enterpriseList.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <template>
  2. <view>
  3. <!-- <u-index-list :scrollTop="scrollTop">
  4. <view v-for="(item, index) in indexList" :key="index">
  5. </view>
  6. </u-index-list> -->
  7. <!-- :options="options1" -->
  8. <!-- @change="dropdownChange" -->
  9. <u-navbar :back-text="i18n('Back')" :back-text-style="backStyle" back-icon-color="#fff" title-color="#fff"
  10. :title="i18n('EnterpriseShow')" :background="background">
  11. </u-navbar>
  12. <u-dropdown class="u-dropdown" style="background-color: #fff;width: 100%;">
  13. <u-dropdown-item v-model="value1" :title="i18n('Comprehensive')" :options="options1"
  14. @change="dropdownChange"></u-dropdown-item>
  15. <u-dropdown-item v-model="value2" :title="i18n('Region')" :options="Dict1" @change="dropdownChange">
  16. </u-dropdown-item>
  17. <u-dropdown-item v-model="value3" :title="i18n('UnitType')" :options="Dict2" @change="dropdownChange">
  18. </u-dropdown-item>
  19. </u-dropdown>
  20. <view @click="toView(item.baseEntityId)"
  21. style="margin: 20upx 20upx;height: 200upx;border-radius: 30upx;overflow: hidden;background-color: #fff;"
  22. v-for="(item,index) in infos">
  23. <img :src="websiteUrl+ item.photo" alt="" v-if="item.photo" style="width: 200upx;height: 200upx;">
  24. <img :src="websiteUrl+'/def/projectdefault.png'" alt="" v-else style="width: 200upx;height: 200upx;">
  25. <view class="recommend-bottom">
  26. <text class="recommend-bottom-name">
  27. {{item.unitName}}
  28. </text>
  29. <text class="tabs" v-if="item.recommendFlag=='y'">
  30. {{i18n('recommend2')}}
  31. </text>
  32. <view>
  33. <text>
  34. {{$i18n.locale === 'zh'?item.unitCountry:item.unitCountryDict.charAt(0).toUpperCase() + item.unitCountryDict.slice(1)}}
  35. </text>
  36. <!-- <text v-show="item.unitRegion"> - </text>
  37. <text>{{item.unitRegion}}</text> -->
  38. </view>
  39. <text v-for="(item,index) in item.labelList">
  40. <u-tag :text="item" mode="light" style="margin:10px 15upx 15upx 0upx;" v-if="index<3" />
  41. </text>
  42. <!-- <view>{{item.labelList}}</view> -->
  43. <!-- <view>发布日期:{{handlePublishTimeDesc(toDate,item.createDate,$i18n.locale)}} {{$t('common.release')}}</view> -->
  44. </view>
  45. <u-toast ref="uToast" />
  46. </view>
  47. <rf-back-top :scrollTop="scrollTop"></rf-back-top>
  48. </view>
  49. </template>
  50. <script>
  51. let timer = null
  52. export default {
  53. data() {
  54. return {
  55. options1: [{
  56. label: this.$t('common.LatestRelease'),
  57. value: 0,
  58. },
  59. {
  60. label: this.$t('common.MostAttention'),
  61. value: 1,
  62. }
  63. ],
  64. background: {
  65. backgroundImage: 'linear-gradient(270deg, #4BC0E2 0%, #538BE7 100%)',
  66. },
  67. backStyle: {
  68. color: '#fff'
  69. },
  70. // scrollTop: 0,
  71. // indexList: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U",
  72. // "V", "W", "X", "Y", "Z"],
  73. value1: 0,
  74. status: 'loadmore',
  75. scrollTop: 0,
  76. value2: null,
  77. value3: null,
  78. page: 1,
  79. Dict1: [],
  80. Dict2: [],
  81. infos: [],
  82. labels: [],
  83. pageNo: 1,
  84. }
  85. },
  86. onReady() {
  87. this.dict1();
  88. this.dict2();
  89. this.getList();
  90. },
  91. computed: {
  92. unitLabelList(label) {
  93. return label.toString().split(",");
  94. }
  95. },
  96. onLoad(options) {
  97. this.value1 = options.type
  98. },
  99. onPageScroll(e) {
  100. this.scrollTop = e.scrollTop;
  101. },
  102. // 加载更多
  103. onReachBottom() {
  104. if (this.page * 10 >= this.total2) return;
  105. this.status = 'loading';
  106. this.page = this.page + 1;
  107. if ((this.page - 1) * 10 >= this.total2) {
  108. this.status = 'nomore';
  109. } else {
  110. this.status = 'loading';
  111. this.getList(this.page);
  112. }
  113. },
  114. methods: {
  115. dropdownChange() {
  116. this.getList();
  117. },
  118. async dict1() {
  119. const res = await this.$myRequest({
  120. url: '/sys/sysDicts',
  121. data: {
  122. type: this.$i18n.locale == 'en' ? "CONTINENT_CODE_DICT_EN" : "CONTINENT_CODE_DICT"
  123. }
  124. });
  125. if (res.data) {
  126. let both = {
  127. label: this.$t('common.All'),
  128. value: null
  129. };
  130. this.Dict1 = res.data[0];
  131. this.Dict1.unshift(both);
  132. }
  133. },
  134. async dict2() {
  135. const res = await this.$myRequest({
  136. url: '/sys/sysDicts',
  137. data: {
  138. type: this.$i18n.locale == 'en' ? "INDUSTRY_DICTS_EN" : "INDUSTRY_DICTS"
  139. }
  140. });
  141. if (res.data) {
  142. res.data[0].forEach(item => {
  143. if (item.value == '06' || item.value == '09' || item.value == '11' || item.value ==
  144. '01' || item.value == '02' ||
  145. item.value == '04' || item.value == '05') {
  146. this.Dict2.push(item);
  147. }
  148. });
  149. let both = {
  150. label: this.$t('common.All'),
  151. value: null
  152. };
  153. this.Dict2.unshift(both);
  154. }
  155. },
  156. async getList() {
  157. const res = await this.$myRequest({
  158. url: '/project/baseUnitViews/',
  159. data: {
  160. pageSize: 10,
  161. pageNo: this.page,
  162. descStatus: this.value1,
  163. areDict: this.value2,
  164. industryDict: this.value3,
  165. language: this.$i18n.locale.toUpperCase()
  166. }
  167. });
  168. if (res.data) {
  169. res.data.baseUnitViews.forEach(item => {
  170. if (item.unitLabel) {
  171. item["labelList"] = item.unitLabel.split(",");
  172. } else {
  173. item["labelList"] = []
  174. }
  175. })
  176. this.total2 = res.data.page.totalCount;
  177. if (this.page == 1) {
  178. this.infos = res.data.baseUnitViews;
  179. } else {
  180. this.infos = this.infos.concat(res.data.baseUnitViews)
  181. }
  182. if (this.infos.length >= this.total2 - 0) {
  183. this.status = 'nomore';
  184. }
  185. }
  186. },
  187. toView(baseEntityId) {
  188. this.$mRouter.push({
  189. route: `/pages/country/enterprise/enterpriseDetail?baseEntityId=${baseEntityId}`
  190. });
  191. },
  192. i18n(data) {
  193. return this.$t('common.' + data);
  194. },
  195. }
  196. }
  197. </script>
  198. <style lang="scss" scoped>
  199. .recommend-bottom {
  200. float: right;
  201. height: 200upx;
  202. width: 488upx;
  203. position: relative;
  204. }
  205. .list-cell {
  206. display: flex;
  207. box-sizing: border-box;
  208. width: 100%;
  209. padding: 10px 24upx;
  210. overflow: hidden;
  211. color: #323233;
  212. font-size: 14px;
  213. line-height: 24px;
  214. background-color: #fff;
  215. }
  216. .tabs {
  217. padding: 5upx 10upx;
  218. border-radius: 10upx;
  219. color: #fff;
  220. position: absolute;
  221. top: 8upx;
  222. right: 10upx;
  223. font-size: 24upx;
  224. margin-top: 10upx;
  225. background-color: #fab019;
  226. }
  227. .tabs2 {
  228. padding: 10upx 20upx;
  229. border: #2B85E4 1px solid;
  230. border-radius: 10upx;
  231. color: #2B85E4;
  232. margin-top: 10upx;
  233. font-size: 1px;
  234. margin-left: 1upx;
  235. }
  236. .recommend-bottom-name {
  237. font-size: 30upx;
  238. font-family: PingFangSC-Medium, PingFang SC;
  239. font-weight: 500;
  240. // overflow: hidden;
  241. // -webkit-line-clamp: 1;
  242. // text-overflow: ellipsis;
  243. display: -webkit-box;
  244. width: 330upx;
  245. // -webkit-box-orient: vertical;
  246. color: #0B0B11;
  247. line-height: 45upx;
  248. margin-top: 30upx;
  249. vertical-align: top;
  250. }
  251. .recommend-bottom-name span {}
  252. </style>