caselist.js 77 KB

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