Browse Source

init

tags/2.2.4
LengYingxin 6 years ago
parent
commit
bd7873f85e
6 changed files with 79 additions and 19 deletions
  1. +7
    -7
      app.json
  2. +49
    -0
      common/common.js
  3. +10
    -1
      config/config.js
  4. +3
    -3
      pages/user/index.wxml
  5. +2
    -2
      project.config.json
  6. +8
    -6
      utils/http.js

+ 7
- 7
app.json View File

@@ -1,15 +1,15 @@
{ {
"pages": [
"pages":[
"pages/index/index", "pages/index/index",
"pages/market/index",
"pages/user/index",
"pages/coupons/details/index", "pages/coupons/details/index",
"pages/shop/details/index", "pages/shop/details/index",
"pages/rushToBuy/index", "pages/rushToBuy/index",
"pages/shop/index/index", "pages/shop/index/index",
"pages/market/index",
"pages/coupons/index/index", "pages/coupons/index/index",
"pages/order/details/index", "pages/order/details/index",
"pages/order/index/index", "pages/order/index/index",
"pages/user/index",
"pages/success/index", "pages/success/index",
"pages/login/index" "pages/login/index"
], ],
@@ -28,15 +28,15 @@
"text": "我的" "text": "我的"
}] }]
}, },
"window": {
"backgroundTextStyle": "light",
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff", "navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat", "navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "black"
"navigationBarTextStyle":"black"
}, },
"networkTimeout": { "networkTimeout": {
"request": 10000, "request": 10000,
"downloadFile": 10000 "downloadFile": 10000
}, },
"debug": false "debug": false
}
}

+ 49
- 0
common/common.js View File

@@ -212,5 +212,54 @@ const func = {
}) })
}) })
}, },
refundCouponOrder: function (couponOrderId) {
return new Promise((resolve, reject) => {
wx.request({
url: config.api.refundCouponOrder,
header: {
"token": app.globalData.token
},
data: {
couponOrderId: couponOrderId,
token: app.globalData.token
},
method: "POST",
success: function (res) {
resolve(res)
},
fail: function (err) {
reject(err)
},
complete: function (res) {
console.log(res)
}
})
})
},
refundOrderCreate: function (orderId, payOrderId) {
return new Promise((resolve, reject) => {
wx.request({
url: config.api.refundOrdercCreate,
header: {
"token": app.globalData.token
},
data: {
payOrderId: payOrderId,
orderId: orderId,
token: app.globalData.token
},
method: "POST",
success: function (res) {
resolve(res)
},
fail: function (err) {
reject(err)
},
complete: function (res) {
console.log(res)
}
})
})
},
} }
module.exports = func; module.exports = func;

+ 10
- 1
config/config.js View File

@@ -1,4 +1,5 @@
var url = 'https://ciformall.youlane.cn' var url = 'https://ciformall.youlane.cn'
//var url = 'http://a8b668aa.ngrok.io'
//var url = 'http://localhost:8001' //var url = 'http://localhost:8001'
var apiPrefix = url + '/C'; var apiPrefix = url + '/C';
var config = { var config = {
@@ -40,10 +41,18 @@ var config = {
* 订单列表 * 订单列表
*/ */
orderList: '/api/order/list', orderList: '/api/order/list',
/**
* 退券
*/
refundCouponOrder: '/api/couponOrder/refund',
/**
* 退款申请
*/
refundOrdercCreate: '/api/refund/create',
}, },


weapp: { weapp: {
AppId: 'wx649b3be73c1afe47',
AppId: 'wx8eb8275b78db4ede',
} }
}; };




+ 3
- 3
pages/user/index.wxml View File

@@ -7,13 +7,13 @@
</view> </view>
<view class="margin"></view> <view class="margin"></view>
<view class="user-btns"> <view class="user-btns">
<navigator url="/pages/market/index">
<navigator url="/pages/order/index/index?id=0">
<view class="user-btn app-border-bottom"> <view class="user-btn app-border-bottom">
<view>我的订单</view> <view>我的订单</view>
<view>全部订单</view> <view>全部订单</view>
</view> </view>
</navigator> </navigator>
<navigator url="/pages/market/index">
<navigator url="/pages/order/index/index?id=1">
<view class="user-btn app-border-bottom"> <view class="user-btn app-border-bottom">
<view>待付款</view> <view>待付款</view>
<view> <view>
@@ -21,7 +21,7 @@
</view> </view>
</view> </view>
</navigator> </navigator>
<navigator url="/pages/market/index">
<navigator url="/pages/order/index/index?id=2">
<view class="user-btn app-border-bottom"> <view class="user-btn app-border-bottom">
<view>已完成</view> <view>已完成</view>
<view> <view>


+ 2
- 2
project.config.json View File

@@ -12,8 +12,8 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.2.2", "libVersion": "2.2.2",
"appid": "wx649b3be73c1afe47",
"projectname": "C4",
"appid": "wx8eb8275b78db4ede",
"projectname": "%E5%AF%8C%E8%8C%82%E6%94%AF%E4%BB%98%E6%B5%8B%E8%AF%95",
"isGameTourist": false, "isGameTourist": false,
"condition": { "condition": {
"search": { "search": {


+ 8
- 6
utils/http.js View File

@@ -1,5 +1,7 @@
let host = 'https://ciformall.youlane.cn/C'

const postResquest = (url, token, message, postData, doSuccess, doFail) => { const postResquest = (url, token, message, postData, doSuccess, doFail) => {
let body={...postData};
let body = { ...postData };
if (message != "") { if (message != "") {
wx.showLoading({ wx.showLoading({
title: message, title: message,
@@ -7,7 +9,7 @@ const postResquest = (url, token, message, postData, doSuccess, doFail) => {
} }
wx.request({ wx.request({
//项目的真正接口,通过字符串拼接方式实现 //项目的真正接口,通过字符串拼接方式实现
url: url,
url: host + url,
header: { header: {
"content-type": "application/json;charset=UTF-8", "content-type": "application/json;charset=UTF-8",
"token": token "token": token
@@ -39,7 +41,7 @@ const getResquest = (url, token, message, getData, doSuccess, doFail) => {
}) })
} }
wx.request({ wx.request({
url: url,
url: host + url,
header: { header: {
"content-type": "application/json;charset=UTF-8", "content-type": "application/json;charset=UTF-8",
"token": token "token": token
@@ -63,6 +65,6 @@ const getResquest = (url, token, message, getData, doSuccess, doFail) => {
}) })
} }
module.exports = { module.exports = {
postResquest: postResquest,
getResquest: getResquest
}
postResquest: postResquest,
getResquest: getResquest
}

Loading…
Cancel
Save