goodsCatList.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view class="container">
  3. <view class="list">
  4. <view @click="nav(index,item.id)" class="item" v-for="(item,index) in list" :key="index">
  5. <view class="name">{{item.name}}</view>
  6. <view class="content flex flex-y-center">
  7. <view class="cell flex flex-y-center arr-r">
  8. <view class="title">添加时间:</view>
  9. <view class="desc text-1">{{item.create_time}}</view>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="no-more">没有更多内容了~</view>
  14. </view>
  15. <view class="footer-bar">
  16. <view class="content flex flex-center">
  17. <navigator url="./editGoodsCat" class="btn">+新增分类</navigator>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. list: [],
  27. }
  28. },
  29. onLoad(e) {
  30. },
  31. onShow() {
  32. this.cygoods_category_index();
  33. },
  34. methods: {
  35. nav(index,id) {
  36. let obj = this.list[index];
  37. uni.setStorageSync("category_info", obj);
  38. uni.navigateTo({
  39. url: `./goodsCatDetail?id=${id}`
  40. })
  41. },
  42. cygoods_category_index(e) {
  43. this.request({
  44. url: "Smdcshop/jftype_index",
  45. data: {
  46. admin_id: uni.getStorageSync("admin_id")
  47. },
  48. }).then(res => {
  49. console.log(res, "res")
  50. if (res.code === '200') {
  51. this.list = res.data;
  52. }
  53. });
  54. },
  55. },
  56. }
  57. </script>
  58. <style>
  59. @import url("../static/css/common.css");
  60. page {
  61. background-color: #F4F5F7;
  62. }
  63. .list {
  64. padding: 30rpx 25rpx;
  65. }
  66. .list .item {
  67. border-radius: 8rpx;
  68. overflow: hidden;
  69. padding-left: 30rpx;
  70. border-left: 8rpx solid #247EFF;
  71. background-color: #fff;
  72. margin-bottom: 30rpx;
  73. }
  74. .list .item .name {
  75. height: 80rpx;
  76. border-bottom: 1rpx solid #f5f5f5;
  77. font-size: 30rpx;
  78. line-height: 80rpx;
  79. font-weight: bold;
  80. }
  81. .list .item .content {
  82. padding: 20rpx 0 24rpx;
  83. }
  84. .list .item .content .cell {
  85. flex: none;
  86. width: 100%;
  87. box-sizing: border-box;
  88. padding-right: 30rpx;
  89. font-size: 26rpx;
  90. line-height: 37rpx;
  91. color: #666;
  92. }
  93. .list .item .content .cell .title {
  94. color: #99A0AD;
  95. flex: none;
  96. }
  97. </style>