index.wxml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <nav
  2. type="back"
  3. title="添加地址"
  4. backgroundColor="{{activeColor ? activeColor : '#ffffff'}}"
  5. frontColor="{{titleColor?titleColor:'#000000'}}"
  6. ></nav>
  7. <view class="container">
  8. <view class='edit-container'>
  9. <view class="a-item">
  10. <view class="icon">
  11. <image class="img" src="https://file-cloud.fmode.cn/receiver.png"></image>
  12. </view>
  13. <view class="input-wrap">
  14. <input
  15. cursor-spacing='100'
  16. class='a-input'
  17. bindinput="bindinputName"
  18. placeholder='姓名'
  19. value="{{address.name}}"
  20. ></input>
  21. </view>
  22. </view>
  23. <view class="a-item">
  24. <view class="icon">
  25. <image class="img" src="https://file-cloud.fmode.cn/mobile.png"></image>
  26. </view>
  27. <view class="input-wrap">
  28. <input
  29. cursor-spacing='100'
  30. class='a-input'
  31. type='number'
  32. bindblur="mobilechange"
  33. value="{{address.mobile}}"
  34. placeholder='手机号码'
  35. maxlength='12'
  36. ></input>
  37. </view>
  38. </view>
  39. <!--
  40. <view class="a-item">
  41. <view class="icon">
  42. <image class="img" src="/nova-shop/images/icon/position.png"></image>
  43. </view>
  44. <view class="input-wrap" bindtap="chooseRegion">
  45. <input
  46. cursor-spacing='100'
  47. class="a-input"
  48. value="{{address.full_region}}"
  49. disabled="true"
  50. placeholder="选择省份、城市、区县"
  51. />
  52. <view class="arrow"></view>
  53. </view>
  54. </view>
  55. -->
  56. <view class="a-item">
  57. <view class="icon">
  58. <image class="img" src="https://file-cloud.fmode.cn/address.png"></image>
  59. </view>
  60. <view class="input-wrap" bindtap="showAddress">
  61. <input
  62. cursor-spacing='100'
  63. class="a-input"
  64. value="{{address.full_region}}"
  65. disabled="true"
  66. placeholder="选择省份、城市、区县"
  67. />
  68. <view class="arrow"></view>
  69. </view>
  70. </view>
  71. <view class="a-item">
  72. <view class="icon">
  73. <image class="img" src="https://file-cloud.fmode.cn/address.png"></image>
  74. </view>
  75. <view class="input-wrap">
  76. <input
  77. cursor-spacing='100'
  78. class="a-input"
  79. bindinput="bindinputAddress"
  80. value="{{address.address}}"
  81. placeholder="详细地址, 如街道、小区或写字楼等"
  82. />
  83. </view>
  84. </view>
  85. <!-- <view class="a-item">
  86. <view class="default-input {{address.is_default == 1 ? 'checked' : 'unchecked'}}" bindtap="bindIsDefault" >点击设为默认地址</view>
  87. </view> -->
  88. </view>
  89. <view class="default-wrap">
  90. <view class="text">设为默认地址</view>
  91. <switch
  92. class="switch"
  93. checked="{{address.is_default}}"
  94. bindchange="switchChange"
  95. ></switch>
  96. </view>
  97. <view
  98. wx:if="{{type==1}}"
  99. class='btn-wrap'
  100. bindtap="saveAddress"
  101. >
  102. <view class="btn active">新增</view>
  103. </view>
  104. <view
  105. wx:if="{{type==2}}"
  106. class='btn-wrap'
  107. bindtap="saveEditAddress"
  108. >
  109. <view class="btn active">保存</view>
  110. </view>
  111. <view
  112. class='delete-wrap'
  113. wx:if="{{addressId > 0}}"
  114. bindtap='deleteAddress'
  115. >
  116. <view class='btn'>删除</view>
  117. </view>
  118. <view class="region-select" wx:if="{{openSelectRegion}}">
  119. <view class="hd">
  120. <view class="region-selected">
  121. <view
  122. class="item {{item.id == 0 ? 'disabled' : ''}} {{(regionType -1) === index ? 'selected' : ''}}"
  123. bindtap="selectRegionType"
  124. data-region-type-index="{{index}}"
  125. wx:for="{{selectRegionList}}"
  126. wx:key="id"
  127. >{{item.name}}
  128. </view>
  129. </view>
  130. <view class="done {{selectRegionDone ? '' : 'disabled'}}" bindtap="doneSelectRegion">确定</view>
  131. </view>
  132. <view class="bd">
  133. <scroll-view scroll-y class="region-list">
  134. <view
  135. class="item {{item.selected ? 'selected' : ''}}"
  136. bindtap="selectRegion"
  137. data-region-index="{{index}}"
  138. wx:for="{{regionList}}"
  139. wx:key="id"
  140. >{{item.name}}
  141. </view>
  142. </scroll-view>
  143. </view>
  144. </view>
  145. </view>
  146. <view
  147. class="bg-mask"
  148. bindtap="cancelSelectRegion"
  149. wx:if="{{openSelectRegion}}"
  150. ></view>
  151. <van-popup
  152. show="{{ isAddress }}"
  153. closeable
  154. position="bottom"
  155. custom-style="height: 20%"
  156. bind:close="onClose"
  157. >
  158. <view style="width:100%;position:fixed;bottom:0;left:0;z-index:10000;height:500rpx;background-color:white">
  159. <!-- 仿原生picker的“确定”和“取消”按钮 -->
  160. <view style="display:flex;width:100%;height:100%">
  161. <view style="position: absolute;top:0;width:100%;height:100rpx;z-index:1000000;display:flex;justify-content:space-between;align-items:center;">
  162. <view style="width:calc(100% / 3);text-align:center;color:rgba(0,0,0,.6);font-size:28rpx" bindtap="onClose">取消
  163. </view>
  164. <view style="width:calc(100% / 3);text-align:center;color:#ff3456;font-size:28rpx" bindtap="confirm">确定
  165. </view>
  166. </view>
  167. <picker-view
  168. indicator-style="height: 200rpx;"
  169. style="width: 100%;height: 300rpx;text-align: center;margin-top:150rpx"
  170. value="{{pIndex}}"
  171. bindchange="changeProvince"
  172. >
  173. <picker-view-column>
  174. <view
  175. wx:for="{{placeArray}}"
  176. wx:key="name"
  177. style="line-height: 77rpx"
  178. >{{item.name}}
  179. </view>
  180. </picker-view-column>
  181. </picker-view>
  182. <picker-view
  183. indicator-style="height: 200rpx;"
  184. style="width: 100%;height: 300rpx;text-align: center;margin-top:150rpx"
  185. value="{{cIndex}}"
  186. bindchange="changeCity"
  187. >
  188. <picker-view-column>
  189. <view
  190. wx:for="{{placeArray[pIndex].city}}"
  191. wx:key="name"
  192. style="line-height: 77rpx"
  193. >{{item.name}}
  194. </view>
  195. </picker-view-column>
  196. </picker-view>
  197. <picker-view
  198. indicator-style="height: 200rpx;"
  199. style="width: 100%;height: 300rpx;text-align: center;margin-top:150rpx"
  200. value="{{aIndex}}"
  201. bindchange="changeArea"
  202. >
  203. <picker-view-column>
  204. <view
  205. wx:for="{{placeArray[pIndex].city[cIndex].area}}"
  206. wx:key="*this"
  207. style="line-height: 77rpx"
  208. >{{item}}
  209. </view>
  210. </picker-view-column>
  211. </picker-view>
  212. </view>
  213. </view>
  214. </van-popup>