status.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <view class="page">
  3. <u-navbar title="储值管理" :autoBack="true" :placeholder="true"></u-navbar>
  4. <!-- 遮罩弹窗:审核中 / 申请失败 -->
  5. <view class="mask" v-if="!loading">
  6. <view class="dialog" @click.stop>
  7. <!-- 审核中 auditStatus=1 -->
  8. <template v-if="auditStatus === 1">
  9. <view class="title">提交申请</view>
  10. <view class="msg">您已提交申请,请耐心等待平台审核。</view>
  11. <view class="btn" @click="goHome">我知道了</view>
  12. </template>
  13. <!-- 已驳回 auditStatus=3 -->
  14. <template v-else-if="auditStatus === 3">
  15. <view class="title">申请失败</view>
  16. <view class="reason-block" v-if="rejectReason">
  17. <text class="reason-label">原因:</text>
  18. <text class="reason-text">{{ rejectReason }}</text>
  19. </view>
  20. <view class="reason-block" v-else>
  21. <text class="reason-text">暂无失败原因说明</text>
  22. </view>
  23. <view
  24. class="btn"
  25. :class="{ disabled: reapplyStatus === 1 }"
  26. @click="reApply"
  27. >
  28. {{ reapplyStatus === 1 ? '暂不可重新申请' : '重新申请' }}
  29. </view>
  30. </template>
  31. <!-- 异常兜底 -->
  32. <template v-else>
  33. <view class="msg">状态异常,请返回重试</view>
  34. <view class="btn" @click="goBack">返回</view>
  35. </template>
  36. </view>
  37. </view>
  38. <view class="loading" v-else>
  39. <u-loading mode="circle" size="48"></u-loading>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import prepaidApi, { getMerchantId } from '@/api/memberPrepaid.js'
  45. export default {
  46. data() {
  47. return {
  48. loading: true,
  49. auditStatus: 1,
  50. reapplyStatus: 0,
  51. rejectReason: ''
  52. };
  53. },
  54. onShow() {
  55. this.loadStatus();
  56. },
  57. methods: {
  58. loadStatus() {
  59. const merchantId = getMerchantId();
  60. if (!merchantId) {
  61. this.loading = false;
  62. uni.showToast({ title: '未获取到门店信息', icon: 'none' });
  63. return;
  64. }
  65. this.loading = true;
  66. prepaidApi
  67. .getFeatureStatus(merchantId)
  68. .then((res) => {
  69. if (res.data.code !== 200) {
  70. uni.showToast({ title: res.data.message || '加载失败', icon: 'none' });
  71. return;
  72. }
  73. const data = res.data.result || {};
  74. this.auditStatus = Number(data.auditStatus);
  75. this.reapplyStatus = Number(data.reapplyStatus);
  76. this.rejectReason = data.rejectReason || '';
  77. if (this.auditStatus === 0) {
  78. uni.redirectTo({ url: '/pages/topUp/agreement' });
  79. } else if (this.auditStatus === 2) {
  80. uni.redirectTo({ url: '/pages/topUp/manage' });
  81. }
  82. })
  83. .catch(() => {
  84. uni.showToast({ title: '网络异常,请稍后重试', icon: 'none' });
  85. })
  86. .finally(() => {
  87. this.loading = false;
  88. });
  89. },
  90. goHome() {
  91. uni.switchTab({ url: '/pages/index/index' });
  92. },
  93. goBack() {
  94. uni.redirectTo({ url: '/pages/topUp/index' });
  95. },
  96. reApply() {
  97. if (this.reapplyStatus === 1) {
  98. uni.showToast({ title: '当前不可重新申请', icon: 'none' });
  99. return;
  100. }
  101. uni.redirectTo({ url: '/pages/topUp/agreement?reapply=1' });
  102. }
  103. }
  104. };
  105. </script>
  106. <style scoped lang="scss">
  107. .page {
  108. min-height: 100vh;
  109. background: #f7f7f7;
  110. }
  111. .mask {
  112. position: fixed;
  113. left: 0;
  114. right: 0;
  115. top: 0;
  116. bottom: 0;
  117. background: rgba(0, 0, 0, 0.45);
  118. display: flex;
  119. align-items: center;
  120. justify-content: center;
  121. z-index: 100;
  122. padding: 0 64rpx;
  123. box-sizing: border-box;
  124. }
  125. .dialog {
  126. width: 100%;
  127. background: #fff;
  128. border-radius: 24rpx;
  129. padding: 56rpx 48rpx 48rpx;
  130. display: flex;
  131. flex-direction: column;
  132. align-items: center;
  133. }
  134. .loading {
  135. padding-top: 200rpx;
  136. display: flex;
  137. justify-content: center;
  138. }
  139. .title {
  140. font-size: 36rpx;
  141. font-weight: 600;
  142. color: #1a1a1a;
  143. text-align: center;
  144. margin-bottom: 28rpx;
  145. }
  146. .msg {
  147. font-size: 28rpx;
  148. color: #333;
  149. text-align: center;
  150. line-height: 1.7;
  151. margin-bottom: 48rpx;
  152. }
  153. .reason-block {
  154. width: 100%;
  155. margin-bottom: 48rpx;
  156. font-size: 28rpx;
  157. line-height: 1.7;
  158. color: #333;
  159. word-break: break-all;
  160. text-align: left;
  161. }
  162. .reason-label {
  163. color: #333;
  164. }
  165. .reason-text {
  166. color: #333;
  167. }
  168. .btn {
  169. width: 100%;
  170. height: 88rpx;
  171. line-height: 88rpx;
  172. text-align: center;
  173. background: linear-gradient(90deg, #51a2ff 0%, #4ec2ff 100%);
  174. color: #fff;
  175. font-size: 32rpx;
  176. border-radius: 140rpx;
  177. &.disabled {
  178. opacity: 0.5;
  179. }
  180. }
  181. </style>