Commit 4eb0d246 by 张立顺

bug修复

1 parent 5398db2f
...@@ -37,12 +37,16 @@ Component({ ...@@ -37,12 +37,16 @@ Component({
}) })
}, },
async init(n, ImgWidth, ImgHeight) { async init(n, ImgWidth, ImgHeight) {
let proportion = ImgWidth / 247
let actualHeight = ImgHeight / proportion
console.log(actualHeight)
wx.$api.showLoading() wx.$api.showLoading()
const drawfun = new Draw( const drawfun = new Draw(
{ {
width: 279, width: 279,
height: 554 // height: 554
height: 82 + actualHeight
}, },
this this
), ),
...@@ -61,7 +65,7 @@ Component({ ...@@ -61,7 +65,7 @@ Component({
x: 16, x: 16,
y: 70, y: 70,
width: 247, width: 247,
height: 472, height: actualHeight,
url: n.posterUrl url: n.posterUrl
} }
], ],
......
...@@ -21,7 +21,9 @@ ...@@ -21,7 +21,9 @@
.poster { .poster {
width: 558rpx; width: 558rpx;
height: 60%; // height: 60%;
height: 1108rpx;
overflow: scroll;
border-radius: 8rpx; border-radius: 8rpx;
} }
......
<block wx:if="{{show}}"> <block wx:if="{{show}}">
<view class="layout" catchtouchmove="noScroll"> <!-- catchtouchmove="noScroll" -->
<view class="bg" bindtap="hide"></view> <view class="layout">
<image src="{{poster}}" class="poster" mode="aspectFit"></image> <view class="bg" bindtap="hide" />
<view class="btn" bindtap="download">保存至相册</view> <view class="poster">
<view class="tips"> <!-- <scroll-view scroll-x="false" scroll-y="true" style="height: 100%"> -->
提示:这是您的专属活动海报,请下载转发给门店员工注册并参与活动分享。请不要将此海报转发给非相关活动参与者,避免活动数据泄漏。 <image src="{{poster}}" mode="widthFix" />
<!-- </scroll-view> -->
</view> </view>
<view class="btn" bindtap="download">保存至相册</view>
<view class="tips">提示:这是您的专属活动海报,请下载转发给门店员工注册并参与活动分享。请不要将此海报转发给非相关活动参与者,避免活动数据泄漏。</view>
</view> </view>
</block> </block>
<authorize scopeType="writePhotosAlbum" bindfail="authFail" show="{{showAuth}}" isShowCheck="{{false}}" id="auth"></authorize>
\ No newline at end of file \ No newline at end of file
<authorize
scopeType="writePhotosAlbum"
bindfail="authFail"
show="{{showAuth}}"
isShowCheck="{{false}}"
id="auth" />
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
wx:key="index" wx:key="index"
bindtap="handleClick" bindtap="handleClick"
data-idx="{{index + 1}}"> data-idx="{{index + 1}}">
<view wx:if="{{hasOpenIcon && formData['scene' + (index + 1)] && sceneActive != (index + 1)}}" class="open-icon"> <!-- && sceneActive != (index + 1) -->
<view wx:if="{{hasOpenIcon && formData['scene' + (index + 1)]}}" class="open-icon">
<image src="{{openedIcon}}" webp></image> <image src="{{openedIcon}}" webp></image>
</view> </view>
<image wx:if="{{formData['scene' + (index + 1)]}}" class="scene-img" src="{{IMGURL}}output/caract0{{index + 1}}.png?v={{img_version}}" /> <image wx:if="{{formData['scene' + (index + 1)]}}" class="scene-img" src="{{IMGURL}}output/caract0{{index + 1}}.png?v={{img_version}}" />
......
// packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.js
import Draw from '~/utils/Draw'
Component({
/**
* 组件的属性列表
*/
properties: {
item: {
type: Object,
observer(n) {
console.log(n, '=================')
this.getImageInfo(n)
}
}
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
getImageInfo(n) {
let that = this
wx.getImageInfo({
src: n.posterUrl,
success: function (res) {
console.log(res)
// w = res.width
// h = res.height
that.init(n, res.width, res.height)
}
})
},
async init(n, ImgWidth, ImgHeight) {
let proportion = ImgWidth / 247
let actualHeight = ImgHeight / proportion
console.log(actualHeight)
wx.$api.showLoading()
const drawfun = new Draw(
{
width: 279,
// height: 554
height: 82 + actualHeight
},
this
),
{ userInfo } = wx.$storage.get(),
merchantName = userInfo.merchantName.length > 12 ? `${userInfo.merchantName.substring(0, 12)}...` : userInfo.merchantName,
res = await drawfun.begin({
imageList: [
{
x: 0,
y: 0,
width: 279,
height: 66,
url: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/output/poster-bg.png'
},
{
x: 16,
y: 70,
width: 247,
height: actualHeight,
url: n.posterUrl
}
],
textList: [
{
x: 12,
y: 14,
fontSize: 14,
color: '#2D2D33',
text: merchantName,
textBaseline: 'top'
},
{
x: 12,
y: 36,
fontSize: 14,
color: '#1B233D',
text: n.activityName,
textBaseline: 'top',
fontWeight: 500
},
{
x: 14 + drawfun.getTextWidth(n.activityName, 14) + 9,
y: 37,
fontSize: 10,
color: '#4466F0',
text: '众筹',
textBaseline: 'top',
border: {
width: 1,
color: '#4466F0',
radius: 2,
padding: [2, 5],
opacity: 0.5
}
}
]
})
console.log(res)
wx.hideLoading()
this.setData({
poster: res.path,
show: true
})
},
download() {
const filePath = this.data.poster,
_this = this
wx.saveImageToPhotosAlbum({
filePath,
success() {
wx.$api.showToast('保存成功')
},
fail(err) {
const auth = _this.selectComponent('#auth')
auth.check()
}
})
},
hide() {
this.setData({
show: false,
poster: ''
})
},
noScroll() {},
authFail(e) {
this.setData({
showAuth: true
})
}
}
})
{
"component": true,
"usingComponents": {
"authorize": "../../../../../components/Authorize/Authorize"
}
}
/* packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.wxss */
.layout {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 998;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.bg {
position: absolute;
width: 100%;
height: 100%;
z-index: -1;
background: rgba(28, 27, 35, 0.60);
}
.poster {
width: 558rpx;
// height: 60%;
height: 1108rpx;
overflow: scroll;
border-radius: 8rpx;
}
.btn {
width: 320rpx;
height: 88rpx;
line-height: 88rpx;
background-image: linear-gradient(-60deg, #556AF5 0%, #7197FF 100%);
border-radius: 16rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
margin-top: 32rpx;
}
.tips {
margin: 16rpx 80rpx 0;
font-size: 24rpx;
color: #FFFFFF;
line-height: 36rpx;
}
}
\ No newline at end of file \ No newline at end of file
<block wx:if="{{show}}">
<view class="layout">
<!-- catchtouchmove="noScroll" -->
<view class="bg" bindtap="hide" />
<view class="poster">
<image src="{{poster}}" mode="widthFix" />
</view>
<view class="btn" bindtap="download">下载图片并转发</view>
<!-- <view class="tips">提示:这是您的专属活动海报,请下载转发给门店员工注册并参与活动分享。请不要将此海报转发给非相关活动参与者,避免活动数据泄漏。</view> -->
</view>
</block>
<authorize
scopeType="writePhotosAlbum"
bindfail="authFail"
show="{{showAuth}}"
isShowCheck="{{false}}"
id="auth" />
...@@ -434,7 +434,7 @@ Page({ ...@@ -434,7 +434,7 @@ Page({
}) })
wx.$storage.set('firstLogin', 'firstLogin') wx.$storage.set('firstLogin', 'firstLogin')
} }
if(this.data.guideShow){ if (this.data.guideShow) {
wx.$storage.set('disLikeRecordFlag', true) wx.$storage.set('disLikeRecordFlag', true)
let disLikeRecordFlag = wx.$storage.get('disLikeRecordFlag') let disLikeRecordFlag = wx.$storage.get('disLikeRecordFlag')
this.setData({ this.setData({
......
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
"usingComponents": { "usingComponents": {
"product": "./components/product/product", "product": "./components/product/product",
"vas-toast": "./components/likeToast/likeToast", "vas-toast": "./components/likeToast/likeToast",
"shareModel": "./components/shareModel/shareModel" "shareModel": "./components/shareModel/shareModel",
"crowdfund-poster": "./components/CrowdfundPoster/CrowdfundPoster"
}, },
"navigationStyle": "custom", "navigationStyle": "custom",
"onReachBottomDistance":50 "onReachBottomDistance": 50
} }
...@@ -15,7 +15,7 @@ Component({ ...@@ -15,7 +15,7 @@ Component({
}, },
formData: { formData: {
type: Object, type: Object,
value: () => { } value: () => {}
}, },
scenePriceList: { scenePriceList: {
type: Array, type: Array,
...@@ -28,19 +28,25 @@ Component({ ...@@ -28,19 +28,25 @@ Component({
*/ */
data: { data: {
IMGURL: IMG_URL, IMGURL: IMG_URL,
custSceneList: [{ openedIcon: `${IMG_URL}/output/openedIcon.png`,
custSceneList: [
{
title: '新车洽谈场景', title: '新车洽谈场景',
subTitle: '1.0新车权益销售' subTitle: '1.0新车权益销售'
}, { },
{
title: '新车交付场景', title: '新车交付场景',
subTitle: '1.1新车精品升级' subTitle: '1.1新车精品升级'
}, { },
{
title: '0-12个月', title: '0-12个月',
subTitle: '1.2新车线上转化' subTitle: '1.2新车线上转化'
}, { },
{
title: '12个月以上', title: '12个月以上',
subTitle: '1.3存量用户众筹' subTitle: '1.3存量用户众筹'
}] }
]
}, },
/** /**
......
...@@ -6,9 +6,11 @@ ...@@ -6,9 +6,11 @@
wx:key="index" wx:key="index"
bindtap="handleClick" bindtap="handleClick"
data-idx="{{index + 1}}"> data-idx="{{index + 1}}">
<view wx:if="{{formData['showList'][index]}}" class="open-icon">已开通</view> <view wx:if="{{formData['showList'][index]}}" class="open-icon">
<image src="{{openedIcon}}" webp></image>
</view>
<image wx:if="{{formData['showList'][index]}}" class="scene-img" src="{{IMGURL}}output/caract0{{index + 1}}.png?v={{img_version}}" /> <image wx:if="{{formData['showList'][index]}}" class="scene-img" src="{{IMGURL}}output/caract0{{index + 1}}.png?v={{img_version}}" />
<image wx:else class="scene-img" src="{{IMGURL}}output/car0{{index + 1}}.png?v={{img_version}}" /> <image wx:else class="lock-img " src="{{IMGURL}}output/carlock0{{index + 1}}.png?v={{img_version}}" />
<view class="scene-title {{formData['showList'][index]?'':'notOpened'}}">{{item.title}}</view> <view class="scene-title {{formData['showList'][index]?'':'notOpened'}}">{{item.title}}</view>
<view>{{item.subTitle}}</view> <view>{{item.subTitle}}</view>
<!-- wx:if="{{scenePriceList.length}}" --> <!-- wx:if="{{scenePriceList.length}}" -->
......
...@@ -41,16 +41,11 @@ ...@@ -41,16 +41,11 @@
.open-icon { .open-icon {
box-sizing: border-box; box-sizing: border-box;
position: absolute; position: absolute;
left: 0.5rpx; position: absolute;
top: 0.5rpx; top: 0;
width: 56rpx; right: 0;
height: 32rpx; width: 78rpx;
line-height: 24rpx; height: 78rpx;
background: #FEEBD6;
border-radius: 6rpx 0 8rpx 0;
font-size: 16rpx;
color: #EF971E;
padding: 4rpx;
} }
/* 已开通 - end */ /* 已开通 - end */
...@@ -102,3 +97,8 @@ ...@@ -102,3 +97,8 @@
color: #3666FE; color: #3666FE;
font-weight: 600; font-weight: 600;
} }
.lock-img {
width: 92rpx;
height: 64rpx;
}
\ No newline at end of file \ No newline at end of file
...@@ -70,6 +70,7 @@ const domain = { ...@@ -70,6 +70,7 @@ const domain = {
商城: 192.168.2.3:8558 */ 商城: 192.168.2.3:8558 */
dev: 'https://scrm.dev.glsx.com.cn', dev: 'https://scrm.dev.glsx.com.cn',
uat: 'https://scrm.test.glsx.com.cn', uat: 'https://scrm.test.glsx.com.cn',
// uat: 'https://scrm.beta.glsx.com.cn',
prod: 'https://scrm.cgacar.com' prod: 'https://scrm.cgacar.com'
}[target[index]] }[target[index]]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!