123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659 |
- <template>
- <view class="rf-category">
- <!--<u-navbar :back-text="i18n('Back')" :back-text-style="backStyle"
- back-icon-color="#fff" title-color="#fff"
- :title="i18n('CountryDetails')"
- :background="background">
- </u-navbar>-->
- <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'}">
- <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="uni-margin-wrap">
- <swiper class="swiper" circular :indicator-dots="true" indicator-active-color="#333" :autoplay="false"
- :interval="2000" :duration="500">
- <swiper-item v-for="(item,index) in photos" :key="index">
- <navigator>
- <image class="swiper-img" :src="websiteUrl+item"></image>
- </navigator>
- </swiper-item>
- </swiper>
- </view>
- <view style="margin-left: 10px;">
- <view style="font-weight: bold;">{{countryInfo.zhName}}</view>
- <view style="margin-top: 10px;">{{$t('common.EnglishName') }}:{{countryInfo.enName}}</view>
- <view style="margin-top: 10px;">{{$t('common.State') }}:{{areMap[countryInfo.areDict]}}</view>
- <view style="margin-top: 10px;">{{$t('common.Basicsituation') }}:</view>
- <view>{{countryInfo.basicProfile}}</view>
- </view>
- <view style="margin-top: 10px;">
- <scroll-view scroll-x class="index-cate">
- <view style="display: inline-block;width: 100%;" :style="$i18n.locale=='en'?
- 'display: flex;justify-content: space-between;':''">
- <view class="index-cate-item2" :style="$i18n.locale=='zh'?
- 'width:30%;':''" style="color: #000;" :class="tabCurrentIndex === 1 ? `text-${themeColor.name} active` : ''"
- @tap.stop="tabClick(1)">
- {{$t('common.Resources') }}
- </view>
- <view :style="$i18n.locale=='zh'?
- 'width:30%;':''" class="index-cate-item2" style="color: #000;"
- :class="tabCurrentIndex === 2 ? `text-${themeColor.name} active` : ''" @tap.stop="tabClick(2)">
- {{ $t('common.EnergyDevelopmentPlanning') }}
- </view>
- <view :style="$i18n.locale=='zh'?
- 'width:30%;':''" class="index-cate-item2" style="color: #000;"
- :class="tabCurrentIndex === 3 ? `text-${themeColor.name} active` : ''" @tap.stop="tabClick(3)">
- {{ $t('common.ProjectDevelopmentGuide') }}
- </view>
- <view :style="$i18n.locale=='zh'?
- 'width:30%;':''" class="index-cate-item2" style="color: #000;"
- :class="tabCurrentIndex === 4 ? `text-${themeColor.name} active` : ''" @tap.stop="tabClick(4)">
- {{ $t('common.LawsRegulations') }}
- </view>
- </view>
- </scroll-view>
- <view v-if="tabCurrentIndex==1" style="margin-left: 10px;margin-top: 10px;">
- <view v-html="info1.contentHtml"></view>
- <view v-if="info1.contentHtml == '' || info1.contentHtml == null " style="text-align: center">{{$t('common.Nodataavailable')}}</view>
- </view>
- <view v-if="tabCurrentIndex==2 && isLogin" style="margin-left: 10px;margin-top: 10px;">
- <view v-html="info2.contentHtml"></view>
- <view v-if="info2.contentHtml == '' || info2.contentHtml == null " style="text-align: center">{{$t('common.Nodataavailable')}}</view>
- </view>
- <view v-if="tabCurrentIndex==3 && isLogin" style="margin-left: 10px;margin-top: 10px;">
- <view v-html="info3.contentHtml"></view>
- <view v-if="info3.contentHtml == '' || info3.contentHtml == null " style="text-align: center">{{$t('common.Nodataavailable')}}</view>
- </view>
- <view v-if="tabCurrentIndex==4 && isLogin" style="margin-left: 10px;margin-top: 10px;">
- <view v-html="info4.contentHtml"></view>
- <Regulations :pdfUrl="pdfUrl" :baseEntityId="baseEntityId"></Regulations>
- </view>
- </view>
- <!-- 8.8.20.112:19001
- -->
- <share v-show="ifShare == true" :show="ifShare" @closeShare="share"
- :title="i18n('Country') + '->' + i18n('CountryInformation')" :summary="$i18n.locale=='zh'? countryInfo.zhName : countryInfo.enName "
- :href="'https://m.geidcp.com/#/pages/country/countryList/countryDetail?' + 'baseEntityId=' + baseEntityId + '&language=' + $i18n.locale"
- :imageUrl="photos && photos[0]?websiteUrl+ photos[0] + '?custom=370_220':
- '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 {
- addIntegral
- } from '@/components/addPointDetailByTaskDict.js'
- import UNavbar from '@/components/uni-nav-bar/uni-nav-bar.vue'
- import mSearch from '@/components/rf-search/rf-search';
- import newsItem from '@/pages/information/news-item'
- import share from '@/components/share'
- import Regulations from './regulations'
- export default {
- data() {
- return {
- tabCurrentIndex: 1,
- baseEntityId: '',
- countryInfo: Object,
- photos: [],
- info1: Object,
- info2: Object,
- info3: Object,
- info4: Object,
- areDict: [],
- ifShare: false,
- background: {
- backgroundImage: 'linear-gradient(270deg, #4BC0E2 0%, #538BE7 100%)',
- },
- backStyle: {
- color: '#fff'
- },
- followed: '',
- modelType: 'country',
- pdfUrl: '',
- // token:'',
- isLogin: false,
- }
- },
- components: {
- UNavbar,
- mSearch,
- newsItem,
- share,
- Regulations,
- addIntegral
- },
- computed: {
- areMap() {
- let obj = {
- }
- this.areDict.forEach(item => {
- obj[item.value] = item.label
- })
- return obj;
- }
- },
- onLoad(option) {
- this.baseEntityId = option.baseEntityId;
- if (option.language) {
- uni.setStorageSync("language", option.language);
- this._i18n.locale = option.language;
- }
- },
- onReady() {
- this.token = uni.getStorageSync('Auth-Token') ? ('Bearer ' + uni.getStorageSync('Auth-Token')) : '';
- console.log('this.token')
- console.log(this.token)
- this.userId = uni.getStorageSync('user') ? (JSON.parse(uni.getStorageSync('user')).id) : '';
- this.cofLogin();
- this.getCountryInfo()
- this.tab1()
- this.tab2()
- this.tab3()
- this.tab4()
- this.dict()
- this.getFollowModelStatusByModelIdAndUserId()
- },
- methods: {
- // //判断登录
- cofLogin() {
- if (this.token == '' && uni.getStorageSync('user') == '') {
- this.isLogin = false;
- } else {
- this.isLogin = true;
- }
- },
- //跳转链接
- navTo(route) {
- if (this.$i18n.locale == 'zh') {
- this.$refs.uToast.show({
- title: '请登录',
- type: 'warning',
- url: '/pages/public/login',
- duration: 800,
- params: {
- back: 1
- }
- })
- } else {
- this.$refs.uToast.show({
- title: 'please log in',
- type: 'warning',
- url: '/pages/public/login',
- duration: 800,
- params: {
- back: 1
- }
- })
- }
- },
- share() {
- this.ifShare = !this.ifShare;
- },
- i18n(data) {
- return this.$t('common.' + data);
- },
- tabClick(index) {
- this.tabCurrentIndex = index;
- if (index != 1) {
- if (this.token == '' && uni.getStorageSync('user') == '') {
- this.isLogin = false;
- this.toLogin()
- }else {
- this.isLogin = true;
- }
- }
- },
- //登录跳转
- toLogin() {
- if (this.$i18n.locale == 'zh') {
- this.$refs.uToast.show({
- title: '请登录',
- type: 'warning',
- url: '/pages/public/login',
- duration: 800,
- params: {
- back: 1
- }
- })
- } else {
- this.$refs.uToast.show({
- title: 'please log in',
- type: 'warning',
- url: '/pages/public/login',
- duration: 800,
- params: {
- back: 1
- }
- })
- }
- },
- async getCountryInfo(baseEntityId) {
- const res = await this.$myRequest({
- url: '/project/baseCountryViews/',
- data: {
- baseEntityId: this.baseEntityId,
- language: this.$i18n.locale.toUpperCase()
- }
- });
- this.id = res.baseEntityId;
- if (res.data) {
- this.countryInfo = res.data.baseCountryViews[0];
- this.photos = this.countryInfo.photo.split(",")
- }
- },
- async tab1(baseEntityId) {
- const res = await this.$myRequest({
- url: '/cms/cmsInformationViews/getInformationList/',
- data: {
- pageSize: 5,
- pageNo: 1,
- businessType: 'countryShow',
- businessId: this.baseEntityId,
- typeDict: 2,
- language: this.$i18n.locale.toUpperCase()
- }
- });
- if (res.data.allDataList.length != 0) {
- this.info1 = res.data.allDataList[0];
- }
- },
- async tab2(baseEntityId) {
- const res = await this.$myRequest({
- url: '/cms/cmsInformationViews/getInformationList/',
- data: {
- pageSize: 5,
- pageNo: 1,
- businessType: 'countryShow',
- businessId: this.baseEntityId,
- typeDict: 3,
- language: this.$i18n.locale.toUpperCase()
- }
- });
- if (res.data.allDataList.length != 0) {
- this.info2 = res.data.allDataList[0];
- }
- },
- async tab3(baseEntityId) {
- const res = await this.$myRequest({
- url: '/cms/cmsInformationViews/getInformationList/',
- data: {
- pageSize: 5,
- pageNo: 1,
- businessType: 'countryShow',
- businessId: this.baseEntityId,
- typeDict: 5,
- language: this.$i18n.locale.toUpperCase()
- }
- });
- if (res.data.allDataList.length != 0) {
- this.info3 = res.data.allDataList[0];
- }
- },
- async tab4(baseEntityId) {
- const res = await this.$myRequest({
- url: '/cms/cmsInformationViews/getInformationList/',
- data: {
- pageSize: 5,
- pageNo: 1,
- businessType: 'countryShow',
- businessId: this.baseEntityId,
- typeDict: 8,
- language: this.$i18n.locale.toUpperCase()
- }
- });
- if (res.data.allDataList.length != 0) {
- this.info4 = res.data ? res.data.allDataList[0] : [];
- this.pdfUrl = this.info4?.pdfPath ? 'api/file/pub/' + this.info4?.pdfPath : '';
- }
- },
- async dict() {
- const res = await this.$myRequest({
- url: '/sys/sysDicts',
- data: {
- type: this.$i18n.locale == 'en' ? "CONTINENT_CODE_DICT_EN" : "CONTINENT_CODE_DICT"
- }
- });
- if (res.data) {
- this.areDict = res.data[0]
- }
- },
- // 是否被关注
- 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";
- addIntegral('point_task_attention', '1')
- 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'
- })
- }
- }
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .rf-category {
- background-color: $color-white;
- }
- .recommend-bottom {
- float: right;
- height: 200upx;
- width: 488upx;
- }
- .index-cate .index-cate-item2 {
- display: inline-block;
- height: 75upx;
- line-height: 75upx;
- margin: 0 15upx 10upx;
- text-align: center;
- font-size: $font-base;
- color: $color-white;
- }
- .infoList {
- padding-top: 20upx;
- display: flex;
- flex-direction: initial;
- justify-content: space-between;
- }
- .leftImg {
- width: 185upx;
- height: 140upx;
- }
- .img {
- width: 100%;
- height: 100%;
- }
- .rightCont {
- width: 460upx;
- padding-bottom: 20upx;
- border-bottom: 1px solid #F1F1F1;
- }
- .title {
- color: #333333;
- font-size: 32upx;
- font-weight: 700;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .title-base {
- font-size: 24upx;
- color: #999999;
- margin-top: 10upx;
- display: flex;
- flex-direction: initial;
- }
- .time {
- margin-left: 30upx;
- }
- .info-cont {
- margin-top: 10upx;
- font-size: 28upx;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .view {
- flex-direction: column;
- }
- .flex-row {
- flex-direction: row;
- }
- .flex-col {
- flex-direction: column;
- }
- .list-cell {
- padding: 0 15px;
- }
- .uni-list-cell-hover {
- background-color: #eeeeee;
- }
- .media-item {
- position: relative;
- flex: 1;
- flex-direction: column;
- padding: 0 30upx;
- }
- .media-item-line {
- position: absolute;
- left: 15px;
- right: 15px;
- bottom: 0;
- height: 1px;
- background-color: #ebebeb;
- }
- .media-image-right {
- flex-direction: row;
- }
- .media-image-left {
- flex-direction: row-reverse;
- }
- .media-title {
- flex: 1;
- }
- .media-title {
- lines: 3;
- text-overflow: ellipsis;
- font-size: 15px;
- color: #555555;
- }
- .media-title2 {
- flex: 1;
- margin-top: 3px;
- line-height: 20px;
- }
- .image-section {
- margin-top: 10px;
- flex-direction: row;
- justify-content: space-between;
- }
- .image-section-right {
- margin-top: 0;
- margin-left: 5px;
- width: 112px;
- height: 73px;
- }
- .image-section-left {
- margin-top: 0;
- margin-right: 5px;
- width: 112px;
- height: 73px;
- }
- .image-list1 {
- height: 240px;
- }
- .image-list2 {
- width: 112px;
- height: 73px;
- }
- .image-list3 {
- width: 112px;
- height: 73px;
- }
- .media-info {
- flex-direction: row;
- align-items: center;
- }
- .info-text {
- margin-right: 10px;
- color: #999999;
- font-size: 12px;
- }
- .media-foot {
- margin-top: 12px;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- }
- .close-view {
- position: relative;
- align-items: center;
- flex-direction: row;
- width: 20px;
- height: 15px;
- line-height: 15px;
- border-width: 1upx;
- border-style: solid;
- border-color: #aaaaaa;
- border-radius: 4px;
- justify-content: center;
- text-align: center;
- }
- .close-l {
- position: absolute;
- width: 9px;
- height: 1px;
- background-color: #aaaaaa;
- }
- .close-h {
- transform: rotate(45deg);
- }
- .close-v {
- transform: rotate(-45deg);
- }
- .uni-margin-wrap {}
- .swiper {
- width: 100%;
- height: 310upx;
- }
- .swiper-img {
- width: 100%;
- height: 310upx;
- }
- .recommend-bottom-name {
- font-size: 35upx;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #0B0B11;
- line-height: 65upx;
- margin-top: 30upx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- </style>
|