|
...
|
...
|
@@ -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 |
...
|
...
|
|