|
@@ -1,30 +1,31 @@
|
|
|
<template>
|
|
|
<view class="business-card">
|
|
|
<view class="select-item" @click.native="showActionSheet = true">
|
|
|
- <view class="select-title">
|
|
|
- 头像
|
|
|
- </view>
|
|
|
+ <view class="select-title">头像</view>
|
|
|
<view class="select-content">
|
|
|
- <image class="aov" src="../../../static/icon-user@3x.png" mode=""></image>
|
|
|
+ <image
|
|
|
+ class="aov"
|
|
|
+ :src="info.image || 'https://static.caimei365.com/app/img/icon/default-head.png'"
|
|
|
+ mode=""
|
|
|
+ ></image>
|
|
|
<text class="cell-more iconfont icon-xiayibu"></text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="select-item" @click.native="$api.navigateTo('/pages/seller/remarks/mine-qrcode')">
|
|
|
- <view class="select-title">
|
|
|
- 二维码
|
|
|
- </view>
|
|
|
+ <view class="select-title">二维码</view>
|
|
|
<view class="select-content">
|
|
|
- <image class="aov" src="../../../static/icon-user@3x.png" mode=""></image>
|
|
|
+ <image class="aov" :src="info.qrcode" mode="" v-if="info.qrcode"></image>
|
|
|
+ <text v-else>无</text>
|
|
|
<text class="cell-more iconfont icon-xiayibu"></text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <tui-actionsheet
|
|
|
- :show="showActionSheet"
|
|
|
- :item-list="itemList"
|
|
|
- @click="itemClick"
|
|
|
- :isCancel="fasle"
|
|
|
- @cancel="closeActionSheet">
|
|
|
- </tui-actionsheet>
|
|
|
+ <tui-actionsheet
|
|
|
+ :show="showActionSheet"
|
|
|
+ :item-list="itemList"
|
|
|
+ @click="itemClick"
|
|
|
+ :isCancel="fasle"
|
|
|
+ @cancel="closeActionSheet"
|
|
|
+ ></tui-actionsheet>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -33,32 +34,51 @@ import { uploadFileImage } from '@/services/public.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- userInfo: {
|
|
|
- photo: ''
|
|
|
- },
|
|
|
+ userInfo: {},
|
|
|
showActionSheet: false,
|
|
|
- itemList: [{
|
|
|
- text: '手机相册',
|
|
|
- },
|
|
|
- {
|
|
|
- text: '取消',
|
|
|
- }],
|
|
|
+ itemList: [
|
|
|
+ {
|
|
|
+ text: '手机相册'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '取消'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ info: {}
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.userInfo = uni.getStorageSync('userInfo')
|
|
|
+ this.getUserInfo()
|
|
|
+ },
|
|
|
methods: {
|
|
|
itemClick(e) {
|
|
|
if (e.index === 1) {
|
|
|
return (this.showActionSheet = false)
|
|
|
} else {
|
|
|
uploadFileImage().then(res => {
|
|
|
- this.userInfo.photo = JSON.parse(res.data).data
|
|
|
- this.showActionSheet = false
|
|
|
+ this.$util.msg('请稍后')
|
|
|
+ const img = JSON.parse(res.data).data
|
|
|
+ if (!img) return this.$util.msg('图片上传失败')
|
|
|
+ this.SellerService.updateSellerInfo({
|
|
|
+ userId: this.userInfo.userId,
|
|
|
+ image: img,
|
|
|
+ qrcode: this.userInfo.qrcode || ''
|
|
|
+ }).then(res => {
|
|
|
+ this.getUserInfo()
|
|
|
+ this.showActionSheet = false
|
|
|
+ this.$util.msg('上传成功')
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
closeActionSheet() {
|
|
|
this.showActionSheet = false
|
|
|
},
|
|
|
+ async getUserInfo() {
|
|
|
+ const { data } = await this.SellerService.GetSellerHome({ userId: this.userInfo.userId })
|
|
|
+ this.info = data
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -72,7 +92,7 @@ export default {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
height: 100rpx;
|
|
|
- border-bottom: 1rpx solid #E1E1E1;
|
|
|
+ border-bottom: 1rpx solid #e1e1e1;
|
|
|
margin-top: 30rpx;
|
|
|
position: relative;
|
|
|
.select-title {
|
|
@@ -105,4 +125,4 @@ export default {
|
|
|
padding-right: 10rpx;
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|