commonMethod.js 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204
  1. var app = getApp(); //获取应用实例
  2. const util = require('@/static/utils/util.js');
  3. const config = require('@/static/config.js');
  4. import requestConfig from '@/static/lib/requestConfig';
  5. import Bus from '@/common/bus';
  6. export default {
  7. data(){
  8. return {
  9. repeatFlag: false,//防止重复提交
  10. showShareOptions:false,//是否打开
  11. projectCode: "", //项目地块的id
  12. isInMakePhone: false,
  13. jumpTempData: null, //跳转页面之前检查是否授权,保存的参数
  14. }
  15. },
  16. watch:{
  17. },
  18. methods:{
  19. optionChange(val) {
  20. this.showShareOptions = val; //④外层调用组件方注册变更方法,将组件内的数据变更,同步到组件外的数据状态中
  21. },
  22. navigateToCityFromNav(e) {
  23. this.navigateToCity(e);
  24. },
  25. swipeItemClk(e) {
  26. this.navigateFuc(e);
  27. },
  28. cityProductComponentClk(e) {
  29. this.navigateFuc(e);
  30. },
  31. cityListComponentClk(e) {
  32. this.navigateFuc(e);
  33. },
  34. navigateToZhuangHu(e){
  35. let jumplink = e.currentTarget.dataset.jumplink;
  36. //已经认证的地址
  37. let jumpvalue = e.currentTarget.dataset.jumpvalue;
  38. if(!jumplink||!jumpvalue){
  39. uni.showToast({
  40. title:'敬请期待',
  41. icon:'none',
  42. duration:1500
  43. })
  44. }else{
  45. uni.navigateTo({
  46. url:`/onlineHouseHold/pages/chooseRoom/homePage?houseId=${jumpvalue}&activityId=${jumplink}`
  47. })
  48. }
  49. },
  50. //跳转到城市搜索页面
  51. navigateToCity(e) {
  52. uni.navigateTo({
  53. url: '/subPackage/pages/addressModule/addressModule'
  54. });
  55. },
  56. resetParentScroll() {
  57. this.scrollTop = this.old.scrollTop;
  58. this.$nextTick(() => {
  59. this.scrollTop = 0;
  60. });
  61. },
  62. /**
  63. * refresh视图,滚到顶部
  64. */
  65. refreshCityProductView() {
  66. this.scrollTop = this.old.scrollTop;
  67. this.$nextTick(() => {
  68. this.scrollTop = 0;
  69. });
  70. },
  71. expandCityProductView(e) {
  72. let one = app.globalData.systemInfo.windowWidth / 750; //获取rpx 和 px 的转换比例
  73. console.log("expandCityProductView:" + JSON.stringify(e));
  74. let scrollDistance = e.scrollDistance;
  75. scrollDistance += this.scrollDistance2;
  76. if (this.navigateHasPadding) {
  77. scrollDistance -= app.globalData.navigateStatusContainerHeight;
  78. }
  79. console.log("expandCityProductView111:" + scrollDistance);
  80. if (this.specialPage) {
  81. scrollDistance -= 69 * one;
  82. scrollDistance -= 6;
  83. console.log("expandCityProductView222:" + scrollDistance);
  84. }
  85. if(this.houseId){//如果是集团页面-原代码是放置在tabview中的-此处判断有扩大范围
  86. let marginTop = e.marginTop.replace('rpx', "") || 0
  87. scrollDistance -= marginTop * one;
  88. }
  89. this.scrollTop = this.old.scrollTop;
  90. this.$nextTick(() => {
  91. this.scrollTop = scrollDistance;
  92. });
  93. },
  94. expandCityListView(e) {
  95. let one = app.globalData.systemInfo.windowWidth / 750; //获取rpx 和 px 的转换比例
  96. console.log("expandCityListView:" + JSON.stringify(e));
  97. let scrollDistance = e.scrollDistance;
  98. scrollDistance += this.scrollDistance2;
  99. if (this.navigateHasPadding) {
  100. scrollDistance -= app.globalData.navigateStatusContainerHeight;
  101. }
  102. console.log("expandCityProductView111:" + scrollDistance);
  103. if (this.specialPage) {
  104. scrollDistance -= 69 * one;
  105. scrollDistance -= 6;
  106. console.log("expandCityProductView222:" + scrollDistance);
  107. }
  108. if(this.houseId){//如果是集团页面-原代码是放置在tabview中的-此处判断有扩大范围
  109. let marginTop = e.marginTop.replace('rpx', "") || 0
  110. scrollDistance -= marginTop * one;
  111. }
  112. this.scrollTop = this.old.scrollTop;
  113. this.$nextTick(() => {
  114. this.scrollTop = scrollDistance;
  115. });
  116. },
  117. swipeUnitScrollHandle(e) {
  118. console.log("swipeUnitScrollHandle:" + JSON.stringify(e));
  119. if (e.detail.event == 0) {
  120. this.scrollAble = false;
  121. } else {
  122. this.scrollAble = true;
  123. }
  124. },
  125. //用户信息授权结束后-执行 可根据type 知道是否授权成功
  126. afterUserHandle(e) {
  127. console.warn("afterUserHandle", e);
  128. var _type = e.detail ? e.detail.type : e.type;
  129. let isSuc = _type === 'fail' ? false : true;
  130. let currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
  131. let para = {
  132. type: 'CLK', //埋点类型
  133. clkId: 'clk_2cmina_137', //点击ID,固定
  134. clkName: "wechatauthorize", //点击名称
  135. clkParams: {
  136. "userInfo": app.globalData.userInfo || '',
  137. "phone": app.globalData.phone || '',
  138. "uni.authorize.scope": "uni.getUserInfo",
  139. "type": _type,
  140. },
  141. };
  142. util.trackRequest(para);
  143. if (e) {
  144. this.showInfoModel = false;
  145. }
  146. },
  147. async afterShareOptionHandle(e) {
  148. if (this.repeatFlag) {
  149. return;
  150. }
  151. this.repeatFlag = true;
  152. var pages = getCurrentPages();
  153. var page = pages[pages.length - 1];//当前页面
  154. var pageInstance = page ? page.$vm : {};//页面实例,可以调用页面实例定义的方法
  155. var currentRoute = page ? page.route : "";//当前页面路径
  156. console.log("afterShareOptionHandle", currentRoute);
  157. if (!currentRoute.startsWith('/')) {
  158. currentRoute = ('/' + currentRoute);
  159. }
  160. let path = currentRoute;
  161. let subtype = "",houseId='',fromProject='',logo='',gpName='',pageId='',fromBrand=false;
  162. // let componentId = app.globalData.componentId || pageInstance.componentId||'';
  163. // let componentType = app.globalData.componentType || pageInstance.componentType||'';
  164. if(currentRoute.indexOf('/groupIndex')>-1){//集团首页
  165. subtype = 'brand';
  166. houseId = '';
  167. fromProject = app.globalData.brandShare;
  168. logo = app.globalData.logo || '';
  169. gpName = app.globalData.projectName || '';
  170. fromBrand = true;
  171. }
  172. else if(currentRoute.indexOf('/index/index/')>-1){//项目首页
  173. subtype = 'project';
  174. houseId = pageInstance.houseId;
  175. fromProject = app.globalData.projectShare;
  176. logo = app.globalData.houseProject.logo || '';
  177. gpName = app.globalData.houseProject.projectName || '';
  178. }
  179. else if(pageInstance.houseId){//项目层
  180. subtype = 'project';
  181. houseId = pageInstance.houseId;
  182. fromProject = app.globalData.projectShare;
  183. logo = app.globalData.houseProject.logo || '';
  184. gpName = app.globalData.houseProject.projectName || '';
  185. pageId = pageInstance.pageId || '';
  186. fromBrand = pageInstance.fromBrand || '';
  187. }
  188. else{ //集团层
  189. subtype = 'brand';
  190. houseId = '';
  191. fromProject = app.globalData.brandShare;
  192. logo = app.globalData.logo || '';
  193. gpName = app.globalData.projectName || '';
  194. pageId = pageInstance.pageId || '';
  195. fromBrand = pageInstance.fromBrand || '';
  196. }
  197. let attrs = {
  198. shareType: 'qrcode',
  199. fromProject: fromProject,
  200. pageId: pageId,
  201. fromBrand: fromBrand,
  202. // componentId:componentId,
  203. // componentType:componentType,
  204. };
  205. if(path.indexOf('/activityWorking')>-1){//活动页面
  206. attrs.sharerId = pageInstance.currentShareInfo && pageInstance.currentShareInfo.productionOwnerId ? pageInstance.currentShareInfo.productionOwnerId : '';
  207. attrs.productionId = pageInstance.currentShareInfo && pageInstance.currentShareInfo.productionId ? pageInstance.currentShareInfo.productionId : '';
  208. attrs.activityPageId = pageInstance.activityPageId;
  209. attrs.activityId = pageInstance.activityId;
  210. }
  211. else if(path.indexOf('/photoActivity')>-1){//摄影大赛
  212. attrs.sharerId = pageInstance.currentShareInfo && pageInstance.currentShareInfo.productionOwnerId ? pageInstance.currentShareInfo.productionOwnerId : '';
  213. attrs.productionId = pageInstance.currentShareInfo && pageInstance.currentShareInfo.productionId ? pageInstance.currentShareInfo.productionId : '';
  214. attrs.activityId = pageInstance.activityId;
  215. if (pageInstance.currentShareInfo && pageInstance.currentShareInfo.productionOwnerId) {
  216. path = '/activityPackage/pages/photoCenter/photoCenter'
  217. } else {
  218. path = '/activityPackage/pages/photoActivity/photoActivity'
  219. }
  220. }
  221. let sign = await app.setShareToken({
  222. subtype: subtype,
  223. houseId: houseId,
  224. attrs: attrs,
  225. });
  226. let obj = {
  227. type: 8,
  228. path: path,
  229. shareToken: sign || app.globalData.shareToken,
  230. houseId: houseId,
  231. logo: logo, //logo图片
  232. gpName: gpName, //名称
  233. defaultImage: 'https://dm.static.elab-plus.com/miniprogramDemo/projectDemo/demo1.png',
  234. };
  235. if(path.indexOf('/activityWarmUp')>-1 || path.indexOf('/activityWorking')>-1
  236. || path.indexOf('/photoActivity')>-1 || path.indexOf('/photoCenter')>-1){//预热页 活动页 摄影大赛
  237. obj.isActivity = 1;
  238. obj.defaultImage = pageInstance.activityDataDetail&&pageInstance.activityDataDetail.poster?pageInstance.activityDataDetail.poster:''
  239. }
  240. app.globalData.shareCardData = JSON.stringify(obj);
  241. uni.navigateTo({
  242. url: '/pages/shareCard/shareCard?houseId=' + houseId,
  243. })
  244. setTimeout(() => {
  245. this.repeatFlag = false;
  246. }, 2000)
  247. },
  248. //需要授权的跳转
  249. jumpCheck(e) {
  250. this.jumpTempData = e;
  251. app.globalData.authComponentData = {
  252. componentType:e.currentTarget.dataset.clickid || '',
  253. componentId:e.currentTarget.dataset.areacpid || '',
  254. componentJumpType:e.currentTarget.dataset.jumptype
  255. }
  256. this.componentId = e.currentTarget.dataset.areacpid || '';
  257. this.componentType = e.currentTarget.dataset.clickid || '';
  258. this.diyArea = e.currentTarget.dataset.diyarea || '';
  259. if (e.currentTarget.dataset.jumptype == 0 && e.currentTarget.dataset.functype != 4) {
  260. return
  261. }
  262. this.afterAuthCheck()
  263. },
  264. afterAuthCheck(isSuc) {
  265. console.log(this.jumpTempData, 'afterAuthCheck即将跳转')
  266. if (this.jumpTempData) {
  267. if (this.jumpTempData.currentTarget.dataset.functype == 4) {
  268. this.goChatList(this.jumpTempData);
  269. } else if (this.jumpTempData.currentTarget.dataset.jumplink &&
  270. (this.jumpTempData.currentTarget.dataset.jumplink.indexOf('wxxf.fangzg') > -1 ||
  271. this.jumpTempData.currentTarget.dataset.jumplink.indexOf('wxxf.niu6666') > -1) && !app.globalData
  272. .phone) {
  273. uni.showToast({
  274. title: '您未授权号码,无法进入',
  275. icon: 'none',
  276. duration: 1500,
  277. });
  278. } else {
  279. this.navigateFuc(this.jumpTempData)
  280. }
  281. this.jumpTempData = null
  282. }
  283. },
  284. /**
  285. * 跳转方法
  286. */
  287. async navigateFuc(e) {
  288. var self = this;
  289. console.log("navigateFuc", e);
  290. let currPageRoute = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length -1].route : null;
  291. // let currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
  292. // if (currPage) {
  293. // currPage.componentId = e.currentTarget.dataset.areacpid || '';
  294. // currPage.componentType = e.currentTarget.dataset.clickid || '';
  295. // currPage.diyArea = e.currentTarget.dataset.diyarea || '';
  296. // }
  297. // 跳转的时候记录下这个组件的相关信息-需要在跳转完成后清空
  298. app.globalData.componentId = e.currentTarget.dataset.areacpid || '';
  299. app.globalData.componentType = e.currentTarget.dataset.clickid || '';
  300. app.globalData.diyArea = e.currentTarget.dataset.diyarea || '';
  301. //兼容链接跳转中有其他原生页的形式
  302. if (e.currentTarget.dataset.jumptype == 1) {
  303. let link = e.currentTarget.dataset.jumplink;
  304. if (link && link.startsWith('/')) {
  305. e.currentTarget.dataset.jumptype = 13;
  306. }
  307. }
  308. if (e.currentTarget.dataset.jumptype == -2 || e.currentTarget.dataset.jumptype == 14) { //打开本地分享弹窗
  309. this.navigateConcern(e);
  310. } else if (e.currentTarget.dataset.jumptype == 0) { //不跳转
  311. return false;
  312. } else if (e.currentTarget.dataset.jumptype == 1) { //h5
  313. this.navigateWebView(e);
  314. } else if (e.currentTarget.dataset.jumptype == 2) { //图集
  315. this.navigateImgSwip(e);
  316. } else if (e.currentTarget.dataset.jumptype == 3) { //户型-必须有houseid
  317. this.navigateHouseType(e);
  318. } else if (e.currentTarget.dataset.jumptype == 4) { //实时实景
  319. this.navigateMoment(e);
  320. } else if (e.currentTarget.dataset.jumptype == 5) { //小程序页面
  321. this.navigateToMiniPage(e);
  322. } else if (e.currentTarget.dataset.jumptype == 6) { //项目首页页面
  323. if(currPageRoute.indexOf('pages/index/index')>-1){//项目首页
  324. uni.showToast({
  325. title: '敬请期待',
  326. icon: 'none',
  327. duration: 1500,
  328. });
  329. return false;
  330. }
  331. else{ //不是项目首页才能跳转
  332. this.navigateToProjectIndexPage(e);
  333. }
  334. } else if (e.currentTarget.dataset.jumptype == 7) { //敬请期待
  335. this.navigateToWaitToast(e);
  336. } else if (e.currentTarget.dataset.jumptype == 8) { //筛选搜索
  337. this.navigateToSearch();
  338. } else if (e.currentTarget.dataset.jumptype == 9) { //资讯列表
  339. this.navigateToNewsList(e);
  340. } else if (e.currentTarget.dataset.jumptype == 10) { //条件搜索
  341. this.navigateToSearchForContation(e);
  342. } else if (e.currentTarget.dataset.jumptype == 12) { //条件搜索
  343. this.goNewVideo(e);
  344. } else if (e.currentTarget.dataset.jumptype == 17) { //条件搜索
  345. this.navigateToQuanMin(e);
  346. } else if (e.currentTarget.dataset.jumptype == 14) { //打开分享
  347. this.optionChange(true);
  348. } else if (e.currentTarget.dataset.jumptype == 15) { //集团视频看房
  349. this.goVideoChat(e);
  350. } else if (e.currentTarget.dataset.jumptype == 16) { //去往项目IM
  351. this.goChatList(e);
  352. } else if (e.currentTarget.dataset.jumptype == 13) { //其他原生页
  353. this.goOtherOriginPage(e)
  354. } else if (e.currentTarget.dataset.jumptype == 18) { //跳转其他小程序
  355. this.goOtherMini(e);
  356. } else if (e.currentTarget.dataset.jumptype == 20) { //装户购物车
  357. this.navigateToZhuangHuShopCar(e);
  358. } else if (e.currentTarget.dataset.jumptype == 21) { //跳转地图页面
  359. this.goMapPage(e);
  360. } else if (e.currentTarget.dataset.jumptype == 22) { //活动页面
  361. this.navigateToSplendActivity(e);
  362. } else if (e.currentTarget.dataset.jumptype == 23) { //预热页
  363. this.navigateToPreheatActivity(e);
  364. } else if (e.currentTarget.dataset.jumptype == 31) { //购房节
  365. this.navigateToBuyActivity(e);
  366. } else if (e.currentTarget.dataset.jumptype == 32) { //摄影大赛
  367. this.navigateToPhotoActivity(e);
  368. } else if (e.currentTarget.dataset.jumptype == 33) { //房贷计算器
  369. this.navigateToLoan(e);
  370. } else if (e.currentTarget.dataset.jumptype == 34) {
  371. this.goVrRoom(e)
  372. } else if (e.currentTarget.dataset.jumptype == 35) {
  373. app.goToShareFriend(e,this.houseId?1:0); // 0 集团,1 项目
  374. } else if (e.currentTarget.dataset.jumptype == 36) { //预约页面-不出现在集团层
  375. this.goAppointmentPage(e);
  376. } else if (e.currentTarget.dataset.jumptype == 70) { //问卷页面
  377. app.navigateToQuestionnaire(e,this.houseId?1:0); // 0 集团,1 项目
  378. } else if (e.currentTarget.dataset.jumptype == 37) {//去往新版搜索结果页
  379. app.navigateToSearchResult(e); //去往新版搜索结果页
  380. } else if (e.currentTarget.dataset.jumptype == 38) {//去往新版搜索结果页
  381. this.navigateToZhuangHu(e); //去往新版搜索结果页
  382. } else if (e.currentTarget.dataset.jumptype == 39) {//开启自动注册
  383. this.autoRegister(e); //自动注册
  384. }
  385. },
  386. //跳转集团身份认证页面
  387. async navigateToQuanMin(e) {
  388. // #ifndef MP-WEIXIN
  389. uni.showToast({
  390. title: '敬请期待',
  391. icon: 'none',
  392. duration: 1500,
  393. });
  394. return false;
  395. // #endif
  396. //没有认证的地址
  397. let jumplink = e.currentTarget.dataset.jumplink || "extraPackage/pages/panKeBao/record/record";
  398. //已经认证的地址
  399. let jumpvalue = e.currentTarget.dataset.jumpvalue || "extraPackage/pages/panKeBao/shareFriends/shareFriends";
  400. var pages = getCurrentPages();
  401. var page = pages[pages.length - 1];//当前页面
  402. var pageInstance = page ? page.$vm : {};//页面实例,可以调用页面实例定义的方法
  403. let data = {};
  404. let requestUrl = "";
  405. if(pageInstance.houseId){//项目层
  406. data = {
  407. customerId: (app.globalData.single && app.globalData.single.id) ? app.globalData.single.id : '',
  408. houseId: pageInstance.houseId,
  409. mobile: app.globalData.phone,
  410. };
  411. requestUrl = "getAuthenticationStatus";
  412. if (jumplink.indexOf('houseId') == -1) {
  413. let _next = jumplink.indexOf('?')>-1 ? ('&houseId=' + pageInstance.houseId) : ('?houseId=' + pageInstance.houseId)
  414. jumplink = jumplink + _next;
  415. }
  416. if (jumpvalue.indexOf('houseId') == -1) {
  417. let _next = jumpvalue.indexOf('?')>-1 ? ('&houseId=' + pageInstance.houseId) : ('?houseId=' + pageInstance.houseId)
  418. jumpvalue = jumpvalue + _next;
  419. }
  420. }
  421. else{//集团层
  422. data = {
  423. brandId: config.brandId,
  424. mobile: app.globalData.phone,
  425. };
  426. requestUrl = "getAuthenticationStatusOnBrand";
  427. }
  428. const res = await requestConfig(requestUrl, data);
  429. console.log("checkoutRecordStatus:", res);
  430. if (res.success && res.single && res.single.verificationStatus == 1) { //已完成身份认证
  431. if (!jumpvalue.startsWith('http')) {//不是一个URL链接,则执行跳转
  432. if (!jumpvalue.startsWith('/')) {
  433. jumpvalue = ('/' + jumpvalue);
  434. }
  435. uni.navigateTo({
  436. url: jumpvalue,
  437. });
  438. } else {//否则跳转到一个内嵌页面
  439. uni.navigateTo({
  440. url: '/pages/webView/webView?view=' + encodeURIComponent(jumpvalue),
  441. fail: function(res) {
  442. console.log(res)
  443. },
  444. });
  445. }
  446. } else {
  447. if (!jumplink.startsWith('http')) {
  448. if (!jumplink.startsWith('/')) {
  449. jumplink = ('/' + jumplink);
  450. }
  451. // jumplink += ('&showInformation=true');
  452. uni.navigateTo({
  453. url: jumplink,
  454. });
  455. } else {
  456. uni.navigateTo({
  457. url: '/pages/webView/webView?view=' + encodeURIComponent(jumplink),
  458. fail: function(res) {
  459. console.log(res)
  460. },
  461. });
  462. }
  463. }
  464. },
  465. /**
  466. * 关注项目或者分享
  467. * type:-1 关注项目
  468. * -2 转发分享
  469. */
  470. navigateConcern(e) {
  471. let type = e.currentTarget.dataset.jumptype;
  472. if (type == -1) {} else if (type == -2 || type == 14) {
  473. this.optionChange(true);
  474. }
  475. },
  476. // 自动注册
  477. autoRegister(e) {
  478. app.checkAuthTotal(5, (res) => {
  479. this.showPhoneModel = res.showPhoneModel
  480. this.showInfoModel = res.showInfoModel
  481. //已经有手机号和身份信息-不触发授权
  482. if (!res.showPhoneModel && !this.showInfoModel) {
  483. this.autoRegisterHandle();
  484. }
  485. else{//需要确保会触发授权-不然,注册的函数不会在这次授权执行,会带入下一次授权,可能会导致错误
  486. app.globalData.authCallbackList.push(this.autoRegisterHandle);
  487. }
  488. })
  489. },
  490. /**
  491. * 自动注册
  492. * @param e
  493. */
  494. async autoRegisterHandle() {
  495. // 表示已经有手机号且
  496. if(app.globalData.phone && (app.globalData.isUserInfo || uni.getStorageSync('userInfo'))){
  497. var userInfo = app.globalData.userInfo ? app.globalData.userInfo : uni.getStorageSync('userInfo');
  498. let parameter = {
  499. kolName: (userInfo && userInfo.nickName ? userInfo.nickName : "未知用户"),
  500. kolSex: '2',//未知性别-自动注册
  501. type: 1,//普通人-自动注册使用普通人
  502. kolMobile: app.globalData.phone,
  503. brandId: config.brandId,
  504. checkStatus: 0,
  505. creator: (userInfo && userInfo.nickName ? userInfo.nickName : "未知用户"), //待确定
  506. houseId: (this.houseId || ''),
  507. status: 1,
  508. all_income: 0,
  509. };
  510. const res = await requestConfig('anchorSave', parameter);
  511. if (res.success == true) {
  512. uni.showToast({
  513. title: '您已成功注册',
  514. icon: 'none',
  515. duration: 1500,
  516. })
  517. } else {
  518. uni.showToast({
  519. title: res.message,
  520. icon: 'none',
  521. duration: 1500,
  522. })
  523. }
  524. }
  525. },
  526. //拨打电话前置函数
  527. beforeNavigateMakePhone(e) {
  528. this.jumpTempData = e;
  529. app.checkAuthTotal(2, (res) => {
  530. if (res.showPhoneModel) {
  531. this.isInMakePhone = true;
  532. this.showPhoneModel = true;
  533. } else {
  534. this.navigateMakePhone()
  535. }
  536. })
  537. },
  538. /**
  539. * 拨打电话
  540. * @param e
  541. */
  542. navigateMakePhone() {
  543. let e = this.jumpTempData;
  544. let phone = e.currentTarget.dataset.phone;
  545. this.isInMakePhone = false;
  546. uni.makePhoneCall({
  547. phoneNumber: phone
  548. })
  549. },
  550. /**
  551. * 跳转原生H5
  552. * @param e
  553. */
  554. navigateWebView: function(e) {
  555. console.log(e.currentTarget.dataset);
  556. const title = e.currentTarget.dataset.title || '';
  557. const jumpLink = e.currentTarget.dataset.jumplink;
  558. console.log("title" + title);
  559. let currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
  560. let houseId = this.houseId || app.globalData.houseId || (currPage?currPage.houseId:'');
  561. if (jumpLink && jumpLink.length > 0) {
  562. app.globalData.currDespage = e.currentTarget.dataset.despage || "";
  563. let type = jumpLink.substring(jumpLink.lastIndexOf('.')).toLocaleLowerCase();
  564. // 如果H5连接的是视频则跳转到全屏播放视频的组件页面中
  565. if (type && type == ".mp4") {
  566. let url = '/pages/bearVideo/bearVideo?source=' + jumpLink + '&title=' + title;
  567. if (houseId) {
  568. url += ('&houseId=' + houseId);
  569. }
  570. uni.navigateTo({
  571. url: url,
  572. fail: function(res) {
  573. // fail
  574. console.log(res)
  575. },
  576. })
  577. } else {
  578. let webviewUrl = '/pages/webView/webView?view=' + encodeURIComponent(jumpLink) + '&title=' + title;
  579. if (houseId) {
  580. webviewUrl += ('&houseId=' + houseId);
  581. } else {
  582. webviewUrl += ('&brandId=' + config.brandId);
  583. }
  584. if (app.checkWebviewLink(jumpLink)) {
  585. uni.showToast({
  586. title: '敬请期待',
  587. icon: 'none',
  588. duration: 1500,
  589. })
  590. } else {
  591. uni.navigateTo({
  592. url: webviewUrl,
  593. fail: function(res) {
  594. console.log(res)
  595. },
  596. })
  597. }
  598. }
  599. app.makeClkTrackRequest(jumpLink)
  600. }
  601. },
  602. /**
  603. * desc:
  604. * 1,处理跳转户型或者户型详情
  605. * 2,选择户型列表或者户型楼栋
  606. *
  607. */
  608. async handleHouseType(e) {
  609. let link = e.currentTarget.dataset.jumplink;
  610. let value = e.currentTarget.dataset.jumpvalue;
  611. console.log("handleHouseType 跳转户型", e);
  612. if (value) { //房间下标
  613. uni.navigateTo({
  614. url: '/subPackage/pages/groupHouseTypeDetail/groupHouseTypeDetail?houseId=' + this.houseId +
  615. '&layoutId=' +
  616. value,
  617. });
  618. } else if (link) { //楼栋ID
  619. const res = await requestConfig('pageListLayoutByBuilding', {
  620. "houseId": this.houseId,
  621. buildingId: link
  622. });
  623. if (res && res.success && res.pageModel.resultSet) {
  624. if (res.pageModel.resultSet.length > 0) {//跳转的是户型列表
  625. let houseUrl = '/subPackage/pages/groupHouseType/groupHouseType?houseId=' + this.houseId +
  626. '&buildingId=' + link;
  627. if (app.globalData.houseProject.shareControl.houseModule == 2) {
  628. houseUrl = '/subPackage/pages/groupHouseList/groupHouseList?houseId=' + this.houseId +
  629. '&buildingId=' + link;
  630. }
  631. uni.navigateTo({
  632. url: houseUrl,
  633. });
  634. } else {
  635. uni.showToast({
  636. title: '敬请期待',
  637. icon: 'none',
  638. duration: 1500,
  639. })
  640. }
  641. } else {
  642. uni.showToast({
  643. title: '敬请期待',
  644. icon: 'none',
  645. duration: 1500,
  646. })
  647. }
  648. }
  649. },
  650. //户型-新版逻辑是不需要在路口处校验是否授权的
  651. navigateHouseType: function(e) {
  652. app.globalData.pageDesc = this.pvCurPageName ? this.pvCurPageName : (this.navbar ? this.navbar.pageName : '');
  653. if(this.houseId){
  654. this.handleHouseType(e);
  655. }
  656. else{
  657. uni.showToast({
  658. title: '敬请期待',
  659. })
  660. }
  661. },
  662. // 此时此刻
  663. async navigateMoment(e) {
  664. console.log('此时此刻', e);
  665. let _data = {}
  666. let currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
  667. let houseId = this.houseId || app.globalData.houseId || (currPage?currPage.houseId:'');
  668. if (houseId) {
  669. _data.houseId = houseId;
  670. } else {
  671. _data.brandId = config.brandId;
  672. }
  673. const res = await requestConfig('queryMomentCurrent', _data); //获取此时此刻当前播放内容
  674. if (res && res.success && res.single) { //存在视频则可以执行下一步
  675. let url = "";
  676. if (houseId) {
  677. url = '/pages/video/video?houseId=' + houseId;
  678. } else {
  679. url = '/pages/video/video?brandId=' + config.brandId;
  680. }
  681. // 个性化需求,运营要求针对这个页面强制改为集团层视频 3591
  682. if(this.pageId == 3601 || this.pageId == '3601' || this.pageId == 3591 || this.pageId == '3591'){
  683. url = url + "&fixBrand=1"
  684. }
  685. uni.navigateTo({
  686. url: url,
  687. })
  688. } else {
  689. uni.showToast({
  690. title: '敬请期待',
  691. })
  692. }
  693. },
  694. /**
  695. * 跳转项目首页
  696. * @param e
  697. */
  698. navigateToProjectIndexPage(e) {
  699. let houseId = e.currentTarget.dataset.jumpvalue;
  700. if (houseId && houseId.toString().length > 0) {
  701. uni.navigateTo({
  702. url: '/pages/index/index?houseId=' + houseId,
  703. fail: function(res) {
  704. console.log(res);
  705. },
  706. })
  707. }
  708. },
  709. //敬请期待
  710. navigateToWaitToast(e) {
  711. uni.showToast({
  712. title: '敬请期待'
  713. });
  714. },
  715. /**
  716. * 跳转搜索
  717. * @param e
  718. */
  719. navigateToSearch(type) {
  720. // 2021.8.16号产品确定所有集团的跳转都转到新的搜索页面上去
  721. let url = '/subPackage/pages/searchNewModule/searchNewModule';
  722. // if(config.brandId=='46'){//大悦城跳转到新的搜索结果页,其他不变
  723. // url = '/subPackage/pages/searchNewModule/searchNewModule';
  724. // }
  725. // if(config.brandId=='6'){//置地-个性化跳转
  726. // url = '/pages/screenSearchListModule/screenSearchListModule';
  727. // if (type) {
  728. // url = url + "?openType=" + type;
  729. // }
  730. // }
  731. uni.navigateTo({
  732. url: url,
  733. });
  734. },
  735. /**
  736. * 条件搜索
  737. * @param e
  738. */
  739. navigateToSearchForContation(e) {
  740. let url = '/subPackage/pages/searchCondition/searchCondition';
  741. uni.navigateTo({
  742. url: url,
  743. });
  744. },
  745. /**
  746. * 跳转资讯列表
  747. * @param e
  748. */
  749. navigateToNewsList(e) {
  750. let _url = "/subPackage/pages/news/newsList/newsList";
  751. let currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
  752. let houseId = this.houseId || app.globalData.houseId || (currPage?currPage.houseId:'');
  753. if (houseId) {
  754. _url = _url + "?houseId=" + houseId;
  755. }
  756. uni.navigateTo({
  757. url: _url
  758. });
  759. },
  760. //打开视频
  761. goNewVideo(e) {
  762. let currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
  763. const jumpLink = e.currentTarget.dataset.jumplink;
  764. const videoId = e.currentTarget.dataset.jumpvalue || '';
  765. const title = e.currentTarget.dataset.expand || '';
  766. let houseId = this.houseId || app.globalData.houseId || (currPage?currPage.houseId:'');
  767. let url = '/pages/bearVideo/bearVideo?source=' + jumpLink + '&title=' + title + '&videoId=' + videoId;
  768. if (houseId) {
  769. url += ('&houseId=' + houseId);
  770. }
  771. uni.navigateTo({
  772. url: url,
  773. })
  774. },
  775. // 集团视频看房
  776. goVideoChat(e) {
  777. if (!e.currentTarget.dataset) {
  778. uni.showToast({
  779. title: '敬请期待'
  780. });
  781. return
  782. }
  783. let url = "/imRoom/pages/multiroom/aide/aide";
  784. let currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
  785. let houseId = this.houseId || app.globalData.houseId || (currPage?currPage.houseId:'');
  786. if (houseId) {
  787. url += '?houseId=' + houseId;
  788. } else {
  789. // this.houseId = e.currentTarget.dataset.jumpvalue
  790. url += '?houseId=' + e.currentTarget.dataset.jumpvalue;
  791. }
  792. app.checkAuthTotal(2, (checkRes) => {
  793. this.showPhoneModel = checkRes.showPhoneModel;
  794. if (!checkRes.showPhoneModel) {
  795. // if (!houseId) {
  796. // this.houseId = "";
  797. // }
  798. uni.navigateTo({
  799. url: url,
  800. fail: (res) => {
  801. uni.showToast({
  802. duration: 1500,
  803. title: '敬请期待'
  804. });
  805. },
  806. })
  807. let param = {
  808. type: 'CLK', //埋点类型
  809. clkId: 'clk_2cmina_94', //点击ID
  810. clkName: 'videoChat-click', //点击前往的页面名称
  811. };
  812. util.trackRequest(param);
  813. }
  814. }, true);
  815. },
  816. // 同屏带看
  817. async goVrRoom(e){
  818. if (!e.currentTarget.dataset) {
  819. uni.showToast({
  820. title: '敬请期待'
  821. });
  822. return
  823. }
  824. app.goVrRoom(Number(e.currentTarget.dataset.jumpvalue),Number(e.currentTarget.dataset.jumplink))
  825. },
  826. //去往项目IM
  827. async goChatList(e) {
  828. let houseId = e.currentTarget.dataset.jumpvalue || this.houseId || app.globalData.houseId;
  829. if(!houseId){
  830. uni.showToast({
  831. title: '敬请期待'
  832. });
  833. return false;
  834. }
  835. console.log("***goChatList***",houseId)
  836. if (this.showPhoneModel || this.showInfoModel) {
  837. return false
  838. }
  839. // if (this.fromBrand) {
  840. // this.houseId = houseId;
  841. // }
  842. app.checkAuthTotal(2, (checkRes) => {
  843. this.showPhoneModel = checkRes.showPhoneModel;
  844. if (!checkRes.showPhoneModel) {
  845. // if (this.fromBrand) {
  846. // this.houseId = "";
  847. // }
  848. if (app.handleGoChat(houseId)) {
  849. console.log("***goChatList-over***")
  850. }
  851. }
  852. }, true);
  853. },
  854. /**
  855. * 查询集团项目GUID
  856. */
  857. async getProjectGUIDByHouseId() {
  858. let requestData = {
  859. houseId: this.houseId
  860. };
  861. const res = await requestConfig('getProjectGUIDByHouseId', requestData);
  862. if (res && res.success && res.single) {
  863. this.projectCode = res.single;
  864. }
  865. },
  866. async goOtherMini(e) { //打开其他小程序
  867. let jumpLink = e.currentTarget.dataset.jumplink; //路径
  868. let appid = e.currentTarget.dataset.jumpvalue || ''; //appid
  869. jumpLink = jumpLink.trim();
  870. let projectCodeIdx = jumpLink.indexOf('?projectCode=');
  871. if(projectCodeIdx >= 0){
  872. this.projectCode = jumpLink.substring(projectCodeIdx+13,jumpLink.length);
  873. jumpLink = jumpLink.substring(0,projectCodeIdx);
  874. }
  875. let extraData = {};
  876. //只有项目层才会触发该逻辑
  877. if (appid == 'wx38d0e39f4c57c4de' && this.houseId) {
  878. if (!this.projectCode) {
  879. await this.getProjectGUIDByHouseId();
  880. }
  881. if (!app.globalData.phone) {//必须存在手机号才行
  882. // this.forceGetPhoneForMiniJumpData = e;
  883. this.showPhoneModel = true;//尝试唤出手机号授权弹窗
  884. // this.forceGetPhoneForMiniJump = true;
  885. return
  886. }
  887. extraData = {
  888. projectcode: this.projectCode, //项目code
  889. phonenumber: app.globalData.phone, //手机号
  890. consultanttel: '', //置业顾问手机(可为空):
  891. consultantname: '', //置业顾问名称(可为空):
  892. }
  893. console.log("navigate to Other miniprogram", extraData);
  894. }
  895. uni.navigateToMiniProgram({
  896. appId: appid,
  897. path: jumpLink,
  898. extraData: extraData,
  899. envVersion: 'release',
  900. fail(err) {
  901. console.warn("***打开其他小程fail***", err)
  902. }
  903. })
  904. },
  905. ///打开小程序中的原生页面
  906. async goOtherOriginPage(e) {
  907. var self = this;
  908. let link = e.currentTarget.dataset.jumplink;
  909. if (link.startsWith('/')) {
  910. link = link.substring(link.indexOf('/') + 1);
  911. }
  912. link = link.trim();
  913. console.log("goOtherOriginPage-link:" + link);
  914. // #ifdef MP-WEIXIN
  915. if ((link.indexOf('/scoreCenter') > -1 || link.indexOf('/myCard') > -1 || link.indexOf('/liveRoom') > -1)
  916. && !app.globalData.phone) {
  917. this.showPhoneModel = true;//尝试唤出手机号授权弹窗
  918. return
  919. }
  920. // #endif
  921. // #ifndef MP-WEIXIN
  922. if (link.indexOf("/panKeBao") > -1 || link.indexOf("/defineShare/defineShare") > -1
  923. || link.indexOf("/myCard/myCard") > -1 || link.indexOf('liveRoom') > -1) {
  924. uni.showToast({
  925. title: '敬请期待',
  926. icon: 'none',
  927. duration: 1500,
  928. });
  929. return false;
  930. }
  931. // #endif
  932. // 当是主播认证页面,则在这个接口,查询主播是否认证过
  933. // 并且有手机号码,则去查询后台
  934. if (link.includes('extraPackage/pages/hostProve/hostProve') && app.globalData.phone) {
  935. let obj = await this.queryAnchorInfo(app.globalData.phone);
  936. if (obj.status) {
  937. link = obj.url;
  938. }
  939. }
  940. if(this.houseId){//如果存在项目id
  941. if(!link.includes('&houseId=')&&!link.includes('?houseId=')){
  942. if (link.indexOf('?') == -1) {
  943. link = link + '?houseId=' + self.houseId;
  944. } else {
  945. link = link + '&houseId=' + self.houseId;
  946. }
  947. }
  948. }else{
  949. if (link.indexOf('?') >= 0) {
  950. link += '&fromBrand=true';
  951. } else {
  952. link += '?fromBrand=true';
  953. }
  954. }
  955. uni.navigateTo({
  956. url: '/' + link,
  957. fail: (res) => {
  958. uni.showToast({
  959. title: '敬请期待',
  960. icon: 'none',
  961. duration: 1500,
  962. });
  963. },
  964. })
  965. },
  966. /**
  967. * 跳转到其他原生页
  968. * @param e
  969. */
  970. navigateToMiniPage(e) {
  971. var self = this;
  972. let link = e.currentTarget.dataset.jumplink;
  973. let pageId = e.currentTarget.dataset.jumpvalue;
  974. let currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
  975. let houseId = this.houseId || app.globalData.houseId || (currPage?currPage.houseId:'');
  976. if (link.startsWith('/')) {
  977. link = link.substring(link.indexOf('/') + 1);
  978. }
  979. link = link.trim();
  980. console.log("navigateToMiniPage-link:" + link);
  981. if(!link){
  982. uni.showToast({
  983. title: '敬请期待'
  984. });
  985. return false;
  986. }
  987. //跳转集团首页
  988. if (link.indexOf("groupIndex1") >= 0 || link.indexOf("groupIndex2") >= 0
  989. || link.indexOf("groupIndex3") >= 0 || link.indexOf("groupIndex4") >= 0) {
  990. uni.switchTab({
  991. url: "/" + link,
  992. })
  993. } else {
  994. let url = '/' + link + '?pageId=' + pageId;
  995. if (!houseId) {
  996. url += '&fromBrand=true';
  997. } else {
  998. url += ('&houseId=' + houseId);
  999. }
  1000. uni.navigateTo({
  1001. url: url,
  1002. fail: (res) => {
  1003. uni.showToast({
  1004. title: '敬请期待'
  1005. });
  1006. }
  1007. })
  1008. }
  1009. },
  1010. //跳转图集-新版逻辑是不需要在路口处校验是否授权的
  1011. navigateImgSwip(e) {
  1012. var self = this;
  1013. let type = e.currentTarget.dataset.jumpvalue;
  1014. if(!type){//没有跳转的图集类型,数据不合法
  1015. uni.showToast({
  1016. title: '敬请期待',
  1017. });
  1018. return false;
  1019. }
  1020. let _url = '/subPackage/pages/groupScaleImg/groupScaleImg?type=' + type
  1021. if(this.houseId){
  1022. _url = _url + '&houseId=' + this.houseId;
  1023. }
  1024. else{
  1025. _url = _url + '&brandId=' + config.brandId;
  1026. }
  1027. uni.navigateTo({
  1028. url: _url,
  1029. });
  1030. },
  1031. //房贷计算器
  1032. navigateToLoan(e) {
  1033. let path = "/subPackage/pages/calculator/calculatorSwitch/calculatorSwitch";
  1034. if (this.houseId) {
  1035. path += ('?houseId=' + this.houseId);
  1036. }
  1037. uni.navigateTo({
  1038. url: path
  1039. })
  1040. },
  1041. //活动页面
  1042. navigateToSplendActivity(e) {
  1043. //不存在pageid
  1044. if(!e.currentTarget.dataset.jumpvalue){
  1045. uni.showToast({
  1046. title: '敬请期待',
  1047. });
  1048. return false;
  1049. }
  1050. let path = "/activityPackage/pages/activityWorking/activityWorking";
  1051. let value = JSON.parse(e.currentTarget.dataset.jumpvalue);
  1052. let pageId = value.pageId;
  1053. path += '?activityPageId=' + e.currentTarget.dataset.jumplink + '&pageId=' + pageId
  1054. if (this.houseId) {
  1055. path += ('&houseId=' + this.houseId);
  1056. }
  1057. else{
  1058. path += '&fromBrand=true';
  1059. }
  1060. uni.navigateTo({
  1061. url: path
  1062. })
  1063. },
  1064. //预热页
  1065. navigateToPreheatActivity(e) {
  1066. //不存在pageid
  1067. if(!e.currentTarget.dataset.jumpvalue){
  1068. uni.showToast({
  1069. title: '敬请期待',
  1070. });
  1071. return false;
  1072. }
  1073. let url = '/activityPackage/pages/activityWarmUp/activityWarmUp?pageId=' + e.currentTarget.dataset.jumpvalue;
  1074. if (this.houseId) {
  1075. url += ('&houseId=' + this.houseId);
  1076. }
  1077. else{
  1078. url += '&fromBrand=true';
  1079. }
  1080. uni.navigateTo({
  1081. url: url
  1082. })
  1083. },
  1084. //摄影大赛
  1085. navigateToPhotoActivity(e) {
  1086. //不存在pageid
  1087. if(!e.currentTarget.dataset.jumpvalue){
  1088. uni.showToast({
  1089. title: '敬请期待',
  1090. });
  1091. return false;
  1092. }
  1093. let path = "/activityPackage/pages/photoActivity/photoActivity?pageId=" + e.currentTarget.dataset.jumpvalue;
  1094. if (this.houseId) {
  1095. path += ('&houseId=' + this.houseId);
  1096. }
  1097. else{
  1098. path += '&fromBrand=true';
  1099. }
  1100. uni.navigateTo({
  1101. url: path
  1102. })
  1103. },
  1104. //购房节
  1105. navigateToBuyActivity(e) {
  1106. //不存在pageid
  1107. if(!e.currentTarget.dataset.jumplink){
  1108. uni.showToast({
  1109. title: '敬请期待',
  1110. });
  1111. return false;
  1112. }
  1113. let path = "/activityPackage/pages/activityCommonPages/activityCommonPages";
  1114. let houseId = e.currentTarget.dataset.jumpvalue;
  1115. if (houseId) {
  1116. path += ('?pageId=' + e.currentTarget.dataset.jumplink + '&houseId=' + houseId)
  1117. } else {
  1118. path += ('?pageId=' + e.currentTarget.dataset.jumplink + '&fromBrand=true')
  1119. }
  1120. uni.navigateTo({
  1121. url: path
  1122. })
  1123. },
  1124. //跳转地图页面
  1125. goMapPage(e){
  1126. if(!this.houseId){
  1127. uni.showToast({
  1128. title: '敬请期待',
  1129. icon: 'none',
  1130. duration: 1500,
  1131. })
  1132. return
  1133. }
  1134. let url = config.host + '/index.html#/pages/zongMap/map?houseId=' + this.houseId;
  1135. uni.navigateTo({
  1136. url: '/pages/webView/webView?view=' + encodeURIComponent(url) +
  1137. '&title=地段配套' + '&houseId=' + this.houseId,
  1138. fail: function(res) {
  1139. console.log(res)
  1140. },
  1141. })
  1142. },
  1143. // 去往预约页面
  1144. goAppointmentPage(e){
  1145. let pageId = e.currentTarget.dataset.jumpvalue;
  1146. let houseId = this.houseId||''
  1147. if(!pageId){
  1148. uni.showToast({
  1149. title: '敬请期待',
  1150. icon: 'none',
  1151. duration: 1500,
  1152. });
  1153. return
  1154. }
  1155. let path = '/activityPackage/pages/appointment/appointment?houseId=' + houseId + '&pageId='+pageId;
  1156. if (!this.houseId) {
  1157. path += '&fromBrand=true'
  1158. }
  1159. uni.navigateTo({
  1160. url: path,
  1161. fail: (res) => {
  1162. uni.showToast({
  1163. title: '敬请期待'
  1164. });
  1165. },
  1166. })
  1167. },
  1168. /**
  1169. * 跳转装户购物车
  1170. * @param e
  1171. */
  1172. navigateToZhuangHuShopCar(e) { //跳转装户购物车
  1173. uni.navigateTo({
  1174. url: '/onlineHouseHold/pages/roomShoppingCart/roomShoppingCart',
  1175. })
  1176. },
  1177. // 查询主播信息
  1178. async queryAnchorInfo(mobile) {
  1179. uni.showLoading({
  1180. title: '加载中'
  1181. });
  1182. const res = await requestConfig('anchorInfo', {
  1183. mobile,
  1184. brandId: config.brandId,
  1185. });
  1186. uni.hideLoading();
  1187. if (res.success && res.single && res.single.checkStatus !==2) {
  1188. // 正在审核中
  1189. return {
  1190. url: `extraPackage/pages/results/results?type=${res.single.checkStatus}`,
  1191. status: true
  1192. }
  1193. } else {
  1194. return {
  1195. status: false
  1196. };
  1197. }
  1198. },
  1199. }
  1200. }