add-address.wxml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <!--module/diet/pages/delivery-address/delivery-address.wxml-->
  2. <t-navbar title="新增收货地址" left-arrow />
  3. <scroll-view class="add-address-scroll" scroll-y>
  4. <!-- 智能粘贴 -->
  5. <view class="smart-fill">
  6. <view class="smart-title">快速智能填写</view>
  7. <view class="smart-paste-box">
  8. <t-textarea
  9. class="smart-paste-input {{smartPasteFocus ? 'smart-paste-input-focus' : 'smart-paste-input-blur'}}"
  10. placeholder="{{smartPastePlaceholder}}"
  11. value="{{smartPasteValue}}"
  12. focus="{{smartPasteFocus}}"
  13. bind:focus="onSmartPasteFocus"
  14. bind:blur="onSmartPasteBlur"
  15. bind:change="onSmartPasteInput"
  16. autosize
  17. />
  18. <view class="smart-paste-btns-bottom" wx:if="{{smartPasteFocus}}">
  19. <button
  20. class="smart-btn smart-btn-clear"
  21. catchtap="onClearSmartPaste"
  22. >清空</button>
  23. <button
  24. class="smart-btn smart-btn-recognize {{!smartPasteValue ? 'smart-btn-recognize-disabled' : ''}}"
  25. catchtap="onRecognizeSmartPaste"
  26. disabled="{{!smartPasteValue}}"
  27. >识别</button>
  28. </view>
  29. </view>
  30. </view>
  31. <!-- 表单 -->
  32. <view class="form-box">
  33. <view class="form-item">
  34. <view class="form-label">收货人</view>
  35. <t-input
  36. class="form-input"
  37. placeholder="请输入收货人姓名"
  38. value="{{formData.liaison}}"
  39. data-field="formData.liaison"
  40. bind:change="onInput"
  41. clearable="{{focusName}}"
  42. focus="{{focusName}}"
  43. bind:focus="onFocusInput"
  44. bind:blur="onBlurInput"
  45. />
  46. </view>
  47. <view class="form-item">
  48. <view class="form-label">手机号</view>
  49. <t-input
  50. class="form-input"
  51. placeholder="请输入收货人手机号"
  52. value="{{formData.phone}}"
  53. data-field="formData.phone"
  54. bind:change="onInput"
  55. focus="{{focusPhone}}"
  56. clearable="{{focusPhone}}"
  57. bind:focus="onFocusPhone"
  58. bind:blur="onBlurPhone"
  59. maxlength="11"
  60. />
  61. </view>
  62. <view class="form-item" bindtap="onShowRegionPicker">
  63. <view class="form-label">所在地区</view>
  64. <t-input
  65. class="form-input"
  66. placeholder="请选择省市区"
  67. value="{{region}}"
  68. readonly
  69. suffixIcon="{{ { name: 'chevron-right', ariaLabel: '右箭头' ,size:'20px'} }}"
  70. />
  71. </view>
  72. <view class="form-item address-detail-item">
  73. <view class="form-label">详细地址</view>
  74. <t-textarea
  75. class="form-detail"
  76. placeholder="如道路、门牌号、小区、楼栋号、单元等"
  77. value="{{formData.detailAddress}}"
  78. maxlength="50"
  79. data-field="formData.detailAddress"
  80. bind:change="onInput"
  81. show-limit
  82. autofocus
  83. focus="{{focusDetail}}"
  84. clearable="{{focusDetail}}"
  85. bind:focus="onFocusDetail"
  86. bind:blur="onBlurDetail"
  87. autosize
  88. />
  89. </view>
  90. </view>
  91. <!-- 隐私提示 -->
  92. <view class="privacy-tip">
  93. <text>为了保护你的个人隐私,请不要在详细地址中填写手机号</text>
  94. </view>
  95. <!-- 标签 -->
  96. <view class="tag-box">
  97. <view class="form-label">标签</view>
  98. <t-tag wx:for="{{tagList}}" wx:key="item" bindtap="onTagSelect" data-tag="{{item}}" class="tagsList {{selectedTag === item ? 'selected' : ''}}" >{{item}}</t-tag>
  99. </view>
  100. <!-- 默认地址 -->
  101. <view class="default-box">
  102. <view class="form-label">设为默认</view>
  103. <t-switch value="{{formData.isDefault==='Y'}}" bindchange="onDefaultChange" />
  104. </view>
  105. </scroll-view>
  106. <t-cascader visible="{{ regionPickerVisible }}" title="选择地区" options="{{ areaTreeData }}" value="{{ regionValue }}" bind:change="onRegionConfirm" bind:close="onRegionCancel" />
  107. <!-- 底部按钮 -->
  108. <view class="save-btn-box">
  109. <button class="save-btn delete-btn" block bindtap="onDelete" wx:if="{{id}}">删除</button>
  110. <button class="save-btn" block bindtap="onSave" loading="{{saving}}" disabled="{{saving}}">保存</button>
  111. </view>