Commit 25c100b3d040bb6270bac6c2960f506426c8991b

Authored by taiyuan
1 parent 9015249a

幸运大转盘分享海报中分享图片尺寸自适应问题修改(小程序码目前写死)

packageB/pages/luckactivity/luckinfo/luckinfo.js
@@ -38,7 +38,7 @@ let imgDraw = { @@ -38,7 +38,7 @@ let imgDraw = {
38 "css": { 38 "css": {
39 "color": "#fff", 39 "color": "#fff",
40 "background": "#FF6768", 40 "background": "#FF6768",
41 - "width": "110px", 41 + "width": "105px",
42 "height": "26px", 42 "height": "26px",
43 "lineHeight": "26px", 43 "lineHeight": "26px",
44 "top": "70px", 44 "top": "70px",
@@ -53,20 +53,18 @@ let imgDraw = { @@ -53,20 +53,18 @@ let imgDraw = {
53 "type": "text", 53 "type": "text",
54 "text": "", 54 "text": "",
55 "css": { 55 "css": {
56 - "color": "red",  
57 "width": "554px", 56 "width": "554px",
58 "padding": "20px", 57 "padding": "20px",
59 "left": "20px", 58 "left": "20px",
60 - "top": "140px", 59 + "top": "160px",
61 "fontSize": "28px", 60 "fontSize": "28px",
62 - "textAlign": "center", 61 + "textAlign": "left",
63 "maxLines": "1", 62 "maxLines": "1",
64 - "fontWeight": "bold",  
65 } 63 }
66 }, 64 },
67 { //4.分享内容 65 { //4.分享内容
68 "type": "text", 66 "type": "text",
69 - "text": "分享内容分享内容分享内容分享内容分享内容分享内容分享内容分享内容分享内容", 67 + "text": "",
70 "css": { 68 "css": {
71 "color": "#000000", 69 "color": "#000000",
72 "width": "554px", 70 "width": "554px",
@@ -82,9 +80,11 @@ let imgDraw = { @@ -82,9 +80,11 @@ let imgDraw = {
82 "type": "image", 80 "type": "image",
83 "url": "/packageB/images/luckDraw/jiang.png", 81 "url": "/packageB/images/luckDraw/jiang.png",
84 "css": { 82 "css": {
85 - "width": "554px", 83 + "width": "auto",
86 "height": "350px", 84 "height": "350px",
87 - "top": "240px", 85 + "top": "230px",
  86 + "left": "277px",
  87 + "align": "center",
88 "mode": "aspectFill", 88 "mode": "aspectFill",
89 } 89 }
90 }, 90 },
@@ -364,7 +364,7 @@ Page({ @@ -364,7 +364,7 @@ Page({
364 364
365 self.setData({ 365 self.setData({
366 'imgDraw.views[3].text': self.data.luckInfo.act_name,//分享标题 366 'imgDraw.views[3].text': self.data.luckInfo.act_name,//分享标题
367 - 'imgDraw.views[4].text': '快来一起抽奖吧,精美奖品等着你!',//分享内容 367 + // 'imgDraw.views[4].text': '快来一起抽奖吧,精美奖品等着你!',//分享内容
368 'imgDraw.views[14].text': util.formar_no_full(self.data.luckInfo.begindate) + ' 至 ' + util.formar_no_full(self.data.luckInfo.enddate),//活动时间 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,18 +372,30 @@ Page({
372 let url = `/api/weshop/marketing/marketingLuckTemplate/get/0/${luckInfo.template_id}`; 372 let url = `/api/weshop/marketing/marketingLuckTemplate/get/0/${luckInfo.template_id}`;
373 app.request.get(url, { 373 app.request.get(url, {
374 success: function(res) { 374 success: function(res) {
375 - // if(res.data.code == 0) { 375 + if(res.data.code == 0) {
376 self.setData({ 376 self.setData({
377 template: res.data.data, 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,6 +404,7 @@ Page({
392 if(luckInfo && luckInfo.store_bannerUrl) { 404 if(luckInfo && luckInfo.store_bannerUrl) {
393 self.setData({ 405 self.setData({
394 bannerUrl: imghost + luckInfo.store_bannerUrl, 406 bannerUrl: imghost + luckInfo.store_bannerUrl,
  407 + custom: true,
395 }); 408 });
396 }; 409 };
397 410
@@ -470,9 +483,9 @@ Page({ @@ -470,9 +483,9 @@ Page({
470 // let user_id = app.globalData.userInfo.user_id; 483 // let user_id = app.globalData.userInfo.user_id;
471 484
472 wx.getImageInfo({ 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 success (res) { 487 success (res) {
475 - if(res.data.code != -1) { 488 + if(res.code != -1) {
476 self.setData({ 489 self.setData({
477 'imgDraw.views[16].url': res.path, 490 'imgDraw.views[16].url': res.path,
478 }); 491 });
packageB/pages/luckactivity/luckinfo/luckinfo.wxml
1 <wxs module="filter" src="../../../../utils/filter.wxs"></wxs> 1 <wxs module="filter" src="../../../../utils/filter.wxs"></wxs>
2 <wxs module="tool" src="./tool.wxs"></wxs> 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 <view class="swiper-container" wx:if="{{nameList && nameList.length != 0}}"> 5 <view class="swiper-container" wx:if="{{nameList && nameList.length != 0}}">
6 <swiper class="swiper" autoplay="true" circular="true" vertical="true" interval="3000"> 6 <swiper class="swiper" autoplay="true" circular="true" vertical="true" interval="3000">
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 /> 36 />
37 </view> 37 </view>
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> 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 <view class="tip-to-down expand-transition"> 40 <view class="tip-to-down expand-transition">
41 <text></text> 41 <text></text>
42 <text></text> 42 <text></text>
packageB/pages/luckactivity/luckinfo/luckinfo.wxss
@@ -470,7 +470,7 @@ page, @@ -470,7 +470,7 @@ page,
470 } 470 }
471 471
472 .luck-container.on .panel { 472 .luck-container.on .panel {
473 - box-shadow: 0 16rpx 24rpx #e7e9eb; 473 + box-shadow: 0 0 24rpx #e7e9eb;
474 } 474 }
475 475
476 .luck-container.on .cs { 476 .luck-container.on .cs {