wxml代码:
<view class="splice-page">
<!--隐藏canvas-->
<canvas canvas-id="tempCanvas" style="width:750rpx;height:{{totalHeight}}px;position:absolute;left:-999999px"></canvas>
<!--保存按钮-->
<view class="saveButton" wx:if="{{readuSave}}" bindtap="saveImgToPhone" style="background:url('../frame/background-pink.jpg')"> <test class="icon-save"></test></view>
<!--拼长图页面-->
<scroll-view scroll-y class="longImage" wx:if="{{page=='longImages'}}" style="height:{{imgViewHeight}}px">
<view class="img-wrapbox" wx:for="{{longImageSrcs}}" wx:key="*this">
<image src="{{item}}" mode="widthFix" data-idx="{{index}}" catchlongtap="gotoDelete" catchtap="quitDelete"></image>
<text class="deleteTextBox" wx:if="{{whichDeleteShow==index}}" bindtap="deleteImg" style="top:50%">删除这张?</text>
</view>
</scroll-view>
<!--拼相框页面-->
<view class="photoFrame" wx:if="{{page==='photoFrame'}}" style="height:{{frameHeight}}px" bindtouchstart="uploadScaleStart" bindtouchmove="uploadScaleMove" bindtouchend="uploadScaleEnd">
<image class="frame" src="{{frameSrc}}" mode="widthFix"></image>
<image class="photo" src="{{photoSrc}}" style="width:{{photoWidth}}px;height:{{photoHeight}}px;top:{{photoTop}}px;left:{{photoLeft}}px" disable-scroll="true"></image>
</view>
<!--拼长图页面的底部工具栏-->
<view class="toolbar-bottom" wx:if="{{page==='longImages'}}">
<view bindtap="addImages"><text class="icon-listadd"></text><text class="text">添加图片</text></view>
</view>
<!--相框页面的底部工具栏-->
<view class="toolbar-bottom" wx:if="{{page==='photoFrame'}}">
<view bindtap="addFrame"><text class="icon-frame"></text><text class="text">选择相框</text></view>
<view bindtap="addPhoto"><text class="icon-photo"></text><text class="text">添加照片</text></view>
</view>
<!--相框选择窗口-->
<view class="frameChoose" wx:if="{{isFrameChoose}}">
<view class="frameChoose-top"><text class="farmeChoose-top-left">选择相框</text><text class="farmeChoose-top-right" bindtap="closeFrameChoose"></text> </view>
<scroll-view scroll-y>
<view wx:for="{{frameSrcs}}" wx:key="*this" data-src="{{item.src}}" class="frameBox" bindtap="chooseFrame">
<image src="{{'../frame'+item.src}}" mode="aspectFit"></image><text>{{item.title}}</text>
</view>
</scroll-view>
</view>
</view>
调试错误:
VM56 WAService.js:2 TypeError: Cannot read property 'windowWidth' of undefined
at vt.onLoad (index.js? [sm]:27)
at vt.<anonymous> (VM56 WAService.js:2)
at vt.r.__callPageLifeTime__ (VM56 WAService.js:2)
at nn (VM56 WAService.js:2)
at VM56 WAService.js:2
at cn (VM56 WAService.js:2)
at Function.<anonymous> (VM56 WAService.js:2)
这不是说的很清楚了 index.js 27 行 windowWidth 未定义
去js里找。 wxml 是视图页