1
0

casemsg.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  1. const app = getApp(),util = require("../../../utils/util"),utils = require("../../../utils/http");
  2. let videoContext=null;
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. top: app.globalData.statusBarHeight,
  9. hgt: app.globalData.titleBarHeight,
  10. imgUrl: app.globalData.imgUrl,
  11. communityht: '',
  12. cid: '',
  13. casemsgobj: {},
  14. page: 1,
  15. personMsg: app.globalData.personMsg,
  16. wshareshow: false,
  17. showTask: true,
  18. datashow: false,
  19. caselist: [],
  20. leftcaselist: [],
  21. rightcaselist: [],
  22. companyobj: app.globalData.companyobj,
  23. showAddress: false,
  24. imgarr: [],
  25. type: '',
  26. priceflag: false,
  27. swiperIndex:0,
  28. tab: [{
  29. name: 'VR案例',
  30. type: 'vr',
  31. count: 0
  32. }, {
  33. name: '视频案例',
  34. type: 'video',
  35. count: 0
  36. }],
  37. activeType: '',
  38. bType: "",
  39. pType: "",
  40. ltype:'',//不为空是从名片中点击进去
  41. showCutImage: false,
  42. loading: false,
  43. showApproval: false,
  44. remark: "",
  45. trackimgarr: [],
  46. nowimagearr: [],
  47. shareApprovallist: [],
  48. playflag: 2,//1是播放中,2是暂停
  49. },
  50. /**
  51. * 生命周期函数--监听页面加载
  52. */
  53. onLoad: function (options) {
  54. var that = this;
  55. if(!!options.ty) {
  56. this.setData({
  57. bType: options.ty,
  58. showTask: false
  59. })
  60. }
  61. if (!!options.tp) {
  62. this.setData({
  63. pType: options.tp
  64. })
  65. }
  66. wx.showLoading({
  67. title: '加载中...',
  68. })
  69. that.setData({
  70. cid: options.cid,
  71. companyobj: app.globalData.companyobj,
  72. ltype:options.ltype?options.ltype:''
  73. })
  74. that.casemsgfun();
  75. },
  76. handShowUpload: function () {
  77. this.setData({
  78. trackimgarr: [],
  79. nowimagearr: [],
  80. remark: "",
  81. showCutImage: true
  82. })
  83. },
  84. handleShowApproval() {
  85. this.setData({
  86. showApproval: true
  87. })
  88. wx.showLoading({
  89. title: '加载中...',
  90. })
  91. this.getBrokerApprovallist();
  92. },
  93. //获取审核列表
  94. getBrokerApprovallist() {
  95. const that = this;
  96. utils.$post({
  97. url: app.globalData.webUrl + 'api/agentEmp/share_list',
  98. header: {
  99. 'Authorization': 'bearer ' + app.globalData.token
  100. },
  101. data: {
  102. id: that.data.cid,
  103. type: "MaterialCase"
  104. },
  105. success: function (res) {
  106. wx.hideLoading();
  107. if (res.data.code == 0) {
  108. that.setData({
  109. shareApprovallist: res.data.data,
  110. datashow: true
  111. })
  112. }
  113. }
  114. })
  115. },
  116. previewImageEvent(e) {
  117. let index = parseInt(e.currentTarget.dataset.index);
  118. let idx = parseInt(e.currentTarget.dataset.idx);
  119. wx.previewImage({
  120. urls: this.data.shareApprovallist[index].img,
  121. current: this.data.shareApprovallist[index].img[idx]
  122. })
  123. },
  124. closeDialog: function () {
  125. this.setData({
  126. showCutImage: false,
  127. showApproval: false
  128. })
  129. },
  130. getTextarea(e) {
  131. this.setData({
  132. remark: e.detail.value
  133. })
  134. },
  135. //审核通过
  136. confirmApproval(e) {
  137. let id = e.currentTarget.dataset.id;
  138. const that = this;
  139. wx.showModal({
  140. title: '审核提醒',
  141. content: '您确认通过审核吗?',
  142. complete: (res) => {
  143. if (res.confirm) {
  144. utils.$post({
  145. url: app.globalData.webUrl + 'api/agentEmp/validate_share',
  146. header: {
  147. 'Authorization': 'bearer ' + app.globalData.token
  148. },
  149. data: {
  150. share_id: id,
  151. status: 1
  152. },
  153. success: function (res) {
  154. if (res.data.code == 0) {
  155. wx.showToast({
  156. title: '已通过审核',
  157. icon: "none",
  158. duration: 1500,
  159. success: function() {
  160. setTimeout(() => {
  161. that.getBrokerApprovallist();
  162. },1000)
  163. }
  164. })
  165. }
  166. }
  167. })
  168. }
  169. }
  170. })
  171. },
  172. //审核拒绝
  173. rejectApproval(e) {
  174. let id = e.currentTarget.dataset.id;
  175. const that = this;
  176. wx.showModal({
  177. title: '审核提醒',
  178. content: '您确认驳回审核吗?',
  179. complete: (res) => {
  180. if (res.confirm) {
  181. utils.$post({
  182. url: app.globalData.webUrl + 'api/agentEmp/validate_share',
  183. header: {
  184. 'Authorization': 'bearer ' + app.globalData.token
  185. },
  186. data: {
  187. share_id: id,
  188. status: 2
  189. },
  190. success: function (res) {
  191. if (res.data.code == 0) {
  192. wx.showToast({
  193. title: '已驳回审核',
  194. icon: "none",
  195. duration: 1500,
  196. success: function() {
  197. setTimeout(() => {
  198. that.getBrokerApprovallist();
  199. },1000)
  200. }
  201. })
  202. }
  203. }
  204. })
  205. }
  206. }
  207. })
  208. },
  209. //上传分享截图
  210. submitData() {
  211. if (!this.data.trackimgarr.length) {
  212. wx.showToast({
  213. title: '请上传分享截图!',
  214. icon: "none",
  215. duration: 1500,
  216. })
  217. return false;
  218. }
  219. this.setData({
  220. loading: true
  221. })
  222. this.ossuploadimg();
  223. },
  224. uploadImage() {
  225. let _this = this;
  226. wx.chooseMedia({
  227. count: 9,
  228. mediaType: ["image"],
  229. sourceType: ["album", "camera"],
  230. sizeType: ['original', 'compressed'],
  231. success: function (res) {
  232. if (res.errMsg == "chooseMedia:ok") {
  233. _this.createImagePayment(res.tempFiles);
  234. }
  235. }
  236. })
  237. },
  238. imageDel(e) {
  239. let index = e.currentTarget.dataset.index;
  240. this.data.trackimgarr.splice(index, 1);
  241. this.setData({
  242. trackimgarr: this.data.trackimgarr
  243. })
  244. },
  245. createImagePayment: function (imgUrl) {
  246. var that = this;
  247. if (imgUrl.length == 0) return;
  248. var lent = that.data.trackimgarr.length + imgUrl.length;
  249. if (lent > 9) {
  250. lent = 9
  251. } else {
  252. lent = lent;
  253. }
  254. let trackimgarr = that.data.trackimgarr;
  255. let len = imgUrl.length;
  256. if ((trackimgarr.length + len) > 9) {
  257. for (let j = 0; j < len; j++) {
  258. if (trackimgarr.length < 9) {
  259. trackimgarr.push(imgUrl[j]);
  260. }
  261. }
  262. } else {
  263. trackimgarr = trackimgarr.concat(imgUrl);
  264. }
  265. that.setData({
  266. trackimgarr: trackimgarr
  267. })
  268. },
  269. ossuploadimg: function (e) {
  270. let that = this;
  271. let trackimgarr = that.data.trackimgarr;
  272. var arr = [];
  273. for (let i = 0; i < trackimgarr.length; i++) {
  274. //获取文件后缀
  275. // 随机生成文件名称
  276. let rstr = trackimgarr[i].tempFilePath.split('.');
  277. var fileRandName = Date.now() + "" + parseInt(Math.random() * 10000) + i;
  278. var imgName = fileRandName + '.' + 'png';
  279. // var fileName = that.data.;
  280. var date = new Date();
  281. var time = date.getFullYear() + '' + (date.getMonth() * 1 + 1) + '' + date.getDate();
  282. var imgstr = 'broker/' + time + '/' + imgName;
  283. var nowimagearr = that.data.nowimagearr;
  284. nowimagearr.push(imgstr);
  285. that.setData({
  286. nowimagearr: nowimagearr
  287. })
  288. wx.uploadFile({
  289. url: 'https://wzh-zqxg.oss-cn-hangzhou.aliyuncs.com',
  290. filePath: trackimgarr[i].tempFilePath,
  291. name: 'file',
  292. formData: {
  293. // name: that.data.imgSrc[0],
  294. key: 'broker/' + time + '/' + imgName,
  295. policy: "eyJleHBpcmF0aW9uIjoiMjA0MC0wMS0wMVQxMjowMDowMC4wMDBaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF1dfQ==",
  296. OSSAccessKeyId: "LTAI5tHjWupJSCAycy2yVbQZ",
  297. success_action_status: "200",
  298. signature: "GPu5wBYVzdhICS/hdJH6rKG0kos=",
  299. },
  300. header: {
  301. "Content-Type": "multipart/form-data",
  302. 'accept': 'application/json',
  303. },
  304. success: function (rs) {
  305. if (rs.errMsg == 'uploadFile:ok') {
  306. arr.push('0');
  307. if (arr.length == trackimgarr.length) {
  308. that.requestUploadImageApi();
  309. }
  310. }
  311. },
  312. fail(res) {
  313. wx.hideLoading()
  314. }
  315. })
  316. }
  317. },
  318. requestUploadImageApi() {
  319. let that = this;
  320. let imgs = that.data.nowimagearr.map(v => {
  321. return { serverId: "", img: v, };
  322. })
  323. utils.$post({
  324. url: app.globalData.webUrl + 'api/agentsWork/upload_share_log',
  325. header: {
  326. 'Authorization': 'bearer ' + app.globalData.token
  327. },
  328. data: {
  329. article_id: that.data.cid,
  330. file_media_id: imgs,
  331. remarks: that.data.remark,
  332. type: "MaterialCase"
  333. },
  334. success: function (res) {
  335. that.setData({
  336. loading: false
  337. })
  338. if (res.data.code == '0') {
  339. wx.showToast({
  340. title: '上传成功',
  341. icon: "success",
  342. duration: 1500
  343. })
  344. that.setData({
  345. showCutImage: false
  346. })
  347. }
  348. }
  349. })
  350. },
  351. setypetap(e) {
  352. this.setData({
  353. type: e.currentTarget.dataset.type
  354. })
  355. },
  356. priceshowtap() {
  357. this.setData({
  358. priceflag: true
  359. })
  360. },
  361. closepricetap() {
  362. this.setData({
  363. priceflag: false
  364. })
  365. },
  366. showAddressName(e) {
  367. let type = e.currentTarget.dataset.type;
  368. if (type == 'hide') {
  369. this.setData({
  370. showAddress: false
  371. })
  372. } else {
  373. this.setData({
  374. showAddress: true
  375. })
  376. }
  377. },
  378. designertap(){
  379. if(!!this.data.casemsgobj.designer_id){
  380. wx.navigateTo({
  381. url: '/customer/pages/designermsg/designermsg?did='+this.data.casemsgobj.designer_id+"&sid="+this.data.casemsgobj.designer_id+'&type='+(this.data.ltype?1:2)
  382. })
  383. }
  384. },
  385. prelook(e) {
  386. let arr = [];
  387. for (let i in this.data.imgarr) {
  388. arr.push(app.globalData.imgUrl + this.data.imgarr[i].img);
  389. }
  390. wx.previewImage({
  391. current: e.currentTarget.dataset.img, // 当前显示图片的 http 链接
  392. urls: arr // 需要预览的图片 http 链接列表
  393. })
  394. },
  395. presharelooktap() {
  396. if (!app.globalData.personMsg.binded.qrcode) {
  397. wx.showToast({
  398. title: "您的微信二维码为空,请上传二维码!",
  399. icon: 'none',
  400. duration: 2000
  401. })
  402. return false;
  403. }
  404. wx.previewImage({
  405. current: app.globalData.imgUrl + app.globalData.personMsg.binded.qrcode, // 当前显示图片的http链接
  406. urls: [app.globalData.imgUrl + app.globalData.personMsg.binded.qrcode]// 需要预览的图片http链接列表
  407. })
  408. },
  409. opintap() {
  410. wx.showToast({
  411. title: '员工不能预约!',
  412. icon: 'none',
  413. duration: 2000
  414. })
  415. },
  416. swiperChange (e) {
  417. let type = e.detail.currentItemId.split('-')[0];
  418. this.setData({
  419. activeType: type
  420. })
  421. },
  422. sharecardtap: function () {
  423. wx.navigateTo({
  424. url: '/index/pages/namecard/namecard'
  425. })
  426. },
  427. handleSwitch(e) {
  428. let type = e.currentTarget.dataset.type;
  429. let swiperIndex=0;
  430. if (type == 'vr') {
  431. swiperIndex = 0;
  432. } else if (type == 'video') {
  433. swiperIndex = !!this.data.casemsgobj.vr_case?1:0;
  434. }
  435. this.setData({
  436. swiperIndex: swiperIndex,
  437. activeType: type,
  438. })
  439. },
  440. casemsgfun: function () {
  441. var that = this;
  442. utils.$get({
  443. url: app.globalData.webUrl + 'api/casedetail',
  444. header: {
  445. 'Authorization': 'bearer ' + app.globalData.token
  446. },
  447. data: {
  448. id: this.data.cid,
  449. uid: app.globalData.personMsg.id,
  450. },
  451. success: function (res) {
  452. let tab=that.data.tab;
  453. if (res.data.code == '0') {
  454. wx.setNavigationBarTitle({
  455. title: res.data.data.title
  456. })
  457. if(!!res.data.data.video_case){
  458. tab[1].count=1;
  459. that.setData({
  460. tab: tab,
  461. activeType:'video'
  462. })
  463. }
  464. if(!!res.data.data.vr_case){
  465. tab[0].count=1;
  466. that.setData({
  467. tab: tab,
  468. activeType:'vr'
  469. })
  470. }
  471. if (!res.data.data.desc) {
  472. if (!res.data.data.real_case) {
  473. that.setData({
  474. type: ''
  475. })
  476. } else {
  477. that.setData({
  478. type: 2
  479. })
  480. }
  481. } else {
  482. if (res.data.data.desc != '<p><br></p>') {
  483. that.setData({
  484. type: 1
  485. })
  486. } else {
  487. that.setData({
  488. type: 2
  489. })
  490. }
  491. }
  492. that.setData({
  493. casemsgobj: res.data.data,
  494. caselist: res.data.data.designer_related_cases,
  495. })
  496. if (res.data.data.from == 1) {
  497. that.setData({
  498. imgarr: JSON.parse(res.data.data.img_content)
  499. })
  500. }
  501. if (that.data.caselist.length > 0) {
  502. that.imgload();
  503. }
  504. }
  505. wx.hideLoading()
  506. }
  507. })
  508. },
  509. videotap() {
  510. videoContext = this.selectComponent('#myVideo');
  511. videoContext.play();
  512. wx.showLoading()
  513. },
  514. bindprogress() {
  515. wx.hideLoading();
  516. this.setData({
  517. playflag: 1
  518. })
  519. },
  520. openVRLink(e) {
  521. let type = e.currentTarget.dataset.type;
  522. if (type == 1) {
  523. let vrlink = this.data.casemsgobj.vr_case;
  524. wx.navigateTo({
  525. url: '/pages/other/other?type=565&vrlink=' + encodeURIComponent(vrlink) + '&cty=materialCase' + '&uid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype + '&aid=' + this.data.casemsgobj.id,
  526. })
  527. } else {
  528. let vrlink = e.currentTarget.dataset.vrlink;
  529. let aid = e.currentTarget.dataset.id;
  530. wx.navigateTo({
  531. url: '/pages/other/other?type=565&vrlink=' + encodeURIComponent(vrlink) + '&cty=materialCase' + '&uid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype + '&aid=' + aid,
  532. })
  533. }
  534. },
  535. imgload: function () {
  536. var that = this;
  537. var leftlist = that.data.leftcaselist;
  538. var rightlist = that.data.rightcaselist;
  539. var indexlist = that.data.caselist;
  540. if (indexlist.length == 0) {
  541. return false;
  542. }
  543. if (leftlist.length == 0) {
  544. leftlist.push(indexlist[0]);
  545. indexlist.shift();
  546. that.setData({
  547. caselist: indexlist,
  548. leftcaselist: leftlist,
  549. rightcaselist: rightlist
  550. })
  551. } else {
  552. var leftheight, rightheight;
  553. const query = wx.createSelectorQuery()
  554. query.select('.leftcasebox').boundingClientRect();
  555. query.exec(function (res) {
  556. leftheight = res[0].height;
  557. const queryright = wx.createSelectorQuery()
  558. queryright.select('.rightcasebox').boundingClientRect();
  559. queryright.exec(function (rs) {
  560. leftlist = that.data.leftcaselist;
  561. rightlist = that.data.rightcaselist;
  562. indexlist = that.data.caselist;
  563. rightheight = rs[0].height;
  564. if (leftheight <= rightheight) {
  565. leftlist.push(indexlist[0]);
  566. indexlist.shift();
  567. } else {
  568. rightlist.push(indexlist[0]);
  569. indexlist.shift();
  570. }
  571. that.setData({
  572. caselist: indexlist,
  573. leftcaselist: leftlist,
  574. rightcaselist: rightlist
  575. })
  576. })
  577. })
  578. }
  579. },
  580. callphonetap: function () {
  581. wx.makePhoneCall({
  582. phoneNumber: app.globalData.personMsg.phone //仅为示例,并非真实的电话号码
  583. })
  584. },
  585. sendfriendtap() {
  586. this.addsharetap();
  587. },
  588. addsharetap: function () {
  589. let that = this;
  590. utils.$post({
  591. url: app.globalData.webUrl + 'api/share/addlog',
  592. header: {
  593. 'Authorization': 'bearer ' + app.globalData.token
  594. },
  595. data: {
  596. id: that.data.cid,
  597. type: 'materialCase',
  598. },
  599. success: function (r) {}
  600. })
  601. },
  602. setpostertap: function () {
  603. if (this.data.bType == 'b') {
  604. wx.navigateTo({
  605. url: '/index/pages/setposter/setposter?type=materialCase&aid=' + this.data.cid + "&ty=b&listshare=",
  606. })
  607. } else {
  608. wx.navigateTo({
  609. url: '/index/pages/setposter/setposter?type=materialCase&aid=' + this.data.cid + "&listshare=",
  610. })
  611. }
  612. },
  613. casemsgtap: function (e) {
  614. wx.redirectTo({
  615. url: '/index/pages/casemsg/casemsg?cid=' + e.currentTarget.dataset.cid
  616. })
  617. },
  618. precasetap: function () {
  619. if (!this.data.casemsgobj.preid) {
  620. wx.showToast({
  621. title: '已经第一篇了!',
  622. icon: 'none',
  623. duration: 2000
  624. })
  625. return false
  626. }
  627. wx.redirectTo({
  628. url: '/index/pages/casemsg/casemsg?cid=' + this.data.casemsgobj.preid
  629. })
  630. },
  631. nextcasetap: function () {
  632. if (!this.data.casemsgobj.nextid) {
  633. wx.showToast({
  634. title: '已经到头了!',
  635. icon: 'none',
  636. duration: 2000
  637. })
  638. return false
  639. }
  640. wx.redirectTo({
  641. url: '/index/pages/casemsg/casemsg?cid=' + this.data.casemsgobj.nextid
  642. })
  643. },
  644. collectap: function () {
  645. var that = this;
  646. var casemsgobj = that.data.casemsgobj;
  647. utils.$post({
  648. url: app.globalData.webUrl + 'api/collect',
  649. header: {
  650. 'Authorization': 'bearer ' + app.globalData.token
  651. },
  652. data: {
  653. user_id: app.globalData.personMsg.id,
  654. content_type: "materialCase",
  655. content_id: that.data.cid
  656. },
  657. success: function (res) {
  658. if (res.data.code == '0') {
  659. wx.showToast({
  660. title: res.data.msg,
  661. icon: 'none',
  662. duration: 2000
  663. })
  664. casemsgobj.collected = !casemsgobj.collected;
  665. that.setData({
  666. casemsgobj: casemsgobj
  667. })
  668. }
  669. }
  670. })
  671. },
  672. casesharetap: function () {
  673. this.setData({
  674. wshareshow: true
  675. })
  676. },
  677. shareurltap: function () {
  678. wx.showLoading({
  679. title: '加载中...',
  680. })
  681. this.addsharetap();
  682. if (this.data.bType == 'b') {
  683. util.schemefun('/share/pages/materialcase/materialcase', 'cid=' + this.data.cid + '&uid=' + app.globalData.agentEmployeEid + '&ctp=' + app.globalData.clientype + '&agid=' + app.globalData.brokeruserId, this.data.cid, 'materialCase', '');
  684. } else {
  685. util.schemefun('/share/pages/materialcase/materialcase', 'cid=' + this.data.cid + '&uid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype, this.data.cid, 'materialCase', '');
  686. }
  687. },
  688. /**
  689. * 生命周期函数--监听页面初次渲染完成
  690. */
  691. onReady: function () {
  692. },
  693. lasttap: function () {
  694. wx.navigateBack()
  695. },
  696. /**
  697. * 生命周期函数--监听页面显示
  698. */
  699. onShow: function () {
  700. },
  701. otherlistfun: function () {
  702. var that = this;
  703. var page = that.data.page;
  704. page = page * 1 + 1;
  705. utils.$post({
  706. url: app.globalData.webUrl + 'api/designercases',
  707. header: {
  708. 'Authorization': 'bearer ' + app.globalData.token
  709. },
  710. data: {
  711. page: page,
  712. limit: 4,
  713. designer_id: that.data.casemsgobj.designer_id,
  714. material_case_id:this.data.cid
  715. },
  716. success: function (res) {
  717. that.setData({
  718. page: page
  719. })
  720. if (res.data.code == '0') {
  721. // caselist:indexlist,
  722. // leftcaselist:leftlist,
  723. // rightcaselist:rightlist
  724. var caselist = that.data.caselist;
  725. var arrflag = false;
  726. if (res.data.data.length == 0) {
  727. wx.showToast({
  728. title: '暂无更多数据',
  729. icon: 'none',
  730. duration: 2000
  731. })
  732. } else {
  733. if (caselist.length != 0) {
  734. arrflag = true;
  735. }
  736. console.log(caselist)
  737. caselist = caselist.concat(res.data.data);
  738. that.setData({
  739. caselist: caselist
  740. });
  741. if (!arrflag) {
  742. that.imgload();
  743. }
  744. }
  745. }
  746. }
  747. })
  748. },
  749. /**
  750. * 生命周期函数--监听页面隐藏
  751. */
  752. onHide: function () {
  753. },
  754. /**
  755. * 生命周期函数--监听页面卸载
  756. */
  757. onUnload: function () {
  758. },
  759. /**
  760. * 页面相关事件处理函数--监听用户下拉动作
  761. */
  762. onPullDownRefresh: function () {
  763. },
  764. /**
  765. * 页面上拉触底事件的处理函数
  766. */
  767. onReachBottom: function () {
  768. },
  769. /**
  770. * 用户点击右上角分享
  771. */
  772. onShareAppMessage: function () {
  773. var img = this.data.casemsgobj.cover_share_img?this.data.casemsgobj.cover_share_img:this.data.casemsgobj.cover_img;
  774. if (this.data.bType == 'b') {
  775. this.addsharetap();
  776. img = img.replace('http://o.nczyzs.com/', 'https://o.nczyzs.com/');
  777. return {
  778. title: this.data.casemsgobj.title,
  779. imageUrl: img,
  780. path: '/share/pages/materialcase/materialcase?cid=' + this.data.cid + '&uid=' + app.globalData.agentEmployeEid + '&ctp=' + app.globalData.clientype + '&agid=' + app.globalData.brokeruserId
  781. }
  782. } else {
  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.personMsg.id + '&ctp=' + app.globalData.clientype
  789. }
  790. }
  791. }
  792. })