修复店务预约与小程序生产问题
This commit is contained in:
@@ -2,7 +2,7 @@ const { BRAND_CONFIG } = require('../../utils/config')
|
||||
const userApi = require('../../api/user')
|
||||
const authApi = require('../../api/auth')
|
||||
const auth = require('../../utils/auth')
|
||||
const { chooseImageFilePath, uploadProfileImage } = require('../../utils/upload')
|
||||
const { chooseImageFilePath, uploadAvatar } = require('../../utils/upload')
|
||||
|
||||
function resolveRoleText(type) {
|
||||
const role = Number(type)
|
||||
@@ -184,8 +184,13 @@ Page({
|
||||
return
|
||||
}
|
||||
this.setData({ avatarUploading: true })
|
||||
const avatar = await uploadProfileImage(filePath)
|
||||
this.setData({ 'profileForm.avatar': avatar })
|
||||
const avatar = await uploadAvatar(filePath)
|
||||
const profile = await userApi.info()
|
||||
this.syncProfileToSession({
|
||||
...profile,
|
||||
avatar: profile.avatar || avatar
|
||||
})
|
||||
this.setData({ 'profileForm.avatar': profile.avatar || avatar })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '头像上传失败', icon: 'none' })
|
||||
} finally {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
<view class="page">
|
||||
<view class="card profile-card">
|
||||
<view class="profile-main">
|
||||
<view class="shop-logo">指</view>
|
||||
<view wx:if="{{userInfo.avatar}}" class="shop-logo image-avatar">
|
||||
<image src="{{userInfo.avatar}}" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view wx:else class="shop-logo">指</view>
|
||||
<view class="profile-copy">
|
||||
<text class="shop-name">{{shopName}}</text>
|
||||
<text class="phone">{{phone}}</text>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
flex-shrink: 0;
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
overflow: hidden;
|
||||
border-radius: 24rpx;
|
||||
background: #6f8f83;
|
||||
color: #fff;
|
||||
@@ -31,6 +32,11 @@
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.shop-logo image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.shop-name,
|
||||
.phone {
|
||||
display: block;
|
||||
|
||||
Reference in New Issue
Block a user