index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <view class="page">
  3. <view class="page-container">
  4. <u-navbar class="nav-bar" title="库存管理" :autoBack="true" :placeholder="true" v-hideNav></u-navbar>
  5. <!-- 总资产成本区域 -->
  6. <view class="asset-header">
  7. <view class="asset-text-wrap">
  8. <view class="asset-title-con">
  9. <view class="asset-title">总资产成本(元)</view>
  10. <u-icon name="question-circle" size="14" color="#999999"></u-icon>
  11. </view>
  12. <text class="asset-value">3,869,014</text>
  13. </view>
  14. <u-button class="view-btn" type="text" size="mini">查看财务报表</u-button>
  15. </view>
  16. <view class="data-cards">
  17. <view class="card-item">
  18. <text class="card-label">今日上传</text>
  19. <text class="card-value">12</text>
  20. </view>
  21. <view class="card-item">
  22. <text class="card-label">今日下架</text>
  23. <text class="card-value green">8</text>
  24. </view>
  25. <view class="card-item">
  26. <text class="card-label">商品总数</text>
  27. <text class="card-value">2</text>
  28. </view>
  29. </view>
  30. <view class="search-wrapper">
  31. <u-search placeholder="搜索编号、名称、品牌..." bg-color="#f9fafb" border-radius="4rpx"
  32. :show-action="false" class="search-input-wrap"></u-search>
  33. <view class="search-filter-btn">
  34. <u-icon name="list" size="22" color="#666666"></u-icon>
  35. </view>
  36. </view>
  37. <view class="category-tabs-wrap">
  38. <u-tabs :list="tabList" :is-scroll="true" active-color="#007aff" inactive-color="#666666" font-size="28rpx"
  39. border-bottom="none" @change="switchTab" class="u-tabs-custom"></u-tabs>
  40. </view>
  41. <view class="filter-bar">
  42. <view class="sort-btn">
  43. <text class="sort-text">{{ currentSortText }}</text>
  44. <u-icon name="arrow-down" size="12" color="#666666" class="sort-icon"></u-icon>
  45. </view>
  46. <view class="price-layout-btn">
  47. <view class="price-btn" type="text">
  48. <u-icon name="eye" size="18" color="#1890ff" class="price-icon"></u-icon>
  49. <text class="price-text">价格可见</text>
  50. </view>
  51. <view class="layout-btn" type="text" size="mini">
  52. <u-icon name="grid" size="20" color="#666666"></u-icon>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="goods-list">
  57. <view @click="handleToDetail" class="goods-item" v-for="(goods, goodsIndex) in goodsList" :key="`goods-${goodsIndex}`">
  58. <view class="goods-img-container">
  59. <image class="goods-img" :src="goods.imgUrl" mode="aspectFill" lazy-load></image>
  60. <view class="stock-indicator"
  61. v-if="goods.stock !== null && goods.stock !== undefined && goods.stock > 0"></view>
  62. </view>
  63. <view class="goods-info">
  64. <text class="goods-brand">{{ goods.brand || '' }}</text>
  65. <text class="goods-name">{{ goods.name || '' }}</text>
  66. <view class="price-group">
  67. <view class="price-items">
  68. <view class="price-item">
  69. <text class="price-type">成本价</text>
  70. <text class="price">¥{{ goods.costPrice }}</text>
  71. </view>
  72. <view class="price-item">
  73. <text class="price-type">销售价</text>
  74. <text class="price sales">¥{{ goods.salesPrice }}</text>
  75. </view>
  76. </view>
  77. <view class="price-items">
  78. <view class="price-item">
  79. <text class="price-type">同行价</text>
  80. <text class="price">¥{{ goods.peerPrice }}</text>
  81. </view>
  82. <view class="price-item">
  83. <text class="price-type">代理价</text>
  84. <text class="price">¥{{ goods.agentPrice }}</text>
  85. </view>
  86. </view>
  87. </view>
  88. <view class="others">
  89. <view class="other-item stock" >得</view>
  90. <view class="other-item">得</view>
  91. <view class="other-item">得</view>
  92. </view>
  93. </view>
  94. <view class="more">
  95. <u-icon name="more-dot-fill" size="16" color="#666666"></u-icon>
  96. <text class="goods-stock"
  97. v-if="goods.stock !== null && goods.stock !== undefined && goods.stock > 0">数量:{{ goods.stock
  98. }}</text>
  99. </view>
  100. </view>
  101. </view>
  102. </view>
  103. <!-- 添加按钮 -->
  104. <view class="add-button" @click="handleAdd">
  105. <u-icon name="plus" size="36" color="#ffffff"></u-icon>
  106. </view>
  107. </view>
  108. </template>
  109. <script>
  110. export default {
  111. data() {
  112. return {
  113. tabList: [
  114. { name: "全部" },
  115. { name: "腕表" },
  116. { name: "箱包" },
  117. { name: "珠宝" },
  118. { name: "鞋靴" },
  119. { name: "配饰" },
  120. { name: "服饰" },
  121. { name: "其它" }
  122. ],
  123. currentSortText: '按最近更新排序',
  124. goodsList: [
  125. {
  126. imgUrl: require("./imgs/1.jpg"),
  127. brand: "ROLEX",
  128. name: "Submariner Date 126610LN",
  129. costPrice: "92,500",
  130. salesPrice: "89,000",
  131. peerPrice: "92,500",
  132. agentPrice: "89,000",
  133. stock: 1
  134. },
  135. {
  136. imgUrl: require("./imgs/1.jpg"),
  137. brand: "ROLEX",
  138. name: "Submariner Date 126610LN",
  139. costPrice: "92,500",
  140. salesPrice: "89,000",
  141. peerPrice: "92,500",
  142. agentPrice: "89,000",
  143. stock: 1
  144. },
  145. {
  146. imgUrl: require("./imgs/1.jpg"),
  147. brand: "ROLEX",
  148. name: "Submariner Date 126610LN",
  149. costPrice: "92,500",
  150. salesPrice: "89,000",
  151. peerPrice: "92,500",
  152. agentPrice: "89,000",
  153. stock: 1
  154. },
  155. {
  156. imgUrl: require("./imgs/1.jpg"),
  157. brand: "ROLEX",
  158. name: "Submariner Date 126610LN",
  159. costPrice: "92,500",
  160. salesPrice: "89,000",
  161. peerPrice: "92,500",
  162. agentPrice: "89,000",
  163. stock: 1
  164. },
  165. {
  166. imgUrl: require("./imgs/1.jpg"),
  167. brand: "ROLEX",
  168. name: "Submariner Date 126610LN",
  169. costPrice: "92,500",
  170. salesPrice: "89,000",
  171. peerPrice: "92,500",
  172. agentPrice: "89,000",
  173. stock: 1
  174. }
  175. ]
  176. };
  177. },
  178. methods: {
  179. switchTab(index) {
  180. console.log("当前选中标签索引:", index);
  181. },
  182. handleToDetail() {
  183. uni.navigateTo({
  184. url: `/pages/wareHouse/detail`
  185. });
  186. },
  187. handleAdd() {
  188. console.log("点击添加按钮");
  189. uni.navigateTo({
  190. url: `/pages/wareHouse/add`
  191. });
  192. },
  193. }
  194. };
  195. </script>
  196. <style lang="scss" scoped>
  197. @import "./styles/index.scss";
  198. </style>