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
ad2e658c
Commit
ad2e658c
authored
Mar 06, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into test
parents
391fbf22
5c6fedd7
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
116 additions
and
40 deletions
+116
-40
bean.ts
src/api/bean.ts
+14
-2
index.js
src/constants/index.js
+4
-4
BarCode.tsx
src/pages/BarCode/BarCode.tsx
+31
-12
Home.tsx
src/pages/Home/Home.tsx
+1
-1
OrderPay.tsx
src/pages/Order/OrderPay/OrderPay.tsx
+5
-3
UserSetting.tsx
src/pages/UserSetting/UserSetting.tsx
+19
-10
userinfo.ts
src/store/rootReducers/userinfo.ts
+8
-8
Customer.ts
src/types/Customer/Customer.ts
+34
-0
No files found.
src/api/bean.ts
View file @
ad2e658c
import
{
CustomerBeanAccountVo
,
AccountParams
}
from
'./baseClass'
;
import
{
CustomerBeanAccountVo
}
from
'./baseClass'
;
import
{
customerFetch
,
ResponseDataEntity
}
from
'.'
;
type
Params
=
{
areaId
:
number
;
/** 会员电话 */
customerPhone
:
string
;
/** 会员id */
id
:
number
;
/** 服务id */
serviceIdList
:
string
[];
};
export
const
fetchBeanCount
=
(
data
:
Account
Params
,
data
:
Params
,
):
Promise
<
ResponseDataEntity
<
CustomerBeanAccountVo
[]
>>
=>
customerFetch
({
url
:
'/customerAccount/queryAccount'
,
...
...
src/constants/index.js
View file @
ad2e658c
export
const
APP_ID
=
'wxf5912b79bba23663'
;
export
const
BASE_SERVER_URL
=
'https://ex-
test
-dcxy-base-app.168cad.top'
;
export
const
BASE_SERVER_URL
=
'https://ex-
dev
-dcxy-base-app.168cad.top'
;
export
const
CUSTOMER_SERVER_URL
=
'https://ex-
test
-dcxy-customer-app.168cad.top'
;
'https://ex-
dev
-dcxy-customer-app.168cad.top'
;
export
const
SCHOOL_MAIN_URL
=
'https://internal-
test-school-home-bg
.168cad.top'
;
export
const
ANN_LINK_URL
=
'https://ex-
test
-wx.168cad.top/announcement/'
;
'https://internal-
dev-school-main
.168cad.top'
;
export
const
ANN_LINK_URL
=
'https://ex-
dev
-wx.168cad.top/announcement/'
;
src/pages/BarCode/BarCode.tsx
View file @
ad2e658c
...
...
@@ -7,13 +7,9 @@ import RefreshIcon from '../../images/barcode/icon_shuaxin@2x.png';
import
wxbarcode
from
'wxbarcode'
;
import
'./BarCode.scss'
;
import
{
UserState
}
from
'../../store/rootReducers/userinfo'
;
import
{
UserState
,
updateUserInfo
}
from
'../../store/rootReducers/userinfo'
;
import
{
connect
}
from
'@tarojs/redux'
;
import
{
fetchPayOrder
,
fetchOrderDetailAndPay
,
fetchDeductionInfo
,
}
from
'../../api/order'
;
import
{
fetchPayOrder
,
fetchOrderDetailAndPay
}
from
'../../api/order'
;
import
OrderInfo
from
'../Order/components/OrderInfo/OrderInfo'
;
import
OrderTitle
from
'../Order/components/OrderTitle/OrderTitle'
;
import
OrderPayway
from
'../Order/components/OrderPayway/OrderPayway'
;
...
...
@@ -22,10 +18,15 @@ import {
PaymentAndActiveInfo
,
CustomerBeanAccountVo
,
}
from
'../../api/baseClass'
;
import
{
Customer
}
from
'../../types/Customer/Customer'
;
type
PageStateProps
=
{
userinfo
:
UserState
;
userinfo
:
Customer
;
};
type
PageDispatchProps
=
{
updateUserInfo
:
(
e
:
UserState
)
=>
void
;
};
type
PageOwnProps
=
{};
type
PageState
=
{
showPayOrder
:
boolean
;
...
...
@@ -49,15 +50,22 @@ type PageState = {
};
};
type
IProps
=
PageStateProps
&
PageOwnProps
;
type
IProps
=
PageStateProps
&
PageOwnProps
&
PageDispatchProps
;
interface
BarCode
{
props
:
IProps
;
state
:
PageState
;
}
@
connect
(({
userinfo
})
=>
({
userinfo
,
}))
@
connect
(
({
userinfo
})
=>
({
userinfo
,
}),
dispatch
=>
({
updateUserInfo
(
entity
:
UserState
)
{
dispatch
(
updateUserInfo
(
entity
));
},
}),
)
class
BarCode
extends
Component
{
constructor
(
props
:
PageOwnProps
)
{
super
(
props
);
...
...
@@ -177,6 +185,13 @@ class BarCode extends Component {
showBig
:
!
showBig
,
});
}
refreshCodeBar
()
{
const
{
updateUserInfo
}
=
this
.
props
;
updateUserInfo
({
idBar
:
''
,
});
this
.
drawBarCode
(
false
);
}
render
()
{
const
{
userinfo
}
=
this
.
props
;
...
...
@@ -207,7 +222,11 @@ class BarCode extends Component {
<
Image
className=
'bg'
src=
{
BarCodeBoxBg
}
/>
)
}
{
!
showBig
&&
(
<
Image
className=
'BarCodeBox-refresh'
src=
{
RefreshIcon
}
/>
<
Image
className=
'BarCodeBox-refresh'
src=
{
RefreshIcon
}
onClick=
{
this
.
refreshCodeBar
}
/>
)
}
<
View
className=
{
`BarCodeImg ${showBig ? 'BarCodeImgBig' : ''}`
}
>
{
showPayOrder
?
null
:
(
...
...
src/pages/Home/Home.tsx
View file @
ad2e658c
...
...
@@ -90,7 +90,7 @@ class Home extends Component {
.
then
(
res
=>
{
const
data
=
res
.
data
;
let
commBeanItem
=
data
.
find
(
item
=>
item
.
serviceId
===
'1'
);
let
hairDryerBeanItem
=
data
.
find
(
item
=>
item
.
serviceId
===
'
1
'
);
let
hairDryerBeanItem
=
data
.
find
(
item
=>
item
.
serviceId
===
'
4
'
);
let
commBean
=
commBeanItem
?
commBeanItem
.
money
:
0.0
;
let
hairDryerBean
=
hairDryerBeanItem
?
hairDryerBeanItem
.
money
:
0.0
;
this
.
setState
({
...
...
src/pages/Order/OrderPay/OrderPay.tsx
View file @
ad2e658c
...
...
@@ -4,7 +4,7 @@ import { View } from '@tarojs/components';
import
OrderTitle
from
'../components/OrderTitle/OrderTitle'
;
import
OrderInfo
from
'../components/OrderInfo/OrderInfo'
;
import
{
fetchOrderDetailAndPay
,
fetchDeductionInfo
}
from
'../../../api/order'
;
import
{
fetchOrderDetailAndPay
}
from
'../../../api/order'
;
import
'./OrderPay.scss'
;
import
{
...
...
@@ -13,7 +13,7 @@ import {
PaymentAndActiveInfo
,
}
from
'../../../api/baseClass'
;
import
{
connect
}
from
'@tarojs/redux'
;
import
{
UserState
}
from
'
src
/store/rootReducers/userinfo'
;
import
{
UserState
}
from
'
../../..
/store/rootReducers/userinfo'
;
import
OrderPayway
from
'../components/OrderPayway/OrderPayway'
;
type
PageStateProps
=
{
...
...
@@ -116,7 +116,9 @@ class OrderPay extends Component {
const
{
orderInfo
,
payInfos
,
accounts
}
=
this
.
state
;
return
(
<
View
className=
'OrderPay topBr'
>
<
OrderTitle
price=
{
orderInfo
.
payableMoney
}
/>
<
OrderTitle
price=
{
orderInfo
.
payableMoney
?
orderInfo
.
payableMoney
:
0
}
/>
<
OrderInfo
orderInfo=
{
orderInfo
}
/>
<
View
className=
'OrderPay-line'
/>
<
OrderPayway
...
...
src/pages/UserSetting/UserSetting.tsx
View file @
ad2e658c
...
...
@@ -11,14 +11,23 @@ import radioIcon from '../../images/login/pc_nor_icon@2x.png';
import
radioCheckIcon
from
'../../images/login/pc_sel_icon@2x.png'
;
import
'./UserSetting.scss'
;
import
{
connect
}
from
'@tarojs/redux'
;
import
{
UserState
,
updateUserInfo
}
from
'../../store/rootReducers/userinfo'
;
import
{
updateUserInfo
}
from
'../../store/rootReducers/userinfo'
;
import
{
perfectionUserInfo
}
from
'../../api/customer'
;
import
{
Customer
}
from
'../../types/Customer/Customer'
;
type
UpdateParams
=
{
customerId
:
number
;
customerName
:
string
;
customerSex
:
string
;
birthDay
:
string
;
studentNo
:
string
;
entranceDate
:
string
;
};
type
PageStateProps
=
{
userinfo
:
UserState
;
userinfo
:
Customer
;
};
type
PageDispatchProps
=
{
updateUserInfo
:
(
e
:
U
serState
)
=>
void
;
updateUserInfo
:
(
e
:
U
pdateParams
)
=>
void
;
};
type
PageOwnProps
=
{};
type
PageState
=
{
...
...
@@ -40,7 +49,7 @@ interface UserSetting {
userinfo
,
}),
dispatch
=>
({
updateUserInfo
(
entity
:
U
serState
)
{
updateUserInfo
(
entity
:
U
pdateParams
)
{
dispatch
(
updateUserInfo
(
entity
));
},
}),
...
...
@@ -63,12 +72,12 @@ class UserSetting extends Component {
},
}
=
props
;
this
.
state
=
{
birthDay
:
birthDay
,
customerHead
:
customerHead
,
customerName
:
customerName
,
customerSex
:
customerSex
,
entranceDate
:
entranceDate
,
studentNo
:
studentNo
,
birthDay
:
birthDay
?
birthDay
.
split
(
' '
)[
0
]
:
''
,
customerHead
:
customerHead
?
customerHead
:
''
,
customerName
:
customerName
?
customerName
:
''
,
customerSex
:
customerSex
?
customerSex
:
''
,
entranceDate
:
entranceDate
?
entranceDate
.
split
(
' '
)[
0
]
:
''
,
studentNo
:
studentNo
?
studentNo
:
''
,
};
}
...
...
src/store/rootReducers/userinfo.ts
View file @
ad2e658c
import
Action
from
'../../types/Store/Actions'
;
export
class
UserState
{
export
type
UserState
=
{
login
?:
boolean
;
areaId
:
number
;
areaId
?
:
number
;
areaName
?:
string
;
birthDay
?:
string
;
createAt
?:
string
;
createLoginDate
?:
string
;
customerHead
?:
string
;
customerId
:
number
;
customerId
?
:
number
;
customerName
?:
string
;
customerPhone
?:
string
;
customerSex
?:
string
;
...
...
@@ -19,7 +19,7 @@ export class UserState {
hardwarePwd
?:
string
;
hardwareState
?:
string
;
hardwarelastDate
?:
string
;
idBar
:
string
;
idBar
?
:
string
;
idCard
?:
string
;
isFirstRecharge
?:
number
;
lastLoginDate
?:
string
;
...
...
@@ -33,17 +33,17 @@ export class UserState {
updateAt
?:
string
;
updateLoginDate
?:
string
;
version
?:
string
;
}
}
;
export
const
INITIAL_STATE
=
{
login
:
false
,
areaId
:
undefined
,
areaId
:
0
,
areaName
:
''
,
birthDay
:
''
,
createAt
:
''
,
createLoginDate
:
''
,
customerHead
:
''
,
customerId
:
undefined
,
customerId
:
0
,
customerName
:
''
,
customerPhone
:
''
,
customerSex
:
''
,
...
...
@@ -56,7 +56,7 @@ export const INITIAL_STATE = {
hardwarelastDate
:
''
,
idBar
:
''
,
idCard
:
''
,
isFirstRecharge
:
undefined
,
isFirstRecharge
:
0
,
lastLoginDate
:
''
,
loginAccount
:
''
,
loginPwd
:
''
,
...
...
src/types/Customer/Customer.ts
0 → 100644
View file @
ad2e658c
export
type
Customer
=
{
areaId
:
number
;
areaName
:
string
;
birthDay
:
string
;
createAt
:
string
;
createLoginDate
:
string
;
customerHead
:
string
;
customerId
:
number
;
customerName
:
string
;
customerPhone
:
string
;
customerSex
:
string
;
customerType
:
string
;
email
:
string
;
entranceDate
:
string
;
hardwareAccount
:
string
;
hardwarePwd
:
string
;
hardwareState
:
string
;
hardwarelastDate
:
string
;
idBar
:
string
;
idCard
:
string
;
isFirstRecharge
:
number
;
lastLoginDate
:
string
;
loginAccount
:
string
;
loginPwd
:
string
;
loginPwdSalt
:
string
;
loginState
:
string
;
state
:
string
;
studentNo
:
string
;
token
:
string
;
updateAt
:
string
;
updateLoginDate
:
string
;
version
:
string
;
wxToken
:
string
;
};
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