最新版代码提交

This commit is contained in:
2026-04-13 16:12:25 +08:00
parent 26e57e4891
commit e894689918
5 changed files with 159 additions and 167 deletions

View File

@ -3,8 +3,8 @@ export default {
appName: "Wagoo",
appShareName: "Wagoo",
appId: "wx00e2dcdc7c02b23a",
apiBaseUrl: "https://api.wagoo.me/api/v1", // 服务端测试地址
// apiBaseUrl: "https://api.wagoo.pet/api/v1", // 服务端生产地址
// apiBaseUrl: "https://api.wagoo.me/api/v1", // 服务端测试地址
apiBaseUrl: "https://api.wagoo.pet/api/v1", // 服务端生产地址
// apiBaseUrl: "http:192.168.30.79", //本地接口
tencentMapKey: "WSBBZ-7OXK4-46QUC-KFB7B-4N3W7-M2BXM",
tencentSecret: "vb7D0PGj7xUvmOLuJz2Jd7ykTMpjiWRJ",

View File

@ -200,6 +200,31 @@ export default {
type: 0,
cursor: this.nextCursor
}
// 加载更多时直接请求,不使用缓存
if (this.goodPage > 1) {
getGoodsListData(params)
.then((res) => {
const list = res?.data.data?.products || res?.data || [];
const hasMore = res?.data.data?.has_more;
const nextCursor = res?.data.data?.next_cursor || '';
this.goodsList = [...this.goodsList, ...list];
this.hasMore = hasMore;
this.nextCursor = nextCursor;
this.goodsTotal = res?.count || 0;
})
.catch((err) => {
console.error('获取商品列表失败', err);
})
.finally(() => {
this.isLoadingGoods = false;
this.refreshTriggered = false;
});
return;
}
// 第一页使用缓存
getHomeGoodsWithCache(params, forceRefresh)
.then((res) => {
const list = res?.data.data?.products || res?.data.data || [];
@ -207,13 +232,9 @@ export default {
const nextCursor = res?.data.data?.next_cursor || '';
// 只有当数据有变化时才更新商品列表,避免不必要的刷新
if (this.goodPage === 1) {
if (res.hasChanged !== false || this.goodsList.length === 0) {
this.goodsList = list;
}
} else {
this.goodsList = [...this.goodsList, ...list];
}
this.hasMore = hasMore;
this.nextCursor = nextCursor;

View File

@ -1,19 +1,15 @@
<template>
<view class="flex-row-start info-cell good-info" :class="{'good-info-multi' : data.length > 1}">
<template v-if="data.length === 1">
<view class="good-wrapper">
<image class="good-icon" :src="data[0].product_pic" mode="aspectFill" @click="$emit('clickGoodImg', data[0])" />
<view class="price-section">
<view class="price-left">
<text class="hand-price-tag">到手价</text>
<text class="current-price">¥{{ data[0].goods_price || data[0].product_actual_price }}</text>
<text class="origin-price" v-if="data[0].product_original_price">原价¥{{ data[0].product_original_price }}</text>
<view class="good-content" @click="$emit('clickGoodInfo', data[0])">
<view class="goods-row-first">
<view class="goods-name">{{ data[0].goods_name || "" }}</view>
<view class="fs-28 app-fc-main goods-price">
¥{{ data[0].goods_price || data[0].product_actual_price }}
</view>
<text class="goods-count">已售{{ data[0].number || 1 }}</text>
</view>
<view class="goods-name" @click="$emit('clickGoodInfo', data[0])">
{{ data[0].goods_name || "" }}
</view>
<view class="fs-24 app-fc-normal">{{ data[0].number || 1 }}</view>
</view>
</template>
@ -84,64 +80,43 @@
padding-top: 20rpx;
align-items: flex-start;
.good-wrapper {
width: 100%;
display: flex;
flex-direction: column;
}
.good-icon {
width: 100%;
height: 400rpx;
width: 160rpx;
height: 160rpx;
border-radius: 16rpx;
background: #f5f5f5;
margin-right: 20rpx;
flex-shrink: 0;
}
.price-section {
.good-content {
flex: 1;
height: 160rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
.goods-row-first {
display: flex;
justify-content: space-between;
align-items: baseline;
margin-top: 20rpx;
.price-left {
display: flex;
align-items: baseline;
.hand-price-tag {
font-size: 24rpx;
color: #fff;
background: linear-gradient(135deg, #FF19A0, #FF6B35);
padding: 4rpx 12rpx;
border-radius: 4rpx;
margin-right: 12rpx;
}
.current-price {
font-size: 40rpx;
color: #FF19A0;
font-weight: bold;
}
.origin-price {
font-size: 24rpx;
color: #999;
text-decoration: line-through;
margin-left: 12rpx;
}
}
.goods-count {
font-size: 24rpx;
color: #999;
}
}
align-items: flex-start;
width: 100%;
.goods-name {
font-size: 32rpx;
font-size: 28rpx;
color: #3D3D3D;
line-height: 44rpx;
font-weight: bold;
margin-top: 16rpx;
line-height: 40rpx;
margin-right: 16rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.goods-price {
flex-shrink: 0;
}
}
}
}

View File

@ -32,11 +32,11 @@
</view>
<!-- 图片撑满屏幕宽度 -->
<image
<!-- <image
class="full-width-img"
src="https://static.wagoo.pet/statics/1.png"
mode="widthFix"
/>
/> -->
<image
class="full-width-img"
src="https://static.wagoo.pet/statics/2.png"
@ -47,21 +47,21 @@
src="https://static.wagoo.pet/statics/3.png"
mode="widthFix"
/>
<image
<!-- <image
class="full-width-img"
src="https://static.wagoo.pet/statics/4.png"
mode="widthFix"
/>
<image
/> -->
<!-- <image
class="full-width-img"
src="https://static.wagoo.pet/statics/5.png"
mode="widthFix"
/>
<image
/> -->
<!-- <image
class="full-width-img"
src="https://static.wagoo.pet/statics/6.png"
mode="widthFix"
/>
/> -->
<view class="order-create-container">
<!-- 可拖动联系客服组件 -->
@ -257,7 +257,6 @@ export default {
this.orderPrice = res.data[0].price
// console.log(res,'--=')
})
},
createOrder(isPrePay) {
return new Promise((resolve, reject) => {
@ -270,7 +269,6 @@ export default {
const params = {
id: Number(this.orderData[0].goods_id),
};
createCartOrder(params)
.then((res) => {
if (typeof tt !== "undefined" && tt.requirePlugin) {
@ -325,7 +323,6 @@ export default {
icon: "none",
});
}
resolve();
})
.catch((err) => {

View File

@ -74,7 +74,6 @@
if (data.product_pic) {
return data.product_pic;
}
// Try to parse image_list from attr_key_value_map
if (data.product?.attr_key_value_map?.image_list) {
try {