This commit is contained in:
dong_bo0602 2021-08-06 11:07:14 +08:00
parent c2ed1e14f2
commit c694c70373
4 changed files with 80 additions and 79 deletions

View File

@ -234,13 +234,14 @@ Page({
} else {
area[i]['templateAreaFontStyle'] = 'italic'
}
if (area[i].templateAreaServerLink == '1') {
if (area[i].templateAreaFontValue.length > area[i].templateAreaFontLength) {
area[i].templateAreaFontValue = area[i].templateAreaFontValue.substring(area[i].templateAreaFontLength, -1)
}
}
// if (area[i].templateAreaServerLink == '1') {
// if (area[i].templateAreaFontValue.length > area[i].templateAreaFontLength) {
// area[i].templateAreaFontValue = area[i].templateAreaFontValue.substring(area[i].templateAreaFontLength, -1)
// }
// }
area[i].templateAreaFontSize = Math.floor(area[i].templateAreaFontSize * 750 / wx.getSystemInfoSync().windowWidth) + 'rpx'
}
console.log(area)
self.setData({
cardInfo: res.data,
areaList: area

View File

@ -25,7 +25,7 @@
<!-- 其他 -->
<view class="area-box" wx:for="{{areaList}}" data-cur="{{index}}" wx:key="index" bindtap="giveFocus"
style="position:absolute;top: {{(item.templateAreaTop / cardInfo.picturesTemplateHeight) * 100 + '%'}};left:{{(item.templateAreaLeft / cardInfo.picturesTemplateWidth) * 100 + '%'}};color:{{item.templateAreaFontColor}};width:{{(item.templateAreaWidth / cardInfo.picturesTemplateWidth) * 100 + '%'}};height:{{(item.templateAreaHeight / cardInfo.picturesTemplateHeight) * 100 + '%'}}"
wx:if="{{item.templateAreaServerLink != '1' && item.templateAreaServerLink != '2'}}">
wx:if="{{item.templateAreaType == '1' && item.templateAreaServerLink == '1'}}">
<text wx:if="{{!item.templateAreaFile}}">{{item.templateAreaFontValue}}</text>
<image src="{{cardUrl}}{{item.templateAreaFile}}" wx:else></image>
<!-- <image src="{{cardUrl}}{{item.templateAreaFile}}" style="width: 100%;height:100%"></image> -->
@ -39,9 +39,9 @@
wx:if="{{item.templateAreaServerLink != '2' && item.templateAreaType != '1'}}">
<view class="item-title">{{item.templateAreaName}}:</view>
<view class="item-input">
<input type="text" placeholder="请输入内容,最多{{item.templateAreaFontLength}}个字" bindinput="editInfo"
<input type="text" bindinput="editInfo"
data-num="{{index}}" bindblur="getFileId" value="{{item.templateAreaFontValue}}" focus="{{item.focus}}"
wx:if="{{item.templateAreaServerLink != '1'}}" maxlength="{{item.templateAreaFontLength}}"></input>
wx:if="{{item.templateAreaServerLink != '1'}}"></input>
<input type="text" placeholder="请输入内容,最多{{item.templateAreaFontLength}}个字" bindinput="editInfo"
data-num="{{index}}" value="{{item.templateAreaFontValue}}" focus="{{item.focus}}"
maxlength="{{item.templateAreaFontLength}}" wx:else></input>

View File

@ -212,11 +212,11 @@ Page({
}).then(res => {
var area = res.data.areaList
for (let i = 0; i < area.length; i ++) {
if (area[i].templateAreaServerLink == '1') {
if (area[i].templateAreaFontValue.length > area[i].templateAreaFontLength) {
area[i].templateAreaFontValue = area[i].templateAreaFontValue.substring(area[i].templateAreaFontLength, -1)
}
}
// if (area[i].templateAreaServerLink == '1') {
// if (area[i].templateAreaFontValue.length > area[i].templateAreaFontLength) {
// area[i].templateAreaFontValue = area[i].templateAreaFontValue.substring(area[i].templateAreaFontLength, -1)
// }
// }
area[i].templateAreaFontSize = Math.floor(area[i].templateAreaFontSize * 750 / wx.getSystemInfoSync().windowWidth) + 'rpx'
if (area[i].templateAreaFontCenter == '1') {
area[i].templateAreaFontCenter = 'left'