Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wx-school-app
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姜雷
wx-school-app
Commits
e4059fb2
Commit
e4059fb2
authored
Mar 30, 2020
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加首页
parent
60c084a4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
226 additions
and
20 deletions
+226
-20
index.ts
src/api/index.ts
+1
-1
app.tsx
src/app.tsx
+1
-0
FakeHome.scss
src/pages/FakeHome/FakeHome.scss
+104
-0
FakeHome.tsx
src/pages/FakeHome/FakeHome.tsx
+101
-0
index.tsx
src/pages/index/index.tsx
+19
-19
No files found.
src/api/index.ts
View file @
e4059fb2
...
...
@@ -48,7 +48,7 @@ const createFetch = (basePath: string) => {
}
if
(
data
.
code
===
LogoutCode
)
{
Taro
.
reLaunch
({
url
:
"/pages/
Login/Login
"
url
:
"/pages/
FakeHome/FakeHome
"
});
throw
data
;
}
...
...
src/app.tsx
View file @
e4059fb2
...
...
@@ -46,6 +46,7 @@ class App extends Component {
'pages/WashingMachine/AppointmentPay'
,
'pages/stringPay/stringPay'
,
'pages/AppPay/AppPay'
,
'pages/FakeHome/FakeHome'
,
],
window
:
{
backgroundTextStyle
:
'light'
,
...
...
src/pages/FakeHome/FakeHome.scss
0 → 100644
View file @
e4059fb2
.FakeHome
{
.Home-UserBox
{
position
:
relative
;
height
:
320px
;
padding
:
0
32px
;
// margin: 0 32px;
box-sizing
:
content-box
;
background-color
:
#eee
;
.Home-UserBox-content
{
position
:
relative
;
width
:
100%
;
height
:
100%
;
z-index
:
0
;
overflow
:
hidden
;
.bg
{
height
:
390px
;
}
.Home-UserBox-Setting
{
position
:
absolute
;
right
:
28px
;
top
:
22px
;
width
:
38px
;
height
:
38px
;
}
.Home-UserBox-info
{
padding
:
80px
88px
20px
76px
;
display
:
flex
;
justify-content
:
space-between
;
color
:
#333
;
}
.Home-UserBox-name
{
font-size
:
44px
;
margin-bottom
:
8px
;
}
.Home-UserBox-tel
{
font-size
:
32px
;
margin-bottom
:
8px
;
}
.Home-UserBox-addr
{
font-size
:
24px
;
}
.Home-UserBox-headimg
{
width
:
100px
;
height
:
100px
;
border-radius
:
50%
;
border
:
10px
solid
#c8ccfc
;
}
.Home-UserBox-line
{
width
:
620px
;
border-top
:
1px
solid
#d7daff
;
margin
:
0
auto
;
}
}
.Home-UserBox-Order
{
position
:
absolute
;
left
:
50%
;
bottom
:
-40px
;
transform
:
translate
(
-50%
);
width
:
572px
;
height
:
80px
;
line-height
:
80px
;
background-color
:
#6180f4
;
border-radius
:
50px
;
display
:
flex
;
overflow
:
hidden
;
.Home-UserBox-Order-text
{
position
:
relative
;
flex
:
1
;
text-align
:
center
;
color
:
#fff
;
font-size
:
24px
;
&
:first-child::after
{
content
:
" "
;
position
:
absolute
;
height
:
44px
;
width
:
1px
;
background-color
:
#abbcf9
;
right
:
0
;
top
:
18px
;
}
}
}
}
.Home-Service
{
padding-top
:
40px
;
.Home-Service-List
{
display
:
flex
;
flex-flow
:
wrap
;
justify-content
:
space-between
;
.Home-Service-List
{
margin-top
:
20px
;
}
&
.normal
,
&
.block
{
padding
:
0
32px
;
margin
:
20px
auto
;
}
&
.big
{
width
:
686px
;
margin
:
20px
auto
0
;
}
}
}
}
src/pages/FakeHome/FakeHome.tsx
0 → 100644
View file @
e4059fb2
import
"./FakeHome.scss"
;
import
Taro
from
"@tarojs/taro"
;
import
{
View
,
Image
,
Text
}
from
"@tarojs/components"
;
import
SettingIcon
from
"../../images/home/icon_shezhi@2x.png"
;
import
UserBoxBg
from
"../../images/home/img_bg@2x.png"
;
import
UserHeaderF
from
"../../images/home/img_girl_touxiang@2x.png"
;
import
MenuIconNormal
from
"@/components/MenuIcon/normal/MenuIconNormal"
;
import
WaterIconNormal
from
"../../images/menu/ic_zizhu@2x.png"
;
import
DryerIconNormal
from
"../../images/menu/ic_chuifeng@2x.png"
;
import
DispenserIconNormal
from
"../../images/menu/ic_bigua@2x.png"
;
import
WasherIconNormal
from
"../../images/menu/ic_xiyi@2x.png"
;
function
FakeHome
()
{
const
goLoginPage
=
()
=>
{
Taro
.
showModal
({
title
:
"提示"
,
content
:
"请登录后使用"
})
.
then
(
res
=>
{
if
(
res
.
confirm
)
{
Taro
.
navigateTo
({
url
:
"/pages/Login/Login"
});
}
})
.
catch
(
err
=>
{
console
.
log
(
err
);
});
};
return
(
<
View
className=
"FakeHome"
>
<
View
className=
"Home-UserBox"
>
<
View
className=
"Home-UserBox-content"
>
<
Image
className=
"Home-UserBox-Setting"
src=
{
SettingIcon
}
onClick=
{
goLoginPage
}
/>
<
Image
className=
"bg"
src=
{
UserBoxBg
}
/>
<
View
className=
"Home-UserBox-info"
>
<
View
className=
"Home-UserBox-other"
>
<
View
className=
"Home-UserBox-name"
>
用户
</
View
>
{
/* <View className="Home-UserBox-tel">
{userinfo.customerPhone &&
this.formatePhone(userinfo.customerPhone)}
</View> */
}
<
View
className=
"Home-UserBox-addr"
>
校区名称
</
View
>
</
View
>
<
Image
className=
"Home-UserBox-headimg"
src=
{
UserHeaderF
}
onClick=
{
goLoginPage
}
/>
</
View
>
</
View
>
<
View
className=
"Home-UserBox-Order"
>
<
Text
className=
"Home-UserBox-Order-text"
onClick=
{
goLoginPage
}
>
我的订单
</
Text
>
<
Text
className=
"Home-UserBox-Order-text"
onClick=
{
goLoginPage
}
>
账户
</
Text
>
</
View
>
</
View
>
<
View
className=
"Home-Service"
>
<
View
className=
"Home-Service-List normal"
>
<
MenuIconNormal
key=
"1"
icon=
{
WaterIconNormal
}
text=
"饮水"
onClick=
{
goLoginPage
}
/>
<
MenuIconNormal
key=
"1"
icon=
{
DryerIconNormal
}
text=
"吹风"
onClick=
{
goLoginPage
}
/>
<
MenuIconNormal
key=
"1"
icon=
{
DispenserIconNormal
}
text=
"壁挂机"
onClick=
{
goLoginPage
}
/>
<
MenuIconNormal
key=
"1"
icon=
{
WasherIconNormal
}
text=
"洗衣"
onClick=
{
goLoginPage
}
/>
</
View
>
</
View
>
</
View
>
);
}
export
default
FakeHome
;
src/pages/index/index.tsx
View file @
e4059fb2
import
{
ComponentClass
}
from
'react'
;
import
Taro
,
{
Component
,
Config
}
from
'@tarojs/taro'
;
import
{
View
}
from
'@tarojs/components'
;
import
{
ComponentClass
}
from
"react"
;
import
Taro
,
{
Component
,
Config
}
from
"@tarojs/taro"
;
import
{
View
}
from
"@tarojs/components"
;
import
'./index.scss'
;
import
{
connect
}
from
'@tarojs/redux'
;
import
"./index.scss"
;
import
{
connect
}
from
"@tarojs/redux"
;
import
{
updateUserInfo
,
UserState
}
from
'../../store/rootReducers/userinfo'
;
import
{
appLogin
}
from
'../../api/customer'
;
import
{
shareHandle
}
from
'@/common/shareMethod'
;
import
useSystemInfo
from
'@/hooks/useSystemInfo'
;
import
{
updateUserInfo
,
UserState
}
from
"../../store/rootReducers/userinfo"
;
import
{
appLogin
}
from
"../../api/customer"
;
import
{
shareHandle
}
from
"@/common/shareMethod"
;
import
useSystemInfo
from
"@/hooks/useSystemInfo"
;
type
PageDispatchProps
=
{
updateUserInfo
:
(
e
:
UserState
|
{
token
:
string
})
=>
void
;
...
...
@@ -32,8 +32,8 @@ interface Index {
dispatch
=>
({
updateUserInfo
(
entity
:
UserState
)
{
dispatch
(
updateUserInfo
(
entity
));
}
,
})
,
}
})
)
class
Index
extends
Component
{
config
:
Config
=
{};
...
...
@@ -41,7 +41,7 @@ class Index extends Component {
constructor
(
props
:
IProps
)
{
super
(
props
);
this
.
state
=
{
errorText
:
''
,
errorText
:
""
};
}
onShareAppMessage
=
shareHandle
;
...
...
@@ -53,11 +53,11 @@ class Index extends Component {
checkUser
()
{
Taro
.
getStorage
({
key
:
'token'
,
key
:
"token"
})
.
then
(
res
=>
{
const
data
=
res
.
data
;
console
.
log
(
'token '
+
data
);
console
.
log
(
"token "
+
data
);
})
.
catch
(()
=>
{
this
.
loginHandle
();
...
...
@@ -71,16 +71,16 @@ class Index extends Component {
console
.
log
(
res
);
const
code
=
res
.
code
;
updateUserInfo
({
code
,
code
});
appLogin
({
code
:
res
.
code
,
code
:
res
.
code
})
.
then
(
res
=>
{
const
data
=
res
.
data
;
updateUserInfo
(
data
);
Taro
.
redirectTo
({
url
:
'/pages/Home/Home'
,
url
:
"/pages/Home/Home"
// url: '/pages/WashingMachine/WashingMachine',
});
})
...
...
@@ -88,7 +88,7 @@ class Index extends Component {
console
.
log
(
err
);
Taro
.
hideLoading
();
Taro
.
redirectTo
({
url
:
'/pages/Login/Login'
,
url
:
"/pages/FakeHome/FakeHome"
});
});
})
...
...
@@ -100,7 +100,7 @@ class Index extends Component {
render
()
{
const
{
errorText
}
=
this
.
state
;
useSystemInfo
();
return
<
View
className=
'Index'
>
{
errorText
}
</
View
>;
return
<
View
className=
"Index"
>
{
errorText
}
</
View
>;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment