|
@@ -0,0 +1,376 @@
|
|
|
+<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 == 'error'">
|
|
|
+ <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 == 'paying'">
|
|
|
+ <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>
|
|
|
+ <div class="orderinfo">
|
|
|
+ <p>
|
|
|
+ <span>购买时间:</span>
|
|
|
+ {{ orderInfo.createTime }}
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ <span>订单号:</span>
|
|
|
+ {{ orderInfo.orderNo }}
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ <span>购买详情:</span>
|
|
|
+ </p>
|
|
|
+ <img class="icon_img" v-if="!ownershipType" src="@/assets/images/icon_cw.png" alt srcset />
|
|
|
+ </div>
|
|
|
+ <van-button type="info" @click="onRepay" round>返回</van-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+/* eslint-disable */
|
|
|
+import MHeader from "@/components/MHeader"
|
|
|
+import { browser } from "@/common/common"
|
|
|
+// import { stat } from 'fs'
|
|
|
+export default {
|
|
|
+ name: "paymentresult",
|
|
|
+ components: { MHeader },
|
|
|
+ data() {
|
|
|
+ let that = this;
|
|
|
+ return {
|
|
|
+ headerStatus: false,
|
|
|
+ isBack: that.$route.query.isBack == "off" ? false : true, // 是否显示返回按钮
|
|
|
+ pageStatus: null,
|
|
|
+ orderInfo: {}, // 订单基本信息
|
|
|
+ smsText: 60,
|
|
|
+ groupType: null, //订单类型
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ if (!browser().android && !browser().iPhone) {
|
|
|
+ this.headerStatus = true;
|
|
|
+ }
|
|
|
+ this.__init();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ __init() {
|
|
|
+ let params = this.$route.query;
|
|
|
+ // 支付成功
|
|
|
+ if (params.orderNo) {
|
|
|
+ // 是否有订单号
|
|
|
+ // checkOrderStatus({ orderNo: params.orderNo }).then(res => {
|
|
|
+ // let result = res.data;
|
|
|
+ // if (result.code == 200) {
|
|
|
+ // let tempResult = result.data;
|
|
|
+ // if (
|
|
|
+ // tempResult.ownershipType &&
|
|
|
+ // tempResult.ownershipType == "COOPERATION"
|
|
|
+ // ) {
|
|
|
+ // this.ownershipType = true;
|
|
|
+ // }
|
|
|
+ // this.orderInfo = tempResult.order;
|
|
|
+ // this.groupType = tempResult.groupType;
|
|
|
+ // if (tempResult.order.type) {
|
|
|
+ // this.activeName = tempResult.order.type;
|
|
|
+ // }
|
|
|
+ // this.showStatus(tempResult.order.status, tempResult.groupType);
|
|
|
+ // if (tempResult.groupType == "MUSIC") {
|
|
|
+ // // 乐团课
|
|
|
+ // this.parseClassList(tempResult.course, tempResult.goods);
|
|
|
+ // } else if (tempResult.groupType == "VIP") {
|
|
|
+ // // vip课
|
|
|
+ // this.parseVipList(tempResult.detail);
|
|
|
+ // } else if (tempResult.groupType == "SPORADIC") {
|
|
|
+ // // 零星收费
|
|
|
+ // this.parseSporadic(tempResult.detail);
|
|
|
+ // } else if (tempResult.groupType == "PRACTICE") {
|
|
|
+ // // 陪练课
|
|
|
+ // this.queryOrderInfo();
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // // 订单处理中
|
|
|
+ // this.pageStatus = "paying";
|
|
|
+ // this.CountDown();
|
|
|
+ // }
|
|
|
+ // // this.pageStatus = 'success'
|
|
|
+ // });
|
|
|
+ } else {
|
|
|
+ if (params.type) {
|
|
|
+ this.pageStatus = params.type;
|
|
|
+ } else {
|
|
|
+ this.pageStatus = "paying";
|
|
|
+ this.CountDown();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getYMDToCn(date) {
|
|
|
+ if (typeof date == "string") {
|
|
|
+ date = date.replace(/-/gi, "/");
|
|
|
+ }
|
|
|
+ let tempDate = new Date(date);
|
|
|
+ return (
|
|
|
+ tempDate.getFullYear() +
|
|
|
+ "年" +
|
|
|
+ (tempDate.getMonth() + 1) +
|
|
|
+ "月" +
|
|
|
+ tempDate.getDate() +
|
|
|
+ "日"
|
|
|
+ );
|
|
|
+ },
|
|
|
+ splitStr(str) {
|
|
|
+ if (str) {
|
|
|
+ let s = str.split(":");
|
|
|
+ return s[0] + ":" + s[1];
|
|
|
+ } else {
|
|
|
+ return str;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ showStatus(status, type) {
|
|
|
+ if (status == "ING") {
|
|
|
+ this.pageStatus = "paying";
|
|
|
+ this.CountDown();
|
|
|
+ } else if (status == "SUCCESS") {
|
|
|
+ this.pageStatus = "success";
|
|
|
+ } else if (status == "FAILED") {
|
|
|
+ this.pageStatus = "error";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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 {
|
|
|
+ // musicGroupId
|
|
|
+ if (this.$route.query.sporadic || this.groupType == "SPORADIC") {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/SporadicLogin",
|
|
|
+ query: {
|
|
|
+ id: this.$route.query.sporadic || this.orderInfo.musicGroupId
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else if (this.groupType == "PRACTICE") {
|
|
|
+ window.location.replace(
|
|
|
+ window.location.href.toString().replace(window.location.hash, "") +
|
|
|
+ "#" +
|
|
|
+ "/auditionpay/1"
|
|
|
+ );
|
|
|
+ this.$router.push("/auditionpay/1");
|
|
|
+ } else {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/login",
|
|
|
+ query: {
|
|
|
+ musicGroupId: this.$route.query.musicGroupId
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onRepay() {
|
|
|
+ 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 {
|
|
|
+ if (this.groupType == "SPORADIC") {
|
|
|
+ if (this.activeName == "LUCK") {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/smallLogin/active"
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/SporadicLogin",
|
|
|
+ query: {
|
|
|
+ id: this.orderInfo.musicGroupId
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else if (this.groupType == "PRACTICE") {
|
|
|
+ window.location.replace(
|
|
|
+ window.location.href.toString().replace(window.location.hash, "") +
|
|
|
+ "#" +
|
|
|
+ "/auditionpay/1"
|
|
|
+ );
|
|
|
+ this.$router.push("/auditionpay/1");
|
|
|
+ } else {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/login",
|
|
|
+ query: {
|
|
|
+ musicGroupId: this.$route.query.musicGroupId
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ CountDown() {
|
|
|
+ let s = 60;
|
|
|
+ this.smsText = s;
|
|
|
+ let timer = setInterval(() => {
|
|
|
+ if (s <= 0) {
|
|
|
+ window.location.reload();
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .classdetail {
|
|
|
+ background: #fff;
|
|
|
+ margin-bottom: 0.25rem;
|
|
|
+ font-size: 0.14rem;
|
|
|
+ color: #444;
|
|
|
+ padding: 0.15rem;
|
|
|
+ h3 {
|
|
|
+ font-size: 0.14rem;
|
|
|
+ color: #444444;
|
|
|
+ }
|
|
|
+ .detailList {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ p {
|
|
|
+ width: 40%;
|
|
|
+ }
|
|
|
+ span {
|
|
|
+ padding-right: 0.08rem;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .orderinfo {
|
|
|
+ position: relative;
|
|
|
+ // margin-bottom: 0.25rem;
|
|
|
+ margin-bottom: 0.1rem;
|
|
|
+ padding: 0.15rem 0.15rem 0.48rem;
|
|
|
+ background-color: #fff;
|
|
|
+ font-size: 0.14rem;
|
|
|
+ color: #777777;
|
|
|
+ span {
|
|
|
+ color: #444444;
|
|
|
+ }
|
|
|
+ .icon_img {
|
|
|
+ width: 1.2rem;
|
|
|
+ height: 1.1rem;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0.3rem;
|
|
|
+ right: 0.2rem;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|