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

c

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