Commit dc41628a by 李伟康

```

feat(OrderPay): 添加二维码加载状态提示

在获取支付二维码的过程中,增加 loading 状态展示,避免页面空白。同时优化了二维码渲染逻辑,
确保只有在二维码图片加载完成后再显示相关内容。此外,为弹窗添加了淡入淡出过渡动画,
提升用户体验。

- 增加 loading 图标资源引用
- 在 data 中注入 loadingIcon 数据
- 使用 v-else 显示加载状态
- 为 popup 容器添加 transition 过渡效果
- 调整 getOrderDetail 方法中的判断条件,防止组件未挂载时报错
```
1 parent 3debe636
...@@ -20,17 +20,28 @@ ...@@ -20,17 +20,28 @@
</view> </view>
</template> </template>
<template #content> <template #content>
<view class="pos-popup"> <template v-if="orderInfo.payId">
<template v-if="orderInfo.payId"> <view class="pos-popup">
<view class="price">¥{{ orderInfo.total_price }}</view> <template v-if="wxqrcode || posQrCode">
<image <view class="price">¥{{ orderInfo.total_price }}</view>
class="qrcode" <image
:src="orderInfo.payType == 1 ? wxqrcode : posQrCode" class="qrcode"
></image> :src="orderInfo.payType == 1 ? wxqrcode : posQrCode"
<view class="level-1-tips">{{ orderInfo.payType == 1 ? '请让客户打开微信扫描上方付款码进行支付' : '请使用POS机扫描此码,再向客户收款' }}</view> ></image>
<view class="level-2-tips">超过24小时未支付将关闭此订单</view> <view class="level-1-tips">{{ orderInfo.payType == 1 ? '请让客户打开微信扫描上方付款码进行支付' : '请使用POS机扫描此码,再向客户收款' }}</view>
</template> <view class="level-2-tips">超过24小时未支付将关闭此订单</view>
</view> </template>
<template v-else>
<view class="loading-box">
<image
class="loading"
:src="loadingIcon"
/>
</view>
</template>
</view>
</template>
</template> </template>
</PublishPopup> </PublishPopup>
</template> </template>
...@@ -38,6 +49,7 @@ ...@@ -38,6 +49,7 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import PublishPopup from '@/components/PublishPopup.vue' import PublishPopup from '@/components/PublishPopup.vue'
import qrcode from '@/utils/qrcode' import qrcode from '@/utils/qrcode'
const loadingIcon = require('@/assets/images/common/loadding.gif')
export default { export default {
components: { components: {
PublishPopup PublishPopup
...@@ -45,6 +57,7 @@ export default { ...@@ -45,6 +57,7 @@ export default {
name: '', name: '',
data () { data () {
return { return {
loadingIcon,
orderInfo: {}, orderInfo: {},
wxqrcode: '', wxqrcode: '',
posQrCode: '', posQrCode: '',
...@@ -84,11 +97,11 @@ export default { ...@@ -84,11 +97,11 @@ export default {
}, },
async getOrderDetail () { async getOrderDetail () {
uni.hideLoading() uni.hideLoading()
if (!this.show) return if (!this.show || !this.$refs.payPopup) return
const { payId } = this.orderInfo const { payId } = this.orderInfo
if (payId) { if (payId) {
const data = await uni.$api.equityApi.getOrderDetail({ orderCode: payId }) const data = await uni.$api.equityApi.getOrderDetail({ orderCode: payId })
console.log(data,'----') console.log(data, '----')
this.orderInfo.total_price = data.totalPrice this.orderInfo.total_price = data.totalPrice
let { payOrder, status } = data let { payOrder, status } = data
if (payOrder?.payStatus == 2 || status == 4) { if (payOrder?.payStatus == 2 || status == 4) {
...@@ -183,6 +196,7 @@ export default { ...@@ -183,6 +196,7 @@ export default {
background: #ffffff; background: #ffffff;
margin: 0 auto toRpx(63) auto; margin: 0 auto toRpx(63) auto;
padding: toRpx(63) 0; padding: toRpx(63) 0;
transition: all 0.15s;
.qrcode { .qrcode {
width: toRpx(320); width: toRpx(320);
height: toRpx(320); height: toRpx(320);
...@@ -207,4 +221,18 @@ export default { ...@@ -207,4 +221,18 @@ export default {
} }
} }
} }
.loading-box{
position: relative;
width: 100%;
height: 574rpx;
.loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: toRpx(128);
height: toRpx(128);
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!