|
@@ -1,164 +1,193 @@
|
|
|
<template>
|
|
|
- <view>
|
|
|
- <!-- pages/me.wxml -->
|
|
|
- <view class="container">
|
|
|
- <h1 class="title">{{ detailInfo.titleName }}</h1>
|
|
|
- <view class="wenzhangLy">
|
|
|
- <!-- 头像昵称 -->
|
|
|
- <view class="txTime">
|
|
|
- <image :src="(detailInfo.headImg!=null)?loadImgSrcLocalhost(detailInfo.headImg):'https://tse4-mm.cn.bing.net/th/id/OIP-C.cYyiJYfTo1SY1cj26FQpAQHaHa?rs=1&pid=ImgDetMain'" style="border-radius: 50px;"></image>
|
|
|
- <view class="time">
|
|
|
- <p>{{detailInfo.nickName?detailInfo.nickName:'网友'}}</p>
|
|
|
- <span>{{ detailInfo.createTime }}</span>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <!-- 积分 -->
|
|
|
-<!-- <span class="jf">100</span> -->
|
|
|
- </view>
|
|
|
- <view class="wenzhangCont article">
|
|
|
+ <view>
|
|
|
+ <!-- pages/me.wxml -->
|
|
|
+ <view class="container">
|
|
|
+ <h1 class="title">{{ detailInfo.titleName }}</h1>
|
|
|
+<!-- <view class="wenzhangLy">-->
|
|
|
+<!-- <!– 头像昵称 –>-->
|
|
|
+<!-- <view class="txTime">-->
|
|
|
+<!-- <img-->
|
|
|
+<!-- class="uni-header-image"-->
|
|
|
+<!-- :src="initInfo.headImg == null || initInfo.headImg == '' ? initImgPath : loadImgSrcLocalhost(initInfo.headImg)"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- <view class="time">-->
|
|
|
+<!-- <p>{{ initInfo.name == null || initInfo.name == '' ? initInfo.wechatName : initInfo.name }}</p>-->
|
|
|
+<!-- <span>{{ fromData.createTime }}</span>-->
|
|
|
+<!-- </view>-->
|
|
|
+<!-- </view>-->
|
|
|
+<!-- </view>-->
|
|
|
+ <view class="wenzhangCont article">
|
|
|
<span v-html="detailInfo.textDetails">
|
|
|
</span>
|
|
|
|
|
|
- <view >
|
|
|
- <!-- 图片轮播 -->
|
|
|
- <swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration" :circular="circular">
|
|
|
- <block v-for="(one, index) in detailInfo.urls" :key="index">
|
|
|
- <swiper-item><image :src="loadImgSrcLocalhost(one)" style="background-size: 100% 100%;"></image></swiper-item>
|
|
|
- </block>
|
|
|
- </swiper>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <view>
|
|
|
+ <!-- 图片轮播 -->
|
|
|
+ <swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration"
|
|
|
+ :circular="circular">
|
|
|
+ <block v-for="(one, index) in detailInfo.urls" :key="index">
|
|
|
+ <swiper-item>
|
|
|
+ <image :src="loadImgSrcLocalhost(one)" style="background-size: 100% 100%;"></image>
|
|
|
+ </swiper-item>
|
|
|
+ </block>
|
|
|
+ </swiper>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
|
|
|
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getServer } from '@/api/information/information.js'
|
|
|
-// pages/me.js
|
|
|
+import {getServer} from '@/api/information/information.js'
|
|
|
+import {
|
|
|
+ getUserInfo
|
|
|
+} from '@/api/me/me.js'
|
|
|
+
|
|
|
export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- anwserVal:'',
|
|
|
- anwserList:[
|
|
|
- {
|
|
|
- deptName:'国家乡村振兴局',
|
|
|
- updateTime:'2023-2-27 16:04',
|
|
|
- desc:'用好政策效果评估成果,进一步优化巩固拓展脱贫攻坚成果同乡村振兴有效衔接政策供给,为推动工作提质增效提供有力支撑保障。',
|
|
|
- }
|
|
|
- ],
|
|
|
- isCollection:false,
|
|
|
- isAdopt:false,
|
|
|
- adoptTopSize:'115',
|
|
|
- adoptIndex:null,
|
|
|
- detailInfo:{},
|
|
|
- };
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ anwserVal: '',
|
|
|
+ anwserList: [
|
|
|
+ {
|
|
|
+ deptName: '国家乡村振兴局',
|
|
|
+ updateTime: '2023-2-27 16:04',
|
|
|
+ desc: '用好政策效果评估成果,进一步优化巩固拓展脱贫攻坚成果同乡村振兴有效衔接政策供给,为推动工作提质增效提供有力支撑保障。',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ isCollection: false,
|
|
|
+ isAdopt: false,
|
|
|
+ adoptTopSize: '115',
|
|
|
+ adoptIndex: null,
|
|
|
+ detailInfo: {},
|
|
|
+ initInfo: {
|
|
|
+ userId: null,
|
|
|
+ scoreNum: 0,
|
|
|
+ wechatName: "微信用户",
|
|
|
+ name: null,
|
|
|
+ headImg: null,
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 评论回答
|
|
|
+ answerFunc() {
|
|
|
+ this.anwserList.push({
|
|
|
+ deptName: '国家烟草局',
|
|
|
+ updateTime: new Date().getFullYear() + "-" + new Date().getMonth() + "-" + new Date().getDay() + " " + (new Date().getHours() < 10 ? "0" + new Date().getHours() : new Date().getHours()) + ':' + (new Date().getMinutes() < 10 ? "0" + new Date().getMinutes() : new Date().getMinutes()),
|
|
|
+ desc: this.anwserVal,
|
|
|
+ })
|
|
|
+ this.anwserVal = null
|
|
|
},
|
|
|
- methods: {
|
|
|
- // 评论回答
|
|
|
- answerFunc(){
|
|
|
- this.anwserList.push({
|
|
|
- deptName:'国家烟草局',
|
|
|
- updateTime:new Date().getFullYear() + "-" + new Date().getMonth() + "-" + new Date().getDay() + " " + (new Date().getHours() < 10 ? "0" + new Date().getHours() : new Date().getHours()) + ':' + (new Date().getMinutes() < 10 ? "0" + new Date().getMinutes() : new Date().getMinutes()),
|
|
|
- desc:this.anwserVal,
|
|
|
- })
|
|
|
- this.anwserVal = null
|
|
|
- },
|
|
|
- adoptFunc(idx){
|
|
|
- this.adoptIndex = idx
|
|
|
- this.isAdopt = true
|
|
|
- },
|
|
|
- // 标记喜欢
|
|
|
- collectionFunc(){
|
|
|
- this.isCollection = !this.isCollection
|
|
|
- },
|
|
|
- // 加工图片路径
|
|
|
- srcExcutedFunc(html){
|
|
|
- let newReg = /(?<=(src="))[^"]*?(?=")/ig;
|
|
|
- let newHtml = html
|
|
|
- var allSrc = html.match(newReg);
|
|
|
- try{
|
|
|
- if(allSrc.length != 0){
|
|
|
- allSrc.forEach(e => {
|
|
|
- newHtml = newHtml.replace(e,this.loadImgSrc(e))
|
|
|
- })
|
|
|
- }
|
|
|
- }catch(e){
|
|
|
- //TODO handle the exception
|
|
|
- }
|
|
|
+ adoptFunc(idx) {
|
|
|
+ this.adoptIndex = idx
|
|
|
+ this.isAdopt = true
|
|
|
+ },
|
|
|
+ // 标记喜欢
|
|
|
+ collectionFunc() {
|
|
|
+ this.isCollection = !this.isCollection
|
|
|
+ },
|
|
|
+ // 加工图片路径
|
|
|
+ srcExcutedFunc(html) {
|
|
|
+ let newReg = /(?<=(src="))[^"]*?(?=")/ig;
|
|
|
+ let newHtml = html
|
|
|
+ var allSrc = html.match(newReg);
|
|
|
+ try {
|
|
|
+ if (allSrc.length != 0) {
|
|
|
+ allSrc.forEach(e => {
|
|
|
+ newHtml = newHtml.replace(e, this.loadImgSrc(e))
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ //TODO handle the exception
|
|
|
+ }
|
|
|
|
|
|
- return newHtml
|
|
|
- }
|
|
|
- }
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面加载
|
|
|
- */,
|
|
|
- onLoad(options) {
|
|
|
- console.log('options',options)
|
|
|
- getServer(options).then(res => {
|
|
|
- let result = res.data
|
|
|
- // result.textDetails = this.srcExcutedFunc(result.textDetails)
|
|
|
- this.detailInfo = result
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面初次渲染完成
|
|
|
- */
|
|
|
- onReady(e) {
|
|
|
- },
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面显示
|
|
|
- */
|
|
|
- onShow() {},
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面隐藏
|
|
|
- */
|
|
|
- onHide() {},
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面卸载
|
|
|
- */
|
|
|
- onUnload() {},
|
|
|
- /**
|
|
|
- * 页面相关事件处理函数--监听用户下拉动作
|
|
|
- */
|
|
|
- onPullDownRefresh() {},
|
|
|
- /**
|
|
|
- * 页面上拉触底事件的处理函数
|
|
|
- */
|
|
|
- onReachBottom() {},
|
|
|
- /**
|
|
|
- * 用户点击右上角分享
|
|
|
- */
|
|
|
- onShareAppMessage() {},
|
|
|
+ return newHtml
|
|
|
+ },
|
|
|
+ getUserInfoByUserId(userId) {
|
|
|
+ getUserInfo(userId).then(res => {
|
|
|
+ this.initInfo = res.data;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面加载
|
|
|
+ */,
|
|
|
+ onLoad(options) {
|
|
|
+ console.log('options', options)
|
|
|
+ getServer(options).then(res => {
|
|
|
+ let result = res.data
|
|
|
+ // result.textDetails = this.srcExcutedFunc(result.textDetails)
|
|
|
+ this.detailInfo = result
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面初次渲染完成
|
|
|
+ */
|
|
|
+ onReady(e) {
|
|
|
+ this.userId = getApp().globalData.userId
|
|
|
+ this.getUserInfoByUserId(this.userId)
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面显示
|
|
|
+ */
|
|
|
+ onShow() {
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面隐藏
|
|
|
+ */
|
|
|
+ onHide() {
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面卸载
|
|
|
+ */
|
|
|
+ onUnload() {
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 页面相关事件处理函数--监听用户下拉动作
|
|
|
+ */
|
|
|
+ onPullDownRefresh() {
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 页面上拉触底事件的处理函数
|
|
|
+ */
|
|
|
+ onReachBottom() {
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 用户点击右上角分享
|
|
|
+ */
|
|
|
+ onShareAppMessage() {
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
@import 'informationDetail.css';
|
|
|
|
|
|
-.collect{
|
|
|
- .icon-shoucang:before{
|
|
|
- color: red;
|
|
|
- }
|
|
|
+.collect {
|
|
|
+ .icon-shoucang:before {
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
}
|
|
|
-.not-collect{
|
|
|
+
|
|
|
+.not-collect {
|
|
|
|
|
|
}
|
|
|
-.effectBix{
|
|
|
- width: 56px;
|
|
|
- height: 56px;
|
|
|
- border-radius: 50px;
|
|
|
- font-family: 'Bebas Neue', cursive;
|
|
|
- background: linear-gradient(45deg, transparent 5%, #FF013C 5%);
|
|
|
- border: 0;
|
|
|
- color: #fff;
|
|
|
- text-align: center;
|
|
|
- line-height: 56px;
|
|
|
- outline: transparent;
|
|
|
- position: absolute;
|
|
|
- transform: rotate(-30deg);
|
|
|
- right:3%;
|
|
|
- top: -5%;
|
|
|
+
|
|
|
+.effectBix {
|
|
|
+ width: 56px;
|
|
|
+ height: 56px;
|
|
|
+ border-radius: 50px;
|
|
|
+ font-family: 'Bebas Neue', cursive;
|
|
|
+ background: linear-gradient(45deg, transparent 5%, #FF013C 5%);
|
|
|
+ border: 0;
|
|
|
+ color: #fff;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 56px;
|
|
|
+ outline: transparent;
|
|
|
+ position: absolute;
|
|
|
+ transform: rotate(-30deg);
|
|
|
+ right: 3%;
|
|
|
+ top: -5%;
|
|
|
}
|
|
|
|
|
|
.effectBox, .effectBox::after {
|