细节修改 个人中心加获取头像

version/0412
fanfan 9 months ago
parent c5531a1a37
commit 5af8f91886
  1. 9
      pages/goods/components/setPrice.vue
  2. 34
      pages/user/index.vue

@ -7,13 +7,8 @@
</view>
<view class="priceContainer">
<view class="priceCon">
<<<<<<< HEAD
<text>秒杀价</text><input type="text" v-model="secondPrice" class="input" value=""
placeholder="秒杀价格可低于成本价" />
=======
<text>秒杀价</text>
<input type="text" v-model="secondPrice" class="input" placeholder="秒杀价格可低于成本价" />
>>>>>>> 334106d4c315bfefd82a940ba62881c49b6494af
<!-- <text>秒杀价</text><input type="text" v-model="secondPrice" class="input" value=""
placeholder="秒杀价格可低于成本价" /> -->
</view>
<view class="priceTime">
<view class="text">秒杀区间</view>

@ -12,9 +12,10 @@
<view class="image-text_1" v-if="!isLogin" @click="goLogin()">
未登录
</view>
<button class="avatar-wrapper" v-else type="primary" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<button class="avatar-wrapper" v-else type="primary" open-type="chooseAvatar"
@chooseavatar="onChooseAvatar">
<!-- <button class="avatar-wrapper" v-else @click="onChooseAvatar"> -->
<text lines="1" class="text-group_1">{{userInfo.nick_name}}</text>
<text lines="1" class="text-group_1">{{userInfo.nick_name}}3</text>
<image :src="$picUrl+'/static/user/weChat.png'" class="thumbnail_1"></image>
</button>
<view class="text-wrapper_1" v-if="isLogin" @click="wechatLogin">
@ -570,6 +571,7 @@
} from '@/core/app'
import * as UserApi from '@/api/user';
import * as Api from '@/api/goods'
import * as UploadApi from '@/api/upload'
import {
createQrCodeImg
} from '@/utils/qrcode'
@ -616,7 +618,7 @@
let that = this
that.headImgUpload(e.detail.avatarUrl)
},
nickSubmit(avatar_id, nick_name) {
nickSubmit(avatar_id) {
UserApi.editUser({
avatar_id: avatar_id
})
@ -639,14 +641,21 @@
.finally()
},
headImgUpload(avatarUrl) {
//
const that = this
UserApi.wxHeadImgUpload({
headImg: avatarUrl,
checkLogin: 1
const app = this
const imageList=[{path: avatarUrl}]
//
return new Promise((resolve, reject) => {
if (imageList.length > 0) {
UploadApi.image(imageList)
.then(fileIds => {
console.log(fileIds)
app.nickSubmit(fileIds.join(','))
resolve(fileIds)
})
.then(res => {
that.nickSubmit(res.data.fileInfo.file_id)
.catch(reject)
} else {
resolve()
}
})
},
goShopOrderList() {
@ -939,6 +948,7 @@
flex-direction: column;
justify-content: flex-end;
padding-bottom: 30rpx;
.toTop {
position: fixed;
bottom: 30rpx;
@ -1127,10 +1137,12 @@
padding: 0;
margin: 0;
border: none;
::v-ddep uni-button:after {
border: none !important;
}
button[type=primary][plain]{
button[type=primary][plain] {
border: none !important;
}
}

Loading…
Cancel
Save