123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- <template>
- <!-- 快捷运营 -->
- <view class="quick-oprea">
- <swiper class="swiper" :autoplay="false" @change="swiperChange" :circular="true">
- <swiper-item v-for="(item, index) in footList" :key="index" class="swiper-item">
- <view class="content" v-for="(i, o) in item" :key="i" @click="NavToDetailPage(i)">
- <view class="list">
- <div class="list-icon">
- <image :src="i.icon" style="width: 100%;height: 100%;" mode=""></image>
- </div>
- <div class="list-title">
- <div class="title-1">
- <div class="title-1-item">
- <view style="display: inline-block;">{{ i.name }}</view>
- <text class="title-2-item">GO></text>
- </div>
- </div>
- <div class="title-2">{{i.remark || ''}}</div>
- </div>
- </view>
- </view>
- </swiper-item>
- </swiper>
- <view class="swiper__dots-box">
- <view
- v-for="(item, idx) in footList"
- :key="idx"
- :class="[idx === current ? 'swiper__dots-long' : 'none']"
- :data-index="current"
- class="swiper__dots-item"
- ></view>
- </view>
- </view>
- </template>
- <script>
- import cmsMixins from '@/mixins/cmsMixins.js'
- import { mapState } from 'vuex'
- export default {
- mixins: [cmsMixins],
- props: {
- list: {
- type: Array,
- default: () => []
- }
- },
- data() {
- return {
- current: 0 // 切换轮播
- }
- },
- computed: {
- ...mapState(['hasLogin']),
- // 快捷运营列表
- footList() {
- let newArr = [],
- a = []
- this.list.map((item, index) => {
- if (index !== 0 && index % 4 === 0) {
- newArr.push(a)
- a = []
- a.push(item)
- } else a.push(item)
- if (this.list.length === index + 1) {
- newArr.push(a)
- }
- })
- return newArr
- }
- },
- watch: {},
- mounted() {
- console.log('this.footList', this.footList)
- },
- methods: {
- // 链接跳转
- NavToDetailPage(pros) {
- if (!this.hasLogin) return this.$api.navigateTo('/pages/login/login')
- /**
- * 页面跳转类型
- * 1、二级页面,2、搜索项目仪器,3、直播页面,4、自由页面,5、商品详情,6、仪器项目详情,7、供应商主页
- * 8、专题活动页,9、二手市场介绍,10、二手商品列表,11、二手商品发布,12、商品搜索,13、信息详情
- * 14、品牌招商介绍页,15、维修保养介绍页,16、首页,17、注册页,18、信息中心,19、供应商列表
- * 23、新活动专题页面
- **/
- if (pros.linkType) {
- const typeMap = {
- 1: `/pages/goods/goods-instrument?linkId=${pros.linkParam.id}&title=${pros.name}`,
- 3: '/pages/h5/article/path-live',
- 4: '/pages/h5/other/brands',
- 10: '/pages/second/product/product-list',
- 14: '/pages/h5/other/brand',
- 15: '/pages/h5/other/repair',
- 18: `/pages/h5/article/path?link=${pros.link}`,
- 20: `/pages/goods/good-floor?linkId=${pros.linkParam.id}&title=${pros.name}`,
- 21: '/pages/h5/activity/meobohui',
- 22: `/pages/goods/good-floor-temp?linkId=${pros.linkParam.id}&title=${pros.name}`,
- 23: `/pages/h5/activity/activity-topic?linkId=${pros.linkParam.id}`, //活动专题页面
- 25: '/pages/goods/goods-doc-list', //美业资料
- 28: `/pages/h5/article/path?link=${pros.link}`, // 采美认证通
- 29: '/pages/user/coupon/coupon-collection', //领券中心
- 30: `/pages/h5/activity/quick-operation?linkId=${pros.linkParam.id}`, // 快捷运营入口
- }
- const url = typeMap[pros.linkType]
- console.log(url)
- this.$api.navigateTo(url)
- }
- },
- swiperChange(e) {
- //轮播图切换
- this.current = e.detail.current
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .quick-oprea {
- background-color: #f7f7f7;
- padding: 20rpx;
- position: relative;
- height: 400rpx;
- .swiper__dots-box {
- position: absolute;
- left: 0;
- right: 0;
- bottom: 32rpx;
- display: flex;
- flex: 1;
- flex-direction: row;
- justify-content: center;
- align-items: center;
- .swiper__dots-item {
- width: 14rpx;
- height: 5rpx;
- border-radius: 100%;
- margin-left: 6px;
- background-color: #e15621;
- opacity: 0.2;
- }
- .swiper__dots-long {
- width: 26rpx;
- height: 5rpx;
- border-radius: 4rpx;
- background-color: #e15621;
- transition: all 0.4s;
- opacity: 1;
- }
- }
- }
- .swiper {
- height: 340rpx;
- .swiper-item {
- display: grid;
- grid-template-columns: repeat(2, 1fr);
- grid-template-rows: repeat(2, 1fr);
- grid-gap: 18rpx;
- .content {
- box-sizing: border-box;
- border-radius: 16rpx;
- background-color: #fff;
- display: flex;
- align-items: center;
- background: linear-gradient(180deg, #FFF1EB 0%, #FFFFFF 100%);
- .list {
- width: 100%;
- display: flex;
- height: 80rpx;
- .list-icon {
- width: 80rpx;
- height: 100%;
- border-radius: 50%;
- margin-left: 24rpx;
- overflow: hidden;
- }
- .list-title {
- margin-left: 16rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .title-1 {
- .title-1-item {
- color: #333333;
- font-size: 28rpx;
- width: 222rpx;
- display: flex;
- align-items: center;
- .title-2-item {
- width: 62rpx;
- height: 32rpx;
- background: #ff5b00;
- border-radius: 14rpx;
- font-size: 22rpx;
- text-align: center;
- height: 32rpx;
- color: white;
- margin-left: 6rpx;
- }
- }
- }
- .title-2 {
- color: #999999;
- font-size: 22rpx;
- }
- }
- }
- }
- }
- }
- </style>
|