cooperationNetwork.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <template>
  2. <view class="rf-category">
  3. <view class="icoStyle">
  4. <view class="leftArrow" @tap="back" color="#fff" size="40">
  5. <u-icon name="arrow-left" color="#fff" size="40" style="margin-right: 10upx;"></u-icon>
  6. </view>
  7. <rf-search-bar
  8. @search="navToSearch"
  9. icon="iconkuaijiecaidan"
  10. :title= " $t('common.return')"
  11. :placeholder = "$i18n.locale == 'zh'? '请输入关键字': 'Please input keywords'" />
  12. </view>
  13. <view class="tabsBox">
  14. <view class="tabs">
  15. <view class="tab-lines"></view>
  16. <u-tabs-swiper ref="uTabs" :list="realTimeInfoScreens" :current="current" bar-width="120"
  17. @change="tabsChange" :is-scroll="false" swiperWidth="750">
  18. </u-tabs-swiper>
  19. </view>
  20. <swiper class="swiper-tab" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
  21. <!-- 会员介绍 -->
  22. <swiper-item class="swiper-item">
  23. <scroll-view scroll-y style="width: 100%;height: 100%;">
  24. <member-introduction></member-introduction>
  25. </scroll-view>
  26. </swiper-item>
  27. <!-- 联盟介绍 -->
  28. <swiper-item class="swiper-item">
  29. <scroll-view scroll-y style="width: 100%;height: 100%;">
  30. <league-introduction @league-event="leagueEvent"></league-introduction>
  31. </scroll-view>
  32. </swiper-item>
  33. <!-- 合作单位介绍 -->
  34. <swiper-item class="swiper-item">
  35. <scroll-view scroll-y style="width: 100%;height: 100%;">
  36. <unit-introduction @popup-event="parentEvent"></unit-introduction>
  37. </scroll-view>
  38. </swiper-item>
  39. <!-- 定制服务 -->
  40. <swiper-item class="swiper-item">
  41. <scroll-view scroll-y style="width: 100%;height: 100%;">
  42. <custom-service></custom-service>
  43. </scroll-view>
  44. </swiper-item>
  45. </swiper>
  46. </view>
  47. <!-- 详情 -->
  48. <u-popup v-model="detailShow" mode="bottom" height="60%">
  49. <view class="popupView">
  50. <view class="pop-title">
  51. <text class="title-name">{{$i18n.locale=='zh'?this.member.unitZhName:this.member.unitEnName}}</text>
  52. <text class="title-bq" v-if="$i18n.locale=='zh'&&initData.industry">{{initData.industry}}</text>
  53. <text class="title-bq" v-if="$i18n.locale=='en'&&initData.industryDict">{{TagEn[parseInt(initData.industryDict)]}}</text>
  54. </view>
  55. <view class="pop-name">
  56. <text class="bold">{{$t('common.place')}}:</text>
  57. <text>{{countryDictsMap[initData.unitCountryDict]}}{{initData.unitRegion?'-'+initData.unitRegion:''}}</text>
  58. </view>
  59. <view class="pop-name">
  60. <text class="bold">{{$t('common.DateOfEstablishment')}}:</text>
  61. <text>{{initData.setUpDate?initData.setUpDate:''}}</text>
  62. </view>
  63. <view class="pop-name">
  64. <text class="bold">{{$t('common.LegalRepresentative')}}:</text>
  65. <text>{{initData.corporateName?initData.corporateName:''}}</text>
  66. </view>
  67. <view class="pop-name">
  68. <text class="bold">{{$t('common.OfficialWebsite')}}:</text>
  69. <text>{{initData.officialWebsitePath?initData.officialWebsitePath:''}}</text>
  70. </view>
  71. <view class="pop-name">
  72. <text class="bold">{{$t('common.intro')}}:</text>
  73. <text>{{initData.projectPerformance}}</text>
  74. </view>
  75. </view>
  76. </u-popup>
  77. </view>
  78. </template>
  79. <script>
  80. import rfSearchBar from '@/components/rf-search-bar';
  81. import memberIntroduction from './components/memberIntroduction.vue';
  82. import leagueIntroduction from './components/leagueIntroduction.vue';
  83. import unitIntroduction from './components/unitIntroduction.vue';
  84. import customService from './components/customService.vue';
  85. export default {
  86. components: {
  87. rfSearchBar,
  88. memberIntroduction,
  89. leagueIntroduction,
  90. unitIntroduction,
  91. customService
  92. },
  93. data(){
  94. return {
  95. detailShow: false,
  96. realTimeInfoScreens:[{
  97. name: this.$i18n.locale ==='zh'? "会员介绍" : "Member",
  98. value: 'member'
  99. },{
  100. name: this.$i18n.locale ==='zh'? "联盟介绍" : "Alliance",
  101. value: 'union'
  102. },{
  103. name: this.$i18n.locale ==='zh'? "合作单位介绍" : "Partners",
  104. value: 'cooperation'
  105. },{
  106. name: this.$i18n.locale ==='zh'? "定制服务" : "Customized Service",
  107. value: 'custom'
  108. }],
  109. current: 0,
  110. swiperCurrent: 0,
  111. TagEn:['Individual Member','Groups','Scientific Institutions','Colleges And Universities','Energy Companies','Equipement Manufactures','Project Contractors','Financial Institutions','Consultation Enterprises','Rigidity Of Enterprise','Media','Logistics Transportation','Others'],
  112. member: [],
  113. initData: {},
  114. countryDicts: [],
  115. countryDictsMap: {},
  116. }
  117. },
  118. onLoad(options){
  119. this.current= options.id?options.id:0;
  120. this.swiperCurrent= options.id?options.id:0;
  121. this.getCountry();
  122. },
  123. methods: {
  124. back() {
  125. uni.navigateBack();
  126. },
  127. leagueEvent(data) { //联盟介绍弹框
  128. this.getMemberUnitFlag(data.unitId);
  129. this.member = data;
  130. this.getMemberUnit(data.unitId);
  131. },
  132. parentEvent(data) { //合作单位介绍弹框
  133. this.detailShow = true;
  134. this.member = data;
  135. this.getMemberUnit(data.unitId);
  136. },
  137. // tabs通知swiper切换
  138. tabsChange(index) {
  139. this.swiperCurrent = index;
  140. },
  141. // swiper-item左右移动,通知tabs的滑块跟随移动
  142. transition(e) {
  143. let dx = e.detail.dx;
  144. this.$refs.uTabs.setDx(dx);
  145. },
  146. animationfinish(e) {
  147. let current = e.detail.current;
  148. this.$refs.uTabs.setFinishCurrent(current);
  149. this.swiperCurrent = current;
  150. this.current = current;
  151. },
  152. // 通用跳转
  153. navToSearch() {
  154. this.$mRouter.push({
  155. route: `/pages/index/search/search?data=${JSON.stringify(this.search)}`
  156. });
  157. },
  158. async getCountry() {
  159. const res = await this.$myRequest({
  160. url: '/sys/sysDicts',
  161. data: {
  162. type: this.$i18n.locale=='zh'?'UNIT_COUNTRY_DICT':'unit_country_dict_en'
  163. }
  164. });
  165. // console.log(res.data[0]);
  166. this.countryDicts = res.data[0];
  167. for(var i = 0; i < this.countryDicts.length; i++){
  168. this.countryDictsMap[this.countryDicts[i].value] = this.countryDicts[i].label ? this.countryDicts[i].label : this.countryDicts[i];
  169. }
  170. },
  171. async getMemberUnitFlag(unitId) {
  172. const res = await this.$myRequest({
  173. url: '/project/baseUnitViews/getMemberUnitFlag',
  174. data: {
  175. baseEntityId: unitId,
  176. language: this.$i18n.locale.toUpperCase()
  177. }
  178. });
  179. if(res.data.flag) {
  180. this.detailShow = true;
  181. }else {
  182. this.$refs.uToast.show({
  183. title: this.$i18n.locale == 'zh'? '暂无数据': 'No data available',
  184. type: 'warning'
  185. });
  186. this.detailShow = false;
  187. }
  188. },
  189. async getMemberUnit(unitId) {
  190. const res = await this.$myRequest({
  191. url: '/project/baseUnitViews/getMemberUnit',
  192. data: {
  193. baseEntityId: unitId,
  194. language: this.$i18n.locale.toUpperCase()
  195. }
  196. });
  197. if(res.data) {
  198. this.initData = res.data.baseUnitView || [];
  199. this.initData.unitLabel = this.initData.unitLabel?this.initData.unitLabel.split(','):"";
  200. this.initData.setUpDate = this.formatDate(this.initData.setUpDate,'YYYY');
  201. if(this.$i18n.locale == "zh"){
  202. this.initData.unitCountry = res.data.baseUnitView.unitCountry;
  203. }else if(this.$i18n.locale == "en"){
  204. this.initData.unitCountry = res.data.baseUnitView.unitCountryDict;
  205. }
  206. }else {
  207. this.initData = [];
  208. }
  209. }
  210. }
  211. }
  212. </script>
  213. <style lang="scss" scoped>
  214. .rf-category {
  215. /* #ifdef APP-PLUS */
  216. padding-top: var(--status-bar-height);
  217. /* #endif */
  218. }
  219. .icoStyle {
  220. display: flex;
  221. .leftArrow {
  222. position: absolute;
  223. left: 4upx;
  224. top: calc(30upx + var(--status-bar-height));;
  225. z-index: 9999;
  226. }
  227. }
  228. .tabsBox {
  229. display: flex;
  230. flex-direction: column;
  231. /* #ifdef APP-PLUS */
  232. height: calc(100vh - var(--status-bar-height));
  233. /* #endif */
  234. /* #ifndef APP-PLUS */
  235. height: 100vh;
  236. /* #endif */
  237. width: 100%;
  238. padding-top: 168upx;
  239. .tabs {
  240. position: fixed;
  241. top: calc(88upx + var(--status-bar-height));
  242. left: 0;
  243. z-index: 9999;
  244. width: 100%;
  245. }
  246. .tab-lines {
  247. width: 100%;
  248. height: 1px;
  249. background-color: #E1E1E1;
  250. position: absolute;
  251. bottom: 1px;
  252. left: 0;
  253. }
  254. }
  255. .swiper-tab {
  256. flex: 1;
  257. }
  258. .popupView {
  259. padding: 20upx 30upx;
  260. .pop-title {
  261. display: flex;
  262. justify-content: space-between;
  263. .title-name {
  264. font-size: 34upx;
  265. font-weight: 700;
  266. color: #333333;
  267. }
  268. .title-bq {
  269. font-size: 30upx;
  270. background-color: #fef0f0;
  271. border: 1px solid #fde2e2;
  272. color: #f56c6c;
  273. padding: 10upx;
  274. border-radius: 6upx;
  275. }
  276. }
  277. .pop-name {
  278. font-size: 30upx;
  279. color: #333333;
  280. line-height: 50upx;
  281. .bold {
  282. font-weight: bold;
  283. }
  284. }
  285. }
  286. </style>