| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <html>
- <head>
- <meta charset="utf-8">
- <title>Hello MUI</title>
- <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <!--标准mui.css-->
- <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
- <link rel="stylesheet" href="../css/mui.min.css">
- <link rel="stylesheet" href="../css/iconfont.css">
- <link rel="stylesheet" href="../css/common.css">
- <!--App自定义的css-->
- <style type="text/css">
- body,html,.mui-content{
- background-color: #fff;
- }
- .bottomTxt >div{
- text-align: center;
- line-height: 40px;
- font-size: 22px;
- color: #656565;
- }
- .bottomTxt textarea{
- border: none;
- min-height: 200px;
- text-indent: 20px;
- font-size: 14px;
- letter-spacing: .2rem;
- }
- .bottomTxt .active{
- border: 1px solid #9a9a9a;
- width: 80%;
- margin: 0 auto;
- display: block;
- }
- #saveBox{
- margin-top: 10px;
- text-align: center;
- display: none;
- }
- #saveBox button{
- width: 30%;
- }
- </style>
- </head>
- <body>
- <header class="mui-bar mui-bar-nav">
- <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
- <h1 class="mui-title" id="title">孢子仪图片描述</h1>
- <a class="headRightIcon fa fa-edit mui-pull-right" id="editBtn">编辑</a>
- </header>
- <div class="mui-content">
- <div class="">
- <img src="" width="100%" id="bzyImg"/>
- <!--<img src="http://120.27.222.26/bzy/pyftp/ftp_file/bzy_photo/866262040450529/20190513/20190513211133.jpg" width="100%" id="bzyImg"/>-->
- </div>
- <div class="bottomTxt">
- <div>图片描述</div>
- <textarea class="" readonly='readonly' id="describe" rows="" cols=""></textarea>
- </div>
- <div id="saveBox">
- <button type="button" id="cancelBtn" class="mui-btn mui-btn-primary">取 消</button>
- <button type="button" id="sendBtn" class="mui-btn mui-btn-primary">保 存</button>
- </div>
- </div>
- </body>
- <script src="../js/jquery-2.1.0.js"></script>
- <script src="../js/mui.min.js"></script>
- <script>
- var equipId,addr,describeMsg;
- var startPage = 1;
- var totalPage = 0;
- var username;
- mui.plusReady(function() {
- var self = plus.webview.currentWebview();
- equipId = self.equipId;
- addr = self.addr;
- if(self.addr.substring(0,4) == 'http'){
- $('#bzyImg').attr('src', addr);
- }else{
- $('#bzyImg').attr('src','http://120.27.222.26/bzy/'+addr);
- }
- // $('#bzyImg').attr('src','http://120.27.222.26/bzy/pyftp/ftp_file/bzy_photo/866262040450529/20190513/20190513211133.jpg');
-
- mui.ajax('http://120.27.222.26/bzy_describe_img', {
- data: {
- 'addr': addr
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'get', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- beforeSend: function() {
- plus.nativeUI.showWaiting('请求中...');
- },
- complete: function() {
- plus.nativeUI.closeWaiting();
- },
- success: function(data) {
- describeMsg = data;
- $('#describe').val(data || '暂无数据')
- },
- error: function(xhr, type, errorThrown) {
- mui.toast('请求失败')
- }
- });
-
- $('#editBtn').on('tap',function(){
- $('#describe').attr('readonly',false);
- $('#describe').addClass('active');
- $('#describe').val(describeMsg);
- $('#saveBox').show();
- })
- $('#cancelBtn').on('tap',function(){
- $('#describe').attr('readonly',true);
- $('#describe').val(describeMsg || '暂无数据');
- $('#describe').removeClass('active');
- $('#saveBox').hide();
- })
- $('#sendBtn').on('tap',function(){
- mui.ajax('http://120.27.222.26/bzy_describe_img', {
- data: {
- 'addr': addr,
- 'describe':$('#describe').val()
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- beforeSend: function() {
- plus.nativeUI.showWaiting('请求中...');
- },
- complete: function() {
- plus.nativeUI.closeWaiting();
- },
- success: function(data) {
- console.log(JSON.stringify(data))
- if(data == 0){
- describeMsg = $('#describe').val();
- $('#describe').val(describeMsg || '暂无数据');
- $('#describe').attr('readonly',true);
- $('#describe').removeClass('active');
- $('#saveBox').hide();
- }else{
- mui.toast('添加描述失败!');
- }
-
- },
- error: function(xhr, type, errorThrown) {
- mui.toast('请求失败')
- }
- });
-
- })
- $('#bzyImg').on('tap',function(){
- var imgsrc = document.getElementById('bzyImg').getAttribute('src');
- console.log(imgsrc)
- plus.nativeUI.previewImage([
- imgsrc
- ]);
- })
- })
-
- </script>
- </html>
|