caselist.js 73 KB

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