guide_the_message.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. var httpData = GetRequest();
  2. var docInfo = JSON.parse(window.localStorage.getItem('wlyyAgent'));
  3. var tempwindow;
  4. var previewLayerIndex, followupLayerIndex, KFZDlayerIndex;
  5. function closeGuidancePreview(){
  6. layer.close(previewLayerIndex)
  7. }
  8. function closeFollowUpLayer(planDetaiId, relationCode){
  9. if($.isArray(relationCode)) {
  10. $.each(relationCode, function(index, item){
  11. top.rehabilitationGuideVue.saveRehabilitationOperateRecord(planDetaiId, 6, item)
  12. })
  13. } else {
  14. top.rehabilitationGuideVue.saveRehabilitationOperateRecord(planDetaiId, 6, relationCode)
  15. }
  16. layer.close(followupLayerIndex)
  17. }
  18. function closeKFZDlayer(planDetaiId){
  19. top.rehabilitationGuideVue.saveRehabilitationOperateRecord(planDetaiId, 5)
  20. layer.close(KFZDlayerIndex)
  21. }
  22. function showSuccessMessage(msg) {
  23. layer.msg(msg, {
  24. icon: 1
  25. })
  26. }
  27. function showErrorMessage(msg) {
  28. layer.msg(msg, {
  29. icon: 5
  30. })
  31. }
  32. top.rehabilitationGuideVue = new Vue({
  33. el: "#app",
  34. data: {
  35. doctorlevel:docInfo.doctorlevel,
  36. imgData: {
  37. accept: 'image/gif, image/jpeg, image/png, image/jpg',
  38. },
  39. isCollapse: false,
  40. selectCheckTyperadio:0,
  41. showAppointHelpCheckBtn:true, //点击预约协诊按钮结束变为false
  42. showRecordFinished:false, //点击完成记录按钮变为true
  43. appointTime:'',
  44. appointDate:"",
  45. appointHour:'',
  46. upImgs: [],
  47. upImgArr: [],
  48. planid: httpData['planid'], // 服务项id
  49. service: {
  50. relationRecordImg:{},
  51. messageList:{},
  52. },
  53. startTime:'',
  54. pickerOptions:{
  55. disabledDate:function(time) {
  56. return time.format('yyyy-MM-dd') < new Date().format('yyyy-MM-dd')
  57. }
  58. },
  59. pId: httpData['pId'], // 康复计划id
  60. patient: httpData['patient'],
  61. patientName: decodeURI(httpData['patientName']),
  62. layerIndex: undefined,
  63. recordId: httpData['recordId']||undefined,
  64. islimit: false,
  65. },
  66. watch:{
  67. appointDate:function(){
  68. if(this.appointDate==new Date().format('yyyy-MM-dd')){
  69. this.startTime=new Date(new Date().getTime()).format('hh:mm')
  70. }else{
  71. this.startTime=''
  72. }
  73. }
  74. },
  75. mounted: function() {
  76. this.getServiceItem();
  77. },
  78. methods: {
  79. // 提醒患者 num 1康复指导2康复下转3复诊提醒4上门服务提醒5家签提醒
  80. sendSpecialistWeixinMessage: function(type){
  81. var vm = this
  82. var text = ''
  83. if(type==4){ // 上门服务
  84. text = '请问您是否确认提醒'+vm.patientName+'居民预约上门护理服务?'
  85. } else if(type==7){ // 康复复诊
  86. text = '请问您是否确认提醒'+vm.patientName+'居民进行复诊?'
  87. }
  88. var current=layer.confirm(text, {
  89. btn: ['确定', '取消'],
  90. title: "提示"
  91. }, function (index) {
  92. var reservationTypeObj={0:2,1:3,2:1}
  93. var _type = type == 4? 4:type==7?3:''
  94. var loading = layer.load(0, {shade: false})
  95. var params = {
  96. patient: vm.patient,
  97. doctor: docInfo.uid,
  98. type: _type,
  99. relationCode: vm.planid,
  100. planId: vm.pId,
  101. reservationType:reservationTypeObj[vm.selectCheckTyperadio] //复诊类型:1线上,2线下,3远程
  102. }
  103. rehaAPI.sendSpecialistWeixinMessage(params).then(function(res){
  104. layer.close(loading)
  105. if(res.status == 200){
  106. showSuccessMessage('提交成功!')
  107. if(_type == 3 || _type == 4){ // 提醒患者后,即认为是已完成
  108. vm.saveRehabilitationOperateRecord(vm.planid, type)
  109. }
  110. } else {
  111. showErrorMessage(res.msg)
  112. }
  113. })
  114. layer.close(current); //再执行关闭
  115. })
  116. },
  117. appointHelpCheck:function(data){
  118. var vm=this
  119. vm.showAppointHelpCheckBtn=false
  120. vm.appointTime=vm.appointDate+' '+vm.appointHour
  121. var params={
  122. patient:vm.patient,
  123. doctor:data.familyDoctorCode,
  124. doctorName:data.familyDoctorName, //家签医生
  125. sendTime:vm.appointTime,
  126. planDetailId:vm.planid,
  127. appointmentDoctor:data.specialistDoctorCode,
  128. appointmentDoctorName:data.specialistDoctorName //专科医生
  129. }
  130. var loading = layer.load(0, {shade: false})
  131. rehaAPI.appointmentConsultation(params).then(function(res){
  132. layer.close(loading)
  133. if(res.status == 200){
  134. showSuccessMessage('操作成功')
  135. setTimeout(function(){
  136. vm.getServiceItem()
  137. },400)
  138. } else {
  139. showErrorMessage(res.msg)
  140. }
  141. })
  142. },
  143. encryptCode: function(docCode) {
  144. var publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4lT0JWcv9xx6Q1hsxMal2F1AmKti/xVbBeh8jrD5CiYsFTH0DO1Mpyvv8YtkGdnDSLRjOQOA1PiaYvZoHIhml/jTvEMsvFlAD5i1BsHa5blLlJxQNp/XI7wpMZPfczqO+I/JONrV6ib+6Ci/1FyTjPQfHaiT2ehGyM/CFzOW1PQIDAQAB"
  145. var encrypt =new JSEncrypt()
  146. encrypt.setPublicKey(publicKey)
  147. return encodeURIComponent(encrypt.encrypt(docCode))
  148. },
  149. openWindow(url, p1, p2){
  150. try{
  151. if(tempwindow)
  152. tempwindow.close()
  153. }catch(e){
  154. console.log(e)
  155. }
  156. if(p1){
  157. tempwindow = window.open('_blank', p1, p2)
  158. } else {
  159. tempwindow = window.open('_blank')
  160. }
  161. tempwindow.location = url
  162. },
  163. openHelpCheck:function(){
  164. var encryptCode = this.encryptCode(docInfo.uid)
  165. var url = httpRequest.teamworkService + '/#/teamwork/login?_code='+ encryptCode
  166. this.openWindow(url)
  167. },
  168. recordFinished:function(){
  169. this.showRecordFinished=true
  170. },
  171. //康复指导
  172. kfzd:function(){
  173. var vm=this, str = '../../rehabilitation/html/rehabilitation_guidance.html?patient='+vm.patient+'&planDetaiId='+vm.planid+'&planId='+vm.pId
  174. KFZDlayerIndex = layer.open({
  175. type: 2,
  176. // offset: ['100px'], //右下角弹出
  177. area: ['660px', '650px'],
  178. shade: 0.5,
  179. title: '康复指导',
  180. fixed: true, //不固定
  181. maxmin: true,
  182. closeBtn: 1,
  183. shift: 5,
  184. shadeClose: false, //点击遮罩关闭层
  185. content: str,
  186. end: function() { // 未点击确定按钮,点击关闭按钮
  187. this.getServiceItem();   
  188. }
  189. });
  190. },
  191. // 康复随访计划
  192. sfjh: function(){
  193. var vm=this
  194. followupLayerIndex = layer.open({
  195. type: 2,
  196. // offset: ['100px'], //右下角弹出
  197. area: ['80%', '650px'],
  198. shade: 0.5,
  199. title: '随访计划',
  200. fixed: true, //不固定
  201. maxmin: true,
  202. closeBtn: 1,
  203. shift: 5,
  204. shadeClose: false, //点击遮罩关闭层
  205. content:'../../followup/html/followup_newplan.html?patient='+vm.patient+'&planDetaiId='+vm.planid+'&planId='+vm.pId,
  206. end: function() { // 未点击确定按钮,点击关闭按钮
  207. this.getServiceItem();    
  208. }
  209. });
  210. },
  211. zwkf: function() {
  212. top.layer.msg('此功能暂未开放', {
  213. icon: 1
  214. });
  215. },
  216. //康复指导
  217. jkzd: function(planId,patient) {
  218. var vm = this
  219. top.layer.open({
  220. type: 2,
  221. // offset: ['100px'], //右下角弹出
  222. area: ['80%', '648px'],
  223. shade: 0.5,
  224. title: '健康教育',
  225. fixed: true, //不固定
  226. maxmin: true,
  227. closeBtn: 1,
  228. shift: 5,
  229. shadeClose: false, //点击遮罩关闭层
  230. content: '../../guidance/html/index.html#/person-edit-panel?patient=' + patient + '&planId=' + planId
  231. });
  232. },
  233. openFollowResult(){
  234. top.layer.open({
  235. type: 2,
  236. area: ['600px', '700px'],
  237. shade: 0.5,
  238. title: '查看随访表单',
  239. fixed: true, //不固定
  240. maxmin: true,
  241. closeBtn: 1,
  242. // shift: 5,
  243. shadeClose: false, //点击遮罩关闭层
  244. content: '../html/followResult.html'
  245. })
  246. },
  247. openFollowRecordForm(){
  248. top.layer.open({
  249. type: 2,
  250. area: ['850px', '700px'],
  251. shade: 0.5,
  252. title: '记录随访表单',
  253. fixed: true, //不固定
  254. maxmin: true,
  255. closeBtn: 1,
  256. // shift: 5,
  257. shadeClose: false, //点击遮罩关闭层
  258. content: '../html/followRecord.html'
  259. })
  260. },
  261. qwapp: function() {
  262. top.layer.msg('请前往app处理', {
  263. icon: 5
  264. });
  265. },
  266. viewGuidance: function(o){
  267. var vm = this
  268. previewLayerIndex = layer.open({
  269. type: 2,
  270. area: ['380px', '600px'],
  271. shade: 0.5,
  272. title: '预览',
  273. fixed: true, //不固定
  274. maxmin: true,
  275. closeBtn:1,
  276. shift: 5,
  277. shadeClose: false, //点击遮罩关闭层
  278. content: '../../rehabilitation/html/rehabilitation_guidance_preview.html?modelCode='+o.article
  279. });
  280. },
  281. getServiceItem: function() {
  282. var vm = this;
  283. var loginDoctor = JSON.parse(window.localStorage.getItem('wlyyAgent'));
  284. var loadding = top.layer.load(0, {
  285. shade: false
  286. }); //0代表加载的风格,支持0-2
  287. var params = {
  288. planDetailId: vm.planid,
  289. }
  290. if(vm.recordId){
  291. params['recordId'] = vm.recordId
  292. }
  293. rehaAPI.serviceItem(params).then(function(res) {
  294. top.layer.close(loadding);
  295. if(res.status == 200) {
  296. vm.service = res.data;
  297. var isZK=loginDoctor.doctorType==1?true:false;
  298. vm.service.isZK=isZK;
  299. if(vm.service.completeTime){
  300. var l = vm.service.completeTime.length
  301. vm.service.shortCompleteTime = vm.service.completeTime.substr(l-5, l-1)
  302. }
  303. if(vm.service.isMyTask==1){//执行者
  304. vm.service.isCK=true;//无法显示按钮
  305. if(loginDoctor.uid==vm.service.specialistDoctorCode){//说明我自己是创建者
  306. vm.service.isCK=false;
  307. vm.service.isCreate=true;
  308. }
  309. }else{
  310. if(loginDoctor.uid==vm.service.specialistDoctorCode){//说明我自己是创建者
  311. vm.service.isCreate=true;
  312. }
  313. }
  314. if(vm.service.type == 4 || vm.service.type == 5 || vm.service.type == 7){
  315. vm.getRelationRecord(vm.service.type, vm.planid).then(function(result){
  316. if(result.status == 200){
  317. vm.service.relationList = result.data&&result.data.length>0?result.data:undefined
  318. vm.$forceUpdate()
  319. }
  320. })
  321. }
  322. if(vm.service.frequencyCode){
  323. vm.islimit = true
  324. } else {
  325. vm.islimit = false
  326. }
  327. } else {
  328. top.layer.msg(res.msg, {
  329. icon: 5
  330. });
  331. }
  332. if(vm.service.status==1){
  333. var index = top.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  334. top.layer.title('服务记录详情', index) //再改变当前层的标题
  335. }
  336. })
  337. },
  338. getRelationRecord: function(type, planDetaiId){
  339. // 1.电话短信 2.康复咨询 3.远程监控检测 4.上门服务 5.康复指导 6 康复随访 7.复诊)
  340. var vm = this
  341. var url=''
  342. if(type==5){
  343. url='doctor/specialist/rehabilitation/selectByRelationCode'
  344. }else if(type==7){
  345. url='third/guahao/selectByRelationCode'
  346. }else if(type==4){
  347. url="/doctor/specialist/rehabilitation/selectRelationCode"
  348. }
  349. var vm = this
  350. var params = {
  351. relationCode: vm.recordId?vm.recordId:planDetaiId
  352. }
  353. return httpRequest.get(url, {data: params})
  354. },
  355. zdly: function(data) {
  356. var vm = this
  357. var loginDoctor = JSON.parse(window.localStorage.getItem('wlyyAgent'));
  358. var otherCode, otherName;
  359. if(loginDoctor.doctorType == 1) {
  360. otherCode = data.familyDoctorCode;
  361. otherName = data.familyDoctorName;
  362. } else {
  363. otherCode = data.specialistDoctorCode;
  364. otherName = data.specialistDoctorName;
  365. }
  366. top.layer.open({
  367. type: 2,
  368. // offset: ['100px'], //右下角弹出
  369. area: ['660px', '600px'],
  370. shade: 0.5,
  371. title: '指导留言',
  372. fixed: true, //不固定
  373. maxmin: true,
  374. closeBtn: 1,
  375. shift: 5,
  376. shadeClose: false, //点击遮罩关闭层
  377. content: '../../consulting/html/consulting.html?otherCode=' + otherCode + '&otherName=' + encodeURI(otherName) + '&planDetailId=' + vm.planid,
  378. end: function() { // 未点击确定按钮,点击关闭按钮
  379.       
  380. vm.getServiceItem();    
  381. }
  382. });
  383. },
  384. deleteImg: function(idx) {
  385. console.log(idx)
  386. this.upImgs.splice(idx, 1)
  387. },
  388. chakan: function() {
  389. this.isCollapse = !this.isCollapse;
  390. },
  391. upLoadImgToBase64: function() {
  392. var vm = this;
  393. var img1 = event.target.files[0];
  394. var reader = new FileReader();
  395. var type = img1.type; //文件的类型,判断是否是图片
  396. var size = img1.size; //文件的大小,判断图片的大小
  397. if(this.imgData.accept.indexOf(type) == -1) {
  398. alert('请选择我们支持的图片格式!');
  399. return false;
  400. }
  401. if(size > 3145728) {
  402. alert('请选择3M以内的图片!');
  403. return false;
  404. }
  405. reader.readAsDataURL(img1);
  406. reader.onload = function(e) {
  407. vm.upImgs.push({
  408. baseUrl: e.target.result
  409. });
  410. vm.upImgArr.push(img1);
  411. console.log('e', e, 'vm.upImgs', vm.upImgs, 'vm.upImgArr', vm.upImgArr)
  412. //vm.uploadImg(vm.upImgArr);
  413. }
  414. },
  415. qrwc: function(patient,type) {
  416. var vm = this;
  417. if(!vm.service.node){
  418. showErrorMessage('请填写服务记录')
  419. return
  420. }
  421. if(!vm.upImgs.length){
  422. showErrorMessage('请上传相关记录')
  423. return
  424. }
  425. vm.saveRehabilitationOperateRecord(vm.planid,type);
  426. },
  427. saveRehabilitationOperateRecord:function(planDetailId, type, relationCode, flag){
  428. var vm=this;
  429. var params={
  430. rehabilitationDetailId: planDetailId,
  431. node: null,
  432. patientCode: vm.patient,
  433. doctorCode: docInfo.uid,
  434. relationRecordType: type,
  435. relationRecordCode: '',
  436. relationRecordImg: null,
  437. status: 0
  438. }
  439. rehaAPI.saveRehabilitationOperateRecord({dataJson:JSON.stringify(params)}).then(function(res){
  440. if(res.status==200){
  441. if(type==1 || type==7){
  442. vm.uploadImg(vm.upImgArr);
  443. }else if(type==6){
  444. vm.updateRelationCodeByDetailId(planDetailId, relationCode)
  445. } else {
  446. vm.updateNoteAndImageRehabilitationOperate(planDetailId)
  447. }
  448. } else {
  449. layer.msg(res.msg, {
  450. icon: 5
  451. });
  452. }
  453. })
  454. },
  455. //上传图片
  456. uploadImg: function(data) {
  457. var vm = this;
  458. var len = data.length;
  459. if(len==0) {
  460. vm.updateNoteAndImageRehabilitationOperate(vm.planid)
  461. } else {
  462. var file = data[len - 1];
  463. var formData = new FormData();
  464. formData.append('file', file);
  465. rehaAPI.upload(formData).then(function(res) {
  466. if(res.status == 200) {
  467. vm.upImgs[len - 1].img = res.data;
  468. data.pop();
  469. vm.$forceUpdate()
  470. vm.uploadImg(data);
  471. } else {
  472. layer.msg(res.msg, {
  473. icon: 5
  474. });
  475. }
  476. })
  477. }
  478. },
  479. updateNoteAndImageRehabilitationOperate: function(planDetailId, relationCode) {
  480. var vm = this;
  481. var _image = [];
  482. $.each(vm.upImgs, function(index, obj){
  483. _image.push(obj.img);
  484. })
  485. var params = {
  486. planDetailId: planDetailId,
  487. node: vm.service&&vm.service.node?vm.service.node:null,
  488. image:JSON.stringify(_image)||''
  489. }
  490. if(relationCode){
  491. params['relationCode'] = relationCode
  492. }
  493. var loadding = top.layer.load(0, {
  494. shade: false
  495. }); //0代表加载的风格,支持0-2
  496. rehaAPI.updateNoteAndImageRehabilitationOperate(params).then(function(res) {
  497. top.layer.close(loadding);
  498. if(res.status == 200) {
  499. vm.getServiceItem();
  500. top.rehabilitationVue.refresh()
  501. }
  502. })
  503. },
  504. updateRelationCodeByDetailId: function(planDetailId, relationCode){
  505. var vm = this
  506. var params = {
  507. planDetailId: planDetailId,
  508. relationCode: relationCode,
  509. }
  510. rehaAPI.updateRelationCodeByDetailId(params).then(function(res) {
  511. if(res.status == 200) {
  512. vm.getServiceItem();
  513. top.rehabilitationVue.refresh()
  514. } else {
  515. showErrorMessage(res.msg)
  516. }
  517. })
  518. },
  519. viewDetial:function(type,code){
  520. var vm=this;
  521. if(type == 3) {
  522. top.layer.msg('客户端暂不支持查询健康指导记录');
  523. } else if(type==4){
  524. top.layer.msg('客户端暂不支持查询随访记录');
  525. }else{
  526. top.layer.open({
  527. type: 2,
  528. // offset: ['100px'], //右下角弹出
  529. area: ['80%', '600px'],
  530. shade: 0.5,
  531. title: '指导教育',
  532. fixed: true, //不固定
  533. maxmin: true,
  534. closeBtn: 1,
  535. shift: 5,
  536. shadeClose: false, //点击遮罩关闭层
  537. content: '../../article/html/article-info.html?articleId=' + code,
  538. end: function() { // 未点击确定按钮,点击关闭按钮
  539. vm.getServiceItem();    
  540. }
  541. });
  542. }
  543. },
  544. getContent: function(value,type) {
  545. var res=value;
  546. if(type==2 || type==9){
  547. res = "<img src='"+httpRequest.getImgUrl(res)+"'>";
  548. }else if(type==3){
  549. res = '【语音】';
  550. }else if(type==19){
  551. res = '【聊天记录】';
  552. }else if(type==12){
  553. res = '【视频】';
  554. }
  555. return res;
  556. }
  557. },
  558. filters: {
  559. formatDate: function(value, format) {
  560. if(!value) return;
  561. var fmt = format || "yyyy-MM-dd hh:mm";
  562. var date = new Date(value);
  563. if(/(y+)/.test(fmt)) {
  564. fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
  565. }
  566. let o = {
  567. 'M+': date.getMonth() + 1,
  568. 'd+': date.getDate(),
  569. 'h+': date.getHours(),
  570. 'm+': date.getMinutes(),
  571. 's+': date.getSeconds()
  572. };
  573. for(let k in o) {
  574. if(new RegExp(`(${k})`).test(fmt)) {
  575. let str = o[k] + '';
  576. fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : ('00' + str).substr(str.length));
  577. }
  578. }
  579. return fmt;
  580. },
  581. getImgUrl: function(value) {
  582. var url = httpRequest.getImgUrl(value);
  583. return url;
  584. }
  585. }
  586. })
  587. $("body").on('click','img',function(){
  588. var _this = $(this);//将当前的img元素作为_this传入函数
  589. imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);
  590. });
  591. function imgShow(outerdiv, innerdiv, bigimg, _this){
  592. var src = _this.attr("src");//获取当前点击的pimg元素中的src属性
  593. $(bigimg).attr("src", src);//设置#bigimg元素的src属性
  594. /*获取当前点击图片的真实大小,并显示弹出层及大图*/
  595. $("<img/>").attr("src", src).load(function(){
  596. var windowW = $(window).width();//获取当前窗口宽度
  597. var windowH = $(window).height();//获取当前窗口高度
  598. var realWidth = this.width;//获取图片真实宽度
  599. var realHeight = this.height;//获取图片真实高度
  600. var imgWidth, imgHeight;
  601. var scale = 0.8;//缩放尺寸,当图片真实宽度和高度大于窗口宽度和高度时进行缩放
  602. if(realHeight>windowH*scale) {//判断图片高度
  603. imgHeight = windowH*scale;//如大于窗口高度,图片高度进行缩放
  604. imgWidth = imgHeight/realHeight*realWidth;//等比例缩放宽度
  605. if(imgWidth>windowW*scale) {//如宽度扔大于窗口宽度
  606. imgWidth = windowW*scale;//再对宽度进行缩放
  607. }
  608. } else if(realWidth>windowW*scale) {//如图片高度合适,判断图片宽度
  609. imgWidth = windowW*scale;//如大于窗口宽度,图片宽度进行缩放
  610. imgHeight = imgWidth/realWidth*realHeight;//等比例缩放高度
  611. } else {//如果图片真实高度和宽度都符合要求,高宽不变
  612. imgWidth = realWidth;
  613. imgHeight = realHeight;
  614. }
  615. $(bigimg).css("width",imgWidth);//以最终的宽度对图片缩放
  616. var w = (windowW-imgWidth)/2;//计算图片与窗口左边距
  617. var h = (windowH-imgHeight)/2;//计算图片与窗口上边距
  618. $(innerdiv).css({"top":h, "left":w});//设置#innerdiv的top和left属性
  619. $(outerdiv).fadeIn("fast");//淡入显示#outerdiv及.pimg
  620. });
  621. $(outerdiv).click(function(){//再次点击淡出消失弹出层
  622. $(this).fadeOut("fast");
  623. });
  624. }