broker.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908
  1. // customer/pages/broker/broker.js
  2. var App = getApp();
  3. var utils = require("../../../utils/http");
  4. var nowtimestamp = 0, stoptime = 0;
  5. let loginnum = 1;
  6. let page = 1;
  7. Page({
  8. data: {
  9. agentName: App.globalData.agentName,
  10. top: App.globalData.statusBarHeight,
  11. hgt: App.globalData.titleBarHeight,
  12. imgUrl: App.globalData.imgUrl,
  13. personobj: App.globalData.personMsg,
  14. signflag: false,
  15. instructionsflag: false,
  16. num: 0,
  17. unlogin: false,
  18. clientTotal: {},
  19. intregralTotal: {},
  20. userflag: true,//true是有个人信息,false没有个人信息,
  21. permiss: true,
  22. unfutureflag: false,
  23. companyname: App.globalData.companyname,
  24. sourceShow: true,
  25. stateShow: false,
  26. datashow: false,
  27. rType: '1',
  28. rid: "",
  29. date: '',
  30. keyword: '',
  31. clientType: '',
  32. clientState: '',
  33. clueStateText: "",
  34. clueStateId: "",
  35. clueMobileText: "",
  36. clueMobileId: "",
  37. getDate: "",
  38. maxDate: new Date(),
  39. curType: '全部客户',
  40. showCompany: false,
  41. hiddenSearch: true,
  42. showClueState: false,
  43. showClueMobile: false,
  44. showClueRecord: false,
  45. shareArticleNew: false,
  46. clueRecordlist: [],
  47. shareArticledlist: [],
  48. shareCluelist: [],
  49. brokerClientlist: [],
  50. companylist: [],
  51. stateArr: [{
  52. id: '',
  53. text: '全部',
  54. show: 1
  55. },
  56. {
  57. id: 1,
  58. text: "待确认",
  59. show: 1,
  60. },
  61. {
  62. id: 10,
  63. text: "有效",
  64. show: 1,
  65. },
  66. {
  67. id: 2,
  68. text: "已到店",
  69. show: 1,
  70. },
  71. {
  72. id: 3,
  73. text: "已量房",
  74. show: 1,
  75. },
  76. {
  77. id: 4,
  78. text: "已到场",
  79. show: 1,
  80. },
  81. {
  82. id: 5,
  83. text: "已签单",
  84. show: 1,
  85. },
  86. {
  87. id: 6,
  88. text: "已转单",
  89. show: 1,
  90. }
  91. ],
  92. statusArr: [{
  93. text: "全部",
  94. id: ""
  95. },{
  96. text: "未报备",
  97. id: "0"
  98. },{
  99. text: "已报备",
  100. id: "1"
  101. },{
  102. text: "无效",
  103. id: "2"
  104. }],
  105. mobilelist: [{
  106. text: "全部",
  107. id: ""
  108. },{
  109. text: "有手机号",
  110. id: "has"
  111. },{
  112. text: "无手机号",
  113. id: "hasno"
  114. }],
  115. },
  116. onLoad: function () {
  117. page = 1;
  118. var that = this;
  119. wx.showLoading({
  120. title: '加载中......',
  121. })
  122. that.setData({
  123. top: App.globalData.statusBarHeight,
  124. hgt: App.globalData.titleBarHeight,
  125. companyname: App.globalData.companyname,
  126. clientType: App.globalData.clientype
  127. })
  128. that.setData({
  129. personobj: App.globalData.personMsg,
  130. })
  131. this.intregral_total();
  132. this.getBrokerClient();
  133. this.getCompanylist();
  134. },
  135. onReady: function () {
  136. },
  137. switchTab: function (e) {
  138. page = 1;
  139. let type = e.currentTarget.dataset.type;
  140. this.setData({
  141. rType: type
  142. })
  143. wx.showLoading({
  144. title: '加载中...',
  145. })
  146. if (type == 1) {
  147. this.getBrokerClient();
  148. } else if (type == 2) {
  149. this.getShareCluelist();
  150. } else {
  151. this.getShareArticledlist();
  152. }
  153. },
  154. jumpMinePage: function () {
  155. wx.reLaunch({
  156. url: '/customer/pages/brokerindex/brokerindex',
  157. })
  158. },
  159. jumpSharePage: function () {
  160. wx.reLaunch({
  161. url: '/customer/pages/brokershare/brokershare',
  162. })
  163. },
  164. jumpRankPage: function () {
  165. wx.reLaunch({
  166. url: '/customer/pages/brokerindex/brokerindex?type=rank',
  167. })
  168. },
  169. jumpscreenshot: function() {
  170. wx.reLaunch({
  171. url: '/customer/pages/screenshot/screenshot',
  172. })
  173. },
  174. exchangeFunc: function() {
  175. wx.navigateTo({
  176. url: '/pages/other/other?type=6709',
  177. })
  178. },
  179. jumpShareInfo: function (e) {
  180. let type = e.currentTarget.dataset.type;
  181. let content_id = e.currentTarget.dataset.contentid;
  182. switch (type) {
  183. case "AgentArticle":
  184. wx.navigateTo({
  185. url: '/customer/pages/brokershareinfo/brokershareinfo?id=' + content_id,
  186. })
  187. break;
  188. case "MaterialEvidence":
  189. wx.navigateTo({
  190. url: '/index/pages/publicpraisemsg/publicpraisemsg?eid=' + content_id + '&ty=b',
  191. })
  192. break;
  193. case "CompanyStrength":
  194. wx.navigateTo({
  195. url: '/index/pages/companystrengthmsg/companystrengthmsg?eid=' + content_id + '&ty=b',
  196. })
  197. break;
  198. case "Video":
  199. wx.navigateTo({
  200. url: '/index/pages/videoshare/videoshare?vid=' + content_id + '&ty=b',
  201. })
  202. break;
  203. case "Building":
  204. wx.navigateTo({
  205. url: '/index/pages/progressdetail/progressdetail?cid=' + content_id + '&ty=b',
  206. })
  207. break;
  208. case "MaterialCase":
  209. wx.navigateTo({
  210. url: '/index/pages/casemsg/casemsg?cid=' + content_id + '&ty=b',
  211. })
  212. break;
  213. case "Article":
  214. wx.navigateTo({
  215. url: '/index/pages/articleshare/articleshare?aid=' + content_id + '&ty=b',
  216. })
  217. break;
  218. }
  219. },
  220. handleCopyText(e) {
  221. let data = e.currentTarget.dataset.text;
  222. wx.setClipboardData({
  223. data: data,
  224. success: function (res) { }
  225. })
  226. },
  227. bindDateChange(e) {
  228. page = 1;
  229. this.setData({
  230. date: e.detail.value
  231. })
  232. this.getBrokerClient();
  233. },
  234. bindClueDateChange(e) {
  235. page = 1;
  236. this.setData({
  237. getDate: e.detail.value
  238. })
  239. this.getShareCluelist()
  240. },
  241. bingStateChange(e) {
  242. this.setData({
  243. stateShow: !this.data.stateShow
  244. })
  245. },
  246. handleShowClueState(e) {
  247. this.setData({
  248. showClueState: !this.data.showClueState
  249. })
  250. },
  251. getStateChange(e) {
  252. page = 1;
  253. let text = e.currentTarget.dataset.text;
  254. this.setData({
  255. clientState: text == '全部' ? "" : text,
  256. stateShow: false
  257. })
  258. this.getBrokerClient();
  259. },
  260. getStatusChange(e) {
  261. page = 1;
  262. let data = e.currentTarget.dataset;
  263. this.setData({
  264. clueStateId: data.id,
  265. clueStateText: data.text,
  266. showClueState: false
  267. })
  268. this.getShareCluelist();
  269. },
  270. getMobileChange(e) {
  271. page = 1;
  272. let data = e.currentTarget.dataset;
  273. this.setData({
  274. clueMobileText: data.text,
  275. clueMobileId: data.id,
  276. showClueMobile: false,
  277. });
  278. this.getShareCluelist();
  279. },
  280. handleShowClueMobile(e) {
  281. this.setData({
  282. showClueMobile: !this.data.showClueMobile
  283. })
  284. },
  285. handleSearchAll() {
  286. page = 1;
  287. this.setData({
  288. clientState: "",
  289. date: "",
  290. clueStateId: "",
  291. clueStateText: "",
  292. getDate: "",
  293. clueMobileId: "",
  294. clueMobileText: ""
  295. })
  296. if (this.data.rType == 1) {
  297. this.getBrokerClient();
  298. } else if (this.data.rType == 2) {
  299. this.getShareCluelist();
  300. } else {
  301. this.getShareArticledlist();
  302. }
  303. },
  304. viewIntegral() {
  305. wx.navigateTo({
  306. url: '/pages/other/other?type=2277',
  307. })
  308. },
  309. goidxtap: function () {
  310. wx.navigateTo({
  311. url: '/index/pages/activity/activity?type=broker',
  312. })
  313. },
  314. closetap: function () {
  315. this.setData({
  316. unfutureflag: false
  317. })
  318. },
  319. setap: function () {
  320. wx.navigateTo({
  321. url: '/mycustomer/pages/set/set'
  322. })
  323. },
  324. viewFootRecord(e) {
  325. let rid = e.currentTarget.dataset.id;
  326. this.setData({
  327. rid: rid
  328. })
  329. this.getShareClueRecord();
  330. },
  331. switchCompany() {
  332. this.setData({
  333. showCompany: true
  334. })
  335. },
  336. switchCompanyType(e) {
  337. wx.showLoading({
  338. title: '切换中...',
  339. })
  340. let company = e.currentTarget.dataset.company;
  341. App.globalData.clientype = company;
  342. this.setData({
  343. showCompany: false,
  344. clientType: company
  345. })
  346. setTimeout(() => {
  347. wx.hideLoading();
  348. wx.reLaunch({
  349. url: '/pages/index/index',
  350. })
  351. }, 1000)
  352. },
  353. closeDialog() {
  354. this.setData({
  355. stateShow: false,
  356. showCompany: false,
  357. showClueState: false,
  358. showClueMobile: false,
  359. showClueRecord: false
  360. })
  361. },
  362. onChange(e) {
  363. this.setData({
  364. keyword: e.detail.value
  365. })
  366. },
  367. onSearch() {
  368. page = 1;
  369. this.getBrokerClient();
  370. },
  371. showSearchIpt() {
  372. let showState = !this.data.hiddenSearch;
  373. this.setData({
  374. hiddenSearch: showState
  375. })
  376. },
  377. arrfun: function (str) {
  378. var that = this;
  379. let arr = str.split(',');
  380. return arr;
  381. },
  382. logintap: function () {
  383. this.loginbox = this.selectComponent("#loginbox");
  384. this.loginbox.loginfun();
  385. },
  386. /**
  387. * 获取公司列表
  388. */
  389. getCompanylist() {
  390. let that = this;
  391. utils.$post({
  392. url: App.globalData.webUrl + 'api/agents_work/company',
  393. header: {
  394. 'Authorization': 'bearer ' + App.globalData.token
  395. },
  396. data: {},
  397. success: function (res) {
  398. if (res.data.code == '0') {
  399. that.setData({
  400. companylist: res.data.data
  401. })
  402. }
  403. }
  404. })
  405. },
  406. getNewShareArticleNum() {
  407. let that = this;
  408. utils.$post({
  409. url: App.globalData.webUrl + 'api/agentsWork/newShareArticle',
  410. header: {
  411. 'Authorization': 'bearer ' + App.globalData.token
  412. },
  413. data: {},
  414. success: function (res) {
  415. if (res.data.code == '0') {
  416. that.setData({
  417. shareArticleNew: res.data.new
  418. })
  419. }
  420. }
  421. })
  422. },
  423. /**
  424. * 获取线索列表接口
  425. */
  426. getShareCluelist() {
  427. let that = this;
  428. that.setData({
  429. datashow: false
  430. })
  431. utils.$post({
  432. url: App.globalData.webUrl + 'api/agentsWork/clue_list',
  433. header: {
  434. 'Authorization': 'bearer ' + App.globalData.token
  435. },
  436. data: {
  437. page: page,
  438. limit: 10,
  439. getDate: that.data.getDate,
  440. state: that.data.clueStateId,
  441. phone: that.data.clueMobileId
  442. },
  443. success: function (res) {
  444. wx.hideLoading();
  445. if (res.data.code == '0') {
  446. that.setData({
  447. shareCluelist: res.data.data.data.map(v => {
  448. if (v.phone) {
  449. v.phonestr = v.phone.substring(0, 3) + "****" + v.phone.substr(v.phone.length-4);
  450. }
  451. return v;
  452. }),
  453. datashow: true
  454. })
  455. }
  456. }
  457. })
  458. },
  459. /**
  460. * 获取线索足迹
  461. */
  462. getShareClueRecord() {
  463. let that = this;
  464. utils.$post({
  465. url: App.globalData.webUrl + 'api/agentsWork/footprints',
  466. header: {
  467. 'Authorization': 'bearer ' + App.globalData.token
  468. },
  469. data: {
  470. id: that.data.rid,
  471. },
  472. success: function (res) {
  473. if (res.data.code == '0') {
  474. that.setData({
  475. showClueRecord: true,
  476. clueRecordlist: res.data.data
  477. })
  478. }
  479. }
  480. })
  481. },
  482. /**
  483. * 获取分享内容列表
  484. */
  485. getShareArticledlist() {
  486. let that = this;
  487. that.setData({
  488. datashow: false
  489. })
  490. utils.$post({
  491. url: App.globalData.webUrl + 'api/agentsWork/share_article',
  492. header: {
  493. 'Authorization': 'bearer ' + App.globalData.token
  494. },
  495. data: {
  496. from: 'shareLog',
  497. page: page,
  498. limit: 10
  499. },
  500. success: function (res) {
  501. wx.hideLoading();
  502. if (res.data.code == '0') {
  503. res.data.data.list = res.data.data.list.map(v => {
  504. if (v.type == 'CompanyStrength' || v.type == 'MaterialEvidence') {
  505. if (v.difference == 1 && v.type == 'MaterialEvidence') {
  506. v.cover = Array.isArray(v.cover)&&v.cover.length?v.cover[0]+'?x-oss-process=video/snapshot,t_100,f_jpg,w_375,m_fast':v.cover
  507. } else {
  508. v.cover = Array.isArray(v.cover)&&v.cover.length?v.cover[0]:v.cover
  509. }
  510. return v;
  511. } else {
  512. return v;
  513. }
  514. })
  515. that.setData({
  516. shareArticledlist: res.data.data.list,
  517. datashow: true
  518. })
  519. }
  520. }
  521. })
  522. },
  523. /**
  524. * 装修推荐官客户列表
  525. */
  526. getBrokerClient() {
  527. let that = this;
  528. utils.$post({
  529. url: App.globalData.webUrl + 'api/agents_work/customer_list',
  530. header: {
  531. 'Authorization': 'bearer ' + App.globalData.token
  532. },
  533. data: {
  534. page: page,
  535. limit: 10,
  536. state: that.data.clientState == '已签单' ? '已交定' : that.data.clientState == '已转单'?'已签单': that.data.clientState,
  537. keyword: that.data.keyword,
  538. addtime: that.data.date
  539. },
  540. success: function (res) {
  541. wx.hideLoading();
  542. if (res.data.code == '0') {
  543. that.setData({
  544. datashow: true,
  545. brokerClientlist: res.data.data.list
  546. })
  547. that.clientStatistics();
  548. }
  549. }
  550. })
  551. },
  552. /**
  553. * 客户数据统计
  554. */
  555. clientStatistics: function (text) {
  556. var that = this;
  557. wx.hideLoading()
  558. utils.$post({
  559. url: App.globalData.webUrl + 'api/agents_work/agt_crm_count',
  560. header: {
  561. 'Authorization': 'bearer ' + App.globalData.token
  562. },
  563. data: {},
  564. success: function (res) {
  565. if (res.data.code == '0') {
  566. that.setData({
  567. clientTotal: res.data.data
  568. })
  569. }
  570. }
  571. })
  572. },
  573. /**
  574. * 我的积分数据
  575. */
  576. intregral_total: function (text) {
  577. var that = this;
  578. wx.hideLoading()
  579. utils.$post({
  580. url: App.globalData.webUrl + 'api/agents_work/intregral_total',
  581. header: {
  582. 'Authorization': 'bearer ' + App.globalData.token
  583. },
  584. data: {},
  585. success: function (res) {
  586. if (res.data.code == '0') {
  587. that.setData({
  588. intregralTotal: res.data.data
  589. })
  590. }
  591. }
  592. })
  593. },
  594. dothis() {},
  595. managemenTap: function () {
  596. this.setData({
  597. unfutureflag: true
  598. })
  599. },
  600. ranktap: function () {
  601. var that = this;
  602. this.$route('/mycustomer/pages/rankbox/rankbox')
  603. },
  604. informTap: function (e) {
  605. var that = this;
  606. wx.navigateTo({
  607. url: '/mycustomer/pages/information/information',
  608. })
  609. },
  610. onShow: function (e) {
  611. var that = this;
  612. loginnum = loginnum + 1;
  613. that.setData({
  614. top: App.globalData.statusBarHeight,
  615. hgt: App.globalData.titleBarHeight,
  616. companyname: App.globalData.companyname
  617. })
  618. that.setData({
  619. tokenflag: App.globalData.tokenflag,
  620. })
  621. this.setData({
  622. personMsg: App.globalData.personMsg
  623. })
  624. },
  625. onAwake: function (t) {
  626. // console.log('[pages/index] 程序被唤醒:', t)
  627. },
  628. /**
  629. * 置顶客户
  630. */
  631. handleTopping: function (e) {
  632. let that = this;
  633. let cid = e.currentTarget.dataset.cid;
  634. utils.$post({
  635. url: App.globalData.webUrl + 'api/agents_work/set_top',
  636. header: {
  637. 'Authorization': 'bearer ' + App.globalData.token
  638. },
  639. data: {
  640. customer_id: cid
  641. },
  642. success: function (res) {
  643. if (res.data.code == '0') {
  644. page = 1;
  645. that.getBrokerClient();
  646. }
  647. }
  648. })
  649. },
  650. backTap: function () {
  651. wx.navigateBack();
  652. },
  653. /**
  654. * 生命周期函数--监听页面隐藏
  655. */
  656. onHide: function () {
  657. var timearr = App.globalData.timearr, flag = false;
  658. for (var i = 0; i < timearr.length; i++) {
  659. if (timearr[i].type == 'index') {
  660. timearr[i].time = timearr[i].time * 1 + stoptime * 1;
  661. flag = true;
  662. }
  663. }
  664. if (!flag) {
  665. var obj = {
  666. type: 'index',
  667. time: stoptime
  668. };
  669. App.globalData.timearr.push(obj);
  670. } else {
  671. App.globalData.timearr = timearr;
  672. }
  673. },
  674. /**
  675. * 生命周期函数--监听页面卸载
  676. */
  677. onUnload: function () {
  678. },
  679. /**
  680. * 页面相关事件处理函数--监听用户下拉动作
  681. */
  682. onPullDownRefresh: function () {
  683. var that = this;
  684. setTimeout(function () {
  685. wx.stopPullDownRefresh();
  686. }, 500)
  687. wx.showLoading({
  688. title: '加载中...',
  689. })
  690. page = 1;
  691. if (that.data.rType == 1) {
  692. utils.$post({
  693. url: App.globalData.webUrl + 'api/agents_work/customer_list',
  694. header: {
  695. 'Authorization': 'bearer ' + App.globalData.token
  696. },
  697. data: {
  698. page: page,
  699. limit: 10,
  700. state: that.data.clientState == '已签单' ? '已交定' : that.data.clientState == '已转单'?'已签单': that.data.clientState,
  701. keyword: that.data.keyword
  702. },
  703. success: function (res) {
  704. wx.hideLoading();
  705. if (res.data.code == '0') {
  706. that.setData({
  707. brokerClientlist: res.data.data.list
  708. })
  709. that.clientStatistics();
  710. } else {
  711. wx.showToast({
  712. title: res.data.msg,
  713. icon: "none",
  714. duration: 1500
  715. })
  716. }
  717. }
  718. })
  719. } else if (that.data.rType == 2) {
  720. utils.$post({
  721. url: App.globalData.webUrl + 'api/agentsWork/clue_list',
  722. header: {
  723. 'Authorization': 'bearer ' + App.globalData.token
  724. },
  725. data: {
  726. page: page,
  727. limit: 10
  728. },
  729. success: function (res) {
  730. wx.hideLoading();
  731. if (res.data.code == '0') {
  732. that.setData({
  733. shareCluelist: res.data.data.data.map(v => {
  734. if (v.phone) {
  735. v.phonestr = v.phone.substring(0, 3) + "****" + v.phone.substr(v.phone.length-4);
  736. }
  737. return v;
  738. })
  739. })
  740. } else {
  741. wx.showToast({
  742. title: res.data.msg,
  743. icon: "none",
  744. duration: 1500
  745. })
  746. }
  747. }
  748. })
  749. } else {
  750. utils.$post({
  751. url: App.globalData.webUrl + 'api/agentsWork/share_article',
  752. header: {
  753. 'Authorization': 'bearer ' + App.globalData.token
  754. },
  755. data: {
  756. from: 'shareLog',
  757. page: page,
  758. limit: 10
  759. },
  760. success: function (res) {
  761. wx.hideLoading();
  762. if (res.data.code == '0') {
  763. res.data.data.list = res.data.data.list.map(v => {
  764. if (v.type == 'CompanyStrength' || v.type == 'MaterialEvidence') {
  765. if (v.difference == 1 && v.type == 'MaterialEvidence') {
  766. v.cover = Array.isArray(v.cover)&&v.cover.length?v.cover[0]+'?x-oss-process=video/snapshot,t_100,f_jpg,w_375,m_fast':v.cover
  767. } else {
  768. v.cover = Array.isArray(v.cover)&&v.cover.length?v.cover[0]:v.cover
  769. }
  770. return v;
  771. } else {
  772. return v;
  773. }
  774. })
  775. that.setData({
  776. shareArticledlist: res.data.data.list
  777. })
  778. } else {
  779. wx.showToast({
  780. title: res.data.msg,
  781. icon: "none",
  782. duration: 1500
  783. })
  784. }
  785. }
  786. })
  787. }
  788. },
  789. /**
  790. * 页面上拉触底事件的处理函数
  791. */
  792. onReachBottom: function () {
  793. page = page + 1;
  794. var that = this;
  795. wx.showLoading({
  796. title: '加载中...',
  797. })
  798. if (that.data.rType == 1) {
  799. utils.$post({
  800. url: App.globalData.webUrl + 'api/agents_work/customer_list',
  801. header: {
  802. 'Authorization': 'bearer ' + App.globalData.token
  803. },
  804. data: {
  805. page: page,
  806. limit: 10,
  807. state: that.data.clientState == '已签单' ? '已交定' : that.data.clientState == '已转单'?'已签单': that.data.clientState,
  808. keyword: that.data.keyword
  809. },
  810. success: function (res) {
  811. wx.hideLoading();
  812. if (res.data.code == '0') {
  813. let list = that.data.brokerClientlist.concat(res.data.data.list);
  814. that.setData({
  815. brokerClientlist: list
  816. })
  817. } else {
  818. wx.showToast({
  819. title: res.data.msg,
  820. icon: "none",
  821. duration: 1500
  822. })
  823. }
  824. }
  825. })
  826. } else if (that.data.rType == 2) {
  827. utils.$post({
  828. url: App.globalData.webUrl + 'api/agentsWork/clue_list',
  829. header: {
  830. 'Authorization': 'bearer ' + App.globalData.token
  831. },
  832. data: {
  833. page: page,
  834. limit: 10
  835. },
  836. success: function (res) {
  837. wx.hideLoading();
  838. if (res.data.code == '0') {
  839. let arrData = res.data.data.data.map(v => {
  840. if (v.phone) {
  841. v.phonestr = v.phone.substring(0, 3) + "****" + v.phone.substr(v.phone.length-4);
  842. }
  843. return v;
  844. })
  845. let list = that.data.shareCluelist.concat(arrData);
  846. that.setData({
  847. shareCluelist: list
  848. })
  849. } else {
  850. wx.showToast({
  851. title: res.data.msg,
  852. icon: "none",
  853. duration: 1500
  854. })
  855. }
  856. }
  857. })
  858. } else {
  859. utils.$post({
  860. url: App.globalData.webUrl + 'api/agentsWork/share_article',
  861. header: {
  862. 'Authorization': 'bearer ' + App.globalData.token
  863. },
  864. data: {
  865. from: 'shareLog',
  866. page: page,
  867. limit: 10
  868. },
  869. success: function (res) {
  870. wx.hideLoading();
  871. if (res.data.code == '0') {
  872. res.data.data.list = res.data.data.list.map(v => {
  873. if (v.type == 'CompanyStrength' || v.type == 'MaterialEvidence') {
  874. if (v.difference == 1 && v.type == 'MaterialEvidence') {
  875. v.cover = Array.isArray(v.cover)&&v.cover.length?v.cover[0]+'?x-oss-process=video/snapshot,t_100,f_jpg,w_375,m_fast':v.cover
  876. } else {
  877. v.cover = Array.isArray(v.cover)&&v.cover.length?v.cover[0]:v.cover
  878. }
  879. return v;
  880. } else {
  881. return v;
  882. }
  883. })
  884. let list = that.data.shareArticledlist.concat(res.data.data.list);
  885. that.setData({
  886. shareArticledlist: list
  887. })
  888. } else {
  889. wx.showToast({
  890. title: res.data.msg,
  891. icon: "none",
  892. duration: 1500
  893. })
  894. }
  895. }
  896. })
  897. }
  898. }
  899. })