diff --git a/common/common.js b/common/common.js
index a7f8ac6..8b832ed 100644
--- a/common/common.js
+++ b/common/common.js
@@ -40,6 +40,15 @@ 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";
+
+
+
+
+
//陈彪接口
// 余额明细下拉框选择列表
@@ -225,6 +234,9 @@ export default {
getCouponDynamicQR,
getCouponStaticQR,
couponDetailSummary,
+ createCouponOrder,
+ accountPay,
+
//陈彪接口
rechargeList,
diff --git a/pages.json b/pages.json
index 1f89798..3f93101 100644
--- a/pages.json
+++ b/pages.json
@@ -13,19 +13,20 @@
},
"pages": [
// pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
-
{
- "path": "pages/businessCard/buyCard",
+ "path": "pages/businessCard/businessCard",
"style": {
- "navigationBarTitleText": "商户卡券购买"
+ "navigationBarTitleText": "商户卡券"
}
},
+
{
- "path": "pages/businessCard/businessCard",
+ "path": "pages/businessCard/buyCard",
"style": {
- "navigationBarTitleText": "商户卡券"
+ "navigationBarTitleText": "商户卡券购买"
}
},
+
{
"path": "pages/businessCard/cardDetail",
"style": {
diff --git a/pages/businessCard/businessCard.vue b/pages/businessCard/businessCard.vue
index 8211917..c1419a3 100644
--- a/pages/businessCard/businessCard.vue
+++ b/pages/businessCard/businessCard.vue
@@ -9,7 +9,7 @@
-
diff --git a/pages/businessCard/buyCard.vue b/pages/businessCard/buyCard.vue
index 0d401cc..dbe8302 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,12 +109,10 @@ export default {
format: true
})
return {
- vModelValue: 3,
-
+ vModelValue: 1,
benginDate: currentDate,
overDate: currentDate,
-
- iconType:'auto', // 图标样式
+ iconType: 'auto', // 图标样式
datetimesingle: '',
// 基础表单数据
baseFormData: {
@@ -130,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() {
@@ -157,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);
},
@@ -165,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);
@@ -181,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) {
@@ -225,9 +280,11 @@ export default {
background-color: #fff;
}
- /deep/ .uni-section{
+ /deep/ .uni-section {
padding-bottom: 10px;
}
-
+ /deep/ .uni-dialog-content-text{
+ text-align: center;
+ }