Kaynağa Gözat

[支付相关api][整理/修复]:api相关问题修复

tags/2.2.4
Stormeye.Wu 6 yıl önce
ebeveyn
işleme
716a8bd1eb
6 değiştirilmiş dosya ile 31 ekleme ve 20 silme
  1. +2
    -2
      config/config.js
  2. +19
    -15
      pages/coupons/details/index.js
  3. +1
    -0
      pages/coupons/index/index.js
  4. +7
    -2
      pages/getphoneInfo/index.js
  5. +1
    -1
      pages/index/coupons/index.js
  6. +1
    -0
      pages/order/index/index.js

+ 2
- 2
config/config.js Dosyayı Görüntüle

@@ -1,7 +1,7 @@
var config = {
name: "富茂",
//url: "https://ciformall.youlane.cn/C/api",
url: "http://0da722ce.ngrok.io/C/api",
url: "https://ciformall.youlane.cn/C/api",
//url: "http://d6a6e7e6.ngrok.io/C/api",
api: {
/**
* 接口用途:login


+ 19
- 15
pages/coupons/details/index.js Dosyayı Görüntüle

@@ -12,18 +12,22 @@ Page({
wx.showLoading({
title: '加载中...',
})
Http.get({
url: Http.config.api.couponDetail,
data: {
id: e.id
}
}).then(res => {
wx.hideLoading();
this.setData({
data: res,
couponId: e.id
if (e.flag == 'pay') {
this.orderFunc();
} else {
Http.get({
url: config.api.couponDetail,
data: {
id: e.id
}
}).then(res => {
wx.hideLoading();
this.setData({
data: res,
couponId: e.id
})
})
})
}
},
/**
* 支付订单更新
@@ -31,7 +35,7 @@ Page({
payOrderUpdate: (orderId, payOrderId, status, reason) => {
// 支付成功
return Http.post({
url: Http.config.api.payOrderUpdate,
url: config.api.payOrderUpdate,
data: {
payOrderId: payOrderId,
orderId: orderId,
@@ -109,7 +113,7 @@ Page({
})
.then(res => {
return Http.post({
url: Http.config.api.orderSave,
url: config.api.orderSave,
data: {
couponId: that.data.couponId
}
@@ -119,7 +123,7 @@ Page({
if (err.code == 11005) {
// 用户手机未授权
wx.redirectTo({
url: '../../getphoneInfo/index',
url: '../../getphoneInfo/index?couponId='+that.data.couponId,
})
}
if (err.code == 11006) {
@@ -137,7 +141,7 @@ Page({
if (res.data.payment > 0) {
// real pay
return Http.post({
url: Http.config.api.payOrderCreate,
url: config.api.payOrderCreate,
data: {
orderId: orderId
}


+ 1
- 0
pages/coupons/index/index.js Dosyayı Görüntüle

@@ -1,4 +1,5 @@
let format = require('../../../utils/util.js')
let config = require('../../../config/config.js')
let app = getApp()
const Http = require("../../../utils/HttpBasics")
//1535126400000


+ 7
- 2
pages/getphoneInfo/index.js Dosyayı Görüntüle

@@ -3,10 +3,15 @@ const Http = require("../../utils/HttpBasics");
var app = getApp();
Page({
data: {
canIUse: wx.canIUse('button.open-type.getPhoneNumber')
canIUse: wx.canIUse('button.open-type.getPhoneNumber'),
couponId: null,
},
onLoad: function(options) {
var that = this;
console.log(options);
that.setData({
couponId: options.couponId
})
},
getPhoneNumber: function(e) {
var that = this;
@@ -27,7 +32,7 @@ Page({
icon: "success",
success: function(res) {
wx.redirectTo({
url: '../login/login',
url: '../coupons/details/index?id=' + that.data.couponId + "&flag=pay",
})
}
})


+ 1
- 1
pages/index/coupons/index.js Dosyayı Görüntüle

@@ -68,7 +68,7 @@ Component({
ready() {
app.couponListCallback = token => {
Http.get({
url: Http.config.api.couponList,
url: config.api.couponList,
data: {
pageNum: 1,
pageSize: 10


+ 1
- 0
pages/order/index/index.js Dosyayı Görüntüle

@@ -1,3 +1,4 @@
let config = require('../../../config/config.js')
let Http = require('../../../utils/HttpBasics')
let app = getApp()



Yükleniyor…
İptal
Kaydet