diff --git a/api/interfaces/exchange.js b/api/interfaces/exchange.js
index e390db9..0750ab3 100644
--- a/api/interfaces/exchange.js
+++ b/api/interfaces/exchange.js
@@ -1,21 +1,41 @@
import {req} from "../request"
-//兑换订单列表
-const index = (type) => req({url: "orders/index", data: {type: type}})
+//权益商品订单列表
+const orders = (type) => req({url: "orders/index", data: {type: type}})
-//兑换订单详情
+//权益订单列表
+const ordersCoupons = (type) => req({url: "orders/coupons", data: {type: type}})
+
+//福利商品订单列表
+const welfare = (type) => req({url: "welfares/orders", data: {type: type}})
+
+//福利券订单列表
+const welfareCoupons = (type) => req({url: "welfares/coupons", data: {type: type}})
+
+//权益订单详情
const show = (orderid) => req({url: "orders/show?", data: {orderid: orderid}})
+//周五福利订单详情
+const welfaresShow = (orderid) => req({url: "welfares/orders/show?", data: {orderid: orderid}})
+
//取消兑换订单
const cancel = (orderid) => req({url: "orders/cancel?orderid=" + orderid , method: "POST"})
+//福利取消订单
+const welfaresCancel = (orderid) => req({url: "welfares/orders/cancel?orderid=" + orderid , method: "POST"})
+
//兑换订单支付
const payments = (orderid) => req({url: "payments/order?orderid=" + orderid})
export default({
- index,
+ orders,
+ ordersCoupons,
+ welfare,
+ welfareCoupons,
show,
+ welfaresShow,
cancel,
+ welfaresCancel,
payments
})
diff --git a/api/interfaces/index.js b/api/interfaces/index.js
index adcc8f2..ac3bdd2 100644
--- a/api/interfaces/index.js
+++ b/api/interfaces/index.js
@@ -65,7 +65,7 @@ const newCity = () => req({url: "ajax/all_right_citys"})
const newidxCity = (code) => req({url: "ajax/all_right_children", data: {code: code}})
//周五福利-获取支付信息
-const fridayInfo = (orderId) => req({url: "welfare/order/" + orderId})
+const fridayInfo = (werlfare_id, address_id, is_deliver) => req({url: "welfare/order/" + werlfare_id, data: {address_id: address_id || '', is_deliver: is_deliver}})
//周五福利-支付
const fridayPay = (trade_no) => req({url: "payments/welfare/wechat",method: "POST", data: {trade_no: trade_no}})
diff --git a/pages/login/login.js b/pages/login/login.js
index 3d3cf09..c61935f 100644
--- a/pages/login/login.js
+++ b/pages/login/login.js
@@ -49,7 +49,6 @@ Page({
wx.getUserProfile({
desc : "获取你的昵称、头像、地区及性别",
success : e => {
- console.log(e)
if(e.errMsg == "getUserProfile:ok"){
this.setData({
isLogin : true,
@@ -60,7 +59,6 @@ Page({
// 检查用户登录Code是否过期
wx.checkSession({
success: res=>{
- console.log(res)
this.userLogin()
},
fail: err=>{
diff --git a/pages/order/order.js b/pages/order/order.js
index 69d81f8..a8e8549 100644
--- a/pages/order/order.js
+++ b/pages/order/order.js
@@ -5,9 +5,10 @@ Page({
* 页面的初始数据
*/
data: {
- stateType : 'all', //状态
- counts : '', //数量
- orderArr : [], //列表
+ orderType : '', //订单来源
+ stateType : 'all', //状态
+ counts : '', //数量
+ orderArr : [], //列表
page : {}, //下一页
lodingStats : false, //加载状态
pay : {
@@ -22,6 +23,7 @@ Page({
*/
onLoad (options) {
this.setData({
+ orderType: options.orderType,
stateType: options.stateType
})
},
@@ -35,7 +37,12 @@ Page({
* 商品活动订单
*/
orderInfo(page) {
- wx.$api.exchange.index(this.data.stateType, page).then(res=>{
+ let url = ''
+ if(this.data.orderType == 'welfare') url = wx.$api.exchange.welfare
+ if(this.data.orderType == 'welfareGoods') url = wx.$api.exchange.welfareCoupons
+ if(this.data.orderType == 'rights') url = wx.$api.exchange.orders
+ if(this.data.orderType == 'rightsCoupons') url = wx.$api.exchange.ordersCoupons
+ url(this.data.stateType, page).then(res=>{
let listArr = this.data.orderArr,
newData = []
if(page == 1 || page == undefined) listArr = []
@@ -79,7 +86,11 @@ Page({
content : '确认取消吗?',
success : res=> {
if (res.confirm) {
- wx.$api.exchange.cancel(orderId).then(res=>{
+ let url = ''
+ if(this.data.orderType == 'welfare' || this.data.orderType == 'welfareGoods') url = wx.$api.exchange.welfaresCancel
+ if(this.data.orderType == 'rights' || this.data.orderType == 'rightsCoupons') url = wx.$api.exchange.cancel
+
+ url(orderId).then(res=>{
// 获取商品活动订单
this.orderInfo()
diff --git a/pages/order/order.wxml b/pages/order/order.wxml
index b282543..fa569c6 100644
--- a/pages/order/order.wxml
+++ b/pages/order/order.wxml
@@ -8,17 +8,21 @@
- 待发货
+ {{orderType == 'welfare' || orderType == 'rights' ? '待发货' : '已支付'}}
-
+
已发货
+
+ 已完成
+
+
@@ -29,29 +33,38 @@
-->
{{item.orderid}}
- {{item.state_text}}
- {{item.state_text}}
- {{item.state_text}}
+
+ {{item.state_text ||item.status_text}}
+
+
+ {{item.state_text || item.status_text}}
+
+ {{item.state_text || item.status_text}}
-
+
- {{item.items.title}}
-
+ {{item.items.title || item.source.right.title}}
+
+ {{item.type_text}}
+
+
红包电子券
实物券
- ¥{{item.items.price}} × {{item.items.qty}}
+ ¥{{item.items.price || item.source.welfare.price}} × {{item.items.qty ? item.items.qty : '1'}}
- 订单详情
-
- 取消订单
- 立即支付
+ 订单详情
+
+ 取消订单
+
+
+ 立即支付
+
@@ -82,13 +95,13 @@
-
+
\ No newline at end of file
diff --git a/pages/orderData/orderData.js b/pages/orderData/orderData.js
index 03debea..9521d11 100644
--- a/pages/orderData/orderData.js
+++ b/pages/orderData/orderData.js
@@ -13,7 +13,9 @@ Page({
*/
data: {
statusHeight : app.globalData.statusBarHeight,
- order : '' //订单详情
+ orderId : '', //订单id
+ order : '', //订单详情
+ orderType : '' //订单来源
},
/**
@@ -21,14 +23,21 @@ Page({
*/
onLoad (options) {
// 获取商品活动订单详情
- this.orderInfo(options.id);
+ this.setData({
+ orderType : options.orderType,
+ orderId : options.id
+ })
+ this.orderInfo();
},
/**
* 商品活动订单详情
*/
- orderInfo(id) {
- wx.$api.exchange.show(id).then(res=>{
+ orderInfo() {
+ let url = ''
+ if(this.data.orderType == 'welfare' || this.data.orderType == 'welfareGoods') url = wx.$api.exchange.welfaresShow
+ if(this.data.orderType == 'rights' || this.data.orderType == 'rightsCoupons') url = wx.$api.exchange.show
+ url(this.data.orderId).then(res=>{
this.setData({
order : res.data
})
@@ -45,10 +54,28 @@ Page({
content : '确认取消吗?',
success : res=> {
if (res.confirm) {
- wx.$api.exchange.cancel(orderId).then(res=>{
- wx.reLaunch({
- url: '/pages/order/order'
- })
+ let url = ''
+ if(this.data.orderType == 'welfare' || this.data.orderType == 'welfareGoods') url = wx.$api.exchange.welfaresCancel
+ if(this.data.orderType == 'rights' || this.data.orderType == 'rightsCoupons') url = wx.$api.exchange.cancel
+
+ url(orderId).then(res=>{
+ if(this.data.orderType == 'rightsCoupons') {
+ wx.reLaunch({
+ url: '/pages/order/order?orderType=rightsCoupons'
+ })
+ } else if(this.data.orderType == 'rights') {
+ wx.reLaunch({
+ url: '/pages/order/order?orderType=rights'
+ })
+ } else if(this.data.orderType == 'welfare') {
+ wx.reLaunch({
+ url: '/pages/order/order?orderType=welfare'
+ })
+ } else {
+ wx.reLaunch({
+ url: '/pages/order/order?orderType=welfareGoods'
+ })
+ }
wx.showToast({
title: res.data,
diff --git a/pages/orderData/orderData.wxml b/pages/orderData/orderData.wxml
index 5b93712..1d6525b 100644
--- a/pages/orderData/orderData.wxml
+++ b/pages/orderData/orderData.wxml
@@ -1,6 +1,6 @@
- {{order.state_text}}
+ {{order.state_text || order.status_text}}
@@ -25,11 +25,11 @@
-
+
- {{order.items.title}}
- ¥{{order.items.price}}
- ×{{order.items.qty}}
+ {{order.items.title || order.source.right.title}}
+ ¥{{order.items.price || order.source.welfare.price}}
+ ×{{order.items.qty ? order.items.qty : '1'}}
@@ -38,7 +38,7 @@
权益类型
- {{order.type_text}}
+ {{order.type_text || order.type_text}}
订单号
@@ -52,12 +52,12 @@
实际支付
- ¥{{order.amount}}
+ ¥{{order.amount || order.source.welfare.price}}
\ No newline at end of file
diff --git a/pages/rights/rights.js b/pages/rights/rights.js
index 9eebacd..04bbbb2 100644
--- a/pages/rights/rights.js
+++ b/pages/rights/rights.js
@@ -20,7 +20,7 @@ Page({
addressShow : false, //收货地址显示
getType : '', //是否显示自提
platIndex : 0, //选择提交方式下标
- isdeliver : '',
+ isdeliver : -1,
platformCp : [], //选择提交数组
pointMoreShow: false,
from : '',
@@ -32,8 +32,8 @@ Page({
disabled : false,
payWayIndex : 0,
payWay :[
- {value: 0, name: "微信支付"},
- {value: 1, name: "沃钱包支付"}
+ {value: 0, name: "微信支付"}
+ // {value: 1, name: "沃钱包支付"}
]
},
@@ -70,6 +70,15 @@ Page({
return { ...obj[val], ...{key: val} }
})
+ if(this.data.isdeliver == -1){
+ if(res.data.detail.type == 'physical') {
+ this.setData({
+ isdeliver : res.data.detail.def_get
+ })
+ }
+ if(res.data.detail.type == 'virtual') this.setData({isdeliver : 1})
+ }
+
this.setData({
address : res.data.address,
allAddress : res.data.all_address,
@@ -264,7 +273,7 @@ Page({
isdeliver: this.data.detail.def_get
})
}
- let right_id = this.data.detail.right_id,
+ let right_id = this.data.detail.right_id,
address_id = this.data.address.id,
is_deliver = this.data.isdeliver,
qty = this.data.num
@@ -277,9 +286,15 @@ Page({
duration: 2000
})
setTimeout(()=>{
- wx.reLaunch({
- url: '/pages/order/order'
- })
+ if(this.data.isdeliver == 1) {
+ wx.reLaunch({
+ url: '/pages/order/order?orderType=rightsCoupons'
+ })
+ } else {
+ wx.reLaunch({
+ url: '/pages/order/order?orderType=rights'
+ })
+ }
},3000)
this.setData({
rightsTap: true
@@ -302,16 +317,34 @@ Page({
icon : 'success'
})
setTimeout(()=>{
- wx.reLaunch({
- url: '/pages/coupon/coupon?type=couponPublic'
- })
+ if(this.data.isdeliver == 1) {
+ wx.reLaunch({
+ url: '/pages/order/order?orderType=rightsCoupons'
+ })
+ } else {
+ wx.reLaunch({
+ url: '/pages/order/order?orderType=rights'
+ })
+ }
+ // wx.reLaunch({
+ // url: '/pages/coupon/coupon?type=couponPublic'
+ // })
},3000)
}
},
fail : res=>{
- wx.reLaunch({
- url: '/pages/order/order?stateType=unpay'
- })
+ if(this.data.isdeliver == 1) {
+ wx.reLaunch({
+ url: '/pages/order/order?orderType=rightsCoupons&stateType=unpay'
+ })
+ } else {
+ wx.reLaunch({
+ url: '/pages/order/order?orderType=rights&stateType=unpay'
+ })
+ }
+ // wx.reLaunch({
+ // url: '/pages/order/order?stateType=unpay'
+ // })
}
})
})
@@ -343,7 +376,7 @@ Page({
},
/**
- * 新增收货地址
+ * 重要提示显示
*/
pointMoreTap() {
this.setData({
diff --git a/pages/rights/rights.wxml b/pages/rights/rights.wxml
index 757ff2d..c50d329 100644
--- a/pages/rights/rights.wxml
+++ b/pages/rights/rights.wxml
@@ -42,10 +42,10 @@
{{detail.four_title}}
-
-
-
-
+
+
+
+
{{detail.three_title}}
diff --git a/pages/user/user.wxml b/pages/user/user.wxml
index 050ca0d..89d70a2 100644
--- a/pages/user/user.wxml
+++ b/pages/user/user.wxml
@@ -137,29 +137,29 @@
活动订单
-->
-
+
- 所有订单
+ 福利券订单
-
+
- 待支付
+ 福利商品订单
-
+
- 待发货
+ 权益订单
-
+
- 已发货
+ 权益商品订单
@@ -85,4 +113,26 @@
+
+
+
+
+
+
+ 请选择收货地址
+ 新增收货地址
+
+
\ No newline at end of file