提交 a6f82784 authored 作者: matian's avatar matian

修改课程包可购买,以及微信分享等

上级 f820bdff
...@@ -24,9 +24,9 @@ export default [ ...@@ -24,9 +24,9 @@ export default [
course_hour: '8课时', course_hour: '8课时',
course_id: '7000656984332566528', course_id: '7000656984332566528',
class_id: '6998519782265847808', class_id: '6998519782265847808',
total_price_desc: '(课程费用:4300元/人,考试费、认证费、教材费合计680元/人)', total_price_desc: '(课程费用4300元/人,考试费/认证费/教材费合计680元/人)',
sku_id: '', sku_id: '7014129405609902080',
spu_id: '' spu_id: '7014129404863315968'
}, },
{ {
category: 'PAAP(Ⅰ)', category: 'PAAP(Ⅰ)',
......
...@@ -24,9 +24,9 @@ export default [ ...@@ -24,9 +24,9 @@ export default [
course_hour: '8课时', course_hour: '8课时',
course_id: '6998547457529348096', course_id: '6998547457529348096',
class_id: '6998519782265847808', class_id: '6998519782265847808',
total_price_desc: '(课程费用:7000元/人,考试费、认证费、教材费合计680元/人)', total_price_desc: '(课程费用7000元/人,考试费/认证费/教材费合计680元/人)',
sku_id: '', sku_id: '7014130347952570368',
spu_id: '' spu_id: '7014130347390533632'
}, },
{ {
category: 'PAAP(Ⅱ)', category: 'PAAP(Ⅱ)',
......
...@@ -24,9 +24,9 @@ export default [ ...@@ -24,9 +24,9 @@ export default [
course_hour: '8课时', course_hour: '8课时',
course_id: '6998547457529348096', course_id: '6998547457529348096',
class_id: '6998519782265847808', class_id: '6998519782265847808',
total_price_desc: '(课程费:12000元/人,考试费、认证费、教材费合计980元/人)', total_price_desc: '(课程费用12000元/人,考试费/认证费/教材费合计980元/人)',
sku_id: '', sku_id: '7014130543629434880',
spu_id: '' spu_id: '7014130542861877248'
}, },
{ {
category: 'PAAM', category: 'PAAM',
......
...@@ -6,8 +6,10 @@ ...@@ -6,8 +6,10 @@
<meta name="theme-color" content="#3276fc" /> <meta name="theme-color" content="#3276fc" />
<meta <meta
name="viewport" name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" /> content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"
/>
<title>清控紫荆金保</title> <title>清控紫荆金保</title>
<script src="https://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script type="module"> <script type="module">
;(async () => { ;(async () => {
window.SHOP = await import('https://webapp-pub.ezijing.com/project_online/fi/shop.js') window.SHOP = await import('https://webapp-pub.ezijing.com/project_online/fi/shop.js')
...@@ -18,6 +20,5 @@ ...@@ -18,6 +20,5 @@
<div id="app"></div> <div id="app"></div>
<script type="module" src="/src/main.ts"></script> <script type="module" src="/src/main.ts"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script> <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
</body> </body>
</html> </html>
...@@ -36,12 +36,12 @@ const { mobile } = useDevice() ...@@ -36,12 +36,12 @@ const { mobile } = useDevice()
<div class="concat_tit">联系我们</div> <div class="concat_tit">联系我们</div>
<div class="concat_con" v-if="!mobile"> <div class="concat_con" v-if="!mobile">
<div class="con_address"> <div class="con_address">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址:北京市海淀区中关村东路1号院清华科技园7号楼5层 &nbsp;&nbsp;&nbsp;&nbsp;址:北京市海淀区中关村东路1号院清华科技园7号楼5层
<br /> <br />
深圳市福田区博今商务广场A座22层 深圳市福田区博今商务广场A座22层
</div> </div>
<div class="con_email">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;箱:THHZJFI@ezijing.com</div> <div class="con_email">&nbsp;&nbsp;&nbsp;&nbsp;箱:THHZJFI@ezijing.com</div>
<div class="con_email">PAA秘书处:13263110169(同微信)</div> <div class="con_email">FI办公室:13263110169(同微信)</div>
</div> </div>
<div class="concat_con" v-else> <div class="concat_con" v-else>
<div class="con_address"> <div class="con_address">
...@@ -50,7 +50,7 @@ const { mobile } = useDevice() ...@@ -50,7 +50,7 @@ const { mobile } = useDevice()
深圳市福田区博今商务广场A座22层 深圳市福田区博今商务广场A座22层
</div> </div>
<div class="con_email">邮箱:THHZJFI@ezijing.com</div> <div class="con_email">邮箱:THHZJFI@ezijing.com</div>
<div class="con_email">PAA秘书处:13263110169(同微信)</div> <div class="con_email">FI办公室:13263110169(同微信)</div>
</div> </div>
</div> </div>
<div class="part_code"> <div class="part_code">
...@@ -161,8 +161,8 @@ const { mobile } = useDevice() ...@@ -161,8 +161,8 @@ const { mobile } = useDevice()
color: #ffffff; color: #ffffff;
.con_address { .con_address {
padding-left: 84px; padding-left: 65px;
text-indent: -84px; text-indent: -65px;
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { useWindowScroll } from '@vueuse/core' import { useWindowScroll } from '@vueuse/core'
import { useUserStore } from '@/stores/user' import { useUserStore } from '@/stores/user'
import AppNav from './Nav.vue' import AppNav from './Nav.vue'
// import { ElMessage } from 'element-plus' // import { ElMessage } from 'element-plus'
import { useDevice } from '@/composables/useDevice' import { useDevice } from '@/composables/useDevice'
// const courseStore = useUserStore() // const courseStore = useUserStore()
...@@ -95,7 +95,7 @@ function handleUser() { ...@@ -95,7 +95,7 @@ function handleUser() {
left: 0; left: 0;
right: 0; right: 0;
color: #fff; color: #fff;
background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%); background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.9) 100%);
.logo { .logo {
background: url('@/assets/images/logo_white.png') no-repeat; background: url('@/assets/images/logo_white.png') no-repeat;
background-size: contain; background-size: contain;
......
...@@ -19,6 +19,7 @@ import AppCard from '@/components/base/AppCard.vue' ...@@ -19,6 +19,7 @@ import AppCard from '@/components/base/AppCard.vue'
import AppContainer from '@/components/base/AppContainer.vue' import AppContainer from '@/components/base/AppContainer.vue'
import modules from './modules' import modules from './modules'
import useWXShare from '@/utils/wx'
const app = createApp(App) const app = createApp(App)
...@@ -35,3 +36,4 @@ app.use(createPinia()) ...@@ -35,3 +36,4 @@ app.use(createPinia())
app.use(router) app.use(router)
app.use(ElementPlus, { locale: zhCn }) app.use(ElementPlus, { locale: zhCn })
app.mount('#app') app.mount('#app')
useWXShare()
...@@ -7,6 +7,10 @@ import Knowledge from '../components/Knowledge.vue' ...@@ -7,6 +7,10 @@ import Knowledge from '../components/Knowledge.vue'
import Course from '../components/Course.vue' import Course from '../components/Course.vue'
import Brand from '../components/Brand.vue' import Brand from '../components/Brand.vue'
import Contact from '../components/Contact.vue' import Contact from '../components/Contact.vue'
import useWXShare from '@/utils/wx'
onMounted(() => {
useWXShare()
})
</script> </script>
<template> <template>
......
...@@ -80,7 +80,7 @@ const handleAgree = (val: any) => { ...@@ -80,7 +80,7 @@ const handleAgree = (val: any) => {
</div> </div>
<div class="pay_con"> <div class="pay_con">
<div class="pay_phone"> <div class="pay_phone">
课程提醒将发送到您的手机:<i style="font-weight: bold">{{ userStore.user?.mobile }}</i> 小提示:上课方式将发送到您的手机:<i style="font-weight: bold">{{ userStore.user?.mobile }}</i>
</div> </div>
<div class="pay_line"></div> <div class="pay_line"></div>
<div class="pay_mode"> <div class="pay_mode">
......
...@@ -60,7 +60,7 @@ const handleAgree = (val: any) => { ...@@ -60,7 +60,7 @@ const handleAgree = (val: any) => {
</div> </div>
</div> </div>
</div> </div>
<div class="con_message">课程提醒将发送到您的手机:{{ userStore.user?.mobile }}</div> <div class="con_message">小提示:上课方式将发送到您的手机:{{ userStore.user?.mobile }}</div>
<div class="con_mode"> <div class="con_mode">
<div class="mode_tit">支付方式</div> <div class="mode_tit">支付方式</div>
<div class="mode_radio"> <div class="mode_radio">
......
...@@ -21,19 +21,17 @@ const handleCancel = () => { ...@@ -21,19 +21,17 @@ const handleCancel = () => {
<div> <div>
<el-dialog <el-dialog
:model-value="buyDialogVisible" :model-value="buyDialogVisible"
:width="!mobile ? '20%' : '70%'" :width="!mobile ? '25%' : '70%'"
:top="!mobile ? '16%' : '50%'" :top="!mobile ? '16%' : '50%'"
:modal="false" :modal="false"
:before-close="handleCancel" :before-close="handleCancel"
> >
<div class="buy_alert"> <div class="buy_alert">
<img <!-- <img src="https://webapp-pub.ezijing.com/project_online/fi/icon_contact.png" alt="" /> -->
src="https://webapp-pub.ezijing.com/project_online/fi/icon_contact.png"
alt=""
/>
<div class="alert_con"> <div class="alert_con">
<div class="con_tit">请联系我们</div> <div class="con_tit">上课方式</div>
<div class="con_desc">PAA秘书处:13263110169(同微信)</div> <img src="https://webapp-pub.ezijing.com/project_online/fi/contact_wx.png" class="con_img" />
<div class="con_desc">请联系小秘书:13263110169(同微信)</div>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
...@@ -60,6 +58,10 @@ const handleCancel = () => { ...@@ -60,6 +58,10 @@ const handleCancel = () => {
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
} }
.con_img {
width: 200px;
height: 200px;
}
.con_desc { .con_desc {
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
...@@ -93,6 +95,10 @@ const handleCancel = () => { ...@@ -93,6 +95,10 @@ const handleCancel = () => {
color: #333333; color: #333333;
margin-top: 0.25rem; margin-top: 0.25rem;
} }
.con_img {
width: 3rem;
height: 3rem;
}
.con_desc { .con_desc {
font-size: 0.24rem; font-size: 0.24rem;
font-weight: 400; font-weight: 400;
......
...@@ -16,15 +16,17 @@ const props = defineProps({ ...@@ -16,15 +16,17 @@ const props = defineProps({
const buyDialogVisible = ref(false) const buyDialogVisible = ref(false)
const handleBuyCourse = () => { const handleBuyCourse = () => {
console.log(props.payStatus, props.shopItem?.isBuy)
if (user.isLogin) { if (user.isLogin) {
if ((props.payStatus === '4' || props.shopItem?.isBuy === true) && props.shopItem?.type === '课程') { if (props.payStatus === '4' || props.shopItem?.isBuy === true) {
window.open('https://paa-learning.ezijing.com') // window.open('https://paa-learning.ezijing.com')
buyDialogVisible.value = true
} else { } else {
if (props.shopItem?.type === '课程包') { // if (props.shopItem?.type === '课程包') {
buyDialogVisible.value = true // buyDialogVisible.value = true
} else { // } else {
router.push(`/shop/pay/${props.shopItem?.id}`) router.push(`/shop/pay/${props.shopItem?.id}`)
} // }
} }
} else { } else {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.href)}` window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.href)}`
...@@ -33,13 +35,11 @@ const handleBuyCourse = () => { ...@@ -33,13 +35,11 @@ const handleBuyCourse = () => {
</script> </script>
<template> <template>
<div class="detail_footer" v-if="!mobile"> <div class="detail_footer" v-if="!mobile">
<div class="left_status" v-if="(payStatus === '4' || shopItem?.isBuy === true) && shopItem?.type === '课程'"> <div class="left_status" v-if="payStatus === '4' || shopItem?.isBuy === true">已购买</div>
已购买
</div>
<template v-else> <template v-else>
<div class="footer_left"> <div class="footer_left">
<div class="left_tit">总学费</div> <div class="left_tit">总学费</div>
<div class="left_desc">课程费用详情:{{ shopItem?.total_price_desc }}</div> <div class="left_desc">{{ shopItem?.total_price_desc }}</div>
</div> </div>
<div class="footer_price" v-if="!mobile"> <div class="footer_price" v-if="!mobile">
<div class="price_icon">¥</div> <div class="price_icon">¥</div>
...@@ -47,36 +47,38 @@ const handleBuyCourse = () => { ...@@ -47,36 +47,38 @@ const handleBuyCourse = () => {
</div> </div>
</template> </template>
<div class="footer_btn" @click="handleBuyCourse"> <div class="footer_btn" @click="handleBuyCourse">
{{ (payStatus === '4' || shopItem?.isBuy === true) && shopItem?.type === '课程' ? '立即学习' : '立即购买' }} {{ payStatus === '4' || shopItem?.isBuy === true ? '联系我们' : '立即购买' }}
</div> </div>
</div> </div>
<div class="detail_footer" v-else> <div class="detail_footer" v-else>
<div class="left_status" v-if="(payStatus === '4' || shopItem?.isBuy === true) && shopItem?.type === '课程'"> <div class="left_status" v-if="payStatus === '4' || shopItem?.isBuy === true">
已购买 已购买 <span class="status_price">¥{{ shopItem?.price }}</span>
</div> </div>
<template v-else> <template v-else>
<div class="footer_left" v-if="shopItem?.type === '课程包'"> <div class="footer_left" v-if="shopItem?.type === '课程包'">
<div class="left_tit">总学费</div> <div class="left_tit">
<div class="left_desc">课程费用详情:{{ shopItem?.total_price_desc }}</div> 总学费 <span class="tit_price">¥{{ shopItem?.price }}</span>
<!-- <div class="footer_price">
<div class="price_icon">¥</div>
<div class="price_price">{{ shopItem?.price }}</div>
</div> -->
</div>
<div class="left_desc">{{ shopItem?.total_price_desc }}</div>
</div> </div>
<div class="footer_left" v-else> <div class="footer_left" v-else>
<div class="left_tit">课程价格</div> <div class="left_tit">课程价格</div>
</div> </div>
</template> </template>
<div <div class="footer_btn" @click="handleBuyCourse" v-if="payStatus === '4' || shopItem?.isBuy === true">
class="footer_btn" <div class="btn_buy">联系我们</div>
@click="handleBuyCourse"
v-if="(payStatus === '4' || shopItem?.isBuy === true) && shopItem?.type === '课程'"
>
<div class="btn_buy">立即学习</div>
</div> </div>
<div class="footer_btn" @click="handleBuyCourse" v-else> <div class="footer_btn" @click="handleBuyCourse" v-else>
<div class="footer_price"> <!-- <div class="footer_price">
<div class="price_icon">¥</div> <div class="price_icon">¥</div>
<div class="price_price">{{ shopItem?.price }}</div> <div class="price_price">{{ shopItem?.price }}</div>
</div> </div> -->
<!-- <div class="btn_buy">立即购买</div> --> <div class="btn_buy">立即购买</div>
</div> </div>
</div> </div>
<ContactDialog v-model:buyDialogVisible="buyDialogVisible" /> <ContactDialog v-model:buyDialogVisible="buyDialogVisible" />
...@@ -161,11 +163,17 @@ const handleBuyCourse = () => { ...@@ -161,11 +163,17 @@ const handleBuyCourse = () => {
font-size: 0.24rem; font-size: 0.24rem;
font-weight: normal; font-weight: normal;
color: #666666; color: #666666;
.status_price {
color: #aa1941;
}
} }
.footer_left { .footer_left {
.left_tit { .left_tit {
font-size: 0.24rem; font-size: 0.24rem;
color: #333333; color: #333333;
.tit_price {
color: #aa1941;
}
} }
.left_desc { .left_desc {
font-size: 0.22rem; font-size: 0.22rem;
...@@ -185,7 +193,7 @@ const handleBuyCourse = () => { ...@@ -185,7 +193,7 @@ const handleBuyCourse = () => {
display: flex; display: flex;
justify-content: center; justify-content: center;
cursor: pointer; cursor: pointer;
padding: 0 0.56rem; padding: 0 0.16rem;
.footer_price { .footer_price {
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -201,6 +209,7 @@ const handleBuyCourse = () => { ...@@ -201,6 +209,7 @@ const handleBuyCourse = () => {
} }
} }
.btn_buy { .btn_buy {
width: 1.5rem;
font-size: 0.28rem; font-size: 0.28rem;
color: #ffffff; color: #ffffff;
cursor: pointer; cursor: pointer;
......
...@@ -21,14 +21,15 @@ const handleDatail = (item: any) => { ...@@ -21,14 +21,15 @@ const handleDatail = (item: any) => {
} }
const handleBuy = (courseItem: any) => { const handleBuy = (courseItem: any) => {
if (user.isLogin) { if (user.isLogin) {
if (courseItem?.isBuy === true && courseItem?.type === '课程') { if (courseItem?.isBuy === true) {
window.open('https://paa-learning.ezijing.com') buyDialogVisible.value = true
// window.open('https://paa-learning.ezijing.com')
} else { } else {
if (courseItem.type === '课程包') { // if (courseItem.type === '课程包') {
buyDialogVisible.value = true // buyDialogVisible.value = true
} else { // } else {
router.push(`/shop/pay/${courseItem.id}`) router.push(`/shop/pay/${courseItem.id}`)
} // }
} }
} else { } else {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.href)}` window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.href)}`
...@@ -64,7 +65,7 @@ const handleBuy = (courseItem: any) => { ...@@ -64,7 +65,7 @@ const handleBuy = (courseItem: any) => {
<div class="bottom_btn"> <div class="bottom_btn">
<div class="btn_detail" v-if="!mobile" @click="handleDatail(courseItem?.id)">查看详情</div> <div class="btn_detail" v-if="!mobile" @click="handleDatail(courseItem?.id)">查看详情</div>
<div class="btn_buy" @click="handleBuy(courseItem)"> <div class="btn_buy" @click="handleBuy(courseItem)">
{{ courseItem?.isBuy === true && courseItem?.type === '课程' ? '立即学习' : '立即购买' }} {{ courseItem?.isBuy === true ? '联系我们' : '立即购买' }}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -32,14 +32,15 @@ const shareTit = computed(() => { ...@@ -32,14 +32,15 @@ const shareTit = computed(() => {
// 购买课程 // 购买课程
const handleBuyCourse = () => { const handleBuyCourse = () => {
if (user.isLogin) { if (user.isLogin) {
if ((props.payStatus === '4' || props.shopItem?.isBuy === true) && props.shopItem?.type === '课程') { if (props.payStatus === '4' || props.shopItem?.isBuy === true) {
window.open('https://paa-learning.ezijing.com') // window.open('https://paa-learning.ezijing.com')
buyDialogVisible.value = true
} else { } else {
if (props.shopItem?.type === '课程包') { // if (props.shopItem?.type === '课程包') {
buyDialogVisible.value = true // buyDialogVisible.value = true
} else { // } else {
router.push(`/shop/pay/${props.shopItem?.id}`) router.push(`/shop/pay/${props.shopItem?.id}`)
} // }
} }
} else { } else {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.href)}` window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.href)}`
...@@ -99,6 +100,7 @@ const handleCopyLink = () => { ...@@ -99,6 +100,7 @@ const handleCopyLink = () => {
<div class="detail_banner"> <div class="detail_banner">
<div class="banner_con"> <div class="banner_con">
<img class="con_img" :src="shopItem?.image_url" /> <img class="con_img" :src="shopItem?.image_url" />
<template v-if="!mobile"> <template v-if="!mobile">
<div class="con_info"> <div class="con_info">
<div class="info_tit">{{ shopItem?.title }}</div> <div class="info_tit">{{ shopItem?.title }}</div>
...@@ -119,9 +121,7 @@ const handleCopyLink = () => { ...@@ -119,9 +121,7 @@ const handleCopyLink = () => {
</div> </div>
<div class="detail_buy"> <div class="detail_buy">
<div class="buy_left"> <div class="buy_left">
<div class="left_status" v-if="(payStatus === '4' || shopItem?.isBuy === true) && shopItem?.type === '课程'"> <div class="left_status" v-if="payStatus === '4' || shopItem?.isBuy === true">已购买</div>
已购买
</div>
<div class="left_price" v-else> <div class="left_price" v-else>
<div class="price_icon">¥</div> <div class="price_icon">¥</div>
<div class="price_num">{{ shopItem?.price }}</div> <div class="price_num">{{ shopItem?.price }}</div>
...@@ -132,7 +132,7 @@ const handleCopyLink = () => { ...@@ -132,7 +132,7 @@ const handleCopyLink = () => {
</div> </div>
</div> </div>
<div class="buy_right" @click="handleBuyCourse" v-if="!mobile"> <div class="buy_right" @click="handleBuyCourse" v-if="!mobile">
{{ (payStatus === '4' || shopItem?.isBuy === true) && shopItem?.type === '课程' ? '立即学习' : '立即购买' }} {{ payStatus === '4' || shopItem?.isBuy === true ? '联系我们' : '立即购买' }}
</div> </div>
</div> </div>
<div class="detail_info" v-if="mobile"> <div class="detail_info" v-if="mobile">
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
import CourseList from '../components/CourseList.vue' import CourseList from '../components/CourseList.vue'
import { useShopStore } from '@/stores/shop' import { useShopStore } from '@/stores/shop'
import { useDevice } from '@/composables/useDevice' import { useDevice } from '@/composables/useDevice'
import useWXShare from '@/utils/wx'
const { mobile } = useDevice() const { mobile } = useDevice()
const shopStore = useShopStore() const shopStore = useShopStore()
const handleTabClick = (tab: any) => { const handleTabClick = (tab: any) => {
...@@ -10,6 +12,9 @@ const handleTabClick = (tab: any) => { ...@@ -10,6 +12,9 @@ const handleTabClick = (tab: any) => {
window.location.reload() window.location.reload()
} }
} }
onMounted(() => {
useWXShare()
})
</script> </script>
<template> <template>
......
...@@ -10,6 +10,8 @@ import RecommendCourse from '../components/RecommendCourse.vue' ...@@ -10,6 +10,8 @@ import RecommendCourse from '../components/RecommendCourse.vue'
import CourseFooter from '../components/CourseFooter.vue' import CourseFooter from '../components/CourseFooter.vue'
import { useShopStore } from '@/stores/shop' import { useShopStore } from '@/stores/shop'
import { useDevice } from '@/composables/useDevice' import { useDevice } from '@/composables/useDevice'
import useWXShare from '@/utils/wx'
const { mobile } = useDevice() const { mobile } = useDevice()
const shopStore = useShopStore() const shopStore = useShopStore()
const route = useRoute() const route = useRoute()
...@@ -27,6 +29,9 @@ const recommendCourse = computed(() => { ...@@ -27,6 +29,9 @@ const recommendCourse = computed(() => {
return shopStore.shopRelatedListOther return shopStore.shopRelatedListOther
} }
}) })
onMounted(() => {
useWXShare()
})
</script> </script>
<template> <template>
......
import httpRequest from './axios'
export default function useWXShare(data) {
const shareData = Object.assign(
{
title: '清控紫荆金保',
desc: '教育、科技、人才!努力建设成为国际卓越的金融保险平台',
link: location.href,
imgUrl: 'https://webapp-pub.ezijing.com/project_online/fi/logo.png'
},
data
)
const updateShareData = () => {
wx.updateAppMessageShareData({
title: shareData.title,
desc: shareData.desc,
link: shareData.link,
imgUrl: shareData.imgUrl
})
wx.updateTimelineShareData({
title: shareData.title,
link: shareData.link,
imgUrl: shareData.imgUrl
})
}
httpRequest
.post(
'https://node-server.ezijing.com/share/getsignature',
{
appId: 'wxfe67f37095e08d2f',
url: location.href.split('#').pop()
},
{
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}
)
.then(result => {
wx.config({
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: 'wxfe67f37095e08d2f', // 必填,公众号的唯一标识
timestamp: result.timestamp, // 必填,生成签名的时间戳
nonceStr: result.noncestr, // 必填,生成签名的随机串
signature: result.token, // 必填,签名
jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData'] // 必填,需要使用的JS接口列表
})
wx.ready(updateShareData)
})
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论