classify.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <!-- 管理分类 -->
  2. <template>
  3. <view class="classify">
  4. <Header :title="title" />
  5. <view class="addClass" @tap="addClass">
  6. <image src="../../static/images/addicon.png" class="addicon"></image>
  7. </view>
  8. <view style="height: 94upx;"></view>
  9. <view class="content">
  10. <view class="item-warp" v-for="item in lineList" :key="item.id">
  11. <view class="warp-top">
  12. <view class="bar"
  13. >分组名称:<text class="name">{{ item.name }}</text></view
  14. >
  15. <view class="bar"
  16. >分组标识:<text class="name">{{ item.code }}</text></view
  17. >
  18. <view class="bar"
  19. >一级分类:<text class="name">{{
  20. item.typeName ? item.typeName : 'none'
  21. }}</text></view
  22. >
  23. <view class="bar"
  24. >所属店铺:<text class="name">{{
  25. item.shopName ? item.shopName : 'none'
  26. }}</text></view
  27. >
  28. </view>
  29. <view class="warp-bottom">
  30. <view class="btn edtil" @tap="compile(item.id)">编辑</view>
  31. <view class="btn delet" @tap="delet(item.id)">删除</view>
  32. </view>
  33. </view>
  34. </view>
  35. <rf-loading v-if="loading"></rf-loading>
  36. </view>
  37. </template>
  38. <script>
  39. import Header from '../components/header';
  40. export default {
  41. name: 'classify',
  42. components: { Header },
  43. data() {
  44. //这里存放数据
  45. return {
  46. loading: true,
  47. title: '管理自定义分类',
  48. storeId: uni.getStorageSync('shopid'),
  49. lineList: [],
  50. gradeList: [],
  51. };
  52. },
  53. onLoad() {
  54. this.getCustomList();
  55. },
  56. //方法集合
  57. methods: {
  58. addClass() {
  59. this.$mRouter.push({ route: '/pages/shop/editclassify' });
  60. },
  61. // 自定义分类列表
  62. async getCustomList() {
  63. this.loading = true;
  64. await this.$http
  65. .get('/goods/getCustomGroupList', {
  66. shopId: this.storeId,
  67. })
  68. .then(async (res) => {
  69. if (res.code === 200) {
  70. this.lineList = res.data.customGroupList;
  71. this.loading = false;
  72. }
  73. });
  74. },
  75. // 编辑
  76. compile(id) {
  77. console.log(id);
  78. },
  79. // 删除
  80. delet(id) {
  81. console.log(id);
  82. },
  83. },
  84. };
  85. </script>
  86. <style lang='scss' scoped>
  87. .classify {
  88. .addClass {
  89. position: fixed;
  90. top: 24.5upx;
  91. right: 33upx;
  92. width: 48upx;
  93. height: 48upx;
  94. z-index: 100;
  95. .addicon {
  96. width: 48upx;
  97. height: 48upx;
  98. }
  99. }
  100. .content {
  101. width: 100%;
  102. padding: 24upx 32upx 100upx;
  103. .item-warp {
  104. width: 100%;
  105. padding: 28upx 31upx 0;
  106. border-radius: 10upx;
  107. background-color: #ffffff;
  108. .warp-top {
  109. padding-bottom: 30upx;
  110. border-bottom: 1px solid #e7e7e7;
  111. .bar {
  112. color: #7a7c7c;
  113. font-size: 28upx;
  114. margin-top: 10upx;
  115. &:first-child {
  116. margin-top: 0;
  117. }
  118. .name {
  119. color: #202020;
  120. margin-left: 5upx;
  121. }
  122. }
  123. }
  124. .warp-bottom {
  125. display: flex;
  126. padding: 17upx 0;
  127. .btn {
  128. width: 158upx;
  129. height: 58upx;
  130. text-align: center;
  131. line-height: 58upx;
  132. border: 1px solid #e2e2e2;
  133. color: #7a7c7c;
  134. margin-left: 275upx;
  135. }
  136. .delet {
  137. color: #ffffff;
  138. border: none;
  139. margin-left: 23upx;
  140. background-color: #ff6a5e;
  141. }
  142. }
  143. }
  144. }
  145. }
  146. </style>