7.10 增加登录页面,事件详情接口对接,我的点赞,关注收藏页面搭建,接口对接

This commit is contained in:
尚政杰
2025-07-10 18:08:16 +08:00
parent c4267a0e27
commit 58b3414bdd
356 changed files with 7710 additions and 978 deletions

View File

@@ -2,13 +2,13 @@
<view>
<navBar leftText="事件详情"></navBar>
<image class="topBg absolute" src="/static/image/mine/myTopBg.png" mode="widthFix"></image>
<view class="eventDetailsC fixed" :style="'top:'+navH+'px;'">
<view v-if="eventDetails" class="eventDetailsC fixed" :style="'top:'+navH+'px;'">
<view class="categoryTitleC">
<view class="category">政策</view>
<text class="title">四部门联合启动人力资源服务业与制造业融合发展试点</text>
<view class="category">{{eventDetails.event_type}}</view>
<text class="title">{{eventDetails.event_title}}</text>
</view>
<view class="time">2025-05-08 08:43</view>
<view class="eventContent">人社部工信部等四部门印发通知明确在30个城市开展3年期试点培育人力资源服务与制造业协同机构打造融合平台和创新模式政策</view>
<view class="eventTime">{{eventDetails.event_created_at.substr(0,16)}}</view>
<view class="eventContent">{{eventDetails.event_desc}}</view>
<scroll-view scroll-x class="categoryList">
<view :class="'item relative '+(selectCategory==index?'select':'')" v-for="(item,index) in categoryList" :key="index" @click="clickCategoryItem(index)">
{{item}}
@@ -21,54 +21,95 @@
</view>
</view>
<view v-if="selectCategory==0" class="targetList">
<view class="item">
<view class="item" v-for="(item,index) in targetList" :key="index" @click="clickStockItem(item.stock_code)">
<view class="nameCodePriceC flex">
<view class="flex1">
<view class="name">科锐国际</view>
<view class="code">300662.SZ</view>
<view class="name">{{item.stock_name}}</view>
<view class="code">{{item.stock_code}}</view>
</view>
<view class="flex1">
</view>
<view class="price flex1">30.04</view>
<view class="price flex1">30.15</view>
<view class="chg flex1">+0.37%</view>
</view>
<view class="content">
科锐国际作为灵活用工龙头企业其业务高度契合政策推动的制造业高端人才引育方向公司技术研发类岗位占比达70%直接匹配政策要求
<view class="price flex1">{{item.trade_data.open_price}}</view>
<view class="price flex1">{{item.trade_data.latest_price}}</view>
<view :class="'chg flex1 '+(getRateUpOrDown(item.trade_data.change_pct)?'down':'up')">{{item.trade_data.change_pct}}%</view>
</view>
<view class="content">{{item.relation_desc}}</view>
</view>
</view>
<view v-if="selectCategory==1" class="conceptList">
<view class="item relative" @click="clickConceptItem()">
<image class="cover" src="" mode="aspectFill"></image>
<view class="item relative" v-for="(item,index) in conceptList" :key="index" @click="clickConceptItem()">
<image class="cover" :src="item.first_image" mode="aspectFill"></image>
<view class="infoC absolute">
<view class="title">布鲁可IP衍生品(250109)</view>
<view class="content">
四部门联合启动的人力资源服务业与制造业融合发展试点主要目的是推动
人力资源服务...
<text class="lookDetails">查看详情</text>
<view class="title">{{item.concept}}</view>
<view class="content relative">{{item.reason}}
<text class="lookDetails absolute">查看详情</text>
</view>
</view>
</view>
</view>
<view v-if="selectCategory==2" class="historyEventList">
<view class="expectScoreC flex" @click="clickExpectScore($event)">
<image class="icon" src="/static/icon/home/expectScore.png" mode="widthFix"></image>
<view class="score flex1">超预期得分{{expectScore}}</view>
<image class="tips" src="/static/icon/home/expectScoreTips.png" mode="widthFix"></image>
</view>
<view class="list">
<view class="item flexStretch" v-for="(item,index) in historyEventList" :key="index">
<view class="eventLineC relative">
<view class="line"></view>
<view class="pointC absolute flexCenter">
<view class="point"></view>
</view>
</view>
<view class="eventInfoC flex1">
<view class="titleCorrelationC flex">
<view class="title flex1">{{item.title}}</view>
<view class="correlation">相关度: 98%</view>
</view>
<view class="content">{{item.content}}</view>
<scroll-view scroll-x class="increaseRateList">
<view :class="'rateItem '+(getRateUpOrDown(item.related_avg_chg)?'down':'up')">
平均涨幅:
<image v-if="getRateUpOrDown(item.related_avg_chg)" class="arrow" src="/static/icon/home/downArrow.png" mode="widthFix"></image>
<image v-else class="arrow" src="/static/icon/home/upArrow.png" mode="widthFix"></image>
{{getRateStr(item.related_avg_chg)}}%
</view>
<view :class="'rateItem '+(getRateUpOrDown(item.related_max_chg)?'down':'up')">
最大涨幅:
<image v-if="getRateUpOrDown(item.related_max_chg)" class="arrow" src="/static/icon/home/downArrow.png" mode="widthFix"></image>
<image v-else class="arrow" src="/static/icon/home/upArrow.png" mode="widthFix"></image>
{{getRateStr(item.related_max_chg)}}%
</view>
</scroll-view>
<view class="relatedStockTimeC flex flex1">
<view class="relatedStockC flex" @click.stop="clickLookHistoricalEventRelatedStock(item)">
<image class="icon" src="/static/icon/home/expectScore.png" mode="widthFix"></image>
查看相关股票
</view>
<view class="time flex1">{{getLocaleTime(item.event_date)}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="bottomC fixed flex">
<view v-if="eventDetails" class="bottomC fixed flex">
<view class="inputC flex1">
<input type="text" placeholder="我来说两句..." placeholder-style="color:#666"/>
<input type="text" v-model="eventComment" placeholder="我来说两句..." placeholder-style="color:#666" confirm-type="send" @confirm="sendEventComment()"/>
</view>
<view class="commentLikeNumC flex">
<view class="item">
<image class="icon" src="/static/icon/home/browser.png" mode="widthFix"></image>
<view>64</view>
<view>{{eventDetails.view_count}}</view>
</view>
<view class="item" @click="clickComment()">
<image class="icon" src="/static/icon/home/comment.png" mode="widthFix"></image>
<view>28</view>
<view>{{eventDetails.post_count}}</view>
</view>
<view class="item">
<view class="item" @click="clickFollow()">
<image class="icon" src="/static/icon/home/follow.png" mode="widthFix"></image>
<view>128</view>
<view>{{eventDetails.follower_count}}</view>
</view>
</view>
</view>
@@ -132,21 +173,70 @@
</view>
</view>
</uni-popup>
<uni-popup ref="expectScorePopup" type="top" mask-background-color="transparent">
<view class="expectScorePopup relative" :style="'margin-top:'+scoreTop+'px;'">
<image class="arrow absolute" src="/static/icon/home/sortArrow.png" mode="widthFix"></image>
<view class="tips">
超预期得分:基于历史事件判断当前事件的超预期情况满分100分得分越高越超预期
</view>
</view>
</uni-popup>
<uni-popup ref="stockPopup" type="bottom">
<view class="stockPopup">
<view class="titleCloseC flex">
<view class="title flex1">相关股票</view>
<view class="closeC" @click="closeRelatedStockPopup()">
<image class="icon" src="/static/icon/home/close.png" mode="widthFix"></image>
</view>
</view>
<view class="list">
<view class="item" v-for="(item,index) in historyEventRelatedStockList" :key="index" @click="clickStockItem(item.stock_code)">
<view class="titleCorrelationC flex">
<view class="title flex1">{{item.stock_name+'('+item.stock_code+')'}}</view>
<view class="correlation">相关度: {{item.correlation*100}}%</view>
</view>
<view class="sectorRateC">
<view class="sector">{{item.sector}}</view>
<view class="rateC">
当日涨幅:
<image v-if="getRateUpOrDown(item.daily_change)" class="arrow" src="/static/icon/home/downArrow.png" mode="widthFix"></image>
<image v-else class="arrow" src="/static/icon/home/upArrow.png" mode="widthFix"></image>
{{getRateStr(item.daily_change)}}%
</view>
</view>
<view class="content">{{item.relation_desc}}</view>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import { inject } from 'vue';
import { eventDetails } from '../../../request/api';
import { eventRelatedConcept, eventHistoryEvent, eventRelatedStock, eventCommentList, commentEvent } from '@/request/api';
import { getLocaleTime, getRateStr, getRateUpOrDown } from '@/utils/util';
export default {
data() {
return {
navH:inject('navHeight'),
windowWidth:inject('windowWidth'),
eventId:'', //事件id
eventDetails:null, //事件详情
categoryList:['相关标的','相关概念','历史事件','时间传导链分析','关联数据'],
targetList:[], //相关标的
conceptList:[], //相关概念
historyEventList:[], //历史事件
historyEventRelatedStockList:[], //历史事件相关股票
selectCategory:0,
headingList:['名称代码','分时图','开盘价','最新价','涨跌幅']
headingList:['名称代码','分时图','开盘价','最新价','涨跌幅'],
getLocaleTime:getLocaleTime,
getRateUpOrDown:getRateUpOrDown,
getRateStr:getRateStr,
scoreTop:'',
eventComment:'', //事件评论
expectScore:0, //预期得分
}
},
onLoad(e)
@@ -154,7 +244,8 @@
if(e.id)
{
this.eventId = e.id
this.getEventDetailsData()
this.getEventRelatedStockData()
this.getEventCommentListData()
}
},
methods: {
@@ -166,15 +257,28 @@
if(this.selectCategory!=index)
{
this.selectCategory = index
if(index==0)
{
//相关标的
this.getEventRelatedStockData()
}else if(index==1)
{
//相关概念
this.getEventRelatedConceptData()
}else if(index==2)
{
//历史事件
this.getEventHistoryEventData()
}
}
},
/**
* 点击查看股票详情
*/
clickStockItem()
clickStockItem(code)
{
uni.navigateTo({
url:'/pages/index/stockDetails/stockDetails'
url:'/pages/index/stockDetails/stockDetails?code='+code
})
},
/**
@@ -186,6 +290,51 @@
url:'/pages/index/conceptDetails/conceptDetails'
})
},
/**
* 点击查看历史事件的相关股票
*/
clickLookHistoricalEventRelatedStock(item)
{
this.historyEventRelatedStockList = item.related_stocks
this.$refs['stockPopup'].open()
},
/**
* 点击关闭相关股票弹窗
*/
closeRelatedStockPopup()
{
this.$refs['stockPopup'].close()
},
/**
* 点击查看超预期得分
*/
clickExpectScore(e)
{
this.scoreTop = e.currentTarget.offsetTop+this.navH+(70+10+20)/750*this.windowWidth
this.$refs['expectScorePopup'].open()
},
/**
* 点击发送事件评论
*/
sendEventComment()
{
if(!this.eventComment)
{
uni.showToast({
title:'请输入评论内容',
icon:'none'
})
return
}
let eventId = this.eventId
let param = {content:this.eventComment}
commentEvent(eventId,param).then(res=>{
}).catch(error=>{
})
},
/**
* 点击评论
*/
@@ -193,18 +342,95 @@
{
this.$refs['popup'].open()
},
/**
* 点击关闭评论弹窗
*/
closeCommentPopup()
{
this.$refs['popup'].close()
},
/**
* 获取事件详情数据
* 点击关注
*/
getEventDetailsData()
clickFollow()
{
let eventId = this.eventId
eventDetails(eventId).then(res=>{
followEvent(eventId).then(res=>{
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
},
/**
* 获取事件相关标的数据
*/
getEventRelatedStockData()
{
let eventId = this.eventId
eventRelatedStock(eventId).then(res=>{
if(res.code==200)
{
this.eventDetails = res.data
this.targetList = res.data.related_stocks
}else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
},
/**
* 获取事件相关概念数据
*/
getEventRelatedConceptData()
{
let eventId = this.eventId
eventRelatedConcept(eventId).then(res=>{
if(res.code==200)
{
this.conceptList = res.data.related_concepts
}else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
},
/**
* 获取事件历史事件数据
*/
getEventHistoryEventData()
{
let eventId = this.eventId
eventHistoryEvent(eventId).then(res=>{
if(res.code==200)
{
this.expectScore = res.data.invest_score
this.historyEventList = res.data.historical_events
}else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
},
/**
* 获取事件评论列表
*/
getEventCommentListData()
{
let eventId = this.eventId
eventCommentList(eventId).then(res=>{
this.commentList = res.data.comments
}).catch(error=>{
})
@@ -230,7 +456,7 @@
right: 0;
bottom: calc(20rpx + 70rpx + 20rpx + env(safe-area-inset-bottom));
border-radius: 20rpx 20rpx 0 0;
overflow-y: hidden;
overflow-y: scroll;
.categoryTitleC
{
padding: 0 25rpx;
@@ -253,7 +479,7 @@
color: #222;
}
}
.time
.eventTime
{
margin: 20rpx 25rpx 0;
font-size: 22rpx;
@@ -329,15 +555,20 @@
}
.price
{
font-size: 28rpx;
font-weight: bold;
color: #222;
text-align: center;
}
.chg
{
text-align: center;
}
.chg.up
{
color: #FF2929;
}
.chg.down
{
color: #22C55E;
}
}
.content
{
@@ -352,9 +583,9 @@
padding: 30rpx 25rpx;
.item
{
margin-bottom: 20rpx;
.cover
{
background-color: red;
display: block;
width: 100%;
height: 350rpx;
@@ -367,6 +598,7 @@
left:0;
width: 100%;
bottom: 0;
border-radius: ;
color: white;
.title
{
@@ -375,18 +607,177 @@
}
.content
{
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
margin-top: 10rpx;
font-size: 20rpx;
font-weight: 500;
line-height: 1.2rem;
.lookDetails
{
right: 0;
color: #F97316;
}
}
}
}
}
.historyEventList
{
padding: 34rpx 25rpx;
.expectScoreC
{
background-color: #FBEFE7;
padding: 0 25rpx;
height: 70rpx;
.icon
{
margin-right: 14rpx;
width: 24rpx;
height: auto;
}
.score
{
font-size: 24rpx;
font-weight: 500;
color: #F97316;
}
.tips
{
margin-left: 14rpx;
width: 24rpx;
height: auto;
}
}
.list
{
padding: 23rpx 0;
.item
{
.eventLineC
{
padding: 0 43rpx 0 15rpx;
.line
{
background-color: #F0F0F0;
width: 1px;
height: 100%;
}
.pointC
{
background-color: #F9731680;
top: 0;
left: 5rpx;
width: 20rpx;
height: 20rpx;
border-radius: 50%;
.point
{
background-color: #F97316;
width: 10rpx;
height: 10rpx;
border-radius: 50%;
}
}
}
.eventInfoC
{
box-shadow: 0px 5px 10px 0px rgba(0,0,0,0.07);
margin-bottom: 20rpx;
padding-top: 27rpx;
min-width: 0;
border-radius: 10rpx;
.titleCorrelationC
{
padding: 0 24rpx 0 30rpx;
.title
{
min-width: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 30rpx;
font-weight: bold;
color: #222;
}
.correlation
{
background-color: #F973161A;
padding: 0 12rpx;
line-height: 40rpx;
border-radius: 5rpx;
font-size: 24rpx;
font-weight: 500;
color: #F97316;
}
}
.content
{
margin: 16rpx 30rpx 0;
font-size: 24rpx;
font-weight: 500;
color: #666;
}
.increaseRateList
{
white-space: nowrap;
padding: 0 30rpx;
margin-top: 24rpx;
.rateItem
{
display: inline-block;
margin-right: 15rpx;
line-height: 44rpx;
padding: 0 14rpx;
border-radius: 10rpx;
font-size: 22rpx;
font-weight: bold;
color: white;
.arrow
{
width: 15rpx;
height: auto;
}
}
.rateItem.up
{
background-color: #C00000;
}
.rateItem.down
{
background-color: #355422;
}
}
.relatedStockTimeC
{
padding-right: 28rpx;
.relatedStockC
{
padding: 16rpx 30rpx;
font-size: 24rpx;
font-weight: bold;
color: #F97316;
.icon
{
margin-right: 13rpx;
width: 24rpx;
height: auto;
}
}
.time
{
font-size: 22rpx;
font-weight: 500;
color: #aaa;
text-align: right;
}
}
}
}
}
}
}
.bottomC
{
@@ -413,12 +804,13 @@
{
.item
{
padding: 0 20rpx;
font-size: 26rpx;
font-weight: bold;
color: #666;
text-align: center;
.icon
{
margin: 0 20rpx;
width: 35rpx;
height: auto;
}
@@ -458,7 +850,6 @@
display: flex;
.avatar
{
background-color: red;
margin-right: 23rpx;
width: 80rpx;
height: 80rpx;
@@ -543,7 +934,6 @@
border-bottom: solid 1rpx #E4E4E4;
.avatar
{
background-color: red;
margin-right: 23rpx;
width: 80rpx;
height: 80rpx;
@@ -622,6 +1012,121 @@
}
}
}
}
.expectScorePopup
{
background-color: white;
margin-left: calc(100% - 320rpx - 24rpx);
width: 320rpx;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 10rpx;
.arrow
{
top: -13rpx;
right: 38rpx;
width: 26rpx;
height: auto;
}
.tips
{
padding: 30rpx 22rpx 20rpx;
font-size: 22rpx;
font-weight: 500;
color: #444;
}
}
.stockPopup
{
background-color: white;
border-radius: 20rpx 20rpx 0 0;
.titleCloseC
{
padding-left: 25rpx;
font-size: 32rpx;
font-weight: bold;
color: #222;
.closeC
{
padding: 28rpx;
.icon
{
width: 28rpx;
height: auto;
}
}
}
.list
{
border-top: solid 1rpx #E4E4E4;
margin: 0 25rpx;
max-height: 800rpx;
overflow-y: scroll;
.item
{
padding: 36rpx 0 28rpx;
border-bottom: solid 1rpx #E4E4E4;
.titleCorrelationC
{
.title
{
min-width: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 30rpx;
font-weight: bold;
color: #222;
}
.correlation
{
background-color: #F973161A;
padding: 0 12rpx;
line-height: 40rpx;
border-radius: 5rpx;
font-size: 24rpx;
font-weight: 500;
color: #F97316;
}
}
.sectorRateC
{
.sector
{
display: inline-block;
margin-right: 20rpx;
padding: 0 11rpx;
line-height: 30rpx;
border-radius: 5rpx;
border: solid 0.5px #F6604A;
font-size: 20rpx;
font-weight: 500;
color: #F6604A;
}
.rateC
{
background-color: #C00000;
display: inline-block;
padding: 0 10rpx;
height: 30rpx;
border-radius: 5rpx;
font-size: 20rpx;
font-weight: 500;
color: white;
.arrow
{
width: 15rpx;
height: auto;
}
}
}
.content
{
margin-top: 16rpx;
font-size: 24rpx;
font-weight: 500;
color: #666;
}
}
}
}
</style>

View File

@@ -14,7 +14,7 @@
<view :class="'item '+(selectTimeCategory==index?'select':'')" v-for="(item,index) in timeCategoryList" :key="index" @click="clickTimeCategoryItem(index)">{{item.name}}</view>
</view>
<view class="flex">
<view class="sortC flex" @click="clickSortItem()">
<view class="sortC flex" @click="clickSort()">
<image class="icon" src="/static/icon/home/sort.png" mode="widthFix"></image>
<text>排序</text>
</view>
@@ -25,14 +25,14 @@
</view>
</view>
</view>
<scroll-view scroll-x class="topCategoryC">
<view :class="'item relative '+(selectTopCategory==index?'select':'')" v-for="(item,index) in topCategoryList" :key="index" @click="clickTopCategoryItem(index)">
{{item}}
<scroll-view scroll-x :scroll-left="topScrollLeft" class="topCategoryC" id="topCategory">
<view :class="'item relative '+(selectTopCategory==index?'select':'')" v-for="(item,index) in stockCategoryList" :key="index" @click="clickTopCategoryItem($event,index)">
{{item.primary_sector}}
<view class="line absolute"></view>
</view>
</scroll-view>
<scroll-view scroll-x class="secondCategoryC">
<view :class="'item '+(selectSecondCategory==index?'select':'')" v-for="(item,index) in secondCategoryList" :key="index" @click="clickSecondCategoryItem(index)">
<scroll-view v-if="stockCategoryList.length>0&&stockCategoryList[selectTopCategory].sub_sectors.length>0" scroll-x :scroll-left="secondScrollLeft" class="secondCategoryC" id="secondCategory">
<view :class="'item '+(selectSecondCategory==index?'select':'')" v-for="(item,index) in stockCategoryList[selectTopCategory].sub_sectors" :key="index" @click="clickSecondCategoryItem($event,index)">
{{item}}
</view>
</scroll-view>
@@ -47,7 +47,7 @@
<view :class="'level '+item.importance">{{item.importance}}</view>
<view class="title">{{item.title}}</view>
</view>
<view class="content">{{item.description}}</view>
<view :class="'content '+(item.isExpand?'':'retract')" @click.stop="clickExpandOrRetract(index)">{{item.description}}</view>
<scroll-view scroll-x class="increaseRateList">
<view :class="'rateItem '+(getRateUpOrDown(item.related_avg_chg)?'down':'up')">
平均涨幅:
@@ -69,7 +69,7 @@
</view>
</scroll-view>
<scroll-view scroll-x class="stockList">
<view class="stockItem">中远海控 +1.46%</view>
<view class="stockItem" v-for="(sitem,sindex) in item.related_stocks" :key="sindex" @click.stop="clickLookRelatedStockItem(sitem.stock_code)">{{sitem.stock_name}} <text class="change">{{(getRateUpOrDown(sitem.daily_change)?'':'+')+sitem.daily_change}}%</text></view>
</scroll-view>
<view class="timeToolBarC flex">
<view class="time flex1">{{getLocaleTime(item.created_at)}}</view>
@@ -82,7 +82,7 @@
<image class="icon" src="/static/icon/home/comment.png" mode="widthFix"></image>
<text>{{item.post_count}}</text>
</view>
<view class="toolItem flex">
<view class="toolItem flex" @click.stop="clickFollowEvent(item.id)">
<image class="icon" src="/static/icon/home/follow.png" mode="widthFix"></image>
<text>{{item.follower_count}}</text>
</view>
@@ -95,7 +95,7 @@
<view class="sortPopup relative">
<image class="arrow absolute" src="/static/icon/home/sortArrow.png" mode="widthFix"></image>
<view class="list" :style="'margin-top:'+sortListTop+'px;'">
<view class="item flex" v-for="(item,index) in sortList" :key="index">
<view class="item flex" v-for="(item,index) in sortList" :key="index" @click="clickSortListItem(item)">
<image class="icon" :src="item.icon" mode="aspectFit"></image>
<text> {{item.name}}</text>
</view>
@@ -159,14 +159,31 @@
<block v-if="selectScreenCategory==1">
<view class="section">选择体系</view>
<view class="industryCategoryC flexWrap">
<view class="item" v-for="(item,index) in industryTopCategoryList" :key="index">
{{item}}
<view :class="'item '+(selectIndustryTopCategory==index?'select':'')" v-for="(item,index) in industryTopCategoryList" :key="index" @click="clickSelectIndustryTopCategoryItem(index)">
{{item.classification_name}}
</view>
</view>
<view class="industrySearchC flex">
<image class="icon" src="/static/icon/home/search.png" mode="widthFix"></image>
<input class="flex1" type="text" placeholder="搜索行业" placeholder-style="color:#94989A"/>
</view>
<view class="industryList">
<view class="selectCategoryList flexWrap">
</view>
<view class="list">
<view class="topCategory">{{industryTopCategoryList[selectIndustryTopCategory].classification_name}}</view>
<view class="secondList">
<view class="secondItem">
<view class="thirdList">
<view class="thirdItem">
</view>
</view>
</view>
</view>
</view>
</view>
</block>
<block v-if="selectScreenCategory==2">
<view class="section">重要性</view>
@@ -189,7 +206,7 @@
<script>
import { inject } from 'vue'
import { eventFilterList, eventList, login } from '@/request/api'
import { filterOptions, eventList, homeData, industryCategoryList, loginByEmail, followEvent, stockCategoryList } from '@/request/api'
import { getRateStr, getRateUpOrDown, getLocaleTime } from '@/utils/util.js'
const echarts = require('../../uni_modules/lime-echart/static/echarts.min.js');
@@ -199,17 +216,23 @@
menuTop:inject('menuTop'),
menuH: inject('menuHeight'),
navH:inject('navHeight'),
windowWidth:inject('windowWidth'),
contentTop:'',
listTop:'',
sortListTop:'',
keywords:'', //关键词
sortList:[],
selectSortKey:'', //选中排序key
timeCategoryList:[],
selectTimeCategory:0,
topCategoryList:['全部','大周期','大消费','大金融地产','TMT板块','公共产业板块'],
stockCategoryList:[],
topScrollWidth:0,
secondScrollWidth:0,
selectTopCategory:0,
secondCategoryList:['全部','石油石化','煤炭','有色金属','钢铁','基础化工','建筑材料'],
topScrollLeft:0,
selectSecondCategory:0,
secondScrollLeft:0,
screenCategoryList:['日期范围','行业分类','重要性'],
selectYearMonth:'', //选择的年月日
startDate:'', //选择开始日期
@@ -220,7 +243,8 @@
monthDateList:[],
selectMonthIndex:0, //选中月份下标
selectMonth:'', //选中年月
industryTopCategoryList:['巨潮行业分类','新财富行业分类','申银万国行业分类','证监会行业分类'],
industryTopCategoryList:[], //行业一级分类
selectIndustryTopCategory:0, //
selectScreenCategory:0,
importanceList:[], //重要性数组
selectImportanceIndex:0, //选择重要性下标
@@ -352,11 +376,13 @@
}
},
onLoad() {
this.contentTop = this.navH + (75+20)/750*inject('windowWidth')
this.listTop = this.contentTop + (22+80+72+44+44)/750*inject('windowWidth')
this.sortListTop = this.navH + (22+80+80)/750*inject('windowWidth')
this.contentTop = this.navH + (75+20)/750*this.windowWidth
this.listTop = this.contentTop + (22+80+72)/750*this.windowWidth
this.sortListTop = this.navH + (22+80+80)/750*this.windowWidth
this.getEventFilterListData()
this.getEventListData()
this.getIndustryCategoryListData()
this.getStockCategoryListData()
// this.init()
let currentDate = new Date();
// 获取当前年份
@@ -428,6 +454,17 @@
}
this.monthDateList = monthDateList
},
onReady() {
uni.createSelectorQuery().select('#topCategory').boundingClientRect(rect=>{
this.topScrollWidth = Math.round(rect.width)
}).exec()
uni.createSelectorQuery().select('#secondCategory').boundingClientRect(rect=>{
if(rect)
{
this.secondScrollWidth = Math.round(rect.width)
}
}).exec()
},
onPullDownRefresh() {
this.page = 1
this.getEventListData()
@@ -463,15 +500,36 @@
if(this.selectTimeCategory!=index)
{
this.selectTimeCategory = index
if(index==0)
{
//最新
this.getEventListData()
}else
//热门
this.getHotEventListData()
}
},
/**
* 点击排序
*/
clickSortItem()
clickSort()
{
this.$refs['sortPopup'].open()
},
/**
* 点击排序选项
*/
clickSortListItem(item)
{
this.selectSortKey = item.key
this.$refs['sortPopup'].close()
if(this.selectTimeCategory==0)
{
//最新
this.getEventListData()
}else
this.getHotEventListData()
},
/**
* 点击筛选
*/
@@ -509,22 +567,31 @@
* 点击选择一级分类
* @param {Object} index
*/
clickTopCategoryItem(index)
clickTopCategoryItem(event,index)
{
if(this.selectTopCategory!=index)
{
this.selectTopCategory = index
let offsetLeft = event.currentTarget.offsetLeft
this.topScrollLeft = offsetLeft - this.topScrollWidth/2
if(index==0)
{
this.listTop = this.contentTop + (22+80+72)/750*this.windowWidth
}else
this.listTop = this.contentTop + (22+80+72+44+44)/750*this.windowWidth
}
},
/**
* 点击选择二级分类
* @param {Object} index
*/
clickSecondCategoryItem(index)
clickSecondCategoryItem(event,index)
{
if(this.selectSecondCategory!=index)
{
this.selectSecondCategory = index
let offsetLeft = event.currentTarget.offsetLeft
this.secondScrollLeft = offsetLeft - this.secondScrollWidth/2
}
},
/**
@@ -594,6 +661,16 @@
this.startTimeStamp = item.timestamp
}
},
/**
* 选择行业分类一级分类
*/
clickSelectIndustryTopCategoryItem(index)
{
if(this.selectIndustryTopCategory!=index)
{
this.selectIndustryTopCategory = index
}
},
/**
* 点击选择重要性
*/
@@ -604,6 +681,39 @@
this.selectImportanceIndex = index
}
},
/**
* 点击展开收起内容
* @param {Object} index
*/
clickExpandOrRetract(index)
{
this.eventList[index].isExpand = !this.eventList[index].isExpand
},
/**
* 点击相关股票
* @param {Object} code
*/
clickLookRelatedStockItem(code)
{
uni.navigateTo({
url:'/pages/index/stockDetails/stockDetails?code='+code
})
},
/**
* 点击关注事件
* @param {Object} id
*/
clickFollowEvent(id)
{
followEvent(id).then(res=>{
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
},
/**
* 查看事件详情
*/
@@ -618,27 +728,68 @@
*/
getEventFilterListData()
{
eventFilterList().then(res=>{
let timeList = [...res.data.available_sorts]
this.timeCategoryList = timeList.splice(0,2)
let sortList = [...res.data.available_sorts]
for (let item of sortList) {
if(item.name=='最新')
{
item.icon = '/static/icon/home/new.png'
filterOptions().then(res=>{
if(res.code==200)
{
let timeList = [...res.data.sort_options]
this.timeCategoryList = timeList.splice(0,2)
let sortList = [...res.data.sort_options]
for (let item of sortList) {
if(item.name=='最新')
{
item.icon = '/static/icon/home/new.png'
}
if(item.name=='热门')
{
item.icon = '/static/icon/home/hot.png'
}
if(item.name=='收益率')
{
item.icon = '/static/icon/home/yield.png'
}
}
if(item.name=='热门')
{
item.icon = '/static/icon/home/hot.png'
this.sortList = res.data.sort_options.splice(0,3)
this.importanceList = res.data.importance_options
this.importanceList.unshift({desc: "全部",key: "all",name: "全部"})
}else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
},
/**
* 获取行业分类
*/
getIndustryCategoryListData()
{
industryCategoryList().then(res=>{
this.industryTopCategoryList = res.data
}).catch(error=>{
})
},
/**
* 获取股票分类
*/
getStockCategoryListData()
{
stockCategoryList().then(res=>{
if(res.code==200)
{
for (let item of res.data) {
item.sub_sectors.unshift('全部')
}
if(item.name=='收益率')
{
item.icon = '/static/icon/home/yield.png'
}
}
this.sortList = res.data.available_sorts.splice(0,3)
this.importanceList = res.data.available_importance_levels
this.importanceList.unshift({desc: "全部",key: "all",name: "全部"})
res.data.unshift({primary_sector:'全部',sub_sectors:[]})
this.stockCategoryList = res.data
}else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
@@ -661,6 +812,10 @@
{
param.importance = this.importanceList[this.selectImportanceIndex].key
}
if(this.selectSortKey)
{
param.sort = this.selectSortKey
}
eventList(param).then(res=>{
if(res.success)
{
@@ -672,6 +827,45 @@
}
}).catch(error=>{
})
let token = uni.getStorageSync('token')
if(!token)
{
let param1 = {email:'1198731706@qq.com',password:'Aa123456',isJson:1}
loginByEmail(param1).then(res=>{
if (res.code==200) {
uni.setStorageSync('token',res.data.token)
} else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
}
},
/**
* 获取热门事件数据
*/
getHotEventListData()
{
homeData().then(res=>{
if(res.code==200)
{
if(this.page==1)
{
this.eventList = res.data.events
}else
this.eventList = this.eventList.concat(res.data.events)
}else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
}
}
@@ -882,14 +1076,18 @@
.content
{
margin-top: 20rpx;
font-size: 24rpx;
font-weight: 500;
color: #666;
word-break: break-all;
}
.content.retract
{
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
text-overflow: ellipsis;
overflow: hidden;
font-size: 24rpx;
font-weight: 500;
color: #666;
}
.increaseRateList
{
@@ -927,6 +1125,7 @@
.stockItem
{
background-color: #F8F8F8;
margin-right: 21rpx;
display: inline-block;
padding: 0 20rpx;
line-height: 60rpx;
@@ -934,7 +1133,12 @@
font-size: 30rpx;
font-weight: bold;
color: #222;
.change
{
color: #F97316;
}
}
}
.timeToolBarC
{
@@ -1201,6 +1405,20 @@
height: auto;
}
}
.industryList
{
margin-top: 24rpx;
.list
{
.topCategory
{
padding: 0 30rpx;
font-size: 28rpx;
font-weight: bold;
color: #F97316;
}
}
}
.importanceList
{
margin-top: 16rpx;

View File

@@ -1,19 +1,255 @@
<template>
<view>
<navBar leftText="科锐国际(300662.SZ)"></navBar>
<navBar :leftText="navTitle"></navBar>
<image class="topBg absolute" src="/static/image/mine/myTopBg.png" mode="widthFix"></image>
<view class="tabC fixed" :style="'top:'+navH+'px;'">
<view :class="'item relative '+(selectCategory==index?'select':'')" v-for="(item,index) in categoryList" :key="index" @click="clickCategoryItem(index)">
{{item}}
<view v-if="selectCategory==index" class="line absolute"></view>
</view>
</view>
<view class="contentC fixed" :style="'top:'+contentTop+'px;'">
<view style="width:750rpx; height:400rpx">
<l-echart ref="chartRef"></l-echart>
</view>
<view class="section">关联描述</view>
<view class="des">全球原油运输巨头VLCC运力规模全球第一直接受益于霍尔木兹海峡地缘风险带来的运价上涨及风险溢价</view>
</view>
</view>
</template>
<script>
import { inject } from 'vue';
import { stockCandlestickChartData, stockDetails } from '@/request/api';
const echarts = require('../../../uni_modules/lime-echart/static/echarts.min.js');
export default {
data() {
return {
navH:inject('navHeight'),
contentTop:'',
navTitle:'',
stockCode:'', //股票code
categoryList:['分钟线','分时图','日K线'],
selectCategory:0,
option:{
title: {
show:false
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
legend: {
show:false
},
grid: {
left: '10%',
right: '10%',
bottom: '15%'
},
xAxis: {
type: 'category',
data: [],
boundaryGap: false,
axisLine: { onZero: false },
splitLine: { show: false },
min: 'dataMin',
max: 'dataMax'
},
yAxis: {
scale: true,
splitArea: {
show: true
}
},
dataZoom: [
{
type: 'inside',
start: 50,
end: 100
},
{
show: true,
type: 'slider',
top: '90%',
start: 50,
end: 100
}
],
series: [
{
name: '日K',
type: 'candlestick',
data: [],
itemStyle: {
color: '#ec0000',
color0: '#8A0000',
borderColor: '#00da3c',
borderColor0: '#008F28'
},
markPoint: {
label: {
formatter: function (param) {
return param != null ? Math.round(param.value) + '' : '';
}
},
data: [
{
name: 'Mark',
coord: ['2013/5/31', 2300],
value: 2300,
itemStyle: {
color: 'rgb(41,60,85)'
}
},
{
name: 'highest value',
type: 'max',
valueDim: 'highest'
},
{
name: 'lowest value',
type: 'min',
valueDim: 'lowest'
},
{
name: 'average value on close',
type: 'average',
valueDim: 'close'
}
],
tooltip: {
formatter: function (param) {
return param.name + '<br>' + (param.data.coord || '');
}
}
},
markLine: {
symbol: ['none', 'none'],
data: [
[
{
name: 'from lowest to highest',
type: 'min',
valueDim: 'lowest',
symbol: 'circle',
symbolSize: 10,
label: {
show: false
},
emphasis: {
label: {
show: false
}
}
},
{
type: 'max',
valueDim: 'highest',
symbol: 'circle',
symbolSize: 10,
label: {
show: false
},
emphasis: {
label: {
show: false
}
}
}
],
{
name: 'min line on close',
type: 'min',
valueDim: 'close'
},
{
name: 'max line on close',
type: 'max',
valueDim: 'close'
}
]
}
}
]
},
}
},
onLoad(e) {
this.contentTop = this.navH+(60+10)/750*inject('windowWidth')
if(e.code)
{
this.stockCode = e.code
this.getStockDetailsData()
this.getStockCandlestickChartData()
}
},
methods: {
async init() {
// chart 图表实例不能存在data里
const chart = await this.$refs.chartRef.init(echarts);
chart.setOption(this.option)
},
/**
* 点击切换分类
* @param {Object} index
*/
clickCategoryItem(index)
{
if(this.selectCategory!=index)
{
this.selectCategory = index
if(index==0||index==2)
{
this.getStockCandlestickChartData()
}
}
},
/**
* 获取股票详情数据
*/
getStockDetailsData()
{
let stockCode = this.stockCode
stockDetails(stockCode).then(res=>{
if(res.code==200)
{
this.navTitle = res.data.basic_info.stock_name+'('+res.data.basic_info.stock_code+')'
}else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
},
/**
* 获取股票K线数据
*/
getStockCandlestickChartData()
{
let stockCode = this.stockCode
let param = {chart_type:'minute'}
if(this.selectCategory==2)
{
param.chart_type = 'daily'
}
stockCandlestickChartData(stockCode,param).then(res=>{
let data = res.data
let categoryData = []
for (let item of data) {
categoryData.push(item.time)
}
this.option.xAxis.data = categoryData
this.init()
}).catch(error=>{
})
}
}
}
</script>
@@ -26,4 +262,57 @@
width: 100%;
height: auto;
}
.tabC
{
background-color: white;
margin-top: 10rpx;
left: 0;
right: 0;
border-radius: 20rpx 20rpx 0 0;
.item
{
display: inline-block;
padding: 0 30rpx;
line-height: 60rpx;
font-size: 28rpx;
font-weight: 500;
color: #42485B;
}
.item.select
{
font-weight: bold;
color: #F97316;
.line
{
background-color: #F97316;
left: calc((100% - 50rpx)/2);
bottom: 0;
width: 50rpx;
height: 2rpx;
}
}
}
.contentC
{
background-color: white;
left: 0;
right: 0;
bottom: 0;
.section
{
padding: 0 28rpx;
line-height: 80rpx;
font-size: 32rpx;
font-weight: bold;
color: #222;
}
.des
{
padding: 0 30rpx;
font-size: 24rpx;
font-weight: 500;
color: #666;
}
}
</style>

View File

@@ -10,20 +10,26 @@
</view>
<view class="contentC fixed" :style="'top:'+contentTop+'px;'">
<view class="">
<view class="todayC flex" @click="clickExpandOrRetract()">
<view class="todayDateC flex">
<view class="todayC flex" >
<view class="todayDateC flex" @click="clickExpandOrRetract()">
<view class="date">{{selectDate}}</view>
<image class="icon" src="/static/icon/invest/calendar.png" mode="widthFix"></image>
</view>
<view class="flex1"></view>
<view class="today"></view>
<view class="today" @click="clickTodayDate()"></view>
</view>
<view class="weekList flex">
<view class="item flex1" v-for="(item,index) in weekList" :key="index">{{item}}</view>
</view>
<view v-if="isExpand" class="monthDateList flexWrap">
<view class="item flexColumnCenter" v-for="(item,index) in monthDateList" :key="index" @click="clickSelectDate(item)">
<view :class="'date '+(item.isToday?'today':(item.isCurrentMonth?'':' notCurrentMonth')) ">{{item.day}}</view>
<block v-if="selectDate!=todayDate">
<view v-if="selectDate==item.date" class="date today">{{item.day}}</view>
<view v-else :class="'date '+(item.isCurrentMonth?'':' notCurrentMonth')">{{item.day}}</view>
</block>
<block v-else>
<view :class="'date '+(item.isToday?'today':(item.isCurrentMonth?'':' notCurrentMonth')) ">{{item.day}}</view>
</block>
<block v-if="item.className">
<view v-if="item.className=='bg-gradient-danger'" class="eventNum danger">{{item.eventCount}}</view>
<view v-if="item.className=='bg-gradient-warning'" class="eventNum warning">{{item.eventCount}}</view>
@@ -37,7 +43,13 @@
</view>
<view v-else class="weekDateList flex">
<view class="item flex1 flexColumnCenter" v-for="(item,index) in weekDateList" @click="clickSelectDate(item)" :key="index">
<view :class="'date '+(item.isToday?'today':'') ">{{item.day}}</view>
<block v-if="selectDate!=todayDate">
<view v-if="selectDate==item.date" class="date today">{{item.day}}</view>
<view v-else :class="'date '+(item.isCurrentMonth?'':' notCurrentMonth')">{{item.day}}</view>
</block>
<block v-else>
<view :class="'date '+(item.isToday?'today':(item.isCurrentMonth?'':' notCurrentMonth')) ">{{item.day}}</view>
</block>
<block v-if="item.className">
<view v-if="item.className=='bg-gradient-danger'" class="eventNum danger">{{item.eventCount}}</view>
<view v-if="item.className=='bg-gradient-warning'" class="eventNum warning">{{item.eventCount}}</view>
@@ -60,15 +72,15 @@
<view :class="'item '+(selectTab==index?'select':'')" v-for="(item,index) in tabList" :key="index" @click="clickTabItem(index)">{{item}}</view>
</view>
<scroll-view scroll-x class="topCategoryC">
<view :class="'item relative '+(selectTopCategory==index?'select':'')" v-for="(item,index) in topCategoryList" :key="index" @click="clickTopCategoryItem(index)">
{{item}}
<view :class="'item relative '+(selectTopCategory==index?'select':'')" v-for="(item,index) in stockCategoryList" :key="index" @click="clickTopCategoryItem(index)">
{{item.primary_sector}}
<view v-if="selectTopCategory==index" class="line absolute"></view>
</view>
</scroll-view>
<view v-if="selectTab==0" class="eventList">
<view class="item" v-for="(item,index) in eventList" :key="index" @click="clickEventItem()">
<view class="item" v-for="(item,index) in eventList" :key="index" @click="clickEventItem(item.id)">
<view class="flex">
<view class="time flex1">{{item.time}}</view>
<view class="time flex1">{{getLocaleHourMinute(item.start_time)}}</view>
<view class="starC relative">
<view class="starList flex" >
<image class="icon" :src="(sindex<(item.star)?'/static/icon/invest/star_s.png':'/static/icon/invest/star.png')" mode="widthFix" v-for="(sitem,sindex) in 5" :key="index"></image>
@@ -76,7 +88,7 @@
</view>
</view>
<view class="categoryTitleC flex">
<view class="category">宏观政策</view>
<view class="category">{{item.category.event_type}}</view>
<view class="title flex1">{{item.title}}</view>
</view>
<view class="labelC">
@@ -85,9 +97,9 @@
</view>
</view>
<view class="content">
<text>{{item.forecast}}</text>
<text>{{item.description}}</text>
</view>
<scroll-view scroll-x class="percentList">
<scroll-view v-if="item.concepts" scroll-x class="percentList">
<view class="percentItem" v-for="(citem,cindex) in JSON.parse(item.concepts)" :key="cindex">
{{citem[0]}}
<zui-progress-circle :position="citem[2]" :range="[270,630]" :size="26" :ring-width="2" :texture="['#F97316','#E3E3E3']">
@@ -98,9 +110,9 @@
</view>
</view>
<view v-if="selectTab==1" class="dataList">
<view class="item">
<view class="item" v-for="(item,index) in dataList" :key="index">
<view class="flex">
<view class="time flex1">21:00</view>
<view class="time flex1">{{getLocaleHourMinute(item.created_at)}}</view>
<view class="starC relative">
<view class="starBgList flex">
<image class="icon" src="/static/icon/invest/star.png" mode="widthFix" v-for="(item,index) in 5" :key="index"></image>
@@ -110,7 +122,7 @@
</view>
</view>
</view>
<view class="title">外交部长王毅将对俄罗斯进行正式访问</view>
<view class="title">{{item.title}}</view>
<view class="valueList flex between">
<view class="pre">前值 -7.1</view>
<view class="prediction">预测 93</view>
@@ -124,7 +136,8 @@
<script>
import { inject } from 'vue'
import { calendarEventCount, calendarEventList } from '../../request/api'
import { stockCategoryList, calendarEventList, calendarDataList, calendarEventCount, } from '@/request/api'
import { getLocaleHourMinute } from '@/utils/util'
export default {
data() {
@@ -141,12 +154,15 @@
isExpand:false, //是否展开日期
tabList:['事件','数据'],
selectTab:0,
topCategoryList:['全部','大周期','大消费','大金融地产','TMT板块','公共产业板块'],
stockCategoryList:[],
selectTopCategory:0,
listTop:'',
todayDate:'', //今日日期
selectDate:'', //选择查看的日期
progress: 75,
eventList:[], //事件列表
dataList:[], //数据列表
getLocaleHourMinute:getLocaleHourMinute
}
},
onLoad() {
@@ -155,7 +171,7 @@
let year = date.getFullYear()
let month = date.getMonth()+1
let day = date.getDate()
this.selectDate = date.getFullYear()+'-'+(month>9?month:('0'+month))+'-'+(day>9?day:('0'+day))
this.todayDate = this.selectDate = date.getFullYear()+'-'+(month>9?month:('0'+month))+'-'+(day>9?day:('0'+day))
let week = date.getDay() || 7
let diff = week - 1
let daysOfWeek = [];
@@ -210,6 +226,7 @@
}
this.monthDateList = daysOfMonth
this.listTop = this.contentTop + (68+40+96+74+70+74+22)/750*inject('windowWidth')
this.getStockCategoryListData()
this.getEventListData()
this.getCurrentMonthEventCountData()
},
@@ -219,6 +236,21 @@
}
},
methods: {
/**
* 点击今日日期
*/
clickTodayDate()
{
if(this.selectDate!=this.todayDate)
{
this.selectDate = this.todayDate
if(this.selectTab==0)
{
this.getEventListData()
}else
this.getDataListData()
}
},
/**
* 点击展开或收起
*/
@@ -240,7 +272,11 @@
if(this.selectDate!=item.date)
{
this.selectDate = item.date
this.getEventListData()
if(this.selectTab==0)
{
this.getEventListData()
}else
this.getDataListData()
}
},
/**
@@ -251,6 +287,11 @@
if(this.selectTab!=index)
{
this.selectTab = index
if(this.selectTab==0)
{
this.getEventListData()
}else
this.getDataListData()
}
},
/**
@@ -261,15 +302,39 @@
if(this.selectTopCategory!=index)
{
this.selectTopCategory = index
if(this.selectTab==0)
{
this.getEventListData()
}else
this.getDataListData()
}
},
/**
* 点击查看事件详情
*/
clickEventItem()
clickEventItem(id)
{
uni.navigateTo({
url:'/pages/invest/investDetails/investDetails'
url:'/pages/invest/investDetails/investDetails?id='+id
})
},
/**
* 获取股票分类
*/
getStockCategoryListData()
{
stockCategoryList().then(res=>{
if(res.code==200)
{
res.data.unshift({primary_sector:'全部',sub_sectors:[]})
this.stockCategoryList = res.data
}else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
},
/**
@@ -277,14 +342,39 @@
*/
getEventListData()
{
let param = {date:this.selectDate}
let param = {start:this.selectDate}
if(this.selectTopCategory>0)
{
param.category = this.stockCategoryList[this.selectTopCategory].primary_sector
}
calendarEventList(param).then(res=>{
for (let item of res) {
let calendarTime = item.calendar_time
let time = calendarTime.split('T')[1]
item.time = time.substr(0,5)
}
this.eventList = res
if(res.code==200)
{
this.eventList = res.data.events
}else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
},
/**
* 获取事件列表数据
*/
getDataListData()
{
let param = {start:this.selectDate}
calendarDataList(param).then(res=>{
if(res.code==200)
{
this.dataList = res.data.data_list
}else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
@@ -307,8 +397,8 @@
for (let s of this.monthDateList) {
if(s.date == date)
{
s.eventCount = item.title
s.className = item.className
s.eventCount = item.title
s.className = item.className
}
}
}

View File

@@ -35,7 +35,7 @@
<script>
import { inject } from 'vue';
import { investEventDetails } from '../../../request/api';
import { investEventDetails } from '@/request/api';
export default {
data() {
@@ -75,8 +75,13 @@
}]
}
},
onLoad() {
onLoad(e) {
this.contentTop = this.navH+(30+74)/750*inject('windowWidth')
if(e.id)
{
this.eventId = e.id
this.getEventDetailsData()
}
},
methods: {
/**

View File

@@ -0,0 +1,192 @@
<template>
<view>
<navBar leftText="登录" :hideNavBg="true" :backBlack="true"></navBar>
<image class="logo" :style="'margin-top:'+contentTop+'px;'" src="/static/image/login/logo.png" mode="widthFix"></image>
<view class="loginTitle">欢迎登录价值前沿平台</view>
<view class="inputC mobile flex">
<image class="icon" src="/static/icon/login/mobile.png" mode="widthFix"></image>
<input class="flex1" type="number" v-model="mobile" placeholder="请输入手机号" placeholder-style="color: #aaa"/>
</view>
<view class="inputC code flex">
<image class="icon" src="/static/icon/login/code.png" mode="widthFix"></image>
<input class="flex1" type="number" v-model="code" placeholder="请输入验证码" placeholder-style="color: #aaa"/>
<view class="getCode" @click="clickGetCode()">获取验证码</view>
</view>
<view class="btn loginAtOnce" @click="clickLoginAtOnce()">立即登录</view>
<view class="btn oneClickLogin" @click="clickOneClickLogin()">授权手机号一键登录</view>
<view class="agreeProtocolC fixed flexCenter">
<view class="agreeC">
<image class="icon" src="" mode="widthFix"></image>
</view>
阅读并同意我们的<text class="protocol">用户服务协议</text><text class="protocol">隐私政策</text>
</view>
</view>
</template>
<script>
import { inject } from 'vue';
import { loginByPhone } from '@/request/api';
export default {
data() {
return {
contentTop:'',
mobile:'', //手机号
code:'', //验证码
}
},
onLoad() {
this.contentTop = inject('navHeight')+230/750*inject('windowWidth')
},
methods: {
/**
* 点击获取验证码
*/
clickGetCode()
{
},
/**
* 点击立即登录
*/
clickLoginAtOnce()
{
if(!this.mobile)
{
uni.showToast({
title:'请输入手机号',
icon:'none'
})
return
}
if(!this.code)
{
uni.showToast({
title:'请输入验证码',
icon:'none'
})
return
}
let param = {phone:this.mobile,code:this.code,isJson:1}
loginByPhone(param).then(res=>{
if(res.code==200)
{
}else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
},
/**
* 点击一键登录
*/
clickOneClickLogin()
{
uni.navigateBack()
}
}
}
</script>
<style lang="less">
.logo
{
margin-left: calc((100% - 144rpx)/2);
width: 144rpx;
height: auto;
}
.loginTitle
{
margin: 40rpx 80rpx 0;
font-size: 40rpx;
font-weight: bold;
text-align: center;
}
.inputC
{
background-color: #f8f8f8;
margin: 0 75rpx;
height: 80rpx;
border-radius: 10rpx;
input
{
font-size: 26rpx;
font-weight: 500;
}
}
.inputC.mobile
{
margin-top: 40rpx;
padding-left: 29rpx;
.icon
{
margin-right: 13rpx;
width: 26rpx;
height: auto;
}
}
.inputC.code
{
margin-top: 36rpx;
padding-left: 27rpx;
.icon
{
margin-right: 10rpx;
width: 26rpx;
height: auto;
}
.getCode
{
padding: 0 30rpx;
font-size: 26rpx;
font-weight: 500;
color: #F97316;
}
}
.btn
{
margin: 0 75rpx;
line-height: 80rpx;
border-radius: 20rpx;
font-size: 26rpx;
font-weight: 500;
text-align: center;
}
.btn.loginAtOnce
{
background-color: #F97316;
margin-top: 60rpx;
color: white;
}
.btn.oneClickLogin
{
background-color: #FFF1E8;
margin-top: 28rpx;
color: #F97316;
}
.agreeProtocolC
{
left: 0;
right: 0;
bottom: calc(120rpx + env(safe-area-inset-bottom));
font-size: 26rpx;
font-weight: 500;
.agreeC
{
padding: 14rpx;
.icon
{
width: 28rpx;
height: auto;
}
}
.protocol
{
color: #F97316;
}
}
</style>

135
pages/login/login.vue Normal file
View File

@@ -0,0 +1,135 @@
<template>
<view>
<navBar leftText="登录" :hideNavBg="true" :backBlack="true"></navBar>
<image class="logo" :style="'margin-top:'+contentTop+'px;'" src="/static/image/login/logo.png" mode="widthFix"></image>
<view class="loginTitle">欢迎登录价值前沿平台</view>
<view class="btn oneClickLogin" @click="clickOneClickLogin()">授权手机号一键登录</view>
<view class="btn codeLogin" @click="clickCodeLogin()">使用短信验证登录</view>
<view class="agreeProtocolC fixed flexCenter">
<view class="agreeC" @click="clickAgree()">
<image class="icon" src="" mode="widthFix"></image>
</view>
阅读并同意我们的<text class="protocol" @click="clickProtocol()">用户服务协议</text><text class="protocol"@click="clickProtocol()">隐私政策</text>
</view>
</view>
</template>
<script>
import { inject } from 'vue';
import { loginByWx } from '@/request/api';
export default {
data() {
return {
contentTop:''
}
},
onLoad() {
this.contentTop = inject('navHeight')+230/750*inject('windowWidth')
},
methods: {
/**
* 点击一键登录
*/
clickOneClickLogin()
{
uni.login({
provider:'weixin',
success(res) {
let param = {code:res.code,isJson:1}
loginByWx(param).then(res=>{
}).catch(error=>{
})
},
fail() {
}
})
},
/**
* 点击验证码登录
*/
clickCodeLogin()
{
uni.navigateTo({
url:'/pages/login/codeLogin/codeLogin'
})
},
/**
* 点击同意
*/
clickAgree()
{
},
/**
* 点击查看协议
*/
clickProtocol()
{
}
}
}
</script>
<style lang="less">
.logo
{
margin-left: calc((100% - 144rpx)/2);
width: 144rpx;
height: auto;
}
.loginTitle
{
margin: 40rpx 80rpx 0;
font-size: 40rpx;
font-weight: bold;
text-align: center;
}
.btn
{
margin: 0 75rpx;
line-height: 80rpx;
border-radius: 20rpx;
font-size: 26rpx;
font-weight: 500;
text-align: center;
}
.btn.oneClickLogin
{
background-color: #F97316;
margin-top: 60rpx;
color: white;
}
.btn.codeLogin
{
background-color: #FFF1E8;
margin-top: 28rpx;
color: #F97316;
}
.agreeProtocolC
{
left: 0;
right: 0;
bottom: calc(120rpx + env(safe-area-inset-bottom));
font-size: 26rpx;
font-weight: 500;
.agreeC
{
padding: 14rpx;
.icon
{
width: 28rpx;
height: auto;
}
}
.protocol
{
color: #F97316;
}
}
</style>

View File

@@ -3,19 +3,18 @@
<navBar leftText="信息完善"></navBar>
<image class="topBg absolute" src="/static/image/mine/myTopBg.png" mode="widthFix"></image>
<view class="avatarC fixed" :style="'top:'+avatarTop+'px;'">
<image class="avatar" src="" mode="aspectFill"></image>
<image class="avatar" :src="avatar?avatar:avatarUrl" mode="aspectFill"></image>
<image class="icon absolute" src="/static/icon/mine/basicInfo/edit.png" mode="widthFix"></image>
<button class="absolute" open-type="chooseAvatar" @chooseavatar="chooseAvatar"></button>
</view>
<view class="basicInfoC fixed" :style="'top:'+contentTop+'px;'">
<view class="title">基本信息</view>
<view class="section">昵称</view>
<view class="inputC">
<input type="text" />
<input type="nickname" v-model="nickname" />
</view>
<view class="section">手机号</view>
<view class="inputC">
<input type="text" />
</view>
<view class="inputC">{{mobile}}</view>
<view class="section">性别</view>
<picker mode="selector" :range="sexList" @change="sexChange">
<view class="selectC flex">
@@ -25,7 +24,7 @@
</picker>
<view class="section">个人简介</view>
<view class="textareaC">
<textarea placeholder="简单介绍一下自己吧" placeholder-style="color:#AAA"></textarea>
<textarea v-model="profile" placeholder="简单介绍一下自己吧" placeholder-style="color:#AAA"></textarea>
</view>
</view>
<view class="next fixed" @click="clickNext()">下一步</view>
@@ -34,21 +33,42 @@
<script>
import { inject } from 'vue';
import { updateBasicInfo, userInfo } from '@/request/api';
import { uploadImg } from '@/utils/util';
export default {
data() {
return {
avatarTop:'',
contentTop:'',
avatar:'', //选择头像临时地址
avatarUrl:'', //已上传的链接
nickname:'', //昵称
mobile:'', //手机号
sexList:['男','女'],
sex:''
sex:'',
profile:'', //个人简介
}
},
onLoad() {
this.avatarTop = inject('navHeight') + 60/750*inject('windowWidth')
this.contentTop = this.avatarTop + 75/750*inject('windowWidth')
this.getUserInfoData()
},
methods: {
/**
* 点击选择头像
* @param {Object} e
*/
chooseAvatar(e)
{
console.log(e)
this.avatar = e.detail.avatarUrl
},
/**
* 点击选择性别
* @param {Object} e
*/
sexChange(e)
{
console.log(e)
@@ -60,8 +80,84 @@
*/
clickNext()
{
uni.navigateTo({
url:'/pages/mine/investPreference/investPreference'
if(!this.avatar&&!this.avatarUrl)
{
uni.showToast({
title:'请选择头像',
icon:'none'
})
return
}
if(!this.nickname)
{
uni.showToast({
title:'请输入昵称',
icon:'none'
})
return
}
if(!this.sex)
{
uni.showToast({
title:'请选择性别',
icon:'none'
})
return
}
if(!this.profile)
{
uni.showToast({
title:'请输入个人简介',
icon:'none'
})
return
}
if(this.avatar)
{
//如果选择了新头像
let param = {avatar:this.avatar,nickname:this.nickname,gender:this.sex=='男'?'male':'female',
bio:this.profile,isFile:1}
updateBasicInfo(param).then(res=>{
uni.navigateTo({
url:'/pages/mine/investPreference/investPreference'
})
}).catch(error=>{
})
}else
{
//没有选择新头像
let param = {nickname:this.nickname,gender:this.sex=='男'?'male':'female',
bio:this.profile}
updateBasicInfo(param).then(res=>{
uni.navigateTo({
url:'/pages/mine/investPreference/investPreference'
})
}).catch(error=>{
})
}
},
/**
* 获取用户信息数据
*/
getUserInfoData()
{
userInfo().then(res=>{
if(res.code==200)
{
this.avatarUrl = res.data.basic_info.avatar_url
this.nickname = res.data.basic_info.nickname
this.mobile = res.data.basic_info.phone
this.sex = res.data.basic_info.gender=='male'?'男':'女'
this.profile = res.data.basic_info.bio
}else
wx.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
}
}
@@ -83,7 +179,6 @@
width: 150rpx;
.avatar
{
background-color: red;
width: 100%;
height: 150rpx;
border-radius: 50%;
@@ -96,6 +191,13 @@
width: 40rpx;
height: auto;
}
button
{
top: 0;
left: 0;
width: 100%;
height: 100%;
}
z-index: 10;
}
.basicInfoC

View File

@@ -9,42 +9,67 @@
</view>
</view>
<view class="list fixed" :style="'top:'+listTop+'px;'">
<view class="item">
<view class="replyContentC">
<view class="flex">
<view class="flex1 flex">
<image class="avatar" src="" mode="aspectFill"></image>
<view class="flex1">
<view class="replyNickname">逸尘破晓</view>
<view class="time">2-15 15:37</view>
<block v-if="selectTab==0">
<view class="commentMeItem" v-for="(item,index) in commentList" :key="index">
<view class="replyContentC">
<view class="flex">
<view class="flex1 flex">
<image class="avatar" src="" mode="aspectFill"></image>
<view class="flex1">
<view class="replyNickname">逸尘破晓</view>
<view class="time">2-15 15:37</view>
</view>
</view>
<view class="reply">回复</view>
</view>
<view class="content">
回复<text class="originNickname">永不落的梦想</text><text>四部门联合启动的人力资源服务业与制造业融合发展点</text>
</view>
<view class="reply">回复</view>
</view>
<view class="content">
回复<text class="originNickname">永不落的梦想</text><text>四部门联合启动的人力资源服务业与制造业融合发展点</text>
<view class="originalTextC">
<view class="originReply">
<text class="originNickname">永不落的梦想</text><text>四部门联合启动的人力资源服务业与制造业融合发展点</text>
</view>
<view class="originEventC">
<view class="levelTitleC flex">
<view class="level">C</view>
<view class="title">四部门联合启动人力资源服务业与制造业...</view>
</view>
<view class="eventContent">人社部工信部等四部门印发通知明确在30个城市开展3年期试点培育人力资源服务与制造业协同机构...</view>
</view>
</view>
</view>
<view class="originalTextC">
<view class="originReply">
<text class="originNickname">永不落的梦想</text><text>四部门联合启动的人力资源服务业与制造业融合发展点</text>
</block>
<block v-else>
<view class="myCommentItem" v-for="(item,index) in commentList" :key="index">
<view class="replyContentC">
<view class="flex">
<image class="avatar" src="" mode="aspectFill"></image>
<view class="flex1">
<view class="nickname">逸尘破晓</view>
<view class="time">{{getLocaleDate(item.created_at)}}</view>
</view>
</view>
<view class="content">{{item.content}}</view>
</view>
<view class="originEventC">
<view class="levelTitleC flex">
<view class="level">C</view>
<view class="title">四部门联合启动人力资源服务业与制造业...</view>
<view class="title">{{item.event_title}}</view>
</view>
<view class="eventContent">人社部工信部等四部门印发通知明确在30个城市开展3年期试点培育人力资源服务与制造业协同机构...</view>
</view>
</view>
</view>
</block>
</view>
</view>
</template>
<script>
import { inject } from 'vue';
import { userActivityList } from '@/request/api';
import { getLocaleDate } from '@/utils/util';
export default {
data() {
return {
@@ -52,10 +77,26 @@
listTop:'',
tabList:['评论我的','我评论的'],
selectTab:0,
commentList:[],
page:1,
loadAll:false,
getLocaleDate:getLocaleDate
}
},
onLoad() {
this.listTop = this.navH+(75+10)/750*inject('windowWidth')
this.getCommentListData()
},
onPullDownRefresh() {
this.page = 1
this.getCommentListData()
},
onReachBottom() {
if(!this.loadAll)
{
this.page ++
this.getCommentListData()
}
},
methods: {
/**
@@ -67,7 +108,34 @@
if(this.selectTab!=index)
{
this.selectTab = index
this.getCommentListData()
}
},
/**
* 获取评论列表数据
*/
getCommentListData()
{
let param = {page:this.page,type:this.selectTab==0?'commented':'comments'}
userActivityList(param).then(res=>{
if (res.code==200) {
if(res.data.current_page==1)
{
this.commentList = res.data.activities
}else
this.commentList = this.followList.concat(res.data.activities)
if(res.data.current_page==res.data.pages)
{
this.loadAll = true
}
} else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
}
}
}
@@ -118,14 +186,13 @@
right: 0;
bottom: 0;
overflow-y: scroll;
.item
.commentMeItem
{
.replyContentC
{
padding: 40rpx 25rpx 0;
.avatar
{
background-color: red;
margin-right: 22rpx;
width: 80rpx;
height: 80rpx;
@@ -134,10 +201,13 @@
.replyNickname
{
font-size: 28rpx;
font-weight: bold;
color: #111;
}
.time
{
font-size: 26rpx;
font-weight: 500;
color: #aaa;
}
.reply
@@ -213,5 +283,73 @@
}
}
}
.myCommentItem
{
.replyContentC
{
padding: 40rpx 25rpx 0;
.avatar
{
margin-right: 22rpx;
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
.nickname
{
font-size: 28rpx;
font-weight: bold;
color: #111;
}
.time
{
font-size: 26rpx;
font-weight: 500;
color: #aaa;
}
.content
{
margin-top: 20rpx;
font-size: 24rpx;
font-weight: 500;
color: #444;
}
}
.originEventC
{
background-color: #F7F7F7;
margin-top: 20rpx;
padding: 20rpx 40rpx;
.levelTitleC
{
font-size: 30rpx;
font-weight: bold;
.level
{
background-color: #FEC44F;
margin-right: 17rpx;
width: 50rpx;
height: 40rpx;
border-radius: 10rpx;
font-size: 30rpx;
font-weight: bold;
color: white;
text-align: center;
}
.title
{
color: #222;
}
}
.eventContent
{
margin-top: 20rpx;
font-size: 24rpx;
font-weight: 500;
color: #666;
}
}
}
}
</style>

View File

@@ -4,20 +4,22 @@
<image class="topBg absolute" src="/static/image/mine/myTopBg.png" mode="widthFix"></image>
<view class="feedbackC fixed" :style="'top:'+navH+'px;'">
<view class="textareaC">
<textarea placeholder="请输入您要反馈的问题200 字以内)" placeholder-style="color:#C5C5C5" maxlength="200"></textarea>
<textarea v-model="content" placeholder="请输入您要反馈的问题200 字以内)" placeholder-style="color:#C5C5C5" maxlength="200"></textarea>
</view>
</view>
<view class="submit fixed">提交</view>
<view class="submit fixed" @click="clickSubmit()">提交</view>
</view>
</template>
<script>
import { inject } from 'vue';
import { feedback } from '@/request/api';
export default {
data() {
return {
navH:inject('navHeight'),
content:'',
}
},
@@ -25,7 +27,36 @@
},
methods: {
clickSubmit()
{
if(!this.content)
{
uni.showToast({
title:'请输入您要反馈的问题',
icon:'none'
})
return
}
let param = {content:this.content,isJson:1}
feedback(param).then(res=>{
if(res.code==200)
{
uni.showToast({
title:res.message,
icon:'none'
})
setTimeout(function() {
uni.navigateBack()
}, 1000);
}else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
}
}
}
</script>

View File

@@ -0,0 +1,309 @@
<template>
<view>
<navBar leftText="关注收藏"></navBar>
<image class="topBg absolute" src="/static/image/mine/myTopBg.png" mode="widthFix"></image>
<view class="list fixed" :style="'top:'+navH+'px;'">
<view class="item" @click="clickEventItem(item.event_id)" v-for="(item,index) in followList" :key="index">
<view class="flex">
<view :class="'level '+item.importance">{{item.importance}}</view>
<view class="title">{{item.event_title}}</view>
</view>
<view class="content">{{item.event_description}}</view>
<scroll-view scroll-x class="increaseRateList">
<view :class="'rateItem '+(getRateUpOrDown(item.related_avg_chg)?'down':'up')">
平均涨幅:
<image v-if="getRateUpOrDown(item.related_avg_chg)" class="arrow" src="/static/icon/home/downArrow.png" mode="widthFix"></image>
<image v-else class="arrow" src="/static/icon/home/upArrow.png" mode="widthFix"></image>
{{getRateStr(item.related_avg_chg)}}%
</view>
<view :class="'rateItem '+(getRateUpOrDown(item.related_max_chg)?'down':'up')">
最大涨幅:
<image v-if="getRateUpOrDown(item.related_max_chg)" class="arrow" src="/static/icon/home/downArrow.png" mode="widthFix"></image>
<image v-else class="arrow" src="/static/icon/home/upArrow.png" mode="widthFix"></image>
{{getRateStr(item.related_max_chg)}}%
</view>
<view :class="'rateItem '+(getRateUpOrDown(item.related_week_chg)?'down':'up')">
周涨幅:
<image v-if="getRateUpOrDown(item.related_week_chg)" class="arrow" src="/static/icon/home/downArrow.png" mode="widthFix"></image>
<image v-else class="arrow" src="/static/icon/home/upArrow.png" mode="widthFix"></image>
{{getRateStr(item.related_week_chg)}}%
</view>
</scroll-view>
<scroll-view scroll-x class="stockList">
<view class="stockItem" v-for="(sitem,sindex) in item.related_stocks" :key="sindex" @click.stop="clickLookRelatedStockItem(sitem.stock_code)">{{sitem.stock_name}} <text class="change">{{(getRateUpOrDown(sitem.daily_change)?'':'+')+sitem.daily_change}}%</text></view>
</scroll-view>
<view class="timeToolBarC flex">
<view class="time flex1">{{getLocaleTime(item.created_at)}}</view>
<view class="toolBarC flex">
<view class="toolItem flex">
<image class="icon" src="/static/icon/home/browser.png" mode="widthFix"></image>
<text>{{item.view_count}}</text>
</view>
<view class="toolItem flex">
<image class="icon" src="/static/icon/home/comment.png" mode="widthFix"></image>
<text>{{item.comment_count}}</text>
</view>
<view class="toolItem flex" @click.stop="clickFollowEvent(item.event_id,index)">
<image class="icon" src="/static/icon/home/follow_s.png" mode="widthFix"></image>
<text>{{item.follower_count}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { inject } from 'vue';
import { userActivityList,followEvent } from '@/request/api';
import { getRateStr, getRateUpOrDown, getLocaleTime } from '@/utils/util.js'
export default {
data() {
return {
navH:inject('navHeight'),
followList:[],
page:1,
loadAll:false,
getRateStr:getRateStr,
getRateUpOrDown:getRateUpOrDown,
getLocaleTime:getLocaleTime
}
},
onLoad() {
this.getFollowCollectListData()
},
onPullDownRefresh() {
this.page = 1
this.getFollowCollectListData()
},
onReachBottom() {
if(!this.loadAll)
{
this.page ++
this.getFollowCollectListData()
}
},
methods: {
/**
* 点击相关股票
* @param {Object} code
*/
clickLookRelatedStockItem(code)
{
uni.navigateTo({
url:'/pages/index/stockDetails/stockDetails?code='+code
})
},
/**
* 点击关注事件
* @param {Object} id
*/
clickFollowEvent(id,index)
{
followEvent(id).then(res=>{
uni.showToast({
title:res.message,
icon:'none'
})
this.followList.splice(index,1)
}).catch(error=>{
})
},
/**
* 查看事件详情
*/
clickEventItem(id)
{
uni.navigateTo({
url:'/pages/index/eventDetails/eventDetails?id='+id
})
},
/**
* 获取关注收藏列表数据
*/
getFollowCollectListData()
{
let param = {page:this.page,type:'follows'}
userActivityList(param).then(res=>{
if (res.code==200) {
if(res.data.current_page==1)
{
this.followList = res.data.activities
}else
this.followList = this.followList.concat(res.data.activities)
if(res.data.current_page==res.data.pages)
{
this.loadAll = true
}
} else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
}
}
}
</script>
<style lang="less">
.topBg
{
top: 0;
left: 0;
width: 100%;
height: auto;
}
.list
{
background-color: white;
left: 0;
right: 0;
bottom: 0;
padding: 0 25rpx;
overflow-y: scroll;
.item
{
padding: 30rpx 0;
border-bottom: solid 1rpx #E4E4E4;
.level
{
margin-right: 16rpx;
width: 50rpx;
line-height: 40rpx;
border-radius: 10rpx;
font-size: 30rpx;
font-weight: bold;
color: white;
text-align: center;
}
.level.S
{
background-color: #CC4C02;
}
.level.A
{
background-color: #EC7014;
}
.level.B
{
background-color: #FB9A29;
}
.level.C
{
background-color: #FEC44F;
}
.title
{
font-size: 30rpx;
font-weight: bold;
color: #222;
}
.content
{
margin-top: 20rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
text-overflow: ellipsis;
overflow: hidden;
font-size: 24rpx;
font-weight: 500;
color: #666;
}
.increaseRateList
{
white-space: nowrap;
margin-top: 24rpx;
.rateItem
{
display: inline-block;
margin-right: 15rpx;
line-height: 44rpx;
padding: 0 14rpx;
border-radius: 10rpx;
font-size: 22rpx;
font-weight: bold;
color: white;
.arrow
{
width: 15rpx;
height: auto;
}
}
.rateItem.up
{
background-color: #C00000;
}
.rateItem.down
{
background-color: #355422;
}
}
.stockList
{
white-space: nowrap;
margin-top: 20rpx;
.stockItem
{
background-color: #F8F8F8;
margin-right: 21rpx;
display: inline-block;
padding: 0 20rpx;
line-height: 60rpx;
border-radius: 10rpx;
font-size: 30rpx;
font-weight: bold;
color: #222;
.change
{
color: #F97316;
}
}
}
.timeToolBarC
{
margin-top: 20rpx;
.time
{
font-size: 22rpx;
font-weight: 500;
color: #aaa;
}
.toolBarC
{
.toolItem
{
padding: 0 20rpx;
font-size: 26rpx;
font-weight: bold;
color: #666;
.icon
{
margin-right: 13rpx;
width: 29rpx;
height: auto;
}
}
.toolItem:first-child
{
.icon
{
margin-right: 15rpx;
width: 33rpx;
height: auto;
}
}
}
}
}
}
</style>

View File

@@ -3,8 +3,9 @@
<navBar leftText="信息完善"></navBar>
<image class="topBg absolute" src="/static/image/mine/myTopBg.png" mode="widthFix"></image>
<view class="avatarC fixed" :style="'top:'+avatarTop+'px;'">
<image class="avatar" src="" mode="aspectFill"></image>
<image class="avatar" :src="avatar?avatar:avatarUrl" mode="aspectFill"></image>
<image class="icon absolute" src="/static/icon/mine/basicInfo/edit.png" mode="widthFix"></image>
<button class="absolute" open-type="chooseAvatar" @chooseavatar="chooseAvatar"></button>
</view>
<view class="preferenceC fixed" :style="'top:'+contentTop+'px;'">
<view class="title">投资偏好设置</view>
@@ -40,20 +41,23 @@
</view>
</view>
<view class="bottomC fixed flex">
<view class="pre btn">上一步</view>
<view class="finish btn flex1">完成</view>
<view class="pre btn" @click="clickPre()">上一步</view>
<view class="finish btn flex1" @click="clickFinish()">完成</view>
</view>
</view>
</template>
<script>
import { inject } from 'vue';
import { userInfo, updateInvestPreference } from '@/request/api';
export default {
data() {
return {
avatarTop:'',
contentTop:'',
avatar:'', //选择头像临时地址
avatarUrl:'', //已上传的链接
investPreferenceList:['长期投资','中短期投资','风险控制型'],
selectInvestIndex:-1,
stockYearList:['新手入门','1年以内','1-3年','3-5年','5-10年','10年以上'],
@@ -68,8 +72,17 @@
onLoad() {
this.avatarTop = inject('navHeight') + 60/750*inject('windowWidth')
this.contentTop = this.avatarTop + 75/750*inject('windowWidth')
this.getUserInfoData()
},
methods: {
/**
* 点击选择头像
* @param {Object} e
*/
chooseAvatar(e)
{
this.avatar = e.detail.avatarUrl
},
/**
* 点击选择投资偏好
* @param {Object} index
@@ -121,6 +134,160 @@
clickMarketItem(index)
{
this.preferredMarketList[index].select = !this.preferredMarketList[index].select;
},
/**
* 点击上一步
*/
clickPre()
{
uni.navigateBack()
},
/**
* 点击完成
*/
clickFinish()
{
if(this.selectInvestIndex<0)
{
uni.showToast({
title:'请选择投资偏好',
icon:'none'
})
return
}
if(this.selectYearIndex<0)
{
uni.showToast({
title:'请选择炒股年限',
icon:'none'
})
return
}
if(this.selectRiskIndex<0)
{
uni.showToast({
title:'请选择风险偏好',
icon:'none'
})
return
}
if(this.selectScaleIndex<0)
{
uni.showToast({
title:'请选择投资规模',
icon:'none'
})
return
}
let arr = []
for (let item of this.preferredMarketList) {
if(item.select)
{
arr.push(item.title)
}
}
if(arr.length==0)
{
uni.showToast({
title:'请选择偏好市场',
icon:'none'
})
return
}
if(this.avatar)
{
//如果选择了新头像
let param = {avatar:this.avatar,isFile:1}
updateBasicInfo(param).then(res=>{
this.uploadInvestPreferenceData()
}).catch(error=>{
})
}else
this.uploadInvestPreferenceData()
},
/**
* 更新投资偏好设置
*/
uploadInvestPreferenceData()
{
let param = {trading_experience: this.selectYearIndex,investment_style: this.investPreferenceList[this.selectInvestIndex],
risk_preference: this.riskPreferenceList[this.selectRiskIndex],
investment_amount: this.investmentScaleList[this.selectScaleIndex],
preferred_markets: arr}
updateInvestPreference(param).then(res=>{
uni.navigateBack({
delta:2
})
}).catch(error=>{
})
},
/**
* 获取用户偏好设置数据
*/
getUserInfoData()
{
userInfo().then(res=>{
if(res.code==200)
{
let data = res.data.investment_preferences
//投资偏好
for (var i = 0; i < this.investPreferenceList.length; i++) {
let item = this.investPreferenceList[i]
if(item==data.investment_style)
{
this.selectInvestIndex = i
break
}
}
//炒股年限
this.selectYearIndex = data.trading_experience
// for (var i = 0; i < this.stockYearList.length; i++) {
// let item = this.stockYearList[i]
// if(item==data.investment_style)
// {
// this.selectYearIndex = i
// break
// }
// }
//风险偏好
for (var i = 0; i < this.riskPreferenceList.length; i++) {
let item = this.riskPreferenceList[i]
if(item==data.risk_preference)
{
this.selectRiskIndex = i
break
}
}
//投资规模
for (var i = 0; i < this.investmentScaleList.length; i++) {
let item = this.investmentScaleList[i]
if(item==data.investment_amount)
{
this.selectScaleIndex = i
break
}
}
//偏好市场
for (let item of this.preferredMarketList) {
let arr = JSON.parse(data.preferred_markets)
let arr1 = arr[0].split(',')
if(arr1.indexOf(item.title)>-1)
{
item.select = true
}else
{
item.select = false
}
}
}else
wx.showToast({
title:res.message,
})
}).catch(error=>{
})
}
}
}
@@ -141,7 +308,6 @@
width: 150rpx;
.avatar
{
background-color: red;
width: 100%;
height: 150rpx;
border-radius: 50%;
@@ -154,6 +320,13 @@
width: 40rpx;
height: auto;
}
button
{
top: 0;
left: 0;
width: 100%;
height: 100%;
}
z-index: 10;
}
.preferenceC

View File

@@ -2,11 +2,11 @@
<view>
<image class="topBg absolute" src="/static/image/mine/myTopBg.png" mode="widthFix"></image>
<view class="navTitle fixed" :style="'top:'+menuTop+'px;line-height:'+menuH+'px;'">个人中心</view>
<view class="personalInfoC relative flex" :style="'margin-top:'+infoTop+'px;'" @click="clickPersonalInfo()">
<image class="avatar" src="" mode="aspectFill"></image>
<view v-if="userInfo" class="personalInfoC relative flex" :style="'margin-top:'+infoTop+'px;'" @click="clickPersonalInfo()">
<image class="avatar" :src="userInfo.basic_info.avatar_url" mode="aspectFill"></image>
<view class="flex1">
<view class="nickname">星河滚烫的理想</view>
<view class="mobile">手机号13654800065</view>
<view class="nickname">{{userInfo.basic_info.username}}</view>
<view class="mobile">手机号{{userInfo.basic_info.phone}}</view>
</view>
<image class="arrow" src="/static/icon/mine/infoArrow.png" mode="widthFix"></image>
</view>
@@ -42,6 +42,7 @@
<script>
import { inject } from 'vue';
import { userInfo } from '@/request/api';
export default {
data() {
@@ -49,6 +50,7 @@
menuTop:inject('menuTop'),
menuH: inject('menuHeight'),
infoTop:'',
userInfo:null,
menuList:[{
icon:'/static/icon/mine/aboutUs.png',
title:'关于我们',
@@ -79,6 +81,9 @@
onLoad() {
this.infoTop = inject('navHeight')+32/750*inject('windowWidth')
},
onShow() {
this.getUserInfoData()
},
methods: {
/**
* 点击查看个人信息
@@ -112,8 +117,15 @@
})
}else if(index==1)
{
}
//关注收藏
uni.navigateTo({
url:'/pages/mine/followCollect/followCollect'
})
}else
//我的点赞
uni.navigateTo({
url:'/pages/mine/myLike/myLike'
})
},
clickMenuItem(url)
{
@@ -123,8 +135,24 @@
url
})
}
}
},
/**
* 获取用户信息数据
*/
getUserInfoData()
{
userInfo().then(res=>{
if(res.code==200)
{
this.userInfo = res.data
}else
wx.showToast({
title:res.message,
})
}).catch(error=>{
})
}
}
}
</script>

View File

@@ -0,0 +1,185 @@
<template>
<view>
<navBar leftText="我的点赞"></navBar>
<image class="topBg absolute" src="/static/image/mine/myTopBg.png" mode="widthFix"></image>
<view class="list fixed" :style="'top:'+navH+'px;'">
<view class="item" v-for="(item,index) in myLikeList" :key="index">
<image class="avatar" :src="item.author.avatarurl" mode="aspectFill"></image>
<view class="flex1">
<view class="nickname">{{item.author.nickname}}</view>
<rich-text class="content" :nodes="item.post_content"></rich-text>
<view class="timeReplyLikeC flex between">
<view class="timeReplyC flex">
<view class="time">{{getLocaleHourMinute(item.like_time)}}</view>
<!-- <view class="reply">回复</view> -->
</view>
<view class="likeC flex">
<image class="icon" src="/static/icon/home/like_s.png" mode="widthFix"></image>
<!-- <view class="num">85</view> -->
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { inject } from 'vue';
import { userActivityList } from '@/request/api';
import { getLocaleHourMinute } from '@/utils/util';
export default {
data() {
return {
navH:inject('navHeight'),
myLikeList:[],
page:1,
loadAll:false,
getLocaleHourMinute:getLocaleHourMinute
}
},
onLoad() {
this.getMyLikeListData()
},
onPullDownRefresh() {
this.page = 1
this.getMyLikeListData()
},
onReachBottom() {
if(!this.loadAll)
{
this.page ++
this.getMyLikeListData()
}
},
methods: {
/**
* 获取我的点赞列表数据
*/
getMyLikeListData()
{
let param = {page:this.page,type:'likes'}
userActivityList(param).then(res=>{
if (res.code==200) {
if(res.data.current_page==1)
{
this.myLikeList = res.data.activities
}else
this.myLikeList = this.myLikeList.concat(res.data.activities)
if(res.data.current_page==res.data.pages)
{
this.loadAll = true
}
} else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
}
}
}
</script>
<style lang="less">
.topBg
{
top: 0;
left: 0;
width: 100%;
height: auto;
}
.list
{
background-color: white;
margin-top: 10rpx;
left: 0;
right: 0;
bottom: 0;
overflow-y: scroll;
.item
{
display: flex;
padding: 30rpx 25rpx;
border-bottom: solid 1rpx #E4E4E4;
.avatar
{
margin-right: 23rpx;
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
.nickname
{
font-size: 28rpx;
font-weight: bold;
color: #111;
}
.content
{
margin-top: 10rpx;
line-height: 1.2rem;
font-size: 24rpx;
font-weight: 500;
color: #666;
}
.timeReplyLikeC
{
.time
{
margin-right: 36rpx;
font-size: 26rpx;
font-weight: 500;
color: #aaa;
}
.reply
{
font-size: 26rpx;
font-weight: 500;
color: #F97316;
}
.likeC
{
padding: 14rpx 0;
font-size: 28rpx;
font-weight: bold;
color: #999;
.icon
{
margin-right: 12rpx;
width: 27rpx;
height: auto;
}
}
.likeC.like
{
color: #F97316;
}
}
.totalCommentNumC
{
padding: 14rpx 0 22rpx;
font-size: 26rpx;
font-weight: 500;
color: #999;
.line
{
background-color: #aaa;
margin-right: 18rpx;
width: 30rpx;
height: 2rpx;
}
.arrow
{
margin-left: 14rpx;
width: 13rpx;
height: auto;
}
}
}
}
</style>

View File

@@ -2,43 +2,56 @@
<view>
<navBar leftText="会员中心"></navBar>
<image class="topBg absolute" src="/static/image/mine/myTopBg.png" mode="widthFix"></image>
<view class="vipC relative" :style="'margin-top:'+navH+'px;'">
<view v-if="memberInfo" class="vipC relative" :style="'margin-top:'+navH+'px;'">
<view class="vipInfoC relative">
<image class="bg" src="/static/image/mine/vip/noVipTopBg.png" mode="widthFix"></image>
<view class="infoC absolute">
<image v-if="memberInfo.is_member" class="bg" src="/static/image/mine/vip/vipTopBg.png" mode="widthFix"></image>
<image v-else class="bg" src="/static/image/mine/vip/noVipTopBg.png" mode="widthFix"></image>
<view v-if="memberInfo.is_member" class="infoC vip absolute">
<view class="title">尊贵的VIP会员</view>
<view class="tips">会员有效期至{{memberInfo.member_expire_date}}</view>
</view>
<view v-else class="infoC absolute">
<view class="title">价值前沿</view>
<view class="tips">您还不是会员 加入尊享N项服务</view>
</view>
</view>
<view class="vipProfitIntroC relative">
<view class="titleC flexCenter">
<image class="icon" src="/static/icon/mine/vip/titleLeft.png" mode="widthFix"></image>
<image v-if="memberInfo.is_member" class="icon" src="/static/icon/mine/vip/titleLeft_v.png" mode="widthFix"></image>
<image v-else class="icon" src="/static/icon/mine/vip/titleLeft.png" mode="widthFix"></image>
<view class="title">即刻开启</view>
<image class="icon" src="/static/icon/mine/vip/titleRight.png" mode="widthFix"></image>
<image v-if="memberInfo.is_member" class="icon" src="/static/icon/mine/vip/titleRight_v.png" mode="widthFix"></image>
<image v-else class="icon" src="/static/icon/mine/vip/titleRight.png" mode="widthFix"></image>
</view>
<view class="subtitle">HOW TO SUBSCRIBE</view>
<view class="stepC flex">
<view class="num">01</view>
<view class="step">点击微信顶部搜索框并指定搜索内容为 <text class="impormant">公众号</text></view>
<view class="step">点击微信顶部搜索框并指定搜索内容为 <text :class="'impormant '+(memberInfo.is_member?'vip':'')">公众号</text></view>
</view>
<view class="picList flex">
<view class="pic flex1">
<image class="icon" src="/static/icon/mine/vip/step1.png" mode="widthFix"></image>
<image v-if="memberInfo.is_member" class="icon" src="/static/icon/mine/vip/step1_v.png" mode="widthFix"></image>
<image v-else class="icon" src="/static/icon/mine/vip/step1.png" mode="widthFix"></image>
</view>
<view class="pic flex1">
<image class="icon" src="/static/icon/mine/vip/step2.png" mode="widthFix"></image>
<image v-if="memberInfo.is_member" class="icon" src="/static/icon/mine/vip/step2_v.png" mode="widthFix"></image>
<image v-else class="icon" src="/static/icon/mine/vip/step2.png" mode="widthFix"></image>
</view>
</view>
<view class="stepC flex">
<view class="num">02</view>
<view class="step">搜索<text class="impormant">价值前沿</text>并点击搜索结果中的<text class="impormant">关注</text></view>
<view class="step">搜索
<text :class="'impormant '+(memberInfo.is_member?'vip':'')">价值前沿</text>并点击搜索结果中的
<text :class="'impormant '+(memberInfo.is_member?'vip':'')">关注</text></view>
</view>
<view class="picList flex">
<view class="pic flex1">
<image class="icon" src="/static/icon/mine/vip/step3.png" mode="widthFix"></image>
<image v-if="memberInfo.is_member" class="icon" src="/static/icon/mine/vip/step3_v.png" mode="widthFix"></image>
<image v-else class="icon" src="/static/icon/mine/vip/step3.png" mode="widthFix"></image>
</view>
<view class="pic flex1">
<image class="icon" src="/static/icon/mine/vip/step4.png" mode="widthFix"></image>
<image v-if="memberInfo.is_member" class="icon" src="/static/icon/mine/vip/step4_v.png" mode="widthFix"></image>
<image v-else class="icon" src="/static/icon/mine/vip/step4.png" mode="widthFix"></image>
</view>
</view>
<view class="questionC">
@@ -46,16 +59,18 @@
<view class="iconListC flex">
<image class="icon" src="/static/icon/mine/vip/investQuestion.png" mode="widthFix"></image>
<view class="list flex1">
<view class="item" v-for="(item,index) in questionList" :key="index">
<view :class="'item '+(memberInfo.is_member?'vip':'')" v-for="(item,index) in questionList" :key="index">
{{item}}
</view>
</view>
</view>
</view>
<view class="titleC research flexCenter">
<image class="icon" src="/static/icon/mine/vip/titleLeft.png" mode="widthFix"></image>
<image v-if="memberInfo.is_member" class="icon" src="/static/icon/mine/vip/titleLeft_v.png" mode="widthFix"></image>
<image v-else class="icon" src="/static/icon/mine/vip/titleLeft.png" mode="widthFix"></image>
<view class="title">行业研究中心</view>
<image class="icon" src="/static/icon/mine/vip/titleRight.png" mode="widthFix"></image>
<image v-if="memberInfo.is_member" class="icon" src="/static/icon/mine/vip/titleRight_v.png" mode="widthFix"></image>
<image v-else class="icon" src="/static/icon/mine/vip/titleRight.png" mode="widthFix"></image>
</view>
<view class="subtitle">20余年专业投研赋能每一位投资者</view>
<view class="introC">
@@ -63,8 +78,10 @@
<image class="icon" src="/static/icon/mine/vip/industrialResearch.png" mode="widthFix"></image>
</view>
<view class="titleC decision flexCenter">
<image class="icon" src="/static/icon/mine/vip/titleLeft.png" mode="widthFix"></image>
<image v-if="memberInfo.is_member" class="icon" src="/static/icon/mine/vip/titleLeft_v.png" mode="widthFix"></image>
<image v-else class="icon" src="/static/icon/mine/vip/titleLeft.png" mode="widthFix"></image>
<view class="title">经营决策中心</view>
<image v-if="memberInfo.is_member" class="icon" src="/static/icon/mine/vip/titleRight_v.png" mode="widthFix"></image>
<image class="icon" src="/static/icon/mine/vip/titleRight.png" mode="widthFix"></image>
</view>
<view class="subtitle">数据洞察辅助每一个关键判断</view>
@@ -73,14 +90,16 @@
<image class="icon" src="/static/icon/mine/vip/operatingDecision.png" mode="widthFix"></image>
</view>
<view class="titleC privilege flexCenter">
<image class="icon" src="/static/icon/mine/vip/titleLeft.png" mode="widthFix"></image>
<image v-if="memberInfo.is_member" class="icon" src="/static/icon/mine/vip/titleLeft_v.png" mode="widthFix"></image>
<image v-else class="icon" src="/static/icon/mine/vip/titleLeft.png" mode="widthFix"></image>
<view class="title">会员尊享特权</view>
<image class="icon" src="/static/icon/mine/vip/titleRight.png" mode="widthFix"></image>
<image v-if="memberInfo.is_member" class="icon" src="/static/icon/mine/vip/titleRight_v.png" mode="widthFix"></image>
<image v-else class="icon" src="/static/icon/mine/vip/titleRight.png" mode="widthFix"></image>
</view>
<view class="subtitle">数据洞察辅助每一个关键判断</view>
<view class="privilegeList flexWrap">
<view :class="'privilegeList flexWrap '+(memberInfo.is_member?'vip':'')">
<view class="item flexColumnCenter" v-for="(item,index) in privilegeList" :key="index">
<image class="icon" :src="item.icon" mode="widthFix"></image>
<image class="icon" :src="(memberInfo.is_member?item.icon_v:item.icon)" mode="widthFix"></image>
<view class="title">{{item.title}}</view>
<view class="tips">{{item.tips}}</view>
</view>
@@ -95,61 +114,72 @@
<script>
import { inject } from 'vue';
import { membershipStatus } from '@/request/api';
export default {
data() {
return {
navH:inject('navHeight'),
memberInfo:null, //会员信息
questionList:['信息纷杂难辨真伪?','信息纷杂难辨真伪?','无法把握宏观趋势与行业动向?'],
privilegeList:[{
icon:'/static/icon/mine/vip/depthReport.png',
icon_v:'/static/icon/mine/vip/depthReport_v.png',
title:'深度研报',
tips:'行业/公司独家分析'
},
{
icon:'/static/icon/mine/vip/strategicInsight.png',
icon_v:'/static/icon/mine/vip/strategicInsight_v.png',
title:'策略洞察',
tips:'赛道趋势+拐点信号'
},
{
icon:'/static/icon/mine/vip/dataTool.png',
icon_v:'/static/icon/mine/vip/dataTool_v.png',
title:'数据工具',
tips:'行业/公司独家分析'
},
{
icon:'/static/icon/mine/vip/dataTool.png',
icon_v:'/static/icon/mine/vip/intelligentScreening_v.png',
title:'智能筛选',
tips:'按需定制标的列表'
},
{
icon:'/static/icon/mine/vip/decisionSupport.png',
icon_v:'/static/icon/mine/vip/decisionSupport_v.png',
title:'决策辅助',
tips:'关键因子评分系统'
},
{
icon:'/static/icon/mine/vip/expertMeeting.png',
icon_v:'/static/icon/mine/vip/expertMeeting_v.png',
title:'专家闭门会',
tips:'深度交流机会'
},
{
icon:'/static/icon/mine/vip/dailyReport.png',
icon_v:'/static/icon/mine/vip/dailyReport_v.png',
title:'日报周报',
tips:'研判速递、节奏掌控'
},
{
icon:'/static/icon/mine/vip/specialColumn.png',
icon_v:'/static/icon/mine/vip/specialColumn_v.png',
title:'专题专栏',
tips:'核心团队观点集结'
},
{
icon:'/static/icon/mine/vip/continuouslyUnlock.png',
icon_v:'/static/icon/mine/vip/continuouslyUnlock_v.png',
title:'持续解锁',
tips:'不定期上线新功能'
}]
}
},
onLoad() {
this.getMemberStatus()
},
methods: {
/**
@@ -160,6 +190,23 @@
uni.navigateTo({
url:'/pages/mine/vipMeal/vipMeal'
})
},
/**
* 获取会员状态
*/
getMemberStatus()
{
membershipStatus().then(res=>{
if (res.code==200) {
this.memberInfo = res.data
} else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
}
}
}
@@ -201,6 +248,17 @@
color: #65758A;
}
}
.infoC.vip
{
.title
{
color: #AB3D1A;
}
.tips
{
color: #AB3D1A;
}
}
}
.vipProfitIntroC
{
@@ -264,6 +322,10 @@
{
font-weight: bold;
}
.impormant.vip
{
color: #F97316;
}
}
}
.picList
@@ -316,6 +378,11 @@
color: #555;
text-align: center;
}
.item.vip
{
background-color: #FFEBDB;
color: #F97316;
}
}
}
}
@@ -376,6 +443,10 @@
}
}
}
.privilegeList.vip
{
box-shadow: 0px 0px 9px 0px rgba(249,115,22,0.4);
}
.bottomTitle
{
margin-top: 80rpx;

View File

@@ -2,21 +2,28 @@
<view>
<navBar leftText="会员中心"></navBar>
<image class="topBg absolute" src="/static/image/mine/myTopBg.png" mode="widthFix"></image>
<view class="vipC" :style="'margin-top:'+navH+'px;'">
<view v-if="memberInfo" class="vipC" :style="'margin-top:'+navH+'px;'">
<view class="vipInfoC relative">
<image class="bg" src="/static/image/mine/vip/noVipTopBg.png" mode="widthFix"></image>
<view class="infoC absolute">
<image v-if="memberInfo.is_member" class="bg" src="/static/image/mine/vip/vipTopBg.png" mode="widthFix"></image>
<image v-else class="bg" src="/static/image/mine/vip/noVipTopBg.png" mode="widthFix"></image>
<view v-if="memberInfo.is_member" class="infoC vip absolute">
<view class="title">尊贵的VIP会员</view>
<view class="tips">会员有效期至{{memberInfo.member_expire_date}}</view>
</view>
<view v-else class="infoC absolute">
<view class="title">价值前沿</view>
<view class="tips">您还不是会员 加入尊享N项服务</view>
</view>
</view>
<view class="privilegeCompareC relative">
<view class="titleC flexCenter">
<image class="icon" src="/static/icon/mine/vip/titleLeft.png" mode="widthFix"></image>
<image v-if="memberInfo.is_member" class="icon" src="/static/icon/mine/vip/titleLeft_v.png" mode="widthFix"></image>
<image v-else class="icon" src="/static/icon/mine/vip/titleLeft.png" mode="widthFix"></image>
<view class="title">特权对比</view>
<image class="icon" src="/static/icon/mine/vip/titleRight.png" mode="widthFix"></image>
<image v-if="memberInfo.is_member" class="icon" src="/static/icon/mine/vip/titleRight_v.png" mode="widthFix"></image>
<image v-else class="icon" src="/static/icon/mine/vip/titleRight.png" mode="widthFix"></image>
</view>
<view class="privilegeList">
<view :class="'privilegeList '+(memberInfo.is_member?'vip':'')">
<view class="header flex">
<view class="privilege item">专属特权</view>
<view class="item free">普通免费</view>
@@ -45,20 +52,25 @@
</view>
</view>
</view>
<view class="joinVipC fixed" @click="clickJoinVip()">立即加入年度VIP</view>
<view v-if="memberInfo" class="joinVipC fixed" @click="clickJoinVip()">{{memberInfo.is_member?'您已是年度VIP':'立即加入年度VIP'}}</view>
</view>
</template>
<script>
import { inject } from 'vue';
import { membershipStatus } from '@/request/api';
export default {
data() {
return {
navH:inject('navHeight'),
memberInfo:null, //会员信息
privilegeList:['高效选股工具','股票基金明星榜单','定期专属晨报、股票动态','独家产业研报','个股产业分析','股票、基金基础指标','7x24 财经直播']
}
},
onLoad() {
this.getMemberStatus()
},
methods: {
/**
* 点击加入vip
@@ -66,6 +78,23 @@
clickJoinVip()
{
},
/**
* 获取会员状态
*/
getMemberStatus()
{
membershipStatus().then(res=>{
if (res.code==200) {
this.memberInfo = res.data
} else
uni.showToast({
title:res.message,
icon:'none'
})
}).catch(error=>{
})
}
}
}
@@ -107,6 +136,17 @@
color: #65758A;
}
}
.infoC.vip
{
.title
{
color: #AB3D1A;
}
.tips
{
color: #AB3D1A;
}
}
}
.privilegeCompareC
{
@@ -203,7 +243,10 @@
}
}
}
.privilegeList.vip
{
box-shadow: 0px 0px 9px 0px rgba(249,115,22,0.4);
}
}
}