materialcase.js 27 KB

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