Compare commits

...

2 Commits

  1. 2
      pages/activity/DargainDetails/index.vue
  2. 42
      pages/user/PersonalData/index.vue

2
pages/activity/DargainDetails/index.vue

@ -261,7 +261,7 @@
<view class="help font-color-red" v-text="'成功帮砍' + bargainHelpPrice + '元'"></view>
您也可以砍价低价拿哦快去挑选心仪的商品吧~
</view>
<button class="tipBnt" open-type="share" v-if="bargainUid === userInfo.uid">邀请好友帮砍价</button>
<button class="tipBnt" open-type="share" v-if="bargainUid === userInfo.uid" @click="close">邀请好友帮砍价</button>
<!-- <view class="tipBnt" @click="goPoster" v-if="bargainUid === userInfo.uid">邀请好友帮砍价</view> -->
<view class="tipBnt" @click="getBargainStart" v-else>我也要参与</view>
</view>

42
pages/user/PersonalData/index.vue

@ -83,7 +83,8 @@
chooseImage
} from "@/utils";
import {
VUE_APP_API_URL
VUE_APP_API_URL,
BXG_TENANT_ID
} from "@/config";
import {
postUserEdit,
@ -192,7 +193,44 @@
});
},
onChooseAvatar(e) {
this.avatar = e.detail.avatarUrl;
uni.getImageInfo({
src: e.detail.avatarUrl,
success: image => {
// console.log(image)
uni.showLoading({ title: '图片上传中', mask: true })
uni.uploadFile({
url: `${VUE_APP_API_URL}/api/upload`,
file: image,
filePath: image.path,
header: {
Authorization: 'Bearer ' + store.getters.token,
'tenant-id': BXG_TENANT_ID
},
name: 'file',
success: res => {
this.avatar = JSON.parse(res.data).data;
console.log('this.avatar', this.avatar)
},
fail: err => {
uni.showToast({
title: '上传图片失败',
icon: 'none',
duration: 2000,
})
},
complete: res => {
uni.hideLoading()
},
})
},
fail: err => {
uni.showToast({
title: '获取图片信息失败',
icon: 'none',
duration: 2000,
})
},
})
},
chooseImage() {
chooseImage((img) => {

Loading…
Cancel
Save