运营商-查看客户;用户头像及昵称修改;
This commit is contained in:
parent
3918dc9fbf
commit
02c8760497
|
|
@ -11,9 +11,9 @@ export default {
|
||||||
title: '加载中'
|
title: '加载中'
|
||||||
})
|
})
|
||||||
// request 触发前拼接 url
|
// 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://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]') {
|
if (args.data && Object.prototype && Object.prototype.toString.call(args.data) === '[object Object]') {
|
||||||
args.data.deptId = globalData.deptId;
|
args.data.deptId = globalData.deptId;
|
||||||
args.data.from = globalData.from;
|
args.data.from = globalData.from;
|
||||||
|
|
@ -122,6 +122,7 @@ export default {
|
||||||
let userInfo = await wx.getUserProfile({
|
let userInfo = await wx.getUserProfile({
|
||||||
desc: '用于小程序登录'
|
desc: '用于小程序登录'
|
||||||
});
|
});
|
||||||
|
console.log(userInfo)
|
||||||
// 获取微信登录凭证
|
// 获取微信登录凭证
|
||||||
const wxLoginRes = await wx.login();
|
const wxLoginRes = await wx.login();
|
||||||
// 获取openid
|
// 获取openid
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,7 @@
|
||||||
<view class="cu-modal" :class="isShow?'show':''">
|
<view class="cu-modal" :class="isShow?'show':''">
|
||||||
<view class="cu-dialog">
|
<view class="cu-dialog">
|
||||||
<view class="padding-xl text-left">
|
<view class="padding-xl text-left">
|
||||||
<view>需先授权微信登录才可正常使用功能,小程序将获取并使用以下信息:</view>
|
<view>需先授权微信登录才可正常使用功能</view>
|
||||||
<view>1.微信昵称</view>
|
|
||||||
<view>2.微信头像</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-bar bg-white">
|
<view class="cu-bar bg-white">
|
||||||
<navigator class="modal-bottom-oper margin-0 flex-sub text-black" open-type="exit" target="miniProgram">拒绝授权
|
<navigator class="modal-bottom-oper margin-0 flex-sub text-black" open-type="exit" target="miniProgram">拒绝授权
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@
|
||||||
}, {
|
}, {
|
||||||
"root": "pages/my/",
|
"root": "pages/my/",
|
||||||
"pages": [{
|
"pages": [{
|
||||||
|
"path": "edit-user-basic-info"
|
||||||
|
}, {
|
||||||
"path": "my-order"
|
"path": "my-order"
|
||||||
}, {
|
}, {
|
||||||
"path": "my-cart"
|
"path": "my-cart"
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@
|
||||||
<view class="padding bg-gradual-color" :style="'padding-top: ' + pageContentTop + 'px; padding-bottom: 100rpx;'">
|
<view class="padding bg-gradual-color" :style="'padding-top: ' + pageContentTop + 'px; padding-bottom: 100rpx;'">
|
||||||
<view class="flex justify-start padding-bottom-xl">
|
<view class="flex justify-start padding-bottom-xl">
|
||||||
<view class="cu-avatar round"
|
<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="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 class="padding-xs text-sm">
|
||||||
<view v-if="myInfo.vipInfo.isVip" class='cu-tag bg-yellow radius'>{{myInfo.vipInfo.level}}会员
|
<view v-if="myInfo.vipInfo.isVip" class='cu-tag bg-yellow radius'>{{myInfo.vipInfo.level}}会员
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -360,6 +361,9 @@
|
||||||
appShareQrcodeModal: false
|
appShareQrcodeModal: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
this.loadData();
|
||||||
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
this.loadData();
|
this.loadData();
|
||||||
},
|
},
|
||||||
|
|
@ -369,6 +373,11 @@
|
||||||
this.curUserInfo = this.$request.getCurUserInfo();
|
this.curUserInfo = this.$request.getCurUserInfo();
|
||||||
this.myInfo = await this.$api.data('myInfo');
|
this.myInfo = await this.$api.data('myInfo');
|
||||||
},
|
},
|
||||||
|
getWxUserBasicInfo() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/my/edit-user-basic-info'
|
||||||
|
})
|
||||||
|
},
|
||||||
showMyOrders(tabHeaderList, tabCur, orderType) {
|
showMyOrders(tabHeaderList, tabCur, orderType) {
|
||||||
let tabInfo = {
|
let tabInfo = {
|
||||||
orderType: orderType,
|
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',
|
code: 'showTeamMembers',
|
||||||
name: '查看团队'
|
name: '查看团队'
|
||||||
}, {
|
}, {
|
||||||
code: '',
|
code: 'showCustomers',
|
||||||
name: '查看客户'
|
name: '查看客户'
|
||||||
}, {
|
}, {
|
||||||
code: '',
|
code: '',
|
||||||
|
|
@ -222,9 +222,13 @@
|
||||||
break;
|
break;
|
||||||
case 'showTeamMembers':
|
case 'showTeamMembers':
|
||||||
uni.navigateTo({
|
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:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,14 +69,18 @@
|
||||||
members: [],
|
members: [],
|
||||||
curUserInfo: {},
|
curUserInfo: {},
|
||||||
pageNum: 0,
|
pageNum: 0,
|
||||||
pageSize: 0
|
pageSize: 0,
|
||||||
|
placeStatus: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(option) {
|
||||||
this.loadData();
|
this.loadData(option);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loadData() {
|
async loadData(option) {
|
||||||
|
if (option && option.placeStatus != undefined) {
|
||||||
|
this.placeStatus = this.option.placeStatus
|
||||||
|
}
|
||||||
this.curUserInfo = this.$request.getCurUserInfo();
|
this.curUserInfo = this.$request.getCurUserInfo();
|
||||||
this.resetData();
|
this.resetData();
|
||||||
// this.myOperaMembers = await this.$api.data('myOperaMembers');
|
// this.myOperaMembers = await this.$api.data('myOperaMembers');
|
||||||
|
|
@ -96,7 +100,9 @@
|
||||||
params.pageSize = this.pageSize;
|
params.pageSize = this.pageSize;
|
||||||
params.customerPlace = this.curUserInfo.customerId;
|
params.customerPlace = this.curUserInfo.customerId;
|
||||||
params.isDistributor = true;
|
params.isDistributor = true;
|
||||||
params.placeStatus = 2;
|
if (this.placeStatus != null && this.placeStatus != undefined) {
|
||||||
|
params.placeStatus = this.placeStatus;
|
||||||
|
}
|
||||||
params.status = 0;
|
params.status = 0;
|
||||||
this.$refs.loadStatusBar.showLoading();
|
this.$refs.loadStatusBar.showLoading();
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue