Compare commits

..

7 Commits

Author SHA1 Message Date
赵毅
531a6da611 11 2025-11-12 15:36:50 +08:00
赵毅
3719becda3 优化个人中心样式 2025-11-12 15:30:45 +08:00
赵毅
50a3660621 修改商品详情页购物车数量和购物车页面数量不一致的bug 2025-11-12 14:02:01 +08:00
赵毅
6033edcd50 修改团购列表数据展示的逻辑 2025-11-12 11:15:01 +08:00
赵毅
83b6a1a0c6 修改团购商品详情页样式展示 2025-11-12 10:46:35 +08:00
赵毅
91f1748ba8 优化团购立即秒杀数据展示逻辑 2025-11-12 09:04:27 +08:00
赵毅
da61b6ca53 优化团购 - 商品详情页面代码 2025-11-12 08:51:39 +08:00
5 changed files with 157 additions and 151 deletions

View File

@ -460,11 +460,11 @@ export default {
},
//
getShopCar() {
request(apiArr.getCarCount, "POST", {}).then((res) => {
this.prevCarNum = res.total;
});
},
// getShopCar() {
// request(apiArr.getCarCount, "POST", {}).then((res) => {
// this.prevCarNum = res.total;
// });
// },
getShopCarList() {
return request(apiArr.getCar, "POST", {}).then((res) => {
@ -472,6 +472,7 @@ export default {
this.carOrderList = [].concat(res.same_day_cart_list, res.normal_cart_list)
.flatMap(supplier => supplier.commodity_cart_and_goods_model);
this.carNum = res.total;
this.prevCarNum = res.total;
return res;
});
},
@ -510,7 +511,7 @@ export default {
// update
request(apiArr.updateCar, "POST", params).then((res) => {
that.getShopCar();
// that.getShopCar();
that.getShopCarList();
});
},
@ -548,7 +549,7 @@ export default {
request(apiArr.updateCar, "POST", params).then((res) => {
console.log(res);
this.getShopCarList();
this.getShopCar();
// this.getShopCar();
uni.showToast({
title: "操作成功!",
success() { },
@ -598,7 +599,7 @@ export default {
onShow() {
this.getShopCarList().then(() => {
this.getGoodsInfo();
this.getShopCar();
// this.getShopCar();
this.getComment();
});
},

View File

@ -515,11 +515,11 @@ export default {
},
//
getShopCar() {
request(apiArr.getCarCount, "POST", {}).then((res) => {
this.prevCarNum = res.total;
});
},
// getShopCar() {
// request(apiArr.getCarCount, "POST", {}).then((res) => {
// this.prevCarNum = res.total;
// });
// },
getShopCarList() {
return request(apiArr.getCar, "POST", {}).then((res) => {
@ -527,6 +527,7 @@ export default {
this.carOrderList = [].concat(res.same_day_cart_list, res.normal_cart_list)
.flatMap(supplier => supplier.commodity_cart_and_goods_model);
this.carNum = res.total;
this.prevCarNum = res.total;
return res;
});
},
@ -565,7 +566,7 @@ export default {
// update
request(apiArr.updateCar, "POST", params).then((res) => {
that.getShopCar();
// that.getShopCar();
that.getShopCarList();
});
},
@ -603,7 +604,7 @@ export default {
request(apiArr.updateCar, "POST", params).then((res) => {
console.log(res);
this.getShopCarList();
this.getShopCar();
// this.getShopCar();
uni.showToast({
title: "操作成功!",
success() { },
@ -660,7 +661,7 @@ export default {
onShow() {
this.getShopCarList().then(() => {
this.getGoodsInfo();
this.getShopCar();
// this.getShopCar();
this.getComment();
});
},

View File

@ -155,7 +155,8 @@ export default {
return
}
const params = {
user_id: uni.getStorageSync('userId')
user_id: uni.getStorageSync('userId'),
community_id: uni.getStorageSync('changeCommData') ? uni.getStorageSync('changeCommData').id : ''
}
return request(apiArr.groupBuyList, 'POST', params).then(res => {
const list = res.group_buy_list.map(item => {

View File

@ -64,7 +64,8 @@
{{ currentGG.goods_name }}
</view>
<view class="Msg">{{ currentGG.commodity_brief }}</view>
<view class="num">已售{{ soldOutNum }} | 剩余{{ currentGG.total_stock }}</view>
<view class="num">已售{{ soldOutNum }}</view>
<!-- | 剩余{{ currentGG.total_stock }} -->
</view>
<!-- 规格 -->
@ -104,7 +105,7 @@
<view class="fenge"></view>
<!-- 已购买区域 -->
<view>
<!-- <view>
<view class="purchase-area">
<view class="purchase-count">{{ totalCount }}人已购买</view>
<view class="view-more" @click="showPurchaseRecords">查看更多 &gt;</view>
@ -123,7 +124,7 @@
</view>
</view>
</view>
</view>
</view> -->
<view class="fenge"></view>
@ -173,7 +174,6 @@
</view>
<view class="cars" @click="car">
<u-badge numberType="limit" :type="type" max="99" :value="carNum"></u-badge>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_car.png"
mode="widthFix"></image>
购物车
@ -417,7 +417,7 @@
</view>
<view class="pay-button" @click="submitPayment">立即支付</view>
</u-popup>
<!-- 弹窗 - 支付成功 -->
<view class="pay-success-shadow" @click="changeShadow2" v-if="boxshadow5">
<view class="pay-success-container">
@ -430,76 +430,77 @@
<view class="verify-code-section">
<view v-if="verifyCode">核销码{{ verifyCode }}</view>
</view>
<view class="welfare-container">
<view class="welfare-header">
<view class="welfare-title">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/groupPurchase/welfare.png"></image>
下单福利
</view>
<view class="welfare-action">已获得</view>
</view>
<view class="welfare-box">
<view class="welfare-item welfare-item-points">
<view class="welfare-item-top">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_fen.png" mode="aspectFit">
<view class="welfare-container">
<view class="welfare-header">
<view class="welfare-title">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/groupPurchase/welfare.png">
</image>
<view>石榴分</view>
下单福利
</view>
<view>
{{ slFen }}
<view class="welfare-action">已获得</view>
</view>
<view class="welfare-box">
<view class="welfare-item welfare-item-points">
<view class="welfare-item-top">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_fen.png" mode="aspectFit">
</image>
<view>石榴分</view>
</view>
<view>
{{ slFen }}
</view>
<view class="welfare-item-bottom">
可抵扣 {{ slFen }}
</view>
</view>
<view class="welfare-item-bottom">
可抵扣 {{ slFen }}
<view class="welfare-item welfare-item-coupon">
<view class="welfare-item-top">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_zi.png" mode="aspectFit">
</image>
<view>石榴籽</view>
</view>
<view>
{{ slZi }}
</view>
<view class="welfare-item-bottom">
可抵扣 {{ slZi }}
</view>
</view>
<view class="welfare-item welfare-item-beans">
<view class="welfare-item-top">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_jin.png" mode="aspectFit" />
<view>石榴金</view>
</view>
<view>
{{ slJin }}
</view>
<view class="welfare-item-bottom">
可抵扣 {{ slJin }}
</view>
</view>
</view>
<view class="welfare-item welfare-item-coupon">
<view class="welfare-item-top">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_zi.png" mode="aspectFit">
</image>
<view>石榴籽</view>
</view>
<view>
{{ slZi }}
</view>
<view class="welfare-item-bottom">
可抵扣 {{ slZi }}
</view>
</view>
<view class="welfare-item welfare-item-beans">
<view class="welfare-item-top">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_jin.png" mode="aspectFit"/>
<view>石榴金</view>
</view>
<view>
{{ slJin }}
</view>
<view class="welfare-item-bottom">
可抵扣 {{ slJin }}
</view>
</view>
</view>
<view class="bottom2">
<view class="invite-section">
<view class="invite-text">
<view class="invite-line1"></view>
赶快邀请好友来下单吧
<view class="invite-line2"></view>
</view>
<view @click.stop="changeShadow2">
<view class="share-buttons">
<button class="share-btn-wechat" open-type="share" bindtap="onShareButtonClick" />
<view class="share-item">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_WX.png"
mode="aspectFill"></image>
微信好友
</view>
<button class="share-btn-miniprogram" open-type="share" bindtap="onShareButtonClick" />
<view class="share-item" @click="shareFriend">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_WX.png"
mode="aspectFill"></image>
小程序链接
<view class="bottom2">
<view class="invite-section">
<view class="invite-text">
<view class="invite-line1"></view>
赶快邀请好友来下单吧
<view class="invite-line2"></view>
</view>
<view @click.stop="changeShadow2">
<view class="share-buttons">
<button class="share-btn-wechat" open-type="share" bindtap="onShareButtonClick" />
<view class="share-item">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_WX.png"
mode="aspectFill"></image>
微信好友
</view>
<button class="share-btn-miniprogram" open-type="share" bindtap="onShareButtonClick" />
<view class="share-item" @click="shareFriend">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_WX.png"
mode="aspectFill"></image>
小程序链接
</view>
</view>
</view>
</view>
@ -601,7 +602,7 @@ export default {
})
return
}
//
if (this.changeCount <= 0) {
uni.showToast({
@ -610,18 +611,18 @@ export default {
})
return
}
//
const currentTime = new Date().getTime();
const activityInfo = this.currentGG.group_buy_activity_info;
let isGroupBuyValid = false;
if (activityInfo) {
const startTime = new Date(activityInfo.start_time).getTime();
const endTime = new Date(activityInfo.end_time).getTime();
isGroupBuyValid = currentTime >= startTime && currentTime <= endTime;
}
// trans_type
// : 71, App: 51
const systemInfo = uni.getSystemInfoSync();
@ -640,7 +641,7 @@ export default {
// #ifdef APP-PLUS
trans_type = 51; // App
// #endif
//
const params = {
user_id: uni.getStorageSync('userId'),
@ -661,7 +662,7 @@ export default {
}]
}]
}
//
request(apiArr.createOrder, "POST", params).then(resVal => {
//
@ -670,7 +671,7 @@ export default {
user_id: uni.getStorageSync('userId'),
trans_type: trans_type
}
request(apiArr.mergePreorder, "POST", preOrderParam).then(res => {
//
this.handleMergePreorderResponse(res, resVal.order_id);
@ -683,7 +684,7 @@ export default {
})
})
},
// mergePreorder
handleMergePreorderResponse(res, orderId) {
if (res && res.timeStamp && res.nonceStr && res.package && res.signType && res.paySign) {
@ -708,10 +709,10 @@ export default {
this.slFen = res.shiliu_fen || 0;
this.slZi = res.shiliu_zi || 0;
this.slJin = res.shiliu_money || 0;
//
this.boxshadow5 = true;
//
this.closeSeckill();
})
@ -754,42 +755,42 @@ export default {
},
//
closePurchase() {
this.showPurchase = false;
},
//
changeShadow2() {
this.boxshadow5 = false;
},
//
shareFriend() {
this.boxshadow5 = false; //
// API
if (typeof uni.share !== 'undefined') {
uni.share({
provider: 'weixin',
scene: 'WXSceneSession',
type: 0,
title: this.currentGG.goods_name || '商品分享',
summary: this.currentGG.commodity_brief || '快来看看这款商品吧',
href: `${window.location.origin}/pages/goodsDetail/index?id=${this.id}`,
imageUrl: this.picUrl + (this.currentGG.goods_carousel && this.currentGG.goods_carousel[0] || ''),
success: () => {
uni.showToast({
title: '分享成功',
icon: 'success',
duration: 2000
});
},
fail: (err) => {
console.error('分享失败', err);
}
});
}
},
closePurchase() {
this.showPurchase = false;
},
//
changeShadow2() {
this.boxshadow5 = false;
},
//
shareFriend() {
this.boxshadow5 = false; //
// API
if (typeof uni.share !== 'undefined') {
uni.share({
provider: 'weixin',
scene: 'WXSceneSession',
type: 0,
title: this.currentGG.goods_name || '商品分享',
summary: this.currentGG.commodity_brief || '快来看看这款商品吧',
href: `${window.location.origin}/pages/goodsDetail/index?id=${this.id}`,
imageUrl: this.picUrl + (this.currentGG.goods_carousel && this.currentGG.goods_carousel[0] || ''),
success: () => {
uni.showToast({
title: '分享成功',
icon: 'success',
duration: 2000
});
},
fail: (err) => {
console.error('分享失败', err);
}
});
}
},
//
goSubmit() {
@ -1087,12 +1088,12 @@ export default {
},
//
getShopCar() {
request(apiArr.getCarCount, "POST", {}).then((res) => {
this.carNum = res.total;
this.prevCarNum = res.total;
});
},
// getShopCar() {
// request(apiArr.getCarCount, "POST", {}).then((res) => {
// this.carNum = res.total;
// this.prevCarNum = res.total;
// });
// },
getShopCarList() {
const params = {
@ -1102,6 +1103,7 @@ export default {
//
this.carOrderList = [].concat(res.same_day_cart_list, res.normal_cart_list)
.flatMap(supplier => supplier.commodity_cart_and_goods_model);
this.carNum = res.total;
return res;
});
},
@ -1132,7 +1134,7 @@ export default {
group_buy_id: this.info.commodity_goods_info_list[this.currentGGIndex].group_buy_activity_id,
}
request(apiArr.updateCar, "POST", params).then((res) => {
that.getShopCar();
// that.getShopCar();
that.getShopCarList();
});
},
@ -1161,7 +1163,7 @@ export default {
title: "操作成功!",
success() { },
});
this.getShopCar();
// this.getShopCar();
this.getGoodsInfo();
});
},
@ -1191,6 +1193,7 @@ export default {
this.showSeckill = false;
uni.removeStorageSync('changeZTAddress')
this.defZTAddress = {}
this.changeCount = 0
},
editAddress() {
@ -1279,7 +1282,7 @@ export default {
this.getShopCarList().then(() => {
this.getGoodsInfo();
});
this.getShopCar();
// this.getShopCar();
this.getZTAddress()
},

View File

@ -142,11 +142,11 @@
</u-grid>
</view>
</view>
<view class="customer" @click="headerCustomerClick">
<!-- <view class="customer" @click="headerCustomerClick">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/page_user_Vector16.png"
mode="" />
<view>客服</view>
</view>
</view> -->
<view style="padding-top: 174rpx;"></view>
<nav-footer :current="4" />
</view>
@ -183,7 +183,7 @@ export default {
{
image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/page_user_Group_1563.png",
name: "收货地址",
url: "",
url: "/packages/shop/address/index",
},
{
image: "https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/page_user_Group_1564.png",
@ -468,12 +468,12 @@ export default {
uni.setStorageSync('work_order_permission', community_worker && community_worker[0].work_order_permission == 1 || false);
uni.setStorageSync('phone', res.account);
uni.hideLoading();
uni.showToast({
title: '刷新成功',
icon: 'success',
mask: true,
duration: 2000,
})
// uni.showToast({
// title: '',
// icon: 'success',
// mask: true,
// duration: 2000,
// })
}
},