|
@@ -1,5 +1,5 @@
|
|
import { defineComponent, onMounted, reactive, ref, nextTick } from 'vue'
|
|
import { defineComponent, onMounted, reactive, ref, nextTick } from 'vue'
|
|
-import { Image, showDialog, Sticky, Tab, Tabs } from 'vant'
|
|
|
|
|
|
+import { Image, Popup, showDialog, Sticky, Tab, Tabs } from 'vant'
|
|
import styles from './index.module.less'
|
|
import styles from './index.module.less'
|
|
// import { useRect } from '@vant/use'
|
|
// import { useRect } from '@vant/use'
|
|
import Apply from './component/apply'
|
|
import Apply from './component/apply'
|
|
@@ -9,6 +9,7 @@ import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
|
import { setLogout } from '@/state'
|
|
import { setLogout } from '@/state'
|
|
import request from '@/helpers/request'
|
|
import request from '@/helpers/request'
|
|
|
|
+import { browser, getUrlCode } from '@/helpers/utils'
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: 'pre-apply',
|
|
name: 'pre-apply',
|
|
@@ -22,6 +23,8 @@ export default defineComponent({
|
|
registerInfo: {} as any,
|
|
registerInfo: {} as any,
|
|
purchase: false, // 购买状态
|
|
purchase: false, // 购买状态
|
|
register: true // 是否注册
|
|
register: true // 是否注册
|
|
|
|
+ // showPopup: false,
|
|
|
|
+ // code: '' as any
|
|
})
|
|
})
|
|
|
|
|
|
const onNext = async (name: string) => {
|
|
const onNext = async (name: string) => {
|
|
@@ -120,12 +123,46 @@ export default defineComponent({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // const getAppIdAndCode = async () => {
|
|
|
|
+ // try {
|
|
|
|
+ // const { data } = await request.get('/api-student/open/paramConfig/wechatAppId')
|
|
|
|
+ // // 判断是否有微信appId
|
|
|
|
+ // if (data) {
|
|
|
|
+ // goAuth(data)
|
|
|
|
+ // }
|
|
|
|
+ // } catch {
|
|
|
|
+ // //
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // const goAuth = (wxAppId: string) => {
|
|
|
|
+ // // 用户授权
|
|
|
|
+ // const urlNow = encodeURIComponent(window.location.href)
|
|
|
|
+ // const scope = 'snsapi_base' //snsapi_userinfo //静默授权 用户无感知
|
|
|
|
+ // const appid = wxAppId || 'wx8654c671631cfade'
|
|
|
|
+ // const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${urlNow}&response_type=code&scope=${scope}&state=STATE&connect_redirect=1#wechat_redirect`
|
|
|
|
+ // window.location.replace(url)
|
|
|
|
+ // }
|
|
|
|
+
|
|
// 先请求接口
|
|
// 先请求接口
|
|
getRegisterStatus()
|
|
getRegisterStatus()
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
|
+ // state.code = route.query.code || ''
|
|
// const { height } = useRect(bannerRef.value)
|
|
// const { height } = useRect(bannerRef.value)
|
|
// state.heightV = height
|
|
// state.heightV = height
|
|
|
|
+ // 判断是否是微信,只能微信中打开
|
|
|
|
+ // if (browser().weixin) {
|
|
|
|
+ // // 微信公众号支付
|
|
|
|
+ // //授权
|
|
|
|
+ // const code = getUrlCode()
|
|
|
|
+ // if (!code || !state.code) {
|
|
|
|
+ // getAppIdAndCode()
|
|
|
|
+ // } else {
|
|
|
|
+ // state.code = code
|
|
|
|
+ // }
|
|
|
|
+ // } else {
|
|
|
|
+ // state.showPopup = true
|
|
|
|
+ // }
|
|
})
|
|
})
|
|
return () => (
|
|
return () => (
|
|
<div class={styles.preApply}>
|
|
<div class={styles.preApply}>
|
|
@@ -157,6 +194,22 @@ export default defineComponent({
|
|
)}
|
|
)}
|
|
{state.tabValue === 'payment' && <Payment onNext={onNext} />}
|
|
{state.tabValue === 'payment' && <Payment onNext={onNext} />}
|
|
{state.tabValue === 'order' && <Order onNext={onNext} />}
|
|
{state.tabValue === 'order' && <Order onNext={onNext} />}
|
|
|
|
+
|
|
|
|
+ {/* <Popup
|
|
|
|
+ v-model:show={state.showPopup}
|
|
|
|
+ round
|
|
|
|
+ style={{ width: '92%' }}
|
|
|
|
+ closeOnClickOverlay={false}
|
|
|
|
+ >
|
|
|
|
+ <div class={styles.popupContainer}>
|
|
|
|
+ <div class={styles.dialogTitle}>
|
|
|
|
+ <i></i>
|
|
|
|
+ 提示
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <p class={styles.popupTips}>请使用微信打开</p>
|
|
|
|
+ </div>
|
|
|
|
+ </Popup> */}
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
}
|
|
}
|