callback.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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, getAuthUrl } from '@/api/official'
  83. // import { getShopUser } from '@/utils/auth'
  84. export default {
  85. name: 'callback',
  86. data() {
  87. return {
  88. constant: this.$constant,
  89. data: {},
  90. // pageStatus: '2',
  91. pageStatus: '7',
  92. promptData: [
  93. '确认你已经有公众号(服务号),并且已认证和申请微 信支付',
  94. '满足以上条件,可以点下方按钮开始授权。',
  95. '点击之后会跳到新页面,页面有个二维码,识别后按确 认授权即可。'
  96. ]
  97. }
  98. },
  99. computed: {
  100. btnText() {
  101. let text = ''
  102. switch (this.pageStatus) {
  103. case '1':
  104. text = '返回管理中心'
  105. break
  106. case '2':
  107. text = '返回首页'
  108. break
  109. case '3':
  110. text = '返回首页'
  111. break
  112. case '4':
  113. text = '返回首页'
  114. break
  115. case '5':
  116. text = '开始授权'
  117. break
  118. case '6':
  119. text = '管理中心'
  120. break
  121. case '7':
  122. text = '开始授权'
  123. break
  124. default:
  125. text = '返回管理中心'
  126. break
  127. }
  128. return text
  129. }
  130. },
  131. onLoad() {
  132. // if (!this.$util.isLogin()) {
  133. // getShopUser()
  134. // return false
  135. // }
  136. },
  137. mounted() {
  138. // this.pageStatus = this.option.pageStatus
  139. // this.init()
  140. },
  141. methods: {
  142. init() {
  143. this.$util.getCheckLogin().then(res => {
  144. if (res) {
  145. this._getStatus()
  146. if (this.pageStatus == 1 || this.pageStatus == 5) {
  147. this._accountDet()
  148. }
  149. }
  150. })
  151. },
  152. // 获取状态
  153. _getStatus() {
  154. applyStatus().then(res => {
  155. let status = res.data.status
  156. if (status == 1) {
  157. this.pageStatus = 2
  158. }
  159. })
  160. },
  161. // 获取用户信息
  162. _accountDet() {
  163. accountDet().then(res => {
  164. this.data = res.data
  165. })
  166. },
  167. jumpPage() {
  168. if (this.btnText == '返回首页') {
  169. this.$util.pageTo({
  170. url: '/official/index',
  171. query: {
  172. id: this.option.id
  173. }
  174. })
  175. } else if (this.btnText == '返回管理中心') {
  176. this.$util.pageTo({
  177. url: '/official/index',
  178. query: {
  179. id: this.option.id
  180. }
  181. })
  182. } else if (this.btnText == '开始授权') {
  183. getAuthUrl().then(res => {
  184. location.href = res.data.url
  185. })
  186. // this.$msg('功能待对接!')
  187. }
  188. }
  189. }
  190. }
  191. </script>
  192. <style lang="scss" scoped>
  193. .callback-wrap {
  194. padding-top: 30px;
  195. .callback-blo {
  196. width: calc(100% - 60px);
  197. margin: 0 30px;
  198. padding: 70px 0;
  199. background-color: #fff;
  200. box-shadow: 2px 2px 16px 0px rgba(181, 181, 181, 0.29);
  201. border-radius: 10px;
  202. text-align: center;
  203. &.paddingTop {
  204. padding-top: 40px;
  205. }
  206. // 使用icon
  207. .icon {
  208. .iconfont {
  209. font-size: 170px;
  210. }
  211. .icondaizhifu {
  212. color: #ffa92e;
  213. }
  214. }
  215. // 使用状态图片
  216. .status-img {
  217. width: 294px;
  218. margin: 0 auto;
  219. }
  220. }
  221. // module
  222. .module-wrap {
  223. padding: 0 32px;
  224. text-align: left;
  225. .module-tit {
  226. font-size: 38px;
  227. // margin-bottom: 20px;
  228. }
  229. .module-det {
  230. .module-list {
  231. @include disFlex(flex-start, flex-start);
  232. margin-top: 30px;
  233. .dot-wrap {
  234. width: 10px;
  235. height: 10px;
  236. border-radius: 50%;
  237. background-color: $mainColor;
  238. margin-top: 12px;
  239. margin-right: 24px;
  240. }
  241. }
  242. }
  243. }
  244. // prompt
  245. .prompt-wrap {
  246. margin-top: 60px;
  247. .prompt-tit {
  248. font-size: 36px;
  249. margin-bottom: 10px;
  250. }
  251. }
  252. // qr-code
  253. .qr-code-wrap {
  254. color: $fontColor2;
  255. text-align: center;
  256. & > div {
  257. margin-top: 10px;
  258. }
  259. .qr-code-img {
  260. width: 226px;
  261. margin: 60px auto 40px;
  262. }
  263. }
  264. // button
  265. .button-wrap {
  266. margin-top: 80px;
  267. }
  268. }
  269. </style>