shareCard.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867
  1. // share/pages/shareCard/shareCard.js
  2. var app = getApp();
  3. var utils = require("../../../utils/http");
  4. let evpage=1,casepage=1;
  5. let time=0;
  6. var timer = null;
  7. Page({
  8. /**
  9. * 页面的初始数据
  10. */
  11. data: {
  12. canIUseGetUserProfile: false,
  13. shareobj:{},
  14. employeeflag:false,//false是用户,true是员工
  15. top:app.globalData.statusBarHeight,
  16. hgt:app.globalData.titleBarHeight,
  17. companyobj:{},
  18. loginFlag:false,
  19. phoneFlag:false,
  20. imgUrl:app.globalData.imgUrl,
  21. mineinfo:{
  22. name: ''
  23. },
  24. logcount:0,
  25. imgarr:[],
  26. type:1,
  27. evidencetype:'',
  28. evidencelist:[],
  29. leftevidencelist:[],
  30. rightevidencelist:[],
  31. catetype:'',
  32. datashow:true,
  33. nowstyle: '',
  34. stylelist: [],
  35. square_start: '', //面积开始值
  36. square_end: '', //面积结束值
  37. nowcommunity: '',
  38. communitylist: [],
  39. nowhousetype: '',
  40. housetypelist: [],
  41. caselist: [],
  42. keyword: '',
  43. datashow: false,
  44. communityflag:false,
  45. nowcommunitname:'',
  46. fromType: '',
  47. typearr:[
  48. {id:1,name:'效果案例',type:1},
  49. {id:2,name:'实景案例',type:2}
  50. ],
  51. noweffect:'',
  52. prelook:'',
  53. timeline:app.globalData.timeline
  54. },
  55. /**
  56. * 生命周期函数--监听页面加载
  57. */
  58. onLoad: function (opts) {
  59. var that = this;
  60. time=0;
  61. if(opts.type=='share'){
  62. this.setData({
  63. prelook:"share"
  64. })
  65. }
  66. if(app.globalData.timeline!=2){
  67. wx.showLoading();
  68. }
  69. if (wx.getUserProfile) {
  70. this.setData({
  71. canIUseGetUserProfile: true
  72. })
  73. }
  74. that.setData({
  75. top: app.globalData.statusBarHeight,
  76. hgt: app.globalData.titleBarHeight,
  77. imgUrl:app.globalData.imgUrl,
  78. fromType: opts.ftype
  79. })
  80. app.globalData.clientype = opts.ctp;
  81. if(opts.empid){
  82. app.globalData.sharempid=opts.empid;
  83. }
  84. app.globalData.shareuserid = opts.uid;
  85. this.loginfun();
  86. },
  87. sharecompany:function (){
  88. const that=this;
  89. utils.$post({
  90. url: app.globalData.webUrl + 'client/index/content_belong_company',
  91. header: {
  92. 'Authorization':'bearer '+app.globalData.token
  93. },
  94. data:{
  95. client_type:app.globalData.clientype,
  96. uid: app.globalData.shareuserid
  97. },
  98. success: function (res) {
  99. if(res.data.code=='0'){
  100. app.globalData.companyobj=res.data.data;
  101. that.setData({
  102. companyobj:res.data.data
  103. })
  104. app.globalData.sharempid= res.data.data.employee_id;
  105. }
  106. },
  107. complete(res) {
  108. wx.hideLoading()
  109. }
  110. })
  111. },
  112. loginfun:function(e){
  113. var that=this;
  114. wx.showLoading({
  115. title: '加载中...',
  116. })
  117. if(!!e){
  118. this.setData({
  119. type:e
  120. })
  121. }
  122. wx.login({
  123. success: function (data) {
  124. if (data.errMsg == 'login:ok') {
  125. utils.$post({
  126. url: app.globalData.webUrl + 'api/users/code2sessionmini',
  127. data: {
  128. code:data.code,
  129. share: app.globalData.shareuserid,
  130. clien_type: app.globalData.clientype
  131. },
  132. success: function (r) {
  133. if(r.data.code=='0'){
  134. app.globalData.sharepersonobj = r.data.share;
  135. app.globalData.token=r.data.token;
  136. that.sharecompany();
  137. if (r.data.share) {
  138. app.globalData.vrString = r.data.share.str;
  139. }
  140. that.setData({
  141. sharepersonMsg:app.globalData.sharepersonobj,
  142. })
  143. if(!!r.data.user.phone){
  144. that.setData({
  145. loginFlag:false,
  146. phoneFlag:false,
  147. employeeflag:(!!r.data.user.binded&&r.data.user.binded.state=='在职')?true:false
  148. })
  149. app.globalData.personMsg=r.data.user;
  150. app.globalData.use_id=r.data.user.id;
  151. var obj={
  152. detail:1
  153. }
  154. that.cardfun(obj);
  155. }else{
  156. that.cardfun();
  157. wx.hideLoading();
  158. that.setData({
  159. loginFlag:false,
  160. phoneFlag:true
  161. })
  162. }
  163. }
  164. }
  165. })
  166. }
  167. }
  168. })
  169. },
  170. cardfun(){
  171. const that=this;
  172. utils.$post({
  173. url: app.globalData.webUrl + 'client/card/info',
  174. header: {
  175. 'Authorization':'bearer '+app.globalData.token
  176. },
  177. data: {
  178. user: app.globalData.shareuserid,
  179. },
  180. success: function (res) {
  181. wx.hideLoading();
  182. if(res.data.code==0){
  183. that.setData({
  184. mineinfo:res.data.data,
  185. logcount:res.data.logcount,
  186. imgarr:res.data.log
  187. })
  188. }
  189. that.evidenceCate();
  190. that.evidencelist();
  191. that.casestylefun();
  192. that.housestylefun();
  193. that.casecommunityfun();
  194. that.caselistfun();
  195. }
  196. })
  197. },
  198. setypetap(e){
  199. this.setData({
  200. type:e.target.dataset.num
  201. })
  202. if(e.target.dataset.num==3){
  203. this.evidencelist();
  204. }
  205. },
  206. preimgtap(){
  207. if(!this.data.mineinfo.qrcode){
  208. wx.showToast({
  209. title: '员工二维码为空!',
  210. icon: 'none',
  211. duration: 2000
  212. })
  213. return false;
  214. }
  215. let img=app.globalData.imgUrl+'/'+this.data.mineinfo.qrcode;
  216. wx.previewImage({
  217. current: img, // 当前显示图片的 http 链接
  218. urls: [img] // 需要预览的图片 http 链接列表
  219. })
  220. },
  221. copytap(){
  222. if(!this.data.mineinfo.wx){
  223. wx.showToast({
  224. title: '员工微信为空!',
  225. icon: 'none',
  226. duration: 2000
  227. })
  228. return false;
  229. }
  230. wx.setClipboardData({
  231. data: this.data.mineinfo.wx,
  232. success (res) {
  233. }
  234. })
  235. },
  236. callphonetap(){
  237. wx.makePhoneCall({
  238. phoneNumber: this.data.mineinfo.phone //仅为示例,并非真实的电话号码
  239. })
  240. },
  241. openVRLink(e) {
  242. let vrlink = e.currentTarget.dataset.vrlink;
  243. let id = e.currentTarget.dataset.id;
  244. wx.navigateTo({
  245. url: '/pages/other/other?type=vr&vrurl=' + escape(vrlink) + '&cty=materialCase' + '&uid=' + app.globalData.shareuserid + '&ctp=' + app.globalData.clientype + '&aid=' + id,
  246. })
  247. },
  248. viewAuthorization() {
  249. return new Promise(function(resolve,reject) {
  250. wx.getSetting({
  251. success (res) {
  252. if(res.authSetting['scope.addPhoneContact']){
  253. resolve({authorize:true})
  254. }else{
  255. wx.openSetting({
  256. success (res) {
  257. if(res.authSetting['scope.addPhoneContact']){
  258. wx.authorize({
  259. scope: 'scope.addPhoneContact',
  260. success: function (res) {
  261. console.log('success:', res);
  262. resolve({authorize:true})
  263. },
  264. fail: function (error) {
  265. console.log('error:', error);
  266. reject({authorize:false})
  267. }
  268. })
  269. }else{
  270. wx.authorize({
  271. scope: 'scope.addPhoneContact',
  272. success: function (res) {
  273. console.log('success:', res);
  274. resolve({authorize:true})
  275. },
  276. fail: function (error) {
  277. console.log('error:', error);
  278. reject({authorize:false})
  279. }
  280. })
  281. }
  282. },
  283. fail(){
  284. wx.authorize({
  285. scope: 'scope.addPhoneContact',
  286. success: function (res) {
  287. console.log('success:', res);
  288. resolve({authorize:true})
  289. },
  290. fail: function (error) {
  291. console.log('error:', error);
  292. reject({authorize:false})
  293. }
  294. })
  295. }
  296. })
  297. }
  298. }
  299. })
  300. })
  301. },
  302. async savenumtap() {
  303. let res = await this.viewAuthorization();
  304. if (res.authorize) {
  305. wx.addPhoneContact({
  306. firstName: this.data.mineinfo.name,
  307. photoFilePath: this.data.mineinfo.headimgurl,
  308. mobilePhoneNumber: this.data.mineinfo.phone,
  309. weChatNumber: this.data.mineinfo.wx,
  310. addressStreet: this.data.mineinfo.company_address,
  311. organization: this.data.mineinfo.company_name,
  312. title: this.data.mineinfo.position
  313. })
  314. return;
  315. }
  316. },
  317. evidenceCate:function(){
  318. var that=this;
  319. utils.$get({
  320. url: app.globalData.webUrl + 'client/material/evidenceCate',
  321. header: {
  322. 'Authorization':'bearer '+app.globalData.token
  323. },
  324. data:{},
  325. success: function (res) {
  326. that.setData({
  327. evidencetype:res.data.data
  328. })
  329. }
  330. })
  331. },
  332. seteffectap(e){
  333. this.setData({
  334. noweffect:e.currentTarget.dataset.type
  335. })
  336. this.caselistfun();
  337. },
  338. setevitap(e){
  339. this.setData({
  340. catetype:e.currentTarget.dataset.eid
  341. })
  342. this.evidencelist();
  343. },
  344. evidencelist:function(){
  345. const that=this;
  346. evpage=1;
  347. utils.$get({
  348. url: app.globalData.webUrl + 'client/evidencelist',
  349. header: {
  350. 'Authorization':'bearer '+app.globalData.token
  351. },
  352. data:{
  353. uid:app.globalData.personMsg.id,
  354. page:1,
  355. cate:that.data.catetype,
  356. },
  357. success: function (res) {
  358. setTimeout(function(){
  359. wx.hideLoading()
  360. },1000)
  361. if(res.data.code=='0'){
  362. that.setData({
  363. evidencelist:res.data.data,
  364. leftevidencelist:[],
  365. rightevidencelist:[],
  366. datashow:true
  367. })
  368. that.imgload();
  369. }
  370. },
  371. fail(){
  372. wx.hideLoading()
  373. }
  374. })
  375. },
  376. publictap:function(e){
  377. wx.navigateTo({
  378. url: '/share/pages/publicpraisemsg/publicpraisemsg?type=3&eid='+e.currentTarget.dataset.eid+"&uid="+app.globalData.shareuserid+'&ctp='+app.globalData.clientype
  379. })
  380. },
  381. imgload:function(){
  382. var that=this;
  383. var leftlist=that.data.leftevidencelist;
  384. var rightlist=that.data.rightevidencelist;
  385. var indexlist=that.data.evidencelist;
  386. if(indexlist.length==0){
  387. return false;
  388. }
  389. if(!indexlist[0]){
  390. return false;
  391. }
  392. if(leftlist.length==0){
  393. leftlist.push(indexlist[0]);
  394. indexlist.shift();
  395. that.setData({
  396. evidencelist:indexlist,
  397. leftevidencelist:leftlist,
  398. rightevidencelist:rightlist
  399. })
  400. }else{
  401. var leftheight,rightheight;
  402. wx.createSelectorQuery().select('.leftpublicpraisebox').boundingClientRect(function(res){
  403. leftheight=res.height;
  404. wx.createSelectorQuery().select('.rightpublicpraisebox').boundingClientRect(function(rs){
  405. leftlist=that.data.leftevidencelist;
  406. rightlist=that.data.rightevidencelist;
  407. indexlist=that.data.evidencelist;
  408. rightheight=rs.height;
  409. if(leftheight<=rightheight){
  410. leftlist.push(indexlist[0]);
  411. indexlist.shift();
  412. }else{
  413. rightlist.push(indexlist[0]);
  414. indexlist.shift();
  415. }
  416. that.setData({
  417. evidencelist:indexlist,
  418. leftevidencelist:leftlist,
  419. rightevidencelist:rightlist
  420. })
  421. }).exec();
  422. }).exec();
  423. }
  424. },
  425. setliketap(){
  426. var that = this;
  427. utils.$get({
  428. url: app.globalData.webUrl + 'client/card/like',
  429. header: {
  430. 'Authorization': 'bearer ' + app.globalData.token
  431. },
  432. data: {
  433. employee_id:app.globalData.sharempid
  434. },
  435. success: function (res) {
  436. let mineinfo=that.data.mineinfo;
  437. if (res.data.code == '0') {
  438. mineinfo.likes=mineinfo.likes*1+1;
  439. that.setData({
  440. mineinfo:mineinfo
  441. })
  442. }
  443. }
  444. })
  445. },
  446. casestylefun: function () {
  447. var that = this;
  448. utils.$get({
  449. url: app.globalData.webUrl + 'client/stylelist',
  450. header: {
  451. 'Authorization': 'bearer ' + app.globalData.token
  452. },
  453. data: {},
  454. success: function (res) {
  455. if (res.data.code == '0') {
  456. that.setData({
  457. stylelist: res.data.data
  458. })
  459. }
  460. }
  461. })
  462. },
  463. housestylefun: function () {
  464. var that = this;
  465. utils.$get({
  466. url: app.globalData.webUrl + 'client/material/housetypelist',
  467. header: {
  468. 'Authorization': 'bearer ' + app.globalData.token
  469. },
  470. data: {},
  471. success: function (res) {
  472. if (res.data.code == '0') {
  473. that.setData({
  474. housetypelist: res.data.data
  475. })
  476. }
  477. }
  478. })
  479. },
  480. onChoose(e) {
  481. var that=this;
  482. that.setData({
  483. nowcommunity:e.detail.item.currentTarget.dataset.cid,
  484. nowcommunitname:e.detail.item.currentTarget.dataset.item.name,
  485. communityflag:false
  486. })
  487. wx.showLoading({
  488. title: '加载中...',
  489. })
  490. that.caselistfun();
  491. },
  492. casecommunityfun: function () {
  493. var that = this;
  494. utils.$get({
  495. url: app.globalData.webUrl + 'client/communitylist',
  496. header: {
  497. 'Authorization': 'bearer ' + app.globalData.token
  498. },
  499. data: {},
  500. success: function (res) {
  501. if (res.data.code == '0') {
  502. that.setData({
  503. communitylist: res.data.data
  504. })
  505. }
  506. that.getCitys();
  507. }
  508. })
  509. },
  510. getCitys() {
  511. const _this = this
  512. const cities = this.data.communitylist;
  513. // 按拼音排序
  514. cities.sort((c1, c2) => {
  515. let pinyin1 = c1.pinyin;
  516. let pinyin2 = c2.pinyin;
  517. return pinyin1.localeCompare(pinyin2)
  518. })
  519. // 添加首字母
  520. const map = new Map()
  521. for (const city of cities) {
  522. const alpha = city.pinyin.charAt(0).toUpperCase()
  523. if (!map.has(alpha)) map.set(alpha, [])
  524. map.get(alpha).push({ name: city.name,id: city.id})
  525. }
  526. const keys = []
  527. for (const key of map.keys()) {
  528. keys.push(key)
  529. }
  530. keys.sort()
  531. const list = []
  532. for (const key of keys) {
  533. list.push({
  534. alpha: key,
  535. subItems: map.get(key)
  536. })
  537. }
  538. for(let i=0;i<list.length;i++){
  539. for (let k = 0; k < list[i].subItems.length; k++) {
  540. for(let j=0;j<cities.length;j++){
  541. if(list[i].subItems[k].name==cities[j].name){
  542. list[i].subItems[k].case_num=cities[j].case_num;
  543. list[i].id=cities[j].id;
  544. }
  545. }
  546. }
  547. }
  548. _this.setData({list:list})
  549. },
  550. selectareatap: function (e) {
  551. this.setData({
  552. square_start: e.currentTarget.dataset.start,
  553. square_end: e.currentTarget.dataset.end,
  554. })
  555. this.caselistfun();
  556. },
  557. caselistfun: function (e) {
  558. var that = this;
  559. casepage = 1;
  560. utils.$get({
  561. url: app.globalData.webUrl + 'client/caselist',
  562. header: {
  563. 'Authorization': 'bearer ' + app.globalData.token
  564. },
  565. data: {
  566. page: 1,
  567. commu_id: that.data.nowcommunity, // 小区id
  568. style_id: that.data.nowstyle, //风格id
  569. square_start: that.data.square_start, //面积开始值
  570. square_end: that.data.square_end, //面积结束值
  571. keyword: that.data.keyword,
  572. housetype_id: that.data.nowhousetype,
  573. case_type:this.data.noweffect,
  574. },
  575. success: function (res) {
  576. that.setData({
  577. datashow: true
  578. })
  579. if (res.data.code == '0') {
  580. that.setData({
  581. caselist: res.data.data,
  582. })
  583. }
  584. setTimeout(function () {
  585. wx.hideLoading()
  586. }, 1000)
  587. },
  588. fail() {
  589. wx.hideLoading()
  590. }
  591. })
  592. },
  593. setstyletap: function (e) {
  594. this.setData({
  595. nowstyle: e.currentTarget.dataset.type
  596. })
  597. this.caselistfun();
  598. },
  599. setcommunitytap: function (e) {
  600. this.setData({
  601. nowcommunity: e.currentTarget.dataset.type,
  602. // communityflag:true,
  603. nowcommunitname: e.currentTarget.dataset.text,
  604. })
  605. this.caselistfun();
  606. },
  607. opencommunitytap:function(){
  608. this.setData({
  609. communityflag:true,
  610. })
  611. },
  612. dothis:function(){},
  613. colsecommunitytap:function(){
  614. this.setData({
  615. communityflag:false
  616. })
  617. },
  618. sethousetypetap: function (e) {
  619. this.setData({
  620. nowhousetype: e.currentTarget.dataset.type
  621. })
  622. this.caselistfun();
  623. },
  624. casemsgtap:function(e){
  625. wx.navigateTo({
  626. url: '/index/pages/casemsg/casemsg?cid='+e.currentTarget.dataset.cid,
  627. })
  628. },
  629. backTap:function(){
  630. if (this.data.fromType) {
  631. wx.navigateBack({
  632. delta: 1,
  633. })
  634. }
  635. // else {
  636. // wx.reLaunch({
  637. // url: '/pages/index/index?state=1',
  638. // })
  639. // }
  640. },
  641. casemsgtap: function (e) {
  642. wx.navigateTo({
  643. url: '/share/pages/materialcase/materialcase?type=3&cid=' + e.currentTarget.dataset.cid+'&uid='+app.globalData.shareuserid+'&ctp='+app.globalData.clientype
  644. })
  645. },
  646. getPhoneNumberTap:function(res){
  647. var that=this;
  648. that.setData({
  649. phoneFlag:false,
  650. })
  651. if(res.detail.errMsg=='getPhoneNumber:ok'){
  652. utils.$post({
  653. url: app.globalData.webUrl + 'api/users/setUserMobile',
  654. data: {
  655. encryptedData:res.detail.encryptedData,
  656. iv:res.detail.iv
  657. },
  658. header: {
  659. 'Authorization':'bearer '+app.globalData.token
  660. },
  661. success: function (r) {
  662. if(r.data.code=='0'){
  663. app.globalData.phone=true;
  664. that.setData({
  665. phoneFlag:false,
  666. })
  667. }
  668. }
  669. })
  670. }
  671. },
  672. searchplacetap(){
  673. if(!this.data.mineinfo.company_vr_address){
  674. wx.showToast({
  675. title: 'VR链接为空!',
  676. icon: 'none',
  677. duration: 2000
  678. })
  679. return false;
  680. }
  681. app.globalData.vraddress=this.data.mineinfo.company_vr_address;
  682. let str = escape(app.globalData.vraddress);
  683. wx.navigateTo({
  684. url: '/pages/other/other?type=vr&ctp='+app.globalData.clientype+'&uid='+app.globalData.shareuserid + '&vrurl='+ str + '&aid=' + this.data.mineinfo.employee_id + '&cty=employeeCard',
  685. })
  686. },
  687. /**
  688. * 生命周期函数--监听页面初次渲染完成
  689. */
  690. onReady: function () {
  691. },
  692. /**
  693. * 生命周期函数--监听页面显示
  694. */
  695. onShow: function () {
  696. this.setData({
  697. timeline:app.globalData.timeline
  698. })
  699. if(app.globalData.timeline==2){
  700. wx.hideLoading()
  701. }
  702. timer = setInterval(function(){
  703. time=time*1+1;
  704. },1000)
  705. },
  706. /**
  707. * 生命周期函数--监听页面隐藏
  708. */
  709. onHide: function () {
  710. if (timer) {
  711. clearInterval(timer)
  712. }
  713. this.visitimefun();
  714. },
  715. visitimefun(){
  716. const that=this;
  717. utils.$post({
  718. url: app.globalData.webUrl + 'client/index/visit_due_time',
  719. header: {
  720. 'Authorization':'bearer '+app.globalData.token
  721. },
  722. data:{
  723. id:that.data.mineinfo.employee_id,
  724. pipe_type:'card',
  725. time:time,
  726. },
  727. success: function (res) {
  728. }
  729. })
  730. },
  731. /**
  732. * 生命周期函数--监听页面卸载
  733. */
  734. onUnload: function () {
  735. this.visitimefun();
  736. },
  737. /**
  738. * 页面相关事件处理函数--监听用户下拉动作
  739. */
  740. onPullDownRefresh: function () {
  741. },
  742. /**
  743. * 页面上拉触底事件的处理函数
  744. */
  745. onReachBottom: function () {
  746. const that=this;
  747. if(this.data.type==3){
  748. evpage=evpage*1+1;
  749. utils.$get({
  750. url: app.globalData.webUrl + 'client/evidencelist',
  751. header: {
  752. 'Authorization':'bearer '+app.globalData.token
  753. },
  754. data:{
  755. page:evpage,
  756. cate:that.data.catetype,
  757. },
  758. success: function (res) {
  759. if(res.data.code=='0'){
  760. let evidencelist=that.data.evidencelist;
  761. var arrflag=false
  762. if(evidencelist.length!=0){
  763. arrflag=true;
  764. }
  765. for(let i=0;i<res.data.data.length;i++){
  766. evidencelist.push(res.data.data[i])
  767. }
  768. that.setData({
  769. evidencelist:evidencelist
  770. })
  771. if(!arrflag){
  772. that.imgload();
  773. }
  774. }
  775. }
  776. })
  777. }else if(this.data.type==2){
  778. casepage = casepage * 1 + 1;
  779. utils.$get({
  780. url: app.globalData.webUrl + 'client/caselist',
  781. header: {
  782. 'Authorization': 'bearer ' + app.globalData.token
  783. },
  784. data: {
  785. page: casepage,
  786. commu_id: that.data.nowcommunity, // 小区id
  787. style_id: that.data.nowstyle, //风格id
  788. square_start: that.data.square_start, //面积开始值
  789. square_end: that.data.square_end, //面积结束值
  790. keyword: that.data.keyword,
  791. housetype_id: that.data.nowhousetype,
  792. case_type:this.data.noweffect,
  793. },
  794. success: function (res) {
  795. let caselist = that.data.caselist;
  796. if (res.data.code == '0') {
  797. caselist = caselist.concat(res.data.data);
  798. that.setData({
  799. caselist: caselist
  800. })
  801. }
  802. setTimeout(function () {
  803. wx.hideLoading()
  804. }, 1000)
  805. }
  806. })
  807. }
  808. },
  809. addsharetap: function (type) {
  810. let that = this;
  811. utils.$post({
  812. url: app.globalData.webUrl + 'api/share/addlog',
  813. header: {
  814. 'Authorization': 'bearer ' + app.globalData.token
  815. },
  816. data: {
  817. id: '0',
  818. type: type,
  819. },
  820. success: function (r) {}
  821. })
  822. },
  823. /**
  824. * 用户点击右上角分享
  825. */
  826. onShareAppMessage: function () {
  827. var that=this;
  828. that.addsharetap('card');
  829. wx.showShareMenu({
  830. withShareTicket: true,
  831. menus: ['shareAppMessage', 'shareTimeline']
  832. })
  833. return {
  834. title: this.data.mineinfo.name+"的个人名片",
  835. imageUrl:app.globalData.imgUrl+"/xcx/sharenamecard.png",
  836. path: '/share/pages/shareCard/shareCard?uid='+app.globalData.shareuserid+'&empid='+app.globalData.sharempid+'&ctp='+app.globalData.clientype,
  837. };
  838. },
  839. onShareTimeline: function () {
  840. var that = this;
  841. that.addsharetap('card');
  842. app.globalData.shareuserid = app.globalData.personMsg.id;
  843. return {
  844. title: this.data.mineinfo.name + "的个人名片",
  845. query:'uid=' + app.globalData.shareuserid + '&empid=' + app.globalData.personMsg.binded.id + '&ctp=' + app.globalData.clientype+'&type=share',
  846. imageUrl: app.globalData.imgUrl + "/xcx/sharenamecard.png",
  847. }
  848. }
  849. })