Commit 7d747089 by zhangquan

细节处理

1 parent e72a06f9
...@@ -14,6 +14,7 @@ Page({ ...@@ -14,6 +14,7 @@ Page({
senceData, senceData,
actNum: 0, actNum: 0,
activeNavIdx: 0, activeNavIdx: 0,
fromLocal: 0,
// 模态框 // 模态框
isShow: true, isShow: true,
...@@ -75,6 +76,59 @@ Page({ ...@@ -75,6 +76,59 @@ Page({
isShow: true, isShow: true,
}); });
}, },
createImg(){
if(this.data.isShow && this.data.fromLocal==1){
let { actNum,activeNavIdx } = this.data;
let img = `${IMGURL}scene/longpic${actNum + 1}.png`
wx.showLoading({
title: '图片加载中',
})
wx.getImageInfo({
src: img,
success:(res)=> {
ActivityApi.getActivityVisitorList({
actNum, activeNavIdx
}).then(response => {
let imgW = res.width/5, imgH =res.height/5;
this.setData({
imgH: (imgH/imgW)*450
})
let drawFun = new Draw({
width: imgW,
height: imgH
});
let arr = [456,222,0,496]
let imgList = [
{
x: 0,
y: 0,
width: imgW,
height: imgH,
url: img,
},
{
x:imgW-64,
y: imgH-arr[actNum]-64,
width: 64,
height: 64,
url: response, //二维码
},
];
drawFun.begin({
imageList: imgList,
}).then(resp => {
console.log('posterUrl.path',resp)
this.setData({
posterUrl: resp.path,
});
wx.hideLoading()
})
console.log(response,'response')
})
}
})
}
},
// 分享按钮 // 分享按钮
handleClick(e) { handleClick(e) {
let { index } = e.currentTarget.dataset; let { index } = e.currentTarget.dataset;
...@@ -119,69 +173,21 @@ Page({ ...@@ -119,69 +173,21 @@ Page({
}, },
onRoute(options) { onRoute(options) {
console.log("options: ", options); console.log("options: ", options);
let { actNum,activeNavIdx } = options let { actNum,activeNavIdx,fromLocal } = options
this.setData({ this.setData({
actNum, actNum,
activeNavIdx activeNavIdx,
fromLocal
}) })
this.createImg()
}, },
noPageAuth : true,
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
if(this.data.isShow){
let { actNum } = this.data;
let img = `${IMGURL}scene/longpic${actNum + 1}.png`
wx.showLoading({
title: '加载图片中',
})
wx.getImageInfo({
src: img,
success:(res)=> {
ActivityApi.getActivityVisitorList({
actNum, activeNavIdx: 0
}).then(response => {
let imgW = res.width/5, imgH =res.height/5;
this.setData({
imgH: (imgH/imgW)*450
})
let drawFun = new Draw({
width: imgW,
height: imgH
});
let arr = [456,222,0,496]
let imgList = [
{
x: 0,
y: 0,
width: imgW,
height: imgH,
url: img,
},
{
x:imgW-64,
y: imgH-arr[actNum]-64,
width: 64,
height: 64,
url: response, //二维码
},
];
drawFun.begin({
imageList: imgList,
}).then(resp => {
console.log('posterUrl.path',resp)
this.setData({
posterUrl: resp.path,
});
wx.hideLoading()
})
console.log(response,'response')
})
}
})
}
}, },
/** /**
......
...@@ -117,7 +117,7 @@ Component({ ...@@ -117,7 +117,7 @@ Component({
}, },
toSharePage() { toSharePage() {
let { actNum, activeNavIdx ,senceData} = this.data; let { actNum, activeNavIdx ,senceData} = this.data;
wx.$router.go("checkProduct", { actNum, activeNavIdx ,senceData}); wx.$router.go("checkProduct", { actNum, activeNavIdx ,senceData, fromLocal:1});
}, },
} }
}) })
...@@ -76,11 +76,11 @@ var senceData = [ ...@@ -76,11 +76,11 @@ var senceData = [
img: 'product-img3', img: 'product-img3',
proName: '漆面保护膜', proName: '漆面保护膜',
price: '12000', price: '12000',
profit: '2160000', profit: '21600万',
type: 'membrane', type: 'membrane',
productType: 'protectMembrane', productType: 'protectMembrane',
path: 'paintProtect', path: 'paintProtect',
sale:100, //销量 sale:10000, //销量
varType: 1 varType: 1
}, },
{ {
...@@ -91,7 +91,7 @@ var senceData = [ ...@@ -91,7 +91,7 @@ var senceData = [
type: 'membrane', type: 'membrane',
productType: 'colorMembrane', productType: 'colorMembrane',
path: 'changingFilm', path: 'changingFilm',
sale:100, //销量 sale:10000, //销量
varType: 1 varType: 1
} }
] ]
......
...@@ -86,7 +86,7 @@ Page({ ...@@ -86,7 +86,7 @@ Page({
showCalculate() { showCalculate() {
this.setData({ this.setData({
visible: !this.data.visible, visible: !this.data.visible,
isReset: false, isReset: false
}); });
}, },
clickDialog(e) { clickDialog(e) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!