nationalregionalCountry.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. <template>
  2. <view class="">
  3. <!-- 背景图 -->
  4. <view class="nationRightView" style="position: relative;background:#F3F4F5;">
  5. <image src="@/static/img/nationaIntroductionList/nationBottom.png" mode="aspectFill" style="width:100%;"
  6. :style="$i18n.locale=='zh'?'':'height:560upx'"></image>
  7. <text :class="$i18n.locale=='zh'?'nationRightText':'nationRightText2'">{{i18n('AsImportantParts')}}</text>
  8. </view>
  9. <view class="borderLine"></view>
  10. <!-- 职责 -->
  11. <view class="" style="margin: 30upx 30upx;">
  12. <text style="display: inline-block;width: 10upx;height: 30upx;
  13. background-color: #6DD400;vertical-align: middle;margin-right: 10upx;"></text>
  14. {{i18n('duty')}}
  15. </view>
  16. <view style="margin-left:10upx;">
  17. <view class="swiper" :class="{en:lang=='en',zh:lang=='zh'}">
  18. <view class="swiper-box" :class="{en:lang=='en',zh:lang=='zh'}">
  19. <swiper @change="handleDotChange">
  20. <swiper-item :key="index" v-for="(item, index) in recommendData">
  21. <view class="wrap" :class="{en:lang=='en',zh:lang=='zh'}"
  22. style="display:flex;align-items:center;margin:0 20upx;">
  23. <view class="swiper-item">
  24. <view class="nationTitle">{{i18n(item.title)}}</view>
  25. <view class="nationLable">{{i18n(item.lable)}}</view>
  26. </view>
  27. </view>
  28. </swiper-item>
  29. </swiper>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="borderLine ftop"></view>
  34. <!-- 推荐活动 -->
  35. <view class="" style="margin:40upx 40upx">
  36. <text style="display: inline-block;width: 10upx;height: 30upx;
  37. background-color: #6DD400;vertical-align: middle;margin-right: 20upx;"></text>
  38. {{i18n('RecommendationActivities')}}
  39. <text style="float: right;color: #1777FE;"
  40. @click="navTo('/pages/nationalregionalCommissions/nationalregionalInformaions/nationalregionalInformaions')">{{i18n('More')}}></text>
  41. </view>
  42. <view>
  43. <view style="margin:10upx 20upx 20upx;height: 160upx;overflow: hidden;background-color: #fff;"
  44. v-for="(item,index) in initData"
  45. @click="navTo('/pages/nationalregionalCommissions/nationalregionalInformaions/nationalregionlInformationDetail',item.entityId)">
  46. <image v-if="item.activityLogo" :src="websiteUrl + item.activityLogo" alt="" style="width: 200upx;"
  47. mode="widthFix">
  48. <image v-else :src="websiteUrl+'/def/def1.png'" alt="" style="width: 200upx;" mode="widthFix">
  49. <view class="recommend-bottom">
  50. <view class="recommend-bottom-name">{{item.activityName}}</view>
  51. <view style="margin-top:20upx;color:#999;font-size:24upx"> {{item.activityPlace}}</view>
  52. <view style="color:#999;font-size:24upx"> {{item.activityTime}}</view>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="borderLine ftop"></view>
  57. <!-- 布局 -->
  58. <view class="" style="margin:40upx 30upx 40upx 30upx;">
  59. <text
  60. style="display: inline-block;width: 10upx;height: 30upx;background-color: #6DD400;vertical-align: middle;margin-right: 10upx;"></text>
  61. {{i18n('Committeelayout')}}
  62. <text style="float: right;color: #1777FE;"
  63. @click=" navTo('/pages/nationalregionalCommissions/nationalregionalInformaions/nationalregionalCountryInformaions')">
  64. {{i18n('More')}} ></text>
  65. </view>
  66. <view class="layoutitem" v-for="(item,index) in world" @click="toView(item)">
  67. <img :src="websiteUrl + item.nationalFlag" alt="" v-if="item.nationalFlag" style="width: 200upx;">
  68. <img :src="websiteUrl+'/def/projectdefault.png'" alt="" v-else style="width: 200upx">
  69. <view class="recommend-bottom">
  70. <view class="recommend-bottom-name">{{item.committeeName}}</view>
  71. </view>
  72. </view>
  73. <u-toast ref="uToast" />
  74. <rf-back-top :scrollTop="scrollTop"></rf-back-top>
  75. </view>
  76. </template>
  77. <script>
  78. export default {
  79. components: {},
  80. props: ['countryList'],
  81. data() {
  82. return {
  83. lang: this.$i18n.locale.toUpperCase() == 'EN' ? 'en' : 'zh',
  84. background: {
  85. backgroundImage: 'linear-gradient(270deg, #4BC0E2 0%, #538BE7 100%)',
  86. },
  87. backStyle: {
  88. color: '#fff'
  89. },
  90. list: [{
  91. name: this.i18n('RegionalCommittee')
  92. }, {
  93. name: this.i18n('NationalCommittee')
  94. }],
  95. current: 0,
  96. recommendData: [],
  97. initData: [], // 推荐活动
  98. committee: [], // 区域委员会
  99. committeeCurrent: 0,
  100. entityId: null,
  101. countryMap: {}, // 当前选中区域委员会列表
  102. regionEntity: {}, //区域委员会
  103. introduce: [], // 区域委员会列表
  104. committeeSelectNum: '',
  105. cooperationUnitDynamicList: [],
  106. regionActivityInfoList: [],
  107. introduceMap: {},
  108. worldSearch: [], // 国家委员会
  109. committeePostDictsMap: [],
  110. committeePostDicts: [],
  111. committeeUnitPostDicts: [],
  112. countryDicts: [],
  113. world: [],
  114. page: 1,
  115. total2: 0,
  116. scrollTop: 0,
  117. status: 'loadmore',
  118. }
  119. },
  120. async mounted() {
  121. this.recommendData = await this.$api.json('recommendCountryData');
  122. this.getInitData();
  123. this.getDicts();
  124. this.getCountryList();
  125. },
  126. onPageScroll(e) {
  127. this.scrollTop = e.scrollTop;
  128. },
  129. computed: {
  130. committeeUnitPostDictsMap() {
  131. return this.committeeUnitPostDicts.array2Obj("value", "label");
  132. },
  133. },
  134. onReachBottom() {
  135. if (this.page * 10 >= this.total2) return;
  136. this.status = 'loading';
  137. this.page = this.page + 1;
  138. console.log(this.page, 'pagepagepagepage');
  139. if ((this.page - 1) * 10 >= this.total2) {
  140. this.status = 'nomore';
  141. } else {
  142. this.status = 'loading';
  143. this.getCountryList(this.page);
  144. }
  145. },
  146. methods: {
  147. toView(item) {
  148. console.log(item)
  149. // let list = {
  150. // entityId:items.entityId,
  151. // committeeName:items.entityId,
  152. // nationalFlag:items.nationalFlag,
  153. // committeeName:items.committeeName,
  154. // committeeProfile:items.committeeProfile,
  155. // }
  156. // list = JSON.stringify(list);
  157. uni.setStorageSync('committeeData', item)
  158. uni.navigateTo({
  159. url: '/pages/nationalregionalCommissions/nationalregionalInformaions/committeeLayout'
  160. })
  161. // this.$mRouter.push({
  162. // route: `/pages/nationalregionalCommissions/nationalregionalCountryList?item=${list}`,
  163. // });
  164. },
  165. navTo(router, id) {
  166. uni.navigateTo({
  167. url: router + '?id=' + id
  168. })
  169. },
  170. async getCountryList() {
  171. const res = await this.$myRequest({
  172. url: '/project/committeeBasisInfos/getCommitteeCountryInfos',
  173. data: {
  174. language: this.$i18n.locale.toUpperCase(),
  175. pageNo: this.page,
  176. pageSize: 5,
  177. },
  178. })
  179. this.world = res.data.committeeBasisInfos || [];
  180. this.total2 = res.data.page.totalCount;
  181. },
  182. committeePostDictsMaps(value) {
  183. const PostDicts = this.committeePostDicts.filter(item => {
  184. return item.value == value
  185. })
  186. return PostDicts[0].label;
  187. },
  188. countryDictsMap(value) {
  189. const PostDicts = this.countryDicts.filter(item => {
  190. return item.value == value
  191. })
  192. return PostDicts[0].label;
  193. },
  194. async getDicts() {
  195. const res = await this.$myRequest({
  196. url: '/sys/sysDicts',
  197. data: {
  198. type: 'COMMITTEE_POST_DICT,COMMITTEE_POST_DICT_EN,COMMITTEE_UNIT_POST_DICT,COMMITTEE_UNIT_POST_DICT_EN,UNIT_COUNTRY_DICT,UNIT_COUNTRY_DICT_EN'
  199. }
  200. });
  201. var data = res.data;
  202. if (data) {
  203. if (this.$i18n.locale == 'zh') {
  204. this.committeePostDicts = res.data[0] || [];
  205. this.committeeUnitPostDicts = res.data[2] || [];
  206. this.countryDicts = res.data[4] || [];
  207. } else if (this.$i18n.locale == 'en') {
  208. this.committeePostDicts = res.data[1] || [];
  209. this.committeeUnitPostDicts = res.data[3] || [];
  210. this.countryDicts = res.data[5] || [];
  211. }
  212. }
  213. },
  214. DictsMap(num, data) {
  215. // if(num==1){
  216. // // title
  217. // this.committeePostDictsMap[];
  218. // }else {
  219. // // country
  220. // }
  221. },
  222. async getInitData() {
  223. let list = {
  224. pageSize: 3,
  225. pageNo: 1,
  226. language: this.$i18n.locale.toUpperCase(),
  227. };
  228. const res = await this.$myRequest({
  229. url: '/project/committeeActivityInfos/getCommitteeActivityList',
  230. data: list
  231. })
  232. this.initData = res.data.committeeActivityInfos || [];
  233. },
  234. async getCommitteeInfos() {
  235. let page = {
  236. committeeId: "",
  237. language: this.$i18n.locale.toUpperCase(),
  238. }
  239. const res = await this.$myRequest({
  240. url: '/project/committeeBasisInfos/getCommitteeInfos',
  241. data: page,
  242. })
  243. // 区域委员会
  244. this.committee = res.data.committeeBasisInfosRegion;
  245. // 国家委员会
  246. this.worldSearch = res.data.committeeBasisInfosCountry;
  247. this.worldSearch.unshift({
  248. committeeName: this.$i18n.locale == 'zh' ? '全部' : 'ALL',
  249. id: null,
  250. value: null
  251. });
  252. this.cooperationUnitDynamicList = res.data.committeeActivityInfos;
  253. this.countryList = res.data.countryList;
  254. this.introduce = res.data.regionList;
  255. this.getCommitteeList(this.committee[0].committeeName, this.committee[0].id, this.committee[0]
  256. .committeeProfileUe, this.committee[0].entityId, this.committee[0])
  257. },
  258. getCommitteeList(lable, num, committeeProfileUe, entityId, item) {
  259. this.introduceMap = {};
  260. this.$set(this.introduceMap, 'chairman', []); //主席
  261. this.$set(this.introduceMap, 'vicePresident', []); // 副主席
  262. this.$set(this.introduceMap, 'secretary', []); // 秘书
  263. this.$set(this.introduceMap, 'member', []); // 委员
  264. this.introduce[1].forEach(element => {
  265. console.log(element.regionalCommitteeDict, entityId, 'introduce[1]');
  266. if (element.regionalCommitteeDict == entityId) {
  267. element.unitProfile = element.unitProfile ? element.unitProfile.replace(/<[^>]+>|&[^>]+;/g,
  268. "") : '';
  269. this.introduceMap.chairman.push(element);
  270. }
  271. })
  272. this.introduce[2].forEach(element => {
  273. console.log(element.regionalCommitteeDict, entityId, 'introduce[2]');
  274. if (element.regionalCommitteeDict == entityId) {
  275. this.introduceMap.vicePresident.push(element);
  276. }
  277. })
  278. this.introduce[3].forEach(element => {
  279. console.log(element.regionalCommitteeDict, entityId, 'introduce[3]');
  280. if (element.regionalCommitteeDict == entityId) {
  281. this.introduceMap.secretary.push(element);
  282. }
  283. })
  284. this.introduce[4].forEach(element => {
  285. console.log(element.regionalCommitteeDict, entityId, 'introduce[4]');
  286. if (element.regionalCommitteeDict == entityId) {
  287. this.introduceMap.member.push(element);
  288. }
  289. })
  290. },
  291. committeeChange(index) {
  292. this.committeeCurrent = index;
  293. this.entityId = this.committee[index].entityId;
  294. this.getCommitteeList(this.committee[index].committeeName, this.committee[index].id, this.committee[index]
  295. .committeeProfileUe, this.committee[index].entityId, this.committee[index]);
  296. },
  297. i18n(data) {
  298. return this.$t('common.' + data);
  299. },
  300. tabChange(index) {
  301. this.current = index;
  302. },
  303. handleDotChange(e) {
  304. console.log(e.target.current)
  305. }
  306. }
  307. }
  308. </script>
  309. <style lang="scss" scoped>
  310. page {
  311. background-color: #fff;
  312. }
  313. .borderLine {
  314. height: 16upx;
  315. width: 100%;
  316. background-color: #F3F4F5;
  317. &.ftop {
  318. height: 24upx;
  319. }
  320. }
  321. .nationRightText,
  322. .nationRightText2 {
  323. position: absolute;
  324. left: 19upx;
  325. top: 45upx;
  326. width: 715upx;
  327. padding: 30upx;
  328. text-indent: 2em;
  329. background: rgba(255, 255, 255, 0.23);
  330. border: 1px solid;
  331. color: #fff;
  332. border-image: linear-gradient(180deg, rgba(22, 102, 150, 0.28), rgba(162, 186, 203, 1)) 1 1;
  333. text-shadow: 0 1px 1px hsla(0, 0%, 100%, .3);
  334. }
  335. .nationRightText {
  336. top: 65upx;
  337. }
  338. .nationRightText::before,
  339. .nationRightText2::before {
  340. content: '';
  341. position: absolute;
  342. top: 0;
  343. right: 0;
  344. bottom: 0;
  345. left: 0;
  346. margin: -30px;
  347. z-index: -1;
  348. -webkit-filter: blur(50upx);
  349. filter: blur(50upx);
  350. }
  351. .swiper-box {
  352. &.zh {
  353. height: 300upx;
  354. /deep/ .uni-swiper-wrapper {
  355. height: 260upx;
  356. }
  357. }
  358. &.en {
  359. height: 380upx;
  360. /deep/ .uni-swiper-wrapper {
  361. height: 360upx;
  362. }
  363. }
  364. }
  365. .uni-swiper-slide-frame .wrap {
  366. border-radius: 20upx;
  367. overflow: hidden;
  368. &.en {
  369. height: 340upx;
  370. }
  371. &.zh {
  372. height: 260upx;
  373. }
  374. }
  375. /deep/.uni-swiper-slides,
  376. .swiper-item {
  377. width: 600upx;
  378. padding: 0 20upx;
  379. display: flex;
  380. align-items: center;
  381. flex-direction: column;
  382. }
  383. .swiper-item {
  384. border-radius: 10upx;
  385. display: flex;
  386. align-items: flex-start;
  387. flex-direction: column;
  388. text-align: left;
  389. }
  390. .swiper-item .nationTitle {
  391. font-size: 28upx;
  392. font-family: PingFangSC-Semibold, PingFang SC;
  393. font-weight: 900;
  394. color: #333;
  395. line-height: 37upx;
  396. padding: 0 20upx;
  397. }
  398. .swiper-item .nationLable {
  399. width: 100%;
  400. font-family: PingFangSC-Semibold, PingFang SC;
  401. margin: 20upx auto 0;
  402. text-indent: 54upx;
  403. color: #333;
  404. padding: 0 0 0 20upx;
  405. text-align: left;
  406. }
  407. .uni-swiper-slide-frame :nth-child(1) {
  408. margin-right: 50upx;
  409. }
  410. .border-top {
  411. border-top: 1px solid #03B6B3;
  412. }
  413. .uni-swiper-slide-frame .wrap {
  414. border-radius: 20upx;
  415. overflow: hidden;
  416. }
  417. .uni-swiper-slide-frame :nth-child(1) .wrap {
  418. background: #F8F8F8;
  419. }
  420. .uni-swiper-slide-frame :nth-child(2) .wrap {
  421. background: #EFFAFF;
  422. }
  423. .uni-swiper-slide-frame :nth-child(3) .wrap {
  424. background: #FAF2ED;
  425. }
  426. .uni-swiper-slide-frame :nth-child(4) .wrap {
  427. background: #EFF6FF;
  428. }
  429. .uni-swiper-slide-frame :nth-child(5) .wrap {
  430. background: #F8F8F8;
  431. }
  432. .border-top {
  433. border-top: 1px solid #03B6B3;
  434. }
  435. .Box_view:active {
  436. background-color: #f1f2f3;
  437. }
  438. .introduceMap-title {
  439. padding: 10upx 15upx;
  440. margin-left: 15upx;
  441. border: 1px solid #0079ef;
  442. }
  443. .nationLable {
  444. font-size: 26upx;
  445. font-family: PingFangSC-Semibold, PingFang SC;
  446. color: #333333;
  447. line-height: 37upx;
  448. }
  449. .recommend-bottom {
  450. float: right;
  451. width: 488upx;
  452. }
  453. .recommend-bottom-name {
  454. font-size: 30upx;
  455. font-family: PingFangSC-Medium, PingFang SC;
  456. font-weight: 500;
  457. color: #0B0B11;
  458. overflow: hidden;
  459. text-overflow: ellipsis;
  460. white-space: nowrap;
  461. }
  462. .imgage-user {
  463. width: 60upx;
  464. height: 60upx;
  465. overflow: hidden;
  466. border-radius: 60upx;
  467. }
  468. .layoutitem {
  469. margin: 10upx 20upx;
  470. height: 160upx;
  471. background: #fff;
  472. display: flex;
  473. align-items: center;
  474. .recommend-bottom {
  475. margin-left: 20upx;
  476. }
  477. }
  478. </style>