customField.wxml 4.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <view class="main">
  2. <view class="content">
  3. <view class="content_item">
  4. <view wx:for="{{list}}" wx:key="index" class="border" wx:if="{{item.isShow===1}}">
  5. <view class="cu-form-group" wx:if="{{item.customType==='下拉选择'&&item.isShow===1}}">
  6. <view class="title"><text class="{{item.customNameVal?'text-green':'text-red'}}">*</text>
  7. <text>{{item.customName}}{{item.isEditable === 0?'(禁用)':''}}</text>
  8. </view>
  9. <picker disabled="{{item.isEditable === 0}}" data-index="{{index}}" bindchange="getSelect" value="{{item.customNameVal}}" range="{{item.configurationOption}}" range-key="{{'name'}}" data-index="{{index}}">
  10. <view class="picker" style="{{item.customNameVal?'color: #646566':'color: #C8C9CC'}}">
  11. {{item.customNameVal?item.customNameVal:item.prompt ||'请选择'}}
  12. <van-icon class="icon" name="arrow" />
  13. </view>
  14. </picker>
  15. </view>
  16. <view class="cu-form-group" wx:if="{{item.customType==='文本' &&item.isShow===1}}">
  17. <view class="title"><text class="{{item.customNameVal?'text-green':'text-red'}}">*</text><text>{{item.customName}}{{item.isEditable === 0?'(禁用)':''}}</text>
  18. </view>
  19. <input disabled="{{item.isEditable === 0}}" type="text" bindinput="getValue" value="{{item.customNameVal}}" placeholder="{{item.prompt || '请填写内容'}}" data-index="{{index}}" placeholder-style="color: #C8C9CC"></input>
  20. </view>
  21. <view class="cu-form-group" wx:if="{{item.customType==='日期'&&item.isShow===1}}">
  22. <view class="title"><text class="{{item.customNameVal ?'text-green':'text-red'}}">*</text><text>{{item.customName}}{{item.isEditable === 0?'(禁用)':''}}</text>
  23. </view>
  24. <picker disabled="{{item.isEditable === 0}}" data-index="{{index}}" class="picker" mode="date" value="{{item.customNameVal}}" start="2015-01-01" end="2100-01-01" bindchange="getValue">
  25. <view class="picker" style="{{item.customNameVal?'color: #646566':'color: #C8C9CC'}}">
  26. {{item.customNameVal?item.customNameVal:item.prompt ||'请选择日期'}}
  27. </view>
  28. </picker>
  29. </view>
  30. <view class="cu-form-group" wx:if="{{item.customType==='时间'&&item.isShow===1}}">
  31. <view class="title"><text class="{{item.customNameVal?'text-green':'text-red'}}">*</text><text>{{item.customName}}{{item.isEditable === 0?'(禁用)':''}}</text>
  32. </view>
  33. <picker disabled="{{item.isEditable === 0}}" data-index="{{index}}" class="picker" mode="time" value="{{item.customNameVal}}" start="00:00" end="23:59" bindchange="getValue">
  34. <view class="picker" style="{{item.customNameVal?'color: #646566':'color: #C8C9CC'}}">
  35. {{item.customNameVal?item.customNameVal:item.prompt ||'请选择时间'}}
  36. </view>
  37. </picker>
  38. </view>
  39. <!-- 图片 -->
  40. <view class="cu-form-group height" wx:if="{{item.customType==='图片'&&item.isShow===1}}">
  41. <view class="title"><text class="{{item.customNameVal?'text-green':'text-red'}}">*</text><text>{{item.customName}}{{item.isEditable === 0?'(禁用)':''}}</text>
  42. </view>
  43. <view wx:if="{{item.customNameVal}}" class="img_box">
  44. <image src="{{item.customNameVal}}" class="img" bindtap="previewImg" data-src="{{item.customNameVal}}"></image>
  45. <image src="../../static/images/delete_img.png" class="DelImg" data-index="{{index}}" catchtap="DelImg" data-type="vvv"></image>
  46. </view>
  47. <image bindtap="doUploadAvatar" class="upload" wx:else data-index="{{index}}" src="../../static/images/default_img.png"></image>
  48. </view>
  49. <!-- 省市区(街道) -->
  50. <view wx:if="{{(item.customType==='省市区'||item.customType==='省市区街道')&&item.isShow===1}}">
  51. <!-- 标题 -->
  52. <view class="cu-form-group">
  53. <view class="title">
  54. <text class="{{item.customNameVal?'text-green':'text-red'}}">*</text><text>{{item.customName}}{{item.isEditable === 0?'(禁用)':''}}</text>
  55. </view>
  56. <area-picker bind:value="getAddress" content="{{item.customNameVal}}" hasStreet="{{item.customType==='省市区街道'}}" data-index="{{index}}"></area-picker>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>