You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

269 lines
5.6 KiB

<template>
2 years ago
<view :class="['page', {oh: !per}]">
<uni-search-bar class="search" radius="30" placeholder="请输入" v-model="keyword" clearButton="auto" cancelButton="none" />
<view class="banner">
<image class="img" src="@/static/image/workbench/index1.png" mode="widthFix"></image>
<view class="info">
<view class="title">城市合伙人招募中</view>
2 years ago
<view class="text">携手共创教育信息化新未来合伙共享产业互联领域新红利</view>
</view>
</view>
<view class="block">
<view class="title-wrap">
<view class="title">热门标签</view>
</view>
<ul class="tags">
<li v-for="(tag, i) in tags" :key="i" @click="$util.to('/order/productDetail/productDetail?id=' + item.mallId)">
<image class="icon" :src="require('@/static/image/index/' + (i + 1) + '.png')"></image>
<view class="text ell">{{ tag.tagsName }}</view>
</li>
</ul>
</view>
<view class="block">
<view class="title-wrap">
<view class="title">热销产品</view>
<view class="all">全部产品</view>
3 years ago
</view>
<view class="list">
<view v-for="(item, i) in hotProducts" :key="i" class="item" @click="toDetail(item)">
<image class="pic" :src="item.appletIcon"></image>
<view class="texts">
<view class="name ell">{{ item.productName }}</view>
<view class="des ell" v-html="item.productIntroduction"></view>
<view class="meta">
<image class="icon" src="@/static/image/index/9.png"></image>
适用专业:
<text class="ell">{{ item.professionalName }}</text>
</view>
3 years ago
</view>
</view>
</view>
</view>
<view class="block">
<view class="title-wrap">
<view class="title">官方推荐</view>
<view class="all">全部产品</view>
3 years ago
</view>
<view class="list">
<view v-for="(item, i) in offcialProducts" :key="i" class="item" @click="toDetail(item)">
<image class="pic" :src="item.appletIcon || require('@/static/image/product.png')"></image>
<view class="texts">
<view class="name ell">{{ item.productName }}</view>
<view class="des ell" v-html="item.productIntroduction"></view>
<view class="meta">
<image class="icon" src="@/static/image/index/9.png"></image>
适用专业:
<text class="ell">{{ item.professionalName }}</text>
</view>
3 years ago
</view>
</view>
</view>
</view>
2 years ago
<view v-if="!per" class="per-mask">功能升级中敬请期待...</view>
</view>
</template>
<script>
import { tagsList, listOfGoods } from '@/apis/modules/product.js'
export default {
data() {
return {
2 years ago
per: true, // 是否有权限
2 years ago
teamId: uni.getStorageSync('teamId') || '',
keyword: '',
tags: [],
hotProducts: [],
offcialProducts: []
}
},
watch: {
keyword () {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initList()
}, 500)
}
},
onShow() {
2 years ago
this.per = true
this.getTags()
this.getProducts()
},
methods: {
2 years ago
// 初始化权限
initRole() {
if (!uni.getStorageSync('auth').includes('首页')) {
this.per = false
}
2 years ago
this.getStudy()
this.getSell()
2 years ago
this.getAnalysis()
2 years ago
},
// 热门标签
getTags() {
tagsList().then(res => {
this.tags = res.tagsList.slice(0, 8)
}).catch(e => {})
},
// 产品
getProducts() {
// 热销产品
listOfGoods({
pageNum: 1,
pageSize: 5,
sort: 1,
isShelves: 0,
hotTag: 1
}).then(({ page }) => {
this.hotProducts = page.records
}).catch(e => {})
// 官方推荐
listOfGoods({
2 years ago
pageNum: 1,
pageSize: 5,
sort: 0,
isShelves: 0,
hotTag: 1,
selection: 1
2 years ago
}).then(({ page }) => {
this.offcialProducts = page.records
2 years ago
}).catch(e => {})
},
2 years ago
// 跳转学习
toStudy() {
uni.switchTab({
url: '/pages/study/study'
})
},
2 years ago
// 跳转学习详情
toDetail(item) {
this.$util.to('/order/productDetail/productDetail?id=' + item.mallId)
3 years ago
},
}
}
</script>
<style scoped lang="scss">
.page {
3 years ago
position: relative;
min-height: 100%;
padding: 30rpx 22rpx;
2 years ago
box-sizing: border-box;
background-color: #fff;
}
.banner {
position: relative;
.img {
width: 100%;
}
.info {
position: absolute;
top: 80rpx;
left: 46rpx;
}
.title {
margin-bottom: 15rpx;
font-size: 36rpx;
font-weight: 600;
color: #001D67;
}
.text {
font-size: 20rpx;
font-family: PingFangSC-Regular, PingFang SC;
color: #001D67;
}
}
.block {
margin: 40rpx 0;
.title-wrap {
3 years ago
display: flex;
justify-content: space-between;
margin-bottom: 34rpx;
.all {
font-size: 24rpx;
color: #666;
}
3 years ago
}
.title {
display: inline-flex;
3 years ago
align-items: center;
font-size: 28rpx;
color: #333;
&:before {
content: '';
width: 10rpx;
height: 26rpx;
margin-right: 14rpx;
background: #007FFF;
border-radius: 5px;
3 years ago
}
}
}
.tags {
display: flex;
flex-wrap: wrap;
li {
width: 25%;
margin-bottom: 24rpx;
text-align: center;
}
3 years ago
.icon {
width: 64rpx;
height: 64rpx;
margin-bottom: 18rpx;
3 years ago
}
.text {
width: 110rpx;
margin: 0 auto;
font-size: 24rpx;
color: #333;
3 years ago
}
}
.list {
.item {
display: flex;
margin-bottom: 28rpx;
3 years ago
}
.pic {
width: 136rpx;
height: 136rpx;
margin-right: 20rpx;
3 years ago
}
.texts {
width: calc(100% - 156rpx);
3 years ago
}
.name {
font-size: 28rpx;
color: #333;
3 years ago
}
.des {
margin: 17rpx 0;
font-size: 24rpx;
color: #666;
3 years ago
}
.meta {
display: flex;
align-items: center;
font-size: 24rpx;
color: #2E2D31;
.icon {
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
2 years ago
}
text {
width: 330rpx;
2 years ago
}
}
2 years ago
}
</style>