This commit is contained in:
高健 2021-08-06 11:33:16 +08:00
commit eeb800e494
4 changed files with 81 additions and 80 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

@ -10,7 +10,7 @@
<!-- 文字 -->
<view class="area-box" wx:for="{{areaList}}" data-cur="{{index}}" bindtap="giveFocus" wx:key="index"
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 + '%'}};font-size:{{item.templateAreaFontSize}};font-style:{{item.templateAreaFontStyle}};font-weight:{{item.templateAreaFontBold}};text-align:{{item.templateAreaFontCenter}}"
wx:if="{{item.templateAreaServerLink == '1'}}">
wx:if="{{item.templateAreaServerLink == '1' && item.templateAreaType != '1'}}">
{{item.templateAreaFontValue}}
</view>
@ -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'

View File

@ -1,73 +1,73 @@
{
"description": "项目配置文件",
"packOptions": {
"ignore": []
"description": "项目配置文件",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": true,
"es6": true,
"enhance": false,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"setting": {
"urlCheck": true,
"es6": true,
"enhance": false,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
"useIsolateContext": true,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"showES6CompileOption": false
"enableEngineNative": false,
"useIsolateContext": true,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"showES6CompileOption": false
},
"compileType": "miniprogram",
"libVersion": "2.17.0",
"appid": "wxe17874894f7ff27b",
"projectname": "card",
"debugOptions": {
"hidedInDevtools": []
},
"scripts": {},
"staticServerOptions": {
"baseURL": "",
"servePath": ""
},
"isGameTourist": false,
"condition": {
"search": {
"list": []
},
"compileType": "miniprogram",
"libVersion": "2.17.0",
"appid": "wxe17874894f7ff27b",
"projectname": "card",
"debugOptions": {
"hidedInDevtools": []
"conversation": {
"list": []
},
"scripts": {},
"staticServerOptions": {
"baseURL": "",
"servePath": ""
"game": {
"list": []
},
"isGameTourist": false,
"condition": {
"search": {
"list": []
},
"conversation": {
"list": []
},
"game": {
"list": []
},
"plugin": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": []
}
"plugin": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": []
}
}
}