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 @@
-
+
-
+
-
+
-
-
-
-
+
+
-
+
-
+
- ¥25.00元
+ ¥{{ $common.moneyFormat(needPay)}}元
-
-
+
+
温馨提示
@@ -35,68 +34,69 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
- ¥25.00元
-
-
-
-
-
- 温馨提示
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -109,16 +109,10 @@ export default {
format: true
})
return {
- vModelValue: 3,
- title: 'picker',
- array: ['全部', '充值', '支付'],
- arrayWay: ['所有方式', '微信', '线下公对公'],
- index: 0,
- indexWay: 0,
+ vModelValue: 1,
benginDate: currentDate,
overDate: currentDate,
-
- iconType:'auto', // 图标样式
+ iconType: 'auto', // 图标样式
datetimesingle: '',
// 基础表单数据
baseFormData: {
@@ -134,23 +128,38 @@ export default {
}]
}
},
+ cardTypeName: '',// 卡类型名称
+ cardRuleName: '',// 卡名称
+ plName: '', // 停车场
+ price: '', // 卡价格
+ cardNum: '', // 库存
+ needPay: 0, // 应付
+ cardRuleNo: '',
}
},
onLoad(params) {
wx.showShareMenu({
withShareTicket: true
})
-
+ let option = JSON.parse(params.optionData)
+ console.log(option)
+ this.cardRelParkNo = option.cardRelParkNo
+ this.cardRuleNo = option.cardRuleNo
+ this.cardTypeName = option.cardTypeName
+ this.cardRuleName = option.cardRuleName
+ this.plName = option.plName
+ this.price = option.value
+ this.cardNum = option.cardNum
+ this.needPay = this.price * this.vModelValue
},
onShow() {
var me = this;
-
},
mounted() {
setTimeout(() => {
- this.baseFormData.datetimesingle = Date.now() - 2*24*3600*1000
- this.datetimesingle = Date.now() - 2*24*3600*1000
- },500)
+ this.baseFormData.datetimesingle = Date.now() - 2 * 24 * 3600 * 1000
+ this.datetimesingle = Date.now() - 2 * 24 * 3600 * 1000
+ }, 500)
},
computed: {
startDate() {
@@ -161,6 +170,48 @@ export default {
}
},
methods: {
+ tobuy() {
+ let that = this
+ let paramsData = {
+ buyNum: this.vModelValue,
+ totalPrice: this.needPay,
+ cardRelParkNo: this.cardRelParkNo,
+ cardRuleNo: this.cardRuleNo
+ }
+ // 首页信息获取 接口
+ that.$myRequest({
+ url: that.$common.createCouponOrder,
+ method: 'POST',
+ data: that.$common.requestSign(paramsData)
+ }).then(res => {
+ console.log(res)
+ let orderId = res.data.orderId
+ this.accountPay(orderId)
+ })
+ },
+ accountPay(orderId){
+ let that = this
+ let paramsData = {
+ payType: '35', // '35' 商户余额支付
+ paySrcType: '501', // '101' : 停车付款单, '501': '商户优惠券购买'
+ orderId: orderId,
+ payFee: this.needPay
+ }
+ // 首页信息获取 接口
+ that.$myRequest({
+ url: that.$common.accountPay,
+ method: 'POST',
+ data: that.$common.requestSign(paramsData)
+ }).then(res => {
+ console.log(res)
+ uni.showToast({
+ title: '购买成功',
+ icon: 'success',
+ duration: 1000
+ })
+
+ })
+ },
changeLog(e) {
console.log('change事件:', e);
},
@@ -169,15 +220,15 @@ export default {
},
dialogConfirm() {
console.log('点击确认')
- this.messageText = `点击确认了 ${this.msgType} 窗口`
- this.$refs.message.open()
+ this.tobuy()
},
dialogToggle(type) {
- this.msgType = type
this.$refs.alertDialog.open()
},
changeValue(value) {
console.log('返回数值:', value);
+ this.vModelValue = value
+ this.needPay = this.price * this.vModelValue
},
blur(e) {
console.log('blur:', e);
@@ -185,10 +236,10 @@ export default {
focus(e) {
console.log('focus:', e);
},
- actionsClick(text){
+ actionsClick(text) {
uni.showToast({
- title:text,
- icon:'none'
+ title: text,
+ icon: 'none'
})
},
bindPickerChange: function (e) {
@@ -229,11 +280,11 @@ export default {
background-color: #fff;
}
- /deep/ .uni-section{
+ /deep/ .uni-section {
padding-bottom: 10px;
}
- /*/deep/ .uni-datetime-picker-btn-text{*/
- /*display: none;*/
- /*}*/
+ /deep/ .uni-dialog-content-text{
+ text-align: center;
+ }
diff --git a/pages/businessCard/cardDetail.vue b/pages/businessCard/cardDetail.vue
index e56869d..3a9be3c 100644
--- a/pages/businessCard/cardDetail.vue
+++ b/pages/businessCard/cardDetail.vue
@@ -1,6 +1,8 @@
- 共18张券被领取,合计金额100.00元,其中已使用16张
+
+ 共{{issuedCount}}张券被领取,合计金额{{$common.moneyFormat(totalFee)}}元,其中已使用{{usedCount}}张
+
@@ -77,7 +79,8 @@
领取时间
-
+
已使用
@@ -89,8 +92,10 @@
使用时间
-
-
+
+
{{i.fullCutValue}}元/张
@@ -102,123 +107,120 @@
-
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -250,11 +252,12 @@ export default {
endTime: currentDate,
pageNum: '1',//当前页
pageSize: '10',//每页条数
- totalPages:'1', // 总条数
- // isLoadAll: false,
- // reload: false,
+ totalPages: '1', // 总条数
status: 'no-more',
dataList: [],
+ issuedCount: 0,// 被领取张数
+ usedCount: 0,// 使用张数
+ totalFee: 0, // 金额
}
},
onLoad(params) {
@@ -262,6 +265,7 @@ export default {
withShareTicket: true
})
this.fetchData()
+ this.couponDetailSummary()
},
onShow() {
var me = this;
@@ -282,14 +286,11 @@ export default {
console.log(this.dataList.length)
if (this.totalPages == this.dataList.length) {
this.status = 'no-more'
- console.log('111')
return
} else {
this.pageNum++;
this.fetchData()
}
-
-
},
computed: {
startDate() {
@@ -301,15 +302,13 @@ export default {
},
methods: {
fetchData: function () {
-
-
let that = this
that.status = 'loading'
let paramsData = {
pageNum: this.pageNum,
pageSize: this.pageSize,
- beginTime: this.beginTime+' 00:00:00',
- endTime: this.endTime+' 23:59:59',
+ beginTime: this.beginTime + ' 00:00:00',
+ endTime: this.endTime + ' 23:59:59',
cardType: this.cardType.toString(), //卡券类型 :1-单次券,2-时长券,3-满减券,4-金额券,5-包天券
isUesed: this.isUesed.toString(), //1:已使用/绑定 0:未使用
}
@@ -320,16 +319,43 @@ export default {
data: that.$common.requestSign(paramsData)
}).then(res => {
// const resDataArray = that.dataList.concat(res.data.dataList);
- if(res.data.pageTotals<10){
- this.status = 'no-more'
+ if(res.data.dataList.length>0){
+ if (res.data.pageTotals < 10) {
+ that.status = 'no-more'
+ } else {
+ that.status = 'more'
+ console.log('more')
+ }
}else{
- this.status = 'more'
+ that.status = 'no-more'
}
+
that.totalPages = res.data.pageTotals;
that.dataList = that.dataList.concat(res.data.dataList)
console.log(that.dataList.length)
})
},
+ couponDetailSummary: function () {
+ let that = this
+ that.status = 'loading'
+ let paramsData = {
+ beginTime: this.beginTime + ' 00:00:00',
+ endTime: this.endTime + ' 23:59:59',
+ cardType: this.cardType.toString(), //卡券类型 :1-单次券,2-时长券,3-满减券,4-金额券,5-包天券
+ isUesed: this.isUesed.toString(), //1:已使用/绑定 0:未使用
+ }
+ // 首页信息获取 接口
+ that.$myRequest({
+ url: that.$common.couponDetailSummary,
+ method: 'POST',
+ data: that.$common.requestSign(paramsData)
+ }).then(res => {
+ console.log(res)
+ this.issuedCount = res.data.issuedCount // 被领取张数
+ this.usedCount = res.data.usedCount // 使用张数
+ this.totalFee = res.data.totalFee // 金额
+ })
+ },
bindPickerChange: function (e, storage) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.index = e.detail.value
@@ -338,7 +364,8 @@ export default {
this.pageSize = this.pageSize
this.totalPages = 1
this.dataList = []
- this.couponIssuedParkPage()
+ this.fetchData()
+ this.couponDetailSummary()
},
bindPickerChangeWay: function (e, storage) {
console.log(storage)
@@ -348,7 +375,8 @@ export default {
this.pageSize = this.pageSize
this.totalPages = 1
this.dataList = []
- this.couponIssuedParkPage()
+ this.fetchData()
+ this.couponDetailSummary()
},
bindStartDateChange: function (e) {
console.log(e.detail.value)
@@ -357,7 +385,8 @@ export default {
this.pageSize = this.pageSize
this.totalPages = 1
this.dataList = []
- this.couponIssuedParkPage()
+ this.fetchData()
+ this.couponDetailSummary()
},
bindEndDateChange: function (e) {
this.endTime = e.detail.value
@@ -365,7 +394,8 @@ export default {
this.pageSize = this.pageSize
this.totalPages = 1
this.dataList = []
- this.couponIssuedParkPage()
+ this.fetchData()
+ this.couponDetailSummary()
},
getDate(type) {
const date = new Date();
@@ -386,23 +416,6 @@ export default {
diff --git a/pages/businessCard/provideCard.vue b/pages/businessCard/provideCard.vue
index b491afd..fb70e7b 100644
--- a/pages/businessCard/provideCard.vue
+++ b/pages/businessCard/provideCard.vue
@@ -18,13 +18,13 @@
-
-
+
+
-
-
+
+
@@ -39,37 +39,39 @@ export default {
qrShow: false,
cardTypeName: '',// 卡类型名称
cardRuleName: '',// 卡名称
- plName:'', // 停车场
- price:'', // 卡价格
- cardNum:'', // 库存
+ plName: '', // 停车场
+ price: '', // 卡价格
+ cardNum: '', // 库存
+ timer: null, // 定时器
+ qrUrl: '',// 二维码url
+ provideText:'停止自动发放',
+ cardRelParkNo:'',//商券规则关联车场和商户编码
}
},
onLoad(params) {
wx.showShareMenu({
withShareTicket: true
})
- // let option = JSON.parse(params.optionData)
- // console.log(option)
- // this.cardTypeName = option.cardTypeName
- // this.cardRuleName = option.cardRuleName
- // this.plName = option.plName
- // this.price = option.value
- // this.cardNum = option.cardNum
+ let option = JSON.parse(params.optionData)
+ console.log(option)
+ this.cardRelParkNo = option.cardRelParkNo
+ this.cardTypeName = option.cardTypeName
+ this.cardRuleName = option.cardRuleName
+ this.plName = option.plName
+ this.price = option.value
+ this.cardNum = option.cardNum
// this.maxNum = option.cardNum
this.getCouponDynamicQR()
},
onShow() {
var me = this;
-
- },
- computed: {
-
},
+ computed: {},
methods: {
getCouponDynamicQR() {
let that = this
let paramsData = {
- cardRelParkNo: '123qwe',
+ cardRelParkNo: this.cardRelParkNo,
codeType: '2'
}
// 首页信息获取 接口
@@ -79,13 +81,18 @@ export default {
data: that.$common.requestSign(paramsData)
}).then(res => {
console.log(res)
- let qrUrl = res.data.qrUrl
- that.qrFun(qrUrl) //调用二维码方法
- console.log(qrUrl)
+ that.qrUrl = res.data.qrUrl
+ that.qrFun(that.qrUrl) //调用二维码方法
+ that.timer = setInterval(() => {
+ // 业务逻辑
+ console.log('11')
+ that.qrFun(that.qrUrl) //调用二维码方法
+ }, 300000)
+ console.log(that.qrUrl)
})
},
//**生成二维码**//
- qrFun: function(text) {
+ qrFun: function (text) {
this.qrShow = true
uQRCode.make({
canvasId: 'qrcode',
@@ -97,85 +104,51 @@ export default {
foregroundColor: '#000000',
fileType: 'jpg',
errorCorrectLevel: uQRCode.errorCorrectLevel.H,
- success: res => {}
+ success: res => {
+ }
})
+ },
+ stopProvide: function () {
+ let that = this
+ // provideText:'停止自动发放'
+ if(that.provideText == '停止自动发放'){
+ that.provideText = '开始自动发放'
+ clearInterval(that.timer)
+ that.timer = null;
+ }else{
+ that.provideText = '停止自动发放'
+ that.qrFun(that.qrUrl) //调用二维码方法
+ that.timer = setInterval(() => {
+ // 业务逻辑
+ console.log('11')
+ that.qrFun(that.qrUrl) //调用二维码方法
+ }, 300000)
+ }
+ },
+ toPrintCard: function () {
+ uni.navigateTo({
+
+ url: '../businessCard/printCard?cardRelParkNo='+this.cardRelParkNo+
+ '&cardTypeName='+ this.cardTypeName+
+ '&cardRuleName='+this.cardRuleName+
+ '&plName='+this.plName+
+ '&price='+this.price+
+ '&cardNum='+this.cardNum
+ });
}
}
}