edit-xuetangyi.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. var rowData = {};
  2. var sn = ""; //记录sn码
  3. var dataId = null;
  4. var type = null;
  5. var name = null;
  6. var type = null;
  7. var photoUrl = null;
  8. var deviceId = null;
  9. var oldSn = ""; //旧sn
  10. var sncode = '';
  11. var showDateDom1 = null;
  12. var showDateDom2 = null;
  13. var showDateDom3 = null;
  14. var showDateDom4 = null;
  15. var showDateDom5 = null;
  16. var showDateDom6 = null;
  17. var showDateDom7 = null;
  18. var categoryCode = '';
  19. var prescriptionCode;
  20. var $szTime = $('.sz-time');
  21. var d = dialog({
  22. contentType: 'load',
  23. skin: 'bk-popup'
  24. }),
  25. tips = ['早餐前血糖', '早餐后血糖', '午餐前血糖', '午餐后血糖', '晚餐前血糖', '晚餐后血糖', '睡前血糖'];
  26. $(function() {
  27. Request = GetRequest();
  28. dataId = Request["id"];
  29. deviceId = Request["deviceId"];
  30. prescriptionCode = Request["prescriptionCode"];
  31. categoryCode = Request["categoryCode"];
  32. $('#member').val(window.localStorage.getItem('nowPatientName'));
  33. getDeviceInfo(deviceId);
  34. bindEvents();
  35. if(dataId) {
  36. $(document).attr("title", "编辑血糖仪");
  37. initData(dataId);
  38. $('.xt-time-list').show();
  39. $("#bang-btn").html("保存");
  40. showDateDom1 = $('#mobIn1');
  41. showDateDom2 = $('#mobIn2');
  42. showDateDom3 = $('#mobIn3');
  43. showDateDom4 = $('#mobIn4');
  44. showDateDom5 = $('#mobIn5');
  45. showDateDom6 = $('#mobIn6');
  46. showDateDom7 = $('#mobIn7');
  47. } else {
  48. $(document).attr("title", "新增血糖仪");
  49. }
  50. $("#bang-btn").addClass("active");
  51. weixinSign();
  52. });
  53. function initData(dataId) {
  54. var params = {};
  55. params.id = dataId;
  56. sendPost("patient/device/PatientDeviceInfo", params, "JSON", "GET",
  57. function(res) {
  58. if(res.msg) {
  59. dialog({
  60. contentType: 'tipsbox',
  61. skin: 'bk-popup',
  62. content: res.msg
  63. }).show();
  64. } else {
  65. dialog({
  66. contentType: 'tipsbox',
  67. skin: 'bk-popup',
  68. bottom: true,
  69. content: '设备信息初始化失败!'
  70. }).show();
  71. }
  72. },
  73. function(res) {
  74. if(res.status == 200) {
  75. rowData = res.data;
  76. oldSn = rowData.device.deviceSn;
  77. $("#sncode").val(rowData.device.deviceSn);
  78. sncode = rowData.device.deviceSn;
  79. console.log(rowData);
  80. var fasting = (rowData.time['fasting'].replace(/ /g, '')).split('-'),
  81. afterBreakFast = (rowData.time['afterBreakFast'].replace(/ /g, '')).split('-'),
  82. beforeLunch = (rowData.time['beforeLunch'].replace(/ /g, '')).split('-'),
  83. afterLunch = (rowData.time['afterLunch'].replace(/ /g, '')).split('-'),
  84. beforeDinner = (rowData.time['beforeDinner'].replace(/ /g, '')).split('-'),
  85. afterDinner = (rowData.time['afterDinner'].replace(/ /g, '')).split('-'),
  86. beforeSleep = (rowData.time['beforeSleep'].replace(/ /g, '')).split('-');
  87. showDateDom1.val(fasting[0].substring(0,5) + '-' + fasting[1].substring(0,5));
  88. showDateDom2.val(afterBreakFast[0].substring(0,5) + '-' + afterBreakFast[1].substring(0,5));
  89. showDateDom3.val(beforeLunch[0].substring(0,5) + '-' + beforeLunch[1].substring(0,5));
  90. showDateDom4.val(afterLunch[0].substring(0,5) + '-' + afterLunch[1].substring(0,5));
  91. showDateDom5.val(beforeDinner[0].substring(0,5) + '-' + beforeDinner[1].substring(0,5));
  92. showDateDom6.val(afterDinner[0].substring(0,5) + '-' + afterDinner[1].substring(0,5));
  93. showDateDom7.val(beforeSleep[0].substring(0,5) + '-' + beforeSleep[1].substring(0,5));
  94. loadTime();
  95. } else {
  96. dialog({
  97. contentType: 'tipsbox',
  98. skin: 'bk-popup',
  99. bottom: true,
  100. content: '设备信息初始化失败!'
  101. }).show();
  102. }
  103. }
  104. )
  105. }
  106. //判断值是否改变过
  107. function isValueChange() {
  108. var changeTagStr = $("#sncode").val();
  109. if(oldSn != changeTagStr) {
  110. }
  111. }
  112. //绑定事件
  113. function bindEvents() {
  114. $('#sncode').on('click', function() {
  115. $(this).focus();
  116. });
  117. //保存方法
  118. $("#bang-btn").bind("click", function() {
  119. if($(this).hasClass("active")) {
  120. var snCode = $("#sncode").val();
  121. if(snCode == null || snCode == "") {
  122. dialog({
  123. contentType: 'tipsbox',
  124. skin: 'bk-popup',
  125. bottom: true,
  126. content: '请输入设备的SN码进行绑定!'
  127. }).show();
  128. } else {
  129. if(!dataId) {
  130. $("#bang-btn").html("正在绑定").css("pointer-events", "none");
  131. }
  132. d.show();
  133. checkSnBind(snCode, checkSuccess);
  134. }
  135. }
  136. })
  137. $(".scanText").on('click', function(){
  138. wx.scanQRCode({
  139. desc: 'scanQRCode desc',
  140. needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
  141. scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码,默认二者都有
  142. success: function (res) {
  143. // 回调
  144. var code = res.resultStr,
  145. arr = code.split(",");//因为微信扫描条形码的时候,会带上这个码的类型,所以取数组后的码显示
  146. $("#sncode").val(arr[1]);
  147. },
  148. error: function(res){
  149. if(res.errMsg.indexOf('function_not_exist') > 0){
  150. alert('版本过低请升级')
  151. }
  152. }
  153. });
  154. })
  155. }
  156. function checkSnBind(snCode, checkSuccess) {
  157. if (dataId && snCode == oldSn) {
  158. addData(snCode);
  159. } else {
  160. var b = /^[0-9a-zA-Z]*$/g;
  161. if(!b.test(snCode)) {
  162. setTimeout(function() {
  163. $("#bang-btn").html("立即绑定").css("pointer-events", "");
  164. }, 3000);
  165. d.close();
  166. dialog({
  167. contentType: 'tipsbox',
  168. skin: 'bk-popup',
  169. bottom: true,
  170. content: '对不起,您输入的SN有误,请重新输入!'
  171. }).show();
  172. return false;
  173. }
  174. var params = {};
  175. params.type = type;
  176. params.device_sn = snCode;
  177. $.ajax(server + "patient/device/PatientDeviceIdcard", {
  178. data: params,
  179. dataType: "JSON",
  180. async: false,
  181. type: "get",
  182. timeout: 10000,
  183. beforeSend: function(request) {
  184. var userAgent = window.localStorage.getItem(agentName);
  185. request.setRequestHeader("userAgent", userAgent);
  186. },
  187. error: function(res) {
  188. dialog({
  189. contentType: 'tipsbox',
  190. skin: 'bk-popup',
  191. bottom: true,
  192. content: '设备SN校验失败!'
  193. }).show();
  194. setTimeout(function() {
  195. $("#bang-btn").html("立即绑定").css("pointer-events", "");
  196. d.close();
  197. }, 3000);
  198. },
  199. success: function(res) {
  200. setTimeout(function() {
  201. $("#bang-btn").html("立即绑定").css("pointer-events", "");
  202. d.close();
  203. }, 3000);
  204. if(res.status == 200) {
  205. var name = "";
  206. var others = null;
  207. for(var j in res.data) {
  208. name = res.data[j].name;
  209. others = res.data[j].others
  210. }
  211. //没被绑定
  212. if(name == "") {
  213. $("#bang-btn").addClass("active");
  214. if(dataId){
  215. editSN(snCode);
  216. } else {
  217. if(checkSuccess != null) {
  218. checkSuccess(snCode);
  219. }
  220. }
  221. } else if(others != null && others == 1) {
  222. // $("#bang-btn").removeClass("active");
  223. //被绑定而且被别人绑定
  224. dialog({
  225. contentType: 'tipsbox',
  226. skin: 'bk-popup',
  227. bottom: true,
  228. content: '该设备已被他人绑定,设备解绑后,方可再次绑定!'
  229. }).show();
  230. } else if(others != null && others == 0) {
  231. // $("#bang-btn").removeClass("active");
  232. if(deviceId == null || !deviceId || deviceId == "") {
  233. //新增,编辑/被自己绑定
  234. dialog({
  235. contentType: 'tipsbox',
  236. skin: 'bk-popup',
  237. bottom: true,
  238. content: '对不起,您已绑定过该设备,解绑后方可继续绑定!'
  239. }).show();
  240. } else {
  241. if(dataId){
  242. editSN(snCode);
  243. } else {
  244. if(checkSuccess != null) {
  245. checkSuccess(snCode);
  246. }
  247. }
  248. }
  249. }
  250. } else {
  251. dialog({
  252. contentType: 'tipsbox',
  253. skin: 'bk-popup',
  254. bottom: true,
  255. content: '该设备已被他人绑定,设备解绑后,方可再次绑定!'
  256. }).show();
  257. }
  258. }
  259. });
  260. }
  261. }
  262. function getDeviceInfo(deviceId) {
  263. sendPost("/common/device/DeviceInfo?id=" + deviceId, {}, "JSON", "GET",
  264. function(res) {
  265. dialog({
  266. contentType: 'tipsbox',
  267. skin: 'bk-popup',
  268. bottom: true,
  269. content: '设备信息获取失败!'
  270. }).show();
  271. },
  272. function(res) {
  273. if(res.status == 200) {
  274. var rowData1 = res.data;
  275. type = rowData1.categoryCode;
  276. name = rowData1.name;
  277. photoUrl = getImgUrl(rowData1.photo);
  278. $(".deviceName").html(name);
  279. $(".div-xuetangyi-img img").attr("src", photoUrl);
  280. } else {
  281. dialog({
  282. contentType: 'tipsbox',
  283. skin: 'bk-popup',
  284. bottom: true,
  285. content: '设备信息获取失败!'
  286. }).show();
  287. }
  288. }
  289. )
  290. }
  291. function checkSuccess(snCode) {
  292. var name1 = "血糖仪-" + name;
  293. var params = {};
  294. params.deviceId = deviceId; //设备ID
  295. params.deviceName = name1; //设备名称
  296. params.deviceSn = snCode; //设备SN码
  297. params.categoryCode = type; //设备分类 血糖仪1 血压计 2
  298. params.userType = "-1"; //是否多用户
  299. if(rowData.id) {
  300. params.id = rowData.id;
  301. }
  302. sendPost("/patient/device/SavePatientDevice", {
  303. "json": JSON.stringify(params)
  304. }, "JSON", "post",
  305. function(res) {
  306. dialog({
  307. contentType: 'tipsbox',
  308. skin: 'bk-popup',
  309. bottom: true,
  310. content: '设备绑定失败!'
  311. }).show();
  312. },
  313. function(res) {
  314. if(res.status == 200) {
  315. dialog({
  316. contentType: 'tipsbox',
  317. skin: 'bk-popup',
  318. bottom: true,
  319. content: '设备绑定成功!'
  320. }).show();
  321. setTimeout(function() {
  322. window.location.href = 'view-shezhishijianduan.html?type=1&sncode=' + $('#sncode').val()+'&categoryCode='+type;
  323. }, 500);
  324. } else {
  325. dialog({
  326. contentType: 'tipsbox',
  327. skin: 'bk-popup',
  328. bottom: true,
  329. content: res.msg
  330. }).show();
  331. return false;
  332. }
  333. }
  334. )
  335. }
  336. function checkDate(v, index) {
  337. if(v == '') {
  338. switch(index) {
  339. case 0:
  340. dialog({
  341. contentType: 'tipsbox',
  342. skin: 'bk-popup',
  343. bottom: true,
  344. content: tips[index]
  345. }).show();
  346. break;
  347. case 1:
  348. dialog({
  349. contentType: 'tipsbox',
  350. skin: 'bk-popup',
  351. bottom: true,
  352. content: tips[index]
  353. }).show();
  354. break;
  355. case 2:
  356. dialog({
  357. contentType: 'tipsbox',
  358. skin: 'bk-popup',
  359. bottom: true,
  360. content: tips[index]
  361. }).show();
  362. break;
  363. case 3:
  364. dialog({
  365. contentType: 'tipsbox',
  366. skin: 'bk-popup',
  367. bottom: true,
  368. content: tips[index]
  369. }).show();
  370. break;
  371. case 4:
  372. dialog({
  373. contentType: 'tipsbox',
  374. skin: 'bk-popup',
  375. bottom: true,
  376. content: tips[index]
  377. }).show();
  378. break;
  379. case 5:
  380. dialog({
  381. contentType: 'tipsbox',
  382. skin: 'bk-popup',
  383. bottom: true,
  384. content: tips[index]
  385. }).show();
  386. break;
  387. case 6:
  388. dialog({
  389. contentType: 'tipsbox',
  390. skin: 'bk-popup',
  391. bottom: true,
  392. content: tips[index]
  393. }).show();
  394. break;
  395. }
  396. d.close();
  397. return true;
  398. }
  399. return false;
  400. }
  401. function editSN (snCode) {
  402. var o = {};
  403. o.deviceSN = oldSn;
  404. o.newDeviceSN = snCode;
  405. o.categoryCode = categoryCode;
  406. o.userType = "-1"; //是否多用户
  407. sendPost("patient/device/setBloodTime", o, "json", "get", null, function(res) {
  408. d.close();
  409. if(res.status == 200) {
  410. addData(snCode);
  411. } else {
  412. dialog({
  413. contentType: 'tipsbox',
  414. bottom: true,
  415. skin: 'bk-popup',
  416. content: res.msg
  417. }).show();
  418. }
  419. });
  420. }
  421. //添加数据
  422. function addData(snCode) {
  423. d.show();
  424. var o = {},
  425. isTrue = false,
  426. isGo = false;
  427. o.deviceSN = snCode;
  428. o.userType = "-1"; //是否多用户
  429. o.categoryCode = categoryCode;
  430. $.each($szTime, function(index) {
  431. var tArr = ($(this).val()).split('-');
  432. if(!isTrue) {
  433. isTrue = checkDate($(this).val(), index);
  434. isGo = checkDate($(this).val(), index);
  435. switch(index) {
  436. case 0:
  437. o.fastingStart = tArr[0] + ':00';
  438. o.fastingEnd = tArr[1] + ':59';
  439. break;
  440. case 1:
  441. o.afterBreakfastStart = tArr[0] + ':00';
  442. o.afterBreakfastEnd = tArr[1] + ':59';
  443. break;
  444. case 2:
  445. o.beforeLunchStart = tArr[0] + ':00';
  446. o.beforeLunchEnd = tArr[1] + ':59';
  447. break;
  448. case 3:
  449. o.afterLunchStart = tArr[0] + ':00';
  450. o.afterLunchEnd = tArr[1] + ':59';
  451. break;
  452. case 4:
  453. o.beforeDinnerStart = tArr[0] + ':00';
  454. o.beforeDinnerEnd = tArr[1] + ':59';
  455. break;
  456. case 5:
  457. o.afterDinnerStart = tArr[0] + ':00';
  458. o.afterDinnerEnd = tArr[1] + ':59';
  459. break;
  460. case 6:
  461. o.beforeSleepStart = tArr[0] + ':00';
  462. o.beforeSleepEnd = tArr[1] + ':59';
  463. break;
  464. }
  465. }
  466. });
  467. if(!isGo) {
  468. sendPost("patient/device/setBloodTime", o, "json", "get", null, function(res) {
  469. d.close();
  470. if(res.status == 200) {
  471. dialog({
  472. contentType: 'tipsbox',
  473. bottom: true,
  474. skin: 'bk-popup',
  475. content: res.msg
  476. }).show();
  477. setTimeout(function() {
  478. if(prescriptionCode){
  479. window.history.go(-3);
  480. }else{
  481. window.location.href='my-equipments.html';
  482. }
  483. }, 500);
  484. } else {
  485. dialog({
  486. contentType: 'tipsbox',
  487. bottom: true,
  488. skin: 'bk-popup',
  489. content: '保存失败'
  490. }).show();
  491. }
  492. });
  493. }
  494. }
  495. function loadTime() {
  496. var iosSelect1 = null;
  497. var iosSelect2 = null;
  498. var iosSelect3 = null;
  499. var iosSelect4 = null;
  500. var iosSelect5 = null;
  501. var iosSelect6 = null;
  502. var iosSelect7 = null;
  503. var starNum1 = 0;
  504. var starNum2 = 0;
  505. // 初始化时间
  506. var now = new Date();
  507. var nowHours = now.getHours();
  508. var nowSeconds = now.getMinutes();
  509. for(var i = 1; i <= 7; i++) {
  510. var d = $('#mobIn' + i),
  511. // d2 = $('#mobIn' + (i - 1)),
  512. aArr = (d.val()).split('-');
  513. d.attr('data-hours', (aArr[0].split(':'))[0]);
  514. d.attr('data-seconds', (aArr[0].split(':'))[1]);
  515. d.attr('data-thours', (aArr[1].split(':'))[0]);
  516. d.attr('data-tseconds', (aArr[1].split(':'))[1]);
  517. }
  518. // 数据初始化
  519. function cN(v) {
  520. return v < 10 ? '0' + v : v;
  521. }
  522. function formatHours(s) {
  523. var arr = [];
  524. for(var i = s; i <= 23; i++) {
  525. arr.push({
  526. id: cN(i) + '',
  527. value: cN(i)
  528. });
  529. }
  530. return arr;
  531. }
  532. function formatSeconds(s) {
  533. var arr = [];
  534. for(var i = s; i <= 59; i++) {
  535. arr.push({
  536. id: cN(i) + '',
  537. value: cN(i)
  538. });
  539. }
  540. return arr;
  541. }
  542. var hoursData = function(callback) {
  543. callback(formatHours(starNum1));
  544. };
  545. var secondData = function(h, callback) {
  546. callback(formatSeconds(starNum2))
  547. };
  548. var hoursTData = function(h, s, callback) {
  549. h = parseInt(h);
  550. callback(formatHours(h));
  551. };
  552. var secondTData = function(h, s, h1, callback) {
  553. s = parseInt(s);
  554. callback(formatSeconds(0))
  555. };
  556. for(var i = 1; i <= 7; i++) {
  557. $('#mobIn' + i).on('click', function() {
  558. var $me = $(this),
  559. aArr = ($me.val()).split('-');
  560. // d.attr('data-hours', (aArr[0].split(':'))[0]);
  561. // d.attr('data-seconds', (aArr[0].split(':'))[1]);
  562. // d.attr('data-thours', (aArr[1].split(':'))[0]);
  563. // d.attr('data-tseconds', (aArr[1].split(':'))[1]);
  564. var oneLevelId = parseInt(aArr[0].split(':')[0]);
  565. var twoLevelId = parseInt(aArr[0].split(':')[1]);
  566. var threeLevelId = parseInt(aArr[1].split(':')[0]);
  567. var fourLevelId = parseInt(aArr[1].split(':')[1]);
  568. var st = parseInt($me.attr('data-thours'));
  569. var $n = $me.closest('.time-item').next(),
  570. $p = $me.closest('.time-item').prev(),
  571. ind = $me.closest('.time-item').index();
  572. if($p.length) {
  573. if(!$p.find('input').val()) {
  574. dialog({
  575. contentType: 'tipsbox',
  576. skin: 'bk-popup',
  577. bottom: true,
  578. content: '请先选择上一个时间段!'
  579. }).show();
  580. return;
  581. }
  582. }
  583. if(ind == 0) {
  584. starNum1 = 0;
  585. starNum2 = 0;
  586. } else {
  587. var $p = $me.closest('.time-item').prev().find('input'),
  588. pArr = ($p.val()).split('-');
  589. starNum1 = parseInt(pArr[1].split(':')[0]);
  590. starNum2 = parseInt('00');
  591. }
  592. new IosSelect(4, [hoursData, secondData, hoursTData, secondTData], {
  593. title: '',
  594. itemHeight: 35,
  595. relation: [1, 1, 1, 1],
  596. oneLevelId: oneLevelId,
  597. twoLevelId: twoLevelId,
  598. threeLevelId: threeLevelId,
  599. fourLevelId: fourLevelId,
  600. showLoading: true,
  601. callback: function(selectOneObj, selectTwoObj, selectThreeObj, selectFourObj) {
  602. $n.find('input').attr('data-hours', selectThreeObj.id);
  603. $n.find('input').attr('data-seconds', selectFourObj.id);
  604. $n.find('input').attr('data-thours', selectThreeObj.id);
  605. $n.find('input').attr('data-tseconds', selectFourObj.id);
  606. $me.attr('data-hours', selectOneObj.id);
  607. $me.attr('data-seconds', selectTwoObj.id);
  608. $me.attr('data-thours', selectThreeObj.id);
  609. $me.attr('data-tseconds', selectFourObj.id);
  610. starNum1 = parseInt(selectThreeObj.id);
  611. starNum2 = parseInt(selectFourObj.id);
  612. $me.val(selectOneObj.value + ':' + selectTwoObj.value + '-' + selectThreeObj.value + ':' + selectFourObj.value);
  613. }
  614. });
  615. });
  616. }
  617. }
  618. function weixinSign(){
  619. //从后台那边获取签名等信息
  620. var params = {};
  621. var url1 = window.location.href;
  622. params.pageUrl = url1;
  623. $.ajax(server + "weixin/getSign", {
  624. data: params,
  625. dataType: "json",
  626. type: "post",
  627. success: function(res){
  628. if (res.status == 200) {
  629. var t = res.data.timestamp;
  630. var noncestr = res.data.noncestr;
  631. var signature = res.data.signature;
  632. wx.config({
  633. appId: appId, // 必填,公众号的唯一标识
  634. timestamp: t, // 必填,生成签名的时间戳
  635. nonceStr: noncestr, // 必填,生成签名的随机串
  636. signature: signature,// 必填,签名,见附录1
  637. jsApiList: [
  638. 'chooseImage',
  639. 'uploadImage',
  640. 'scanQRCode'
  641. ] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
  642. });
  643. // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
  644. wx.ready(function(){
  645. wx.getNetworkType({
  646. success: function (res) {
  647. networkStatus = res.networkType; // 返回网络类型2g,3g,4g,wifi
  648. }
  649. });
  650. });
  651. }
  652. }
  653. });
  654. }