utils.service.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752
  1. /* HTTP API 公共模块业务
  2. * Copyright 2020, CAIMEI365
  3. * Date 2020/06/16
  4. * auther ZHJY
  5. */
  6. var PublicApi = {
  7. // 获取搜索关键词
  8. fetchQueryKeywordList: function(params){
  9. return Http.AjaxService({
  10. url:'/commodity/search/query/get/keyword/list',
  11. type:'post',
  12. data:params,
  13. json:false,
  14. })
  15. },
  16. // 获取搜索关键词
  17. fetchLabelKeywordList: function(params){
  18. return Http.AjaxService({
  19. url:'/commodity/search/query/keyword/list',
  20. type:'get',
  21. data:params,
  22. json:false,
  23. })
  24. },
  25. // oss 初始化 (临时凭证获取)
  26. fetchOssInitData: function(params){
  27. return Http.AjaxService({
  28. url:'/user/oss/token',
  29. type:'get',
  30. data:params,
  31. json:false,
  32. })
  33. },
  34. uploadimg: function (params, callback) {//供应商添加物流上传图片
  35. Http.uploadImage({
  36. url:'/tools/image/upload/multi',
  37. data:params
  38. },callback)
  39. },
  40. uploadFile: function (params, callback) {//上传文件
  41. Http.uploadImage({
  42. url:'/tools/file/upload/oss',
  43. data:params
  44. },callback)
  45. },
  46. deleteOssFile: function (params, callback) {//删除Oss文件
  47. Http.AjaxService({
  48. url:'/tools/file/delete/oss',
  49. type:'post',
  50. data:params,
  51. json:false,
  52. mask:true,
  53. replace:false
  54. })
  55. .then(function(res){
  56. callback(res);
  57. });
  58. },
  59. GetHomeData:function(params,callback){ //首页数据
  60. Http.AjaxService({
  61. url:'/commodity/home/floor',
  62. type:'get',
  63. data:params,
  64. json:false,
  65. isHost:true
  66. })
  67. .then(function(res){
  68. callback(res)
  69. });
  70. },
  71. GetHomeRecommend:function(params,callback){ //新品橱窗重点推荐
  72. Http.AjaxService({
  73. url:'/commodity/home/recommend',
  74. type:'get',
  75. data:params,
  76. json:false,
  77. isHost:true
  78. })
  79. .then(function(res){
  80. callback(res)
  81. });
  82. },
  83. GetHomeNewFloorList:function(params,callback){ //新品橱窗商品列表
  84. Http.AjaxService({
  85. url:'/commodity/home/NewFloorList',
  86. type:'get',
  87. data:params,
  88. json:false,
  89. isHost:true
  90. })
  91. .then(function(res){
  92. callback(res)
  93. });
  94. },
  95. GetHomeNBrandName:function(params,callback){ //新品橱窗品牌列表
  96. Http.AjaxService({
  97. url:'/commodity/home/BrandName',
  98. type:'get',
  99. data:params,
  100. json:false,
  101. isHost:true
  102. })
  103. .then(function(res){
  104. callback(res)
  105. });
  106. },
  107. GetHomeInit:function(params,callback){ //首页数据
  108. Http.AjaxService({
  109. url:'/commodity/home/init',
  110. type:'get',
  111. data:params,
  112. json:false,
  113. isHost:true
  114. })
  115. .then(function(res){
  116. callback(res)
  117. });
  118. },
  119. // GetHomeBanner:function(params,callback){ //首页bnner
  120. // Http.AjaxService({
  121. // url:'/home/banner',
  122. // type:'get',
  123. // data:params,
  124. // json:false
  125. // })
  126. // .then(function(res){
  127. // callback(res)
  128. // });
  129. // },
  130. // GetHomeRightData:function(params,callback){ //首页右侧模块
  131. // Http.AjaxService({
  132. // url:'/commodity/home/sidebar',
  133. // type:'get',
  134. // data:params,
  135. // json:false,
  136. // })
  137. // .then(function(res){
  138. // callback(res)
  139. // });
  140. // },
  141. GetProductClassify:function(params,callback){ //获取一级分类
  142. Http.AjaxService({
  143. url:'/commodity/classify',
  144. type:'get',
  145. data:params,
  146. json:false,
  147. isHost:true
  148. })
  149. .then(function(res){
  150. callback(res)
  151. });
  152. },
  153. // GetNavigationMenu:function(params,callback){ //获取顶部导航
  154. // Http.AjaxService({
  155. // url:'/home/init',
  156. // type:'get',
  157. // data:params,
  158. // json:false
  159. // })
  160. // .then(function(res){
  161. // callback(res)
  162. // });
  163. // },
  164. GetProvince:function(params,callback){ //获取省份信息
  165. Http.AjaxService({
  166. url:'/order/address/select',
  167. type:'get',
  168. data:params,
  169. json:false,
  170. isHost:true
  171. })
  172. .then(function(res){
  173. callback(res)
  174. });
  175. },
  176. GetCity:function(params,callback){ //获取区分信息
  177. Http.AjaxService({
  178. url:'/order/address/select',
  179. type:'get',
  180. data:params,
  181. json:false,
  182. isHost:true
  183. })
  184. .then(function(res){
  185. callback(res)
  186. });
  187. },
  188. GetTown:function(params,callback){ //获取市信息
  189. Http.AjaxService({
  190. url:'/order/address/select',
  191. type:'get',
  192. data:params,
  193. json:false,
  194. isHost:true
  195. })
  196. .then(function(res){
  197. callback(res)
  198. });
  199. },
  200. GetFirstClassFication:function(params,callback){ //获取一级分类
  201. Http.AjaxService({
  202. url:'/commodity/type/first',
  203. type:'get',
  204. data:params,
  205. json:true,
  206. isHost:true
  207. })
  208. .then(function(res){
  209. callback(res)
  210. });
  211. },
  212. GetTwoClassFication:function(params,callback){ //获取二级分类
  213. Http.AjaxService({
  214. url:'/commodity/type/second',
  215. type:'get',
  216. data:params,
  217. json:true,
  218. isHost:true
  219. })
  220. .then(function(res){
  221. callback(res)
  222. });
  223. },
  224. GetThreeClassFication:function(params,callback){ //获取三级分类
  225. Http.AjaxService({
  226. url:'/commodity/type/third',
  227. type:'get',
  228. data:params,
  229. json:true,
  230. isHost:true
  231. })
  232. .then(function(res){
  233. callback(res)
  234. });
  235. },
  236. addCart : function (params,callback) { //加入购物车
  237. Http.AjaxService({
  238. url:'/shoppingCart/addCart',
  239. type:'post',
  240. data:params,
  241. json:false
  242. })
  243. .then(function(res){
  244. callback(res)
  245. });
  246. },
  247. getImgVerifyCode : function (params,callback){ //获取图形验证图形
  248. Http.AjaxService({
  249. url:'/user/captcha',
  250. type:'get',
  251. data:params,
  252. json:true,
  253. isHost:true
  254. })
  255. .then(function(res){
  256. if (res.code == 0) {
  257. callback(res);
  258. }
  259. });
  260. },
  261. getMobileSMScode : function (params,callback){//直接获取手机短信验证码
  262. Http.AjaxService({
  263. url:'/user/activateCodeByReg',
  264. type:'get',
  265. data:params,
  266. json:true
  267. })
  268. .then(function(res){
  269. callback(res);
  270. });
  271. },
  272. getEmailSMScode : function (params,callback) { //获取邮箱短信验证码
  273. Http.AjaxService({
  274. url:'/user/mail/code',
  275. type:'get',
  276. data:params,
  277. json:true,
  278. isHost:true
  279. })
  280. .then(function(res){
  281. callback(res);
  282. });
  283. },
  284. findCompanyPwd : function(params,callback) {//用户找回密码
  285. Http.AjaxService({
  286. url:'/user/findCompanyPwd',
  287. type:'post',
  288. data:params,
  289. json:true
  290. })
  291. .then(function(res){
  292. callback(res);
  293. });
  294. },
  295. clubChangeMobile:function(params,callback){//更换手机号
  296. Http.AjaxService({
  297. url:'/user/update/mobile',
  298. type:'post',
  299. data:params,
  300. json:false,
  301. isHost:true
  302. })
  303. .then(function(res){
  304. callback(res);
  305. });
  306. },
  307. editCompanyInfo : function (params,callback) {//获取要修改的企业信息
  308. Http.AjaxService({
  309. url:'/user/club/applicationData',
  310. type:'get',
  311. data:params,
  312. json:true
  313. })
  314. .then(function(res){
  315. callback(res);
  316. });
  317. },
  318. modifiedData : function (params,callback) {//提交个人中心修改机构信息
  319. Http.AjaxService({
  320. url:'/operation/modifiedData',
  321. type:'post',
  322. data:params,
  323. json:false
  324. })
  325. .then(function(res){
  326. callback(res);
  327. });
  328. },
  329. bindIngUseEmail : function(params,callback) { //未绑定邮箱账户绑定邮箱
  330. Http.AjaxService({
  331. url:'/user/binding',
  332. type:'post',
  333. data:params,
  334. json:true
  335. })
  336. .then(function(res){
  337. callback(res)
  338. });
  339. },
  340. getOperationList : function (params,callback) { //获取机构运营人员列表
  341. Http.AjaxService({
  342. url:'/user/bindOrganization',
  343. type:'post',
  344. data:params,
  345. json:false
  346. })
  347. .then(function(res){
  348. callback(res)
  349. });
  350. },
  351. addOperation : function (params,callback) { //机构员工管理添加运营人员
  352. Http.AjaxService({
  353. url:'/operation/add',
  354. type:'post',
  355. data:params,
  356. json:false
  357. })
  358. .then(function(res){
  359. callback(res)
  360. });
  361. },
  362. deleteOperation : function (params,callback) { //机构员工管理删除运营人员
  363. Http.AjaxService({
  364. url:'/operation/delete',
  365. type:'post',
  366. data:params,
  367. json:false
  368. })
  369. .then(function(res){
  370. callback(res)
  371. });
  372. },
  373. updateInvitationCode : function (params,callback) { //机构员工管理更新邀请码
  374. Http.AjaxService({
  375. url:'/operation/updateInvitationCode',
  376. type:'post',
  377. data:params,
  378. json:false
  379. })
  380. .then(function(res){
  381. callback(res)
  382. });
  383. },
  384. queryShoppingCartList:function(params,callback){ //购物车数据列表
  385. Http.AjaxService({
  386. url:'/shoppingCart/shoppingInfo',
  387. type:'get',
  388. data:params, json:false
  389. })
  390. .then(function(res){
  391. callback(res)
  392. });
  393. },
  394. shoppingCartUpdate:function(params,callback){//更新商品增减
  395. Http.AjaxService({
  396. url:'/shoppingCart/update',
  397. type:'post',
  398. data:params,
  399. json:false
  400. })
  401. .then(function(res){
  402. callback(res)
  403. });
  404. },
  405. shoppingCartDelete:function(params,callback) {//删除购物车商品
  406. Http.AjaxService({
  407. url:'/shoppingCart/delete',
  408. type:'post',
  409. data:params,
  410. json:false
  411. })
  412. .then(function(res){
  413. callback(res)
  414. });
  415. },
  416. queryOrderConfirmInfo:function(params,callback){ //购物车数据列表
  417. Http.AjaxService({
  418. url:'/order/confirm',
  419. type:'get',
  420. data:params,
  421. json:true
  422. })
  423. .then(function(res){
  424. callback(res)
  425. });
  426. },
  427. queryAddressList:function(params,callback){ //地址列表
  428. Http.AjaxService({
  429. url:'/personalCenter/findAddress',
  430. type:'get',
  431. data:params,
  432. json:true
  433. })
  434. .then(function(res){
  435. callback(res)
  436. });
  437. },
  438. deleteNewAddress:function(params,callback){ //删除地址
  439. Http.AjaxService({
  440. url:'/personalCenter/deleteAddress',
  441. type:'get',
  442. data:params,
  443. json:true
  444. })
  445. .then(function(res){
  446. callback(res)
  447. });
  448. },
  449. addNewAddress:function(params,callback) {//保存地址
  450. Http.AjaxService({
  451. url:'/personalCenter/saveAddress',
  452. type:'post',
  453. data:params,
  454. json:false
  455. })
  456. .then(function(res){
  457. callback(res)
  458. });
  459. },
  460. defaultAddress:function(params,callback) {//设为默认地址
  461. Http.AjaxService({
  462. url:'/personalCenter/defaultAddress',
  463. type:'post',
  464. data:params,
  465. json:false
  466. })
  467. .then(function(res){
  468. callback(res)
  469. });
  470. },
  471. getOrderPostage:function(params,callback){ //获取邮费信息
  472. Http.AjaxService({
  473. url:'/order/postage',
  474. type:'get',
  475. data:params,
  476. json:true
  477. })
  478. .then(function(res){
  479. callback(res)
  480. });
  481. },
  482. getFindInvoice:function(params,callback){ //获取发票信息
  483. Http.AjaxService({
  484. url:'/personalCenter/findInvoice',
  485. type:'get',
  486. data:params,
  487. json:true
  488. })
  489. .then(function(res){
  490. callback(res)
  491. });
  492. },
  493. getHomeSaleTips:function(params,callback){ //获取关于我们
  494. Http.AjaxService({
  495. url:'/commodity/home/sale/tips',
  496. type:'get',
  497. data:params,
  498. json:true
  499. })
  500. .then(function(res){
  501. callback(res)
  502. });
  503. },
  504. confirmOrder:function (params,callback) {//提交订单
  505. Http.AjaxService({
  506. url:'/order/submit',
  507. type:'post',
  508. data:params,
  509. json:false
  510. })
  511. .then(function(res){
  512. callback(res)
  513. });
  514. },
  515. updateInvoice:function (params,callback) {//保存发票信息
  516. Http.AjaxService({
  517. url:'/personalCenter/invoice',
  518. type:'post',
  519. data:params,
  520. json:false
  521. })
  522. .then(function(res){
  523. callback(res)
  524. });
  525. },
  526. markAsRead:function (params,callback) {//已读消息
  527. Http.AjaxService({
  528. url:'/user/center/messages/read',
  529. type:'post',
  530. data:params,
  531. json:false
  532. })
  533. .then(function(res){
  534. callback(res)
  535. });
  536. },
  537. deleteMessage:function (params,callback) {//删除消息
  538. Http.AjaxService({
  539. url:'/user/center/messages/delete',
  540. type:'post',
  541. data:params,
  542. json:false
  543. })
  544. .then(function(res){
  545. callback(res)
  546. });
  547. },
  548. GetNewsList:function(params,callback){ //公告列表
  549. Http.AjaxService({
  550. url:'/commodity/home/title',
  551. type:'get',
  552. data:params,
  553. json:false,
  554. isHost:true
  555. })
  556. .then(function(res){
  557. callback(res)
  558. });
  559. },
  560. GetNewsDetails:function(params,callback){ //获取公告详情
  561. Http.AjaxService({
  562. url:'/commodity/home/capacity',
  563. type:'get',
  564. data:params,
  565. json:false,
  566. isHost:true
  567. })
  568. .then(function(res){
  569. callback(res)
  570. });
  571. },
  572. getAuthClubCount:function(params,callback){ // 获取机构未读消息数量
  573. Http.AjaxService({
  574. url:'/user/login/auth/ClubCount',
  575. type:'get',
  576. data:params,
  577. json:false,
  578. isHost:true
  579. })
  580. .then(function(res){
  581. callback(res)
  582. });
  583. },
  584. getAuthShopCount:function(params,callback){ // 获取供应商未读消息数量
  585. Http.AjaxService({
  586. url:'/user/login/auth/ShopCount',
  587. type:'get',
  588. data:params,
  589. json:false,
  590. isHost:true
  591. })
  592. .then(function(res){
  593. callback(res)
  594. });
  595. },
  596. userRecordStatisticsApp: function (params, callback) {//上送统计用户浏览记录
  597. Http.AjaxService({
  598. url: '/user/record/Statistics',
  599. type:'get',
  600. data:params,
  601. json:false,
  602. isHost:true
  603. }).then(function (res) {
  604. callback(res);
  605. });
  606. },
  607. userInformationIsClick: function (params, callback) {//查看用户是否有过弹框,游客当天是否有过弹框
  608. Http.AjaxService({
  609. url: '/user/information/isClick',
  610. type:'get',
  611. data:params,
  612. json:false,
  613. isHost:true
  614. }).then(function (res) {
  615. callback(res);
  616. });
  617. },
  618. getUserPopUpInfo: function (params, callback) {//查看供应商广告弹窗信息
  619. Http.AjaxService({
  620. url: '/user/information/getPopUpInfo',
  621. type:'get',
  622. data:params,
  623. json:false,
  624. isHost:true
  625. }).then(function (res) {
  626. callback(res);
  627. });
  628. },
  629. userInformationInsertRoos: function (params, callback) {//插入填写咨询人基本信息
  630. Http.AjaxService({
  631. url: '/user/information/insertRoos',
  632. type:'post',
  633. data:params,
  634. json:false,
  635. isHost:true
  636. }).then(function (res) {
  637. callback(res);
  638. });
  639. },
  640. getShopAdvert: function (params, callback) {//查看访问者是否浏览过roos相关页面
  641. Http.AjaxService({
  642. url: '/user/information/getShopAdvert',
  643. type:'get',
  644. data:params,
  645. json:false,
  646. isHost:true
  647. }).then(function (res) {
  648. callback(res);
  649. });
  650. },
  651. getArticleRecommendation(params, callback) { // 精选文章和美业资料列表数据
  652. Http.AjaxService({
  653. url: '/info/articlerecommendation',
  654. type:'get',
  655. data:params,
  656. json:false,
  657. isHost:true
  658. }).then((res) => {
  659. callback(res);
  660. });
  661. },
  662. getVoteList(params, callback) { // 获取投票详情
  663. Http.AjaxService({
  664. url: '/commodity/vote/list',
  665. type:'get',
  666. data:params,
  667. json:false,
  668. isHost:true
  669. }).then((res) => {
  670. callback(res);
  671. });
  672. },
  673. getVotePush(params, callback) { // 获取投票详情
  674. Http.AjaxService({
  675. url: '/commodity/push/vote',
  676. type:'post',
  677. data:params,
  678. json:false,
  679. isHost:true
  680. }).then((res) => {
  681. callback(res);
  682. });
  683. },
  684. /**
  685. * @采美AI助手-提问
  686. * @param:userId 用户userId
  687. * @param:question 问题码
  688. */
  689. userNewChat: function (params, callback) {
  690. Http.AjaxService({
  691. url: '/user/chat/new/chat',
  692. type:'get',
  693. data:params,
  694. json:false,
  695. isHost:true
  696. }).then(function (res) {
  697. callback(res);
  698. });
  699. },
  700. /**
  701. * @采美AI助手-提问
  702. * @param:chatId 记录ID
  703. * @param:userId 用户userId
  704. * @param:question 问题码
  705. */
  706. userSecondChat: function (params, callback) {
  707. Http.AjaxService({
  708. url: '/user/chat/second/chat',
  709. type:'get',
  710. data:params,
  711. json:false,
  712. isHost:true
  713. }).then(function (res) {
  714. callback(res);
  715. });
  716. },
  717. /**
  718. * @采美AI助手-提问记录
  719. * @param:userId 用户userId
  720. * @param:pageNum 每页页码
  721. * @param:pageSize 条数
  722. */
  723. userNewChatHistory: function (params, callback) {
  724. Http.AjaxService({
  725. url: '/user/chat/chat/history',
  726. type:'get',
  727. data:params,
  728. json:false,
  729. isHost:true
  730. }).then(function (res) {
  731. callback(res);
  732. });
  733. },
  734. /**
  735. * @采美AI助手-提问记录详情
  736. * @param:userId 用户userId
  737. * @param:chatId 记录Id
  738. */
  739. userNewChatDetail: function (params, callback) {
  740. Http.AjaxService({
  741. url: '/user/chat/history/detail',
  742. type:'get',
  743. data:params,
  744. json:false,
  745. isHost:true
  746. }).then(function (res) {
  747. callback(res);
  748. });
  749. }
  750. };