productManagement.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <template>
  2. <view class="product-manger-wrapper">
  3. <headersVue headerTitle="商品管理" @headerJump="headerJump"></headersVue>
  4. <view class="product-manger-content">
  5. <view class="product-manger-content--top">
  6. <searchVue @search="search" class="search-box"></searchVue>
  7. <view class="btn-product" @click="onHandleAddProduct">
  8. <image
  9. src="/static/images/new_ui/tianjiachanpin.png"
  10. mode="scaleToFill"
  11. />
  12. <view class="txt">添加商品</view>
  13. </view>
  14. </view>
  15. <view class="product-manger-content--tab">
  16. <tabsVue :category="dataList" :currentActive="currentActive"/>
  17. </view>
  18. </view>
  19. <view class="product-manger-content--list">
  20. <view class="list-card" v-for="(item, index) in dataList" :key="index">
  21. <view class="list-card-top">
  22. <view class="list-card-top--left">
  23. <image
  24. src="/static/images/new_ui/tianjiachanpin.png"
  25. mode="scaleToFill"
  26. />
  27. </view>
  28. <view class="list-card-top--right">
  29. <view class="list-card-top--right-title">此处显示商品名称最多一行,显示不下此处显示商品名称最多一行,显示不下</view>
  30. <view class="list-card-top--right-description">
  31. <view class="list-card-top--right-description--left">
  32. <text class="title">销量</text>
  33. <text>5000</text>
  34. </view>
  35. <view class="list-card-top--right-description--right">
  36. <text class="title">库存</text>
  37. <text>5000</text>
  38. </view>
  39. </view>
  40. <view class="list-card-top--right-price">
  41. <view class="list-card-top--right-price--left">
  42. <text>¥</text>
  43. <text class="price">5000</text>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="list-card-bottom-btn">
  49. <view class="list-card-bottom-btn-list">
  50. <view class="list-card-bottom-btn-list--item">推荐</view>
  51. <view class="list-card-bottom-btn-list--item">驳回原因</view>
  52. <view class="list-card-bottom-btn-list--item">上架</view>
  53. <view class="list-card-bottom-btn-list--item">下架</view>
  54. <view class="list-card-bottom-btn-list--item">删除草稿</view>
  55. </view>
  56. </view>
  57. </view>
  58. <view
  59. class=""
  60. v-if="tihsi == 0"
  61. style="margin: 60rpx 0 30rpx 0; color: #999999; font-size: 26rpx"
  62. >
  63. —— 已经到最底部了哦 ——
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. import headersVue from "../components/headers/headers.vue";
  71. import searchVue from "./components/search/search.vue";
  72. import tabsVue from "./components/tablist.vue";
  73. //商品列表
  74. export default {
  75. components: {
  76. headersVue,
  77. searchVue,
  78. tabsVue,
  79. },
  80. methods: {
  81. onPullDownRefresh() {
  82. uni.showLoading({
  83. title: '加载中',
  84. });
  85. this.page = 1
  86. this.is_panudn = true
  87. this.list = []
  88. // this.orderList();
  89. },
  90. onReachBottom() {
  91. console.log('onReachBottom')
  92. // if (this.is_panudn == true) {
  93. // this.page++;
  94. // this.orderList();
  95. // } else {
  96. // return
  97. // }
  98. },
  99. headerJump() {
  100. uni.switchTab({ url: "/shop/productManagementModule/index" });
  101. },
  102. onHandleAddProduct() {
  103. uni.redirectTo({
  104. url: `./addProduct`,
  105. });
  106. },
  107. },
  108. onLoad(options) {
  109. this.currentActive = options.tabIndex || "0";
  110. },
  111. data() {
  112. return {
  113. currentActive:'0',
  114. tihsi: 0,
  115. dataList: [
  116. {
  117. type: 1,
  118. name: "出售中商品",
  119. count: 10,
  120. },
  121. {
  122. type: 2,
  123. name: "仓库中商品",
  124. count: 31,
  125. },
  126. {
  127. type: 3,
  128. name: "已售罄商品",
  129. count: 0,
  130. },
  131. {
  132. type: 4,
  133. name: "警戒库存",
  134. count: 0,
  135. },
  136. {
  137. type: 5,
  138. name: "回收站商品",
  139. count: 0,
  140. },
  141. {
  142. type: 6,
  143. name: "待审核商品",
  144. count: 0,
  145. },
  146. {
  147. type: 7,
  148. name: "审核未通过商品",
  149. count: 0,
  150. },
  151. ],
  152. };
  153. },
  154. };
  155. </script>
  156. <style>
  157. page {
  158. background-color: #f7f8fc;
  159. }
  160. </style>
  161. <style lang="scss" scoped>
  162. .product-manger-wrapper {
  163. // margin-top: 96rpx;
  164. .product-manger-content {
  165. background: #fff;
  166. position: fixed;
  167. top: 80rpx;
  168. width: 100%;
  169. z-index: 666;
  170. &--top {
  171. display: flex;
  172. .search-box {
  173. flex: 1;
  174. }
  175. .btn-product {
  176. user-select: none;
  177. width: 160rpx;
  178. flex-shrink: 0;
  179. display: flex;
  180. align-items: center;
  181. gap: 15rpx;
  182. image {
  183. width: 32rpx;
  184. height: 32rpx;
  185. }
  186. .txt {
  187. font-weight: 400;
  188. font-size: 26rpx;
  189. color: #666666;
  190. word-break: break-all;
  191. }
  192. }
  193. }
  194. }
  195. .product-manger-content--list {
  196. display: flex;
  197. flex-direction: column;
  198. align-items: center;
  199. width: calc(100% - 52rpx);
  200. // border: 2rpx solid #f00;
  201. margin: 328rpx 26rpx 26rpx;
  202. overflow: auto;
  203. .list-card {
  204. width: 100%;
  205. min-height: 274rpx;
  206. background: #ffffff;
  207. border-radius: 8rpx;
  208. margin-bottom: 26rpx;
  209. box-sizing: border-box;
  210. padding: 22rpx 20rpx 22rpx;
  211. .list-card-top {
  212. display: flex;
  213. gap: 20rpx;
  214. .list-card-top--left {
  215. width: 150rpx;
  216. height: 150rpx;
  217. flex-shrink: 0;
  218. border-radius: 7rpx;
  219. background: #d8d8d8;
  220. // text-align: center;
  221. image {
  222. width: 100%;
  223. height: 100%;
  224. border-radius: 7rpx;
  225. }
  226. }
  227. .list-card-top--right {
  228. flex: 1;
  229. .list-card-top--right-title {
  230. font-family: PingFangSC, PingFang SC;
  231. font-weight: 400;
  232. font-size: 26rpx;
  233. color: #333333;
  234. line-height: 37rpx;
  235. display: -webkit-box;
  236. -webkit-box-orient: vertical;
  237. -webkit-line-clamp: 1;
  238. overflow: hidden;
  239. }
  240. .list-card-top--right-description {
  241. font-family: PingFangSC, PingFang SC;
  242. font-weight: 400;
  243. font-size: 22rpx;
  244. color: #666666;
  245. line-height: 30rpx;
  246. word-break: break-all;
  247. display: flex;
  248. gap: 20rpx;
  249. justify-content: flex-start;
  250. padding: 13rpx 0 20rpx 0;
  251. }
  252. .list-card-top--right-description--left,
  253. .list-card-top--right-description--right {
  254. flex: 40%;
  255. .title {
  256. padding-right: 16rpx;
  257. }
  258. }
  259. .list-card-top--right-price {
  260. font-family: PingFangSC, PingFang SC;
  261. .list-card-top--right-price--left {
  262. word-break: break-all;
  263. .price {
  264. font-weight: 600;
  265. font-size: 36rpx;
  266. color: #333333;
  267. line-height: 38rpx;
  268. }
  269. }
  270. }
  271. }
  272. }
  273. .list-card-bottom-btn {
  274. padding-top: 30rpx;
  275. .list-card-bottom-btn-list {
  276. display: flex;
  277. justify-content: flex-end;
  278. align-items: center;
  279. flex-wrap: wrap;
  280. gap: 20rpx;
  281. user-select: none;
  282. .list-card-bottom-btn-list--item {
  283. display: flex;
  284. justify-content: center;
  285. align-items: center;
  286. width: 146rpx;
  287. height: 60rpx;
  288. border-radius: 8rpx;
  289. border: 1rpx solid #e5e5e5;
  290. font-weight: 400;
  291. font-size: 24rpx;
  292. color: #333333;
  293. }
  294. }
  295. }
  296. }
  297. }
  298. }
  299. </style>