callback.vue 8.6 KB

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