| @@ -55,6 +55,11 @@ var config = { | |||||
| * 订单列表 | * 订单列表 | ||||
| */ | */ | ||||
| orderList: "/order/list", | orderList: "/order/list", | ||||
| /** | |||||
| * 订单详情 | |||||
| */ | |||||
| orderDetail: "/order/detail", | |||||
| /** | /** | ||||
| * 券包 | * 券包 | ||||
| */ | */ | ||||
| @@ -131,4 +136,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; | |||||
| @@ -46,9 +46,9 @@ Page({ | |||||
| phone: function() { | phone: function() { | ||||
| let that = this; | let that = this; | ||||
| console.log(that.data); | console.log(that.data); | ||||
| if (that.data.merchantLinkPhone) { | |||||
| if (that.data.data.merchantLinkPhone) { | |||||
| wx.makePhoneCall({ | wx.makePhoneCall({ | ||||
| phoneNumber: that.data.merchantLinkPhone //仅为示例,并非真实的电话号码 | |||||
| phoneNumber: that.data.data.merchantLinkPhone //仅为示例,并非真实的电话号码 | |||||
| }); | }); | ||||
| } | } | ||||
| } | } | ||||
| @@ -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 () { | |||||
| } | |||||
| }) | |||||
| onShareAppMessage: function() {} | |||||
| }); | |||||
| @@ -1,30 +1,28 @@ | |||||
| <view class='order'> | <view class='order'> | ||||
| <view class='tips'> | <view class='tips'> | ||||
| <text class='iconfont icon-choose'></text> | <text class='iconfont icon-choose'></text> | ||||
| <text>付款成功,请尽快到门店使用</text> | |||||
| <text wx:if="{{data.orderStatus==1}}">付款成功,请尽快到门店使用</text> | |||||
| </view> | </view> | ||||
| <view class='section'> | <view class='section'> | ||||
| <view class='detail_msg'> | <view class='detail_msg'> | ||||
| <view class='logo'> | <view class='logo'> | ||||
| <image src='http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg'></image> | |||||
| <image src='{{data.coverImg}}'></image> | |||||
| </view> | </view> | ||||
| <view class='info'> | <view class='info'> | ||||
| <view> | <view> | ||||
| <text>黑椒牛排</text> | |||||
| <text>{{data.subTitle}}</text> | |||||
| </view> | </view> | ||||
| <view> | <view> | ||||
| <text>购买数量:</text>1件</view> | |||||
| <text>{{data.title}}</text> | |||||
| </view> | |||||
| <!-- <view> | |||||
| <text>购买数量:</text>1件 | |||||
| </view> --> | |||||
| <view> | <view> | ||||
| <text>下单时间:</text>2018-07-10 11:30</view> | |||||
| </view> | |||||
| </view> | |||||
| <view class='payment'> | |||||
| <view></view> | |||||
| <view> | |||||
| <text>¥1.00</text> | |||||
| <text>¥59.00</text> | |||||
| <text>下单时间:</text>{{data.paymentTime}}</view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class='classif'> | <view class='classif'> | ||||
| <view> | <view> | ||||
| @@ -35,27 +33,26 @@ | |||||
| <text>适用门店</text> | <text>适用门店</text> | ||||
| <text class='iconfont icon-right'></text> | <text class='iconfont icon-right'></text> | ||||
| </view> | </view> | ||||
| <view> | |||||
| <view wx:if="{{data.orderStatus==1}}" data-quancode="{{data.id}}" bindtap="couponorderdetail"> | |||||
| <view> | <view> | ||||
| <text>兑换码:</text> | <text>兑换码:</text> | ||||
| <text>1234567890</text> | |||||
| <text>{{data.id}}</text> | |||||
| </view> | </view> | ||||
| <view> | <view> | ||||
| <icon class='iconfont icon-dingweib'></icon> | |||||
| <icon class='iconfont icon-right'></icon> | |||||
| <image class="spcode" src="./../../../assets/img/spcode.png" mode="widthFix"></image> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view> | <view> | ||||
| <text>下单时间</text> | <text>下单时间</text> | ||||
| <text>2018-07-10 11:30</text> | |||||
| <text>{{data.paymentTime}}</text> | |||||
| </view> | </view> | ||||
| <view> | <view> | ||||
| <text>订单编号</text> | <text>订单编号</text> | ||||
| <text>1234567890</text> | |||||
| <text>{{data.orderNumber}}</text> | |||||
| </view> | </view> | ||||
| <view> | <view> | ||||
| <text>订单金额</text> | <text>订单金额</text> | ||||
| <text>¥1.00</text> | |||||
| <text>¥{{data.salePrice/100}}</text> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| @@ -35,7 +35,7 @@ | |||||
| display: flex; | display: flex; | ||||
| margin: 0 4%; | margin: 0 4%; | ||||
| margin-top: 2%; | margin-top: 2%; | ||||
| border-bottom: 1px solid #ededed; | |||||
| /* border-bottom: 1px solid #ededed; */ | |||||
| } | } | ||||
| .logo { | .logo { | ||||
| @@ -60,7 +60,7 @@ | |||||
| } | } | ||||
| .info view:nth-child(1) { | .info view:nth-child(1) { | ||||
| margin-bottom: 72rpx; | |||||
| margin-bottom: 30rpx; | |||||
| } | } | ||||
| .info view:nth-child(1) text { | .info view:nth-child(1) text { | ||||
| @@ -119,6 +119,7 @@ | |||||
| justify-content: space-between; | justify-content: space-between; | ||||
| padding-left: 4%; | padding-left: 4%; | ||||
| padding-right: 4%; | padding-right: 4%; | ||||
| border-bottom:1rpx solid #eee; | |||||
| } | } | ||||
| .classif>view text{ | .classif>view text{ | ||||
| font-size: 30rpx; | font-size: 30rpx; | ||||
| @@ -142,4 +143,9 @@ | |||||
| .classif>view:nth-child(6) text:nth-child(2){ | .classif>view:nth-child(6) text:nth-child(2){ | ||||
| color: #FF3434; | color: #FF3434; | ||||
| font-weight: bold; | font-weight: bold; | ||||
| } | |||||
| .spcode{ | |||||
| width: 60rpx; | |||||
| display: inline-block; | |||||
| margin-top: 15rpx; | |||||
| } | } | ||||
| @@ -6,15 +6,15 @@ Page({ | |||||
| data: { | data: { | ||||
| tabs: [ | tabs: [ | ||||
| { | { | ||||
| key: 0, | |||||
| key: "all", | |||||
| name: "全部" | name: "全部" | ||||
| }, | }, | ||||
| { | { | ||||
| key: 1, | |||||
| key: 0, | |||||
| name: "待付款" | name: "待付款" | ||||
| }, | }, | ||||
| { | { | ||||
| key: 2, | |||||
| key: 1, | |||||
| name: "已完成" | name: "已完成" | ||||
| } | } | ||||
| ], | ], | ||||
| @@ -30,10 +30,10 @@ Page({ | |||||
| current_scroll: e.id | current_scroll: e.id | ||||
| }); | }); | ||||
| }, | }, | ||||
| gotopay:function(){ | |||||
| console.log("000000"); | |||||
| gotopay:function(e){ | |||||
| console.log("orderId"+e.currentTarget.dataset.id); | |||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: '/pages/order/detail/index', | |||||
| url: `/pages/order/detail/index?orderId=${e.currentTarget.dataset.id}`, | |||||
| success: function(res){ | success: function(res){ | ||||
| // success | // success | ||||
| }, | }, | ||||
| @@ -54,16 +54,18 @@ Page({ | |||||
| * key==0 | * key==0 | ||||
| * 不发送该字段 | * 不发送该字段 | ||||
| */ | */ | ||||
| if (key == 0) { | |||||
| if (key == 'all') { | |||||
| var variable = { | var variable = { | ||||
| pageNum: pageNum, | pageNum: pageNum, | ||||
| pageSize: 5 | |||||
| pageSize: 5, | |||||
| paymentType:0 | |||||
| }; | }; | ||||
| } else { | } else { | ||||
| var variable = { | var variable = { | ||||
| pageNum: pageNum, | pageNum: pageNum, | ||||
| pageSize: 5, | pageSize: 5, | ||||
| orderStatus: key | |||||
| orderStatus: key, | |||||
| paymentType:0 | |||||
| }; | }; | ||||
| } | } | ||||
| @@ -11,7 +11,9 @@ | |||||
| <view class='info'> | <view class='info'> | ||||
| <view> | <view> | ||||
| <text>{{item.title}}</text> | <text>{{item.title}}</text> | ||||
| <text wx:if="{{item.orderStatus==1}}">等待付款</text> | |||||
| <text wx:if="{{item.orderStatus==0}}">等待付款</text> | |||||
| <text wx:if="{{item.orderStatus==1}}">已付款</text> | |||||
| <text wx:if="{{item.orderStatus==2}}">取消</text> | |||||
| </view> | </view> | ||||
| <view>{{item.subTitle}}</view> | <view>{{item.subTitle}}</view> | ||||
| <view> | <view> | ||||
| @@ -24,8 +26,10 @@ | |||||
| <text>¥{{item.salePrice/100}}</text> | <text>¥{{item.salePrice/100}}</text> | ||||
| <text>¥{{item.price/100}}</text> | <text>¥{{item.price/100}}</text> | ||||
| </view> | </view> | ||||
| <view class="btn" bindtap="gotopay"> | |||||
| <text>支付</text> | |||||
| <view class="btn" data-id="{{item.id}}" bindtap="gotopay"> | |||||
| <text wx:if="{{item.orderStatus==1}}">查看详情</text> | |||||
| <text wx:if="{{item.orderStatus==0}}">支付</text> | |||||
| <text wx:if="{{item.orderStatus==2}}">支付</text> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| @@ -25,7 +25,7 @@ | |||||
| display: flex; | display: flex; | ||||
| margin: 0 4%; | margin: 0 4%; | ||||
| margin-top: 2%; | margin-top: 2%; | ||||
| border-bottom: 1px solid #ededed; | |||||
| border-bottom: 1rpx solid #ededed; | |||||
| } | } | ||||
| .logo { | .logo { | ||||