poster.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view>
  3. <public-module></public-module>
  4. <view class="" style="position: fixed;width: 100%;z-index: 99;">
  5. <u-tabs :is-scroll="false" :list="list" :current="current" @change="change"></u-tabs>
  6. </view>
  7. <view class="" style="padding-top: 100rpx;box-sizing: border-box;">
  8. <view v-if="current==0" class="order">
  9. <view class="order1" v-for="(item,index) in list1" :key="index" @click="queryImg(item.url)">
  10. <image :src="item.url" mode=""></image>
  11. <text>{{item.originalfilename}}</text>
  12. </view>
  13. </view>
  14. <view v-if="current==1" class="order">
  15. <view class="order1" v-for="(item,index) in list2" :key="index" @click="queryImg(item.url)">
  16. <image :src="item.url" mode=""></image>
  17. <text>{{item.originalfilename}}</text>
  18. </view>
  19. </view>
  20. <view v-if="current==2" class="order">
  21. <view class="order1" v-for="(item,index) in list3" :key="index" @click="queryImg(item.url)">
  22. <image :src="item.url" mode=""></image>
  23. <text>{{item.originalfilename}}</text>
  24. </view>
  25. </view>
  26. <view v-if="current==3" class="order">
  27. <view class="order1" v-for="(item,index) in list4" :key="index" @click="queryImg(item.url)">
  28. <image :src="item.url" mode=""></image>
  29. <text>{{item.originalfilename}}</text>
  30. </view>
  31. </view>
  32. <view v-if="current==4" class="order">
  33. <view class="order1" v-for="(item,index) in list5" :key="index" @click="queryImg(item.url)">
  34. <image :src="item.url" mode=""></image>
  35. <text>{{item.originalfilename}}</text>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. list: [{
  46. name: '保险'
  47. }, {
  48. name: '产品',
  49. }, {
  50. name: '节气'
  51. }, {
  52. name: '节日'
  53. }, {
  54. name: '增员',
  55. }],
  56. current: 0,
  57. dirId1: "P0001",
  58. dirId2: "P0002",
  59. dirId3: "P0003",
  60. dirId4: "P0004",
  61. dirId5: "P0005",
  62. dirId6: "P0006",
  63. list1: [],
  64. list2: [],
  65. list3: [],
  66. list4: [],
  67. list5: [],
  68. list6: [],
  69. }
  70. },
  71. async onLoad() {
  72. let res1 = await this.$http.post('/sysPoster/posterListApp', {
  73. type: 'P0002'
  74. });
  75. res1.data.content.forEach(ele => {
  76. ele.url = this.$base.baseUrl + ele.url
  77. });
  78. this.list1 = res1.data.content;
  79. let res2 = await this.$http.post('/sysPoster/posterListApp', {
  80. type: 'P0003'
  81. });
  82. res2.data.content.forEach(ele => {
  83. ele.url = this.$base.baseUrl + ele.url
  84. });
  85. this.list2 = res2.data.content;
  86. let res3 = await this.$http.post('/sysPoster/posterListApp', {
  87. type: 'P0004'
  88. });
  89. res3.data.content.forEach(ele => {
  90. ele.url = this.$base.baseUrl + ele.url
  91. });
  92. this.list3 = res3.data.content;
  93. let res4 = await this.$http.post('/sysPoster/posterListApp', {
  94. type: 'P0005'
  95. });
  96. res4.data.content.forEach(ele => {
  97. ele.url = this.$base.baseUrl + ele.url
  98. });
  99. this.list4 = res4.data.content;
  100. let res5 = await this.$http.post('/sysPoster/posterListApp', {
  101. type: 'P0006'
  102. });
  103. res5.data.content.forEach(ele => {
  104. ele.url = this.$base.baseUrl + ele.url
  105. });
  106. this.list5 = res5.data.content;
  107. },
  108. methods: {
  109. change(index) {
  110. console.log(index)
  111. this.current = index;
  112. },
  113. queryImg(img) {
  114. uni.navigateTo({
  115. url: '/pages/tools/poster/poster-detail?img=' + img
  116. })
  117. }
  118. }
  119. }
  120. </script>
  121. <style>
  122. .tabs {
  123. border-bottom: 2rpx solid #F0EFF4;
  124. position: fixed;
  125. z-index: 999;
  126. }
  127. .order {
  128. width: 100%;
  129. height: auto;
  130. padding: 26rpx;
  131. box-sizing: border-box;
  132. display: flex;
  133. justify-content: space-between;
  134. flex-wrap: wrap;
  135. }
  136. .order1 {
  137. width: 48%;
  138. text-align: center;
  139. margin-bottom: 20px;
  140. }
  141. .order1>text {
  142. font-weight: bold;
  143. }
  144. image {
  145. width: 100%;
  146. height: 600rpx;
  147. border-radius: 20rpx;
  148. }
  149. </style>