no message
This commit is contained in:
@@ -99,11 +99,11 @@
|
||||
}" style="text-align: right;"></up-input>
|
||||
</view>
|
||||
<!-- 运费 -->
|
||||
<view class="order_freight_warp">
|
||||
<view class="order_freight_warp" v-if="orderInfo">
|
||||
<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_" >
|
||||
<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 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 class="order_way_right">
|
||||
{{ getValue(wayOption, orderInfo.paymentMethod) }}
|
||||
<up-image src="/static/common/right.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
|
||||
</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 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>
|
||||
|
||||
@@ -217,6 +258,7 @@
|
||||
<script>
|
||||
import Address from '@/components/address.vue';
|
||||
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 } from '@/api/cart.js';
|
||||
import { getSupportPay } from '@/api/order.js';
|
||||
@@ -233,6 +275,18 @@ export default {
|
||||
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: {
|
||||
Address,
|
||||
@@ -244,6 +298,7 @@ export default {
|
||||
payPwd:0,
|
||||
show:false,
|
||||
isShow:false,
|
||||
addressListOne:[],
|
||||
ids: 0,
|
||||
orderInfo: {
|
||||
// coupon:2,//优惠卷
|
||||
@@ -269,7 +324,7 @@ export default {
|
||||
type:'1'
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
async onLoad(option) {
|
||||
// const ids = option.ids;
|
||||
if (option.sed) {
|
||||
this.ji = 1;
|
||||
@@ -278,6 +333,7 @@ export default {
|
||||
}
|
||||
if (option.ids) {
|
||||
this.ids = option.ids;
|
||||
await this.addressList();
|
||||
this.getOrder();
|
||||
}
|
||||
console.log("参数---", option)
|
||||
@@ -287,11 +343,12 @@ export default {
|
||||
this.addressShow = addressShowPop;
|
||||
}
|
||||
// 支付弹框
|
||||
const payOpen = option.payOpen;
|
||||
if (payOpen && payOpen !== "null") {
|
||||
// const payOpen = option.payOpen;
|
||||
// if (payOpen && payOpen !== "null") {
|
||||
// this.getWayOption();
|
||||
// this.wayShow = payOpen;
|
||||
// }
|
||||
this.getWayOption();
|
||||
this.wayShow = payOpen;
|
||||
}
|
||||
this.getUserInfo();
|
||||
},
|
||||
mounted() {
|
||||
@@ -300,6 +357,13 @@ export default {
|
||||
methods: {
|
||||
getValue,
|
||||
assembleAddress,
|
||||
async addressList() {
|
||||
const res = await getAddress();
|
||||
if (res && res.bizcode === 100) {
|
||||
this.addressListOne = res.data;
|
||||
}
|
||||
|
||||
},
|
||||
onBackspace(e){
|
||||
if(this.password.length>0){
|
||||
this.password = this.password.substring(0,this.password.length-1);
|
||||
@@ -380,12 +444,12 @@ export default {
|
||||
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;
|
||||
}
|
||||
// if (flag) {
|
||||
// this.isShowBalance = false;
|
||||
// } else {
|
||||
// const balanceFlag = data.some(item => item.type === "balance" && item.balance < amount);
|
||||
// this.isShowBalance = balanceFlag;
|
||||
// }
|
||||
this.wayOption = data;
|
||||
console.log('getWayOption', this.wayOption)
|
||||
}
|
||||
@@ -404,8 +468,20 @@ export default {
|
||||
}, 2000)
|
||||
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 = {
|
||||
cartIds: ids,
|
||||
cartIds: ids
|
||||
}
|
||||
if(address){
|
||||
params['addrId'] = address.id
|
||||
}
|
||||
const resp = await getSettleList(params);
|
||||
if (resp && resp.bizcode === 100) {
|
||||
@@ -421,6 +497,7 @@ export default {
|
||||
data.shops = shops;
|
||||
data.paymentMethod = null;// 支付方式
|
||||
this.orderInfo = data;
|
||||
console.log('orderInfoorderInfo',this.orderInfo)
|
||||
}
|
||||
},
|
||||
async getOrderTwo() {
|
||||
@@ -441,6 +518,7 @@ export default {
|
||||
deliveryTime: data.deliveryTime,
|
||||
postagesId: data.postagesId,
|
||||
postagesType: 1,
|
||||
postage:0,
|
||||
goods: [
|
||||
{
|
||||
adress: null,
|
||||
@@ -450,7 +528,7 @@ export default {
|
||||
townshipName:null,
|
||||
goodsId: this.sed.id,
|
||||
id: this.sed.specsId.id,
|
||||
img: data.goodsGraph,
|
||||
img: data.goodsGraph.split(',')[0],
|
||||
name: null,
|
||||
num: this.sed.goodsNum,
|
||||
phone: null,
|
||||
@@ -697,7 +775,8 @@ export default {
|
||||
this.selectAddress = addressObj;
|
||||
},
|
||||
// 地址选中OK
|
||||
addressOk() {
|
||||
async addressOk() {
|
||||
console.log('this.selectAddress',this.selectAddress)
|
||||
const type = this.addressType;
|
||||
const addressIndex = this.addressIndex;
|
||||
const shopsIndex = this.shopsIndex;
|
||||
@@ -707,6 +786,27 @@ export default {
|
||||
this.orderInfo.shops[shopsIndex].addrTimes[addressIndex].address = this.selectAddress;
|
||||
}
|
||||
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) {
|
||||
@@ -733,6 +833,57 @@ export default {
|
||||
</script>
|
||||
|
||||
<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{
|
||||
text-align: center;
|
||||
font-size: 68rpx;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Reference in New Issue
Block a user