1
This commit is contained in:
@ -22,7 +22,7 @@
|
|||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="buy-now-btn-wrapper" @click.stop="handleBuyNow">
|
<view class="buy-now-btn-wrapper" @click.stop="handleBuyNow">
|
||||||
<text class="buy-now-btn">立即购买</text>
|
<text class="buy-now-btn">立即购买1</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -397,7 +397,7 @@ export default {
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
margin-top: 40rpx;
|
margin-top: 50rpx;
|
||||||
|
|
||||||
.goods-list-item {
|
.goods-list-item {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|||||||
@ -464,7 +464,7 @@ title: '请添加客服号',
|
|||||||
width: calc(100vw - 40rpx);
|
width: calc(100vw - 40rpx);
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
margin-top: 20rpx;
|
margin-top:46rpx;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
margin-bottom: 26rpx;
|
margin-bottom: 26rpx;
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<view class="edit-content">
|
<view class="edit-content">
|
||||||
<view class="flex-row-between edit-cell">
|
<view class="flex-row-between edit-cell">
|
||||||
<text class="title">头像</text>
|
<text class="title">头像</text>
|
||||||
<button class="flex-row-end user-avator" open-type="chooseAvatar" @chooseavatar="chooseavatar">
|
<button class="flex-row-end user-avator" @click="chooseavatar">
|
||||||
<image class="avator-icon" :src="userInfo.head_pic_url" />
|
<image class="avator-icon" :src="userInfo.head_pic_url" />
|
||||||
<!-- <image class="arrow-icon" :src="`${imgPrefix}right-arrow.png`" /> -->
|
<!-- <image class="arrow-icon" :src="`${imgPrefix}right-arrow.png`" /> -->
|
||||||
</button>
|
</button>
|
||||||
@ -174,22 +174,27 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 更新头像
|
// 更新头像
|
||||||
async chooseavatar(e) {
|
chooseavatar() {
|
||||||
const {
|
let that = this;
|
||||||
avatarUrl
|
|
||||||
} = e.detail;
|
|
||||||
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "上传中..."
|
title: "上传中..."
|
||||||
});
|
});
|
||||||
|
|
||||||
|
uni.chooseImage({
|
||||||
|
count: 1, // 只选一张图片
|
||||||
|
sourceType: ['album', 'camera'], // 来源:相册、相机
|
||||||
|
success: async function(res) {
|
||||||
try {
|
try {
|
||||||
const { url, objectKey } = await uploadImageToOSS_PUT(avatarUrl);
|
const { url, objectKey } = await uploadImageToOSS_PUT(res.tempFilePaths[0]);
|
||||||
console.log(url, objectKey, 'url, objectKey')
|
that.userInfo.head_pic_url = url; // 同时更新 head_pic_url,因为模板使用的是这个字段
|
||||||
this.userInfo.head_pic_url = url; // 同时更新 head_pic_url,因为模板使用的是这个字段
|
that.userInfo.head_pic = objectKey;
|
||||||
this.userInfo.head_pic = objectKey;
|
that.$forceUpdate();
|
||||||
this.$forceUpdate();
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: "上传成功",
|
||||||
|
icon: "success",
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('头像上传失败:', error);
|
console.error('头像上传失败:', error);
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
@ -199,6 +204,12 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
console.log('选择图片失败:', err.errMsg);
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
onChange(value, key) {
|
onChange(value, key) {
|
||||||
this.userInfo[key] = value;
|
this.userInfo[key] = value;
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="goods-item" >
|
<view class="goods-item" >
|
||||||
<image class="goods-img" :src="getProductImage(data)" mode="aspectFill" />
|
<image @click.stop="handleBuyNow" class="goods-img" :src="getProductImage(data)" mode="aspectFill" />
|
||||||
<view class=" fs-24 app-fc-main goods-name">
|
<view class=" fs-24 app-fc-main goods-name">
|
||||||
{{ data.product.product_name || "" }}
|
{{ data.product.product_name || "" }}
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -643,7 +643,6 @@ export default {
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
margin-top: 40rpx;
|
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
|
|
||||||
.goods-list-item {
|
.goods-list-item {
|
||||||
|
|||||||
Reference in New Issue
Block a user