Commit c05728a72cb6123eed499cc3e6bedadbfa91ac98

Authored by yiren
1 parent 8c41cce9

提前点餐

1 <!--pack-cookbook/pages/cart_new.wxml--> 1 <!--pack-cookbook/pages/cart_new.wxml-->
2 -<view style="background: rgba({{themeColor}});"> 2 +<view style="background: rgba({{themeColor}});height: 100%;">
3 <nav backgroundColor="rgba({{themeColor}})" color="rgba({{navColor}})">{{options.sellerName||'提交订单'}}</nav> 3 <nav backgroundColor="rgba({{themeColor}})" color="rgba({{navColor}})">{{options.sellerName||'提交订单'}}</nav>
4 <scroll-view class="main" style="background: rgba({{themeColor}});"> 4 <scroll-view class="main" style="background: rgba({{themeColor}});">
5 <view class="info" style="color: rgba({{textColor}});"> 5 <view class="info" style="color: rgba({{textColor}});">
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 18
19 .texts_right { 19 .texts_right {
20 font-weight: 500; 20 font-weight: 500;
21 - width: 50%; 21 + width: 60%;
22 text-align: right; 22 text-align: right;
23 } 23 }
24 24
@@ -240,7 +240,8 @@ Page({ @@ -240,7 +240,8 @@ Page({
240 cookbookObj.hasSuccess='1' 240 cookbookObj.hasSuccess='1'
241 cookbookObj.sellerName=res.data.seller.sellername; 241 cookbookObj.sellerName=res.data.seller.sellername;
242 cookbookObj.oid=res.data.id; 242 cookbookObj.oid=res.data.id;
243 - wx.redirectTo({ 243 + console.log('跳转到下单页携带参数',{...cookbookObj});
  244 + wx.navigateTo({
244 url: `/pack-cookbook/pages/success_new?cookbookObj=${JSON.stringify(cookbookObj)}`, 245 url: `/pack-cookbook/pages/success_new?cookbookObj=${JSON.stringify(cookbookObj)}`,
245 }) 246 })
246 return false; 247 return false;
@@ -47,18 +47,21 @@ Page({ @@ -47,18 +47,21 @@ Page({
47 }, 47 },
48 // 获取备注信息 48 // 获取备注信息
49 initOrder(){ 49 initOrder(){
50 - App.Advance.CreateOrder({  
51 - rid: this.data.options.rid, 50 + App.Advance.GetOrderInfo({
52 identity: this.data.options.identity, 51 identity: this.data.options.identity,
53 - status: '0,1',  
54 - openid: getApp().openid, 52 + orderid: this.data.options.oid,
55 }).then(res => { 53 }).then(res => {
56 - console.log(res.data.remark);  
57 this.setData({ 54 this.setData({
58 - notes:res.data.remark 55 + notes:res.data?res.data[0].remark:''
59 }) 56 })
60 }) 57 })
61 }, 58 },
  59 + // 在已点餐页点击返回
  60 + navEvent(){
  61 + wx.redirectTo({
  62 + url: `/pages/customer/detail_owner?id=${this.data.options.rid}`,
  63 + })
  64 + },
62 // 过滤数据 65 // 过滤数据
63 formatCookList(list) { 66 formatCookList(list) {
64 // 获取所有的规格 67 // 获取所有的规格
1 <!--pack-cookbook/pages/success_new.wxml--> 1 <!--pack-cookbook/pages/success_new.wxml-->
2 -<view style="background: rgba({{themeColor}});">  
3 - <nav backgroundColor="rgba({{themeColor}})" color="rgba({{navColor}})">{{options.sellerName}}</nav> 2 +<view style="background: rgba({{themeColor}});height: 100%;">
  3 + <nav back="none" bindNavEvent="navEvent" backgroundColor="rgba({{themeColor}})" color="rgba({{navColor}})">{{options.sellerName}}</nav>
4 <scroll-view class="main" style="background: rgba({{themeColor}});"> 4 <scroll-view class="main" style="background: rgba({{themeColor}});">
5 <view class="box"> 5 <view class="box">
6 <view class="info" style="color: rgba({{textColor}});"> 6 <view class="info" style="color: rgba({{textColor}});">
@@ -62,7 +62,12 @@ Page({ @@ -62,7 +62,12 @@ Page({
62 } 62 }
63 }) 63 })
64 }, 64 },
65 - 65 + //返回我的订单页面
  66 + navEvent(){
  67 + wx.redirectTo({
  68 + url: '/pages/me/list',
  69 + })
  70 + },
66 /** 71 /**
67 * 生命周期函数--监听页面初次渲染完成 72 * 生命周期函数--监听页面初次渲染完成
68 */ 73 */
@@ -221,13 +226,18 @@ Page({ @@ -221,13 +226,18 @@ Page({
221 }, 226 },
222 cookbook() { 227 cookbook() {
223 if (this.data.detail.order && this.data.detail.order.cookbooklist.length > 0) { 228 if (this.data.detail.order && this.data.detail.order.cookbooklist.length > 0) {
224 - wx.navigateTo({  
225 - url: util.http_build_query({  
226 - rid: this.id,  
227 - oid: this.data.detail.order.id,  
228 - identity: 1  
229 - }, '/pack-cookbook/pages/success_new')  
230 - }); 229 + let cookbookObj = {
  230 + rid: this.id,
  231 + oid: this.data.detail.order.id,
  232 + sellerName:this.detail.seller.sellername,
  233 + sid:this.detail.seller.id,
  234 + identity: '1',
  235 + hasSuccess:'1',
  236 + }
  237 + console.log('跳转到下单页携带参数',{...cookbookObj});
  238 + wx.navigateTo({
  239 + url: `/pack-cookbook/pages/success_new?cookbookObj=${JSON.stringify(cookbookObj)}`,
  240 + })
231 } else { 241 } else {
232 App.Advance.CreateOrder({ 242 App.Advance.CreateOrder({
233 rid: this.id, 243 rid: this.id,
@@ -241,8 +251,9 @@ Page({ @@ -241,8 +251,9 @@ Page({
241 rid: this.id, 251 rid: this.id,
242 oid: res.data.id, 252 oid: res.data.id,
243 identity: 1, 253 identity: 1,
244 - sid: res.data.sellerid  
245 - }, '/pack-cookbook/pages/index_news') 254 + sid:this.detail.sid,
  255 + sellerName: this.detail.seller.sellername,
  256 + }, '/pack-cookbook/pages/index_new')
246 }); 257 });
247 }) 258 })
248 } 259 }
1 <!--pages/customer/detail_owner.wxml--> 1 <!--pages/customer/detail_owner.wxml-->
2 -<nav hasHome>订座详情</nav> 2 +<nav back="none" bindNavEvent="navEvent">订座详情</nav>
3 <page loading="{{loading}}"> 3 <page loading="{{loading}}">
4 <view class="view flex justify-start subscribe-tips align-center" wx:if="{{!subscribeHide && (detail.hasRunning || detail.status==0)}}"> 4 <view class="view flex justify-start subscribe-tips align-center" wx:if="{{!subscribeHide && (detail.hasRunning || detail.status==0)}}">
5 <view class="view flex-treble flex align-center"> 5 <view class="view flex-treble flex align-center">
@@ -206,15 +206,17 @@ Page({ @@ -206,15 +206,17 @@ Page({
206 }, 206 },
207 cookbook() { 207 cookbook() {
208 if (this.data.detail.order && this.data.detail.order.cookbooklist.length > 0) { 208 if (this.data.detail.order && this.data.detail.order.cookbooklist.length > 0) {
  209 + let cookbookObj = {
  210 + rid: this.id,
  211 + oid: this.data.detail.order.id,
  212 + sellerName: this.data.seller.name,
  213 + sid: this.data.seller.sid,
  214 + identity: '1',
  215 + hasSuccess:'1',
  216 + }
209 wx.navigateTo({ 217 wx.navigateTo({
210 - url: util.http_build_query({  
211 - rid: this.id,  
212 - oid: this.data.detail.order.id,  
213 - sellerName: this.data.seller.name,  
214 - sid: this.data.seller.sid,  
215 - identity: '1',  
216 - }, '/pack-cookbook/pages/success_new')  
217 - }); 218 + url: `/pack-cookbook/pages/success_new?cookbookObj=${JSON.stringify(cookbookObj)}`,
  219 + })
218 } else { 220 } else {
219 App.Advance.CreateOrder({ 221 App.Advance.CreateOrder({
220 rid: this.id, 222 rid: this.id,
@@ -695,4 +695,11 @@ export default { @@ -695,4 +695,11 @@ export default {
695 'App.Cookbook.GetCookbookByClass':{ 695 'App.Cookbook.GetCookbookByClass':{
696 openid:'openid' 696 openid:'openid'
697 }, 697 },
  698 +
  699 + // 获取提前点餐订单详情
  700 + 'App.Advance.GetOrderInfo':{
  701 + openid:'openid'
  702 + },
  703 +
  704 +
698 } 705 }