调整部分框架
This commit is contained in:
52
src/App.vue
52
src/App.vue
@@ -9,6 +9,8 @@ export default {
|
||||
},
|
||||
onLaunch: function () {
|
||||
this.repairWxSDK()
|
||||
this.initLoginBtn()
|
||||
this.getApps()
|
||||
},
|
||||
onShow: function () {
|
||||
this.initWaterMarker()
|
||||
@@ -19,7 +21,7 @@ export default {
|
||||
...mapState(['token', 'user']),
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['initWaterMarker', 'logout', 'getConfig']),
|
||||
...mapMutations(['initWaterMarker', 'logout', 'getConfig', 'setApps']),
|
||||
goto(params, cb) {
|
||||
let {path: url, query: {app}} = this.$route
|
||||
params.query = {app, ...(params.query || {})}
|
||||
@@ -32,7 +34,28 @@ export default {
|
||||
},
|
||||
repairWxSDK() {
|
||||
wx = jWeixin
|
||||
}
|
||||
},
|
||||
initLoginBtn() {
|
||||
let btn = document.createElement("div")
|
||||
btn.id = "__loginBtn"
|
||||
btn.innerText = "登录"
|
||||
btn.addEventListener("click", () => {
|
||||
if (location.pathname == "/pages/login") {
|
||||
return this.$u.toast("已在登录页!")
|
||||
} else uni.navigateTo({url: "/pages/login?back=" + encodeURIComponent(location.href?.replace(location.origin, ""))})
|
||||
})
|
||||
document.body.appendChild(btn)
|
||||
},
|
||||
getApps() {
|
||||
this.setApps([])
|
||||
this.$http.post("/node/wechatapps/list", null, {
|
||||
params: {size: 999, type: 'wxwork'}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.setApps(res.data.records)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -51,13 +74,14 @@ uni-page-body {
|
||||
background: #f5f5f5;
|
||||
position: relative;
|
||||
}
|
||||
.text-hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.bg-hover {
|
||||
background: #eee;
|
||||
}
|
||||
.text-hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.bg-hover {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
div[bottom] {
|
||||
position: fixed;
|
||||
@@ -153,6 +177,18 @@ uni-button {
|
||||
}
|
||||
}
|
||||
|
||||
#__loginBtn {
|
||||
position: fixed;
|
||||
right: 16px;
|
||||
top: 20px;
|
||||
background-color: $uni-color-primary;
|
||||
color: #fff;
|
||||
padding: 8px 16px;
|
||||
border-radius: 8px;
|
||||
font-size: 24px;
|
||||
box-shadow: 0 0 0.61538462em rgb(0 0 0 / 40%);
|
||||
}
|
||||
|
||||
@keyframes mapWarn {
|
||||
0% {
|
||||
transform: scale(.5);
|
||||
|
||||
Reference in New Issue
Block a user