diff --git a/src/services/apiUrl.js b/src/services/apiUrl.js index 62e3618..7e91d55 100644 --- a/src/services/apiUrl.js +++ b/src/services/apiUrl.js @@ -80,4 +80,12 @@ export const apiUrl = { * 积分新增 */ addCredit:"/api/credit/add", + /** + * 获取会员可赠送的券列表 + */ + wxMerchantcouponSend:"/api/couponSend/list", + /** + * 商户注券操作 + */ + wxMerchantcouponhandSel: "/api/couponSend/handSel", } diff --git a/src/views/navigation/accomplish.vue b/src/views/navigation/accomplish.vue index 1ea8f89..e574718 100644 --- a/src/views/navigation/accomplish.vue +++ b/src/views/navigation/accomplish.vue @@ -1,11 +1,11 @@ @@ -14,12 +14,21 @@ export default { methods: { lookBilling(){ this.$router.push('/billing') + }, + goHome(){ + this.$router.push('/home') } }, }; \ No newline at end of file diff --git a/src/views/navigation/commodity.vue b/src/views/navigation/commodity.vue index 89d9407..019f388 100644 --- a/src/views/navigation/commodity.vue +++ b/src/views/navigation/commodity.vue @@ -1,40 +1,40 @@ @@ -43,144 +43,161 @@ import Vue from "vue"; import { Toast } from "vant"; import moment from "moment"; export default { - data() { - return { - list:{}, - createDate :"", - expiredTime:"", - stateText:[{ - val:0, - name:"未核销" - },{ - val:1, - name:"已核销" - },{ - val:2, - name:"已过期" - },{ - val:3, - name:"已退款" - },] - } - }, - methods: { - ifuse(){ - //调用使用接口 - this.$http.cancel({ - method:"post", - data:{ - couponOrderId:this.list.id - } - }).then(res=>{ - const {code ,message,data} = res - if(code==200){ - this.$router.push('/accomplish') - }else{ - Toast(message); - } - }).catch(res=>{ - Toast(res); - }) - - + data() { + return { + list: {}, + createDate: "", + expiredTime: "", + stateText: [ + { + val: 0, + name: "未核销", }, - gstTicketState(value){ - let temp = this.stateText.filter(res=>{ - return res.val == value - })[0].name - // console.log(temp); - // return temp.name - - } - + { + val: 1, + name: "已核销", + }, + { + val: 2, + name: "已过期", + }, + { + val: 3, + name: "已退款", + }, + ], + }; + }, + methods: { + ifuse() { + Toast.loading({ + duration: 0, // 持续展示 toast + forbidClick: true, + message: "加载中...", + forbidClick: true, + }); + //调用使用接口 + this.$http + .cancel({ + method: "post", + data: { + couponOrderId: this.list.id, + }, + }) + .then((res) => { + const { code, message, data } = res; + if (code == 200) { + Toast.clear(); + this.$router.push("/accomplish"); + } else { + Toast.clear(); + Toast(message); + } + }) + .catch((res) => { + Toast.clear(); + Toast(res); + }); }, - mounted() { - if(this.$route.query.ticket){ - this.list=JSON.parse(this.$route.query.ticket) - this.createDate = moment(Number(this.list.createDate)).format("YYYY-MM-DD HH:mm:ss") - this.expiredTime = moment(Number(this.list.expiredTime)).format("YYYY-MM-DD HH:mm:ss") - }else{ - console.log("券详情为空ticket"); - } + gstTicketState(value) { + let temp = this.stateText.filter((res) => { + return res.val == value; + })[0].name; + // console.log(temp); + // return temp.name }, - -} + }, + mounted() { + if (this.$route.query.ticket) { + this.list = JSON.parse(this.$route.query.ticket); + this.createDate = moment(Number(this.list.createDate)).format( + "YYYY-MM-DD HH:mm:ss" + ); + this.expiredTime = moment(Number(this.list.expiredTime)).format( + "YYYY-MM-DD HH:mm:ss" + ); + } else { + console.log("券详情为空ticket"); + } + }, +}; \ No newline at end of file diff --git a/src/views/navigation/details.vue b/src/views/navigation/details.vue index 8fdecec..9e12aac 100644 --- a/src/views/navigation/details.vue +++ b/src/views/navigation/details.vue @@ -34,6 +34,12 @@ export default { Toast("券码不能为空"); return; } else { + Toast.loading({ + message: "加载中...", + duration: 0, // 持续展示 toast + forbidClick: true, + forbidClick: true, + }); this.$http .ticketDetails({ method: "get", @@ -44,7 +50,7 @@ export default { .then((res) => { const { code, data, message } = res; if (code == 200) { - console.log(data); + Toast.clear(); this.$router.push({ path: "/commodity", query: { @@ -52,11 +58,13 @@ export default { }, }); } else { + Toast.clear(); Toast(message); return; } }) .catch((res) => { + Toast.clear(); Toast(res); }); } @@ -79,6 +87,7 @@ export default { border-radius: 0.2rem; box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15); overflow: hidden; + background-color: #fff; } .text { float: left; diff --git a/src/views/navigation/integral/AddEnd.vue b/src/views/navigation/integral/AddEnd.vue index 784a7be..c056299 100644 --- a/src/views/navigation/integral/AddEnd.vue +++ b/src/views/navigation/integral/AddEnd.vue @@ -5,20 +5,37 @@
操作成功
-
{{ `本次积分:+100 ` }}
+
{{ text }}
-
继续
-
返回首页
+
继续
+
返回首页
+ \ No newline at end of file