Commit 0e7c7a3ba90afc388c2f80b7c7ec87cc0929e414

Authored by vking
1 parent 125a67d5

share

... ... @@ -97,15 +97,12 @@ Page({
})
},
initImage(){
let palette={}
let palette={},share_image_full=''
if(this.options.act=='quanzi'){
let seller=this.data.seller
let pw=getApp().system.windowWidth-20;
let ph=pw/355*558;
let tagsHeight=60//rpx
if(seller.activity.length==0){
ph=pw/355*500;
}
let pw=getApp().system.windowWidth;
let ph=pw/375*620;
this.pw=pw;this.ph=ph;
let cai_jiu_bao=[]//菜酒包
if(seller.cate.length>0){
cai_jiu_bao.push(seller.cate[0])
... ... @@ -125,13 +122,12 @@ Page({
})
}
tags=tags.join(' | ')
if(!tags){
ph=ph-tagsHeight/2
tagsHeight=0
}
let share_image=seller.share_image
.replace('http://','https://')
+'?imageView2/1/w/750/h/500/q/100'
share_image_full=seller.share_image
.replace('http://','https://')
+'?imageView2/0/w/50/q/10'
console.log('share_image:',share_image)
palette={
background: '#fff',
... ... @@ -140,10 +136,33 @@ Page({
views: [
{
type:'image',
url:share_image,
url:share_image_full,
css:{
width:pw+'px',
height:470+'rpx',
height:ph+'px',
mode:'aspectFill'
}
},
{
//https://qn.colorcun.com/share_bg1.png
type:'image',
url:'https://qn.colorcun.com/share_bg1.png',
css:{
top:'10px',
left:'10px',
width:(pw-20)+'px',
height:'470px',
mode:'scaleToFill'
}
},
{
type:'image',
url:share_image,
css:{
top:'20px',
left:'20px',
width:(pw-40)+'px',
height:'220px',
mode:'aspectFill'
}
},
... ... @@ -154,9 +173,10 @@ Page({
css:{
fontSize:'36rpx',
color:'#353535',
top:520+'rpx',
left:'30rpx',
top:'260px',
fontWeight:'bold',
left: (pw / 2) + 'px',
align: 'center',
}
},
{
... ... @@ -165,11 +185,11 @@ Page({
css:{
fontSize:'20rpx',
color:'#ffffff',
top:531+'rpx',
left:['60rpx', 'seller-name', 1] ,
top:'224px',
left:'21px' ,
background:'#F57E32',
lineHeight:'28rpx',
borderRadius:'6rpx',
borderRadius:'0px',
borderWidth:'4rpx',
borderColor:'#F57E32',
}
... ... @@ -180,114 +200,67 @@ Page({
css:{
fontSize:'26rpx',
color:'#999999',
top: '578rpx',
left: '30rpx',
}
},
{
type:'text',
text: tags,
css:{
fontSize:'22rpx',
color:'#C0A369',
top: '638rpx',
left: '42rpx',
background:'#FFEFDF',
lineHeight:'28rpx',
padding:'10rpx 12rpx',
}
},
{
type:'rect',
css:{
color:'#F5F5F5',
top:(634+tagsHeight)+'rpx',
left:'30rpx',
width:(pw-30)+'px',
height:'1px'
}
},
/*
{
type:'text',
text: "陕西风味面馆",
css:{
fontSize:'14px',
color:'#f00',
background:'#ff0',
padding:'8px 20px',
top:(480*(getApp().system.windowWidth/600)+20)+'px',
left:'16px',
lineHeight:'18px'
}
},
{
type:'rect',
css:{
color:'rgba(0,0,0,0.5)',
top:(480*(getApp().system.windowWidth/600)+12)+'px',
left:'0px',
width:'320px',
height:'34px'
top: '290px',
left: (pw / 2) + 'px',
align: 'center',
}
},
*/
{
type: 'image',
url: this.data.qrcode,
css: {
bottom: '112rpx',
bottom: '45px',
left: (pw / 2) + 'px',
width: '140rpx',
height: '140rpx',
width: '130rpx',
height: '130rpx',
align: 'center',
borderRadius:'8px',
borderWidth:'5px',
borderColor:'#fff',
mode:'aspectFill'
},
},
{
type:'text',
text: '长按或扫描二维码,预订、导航',
text: '长按或扫描二维码预订,享更多优惠',
css:{
fontSize:'22rpx',
color:'#999999',
bottom: '50rpx',
color:'#fefefe',
bottom: '18px',
left: (pw / 2) + 'px',
align: 'center',
}
},
],
}
if(seller.activity.length>0){
let al=seller.activity.length
if(al>0){
//活动
let activity=[];
seller.activity.forEach(act=>{
activity.push(act.title)
})
activity='活动: '+activity.join(' | ')
if(al==1){
this.setActiveView(palette.views,seller.activity[0],-1)
}else{
seller.activity.some((act,i)=>{
this.setActiveView(palette.views,act,i)
if(i==1) return true
})
}
}else{
palette.views.push({
type:'text',
text: activity,
css:{
fontSize:'30rpx',
color:'#353535',
top: (676+tagsHeight)+'rpx',
left: '30rpx',
lineHeight:'38rpx',
maxLines:1,
width:(pw-30)+'px',
}
});
palette.views.push({
type:'rect',
text: '包间火爆预订中……',
css:{
color:'#F5F5F5',
top:(754+tagsHeight)+'rpx',
left:'30rpx',
width:(pw-30)+'px',
height:'1px'
fontSize:'36rpx',
color:'#C0A369',
bottom: '200px',
left: (pw / 2) + 'px',
align: 'center',
fontWeight:'bold',
}
});
}
}else{
share_image_full=''
palette={
background: '#fff',
width: '400rpx',
... ... @@ -314,7 +287,7 @@ Page({
wx.getImageInfo({
src:e.detail.path,
success:res=>{
let w=getApp().system.windowWidth-24
let w=getApp().system.windowWidth
console.log('getImageInfo',res)
this.setData({
paletteImageWidth:w,
... ... @@ -328,5 +301,117 @@ Page({
wx.previewImage({
urls:[this.data.paletteImageSrc],
})
}
},
setActiveView(paletteviews,act,index=-1){
let minNumId='minNumId'+Math.abs(index)
let actname={
1:'满减',
2:'满赠',
3:'折扣',
4:'优惠券',
5:'会员价'
}
let boxShadow={
type:'rect',
css: {
top:'377px',
width: '120px',
height: '60px',
color:'#C0A369',
borderWidth:'1px',
borderColor:'#C0A369',
borderRadius:'5px'
},
}
let box={
type:'rect',
css: {
top:'375px',
width: '120px',
height: '60px',
color:'linear-gradient(0deg, #FFFAF6 50%, #FFEFDF 100%)',
borderWidth:'1px',
borderColor:'#C0A369',
borderRadius:'5px',
},
}
let txt235={
type:'text',
text: actname[act.type],
css:{
fontSize:'36rpx',
color:'#C0A369',
top:'393px',
fontWeight:'bold',
align: 'center',
}
}
let txt14={
type:'text',
text: act.min_num,
id:minNumId,
css:{
fontSize:'36rpx',
color:'#C0A369',
top:'383px',
fontWeight:'bold',
align: 'center',
}
}
let txt14per={
type:'text',
text: '¥',
css:{
fontSize:'24rpx',
color:'#C0A369',
top:'388px',
align: 'center',
}
}
let txt14info={
type:'text',
text: 1==act.type?(act.min_num<1?'到店立减':('满'+act.max_num+'元立减')):('满'+act.max_num+'元可用'),
css:{
fontSize:'24rpx',
color:'#C0A369',
top:'410px',
align: 'center',
}
}
switch (index){
case -1:
boxShadow.css.left=(this.pw-120)/2+2+'px'
box.css.left=(this.pw-120)/2+'px'
txt235.css.left=this.pw/2+'px'
txt14.css.left=this.pw/2+'px'
txt14per.css.left=this.pw/2-20+'px'
txt14info.css.left=this.pw/2+'px'
break
case 0:
boxShadow.css.left='52px'
box.css.left='50px'
txt235.css.left='110px'
txt14.css.left='110px'
txt14per.css.left='90px'
txt14info.css.left='110px'
break;
case 1:
boxShadow.css.right='48px'
box.css.right='50px'
txt235.css.right='110px'
txt14.css.right='110px'
txt14per.css.right='130px'
txt14info.css.right='110px'
break;
}
paletteviews.push(boxShadow)
paletteviews.push(box)
if((1==act.type || 4==act.type)){
paletteviews.push(txt14)
paletteviews.push(txt14per)
paletteviews.push(txt14info)
}else{
paletteviews.push(txt235)
}
},
})
\ No newline at end of file
... ...
... ... @@ -5,7 +5,7 @@
<painter palette="{{palette}}" bind:imgOK="onImgOK" bind:imgErr="onImgOK"/>
</view>
<view wx:if="{{paletteImageSrc}}" class="pages">
<view class="pages-view" wx:if="{{actType=='quanzi'}}">
<view class="pages-view flex-vc" wx:if="{{actType=='quanzi'}}">
<image src="{{paletteImageSrc}}"
bindtap="reviewImage"
style="width:{{paletteImageWidth}}px;height:{{paletteImageHeight}}px;"></image>
... ... @@ -16,7 +16,7 @@
style="width:400rpx;height:400rpx; margin-top: 90rpx;"></image>
<view class="qrcode-text">{{seller.sellername}}</view>
</view>
<view class="save">
<view class="save flex-vc">
<savefile filePath="{{paletteImageSrc}}">
<view class="save-but {{hasSellerShare?'sellerShare':''}} flex-cc">
<view class="save-but-icon"></view>
... ...
/* pages/reserve/share.wxss */
page{
background-color: #EEF2F2;
background-color: #fefefe;
}
.pages{
padding-bottom: 160rpx;
padding-bottom: 100rpx;
width: 100%;
padding-top: 20rpx;
padding-top: 0rpx;
background-size: 100% 100%;
}
.pages-view{
width: calc(100% - 24px);
width: 100%;
margin: 0 auto;
background-color: #fefefe;
}
.save{
position: fixed;
bottom: 0;
width: 100%;
height: 100rpx;
background-color: #fff;
}
.save-but{
width: calc(100% - 24px);
height: 100rpx;
margin: 0 auto 30rpx;
width: 500rpx;
height: 80rpx;
background-color: #C0A369;
font-size: 32rpx;
color: #fefefe;
border-radius: 10rpx;
border-radius: 50rpx;
}
.save-but.sellerShare{
background-color: #199095;
... ...
... ... @@ -134,7 +134,7 @@ Page({
if(res.data.hasSetUserInfo){
App.Customer.GetCustomerInfo({},'clear')
}
let firstShowMsg='预计10分钟左右餐厅将告知您结果(请留意短息或微信通知)'
let firstShowMsg='餐厅一般会在10分钟内为您反馈结果,请耐心等候(请留意短信或微信通知)'
if(!this.hasInWorkTime()){//非营业时间预订
firstShowMsg='商家未营业,营业后将第一时间告知您预订结果'
}
... ...