|
|
@ -7,6 +7,15 @@ import { routeTo, showModal } from "@/utils/polish"; |
|
|
|
import { previewBase64Image } from "@/utils"; |
|
|
|
const orderInfo = ref({}); |
|
|
|
onLoad(oprions => { |
|
|
|
if(oprions?.order_no){ |
|
|
|
orderGet({ data: { order_no: oprions?.order_no, brand_id: oprions?.brand_id ?? '' } }) |
|
|
|
.then(oRes=>{ |
|
|
|
orderInfo.value = oRes?.data ?? {}; |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 次卡没有订单号,需要轮询 |
|
|
|
getOrderNoFn({ verify_token: oprions?.verify_token ?? '' }) |
|
|
|
.then(orderNo =>{ |
|
|
|
orderGet({ data: { order_no: orderNo, brand_id: oprions?.brand_id ?? '' } }) |
|
|
@ -18,7 +27,7 @@ onLoad(oprions => { |
|
|
|
|
|
|
|
// ef5bc53a8711d876adbfac7710a03f3f |
|
|
|
|
|
|
|
function getOrderNoFn({ verify_token, times = 1, max = 5, interval = 300 }){ |
|
|
|
function getOrderNoFn({ verify_token, times = 1, max = 100, interval = 300 }){ |
|
|
|
if(times > max){ |
|
|
|
console.warn('轮询了' + (times - 1) + '次'); |
|
|
|
showModal({ content: '查询超时!' }); |
|
|
@ -103,6 +112,7 @@ function toOrderDetail(){ |
|
|
|
</view> |
|
|
|
<view class="es-share" v-if="false">分享给朋友 </view> |
|
|
|
</view> |
|
|
|
<view v-else>加载中...</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|