feat: 首页改造

This commit is contained in:
2026-07-13 18:14:00 +08:00
parent 85fff5c363
commit c6015b8295
15 changed files with 2726 additions and 1399 deletions
+36 -26
View File
@@ -321,7 +321,8 @@
<SharePopup ref="share" v-if="shareOpen" :show="shareShow" @close="onClose" @share="onShare" :id="id"
:text="orderInfo.name ? orderInfo.name : ''" :price="orderInfo.minPrice ? orderInfo.minPrice : ''"
:tu="swiperList.length && swiperList[0]"></SharePopup>
<EvaluateDialog ref="evaluateDialog" :show="evaluateDialogShow" @close="evaluateDialogShow = false" :evalId="id" :mainGraph="orderInfo.mainGraph" :name="orderInfo.name"></EvaluateDialog>
<EvaluateDialog ref="evaluateDialog" :show="evaluateDialogShow" @close="evaluateDialogShow = false" :evalId="id"
:mainGraph="orderInfo.mainGraph" :name="orderInfo.name"></EvaluateDialog>
<view class="hideCanvasView">
<canvas id="myCanvas" canvas-id="myCanvas" :style="{
height: bgObj.height + 'px',
@@ -333,7 +334,7 @@
<script>
import { getGoodsDetail, addGoods, getGoodsSpecs } from "@/api/product.js";
import { getValue, PRODUCT_DELIVERY_TIME } from "@/utils/enumUtils.js";
import { getValue, PRODUCT_DELIVERY_TIME, ACTIVITY_TYPE } from "@/utils/enumUtils.js";
import { copyData } from "@/utils/index.js";
import Evaluation from "@/pages/other_package/productInfo/evaluation.vue";
import EvaluateDialog from "@/pages/other_package/productInfo/evaluate-dialog.vue";
@@ -410,6 +411,8 @@ export default {
isSplash: false,
isCoupon: false, // 是否是优惠券商品
curAmount: 0, // 当前人剩余优惠券金额
activedType: "", // 活动类型
activityId: "", // 秒杀活动ID
};
},
onBackPress(options) {
@@ -425,6 +428,9 @@ export default {
},
onLoad(options) {
const id = options.id;
this.activedType = options.activedType;
this.activityId = options.activityId;
this.isCoupon = options.isPar;
if (this.isCoupon && options.curAmount) {
this.curAmount = options.curAmount;
@@ -840,10 +846,16 @@ export default {
if (this.isCoupon) {
params.type = -1;
}
if(this.activedType === 'seckill'){
params.activityId = this.activityId;
params.activityType = 'seckill';
}
const resp = await getGoodsDetail(params);
if (resp && resp.bizcode === 100) {
const data = resp.data;
this.isShowCart = data.type == 3 ? 1 : 0;
// 限时秒杀 和 积分兑换 不需要购物车
this.isShowCart = this.activedType === 'seckill' || data.type == 3 ? 1 : 0;
// 商品图
if (data.goodsGraph) {
this.swiperList = data.goodsGraph.split(",");
@@ -851,6 +863,9 @@ export default {
data.addressObj = {}; // 收件人地址
data.quantity = 1; // 数量
data.inventory = 0; // 库存
if(this.activedType === 'seckill'){
data.minPrice = data.activity?.activityPrice;
}
this.orderInfo = data;
}
},
@@ -1064,16 +1079,30 @@ export default {
const params = {
id: this.id,
specsId: selectTempl.id, // 规格ID
goodsNum: this.orderInfo.quantity, // 商品数量
goodsNum: this.orderInfo.quantity, // 商品数量
};
console.log("selectTempl", selectTempl);
if (this.isShowCart == 1 || this.isCoupon) {
console.log("活动类型params---秦星星", params,this.isCoupon);
params["specsId"] = selectTempl;
let url = "";
if(this.activedType == "seckill"){
params["activedType"] = this.activedType; // 活动类型
params["activityId"] = this.activityId;// 秒杀活动ID
url = `/pages/order_package/order_submit/order_submit?sed=${JSON.stringify(
params
)}`;
}
if(this.isCoupon){
url =`/pages/order_package/order_submit/order_submit?sed=${JSON.stringify(
params
)}&address=${this.selectAddress?.id}&isCoupon=${this.isCoupon}`
}
uni.navigateTo({
url: `/pages/order_package/order_submit/order_submit?sed=${JSON.stringify(
params
)}&address=${this.selectAddress?.id}&isCoupon=${this.isCoupon}`,
url: url
});
return;
}
@@ -1091,9 +1120,6 @@ export default {
duration: 2000, // 持续时长,单位ms
});
}
// setTimeout(() => {
// this.checkSpecification(false, null);
// }, 2000)
}
},
// 跳转到分享页面
@@ -1124,22 +1150,6 @@ export default {
.product_info_header_warp {
position: relative;
// .product_info_header_swiper {
// height: 562.5rpx !important;
// ::v-deep(.u-swiper__wrapper) {
// height: 562.5rpx !important;
// .u-swiper__wrapper {
// height: 562.5rpx !important;
// .u-swiper__wrapper__item__wrapper__image {
// height: 562.5rpx !important;
// }
// }
// }
// }
.product_info_header_swiper {
height: 800rpx !important;