Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
longhui_app
Project
Project
Details
Activity
Releases
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
杨硕
longhui_app
Commits
82bbaf4b
Commit
82bbaf4b
authored
Jun 21, 2023
by
高宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
投诉建议
parent
74bbb19c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
26 deletions
+105
-26
complaint.js
api/complaint/complaint.js
+13
-0
data.js
api/system/dict/data.js
+9
-0
index.vue
my/complaint/index.vue
+82
-25
picker.js
uni_modules/uview-ui/libs/config/props/picker.js
+1
-1
No files found.
api/complaint/complaint.js
0 → 100644
View file @
82bbaf4b
import
request
from
"../../utils/request"
;
// 添加投诉建议信息
export
function
addComplaint
(
data
)
{
return
request
({
url
:
'/system/ComplaintSuggestion/add'
,
method
:
'post'
,
data
,
headers
:
{
'Content-Type'
:
'application/json;charset=UTF-8'
}
})
}
\ No newline at end of file
api/system/dict/data.js
0 → 100644
View file @
82bbaf4b
import
request
from
'@/utils/request'
// 根据字典类型查询字典数据信息
export
function
getDicts
(
dictType
)
{
return
request
({
url
:
'/system/dict/data/type/'
+
dictType
,
method
:
'get'
})
}
\ No newline at end of file
my/complaint/index.vue
View file @
82bbaf4b
<
template
>
<
template
>
<view
class=
"complaint"
>
<view
class=
"complaint"
>
<view
class=
"complaint-form"
>
<view
class=
"complaint-form"
>
<u--form
labelWidth=
"160"
:model=
"
model1"
ref=
"uForm"
class=
"complaint-form
"
>
<u--form
labelWidth=
"160"
:model=
"
form"
ref=
"uForm"
class=
"complaint-form"
:rules=
"rules
"
>
<u-form-item
label=
"投诉标题"
prop=
"
userInfo.name"
borderBottom
ref=
"item1"
required=
"true"
labelWidth=
"160"
<u-form-item
label=
"投诉标题"
prop=
"
title"
borderBottom
required=
"true"
labelWidth=
"160"
labelPosition=
"top"
>
labelPosition=
"top"
>
<u--input
placeholder=
"请输入投诉标题"
v-model=
"model1
.title"
border=
"none"
></u--input>
<u--input
placeholder=
"请输入投诉标题"
:maxlength=
"30"
v-model=
"form
.title"
border=
"none"
></u--input>
</u-form-item>
</u-form-item>
<u-form-item
label=
"投诉类型"
prop=
"
userInfo.sex
"
borderBottom
required=
"true"
labelWidth=
"160"
<u-form-item
label=
"投诉类型"
prop=
"
type
"
borderBottom
required=
"true"
labelWidth=
"160"
labelPosition=
"top"
@
click=
"show = true; hideKeyboard()"
>
labelPosition=
"top"
@
click=
"show = true; hideKeyboard()"
>
<u--input
v-model=
"
model1.type
"
placeholder=
"请选择投诉类型"
border=
"none"
readonly
></u--input>
<u--input
v-model=
"
form.typeLabel
"
placeholder=
"请选择投诉类型"
border=
"none"
readonly
></u--input>
<u-icon
slot=
"right"
name=
"arrow-right"
></u-icon>
<u-icon
slot=
"right"
name=
"arrow-right"
></u-icon>
</u-form-item>
</u-form-item>
<u-form-item
label=
"投诉内容"
prop=
"
userInfo.name"
borderBottom
ref=
"item1"
required=
"true"
labelWidth=
"160"
<u-form-item
label=
"投诉内容"
prop=
"
details"
borderBottom
required=
"true"
labelWidth=
"160"
labelPosition=
"top"
>
labelPosition=
"top"
>
<u--input
placeholder=
"请输入投诉内容"
v-model=
"model1.message
"
border=
"none"
></u--input>
<u--input
placeholder=
"请输入投诉内容"
:maxlength=
"30"
v-model=
"form.details
"
border=
"none"
></u--input>
</u-form-item>
</u-form-item>
<u-form-item
label=
"联系方式"
prop=
"
userInfo.name"
borderBottom
ref=
"item1
"
labelWidth=
"160"
<u-form-item
label=
"联系方式"
prop=
"
phone"
borderBottom
required=
"true
"
labelWidth=
"160"
labelPosition=
"top"
>
labelPosition=
"top"
>
<u--input
placeholder=
"请输入联系方式"
v-model=
"model1
.phone"
border=
"none"
></u--input>
<u--input
placeholder=
"请输入联系方式"
:maxlength=
"11"
v-model=
"form
.phone"
border=
"none"
></u--input>
</u-form-item>
</u-form-item>
</u--form>
</u--form>
</view>
</view>
<view
class=
"bottom-button"
>
<view
class=
"bottom-button"
>
<view
class=
"button"
>
提交
</view>
<view
class=
"button"
@
click=
"sumit"
>
提交
</view>
</view>
</view>
<u-picker
:show=
"show"
:columns=
"columns"
@
cancel=
"cancel"
@
confirm=
"confirm"
></u-picker>
<u-picker
:show=
"show"
:columns=
"columns"
@
cancel=
"cancel"
@
confirm=
"confirm"
></u-picker>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
addComplaint
}
from
"../../api/complaint/complaint"
;
import
{
getDicts
}
from
"../../api/system/dict/data"
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
showSex
:
false
,
showSex
:
false
,
model1
:
{
form
:
{
title
:
''
,
title
:
''
,
type
:
''
,
type
:
''
,
message
:
''
,
typeLabel
:
''
,
details
:
''
,
phone
:
''
phone
:
''
},
},
show
:
false
,
show
:
false
,
// 存字典中对应字段
list
:[],
columns
:
[
columns
:
[
[
'中国'
,
'美国'
,
'日本'
]
[]
],
],
rules
:
{
rules
:
{
'
userInfo.nam
e'
:
{
'
titl
e'
:
{
type
:
'string'
,
type
:
'string'
,
required
:
true
,
required
:
true
,
message
:
'请填写姓名'
,
message
:
'请输入投诉标题'
,
trigger
:
'blur'
},
'type'
:
{
type
:
'string'
,
required
:
true
,
message
:
'请选择投诉类型'
,
trigger
:
[
'blur'
,
'change'
]
},
'details'
:
{
type
:
'string'
,
required
:
true
,
message
:
'请输入投诉内容'
,
trigger
:
[
'blur'
,
'change'
]
trigger
:
[
'blur'
,
'change'
]
},
},
'
userInfo.sex
'
:
{
'
phone
'
:
{
type
:
'string'
,
type
:
'string'
,
max
:
1
,
required
:
true
,
required
:
true
,
message
:
'请选择男或女'
,
pattern
:
/^1
[
3-9
]\d{9}
$/
,
message
:
'请输入正确联系方式'
,
trigger
:
[
'blur'
,
'change'
]
trigger
:
[
'blur'
,
'change'
]
},
},
},
},
...
@@ -63,6 +80,40 @@
...
@@ -63,6 +80,40 @@
};
};
},
},
methods
:
{
methods
:
{
sumit
(){
console
.
log
(
'form'
,
this
.
form
)
this
.
$refs
.
uForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
addComplaint
(
this
.
form
).
then
(
res
=>
{
console
.
log
(
'res'
,
res
)
if
(
res
.
code
===
200
)
{
uni
.
showToast
({
title
:
'投诉建议成功'
,
icon
:
'success'
})
this
.
$tab
.
navigateTo
(
'/pages/mine/index'
)
}
})
}
});
},
getAllDict
(){
getDicts
(
'complaintType'
).
then
(
res
=>
{
console
.
log
(
'投诉类型'
,
res
)
// this.columns = res.data
this
.
list
=
res
.
data
.
map
(
item
=>
{
return
{
label
:
item
.
dictLabel
,
value
:
item
.
dictValue
}
})
this
.
columns
[
0
]
=
[]
for
(
var
i
=
0
;
i
<
this
.
list
.
length
;
i
++
){
this
.
columns
[
0
].
push
(
this
.
list
[
i
].
label
)
}
console
.
log
(
'columns'
,
this
.
columns
)
})
},
hideKeyboard
()
{
hideKeyboard
()
{
uni
.
hideKeyboard
()
uni
.
hideKeyboard
()
},
},
...
@@ -71,22 +122,28 @@
...
@@ -71,22 +122,28 @@
},
},
confirm
(
res
){
confirm
(
res
){
console
.
log
(
"res"
,
res
)
console
.
log
(
"res"
,
res
)
this
.
model1
.
type
=
res
.
value
for
(
var
i
=
0
;
i
<
this
.
list
.
length
;
i
++
){
if
(
this
.
list
[
i
].
label
===
res
.
value
[
0
]){
this
.
form
.
type
=
this
.
list
[
i
].
value
}
}
this
.
form
.
typeLabel
=
res
.
value
this
.
show
=
false
this
.
show
=
false
},
},
sexSelect
(
e
)
{
this
.
model1
.
userInfo
.
sex
=
e
.
name
this
.
$refs
.
uForm
.
validateField
(
'userInfo.sex'
)
},
},
},
onReady
()
{
onReady
()
{
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
//
this.$refs.uForm.setRules(this.rules)
this
.
$refs
.
uForm
.
setRules
(
this
.
rules
)
},
},
onLoad
()
{
this
.
getAllDict
()
}
};
};
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.complaint
{
.complaint
{
background
:
#F5F5F5
;
background
:
#F5F5F5
;
min-height
:
100vh
;
min-height
:
100vh
;
...
@@ -102,7 +159,7 @@
...
@@ -102,7 +159,7 @@
/
deep
/
.u-form-item__body
{
/
deep
/
.u-form-item__body
{
padding
:
42rpx
0
!
important
;
padding
:
42rpx
0
!
important
;
}
}
/
deep
/
.u-form-item__body__left
{
/
deep
/
.u-form-item__body__left
{
margin-bottom
:
40rpx
!
important
;
margin-bottom
:
40rpx
!
important
;
}
}
...
...
uni_modules/uview-ui/libs/config/props/picker.js
View file @
82bbaf4b
...
@@ -19,7 +19,7 @@ export default {
...
@@ -19,7 +19,7 @@ export default {
cancelText
:
'取消'
,
cancelText
:
'取消'
,
confirmText
:
'确定'
,
confirmText
:
'确定'
,
cancelColor
:
'#909193'
,
cancelColor
:
'#909193'
,
confirmColor
:
'#
3c9cff
'
,
confirmColor
:
'#
D84848
'
,
visibleItemCount
:
5
,
visibleItemCount
:
5
,
keyName
:
'text'
,
keyName
:
'text'
,
closeOnClickOverlay
:
false
,
closeOnClickOverlay
:
false
,
...
...
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