Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
Sign in / Register
Toggle navigation
S
site-uniapp
概览
Overview
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
王柯
site-uniapp
Commits
d4e9d1e6
提交
d4e9d1e6
authored
2月 17, 2023
作者:
wk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加汇筑questionAdd页面
父级
24551d7d
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
255 行增加
和
0 行删除
+255
-0
pages.json
+9
-0
pages/questionAdd/questionAdd.vue
+246
-0
没有找到文件。
pages.json
View file @
d4e9d1e6
...
@@ -546,6 +546,15 @@
...
@@ -546,6 +546,15 @@
}
}
}
}
,{
"path"
:
"pages/questionAdd/questionAdd"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
}
],
],
"globalStyle"
:
{
"globalStyle"
:
{
"navigationBarTextStyle"
:
"white"
,
"navigationBarTextStyle"
:
"white"
,
...
...
pages/questionAdd/questionAdd.vue
0 → 100644
View file @
d4e9d1e6
<
template
>
<view>
<view
class=
"info-box"
>
<view
class=
"flex-between"
>
<view
class=
"title"
><span
class=
"red"
>
*
</span>
问题标签
</view>
<picker
@
change=
"bindPickerChange"
:value=
"index"
:range=
"labelData"
range-key=
"labelMsg"
>
<view
class=
"uni-input"
>
{{
labelData
[
index
]
?
labelData
[
index
].
labelMsg
:
'请选择问题标签'
}}
</view>
</picker>
</view>
</view>
<view
class=
"info-box"
>
<view
class=
"flex-between"
>
<view
class=
"title"
><span
class=
"red"
>
*
</span>
标题
</view>
<input
class=
"text-right"
placeholder=
"请输入标题"
v-model=
"title"
/>
</view>
</view>
<view
class=
"info-box"
>
<view
class=
"title"
><span
class=
"red"
>
*
</span>
内容
</view>
<textarea
class=
"mar-top-10"
v-model=
"content"
placeholder=
"请输入内容"
/>
</view>
<view
class=
"info-box"
>
<view
class=
"title"
>
附件
</view>
<view
class=
"upload-body mar-top-10"
>
<view
class=
"upload-box"
v-for=
"(item, index) in fileList"
:key=
"index"
>
<image
:src=
"item.url"
mode=
"aspectFill"
></image>
<icon
@
click=
"handleClose(index)"
type=
"cancel"
size=
"20"
/>
</view>
<view
class=
"upload-box"
@
click=
"handlePic"
>
<span>
+
</span>
</view>
</view>
</view>
<view
class=
"bottom-button"
@
click=
"handleSave"
>
提交
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
// baseUrl: 'https://cwcd-h5.huizhucloud.com/api', // 测试环境接口
baseUrl
:
'https://gdt-front-mobile.hibuilding.cn/api'
,
// 生产环境接口
projectId
:
''
,
token
:
''
,
labelData
:
[],
index
:
''
,
title
:
''
,
content
:
''
,
attath
:
[],
fileList
:
[],
}
},
onLoad
(
option
)
{
console
.
log
(
'option'
,
option
)
const
{
projectId
,
token
}
=
option
this
.
projectId
=
projectId
this
.
token
=
token
this
.
getLabelData
()
},
methods
:
{
getLabelData
:
function
()
{
uni
.
request
({
url
:
`
${
this
.
baseUrl
}
/macro-cwcd/problemLabel/setting/list`
,
data
:
{},
header
:
{
'Macro-Auth'
:
this
.
token
//自定义请求头信息
},
success
:
(
res
)
=>
{
console
.
log
(
res
.
data
.
data
);
this
.
labelData
=
res
.
data
.
data
}
});
},
bindPickerChange
:
function
(
e
)
{
this
.
index
=
e
.
detail
.
value
},
handlePic
:
function
()
{
uni
.
chooseImage
({
success
:
(
chooseImageRes
)
=>
{
const
tempFilePaths
=
chooseImageRes
.
tempFilePaths
;
uni
.
uploadFile
({
url
:
`
${
this
.
baseUrl
}
/macro-resource/filesys/upload`
,
filePath
:
tempFilePaths
[
0
],
name
:
'file'
,
formData
:
{
'user'
:
'test'
},
header
:
{
'Macro-Auth'
:
this
.
token
//自定义请求头信息
},
success
:
(
uploadFileRes
)
=>
{
console
.
log
(
uploadFileRes
);
const
data
=
JSON
.
parse
(
uploadFileRes
.
data
).
data
console
.
log
(
data
);
this
.
fileList
=
[...
this
.
fileList
].
concat
([{
url
:
data
.
fileUrl
,
id
:
data
.
fileId
}])
}
});
}
});
},
handleClose
:
function
(
index
)
{
const
temp
=
[]
this
.
fileList
.
map
((
item
,
aindex
)
=>
{
if
(
index
!=
aindex
)
temp
.
push
(
item
)
})
this
.
fileList
=
temp
},
handleSave
:
function
()
{
const
label
=
this
.
labelData
[
this
.
index
]
?
this
.
labelData
[
this
.
index
].
label
:
''
const
attach
=
this
.
fileList
.
map
(
item
=>
item
.
id
)
if
(
!
label
||
!
this
.
title
||
!
this
.
content
)
{
uni
.
showToast
({
title
:
'请完善信息!'
,
icon
:
'error'
})
return
}
console
.
log
(
'label'
,
label
)
uni
.
request
({
url
:
`
${
this
.
baseUrl
}
/macro-cwcd/problemFeedback/worker/create`
,
method
:
'POST'
,
data
:
{
label
:
parseInt
(
label
),
title
:
this
.
title
,
content
:
this
.
content
,
attach
:
attach
.
join
(
','
),
projectId
:
this
.
projectId
},
header
:
{
'Macro-Auth'
:
this
.
token
//自定义请求头信息
},
success
:
(
res
)
=>
{
console
.
log
(
'create-httpCode'
,
res
.
data
.
httpCode
);
if
(
res
.
data
.
httpCode
===
200
)
{
/* */
uni
.
navigateBack
()
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
sys_msg
,
icon
:
'error'
})
}
}
});
}
}
}
</
script
>
<
style
lang=
"scss"
>
page
{
background
:
#f5f5f5
;
}
.flex-between
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
}
.flex-start
{
display
:
flex
;
justify-content
:
flex-start
;
}
.text-right
{
text-align
:
right
;
}
.info-box
{
background
:
#fff
;
//
border-radius
:
16
rpx
;
padding
:
20
rpx
;
font-size
:
28
rpx
;
margin-top
:
30
rpx
;
position
:
relative
;
color
:
#656565
;
.red
{
color
:
#FF3141
}
.title
{
color
:
#333
;
}
.mar-top-10
{
margin-top
:
20
rpx
;
}
.upload-body
{
display
:
flex
;
justify-content
:
flex-start
;
.upload-box
{
width
:
160
rpx
;
height
:
160
rpx
;
color
:
#dcdee0
;
background-color
:
#f7f8fa
;
//
line-height
:
160
rpx
;
text-align
:
center
;
font-size
:
60
rpx
;
margin-right
:
20
rpx
;
position
:
relative
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
image
{
width
:
100%
;
height
:
100%
;
}
icon
{
position
:
absolute
;
right
:
0px
;
top
:
0px
;
}
}
}
}
.bottom-button
{
position
:
fixed
;
bottom
:
0
rpx
;
width
:
100%
;
height
:
96
rpx
;
background
:
#3b73fe
;
text-align
:
center
;
color
:
#fff
;
line-height
:
96
rpx
;
font-size
:
32
rpx
;
left
:
0
;
}
</
style
>
Write
Preview
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
Please
register
or
sign in
to comment