|
@ -27,7 +27,7 @@ |
|
|
<view class="se-flex se-flex-ai-c se-pb-10"> |
|
|
<view class="se-flex se-flex-ai-c se-pb-10"> |
|
|
<view class="line-orange"></view> |
|
|
<view class="line-orange"></view> |
|
|
<view class="se-ml-10 se-fs-30 se-c-black se-fw-5"> |
|
|
<view class="se-ml-10 se-fs-30 se-c-black se-fw-5"> |
|
|
购买保险(必买) |
|
|
|
|
|
|
|
|
购买保险(可选) |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
@ -68,8 +68,13 @@ |
|
|
<text class="se-fs-24">合计</text> |
|
|
<text class="se-fs-24">合计</text> |
|
|
<text class="se-c-orange">¥{{items.premium}}元</text> |
|
|
<text class="se-c-orange">¥{{items.premium}}元</text> |
|
|
</view> |
|
|
</view> |
|
|
<view @click="onPay()" class="se-mr-30 se-w-240 se-h-80 se-lh-80 se-ta-c se-c-white se-fs-32 se-br-40 se-bgc-orange"> |
|
|
|
|
|
立即支付 |
|
|
|
|
|
|
|
|
<view class="se-flex se-mr-30"> |
|
|
|
|
|
<view @click="onReject()" class="se-mr-20 se-w-120 se-h-80 se-lh-80 se-ta-c se-c-orange se-fs-28 se-br-40 se-b se-bc-orange"> |
|
|
|
|
|
拒绝 |
|
|
|
|
|
</view> |
|
|
|
|
|
<view @click="onPay()" class="se-w-240 se-h-80 se-lh-80 se-ta-c se-c-white se-fs-32 se-br-40 se-bgc-orange"> |
|
|
|
|
|
立即支付 |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<u-popup :show="show" :custom-style="{alignItems:'center'}" mode="center" bg-color="transparent"> |
|
|
<u-popup :show="show" :custom-style="{alignItems:'center'}" mode="center" bg-color="transparent"> |
|
@ -87,6 +92,9 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</u-popup> |
|
|
</u-popup> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 免责声明组件 --> |
|
|
|
|
|
<disclaimer-modal ref="disclaimerModal" @cancel="onDisclaimerCancel" @confirm="onDisclaimerConfirm"></disclaimer-modal> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -94,7 +102,11 @@ |
|
|
import { |
|
|
import { |
|
|
getTaskById,orderTask,orderDetail,userInfo,payOrder |
|
|
getTaskById,orderTask,orderDetail,userInfo,payOrder |
|
|
} from "@/common/api.js" |
|
|
} from "@/common/api.js" |
|
|
|
|
|
import DisclaimerModal from "@/components/disclaimer/index.vue" |
|
|
export default{ |
|
|
export default{ |
|
|
|
|
|
components: { |
|
|
|
|
|
DisclaimerModal |
|
|
|
|
|
}, |
|
|
data(){ |
|
|
data(){ |
|
|
return{ |
|
|
return{ |
|
|
show:false, |
|
|
show:false, |
|
@ -142,6 +154,19 @@ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
onPay(){ |
|
|
onPay(){ |
|
|
|
|
|
this.payWithInsurance(true); |
|
|
|
|
|
}, |
|
|
|
|
|
onReject(){ |
|
|
|
|
|
this.$refs.disclaimerModal.open(); |
|
|
|
|
|
}, |
|
|
|
|
|
onDisclaimerCancel(){ |
|
|
|
|
|
// 取消免责声明,不执行任何操作 |
|
|
|
|
|
}, |
|
|
|
|
|
onDisclaimerConfirm(){ |
|
|
|
|
|
// 确认免责声明,继续不购买保险的支付流程 |
|
|
|
|
|
this.payWithInsurance(false); |
|
|
|
|
|
}, |
|
|
|
|
|
payWithInsurance(buyInsurance){ |
|
|
let that = this |
|
|
let that = this |
|
|
console.info(that.checked) |
|
|
console.info(that.checked) |
|
|
if(that.checked.length==0){ |
|
|
if(that.checked.length==0){ |
|
@ -154,65 +179,36 @@ |
|
|
let data = { |
|
|
let data = { |
|
|
orderId : that.id, |
|
|
orderId : that.id, |
|
|
payType : that.payRadio, |
|
|
payType : that.payRadio, |
|
|
|
|
|
buyInsurance: buyInsurance // 新增参数,表示是否购买保险 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// if(that.payRadio==1){ |
|
|
|
|
|
payOrder(data).then(res=>{ |
|
|
|
|
|
|
|
|
|
|
|
if(data.payType == '2'){ |
|
|
|
|
|
uni.requestPayment({ |
|
|
|
|
|
provider: 'wxpay', // 服务提提供商 |
|
|
|
|
|
timeStamp: res.result.timeStamp, // 时间戳 |
|
|
|
|
|
nonceStr: res.result.nonceStr, // 随机字符串 |
|
|
|
|
|
package: res.result.packageValue, |
|
|
|
|
|
signType: res.result.signType, // 签名算法 |
|
|
|
|
|
paySign: res.result.paySign, // 签名 |
|
|
|
|
|
success: function (res) { |
|
|
|
|
|
that.onDetail(); |
|
|
|
|
|
}, |
|
|
|
|
|
fail: function (err) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
icon:'none', |
|
|
|
|
|
title:"支付失败" |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}else if(res.code == 200){ |
|
|
|
|
|
that.onDetail(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch(error=>{ |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
// }else if(that.payRadio==2){ |
|
|
|
|
|
// payOrder({orderId:that.id}).then(response=>{ |
|
|
|
|
|
// console.info("payOrder",response) |
|
|
|
|
|
// uni.requestPayment({ |
|
|
|
|
|
// provider: "wxpay", |
|
|
|
|
|
// nonceStr: response.result.nonceStr, |
|
|
|
|
|
// package: response.result.package, |
|
|
|
|
|
// timeStamp: response.result.timeStamp, |
|
|
|
|
|
// signType: response.result.signType, |
|
|
|
|
|
// paySign: response.result.paySign, |
|
|
|
|
|
// success(res) { |
|
|
|
|
|
// that.$u.toast("付款成功!") |
|
|
|
|
|
// that.onDetail(); |
|
|
|
|
|
// }, |
|
|
|
|
|
// fail(err) { |
|
|
|
|
|
// console.info(err) |
|
|
|
|
|
// console.log('支付失败',err); |
|
|
|
|
|
// uni.showToast({ |
|
|
|
|
|
// icon:'none', |
|
|
|
|
|
// title:"支付失败" |
|
|
|
|
|
// }) |
|
|
|
|
|
// } |
|
|
|
|
|
// }) |
|
|
|
|
|
// }).catch(error=>{ |
|
|
|
|
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
payOrder(data).then(res=>{ |
|
|
|
|
|
|
|
|
|
|
|
if(data.payType == '2'){ |
|
|
|
|
|
uni.requestPayment({ |
|
|
|
|
|
provider: 'wxpay', // 服务提提供商 |
|
|
|
|
|
timeStamp: res.result.timeStamp, // 时间戳 |
|
|
|
|
|
nonceStr: res.result.nonceStr, // 随机字符串 |
|
|
|
|
|
package: res.result.packageValue, |
|
|
|
|
|
signType: res.result.signType, // 签名算法 |
|
|
|
|
|
paySign: res.result.paySign, // 签名 |
|
|
|
|
|
success: function (res) { |
|
|
|
|
|
that.onDetail(); |
|
|
|
|
|
}, |
|
|
|
|
|
fail: function (err) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
icon:'none', |
|
|
|
|
|
title:"支付失败" |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}else if(res.code == 200){ |
|
|
|
|
|
that.onDetail(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}).catch(error=>{ |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
onDetail(){ |
|
|
onDetail(){ |
|
|
uni.redirectTo({ |
|
|
uni.redirectTo({ |
|
|