123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032 |
- <template>
- <view class="rf-category" style="position: relative;">
- <!--搜索导航栏-->
- <!--<view class="icoStyle">
- <view class="leftArrow" @tap="back">
- <u-icon name="arrow-left" color="#fff" size="36"></u-icon>
- </view>
- <rf-search-bar @search="navToSearch" icon="iconkuaijiecaidan" />
- </view>-->
- <view class="icoStyle">
- <view style="width:90%;height:99upx">
- <rf-search-bar2 @search="inputValue" icon="iconkuaijiecaidan" :title= " i18n('return')" style="z-index: 99;" />
- </view>
- </view>
- <!-- 标签-->
- <view class="content">
- <view style="background-color: #fff;width: 100%;font-size: 24upx;">
- <u-tabs :list="tabList" :is-scroll="false" :current="current" @change="change" swiperWidth="750"
- bar-width="130" activeColor="rgb(24, 144, 255)"></u-tabs>
- </view>
- <view v-if="current==0">
- <!-- 推荐 -->
- <view style="width: 100%;height: 595upx;background-color: #fff;margin-top: 20upx;">
- <view style="width: 100%;height: 83upx;padding: 0 30upx;">
- <text style="float: left;font-size: 26upx;font-weight: 600;line-height: 83upx;color: #333333;">
- {{i18n('Recommend')}}
- </text>
- <view style="float: right;font-size: 24upx;font-weight: 400;line-height: 83upx;"
- @click="toList('resultRecommend')">
- <text style="color: #848485;">
- {{i18n('MoreInfo')}}
- </text>
- <u-icon name="arrow-right" color="#848485" size="20"
- style="font-size: 24upx;font-weight: 400;"></u-icon>
- </view>
- <view style="clear: both;"></view>
- </view>
- <view style="width: 100%;height: 410upx;padding: 0 30upx;">
- <view v-for="(item,index) in recommendList.results" :key="index" style="float: left;"
- @click="toDetaile(item.entityId,0)" :style="{marginLeft:index%3==0?'0upx':'18upx'}">
- <view style="width: 218upx;height: 280upx;">
- <image
- v-if="item.researchResultCover!='null'&&item.researchResultCover!=null&&item.researchResultCover!=''&&item.researchResultCover!=undefined"
- :src="websiteUrl+item.researchResultCover" mode=""
- style="width: 100%;height: 100%;"></image>
- <image v-else src="@/static/img/resourceSharing/backImage.png" mode=""
- style="width: 100%;height: 100%;"></image>
- </view>
- <view style="width: 218upx;height: 130upx;padding: 20upx 0;">
- <text style="font-size: 28upx; color: #0B0B11;" class="twoLine">
- {{item.name}}
- </text>
- </view>
- </view>
- <view style="clear: both;"></view>
- </view>
- <view style="width: 100%;height: 102upx;">
- <view
- style="width: 205upx;height: 72upx;border-radius: 36upx;background-color: #EBF3FF;margin: 0 auto;text-align: center;">
- <view @click="getRecommend1">
- <text style="font-size: 28upx;font-weight: 400;color: #3D7FFF;line-height: 72upx;">
- <text>{{i18n('ChangeTheBatch')}}</text>
- </text>
- <u-icon name="reload" color="#3D7FFF" size="28"></u-icon>
- </view>
- </view>
- </view>
- </view>
- <!-- 热度top10 -->
- <view style="width: 100%;height: 353upx;background-color: #fff;margin-top: 20upx;">
- <view style="width: 100%;height: 83upx;padding: 0 30upx;">
- <text style="font-size: 26upx;font-weight: 600;line-height: 83upx;color: #333333;">
- {{i18n('resourceHeat')}}TOP10
- </text>
- </view>
- <view style="width: 100%;height: 270upx;padding: 0 0 60upx 0;">
- <!--列表横向滚动-->
- <scroll-view scroll-x="true" class="recommendScroll" style="height: 210upx">
- <block>
- <view v-for="(item,index) in heatList.results" :key="index" class="item"
- @click="toDetaile(item.entityId,0)"
- :style="{marginLeft:index==0?'20upx':'10upx',marginRight:index+1==heatList.results.length?'20upx':'10upx'}">
- <view
- style="width: 150upx;height: 193upx;float: left;margin: 8upx 13upx 9upx 8upx;">
- <image
- v-if="item.researchResultCover!='null'&&item.researchResultCover!=null&&item.researchResultCover!=''&&item.researchResultCover!=undefined"
- :src="websiteUrl+item.researchResultCover" mode=""
- style="width: 100%;height: 100%;"></image>
- <image v-else src="@/static/img/resourceSharing/backImage.png" mode=""
- style="width: 100%;height: 100%;"></image>
- </view>
- <view style="width: 224upx;height: 100%;padding-top: 9upx;float: left;">
- <view style="width: 100%;">
- <text
- style="font-size: 26upx; color: #0B0B11;display: inline-block;width: 100%;"
- class="oneLine">
- {{item.name}}
- </text>
- </view>
- <view style="width: 100%;">
- <text
- style="font-size: 22upx; color: #666666; line-height: 25upx;display: inline-block;width: 100%;"
- class="oneLine">
- {{item.affiliatedUnitName}}
- </text>
- </view>
- <view style="width: 100%;">
- <text
- style="padding: 0 13upx; font-size: 22upx; color: #666666;border-radius: 22upx;display: inline-block;border: 2upx solid #1777FE;color: #1777FE;">
- {{item.researchResultType}}
- </text>
- </view>
- </view>
- <view style="clear: both;"></view>
- </view>
- </block>
- </scroll-view>
- </view>
- </view>
- <!-- 列表 -->
- <view style="width: 100%;background-color: #fff;margin-top: 20upx;">
- <view style="width: 100%;s">
- <u-dropdown class="u-dropdown" ref="uDropdown1" style="background-color: #fff;width: 100%;">
- <u-dropdown-item v-model="value1" :title="i18n('Comprehensive')" @change="dropdownChange"
- :options="options" height="860upx"></u-dropdown-item>
- <u-dropdown-item :title="i18n('resourceType')" height="860upx">
- <view class="slot-content">
- <view class="item-box">
- <view v-for="(item, index) in options1" :key="index"
- :style="{width:index==0?'100%':''}">
- <view class="item" :class="[item.active ? 'active' : '']"
- :style="{display:index==0?'inline-block':''}" @tap="tagClick(index)">
- {{item.label}}
- </view>
- </view>
- </view>
- <!-- <u-button type="primary" @click="closeDropdown">{{i18n('OK')}}</u-button>-->
- </view>
- </u-dropdown-item>
- </u-dropdown>
- </view>
- <view style="width: 100%;padding: 0 30upx 1upx 30upx;">
- <view v-for="(item,index) in dataList.results" :key="index"
- style="width: 100%;height: 280upx;margin-bottom: 60upx;"
- @click="toDetaile(item.entityId,0)">
- <view
- style="width: 218upx;height: 280upx;float: left;border: 1upx solid #979797;margin-right: 20upx">
- <image
- v-if="item.researchResultCover!='null'&&item.researchResultCover!=null&&item.researchResultCover!=''&&item.researchResultCover!=undefined"
- :src="websiteUrl+item.researchResultCover" mode=""
- style="width: 100%;height: 100%;"></image>
- <image v-else src="@/static/img/resourceSharing/backImage.png" mode=""
- style="width: 100%;height: 100%;"></image>
- </view>
- <view style="width: 452upx;height: 100%;float: left;position: relative;">
- <view>
- <text style="font-size: 30upx; color: #0B0B11;" class="twoLine">
- {{item.name}}
- </text>
- </view>
- <view style="margin-top: 13upx;">
- <text style="font-size: 26upx; padding: 0 13upx; border: 2upx solid #1777FE;
- display: inline-block;border-radius: 32upx;color: #1777FE;">
- {{item.researchResultType}}
- </text>
- </view>
- <view v-show="item.informationVisibleStatus=='Y'" style="margin-top: 13upx;">
- <text style="font-size: 26upx; padding: 0 13upx; display: inline-block;
- border-radius: 12upx;background-color: rgba(61,127,255,0.1);color: #3D7FFF;">
- {{i18n('resourcevip')}}
- </text>
- </view>
- <view style="position: absolute;bottom: 0;width: 100%;height: 35upx;color: #666;">
- <view style="float: left;height: 100%">
- <text style="font-size: 28upx;">{{item.updateDate}}</text>
- </view>
- <view style="float: right;">
- <view style="float: left;font-size: 28upx;font-weight: 400;">
- <u-icon name="heart" color="#848485" size="28" style="margin-right: 6upx">
- </u-icon>
- <text v-if="item.num" style="color: #666;">
- {{item.num=='null'?'0':item.num}}
- </text>
- <text v-else style="color: #666;">
- 0
- </text>
- </view>
- <!--<view style="float: left;font-size: 28upx;font-weight: 400;margin-left: 70upx;">
- <u-icon name="arrow-right" color="#848485" size="28" style="margin-right: 6upx"></u-icon>
- <text style="color: #666;">
- 888
- </text>
- </view>-->
- </view>
- <view style="clear: both;"></view>
- </view>
- </view>
- <view style="clear: both;"></view>
- </view>
- <view style="margin-top: 20rpx;">
- <u-loadmore :status="dataList.resultsPage.status" :load-text="dataList.loadText" />
- </view>
- </view>
- </view>
- </view>
- <view v-if="current==1">
- <!-- 推荐 -->
- <view style="width: 100%;background-color: #fff;margin-top: 20upx;">
- <view style="width: 100%;height: 83upx;padding: 0 30upx;">
- <text style="float: left;font-size: 26upx;font-weight: 600;line-height: 83upx;color: #333333;">
- {{i18n('Recommend')}}
- </text>
- <view style="float: right;font-size: 24upx;font-weight: 400;line-height: 83upx;"
- @click="toList('resourceRecommend')">
- <text style="color: #848485;">
- {{i18n('MoreInfo')}}
- </text>
- <u-icon name="arrow-right" color="#848485" size="20"
- style="font-size: 24upx;font-weight: 400;"></u-icon>
- </view>
- <view style="clear: both;"></view>
- </view>
- <view style="width: 100%;padding: 0 30upx;">
- <view v-for="(item,index) in recommendList.resources" :key="index" style="float: left;"
- @click="toDetaile(item.entityId,1)" :style="{marginLeft:index%2==0?'0upx':'20upx'}">
- <view style="width: 335upx;height: 280upx;">
- <image
- v-if="item.researchResourcesMedia!='null'&&item.researchResourcesMedia!=null&&item.researchResourcesMedia!=''&&item.researchResourcesMedia!=undefined"
- :src="websiteUrl+item.researchResourcesMedia" mode=""
- style="width: 100%;height: 100%;"></image>
- <image v-else src="@/static/img/resourceSharing/lavle.png" mode=""
- style="width: 100%;height: 100%;"></image>
- </view>
- <view style="width: 335upx;height: 95upx;padding: 20upx 0 30upx 0;">
- <text style="font-size: 28upx; color: #0B0B11;" class="twoLine">
- {{item.name}}
- </text>
- </view>
- </view>
- <view style="clear: both;"></view>
- </view>
- <view style="width: 100%;height: 102upx;">
- <view
- style="width: 205upx;height: 72upx;border-radius: 36upx;background-color: #EBF3FF;margin: 0 auto;text-align: center;">
- <view @click="getRecommend2">
- <text style="font-size: 28upx;font-weight: 400;color: #3D7FFF;line-height: 72upx;">
- <text>{{i18n('ChangeTheBatch')}}</text>
- </text>
- <u-icon name="reload" color="#3D7FFF" size="20"></u-icon>
- </view>
- </view>
- </view>
- </view>
- <!-- 热度top10 -->
- <view style="width: 100%;height: 273upx;background-color: #fff;margin-top: 20upx;">
- <view style="width: 100%;height: 83upx;padding: 0 30upx;">
- <text style="font-size: 26upx;font-weight: 600;line-height: 83upx;color: #333333;">
- {{i18n('resourceHeat')}}TOP10
- </text>
- </view>
- <view style="width: 100%;height: 190upx;">
- <!--列表横向滚动-->
- <scroll-view scroll-x="true" class="recommendScroll" style="height: 160upx">
- <block>
- <view v-for="(item,index) in heatList.resources" :key="index" class="scroll-view-item_H"
- @click="toDetaile(item.entityId,1)"
- style="min-width: 446upx;height: 160upx;border: 1upx solid #979797;display: inline-block;vertical-align: top;"
- :style="{marginLeft:index==0?'20upx':'10upx',marginRight:index+1==heatList.results.length?'20upx':'10upx'}">
- <view
- style="width: 220upx;height: 140upx;float: left;margin: 10upx 20upx 10upx 10upx;">
- <image
- v-if="item.researchResourcesMedia!='null'&&item.researchResourcesMedia!=null&&item.researchResourcesMedia!=''&&item.researchResourcesMedia!=undefined"
- :src="websiteUrl+item.researchResourcesMedia" mode=""
- style="width: 100%;height: 100%;"></image>
- <image v-else src="@/static/img/resourceSharing/lavle.png" mode=""
- style="width: 100%;height: 100%;"></image>
- </view>
- <view
- style="min-width: 176upx;max-width:310upx;height: 100%;padding: 9upx 9upx 0 0;float: left;">
- <view style="width: 100%;height: 40upx;">
- <text
- style="font-size: 26upx; color: #0B0B11;display: inline-block;width: 100%;"
- class="oneLine">
- {{item.name}}
- </text>
- </view>
- <view style="width: 100%;height: 40upx;">
- <text
- style="font-size: 22upx; color: #666666; line-height: 25upx;display: inline-block;width: 100%;"
- class="oneLine">
- {{item.affiliatedUnitName}}
- </text>
- </view>
- <view style="width: 100%;">
- <text
- style="padding: 0 13upx; font-size: 22upx; color: #666666;border-radius: 22upx;display: inline-block;border: 2upx solid #1777FE;color: #1777FE;">
- {{item.researchResourcesType}}
- </text>
- </view>
- </view>
- <view style="clear: both;"></view>
- </view>
- </block>
- </scroll-view>
- </view>
- </view>
- <!-- 列表 -->
- <view style="width: 100%;background-color: #fff;margin-top: 20upx;">
- <view style="width: 100%; height: 86upx;">
- <u-dropdown class="u-dropdown" ref="uDropdown2" style="background-color: #fff;width: 100%;">
- <u-dropdown-item v-model="value2" :title="i18n('Comprehensive')" @change="dropdownChange"
- :options="options" height="860upx"></u-dropdown-item>
- <u-dropdown-item :title="i18n('resourceType')" height="860upx">
- <view class="slot-content">
- <view class="item-box">
- <view v-for="(item, index) in options2" :key="index"
- :style="{width:index==0?'100%':''}">
- <view class="item" :class="[item.active ? 'active' : '']"
- :style="{display:index==0?'inline-block':''}" @tap="tagClick(index)">
- {{item.label}}
- </view>
- </view>
- </view>
- <!-- <u-button type="primary" @click="closeDropdown">{{i18n('OK')}}</u-button>-->
- </view>
- </u-dropdown-item>
- </u-dropdown>
- </view>
- <view style="width: 100%;padding: 0 30upx;">
- <view v-for="(item,index) in dataList.resources" :key="index"
- style="width: 100%;height: 220upx;margin-bottom: 60upx" @click="toDetaile(item.entityId,1)">
- <view style="width: 270upx;height: 220upx;float: left;">
- <image
- v-if="item.researchResourcesMedia!='null'&&item.researchResourcesMedia!=null&&item.researchResourcesMedia!=''&&item.researchResourcesMedia!=undefined"
- :src="websiteUrl+item.researchResourcesMedia" mode=""
- style="width: 100%;height: 100%;"></image>
- <image v-else src="@/static/img/resourceSharing/lavle.png" mode=""
- style="width: 100%;height: 100%;"></image>
- </view>
- <view style="width: 390upx;height: 100%;float: left;margin-left: 30upx;position: relative;">
- <view>
- <text style="font-size: 30upx; color: #0B0B11;" class="twoLine">
- {{item.name}}
- </text>
- </view>
- <view>
- <text style="font-size: 20upx; color: #666666;" class="twoLine">
- {{item.affiliatedUnitName}}
- </text>
- </view>
- <view style="margin-top: 13upx;">
- <text style="font-size: 26upx; padding: 0 13upx; border: 2upx solid #1777FE;
- display: inline-block;border-radius: 32upx;color: #1777FE;">
- {{item.researchResourcesType}}
- </text>
- </view>
- <view style="position: absolute;bottom: 0;width: 100%;height: 35upx;color: #666;">
- <view style="float: left;height: 100%">
- <text style="font-size: 28upx;">{{item.updateDate}}</text>
- </view>
- <view style="float: right;">
- <view style="float: left;font-size: 28upx;font-weight: 400;">
- <u-icon name="heart" color="#848485" size="28" style="margin-right: 6upx">
- </u-icon>
- <text v-if="item.num" style="color: #666;">
- {{item.num=='null'?'0':item.num}}
- </text>
- <text v-else style="color: #666;">
- 0
- </text>
- </view>
- <!--<view style="float: left;font-size: 28upx;font-weight: 400;margin-left: 70upx;">
- <u-icon name="arrow-right" color="#848485" size="28" style="margin-right: 6upx"></u-icon>
- <text style="color: #666;">
- 888
- </text>
- </view>-->
- </view>
- <view style="clear: both;"></view>
- </view>
- </view>
- <view style="clear: both;"></view>
- </view>
- <view style="margin-top: 20rpx;">
- <u-loadmore :status="dataList.resourcesPage.status" :load-text="dataList.loadText" />
- </view>
- </view>
- </view>
- </view>
- </view>
- <rf-back-top :scrollTop="scrollTop"></rf-back-top>
- </view>
- </template>
- <script>
- import rfSearchBar from '@/components/rf-search-bar';
- import rfSearchBar2 from '@/components/rf-search-bar-xiangmu';
- export default {
- data() {
- return {
- // tab
- tabList: [{
- name: this.i18n('resource')
- },
- {
- name: this.i18n('researchResource')
- },
- ],
- // 字典
- classify1: '',
- classify2: '',
- // screen
- current: 0,
- // 推荐
- recommendList: {
- results: [],
- resultsPage: {
- pageNo: 0,
- totalPage: '',
- },
- resources: [],
- resourcesPage: {
- pageNo: 0,
- totalPage: '',
- },
- },
- // 热度TOP10
- heatList: {
- results: [],
- resources: [],
- },
- // 列表
- dataList: {
- results: [],
- resultsPage: {
- pageNo: 0,
- totalPage: 1,
- status: 'loading',
- isLoading: true,
- },
- resources: [],
- resourcesPage: {
- pageNo: 0,
- totalPage: 1,
- status: 'loading',
- isLoading: true,
- },
- loadText: {
- loading: this.$i18n.locale == 'zh' ? '加载中' : 'Loading',
- nomore: this.$i18n.locale == 'zh' ? '没有更多数据了' : 'No more'
- },
- },
- // 返回顶部
- scrollTop: 0,
- value1: '',
- value2: '',
- options: [{
- label: this.$i18n.locale == 'zh' ? '时间降序' : 'Time in descending order',
- value: 1,
- },
- // {
- // label: '时间升序',
- // value: 2,
- // },
- {
- label: this.$i18n.locale == 'zh' ? '热度降序' : 'Heat in descending order',
- value: 3,
- },
- // {
- // label: '热度升序',
- // value: 4,
- // }
- ],
- options1: [],
- options2: [],
- }
- },
- components: {
- rfSearchBar,
- rfSearchBar2
- },
- async onShow() {
- this.getList1()
- this.getList2()
- },
- onPageScroll(e) {
- this.scrollTop = e.scrollTop;
- },
- onReachBottom() { //页面拉到底部加载
- if (this.dataList.resultsPage.isLoading && this.current == 0) {
- if (this.value1 == 1) {
- this.getList1(0)
- }
- if (this.value1 == 3) {
- this.getList1(1)
- }
- }
- if (this.dataList.resourcesPage.isLoading && this.current == 1) {
- if (this.value2 == 1) {
- this.getList2(0)
- }
- if (this.value2 == 3) {
- this.getList2(1)
- }
- }
- },
- created() {
- this.getDict();
- this.getRecommend1();
- this.getRecommend2();
- this.getHeat1()
- this.getHeat2()
- },
- methods: {
- dropdownChange(index) {
- this.dataList.resultsPage.pageNo = 0;
- this.dataList.results = [];
- this.dataList.resourcesPage.pageNo = 0;
- this.dataList.resources = [];
- if (index == 1) {
- this.getList1(0)
- this.getList2(0)
- }
- if (index == 3) {
- this.getList1(1)
- this.getList2(1)
- }
- },
- closeDropdown() {
- const that = this;
- this.dataList.resultsPage.pageNo = 0;
- this.dataList.results = [];
- this.dataList.resourcesPage.pageNo = 0;
- this.dataList.resources = [];
- if (that.current == 0) {
- that.options1.forEach((i) => {
- if (i.active == true) {
- if (that.value1) {
- if (that.value1 == 1) {
- that.getList1(0, i.value)
- }
- if (that.value1 == 3) {
- that.getList1(1, i.value)
- }
- } else {
- that.getList1(0, i.value)
- }
- }
- })
- that.$refs.uDropdown1.close();
- }
- if (that.current == 1) {
- that.options2.forEach((i) => {
- if (i.active == true) {
- if (that.value2) {
- if (that.value2 == 1) {
- that.getList2(0, i.value)
- }
- if (that.value2 == 3) {
- that.getList2(1, i.value)
- }
- } else {
- that.getList2(0, i.value)
- }
- }
- })
- that.$refs.uDropdown2.close();
- }
- },
- tagClick(index) {
- if (this.current == 0) {
- this.options1.forEach((i) => {
- i.active = false;
- })
- this.options1[index].active = !this.options1[index].active;
- }
- if (this.current == 1) {
- this.options2.forEach((i) => {
- i.active = false;
- })
- this.options2[index].active = !this.options2[index].active;
- }
- this.closeDropdown()
- },
- // tab栏切换
- change(index) {
- this.current = index;
- },
- // 跳转列表
- toList(path) {
- uni.navigateTo({
- url: '/pages/resourceSharing/' + path
- })
- },
- // 跳转详情
- toDetail(path) {
- uni.navigateTo({
- url: '/pages/resourceSharing/' + path
- })
- },
- async getDict() {
- const res = await this.$myRequest({
- url: '/sys/sysDicts',
- data: {
- type: this.$i18n.locale == "zh" ?
- 'RESEARCH_RESULT_TYPE_DICT,RESEARCH_RESOURCE_TYPE_DICT' :
- 'RESEARCH_RESULT_TYPE_DICT_EN,RESEARCH_RESOURCE_TYPE_DICT_EN',
- }
- });
- if (res.data) {
- let both = {
- label: this.$t('common.All'),
- value: null,
- active: true,
- };
- this.classify1 = res.data[0];
- this.classify2 = res.data[1];
- this.classify1.forEach((i) => {
- this.$set(i, 'active', false)
- })
- this.classify2.forEach((i) => {
- this.$set(i, 'active', false)
- })
- this.classify1.unshift(both);
- this.classify2.unshift(both);
- this.options1 = this.classify1;
- this.options2 = this.classify2;
- }
- },
- async getRecommend1() {
- const that = this;
- let params = {
- pageNo: '',
- pageSize: 3,
- language: this.$i18n.locale.toUpperCase(),
- status: 0,
- descStatus: 0,
- reserveTwo: 'Y',
- }
- if (this.recommendList.resultsPage.pageNo >= this.recommendList.resultsPage.totalPage) {
- this.recommendList.resultsPage.pageNo = 0
- }
- this.recommendList.resultsPage.pageNo++;
- params.pageNo = this.recommendList.resultsPage.pageNo;
- const res = await this.$myRequest({
- url: '/resourceshare/baseResearchResultViews/',
- data: {
- ...params
- }
- })
- if (res.data) {
- that.recommendList.results = res.data.baseResearchResultViews;
- that.recommendList.results.forEach((i) => {
- i.updateDate = i.updateDate ? this.formatDate(i.updateDate, "YYYY-MM-DD") : "";
- })
- for (let i = 0; i < that.recommendList.results.length; i++) {
- for (let o = 0; o < that.classify1.length; o++) {
- if (that.recommendList.results[i].researchResultType == that.classify1[o].value) {
- that.recommendList.results[i].researchResultType = that.classify1[o].label;
- }
- }
- }
- this.recommendList.resultsPage.totalPage = res.data.page.totalPage;
- }
- },
- async getRecommend2() {
- const that = this;
- let params = {
- pageNo: '',
- pageSize: 4,
- language: this.$i18n.locale.toUpperCase(),
- status: 0,
- descStatus: 0,
- effective: 'Y',
- };
- if (this.recommendList.resourcesPage.pageNo >= this.recommendList.resourcesPage.totalPage) {
- this.recommendList.resourcesPage.pageNo = 0
- }
- this.recommendList.resourcesPage.pageNo++;
- params.pageNo = this.recommendList.resultsPage.pageNo;
- const res = await this.$myRequest({
- url: '/resourceshare/baseResearchResourcesViews/',
- data: {
- ...params
- }
- })
- if (res.data) {
- that.recommendList.resources = res.data.baseResearchResourcesViews;
- that.recommendList.resources.forEach((i) => {
- i.updateDate = i.updateDate ? this.formatDate(i.updateDate, "YYYY-MM-DD") : "";
- if (i.researchResourcesMedia) {
- i.researchResourcesMedia = i.researchResourcesMedia.split(',')
- i.researchResourcesMedia = i.researchResourcesMedia[0]
- }
- })
- for (let i = 0; i < that.recommendList.resources.length; i++) {
- for (let o = 0; o < that.classify2.length; o++) {
- if (that.recommendList.resources[i].researchResourcesType == that.classify2[o].value) {
- that.recommendList.resources[i].researchResourcesType = that.classify2[o].label;
- }
- }
- }
- this.recommendList.resourcesPage.totalPage = res.data.page.totalPage;
- }
- },
- async getHeat1() {
- const that = this;
- let params = {
- pageNo: 1,
- pageSize: 10,
- language: this.$i18n.locale.toUpperCase(),
- status: 0,
- descStatus: 1,
- reserveTwo: 'Y',
- }
- const res = await this.$myRequest({
- url: '/resourceshare/baseResearchResultViews/',
- data: {
- ...params
- }
- })
- if (res.data) {
- that.heatList.results = res.data.baseResearchResultViews;
- that.heatList.results.forEach((i) => {
- i.updateDate = i.updateDate ? this.formatDate(i.updateDate, "YYYY-MM-DD") : "";
- })
- for (let i = 0; i < that.heatList.results.length; i++) {
- for (let o = 0; o < that.classify1.length; o++) {
- if (that.heatList.results[i].researchResultType == that.classify1[o].value) {
- that.heatList.results[i].researchResultType = that.classify1[o].label;
- }
- }
- }
- }
- },
- async getHeat2() {
- const that = this;
- let params = {
- pageNo: 1,
- pageSize: 10,
- language: this.$i18n.locale.toUpperCase(),
- status: 0,
- descStatus: 1,
- effective: 'Y',
- };
- const res = await this.$myRequest({
- url: '/resourceshare/baseResearchResourcesViews/',
- data: {
- ...params
- }
- })
- if (res.data) {
- that.heatList.resources = res.data.baseResearchResourcesViews;
- that.heatList.resources.forEach((i) => {
- i.updateDate = i.updateDate ? this.formatDate(i.updateDate, "YYYY-MM-DD") : "";
- if (i.researchResourcesMedia) {
- i.researchResourcesMedia = i.researchResourcesMedia.split(',')
- i.researchResourcesMedia = i.researchResourcesMedia[0]
- }
- })
- for (let i = 0; i < that.heatList.resources.length; i++) {
- for (let o = 0; o < that.classify2.length; o++) {
- if (that.heatList.resources[i].researchResourcesType == that.classify2[o].value) {
- that.heatList.resources[i].researchResourcesType = that.classify2[o].label;
- }
- }
- }
- }
- },
- async getList1(descStatus, type) {
- const that = this;
- let params = {
- pageNo: '',
- pageSize: 10,
- language: this.$i18n.locale.toUpperCase(),
- status: 0,
- descStatus: 0,
- reserveTwo: 'Y',
- }
- if (descStatus) {
- params.descStatus = 1;
- }
- if (type) {
- params.researchResultType = type
- }
- if (this.dataList.resultsPage.pageNo >= this.dataList.resultsPage.totalPage) {
- this.dataList.resultsPage.isLoading = false;
- this.dataList.resultsPage.status = 'nomore';
- } else {
- this.dataList.resultsPage.isLoading = true;
- this.dataList.resultsPage.pageNo++;
- params.pageNo = this.dataList.resultsPage.pageNo;
- const res = await this.$myRequest({
- url: '/resourceshare/baseResearchResultViews/',
- data: {
- ...params
- }
- })
- if (res.data) {
- let data = res.data.baseResearchResultViews;
- data.forEach((i) => {
- i.updateDate = i.updateDate ? this.formatDate(i.updateDate, "YYYY-MM-DD") : "";
- })
- for (let i = 0; i < data.length; i++) {
- for (let o = 0; o < that.classify1.length; o++) {
- if (data[i].researchResultType == that.classify1[o].value) {
- data[i].researchResultType = that.classify1[o].label;
- }
- }
- }
- that.dataList.results = [...that.dataList.results, ...data]
- this.dataList.resultsPage.totalPage = res.data.page.totalPage;
- if (this.dataList.resultsPage.totalPage == 1) {
- this.dataList.resultsPage.isLoading = false;
- this.dataList.resultsPage.status = 'nomore';
- }
- }
- }
- },
- async getList2(descStatus, type) {
- const that = this;
- let params = {
- pageNo: '',
- pageSize: 10,
- language: this.$i18n.locale.toUpperCase(),
- status: 0,
- descStatus: 0,
- effective: 'Y',
- };
- if (descStatus) {
- params.descStatus = 1;
- }
- if (type) {
- params.researchResourcesType = type
- }
- if (this.dataList.resourcesPage.pageNo >= this.dataList.resourcesPage.totalPage) {
- this.dataList.resourcesPage.isLoading = false;
- this.dataList.resourcesPage.status = 'nomore';
- } else {
- this.dataList.resourcesPage.isLoading = true;
- this.dataList.resourcesPage.pageNo++;
- params.pageNo = this.dataList.resultsPage.pageNo;
- const res = await this.$myRequest({
- url: '/resourceshare/baseResearchResourcesViews/',
- data: {
- ...params
- }
- })
- if (res.data) {
- let data = res.data.baseResearchResourcesViews;
- data.forEach((i) => {
- i.updateDate = i.updateDate ? this.formatDate(i.updateDate, "YYYY-MM-DD") : "";
- if (i.researchResourcesMedia) {
- i.researchResourcesMedia = i.researchResourcesMedia.split(',')
- i.researchResourcesMedia = i.researchResourcesMedia[0]
- }
- })
- for (let i = 0; i < data.length; i++) {
- for (let o = 0; o < that.classify2.length; o++) {
- if (data[i].researchResourcesType == that.classify2[o].value) {
- data[i].researchResourcesType = that.classify2[o].label;
- }
- }
- }
- that.dataList.resources = [...that.dataList.resources, ...data]
- that.dataList.resourcesPage.totalPage = res.data.page.totalPage;
- if (this.dataList.resourcesPage.totalPage == 1) {
- this.dataList.resourcesPage.isLoading = false;
- this.dataList.resourcesPage.status = 'nomore';
- }
- }
- }
- },
- toDetaile(entityId, screen) {
- if (screen == 0) {
- console.log(entityId);
- this.$mRouter.push({
- route: `/pages/resourceSharing/resourceInfoDetail/resourceInfoDetail?entityId=${entityId}`,
- // route: `/pages/resourceSharing/resourceDetails?entityId=${entityId}`,
- });
- }
- if (screen == 1) {
- this.$mRouter.push({
- route: `/pages/resourceSharing/resourceDetails?entityId=${entityId}`,
- });
- }
- },
- back() {
- uni.navigateBack();
- },
- //中英文切换
- i18n(data) {
- return this.$t('common.' + data);
- },
- // 通用跳转
- inputValue() {
- this.$mRouter.push({
- route: `/pages/index/search/search?data=${JSON.stringify(this.search)}`
- });
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- /deep/ .content .u-dropdown__content {
- height: 800upx !important;
- }
- page {
- width: 100%;
- height: 100%;
- }
- .rf-category {
- background-color: #F3F4F5;
- /* #ifdef APP-PLUS */
- margin-top: calc(20upx + var(--status-bar-height));
- /* #endif */
- .icoStyle {
- display: flex;
- .leftArrow {
- position: absolute;
- left: 4upx;
- top: calc(30upx + var(--status-bar-height));
- ;
- z-index: 9999;
- }
- }
- /*.icoStyle {
- display: flex;
- align-items:center;
- .leftArrow {
- width:36upx;
- height:36upx;
- position: fixed;
- z-index: 99;
- !* #ifdef APP-PLUS *!
- padding-top: calc(20upx + var(--status-bar-height));
- !* #endif *!
- }
- }*/
- .oneLine {
- /* 隐藏溢出元素 */
- overflow: hidden;
- /* 单行显示 */
- white-space: nowrap;
- /* 溢出显示省略号 */
- text-overflow: ellipsis;
- }
- .twoLine {
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .threeLine {
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 3;
- -webkit-box-orient: vertical;
- }
- .wrap {
- display: flex;
- flex-direction: column;
- height: calc(100vh - var(--window-top));
- width: 100%;
- }
- .swiper-box {
- flex: 1;
- }
- .swiper-item {
- height: 100%;
- }
- .slot-content {
- background-color: #FFFFFF;
- padding: 24rpx;
- .item-box {
- margin-bottom: 50rpx;
- display: flex;
- flex-wrap: wrap;
- justify-content: flex-start;
- .item {
- background-color: #E5E6E8;
- color: #333333;
- padding: 12rpx 10rpx;
- border-radius: 18rpx;
- margin-top: 30rpx;
- margin-right: 30rpx;
- }
- }
- .item-box:after {
- content: "";
- flex: auto;
- }
- }
- .recommendScroll {
- overflow: hidden;
- white-space: nowrap; // 滚动必须加的属性
- width: 100%;
- /*height: 210upx;*/
- margin: 0 auto;
- }
- .recommendScroll .item {
- width: 400upx;
- height: 210upx;
- border: 1upx solid #979797;
- display: inline-block;
- vertical-align: top;
- }
- }
- </style>
|