Merge pull request 'xbx' (#149) from xbx into master

Reviewed-on: http://git.luyuan.tk/luyuan/beelink/pulls/149
This commit is contained in:
luyuan 2020-11-24 11:21:03 +08:00
commit b4477c0a39
5 changed files with 66 additions and 8 deletions

View File

@ -8,7 +8,7 @@
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title> <title><%= htmlWebpackPlugin.options.title %></title>
<link href="https://imgcache.qq.com/open/qcloud/video/tcplayer/tcplayer.css" rel="stylesheet"> <link href="https://imgcache.qq.com/open/qcloud/video/tcplayer/tcplayer.css" rel="stylesheet">
<script data-ad-client="ca-pub-7145171713084445" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 如需在IE8、9浏览器中初始化播放器浏览器需支持Flash并在页面中引入 --> <!-- 如需在IE8、9浏览器中初始化播放器浏览器需支持Flash并在页面中引入 -->
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="//imgcache.qq.com/open/qcloud/video/tcplayer/ie8/videojs-ie8.js"></script> <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/ie8/videojs-ie8.js"></script>
@ -107,6 +107,19 @@
</script> </script>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js"></script> <script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js"></script>
<script src="/js/cropper.min.js"></script> <script src="/js/cropper.min.js"></script>
<div id="divadsensedisplaynone" style="width: 500px;height: 100px;display: none;" >
<script data-ad-client="ca-pub-7145171713084445" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 测试 -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-7145171713084445"
data-ad-slot="4213570423"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</body> </body>
</html> </html>

View File

@ -27,6 +27,7 @@ export default defineComponent({
if(getValue('token')){ if(getValue('token')){
console.log("token") console.log("token")
store.commit("login", true) store.commit("login", true)
store.dispatch("getcode");
store.dispatch("setUserInfo"); store.dispatch("setUserInfo");
}else{ }else{

View File

@ -1040,7 +1040,7 @@ export async function luzhi(roomid: string){
} }
export function getaddr() { export function getaddr() {
return new Promise((r)=>{ return new Promise(async (r)=>{
console.log("开始定位") console.log("开始定位")
const lan = getValue("Lanvuage"); const lan = getValue("Lanvuage");
if ("geolocation" in navigator) { if ("geolocation" in navigator) {
@ -1056,7 +1056,7 @@ export function getaddr() {
if(qh.data.ename == "China"){ if(qh.data.ename == "China"){
r({hb: '人民币¥', qh}); r({hb: '人民币¥', qh});
}else { }else {
r({hb: '美元$'}) r({hb: '美元$', qh})
} }
}else{ }else{
if(qh.data.ename == "China"){ if(qh.data.ename == "China"){
@ -1065,11 +1065,45 @@ export function getaddr() {
r({yy: 'en', yyx: 'English', hb: '美元$', qh}) r({yy: 'en', yyx: 'English', hb: '美元$', qh})
} }
} }
},(err) => { },async () => {
message.error(err.message) const qh = await get<any>('countryCode', {
console.log(err, 'err')
});
console.log(qh)
if(lan != null && lan){
if(qh.data.ename == "China"){
r({hb: '人民币¥', qh});
}else {
r({hb: '美元$', qh})
}
}else{
if(qh.data.ename == "China"){
r({yy: "zh", yyx: "中文", hb: '人民币¥', qh});
}else {
r({yy: 'en', yyx: 'English', hb: '美元$', qh})
}
}
// message.error(err.message)
// console.log(err, 'err')
}) })
} else { } else {
const qh = await get<any>('countryCode', {
});
console.log(qh)
if(lan != null && lan){
if(qh.data.ename == "China"){
r({hb: '人民币¥', qh});
}else {
r({hb: '美元$', qh})
}
}else{
if(qh.data.ename == "China"){
r({yy: "zh", yyx: "中文", hb: '人民币¥', qh});
}else {
r({yy: 'en', yyx: 'English', hb: '美元$', qh})
}
}
/* 地理位置服务不可用 */ /* 地理位置服务不可用 */
console.log("无法定位") console.log("无法定位")
} }

View File

@ -110,6 +110,9 @@ export default createStore({
} }
}, },
setquhao(state, data){
state.qh = data.qh.data;
},
setWlan(state){ setWlan(state){
const lan = getValue("Lanvuage"); const lan = getValue("Lanvuage");
if(lan != null && lan){ if(lan != null && lan){
@ -134,6 +137,11 @@ export default createStore({
const info = await getaddr(); const info = await getaddr();
console.log(info,11256445); console.log(info,11256445);
commit("setLanguage", info) commit("setLanguage", info)
},
async getcode({ commit }){
const info = await getaddr();
console.log(info,11256445);
commit("setquhao", info)
} }
}, },
modules: { modules: {

View File

@ -23,7 +23,7 @@
</a-select-option> </a-select-option>
<a-select-option value="Jiangsu"> Jiangsu </a-select-option> <a-select-option value="Jiangsu"> Jiangsu </a-select-option>
</a-select> --> </a-select> -->
<a-select :default-value="mrqh.name + '+' + mrqh.code" size="small" option-label-prop="label" @change="getquhao" class="getcode" show-search > <a-select v-model:value="hqqh" size="small" option-label-prop="label" @change="getquhao" class="getcode" show-search >
<a-select-option v-for="(i,j) in quhaolist" :key="j" :value="i.name + '+' + i.code" :label="'+' + i.code"> <a-select-option v-for="(i,j) in quhaolist" :key="j" :value="i.name + '+' + i.code" :label="'+' + i.code">
{{i.name}}+{{i.code}} {{i.name}}+{{i.code}}
</a-select-option> </a-select-option>
@ -147,6 +147,7 @@ export default defineComponent({
password: '123456' password: '123456'
}) })
const mrqh = computed(() => store.state.qh) const mrqh = computed(() => store.state.qh)
const hqqh = computed(() => { return mrqh.value.name + '+' + mrqh.value.code })
const quhaolist = ref<any>([ const quhaolist = ref<any>([
{ {
code: "86", code: "86",
@ -284,7 +285,8 @@ export default defineComponent({
navto, navto,
lan, lan,
slogin, slogin,
mrqh mrqh,
hqqh
}; };
}, },
}); });