暂存代码
This commit is contained in:
@@ -98,7 +98,7 @@
|
||||
|
||||
|
||||
<!-- 支付方式 -->
|
||||
<view class="order_way_warp" @click="wayShow = true;">
|
||||
<view class="order_way_warp" @click="wayShowFun(true)">
|
||||
<view>支付方式</view>
|
||||
<view class="order_way_right">
|
||||
{{getValue(wayOption,orderInfo.paymentMethod)}}
|
||||
@@ -119,17 +119,21 @@
|
||||
v-model="orderInfo.paymentMethod"
|
||||
placement="column"
|
||||
>
|
||||
<view class="way_item" v-for="item in wayOption" :key="item.id">
|
||||
<view class="way_item_">
|
||||
<!-- <view style="margin-top: 2rpx;"><up-image :src="item.path" width="20" height="20" bgColor="#f1f6ff00"></up-image></view> -->
|
||||
<view class="way_item_val">{{item.name}}<text v-if="item.balance"> ({{item.balance}})</text></view>
|
||||
<view v-for="item in wayOption" :key="item.id" style="margin-bottom: 10rpx;">
|
||||
<view class="way_item" >
|
||||
<view class="way_item_">
|
||||
<view class="way_item_val">{{item.name}}<text v-if="item.balance"> ({{item.balance}})</text></view>
|
||||
</view>
|
||||
<view v-if="item.type === 'balance' && isShowBalance" class="go_balance_comm_warp" @click="goRechargeFun(item)">去充值</view>
|
||||
<up-radio
|
||||
v-else
|
||||
:name="item.type"
|
||||
activeColor="#03AD27"
|
||||
>
|
||||
</up-radio>
|
||||
</view>
|
||||
<up-radio
|
||||
:name="item.type"
|
||||
activeColor="#FF7C41"
|
||||
>
|
||||
</up-radio>
|
||||
</view>
|
||||
<view class="balance_comm_msg" v-if="item.type === 'balance' && isShowBalance">当前现金余额不足,如需支付请前往充值</view>
|
||||
</view>
|
||||
</up-radio-group>
|
||||
<view class="popup_but" @click="wayShow=false;">
|
||||
确认
|
||||
@@ -193,33 +197,28 @@
|
||||
shopsIndex:0,// 收件地址数据类型
|
||||
selectAddress:{},// 收件地址选择
|
||||
wayOption:[],
|
||||
// leftPath:'',
|
||||
// leftPathType:'',
|
||||
isShowBalance:false,
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
const ids = option.ids;
|
||||
console.log("ids",ids);
|
||||
if(ids && ids!=="null"){
|
||||
this.ids = ids;
|
||||
this.getOrder();
|
||||
// const idsArr = ids.split(",");
|
||||
// console.log("idsArr.length",idsArr.length);
|
||||
// if(idsArr.length >1){
|
||||
// this.leftPath = "/pages/sort/sort";
|
||||
// this.leftPathType = "switchTab"
|
||||
// }else{
|
||||
// this.leftPath = "/pages/productInfo/productInfo?id="+ids;
|
||||
// this.leftPathType = "navigateTo"
|
||||
// }
|
||||
}
|
||||
const addressShow = option.addressShow;
|
||||
if(addressShow && addressShow !=="null"){
|
||||
this.addressShow = addressShow;
|
||||
}
|
||||
// 支付弹框
|
||||
const payOpen = option.payOpen;
|
||||
if(payOpen && payOpen !=="null"){
|
||||
this.getWayOption();
|
||||
this.wayShow = payOpen;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getWayOption();
|
||||
|
||||
},
|
||||
methods: {
|
||||
getValue,
|
||||
@@ -232,10 +231,26 @@
|
||||
url:"/pages/mine_address_add/mine_address_add?ids="+ids,
|
||||
})
|
||||
},
|
||||
wayShowFun(type){
|
||||
if(type){
|
||||
this.getWayOption();
|
||||
}
|
||||
this.wayShow=type;
|
||||
},
|
||||
async getWayOption(){
|
||||
const result = await getSupportPay();
|
||||
if(result && result.bizcode === 100){
|
||||
this.wayOption = result.data;
|
||||
const data = result.data || [];
|
||||
const amount = this.orderInfo.amount;
|
||||
let flag = data.some(item => ['wechat','alipay'].includes(item.type));
|
||||
// 没有支付宝和微信支付
|
||||
if(flag){
|
||||
this.isShowBalance = false;
|
||||
}else{
|
||||
const balanceFlag = data.some(item => item.type === "balance" && item.balance < amount);
|
||||
this.isShowBalance = balanceFlag;
|
||||
}
|
||||
this.wayOption = data;
|
||||
}
|
||||
},
|
||||
async getOrder(){
|
||||
@@ -437,10 +452,17 @@
|
||||
this.shopsIndex = index;
|
||||
},
|
||||
jumpProductInfo(item){
|
||||
console.log("item",item);
|
||||
uni.navigateTo({
|
||||
url:"/pages/productInfo/productInfo?id="+item.goodsId,
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 去充值
|
||||
*/
|
||||
goRechargeFun (item){
|
||||
uni.navigateTo({
|
||||
url:"/pages/mine_purse_recharge/mine_purse_recharge?category=balance&amount="+item.balance+"&back=submit&id="+this.ids,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user