Commit 7d747089 by zhangquan

细节处理

1 parent e72a06f9
......@@ -14,6 +14,7 @@ Page({
senceData,
actNum: 0,
activeNavIdx: 0,
fromLocal: 0,
// 模态框
isShow: true,
......@@ -75,6 +76,59 @@ Page({
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) {
let { index } = e.currentTarget.dataset;
......@@ -119,69 +173,21 @@ Page({
},
onRoute(options) {
console.log("options: ", options);
let { actNum,activeNavIdx } = options
let { actNum,activeNavIdx,fromLocal } = options
this.setData({
actNum,
activeNavIdx
activeNavIdx,
fromLocal
})
this.createImg()
},
noPageAuth : true,
/**
* 生命周期函数--监听页面加载
*/
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({
},
toSharePage() {
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 = [
img: 'product-img3',
proName: '漆面保护膜',
price: '12000',
profit: '2160000',
profit: '21600万',
type: 'membrane',
productType: 'protectMembrane',
path: 'paintProtect',
sale:100, //销量
sale:10000, //销量
varType: 1
},
{
......@@ -91,7 +91,7 @@ var senceData = [
type: 'membrane',
productType: 'colorMembrane',
path: 'changingFilm',
sale:100, //销量
sale:10000, //销量
varType: 1
}
]
......
......@@ -86,7 +86,7 @@ Page({
showCalculate() {
this.setData({
visible: !this.data.visible,
isReset: false,
isReset: false
});
},
clickDialog(e) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!