add.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <view>
  3. <!-- <scroll-view scroll-y="true" class="goods-scroll"> -->
  4. <view class="goods-edit-wrap">
  5. <view class="goods-item">
  6. <view class="title">商品类型</view>
  7. <view class="goods-type">
  8. <view :class="{ 'selected color-base-text color-base-border': goodsClass == 1 }" @click="goodsClass = 1">
  9. <text>实物商品</text>
  10. <text class="iconfont iconduigou1"></text>
  11. </view>
  12. <view :class="{ 'selected color-base-text color-base-border': goodsClass == 2 }" @click="goodsClass = 2">
  13. <text>虚拟商品</text>
  14. <text class="iconfont iconduigou1"></text>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="form-main">
  19. <view class="form-title">基础信息</view>
  20. <view class="goods-item">
  21. <view class="form-wrap">
  22. <text class="label">商品名称</text>
  23. <input class="uni-input" v-model="goodsData.goods_name" placeholder="请输入商品名称" maxlength="100" />
  24. </view>
  25. <view class="form-wrap">
  26. <text class="label">促销语</text>
  27. <input class="uni-input" v-model="goodsData.introduction" placeholder="请输入促销语" maxlength="100" />
  28. </view>
  29. <view class="form-wrap more-wrap" @click="openGoodsCategory()">
  30. <text class="label">商品分类</text>
  31. <text class="selected">请选择</text>
  32. <text class="iconfont iconright"></text>
  33. </view>
  34. <view class="form-wrap goods-img" :style="{ height: goodsImgHeight + 'px' }">
  35. <text class="label">商品图片</text>
  36. <view class="img-list">
  37. <shmily-drag-image :list.sync="goodsData.goods_image" :imageWidth="170" :number="10" :callback="refreshGoodsImgHeight()"></shmily-drag-image>
  38. <view class="tips">建议尺寸:800*800,长按图片可拖拽排序,最多上传10张</view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="form-main">
  44. <view class="form-title">规格、价格及库存</view>
  45. <view class="goods-item">
  46. <view class="form-wrap more-wrap" @click="openGoodsSpec()">
  47. <text class="label">规格类型</text>
  48. <text class="selected color-title">单规格</text>
  49. <text class="iconfont iconright"></text>
  50. </view>
  51. <view class="form-wrap more-wrap" @click="openGoodsSpecEdit()">
  52. <text class="label">规格详情</text>
  53. <text class="selected">价格、库存</text>
  54. <text class="iconfont iconright"></text>
  55. </view>
  56. <view class="form-wrap price">
  57. <text class="label">销售价</text>
  58. <input class="uni-input" v-model="goodsData.price" placeholder="0.00" />
  59. <text class="unit">元</text>
  60. </view>
  61. <view class="form-wrap price">
  62. <text class="label">划线价</text>
  63. <input class="uni-input" v-model="goodsData.market_price" placeholder="0.00" />
  64. <text class="unit">元</text>
  65. </view>
  66. <view class="form-wrap price">
  67. <text class="label">成本价</text>
  68. <input class="uni-input" v-model="goodsData.cost_price" placeholder="0.00" />
  69. <text class="unit">元</text>
  70. </view>
  71. <view class="form-wrap price">
  72. <text class="label">库存</text>
  73. <input class="uni-input" v-model="goodsData.goods_stock" placeholder="0" />
  74. <text class="unit">件</text>
  75. </view>
  76. <view class="form-wrap price">
  77. <text class="label">库存预警</text>
  78. <input class="uni-input" v-model="goodsData.goods_stock_alarm" placeholder="0" />
  79. <text class="unit">件</text>
  80. </view>
  81. <view class="form-wrap price">
  82. <text class="label">重量</text>
  83. <input class="uni-input" v-model="goodsData.weight" placeholder="0.00" />
  84. <text class="unit">kg</text>
  85. </view>
  86. <view class="form-wrap price">
  87. <text class="label">体积</text>
  88. <input class="uni-input" v-model="goodsData.volume" placeholder="0.00" />
  89. <text class="unit">m³</text>
  90. </view>
  91. <view class="form-wrap price">
  92. <text class="label">商品编码</text>
  93. <input class="uni-input" v-model="goodsData.sku_no" placeholder="请输入商品编码" />
  94. </view>
  95. </view>
  96. </view>
  97. <view class="form-main">
  98. <view class="form-title">配送及其他信息</view>
  99. <view class="goods-item">
  100. <view class="form-wrap more-wrap" @click="openExpressFreight()">
  101. <text class="label">快递运费</text>
  102. <text class="selected">免邮</text>
  103. <text class="iconfont iconright"></text>
  104. </view>
  105. <!-- <view class="form-wrap more-wrap">
  106. <text class="label">运费模板</text>
  107. <text class="selected">请选择运费模板</text>
  108. <text class="iconfont iconright"></text>
  109. </view> -->
  110. <view class="form-wrap price">
  111. <text class="label">限购数量</text>
  112. <input class="uni-input" placeholder="0" />
  113. <text class="unit">件</text>
  114. </view>
  115. <view class="form-wrap price">
  116. <text class="label">起售数量</text>
  117. <input class="uni-input" placeholder="0" />
  118. <text class="unit">件</text>
  119. </view>
  120. <view class="form-wrap price">
  121. <text class="label">单位</text>
  122. <input class="uni-input" placeholder="请输入单位" />
  123. </view>
  124. <view class="form-wrap price">
  125. <text class="label">排序</text>
  126. <input class="uni-input" placeholder="0" />
  127. </view>
  128. <view class="form-wrap more-wrap" @click="openGoodsState()">
  129. <text class="label">状态</text>
  130. <text class="selected">立刻上架</text>
  131. <text class="iconfont iconright"></text>
  132. </view>
  133. </view>
  134. </view>
  135. <view class="form-main">
  136. <view class="form-title">商品详情</view>
  137. <view class="goods-item">
  138. <view class="form-wrap more-wrap">
  139. <text class="label">商品详情</text>
  140. <text class="selected">查看</text>
  141. <text class="iconfont iconright"></text>
  142. </view>
  143. </view>
  144. </view>
  145. <view class="form-main">
  146. <view class="form-title">商品参数</view>
  147. <view class="goods-item">
  148. <view class="form-wrap more-wrap" @click="openAttr()">
  149. <text class="label">商品参数</text>
  150. <text class="selected">查看</text>
  151. <text class="iconfont iconright"></text>
  152. </view>
  153. </view>
  154. </view>
  155. <!-- <loading-cover ref="loadingCover"></loading-cover> -->
  156. </view>
  157. <!-- </scroll-view> -->
  158. <view class="footer-wrap"><button type="primary">保存</button></view>
  159. </view>
  160. </template>
  161. <script>
  162. import shmilyDragImage from '@/components/shmily-drag-image/shmily-drag-image.vue';
  163. import nsSwitch from '@/components/ns-switch/ns-switch.vue';
  164. import edit from './js/edit.js';
  165. export default {
  166. components: {
  167. shmilyDragImage,
  168. nsSwitch
  169. },
  170. mixins: [edit]
  171. };
  172. </script>
  173. <style lang="scss">
  174. @import './css/edit.scss';
  175. </style>