|
@@ -50,17 +50,18 @@ Page({
|
|
|
this.sceneName = data.sceneName
|
|
|
|
|
|
let params = {
|
|
|
- scene: `a=${id},${type},1,${roomId},1`,
|
|
|
- // page: vrLink
|
|
|
- page: 'pages/webview/index'
|
|
|
+ scene: `${id}_${type}_1_${roomId}_1`,
|
|
|
+ page: vrLink.substr(1, vrLink.length - 1) //截掉page前的 /
|
|
|
}
|
|
|
|
|
|
// this.getMIniCode =remote.requestHost+'/statics/tmp/images/1634032649766.png'
|
|
|
try {
|
|
|
let codeData = await this.generateMicroAppCode(params)
|
|
|
if (codeData) {
|
|
|
- this.getMIniCode = remote.requestHost + codeData
|
|
|
|
|
|
+ this.getMIniCode = remote.requestHost + codeData
|
|
|
+ console.log('****')
|
|
|
+ console.log(this.getMIniCode)
|
|
|
} else {
|
|
|
this.getMIniCode = null
|
|
|
wx.showToast({
|
|
@@ -176,10 +177,15 @@ Page({
|
|
|
// } else {
|
|
|
// var shareCode = null
|
|
|
// }
|
|
|
+ var shareCode = null
|
|
|
if (this.getMIniCode) {
|
|
|
- var shareCode = await this.downloadFile(this.getMIniCode)
|
|
|
- } else {
|
|
|
- var getMIniCode = null
|
|
|
+ try {
|
|
|
+ shareCode = await this.downloadFile(this.getMIniCode)
|
|
|
+
|
|
|
+ } catch (err) {
|
|
|
+ shareCode = null
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const img_width = this.canvas_width * 0.8644,
|
|
@@ -194,11 +200,19 @@ Page({
|
|
|
this.context.font = 'normal 300 11px sans-serif'
|
|
|
// this.sceneName =
|
|
|
// let title ='MOOST·理想服饰MOOST·理想服饰MOOST'
|
|
|
- if (this.sceneName.length > 15) {
|
|
|
+ if (this.sceneName && this.sceneName.length > 15) {
|
|
|
this.sceneName = this.sceneName.substring(0, 15) + '...'
|
|
|
+ } else if(!this.sceneName){
|
|
|
+ this.sceneName = ''
|
|
|
+ }
|
|
|
+ console.log(this.sceneName)
|
|
|
+ if (this.sceneName != '') {
|
|
|
+ this.titleWidth = this.context.measureText(this.sceneName).width+ 53 + 20
|
|
|
+ } else {
|
|
|
+ this.titleWidth = 20
|
|
|
}
|
|
|
- let titleWidth = this.context.measureText(this.sceneName).width
|
|
|
- this.roundRectColor(this.context, left + 10, 243, titleWidth + 53 + 20, 22, 6, 'rgba(0, 0, 0, 0.6)')
|
|
|
+
|
|
|
+ this.roundRectColor(this.context, left + 10, 243, this.titleWidth , 22, 6, 'rgba(0, 0, 0, 0.6)')
|
|
|
this.context.fillStyle = '#fff'
|
|
|
this.context.font = 'normal 300 11px sans-serif'
|
|
|
this.context.fillText(this.sceneName, left + 10 + 53 + 10, 243 + 15)
|