Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
comment_app
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
莫晓莉
comment_app
Commits
627840de
Commit
627840de
authored
Sep 19, 2020
by
莫晓莉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mxl
parent
16f7059d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
114 additions
and
39 deletions
+114
-39
api/login.js
+1
-1
pages/evaluate/evaluate.css
+11
-2
pages/evaluate/evaluate.vue
+63
-29
pages/main/main.vue
+33
-6
pages/user/user.vue
+1
-0
utils/etc.js
+2
-1
utils/request.js
+3
-0
No files found.
api/login.js
View file @
627840de
...
@@ -32,7 +32,7 @@ export const applyProject = (data) => {
...
@@ -32,7 +32,7 @@ export const applyProject = (data) => {
//意见反馈
//意见反馈
export
const
satisfactionEvaluation
=
(
data
)
=>
{
export
const
satisfactionEvaluation
=
(
data
)
=>
{
return
request
(
'satisfactionEvaluation'
,
data
)
return
request
(
'satisfactionEvaluation'
,
data
,
'POST'
)
}
}
//获取已审批的项目
//获取已审批的项目
...
...
pages/evaluate/evaluate.css
View file @
627840de
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
margin-top
:
25
upx
;
margin-top
:
25
upx
;
border
:
1
upx
solid
#ccc
;
border
:
1
upx
solid
#ccc
;
padding
:
15
upx
;
padding
:
15
upx
;
font-size
:
25
upx
;
font-size
:
30
upx
;
width
:
100%
;
width
:
100%
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
}
}
...
@@ -87,6 +87,8 @@
...
@@ -87,6 +87,8 @@
/* margin-right: 25upx;
/* margin-right: 25upx;
margin-bottom: 15upx; */
margin-bottom: 15upx; */
margin
:
10
upx
;
margin
:
10
upx
;
/* border:1upx soild #ccc;
box-sizing: border-box; */
}
}
.imgs-area
.add-box
{
.imgs-area
.add-box
{
...
@@ -94,7 +96,7 @@
...
@@ -94,7 +96,7 @@
box-sizing
:
border-box
;
box-sizing
:
border-box
;
font-size
:
25
upx
;
font-size
:
25
upx
;
/* padding-top: 30upx; */
/* padding-top: 30upx; */
/* border: 1upx solid #ccc; */
border
:
1
upx
solid
#ccc
;
background
:
#F4F7F8
;
background
:
#F4F7F8
;
width
:
200
upx
;
width
:
200
upx
;
height
:
200
upx
;
height
:
200
upx
;
...
@@ -265,4 +267,11 @@
...
@@ -265,4 +267,11 @@
margin
:
20
upx
;
margin
:
20
upx
;
font-size
:
55
upx
;
font-size
:
55
upx
;
}
}
.trangle
{
display
:
inline-block
;
border-top
:
15
upx
solid
;
border-right
:
8
upx
solid
;
border-left
:
8
upx
solid
;
border-color
:
black
transparent
transparent
transparent
;
}
/***************************************** */
/***************************************** */
pages/evaluate/evaluate.vue
View file @
627840de
...
@@ -24,11 +24,21 @@
...
@@ -24,11 +24,21 @@
</view>
</view>
</view>
-->
</view>
-->
<view
class=
"category-title"
>
反馈项目
<text
style=
"color:red;"
>
*
</text>
</view>
<picker
style=
"border:1upx solid #ccc;"
@
change=
"proChange"
:value=
"projectTypeIndex"
:range=
"projectTypeList"
range-key=
"projectName"
>
<view
class=
"flex-a-c"
style=
"height:80upx;line-height: 80upx;padding:0 25upx;"
>
<view
class=
"flex1 picker-content"
>
{{
projectTypeIndex
>-
1
?
projectTypeList
[
projectTypeIndex
].
projectName
:
'点击选择'
}}
</view>
<view
class=
"trangle"
></view>
</view>
</picker>
<view
class=
"category-title"
>
<view
class=
"category-title"
>
反馈内容
<text
style=
"color:red;"
>
*
</text>
反馈内容
<text
style=
"color:red;"
>
*
</text>
</view>
</view>
<textarea
v-model=
"evaluationForm.remark"
class=
"suggest-area"
placeholder=
"请详细描述您的问题或建议"
name=
"content"
></textarea>
<textarea
v-model=
"evaluationForm.remark"
class=
"suggest-area"
placeholder=
"请详细描述您的问题或建议"
name=
"content"
></textarea>
<view
class=
"category-title"
>
<view
class=
"category-title"
>
上传图片
上传图片
...
@@ -36,9 +46,9 @@
...
@@ -36,9 +46,9 @@
</view>
</view>
<view
class=
"imgs-area"
>
<view
class=
"imgs-area"
>
<view
class=
"img-box"
v-for=
"(item,index) in image
List
"
:key=
"index"
>
<view
class=
"img-box"
v-for=
"(item,index) in image
Url
"
:key=
"index"
>
<image
class=
"pic"
:src=
"item"
@
tap=
"previewPictures(item)"
/>
<image
class=
"pic"
:src=
"item"
@
tap=
"previewPictures(item)"
/>
<image
@
click=
"del(index)"
class=
"delete-icon"
src=
"../../static/comment/delete.png"
/>
<image
@
click=
"del(index)"
class=
"delete-icon"
src=
"../../static/comment/delete.png"
/>
</view>
</view>
<view
class=
"flex-ac-jc add-box"
@
click=
"uploadPictures"
>
<view
class=
"flex-ac-jc add-box"
@
click=
"uploadPictures"
>
<image
class=
"add-btn"
style=
''
src=
'../../static/comment/add-icon.png'
></image>
<image
class=
"add-btn"
style=
''
src=
'../../static/comment/add-icon.png'
></image>
...
@@ -49,18 +59,23 @@
...
@@ -49,18 +59,23 @@
<view>
<view>
<view
class=
"btns-area"
>
<view
class=
"btns-area"
>
<button
class=
"send-btn flex-ac-jc"
>
提交反馈
</button>
<button
@
click=
"satisfactionEvaluation"
class=
"send-btn flex-ac-jc"
>
提交反馈
</button>
<button
class=
"cancel-btn flex-ac-jc"
>
取 消
</button>
<button
@
click=
"back"
class=
"cancel-btn flex-ac-jc"
>
取 消
</button>
</view>
</view>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
satisfactionEvaluation
}
from
"@/api/login"
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
imageList
:
[],
projectId
:
0
,
evaluationForm
:
{},
imageUrl
:
[],
//
starsList
:
[{
starsList
:
[{
id
:
1
,
id
:
1
,
content
:
"★"
,
content
:
"★"
,
...
@@ -111,40 +126,41 @@
...
@@ -111,40 +126,41 @@
// }
// }
// ],
// ],
starLevel
:
[
starLevel
:
[{
{
level
:
1
,
level
:
1
,
name
:
"不满意"
,
name
:
"不满意"
,
face
:
"../../static/comment/level1.png"
face
:
"../../static/comment/level1.png"
},
},
{
{
level
:
2
,
level
:
2
,
name
:
"较不满意"
,
name
:
"较不满意"
,
face
:
"../../static/comment/level2.png"
face
:
"../../static/comment/level2.png"
},
},
{
{
level
:
3
,
level
:
3
,
name
:
"一般"
,
name
:
"一般"
,
face
:
"../../static/comment/level3.png"
face
:
"../../static/comment/level3.png"
},
},
{
{
level
:
4
,
level
:
4
,
name
:
"较满意"
,
name
:
"较满意"
,
face
:
"../../static/comment/level4.png"
face
:
"../../static/comment/level4.png"
},
},
{
{
level
:
5
,
level
:
5
,
name
:
"很满意"
,
name
:
"很满意"
,
face
:
"../../static/comment/praise.png"
face
:
"../../static/comment/praise.png"
},
},
],
],
cur_starLevel
:
0
cur_starLevel
:
0
}
}
},
},
methods
:
{
methods
:
{
// uni-app上传图片
uploadPictures
()
{
uploadPictures
()
{
var
that
=
this
;
uni
.
chooseImage
({
uni
.
chooseImage
({
count
:
6
,
//默认9
count
:
6
,
//默认9
sizeType
:
[
'original'
,
'compressed'
],
//可以指定是原图还是压缩图,默认二者都有
sizeType
:
[
'original'
,
'compressed'
],
//可以指定是原图还是压缩图,默认二者都有
...
@@ -152,22 +168,41 @@
...
@@ -152,22 +168,41 @@
success
:
res
=>
{
success
:
res
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
// 将选择的本地图片赋值给data中定义的images变量
// 将选择的本地图片赋值给data中定义的images变量
this
.
imageList
=
this
.
imageList
.
concat
(
res
.
tempFilePaths
);
// Start
console
.
log
(
this
.
imageList
)
var
tempFilePaths
=
res
.
tempFilePaths
;
tempFilePaths
.
forEach
(
item
=>
{
this
.
urlTobase64
(
item
);
});
// end
}
}
})
})
},
},
urlTobase64
(
url
)
{
var
that
=
this
;
uni
.
request
({
url
:
url
,
method
:
'GET'
,
responseType
:
'arraybuffer'
,
success
:
res
=>
{
let
base64
=
uni
.
arrayBufferToBase64
(
res
.
data
);
//把arraybuffer转成base64
base64
=
'data:image/jpeg;base64,'
+
base64
;
//不加上这串字符,在页面无法显示
that
.
imageUrl
=
that
.
imageUrl
.
concat
(
base64
);
that
.
evaluationForm
.
imageUrl
=
that
.
imageUrl
;
}
});
},
/*
/*
图片预览
图片预览
*/
*/
previewPictures
(
item
)
{
previewPictures
(
item
)
{
uni
.
previewImage
({
uni
.
previewImage
({
current
:
item
,
current
:
item
,
urls
:
this
.
image
List
urls
:
this
.
image
Url
})
})
},
},
del
(
index
){
del
(
index
)
{
this
.
image
List
.
splice
(
index
,
1
)
this
.
image
Url
.
splice
(
index
,
1
)
},
},
selStar
(
e
)
{
selStar
(
e
)
{
...
@@ -178,27 +213,26 @@
...
@@ -178,27 +213,26 @@
list
[
i
].
selected
=
i
<
idx
?
true
:
false
;
list
[
i
].
selected
=
i
<
idx
?
true
:
false
;
}
}
this
.
starsList
=
list
;
this
.
starsList
=
list
;
this
.
cur_starLevel
=
idx
-
1
;
this
.
cur_starLevel
=
idx
-
1
;
},
},
// 提交反馈
// 提交反馈
//申请服务
satisfactionEvaluation
()
{
satisfactionEvaluation
()
{
if
(
this
.
evaluationForm
.
remark
==
undefined
)
{
if
(
this
.
evaluationForm
.
remark
==
undefined
)
{
uni
.
showToast
({
uni
.
showToast
({
icon
:
'none'
,
icon
:
'none'
,
title
:
'请输入反馈内容'
title
:
'请输入反馈内容'
});
});
return
;
return
;
}
}
if
(
this
.
disableLevelIndex
==-
1
)
{
if
(
this
.
imageUrl
.
length
==
0
)
{
uni
.
showToast
({
uni
.
showToast
({
icon
:
'none'
,
icon
:
'none'
,
title
:
'请上传照片'
title
:
'请上传照片'
});
});
return
;
return
;
}
}
satisfactionEvaluation
(
this
.
evaluationForm
).
then
(
res
=>
{
satisfactionEvaluation
(
JSON
.
stringify
(
this
.
evaluationForm
)
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
uni
.
showToast
({
uni
.
showToast
({
icon
:
'success'
,
icon
:
'success'
,
...
@@ -213,8 +247,8 @@
...
@@ -213,8 +247,8 @@
})
})
},
},
}
}
}
}
</
script
>
</
script
>
<
style
>
<
style
>
...
...
pages/main/main.vue
View file @
627840de
...
@@ -34,12 +34,39 @@
...
@@ -34,12 +34,39 @@
export
default
{
export
default
{
onLoad
:
function
()
{
onLoad
:
function
()
{
const
token
=
uni
.
getStorageSync
(
'token'
)
const
token
=
uni
.
getStorageSync
(
'token'
);
console
.
log
(
token
);
const
user
=
uni
.
getStorageSync
(
'user'
);
if
(
token
){
uni
.
setStorageSync
(
'token'
,
token
);
uni
.
switchTab
({
console
.
log
(
"token="
,
token
);
url
:
'/pages/login/login'
console
.
log
(
"user="
,
user
);
})
if
(
!
token
){
// uni.switchTab({
// url:'/pages/login/login'
// })
uni
.
showModal
({
title
:
'未登录'
,
content
:
'您未登录,需要登录后才能继续'
,
/**
* 如果需要强制登录,不显示取消按钮
*/
showCancel
:
!
this
.
forcedLogin
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
/**
* 如果需要强制登录,使用reLaunch方式
*/
if
(
this
.
forcedLogin
)
{
uni
.
reLaunch
({
url
:
'../login/login'
});
}
else
{
uni
.
navigateTo
({
url
:
'../login/login'
});
}
}
}
});
}
}
// getUserByToken().then(res=>{
// getUserByToken().then(res=>{
...
...
pages/user/user.vue
View file @
627840de
...
@@ -116,6 +116,7 @@
...
@@ -116,6 +116,7 @@
},
},
onShow
()
{
onShow
()
{
// this.mylike();
// this.mylike();
},
},
methods
:
{
methods
:
{
// ...mapMutations(['logout']),
// ...mapMutations(['logout']),
...
...
utils/etc.js
View file @
627840de
export
default
{
export
default
{
baseURL
:
'http://192.168.7.122:9
100
'
,
//接口请求地址
baseURL
:
'http://192.168.7.122:9
888/API-SERVER
'
,
//接口请求地址
fileURL
:
'http://192.168.7.122:9100'
//文件请求地址
fileURL
:
'http://192.168.7.122:9100'
//文件请求地址
}
}
\ No newline at end of file
utils/request.js
View file @
627840de
...
@@ -12,6 +12,9 @@ let req = (method, p, reqMethod) => {
...
@@ -12,6 +12,9 @@ let req = (method, p, reqMethod) => {
uni
.
request
({
uni
.
request
({
url
:
etc
.
baseURL
+
url
,
url
:
etc
.
baseURL
+
url
,
method
:
reqMethod
||
'GET'
,
method
:
reqMethod
||
'GET'
,
header
:
{
'Content-Type'
:
reqMethod
==
"POST"
?
'application/x-www-form-urlencoded'
:
'application/json'
},
data
:
{
data
:
{
p
:
p
?
p
:
{}
p
:
p
?
p
:
{}
},
},
...
...
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