Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxuelai
wechatapp.shangjiadao.com
Commits
4fe33294
Commit
4fe33294
authored
Feb 08, 2020
by
ltz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
1538ffee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
122 additions
and
57 deletions
+122
-57
index.js
business/pages/morethemeindex/index.js
+116
-55
index.json
business/pages/morethemeindex/index.json
+2
-1
index.wxml
business/pages/morethemeindex/index.wxml
+4
-1
No files found.
business/pages/morethemeindex/index.js
View file @
4fe33294
...
...
@@ -16,7 +16,8 @@ import {
}
from
'../../../service/business/morethemeindex.js'
;
import
{
wxOpenLocation
,
wxNavigateToMiniProgram
wxNavigateToMiniProgram
,
wxPreviewImage
}
from
'../../../utilities/wxApi.js'
;
import
{
formIdCreate
...
...
@@ -133,7 +134,10 @@ Page({
status
:
false
,
pushStatus
:
2
},
subject_count
:
1
subject_count
:
1
,
painting
:
{},
memberHasclock
:
[],
imageUrl
:
'https://cdn.img.shangjiadao.cn/source/images/dakav4/morethemeindex/unlockindex1.png'
},
onLoad
:
function
(
options
)
{
// Do some initialize when page load.
this
.
innerAudioContext
=
wx
.
createInnerAudioContext
();
// 当前页面唯一的一个音频容器
...
...
@@ -155,7 +159,6 @@ Page({
this
.
getDetail
();
this
.
getUnlockSubjectList
();
// this.clockMemberListGet('init')
// console.log(this.data.sort)
},
onReady
:
function
()
{
// Do something when page ready.
...
...
@@ -208,67 +211,123 @@ Page({
})
}
},
onShareAppMessage
:
function
(
option
)
{
// return custom share data when user share.
const
{
from
,
target
}
=
option
;
let
shareObj
=
{
}
if
(
from
==
'menu'
)
{
shareObj
=
{
title
:
this
.
data
.
moreTheme
.
title
,
path
:
`/src/pages/sharemoretheme/index?tid=
${
this
.
data
.
tid
}
&id=
${
this
.
data
.
id
}
`
// TODO delete
generatePic
(){
let
imageUrl
=
this
.
data
.
imageUrl
;
this
.
setData
({
painting
:
{
width
:
750
,
height
:
600
,
views
:
[
// { // 头像
// type: 'image',
// url: userInfo?imagify(userInfo.avatar, 'image/resize,w_160/format,jpg'):imagify(visitor.userInfo.avatarUrl, 'image/resize,w_160/format,jpg'),
// top: 766,
// left: 70,
// width: 80,
// height: 80
// },
{
// 背景
type
:
'image'
,
url
:
imageUrl
,
top
:
0
,
left
:
0
,
width
:
750
,
height
:
400
},
{
// 打卡详情
type
:
'text'
,
content
:
`
${
this
.
data
.
moreTheme
.
title
.
length
>
15
?
this
.
data
.
moreTheme
.
title
.
substr
(
0
,
15
)
+
'...'
:
this
.
data
.
moreTheme
.
title
}
`
,
fontSize
:
36
,
color
:
'#000000'
,
textAlign
:
'left'
,
top
:
432
,
left
:
0
,
bolder
:
true
},
]
}
posterLog
({
poster_type
:
2
,
type
:
3
,
class_id
:
this
.
data
.
id
})
},
eventGetImage
(
e
)
{
console
.
log
(
e
)
const
{
detail
}
=
e
;
wx
.
hideLoading
();
if
(
detail
.
errMsg
==
'canvasdrawer:ok'
)
{
wxPreviewImage
({
current
:
e
.
detail
.
tempFilePath
,
urls
:
[
e
.
detail
.
tempFilePath
]
})
}
else
if
(
from
==
'button'
)
{
if
(
!
target
.
dataset
.
info
)
{
shareObj
=
{
title
:
this
.
data
.
moreTheme
.
title
,
path
:
`/src/pages/sharemoretheme/index?tid=
${
this
.
data
.
tid
}
&id=
${
this
.
data
.
id
}
`
}
posterLog
({
poster_type
:
2
,
type
:
3
,
class_id
:
this
.
data
.
id
})
}
else
{
const
{
target
:
{
dataset
:
{
info
}
}
}
=
option
;
posterLog
({})
console
.
log
(
e
.
detail
.
tempFilePath
,
'url'
)
this
.
setData
({
painting
:
null
,
})
}
else
{
this
.
setData
({
painting
:
null
,
})
wx
.
showToast
({
title
:
'生成失败'
,
icon
:
'none'
})
}
},
shareObj
=
{
title
:
`
${
info
.
school_student
.
nickname
}
的打卡详情`
,
path
:
`/src/pages/clockdetail/newindex?tid=
${
info
.
subject_id
}
&cid=
${
info
.
id
}
`
}
return
{
title
:
shareObj
.
title
,
path
:
shareObj
.
path
,
imageUrl
:
'https://cdn.img.shangjiadao.cn/source/images/dakav4/morethemeindex/unlockindex1.png'
,
success
:
(
res
)
=>
{
if
(
res
.
errMsg
==
'shareAppMessage:ok'
)
{
this
.
setData
({
shareObj
:
this
.
data
.
initShareObj
})
}
onShareAppMessage
:
function
(
option
)
{
let
imageUrl
=
this
.
data
.
imageUrl
;
this
.
setData
({
painting
:
{
width
:
750
,
height
:
600
,
views
:
[
// { // 头像
// type: 'image',
// url: userInfo?imagify(userInfo.avatar, 'image/resize,w_160/format,jpg'):imagify(visitor.userInfo.avatarUrl, 'image/resize,w_160/format,jpg'),
// top: 766,
// left: 70,
// width: 80,
// height: 80
// },
{
// 背景
type
:
'image'
,
url
:
imageUrl
,
top
:
0
,
left
:
0
,
width
:
750
,
height
:
400
},
}
{
// 打卡详情
type
:
'text'
,
content
:
`
${
this
.
data
.
moreTheme
.
title
.
length
>
15
?
this
.
data
.
moreTheme
.
title
.
substr
(
0
,
15
)
+
'...'
:
this
.
data
.
moreTheme
.
title
}
`
,
fontSize
:
36
,
color
:
'#000000'
,
textAlign
:
'left'
,
top
:
432
,
left
:
0
,
bolder
:
true
},
]
}
})
let
shareObj
=
{};
shareObj
=
{
title
:
this
.
data
.
moreTheme
.
title
,
path
:
`/src/pages/sharemoretheme/index?tid=
${
this
.
data
.
tid
}
&id=
${
this
.
data
.
id
}
`
}
posterLog
({
poster_type
:
2
,
type
:
3
,
class_id
:
this
.
data
.
id
})
console
.
log
(
shareObj
,
'分享参数'
)
return
{
title
:
shareObj
.
title
,
path
:
shareObj
.
path
,
imageUrl
:
'https://cdn.img.shangjiadao.cn/source/images/dakav4/morethemeindex/unlockindex.png'
,
imageUrl
:
imageUrl
,
success
:
(
res
)
=>
{
// 转发成功之后的回调
if
(
res
.
errMsg
==
'shareAppMessage:ok'
)
{
...
...
@@ -1280,6 +1339,8 @@ Page({
if
(
code
!=
200
)
{
// 失败的处理
}
else
{
let
memberHasclock
=
data
.
clock_list
.
splice
(
0
,
3
).
map
(
item
=>
item
.
avatar
);
console
.
log
(
22
,
memberHasclock
)
// if (data.un_clock_total_count) {
this
.
setData
({
memberTotal
:
data
.
un_clock_total_count
||
0
,
...
...
business/pages/morethemeindex/index.json
View file @
4fe33294
...
...
@@ -13,6 +13,7 @@
"comment-editor"
:
"../../../components/commenteditor"
,
"btn-drag"
:
"../../../components/btndrag"
,
"expiredTip"
:
"../../components/expiredTip"
,
"comment-editor-type-choose"
:
"../../components/commentEditorTypeChoose"
"comment-editor-type-choose"
:
"../../components/commentEditorTypeChoose"
,
"canvasdrawer"
:
"../../../components/canvasdrawer/canvasdrawer"
}
}
\ No newline at end of file
business/pages/morethemeindex/index.wxml
View file @
4fe33294
...
...
@@ -246,4 +246,7 @@
</view>
<view class="footer" bindtap="hideNoticeDailog">知道了</view>
</view>
</view>
\ No newline at end of file
</view>
<!-- TODO 待删 为了查看分享图片-->
<canvasdrawer painting="{{painting}}" bind:getImage="eventGetImage" />
\ No newline at end of file
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