// pages/other/other.js var app = getApp(); const utils = require("../../utils/http"); const util = require("../../utils/util"); var time = 0; var timer = null; let title='',imgurl=''; Page({ /** * 页面的初始数据 */ data: { webUrl: '', clientype: app.globalData.clientype, type:'1',//1是小红屋,2是酷家乐,3是建额全景,剩下的是其他 companyobj:{}, personobj:{}, canIUseGetUserProfile:false, loginFlag:false, mobileflag:false, vrType: '', aid: '', imgUrl: app.globalData.imgUrl, platform:'windows', wshareshow:false, showTask:true, xhwwidth:'', bottom:26, emptype:'', isVr: "", userflag:false, }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { time = 0; imgurl=''; title=''; this.setData({ emptype:'', }) if(!!options.emp){ this.setData({ emptype:'1', }) } if(!!options.type&&options.type=='vr'){ app.globalData.clientype=options.ctp; app.globalData.shareuserid = options.uid; this.setData({ isVr: options.type }) this.login(); } if (!!options.aid) { this.setData({ aid: options.aid }) } if (!!options.cty) { this.setData({ vrType: options.cty }) } if (!!options.scene) { wx.hideHomeButton() options = unescape(options.scene); let arr = options.split('&'); let obj = {}; for (let i = 0; i < arr.length; i++) { let arr1 = arr[i].split('='); obj[arr1[0]] = arr1[1]; } this.setData({ isVr: obj.type }) this.getmsgfun(obj.ticket); }else if (options.type == '21' || options.type == '23') {//新客户 this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/customerMsg?token=' + app.globalData.token + '&cid=' + options.vid + '&client_type=' + app.globalData.clientype+"&platform="+app.globalData.platform, }) } else if (options.type == '22') {//共有客户 this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/client?token=' + app.globalData.token + '&orgid=' + app.globalData.personMsg.binded.org_id + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id + "&platform="+app.globalData.platform, }) } else if (options.type == '3') {//共有客户 this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/workReport?token=' + app.globalData.token + '&type=' + (options.state ? options.state : '') + '&orgid=' + app.globalData.personMsg.binded.org_id + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id+"&platform="+app.globalData.platform, }) } else if (options.type == '2') { this.setData({ webUrl: options.content, clientype: app.globalData.clientype, }) } else if (options.type == '4') { // 日报详情 this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/dailyDetail?token=' + app.globalData.token + '&id=' + options.did + '&type=' + 'sendout' + '&orgid=' + app.globalData.personMsg.binded.org_id + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id, }) }else if (options.type == '88') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/customermsg?token=' + app.globalData.token + "&aid=" + options.aid + "&cid=" + options.cid + '&client_type=' + app.globalData.clientype+"&platform="+app.globalData.platform }) } else if (options.type == '11') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/trainmsg?token=' + app.globalData.token + '&tid=' + options.tid + '&client_type=' + app.globalData.clientype }) } else if (options.type == '48') {//共有客户 wx.setNavigationBarColor({ frontColor: '#ffffff', backgroundColor: '#2376FF', }) this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/custmanage?token=' + app.globalData.token + '&orgid=' + app.globalData.personMsg.binded.org_id + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id, }) } else if (options.type == '32') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/trainCamp?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id }) } else if (options.type == '77') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/recycle?token=' + app.globalData.token + '&orgid=' + app.globalData.personMsg.binded.org_id + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id, }) wx.setNavigationBarColor({ backgroundColor: '#249efb', frontColor: '#ffffff', }) } else if (options.type == '29') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/joinCustomer?token=' + app.globalData.token + '&actid=' + options.actid + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id, }) } else if (options.type == '63') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/winPrize?token=' + app.globalData.token + '&actid=' + options.actid + '&client_type=' + app.globalData.clientype, }) } else if (options.type == '9') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/designerlist?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype, }) } else if (options.type == '111') { // vr let vrurl1="https://h5.zqxg.cc"; let vrlink = JSON.parse(JSON.stringify(unescape(options.vrurl))); if (vrlink.indexOf(vrurl1) > -1) { if (vrlink.indexOf('/0/') < 0 && app.globalData.vrString) { vrlink = `${vrlink}/0/${app.globalData.vrString}`; } } this.setData({ webUrl: vrlink, }) } else if (options.type == '121') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/collage?token=' + app.globalData.token + '&orgid=' + app.globalData.personMsg.binded.org_id + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id, }) } else if (options.type == 'vr') { // vr wx.hideHomeButton() let vrurl1="https://h5.zqxg.cc"; let vrlink = JSON.parse(JSON.stringify(unescape(options.vrurl))); if (vrlink.indexOf(vrurl1) > -1) { if (vrlink.indexOf('/0/') < 0 && app.globalData.vrString) { vrlink = `${vrlink}/0/${app.globalData.vrString}`; } } this.setData({ webUrl: vrlink, }) } else if (options.type == '818') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/fiveDimensions?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + '&empid=' + options.empid, }) } else if (options.type == '919') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/overdue?token=' + app.globalData.token + '&orgid=' + app.globalData.personMsg.binded.org_id + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id, }) } else if (options.type == 'screen') { wx.setNavigationBarColor({ backgroundColor: '#C40909', frontColor: '#ffffff', }) this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/wbmanage?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id, }) } else if (options.type == "565") { // vr wx.hideHomeButton() let vrurl1="https://h5.zqxg.cc"; let vrlink = JSON.parse(JSON.stringify(decodeURIComponent(options.vrlink))); if (vrlink.indexOf(vrurl1) > -1) { if (vrlink.indexOf('/0/') < 0 && app.globalData.vrString) { vrlink = `${vrlink}/0/${app.globalData.vrString}`; } } this.setData({ webUrl: vrlink, }) } else if (options.type == '999') { wx.setNavigationBarColor({ frontColor: '#ffffff', backgroundColor: '#191c23', }) this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/medal?token=' + app.globalData.token + '&orgid=' + app.globalData.personMsg.binded.org_id + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id, }) } else if (options.type == '525') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/addReport?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype, }) } else if (options.type == '656') { wx.setNavigationBarColor({ frontColor: '#ffffff', backgroundColor: '#249efb', }) this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/brokerModule?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id, }) } else if (options.type == '2277') { wx.setNavigationBarColor({ frontColor: '#ffffff', backgroundColor: '#249efb', }) this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/integral?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + '&brokerId=' + app.globalData.brokeruserId + '&btype=b', }) } else if (options.type == '5566') { wx.setNavigationBarColor({ frontColor: '#ffffff', backgroundColor: '#249efb', }) this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/brokerDetail?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id + '&brokerId=' + options.cid, }) } else if (options.type == '13') { wx.setNavigationBarColor({ frontColor: '#ffffff', backgroundColor: '#249efb', }) this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/sharestatistics?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype, }) } else if (options.type == '987') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/buildinglist?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype +"&platform="+app.globalData.platform + "&type=" + options.bType, }) } else if (options.type == '090') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/publicQr?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype +"&platform="+app.globalData.platform, }) }else if (options.type == '-87') {//未到访 wx.setNavigationBarColor({ frontColor: '#ffffff', backgroundColor: '#249efb', }) this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/crmnotice?token=' + app.globalData.token + '&orgid=' + app.globalData.personMsg.binded.org_id + '&client_type=' + app.globalData.clientype + '&empid=' + app.globalData.personMsg.binded.id+'&time='+options.time, }) } else if (options.type == '9009') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/Mbroker?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + "&platform="+app.globalData.platform, }) } else if (options.type == '9889') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/addBuilding?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype +"&platform="+app.globalData.platform, }) } else if (options.type == '6060') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/deadOrder?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype +"&platform="+app.globalData.platform, }) } else if (options.type == '0111') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/Mapproval?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype +"&platform="+app.globalData.platform, }) } else if (options.type == '0202') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/trainmsg?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype +"&platform="+app.globalData.platform + '&tid=' + options.cid, }) } else if(options.type=='viewgrades'){ this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/viewGrades?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + '&pid=' + options.pid, }) } else if(options.type=='assessmsg'){ this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/assessMsg?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype + '&pid=' + options.pid, }) } else if (options.type == '6886') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/statistics?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype +"&platform="+app.globalData.platform, }) } else if (options.type == '8992') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/construction?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype +"&platform="+app.globalData.platform, }) } else if (options.type == '6709') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/exchange?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype +"&platform="+app.globalData.platform + '&btype=b', }) } else if (options.type == '6006') { this.setData({ webUrl: app.globalData.webUrl + 'applet.html#/cluemsg?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype +"&platform="+app.globalData.platform + "&cid=" + options.cid, }) } this.setype(); }, getmsgfun(ticket){ const that=this; wx.request({ url: app.globalData.webUrl + 'api/share/getQueryByTicket', method: 'GET', data: { ticket: ticket }, success: (res) => { if(res.data.code==0){ let arr=res.data.data.split('&'); let obj = {}; for (let i = 0; i < arr.length; i++) { let arr1 = arr[i].split('='); obj[arr1[0]] = arr1[1]; } app.globalData.clientype=obj.c; app.globalData.shareuserid = obj.u; let str = unescape(obj.l); that.setData({ aid: obj.a, vrType: obj.y, webUrl: str, }) that.setype(); that.login(); } } }) }, sharecompany: function () { const that = this; utils.$post({ url: app.globalData.webUrl + 'client/index/content_belong_company', header: { 'Authorization': 'bearer ' + app.globalData.token }, data: { client_type: app.globalData.clientype, uid: app.globalData.shareuserid }, success: function (res) { if (res.data.code == '0') { app.globalData.currentUserId = res.data.data.employee_id || ''; app.globalData.companyobj=res.data.data; that.setData({ companyobj: res.data.data }) } }, complete(res) { wx.hideLoading() } }) }, login: function () { var that = this; if(this.data.emptype){ that.setData({ showTask:true, }) }else{ that.setData({ showTask:false, }) } that.setData({ userflag:true }) wx.login({ success: function (data) { if (data.errMsg == 'login:ok') { utils.$post({ url: app.globalData.webUrl + 'api/users/code2sessionmini', data: { code: data.code, share: app.globalData.shareuserid, client_type:app.globalData.clientype }, success: function (r) { if (r.data.code == '0') { app.globalData.sharepersonobj = r.data.share; app.globalData.companyobj = r.data.company_data; that.setData({ companyobj: r.data.company_data, personobj:r.data.share }) that.sharecompany(); if (that.data.vrType!='housetype') { that.vrFooterRecord(); } that.geTitle(); if (!!r.data.user.phone) { that.setData({ loginFlag: false, mobileflag: false, userflag:false }) app.globalData.personMsg = r.data.user; wx.hideLoading(); app.globalData.phone = true;//有手机号 }else{ wx.hideLoading(); app.globalData.phone = false;//没有手机号 that.setData({ loginFlag: false, mobileflag:true }) } } } }) } } }) }, /** * vr获取足迹 */ vrFooterRecord() { var that = this; let dataObj = {}; if (that.data.vrType === 'housetype') { dataObj = { type: that.data.vrType, id: that.data.aid, alertshow: "123", prompt: title } } else { dataObj = { type: that.data.vrType, id: that.data.aid, alertshow: "123", } } utils.$post({ url: app.globalData.webUrl + 'client/material/vrfootprints', data: dataObj, header: { 'Authorization':'bearer '+app.globalData.token }, success: function (r) { if(r.data.code=='0'){} } }) }, bindmessage(e){ console.log(e) let arr=e.detail.data; for(let i in arr){ this.viewlookfun(arr[i].sid,arr[i].vid,arr[i].time,arr[i].vdate); } }, // vr场景浏览时长 viewlookfun(sid,vid,time,hour){ const that=this; utils.$post({ url: app.globalData.webUrl + 'client/material/saveViewFoots', data: { sid:sid,//作品sid view_id:vid,//场景id time:time,//浏览时长 viewtime:hour.split('-').join(':'),//浏览时间 alertshow: "123" }, header: { 'Authorization':'bearer '+app.globalData.token }, success: function (r) { if(r.data.code=='0'){} } }) }, setype(){ if(!this.data.vrType){ this.setData({ type:'', platform:'' }) wx.hideShareMenu({ menus: ['shareAppMessage', 'shareTimeline'] }) return false; } const that=this; let webUrl=this.data.webUrl; let redurltest='https://hnweizhihui.xiaohongwu.com'; let kjlurltest="https://pano337.p.kujiale.com"; let jeajurltest="https://vr-17.justeasy.cn"; let jeajurltest1="https://vr.justeasy.cn"; let wlurltest1="https://panorama.m2m88.com"; //26 let wlurltest2="https://panorama.wlwno1.com";//27 let nowurl="https://h5.zqxg.cc";//https://h5.zqxg.cc|saastest.zhuangqixiaoguan.com-37|18 if(webUrl.substr(0, 34)==redurltest){ wx.getSystemInfo({ success (res) { let width=(res.windowWidth-16)*0.4; that.setData({ xhwwidth:width, bottom:res.platform=='android'?'26':36 }) } }) this.setData({ type:1, platform:app.globalData.platform, }) }else if(webUrl.substr(0, 29)==kjlurltest){ this.setData({ type:2, platform:app.globalData.platform, }) }else if(webUrl.substr(0, 25)==jeajurltest||webUrl.substr(0, 22)==jeajurltest1){ this.setData({ type:3, platform:app.globalData.platform, }) }else if(webUrl.substr(0, 26)==wlurltest1||webUrl.substr(0, 27)==wlurltest2){ this.setData({ type:4, platform:app.globalData.platform, }) }else if (webUrl.substr(0, 18)==nowurl){ this.setData({ type:5, platform:app.globalData.platform, }) } if(!!app.globalData.token && !this.data.isVr){ this.geTitle(); } }, // 分享 shareurltap: function () { wx.showLoading({ title: '加载中...', }) this.addsharetap('toolAll'); let str =this.data.webUrl; util.schemefun('/pages/other/other', 'uid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype+ '&type=vr&aid=' + this.data.aid+ '&cty='+this.data.vrType+'_vr', this.data.aid, this.data.vrType+'_vr', '',str); }, sendfriendtap() { this.addsharetap('toolAll'); }, setpostertap: function () { wx.navigateTo({ url: '/index/pages/setposter/setposter?type=vr&aid=' + this.data.aid + "&listshare=&vrtype="+this.data.vrType+'&turl='+escape(this.data.webUrl), }) }, casesharetap(){ this.setData({ wshareshow:true }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, callphonetap(){ wx.makePhoneCall({ phoneNumber: this.data.personobj.phone }) }, toPageNameCard() { wx.navigateTo({ url: '/share/pages/shareCard/shareCard?uid=' + (app.globalData.shareuserid?app.globalData.shareuserid:this.data.personobj.id)+ '&empid=' + (app.globalData.currentUserId?app.globalData.currentUserId:this.data.personobj.binded.id) + '&ctp=' + app.globalData.clientype + '&ftype=share', }) }, prelookimgtap() { let personobj=this.data.personobj; let qrcode=''; if(!!personobj.qrcode){ qrcode=personobj.qrcode; }else if(!!personobj.binded.qrcode){ qrcode=personobj.binded.qrcode; } if (!qrcode) { wx.showToast({ title: "当前装修顾问的二维码为空!", icon: 'none', duration: 2000 }) return false; } wx.previewImage({ current: app.globalData.imgUrl + qrcode, // 当前显示图片的http链接 urls: [app.globalData.imgUrl + qrcode]// 需要预览的图片http链接列表 }) }, getPhoneNumberTap:function(res){ var that=this; if(res.detail.errMsg=='getPhoneNumber:ok'){ utils.$post({ url: app.globalData.webUrl + 'api/users/setUserMobile', data: { encryptedData:res.detail.encryptedData, iv:res.detail.iv }, header: { 'Authorization':'bearer '+app.globalData.token }, success: function (r) { if(r.data.code=='0'){ that.signup(r.data.mobile); }else{ that.setData({ errorText:r.data.msg, errorflag:true }) } } }) } }, signup:function(mobile){ const that=this; utils.$post({ url: app.globalData.webUrl + 'client/index/signUp', data: { name:'', remark:'', mobile:mobile, type:that.data.vrType+'Vr', id: that.data.aid, }, header: { 'Authorization':'bearer '+app.globalData.token }, success: function (r) { if(r.data.code=='0'){ wx.showToast({ title: '恭喜您报名成功', icon:'none' }) } } }) }, /** * 生命周期函数--监听页面显示 */ onShow: function () { timer = setInterval(function () { time = (time * 1) + 1; }, 1000) if(JSON.stringify(app.globalData.sharepersonobj) != "{}"&&!!app.globalData.sharepersonobj){ this.setData({ personobj:app.globalData.sharepersonobj }) }else if(JSON.stringify(app.globalData.personMsg) != "{}"){ var obj = app.globalData.personMsg; obj.name = app.globalData.personMsg.binded ? app.globalData.personMsg.binded.name : ''; this.setData({ personobj:obj }) } this.setData({ companyobj:app.globalData.companyobj, imgUrl: app.globalData.imgUrl, }) }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { if (timer) { clearInterval(timer); } if (!!this.data.aid) { this.visitimefun(); if (this.data.vrType == 'housetype') { this.visitimefun(this.data.vrType); } } }, visitimefun(typeStr) { const that = this; utils.$post({ url: app.globalData.webUrl + 'client/index/visit_due_time', header: { 'Authorization': 'bearer ' + app.globalData.token }, data: { id: that.data.aid, pipe_type: typeStr ? typeStr : that.data.vrType+'Vr', time: time, }, success: function (res) { console.log(res,'<<<<<'); } }) }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { if (!!this.data.aid) { this.visitimefun(); if (this.data.vrType == 'housetype') { this.visitimefun(this.data.vrType); } } }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, geTitle(){ const that = this; if (title && imgurl) { return false; } if(this.data.vrType=='company'){ title="在线逛展厅-"+app.globalData.companyobj.company_name; imgurl=app.globalData.imgUrl + 'xcx/aaa/vrcover.png'; }else if(this.data.vrType=='employeeCard'){ title=app.globalData.companyobj.company_name+'VR寻址'; imgurl=app.globalData.imgUrl+"/xcx/sharenamecard.png"; }else if(this.data.vrType=='materialCase'){ utils.$get({ url: app.globalData.webUrl + 'client/casedetail', header: { 'Authorization': 'bearer ' + app.globalData.token }, data: { id: this.data.aid, share:'146' }, success: function (res) { if (res.data.code == '0') { title=res.data.data.title+'的VR'; imgurl=res.data.data.cover_img; } } }) }else if(this.data.vrType=='building'){ utils.$get({ url: app.globalData.webUrl + 'client/building/view', header: { 'Authorization': 'bearer ' + app.globalData.token }, data: { id: this.data.aid, share:'146' }, success: function (res) { if (res.data.code == '0') { title=res.data.data.name+'的VR'; imgurl=res.data.data.cover[0]; } } }) }else if(this.data.vrType=='construction'){ utils.$post({ url: app.globalData.webUrl + 'client/construction/view', header: { 'Authorization': 'bearer ' + app.globalData.token }, data: { id: this.data.aid, share:'146' }, success: function (res) { if (res.data.code == '0') { title=res.data.data.name+'的VR'; imgurl=res.data.data.cover; } } }) } else if(this.data.vrType=='housetype'){ utils.$post({ url: app.globalData.webUrl + 'client/building/housetype_detail', header: { 'Authorization': 'bearer ' + app.globalData.token }, data: { id: this.data.aid, share:'146' }, success: function (res) { if (res.data.code == '0') { let dataObj = res.data.data; if (dataObj.room == 9) { dataObj.housetypename = "别墅"; } else { dataObj.housetypename = `${dataObj.room}室${dataObj.hall}厅${dataObj.bathroom}卫`; } title = dataObj.housetypename; if (dataObj.house_img && dataObj.house_img.length) { imgurl = dataObj.house_img[0]; } else { imgurl = ""; } if (that.data.isVr === 'vr') { that.vrFooterRecord(); } } } }) }else if(this.data.vrType=='groupVr'){ utils.$post({ url: app.globalData.webUrl + 'mobile/share/getEasyRead', header: { 'Authorization': 'bearer ' + app.globalData.token }, data: { sid: this.data.aid, share:'146' }, success: function (res) { if (res.data.code == '0') { let dataObj = res.data.data; title = dataObj.title?dataObj.title:'未命名的作品'; imgurl=dataObj.pic_path?dataObj.pic_path:''; } } }) } }, addsharetap: function (type) { let that = this; utils.$post({ url: app.globalData.webUrl + 'api/share/addlog', header: { 'Authorization': 'bearer ' + app.globalData.token }, data: { id: this.data.aid, type: this.data.vrType+'_vr', other_data:this.data.webUrl }, success: function (r) {} }) }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { if (this.data.vrType!='groupVr') { this.addsharetap('toolAll'); } let str = escape(this.data.webUrl); return { title: title, imageUrl:imgurl, path: '/pages/other/other?ctp=' + app.globalData.clientype+'&uid='+ (app.globalData.shareuserid?app.globalData.shareuserid:app.globalData.personMsg.id) + '&type=vr&vrurl=' + str + '&aid=' + this.data.aid+ '&cty='+this.data.vrType }; } })