commission-auth.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <!-- 页面 -->
  2. <template>
  3. <su-popup
  4. :show="state.show"
  5. type="center"
  6. round="10"
  7. @close="state.show = false"
  8. :isMaskClick="false"
  9. maskBackgroundColor="rgba(0, 0, 0, 0.7)"
  10. >
  11. <view class="notice-box">
  12. <view class="img-wrap">
  13. <image
  14. class="notice-img"
  15. :src="sheep.$url.static(state.event.image)"
  16. mode="aspectFill"
  17. ></image>
  18. </view>
  19. <view class="notice-title">{{ state.event.title }}</view>
  20. <view class="notice-detail">{{ state.event.subtitle }}</view>
  21. <button
  22. class="ss-reset-button notice-btn ui-Shadow-Main ui-BG-Main-Gradient"
  23. @tap="onTap(state.event.action)"
  24. >
  25. {{ state.event.button }}
  26. </button>
  27. <button class="ss-reset-button back-btn" @tap="sheep.$router.back()"> 返回 </button>
  28. </view>
  29. </su-popup>
  30. </template>
  31. <script setup>
  32. import sheep from '@/sheep';
  33. import { reactive, watch } from 'vue';
  34. const props = defineProps({
  35. error: {
  36. type: Number,
  37. default: 0,
  38. },
  39. });
  40. const emits = defineEmits(['getAgentInfo']);
  41. const state = reactive({
  42. event: {},
  43. show: false,
  44. });
  45. watch(
  46. () => props.error,
  47. (error) => {
  48. if (error !== 0 && error !== 100) {
  49. state.event = eventMap[error];
  50. state.show = true;
  51. }
  52. },
  53. );
  54. async function onTap(eventName) {
  55. switch (eventName) {
  56. case 'back': // 返回
  57. sheep.$router.back();
  58. break;
  59. case 'apply': // 需提交资料
  60. sheep.$router.go('/pages/commission/apply');
  61. break;
  62. case 'reApply': // 直接重新申请
  63. let { error } = await sheep.$api.commission.apply();
  64. if (error === 0) {
  65. emits('getAgentInfo');
  66. }
  67. break;
  68. }
  69. }
  70. const eventMap = {
  71. // 关闭
  72. 101: {
  73. image: '/static/img/shop/commission/close.png',
  74. title: '分销中心已关闭',
  75. subtitle: '该功能暂不可用',
  76. button: '知道了',
  77. action: 'back',
  78. },
  79. // 禁用
  80. 102: {
  81. image: '/static/img/shop/commission/forbidden.png',
  82. title: '账户已被禁用',
  83. subtitle: '该功能暂不可用',
  84. button: '知道了',
  85. action: 'back',
  86. },
  87. // 补充信息
  88. 103: {
  89. image: '/static/img/shop/commission/apply.png',
  90. title: '待完善信息',
  91. subtitle: '请补充您的信息后提交审核',
  92. button: '完善信息',
  93. action: 'apply',
  94. },
  95. // 审核中
  96. 104: {
  97. image: '/static/img/shop/commission/pending.png',
  98. title: '正在审核中',
  99. subtitle: '请耐心等候结果',
  100. button: '知道了',
  101. action: 'back',
  102. },
  103. // 重新提交
  104. 105: {
  105. image: '/static/img/shop/commission/reject.png',
  106. title: '抱歉!您的申请信息未通过',
  107. subtitle: '请尝试修改后重新提交',
  108. button: '重新申请',
  109. action: 'apply',
  110. },
  111. // 直接重新申请
  112. 106: {
  113. image: '/static/img/shop/commission/reject.png',
  114. title: '抱歉!您的申请未通过',
  115. subtitle: '请尝试重新申请',
  116. button: '重新申请',
  117. action: 'reApply',
  118. },
  119. // 冻结
  120. 107: {
  121. image: '/static/img/shop/commission/freeze.png',
  122. title: '抱歉!您的账户已被冻结',
  123. subtitle: '如有疑问请联系客服',
  124. button: '联系客服',
  125. action: 'chat',
  126. },
  127. };
  128. </script>
  129. <style lang="scss" scoped>
  130. .notice-box {
  131. display: flex;
  132. flex-direction: column;
  133. justify-content: center;
  134. align-items: center;
  135. background-color: #fff;
  136. width: 612rpx;
  137. min-height: 658rpx;
  138. background: #ffffff;
  139. padding: 30rpx;
  140. border-radius: 20rpx;
  141. .img-wrap {
  142. margin-bottom: 50rpx;
  143. .notice-img {
  144. width: 180rpx;
  145. height: 170rpx;
  146. }
  147. }
  148. .notice-title {
  149. font-size: 35rpx;
  150. font-weight: bold;
  151. color: #333;
  152. margin-bottom: 28rpx;
  153. }
  154. .notice-detail {
  155. font-size: 28rpx;
  156. font-weight: 400;
  157. color: #999999;
  158. line-height: 36rpx;
  159. margin-bottom: 50rpx;
  160. }
  161. .notice-btn {
  162. width: 492rpx;
  163. line-height: 70rpx;
  164. border-radius: 35rpx;
  165. font-size: 28rpx;
  166. font-weight: 500;
  167. color: #ffffff;
  168. margin-bottom: 10rpx;
  169. }
  170. .back-btn {
  171. width: 492rpx;
  172. line-height: 70rpx;
  173. font-size: 28rpx;
  174. font-weight: 500;
  175. color: var(--ui-BG-Main-gradient);
  176. background: none;
  177. }
  178. }
  179. </style>