幼教产品B2B生态平台小程序端
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.

217 lines
4.5 KiB

12 months ago
<template>
<view :class="[{oh: !per}]">
<view class="page">
<view class="search-wrap">
<uni-search-bar class="search" radius="30" placeholder="请输入" v-model="keyword" clearButton="auto" cancelButton="none" @confirm="searchConfirm" />
<view>
<uni-icons type="notification" size="20"></uni-icons>
</view>
</view>
<view class="banner">
12 months ago
<image class="pic" src="@/static/image/info-bg.jpg" mode="widthFix"></image>
12 months ago
</view>
12 months ago
<view class="module">
12 months ago
<view class="title-wrap">
<view class="title">爆款推荐</view>
</view>
12 months ago
<image class="hot" src="@/static/image/info-bg.jpg" mode="widthFix"></image>
12 months ago
</view>
12 months ago
<view class="module">
12 months ago
<view class="title">活动速递</view>
<ul class="tab">
<li v-for="(tab, i) in tabs" :class="{active: curTab === tab.id}" @click="tabChange(tab)">{{ tab.name }}</li>
</ul>
<view class="list">
12 months ago
<view v-for="(item, i) in list" :key="i" class="item" @click="toDetail(item)">
<image class="pic" :src="item.coverUrl"></image>
12 months ago
<view class="texts">
12 months ago
<view class="name ell">{{ item.competitionName }}</view>
<view class="meta">时间{{ item.playStartTime + ' ~ ' + item.playEndTime }}</view>
<view class="meta ell">主办方{{ item.sponsor }}</view>
<view v-if="item.whetherToShowApplicants === '1'" class="meta ell">(0/{{ item.quantityLimit }})人已报名</view>
<view class="sign" @click.stop="sign(item)">报名</view>
12 months ago
</view>
</view>
</view>
</view>
</view>
<view v-if="!per" class="per-mask">功能升级中敬请期待...</view>
</view>
</template>
<script>
12 months ago
import { postLoginActivity } from '@/apis/modules/activity.js'
12 months ago
export default {
data() {
return {
per: true, // 是否有权限
teamId: uni.getStorageSync('teamId') || '',
keyword: '',
12 months ago
list: [],
page: 1,
pageSize: 10,
12 months ago
total: 0,
curTab: 0,
tabs: [
{
name: '全部',
id: 0
},
{
12 months ago
name: '会议',
12 months ago
id: 1
12 months ago
},
{
name: '论坛',
id: 2
},
{
name: '讲座',
id: 3
},
{
name: '展会',
id: 4
},
{
name: '培训',
id: 5
12 months ago
}
],
}
},
onShow() {
12 months ago
uni.setStorageSync('token', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNzAyMjg4MDEzLCJleHAiOjE3MDMxNTIwMTMsImFjY291bnRJZCI6IjEifQ.3dZSZAG7w8tSPU9DBL0VdULgkQmiZpYVzjf1qfxx5HY')
12 months ago
this.keyword = ''
this.per = true
this.getProducts()
},
methods: {
// 初始化权限
initRole() {
if (!uni.getStorageSync('auth').includes('首页')) {
this.per = false
}
this.getProducts()
},
12 months ago
// 列表
12 months ago
getProducts() {
12 months ago
postLoginActivity({
pageNum: this.page,
pageSize: this.pageSize,
listType: 0,
platformSource: ''
}).then(({ data }) => {
this.list = data.records
12 months ago
}).catch(e => {})
},
// 模糊查询回调
searchConfirm(e) {
e.value && this.$util.to(`/order/products/products?keyword=${e.value}`)
},
12 months ago
// 跳转活动详情
12 months ago
toDetail(item) {
12 months ago
this.$util.to('/order/activityDetail/activityDetail?id=' + item.id)
12 months ago
},
// tab切换
tabChange(tab) {
this.curTab = tab.id
// this.initList()
},
12 months ago
// 报名
sign(item) {
}
12 months ago
}
}
</script>
<style scoped lang="scss">
.page {
position: relative;
border-top-left-radius: 16px;
border-top-right-radius: 16px;
}
.banner {
position: relative;
.pic {
width: 100%;
}
}
12 months ago
.hot {
width: 100%;
}
12 months ago
.search-wrap {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 10rpx;
12 months ago
background-color: #fff;
12 months ago
.search {
flex: 1;
}
}
12 months ago
.module {
margin: 20rpx;
padding: 20rpx;
background-color: #fff;
border-radius: 8px;
12 months ago
.title-wrap {
display: flex;
justify-content: space-between;
margin-bottom: 34rpx;
}
.title {
display: inline-flex;
align-items: center;
12 months ago
font-size: 30rpx;
12 months ago
font-weight: 600;
color: #333;
}
}
.list {
.item {
12 months ago
position: relative;
12 months ago
display: flex;
margin-bottom: 28rpx;
12 months ago
background-color: #fff;
border-radius: 8px;
overflow: hidden;
12 months ago
}
.pic {
12 months ago
width: 320rpx;
height: 240rpx;
12 months ago
margin-right: 20rpx;
}
.texts {
width: calc(100% - 240rpx);
12 months ago
padding: 10rpx;
12 months ago
}
.name {
font-size: 28rpx;
font-weight: 600;
color: #333;
}
.meta {
12 months ago
margin: 10rpx 0;
font-size: 26rpx;
color: #999;
12 months ago
}
12 months ago
.sign {
position: absolute;
bottom: 0;
right: 0;
padding: 10rpx 30rpx;
font-size: 28rpx;
color: #fff;
background-color: $uni-primary;
border-radius: 4px;
12 months ago
}
}
</style>