Commit 324fcc3d37e67dbc214ac32197a98562529c9d57

Authored by yiren
1 parent 8d641b01

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

@@ -67,6 +67,13 @@ Page({ @@ -67,6 +67,13 @@ Page({
67 this.countdown() 67 this.countdown()
68 this.modal = this.selectComponent("#payModal"); //通过给组件所起的id调用组件 68 this.modal = this.selectComponent("#payModal"); //通过给组件所起的id调用组件
69 }, 69 },
  70 + // 购买完成券之后关注公众号
  71 + wananchi() {
  72 + this.closeModal()
  73 + wx.navigateTo({
  74 + url: `/pages/me/wananchi?type=1&oid=${this.data.opt.detail.oid}`
  75 + })
  76 + },
70 showModal() { 77 showModal() {
71 this.modal.showModal() //调用组件中打开模态框方法 78 this.modal.showModal() //调用组件中打开模态框方法
72 }, 79 },
@@ -68,12 +68,23 @@ @@ -68,12 +68,23 @@
68 <my-modal id="payModal" fadeStyle="slideUp" height="380px"> 68 <my-modal id="payModal" fadeStyle="slideUp" height="380px">
69 <view slot="modalName" class="titleModal">成功支付{{opt.totalize}}元</view> 69 <view slot="modalName" class="titleModal">成功支付{{opt.totalize}}元</view>
70 <view slot="modalContent"> 70 <view slot="modalContent">
71 - <view class="explain" wx:if="{{type=='2'}}">  
72 - 您的会员充值已经在办理中,到店消费时请和收银核实,谢谢! 71 + <block wx:if="{{type=='2'}}">
  72 + <view class="explain">
  73 + 您的会员充值已经在办理中,到店消费时请和收银核实,谢谢!
  74 + </view>
  75 + <button wx:if="{{type=='2'}}" class="font32r btnsPay" bindtap="recharge">朕知道了
  76 + </button>
  77 + </block>
  78 + <view class="explain explain1" wx:else>
  79 + <view class="bottom_box">
  80 + <view class="font24r">温馨提示:</view>
  81 + <view class="font24r">1、到店消费时,请您向餐厅出示该二维码。</view>
  82 + <view class="font24r">2、从<text class="bold_box">周到安排</text>微信小程序,我的-优惠券,可以找到您的卡券。</view>
  83 + <view class="font24r">3、您也可以关注<text class="bold_box">周到安排</text>公众号,获取优惠券更多信息。</view>
  84 + <view class="font28r publicity" bindtap="wananchi">关注<text class="bold_box">周到安排</text>公众号,及时获取更多优惠券动态<view class="more" style="margin-left: 20rpx;"></view>
  85 + </view>
  86 + </view>
  87 + <button class="font32r btnsPay" bindtap="certificate">完成</button>
73 </view> 88 </view>
74 - <button wx:if="{{type=='2'}}" class="font32r btnsPay" bindtap="recharge">朕知道了  
75 - </button>  
76 - <button wx:else class="font32r btnsPay" bindtap="certificate">完成  
77 - </button>  
78 </view> 89 </view>
79 </my-modal> 90 </my-modal>
@@ -145,6 +145,10 @@ @@ -145,6 +145,10 @@
145 padding: 0 36rpx 0 36rpx; 145 padding: 0 36rpx 0 36rpx;
146 margin-top: 40rpx; 146 margin-top: 40rpx;
147 } 147 }
  148 +.explain1{
  149 + padding: 0;
  150 + margin-top: 0;
  151 +}
148 152
149 .colorSty{ 153 .colorSty{
150 color: #999999; 154 color: #999999;
@@ -159,4 +163,29 @@ @@ -159,4 +163,29 @@
159 .sexText{ 163 .sexText{
160 position: relative; 164 position: relative;
161 top: -10rpx; 165 top: -10rpx;
  166 +}
  167 +
  168 +.bottom_box {
  169 + border-radius: 16rpx;
  170 + width: 100%;
  171 + box-sizing: border-box;
  172 + padding-left: 20rpx;
  173 +}
  174 +
  175 +.bottom_box view {
  176 + color: #999999;
  177 + font-family: PingFang SC;
  178 + line-height: 38rpx;
  179 +}
  180 +
  181 +.bold_box {
  182 + font-weight: bold;
  183 + color: #515151;
  184 +}
  185 +
  186 +.publicity {
  187 + margin-top: 14rpx;
  188 + display: flex;
  189 + align-items: center;
  190 + padding: 20rpx 0;
162 } 191 }
@@ -33,6 +33,7 @@ Page({ @@ -33,6 +33,7 @@ Page({
33 }, 33 },
34 checkModal: '', 34 checkModal: '',
35 classifyModal: '', 35 classifyModal: '',
  36 + normsLen: '',
36 /** 37 /**
37 * 生命周期函数--监听页面加载 38 * 生命周期函数--监听页面加载
38 */ 39 */
@@ -74,14 +75,14 @@ Page({ @@ -74,14 +75,14 @@ Page({
74 let obj = { 75 let obj = {
75 sellerName: this.data.options.sellerName, 76 sellerName: this.data.options.sellerName,
76 sellerid: this.data.options.sid, 77 sellerid: this.data.options.sid,
77 - rid:this.data.options.rid,  
78 - oid:this.data.options.oid, 78 + rid: this.data.options.rid,
  79 + oid: this.data.options.oid,
79 sellerDate: this.data.options.sellerDate, 80 sellerDate: this.data.options.sellerDate,
80 region: this.data.options.region, 81 region: this.data.options.region,
81 tableNum: this.data.options.tableNum, 82 tableNum: this.data.options.tableNum,
82 - soltName:this.data.options.soltName, 83 + soltName: this.data.options.soltName,
83 } 84 }
84 - console.log('objobjobjobjobj',obj); 85 + console.log('objobjobjobjobj', obj);
85 wx.setStorageSync('cookbooklist', JSON.stringify(cookbooklist)) 86 wx.setStorageSync('cookbooklist', JSON.stringify(cookbooklist))
86 wx.setStorageSync('cookbookObj', JSON.stringify(obj)) 87 wx.setStorageSync('cookbookObj', JSON.stringify(obj))
87 wx.navigateTo({ 88 wx.navigateTo({
@@ -95,6 +96,20 @@ Page({ @@ -95,6 +96,20 @@ Page({
95 check2 96 check2
96 }) 97 })
97 }, 98 },
  99 + getNormsLen() {
  100 + let cookbooklist = this.data.cookbooklist;
  101 + let normsLen = 0;
  102 + cookbooklist.forEach(items => {
  103 + items.cookbooklist[0].forEach(item => {
  104 + if (item.norms.length > 0) {
  105 + normsLen += item.norms.length
  106 + }
  107 + })
  108 + })
  109 + this.setData({
  110 + normsLen
  111 + })
  112 + },
98 // 展示做法规格弹窗 113 // 展示做法规格弹窗
99 showModal() { 114 showModal() {
100 this.checkModal.showModal() 115 this.checkModal.showModal()
@@ -127,7 +142,6 @@ Page({ @@ -127,7 +142,6 @@ Page({
127 let price = this.data.checkObj.price; 142 let price = this.data.checkObj.price;
128 let data = this.data.cookbooklist[indexs].cookbooklist[0][index] 143 let data = this.data.cookbooklist[indexs].cookbooklist[0][index]
129 let isAlike = false; 144 let isAlike = false;
130 -  
131 data.norms.forEach(item => { 145 data.norms.forEach(item => {
132 if (this.data.check1 == item.practice && this.data.check2 == item.unit) { 146 if (this.data.check1 == item.practice && this.data.check2 == item.unit) {
133 isAlike = true 147 isAlike = true
@@ -151,7 +165,7 @@ Page({ @@ -151,7 +165,7 @@ Page({
151 }) 165 })
152 } 166 }
153 this.closeModal() 167 this.closeModal()
154 - 168 + this.getNormsLen()
155 }, 169 },
156 // 点击加号 170 // 点击加号
157 addition(e) { 171 addition(e) {
@@ -164,7 +178,7 @@ Page({ @@ -164,7 +178,7 @@ Page({
164 checkObj: { 178 checkObj: {
165 indexs, 179 indexs,
166 index, 180 index,
167 - price:item.price 181 + price: item.price
168 }, 182 },
169 normsIndex, 183 normsIndex,
170 checkItem: item 184 checkItem: item
@@ -185,6 +199,7 @@ Page({ @@ -185,6 +199,7 @@ Page({
185 cookbooklist: this.data.cookbooklist, 199 cookbooklist: this.data.cookbooklist,
186 }) 200 })
187 } 201 }
  202 + this.getNormsLen()
188 }, 203 },
189 // 点击减号 204 // 点击减号
190 subtraction(e) { 205 subtraction(e) {
@@ -201,6 +216,7 @@ Page({ @@ -201,6 +216,7 @@ Page({
201 this.setData({ 216 this.setData({
202 cookbooklist: this.data.cookbooklist, 217 cookbooklist: this.data.cookbooklist,
203 }) 218 })
  219 + this.getNormsLen()
204 }, 220 },
205 // 扫桌码点餐 221 // 扫桌码点餐
206 initOrder() { 222 initOrder() {
@@ -289,7 +305,7 @@ Page({ @@ -289,7 +305,7 @@ Page({
289 } 305 }
290 cook.item_clear_num = item_clear_num; 306 cook.item_clear_num = item_clear_num;
291 cook.index = n; //分类下菜品的下标 307 cook.index = n; //分类下菜品的下标
292 - if(!cook.norms || cook.norms.length==0){ 308 + if (!cook.norms || cook.norms.length == 0) {
293 cook.norms = []; //做法规格 309 cook.norms = []; //做法规格
294 } 310 }
295 // let type;//模拟种类 1为一行显示1个 2为一行显示2个 311 // let type;//模拟种类 1为一行显示1个 2为一行显示2个
@@ -336,16 +352,16 @@ Page({ @@ -336,16 +352,16 @@ Page({
336 }, 352 },
337 // 获取所有分类下所有菜品列表 353 // 获取所有分类下所有菜品列表
338 getCookList(orderid) { 354 getCookList(orderid) {
339 - let cookbooklist=wx.getStorageSync('cookbooklist');  
340 - let cookbooklistStorage=cookbooklist?JSON.parse(cookbooklist):'';  
341 - console.log('cookbooklist历史数据',cookbooklistStorage);  
342 - if(cookbooklistStorage.length>0){ 355 + let cookbooklist = wx.getStorageSync('cookbooklist');
  356 + let cookbooklistStorage = cookbooklist ? JSON.parse(cookbooklist) : '';
  357 + console.log('cookbooklist历史数据', cookbooklistStorage);
  358 + if (cookbooklistStorage.length > 0) {
343 this.setData({ 359 this.setData({
344 - cookbooklist:this.formatCookList(cookbooklistStorage), 360 + cookbooklist: this.formatCookList(cookbooklistStorage),
345 isloading: false, 361 isloading: false,
346 showSkeleton: false, 362 showSkeleton: false,
347 }) 363 })
348 - }else{ 364 + } else {
349 let param = { 365 let param = {
350 sellerid: this.data.options.sid, 366 sellerid: this.data.options.sid,
351 identity: this.data.options.identity, 367 identity: this.data.options.identity,
@@ -371,17 +387,19 @@ Page({ @@ -371,17 +387,19 @@ Page({
371 * 生命周期函数--监听页面显示 387 * 生命周期函数--监听页面显示
372 */ 388 */
373 onShow() { 389 onShow() {
374 - let cookbooklist=wx.getStorageSync('cookbooklist')  
375 - let cookbooklistStorage=cookbooklist?JSON.parse(cookbooklist):''  
376 - console.log('cookbooklist历史数据',cookbooklistStorage);  
377 - if(cookbooklistStorage){ 390 + let cookbooklist = wx.getStorageSync('cookbooklist')
  391 + let cookbooklistStorage = cookbooklist ? JSON.parse(cookbooklist) : ''
  392 + console.log('cookbooklist历史数据', cookbooklistStorage);
  393 + if (cookbooklistStorage) {
378 this.setData({ 394 this.setData({
379 - cookbooklist:cookbooklistStorage, 395 + cookbooklist: cookbooklistStorage,
380 isloading: false, 396 isloading: false,
381 showSkeleton: false, 397 showSkeleton: false,
382 }) 398 })
383 - }else{ 399 + this.getNormsLen()
  400 + } else {
384 this.getCookList() 401 this.getCookList()
  402 + this.getNormsLen()
385 } 403 }
386 }, 404 },
387 405
@@ -87,7 +87,10 @@ @@ -87,7 +87,10 @@
87 </view> 87 </view>
88 </view> 88 </view>
89 <view class="right flex-cmc" bindtap="gotoShoppingCart"> 89 <view class="right flex-cmc" bindtap="gotoShoppingCart">
90 - <image src="https://qn.colorcun.com/WechatIMG701.png" mode="" /> 90 + <view class="rightBox">
  91 + <image src="https://qn.colorcun.com/WechatIMG701.png" mode="" />
  92 + <view class="num" wx:if="{{normsLen}}">{{normsLen}}</view>
  93 + </view>
91 <view class="fixedName"> 94 <view class="fixedName">
92 已选菜品 95 已选菜品
93 </view> 96 </view>
@@ -72,7 +72,7 @@ page { @@ -72,7 +72,7 @@ page {
72 72
73 .dishImg { 73 .dishImg {
74 width: 100%; 74 width: 100%;
75 - height: calc(100vw * 0.67) !important; 75 + height: 750rpx !important;
76 } 76 }
77 77
78 .greens { 78 .greens {
@@ -189,13 +189,32 @@ page { @@ -189,13 +189,32 @@ page {
189 height: 36rpx; 189 height: 36rpx;
190 } 190 }
191 191
192 -.fixedBox view { 192 +.fixedBox .right{
193 padding: 0 20rpx; 193 padding: 0 20rpx;
194 } 194 }
195 195
196 -.fixedBox .right image {  
197 - width: 41rpx;  
198 - height: 36rpx; 196 +.fixedBox .right .rightBox image {
  197 + width: 50rpx;
  198 + height: 50rpx;
  199 +}
  200 +
  201 +.fixedBox .right .rightBox{
  202 + position: relative;
  203 +}
  204 +
  205 +.fixedBox .right .num{
  206 + position: absolute;
  207 + right: -20%;
  208 + top: 0;
  209 + width: 30rpx;
  210 + height: 30rpx;
  211 + font-size: 24rpx;
  212 + border-radius: 50%;
  213 + background: #e76940;
  214 + color: #fff;
  215 + display: flex;
  216 + align-items: center;
  217 + justify-content: center;
199 } 218 }
200 219
201 .fixedName { 220 .fixedName {
@@ -5,15 +5,27 @@ Page({ @@ -5,15 +5,27 @@ Page({
5 * 页面的初始数据 5 * 页面的初始数据
6 */ 6 */
7 data: { 7 data: {
8 - 8 + isShow:'show',
  9 + oid:'',
9 }, 10 },
10 /** 11 /**
11 * 生命周期函数--监听页面加载 12 * 生命周期函数--监听页面加载
12 */ 13 */
13 onLoad(options) { 14 onLoad(options) {
14 - 15 + // 购买券之后,弹框跳转,返回需要跳转到邀请函页
  16 + if(options && options.type=='1'){
  17 + this.setData({
  18 + isShow:'none',
  19 + oid:options.oid
  20 + })
  21 + }
  22 + console.log('options',options);
  23 + },
  24 + navEvent(){
  25 + return wx.reLaunch({
  26 + url: '/pages/customer/detail_owner_invitation_new?id='+this.data.oid,
  27 + })
15 }, 28 },
16 -  
17 /** 29 /**
18 * 生命周期函数--监听页面初次渲染完成 30 * 生命周期函数--监听页面初次渲染完成
19 */ 31 */
1 <!--pages/me/wananchi.wxml--> 1 <!--pages/me/wananchi.wxml-->
2 -<nav backgroundColor="transparent"></nav> 2 +<nav back="{{isShow}}" bindNavEvent="{{isShow=='none'?'navEvent':''}}" backgroundColor="transparent"></nav>
3 <view class="box"> 3 <view class="box">
4 <view class="title"> 4 <view class="title">
5 关注周到安排公众号 5 关注周到安排公众号