| @@ -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; | |||||
| @@ -29,7 +29,7 @@ Page({ | |||||
| Http.get({ | Http.get({ | ||||
| url: config.api.couponDetail, | url: config.api.couponDetail, | ||||
| data: { | data: { | ||||
| id: options.couponChannelId, | |||||
| couponChannelId: options.couponChannelId, | |||||
| } | } | ||||
| }).then(res => { | }).then(res => { | ||||
| console.log(res); | console.log(res); | ||||
| @@ -82,15 +82,18 @@ Page({ | |||||
| }) | }) | ||||
| .then(res => { | .then(res => { | ||||
| console.log("payOrderUpdate then", res); | console.log("payOrderUpdate then", res); | ||||
| wx.showToast({ | |||||
| title: "购买成功", | |||||
| duration: 2500 | |||||
| }); | |||||
| // wx.showToast({ | |||||
| // title: "购买成功", | |||||
| // duration: 2500 | |||||
| // }); | |||||
| }) | }) | ||||
| .catch(err => { | .catch(err => { | ||||
| console.log("payOrderUpdate catch", err); | console.log("payOrderUpdate catch", err); | ||||
| }); | }); | ||||
| }, | }, | ||||
| /** | |||||
| * 发起支付 | |||||
| */ | |||||
| orderFunc() { | orderFunc() { | ||||
| var that = this; | var that = this; | ||||
| wx.showLoading({ | wx.showLoading({ | ||||
| @@ -105,6 +108,10 @@ Page({ | |||||
| data: {} | data: {} | ||||
| }) | }) | ||||
| .then(res => { | .then(res => { | ||||
| console.log(res); | |||||
| /** | |||||
| * orderSave 下单 | |||||
| */ | |||||
| return Http.post({ | return Http.post({ | ||||
| url: config.api.orderSave, | url: config.api.orderSave, | ||||
| data: { | data: { | ||||
| @@ -136,6 +143,9 @@ Page({ | |||||
| }); | }); | ||||
| if (res.data.payment > 0) { | if (res.data.payment > 0) { | ||||
| // 支付金额不为0 | // 支付金额不为0 | ||||
| /** | |||||
| * 支付订单创建 | |||||
| */ | |||||
| Http.post({ | Http.post({ | ||||
| url: config.api.payOrderCreate, | url: config.api.payOrderCreate, | ||||
| data: { | data: { | ||||
| @@ -154,49 +164,60 @@ Page({ | |||||
| signType: "MD5", | signType: "MD5", | ||||
| paySign: res.data.paySign, | paySign: res.data.paySign, | ||||
| success: res => { | success: res => { | ||||
| console.log(res); | |||||
| console.log("姐在检查付款异常"); | |||||
| that.payOrderUpdate(that.data.orderId, payOrderId, 1); // 支付成功 | that.payOrderUpdate(that.data.orderId, payOrderId, 1); // 支付成功 | ||||
| console.log(res); | console.log(res); | ||||
| console.log("支付成功"); | |||||
| wx.showToast({ | |||||
| title: "购买成功", | |||||
| duration: 2500 | |||||
| }); | |||||
| if(res.errMsg=='requestPayment:ok'){ | |||||
| wx.showToast({ | |||||
| title: "购买成功", | |||||
| duration: 2500 | |||||
| }); | |||||
| } | |||||
| wx.navigateBack({ | wx.navigateBack({ | ||||
| delta: 2 | delta: 2 | ||||
| }); | }); | ||||
| }, | }, | ||||
| fail: res => { | fail: res => { | ||||
| that.payOrderUpdate(that.data.orderId, payOrderId, 2); // 支付失败 | that.payOrderUpdate(that.data.orderId, payOrderId, 2); // 支付失败 | ||||
| console.log(res); | console.log(res); | ||||
| console.log("支付失败"); | |||||
| return; | return; | ||||
| }, | }, | ||||
| complete: res => { | complete: res => { | ||||
| console.log(res); | console.log(res); | ||||
| console.log("支付完成"); | console.log("支付完成"); | ||||
| var url = res.data.url; | |||||
| console.log("get url", url); | |||||
| // var url = res.data.url; | |||||
| // console.log("get url", url); | |||||
| if (res.errMsg == "requestPayment:ok") { | if (res.errMsg == "requestPayment:ok") { | ||||
| wx.showModal({ | wx.showModal({ | ||||
| title: "提示", | title: "提示", | ||||
| content: "支付成功" | content: "支付成功" | ||||
| }); | }); | ||||
| if (url) { | |||||
| setTimeout(function () { | |||||
| wx.redirectTo({ | |||||
| url: "/pages" + url | |||||
| }); | |||||
| }, 2000); | |||||
| } else { | |||||
| setTimeout(() => { | |||||
| wx.navigateBack(); | |||||
| }, 2000); | |||||
| } | |||||
| } else { | |||||
| wx.showModal({ | |||||
| title: "错误提示", | |||||
| content: res.errMsg | |||||
| }); | |||||
| // if (url) { | |||||
| // setTimeout(function () { | |||||
| // wx.redirectTo({ | |||||
| // url: "/pages" + url | |||||
| // }); | |||||
| // }, 2000); | |||||
| // } else { | |||||
| // setTimeout(() => { | |||||
| // wx.navigateBack(); | |||||
| // }, 2000); | |||||
| // } | |||||
| } | |||||
| else { | |||||
| wx.showToast({ | |||||
| title:'支付失败', | |||||
| image:'./../../../assets/img/fail.png', | |||||
| duration: 1500, | |||||
| mask:false | |||||
| }) | |||||
| } | } | ||||
| return; | return; | ||||
| } | } | ||||
| @@ -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 //仅为示例,并非真实的电话号码 | |||||
| }); | }); | ||||
| } | } | ||||
| } | } | ||||
| @@ -22,7 +22,7 @@ Page({ | |||||
| name: "已退款" | name: "已退款" | ||||
| } | } | ||||
| ], | ], | ||||
| list: [{wm:'000'}], | |||||
| list: [], | |||||
| current: "0", | current: "0", | ||||
| current_scroll: "0", | current_scroll: "0", | ||||
| page: 1, | page: 1, | ||||
| @@ -11,6 +11,7 @@ | |||||
| <button>去领券</button> | <button>去领券</button> | ||||
| </navigator> | </navigator> | ||||
| </view> | </view> | ||||
| <view class='section' wx:for='{{list}}' wx:key='{{index}}' bindtap="gotouse" data-quancode="{{item.id}}"> | <view class='section' wx:for='{{list}}' wx:key='{{index}}' bindtap="gotouse" data-quancode="{{item.id}}"> | ||||
| <view class='detail_msg'> | <view class='detail_msg'> | ||||
| <view class='logo'> | <view class='logo'> | ||||
| @@ -1,65 +1,130 @@ | |||||
| let config = require("../../../config/config.js"); | |||||
| let util = require("../../../utils/util"); | |||||
| let Http = require("../../../utils/HttpBasics"); | |||||
| let app = getApp(); | |||||
| Page({ | Page({ | ||||
| /** | /** | ||||
| * 页面的初始数据 | * 页面的初始数据 | ||||
| */ | */ | ||||
| data: { | data: { | ||||
| showModalStatus: false, | |||||
| flag: 0 | |||||
| }, | }, | ||||
| /** | |||||
| * 点击弹出二维码 | |||||
| * 然后再关闭 | |||||
| */ | |||||
| powerDrawer: function(e) { | |||||
| var currentStatu = e.currentTarget.dataset.statu; | |||||
| console.log(e.currentTarget.dataset.statu); | |||||
| console.log(e.currentTarget.dataset.quancode); | |||||
| this.utils(currentStatu, e.currentTarget.dataset.quancode); | |||||
| }, | |||||
| utils: function(currentStatu, quancode) { | |||||
| /* 动画部分 */ | |||||
| // 第1步:创建动画实例 | |||||
| var animation = wx.createAnimation({ | |||||
| duration: 200, //动画时长 | |||||
| timingFunction: "linear", //线性 | |||||
| delay: 0 //0则不延迟 | |||||
| }); // 第2步:这个动画实例赋给当前的动画实例 | |||||
| this.animation = animation; // 第3步:执行第一组动画 | |||||
| animation.opacity(0).step(); // 第4步:导出动画对象赋给数据对象储存 | |||||
| this.setData({ | |||||
| animationData: animation.export() | |||||
| }); // 第5步:设置定时器到指定时候后,执行第二组动画 | |||||
| setTimeout( | |||||
| function() { | |||||
| // 执行第二组动画 | |||||
| animation.opacity(1).step(); // 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象 | |||||
| this.setData({ | |||||
| animationData: animation | |||||
| }); //关闭 | |||||
| if (currentStatu == "close") { | |||||
| this.setData({ | |||||
| showModalStatus: false | |||||
| }); | |||||
| } | |||||
| }.bind(this), | |||||
| 20 | |||||
| ); | |||||
| // 显示 | |||||
| if (currentStatu == "open") { | |||||
| this.setData({ | |||||
| showModalStatus: true | |||||
| }); | |||||
| this.data.flag++; | |||||
| console.log(this.data.flag); | |||||
| util.barcode("barcode" + this.data.flag, quancode, 500, 100); | |||||
| util.qrcode("qrcode" + this.data.flag, quancode, 350, 350); | |||||
| this.setData({ | |||||
| flag: this.data.flag | |||||
| }); | |||||
| } | |||||
| }, | |||||
| /** | /** | ||||
| * 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
| */ | */ | ||||
| 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 | |||||
| }); | |||||
| //createDate 创建时间 | |||||
| var createDate = util.fmtDate(res.data.createDate); | |||||
| console.log(createDate); | |||||
| that.setData({ | |||||
| createDate:createDate, | |||||
| }) | |||||
| }); | |||||
| }, | }, | ||||
| /** | /** | ||||
| * 生命周期函数--监听页面初次渲染完成 | * 生命周期函数--监听页面初次渲染完成 | ||||
| */ | */ | ||||
| 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,61 +1,69 @@ | |||||
| <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>{{createDate}}</view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class='classif'> | <view class='classif'> | ||||
| <view> | |||||
| <text>有效期:</text> | |||||
| <text>2018-07-10 至 2018-07-10</text> | |||||
| </view> | |||||
| <view> | |||||
| <view class="clearfix"> | |||||
| <text>适用门店</text> | <text>适用门店</text> | ||||
| <text class='iconfont icon-right'></text> | |||||
| <text class="fr">{{data.merchantName}}</text> | |||||
| </view> | </view> | ||||
| <view> | |||||
| <view wx:if="{{data.orderStatus==1}}" data-quancode="{{data.id}}" bindtap="powerDrawer" data-statu="open"> | |||||
| <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>{{createDate}}</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 class="jine">¥{{data.salePrice/100}}</text> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <!--mask--> | |||||
| <view class="drawer_screen" data-quancode="{{data.id}}" wx:if="{{showModalStatus}}" bindtap="powerDrawer" data-statu="close"></view> | |||||
| <view animation="{{animationData}}" class="drawer_box" wx:if="{{showModalStatus}}"> | |||||
| <view class="panel"> | |||||
| <view class="barcode"> | |||||
| <canvas canvas-id="barcode{{flag+1}}" /> | |||||
| </view> | |||||
| <view class="qrcode"> | |||||
| <canvas canvas-id="qrcode{{flag+1}}" /> | |||||
| </view> | </view> | ||||
| <view class="barnum"><text>兑换码:</text>{{data.id}}</view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| @@ -1,11 +1,11 @@ | |||||
| @import '../../../app.wxss'; | |||||
| @import "../../../app.wxss"; | |||||
| .order { | .order { | ||||
| width: 100%; | width: 100%; | ||||
| } | } | ||||
| .tips { | .tips { | ||||
| width: 92%; | width: 92%; | ||||
| height: 88rpx; | height: 88rpx; | ||||
| background: #00C0FF; | |||||
| background: #00c0ff; | |||||
| color: #fff; | color: #fff; | ||||
| padding: 0 4%; | padding: 0 4%; | ||||
| line-height: 88rpx; | line-height: 88rpx; | ||||
| @@ -19,7 +19,7 @@ | |||||
| height: 32rpx; | height: 32rpx; | ||||
| background: #fff; | background: #fff; | ||||
| border-radius: 50%; | border-radius: 50%; | ||||
| color: #00C0FF; | |||||
| color: #00c0ff; | |||||
| line-height: 32rpx; | line-height: 32rpx; | ||||
| text-align: center; | text-align: center; | ||||
| display: inline-block; | display: inline-block; | ||||
| @@ -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 { | ||||
| @@ -47,6 +47,7 @@ | |||||
| .logo image { | .logo image { | ||||
| width: 100%; | width: 100%; | ||||
| height: 100%; | height: 100%; | ||||
| border-radius:16rpx; | |||||
| } | } | ||||
| .info view:nth-child(1) { | .info view:nth-child(1) { | ||||
| @@ -60,7 +61,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 { | ||||
| @@ -72,13 +73,15 @@ | |||||
| font-size: 24rpx; | font-size: 24rpx; | ||||
| } | } | ||||
| .info view:nth-child(2), .info view:nth-child(3) { | |||||
| .info view:nth-child(2), | |||||
| .info view:nth-child(3) { | |||||
| color: #ff3434; | color: #ff3434; | ||||
| font-size: 24rpx; | font-size: 24rpx; | ||||
| padding-left: 4%; | padding-left: 4%; | ||||
| } | } | ||||
| .info view:nth-child(2) text, .info view:nth-child(3) text { | |||||
| .info view:nth-child(2) text, | |||||
| .info view:nth-child(3) text { | |||||
| font-size: 22rpx; | font-size: 22rpx; | ||||
| color: #b8b8b8; | color: #b8b8b8; | ||||
| } | } | ||||
| @@ -94,7 +97,7 @@ | |||||
| padding: 0 4%; | padding: 0 4%; | ||||
| display: flex; | display: flex; | ||||
| justify-content: space-between; | justify-content: space-between; | ||||
| border-bottom: 20rpx solid #EDEDED; | |||||
| border-bottom: 20rpx solid #ededed; | |||||
| } | } | ||||
| .payment view:nth-child(2) text:nth-child(1) { | .payment view:nth-child(2) text:nth-child(1) { | ||||
| @@ -112,34 +115,209 @@ | |||||
| .classif { | .classif { | ||||
| width: 100%; | width: 100%; | ||||
| } | } | ||||
| .classif>view{ | |||||
| .classif > view { | |||||
| height: 88rpx; | height: 88rpx; | ||||
| line-height: 88rpx; | line-height: 88rpx; | ||||
| display: flex; | display: flex; | ||||
| 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; | ||||
| } | } | ||||
| .classif>view text:nth-child(2){ | |||||
| color: #B8B8B8; | |||||
| font-size: 30rpx; | |||||
| .classif > view text:nth-child(2) { | |||||
| color: #b8b8b8; | |||||
| font-size: 30rpx; | |||||
| } | } | ||||
| .classif>view:nth-child(1) { | |||||
| .classif > view:nth-child(1) { | |||||
| display: block; | display: block; | ||||
| border-top:20rpx solid #f8f8f8; | |||||
| } | } | ||||
| .classif>view:nth-child(1) text:nth-child(2) { | |||||
| .classif > view:nth-child(1) text:nth-child(2) { | |||||
| padding-left: 15rpx; | padding-left: 15rpx; | ||||
| } | } | ||||
| .classif>view:nth-child(3),.classif>view:nth-child(4) { | |||||
| border-top: 20rpx solid #EDEDED; | |||||
| .classif > view:nth-child(3), | |||||
| .classif > view:nth-child(4) { | |||||
| border-top: 20rpx solid #f8f8f8; | |||||
| } | |||||
| .classif > view:nth-child(3) view text:nth-child(2) { | |||||
| padding-left: 15rpx; | |||||
| } | } | ||||
| .classif>view:nth-child(3) view text:nth-child(2) { | |||||
| padding-left: 15rpx; | |||||
| } | |||||
| .classif>view:nth-child(6) text:nth-child(2){ | |||||
| color: #FF3434; | |||||
| .classif > view:nth-child(6) text:nth-child(2) { | |||||
| color: #ff3434; | |||||
| font-weight: bold; | font-weight: bold; | ||||
| } | |||||
| .spcode { | |||||
| width: 60rpx; | |||||
| display: inline-block; | |||||
| margin-top: 15rpx; | |||||
| } | |||||
| /*mask*/ | |||||
| .drawer_screen { | |||||
| position: absolute; | |||||
| width: 100%; | |||||
| height: 100%; | |||||
| top: 0; | |||||
| left: 0; | |||||
| z-index: 1000; | |||||
| background: #000; | |||||
| opacity: 0.5; | |||||
| overflow: hidden; | |||||
| } | |||||
| .drawer_box { | |||||
| width: 650rpx; | |||||
| position: fixed; | |||||
| overflow: hidden; | |||||
| top: 50%; | |||||
| left: 0; | |||||
| z-index: 1001; | |||||
| margin: -150px 50rpx 0 50rpx; | |||||
| border-radius: 3px; | |||||
| } | |||||
| .drawer_title { | |||||
| padding: 15px; | |||||
| font: 20px "microsoft yahei"; | |||||
| text-align: center; | |||||
| } | |||||
| .drawer_content { | |||||
| height: 210px; | |||||
| overflow-y: scroll; /*超出父盒子高度可滚动*/ | |||||
| } | |||||
| .btn_ok { | |||||
| padding: 10px; | |||||
| font: 20px "microsoft yahei"; | |||||
| text-align: center; | |||||
| border-top: 1px solid #e8e8ea; | |||||
| color: #3cc51f; | |||||
| } | |||||
| .top { | |||||
| padding-top: 8px; | |||||
| } | |||||
| .bottom { | |||||
| padding-bottom: 8px; | |||||
| } | |||||
| .title { | |||||
| height: 30px; | |||||
| line-height: 30px; | |||||
| width: 160rpx; | |||||
| text-align: center; | |||||
| display: inline-block; | |||||
| font: 300 28rpx/30px "microsoft yahei"; | |||||
| } | |||||
| .input_base { | |||||
| border: 2rpx solid #ccc; | |||||
| padding-left: 10rpx; | |||||
| margin-right: 50rpx; | |||||
| } | |||||
| .input_h30 { | |||||
| height: 30px; | |||||
| line-height: 30px; | |||||
| } | |||||
| .input_h60 { | |||||
| height: 60px; | |||||
| } | |||||
| .input_view { | |||||
| font: 12px "microsoft yahei"; | |||||
| background: #fff; | |||||
| color: #000; | |||||
| line-height: 30px; | |||||
| } | |||||
| input { | |||||
| font: 12px "microsoft yahei"; | |||||
| background: #fff; | |||||
| color: #000; | |||||
| } | |||||
| radio { | |||||
| margin-right: 20px; | |||||
| } | |||||
| .grid { | |||||
| display: -webkit-box; | |||||
| display: box; | |||||
| } | |||||
| .col-0 { | |||||
| -webkit-box-flex: 0; | |||||
| box-flex: 0; | |||||
| } | |||||
| .col-1 { | |||||
| -webkit-box-flex: 1; | |||||
| box-flex: 1; | |||||
| } | |||||
| .fl { | |||||
| float: left; | |||||
| } | |||||
| .fr { | |||||
| float: right; | |||||
| } | |||||
| .clearfix:after { | |||||
| content: "."; | |||||
| display: block; | |||||
| height: 0; | |||||
| clear: both; | |||||
| visibility: hidden; | |||||
| } | |||||
| .panel { | |||||
| width: 600rpx; | |||||
| border-radius: 10rpx; | |||||
| background-color: #fff; | |||||
| margin: 30rpx auto 0; | |||||
| padding: 30rpx 0; | |||||
| position: relative; | |||||
| z-index: 10000000000; | |||||
| } | |||||
| .pane2{ | |||||
| background: #fff; | |||||
| opacity: .6; | |||||
| } | |||||
| .pane2 image{ | |||||
| width: 500rpx; | |||||
| display: block; | |||||
| margin: 40rpx auto 0; | |||||
| } | |||||
| .barcode { | |||||
| height: 100rpx; | |||||
| width: 500rpx; | |||||
| margin: 0 auto; | |||||
| } | |||||
| .barnum { | |||||
| height: 46rpx; | |||||
| line-height: 46rpx; | |||||
| font-size: 32rpx; | |||||
| text-align: center; | |||||
| letter-spacing: 2rpx; | |||||
| white-space: nowrap; | |||||
| color: #999; | |||||
| } | |||||
| .barnum text { | |||||
| color: #333; | |||||
| } | |||||
| .barcode > canvas { | |||||
| width: 500rpx; | |||||
| height: 100rpx; | |||||
| } | |||||
| .qrcode { | |||||
| height: 340rpx; | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| justify-content: flex-end; | |||||
| align-items: center; | |||||
| } | |||||
| .qrcode > canvas { | |||||
| width: 350rpx; | |||||
| height: 350rpx; | |||||
| } | |||||
| .jine{ | |||||
| color: #f96563!important; | |||||
| font-size: 36rpx!important; | |||||
| } | } | ||||
| @@ -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 { | ||||
| @@ -88,7 +88,7 @@ | |||||
| padding: 0 4%; | padding: 0 4%; | ||||
| display: flex; | display: flex; | ||||
| justify-content: space-between; | justify-content: space-between; | ||||
| border-bottom: 20rpx solid #ededed; | |||||
| border-bottom: 20rpx solid #f8f8f8; | |||||
| } | } | ||||
| .payment view:nth-child(1) text:nth-child(1) { | .payment view:nth-child(1) text:nth-child(1) { | ||||
| @@ -24,7 +24,6 @@ | |||||
| <view class="view1"><text class="remainingNumber">剩余件数:</text><text class='realnumber'>{{item.remainInventory}}件</text></view> | <view class="view1"><text class="remainingNumber">剩余件数:</text><text class='realnumber'>{{item.remainInventory}}件</text></view> | ||||
| <view class='buy'>购买</view> | <view class='buy'>购买</view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| @@ -9,13 +9,13 @@ | |||||
| </view> | </view> | ||||
| <view class="margin"></view> | <view class="margin"></view> | ||||
| <view class="user-btns"> | <view class="user-btns"> | ||||
| <navigator url="/pages/order/index/index?id=0"> | |||||
| <navigator url="/pages/order/index/index?id=all"> | |||||
| <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/order/index/index?id=1"> | |||||
| <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> | ||||
| @@ -23,7 +23,7 @@ | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </navigator> | </navigator> | ||||
| <navigator url="/pages/order/index/index?id=2"> | |||||
| <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> | ||||
| @@ -1,10 +1,10 @@ | |||||
| .margin { | .margin { | ||||
| background: #f5f5f5; | |||||
| background: #f8f8f8; | |||||
| height: 20rpx; | height: 20rpx; | ||||
| } | } | ||||
| .user { | .user { | ||||
| background: #f5f5f5; | |||||
| background: #f8f8f8; | |||||
| min-height: 100vh; | min-height: 100vh; | ||||
| } | } | ||||
| @@ -11,7 +11,7 @@ | |||||
| "newFeature": true | "newFeature": true | ||||
| }, | }, | ||||
| "compileType": "miniprogram", | "compileType": "miniprogram", | ||||
| "libVersion": "2.2.2", | |||||
| "libVersion": "2.2.4", | |||||
| "appid": "wx8eb8275b78db4ede", | "appid": "wx8eb8275b78db4ede", | ||||
| "projectname": "%E5%AF%8C%E8%8C%82%E6%94%AF%E4%BB%98%E6%B5%8B%E8%AF%95", | "projectname": "%E5%AF%8C%E8%8C%82%E6%94%AF%E4%BB%98%E6%B5%8B%E8%AF%95", | ||||
| "isGameTourist": false, | "isGameTourist": false, | ||||
| @@ -76,9 +76,30 @@ function fmtDate(obj) { | |||||
| d.substring(d.length - 2, d.length) | d.substring(d.length - 2, d.length) | ||||
| ); | ); | ||||
| } | } | ||||
| //计算下单的时间与现在的时间的 | |||||
| function timechuo(startTime) { | |||||
| var s1 = new Date(startTime.replace(/-/g, "/")); | |||||
| var s2 = new Date(); | |||||
| var runTime = parseInt((s1.getTime() - s2.getTime()) / 1000); | |||||
| var year = Math.floor(runTime / 86400 / 365); | |||||
| var runTime = runTime % (86400 * 365); | |||||
| var month = Math.floor(runTime / 86400 / 30); | |||||
| var runTime = runTime % (86400 * 30); | |||||
| var day = Math.floor(runTime / 86400); | |||||
| var runTime = runTime % 86400; | |||||
| var hour = Math.floor(runTime / 3600); | |||||
| var runTime = runTime % 3600; | |||||
| var minute = Math.floor(runTime / 60); | |||||
| var runTime = runTime % 60; | |||||
| var second = runTime; | |||||
| console.log(month, day, hour, minute, second); | |||||
| return (day+"天"+hour+"小时"+minute+"分钟") | |||||
| } | |||||
| module.exports = { | module.exports = { | ||||
| formatTime: formatTime, | formatTime: formatTime, | ||||
| barcode: barc, | barcode: barc, | ||||
| qrcode: qrc, | qrcode: qrc, | ||||
| fmtDate: fmtDate | |||||
| fmtDate: fmtDate, | |||||
| timechuo:timechuo | |||||
| }; | }; | ||||