308 lines
22 KiB
Plaintext
Executable File
308 lines
22 KiB
Plaintext
Executable File
<view bindtap="hideEditBox" class="page-box-2" id="top-box" style="position: fixed;z-index: 1;margin-top: 0rpx;">
|
|
<view catchtap="showDisplayType" class="cu-bar bg-white" style="width: 100%;">
|
|
<view style="font-size: 32rpx;color:#000;"> 本栏目可以发布 </view>
|
|
</view>
|
|
<view class="type-box">
|
|
<block wx:for="{{fieldList}}" wx:key="index">
|
|
<view catchtap="showType" class="item" data-type="{{item.type}}" wx:if="{{item.type=='text'||item.type=='textarea'}}">
|
|
<image mode="scaleToFill" src="/images/txt.png"></image>
|
|
<view>文本</view>
|
|
</view>
|
|
<view catchtap="showType" class="item" data-type="{{item.type}}" wx:elif="{{item.type=='photo'}}">
|
|
<image mode="scaleToFill" src="/images/jpg.png"></image>
|
|
<view>图片</view>
|
|
</view>
|
|
<view catchtap="showType" class="item" data-type="{{item.type}}" wx:elif="{{item.type=='video'}}">
|
|
<image mode="scaleToFill" src="/images/mp4.png"></image>
|
|
<view>视频</view>
|
|
</view>
|
|
<view catchtap="showType" class="item" data-type="{{item.type}}" wx:elif="{{item.type=='audio'}}">
|
|
<image mode="scaleToFill" src="/images/mp3.png"></image>
|
|
<view>音频</view>
|
|
</view>
|
|
<view catchtap="showType" class="item" data-type="{{item.type}}" wx:elif="{{item.type=='select'}}">
|
|
<image mode="scaleToFill" src="/images/lib.png"></image>
|
|
<view>选项</view>
|
|
</view>
|
|
<view catchtap="showType" class="item" data-type="{{item.type}}" wx:elif="{{item.type=='map'}}">
|
|
<image mode="scaleToFill" src="/images/map.png"></image>
|
|
<view>定位</view>
|
|
</view>
|
|
<view catchtap="showType" class="item" data-type="{{item.type}}" wx:elif="{{item.type=='link'}}">
|
|
<image mode="scaleToFill" src="/images/htm.png"></image>
|
|
<view>链接</view>
|
|
</view>
|
|
<view wx:if="{{index!=fieldList.length-1}}">+</view>
|
|
</block>
|
|
</view>
|
|
</view>
|
|
<view bindtap="hideEditBox" class="page-box-2" style="margin-top: {{topBoxHeight}}px;">
|
|
<block wx:if="{{valueList.length>0}}">
|
|
<view style="margin-top: 15rpx;width: 100%;" wx:for="{{valueList}}" wx:key="index">
|
|
<view catchtap="showEditBox" class="item-box {{currentIndex==index?'sel-border':''}}" data-idx="{{index}}" wx:if="{{item.type=='text'||item.type=='textarea'}}">
|
|
<view style="width: 100%;text-align: {{item.textAlign}};font-size: 32rpx;overflow-wrap: break-word;"> {{item.value}}</view>
|
|
</view>
|
|
<view catchtap="showEditBox" class="item-box {{currentIndex==index?'sel-border':''}}" data-idx="{{index}}" wx:if="{{item.type=='photo'}}">
|
|
<view class="grid col-3 grid-square flex-sub" style="width: 100%;" wx:if="{{item.displayType=='1'}}">
|
|
<view class="bg-img" wx:for="{{item.valueList}}" wx:for-item="photo" wx:key="idx">
|
|
<image mode="aspectFill" src="{{photo.path}}"></image>
|
|
</view>
|
|
</view>
|
|
<swiper autoplay="{{item.displayType=='3'}}" indicatorDots="{{true}}" style="width:100%;height:400rpx;" wx:elif="{{item.displayType=='2'||item.displayType=='3'}}">
|
|
<swiper-item style="width:100%;" wx:for="{{item.valueList}}" wx:for-index="pIndex" wx:for-item="photo" wx:key="pIndex">
|
|
<image mode="aspectFill" src="{{photo.path}}" style="width:100%;border-radius:5rpx;height:400rpx;"></image>
|
|
</swiper-item>
|
|
</swiper>
|
|
<view style="width: 100%;" wx:elif="{{item.displayType=='4'}}">
|
|
<image mode="widthFix" src="{{photo.path}}" style="width:100%;border-radius:5rpx;" wx:for="{{item.valueList}}" wx:for-index="pIndex" wx:for-item="photo" wx:key="pIndex"></image>
|
|
</view>
|
|
</view>
|
|
<view catchtap="showEditBox" class="item-box {{currentIndex==index?'sel-border':''}}" data-idx="{{index}}" wx:if="{{item.type=='video'}}">
|
|
<view class="grid col-3 grid-square flex-sub" style="width: 100%;" wx:if="{{item.displayType=='1'}}">
|
|
<view class="bg-img" wx:for="{{item.valueList}}" wx:for-index="idx" wx:for-item="video" wx:key="idx">
|
|
<image mode="aspectFill" src="{{video.coverPath}}"></image>
|
|
<image catchtap="viewVideo" data-idx="{{idx}}" data-index="{{index}}" mode="scaleToFill" src="/images/ic_video_play.png" style="width: 48rpx;height:48rpx;position: absolute;top:40%;left:40%;"></image>
|
|
</view>
|
|
</view>
|
|
<block wx:if="{{item.displayType=='2'}}">
|
|
<view class="movie-box" wx:for="{{item.valueList}}" wx:for-index="idx" wx:for-item="video" wx:key="idx">
|
|
<image mode="scaleToFill" src="{{video.coverPath}}"></image>
|
|
<view class="play-box-arrow-flex">
|
|
<image catchtap="viewVideo" data-idx="{{idx}}" data-index="{{index}}" mode="scaleToFill" src="/images/ic_video_play.png" style="width: 96rpx;height:96rpx;"></image>
|
|
</view>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
<view catchtap="showEditBox" class="item-box {{currentIndex==index?'sel-border':''}}" data-idx="{{index}}" wx:if="{{item.type=='audio'}}">
|
|
<view class="play-box-shadow-little">
|
|
<view class="flex justify-between align-center" style="width:80%;">
|
|
<text>{{item.value.curDurationStr}}</text>
|
|
<slider activeColor="#1296db" backgroundColor="#cacaca" bindchange="slider4change" blockColor="#1296db" blockSize="14" class="flex-sub" data-idx="{{index}}" data-item="{{item.value}}" data-type="show" max="{{item.value.duration}}" min="{{0}}" value="{{item.value.curDuration}}"></slider>
|
|
<text>{{item.value.totalDurationStr}}</text>
|
|
</view>
|
|
<view class="flex justify-between" style="width:80%;">
|
|
<image catchtap="rewind" data-idx="{{index}}" data-item="{{item.value}}" data-type="show" mode="scaleToFill" src="/images/ic_audio_rewind.png"></image>
|
|
<image catchtap="play" data-idx="{{index}}" data-item="{{item.value}}" data-type="show" mode="scaleToFill" src="{{item.value.isPlay?'/images/ic_audio_playing.png':'/images/ic_audio_play.png'}}"></image>
|
|
<image catchtap="speed" data-idx="{{index}}" data-item="{{item.value}}" data-type="show" mode="scaleToFill" src="/images/ic_audio_speed.png"></image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view catchtap="showEditBox" class="item-box {{currentIndex==index?'sel-border':''}}" data-idx="{{index}}" wx:if="{{item.type=='map'}}">
|
|
<view class="flex flex-direction align-center bg-white radius item-padding">
|
|
<view style="width: 100%;">
|
|
<view class="flex justify-between">
|
|
<view> {{item.value.name}}-{{item.value.address}} </view>
|
|
</view>
|
|
<view style="border-radius:10rpx;overflow:hidden;margin-top:10rpx;width: 100%;">
|
|
<map latitude="{{item.value.latitude}}" longitude="{{item.value.longitude}}" markers="{{[ {latitude:item.value.latitude,longitude:item.value.longitude} ]}}" scale="12" style="width:100%;height:300rpx;"></map>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view catchtap="showEditBox" class="item-box {{currentIndex==index?'sel-border':''}}" data-idx="{{index}}" wx:if="{{item.type=='link'}}">
|
|
<view style="width: 100%;font-size: 32rpx;">{{item.value}}</view>
|
|
</view>
|
|
<view catchtap="showEditBox" class="item-box {{currentIndex==index?'sel-border':''}}" data-idx="{{index}}" wx:if="{{item.type=='select'}}">
|
|
<view style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center;flex-wrap: wrap;width: 100%;">
|
|
<view class="cu-tag bg-blue" wx:for="{{item.valueList}}" wx:for-item="options" wx:key="index"> {{options.name}} </view>
|
|
</view>
|
|
</view>
|
|
<view wx:if="{{currentIndex==index}}">
|
|
<view class="control-box">
|
|
<view catchtap="editItem" class="item" data-index="{{index}}" data-type="{{item.type}}" wx:if="{{item.type!='audio'}}">
|
|
<text class="cuIcon-edit bg-yellow-light"></text>
|
|
<text style="margin-left: 15rpx;">编辑</text>
|
|
</view>
|
|
<view catchtap="insertItem" class="item" data-index="{{index}}" data-type="{{item.type}}">
|
|
<text class="cuIcon-write bg-yellow-light"></text>
|
|
<text style="margin-left: 15rpx;">插入</text>
|
|
</view>
|
|
<view catchtap="delItem" class="item" data-index="{{index}}" data-type="{{item.type}}">
|
|
<text class="cuIcon-roundclose bg-yellow-light"></text>
|
|
<text style="margin-left: 15rpx;">删除</text>
|
|
</view>
|
|
</view>
|
|
<view style="width: 100%;" wx:if="{{isInsert}}">
|
|
<view class="dir-parent-box">
|
|
<view class="title">方向:</view>
|
|
<view class="dir-box">
|
|
<view catchtap="chooseDirection" class="cu-capsule radius" data-idx="1">
|
|
<view class="cu-tag {{selDirection=='1'?'bg-yellowlight':'bg-grey'}}">
|
|
<text class="{{selDirection=='1'?'cuIcon-radiobox':'cuIcon-round'}}"></text>
|
|
</view>
|
|
<view class="cu-tag {{selDirection=='1'?'line-yellowlight2':'line-black'}}"> 内容上 </view>
|
|
</view>
|
|
<view catchtap="chooseDirection" class="cu-capsule radius" data-idx="2" style="margin-left: 15rpx;">
|
|
<view class="cu-tag {{selDirection=='2'?'bg-yellowlight':'bg-grey'}}">
|
|
<text class="{{selDirection=='2'?'cuIcon-radiobox':'cuIcon-round'}}"></text>
|
|
</view>
|
|
<view class="cu-tag {{selDirection=='2'?'line-yellowlight2':'line-black'}}"> 内容下 </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="dir-parent-box">
|
|
<view class="title">类型:</view>
|
|
<view class="choose-box">
|
|
<view catchtap="chooseFieldType" class="item" data-idx="{{idx}}" data-type="{{it.type}}" wx:for="{{fieldList}}" wx:for-index="idx" wx:for-item="it" wx:key="idx">
|
|
<text class="{{curFieldTypeIndex==idx?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
|
<text class="{{curFieldTypeIndex==idx?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">{{it.type}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<button catchtap="doInsert" class="cu-btn bg-blue" style="width:100%;margin-top:15rpx;">确定插入</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</block>
|
|
<view style="margin-top:15rpx;width:100%;" wx:else>
|
|
<van-empty description="点击图标进行添加内容"></van-empty>
|
|
</view>
|
|
</view>
|
|
<van-popup bind:close="onClose" position="top" show="{{isShowInput}}">
|
|
<view class="input-box" style="margin-top: {{maringHeight}}px;">
|
|
<view class="title"> 文本 </view>
|
|
<view class="cu-bar bg-white choose-box">
|
|
<view catchtap="chooseTextAlign" class="item" data-type="1">
|
|
<text class="{{curTextAlign=='1'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
|
<text class="{{curTextAlign=='1'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">文字居左</text>
|
|
</view>
|
|
<view catchtap="chooseTextAlign" class="item" data-type="2">
|
|
<text class="{{curTextAlign=='2'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
|
<text class="{{curTextAlign=='2'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">文字居中</text>
|
|
</view>
|
|
<view catchtap="chooseTextAlign" class="item" data-type="3">
|
|
<text class="{{curTextAlign=='3'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
|
<text class="{{curTextAlign=='3'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">文字居右</text>
|
|
</view>
|
|
</view>
|
|
<textarea bindinput="inputWatch" placeholder="请输入内容" placeholderStyle="color:#333333;" value="{{curTextValue}}"></textarea>
|
|
<view style="width: 100%;margin-top: 15rpx;">
|
|
<button bindtap="doConfirmInput" class="cu-btn bg-blue" data-type="{{sourceType}}" style="width:100%">确定</button>
|
|
</view>
|
|
</view>
|
|
</van-popup>
|
|
<van-popup bind:close="onClose" position="top" show="{{isShowLink}}">
|
|
<view class="input-box" style="margin-top: {{maringHeight}}px;">
|
|
<view class="title"> 链接 </view>
|
|
<input bindinput="inputLink" class="item-input" placeholder="请输入链接地址" placeholderStyle="color:#333333;" value="{{curLinkText}}"></input>
|
|
<view style="width: 100%;margin-top: 15rpx;">
|
|
<button bindtap="doConfirmLink" class="cu-btn bg-blue" style="width:100%">确定</button>
|
|
</view>
|
|
</view>
|
|
</van-popup>
|
|
<van-action-sheet bind:close="closePop" closeOnClickOverlay="{{false}}" data-type="audio" overlay="{{true}}" show="{{isShowAudio}}" style="padding-bottom:180rpx;" title="语音">
|
|
<view class="audio-box">
|
|
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:80rpx;width: 100%;" wx:if="{{audioFile==null}}">
|
|
<image mode="heightFix" src="{{isRecording?'/images/ic_voice_record.gif':'/images/ic_record_start.png'}}" style="width:300rpx;height:300rpx;"></image>
|
|
<text>00:{{audioDuration>9?audioDuration:'0'+audioDuration}}</text>
|
|
<view bindtouchend="doEndRecord" bindtouchstart="startRecord" class="cu-btn bg-blue radius margin-top-sm" style="width:70%;">{{isRecording?'正在录音':'长按录音'}}</view>
|
|
</view>
|
|
<view style="width: 100%;display: flex;flex-direction: column;justify-content: center;align-items: center;" wx:else>
|
|
<view class="play-box-shadow">
|
|
<view class="flex justify-between align-center" style="width:80%;">
|
|
<text>{{audioFile.curDurationStr}}</text>
|
|
<slider activeColor="#1296db" backgroundColor="#cacaca" bindchange="slider4change" blockColor="#1296db" blockSize="14" class="flex-sub" data-item="{{audioFile}}" data-type="record" max="{{audioFile.duration}}" min="{{0}}" value="{{audioFile.curDuration}}"></slider>
|
|
<text>{{audioFile.totalDurationStr}}</text>
|
|
</view>
|
|
<view class="flex justify-between" style="width:80%;">
|
|
<image bindtap="rewind" data-item="{{audioFile}}" data-type="record" mode="scaleToFill" src="/images/ic_audio_rewind.png"></image>
|
|
<image bindtap="play" data-item="{{audioFile}}" data-type="record" mode="scaleToFill" src="{{audioFile.isPlay?'/images/ic_audio_playing.png':'/images/ic_audio_play.png'}}"></image>
|
|
<image bindtap="speed" data-item="{{audioFile}}" data-type="record" mode="scaleToFill" src="/images/ic_audio_speed.png"></image>
|
|
</view>
|
|
<text catchtap="delAudio" class="cuIcon-roundclose" style="position: absolute;top: -15rpx;right:-15rpx;font-size: 50rpx;color: #1296db;"></text>
|
|
</view>
|
|
<button bindtap="doConfirmAudio" class="cu-btn bg-blue" style="width:80%;margin-top: 15rpx;">确定</button>
|
|
</view>
|
|
</view>
|
|
</van-action-sheet>
|
|
<van-action-sheet bind:close="closePop" data-type="1" show="{{isShowPhoto}}" style="padding-bottom:180rpx;" title="图片">
|
|
<scroll-view scrollY style="width: 100%;height: 500rpx;padding: 15rpx;">
|
|
<view class="cu-bar bg-white">
|
|
<view class="action">
|
|
<text>图片 {{photoList.length}}/9</text>
|
|
</view>
|
|
<view class="action">
|
|
<button catchtap="confirmPhoto" class="cu-btn bg-blue" style="width:100%;height: 60rpx;">确定</button>
|
|
</view>
|
|
</view>
|
|
<view class="cu-bar bg-white choose-box">
|
|
<view catchtap="choosePhotoDisplay" class="item" data-type="1">
|
|
<text class="{{curSelPhotoDisplay=='1'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
|
<text class="{{curSelPhotoDisplay=='1'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">九宫格</text>
|
|
</view>
|
|
<view catchtap="choosePhotoDisplay" class="item" data-type="2">
|
|
<text class="{{curSelPhotoDisplay=='2'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
|
<text class="{{curSelPhotoDisplay=='2'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">轮播</text>
|
|
</view>
|
|
<view catchtap="choosePhotoDisplay" class="item" data-type="3">
|
|
<text class="{{curSelPhotoDisplay=='3'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
|
<text class="{{curSelPhotoDisplay=='3'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">轮播(自动)</text>
|
|
</view>
|
|
<view catchtap="choosePhotoDisplay" class="item" data-type="4">
|
|
<text class="{{curSelPhotoDisplay=='4'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
|
<text class="{{curSelPhotoDisplay=='4'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">平铺</text>
|
|
</view>
|
|
</view>
|
|
<view class="cu-form-group item-padding" style="margin-top: 15rpx;">
|
|
<view class="grid col-3 grid-square flex-sub">
|
|
<view catchtap="viewPhoto" class="bg-img" data-url="{{photo.path}}" wx:for="{{photoList}}" wx:for-index="idx" wx:for-item="photo" wx:key="idx">
|
|
<image mode="aspectFill" src="{{photo.path}}"></image>
|
|
<view catchtap="delPhoto" class="cu-tag bg-red" data-index="{{idx}}">
|
|
<text class="cuIcon-close"></text>
|
|
</view>
|
|
</view>
|
|
<view catchtap="chooseImg" class="solids" data-index="{{index}}" data-item="{{item}}" wx:if="{{photoList.length<9}}">
|
|
<text class="cuIcon-cameraadd"></text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</van-action-sheet>
|
|
<van-action-sheet bind:close="closePop" data-type="1" show="{{isShowVideo}}" style="padding-bottom:180rpx;" title="视频">
|
|
<scroll-view scrollY style="width: 100%;height: 500rpx;padding: 15rpx;">
|
|
<view class="cu-bar bg-white">
|
|
<view class="action">
|
|
<text>视频 {{videoList.length}}/9</text>
|
|
</view>
|
|
<view class="action">
|
|
<button catchtap="confirmVideo" class="cu-btn bg-blue" style="width:100%;height: 60rpx;">确定</button>
|
|
</view>
|
|
</view>
|
|
<view class="cu-bar bg-white choose-box">
|
|
<view catchtap="chooseVideoDisplay" class="item" data-type="1">
|
|
<text class="{{curVideoDisplay=='1'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
|
<text class="{{curVideoDisplay=='1'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">九宫格</text>
|
|
</view>
|
|
<view catchtap="chooseVideoDisplay" class="item" data-type="2">
|
|
<text class="{{curVideoDisplay=='2'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
|
<text class="{{curVideoDisplay=='2'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">平铺</text>
|
|
</view>
|
|
</view>
|
|
<view class="cu-form-group item-padding" style="margin-top: 15rpx;">
|
|
<view class="grid col-3 grid-square flex-sub">
|
|
<view class="bg-img" wx:for="{{videoList}}" wx:for-index="idx" wx:for-item="video" wx:key="idx">
|
|
<image mode="aspectFill" src="{{video.coverPath}}"></image>
|
|
<view catchtap="delVideo" class="cu-tag bg-red" data-index="{{idx}}" data-itemIndex="{{index}}">
|
|
<text class="cuIcon-close"></text>
|
|
</view>
|
|
</view>
|
|
<view catchtap="chooseVideo" class="solids" wx:if="{{videoList.length<9}}">
|
|
<text class="cuIcon-cameraadd"></text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</van-action-sheet>
|
|
<van-action-sheet bind:close="closePop" data-type="8" show="{{isShowSelect}}" style="padding-bottom:180rpx;" title="请选择">
|
|
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:30rpx;">
|
|
<scroll-view scrollY style="height:320rpx;max-height:320rpx;padding:0rpx 20rpx;">
|
|
<view class="cu-capsule radius sel-item" wx:for="{{optionsList}}" wx:key="index">
|
|
<view catchtap="chooseTags" class="cu-tag {{item.isSel?'bg-blue':'bg-gray'}}" data-idx="{{index}}" data-item="{{item}}"> {{item.name}} </view>
|
|
</view>
|
|
</scroll-view>
|
|
<view style="width: 60%;margin-top: 15rpx;">
|
|
<button bindtap="doConfirmSel" class="cu-btn bg-blue" style="width:100%">确定</button>
|
|
</view>
|
|
</view>
|
|
</van-action-sheet>
|