暂存code

This commit is contained in:
hejiangming
2025-05-07 09:54:33 +08:00
parent 78270eeda0
commit 007b002b81
403 changed files with 14507 additions and 6320 deletions
+30 -21
View File
@@ -5,6 +5,7 @@
<up-swiper
:list="swiperList"
height="280"
@change="e => currentNum = e.current"
>
<template #indicator>
<view
@@ -27,7 +28,9 @@
<view class="content_data">
<view class="content_data_price">
<text>¥</text>
<text style="font-size: 60rpx;" v-if="orderInfo.maxPrice && orderInfo.maxPrice !==0">{{orderInfo.minPrice}} - {{orderInfo.maxPrice}}</text>
<text style="font-size: 60rpx;" v-if="orderInfo.minPrice && orderInfo.maxPrice">
{{orderInfo.minPrice}} - {{orderInfo.maxPrice}}
</text>
<text style="font-size: 60rpx;" v-else>{{orderInfo.minPrice}}</text>
<text class="price_o">¥{{orderInfo.adPrice}}</text>
</view>
@@ -119,6 +122,7 @@
:round="10"
:closeOnClickOverlay="false"
:closeable="true"
@close="specificationShow=false"
mode="bottom"
>
<view class="specification_warp">
@@ -146,7 +150,8 @@
{{selectSpecificationTempl.price}}
</text>
<view style="font-size: 50rpx" v-else>
{{orderInfo.minPrice}} - {{orderInfo.maxPrice}}
{{orderInfo.minPrice}}
<text v-if="orderInfo.maxPrice">- {{orderInfo.maxPrice}}</text>
</view>
<view class="price_content_coupon_warp" v-if="orderInfo.couponPrice && orderInfo.couponPrice !==0">优惠卷{{orderInfo.couponPrice}}</view>
</view>
@@ -186,11 +191,11 @@
<view class="quantity_but" @click="quantityFun('add')">+</view>
</view>
</view>
<view v-if="specificationShowType === 'buy'" class="specification_buy_but" @click="byFun">去支付</view>
<view v-else-if="specificationShowType === 'addCart'" class="specification_buy_but" @click="addCart">加入购物车</view>
<view v-if="specificationShowType === 'buy'" class="specification_buy_but" @click="addCart(true)">去支付</view>
<view v-else-if="specificationShowType === 'addCart'" class="specification_buy_but" @click="addCart(false)">加入购物车</view>
<view v-else class="product_but_right popup_but">
<view class ='but_comm join_warp' @click="addCart">加入购物车</view>
<view class="but_comm buy_warp" @click="byFun">立即购买</view>
<view class ='but_comm join_warp' @click="addCart(false)">加入购物车</view>
<view class="but_comm buy_warp" @click="addCart(true)">立即购买</view>
</view>
</view>
</view>
@@ -213,7 +218,7 @@
return {
id:0,
swiperList:[],
currentNum:1,
currentNum:0,
specificationShow:false,
specificationShowType:'',// 弹框类型
orderInfo:{},
@@ -369,16 +374,9 @@
}
this.orderInfo.quantity = currentQuantity;
},
// 立即购买,确定订单页面
byFun(){
// 先加入购物车,再去购买
this.addCart();
uni.navigateTo({
url: '/pages/order_submit/order_submit',
})
},
// 加入购入车
async addCart(){
async addCart(isBy = false){
const selectTempl = this.selectSpecificationTempl;
if(!selectTempl || Object.keys(selectTempl).length ===0){
uni.showToast({
@@ -395,15 +393,25 @@
}
const resp = await addGoods(params);
if(resp && resp.bizcode === 100){
uni.showToast({
title: '成功加入购物车',
icon: 'success', // 可选 success/loading/none
duration: 2000 // 持续时长,单位ms
});
if(isBy){
uni.navigateTo({
url: '/pages/order_submit/order_submit?ids='+resp.data,
})
}else{
uni.showToast({
title: '成功加入购物车',
icon: 'success', // 可选 success/loading/none
duration: 2000 // 持续时长,单位ms
});
}
setTimeout(()=>{
this.checkSpecification(false,null);
},2000)
}
},
// 跳转到分享页面
jumpShare(){
}
}
@@ -720,6 +728,7 @@
}
.popup_but{
background-color: #FFFFFF;
.but_comm{
width: 40%;
}