diff --git a/components/coupons/index.wxml b/components/coupons/index.wxml index a780f28..5777a09 100644 --- a/components/coupons/index.wxml +++ b/components/coupons/index.wxml @@ -1,4 +1,4 @@ - + diff --git a/config/config.js b/config/config.js index 3dc349f..92202fb 100755 --- a/config/config.js +++ b/config/config.js @@ -1,7 +1,7 @@ var config = { name: "富茂", - url: "https://ciformall.youlane.cn/C/api", - //url: "http://89e4b9c3.ngrok.io/C/api", + //url: "https://ciformall.youlane.cn/C/api", + url: "http://fd1a0cab.ngrok.io/C/api", api: { /** * 接口用途:login @@ -114,7 +114,7 @@ var config = { /** * banner详情页面 */ - bannerDetail:"/wxCampaign/findById" + bannerDetail: "/wxCampaign/findById" }, weapp: { @@ -131,4 +131,4 @@ for (var key in config.api) { config.api[key] = apiPrefix + config.api[key]; } */ -module.exports = config; +module.exports = config; \ No newline at end of file diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index 5263976..880f325 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -5,8 +5,6 @@ const util = require("../../../utils/util"); Page({ data: { data: {}, - couponChannelId: null, - couponId: null, orderId: "", day: "", hour: "", @@ -15,10 +13,6 @@ Page({ onLoad(options) { let that = this; console.log(options.id); - that.setData({ - couponId: options.id - }) - console.log(options.targetAd); wx.showLoading({ title: "加载中..." }); @@ -29,8 +23,7 @@ Page({ Http.get({ url: config.api.couponDetail, data: { - couponId: options.id, - targetAd: options.targetAd + id: options.id, } }).then(res => { console.log(res); @@ -62,8 +55,7 @@ Page({ console.log(that.data.day); wx.hideLoading(); that.setData({ - data: res.data, - couponChannelId: res.data.couponChannelId + data: res.data }); }); } @@ -168,8 +160,8 @@ Page({ return Http.post({ url: config.api.orderSave, data: { - couponChannelId: that.data.couponChannelId, - couponId: that.data.couponId + couponChannelId: '' + that.data.data.id, + couponId: '' + that.data.data.couponId } }); }) @@ -178,13 +170,13 @@ Page({ if (err.code == 11005) { // 用户手机未授权 wx.redirectTo({ - url: "../../getphoneInfo/index?couponId=" + that.data.couponId + url: "../../getphoneInfo/index?couponChannelId=" + that.data.id }); } if (err.code == 11006) { // 用户手机已加密 wx.redirectTo({ - url: "../../phoneinput/phoneinput?couponId=" + that.data.couponId + url: "../../phoneinput/phoneinput?couponChannelId=" + that.data.id }); } }) diff --git a/pages/getphoneInfo/index.js b/pages/getphoneInfo/index.js index dffd200..4fd5df3 100755 --- a/pages/getphoneInfo/index.js +++ b/pages/getphoneInfo/index.js @@ -4,13 +4,13 @@ var app = getApp(); Page({ data: { canIUse: wx.canIUse('button.open-type.getPhoneNumber'), - couponId: null, + couponChannelId: null, }, onLoad: function(options) { var that = this; console.log(options); that.setData({ - couponId: options.couponId + couponChannelId: options.couponChannelId }) }, getPhoneNumber: function(e) { @@ -32,7 +32,7 @@ Page({ icon: "success", success: function(res) { wx.redirectTo({ - url: '../coupon/detail/index?id=' + that.data.couponId + "&flag=pay", + url: '/pages/coupon/detail/index?id=' + that.data.couponChannelId + "&flag=pay", }) } }) diff --git a/pages/phoneinput/phoneinput.js b/pages/phoneinput/phoneinput.js index 49c2a72..4a19807 100644 --- a/pages/phoneinput/phoneinput.js +++ b/pages/phoneinput/phoneinput.js @@ -9,7 +9,14 @@ Page({ yzm: '', retry: false, time: 60, - couponId: null, + couponChannelId: null, + }, + onLoad: function (options) { + var that = this; + console.log(options); + that.setData({ + couponChannelId: options.couponChannelId + }) }, getYZM(e) { this.setData({ @@ -31,7 +38,7 @@ Page({ }) .then(res => { wx.redirectTo({ - url: '/pages/coupon/detail/index?id=' + that.data.couponId + "&flag=pay", + url: '/pages/coupon/detail/index?id=' + that.data.couponChannelId + "&flag=pay", }) }) .catch(error => { diff --git a/pages/rushToBuy/index.js b/pages/rushToBuy/index.js index 28af078..822fb46 100644 --- a/pages/rushToBuy/index.js +++ b/pages/rushToBuy/index.js @@ -117,8 +117,8 @@ Page({ 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 + }`, success: function(res) { // success },