123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547 |
- <template>
- <view class="organsDetial">
- <!-- 标题栏 -->
- <u-navbar :is-back="true" :back-icon-color="'#fff'" :background="{'background':'#1777FE'}" :border-bottom="true"
- :back-text="$t('common.Back')" :title-color="'#fff'" :back-text-style="{color:'#fff'}" :title="title">
- <view slot="right" style="margin-right:20upx">
- <u-icon name="share-fill" style="margin-right: 30upx;" color="white" size="50" @click="share"></u-icon>
- <u-icon name="heart-fill" color="#fff" size="36" @click="saveFollowModel(followed)"
- v-if="this.followed"></u-icon>
- <u-icon name="heart" color="#fff" size="36" @click="saveFollowModel(followed)" v-if="!this.followed">
- </u-icon>
- </view>
- </u-navbar>
- <!-- <view class="banner" style="text-align: center;"><image style="height: 100%;" :src="detial.photo" ></image></view> -->
- <view class="banner">
- <image class="bannerimg" :src="detial.photo" mode="widthFix"></image>
- </view>
- <view class="headInfo">
- <view class="title">{{detial.unitName}}</view>
- <view class="address">
- <view class="label">{{$t('common.place')}}:</view>
- <view class="text">{{detial.unitCountry}} </view>
- </view>
- <view class="web">
- <text>{{$t('common.Website')}}:</text><text>{{detial.officialWebsitePath}}</text>
- </view>
- <view class="des">
- <view class="label">{{$t('common.Introduce')}}:</view>
- <view class="text">
- <!-- <rich-text :nodes="detial.unitIntroduction"></rich-text> -->
- <view :class="flag?'':'introduct1'" v-html="detial.unitIntroduction"></view>
- <view class="more" @click="showAll" v-if="flag==false">{{$t('common.SeeAll')}}</view>
- <view style="clear: both;"></view>
- </view>
- </view>
- </view>
- <view class="line5"></view>
- <view class="tab">
- <view class="tabtitle">
- <u-tabs-swiper ref="uTabs" :list="tabTitleList" :current="current" :is-scroll="true" :bold="false"
- :bar-height="0" :bar-style="{margin:'0 auto',textAlign:'center'}" :swiperWidth="750"
- @change="tabsChange">
- </u-tabs-swiper>
- </view>
- <view class="tabcontent">
- <swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
- <swiper-item class="swiper-item" v-for="(item, index) in tabs" :key="index">
- <scroll-view :scroll-y="true" style="height:100%;width:100%;" @scrolltolower="onreachBottom">
- <!-- 页面1 -->
- <view class="page" v-if="index==0 && item.list.length>0">
- <view class="pageitem" v-for="(pageitem,pageidx) in item.list" :key="pageidx"
- @click="toShowDetial(pageitem)">
- <view class="label">{{pageitem.title}}</view>
- <view class="date">{{formatDate(pageitem.publishDate)}}</view>
- </view>
- </view>
- <!-- 页面2 -->
- <view class="page" v-if="index==1 && item.list.length>0">
- <view class="pageitem" v-for="(pageitem,pageidx) in item.list" :key="pageidx"
- @click="toShowDetial(pageitem)">
- <view class="label">{{pageitem.title}}</view>
- <view class="date">{{formatDate(pageitem.publishDate)}}</view>
- </view>
- </view>
- <view class="nodata" v-if="item.list.length==0">{{msg}}</view>
- </scroll-view>
- </swiper-item>
- </swiper>
- </view>
- </view>
- <view class="line5"></view>
- <view class="dynamic" v-if="infoList.length>0">
- <view class="zoneTitle">{{$t('common.InstitutionDynamic')}}</view>
- <view class="infoList">
- <view class="item" v-for="(item,index) in infoList" :key="index" @click="toShowDetial(item)">
- <!-- <view class="thumb"><image class="thumbimg" :src="item.thumb" mode="widthFix"></image></view> -->
- <view class="info">
- <view class="title">{{item.title}}</view>
- <view class="date">{{publishDate(item.publishDate)}}</view>
- </view>
- </view>
- </view>
- </view>
- <!-- 8.8.20.112:19001 -->
- <share v-show="ifShare == true" :show="ifShare" @closeShare="share" :title="i18n('FinancialInstitutions')"
- :summary="detial.unitName"
- :href="'https://m.geidcp.com/#/pages/financialService/financialOrgans/organsDetial?' + 'baseEntityId=' + baseEntityId + '&language=' + $i18n.locale"
- :imageUrl="detial.photo? detial.photo :
- 'https://geidcp.com/api/file/pub/defaultCutPic/shareLogo.png'">
- </share>
- <!-- #ifdef H5 -->
- <rf-back-home></rf-back-home>
- <!-- #endif -->
- <u-toast ref="uToast" />
- </view>
- </template>
- <script>
- import UNavbar from '@/components/uni-nav-bar/uni-nav-bar.vue'
- import UIcon from '@/components/uni-icons/uni-icons.vue'
- import {
- getBaseFinancialInstitutionInfos
- } from "@/api/financialService/baseFinancialInstitutionInfo";
- import {
- getInformationList
- } from '@/api/cooperation/baseCooperationUnit'
- import {
- saveFollowModel,
- getFollowModelStatusByModelIdAndUserId
- } from '@/api/operation/basePortalModelFollowInfo'
- import share from '@/components/share'
- export default {
- name: 'OrgansDetial',
- components: {
- UNavbar,
- UIcon,
- share
- },
- data: function() {
- return {
- title: '',
- msg: '',
- baseEntityId: '',
- modelType: 'financialInstitution',
- followed: '',
- detial: {},
- current: 0,
- ifShare: false,
- swiperCurrent: 0,
- // seeAll: '查看全部',
- tabTitleList: [{
- name: this.$t('common.ProductAndService')
- },
- {
- name: this.$t('common.InvestmentAndCases')
- }
- ],
- flag: false,
- tabs: [{
- list: []
- },
- {
- list: []
- }
- ],
- infoList: [],
- token: ''
- }
- },
- onShow: function() {
- this.token = uni.getStorageSync('Auth-Token') ? ('Bearer ' + uni.getStorageSync('Auth-Token')) : '';
- this.userId = uni.getStorageSync('user') ? (JSON.parse(uni.getStorageSync('user')).id) : '';
- },
- onLoad: function(e) {
- this.baseEntityId = e.baseEntityId;
- if (option.language) {
- uni.setStorageSync("language", option.language);
- this._i18n.locale = option.language;
- }
- uni.showLoading({
- title: this.$i18n.locale == 'zh' ? '加载中...' : 'Loading...',
- });
- this.seeAll = this.$i18n.locale == 'zh' ? '查看全部' : 'See All'
- this.title = this.$i18n.locale == 'zh' ? '机构详情' : 'InvestmentGuide Detial'
- this.msg = this.$i18n.locale == 'zh' ? '暂无数据' : 'No Data'
- setTimeout(() => {
- uni.hideLoading();
- }, 100)
- },
- created() {
- this.initData()
- },
- methods: {
- share() {
- this.ifShare = !this.ifShare;
- },
- i18n(data) {
- return this.$t('common.' + data);
- },
- async initData() {
- await this.getBaseFinancialInstitutionInfos()
- await this.getInformationList()
- },
- // tabs通知swiper切换
- tabsChange(index) {
- this.swiperCurrent = index;
- },
- // swiper-item左右移动,通知tabs的滑块跟随移动
- transition(e) {
- let dx = e.detail.dx;
- this.$refs.uTabs.setDx(dx);
- },
- // 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态 // swiper滑动结束,分别设置tabs和swiper的状态
- animationfinish(e) {
- let current = e.detail.current;
- this.$refs.uTabs.setFinishCurrent(current);
- this.swiperCurrent = current;
- this.current = current;
- },
- // 获取详情
- async getBaseFinancialInstitutionInfos() {
- let params = {
- pageNo: this.pageNo,
- language: this.$i18n.locale,
- baseEntityId: this.baseEntityId
- }
- const res = await this.$myRequest({
- url: '/project/baseFinancialInstitutionInfos/',
- data: {
- ...params
- }
- });
- // let res = await getBaseFinancialInstitutionInfos(params);
- this.detial = res.data.baseFinancialInstitutionInfos[0];
- this.$set(this.detial, 'photo', 'https://m.geidcp.com/api/file/pub/' + this.detial.photo);
- this.getFollowModelStatusByModelIdAndUserId();
- },
- // 获取产品与服务列表
- async getInformationList() {
- let params = {
- businessType: 'financial_institutions',
- businessId: this.detial.baseEntityId,
- language: this.$i18n.locale.toLocaleUpperCase(),
- }
- const res = await this.$myRequest({
- url: '/cms/cmsInformationViews/getInformationList/',
- data: {
- ...params
- }
- });
- // let res = await getInformationList(params);
- if (res.data.allDataList.length > 0) {
- this.tabs[0]['list'] = res.data['1']; //产品与服务
- this.tabs[1]['list'] = res.data['2']; //投融资案例
- this.infoList = res.data['3']; //机构动态
- }
- },
- //格式化日期
- publishDate(timenumber) {
- return new Date(parseInt(timenumber)).toLocaleDateString().replace(new RegExp(/\//, 'mg'), '-');
- },
- // scroll-view到底部加载更多
- onreachBottom() {
- },
- toShowDetial(item) {
- uni.setStorageSync('detialInfo', item)
- uni.navigateTo({
- url: '/pages/financialService/financialOrgans/organsInfoDetial'
- })
- },
- // 是否被关注
- async getFollowModelStatusByModelIdAndUserId() {
- let res = await this.$myRequest({
- url: '/op/basePortalModelFollowInfos/followModelStatusByModelIdAndUserId',
- data: {
- modelId: this.baseEntityId,
- modelType: this.modelType,
- userId: this.userId
- }
- })
- this.followed = res.data;
- },
- // 关注或取消关注
- async saveFollowModel(flag) {
- if (this.token.length <= 7) {
- uni.navigateTo({
- url: '/pages/public/login?back=1'
- })
- } else {
- let [type, msg, followfailmsg] = [];
- if (!flag) {
- type = "follow";
- msg = this.$i18n.locale == 'zh' ? '关注成功' : 'fowllow success'
- followfailmsg = this.$i18n.locale == 'zh' ? '关注失败' : 'fowllow fail'
- } else {
- type = "unfollow"
- msg = this.$i18n.locale == 'zh' ? '取消关注成功' : 'cancel fowllow success'
- followfailmsg = this.$i18n.locale == 'zh' ? '取消关注成功关注失败' : 'cnacel fowllow fail'
- }
- let res = await this.$myRequest({
- url: '/op/basePortalModelFollowInfos/followModel',
- method: 'post',
- headers: {
- token: this.token
- },
- data: {
- modelId: this.baseEntityId,
- modelType: this.modelType,
- userId: this.userId,
- followType: type,
- }
- })
- if (!flag) {
- if (res.status == '200' && res.msg == 'ok') {
- this.$refs.uToast.show({
- title: msg,
- type: 'success'
- })
- this.followed = !this.followed;
- } else this.$refs.uToast.show({
- title: followfailmsg,
- type: 'error'
- })
- } else {
- if (res.status == '200' && res.msg == 'ok') {
- this.$refs.uToast.show({
- title: msg,
- type: 'success'
- })
- this.followed = !this.followed;
- } else this.$refs.uToast.show({
- title: followfailmsg,
- type: 'error'
- })
- }
- }
- },
- //点击查看全部
- showAll() {
- this.flag = true
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- /deep/ .uni-swiper-wrapper {
- min-height: 550upx !important;
- }
- /deep/ .u-tabs-scroll-box {
- display: flex;
- justify-content: space-around;
- }
- .organsDetial {
- background: #fefefe;
- .line5 {
- width: 100%;
- height: 10upx;
- background: #eee;
- }
- .banner {
- position: relative;
- // height: 340upx;
- .bannerimg {
- display: block;
- width: 100%;
- height: 100%;
- }
- }
- .headInfo {
- padding: 3%;
- .title {
- // height:80upx;
- // line-height:80upx;
- font-weight: 600;
- font-size: 30upx;
- color: #666;
- }
- .web,
- .address {
- height: 50upx;
- line-height: 50upx;
- display: flex;
- .label {
- width: 90upx;
- }
- .text {
- flex: 1;
- }
- }
- .des {
- // display:flex;
- margin-top: 20upx;
- .label {
- float: left;
- max-width: 200upx;
- }
- .text {
- .more {
- float: right;
- color: #2979FF;
- }
- .introduct1 {
- height: 120upx;
- display: inline-block;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 3;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- // .introduct2{
- // display:inline-block;
- // }
- // flex:1;
- // color:#666;
- }
- }
- }
- .tab {
- .tabtitle {
- width: 100%;
- padding: 0 3%;
- height: 80upx;
- display: flex;
- align-items: center;
- justify-content: space-around;
- .item {
- width: 40%;
- border-bottom: 2upx solid transparent;
- text-align: center;
- line-height: 80upx;
- &.active {
- color: #007AFF;
- border-bottom: 4upx solid #007AFF;
- }
- }
- }
- .tabcontent {
- padding: 0 3%;
- min-height: 550upx;
- border-top: 1px solid #eee;
- margin-top: 1px;
- .page {
- .pageitem {
- border-bottom: 2upx solid #eee;
- margin: 16upx 0;
- padding: 2% 0;
- .label {
- color: #666;
- }
- .date {
- color: #aaa;
- font-size: 20upx;
- }
- &:last-of-type {
- border: none;
- }
- }
- }
- }
- }
- .nodata {
- height: 200upx;
- line-height: 200upx;
- text-align: center;
- color: #aaa;
- }
- .dynamic {
- padding: 3%;
- width: 100%;
- .zoneTitle {
- height: 100upx;
- line-height: 100upx;
- font-weight: bold;
- position: relative;
- margin-left: 10upx;
- color: #666;
- &:before {
- content: "";
- width: 6upx;
- height: 40upx;
- background: #04e;
- position: absolute;
- left: -10upx;
- top: 50%;
- margin-top: -22upx;
- }
- }
- .infoList {
- .item {
- display: flex;
- margin: 20upx 0;
- border-bottom: 1px solid #eee;
- .thumb {
- width: 200upx;
- position: relative;
- overflow: hidden;
- margin-right: 20upx;
- .thumbimg {
- display: block;
- width: 100%;
- margin-top: 10upx;
- }
- }
- .info {
- flex: 1;
- .title {
- margin-bottom: 10upx;
- }
- .date {
- font-size: 20upx;
- color: #aaa;
- margin-bottom: 10upx;
- }
- }
- }
- }
- }
- }
- </style>
|