fix: 修复分享路径错误并优化代码格式
修复indexNewsInfo.vue中分享路径的拼写错误(/page/改为/pages/) 在rankDetail.vue中添加返回功能 优化多个组件的代码格式和样式
This commit is contained in:
parent
aada0e1c2c
commit
14fa72f32b
|
|
@ -1,10 +1,10 @@
|
|||
<template>
|
||||
<view class="main">
|
||||
<text style="margin-left: 40rpx;margin-right: 40rpx;display: flex;">
|
||||
<text style="margin-left: 40rpx; margin-right: 40rpx; display: flex">
|
||||
<text class="title">{{ props.data.title?.slice(0, 3) }}</text>
|
||||
<text :class="['title', isLogin ? '' : 'mohu']">{{ props.data.title?.slice(3,
|
||||
props.data.title.length
|
||||
- 1) }}</text>
|
||||
<text :class="['title', isLogin ? '' : 'mohu']">{{
|
||||
props.data.title?.slice(3, props.data.title.length)
|
||||
}}</text>
|
||||
</text>
|
||||
|
||||
<view class="author">
|
||||
|
|
@ -22,17 +22,31 @@
|
|||
|
||||
<!-- 两个标签 start -->
|
||||
<view class="r_r_tags">
|
||||
<view style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 95vw">
|
||||
<view
|
||||
style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 95vw"
|
||||
>
|
||||
<view class="r_tags">
|
||||
<view class="tag" style="background-color: #fff9ec; color: #ffb100"
|
||||
v-for="(item, index) in props.data.conceptLabels" :key="index">{{ item }}</view>
|
||||
<view
|
||||
class="tag"
|
||||
style="background-color: #fff9ec; color: #ffb100"
|
||||
v-for="(item, index) in props.data.conceptLabels"
|
||||
:key="index"
|
||||
>{{ item }}</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 100vw">
|
||||
<view
|
||||
style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 100vw"
|
||||
>
|
||||
<view class="r_tags">
|
||||
<view class="tag" style="background-color: #f5f8fe; color: #007aff"
|
||||
v-for="(item, index) in props.data.industryLabels" :key="index">{{ item }}</view>
|
||||
<view
|
||||
class="tag"
|
||||
style="background-color: #f5f8fe; color: #007aff"
|
||||
v-for="(item, index) in props.data.industryLabels"
|
||||
:key="index"
|
||||
>{{ item }}</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -40,7 +54,6 @@
|
|||
|
||||
<!-- 摘要 -->
|
||||
<view :class="['desc', isLogin ? '' : 'mohu']" v-if="props.data.summary">
|
||||
|
||||
<!-- <view class="bill_icon"></view> -->
|
||||
{{ props.data.summary }}
|
||||
</view>
|
||||
|
|
@ -54,8 +67,11 @@
|
|||
v-html="props.data.content">
|
||||
</text> -->
|
||||
|
||||
<rich-text :class="['articleDes', isLogin ? '' : 'mohu']" style="white-space: pre-wrap"
|
||||
v-html="props.data.content"></rich-text>
|
||||
<rich-text
|
||||
:class="['articleDes', isLogin ? '' : 'mohu']"
|
||||
style="white-space: pre-wrap"
|
||||
v-html="props.data.content"
|
||||
></rich-text>
|
||||
</view>
|
||||
|
||||
<!-- <view
|
||||
|
|
@ -77,7 +93,7 @@ import {
|
|||
onShareTimeline,
|
||||
} from "@dcloudio/uni-app";
|
||||
// import articleMock from "@/mock/article.js";
|
||||
const isLogin = ref(uni.getStorageSync('token'))
|
||||
const isLogin = ref(uni.getStorageSync("token"));
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ onShareTimeline(async (res) => {
|
|||
});
|
||||
return {
|
||||
title: data.value.title, //标题
|
||||
path: "/page/detail/indexNewsInfo?id=" + data.value.id, //可以指定动态路径
|
||||
path: "/pages/detail/indexNewsInfo?id=" + data.value.id, //可以指定动态路径
|
||||
imageUrl:
|
||||
"https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/share_pic_1%402x.png", //分享图
|
||||
};
|
||||
|
|
@ -260,7 +260,7 @@ onShareAppMessage(async (res) => {
|
|||
});
|
||||
return {
|
||||
title: data.value.title, //标题
|
||||
path: "/page/detail/indexNewsInfo?id=" + data.value.id, //可以指定动态路径
|
||||
path: "/pages/detail/indexNewsInfo?id=" + data.value.id, //可以指定动态路径
|
||||
imageUrl:
|
||||
"https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/share_pic_1%402x.png", //分享图
|
||||
};
|
||||
|
|
|
|||
|
|
@ -255,6 +255,10 @@ function goSreach() {
|
|||
}
|
||||
}
|
||||
|
||||
function goBack() {
|
||||
uni.navigateBack();
|
||||
}
|
||||
|
||||
const tagClickedClass = ref("");
|
||||
const props = reactive({});
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,12 @@
|
|||
<!-- 列表区域 -->
|
||||
<!-- @click="jump(item)" -->
|
||||
<view class="colListContainer">
|
||||
<view class="colListItem" v-for="item in data" :key="item.id" @click="jump(item)">
|
||||
<view
|
||||
class="colListItem"
|
||||
v-for="item in data"
|
||||
:key="item.id"
|
||||
@click="jump(item)"
|
||||
>
|
||||
<view class="ItemLeft">
|
||||
<view class="colName">{{ item.name }}</view>
|
||||
<view class="colDesc">{{ item.desc }}</view>
|
||||
|
|
@ -53,7 +58,9 @@ const formatData = (data: any) => {
|
|||
if (data.indexOf(item.type) !== -1) {
|
||||
return {
|
||||
...item,
|
||||
validTime: formatTime(new Date().getTime() + 1000 * 60 * 60 * 24 * 30),
|
||||
validTime: formatTime(
|
||||
new Date().getTime() + 1000 * 60 * 60 * 24 * 30
|
||||
),
|
||||
};
|
||||
}
|
||||
})
|
||||
|
|
@ -135,7 +142,8 @@ const colList = ref([
|
|||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
.flashBack {}
|
||||
.flashBack {
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: var(--h1-font-size);
|
||||
|
|
|
|||
Loading…
Reference in New Issue