callback.vue 6.7 KB

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