caselist.js 73 KB

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