Browse Source

券详情接口修改,支付接口修改

tags/2.2.4
Stormeye.Wu 6 years ago
parent
commit
4f12754a93
5 changed files with 24 additions and 13 deletions
  1. +1
    -1
      components/coupons/index.wxml
  2. +12
    -6
      pages/coupon/detail/index.js
  3. +5
    -2
      pages/getphoneInfo/index.js
  4. +3
    -3
      pages/index/rushToBuy/index.js
  5. +3
    -1
      pages/phoneinput/phoneinput.js

+ 1
- 1
components/coupons/index.wxml View File

@@ -1,4 +1,4 @@
<navigator url="/pages/coupon/detail/index?id={{data.id}}">
<navigator url="/pages/coupon/detail/index?id={{data.id}}&couponId={{data.couponId}}">
<!-- 首页优惠券列表页面 -->
<view class="coupons">
<view class="coupons-img">


+ 12
- 6
pages/coupon/detail/index.js View File

@@ -5,6 +5,8 @@ const util = require("../../../utils/util");
Page({
data: {
data: {},
couponChannelId: null,
couponId: null,
orderId: "",
day: "",
hour: "",
@@ -13,6 +15,10 @@ Page({
onLoad(options) {
let that = this;
console.log(options.id);
that.setData({
couponChannelId: options.id,
couponId: options.couponId
})
wx.showLoading({
title: "加载中..."
});
@@ -160,8 +166,8 @@ Page({
return Http.post({
url: config.api.orderSave,
data: {
couponChannelId: '' + that.data.data.id,
couponId: '' + that.data.data.couponId
couponChannelId: '' + that.data.couponChannelId,
couponId: '' + that.data.couponId
}
});
})
@@ -170,13 +176,13 @@ Page({
if (err.code == 11005) {
// 用户手机未授权
wx.redirectTo({
url: "../../getphoneInfo/index?couponChannelId=" + that.data.id
url: "../../getphoneInfo/index?couponChannelId=" + that.data.couponChannelId + "&couponId=" + that.data.couponId
});
}
if (err.code == 11006) {
// 用户手机已加密
wx.redirectTo({
url: "../../phoneinput/phoneinput?couponChannelId=" + that.data.id
url: "../../phoneinput/phoneinput?couponChannelId=" + that.data.couponChannelId + "& couponId=" + that.data.couponId
});
}
})
@@ -197,8 +203,8 @@ Page({
console.log(res);
var payOrderId = "" + res.data.out_trade_no;
wx.hideLoading();
//payment(res);
that.payOrderUpdate(that.data.orderId, payOrderId, 1); // 支付成功
payment(res);
//that.payOrderUpdate(that.data.orderId, payOrderId, 1); // 支付成功
});
} else {
// 免费券


+ 5
- 2
pages/getphoneInfo/index.js View File

@@ -5,12 +5,14 @@ Page({
data: {
canIUse: wx.canIUse('button.open-type.getPhoneNumber'),
couponChannelId: null,
couponId: null
},
onLoad: function(options) {
var that = this;
console.log(options);
that.setData({
couponChannelId: options.couponChannelId
couponChannelId: options.couponChannelId,
couponId: options.couponId
})
},
getPhoneNumber: function(e) {
@@ -32,7 +34,8 @@ Page({
icon: "success",
success: function(res) {
wx.redirectTo({
url: '/pages/coupon/detail/index?id=' + that.data.couponChannelId + "&flag=pay",
url: '/pages/coupon/detail/index?id='
+ that.data.couponChannelId + '&couponId='+ that.data.couponId +'&flag=pay",
})
}
})


+ 3
- 3
pages/index/rushToBuy/index.js View File

@@ -36,12 +36,12 @@ Component({
gotodetail: function(e) {
console.log(e);
console.log("出错啦 大哥");
console.log(e.currentTarget.dataset.couponid);
console.log(e.currentTarget.dataset.id);
console.log(e.currentTarget.dataset.targetad);
wx.navigateTo({
url: `/pages/coupon/detail/index?id=${
e.currentTarget.dataset.couponid
}&targetAd=${e.currentTarget.dataset.targetad}`
e.currentTarget.dataset.id
}&couponId=${e.currentTarget.dataset.couponId}`
});
}
},


+ 3
- 1
pages/phoneinput/phoneinput.js View File

@@ -10,12 +10,14 @@ Page({
retry: false,
time: 60,
couponChannelId: null,
couponId:null
},
onLoad: function (options) {
var that = this;
console.log(options);
that.setData({
couponChannelId: options.couponChannelId
couponChannelId: options.couponChannelId,
couponId: options.couponId,
})
},
getYZM(e) {


Loading…
Cancel
Save