Commit 0e7c7a3ba90afc388c2f80b7c7ec87cc0929e414

Authored by vking
1 parent 125a67d5

share

@@ -97,15 +97,12 @@ Page({ @@ -97,15 +97,12 @@ Page({
97 }) 97 })
98 }, 98 },
99 initImage(){ 99 initImage(){
100 - let palette={} 100 + let palette={},share_image_full=''
101 if(this.options.act=='quanzi'){ 101 if(this.options.act=='quanzi'){
102 let seller=this.data.seller 102 let seller=this.data.seller
103 - let pw=getApp().system.windowWidth-20;  
104 - let ph=pw/355*558;  
105 - let tagsHeight=60//rpx  
106 - if(seller.activity.length==0){  
107 - ph=pw/355*500;  
108 - } 103 + let pw=getApp().system.windowWidth;
  104 + let ph=pw/375*620;
  105 + this.pw=pw;this.ph=ph;
109 let cai_jiu_bao=[]//菜酒包 106 let cai_jiu_bao=[]//菜酒包
110 if(seller.cate.length>0){ 107 if(seller.cate.length>0){
111 cai_jiu_bao.push(seller.cate[0]) 108 cai_jiu_bao.push(seller.cate[0])
@@ -125,13 +122,12 @@ Page({ @@ -125,13 +122,12 @@ Page({
125 }) 122 })
126 } 123 }
127 tags=tags.join(' | ') 124 tags=tags.join(' | ')
128 - if(!tags){  
129 - ph=ph-tagsHeight/2  
130 - tagsHeight=0  
131 - }  
132 let share_image=seller.share_image 125 let share_image=seller.share_image
133 .replace('http://','https://') 126 .replace('http://','https://')
134 +'?imageView2/1/w/750/h/500/q/100' 127 +'?imageView2/1/w/750/h/500/q/100'
  128 + share_image_full=seller.share_image
  129 + .replace('http://','https://')
  130 + +'?imageView2/0/w/50/q/10'
135 console.log('share_image:',share_image) 131 console.log('share_image:',share_image)
136 palette={ 132 palette={
137 background: '#fff', 133 background: '#fff',
@@ -140,10 +136,33 @@ Page({ @@ -140,10 +136,33 @@ Page({
140 views: [ 136 views: [
141 { 137 {
142 type:'image', 138 type:'image',
143 - url:share_image, 139 + url:share_image_full,
144 css:{ 140 css:{
145 width:pw+'px', 141 width:pw+'px',
146 - height:470+'rpx', 142 + height:ph+'px',
  143 + mode:'aspectFill'
  144 + }
  145 + },
  146 + {
  147 + //https://qn.colorcun.com/share_bg1.png
  148 + type:'image',
  149 + url:'https://qn.colorcun.com/share_bg1.png',
  150 + css:{
  151 + top:'10px',
  152 + left:'10px',
  153 + width:(pw-20)+'px',
  154 + height:'470px',
  155 + mode:'scaleToFill'
  156 + }
  157 + },
  158 + {
  159 + type:'image',
  160 + url:share_image,
  161 + css:{
  162 + top:'20px',
  163 + left:'20px',
  164 + width:(pw-40)+'px',
  165 + height:'220px',
147 mode:'aspectFill' 166 mode:'aspectFill'
148 } 167 }
149 }, 168 },
@@ -154,9 +173,10 @@ Page({ @@ -154,9 +173,10 @@ Page({
154 css:{ 173 css:{
155 fontSize:'36rpx', 174 fontSize:'36rpx',
156 color:'#353535', 175 color:'#353535',
157 - top:520+'rpx',  
158 - left:'30rpx', 176 + top:'260px',
159 fontWeight:'bold', 177 fontWeight:'bold',
  178 + left: (pw / 2) + 'px',
  179 + align: 'center',
160 } 180 }
161 }, 181 },
162 { 182 {
@@ -165,11 +185,11 @@ Page({ @@ -165,11 +185,11 @@ Page({
165 css:{ 185 css:{
166 fontSize:'20rpx', 186 fontSize:'20rpx',
167 color:'#ffffff', 187 color:'#ffffff',
168 - top:531+'rpx',  
169 - left:['60rpx', 'seller-name', 1] , 188 + top:'224px',
  189 + left:'21px' ,
170 background:'#F57E32', 190 background:'#F57E32',
171 lineHeight:'28rpx', 191 lineHeight:'28rpx',
172 - borderRadius:'6rpx', 192 + borderRadius:'0px',
173 borderWidth:'4rpx', 193 borderWidth:'4rpx',
174 borderColor:'#F57E32', 194 borderColor:'#F57E32',
175 } 195 }
@@ -180,114 +200,67 @@ Page({ @@ -180,114 +200,67 @@ Page({
180 css:{ 200 css:{
181 fontSize:'26rpx', 201 fontSize:'26rpx',
182 color:'#999999', 202 color:'#999999',
183 - top: '578rpx',  
184 - left: '30rpx',  
185 - }  
186 - },  
187 - {  
188 - type:'text',  
189 - text: tags,  
190 - css:{  
191 - fontSize:'22rpx',  
192 - color:'#C0A369',  
193 - top: '638rpx',  
194 - left: '42rpx',  
195 - background:'#FFEFDF',  
196 - lineHeight:'28rpx',  
197 - padding:'10rpx 12rpx',  
198 - }  
199 - },  
200 - {  
201 - type:'rect',  
202 - css:{  
203 - color:'#F5F5F5',  
204 - top:(634+tagsHeight)+'rpx',  
205 - left:'30rpx',  
206 - width:(pw-30)+'px',  
207 - height:'1px'  
208 - }  
209 - },  
210 - /*  
211 - {  
212 - type:'text',  
213 - text: "陕西风味面馆",  
214 - css:{  
215 - fontSize:'14px',  
216 - color:'#f00',  
217 - background:'#ff0',  
218 - padding:'8px 20px',  
219 - top:(480*(getApp().system.windowWidth/600)+20)+'px',  
220 - left:'16px',  
221 - lineHeight:'18px'  
222 - }  
223 - },  
224 - {  
225 - type:'rect',  
226 - css:{  
227 - color:'rgba(0,0,0,0.5)',  
228 - top:(480*(getApp().system.windowWidth/600)+12)+'px',  
229 - left:'0px',  
230 - width:'320px',  
231 - height:'34px' 203 + top: '290px',
  204 + left: (pw / 2) + 'px',
  205 + align: 'center',
232 } 206 }
233 }, 207 },
234 - */  
235 { 208 {
236 type: 'image', 209 type: 'image',
237 url: this.data.qrcode, 210 url: this.data.qrcode,
238 css: { 211 css: {
239 - bottom: '112rpx', 212 + bottom: '45px',
240 left: (pw / 2) + 'px', 213 left: (pw / 2) + 'px',
241 - width: '140rpx',  
242 - height: '140rpx', 214 + width: '130rpx',
  215 + height: '130rpx',
243 align: 'center', 216 align: 'center',
  217 + borderRadius:'8px',
  218 + borderWidth:'5px',
  219 + borderColor:'#fff',
  220 + mode:'aspectFill'
244 }, 221 },
245 }, 222 },
246 { 223 {
247 type:'text', 224 type:'text',
248 - text: '长按或扫描二维码,预订、导航', 225 + text: '长按或扫描二维码预订,享更多优惠',
249 css:{ 226 css:{
250 fontSize:'22rpx', 227 fontSize:'22rpx',
251 - color:'#999999',  
252 - bottom: '50rpx', 228 + color:'#fefefe',
  229 + bottom: '18px',
253 left: (pw / 2) + 'px', 230 left: (pw / 2) + 'px',
254 align: 'center', 231 align: 'center',
255 } 232 }
256 }, 233 },
257 ], 234 ],
258 } 235 }
259 - if(seller.activity.length>0){ 236 + let al=seller.activity.length
  237 + if(al>0){
260 //活动 238 //活动
261 - let activity=[];  
262 - seller.activity.forEach(act=>{  
263 - activity.push(act.title)  
264 - })  
265 - activity='活动: '+activity.join(' | ') 239 + if(al==1){
  240 + this.setActiveView(palette.views,seller.activity[0],-1)
  241 + }else{
  242 + seller.activity.some((act,i)=>{
  243 + this.setActiveView(palette.views,act,i)
  244 + if(i==1) return true
  245 + })
  246 + }
  247 +
  248 + }else{
266 palette.views.push({ 249 palette.views.push({
267 type:'text', 250 type:'text',
268 - text: activity,  
269 - css:{  
270 - fontSize:'30rpx',  
271 - color:'#353535',  
272 - top: (676+tagsHeight)+'rpx',  
273 - left: '30rpx',  
274 - lineHeight:'38rpx',  
275 - maxLines:1,  
276 - width:(pw-30)+'px',  
277 - }  
278 - });  
279 - palette.views.push({  
280 - type:'rect', 251 + text: '包间火爆预订中……',
281 css:{ 252 css:{
282 - color:'#F5F5F5',  
283 - top:(754+tagsHeight)+'rpx',  
284 - left:'30rpx',  
285 - width:(pw-30)+'px',  
286 - height:'1px' 253 + fontSize:'36rpx',
  254 + color:'#C0A369',
  255 + bottom: '200px',
  256 + left: (pw / 2) + 'px',
  257 + align: 'center',
  258 + fontWeight:'bold',
287 } 259 }
288 }); 260 });
289 } 261 }
290 }else{ 262 }else{
  263 + share_image_full=''
291 palette={ 264 palette={
292 background: '#fff', 265 background: '#fff',
293 width: '400rpx', 266 width: '400rpx',
@@ -314,7 +287,7 @@ Page({ @@ -314,7 +287,7 @@ Page({
314 wx.getImageInfo({ 287 wx.getImageInfo({
315 src:e.detail.path, 288 src:e.detail.path,
316 success:res=>{ 289 success:res=>{
317 - let w=getApp().system.windowWidth-24 290 + let w=getApp().system.windowWidth
318 console.log('getImageInfo',res) 291 console.log('getImageInfo',res)
319 this.setData({ 292 this.setData({
320 paletteImageWidth:w, 293 paletteImageWidth:w,
@@ -328,5 +301,117 @@ Page({ @@ -328,5 +301,117 @@ Page({
328 wx.previewImage({ 301 wx.previewImage({
329 urls:[this.data.paletteImageSrc], 302 urls:[this.data.paletteImageSrc],
330 }) 303 })
331 - } 304 + },
  305 + setActiveView(paletteviews,act,index=-1){
  306 + let minNumId='minNumId'+Math.abs(index)
  307 + let actname={
  308 + 1:'满减',
  309 + 2:'满赠',
  310 + 3:'折扣',
  311 + 4:'优惠券',
  312 + 5:'会员价'
  313 + }
  314 + let boxShadow={
  315 + type:'rect',
  316 + css: {
  317 + top:'377px',
  318 + width: '120px',
  319 + height: '60px',
  320 + color:'#C0A369',
  321 + borderWidth:'1px',
  322 + borderColor:'#C0A369',
  323 + borderRadius:'5px'
  324 + },
  325 + }
  326 + let box={
  327 + type:'rect',
  328 + css: {
  329 + top:'375px',
  330 + width: '120px',
  331 + height: '60px',
  332 + color:'linear-gradient(0deg, #FFFAF6 50%, #FFEFDF 100%)',
  333 + borderWidth:'1px',
  334 + borderColor:'#C0A369',
  335 + borderRadius:'5px',
  336 + },
  337 + }
  338 + let txt235={
  339 + type:'text',
  340 + text: actname[act.type],
  341 + css:{
  342 + fontSize:'36rpx',
  343 + color:'#C0A369',
  344 + top:'393px',
  345 + fontWeight:'bold',
  346 + align: 'center',
  347 + }
  348 + }
  349 + let txt14={
  350 + type:'text',
  351 + text: act.min_num,
  352 + id:minNumId,
  353 + css:{
  354 + fontSize:'36rpx',
  355 + color:'#C0A369',
  356 + top:'383px',
  357 + fontWeight:'bold',
  358 + align: 'center',
  359 + }
  360 + }
  361 + let txt14per={
  362 + type:'text',
  363 + text: '¥',
  364 + css:{
  365 + fontSize:'24rpx',
  366 + color:'#C0A369',
  367 + top:'388px',
  368 + align: 'center',
  369 + }
  370 + }
  371 + let txt14info={
  372 + type:'text',
  373 + text: 1==act.type?(act.min_num<1?'到店立减':('满'+act.max_num+'元立减')):('满'+act.max_num+'元可用'),
  374 + css:{
  375 + fontSize:'24rpx',
  376 + color:'#C0A369',
  377 + top:'410px',
  378 + align: 'center',
  379 + }
  380 + }
  381 + switch (index){
  382 + case -1:
  383 + boxShadow.css.left=(this.pw-120)/2+2+'px'
  384 + box.css.left=(this.pw-120)/2+'px'
  385 + txt235.css.left=this.pw/2+'px'
  386 + txt14.css.left=this.pw/2+'px'
  387 + txt14per.css.left=this.pw/2-20+'px'
  388 + txt14info.css.left=this.pw/2+'px'
  389 + break
  390 + case 0:
  391 + boxShadow.css.left='52px'
  392 + box.css.left='50px'
  393 + txt235.css.left='110px'
  394 + txt14.css.left='110px'
  395 + txt14per.css.left='90px'
  396 + txt14info.css.left='110px'
  397 + break;
  398 + case 1:
  399 + boxShadow.css.right='48px'
  400 + box.css.right='50px'
  401 + txt235.css.right='110px'
  402 + txt14.css.right='110px'
  403 + txt14per.css.right='130px'
  404 + txt14info.css.right='110px'
  405 + break;
  406 + }
  407 + paletteviews.push(boxShadow)
  408 + paletteviews.push(box)
  409 + if((1==act.type || 4==act.type)){
  410 + paletteviews.push(txt14)
  411 + paletteviews.push(txt14per)
  412 + paletteviews.push(txt14info)
  413 + }else{
  414 + paletteviews.push(txt235)
  415 + }
  416 + },
332 }) 417 })
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 <painter palette="{{palette}}" bind:imgOK="onImgOK" bind:imgErr="onImgOK"/> 5 <painter palette="{{palette}}" bind:imgOK="onImgOK" bind:imgErr="onImgOK"/>
6 </view> 6 </view>
7 <view wx:if="{{paletteImageSrc}}" class="pages"> 7 <view wx:if="{{paletteImageSrc}}" class="pages">
8 - <view class="pages-view" wx:if="{{actType=='quanzi'}}"> 8 + <view class="pages-view flex-vc" wx:if="{{actType=='quanzi'}}">
9 <image src="{{paletteImageSrc}}" 9 <image src="{{paletteImageSrc}}"
10 bindtap="reviewImage" 10 bindtap="reviewImage"
11 style="width:{{paletteImageWidth}}px;height:{{paletteImageHeight}}px;"></image> 11 style="width:{{paletteImageWidth}}px;height:{{paletteImageHeight}}px;"></image>
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 style="width:400rpx;height:400rpx; margin-top: 90rpx;"></image> 16 style="width:400rpx;height:400rpx; margin-top: 90rpx;"></image>
17 <view class="qrcode-text">{{seller.sellername}}</view> 17 <view class="qrcode-text">{{seller.sellername}}</view>
18 </view> 18 </view>
19 - <view class="save"> 19 + <view class="save flex-vc">
20 <savefile filePath="{{paletteImageSrc}}"> 20 <savefile filePath="{{paletteImageSrc}}">
21 <view class="save-but {{hasSellerShare?'sellerShare':''}} flex-cc"> 21 <view class="save-but {{hasSellerShare?'sellerShare':''}} flex-cc">
22 <view class="save-but-icon"></view> 22 <view class="save-but-icon"></view>
1 /* pages/reserve/share.wxss */ 1 /* pages/reserve/share.wxss */
2 page{ 2 page{
3 - background-color: #EEF2F2; 3 + background-color: #fefefe;
4 } 4 }
5 .pages{ 5 .pages{
6 - padding-bottom: 160rpx; 6 + padding-bottom: 100rpx;
7 width: 100%; 7 width: 100%;
8 - padding-top: 20rpx; 8 + padding-top: 0rpx;
  9 + background-size: 100% 100%;
9 } 10 }
10 .pages-view{ 11 .pages-view{
11 - width: calc(100% - 24px); 12 + width: 100%;
12 margin: 0 auto; 13 margin: 0 auto;
13 - background-color: #fefefe;  
14 } 14 }
15 .save{ 15 .save{
16 position: fixed; 16 position: fixed;
17 bottom: 0; 17 bottom: 0;
18 width: 100%; 18 width: 100%;
  19 + height: 100rpx;
  20 + background-color: #fff;
19 } 21 }
20 .save-but{ 22 .save-but{
21 - width: calc(100% - 24px);  
22 - height: 100rpx;  
23 - margin: 0 auto 30rpx; 23 + width: 500rpx;
  24 + height: 80rpx;
24 background-color: #C0A369; 25 background-color: #C0A369;
25 font-size: 32rpx; 26 font-size: 32rpx;
26 color: #fefefe; 27 color: #fefefe;
27 - border-radius: 10rpx; 28 + border-radius: 50rpx;
28 } 29 }
29 .save-but.sellerShare{ 30 .save-but.sellerShare{
30 background-color: #199095; 31 background-color: #199095;
@@ -134,7 +134,7 @@ Page({ @@ -134,7 +134,7 @@ Page({
134 if(res.data.hasSetUserInfo){ 134 if(res.data.hasSetUserInfo){
135 App.Customer.GetCustomerInfo({},'clear') 135 App.Customer.GetCustomerInfo({},'clear')
136 } 136 }
137 - let firstShowMsg='预计10分钟左右餐厅将告知您结果(请留意短息或微信通知)' 137 + let firstShowMsg='餐厅一般会在10分钟内为您反馈结果,请耐心等候(请留意短信或微信通知)'
138 if(!this.hasInWorkTime()){//非营业时间预订 138 if(!this.hasInWorkTime()){//非营业时间预订
139 firstShowMsg='商家未营业,营业后将第一时间告知您预订结果' 139 firstShowMsg='商家未营业,营业后将第一时间告知您预订结果'
140 } 140 }