|
@@ -2,7 +2,7 @@
|
|
|
<view class="content">
|
|
|
<view class="content1 flex-between relative flex">
|
|
|
<view class="user flex">
|
|
|
- <image :src="userInfo.head" mode="widthFix" class="img" @click="editHead"></image>
|
|
|
+ <image :src="userInfo.head?userInfo.head:'../../static/imgs/mySet/head.png'" mode="widthFix" class="img" @click="editHead"></image>
|
|
|
<view class="name">
|
|
|
{{userInfo.nickname}}
|
|
|
</view>
|
|
@@ -117,10 +117,29 @@
|
|
|
|
|
|
onLoad() {
|
|
|
that = this
|
|
|
- if (uni.getStorageSync("userInfo").phone) {
|
|
|
- this.userInfo = uni.getStorageSync("userInfo")
|
|
|
+ this.userInfo = uni.getStorageSync("userInfo")
|
|
|
+ if(!this.userInfo.nickname){
|
|
|
+ let code = ""
|
|
|
+ for(var i=0;i<6;i++){
|
|
|
+ code += parseInt(Math.random()*10);
|
|
|
+ }
|
|
|
+ this.userInfo.nickname = 'user'+code
|
|
|
+ this.$request.baseRequest('commonUserApp', 'edit', {
|
|
|
+ commonUserInfo: JSON.stringify(this.userInfo)
|
|
|
+ }, failres => {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: failres.errmsg,
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ }).then(res => {
|
|
|
+ this.userInfo = res.data
|
|
|
+ uni.setStorageSync("userInfo", this.userInfo)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (this.userInfo.phone) {
|
|
|
this.$request.baseRequest('admin.unimall.cardManagementInfo', 'list', {
|
|
|
- commonId: uni.getStorageSync("userInfo").id
|
|
|
+ commonId: this.userInfo.id
|
|
|
}, failres => {
|
|
|
this.$refs.uToast.show({
|
|
|
type: 'error',
|