Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 2675e99c
authored
Nov 18, 2022
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
bug修复中
1 parent
33266a7b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
56 deletions
components/CrowdfundPoster/CrowdfundPoster.js
packagesList/mineDetail/pages/messageBox.js
packagesList/mineDetail/pages/messageBox.wxml
packagesList/packageOutput/components/outputCrowdfund/outputCrowdfund.json
components/CrowdfundPoster/CrowdfundPoster.js
View file @
2675e99
...
...
@@ -9,22 +9,23 @@ Component({
item
:
{
type
:
Object
,
observer
(
n
)
{
this
.
check
(
n
)
.
then
(
res
=>
{
if
(
res
)
this
.
setData
({
poster
:
res
,
show
:
true
})
else
this
.
begin
()
})
.
catch
(()
=>
this
.
begin
())
n
.
posterUrl
&&
this
.
checkUrl
()
// this.check(n)
// .then(res => {
// if (res)
// this.setData({
// poster: res,
// show: true
// })
// else this.begin()
// })
// .catch(() => this.begin())
}
},
findKey
:
{
type
:
String
,
value
:
'activityId
'
},
//
findKey: {
//
type: String,
// value: 'url
'
//
},
scrollImg
:
{
type
:
Boolean
,
value
:
true
...
...
@@ -35,13 +36,49 @@ Component({
* 组件的初始数据
*/
data
:
{
_item_
:
null
_item_
:
null
,
findKey
:
'urlLink'
},
/**
* 组件的方法列表
*/
methods
:
{
checkUrl
()
{
let
{
item
}
=
this
.
data
const
fileList
=
wx
.
$storage
.
get
(
'fileList'
)
||
[],
fn
=
wx
.
getFileSystemManager
(),
{
findKey
}
=
this
.
data
// url
// return new Promise((resolve, reject) => {
if
(
fileList
.
length
)
{
fn
.
readdir
({
dirPath
:
wx
.
env
.
USER_DATA_PATH
,
success
({
files
})
{
console
.
log
(
files
,
'文件列表'
)
if
(
files
.
length
<
21
)
{
let
item
=
fileList
.
find
(
e
=>
e
[
findKey
]
===
n
[
findKey
])
if
(
item
)
{
const
poster
=
files
.
find
(
s
=>
s
.
includes
(
item
.
fileId
))
wx
.
hideLoading
()
if
(
poster
)
resolve
(
`
${
wx
.
env
.
USER_DATA_PATH
}
/
${
poster
}
`
)
else
reject
()
}
else
reject
()
}
else
{
wx
.
$storage
.
rm
(
'fileList'
)
files
.
map
(
e
=>
{
fn
.
unlink
({
filePath
:
`
${
wx
.
env
.
USER_DATA_PATH
}
/
${
e
}
`
})
})
reject
()
}
}
})
}
// else reject()
// })
},
begin
()
{
let
{
item
}
=
this
.
data
item
.
posterUrl
&&
this
.
getImageInfo
(
item
)
...
...
@@ -50,36 +87,6 @@ Component({
this
.
setData
({
_item_
:
n
})
const
fileList
=
wx
.
$storage
.
get
(
'fileList'
)
||
[],
fn
=
wx
.
getFileSystemManager
(),
{
findKey
}
=
this
.
data
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
fileList
.
length
)
{
fn
.
readdir
({
dirPath
:
wx
.
env
.
USER_DATA_PATH
,
success
({
files
})
{
console
.
log
(
files
,
'文件列表'
)
if
(
files
.
length
<
21
)
{
let
item
=
fileList
.
find
(
e
=>
e
[
findKey
]
===
n
[
findKey
])
if
(
item
)
{
const
poster
=
files
.
find
(
s
=>
s
.
includes
(
item
.
fileId
))
wx
.
hideLoading
()
if
(
poster
)
resolve
(
`
${
wx
.
env
.
USER_DATA_PATH
}
/
${
poster
}
`
)
else
reject
()
}
else
reject
()
}
else
{
wx
.
$storage
.
rm
(
'fileList'
)
files
.
map
(
e
=>
{
fn
.
unlink
({
filePath
:
`
${
wx
.
env
.
USER_DATA_PATH
}
/
${
e
}
`
})
})
reject
()
}
}
})
}
else
reject
()
})
},
getImageInfo
(
n
)
{
console
.
log
(
n
)
...
...
@@ -204,8 +211,8 @@ Component({
let
fileList
=
wx
.
$storage
.
get
(
'fileList'
)
||
[]
fileList
.
push
({
fileId
:
res
.
fileId
,
path
:
res
.
path
,
[
findKey
]:
n
[
findKey
]
path
:
res
.
path
//
[findKey]: n[findKey]
})
wx
.
$storage
.
set
(
'fileList'
,
fileList
)
},
...
...
packagesList/mineDetail/pages/messageBox.js
View file @
2675e99
...
...
@@ -36,7 +36,7 @@ Component({
list
:
'messageList'
}
},
findKey
:
''
,
//
findKey: '',
warReportList
:
[],
messageList
:
[],
serviceMerchantId
:
''
...
...
@@ -89,7 +89,7 @@ Component({
showPoster
(
e
)
{
const
{
item
}
=
e
.
currentTarget
.
dataset
this
.
setData
({
findKey
:
'crowdFundActivityId'
,
//
findKey: 'crowdFundActivityId',
posterItem
:
{
activityName
:
item
.
activityName
,
posterUrl
:
item
.
valueUrl
,
...
...
@@ -101,9 +101,9 @@ Component({
async
copyLink
(
e
)
{
const
{
item
}
=
e
.
currentTarget
.
dataset
,
posterObj
=
this
.
selectComponent
(
'#poster'
)
this
.
setData
({
findKey
:
'activityId'
})
//
this.setData({
//
findKey: 'activityId'
//
})
try
{
let
flag
=
await
posterObj
.
check
(
item
)
posterObj
.
setData
({
...
...
packagesList/mineDetail/pages/messageBox.wxml
View file @
2675e99
...
...
@@ -118,6 +118,7 @@
</scroll-view>
</view>
</view>
<crowdfund-poster findKey="{{findKey}}" id="poster" item="{{posterItem}}" />
<!-- findKey="{{findKey}}" -->
<crowdfund-poster id="poster" item="{{posterItem}}" />
<canvas class="erweimaCanvas" style="width: 600rpx; height: 600rpx;" canvas-id="myQrcode" />
packagesList/packageOutput/components/outputCrowdfund/outputCrowdfund.json
View file @
2675e99
{
"component"
:
true
,
"usingComponents"
:
{
"poster"
:
"../poster/poster"
}
"usingComponents"
:
{}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment