Commit 25c100b3d040bb6270bac6c2960f506426c8991b
1 parent
9015249a
幸运大转盘分享海报中分享图片尺寸自适应问题修改(小程序码目前写死)
Showing
3 changed files
with
36 additions
and
23 deletions
packageB/pages/luckactivity/luckinfo/luckinfo.js
... | ... | @@ -38,7 +38,7 @@ let imgDraw = { |
38 | 38 | "css": { |
39 | 39 | "color": "#fff", |
40 | 40 | "background": "#FF6768", |
41 | - "width": "110px", | |
41 | + "width": "105px", | |
42 | 42 | "height": "26px", |
43 | 43 | "lineHeight": "26px", |
44 | 44 | "top": "70px", |
... | ... | @@ -53,20 +53,18 @@ let imgDraw = { |
53 | 53 | "type": "text", |
54 | 54 | "text": "", |
55 | 55 | "css": { |
56 | - "color": "red", | |
57 | 56 | "width": "554px", |
58 | 57 | "padding": "20px", |
59 | 58 | "left": "20px", |
60 | - "top": "140px", | |
59 | + "top": "160px", | |
61 | 60 | "fontSize": "28px", |
62 | - "textAlign": "center", | |
61 | + "textAlign": "left", | |
63 | 62 | "maxLines": "1", |
64 | - "fontWeight": "bold", | |
65 | 63 | } |
66 | 64 | }, |
67 | 65 | { //4.分享内容 |
68 | 66 | "type": "text", |
69 | - "text": "分享内容分享内容分享内容分享内容分享内容分享内容分享内容分享内容分享内容", | |
67 | + "text": "", | |
70 | 68 | "css": { |
71 | 69 | "color": "#000000", |
72 | 70 | "width": "554px", |
... | ... | @@ -82,9 +80,11 @@ let imgDraw = { |
82 | 80 | "type": "image", |
83 | 81 | "url": "/packageB/images/luckDraw/jiang.png", |
84 | 82 | "css": { |
85 | - "width": "554px", | |
83 | + "width": "auto", | |
86 | 84 | "height": "350px", |
87 | - "top": "240px", | |
85 | + "top": "230px", | |
86 | + "left": "277px", | |
87 | + "align": "center", | |
88 | 88 | "mode": "aspectFill", |
89 | 89 | } |
90 | 90 | }, |
... | ... | @@ -364,7 +364,7 @@ Page({ |
364 | 364 | |
365 | 365 | self.setData({ |
366 | 366 | 'imgDraw.views[3].text': self.data.luckInfo.act_name,//分享标题 |
367 | - 'imgDraw.views[4].text': '快来一起抽奖吧,精美奖品等着你!',//分享内容 | |
367 | + // 'imgDraw.views[4].text': '快来一起抽奖吧,精美奖品等着你!',//分享内容 | |
368 | 368 | 'imgDraw.views[14].text': util.formar_no_full(self.data.luckInfo.begindate) + ' 至 ' + util.formar_no_full(self.data.luckInfo.enddate),//活动时间 |
369 | 369 | }); |
370 | 370 | |
... | ... | @@ -372,18 +372,30 @@ Page({ |
372 | 372 | let url = `/api/weshop/marketing/marketingLuckTemplate/get/0/${luckInfo.template_id}`; |
373 | 373 | app.request.get(url, { |
374 | 374 | success: function(res) { |
375 | - // if(res.data.code == 0) { | |
375 | + if(res.data.code == 0) { | |
376 | 376 | self.setData({ |
377 | 377 | template: res.data.data, |
378 | - bannerUrl: imghost + ((res.data.data&&res.data.data.bannerUrl) ? res.data.data.bannerUrl:'miniapp/images/luckDraw/bg.png?v=2'), //背景图 | |
379 | - 'blocks[0].imgs[0].src': imghost + ((res.data.data&&res.data.data.wheelBaseUrl) ? res.data.data.wheelBaseUrl:'miniapp/images/luckDraw/weel.png?v=2'), //转盘 | |
380 | - 'buttons[0].imgs[0].src': imghost + ((res.data.data&&res.data.data.wheelPointerUrl) ? res.data.data.wheelPointerUrl:'miniapp/images/luckDraw/pointer.png?v=2'), //指针 | |
381 | - 'imgDraw.views[3].text': (res.data.data&&res.data.data.title) ? res.data.data.title : self.data.luckInfo.act_name,//分享标题 | |
382 | - 'imgDraw.views[4].text': (res.data.data&&res.data.data.share_content) ? res.data.data.share_content : '快来一起抽奖吧,精美奖品等着你!',//分享标题 | |
383 | - 'imgDraw.views[5].url': (res.data.data&&res.data.data.share_image) ? (imghost + res.data.data.share_image):(self.data.luckInfo.imageurl ? (imghost + self.data.luckInfo.imageurl):'/packpageB/images/luckDraw/jiang.png'),//分享图片 | |
384 | - 'imgDraw.views[14].text': util.formar_no_full(self.data.luckInfo.begindate) + ' 至 ' + util.formar_no_full(self.data.luckInfo.enddate),//活动时间 | |
378 | + bannerUrl: imghost + res.data.data.bannerUrl, //背景图 | |
379 | + 'blocks[0].imgs[0].src': imghost + res.data.data.wheelBaseUrl, //转盘 | |
380 | + 'buttons[0].imgs[0].src': imghost + res.data.data.wheelPointerUrl, //指针 | |
381 | + 'imgDraw.views[3].text': res.data.data.title, //分享标题 | |
382 | + 'imgDraw.views[5].url': imghost + res.data.data.share_image, //分享图片 | |
385 | 383 | }); |
386 | - // }; | |
384 | + | |
385 | + // self.setData({ | |
386 | + // template: res.data.data, | |
387 | + // bannerUrl: imghost + res.data.data.bannerUrl, //背景图 | |
388 | + // //bannerUrl: imghost + ((res.data.data&&res.data.data.bannerUrl) ? res.data.data.bannerUrl:'miniapp/images/luckDraw/bg.png?v=2'), //背景图 | |
389 | + // 'blocks[0].imgs[0].src': imghost + res.data.data&&res.data.data.wheelBaseUrl) ? res.data.data.wheelBaseUrl:'miniapp/images/luckDraw/weel.png?v=2'), //转盘 | |
390 | + // 'buttons[0].imgs[0].src': imghost + ((res.data.data&&res.data.data.wheelPointerUrl) ? res.data.data.wheelPointerUrl:'miniapp/images/luckDraw/pointer.png?v=2'), //指针 | |
391 | + // 'imgDraw.views[3].text': (res.data.data&&res.data.data.title) ? res.data.data.title : self.data.luckInfo.act_name,//分享标题 | |
392 | + // // 'imgDraw.views[4].text': (res.data.data&&res.data.data.share_content) ? res.data.data.share_content : '快来一起抽奖吧,精美奖品等着你!',//分享内容 | |
393 | + // 'imgDraw.views[5].url': (res.data.data&&res.data.data.share_image) ? (imghost + res.data.data.share_image):(self.data.luckInfo.imageurl ? (imghost + self.data.luckInfo.imageurl):'/packpageB/images/luckDraw/jiang.png'),//分享图片 | |
394 | + // 'imgDraw.views[14].text': util.formar_no_full(self.data.luckInfo.begindate) + ' 至 ' + util.formar_no_full(self.data.luckInfo.enddate),//活动时间 | |
395 | + // }); | |
396 | + } else { | |
397 | + | |
398 | + }; | |
387 | 399 | |
388 | 400 | }, |
389 | 401 | }); |
... | ... | @@ -392,6 +404,7 @@ Page({ |
392 | 404 | if(luckInfo && luckInfo.store_bannerUrl) { |
393 | 405 | self.setData({ |
394 | 406 | bannerUrl: imghost + luckInfo.store_bannerUrl, |
407 | + custom: true, | |
395 | 408 | }); |
396 | 409 | }; |
397 | 410 | |
... | ... | @@ -470,9 +483,9 @@ Page({ |
470 | 483 | // let user_id = app.globalData.userInfo.user_id; |
471 | 484 | |
472 | 485 | wx.getImageInfo({ |
473 | - src: `${mainUrl}/api/wx/open/app/user/getWeAppEwm/${store_id}?sceneValue=${user_id}_${cj_id}&pageValue=packageB/pages/luckactivity/luckinfo/luckinfo`, | |
486 | + src: `${mainUrl}/api/wx/open/app/user/getWeAppEwm/${store_id}?sceneValue=${user_id}_${cj_id}&pageValue=pages/index/index/index`, | |
474 | 487 | success (res) { |
475 | - if(res.data.code != -1) { | |
488 | + if(res.code != -1) { | |
476 | 489 | self.setData({ |
477 | 490 | 'imgDraw.views[16].url': res.path, |
478 | 491 | }); | ... | ... |
packageB/pages/luckactivity/luckinfo/luckinfo.wxml
1 | 1 | <wxs module="filter" src="../../../../utils/filter.wxs"></wxs> |
2 | 2 | <wxs module="tool" src="./tool.wxs"></wxs> |
3 | -<view class="luck-container {{template ? '':'on'}}" style="background: {{template.colorCode ? template.colorCode:'#f0f0f0'}} url({{bannerUrl ? bannerUrl:(imghost + 'miniapp/images/luckDraw/bg.png?v=2')}}) no-repeat;"> | |
3 | +<view class="luck-container {{!template&&custom ? 'on':''}}" style="background: {{template&&template.colorCode ? template.colorCode:(custom ? '#f0f0f0':'#da104b')}} url({{bannerUrl ? bannerUrl:(imghost + 'miniapp/images/luckDraw/bg.png?v=2')}}) no-repeat;"> | |
4 | 4 | <!-- 中奖人员 --> |
5 | 5 | <view class="swiper-container" wx:if="{{nameList && nameList.length != 0}}"> |
6 | 6 | <swiper class="swiper" autoplay="true" circular="true" vertical="true" interval="3000"> |
... | ... | @@ -36,7 +36,7 @@ |
36 | 36 | /> |
37 | 37 | </view> |
38 | 38 | <view class="weel-txt fs28 white t-c pdt10" wx:if="{{luckInfo.vip_act_num == 0}}">今天你有 <text class="fs50 c-yellow cs">不限次</text> 抽奖机会</view> |
39 | - <view class="weel-txt fs28 white t-c pdt10" wx:else>今天你还有 <text class="fs50 c-yellow">{{filter.show_default(luckInfo.user_LuckNumDay, '0')}}</text> 次抽奖机会</view> | |
39 | + <view class="weel-txt fs28 white t-c pdt10" wx:else>今天你还有 <text class="fs50 c-yellow cs">{{filter.show_default(luckInfo.user_LuckNumDay, '0')}}</text> 次抽奖机会</view> | |
40 | 40 | <view class="tip-to-down expand-transition"> |
41 | 41 | <text></text> |
42 | 42 | <text></text> | ... | ... |