Commit 324fcc3d37e67dbc214ac32197a98562529c9d57

Authored by yiren
1 parent 8d641b01

买券完成提示关注公众号,已选菜品数量

... ... @@ -67,6 +67,13 @@ Page({
this.countdown()
this.modal = this.selectComponent("#payModal"); //通过给组件所起的id调用组件
},
// 购买完成券之后关注公众号
wananchi() {
this.closeModal()
wx.navigateTo({
url: `/pages/me/wananchi?type=1&oid=${this.data.opt.detail.oid}`
})
},
showModal() {
this.modal.showModal() //调用组件中打开模态框方法
},
... ...
... ... @@ -68,12 +68,23 @@
<my-modal id="payModal" fadeStyle="slideUp" height="380px">
<view slot="modalName" class="titleModal">成功支付{{opt.totalize}}元</view>
<view slot="modalContent">
<view class="explain" wx:if="{{type=='2'}}">
您的会员充值已经在办理中,到店消费时请和收银核实,谢谢!
<block wx:if="{{type=='2'}}">
<view class="explain">
您的会员充值已经在办理中,到店消费时请和收银核实,谢谢!
</view>
<button wx:if="{{type=='2'}}" class="font32r btnsPay" bindtap="recharge">朕知道了
</button>
</block>
<view class="explain explain1" wx:else>
<view class="bottom_box">
<view class="font24r">温馨提示:</view>
<view class="font24r">1、到店消费时,请您向餐厅出示该二维码。</view>
<view class="font24r">2、从<text class="bold_box">周到安排</text>微信小程序,我的-优惠券,可以找到您的卡券。</view>
<view class="font24r">3、您也可以关注<text class="bold_box">周到安排</text>公众号,获取优惠券更多信息。</view>
<view class="font28r publicity" bindtap="wananchi">关注<text class="bold_box">周到安排</text>公众号,及时获取更多优惠券动态<view class="more" style="margin-left: 20rpx;"></view>
</view>
</view>
<button class="font32r btnsPay" bindtap="certificate">完成</button>
</view>
<button wx:if="{{type=='2'}}" class="font32r btnsPay" bindtap="recharge">朕知道了
</button>
<button wx:else class="font32r btnsPay" bindtap="certificate">完成
</button>
</view>
</my-modal>
\ No newline at end of file
... ...
... ... @@ -145,6 +145,10 @@
padding: 0 36rpx 0 36rpx;
margin-top: 40rpx;
}
.explain1{
padding: 0;
margin-top: 0;
}
.colorSty{
color: #999999;
... ... @@ -159,4 +163,29 @@
.sexText{
position: relative;
top: -10rpx;
}
.bottom_box {
border-radius: 16rpx;
width: 100%;
box-sizing: border-box;
padding-left: 20rpx;
}
.bottom_box view {
color: #999999;
font-family: PingFang SC;
line-height: 38rpx;
}
.bold_box {
font-weight: bold;
color: #515151;
}
.publicity {
margin-top: 14rpx;
display: flex;
align-items: center;
padding: 20rpx 0;
}
\ No newline at end of file
... ...
... ... @@ -33,6 +33,7 @@ Page({
},
checkModal: '',
classifyModal: '',
normsLen: '',
/**
* 生命周期函数--监听页面加载
*/
... ... @@ -74,14 +75,14 @@ Page({
let obj = {
sellerName: this.data.options.sellerName,
sellerid: this.data.options.sid,
rid:this.data.options.rid,
oid:this.data.options.oid,
rid: this.data.options.rid,
oid: this.data.options.oid,
sellerDate: this.data.options.sellerDate,
region: this.data.options.region,
tableNum: this.data.options.tableNum,
soltName:this.data.options.soltName,
soltName: this.data.options.soltName,
}
console.log('objobjobjobjobj',obj);
console.log('objobjobjobjobj', obj);
wx.setStorageSync('cookbooklist', JSON.stringify(cookbooklist))
wx.setStorageSync('cookbookObj', JSON.stringify(obj))
wx.navigateTo({
... ... @@ -95,6 +96,20 @@ Page({
check2
})
},
getNormsLen() {
let cookbooklist = this.data.cookbooklist;
let normsLen = 0;
cookbooklist.forEach(items => {
items.cookbooklist[0].forEach(item => {
if (item.norms.length > 0) {
normsLen += item.norms.length
}
})
})
this.setData({
normsLen
})
},
// 展示做法规格弹窗
showModal() {
this.checkModal.showModal()
... ... @@ -127,7 +142,6 @@ Page({
let price = this.data.checkObj.price;
let data = this.data.cookbooklist[indexs].cookbooklist[0][index]
let isAlike = false;
data.norms.forEach(item => {
if (this.data.check1 == item.practice && this.data.check2 == item.unit) {
isAlike = true
... ... @@ -151,7 +165,7 @@ Page({
})
}
this.closeModal()
this.getNormsLen()
},
// 点击加号
addition(e) {
... ... @@ -164,7 +178,7 @@ Page({
checkObj: {
indexs,
index,
price:item.price
price: item.price
},
normsIndex,
checkItem: item
... ... @@ -185,6 +199,7 @@ Page({
cookbooklist: this.data.cookbooklist,
})
}
this.getNormsLen()
},
// 点击减号
subtraction(e) {
... ... @@ -201,6 +216,7 @@ Page({
this.setData({
cookbooklist: this.data.cookbooklist,
})
this.getNormsLen()
},
// 扫桌码点餐
initOrder() {
... ... @@ -289,7 +305,7 @@ Page({
}
cook.item_clear_num = item_clear_num;
cook.index = n; //分类下菜品的下标
if(!cook.norms || cook.norms.length==0){
if (!cook.norms || cook.norms.length == 0) {
cook.norms = []; //做法规格
}
// let type;//模拟种类 1为一行显示1个 2为一行显示2个
... ... @@ -336,16 +352,16 @@ Page({
},
// 获取所有分类下所有菜品列表
getCookList(orderid) {
let cookbooklist=wx.getStorageSync('cookbooklist');
let cookbooklistStorage=cookbooklist?JSON.parse(cookbooklist):'';
console.log('cookbooklist历史数据',cookbooklistStorage);
if(cookbooklistStorage.length>0){
let cookbooklist = wx.getStorageSync('cookbooklist');
let cookbooklistStorage = cookbooklist ? JSON.parse(cookbooklist) : '';
console.log('cookbooklist历史数据', cookbooklistStorage);
if (cookbooklistStorage.length > 0) {
this.setData({
cookbooklist:this.formatCookList(cookbooklistStorage),
cookbooklist: this.formatCookList(cookbooklistStorage),
isloading: false,
showSkeleton: false,
})
}else{
} else {
let param = {
sellerid: this.data.options.sid,
identity: this.data.options.identity,
... ... @@ -371,17 +387,19 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
let cookbooklist=wx.getStorageSync('cookbooklist')
let cookbooklistStorage=cookbooklist?JSON.parse(cookbooklist):''
console.log('cookbooklist历史数据',cookbooklistStorage);
if(cookbooklistStorage){
let cookbooklist = wx.getStorageSync('cookbooklist')
let cookbooklistStorage = cookbooklist ? JSON.parse(cookbooklist) : ''
console.log('cookbooklist历史数据', cookbooklistStorage);
if (cookbooklistStorage) {
this.setData({
cookbooklist:cookbooklistStorage,
cookbooklist: cookbooklistStorage,
isloading: false,
showSkeleton: false,
})
}else{
this.getNormsLen()
} else {
this.getCookList()
this.getNormsLen()
}
},
... ...
... ... @@ -87,7 +87,10 @@
</view>
</view>
<view class="right flex-cmc" bindtap="gotoShoppingCart">
<image src="https://qn.colorcun.com/WechatIMG701.png" mode="" />
<view class="rightBox">
<image src="https://qn.colorcun.com/WechatIMG701.png" mode="" />
<view class="num" wx:if="{{normsLen}}">{{normsLen}}</view>
</view>
<view class="fixedName">
已选菜品
</view>
... ...
... ... @@ -72,7 +72,7 @@ page {
.dishImg {
width: 100%;
height: calc(100vw * 0.67) !important;
height: 750rpx !important;
}
.greens {
... ... @@ -189,13 +189,32 @@ page {
height: 36rpx;
}
.fixedBox view {
.fixedBox .right{
padding: 0 20rpx;
}
.fixedBox .right image {
width: 41rpx;
height: 36rpx;
.fixedBox .right .rightBox image {
width: 50rpx;
height: 50rpx;
}
.fixedBox .right .rightBox{
position: relative;
}
.fixedBox .right .num{
position: absolute;
right: -20%;
top: 0;
width: 30rpx;
height: 30rpx;
font-size: 24rpx;
border-radius: 50%;
background: #e76940;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
}
.fixedName {
... ...
... ... @@ -5,15 +5,27 @@ Page({
* 页面的初始数据
*/
data: {
isShow:'show',
oid:'',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 购买券之后,弹框跳转,返回需要跳转到邀请函页
if(options && options.type=='1'){
this.setData({
isShow:'none',
oid:options.oid
})
}
console.log('options',options);
},
navEvent(){
return wx.reLaunch({
url: '/pages/customer/detail_owner_invitation_new?id='+this.data.oid,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
<!--pages/me/wananchi.wxml-->
<nav backgroundColor="transparent"></nav>
<nav back="{{isShow}}" bindNavEvent="{{isShow=='none'?'navEvent':''}}" backgroundColor="transparent"></nav>
<view class="box">
<view class="title">
关注周到安排公众号
... ...