organsList.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. <template>
  2. <view class="organsList">
  3. <view class="icoStyle">
  4. <view style="width:90%;height:99upx">
  5. <rf-search-bar @search="navToSearch" icon="iconkuaijiecaidan" style="z-index: 99;" />
  6. </view>
  7. </view>
  8. <PageMenu :currentIndex="0" />
  9. <view class="selectData">
  10. <view class="newfollow" :class="{active:menuIndex==0}" @click="getDatas(0)">{{$t('common.LatestUpdated')}}
  11. </view>
  12. <view class="followmost" :class="{active:menuIndex==1}" @click="getDatas(1)">{{$t('common.MostAttention')}}
  13. </view>
  14. <view class="selection">
  15. <view class="showstyle">
  16. <u-icon v-if="styleFlag" name="list-dot" @click="styleFlag=!styleFlag" color="#aaa" size="28">
  17. </u-icon>
  18. <u-icon v-if="!styleFlag" name="grid" @click="styleFlag=!styleFlag" color="#aaa" size="28"></u-icon>
  19. </view>
  20. <text class="text"></text>
  21. <view class="check" @click="showDia">
  22. <view class="text">{{$t('common.Screening')}}</view>
  23. <!-- <image class="img" src="../../../static/check.png" mode="widthFix"></image> -->
  24. </view>
  25. </view>
  26. </view>
  27. <!-- 筛选弹窗 -->
  28. <u-popup v-model="DiaFlag" mode="right" length="88%" border-radius="10" :closeable="true">
  29. <view class="diacontent">
  30. <view class="diatitle">{{$t('common.Screening')}}</view>
  31. <view class="titleTtype">{{$t('common.Region')}}</view>
  32. <view class="zone">
  33. <view class="zoneitem" v-for="(zoneitem,zoneidx) in zoneList" :key="zoneidx"
  34. :class="{active:zoneCurrentIndex==(zoneidx)}"
  35. @click="checkItemSingle(zoneidx,'zoneCurrentIndex')">
  36. {{$t(zoneitem.title)}}
  37. </view>
  38. </view>
  39. <view class="titleTtype">{{$t('common.Type')}}</view>
  40. <view class="zone">
  41. <view class="zoneitem" v-for="(zoneitem,zoneidx) in typeList" :key="zoneidx"
  42. :class="{active:typeCurrentIndex==zoneidx}"
  43. @click="checkItemSingle(zoneidx,'typeCurrentIndex')">{{$t(zoneitem.label)}}</view>
  44. </view>
  45. <!-- <view class="titleTtype">按产品</view>
  46. <view class="zone">
  47. <view class="zoneitem"
  48. v-for="(zoneitem,zoneidx) in proList"
  49. :key="zoneidx"
  50. :class="{active:proCheckedList.indexOf(zoneitem.id)!=-1}"
  51. @click="checkItem(zoneitem,'proCheckedList')">{{zoneitem.title}}</view>
  52. </view> -->
  53. <view class="btn">
  54. <view class="reset" @click="commitBtn('reset')" :class="{active:btnActive=='reset'}">
  55. {{$t('common.reset')}}
  56. </view>
  57. <view class="commit" @click="commitBtn('commit')" :class="{active:btnActive=='commit'}">
  58. {{$t('common.mConfirm')}}
  59. </view>
  60. </view>
  61. </view>
  62. </u-popup>
  63. <view class="myDatalist" style="margin-top:10upx;display:flex;">
  64. <view class="titlelist" style="width:60upx">
  65. <view class="titleitem" v-for="(titleitem,titleidx) in indexList" :key="titleidx"
  66. :class="{active:titleitem==titleIndex}" @click="checkWord(titleitem)">{{titleitem}}</view>
  67. </view>
  68. <view class="content" style="width:92%">
  69. <view v-for="(item, index) in indexList" :key="index">
  70. <view class="dataList" v-if="item=='A'" :class="{flex:!styleFlag}">
  71. <view class="list-cell" v-for="(dataitem,dataindex) in listA" :key="dataindex"
  72. :class="{flex:!styleFlag}" @click="showDetial(dataitem)">
  73. <view class="icon" v-if="styleFlag">
  74. <image v-if="dataitem.photo" class="img" :src="dataitem.photo"
  75. @error="showDefaultThumb(dataitem)" mode="widthFix"></image>
  76. <image v-if="!dataitem.photo" class="img" :src="defaultThumb" mode="widthFix"></image>
  77. </view>
  78. <view class="info" v-if="styleFlag">
  79. <view class="title">{{dataitem.unitName}}</view>
  80. <view class="city">{{dataitem.unitCountry}} </view>
  81. </view>
  82. <view class="box" v-if="!styleFlag"> {{dataitem.unitName}}</view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. <u-back-top :scrollTop="scrollTop" mode="circle" :icon-style="{fontSize:'32rpx',color:'#aaa'}"></u-back-top>
  89. <u-toast ref="uToast" />
  90. </view>
  91. </template>
  92. <script>
  93. import {
  94. getBaseFinancialInstitutionInfos
  95. } from "@/api/financialService/baseFinancialInstitutionInfo";
  96. import {
  97. getDicts
  98. } from '@/api/dict'
  99. import rfSearchBar from '@/components/rf-search-bar-xiangmu';
  100. import BackTop from '@/components/rf-back-top'
  101. import PageMenu from '../dom/pageMenu'
  102. export default {
  103. components: {
  104. rfSearchBar,
  105. PageMenu,
  106. BackTop
  107. },
  108. data() {
  109. return {
  110. titleIndex: '',
  111. menuIndex: 0,
  112. scrollTop: 0,
  113. totalPage: '0',
  114. count: 0,
  115. defaultThumb: 'https://m.geidcp.com/api/file/pub/unit/2020/09/22/a1ba37db5765439ea57e82ae074b239a.png',
  116. keyword: '',
  117. styleFlag: true,
  118. icon: '../../../static/apple.png',
  119. DiaFlag: false,
  120. btnActive: 'reset',
  121. pageNo: 1,
  122. pageSize: 20,
  123. sortType: 0,
  124. zoneList: [{
  125. id: 0,
  126. title: 'common.All'
  127. },
  128. {
  129. id: 1,
  130. title: 'common.Domestic'
  131. },
  132. {
  133. id: 2,
  134. title: 'common.International'
  135. }
  136. ],
  137. zoneCurrentIndex: 0,
  138. zoneCheckedList: [],
  139. typeCurrentIndex: 0,
  140. typeList: [],
  141. typeCheckedList: [],
  142. proList: [{
  143. id: 0,
  144. title: '全部'
  145. },
  146. {
  147. id: 1,
  148. title: '政策性及开发性金融机构'
  149. },
  150. {
  151. id: 2,
  152. title: '担保机构'
  153. },
  154. {
  155. id: 3,
  156. title: '商业银行'
  157. },
  158. {
  159. id: 4,
  160. title: '基金等投资机构'
  161. },
  162. ],
  163. proCheckedList: [],
  164. indexList: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S",
  165. "T", "U", "V", "W", "X", "Y", "Z", "#"
  166. ],
  167. listA: [],
  168. }
  169. },
  170. // 页面滚动到底部的时候加载更多数据
  171. onReachBottom(e) {
  172. if (this.pageNo < this.totalPage) {
  173. this.pageNo++;
  174. this.getMore();
  175. } else {
  176. let msg = this.$i18n.locale == 'zh' ? '没有更多数据了' : 'No more data'
  177. if (this.count == 0) this.$refs.uToast.show({
  178. title: msg,
  179. type: 'success',
  180. })
  181. this.count++;
  182. }
  183. },
  184. onLoad(e) {
  185. uni.showLoading({
  186. title: this.$i18n.locale == 'zh' ? '加载中...' : 'Loading...'
  187. });
  188. this.title = this.$i18n.locale == 'zh' ? '机构详情' : 'InvestmentGuide Detial'
  189. setTimeout(() => {
  190. uni.hideLoading();
  191. }, 100)
  192. },
  193. created() {
  194. this.getBaseFinancialInstitutionInfos();
  195. },
  196. methods: {
  197. // 获取数据列表
  198. async getBaseFinancialInstitutionInfos(sortType) {
  199. let params = {
  200. pageSize: this.pageSize,
  201. pageNo: this.pageNo,
  202. language: this.$i18n.locale.toUpperCase(),
  203. sortType: sortType ? sortType : 0
  204. }
  205. const res = await this.$myRequest({
  206. url: '/project/baseFinancialInstitutionInfos/',
  207. data: params
  208. })
  209. if (res.data) {
  210. if (res.data.baseFinancialInstitutionInfos) {
  211. this.listA = res.data.baseFinancialInstitutionInfos;
  212. for (let i = 0; i < this.listA.length; i++) {
  213. this.$set(this.listA[i], 'photo', 'https://m.geidcp.com/api/file/pub/' + this.listA[i][
  214. 'photo'
  215. ])
  216. }
  217. this.totalPage = parseFloat(res.data.page.totalPage);
  218. } else {
  219. this.listA = []
  220. this.menuIndex = -1;
  221. }
  222. }
  223. },
  224. // 加载更多
  225. async getMore() {
  226. let params = {
  227. pageSize: this.pageSize,
  228. pageNo: this.pageNo,
  229. language: this.$i18n.locale.toUpperCase(),
  230. sortType: this.sortType
  231. }
  232. const res = await this.$myRequest({
  233. url: '/project/baseFinancialInstitutionInfos/',
  234. data: params
  235. });
  236. if (res.data.baseFinancialInstitutionInfos) {
  237. this.listA = [...this.listA, ...res.data.baseFinancialInstitutionInfos];
  238. for (let i = 0; i < this.listA.length; i++) {
  239. this.$set(this.listA[i], 'photo', 'https://m.geidcp.com/api/file/pub/' + this.listA[i][
  240. 'photo'
  241. ])
  242. }
  243. }
  244. },
  245. //获取筛选类型
  246. async getDicts(paramsType) {
  247. const ditres = await this.$myRequest({
  248. url: '/sys/sysDicts',
  249. data: {
  250. type: this.$i18n.locale == 'zh' ? 'FINANCIAL_INSTITUTIONS_TYPE_DICT' :
  251. 'FINANCIAL_INSTITUTIONS_TYPE_DICT_EN'
  252. }
  253. });
  254. if (ditres.msg == 'ok') {
  255. this.typeList = ditres.data[0];
  256. this.$nextTick(() => {
  257. this.typeList.unshift({
  258. id: 0,
  259. label: 'common.All'
  260. })
  261. })
  262. }
  263. },
  264. //路由后退一步
  265. back() {
  266. // #ifdef H5
  267. history.back()
  268. // #endif
  269. // #ifndef H5
  270. uni.navigateBack({})
  271. // #endif
  272. },
  273. //搜索
  274. navToSearch(keyword) {
  275. uni.navigateTo({
  276. url: '/pages/index/search/search?data=' + keyword
  277. })
  278. },
  279. //查看详情
  280. showDetial(item) {
  281. uni.navigateTo({
  282. url: '/pages/financialService/financialOrgans/organsDetial?baseEntityId=' + item.baseEntityId
  283. })
  284. },
  285. //索引值
  286. async checkWord(item) {
  287. if (this.titleIndex != item) {
  288. this.titleIndex = item;
  289. let keyparams = {
  290. pageSize: this.pageSize,
  291. pageNo: 1,
  292. language: this.$i18n.locale.toUpperCase(),
  293. sortType: this.menuIndex,
  294. region: this.zoneCurrentIndex == 0 ? null : this.zoneCurrentIndex - 1,
  295. institutionTypeDict: this.typeCurrentIndex == 0 ? null : this.typeCurrentIndex, // 地区
  296. initial: this.titleIndex == '' ? null : this.titleIndex,
  297. Initials: this.titleIndex == '' ? null : this.titleIndex
  298. }
  299. const res = await this.$myRequest({
  300. url: '/project/baseFinancialInstitutionInfos/',
  301. data: keyparams,
  302. });
  303. if (res.data.baseFinancialInstitutionInfos) {
  304. this.listA = res.data.baseFinancialInstitutionInfos;
  305. for (let i = 0; i < this.listA.length; i++) {
  306. this.$set(this.listA[i], 'photo', 'https://m.geidcp.com/api/file/pub/' + this.listA[i][
  307. 'photo'
  308. ])
  309. }
  310. this.totalPage = parseFloat(res.data.page.totalPage);
  311. } else {
  312. this.listA = [];
  313. this.menuIndex = 0;
  314. }
  315. }
  316. },
  317. getDatas(type) {
  318. if (this.menuIndex != type) {
  319. this.pageNo = 1;
  320. this.menuIndex = type;
  321. this.titleIndex = '';
  322. this.getBaseFinancialInstitutionInfos(type)
  323. }
  324. },
  325. //打开弹窗
  326. showDia() {
  327. this.getDicts();
  328. this.pageNo = 1;
  329. this.zoneCurrentIndex = 0;
  330. this.typeCurrentIndex = 0;
  331. this.DiaFlag = true;
  332. this.titleIndex = '';
  333. },
  334. //切换操作类型表单
  335. commitBtn(type) {
  336. if (this.btnActive != type) this.btnActive = type;
  337. if (type == 'reset') {
  338. this.pageNo = 1;
  339. this.zoneCurrentIndex = 0;
  340. this.typeCurrentIndex = 0;
  341. } else {
  342. this.submitForm()
  343. }
  344. },
  345. // 选择标签-单选
  346. checkItemSingle(item, checkedIndex) {
  347. if (this[checkedIndex] != item) {
  348. this[checkedIndex] = item
  349. }
  350. },
  351. // 选择标签-多选
  352. checkItem(item, checkedList) {
  353. if (this[checkedList].indexOf(item.id) == -1) {
  354. this[checkedList].push(item.id)
  355. } else {
  356. this[checkedList] = this[checkedList].filter((val, key) => {
  357. return item.id != val;
  358. })
  359. }
  360. },
  361. //提交表单-重置
  362. async submitForm() {
  363. let params = {
  364. pageSize: this.pageSize,
  365. pageNo: this.pageNo,
  366. language: this.$i18n.locale,
  367. sortType: this.menuIndex, // 最新或最多
  368. region: this.zoneCurrentIndex == 0 ? null : this.zoneCurrentIndex - 1, // 地区
  369. institutionTypeDict: this.typeCurrentIndex == 0 ? null : this.typeCurrentIndex, // 类型
  370. initial: this.titleIndex == '' ? null : this.titleIndex, // 字母
  371. Initials: this.titleIndex == '' ? null : this.titleIndex // 字母
  372. }
  373. let res = await this.$myRequest({
  374. url: '/project/baseFinancialInstitutionInfos/',
  375. data: params
  376. });
  377. if (res.data.baseFinancialInstitutionInfos) {
  378. this.listA = res.data.baseFinancialInstitutionInfos;
  379. for (let i = 0; i < this.listA.length; i++) {
  380. this.$set(this.listA[i], 'photo', 'https://m.geidcp.com/api/file/pub/' + this.listA[i][
  381. 'photo'
  382. ])
  383. }
  384. this.totalPage = parseFloat(res.data.page.totalPage);
  385. } else {
  386. this.listA = [];
  387. // this.menuIndex=-1;
  388. }
  389. this.DiaFlag = false;
  390. this.zoneCurrentIndex = 0;
  391. this.typeCurrentIndex = 0;
  392. this.titleIndex = '';
  393. },
  394. scroll(e) {
  395. this.old.scrollTop = e.detail.scrollTop
  396. },
  397. showDefaultThumb(item) {
  398. this.$set(item, 'photo', this.defaultThumb)
  399. },
  400. i18n(data) {
  401. return this.$t('common.' + data);
  402. },
  403. onPageScroll(e) {
  404. this.scrollTop = e.scrollTop;
  405. }
  406. }
  407. }
  408. </script>
  409. <style lang="scss" scoped>
  410. .icoStyle {
  411. display: flex;
  412. align-items: center;
  413. .leftArrow {
  414. /* #ifdef APP-PLUS */
  415. padding-top: calc(28upx + var(--status-bar-height));
  416. /* #endif */
  417. .text {
  418. color: #fff;
  419. }
  420. }
  421. }
  422. /deep/ .u-index-anchor {
  423. padding: 0;
  424. }
  425. /deep/ .u-index-bar__sidebar {
  426. top: 58%;
  427. z-index: 9999;
  428. }
  429. .list-cell {
  430. display: flex;
  431. align-items: flex-start;
  432. box-sizing: border-box;
  433. padding: 10px 24upx;
  434. overflow: hidden;
  435. color: #323233;
  436. font-size: 14px;
  437. line-height: 24px;
  438. background-color: #fff;
  439. .box {
  440. border: 1px solid #ddd;
  441. padding: 0 10upx;
  442. }
  443. .icon {
  444. width: 140upx;
  445. height: 140upx;
  446. margin-right: 20upx;
  447. .img {
  448. width: 100%;
  449. display: block;
  450. margin-top: 10upx;
  451. }
  452. }
  453. .info {
  454. flex: 1;
  455. .title {
  456. font-weight: 700;
  457. }
  458. .city {
  459. margin-top: 30upx;
  460. color: #666;
  461. }
  462. }
  463. }
  464. .organsList {
  465. background: #fafafa;
  466. .dataList {
  467. &.flex {
  468. display: flex;
  469. width: 100%;
  470. background: #fff;
  471. flex-wrap: wrap;
  472. align-items: flex-start;
  473. .list-cell.flex {
  474. align-items: flex-start;
  475. }
  476. }
  477. }
  478. .selectData {
  479. display: flex;
  480. align-items: center;
  481. height: 80upx;
  482. line-height: 80upx;
  483. background-color: #fff;
  484. width: 100%;
  485. justify-content: space-around;
  486. color: #666;
  487. .followmost,
  488. .newfollow {
  489. &.active {
  490. color: #0079EF
  491. }
  492. }
  493. .selection {
  494. width: 150upx;
  495. display: flex;
  496. align-items: center;
  497. .text {
  498. color: #ddd;
  499. }
  500. .showstyle {
  501. .img {
  502. display: block;
  503. width: 36upx;
  504. height: 36upx;
  505. }
  506. }
  507. .check {
  508. display: flex;
  509. align-items: center;
  510. .text {
  511. margin-left: 20upx;
  512. color: #666;
  513. }
  514. .img {
  515. display: block;
  516. width: 32upx;
  517. height: 32upx;
  518. margin-left: 10upx;
  519. }
  520. }
  521. }
  522. }
  523. .diacontent {
  524. padding: 50upx 20upx 20upx 20upx;
  525. position: relative;
  526. overflow: hidden;
  527. height: 100%;
  528. .diatitle {
  529. font-weight: bold;
  530. height: 100upx;
  531. line-height: 100upx;
  532. margin-bottom: 20upx;
  533. }
  534. .zone {
  535. display: flex;
  536. align-items: center;
  537. margin: 20upx 0;
  538. flex-wrap: wrap;
  539. .zoneitem {
  540. padding: 10upx 30upx;
  541. background: #eee;
  542. margin: 10upx 10upx 0 0;
  543. color: #666;
  544. &.active {
  545. color: #09a0f2;
  546. background-color: #def;
  547. }
  548. }
  549. }
  550. .btn {
  551. display: flex;
  552. position: absolute;
  553. bottom: 0;
  554. width: 100%;
  555. height: 100upx;
  556. .reset,
  557. .commit {
  558. color: #007AFF;
  559. height: 100upx;
  560. line-height: 100upx;
  561. width: 47%;
  562. text-align: center;
  563. &.active {
  564. background: #007AFF;
  565. color: #fff;
  566. }
  567. }
  568. .reset {
  569. margin-right: 2upx;
  570. }
  571. }
  572. }
  573. .titlelist {
  574. width: 60upx;
  575. text-align: center;
  576. position: fixed;
  577. right: 0;
  578. top: 340upx;
  579. padding-top: 40upx;
  580. z-index: 99999;
  581. .titleitem {
  582. margin: 0 auto;
  583. width: 36upx;
  584. height: 36upx;
  585. line-height: 36upx;
  586. text-align: center;
  587. font-size: 20upx;
  588. &.active {
  589. color: #fff;
  590. background: #0081FF;
  591. border-radius: 50%;
  592. }
  593. }
  594. }
  595. }
  596. </style>