edit.wxml 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <!--pages/goods/edit.wxml-->
  2. <form bindsubmit="formSubmit" report-submit="true">
  3. <wux-cell-group>
  4. <wux-cell title="商品分类" hover-class="none" is-link extra="{{categoryDisplay}}" bind:click="showCategoryPicker"></wux-cell>
  5. <wux-cell hover-class="none">
  6. <wux-input label="商品名称" data-label="商品名称" data-rules="required" error="{{goodsName_error}}" value="{{goodsName}}" controlled focus="{{goodsName_focus}}" data-name="goodsName" bind:change="inputChange" bind:error="onError" bind:blur="onBlur" clear placeholder="请输入商品名称"></wux-input>
  7. </wux-cell>
  8. <wux-cell hover-class="none">
  9. <wux-input label="商品编号" data-label="商品编号" data-rules="required" error="{{sn_error}}" focus="{{sn_focus}}" value="{{sn}}" controlled data-name="sn" bind:change="inputChange" bind:error="onError" bind:blur="onBlur" clear placeholder="请输入商品编号"></wux-input>
  10. </wux-cell>
  11. <wux-cell title="商品图片" hover-class="none">
  12. <view style="margin-top:20rpx">
  13. <!-- <wux-upload listType="picture-card" controlled fileList="{{fileList}}" showUploadList max="4" url="{{uploadUrl}}" bind:change="onFileChange" bind:success="onFileUploadSuccess" bind:fail="onFail" bind:complete="onFileComplete" bind:preview="onPreview"
  14. bind:remove="onFileRemove">
  15. </wux-upload> -->
  16. <view wx:if="{{fileList.length>0}}" >
  17. <block class="image_upload" wx:for="{{fileList}}" >
  18. <image data-action="edit" data-index="{{index}}" bindtap="navToResize" mode="aspectFit" src="{{item.url}}"></image>
  19. <van-icon class="image_close" name="close" size="20px"/>
  20. </block>
  21. <view data-action="add" class="image_upload" bindtap="navToResize">
  22. <van-icon name="plus" size="20px" />
  23. </view>
  24. </view>
  25. <view wx:else data-action="add" class="image_upload" bindtap="navToResize">
  26. <van-icon name="plus" size="20px" />
  27. </view>
  28. </view>
  29. </wux-cell>
  30. <wux-cell hover-class="none">
  31. <wux-input label="商品价格" value="{{price}}" controlled data-label="商品价格" data-rules="required" error="{{price_error}}" focus="{{price_focus}}" data-name="price" bind:change="inputChange" type="digit" bind:error="onError" bind:blur="onBlur" clear placeholder="请输入商品价格"></wux-input>
  32. </wux-cell>
  33. <wux-cell hover-class="none">
  34. <wux-input label="库存" value="{{stock}}" controlled data-label="库存" data-rules="required" error="{{stock_error}}" focus="{{stock_focus}}" data-name="stock" bind:change="inputChange" type="digit" bind:error="onError" bind:blur="onBlur" clear placeholder="请输入库存" disabled="{{goods_id}}"></wux-input>
  35. </wux-cell>
  36. </wux-cell-group>
  37. <view class="cu-bar bg-white solid-bottom">
  38. <view class="action text-black">商品详情</view>
  39. </view>
  40. <view class="cu-card">
  41. <view>
  42. <view wx:for="{{pics}}" wx:key="{{index}}" class="margin bg-white text-center padding shadow margin-top-sm" >
  43. <view class="cu-bar bg-white">
  44. <view class="action"></view>
  45. <view class="action">
  46. <button class="cu-btn line-green sm cuIcon-edit margin-right-sm" bindtap="changePic" data-id="{{index}}">更换</button>
  47. <button class="cu-btn line-orange sm cuIcon-delete" bindtap="deletePic" data-id="{{index}}">删除</button>
  48. </view>
  49. </view>
  50. <image mode="aspectFit" src="{{item}}" ></image>
  51. </view>
  52. </view>
  53. <view class="margin bg-white text-center padding shadow margin-top-sm">
  54. <view bindtap="sendImage" style="height:200rpx" class="flex justify-center align-center text-xsl text-green">
  55. <view class="cuIcon-roundadd"></view>
  56. </view>
  57. </view>
  58. </view>
  59. <!--分类选择弹出层-->
  60. <wux-cascader visible="{{ categoryShow }}" controlled value="{{ categoryValue }}" title="商品分类" defaultFieldNames="{{defaultFieldNames}}" closable options="{{ options2 }}" bind:close="closeCategoryPicker" bind:change="categoryChange" />
  61. <view class="operBtn">
  62. <van-row>
  63. <van-col span="12" wx:if="{{goods_id}}">
  64. <button class="van-button van-button van-button--primary van-button--primary van-button--large van-button--large van-button--square van-button--square" bindtap="offProduct" form-type="submit">下架</button>
  65. </van-col>
  66. <van-col span="{{goods_id?12:24}}">
  67. <!-- <wux-button block type="calm" bindtap="aboveProduct" formType="submit">calm</wux-button> -->
  68. <button class="van-button van-button van-button--danger van-button--danger van-button--large van-button--large van-button--square van-button--square" bindtap="aboveProduct" form-type="submit">上架</button>
  69. </van-col>
  70. </van-row>
  71. </view>
  72. </form>
  73. <!--顶部提示框-->
  74. <wux-toptips id="wux-toptips" />
  75. <wux-toast id="wux-toast" />
  76. <wux-loading id="wux-loading" />
  77. <wux-dialog id="wux-dialog" />