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
2766a416
Commit
2766a416
authored
Mar 05, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善反馈逻辑
parent
50fa246e
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
167 additions
and
19 deletions
+167
-19
customer.ts
src/api/customer.ts
+15
-0
app.tsx
src/app.tsx
+1
-0
index.js
src/constants/index.js
+1
-1
Announcement.tsx
src/pages/Announcement/Announcement.tsx
+3
-4
Content.scss
src/pages/Content/Content.scss
+0
-0
Content.tsx
src/pages/Content/Content.tsx
+45
-0
Feedback.scss
src/pages/Feedback/Feedback.scss
+1
-0
Feedback.tsx
src/pages/Feedback/Feedback.tsx
+82
-5
Home.tsx
src/pages/Home/Home.tsx
+12
-2
Login.tsx
src/pages/Login/Login.tsx
+2
-2
Register.tsx
src/pages/Register/Register.tsx
+5
-5
No files found.
src/api/customer.ts
View file @
2766a416
...
...
@@ -63,3 +63,18 @@ export const perfectionUserInfo = (entity: perfectionCustomerParams) =>
method
:
'POST'
,
data
:
entity
,
});
type
CustomerParam
=
{
areaId
:
number
;
areaName
:
string
;
customerId
:
number
;
customerName
:
string
;
customerPhone
:
string
;
feedbackContent
:
string
;
};
export
const
fetchFeedback
=
(
entity
:
CustomerParam
)
=>
customerFetch
({
url
:
'/app/customer/feed/back'
,
method
:
'POST'
,
data
:
entity
,
});
src/app.tsx
View file @
2766a416
...
...
@@ -37,6 +37,7 @@ class App extends Component {
'pages/Feedback/Feedback'
,
'pages/Order/OrderDetail/OrderDetail'
,
'pages/SelectCampus/SelectCampus'
,
'pages/Content/Content'
,
],
window
:
{
backgroundTextStyle
:
'light'
,
...
...
src/constants/index.js
View file @
2766a416
...
...
@@ -5,4 +5,4 @@ export const BASE_SERVER_URL = 'https://ex-dev-dcxy-base-app.168cad.top';
export
const
CUSTOMER_SERVER_URL
=
'https://ex-dev-dcxy-customer-app.168cad.top'
;
export
const
SCHOOL_MAIN_URL
=
'https://internal-dev-school-main.168cad.top'
;
export
const
ANN_LINK_URL
=
'https://
internal-dev-school-homepage.168cad.top
/'
;
export
const
ANN_LINK_URL
=
'https://
ex-dev-wx.168cad.top/announcement
/'
;
src/pages/Announcement/Announcement.tsx
View file @
2766a416
import
{
Component
}
from
'@tarojs/taro'
;
import
Taro
,
{
Component
}
from
'@tarojs/taro'
;
import
{
ComponentClass
}
from
'react'
;
import
{
View
,
ScrollView
,
Image
,
Text
,
WebView
}
from
'@tarojs/components'
;
...
...
@@ -57,9 +57,8 @@ class Announcement extends Component {
});
}
geAnnDetail
(
id
:
number
,
title
:
string
)
{
console
.
log
(
id
);
this
.
setState
({
linkUrl
:
`
${
ANN_LINK_URL
}
/Content/
${
id
}
?title=
${
title
}
`
,
Taro
.
navigateTo
({
url
:
`/pages/Content/Content?id=
${
id
}
`
,
});
}
render
()
{
...
...
src/pages/Content/Content.scss
0 → 100644
View file @
2766a416
src/pages/Content/Content.tsx
0 → 100644
View file @
2766a416
import
{
Component
}
from
'@tarojs/taro'
;
import
{
ComponentClass
}
from
'react'
;
import
{
WebView
}
from
'@tarojs/components'
;
import
{
connect
}
from
'@tarojs/redux'
;
import
{
ANN_LINK_URL
}
from
'../../constants'
;
type
PageOwnProps
=
{
token
:
string
;
};
type
PageState
=
{
linkUrl
:
string
;
};
interface
Content
{
props
:
PageOwnProps
;
state
:
PageState
;
}
@
connect
(({
userinfo
})
=>
({
token
:
userinfo
.
token
,
}))
class
Content
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
linkUrl
:
''
,
};
this
.
getLinkUrl
();
}
getLinkUrl
()
{
const
{
token
}
=
this
.
props
;
const
{
id
}
=
this
.
$router
.
params
;
this
.
setState
({
linkUrl
:
`
${
ANN_LINK_URL
}
?id=
${
id
}
&token=
${
token
}
`
,
});
}
render
()
{
const
{
linkUrl
}
=
this
.
state
;
return
linkUrl
&&
<
WebView
src=
{
linkUrl
}
/>;
}
}
export
default
Content
as
ComponentClass
<
PageOwnProps
,
PageState
>
;
src/pages/Feedback/Feedback.scss
View file @
2766a416
...
...
@@ -8,6 +8,7 @@
padding
:
20px
;
width
:
100%
;
height
:
468px
;
line-height
:
50px
;
font-size
:
28px
;
}
.Feedback-btn
{
...
...
src/pages/Feedback/Feedback.tsx
View file @
2766a416
import
{
ComponentClass
}
from
'react'
;
import
Taro
,
{
Component
,
Config
}
from
'@tarojs/taro'
;
import
{
View
,
Textarea
,
Button
}
from
'@tarojs/components'
;
import
{
fetchFeedback
}
from
'../../api/customer'
;
import
{
connect
}
from
'@tarojs/redux'
;
import
{
UserState
}
from
'src/store/rootReducers/userinfo'
;
type
PageProps
=
{};
import
'./Feedback.scss'
;
type
PageProps
=
{
areaId
:
number
;
areaName
:
string
;
customerId
:
number
;
customerName
:
string
;
customerPhone
:
string
;
};
type
PageState
=
{
tex
t
:
string
;
feedbackConten
t
:
string
;
};
interface
Feedback
{
props
:
PageProps
;
state
:
PageState
;
}
@
connect
(({
userinfo
})
=>
({
areaId
:
userinfo
.
areaId
,
areaName
:
userinfo
.
areaName
,
customerId
:
userinfo
.
customerId
,
customerName
:
userinfo
.
customerName
,
customerPhone
:
userinfo
.
customerPhone
,
}))
class
Feedback
extends
Component
<
PageProps
,
PageState
>
{
config
:
Config
=
{
navigationBarTitleText
:
'意见反馈'
,
...
...
@@ -14,19 +36,74 @@ class Feedback extends Component<PageProps, PageState> {
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
tex
t
:
''
,
feedbackConten
t
:
''
,
};
}
feedbackHandle
()
{
Taro
.
showLoading
();
const
{
feedbackContent
}
=
this
.
state
;
if
(
feedbackContent
&&
feedbackContent
.
length
>
5
)
{
const
{
areaId
,
areaName
,
customerId
,
customerName
,
customerPhone
,
}
=
this
.
props
;
fetchFeedback
({
areaId
,
areaName
,
customerId
,
customerName
,
customerPhone
,
feedbackContent
,
})
.
then
(
res
=>
{
Taro
.
hideLoading
();
console
.
log
(
res
);
Taro
.
showToast
({
title
:
'反馈成功'
,
icon
:
'success'
,
});
setTimeout
(()
=>
{
Taro
.
navigateBack
();
},
2000
);
})
.
catch
(
err
=>
{
Taro
.
hideLoading
();
console
.
log
(
err
);
Taro
.
showToast
({
title
:
'反馈失败'
,
icon
:
'none'
,
});
});
}
else
{
Taro
.
showToast
({
title
:
'请输入至少5个字'
,
icon
:
'none'
,
});
}
}
render
()
{
return
(
<
View
className=
'Feedback'
>
<
Textarea
className=
'Feedback-input'
value=
{
this
.
state
.
tex
t
}
value=
{
this
.
state
.
feedbackConten
t
}
placeholder=
'反馈问题不超过50字'
maxlength=
{
50
}
onInput=
{
({
detail
:
{
value
}
})
=>
{
this
.
setState
({
feedbackContent
:
value
.
trim
(),
});
return
value
.
trim
();
}
}
/>
<
Button
className=
'Feedback-btn'
>
提交
</
Button
>
<
Button
className=
'Feedback-btn'
onClick=
{
this
.
feedbackHandle
}
>
提交
</
Button
>
</
View
>
);
}
...
...
src/pages/Home/Home.tsx
View file @
2766a416
...
...
@@ -150,6 +150,7 @@ class Home extends Component {
});
}
goFeedback
()
{
this
.
toggleBarMenu
();
Taro
.
navigateTo
({
url
:
'/pages/Feedback/Feedback'
,
});
...
...
@@ -190,7 +191,12 @@ class Home extends Component {
let
newPhone
=
phone
.
replace
(
/
([
0-9
]{3})([
0-9
]{4})([
0-9
]{4})
/
,
'$1****$3'
);
return
newPhone
;
};
geAnnDetail
(
id
:
number
,
title
:
string
)
{
console
.
log
(
id
);
Taro
.
navigateTo
({
url
:
`/pages/Content/Content?id=
${
id
}
`
,
});
}
render
()
{
const
{
userinfo
}
=
this
.
props
;
const
{
commBean
,
hairDryerBean
,
annItem
,
barMenuVisiable
}
=
this
.
state
;
...
...
@@ -275,7 +281,11 @@ class Home extends Component {
</
View
>
</
View
>
{
annItem
.
items
.
length
&&
(
<
View
className=
'Home-Announcement-Content'
>
<
View
className=
'Home-Announcement-Content'
onClick=
{
()
=>
this
.
geAnnDetail
(
annItem
.
items
[
0
].
id
,
annItem
.
items
[
0
].
title
)
}
>
<
Text
>
{
annItem
.
items
[
0
].
title
}
</
Text
>
<
Text
className=
'ContentDate'
>
{
annItem
.
items
[
0
].
updateTime
}
...
...
src/pages/Login/Login.tsx
View file @
2766a416
...
...
@@ -38,8 +38,8 @@ class Login extends Component {
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
account
:
'
15928189723
'
,
pwd
:
'
123456
'
,
account
:
''
,
pwd
:
''
,
};
}
...
...
src/pages/Register/Register.tsx
View file @
2766a416
...
...
@@ -61,11 +61,11 @@ class Register extends Component {
constructor
(
props
:
IProps
)
{
super
(
props
);
this
.
state
=
{
name
:
'
姜雷
'
,
cellphone
:
'
18108096033
'
,
name
:
''
,
cellphone
:
''
,
vcode
:
''
,
pwd
:
'
123456
'
,
checkPwd
:
'
123456
'
,
pwd
:
''
,
checkPwd
:
''
,
sex
:
'1'
,
agree
:
false
,
showPwd
:
false
,
...
...
@@ -296,7 +296,7 @@ class Register extends Component {
<
Vcode
vcode
-
classname=
'registerBox-getVcode'
ref=
'Vcode'
onClickHandle=
{
this
.
getVcod
e
}
cellphone=
{
cellphon
e
}
/>
</
View
>
<
View
className=
'registerBox-title'
>
...
...
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