Commit edb89d9d97ef4b7f5290654c4510fbe62cb33783

Authored by pengye
1 parent 92144b5f

APP商家端排菜分享小程序显示

... ... @@ -149,6 +149,7 @@ Page({
data.sellerName=that.data.opt.sellerName;
data.oid=that.data.opt.oid;
data.hasSuccess='1'
data.type='1'
data.rid=that.data.opt.rid?that.data.opt.rid:''
url = `/pack-cookbook/pages/success_new?hasSuccess=${data.hasSuccess}&identity=${data.identity}&oid=${data.oid}&rid=${data.rid}&sellerName=${data.sellerName}&sid=${data.sid}`;
}
... ... @@ -344,6 +345,7 @@ Page({
data.sellerName=this.data.opt.sellerName;
data.hasSuccess='1';
data.identity='1';
data.type='1'
data.rid=this.data.opt.rid?this.data.opt.rid:''
let url = `/pack-cookbook/pages/success_new?hasSuccess=${data.hasSuccess}&identity=${data.identity}&oid=${data.oid}&rid=${data.rid}&sellerName=${data.sellerName}&sid=${data.sid}`;
return wx.reLaunch({
... ...
... ... @@ -340,7 +340,7 @@ Page({
remark:this.data.notes+''
}).then(res => {
wx.navigateTo({
url: `/pack-cookbook/pages/success_new?hasSuccess=${data.hasSuccess}&identity=${data.identity}&oid=${data.oid}&rid=${data.rid}&sellerName=${data.sellerName}&sid=${data.sid}`
url: `/pack-cookbook/pages/success_new?hasSuccess=${data.hasSuccess}&type=1&identity=${data.identity}&oid=${data.oid}&rid=${data.rid}&sellerName=${data.sellerName}&sid=${data.sid}`
})
})
}
... ...
... ... @@ -251,7 +251,7 @@ Page({
data.oid=res.data.id;
console.log('跳转到下单页携带参数',{...data});
wx.navigateTo({
url: `/pack-cookbook/pages/success_new?hasSuccess=${data.hasSuccess}&identity=${data.identity}&oid=${data.oid}&rid=${data.rid}&sellerName=${data.sellerName}&sid=${data.sid}`,
url: `/pack-cookbook/pages/success_new?hasSuccess=${data.hasSuccess}&type=1&identity=${data.identity}&oid=${data.oid}&rid=${data.rid}&sellerName=${data.sellerName}&sid=${data.sid}`,
})
return false;
}
... ...
... ... @@ -31,7 +31,7 @@ Page({
let originalWidth = e.detail.width;
let originalHeight = e.detail.height;
let imageSize = util.imageZoomHeightUtil(originalWidth,originalHeight);
let imageHeight = `cookbooklist[${indexs}].cookbooklist[0][${index}].norms[${idx}].imageHeight`;
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,
... ... @@ -49,6 +49,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let cookbooklist=util.determine(options.cookbooklist)
this.setData({
options:{
rid:options.rid,
... ... @@ -56,16 +57,69 @@ Page({
sellerName:options.sellerName,
sid:options.sid,
identity:options.identity,
hasSuccess:options.hasSuccess
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
});
this.getCheckCookList()
this.getDetail()
this.initOrder()
console.log('type=2 cookbooklist',cookbooklist);
if(options.type=='2'){
this.getCookbooklist(cookbooklist)
this.getDetail()
this.GetDzSellerConfFun()
}else{
this.getDetail()
this.initOrder()
this.getCheckCookList()
}
},
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(){
... ... @@ -308,7 +362,7 @@ Page({
this.setData({
cookbooklist
})
this.getNewRechargeListfFun();
this.getNewRechargeListfFun(this.data.probablyPrice);
})
this.GetDzSellerConfFun()
},
... ... @@ -417,7 +471,7 @@ Page({
})
},
// 获取充值列表信息
getNewRechargeListfFun() {
getNewRechargeListfFun(probablyPrice) {
App.Activity.GetNewRechargeList({
sellerid: this.data.options.sid,
is_expire: '0'
... ... @@ -436,7 +490,7 @@ Page({
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,this.data.probablyPrice)
let item=this.findClosest(list,probablyPrice)
let rechargeList=[];
item?rechargeList.push(item):'';
this.setData({
... ... @@ -471,11 +525,16 @@ Page({
...this.data.options,
hasOnlyShow: 1
};
console.log(data);
delete data.hasSuccess
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: `/pack-cookbook/pages/success_new?hasSuccess=${data.hasSuccess}&identity=${data.identity}&oid=${data.oid}&rid=${data.rid}&sellerName=${data.sellerName}&sid=${data.sid}`,
path,
imageUrl: 'http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148571.jpg',
}
},
... ...
... ... @@ -13,66 +13,116 @@
</view>
<view class="info" style="color: rgba({{textColor}});">
<view class="texts font28r">就餐人数:</view>
<view class="texts font28r">{{seller.tableNum}}</view>
<view class="texts_right font28r">{{seller.tableNum}}</view>
</view>
<view class="info" wx:if="{{options.type=='2'}}" style="color: rgba({{textColor}});">
<view class="texts font28r">排菜单名称:</view>
<view class="texts_right font28r">{{options.name}}</view>
</view>
<view class="info" wx:if="{{options.type=='2'}}" style="color: rgba({{textColor}});">
<view class="texts font28r">餐厅地址:</view>
<view class="texts_right font28r">{{options.address}}</view>
</view>
<view class="info" wx:if="{{options.type=='2'}}" style="color: rgba({{textColor}});">
<view class="texts font28r">专属服务:</view>
<view class="texts_right font28r">{{options.service}}</view>
</view>
<view class="info" style="color: rgba({{textColor}});">
<view class="texts font28r">备注信息:</view>
<view class="texts font28r">{{notes?notes:''}}</view>
<view class="texts_right font28r">{{(options.type=='2' && options.remark)?options.remark:(options.type=='1' && notes)?notes:''}}</view>
</view>
<image class="imgs" src="https://qn.colorcun.com/001.png" mode="" />
</view>
<view class="checkMenu">
<block wx:for="{{cookbooklist}}" wx:key="id" wx:for-index="indexs">
<view class="heand flex-cc" wx:if="{{item.is_show}}">
<view class="heand flex-cc" wx:if="{{options.type=='2' || item.is_show}}">
<view class="style_round flex-cc">
<view class="round"></view>
<view class="line"></view>
</view>
<view class="title" style="color:rgba({{textColor}})">{{item.class_name}} <view>{{item.normsLen}}道</view></view>
<view class="title" style="color:rgba({{textColor}})">{{item.class_name}} <view>{{options.type=='2'?item.cookbooklist.length:item.normsLen}}道</view></view>
<view class="style_round flex-cc">
<view class="line"></view>
<view class="round"></view>
</view>
</view>
<block wx:for="{{item.cookbooklist[0]}}" wx:key="id" wx:for-index="index" wx:key="id" >
<block wx:if="{{item.norms.length>0}}">
<view wx:for="{{item.norms}}" wx:for-index="idx" wx:key="id" class="normsBox">
<view class="content">
<view class="single" style="color: rgba({{textColor}});">{{item.cookName}}<text wx:if="{{item.name}}">({{item.name}})</text></view>
<view wx:if="{{is_show_price!='0'}}" class="onwBoxWrap">
<view class="oneBox" style="color: rgba({{textColor}});" wx:for="{{item.specArr}}" wx:key="id">
<view wx:if="{{item.str}}">{{item.str}}</view>
<view wx:if="{{item.member_str}}">{{item.member_str}}</view>
<block wx:if="{{options.type=='2'}}">
<block wx:for="{{item.cookbooklist}}" wx:key="id" wx:for-index="index" wx:key="id" >
<block wx:if="{{item.amount>0}}">
<view class="normsBox">
<view class="content">
<view class="single" style="color: rgba({{textColor}});">{{item.name}}<text wx:if="{{item.practiceName}}">({{item.practiceName}})</text></view>
<view wx:if="{{is_show_price!='0'}}" class="onwBoxWrap">
<view class="oneBox" style="color: rgba({{textColor}});" wx:for="{{item.specArr}}" wx:key="id">
<view wx:if="{{item.str}}">{{item.str}}</view>
<view wx:if="{{item.member_str}}" class="margLeft">{{item.member_str}}</view>
</view>
</view>
</view>
<view wx:else class="onwBoxWrap">
<view class="oneBox" style="color: rgba({{textColor}});">
<view wx:if="{{item.taste}}" class="font26r">味型:{{item.taste}}</view>
<view wx:if="{{item.cooks}}" class="font26r">烹调:{{item.cooks}}</view>
<view wx:else class="onwBoxWrap">
<view class="oneBox" style="color: rgba({{textColor}});">
<view wx:if="{{item.taste}}" class="font26r">味型:{{item.taste}}</view>
<view wx:if="{{item.cooks}}" class="font26r">烹调:{{item.cooks}}</view>
</view>
</view>
</view>
<view wx:if="{{(is_show_price=='1' || !is_show_price) && (item.taste || item.cooks)}}" class="dishTexts" style="color:rgba({{textColor}})">
<text wx:if="{{item.taste}}" class="texts">味型:{{item.taste}}</text>
<text wx:if="{{item.cooks}}">烹调:{{item.cooks}}</text>
</view>
<view class="imgOneBox">
<image wx:if="{{item.image}}" catch:tap="preview" style="height: {{item.imageHeight>height?height+'px':item.imageHeight+'px'}};width: {{item.imageHeight>height?'':item.imageHeight==height?'100%':'100%'}}" mode="{{(item.imageHeight>height || item.imageHeight==height)?'aspectFit':''}}" src="{{item.image}}" bindload="imageLoad" data-item="{{item}}" data-index="{{index}}" data-indexs="{{indexs}}" data-idx="{{idx}}" />
</view>
<view class="countNum">
<view class="num">{{item.amount}}</view>
<view class="text texts" wx:if="{{item.specsName}}" style="color: rgba({{textColor}});">{{item.specsName}}</view>
<view class="text" wx:if="{{item.practiceName}}" style="color: rgba({{textColor}});">{{item.practiceName}}</view>
</view>
</view>
<view wx:if="{{(is_show_price=='1' || !is_show_price) && (item.taste || item.cooks)}}" class="dishTexts" style="color:rgba({{textColor}})">
<text wx:if="{{item.taste}}" class="texts">味型:{{item.taste}}</text>
<text wx:if="{{item.cooks}}">烹调:{{item.cooks}}</text>
</view>
<view class="imgOneBox">
<image wx:if="{{item.image}}" catch:tap="preview" style="height: {{item.imageHeight>height?height+'px':item.imageHeight+'px'}};width: {{item.imageHeight>height?'':item.imageHeight==height?'100%':'100%'}}" mode="{{(item.imageHeight>height || item.imageHeight==height)?'aspectFit':''}}" src="{{item.image}}" bindload="imageLoad" data-item="{{item}}" data-index="{{index}}" data-indexs="{{indexs}}" data-idx="{{idx}}" />
</view>
<view class="countNum">
<view class="num">{{item.count}}</view>
<view class="text texts" wx:if="{{item.specs || item.unit}}" style="color: rgba({{textColor}});">{{item.specs?item.specs:item.unit}}</view>
<view class="text" wx:if="{{item.specs || item.name}}" style="color: rgba({{textColor}});">{{item.name?item.name:''}}</view>
</block>
</block>
</block>
<block wx:else>
<block wx:for="{{item.cookbooklist[0]}}" wx:key="id" wx:for-index="index" wx:key="id" >
<block wx:if="{{item.norms.length>0}}">
<view wx:for="{{item.norms}}" wx:for-index="idx" wx:key="id" class="normsBox">
<view class="content">
<view class="single" style="color: rgba({{textColor}});">{{item.cookName}}<text wx:if="{{item.name}}">({{item.name}})</text></view>
<view wx:if="{{is_show_price!='0'}}" class="onwBoxWrap">
<view class="oneBox" style="color: rgba({{textColor}});" wx:for="{{item.specArr}}" wx:key="id">
<view wx:if="{{item.str}}">{{item.str}}</view>
<view wx:if="{{item.member_str}}" class="margLeft">{{item.member_str}}</view>
</view>
</view>
<view wx:else class="onwBoxWrap">
<view class="oneBox" style="color: rgba({{textColor}});">
<view wx:if="{{item.taste}}" class="font26r">味型:{{item.taste}}</view>
<view wx:if="{{item.cooks}}" class="font26r">烹调:{{item.cooks}}</view>
</view>
</view>
</view>
<view wx:if="{{(is_show_price=='1' || !is_show_price) && (item.taste || item.cooks)}}" class="dishTexts" style="color:rgba({{textColor}})">
<text wx:if="{{item.taste}}" class="texts">味型:{{item.taste}}</text>
<text wx:if="{{item.cooks}}">烹调:{{item.cooks}}</text>
</view>
<view class="imgOneBox">
<image wx:if="{{item.image}}" catch:tap="preview" style="height: {{item.imageHeight>height?height+'px':item.imageHeight+'px'}};width: {{item.imageHeight>height?'':item.imageHeight==height?'100%':'100%'}}" mode="{{(item.imageHeight>height || item.imageHeight==height)?'aspectFit':''}}" src="{{item.image}}" bindload="imageLoad" data-item="{{item}}" data-index="{{index}}" data-indexs="{{indexs}}" data-idx="{{idx}}" />
</view>
<view class="countNum">
<view class="num">{{item.count}}</view>
<view class="text texts" wx:if="{{item.specs || item.unit}}" style="color: rgba({{textColor}});">{{item.specs?item.specs:item.unit}}</view>
<view class="text" wx:if="{{item.specs || item.name}}" style="color: rgba({{textColor}});">{{item.name?item.name:''}}</view>
</view>
</view>
</view>
</block>
</block>
</block>
</block>
</view>
<view style="background-color: #fff;margin:0 20rpx;padding-top: 20rpx;">
<view class="probably flex-ll">
<view class="tariff font24r">菜单价:<text class="font32r">{{probablyPrice}}</text>元</view>
<view class="tariff font24r">会员价:<text class="font32r">{{vipProbablyPrice}}</text>元</view>
<view class="tariff font24r">菜单价:<text class="font28r">{{options.type=='2'?options.priceSum:probablyPrice}}</text>元</view>
<view class="tariff font24r">会员价:<text class="font28r">{{options.type=='2'?options.memberPriceSum:vipProbablyPrice}}</text>元</view>
<view class="tariff font24r" wx:if="{{options.type=='2' && options.planPriceSum}}">排菜价:<text class="font28r">{{options.planPriceSum}}</text>元</view>
</view>
<view class="information font36r">特别优惠</view>
<view class="poop font24r">根据您选择的菜品,我们推荐您参加以下活动,本次消费可用,预计可以节约大笔开销!</view>
... ... @@ -110,8 +160,8 @@
周到安排提供技术支持 400-000-9690
</view>
</scroll-view>
<view class="btns flex-cc" wx:if="{{options.hasSuccess==1}}">
<button class="font32r continue flex-cc" style="background: rgba({{themeColor}});color: rgba({{textColor}});" bindtap="continueOrdering">菜品更换</button>
<button class="font32r determine flex-cc" open-type="share">分享菜单</button>
<view class="btns flex-cc">
<button wx:if="{{options.hasSuccess==1 && options.type=='1'}}" class="font32r continue flex-cc" style="background: rgba({{themeColor}});color: rgba({{textColor}});" bindtap="continueOrdering">菜品更换</button>
<button wx:if="{{options.hasSuccess==1}}" class="font32r determine flex-cc {{options.type=='2'?'onebtns':''}}" open-type="share">分享菜单</button>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -18,8 +18,8 @@
.texts_right {
font-weight: 500;
width: 50%;
text-align: right;
width: 57%;
}
.info input {
... ... @@ -66,7 +66,7 @@
color: #000;
background: #fff;
font-family: PingFang SC;
padding: 30rpx 40rpx 52rpx 40rpx;
padding: 30rpx 0 52rpx 0;
margin: 0 20rpx;
}
... ... @@ -329,4 +329,10 @@
}
.countNum .texts{
margin: 0 20rpx;
}
.margLeft{
margin-left: 20rpx;
}
.btns .onebtns{
width: 100%;
}
\ No newline at end of file
... ...
... ... @@ -710,4 +710,9 @@ export default {
'App.GuestManage.SetGuestInfo':{
openid:'openid'
},
// 预定ID获取排菜
'App.PlanCook.GetPlanCookByRid':{
openid:'openid'
},
}
\ No newline at end of file
... ...