CardItem.wxml
3.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!--packageStudyCenter/pages/myTask/components/CardItem/CardItem.wxml-->
<view class="item-container">
<slot></slot>
<view class="image-box" wx:if="{{!customTop}}">
<view class="image-tag" wx:if="{{infoData._tagImage}}">
<image src="{{infoData._tagImage}}" mode=""/>
</view>
<block wx:if="{{infoData._tagText}}">
<view class="tag">{{infoData._tagText}}</view>
</block>
<image class="item-img" src="{{infoData._imageUrl}}"/>
</view>
<view class="item-content">
<block wx:for="{{formItems}}" wx:key="index">
<view class="item-title" wx:if="{{item.type == 'title'}}">{{infoData[item.key]}}</view>
<block wx:elif="{{item.type == 'score'}}">
<view class="score-box">
<van-rate value="{{infoData[item.key]}}" size="20" gutter="1.5" count="{{item.allCount || 5}}" custom-class="score-view" color="{{item.color || '#FFB642'}}" void-icon="star" void-color="{{item.voidColor || '#E0E0E0'}}" readonly/>
<view class="score-text">{{infoData[item.textKey]}}</view>
</view>
</block>
<block wx:elif="{{item.type == 'btn'}}">
<view class="item-btn {{infoData[item.showEventKey] ? '' : 'transparent'}}" catch:tap="goPage" data-target="{{infoData}}">{{item.btnText}}</view>
</block>
<block wx:elif="{{item.type == 'completeIcon' && infoData[item.showEventKey] == item.showEventValue}}">
<image class="completed-bg" src="{{IMG_URL}}usedCar/completed-bg.png" />
</block>
<block wx:elif="{{item.type == 'studied'}}">
<view class="studied-box">
<image class="icon" src="{{IMG_URL}}studyCenter/all-amount.png"/>
<view class="text">{{infoData[item.key]}}人已学习</view>
</view>
</block>
<view class="item {{infoData._showCompleteIcon || item.type == 'empty' ? 'transparent' : ''}}" wx:else>
<view class="label {{item.customerLabel ? 'custom' : ''}}">{{item.label}}</view>
<view class="value">
<block wx:if="{{item.type == 'progress'}}">
<block wx:if="{{infoData[item.statusKey] == item.statusEvent}}">
<view class="progress-box">
<view class="progress-bar" style="width: {{infoData[item.key]}};"></view>
<view class="progress-text">{{infoData[item.key]}}</view>
</view>
</block>
<block wx:else>
<view class="dot-value"></view>
<view class="green">已完成</view>
</block>
</block>
<block wx:elif="{{item.arr}}">
<block wx:for="{{item.arr}}" wx:key="idx" wx:for-index="idx" wx:for-item="subItem">
<view class="{{item.colorEventKey ? (infoData[item.colorEventKey] == item.colorEventValue ? 'green' : 'red') : ''}}">
<block wx:if="{{idx == 1}}">
<text class="split">|</text>
</block>
{{infoData[subItem] != null ? infoData[subItem] : '-'}}{{item.unitArr[idx]}}
</view>
</block>
</block>
<block wx:else>
{{infoData[item.key] != null ? infoData[item.key] : '-'}}<text wx:if="{{item.unit}}">{{item.unit}}</text>
</block>
</view>
</view>
</block>
</view>
</view>