quickOperation.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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. console.log('this.footList', this.footList)
  73. },
  74. methods: {
  75. // 链接跳转
  76. NavToDetailPage(pros) {
  77. // if (!this.hasLogin) return this.$api.navigateTo('/pages/login/login')
  78. /**
  79. * 页面跳转类型
  80. * 1、二级页面,2、搜索项目仪器,3、直播页面,4、自由页面,5、商品详情,6、仪器项目详情,7、供应商主页
  81. * 8、专题活动页,9、二手市场介绍,10、二手商品列表,11、二手商品发布,12、商品搜索,13、信息详情
  82. * 14、品牌招商介绍页,15、维修保养介绍页,16、首页,17、注册页,18、信息中心,19、供应商列表
  83. * 23、新活动专题页面
  84. **/
  85. if (pros.linkType) {
  86. const typeMap = {
  87. 1: `/pages/goods/goods-instrument?linkId=${pros.linkParam.id}&title=${pros.name}`,
  88. 3: '/pages/h5/article/path-live',
  89. 4: '/pages/h5/other/brands',
  90. 10: '/pages/second/product/product-list',
  91. 14: '/pages/h5/other/brand',
  92. 15: '/pages/h5/other/repair',
  93. 18: `/pages/h5/article/path?link=${pros.link}`,
  94. 20: `/pages/goods/good-floor?linkId=${pros.linkParam.id}&title=${pros.name}`,
  95. 21: '/pages/h5/activity/meobohui',
  96. 22: `/pages/goods/good-floor-temp?linkId=${pros.linkParam.id}&title=${pros.name}`,
  97. 23: `/pages/h5/activity/activity-topic?linkId=${pros.linkParam.id}`, //活动专题页面
  98. 25: '/pages/goods/goods-doc-list', //美业资料
  99. 28: `/pages/h5/article/path?link=${pros.link}`, // 采美认证通
  100. 29: '/pages/user/coupon/coupon-collection', //领券中心
  101. 30: `/pages/h5/activity/quick-operation?linkId=${pros.linkParam.id}`, // 快捷运营入口
  102. }
  103. const url = typeMap[pros.linkType]
  104. console.log(url)
  105. this.$api.navigateTo(url)
  106. }
  107. },
  108. swiperChange(e) {
  109. //轮播图切换
  110. this.current = e.detail.current
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. .quick-oprea {
  117. background-color: #f7f7f7;
  118. padding: 20rpx;
  119. position: relative;
  120. height: 400rpx;
  121. .swiper__dots-box {
  122. position: absolute;
  123. left: 0;
  124. right: 0;
  125. bottom: 32rpx;
  126. display: flex;
  127. flex: 1;
  128. flex-direction: row;
  129. justify-content: center;
  130. align-items: center;
  131. .swiper__dots-item {
  132. width: 14rpx;
  133. height: 5rpx;
  134. border-radius: 100%;
  135. margin-left: 6px;
  136. background-color: #e15621;
  137. opacity: 0.2;
  138. }
  139. .swiper__dots-long {
  140. width: 26rpx;
  141. height: 5rpx;
  142. border-radius: 4rpx;
  143. background-color: #e15621;
  144. transition: all 0.4s;
  145. opacity: 1;
  146. }
  147. }
  148. }
  149. .swiper {
  150. height: 340rpx;
  151. .swiper-item {
  152. display: grid;
  153. grid-template-columns: repeat(2, 1fr);
  154. grid-template-rows: repeat(2, 1fr);
  155. grid-gap: 18rpx;
  156. .content {
  157. box-sizing: border-box;
  158. border-radius: 16rpx;
  159. background-color: #fff;
  160. display: flex;
  161. align-items: center;
  162. background: linear-gradient(180deg, #FFF1EB 0%, #FFFFFF 100%);
  163. .list {
  164. width: 100%;
  165. display: flex;
  166. height: 80rpx;
  167. .list-icon {
  168. width: 80rpx;
  169. height: 100%;
  170. border-radius: 50%;
  171. margin-left: 24rpx;
  172. overflow: hidden;
  173. }
  174. .list-title {
  175. margin-left: 16rpx;
  176. display: flex;
  177. flex-direction: column;
  178. justify-content: space-between;
  179. .title-1 {
  180. .title-1-item {
  181. color: #333333;
  182. font-size: 28rpx;
  183. width: 222rpx;
  184. display: flex;
  185. align-items: center;
  186. .title-2-item {
  187. width: 62rpx;
  188. height: 32rpx;
  189. background: #ff5b00;
  190. border-radius: 14rpx;
  191. font-size: 22rpx;
  192. text-align: center;
  193. height: 32rpx;
  194. color: white;
  195. margin-left: 6rpx;
  196. }
  197. }
  198. }
  199. .title-2 {
  200. color: #999999;
  201. font-size: 22rpx;
  202. }
  203. }
  204. }
  205. }
  206. }
  207. }
  208. </style>