|
|
@@ -14,24 +14,22 @@
|
|
|
</block>
|
|
|
<view class="status-text app-size-36 app-bold">{{ pageTit }}</view>
|
|
|
<block v-if="pageStatus == 1 || pageStatus == 2">
|
|
|
- <view class="price">
|
|
|
- <span class="app-size-36 app-bold">¥{{ totalPrice }}</span>
|
|
|
+
|
|
|
+ <view class="price" v-if="Number(orderInfo.hbAmount)>0 || Number(orderInfo.discountAmount)>0">
|
|
|
+ <view style="text-decoration:line-through;font-size:30upx;font-weight:bold;color:#8a7f7f;">¥{{ parseFloat((Number(orderInfo.hbAmount)+Number(orderInfo.actPrice)+Number(orderInfo.discountAmount)).toFixed(2)) }}</view>
|
|
|
+ <view style="color:red;font-size:30upx;font-weight:bold;margin-bottom:10upx;" v-if="Number(orderInfo.hbAmount)>0">红包 -¥{{ parseFloat(orderInfo.hbAmount) }}</view>
|
|
|
+ <view style="color:red;font-size:30upx;font-weight:bold;margin-bottom:10upx;" v-if="Number(orderInfo.discountAmount)>0">订单优惠 -¥{{ parseFloat(orderInfo.discountAmount) }}</view>
|
|
|
+ <span class="app-size-36 app-bold">¥{{ orderInfo.actPrice?parseFloat(orderInfo.actPrice):0 }}</span>
|
|
|
</view>
|
|
|
- <view class="order-num app-color-3">订单号: {{ orderSn }}</view>
|
|
|
- </block>
|
|
|
- <block v-else-if="pageStatus == 3 && payDiscountPrice >0">
|
|
|
- <view>
|
|
|
- <span v-if="payDiscountType == 0" class="app-color-2">使用优惠券为您省</span>
|
|
|
- <span v-else-if="payDiscountType == 1" class="app-color-2">会员身份为您省</span>
|
|
|
- <span v-else-if="payDiscountType == 2" class="app-color-2">随机优惠为您省</span>
|
|
|
- <span v-else class="app-color-2">随机优惠为您省</span>
|
|
|
- <span class="app-price">{{ payDiscountPrice }}元</span>
|
|
|
+ <view class="price" v-else>
|
|
|
+ <span class="app-size-36 app-bold">¥{{ orderInfo.actPrice?parseFloat(orderInfo.actPrice):0 }}</span>
|
|
|
</view>
|
|
|
+ <view class="order-num app-color-3" style="margin-top:10upx;">订单号: {{ orderSn }}</view>
|
|
|
</block>
|
|
|
<block v-if="pageStatus == 1 || pageStatus == 2">
|
|
|
<view class="call-one-btn">
|
|
|
<view v-if="Number(hdInfo.balance)>0" style="color:green;font-weight:bold;font-size:36upx;margin-top:28upx;">可用余额 ¥{{ parseFloat(hdInfo.balance) }}</view>
|
|
|
- <button v-if="isYeBtnShow" class="button-com green pay-wx" @click="balancePayFn" style="height:100upx;line-height:50upx;">余额支付</button>
|
|
|
+ <button v-if="orderInfo.showYePay == 1" class="button-com green pay-wx" @click="balancePayFn" style="height:100upx;line-height:50upx;">余额支付</button>
|
|
|
<button v-if="getPayType == 1" class="button-com green pay-wx" @click="wxPayFn" style="height:100upx;line-height:50upx;">微信支付</button>
|
|
|
<button v-else class="button-com green pay-wx" @click="wxPayFnOld" style="height:100upx;line-height:50upx;">微信支付</button>
|
|
|
</view>
|
|
|
@@ -39,6 +37,12 @@
|
|
|
<block v-else-if="pageStatus == 3 || pageStatus == 4 || pageStatus == 5">
|
|
|
<view class="call-btn-com call-two-btn" v-if="$util.isEmpty(loginInfo)"> <button class="button-com" @click="register()" >注册会员</button> </view>
|
|
|
<view class="call-btn-com call-two-btn"> <button class="button-com default" @click="goBackHome()" >返回首页</button></view>
|
|
|
+
|
|
|
+ <!-- #ifdef MP-WEIXIN -->
|
|
|
+ <view style="width:100%;height:10upx;background-color:white;margin-top:60upx;"></view>
|
|
|
+ <ad-custom unit-id="adunit-510957a20b72a06b"></ad-custom>
|
|
|
+ <!-- #endif -->
|
|
|
+
|
|
|
</block>
|
|
|
</view>
|
|
|
<view class="coupon-wrap" v-if="option.pageStatus == 5">
|
|
|
@@ -49,8 +53,6 @@
|
|
|
<img :src="`${constant.imgUrl}/retail/images/extension.png`" alt mode="widthFix" />
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
-
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -60,9 +62,8 @@ import ModalModule from "@/components/plugin/modal";
|
|
|
import AlertModule from "@/components/plugin/alert";
|
|
|
import wexinPay from "@/utils/pay/wxPay";
|
|
|
import { getShopUser } from "@/utils/auth";
|
|
|
-import { balancePay, wxPay } from "@/api/order";
|
|
|
+import { balancePay, wxPay,getDetail } from "@/api/order";
|
|
|
import { postWxCode } from '@/api/mini';
|
|
|
-import { getHdInfo } from '@/api/hd';
|
|
|
export default {
|
|
|
name: "index",
|
|
|
components: {
|
|
|
@@ -75,21 +76,17 @@ export default {
|
|
|
pageTit: "",
|
|
|
pageStatus: 1,
|
|
|
contentClass: "",
|
|
|
- payDiscountPrice: null,
|
|
|
- payDiscountType: 0,
|
|
|
passwordModal: false,
|
|
|
form: {
|
|
|
payPassword: ""
|
|
|
},
|
|
|
+ orderInfo:{showYePay:0},
|
|
|
payCallData: {},
|
|
|
setPassModal: false,
|
|
|
- totalPrice:0,
|
|
|
orderSn:'',
|
|
|
getPayType:1,
|
|
|
hasRequestApi:false,
|
|
|
- hdInfo:{},
|
|
|
- isYeBtnShow:false,
|
|
|
- id:0
|
|
|
+ hdInfo:{}
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -106,28 +103,16 @@ export default {
|
|
|
init() {
|
|
|
this.orderSn = this.option.orderSn ? this.option.orderSn : ''
|
|
|
this.getPayType = this.option.getPayType
|
|
|
- if(this.option.totalPrice){
|
|
|
- this.totalPrice = Number(this.option.totalPrice)
|
|
|
- this.totalPrice = this.totalPrice.toFixed(2)
|
|
|
- this.totalPrice = parseFloat(this.totalPrice)
|
|
|
- }
|
|
|
this.pageStatus = this.option.pageStatus;
|
|
|
- this.payDiscountPrice = this.option.payDiscountPrice;
|
|
|
- this.payDiscountType = this.option.payDiscountType;
|
|
|
this.initClass(this.pageStatus);
|
|
|
getShopUser(true)
|
|
|
-
|
|
|
- if(this.option.hdId && this.option.hdId>0){
|
|
|
- getHdInfo({id:this.option.hdId}).then(res=>{
|
|
|
- if(res.code == 1){
|
|
|
- this.hdInfo = res.data.hd ? res.data.hd : {}
|
|
|
- if(Number(this.hdInfo.balance) >= Number(this.totalPrice)){
|
|
|
- this.isYeBtnShow = true
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
+ let id = this.option.id?this.option.id:0
|
|
|
+ getDetail({id:id}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ this.orderInfo = res.data ? res.data : {}
|
|
|
+ console.log('this.orderInfo',this.orderInfo)
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
wxPayFn() {
|
|
|
let that = this
|
|
|
@@ -153,7 +138,6 @@ export default {
|
|
|
this.payCallData = res.data
|
|
|
wexinPay(res.data, that.paySuccess, that.payFail)
|
|
|
that.orderSn = res.data.orderSn ? res.data.orderSn : ''
|
|
|
- that.id = res.data.id ? res.data.id : 0
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
@@ -169,22 +153,16 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
paySuccess() {
|
|
|
- let account= this.option.account?this.option.account:0
|
|
|
- let hdId = this.option.hdId ? this.option.hdId:0
|
|
|
- let id = this.option.id ? this.option.id : 0
|
|
|
- this.$util.pageTo({ url: "/pages/callback/paySuccess?id="+id+'&account='+account+'&hdId='+hdId, type: 2 })
|
|
|
+ this.$util.pageTo({ url: "/pages/callback/paySuccess", type: 2 })
|
|
|
},
|
|
|
payFail() {
|
|
|
},
|
|
|
balancePayFn() {
|
|
|
let that = this
|
|
|
- let account= this.option.account?this.option.account:0
|
|
|
- let hdId = this.option.hdId ? this.option.hdId:0
|
|
|
- let id = this.option.id ? this.option.id : 0
|
|
|
that.$util.confirmModal({content:'确认余额支付?'},() => {
|
|
|
balancePay({orderSn:this.orderSn}).then(res=>{
|
|
|
if(res.code == 1){
|
|
|
- this.$util.pageTo({ url:"/pages/callback/paySuccess?id="+id+'&account='+account+'&hdId='+hdId,type: 2})
|
|
|
+ this.$util.pageTo({ url:"/pages/callback/paySuccess",type: 2})
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
@@ -300,7 +278,7 @@ export default {
|
|
|
.awaitPayYe {
|
|
|
.status-text {
|
|
|
margin-top: 22upx;
|
|
|
- margin-bottom: 52upx;
|
|
|
+ margin-bottom:26upx;
|
|
|
color: #ffa92e;
|
|
|
}
|
|
|
.surplus {
|