Commit e7be9f188d87a78be1ad35667ffd2c13f7fa45ac

Authored by wangfan
1 parent b3db6190

提前点餐调整

@@ -65,6 +65,7 @@ Page({ @@ -65,6 +65,7 @@ Page({
65 res.data.cookbooklist=cookbooklist; 65 res.data.cookbooklist=cookbooklist;
66 this.setData({ 66 this.setData({
67 order: res.data, 67 order: res.data,
  68 + openid:getApp().openid,
68 }) 69 })
69 }) 70 })
70 }, 71 },
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 </view> 24 </view>
25 <view class="footer"> 25 <view class="footer">
26 <view class="total">共计:¥{{order.price}}</view> 26 <view class="total">共计:¥{{order.price}}</view>
27 - <view class="infos"> 27 + <view class="infos" wx:if="{{openid==order.openid && openid}}">
28 <view class="flex-lr item"> 28 <view class="flex-lr item">
29 <view class="item-label">人数:</view> 29 <view class="item-label">人数:</view>
30 <view> 30 <view>
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
41 </view> 41 </view>
42 </formids> 42 </formids>
43 </view> 43 </view>
44 - <formids class="submit" bindclick="submitOrder"> 44 + <formids class="submit" bindclick="submitOrder" wx:if="{{openid==order.openid && openid}}">
45 <view class="submit">确认下单</view> 45 <view class="submit">确认下单</view>
46 </formids> 46 </formids>
47 </view> 47 </view>
@@ -48,10 +48,21 @@ Page({ @@ -48,10 +48,21 @@ Page({
48 App.Advance.CreateOrder({ 48 App.Advance.CreateOrder({
49 rid: this.data.options.rid, 49 rid: this.data.options.rid,
50 identity:this.data.options.identity, 50 identity:this.data.options.identity,
51 - status:'0,1' 51 + status:'0,1',
  52 + openid:getApp().openid,
52 }).then(res => { 53 }).then(res => {
53 let orderItemCount=0; 54 let orderItemCount=0;
54 res.data.cookbooklist.forEach(cb=>{ 55 res.data.cookbooklist.forEach(cb=>{
  56 + if(this.data.options.identity==1 && cb.status>0){
  57 + wx.redirectTo({
  58 + url:util.http_build_query({
  59 + rid:this.data.options.rid,
  60 + oid:res.data.id,
  61 + identity:1
  62 + },'/pack-cookbook/pages/success')
  63 + });
  64 + return false;
  65 + }
55 orderItemCount+=parseInt(cb.num) 66 orderItemCount+=parseInt(cb.num)
56 }) 67 })
57 this.setData({ 68 this.setData({
@@ -8,9 +8,11 @@ @@ -8,9 +8,11 @@
8 <view class="title Medium">订单提交成功</view> 8 <view class="title Medium">订单提交成功</view>
9 <view class="optx flex-vc"> 9 <view class="optx flex-vc">
10 <view class="opt-view flex-ll"> 10 <view class="opt-view flex-ll">
11 - <formids bindclick="gotoEditor" class="width:50%;"> 11 +
  12 + <formids bindclick="gotoEditor" class="width:50%;" wx:if="{{options.identity==2}}">
12 <view class="but editor" style="width: 100%;">修改菜品</view> 13 <view class="but editor" style="width: 100%;">修改菜品</view>
13 </formids> 14 </formids>
  15 +
14 <button class="but share button-none" open-type="share">分享</button> 16 <button class="but share button-none" open-type="share">分享</button>
15 </view> 17 </view>
16 </view> 18 </view>
@@ -81,7 +83,7 @@ @@ -81,7 +83,7 @@
81 <view style="height: 150rpx;width: 100%;"></view> 83 <view style="height: 150rpx;width: 100%;"></view>
82 <view class="optx flex-vc" wx:if="{{options.hasSuccess!=1 && options.hasOnlyShow!=1}}"> 84 <view class="optx flex-vc" wx:if="{{options.hasSuccess!=1 && options.hasOnlyShow!=1}}">
83 <view class="opt-view flex-ll"> 85 <view class="opt-view flex-ll">
84 - <formids bindclick="gotoEditor" class="width:50%;"> 86 + <formids bindclick="gotoEditor" class="width:50%;" wx:if="{{options.identity==2}}">
85 <view class="but editor" style="width: 100%;">修改菜品</view> 87 <view class="but editor" style="width: 100%;">修改菜品</view>
86 </formids> 88 </formids>
87 <button class="but share button-none" open-type="share">分享</button> 89 <button class="but share button-none" open-type="share">分享</button>
@@ -120,9 +120,10 @@ @@ -120,9 +120,10 @@
120 text-align: center; 120 text-align: center;
121 121
122 } 122 }
123 -.opt-view .but:first-child{ 123 +.opt-view .editor{
124 border-right: 2rpx solid #979797; 124 border-right: 2rpx solid #979797;
125 } 125 }
  126 +
126 .pages .optx{ 127 .pages .optx{
127 position: relative; 128 position: relative;
128 background-color: #fefefe; 129 background-color: #fefefe;
@@ -214,6 +214,7 @@ Page({ @@ -214,6 +214,7 @@ Page({
214 }else{ 214 }else{
215 App.Advance.CreateOrder({ 215 App.Advance.CreateOrder({
216 rid:this.id, 216 rid:this.id,
  217 + openid:getApp().openid,
217 }).then(res=>{ 218 }).then(res=>{
218 if(res.ret!=200){ 219 if(res.ret!=200){
219 return util.toast(res.msg,'none') 220 return util.toast(res.msg,'none')
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 "list": [] 31 "list": []
32 }, 32 },
33 "miniprogram": { 33 "miniprogram": {
34 - "current": 45, 34 + "current": 40,
35 "list": [ 35 "list": [
36 { 36 {
37 "id": 0, 37 "id": 0,
@@ -302,7 +302,7 @@ @@ -302,7 +302,7 @@
302 "name": "pack-cookbook/pages/success", 302 "name": "pack-cookbook/pages/success",
303 "pathName": "pack-cookbook/pages/success", 303 "pathName": "pack-cookbook/pages/success",
304 "query": "rid=1196&oid=1&identity=1&hasSuccess=1", 304 "query": "rid=1196&oid=1&identity=1&hasSuccess=1",
305 - "scene": "1001" 305 + "scene": 1001
306 }, 306 },
307 { 307 {
308 "id": -1, 308 "id": -1,
@@ -340,7 +340,7 @@ @@ -340,7 +340,7 @@
340 "id": 40, 340 "id": 40,
341 "name": "邀请Ren pages/customer/index ", 341 "name": "邀请Ren pages/customer/index ",
342 "pathName": "pages/customer/detail_owner_invitation", 342 "pathName": "pages/customer/detail_owner_invitation",
343 - "query": "id=3672&fromid=test&hasInvitation=1&hasSellerShare=1", 343 + "query": "id=6158&fromid=test&hasInvitation=1&hasSellerShare=1",
344 "scene": null 344 "scene": null
345 }, 345 },
346 { 346 {