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

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

上级 58ae9e8c
......@@ -24,9 +24,9 @@ export default [
course_hour: '8课时',
course_id: '7000656984332566528',
class_id: '6998519782265847808',
total_price_desc: '(课程费用:4300元/人,考试费、认证费、教材费合计680元/人)',
sku_id: '',
spu_id: ''
total_price_desc: '(课程费用4300元/人,考试费/认证费/教材费合计680元/人)',
sku_id: '7014129405609902080',
spu_id: '7014129404863315968'
},
{
category: 'PAAP(Ⅰ)',
......
......@@ -24,9 +24,9 @@ export default [
course_hour: '8课时',
course_id: '6998547457529348096',
class_id: '6998519782265847808',
total_price_desc: '(课程费用:7000元/人,考试费、认证费、教材费合计680元/人)',
sku_id: '',
spu_id: ''
total_price_desc: '(课程费用7000元/人,考试费/认证费/教材费合计680元/人)',
sku_id: '7014130347952570368',
spu_id: '7014130347390533632'
},
{
category: 'PAAP(Ⅱ)',
......
......@@ -24,9 +24,9 @@ export default [
course_hour: '8课时',
course_id: '6998547457529348096',
class_id: '6998519782265847808',
total_price_desc: '(课程费:12000元/人,考试费、认证费、教材费合计980元/人)',
sku_id: '',
spu_id: ''
total_price_desc: '(课程费用12000元/人,考试费/认证费/教材费合计980元/人)',
sku_id: '7014130543629434880',
spu_id: '7014130542861877248'
},
{
category: 'PAAM',
......
......@@ -6,16 +6,19 @@
<meta name="theme-color" content="#3276fc" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
<title>清控紫荆金保|PAA</title>
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"
/>
<title>清控紫荆金保PAA</title>
<script src="https://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script type="module">
;(async () => {
window.SHOP = await import('https://webapp-pub.ezijing.com/project_online/paa/shop.js')
window.SHOP = await import('https://webapp-pub.ezijing.com/project_online/fi/shop.js')
})()
</script>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
</body>
</html>
......@@ -16,6 +16,7 @@ import AppCard from '@/components/base/AppCard.vue'
import AppContainer from '@/components/base/AppContainer.vue'
import modules from './modules'
import useWXShare from '@/utils/wx'
const app = createApp(App)
// 注册公共组件
......@@ -33,3 +34,4 @@ app.use(router)
app.use(ElementPlus)
app.mount('#app')
useWXShare()
......@@ -5,6 +5,10 @@ import ProjectSystem from '../components/ProjectSystem.vue'
import Course from '../components/Course.vue'
import ExamProcess from '../components/ExamProcess.vue'
import Teacher from '../components/Teacher.vue'
import useWXShare from '@/utils/wx'
onMounted(() => {
useWXShare()
})
</script>
<template>
......
......@@ -74,7 +74,7 @@ const checkedChange = (val: string) => {
</div>
<div class="pay_con">
<div class="pay_phone">
课程提醒将发送到您的手机:<i style="font-weight: bold">{{ userStore.user?.mobile }}</i>
小提示:上课方式将发送到您的手机:<i style="font-weight: bold">{{ userStore.user?.mobile }}</i>
</div>
<div class="pay_line"></div>
<div class="pay_mode">
......
......@@ -61,7 +61,7 @@ const handleAgree = (val: any) => {
</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="mode_tit">支付方式</div>
<div class="mode_radio">
......
......@@ -21,19 +21,17 @@ const handleCancel = () => {
<div>
<el-dialog
:model-value="buyDialogVisible"
:width="!mobile ? '20%' : '70%'"
:width="!mobile ? '25%' : '70%'"
:top="!mobile ? '16%' : '50%'"
:modal="false"
:before-close="handleCancel"
>
<div class="buy_alert">
<img
src="https://webapp-pub.ezijing.com/project_online/fi/icon_contact.png"
alt=""
/>
<!-- <img src="https://webapp-pub.ezijing.com/project_online/fi/icon_contact.png" alt="" /> -->
<div class="alert_con">
<div class="con_tit">请联系我们</div>
<div class="con_desc">PAA秘书处:13263110169(同微信)</div>
<div class="con_tit">上课方式</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>
</el-dialog>
......@@ -60,6 +58,10 @@ const handleCancel = () => {
font-weight: 400;
color: #333333;
}
.con_img {
width: 200px;
height: 200px;
}
.con_desc {
font-size: 14px;
font-weight: 400;
......@@ -93,6 +95,10 @@ const handleCancel = () => {
color: #333333;
margin-top: 0.25rem;
}
.con_img {
width: 3rem;
height: 3rem;
}
.con_desc {
font-size: 0.24rem;
font-weight: 400;
......
......@@ -16,15 +16,17 @@ const props = defineProps({
const buyDialogVisible = ref(false)
const handleBuyCourse = () => {
console.log(props.payStatus, props.shopItem?.isBuy)
if (user.isLogin) {
if ((props.payStatus === '4' || props.shopItem?.isBuy === true) && props.shopItem?.type === '课程') {
window.open('https://paa-learning.ezijing.com')
if (props.payStatus === '4' || props.shopItem?.isBuy === true) {
// window.open('https://paa-learning.ezijing.com')
buyDialogVisible.value = true
} else {
if (props.shopItem?.type === '课程包') {
buyDialogVisible.value = true
} else {
router.push(`/shop/pay/${props.shopItem?.id}`)
}
// if (props.shopItem?.type === '课程包') {
// buyDialogVisible.value = true
// } else {
router.push(`/shop/pay/${props.shopItem?.id}`)
// }
}
} else {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.href)}`
......@@ -33,56 +35,54 @@ const handleBuyCourse = () => {
</script>
<template>
<div class="detail_footer" v-if="!mobile">
<div class="left_status" v-if="(payStatus === '4' || shopItem?.isBuy === true) && shopItem?.type === '课程'">
已购买
</div>
<div class="left_status" v-if="payStatus === '4' || shopItem?.isBuy === true">已购买</div>
<template v-else>
<div class="footer_left">
<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 class="footer_price" v-if="!mobile">
<div class="price_icon">¥</div>
<div class="price_price">{{ shopItem?.price }}</div>
</div>
</template>
<div class="footer_btn" @click="handleBuyCourse">
{{ (payStatus === '4' || shopItem?.isBuy === true) && shopItem?.type === '课程' ? '立即学习' : '立即购买' }}
{{ payStatus === '4' || shopItem?.isBuy === true ? '联系我们' : '立即购买' }}
</div>
</div>
<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>
<template v-else>
<div class="footer_left" v-if="shopItem?.type === '课程包'">
<div class="left_tit">总学费</div>
<div class="left_desc">课程费用详情:{{ shopItem?.total_price_desc }}</div>
<div class="left_tit">
总学费 <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 class="footer_left" v-else>
<div class="left_tit">课程价格</div>
</div>
</template>
<div
class="footer_btn"
@click="handleBuyCourse"
v-if="(payStatus === '4' || shopItem?.isBuy === true) && shopItem?.type === '课程'"
>
<div class="btn_buy">立即学习</div>
<div class="footer_btn" @click="handleBuyCourse" v-if="payStatus === '4' || shopItem?.isBuy === true">
<div class="btn_buy">联系我们</div>
</div>
<div class="footer_btn" @click="handleBuyCourse" v-else>
<div class="footer_price">
<!-- <div class="footer_price">
<div class="price_icon">¥</div>
<div class="price_price">{{ shopItem?.price }}</div>
</div>
<!-- <div class="btn_buy">立即购买</div> -->
</div> -->
<div class="btn_buy">立即购买</div>
</div>
</div>
<ContactDialog v-model:buyDialogVisible="buyDialogVisible" />
</template>
<style lang="scss" scoped>
.is-pc {
.detail_footer {
......@@ -163,16 +163,21 @@ const handleBuyCourse = () => {
font-size: 0.24rem;
font-weight: normal;
color: #666666;
.status_price {
color: #aa1941;
}
}
.footer_left {
.left_tit {
font-size: 0.24rem;
color: #333333;
.tit_price {
color: #aa1941;
}
}
.left_desc {
font-size: 0.18rem;
font-size: 0.22rem;
color: #999999;
// width: 3rem;
}
.footer_price {
display: none;
......@@ -188,7 +193,7 @@ const handleBuyCourse = () => {
display: flex;
justify-content: center;
cursor: pointer;
padding: 0 0.56rem;
padding: 0 0.16rem;
.footer_price {
display: flex;
justify-content: center;
......@@ -204,6 +209,7 @@ const handleBuyCourse = () => {
}
}
.btn_buy {
width: 1.5rem;
font-size: 0.28rem;
color: #ffffff;
cursor: pointer;
......
......@@ -22,13 +22,14 @@ const handleDatail = (item: any) => {
const handleBuy = (courseItem: any) => {
if (user.isLogin) {
if (courseItem?.isBuy === true && courseItem?.type === '课程') {
window.open('https://paa-learning.ezijing.com')
// window.open('https://paa-learning.ezijing.com')
buyDialogVisible.value = true
} else {
if (courseItem.type === '课程包') {
buyDialogVisible.value = true
} else {
router.push(`/shop/pay/${courseItem.id}`)
}
// if (courseItem.type === '课程包') {
// buyDialogVisible.value = true
// } else {
router.push(`/shop/pay/${courseItem.id}`)
// }
}
} else {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.href)}`
......@@ -64,8 +65,9 @@ const handleBuy = (courseItem: any) => {
<div class="bottom_btn">
<div class="btn_detail" v-if="!mobile" @click="handleDatail(courseItem?.id)">查看详情</div>
<div class="btn_buy" @click="handleBuy(courseItem)">
{{ courseItem?.isBuy === true && courseItem?.type === '课程' ? '立即学习' : '立即购买' }}
{{ courseItem?.isBuy === true ? '联系我们' : '立即购买' }}
</div>
{{ courseItem?.isBuy }}
</div>
</div>
</div>
......
......@@ -33,13 +33,14 @@ const shareTit = computed(() => {
const handleBuyCourse = () => {
if (user.isLogin) {
if ((props.payStatus === '4' || props.shopItem?.isBuy === true) && props.shopItem?.type === '课程') {
window.open('https://paa-learning.ezijing.com')
// window.open('https://paa-learning.ezijing.com')
buyDialogVisible.value = true
} else {
if (props.shopItem?.type === '课程包') {
buyDialogVisible.value = true
} else {
router.push(`/shop/pay/${props.shopItem?.id}`)
}
// if (props.shopItem?.type === '课程包') {
// buyDialogVisible.value = true
// } else {
router.push(`/shop/pay/${props.shopItem?.id}`)
// }
}
} else {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.href)}`
......@@ -119,9 +120,7 @@ const handleCopyLink = () => {
</div>
<div class="detail_buy">
<div class="buy_left">
<div class="left_status" v-if="(payStatus === '4' || shopItem?.isBuy === true) && shopItem?.type === '课程'">
已购买
</div>
<div class="left_status" v-if="payStatus === '4' || shopItem?.isBuy === true">已购买</div>
<div class="left_price" v-else>
<div class="price_icon">¥</div>
<div class="price_num">{{ shopItem?.price }}</div>
......@@ -132,7 +131,7 @@ const handleCopyLink = () => {
</div>
</div>
<div class="buy_right" @click="handleBuyCourse" v-if="!mobile">
{{ (payStatus === '4' || shopItem?.isBuy === true) && shopItem?.type === '课程' ? '立即学习' : '立即购买' }}
{{ (payStatus === '4' || shopItem?.isBuy === true) && shopItem?.type === '课程' ? '联系我们' : '立即购买' }}
</div>
</div>
<div class="detail_info" v-if="mobile">
......
......@@ -2,6 +2,8 @@
import CourseList from '../components/CourseList.vue'
import { useShopStore } from '@/stores/shop'
import { useDevice } from '@/composables/useDevice'
import useWXShare from '@/utils/wx'
const { mobile } = useDevice()
const shopStore = useShopStore()
const handleTabClick = (tab: any) => {
......@@ -10,6 +12,9 @@ const handleTabClick = (tab: any) => {
window.location.reload()
}
}
onMounted(() => {
useWXShare()
})
</script>
<template>
......
......@@ -10,6 +10,7 @@ import RecommendCourse from '../components/RecommendCourse.vue'
import CourseFooter from '../components/CourseFooter.vue'
import { useShopStore } from '@/stores/shop'
import { useDevice } from '@/composables/useDevice'
import useWXShare from '@/utils/wx'
const { mobile } = useDevice()
const shopStore = useShopStore()
const route = useRoute()
......@@ -27,6 +28,9 @@ const recommendCourse = computed(() => {
return shopStore.shopRelatedListOther
}
})
onMounted(() => {
useWXShare()
})
</script>
<template>
......
import httpRequest from './axios'
export default function useWXShare(data) {
const shareData = Object.assign(
{
title: '清控紫荆金保PAA',
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论