Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DAO实验室
DAO项目提案工具
提交
7e96d282
D
DAO项目提案工具
项目概览
DAO实验室
/
DAO项目提案工具
通知
6
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DAO项目提案工具
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
7e96d282
编写于
7月 10, 2022
作者:
L
lumin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完善海报逻辑
上级
84feb68e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
51 addition
and
13 deletion
+51
-13
cloudfunctions/project/qrcode/create.js
cloudfunctions/project/qrcode/create.js
+1
-0
miniprogram/pages/detail/create.js
miniprogram/pages/detail/create.js
+9
-6
miniprogram/pages/detail/detail.js
miniprogram/pages/detail/detail.js
+40
-6
miniprogram/pages/template/modal/addwx.wxml
miniprogram/pages/template/modal/addwx.wxml
+1
-1
未找到文件。
cloudfunctions/project/qrcode/create.js
浏览文件 @
7e96d282
...
...
@@ -13,6 +13,7 @@ exports.createQrcode = async (event, context) => {
scene
:
event
.
scene
,
page
:
event
.
page
})
// if (result && result.buffer) {
// var res = await cloud.uploadFile({
// cloudPath: fileName,
...
...
miniprogram/pages/detail/create.js
浏览文件 @
7e96d282
...
...
@@ -5,7 +5,7 @@ export default class Create {
that
.
setData
({
'
posterParams.width
'
:
`660rpx`
,
'
posterParams.height
'
:
`1080rpx`
,
'
posterParams.background
'
:
'
#
eee
'
,
'
posterParams.background
'
:
'
#
fff
'
,
});
// console.log(rects);
let
views
=
[
...
...
@@ -51,12 +51,15 @@ export default class Create {
{
id
:
'
qrcode
'
,
type
:
"
image
"
,
url
:
`
${
that
.
data
.
project
.
users
[
0
].
userInfo
.
avatarUrl
}
`
,
url
:
`
${
that
.
data
.
qrcode
}
`
,
css
:
{
top
:
"
340rpx
"
,
left
:
"
90rpx
"
,
width
:
"
460rpx
"
,
height
:
"
460rpx
"
,
top
:
"
370rpx
"
,
left
:
"
120rpx
"
,
width
:
"
400rpx
"
,
height
:
"
400rpx
"
,
// borderWidth: '2rpx',
// borderColor: 'black',
// borderStyle: 'dashed',
},
},
{
...
...
miniprogram/pages/detail/detail.js
浏览文件 @
7e96d282
...
...
@@ -47,7 +47,6 @@ Page({
enrollUser
:[],
posterParams
:{}
})
this
.
createQrcode
();
this
.
loadProject
(
projectId
);
this
.
loadEnrolls
();
},
...
...
@@ -72,10 +71,9 @@ Page({
})
}
// 查询元素
setTimeout
(()
=>
{
new
posterFactory
().
setPosterParams
(
that
);
},
0
);
that
.
createQrcode
();
}).
catch
(
err
=>
{
console
.
log
(
'
err:
'
,
err
)
})
...
...
@@ -92,7 +90,20 @@ Page({
}
}).
then
(
res
=>
{
console
.
log
(
'
cloud res:
'
,
res
)
// that.setData({
// qrcode:res.result.result.buffer
// })
console
.
log
(
res
.
result
.
result
.
buffer
);
that
.
getQRCodeImg
(
res
.
result
.
result
.
buffer
,
function
(
res
){
console
.
log
(
that
.
data
);
that
.
setData
({
qrcode
:
res
})
// 查询元素
setTimeout
(()
=>
{
new
posterFactory
().
setPosterParams
(
that
);
},
0
);
});
}).
catch
(
err
=>
{
console
.
log
(
'
err:
'
,
err
)
})
...
...
@@ -140,6 +151,29 @@ Page({
})
},
/** 将小程序码的ArrayBuffer转换成临时图片路径 */
getQRCodeImg
(
arrayBuffer
,
callback
)
{
const
fs
=
wx
.
getFileSystemManager
()
// 获取文件管理器实例
const
filePath
=
wx
.
env
.
USER_DATA_PATH
+
"
/
"
+
this
.
data
.
projectId
+
"
.jpg
"
// 临时路径
// 将arrayBuffer写入缓存中,并返回文件路径
// return new Promise((resolve, reject) => {
fs
.
writeFile
({
filePath
:
filePath
,
data
:
arrayBuffer
,
encoding
:
'
base64
'
,
success
(
res
)
{
console
.
log
(
res
);
console
.
log
(
filePath
);
callback
(
filePath
)
},
fail
(
err
)
{
console
.
log
(
'
getQRCodeImgErr ---
'
,
err
)
}
})
// })
},
addEnroll
:
function
(){
let
that
=
this
;
wx
.
cloud
.
callFunction
({
...
...
miniprogram/pages/template/modal/addwx.wxml
浏览文件 @
7e96d282
<view class="cu-modal
show
{{modalName=='addwx'?'show':''}}">
<view class="cu-modal {{modalName=='addwx'?'show':''}}">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">添加好友</view>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录