Commit 65ebd0e7 authored by 何毅恒's avatar 何毅恒

c

parent a23aeb3c
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <!-- <meta name="viewport" id="viewport" content="width=device-width, initial-scale=0.5, maximum-scale=0.5"> -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>格利帮助中心</title> <title>格利帮助中心</title>
</head> </head>
<body> <body>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
"dependencies": { "dependencies": {
"axios": "^1.4.0", "axios": "^1.4.0",
"element-plus": "^2.3.8", "element-plus": "^2.3.8",
"jweixin-module": "^1.6.0",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"pinia": "^2.1.6", "pinia": "^2.1.6",
"terser": "^5.19.2", "terser": "^5.19.2",
...@@ -2531,6 +2532,11 @@ ...@@ -2531,6 +2532,11 @@
"integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
"dev": true "dev": true
}, },
"node_modules/jweixin-module": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
"integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
},
"node_modules/kind-of": { "node_modules/kind-of": {
"version": "6.0.3", "version": "6.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
...@@ -6695,6 +6701,11 @@ ...@@ -6695,6 +6701,11 @@
"integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
"dev": true "dev": true
}, },
"jweixin-module": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
"integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
},
"kind-of": { "kind-of": {
"version": "6.0.3", "version": "6.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
"dependencies": { "dependencies": {
"axios": "^1.4.0", "axios": "^1.4.0",
"element-plus": "^2.3.8", "element-plus": "^2.3.8",
"jweixin-module": "^1.6.0",
"lib-flexible": "^0.3.2",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"pinia": "^2.1.6", "pinia": "^2.1.6",
"terser": "^5.19.2", "terser": "^5.19.2",
......
...@@ -13,6 +13,8 @@ import './style/reset.css' ...@@ -13,6 +13,8 @@ import './style/reset.css'
const app = createApp(App) const app = createApp(App)
import wx from './utils/wxJssdk' import wx from './utils/wxJssdk'
app.config.globalProperties.$wx = wx app.config.globalProperties.$wx = wx
app.config.globalProperties.$img = 'https://c.gelifood.com/' app.config.globalProperties.$img = 'https://c.gelifood.com/'
// app.config.globalProperties.$img = 'https://cms.gelifood.com/' // app.config.globalProperties.$img = 'https://cms.gelifood.com/'
......
...@@ -3,12 +3,13 @@ ...@@ -3,12 +3,13 @@
<h2>{{ informationDetail.title }}</h2> <h2>{{ informationDetail.title }}</h2>
<div class="downBox"> <div class="downBox">
<span>{{ formatDate(informationDetail.add_time) }}</span> <span>{{ formatDate(informationDetail.add_time) }}</span>
<a <!-- <a
v-if="informationDetail.is_down" v-if="informationDetail.is_down"
:href="informationDetail.pdf_url" :href="imgUrl + informationDetail.pdf_url"
:download="informationDetail.title" :download="informationDetail.title"
>点击下载</a >点击下载</a
> > -->
<div class="downLoadBtn" @click="downLoad">点击下载</div>
</div> </div>
<p v-html="informationDetail.content"></p> <p v-html="informationDetail.content"></p>
</div> </div>
...@@ -24,14 +25,21 @@ import { ...@@ -24,14 +25,21 @@ import {
} from "vue"; } from "vue";
import { post } from "@/api/index"; import { post } from "@/api/index";
import { formatDate } from "@/utils/index"; import { formatDate } from "@/utils/index";
// import wx from "weixin-js-sdk";
const { const {
appContext: { appContext: {
config: { globalProperties }, config: { globalProperties },
}, },
} = getCurrentInstance() as ComponentInternalInstance; } = getCurrentInstance() as ComponentInternalInstance;
const route = useRouter(); const route = useRouter();
const imgUrl = globalProperties.$img;
onMounted(() => { onMounted(() => {
getInformationDetail(id); getInformationDetail(id);
// 引入jweixin-1.3.2.js
let script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://res.wx.qq.com/open/js/jweixin-1.3.2.js";
document.body.appendChild(script);
}); });
let id = route.currentRoute.value.query.id; let id = route.currentRoute.value.query.id;
let informationDetail: any = ref(); let informationDetail: any = ref();
...@@ -46,7 +54,12 @@ const getInformationDetail = async (id) => { ...@@ -46,7 +54,12 @@ const getInformationDetail = async (id) => {
wxJssdk(); wxJssdk();
} }
}; };
const downLoad = () => {
let pdf_url = imgUrl + informationDetail.value.pdf_url;
wx.miniProgram.navigateTo({
url: "/pkgB/autoDownloadh5/autoDownloadh5?pdf_url=" + pdf_url,
});
};
// jssdk 微信分享 // jssdk 微信分享
const wxJssdk = () => { const wxJssdk = () => {
let obj = { let obj = {
...@@ -89,6 +102,13 @@ const wxJssdk = () => { ...@@ -89,6 +102,13 @@ const wxJssdk = () => {
color: #e75d5d; color: #e75d5d;
line-height: 16.5px; line-height: 16.5px;
} }
.downLoadBtn {
height: 16.5px;
font-size: 12px;
font-weight: 500;
color: #e75d5d;
line-height: 16.5px;
}
} }
p { p {
font-size: 14px; font-size: 14px;
......
...@@ -123,6 +123,7 @@ let informationListParam = ref({ ...@@ -123,6 +123,7 @@ let informationListParam = ref({
category_id_1: "", // 1级分类id category_id_1: "", // 1级分类id
category_id_2: "", // 2级分类id category_id_2: "", // 2级分类id
title: "", // title: "", //
is_show:1
}); });
let informationList = ref([]); let informationList = ref([]);
const getInformationList = async () => { const getInformationList = async () => {
...@@ -144,7 +145,7 @@ const selectSecondClassifyItem = (row) => { ...@@ -144,7 +145,7 @@ const selectSecondClassifyItem = (row) => {
const wxJssdk = () => { const wxJssdk = () => {
let obj = { let obj = {
title: "帮助中心", title: "帮助中心",
link: 'https://testhelp.gelifood.com/index.html', link: "https://testhelp.gelifood.com/index.html",
desc: "", desc: "",
imgUrl: "../../assets/img/helpImg.png", imgUrl: "../../assets/img/helpImg.png",
}; };
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
import { ref, defineAsyncComponent, onMounted } from "vue"; import { ref, defineAsyncComponent, onMounted } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { post } from "@/api/index"; import { post } from "@/api/index";
const ArticleItem = defineAsyncComponent( const ArticleItem = defineAsyncComponent(
() => import("@/components/ArticleItem.vue") () => import("@/components/ArticleItem.vue")
); );
...@@ -65,6 +66,7 @@ const cancel = (): void => { ...@@ -65,6 +66,7 @@ const cancel = (): void => {
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
#search { #search {
width: 100vw;
.noData { .noData {
text-align: center; text-align: center;
img { img {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="title">{{ informationDetail.title }}</div> <div class="title">{{ informationDetail.title }}</div>
<a <a
v-if="informationDetail.is_down" v-if="informationDetail.is_down"
:href="informationDetail.pdf_url" :href="imgUrl + informationDetail.pdf_url"
:download="informationDetail.title" :download="informationDetail.title"
class="downText" class="downText"
>点击下载</a >点击下载</a
...@@ -13,14 +13,24 @@ ...@@ -13,14 +13,24 @@
</template> </template>
<script lang='ts' setup> <script lang='ts' setup>
import { ref, onMounted } from "vue"; import {
import { useRoute, useRouter } from "vue-router"; ref,
onMounted,
getCurrentInstance,
ComponentInternalInstance,
} from "vue";
import { useRoute } from "vue-router";
import { post } from "@/api/index"; import { post } from "@/api/index";
onMounted(() => { onMounted(() => {
getInformationDetail(id); getInformationDetail(id);
}); });
const {
appContext: {
config: { globalProperties },
},
} = getCurrentInstance() as ComponentInternalInstance;
const route = useRoute(); const route = useRoute();
const imgUrl = globalProperties.$img;
// 文章详情 // 文章详情
let id = route.query.id; let id = route.query.id;
let informationDetail: any = ref(); let informationDetail: any = ref();
......
...@@ -48,6 +48,7 @@ let informationListState = ref({ ...@@ -48,6 +48,7 @@ let informationListState = ref({
category_id_1: category_id_1.value, category_id_1: category_id_1.value,
category_id_2: category_id_2.value, category_id_2: category_id_2.value,
title: "", title: "",
is_show: 1,
}); });
let informationList: any = ref({}); let informationList: any = ref({});
// 获取列表 // 获取列表
......
...@@ -8,11 +8,11 @@ class wxJssdk{ ...@@ -8,11 +8,11 @@ class wxJssdk{
} }
// 初始化配置 // 初始化配置
async wxConfig(){ async wxConfig(){
let url:string = window.location.href.split("#")[0]; let url:string = window.location.href.split("/#")[0];
let res:any = await post('Information/getTicket',{url}) let res:any = await post('Information/getTicket',{url})
if (res.code == 0) { if (res.code == 0) {
wx.config({ wx.config({
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.data.appid, // 必填,公众号的唯一标识 appId: res.data.appid, // 必填,公众号的唯一标识
timestamp: res.data.timestamp, // 必填,生成签名的时间戳 timestamp: res.data.timestamp, // 必填,生成签名的时间戳
nonceStr: res.data.noncestr, // 必填,生成签名的随机串 nonceStr: res.data.noncestr, // 必填,生成签名的随机串
...@@ -21,10 +21,12 @@ class wxJssdk{ ...@@ -21,10 +21,12 @@ class wxJssdk{
'updateAppMessageShareData', 'updateAppMessageShareData',
'updateTimelineShareData', 'updateTimelineShareData',
], ],
openTagList: ["wx-open-launch-weapp"],
}); });
} }
} }
// 微信分享 // 微信分享
wxShare(shareObj:any) { wxShare(shareObj:any) {
this.wxConfig(); this.wxConfig();
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment