quickOperation.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <!-- 快捷运营 -->
  3. <view class="quick-oprea">
  4. <swiper class="swiper" :autoplay="false" @change="swiperChange" :circular="true">
  5. <swiper-item v-for="(item, index) in footList" :key="index" class="swiper-item">
  6. <view class="content" v-for="(i, o) in item" :key="i" @click="NavToDetailPage(i)">
  7. <view class="list">
  8. <div class="list-icon">
  9. <image :src="i.icon" style="width: 100%;height: 100%;" mode=""></image>
  10. </div>
  11. <div class="list-title">
  12. <div class="title-1">
  13. <div class="title-1-item">
  14. <view style="display: inline-block;">{{ i.name }}</view>
  15. <text class="title-2-item">GO></text>
  16. </div>
  17. </div>
  18. <div class="title-2">{{i.remark || ''}}</div>
  19. </div>
  20. </view>
  21. </view>
  22. </swiper-item>
  23. </swiper>
  24. <view class="swiper__dots-box">
  25. <view
  26. v-for="(item, idx) in footList"
  27. :key="idx"
  28. :class="[idx === current ? 'swiper__dots-long' : 'none']"
  29. :data-index="current"
  30. class="swiper__dots-item"
  31. ></view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import cmsMixins from '@/mixins/cmsMixins.js'
  37. import { mapState } from 'vuex'
  38. export default {
  39. mixins: [cmsMixins],
  40. props: {
  41. list: {
  42. type: Array,
  43. default: () => []
  44. }
  45. },
  46. data() {
  47. return {
  48. current: 0 // 切换轮播
  49. }
  50. },
  51. computed: {
  52. ...mapState(['hasLogin']),
  53. // 快捷运营列表
  54. footList() {
  55. let newArr = [],
  56. a = []
  57. this.list.map((item, index) => {
  58. if (index !== 0 && index % 4 === 0) {
  59. newArr.push(a)
  60. a = []
  61. a.push(item)
  62. } else a.push(item)
  63. if (this.list.length === index + 1) {
  64. newArr.push(a)
  65. }
  66. })
  67. return newArr
  68. }
  69. },
  70. watch: {},
  71. mounted() {},
  72. methods: {
  73. // 链接跳转
  74. NavToDetailPage(pros) {
  75. this.$api.FlooryNavigateTo(pros)
  76. },
  77. swiperChange(e) {
  78. //轮播图切换
  79. this.current = e.detail.current
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .quick-oprea {
  86. background-color: #f7f7f7;
  87. padding: 20rpx;
  88. position: relative;
  89. height: 400rpx;
  90. .swiper__dots-box {
  91. position: absolute;
  92. left: 0;
  93. right: 0;
  94. bottom: 32rpx;
  95. display: flex;
  96. flex: 1;
  97. flex-direction: row;
  98. justify-content: center;
  99. align-items: center;
  100. .swiper__dots-item {
  101. width: 14rpx;
  102. height: 5rpx;
  103. border-radius: 100%;
  104. margin-left: 6px;
  105. background-color: #e15621;
  106. opacity: 0.2;
  107. }
  108. .swiper__dots-long {
  109. width: 26rpx;
  110. height: 5rpx;
  111. border-radius: 4rpx;
  112. background-color: #e15621;
  113. transition: all 0.4s;
  114. opacity: 1;
  115. }
  116. }
  117. }
  118. .swiper {
  119. height: 340rpx;
  120. .swiper-item {
  121. display: grid;
  122. grid-template-columns: repeat(2, 1fr);
  123. grid-template-rows: repeat(2, 1fr);
  124. grid-gap: 18rpx;
  125. .content {
  126. box-sizing: border-box;
  127. border-radius: 16rpx;
  128. background-color: #fff;
  129. display: flex;
  130. align-items: center;
  131. background: linear-gradient(180deg, #FFF1EB 0%, #FFFFFF 100%);
  132. .list {
  133. width: 100%;
  134. display: flex;
  135. height: 80rpx;
  136. .list-icon {
  137. width: 80rpx;
  138. height: 100%;
  139. border-radius: 50%;
  140. margin-left: 24rpx;
  141. overflow: hidden;
  142. }
  143. .list-title {
  144. margin-left: 16rpx;
  145. display: flex;
  146. flex-direction: column;
  147. justify-content: space-between;
  148. .title-1 {
  149. .title-1-item {
  150. color: #333333;
  151. font-size: 28rpx;
  152. width: 222rpx;
  153. display: flex;
  154. align-items: center;
  155. .title-2-item {
  156. width: 62rpx;
  157. height: 32rpx;
  158. background: #ff5b00;
  159. border-radius: 14rpx;
  160. font-size: 22rpx;
  161. text-align: center;
  162. height: 32rpx;
  163. color: white;
  164. margin-left: 6rpx;
  165. }
  166. }
  167. }
  168. .title-2 {
  169. color: #999999;
  170. font-size: 22rpx;
  171. }
  172. }
  173. }
  174. }
  175. }
  176. }
  177. </style>