t-i-common.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="content" v-if="list.length > 0">
  3. <view class="title">
  4. <view class="text">我的常用</view>
  5. <view class="bars" @click="go_bars()">
  6. <uni-icons type="bars" color="#999" size="18"></uni-icons>
  7. </view>
  8. </view>
  9. <view class="list">
  10. <view class="item" v-for="(item,index) in list" :key="index" @click="go_record(item.page_id)">
  11. <view class="icon">
  12. <image v-if="index%7 == 1" src="./icon/01.png" mode=""></image>
  13. <image v-if="index%7 == 2" src="./icon/02.png" mode=""></image>
  14. <image v-if="index%7 == 3" src="./icon/03.png" mode=""></image>
  15. <image v-if="index%7 == 4" src="./icon/04.png" mode=""></image>
  16. <image v-if="index%7 == 5" src="./icon/05.png" mode=""></image>
  17. <image v-if="index%7 == 6" src="./icon/06.png" mode=""></image>
  18. <image v-if="index%7 == 7" src="./icon/07.png" mode=""></image>
  19. <image v-if="index%7 == 0" src="./icon/08.png" mode=""></image>
  20. </view>
  21. <view class="name">{{item.page_name}}</view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. name: "t-i-common",
  29. data() {
  30. return {
  31. list: []
  32. };
  33. },
  34. created() {
  35. this.get_link()
  36. },
  37. methods: {
  38. go_bars() {
  39. uni.navigateTo({
  40. url: "../../index/bars_sort/bars_sort"
  41. })
  42. },
  43. get_link() {
  44. this.$api.getCommonMenuList({
  45. }).then((res) => {
  46. // console.log(res.data)
  47. this.list = res.data.data
  48. })
  49. },
  50. go_record(pageId){
  51. uni.navigateTo({
  52. url:"../../index/record/record?pageId=" + pageId + "&mine_code=" + uni.getStorageSync('mine_code')
  53. })
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss">
  59. .content {
  60. margin-bottom: 30rpx;
  61. background-color: #FFFFFF;
  62. box-sizing: border-box;
  63. padding: 50rpx 25rpx;
  64. }
  65. .title {
  66. display: flex;
  67. align-items: baseline;
  68. justify-content: space-between;
  69. .text {
  70. font-size: 36rpx;
  71. }
  72. .bars {
  73. width: 100rpx;
  74. text-align: right;
  75. }
  76. }
  77. .list {
  78. width: 700rpx;
  79. overflow: hidden;
  80. .item {
  81. margin-top: 30rpx;
  82. display: flex;
  83. align-items: center;
  84. height: 90rpx;
  85. .icon {
  86. width: 40rpx;
  87. margin-right: 30rpx;
  88. image {
  89. display: block;
  90. width: 40rpx;
  91. height: 40rpx;
  92. }
  93. }
  94. .name {
  95. width: 620rpx;
  96. line-height: 90rpx;
  97. font-size: 28rpx;
  98. border-bottom: 1rpx solid #DBDBDB;
  99. }
  100. }
  101. }
  102. </style>