|
@@ -15,10 +15,10 @@
|
|
|
</template>
|
|
|
<van-tabs class="test-type" animated>
|
|
|
<van-tab :title="sujectItem.name" v-for="(sujectItem, index) in carTypeItem.sujectList" :key="index" :name="sujectItem.name">
|
|
|
- <component v-if="index == 0" :is="sujectOne" :query="{ ...carTypeItem.query, ...sujectItem.query, title: '模拟考试' }"></component>
|
|
|
- <sujectTwo v-if="index == 1" :is="sujectTwo" :query="{ ...carTypeItem.query, ...sujectItem.query, title: '模拟考试' }"></sujectTwo>
|
|
|
- <sujectThree v-if="index == 2" :is="sujectThree" :query="{ ...carTypeItem.query, ...sujectItem.query, title: '模拟考试' }"></sujectThree>
|
|
|
- <component v-if="index == 3" :is="sujectOne" :query="{ ...carTypeItem.query, ...sujectItem.query, title: '模拟考试' }"></component>
|
|
|
+ <sujectOne v-if="index == 0" :query="{ ...carTypeItem.query, ...sujectItem.query, title: '模拟考试' }"></sujectOne>
|
|
|
+ <sujectTwo v-if="index == 1" ></sujectTwo>
|
|
|
+ <sujectThree v-if="index == 2" :query="{ ...carTypeItem.query, ...sujectItem.query, title: '模拟考试' }"></sujectThree>
|
|
|
+ <sujectOne v-if="index == 3" :query="{ ...carTypeItem.query, ...sujectItem.query, title: '模拟考试' }"></sujectOne>
|
|
|
</van-tab>
|
|
|
</van-tabs>
|
|
|
</van-tab>
|
|
@@ -34,37 +34,36 @@ import swiper from "./components/swiper.vue";
|
|
|
import { ref, nextTick, onBeforeMount } from "vue";
|
|
|
import { useLogin, useUpdateUserInfo } from "@/hooks";
|
|
|
import { useStore } from "vuex";
|
|
|
-import useWxSign from '@/hooks/wx/sign'
|
|
|
+import useWxSign from "@/hooks/wx/sign";
|
|
|
import { Toast } from "vant";
|
|
|
import { useRouter } from "vue-router";
|
|
|
import { openApi } from "@/api/index";
|
|
|
import wx from "weixin-js-sdk-ts";
|
|
|
const store = useStore();
|
|
|
const carTypeRef = ref<any>(null);
|
|
|
-const { createWxConfig } = useWxSign()
|
|
|
- openApi
|
|
|
- .jspapi({
|
|
|
- url: window.location.href,
|
|
|
-
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- // let wxConfig = {
|
|
|
- // debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
|
|
|
- // appId: res.data.data.appId as string, // 必填,公众号的唯一标识
|
|
|
- // timestamp: res.data.data.timestamp as number, // 必填,生成签名的时间戳
|
|
|
- // nonceStr: res.data.data.nonceStr as string, // 必填,生成签名的随机串
|
|
|
- // signature: res.data.data.signature as string, // 必填,签名
|
|
|
- // jsApiList: ["previewImage"], // 必填,需要使用的JS接口列表
|
|
|
- // openTagList: ["wx-open-launch-weapp"], // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
|
|
|
- // };
|
|
|
- wx.config({
|
|
|
- debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
|
|
|
- appId: res.data.data.appId as string, // 必填,公众号的唯一标识
|
|
|
- ...createWxConfig(res.data.data.ticket as string),
|
|
|
- jsApiList: ["previewImage"], // 必填,需要使用的JS接口列表
|
|
|
- openTagList: ["wx-open-launch-weapp"], // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
|
|
|
- });
|
|
|
- });
|
|
|
+const { createWxConfig } = useWxSign();
|
|
|
+openApi
|
|
|
+ .jspapi({
|
|
|
+ url: '',
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ // let wxConfig = {
|
|
|
+ // debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
|
|
|
+ // appId: res.data.data.appId as string, // 必填,公众号的唯一标识
|
|
|
+ // timestamp: res.data.data.timestamp as number, // 必填,生成签名的时间戳
|
|
|
+ // nonceStr: res.data.data.nonceStr as string, // 必填,生成签名的随机串
|
|
|
+ // signature: res.data.data.signature as string, // 必填,签名
|
|
|
+ // jsApiList: ["previewImage"], // 必填,需要使用的JS接口列表
|
|
|
+ // openTagList: ["wx-open-launch-weapp"], // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
|
|
|
+ // };
|
|
|
+ wx.config({
|
|
|
+ debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
|
|
|
+ appId: res.data.data.appId as string, // 必填,公众号的唯一标识
|
|
|
+ ...createWxConfig(res.data.data.ticket as string),
|
|
|
+ jsApiList: ["previewImage"], // 必填,需要使用的JS接口列表
|
|
|
+ openTagList: ["wx-open-launch-weapp"], // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
|
|
|
+ });
|
|
|
+ });
|
|
|
//打印环境变量
|
|
|
console.log(import.meta.env.MODE, "环境变量");
|
|
|
nextTick(() => {
|