Browse Source

ios 语音问题

master
kami 2 years ago
parent
commit
5bc9ce0118
  1. 7
      src/main.js
  2. 2
      src/store/wx.js
  3. 169
      src/views/Home.vue
  4. 1101
      src/views/mail/components/Write.vue
  5. 13
      vite.config.js

7
src/main.js

@ -2,6 +2,7 @@ import { createApp } from 'vue'
import router from './router/index'
import { createPinia } from 'pinia'
import App from './App.vue'
import { Button, Tab, Tabs, Form, Field, CellGroup, Cell, RadioGroup, Radio, Uploader, Icon, Popup, Loading, Overlay, Empty, List, Picker } from 'vant';
import IconComponent from '@/components/Icon.vue'
@ -13,6 +14,10 @@ import 'vant/lib/index.css';
import './assets/style/style.scss'
import './assets/style/vant.scss'
// import VConsole from 'vconsole';
//
// const vConsole = new VConsole();
const app = createApp(App)
.use(router)
.use(createPinia())
@ -35,4 +40,4 @@ const app = createApp(App)
.use(Picker)
.component('Icon', IconComponent)
.component('Loading', LoadingComponent);
app.mount('#app')
app.mount('#app')

2
src/store/wx.js

@ -11,7 +11,7 @@ const WxStore = defineStore(
initSign() {
const _this = this;
return new Promise((resolve, reject) => {
const url = window.location.href.split("?")[0];
const url = window.location.href;
wxSign(url).then((data) => {
wx.config({
// debug: true, // 开启调试模式

169
src/views/Home.vue

@ -1,46 +1,47 @@
<template>
<div class="wrapper">
<header>
<img src="/imgs/bg1.png" alt="" />
</header>
<main>
<div class="flex gap-10 center mt-20">
<a
class="flex v-center center gap-16"
@click="router.push('/realName/auth')"
>
<div style="width: 48px">
<img src="/imgs/write.png" alt="" />
</div>
<span>我要写信</span>
</a>
<a
class="flex v-center center gap-16"
@click="router.push('/mail?active=my')"
>
<div style="width: 48px">
<img src="/imgs/search.png" alt="" />
</div>
<span>回复查询</span>
</a>
</div>
<p class="text-center mt-20">
局长信箱只接受实名举报投诉不受理报警业务
</p>
<p class="text-center">如遇紧急情况请拨打110</p>
</main>
</div>
<Loading :loading="loading" />
<div class="wrapper">
<header>
<img src="/imgs/bg1.png" alt=""/>
</header>
<main>
<div class="flex gap-10 center mt-20">
<a
class="flex v-center center gap-16"
@click="router.push('/realName/auth')"
>
<div style="width: 48px">
<img src="/imgs/write.png" alt=""/>
</div>
<span>我要写信</span>
</a>
<a
class="flex v-center center gap-16"
@click="router.push('/mail?active=my')"
>
<div style="width: 48px">
<img src="/imgs/search.png" alt=""/>
</div>
<span>回复查询</span>
</a>
</div>
<p class="text-center mt-20">
局长信箱只接受实名举报投诉不受理报警业务
</p>
<p class="text-center">如遇紧急情况请拨打110</p>
</main>
</div>
<Loading :loading="loading"/>
</template>
<script setup>
import { useRoute, useRouter } from "vue-router";
import { auth, authOpenid } from "@/api/auth";
import {useRoute, useRouter} from "vue-router";
import {auth, authOpenid} from "@/api/auth";
import UserStore from "@/store/user";
import { setToken, getToken } from "@/util/cookie";
import {setToken, getToken} from "@/util/cookie";
import WxStore from "@/store/wx";
const wxStore = WxStore();
const router = useRouter();
@ -51,58 +52,60 @@ const code = route.query.code;
const loading = ref(true)
if (!getToken()) {
if (code) {
//
auth(code).then((data) => {
setToken(data.token);
userStore.user = data.user;
loading.value = false
wxStore.initSign()
});
} else if (route.query.openid) {
//
authOpenid(route.query.openid).then((data) => {
setToken(data.token);
userStore.user = data.user;
loading.value = false
wxStore.initSign()
});
} else {
const appid = "wx795f76e4bc3b0062";
// const location = window.location.href
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(
"https://mailbox.biutag.com/"
)}&response_type=code&scope=snsapi_base&state=#wechat_redirect`;
// window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent('https://mailbox.biutag.com/#/code?abc')}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
// https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx795f76e4bc3b0062&redirect_uri=https%3A%2F%2Fmailbox.biutag.com%2F&response_type=code&scope=snsapi_base&state=123#wechat_redirect'
}
if (code) {
//
auth(code).then((data) => {
setToken(data.token);
userStore.user = data.user;
loading.value = false
window.location.href = "https://mailbox.biutag.com/"
// wxStore.initSign()
});
} else if (route.query.openid) {
//
authOpenid(route.query.openid).then((data) => {
setToken(data.token);
userStore.user = data.user;
loading.value = false
window.location.href = "https://mailbox.biutag.com/"
// wxStore.initSign()
});
} else {
const appid = "wx795f76e4bc3b0062";
// const location = window.location.href
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(
"https://mailbox.biutag.com/"
)}&response_type=code&scope=snsapi_base&state=#wechat_redirect`;
// window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent('https://mailbox.biutag.com/#/code?abc')}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
// https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx795f76e4bc3b0062&redirect_uri=https%3A%2F%2Fmailbox.biutag.com%2F&response_type=code&scope=snsapi_base&state=123#wechat_redirect'
}
} else {
loading.value = false
wxStore.initSign()
loading.value = false
wxStore.initSign()
}
</script>
<style lang="scss" scoped>
.wrapper {
background-color: #fff;
background-color: #fff;
}
header {
img {
width: 100%;
}
img {
width: 100%;
}
}
a {
width: 45.2%;
height: 84px;
text-decoration: none;
border: 1px solid var(--primary-color);
color: var(--primary-color);
font-weight: bold;
font-size: 18px;
&:hover {
cursor: pointer;
}
width: 45.2%;
height: 84px;
text-decoration: none;
border: 1px solid var(--primary-color);
color: var(--primary-color);
font-weight: bold;
font-size: 18px;
&:hover {
cursor: pointer;
}
}
</style>
</style>

1101
src/views/mail/components/Write.vue

File diff suppressed because it is too large Load Diff

13
vite.config.js

@ -38,5 +38,18 @@ export default defineConfig({
rewrite: (p) => p.replace(/^\/api/, '')
}
}
},
build: {
rollupOptions: {
output: {
entryFileNames: `assets/[name].${new Date().getTime()}.js`,
chunkFileNames: `assets/[name].${new Date().getTime()}.js`,
assetFileNames: `assets/[name].${new Date().getTime()}.[ext]`,
compact: true,
manualChunks: {
vue: ['vue']
},
}
}
}
})

Loading…
Cancel
Save