This commit is contained in:
高健 2021-07-20 16:40:18 +08:00
commit a0c7f9d9be
8 changed files with 98 additions and 79 deletions

View File

@ -216,6 +216,12 @@ Page({
} else { } else {
area[i]['templateAreaFontStyle'] = 'italic' 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)
}
}
area[i].templateAreaFontSize = Math.floor(area[i].templateAreaFontSize * 750 / wx.getSystemInfoSync().windowWidth) + 'rpx'
} }
self.setData({ self.setData({
cardInfo: res.data, cardInfo: res.data,

View File

@ -39,18 +39,18 @@
wx:if="{{item.templateAreaServerLink != '2' && item.templateAreaType != '1'}}"> wx:if="{{item.templateAreaServerLink != '2' && item.templateAreaType != '1'}}">
<view class="item-title">{{item.templateAreaName}}:</view> <view class="item-title">{{item.templateAreaName}}:</view>
<view class="item-input"> <view class="item-input">
<input type="text" placeholder="请输入内容" bindinput="editInfo" data-num="{{index}}" bindblur="getFileId" <input type="text" placeholder="请输入内容,最多{{item.templateAreaFontLength}}个字" bindinput="editInfo" data-num="{{index}}" bindblur="getFileId"
value="{{item.templateAreaFontValue}}" focus="{{item.focus}}" value="{{item.templateAreaFontValue}}" focus="{{item.focus}}"
wx:if="{{item.templateAreaServerLink != '1'}}"></input> wx:if="{{item.templateAreaServerLink != '1'}}" maxlength="{{item.templateAreaFontLength}}"></input>
<input type="text" placeholder="请输入内容" bindinput="editInfo" data-num="{{index}}" <input type="text" placeholder="请输入内容,最多{{item.templateAreaFontLength}}个字" bindinput="editInfo" data-num="{{index}}"
value="{{item.templateAreaFontValue}}" focus="{{item.focus}}" wx:else></input> value="{{item.templateAreaFontValue}}" focus="{{item.focus}}" maxlength="{{item.templateAreaFontLength}}" wx:else></input>
</view> </view>
</view> </view>
<view class="row" wx:for="{{areaList}}" wx:key="index" <view class="row" wx:for="{{areaList}}" wx:key="index"
wx:if="{{item.templateAreaServerLink == '2' && item.templateAreaType != '1'}}"> wx:if="{{item.templateAreaServerLink == '2' && item.templateAreaType != '1'}}">
<view class="item-title">{{item.templateAreaName}}:</view> <view class="item-title">{{item.templateAreaName}}:</view>
<view class="item-input" bindtap="choosePhoto" data-cur="{{index}}"> <view class="item-input" bindtap="choosePhoto" data-cur="{{index}}">
<image src="{{cardUrl}}{{item.templateAreaFile}}"></image> <image src="{{cardUrl}}{{item.templateAreaFile}}" mode="widthFix"></image>
<text class="cuIcon-cameraadd"></text> <text class="cuIcon-cameraadd"></text>
</view> </view>
</view> </view>

View File

@ -20,6 +20,7 @@ page{
.area-box{ .area-box{
white-space: nowrap; white-space: nowrap;
background: none !important; background: none !important;
z-index: 111;
} }
.area-box image{ .area-box image{
width: 100%; width: 100%;
@ -63,7 +64,7 @@ page{
} }
.item-input image{ .item-input image{
max-width: 70%; max-width: 70%;
max-height: 120rpx; /* max-height: 120rpx; */
} }
.item-code-input image{ .item-code-input image{
max-width: 35%; max-width: 35%;

View File

@ -455,6 +455,12 @@ Page({
}).then(res => { }).then(res => {
var area = res.data.areaList var area = res.data.areaList
for (let i = 0; i < area.length; i++) { 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)
}
}
area[i].templateAreaFontSize = Math.floor(area[i].templateAreaFontSize * 750 / wx.getSystemInfoSync().windowWidth) + 'rpx'
if (area[i].templateAreaFontCenter == '1') { if (area[i].templateAreaFontCenter == '1') {
area[i].templateAreaFontCenter = 'left' area[i].templateAreaFontCenter = 'left'
} else if (area[i].templateAreaFontCenter == '2') { } else if (area[i].templateAreaFontCenter == '2') {

View File

@ -212,6 +212,12 @@ Page({
}).then(res => { }).then(res => {
var area = res.data.areaList var area = res.data.areaList
for (let i = 0; i < area.length; i ++) { 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)
}
}
area[i].templateAreaFontSize = Math.floor(area[i].templateAreaFontSize * 750 / wx.getSystemInfoSync().windowWidth) + 'rpx'
if (area[i].templateAreaFontCenter == '1') { if (area[i].templateAreaFontCenter == '1') {
area[i].templateAreaFontCenter = 'left' area[i].templateAreaFontCenter = 'left'
} else if (area[i].templateAreaFontCenter == '2') { } else if (area[i].templateAreaFontCenter == '2') {

View File

@ -38,18 +38,18 @@
wx:if="{{item.templateAreaServerLink != '2' && item.templateAreaType != '1'}}"> wx:if="{{item.templateAreaServerLink != '2' && item.templateAreaType != '1'}}">
<view class="item-title">{{item.templateAreaName}}:</view> <view class="item-title">{{item.templateAreaName}}:</view>
<view class="item-input"> <view class="item-input">
<input type="text" placeholder="请输入内容" bindinput="editInfo" data-num="{{index}}" bindblur="getFileId" <input type="text" placeholder="请输入内容,最多{{item.templateAreaFontLength}}个字" bindinput="editInfo" data-num="{{index}}" bindblur="getFileId"
value="{{item.templateAreaFontValue}}" focus="{{item.focus}}" value="{{item.templateAreaFontValue}}" focus="{{item.focus}}"
wx:if="{{item.templateAreaServerLink != '1'}}"></input> wx:if="{{item.templateAreaServerLink != '1'}}" maxlength="{{item.templateAreaFontLength}}"></input>
<input type="text" placeholder="请输入内容" bindinput="editInfo" data-num="{{index}}" <input type="text" placeholder="请输入内容,最多{{item.templateAreaFontLength}}个字" bindinput="editInfo" data-num="{{index}}"
value="{{item.templateAreaFontValue}}" focus="{{item.focus}}" wx:else></input> value="{{item.templateAreaFontValue}}" focus="{{item.focus}}" maxlength="{{item.templateAreaFontLength}}" wx:else></input>
</view> </view>
</view> </view>
<view class="row" wx:for="{{areaList}}" wx:key="index" <view class="row" wx:for="{{areaList}}" wx:key="index"
wx:if="{{item.templateAreaServerLink == '2' && item.templateAreaType != '1'}}"> wx:if="{{item.templateAreaServerLink == '2' && item.templateAreaType != '1'}}">
<view class="item-title">{{item.templateAreaName}}:</view> <view class="item-title">{{item.templateAreaName}}:</view>
<view class="item-input" bindtap="choosePhoto" data-cur="{{index}}"> <view class="item-input" bindtap="choosePhoto" data-cur="{{index}}">
<image src="{{cardUrl}}{{item.templateAreaFile}}"></image> <image src="{{cardUrl}}{{item.templateAreaFile}}" mode="widthFix"></image>
<text class="cuIcon-cameraadd"></text> <text class="cuIcon-cameraadd"></text>
</view> </view>
</view> </view>

View File

@ -75,7 +75,7 @@ page {
.item-input image { .item-input image {
max-width: 70%; max-width: 70%;
max-height: 120rpx; /* max-height: 120rpx; */
} }
.item-code-input image { .item-code-input image {