Commit f2e84505af8e102ebba8291a5768695fc410cb15

Authored by wangfan
1 parent e093fb40

快速预定

... ... @@ -72,7 +72,7 @@ Page({
let val=util.val(e).trim();
if(val>0){
App.Advance.SetOrderById({
orderid:this.data.options.oid,
orderid:this.data.order.id||this.data.options.oid,
pnum:val,
})
... ... @@ -83,4 +83,14 @@ Page({
url: util.http_build_query({...this.data.order},'./remark')
})
},
submitOrder(){
App.Advance.PlaceOrder({
orderid:this.data.order.id||this.data.options.oid,
identity:this.data.options.identity,
}).then(res=>{
wx.redirectTo({
url: util.http_build_query({...this.data.options,hasSuccess:1},'./success')
})
})
},
})
\ No newline at end of file
... ...
... ... @@ -40,7 +40,7 @@
</view>
</formids>
</view>
<formids class="submit">
<formids class="submit" bindclick="submitOrder">
<view class="submit">确认下单</view>
</formids>
</view>
... ...
... ... @@ -46,6 +46,7 @@ Page({
orderItemCount+=parseInt(cb.num)
})
this.setData({
[`options.oid`]:res.data.id,
order: res.data,
orderItemCount:orderItemCount,
})
... ...
// pack-cookbook/pages/success.js
import util from '../../utils/util';
import App from '../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
moreDisplay:false,
},
/**
... ... @@ -63,7 +67,12 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {
let options={...this.data.options};
delete options.hasSuccess
return {
title:'邀你一起点菜',
path:util.http_build_query(options,'./success')
}
},
initOrder(){
... ... @@ -71,9 +80,37 @@ Page({
rid: this.data.options.rid,
identity:this.data.options.identity
}).then(res => {
res.data.cdateStr=util.unixtoTime(res.data.cdate,'YYYY-MM-DD')
let cookbooklist={};
let i=0;
let moreDisplay=true;
res.data.cookbooklist.forEach(ck=>{
if(!cookbooklist[ck.classid]){
cookbooklist[ck.classid]={'name':ck.class_name,list:[],moreDisplay:moreDisplay}
}
ck.moreDisplay=moreDisplay
cookbooklist[ck.classid].list.push(ck)
i++;
if(i>=4){
moreDisplay=false;
}
})
res.data.booklist=cookbooklist;
this.setData({
order: res.data,
})
})
},
moreDisplay(){
this.setData({
moreDisplay:!this.data.moreDisplay
})
},
gotoEditor(){
let options={...this.data.options};
delete options.hasSuccess
wx.redirectTo({
url: util.http_build_query(options,'./index')
})
}
})
\ No newline at end of file
... ...
... ... @@ -8,8 +8,10 @@
<view class="title Medium">订单提交成功</view>
<view class="optx flex-vc">
<view class="opt-view flex-ll">
<view class="but editor">修改菜品</view>
<view class="but share">分享</view>
<formids bindclick="gotoEditor" class="width:50%;">
<view class="but editor" style="width: 100%;">修改菜品</view>
</formids>
<button class="but share button-none" open-type="share">分享</button>
</view>
</view>
</view>
... ... @@ -17,34 +19,41 @@
</view>
<view class="pages">
<view class="carts">
<view class="block">
<view class="title">123123</view>
<view class="cart-body">
<view class="cart-item flex-lr" wx:for="{{[1]}}" wx:key="item.key">
<view class="icon">
<image src="{{}}"></image>
</view>
<view class="name">范德萨范德萨发{{item}}</view>
<view class="price">¥125.00/份</view>
<view class="opt">
{{item.num||10}}
</view>
<block wx:for="{{order.booklist}}" wx:key="order.booklist.key">
<view class="block" hidden="{{!moreDisplay && !item.moreDisplay}}">
<view class="title">{{item.name}}</view>
<view class="cart-body">
<block wx:for="{{item.list}}" wx:key="item.key">
<view class="cart-item flex-lr" hidden="{{!moreDisplay && !item.moreDisplay}}">
<view class="icon">
<image src="{{item.cookimage}}"></image>
</view>
<view class="name">{{item.cookname}}</view>
<view class="price">¥{{item.price}}/份</view>
<view class="opt">
{{item.num}}
</view>
</view>
</block>
</view>
</view>
</view>
</block>
</view>
<view class="total">共计:¥88</view>
<view class="moreDisplay flex-vc"
bindtap="moreDisplay"
wx:if="{{order.cookbooklist.length>4}}">{{!moreDisplay?'查看更多':'收起'}}</view>
<view class="total">共计:¥{{order.price}}</view>
</view>
<view class="hr"></view>
<view class="pages">
<view class="infos">
<view class="flex-lr item">
<view>备注:</view>
<view class="">口味、偏好等要求</view>
<view class="" style="max-width: 85%;line-height: 40rpx; ">{{order.remark||''}}</view>
</view>
<view class="flex-lr item">
<view>人数:</view>
<view class="">111</view>
<view class="">{{order.pnum||''}}</view>
</view>
</view>
</view>
... ... @@ -56,11 +65,11 @@
</view>
<view class="flex-ll item">
<view>订单编号:</view>
<view class="">22333445678</view>
<view class="">{{order.no}}</view>
</view>
<view class="flex-ll item">
<view>下单时间:</view>
<view class="">2018-07-12</view>
<view class="">{{order.cdateStr}}</view>
</view>
</view>
</view>
... ...
... ... @@ -142,4 +142,11 @@
.success .info{
font-size: 26rpx;
color:#999999
}
.moreDisplay{
height: 100rpx;
line-height: 100rpx;
color: #999999;
font-size: 28rpx;
}
\ No newline at end of file
... ...
... ... @@ -30,7 +30,7 @@
"list": []
},
"miniprogram": {
"current": 34,
"current": 35,
"list": [
{
"id": 0,
... ... @@ -299,7 +299,7 @@
"id": 35,
"name": "pack-cookbook/pages/success",
"pathName": "pack-cookbook/pages/success",
"query": "rid=1196&oid=2&identity=1&hasSuccess=1",
"query": "rid=1196&oid=1&identity=1&hasSuccess=1",
"scene": "1001"
},
{
... ...
... ... @@ -137,6 +137,8 @@ export default {
'App.Orders.GetRemarkBySellerid':{
cachetime: 300,
},
//下单
'App.Advance.PlaceOrder':null,
/**crm**/
'App.Reserve.Members':null,
... ...