import {rootUrl,rootUrl2} from '../../utils/params';
Page({
data: {
imgUrls: [],
truePrice:'',
title:'',
info:'',
specLst:[], //规格参数
id:'',
attr:'',
num:1,
onePrice: '',
morePrice:'',
infoImgs:[],
indicatorDots: true,
vertical: false,
autoplay: true,
interval: 3000,
duration: 1000,
},
onShareAppMessage() {
return {
title: '佰露集微商城',
desc: '一个专卖良心商品的小网站',
path: `/pages/proInfo/index?id=${this.data.id}`
}
},
querySpec(e){
const attr = e.currentTaget.dataset.value;
this.queryInfo({attr:attr})
},
inputVl(e){
const num = e.detail.value;
this.howMorePri(num)
},
add(){
const num = this.data.num+1;
this.howMorePri(num)
// this.queryInfo({monParam:'morePrice'})
},
cut(){
if (this.data.num < 2) return;
const num = this.data.num-1;
this.howMorePri(num)
},
howMorePri(num){
this.setData({
num:num,
morePrice:num*this.data.onePrice
});
},
queryInfo({id=false,monParam,num=false,attr=false}={}){
const setDa = (money)=>{
const json = {};
json[monParam] = money
return json;
};
wx.request({
url: `${rootUrl}/goods.php?act=price&id=${id?id:this.data.id}&attr=${attr?attr:this.data.attr}&number=${num?num:this.data.num}`,
method: 'GET',
data: {},
header: {
'Accept': 'application/json'
},
success: (res)=> {
this.setData(setDa(res.data.result));
}
})
},
onLoad(options) {
this.setData({
id:options.id
})
this.proData(options.id);
this.queryInfo({id:options.id,monParam:'onePrice',num:1,attr:254});
},
proData(id){
switch(parseInt(id)){
case 80: return this.setData({
title:'【佰露集】鲜嫩嫩蚕丝面膜(修护、舒缓、保湿)',
truePrice : '119.80',
specLst:[
{ value:'141', text:`30g/ml (6片装)` }
],
imgUrls:[
{url:`${rootUrl2}/images/201507/goods_img/80_P_1437472983048.jpg` },
{url:`${rootUrl2}/images/201507/goods_img/80_P_1437472983725.jpg` },
{url:`${rootUrl2}/images/201507/goods_img/80_P_1437702015809.jpg` }
],
info:`鲜嫩嫩蚕丝面膜中添加了独特的辅酶Q10,辅酶Q10存在于每一个细胞中,是细胞活动不可缺少的成分;辅酶Q10是制造使肌肤丰润嫩白的胶原蛋白、透明质酸、水分等的动力来源,不仅具有维持肌肤看戏状态的功效,还能减缓细纹等老化现象对肌肤造成伤害 ,唤醒肌肤自身原有的机能,令肌肤恢复柔滑水嫩;鲜嫩嫩蚕丝面膜能给肌肤带来能量,恢复弹力;补水保湿美白;抗皱、修护受损肌肤等问题; 维持细胞基本功能,维持皮肤光泽;保护细胞不受自由基伤害,维持皮肤组织结构完整。`,
infoImgs:[
{url:`${rootUrl2}/images/upload/Image/鲜嫩嫩.jpg` }
]
});
case 81: return this.setData({
title:'【佰露集】亮晶晶蚕丝面膜(白皙润颜、补水保湿)',
truePrice : '119.80',
specLst:[
{ value:'144', text:`30g/ml (6片装)` }
],
imgUrls:[
{url:`${rootUrl2}/images/201507/goods_img/81_P_1437701957631.jpg` },
{url:`${rootUrl2}/images/201507/goods_img/81_P_1437701957975.jpg` },
{url:`${rootUrl2}/images/201507/goods_img/81_P_1437701957483.jpg` }
],
info:`亮晶晶蚕丝面膜中也特别添加了神经酰胺(Geramide)精华液,不仅保湿、抗氧化、温和滋润,还能缓解皮肤压力,充分补充肌肤不足水分和细胞间脂质,增强皮肤抵抗力,有效锁水,活化肌肤微循环;加速新城代谢,清除自由基,过滤包裹代谢皮肤中已经形成的重金属,深层次改善皮肤皱纹、干燥、衰老、松弛等肌肤问题,使肌肤柔软紧致、润泽、有弹性、重塑V脸。`,
infoImgs:[
{url:`${rootUrl2}/images/upload/Image/亮晶晶.jpg` }
]
});
case 82: return this.setData({
title:'【佰露集】水灵灵蚕丝面膜(水润保湿、净肤清透)',
truePrice : '119.80',
specLst:[
{ value:'146', text:`30g/ml (6片装)` }
],
imgUrls:[
{url:`${rootUrl2}/images/201507/goods_img/82_P_1437473839218.jpg` },
{url:`${rootUrl2}/images/201507/goods_img/82_P_1437473839877.jpg` },
{url:`${rootUrl2}/images/201507/goods_img/82_P_1437701889783.jpg` }
],
info:`水灵灵蚕丝面膜中特别添加的神经酰胺(Geramide)精华液是高效保湿剂,非常易被皮肤吸收,并能促进其它营养物质渗透,与皮肤的结构和功能也有着极为密切的关系,在皮肤的修复、保湿抗衰老等方面也发挥着重要作用;对于皮肤粗糙,干燥保湿有效率为80%,通过氢键形成层状结构的分子复合体,促进表皮的水合作用,从而改善皮肤保持水分的能力,帮助皮肤再恢复,改善皮肤外观,令皮肤光滑有弹性;如果你的皮肤敏感又很干燥,在这种情况下皮肤不仅仅因为缺水,还因肌肤自我屏障功能低下,肌肤无法锁住水分,这时使用水灵灵面膜就像黏着剂一样。`,
infoImgs:[
{url:`${rootUrl2}/images/upload/Image/水灵灵(1).jpg` }
]
});
case 83: return this.setData({
title:'【佰露集】薰衣草蚕丝面膜(补水控油、收缩毛孔)',
truePrice : '99.80',
specLst:[
{ value:'148', text:`25g/ml (6片装)` }
],
imgUrls:[
{url:`${rootUrl2}/images/201507/goods_img/83_P_1437702355738.jpg` },
{url:`${rootUrl2}/images/201507/goods_img/83_P_1437702355522.jpg` },
{url:`${rootUrl2}/images/201507/goods_img/83_P_1437702355292.jpg` }
],
info:`薰衣草对肌肤有很好的调整效果,增强皮肤对环境影响的防护力,全面排出肌肤表面与积累在毛孔中的老废物杂质,唤醒明亮的健康美肌,使用薰衣草面膜后肌肤变得更明亮、润泽和更有弹性;薰衣草面膜能增加肌肤的保水性,使肌肤的保湿效果增大,因而促使肌肤更显亮丽且不易产生过敏反应;增加肌肤的紧缩性及弹性,使松弛的肌肤回复年轻状态,并可因此达到去除皱纹的目的。因保水性及紧缩性的双重作用,薰衣草面膜可改善干性及油性肌肤的分泌状态,使之渐趋于中性肌肤,并促使毛细孔收缩细致。电脑辐射、油脂分泌过剩造成毛孔粗大,使用后平复`,