1
This commit is contained in:
@ -3,9 +3,9 @@
|
|||||||
<!-- <view :style="{ height: ststuaBarHeight + 'px' }"></view> -->
|
<!-- <view :style="{ height: ststuaBarHeight + 'px' }"></view> -->
|
||||||
<view
|
<view
|
||||||
class="flex-row-center nav-title ali-puhui-bold"
|
class="flex-row-center nav-title ali-puhui-bold"
|
||||||
:style="{ height: menuButtonHeight + 'px' }"
|
style="height:120px;"
|
||||||
>
|
>
|
||||||
{{ title }}
|
<text style="margin-top:35px;">{{ title }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -86,7 +86,8 @@
|
|||||||
"usingComponents" : true
|
"usingComponents" : true
|
||||||
},
|
},
|
||||||
"mp-toutiao" : {
|
"mp-toutiao" : {
|
||||||
"usingComponents" : true
|
"usingComponents" : true,
|
||||||
|
"appid" : "tte57093cd7a7fbf2401"
|
||||||
},
|
},
|
||||||
"mp-qq" : {
|
"mp-qq" : {
|
||||||
"usingComponents" : true
|
"usingComponents" : true
|
||||||
|
|||||||
@ -2,12 +2,12 @@
|
|||||||
<view class="flex-column-start category-container">
|
<view class="flex-column-start category-container">
|
||||||
<!-- 自定义导航栏 -->
|
<!-- 自定义导航栏 -->
|
||||||
<view class="custom-navbar">
|
<view class="custom-navbar">
|
||||||
<view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
|
<view class="status-bar" style="height:60px;"></view>
|
||||||
<view class="navbar-content">
|
<view class="navbar-content">
|
||||||
<view class="back-btn" @click="handleBack">
|
<view class="back-btn" @click="handleBack">
|
||||||
<view class="back-icon"></view>
|
<view class="back-icon"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="search-input-wrapper" :style="{ width: searchInputWidth + 'rpx' }">
|
<view class="search-input-wrapper" style="width:80%;">
|
||||||
<input class="search-input" type="text" placeholder="搜索商品" v-model="searchKeyword"
|
<input class="search-input" type="text" placeholder="搜索商品" v-model="searchKeyword"
|
||||||
@confirm="handleSearch" @focus="handleSearchFocus" />
|
@confirm="handleSearch" @focus="handleSearchFocus" />
|
||||||
</view>
|
</view>
|
||||||
@ -406,6 +406,7 @@ export default {
|
|||||||
padding: 0 32rpx;
|
padding: 0 32rpx;
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
|
||||||
.back-btn {
|
.back-btn {
|
||||||
width: 60rpx;
|
width: 60rpx;
|
||||||
@ -504,7 +505,7 @@ export default {
|
|||||||
.category-content {
|
.category-content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding-top: 50rpx;
|
padding-top: 90rpx;
|
||||||
|
|
||||||
// 左侧:一级分类列表
|
// 左侧:一级分类列表
|
||||||
.category-list-left {
|
.category-list-left {
|
||||||
|
|||||||
@ -44,7 +44,7 @@
|
|||||||
<view class="goods-content">
|
<view class="goods-content">
|
||||||
<view class="goods-row-first">
|
<view class="goods-row-first">
|
||||||
<view class="goods-name">{{ item.item_name || item.product_name }}</view>
|
<view class="goods-name">{{ item.item_name || item.product_name }}</view>
|
||||||
<text class="goods-price">¥{{ item.product_price }}</text>
|
<text class="goods-price">¥{{ item.product_price || item.goods_price }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-row-second">
|
<view class="goods-row-second">
|
||||||
<!-- <view class="goods-spec">
|
<!-- <view class="goods-spec">
|
||||||
@ -297,7 +297,7 @@
|
|||||||
const eventChannel = this.getOpenerEventChannel();
|
const eventChannel = this.getOpenerEventChannel();
|
||||||
eventChannel.on("createOrder", (data) => {
|
eventChannel.on("createOrder", (data) => {
|
||||||
this.orderData = data?.goodList || [];
|
this.orderData = data?.goodList || [];
|
||||||
this.payPrice = (data?.goodList || []).reduce((sum, item) => sum + Number(item.product_price * item.number || 0), 0);
|
this.payPrice = (data?.goodList || []).reduce((sum, item) => sum + Number( (item.product_price || item.goods_price ) * item.number || 0), 0);
|
||||||
console.log(data,'--=?')
|
console.log(data,'--=?')
|
||||||
const price = this.orderData.reduce(
|
const price = this.orderData.reduce(
|
||||||
(total, prev) => total + +prev.item_price,
|
(total, prev) => total + +prev.item_price,
|
||||||
@ -383,7 +383,7 @@
|
|||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// console.log(this.orderData,'--=?')
|
|
||||||
const item = {
|
const item = {
|
||||||
product_id:this.orderData[0].id,
|
product_id:this.orderData[0].id,
|
||||||
price_id:this.orderData[0].prices[0].id,
|
price_id:this.orderData[0].prices[0].id,
|
||||||
@ -393,10 +393,11 @@
|
|||||||
number:this.orderData[0].number,
|
number:this.orderData[0].number,
|
||||||
product_price:this.orderData[0].prices[0].actual_price
|
product_price:this.orderData[0].prices[0].actual_price
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
createCartOrder({
|
createCartOrder({
|
||||||
type:this.sliverInfo.id,
|
type:this.sliverInfo.id,
|
||||||
original_price:this.orderData[0].prices[0].original_price, //付款金额
|
original_price:this.orderData[0].original_price, //付款金额
|
||||||
actual_price:this.payPrice + '', //付款金额
|
actual_price:this.payPrice + '', //付款金额
|
||||||
reduction_amount:'0',
|
reduction_amount:'0',
|
||||||
pay_amount:this.payPrice +'', //付款金额
|
pay_amount:this.payPrice +'', //付款金额
|
||||||
@ -533,7 +534,7 @@
|
|||||||
|
|
||||||
createCartOrder({
|
createCartOrder({
|
||||||
type:this.sliverInfo.id,
|
type:this.sliverInfo.id,
|
||||||
original_price:this.orderData[0].prices[0].original_price, //付款金额
|
original_price:this.orderData[0].original_price, //付款金额
|
||||||
actual_price:this.payPrice + '', //付款金额
|
actual_price:this.payPrice + '', //付款金额
|
||||||
reduction_amount:'0',
|
reduction_amount:'0',
|
||||||
pay_amount:this.payPrice + '', //付款金额
|
pay_amount:this.payPrice + '', //付款金额
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
<view class="edit-form">
|
<view class="edit-form">
|
||||||
<form-cell title="宠物头像" type="custom" :showRightArrow="false">
|
<form-cell title="宠物头像" type="custom" :showRightArrow="false">
|
||||||
<view class="uploadImgWrapper" slot="right">
|
<view class="uploadImgWrapper" slot="right">
|
||||||
<button class="upload-btn" open-type="chooseAvatar" @chooseavatar="changeAvator">
|
<button class="upload-btn" @click="changeAvator">
|
||||||
<image v-if="recordInfo.avatar" class="uploaded-img" :src="recordInfo.avatar"
|
<image v-if="recordInfo.avatar" class="uploaded-img" :src="recordInfo.avatar"
|
||||||
mode="aspectFill" />
|
mode="aspectFill" />
|
||||||
<image v-else :src="`${imgPrefix}record-cameraImg.png`" class="img" />
|
<image v-else :src="`${imgPrefix}record-cameraImg.png`" class="img" />
|
||||||
@ -255,26 +255,43 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
moment,
|
moment,
|
||||||
// 更新头像
|
// 更新头像
|
||||||
async changeAvator(e) {
|
changeAvator() {
|
||||||
const {
|
let that = this
|
||||||
avatarUrl
|
// const {
|
||||||
} = e.detail;
|
// avatarUrl
|
||||||
|
// } = e.detail;
|
||||||
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "上传中..."
|
title: "上传中..."
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { url, objectKey } = await uploadImageToOSS_PUT(avatarUrl);
|
tt.chooseImage({
|
||||||
console.log(url, objectKey, 'url, objectKey');
|
count: 1, // 最多可选图片数量,默认为9
|
||||||
this.recordInfo.avatar = url; // 完整URL
|
sourceType: ['album', 'camera'], // 来源:相册、相机或两者都有
|
||||||
this.recordInfo.chongwu_pic = objectKey; // 对象键
|
success : async function(res) {
|
||||||
this.$forceUpdate();
|
const { url, objectKey } = await uploadImageToOSS_PUT(res.tempFilePaths[0]);
|
||||||
|
// console.log(url, objectKey, 'url, objectKey');
|
||||||
|
that.recordInfo.avatar = url; // 完整URL
|
||||||
|
that.recordInfo.chongwu_pic = objectKey; // 对象键
|
||||||
|
that.$forceUpdate();
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "上传成功",
|
title: "上传成功",
|
||||||
icon: "success",
|
icon: "success",
|
||||||
});
|
});
|
||||||
|
// 调用成功,res.tempFilePaths 为图片本地路径数组
|
||||||
|
// console.log('选中的图片路径:', res.tempFilePaths);
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
// 调用失败,例如用户取消、未授权或参数错误
|
||||||
|
console.log('选择图片失败:', err.errMsg);
|
||||||
|
},
|
||||||
|
complete: function() {
|
||||||
|
// 无论成功或失败都会执行
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('头像上传失败:', error);
|
console.error('头像上传失败:', error);
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
@ -299,7 +316,6 @@ export default {
|
|||||||
changeHair(value) {
|
changeHair(value) {
|
||||||
this.recordInfo.hair = value;
|
this.recordInfo.hair = value;
|
||||||
this.recordInfo.weight_id = "";
|
this.recordInfo.weight_id = "";
|
||||||
this.getRecordWeightList();
|
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
},
|
},
|
||||||
onBreedChange(val) {
|
onBreedChange(val) {
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="flex-column-start shop-container">
|
<view class="flex-column-start shop-container">
|
||||||
<view class="shop-header">
|
<view class="shop-header">
|
||||||
<view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
|
<view class="status-bar" style="height:54px;"></view>
|
||||||
<view class="header-content">
|
<view class="header-content">
|
||||||
<view class="search-bar" :style="{ width: searchBarWidth + 'rpx' }" @click="jumpToSearch">
|
<view class="search-bar" @click="jumpToSearch">
|
||||||
<text class="search-icon">🔍</text>
|
<text class="search-icon">🔍</text>
|
||||||
<text class="search-placeholder">猫猫主粮</text>
|
<text class="search-placeholder">猫猫主粮</text>
|
||||||
</view>
|
</view>
|
||||||
@ -29,7 +29,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view class="shop-content" :style="{ paddingTop: headerHeight + 'rpx' }" scroll-y
|
<scroll-view class="shop-content" style="padding-top:141px;" scroll-y
|
||||||
:refresher-enabled="true" :refresher-triggered="refreshTriggered" @refresherrefresh="onRefresh"
|
:refresher-enabled="true" :refresher-triggered="refreshTriggered" @refresherrefresh="onRefresh"
|
||||||
@scrolltolower="onLoadMore">
|
@scrolltolower="onLoadMore">
|
||||||
<view>
|
<view>
|
||||||
|
|||||||
Reference in New Issue
Block a user