success_new.js 26.6 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676
// pack-cookbook/pages/success_new.js
import App from '../../utils/api';
import util from '../../utils/util';
import RS from '../../utils/reserveStatus'
import TP from '../../utils/tpls';
Page({
    /**
     * 页面的初始数据
     */
    data: {
        cookbooklist: [],
        probablyPrice: '',
        vipProbablyPrice: '',
        notes: '',
        tpls: [],
        reserev:{},
        seller: {},
        options: {},
        rechargeList:[],
        textsInfoColor:'',
        themeColor:'',
        textColor:'',
        navColor:'',
        height:wx.getSystemInfoSync().windowWidth*1,
        is_show_price:'',
        changeType:'1',//1不允许修改 2开餐1小时之前 3开餐2小时之前 4预订日期1天前 5预订日期2天前
    },
    myToast :'',
    imageLoad(e) {
      const index = e.currentTarget.dataset['index'];
      const indexs = e.currentTarget.dataset['indexs'];
      const idx = e.currentTarget.dataset['idx'];
      //获取图片的原始宽度和高度 
      let originalWidth = e.detail.width; 
      let originalHeight = e.detail.height; 
      let imageSize = util.imageZoomHeightUtil(originalWidth,originalHeight); 
      let imageHeight = this.data.options.type=='2'?`cookbooklist[${indexs}].cookbooklist[${index}].imageHeight`:`cookbooklist[${indexs}].cookbooklist[0][${index}].norms[${idx}].imageHeight`;
      let height=(imageSize && imageSize.imageHeight)?imageSize.imageHeight.toFixed(0):'';
      this.setData({
        [imageHeight]:height,
      }) 
    },
    preview(event){
      const item = event.currentTarget.dataset['item'];
      let currentUrl = item.image
      wx.previewImage({
        current: currentUrl, // 当前显示图片的http链接
        urls: [currentUrl] // 需要预览的图片http链接列表
      })
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        let cookbooklist=util.determine(options.cookbooklist)
        this.setData({
            options:{
              rid:options.rid,
              oid:options.oid,
              sellerName:options.sellerName,
              sid:options.sid,
              identity:options.identity,    
              hasSuccess:options.hasSuccess,
              type:options.type?options.type:'1',//type 1提前点餐分享  2排菜分享
              priceSum:options.priceSum?options.priceSum:'',
              memberPriceSum:options.memberPriceSum?options.memberPriceSum:'',
              planPriceSum:options.planPriceSum?options.planPriceSum:'',
              remark:options.remark?options.remark:'',
              name:options.name?options.name:'',
              address:options.address?options.address:'',
              service:options.service?options.service:'',
            },
            tpls: [TP.tpls(1)],
            cookbooklistOld:cookbooklist
        })
        console.log('options', {
            ...options
        });
        console.log('type=2 cookbooklist',cookbooklist);
        if(options.type=='2'){
            this.getCookbooklist(cookbooklist)
            this.getDetail()
            this.GetDzSellerConfFun()
        }else{
            this.getDetail()
            this.initOrder()
            this.getCheckCookList()
        }
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {
        this.myToast = this.selectComponent("#myToast")
    },
    getCookbooklist(cookbooklist){
        cookbooklist.forEach(i => {
            i.cookbooklist.forEach(j => {
                if (j.amount && j.amount > 0) {
                    j.imageHeight='';
                    if(j.amountHasOrderList && j.amountHasOrderList.length>0 && j.amountHasOrderList[0] && j.amountHasOrderList[0]['specModel']){
                        j.specsName=j.amountHasOrderList[0]['specModel'].specs;
                    }
                    if(j.amountHasOrderList && j.amountHasOrderList.length>0 && j.amountHasOrderList[0] && j.amountHasOrderList[0]['practiceModel']){
                        j.practiceName=j.amountHasOrderList[0]['practiceModel'].name;
                    }
                    j.specArr = []
                    let obj = {}
                    if (j.spec && j.spec.length > 0) {
                        j.spec.forEach(single => {
                            if (single.status == '1') {
                                obj = {
                                    str: '¥' + single.price + '/' + single.specs,
                                    member_str: (single.member_price && single.member_price!='0') ? '  会员¥' + single.member_price + '/' + single.specs : '',
                                }
                                j.specArr.push(obj)
                            }
                        })
                    }
                    this.getNewRechargeListfFun(this.data.options.priceSum);
                    i.is_show = true
                } else {
                    i.is_show = false
                }
            })
        })
        console.log('type=2改变后的cookbooklist',cookbooklist);
        this.setData({
            noData: true,
            cookbooklist
        })
    },
    // 获取备注信息
    initOrder(){
        App.Advance.GetOrderInfo({
            identity: this.data.options.identity,
            orderid: this.data.options.oid,
        }).then(res => {
            this.setData({
                notes:res.data?res.data[0].remark:''
            })
        })
    },
    // 在已点餐页点击返回
    navEvent(){
        wx.redirectTo({
          url: `/pages/customer/detail_owner?id=${this.data.options.rid}`,
        })
    },
    // 过滤数据
    formatCookList(list) {
        // 获取所有的规格
        list.forEach(item => {
            item.cookbooklist[0].forEach((i, idx) => {
                i.specArr = []
                let obj = {}
                if (i.spec && i.spec.length > 0) {
                    i.spec.forEach(single => {
                        if (single.status == '1') {
                            obj = {
                                cid: single.cid,
                                clear_num: single.clear_num,
                                id: single.id,
                                member_price: (single.member_price && single.member_price!='0')?single.member_price:single.price,
                                price: single.price,
                                specid: single.specid,
                                specs: single.specs,
                                status: single.status,
                                str: '¥' + single.price + '/' + single.specs,
                                member_str: (single.member_price && single.member_price!='0') ? '会员  ¥' + single.member_price + '/' + single.specs : '',
                            }
                            i.specArr.push(obj)
                        }
                    })
                }
            })
        })
        // 排序
        let sortArr = []
        list.forEach(item => {
            item.cookbooklist[0].sort((a, b) => {
                return a.order_o - b.order_o
            })
            sortArr.push(item)
        })
        //原栏目下显示
        let hasShowClass = false;
        //菜单中展示沽清的菜品
        let hasClearCookbook = false;
        //十道必选菜
        let has10CaiOpen = false;
        let flist = [];
        let assortArr = [];
        let check1 = '';
        let check2 = '';
        if (sortArr.length > 0) {
            has10CaiOpen = list[0].status == 1;
            sortArr.forEach(function (cate, i) {
                let num = 0;
                let obj = {
                    class_name: cate.class_name,
                    class_type: cate.class_type,
                    id: cate.id,
                    order: cate.order,
                    status: cate.status,
                }
                if (cate.status == 1 && cate.cookbooklist[0].length > 0) {
                    assortArr.push(obj)
                    let cooks = [];
                    cate.cookbooklist[0].forEach(function (cook, n) {
                        if (cook.status == 1) {
                            let flag = true;
                            if (has10CaiOpen) {
                                if (cate.class_type == 2 && !hasShowClass && flist.length > 0 && flist[0].class_type == 1) {
                                    for (let fi = 0; fi < flist[0].cookbooklist[0].length; fi++) {
                                        if (flist[0].cookbooklist[0][fi].id == cook.id) {
                                            flag = false;
                                            break;
                                        }
                                    }
                                }
                            }
                            cook.item_clear_num = cook.clear_num;
                            if (!hasClearCookbook) { //不显示卖光了
                                let item_clear_num = cook.clear_num;
                                if (cook.specArr) {
                                    let clear_num = null;
                                    cook.specArr.forEach(spec => {
                                        if (spec.clear_num == 0) {
                                            clear_num = 0;
                                        } else {
                                            clear_num = null;
                                        }
                                    })
                                    if (clear_num == 0) {
                                        item_clear_num = 0;
                                    }
                                }
                                cook.item_clear_num = item_clear_num;
                                cook.index = n; //分类下菜品的下标
                                cook.type = '1';
                                let cook_style = cook.cook_style ? util.determine(cook.cook_style) : {
                                    image_type: '1',
                                    name_type: ''
                                }; //判断是不是json,是json在转换为对象
                                cook.imageHeight=''
                                cook.cook_style = cook_style;
                                cook.image_type = cook_style && cook_style.image_type ? cook_style.image_type : '1'; //1大图,2小图  默认大图
                                cook.name_type = cook_style && cook_style.name_type ? cook_style.name_type : '3'; //1左侧,2右侧,3顶部分开  默认分开
                                cook.check1 = cook.practice.length > 0 ? cook.practice[0].id : '';
                                cook.check2 = cook.specArr.length > 0 ? cook.specArr[0].id : '';
                                cook.price = cook.specArr.length > 0 ? cook.specArr[0].price : cook.price;
                                cook.member_price = cook.specArr.length > 0 ? cook.specArr[0].member_price : cook.member_price;
                                if (item_clear_num == 0) {
                                    flag = false;
                                }
                            }
                            if (flag) {
                                cooks.push(cook);
                            }
                        }
                    })
                    if (cooks.length > 0) {
                        cate.cookbooklist[0] = cooks;
                        flist.push(cate)
                    }
                }
            })
        }
        let cookbooklist = JSON.parse(JSON.stringify(flist))
        let newArr = JSON.parse(JSON.stringify(cookbooklist))
        let num = 0
        newArr.forEach((i, u) => {
            if (i.cookbooklist.length != 0) {
                i.cookbooklist[0].forEach(j => {
                    let cook_style = j.cook_style ? j.cook_style : j.image_type
                    if (cook_style && cook_style.image_type == 2) {
                        num++
                    } else {
                        if (num % 2 != 0) {
                            let k = cookbooklist[u].cookbooklist[0].findIndex((item) => {
                                return j.id == item.id
                            })
                            if (k != -1) {
                                let temp = {
                                    boderNone: true,
                                    image_type: '2',
                                }
                                cookbooklist[u].cookbooklist[0].splice(k, 0, temp)
                            }
                        }
                        num = 0
                    }
                })
            }
        })
        this.getCookNormsList(cookbooklist)
        flist = cookbooklist;
        this.setData({
            check1,
            check2,
            assortArr
        })
        return flist;
    },
    // 加减处理已点菜的数据
    getCookNormsList(cookbooklist) {
        let probablyPrice = 0;
        let vipProbablyPrice = 0;
        cookbooklist.forEach(i => {
            i.normsLen = 0
            i.cookbooklist[0].forEach(j => {
                if (j.order_xx && j.order_xx.length > 0) {
                    let arr = j.order_xx;
                    let result = arr.reduce((obj, item) => {
                        if (item && item.status == '0') {
                            console.log('status为0,这个菜没有下单');
                            return obj;
                        }
                        let find = obj.find(i => (i.practiceid === item.practiceid && i.specid === item.specid));
                        let _d = {
                            ...item,
                            count: 1
                        };
                        find ? find.count++ : obj.push(_d);
                        return obj;
                    }, []);
                    result = result.sort((obj1, obj2) => util.objCompare(obj1, obj2, 'practiceid'))
                    j.norms = result.sort((obj1, obj2) => util.objCompare(obj1, obj2, 'specid'))
                    j.norms.forEach(n => {
                        n.id = j.id;
                        n.check2 = j.check2;
                        n.cookName = j.name;
                        n.check1 = j.check1;
                        n.unit = j.unit;
                        n.image = j.image;
                        n.specArr = j.specArr;
                        n.cooks = j.cooks;
                        n.taste = j.taste;
                        let list = j.specArr.filter(i => {
                            return i.id == n.specid
                        })
                        n.price = (list[0] && list[0].price) ? list[0].price : j.price;
                        n.member_price = (list[0] && list[0].member_price) ? list[0].member_price : j.member_price;
                        let price = n.count * 1 * (n.price * 1);
                        let vipPrice = n.count * 1 * (n.member_price * 1);
                        probablyPrice += price;
                        vipProbablyPrice += vipPrice;
                    })
                    i.normsLen += j.norms.length
                    i.is_show = true
                } else {
                    j.norms = []
                }
            })
        })
        console.log(cookbooklist);
        this.setData({
            noData: true,
            probablyPrice:probablyPrice.toFixed(2),
            vipProbablyPrice:vipProbablyPrice.toFixed(2),
        })
        return cookbooklist
    },
    // 获取点菜列表
    getCheckCookList() {
        let param = {
            sellerid: this.data.options.sid,
            identity: '1',
            orderid: this.data.options.oid,
            status: '0,1',
        };
        App.Cookbook.GetCookbookByClass(param).then(json => {
            let cookbooklist = this.formatCookList(json.data[0].list)
            this.setData({
                cookbooklist
            })
            this.getNewRechargeListfFun(this.data.probablyPrice);
        })
        this.GetDzSellerConfFun()
    },
    // 获取主题色
    GetDzSellerConfFun() {
        App.Seller.GetDzSellerConf({
            sid: this.data.options.sid
        }).then(res => {
            let themeColor, textColor, navColor,textsInfoColor;
            if (res.data.cook_style) {
                let style = util.determine(res.data.cook_style)
                if (style && style.red && style.green && style.blue && style.alpha) {
                    themeColor = style.red + ',' + style.green + ',' + style.blue + ',' + Math.floor(style.alpha)
                } else {
                    themeColor = '77,78,80,1'; //未设置 为灰色
                    navColor = "255,255,255,1"
                    textColor = '251,246,241,1'
                    textsInfoColor='153, 153, 153,1'
                }
                if (themeColor == '251,246,241,1') {
                    textColor = '0,0,0,1'
                    navColor='0,0,0,1'
                    textsInfoColor='0,0,0,1'
                } else {
                    navColor = "255,255,255,1"
                    textColor = '251,246,241,1'
                    textsInfoColor='153, 153, 153,1'
                }
            }
            this.setData({
                themeColor,
                textColor,
                navColor,
                textsInfoColor,
                is_show_price:res.data.is_show_price,
                changeType:res.data.is_allow_update,
            })
        }).catch(res => {
            themeColor = '77,78,80,1';
            navColor = "255,255,255,1"
            this.setData({
                themeColor,
                navColor
            })
        })
    },
    // 菜品更换
    continueOrdering() {
        if (this.data.changeType == '1') {
            return this.myToast.showToast('您的订单已经下达给商家,如果需要改菜需和商家确认,以免产生误解。', 3000)
        }
        let ddateStr = new Date(this.data.reserev.ddate * 1000)
        let year = ddateStr.getFullYear();
        let month = ddateStr.getMonth() + 1;
        let day = ddateStr.getDate();
        let day1 = year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day);
        // 获取日期对应的时段
        App.Seller.getMealSectionByDay({
            sellerid: this.data.options.sid,
            day: day1,
        }).then(res => {
            let data = res.data;
            let lunchDinnerList = [];
            if (data.length <= 3 && !data[0].ddate_solt) {
                data.forEach(i => {
                    if (i.mname == '早餐') {
                        lunchDinnerList.push({
                            mname: "早餐",
                            mdate: i.mdate,
                            ddate_solt: 1,
                        })
                    }
                    if (i.mname == '午餐') {
                        lunchDinnerList.push({
                            mname: "午餐",
                            mdate: i.mdate,
                            ddate_solt: 2,
                        })
                    }
                    if (i.mname == '晚餐') {
                        lunchDinnerList.push({
                            mname: "晚餐",
                            mdate: i.mdate,
                            ddate_solt: 3,
                        })
                    }
                })
            } else {
                lunchDinnerList = data;
            }
            let dur;
            const currentTimestamp = Date.now();
            let obj = lunchDinnerList.filter(i => {
                return i.ddate_solt == this.data.reserev.ddate_solt
            })
            if (obj && obj.length > 0) {
                dur = obj[0].mdate.split('-')[0];
            }
            let ddate = util.unixtoTime(this.data.reserev.ddate, 'YYYY-MM-DD');
            const dateTimeString = `${ddate}T${dur}:00`;
            const timestamp = new Date(dateTimeString).getTime();
            let times = 0;
            const oneHour = 60 * 60 * 1000; // 1小时的毫秒数
            const twoHours = 2 * oneHour; // 2小时的毫秒数
            const oneDay = 24 * 60 * 60 * 1000; // 1天的毫秒数
            const twoDays = 2 * oneDay; // 2天的毫秒数
            switch (this.data.changeType) {
                case '2':
                    times = timestamp - oneHour;
                    break;
                case '3':
                    times = timestamp - twoHours;
                    break;
                case '4':
                    times = timestamp - oneDay;
                    break;
                case '5':
                    times = timestamp - twoDays;
                    break;
            }
            if (currentTimestamp >= times) {
                return this.myToast.showToast('您的订单已经下达给商家,如果需要改菜需和商家确认,以免产生误解。', 3000)
            } else {
                let url = util.http_build_query({
                    sid: this.data.options.sid,
                    sellerName: this.data.options.sellerName,
                    rid: this.data.options.rid,
                    oid: this.data.options.oid,
                    identity: '1',
                }, '/pack-cookbook/pages/index_new')
                wx.redirectTo({
                    url
                })
            }
        })
    },
    // 点击了解更多会员优惠政策
    gotoFavourableList() {
        let url = util.http_build_query({
            sellerName: this.data.options.sellerName,
            sellerid: this.data.options.sid,
            oid: this.data.options.oid,
            rid: this.data.options.rid,
            types: '2',
        }, '/pack-cookbook/pages/favourableList')
        wx.navigateTo({
            url
        })
    },
    // 获取订单信息
    getDetail() {
        App.Reserve.Detail({
            openid: getApp().openid,
            rid: this.data.options.rid
        }).then(res => {
			let tablesText = ''; //桌子信息
			res.data.tables.forEach((t,i) => {
				tablesText+=t.rname+t.name+(i==(res.data.tables.length-1)?'':'、');
			})
            let reserev = RS.reserve(res.data)
            let dateSmart = util.unixtoTime(reserev.ddate, 'YYYY/MM/DD 星期WW HH:II');
            this.setData({
                reserev,
                seller: {
                    soltName: reserev.soltName,
                    date: dateSmart,
                    tableNum:res.data.actual_pum?res.data.actual_pum:'',
                    tablesText,
                    map_address:reserev.seller.map_address,
                }
            })
        }).catch(res => {
            console.log(res, '详情请求失败');
        })
    },
    // 获取充值列表信息
    getNewRechargeListfFun(probablyPrice) {
        App.Activity.GetNewRechargeList({
            sellerid: this.data.options.sid,
        }).then(res => {
            let arr=[]
            res.data.forEach(i=>{
                if(i.status!='1'){
                    arr.push(i)
                }
            })
            let list = arr;
            list.forEach((item,index) => {
                if(item.is_open=='0'){
                    list.splice(index,1)
                }
                item.recharge_lists = item.recharge_list ? JSON.parse(item.recharge_list) : '';
                let recharge_lists = item.recharge_lists;
                item.priceInfo = '';
                item.scoreInfo = '';
                item.certificate = '';
                if (recharge_lists.is_price == '1') item.priceInfo = '会员充值满' + item.recharge_money + '元赠送' + item.recharge_lists.price + '元余额';
                if (recharge_lists.is_score == '1') item.scoreInfo = '会员充值满' + item.recharge_money + '元赠送' + item.recharge_lists.score + '积分';
                if (recharge_lists.is_coupons == '1' && recharge_lists.coupons_names.length > 0) item.certificate = recharge_lists.coupons_names.join('、');
            })
            let item=this.findClosest(list,probablyPrice)
            let rechargeList=[];
            item?rechargeList.push(item):'';
            this.setData({
                rechargeList,
            })
        }).catch(res => {
            console.log('GetSellerTemplateConf请求失败');
        })
    },
    // 筛选出合适的充值优惠
    findClosest(list, price) {
        if (list.length == 0) {
            return false
        }
        list.sort((i, t) => i.recharge_money - t.recharge_money)
        let min = Math.abs(list[0].recharge_money - price) // 最小差值
        let cur = 0 // 当前值
        let isMax1001 = false
        list.forEach(item => {
            item.recharge_money = item.recharge_money * 1
            if (item.recharge_money >= price) {
                if (!isMax1001) {
                    min = Math.abs(item.recharge_money - price)
                    cur = item
                    isMax1001 = true
                } else {
                    if (Math.abs(item.recharge_money - price) <= min) {
                        min = Math.abs(item.recharge_money - price)
                        cur = item
                    }
                }
            } else {
                if (Math.abs(item.recharge_money - price) <= min) {
                    min = Math.abs(item.recharge_money - price)
                    cur = item
                }
            }
        })
        return cur;
    },
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {
        let data={
            ...this.data.options,
            hasOnlyShow: 1
        };
        data.hasSuccess=null
        let path;
        if(this.data.options.type=='2'){
            path=`/pack-cookbook/pages/success_new?hasSuccess=${data.hasSuccess}&identity=${data.identity}&oid=${data.oid}&rid=${data.rid}&sellerName=${data.sellerName}&sid=${data.sid}&type=2&priceSum=${data.priceSum}&memberPriceSum=${data.memberPriceSum}&planPriceSum=${data.planPriceSum}&remark=${data.remark}&cookbooklist=${JSON.stringify(this.data.cookbooklistOld)}&name=${data.name}&address=${data.address}&service=${data.service}`
        }else{
            path=`/pack-cookbook/pages/success_new?hasSuccess=${data.hasSuccess}&identity=${data.identity}&oid=${data.oid}&rid=${data.rid}&sellerName=${data.sellerName}&sid=${data.sid}&type=1`
        }
        return {
            title: '菜品已点好,快来看看都点了什么~',
            path,
            imageUrl: 'http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148571.jpg',
        }
    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },
})