resourceSharing.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032
  1. <template>
  2. <view class="rf-category" style="position: relative;">
  3. <!--搜索导航栏-->
  4. <!--<view class="icoStyle">
  5. <view class="leftArrow" @tap="back">
  6. <u-icon name="arrow-left" color="#fff" size="36"></u-icon>
  7. </view>
  8. <rf-search-bar @search="navToSearch" icon="iconkuaijiecaidan" />
  9. </view>-->
  10. <view class="icoStyle">
  11. <view style="width:90%;height:99upx">
  12. <rf-search-bar2 @search="inputValue" icon="iconkuaijiecaidan" :title= " i18n('return')" style="z-index: 99;" />
  13. </view>
  14. </view>
  15. <!-- 标签-->
  16. <view class="content">
  17. <view style="background-color: #fff;width: 100%;font-size: 24upx;">
  18. <u-tabs :list="tabList" :is-scroll="false" :current="current" @change="change" swiperWidth="750"
  19. bar-width="130" activeColor="rgb(24, 144, 255)"></u-tabs>
  20. </view>
  21. <view v-if="current==0">
  22. <!-- 推荐 -->
  23. <view style="width: 100%;height: 595upx;background-color: #fff;margin-top: 20upx;">
  24. <view style="width: 100%;height: 83upx;padding: 0 30upx;">
  25. <text style="float: left;font-size: 26upx;font-weight: 600;line-height: 83upx;color: #333333;">
  26. {{i18n('Recommend')}}
  27. </text>
  28. <view style="float: right;font-size: 24upx;font-weight: 400;line-height: 83upx;"
  29. @click="toList('resultRecommend')">
  30. <text style="color: #848485;">
  31. {{i18n('MoreInfo')}}
  32. </text>
  33. <u-icon name="arrow-right" color="#848485" size="20"
  34. style="font-size: 24upx;font-weight: 400;"></u-icon>
  35. </view>
  36. <view style="clear: both;"></view>
  37. </view>
  38. <view style="width: 100%;height: 410upx;padding: 0 30upx;">
  39. <view v-for="(item,index) in recommendList.results" :key="index" style="float: left;"
  40. @click="toDetaile(item.entityId,0)" :style="{marginLeft:index%3==0?'0upx':'18upx'}">
  41. <view style="width: 218upx;height: 280upx;">
  42. <image
  43. v-if="item.researchResultCover!='null'&&item.researchResultCover!=null&&item.researchResultCover!=''&&item.researchResultCover!=undefined"
  44. :src="websiteUrl+item.researchResultCover" mode=""
  45. style="width: 100%;height: 100%;"></image>
  46. <image v-else src="@/static/img/resourceSharing/backImage.png" mode=""
  47. style="width: 100%;height: 100%;"></image>
  48. </view>
  49. <view style="width: 218upx;height: 130upx;padding: 20upx 0;">
  50. <text style="font-size: 28upx; color: #0B0B11;" class="twoLine">
  51. {{item.name}}
  52. </text>
  53. </view>
  54. </view>
  55. <view style="clear: both;"></view>
  56. </view>
  57. <view style="width: 100%;height: 102upx;">
  58. <view
  59. style="width: 205upx;height: 72upx;border-radius: 36upx;background-color: #EBF3FF;margin: 0 auto;text-align: center;">
  60. <view @click="getRecommend1">
  61. <text style="font-size: 28upx;font-weight: 400;color: #3D7FFF;line-height: 72upx;">
  62. <text>{{i18n('ChangeTheBatch')}}</text>
  63. </text>
  64. <u-icon name="reload" color="#3D7FFF" size="28"></u-icon>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <!-- 热度top10 -->
  70. <view style="width: 100%;height: 353upx;background-color: #fff;margin-top: 20upx;">
  71. <view style="width: 100%;height: 83upx;padding: 0 30upx;">
  72. <text style="font-size: 26upx;font-weight: 600;line-height: 83upx;color: #333333;">
  73. {{i18n('resourceHeat')}}TOP10
  74. </text>
  75. </view>
  76. <view style="width: 100%;height: 270upx;padding: 0 0 60upx 0;">
  77. <!--列表横向滚动-->
  78. <scroll-view scroll-x="true" class="recommendScroll" style="height: 210upx">
  79. <block>
  80. <view v-for="(item,index) in heatList.results" :key="index" class="item"
  81. @click="toDetaile(item.entityId,0)"
  82. :style="{marginLeft:index==0?'20upx':'10upx',marginRight:index+1==heatList.results.length?'20upx':'10upx'}">
  83. <view
  84. style="width: 150upx;height: 193upx;float: left;margin: 8upx 13upx 9upx 8upx;">
  85. <image
  86. v-if="item.researchResultCover!='null'&&item.researchResultCover!=null&&item.researchResultCover!=''&&item.researchResultCover!=undefined"
  87. :src="websiteUrl+item.researchResultCover" mode=""
  88. style="width: 100%;height: 100%;"></image>
  89. <image v-else src="@/static/img/resourceSharing/backImage.png" mode=""
  90. style="width: 100%;height: 100%;"></image>
  91. </view>
  92. <view style="width: 224upx;height: 100%;padding-top: 9upx;float: left;">
  93. <view style="width: 100%;">
  94. <text
  95. style="font-size: 26upx; color: #0B0B11;display: inline-block;width: 100%;"
  96. class="oneLine">
  97. {{item.name}}
  98. </text>
  99. </view>
  100. <view style="width: 100%;">
  101. <text
  102. style="font-size: 22upx; color: #666666; line-height: 25upx;display: inline-block;width: 100%;"
  103. class="oneLine">
  104. {{item.affiliatedUnitName}}
  105. </text>
  106. </view>
  107. <view style="width: 100%;">
  108. <text
  109. style="padding: 0 13upx; font-size: 22upx; color: #666666;border-radius: 22upx;display: inline-block;border: 2upx solid #1777FE;color: #1777FE;">
  110. {{item.researchResultType}}
  111. </text>
  112. </view>
  113. </view>
  114. <view style="clear: both;"></view>
  115. </view>
  116. </block>
  117. </scroll-view>
  118. </view>
  119. </view>
  120. <!-- 列表 -->
  121. <view style="width: 100%;background-color: #fff;margin-top: 20upx;">
  122. <view style="width: 100%;s">
  123. <u-dropdown class="u-dropdown" ref="uDropdown1" style="background-color: #fff;width: 100%;">
  124. <u-dropdown-item v-model="value1" :title="i18n('Comprehensive')" @change="dropdownChange"
  125. :options="options" height="860upx"></u-dropdown-item>
  126. <u-dropdown-item :title="i18n('resourceType')" height="860upx">
  127. <view class="slot-content">
  128. <view class="item-box">
  129. <view v-for="(item, index) in options1" :key="index"
  130. :style="{width:index==0?'100%':''}">
  131. <view class="item" :class="[item.active ? 'active' : '']"
  132. :style="{display:index==0?'inline-block':''}" @tap="tagClick(index)">
  133. {{item.label}}
  134. </view>
  135. </view>
  136. </view>
  137. <!-- <u-button type="primary" @click="closeDropdown">{{i18n('OK')}}</u-button>-->
  138. </view>
  139. </u-dropdown-item>
  140. </u-dropdown>
  141. </view>
  142. <view style="width: 100%;padding: 0 30upx 1upx 30upx;">
  143. <view v-for="(item,index) in dataList.results" :key="index"
  144. style="width: 100%;height: 280upx;margin-bottom: 60upx;"
  145. @click="toDetaile(item.entityId,0)">
  146. <view
  147. style="width: 218upx;height: 280upx;float: left;border: 1upx solid #979797;margin-right: 20upx">
  148. <image
  149. v-if="item.researchResultCover!='null'&&item.researchResultCover!=null&&item.researchResultCover!=''&&item.researchResultCover!=undefined"
  150. :src="websiteUrl+item.researchResultCover" mode=""
  151. style="width: 100%;height: 100%;"></image>
  152. <image v-else src="@/static/img/resourceSharing/backImage.png" mode=""
  153. style="width: 100%;height: 100%;"></image>
  154. </view>
  155. <view style="width: 452upx;height: 100%;float: left;position: relative;">
  156. <view>
  157. <text style="font-size: 30upx; color: #0B0B11;" class="twoLine">
  158. {{item.name}}
  159. </text>
  160. </view>
  161. <view style="margin-top: 13upx;">
  162. <text style="font-size: 26upx; padding: 0 13upx; border: 2upx solid #1777FE;
  163. display: inline-block;border-radius: 32upx;color: #1777FE;">
  164. {{item.researchResultType}}
  165. </text>
  166. </view>
  167. <view v-show="item.informationVisibleStatus=='Y'" style="margin-top: 13upx;">
  168. <text style="font-size: 26upx; padding: 0 13upx; display: inline-block;
  169. border-radius: 12upx;background-color: rgba(61,127,255,0.1);color: #3D7FFF;">
  170. {{i18n('resourcevip')}}
  171. </text>
  172. </view>
  173. <view style="position: absolute;bottom: 0;width: 100%;height: 35upx;color: #666;">
  174. <view style="float: left;height: 100%">
  175. <text style="font-size: 28upx;">{{item.updateDate}}</text>
  176. </view>
  177. <view style="float: right;">
  178. <view style="float: left;font-size: 28upx;font-weight: 400;">
  179. <u-icon name="heart" color="#848485" size="28" style="margin-right: 6upx">
  180. </u-icon>
  181. <text v-if="item.num" style="color: #666;">
  182. {{item.num=='null'?'0':item.num}}
  183. </text>
  184. <text v-else style="color: #666;">
  185. 0
  186. </text>
  187. </view>
  188. <!--<view style="float: left;font-size: 28upx;font-weight: 400;margin-left: 70upx;">
  189. <u-icon name="arrow-right" color="#848485" size="28" style="margin-right: 6upx"></u-icon>
  190. <text style="color: #666;">
  191. 888
  192. </text>
  193. </view>-->
  194. </view>
  195. <view style="clear: both;"></view>
  196. </view>
  197. </view>
  198. <view style="clear: both;"></view>
  199. </view>
  200. <view style="margin-top: 20rpx;">
  201. <u-loadmore :status="dataList.resultsPage.status" :load-text="dataList.loadText" />
  202. </view>
  203. </view>
  204. </view>
  205. </view>
  206. <view v-if="current==1">
  207. <!-- 推荐 -->
  208. <view style="width: 100%;background-color: #fff;margin-top: 20upx;">
  209. <view style="width: 100%;height: 83upx;padding: 0 30upx;">
  210. <text style="float: left;font-size: 26upx;font-weight: 600;line-height: 83upx;color: #333333;">
  211. {{i18n('Recommend')}}
  212. </text>
  213. <view style="float: right;font-size: 24upx;font-weight: 400;line-height: 83upx;"
  214. @click="toList('resourceRecommend')">
  215. <text style="color: #848485;">
  216. {{i18n('MoreInfo')}}
  217. </text>
  218. <u-icon name="arrow-right" color="#848485" size="20"
  219. style="font-size: 24upx;font-weight: 400;"></u-icon>
  220. </view>
  221. <view style="clear: both;"></view>
  222. </view>
  223. <view style="width: 100%;padding: 0 30upx;">
  224. <view v-for="(item,index) in recommendList.resources" :key="index" style="float: left;"
  225. @click="toDetaile(item.entityId,1)" :style="{marginLeft:index%2==0?'0upx':'20upx'}">
  226. <view style="width: 335upx;height: 280upx;">
  227. <image
  228. v-if="item.researchResourcesMedia!='null'&&item.researchResourcesMedia!=null&&item.researchResourcesMedia!=''&&item.researchResourcesMedia!=undefined"
  229. :src="websiteUrl+item.researchResourcesMedia" mode=""
  230. style="width: 100%;height: 100%;"></image>
  231. <image v-else src="@/static/img/resourceSharing/lavle.png" mode=""
  232. style="width: 100%;height: 100%;"></image>
  233. </view>
  234. <view style="width: 335upx;height: 95upx;padding: 20upx 0 30upx 0;">
  235. <text style="font-size: 28upx; color: #0B0B11;" class="twoLine">
  236. {{item.name}}
  237. </text>
  238. </view>
  239. </view>
  240. <view style="clear: both;"></view>
  241. </view>
  242. <view style="width: 100%;height: 102upx;">
  243. <view
  244. style="width: 205upx;height: 72upx;border-radius: 36upx;background-color: #EBF3FF;margin: 0 auto;text-align: center;">
  245. <view @click="getRecommend2">
  246. <text style="font-size: 28upx;font-weight: 400;color: #3D7FFF;line-height: 72upx;">
  247. <text>{{i18n('ChangeTheBatch')}}</text>
  248. </text>
  249. <u-icon name="reload" color="#3D7FFF" size="20"></u-icon>
  250. </view>
  251. </view>
  252. </view>
  253. </view>
  254. <!-- 热度top10 -->
  255. <view style="width: 100%;height: 273upx;background-color: #fff;margin-top: 20upx;">
  256. <view style="width: 100%;height: 83upx;padding: 0 30upx;">
  257. <text style="font-size: 26upx;font-weight: 600;line-height: 83upx;color: #333333;">
  258. {{i18n('resourceHeat')}}TOP10
  259. </text>
  260. </view>
  261. <view style="width: 100%;height: 190upx;">
  262. <!--列表横向滚动-->
  263. <scroll-view scroll-x="true" class="recommendScroll" style="height: 160upx">
  264. <block>
  265. <view v-for="(item,index) in heatList.resources" :key="index" class="scroll-view-item_H"
  266. @click="toDetaile(item.entityId,1)"
  267. style="min-width: 446upx;height: 160upx;border: 1upx solid #979797;display: inline-block;vertical-align: top;"
  268. :style="{marginLeft:index==0?'20upx':'10upx',marginRight:index+1==heatList.results.length?'20upx':'10upx'}">
  269. <view
  270. style="width: 220upx;height: 140upx;float: left;margin: 10upx 20upx 10upx 10upx;">
  271. <image
  272. v-if="item.researchResourcesMedia!='null'&&item.researchResourcesMedia!=null&&item.researchResourcesMedia!=''&&item.researchResourcesMedia!=undefined"
  273. :src="websiteUrl+item.researchResourcesMedia" mode=""
  274. style="width: 100%;height: 100%;"></image>
  275. <image v-else src="@/static/img/resourceSharing/lavle.png" mode=""
  276. style="width: 100%;height: 100%;"></image>
  277. </view>
  278. <view
  279. style="min-width: 176upx;max-width:310upx;height: 100%;padding: 9upx 9upx 0 0;float: left;">
  280. <view style="width: 100%;height: 40upx;">
  281. <text
  282. style="font-size: 26upx; color: #0B0B11;display: inline-block;width: 100%;"
  283. class="oneLine">
  284. {{item.name}}
  285. </text>
  286. </view>
  287. <view style="width: 100%;height: 40upx;">
  288. <text
  289. style="font-size: 22upx; color: #666666; line-height: 25upx;display: inline-block;width: 100%;"
  290. class="oneLine">
  291. {{item.affiliatedUnitName}}
  292. </text>
  293. </view>
  294. <view style="width: 100%;">
  295. <text
  296. style="padding: 0 13upx; font-size: 22upx; color: #666666;border-radius: 22upx;display: inline-block;border: 2upx solid #1777FE;color: #1777FE;">
  297. {{item.researchResourcesType}}
  298. </text>
  299. </view>
  300. </view>
  301. <view style="clear: both;"></view>
  302. </view>
  303. </block>
  304. </scroll-view>
  305. </view>
  306. </view>
  307. <!-- 列表 -->
  308. <view style="width: 100%;background-color: #fff;margin-top: 20upx;">
  309. <view style="width: 100%; height: 86upx;">
  310. <u-dropdown class="u-dropdown" ref="uDropdown2" style="background-color: #fff;width: 100%;">
  311. <u-dropdown-item v-model="value2" :title="i18n('Comprehensive')" @change="dropdownChange"
  312. :options="options" height="860upx"></u-dropdown-item>
  313. <u-dropdown-item :title="i18n('resourceType')" height="860upx">
  314. <view class="slot-content">
  315. <view class="item-box">
  316. <view v-for="(item, index) in options2" :key="index"
  317. :style="{width:index==0?'100%':''}">
  318. <view class="item" :class="[item.active ? 'active' : '']"
  319. :style="{display:index==0?'inline-block':''}" @tap="tagClick(index)">
  320. {{item.label}}
  321. </view>
  322. </view>
  323. </view>
  324. <!-- <u-button type="primary" @click="closeDropdown">{{i18n('OK')}}</u-button>-->
  325. </view>
  326. </u-dropdown-item>
  327. </u-dropdown>
  328. </view>
  329. <view style="width: 100%;padding: 0 30upx;">
  330. <view v-for="(item,index) in dataList.resources" :key="index"
  331. style="width: 100%;height: 220upx;margin-bottom: 60upx" @click="toDetaile(item.entityId,1)">
  332. <view style="width: 270upx;height: 220upx;float: left;">
  333. <image
  334. v-if="item.researchResourcesMedia!='null'&&item.researchResourcesMedia!=null&&item.researchResourcesMedia!=''&&item.researchResourcesMedia!=undefined"
  335. :src="websiteUrl+item.researchResourcesMedia" mode=""
  336. style="width: 100%;height: 100%;"></image>
  337. <image v-else src="@/static/img/resourceSharing/lavle.png" mode=""
  338. style="width: 100%;height: 100%;"></image>
  339. </view>
  340. <view style="width: 390upx;height: 100%;float: left;margin-left: 30upx;position: relative;">
  341. <view>
  342. <text style="font-size: 30upx; color: #0B0B11;" class="twoLine">
  343. {{item.name}}
  344. </text>
  345. </view>
  346. <view>
  347. <text style="font-size: 20upx; color: #666666;" class="twoLine">
  348. {{item.affiliatedUnitName}}
  349. </text>
  350. </view>
  351. <view style="margin-top: 13upx;">
  352. <text style="font-size: 26upx; padding: 0 13upx; border: 2upx solid #1777FE;
  353. display: inline-block;border-radius: 32upx;color: #1777FE;">
  354. {{item.researchResourcesType}}
  355. </text>
  356. </view>
  357. <view style="position: absolute;bottom: 0;width: 100%;height: 35upx;color: #666;">
  358. <view style="float: left;height: 100%">
  359. <text style="font-size: 28upx;">{{item.updateDate}}</text>
  360. </view>
  361. <view style="float: right;">
  362. <view style="float: left;font-size: 28upx;font-weight: 400;">
  363. <u-icon name="heart" color="#848485" size="28" style="margin-right: 6upx">
  364. </u-icon>
  365. <text v-if="item.num" style="color: #666;">
  366. {{item.num=='null'?'0':item.num}}
  367. </text>
  368. <text v-else style="color: #666;">
  369. 0
  370. </text>
  371. </view>
  372. <!--<view style="float: left;font-size: 28upx;font-weight: 400;margin-left: 70upx;">
  373. <u-icon name="arrow-right" color="#848485" size="28" style="margin-right: 6upx"></u-icon>
  374. <text style="color: #666;">
  375. 888
  376. </text>
  377. </view>-->
  378. </view>
  379. <view style="clear: both;"></view>
  380. </view>
  381. </view>
  382. <view style="clear: both;"></view>
  383. </view>
  384. <view style="margin-top: 20rpx;">
  385. <u-loadmore :status="dataList.resourcesPage.status" :load-text="dataList.loadText" />
  386. </view>
  387. </view>
  388. </view>
  389. </view>
  390. </view>
  391. <rf-back-top :scrollTop="scrollTop"></rf-back-top>
  392. </view>
  393. </template>
  394. <script>
  395. import rfSearchBar from '@/components/rf-search-bar';
  396. import rfSearchBar2 from '@/components/rf-search-bar-xiangmu';
  397. export default {
  398. data() {
  399. return {
  400. // tab
  401. tabList: [{
  402. name: this.i18n('resource')
  403. },
  404. {
  405. name: this.i18n('researchResource')
  406. },
  407. ],
  408. // 字典
  409. classify1: '',
  410. classify2: '',
  411. // screen
  412. current: 0,
  413. // 推荐
  414. recommendList: {
  415. results: [],
  416. resultsPage: {
  417. pageNo: 0,
  418. totalPage: '',
  419. },
  420. resources: [],
  421. resourcesPage: {
  422. pageNo: 0,
  423. totalPage: '',
  424. },
  425. },
  426. // 热度TOP10
  427. heatList: {
  428. results: [],
  429. resources: [],
  430. },
  431. // 列表
  432. dataList: {
  433. results: [],
  434. resultsPage: {
  435. pageNo: 0,
  436. totalPage: 1,
  437. status: 'loading',
  438. isLoading: true,
  439. },
  440. resources: [],
  441. resourcesPage: {
  442. pageNo: 0,
  443. totalPage: 1,
  444. status: 'loading',
  445. isLoading: true,
  446. },
  447. loadText: {
  448. loading: this.$i18n.locale == 'zh' ? '加载中' : 'Loading',
  449. nomore: this.$i18n.locale == 'zh' ? '没有更多数据了' : 'No more'
  450. },
  451. },
  452. // 返回顶部
  453. scrollTop: 0,
  454. value1: '',
  455. value2: '',
  456. options: [{
  457. label: this.$i18n.locale == 'zh' ? '时间降序' : 'Time in descending order',
  458. value: 1,
  459. },
  460. // {
  461. // label: '时间升序',
  462. // value: 2,
  463. // },
  464. {
  465. label: this.$i18n.locale == 'zh' ? '热度降序' : 'Heat in descending order',
  466. value: 3,
  467. },
  468. // {
  469. // label: '热度升序',
  470. // value: 4,
  471. // }
  472. ],
  473. options1: [],
  474. options2: [],
  475. }
  476. },
  477. components: {
  478. rfSearchBar,
  479. rfSearchBar2
  480. },
  481. async onShow() {
  482. this.getList1()
  483. this.getList2()
  484. },
  485. onPageScroll(e) {
  486. this.scrollTop = e.scrollTop;
  487. },
  488. onReachBottom() { //页面拉到底部加载
  489. if (this.dataList.resultsPage.isLoading && this.current == 0) {
  490. if (this.value1 == 1) {
  491. this.getList1(0)
  492. }
  493. if (this.value1 == 3) {
  494. this.getList1(1)
  495. }
  496. }
  497. if (this.dataList.resourcesPage.isLoading && this.current == 1) {
  498. if (this.value2 == 1) {
  499. this.getList2(0)
  500. }
  501. if (this.value2 == 3) {
  502. this.getList2(1)
  503. }
  504. }
  505. },
  506. created() {
  507. this.getDict();
  508. this.getRecommend1();
  509. this.getRecommend2();
  510. this.getHeat1()
  511. this.getHeat2()
  512. },
  513. methods: {
  514. dropdownChange(index) {
  515. this.dataList.resultsPage.pageNo = 0;
  516. this.dataList.results = [];
  517. this.dataList.resourcesPage.pageNo = 0;
  518. this.dataList.resources = [];
  519. if (index == 1) {
  520. this.getList1(0)
  521. this.getList2(0)
  522. }
  523. if (index == 3) {
  524. this.getList1(1)
  525. this.getList2(1)
  526. }
  527. },
  528. closeDropdown() {
  529. const that = this;
  530. this.dataList.resultsPage.pageNo = 0;
  531. this.dataList.results = [];
  532. this.dataList.resourcesPage.pageNo = 0;
  533. this.dataList.resources = [];
  534. if (that.current == 0) {
  535. that.options1.forEach((i) => {
  536. if (i.active == true) {
  537. if (that.value1) {
  538. if (that.value1 == 1) {
  539. that.getList1(0, i.value)
  540. }
  541. if (that.value1 == 3) {
  542. that.getList1(1, i.value)
  543. }
  544. } else {
  545. that.getList1(0, i.value)
  546. }
  547. }
  548. })
  549. that.$refs.uDropdown1.close();
  550. }
  551. if (that.current == 1) {
  552. that.options2.forEach((i) => {
  553. if (i.active == true) {
  554. if (that.value2) {
  555. if (that.value2 == 1) {
  556. that.getList2(0, i.value)
  557. }
  558. if (that.value2 == 3) {
  559. that.getList2(1, i.value)
  560. }
  561. } else {
  562. that.getList2(0, i.value)
  563. }
  564. }
  565. })
  566. that.$refs.uDropdown2.close();
  567. }
  568. },
  569. tagClick(index) {
  570. if (this.current == 0) {
  571. this.options1.forEach((i) => {
  572. i.active = false;
  573. })
  574. this.options1[index].active = !this.options1[index].active;
  575. }
  576. if (this.current == 1) {
  577. this.options2.forEach((i) => {
  578. i.active = false;
  579. })
  580. this.options2[index].active = !this.options2[index].active;
  581. }
  582. this.closeDropdown()
  583. },
  584. // tab栏切换
  585. change(index) {
  586. this.current = index;
  587. },
  588. // 跳转列表
  589. toList(path) {
  590. uni.navigateTo({
  591. url: '/pages/resourceSharing/' + path
  592. })
  593. },
  594. // 跳转详情
  595. toDetail(path) {
  596. uni.navigateTo({
  597. url: '/pages/resourceSharing/' + path
  598. })
  599. },
  600. async getDict() {
  601. const res = await this.$myRequest({
  602. url: '/sys/sysDicts',
  603. data: {
  604. type: this.$i18n.locale == "zh" ?
  605. 'RESEARCH_RESULT_TYPE_DICT,RESEARCH_RESOURCE_TYPE_DICT' :
  606. 'RESEARCH_RESULT_TYPE_DICT_EN,RESEARCH_RESOURCE_TYPE_DICT_EN',
  607. }
  608. });
  609. if (res.data) {
  610. let both = {
  611. label: this.$t('common.All'),
  612. value: null,
  613. active: true,
  614. };
  615. this.classify1 = res.data[0];
  616. this.classify2 = res.data[1];
  617. this.classify1.forEach((i) => {
  618. this.$set(i, 'active', false)
  619. })
  620. this.classify2.forEach((i) => {
  621. this.$set(i, 'active', false)
  622. })
  623. this.classify1.unshift(both);
  624. this.classify2.unshift(both);
  625. this.options1 = this.classify1;
  626. this.options2 = this.classify2;
  627. }
  628. },
  629. async getRecommend1() {
  630. const that = this;
  631. let params = {
  632. pageNo: '',
  633. pageSize: 3,
  634. language: this.$i18n.locale.toUpperCase(),
  635. status: 0,
  636. descStatus: 0,
  637. reserveTwo: 'Y',
  638. }
  639. if (this.recommendList.resultsPage.pageNo >= this.recommendList.resultsPage.totalPage) {
  640. this.recommendList.resultsPage.pageNo = 0
  641. }
  642. this.recommendList.resultsPage.pageNo++;
  643. params.pageNo = this.recommendList.resultsPage.pageNo;
  644. const res = await this.$myRequest({
  645. url: '/resourceshare/baseResearchResultViews/',
  646. data: {
  647. ...params
  648. }
  649. })
  650. if (res.data) {
  651. that.recommendList.results = res.data.baseResearchResultViews;
  652. that.recommendList.results.forEach((i) => {
  653. i.updateDate = i.updateDate ? this.formatDate(i.updateDate, "YYYY-MM-DD") : "";
  654. })
  655. for (let i = 0; i < that.recommendList.results.length; i++) {
  656. for (let o = 0; o < that.classify1.length; o++) {
  657. if (that.recommendList.results[i].researchResultType == that.classify1[o].value) {
  658. that.recommendList.results[i].researchResultType = that.classify1[o].label;
  659. }
  660. }
  661. }
  662. this.recommendList.resultsPage.totalPage = res.data.page.totalPage;
  663. }
  664. },
  665. async getRecommend2() {
  666. const that = this;
  667. let params = {
  668. pageNo: '',
  669. pageSize: 4,
  670. language: this.$i18n.locale.toUpperCase(),
  671. status: 0,
  672. descStatus: 0,
  673. effective: 'Y',
  674. };
  675. if (this.recommendList.resourcesPage.pageNo >= this.recommendList.resourcesPage.totalPage) {
  676. this.recommendList.resourcesPage.pageNo = 0
  677. }
  678. this.recommendList.resourcesPage.pageNo++;
  679. params.pageNo = this.recommendList.resultsPage.pageNo;
  680. const res = await this.$myRequest({
  681. url: '/resourceshare/baseResearchResourcesViews/',
  682. data: {
  683. ...params
  684. }
  685. })
  686. if (res.data) {
  687. that.recommendList.resources = res.data.baseResearchResourcesViews;
  688. that.recommendList.resources.forEach((i) => {
  689. i.updateDate = i.updateDate ? this.formatDate(i.updateDate, "YYYY-MM-DD") : "";
  690. if (i.researchResourcesMedia) {
  691. i.researchResourcesMedia = i.researchResourcesMedia.split(',')
  692. i.researchResourcesMedia = i.researchResourcesMedia[0]
  693. }
  694. })
  695. for (let i = 0; i < that.recommendList.resources.length; i++) {
  696. for (let o = 0; o < that.classify2.length; o++) {
  697. if (that.recommendList.resources[i].researchResourcesType == that.classify2[o].value) {
  698. that.recommendList.resources[i].researchResourcesType = that.classify2[o].label;
  699. }
  700. }
  701. }
  702. this.recommendList.resourcesPage.totalPage = res.data.page.totalPage;
  703. }
  704. },
  705. async getHeat1() {
  706. const that = this;
  707. let params = {
  708. pageNo: 1,
  709. pageSize: 10,
  710. language: this.$i18n.locale.toUpperCase(),
  711. status: 0,
  712. descStatus: 1,
  713. reserveTwo: 'Y',
  714. }
  715. const res = await this.$myRequest({
  716. url: '/resourceshare/baseResearchResultViews/',
  717. data: {
  718. ...params
  719. }
  720. })
  721. if (res.data) {
  722. that.heatList.results = res.data.baseResearchResultViews;
  723. that.heatList.results.forEach((i) => {
  724. i.updateDate = i.updateDate ? this.formatDate(i.updateDate, "YYYY-MM-DD") : "";
  725. })
  726. for (let i = 0; i < that.heatList.results.length; i++) {
  727. for (let o = 0; o < that.classify1.length; o++) {
  728. if (that.heatList.results[i].researchResultType == that.classify1[o].value) {
  729. that.heatList.results[i].researchResultType = that.classify1[o].label;
  730. }
  731. }
  732. }
  733. }
  734. },
  735. async getHeat2() {
  736. const that = this;
  737. let params = {
  738. pageNo: 1,
  739. pageSize: 10,
  740. language: this.$i18n.locale.toUpperCase(),
  741. status: 0,
  742. descStatus: 1,
  743. effective: 'Y',
  744. };
  745. const res = await this.$myRequest({
  746. url: '/resourceshare/baseResearchResourcesViews/',
  747. data: {
  748. ...params
  749. }
  750. })
  751. if (res.data) {
  752. that.heatList.resources = res.data.baseResearchResourcesViews;
  753. that.heatList.resources.forEach((i) => {
  754. i.updateDate = i.updateDate ? this.formatDate(i.updateDate, "YYYY-MM-DD") : "";
  755. if (i.researchResourcesMedia) {
  756. i.researchResourcesMedia = i.researchResourcesMedia.split(',')
  757. i.researchResourcesMedia = i.researchResourcesMedia[0]
  758. }
  759. })
  760. for (let i = 0; i < that.heatList.resources.length; i++) {
  761. for (let o = 0; o < that.classify2.length; o++) {
  762. if (that.heatList.resources[i].researchResourcesType == that.classify2[o].value) {
  763. that.heatList.resources[i].researchResourcesType = that.classify2[o].label;
  764. }
  765. }
  766. }
  767. }
  768. },
  769. async getList1(descStatus, type) {
  770. const that = this;
  771. let params = {
  772. pageNo: '',
  773. pageSize: 10,
  774. language: this.$i18n.locale.toUpperCase(),
  775. status: 0,
  776. descStatus: 0,
  777. reserveTwo: 'Y',
  778. }
  779. if (descStatus) {
  780. params.descStatus = 1;
  781. }
  782. if (type) {
  783. params.researchResultType = type
  784. }
  785. if (this.dataList.resultsPage.pageNo >= this.dataList.resultsPage.totalPage) {
  786. this.dataList.resultsPage.isLoading = false;
  787. this.dataList.resultsPage.status = 'nomore';
  788. } else {
  789. this.dataList.resultsPage.isLoading = true;
  790. this.dataList.resultsPage.pageNo++;
  791. params.pageNo = this.dataList.resultsPage.pageNo;
  792. const res = await this.$myRequest({
  793. url: '/resourceshare/baseResearchResultViews/',
  794. data: {
  795. ...params
  796. }
  797. })
  798. if (res.data) {
  799. let data = res.data.baseResearchResultViews;
  800. data.forEach((i) => {
  801. i.updateDate = i.updateDate ? this.formatDate(i.updateDate, "YYYY-MM-DD") : "";
  802. })
  803. for (let i = 0; i < data.length; i++) {
  804. for (let o = 0; o < that.classify1.length; o++) {
  805. if (data[i].researchResultType == that.classify1[o].value) {
  806. data[i].researchResultType = that.classify1[o].label;
  807. }
  808. }
  809. }
  810. that.dataList.results = [...that.dataList.results, ...data]
  811. this.dataList.resultsPage.totalPage = res.data.page.totalPage;
  812. if (this.dataList.resultsPage.totalPage == 1) {
  813. this.dataList.resultsPage.isLoading = false;
  814. this.dataList.resultsPage.status = 'nomore';
  815. }
  816. }
  817. }
  818. },
  819. async getList2(descStatus, type) {
  820. const that = this;
  821. let params = {
  822. pageNo: '',
  823. pageSize: 10,
  824. language: this.$i18n.locale.toUpperCase(),
  825. status: 0,
  826. descStatus: 0,
  827. effective: 'Y',
  828. };
  829. if (descStatus) {
  830. params.descStatus = 1;
  831. }
  832. if (type) {
  833. params.researchResourcesType = type
  834. }
  835. if (this.dataList.resourcesPage.pageNo >= this.dataList.resourcesPage.totalPage) {
  836. this.dataList.resourcesPage.isLoading = false;
  837. this.dataList.resourcesPage.status = 'nomore';
  838. } else {
  839. this.dataList.resourcesPage.isLoading = true;
  840. this.dataList.resourcesPage.pageNo++;
  841. params.pageNo = this.dataList.resultsPage.pageNo;
  842. const res = await this.$myRequest({
  843. url: '/resourceshare/baseResearchResourcesViews/',
  844. data: {
  845. ...params
  846. }
  847. })
  848. if (res.data) {
  849. let data = res.data.baseResearchResourcesViews;
  850. data.forEach((i) => {
  851. i.updateDate = i.updateDate ? this.formatDate(i.updateDate, "YYYY-MM-DD") : "";
  852. if (i.researchResourcesMedia) {
  853. i.researchResourcesMedia = i.researchResourcesMedia.split(',')
  854. i.researchResourcesMedia = i.researchResourcesMedia[0]
  855. }
  856. })
  857. for (let i = 0; i < data.length; i++) {
  858. for (let o = 0; o < that.classify2.length; o++) {
  859. if (data[i].researchResourcesType == that.classify2[o].value) {
  860. data[i].researchResourcesType = that.classify2[o].label;
  861. }
  862. }
  863. }
  864. that.dataList.resources = [...that.dataList.resources, ...data]
  865. that.dataList.resourcesPage.totalPage = res.data.page.totalPage;
  866. if (this.dataList.resourcesPage.totalPage == 1) {
  867. this.dataList.resourcesPage.isLoading = false;
  868. this.dataList.resourcesPage.status = 'nomore';
  869. }
  870. }
  871. }
  872. },
  873. toDetaile(entityId, screen) {
  874. if (screen == 0) {
  875. console.log(entityId);
  876. this.$mRouter.push({
  877. route: `/pages/resourceSharing/resourceInfoDetail/resourceInfoDetail?entityId=${entityId}`,
  878. // route: `/pages/resourceSharing/resourceDetails?entityId=${entityId}`,
  879. });
  880. }
  881. if (screen == 1) {
  882. this.$mRouter.push({
  883. route: `/pages/resourceSharing/resourceDetails?entityId=${entityId}`,
  884. });
  885. }
  886. },
  887. back() {
  888. uni.navigateBack();
  889. },
  890. //中英文切换
  891. i18n(data) {
  892. return this.$t('common.' + data);
  893. },
  894. // 通用跳转
  895. inputValue() {
  896. this.$mRouter.push({
  897. route: `/pages/index/search/search?data=${JSON.stringify(this.search)}`
  898. });
  899. },
  900. }
  901. }
  902. </script>
  903. <style lang="scss" scoped>
  904. /deep/ .content .u-dropdown__content {
  905. height: 800upx !important;
  906. }
  907. page {
  908. width: 100%;
  909. height: 100%;
  910. }
  911. .rf-category {
  912. background-color: #F3F4F5;
  913. /* #ifdef APP-PLUS */
  914. margin-top: calc(20upx + var(--status-bar-height));
  915. /* #endif */
  916. .icoStyle {
  917. display: flex;
  918. .leftArrow {
  919. position: absolute;
  920. left: 4upx;
  921. top: calc(30upx + var(--status-bar-height));
  922. ;
  923. z-index: 9999;
  924. }
  925. }
  926. /*.icoStyle {
  927. display: flex;
  928. align-items:center;
  929. .leftArrow {
  930. width:36upx;
  931. height:36upx;
  932. position: fixed;
  933. z-index: 99;
  934. !* #ifdef APP-PLUS *!
  935. padding-top: calc(20upx + var(--status-bar-height));
  936. !* #endif *!
  937. }
  938. }*/
  939. .oneLine {
  940. /* 隐藏溢出元素 */
  941. overflow: hidden;
  942. /* 单行显示 */
  943. white-space: nowrap;
  944. /* 溢出显示省略号 */
  945. text-overflow: ellipsis;
  946. }
  947. .twoLine {
  948. overflow: hidden;
  949. text-overflow: ellipsis;
  950. display: -webkit-box;
  951. -webkit-line-clamp: 2;
  952. -webkit-box-orient: vertical;
  953. }
  954. .threeLine {
  955. overflow: hidden;
  956. text-overflow: ellipsis;
  957. display: -webkit-box;
  958. -webkit-line-clamp: 3;
  959. -webkit-box-orient: vertical;
  960. }
  961. .wrap {
  962. display: flex;
  963. flex-direction: column;
  964. height: calc(100vh - var(--window-top));
  965. width: 100%;
  966. }
  967. .swiper-box {
  968. flex: 1;
  969. }
  970. .swiper-item {
  971. height: 100%;
  972. }
  973. .slot-content {
  974. background-color: #FFFFFF;
  975. padding: 24rpx;
  976. .item-box {
  977. margin-bottom: 50rpx;
  978. display: flex;
  979. flex-wrap: wrap;
  980. justify-content: flex-start;
  981. .item {
  982. background-color: #E5E6E8;
  983. color: #333333;
  984. padding: 12rpx 10rpx;
  985. border-radius: 18rpx;
  986. margin-top: 30rpx;
  987. margin-right: 30rpx;
  988. }
  989. }
  990. .item-box:after {
  991. content: "";
  992. flex: auto;
  993. }
  994. }
  995. .recommendScroll {
  996. overflow: hidden;
  997. white-space: nowrap; // 滚动必须加的属性
  998. width: 100%;
  999. /*height: 210upx;*/
  1000. margin: 0 auto;
  1001. }
  1002. .recommendScroll .item {
  1003. width: 400upx;
  1004. height: 210upx;
  1005. border: 1upx solid #979797;
  1006. display: inline-block;
  1007. vertical-align: top;
  1008. }
  1009. }
  1010. </style>