businessGoodsEdit.wxml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  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. data-formkey="product_img_url"
  18. bind:click-preview="uploadImg"
  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. data-formkey="product_rotation_img_list"
  38. bind:click-preview="uploadImg"
  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. data-formkey="product_detail_img_list"
  58. bind:click-preview="uploadImg"
  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 class="form-item" wx:if="{{productCheckStatus === 1}}">
  180. <label>
  181. <text>状 态</text>
  182. </label>
  183. <view class="value">
  184. <view
  185. class="select-options"
  186. wx:for="{{productStatus}}"
  187. wx:key="value"
  188. data-formkey="product_status"
  189. data-item="{{item}}"
  190. bind:tap="handleRadio">
  191. <image
  192. hidden="{{ index === 0 ? form.product_status === 0 : form.product_status === 1}}"
  193. src="../../image/common/unselected.png"></image>
  194. <image
  195. hidden="{{index === 0 ? form.product_status !== 0 : form.product_status !== 1}}"
  196. src="../../image/common/selected.png"></image>
  197. <text>{{item.name}}</text>
  198. </view>
  199. </view>
  200. </view>
  201. <view
  202. class="form-item border-bottom-2"
  203. bind:tap="saleAtTypeShow">
  204. <label>
  205. <text>发售时间</text>
  206. </label>
  207. <view class="value">
  208. <view class="{{!!form.product_sale_at ? '' : 'placeholder'}}">{{form.product_sale_at || '请选择发售时间'}}
  209. </view>
  210. <image class="arrow" src="../../image/businessGoodsEdit/arrow.png"></image>
  211. </view>
  212. </view>
  213. <button
  214. class="btn-submit"
  215. type="primary"
  216. form-type="submit">保存
  217. </button>
  218. </form>
  219. </view>
  220. </view>
  221. <!--弹窗:分类选择-->
  222. <van-popup
  223. show="{{ booCategory }}"
  224. close-on-click-overlay="{{false}}"
  225. round
  226. position="bottom"
  227. bind:click-overlay="categoryHide">
  228. <van-picker
  229. id="picker-category"
  230. columns="{{ categoryList }}"
  231. show-toolbar
  232. default-index="{{ categoryInDefaultIndex }}"
  233. bind:cancel="categoryHide"
  234. bind:confirm="categoryConfirm"/>
  235. </van-popup>
  236. <!--弹窗:品牌选择-->
  237. <van-popup
  238. show="{{ booBrand }}"
  239. close-on-click-overlay="{{false}}"
  240. round
  241. position="bottom"
  242. bind:click-overlay="brandHide">
  243. <van-picker
  244. id="picker-brand"
  245. columns="{{ brandList }}"
  246. show-toolbar
  247. default-index="{{ brandInDefaultIndex }}"
  248. bind:cancel="brandHide"
  249. bind:confirm="brandConfirm"/>
  250. </van-popup>
  251. <!--弹窗:单位选择-->
  252. <van-popup
  253. show="{{ booUnit }}"
  254. close-on-click-overlay="{{false}}"
  255. round
  256. position="bottom"
  257. bind:click-overlay="unitHide">
  258. <van-picker
  259. id="picker-unit"
  260. columns="{{ unitInColumns }}"
  261. show-toolbar
  262. default-index="{{ unitInDefaultIndex }}"
  263. bind:cancel="unitHide"
  264. bind:confirm="unitConfirm"/>
  265. </van-popup>
  266. <!--弹窗:预售选择-->
  267. <van-popup
  268. show="{{ booSaleAtType }}"
  269. close-on-click-overlay="{{false}}"
  270. position="bottom"
  271. bind:click-overlay="saleAtTypeHide">
  272. <view class="sale-at">
  273. <view
  274. class="time-0"
  275. data-type="0"
  276. bind:tap="handleSaleAtType">
  277. <view class="select-wrap">
  278. <image
  279. class="select"
  280. wx:if="{{saleAtType !== '0'}}"
  281. src="../../image/common/unselected.png"></image>
  282. <image
  283. class="select"
  284. wx:if="{{saleAtType === '0'}}"
  285. src="../../image/common/selected.png"></image>
  286. </view>
  287. <text>预售</text>
  288. <view
  289. class="arrow-wrap"
  290. style="visibility:hidden;">
  291. <image
  292. class="arrow"
  293. src="../../image/common/arrow_1.png"></image>
  294. </view>
  295. </view>
  296. <view
  297. class="time-1"
  298. data-type="1"
  299. bind:tap="handleSaleAtType">
  300. <view class="select-wrap">
  301. <image
  302. class="select"
  303. wx:if="{{saleAtType !== '1'}}"
  304. src="../../image/common/unselected.png"></image>
  305. <image
  306. class="select"
  307. wx:if="{{saleAtType === '1'}}"
  308. src="../../image/common/selected.png"></image>
  309. </view>
  310. <text
  311. class="placeholder">{{form.product_sale_at === '预售' || form.product_sale_at === '' ? '选择售卖时间' : form.product_sale_at}}
  312. </text>
  313. <view class="arrow-wrap">
  314. <image
  315. class="arrow"
  316. src="../../image/common/arrow_1.png"></image>
  317. </view>
  318. </view>
  319. </view>
  320. </van-popup>
  321. <!--弹窗:预售时间选择-->
  322. <van-popup
  323. show="{{ booSaleAt }}"
  324. close-on-click-overlay="{{false}}"
  325. round
  326. position="bottom"
  327. bind:click-overlay="saleAtHide">
  328. <van-datetime-picker
  329. id="picker-datetime"
  330. type="datetime"
  331. value="{{ currentDate }}"
  332. min-date="{{ minDate }}"
  333. max-date="{{ maxDate }}"
  334. bind:cancel="saleAtHide"
  335. bind:confirm="saleAtConfirm"/>
  336. </van-popup>