callback.vue 6.8 KB

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