consultationDetails.vue
2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<template>
<view class="">
<view class="mainBox">
<view class="title">{{detail.title}}</view>
<view class="timenev flexD">
<view class="time">
发布时间{{detail.publishtime}}
</view>
<image src="../../static/ic_fenxiang.png" mode="" @click="shareModel=true"></image>
</view>
<mp-html :content="detail.content" />
<!-- <rich-text :nodes="detail.content"></rich-text> -->
</view>
<view class="share" v-if="shareModel" @click="shareModel=false">
<image src="/static/detailShare.png" mode=""></image>
<view class="">
点击这里进行分享
</view>
</view>
</view>
</template>
<script>
import {
arc_detail
} from '@/api/index.js'
export default {
data() {
return {
id: "",
detail: {
title: "",
publishtime: "",
content: "",
},
shareModel: false,
Images: "http://yuanjie.n.broing.cn/assets/img/share_logo.jpg",
jssdk: {},
}
},
onLoad(options) {
this.id = options.id
let title = uni.getStorageSync("deltitle")
if(uni.getStorageSync("deltitle")){
uni.setNavigationBarTitle({
title: title //这是修改后的导航栏文字
})
}else{
uni.setNavigationBarTitle({
title: "资讯" //这是修改后的导航栏文字
})
}
let URL=window.location.href
this.$wxH5Share.get_jssdk(title,URL)
this.arc_detail()
// console.log(!(uni.getSystemInfoSync().platform == 'android'))
// if (!(uni.getSystemInfoSync().platform == 'android')) {
// if (location.href.indexOf("#reloaded") == -1) {
// location.href = location.href + "#reloaded";
// location.reload();
// }
// }
},
onUnload() {
uni.removeStorageSync("deltitle")
},
methods: {
//详情
async arc_detail() {
try {
const res = await arc_detail(this.id, window.location.href)
this.detail = res.detail
this.jssdk = res.jssdk
// this.share()
console.log('arc_detail', res)
// 保存数据
} catch (err) {
uni.showToast({
title: err,
icon: 'none'
})
console.log('arc_detail', err)
}
},
}
}
</script>
<style lang="less">
.mainBox {
padding: 24rpx 31rpx;
.timenev {
margin-top: 20rpx;
color: rgba(179, 179, 179, 1);
font-size: 24rpx;
font-weight: 400;
font-family: "PingFang SC";
image {
width: 40rpx;
height: 40rpx;
}
}
}
.share {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, .6);
image {
position: fixed;
right: 80rpx;
top: 4rpx;
width: 188rpx;
height: 262rpx;
}
view {
position: fixed;
right: 80rpx;
top: 300rpx;
color: rgba(255, 255, 255, 1);
font-size: 36rpx;
font-weight: 700;
}
}
</style>