|
@@ -87,15 +87,6 @@ function next() {
|
|
|
showProtocol.value = false
|
|
showProtocol.value = false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-async function handleH5PayResult(orderNumber: string) {
|
|
|
|
|
- const isPaySuccess = await useUserStore().pollOrderPaySuccess(orderNumber)
|
|
|
|
|
- if (isPaySuccess) {
|
|
|
|
|
- await useUserStore().paySuccess('film-order', 'subPack-film/index/index')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- useGlobalToast().show({ msg: '暂未查询到支付成功,请稍后在订单列表查看' })
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
async function pay() {
|
|
async function pay() {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
try {
|
|
try {
|
|
@@ -118,15 +109,16 @@ async function pay() {
|
|
|
const payMent = await useUserStore().getPayMent(orderNumber)
|
|
const payMent = await useUserStore().getPayMent(orderNumber)
|
|
|
if (payMent.payType !== 'point') {
|
|
if (payMent.payType !== 'point') {
|
|
|
try {
|
|
try {
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
|
|
- const res = await useUserStore().handleCommonPayMent(orderNumber)
|
|
|
|
|
- await useUserStore().getWxCommonPayment(res)
|
|
|
|
|
- await useUserStore().paySuccess('film-order', 'subPack-film/index/index')
|
|
|
|
|
- // #endif
|
|
|
|
|
- // #ifdef H5
|
|
|
|
|
- useUserStore().handleCommonWechatPay(orderNumber)
|
|
|
|
|
- await handleH5PayResult(orderNumber)
|
|
|
|
|
- // #endif
|
|
|
|
|
|
|
+ // // #ifdef MP-WEIXIN
|
|
|
|
|
+ // const res = await useUserStore().handleCommonPayMent(orderNumber)
|
|
|
|
|
+ // await useUserStore().getWxCommonPayment(res)
|
|
|
|
|
+ // await useUserStore().paySuccess('film-order', 'subPack-film/index/index')
|
|
|
|
|
+ // // #endif
|
|
|
|
|
+ // // #ifdef H5
|
|
|
|
|
+ // useUserStore().handleCommonWechatPay(orderNumber)
|
|
|
|
|
+ // await handleH5PayResult(orderNumber)
|
|
|
|
|
+ // // #endif
|
|
|
|
|
+ useGlobalToast().show('暂不支持微信支付')
|
|
|
}
|
|
}
|
|
|
catch {
|
|
catch {
|
|
|
await useUserStore().payError('film-order', 'subPack-film/index/index')
|
|
await useUserStore().payError('film-order', 'subPack-film/index/index')
|
|
@@ -144,7 +136,14 @@ async function pay() {
|
|
|
loading.value = false
|
|
loading.value = false
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+// async function handleH5PayResult(orderNumber: string) {
|
|
|
|
|
+// const isPaySuccess = await useUserStore().pollOrderPaySuccess(orderNumber)
|
|
|
|
|
+// if (isPaySuccess) {
|
|
|
|
|
+// await useUserStore().paySuccess('film-order', 'subPack-film/index/index')
|
|
|
|
|
+// return
|
|
|
|
|
+// }
|
|
|
|
|
+// useGlobalToast().show({ msg: '暂未查询到支付成功,请稍后在订单列表查看' })
|
|
|
|
|
+// }
|
|
|
function call() {
|
|
function call() {
|
|
|
uni.makePhoneCall({
|
|
uni.makePhoneCall({
|
|
|
phoneNumber: info.value.phone,
|
|
phoneNumber: info.value.phone,
|
|
@@ -163,14 +162,9 @@ async function getPoints() {
|
|
|
getPoints()
|
|
getPoints()
|
|
|
|
|
|
|
|
function usePoints() {
|
|
function usePoints() {
|
|
|
- return Math.round(totalPrice.value * 100) >= info.value.points ? info.value.points : Math.round(totalPrice.value * 100)
|
|
|
|
|
|
|
+ return (totalPrice.value * 100) >= info.value.points ? info.value.points : ((totalPrice.value * 10000) / 100)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const actualPayPrice = computed(() => {
|
|
|
|
|
- const result = (Math.round(totalPrice.value * 100) - usePoints()) / 100
|
|
|
|
|
- return Math.max(0, Number(result.toFixed(2)))
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
onLoad((options) => {
|
|
onLoad((options) => {
|
|
|
query.value = JSON.parse(options?.query)
|
|
query.value = JSON.parse(options?.query)
|
|
|
info.value = uni.getStorageSync('film-info')
|
|
info.value = uni.getStorageSync('film-info')
|
|
@@ -284,7 +278,7 @@ onLoad((options) => {
|
|
|
总计
|
|
总计
|
|
|
</view>
|
|
</view>
|
|
|
<view class="total">
|
|
<view class="total">
|
|
|
- ¥{{ actualPayPrice }}
|
|
|
|
|
|
|
+ ¥{{ (totalPrice * 100 - usePoints()) / 100 }}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -323,7 +317,7 @@ onLoad((options) => {
|
|
|
<view class="footer-box">
|
|
<view class="footer-box">
|
|
|
<view class="price-box">
|
|
<view class="price-box">
|
|
|
<view class="total">
|
|
<view class="total">
|
|
|
- ¥{{ actualPayPrice }}
|
|
|
|
|
|
|
+ ¥{{ (totalPrice * 100 - usePoints()) / 100 }}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="reduce">
|
|
<view class="reduce">
|
|
|
共减¥{{ usePoints() / 100 }}
|
|
共减¥{{ usePoints() / 100 }}
|