Addcommodity.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <view class="titlenav">
  3. <!-- <titlenav :flag="true"></titlenav> -->
  4. <view class="top">
  5. <view class="title">新增商品</view>
  6. </view>
  7. <view class="content">
  8. <u-cell-group :border="false" class="from">
  9. <view class="list">
  10. <view class="name">商品名称</view>
  11. <u-field placeholder="请输入商品名称" is-link v-model="form.storename" />
  12. </view>
  13. <view class="list">
  14. <view class="name name2">商品分类</view>
  15. <u-cell-item title="请选择所属分类" is-link></u-cell-item>
  16. </view>
  17. <view class="list">
  18. <view class="name">库存(件)</view>
  19. <u-field placeholder="请输入库存数量" is-link v-model="form.stock" />
  20. </view>
  21. <view class="list">
  22. <view class="name">单价(元)</view>
  23. <u-field placeholder="商品单价(元)" is-link v-model="form.price" />
  24. </view>
  25. <view class="list">
  26. <view class="name">主料</view>
  27. <u-field placeholder="请输入材料" is-link v-model="form.material" />
  28. </view>
  29. <view class="list">
  30. <view class="name">规格</view>
  31. <u-field placeholder="例:1人份 (200g)" is-link v-model="form.num" />
  32. </view>
  33. </u-cell-group>
  34. </view>
  35. <view class="bottom">
  36. <view class="characteristic">掌柜描述</view>
  37. <u-field type="textarea" placeholder="请介绍您的商品信息,会更受欢迎哦" v-model="form.characteristic" />
  38. <view class="characteristic">商品实物图</view>
  39. <u-upload :action="action" max-count="3" :file-list="fileList"></u-upload>
  40. </view>
  41. <view class="btn">
  42. <u-button block class="btn2" @click="submit">不上架</u-button>
  43. <u-button block type="primary" @click="submit2">上架出售</u-button>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import { mapState } from 'vuex';
  49. import Titlenav from '../components/Titlenav.vue';
  50. export default {
  51. components: { Titlenav },
  52. data() {
  53. return {
  54. form: {},
  55. action: 'http://www.example.com/upload',
  56. fileList: [
  57. {
  58. url: ''
  59. }
  60. ]
  61. };
  62. },
  63. computed: {
  64. ...mapState(['systemInfo'])
  65. },
  66. methods: {}
  67. };
  68. </script>
  69. <style lang="scss" scoped>
  70. .titlenav {
  71. background: #214bbe;
  72. .top {
  73. height: 50px;
  74. .title {
  75. font-size: 22px;
  76. font-weight: bold;
  77. color: #ffffff;
  78. line-height: 26px;
  79. padding: 10px 0 20px 20px;
  80. }
  81. }
  82. .content {
  83. background: #ffffff;
  84. border-radius: 16px 16px 0px 0px;
  85. padding: 1px 20px;
  86. display: flex;
  87. align-items: center;
  88. }
  89. .bottom {
  90. background: #ffffff;
  91. padding-bottom: 100px;
  92. /deep/ .u-field {
  93. margin: 0 20px;
  94. padding: 0 0 15px 0;
  95. }
  96. .characteristic {
  97. font-size: 14px;
  98. font-weight: bold;
  99. color: #000000;
  100. line-height: 24px;
  101. padding: 24px 0 8px 20px;
  102. }
  103. }
  104. /deep/ .u-btn {
  105. width: 162px;
  106. height: 48px;
  107. font-size: 16px;
  108. font-weight: 400;
  109. color: #ffffff;
  110. border-radius: 4px;
  111. }
  112. /deep/ .u-list-item {
  113. margin-left: 20px;
  114. width: 160px !important;
  115. height: 160px !important;
  116. }
  117. /deep/ .u-label {
  118. flex: 0 0 0 !important;
  119. }
  120. /deep/ .u-iconfont {
  121. font-size: 14px !important;
  122. }
  123. /deep/ .uni-textarea-textarea {
  124. font-size: 16px;
  125. font-weight: 400;
  126. color: #000000;
  127. line-height: 24px;
  128. }
  129. /deep/ .uni-textarea-placeholder {
  130. font-weight: 400;
  131. font-size: 16px;
  132. }
  133. .from {
  134. /deep/ .u-cell__value {
  135. color: #000000;
  136. font-weight: 400;
  137. }
  138. /deep/ .u-cell_title {
  139. font-size: 13px;
  140. font-weight: 400;
  141. color: #aaabad;
  142. line-height: 24px;
  143. }
  144. /deep/ .u-field {
  145. padding: 23px 0;
  146. color: #000000;
  147. font-weight: bold;
  148. }
  149. /deep/ .uni-input-input {
  150. font-weight: 400;
  151. }
  152. /deep/ .uni-input-placeholder {
  153. font-size: 13px;
  154. font-weight: 400;
  155. color: #aaabad;
  156. line-height: 24px;
  157. }
  158. /deep/ .u-cell {
  159. padding: 21.5px 0;
  160. }
  161. /deep/ .u-cell__value {
  162. height: 27px;
  163. }
  164. .list {
  165. display: flex;
  166. align-items: center;
  167. .name {
  168. font-size: 14px;
  169. font-weight: bold;
  170. width: 86px;
  171. color: #000000;
  172. line-height: 24px;
  173. margin-right: 14px;
  174. &.name2 {
  175. margin-right: 44px;
  176. }
  177. }
  178. }
  179. }
  180. .btn {
  181. display: flex;
  182. align-items: center;
  183. position: fixed;
  184. justify-content: space-between;
  185. left: 0;
  186. right: 0;
  187. bottom: 0;
  188. z-index: 100;
  189. padding: 6px 20px;
  190. padding-bottom: 34px;
  191. padding-bottom: calc(34px + constant(safe-area-inset-bottom)); // 兼容 IOS<11.2
  192. padding-bottom: calc(34px + env(safe-area-inset-bottom)); // 兼容 IOS>=11.2
  193. background-color: #ffffff;
  194. .btn2 {
  195. color: #214bbe;
  196. }
  197. }
  198. }
  199. </style>