questionnaire.wxml
1.68 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
<block wx:if="{{questionnaireObj.id}}">
<block wx:if="{{!finish}}">
<view class="layout">
<text class="tips">{{questionnaireObj.desc}}</text>
<view class="form-box">
<block wx:for="{{questionnaireObj.questions}}" wx:key="index">
<view class="title {{item.required?'required':''}}">
<view class="num">{{item.num}}.</view>
<view class="text">{{item.text}}</view>
</view>
<view class="item {{item.type == 3?'textarea':''}}">
<block wx:if="{{item.type == 1}}">
<gl-radio data="{{item.data}}" num="{{item.num}}" bindchange="change" />
</block>
<block wx:elif="{{item.type == 2}}">
<gl-checkbox data="{{item.data}}" num="{{item.num}}" bindchange="change" />
</block>
<block wx:elif="{{item.type == 3}}">
<gl-textarea placeholder="请输入" maxlength="{{item.maxLength}}" data-num="{{item.num}}" bindblur="blur" showWordLimit></gl-textarea>
</block>
<block wx:elif="{{item.type == 4}}">
<gl-select data="{{item.data}}" title="{{item.text}}" num="{{item.num}}" bindchange="change" />
</block>
<block wx:else>
<gl-cascader data="{{item.data}}" title="{{item.text}}" num="{{item.num}}" bindchange="change" />
</block>
</view>
</block>
</view>
</view>
<block wx:if="{{questionnaireObj.status == 1}}">
<view class="fixed-btn text-center">
<button class="default-btn" bindtap="submit">提交</button>
</view>
</block>
</block>
<block wx:else>
<finish data="{{questionnaireObj}}" />
</block>
</block>