1
0

materialcase.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804
  1. // index/pages/casemsg/casemsg.js
  2. const app = getApp();
  3. var utils = require("../../../utils/http")
  4. let time = 0;
  5. var timer = null;
  6. var designTimer = null;
  7. Page({
  8. /**
  9. * 页面的初始数据
  10. */
  11. data: {
  12. top: app.globalData.statusBarHeight,
  13. hgt: app.globalData.titleBarHeight,
  14. imgUrl: app.globalData.imgUrl,
  15. communityht: '',
  16. cid: '',
  17. casemsgobj: {},
  18. page: 1,
  19. shareid: '',
  20. loginFlag: false,
  21. phoneFlag:false,
  22. canIUseGetUserProfile: false,
  23. datashow: false,
  24. personMsg: {},
  25. caselist: [],
  26. leftcaselist: [],
  27. rightcaselist: [],
  28. sharepersonMsg: app.globalData.sharepersonobj,
  29. employeeflag: false,//false是用户,true是员工
  30. companyobj: {},
  31. articlelogin: false,
  32. scrollTop: 0,
  33. showAction: false,
  34. showAddress: false,
  35. imgarr:[],
  36. type:'',//有值代表是从其他页面进来的
  37. ctype:'',
  38. priceflag: false,
  39. swiperIndex:0,
  40. tab: [{
  41. name: 'VR案例',
  42. type: 'vr',
  43. count: 0
  44. }, {
  45. name: '视频案例',
  46. type: 'video',
  47. count: 0
  48. }],
  49. activeType: '',
  50. designPlan: false,
  51. isBroker: false,
  52. showMask: false,
  53. fPhone: "",
  54. agid: ""
  55. },
  56. /**
  57. * 生命周期函数--监听页面加载
  58. */
  59. onLoad: function (options) {
  60. var that = this;
  61. time = 0;
  62. wx.hideHomeButton();
  63. that.setData({
  64. top: app.globalData.statusBarHeight,
  65. hgt: app.globalData.titleBarHeight,
  66. imgUrl: app.globalData.imgUrl,
  67. })
  68. if(options.type){
  69. this.setData({
  70. type:options.type
  71. })
  72. }
  73. if (wx.getUserProfile) {
  74. this.setData({
  75. canIUseGetUserProfile: true
  76. })
  77. }
  78. if (!!options.scene) {
  79. options = unescape(options.scene);
  80. let arr = options.split('&');
  81. let obj = {};
  82. for (let i = 0; i < arr.length; i++) {
  83. let arr1 = arr[i].split('=');
  84. obj[arr1[0]] = arr1[1];
  85. }
  86. if (obj.g) {
  87. that.setData({
  88. cid: obj.a,
  89. shareid: obj.u,
  90. isBroker: true,
  91. agid: obj.g
  92. })
  93. app.globalData.clientype = obj.c;
  94. app.globalData.shareuserid = obj.u;
  95. app.globalData.brokeruserId = obj.g;
  96. } else {
  97. that.setData({
  98. cid: obj.cid,
  99. shareid: obj.uid
  100. })
  101. app.globalData.clientype = obj.ctp;
  102. app.globalData.shareuserid = obj.uid;
  103. }
  104. } else {
  105. that.setData({
  106. cid: options.cid,
  107. shareid: options.uid
  108. })
  109. if (!!options.agid) {
  110. that.setData({
  111. isBroker: true,
  112. agid: options.agid
  113. })
  114. app.globalData.brokeruserId = options.agid;
  115. }
  116. app.globalData.clientype = options.ctp;
  117. app.globalData.shareuserid = options.uid;
  118. }
  119. this.login();
  120. },
  121. dothis(){},
  122. sharecompany: function () {
  123. const that = this;
  124. utils.$post({
  125. url: app.globalData.webUrl + 'client/index/content_belong_company',
  126. header: {
  127. 'Authorization': 'bearer ' + app.globalData.token
  128. },
  129. data: {
  130. client_type: app.globalData.clientype,
  131. uid: app.globalData.shareuserid
  132. },
  133. success: function (res) {
  134. if (res.data.code == '0') {
  135. app.globalData.companyobj=res.data.data;
  136. app.globalData.sharempid = res.data.data.employee_id;
  137. that.setData({
  138. companyobj: res.data.data
  139. })
  140. }
  141. },
  142. complete(res) {
  143. wx.hideLoading()
  144. }
  145. })
  146. },
  147. login: function () {
  148. var that = this;
  149. wx.login({
  150. success: function (data) {
  151. if (data.errMsg == 'login:ok') {
  152. utils.$post({
  153. url: app.globalData.webUrl + 'api/users/code2sessionmini',
  154. data: {
  155. code: data.code,
  156. share: app.globalData.shareuserid,
  157. client_type:app.globalData.clientype,
  158. share_agent_id: app.globalData.brokeruserId
  159. },
  160. success: function (r) {
  161. if (r.data.code == '0') {
  162. app.globalData.sharepersonobj = r.data.share;
  163. app.globalData.token = r.data.token;
  164. that.sharecompany();
  165. if (r.data.share) {
  166. app.globalData.vrString = r.data.share.str;
  167. }
  168. that.setData({
  169. sharepersonMsg: app.globalData.sharepersonobj,
  170. })
  171. app.globalData.companyname=r.data.company;
  172. app.globalData.official_openid = r.data.official_openid;
  173. app.globalData.agentEmployeEid = r.data.agent_employee_id;
  174. if (!!r.data.user.phone) {
  175. that.setData({
  176. fPhone: r.data.user.phone,
  177. articlelogin: true,
  178. loginFlag: false,
  179. phoneFlag: false,
  180. employeeflag: (!!r.data.user.binded && r.data.user.binded.state == '在职') ? true : false
  181. })
  182. app.globalData.personMsg = r.data.user;
  183. app.globalData.use_id = r.data.user.id;
  184. if (!!r.data.user.binded && r.data.user.binded.state == '在职'){
  185. app.globalData.currentUserId = r.data.user.binded.id;
  186. }
  187. var obj = {
  188. detail: 1
  189. }
  190. that.casemsgfun(obj);
  191. } else {
  192. that.casemsgfun();
  193. wx.hideLoading();
  194. that.setData({
  195. loginFlag: false,
  196. articlelogin: false,
  197. phoneFlag: true
  198. })
  199. }
  200. } else {
  201. setTimeout(function () {
  202. wx.hideLoading()
  203. }, 500)
  204. }
  205. }
  206. })
  207. }
  208. }
  209. })
  210. },
  211. cancelGetPhone() {
  212. designTimer = setTimeout(() => {
  213. this.setData({
  214. designPlan: true
  215. })
  216. },4000)
  217. },
  218. designertap(){
  219. if(!!this.data.casemsgobj.designer_id){
  220. wx.navigateTo({
  221. url: '/share/pages/designermsg/designermsg?did='+this.data.casemsgobj.designer_id+"&type=3"
  222. })
  223. }
  224. },
  225. presharelooktap() {
  226. if (!app.globalData.sharepersonobj.qrcode) {
  227. wx.showToast({
  228. title: "当前专属客服的二维码为空!",
  229. icon: 'none',
  230. duration: 2000
  231. })
  232. return false;
  233. }
  234. wx.previewImage({
  235. current: app.globalData.imgUrl + app.globalData.sharepersonobj.qrcode, // 当前显示图片的http链接
  236. urls: [app.globalData.imgUrl + app.globalData.sharepersonobj.qrcode]// 需要预览的图片http链接列表
  237. })
  238. },
  239. setypetap(e) {
  240. this.setData({
  241. ctype: e.currentTarget.dataset.type
  242. })
  243. },
  244. swiperChange (e) {
  245. let type = e.detail.currentItemId.split('-')[0];
  246. this.setData({
  247. activeType: type
  248. })
  249. },
  250. prelooktap(e){
  251. let arr=[];
  252. for(let i in this.data.imgarr){
  253. arr.push(app.globalData.imgUrl+this.data.imgarr[i].img);
  254. }
  255. wx.previewImage({
  256. current: e.currentTarget.dataset.img, // 当前显示图片的 http 链接
  257. urls: arr // 需要预览的图片 http 链接列表
  258. })
  259. },
  260. /**
  261. * 前往个人名片
  262. */
  263. toPageNameCard() {
  264. wx.navigateTo({
  265. url: '/share/pages/shareCard/shareCard?uid='+ app.globalData.shareuserid + '&ctp=' + app.globalData.clientype + '&empid=' + app.globalData.sharempid + '&ftype=share',
  266. })
  267. },
  268. golastap: function () {
  269. wx.navigateBack({
  270. delta: 1,
  271. success:function(r){
  272. },
  273. fail:function(r){
  274. wx.reLaunch({
  275. url: '/pages/index/index?state=1',
  276. })
  277. },
  278. })
  279. },
  280. goindextap:function(){
  281. if(!this.data.employeeflag){
  282. wx.reLaunch({
  283. url: '/pages/index/index',
  284. })
  285. }else{
  286. wx.reLaunch({
  287. url: '/pages/consoledesk/consoledesk',
  288. })
  289. }
  290. },
  291. callphonetap: function () {
  292. console.log()
  293. wx.makePhoneCall({
  294. phoneNumber: app.globalData.sharepersonobj.phone //仅为示例,并非真实的电话号码
  295. })
  296. },
  297. lookcasefun() {
  298. let casemsgobj = this.data.casemsgobj;
  299. casemsgobj.desccontentmsg = casemsgobj.desc;
  300. casemsgobj.realdesc = casemsgobj.real_case;
  301. this.setData({
  302. casemsgobj: casemsgobj
  303. })
  304. },
  305. handleSwitch(e) {
  306. let type = e.currentTarget.dataset.type;
  307. let swiperIndex=0;
  308. if (type == 'vr') {
  309. swiperIndex = 0;
  310. } else if (type == 'video') {
  311. swiperIndex = !!this.data.casemsgobj.vr_case?1:0;
  312. }
  313. this.setData({
  314. swiperIndex: swiperIndex,
  315. activeType: type,
  316. })
  317. },
  318. openVRLink(e) {
  319. let type = e.currentTarget.dataset.type;
  320. if (type == 1) {
  321. let vrlink = this.data.casemsgobj.vr_case;
  322. wx.navigateTo({
  323. url: '/pages/other/other?type=vr&vrurl=' + escape(vrlink) + '&cty=materialCase' + '&uid=' + app.globalData.shareuserid + '&ctp=' + app.globalData.clientype + '&aid=' + this.data.casemsgobj.id,
  324. })
  325. } else {
  326. let aid = e.currentTarget.dataset.id;
  327. let vrlink = e.currentTarget.dataset.vrlink;
  328. wx.navigateTo({
  329. url: '/pages/other/other?type=vr&vrurl=' + escape(vrlink) + '&cty=materialCase' + '&uid=' + app.globalData.shareuserid + '&ctp=' + app.globalData.clientype + '&aid=' + aid,
  330. })
  331. }
  332. },
  333. hiddenMaskFunc() {
  334. this.setData({
  335. showMask: false
  336. })
  337. },
  338. getPhoneNumberTap: function (res) {
  339. var that = this;
  340. let type = res.currentTarget.dataset.type;
  341. if (type != 'broker') {
  342. that.lookcasefun();
  343. }
  344. if (res.detail.errMsg == 'getPhoneNumber:ok') {
  345. if (designTimer) {
  346. clearTimeout(designTimer);
  347. }
  348. utils.$post({
  349. url: app.globalData.webUrl + 'api/users/setUserMobile',
  350. data: {
  351. encryptedData: res.detail.encryptedData,
  352. iv: res.detail.iv
  353. },
  354. header: {
  355. 'Authorization': 'bearer ' + app.globalData.token
  356. },
  357. success: function (r) {
  358. if (r.data.code == '0') {
  359. that.setData({
  360. fPhone: r.data.mobile,
  361. })
  362. if (type == 'broker') {
  363. that.setData({
  364. showMask: true
  365. })
  366. return false;
  367. }
  368. if (res.currentTarget.dataset.type == 'price') {
  369. that.setData({
  370. phoneFlag: false,
  371. designPlan: false
  372. })
  373. return;
  374. }
  375. if(res.currentTarget.dataset.type==1){
  376. wx.showToast({
  377. title: '预约成功!',
  378. icon: 'none',
  379. duration: 2000
  380. })
  381. }
  382. that.orderfun();
  383. app.globalData.phone = true;
  384. that.setData({
  385. phoneFlag: false,
  386. webUrl: app.globalData.webUrl,
  387. articlelogin: true,
  388. designPlan: false
  389. })
  390. } else {
  391. that.setData({
  392. errorText: r.data.msg,
  393. errorflag: true
  394. })
  395. }
  396. }
  397. })
  398. } else {
  399. this.setData({
  400. showMask: true
  401. })
  402. }
  403. },
  404. orderfun() {
  405. const that = this;
  406. utils.$post({
  407. url: app.globalData.webUrl + 'client/material/designer_reserve',
  408. header: {
  409. 'Authorization': 'bearer ' + app.globalData.token
  410. },
  411. data: {
  412. id:that.data.cid,
  413. designer_id:that.data.casemsgobj.designer_id?that.data.casemsgobj.designer_id:'',
  414. type:'materialCase',
  415. share_uid:app.globalData.shareuserid
  416. },
  417. success: function (res) {
  418. if (res.data.code == '0') {
  419. wx.showToast({
  420. title: res.data.msg,
  421. icon: "none",
  422. duration: 2000
  423. });
  424. }
  425. }
  426. })
  427. },
  428. casefun: function () {
  429. this.casemsgfun();
  430. },
  431. casemsgfun: function (type) {
  432. var that = this;
  433. if (!!type && type.detail == '1') {
  434. that.setData({
  435. articlelogin: true,
  436. phoneFlag: false,
  437. })
  438. }
  439. utils.$get({
  440. url: app.globalData.webUrl + 'client/casedetail',
  441. header: {
  442. 'Authorization': 'bearer ' + app.globalData.token
  443. },
  444. data: {
  445. id: this.data.cid
  446. },
  447. success: function (res) {
  448. setTimeout(function () {
  449. wx.hideLoading()
  450. }, 500)
  451. let tab=that.data.tab;
  452. if (res.data.code == '0') {
  453. if(!!res.data.data.video_case){
  454. tab[1].count=1;
  455. that.setData({
  456. tab: tab,
  457. activeType:'video'
  458. })
  459. }
  460. if(!!res.data.data.vr_case){
  461. tab[0].count=1;
  462. that.setData({
  463. tab: tab,
  464. activeType:'vr'
  465. })
  466. }
  467. var article = res.data.data.desc,realdesc=res.data.data.real_case;
  468. if (!!type && type.detail == '1') {
  469. article = res.data.data.desc;
  470. realdesc=res.data.data.real_case;
  471. } else {
  472. let length = res.data.data.desc.length;
  473. article = res.data.data.desc.substring(0, length);
  474. let len = res.data.data.real_case.length;
  475. realdesc=res.data.data.real_case.substring(0, len);
  476. }
  477. res.data.data.desccontentmsg = article;
  478. res.data.data.realdesc=realdesc;
  479. if (!res.data.data.desc) {
  480. if (!res.data.data.real_case) {
  481. that.setData({
  482. ctype: ''
  483. })
  484. } else {
  485. that.setData({
  486. ctype: 2
  487. })
  488. }
  489. } else {
  490. if (res.data.data.desc != '<p><br></p>') {
  491. that.setData({
  492. ctype: 1
  493. })
  494. } else {
  495. that.setData({
  496. ctype: 2
  497. })
  498. }
  499. }
  500. that.setData({
  501. casemsgobj: res.data.data,
  502. caselist: res.data.data.designer_related_cases,
  503. leftcaselist: [],
  504. rightcaselist: [],
  505. })
  506. if(res.data.data.from==1){
  507. that.setData({
  508. imgarr:JSON.parse(res.data.data.img_content)
  509. })
  510. }
  511. that.imgload();
  512. }
  513. }
  514. })
  515. },
  516. imgload: function () {
  517. var that = this;
  518. var leftlist = that.data.leftcaselist;
  519. var rightlist = that.data.rightcaselist;
  520. var indexlist = that.data.caselist;
  521. if (indexlist.length == 0) {
  522. return false;
  523. }
  524. if (leftlist.length == 0) {
  525. leftlist.push(indexlist[0]);
  526. indexlist.shift();
  527. that.setData({
  528. caselist: indexlist,
  529. leftcaselist: leftlist,
  530. rightcaselist: rightlist
  531. })
  532. } else {
  533. var leftheight, rightheight;
  534. const query = wx.createSelectorQuery()
  535. query.select('.leftcasebox').boundingClientRect();
  536. query.exec(function (res) {
  537. leftheight = res[0].height;
  538. const queryright = wx.createSelectorQuery()
  539. queryright.select('.rightcasebox').boundingClientRect();
  540. queryright.exec(function (rs) {
  541. leftlist = that.data.leftcaselist;
  542. rightlist = that.data.rightcaselist;
  543. indexlist = that.data.caselist;
  544. rightheight = rs[0].height;
  545. if (leftheight <= rightheight) {
  546. leftlist.push(indexlist[0]);
  547. indexlist.shift();
  548. } else {
  549. rightlist.push(indexlist[0]);
  550. indexlist.shift();
  551. }
  552. that.setData({
  553. caselist: indexlist,
  554. leftcaselist: leftlist,
  555. rightcaselist: rightlist
  556. })
  557. })
  558. })
  559. }
  560. },
  561. addsharetap: function () {
  562. let that = this;
  563. utils.$post({
  564. url: app.globalData.webUrl + 'api/share/addlog',
  565. header: {
  566. 'Authorization': 'bearer ' + app.globalData.token
  567. },
  568. data: {
  569. id: that.data.cid,
  570. type: 'materialCase',
  571. },
  572. success: function (r) {}
  573. })
  574. },
  575. casemsgtap: function (e) {
  576. wx.redirectTo({
  577. url: '/share/pages/materialcase/materialcase?cid=' + e.currentTarget.dataset.cid + "&uid=" + app.globalData.shareuserid + '&ctp=' + app.globalData.clientype
  578. })
  579. },
  580. priceshowtap() {
  581. this.setData({
  582. priceflag: true
  583. })
  584. },
  585. closepricetap() {
  586. this.setData({
  587. priceflag: false
  588. })
  589. },
  590. closeDesigntap(e) {
  591. if (designTimer) {
  592. clearTimeout(designTimer);
  593. }
  594. if (e.detail.type == 'success') {
  595. this.setData({
  596. designPlan: false
  597. })
  598. } else {
  599. this.setData({
  600. designPlan: false
  601. })
  602. }
  603. },
  604. precasetap: function () {
  605. if (!this.data.casemsgobj.preid) {
  606. wx.showToast({
  607. title: '已经第一篇了!',
  608. icon: 'none',
  609. duration: 2000
  610. })
  611. return false
  612. }
  613. wx.redirectTo({
  614. url: '/share/pages/materialcase/materialcase?cid=' + this.data.casemsgobj.preid + '&uid=' + this.data.shareid
  615. })
  616. },
  617. nextcasetap: function () {
  618. if (!this.data.casemsgobj.nextid) {
  619. wx.showToast({
  620. title: '已经到头了!',
  621. icon: 'none',
  622. duration: 2000
  623. })
  624. return false
  625. }
  626. wx.redirectTo({
  627. url: '/share/pages/materialcase/materialcase?cid=' + this.data.casemsgobj.nextid + '&uid=' + this.data.shareid
  628. })
  629. },
  630. /**
  631. * 生命周期函数--监听页面初次渲染完成
  632. */
  633. onReady: function () {
  634. },
  635. lasttap: function () {
  636. wx.reLaunch({
  637. url: '/pages/index/index?state=1'
  638. })
  639. },
  640. /**
  641. * 生命周期函数--监听页面显示
  642. */
  643. onShow: function () {
  644. this.setData({
  645. top: app.globalData.statusBarHeight,
  646. hgt: app.globalData.titleBarHeight,
  647. imgUrl: app.globalData.imgUrl,
  648. })
  649. timer = setInterval(function () {
  650. time = time * 1 + 1;
  651. }, 1000)
  652. },
  653. otherlistfun: function () {
  654. var that = this;
  655. var page = that.data.page;
  656. page = page * 1 + 1;
  657. utils.$post({
  658. url: app.globalData.webUrl + 'client/designercases',
  659. header: {
  660. 'Authorization': 'bearer ' + app.globalData.token
  661. },
  662. data: {
  663. page: page,
  664. limit: 4,
  665. designer_id: that.data.casemsgobj.designer_id,
  666. material_case_id:this.data.cid
  667. },
  668. success: function (res) {
  669. that.setData({
  670. page: page
  671. })
  672. if (res.data.code == '0') {
  673. var caselist = that.data.caselist;
  674. var arrflag = false;
  675. if (res.data.data.length == 0) {
  676. wx.showToast({
  677. title: '暂无更多数据',
  678. icon: 'none',
  679. duration: 2000
  680. })
  681. } else {
  682. if (caselist.length != 0) {
  683. arrflag = true;
  684. }
  685. caselist = caselist.concat(res.data.data);
  686. that.setData({
  687. caselist: caselist
  688. });
  689. if (!arrflag) {
  690. that.imgload();
  691. }
  692. }
  693. }
  694. }
  695. })
  696. },
  697. /**
  698. * 生命周期函数--监听页面隐藏
  699. */
  700. onHide: function () {
  701. if (timer) {
  702. clearInterval(timer);
  703. }
  704. if (designTimer) {
  705. clearTimeout(designTimer);
  706. }
  707. this.visitimefun();
  708. },
  709. visitimefun() {
  710. const that = this;
  711. utils.$post({
  712. url: app.globalData.webUrl + 'client/index/visit_due_time',
  713. header: {
  714. 'Authorization': 'bearer ' + app.globalData.token
  715. },
  716. data: {
  717. id: that.data.cid,
  718. pipe_type: 'materialCase',
  719. time: time,
  720. },
  721. success: function (res) {
  722. }
  723. })
  724. },
  725. operateBtn () {
  726. this.setData({
  727. showAction: false
  728. })
  729. },
  730. /**
  731. * 展示地址
  732. */
  733. showAddressName (e) {
  734. let type = e.currentTarget.dataset.type;
  735. if (type == 'hide') {
  736. this.setData({
  737. showAddress: false
  738. })
  739. } else{
  740. this.setData({
  741. showAddress: true
  742. })
  743. }
  744. },
  745. /**
  746. * 生命周期函数--监听页面卸载
  747. */
  748. onUnload: function () {
  749. if (designTimer) {
  750. clearTimeout(designTimer);
  751. }
  752. this.visitimefun();
  753. },
  754. /**
  755. * 页面相关事件处理函数--监听用户下拉动作
  756. */
  757. onPullDownRefresh: function () {
  758. },
  759. /**
  760. * 页面上拉触底事件的处理函数
  761. */
  762. onReachBottom: function () {
  763. },
  764. /**
  765. * 用户点击右上角分享
  766. */
  767. onShareAppMessage: function () {
  768. var img = this.data.casemsgobj.cover_share_img?this.data.casemsgobj.cover_share_img:this.data.casemsgobj.cover_img;
  769. if (app.globalData.brokeruserId) {
  770. this.addsharetap();
  771. img = img.replace('http://o.nczyzs.com/', 'https://o.nczyzs.com/');
  772. return {
  773. title: this.data.casemsgobj.title,
  774. imageUrl: img,
  775. path: '/share/pages/materialcase/materialcase?cid=' + this.data.cid + '&uid=' + app.globalData.shareuserid + '&ctp=' + app.globalData.clientype + '&agid=' + app.globalData.brokeruserId,
  776. };
  777. } else {
  778. this.addsharetap();
  779. img = img.replace('http://o.nczyzs.com/', 'https://o.nczyzs.com/');
  780. return {
  781. title: this.data.casemsgobj.title,
  782. imageUrl: img,
  783. path: '/share/pages/materialcase/materialcase?cid=' + this.data.cid + '&uid=' + app.globalData.shareuserid + '&ctp=' + app.globalData.clientype,
  784. };
  785. }
  786. }
  787. })