|
...
|
...
|
@@ -16,6 +16,33 @@ Page({ |
|
|
|
seller: {},
|
|
|
|
options: {},
|
|
|
|
rechargeList:[],
|
|
|
|
textsInfoColor:'',
|
|
|
|
themeColor:'',
|
|
|
|
textColor:'',
|
|
|
|
navColor:'',
|
|
|
|
height:wx.getSystemInfoSync().windowWidth*1,
|
|
|
|
},
|
|
|
|
imageLoad(e) {
|
|
|
|
const index = e.currentTarget.dataset['index'];
|
|
|
|
const indexs = e.currentTarget.dataset['indexs'];
|
|
|
|
const idx = e.currentTarget.dataset['idx'];
|
|
|
|
//获取图片的原始宽度和高度
|
|
|
|
let originalWidth = e.detail.width;
|
|
|
|
let originalHeight = e.detail.height;
|
|
|
|
let imageSize = util.imageZoomHeightUtil(originalWidth,originalHeight);
|
|
|
|
let imageHeight = `cookbooklist[${indexs}].cookbooklist[0][${index}].norms[${idx}].imageHeight`;
|
|
|
|
let height=(imageSize && imageSize.imageHeight)?imageSize.imageHeight.toFixed(0):'';
|
|
|
|
this.setData({
|
|
|
|
[imageHeight]:height,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
preview(event){
|
|
|
|
const item = event.currentTarget.dataset['item'];
|
|
|
|
let currentUrl = item.image
|
|
|
|
wx.previewImage({
|
|
|
|
current: currentUrl, // 当前显示图片的http链接
|
|
|
|
urls: [currentUrl] // 需要预览的图片http链接列表
|
|
|
|
})
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
...
|
...
|
@@ -152,6 +179,7 @@ Page({ |
|
|
|
image_type: '1',
|
|
|
|
name_type: ''
|
|
|
|
}; //判断是不是json,是json在转换为对象
|
|
|
|
cook.imageHeight=''
|
|
|
|
cook.cook_style = cook_style;
|
|
|
|
cook.image_type = cook_style && cook_style.image_type ? cook_style.image_type : '1'; //1大图,2小图 默认大图
|
|
|
|
cook.name_type = cook_style && cook_style.name_type ? cook_style.name_type : '3'; //1左侧,2右侧,3顶部分开 默认分开
|
|
...
|
...
|
@@ -237,6 +265,8 @@ Page({ |
|
|
|
n.cookName = j.name;
|
|
|
|
n.check1 = j.check1;
|
|
|
|
n.unit = j.unit;
|
|
|
|
n.image = j.image;
|
|
|
|
n.specArr = j.specArr;
|
|
|
|
let list = j.specArr.filter(i => {
|
|
|
|
return i.id == n.specid
|
|
|
|
})
|
|
...
|
...
|
@@ -275,9 +305,7 @@ Page({ |
|
|
|
this.setData({
|
|
|
|
cookbooklist
|
|
|
|
})
|
|
|
|
setTimeout(() => {
|
|
|
|
this.getNewRechargeListfFun();
|
|
|
|
}, 0);
|
|
|
|
this.getNewRechargeListfFun();
|
|
|
|
})
|
|
|
|
this.GetDzSellerConfFun()
|
|
|
|
},
|
|
...
|
...
|
@@ -286,25 +314,31 @@ Page({ |
|
|
|
App.Seller.GetDzSellerConf({
|
|
|
|
sid: this.data.options.sid
|
|
|
|
}).then(res => {
|
|
|
|
let themeColor, textColor, navColor;
|
|
|
|
let themeColor, textColor, navColor,textsInfoColor;
|
|
|
|
if (res.data.cook_style) {
|
|
|
|
let style = util.determine(res.data.cook_style)
|
|
|
|
if (style && style.red && style.green && style.blue && style.alpha) {
|
|
|
|
themeColor = style.red + ',' + style.green + ',' + style.blue + ',' + Math.floor(style.alpha)
|
|
|
|
} else {
|
|
|
|
themeColor = '77,78,80,1'; //未设置 为灰色
|
|
|
|
navColor = "255,255,255,1"
|
|
|
|
textColor = '251,246,241,1'
|
|
|
|
textsInfoColor='153, 153, 153,1'
|
|
|
|
}
|
|
|
|
if (themeColor == '251,246,241,1') {
|
|
|
|
textColor = '0,0,0,1'
|
|
|
|
navColor='0,0,0,1'
|
|
|
|
textsInfoColor='0,0,0,1'
|
|
|
|
} else {
|
|
|
|
navColor = "255,255,255,1"
|
|
|
|
textColor = '251,246,241,1'
|
|
|
|
textsInfoColor='153, 153, 153,1'
|
|
|
|
}
|
|
|
|
this.setData({
|
|
|
|
themeColor,
|
|
|
|
textColor,
|
|
|
|
navColor
|
|
|
|
navColor,
|
|
|
|
textsInfoColor
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}).catch(res => {
|
|
...
|
...
|
@@ -401,10 +435,8 @@ Page({ |
|
|
|
let item=this.findClosest(list,this.data.probablyPrice)
|
|
|
|
let rechargeList=[];
|
|
|
|
item?rechargeList.push(item):'';
|
|
|
|
wx.nextTick(()=>{
|
|
|
|
this.setData({
|
|
|
|
rechargeList,
|
|
|
|
})
|
|
|
|
this.setData({
|
|
|
|
rechargeList,
|
|
|
|
})
|
|
|
|
}).catch(res => {
|
|
|
|
console.log('GetSellerTemplateConf请求失败');
|
...
|
...
|
|