purchase-s-details.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752
  1. var sysT = require('../../../../tool/sys-tool.js')
  2. var businessT = require('../../../../tool/business-tool.js')
  3. var purchaseO = require('../../public/model/purchaseOrder.js')
  4. var p = require('../../public/model/public.js')
  5. var publicData = require('../../../../constant/data.js')
  6. var url = require('../../../../constant/url.js')
  7. import Net from '../../../../tool/net.js'
  8. var net = new Net()
  9. var businessType = require('../../../../public/business-type.js')
  10. var purchaseData = require('../../public/model/purchase-details.js')
  11. var key = require('../../../../constant/key.js')
  12. var app = getApp()
  13. import PurchaseOrder from '../../public/model/purchaseOrder.js'
  14. var login = require('../../../../public/login.js')
  15. Page({
  16. /**
  17. * 页面的初始数据
  18. */
  19. data: {
  20. isFirstLoad: true,
  21. ui: {
  22. tips: {
  23. explain: [],
  24. choose: [],
  25. process: 'process_s',
  26. question: {},
  27. tips: []
  28. }
  29. },
  30. data: {
  31. },
  32. choseCity: {},
  33. adapter: {
  34. suffix: '',
  35. isSupplementaryPay: false,
  36. leftButton: '一键续保',
  37. rightButton: '立即参保',
  38. city: {
  39. t: '参保城市',
  40. c: '',
  41. d: [],
  42. v: [0, 0],
  43. des: ''
  44. },
  45. charge: 0,
  46. count: 10000,
  47. //客服需要的
  48. isLogin: false,
  49. userInfo: {
  50. avatarUrl: ''
  51. },
  52. params: {
  53. }
  54. },
  55. project: {
  56. l: true,//是否有下横线
  57. s: false,//是否展示
  58. t: '参保方案',
  59. c: '',
  60. v: []
  61. },
  62. account: {
  63. l: true,
  64. t: '户籍性质',
  65. c: '本地城镇'
  66. },
  67. tips: {
  68. s: false,
  69. t: []
  70. },
  71. accounts: null,
  72. accountsAnimation: {},
  73. totals:[],
  74. list:[],
  75. choseAccount: 0,
  76. showContact: false,
  77. showContactHeight: -68,
  78. scroll: true,
  79. // confirmView: {
  80. // animation: {},
  81. // hidden: true,
  82. // height: '800rpx',
  83. // bottom: '0rpx',
  84. // suffix: ''
  85. // },
  86. scrollView: {
  87. top: 0
  88. },
  89. positionHeight: [0, 0, 0, 0, 0],
  90. chooseHidden: true,
  91. chooseing: false//是否点击选择购买流程等
  92. },
  93. // hiddenConfirmView: function () {
  94. // var animation = wx.createAnimation({
  95. // duration: 300,
  96. // timingFunction: 'ease',
  97. // })
  98. // animation.bottom('-' + this.data.confirmView.height).step()
  99. // this.data.confirmView.animation = animation.export()
  100. // this.data.confirmView.hidden = false
  101. // this.setData({
  102. // confirmView: this.data.confirmView
  103. // })
  104. // setTimeout(function () {
  105. // this.data.confirmView.hidden = true
  106. // this.setData({
  107. // confirmView: this.data.confirmView,
  108. // scroll: true
  109. // })
  110. // }.bind(this), 300)
  111. // },
  112. // dismissConfirmView: businessT.action(function () {
  113. // this.hiddenConfirmView()
  114. // }),
  115. // showConfirmView: function (sender) {
  116. // if (!this.data.confirmView.hidden) {
  117. // return
  118. // }
  119. // var order = p.getOrder()
  120. // this.data.confirmView.hidden = false
  121. // this.data.confirmView.tips = {s: !order.isSupplementaryPay, t: [this.data.adapter.city.des] }
  122. // this.data.confirmView.city = this.data.adapter.city
  123. // this.data.confirmView.project = this.data.project
  124. // this.data.confirmView.account = this.data.account
  125. // this.setData({
  126. // confirmView: this.data.confirmView,
  127. // scroll: false
  128. // })
  129. // var animation = wx.createAnimation({
  130. // duration: 300,
  131. // timingFunction: 'ease',
  132. // })
  133. // animation.bottom('0rpx').step()
  134. // this.data.confirmView.animation = animation.export()
  135. // this.data.confirmView.hidden = false
  136. // setTimeout(function () {
  137. // this.setData({
  138. // confirmView: this.data.confirmView
  139. // })
  140. // }.bind(this), 300)
  141. // },
  142. hiddenContactListener: function (e) {
  143. this.setData({
  144. scroll: true
  145. })
  146. },
  147. toCalculator: function (sender) {
  148. var cha = sysT.sysInfo().system.indexOf("iOS") == 0 ? 'iOS' : 'Android'
  149. var order = p.getOrder()
  150. businessT.debugLog(app.purchase.purchaseData)
  151. wx.navigateTo({
  152. url: '../../../../public/pages/html/html?host=https://www.wodeshebao.com/calc/app_index.html&f=' + cha + '&c=' + app.purchase.purchaseData.city_code + '&cid=' + app.purchase.purchaseData.id + '&hk=' + order.accountType,
  153. })
  154. },
  155. yearPay: function (sender) {
  156. wx.showToast({
  157. title: '凡带年缴标识的首月一次性收取一年费用\n年费会因缴费首月不同稍有不同',
  158. icon: 'none'
  159. })
  160. },
  161. judgeIsLogin: function () {
  162. if (app.loginStatus.key == "") {
  163. wx.navigateTo({
  164. url: '../../../login/index',
  165. })
  166. return false
  167. }
  168. return true
  169. },
  170. contactAction: function (sender) {
  171. if (!this.judgeIsLogin()) {
  172. return
  173. }
  174. // wx.navigateTo({
  175. // url: '../../../../public/pages/html/html?host=https://kf.shanp.com/user.html&channel=h5XCX&phone=' + app.globalData.userInfo.phone + '&uid=' + app.globalData.userInfo.uid + '&t=' + new Date().getTime(),
  176. // })
  177. },
  178. phoneAction: function (sender) {
  179. this.setData({
  180. showContact: true,
  181. scroll: false
  182. })
  183. },
  184. supplementaryPay: function (sender) {
  185. if (!this.judgeIsLogin()) {
  186. return
  187. }
  188. var purchase = app.purchase.purchaseData
  189. if (purchase.addeds_num == 0) {
  190. wx.showToast({
  191. title: '该城市不支持补缴社保',
  192. icon: 'none'
  193. })
  194. return
  195. }
  196. this.toCustomer()
  197. },
  198. quickPurchase: function (sender) {
  199. if (!this.judgeIsLogin()) {
  200. return
  201. }
  202. if (app.globalData.customerList.length == 0) {
  203. wx.showToast({
  204. title: '你还没有参保记录,请选择“立即参保”',
  205. icon: 'none'
  206. })
  207. return
  208. }
  209. wx.navigateTo({
  210. url: '../../../../public/pages/customer-view/customer-view?type=qPurchase&businessType=s',
  211. })
  212. },
  213. purchase: businessT.action(function (sender) {
  214. if (!this.judgeIsLogin()) {
  215. return
  216. }
  217. this.toCustomer()
  218. }),
  219. // confirmAction: businessT.action(function (sender) {
  220. // this.hiddenConfirmView()
  221. // setTimeout(function () {
  222. // this.toCustomer()
  223. // }.bind(this), 500)
  224. // }),
  225. toCustomer: function () {
  226. if (app.globalData.customerList.length > 0) {
  227. wx.navigateTo({
  228. url: '../../../../public/pages/customer-view/customer-view?type=nPurchase',
  229. })
  230. return
  231. }
  232. wx.navigateTo({
  233. url: '../new-customer/new-customer',
  234. })
  235. },
  236. chooseProject: function (sender) {
  237. app.purchase.purchaseData = app.purchase.purchaseDataArray[sender.detail.value]
  238. this.handleData()
  239. },
  240. chooseCity: function (sender) {
  241. //防止第一列还在滑动就确定,再次展示会错位
  242. this.data.adapter.city.d[1] = publicData.purchaseCity[(publicData.purchaseCity.p)[sender.detail.value[0]].id]
  243. this.data.adapter.city.v = sender.detail.value
  244. var pr = publicData.purchaseCity.p[sender.detail.value[0]].id
  245. var c = publicData.purchaseCity[pr][sender.detail.value[1]]
  246. if (!c) {
  247. c = publicData.purchaseCity[pr][0]
  248. this.data.adapter.city.v[1] = 0
  249. }
  250. this.data.choseCity = c
  251. this.setData({
  252. adapter: this.data.adapter
  253. })
  254. this.getData(c.id)
  255. },
  256. chooseCityColumn: function (sender) {
  257. if (sender.detail.column == 0) {
  258. this.data.adapter.city.d[1] = publicData.purchaseCity[(publicData.purchaseCity.p)[sender.detail.value].id]
  259. this.data.adapter.city.v = [sender.detail.value, 0]
  260. this.setData({
  261. adapter: this.data.adapter
  262. })
  263. }
  264. },
  265. chooseAccountP: businessT.action(function (sender) {
  266. this.changeAccount(sender.detail.value)
  267. }),
  268. chooseAccount: businessT.action(function (sender) {
  269. this.changeAccount(sender.currentTarget.id)
  270. }),
  271. changeAccount: function (index) {
  272. businessT.debugLog(index)
  273. var order = p.getOrder()
  274. order.accountType = Number(index) + 1
  275. this.data.choseAccount = index
  276. businessT.debugLog(order)
  277. this.data.account.c = this.data.accounts[index]
  278. var animation = wx.createAnimation({
  279. duration: 300,
  280. timingFunction: 'ease',
  281. })
  282. var t = 190 * sysT.rpxToPx() * index
  283. animation.translateX(t).step()
  284. this.setData({
  285. choseAccount: this.data.choseAccount,
  286. account: this.data.account,
  287. accountsAnimation: animation.export()
  288. })
  289. this.calculateHeight()
  290. },
  291. scroll: function (sender) {
  292. this.data.scrollView.top = sender.detail.scrollTop
  293. if (sender.detail.scrollTop >= this.data.positionHeight[0]) {
  294. this.data.chooseHidden = false
  295. this.setData({
  296. chooseHidden: this.data.chooseHidden
  297. })
  298. if (this.data.chooseing) {
  299. this.data.chooseing = false
  300. return
  301. }
  302. var chooseHeight = this.data.positionHeight[1] - this.data.positionHeight[0]
  303. if (sender.detail.scrollTop >= this.data.positionHeight[4] - chooseHeight) {
  304. this.changeChoose(3)
  305. } else if (sender.detail.scrollTop >= this.data.positionHeight[3] - chooseHeight) {
  306. this.changeChoose(2)
  307. } else if (sender.detail.scrollTop >= this.data.positionHeight[2] - chooseHeight) {
  308. this.changeChoose(1)
  309. } else if (sender.detail.scrollTop >= this.data.positionHeight[1] - chooseHeight) {
  310. this.changeChoose(0)
  311. }
  312. } else {
  313. this.data.chooseHidden = true
  314. this.setData({
  315. chooseHidden: this.data.chooseHidden
  316. })
  317. }
  318. },
  319. tipsChoose: businessT.action(function (sender) {
  320. businessT.debugLog(sender.currentTarget.id)
  321. var index = Number(sender.currentTarget.id)
  322. var chooseHeight = this.data.positionHeight[1] - this.data.positionHeight[0]
  323. this.data.scrollView.top = this.data.positionHeight[index + 1] - chooseHeight
  324. this.setData({
  325. scrollView: this.data.scrollView
  326. })
  327. this.data.chooseing = true
  328. this.changeChoose(index)
  329. }),
  330. changeChoose: function (index) {
  331. var animation = wx.createAnimation({
  332. duration: 300,
  333. timingFunction: 'ease',
  334. })
  335. animation.translateX(index * 190 * sysT.rpxToPx()).step()
  336. this.data.ui.tips.choose.animation = animation.export()
  337. this.data.ui.tips.choose.c = index
  338. this.setData({
  339. ui: this.data.ui
  340. })
  341. },
  342. getData: function (cityId) {
  343. wx.showLoading({
  344. title: '加载中',
  345. mask: true
  346. })
  347. var order = p.getOrder()
  348. var path = order.isSupplementaryPay ? url.getSupplementaryPurchaseData : url.getNormalPurchaseData
  349. net.connect({
  350. url: url.app_host + path,
  351. method: 'POST',
  352. data: {
  353. city_code: cityId,
  354. type: 1
  355. },
  356. success: (err, res) => {
  357. if (Object.prototype.toString.call(res.data) == '[object Array]' && res.data.length > 0) {
  358. purchaseData.handleData(res.data)
  359. this.handleData()
  360. if (order.isSupplementaryPay) {
  361. wx.setStorageSync(key.StorageKey.lastCity_s, this.data.choseCity)
  362. } else {
  363. wx.setStorageSync(key.StorageKey.lastCity_n, this.data.choseCity)
  364. }
  365. wx.hideLoading()
  366. } else {
  367. this.getDataFail()
  368. businessT.showFailTips({ code: 0, msg: '' }, '加载失败')
  369. }
  370. },
  371. fail: (err, res) => {
  372. this.getDataFail()
  373. businessT.showFailTips(err, '加载失败')
  374. }
  375. }, true)
  376. },
  377. getDataFail: function () {
  378. wx.hideLoading()
  379. var order = p.getOrder()
  380. this.data.choseCity = { name: order.cityName, id: order.city }
  381. this.data.adapter.city.c = this.data.choseCity.name
  382. this.setData({
  383. adapter: this.data.adapter
  384. })
  385. if (app.purchase.purchaseData == null) {
  386. setTimeout(function () {
  387. wx.navigateBack({
  388. })
  389. }.bind(this), 1000)
  390. }
  391. },
  392. handleData: function () {
  393. if (this.data.ui.tips.question.height[0] == 0) {
  394. businessT.debugLog('算问题')
  395. var query = wx.createSelectorQuery();
  396. for (var i in this.data.ui.tips.question.ids) {
  397. var id = this.data.ui.tips.question.ids[i]
  398. query.select('#' + id).boundingClientRect()
  399. }
  400. var that = this;
  401. query.exec(function (res) {
  402. //res就是 该元素的信息 数组
  403. businessT.debugLog(res)
  404. for (var i in res) {
  405. that.data.ui.tips.question.height[i] = res[i].height
  406. }
  407. that.setData({
  408. ui: that.data.ui
  409. })
  410. })
  411. }
  412. var order = p.getOrder()
  413. var data = app.purchase.purchaseData
  414. this.data.adapter.city.c = this.data.choseCity.name
  415. this.data.adapter.charge = order.isSupplementaryPay ? data.added_charge : data.shebao_charge
  416. this.data.adapter.city.des = '目前可购买' + data.month + '及之后月份,截止时间为' + purchaseData.getPurchaseDeadline(data.inc_date) + '月' + data.inc_date + '日'
  417. if (app.purchase.purchaseDataArray.length > 1) {
  418. this.data.project.s = true
  419. var v = []
  420. for (var i in app.purchase.purchaseDataArray) {
  421. v.push(app.purchase.purchaseDataArray[i].shebao_type)
  422. }
  423. this.data.project.v = v
  424. } else {
  425. this.data.project.s = false
  426. this.data.project.v = []
  427. }
  428. this.data.project.c = data.shebao_type
  429. if (order.isSupplementaryPay) {
  430. if (data.shebao_note == '') {
  431. this.data.tips.t = []
  432. } else {
  433. this.data.tips.t = data.shebao_note.split('\n')
  434. }
  435. } else {
  436. if (data.shebao_desc == '') {
  437. this.data.tips.t = []
  438. } else {
  439. this.data.tips.t = data.shebao_desc.split('\n')
  440. }
  441. }
  442. if (this.data.tips.t.length > 0) {
  443. this.data.tips.s = true
  444. } else {
  445. this.data.tips.s = false
  446. }
  447. if (data.shebaos && Object.prototype.toString.call(data.shebaos) == '[object Array]') {
  448. var list = []
  449. var totals = []
  450. for (var index in data.shebaos) {
  451. var d = data.shebaos[index].data
  452. var l =[]
  453. var sum = 0
  454. var yearSum = 0
  455. var isYear = false
  456. for (var _index in d) {
  457. var item = d[_index]
  458. sum += Number(item.p)
  459. if (item.s) {
  460. isYear = true
  461. } else {
  462. yearSum += Number(item.p)
  463. }
  464. l.push(item)
  465. }
  466. var charge = order.isSupplementaryPay ? data.added_charge : data.shebao_charge
  467. if (isYear) {
  468. var t = [
  469. { t: '本年首月套餐费用', c: '¥ ' + Number(sum).toFixed(2) + '/月' },
  470. { t: '非首月套餐费用', c: '¥ ' + Number(yearSum).toFixed(2) + '/月' }
  471. ]
  472. } else {
  473. var t = [
  474. { t: '套餐费用', c: '¥ ' + Number(sum).toFixed(2) + '/月' }
  475. ]
  476. }
  477. list.push(l)
  478. totals.push(t)
  479. }
  480. this.data.list = list
  481. this.data.totals = totals
  482. }
  483. purchaseData.changeShebaoDataToCustomerData()
  484. order.cityName = this.data.choseCity.name
  485. this.setData({
  486. adapter: this.data.adapter,
  487. project: this.data.project,
  488. tips: this.data.tips,
  489. list: this.data.list,
  490. totals: this.data.totals,
  491. showContactHeight: sysT.suffixOfClass() == '-X' ? 0 : -68
  492. })
  493. this.calculateHeight()
  494. },
  495. calculateHeight: function () {
  496. //purchase-details-choose
  497. var query = wx.createSelectorQuery();
  498. var that = this;
  499. //选择id
  500. query.select('#purchase-details-choose').boundingClientRect()
  501. query.select('#purchase-details-process').boundingClientRect()
  502. query.select('#purchase-details-advantage').boundingClientRect()
  503. query.select('#purchase-details-question').boundingClientRect()
  504. query.select('#purchase-details-tips').boundingClientRect()
  505. query.exec(function (res) {
  506. //res就是 该元素的信息 数组
  507. that.data.positionHeight[0] = res[0].top + that.data.scrollView.top
  508. that.data.positionHeight[1] = res[1].top + that.data.scrollView.top
  509. that.data.positionHeight[2] = res[2].top + that.data.scrollView.top
  510. that.data.positionHeight[3] = res[3].top + that.data.scrollView.top
  511. that.data.positionHeight[4] = res[4].top + that.data.scrollView.top
  512. businessT.debugLog(that.data.positionHeight)
  513. })
  514. },
  515. /**
  516. * 生命周期函数--监听页面加载
  517. */
  518. onLoad: function (options) {
  519. if (options.first) {
  520. login.autoLogin(true)
  521. }
  522. var order = p.getOrder()
  523. if (!order) {
  524. var order = new PurchaseOrder()
  525. p.setOrder(order)
  526. }
  527. if (options.isSupplementaryPay == 1) {
  528. order.isSupplementaryPay = true
  529. } else {
  530. order.isSupplementaryPay = false
  531. }
  532. order.setCity()
  533. order.purchaseType = businessType.PurchaseType.socialInsurance
  534. this.data.choseCity = {name: order.cityName, id: order.city}
  535. var title
  536. var tips
  537. if (order.isSupplementaryPay) {
  538. title = '社保补缴详情'
  539. tips = {
  540. explain: ['补缴必须与正常月份一起操作,所以下补缴单前请先下一个月正常单(点击首页-缴社保)', '补缴不能跨月操作。例如,现在可以下10月份订单,那么补缴必须从9月份开始往前连续购买,不可从8月份或其他月份开始(若9月份已缴费就不能操作补缴了)。', '本平台仅支持代缴服务,不支持生育津贴、住房补贴等申领,且不出具任何相关证明。']
  541. }
  542. } else {
  543. title = '社保缴纳详情'
  544. tips = {
  545. explain: ['以前曾在单位参保过的,第一次下单购买前,请先确认前单位是否已经减员。若因前单位没有减员的,导致购买不成功,本平台不负责哦。', '本平台仅支持代缴服务,不支持生育津贴、住房补贴等申领,且不出具任何相关证明。'],
  546. attention: ['若您停止购买后,本平台通常会于次月截止时间后的一周操作减员(部分地区可能会有延迟),需提前减员的用户,请提前3-7工作日联系客服。', '如果您当月申请减员后,又想重新购买当月的社保,请务必先联系客服撤销减员,避免漏缴。'],
  547. attentionT: '社保减员注意事项'
  548. }
  549. }
  550. tips.choose = {
  551. t: ['购买流程', '平台优势', '常见问题', '温馨提示'],
  552. c: 0,
  553. animation: {}
  554. }
  555. tips.process = 'process_s'
  556. tips.tips = ['避免因错过了截止时间忘记下单,造成社保断缴的,建议一次性购买多个月份。若有新的工作单位,未缴费的月份可申请退款。',
  557. '凡带有“年缴”标识的,首月会一次性收取一年费用,年费会因地区和缴费月份不同稍有变化。',
  558. '带有“预收费用”的城市,因社保局已确定调费,但上调金额未定,固将预收一定的费用。待社保局确定上调金额后,我们会统一清算,多退少补(如:杭州市一般于6月份公布,但须从当年1月份开始执行)',
  559. '每年政府会调整社保缴费基数,我们会在第一时间通知您。若因政府调整通知滞后导致划扣金额不准确的,我们承诺多退少补,童叟无欺。',
  560. '本套餐适合于16岁至法定退休年龄之间的用户购买。']
  561. tips.question = { t: '社保购买常见问题', c: [
  562. '付款成功后,一般什么时候可以查询参保情况呢?',
  563. ['当月下单截止后,专员会开始进行跟进。\n如有异常,则会通过信息或电话通知您;没有通知则表示正常操作,一般可于', '次月1日-15日查询', '缴纳情况。'],
  564. '如果社保缴纳没有成功,你们会给予退款么?',
  565. '会的,因您自身原因办理不成功,或符合申请退款条件的,则给予退款。但支付宝或微信平台收取0.6%的手续费需由您承担。\n退款一般会于月底或次月初前原路退还给您。',
  566. '你们可以办理社保卡么?办理需要多长时间?',
  567. '可以办理的,但若您是停保期间是无法办卡的哦。\n社保卡一般会在当月成功缴费后的2 - 6个月内出卡(不同地区时间不一样)。\n办理成功后会以邮寄方式寄给您,邮费到付。'
  568. ], ids: ['questionLeft1', 'questionRight1', 'questionLeft2', 'questionRight2', 'questionLeft3', 'questionRight3'], height: [0, 0, 0, 0, 0, 0, 0, 0] }
  569. this.data.ui.tips = tips
  570. wx.setNavigationBarTitle({
  571. title: title
  572. })
  573. var cityData = [publicData.purchaseCity.p, publicData.purchaseCity[(publicData.purchaseCity.p)[0].id]]
  574. this.data.adapter = {
  575. suffix: sysT.suffixOfClass(),
  576. isSupplementaryPay: order.isSupplementaryPay,
  577. banner: order.isSupplementaryPay ? '../../../../icon/home/s_s_banner.png' : '../../../../icon/home/s_p_banner.png',
  578. title: '自助缴社保 按当地最低标准缴费',
  579. leftButton: '一键续保',
  580. rightButton: '立即参保',
  581. city: {
  582. t: '参保城市',
  583. c: this.data.choseCity.name,
  584. d: cityData,
  585. v: [0, 0],
  586. des: ''
  587. },
  588. charge: 0,
  589. count: 10000,
  590. //客服需要的
  591. isLogin: false,
  592. userInfo: {
  593. avatarUrl: ''
  594. },
  595. params: {
  596. }
  597. }
  598. // this.data.confirmView.suffix = sysT.suffixOfClass()
  599. // if (sysT.suffixOfClass() == '-X') {
  600. // this.data.confirmView.height = '868rpx'
  601. // this.data.confirmView.bottom = '68rpx'
  602. // }
  603. this.setData({
  604. choseCity: this.data.choseCity,
  605. adapter: this.data.adapter,
  606. accounts: publicData.accounts,
  607. ui: this.data.ui
  608. })
  609. this.getData(this.data.choseCity.id)
  610. },
  611. /**
  612. * 生命周期函数--监听页面初次渲染完成
  613. */
  614. onReady: function () {
  615. // var order = p.getOrder()
  616. // businessT.debugLog(order)
  617. // if(order.isSupplementaryPay) {
  618. // app.purchase.purchaseDataArray = app.purchase.supplementaryPurchaseDataArray
  619. // } else {
  620. // app.purchase.purchaseDataArray = app.purchase.normalPurchaseDataArray
  621. // }
  622. // var purchaseArray = app.purchase.purchaseDataArray
  623. // if (purchaseArray.length > 0) {
  624. // var purchase = purchaseArray[0]
  625. // if (purchase.city_code == this.data.choseCity.id && purchase.pack == 1) {
  626. // app.purchase.purchaseData = purchase
  627. // this.handleData()
  628. // } else {
  629. // app.purchase.purchaseDataArray = []
  630. // app.purchase.purchaseData = null
  631. // this.getData(this.data.choseCity.id)
  632. // }
  633. // } else {
  634. // this.getData(this.data.choseCity.id)
  635. // }
  636. },
  637. /**
  638. * 生命周期函数--监听页面显示
  639. */
  640. onShow: function () {
  641. //客服
  642. this.data.adapter.isLogin = app.loginStatus.isLogin
  643. this.data.adapter.userInfo.nickName = app.globalData.userInfo.phone
  644. this.data.adapter.params.phone = app.globalData.userInfo.phone
  645. this.data.adapter.params.userId = app.globalData.userInfo.uid
  646. this.setData({
  647. adapter: this.data.adapter
  648. })
  649. if (this.data.isFirstLoad) {
  650. this.data.isFirstLoad = false
  651. return
  652. }
  653. var order = p.getOrder()
  654. this.data.choseCity = { name: order.cityName, id: order.city }
  655. this.handleData()
  656. },
  657. /**
  658. * 生命周期函数--监听页面隐藏
  659. */
  660. onHide: function () {
  661. },
  662. /**
  663. * 生命周期函数--监听页面卸载
  664. */
  665. onUnload: function () {
  666. },
  667. /**
  668. * 页面相关事件处理函数--监听用户下拉动作
  669. */
  670. onPullDownRefresh: function () {
  671. },
  672. /**
  673. * 页面上拉触底事件的处理函数
  674. */
  675. onReachBottom: function () {
  676. },
  677. /**
  678. * 用户点击右上角分享
  679. */
  680. onShareAppMessage: function () {
  681. return {
  682. path: '/page/home/index',
  683. imageUrl: '../../../../icon/public/share_img.png',
  684. title: '自助缴社保公积金,覆盖200多个城市,专业团队操作'
  685. }
  686. }
  687. })