From dbf63edb81957485b592dfc2387d724950a2b87e Mon Sep 17 00:00:00 2001
From: meo <958484406@qq.com>
Date: Tue, 28 Aug 2018 12:25:06 +0800
Subject: [PATCH] =?UTF-8?q?[=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85,=E8=AE=A2?=
=?UTF-8?q?=E5=8D=95=E7=8A=B6=E6=80=81=E7=9A=84=E5=88=A4=E6=96=AD][?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0]:=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=B8=B2=E6=9F=93=EF=BC=8C=E4=BB=A5?=
=?UTF-8?q?=E5=8F=8A=E9=92=88=E5=AF=B9=E4=B8=8D=E5=90=8C=E7=9A=84=E8=AE=A2?=
=?UTF-8?q?=E5=8D=95=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=90=8C?=
=?UTF-8?q?=E7=9A=84=E6=A0=87=E8=AF=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/config.js | 7 ++-
pages/couponorder/detail/index.js | 4 +-
pages/order/detail/index.js | 75 +++++++++++++++++++------------
pages/order/detail/index.wxml | 35 +++++++--------
pages/order/detail/index.wxss | 10 ++++-
pages/order/index/index.js | 20 +++++----
pages/order/index/index.wxml | 10 +++--
pages/order/index/index.wxss | 2 +-
8 files changed, 97 insertions(+), 66 deletions(-)
diff --git a/config/config.js b/config/config.js
index 914c92f..e788e02 100755
--- a/config/config.js
+++ b/config/config.js
@@ -55,6 +55,11 @@ var config = {
* 订单列表
*/
orderList: "/order/list",
+
+ /**
+ * 订单详情
+ */
+ orderDetail: "/order/detail",
/**
* 券包
*/
@@ -131,4 +136,4 @@ for (var key in config.api) {
config.api[key] = apiPrefix + config.api[key];
}
*/
-module.exports = config;
\ No newline at end of file
+module.exports = config;
diff --git a/pages/couponorder/detail/index.js b/pages/couponorder/detail/index.js
index 94be8c2..cf9bd9c 100644
--- a/pages/couponorder/detail/index.js
+++ b/pages/couponorder/detail/index.js
@@ -46,9 +46,9 @@ Page({
phone: function() {
let that = this;
console.log(that.data);
- if (that.data.merchantLinkPhone) {
+ if (that.data.data.merchantLinkPhone) {
wx.makePhoneCall({
- phoneNumber: that.data.merchantLinkPhone //仅为示例,并非真实的电话号码
+ phoneNumber: that.data.data.merchantLinkPhone //仅为示例,并非真实的电话号码
});
}
}
diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js
index daae2ca..45e920a 100644
--- a/pages/order/detail/index.js
+++ b/pages/order/detail/index.js
@@ -1,65 +1,82 @@
-Page({
+let config = require("../../../config/config.js");
+let Http = require("../../../utils/HttpBasics");
+let app = getApp();
+Page({
/**
* 页面的初始数据
*/
- data: {
-
- },
+ data: {},
/**
* 生命周期函数--监听页面加载
*/
- onLoad: function (options) {
-
+ onLoad: function(options) {
+ let that = this;
+ console.log(options.orderId);
+ Http.get({
+ url: config.api.orderDetail,
+ data: {
+ orderId: options.orderId
+ }
+ }).then(res => {
+ console.log(res);
+ console.log("我是订单详情");
+ that.setData({
+ data: res.data
+ });
+ });
+ },
+ couponorderdetail: function(e) {
+ console.log(e);
+ wx.navigateTo({
+ url: `/pages/couponorder/detail/index?quancode=${
+ e.currentTarget.dataset.quancode
+ }`,
+ success: function(res) {
+ // success
+ console.log("点击跳转到券详情页面");
+ },
+ fail: function() {
+ // fail
+ },
+ complete: function() {
+ // complete
+ }
+ });
},
-
/**
* 生命周期函数--监听页面初次渲染完成
*/
- onReady: function () {
-
- },
+ onReady: function() {},
/**
* 生命周期函数--监听页面显示
*/
- onShow: function () {
-
- },
+ onShow: function(options) {},
/**
* 生命周期函数--监听页面隐藏
*/
- onHide: function () {
-
- },
+ onHide: function() {},
/**
* 生命周期函数--监听页面卸载
*/
- onUnload: function () {
-
- },
+ onUnload: function() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
- onPullDownRefresh: function () {
-
- },
+ onPullDownRefresh: function() {},
/**
* 页面上拉触底事件的处理函数
*/
- onReachBottom: function () {
-
- },
+ onReachBottom: function() {},
/**
* 用户点击右上角分享
*/
- onShareAppMessage: function () {
-
- }
-})
\ No newline at end of file
+ onShareAppMessage: function() {}
+});
diff --git a/pages/order/detail/index.wxml b/pages/order/detail/index.wxml
index bf9429c..0b9b51d 100644
--- a/pages/order/detail/index.wxml
+++ b/pages/order/detail/index.wxml
@@ -1,30 +1,28 @@
- 付款成功,请尽快到门店使用
+ 付款成功,请尽快到门店使用
-
+
- 黑椒牛排
+ {{data.subTitle}}
- 购买数量:1件
+ {{data.title}}
+
+
- 下单时间:2018-07-10 11:30
-
-
-
-
-
- ¥1.00
- ¥59.00
+ 下单时间:{{data.paymentTime}}
+
@@ -35,27 +33,26 @@
适用门店
-
+
兑换码:
- 1234567890
+ {{data.id}}
-
-
+
下单时间
- 2018-07-10 11:30
+ {{data.paymentTime}}
订单编号
- 1234567890
+ {{data.orderNumber}}
订单金额
- ¥1.00
+ ¥{{data.salePrice/100}}
\ No newline at end of file
diff --git a/pages/order/detail/index.wxss b/pages/order/detail/index.wxss
index 20218f1..f4e205b 100644
--- a/pages/order/detail/index.wxss
+++ b/pages/order/detail/index.wxss
@@ -35,7 +35,7 @@
display: flex;
margin: 0 4%;
margin-top: 2%;
- border-bottom: 1px solid #ededed;
+ /* border-bottom: 1px solid #ededed; */
}
.logo {
@@ -60,7 +60,7 @@
}
.info view:nth-child(1) {
- margin-bottom: 72rpx;
+ margin-bottom: 30rpx;
}
.info view:nth-child(1) text {
@@ -119,6 +119,7 @@
justify-content: space-between;
padding-left: 4%;
padding-right: 4%;
+ border-bottom:1rpx solid #eee;
}
.classif>view text{
font-size: 30rpx;
@@ -142,4 +143,9 @@
.classif>view:nth-child(6) text:nth-child(2){
color: #FF3434;
font-weight: bold;
+}
+.spcode{
+ width: 60rpx;
+ display: inline-block;
+ margin-top: 15rpx;
}
\ No newline at end of file
diff --git a/pages/order/index/index.js b/pages/order/index/index.js
index 4889e61..2fd7ce6 100644
--- a/pages/order/index/index.js
+++ b/pages/order/index/index.js
@@ -6,15 +6,15 @@ Page({
data: {
tabs: [
{
- key: 0,
+ key: "all",
name: "全部"
},
{
- key: 1,
+ key: 0,
name: "待付款"
},
{
- key: 2,
+ key: 1,
name: "已完成"
}
],
@@ -30,10 +30,10 @@ Page({
current_scroll: e.id
});
},
- gotopay:function(){
- console.log("000000");
+ gotopay:function(e){
+ console.log("orderId"+e.currentTarget.dataset.id);
wx.navigateTo({
- url: '/pages/order/detail/index',
+ url: `/pages/order/detail/index?orderId=${e.currentTarget.dataset.id}`,
success: function(res){
// success
},
@@ -54,16 +54,18 @@ Page({
* key==0
* 不发送该字段
*/
- if (key == 0) {
+ if (key == 'all') {
var variable = {
pageNum: pageNum,
- pageSize: 5
+ pageSize: 5,
+ paymentType:0
};
} else {
var variable = {
pageNum: pageNum,
pageSize: 5,
- orderStatus: key
+ orderStatus: key,
+ paymentType:0
};
}
diff --git a/pages/order/index/index.wxml b/pages/order/index/index.wxml
index 23d0c16..5106a92 100644
--- a/pages/order/index/index.wxml
+++ b/pages/order/index/index.wxml
@@ -11,7 +11,9 @@
{{item.title}}
- 等待付款
+ 等待付款
+ 已付款
+ 取消
{{item.subTitle}}
@@ -24,8 +26,10 @@
¥{{item.salePrice/100}}
¥{{item.price/100}}
-
- 支付
+
+ 查看详情
+ 支付
+ 支付
diff --git a/pages/order/index/index.wxss b/pages/order/index/index.wxss
index 13ff835..e7c0039 100644
--- a/pages/order/index/index.wxss
+++ b/pages/order/index/index.wxss
@@ -25,7 +25,7 @@
display: flex;
margin: 0 4%;
margin-top: 2%;
- border-bottom: 1px solid #ededed;
+ border-bottom: 1rpx solid #ededed;
}
.logo {