Browse Source

ios 语音问题

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

5
src/main.js

@ -2,6 +2,7 @@ import { createApp } from 'vue'
import router from './router/index' import router from './router/index'
import { createPinia } from 'pinia' import { createPinia } from 'pinia'
import App from './App.vue' 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 { 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' import IconComponent from '@/components/Icon.vue'
@ -13,6 +14,10 @@ import 'vant/lib/index.css';
import './assets/style/style.scss' import './assets/style/style.scss'
import './assets/style/vant.scss' import './assets/style/vant.scss'
// import VConsole from 'vconsole';
//
// const vConsole = new VConsole();
const app = createApp(App) const app = createApp(App)
.use(router) .use(router)
.use(createPinia()) .use(createPinia())

2
src/store/wx.js

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

161
src/views/Home.vue

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

1099
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/, '') 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