2019-07-24 15:52:07 +08:00

148 lines
5.0 KiB
Plaintext

<!--components/inform/inform.wxml-->
<cu-custom bgColor="bg-gradual-green" isBack="{{true}}"><view slot="backText">返回</view><view slot="content">{{pageName}}</view></cu-custom>
<view class="issue-box" wx:if="{{pagetype==1}}">
<view class="issue-list">
<view class="issue-item" wx:for="{{userInfoDetail.issue}}" wx:key>
<view class="issue-top" data-productid="{{item.id}}" bindtap="jumpToDetail">
<view class="issue-num">{{index+1}}</view>
<view class="issue-main">
<view class="issue-title">{{item.title}}</view>
<view class="issue-detail">{{item.details}}</view>
</view>
</view>
<view class="issue-changePrice">
<input class="issue-input" placeholder="修改价格,填0免费" type="number" data-inputNum="{{index}}" bindinput="input"/>
<view class="issue-submit" data-index="{{index}}" catchtap="changePrice">修改价格</view>
<view class="issue-hassale"data-index="{{index}}" catchtap="bindtapSale">卖出</view>
</view>
</view>
</view>
</view>
<view class="want-box" wx:if="{{pagetype==2}}">
<view class="want-list">
<view class="want-item" wx:for="{{userInfoDetail.want}}" wx:key data-productid="{{item.productId}}" bindtap="jumpToDetail">
<view class="want-main">
<view class="want-num">{{index+1}}</view>
<view class="want-title">{{item.productName}}</view>
</view>
<view class="want-cancal" data-productid="{{item.productId}}" catchtap="bindCancalWant">取消收藏</view>
</view>
</view>
</view>
<view class="msg-box" wx:if="{{pagetype==3}}">
<view class="unreadMsg-list">
<view class="unreadMsg-item" wx:for="{{userInfoDetail.unreadMsg}}" wx:key="{{index}}" data-productid="{{item.productId}}" bindtap="jumpToDetail">
<view class="unreadMsg-top">
<view class="unreadMsg-title">
<view style="font-size: 50rpx;" class="unreadMsg-icon {{msgProcess.style(item)}}" ></view>
<view class="unreadMsg-titleWord">{{msgProcess.titleWord(item)}}</view>
</view>
<view class="unreadMsg-time">{{item.ago}}</view>
</view>
<view class="unreadMsg-main">{{msgProcess.mainWord(item)}}</view>
</view>
</view>
</view>
<!-- 清除消息 -->
<view class="clearMsg-button" bindtap="bindclearMsg" wx:if="{{pagetype==3}}">
<view class="icon-delete" style="font-size:50rpx;"></view>
</view>
<!-- 商品列表 -->
<view class="product-list" wx:if="{{pagetype==4}}">
<view class="product-item" wx:for="{{list}}" wx:key data-productId="{{item._id}}" bindtap="jumpToExamine">
<view class="user-box">
<image src="{{item.userInfo.avatarUrl}}" />
<view class="user-info">
<view class="user-name">{{item.userInfo.userName}}</view>
<view class="user-time">{{item.time}}</view>
</view>
<view class="pro-price">
¥{{item.price}}
</view>
</view>
<view class="pro-title">#{{item.title}}#</view>
<view class="pro-detail">{{item.details}}</view>
<image mode='widthFix' class="pro-img" src="{{item.photos[0]}}" />
<view class='pro-footer'>
<view class="pro-tag">
<view class="padding-xs">
<view class="cu-tag {{tagColor.style(item.tag)}} light">{{item.tag}}</view>
<view class="cu-tag {{tagColor.style(item.adds)}} light">{{item.adds}}</view>
</view>
</view>
<view class="text-gray text-sm">
</view>
</view>
</view>
</view>
<wxs module="msgProcess">
var titleWord = function(item){
if(item.isWant) {
if(item.stats == 1) return '价格变动';
else if(item.stats == 2) return '已卖出';
} else {
if(item.iscomment) return '有新评论';
else return '有新回复';
}
};
var mainWord = function(item) {
var title = titleWord(item);
var main = '商品"' + item.productName +'"'+ title;
return main;
}
var style = function(item){
if(item.isWant) {
if(item.stats == 1) return 'icon-refund text-yellow';
else if(item.stats == 2) return 'icon-delete text-red';
} else {
if(item.iscomment) return 'icon-message text-green';
else return 'icon-mark text-blue';
}
};
module.exports.titleWord = titleWord;
module.exports.mainWord = mainWord;
module.exports.style = style;
</wxs>
<wxs module="tagColor">
var colorClass = function(item){
switch(item){
case "图书":
return 'bg-cyan';
break;
case "电子":
return 'bg-orange';
break;
case "体育":
return 'bg-yellow';
break;
case "乐器":
return 'bg-green';
break;
case "生活":
return 'bg-red';
break;
case "长理南区":
return 'bg-blue';
break;
case "长理东区":
return 'bg-brown';
break;
case "长理西区":
return 'bg-pink';
break;
}
};
module.exports.style = colorClass;
</wxs>