mini/pages/try/index/index.wxml

141 lines
6.5 KiB
Plaintext

<scroll-view class="try-container" scroll-y show-scrollbar="{{false}}" enhanced>
<view class="top">
<nav-bar/>
<!-- <view class="header">
<view>我的试衣间</view>
</view> -->
</view>
<view class="main" style="height:{{imgHeight}}px">
<block wx:if="{{defaultPersonImage}}">
<!--
isViewPersonImage:长按显示模特照片,松开显示生成的照片,如果生成失败,就还是显示模特照片
-->
<image class="person-image" mode="aspectFit"
src="{{isViewPersonImage?currentHistory.person_image_url:(currentHistory.completion_url||currentHistory.person_image_url)}}"
data-item="{{isViewPersonImage?currentHistory.person_image_url:(currentHistory.completion_url||currentHistory.person_image_url)}}"
wx:if="{{currentHistory.id}}" bind:longpress="viewPersonImage"
bind:tap="viewImageInView"
bind:touchcancel="viewCompleteImage" bind:touchend="viewCompleteImage"/>
<image class="person-image" src="{{defaultPersonImage}}" mode="aspectFit" wx:else
bind:tap="showChooseImageAS"/>
</block>
<block wx:else>
<!-- <button plain size="mini" class="top-btn" bind:tap="chooseImg">添加形象照</button> -->
<view class="upload-btn">
<view class="icon body"></view>
</view>
</block>
<!-- <button plain size="mini" class="top-btn" bind:tap="navToPersonImage"
wx:if="{{hasMultiPersonImages}}"
loading="{{personImage.uploading}}">
更换形象照
</button>
<button plain size="mini" class="top-btn" bind:tap="chooseImg" wx:else
loading="{{personImage.uploading}}" disabled="{{personImage.uploading}}">
添加形象照
</button> -->
<view class="clothing" wx:if="{{defaultPersonImage}}">
<view class="item c-top" bind:tap="chooseTopClothing">
<image src="{{currentHistory.top_clothing_url}}" class="image" mode="aspectFit"
wx:if="{{currentHistory.id}}"/>
<block wx:elif="{{topClothing.tempFilePath}}">
<image src="{{topClothing.serverUrl||topClothing.tempFilePath}}" class="image"
mode="aspectFit"/>
<view class="loading-area" wx:if="{{topClothing.uploading}}">
<view class="icon loading"></view>
</view>
</block>
<view class="icon top-clothing" wx:else></view>
</view>
<view class="item c-bottom" bind:tap="chooseBottomClothing">
<image src="{{currentHistory.bottom_clothing_url}}" class="image" mode="aspectFit"
wx:if="{{currentHistory.id}}"/>
<block wx:elif="{{bottomClothing.tempFilePath}}">
<image src="{{bottomClothing.serverUrl||bottomClothing.tempFilePath}}"
class="image" mode="aspectFit"/>
<view class="loading-area" wx:if="{{bottomClothing.uploading}}">
<view class="icon loading"></view>
</view>
</block>
<view class="icon bottom-clothing" wx:else></view>
</view>
</view>
<view class="right-bottom-area" wx:if="{{currentHistory.id}}" bind:tap="deleteHistory"
data-item="{{currentHistory}}">
<view class="delete-area">
<view class="icon lajitong"></view>
</view>
</view>
</view>
<view class="bottom">
<button type="primary" bind:tap="tryon" wx:if="{{!defaultPersonImage}}" bind:tap="chooseImg"
loading="{{personImage.uploading}}" disabled="{{personImage.uploading}}">添加形象照</button>
<block wx:elif="{{currentHistory.id}}">
<button type="primary" bind:tap="showComment" wx:if="{{currentHistory.completion_url}}"
loading="{{tryonCommentLoading}}">查看 AI 点评</button>
<button type="primary" wx:else disabled>生成失败</button>
</block>
<button type="primary" bind:tap="tryon"
loading="{{trying}}"
disabled="{{trying||userInfo.tryon_remain_count<1}}" wx:else>
立刻试穿(剩余:{{userInfo.tryon_remain_count}}次)
</button>
</view>
<view class="history" wx:if="{{history.length>0}}">
<view class="item btn-new {{currentHistory.id?'':'current'}}" bind:tap="addNew">
<view class="icon plus"></view>
</view>
<scroll-view class="list" scroll-x="{{true}}" enable-flex show-scrollbar="{{false}}" enhanced>
<view class="item {{currentHistory.id==item.id?'current':''}}" wx:for="{{history}}"
bind:tap="selectHistory" data-item="{{item}}" wx:key="index"
bind:longpress="deleteHistory">
<image wx:if="{{item.completion_url}}" src="{{item.completion_url}}" class="image"
mode="aspectFit"/>
<block wx:else>
<image src="{{item.top_clothing_url}}" class="top-img"/>
<image src="{{item.bottom_clothing_url}}" class="bottom-img"/>
<view class="error-area" wx:if="{{item.status==tryonStatus.error}}">
<view type="warn" size="60rpx" class="icon warn"><view class="dispatch"/></view>
<view class="tips">失败</view>
</view>
<view class="loading-area" wx:else>
<view class="icon loading"></view>
</view>
</block>
<!-- <view class="delete-area" capture-catch:tap="deleteHistory" data-item="{{item}}">
<view class="icon delete"></view>
</view> -->
</view>
<navigator url="/pages/my/history/list" class="item item-more" wx:if="{{history.length==10}}">
<!-- <view class="icon more"></view> -->
<view>更多</view>
</navigator>
</scroll-view>
</view>
</scroll-view>
<share-modal-view show="{{isShowComment}}" data="{{tryonComment}}" pageHeight="{{pageHeight}}"
buttonType="{{shared_history_id?'tryon':'share'}}" bind:tryon="tryonShared"
bind:afterLeave="commentViewLeave"/>
<!-- <modal-view show="{{isShowComment}}" class="comment-modal-view" pageHeight="{{pageHeight}}"
isShowCancel="{{false}}" isShowOk="{{false}}" bind:afterLeave="commentViewLeave" showCloseButton>
<view class="image-area">
<image src="{{tryonComment.completion_url}}" class="image" mode="aspectFill"/>
<view class="top-bottom">
<image class="top" src="{{tryonComment.top_clothing_url}}"/>
<image class="bottom" src="{{tryonComment.bottom_clothing_url}}"/>
</view>
</view>
<view class="comment">
<view class="point">{{tryonComment.score}}</view>
<view class="cmt-title">AI 点评:</view>
<view class="cmt-content">{{tryonComment.comment}}</view>
<button wx:if="{{shared_history_id}}" class="button" type="primary" bind:tap="tryonShared">试穿</button>
<button class="button" type="primary" open-type="share" wx:else>分享</button>
</view>
</modal-view> -->