微信头像上传

version/0412
shuxiaoquan 9 months ago
parent 31bfc9a177
commit 334106d4c3
  1. 3
      pages/goods/components/setPrice.vue
  2. 33
      pages/news1/setting.vue

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

@ -5,8 +5,13 @@
<view class="name-text">
头像
</view>
<image @click="chooseImage()" :src="info.avatar_url ? info.avatar_url : '/static/default-logo.png'"
<view class="avatar">
<image :src="info.avatar_url ? info.avatar_url : '/static/default-logo.png'"
class="image_logo"></image>
<button open-type="chooseAvatar" @chooseavatar="chooseavatar"></button>
</view>
<!-- <image @click="chooseImage()" :src="info.avatar_url ? info.avatar_url : '/static/default-logo.png'"
class="image_logo"></image> -->
</view>
<view class="box-avter conten-height">
<view class="name-text">
@ -100,6 +105,17 @@ export default {
this.genderIndex = this.info.gender == '男' ? 0 : 1
},
methods: {
chooseavatar(e){
console.log(e)
let tempFiles = e.detail.avatarUrl;
this.info.avatar_url = tempFiles
this.imageList = this.imageList.concat([
{
path: tempFiles
}
])
this.uploadFile()
},
sureSubmit() {
let params = {
nick_name: this.info.nick_name,
@ -265,7 +281,20 @@ page {
font-size: 28rpx;
color: #303030;
}
.avatar{
width: 114rpx;
height: 114rpx;
position: relative;
}
.avatar button{
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 2;
opacity: 0;
}
.image_logo {
width: 114rpx;
height: 114rpx;

Loading…
Cancel
Save