countryList.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711
  1. <template>
  2. <view class="rf-category">
  3. <u-navbar :back-text="i18n('Back')" :back-text-style="backStyle" back-icon-color="#fff" title-color="#fff"
  4. :title="i18n('CountryInformation')" :background="background">
  5. </u-navbar>
  6. <view>
  7. <image src="../../../static/country.jpg" style="width: 100%;height: 480upx;"></image>
  8. </view>
  9. <view>
  10. <!-- 大洲选项卡 -->
  11. <view v-for="(item,index) in countryList" :key="index" @click="countryClick(index)" class="country_item"
  12. style="margin-left: 3%;display: inline-block;
  13. height: 80upx;width: 45%;margin-top: 20upx;border-radius: 20upx;">
  14. <view class="" style="margin-top: 15upx;" :style="$i18n.locale=='zh'?
  15. 'margin-left: 100upx;':'margin-left: 80upx;'">
  16. <image :src="getIcon(item.labelEn,index)" alt="" style="width: 60upx;height: 60upx;
  17. vertical-align: middle;margin-right: 10upx;">
  18. {{$i18n.locale=='zh'?item.label:item.labelEn}}
  19. </view>
  20. </view>
  21. </view>
  22. <!-- 国家列表 -->
  23. <view class="clist" style="margin-top: 10px;" v-if="listShow">
  24. <view style="font-size: 40upx;text-align: center;font-weight: bold;">{{areName}}</view>
  25. <view style="margin:20upx 50upx;">
  26. <view @click="toView(item.baseEntityId)" v-for="(item,index) in countryInfos" :key="index"
  27. class="country">
  28. {{item.zhName}}
  29. </view>
  30. </view>
  31. </view>
  32. <view style="margin-top: 10px;">
  33. <mSearch class="mSearch-input-box" :mode="2" button="inside"
  34. :placeholder="i18n('PleaseEnter') + i18n('Nameofcountry')" @search="search" @confirm="doSearchf"
  35. v-model="keyword"></mSearch>
  36. </view>
  37. <u-popup v-model="show">
  38. <view style="margin:20upx 50upx ;padding-top: 60upx;">
  39. <view @click="toView(item.baseEntityId)" v-for="(item,index) in showCountryList" :key="index"
  40. class="country2">
  41. {{$i18n.locale=='zh'?item.zhName:item.enName}}
  42. </view>
  43. </view>
  44. </u-popup>
  45. <view style="margin-top: 10px;">
  46. <scroll-view scroll-x class="index-cate">
  47. <view style="display: inline-block;width: 100%;">
  48. <view class="index-cate-item" style="color: #000;"
  49. :class="tabCurrentIndex === 0 ? `text-${themeColor.name} active` : ''" @tap.stop="tabClick(0)">
  50. {{ $t('common.LatestDevelopment') }}
  51. </view>
  52. <view class="index-cate-item" style="color: #000;"
  53. :class="tabCurrentIndex === 1 ? `text-${themeColor.name} active` : ''" @tap.stop="tabClick(1)">
  54. {{ $t('common.ProjectTrends') }}
  55. </view>
  56. <view class="index-cate-item" style="color: #000;"
  57. :class="tabCurrentIndex === 2 ? `text-${themeColor.name} active` : ''" @tap.stop="tabClick(2)">
  58. {{ $t('common.EnterpriseInquiry') }}
  59. </view>
  60. </view>
  61. </scroll-view>
  62. <view v-if="tabCurrentIndex == 2">
  63. <view @click="toUnitView(item.baseEntityId)"
  64. style="margin: 20upx 20upx;height: 200upx;border-radius: 30upx;overflow: hidden;background-color: #fff;"
  65. v-for="(item,index) in infos">
  66. <img :src="websiteUrl+ item.photo" alt="" v-if="item.photo" style="width: 200upx;height: 200upx;">
  67. <img :src="websiteUrl+'/def/projectdefault.png'" alt="" v-else style="width: 200upx;height: 200upx;">
  68. <view class="recommend-bottom">
  69. <text class="recommend-bottom-name">
  70. {{item.unitName}}
  71. </text>
  72. <text class="tabs" v-if="item.recommendFlag=='y'">
  73. {{i18n('recommend2')}}
  74. </text>
  75. <view>
  76. <text>
  77. {{$i18n.locale === 'zh'?item.unitCountry:item.unitCountryDict.charAt(0).toUpperCase() + item.unitCountryDict.slice(1)}}
  78. </text>
  79. <!-- <text v-show="item.unitRegion"> - </text>
  80. <text>{{item.unitRegion}}</text> -->
  81. </view>
  82. <text v-for="(item,index) in item.labelList">
  83. <u-tag :text="item" mode="light" style="margin:10px 15upx 15upx 0upx;" v-if="index<3" />
  84. </text>
  85. <!-- <view>{{item.labelList}}</view> -->
  86. <!-- <view>发布日期:{{handlePublishTimeDesc(toDate,item.createDate,$i18n.locale)}} {{$t('common.release')}}</view> -->
  87. </view>
  88. <u-toast ref="uToast" />
  89. </view>
  90. <u-loadmore :status="status" />
  91. </view>
  92. <view v-if="tabCurrentIndex == 1">
  93. <view style="margin: 20upx 20upx;height: 200upx;border-radius: 30upx;
  94. overflow: hidden;background-color: #fff;" v-for="(item,index) in projectInfos"
  95. @click="navToList('/pages/country/projectPresentation/projectPresentationDetails',item.projectId)">
  96. <img :src="websiteUrl+ item.bannerList[0]" alt="" v-if="item.bannerList"
  97. style="width: 200upx;height: 200upx;">
  98. <img :src="websiteUrl+'/def/projectdefault.png'" alt="" v-else
  99. style="width: 200upx;height: 200upx;">
  100. <view class="recommend-bottom">
  101. <view class="recommend-bottom-name">{{item.projectName}}</view>
  102. <view>{{formatDate(item.createDate)}} </view>
  103. </view>
  104. </view>
  105. <u-loadmore :status="status" />
  106. </view>
  107. <view v-if="tabCurrentIndex == 0">
  108. <view v-for="(item,index) in newsInfos"
  109. @click="navToList('/pages/country/countryList/countryInformationDetails',item.baseEntityId)">
  110. <view class="media-item view">
  111. <view class="infoList">
  112. <view class="leftImg" v-if="item.pictureUrl">
  113. <image class="img" :src="websiteUrl+item.pictureUrl" mode=""></image>
  114. </view>
  115. <view class="rightCont" :style="{ width: item.pictureUrl?'460upx':'100%' }">
  116. <view class="title">{{ item.title }}</view>
  117. <view class="info-cont">
  118. {{ item.content }}
  119. </view>
  120. <view class="title-base">
  121. <text>{{ item.auther }}</text>
  122. <text class="time">{{ formatDate(item.publishDate) }}</text>
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. <u-toast ref="uToast" />
  131. <rf-back-top :scrollTop="scrollTop"></rf-back-top>
  132. </view>
  133. </template>
  134. <script>
  135. import mSearch from '@/components/rf-search/rf-search';
  136. import newsItem from '@/pages/information/news-item'
  137. export default {
  138. data() {
  139. return {
  140. categoryList: [{
  141. "label": "最新动态",
  142. "value": "1"
  143. },
  144. {
  145. "label": "项目进展",
  146. "value": "2"
  147. },
  148. ],
  149. background: {
  150. backgroundImage: 'linear-gradient(270deg, #4BC0E2 0%, #538BE7 100%)',
  151. },
  152. backStyle: {
  153. color: '#fff'
  154. },
  155. status: 'loadmore',
  156. showCountryList: [],
  157. tabCurrentIndex: 0,
  158. keyword: '',
  159. listShow: false,
  160. screen1sIndex: null,
  161. show: false,
  162. scrollTop: 0,
  163. countryList: [{
  164. label: '亚洲',
  165. labelEn: 'Asia'
  166. },
  167. {
  168. label: '非洲',
  169. labelEn: 'Africa'
  170. },
  171. {
  172. label: '欧洲',
  173. labelEn: 'Europe'
  174. },
  175. {
  176. label: '北美洲',
  177. labelEn: 'Northamerica'
  178. },
  179. {
  180. label: '南美洲',
  181. labelEn: 'Southamerica'
  182. },
  183. {
  184. label: '大洋洲',
  185. labelEn: 'Oceania'
  186. },
  187. ],
  188. page: 1,
  189. total2: 0,
  190. areName: '',
  191. areNameEn: '',
  192. countryMap: Object,
  193. countryInfos: [],
  194. projectInfos: [],
  195. newsInfos: [],
  196. toDate: Date.parse(new Date()),
  197. infos: [],
  198. }
  199. },
  200. components: {
  201. mSearch,
  202. newsItem
  203. },
  204. onPageScroll(e) {
  205. this.scrollTop = e.scrollTop;
  206. },
  207. onShow() {
  208. this.countryClick(0)
  209. this.tabClick(0)
  210. },
  211. onReady() {
  212. let page = {
  213. }
  214. this.getCountryMap(page);
  215. this.getProjectInfo(1);
  216. this.getNewsInfo(page);
  217. this.getUnitList(page);
  218. },
  219. onReachBottom() {
  220. if (this.page * 10 >= this.total2) return;
  221. this.status = 'loading';
  222. this.page = this.page + 1;
  223. console.log(this.page, 'pagepagepagepage');
  224. if ((this.page - 1) * 10 >= this.total2) {
  225. this.status = 'nomore';
  226. } else {
  227. this.status = 'loading';
  228. this.getProjectInfo(this.page);
  229. }
  230. },
  231. methods: {
  232. i18n(data) {
  233. return this.$t('common.' + data);
  234. },
  235. toView(baseEntityId) {
  236. console.log('id', baseEntityId)
  237. this.$mRouter.push({
  238. route: `/pages/country/countryList/countryDetail?baseEntityId=${baseEntityId}`
  239. });
  240. },
  241. doSearch(flag) {
  242. console.log(flag)
  243. this.show = true;
  244. },
  245. async search(data) {
  246. console.log('zhName',data)
  247. const res = await this.$myRequest({
  248. url: '/project/baseCountryViews/',
  249. data: {
  250. zhName: data,
  251. // enName:this.$i18n.locale=="en"?data:'',
  252. }
  253. });
  254. this.showCountryList = res.data.baseCountryViews;
  255. const that = this;
  256. if (this.showCountryList) {
  257. that.show = true;
  258. } else {
  259. that.$refs.uToast.show({
  260. title: this.$i18n.locale == 'zh' ? '暂无当前国家信息' : 'No current country information',
  261. type: 'error',
  262. })
  263. }
  264. },
  265. getIcon(value, index) {
  266. if (index == this.screen1sIndex) {
  267. return require("../../../static/img/country/" + value + '.png');
  268. } else {
  269. return require("../../../static/img/country/" + value + '1.png');
  270. }
  271. },
  272. tabClick(index) {
  273. this.tabCurrentIndex = index;
  274. },
  275. async getCountryMap(page) {
  276. const res = await this.$myRequest({
  277. url: '/project/baseCountryViews/',
  278. data: {
  279. language: this.$i18n.locale.toUpperCase()
  280. }
  281. });
  282. if (res.data) {
  283. this.countryMap = res.data.areMap
  284. }
  285. },
  286. countryClick(index) {
  287. this.listShow = true;
  288. this.screen1sIndex = index;
  289. this.areNameEn = this.countryList[index]['labelEn']
  290. this.areName = this.$i18n.locale == 'zh' ? this.countryList[index]['label'] : this.countryList[index][
  291. 'labelEn'
  292. ]
  293. this.getCountryByAre(this.countryList[index].labelEn) // 获取洲际索引
  294. this.getUnitList();
  295. },
  296. async getCountryByAre(are) {
  297. are = are.toLowerCase();
  298. await this.getCountryMap();
  299. this.countryInfos = this.countryMap[are];
  300. },
  301. async getProjectInfo(page) {
  302. const res = await this.$myRequest({
  303. url: '/project/baseProjectViews/',
  304. data: {
  305. pageNo: page,
  306. pageSize: 10,
  307. language: this.$i18n.locale.toUpperCase(),
  308. descStatus: 0,
  309. status: 1
  310. }
  311. });
  312. if (res.data) {
  313. if (this.page == 1) {
  314. this.projectInfos = res.data.baseProjectViews;
  315. } else {
  316. this.projectInfos = this.projectInfos.concat(res.data.baseProjectViews)
  317. }
  318. this.total2 = res.data.page.totalCount;
  319. if (this.projectInfos.length >= this.total2 - 0) {
  320. this.status = 'nomore';
  321. }
  322. }
  323. },
  324. async getNewsInfo(page) {
  325. const res = await this.$myRequest({
  326. url: '/cms/cmsInformationViews/getCountryDynamicInfos',
  327. data: {
  328. pageNo: 1,
  329. pageSize: 10,
  330. language: this.$i18n.locale.toUpperCase(),
  331. }
  332. });
  333. if (res.data) {
  334. this.newsInfos = res.data;
  335. }
  336. },
  337. navToList(src, data) {
  338. this.$mRouter.push({
  339. route: src + '?id=' + data
  340. });
  341. },
  342. //获取企业展示
  343. async getUnitList(data) {
  344. console.log(this.areNameEn)
  345. const res = await this.$myRequest({
  346. url: '/project/baseUnitViews/',
  347. data: {
  348. pageSize: 10,
  349. pageNo: 1,
  350. areDict: this.areNameEn,
  351. language: this.$i18n.locale.toUpperCase(),
  352. }
  353. });
  354. if (res.data) {
  355. console.log(res.data);
  356. this.infos = res.data.baseUnitViews;
  357. }
  358. },
  359. //企业跳转详情
  360. toUnitView(baseEntityId) {
  361. this.$mRouter.push({
  362. route: `/pages/country/enterprise/enterpriseDetail?baseEntityId=${baseEntityId}`
  363. });
  364. },
  365. }
  366. }
  367. </script>
  368. <style lang="scss" scoped>
  369. .rf-category {
  370. background-color: $color-white;
  371. /* #ifdef APP-PLUS */
  372. // margin-top: calc(20upx + var(--status-bar-height));
  373. /* #endif */
  374. }
  375. .recommend-bottom {
  376. float: right;
  377. height: 200upx;
  378. width: 488upx;
  379. }
  380. .index-cate .index-cate-item {
  381. // margin: 0 4upx 10upx;
  382. width: 50%;
  383. display: inline-block;
  384. }
  385. .infoList {
  386. padding-top: 20upx;
  387. display: flex;
  388. flex-direction: initial;
  389. justify-content: space-between;
  390. }
  391. .leftImg {
  392. width: 185upx;
  393. height: 140upx;
  394. }
  395. .img {
  396. width: 100%;
  397. height: 100%;
  398. }
  399. .country_item:nth-of-type(1),
  400. .country_item:nth-of-type(4) {
  401. background: #fef7f1;
  402. color: #fe6e27;
  403. }
  404. .country_item:nth-of-type(2),
  405. .country_item:nth-of-type(5) {
  406. background: #eefaf8;
  407. color: #6ee0bc;
  408. }
  409. .country_item:nth-of-type(3),
  410. .country_item:nth-of-type(6) {
  411. background: #eff6ff;
  412. color: #7ca4d5;
  413. }
  414. .rightCont {
  415. width: 460upx;
  416. padding-bottom: 20upx;
  417. border-bottom: 1px solid #F1F1F1;
  418. }
  419. .title {
  420. color: #333333;
  421. font-size: 32upx;
  422. font-weight: 700;
  423. overflow: hidden;
  424. text-overflow: ellipsis;
  425. display: -webkit-box;
  426. -webkit-line-clamp: 2;
  427. -webkit-box-orient: vertical;
  428. }
  429. .title-base {
  430. font-size: 24upx;
  431. color: #999999;
  432. margin-top: 10upx;
  433. display: flex;
  434. flex-direction: initial;
  435. }
  436. .time {
  437. margin-left: 30upx;
  438. }
  439. .info-cont {
  440. margin-top: 10upx;
  441. font-size: 28upx;
  442. overflow: hidden;
  443. text-overflow: ellipsis;
  444. display: -webkit-box;
  445. -webkit-line-clamp: 2;
  446. -webkit-box-orient: vertical;
  447. }
  448. .view {
  449. flex-direction: column;
  450. }
  451. .flex-row {
  452. flex-direction: row;
  453. }
  454. .flex-col {
  455. flex-direction: column;
  456. }
  457. .list-cell {
  458. padding: 0 15px;
  459. }
  460. .uni-list-cell-hover {
  461. background-color: #eeeeee;
  462. }
  463. .media-item {
  464. position: relative;
  465. flex: 1;
  466. flex-direction: column;
  467. padding: 0 30upx;
  468. }
  469. .media-item-line {
  470. position: absolute;
  471. left: 15px;
  472. right: 15px;
  473. bottom: 0;
  474. height: 1px;
  475. background-color: #ebebeb;
  476. }
  477. .media-image-right {
  478. flex-direction: row;
  479. }
  480. .country {
  481. border: 1px solid #f1f1f1;
  482. -webkit-box-shadow: 10upx 10upx 10upx #f1f1f1;
  483. box-shadow: 10upx 10upx 10upx #f1f1f1;
  484. display: inline-block;
  485. margin-top: 10px;
  486. color: #2c558a;
  487. border-radius: 10upx;
  488. width: 45%;
  489. overflow: hidden;
  490. white-space: nowrap;
  491. text-overflow: ellipsis;
  492. height: 60upx;
  493. line-height: 60upx;
  494. text-align: center;
  495. margin-left: 20upx;
  496. }
  497. .country2 {
  498. border: 1px solid #f1f1f1;
  499. -webkit-box-shadow: 10upx 10upx 10upx #f1f1f1;
  500. box-shadow: 10upx 10upx 10upx #f1f1f1;
  501. margin-top: 10px;
  502. color: #2c558a;
  503. border-radius: 10upx;
  504. width: 400upx;
  505. overflow: hidden;
  506. white-space: nowrap;
  507. text-overflow: ellipsis;
  508. height: 60upx;
  509. line-height: 60upx;
  510. text-align: center;
  511. margin-left: 20upx;
  512. }
  513. .media-image-left {
  514. flex-direction: row-reverse;
  515. }
  516. .media-title {
  517. flex: 1;
  518. }
  519. .media-title {
  520. lines: 3;
  521. text-overflow: ellipsis;
  522. font-size: 15px;
  523. color: #555555;
  524. }
  525. .media-title2 {
  526. flex: 1;
  527. margin-top: 3px;
  528. line-height: 20px;
  529. }
  530. .image-section {
  531. margin-top: 10px;
  532. flex-direction: row;
  533. justify-content: space-between;
  534. }
  535. .image-section-right {
  536. margin-top: 0;
  537. margin-left: 5px;
  538. width: 112px;
  539. height: 73px;
  540. }
  541. .image-section-left {
  542. margin-top: 0;
  543. margin-right: 5px;
  544. width: 112px;
  545. height: 73px;
  546. }
  547. .image-list1 {
  548. height: 240px;
  549. }
  550. .image-list2 {
  551. width: 112px;
  552. height: 73px;
  553. }
  554. .image-list3 {
  555. width: 112px;
  556. height: 73px;
  557. }
  558. .media-info {
  559. flex-direction: row;
  560. align-items: center;
  561. }
  562. .info-text {
  563. margin-right: 10px;
  564. color: #999999;
  565. font-size: 12px;
  566. }
  567. .media-foot {
  568. margin-top: 12px;
  569. flex-direction: row;
  570. align-items: center;
  571. justify-content: space-between;
  572. }
  573. .close-view {
  574. position: relative;
  575. align-items: center;
  576. flex-direction: row;
  577. width: 20px;
  578. height: 15px;
  579. line-height: 15px;
  580. border-width: 1upx;
  581. border-style: solid;
  582. border-color: #aaaaaa;
  583. border-radius: 4px;
  584. justify-content: center;
  585. text-align: center;
  586. }
  587. .close-l {
  588. position: absolute;
  589. width: 9px;
  590. height: 1px;
  591. background-color: #aaaaaa;
  592. }
  593. .close-h {
  594. transform: rotate(45deg);
  595. }
  596. .close-v {
  597. transform: rotate(-45deg);
  598. }
  599. .recommend-bottom-name {
  600. font-size: 35upx;
  601. font-family: PingFangSC-Medium, PingFang SC;
  602. font-weight: 500;
  603. color: #0B0B11;
  604. line-height: 65upx;
  605. margin-top: 30upx;
  606. overflow: hidden;
  607. text-overflow: ellipsis;
  608. white-space: nowrap;
  609. }
  610. .wrap {
  611. padding: 24upx;
  612. }
  613. .item {
  614. padding: 24upx 0;
  615. color: $u-content-color;
  616. font-size: 28upx;
  617. }
  618. /deep/.serach .content .content-box .input.center {
  619. width: 400upx;
  620. }
  621. </style>