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
@@ -1,7 +1,6 @@
<template>
<view class="order_submit_warp">
<Header :leftTitle="$t('order.submit.title')" leftPathType="switchTab"
leftPath="/pages/shopping_cart/shopping_cart" />
<Header leftTitle="提交订单" leftPathType="switchTab" leftPath="/pages/shopping_cart/shopping_cart" />
<!-- 收件人信息 -->
<view class="order_submit_header_warp" @click="checkAddressShow(true, 'data')"
v-if="orderInfo.address && Object.keys(orderInfo.address).length !== 0">
@@ -61,7 +60,7 @@
<view class="content_right_total">
<view>¥<text style="font-size: 36rpx">{{
pItem.totalPrice
}}</text></view>
}}</text></view>
<view>每件到手价¥{{ pItem.unitPrice }}</view>
</view>
<view class="shopping_info_quantity">
@@ -85,7 +84,7 @@
<view class="content_right_total">
<view>¥<text style="font-size: 36rpx">{{
pItem.totalPrice
}}</text></view>
}}</text></view>
<view>每件到手价¥{{ pItem.unitPrice }}</view>
</view>
<view class="shopping_info_quantity">
@@ -109,7 +108,7 @@
<view class="order_freight_item">
<view>运费<text style="color: #c0c3c6; margin-left: 20rpx">{{
getValue(PRODUCT_DELIVERY_TIME, addItem.deliveryTime)
}}</text></view>
}}</text></view>
<view class="value_">
{{ orderInfo.postage ? "¥" + orderInfo.postage : "包邮" }}
</view>
@@ -188,7 +187,7 @@
<text class="text-32 text-zu">运费</text>
<text class="text-32 text-zu text-bold">¥{{ orderInfo.postage }}</text>
</view>
<view class="price-view" @click="couponShow = true">
<!-- <view class="price-view" @click="couponShow = true">
<text class="text-32 text-zu">优惠券</text>
<view style="display: flex; align-items: center;">
<view class="text-24 " style="margin-right:4rpx;color:#999;">{{ selectedCoupon ? `-${selectedCoupon.amount}` :
@@ -196,6 +195,14 @@
<up-image src="/static/common/right.png" width="12" height="12" bgColor="#f1f6ff00"
style="display:inline-block;vertical-align: middle;"></up-image>
</view>
</view> -->
<view class="price-view" @click="this.sed?.activedType == 'seckill' && allOrderInfo.activity?.activityPrice">
<text class="text-32 text-zu">秒杀价</text>
<view style="display: flex; align-items: center;">
<view class="seckill-tag">限时秒杀</view>
<view class="text-24 " style="margin-right:8rpx;color:#7934F6;font-size: 32rpx;font-weight: bold;">¥{{
allOrderInfo.activity?.activityPrice}}</view>
</view>
</view>
<view class="price-view" v-if="isCoupon">
<text class="text-32 text-zu">数字积分</text>
@@ -261,11 +268,11 @@
<view class="popup_but" @click="addressOk"> 确认 </view>
</view>
</up-popup>
<u-modal :show="tipsShow" title="提示" showCancelButton @cancel="onCancel" @confirm="onConfirm"
<u-modal :show="tipsShow" v-if="tipsShow" title="提示" showCancelButton @cancel="onCancel" @confirm="onConfirm"
:cancelText="type == 1 ? '取消' : '忘记密码'" :confirmText="type == 1 ? '去设置' : '重试'" confirmColor="#7934F6"
:content="content"></u-modal>
<u-keyboard ref="uKeyboard" mode="number" :show="show" @change="onChange" @backspace="onBackspace"
<u-keyboard ref="uKeyboard" mode="number" v-if="show" :show="show" @change="onChange" @backspace="onBackspace"
:dotDisabled="true" :tooltip="false">
<view style="background-color: #fff">
<view class="money">
@@ -287,7 +294,7 @@
<up-toast ref="uToastRef"></up-toast>
<!-- 优惠券选择弹框 -->
<CouponDialog :show="couponShow" @close="couponShow = false" @select="handleCouponSelect"></CouponDialog>
<CouponDialog :show="couponShow" v-if="couponShow" @close="couponShow = false" @select="handleCouponSelect"></CouponDialog>
</view>
</template>
@@ -297,19 +304,17 @@ import { getGoodsDetail } from "@/api/product.js";
import { getAddress } from "@/api/address.js";
import {
PAYMENT_WAY,
PAYMENT_WAY_,
PRODUCT_DELIVERY_TIME,
getValue,
WAY_LIST,
} from "@/utils/enumUtils.js";
import {
getSettleList,
settle,
settlementOrder,
updateGoodsNum,
setSeckillOrder
} from "@/api/cart.js";
import { getSupportPay } from "@/api/order.js";
import { feedback } from "@/api/payment.js";
import { assembleAddress } from "@/utils/index.js";
import Header from "@/components/header.vue";
import { getUserInfo } from "@/api/auth.js";
@@ -535,6 +540,10 @@ export default {
parmas["types"] = "1,2,3";
parmas.isDeduction = true;
}
if(this.sed.activedType == "seckill"){
parmas["types"] = "1,2,3";
}
const result = await getSupportPay(parmas);
if (result && result.bizcode === 100) {
const data = result.data || [];
@@ -613,13 +622,17 @@ export default {
if (this.isCoupon) {
params.type = -1;
}
if (this.sed?.activedType == "seckill") {
params.activityId = Number(this.sed?.activityId);
params.activityType = "seckill";
}
const resp = await getGoodsDetail(params);
if (resp && resp.bizcode === 100) {
const data = resp.data;
this.isPoints = data.type == 3 ? 1 : 0;
this.orderInfo = {
address: null,
amount: this.sed.goodsNum * this.sed.specsId.price,
amount:this.sed?.activedType == "seckill" ? data.activity?.activityPrice :this.sed.goodsNum * this.sed.specsId.price || 0,
postage: 0,
shops: [
{
@@ -886,9 +899,16 @@ export default {
params["goodsId"] = this.sed.id;
params["specsId"] = this.sed.specsId.id;
params["goodsNum"] = this.orderInfo.shops[0].addrTimes[0].goods[0].num;
if (this.isCoupon) params.payway2 = "vcoin";
resp = await settlementOrder(params);
console.log("秦星星params-----", this.sed?.activedType);
if (this.sed?.activedType == "seckill") {
params["activityId"] = Number(this.sed?.activityId); // 秒杀活动ID
resp = await setSeckillOrder(params);
} else {
if (this.isCoupon) params.payway2 = "vcoin";
resp = await settlementOrder(params);
}
} else {
params["cartIds"] = this.ids;
if (
@@ -1056,6 +1076,16 @@ export default {
display: flex;
flex-direction: row;
justify-content: space-between;
.seckill-tag {
background: #7934F6;
border-radius: 4rpx;
font-weight: 600;
font-size: 20rpx;
color: #FFFFFF;
padding: 4rpx 12rpx;
margin-right: 8rpx;
}
}
.way-option {
@@ -1115,7 +1145,7 @@ export default {
.order_submit_warp {
background-color: $app-bj;
height: calc(100vh - 200rpx);
height: calc(100% - 200rpx - env(safe-area-inset-bottom));
padding: 20rpx;
overflow-y: auto;
}