diff --git a/packageB/pages/luckactivity/luckinfo/luckinfo.js b/packageB/pages/luckactivity/luckinfo/luckinfo.js index 6bbe8ab..4ae0e1e 100644 --- a/packageB/pages/luckactivity/luckinfo/luckinfo.js +++ b/packageB/pages/luckactivity/luckinfo/luckinfo.js @@ -10,7 +10,7 @@ let imgDraw = { "views": [ { //0.头像 "type": "image", - // "url": "", + // "url": app.globalData.userInfo.head_pic, "css": { "background": "white", "width": "80px", @@ -81,8 +81,8 @@ let imgDraw = { "url": "/packageB/images/luckDraw/jiang.png", "css": { "width": "auto", - "height": "350px", - "top": "230px", + "height": "380px", + "top": "220px", "left": "277px", "align": "center", "mode": "aspectFill", @@ -94,7 +94,7 @@ let imgDraw = { "css": { "width": "30px", "height": "30px", - "top": "620px", + "top": "630px", "left": "18px", "rotate": "0", "borderRadius": "30px", @@ -106,7 +106,7 @@ let imgDraw = { "css": { "color": "red", "width": "110px", - "top": "620px", + "top": "630px", "left": "52px", "fontSize": "22px", } @@ -117,7 +117,7 @@ let imgDraw = { "css": { "width": "30px", "height": "30px", - "top": "620px", + "top": "630px", "left": "208px", "borderRadius": "30px", } @@ -128,7 +128,7 @@ let imgDraw = { "css": { "color": "red", "width": "129px", - "top": "620px", + "top": "630px", "left": "243px", "fontSize": "22px", } @@ -139,7 +139,7 @@ let imgDraw = { "css": { "width": "30px", "height": "30px", - "top": "620px", + "top": "630px", "left": "410px", "borderRadius": "30px", } @@ -150,7 +150,7 @@ let imgDraw = { "css": { "color": "red", "width": "121px", - "top": "620px", + "top": "630px", "left": "450px", "fontSize": "22px", } @@ -193,7 +193,7 @@ let imgDraw = { "css": { "color": "#7c7c7c", "width": "348px", - "top": "810px", + "top": "820px", "left": "27px", "fontSize": "24px", } @@ -205,7 +205,7 @@ let imgDraw = { "css": { "width": "150px", "height": "150px", - "top": "705px", + "top": "715px", "left": "380px", "mode": "scaleToFill" } @@ -217,7 +217,7 @@ let imgDraw = { Page({ data: { - imgDraw: imgDraw, + imgDraw, start: false, list: null, isLoading: false, // 检测是否已经发送请求,防止重复发送请求 @@ -239,6 +239,7 @@ Page({ blocks: [{ padding: '76rpx', imgs: [{ + src: imghost + 'miniapp/images/luckDraw/weel.png?v=3', width: '700rpx', height: '700rpx', rotate: true, @@ -247,6 +248,7 @@ Page({ buttons: [{ radius: '60rpx', imgs: [{ + src: imghost + 'miniapp/images/luckDraw/pointer.png?v=3', width: '188rpx', height: '230rpx', top: '-130rpx', @@ -310,12 +312,28 @@ Page({ onShow() { // console.log('show~~`'); + if(app.globalData.userInfo) { if(!this.data.isLogin) { + // 下载头像 + let path = app.globalData.userInfo.head_pic; + path = path.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); + path = path.replace("https://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); + wx.downloadFile({ + url: path, //仅为示例,并非真实的资源 + success (res) { + // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容 + if (res.statusCode === 200) { + self.setData({ + 'imgDraw.views[0].url': res.tempFilePath,//头像 + }); + } + } + }); + this.setData({ userInfo: app.globalData.userInfo, isLogin: true, - 'imgDraw.views[0].url': app.globalData.userInfo.head_pic,//头像 'imgDraw.views[1].text': app.globalData.userInfo.nickname,//昵称 }); // console.log('imghost', this.data.imghost); @@ -340,6 +358,12 @@ Page({ icon: 'none', }); self.data.msg = res.data.msg; + // self.setData({ + // bannerUrl: imghost + 'miniapp/images/luckDraw/bg.png?v=2', + // 'blocks[0].imgs[0].src': imghost + 'miniapp/images/luckDraw/weel.png?v=3', //转盘 + // 'buttons[0].imgs[0].src': imghost + 'miniapp/images/luckDraw/pointer.png?v=3', //指针 + // }); + }; // console.log('luckInfo', res.data.data); @@ -369,6 +393,7 @@ Page({ 'buttons[0].imgs[0].src': imghost + ((template&&template.wheelPointerUrl) ? template.wheelPointerUrl:'miniapp/images/luckDraw/pointer.png?v=3'), //指针 'imgDraw.views[3].text': template.title, //分享标题 'imgDraw.views[5].url': imghost + (template&&template.share_image ? template.share_image:self.data.luckInfo.imageurl), //分享图片 + imgDraw: imgDraw, }); let color = template&&template.colorCode ? template.colorCode:'#da104b'; diff --git a/packageB/pages/luckactivity/luckinfo/luckinfo.wxss b/packageB/pages/luckactivity/luckinfo/luckinfo.wxss index 2b88782..b97203d 100644 --- a/packageB/pages/luckactivity/luckinfo/luckinfo.wxss +++ b/packageB/pages/luckactivity/luckinfo/luckinfo.wxss @@ -434,7 +434,9 @@ page, color: #FFE12F; padding: 0 10rpx; } - +.bdt:only-child { + border-top: none; +} .bdt ~ .bdt { border-top: 2rpx solid #ebedf0; } @@ -450,8 +452,8 @@ page, } .poster { - width: 554rpx; - height: 899rpx; + width: 620rpx; + height: 995rpx; /* border-radius: 16rpx; */ margin: 0 auto; /* background-color: pink; */