|
@@ -68,7 +68,6 @@ Page({
|
|
|
uploadHide: true
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
creatShare() {
|
|
|
let video = this.data.readDetail
|
|
|
return new Promise((resolve, reject) => {
|
|
@@ -81,7 +80,7 @@ Page({
|
|
|
}).exec((res) => {
|
|
|
const canvas = res[0].node;
|
|
|
const ctx = canvas.getContext('2d');
|
|
|
- const dpr = wx.getSystemInfoSync().pixelRatio;
|
|
|
+ const dpr = 0.84
|
|
|
canvas.width = res[0].width * dpr;
|
|
|
canvas.height = res[0].height * dpr;
|
|
|
ctx.scale(dpr, dpr);
|
|
@@ -145,15 +144,27 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
- console.log(wx.getStorageSync('shareVideoId'), 'reading-wx.score');
|
|
|
wx.canvasToTempFilePath({
|
|
|
canvas: canvas,
|
|
|
success(res) {
|
|
|
+ // #if MP
|
|
|
resolve({
|
|
|
title: '我的新作品发布啦,快来捧场点赞!',
|
|
|
path: `/pages/pkPage/index?videoId=${wx.getStorageSync('shareVideoId')}&uid=${wx.getStorageSync('uid')}&isShare=true`,
|
|
|
imageUrl: res.tempFilePath
|
|
|
})
|
|
|
+ // #elif ANDROID
|
|
|
+ resolve({
|
|
|
+ title: '我的新作品发布啦,快来捧场点赞!',
|
|
|
+ userName: 'gh_50f61361ad1d',
|
|
|
+ path: `/pages/pkPage/index?videoId=${wx.getStorageSync('shareVideoId')}&uid=${wx.getStorageSync('uid')}&isShare=true`,
|
|
|
+ imagePath: res.tempFilePath,
|
|
|
+ webpageUrl: 'http://www.efunbox.cn',
|
|
|
+ withShareTicket: true,
|
|
|
+ miniprogramType: 1,
|
|
|
+ scene: 0,
|
|
|
+ })
|
|
|
+ // #endif
|
|
|
},
|
|
|
fail(res) {
|
|
|
reject()
|
|
@@ -194,6 +205,11 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
// #elif ANDROID
|
|
|
+ const promise = new Promise(resolve => {
|
|
|
+ this.creatShare().then(res => {
|
|
|
+ resolve(res)
|
|
|
+ })
|
|
|
+ })
|
|
|
return {
|
|
|
title: '我的新作品发布啦,快来捧场点赞!',
|
|
|
userName: 'gh_50f61361ad1d',
|
|
@@ -203,6 +219,7 @@ Page({
|
|
|
withShareTicket: true,
|
|
|
miniprogramType: 1,
|
|
|
scene: 0,
|
|
|
+ promise
|
|
|
}
|
|
|
// #endif
|
|
|
},
|