123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <template>
- <div class="container">
- <div v-if="result.code === 'success'" class="result">
- <img class="result-pic" :src="result.pic" alt="" />
- <div class="result-title">{{ result.title }}</div>
- <van-button type="primary" class="result-btn" @click="goUBOXBind">
- 去绑定支付宝账号
- </van-button>
- </div>
- <div v-if="result.code === 'registered'" class="result">
- <img class="result-pic" :src="result.pic" alt="" />
- <div class="result-title">{{ result.title }}</div>
- <van-button type="primary" class="result-btn" @click="goUBOXBind">
- 去绑定支付宝账号
- </van-button>
- </div>
- <div v-if="result.code === 'fail'" class="result">
- <img class="result-pic" :src="result.pic" alt="" />
- <div class="result-title">{{ result.title }}</div>
- </div>
- </div>
- </template>
- <script>
- import { getURLParameters } from "@/utils";
- const resultMap = {
- 200: {
- code: "success",
- pic: require("@/assets/images/result_1.png"),
- title: "继续完成绑定支付宝账号,即可开门消费。",
- },
- fail: {
- code: "fail",
- pic: require("@/assets/images/result_2.png"),
- title: "系统异常,请勿重复操作。",
- },
- 6010: {
- code: "registered",
- pic: require("@/assets/images/result_2.png"),
- title: "用户已注册,请勿重复操作。",
- },
- };
- export default {
- data() {
- return {
- result: {},
- };
- },
- created() {
- const { code: statusCode } = getURLParameters();
- this.result = resultMap[statusCode]
- ? resultMap[statusCode]
- : resultMap["fail"];
- // this.aliPayReady()
- },
- methods: {
- // aliPayReady() {
- // function ready(callback) {
- // // 如果jsbridge已经注入则直接调用
- // if (window.AlipayJSBridge) {
- // callback && callback()
- // } else {
- // // 如果没有注入则监听注入的事件
- // document.addEventListener('AlipayJSBridgeReady', callback, false)
- // }
- // }
- // ready(function () {
- // console.log('AlipayJSBridge 初始化完毕')
- // })
- // },
- // exitApp() {
- // AlipayJSBridge.call('exitApp')
- // },
- // openScan() {
- // AlipayJSBridge.call(
- // 'scan',
- // {
- // scanType: ['qrCode', 'barCode'],
- // actionType: 'scanAndRoute',
- // },
- // function (result) {
- // alert(JSON.stringify(result))
- // },
- // )
- // },
- /**
- * 跳转到友宝绑定支付宝页面
- */
- goUBOXBind() {
- location.href = `http://cashier.aicebox.com/user/bind/init/1036_100811_dt1`;
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .container {
- box-sizing: border-box;
- padding: 24px;
- }
- .result {
- display: flex;
- flex-direction: column;
- align-items: center;
- &-pic {
- width: 200px;
- height: 170px;
- }
- &-title {
- margin-top: 24px;
- font-size: 18px;
- color: #333;
- font-weight: bold;
- }
- &-tips {
- margin-top: 8px;
- font-size: 14px;
- color: #333;
- }
- &-btn {
- margin-top: 30px;
- width: 100%;
- font-size: 15px;
- background: #4684ff;
- border-color: #4684ff;
- border-radius: 24px;
- overflow: hidden;
- }
- }
- </style>
|