Ver a proveniência

[下订单接口][修改]:couponChanelId下单

tags/2.2.4
Stormeye.Wu há 7 anos
ascendente
cometimento
819ab27ef3
6 ficheiros alterados com 25 adições e 26 eliminações
  1. +1
    -1
      components/coupons/index.wxml
  2. +4
    -4
      config/config.js
  3. +6
    -14
      pages/coupon/detail/index.js
  4. +3
    -3
      pages/getphoneInfo/index.js
  5. +9
    -2
      pages/phoneinput/phoneinput.js
  6. +2
    -2
      pages/rushToBuy/index.js

+ 1
- 1
components/coupons/index.wxml Ver ficheiro

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


+ 4
- 4
config/config.js Ver ficheiro

@@ -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;

+ 6
- 14
pages/coupon/detail/index.js Ver ficheiro

@@ -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
});
}
})


+ 3
- 3
pages/getphoneInfo/index.js Ver ficheiro

@@ -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",
})
}
})


+ 9
- 2
pages/phoneinput/phoneinput.js Ver ficheiro

@@ -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 => {


+ 2
- 2
pages/rushToBuy/index.js Ver ficheiro

@@ -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
},


Carregando…
Cancelar
Guardar