Commit 4fe33294 authored by ltz's avatar ltz

fix

parent 1538ffee
...@@ -16,7 +16,8 @@ import { ...@@ -16,7 +16,8 @@ import {
} from '../../../service/business/morethemeindex.js'; } from '../../../service/business/morethemeindex.js';
import { import {
wxOpenLocation, wxOpenLocation,
wxNavigateToMiniProgram wxNavigateToMiniProgram,
wxPreviewImage
} from '../../../utilities/wxApi.js'; } from '../../../utilities/wxApi.js';
import { import {
formIdCreate formIdCreate
...@@ -133,7 +134,10 @@ Page({ ...@@ -133,7 +134,10 @@ Page({
status: false, status: false,
pushStatus: 2 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. onLoad: function (options) { // Do some initialize when page load.
this.innerAudioContext = wx.createInnerAudioContext(); // 当前页面唯一的一个音频容器 this.innerAudioContext = wx.createInnerAudioContext(); // 当前页面唯一的一个音频容器
...@@ -155,7 +159,6 @@ Page({ ...@@ -155,7 +159,6 @@ Page({
this.getDetail(); this.getDetail();
this.getUnlockSubjectList(); this.getUnlockSubjectList();
// this.clockMemberListGet('init') // this.clockMemberListGet('init')
// console.log(this.data.sort)
}, },
onReady: function () { // Do something when page ready. onReady: function () { // Do something when page ready.
...@@ -208,67 +211,123 @@ Page({ ...@@ -208,67 +211,123 @@ Page({
}) })
} }
}, },
onShareAppMessage: function (option) { // return custom share data when user share. // TODO delete
const { generatePic(){
from, let imageUrl = this.data.imageUrl;
target this.setData({
} = option; painting: {
let shareObj = { width: 750,
height: 600,
} views: [
if (from == 'menu') { // { // 头像
shareObj = { // type: 'image',
title: this.data.moreTheme.title, // url: userInfo?imagify(userInfo.avatar, 'image/resize,w_160/format,jpg'):imagify(visitor.userInfo.avatarUrl, 'image/resize,w_160/format,jpg'),
path: `/src/pages/sharemoretheme/index?tid=${this.data.tid}&id=${this.data.id}` // 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, eventGetImage(e) {
class_id: this.data.id 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') { console.log(e.detail.tempFilePath,'url')
if (!target.dataset.info) { this.setData({
shareObj = { painting: null,
title: this.data.moreTheme.title, })
path: `/src/pages/sharemoretheme/index?tid=${this.data.tid}&id=${this.data.id}` } else {
} this.setData({
posterLog({ painting: null,
poster_type: 2, })
type: 3, wx.showToast({
class_id: this.data.id title: '生成失败',
}) icon: 'none'
} else { })
const { }
target: { },
dataset: {
info
}
}
} = option;
posterLog({})
shareObj = { onShareAppMessage: function (option) {
title: `${info.school_student.nickname}的打卡详情`, let imageUrl = this.data.imageUrl;
path: `/src/pages/clockdetail/newindex?tid=${info.subject_id}&cid=${info.id}` this.setData({
} painting: {
return { width: 750,
title: shareObj.title, height: 600,
path: shareObj.path, views: [
imageUrl:'https://cdn.img.shangjiadao.cn/source/images/dakav4/morethemeindex/unlockindex1.png', // { // 头像
success: (res) => { // type: 'image',
if (res.errMsg == 'shareAppMessage:ok') { // url: userInfo?imagify(userInfo.avatar, 'image/resize,w_160/format,jpg'):imagify(visitor.userInfo.avatarUrl, 'image/resize,w_160/format,jpg'),
this.setData({ // top: 766,
shareObj: this.data.initShareObj // 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 { return {
title: shareObj.title, title: shareObj.title,
path: shareObj.path, path: shareObj.path,
imageUrl:'https://cdn.img.shangjiadao.cn/source/images/dakav4/morethemeindex/unlockindex.png', imageUrl: imageUrl,
success: (res) => { success: (res) => {
// 转发成功之后的回调 // 转发成功之后的回调
if (res.errMsg == 'shareAppMessage:ok') { if (res.errMsg == 'shareAppMessage:ok') {
...@@ -1280,6 +1339,8 @@ Page({ ...@@ -1280,6 +1339,8 @@ Page({
if (code != 200) { // 失败的处理 if (code != 200) { // 失败的处理
} else { } else {
let memberHasclock = data.clock_list.splice(0,3).map(item=>item.avatar);
console.log(22,memberHasclock)
// if (data.un_clock_total_count) { // if (data.un_clock_total_count) {
this.setData({ this.setData({
memberTotal: data.un_clock_total_count || 0, memberTotal: data.un_clock_total_count || 0,
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
"comment-editor": "../../../components/commenteditor", "comment-editor": "../../../components/commenteditor",
"btn-drag":"../../../components/btndrag", "btn-drag":"../../../components/btndrag",
"expiredTip": "../../components/expiredTip", "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
...@@ -246,4 +246,7 @@ ...@@ -246,4 +246,7 @@
</view> </view>
<view class="footer" bindtap="hideNoticeDailog">知道了</view> <view class="footer" bindtap="hideNoticeDailog">知道了</view>
</view> </view>
</view> </view>
\ No newline at end of file
<!-- TODO 待删 为了查看分享图片-->
<canvasdrawer painting="{{painting}}" bind:getImage="eventGetImage" />
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment