幼教产品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.

352 lines
8.2 KiB

12 months ago
<template>
<view :class="[{oh: !per}]">
<view class="page">
<view class="search-wrap">
11 months ago
<uni-search-bar class="search" radius="30" placeholder="请输入" v-model="keyword" clearButton="auto" cancelButton="none" @confirm="initList" @clear="clearKeyword" />
11 months ago
<!-- <uni-icons class="icon" custom-prefix="iconfont" type="icon-filter" size="22" color="#007eff" @click="typeVisible = true"></uni-icons> -->
12 months ago
</view>
12 months ago
<view class="wrap">
11 months ago
<sideSelect :menus.sync="classifications" @menuClick="menuClick" />
12 months ago
<view class="list">
11 months ago
<view class="item" v-for="(item, i) in list" :key="i" @click.stop="toDetail(item)">
12 months ago
<view class="pro-name">
11 months ago
<image class="icon" :src="item.logoUrl ? item.logoUrl : Common.shopIcon"></image>
11 months ago
{{ item.companyName }}
12 months ago
</view>
12 months ago
<view class="info">
11 months ago
<view v-if="item.briefIntroduction" class="intro">
<image class="icon" src="http://124.71.79.122/images/miniProgram/intro.png" mode="widthFix" />
<view class="text ell">{{ item.briefIntroduction }}</view>
</view>
<view v-if="item.province || item.city" class="meta">
<image class="icon" src="http://124.71.79.122/images/miniProgram/address1.png" mode="widthFix" />
{{ item.province }}-{{ item.city }}
</view>
11 months ago
<view class="actions">
<view class="star" @click.stop="collect(item)">
<uni-icons class="star-icon" color="#ffcf47" :type="item.whetherAttention ? 'star' : 'star-filled'" size="25" @click.stop="collect(item)"></uni-icons>
{{ item.whetherAttention ? '取消关注' : '关注' }}
</view>
<view class="order" @click.stop="toOrder(item)">我想采购</view>
</view>
12 months ago
</view>
</view>
12 months ago
</view>
12 months ago
</view>
</view>
11 months ago
<view :class="['type-popup', {active: typeVisible}]">
<uni-icons class="close" type="closeempty" size="20" color="#757575" @click="closeType"></uni-icons>
<template v-for="(item, i) in classifications">
11 months ago
<template v-if="item.children && item.children.length">
11 months ago
<view :key="i" class="title">{{ item.classificationName }}</view>
<view class="types">
<view v-for="(child, j) in item.children" :key="j" :class="['item', {active: active == child.id}]" @click="classificationClick(child)">{{ child.classificationName }}</view>
</view>
</template>
<view v-else class="types">
<view :class="['item', {active: active == item.id}]" @click="classificationClick(item)">{{ item.classificationName }}</view>
</view>
</template>
</view>
11 months ago
<order ref="order" />
11 months ago
<view v-if="!per" class="per-mask">功能升级中敬请期待...</view>
12 months ago
</view>
</template>
<script>
11 months ago
import { selectEnterpriseCertificationList, treeStructureList, collect, cancelCollection } from '@/apis/modules/supplier.js'
11 months ago
import Common from '@/config/common'
12 months ago
export default {
data() {
return {
11 months ago
Common,
12 months ago
per: true, // 是否有权限
teamId: uni.getStorageSync('teamId') || '',
11 months ago
platformId: uni.getStorageSync('platformId'),
12 months ago
menus: [
{
id: '',
name: '全部'
},
{
id: 1,
name: '服装'
},
{
id: 2,
name: '教具'
},
{
id: 3,
name: '课程'
},
{
id: 4,
name: '家具'
},
{
12 months ago
id: 5,
12 months ago
name: '设备'
},
{
12 months ago
id: 6,
12 months ago
name: '服务'
},
{
12 months ago
id: 7,
12 months ago
name: '其它'
},
],
12 months ago
list: [],
11 months ago
reachBottom: 0, // 是否是上拉加载。0->否,1->是,-1->加载完所有数据
status: 'more', // 上拉加载状态 more|loading|noMore
12 months ago
keyword: '',
11 months ago
page: 1,
pageSize: 5,
12 months ago
total: 0,
curTab: 0,
11 months ago
tabs: [],
classifications: [],
active: '',
typeVisible: false,
11 months ago
submiting: false,
12 months ago
}
},
11 months ago
// 下拉刷新
onPullDownRefresh() {
this.initList()
setTimeout(() => {
uni.stopPullDownRefresh()
}, 1500)
},
// 上拉加载
onReachBottom() {
if (this.reachBottom >= 0) {
this.reachBottom = 1
this.status = 'loading'
this.getList()
}
},
12 months ago
onShow() {
11 months ago
this.active = ''
12 months ago
this.keyword = ''
11 months ago
this.typeVisible = false
11 months ago
this.per = this.platformId !== 6 // 供应商不能查看该页面
this.per && this.initList()
12 months ago
},
methods: {
11 months ago
initList() {
this.page = 1
this.reachBottom = 0
11 months ago
this.getCategory()
11 months ago
this.getList()
12 months ago
},
11 months ago
// 列表
getList() {
11 months ago
uni.showLoading({
title: '加载中'
})
11 months ago
selectEnterpriseCertificationList({
auditStatus: null,
authenticationStatus: 2,
pageNum: this.page,
pageSize: this.pageSize,
platformSource: 6,
keyWord: this.keyword,
11 months ago
supplierClassificationId: this.active,
11 months ago
}).then(({ data }) => {
11 months ago
this.list = this.reachBottom > 0 ? [...this.list, ...data.records] : data.records
this.page++ // 每次获取了数据后page+1
const noMore = this.list.length === data.total // 是否加载完所有数据
this.status = noMore ? 'noMore' : 'more' // 加载完了则设置为noMore
this.reachBottom = noMore ? -1 : 0 // 加载完了则设置为-1
11 months ago
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
})
12 months ago
},
11 months ago
// 获取分类
async getCategory() {
const { list } = await treeStructureList()
11 months ago
this.classifications = [
{
id: '',
classificationName: '全部'
},
...list[0].children
]
11 months ago
},
// 分类点击回调
11 months ago
classificationClick(item) {
11 months ago
this.active = item.id
11 months ago
this.typeVisible = false
this.initList()
11 months ago
},
// 关闭分类弹框
closeType() {
this.typeVisible = false
this.initList()
},
11 months ago
// keyword清除回调
clearKeyword() {
this.keyword = ''
this.initList()
12 months ago
},
// 跳转学习详情
toDetail(item) {
11 months ago
this.$util.to('/other/supplierDetail/supplierDetail?teamId=' + item.teamId)
12 months ago
},
11 months ago
// 切换
menuClick(tab) {
11 months ago
this.active = tab.id
11 months ago
this.initList()
12 months ago
},
11 months ago
// 我想采购
toOrder(row) {
const el = this.$refs.order
11 months ago
el.remarks = ''
11 months ago
el.getGoods(row.teamId)
11 months ago
el.$refs.popup.open()
11 months ago
},
// 关注
async collect(row) {
if (this.submiting) return false
this.submiting = true
if (row.whetherAttention) {
const that = this
uni.showModal({
title: '提示',
content: '确定要取消关注吗?',
async success(res) {
if (res.confirm) {
await cancelCollection(row.attentionId)
that.submiting = false
that.$util.sucMsg('取消关注成功')
row.whetherAttention = 0
}
}
})
} else {
const res = await collect({
supplierAccountId: row.accountId
})
this.$set(row, 'attentionId', res.message)
this.submiting = false
row.whetherAttention = 1
}
},
12 months ago
}
}
</script>
<style scoped lang="scss">
.banner {
12 months ago
display: block;
width: 100%;
border: 0;
}
.wrap {
display: flex;
align-items: flex-start;
12 months ago
}
.list {
12 months ago
flex: 1;
11 months ago
width: 100vw;
overflow: hidden;
12 months ago
.item {
11 months ago
position: relative;
12 months ago
padding: 24rpx;
margin: 16rpx 24rpx;
background-color: #fff;
border-radius: 16rpx;
}
.pro-name {
display: flex;
align-items: center;
padding: 18rpx 0;
11 months ago
font-size: 32rpx;
12 months ago
font-weight: 600;
color: #333;
border-bottom: 1px solid #E6E8ED;
.icon {
11 months ago
width: 66rpx;
min-width: 66rpx;
height: 66rpx;
12 months ago
margin-right: 20rpx;
border-radius: 4px;
}
}
.info {
11 months ago
position: relative;
12 months ago
padding: 12rpx 0;
}
.line {
display: flex;
padding: 12rpx 0;
}
.name {
margin-right: 10rpx;
font-size: 28rpx;
color: #999;
}
11 months ago
.intro {
11 months ago
display: flex;
align-items: center;
margin: 10rpx 0 20rpx;
font-size: 26rpx;
color: #3c3c3c;
.text {
max-width: 49%;
}
11 months ago
}
.meta {
11 months ago
display: flex;
align-items: center;
11 months ago
margin-bottom: 20rpx;
11 months ago
font-size: 26rpx;
11 months ago
color: #3c3c3c;
}
.icon {
width: 30rpx;
margin-right: 10rpx;
12 months ago
}
.ell-wrap {
display: inline-flex;
align-items: center;
}
.ell {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
11 months ago
.actions {
display: flex;
justify-content: flex-end;
align-items: center;
}
.star {
display: inline-flex;
align-items: center;
margin-right: 20rpx;
font-size: 28rpx;
color: #333;
.star-icon {
margin-right: 10rpx;
}
}
11 months ago
.order {
padding: 8rpx 28rpx;
font-size: 28rpx;
color: #fff;
background-color: $uni-primary;
border-radius: 20px;
12 months ago
}
}
</style>