Commit 0119ca6d by liimin

Merge branch 'v1.0.0' of http://192.168.3.233:8090/saas/mini-program/hmd into v1.0.0

2 parents 8887c707 5e000efa
......@@ -81,8 +81,18 @@ class Request {
}
if (code == 20 || code == 21) {
wx.hideLoading()
return wx.reLaunch({
url: '/pages/loading/loading'
const thisPage = wx.p.router.getPageInstance(),
options = Object.keys(thisPage.options)
let currentRoute = thisPage.route,
query = []
if (options.length) {
options.map(key => {
query.push(`${key}=${options[key]}`)
})
}
if (query.length) currentRoute += `?${query.join('&')}`
return wx.p.router.redirectTo('/pages/loading/loading', {
url: `/${currentRoute}`
})
} else {
if (code == '0') {
......
......@@ -35,8 +35,14 @@ Page({
async onLoad() {
wx.p.wxApi.showLoading()
const {
data
data,
code
} = await wx.p.api.userApi.login()
if (code == '0') {
wx.p.storage.set('userInfo', data)
wx.p.storage.set('sessionId', data.sessionId)
wx.p.router.back()
}
if (data) this.sessionId = data.sessionId
wx.hideLoading()
},
......@@ -159,7 +165,7 @@ Page({
wx.p.storage.set('sessionId', data.sessionId)
// 返回上一页
wx.p.router.back(thisPage => {
thisPage.setData({
thisPage && thisPage.setData({
userInfo: data
})
})
......
<view class="layout">
<view class="login-bg x-center">
<glsx-image src="login/login-bg.png"></glsx-image>
</view>
<navigation-bar navStyle="background:transparent;" custom page-title="登录">
<view class="nav-bar flex">
<view class="back flex" bindtap="back">
......
/* pages/login/login.wxss */
page {
background-color: #000 !important;
page {}
.login-bg {
position: fixed;
z-index: -2;
width: 1350rpx;
height: 1664rpx;
top: -60rpx;
}
.layout::before{
position: fixed;
left: 0;
top: 0;
width: 100vw;
height: 600rpx;
background-image: linear-gradient(0deg, #0a030300 22%, #0A0303 100%);
z-index: -1;
content: '';
}
.layout::after {
position: fixed;
left: 0;
bottom: 0;
width: 100vw;
height: 400rpx;
transform: scaleY(-1);
background-image: linear-gradient(0deg, #0a030300 22%, #0A0303 90%);
z-index: -1;
content: '';
}
.nav-bar {
......
......@@ -38,7 +38,6 @@ page {
.layout {
padding-bottom: 200rpx;
position: relative;
padding-top: 16rpx;
background: transparent;
......
<navigation-bar page-title="首页" custom bindnavbarReady="navbarReady" navStyle="background-color: transparent;">
<navigation-bar page-title="首页" custom bindnavbarReady="navbarReady" navStyle="background-color: #F9F7F7;">
<view class="home-top flex">
海马刀
<view class="widget-box" bindtap="openKF">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!