瀏覽代碼

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

tags/2.2.4
Stormeye.Wu 7 年之前
父節點
當前提交
819ab27ef3
共有 6 個文件被更改,包括 25 次插入26 次删除
  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 查看文件

@@ -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">
<view class="coupons-img"> <view class="coupons-img">


+ 4
- 4
config/config.js 查看文件

@@ -1,7 +1,7 @@
var config = { var config = {
name: "富茂", 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: { api: {
/** /**
* 接口用途:login * 接口用途:login
@@ -114,7 +114,7 @@ var config = {
/** /**
* banner详情页面 * banner详情页面
*/ */
bannerDetail:"/wxCampaign/findById"
bannerDetail: "/wxCampaign/findById"
}, },


weapp: { weapp: {
@@ -131,4 +131,4 @@ for (var key in config.api) {
config.api[key] = apiPrefix + config.api[key]; config.api[key] = apiPrefix + config.api[key];
} }
*/ */
module.exports = config;
module.exports = config;

+ 6
- 14
pages/coupon/detail/index.js 查看文件

@@ -5,8 +5,6 @@ const util = require("../../../utils/util");
Page({ Page({
data: { data: {
data: {}, data: {},
couponChannelId: null,
couponId: null,
orderId: "", orderId: "",
day: "", day: "",
hour: "", hour: "",
@@ -15,10 +13,6 @@ Page({
onLoad(options) { onLoad(options) {
let that = this; let that = this;
console.log(options.id); console.log(options.id);
that.setData({
couponId: options.id
})
console.log(options.targetAd);
wx.showLoading({ wx.showLoading({
title: "加载中..." title: "加载中..."
}); });
@@ -29,8 +23,7 @@ Page({
Http.get({ Http.get({
url: config.api.couponDetail, url: config.api.couponDetail,
data: { data: {
couponId: options.id,
targetAd: options.targetAd
id: options.id,
} }
}).then(res => { }).then(res => {
console.log(res); console.log(res);
@@ -62,8 +55,7 @@ Page({
console.log(that.data.day); console.log(that.data.day);
wx.hideLoading(); wx.hideLoading();
that.setData({ that.setData({
data: res.data,
couponChannelId: res.data.couponChannelId
data: res.data
}); });
}); });
} }
@@ -168,8 +160,8 @@ Page({
return Http.post({ return Http.post({
url: config.api.orderSave, url: config.api.orderSave,
data: { 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) { if (err.code == 11005) {
// 用户手机未授权 // 用户手机未授权
wx.redirectTo({ wx.redirectTo({
url: "../../getphoneInfo/index?couponId=" + that.data.couponId
url: "../../getphoneInfo/index?couponChannelId=" + that.data.id
}); });
} }
if (err.code == 11006) { if (err.code == 11006) {
// 用户手机已加密 // 用户手机已加密
wx.redirectTo({ wx.redirectTo({
url: "../../phoneinput/phoneinput?couponId=" + that.data.couponId
url: "../../phoneinput/phoneinput?couponChannelId=" + that.data.id
}); });
} }
}) })


+ 3
- 3
pages/getphoneInfo/index.js 查看文件

@@ -4,13 +4,13 @@ var app = getApp();
Page({ Page({
data: { data: {
canIUse: wx.canIUse('button.open-type.getPhoneNumber'), canIUse: wx.canIUse('button.open-type.getPhoneNumber'),
couponId: null,
couponChannelId: null,
}, },
onLoad: function(options) { onLoad: function(options) {
var that = this; var that = this;
console.log(options); console.log(options);
that.setData({ that.setData({
couponId: options.couponId
couponChannelId: options.couponChannelId
}) })
}, },
getPhoneNumber: function(e) { getPhoneNumber: function(e) {
@@ -32,7 +32,7 @@ Page({
icon: "success", icon: "success",
success: function(res) { success: function(res) {
wx.redirectTo({ 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 查看文件

@@ -9,7 +9,14 @@ Page({
yzm: '', yzm: '',
retry: false, retry: false,
time: 60, time: 60,
couponId: null,
couponChannelId: null,
},
onLoad: function (options) {
var that = this;
console.log(options);
that.setData({
couponChannelId: options.couponChannelId
})
}, },
getYZM(e) { getYZM(e) {
this.setData({ this.setData({
@@ -31,7 +38,7 @@ Page({
}) })
.then(res => { .then(res => {
wx.redirectTo({ 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 => { .catch(error => {


+ 2
- 2
pages/rushToBuy/index.js 查看文件

@@ -117,8 +117,8 @@ Page({
console.log(e.currentTarget.dataset.targetad); console.log(e.currentTarget.dataset.targetad);
wx.navigateTo({ wx.navigateTo({
url: `/pages/coupon/detail/index?id=${ url: `/pages/coupon/detail/index?id=${
e.currentTarget.dataset.couponid
}&targetAd=${e.currentTarget.dataset.targetad}`,
e.currentTarget.dataset.id
}`,
success: function(res) { success: function(res) {
// success // success
}, },


Loading…
取消
儲存