httpRequest.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  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. $http.prototype.$postFile = function (url, data, callback) {
  279. var urlT = this.ip + eval('this.' + url);
  280. api.ajax({
  281. url: urlT,
  282. method: 'post',
  283. data: {
  284. values: data
  285. },
  286. headers: {
  287. "Content-type": "multipart/form-data"
  288. },
  289. }, function (ret, err) {
  290. api.hideProgress();
  291. api.refreshHeaderLoadDone();
  292. if (ret) {
  293. callback(ret);
  294. } else {
  295. api.toast({
  296. msg: '当前网络不稳定,请稍后再试'
  297. });
  298. }
  299. });
  300. }
  301. // api的ajax
  302. $http.prototype.$post = function (url, data, callback, other) {
  303. var content = "", urlT = "", _this = this;
  304. if (data.url == "json") {
  305. delete data.url;
  306. // 确认contenttype选项
  307. content = "application/json;charset=UTF-8";
  308. } else if (data.url == "file") {
  309. data = [{}, {
  310. file: data[1].file
  311. }]
  312. content = "application/json;charset=UTF-8";
  313. } else {
  314. content = "application/x-www-form-urlencoded"
  315. }
  316. var datas = this.serize(data);
  317. if (typeof other != 'undefined' && other != "" && other != 'undefined') {
  318. urlT = this.ip + eval('this.' + url) + '/' + other;
  319. } else {
  320. urlT = this.ip + eval('this.' + url);
  321. }
  322. api.showProgress({
  323. });
  324. if (this.ajax == true) {
  325. return;
  326. }
  327. this.ajax = true;
  328. api.ajax({
  329. url: urlT,
  330. method: 'post',
  331. data: datas,
  332. headers: {
  333. "Content-type": content,
  334. },
  335. }, function (ret, err) {
  336. _this.ajax = false;
  337. api.hideProgress();
  338. api.refreshHeaderLoadDone();
  339. if (ret) {
  340. callback(ret);
  341. } else {
  342. api.toast({
  343. msg: '当前网络不稳定,请稍后再试'
  344. });
  345. }
  346. });
  347. }
  348. //特殊post api
  349. $http.prototype.$postuser = function (url, data, callback, other) {
  350. var content = "", urlT = "", _this = this;
  351. if (data.url == "json") {
  352. delete data.url;
  353. // 确认contenttype选项
  354. content = "application/json;charset=UTF-8";
  355. } else if (data.url == "file") {
  356. data = [{}, {
  357. file: data[1].file
  358. }]
  359. content = "application/json;charset=UTF-8";
  360. } else {
  361. content = "application/x-www-form-urlencoded"
  362. }
  363. var datas = this.serize(data);
  364. if (typeof other != 'undefined' && other != "" && other != 'undefined') {
  365. urlT = this.ip + eval('this.' + url) + '/' + other;
  366. } else {
  367. urlT = this.ip + eval('this.' + url);
  368. }
  369. api.showProgress({
  370. });
  371. if (this.ajax == true) {
  372. return;
  373. }
  374. this.ajax = true;
  375. api.ajax({
  376. url: urlT,
  377. method: 'post',
  378. data: datas,
  379. headers: {
  380. "Content-type": content,
  381. },
  382. }, function (ret, err) {
  383. _this.ajax = false;
  384. api.hideProgress();
  385. api.refreshHeaderLoadDone();
  386. if (ret) {
  387. callback(ret);
  388. } else {
  389. api.toast({
  390. msg: '当前网络不稳定,请稍后再试'
  391. });
  392. }
  393. });
  394. }
  395. // 单独的get请求
  396. $http.prototype.$getadd = function (url, data, callback, other) {
  397. var _this = this;
  398. api.showProgress({
  399. });
  400. this.ajax = true;
  401. api.ajax({
  402. url: this.ip + eval('this.' + url) + data,
  403. method: 'get',
  404. data: {
  405. values: {
  406. }
  407. },
  408. headers: {
  409. "Content-type": "application/json;charset=UTF-8"
  410. },
  411. }, function (ret, err) {
  412. _this.ajax = false;
  413. api.hideProgress();
  414. api.refreshHeaderLoadDone();
  415. if (ret) {
  416. callback(ret);
  417. } else {
  418. api.toast({
  419. msg: '当前网络不稳定,请稍后再试'
  420. });
  421. }
  422. });
  423. }
  424. // get获取
  425. $http.prototype.$get = function (url, data, callback, other) {
  426. var content = "", urlT = "", _this = this;
  427. if (data.url == "json") {
  428. delete data.url;
  429. // 确认contenttype选项
  430. content = "application/json;charset=UTF-8";
  431. } else {
  432. content = "application/x-www-form-urlencoded"
  433. }
  434. var datas = this.serize(data);
  435. if (typeof other != 'undefined' && other != "" && other != 'undefined') {
  436. urlT = this.ip + eval('this.' + url) + '/' + other;
  437. } else {
  438. urlT = this.ip + eval('this.' + url);
  439. }
  440. api.showProgress({
  441. });
  442. if (this.ajax == true) {
  443. return;
  444. }
  445. this.ajax = true;
  446. api.ajax({
  447. url: urlT,
  448. method: 'get',
  449. data: {
  450. values: {
  451. }
  452. },
  453. headers: {
  454. "Content-type": "application/json;charset=UTF-8"
  455. },
  456. }, function (ret, err) {
  457. _this.ajax = false;
  458. api.hideProgress();
  459. api.refreshHeaderLoadDone();
  460. if (ret) {
  461. callback(ret);
  462. } else {
  463. api.toast({
  464. msg: '当前网络不稳定,请稍后再试'
  465. });
  466. }
  467. });
  468. }
  469. // 在链接后面拼接参数
  470. $http.prototype.$getOption = function (url, other, callback) {
  471. var _this = this;
  472. api.showProgress({
  473. });
  474. if (typeof other != 'undefined' && other != "" && other != 'undefined') {
  475. urlT = this.ip + eval('this.' + url) + '?' + other;
  476. } else {
  477. urlT = this.ip + eval('this.' + url);
  478. }
  479. api.ajax({
  480. url: urlT,
  481. method: 'get',
  482. data: {
  483. values: {
  484. }
  485. },
  486. headers: {
  487. "Content-type": "application/json;charset=UTF-8"
  488. },
  489. }, function (ret, err) {
  490. _this.ajax = false;
  491. api.hideProgress();
  492. api.refreshHeaderLoadDone();
  493. if (ret) {
  494. callback(ret);
  495. } else {
  496. api.toast({
  497. msg: '当前网络不稳定,请稍后再试'
  498. });
  499. }
  500. });
  501. }
  502. // 单独的有文件名字的上传文件
  503. $http.prototype.uploadfile = function (url, data, callback) {
  504. var _this = this;
  505. var urlT = this.ip + eval('this.' + url);
  506. var formdata = new FormData();
  507. formdata.append('file', data.file);
  508. formdata.append('type', data.type);
  509. api.showProgress({
  510. });
  511. $.ajax({
  512. url: urlT,
  513. type: "POST",
  514. data: formdata,
  515. processData: false, // 告诉jQuery不要去处理发送的数据
  516. contentType: false, // 告诉jQuery不要去设置Content-Type请求头
  517. success: function (ret, status, xhr) {
  518. api.hideProgress();
  519. if (ret.code == 0 || ret.code == '0') {
  520. callback(ret);
  521. }
  522. }
  523. });
  524. }
  525. // 对数据进行处理,第一个为values,第二个为file body
  526. $http.prototype.serize = function (data) {
  527. var serizeData;
  528. if (data instanceof Array) {
  529. if (data.length == 1) {
  530. serizeData = {
  531. values: data[0]
  532. }
  533. } else {
  534. serizeData = {
  535. values: data[0],
  536. files: data[1]
  537. }
  538. }
  539. } else {
  540. if (data.type == 'body') {
  541. delete data.type;
  542. if (data.yy == 'keng') {
  543. delete data.yy
  544. serizeData = {
  545. body: data.id
  546. }
  547. } else {
  548. serizeData = {
  549. body: data
  550. }
  551. }
  552. } else {
  553. serizeData = {
  554. values: data
  555. }
  556. }
  557. }
  558. return serizeData;
  559. }
  560. function alertJson(str) {
  561. alert(JSON.stringify(str));
  562. }