no message

This commit is contained in:
2025-10-24 16:37:40 +08:00
parent 0a7a4392e2
commit 0390ba12dd
3 changed files with 172 additions and 21 deletions
+170 -19
View File
@@ -99,11 +99,11 @@
}" style="text-align: right;"></up-input> }" style="text-align: right;"></up-input>
</view> </view>
<!-- 运费 --> <!-- 运费 -->
<view class="order_freight_warp"> <view class="order_freight_warp" v-if="orderInfo">
<view class="order_freight_item"> <view class="order_freight_item">
<view>运费</view> <view>运费<text style="color: #C0C3C6;margin-left:20rpx">{{ getValue(PRODUCT_DELIVERY_TIME, addItem.deliveryTime) }}</text></view>
<view class="value_" > <view class="value_" >
<text style="color: #9E9E9E;">({{ getValue(PRODUCT_DELIVERY_TIME, addItem.deliveryTime) }})</text>包邮 {{orderInfo.shops[0].addrTimes[0].postage ? orderInfo.shops[0].addrTimes[0].postage : '包邮'}}
</view> </view>
</view> </view>
<!-- <view class="order_freight_item"> <!-- <view class="order_freight_item">
@@ -117,16 +117,57 @@
<!-- 支付方式 --> <!-- 支付方式 -->
<view class="order_way_warp" @click="wayShowFun(true)"> <!-- <view class="order_way_warp" @click="wayShowFun(true)">
<view>支付方式</view> <view>支付方式</view>
<view class="order_way_right"> <view class="order_way_right">
{{ getValue(wayOption, orderInfo.paymentMethod) }} {{ getValue(wayOption, orderInfo.paymentMethod) }}
<up-image src="/static/common/right.png" width="20" height="20" bgColor="#f1f6ff00"></up-image> <up-image src="/static/common/right.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view> </view>
</view> -->
<view class="order_way_warp_two" >
<text class="text-32 text-zu">支付方式</text>
<up-radio-group v-model="orderInfo.paymentMethod" placement="column">
<view v-for="(item,index) in wayOption" :key="item.id" class="way-option"
:style="{borderWidth:wayOption.length - 1 == index ? '0rpx' : '2rpx'}">
<view class="way-option-item" >
<image v-if="item.type == 'wechat'" src="@/static/new/wx.png"></image>
<image v-if="item.type == 'alipay'" src="@/static/new/zfb.png"></image>
<image v-if="item.type == 'balance'" src="@/static/new/bank.png"></image>
<image v-if="item.type == 'redpacket'" src="@/static/new/jf.png"></image>
<text v-if="item.type == 'wechat' || item.type == 'alipay'" class="text-32 text-zu" style="margin-left:20rpx">{{item.name}}</text>
<text v-else style="margin-left:20rpx" class="text-32 text-zu">{{item.name}}
<text style="color:#999;margin:0 10rpx">可用:</text>
{{item.balance}}
</text>
</view>
<up-radio :name="item.type" activeColor="#7934F6">
</up-radio>
</view>
</up-radio-group>
</view>
<view class="order_way_warp_two" >
<view class="price-view">
<text class="text-32 text-zu">商品总价</text>
<text class="text-32 text-zu text-bold">¥{{ orderInfo.amount - orderInfo.shops[0].addrTimes[0].postage }}</text>
</view>
<view class="price-view">
<text class="text-32 text-zu">运费</text>
<text class="text-32 text-zu text-bold">¥{{ orderInfo.shops[0].addrTimes[0].postage }}</text>
</view>
<view class="price-line"></view>
<view class="price-view-two">
<text class="text-32 text-fu1">合计</text>
<text class="text-32 text-zi text-bold">¥{{ orderInfo.amount }}</text>
</view>
</view> </view>
<!-- 去支付的固定按钮 --> <!-- 去支付的固定按钮 -->
<view class="order_pay_but"> <view class="order_pay_but">
<view class="price_">¥<text style="font-size: 60rpx;">{{ orderInfo.amount }}</text></view> <view class="price_">
<text class="text-32" style="color:#999;font-weight: 400;">共
<text>{{totleNum}}</text>
件
</text>
¥<text style="font-size: 60rpx;">{{ orderInfo.amount }}</text></view>
<view class="_but" @click="goPay">支付</view> <view class="_but" @click="goPay">支付</view>
</view> </view>
@@ -217,6 +258,7 @@
<script> <script>
import Address from '@/components/address.vue'; import Address from '@/components/address.vue';
import { getGoodsDetail } from '@/api/product.js'; 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 { PAYMENT_WAY, PAYMENT_WAY_, PRODUCT_DELIVERY_TIME, getValue, WAY_LIST } from '@/utils/enumUtils.js';
import { getSettleList, settle, settlementOrder, updateGoodsNum } from '@/api/cart.js'; import { getSettleList, settle, settlementOrder, updateGoodsNum } from '@/api/cart.js';
import { getSupportPay } from '@/api/order.js'; import { getSupportPay } from '@/api/order.js';
@@ -233,6 +275,18 @@ export default {
PRODUCT_DELIVERY_TIME() { PRODUCT_DELIVERY_TIME() {
return PRODUCT_DELIVERY_TIME; return PRODUCT_DELIVERY_TIME;
}, },
totleNum(){
let num = 0;
console.log('totleNum',JSON.parse(JSON.stringify(this.orderInfo)))
if(this.orderInfo && this.orderInfo.shops && this.orderInfo.shops.length){
let goods = this.orderInfo.shops[0].addrTimes[0].goods;
goods.forEach(item=>{
num += item.num;
})
}
return num;
},
}, },
components: { components: {
Address, Address,
@@ -244,6 +298,7 @@ export default {
payPwd:0, payPwd:0,
show:false, show:false,
isShow:false, isShow:false,
addressListOne:[],
ids: 0, ids: 0,
orderInfo: { orderInfo: {
// coupon:2,//优惠卷 // coupon:2,//优惠卷
@@ -269,7 +324,7 @@ export default {
type:'1' type:'1'
}; };
}, },
onLoad(option) { async onLoad(option) {
// const ids = option.ids; // const ids = option.ids;
if (option.sed) { if (option.sed) {
this.ji = 1; this.ji = 1;
@@ -278,6 +333,7 @@ export default {
} }
if (option.ids) { if (option.ids) {
this.ids = option.ids; this.ids = option.ids;
await this.addressList();
this.getOrder(); this.getOrder();
} }
console.log("参数---", option) console.log("参数---", option)
@@ -287,11 +343,12 @@ export default {
this.addressShow = addressShowPop; this.addressShow = addressShowPop;
} }
// 支付弹框 // 支付弹框
const payOpen = option.payOpen; // const payOpen = option.payOpen;
if (payOpen && payOpen !== "null") { // if (payOpen && payOpen !== "null") {
// this.getWayOption();
// this.wayShow = payOpen;
// }
this.getWayOption(); this.getWayOption();
this.wayShow = payOpen;
}
this.getUserInfo(); this.getUserInfo();
}, },
mounted() { mounted() {
@@ -300,6 +357,13 @@ export default {
methods: { methods: {
getValue, getValue,
assembleAddress, assembleAddress,
async addressList() {
const res = await getAddress();
if (res && res.bizcode === 100) {
this.addressListOne = res.data;
}
},
onBackspace(e){ onBackspace(e){
if(this.password.length>0){ if(this.password.length>0){
this.password = this.password.substring(0,this.password.length-1); this.password = this.password.substring(0,this.password.length-1);
@@ -380,12 +444,12 @@ export default {
const amount = this.orderInfo.amount; const amount = this.orderInfo.amount;
let flag = data.some(item => ['wechat', 'alipay'].includes(item.type)); let flag = data.some(item => ['wechat', 'alipay'].includes(item.type));
// 没有支付宝和微信支付 // 没有支付宝和微信支付
if (flag) { // if (flag) {
this.isShowBalance = false; // this.isShowBalance = false;
} else { // } else {
const balanceFlag = data.some(item => item.type === "balance" && item.balance < amount); // const balanceFlag = data.some(item => item.type === "balance" && item.balance < amount);
this.isShowBalance = balanceFlag; // this.isShowBalance = balanceFlag;
} // }
this.wayOption = data; this.wayOption = data;
console.log('getWayOption', this.wayOption) console.log('getWayOption', this.wayOption)
} }
@@ -404,8 +468,20 @@ export default {
}, 2000) }, 2000)
return; return;
} }
let address = null;
if(this.addressListOne.length){
let arr = this.addressListOne.filter(i=>i.isDefault)
if(arr.length){
address = arr[0];
}else{
address = this.addressListOne[0];
}
}
const params = { const params = {
cartIds: ids, cartIds: ids
}
if(address){
params['addrId'] = address.id
} }
const resp = await getSettleList(params); const resp = await getSettleList(params);
if (resp && resp.bizcode === 100) { if (resp && resp.bizcode === 100) {
@@ -421,6 +497,7 @@ export default {
data.shops = shops; data.shops = shops;
data.paymentMethod = null;// 支付方式 data.paymentMethod = null;// 支付方式
this.orderInfo = data; this.orderInfo = data;
console.log('orderInfoorderInfo',this.orderInfo)
} }
}, },
async getOrderTwo() { async getOrderTwo() {
@@ -441,6 +518,7 @@ export default {
deliveryTime: data.deliveryTime, deliveryTime: data.deliveryTime,
postagesId: data.postagesId, postagesId: data.postagesId,
postagesType: 1, postagesType: 1,
postage:0,
goods: [ goods: [
{ {
adress: null, adress: null,
@@ -450,7 +528,7 @@ export default {
townshipName:null, townshipName:null,
goodsId: this.sed.id, goodsId: this.sed.id,
id: this.sed.specsId.id, id: this.sed.specsId.id,
img: data.goodsGraph, img: data.goodsGraph.split(',')[0],
name: null, name: null,
num: this.sed.goodsNum, num: this.sed.goodsNum,
phone: null, phone: null,
@@ -697,7 +775,8 @@ export default {
this.selectAddress = addressObj; this.selectAddress = addressObj;
}, },
// 地址选中OK // 地址选中OK
addressOk() { async addressOk() {
console.log('this.selectAddress',this.selectAddress)
const type = this.addressType; const type = this.addressType;
const addressIndex = this.addressIndex; const addressIndex = this.addressIndex;
const shopsIndex = this.shopsIndex; const shopsIndex = this.shopsIndex;
@@ -707,6 +786,27 @@ export default {
this.orderInfo.shops[shopsIndex].addrTimes[addressIndex].address = this.selectAddress; this.orderInfo.shops[shopsIndex].addrTimes[addressIndex].address = this.selectAddress;
} }
this.addressShow = this.false; this.addressShow = this.false;
if(this.selectAddress && !this.sed){
const params = {
cartIds: this.ids,
addrId:this.selectAddress.id
}
const resp = await getSettleList(params);
if (resp && resp.bizcode === 100) {
const data = resp.data;
const shops = data.shops;
if (shops && shops.length !== 0) {
shops.map(item => {
item.addrTimes.map(addItem => {
addItem.remark = null;
})
})
}
data.shops = shops;
data.paymentMethod = null;// 支付方式
this.orderInfo = data;
}
}
}, },
// 地址类型 // 地址类型
checkAddressShow(status, type, addIndex, index) { checkAddressShow(status, type, addIndex, index) {
@@ -733,6 +833,57 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.order_way_warp_two{
width:100%;
padding: 32rpx 32rpx 0;
display: flex;
flex-direction: column;
box-sizing: border-box;
background-color: #fff;
border-radius: 16rpx;
margin-top:24rpx;
.price-view-two{
width:100%;
height:108rpx;
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
}
.price-line{
width:100%;
min-height:1rpx;
background-color: #ECECEC;
}
.price-view{
width:100%;
height:72rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.way-option{
height:112rpx;
width:100%;
display: flex;
flex-direction: row;
align-items: center;
border-bottom:1rpx solid #ececec;
justify-content: space-between;
.way-option-item{
height:112rpx;
display: flex;
flex-direction: row;
align-items: center;
image{
width:48rpx;
height:48rpx;
}
}
}
}
.money{ .money{
text-align: center; text-align: center;
font-size: 68rpx; font-size: 68rpx;
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB