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
677d4b5d
Commit
677d4b5d
authored
Mar 12, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into test
parents
fd0a61ad
1fb6838a
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
149 additions
and
22 deletions
+149
-22
area.ts
src/api/area.ts
+8
-2
customer.ts
src/api/customer.ts
+10
-1
app.tsx
src/app.tsx
+1
-0
BarCode.tsx
src/pages/BarCode/BarCode.tsx
+1
-1
Content.scss
src/pages/Content/Content.scss
+0
-0
Feedback.tsx
src/pages/Feedback/Feedback.tsx
+1
-1
Login.tsx
src/pages/Login/Login.tsx
+17
-1
Register.tsx
src/pages/Register/Register.tsx
+30
-2
SelectCampus.scss
src/pages/SelectCampus/SelectCampus.scss
+3
-0
SelectCampus.tsx
src/pages/SelectCampus/SelectCampus.tsx
+41
-14
WebPage.tsx
src/pages/WebPage/WebPage.tsx
+37
-0
No files found.
src/api/area.ts
View file @
677d4b5d
import
{
baseFetch
}
from
'./index'
;
import
{
baseFetch
,
ResponseDataEntity
}
from
'./index'
;
export
const
fetchAllArea
=
()
=>
export
type
Area
=
{
id
:
number
;
areaName
:
string
;
initial
?:
string
;
};
export
const
fetchAllArea
=
():
Promise
<
ResponseDataEntity
<
Area
[]
>>
=>
baseFetch
({
url
:
'/area/queryAreaList'
,
});
src/api/customer.ts
View file @
677d4b5d
...
...
@@ -35,7 +35,16 @@ export const changePwdByCellphone = (data: PwdParams) =>
data
:
data
,
});
type
RegisiterPramas
=
{};
type
RegisiterPramas
=
{
code
:
string
;
areaId
:
number
;
areaName
:
string
;
customerName
:
string
;
customerPhone
:
string
;
customerSex
:
string
;
password
:
string
;
verificationCode
:
string
;
};
// type RegisiterReponseData = {};
export
const
wxUserRegister
=
(
entity
:
RegisiterPramas
)
=>
...
...
src/app.tsx
View file @
677d4b5d
...
...
@@ -38,6 +38,7 @@ class App extends Component {
'pages/Order/OrderDetail/OrderDetail'
,
'pages/SelectCampus/SelectCampus'
,
'pages/Content/Content'
,
'pages/WebPage/WebPage'
,
],
window
:
{
backgroundTextStyle
:
'light'
,
...
...
src/pages/BarCode/BarCode.tsx
View file @
677d4b5d
...
...
@@ -133,7 +133,7 @@ class BarCode extends Component {
this
.
fetchOrder
(
res
.
data
[
0
].
id
);
this
.
setState
({
showPayOrder
:
true
});
}
else
{
this
.
drawBarCode
(
false
);
this
.
drawBarCode
();
}
})
.
catch
(
err
=>
{
...
...
src/pages/Content/Content.scss
deleted
100644 → 0
View file @
fd0a61ad
src/pages/Feedback/Feedback.tsx
View file @
677d4b5d
...
...
@@ -43,7 +43,7 @@ class Feedback extends Component<PageProps, PageState> {
feedbackHandle
()
{
Taro
.
showLoading
();
const
{
feedbackContent
}
=
this
.
state
;
if
(
feedbackContent
&&
feedbackContent
.
length
>
5
)
{
if
(
feedbackContent
&&
feedbackContent
.
length
>
=
5
)
{
const
{
areaId
,
areaName
,
...
...
src/pages/Login/Login.tsx
View file @
677d4b5d
...
...
@@ -14,6 +14,7 @@ type PageDispatchProps = {
};
type
PageState
=
{
fetching
:
boolean
;
account
:
string
;
pwd
:
string
;
};
...
...
@@ -39,6 +40,7 @@ class Login extends Component {
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
fetching
:
false
,
account
:
''
,
pwd
:
''
,
};
...
...
@@ -64,7 +66,11 @@ class Login extends Component {
}
loginHandle
():
void
{
if
(
this
.
state
.
fetching
)
return
;
if
(
this
.
validataLoginData
())
{
this
.
setState
({
fetching
:
true
,
});
const
{
updateUserInfo
,
userinfo
}
=
this
.
props
;
const
{
account
,
pwd
}
=
this
.
state
;
console
.
log
(
'in loginHandle'
);
...
...
@@ -77,19 +83,29 @@ class Login extends Component {
const
data
=
res
.
data
;
console
.
log
(
data
);
updateUserInfo
(
data
);
Taro
.
re
directTo
({
Taro
.
re
Launch
({
url
:
'/pages/Home/Home'
,
});
})
.
catch
(
err
=>
{
console
.
log
(
err
);
if
(
err
.
code
&&
err
.
code
===
NotRegisterCode
)
{
updateUserInfo
({
customerPhone
:
account
,
});
setTimeout
(()
=>
{
this
.
setState
({
fetching
:
false
,
});
Taro
.
navigateTo
({
url
:
'/pages/Register/Register'
,
});
},
2000
);
}
else
{
this
.
setState
({
fetching
:
false
,
});
}
});
}
...
...
src/pages/Register/Register.tsx
View file @
677d4b5d
...
...
@@ -28,6 +28,7 @@ type PageDispatchProps = {
};
type
PageState
=
{
fetching
:
boolean
;
name
:
string
;
cellphone
:
string
;
vcode
:
string
;
...
...
@@ -64,6 +65,7 @@ class Register extends Component {
super
(
props
);
const
{
customerPhone
}
=
props
.
userinfo
;
this
.
state
=
{
fetching
:
false
,
name
:
''
,
cellphone
:
customerPhone
,
vcode
:
''
,
...
...
@@ -148,13 +150,21 @@ class Register extends Component {
}
getRegister
()
{
if
(
this
.
state
.
fetching
)
return
;
if
(
this
.
validateRegisterEntity
())
{
this
.
setState
({
fetching
:
true
,
});
const
{
name
,
cellphone
,
pwd
,
sex
,
vcode
}
=
this
.
state
;
const
{
userinfo
:
{
areaId
,
areaName
},
updateUserInfo
,
}
=
this
.
props
;
Taro
.
login
()
.
then
(
res
=>
res
.
code
)
.
then
(
code
=>
{
wxUserRegister
({
code
:
code
,
areaId
:
areaId
,
areaName
:
areaName
,
customerName
:
name
,
...
...
@@ -174,11 +184,18 @@ class Register extends Component {
title
:
'注册成功'
,
});
setTimeout
(()
=>
{
Taro
.
redirectTo
({
Taro
.
reLaunch
({
url
:
'/pages/Home/Home'
,
});
},
2000
);
})
.
catch
(
err
=>
{
console
.
log
(
err
);
this
.
setState
({
fetching
:
false
,
});
});
})
.
catch
(
console
.
log
);
}
}
...
...
@@ -207,6 +224,15 @@ class Register extends Component {
}));
}
goAgreementPage
(
e
)
{
e
.
stopPropagation
();
Taro
.
navigateTo
({
url
:
'/pages/WebPage/WebPage?url='
+
encodeURIComponent
(
'https://api.dcrym.com/dcwap/agreement.html'
),
});
}
render
()
{
const
{
name
,
...
...
@@ -355,7 +381,9 @@ class Register extends Component {
<
Image
className=
'registerBox-agreeCheck'
src=
{
agreeNotIcon
}
/>
)
}
<
Text
>
同意条款
</
Text
>
<
Text
className=
'service-deal'
>
《多彩校园服务协议》
</
Text
>
<
Text
className=
'service-deal'
onClick=
{
this
.
goAgreementPage
}
>
《多彩校园服务协议》
</
Text
>
</
View
>
{
agree
?
(
<
Button
className=
'registerBox-button'
onClick=
{
this
.
getRegister
}
>
...
...
src/pages/SelectCampus/SelectCampus.scss
View file @
677d4b5d
...
...
@@ -88,4 +88,7 @@
border-bottom
:
2px
solid
#ebebeb
;
word-break
:
break-all
;
}
.locationItem
:last-child
{
border-bottom
:
none
;
}
}
src/pages/SelectCampus/SelectCampus.tsx
View file @
677d4b5d
...
...
@@ -5,17 +5,11 @@ import { connect } from '@tarojs/redux';
import
{
View
,
Text
,
Input
,
Image
,
ScrollView
}
from
'@tarojs/components'
;
import
SearchIcon
from
'../../images/login/icon_search@2x.png'
;
import
{
fetchAllArea
}
from
'../../api/area'
;
import
{
fetchAllArea
,
Area
}
from
'../../api/area'
;
import
{
UserState
,
updateUserInfo
}
from
'../../store/rootReducers/userinfo'
;
import
'./SelectCampus.scss'
;
type
Area
=
{
id
:
number
;
areaName
:
string
;
initial
?:
string
;
};
type
AreaList
=
Array
<
{
firstPin
:
string
;
children
:
Array
<
Area
>
;
...
...
@@ -80,6 +74,34 @@ class SelectCampus extends Component {
fetchAllArea
()
.
then
(
res
=>
{
console
.
log
(
res
);
let
initialList
=
[
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
,
'G'
,
'H'
,
'I'
,
'J'
,
'K'
,
'L'
,
'M'
,
'N'
,
'O'
,
'P'
,
'Q'
,
'R'
,
'S'
,
'T'
,
'U'
,
'V'
,
'W'
,
'X'
,
'Y'
,
'Z'
,
];
let
campusIndexArr
:
Array
<
string
>
=
[];
let
campusList
:
AreaList
=
[];
res
.
data
.
map
((
area
:
Area
)
=>
{
...
...
@@ -89,11 +111,12 @@ class SelectCampus extends Component {
if
(
index
>
-
1
)
{
campusList
[
index
].
children
.
push
(
area
);
}
else
{
campusIndexArr
.
push
(
firstPin
);
campusList
.
push
({
let
index
=
initialList
.
indexOf
(
firstPin
);
campusIndexArr
[
index
]
=
firstPin
;
campusList
[
index
]
=
{
firstPin
:
firstPin
,
children
:
[
area
],
}
)
;
};
}
}
});
...
...
@@ -190,14 +213,16 @@ class SelectCampus extends Component {
</
View
>
</
View
>
<
View
className=
'infoBar'
>
{
pinList
.
map
(
item
=>
(
{
pinList
.
map
(
item
=>
item
?
(
<
View
key=
{
item
}
className=
'infoItem'
onClick=
{
()
=>
this
.
showToastHandle
(
item
)
}
>
{
item
}
</
View
>
))
}
)
:
null
,
)
}
</
View
>
<
View
className=
{
showToast
?
'show br8 infoToast'
:
'br8 infoToast'
}
>
{
localText
}
...
...
@@ -207,7 +232,8 @@ class SelectCampus extends Component {
className=
'locationList'
scrollIntoView=
{
localText
}
scrollWithAnimation
>
{
filterList
.
map
(
campusItem
=>
(
{
filterList
.
map
(
campusItem
=>
campusItem
?
(
<
View
key=
{
campusItem
.
firstPin
}
className=
'locationArea'
>
<
View
id=
{
campusItem
.
firstPin
}
className=
'locationTitle'
>
{
campusItem
.
firstPin
}
...
...
@@ -222,7 +248,8 @@ class SelectCampus extends Component {
</
View
>
))
}
</
View
>
))
}
)
:
null
,
)
}
</
ScrollView
>
</
View
>
);
...
...
src/pages/WebPage/WebPage.tsx
0 → 100644
View file @
677d4b5d
import
{
Component
}
from
'@tarojs/taro'
;
import
{
ComponentClass
}
from
'react'
;
import
{
WebView
}
from
'@tarojs/components'
;
type
PageState
=
{
linkUrl
:
string
;
};
interface
WebPage
{
state
:
PageState
;
}
class
WebPage
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
linkUrl
:
''
,
};
}
componentWillMount
()
{
console
.
log
(
this
.
$router
.
params
);
const
{
url
}
=
this
.
$router
.
params
;
if
(
url
)
{
this
.
setState
({
linkUrl
:
url
,
});
}
}
render
()
{
const
{
linkUrl
}
=
this
.
state
;
return
linkUrl
&&
<
WebView
src=
{
linkUrl
}
/>;
}
}
export
default
WebPage
as
ComponentClass
<
any
,
PageState
>
;
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