|
|
|
@ -1,76 +1,79 @@ |
|
|
|
<template> |
|
|
|
<view> |
|
|
|
<!-- 商品信息 --> |
|
|
|
<self-line/> |
|
|
|
<view class="bg-white padding-tb-sm"> |
|
|
|
<skeleton :loading="skeletonLoading" :row="2" :showAvatar="false" :showTitle="true"> |
|
|
|
|
|
|
|
<view class="flex justify-between align-start padding-top-sm padding-lr"> |
|
|
|
<image v-if="orderDetails.goods.cover" :src="orderDetails.goods.cover" mode="aspectFill" style="width: 150rpx; height: 150rpx;"></image> |
|
|
|
<view class="flex-sub padding-left-sm"> |
|
|
|
<view class="bref-box margin-top-xs"> |
|
|
|
{{orderDetails.goods.name}} |
|
|
|
</view> |
|
|
|
<view class="flex justify-between"> |
|
|
|
<text class="block margin-top-sm text-gray text-sm">数量</text> |
|
|
|
<view class="flex align-center margin-top-sm"> |
|
|
|
<text class="cuIcon-move" @tap="reduce"></text> |
|
|
|
<input type="number" v-model="num" class="text-center margin-lr-sm radius" style="width: 60rpx; height: 50rpx;background-color: #f7f7fb;" /> |
|
|
|
<text class="cuIcon-add" @tap="add"></text> |
|
|
|
<block v-if="isRight(orderDetails)"> |
|
|
|
<self-line/> |
|
|
|
<view class="bg-white padding-tb-sm"> |
|
|
|
<skeleton :loading="skeletonLoading" :row="2" :showAvatar="false" :showTitle="true"> |
|
|
|
|
|
|
|
<view class="flex justify-between align-start padding-top-sm padding-lr"> |
|
|
|
<image :src="orderDetails.goods.cover" mode="aspectFill" style="width: 150rpx; height: 150rpx;"></image> |
|
|
|
<view class="flex-sub padding-left-sm"> |
|
|
|
<view class="bref-box margin-top-xs"> |
|
|
|
{{orderDetails.goods.name}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="flex justify-between margin-top-sm"> |
|
|
|
<view class="text-red text-price text-lg"> |
|
|
|
{{Number(orderDetails.goods.specs[0].selling_price || 0)}} |
|
|
|
<view class="flex justify-between"> |
|
|
|
<text class="block margin-top-sm text-gray text-sm">数量</text> |
|
|
|
<view class="flex align-center margin-top-sm"> |
|
|
|
<text class="cuIcon-move" @tap="reduce"></text> |
|
|
|
<input type="number" v-model="num" class="text-center margin-lr-sm radius" style="width: 60rpx; height: 50rpx;background-color: #f7f7fb;" /> |
|
|
|
<text class="cuIcon-add" @tap="add"></text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="flex justify-between margin-top-sm"> |
|
|
|
<view class="text-red text-price text-lg"> |
|
|
|
{{Number(orderDetails.goods.specs[0].selling_price || 0)}} |
|
|
|
</view> |
|
|
|
<!-- <view> |
|
|
|
<button v-if="true" class="cu-btn line-orange round margin-left-sm text-sm">申请退款</button> |
|
|
|
<button v-else class="cu-btn line-gray bg-gray round margin-left-sm text-sm">退款中</button> |
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
<!-- <view> |
|
|
|
<button v-if="true" class="cu-btn line-orange round margin-left-sm text-sm">申请退款</button> |
|
|
|
<button v-else class="cu-btn line-gray bg-gray round margin-left-sm text-sm">退款中</button> |
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</skeleton> |
|
|
|
</view> |
|
|
|
|
|
|
|
<self-line/> |
|
|
|
<skeleton :loading="skeletonLoading" :row="1" :showAvatar="false" :showTitle="true"> |
|
|
|
<view class="bg-white"> |
|
|
|
<view class="cu-bar padding-lr solid-bottom"> |
|
|
|
<text class="text-gray">优惠</text> |
|
|
|
<text>暂无优惠</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
</skeleton> |
|
|
|
</view> |
|
|
|
</skeleton> |
|
|
|
<self-line/> |
|
|
|
|
|
|
|
<skeleton :loading="skeletonLoading" :row="13" :showAvatar="false" :showTitle="true"> |
|
|
|
<view class="btn-bottom"> |
|
|
|
<view class="padding flex justify-around align-center" v-if="orderDetails.agreement.tips"> |
|
|
|
<checkbox-group class="block" @change="CheckboxChange"> |
|
|
|
<view class="margin-right"> |
|
|
|
<checkbox @change="CheckboxChange" :class="checkbox[0].checked?'checked':''" :checked="checkbox[0].checked?true:false" value="A"></checkbox> |
|
|
|
</view> |
|
|
|
</checkbox-group> |
|
|
|
<view class="text-sm text-gray">{{orderDetails.agreement.tips}}</view> |
|
|
|
|
|
|
|
<self-line/> |
|
|
|
<skeleton :loading="skeletonLoading" :row="1" :showAvatar="false" :showTitle="true"> |
|
|
|
<view class="bg-white"> |
|
|
|
<view class="cu-bar padding-lr solid-bottom"> |
|
|
|
<text class="text-gray">优惠</text> |
|
|
|
<text>暂无优惠</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<self-line/> |
|
|
|
<view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top shadow"> |
|
|
|
<view class="flex align-center"> |
|
|
|
<text class="">应付款:</text> |
|
|
|
<view class="text-lg text-price text-red"> |
|
|
|
{{Number(orderDetails.goods.specs[0].selling_price*num || 0)}} |
|
|
|
</skeleton> |
|
|
|
<self-line/> |
|
|
|
|
|
|
|
<skeleton :loading="skeletonLoading" :row="13" :showAvatar="false" :showTitle="true"> |
|
|
|
<view class="btn-bottom"> |
|
|
|
<view class="padding flex justify-around align-center" v-if="orderDetails.agreement.tips"> |
|
|
|
<checkbox-group class="block" @change="CheckboxChange"> |
|
|
|
<view class="margin-right"> |
|
|
|
<checkbox @change="CheckboxChange" :class="checkbox[0].checked?'checked':''" :checked="checkbox[0].checked?true:false" value="A"></checkbox> |
|
|
|
</view> |
|
|
|
</checkbox-group> |
|
|
|
<view class="text-sm text-gray">{{orderDetails.agreement.tips}}</view> |
|
|
|
</view> |
|
|
|
<self-line/> |
|
|
|
<view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top shadow"> |
|
|
|
<view class="flex align-center"> |
|
|
|
<text class="">应付款:</text> |
|
|
|
<view class="text-lg text-price text-red"> |
|
|
|
{{Number(orderDetails.goods.specs[0].selling_price*num || 0)}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<button class="cu-btn block bg-orange round shadow" @tap="submit"> |
|
|
|
<text class="cuIcon-loading2 cuIconfont-spin margin-right-xs text-white" v-if="loading"></text> |
|
|
|
<text class="text-df text-white">{{ loading ? '支付中...' : '下单付款' }}</text> |
|
|
|
</button> |
|
|
|
</view> |
|
|
|
<button class="cu-btn block bg-orange round shadow" @tap="submit"> |
|
|
|
<text class="cuIcon-loading2 cuIconfont-spin margin-right-xs text-white" v-if="loading"></text> |
|
|
|
<text class="text-df text-white">{{ loading ? '支付中...' : '下单付款' }}</text> |
|
|
|
</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</skeleton> |
|
|
|
</skeleton> |
|
|
|
</block> |
|
|
|
|
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -89,12 +92,18 @@ |
|
|
|
goods_id: 1, |
|
|
|
goods_specs_id: 1, |
|
|
|
orderDetails: {}, |
|
|
|
ifchoose: true |
|
|
|
ifchoose: true, |
|
|
|
ifCheck: true |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
total(){ |
|
|
|
return this.num * this.price |
|
|
|
}, |
|
|
|
isRight(){ |
|
|
|
return function(val){ |
|
|
|
return this.$shared.isRight(val); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(e) { |
|
|
|
@ -107,6 +116,11 @@ |
|
|
|
if(res.code == 0) { |
|
|
|
this.orderDetails = res.data |
|
|
|
this.skeletonLoading = false |
|
|
|
if( Object.keys(res.metal_data).length != 0 ) { |
|
|
|
this.ifCheck = false |
|
|
|
}else { |
|
|
|
this.ifCheck = true |
|
|
|
} |
|
|
|
}else { |
|
|
|
this.$msg(res.msg) |
|
|
|
} |
|
|
|
@ -136,39 +150,34 @@ |
|
|
|
}, |
|
|
|
submit(){ |
|
|
|
if(this.ifchoose == true) { |
|
|
|
this.$http(this.API.API_PRPAID, { |
|
|
|
goods_id: this.goods_id, |
|
|
|
goods_specs_id: this.goods_specs_id, |
|
|
|
number: this.num, |
|
|
|
token: 'fdf12000e774e48bc60c6b6d42055602' |
|
|
|
}).then(res => { |
|
|
|
console.log(res) |
|
|
|
|
|
|
|
// let nonceStr = res.data.nonceStr |
|
|
|
// appId: "wxb35ef055a4dd8ad4" |
|
|
|
// nonceStr: "60d3125d138af" |
|
|
|
// order_num: "2842855348400816128" |
|
|
|
// package: "prepay_id=wx23185213000285e14ea77ac97acc670000" |
|
|
|
// paySign: "6DC330CBDF6C29BEDD4D254D9DA97364" |
|
|
|
// signType: "MD5" |
|
|
|
// timeStamp: "1624445533" |
|
|
|
|
|
|
|
|
|
|
|
uni.requestPayment({ |
|
|
|
orderInfo: res.data.order_num, |
|
|
|
timeStamp: res.data.timeStamp, |
|
|
|
nonceStr: res.data.nonceStr, |
|
|
|
package: res.data.package, |
|
|
|
signType: res.data.signType, |
|
|
|
paySign: res.data.paySign, |
|
|
|
complete: result => { |
|
|
|
console.log(result) |
|
|
|
} |
|
|
|
if(this.ifCheck == false) { |
|
|
|
this.$routerGo('/pages/login/index?type=phone') |
|
|
|
}else { |
|
|
|
this.$http(this.API.API_PRPAID, { |
|
|
|
goods_id: this.goods_id, |
|
|
|
goods_specs_id: this.goods_specs_id, |
|
|
|
number: this.num, |
|
|
|
token: 'fdf12000e774e48bc60c6b6d42055602' |
|
|
|
}).then(res => { |
|
|
|
console.log(res) |
|
|
|
uni.requestPayment({ |
|
|
|
orderInfo: res.data.order_num, |
|
|
|
timeStamp: res.data.timeStamp, |
|
|
|
nonceStr: res.data.nonceStr, |
|
|
|
package: res.data.package, |
|
|
|
signType: res.data.signType, |
|
|
|
paySign: res.data.paySign, |
|
|
|
success: function (res) { |
|
|
|
this.$routerGo('/pages/order/pay-success?ifSuccess='+1) |
|
|
|
}, |
|
|
|
fail: function (err) { |
|
|
|
this.$routerGo('/pages/order/pay-success?ifSuccess='+2) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
return |
|
|
|
this.$routerGo('/pages/order/pay-success') |
|
|
|
} |
|
|
|
|
|
|
|
}else { |
|
|
|
this.$msg('请认真阅读并同意协议!') |
|
|
|
return |
|
|
|
|