diff --git a/common/common.js b/common/common.js index 4a441eb..8671229 100644 --- a/common/common.js +++ b/common/common.js @@ -35,6 +35,19 @@ const couponRuleParkPage = serverUrl + "/business/h5/coupon/couponRuleParkPage"; const couponIssuedParkPage = serverUrl + "/business/h5/couponIssued/couponIssuedParkPage"; // 商户卡券-卡券发放-生成领券的动态码 const getCouponDynamicQR = serverUrl + "/business/h5/couponsend/getCouponDynamicQR"; +// 商户卡券-卡券发放-生成领券的静态码下载地址 +const getCouponStaticQR = serverUrl + "/business/h5/couponsend/getCouponStaticQR"; +// 卡券申领明细总览 +const couponDetailSummary = serverUrl + "/business/h5/couponIssued/couponDetailSummary"; + +// 商户卡券-卡券下单 +const createCouponOrder = serverUrl + "/business/h5/coupon/createCouponOrder"; +// 商户卡券-使用余额购买 +const accountPay = serverUrl + "/business/h5/pay/busAccount/accountPay"; + + + + //陈彪接口 @@ -219,6 +232,12 @@ export default { couponRuleParkPage, couponIssuedParkPage, getCouponDynamicQR, + getCouponStaticQR, + couponDetailSummary, + createCouponOrder, + accountPay, + + //陈彪接口 rechargeList, walletKindType, diff --git a/common/requestServer.js b/common/requestServer.js index 1e7e4d6..da33ece 100644 --- a/common/requestServer.js +++ b/common/requestServer.js @@ -52,7 +52,7 @@ export const myRequest = (options) => { uni.hideLoading(); uni.showToast({ title: result.message, - icon: 'error', + icon: 'none', duration: 2000 }); } @@ -65,7 +65,7 @@ export const myRequest = (options) => { console.log("请求失败", error); uni.showToast({ title: error.message, - icon: 'error', + icon: 'none', duration: 2000 }) // 失败数据 diff --git a/pages.json b/pages.json index 81fa8db..8748915 100644 --- a/pages.json +++ b/pages.json @@ -21,9 +21,10 @@ } }, { - "path": "pages/businessCard/provideCard", + "path": "pages/businessCard/cardDetail", "style": { - "navigationBarTitleText": "商户卡券发放" + "navigationBarTitleText": "商户卡券明细", + "enablePullDownRefresh": true } }, { @@ -33,13 +34,34 @@ } }, + + { - "path": "pages/businessCard/cardDetail", + "path": "pages/businessCard/buyCard", "style": { - "navigationBarTitleText": "商户卡券明细", - "enablePullDownRefresh": true + "navigationBarTitleText": "商户卡券购买" } }, + + + + { + "path": "pages/businessCard/provideCard", + "style": { + "navigationBarTitleText": "商户卡券发放" + } + }, + { + "path": "pages/businessCard/printCard", + "style": { + "navigationBarTitleText": "商户卡券打印" + } + }, + + + + + { "path": "pages/rechargeDetail/rechargeDetail", "style": { @@ -71,20 +93,9 @@ } }, - { - "path": "pages/businessCard/printCard", - "style": { - "navigationBarTitleText": "商户卡券打印" - } - }, - { - "path": "pages/businessCard/buyCard", - "style": { - "navigationBarTitleText": "商户卡券购买" - } - }, + { diff --git a/pages/businessCard/businessCard.vue b/pages/businessCard/businessCard.vue index 63f1801..259dcd3 100644 --- a/pages/businessCard/businessCard.vue +++ b/pages/businessCard/businessCard.vue @@ -9,7 +9,7 @@ - @@ -32,8 +32,8 @@ - - 暂无可以购买的商户卡券 + + @@ -44,15 +44,9 @@ export default { dataList: [], rows: [], pageNum: 1,//当前页 - pageSize: 1,//每页条数 - reload: false, - status: 'more', - contentText: { - contentdown: '上拉加载更多~', - contentrefresh: '正在加载更多~', - contentmore: '我是有底线的~' - }, - iconType: 'auto', // 图标样式 + pageSize: 10,//每页条数 + totalPages: '1', // 总条数 + status: 'no-more', } }, onLoad(params) { @@ -64,14 +58,37 @@ export default { onShow() { var me = this; }, + // 下拉刷新触发 + onPullDownRefresh(val) { + console.log('下拉刷新触发') + this.pageNum = 1 + this.pageSize = this.pageSize + this.totalPages = 1 + this.dataList = [] + this.couponRuleParkPage() + }, + // 上拉加载触发 + onReachBottom() { + console.log('上拉加载触发') + console.log(this.totalPages) + console.log(this.dataList.length) + if (this.totalPages == this.dataList.length) { + this.status = 'no-more' + return + } else { + this.pageNum++; + this.couponRuleParkPage() + } + }, computed: {}, methods: { // 通过商户ID查询停车记录信息 couponRuleParkPage() { let that = this + that.status = 'loading' let paramsData = { - pageNum: '1', - pageSize: '10' + pageNum: this.pageNum, + pageSize: this.pageSize } // 首页信息获取 接口 that.$myRequest({ @@ -79,26 +96,36 @@ export default { method: 'POST', data: that.$common.requestSign(paramsData) }).then(res => { - this.dataList = res.data.dataList - console.log(this.dataList) + if(res.data.dataList.length>0){ + if (res.data.pageTotals < 10) { + that.status = 'no-more' + } else { + that.status = 'more' + console.log('more') + } + }else{ + that.status = 'no-more' + } + that.totalPages = res.data.pageTotals; + that.dataList = that.dataList.concat(res.data.dataList) + console.log(that.dataList.length) }) }, toBuy(i) { uni.navigateTo({ - url: '../businessCard/buyCard?optionData='+JSON.stringify(i) + url: '../businessCard/buyCard?optionData=' + JSON.stringify(i) }); }, - printClick(i){ + printClick(i) { uni.navigateTo({ - url: '../businessCard/cardPrint?optionData='+JSON.stringify(i) + url: '../businessCard/cardPrint?optionData=' + JSON.stringify(i) }); }, - provideCard(i){ + provideCard(i) { uni.navigateTo({ - url: '../businessCard/provideCard?optionData='+JSON.stringify(i) + url: '../businessCard/provideCard?optionData=' + JSON.stringify(i) }); } - } } @@ -108,48 +135,7 @@ export default { padding-bottom: 10px; } - .rechargeWrap { - position: relative; - .rechargeArrow { - position: absolute; - right: 10px; - top: 30px; - font-size: 20px; - color: #999; - } - } - - .recordCon { - padding-right: 35px; - color: #999; - display: flex; - justify-content: space-between; - } - - .container { - overflow: hidden; - } - .custom-cover { - flex: 1; - flex-direction: row; - position: relative; - } - - .cover-content { - position: absolute; - bottom: 0; - left: 0; - right: 0; - height: 40px; - background-color: rgba($color: #000000, $alpha: 0.4); - display: flex; - flex-direction: row; - align-items: center; - padding-left: 15px; - font-size: 14px; - color: #fff; - } .card-actions { display: flex; diff --git a/pages/businessCard/buyCard.vue b/pages/businessCard/buyCard.vue index 1837613..61b7484 100644 --- a/pages/businessCard/buyCard.vue +++ b/pages/businessCard/buyCard.vue @@ -1,33 +1,32 @@