Showing
13 changed files
with
195 additions
and
67 deletions
| 1 | <!--components/2.0/taocan/subject.wxml--> | 1 | <!--components/2.0/taocan/subject.wxml--> |
| 2 | +<wxs src="../../../utils/util.wxs" module="util" /> | ||
| 2 | <view class="view card padding-lr-lg padding-tb"> | 3 | <view class="view card padding-lr-lg padding-tb"> |
| 3 | <view class="header view flex align-center"> | 4 | <view class="header view flex align-center"> |
| 4 | - <view class="view avatar margin-right-sm" style="background-image: url('{{order.seller.oooo}}')"></view> | 5 | + <view class="view avatar margin-right-sm" style="background-image: url('{{order_info.seller_image}}?imageView2/2/w/320')"></view> |
| 5 | <view class="flex-treble"> | 6 | <view class="flex-treble"> |
| 6 | - <view class="txt-32-h text-cut" style="margin-bottom: 2rpx;">123</view> | ||
| 7 | - <view class="txt-24-h text-gray text-cut">地址</view> | 7 | + <view class="txt-32-h text-cut" style="margin-bottom: 2rpx;">{{order_info.sellername}}</view> |
| 8 | + <view class="txt-24-h text-gray text-cut">{{order_info.real_address}}</view> | ||
| 8 | </view> | 9 | </view> |
| 9 | <view class="view txt-28-h text-blue" wx:if="{{hasTopStatus}}">以哈哈</view> | 10 | <view class="view txt-28-h text-blue" wx:if="{{hasTopStatus}}">以哈哈</view> |
| 10 | <view class="phone view" wx:else=""></view> | 11 | <view class="phone view" wx:else=""></view> |
| 11 | </view> | 12 | </view> |
| 12 | <view class="view flex solid-bottom" style="padding-bottom: 36rpx;padding-top: 36rpx;"> | 13 | <view class="view flex solid-bottom" style="padding-bottom: 36rpx;padding-top: 36rpx;"> |
| 13 | - <view class="thumb margin-right-lg"></view> | 14 | + <view class="thumb margin-right-lg" style="background-image: url('{{foods_info.main_url}}?imageView2/2/w/320')"></view> |
| 14 | <view class="flex flex-direction justify-between"> | 15 | <view class="flex flex-direction justify-between"> |
| 15 | <view class="flex align-center"> | 16 | <view class="flex align-center"> |
| 16 | <view class="bg-white label txt-20-h">套餐名称</view> | 17 | <view class="bg-white label txt-20-h">套餐名称</view> |
| 17 | - <view class="txt-28-h margin-left-lg">套餐名称</view> | 18 | + <view class="txt-28-h margin-left-lg">{{foods_info.name}}</view> |
| 18 | </view> | 19 | </view> |
| 19 | <view class="flex align-center"> | 20 | <view class="flex align-center"> |
| 20 | <view class="bg-white label txt-20-h">套餐数量</view> | 21 | <view class="bg-white label txt-20-h">套餐数量</view> |
| 21 | - <view class="txt-28-h margin-left-lg">套餐名称</view> | 22 | + <view class="txt-28-h margin-left-lg">1</view> |
| 22 | </view> | 23 | </view> |
| 23 | <view class="flex align-center"> | 24 | <view class="flex align-center"> |
| 24 | <view class="bg-white label txt-20-h">有效期限</view> | 25 | <view class="bg-white label txt-20-h">有效期限</view> |
| 25 | - <view class="txt-28-h margin-left-lg">套餐名称</view> | 26 | + <view class="txt-28-h margin-left-lg">{{util.unixtoTime(foods_info.eff_time_end,'YYYY-MM-DD')}}</view> |
| 26 | </view> | 27 | </view> |
| 27 | <view class="flex align-center"> | 28 | <view class="flex align-center"> |
| 28 | <view class="bg-white label txt-20-h">套餐价格</view> | 29 | <view class="bg-white label txt-20-h">套餐价格</view> |
| 29 | - <view class="txt-28-h margin-left-lg">套餐名称</view> | 30 | + <view class="txt-28-h margin-left-lg">¥{{foods_info.sale_price}}</view> |
| 30 | </view> | 31 | </view> |
| 31 | </view> | 32 | </view> |
| 32 | </view> | 33 | </view> |
| @@ -11,26 +11,29 @@ Page({ | @@ -11,26 +11,29 @@ Page({ | ||
| 11 | activityId:'', | 11 | activityId:'', |
| 12 | packs:{}, | 12 | packs:{}, |
| 13 | }, | 13 | }, |
| 14 | - | 14 | + activityId:'', |
| 15 | /** | 15 | /** |
| 16 | * 生命周期函数--监听页面加载 | 16 | * 生命周期函数--监听页面加载 |
| 17 | * sid 商家id | 17 | * sid 商家id |
| 18 | * pid 套餐id | 18 | * pid 套餐id |
| 19 | */ | 19 | */ |
| 20 | onLoad: function (options) { | 20 | onLoad: function (options) { |
| 21 | + this.activityId=options.pid | ||
| 21 | App.Foodset.GetFoodsetList({sid:options.sid}).then(res=>{ | 22 | App.Foodset.GetFoodsetList({sid:options.sid}).then(res=>{ |
| 22 | let packs={} | 23 | let packs={} |
| 23 | res.data.some(r=>{ | 24 | res.data.some(r=>{ |
| 24 | - r['包间可用']=r.service.indexOf('包间可用'); | 25 | + r['包间可用']=r.service.indexOf('包间可用')>-1; |
| 26 | + r['免预约']=r.service.indexOf('免预约')>-1; | ||
| 27 | + r['随时退']=r.service.indexOf('随时退')>-1; | ||
| 25 | r.sid=this.data.sid | 28 | r.sid=this.data.sid |
| 26 | packs[r.id]=r | 29 | packs[r.id]=r |
| 27 | }) | 30 | }) |
| 28 | this.setData({ | 31 | this.setData({ |
| 29 | packs:packs, | 32 | packs:packs, |
| 30 | - activityId:options.pid, | 33 | + activityId:this.activityId, |
| 31 | }) | 34 | }) |
| 35 | + this.getActivityDetail() | ||
| 32 | }) | 36 | }) |
| 33 | - | ||
| 34 | }, | 37 | }, |
| 35 | 38 | ||
| 36 | /** | 39 | /** |
| @@ -82,11 +85,14 @@ Page({ | @@ -82,11 +85,14 @@ Page({ | ||
| 82 | 85 | ||
| 83 | }, | 86 | }, |
| 84 | touchTab(e){ | 87 | touchTab(e){ |
| 88 | + this.activityId=util.attr(e,'id') | ||
| 85 | let obj={ | 89 | let obj={ |
| 86 | - activityId:util.attr(e,'id'), | 90 | + activityId:this.activityId, |
| 87 | } | 91 | } |
| 88 | - let index=util.attr(e,'index') | ||
| 89 | - let length=this.data.packs.length; | 92 | + let id=util.attr(e,'id') |
| 93 | + let ps=Object.keys(this.data.packs) | ||
| 94 | + let index=ps.indexOf(id) | ||
| 95 | + let length=ps.length; | ||
| 90 | let current=0 | 96 | let current=0 |
| 91 | if(index>length-3){ | 97 | if(index>length-3){ |
| 92 | current=length-3; | 98 | current=length-3; |
| @@ -95,6 +101,7 @@ Page({ | @@ -95,6 +101,7 @@ Page({ | ||
| 95 | } | 101 | } |
| 96 | obj.current=current | 102 | obj.current=current |
| 97 | this.setData(obj) | 103 | this.setData(obj) |
| 104 | + this.getActivityDetail(); | ||
| 98 | }, | 105 | }, |
| 99 | swiperChange(e){ | 106 | swiperChange(e){ |
| 100 | console.log(e) | 107 | console.log(e) |
| @@ -107,5 +114,42 @@ Page({ | @@ -107,5 +114,42 @@ Page({ | ||
| 107 | this.setData({ | 114 | this.setData({ |
| 108 | hasShowRule:!this.data.hasShowRule, | 115 | hasShowRule:!this.data.hasShowRule, |
| 109 | }) | 116 | }) |
| 110 | - } | 117 | + }, |
| 118 | + getActivityDetail(){ | ||
| 119 | + let packs=this.data.packs | ||
| 120 | + if(!packs[this.activityId].operator){ | ||
| 121 | + App.Foodset.GetFoodsetDetail({fid:this.activityId}).then(res=>{ | ||
| 122 | + packs[this.activityId]={...packs[this.activityId],...res.data} | ||
| 123 | + this.setData({ | ||
| 124 | + packs:packs, | ||
| 125 | + }) | ||
| 126 | + }) | ||
| 127 | + } | ||
| 128 | + }, | ||
| 129 | + createSale(){ | ||
| 130 | + let pack=this.data.packs[this.activityId] | ||
| 131 | + App.PayOnline.JsApiPay({ | ||
| 132 | + pay_type:1, | ||
| 133 | + fid:this.activityId, | ||
| 134 | + sid:pack.sid, | ||
| 135 | + }).then(res=>{ | ||
| 136 | + if(res.ret==200){ | ||
| 137 | + let order_id=res.data.order_id | ||
| 138 | + res.data.timeStamp+="" | ||
| 139 | + wx.requestPayment({ | ||
| 140 | + ...res.data, | ||
| 141 | + success:res=>{ | ||
| 142 | + util.toast('支付成功') | ||
| 143 | + setTimeout(()=>{ | ||
| 144 | + wx.navigateTo({ | ||
| 145 | + url:'/pages/taocan/order?id='+order_id, | ||
| 146 | + }) | ||
| 147 | + },1000) | ||
| 148 | + }, | ||
| 149 | + }) | ||
| 150 | + }else{ | ||
| 151 | + util.toast(res.msg,'none') | ||
| 152 | + } | ||
| 153 | + }) | ||
| 154 | + }, | ||
| 111 | }) | 155 | }) |
| 1 | <!--pages/taocan/index.wxml--> | 1 | <!--pages/taocan/index.wxml--> |
| 2 | +<wxs src="../../utils/util.wxs" module="util" /> | ||
| 2 | <nav hasHome>套餐详情</nav> | 3 | <nav hasHome>套餐详情</nav> |
| 3 | <swiper | 4 | <swiper |
| 4 | display-multiple-items="3" | 5 | display-multiple-items="3" |
| @@ -10,7 +11,9 @@ | @@ -10,7 +11,9 @@ | ||
| 10 | <swiper-item | 11 | <swiper-item |
| 11 | bindtap="touchTab" data-id="{{item.id}}" data-index="{{index}}" | 12 | bindtap="touchTab" data-id="{{item.id}}" data-index="{{index}}" |
| 12 | class="swiper-item {{activityId==item.id?'active':''}} flex align-center"> | 13 | class="swiper-item {{activityId==item.id?'active':''}} flex align-center"> |
| 13 | - <view class="txt-28-h">{{item.name}}</view> | 14 | + <view class="txt-28-h text-cut" style="width: 220rpx;height: 50rpx;"> |
| 15 | + <text class="swiper-item-txt">{{item.name}}</text> | ||
| 16 | + </view> | ||
| 14 | </swiper-item> | 17 | </swiper-item> |
| 15 | </block> | 18 | </block> |
| 16 | </swiper> | 19 | </swiper> |
| @@ -24,7 +27,7 @@ | @@ -24,7 +27,7 @@ | ||
| 24 | <view class="txt-20-h" style="margin-bottom: 8rpx;">¥</view> | 27 | <view class="txt-20-h" style="margin-bottom: 8rpx;">¥</view> |
| 25 | <view class="txt-28-h" style="margin-bottom: 4rpx;">{{packs[activityId].market_price}}</view> | 28 | <view class="txt-28-h" style="margin-bottom: 4rpx;">{{packs[activityId].market_price}}</view> |
| 26 | </view> | 29 | </view> |
| 27 | - <view class="view flex text-orange align-end margin-left-sm" > | 30 | + <view class="view flex text-orange align-end margin-left-sm" wx:if="{{packs[activityId].discount>0}}" > |
| 28 | <view class="view tag" style="margin-bottom: 16rpx;"></view> | 31 | <view class="view tag" style="margin-bottom: 16rpx;"></view> |
| 29 | <view class="view margin-left-xs txt-24-h" style="margin-bottom: 10rpx;">{{packs[activityId].discount*10}}折</view> | 32 | <view class="view margin-left-xs txt-24-h" style="margin-bottom: 10rpx;">{{packs[activityId].discount*10}}折</view> |
| 30 | </view> | 33 | </view> |
| @@ -52,14 +55,14 @@ | @@ -52,14 +55,14 @@ | ||
| 52 | <view class="dot"></view> | 55 | <view class="dot"></view> |
| 53 | <view class="txt-30-h text-bold">有效期</view> | 56 | <view class="txt-30-h text-bold">有效期</view> |
| 54 | </view> | 57 | </view> |
| 55 | - <view class="text-df">123123</view> | 58 | + <view class="text-df">{{util.unixtoTime(packs[activityId].eff_time_start,'YYYY.MM.DD')}}-{{util.unixtoTime(packs[activityId].eff_time_end,'YYYY.MM.DD HH:II')}}</view> |
| 56 | </view> | 59 | </view> |
| 57 | <view class="view padding block"> | 60 | <view class="view padding block"> |
| 58 | <view class="flex align-center margin-bottom-sm"> | 61 | <view class="flex align-center margin-bottom-sm"> |
| 59 | <view class="dot"></view> | 62 | <view class="dot"></view> |
| 60 | <view class="txt-30-h text-bold">使用时间</view> | 63 | <view class="txt-30-h text-bold">使用时间</view> |
| 61 | </view> | 64 | </view> |
| 62 | - <view class="text-df">123123</view> | 65 | + <view class="text-df">{{packs[activityId].use_time}}</view> |
| 63 | </view> | 66 | </view> |
| 64 | <view class="view padding block padding-bottom-sm"> | 67 | <view class="view padding block padding-bottom-sm"> |
| 65 | <view class="flex align-center margin-bottom-sm"> | 68 | <view class="flex align-center margin-bottom-sm"> |
| @@ -67,7 +70,7 @@ | @@ -67,7 +70,7 @@ | ||
| 67 | <view class="txt-30-h text-bold">使用规则</view> | 70 | <view class="txt-30-h text-bold">使用规则</view> |
| 68 | </view> | 71 | </view> |
| 69 | <view class="text-df" wx:if="{{hasShowRule}}"> | 72 | <view class="text-df" wx:if="{{hasShowRule}}"> |
| 70 | - <text>123123</text> | 73 | + <text style="line-height: 40rpx;">{{packs[activityId].use_notice}}</text> |
| 71 | </view> | 74 | </view> |
| 72 | <view class="flex justify-center align-center rule margin-top-sm margin-bottom-sm" bindtap="toggleRule"> | 75 | <view class="flex justify-center align-center rule margin-top-sm margin-bottom-sm" bindtap="toggleRule"> |
| 73 | <view class="txt-28-h">{{hasShowRule?'收起':'展开更多'}}</view> | 76 | <view class="txt-28-h">{{hasShowRule?'收起':'展开更多'}}</view> |
| @@ -79,19 +82,19 @@ | @@ -79,19 +82,19 @@ | ||
| 79 | <view class="view bottom flex align-center justify-between padding-lr-xl"> | 82 | <view class="view bottom flex align-center justify-between padding-lr-xl"> |
| 80 | <view class="view flex align-end margin-right"> | 83 | <view class="view flex align-end margin-right"> |
| 81 | <view class="text-orange txt-40-h" style="margin-bottom: 4rpx;">¥</view> | 84 | <view class="text-orange txt-40-h" style="margin-bottom: 4rpx;">¥</view> |
| 82 | - <view class="text-orange txt-52-h margin-right-sm text-bold">123</view> | 85 | + <view class="text-orange txt-52-h margin-right-sm text-bold">{{packs[activityId].sale_price}}</view> |
| 83 | </view> | 86 | </view> |
| 84 | - <view class="view flex flex-direction justify-center align-center"> | ||
| 85 | - <view class="view flex text-orange align-center" > | 87 | + <view class="view flex flex-direction justify-center align-start"> |
| 88 | + <view class="view flex text-orange align-center" wx:if="{{packs[activityId].discount>0}}"> | ||
| 86 | <view class="view tag"></view> | 89 | <view class="view tag"></view> |
| 87 | - <view class="view margin-left-xs txt-24-h">8折</view> | 90 | + <view class="view margin-left-xs txt-24-h">{{packs[activityId].discount*10}}折</view> |
| 88 | </view> | 91 | </view> |
| 89 | <view class="huaxian flex align-end"> | 92 | <view class="huaxian flex align-end"> |
| 90 | <view class="txt-24-h" style="margin-bottom: 2rpx;">¥</view> | 93 | <view class="txt-24-h" style="margin-bottom: 2rpx;">¥</view> |
| 91 | - <view class="txt-32-h">123</view> | 94 | + <view class="txt-32-h">{{packs[activityId].market_price}}</view> |
| 92 | </view> | 95 | </view> |
| 93 | </view> | 96 | </view> |
| 94 | - <view class="flex flex-treble justify-end"> | 97 | + <view class="flex flex-treble justify-end" bindtap="createSale"> |
| 95 | <view class="buyButton txt-36-h text-bold flex align-center justify-center bg-blue-blue">立即抢购</view> | 98 | <view class="buyButton txt-36-h text-bold flex align-center justify-center bg-blue-blue">立即抢购</view> |
| 96 | </view> | 99 | </view> |
| 97 | </view> | 100 | </view> |
| 1 | /* pages/taocan/index.wxss */ | 1 | /* pages/taocan/index.wxss */ |
| 2 | @import "../../colorui/main.wxss"; | 2 | @import "../../colorui/main.wxss"; |
| 3 | -.swiper-item{ | 3 | +.swiper-item-txt{ |
| 4 | position: relative; | 4 | position: relative; |
| 5 | } | 5 | } |
| 6 | -.swiper-item.active:after{ | 6 | +.swiper-item.active .swiper-item-txt:after{ |
| 7 | position: absolute; | 7 | position: absolute; |
| 8 | - bottom: 4rpx; | 8 | + bottom: -14rpx; |
| 9 | width: 60rpx; | 9 | width: 60rpx; |
| 10 | height: 6rpx; | 10 | height: 6rpx; |
| 11 | background: linear-gradient(90deg, #3BBFF5 0%, #57A0FF 100%); | 11 | background: linear-gradient(90deg, #3BBFF5 0%, #57A0FF 100%); |
| 12 | border-radius: 3rpx; | 12 | border-radius: 3rpx; |
| 13 | content: ""; | 13 | content: ""; |
| 14 | - left:calc(50% - 60rpx); | 14 | + left:calc(50% - 30rpx); |
| 15 | + display: block; | ||
| 16 | + z-index: 9; | ||
| 15 | } | 17 | } |
| 16 | .swiper-item.active .txt-28-h{ | 18 | .swiper-item.active .txt-28-h{ |
| 17 | font-weight: bold; | 19 | font-weight: bold; |
| 1 | // pages/taocan/detail.js | 1 | // pages/taocan/detail.js |
| 2 | +import util from '../../utils/util'; | ||
| 3 | +import App from '../../utils/api'; | ||
| 4 | +//账单状态 1=初始化 2=交易成功(待使用) 3=已使用 4=退款中 5=已退款 6=已过期 7=支付失败 | ||
| 5 | +const orderStatusStr={ | ||
| 6 | + 1:{status:'未支付',info:''}, | ||
| 7 | + 2:{status:'待使用',info:'感谢您的支持,请您按尽快来店就餐呦'}, | ||
| 8 | + 3:{status:'已使用',info:'感谢您的支持,满意的话记得常来呦'}, | ||
| 9 | + 4:{status:'退款中',info:''}, | ||
| 10 | + 5:{status:'已退款',info:'钱款已原路退还,请在微信账单查看呦'}, | ||
| 11 | + 6:{status:'已过期',info:'您可以随时申请退款呦'}, | ||
| 12 | + 7:{status:'支付失败',info:''}, | ||
| 13 | +} | ||
| 2 | Page({ | 14 | Page({ |
| 3 | 15 | ||
| 4 | /** | 16 | /** |
| 5 | * 页面的初始数据 | 17 | * 页面的初始数据 |
| 6 | */ | 18 | */ |
| 7 | data: { | 19 | data: { |
| 8 | - | 20 | + order_info:null, |
| 21 | + foods_info:null, | ||
| 9 | }, | 22 | }, |
| 10 | 23 | ||
| 11 | /** | 24 | /** |
| 12 | * 生命周期函数--监听页面加载 | 25 | * 生命周期函数--监听页面加载 |
| 13 | */ | 26 | */ |
| 14 | onLoad: function (options) { | 27 | onLoad: function (options) { |
| 15 | - | 28 | + this.options=options |
| 29 | + this.getOrderInfo(); | ||
| 16 | }, | 30 | }, |
| 17 | 31 | ||
| 18 | /** | 32 | /** |
| @@ -62,5 +76,33 @@ Page({ | @@ -62,5 +76,33 @@ Page({ | ||
| 62 | */ | 76 | */ |
| 63 | onShareAppMessage: function () { | 77 | onShareAppMessage: function () { |
| 64 | 78 | ||
| 65 | - } | 79 | + }, |
| 80 | + toggleRule(){ | ||
| 81 | + this.setData({ | ||
| 82 | + hasShowRule:!this.data.hasShowRule, | ||
| 83 | + }) | ||
| 84 | + }, | ||
| 85 | + getOrderInfo() { | ||
| 86 | + App.Foodset.GetFoodOrdersDetail({ | ||
| 87 | + ufid: this.options.id, | ||
| 88 | + }).then(async res=>{ | ||
| 89 | + let qrcode='' | ||
| 90 | + if(true || res.data.order_info.status==2){ | ||
| 91 | + qrcode=util.http_build_query({ | ||
| 92 | + path:'pages/writeoff/setmeal', | ||
| 93 | + //path:'pages/me/s_index', | ||
| 94 | + param:JSON.stringify({ | ||
| 95 | + sid:res.data.order_info.sid, | ||
| 96 | + oid:res.data.order_info.id | ||
| 97 | + }) | ||
| 98 | + },util.cgi('App.System.GetWxLiteCodeScene')) | ||
| 99 | + } | ||
| 100 | + this.setData({ | ||
| 101 | + order_info:{...res.data.order_info,...res.data.seller_info}, | ||
| 102 | + order_tips:orderStatusStr[res.data.order_info.status], | ||
| 103 | + foods_info:res.data.foods_info[0], | ||
| 104 | + qrcode:qrcode, | ||
| 105 | + }) | ||
| 106 | + }) | ||
| 107 | + }, | ||
| 66 | }) | 108 | }) |
| 1 | <!--pages/taocan/detail.wxml--> | 1 | <!--pages/taocan/detail.wxml--> |
| 2 | +<wxs src="../../utils/util.wxs" module="util" /> | ||
| 2 | <view class="view bg-blue-img"></view> | 3 | <view class="view bg-blue-img"></view> |
| 3 | <nav backgroundColor="rgba(0,0,0,0)" color="#ffffff"></nav> | 4 | <nav backgroundColor="rgba(0,0,0,0)" color="#ffffff"></nav> |
| 4 | <view class="view padding-lr padding-bottom-lg" style="position: relative"> | 5 | <view class="view padding-lr padding-bottom-lg" style="position: relative"> |
| 5 | - <view class="text-white txt-40-h text-bold margin-top-sm">已退款</view> | ||
| 6 | - <view class="text-white txt-28-h text-bold margin-bottom-lg" style="margin-top: 6rpx;">钱款已原路退还,请在微信账单查看呦</view> | ||
| 7 | - <subject order="{{order}}"> | 6 | + <view class="text-white txt-40-h text-bold margin-top-sm">{{order_tips.status}}</view> |
| 7 | + <view class="text-white txt-28-h text-bold margin-bottom-lg" style="margin-top: 6rpx;">{{order_tips.info}}</view> | ||
| 8 | + <subject foods_info="{{foods_info}}" order_info="{{order_info}}"> | ||
| 8 | <view class="view flex flex-direction justify-center align-center margin-top-lg"> | 9 | <view class="view flex flex-direction justify-center align-center margin-top-lg"> |
| 9 | - <view class="Medium txt-28-h">券码:1111 1111 1111</view> | ||
| 10 | - <image src="{{false?'':'http://nosqn.colorcun.com/taocan/1%20%2813%29.png'}}" mode="heightFix" style="height: 340rpx;"></image> | 10 | + <view class="Medium txt-28-h {{order_info.status==2?'':'overline'}}">券码:{{order_info.id}}</view> |
| 11 | + <image src="{{qrcode?qrcode:'http://nosqn.colorcun.com/taocan/1%20%2813%29.png'}}" mode="heightFix" style="height: 340rpx;"></image> | ||
| 11 | </view> | 12 | </view> |
| 12 | </subject> | 13 | </subject> |
| 13 | - <navigator url="/pages/reserve/detail?id={{order.seller.id}}&activeTab=reserve"> | 14 | + <navigator url="/pages/reserve/detail?id={{order_info.sid}}&activeTab=reserve"> |
| 14 | <view class="view card flex margin-tb-sm padding-lg justify-between"> | 15 | <view class="view card flex margin-tb-sm padding-lg justify-between"> |
| 15 | <view class="view text-bold txt-32-h">您还可以预订包间</view> | 16 | <view class="view text-bold txt-32-h">您还可以预订包间</view> |
| 16 | <view class="view bg-blue-blue round" style="padding: 8rpx 20rpx;">订包间</view> | 17 | <view class="view bg-blue-blue round" style="padding: 8rpx 20rpx;">订包间</view> |
| @@ -23,14 +24,14 @@ | @@ -23,14 +24,14 @@ | ||
| 23 | <view class="dot"></view> | 24 | <view class="dot"></view> |
| 24 | <view class="txt-30-h text-bold">有效期</view> | 25 | <view class="txt-30-h text-bold">有效期</view> |
| 25 | </view> | 26 | </view> |
| 26 | - <view class="text-df">123123</view> | 27 | + <view class="text-df">{{util.unixtoTime(foods_info.eff_time_start,'YYYY.MM.DD')}}-{{util.unixtoTime(foods_info.eff_time_end,'YYYY.MM.DD HH:II')}}</view> |
| 27 | </view> | 28 | </view> |
| 28 | <view class="view padding block"> | 29 | <view class="view padding block"> |
| 29 | <view class="flex align-center margin-bottom-sm"> | 30 | <view class="flex align-center margin-bottom-sm"> |
| 30 | <view class="dot"></view> | 31 | <view class="dot"></view> |
| 31 | <view class="txt-30-h text-bold">使用时间</view> | 32 | <view class="txt-30-h text-bold">使用时间</view> |
| 32 | </view> | 33 | </view> |
| 33 | - <view class="text-df">123123</view> | 34 | + <view class="text-df">{{foods_info.use_time}}</view> |
| 34 | </view> | 35 | </view> |
| 35 | <view class="view padding block padding-bottom-sm"> | 36 | <view class="view padding block padding-bottom-sm"> |
| 36 | <view class="flex align-center margin-bottom-sm"> | 37 | <view class="flex align-center margin-bottom-sm"> |
| @@ -38,7 +39,7 @@ | @@ -38,7 +39,7 @@ | ||
| 38 | <view class="txt-30-h text-bold">使用规则</view> | 39 | <view class="txt-30-h text-bold">使用规则</view> |
| 39 | </view> | 40 | </view> |
| 40 | <view class="text-df" wx:if="{{hasShowRule}}"> | 41 | <view class="text-df" wx:if="{{hasShowRule}}"> |
| 41 | - <text>123123</text> | 42 | + <text style="line-height: 40rpx;">{{foods_info.use_notice}}</text> |
| 42 | </view> | 43 | </view> |
| 43 | <view class="flex justify-center align-center rule margin-top-sm margin-bottom-sm" bindtap="toggleRule"> | 44 | <view class="flex justify-center align-center rule margin-top-sm margin-bottom-sm" bindtap="toggleRule"> |
| 44 | <view class="txt-28-h">{{hasShowRule?'收起':'展开更多'}}</view> | 45 | <view class="txt-28-h">{{hasShowRule?'收起':'展开更多'}}</view> |
| @@ -53,13 +54,13 @@ | @@ -53,13 +54,13 @@ | ||
| 53 | </view> | 54 | </view> |
| 54 | <view class="view padding padding-lr-lg flex justify-between"> | 55 | <view class="view padding padding-lr-lg flex justify-between"> |
| 55 | <view class="text-gray txt-28-h">商品总价</view> | 56 | <view class="text-gray txt-28-h">商品总价</view> |
| 56 | - <view class="txt-28-h">¥888.00</view> | 57 | + <view class="txt-28-h">¥{{order_info.price}}</view> |
| 57 | </view> | 58 | </view> |
| 58 | <view class="view padding-bottom padding-lr-lg flex justify-between"> | 59 | <view class="view padding-bottom padding-lr-lg flex justify-between"> |
| 59 | <view class="text-gray txt-28-h">实际付款</view> | 60 | <view class="text-gray txt-28-h">实际付款</view> |
| 60 | - <view class="txt-28-h">¥888.00</view> | 61 | + <view class="txt-28-h">¥{{order_info.should_price}}</view> |
| 61 | </view> | 62 | </view> |
| 62 | - <navigator url="/pages/taocan/orderHis?id={{order.id}}"> | 63 | + <navigator url="/pages/taocan/orderHis?id={{order_info.id}}"> |
| 63 | <view class="view padding-bottom padding-lr-lg flex justify-between"> | 64 | <view class="view padding-bottom padding-lr-lg flex justify-between"> |
| 64 | <view class="text-gray txt-28-h">交易快照</view> | 65 | <view class="text-gray txt-28-h">交易快照</view> |
| 65 | <view class="view txt-28-h flex-treble flex align-center justify-end"> | 66 | <view class="view txt-28-h flex-treble flex align-center justify-end"> |
| @@ -70,15 +71,19 @@ | @@ -70,15 +71,19 @@ | ||
| 70 | </navigator> | 71 | </navigator> |
| 71 | <view class="view padding-bottom padding-lr-lg flex justify-between"> | 72 | <view class="view padding-bottom padding-lr-lg flex justify-between"> |
| 72 | <view class="text-gray txt-28-h">订单编号</view> | 73 | <view class="text-gray txt-28-h">订单编号</view> |
| 73 | - <view class="txt-28-h">¥888.00</view> | 74 | + <view class="txt-28-h">{{order_info.order_no}}</view> |
| 74 | </view> | 75 | </view> |
| 75 | <view class="view padding-bottom padding-lr-lg flex justify-between"> | 76 | <view class="view padding-bottom padding-lr-lg flex justify-between"> |
| 76 | <view class="text-gray txt-28-h">下单时间</view> | 77 | <view class="text-gray txt-28-h">下单时间</view> |
| 77 | - <view class="txt-28-h">¥888.00</view> | 78 | + <view class="txt-28-h">{{util.unixtoTime(order_info.pay_time,'YYYY-MM-DD HH:II:SS')}}</view> |
| 79 | + </view> | ||
| 80 | + <view class="view padding-bottom padding-lr-lg flex justify-between"> | ||
| 81 | + <view class="text-gray txt-28-h">使用时间</view> | ||
| 82 | + <view class="txt-28-h">{{util.unixtoTime(order_info.use_time,'YYYY-MM-DD HH:II:SS')}}</view> | ||
| 78 | </view> | 83 | </view> |
| 79 | <view class="view padding-bottom padding-lr-lg flex justify-between"> | 84 | <view class="view padding-bottom padding-lr-lg flex justify-between"> |
| 80 | <view class="text-gray txt-28-h">退款时间</view> | 85 | <view class="text-gray txt-28-h">退款时间</view> |
| 81 | - <view class="txt-28-h">¥888.00</view> | 86 | + <view class="txt-28-h">{{util.unixtoTime(order_info.refund_time,'YYYY-MM-DD HH:II:SS')}}</view> |
| 82 | </view> | 87 | </view> |
| 83 | </view> | 88 | </view> |
| 84 | </view> | 89 | </view> |
| @@ -28,4 +28,7 @@ | @@ -28,4 +28,7 @@ | ||
| 28 | } | 28 | } |
| 29 | .rule .icon.show{ | 29 | .rule .icon.show{ |
| 30 | background-image: url("http://nosqn.colorcun.com/taocan/1%20%286%29.png"); | 30 | background-image: url("http://nosqn.colorcun.com/taocan/1%20%286%29.png"); |
| 31 | +} | ||
| 32 | +.overline{ | ||
| 33 | + text-decoration: line-through; | ||
| 31 | } | 34 | } |
| 1 | // pages/taocan/orderHis.js | 1 | // pages/taocan/orderHis.js |
| 2 | +import util from '../../utils/util'; | ||
| 3 | +import App from '../../utils/api'; | ||
| 2 | Page({ | 4 | Page({ |
| 3 | 5 | ||
| 4 | /** | 6 | /** |
| @@ -12,7 +14,8 @@ Page({ | @@ -12,7 +14,8 @@ Page({ | ||
| 12 | * 生命周期函数--监听页面加载 | 14 | * 生命周期函数--监听页面加载 |
| 13 | */ | 15 | */ |
| 14 | onLoad: function (options) { | 16 | onLoad: function (options) { |
| 15 | - | 17 | + this.options=options |
| 18 | + this.getOrderInfo(); | ||
| 16 | }, | 19 | }, |
| 17 | 20 | ||
| 18 | /** | 21 | /** |
| @@ -67,5 +70,20 @@ Page({ | @@ -67,5 +70,20 @@ Page({ | ||
| 67 | this.setData({ | 70 | this.setData({ |
| 68 | hasShowRule:!this.data.hasShowRule, | 71 | hasShowRule:!this.data.hasShowRule, |
| 69 | }) | 72 | }) |
| 70 | - } | 73 | + }, |
| 74 | + getOrderInfo() { | ||
| 75 | + App.Foodset.GetFoodOrdersDetail({ | ||
| 76 | + ufid: this.options.id, | ||
| 77 | + }).then(async res=>{ | ||
| 78 | + let foods_info=res.data.foods_info[0] | ||
| 79 | + foods_info['包间可用']=foods_info.service.indexOf('包间可用')>-1; | ||
| 80 | + foods_info['免预约']=foods_info.service.indexOf('免预约')>-1; | ||
| 81 | + foods_info['随时退']=foods_info.service.indexOf('随时退')>-1; | ||
| 82 | + this.setData({ | ||
| 83 | + order_info:res.data.order_info, | ||
| 84 | + //order_tips:orderStatusStr[res.data.order_info.status], | ||
| 85 | + foods_info:foods_info, | ||
| 86 | + }) | ||
| 87 | + }) | ||
| 88 | + }, | ||
| 71 | }) | 89 | }) |
| 1 | <!--pages/taocan/orderHis.wxml--> | 1 | <!--pages/taocan/orderHis.wxml--> |
| 2 | -<nav hasHome>套餐详情</nav> | 2 | +<wxs src="../../utils/util.wxs" module="util" /> |
| 3 | +<nav>套餐详情</nav> | ||
| 3 | <view class="text-orange txt-28-h padding-lr-lg tips">发生交易纠纷时,此页面可作为判断依据。</view> | 4 | <view class="text-orange txt-28-h padding-lr-lg tips">发生交易纠纷时,此页面可作为判断依据。</view> |
| 4 | <view class="view" style="padding-bottom: 150rpx;"> | 5 | <view class="view" style="padding-bottom: 150rpx;"> |
| 5 | <view class="view box margin-lr margin-top-lg margin-bottom-sm padding"> | 6 | <view class="view box margin-lr margin-top-lg margin-bottom-sm padding"> |
| 6 | - <view class="view txt-40-h text-bold">招牌花开富贵六十人餐</view> | 7 | + <view class="view txt-40-h text-bold">{{foods_info.name}}</view> |
| 7 | <view class="view flex align-end"> | 8 | <view class="view flex align-end"> |
| 8 | <view class="text-orange txt-28-h" style="margin-bottom: 4rpx;">¥</view> | 9 | <view class="text-orange txt-28-h" style="margin-bottom: 4rpx;">¥</view> |
| 9 | - <view class="text-orange txt-44-h margin-right-sm text-bold">123</view> | 10 | + <view class="text-orange txt-44-h margin-right-sm text-bold">{{foods_info.sale_price}}</view> |
| 10 | <view class="huaxian flex align-end"> | 11 | <view class="huaxian flex align-end"> |
| 11 | <view class="txt-20-h" style="margin-bottom: 8rpx;">¥</view> | 12 | <view class="txt-20-h" style="margin-bottom: 8rpx;">¥</view> |
| 12 | - <view class="txt-28-h" style="margin-bottom: 4rpx;">123</view> | 13 | + <view class="txt-28-h" style="margin-bottom: 4rpx;">{{foods_info.market_price}}</view> |
| 13 | </view> | 14 | </view> |
| 14 | - <view class="view flex text-orange align-end margin-left-sm" > | 15 | + <view class="view flex text-orange align-end margin-left-sm" wx:if="{{foods_info.discount>0}}"> |
| 15 | <view class="view tag" style="margin-bottom: 16rpx;"></view> | 16 | <view class="view tag" style="margin-bottom: 16rpx;"></view> |
| 16 | - <view class="view margin-left-xs txt-24-h" style="margin-bottom: 10rpx;">8折</view> | 17 | + <view class="view margin-left-xs txt-24-h" style="margin-bottom: 10rpx;">{{foods_info.discount*10}}折</view> |
| 17 | </view> | 18 | </view> |
| 18 | </view> | 19 | </view> |
| 19 | <view class="view flex align-center txt-28-h margin-bottom labels" style="margin-top: 10rpx;"> | 20 | <view class="view flex align-center txt-28-h margin-bottom labels" style="margin-top: 10rpx;"> |
| 20 | - <view class="view margin-right flex align-center"> | 21 | + <view class="view margin-right flex align-center" wx:if="{{foods_info['包间可用']}}"> |
| 21 | <view class="view icon icon1"></view> | 22 | <view class="view icon icon1"></view> |
| 22 | <view class="view txt-28-h bg-white">包间可用</view> | 23 | <view class="view txt-28-h bg-white">包间可用</view> |
| 23 | </view> | 24 | </view> |
| 24 | - <view class="view margin-right flex align-center"> | 25 | + <view class="view margin-right flex align-center" wx:if="{{foods_info['免预约']}}"> |
| 25 | <view class="view icon icon2"></view> | 26 | <view class="view icon icon2"></view> |
| 26 | <view class="view txt-28-h bg-white">免预约</view> | 27 | <view class="view txt-28-h bg-white">免预约</view> |
| 27 | </view> | 28 | </view> |
| 28 | - <view class="view margin-right flex align-center"> | 29 | + <view class="view margin-right flex align-center" wx:if="{{foods_info['随时退']}}"> |
| 29 | <view class="view icon icon3"></view> | 30 | <view class="view icon icon3"></view> |
| 30 | <view class="view txt-28-h bg-white">随时退</view> | 31 | <view class="view txt-28-h bg-white">随时退</view> |
| 31 | </view> | 32 | </view> |
| 32 | </view> | 33 | </view> |
| 33 | - <image src="" style="width:100%;background-color: #cccccc;border-radius: 10rpx;" mode="widthFix"></image> | 34 | + <image src="{{foods_info.detail_url}}" style="width:100%;border-radius: 10rpx;" mode="widthFix"></image> |
| 34 | </view> | 35 | </view> |
| 35 | <view class="view box margin-lr margin-top-sm margin-bottom-sm"> | 36 | <view class="view box margin-lr margin-top-sm margin-bottom-sm"> |
| 36 | <view class="txt-30-h padding solid-bottom">购买须知</view> | 37 | <view class="txt-30-h padding solid-bottom">购买须知</view> |
| @@ -39,14 +40,14 @@ | @@ -39,14 +40,14 @@ | ||
| 39 | <view class="dot"></view> | 40 | <view class="dot"></view> |
| 40 | <view class="txt-30-h text-bold">有效期</view> | 41 | <view class="txt-30-h text-bold">有效期</view> |
| 41 | </view> | 42 | </view> |
| 42 | - <view class="text-df">123123</view> | 43 | + <view class="text-df">{{util.unixtoTime(foods_info.eff_time_start,'YYYY.MM.DD')}}-{{util.unixtoTime(foods_info.eff_time_end,'YYYY.MM.DD HH:II')}}</view> |
| 43 | </view> | 44 | </view> |
| 44 | <view class="view padding block"> | 45 | <view class="view padding block"> |
| 45 | <view class="flex align-center margin-bottom-sm"> | 46 | <view class="flex align-center margin-bottom-sm"> |
| 46 | <view class="dot"></view> | 47 | <view class="dot"></view> |
| 47 | <view class="txt-30-h text-bold">使用时间</view> | 48 | <view class="txt-30-h text-bold">使用时间</view> |
| 48 | </view> | 49 | </view> |
| 49 | - <view class="text-df">123123</view> | 50 | + <view class="text-df">{{foods_info.use_time}}</view> |
| 50 | </view> | 51 | </view> |
| 51 | <view class="view padding block padding-bottom-sm"> | 52 | <view class="view padding block padding-bottom-sm"> |
| 52 | <view class="flex align-center margin-bottom-sm"> | 53 | <view class="flex align-center margin-bottom-sm"> |
| @@ -54,7 +55,7 @@ | @@ -54,7 +55,7 @@ | ||
| 54 | <view class="txt-30-h text-bold">使用规则</view> | 55 | <view class="txt-30-h text-bold">使用规则</view> |
| 55 | </view> | 56 | </view> |
| 56 | <view class="text-df" wx:if="{{hasShowRule}}"> | 57 | <view class="text-df" wx:if="{{hasShowRule}}"> |
| 57 | - <text>123123</text> | 58 | + <text style="line-height: 40rpx;">{{foods_info.use_notice}}</text> |
| 58 | </view> | 59 | </view> |
| 59 | <view class="flex justify-center align-center rule margin-top-sm margin-bottom-sm" bindtap="toggleRule"> | 60 | <view class="flex justify-center align-center rule margin-top-sm margin-bottom-sm" bindtap="toggleRule"> |
| 60 | <view class="txt-28-h">{{hasShowRule?'收起':'展开更多'}}</view> | 61 | <view class="txt-28-h">{{hasShowRule?'收起':'展开更多'}}</view> |
| @@ -730,13 +730,13 @@ | @@ -730,13 +730,13 @@ | ||
| 730 | { | 730 | { |
| 731 | "name": "pages/taocan/order", | 731 | "name": "pages/taocan/order", |
| 732 | "pathName": "pages/taocan/order", | 732 | "pathName": "pages/taocan/order", |
| 733 | - "query": "id=1", | 733 | + "query": "id=0000000011", |
| 734 | "scene": null | 734 | "scene": null |
| 735 | }, | 735 | }, |
| 736 | { | 736 | { |
| 737 | "name": "pages/taocan/orderHis", | 737 | "name": "pages/taocan/orderHis", |
| 738 | "pathName": "pages/taocan/orderHis", | 738 | "pathName": "pages/taocan/orderHis", |
| 739 | - "query": "id=1", | 739 | + "query": "id=0000000011", |
| 740 | "scene": null | 740 | "scene": null |
| 741 | } | 741 | } |
| 742 | ] | 742 | ] |
| @@ -503,6 +503,13 @@ export default { | @@ -503,6 +503,13 @@ export default { | ||
| 503 | //获取商家菜品套餐详情 | 503 | //获取商家菜品套餐详情 |
| 504 | 'App.Foodset.GetFoodsetDetail':null, | 504 | 'App.Foodset.GetFoodsetDetail':null, |
| 505 | 505 | ||
| 506 | + //JSAPI下单API【1=菜品套餐支付】 | ||
| 507 | + 'App.PayOnline.JsApiPay':{ | ||
| 508 | + openid:'openid', | ||
| 509 | + }, | ||
| 510 | + | ||
| 511 | + //根据账单ID获取账单详情 | ||
| 512 | + 'App.Foodset.GetFoodOrdersDetail':null, | ||
| 506 | 513 | ||
| 507 | //获取商家优惠对接人信息 | 514 | //获取商家优惠对接人信息 |
| 508 | 'App.Customer.GetSellerPreferentialDocking':null, | 515 | 'App.Customer.GetSellerPreferentialDocking':null, |
-
Please register or login to post a comment