|
@@ -0,0 +1,217 @@
|
|
|
+<template>
|
|
|
+ <div class="paymentResult">
|
|
|
+ <m-header v-if="headerStatus" :isBack="isBack" />
|
|
|
+ <div class="payon" v-if="pageStatus == 'ON'">
|
|
|
+ <img src="@/assets/images/pay_success.png" alt />
|
|
|
+ <p>支付成功</p>
|
|
|
+ <van-button type="info" @click="onAppBack" round>返回</van-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="payerror" v-if="pageStatus == 'FAILED'">
|
|
|
+ <img src="@/assets/images/pay_error.png" alt />
|
|
|
+ <p>支付失败</p>
|
|
|
+ <van-button type="info" @click="onAppBack" round>返回</van-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="paying" v-if="pageStatus == 'ING'">
|
|
|
+ <img src="@/assets/images/pay_ing.png" alt />
|
|
|
+ <p>订单处理中</p>
|
|
|
+ <van-button type="info" @click="onAppBack" round>返回</van-button>
|
|
|
+ <p class="countdown">到计时{{ smsText }}秒刷新</p>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="paysuccess" v-if="pageStatus == 'SUCCESS'">
|
|
|
+ <div class="status">
|
|
|
+ <img src="@/assets/images/pay_success.png" alt />
|
|
|
+ <p>支付成功</p>
|
|
|
+ <p class="money" v-if="groupType == 'PRACTICE'">¥{{ PRACTICEPRICE }}</p>
|
|
|
+ <p class="money" v-else>¥{{ orderInfo.actualAmount }}</p>
|
|
|
+ </div>
|
|
|
+ <van-button type="info" @click="onAppBack" round>返回</van-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+/* eslint-disable */
|
|
|
+import MHeader from "@/components/MHeader"
|
|
|
+import { paymentResult } from "./adapay/AdapayApi"
|
|
|
+import { browser } from "@/utils/common"
|
|
|
+// import { stat } from 'fs'
|
|
|
+export default {
|
|
|
+ name: "paymentResult",
|
|
|
+ components: { MHeader },
|
|
|
+ data() {
|
|
|
+ let that = this;
|
|
|
+ const query = this.$route.query
|
|
|
+ return {
|
|
|
+ headerStatus: false,
|
|
|
+ isBack: query.isBack == "off" ? false : true, // 是否显示返回按钮
|
|
|
+ pageStatus: null
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ // window.localStorage.removeItem('userInfo') // 删除用户信息
|
|
|
+ // window.localStorage.removeItem('Authorization') // 删除用户信息
|
|
|
+ if (!browser().android && !browser().iPhone) {
|
|
|
+ this.headerStatus = true;
|
|
|
+ }
|
|
|
+ this.__init()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ pushHistory() {
|
|
|
+ var state = {
|
|
|
+ title: "title",
|
|
|
+ url: "#"
|
|
|
+ };
|
|
|
+ window.history.pushState(state, "title", "#");
|
|
|
+ },
|
|
|
+ __init() {
|
|
|
+ let params = this.$route.query;
|
|
|
+ // 支付成功
|
|
|
+ if (params.orderNo) {
|
|
|
+ // 是否有订单号
|
|
|
+ paymentResult({ orderNo: params.orderNo }).then(res => {
|
|
|
+ let result = res.data;
|
|
|
+ if (result.code == 200) {
|
|
|
+ } else {
|
|
|
+ // 订单处理中
|
|
|
+ this.pageStatus = "ING";
|
|
|
+ this.CountDown();
|
|
|
+ }
|
|
|
+ // this.pageStatus = 'success'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ if (params.type) {
|
|
|
+ this.pageStatus = params.type;
|
|
|
+ } else {
|
|
|
+ this.pageStatus = "ING";
|
|
|
+ this.CountDown();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onAppBack() {
|
|
|
+ // app回调页面
|
|
|
+ if (browser().android) {
|
|
|
+ if (this.groupType == "PRACTICE") {
|
|
|
+ // 收费网管课
|
|
|
+ window.location.replace(
|
|
|
+ window.location.href.toString().replace(window.location.hash, "") +
|
|
|
+ "#" +
|
|
|
+ "/auditionpay/1"
|
|
|
+ );
|
|
|
+ this.$router.push("/auditionpay/1");
|
|
|
+ } else {
|
|
|
+ DAYA.postMessage(JSON.stringify({ api: "back" }));
|
|
|
+ }
|
|
|
+ } else if (browser().iPhone) {
|
|
|
+ if (this.groupType == "PRACTICE") {
|
|
|
+ // 收费网管课
|
|
|
+ window.location.replace(
|
|
|
+ window.location.href.toString().replace(window.location.hash, "") +
|
|
|
+ "#" +
|
|
|
+ "/auditionpay/1"
|
|
|
+ );
|
|
|
+ this.$router.push("/auditionpay/1");
|
|
|
+ } else {
|
|
|
+ window.webkit.messageHandlers.DAYA.postMessage(
|
|
|
+ JSON.stringify({ api: "back" })
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.onHref()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onHref() {
|
|
|
+ // musicGroupId
|
|
|
+ if (this.$route.query.sporadic || this.groupType == "SPORADIC") {
|
|
|
+ if (this.orderInfo.organId == 42) { // 42 分部是对外考级报名
|
|
|
+ this.$router.replace({
|
|
|
+ path: "/levelApply"
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/SporadicLogin",
|
|
|
+ query: {
|
|
|
+ id: this.$route.query.sporadic || this.orderInfo.musicGroupId
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ window.location.replace(
|
|
|
+ window.location.href.toString().replace(window.location.hash, "") +
|
|
|
+ "#" + "/transfer/"
|
|
|
+ );
|
|
|
+ this.$router.push("/transfer")
|
|
|
+ }
|
|
|
+ },
|
|
|
+ CountDown() {
|
|
|
+ let s = 60;
|
|
|
+ this.smsText = s;
|
|
|
+ let timer = setInterval(() => {
|
|
|
+ if (s <= 0) {
|
|
|
+ this.__init();
|
|
|
+ clearInterval(timer);
|
|
|
+ } else {
|
|
|
+ s--;
|
|
|
+ this.smsText = s;
|
|
|
+ }
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.paymentResult {
|
|
|
+ min-height: 100vh;
|
|
|
+}
|
|
|
+.payerror,
|
|
|
+.payon,
|
|
|
+.paying {
|
|
|
+ padding-top: 1rem;
|
|
|
+ img {
|
|
|
+ display: block;
|
|
|
+ margin: 0 auto;
|
|
|
+ width: 1.03rem;
|
|
|
+ height: 1.37rem;
|
|
|
+ }
|
|
|
+ p {
|
|
|
+ padding-top: 0.12rem;
|
|
|
+ font-size: 0.18rem;
|
|
|
+ color: #444444;
|
|
|
+ text-align: center;
|
|
|
+ margin-bottom: 1.5rem;
|
|
|
+ &.countdown {
|
|
|
+ font-size: 0.14rem;
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.van-button {
|
|
|
+ width: 90%;
|
|
|
+ margin: 0 5% 0;
|
|
|
+ line-height: 0.48rem;
|
|
|
+ height: 0.5rem;
|
|
|
+ font-size: 0.18rem;
|
|
|
+}
|
|
|
+.paysuccess {
|
|
|
+ .status {
|
|
|
+ background-color: #fff;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 0.16rem;
|
|
|
+ color: #444;
|
|
|
+ padding-bottom: 0.1rem;
|
|
|
+ margin-bottom: 0.1rem;
|
|
|
+ img {
|
|
|
+ margin-top: 0.1rem;
|
|
|
+ width: 0.58rem;
|
|
|
+ height: 0.71rem;
|
|
|
+ }
|
|
|
+ .money {
|
|
|
+ font-size: 0.14rem;
|
|
|
+ color: #f97215;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|