index.wxml 5.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <form bindsubmit="formSubmit">
  2. <view wx:for="{{formList}}" wx:key="index" class="u-m-b-20">
  3. <view class="u-font-30">{{item.title}} <text wx:if="{{item.required}}" class="red">*</text></view>
  4. <view class="u-font-26 text-gray line-h u-m-b-10">{{item.remark}}</view>
  5. <view wx:if="{{item.type=='image'}}">
  6. <chooseImage imgMax="{{item.max_count}}" bind:on-changeImage="changeImg" bind:onChooseImage="chooseImage" key="{{item.type+'_'+item.random_code}}"></chooseImage>
  7. </view>
  8. <view wx:if="{{item.type=='text'}}">
  9. <input value="{{form[item.type+'_'+item.random_code]}}" bindinput="bindKeyInput" data-idx="{{item.type+'_'+item.random_code}}" placeholder="{{item.hint}}" type="{{item.type}}" class="ipt" placeholder-class="ipt-holder" />
  10. </view>
  11. <view wx:if="{{item.type=='textarea'}}">
  12. <textarea value="{{form[item.type+'_'+item.random_code]}}" bindinput="bindKeyInput" data-idx="{{item.type+'_'+item.random_code}}" style="min-height:120rpx;" auto-height placeholder="{{item.hint}}" class="ipt" placeholder-class="ipt-holder" />
  13. </view>
  14. <view wx:if="{{item.type=='select'}}" class="pos-r">
  15. <picker bindchange="bindPickerChange" value="{{item.index}}" range="{{item.option_val}}" data-idx="{{index}}">
  16. <view class="ipt {{item.index==-1?'ipt-holder':''}}">{{item.index==-1?item.hint:form[item.type+'_'+item.random_code]}}</view>
  17. <i class="iconfont icon-xiatiao rightIcon"></i>
  18. </picker>
  19. </view>
  20. <view wx:if="{{item.type=='radio'}}">
  21. <radio-group bindchange="radioChange" data-idx="{{item.type+'_'+item.random_code}}">
  22. <label class="i-flex u-m-t-15 i-flex-alc radio" wx:for="{{item.option_val}}" wx:for-item="rItem" wx:key="rItem">
  23. <radio value="{{rItem}}" checked="{{false}}"/>
  24. <view class="i-flex-item">{{rItem}}</view>
  25. </label>
  26. </radio-group>
  27. </view>
  28. <view wx:if="{{item.type=='checked'}}">
  29. <checkbox-group bindchange="checkboxChange" data-idx="{{item.type+'_'+item.random_code}}">
  30. <label class="i-flex u-m-t-15 i-flex-alc" wx:for="{{item.option_val}}" wx:for-item="rItem" wx:key="rItem">
  31. <checkbox value="{{rItem}}" checked="{{false}}"/>
  32. <view class="i-flex-item">{{rItem}}</view>
  33. </label>
  34. </checkbox-group>
  35. </view>
  36. <view wx:if="{{item.type=='area'}}" class="pos-r">
  37. <picker mode="region" bindchange="bindRegionChange" value="{{item.region}}" data-idx="{{index}}">
  38. <view class="ipt {{item.province_id?'':'ipt-holder'}}">
  39. <block wx:if="{{item.province_id}}">
  40. {{item.region[0]}},{{item.region[1]}},{{item.region[2]}}
  41. </block>
  42. <block wx:else>{{item.hint}}</block>
  43. </view>
  44. <i class="iconfont icon-xiatiao rightIcon"></i>
  45. </picker>
  46. </view>
  47. <view wx:if="{{item.type=='date'}}" class="pos-r">
  48. <picker mode="date" value="{{form[item.type+'_'+item.random_code]}}" bindchange="bindDateChange" data-idx="{{item.type+'_'+item.random_code}}">
  49. <view class="ipt">{{form[item.type+'_'+item.random_code]?form[item.type+'_'+item.random_code]:item.hint}}</view>
  50. <i class="iconfont icon-calendar rightIcon"></i>
  51. </picker>
  52. </view>
  53. <view wx:if="{{item.type=='date_range'}}" class="pos-r">
  54. <view class="ipt" bindtap="showDateRange" data-idx="{{index}}">{{form[item.type+'_'+item.random_code]?form[item.type+'_'+item.random_code]:item.begin_hint}}</view>
  55. <timePicker pickerShow="{{item.show}}" id="{{item.type+'_'+item.random_code}}" bind:hidePicker="pickerHide" bind:setPickerTime="setPickerTime"
  56. config="{{item.pickerConfig}}" data-idx="{{index}}"></timePicker>
  57. <i class="iconfont icon-calendar rightIcon"></i>
  58. </view>
  59. <view wx:if="{{item.type=='time'}}" class="pos-r">
  60. <view class="ipt" bindtap="showTimeRange" data-idx="{{index}}">{{form[item.type+'_'+item.random_code]?form[item.type+'_'+item.random_code]:item.hint}}</view>
  61. <time-range show="{{item.show}}" isOne="{{true}}" beginTime="{{form[item.type+'_'+item.random_code]}}" bind:confrim="timeRangeConfirm" bind:cancel="pickerHide" data-idx="{{index}}"></time-range >
  62. <i class="iconfont icon-time rightIcon"></i>
  63. </view>
  64. <view wx:if="{{item.type=='time_range'}}" class="pos-r">
  65. <view class="ipt" bindtap="showTimeRange" data-idx="{{index}}">{{form[item.type+'_'+item.random_code]?form[item.type+'_'+item.random_code]:item.begin_hint}}</view>
  66. <time-range show="{{item.show}}" beginTime="{{item.beginTime}}" endTime="{{item.endTime}}" bind:confrim="timeRangeConfirm" bind:cancel="pickerHide" data-idx="{{index}}"></time-range >
  67. <i class="iconfont icon-time rightIcon"></i>
  68. </view>
  69. <view wx:if="{{item.type=='idcard'}}">
  70. <input value="{{form[item.type+'_'+item.random_code]}}" bindinput="bindKeyInput" data-idx="{{item.type+'_'+item.random_code}}" placeholder="{{item.hint}}" type="{{item.idcard}}" class="ipt" placeholder-class="ipt-holder" maxlength="18" />
  71. </view>
  72. <view wx:if="{{item.type=='telephone'}}">
  73. <input value="{{form[item.type+'_'+item.random_code]}}" bindinput="bindKeyInput" data-idx="{{item.type+'_'+item.random_code}}" placeholder="{{item.hint}}" type="number" class="ipt" placeholder-class="ipt-holder" maxlength="11" />
  74. </view>
  75. </view>
  76. </form>