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
46a95b0c
提交
46a95b0c
authored
1月 10, 2023
作者:
wk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
项目详情未选择项目情况下 默认第一个
父级
ecfce872
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
170 行增加
和
4 行删除
+170
-4
pages/gallery/gallery.vue
+1
-1
pages/mine/projectInfo/projectInfo.vue
+169
-3
没有找到文件。
pages/gallery/gallery.vue
View file @
46a95b0c
...
@@ -473,7 +473,7 @@
...
@@ -473,7 +473,7 @@
}
}
.rq-image
{
.rq-image
{
width
:
2
2
rpx
;
width
:
2
4
rpx
;
height
:
16px
;
height
:
16px
;
margin
:
0
10
rpx
0
30
rpx
;
margin
:
0
10
rpx
0
30
rpx
;
}
}
...
...
pages/mine/projectInfo/projectInfo.vue
View file @
46a95b0c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<view
class=
"item-value"
></view>
<view
class=
"item-value"
></view>
</view>
</view>
<view
class=
"line"
></view>
<view
class=
"line"
></view>
<view
class=
"item"
>
<view
class=
"item"
@
click=
"showQrcode"
>
<view
class=
"item-name"
>
项目二维码:
</view>
<view
class=
"item-name"
>
项目二维码:
</view>
<view
class=
"item-value-blue"
>
二维码下载
</view>
<view
class=
"item-value-blue"
>
二维码下载
</view>
</view>
</view>
...
@@ -25,7 +25,8 @@
...
@@ -25,7 +25,8 @@
<view
class=
"line"
></view>
<view
class=
"line"
></view>
<view
class=
"item"
>
<view
class=
"item"
>
<view
class=
"item-name"
>
项目地址:
</view>
<view
class=
"item-name"
>
项目地址:
</view>
<view
class=
"item-value"
>
{{
project
.
province
}}{{
project
.
city
}}{{
project
.
area
}}
</view>
<view
class=
"item-value"
style=
"width: 488rpx;"
>
{{
project
.
province
}}{{
project
.
city
}}{{
project
.
area
}}
</view>
</view>
</view>
<view
class=
"line"
></view>
<view
class=
"line"
></view>
<view
class=
"item"
>
<view
class=
"item"
>
...
@@ -44,17 +45,33 @@
...
@@ -44,17 +45,33 @@
<view
class=
"item-value"
></view>
<view
class=
"item-value"
></view>
</view>
</view>
</view>
</view>
<view
class=
"model-view"
:style=
"showModal?'':'display:none;'"
>
<view
class=
"model-out-box"
>
<view
class=
"text-black-normal"
>
{{
curTitle
}}
</view>
<view
class=
"model-content"
>
<canvas
canvas-id=
"qrcode"
style=
"margin: 40rpx;"
></canvas>
</view>
<view
style=
"display: flex;flex-direction: row;width: 100%;"
>
<view
class=
"btn-dialog-grey"
@
click=
"cancel"
>
取消
</view>
<view
class=
"btn-dialog-blue"
@
click=
"saveQrcode"
>
保存图片
</view>
</view>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
uQRCode
from
"../../../common/Sansnn-uQRCode/uqrcode.js"
import
Api
from
"../../../api/api.js"
import
Api
from
"../../../api/api.js"
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
longitude
:
"122"
,
longitude
:
"122"
,
latitude
:
"36"
,
latitude
:
"36"
,
project
:
{}
project
:
{},
showModal
:
false
,
qrcodeSrc
:
""
,
curTitle
:
""
}
}
},
},
onLoad
()
{
onLoad
()
{
...
@@ -62,6 +79,8 @@
...
@@ -62,6 +79,8 @@
},
},
methods
:
{
methods
:
{
getProjectInfo
()
{
getProjectInfo
()
{
let
projectId
=
uni
.
getStorageSync
(
"project_id"
)
if
(
projectId
)
{
Api
.
getProjectInfo
({
Api
.
getProjectInfo
({
data
:
{
data
:
{
project_id
:
uni
.
getStorageSync
(
"project_id"
)
project_id
:
uni
.
getStorageSync
(
"project_id"
)
...
@@ -74,6 +93,95 @@
...
@@ -74,6 +93,95 @@
this
.
$toast
.
showToast
(
result
.
msg
)
this
.
$toast
.
showToast
(
result
.
msg
)
}
}
})
})
}
else
{
this
.
loadProject
()
}
},
loadProject
()
{
let
orgNo
=
uni
.
getStorageSync
(
"org_no"
)
if
(
orgNo
==
'001'
)
{
orgNo
=
""
}
Api
.
getProjectList
({
data
:
{
is_all
:
1
,
org_no
:
orgNo
}
}).
then
((
result
)
=>
{
console
.
log
(
"项目列表:"
,
result
);
if
(
result
.
code
===
0
)
{
this
.
projectList
=
result
.
data
.
list
this
.
project
=
this
.
projectList
[
0
]
}
else
{
this
.
$toast
.
showToast
(
result
.
msg
)
}
})
},
showQrcode
()
{
this
.
curTitle
=
this
.
project
.
project_name
this
.
showModal
=
true
this
.
$nextTick
(
function
()
{
this
.
cancvsQrcode
(
this
.
project
.
project_id
)
})
},
cancvsQrcode
(
text
)
{
uQRCode
.
make
({
canvasId
:
'qrcode'
,
componentInstance
:
this
,
text
:
text
,
size
:
160
,
margin
:
10
,
backgroundColor
:
'#ffffff'
,
foregroundColor
:
'#000000'
,
fileType
:
'jpg'
,
correctLevel
:
uQRCode
.
errorCorrectLevel
.
H
,
success
:
res
=>
{
console
.
log
(
res
)
this
.
qrcodeSrc
=
res
},
fail
:
error
=>
{
console
.
log
(
error
)
}
})
},
cancel
()
{
this
.
curTitle
=
""
this
.
showModal
=
false
},
saveQrcode
()
{
// #ifndef H5
this
.
save
(
this
.
qrcodeSrc
)
// #endif
// #ifdef H5
let
_t
=
this
;
uni
.
downloadFile
({
url
:
this
.
qrcodeSrc
,
success
:
(
res
)
=>
{
if
(
res
.
statusCode
===
200
)
{
let
file
=
res
.
tempFilePath
;
_t
.
save
(
file
)
}
}
});
// #endif
},
save
(
url
)
{
let
_this
=
this
;
uni
.
saveImageToPhotosAlbum
({
filePath
:
url
,
success
:
()
=>
{
uni
.
hideLoading
();
uni
.
showToast
({
title
:
"图片已保存到相册"
});
},
fail
:
()
=>
{
uni
.
hideLoading
();
uni
.
showToast
({
title
:
"图片保存失败"
});
}
});
}
}
}
}
}
}
...
@@ -168,5 +276,63 @@
...
@@ -168,5 +276,63 @@
}
}
}
}
}
.model-view
{
position
:
fixed
;
top
:
0
;
z-index
:
1
;
width
:
100%
;
height
:
100%
;
display
:
flex
;
justify-content
:
center
;
background-color
:
rgba
(
0
,
0
,
0
,
0.4
);
}
.model-out-box
{
width
:
600
rpx
;
height
:
600
rpx
;
background-color
:
#FFFFFF
;
border-radius
:
20
rpx
;
margin-top
:
45%
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
space-between
;
padding
:
32
rpx
0
0
0
;
align-items
:
center
;
}
.model-content
{
width
:
400
rpx
;
height
:
400
rpx
;
border-radius
:
10
rpx
;
background
:
#fff
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.btn-dialog-grey
{
display
:
flex
;
flex
:
1
;
height
:
100
rpx
;
font-size
:
32
rpx
;
color
:
#333333
;
align-items
:
center
;
border-top
:
2
rpx
solid
rgba
(
0
,
0
,
0
,
0.1
);
border-right
:
2
rpx
solid
rgba
(
0
,
0
,
0
,
0.1
);
justify-content
:
center
;
}
.btn-dialog-blue
{
display
:
flex
;
flex
:
1
;
height
:
100
rpx
;
font-size
:
32
rpx
;
color
:
#3B73FE
;
border-top
:
2
rpx
solid
rgba
(
0
,
0
,
0
,
0.1
);
align-items
:
center
;
justify-content
:
center
;
}
}
</
style
>
</
style
>
Write
Preview
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
Please
register
or
sign in
to comment