调整部分框架

This commit is contained in:
aixianling
2022-05-30 18:46:49 +08:00
parent 16beb074f6
commit 8e9a7de387
7 changed files with 112 additions and 59 deletions

View File

@@ -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);