|
|
@@ -1,7 +1,14 @@
|
|
|
<template>
|
|
|
<view class="container">
|
|
|
+ <!-- 空列表 -->
|
|
|
<view class="hint" v-if="showHint">暂无订单记录</view>
|
|
|
- <view class="mark" v-show="showDetail" @click="toShowDetail()"></view>
|
|
|
+ <!-- 遮罩层 -->
|
|
|
+ <view
|
|
|
+ class="mark"
|
|
|
+ v-show="showDetail || showPay"
|
|
|
+ @click="markClose()"
|
|
|
+ ></view>
|
|
|
+ <!-- 订单列表 -->
|
|
|
<view class="list">
|
|
|
<template v-if="orderList.length !== 0">
|
|
|
<view class="messCard" v-for="item in orderList">
|
|
|
@@ -35,13 +42,17 @@
|
|
|
<view class="bt-item">
|
|
|
<view
|
|
|
class="button"
|
|
|
- @click="putMess(item.orderNo)"
|
|
|
+ @click="feedBack(item.orderNo)"
|
|
|
v-if="item.status == 1"
|
|
|
>
|
|
|
订单反馈
|
|
|
</view>
|
|
|
|
|
|
- <view class="button" @click="toPay()" v-if="item.status == 1">
|
|
|
+ <view
|
|
|
+ class="button"
|
|
|
+ @click="toPay(item.payForIdentify, item.studentName)"
|
|
|
+ v-if="item.status == 1"
|
|
|
+ >
|
|
|
继续支付
|
|
|
</view>
|
|
|
<view
|
|
|
@@ -56,10 +67,50 @@
|
|
|
</view>
|
|
|
</template>
|
|
|
</view>
|
|
|
+ <!-- 继续支付页面 -->
|
|
|
+ <view class="messageCard" v-show="showPay">
|
|
|
+ <view class="item-form">
|
|
|
+ <view class="item">
|
|
|
+ <text class="ite">收费单位 </text>
|
|
|
+ <text class="content">南昌交通学院</text>
|
|
|
+ </view>
|
|
|
+ <view class="item">
|
|
|
+ <text class="ite">姓名 </text>
|
|
|
+ <text class="content">{{ studentName }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="item">
|
|
|
+ <text class="ite">学号 </text>
|
|
|
+ <text class="content">{{ studentNo }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="item">
|
|
|
+ <text class="ite">专业 </text>
|
|
|
+ <text class="content">{{ majorName }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="item">
|
|
|
+ <text class="ite">班级 </text>
|
|
|
+ <text class="content">{{ className }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="item">
|
|
|
+ <text class="ite">缴费学年 </text>
|
|
|
+ <text class="content">{{ years }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="item-pay" v-for="item in Arr">
|
|
|
+ <text class="ite">{{ item.id }} </text>
|
|
|
+ <text class="content">¥{{ item.money }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="item">
|
|
|
+ <text class="ite">总金额 </text>
|
|
|
+ <text class="content">¥{{ orderAmount }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <button @click="getPay()" hover-class="button-hover">支付</button>
|
|
|
+ <button @click="closePay()" hover-class="button-hover">取消</button>
|
|
|
+ </view>
|
|
|
+ <!-- 查看详情 -->
|
|
|
<view class="detail" v-show="showDetail">
|
|
|
<view class="top">
|
|
|
<text>订单详情</text>
|
|
|
- <view class="close" @click="toShowDetail()">
|
|
|
+ <view class="close" @click="closeDetail()">
|
|
|
<view class="image"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -105,9 +156,9 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- showHint: true,
|
|
|
+ showPay: false, //继续支付弹窗
|
|
|
+ showHint: true, //无订单提示页
|
|
|
showDetail: false, //订单详情弹窗
|
|
|
- paySuccess: true, //缴费成功隐藏按钮
|
|
|
orderList: [],
|
|
|
studentName: "",
|
|
|
studentNo: "",
|
|
|
@@ -116,18 +167,43 @@ export default {
|
|
|
years: "",
|
|
|
Arr: [],
|
|
|
orderAmount: "",
|
|
|
- status: "",
|
|
|
- // homeUrl: "http://3mb8i8.natappfree.cc ",
|
|
|
homeUrl: "https://jtishfw.ncjti.edu.cn/jiaofei/backendApi",
|
|
|
+ notifyUrl:
|
|
|
+ "https://jtishfw.ncjti.edu.cn/jiaofei/backendApi/pay/jxnxs/notify/",
|
|
|
+ orderNo: "",
|
|
|
+ //微信支付参数
|
|
|
+ appId: "",
|
|
|
+ timeStamp: "",
|
|
|
+ nonceStr: "",
|
|
|
+ package: "",
|
|
|
+ signType: "",
|
|
|
+ paySign: "",
|
|
|
};
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- this.getOrderList();
|
|
|
+ let cardNumber = sessionStorage.getItem("cardNumber");
|
|
|
+
|
|
|
+ if (cardNumber == null) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "cardNumber为空",
|
|
|
+ icon: "error",
|
|
|
+ mask: true,
|
|
|
+ duration: 2000,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.getOrderList(); //获取订单列表
|
|
|
+ }
|
|
|
},
|
|
|
- created() {},
|
|
|
methods: {
|
|
|
- toShowDetail() {
|
|
|
- this.showDetail = !this.showDetail;
|
|
|
+ markClose() {
|
|
|
+ this.showPay = false;
|
|
|
+ this.showDetail = false;
|
|
|
+ },
|
|
|
+ closeDetail() {
|
|
|
+ this.showDetail = false;
|
|
|
+ },
|
|
|
+ closePay() {
|
|
|
+ this.showPay = false;
|
|
|
},
|
|
|
//获取订单列表
|
|
|
getOrderList() {
|
|
|
@@ -147,10 +223,18 @@ export default {
|
|
|
method: "GET",
|
|
|
sslVerify: true,
|
|
|
success: ({ data, statusCode, header }) => {
|
|
|
- // console.log(data.data.list);
|
|
|
- this.orderList = data.data.list;
|
|
|
- if (data.data.list.length !== 0) {
|
|
|
- this.showHint = false;
|
|
|
+ if (data.success) {
|
|
|
+ if (data.data.list.length !== 0) {
|
|
|
+ this.showHint = false;
|
|
|
+ this.orderList = data.data.list;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: data.message,
|
|
|
+ icon: "error",
|
|
|
+ mask: true,
|
|
|
+ duration: 2000,
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
fail: (error) => {},
|
|
|
@@ -184,16 +268,44 @@ export default {
|
|
|
this.years = res.years;
|
|
|
this.majorName = res.majorName;
|
|
|
this.className = res.className;
|
|
|
- this.orderAmount = res.realPayAmount;
|
|
|
this.getPayDetail(res.payItemDetail);
|
|
|
+ this.orderAmount = res.realPayAmount;
|
|
|
},
|
|
|
fail: (error) => {},
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- //跳转支付页面
|
|
|
- toPay() {
|
|
|
- uni.navigateTo({ url: "/pages/blankIndex/blankIndex" });
|
|
|
+ //继续支付
|
|
|
+ toPay(payForIdentify, studentName) {
|
|
|
+ this.showPay = !this.showPay;
|
|
|
+ let cardNumber = sessionStorage.getItem("cardNumber");
|
|
|
+
|
|
|
+ let url =
|
|
|
+ this.homeUrl +
|
|
|
+ `/tuitionpayment/payableinfo/payableInfo/${payForIdentify}/${studentName}`;
|
|
|
+
|
|
|
+ uni.request({
|
|
|
+ url: url,
|
|
|
+ header: {
|
|
|
+ card_number: cardNumber,
|
|
|
+ Accept: "application/json",
|
|
|
+ "Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
|
|
|
+ "X-Requested-With": "XMLHttpRequest",
|
|
|
+ },
|
|
|
+ method: "GET",
|
|
|
+ sslVerify: true,
|
|
|
+ success: ({ data, statusCode, header }) => {
|
|
|
+ let res = data.data;
|
|
|
+ this.studentName = res.studentName;
|
|
|
+ this.studentNo = res.studentNo;
|
|
|
+ this.years = res.years;
|
|
|
+ this.majorName = res.majorName;
|
|
|
+ this.className = res.className;
|
|
|
+ this.getPayDetail(res.payItemDetail);
|
|
|
+ this.orderAmount = res.realPayAmount;
|
|
|
+ },
|
|
|
+ fail: (error) => {},
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
//获取学费明细
|
|
|
@@ -219,7 +331,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
//订单反馈
|
|
|
- putMess(orderNo) {
|
|
|
+ feedBack(orderNo) {
|
|
|
let cardNumber = sessionStorage.getItem("cardNumber");
|
|
|
|
|
|
let url = this.homeUrl + `/tuitionpayment/payorder/${orderNo}/orderStatu`;
|
|
|
@@ -247,6 +359,185 @@ export default {
|
|
|
fail: (error) => {},
|
|
|
});
|
|
|
},
|
|
|
+ //支付
|
|
|
+ getPay() {
|
|
|
+ uni.showToast({
|
|
|
+ title: "支付中,请稍等",
|
|
|
+ icon: "loading",
|
|
|
+ mask: true,
|
|
|
+ duration: 1500,
|
|
|
+ });
|
|
|
+ this.getOrderNo(); //获取订单号
|
|
|
+ },
|
|
|
+ //获取订单号
|
|
|
+ getOrderNo() {
|
|
|
+ let that = this;
|
|
|
+
|
|
|
+ let cardNumber = sessionStorage.getItem("cardNumber");
|
|
|
+
|
|
|
+ let url =
|
|
|
+ that.homeUrl + `/tuitionpayment/payorder/${that.studentNo}/create`;
|
|
|
+
|
|
|
+ uni.request({
|
|
|
+ url: url,
|
|
|
+ data: {},
|
|
|
+ header: {
|
|
|
+ card_number: cardNumber,
|
|
|
+ Accept: "application/json",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "X-Requested-With": "XMLHttpRequest",
|
|
|
+ },
|
|
|
+ method: "POST",
|
|
|
+ sslVerify: true,
|
|
|
+ success: ({ data, statusCode, header }) => {
|
|
|
+ let res = data.data;
|
|
|
+ that.orderNo = res.orderNo;
|
|
|
+ if (!data.success) {
|
|
|
+ uni.showToast({
|
|
|
+ title: data.message,
|
|
|
+ icon: "error",
|
|
|
+ mask: true,
|
|
|
+ duration: 2000,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ that.getPayMethod();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (error) => {},
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //获取支付方式
|
|
|
+ getPayMethod() {
|
|
|
+ let url = this.homeUrl + "/payMethodSetting/currentPay";
|
|
|
+
|
|
|
+ uni.request({
|
|
|
+ url: url,
|
|
|
+ data: {},
|
|
|
+ header: {
|
|
|
+ Accept: "application/json",
|
|
|
+ "Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
|
|
|
+ "X-Requested-With": "XMLHttpRequest",
|
|
|
+ },
|
|
|
+ method: "GET",
|
|
|
+ sslVerify: true,
|
|
|
+ success: ({ data, statusCode, header }) => {
|
|
|
+ let res = data.data;
|
|
|
+ if (data.success) {
|
|
|
+ if (res.currentPayMethod === "1") {
|
|
|
+ this.getwxParam();
|
|
|
+ } else {
|
|
|
+ this.nsPay();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: data.message,
|
|
|
+ icon: "error",
|
|
|
+ mask: true,
|
|
|
+ duration: 1000,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (error) => {},
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //拉起农商行支付
|
|
|
+ nsPay() {
|
|
|
+ let O = "5494ec3310685daa218382619dd20e27";
|
|
|
+
|
|
|
+ let out_no = this.orderNo;
|
|
|
+
|
|
|
+ let amount = this.orderAmount;
|
|
|
+
|
|
|
+ let appoint_notify = this.notifyUrl;
|
|
|
+
|
|
|
+ let mainUrl = `https://q.jxnxs.com/newpay?O=${O}&out_no=${out_no}&amount=${amount}&appoint_notify=${appoint_notify}`;
|
|
|
+
|
|
|
+ window.location.href = mainUrl;
|
|
|
+ },
|
|
|
+ //获取微信支付参数
|
|
|
+ getwxParam() {
|
|
|
+ let that = this;
|
|
|
+
|
|
|
+ let cardNumber = sessionStorage.getItem("cardNumber");
|
|
|
+
|
|
|
+ let openId = localStorage.getItem("openId");
|
|
|
+
|
|
|
+ let url = that.homeUrl + "/pay/ccb/getJsApiParam";
|
|
|
+
|
|
|
+ uni.request({
|
|
|
+ url: url,
|
|
|
+ data: {
|
|
|
+ orderNo: that.orderNo,
|
|
|
+ openId: openId,
|
|
|
+ },
|
|
|
+ header: {
|
|
|
+ card_number: cardNumber,
|
|
|
+ Accept: "application/json",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ "X-Requested-With": "XMLHttpRequest",
|
|
|
+ },
|
|
|
+ method: "GET",
|
|
|
+ sslVerify: true,
|
|
|
+ success: ({ data, statusCode, header }) => {
|
|
|
+ if (!data.success) {
|
|
|
+ uni.showToast({
|
|
|
+ title: data.message,
|
|
|
+ icon: "error",
|
|
|
+ mask: true,
|
|
|
+ duration: 2000,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ let res = data.data;
|
|
|
+ that.appId = res.appId;
|
|
|
+ that.timeStamp = res.timeStamp;
|
|
|
+ that.nonceStr = res.nonceStr;
|
|
|
+ that.package = res.package;
|
|
|
+ that.signType = res.signType;
|
|
|
+ that.paySign = res.paySign;
|
|
|
+ that.wxPay();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (error) => {},
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //吊起微信支付
|
|
|
+ wxPay() {
|
|
|
+ let that = this;
|
|
|
+
|
|
|
+ function onBridgeReady() {
|
|
|
+ WeixinJSBridge.invoke(
|
|
|
+ "getBrandWCPayRequest",
|
|
|
+ {
|
|
|
+ appId: that.appId, //公众号ID,由商户传入
|
|
|
+ timeStamp: that.timeStamp, //时间戳,自1970年以来的秒数
|
|
|
+ nonceStr: that.nonceStr, //随机串
|
|
|
+ package: that.package,
|
|
|
+ signType: that.signType, //微信签名方式:
|
|
|
+ paySign: that.paySign, //微信签名
|
|
|
+ },
|
|
|
+ function (res) {
|
|
|
+ if (res.err_msg == "get_brand_wcpay_request:ok") {
|
|
|
+ // 使用以上方式判断前端返回,微信团队郑重提示:
|
|
|
+ //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (typeof WeixinJSBridge == "undefined") {
|
|
|
+ if (document.addEventListener) {
|
|
|
+ document.addEventListener(
|
|
|
+ "WeixinJSBridgeReady",
|
|
|
+ onBridgeReady,
|
|
|
+ false
|
|
|
+ );
|
|
|
+ } else if (document.attachEvent) {
|
|
|
+ document.attachEvent("WeixinJSBridgeReady", onBridgeReady);
|
|
|
+ document.attachEvent("onWeixinJSBridgeReady", onBridgeReady);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ onBridgeReady();
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|