callback.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <!-- 官网各种回调页面 -->
  3. <div class="app-content">
  4. <div class="callback-wrap">
  5. <div class="callback-blo" :class="{ 'paddingTop' : pageStatus == 7 }">
  6. <block v-if="pageStatus == 7">
  7. <div class="module-wrap">
  8. <div class="module-tit">提示</div>
  9. <div class="module-det">
  10. <div class="module-list" v-for="(item, index) in promptData" :key="index">
  11. <span class="dot-wrap"></span>
  12. <span>{{ item }}</span>
  13. </div>
  14. </div>
  15. </div>
  16. </block>
  17. <block v-else>
  18. <!-- 使用icon -->
  19. <!-- 成功 icon -->
  20. <block v-if="pageStatus == 1">
  21. <div class="status-img">
  22. <img :src="`${constant.imgUrl}/retail/callback/success.png`" alt mode="widthFix" />
  23. </div>
  24. </block>
  25. <!-- 使用图片 -->
  26. <!-- 支付成功 -->
  27. <block v-else>
  28. <div class="icon">
  29. <i class="iconfont icondaizhifu"></i>
  30. </div>
  31. </block>
  32. <!-- prompt-wrap -->
  33. <div class="prompt-wrap">
  34. <block v-if="pageStatus == 1">
  35. <div class="prompt-tit" style="color: #09bb07">恭喜您, 续订成功!</div>
  36. <div>
  37. <span class="app-color-2">你的帐号有效期已延长至:</span>
  38. <span>{{ data.deadline | formatTime('YYYY-MM-DD hh:mm:ss') }}</span>
  39. </div>
  40. </block>
  41. <block v-if="pageStatus == 2">
  42. <div class="prompt-tit">申请已提交</div>
  43. <div>
  44. <span class="app-color-2">审核大约需要一个工作日,请耐心等候</span>
  45. </div>
  46. </block>
  47. </div>
  48. <!-- qr-code -->
  49. <div class="qr-code-wrap" v-if="option.focus == 0">
  50. <div class="qr-code-img">
  51. <img :src="option.qrCode" alt />
  52. </div>
  53. <div>识别二维码关注花卉宝</div>
  54. <div>审核结果将通过微信通知您</div>
  55. </div>
  56. </block>
  57. <!-- button -->
  58. <div class="button-wrap">
  59. <block v-if="pageStatus == 1 || pageStatus == 7">
  60. <button class="admin-button-com big blue" @click="jumpPage">{{ btnText }}</button>
  61. </block>
  62. <block v-else>
  63. <button class="admin-button-com big default" @click="jumpPage">{{ btnText }}</button>
  64. </block>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </template>
  70. <script>
  71. /** *
  72. * 页面状态
  73. * @parmas pageStatus 进入页面的状态
  74. * @parmas 1 续订成功
  75. * @parmas 2 申请已提交
  76. * @parmas 3 申请已提交 - 返回二维码 -- successPay
  77. * @parmas 4 审核未通过 -- successEval
  78. * @parmas 5 审核通过 - 扫码支付 -- successPayCode
  79. * @parmas 6 授权成功 - 扫码支付 -- successPayCode
  80. * @parmas 7 授权提示 - 扫码支付 -- successPayCode
  81. */
  82. import { accountDet, applyStatus } from '@/api/official'
  83. import { getShopUser } from '@/utils/auth'
  84. export default {
  85. name: 'callback',
  86. data() {
  87. return {
  88. data: {},
  89. pageStatus: '2',
  90. promptData: [
  91. '确认你已经有公众号(服务号),并且已认证和申请微 信支付',
  92. '满足以上条件,可以点下方按钮开始授权。',
  93. '点击之后会跳到新页面,页面有个二维码,识别后按确 认授权即可。'
  94. ]
  95. }
  96. },
  97. computed: {
  98. btnText() {
  99. let text = ''
  100. switch (this.pageStatus) {
  101. case '1':
  102. text = '返回管理中心'
  103. break
  104. case '2':
  105. text = '返回首页'
  106. break
  107. case '3':
  108. text = '返回首页'
  109. break
  110. case '4':
  111. text = '返回首页'
  112. break
  113. case '5':
  114. text = '开始授权'
  115. break
  116. case '6':
  117. text = '管理中心'
  118. break
  119. case '7':
  120. text = '开始授权'
  121. break
  122. default:
  123. text = '返回管理中心'
  124. break
  125. }
  126. return text
  127. }
  128. },
  129. onLoad() {
  130. let token = uni.getStorageSync('token')
  131. if (!token) {
  132. getShopUser()
  133. return false
  134. }
  135. },
  136. mounted() {
  137. // this.pageStatus = this.option.pageStatus
  138. // this.init()
  139. },
  140. methods: {
  141. init() {
  142. this._getStatus()
  143. if (this.pageStatus == 1 || this.pageStatus == 5) {
  144. this._accountDet()
  145. }
  146. },
  147. // 获取状态
  148. _getStatus() {
  149. applyStatus().then(res => {
  150. let status = res.data.status
  151. if (status == 1) {
  152. this.pageStatus = 2
  153. }
  154. })
  155. },
  156. // 获取用户信息
  157. _accountDet() {
  158. accountDet().then(res => {
  159. this.data = res.data
  160. })
  161. },
  162. jumpPage() {
  163. if (this.btnText == '返回首页') {
  164. this.$util.pageTo({
  165. url: '/official/index',
  166. query: {
  167. id: this.option.id
  168. }
  169. })
  170. } else if (this.btnText == '返回管理中心') {
  171. this.$util.pageTo({
  172. url: '/official/index',
  173. query: {
  174. id: this.option.id
  175. }
  176. })
  177. }
  178. }
  179. }
  180. }
  181. </script>
  182. <style lang="scss" scoped>
  183. .callback-wrap {
  184. padding-top: 30px;
  185. .callback-blo {
  186. width: calc(100% - 60px);
  187. margin: 0 30px;
  188. padding: 70px 0;
  189. background-color: #fff;
  190. box-shadow: 2px 2px 16px 0px rgba(181, 181, 181, 0.29);
  191. border-radius: 10px;
  192. text-align: center;
  193. &.paddingTop {
  194. padding-top: 40px;
  195. }
  196. // 使用icon
  197. .icon {
  198. .iconfont {
  199. font-size: 170px;
  200. }
  201. .icondaizhifu {
  202. color: #ffa92e;
  203. }
  204. }
  205. // 使用状态图片
  206. .status-img {
  207. width: 294px;
  208. margin: 0 auto;
  209. }
  210. }
  211. // module
  212. .module-wrap {
  213. padding: 0 32px;
  214. text-align: left;
  215. .module-tit {
  216. font-size: 38px;
  217. // margin-bottom: 20px;
  218. }
  219. .module-det {
  220. .module-list {
  221. @include disFlex(flex-start, flex-start);
  222. margin-top: 30px;
  223. .dot-wrap {
  224. width: 10px;
  225. height: 10px;
  226. border-radius: 50%;
  227. background-color: $mainColor;
  228. margin-top: 12px;
  229. margin-right: 24px;
  230. }
  231. }
  232. }
  233. }
  234. // prompt
  235. .prompt-wrap {
  236. margin-top: 60px;
  237. .prompt-tit {
  238. font-size: 36px;
  239. margin-bottom: 10px;
  240. }
  241. }
  242. // qr-code
  243. .qr-code-wrap {
  244. color: $fontColor2;
  245. text-align: center;
  246. & > div {
  247. margin-top: 10px;
  248. }
  249. .qr-code-img {
  250. width: 226px;
  251. margin: 60px auto 40px;
  252. }
  253. }
  254. // button
  255. .button-wrap {
  256. margin-top: 80px;
  257. }
  258. }
  259. </style>