CINXE.COM
Discover - Matchexpo
<!DOCTYPE html> <html> <head> <title>Discover - Matchexpo</title> <meta charset="utf-8"/> <meta http-equiv="Cache-Control" content="max-age=31536000"/> <meta http-equiv="Pragma" content="max-age=31536000"/> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" /> <!-- Meta Pixel Code --> <script> !function (f, b, e, v, n, t, s) { if (f.fbq) return; n = f.fbq = function () { n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments) }; if (!f._fbq) f._fbq = n; n.push = n; n.loaded = !0; n.version = '2.0'; n.queue = []; t = b.createElement(e); t.async = !0; t.src = v; s = b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t, s) }(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js'); fbq('init', '1041230296873208'); fbq('track', 'PageView'); </script> <noscript> <img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1041230296873208&ev=PageView&noscript=1" /> </noscript> <!-- End Meta Pixel Code --> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2834372922206562" crossorigin="anonymous"></script> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-B0EZSHLW6R"></script> <script> window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'G-B0EZSHLW6R'); </script> <meta name="keywords" content="Discover - Matchexpo"/> <meta name="description" content="Discover - Matchexpo author:matchexpo"/> <meta property="og:image" content="https://matchexpo.obs.cn-north-1.myhuaweicloud.com/common/2022/0830/630d815374a53.ico"/> <link rel="shortcut icon" href="https://matchexpo.obs.cn-north-1.myhuaweicloud.com/common/2022/0830/630d815374a53.ico" type="image/x-icon"/> <script> var ai_chat_url = 'https://ai.starify.cn'; let screen_width = screen.availWidth let white_list = ['/live-stream', '/mobile', '/invite-', '/community', '/supply-demand', '/job', '/city-plan-form'] //过滤白名单-是否进入 /mobile let is_pass = true //是否通过白名单筛选 white_list.forEach(item => { if (location.pathname.indexOf(item) !== -1) { is_pass = false } }) resizeInitWindow() window.addEventListener('resize', () => { resizeInitWindow() }) function resizeInitWindow() { if (window.screen.availWidth < 992) { document.querySelector('html').style.fontSize = ((screen_width / 375) * 62.5) + '%' if (is_pass) { if ((location.pathname.indexOf('/expo') > -1 || location.pathname.indexOf('/news') > -1 || location.pathname.indexOf('/live') > -1 || location.pathname.indexOf('/homepage') > -1)) { //跳转到对应的移动端页面 location.href = '/mobile' + location.pathname } else { //没有相关页面关键词跳转到移动端首页 location.href = '/mobile/index' } } } else { document.querySelector('html').style.fontSize = ((screen_width / 1920) * 62.5) + '%' } } </script> <script src="/common/js-config?v=8.8"></script> <!-- 导入 Vue 3 --> <script src="/assets/lib/jquery-1.11.1.min.js"></script> <script src="/assets/lib/vue@next.js"></script> <script src="/assets/lib/vue-i18n.global.min.js"></script> <script src="/lang/i18n.js?v=8.8"></script> <script src="/lang/module/en-us.js?v=8.8"></script> <script src="/lang/module/en-us-all.min.js?v=8.8"></script> <script src="/assets/lib/axios.min.js"></script> <!-- 导入组件库 --> <script src="/assets/lib/element-plus.js"></script> <!-- 导入压缩js库 --> <script src="/assets/utils/utils-all.min.js?v=8.8"></script> <script src="/assets/chatgpt-icon/iconfont.js?v=8.8"></script> <link href="/assets/iconfont/iconfont.css?v=8.8" rel="stylesheet" type="text/css"/> <link href="/assets/css/element/index-rem.css?v=8.8" rel="stylesheet" type="text/css"/> <link href="/assets/css/community/recommendUser.css" rel="stylesheet" type="text/css"/> <link href="/assets/css/index.css" rel="stylesheet" type="text/css"/> <link href="/assets/css/index/all.css?v=8.8" rel="stylesheet" type="text/css"/> <link href="/assets/chatgpt-icon/iconfont.css?v=8.8" rel="stylesheet" type="text/css"/> <link href="/assets/css/layout/common.css?v=8.8" rel="stylesheet" type="text/css"/> <script src="/assets/lib/tinymce/tinymce.min.js"></script> <link href="/assets/css/community/discover.css?v=8.8" rel="stylesheet" type="text/css"/> <link href="/assets/css/community/specialModule.css?v=8.8" rel="stylesheet" type="text/css"/> <link href="/assets/css/community/connectionModule.css?v=8.8" rel="stylesheet" type="text/css"/> <link href="/assets/css/layout/common.css?v=8.8" rel="stylesheet" type="text/css"/> <link href="/assets/css/mobile/layout.css?v=8.8" rel="stylesheet" type="text/css"/> <link href="/assets/css/mobile/layout/bottom.css?v=8.8" rel="stylesheet" type="text/css" /> <link href="/assets/css/layout/login/loginPopup.css?v=8.8" rel="stylesheet" type="text/css"/> <link href="/assets/utils/intl-tel-input/build/css/intlTelInput.css" rel="stylesheet" type="text/css" /> <link href="/assets/css/community/layout/index.css?v=8.8" rel="stylesheet" type="text/css"/> <link href="/assets/css/community/layout/navbarLeft.css?v=8.8" rel="stylesheet" type="text/css"/> <link href="/assets/css/community/layout/empty.css?v=8.8" rel="stylesheet" type="text/css"/> <link href="/assets/css/community/layout/navbarRight.css?v=8.8" rel="stylesheet" type="text/css"/> <link href="/assets/css/layout/owl/owl.carousel.min.css" rel="stylesheet" type="text/css" /> <link href="/assets/css/layout/owl/owl.theme.default.css" rel="stylesheet" type="text/css" /> </head> <body data-lang="en-us" > <div id="loadingBox" class="loading_container"> <div class="boxes"> <div class="box"> <div></div> <div></div> <div></div> <div></div> </div> <div class="box"> <div></div> <div></div> <div></div> <div></div> </div> <div class="box"> <div></div> <div></div> <div></div> <div></div> </div> <div class="box"> <div></div> <div></div> <div></div> <div></div> </div> </div> </div> <div class="container_body community_app"> <div class="head_container"> <div class="pc_module"> <div class="community_head" id="community_head"> <div class="head_logo" > <div> <svg class="icon_en svg-icon" aria-hidden="true"> <use xlink:href="#ic_Community1"></use> </svg> </div> <a href="/"><i>|</i>Home</a> </div> <div class="head_search_box"> <div class="head_search"> <i class="iconfont ic_search"></i> <input placeholder="Search" id="globalSearch" /> </div> </div> <div class="head_notice"> <a href="/notification"> <i class="iconfont ic_notice"></i> <span class="notice_point"></span> </a> </div> <div> <el-popover placement="bottom" :width="250" trigger="hover"> <template #reference> <span class="el-dropdown-link language-dropdown" v-cloak> <span class="iconfont ic_language icon_language"></span> <span>{{ locale.label }}</span> </span> </template> <div class="website-lang"> <div v-for="(website, i) in languages" :key="'web-' + i"> <div class="title">{{ website.name }}</div> <div class="site-languages"> <div class="language" :class="(language.site == currSite && language.value == currLanguage) ? 'selected' : ''" v-for="(language, j) in website.list" :key="'opt-' + j" @click="handleLang(language)" v-cloak> {{ language.label }} </div> </div> </div> </div> </el-popover> </div> </div> </div> <div class="mobile_module"> <div id="headBox"> <div class="m_head_container" v-cloak> <a href="/mobile/index" target="_self" class="logo_image"> <svg v-if="$community.judgePageType('community')" class="icon_en svg-icon" aria-hidden="true"> <use xlink:href="#ic_Matchpages"></use> </svg> <svg v-else-if="$community.judgePageType('supply')" class="icon_en svg-icon" aria-hidden="true"> <use xlink:href="#ic_Matchpages"></use> </svg> <svg v-else class="icon_en svg-icon" aria-hidden="true"> <use xlink:href="#ic_Matchpages"></use> </svg> </a> <div class="head_option"> <div @click="showMenu = true"><i class="iconfont ic_list"></i></div> </div> <el-drawer v-model="showMenu" :with-header="false" size="60%"> <div class="user_info" v-if="$config.apiToken"> <img :src="$config.ossDomain + baseUserInfo.curr_enterprise_logo" onerror="this.src = '/assets/image/defaultLogo.png'"> <span>{{ baseUserInfo.curr_enterprise_name }}</span> </div> <el-menu :default-active="activeIndex"> <el-menu-item index="index" @click="pageTo('/mobile/index')"> <i class="iconfont ic_home"></i> Home </el-menu-item> <el-menu-item index="news" @click="pageTo('/mobile/news')"> <i class="iconfont ic_news"></i> News </el-menu-item> <el-menu-item index="expo" @click="pageTo('/mobile/expo')"> <i class="iconfont ic_events"></i> Events & Fairs </el-menu-item> <el-menu-item index="live" @click="pageTo('/mobile/live')"> <i class="iconfont ic_lives"></i> Live </el-menu-item> <el-menu-item index="dynamic" @click="pageTo('/community/dynamic')"> <i class="iconfont ic_Community"></i> Community </el-menu-item> <el-menu-item class="community_menu" index="dynamic" @click="pageTo('/community/dynamic')"> <div class="menu_icon"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_ic_dynamic"></use> </svg> </div> Updates </el-menu-item> <el-menu-item class="community_menu" index="topics" @click="pageTo('/community/topics')"> <div class="menu_icon" style="background-color: #FFE6E5"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_ic_thematic"></use> </svg> </div> Topics </el-menu-item> <el-menu-item class="community_menu" index="group" @click="pageTo('/community/group')"> <div class="menu_icon"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_ic_group"></use> </svg> </div> Group </el-menu-item> <el-menu-item class="community_menu" index="discover" @click="pageTo('/community/discover')"> <div class="menu_icon" style="background-color: #FFF8E5"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_ic_find"></use> </svg> </div> Discovery </el-menu-item> <el-menu-item class="community_menu" index="supply-demand" @click="pageTo('/supply-demand')"> <div class="menu_icon" style="background-color: #FFE6E5"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_ic_gx"></use> </svg> </div> Supply & Demand </el-menu-item> <el-menu-item class="community_menu" index="job" @click="pageTo('/job')"> <div class="menu_icon"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_ic_zp"></use> </svg> </div> Jobs </el-menu-item> <el-sub-menu index="lang"> <template #title> <i class="iconfont ic_global"></i> Language switching </template> <el-menu-item v-for="(item,index) in languages[1].list" :key="index" :index="item.value" @click="handleLang(item)"> {{ item.label }} </el-menu-item> <el-menu-item v-for="(item,index) in languages[0].list" :key="index" :index="item.value" @click="handleLang(item)"> {{ item.label }} </el-menu-item> </el-sub-menu> </el-menu> <div class="navbar_text" v-if="!($community.judgePageType('community'))"> Please use PC to publish activities, live broadcasts and information </div> <div class="navbar_btn" v-else> <a @click="routeTo('/mobile/index')">Return to home</a> </div> <div class="navbar_btn" v-show="!$config.apiToken"> <a @click="routeTo('/mobile/login')">Sign in</a> <span>|</span> <a @click="routeTo('/mobile/register')">Register</a> </div> <div class="navbar_btn" v-show="$config.apiToken"> <a @click="outLogin">Sign out</a> </div> </el-drawer> </div> <div class="search_box" style="display: none"> <el-input v-model="searchValue" placeholder="Search" id="searchValue"> <template #prefix> <i class="iconfont ic_search"></i> </template> <template #suffix> <el-button type="primary" @click="searchData()" id="searchBtn">Search</el-button> </template> </el-input> </div> </div> <script> let headBox = initVue({ name:'headBox', data() { return { activeIndex: 'index', baseUserInfo:{}, showMenu: false, currSite:'', currLanguage:'', searchValue: '', languages: this.$config.languages } }, methods: { returnActiveIndex() { let name = location.pathname if (name.indexOf('/mobile/index') > -1) { this.activeIndex = 'index' } else if(name.indexOf('/mobile/news') > -1) { this.activeIndex = 'news' } else if(name.indexOf('/mobile/expo') > -1) { this.activeIndex = 'expo' } else if(name.indexOf('/mobile/live') > -1) { this.activeIndex = 'live' } else if(name.indexOf('dynamic') > -1) { this.activeIndex = 'dynamic' } else if(name.indexOf('topics') > -1) { this.activeIndex = 'topics' } else if(name.indexOf('group') > -1) { this.activeIndex = 'group' } else if(name.indexOf('discover') > -1) { this.activeIndex = 'discover' } else if(name.indexOf('supply-demand') > -1) { this.activeIndex = 'supply-demand' } else if(name.indexOf('job') > -1) { this.activeIndex = 'job' } }, searchData() { if (this.$community.judgePageType('community')) { location.href = '/community/search?keyword=' + this.searchValue } else { } }, handleLang(lang) { this.currSite = lang.site this.currLanguage = lang.value let url = '' if (lang.site != this.$config.siteName) { url = this.$config.siteDomain[lang.site] + '/mobile/index' + '?lang=' + lang.value } else { this.$i18n.setLocale(lang.value) url = this.$config.siteDomain[lang.site] + '/mobile/index' } location.href = url }, routeTo(url) { location.href = url + '?redirect=' + location.pathname }, outLogin() { removeAccessToken() // window.open('/dist/login','_self') this.routeTo('/mobile/login') }, getUserInfo() { mtpRequest({ url: '/api/user/base-account', method: 'post', }).then(res=>{ this.baseUserInfo = res.data $('#headBox').trigger('getUserInfo',this.baseUserInfo) //异步通信 this.$loading.completeLoading() }) }, pageTo(url,type) { if (type) { window.open(url,type) } else { window.open(url,'_self') } }, }, created() { }, mounted() { this.returnActiveIndex() if (this.$config.apiToken) { this.getUserInfo() } else { this.$loading.completeLoading() } if (getUrlParam('keyword')) { this.searchValue = getUrlParam('keyword') } }, }, "#headBox"); </script> </div> </div> <div class="body_container"> <div> <div class="navbar_left" id="navbar_left"> <div class="user_info"> <div class="user_avatar" @click="toHomepage"> <img :src="$config.ossDomain + baseUserInfo.curr_enterprise_logo" onerror="this.src = '/assets/image/defaultLogo.png'"> </div> <mtp-user-dropdown v-if="$config.apiToken" @update-user-info="updateUserInfo"> <div class="user_nick"> {{ baseUserInfo.curr_enterprise_name }} <i class="iconfont ic_down_line"></i> </div> </mtp-user-dropdown> <div class="user_nick" v-else> <div> <div>You are not logged in</div> <div> <a :href="loginHrefReturn()">Sign in now</a> </div> </div> </div> <div v-if="$config.apiToken"> <div v-if="baseUserInfo.enterprise_certified_id && baseUserInfo.enterprise_certified_id > 0"> <div class="authentication_tag enterprise"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_businessV"></use> </svg> <span>Enterprise</span> </div> </div> <div v-else-if="baseUserInfo.personal_certified_id && baseUserInfo.personal_certified_id > 0"> <div class="authentication_tag person_tag"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_personalV"></use> </svg> <span>Personal certification</span> </div> </div> <div v-else> <div class="authentication_tag none_auth"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_unverifiedV"></use> </svg> <span>Not certified</span> </div> </div> </div> </div> <div class="navbar_menu_list"> <a class="navbar_menu" :class="activeMenu === 'dynamic' ? 'active' : ''" href="/community/dynamic"> <div class="menu_icon"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_ic_dynamic"></use> </svg> </div> <div class="menu_title"> Updates </div> </a> <a class="navbar_menu" :class="activeMenu === 'special' ? 'active' : ''" href="/community/topics"> <div class="menu_icon"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_ic_thematic"></use> </svg> </div> <div class="menu_title"> Topics </div> </a> <a class="navbar_menu" :class="activeMenu === 'group' ? 'active' : ''" href="/community/group"> <div class="menu_icon"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_ic_group"></use> </svg> </div> <div class="menu_title"> Group </div> </a> <a class="navbar_menu" :class="activeMenu === 'discover' ? 'active' : ''" href="/community/discover"> <div class="menu_icon"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_ic_find"></use> </svg> </div> <div class="menu_title"> Discovery </div> </a> <a class="navbar_menu" :class="activeMenu === 'supply-demand' ? 'active' : ''" href="/supply-demand"> <div class="menu_icon"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_ic_gx"></use> </svg> </div> <div class="menu_title"> Supply & Demand </div> </a> <a class="navbar_menu" :class="activeMenu === 'job' ? 'active' : ''" href="/job"> <div class="menu_icon"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_ic_zp"></use> </svg> </div> <div class="menu_title"> Jobs </div> </a> </div> <div class="navbar_module" v-if="groupList && groupList.length > 0"> <div class="module_title">The group I created</div> <div class="navbar_module_list"> <div class="navbar_module_item" v-for="(item,index) in myCreateGroupList" :key="index" v-show="index<5 || (isShowGroups && index >= 5)" @click="toMyInfo(item.group_id)"> <div class="grid_avatar" v-if="item.user_logos"> <img v-for="logo in item.user_logos" :src="logo" /> </div> <span class="module_item_title">{{ item.name }}</span> </div> <div class="navbar_module_option" v-show="!isShowGroups && groupList.length > 5" @click="isShowGroups = true"> Expand all<i class="iconfont ic_down"></i> </div> <div class="navbar_module_option" v-show="isShowGroups && groupList.length > 5" @click="isShowGroups = false"> fold<i class="iconfont ic_down fold"></i> </div> </div> </div> <div class="navbar_module" v-if="groupList && groupList.length > 0"> <div class="module_title">The group I joined</div> <div class="navbar_module_list"> <a class="navbar_module_item" v-for="(item,index) in groupList" :key="index" v-show="index<5 || (isShowGroups && index >= 5) " :href="item.route"> <div class="grid_avatar" v-if="item.user_logos"> <img v-for="logo in item.user_logos" :src="logo" /> </div> <span class="module_item_title">{{ item.name }}</span> </a> <div class="navbar_module_option" v-show="!isShowGroups && groupList.length > 5" @click="isShowGroups = true"> Expand all<i class="iconfont ic_down"></i> </div> <div class="navbar_module_option" v-show="isShowGroups && groupList.length > 5" @click="isShowGroups = false"> fold<i class="iconfont ic_down fold"></i> </div> </div> </div> <div class="navbar_module navbar_page" v-if="accountList && accountList.length > 0"> <div class="module_title">Homepage I follow</div> <div class="navbar_module_list"> <a class="navbar_module_item" v-for="(item,index) in accountList" :key="item.id" :href="item.route" v-show="index<5 || (isShowFollow && index >= 5)"> <img :src="$config.ossDomain + item.logo" onerror="this.src = '/assets/image/defaultLogo.png'"> <span class="module_item_title">{{ item.name }}</span> </a> </div> <div class="navbar_module_option" v-show="!isShowFollow && accountList.length > 5" @click="isShowFollow = true"> Expand all<i class="iconfont ic_down"></i> </div> <div class="navbar_module_option" v-show="isShowFollow && accountList.length > 5" @click="isShowFollow = false"> fold<i class="iconfont ic_down fold"></i> </div> </div> <div class="login_dialog"> <el-dialog :append-to-body="true" v-model="loginDialogVisible" width="52%" > <div> <login-right></login-right> </div> </el-dialog> </div> </div> <script src="/assets/js/UserDropdown/UserDropdown.js"></script> <script> //定义注册的组件名称(方法名称要同步) let navbar_left = initVue({ name:'navbar_left', data(){ return { loginDialogVisible: false, baseUserInfo: {}, groupList: [], myCreateGroupList: [], accountList:[], isShowGroups:false, isShowFollow:false, activeMenu:'dynamic' } }, mounted() { this.changeNavbar() if (this.$config.apiToken) { this.getGroupList() this.upDateFollowGroup() this.getFollowAccount() this.getMyCreateGroupList() } this.initLoginDialog() }, methods:{ toHomepage() { if (this.$config.apiToken) { location.href = '/page/' + this.baseUserInfo.curr_enterprise_id } else { location.href = this.loginHrefReturn() } }, loginHrefReturn() { return '/login?redirect=' + location.pathname }, initLoginDialog() { //通过自定义事件 完成异步通信 let showLoginDialog = document.createEvent('Event'); showLoginDialog.initEvent('showLoginDialog', true, false); $(document).on('showLoginDialog','#navbar_left',()=>{ this.loginDialogVisible = true }) }, getFollowAccount() { mtpRequest({ url: '/api/user/get-my-concern-enterprise', method: 'get', params:{ page:1, page_size:999 } }).then(res=>{ if (res.ret === 0) { this.accountList = res.data.data } }) }, upDateFollowGroup() { this.$nextTick(()=>{ let upDateFollowGroup = document.createEvent('Event'); upDateFollowGroup.initEvent('upDateFollowGroup', true, false); $(document).on('upDateFollowGroup','.navbar_left',()=>{ this.getGroupList() }) }) }, async getGroupList() { //获取小组列表 await mtpRequest({ url: '/api/community/group-list', method: 'get', params:{ 'is_my_follow':1 } }).then((res) => { if (res.ret === 0) { this.groupList = res.data.data } }) }, getMyCreateGroupList() { //获取小组列表 mtpRequest({ url: '/api/community/my-group-list', method: 'get', params: { } }).then((res) => { if (res.ret === 0) { this.myCreateGroupList = res.data.data } }) }, changeNavbar() { if (location.pathname.indexOf('dynamic') > -1) { this.activeMenu = 'dynamic' } else if (location.pathname.indexOf('topics') > -1) { this.activeMenu = 'special' } else if (location.pathname.indexOf('group') > -1) { this.activeMenu = 'group' } else if (location.pathname.indexOf('discover') > -1) { this.activeMenu = 'discover' } else if (location.pathname.indexOf('supply-demand') > -1) { this.activeMenu = 'supply-demand' } else if (location.pathname.indexOf('job') > -1) { this.activeMenu = 'job' } else if (location.pathname.indexOf('publish') > -1) { this.activeMenu = 'publish' } }, updateUserInfo(data) { this.baseUserInfo = data }, toMyPublish() { if (this.$config.apiToken) { window.open('/community/publish', '_self') } else { this.$globalDialog.showLoginDialog() } }, toMyInfo(groupId) { window.location.href = "/community/group/myinfo?id=" + groupId } } },"#navbar_left",['loginRight','mtpUserDropdown']) </script> </div> <div class="app_container"> <div> <div class="head_hot_group"> <div class="group"> <div class="group_first_title">Join a hot group</div> <div class="group_list owl-carousel owl-theme"> <div class="group_item more_group"> <a class="group_item_image" href="/community/group"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_ic_right_community"></use> </svg> </a> <a class="group_btn" href="/community/group">More</a> </div> </div> </div> </div> </div> <div class="app_body"> <div class="app_content"> <div style="display:none;"> 1 1 1 </div> <div id="discover_container" class="discover_container"> <div class="discover_module"> <div class="module_title">Network recommendation <span @click="changeData(connection,'connection_module_list')"><i class="iconfont ic_sync"></i>Change</span></div> <div id="connection_module_list"> <div class="empty_box"> <div class="empty_image"> <img src="https://matchexpo.obs.cn-north-1.myhuaweicloud.com/common/2023/0419/643faf3721af9.png"> </div> <div>Relevant data is empty</div> </div> </div> </div> <div class="discover_module"> <div class="module_title">Special recommendation <span><i class="iconfont ic_sync"></i>Change</span></div> <div id="special_module_list" @click="changeData(special,'specialModule')"> <div class="special_module_list" data-last-page="1"> <a class="module_item" href="https://www.matchexpo.com/community/topics/water-technology.html"> <div class="module_image"> <img src="https://matchexpo.obs.cn-north-1.myhuaweicloud.com/common/2022/1130/6386369d2f895.jpg?x-image-process=image/resize,m_lfit,h_264,w_512" /> </div> <div class="module_title">Water Technology</div> <div class="module_tag_list"> <div>Water treatment</div> </div> <div class="module_start"> <span class="iconfont ic_star"></span> <span class="iconfont ic_star"></span> <span class="iconfont ic_star"></span> <span class="iconfont ic_star"></span> <span class="iconfont ic_star"></span> </div> </a> <a class="module_item" href="https://www.matchexpo.com/community/topics/let-talk-about-food-processing.html"> <div class="module_image"> <img src="https://matchexpo.obs.cn-north-1.myhuaweicloud.com/common/2022/1130/6386383199c7e.jpeg?x-image-process=image/resize,m_lfit,h_264,w_512" /> </div> <div class="module_title">Let talk about Food processing</div> <div class="module_tag_list"> <div>Food processing, packagin</div> </div> <div class="module_start"> <span class="iconfont ic_star"></span> <span class="iconfont ic_star"></span> <span class="iconfont ic_star"></span> <span class="iconfont ic_star"></span> <span class="iconfont ic_star"></span> </div> </a> </div> </div> </div> </div> </div> <div class="app_right_navbar"> <!DOCTYPE html> <div class="navbar_right" id="navbar_right"> <div class="publish_box"> <div class="publish_btn" @click="showPublish('image')"> <div class="publish_icon"> <i class="iconfont ic_Profile"></i> Add a post </div> </div> <div class="publish_btn" @click="showPublish('video')"> <div class="publish_icon"> <i class="iconfont ic_VideoCamera"></i> Add a video </div> </div> </div> <div class="top_group_box" v-show="showElite"> <div> <div class="group_title"><span></span>Elite group <span class="changeGroupBtn"><i class="iconfont ic_sync"></i>Change</span></div> <div id="hot_tag_box"> <div class="group_list" data-last-page="1"> </div> </div> </div> </div> <div class="hot_search_box"> <div> <div class="hot_search_title"> <i class="iconfont ic_fire"></i> Hot search list </div> <div class="hot_search_list"> <a class="hot_search_item" href="/community/search?keyword=母婴"> <i class="num">1</i> <span>母婴</span> </a> <a class="hot_search_item" href="/community/search?keyword=China Export Market"> <i class="num">2</i> <span>China Export Market</span> </a> <a class="hot_search_item" href="/community/search?keyword=Light Industry Export Data"> <i class="num">3</i> <span>Light Industry Export Data</span> </a> </div> </div> </div> <el-dialog v-model="isShowPublish" title="Add your updates" append-to-body custom-class="publish_dialog" @close="initArticleData()" :close-on-click-modal="false"> <div class="publish_container"> <div class="publish_title"> <el-input placeholder="Please enter a title" v-model="articleForm.title" maxlength="250" show-word-limit></el-input> </div> <div class="publish_content"> <textarea id="tinymce">Post your ideas?</textarea> </div> <div class="append_to_image" @click="showMedia" v-if="articleForm.type === 1"> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_ic_img_community"></use> </svg> <span>Add Image</span> </div> <div class="append_to_video" @click="showMedia" v-else> <svg class="icon" aria-hidden="true"> <use xlink:href="#ic_ic_vedio_community"></use> </svg> <span>Add Video</span> </div> <div class="media_list image_list" v-if="articleForm.type === 1"> <img v-for="(item,index) in articleForm.content_file" :key="index" :src="$config.ossDomain + item"> </div> <div class="media_list " :class="articleForm.content_file.length > 1 ? 'image_list' : ''" v-else> <video autoplay controls loop muted v-for="(item,index) in articleForm.content_file" :key="index" :src="$config.ossDomain + item" /> </div> <div class="module_list"> <div class="module_title">Related industries<span>(Add at least five)</span></div> <div class="industry_list"> <div class="industry_item add_industry_item" @click="isShowIndustry = true"> <span v-if="addIndustryItems.length === 0">+Add Industry Labels</span> <span v-else>Edit Industry Labels</span> </div> <div class="industry_item" v-for="item in addIndustryItems" :key="item.id">{{ item.name }}</div> </div> </div> <div class="module_list"> <div class="module_title">Relevant groups</div> <el-checkbox-group v-model="articleForm.group_ids" class="order_list" :max="1" v-if="groupList.length > 0"> <el-checkbox v-for="item in groupList" :key="item.id" :label="item.id"> <div class="group_item"> <div class="grid_avatar" v-if="item.user_logos"> <img v-for="logo in item.user_logos" :src="logo" /> </div> <div>{{ item.name }}</div> </div> </el-checkbox> </el-checkbox-group> <div class="module_empty" v-else > You haven't followed any group yet, please follow the <a href="/community/group">group</a>~ </div> </div> <el-config-provider :locale="$elementLang"> <div class="module_list pub_time"> <div class="module_title">Scheduled Sending</div> <el-date-picker v-model="articleForm.pub_time" type="datetime" placeholder="Select date" format="YYYY-MM-DD HH:mm" value-format="YYYY-MM-DD HH:mm"></el-date-picker> </div> </el-config-provider> </div> <template #footer> <span class="dialog-footer"> <el-button type="primary" @click="saveArticle">Determine</el-button> </span> </template> </el-dialog> <el-dialog title="Edit Industry Labels" v-model="isShowIndustry" width="30%" append-to-body> <div class="select_industry"> <el-select size="large" v-model="articleForm.industry_ids" placeholder="Please select an industry label" multiple filterable remote reserve-keyword :multiple-limit="5"> <el-option v-for="(item,index) in industryList" :key="item.id" :label="item.name" :value="item.id"></el-option> </el-select> </div> <template #footer> <span class="dialog-footer"> <el-button type="primary" @click="addIndustry">Determine</el-button> </span> </template> </el-dialog> <el-dialog v-model="isShowMedia" width="76%" top="5vh" append-to-body> <mtp-media ref="mtpMedia" :media-type="media.mediaType" :select-type="media.selectType" @select-media-data="selectImage" ></mtp-media> <template #footer> <el-button @click="isShowMedia = false">Cancel</el-button> <el-button type="primary" @click="$refs['mtpMedia'].submitSelectMedia()">Determine</el-button> </template> </el-dialog> </div> <script src="/assets/js/media/media.js"></script> <script> document.write('') //定义注册的组件名称(方法名称要同步) let navbar_right = initVue({ name:'navbar_right', data(){ return { showElite:false, articleForm:{ title:'', content:'', pub_time:'', type:1, //类型1=图片,2=视频 content_file:[], group_ids:[], industry_ids:[] }, imageLoading: false, media:{ selectType:2, mediaType:1 }, groupList:[], tinymce:{}, groupListParams: { blade: 'community-group-list', view_file: 'community.layout.eliteGroupList', page:1, page_size:3, sort:'elite' }, limitNum: 30000, addIndustryItems:[], isShowIndustry:false, isShowPublish: false, isShowMedia:false, industryList:[], activeGroupUserListParams: { blade: 'community-group-user-list', view_file: 'community.layout.activeGroupUser', page: 1, page_size: 10, is_active: 1 }, groupId: 0 } }, mounted() { this.getIndustryList() this.initFollowBtn() if (location.pathname.indexOf('discover') > -1) { this.showElite = true } this.initShowDialog() this.initChangeGroup() this.initChangeActiveGroupUser() }, methods:{ initChangeActiveGroupUser() { let btn = document.querySelectorAll('.changeActiveGroupUserBtn') if (btn.length > 0) { let dom = document.getElementById('active_group_user_box') let list = dom.querySelector('.active_group_user_list') let last_page = parseInt(list.getAttribute('data-last-page')) btn.forEach(item => { item.addEventListener('click', () => { if (this.activeGroupUserListParams.page + 1 <= last_page) { this.activeGroupUserListParams.page += 1 } else { this.activeGroupUserListParams.page = 1 } this.activeGroupUserListParams.group_id = this.groupId mtpRequest({ url: '/blade', method: 'get', params: this.activeGroupUserListParams }).then(res => { dom.innerHTML = res.data this.$friend.bindClickEvent() }) }) }) } }, initChangeGroup() { let btn = document.querySelectorAll('.changeGroupBtn') let dom = document.getElementById('hot_tag_box') let list = dom.querySelector('.group_list') let last_page = parseInt(list.getAttribute('data-last-page')) btn.forEach(item=>{ item.addEventListener('click',()=>{ if (this.groupListParams.page + 1 <= last_page) { this.groupListParams.page += 1 } else { this.groupListParams.page = 1 } mtpRequest({ url:'/blade', method:'get', params:this.groupListParams }).then(res=>{ dom.innerHTML = res.data this.initFollowBtn() }) }) }) }, initShowDialog() { //通过自定义事件 完成异步通信 let showPublishDialog = document.createEvent('Event'); showPublishDialog.initEvent('showPublishDialog', true, false); $(document).on('showPublishDialog','#navbar_right',()=>{ this.showPublish('image') }) }, initFollowBtn() { //初始化关注小组按钮 let group_item_list_s = document.querySelectorAll('.top_group_box .group_item') group_item_list_s.forEach(item=>{ initFollowBtnEvent(item) }) }, initArticleData() { this.articleForm = { title:'', content:'', pub_time:'', type:1, //类型1=图片,2=视频 content_file:[], group_ids:[], industry_ids:[] } this.articleForm.content = '' this.addIndustryItems = [] tinymce.activeEditor.setContent('') }, showPublish(type) { if (this.$config.apiToken) { if (type === 'group') { window.location.href = "/community/group/edit" return } this.getGroupList() this.isShowPublish = true this.initTinymce() if (type === 'image') { this.media.selectType = 2 this.media.mediaType = 1 this.articleForm.type = 1 } else { this.media.selectType = 1 this.media.mediaType = 2 this.articleForm.type = 2 } } else { this.$globalDialog.showLoginDialog() } }, saveArticle() { this.articleForm.content = tinymce.activeEditor.getContent() //发布帖子 if (!this.articleForm.title) { this.$message.warning('The title cannot be empty') return false } if (!this.articleForm.content) { this.$message.warning('Content cannot be empty') return false } if (!this.articleForm.content_file.length && this.articleForm.type != 1) { // 图片帖子不做校验 if (this.articleForm.type === 1) { //this.$message.warning('The Image cannot be empty') } else { this.$message.warning('Video cannot be empty') } return false } if (!this.articleForm.industry_ids.length) { this.$message.warning('Select at least one industry') return false } mtpRequest({ url: '/api/community/article', method: 'post', data:this.articleForm }).then((res) => { if (res.ret === 0) { this.isShowPublish = false this.initArticleData() this.$message.success('Post published successfully, please wait patiently for review') } }) }, selectImage(file) { this.articleForm.content_file = [] file.forEach(item=>{ this.articleForm.content_file.push(item.file) }) this.isShowMedia = false }, showMedia() { this.isShowMedia = true }, initTinymce() { this.$nextTick(()=>{ this.tinymce = tinymce.init({ selector: '#tinymce', menubar: false, plugins: ['powerpaste'], powerpaste_block_drop:true, powerpaste_allow_local_images:false, paste_block_drop: false, paste_data_images: false, content_css: '/assets/css/tinymce/tinymce.css', // 以css文件方式自定义可编辑区域的css样式,css文件需自己创建并引入 init_instance_callback: editor => { editor.on('NodeChange Change KeyUp SetContent', async(e) => { this.checkTag() if (e.type && e.type === 'setcontent') { this.$emit('input', editor.getContent()) } if (e.type && e.type === 'keyup') { if (this.limitNum > 0) { let currContent = editor.getContent() // const contentLen = this.strLen(currContent) if (currContent.length > this.limitNum) { currContent = this.cutByte(currContent, this.limitNum, '') editor.setContent(currContent) this.$message.warning('Text exceeds limit') } await this.replaceImageSrc(currContent, (content) => { editor.setContent(content) }) } } }) }, }); }) }, checkTag() { const tinymce = window.tinymce.get('tinymce') if (tinymce && tinymce.selection) { var aTag = tinymce.selection.getNode() if (aTag.nodeName === 'IMG') { this.chooseImageHover = true } else { this.chooseImageHover = false } if (aTag.nodeName === 'A') { this.addLinkHover = true } else { if (aTag.parentNode.nodeName === 'A') { this.addLinkHover = true if (aTag.nodeName === 'IMG') { this.chooseImageHover = true } else { this.chooseImageHover = false } } else { this.addLinkHover = false } } } }, strLen(str) { if (typeof str === 'string') { return str.replace(/[^\x00-\xff]/g, '01').length } else { return 0 } }, cutByte(str, len, endstr) { len = +len endstr = typeof (endstr) === 'undefined' ? '' : endstr.toString() var endstrBl = this.strLen(endstr) function n2(a) { var n = a / 2 | 0; return (n > 0 ? n : 1) } // 用于二分法查找 if (!(str + '').length || !len || len <= 0) { return '' } if (len < endstrBl) { endstr = '' endstrBl = 0 } var lenS = len - endstrBl var _lenS = 0 var _strl = 0 while (_strl <= lenS) { var _lenS1 = n2(lenS - _strl) var addn = this.strLen(str.substr(_lenS, _lenS1)) if (addn === 0) { return str } _strl += addn _lenS += _lenS1 } if (str.length - _lenS > endstrBl || this.strLen(str.substring(_lenS - 1)) > endstrBl) { return str.substr(0, _lenS - 1) + endstr } else { return str } }, async replaceImageSrc(content, callback) { let currContent = content const imgRegex = /<img[^>]+>/g const srcRegex = /src="([^"]+)"/ const imgTags = currContent.match(imgRegex) if (!(imgTags && imgTags.length > 0) || this.imageLoading) { return false } let no = 0 for (let i = 0; i < imgTags.length; i++) { const imgTag = imgTags[i] const srcMatch = srcRegex.exec(imgTag) if (!(srcMatch && srcMatch[1] && srcMatch[1].indexOf(this.$config.ossDomain) === -1)) { return false } this.imageLoading = true await this.convertImageUrlToBase64(srcMatch[1]).then(res => { var param = {} param.file = res param.is_temporary = 1 // 标识图片不展示 param.folder_id = 0 mtpRequest({ url: '/api/attachment/upload-image', method: 'post', data:param }).then(response => { if (response.data) { no += 1 currContent = currContent.replace(srcMatch[1], this.$config.ossDomain + response.data.file) if (no === imgTags.length) { callback(currContent) this.imageLoading = false } } }) }) } // const contentLen = this.strLen(currContent) }, async convertImageUrlToBase64(url) { return await new Promise((resolve, reject) => { const xhr = new XMLHttpRequest() xhr.onload = function() { const reader = new FileReader() reader.onloadend = function() { resolve(reader.result) } reader.onerror = reject reader.readAsDataURL(xhr.response) } xhr.onerror = reject xhr.open('GET', url) xhr.responseType = 'blob' xhr.send() }) }, getGroupList() { //获取小组列表 mtpRequest({ url: '/api/community/group-list', method: 'get', params:{ 'is_my_follow':1 } }).then((res) => { if (res.ret === 0) { this.groupList = res.data.data } }) }, addIndustry() { this.addIndustryItems = [] this.industryList.forEach(list_item=>{ this.articleForm.industry_ids.forEach(id=>{ if (id === list_item.id) { this.addIndustryItems.push(list_item) } }) }) this.isShowIndustry = false }, getIndustryList() { //获取行业标签 mtpRequest({ url: '/api/basic/get-industry-list', method: 'get', }).then((res) => { if (res.ret === 0) { this.industryList = res.data } }) }, } },"#navbar_right",['mtpMedia']) </script> </div> </div> </div> </div> <div class="pc_module"> <div class="copyright"> 2019-2022。 Matchexpo | Wuhan Matchexpo Technology Co., Ltd. All rights reserved. <a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank"> <img src="https://matchexpo.obs.cn-north-1.myhuaweicloud.com/common/2022/0830/630d8153bd984.png" /> <span style="margin-right: 4px">鄂ICP备2022017323号 </span> </a> <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=42018502006493" target="_blank"> <img src="https://matchexpo.obs.cn-north-1.myhuaweicloud.com/common/2022/0830/630d812ede0c6.gif" class="icon_public_security" /> <span>鄂公网安备 42018502006493</span> </a> <div> Room 03, Floor 3, Building 4, Gezhouba Sun City, No. 40, Gaoxin 4th Road, Donghu New Technology Development Zone, Wuhan </div> </div> <script src="https://oss.starify.cn/prod/starigy/w_chat/install/js/5fd0a346-23e4-8052-fd6c-999f94c6f1b4.js" async></script> </div> <div class="mobile_module"> <div id="bottom_container"> <div class="bottom_head"></div> <div class="bottom" > <div class="bottom_main"> <div class="bottom_left"> <a class="bottom_logo" href="/"> <svg class="icon_en svg-icon" aria-hidden="true"> <use xlink:href="#ic_Matchpages"></use> </svg> </a> <div class="bottom_desc"> Matchexpo is an exhibition community platform for event & fair community in China, serving the essential functions of exhibitions, events, fairs, assisting ticket sales, visitor registration and booth reservation, allowing organizers to create, share, find and participate in activities, creating community space for organizers and exhibitors, finding their partners and helping them expand<br> </div> </div> <div class="bottom_list"> <a class="bottom_item" href="/mobile/contact-us">Contact Us</a> <a class="bottom_item" href="/mobile/copyright-notice">Copyright notice</a> <a class="bottom_item" href="/mobile/user-agreement">User Agreement</a> <a class="bottom_item" href="/mobile/privacy-policy">Privacy Policy</a> <a class="bottom_item" href="/mobile/about-us">About Us</a> <a class="bottom_item" href="/mobile/our-mission">Our Mission</a> <a class="bottom_item" href="/mobile/certification-specification">Certification specification</a> <a class="bottom_item" href="/mobile/integrity-report">Integrity Report</a> <a class="bottom_item" href="/mobile/help-center">Help Center</a> <a class="bottom_item" href="/mobile/cooperative-partner">Cooperative partners</a> <a class="bottom_item" href="/mobile/advertisement">Advertising cooperation</a> <a class="bottom_item" href="/mobile/link">Links</a> <a class="bottom_item" href="/mobile/channel">Channel Cooperation</a> <a class="bottom_item" href="/mobile/invitation">Invite friends</a> </div> <div class="bottom_right"> <div class="bottom_qrcode_list"> <div class="bottom_qrcode"> <img src="https://matchexpo.obs.cn-north-1.myhuaweicloud.com/common/2022/0830/630d8161532ac.png"> <span>Follow official account</span> </div> <div class="bottom_qrcode"> <img src="https://matchexpo.obs.cn-north-1.myhuaweicloud.com/common/2022/0830/630d815ddd9af.png"> <span>Online support</span> </div> </div> <div class="platform_list"> <div class="platform_item" style="background:#1877F2"> <i class="iconfont ic_facebook1" ></i> </div> <div class="platform_item" style="background:#1DA1F2"> <i class="iconfont ic_twitter1"></i> </div> <div class="platform_item" style="background: #2867B2"> <i class="iconfont ic_linkedin1"></i> </div> <div class="platform_item" style="background: #FF0000"> <i class="iconfont ic_youtube" ></i> </div> <div class="platform_item" style="background: #F00073"> <i class="iconfont ic_instagram"></i> </div> <div class="platform_item" style="background: #E60023"> <i class="iconfont ic_pinterest1" ></i> </div> </div> </div> </div> </div> <div class="bottom_text"> <div @click="toHomepage('/')"> <span>Matchexpo: Event Marketing Platform</span> International - Traditional Chinese - Simplified Chinese </div> | <a href="https://www.matchpages.cn/" target="_blank"> <span>Matchpages Web Builder</span> </a> | <a href="https://www.starify.cn/" target="_blank"> <span>Starify omni-Channel Chatbot</span> </a> </div> <div class="copyright"> 2019-2022。 Matchexpo | Wuhan Matchexpo Technology Co., Ltd. All rights reserved. <a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank"> <img src="https://matchexpo.obs.cn-north-1.myhuaweicloud.com/common/2022/0830/630d8153bd984.png" /> <span style="margin-right: 4px">鄂ICP备2022017323号 </span> </a> <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=42018502006493" target="_blank"> <img src="https://matchexpo.obs.cn-north-1.myhuaweicloud.com/common/2022/0830/630d812ede0c6.gif" class="icon_public_security" /> <span>鄂公网安备 42018502006493</span> </a> <div> Room 03, Floor 3, Building 4, Gezhouba Sun City, No. 40, Gaoxin 4th Road, Donghu New Technology Development Zone, Wuhan </div> </div> <script src="https://oss.starify.cn/prod/starigy/w_chat/install/js/5fd0a346-23e4-8052-fd6c-999f94c6f1b4.js" async></script> </div> <script> let bottom_container = initVue({ name:'bottomContainer', data() { return { url:'', } }, methods: { toBottomPage(url) { window.open('/bottom#' + url,'_self') }, toHomepage(url) { var homeUrl = encodeURIComponent(url) if (this.$config.apiToken) { let centerUrl = this.$config.publishDomain + '/#/auth-login/' + this.$config.apiToken + '?redirect=' + homeUrl window.open(centerUrl, '_blank') } else { let centerUrl = this.$config.publishDomain + '?redirect=' + homeUrl $('#headBox').trigger('loginDialog',centerUrl) } } }, mounted() { this.$nextTick(()=>{ //更新token的val getUserEvent((res)=>{ if (res) { this.$config.apiToken = res this.$login.setToken(res) } }) }) }, }, "#bottom_container"); </script> </div> </div> <script> //移除loading效果 let loading_box = document.getElementById("loadingBox") function completeLoading() { if (loading_box) { loading_box.style.opacity = '0'; setTimeout(() => { if (document.querySelector('.container_body')) { document.querySelector('.container_body').style.opacity = '1'; } document.getElementById("loadingBox").style.display = "none"; }, 400) } } //初始化loading效果 function initLoading() { document.getElementById("loadingBox").style.display = ""; document.getElementById("loadingBox").style.opacity = '1'; } $(() => { setTimeout(() => { lazyload() }, 100) document.addEventListener('scroll', () => { lazyload() }, {passive: true}) setInterval(() => { lazyload() }, 1000) function lazyload() { var viewHeight = document.body.clientHeight //可视区域的高度 //获取所有要进行懒加载的图片 const lazyloadImg = document.querySelectorAll('img[data-original][lazyload]') lazyloadImg.forEach(item => { let rect = item.getBoundingClientRect()//获取每一个img元素的宽高以及距离视口顶部的距离 if (rect.top <= viewHeight && rect.top > -rect.height) { item.src = item.dataset.original item.removeAttribute('data-original') item.removeAttribute('lazyload') if (!item.onerror) { item.onerror = () => { item.src = '/assets/image/img_default.svg' } } item.style.opacity = 1 } }) } }) function getActiveTag() { let tag = document.querySelector('.active_tag') let tag_index = 0 document.querySelectorAll('.left_nav_list .nav_item').forEach((item, index) => { if (JSON.stringify(item.classList).indexOf('active') > -1) { tag_index = index } }) if (document.querySelector('.left_nav_list .active')) { let top = document.querySelector('.left_nav_list .active').offsetTop tag.style.top = parseInt(top) + 'px' tag.style.opacity = 1 } } /*判断是否禁用cookie*/ if (!(navigator.cookieEnabled && typeof window.localStorage !== 'undefined')) { ElementPlus.ElMessage({ message: 'Please allow all cookies in your browser settings and try again', type: 'warning', }) } /*获取站点*/ function returnSiteName() { window.siteName = 'overseas'; return 'overseas' } returnSiteName() /*数字转中文*/ function NumberToChinese(num) { var chnNumChar = ['Zero', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine']; var chnUnitSection = ['', '0k', 'Billion', 'Trillion', 'Billion'] var chnUnitChar = ['', 'Ten', 'Hundred', 'Thousand'] function SectionToChinese(section) { // 节内转换算法 var strIns = '', chnStr = ''; var unitPos = 0; var zero = true; while (section > 0) { var v = section % 10; if (v === 0) { if (!zero) { zero = true; chnStr = chnNumChar[v] + chnStr; } } else { zero = false; strIns = chnNumChar[v]; strIns += chnUnitChar[unitPos]; chnStr = strIns + chnStr; } unitPos++; section = Math.floor(section / 10); } return chnStr; } // 转换算法主函数 var unitPos = 0; var strIns = '', chnStr = ''; var needZero = false; if (num === 0) { return chnNumChar[0]; } while (num > 0) { var section = num % 10000; if (needZero) { chnStr = chnNumChar[0] + chnStr; } strIns = SectionToChinese(section); strIns += (section !== 0) ? chnUnitSection[unitPos] : chnUnitSection[0]; chnStr = strIns + chnStr; needZero = (section < 1000) && (section > 0); num = Math.floor(num / 10000); unitPos++; } return chnStr; } /*日期转化*/ function getWeekDay(time) { time = new Date(time) var dayarray = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday") var montharray = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") var year = time.getYear() if (year < 1000) year += 1900 var day = time.getDay() var month = time.getMonth() var daym = time.getDate() if (daym < 10) daym = "0" + daym var hours = time.getHours() var minutes = time.getMinutes() var seconds = time.getSeconds() var dn = "AM" if (hours >= 12) dn = "PM" if (hours > 12) { hours = hours - 12 } if (hours == 0) hours = 12 if (minutes <= 9) minutes = "0" + minutes if (seconds <= 9) seconds = "0" + seconds return dayarray[day] + ", " + montharray[month] + "" + daym + ", " + year + " " + hours + ":" + minutes + ":" + seconds + " " + dn } /*判断单位缩写*/ function formatNumber(number) { let lang = 'en-us'; let length = (number + '').length; //数字长度 let str = number + ''; if (lang === 'en-us') { if (length > 9) { //亿单位 str = (number / 1000000000).toFixed(1) + 'Billion' } else if (length > 6) { //万单位 str = (number / 1000000).toFixed(1) + 'Million' } else if (length > 3) { //千单位 str = (number / 1000).toFixed(1) + 'Thousand' } else { return number; } return str; } else { if (length > 8) { //亿单位 str = (number / 100000000).toFixed(1) + 'Hundred million' } else if (length > 4) { //万单位 str = (number / 10000).toFixed(1) + '0k' } else if (length > 3) { //千单位 str = (number / 1000).toFixed(1) + 'Thousand' } else { return number; } return str; } } /*时间转化*/ function timeTran(theTime) { let nowTime = new Date().getTime(); let dur = (nowTime - new Date(theTime).getTime()) / 1000; if (dur <= 60) { return 'Just'; } else if (dur <= 3600) { let number = parseInt(dur / 60) let s = (number > 1 ? 's' : '') return number + ' Minutes ago'.replace('{s}', s) } else if (dur <= 86400) { let number = parseInt(dur / 3600) let s = (number > 1 ? 's' : '') return number + ' Hours ago'.replace('{s}', s) } else if (dur <= 86400 * 30) { let number = parseInt(dur / 86400) let s = (number > 1 ? 's' : '') return number + ' Days ago'.replace('{s}', s) } else if (dur <= 86400 * 30 * 12) { let number = parseInt(dur / (86400 * 30)) let s = (number > 1 ? 's' : '') return number + ' Months ago'.replace('{s}', s) } else { let number = parseInt(dur / (86400 * 30 * 12)) let s = (number > 1 ? 's' : '') return number + ' Last year'.replace('{s}', s) } } // 记录访问referrer var referrer = document.referrer var user_referrer = window.localStorage.getItem('user_referrer') if (!user_referrer) { user_referrer = [] } else { user_referrer = JSON.parse(user_referrer) } if (typeof referrer === 'string' && user_referrer.length < 20) { var recorded = 0 user_referrer.forEach(item => { if (item == referrer) { recorded = 1 } }) if (recorded === 0) { user_referrer.push(referrer) window.localStorage.setItem('user_referrer', JSON.stringify(user_referrer)) } } </script> <script> //定义注册的组件名称(方法名称要同步) let community = initVue({ name:'discover_container', data(){ return { activeTab:'recommend', connection:{ blade:'recommend-enterprise', view_file:'community.discover.components.connectionModule', page:1, show_page:1, page_size:10 }, special:{ blade:'community-topic-list', view_file:'community.topics.components.specialModule', page:1, page_size:10 } } }, mounted() { this.$community.attentionUser(this) }, methods:{ changeData(params,dom) { let last_page = '' last_page = document.querySelector('.' + dom).getAttribute('data-last-page') if (params.page +1 <= parseInt(last_page)) { params.page += 1 } else { params.page = 1 } mtpRequest({ url:'/blade', method:'get', params:params }).then(res=>{ if (res.ret === 0) { document.querySelector('#'+dom).innerHTML = res.data this.$nextTick(()=>{ this.$community.attentionUser(this) }) } }) }, changeTab(name) { this.activeTab = name } } },"#discover_container") </script> <script> let community_head = initVue({ name:'community_head', data() { return { currSite: 'overseas', currLanguage: 'en-us', locale: { 'label': 'English', 'value': 'en-us' }, languages: this.$config.languages, locales: this.$config.locales } }, created() { this.locales.forEach(v => { if (v.value === this.$i18n.getLocale()) { this.locale = v return false } }) }, methods: { handleLang(lang) { this.currSite = lang.site this.currLanguage = lang.value let url = this.$config.siteDomain[lang.site] + location.pathname + '?lang=' + lang.value this.$i18n.setLocale(lang.value) location.href = url }, } }, "#community_head") </script> <script> if ($('.owl-carousel.group_list') && window.screen.availWidth < 992) { $('.owl-carousel.group_list').owlCarousel({ items: 1, animateOut: 'fadeOut', nav: false, loop: true, dots: false, autoplay:true }) } /*设置搜索框回车事件*/ $(document).ready(()=>{ $("#globalSearch").keydown((e)=>{ if (e.keyCode == 13 && window.location.pathname != '/supply-demand' && window.location.pathname != '/job') { let value = $("#globalSearch").val() location.href = '/community/search?keyword=' + value } }) }) /*设置消息通知红点事件*/ if (getToken()) { mtpRequest({ url: '/api/user/get-all-notification-data', method: 'get', }).then((res) => { if (res.ret === 0) { let point = document.querySelector('.notice_point') if (!point) { return false } if (res.data.all_count > 0) { point.style.display = 'flex' if (parseInt(res.data.all_count) > 99) { point.innerHTML = '99' } else { point.innerHTML = res.data.all_count + '' } } else { point.style.display = 'none' } } }) } /*设置关注小组按钮绑定点击事件*/ let group_item_list = document.querySelectorAll('.head_hot_group .group_item') group_item_list.forEach(item=>{ initFollowBtnEvent(item) }) function initFollowBtnEvent(item) { let token = getToken() if (item.attributes && item.attributes['data-id']) { let btn = item.querySelector('.group_btn') let id = item.attributes['data-id'].value let name = item.getElementsByClassName('group_title')[0].innerHTML if (btn) { btn.addEventListener('click',()=>{ if (token) { mtpFollowGroup(parseInt(id),name) } else { this.$globalDialog.showLoginDialog() //弹出登录窗 } }) } } } function mtpFollowGroup(id,name) { mtpRequest({ url: '/api/community/follow-group', method: 'post', data:{ group_id:id } }).then((res) => { if (res.ret === 0) { $('.navbar_left').trigger('upDateFollowGroup') let group_item_list = document.querySelectorAll('.group_item') group_item_list.forEach(item=>{ let btn = item.querySelector('#mtp_follow_group') let btn2 = item.querySelector('#mtp_follow_group2') if (item && item.attributes['data-id'] && parseInt(item.attributes['data-id'].value) === id ) { if (parseInt(btn.attributes['data-follow'].value) === 1) { btn.querySelectorAll('div')[0].style.display = 'block' if (btn.querySelectorAll('div')[1]) { btn.querySelectorAll('div')[1].style.display = 'none' } $('#btn_box_more_' + id).hide() btn.setAttribute('data-follow','0') } else { btn.querySelectorAll('div')[0].style.display = 'none' if (btn.querySelectorAll('div')[1]) { btn.querySelectorAll('div')[1].style.display = 'block' } $('#btn_box_more_' + id).show() btn.setAttribute('data-follow','1') } if (btn2) { if (parseInt(btn2.attributes['data-follow'].value) === 1) { btn2.querySelector('.join_group_box').style.display = 'block' btn2.querySelector('.in_group_box').style.display = 'none' btn2.setAttribute('data-follow','0') } else { btn2.querySelector('.join_group_box').style.display = 'none' btn2.querySelector('.in_group_box').style.display = 'block' btn2.setAttribute('data-follow','1') } } } }) } }) } </script> </body> </html>