morecontent.js 71 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075
  1. const app = getApp();
  2. var utils = require("../../../utils/http");
  3. const util = require("../../../utils/util");
  4. let page = 1;
  5. let showflag=true,caseloadflag=false,videoflag=false;
  6. Page({
  7. /**
  8. * 页面的初始数据
  9. */
  10. data: {
  11. ordertype: '',
  12. unlogin: false,//默认未登录状态,false未登录,true登录成功,并是公司成员
  13. imgUrl: app.globalData.imgUrl,
  14. mattertype: '拓客案例',
  15. toptype: '素材库',
  16. casefiltratetype: 3,
  17. list: [],
  18. filtrateflag: false,
  19. tagflag: false,
  20. tagtype: "",
  21. nowtagtit: "",
  22. tagArr: [],
  23. articledialog: false,
  24. articleTag: '',
  25. articleId: '',
  26. articleArr: [],
  27. casestyletype: '',
  28. curTypeField: '',
  29. caselist: [],
  30. datashow: false,
  31. evidencelist: [],
  32. leftevidencelist: [],
  33. rightevidencelist: [],
  34. catetype: '',//口碑
  35. wxfriendlist: [],
  36. square_start: '',//面积开始值
  37. square_end: '',//面积结束值
  38. commu_id: '',
  39. communame: '',
  40. videoid: [],
  41. playBtn: true,
  42. casepage: 1,
  43. friendpage: 1,
  44. evidencepage: 1,
  45. page: 1,
  46. nowtype: '',
  47. nowid: '',
  48. downflag: false,
  49. downloaded: false,
  50. downlen: 0,
  51. num: 0,
  52. syslabel: [],
  53. companylabel: [],
  54. wxlabel: '',
  55. casekeytext: '',
  56. friendkeytext: '',
  57. evidencekeytext: '',
  58. evidencetype: [],
  59. nowstyleid: '',
  60. nowfirst: '',
  61. nowtitbtn: '',
  62. nowtitle: '',
  63. nowimg: '',
  64. titlist: [],
  65. secondtitlist: [],
  66. videotext: '',
  67. videolist: [],
  68. leftlist: [],
  69. rightlist: [],
  70. articletext: '',
  71. articletitlist: [],
  72. articlesecondtitlist: [],
  73. articlepage: 1,
  74. articlenowfirst: '',
  75. articlelist: [],
  76. articlenowtitbtn: '',
  77. wshareshow: false,
  78. listshare: false,
  79. poster: '',
  80. qrcode: '',
  81. islist: false,
  82. indexList: [],
  83. constructlist: [],
  84. casecommunitylist: [],
  85. site_id: '',
  86. sitename: '',
  87. sourceflag: false,
  88. articleflag: false,
  89. cateflag: false,
  90. nowtext: '',
  91. nowarticletext: '',
  92. nowcatetit: '',
  93. otherarr: [
  94. { id: 1, name: '最新', type: 'time' },
  95. { id: 2, name: '最热', type: 'hot' },
  96. { id: 3, name: '拓客效果', type: 'clue_number' }
  97. ],//ordertype
  98. nowotherid: '',
  99. otherflag: false,
  100. evidarr: [
  101. { id: 1, name: '视频', type: '1' },
  102. { id: 2, name: '图文', type: '2' }
  103. ],
  104. square: [
  105. { id: 1, name: '60㎡以下', start: 0, end: 60 },
  106. { id: 2, name: '60㎡—90㎡', start: 60, end: 90 },
  107. { id: 3, name: '90㎡—110㎡', start: 90, end: 110 },
  108. { id: 4, name: '110㎡—140㎡', start: 110, end: 140 },
  109. { id: 5, name: '140㎡—170㎡', start: 140, end: 170 },
  110. { id: 6, name: '170㎡—210㎡', start: 170, end: 210 },
  111. { id: 7, name: '210㎡—240㎡', start: 210, end: 240 },
  112. { id: 8, name: '240㎡—270㎡', start: 240, end: 270 },
  113. { id: 9, name: '270㎡以上', start: 270, end: '' }
  114. ],
  115. nowevidtype: '',
  116. nowevidtypetext: '',
  117. catetypeflag: false,
  118. casetype: '',
  119. styleflag: false,
  120. housestyleflag: false,
  121. squareflag: false,
  122. nowstyletext: '',
  123. nowsquare: '',
  124. nowhousestyletext: '',
  125. nowcommunitytext: '',
  126. casestylelist: [],
  127. housestylelist: [],
  128. leftcaselist: [],
  129. rightcaselist: [],
  130. typearr:[
  131. {id:1,name:'效果案例',type:1},
  132. {id:2,name:'实景案例',type:2}
  133. ],
  134. noweffect:'',
  135. noweffectid:'',
  136. effectflag:false,
  137. },
  138. /**
  139. * 生命周期函数--监听页面加载
  140. */
  141. onLoad: function (options) {
  142. var that = this;
  143. wx.hideShareMenu({
  144. menus: ['shareAppMessage', 'shareTimeline']
  145. })
  146. wx.showLoading({
  147. title: '加载中...',
  148. })
  149. this.articletit();
  150. this.articlefun();
  151. this.videotitfun();
  152. this.caselistfun();
  153. // this.communitylistfun();
  154. this.housestylefun();
  155. this.casestylefun();
  156. this.communityfun();
  157. this.articlelabelfun();
  158. this.videolabelfun();
  159. },
  160. articlelabelfun(){
  161. const that=this;
  162. utils.$get({
  163. url: app.globalData.webUrl + "api/article/get_all_label",
  164. header: {
  165. 'Authorization': 'bearer ' + app.globalData.token
  166. },
  167. data: {},
  168. success: function (res) {
  169. wx.hideLoading();
  170. if (res.data.code == 0) {
  171. that.setData({
  172. articleArr: res.data.data
  173. })
  174. }
  175. }
  176. })
  177. },
  178. videolabelfun(){
  179. const that=this;
  180. utils.$get({
  181. url: app.globalData.webUrl + "api/video/get_all_label",
  182. header: {
  183. 'Authorization': 'bearer ' + app.globalData.token
  184. },
  185. data: {},
  186. success: function (res) {
  187. wx.hideLoading();
  188. if (res.data.code == 0) {
  189. that.setData({
  190. tagArr: res.data.data
  191. })
  192. }
  193. }
  194. })
  195. },
  196. deltap(e) {
  197. var that = this;
  198. that.setData({
  199. site_id: '',
  200. sitename: ''
  201. })
  202. that.constructfun();
  203. },
  204. setcollectap(e) {
  205. const that = this;
  206. let num = e.currentTarget.dataset.idx;
  207. let str = "";
  208. let constructlist = that.data.constructlist;
  209. if (constructlist[num].collect == 0) {
  210. str = 'api/construction/collect'
  211. } else {
  212. str = 'api/construction/collectCancel'
  213. }
  214. utils.$post({
  215. url: app.globalData.webUrl + str,
  216. header: {
  217. 'Authorization': 'bearer ' + app.globalData.token
  218. },
  219. data: {
  220. id: e.currentTarget.dataset.cid
  221. },
  222. success: function (res) {
  223. wx.hideLoading();
  224. if (res.data.code == 0) {
  225. if (str == 'api/construction/collect') {
  226. constructlist[num].collect = 1;
  227. } else {
  228. constructlist[num].collect = 0;
  229. }
  230. that.setData({
  231. constructlist: constructlist
  232. })
  233. }
  234. }
  235. })
  236. },
  237. evidenceCate: function () {
  238. var that = this;
  239. utils.$get({
  240. url: app.globalData.webUrl + 'api/material/evidenceCate',
  241. header: {
  242. 'Authorization': 'bearer ' + app.globalData.token
  243. },
  244. data: {},
  245. success: function (res) {
  246. that.setData({
  247. evidencetype: res.data.data
  248. })
  249. }
  250. })
  251. },
  252. casemsgtap: function (e) {
  253. wx.navigateTo({
  254. url: '/index/pages/casemsg/casemsg?cid=' + e.currentTarget.dataset.cid,
  255. })
  256. },
  257. setordertypetap(e) {
  258. if (e.currentTarget.dataset.type == '2') {
  259. this.setData({
  260. otherflag: true,
  261. articleflag: false,
  262. cateflag: false,
  263. sourceflag: false
  264. })
  265. } else if (e.currentTarget.dataset.type == '3') {
  266. this.setData({
  267. otherflag: false,
  268. catetypeflag: this.data.mattertype == '客户好评' ? 'true' : 'false',
  269. })
  270. } else if (e.currentTarget.dataset.type == '6') {
  271. if (this.data.mattertype == '拓客图文') {
  272. this.setData({
  273. articledialog: true,
  274. articleflag: false,
  275. cateflag: false,
  276. sourceflag: false
  277. })
  278. } else {
  279. this.setData({
  280. tagflag: true,
  281. articleflag: false,
  282. cateflag: false,
  283. sourceflag: false
  284. })
  285. }
  286. } else {
  287. this.setData({
  288. otherflag: false,
  289. sourceflag: this.data.mattertype == '拓客视频' && e.currentTarget.dataset.type == '2' ? 'false' : this.data.mattertype == '拓客视频' ? true : '',
  290. cateflag: this.data.mattertype == '客户好评' && e.currentTarget.dataset.type == '2' ? 'false' : this.data.mattertype == '客户好评' ? true : '',
  291. articleflag: this.data.mattertype == '拓客图文' && e.currentTarget.dataset.type == '2' ? 'false' : this.data.mattertype == '拓客图文' ? true : '',
  292. })
  293. }
  294. },
  295. casetypetap(e) {
  296. this.setData({
  297. casetype: e.currentTarget.dataset.type,
  298. styleflag: e.currentTarget.dataset.type == 1 ? true : '',
  299. housestyleflag: e.currentTarget.dataset.type == 3 ? true : '',
  300. squareflag: e.currentTarget.dataset.type == 2 ? true : '',
  301. // filtrateflag: e.currentTarget.dataset.type == 4 ? true : false,
  302. otherflag: e.currentTarget.dataset.type == 5 ? true : false,
  303. effectflag: e.currentTarget.dataset.type == 4 ? true : false,
  304. })
  305. },
  306. setstyletap(e) {
  307. if (e.detail == "") {
  308. this.setData({
  309. styleflag: false
  310. })
  311. return false;
  312. }
  313. if (e.detail.currentTarget.dataset.type == 1 && e.detail.currentTarget.dataset.idx != '-1') {
  314. this.setData({
  315. casestyletype: e.detail.currentTarget.dataset.text,
  316. styleflag: false,
  317. nowstyletext: this.data.casestylelist[e.detail.currentTarget.dataset.idx].name
  318. })
  319. } else if (e.detail.currentTarget.dataset.idx == '-1') {
  320. this.setData({
  321. casestyletype: '',
  322. styleflag: false,
  323. nowstyletext: ''
  324. })
  325. }
  326. this.caselistfun();
  327. },
  328. setsquaretap(e) {
  329. if (e.detail == "") {
  330. this.setData({
  331. squareflag: false
  332. })
  333. return false;
  334. }
  335. if (e.detail.currentTarget.dataset.type == 1 && e.detail.currentTarget.dataset.idx != '-1') {
  336. this.setData({
  337. nowsquare: e.detail.currentTarget.dataset.text,
  338. squareflag: false,
  339. square_start: this.data.square[e.detail.currentTarget.dataset.idx].start,//面积开始值
  340. square_end: this.data.square[e.detail.currentTarget.dataset.idx].end,//面积结束值
  341. })
  342. } else if (e.detail.currentTarget.dataset.idx == '-1') {
  343. this.setData({
  344. nowsquare: '',
  345. squareflag: false,
  346. square_start: '',//面积开始值
  347. square_end: '',//面积结束值
  348. })
  349. }
  350. this.caselistfun();
  351. },
  352. sethousestyletap(e) {
  353. if (e.detail == "") {
  354. this.setData({
  355. housestyleflag: false
  356. })
  357. return false;
  358. }
  359. if (e.detail.currentTarget.dataset.type == 1 && e.detail.currentTarget.dataset.idx != '-1') {
  360. this.setData({
  361. nowstyleid: e.detail.currentTarget.dataset.text,
  362. housestyleflag: false,
  363. nowhousestyletext: this.data.housestylelist[e.detail.currentTarget.dataset.idx].name
  364. })
  365. } else if (e.detail.currentTarget.dataset.idx == '-1') {
  366. this.setData({
  367. nowstyleid: '',
  368. housestyleflag: false,
  369. nowhousestyletext: ''
  370. })
  371. }
  372. this.caselistfun();
  373. },
  374. communitytap(e) {
  375. this.setData({
  376. commu_id: e.detail.item.target.dataset.cid,
  377. nowcommunitytext: e.detail.item.target.dataset.item.name,
  378. filtrateflag: false,
  379. casetype:''
  380. })
  381. this.caselistfun();
  382. },
  383. clearcommunitytap() {
  384. this.setData({
  385. nowcommunitytext: '',
  386. commu_id: ''
  387. })
  388. this.caselistfun();
  389. },
  390. casestylefun: function () {
  391. var that = this;
  392. utils.$get({
  393. url: app.globalData.webUrl + 'api/stylelist',
  394. header: {
  395. 'Authorization': 'bearer ' + app.globalData.token
  396. },
  397. data: {},
  398. success: function (res) {
  399. if (res.data.code == '0') {
  400. that.setData({
  401. casestylelist: res.data.data
  402. })
  403. }
  404. }
  405. })
  406. },
  407. housestylefun: function () {
  408. var that = this;
  409. utils.$get({
  410. url: app.globalData.webUrl + 'api/material/housetypelist',
  411. header: {
  412. 'Authorization': 'bearer ' + app.globalData.token
  413. },
  414. data: {},
  415. success: function (res) {
  416. if (res.data.code == '0') {
  417. that.setData({
  418. housestylelist: res.data.data
  419. })
  420. }
  421. }
  422. })
  423. },
  424. caselistfun: function (e) {
  425. var that = this;
  426. if (!!e) {
  427. that.setData({
  428. filtrateflag: false
  429. })
  430. }
  431. wx.showLoading({
  432. title: '加载中...',
  433. })
  434. that.setData({
  435. casepage: 1,
  436. datashow: false
  437. })
  438. utils.$get({
  439. url: app.globalData.webUrl + 'api/caselist',
  440. header: {
  441. 'Authorization': 'bearer ' + app.globalData.token
  442. },
  443. data: {
  444. uid: app.globalData.personMsg.id,
  445. page: 1,
  446. limit:10,
  447. commu_id: that.data.commu_id,// 小区id
  448. style_id: that.data.casestyletype,//风格id
  449. square_start: that.data.square_start,//面积开始值
  450. square_end: that.data.square_end,//面积结束值
  451. keyword: that.data.casekeytext,
  452. housetype_id: that.data.nowstyleid,
  453. case_type:this.data.noweffectid,
  454. order: that.data.ordertype == 'clue_number' ? 'clue_number' :that.data.ordertype == 'hot'?'shared_times':''
  455. },
  456. success: function (res) {
  457. that.setData({
  458. datashow: true
  459. })
  460. if (res.data.code == '0') {
  461. that.setData({
  462. caselist: res.data.data,
  463. leftcaselist: [],
  464. rightcaselist: [],
  465. datashow: true
  466. })
  467. that.caseimgload();
  468. }
  469. setTimeout(function () {
  470. wx.hideLoading()
  471. }, 500)
  472. }, fail() {
  473. wx.hideLoading()
  474. }
  475. })
  476. },
  477. caseimgload: function () {
  478. var that = this;
  479. var leftlist = that.data.leftcaselist;
  480. var rightlist = that.data.rightcaselist;
  481. var indexlist = that.data.caselist;
  482. if(this.data.mattertype!='拓客案例'){
  483. caseloadflag=false;
  484. return false;
  485. }
  486. caseloadflag=true;
  487. if (indexlist.length == 0) {
  488. return false;
  489. }
  490. if (!indexlist[0]) {
  491. return false;
  492. }
  493. if (leftlist.length == 0) {
  494. leftlist.push(indexlist[0]);
  495. indexlist.shift();
  496. that.setData({
  497. caselist: indexlist,
  498. leftcaselist: leftlist,
  499. rightcaselist: rightlist
  500. })
  501. } else {
  502. var leftheight, rightheight;
  503. const query = wx.createSelectorQuery()
  504. query.select('#leftcasebox').boundingClientRect();
  505. query.exec(function (res) {
  506. if(res[0]){
  507. leftheight = res[0].height;
  508. const query1 = wx.createSelectorQuery()
  509. query1.select('#rightcasebox').boundingClientRect();
  510. query1.exec(function (rs) {
  511. leftlist = that.data.leftcaselist;
  512. rightlist = that.data.rightcaselist;
  513. indexlist = that.data.caselist;
  514. rightheight = rs[0].height;
  515. if (!indexlist[0]) {
  516. return false;
  517. }
  518. if (leftheight <= rightheight) {
  519. leftlist.push(indexlist[0]);
  520. indexlist.shift();
  521. } else {
  522. rightlist.push(indexlist[0]);
  523. indexlist.shift();
  524. }
  525. that.setData({
  526. caselist: indexlist,
  527. leftcaselist: leftlist,
  528. rightcaselist: rightlist
  529. })
  530. })
  531. }
  532. });
  533. }
  534. },
  535. setothertap(e) {
  536. if (e.detail == "") {
  537. this.setData({
  538. otherflag: false
  539. })
  540. return false;
  541. }
  542. if (e.detail.currentTarget.dataset.type == 1 && e.detail.currentTarget.dataset.idx != '-1') {
  543. this.setData({
  544. nowotherid: e.detail.currentTarget.dataset.text,
  545. otherflag: false,
  546. ordertype: this.data.otherarr[e.detail.currentTarget.dataset.idx].type
  547. })
  548. } else if (e.detail.currentTarget.dataset.idx == '-1') {
  549. this.setData({
  550. nowotherid: '',
  551. otherflag: false,
  552. ordertype: '',
  553. })
  554. }
  555. if (this.data.mattertype == '拓客视频') {
  556. this.videodata();
  557. } else if (this.data.mattertype == '客户好评') {
  558. this.evidencelistfun();
  559. } else if (this.data.mattertype == '拓客图文') {
  560. this.articlefun();
  561. }else if (this.data.mattertype == '拓客案例') {
  562. this.caselistfun();
  563. }
  564. },
  565. seteffectap(e) {
  566. if (e.detail == "") {
  567. this.setData({
  568. effectflag: false
  569. })
  570. return false;
  571. }
  572. if (e.detail.currentTarget.dataset.type == 1 && e.detail.currentTarget.dataset.idx != '-1') {
  573. this.setData({
  574. noweffect: this.data.typearr[e.detail.currentTarget.dataset.idx].name,
  575. effectflag: false,
  576. noweffectid: this.data.typearr[e.detail.currentTarget.dataset.idx].type
  577. })
  578. } else if (e.detail.currentTarget.dataset.idx == '-1') {
  579. this.setData({
  580. noweffectid: '',
  581. effectflag: false,
  582. noweffect: '',
  583. })
  584. }
  585. this.caselistfun();
  586. },
  587. videotitfun: function () {
  588. var that = this;
  589. wx.showLoading({
  590. title: '加载中...',
  591. })
  592. utils.$post({
  593. url: app.globalData.webUrl + 'api/video/type',
  594. header: {
  595. 'Authorization': 'bearer ' + app.globalData.token
  596. },
  597. data: {},
  598. success: function (res) {
  599. wx.hideLoading();
  600. if (res.data.code == 0) {
  601. that.setData({
  602. titlist: res.data.data,
  603. // secondtitlist:res.data.data[0].sonLabel,
  604. // nowfirst:res.data.data[0].val
  605. })
  606. that.videodata();
  607. }
  608. }
  609. })
  610. },
  611. firstitbtn: function (e) {
  612. var that = this;
  613. if (!e.currentTarget.dataset.text) {
  614. this.setData({
  615. nowfirst: '',
  616. nowtitbtn: '',
  617. page: 1,
  618. videolist: [],
  619. secondtitlist: '',
  620. })
  621. } else {
  622. this.setData({
  623. nowfirst: e.currentTarget.dataset.text,
  624. nowtitbtn: '',
  625. page: 1,
  626. videolist: [],
  627. secondtitlist: that.data.titlist[e.currentTarget.dataset.idx].sonLabel,
  628. })
  629. }
  630. that.videodata();
  631. },
  632. setcasekeywordtap: function (e) {
  633. this.setData({
  634. casekeytext: e.detail.value
  635. })
  636. },
  637. secondtitap: function (e) {
  638. var that = this;
  639. this.setData({
  640. nowtitbtn: e.currentTarget.dataset.text,
  641. page: 1,
  642. videolist: [],
  643. filtrateflag: false
  644. })
  645. wx.showLoading({
  646. title: '加载中...',
  647. })
  648. that.videodata();
  649. },
  650. videodata: function () {
  651. var that = this;
  652. that.setData({
  653. datashow: true,
  654. page: 1
  655. })
  656. util.goTop();
  657. utils.$post({
  658. url: app.globalData.webUrl + 'api/video/list',
  659. header: {
  660. 'Authorization': 'bearer ' + app.globalData.token
  661. },
  662. data: {
  663. type: that.data.nowfirst,
  664. label: that.data.tagtype,
  665. page: 1,
  666. limit: "10",
  667. keyword: that.data.videotext,
  668. order: that.data.ordertype == 'clue_number' ? 'clue_number' : that.data.ordertype == 'hot'?'shared_times':'uploadtime'
  669. },
  670. success: function (res) {
  671. if (res.data.code == 0) {
  672. that.setData({
  673. videolist: res.data.data,
  674. leftlist: [],
  675. rightlist: []
  676. })
  677. that.videoimgload();
  678. }
  679. setTimeout(function () {
  680. wx.hideLoading();
  681. }, 500)
  682. }
  683. })
  684. },
  685. videoimgload: function () {
  686. var that = this;
  687. if (that.data.mattertype != '拓客视频') {
  688. videoflag=false;
  689. return false;
  690. }
  691. videoflag=true;
  692. var leftlist = that.data.leftlist;
  693. var rightlist = that.data.rightlist;
  694. var videolist = that.data.videolist;
  695. if (videolist.length == 0) {
  696. return false;
  697. }
  698. let vidoemsg = videolist[0];
  699. if (!vidoemsg) {
  700. that.setData({
  701. videolist: [],
  702. })
  703. return false;
  704. }
  705. if (leftlist.length == 0) {
  706. leftlist.push(vidoemsg);
  707. videolist.shift();
  708. that.setData({
  709. videolist: videolist,
  710. leftlist: leftlist,
  711. rightlist: rightlist
  712. })
  713. } else {
  714. // setTimeout(() => {
  715. var leftheight, rightheight;
  716. const query = wx.createSelectorQuery()
  717. query.select('.leftvideolistbox').boundingClientRect();
  718. query.exec(function (res) {
  719. if(res[0]){
  720. leftheight = res[0].height;
  721. const queryright = wx.createSelectorQuery()
  722. queryright.select('.rightvideolistbox').boundingClientRect();
  723. queryright.exec(function (rs) {
  724. leftlist = that.data.leftlist;
  725. rightlist = that.data.rightlist;
  726. rightheight = rs[0].height;
  727. if (leftheight <= rightheight) {
  728. leftlist.push(vidoemsg);
  729. videolist.shift();
  730. } else {
  731. rightlist.push(vidoemsg);
  732. videolist.shift();
  733. }
  734. that.setData({
  735. videolist: videolist,
  736. leftlist: leftlist,
  737. rightlist: rightlist
  738. })
  739. })
  740. }
  741. })
  742. // }, 50);
  743. }
  744. },
  745. articletit: function () {
  746. var that = this;
  747. wx.showLoading({
  748. title: '加载中...',
  749. })
  750. utils.$post({
  751. url: app.globalData.webUrl + 'api/article/type',
  752. header: {
  753. 'Authorization': 'bearer ' + app.globalData.token
  754. },
  755. data: {},
  756. success: function (res) {
  757. wx.hideLoading();
  758. if (res.data.code == 0) {
  759. that.setData({
  760. articletitlist: res.data.data,
  761. articlesecondtitlist: []
  762. })
  763. }
  764. }
  765. })
  766. },
  767. articlefirstitbtn: function (e) {
  768. var that = this;
  769. if (!e.currentTarget.dataset.text) {
  770. this.setData({
  771. articlenowfirst: '',
  772. articlenowtitbtn: '',
  773. articlepage: 1,
  774. articlelist: [],
  775. articlesecondtitlist: '',
  776. })
  777. } else {
  778. this.setData({
  779. articlenowfirst: e.currentTarget.dataset.text,
  780. articlenowtitbtn: '',
  781. articlepage: 1,
  782. articlelist: [],
  783. articlesecondtitlist: that.data.articletitlist[e.currentTarget.dataset.idx].sonLabel,
  784. })
  785. }
  786. this.articlefun();
  787. },
  788. articlesecondtitap: function (e) {
  789. var that = this;
  790. this.setData({
  791. articlenowtitbtn: e.currentTarget.dataset.text,
  792. articlepage: 1,
  793. articlelist: [],
  794. filtrateflag: false
  795. })
  796. wx.showLoading({
  797. title: '加载中...',
  798. })
  799. this.articlefun();
  800. },
  801. articlefun: function () {
  802. var that = this;
  803. that.setData({
  804. articlepage: 1
  805. })
  806. utils.$post({
  807. url: app.globalData.webUrl + 'api/article/list',
  808. header: {
  809. 'Authorization': 'bearer ' + app.globalData.token
  810. },
  811. data: {
  812. type: that.data.articlenowfirst,
  813. label: that.data.articleId,
  814. page: 1,
  815. limit: "10",
  816. keyword: that.data.articletext,
  817. order: that.data.ordertype == 'clue_number' ? 'clue_number' :that.data.ordertype == 'hot'? 'shared_times':'uploadtime'
  818. },
  819. success: function (res) {
  820. that.setData({
  821. datashow: true
  822. })
  823. if (res.data.code == 0) {
  824. that.setData({
  825. articlelist: res.data.data
  826. })
  827. }
  828. wx.hideLoading()
  829. }
  830. })
  831. },
  832. articleTap: function (e) {
  833. wx.navigateTo({
  834. url: "/index/pages/articleshare/articleshare?aid=" + e.currentTarget.dataset.aid,
  835. });
  836. },
  837. setvideokeywordtap: function (e) {
  838. let that = this;
  839. this.setData({
  840. videotext: e.detail.value
  841. })
  842. },
  843. setarticlekeywordtap: function (e) {
  844. this.setData({
  845. articletext: e.detail.value
  846. })
  847. },
  848. /**
  849. * 拓客案例收藏
  850. */
  851. casecollectap: function (e) {
  852. var that = this;
  853. let caselist = '';
  854. if (e.currentTarget.dataset.type == 'rightcaselist') {
  855. caselist = that.data.rightcaselist;
  856. } else {
  857. caselist = that.data.leftcaselist;
  858. }
  859. utils.$post({
  860. url: app.globalData.webUrl + 'api/collect',
  861. header: {
  862. 'Authorization': 'bearer ' + app.globalData.token
  863. },
  864. data: {
  865. user_id: app.globalData.personMsg.id,
  866. content_type: "materialCase",
  867. content_id: e.currentTarget.dataset.cid
  868. },
  869. success: function (res) {
  870. if (res.data.code == '0') {
  871. wx.showToast({
  872. title: res.data.msg,
  873. icon: 'none',
  874. duration: 2000
  875. })
  876. caselist[e.currentTarget.dataset.idx].collected = !caselist[e.currentTarget.dataset.idx].collected;
  877. if (e.currentTarget.dataset.type == 'rightcaselist') {
  878. that.setData({
  879. rightcaselist: caselist
  880. })
  881. } else {
  882. that.setData({
  883. leftcaselist: caselist
  884. })
  885. }
  886. }
  887. }
  888. })
  889. },
  890. articlecollectap: function (e) {
  891. let that = this, aurl = '', articlelist = this.data.articlelist;
  892. if (e.currentTarget.dataset.num == true) {
  893. aurl = 'api/article/collectCancel';
  894. } else {
  895. aurl = 'api/article/collect';
  896. }
  897. utils.$post({
  898. url: app.globalData.webUrl + aurl,
  899. header: {
  900. 'Authorization': 'bearer ' + app.globalData.token
  901. },
  902. data: {
  903. id: e.currentTarget.dataset.aid
  904. },
  905. success: function (res) {
  906. if (res.data.code == '0') {
  907. wx.showToast({
  908. title: res.data.msg,
  909. icon: 'none',
  910. duration: 2000
  911. })
  912. articlelist[e.currentTarget.dataset.idx].isCollection = !articlelist[e.currentTarget.dataset.idx].isCollection;
  913. that.setData({
  914. articlelist: articlelist
  915. })
  916. }
  917. }
  918. })
  919. },
  920. setsourcetap(e) {
  921. if (e.detail == "") {
  922. this.setData({
  923. sourceflag: false
  924. })
  925. return false;
  926. }
  927. if (e.detail.currentTarget.dataset.type == 1 && e.detail.currentTarget.dataset.idx != '-1') {
  928. this.setData({
  929. nowfirst: e.detail.currentTarget.dataset.text,
  930. sourceflag: false,
  931. nowtext: this.data.titlist[e.detail.currentTarget.dataset.idx].name,
  932. tagArr: this.data.titlist[e.detail.currentTarget.dataset.idx].sonLabel,
  933. tagtype: '',
  934. nowtagtit: ''
  935. })
  936. } else if (e.detail.currentTarget.dataset.idx == '-1') {
  937. this.videolabelfun();
  938. this.setData({
  939. nowfirst: '',
  940. sourceflag: false,
  941. nowtext: '',
  942. tagArr: [],
  943. tagtype: '',
  944. nowtagtit: ''
  945. })
  946. }
  947. this.videodata();
  948. },
  949. setarticletap(e) {
  950. if (e.detail == "") {
  951. this.setData({
  952. articleflag: false
  953. })
  954. return false;
  955. }
  956. if (e.detail.currentTarget.dataset.type == 1 && e.detail.currentTarget.dataset.idx != '-1') {
  957. this.setData({
  958. articlenowfirst: e.detail.currentTarget.dataset.text,
  959. articleflag: false,
  960. nowarticletext: this.data.articletitlist[e.detail.currentTarget.dataset.idx].name,
  961. articleArr: this.data.articletitlist[e.detail.currentTarget.dataset.idx].sonLabel,
  962. articleId: '',
  963. articleTag: ''
  964. })
  965. } else if (e.detail.currentTarget.dataset.idx == '-1') {
  966. this.articlelabelfun();
  967. this.setData({
  968. articlenowfirst: '',
  969. articleflag: false,
  970. nowarticletext: '',
  971. articleArr: [],
  972. articleId: '',
  973. articleTag: ''
  974. })
  975. }
  976. this.articlefun();
  977. },
  978. setcatetypetap(e) {
  979. if (e.detail == "") {
  980. this.setData({
  981. catetypeflag: false
  982. })
  983. return false;
  984. }
  985. if (e.detail.currentTarget.dataset.type == 1 && e.detail.currentTarget.dataset.idx != '-1') {
  986. this.setData({
  987. nowevidtype: e.detail.currentTarget.dataset.text,
  988. catetypeflag: false,
  989. nowevidtypetext: this.data.evidarr[e.detail.currentTarget.dataset.idx].name
  990. })
  991. } else if (e.detail.currentTarget.dataset.idx == '-1') {
  992. this.setData({
  993. nowevidtype: '',
  994. catetypeflag: false,
  995. nowevidtypetext: ''
  996. })
  997. }
  998. this.evidencelistfun();
  999. },
  1000. setcatetap(e) {
  1001. if (e.detail == "") {
  1002. this.setData({
  1003. cateflag: false
  1004. })
  1005. return false;
  1006. }
  1007. if (e.detail.currentTarget.dataset.type == 1 && e.detail.currentTarget.dataset.idx != '-1') {
  1008. this.setData({
  1009. catetype: e.detail.currentTarget.dataset.text,
  1010. cateflag: false,
  1011. nowcatetit: this.data.evidencetype[e.detail.currentTarget.dataset.idx].name
  1012. })
  1013. } else if (e.detail.currentTarget.dataset.idx == '-1') {
  1014. this.setData({
  1015. catetype: '',
  1016. cateflag: false,
  1017. nowcatetit: ''
  1018. })
  1019. }
  1020. this.evidencelistfun();
  1021. },
  1022. setTagTapFunc(e) {
  1023. if (e.detail == "") {
  1024. this.setData({
  1025. tagflag: false
  1026. })
  1027. return false;
  1028. }
  1029. if (e.detail.currentTarget.dataset.type == 1 && e.detail.currentTarget.dataset.idx != '-1') {
  1030. this.setData({
  1031. tagtype: e.detail.currentTarget.dataset.text,
  1032. tagflag: false,
  1033. nowtagtit: this.data.tagArr[e.detail.currentTarget.dataset.idx].name
  1034. })
  1035. } else if (e.detail.currentTarget.dataset.idx == '-1') {
  1036. this.setData({
  1037. tagtype: '',
  1038. tagflag: false,
  1039. nowtagtit: ''
  1040. })
  1041. }
  1042. this.videodata();
  1043. },
  1044. setArticleFunc(e) {
  1045. if (e.detail == "") {
  1046. this.setData({
  1047. articledialog: false
  1048. })
  1049. return false;
  1050. }
  1051. if (e.detail.currentTarget.dataset.type == 1 && e.detail.currentTarget.dataset.idx != '-1') {
  1052. this.setData({
  1053. articleId: e.detail.currentTarget.dataset.text,
  1054. articledialog: false,
  1055. articleTag: this.data.articleArr[e.detail.currentTarget.dataset.idx].name
  1056. })
  1057. } else if (e.detail.currentTarget.dataset.idx == '-1') {
  1058. this.setData({
  1059. articleId: '',
  1060. articledialog: false,
  1061. articleTag: ''
  1062. })
  1063. }
  1064. this.articlefun();
  1065. },
  1066. setevidencekeywordtap: function (e) {
  1067. this.setData({
  1068. evidencekeytext: e.detail.value
  1069. })
  1070. },
  1071. previewImg: function (e) {
  1072. var that = this;
  1073. var idx = e.target.dataset.src, current;
  1074. var imglist = [];
  1075. for (var i = 0; i < that.data.wxfriendlist.length; i++) {
  1076. if (that.data.wxfriendlist[i].id == idx) {
  1077. imglist = that.data.wxfriendlist[i].picture;
  1078. }
  1079. }
  1080. for (var j = 0; j < imglist.length; j++) {
  1081. imglist[j] = app.globalData.imgUrl + imglist[j];
  1082. }
  1083. current = e.target.dataset.vsrc;
  1084. wx.previewImage({
  1085. current: current, // 当前显示图片的http链接
  1086. urls: imglist, // 需要预览的图片http链接列表
  1087. fail(res) {
  1088. console.log(res)
  1089. }
  1090. })
  1091. },
  1092. praisecollecttap: function (e) {
  1093. var that = this;
  1094. let list = [];
  1095. if (e.currentTarget.dataset.type == 'left') {
  1096. list = that.data.leftevidencelist;
  1097. } else {
  1098. list = that.data.rightevidencelist
  1099. }
  1100. utils.$post({
  1101. url: app.globalData.webUrl + 'api/collect',
  1102. header: {
  1103. 'Authorization': 'bearer ' + app.globalData.token
  1104. },
  1105. data: {
  1106. user_id: app.globalData.personMsg.id,
  1107. content_type: "materialEvidence",
  1108. content_id: e.currentTarget.dataset.eid
  1109. },
  1110. success: function (res) {
  1111. if (res.data.code == '0') {
  1112. wx.showToast({
  1113. title: res.data.msg,
  1114. icon: 'none',
  1115. duration: 2000
  1116. })
  1117. list[e.currentTarget.dataset.idx].collected = !list[e.currentTarget.dataset.idx].collected;
  1118. if (e.currentTarget.dataset.type == 'left') {
  1119. that.setData({
  1120. leftevidencelist: list
  1121. })
  1122. } else {
  1123. that.setData({
  1124. rightevidencelist: list
  1125. })
  1126. }
  1127. }
  1128. }
  1129. })
  1130. },
  1131. dothis: function () { },
  1132. openVRLink(e) {
  1133. let id = e.currentTarget.dataset.id;
  1134. let vrlink = e.currentTarget.dataset.vrlink;
  1135. wx.navigateTo({
  1136. url: '/pages/other/other?type=565&vrlink=' + encodeURIComponent(vrlink) + '&cty=materialCase' + '&uid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype + '&aid=' + id,
  1137. })
  1138. },
  1139. mattertitap: function (e) {
  1140. this.setData({
  1141. mattertype: e.currentTarget.dataset.type,
  1142. filtrateflag: false,
  1143. ordertype: '',
  1144. nowotherid: ''
  1145. })
  1146. wx.showLoading({
  1147. title: '加载中...',
  1148. })
  1149. if (this.data.mattertype == '拓客图文' && this.data.articlelist.length == 0) {
  1150. wx.pageScrollTo({
  1151. scrollTop: 0,
  1152. duration: 5
  1153. })
  1154. this.articlefun();
  1155. } else if (this.data.mattertype == '拓客视频') {
  1156. if (this.data.leftlist.length != 0 || this.data.rightlist.length != 0) {
  1157. if(!videoflag){
  1158. this.videoimgload();
  1159. }
  1160. wx.hideLoading()
  1161. } else {
  1162. wx.pageScrollTo({
  1163. scrollTop: 0,
  1164. duration: 5
  1165. })
  1166. this.videodata();
  1167. }
  1168. } else if (this.data.mattertype == '拓客案例') {
  1169. if (this.data.leftcaselist.length != 0 || this.data.rightcaselist.length != 0) {
  1170. wx.hideLoading()
  1171. if(!caseloadflag){
  1172. this.caseimgload();
  1173. }
  1174. } else {
  1175. wx.pageScrollTo({
  1176. scrollTop: 0,
  1177. duration: 5
  1178. })
  1179. this.caselistfun();
  1180. }
  1181. } else {
  1182. wx.hideLoading()
  1183. }
  1184. },
  1185. topchangetap: function (e) {
  1186. this.setData({
  1187. toptype: e.currentTarget.dataset.type
  1188. })
  1189. },
  1190. casefiltratetap: function (e) {
  1191. this.setData({
  1192. casefiltratetype: e.currentTarget.dataset.type
  1193. })
  1194. },
  1195. allfiltratetap: function () {
  1196. this.setData({
  1197. filtrateflag: true,
  1198. casetype: 5
  1199. })
  1200. },
  1201. closefiltratetap: function () {
  1202. this.setData({
  1203. filtrateflag: false,
  1204. casetype:''
  1205. })
  1206. },
  1207. /**
  1208. * 拓客案例分享
  1209. */
  1210. casesharetap: function (e) {
  1211. var that = this;
  1212. that.setData({
  1213. curTypeField: "MaterialCase",
  1214. nowtype: 'materialCase',
  1215. nowid: e.currentTarget.dataset.cid,
  1216. nowtitle: e.currentTarget.dataset.title,
  1217. nowimg: e.currentTarget.dataset.img,
  1218. wshareshow: true,
  1219. islist: false,
  1220. })
  1221. },
  1222. /**
  1223. * 图文分享
  1224. */
  1225. articlesharetap: function (e) {
  1226. var that = this;
  1227. that.setData({
  1228. curTypeField: "Article",
  1229. nowtype: 'article',
  1230. nowid: e.currentTarget.dataset.aid,
  1231. nowtitle: e.currentTarget.dataset.title,
  1232. nowimg: e.currentTarget.dataset.img,
  1233. islist: false,
  1234. wshareshow: true
  1235. })
  1236. },
  1237. listsharetap: function () {
  1238. const that = this;
  1239. this.setData({
  1240. wshareshow: true,
  1241. nowid: '',
  1242. islist: true,
  1243. listshare: true
  1244. })
  1245. if (that.data.mattertype == '拓客案例') {
  1246. that.setData({
  1247. nowimg: app.globalData.imgUrl + "xcx/caseposter.jpg"
  1248. })
  1249. } else if (that.data.mattertype == '客户好评') {
  1250. that.setData({
  1251. nowimg: app.globalData.imgUrl + "xcx/praiseimg.jpg",
  1252. })
  1253. }
  1254. },
  1255. shareurltap: function () {
  1256. let that = this;
  1257. if (this.data.listshare) {
  1258. wx.showLoading({
  1259. title: '加载中...',
  1260. })
  1261. if (this.data.mattertype == '拓客案例') { //u=69&c=&s=&st=&e=&h=
  1262. util.schemefun('/share/pages/caselist/caselist', 's=' + app.globalData.personMsg.id + '&c=' + that.data.commu_id + '&s=' + that.data.casestyletype + '&st=' + that.data.square_start + '&e=' + that.data.square_end + '&k=&h=' + that.data.nowstyleid + '&ctp=' + app.globalData.clientype, '', 'materialCase', '');
  1263. } else if (this.data.mattertype == '客户好评') {
  1264. util.schemefun('/share/pages/praiselist/praiselist', 'uid=' + app.globalData.personMsg.id + '&cate=' + this.data.catetype + '&ctp=' + app.globalData.clientype, '', 'materialEvidence', '');
  1265. } else if (this.data.mattertype == '拓客视频') {
  1266. util.schemefun('/share/pages/videolist/videolist', 'uid=' + app.globalData.personMsg.id + '&firsTitext=' + this.data.nowfirst + '&nowTagText=' + that.data.nowtitbtn + '&ctp=' + app.globalData.clientype, '', 'video', '');
  1267. } else if (this.data.mattertype == '拓客图文') {
  1268. util.schemefun('/share/pages/articleshare/articleshare', 'userid=' + app.globalData.personMsg.id+'&aid='+this.data.nowid + '&ctp=' + app.globalData.clientype, '', 'article', '');
  1269. }
  1270. this.setData({
  1271. listshare: false
  1272. })
  1273. return false;
  1274. }
  1275. switch (that.data.nowtype) {
  1276. case 'materialCase':
  1277. wx.showLoading({
  1278. title: '加载中...',
  1279. })
  1280. util.schemefun('/share/pages/materialcase/materialcase', 'cid=' + that.data.nowid + '&uid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype, that.data.nowid, 'materialCase', '');
  1281. this.sharelogtap();
  1282. break;
  1283. case 'materialEvidence':
  1284. wx.showLoading({
  1285. title: '加载中...',
  1286. })
  1287. util.schemefun('/share/pages/publicpraisemsg/publicpraisemsg', 'eid=' + that.data.nowid + '&uid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype, that.data.nowid, 'materialEvidence', '');
  1288. this.sharelogtap();
  1289. break;
  1290. case 'video':
  1291. wx.showLoading({
  1292. title: '加载中...',
  1293. })
  1294. util.schemefun('/share/pages/videoshare/videoshare', 'vid=' + that.data.nowid + '&userid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype, that.data.nowid, 'video', '');
  1295. this.sharelogtap();
  1296. break;
  1297. case 'article':
  1298. wx.showLoading({
  1299. title: '加载中...',
  1300. })
  1301. util.schemefun('/share/pages/articleshare/articleshare', 'aid=' + that.data.nowid + '&userid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype, that.data.nowid, 'article', '');
  1302. this.sharelogtap();
  1303. break;
  1304. case 'Construction':
  1305. wx.showLoading({
  1306. title: '加载中...',
  1307. })
  1308. util.schemefun('/share/pages/constructsite/constructsite', 'uid=' + app.globalData.personMsg.id + '&cid=' + that.data.nowid + '&ctp=' + app.globalData.clientype, '', 'Construction', '');
  1309. this.sharelogtap();
  1310. default:
  1311. console.log('1')
  1312. }
  1313. },
  1314. setpostertap: function () {
  1315. let that = this;
  1316. let type = that.data.nowtype, usrl = "";
  1317. if (this.data.mattertype == '拓客视频') {
  1318. type = "video";
  1319. usrl = '&ftext=' + this.data.nowfirst + '&nText=' + that.data.nowtitbtn;
  1320. } else if (this.data.mattertype == '拓客图文') {
  1321. type = "article";
  1322. } else if (this.data.mattertype == '拓客案例') {
  1323. type = "materialCase";
  1324. usrl = '&u=' + app.globalData.personMsg.id + '&c=' + that.data.commu_id + '&s=' + that.data.casestyletype + '&st=' + that.data.square_start + '&e=' + that.data.square_end + '&h=' + that.data.nowstyleid
  1325. }
  1326. wx.navigateTo({
  1327. url: '/index/pages/setposter/setposter?type=' + type + '&aid=' + this.data.nowid + "&listshare=" + (that.data.listshare ? '123' : '') + usrl,
  1328. })
  1329. },
  1330. sendfriendtap: function () {
  1331. this.sharelogtap();
  1332. },
  1333. getcodeimg: function (type, usrl) {
  1334. let that = this, query = '', path = '';
  1335. if (type == 'video') {
  1336. query = 'vid=' + that.data.nowid + '&userid=' + app.globalData.personMsg.id;
  1337. path = 'share/pages/videoshare/videoshare';
  1338. }
  1339. if (type == 'article') {
  1340. query = 'aid=' + that.data.nowid + '&userid=' + app.globalData.personMsg.id;
  1341. path = 'share/pages/articleshare/articleshare';
  1342. }
  1343. utils.$post({
  1344. url: app.globalData.webUrl + 'api/share/qrcode',
  1345. header: {
  1346. 'Authorization': 'bearer ' + app.globalData.token
  1347. },
  1348. data: {
  1349. query: query,
  1350. path: path
  1351. },
  1352. success: function (res) {
  1353. if (res.data.code == "0") {
  1354. that.setData({
  1355. qrcodeimg: res.data.data
  1356. })
  1357. // setTimeout(function(){
  1358. // that.createdCode();
  1359. // },300)
  1360. }
  1361. },
  1362. fail() {
  1363. }
  1364. })
  1365. },
  1366. videosharetap: function (e) {
  1367. var that = this;
  1368. this.setData({
  1369. curTypeField: "Video",
  1370. nowtype: 'video',
  1371. nowid: e.currentTarget.dataset.vid,
  1372. nowtitle: e.currentTarget.dataset.title,
  1373. nowimg: e.currentTarget.dataset.img,
  1374. wshareshow: true,
  1375. islist: false
  1376. })
  1377. },
  1378. sharelogtap: function (e) {
  1379. var that = this;
  1380. utils.$post({
  1381. url: app.globalData.webUrl + 'api/share/addlog',
  1382. header: {
  1383. 'Authorization': 'bearer ' + app.globalData.token
  1384. },
  1385. data: {
  1386. id: that.data.nowid,
  1387. type: that.data.nowtype
  1388. },
  1389. success: function (r) {
  1390. }
  1391. })
  1392. },
  1393. // communitylistfun: function (e) {
  1394. // var that = this;
  1395. // that.setData({
  1396. // casepage: 1,
  1397. // })
  1398. // utils.$get({
  1399. // url: app.globalData.webUrl + 'api/communitylist',
  1400. // header: {
  1401. // 'Authorization': 'bearer ' + app.globalData.token
  1402. // },
  1403. // data: {
  1404. // page: 1,
  1405. // sort: this.data.ordertype == 'time' ? '' : 'updatetime'
  1406. // },
  1407. // success: function (res) {
  1408. // that.setData({
  1409. // datashow: true
  1410. // })
  1411. // let indexList = [], str = '';
  1412. // if (res.data.code == '0') {
  1413. // for (let i in res.data.data) {
  1414. // res.data.data[i].firstword = res.data.data[i].pinyin.slice(0, 1).toUpperCase();
  1415. // if (res.data.data[i].pinyin.slice(0, 1).toUpperCase() != str) {
  1416. // str = res.data.data[i].pinyin.slice(0, 1).toUpperCase() + '';
  1417. // indexList.push(str);
  1418. // }
  1419. // }
  1420. // that.setData({
  1421. // caselist: res.data.data,
  1422. // indexList: indexList
  1423. // })
  1424. // }
  1425. // setTimeout(function () {
  1426. // wx.hideLoading()
  1427. // }, 1000)
  1428. // }, fail() {
  1429. // wx.hideLoading()
  1430. // }
  1431. // })
  1432. // },
  1433. communityfun: function (e) {
  1434. var that = this;
  1435. that.setData({
  1436. casepage: 1,
  1437. })
  1438. utils.$get({
  1439. url: app.globalData.webUrl + 'api/communitylist',
  1440. header: {
  1441. 'Authorization': 'bearer ' + app.globalData.token
  1442. },
  1443. data: {
  1444. page: 1,
  1445. sort: ''
  1446. },
  1447. success: function (res) {
  1448. that.setData({
  1449. datashow: true
  1450. })
  1451. let indexList = [], str = '';
  1452. if (res.data.code == '0') {
  1453. for (let i in res.data.data) {
  1454. res.data.data[i].firstword = res.data.data[i].pinyin.slice(0, 1).toUpperCase();
  1455. if (res.data.data[i].pinyin.slice(0, 1).toUpperCase() != str) {
  1456. str = res.data.data[i].pinyin.slice(0, 1).toUpperCase() + '';
  1457. indexList.push(str);
  1458. }
  1459. }
  1460. that.setData({
  1461. communitycaselist: res.data.data,
  1462. indexList: indexList
  1463. })
  1464. that.communitygetCitys();
  1465. }
  1466. setTimeout(function () {
  1467. wx.hideLoading()
  1468. }, 500)
  1469. }, fail() {
  1470. wx.hideLoading()
  1471. }
  1472. })
  1473. },
  1474. communitygetCitys() {
  1475. const _this = this
  1476. const cities = this.data.communitycaselist;
  1477. // 按拼音排序
  1478. cities.sort((c1, c2) => {
  1479. let pinyin1 = c1.pinyin;
  1480. let pinyin2 = c2.pinyin;
  1481. return pinyin1.localeCompare(pinyin2)
  1482. })
  1483. // 添加首字母
  1484. const map = new Map()
  1485. for (const city of cities) {
  1486. const alpha = city.pinyin.charAt(0).toUpperCase()
  1487. if (!map.has(alpha)) map.set(alpha, [])
  1488. map.get(alpha).push({ name: city.name, id: city.id })
  1489. }
  1490. const keys = []
  1491. for (const key of map.keys()) {
  1492. keys.push(key)
  1493. }
  1494. keys.sort()
  1495. const list = []
  1496. for (const key of keys) {
  1497. list.push({
  1498. alpha: key,
  1499. subItems: map.get(key)
  1500. })
  1501. }
  1502. for (let i = 0; i < list.length; i++) {
  1503. list[i].subItems[0].case_num = '0';
  1504. for (let k = 0; k < list[i].subItems.length; k++) {
  1505. for (let j = 0; j < cities.length; j++) {
  1506. if (list[i].subItems[k].name == cities[j].name) {
  1507. list[i].subItems[k].case_num = cities[j].case_num;
  1508. list[i].id = cities[j].id;
  1509. }
  1510. }
  1511. }
  1512. }
  1513. _this.setData({ communitylist: list })
  1514. },
  1515. catetap: function (e) {
  1516. this.setData({
  1517. catetype: e.currentTarget.dataset.text
  1518. })
  1519. this.evidencelistfun();
  1520. },
  1521. evidencelistfun: function (e) {
  1522. var that = this;
  1523. if (!!e) {
  1524. that.setData({
  1525. filtrateflag: false
  1526. })
  1527. }
  1528. this.setData({
  1529. evidencepage: 1,
  1530. })
  1531. utils.$get({
  1532. url: app.globalData.webUrl + 'api/evidencelist',
  1533. header: {
  1534. 'Authorization': 'bearer ' + app.globalData.token
  1535. },
  1536. data: {
  1537. uid: app.globalData.personMsg.id,
  1538. page: 1,
  1539. limit:10,
  1540. cate: that.data.catetype,
  1541. keyword: that.data.evidencekeytext,
  1542. order: that.data.ordertype == 'clue_number' ? 'clue_number' :that.data.ordertype == 'hot'?'view_times':'addtime',
  1543. difference: !that.data.nowevidtype ? 0 : that.data.nowevidtype
  1544. },
  1545. success: function (res) {
  1546. setTimeout(function () {
  1547. wx.hideLoading()
  1548. }, 500)
  1549. if (res.data.code == '0') {
  1550. that.setData({
  1551. evidencelist: res.data.data,
  1552. leftevidencelist: [],
  1553. rightevidencelist: [],
  1554. datashow: true
  1555. })
  1556. that.imgload();
  1557. }
  1558. },
  1559. fail() {
  1560. wx.hideLoading()
  1561. }
  1562. })
  1563. },
  1564. imgload: function () {
  1565. var that = this;
  1566. var leftlist = that.data.leftevidencelist;
  1567. var rightlist = that.data.rightevidencelist;
  1568. var indexlist = that.data.evidencelist;
  1569. if (indexlist.length == 0) {
  1570. return false;
  1571. }
  1572. if (that.data.mattertype != '客户好评') {
  1573. return false;
  1574. }
  1575. if (leftlist.length == 0) {
  1576. leftlist.push(indexlist[0]);
  1577. indexlist.shift();
  1578. that.setData({
  1579. evidencelist: indexlist,
  1580. leftevidencelist: leftlist,
  1581. rightevidencelist: rightlist
  1582. })
  1583. } else {
  1584. var leftheight, rightheight;
  1585. wx.createSelectorQuery().select('.leftpublicpraisebox').boundingClientRect(function (res) {
  1586. leftheight = res.height;
  1587. wx.createSelectorQuery().select('.rightpublicpraisebox').boundingClientRect(function (rs) {
  1588. leftlist = that.data.leftevidencelist;
  1589. rightlist = that.data.rightevidencelist;
  1590. indexlist = that.data.evidencelist;
  1591. rightheight = rs.height;
  1592. if (leftheight <= rightheight) {
  1593. leftlist.push(indexlist[0]);
  1594. indexlist.shift();
  1595. } else {
  1596. rightlist.push(indexlist[0]);
  1597. indexlist.shift();
  1598. }
  1599. that.setData({
  1600. evidencelist: indexlist,
  1601. leftevidencelist: leftlist,
  1602. rightevidencelist: rightlist
  1603. })
  1604. }).exec();
  1605. }).exec();
  1606. }
  1607. },
  1608. arrfun: function (str) {
  1609. var that = this;
  1610. let arr = str.split(',');
  1611. return arr;
  1612. },
  1613. alltextap: function (e) {
  1614. var that = this;
  1615. var wxfriendlist = this.data.wxfriendlist;
  1616. wxfriendlist[e.currentTarget.dataset.idx].textflag = 1;
  1617. this.setData({
  1618. wxfriendlist: wxfriendlist
  1619. })
  1620. },
  1621. publictap: function (e) {
  1622. wx.navigateTo({
  1623. url: '/index/pages/publicpraisemsg/publicpraisemsg?eid=' + e.currentTarget.dataset.eid + "&title=" + e.currentTarget.dataset.title,
  1624. })
  1625. },
  1626. evidencetap: function (e) {
  1627. var that = this;
  1628. that.setData({
  1629. nowtype: 'materialEvidence',
  1630. nowid: e.currentTarget.dataset.eid,
  1631. nowtitle: e.currentTarget.dataset.title,
  1632. nowimg: e.currentTarget.dataset.img,
  1633. islist: false,
  1634. wshareshow: true
  1635. })
  1636. },
  1637. /**
  1638. * 生命周期函数--监听页面初次渲染完成
  1639. */
  1640. onReady: function () {
  1641. },
  1642. /**
  1643. * 生命周期函数--监听页面显示
  1644. */
  1645. onShow: function () {
  1646. const that=this;
  1647. if(!showflag){
  1648. if(that.data.mattertype == '拓客案例'){
  1649. this.caseimgload();
  1650. }else if(that.data.mattertype == '拓客视频'){
  1651. this.videoimgload();
  1652. }
  1653. }
  1654. showflag=true;
  1655. },
  1656. /**
  1657. * 生命周期函数--监听页面隐藏
  1658. */
  1659. onHide: function () {
  1660. showflag=false;
  1661. },
  1662. /**
  1663. * 生命周期函数--监听页面卸载
  1664. */
  1665. onUnload: function () {
  1666. },
  1667. /**
  1668. * 页面相关事件处理函数--监听用户下拉动作
  1669. */
  1670. onPullDownRefresh: function () {
  1671. var that = this;
  1672. if (that.data.mattertype == '拓客视频') {
  1673. this.setData({
  1674. page: 1
  1675. })
  1676. utils.$post({
  1677. url: app.globalData.webUrl + 'api/video/list',
  1678. header: {
  1679. 'Authorization': 'bearer ' + app.globalData.token
  1680. },
  1681. data: {
  1682. type: that.data.nowfirst,
  1683. label: that.data.tagtype,
  1684. page: 1,
  1685. limit: "10",
  1686. keyword: that.data.videotext,
  1687. order: that.data.ordertype == 'clue_number' ? 'clue_number' :that.data.ordertype == 'hot'?'shared_times':'uploadtime'
  1688. },
  1689. success: function (res) {
  1690. wx.stopPullDownRefresh();
  1691. if (res.data.code == 0) {
  1692. that.setData({
  1693. videolist: res.data.data,
  1694. leftlist: [],
  1695. rightlist: []
  1696. })
  1697. that.videoimgload();
  1698. }
  1699. setTimeout(function () {
  1700. wx.hideLoading();
  1701. }, 500)
  1702. }
  1703. })
  1704. } else if (that.data.mattertype == '拓客案例') {
  1705. that.setData({
  1706. casepage: 1,
  1707. datashow: false
  1708. })
  1709. wx.showLoading({
  1710. title: '加载中...',
  1711. })
  1712. utils.$get({
  1713. url: app.globalData.webUrl + 'api/caselist',
  1714. header: {
  1715. 'Authorization': 'bearer ' + app.globalData.token
  1716. },
  1717. data: {
  1718. uid: app.globalData.personMsg.id,
  1719. page: 1,
  1720. limit:10,
  1721. commu_id: that.data.commu_id,// 小区id
  1722. style_id: that.data.casestyletype,//风格id
  1723. square_start: that.data.square_start,//面积开始值
  1724. square_end: that.data.square_end,//面积结束值
  1725. keyword: that.data.casekeytext,
  1726. housetype_id: that.data.nowstyleid,
  1727. case_type:this.data.noweffectid,
  1728. order: that.data.ordertype == 'clue_number' ? 'clue_number' :that.data.ordertype == 'hot'?'shared_times':''
  1729. },
  1730. success: function (res) {
  1731. wx.stopPullDownRefresh();
  1732. if (res.data.code == '0') {
  1733. that.setData({
  1734. caselist: res.data.data,
  1735. leftcaselist: [],
  1736. rightcaselist: [],
  1737. })
  1738. that.caseimgload();
  1739. }
  1740. wx.hideLoading();
  1741. }
  1742. })
  1743. } else {
  1744. var that = this;
  1745. that.setData({
  1746. articlepage: 1
  1747. })
  1748. utils.$post({
  1749. url: app.globalData.webUrl + 'api/article/list',
  1750. header: {
  1751. 'Authorization': 'bearer ' + app.globalData.token
  1752. },
  1753. data: {
  1754. type: that.data.articlenowfirst,
  1755. label: that.data.articleId,
  1756. page: 1,
  1757. limit: "10",
  1758. keyword: that.data.articletext,
  1759. order: that.data.ordertype == 'clue_number' ? 'clue_number' :that.data.ordertype == 'hot'?'shared_times':'uploadtime'
  1760. },
  1761. success: function (res) {
  1762. wx.stopPullDownRefresh()
  1763. if (res.data.code == 0) {
  1764. that.setData({
  1765. articlelist: res.data.data
  1766. })
  1767. }
  1768. }
  1769. })
  1770. }
  1771. },
  1772. /**
  1773. * 页面上拉触底事件的处理函数
  1774. */
  1775. onReachBottom: function () {
  1776. var that = this;
  1777. if (that.data.mattertype == '拓客视频') {
  1778. var page = that.data.page;
  1779. page = page * 1 + 1;
  1780. that.setData({
  1781. page: page
  1782. })
  1783. wx.showLoading({
  1784. title: '加载中...',
  1785. })
  1786. utils.$post({
  1787. url: app.globalData.webUrl + 'api/video/list',
  1788. header: {
  1789. 'Authorization': 'bearer ' + app.globalData.token
  1790. },
  1791. data: {
  1792. type: that.data.nowfirst,
  1793. label: that.data.tagtype,
  1794. page: page,
  1795. limit: "10",
  1796. keyword: that.data.videotext,
  1797. order: that.data.ordertype == 'clue_number' ? 'clue_number' :that.data.ordertype == 'hot'? 'shared_times':'uploadtime'
  1798. },
  1799. success: function (res) {
  1800. wx.hideLoading();
  1801. if (res.data.code == 0) {
  1802. var arr = res.data.data;
  1803. var arrflag = false;
  1804. var videolist = that.data.videolist;
  1805. if (videolist.length != 0) {
  1806. arrflag = true;
  1807. }
  1808. for (var i = 0; i < arr.length; i++) {
  1809. videolist.push(arr[i]);
  1810. }
  1811. that.setData({
  1812. videolist: videolist,
  1813. })
  1814. if (!arrflag) {
  1815. that.videoimgload();
  1816. }
  1817. }
  1818. }
  1819. })
  1820. } else if (that.data.mattertype == '拓客案例') {
  1821. var page = that.data.casepage;
  1822. page = page * 1 + 1;
  1823. that.setData({
  1824. casepage: page,
  1825. datashow: false
  1826. })
  1827. wx.showLoading({
  1828. title: '加载中...',
  1829. })
  1830. wx.showLoading({
  1831. title: '加载中...',
  1832. })
  1833. utils.$get({
  1834. url: app.globalData.webUrl + 'api/caselist',
  1835. header: {
  1836. 'Authorization': 'bearer ' + app.globalData.token
  1837. },
  1838. data: {
  1839. uid: app.globalData.personMsg.id,
  1840. page: that.data.casepage,
  1841. limit:10,
  1842. commu_id: that.data.commu_id,// 小区id
  1843. style_id: that.data.casestyletype,//风格id
  1844. square_start: that.data.square_start,//面积开始值
  1845. square_end: that.data.square_end,//面积结束值
  1846. keyword: that.data.casekeytext,
  1847. housetype_id: that.data.nowstyleid,
  1848. case_type:this.data.noweffectid,
  1849. order:that.data.ordertype == 'clue_number' ? 'clue_number' :that.data.ordertype == 'hot'?'shared_times':''
  1850. },
  1851. success: function (res) {
  1852. wx.hideLoading();
  1853. if (res.data.code == '0') {
  1854. let arrflag = false;
  1855. let caselist = that.data.caselist;
  1856. if (caselist.length != 0) {
  1857. arrflag = true;
  1858. }
  1859. caselist = caselist.concat(res.data.data)
  1860. that.setData({
  1861. caselist: caselist
  1862. })
  1863. if (!arrflag) {
  1864. that.caseimgload();
  1865. }
  1866. }
  1867. }
  1868. })
  1869. } else {
  1870. var articlepage = that.data.articlepage;
  1871. articlepage = articlepage * 1 + 1;
  1872. that.setData({
  1873. articlepage: articlepage
  1874. })
  1875. utils.$post({
  1876. url: app.globalData.webUrl + 'api/article/list',
  1877. header: {
  1878. 'Authorization': 'bearer ' + app.globalData.token
  1879. },
  1880. data: {
  1881. type: that.data.articlenowfirst,
  1882. label: that.data.articleId,
  1883. page: articlepage,
  1884. limit: "10",
  1885. keyword: that.data.articletext,
  1886. order: that.data.ordertype == 'clue_number' ? 'clue_number' :that.data.ordertype == 'hot'?'shared_times':'uploadtime'
  1887. },
  1888. success: function (res) {
  1889. let articlelist = that.data.articlelist;
  1890. if (res.data.code == 0) {
  1891. articlelist = articlelist.concat(res.data.data)
  1892. that.setData({
  1893. articlelist: articlelist
  1894. })
  1895. }
  1896. wx.hideLoading()
  1897. }
  1898. })
  1899. }
  1900. },
  1901. videoTap: function (e) {
  1902. wx.navigateTo({
  1903. url: "/index/pages/videoshare/videoshare?vid=" + e.currentTarget.dataset.vid,
  1904. });
  1905. },
  1906. videocollectap: function (e) {
  1907. var that = this;
  1908. var vurl = '';
  1909. var videoObj = '';
  1910. if (e.currentTarget.dataset.type == 'leftlist') {
  1911. videoObj = that.data.leftlist;
  1912. } else {
  1913. videoObj = that.data.rightlist;
  1914. }
  1915. if (e.currentTarget.dataset.num == '0') {
  1916. vurl = "api/video/collect"
  1917. } else {
  1918. vurl = "api/video/collectCancel"
  1919. }
  1920. utils.$post({
  1921. url: app.globalData.webUrl + vurl,
  1922. header: {
  1923. 'Authorization': 'bearer ' + app.globalData.token
  1924. },
  1925. data: {
  1926. id: e.currentTarget.dataset.vid,
  1927. },
  1928. success: function (res) {
  1929. if (res.data.code == "0") {
  1930. if (videoObj[e.currentTarget.dataset.idx].isCollection == '0') {
  1931. videoObj[e.currentTarget.dataset.idx].isCollection = 1;
  1932. if (e.currentTarget.dataset.type == 'leftlist') {
  1933. that.setData({
  1934. leftlist: videoObj
  1935. })
  1936. } else {
  1937. that.setData({
  1938. rightlist: videoObj
  1939. })
  1940. }
  1941. wx.showToast({
  1942. title: res.data.msg,
  1943. icon: 'none',
  1944. duration: 2000
  1945. })
  1946. } else {
  1947. wx.showToast({
  1948. title: res.data.msg,
  1949. icon: 'none',
  1950. duration: 2000
  1951. })
  1952. videoObj[e.currentTarget.dataset.idx].isCollection = 0;
  1953. if (e.currentTarget.dataset.type == 'leftlist') {
  1954. that.setData({
  1955. leftlist: videoObj
  1956. })
  1957. } else {
  1958. that.setData({
  1959. rightlist: videoObj
  1960. })
  1961. }
  1962. }
  1963. } else {
  1964. if (res.data.msg == '您已收藏') {
  1965. videoObj[e.currentTarget.dataset.idx].isCollection = 1;
  1966. if (e.currentTarget.dataset.type == 'leftlist') {
  1967. that.setData({
  1968. leftlist: videoObj
  1969. })
  1970. } else {
  1971. that.setData({
  1972. rightlist: videoObj
  1973. })
  1974. }
  1975. }
  1976. }
  1977. }
  1978. })
  1979. },
  1980. /**
  1981. * 用户点击右上角分享
  1982. */
  1983. onShareAppMessage: function () {
  1984. let that = this;
  1985. this.setData({
  1986. wshareshow: false
  1987. })
  1988. that.setData({
  1989. wshareshow: false
  1990. })
  1991. if (that.data.nowtype == 'video') {
  1992. this.sharelogtap();
  1993. return {
  1994. title: that.data.nowtitle,
  1995. imageUrl: that.data.nowimg,
  1996. path: '/share/pages/videoshare/videoshare?vid=' + that.data.nowid + '&userid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype
  1997. }
  1998. }
  1999. if (that.data.nowtype == 'article') {
  2000. this.sharelogtap();
  2001. return {
  2002. title: that.data.nowtitle,
  2003. imageUrl: that.data.nowimg,
  2004. path: '/share/pages/articleshare/articleshare?aid=' + that.data.nowid + '&userid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype
  2005. }
  2006. }
  2007. if (that.data.nowtype == 'materialEvidence') {
  2008. this.sharelogtap();
  2009. return {
  2010. title: that.data.nowtitle,
  2011. imageUrl: that.data.nowimg,
  2012. path: '/share/pages/publicpraisemsg/publicpraisemsg?eid=' + that.data.nowid + '&uid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype
  2013. }
  2014. }
  2015. // if (this.data.mattertype == '拓客案例') {
  2016. // this.sharelogtap();
  2017. // return {
  2018. // title: app.globalData.personMsg.binded.name + "的拓客案例",
  2019. // imageUrl: app.globalData.imgUrl + "xcx/caseposter.jpg",
  2020. // path: '/share/pages/caselist/caselist?u=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype + '&c=' + that.data.commu_id + '&s=' + that.data.casestyletype + '&st=' + that.data.square_start + '&e=' + that.data.square_end + '&h=' + that.data.nowstyleid
  2021. // }
  2022. // }
  2023. var img = that.data.nowimg;
  2024. img = img.replace('http://o.nczyzs.com/', 'https://o.nczyzs.com/');
  2025. if (that.data.nowtype == 'materialCase') {
  2026. this.sharelogtap();
  2027. return {
  2028. title: that.data.nowtitle,
  2029. imageUrl: that.data.nowimg,
  2030. path: '/share/pages/materialcase/materialcase?cid=' + that.data.nowid + '&uid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype
  2031. }
  2032. }
  2033. }
  2034. })