businessGoodsEdit.wxml 9.9 KB

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