index.wxml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <nav type="back" title="{{id?'编辑商品':'添加商品'}}" background-color="#46a9a4"></nav>
  2. <view class="top">
  3. <view class="top-figure">套餐首图</view>
  4. <upload bind:onChangeFile="changeFile" fileList="{{imageList}}" accept="image" maxCount="1" uploadURL="{{uploadURL}}"
  5. domain="{{domain}}" uptokenURL="{{uptokenURL}}"></upload>
  6. <input bindblur="blur" type="text" class="input" data-name="name" value="{{name}}" placeholder="商品名称"></input>
  7. <input bindblur="blur" type="text" class="input" data-name="desc" value="{{desc}}"
  8. placeholder="商品简介"></input>
  9. <view class="top-input">
  10. <view class="top-txt">
  11. <input bindblur="blur" type="text" class="inputs" data-name="price" value="{{price}}"
  12. placeholder="售价多少"></input>
  13. <view>元</view>
  14. </view>
  15. <view class="top-txt">
  16. <input bindblur="blur" type="text" class="inputs" data-name="originalPrice" value="{{originalPrice}}"
  17. placeholder="商品原价"></input>
  18. <view>元</view>
  19. </view>
  20. </view>
  21. <view class="top-input">
  22. <view class="top-txt">
  23. <input bindblur="blur" type="number" class="inputs" data-name="sales" value="{{sales}}"
  24. placeholder="已售数量"></input>
  25. <view>件</view>
  26. </view>
  27. <view class="top-txt">
  28. <input bindblur="blur" type="number" class="inputs" data-name="total" value="{{total}}"
  29. placeholder="库存数量"></input>
  30. <view>件</view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="goods-title" bindtap="showCategory">
  35. <view class="goods-txt">商品分类</view>
  36. <view class="txt-placeholder">
  37. <view class="txt-place">{{category?category.name:'请选择商品分类'}}</view>
  38. <van-icon name="arrow" />
  39. </view>
  40. </view>
  41. <van-popup show="{{ showPicker }}" round position="bottom" custom-style="height: 50%" bind:close="closePicker">
  42. <van-picker show-toolbar title="选择商品分类" custom-style="height: 100%" columns="{{ columns }}" value-key="{{'name'}}"
  43. defaultIndex="{{pickerIndex}}" getColumnIndex="{{item}}" bind:cancel="onCancel" bind:confirm="onConfirm" />
  44. </van-popup>
  45. <view class="goods-title">
  46. <view class="goods-txt">是否上架商品</view>
  47. <van-switch checked="{{ checked }}" bind:change="onChange" />
  48. </view>
  49. <view class="goods-title">
  50. <view class="goods-txt">是否推荐商品</view>
  51. <van-switch checked="{{ check }}" bind:change="oChange" />
  52. </view>
  53. <view class="buttoms">
  54. <buttom class="buttoms-bottom2" bindtap="submit">发布商品</buttom>
  55. </view>