123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457 |
- <template>
- <page-layout class="exhibit-index exhibitor-index">
- <nav-bar title="展品信息" @init="onInitNavbar"></nav-bar>
- <u-scroll-view>
- <view class="main-container">
-
- <u-search v-model="searchKeyword" placeholder="搜索展商 / 展品名称 / 会议" @search="onSearch" />
- <view class="select-box">
- <view class="select-title item-title">
- 筛选
- </view>
- <view class="select-list">
- <van-collapse :value="activeName" @change="onChange">
- <van-collapse-item class="first-title" title="展品分类" name="展品分类">
-
- {{item.label}}
- <u-select title="展品分类" v-model="searchCategoryId" :data="categories" uId="dropdown2" :children="true"
- @change-event="searchList()"></u-select>
- </van-collapse-item>
- <van-collapse-item class="first-title" title="应用领域" name="应用领域">
-
- {{item.label}}
- <u-select title="应用领域" v-model="searchApplicationAreas" :data="applicationAreass" uId="dropdown3"
- @change-event="searchList()"></u-select>
- </van-collapse-item>
- </van-collapse>
- </view>
- <view class="select-search-btn" @click="searchList()">搜索</view>
- </view>
- <view class="ad-space" @tap="navigateToAdLink(adInfo.ad_link)">
- <image :src="adInfo.ad_file" mode="widthFix" />
- </view>
- <van-empty v-if="exhibitList.length === 0" description="暂无数据" />
- <view v-else class="exhibit-list exhibitor-list">
- <template v-for="(item, index) in exhibitList">
- <exhibit-item :item="item" :key="index" :pollShow="pollShow.product_poll_show" @share="onShare"
- @updateItemValue="updateItemValue()" />
- </template>
- </view>
- <u-pagination :pageSize="exhibitParams.page_size" :total="total" @page-change="handlePageChange()"
- v-if="total>0"></u-pagination>
- <disclaimer-text></disclaimer-text>
- </view>
- </u-scroll-view>
- <float-button></float-button>
- <van-dialog id="van-dialog" />
- <u-share-action-sheet :show.sync="showShare" :show-info="shareInfo" />
- </page-layout>
- </template>
- <script>
- import NavBar from '@/components/layout/nav-bar'
- import USelect from '@/components/common/u-select/index.vue'
- import UScrollView from '@/components/common/u-scroll-view'
- import UShareActionSheet from '@/components/common/u-share-action-sheet'
- import USearch from '@/components/common/u-search'
- import UDropdownSelect from '@/components/common/u-dropdown-select'
- import UPagination from '@/components/common/u-pagination/index.vue'
- import ExhibitItem from '@/pages/exhibitor/components/exhibit-item.vue'
- import floatButton from "@/components/layout/float-button"
- import {
- exhibitorsProductList,
- productCategoryList,
- applicationAreasList,
- globalPollShow
- } from '@/api/exhibitor'
- import {
- getAdInfo
- } from '@/api'
- import DisclaimerText from '@/components/disclaimer-text/index.vue'
- import PageLayout from "@/components/layout/page-layout";
- import vanCollapse from '@/wxcomponents/vant/collapse/index'
- import vanCollapseItem from '@/wxcomponents/vant/collapse-item/index'
- export default {
- options: {
-
- },
- components: {
- PageLayout,
- NavBar,
- UScrollView,
- USearch,
- UDropdownSelect,
- UShareActionSheet,
- ExhibitItem,
- DisclaimerText,
- USelect,
- UPagination,
- floatButton,
- vanCollapse,
- vanCollapseItem
- },
- computed: {},
- data() {
- return {
- activeName: '',
- searchCategoryId: '',
- searchApplicationAreas: '',
- scrollviewHeight: 0,
- searchKeyword: '',
- exhibitParams: {
- page: 1,
- page_size: 10,
- keyword: '',
- product_cate_id: '',
- application_areas_id: ''
- },
- exhibitList: [],
- exhibitListLoading: false,
- exhibitListLastPage: 1,
- shareInfo: null,
- showShare: false,
- categories: [],
- applicationAreass: [],
- pollShow: {
- exhibitors_poll_show: 0,
- product_poll_show: 0
- },
- total: 0,
- baseUrl: 'https://mp-test-onlinecatelogue.matchexpo.cn',
- adInfo: {
- ad_file: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da70a6c76a.png?x-oss-process=image/resize,w_200'
- }
- }
- },
- created() {
- this.loadFontFace('Poppins')
- this.getProductCategoryList()
- this.getApplicationAreasList()
- this.getList()
- this.getGlobalPollShow(),
- this.getAdData()
- },
- methods: {
- onChange(event) {
- this.activeName = event
- },
- handlePageChange(page) {
- this.exhibitParams.page = page
- exhibitorsProductList(this.exhibitParams).then(res => {
- if (res.data.data) {
- this.exhibitList = res.data.data
- } else {
- this.showToast('系统繁忙,稍候再试')
- }
- })
- },
- getApplicationAreasList() {
- applicationAreasList().then(res => {
- let areas = []
- res.data.forEach(item => {
- areas.push({
- label: item.name,
- value: item.id,
- })
- })
- this.applicationAreass = areas
- })
- },
- getProductCategoryList() {
- productCategoryList().then(res => {
- let cate = []
- res.data.forEach(item => {
- let child = []
- item.children.forEach(itemC => {
- child.push({
- label: itemC.name,
- value: itemC.id
- })
- })
- cate.push({
- label: item.name,
- value: item.id,
- children: child
- })
- })
- this.categories = cate
- })
- },
- searchList() {
- this.showLoading()
- let product_cate_ids = ''
- let application_areas_ids = ''
- if (this.searchCategoryId.length === 0) {
- product_cate_ids = 'product_cate_id='
- } else {
- for (let i = 0; i < this.searchCategoryId.length; i++) {
- if (i === this.searchCategoryId.length - 1) {
- product_cate_ids = product_cate_ids + 'product_cate_id[]=' + this.searchCategoryId[i]
- } else {
- product_cate_ids = product_cate_ids + 'product_cate_id[]=' + this.searchCategoryId[i] + '&'
- }
- }
- }
- if (this.searchApplicationAreas.length === 0) {
- application_areas_ids = 'application_areas_id='
- } else {
- for (let i = 0; i < this.searchApplicationAreas.length; i++) {
- if (i === this.searchApplicationAreas.length - 1) {
- application_areas_ids = application_areas_ids + 'application_areas_id[]=' + this.searchApplicationAreas[i]
- } else {
- application_areas_ids = application_areas_ids + 'application_areas_id[]=' + this.searchApplicationAreas[
- i] + '&'
- }
- }
- }
- let url = this.baseUrl + '/api/exhibitors/product/list?page=1&page_size=10&keyword=&' + product_cate_ids + '&' +
- application_areas_ids
- uni.request({
- url: url,
- method: 'GET',
- success: (res) => {
-
- this.exhibitList = res.data.data
- this.total = res.data.total
- this.exhibitListLastPage = res.data.last_page
- this.hideLoading()
- },
- fail: (err) => {
- console.error('请求失败', err);
- }
- });
- },
- getList() {
- this.showLoading()
- exhibitorsProductList(this.exhibitParams).then(res => {
- if (res.data.data) {
- this.exhibitList = res.data.data
- this.total = res.data.total
- this.exhibitListLastPage = res.data.last_page
- } else {
- this.showToast('系统繁忙,稍候再试')
- }
- this.exhibitListLoading = false
- this.hideLoading()
- })
- },
-
-
-
-
-
-
-
-
-
-
-
- onShare(e) {
- this.shareInfo = e.detail
- this.showShare = true
- },
- onShareAppMessage: function(res) {
- if (res.from === 'button') {
- if (this.shareInfo) {
- return this.shareInfo
- }
- }
- this.shareInfo = null
- this.showShare = false
- return {
- title: '慕尼黑上海电子生产设备展',
- path: '/pages/index/index',
- imageUrl: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da5a7dd374.png?x-oss-process=image/resize,w_600,h_600,limit_0,m_pad'
- }
- },
- onSelectDropdown(index) {
- ['select1', 'select2', 'select3'].forEach(v => {
- if (v !== 'select' + index) {
- this.$refs[v].hideDropdown()
- }
- })
- },
- onClickExhibit(item) {
- this.navigateTo('/pages/exhibitor/exhibit-detail')
- },
- onSearch() {
- this.navigateTo('/pages/index/search?query=' + this.searchKeyword)
- },
- getGlobalPollShow() {
- globalPollShow().then(res => {
- this.pollShow = res.data
- console.log(this.pollShow);
- })
- },
- updateItemValue(e) {
- this.exhibitList.forEach((item) => {
- if (item.id === e.id) {
- item[e.key] = e.value
- }
- })
- },
- navigateToAdLink(href) {
- this.navigateTo(href)
- },
- getAdData() {
- getAdInfo({
- number: "ExhibitorProductTop001"
- }).then(res => {
- this.adInfo = res.data[0]
- })
- }
- }
- }
- </script>
- <style lang="scss">
- checkbox {
- color: #333333;
- .wx-checkbox-input {
- width: 26rpx;
- height: 26rpx;
- &.wx-checkbox-input-checked {
- background-color: #E57519;
- &::before {
- content: '';
- }
- }
- }
- &.open {
- color: #E57519;
- background-color: #FDF4EB;
- }
- }
- .select-box {
- display: flex;
- flex-direction: column;
- background-color: #FFFFFF;
- border-radius: 21rpx;
- border: 2rpx dashed #94A3B8;
- padding: 34rpx 30rpx 54rpx 30rpx;
- margin-bottom: 42rpx;
- .select-title {
- margin-bottom: 30rpx;
- }
- .select-list {
- margin-bottom: 30rpx;
-
- .van-collapse {
- display: flex;
- flex-direction: column;
- grid-gap: 30rpx;
-
- .first-title {
- &>.van-collapse-item {
- border-radius: 14rpx;
- border: 2rpx solid #B3B3B3;
- overflow: hidden;
-
- .van-collapse-item__content {
- padding: unset;
- }
-
- van-collapse {
- .van-collapse-item {
- border-bottom: 2rpx solid #e3e9f1;
-
- .van-cell {
- grid-gap: 16rpx;
- width: 100%;
- .van-cell__title {
- flex: unset;
- width: fit-content;
- }
-
- .van-cell__right-icon-wrap {
- font-size: $fontSize0;
-
- .van-icon-arrow {
- color: #333333;
- &::before {
- content: '\e819';
- font-family: iconfont;
- }
- }
- }
- }
-
- .van-collapse-item__wrapper {
- .custom-checkbox {
- checkbox {
- border: unset;
- }
- }
- }
- }
-
- &:nth-last-child(1) {
- .van-collapse-item {
- border: unset;
- }
- }
- }
- }
-
- .van-cell {
- padding: 16rpx 20rpx;
-
- &::after {
- border-bottom: unset;
- }
- }
- }
- }
-
- .van-hairline--top-bottom {
- &::after {
- border: unset;
- }
- }
- }
- .select-search-btn {
- padding: 18rpx 25rpx;
- border: 1rpx solid #E57519;
- background-color: #E57519;
- font-size: $fontSize3;
- width: 100%;
- color: #FFFFFF;
- display: flex;
- justify-content: center;
- align-items: center;
- border-radius: 13rpx;
- grid-gap: 20rpx;
- font-weight: bold;
- &::before {
- content: '\e86f';
- font-size: $fontSize3;
- font-family: iconfont;
- font-weight: bold;
- }
- }
- }
- </style>
|