运营商-查看客户;用户头像及昵称修改;
This commit is contained in:
parent
3918dc9fbf
commit
02c8760497
|
|
@ -11,9 +11,9 @@ export default {
|
|||
title: '加载中'
|
||||
})
|
||||
// request 触发前拼接 url
|
||||
// args.url = 'https://www.opsoul.com:8881' + args.url;
|
||||
args.url = 'https://www.opsoul.com:8881' + args.url;
|
||||
// args.url = 'http://192.168.2.60:80' + args.url;
|
||||
args.url = 'http://127.0.0.1:80' + args.url;
|
||||
// args.url = 'http://127.0.0.1:80' + args.url;
|
||||
if (args.data && Object.prototype && Object.prototype.toString.call(args.data) === '[object Object]') {
|
||||
args.data.deptId = globalData.deptId;
|
||||
args.data.from = globalData.from;
|
||||
|
|
@ -121,7 +121,8 @@ export default {
|
|||
async login() {
|
||||
let userInfo = await wx.getUserProfile({
|
||||
desc: '用于小程序登录'
|
||||
});
|
||||
});
|
||||
console.log(userInfo)
|
||||
// 获取微信登录凭证
|
||||
const wxLoginRes = await wx.login();
|
||||
// 获取openid
|
||||
|
|
|
|||
|
|
@ -4,9 +4,7 @@
|
|||
<view class="cu-modal" :class="isShow?'show':''">
|
||||
<view class="cu-dialog">
|
||||
<view class="padding-xl text-left">
|
||||
<view>需先授权微信登录才可正常使用功能,小程序将获取并使用以下信息:</view>
|
||||
<view>1.微信昵称</view>
|
||||
<view>2.微信头像</view>
|
||||
<view>需先授权微信登录才可正常使用功能</view>
|
||||
</view>
|
||||
<view class="cu-bar bg-white">
|
||||
<navigator class="modal-bottom-oper margin-0 flex-sub text-black" open-type="exit" target="miniProgram">拒绝授权
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@
|
|||
}]
|
||||
}, {
|
||||
"root": "pages/my/",
|
||||
"pages": [{
|
||||
"pages": [{
|
||||
"path": "edit-user-basic-info"
|
||||
}, {
|
||||
"path": "my-order"
|
||||
}, {
|
||||
"path": "my-cart"
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@
|
|||
<view class="padding bg-gradual-color" :style="'padding-top: ' + pageContentTop + 'px; padding-bottom: 100rpx;'">
|
||||
<view class="flex justify-start padding-bottom-xl">
|
||||
<view class="cu-avatar round"
|
||||
:style="'width: 120rpx; height: 120rpx; background-image:url(' + curUserInfo.customerLogoUrl + ');'"></view>
|
||||
:style="'width: 120rpx; height: 120rpx; background-image:url(' + curUserInfo.customerLogoUrl + ');'"
|
||||
@click="getWxUserBasicInfo"></view>
|
||||
<view class="margin-lr-sm">
|
||||
<view class="text-xl margin-bottom-xs">{{curUserInfo.name}}</view>
|
||||
<view class="text-xl margin-bottom-xs" @click="getWxUserBasicInfo">{{curUserInfo.name}}</view>
|
||||
<view class="padding-xs text-sm">
|
||||
<view v-if="myInfo.vipInfo.isVip" class='cu-tag bg-yellow radius'>{{myInfo.vipInfo.level}}会员
|
||||
</view>
|
||||
|
|
@ -359,6 +360,9 @@
|
|||
appQrcode: '',
|
||||
appShareQrcodeModal: false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.loadData();
|
||||
},
|
||||
onReady() {
|
||||
this.loadData();
|
||||
|
|
@ -369,6 +373,11 @@
|
|||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
this.myInfo = await this.$api.data('myInfo');
|
||||
},
|
||||
getWxUserBasicInfo() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/edit-user-basic-info'
|
||||
})
|
||||
},
|
||||
showMyOrders(tabHeaderList, tabCur, orderType) {
|
||||
let tabInfo = {
|
||||
orderType: orderType,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
<template>
|
||||
<view class="bg-white">
|
||||
<!-- 顶部操作条 -->
|
||||
<cu-custom :bgColor="'bg-main-color'" :isBack="true">
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">头像及昵称修改</block>
|
||||
</cu-custom>
|
||||
<view class="margin-top-lg margin-lr">
|
||||
<view class="text-center padding-tb-lg">
|
||||
<button class="cu-avatar round"
|
||||
:style="'width: 120rpx; height: 120rpx; background-image:url(' + avatarUrl + ');'"
|
||||
open-type="chooseAvatar" @chooseavatar="onChooseAvatar"></button>
|
||||
</view>
|
||||
<!-- <button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
|
||||
<image class="avatar" :src="{{avatarUrl}}"></image>
|
||||
</button> -->
|
||||
<form @submit="submit">
|
||||
<view class="cu-form-group">
|
||||
<view class="title">昵称</view>
|
||||
<input type="nickname" name="nickname" v-model="nickname" placeholder="请输入昵称"></input>
|
||||
</view>
|
||||
<view class="padding-tb">
|
||||
<button class="bg-main-color long-btn cu-btn shadow-blur radius" form-type="submit">提交</button>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
onLoad() {
|
||||
this.loadCurBasicInfo();
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
curUserInfo: {},
|
||||
avatarUrl: "",
|
||||
nickname: ""
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadCurBasicInfo() {
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
this.avatarUrl = this.curUserInfo.customerLogoUrl;
|
||||
this.nickname = this.curUserInfo.name;
|
||||
},
|
||||
onChooseAvatar(e) {
|
||||
this.$request.uploadFile(e.detail.avatarUrl).then((url) => {
|
||||
this.avatarUrl = url;
|
||||
});
|
||||
},
|
||||
async submit(e) {
|
||||
let res = await this.$request.updateUser({
|
||||
customerId: this.curUserInfo.customerId,
|
||||
name: e.detail.value.nickname,
|
||||
customerLogoUrl: this.avatarUrl
|
||||
})
|
||||
if (res && res.code === 0) {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
title: '更新成功'
|
||||
})
|
||||
let timeout = setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/index?menuCode=myPage'
|
||||
})
|
||||
clearTimeout(timeout);
|
||||
}, 1500);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -151,7 +151,7 @@
|
|||
code: 'showTeamMembers',
|
||||
name: '查看团队'
|
||||
}, {
|
||||
code: '',
|
||||
code: 'showCustomers',
|
||||
name: '查看客户'
|
||||
}, {
|
||||
code: '',
|
||||
|
|
@ -222,9 +222,13 @@
|
|||
break;
|
||||
case 'showTeamMembers':
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/my-team-member'
|
||||
url: '/pages/my/my-team-member?placeStatus=2'
|
||||
})
|
||||
break;
|
||||
break;
|
||||
case 'showCustomers':
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/my-team-member'
|
||||
})
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,14 +69,18 @@
|
|||
members: [],
|
||||
curUserInfo: {},
|
||||
pageNum: 0,
|
||||
pageSize: 0
|
||||
pageSize: 0,
|
||||
placeStatus: null
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.loadData();
|
||||
onLoad(option) {
|
||||
this.loadData(option);
|
||||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
async loadData(option) {
|
||||
if (option && option.placeStatus != undefined) {
|
||||
this.placeStatus = this.option.placeStatus
|
||||
}
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
this.resetData();
|
||||
// this.myOperaMembers = await this.$api.data('myOperaMembers');
|
||||
|
|
@ -96,7 +100,9 @@
|
|||
params.pageSize = this.pageSize;
|
||||
params.customerPlace = this.curUserInfo.customerId;
|
||||
params.isDistributor = true;
|
||||
params.placeStatus = 2;
|
||||
if (this.placeStatus != null && this.placeStatus != undefined) {
|
||||
params.placeStatus = this.placeStatus;
|
||||
}
|
||||
params.status = 0;
|
||||
this.$refs.loadStatusBar.showLoading();
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in New Issue