edit.wxml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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}}" wx:key="index" >
  18. <view class="my_image">
  19. <image style="width: 130rpx;height: 130rpx;" data-action="edit" data-index="{{index}}" bindtap="navToResize" mode="aspectFit" src="{{item.url}}"></image>
  20. <!-- <van-icon class="image_close" name="close" size="20px"/>-->
  21. </view>
  22. </block>
  23. <view style="margin: 7rpx;" data-action="add" class="image_upload" bindtap="navToResize">
  24. <van-icon name="plus" size="20px" />
  25. </view>
  26. </view>
  27. <view wx:else data-action="add" class="image_upload" bindtap="navToResize">
  28. <van-icon name="plus" size="20px" />
  29. </view>
  30. </view>
  31. </wux-cell>
  32. <wux-cell hover-class="none">
  33. <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>
  34. </wux-cell>
  35. <wux-cell hover-class="none">
  36. <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>
  37. </wux-cell>
  38. </wux-cell-group>
  39. <view class="cu-bar bg-white solid-bottom">
  40. <view class="action text-black">商品详情</view>
  41. </view>
  42. <view class="cu-card">
  43. <view>
  44. <view wx:for="{{pics}}" wx:key="index" class="margin bg-white text-center padding shadow margin-top-sm" >
  45. <view class="cu-bar bg-white">
  46. <view class="action"></view>
  47. <view class="action">
  48. <button class="cu-btn line-green sm cuIcon-edit margin-right-sm" bindtap="changePic" data-id="{{index}}">更换</button>
  49. <button class="cu-btn line-orange sm cuIcon-delete" bindtap="deletePic" data-id="{{index}}">删除</button>
  50. </view>
  51. </view>
  52. <image mode="aspectFit" src="{{item}}" ></image>
  53. </view>
  54. </view>
  55. <view class="margin bg-white text-center padding shadow margin-top-sm">
  56. <view bindtap="sendImage" style="height:200rpx" class="flex justify-center align-center text-xsl text-green">
  57. <view class="cuIcon-roundadd"></view>
  58. </view>
  59. </view>
  60. </view>
  61. <!--分类选择弹出层-->
  62. <wux-cascader visible="{{ categoryShow }}" controlled value="{{ categoryValue }}" title="商品分类" defaultFieldNames="{{defaultFieldNames}}" closable options="{{ options2 }}" bind:close="closeCategoryPicker" bind:change="categoryChange" />
  63. <view class="operBtn">
  64. <van-row>
  65. <van-col span="12" wx:if="{{goods_id}}">
  66. <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="offProduct" form-type="submit">下架</button>
  67. </van-col>
  68. <van-col span="{{goods_id?12:24}}">
  69. <!-- <wux-button block type="calm" bindtap="aboveProduct" formType="submit">calm</wux-button> -->
  70. <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="aboveProduct" form-type="submit">上架</button>
  71. </van-col>
  72. </van-row>
  73. </view>
  74. </form>
  75. <!--顶部提示框-->
  76. <wux-toptips id="wux-toptips" />
  77. <wux-toast id="wux-toast" />
  78. <wux-loading id="wux-loading" />
  79. <wux-dialog id="wux-dialog" />