businessGoodsEdit.wxml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <view class="wrapper">
  2. <view class="width-690">
  3. <form bind:submit="onSubmit">
  4. <view class="photo">
  5. <label>
  6. <text>商品主图</text>
  7. <text>({{form.product_img_url.length}}/{{product_img_url_max}})</text>
  8. </label>
  9. <view class="value">
  10. <view
  11. class="van-uploader-wrap">
  12. <van-uploader
  13. file-list="{{ form.product_img_url }}"
  14. max-count="{{product_img_url_max}}"
  15. multiple="{{false}}"
  16. accept="image"
  17. image-fit="aspectFit"
  18. data-formkey="product_img_url"
  19. bind:after-read="afterRead"
  20. bind:delete="delete"/>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="photo">
  25. <label>
  26. <text>商品轮播图</text>
  27. <text>({{form.product_rotation_img_list.length}}/{{product_rotation_img_list_max}})</text>
  28. </label>
  29. <view class="value">
  30. <view
  31. class="van-uploader-wrap">
  32. <van-uploader
  33. file-list="{{ form.product_rotation_img_list }}"
  34. max-count="{{product_rotation_img_list_max}}"
  35. multiple="{{true}}"
  36. accept="image"
  37. image-fit="aspectFit"
  38. data-formkey="product_rotation_img_list"
  39. bind:after-read="afterRead"
  40. bind:delete="delete"/>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="photo">
  45. <label>
  46. <text>商品详情图</text>
  47. <text>({{form.product_detail_img_list.length}}/{{product_detail_img_list_max}})</text>
  48. </label>
  49. <view class="value">
  50. <view
  51. class="van-uploader-wrap">
  52. <van-uploader
  53. file-list="{{ form.product_detail_img_list }}"
  54. max-count="{{product_detail_img_list_max}}"
  55. multiple="{{true}}"
  56. accept="image"
  57. image-fit="aspectFit"
  58. data-formkey="product_detail_img_list"
  59. bind:after-read="afterRead"
  60. bind:delete="delete"/>
  61. </view>
  62. </view>
  63. <view class="tip border-bottom-2">请上传尺寸为375*375像素图片</view>
  64. </view>
  65. <view class="form-item">
  66. <label>
  67. <text>标题</text>
  68. </label>
  69. <view class="value">
  70. <input
  71. value="{{form.product_title}}"
  72. placeholder="输入商品标题"
  73. placeholder-class="placeholder"
  74. data-formkey="product_title"
  75. bind:input="setFormValue"></input>
  76. </view>
  77. </view>
  78. <view class="describe">
  79. <view class="value">
  80. <textarea
  81. value="{{form.product_desc}}"
  82. placeholder="请输入商品简介"
  83. placeholder-class="placeholder"
  84. maxlength="{{200}}"
  85. auto-height="{{true}}"
  86. data-formkey="product_desc"
  87. bind:input="setFormValue"></textarea>
  88. <view class="words-limit">{{form.product_desc.length}}/200</view>
  89. </view>
  90. </view>
  91. <view
  92. class="form-item border-bottom-2"
  93. bind:tap="categoryShow">
  94. <label>
  95. <text>商品分类</text>
  96. </label>
  97. <view class="value">
  98. <view
  99. class="{{!!form.product_category_id.id ? '' : 'placeholder'}}">
  100. {{form.product_category_id.category_name || '请选择商品分类'}}
  101. </view>
  102. <image class="arrow" src="../../image/businessGoodsEdit/arrow.png"></image>
  103. </view>
  104. </view>
  105. <view
  106. class="form-item"
  107. bind:tap="brandShow">
  108. <label>
  109. <text>商品品牌</text>
  110. </label>
  111. <view class="value">
  112. <view class="{{!!form.product_brand_id.id ? '' : 'placeholder'}}">
  113. {{form.product_brand_id.brand_name || '请选择商品品牌'}}
  114. </view>
  115. <image class="arrow" src="../../image/businessGoodsEdit/arrow.png"></image>
  116. </view>
  117. </view>
  118. <view class="form-item">
  119. <label>
  120. <text>商品规格</text>
  121. </label>
  122. <view class="value">
  123. <input
  124. value="{{form.product_spec}}"
  125. placeholder="输入商品规格"
  126. placeholder-class="placeholder"
  127. data-formkey="product_spec"
  128. bind:input="setFormValue"></input>
  129. </view>
  130. </view>
  131. <view class="form-item" bind:tap="unitShow">
  132. <label>
  133. <text>单 位</text>
  134. </label>
  135. <view class="value">
  136. <view class="{{!!form.product_unit ? '' : 'placeholder'}}">{{form.product_unit || '请选择商品单位'}}</view>
  137. <image class="arrow" src="../../image/businessGoodsEdit/arrow.png"></image>
  138. </view>
  139. </view>
  140. <view class="form-item">
  141. <label>
  142. <text>批发价(元)</text>
  143. </label>
  144. <view class="value">
  145. <input
  146. value="{{form.product_all_price}}"
  147. placeholder="输入批发价"
  148. placeholder-class="placeholder"
  149. data-formkey="product_all_price"
  150. bind:input="setFormValue"></input>
  151. </view>
  152. </view>
  153. <view class="form-item">
  154. <label>
  155. <text>零售价(元)</text>
  156. </label>
  157. <view class="value">
  158. <input
  159. value="{{form.product_price}}"
  160. placeholder="输入零售价"
  161. placeholder-class="placeholder"
  162. data-formkey="product_price"
  163. bind:input="setFormValue"></input>
  164. </view>
  165. </view>
  166. <view class="form-item">
  167. <label>
  168. <text>库 存</text>
  169. </label>
  170. <view class="value">
  171. <input
  172. value="{{form.product_count}}"
  173. placeholder="输入库存"
  174. placeholder-class="placeholder"
  175. data-formkey="product_count"
  176. bind:input="setFormValue"></input>
  177. </view>
  178. </view>
  179. <view
  180. class="form-item border-bottom-2"
  181. bind:tap="saleAtTypeShow">
  182. <label>
  183. <text>发售时间</text>
  184. </label>
  185. <view class="value">
  186. <view
  187. class="{{!!form.product_sale_at ? '' : 'placeholder'}}">
  188. <block
  189. wx:if="{{!!form.product_sale_at}}">
  190. {{form.product_sale_at === '现货' ? form.product_sale_at : '预售时间:' + form.product_sale_at}}
  191. </block>
  192. <block wx:else>请选择预售时间</block>
  193. </view>
  194. <image class="arrow" src="../../image/businessGoodsEdit/arrow.png"></image>
  195. </view>
  196. </view>
  197. <button
  198. class="btn-submit"
  199. type="primary"
  200. form-type="submit">保存
  201. </button>
  202. </form>
  203. </view>
  204. </view>
  205. <!--弹窗:分类选择-->
  206. <van-popup
  207. show="{{ booCategory }}"
  208. close-on-click-overlay="{{false}}"
  209. round
  210. position="bottom"
  211. bind:click-overlay="categoryHide">
  212. <van-picker
  213. id="picker-category"
  214. columns="{{ categoryList }}"
  215. show-toolbar
  216. default-index="{{ categoryInDefaultIndex }}"
  217. bind:cancel="categoryHide"
  218. bind:confirm="categoryConfirm"/>
  219. </van-popup>
  220. <!--弹窗:品牌选择-->
  221. <van-popup
  222. show="{{ booBrand }}"
  223. close-on-click-overlay="{{false}}"
  224. round
  225. position="bottom"
  226. bind:click-overlay="brandHide">
  227. <van-picker
  228. id="picker-brand"
  229. columns="{{ brandList }}"
  230. show-toolbar
  231. default-index="{{ brandInDefaultIndex }}"
  232. bind:cancel="brandHide"
  233. bind:confirm="brandConfirm"/>
  234. </van-popup>
  235. <!--弹窗:单位选择-->
  236. <van-popup
  237. show="{{ booUnit }}"
  238. close-on-click-overlay="{{false}}"
  239. round
  240. position="bottom"
  241. bind:click-overlay="unitHide">
  242. <van-picker
  243. id="picker-unit"
  244. columns="{{ unitInColumns }}"
  245. show-toolbar
  246. default-index="{{ unitInDefaultIndex }}"
  247. bind:cancel="unitHide"
  248. bind:confirm="unitConfirm"/>
  249. </van-popup>
  250. <!--弹窗:预售选择-->
  251. <van-popup
  252. show="{{ booSaleAtType }}"
  253. close-on-click-overlay="{{false}}"
  254. position="bottom"
  255. bind:click-overlay="saleAtTypeHide">
  256. <view class="sale-at">
  257. <view
  258. class="time-0"
  259. data-type="0"
  260. bind:tap="handleSaleAtType">
  261. <view class="select-wrap">
  262. <image
  263. class="select"
  264. wx:if="{{saleAtType !== '0'}}"
  265. src="../../image/common/unselected.png"></image>
  266. <image
  267. class="select"
  268. wx:if="{{saleAtType === '0'}}"
  269. src="../../image/common/selected.png"></image>
  270. </view>
  271. <text>现货</text>
  272. <view
  273. class="arrow-wrap"
  274. style="visibility:hidden;">
  275. <image
  276. class="arrow"
  277. src="../../image/common/arrow_1.png"></image>
  278. </view>
  279. </view>
  280. <view
  281. class="time-1"
  282. data-type="1"
  283. bind:tap="handleSaleAtType">
  284. <view class="select-wrap">
  285. <image
  286. class="select"
  287. wx:if="{{saleAtType !== '1'}}"
  288. src="../../image/common/unselected.png"></image>
  289. <image
  290. class="select"
  291. wx:if="{{saleAtType === '1'}}"
  292. src="../../image/common/selected.png"></image>
  293. </view>
  294. <text
  295. class="placeholder">{{form.product_sale_at === '现货' || form.product_sale_at === '' ? '选择预售时间' : '预售时间:' + form.product_sale_at}}
  296. </text>
  297. <view class="arrow-wrap">
  298. <image
  299. class="arrow"
  300. src="../../image/common/arrow_1.png"></image>
  301. </view>
  302. </view>
  303. </view>
  304. </van-popup>
  305. <!--弹窗:预售时间选择-->
  306. <van-popup
  307. show="{{ booSaleAt }}"
  308. close-on-click-overlay="{{false}}"
  309. round
  310. position="bottom"
  311. bind:click-overlay="saleAtHide">
  312. <van-datetime-picker
  313. id="picker-datetime"
  314. type="date"
  315. value="{{ currentDate }}"
  316. min-date="{{ minDate }}"
  317. max-date="{{ maxDate }}"
  318. bind:cancel="saleAtHide"
  319. bind:confirm="saleAtConfirm"/>
  320. </van-popup>