morecontent.js 71 KB

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