httpRequest.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. /**
  2. * 有关 访问服务器的uri
  3. */
  4. var $http = function () {
  5. this.ajaxLock = false;
  6. // this.ip = "http://192.168.43.144/api";
  7. // this.ip = "http://192.168.242.24:9002";
  8. //this.ip = "http://b2bcnapi.sailuntire.com/api";
  9. this.ip = "http://b2bcnapi.sailuntire.com/api/test";
  10. /****** 用户相关 ******/
  11. // 选择图片生成地址
  12. this.getUrlByFileUrl = "/web/file/upload";
  13. // 根据省获取经销商
  14. this.getUpuserByProvideUrl = "/web/bizLogin/testPostApi";
  15. // 注册用户
  16. this.regizeUrl = "/web/bizLogin/registRetailer";
  17. // 登录用户
  18. this.loginUrl = "/web/bizLogin/login";
  19. // 根据loginid获取用户信息
  20. // this.getUserInfoUrl = "/base/retailer/loginToInfo";
  21. /******* 订单相关 ********/
  22. // 查看剩余库存
  23. this.getStockUrl_old = "/jinyu/bizAgentStock/page";
  24. this.getStockUrl = "/base/material/pageMaterialStock";
  25. // 添加商品到购物车
  26. this.addCarUrl = "/jinyu/bizCart/save";
  27. // 获取购物车列表
  28. this.shopCarListUrl = "/jinyu/bizCart/list";
  29. // 获取商品详情
  30. this.getInfoUrl = "/base/material/info";
  31. // 下单传 {"retailerId":"212","amounr":100,"bizCartDtoList":[{"id":121...},{"id":12..}] 这里把购物车的列表给我}
  32. this.downOrderUrl = "/base/bizOrder/save";
  33. // 删除购物车 --删除一个
  34. this.deleteCar = "/jinyu/bizCart/deleteOne";
  35. // 删除购物车记录 -- 珊瑚多个
  36. this.deleteCars = "/jinyu/bizCart/delete";
  37. // 获取订单列表
  38. this.getOrderListUrl = "/base/bizOrder/page";
  39. // 获取订单详情
  40. this.getOrderInfo = "/base/bizOrder/info";
  41. // ---------- 525 ---------
  42. // 获取库存详情
  43. this.getKucunInfoUrl = "/jinyu/bizRetailerStock/page";
  44. // 获取商品类别
  45. this.getStoreTypeUrl = "/jinyu/bizGoodsType/list";
  46. // 添加商品类别
  47. this.addStoreTypeUrl = "/jinyu/bizGoodsType/save";
  48. // 添加商品
  49. this.addStoreUrl = "/jinyu/bizGoods/saveGoods";
  50. // 查看自己的供应商
  51. this.getSupplierUrl = "/jinyu/bizSupplier/list";
  52. // 根据条形码查询商品
  53. this.getStoreByScanUrl = "/jinyu/bizGoods/selectBySerialNumber";
  54. // 添加供应商
  55. this.addSupplierUrl = "/jinyu/bizSupplier/save";
  56. // 进货
  57. this.buyStoreUrl = "/jinyu/bizBills/save";
  58. // 单据
  59. this.buyListUrl = "/jinyu/bizBills/page";
  60. // 商品详情
  61. this.getStoreInfoUrl = "/jinyu/bizGoods/info";
  62. // 选择品牌
  63. this.chooseBrandUrl = "/base/brand/list";
  64. // 根据扫出来的码获取商品信息(进销存) -- 需要后面拼接
  65. this.jinstoreByScanUrl = "/base/material/infoByKey";
  66. // 获取门店经销商列表
  67. this.getSupplierListUrl = "/base/retailerAgent/list";
  68. // 经销商查询自己库存
  69. // this.checkStoreUrl = "/jinyu/bizAgentStock/page";
  70. this.checkStoreUrl_old = "/jinyu/bizAgentStock/page";
  71. this.checkStoreUrl = "/jinyu/bizAgentStock/pageOwn";
  72. // 扫码商品 0705
  73. this.addStoreByScanUrl = "/jinyu/bizGoods/selectBySerialNumberAndRetailerId";
  74. // 入库扫码
  75. this.addOrgoScanUrl = '/jinyu/bizGoods/selectInBySerialNumberAndRetailerId';
  76. // 出库扫码
  77. this.outScanUrl = '/jinyu/bizGoods/selectOutBySerialNumberAndRetailerId';
  78. /********* 0706 ***********/
  79. // 收取短信验证码
  80. this.getPhoneCode = '/web/bizLogin/sendCode';
  81. // 获取客户信息
  82. this.customListUrl = '/web/bizCustomRetailer/page';
  83. // 获取门店详情
  84. this.getMDInfo = "/base/retailer/retailerInfo";
  85. // 获取所有的轮胎服务类目
  86. this.getServices = "/base/service/list";
  87. // 添加服务
  88. this.addServices = "/jinyu/bizRetailerService/save";
  89. // 根据品牌统计库存
  90. this.getStockByPP = "/jinyu/bizRetailerStock/selectStockByBrand";
  91. // 获取积分
  92. this.getJFStore = "/jinyu/bizMall/page";
  93. // 获取新闻条
  94. this.getNews = "/jinyu/bizArticle/page";
  95. // 根据品牌获取上级代理商
  96. this.getUpByBrand = "/jinyu/bizAgentBrand/listByAgentIds";
  97. // 根据品牌和省市获取上级代理商
  98. this.getUpByBrandAndArea = "/jinyu/bizAgentBrand/listByBrandIds";
  99. // 获取门店积分列表
  100. this.getJFlistUrl = "/jinyu/bizRetailerIntegral/page";
  101. // 兑换商品
  102. this.exchangeUrl = "/jinyu/bizMallOrder/save";
  103. // 查看兑换记录
  104. this.exchangeListUrl = "/jinyu/bizMallOrder/page";
  105. // 检查版本
  106. this.getVersionUrl = "/web/biz/getAppVersion";
  107. // 活动banner
  108. this.getBannerUrl = "/biz/bizBanner/list";
  109. // 获取参加活动的商品
  110. this.getStoreBannerUrl = "/biz/bizActivity/activityInfo";
  111. // 根据条形码获取商品
  112. this.getStoreByScan = "/web/biz/bizGoods/Scancoderemotecall";
  113. // 获取经销商对应物料列表
  114. this.getStoreListU = "/web/biz/bizCoupon/select";
  115. // 添加商品至购物车
  116. this.addStoreToCarU = "/web/biz/bizCart/save";
  117. // 获取购物车列表
  118. this.getCarListU = "/web/biz/bizCart/selectCart";
  119. //线上订货修改购物车数量
  120. this.updateCarNum = "/web/biz/bizCart/update"
  121. // 从购物车下单
  122. this.downOrderU = "/web/base/bizOrder/save";
  123. // 扫码确定
  124. this.scanDoneU = "/web/biz/bizGoods/Scancode";
  125. //签约级别
  126. this.signLv = "/web/bizLogin/enum";
  127. // 门店立即抢购
  128. this.rushToBuyU = "/web/base/bizOrder/directSave";
  129. // 门店查询订单
  130. this.getOrderListU = "/web/base/bizOrder/selectStore";
  131. // 门店获取订单详情
  132. this.getOrderInfoU = "/web/biz/bizOrderInfo/selectOrderInfo";
  133. // 获取门店参保列表接口
  134. this.getInsuranceU = "/web/sailun/insurance/getInsuranceList";
  135. // 获取门店详情
  136. this.getAgentInfoU = "/web/biz/bizAudit/store";
  137. // 扫码入库
  138. this.sacaCodeIn = "/web/biz/bizGoods/ScanCodeIn";
  139. // 获取轮胎理赔详情
  140. this.getLipeiList = "/web/sailun/insurance/getInsuranceList";
  141. // 通过胎号获取理赔单详情
  142. this.getLipeiInfoU = "/web/sailun/insurance/getTireClaimInfo";
  143. // 理赔图片的上传
  144. this.uploadLipeU = "/web/sailun/insurance/tireImageUpload";
  145. // 提交轮胎保理赔记录
  146. this.sumbiltLipeiU = "/web/sailun/insurance/submitTireClaim";
  147. // 获取入库记录
  148. this.getIntoListU = "/web/sailun/insurance/getStoreClaimList";
  149. // 获取出入库记录
  150. this.getinOrOutU = "/web/biz/bizGoods/Incomingandoutgoingrecordsquery";
  151. // 获取赔付记录
  152. this.peifuListU = "/web/sailun/insurance/getStoreClaimList";
  153. // 扫码出库
  154. this.outStoreU = "/web/biz/bizGoods/ScanCodeOut";
  155. // 获取签约等级
  156. this.getSignLvU = "/web/bizLogin/enum";
  157. // 门店查询经销商库存
  158. this.getStockListU = "/web/biz/bizAudit/QueryStoreAgentStock";
  159. // 删除购物车记录
  160. this.delCarMataxU = "/web/biz/bizCart/deleteOne";
  161. // 获取理赔单详情
  162. this.getTlementInfoU = "/web/sailun/insurance/getTireInfo";
  163. // 生成核销code
  164. this.getHxCodeU = "/web/biz/bizCoupon/save";
  165. // 获取门店门店核销码列表
  166. this.getHxListU = "/web/biz/bizCoupon/selectCoupon";
  167. // 获取物料筛选条件
  168. this.getWuliaoAntionU = "/web/biz/bizCoupon/condition";
  169. //请求文章 根据id
  170. this.getOneDetails = "/web/biz/bizArticle/getOneDetails";
  171. //厂家宣传
  172. // this.getArticle="/web/biz/bizArticle/list"
  173. // 获取地址管理
  174. // this.getAddress="/sys/bizReceiptAddress/paget"
  175. // 获取地址列表
  176. this.getAddressListU = "/web/sys/bizReceiptAddress/page";
  177. // 门店新增收货地址
  178. this.addAddressU = "/web/sys/bizReceiptAddress/save";
  179. // 查看门店自己的优惠券
  180. // this.searchKuCunU = "/web/sys/bizStoreRegistrationSpree/page";
  181. /// 查看门店自己的库存
  182. this.searchKuCunU = "/web/biz/bizGoods/storeSelectStock";
  183. // 门店查询返利明细
  184. this.lookUserTotalU = "/web/biz/bizStoreReward/page";
  185. // 获取优惠券
  186. this.getCouponListU = "/web/sys/bizStoreRegistrationSpree/page";
  187. // 查询门店进货分析
  188. this.getStoreIntoListU = "/web/base/bizOrder/caculateStore";
  189. // 检查版本
  190. this.checkVersionU = "/web/biz/getAppVersion?type=1";
  191. // ios检查版本
  192. this.ioscheckVersionU = "/web/biz/getAppVersion?type=3";
  193. // 上传门店车辆图片接口
  194. this.uploadCarPhotoU = "/web/sailun/insurance/carPictureUpload";
  195. //我的供应商
  196. this.getSupplier = "/web/biz/bizStoreAgent/mySuppliers";
  197. //获取跑马灯list
  198. this.getMessageList = "/web/mobile/sysMessage/getMessageList";
  199. //获取新版本
  200. this.getNewVersionU = "/web/file/getShopApk";
  201. //上传门店行驶证照片
  202. this.uploadUserCarU = "/web/sailun/insurance/carPictureUpload";
  203. //离线缓存工单
  204. this.saveJxItemU = "/event/queryEventLX/";
  205. //轮播图
  206. this.getbannerLists = "/web/biz/bizStoreBrand/selectStoreBrandBanner";
  207. //获取商品分类
  208. this.getTypes = "/web/biz/bizGoodsType/selectProductCategory";
  209. // 获取商品
  210. this.getshopLists = "/web/biz/bizGoodsType/selectCategoryItem";
  211. //加入购物车
  212. this.addShopCart = "/web/sailun/bizIntegralCart/save";
  213. //查看购物车
  214. this.getShopCart = "/web/sailun/bizIntegralCart/page";
  215. //修改购物车数量
  216. this.fixCartNum = "/web/sailun/bizIntegralCart/update";
  217. //删除购物车
  218. this.delCart = "/web/sailun/bizIntegralCart/deletes";
  219. //下单
  220. this.addOrder = "/web/biz/bizShopIntegralOrder/save";
  221. //查看兑换记录
  222. this.getOrderannal = "/web/biz/bizIntegralOrderItem/page";
  223. //积分商场详情
  224. this.getProductImage = "/web//sailun/bizProductImage/storeProductItem";
  225. //收货地址查询
  226. this.getReceiptAddress = "/web/sys/bizReceiptAddress/list";
  227. // 立即下单
  228. this.immediatelyOrder = "/web/biz/bizShopIntegralOrder/immediatelyOrder";
  229. //查找更换收后地址
  230. this.updateAddress = "/web/sys/bizReceiptAddress/update";
  231. //删除收货地址
  232. this.addressDel="/web/sys/bizReceiptAddress/delete";
  233. //根据商品名搜索积分商品
  234. this.searchShop="/web/biz/bizCart/appSelectProduct";
  235. //查找订单
  236. this.searchOrder="/web/biz/bizIntegralOrderItem/selectIntegralOrderProduct"
  237. //消息列表
  238. this.getMsg="/web/sailun/bizMessageForUser/getMessageCategory";
  239. //消息详情
  240. this.getMsgdetails="/web/sailun/bizMessageForUser/list";
  241. //消息已阅
  242. this.updateMessage="/web/sailun/bizMessageForUser/updateMessage";
  243. //修改签约地址
  244. this.updatesign="/web/biz/bizStoreUpdateMessage/save";
  245. //查看签约地址
  246. this.getsignAddress="/web/biz/bizStoreUpdateMessage/list";
  247. //查看核销详情页
  248. this.hexiaoInfo="/web/biz/bizCoupon/list";
  249. //季度任务数据
  250. this.selectQuarter="/web/biz/bizScanRecord/selectQuarter";
  251. //提交用户信息
  252. this.MobileMessage="/web/biz/bizMobileMessage/save";
  253. //修改签约
  254. this.SignlvUpdate="/web/biz/bizStoreUpdateSignlv/save";
  255. //查看签约
  256. this.SignlvList="/web/biz/bizStoreUpdateSignlv/list";
  257. /**********************************车主下单功能***********************************/
  258. //根据门店id获取所有门店微信订单信息
  259. this.getAllUndealCarOrder="/web/sailun/wxCarorderHead/caroder/getAllUndealCarOrderByStoreId";
  260. this.getOrderInfo = "/web/sailun/wxCarorderHead/carorder/getOrderInfoById";
  261. this.getStoreToMaktxInfoByBSP = "/web/biz/bizGoods/getStoreToMaktxInfoByBSP";
  262. this.updateStoreToMaktxInfoByBSP = "/web/biz/bizGoods/updateStoreToMaktxInfoByBSP";
  263. this.changeWxCarOrderStatus = "/web/sailun/wxCarorderHead/carorder/changeWxCarOrderStatus";
  264. /**********************************对账功能***********************************/
  265. this.getConfirmMonth = "/web/biz/bizMonthDetail/getConfirmMonth";//获取已确认的月份
  266. this.getMonthDetail = "/web/biz/bizMonthDetail/getMonthDetail";//获取月结明细
  267. this.confirmMonthDetail = "/web/biz/bizMonthDetail/confirmMonthDetail";//确认月结明细
  268. this.getRegistTime = "/web/biz/bizMonthDetail/getRegistTime";//获取门店注册时间
  269. //通过图片获取信息
  270. this.licenseDiscern="/web/bizLogin/licenseDiscern";
  271. //运营执行信息是否有效
  272. this.verifyBusiness="/web/bizLogin/verifyBusiness";
  273. //上传运营图片
  274. this.storeUpdatalicense="/web/biz/bizStoreBasicInfo/storeUpdateLicense"
  275. //解冻
  276. this.storeUnfreezeProposer="/web/biz/bizAgentFunction/storeUnfreezeProposer"
  277. // 获取修改提示
  278. this.getStoreSignMessage= "/web/biz/getStoreSignMessage"
  279. }
  280. $http.prototype.$postFile = function (url, data, callback) {
  281. var urlT = this.ip + eval('this.' + url);
  282. api.ajax({
  283. url: urlT,
  284. method: 'post',
  285. data: {
  286. values: data
  287. },
  288. headers: {
  289. "Content-type": "multipart/form-data"
  290. },
  291. }, function (ret, err) {
  292. api.hideProgress();
  293. api.refreshHeaderLoadDone();
  294. if (ret) {
  295. callback(ret);
  296. } else {
  297. api.toast({
  298. msg: '当前网络不稳定,请稍后再试'
  299. });
  300. }
  301. });
  302. }
  303. // api的ajax
  304. $http.prototype.$post = function (url, data, callback, other) {
  305. var content = "", urlT = "", _this = this;
  306. if (data.url == "json") {
  307. delete data.url;
  308. // 确认contenttype选项
  309. content = "application/json;charset=UTF-8";
  310. } else if (data.url == "file") {
  311. data = [{}, {
  312. file: data[1].file
  313. }]
  314. content = "application/json;charset=UTF-8";
  315. } else {
  316. content = "application/x-www-form-urlencoded"
  317. }
  318. var datas = this.serize(data);
  319. if (typeof other != 'undefined' && other != "" && other != 'undefined') {
  320. urlT = this.ip + eval('this.' + url) + '/' + other;
  321. } else {
  322. urlT = this.ip + eval('this.' + url);
  323. }
  324. api.showProgress({
  325. });
  326. if (this.ajax == true) {
  327. return;
  328. }
  329. this.ajax = true;
  330. api.ajax({
  331. url: urlT,
  332. method: 'post',
  333. data: datas,
  334. headers: {
  335. "Content-type": content,
  336. },
  337. }, function (ret, err) {
  338. _this.ajax = false;
  339. api.hideProgress();
  340. api.refreshHeaderLoadDone();
  341. if (ret) {
  342. callback(ret);
  343. } else {
  344. api.toast({
  345. msg: '当前网络不稳定,请稍后再试'
  346. });
  347. }
  348. });
  349. }
  350. //特殊post api
  351. $http.prototype.$postuser = function (url, data, callback, other) {
  352. var content = "", urlT = "", _this = this;
  353. if (data.url == "json") {
  354. delete data.url;
  355. // 确认contenttype选项
  356. content = "application/json;charset=UTF-8";
  357. } else if (data.url == "file") {
  358. data = [{}, {
  359. file: data[1].file
  360. }]
  361. content = "application/json;charset=UTF-8";
  362. } else {
  363. content = "application/x-www-form-urlencoded"
  364. }
  365. var datas = this.serize(data);
  366. if (typeof other != 'undefined' && other != "" && other != 'undefined') {
  367. urlT = this.ip + eval('this.' + url) + '/' + other;
  368. } else {
  369. urlT = this.ip + eval('this.' + url);
  370. }
  371. api.showProgress({
  372. });
  373. if (this.ajax == true) {
  374. return;
  375. }
  376. this.ajax = true;
  377. api.ajax({
  378. url: urlT,
  379. method: 'post',
  380. data: datas,
  381. headers: {
  382. "Content-type": content,
  383. },
  384. }, function (ret, err) {
  385. _this.ajax = false;
  386. api.hideProgress();
  387. api.refreshHeaderLoadDone();
  388. if (ret) {
  389. callback(ret);
  390. } else {
  391. api.toast({
  392. msg: '当前网络不稳定,请稍后再试'
  393. });
  394. }
  395. });
  396. }
  397. // 单独的get请求
  398. $http.prototype.$getadd = function (url, data, callback, other) {
  399. var _this = this;
  400. api.showProgress({
  401. });
  402. this.ajax = true;
  403. api.ajax({
  404. url: this.ip + eval('this.' + url) + data,
  405. method: 'get',
  406. data: {
  407. values: {
  408. }
  409. },
  410. headers: {
  411. "Content-type": "application/json;charset=UTF-8"
  412. },
  413. }, function (ret, err) {
  414. _this.ajax = false;
  415. api.hideProgress();
  416. api.refreshHeaderLoadDone();
  417. if (ret) {
  418. callback(ret);
  419. } else {
  420. api.toast({
  421. msg: '当前网络不稳定,请稍后再试'
  422. });
  423. }
  424. });
  425. }
  426. // get获取
  427. $http.prototype.$get = function (url, data, callback, other) {
  428. var content = "", urlT = "", _this = this;
  429. if (data.url == "json") {
  430. delete data.url;
  431. // 确认contenttype选项
  432. content = "application/json;charset=UTF-8";
  433. } else {
  434. content = "application/x-www-form-urlencoded"
  435. }
  436. var datas = this.serize(data);
  437. if (typeof other != 'undefined' && other != "" && other != 'undefined') {
  438. urlT = this.ip + eval('this.' + url) + '/' + other;
  439. } else {
  440. urlT = this.ip + eval('this.' + url);
  441. }
  442. api.showProgress({
  443. });
  444. if (this.ajax == true) {
  445. return;
  446. }
  447. this.ajax = true;
  448. api.ajax({
  449. url: urlT,
  450. method: 'get',
  451. data: {
  452. values: {
  453. }
  454. },
  455. headers: {
  456. "Content-type": "application/json;charset=UTF-8"
  457. },
  458. }, function (ret, err) {
  459. _this.ajax = false;
  460. api.hideProgress();
  461. api.refreshHeaderLoadDone();
  462. if (ret) {
  463. callback(ret);
  464. } else {
  465. api.toast({
  466. msg: '当前网络不稳定,请稍后再试'
  467. });
  468. }
  469. });
  470. }
  471. // 在链接后面拼接参数
  472. $http.prototype.$getOption = function (url, other, callback) {
  473. var _this = this;
  474. api.showProgress({
  475. });
  476. if (typeof other != 'undefined' && other != "" && other != 'undefined') {
  477. urlT = this.ip + eval('this.' + url) + '?' + other;
  478. } else {
  479. urlT = this.ip + eval('this.' + url);
  480. }
  481. api.ajax({
  482. url: urlT,
  483. method: 'get',
  484. data: {
  485. values: {
  486. }
  487. },
  488. headers: {
  489. "Content-type": "application/json;charset=UTF-8"
  490. },
  491. }, function (ret, err) {
  492. _this.ajax = false;
  493. api.hideProgress();
  494. api.refreshHeaderLoadDone();
  495. if (ret) {
  496. callback(ret);
  497. } else {
  498. api.toast({
  499. msg: '当前网络不稳定,请稍后再试'
  500. });
  501. }
  502. });
  503. }
  504. // 单独的有文件名字的上传文件
  505. $http.prototype.uploadfile = function (url, data, callback) {
  506. var _this = this;
  507. var urlT = this.ip + eval('this.' + url);
  508. var formdata = new FormData();
  509. formdata.append('file', data.file);
  510. formdata.append('type', data.type);
  511. api.showProgress({
  512. });
  513. $.ajax({
  514. url: urlT,
  515. type: "POST",
  516. data: formdata,
  517. processData: false, // 告诉jQuery不要去处理发送的数据
  518. contentType: false, // 告诉jQuery不要去设置Content-Type请求头
  519. success: function (ret, status, xhr) {
  520. api.hideProgress();
  521. if (ret.code == 0 || ret.code == '0') {
  522. callback(ret);
  523. }
  524. }
  525. });
  526. }
  527. // 对数据进行处理,第一个为values,第二个为file body
  528. $http.prototype.serize = function (data) {
  529. var serizeData;
  530. if (data instanceof Array) {
  531. if (data.length == 1) {
  532. serizeData = {
  533. values: data[0]
  534. }
  535. } else {
  536. serizeData = {
  537. values: data[0],
  538. files: data[1]
  539. }
  540. }
  541. } else {
  542. if (data.type == 'body') {
  543. delete data.type;
  544. if (data.yy == 'keng') {
  545. delete data.yy
  546. serizeData = {
  547. body: data.id
  548. }
  549. } else {
  550. serizeData = {
  551. body: data
  552. }
  553. }
  554. } else {
  555. serizeData = {
  556. values: data
  557. }
  558. }
  559. }
  560. return serizeData;
  561. }
  562. function alertJson(str) {
  563. alert(JSON.stringify(str));
  564. }