123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922 |
- // 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:'',
- wshareshow:false,
- showTask:true,
- xhwwidth:'',
- bottom:26,
- emptype:'',
- isVr: "",
- userflag:false,
- isPrivacy: false,
- isAgree: 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') {
- wx.hideHomeButton();
- 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://wzh.nczyzs.com";
- 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}`;
- } else {
- if (app.globalData.personMsg && app.globalData.personMsg.id) {
- vrlink = vrlink.substring(0, vrlink.indexOf('/0/'));
- 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://wzh.nczyzs.com";
- 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}`;
- } else {
- if (app.globalData.personMsg && app.globalData.personMsg.id) {
- vrlink = vrlink.substring(0, vrlink.indexOf('/0/'));
- 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://wzh.nczyzs.com";
- 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}`;
- } else {
- if (app.globalData.personMsg && app.globalData.personMsg.id) {
- vrlink = vrlink.substring(0, vrlink.indexOf('/0/'));
- 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,
- })
- } else if (options.type == '0090') {
- this.setData({
- webUrl: app.globalData.webUrl + 'applet.html#/works?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype +"&platform="+app.globalData.platform,
- })
- } else if (options.type == '5995') {
- this.setData({
- webUrl: app.globalData.webUrl + 'applet.html#/trainmsg?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype +"&platform="+app.globalData.platform + "&from=1&tid=" + options.tid,
- })
- } else if (options.type == '5895') {
- this.setData({
- webUrl: app.globalData.webUrl + 'applet.html#/assessMsg?token=' + app.globalData.token + '&client_type=' + app.globalData.clientype +"&platform="+app.globalData.platform + "&from=1&pid=" + options.pid,
- })
- }
- this.setype();
- },
- //用户同意隐私协议
- agreePrivacy() {
- this.setData({
- isPrivacy: true,
- isAgree: true
- })
- },
- 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/code2session',
- 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){
- 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;
- }
- this.setData({
- platform: app.globalData.platform
- })
- const that=this;
- let webUrl=this.data.webUrl;
- let redurltest='https://hnweizhihui.xiaohongwu.nczyzs.com';//41
- let kjlurltest="https://pano337.p.kujiale.com";
- let jeajurltest="https://vr-17.justeasy.nczyzs.com";
- let jeajurltest1="https://vr.justeasy.nczyzs.com";
- let wlurltest1="https://panorama.m2m88.com";//26
- let wlurltest2="https://panorama.wlwno1.com";//27
- let nowurl="https://wzh.nczyzs.com";//22
- let wl360="https://vr.3d66.nczyzs.com"//26
- if(webUrl.substr(0, 41)==redurltest){
- wx.getSystemInfo({
- success (res) {
- let width=(res.windowWidth-16)*0.48;
- 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, 33)==jeajurltest||webUrl.substr(0, 30)==jeajurltest1){
- this.setData({
- type:3,
- platform:app.globalData.platform,
- })
-
- }else if(webUrl.substr(0, 26)==wlurltest1||webUrl.substr(0, 27)==wlurltest2||webUrl.substr(0, 26)==wl360){
- this.setData({
- type:4,
- platform:app.globalData.platform,
- })
- } else if (webUrl.substr(0, 22)==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) {
- if (!this.data.isAgree) {
- return false;
- }
- 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
- };
- }
- })
|