123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- <template>
- <view class="container instrument">
- <view class="banner">
- <view class="banner-image">
- <image :src="banner" mode=""></image>
- </view>
- </view>
- <view class="instrument-list">
- <view class="list-item-cell" v-for="(item,index) in list" :key="index">
- <view class="list-item-title">
- <view class="title" :class="item.link ? 'float' : ''">
- <text>{{ item.title }}</text>
- </view>
- <view class="more" v-if="item.link" @click="details(item)">
- <text>查看更多</text>
- <text class="iconfont icon-xiangyou"></text>
- </view>
- </view>
- <view class="list-item-pros">
- <view class="item-pros" v-for="(pros,prosIndex) in item.floorData" :key="prosIndex" @click="details(pros)">
- <view class="item-pros-image">
- <image :src="pros.image" mode=""></image>
- </view>
- <view class="item-pros-name">{{ pros.title }}</view>
- </view>
- </view>
- </view>
- </view>
- <!-- 侧边 -->
- <scroll-top v-if="isScrollTop"></scroll-top>
- </view>
- </template>
- <script>
- export default{
- components:{
-
- },
- data(){
- return{
- banner:'',
- list:[],
- linkType:0,
- isScrollTop:false,
- linkTitle:''
- }
- },
- onLoad(option) {
- console.log(option)
- let _self = this
- this.linkType = option.linkId
- this.linkTitle = option.title
- uni.setNavigationBarTitle({title:_self.linkTitle});
- this.GetPageTopicInfo()
- },
- methods:{
- GetPageTopicInfo(){//获取数据
- this.ProductService.GetPageTopic({type:this.linkType}).then(response =>{
- let data = response.data
- this.list = data
- this.GetPageTopicBanner()
- }).catch(error =>{
- this.$util.msg(error.msg,2000)
- })
- },
- GetPageTopicBanner(){//获取banner
- this.ProductService.GetPageTopicBanner({type:this.linkType}).then(response =>{
- let data = response.data
- this.banner = data.image
- }).catch(error =>{
- this.$util.msg(error.msg,2000)
- })
- },
- details(floor){
- console.log(floor)
- switch(floor.linkType){
- case 1://二级页面
- this.$api.navigateTo(`/pages/goods/goods-instrument?linkId=${floor.linkParam.id}&title=${floor.title}`)
- break;
- case 2://搜索项目仪器
- this.$api.navigateTo(`/pages/search/search-instrument?linkId=${floor.linkParam.id}`)
- break;
- case 3://直播页面
- this.$api.navigateTo(``)
- break;
- case 4://自由页面
- this.$api.navigateTo(`/pages/goods/goods-instrument?linkId=${floor.linkParam.id}`)
- break;
- case 5://商品详情
- this.$api.navigateTo(`/pages/goods/product?id=${floor.linkParam.id}`)
- break;
- case 6://仪器项目详情
- this.$api.navigateTo(`/pages/goods/instrument-details?id=${floor.linkParam.id}`)
- break;
- case 7://供应商主页
- this.$api.navigateTo(`/supplier/pages/user/my-shop?shopId=${floor.linkParam.id}`)
- break;
- case 8://专题活动页
- this.$api.navigateTo(`/h5/pages/activity/activity-list`)
- break;
- case 9://二手市场介绍
- this.$api.navigateTo(`/second/pages/form/introduce`)
- break;
- case 10://二手商品列表
- this.$api.navigateTo(`/second/pages/product/product-list`)
- break;
- case 11://二手商品发布
- this.$api.navigateTo(`/second/pages/form/form`)
- break;
- case 12://商品搜索
- this.$api.navigateTo(`/pages/search/search?keyWord=${floor.title}`)
- break;
- case 13://信息详情
- this.$api.navigateTo(`/pages/goods/goods-instrument?linkId=${floor.linkParam.id}`)
- break;
- case 14://品牌招商介绍页
- this.$api.navigateTo(`/pages/goods/goods-instrument?linkId=${floor.linkParam.id}`)
- break;
- case 15://维修保养介绍页
- this.$api.navigateTo(`/pages/goods/goods-instrument?linkId=${floor.linkParam.id}`)
- break;
- case 16://首页
- this.$api.switchTabTo(`/pages/tabBar/home/index`)
- break;
- case 17://注册页
- this.$api.navigateTo(`/pages/login/register-select`)
- break;
- case 18://信息中心
- this.$api.navigateTo(`/pages/login/register-select`)
- break;
- case 19://供应商列表
- this.$api.navigateTo(`/pages/login/register-select`)
- break;
- }
- }
- },
- onPageScroll(e){//实时获取到滚动的值
- if(e.scrollTop>600){
- this.isScrollTop = true
- }else{
- this.isScrollTop = false
- }
- },
- onShow() {
- }
- }
- </script>
- <style lang="scss">
- page{
- background-color: #F7F7F7;
- }
- .instrument{
- width: 100%;
- height: auto;
- .banner{
- box-sizing: border-box;
- padding:24rpx;
- background-color: #FFFFFF;
- width: 100%;
- .banner-image{
- width: 100%;
- height: 248rpx;
- border-radius: 4rpx;
- }
- image{
- width: 100%;
- height: 248rpx;
- border-radius: 4rpx;
- }
- }
- .instrument-list{
- width: 100%;
- height: auto;
- box-sizing: border-box;
- padding: 0 24rpx;
- .list-item-cell{
- width: 100%;
- height: auto;
- float: left;
- .list-item-title{
- width: 100%;
- height: 88rpx;
- line-height: 88rpx;
- float: left;
- .title{
- font-size: $font-size-28;
- line-height: 80rpx;
- color: $text-color;
- font-weight: bold;
- &.float{
- float: left;
- }
- }
- .more{
- font-size: $font-size-26;
- line-height: 80rpx;
- color: #999999;
- height: 80rpx;
- float: right;
- .icon-xiangyou{
- font-size: $font-size-28;
- margin-left: 10rpx;
- }
- }
- }
- .list-item-pros{
- width: 100%;
- height: auto;
- float: left;
- .item-pros{
- width: 340rpx;
- height: 414rpx;
- float: left;
- margin-right: 20rpx;
- margin-bottom: 20rpx;
- background-color: #FFFFFF;
- border-radius: 4rpx;
- &:nth-child(2n){
- margin-right: 0;
- }
- .item-pros-image{
- width: 340rpx;
- height: 340rpx;
- float: left;
- image{
- width: 340rpx;
- height: 340rpx;
- display: block;
- border-radius: 4rpx 4rpx 0 0;
- }
- }
- .item-pros-name{
- width: 100%;
- height: 74rpx;
- line-height: 74rpx;
- box-sizing: border-box;
- padding: 0 24rpx;
- white-space: normal;
- word-break: break-all;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 1;
- text-align: center;
- font-size: $font-size-26;
- line-height: 74rpx;
- text-align: center;
- }
- }
- }
- }
- }
- }
- </style>
|