IntroductionPartnerInformation.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. <template>
  2. <div>
  3. <div style="width: 100%;height: 342px;margin-top: 20px;position: relative;">
  4. <div><img src="../../assets/img/introductionCooperation/exclusive/zh_en.png" alt="" style="width: 100%;"></div>
  5. <div style="position: relative; left: 487px; top: -215px">
  6. <span :style="this.$i18n.locale== 'zh' ? 'font-size: 40px;font-weight: 700;color: white;position: relative;left: 32px;top: -14px;':'font-size: 40px;font-weight: 700;color: white;position: relative;left:-56px;top: -14px;'">{{$t('common.TitleTop')}}</span>
  7. <br/>
  8. <span :style="this.$i18n.locale== 'zh' ? 'font-size: 20px;color: white;position:relative; top: 4px; letter-spacing: 5px;left: -42px;':'font-size: 20px;color: white; position: relative;top: 4px;left: -176px;'">{{$t('common.TitleBottom')}}</span>
  9. </div>
  10. </div>
  11. <div style="width: 80%;margin: auto;margin-top: 30px;color: #333;">
  12. <span>{{$t('common.CooperationUnitIntroduction')}}</span>
  13. </div>
  14. <div style="margin:50px 30px 0 30px ;height: 50px;line-height: 50px;" class="box1">
  15. <img src="@/assets/img/cooperationExchange/20200608_03.gif" alt=""
  16. style="height: 20px;vertical-align: middle;">
  17. <span style="color: #3a6295;font-weight: 700;margin-left: 5px;">{{$t('common.AgreementMoUPartners')}}</span>
  18. <!-- 搜索合作单位 -->
  19. <span style="float: right;width: 200px; margin-right: 550px;">
  20. <!-- suffix-icon="el-icon-search" -->
  21. <el-input
  22. style="width: 350px;"
  23. v-model="searchName"
  24. :placeholder="$t('common.Enterthenameofthepartner')"
  25. >
  26. <el-button class="cursor" slot="append" type="primary"
  27. @click="getDatas">{{$t('common.Search')}}</el-button>
  28. </el-input>
  29. </span>
  30. </div>
  31. <div style="margin: 20px;color: #666;font-size: 14px;" class="continents">
  32. <ul>
  33. <li class="cursor" v-for="(item,index) in initData"
  34. @click="toViewDetail('IntroductionPartnerInformationDetails',item)">
  35. <img v-if="memberUnits[item.unitId]"src="@/assets/img/introductionCooperation/profile.png" alt="" style="vertical-align: middle;">
  36. <span style="margin-left: 9px">{{$i18n.locale === 'zh'?item.unitZhName : item.unitEnName}}</span>
  37. </li>
  38. </ul>
  39. </div>
  40. <!-- 分页 -->
  41. <div style="width: 100%;position: relative;height: 100px;">
  42. <el-pagination
  43. style="height: 80px;position: absolute;left: 50%;top: 100px;transform: translate(-50%,-50%);"
  44. background
  45. layout="prev, pager, next"
  46. page-size=15
  47. :total=total-0
  48. :current-page.sync="currentPage"
  49. @current-change="handleCurrentChange">
  50. </el-pagination>
  51. </div>
  52. <div style="margin:25px 30px 0 30px ;height: 50px;line-height: 50px;" class="box1">
  53. <img src="@/assets/img/cooperationExchange/20200608_03.gif" alt=""
  54. style="height: 20px;vertical-align: middle;">
  55. <span style="color: #3a6295;font-weight: 700;margin-left: 5px;">{{$t('common.Recommendedpartner')}}</span>
  56. </div>
  57. <div class="recommended">
  58. <div class="cursor" style="width: 22%;height: 180px;display: inline-block;color: #000;" v-for="i in recommendList" @click="toViewDetail('IntroductionPartnerInformationDetails',i)">
  59. <img :src="'api/file/pub/'+ i.photo" alt=""
  60. @click="toViewDetail('IntroductionPartnerInformationDetails',item)"
  61. style="width: 100%;height: 150px">
  62. <span>{{$i18n.locale=='zh'?i.unitZhName:i.unitEnName}}</span>
  63. <!-- <span><span>110</span>{{$t('common.visits')}}</span>-->
  64. </div>
  65. </div>
  66. </div>
  67. </template>
  68. <script>
  69. import {getBaseCooperationUnits} from "@/api/cooperation/baseCooperationUnit";
  70. import {gateGetUnitViewById} from "@/api/baseUnitView";
  71. export default {
  72. name: 'IntroductionPartnerInformation',
  73. data() {
  74. return {
  75. enterpriseDetails: this.$route.params.key,
  76. currentPage:1,
  77. params: {
  78. pageNo: 1,
  79. pageSize: 15,
  80. language: '',
  81. unitZhName: '',
  82. unitEnName: ''
  83. },
  84. memberUnits:{},
  85. page: {},
  86. searchName: '',
  87. total: 0,
  88. initData: [],
  89. selectData: [],
  90. recommendList:[],
  91. }
  92. },
  93. created() {
  94. // this.getInitData();
  95. // this.getinformation()
  96. },
  97. watch: {
  98. "$i18n.locale"() {
  99. this.get();
  100. }
  101. },
  102. mounted() {
  103. this.get();
  104. },
  105. methods: {
  106. get() {
  107. this.params.language = this.$i18n.locale.toUpperCase();
  108. getBaseCooperationUnits(this.params).then(res => {
  109. if (res.data) {
  110. this.total = res.data.page.totalCount;
  111. this.initData = res.data.baseCooperationUnits;
  112. this.memberUnits = res.data.memberUnits
  113. this.initData.forEach(element => {
  114. if(!element.photo){
  115. element.photo = "/def/enterpriseDefault.png"
  116. }
  117. });
  118. }
  119. })
  120. var params={
  121. pageNo: 1,
  122. pageSize: 4,
  123. language: this.$i18n.locale.toUpperCase(),
  124. recommendFlag:'y'
  125. }
  126. getBaseCooperationUnits(params).then(res => {
  127. if (res.data) {
  128. this.recommendList = res.data.baseCooperationUnits||[];
  129. this.recommendList.forEach(element=>{
  130. if(!element.photo){
  131. element.photo = "/def/cooperationDef.png"
  132. }
  133. })
  134. }
  135. })
  136. },
  137. getDatas() {
  138. const that = this
  139. that.selectData = []
  140. this.params.unitZhName = '';
  141. this.params.unitEnName = '';
  142. this.params.language = this.$i18n.locale;
  143. this.params.pageNo = 1;
  144. if (this.$i18n.locale === 'zh') {
  145. this.params.unitZhName = this.searchName;
  146. } else {
  147. this.params.unitEnName = this.searchName
  148. }
  149. // this.params.pageNo=1
  150. getBaseCooperationUnits(this.params).then(res => {
  151. console.log(res.data)
  152. if (Object.keys(res.data).length !==0) {
  153. this.total = res.data.page.totalCount;
  154. this.currentPage=1;
  155. this.initData = res.data.baseCooperationUnits;
  156. this.memberUnits = res.data.memberUnits
  157. // data_array = data_array.filter(function (item) {
  158. // console.log(item.unitZhName,this.searchName);
  159. // if (item.unitZhName.toUpperCase().indexOf(this.searchName) !== -1) {
  160. // that.selectData.push(item)
  161. // console.log(",,,,,,,,",that.selectData)
  162. // } else {
  163. // console.log('不一致')
  164. // }
  165. // })
  166. // if (this.params.pageNo < Math.ceil(this.total / this.params.pageSize)) {
  167. // this.params.pageNo += 1;
  168. // this.getDatas(this.searchName);
  169. // } else {
  170. // that.initData = that.selectData;
  171. // }
  172. } else {
  173. this.initData = [];
  174. this.total = 0;
  175. console.log('查询结束')
  176. return;
  177. }
  178. })
  179. },
  180. getIconUrl(url) {
  181. return require("@/assets/img/introductionCooperation/" + url);
  182. },
  183. getIconUrl2(url) {
  184. return require("@/assets/img/introductionCooperation/industry/" + url);
  185. },
  186. toView(router, json, index) {
  187. this.$router.push({
  188. name: router,
  189. query: {
  190. id: json.unitId,
  191. businessId: json.id,
  192. index: index
  193. },
  194. }
  195. )
  196. },
  197. toViewDetail(router,json){
  198. gateGetUnitViewById(json.unitId,this.$i18n.locale.toUpperCase()).then(res => {
  199. var data = res.data;
  200. if(data){
  201. var baseUnitView = res.data.baseUnitView;
  202. if(baseUnitView.showable == '1'){
  203. this.$store.commit('modify', 'enterpriseDetails');
  204. window.localStorage.setItem('router', 'enterpriseDetails');
  205. const { href } = this.$router.resolve({
  206. name: 'enterpriseDetails',
  207. query: {
  208. key: json.unitId
  209. }
  210. });
  211. window.open(href, '_blank');
  212. }else{
  213. if(data.isMember != undefined ){
  214. let member ={
  215. memberNameZh: data.isMember.memberNameZh,
  216. memberNameEn:data.isMember.memberNameEn,
  217. unitId:data.isMember.unitId,
  218. }
  219. this.$store.commit('modify', 'IntroductionPresentationDetails');
  220. window.localStorage.setItem('router', 'IntroductionPresentationDetails');
  221. const { href } = this.$router.resolve({
  222. name: 'IntroductionPresentationDetails',
  223. query: {
  224. key: data.isMember.id,
  225. member: JSON.stringify(member)
  226. }
  227. });
  228. window.open(href, '_blank');
  229. }else{
  230. if(json.showFlag === 'y'){
  231. this.$store.commit('modify', router);
  232. window.localStorage.setItem('router', router);
  233. const { href } = this.$router.resolve({
  234. name: router,
  235. query: {
  236. key: json.id,
  237. }
  238. });
  239. window.open(href, '_blank');
  240. }else if(baseUnitView.officialWebsitePath){
  241. var url = baseUnitView.officialWebsitePath;
  242. if(url.indexOf('http') == -1){
  243. url = 'http://' + url
  244. }
  245. window.open(url,'_blank')
  246. }else{
  247. return
  248. }
  249. }
  250. }
  251. }
  252. })
  253. },
  254. handleCurrentChange(val) {
  255. this.params.pageNo = val;
  256. this.get();
  257. },
  258. screenBack(data) {
  259. console.log(data, 'screenBackscreenBackscreenBackscreenBack')
  260. },
  261. screen(i) {
  262. this.index = i
  263. }
  264. }
  265. }
  266. </script>
  267. <!-- Add "scoped" attribute to limit CSS to this component only -->
  268. <style scoped>
  269. .box {
  270. margin-top: 10px;
  271. background: #fff;
  272. /* height: 500px; */
  273. padding: 20px 0;
  274. }
  275. .crumbs {
  276. margin-left: 20px;
  277. }
  278. body {
  279. margin: 0;
  280. }
  281. .box1 >>> .el-input__inner {
  282. height: 40px !important;
  283. border-radius: 22px 0 0 22px;
  284. }
  285. .box1 >>> .el-input-group__prepend {
  286. border-radius: 22px 0 0 22px;
  287. background: #fff;
  288. }
  289. .box1 >>> .el-input-group__prepend {
  290. background-color: #fff;
  291. color: #000;
  292. }
  293. .box1 >>> .el-input-group {
  294. border-radius: 20px;
  295. }
  296. .continents ul {
  297. text-align: top;
  298. /*display: flex;*/
  299. /*display: -webkit-flex; !* Safari *!*/
  300. /*justify-content:space-between;*/
  301. /*flex-wrap:wrap;*/
  302. }
  303. .continents ul li {
  304. border: 1px solid #f1f1f1;
  305. display: inline-block;
  306. box-shadow: 5px 5px 5px #f1f1f1;
  307. margin-bottom: 10px;
  308. color: #5878a2;
  309. border-radius: 5px;
  310. text-overflow: ellipsis;
  311. white-space: nowrap;
  312. overflow: hidden;
  313. width: 364px;
  314. margin-right: 10px;
  315. height: 35px;
  316. line-height: 35px;
  317. text-align: left;
  318. padding-left: 10px;
  319. }
  320. .continents ul li:hover {
  321. border: 1px solid #e36844;
  322. }
  323. .continents ul li:active {
  324. background: #e36844;
  325. color: #fff;
  326. }
  327. .recommended {
  328. width: 95%;
  329. height: 180px;
  330. display: flex;
  331. justify-content: space-between;
  332. flex-wrap: wrap;
  333. overflow: hidden;
  334. margin-bottom: 30px;
  335. padding: 0 30px;
  336. text-align: center;
  337. }
  338. .box1 >>> .el-input-group__append {
  339. border-radius: 0 22px 22px 0;
  340. background-color: #fff;
  341. }
  342. </style>