'
+ } else {
+ html += '
提交时间:' + this.createTime +
+ '' + this.statusStr +
+ '
'
+ }
+
+ $.each(this.list, function() {
+ totPayable += Number(this.payable)
+ html += '
订单编号:' + this.orderNo +
+ '
优惠金额:' + this.payable + '
'
+ })
+ totPayable = totPayable.toFixed(2)
+
+ html += '
总计优惠款:' + totPayable + '
'
+ })
+ if (page == 1) {
+ $('.committed').html(html);
+ } else {
+ $('.committed').append(html);
+ }
+ } else {
+ mui.alert(data.msg)
+ }
+ })
+ }
+
+ mui('body').on('tap', '.btn', function() {
+ // 每次触发事件就会使用 innerText 获取纯文本。
+ var copy_content = $(this).attr("data-value");
+
+ // var copy_content = this.innerText;
+ // 加了一个确认框 让用户选择是否复制
+ // mui.confirm('您要复制内容吗?', '小禾CRM', ['取消', '复制内容'], function (e) {
+ // if (e.index == 1) {
+ //判断是安卓还是ios
+ if (mui.os.ios) {
+ // ios 的方法 这个我没具体研究过 直接拿来用了
+ var UIPasteboard = plus.ios.importClass("UIPasteboard");
+ var generalPasteboard = UIPasteboard.generalPasteboard();
+ //设置 复制的内容也就是 触发事件 innerText 获取的内容
+ generalPasteboard.plusCallMethod({
+ setValue: copy_content,
+ forPasteboardType: "public.utf8-plain-text"
+ });
+ generalPasteboard.plusCallMethod({
+ valueForPasteboardType: "public.utf8-plain-text"
+ });
+ // 在上边都走完 给用户一个提示
+ mui.toast('复制成功')
+ } else {
+ //安卓 的方法 这个我没具体研究过 直接拿来用了
+ var context = plus.android.importClass("android.content.Context");
+ var main = plus.android.runtimeMainActivity();
+ var clip = main.getSystemService(context.CLIPBOARD_SERVICE);
+ plus.android.invoke(clip, "setText", copy_content);
+ // 在上边都走完 给用户一个提示
+ mui.toast('复制成功')
+ }
+ // }
+ })
+
+
+
})
diff --git a/static/app2/js/perfect-scrollbar.min.js b/static/app2/js/perfect-scrollbar.min.js
old mode 100755
new mode 100644
diff --git a/static/app2/js/photoswipe-ui-default.min.js b/static/app2/js/photoswipe-ui-default.min.js
old mode 100755
new mode 100644
diff --git a/static/app2/js/photoswipe.js b/static/app2/js/photoswipe.js
old mode 100755
new mode 100644
diff --git a/static/app2/js/pj.js b/static/app2/js/pj.js
old mode 100755
new mode 100644
index 22ae733..1d41ede
--- a/static/app2/js/pj.js
+++ b/static/app2/js/pj.js
@@ -1,236 +1,236 @@
-mui.plusReady(function() {
- var token = localStorage.getItem('token');
- var self = plus.webview.currentWebview();
- var data_order_id = self.data_order_id;
- mui.ajax(qlgUrl('app/Orders/getOrderAppraise'), {
- headers: {
- "HYH-Token": token
- },
- data: {
- oId: data_order_id
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- var data = toJson(data);
- if (data.status == 1) {
- data = data.data
- var html = '';
- var i = 0;
- $.each(data.Rows, function() {
- if (this.appraise == null) {
- html += '
' +
- this.goodsName +
- '
你的浏览器不支持flash,Silverlight或者HTML5!
'
- i++;
- } else {
- html += '
' +
- this.appraise.content + '
'
-
- $.each(this.appraise.images, function() {
- html += '
 + ')
'
- });
-
-
-
- html += '
';
- }
- });
- $('.con').html(html)
- $('.star').each(function() {
- if ($(this).attr('data-isPj') == 1) {
- var num = +$(this).parent().attr('data-' + $(this).parent().attr('data-class')) - 1
- $(this).children().eq(num).children().addClass('star_on').removeClass('star_off')
- $(this).children().eq(num).prevAll().children().addClass('star_on').removeClass('star_off')
- $(this).children().eq(num).nextAll().children().addClass('star_off').removeClass('star_on')
- }
- })
- var btnArr = [];
-
- $('.selectfiles').each(function(num) {
- btnArr.push($(this).attr('id'));
- })
-
- $.each(btnArr, function(i, n) {
- var self = this.toString();
- var that = document.getElementById(this);
- var uploader = new plupload.Uploader({
- runtimes: 'html5,flash,silverlight,html4',
- browse_button: self,
- //multi_selection: false,
- // container: document.getElementById('container'),
- flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf',
- silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap',
- url: 'http://oss.aliyuncs.com',
- dir: 'appraises',
-
- filters: {
- mime_types: [ //只允许上传图片和zip,rar文件
- {
- title: "Image files",
- extensions: "jpg,gif,png,bmp"
- },
- {
- title: "Zip files",
- extensions: "zip,rar"
- }
- ],
- max_file_size: '10mb', //最大只能上传10mb的文件
- prevent_duplicates: true //不允许选取重复文件
- },
-
- init: {
- PostInit: function() {
- document.getElementsByClassName('ossfile')[i].innerHTML = '';
- // document.getElementById('postfiles').onclick = function() {
- // set_upload_param(uploader, '', false);
- // return false;
- // };
- uploader.bind('FilesAdded', function() {
- set_upload_param(uploader, '', false, 'appraises');
- return false;
- });
- },
-
- FilesAdded: function(up, files) {
- plupload.each(files, function(file) {
- document.getElementsByClassName('ossfile')[i].innerHTML += '
';
- });
- },
-
- BeforeUpload: function(up, file) {
- check_object_radio();
- set_upload_param(up, file.name, true);
- },
-
- UploadProgress: function(up, file) {
- var d = document.getElementById(file.id);
- d.getElementsByTagName('b')[0].innerHTML = '
' + file.percent + "%";
- var prog = d.getElementsByTagName('div')[0];
- var progBar = prog.getElementsByTagName('div')[0]
- progBar.style.width = 2 * file.percent + 'px';
- progBar.setAttribute('aria-valuenow', file.percent);
- },
-
- FileUploaded: function(up, file, info) {
- if (info.status == 200) {
- document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = '
) +
- ')
';
- } else {
- document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response;
- }
- },
-
- Error: function(up, err) {
- if (err.code == -600) {
- mui.alert("\n选择的文件太大了");
- } else if (err.code == -601) {
- mui.alert("\n选择的文件后缀不对");
- } else if (err.code == -602) {
- mui.alert("\n这个文件已经上传过一遍了");
- } else {
- mui.alert("\nError xml:" + err.response);
- }
- }
- }
- });
-
- uploader.init();
- });
- } else {
- mui.alert(data.msg)
- }
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
-
- $('.con').on('tap', '.star_a', function() {
- if ($(this).parent().attr('data-isPj') == 1) {
- return;
- }
- $(this).children().addClass('star_on').removeClass('star_off');
- $(this).prevAll().children().addClass('star_on').removeClass('star_off');
- $(this).nextAll().children().addClass('star_off').removeClass('star_on');
- $(this).parent().parent().attr('data-' + $(this).parent().parent().attr('data-class'), $(this).index() + 1);
- })
-
- $('.con').on('tap', '.tijiao', function() {
- var goodsId = $(this).parent().attr('data-goodsId');
- var goodsSpecId = $(this).parent().attr('data-goodsSpecId');
- var orderId = $(this).parent().attr('data-orderId');
- var orderGoodsId = $(this).parent().attr('data-orderGoodsId');
- var timeScore = $(this).siblings('.row[data-class*=timeScore]').attr('data-timeScore');
- var goodsScore = $(this).siblings('.row[data-class*=goodsScore]').attr('data-goodsScore');
- var serviceScore = $(this).siblings('.row[data-class*=serviceScore]').attr('data-serviceScore');
- var content = $(this).siblings('.purchase').children('textarea').val();
- var that = $(this);
- var imagesArr = [];
- $(this).siblings('.purchase').children('.up_out').children('.ossfile').children('.files_out').children('b').children(
- 'img').each(function() {
- imagesArr.push($(this).attr('data-src'))
- })
- var images = imagesArr.join(',');
- if (timeScore == 0 || serviceScore == 0 || serviceScore == 0) {
- mui.alert('评分必须1-5分之间!');
- return;
- }
- if (content.length < 3) {
- mui.alert('评论最少3个字!');
- return;
- }
- that.attr('disabled', 'disabled');
- mui.ajax(hyhUrl('app/Goodsappraises/add'), {
- headers: {
- "HYH-Token": token
- },
- data: {
- goodsId: goodsId,
- goodsSpecId: goodsSpecId,
- orderId: orderId,
- orderGoodsId: orderGoodsId,
- timeScore: timeScore,
- goodsScore: goodsScore,
- serviceScore: serviceScore,
- content: content,
- images: images
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- var data = toJson(data);
- mui.alert(data.msg)
- if (data.status == 1) {
- location.reload();
- } else {
- mui.alert(data.msg)
- }
- that.removeAttr('disabled');
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- })
+mui.plusReady(function() {
+ var token = localStorage.getItem('token');
+ var self = plus.webview.currentWebview();
+ var data_order_id = self.data_order_id;
+ mui.ajax(qlgUrl('app/Orders/getOrderAppraise'), {
+ headers: {
+ "HYH-Token": token
+ },
+ data: {
+ oId: data_order_id
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ var data = toJson(data);
+ if (data.status == 1) {
+ data = data.data
+ var html = '';
+ var i = 0;
+ $.each(data.Rows, function() {
+ if (this.appraise == null) {
+ html += '
' +
+ this.goodsName +
+ '
你的浏览器不支持flash,Silverlight或者HTML5!
'
+ i++;
+ } else {
+ html += '
' +
+ this.appraise.content + '
'
+
+ $.each(this.appraise.images, function() {
+ html += '
 + ')
'
+ });
+
+
+
+ html += '
';
+ }
+ });
+ $('.con').html(html)
+ $('.star').each(function() {
+ if ($(this).attr('data-isPj') == 1) {
+ var num = +$(this).parent().attr('data-' + $(this).parent().attr('data-class')) - 1
+ $(this).children().eq(num).children().addClass('star_on').removeClass('star_off')
+ $(this).children().eq(num).prevAll().children().addClass('star_on').removeClass('star_off')
+ $(this).children().eq(num).nextAll().children().addClass('star_off').removeClass('star_on')
+ }
+ })
+ var btnArr = [];
+
+ $('.selectfiles').each(function(num) {
+ btnArr.push($(this).attr('id'));
+ })
+
+ $.each(btnArr, function(i, n) {
+ var self = this.toString();
+ var that = document.getElementById(this);
+ var uploader = new plupload.Uploader({
+ runtimes: 'html5,flash,silverlight,html4',
+ browse_button: self,
+ //multi_selection: false,
+ // container: document.getElementById('container'),
+ flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf',
+ silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap',
+ url: 'http://oss.aliyuncs.com',
+ dir: 'appraises',
+
+ filters: {
+ mime_types: [ //只允许上传图片和zip,rar文件
+ {
+ title: "Image files",
+ extensions: "jpg,gif,png,bmp"
+ },
+ {
+ title: "Zip files",
+ extensions: "zip,rar"
+ }
+ ],
+ max_file_size: '10mb', //最大只能上传10mb的文件
+ prevent_duplicates: true //不允许选取重复文件
+ },
+
+ init: {
+ PostInit: function() {
+ document.getElementsByClassName('ossfile')[i].innerHTML = '';
+ // document.getElementById('postfiles').onclick = function() {
+ // set_upload_param(uploader, '', false);
+ // return false;
+ // };
+ uploader.bind('FilesAdded', function() {
+ set_upload_param(uploader, '', false, 'appraises');
+ return false;
+ });
+ },
+
+ FilesAdded: function(up, files) {
+ plupload.each(files, function(file) {
+ document.getElementsByClassName('ossfile')[i].innerHTML += '
';
+ });
+ },
+
+ BeforeUpload: function(up, file) {
+ check_object_radio();
+ set_upload_param(up, file.name, true);
+ },
+
+ UploadProgress: function(up, file) {
+ var d = document.getElementById(file.id);
+ d.getElementsByTagName('b')[0].innerHTML = '
' + file.percent + "%";
+ var prog = d.getElementsByTagName('div')[0];
+ var progBar = prog.getElementsByTagName('div')[0]
+ progBar.style.width = 2 * file.percent + 'px';
+ progBar.setAttribute('aria-valuenow', file.percent);
+ },
+
+ FileUploaded: function(up, file, info) {
+ if (info.status == 200) {
+ document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = '
) +
+ ')
';
+ } else {
+ document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response;
+ }
+ },
+
+ Error: function(up, err) {
+ if (err.code == -600) {
+ mui.alert("\n选择的文件太大了");
+ } else if (err.code == -601) {
+ mui.alert("\n选择的文件后缀不对");
+ } else if (err.code == -602) {
+ mui.alert("\n这个文件已经上传过一遍了");
+ } else {
+ mui.alert("\nError xml:" + err.response);
+ }
+ }
+ }
+ });
+
+ uploader.init();
+ });
+ } else {
+ mui.alert(data.msg)
+ }
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+
+ $('.con').on('tap', '.star_a', function() {
+ if ($(this).parent().attr('data-isPj') == 1) {
+ return;
+ }
+ $(this).children().addClass('star_on').removeClass('star_off');
+ $(this).prevAll().children().addClass('star_on').removeClass('star_off');
+ $(this).nextAll().children().addClass('star_off').removeClass('star_on');
+ $(this).parent().parent().attr('data-' + $(this).parent().parent().attr('data-class'), $(this).index() + 1);
+ })
+
+ $('.con').on('tap', '.tijiao', function() {
+ var goodsId = $(this).parent().attr('data-goodsId');
+ var goodsSpecId = $(this).parent().attr('data-goodsSpecId');
+ var orderId = $(this).parent().attr('data-orderId');
+ var orderGoodsId = $(this).parent().attr('data-orderGoodsId');
+ var timeScore = $(this).siblings('.row[data-class*=timeScore]').attr('data-timeScore');
+ var goodsScore = $(this).siblings('.row[data-class*=goodsScore]').attr('data-goodsScore');
+ var serviceScore = $(this).siblings('.row[data-class*=serviceScore]').attr('data-serviceScore');
+ var content = $(this).siblings('.purchase').children('textarea').val();
+ var that = $(this);
+ var imagesArr = [];
+ $(this).siblings('.purchase').children('.up_out').children('.ossfile').children('.files_out').children('b').children(
+ 'img').each(function() {
+ imagesArr.push($(this).attr('data-src'))
+ })
+ var images = imagesArr.join(',');
+ if (timeScore == 0 || serviceScore == 0 || serviceScore == 0) {
+ mui.alert('评分必须1-5分之间!');
+ return;
+ }
+ if (content.length < 3) {
+ mui.alert('评论最少3个字!');
+ return;
+ }
+ that.attr('disabled', 'disabled');
+ mui.ajax(hyhUrl('app/Goodsappraises/add'), {
+ headers: {
+ "HYH-Token": token
+ },
+ data: {
+ goodsId: goodsId,
+ goodsSpecId: goodsSpecId,
+ orderId: orderId,
+ orderGoodsId: orderGoodsId,
+ timeScore: timeScore,
+ goodsScore: goodsScore,
+ serviceScore: serviceScore,
+ content: content,
+ images: images
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ var data = toJson(data);
+ mui.alert(data.msg)
+ if (data.status == 1) {
+ location.reload();
+ } else {
+ mui.alert(data.msg)
+ }
+ that.removeAttr('disabled');
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ })
})
diff --git a/static/app2/js/plupload.full.min.js b/static/app2/js/plupload.full.min.js
old mode 100755
new mode 100644
diff --git a/static/app2/js/properties.js b/static/app2/js/properties.js
old mode 100755
new mode 100644
index 3ebfedf..aff89c7
--- a/static/app2/js/properties.js
+++ b/static/app2/js/properties.js
@@ -1,106 +1,106 @@
-mui.plusReady(function() {
-
- window.addEventListener('reload', function(e) { //执行刷新
- location.reload();
- });
- var self = plus.webview.currentWebview();
- //console.log(self);
- var shopId = self.id;
- //console.log(shopId);
- var page = 1;
- var pageSize = 10;
- var isloading = false;
- getRecommend(page, pageSize);
-
- function getRecommend(page, pageSize) {
- var recommenddata = {
- page: page ? page : 1,
- pageSize: pageSize ? pageSize : 10
- }
- recommenddata.shopId = shopId
- if (isloading == true) {
- return;
- } else {
- isloading = false;
- }
- isloading == true
- JZL.ajax(qlgUrl("app/shops/getSpecs"), recommenddata, function(data) {
- //console.log(data);
- if (data.status == 1) {
- var html = '';
- var data = data.data;
- if ('' == data.Rows) {
- //console.log("去" );
- $('.con').append(
- '
没有更多数据
');
- return;
- }
- $.each(data.Rows, function() {
- html += '
'
-
- if (page == 1) {
- $('.con_con').html(html);
- } else {
- $('.con_con').append(html);
- }
-
- })
- } else {
- mui.alert(data.msg)
- }
- isloading == false;
- })
-
- }
-
- document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
- if (scroll.y == scroll.maxScrollY) {
- if (isloading == true) {
- page++;
- getRecommend(page, pageSize);
- }
- }
- })
- var specCatsId = "";
- mui('.con').on('tap', '.bj', function() {
-
- // //console.log(1);
- specCatsId = $(this).parent().parent().attr("data-id");
- //console.log(specCatsId);
- var setName = $(this).parent().parent().find("label").text();
- //console.log(setName);
-
- JZL.openWindow("addproperties.html", parseInt(shopId), {
- "specCatsId": specCatsId,
- "setName": setName
- })
- })
- //删除
- $('.con').on('tap', '.del', function() {
- specCatsId = $(this).parent().parent().attr("data-id");
-
- if (confirm('确认删除?')) {
- JZL.ajax(qlgUrl('app/shops/delSpecSet'), {
- id: specCatsId,
- shopId: shopId
- }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // var data = toJson(data, 1);
- //console.log(1);
- //console.log(data);
- if (data.status == 1) {
-
- location.reload()
- } else {
- mui.alert(data.msg)
- }
- })
-
- }
- })
-
- $('.add1').on('tap', function() {
- JZL.openWindow('addproperties.html',parseInt(shopId));
- })
-
+mui.plusReady(function() {
+
+ window.addEventListener('reload', function(e) { //执行刷新
+ location.reload();
+ });
+ var self = plus.webview.currentWebview();
+ //console.log(self);
+ var shopId = self.id;
+ //console.log(shopId);
+ var page = 1;
+ var pageSize = 10;
+ var isloading = false;
+ getRecommend(page, pageSize);
+
+ function getRecommend(page, pageSize) {
+ var recommenddata = {
+ page: page ? page : 1,
+ pageSize: pageSize ? pageSize : 10
+ }
+ recommenddata.shopId = shopId
+ if (isloading == true) {
+ return;
+ } else {
+ isloading = false;
+ }
+ isloading == true
+ JZL.ajax(qlgUrl("app/shops/getSpecs"), recommenddata, function(data) {
+ //console.log(data);
+ if (data.status == 1) {
+ var html = '';
+ var data = data.data;
+ if ('' == data.Rows) {
+ //console.log("去" );
+ $('.con').append(
+ '
没有更多数据
');
+ return;
+ }
+ $.each(data.Rows, function() {
+ html += '
'
+
+ if (page == 1) {
+ $('.con_con').html(html);
+ } else {
+ $('.con_con').append(html);
+ }
+
+ })
+ } else {
+ mui.alert(data.msg)
+ }
+ isloading == false;
+ })
+
+ }
+
+ document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
+ if (scroll.y == scroll.maxScrollY) {
+ if (isloading == true) {
+ page++;
+ getRecommend(page, pageSize);
+ }
+ }
+ })
+ var specCatsId = "";
+ mui('.con').on('tap', '.bj', function() {
+
+ // //console.log(1);
+ specCatsId = $(this).parent().parent().attr("data-id");
+ //console.log(specCatsId);
+ var setName = $(this).parent().parent().find("label").text();
+ //console.log(setName);
+
+ JZL.openWindow("addproperties.html", parseInt(shopId), {
+ "specCatsId": specCatsId,
+ "setName": setName
+ })
+ })
+ //删除
+ $('.con').on('tap', '.del', function() {
+ specCatsId = $(this).parent().parent().attr("data-id");
+
+ if (confirm('确认删除?')) {
+ JZL.ajax(qlgUrl('app/shops/delSpecSet'), {
+ id: specCatsId,
+ shopId: shopId
+ }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // var data = toJson(data, 1);
+ //console.log(1);
+ //console.log(data);
+ if (data.status == 1) {
+
+ location.reload()
+ } else {
+ mui.alert(data.msg)
+ }
+ })
+
+ }
+ })
+
+ $('.add1').on('tap', function() {
+ JZL.openWindow('addproperties.html',parseInt(shopId));
+ })
+
})
diff --git a/static/app2/js/qrbb.js b/static/app2/js/qrbb.js
old mode 100755
new mode 100644
index a670935..3d7c050
--- a/static/app2/js/qrbb.js
+++ b/static/app2/js/qrbb.js
@@ -1,111 +1,111 @@
-mui.plusReady(function() {
-
- window.addEventListener('reload', function(e) { //执行刷新
- location.reload();
- });
- var page = 1;
- var pageSize = 10;
- // var isloading = false;
- getRecommend();
-
- function getRecommend() {
-
- // //console.log(recommenddata);
- //获取亲人报备列表
- JZL.ajax(qlgUrl('app/auth/getAuthFamilyReportSelect'), {}, function(data) {
- //服务器返回响应,根据响应结果,分析是否登录成功;
- //console.log(data);
- if (data.status == 1) {
- var html = '';
- var data = data.data;
- if (data == '') {
- $('.con').append('
没有更多数据
');
- return;
- }
- $.each(data, function() {
- html += '
' + this.familyName + '(' + this.familyRelations +
- ')
';
- })
- $('.con').html(html);
- } else {
- mui.alert(data.msg)
- }
- });
-
-
- }
- // document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
- // if (scroll.y == scroll.maxScrollY) {
- // if (isloading == true) {
- // page++;
- // getRecommend(page, pageSize);
- // }
- // }
- // })
-
- var qrbbid;
- mui('.con').on('tap', '.bj', function() {
- qrbbid = $(this).attr('data-id')
-
- JZL.openWindow('addqrbb.html', qrbbid);
-
- })
- $('.con').on('tap', '.del', function() {
- qrbbid = $(this).attr('data-id')
- if (confirm('确认删除?')) {
- var lxy_div =
- '
';
-
- $('body').append(lxy_div);
-
- $('.lxy_zz').on('tap', function(e) {
- e.preventDefault();
- e.stopPropagation()
- })
- mui('.lxy_zz_btn').on('tap', '.cancle', function() {
- // $('#home_zhezhao').css('display', 'none');
- $('#home_zhezhao').remove();
- return;
-
- })
-
- mui('.lxy_zz_btn').on('tap', '.sure', function() {
- var payPwd = $('.payword').val();
- //console.log(payPwd);
- if (payPwd == '') {
- mui.alert("请输入密码")
- }
- JZL.ajax(qlgUrl('app/auth/delAuthFamily'), {
- isReport: 1,
- id: qrbbid,
- payPwd: payPwd
- }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- //console.log(data);
- var data = toJson(data, 1);
- if (data.status == 1) {
- $('#home_zhezhao').remove();
- location.reload()
- } else {
- mui.alert(data.msg)
- }
- })
-
- });
- }
-
- })
- /* mui('.mui-content').on('tap','.qrrz',function(){
- JZL.openWindow('qrrz.html', 'qrrz.html');
-
- }) */
- $('.add1').on('tap', function() {
- JZL.openWindow('addqrbb.html', 'addqrbb.html');
- })
-
-
-
-
+mui.plusReady(function() {
+
+ window.addEventListener('reload', function(e) { //执行刷新
+ location.reload();
+ });
+ var page = 1;
+ var pageSize = 10;
+ // var isloading = false;
+ getRecommend();
+
+ function getRecommend() {
+
+ // //console.log(recommenddata);
+ //获取亲人报备列表
+ JZL.ajax(qlgUrl('app/auth/getAuthFamilyReportSelect'), {}, function(data) {
+ //服务器返回响应,根据响应结果,分析是否登录成功;
+ //console.log(data);
+ if (data.status == 1) {
+ var html = '';
+ var data = data.data;
+ if (data == '') {
+ $('.con').append('
没有更多数据
');
+ return;
+ }
+ $.each(data, function() {
+ html += '
' + this.familyName + '(' + this.familyRelations +
+ ')
';
+ })
+ $('.con').html(html);
+ } else {
+ mui.alert(data.msg)
+ }
+ });
+
+
+ }
+ // document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
+ // if (scroll.y == scroll.maxScrollY) {
+ // if (isloading == true) {
+ // page++;
+ // getRecommend(page, pageSize);
+ // }
+ // }
+ // })
+
+ var qrbbid;
+ mui('.con').on('tap', '.bj', function() {
+ qrbbid = $(this).attr('data-id')
+
+ JZL.openWindow('addqrbb.html', qrbbid);
+
+ })
+ $('.con').on('tap', '.del', function() {
+ qrbbid = $(this).attr('data-id')
+ if (confirm('确认删除?')) {
+ var lxy_div =
+ '
';
+
+ $('body').append(lxy_div);
+
+ $('.lxy_zz').on('tap', function(e) {
+ e.preventDefault();
+ e.stopPropagation()
+ })
+ mui('.lxy_zz_btn').on('tap', '.cancle', function() {
+ // $('#home_zhezhao').css('display', 'none');
+ $('#home_zhezhao').remove();
+ return;
+
+ })
+
+ mui('.lxy_zz_btn').on('tap', '.sure', function() {
+ var payPwd = $('.payword').val();
+ //console.log(payPwd);
+ if (payPwd == '') {
+ mui.alert("请输入密码")
+ }
+ JZL.ajax(qlgUrl('app/auth/delAuthFamily'), {
+ isReport: 1,
+ id: qrbbid,
+ payPwd: payPwd
+ }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ //console.log(data);
+ var data = toJson(data, 1);
+ if (data.status == 1) {
+ $('#home_zhezhao').remove();
+ location.reload()
+ } else {
+ mui.alert(data.msg)
+ }
+ })
+
+ });
+ }
+
+ })
+ /* mui('.mui-content').on('tap','.qrrz',function(){
+ JZL.openWindow('qrrz.html', 'qrrz.html');
+
+ }) */
+ $('.add1').on('tap', function() {
+ JZL.openWindow('addqrbb.html', 'addqrbb.html');
+ })
+
+
+
+
})
diff --git a/static/app2/js/qrcode.js b/static/app2/js/qrcode.js
old mode 100755
new mode 100644
diff --git a/static/app2/js/qrrz.js b/static/app2/js/qrrz.js
old mode 100755
new mode 100644
index a2ecb39..84e3a0f
--- a/static/app2/js/qrrz.js
+++ b/static/app2/js/qrrz.js
@@ -1,114 +1,114 @@
-mui.plusReady(function() {
- window.addEventListener('reload', function(e) { //执行刷新
- location.reload();
- });
- //获取亲人认证列表
- var page = 1;
- var pageSize = 10;
- var isjiazai = 1;
- getRecommend(page, pageSize);
-
- function getRecommend(page, pageSize) {
- var recommenddata = {
- page: page ? page : 1,
- pageSize: pageSize ? pageSize : 10
- }
- if (isjiazai == 0) {
- return;
- } else {
- isjiazai = 0;
- }
- JZL.ajax(qlgUrl('app/auth/getAuthFamilyPersonalSelect'), recommenddata, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- //console.log(data);
- if (data.status == 1) {
- var html = '';
- var data = data.data;
- if ('' == data.Rows) {
- $('.mui-scroll').append(
- '
没有更多数据
');
- isjiazai = 0;
- return;
- }
- $.each(data.Rows, function() {
- html += '
' + this.familyName +
- '(' + this.familyRelations +
- ')
';
- // //console.log(this.id);
-
-
- })
- if (page == 1) {
- $('.con').html(html);
- } else {
- $('.con').append(html);
- }
- } else {
-
- }
- isjiazai = 1;
- })
- }
-
- document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
- if (scroll.y == scroll.maxScrollY) {
- if (isjiazai == 1) {
- page++;
- getRecommend(page, pageSize);
- }
- }
- })
- var qrrzid;
- // 编辑
- mui('.con').on('tap', '.bj', function() {
-
- qrrzid = $(this).attr('data-id');
- //console.log(qrrzid);
- JZL.openWindow('addqrrz.html', qrrzid);
- })
- // 删除
- $('.con').on('tap', '.del', function() {
- qrrzid = $(this).attr('data-id');
- if (confirm('确认删除?')) {
- var lxy_div =
- '
';
- $('body').append(lxy_div);
- $('.lxy_zz').on('tap', function(e) {
- e.preventDefault();
- e.stopPropagation()
- })
- mui('.lxy_zz_btn').on('tap', '.cancle', function() {
- $('#home_zhezhao').remove();
- return;
- })
-
- mui('.lxy_zz_btn').on('tap', '.sure', function() {
- var payPwd = $('.payword').val();
- if (payPwd == '') {
- mui.alert("请输入密码")
- }
- JZL.ajax(qlgUrl('app/auth/delAuthFamily'), {
- id: qrrzid,
- payPwd: payPwd
- }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // var data = toJson(data, 1);
-
- if (data.status == 1) {
- $('#home_zhezhao').remove();
- location.reload()
- }
- })
-
- })
- }
- })
- $('.add1').on('tap', function() {
- JZL.openWindow('addqrrz.html', 'addqrrz.html');
-
- })
-
-
-
-
-})
+mui.plusReady(function() {
+ window.addEventListener('reload', function(e) { //执行刷新
+ location.reload();
+ });
+ //获取亲人认证列表
+ var page = 1;
+ var pageSize = 10;
+ var isjiazai = 1;
+ getRecommend(page, pageSize);
+
+ function getRecommend(page, pageSize) {
+ var recommenddata = {
+ page: page ? page : 1,
+ pageSize: pageSize ? pageSize : 10
+ }
+ if (isjiazai == 0) {
+ return;
+ } else {
+ isjiazai = 0;
+ }
+ JZL.ajax(qlgUrl('app/auth/getAuthFamilyPersonalSelect'), recommenddata, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ //console.log(data);
+ if (data.status == 1) {
+ var html = '';
+ var data = data.data;
+ if ('' == data.Rows) {
+ $('.mui-scroll').append(
+ '
没有更多数据
');
+ isjiazai = 0;
+ return;
+ }
+ $.each(data.Rows, function() {
+ html += '
' + this.familyName +
+ '(' + this.familyRelations +
+ ')
';
+ // //console.log(this.id);
+
+
+ })
+ if (page == 1) {
+ $('.con').html(html);
+ } else {
+ $('.con').append(html);
+ }
+ } else {
+
+ }
+ isjiazai = 1;
+ })
+ }
+
+ document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
+ if (scroll.y == scroll.maxScrollY) {
+ if (isjiazai == 1) {
+ page++;
+ getRecommend(page, pageSize);
+ }
+ }
+ })
+ var qrrzid;
+ // 编辑
+ mui('.con').on('tap', '.bj', function() {
+
+ qrrzid = $(this).attr('data-id');
+ //console.log(qrrzid);
+ JZL.openWindow('addqrrz.html', qrrzid);
+ })
+ // 删除
+ $('.con').on('tap', '.del', function() {
+ qrrzid = $(this).attr('data-id');
+ if (confirm('确认删除?')) {
+ var lxy_div =
+ '
';
+ $('body').append(lxy_div);
+ $('.lxy_zz').on('tap', function(e) {
+ e.preventDefault();
+ e.stopPropagation()
+ })
+ mui('.lxy_zz_btn').on('tap', '.cancle', function() {
+ $('#home_zhezhao').remove();
+ return;
+ })
+
+ mui('.lxy_zz_btn').on('tap', '.sure', function() {
+ var payPwd = $('.payword').val();
+ if (payPwd == '') {
+ mui.alert("请输入密码")
+ }
+ JZL.ajax(qlgUrl('app/auth/delAuthFamily'), {
+ id: qrrzid,
+ payPwd: payPwd
+ }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // var data = toJson(data, 1);
+
+ if (data.status == 1) {
+ $('#home_zhezhao').remove();
+ location.reload()
+ }
+ })
+
+ })
+ }
+ })
+ $('.add1').on('tap', function() {
+ JZL.openWindow('addqrrz.html', 'addqrrz.html');
+
+ })
+
+
+
+
+})
diff --git a/static/app2/js/recommend.js b/static/app2/js/recommend.js
old mode 100755
new mode 100644
index 6df2458..2a0cf82
--- a/static/app2/js/recommend.js
+++ b/static/app2/js/recommend.js
@@ -1,45 +1,46 @@
-mui.plusReady(function() {
-
- //跳转到商品详情
- mui("body").on('tap', '.recommend_con_block', function() {
- // var tj = plus.webview.create('search.html');
- // tj.show();
- // mui.alert(e.target.attributes["data-id"].nodeValue);
- var data_id = this.attributes["data-goodsId"].nodeValue;
- var goodsType =$(this).attr('data-goodsType')
- // //console.log(this.attributes["data-id"].nodeValue);
- mui.openWindow({
- url: 'details.html',
- id: 'details.html' + data_id,
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- data_id: data_id,
- goodsType : goodsType?goodsType :""
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
- })
-
+mui.plusReady(function() {
+
+ //跳转到商品详情
+ mui("body").on('tap', '.recommend_con_block', function() {
+ // var tj = plus.webview.create('search.html');
+ // tj.show();
+ // mui.alert(e.target.attributes["data-id"].nodeValue);
+ var data_id = this.attributes["data-goodsId"].nodeValue;
+ var goodsType =$(this).attr('data-goodsType');
+ // //console.log(this.attributes["data-id"].nodeValue);
+ mui.openWindow({
+ url: 'details.html',
+ id: 'details.html' + data_id,
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ data_id: data_id,
+ goodsType : goodsType?goodsType :"",
+ from_id: from_id?from_id:0
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+ })
+
})
\ No newline at end of file
diff --git a/static/app2/js/reg.js b/static/app2/js/reg.js
old mode 100755
new mode 100644
index aebde9f..e89896d
--- a/static/app2/js/reg.js
+++ b/static/app2/js/reg.js
@@ -1,499 +1,499 @@
-// mui.init({
-// beforeback: function() { //获得父页面的webview
-// var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
-// mui.fire(list, 'refresh');
-// //返回true,继续页面关闭逻辑
-// return true;
-// }
-// });
-
-mui.plusReady(function() {
-
- var wait = 120;
-
- // 判断用户名是否存在
- $('#loginName').on('blur', function() {
- var loginName = $('#loginName').val();
- JZL.ajax('http://t.ect99.com/app/users/check_login_name', {
- loginName: loginName
- }, function(data) {
- // console.log(data);
- if (1 != data.status) {
- mui.alert(data.msg)
- }
- })
- })
-
- function GetQueryString(name) {
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
- console.log(reg);
- var r = window.location.search.substr(1).match(reg);
- if (r != null)
- return unescape(r[2]);
- return null;
- }
-
- var pName = GetQueryString('pName') ? GetQueryString('pName') : localStorage.getItem('pName');
-
-// if (!pName) {
-// pName = localStorage.getItem('pName');
-// var indexNum = pName.indexOf('&');
-// if (indexNum > 0) {
-// pName = pName.slice(0, indexNum);
-// }
-// }
-//
- if (pName) {
- console.log(pName);
-// $('#pName').val(pname);;
-// $('#pName').attr('disabled', 'disabled');
- }
- // 推荐人信息
- //var PName = "";
- $('#pName').on('blur', function() {
- pName = $('#pName').val();
- if ('' != pName) {
- if (!(
- /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/
- .test(pName))) {
- mui.alert("手机号码有误,请重填!");
- return;
- }
- $('.pNameCode').show();
-
- mui('.row').on('tap', '#mobileCode1', function() {
- $(this).attr("disabled", true);
- JZL.ajax('http://t.ect99.com/app/users/getPhoneVerifyCode', {
- userPhone: pName
- }, function(data) {
- if (1 == data.status) {
- time()
- } else {
- mui.alert(data.msg);
- }
- $('#mobileCode1').removeAttr('disabled');
-
- })
- })
-
-
-
- } else {
- $('.pNameCode').hide();
- }
-
- })
- // JZL.ajax(qlgUrl('app/users/check_login_name'),{loginName:loginName},function (data) {
- // // console.log(data);
- //
- // if (1 != data.status) {
- // mui.alert(data.msg)
- // }
- // })
- function time() {
- if (wait == 0) {
- $('#mobileCode').removeAttr("disabled");
- $('#mobileCode').val("重新发送");
- wait = 120;
- } else {
- $('#mobileCode').attr("disabled", true);
- $('#mobileCode').val("重新发送(" + wait + ")");
- wait--;
- setTimeout(function() {
- time()
- },
- 1000)
- }
- }
- //获取验证码
- mui('.row').on('tap', '#mobileCode', function() {
- var loginName = $('#loginName').val();
- if (loginName == '') {
- mui.alert('手机号不能为空!');
- return;
- }
- // if (!(
- // /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/
- // .test(loginName))) {
- // mui.alert("手机号码有误,请重填!");
- // return;
- // }
- $(this).attr("disabled", true);
- mui.ajax('http://t.ect99.com/app/users/getPhoneVerifyCode', {
-
- data: {
- userPhone: loginName
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒
- success: function(data) {
- console.log(data);
- //服务器返回响应,根据响应结果,分析是否登录成功;
- if (data.status == 1) {
- time();
- } else {
- mui.alert(data.msg);
- }
- $('#mobileCode').removeAttr('disabled');
- },
-
- error: function(xhr, type, errorThrown) {
- //异常处理;
- mui.alert(type)
- // mui.alert(type);
- }
- });
- })
- //注册协议
- mui.ajax('http://t.ect99.com/app/Tags/articleDetail', {
- data: {
- articleId: 114
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) {
- console.log(data);
- // if(data.status==1){
- // console.log(1);
- var html1 = ''
- html1 = '
' + data.articleContent + '
'
- $('.zcxycontent').append(html1)
- // }
- },
- error: function(xhr, type, errorThrown) {
-
- }
- });
- //上传图片
-
- var files = []; //存储文件信息的数组
- var fname = ""; //表示文件名,例如 XXXX.jpg;
- var expire = 0;
- var pathName = '';
- var inpId = '';
- var keyname = '';
- var imgId = '';
- var isZip = 1;
- var qualityNum = 90;
- var response = ';'
- var UP = UP || {};
- UP.isBatch = 0;
- UP.init = function(inputId, path, imageId, isBatch, isZipImg, quality) {
- inpId = inputId;
- pathName = path;
- imgId = imageId;
- if (typeof(isBatch) != 'undefined') {
- UP.isBatch = isBatch;
- }
- if (typeof(isZipImg) != 'undefined') {
- // console.log(typeof(isZipImg));
- isZip = isZipImg;
- }
- if (typeof(quality) != 'undefined') {
- qualityNum = quality;
- }
-
- }
-
- function send_request() {
- var xmlhttp = null;
- if (window.XMLHttpRequest) {
- xmlhttp = new XMLHttpRequest();
- } else if (window.ActiveXObject) {
- xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
- }
-
- if (xmlhttp != null) {
- // console.log(dir)
- serverUrl = 'http://t.ect99.com/oss/get.php?dir=' + pathName;
- // serverUrl = 'https://img.zgqlg.com.cn/oss/get.php?dir=' + pathName;
-
- xmlhttp.open("GET", serverUrl, false);
- xmlhttp.send(null);
- return xmlhttp.responseText;
- } else {
- mui.alert("Your browser does not support XMLHTTP.");
- }
-
- }
-
- function get_signature() {
- //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲
- now = timestamp = Date.parse(new Date()) / 1000;
- if (expire < now + 3) {
- body = send_request()
- var obj = eval("(" + body + ")");
- response = obj;
- // console.log(obj);
- }
- return response;
- };
- // 上传文件
- function upload(callback) {
- // console.log(files);
- if (files.length <= 0) {
- mui.toast('没有添加上传文件');
- return;
- }
- var obj = get_signature();
- if (obj) {
- server = obj['host'];
- policyBase64 = obj['policy'];
- accessid = obj['accessid'];
- signature = obj['signature'];
- expire = parseInt(obj['expire']);
- callbackbody = obj['callback'];
- path = obj['dir'];
-
- } else {
- mui.toast('初始化失败');
- return;
- }
-
- var wt = plus.nativeUI.showWaiting();
- var task = plus.uploader.createUpload(server, {
- method: "POST"
- }, function(t, status) {
- //上传完成
- if (status == 200) {
- wt.close();
- if (1 == UP.isBatch) {
- callback(t, status, keyname, server + '/' + keyname);
- } else {
- document.getElementById(inpId).value = keyname;
- var ele = document.getElementById(imgId);
- ele.src = server + '/' + keyname;
- ele.setAttribute('data-src', keyname);
- mui.toast('上传成功');
- //至此上传成功,上传后的图片完整地址为server+testName
- //keyname
- }
-
- } else {
- wt.close();
- mui.toast('上传失败:' + status);
- }
- });
- var suffix1 = get_suffix(fname); //文件后缀 例如 .jpg
- keyname = path + new Date().getTime() + suffix1;
- task.addData("key", keyname);
- task.addData("policy", policyBase64);
- task.addData("OSSAccessKeyId", accessid);
- task.addData("success_action_status", "200");
- // task.addData("callback", callbackbody);
- task.addData("signature", signature);
- var f = files[files.length - 1];
- // console.log(f)
-
- task.addFile(f.path, {
- key: "file",
- name: "file",
- mime: "image/jpeg"
- });
- //files.length = 0;
- task.start();
-
- }
-
- //得到文件名的后缀
- function get_suffix(filename) {
- var pos = filename.lastIndexOf('.');
- var suffix = '';
- if (pos != -1) {
- suffix = filename.substring(pos)
- }
- return suffix;
- }
- // 拍照添加文件
- function appendByCamera(callback) {
- plus.camera.getCamera().captureImage(function(p) {
- uploadImg(p, callback);
- });
- }
- // 从相册添加文件
- function appendByGallery(callback) {
- plus.gallery.pick(function(p) {
- uploadImg(p, callback);
- });
- }
-
- // 添加文件
- var index = 1;
-
- function uploadImg(p, callback) {
- if (1 == isZip) {
- compressImg(p, callback);
- } else {
- appendFile(p, callback)
- }
- }
-
- function appendFile(p, callback) {
- // var fe = document.getElementById(fileId);
- var n = p.substr(p.lastIndexOf('/') + 1);
- // fname = n/////////;
- files.push({
- name: "uploadkey" + index,
- path: p
- });
- //console.log(3);
- // index++;
- upload(callback);
- }
-
- function compressImg(src, callback) {
- var filename = src.substring(src.lastIndexOf('/') + 1);
- var opions = {
- src: src,
- dst: '_doc/tmp/' + filename,
- overwrite: true,
- //width: '300px', //这里指定了宽度,同样可以修改
- format: 'jpg',
- quality: qualityNum //图片质量不再修改,以免失真
- };
- var successCB = function(evt) {
- // console.log(JSON.stringify(evt));
- fname = filename;
- // files[0]={
- // name: "uploadkey",
- // path: evt.target
- // };
- files.push({
- name: "uploadkey" + index,
- path: evt.target
- });
- // index++;
- //上传
- upload(callback);
- //_this.avatar(evt.target);
- };
- var errorCB = function(err) {
- appendFile(src, callback);
-
- //console.log(JSON.stringify(err));
- //mui.toast("图片压缩失败");i m
- };
- plus.zip.compressImage(opions, successCB, errorCB);
- };
-
- function openCamera(callback) {
- plus.nativeUI.actionSheet({
- cancel: "取消",
- buttons: [{
- title: "拍照"
- },
- {
- title: "从相册中选择"
- }
- ]
- }, function(e) { //1 是拍照 2 从相册中选择
- switch (e.index) {
- case 1:
- appendByCamera(callback);
- break;
- case 2:
- appendByGallery(callback);
- break;
- }
- });
- }
- $(".photos").on("tap", '.regConfirm', function() {
- // UP.init("accountBookImg", "test", "accountBookImgTag")
-
- UP.init("regConfirmImg", "test", "regConfirmImg")
- openCamera()
- })
-
-
- mui('.down').on('tap', '.btn', function() {
- var loginName = $('#loginName').val();
- var mobileCode = $('.yzm').val();
- var loginPwd = $('#loginPwd').val();
- var reUserPwd = $('#reUserPwd').val();
- var mobileCode1 = $('#mobileCode1').val() ? $('#mobileCode1').val() : ""; //推荐人验证码
-
-
- pName = $('#pName').val();
-
- // var verifyCode = $('.tpyzm').val();
- var regConfirmImg = $('#regConfirmImg').val();
- if (loginName == '') {
- mui.alert('手机号不能为空!');
- return;
- }
- if (!(
- /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/
- .test(loginName))) {
- mui.alert("手机号码有误,请重填!");
- return;
- }
- if (mobileCode == '') {
- mui.alert('验证码不能为空!');
- return;
- }
- if (loginPwd == '') {
- mui.alert('密码不能为空!');
- return;
- }
- if (reUserPwd == '') {
- mui.alert('确认密码不能为空!');
- return;
- }
- if (loginPwd.length < 6) {
- mui.alert('密码不能小于6位!');
- return;
- }
- if (!(loginPwd == reUserPwd)) {
- mui.alert('两次密码不一致!');
- return;
- }
- if (regConfirmImg == '') {
- mui.alert('请上传确认书照片');
- return;
- }
- if (pName != '') {
- if ('' == mobileCode1) {
- mui.alert('请输入推荐人验证码');
- return;
- }
- }
- $(this).attr("disabled", true);
- mui.ajax('http://t.ect99.com/app/users/register', {
- data: {
- loginName: loginName,
- mobileCode: mobileCode,
- loginPwd: loginPwd,
- reUserPwd: reUserPwd,
- pName: pName,
- nameType: 3,
- regConfirmImg: regConfirmImg,
- mobileCode1: mobileCode1
- // verifyCode: verifyCode
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒
- success: function(data) {
- //服务器返回响应,根据响应结果,分析是否登录成功;
- mui.alert(data.msg);
-
- if (data.status == 1) {
- // mui.back();
- plus.runtime.open
- } else {
- // $('.yzmhh').attr('src', hyhUrl('mobile/users/getverify?rnd=' + Math.random()));
- }
- $('.btn').removeAttr('disabled');
- },
-
- error: function(xhr, type, errorThrown) {
- //异常处理;
- // mui.alert(type);
- }
- });
-
- })
-
+// mui.init({
+// beforeback: function() { //获得父页面的webview
+// var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
+// mui.fire(list, 'refresh');
+// //返回true,继续页面关闭逻辑
+// return true;
+// }
+// });
+
+mui.plusReady(function() {
+
+ var wait = 120;
+
+ // 判断用户名是否存在
+ $('#loginName').on('blur', function() {
+ var loginName = $('#loginName').val();
+ JZL.ajax('http://t.ect99.com/app/users/check_login_name', {
+ loginName: loginName
+ }, function(data) {
+ // console.log(data);
+ if (1 != data.status) {
+ mui.alert(data.msg)
+ }
+ })
+ })
+
+ function GetQueryString(name) {
+ var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
+ console.log(reg);
+ var r = window.location.search.substr(1).match(reg);
+ if (r != null)
+ return unescape(r[2]);
+ return null;
+ }
+
+ var pName = GetQueryString('pName') ? GetQueryString('pName') : localStorage.getItem('pName');
+
+// if (!pName) {
+// pName = localStorage.getItem('pName');
+// var indexNum = pName.indexOf('&');
+// if (indexNum > 0) {
+// pName = pName.slice(0, indexNum);
+// }
+// }
+//
+ if (pName) {
+ console.log(pName);
+// $('#pName').val(pname);;
+// $('#pName').attr('disabled', 'disabled');
+ }
+ // 推荐人信息
+ //var PName = "";
+ $('#pName').on('blur', function() {
+ pName = $('#pName').val();
+ if ('' != pName) {
+ if (!(
+ /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/
+ .test(pName))) {
+ mui.alert("手机号码有误,请重填!");
+ return;
+ }
+ $('.pNameCode').show();
+
+ mui('.row').on('tap', '#mobileCode1', function() {
+ $(this).attr("disabled", true);
+ JZL.ajax('http://t.ect99.com/app/users/getPhoneVerifyCode', {
+ userPhone: pName
+ }, function(data) {
+ if (1 == data.status) {
+ time()
+ } else {
+ mui.alert(data.msg);
+ }
+ $('#mobileCode1').removeAttr('disabled');
+
+ })
+ })
+
+
+
+ } else {
+ $('.pNameCode').hide();
+ }
+
+ })
+ // JZL.ajax(qlgUrl('app/users/check_login_name'),{loginName:loginName},function (data) {
+ // // console.log(data);
+ //
+ // if (1 != data.status) {
+ // mui.alert(data.msg)
+ // }
+ // })
+ function time() {
+ if (wait == 0) {
+ $('#mobileCode').removeAttr("disabled");
+ $('#mobileCode').val("重新发送");
+ wait = 120;
+ } else {
+ $('#mobileCode').attr("disabled", true);
+ $('#mobileCode').val("重新发送(" + wait + ")");
+ wait--;
+ setTimeout(function() {
+ time()
+ },
+ 1000)
+ }
+ }
+ //获取验证码
+ mui('.row').on('tap', '#mobileCode', function() {
+ var loginName = $('#loginName').val();
+ if (loginName == '') {
+ mui.alert('手机号不能为空!');
+ return;
+ }
+ // if (!(
+ // /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/
+ // .test(loginName))) {
+ // mui.alert("手机号码有误,请重填!");
+ // return;
+ // }
+ $(this).attr("disabled", true);
+ mui.ajax('http://t.ect99.com/app/users/getPhoneVerifyCode', {
+
+ data: {
+ userPhone: loginName
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒
+ success: function(data) {
+ console.log(data);
+ //服务器返回响应,根据响应结果,分析是否登录成功;
+ if (data.status == 1) {
+ time();
+ } else {
+ mui.alert(data.msg);
+ }
+ $('#mobileCode').removeAttr('disabled');
+ },
+
+ error: function(xhr, type, errorThrown) {
+ //异常处理;
+ mui.alert(type)
+ // mui.alert(type);
+ }
+ });
+ })
+ //注册协议
+ mui.ajax('http://t.ect99.com/app/Tags/articleDetail', {
+ data: {
+ articleId: 114
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) {
+ console.log(data);
+ // if(data.status==1){
+ // console.log(1);
+ var html1 = ''
+ html1 = '
' + data.articleContent + '
'
+ $('.zcxycontent').append(html1)
+ // }
+ },
+ error: function(xhr, type, errorThrown) {
+
+ }
+ });
+ //上传图片
+
+ var files = []; //存储文件信息的数组
+ var fname = ""; //表示文件名,例如 XXXX.jpg;
+ var expire = 0;
+ var pathName = '';
+ var inpId = '';
+ var keyname = '';
+ var imgId = '';
+ var isZip = 1;
+ var qualityNum = 90;
+ var response = ';'
+ var UP = UP || {};
+ UP.isBatch = 0;
+ UP.init = function(inputId, path, imageId, isBatch, isZipImg, quality) {
+ inpId = inputId;
+ pathName = path;
+ imgId = imageId;
+ if (typeof(isBatch) != 'undefined') {
+ UP.isBatch = isBatch;
+ }
+ if (typeof(isZipImg) != 'undefined') {
+ // console.log(typeof(isZipImg));
+ isZip = isZipImg;
+ }
+ if (typeof(quality) != 'undefined') {
+ qualityNum = quality;
+ }
+
+ }
+
+ function send_request() {
+ var xmlhttp = null;
+ if (window.XMLHttpRequest) {
+ xmlhttp = new XMLHttpRequest();
+ } else if (window.ActiveXObject) {
+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+
+ if (xmlhttp != null) {
+ // console.log(dir)
+ serverUrl = 'http://t.ect99.com/oss/get.php?dir=' + pathName;
+ // serverUrl = 'https://img.zgqlg.com.cn/oss/get.php?dir=' + pathName;
+
+ xmlhttp.open("GET", serverUrl, false);
+ xmlhttp.send(null);
+ return xmlhttp.responseText;
+ } else {
+ mui.alert("Your browser does not support XMLHTTP.");
+ }
+
+ }
+
+ function get_signature() {
+ //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲
+ now = timestamp = Date.parse(new Date()) / 1000;
+ if (expire < now + 3) {
+ body = send_request()
+ var obj = eval("(" + body + ")");
+ response = obj;
+ // console.log(obj);
+ }
+ return response;
+ };
+ // 上传文件
+ function upload(callback) {
+ // console.log(files);
+ if (files.length <= 0) {
+ mui.toast('没有添加上传文件');
+ return;
+ }
+ var obj = get_signature();
+ if (obj) {
+ server = obj['host'];
+ policyBase64 = obj['policy'];
+ accessid = obj['accessid'];
+ signature = obj['signature'];
+ expire = parseInt(obj['expire']);
+ callbackbody = obj['callback'];
+ path = obj['dir'];
+
+ } else {
+ mui.toast('初始化失败');
+ return;
+ }
+
+ var wt = plus.nativeUI.showWaiting();
+ var task = plus.uploader.createUpload(server, {
+ method: "POST"
+ }, function(t, status) {
+ //上传完成
+ if (status == 200) {
+ wt.close();
+ if (1 == UP.isBatch) {
+ callback(t, status, keyname, server + '/' + keyname);
+ } else {
+ document.getElementById(inpId).value = keyname;
+ var ele = document.getElementById(imgId);
+ ele.src = server + '/' + keyname;
+ ele.setAttribute('data-src', keyname);
+ mui.toast('上传成功');
+ //至此上传成功,上传后的图片完整地址为server+testName
+ //keyname
+ }
+
+ } else {
+ wt.close();
+ mui.toast('上传失败:' + status);
+ }
+ });
+ var suffix1 = get_suffix(fname); //文件后缀 例如 .jpg
+ keyname = path + new Date().getTime() + suffix1;
+ task.addData("key", keyname);
+ task.addData("policy", policyBase64);
+ task.addData("OSSAccessKeyId", accessid);
+ task.addData("success_action_status", "200");
+ // task.addData("callback", callbackbody);
+ task.addData("signature", signature);
+ var f = files[files.length - 1];
+ // console.log(f)
+
+ task.addFile(f.path, {
+ key: "file",
+ name: "file",
+ mime: "image/jpeg"
+ });
+ //files.length = 0;
+ task.start();
+
+ }
+
+ //得到文件名的后缀
+ function get_suffix(filename) {
+ var pos = filename.lastIndexOf('.');
+ var suffix = '';
+ if (pos != -1) {
+ suffix = filename.substring(pos)
+ }
+ return suffix;
+ }
+ // 拍照添加文件
+ function appendByCamera(callback) {
+ plus.camera.getCamera().captureImage(function(p) {
+ uploadImg(p, callback);
+ });
+ }
+ // 从相册添加文件
+ function appendByGallery(callback) {
+ plus.gallery.pick(function(p) {
+ uploadImg(p, callback);
+ });
+ }
+
+ // 添加文件
+ var index = 1;
+
+ function uploadImg(p, callback) {
+ if (1 == isZip) {
+ compressImg(p, callback);
+ } else {
+ appendFile(p, callback)
+ }
+ }
+
+ function appendFile(p, callback) {
+ // var fe = document.getElementById(fileId);
+ var n = p.substr(p.lastIndexOf('/') + 1);
+ // fname = n/////////;
+ files.push({
+ name: "uploadkey" + index,
+ path: p
+ });
+ //console.log(3);
+ // index++;
+ upload(callback);
+ }
+
+ function compressImg(src, callback) {
+ var filename = src.substring(src.lastIndexOf('/') + 1);
+ var opions = {
+ src: src,
+ dst: '_doc/tmp/' + filename,
+ overwrite: true,
+ //width: '300px', //这里指定了宽度,同样可以修改
+ format: 'jpg',
+ quality: qualityNum //图片质量不再修改,以免失真
+ };
+ var successCB = function(evt) {
+ // console.log(JSON.stringify(evt));
+ fname = filename;
+ // files[0]={
+ // name: "uploadkey",
+ // path: evt.target
+ // };
+ files.push({
+ name: "uploadkey" + index,
+ path: evt.target
+ });
+ // index++;
+ //上传
+ upload(callback);
+ //_this.avatar(evt.target);
+ };
+ var errorCB = function(err) {
+ appendFile(src, callback);
+
+ //console.log(JSON.stringify(err));
+ //mui.toast("图片压缩失败");i m
+ };
+ plus.zip.compressImage(opions, successCB, errorCB);
+ };
+
+ function openCamera(callback) {
+ plus.nativeUI.actionSheet({
+ cancel: "取消",
+ buttons: [{
+ title: "拍照"
+ },
+ {
+ title: "从相册中选择"
+ }
+ ]
+ }, function(e) { //1 是拍照 2 从相册中选择
+ switch (e.index) {
+ case 1:
+ appendByCamera(callback);
+ break;
+ case 2:
+ appendByGallery(callback);
+ break;
+ }
+ });
+ }
+ $(".photos").on("tap", '.regConfirm', function() {
+ // UP.init("accountBookImg", "test", "accountBookImgTag")
+
+ UP.init("regConfirmImg", "test", "regConfirmImg")
+ openCamera()
+ })
+
+
+ mui('.down').on('tap', '.btn', function() {
+ var loginName = $('#loginName').val();
+ var mobileCode = $('.yzm').val();
+ var loginPwd = $('#loginPwd').val();
+ var reUserPwd = $('#reUserPwd').val();
+ var mobileCode1 = $('#mobileCode1').val() ? $('#mobileCode1').val() : ""; //推荐人验证码
+
+
+ pName = $('#pName').val();
+
+ // var verifyCode = $('.tpyzm').val();
+ var regConfirmImg = $('#regConfirmImg').val();
+ if (loginName == '') {
+ mui.alert('手机号不能为空!');
+ return;
+ }
+ if (!(
+ /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/
+ .test(loginName))) {
+ mui.alert("手机号码有误,请重填!");
+ return;
+ }
+ if (mobileCode == '') {
+ mui.alert('验证码不能为空!');
+ return;
+ }
+ if (loginPwd == '') {
+ mui.alert('密码不能为空!');
+ return;
+ }
+ if (reUserPwd == '') {
+ mui.alert('确认密码不能为空!');
+ return;
+ }
+ if (loginPwd.length < 6) {
+ mui.alert('密码不能小于6位!');
+ return;
+ }
+ if (!(loginPwd == reUserPwd)) {
+ mui.alert('两次密码不一致!');
+ return;
+ }
+ if (regConfirmImg == '') {
+ mui.alert('请上传确认书照片');
+ return;
+ }
+ if (pName != '') {
+ if ('' == mobileCode1) {
+ mui.alert('请输入推荐人验证码');
+ return;
+ }
+ }
+ $(this).attr("disabled", true);
+ mui.ajax('http://t.ect99.com/app/users/register', {
+ data: {
+ loginName: loginName,
+ mobileCode: mobileCode,
+ loginPwd: loginPwd,
+ reUserPwd: reUserPwd,
+ pName: pName,
+ nameType: 3,
+ regConfirmImg: regConfirmImg,
+ mobileCode1: mobileCode1
+ // verifyCode: verifyCode
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒
+ success: function(data) {
+ //服务器返回响应,根据响应结果,分析是否登录成功;
+ mui.alert(data.msg);
+
+ if (data.status == 1) {
+ // mui.back();
+ plus.runtime.open
+ } else {
+ // $('.yzmhh').attr('src', hyhUrl('mobile/users/getverify?rnd=' + Math.random()));
+ }
+ $('.btn').removeAttr('disabled');
+ },
+
+ error: function(xhr, type, errorThrown) {
+ //异常处理;
+ // mui.alert(type);
+ }
+ });
+
+ })
+
})
diff --git a/static/app2/js/register.js b/static/app2/js/register.js
old mode 100755
new mode 100644
index 4a872fe..eb388ab
--- a/static/app2/js/register.js
+++ b/static/app2/js/register.js
@@ -1,201 +1,201 @@
-mui.init({
- beforeback: function() { //获得父页面的webview
- var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
- mui.fire(list, 'refresh');
- //返回true,继续页面关闭逻辑
- return true;
- }
-});
-
-mui.plusReady(function() {
- var wait = 120;
- // var html =
- // '
';
- //
- // $('.con').append(html);
- // 判断用户名是否存在
- $('#loginName').on('blur', function() {
- var loginName = $('#loginName').val();
- if ('' == loginName) {
- mui.mui.alert('用户名不能为空')
- return;
- }
- if (6 > loginName.length) {
- mui.alert('用户名不能小于6个字符')
- return;
- }
- JZL.ajax(qlgUrl('app/users/check_login_name'), {
- loginName: loginName
- }, function(data) {
- // //console.log(data);
- if (1 != data.status) {
- mui.alert(data.msg)
- }
- })
- })
- // 推荐人信息
- $('.pNameCode').hide();
-
- var PName = "";
- $('#pName').on('blur', function() {
- pName = $('#pName').val();
- if ('' != pName) {
-
- if (!(
- /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/
- .test(pName))) {
- mui.alert("手机号码有误,请重填!");
- return;
- }
- $('.pNameCode').show();
- mui('.row').on('tap', '#getMobileCode', function() {
- var that=$(this)
- that.attr("disabled", true);
- JZL.ajax(qlgUrl('app/users/getPhoneVerifyCode'), {
- userPhone: pName
- }, function(data) {
- if (1 == data.status) {
- time()
- } else {
- mui.alert(data.msg);
- }
- that.removeAttr('disabled');
-
- })
- })
-
-
-
- } else {
- $('.pNameCode').hide();
- }
-
- })
-
- function time() {
- if (wait == 0) {
- $('#getMobileCode').removeAttr("disabled");
- $('#getMobileCode').val("重新发送");
- wait = 120;
- } else {
- $('#getMobileCode').attr("disabled", true);
- $('#getMobileCode').val("重新发送(" + wait + ")");
- wait--;
- setTimeout(function() {
- time()
- },
- 1000)
- }
- }
-
- //注册协议
- mui.ajax(qlgUrl('app/Tags/articleDetail'), {
- data: {
- articleId: 114
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) {
- //console.log(data);
- // if(data.status==1){
- // //console.log(1);
-
- $('.zcxycontent').html(data.articleContent)
- // }
- },
- error: function(xhr, type, errorThrown) {
-
- }
- });
- //上传图片
- $(".photos").on("tap", '.regConfirm', function() {
- // UP.init("accountBookImg", "test", "accountBookImgTag")
-
- UP.init("regConfirmImg", "test", "regConfirm")
- openCamera()
- })
-
-
- mui('.down').on('tap', '.btn', function() {
- var loginName = $('#loginName').val();
- // var mobileCode = $('.yzm').val();
- var loginPwd = $('#loginPwd').val();
- var reUserPwd = $('#reUserPwd').val();
- var mobileCode = $('#mobileCode').val() ? $('#mobileCode').val() : ""; //推荐人验证码
- var payPwd = $('#loginPaywd').val();
- var reUserPaywd = $('#reUserPaywd').val();
- var pName = $('#pName').val();
-
- // var verifyCode = $('.tpyzm').val();
- var regConfirmImg = $('#regConfirmImg').val();
- if (loginName == '') {
- mui.alert('用户名不能为空!');
- return;
- }
- if (loginPwd.length < 6) {
- mui.alert('登录密码不能小于6位!');
- return;
- }
- if (!(loginPwd == reUserPwd)) {
- mui.alert('两次登录密码不一致!');
- return;
- }
- if (payPwd.length < 6) {
- mui.alert('操作密码不能小于6位!');
- return;
- }
- if (payPwd != reUserPaywd) {
- mui.alert('两次操作密码不一致!');
- return;
- }
- if (regConfirmImg == '') {
- mui.alert('请上传确认书照片');
- return;
- }
- if (pName != '') {
- if ('' == mobileCode) {
- mui.alert('请输入推荐人验证码');
- return;
- }
- }
- var ajaxData={
- loginName: loginName,
- // mobileCode: mobileCode,
- loginPwd: loginPwd,
- payPwd: payPwd,
- pName: pName,
- // nameType: 3,
- regConfirmImg: regConfirmImg,
- mobileCode: mobileCode
- };
-
- var that = $(this)
- that.attr("disabled", true);
-
- mui.ajax(qlgUrl('app/users/register'), {
- data:ajaxData,
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒
- success: function(data) {
- //服务器返回响应,根据响应结果,分析是否登录成功;
- mui.alert(data.msg);
-
- if (data.status == 1) {
- mui.back();
- } else {
- // $('.yzmhh').attr('src', hyhUrl('mobile/users/getverify?rnd=' + Math.random()));
- }
- that.removeAttr('disabled');
- },
-
- error: function(xhr, type, errorThrown) {
- //异常处理;
- // mui.alert(type);
- }
- });
-
- })
-
-})
+mui.init({
+ beforeback: function() { //获得父页面的webview
+ var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
+ mui.fire(list, 'refresh');
+ //返回true,继续页面关闭逻辑
+ return true;
+ }
+});
+
+mui.plusReady(function() {
+ var wait = 120;
+ // var html =
+ // '
';
+ //
+ // $('.con').append(html);
+ // 判断用户名是否存在
+ $('#loginName').on('blur', function() {
+ var loginName = $('#loginName').val();
+ if ('' == loginName) {
+ mui.mui.alert('用户名不能为空')
+ return;
+ }
+ if (6 > loginName.length) {
+ mui.alert('用户名不能小于6个字符')
+ return;
+ }
+ JZL.ajax(qlgUrl('app/users/check_login_name'), {
+ loginName: loginName
+ }, function(data) {
+ // //console.log(data);
+ if (1 != data.status) {
+ mui.alert(data.msg)
+ }
+ })
+ })
+ // 推荐人信息
+ $('.pNameCode').hide();
+
+ var PName = "";
+ $('#pName').on('blur', function() {
+ pName = $('#pName').val();
+ if ('' != pName) {
+
+ if (!(
+ /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/
+ .test(pName))) {
+ mui.alert("手机号码有误,请重填!");
+ return;
+ }
+ $('.pNameCode').show();
+ mui('.row').on('tap', '#getMobileCode', function() {
+ var that=$(this)
+ that.attr("disabled", true);
+ JZL.ajax(qlgUrl('app/users/getPhoneVerifyCode'), {
+ userPhone: pName
+ }, function(data) {
+ if (1 == data.status) {
+ time()
+ } else {
+ mui.alert(data.msg);
+ }
+ that.removeAttr('disabled');
+
+ })
+ })
+
+
+
+ } else {
+ $('.pNameCode').hide();
+ }
+
+ })
+
+ function time() {
+ if (wait == 0) {
+ $('#getMobileCode').removeAttr("disabled");
+ $('#getMobileCode').val("重新发送");
+ wait = 120;
+ } else {
+ $('#getMobileCode').attr("disabled", true);
+ $('#getMobileCode').val("重新发送(" + wait + ")");
+ wait--;
+ setTimeout(function() {
+ time()
+ },
+ 1000)
+ }
+ }
+
+ //注册协议
+ mui.ajax(qlgUrl('app/Tags/articleDetail'), {
+ data: {
+ articleId: 114
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) {
+ //console.log(data);
+ // if(data.status==1){
+ // //console.log(1);
+
+ $('.zcxycontent').html(data.articleContent)
+ // }
+ },
+ error: function(xhr, type, errorThrown) {
+
+ }
+ });
+ //上传图片
+ $(".photos").on("tap", '.regConfirm', function() {
+ // UP.init("accountBookImg", "test", "accountBookImgTag")
+
+ UP.init("regConfirmImg", "test", "regConfirm")
+ openCamera()
+ })
+
+
+ mui('.down').on('tap', '.btn', function() {
+ var loginName = $('#loginName').val();
+ // var mobileCode = $('.yzm').val();
+ var loginPwd = $('#loginPwd').val();
+ var reUserPwd = $('#reUserPwd').val();
+ var mobileCode = $('#mobileCode').val() ? $('#mobileCode').val() : ""; //推荐人验证码
+ var payPwd = $('#loginPaywd').val();
+ var reUserPaywd = $('#reUserPaywd').val();
+ var pName = $('#pName').val();
+
+ // var verifyCode = $('.tpyzm').val();
+ var regConfirmImg = $('#regConfirmImg').val();
+ if (loginName == '') {
+ mui.alert('用户名不能为空!');
+ return;
+ }
+ if (loginPwd.length < 6) {
+ mui.alert('登录密码不能小于6位!');
+ return;
+ }
+ if (!(loginPwd == reUserPwd)) {
+ mui.alert('两次登录密码不一致!');
+ return;
+ }
+ if (payPwd.length < 6) {
+ mui.alert('操作密码不能小于6位!');
+ return;
+ }
+ if (payPwd != reUserPaywd) {
+ mui.alert('两次操作密码不一致!');
+ return;
+ }
+ if (regConfirmImg == '') {
+ mui.alert('请上传确认书照片');
+ return;
+ }
+ if (pName != '') {
+ if ('' == mobileCode) {
+ mui.alert('请输入推荐人验证码');
+ return;
+ }
+ }
+ var ajaxData={
+ loginName: loginName,
+ // mobileCode: mobileCode,
+ loginPwd: loginPwd,
+ payPwd: payPwd,
+ pName: pName,
+ // nameType: 3,
+ regConfirmImg: regConfirmImg,
+ mobileCode: mobileCode
+ };
+
+ var that = $(this)
+ that.attr("disabled", true);
+
+ mui.ajax(qlgUrl('app/users/register'), {
+ data:ajaxData,
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒
+ success: function(data) {
+ //服务器返回响应,根据响应结果,分析是否登录成功;
+ mui.alert(data.msg);
+
+ if (data.status == 1) {
+ mui.back();
+ } else {
+ // $('.yzmhh').attr('src', hyhUrl('mobile/users/getverify?rnd=' + Math.random()));
+ }
+ that.removeAttr('disabled');
+ },
+
+ error: function(xhr, type, errorThrown) {
+ //异常处理;
+ // mui.alert(type);
+ }
+ });
+
+ })
+
+})
diff --git a/static/app2/js/register1.js b/static/app2/js/register1.js
old mode 100755
new mode 100644
index ed290d6..e1f1e61
--- a/static/app2/js/register1.js
+++ b/static/app2/js/register1.js
@@ -1,471 +1,471 @@
-// mui.init({
-// beforeback: function() { //获得父页面的webview
-// var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
-// mui.fire(list, 'refresh');
-// //返回true,继续页面关闭逻辑
-// return true;
-// }
-// });
-
-mui.plusReady(function() {
- var wait = 120;
- // var html =
- // '
';
- //
- // $('.con').append(html);
- // 判断手机号是否存在 格式是否正确
- $('#loginName').on('blur', function() {
- var loginName = $('#loginName').val();
- JZL.ajax('http://t.ect99.com/app/users/check_login_name', {
- loginName: loginName
- }, function(data) {
- // //console.log(data);
- if (1 != data.status) {
- mui.alert(data.msg)
- }
- })
- })
- // 推荐人信息
- $('.pNameCode').hide();
-
- var PName="";
- $('#pName').on('blur', function() {
- pName = $('#pName').val();
- if ('' != pName) {
- if (!(
- /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/
- .test(pName))) {
- mui.alert("手机号码有误,请重填!");
- return;
- }
- $('.pNameCode').show();
-
- mui('.row').on('tap', '#mobileCode1', function() {
- $(this).attr("disabled", true);
- JZL.ajax('http://t.ect99.com/app/users/getPhoneVerifyCode',{userPhone:pName},function (data) {
- if (1==data.status) {
- time()
- }else {
- mui.alert(data.msg);
- }
- $('#mobileCode1').removeAttr('disabled');
-
- })
-})
-
-
-
- } else {
- $('.pNameCode').hide();
- }
-
- })
-// JZL.ajax(qlgUrl('app/users/check_login_name'),{loginName:loginName},function (data) {
-// // //console.log(data);
-//
-// if (1 != data.status) {
-// mui.alert(data.msg)
-// }
-// })
- function time() {
- if (wait == 0) {
- $('#mobileCode').removeAttr("disabled");
- $('#mobileCode').val("重新发送");
- wait = 120;
- } else {
- $('#mobileCode').attr("disabled", true);
- $('#mobileCode').val("重新发送(" + wait + ")");
- wait--;
- setTimeout(function() {
- time()
- },
- 1000)
- }
- }
- //获取验证码
- mui('.row').on('tap', '#mobileCode', function() {
- var loginName = $('#loginName').val();
- if (loginName == '') {
- mui.alert('手机号不能为空!');
- return;
- }
- // if (!(
- // /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/
- // .test(loginName))) {
- // mui.alert("手机号码有误,请重填!");
- // return;
- // }
- $(this).attr("disabled", true);
- mui.ajax('http://t.ect99.com/app/users/getPhoneVerifyCode', {
-
- data: {
- userPhone: loginName
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒
- success: function(data) {
- //console.log(data);
- //服务器返回响应,根据响应结果,分析是否登录成功;
- if (data.status == 1) {
- time();
- } else {
- mui.alert(data.msg);
- }
- $('#mobileCode').removeAttr('disabled');
- },
-
- error: function(xhr, type, errorThrown) {
- //异常处理;
- mui.alert(type)
- // mui.alert(type);
- }
- });
- })
- //注册协议
- mui.ajax('http://t.ect99.com/app/Tags/articleDetail', {
- data: {
- articleId: 114
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) {
- //console.log(data);
- // if(data.status==1){
- // //console.log(1);
- var html1 = ''
- html1 = '
' + data.articleContent + '
'
- $('.zcxycontent').append(html1)
- // }
- },
- error: function(xhr, type, errorThrown) {
-
- }
- });
- //上传图片
-
- var files = []; //存储文件信息的数组
- var fname = ""; //表示文件名,例如 XXXX.jpg;
- var expire = 0;
- var pathName = '';
- var inpId = '';
- var keyname = '';
- var imgId='';
- var isZip=1;
- var qualityNum=90;
- var response=';'
- var UP = UP || {};
- UP.isBatch=0;
- UP.init = function(inputId, path,imageId,isBatch,isZipImg,quality) {
- inpId = inputId;
- pathName = path;
- imgId = imageId;
- if(typeof(isBatch) != 'undefined'){
- UP.isBatch = isBatch;
- }
- if(typeof(isZipImg) != 'undefined'){
- // //console.log(typeof(isZipImg));
- isZip = isZipImg;
- }
- if(typeof(quality) != 'undefined'){
- qualityNum = quality;
- }
-
- }
-
- function send_request() {
- var xmlhttp = null;
- if (window.XMLHttpRequest) {
- xmlhttp = new XMLHttpRequest();
- } else if (window.ActiveXObject) {
- xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
- }
-
- if (xmlhttp != null) {
- // //console.log(dir)
- serverUrl = 'http://t.ect99.com/oss/get.php?dir=' + pathName;
- // serverUrl = 'https://img.zgqlg.com.cn/oss/get.php?dir=' + pathName;
-
- xmlhttp.open("GET", serverUrl, false);
- xmlhttp.send(null);
- return xmlhttp.responseText;
- } else {
- mui.alert("Your browser does not support XMLHTTP.");
- }
-
- }
-
- function get_signature() {
- //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲
- now = timestamp = Date.parse(new Date()) / 1000;
- if (expire < now + 3) {
- body = send_request()
- var obj = eval("(" + body + ")");
- response = obj;
- // //console.log(obj);
- }
- return response;
- };
- // 上传文件
- function upload(callback) {
- // //console.log(files);
- if (files.length <= 0) {
- mui.toast('没有添加上传文件');
- return;
- }
- var obj = get_signature();
- if (obj) {
- server = obj['host'];
- policyBase64 = obj['policy'];
- accessid = obj['accessid'];
- signature = obj['signature'];
- expire = parseInt(obj['expire']);
- callbackbody = obj['callback'];
- path = obj['dir'];
-
- } else {
- mui.toast('初始化失败');
- return;
- }
-
- var wt = plus.nativeUI.showWaiting();
- var task = plus.uploader.createUpload(server, {
- method: "POST"
- }, function(t, status) {
- //上传完成
- if (status == 200) {
- wt.close();
- if(1 == UP.isBatch){
- callback(t,status,keyname,server + '/'+keyname);
- }else{
- document.getElementById(inpId).value = keyname;
- var ele=document.getElementById(imgId);
- ele.src=server + '/'+keyname;
- ele.setAttribute('data-src',keyname);
- mui.toast('上传成功');
- //至此上传成功,上传后的图片完整地址为server+testName
- //keyname
- }
-
- } else {
- wt.close();
- mui.toast('上传失败:' + status);
- }
- });
- var suffix1 = get_suffix(fname); //文件后缀 例如 .jpg
- keyname = path + new Date().getTime() + suffix1;
- task.addData("key", keyname);
- task.addData("policy", policyBase64);
- task.addData("OSSAccessKeyId", accessid);
- task.addData("success_action_status", "200");
- // task.addData("callback", callbackbody);
- task.addData("signature", signature);
- var f = files[files.length-1];
- // //console.log(f)
-
- task.addFile(f.path, {
- key: "file",
- name: "file",
- mime: "image/jpeg"
- });
- //files.length = 0;
- task.start();
-
- }
-
- //得到文件名的后缀
- function get_suffix(filename) {
- var pos = filename.lastIndexOf('.');
- var suffix = '';
- if (pos != -1) {
- suffix = filename.substring(pos)
- }
- return suffix;
- }
- // 拍照添加文件
- function appendByCamera(callback) {
- plus.camera.getCamera().captureImage(function(p) {
- uploadImg(p,callback);
- });
- }
- // 从相册添加文件
- function appendByGallery(callback) {
- plus.gallery.pick(function(p) {
- uploadImg(p,callback);
- });
- }
-
- // 添加文件
- var index = 1;
- function uploadImg(p,callback){
- if(1 == isZip){
- compressImg(p,callback);
- }else{
- appendFile(p,callback)
- }
- }
- function appendFile(p,callback) {
- // var fe = document.getElementById(fileId);
- var n = p.substr(p.lastIndexOf('/') + 1);
- fname = n;
- files.push({
- name: "uploadkey" + index,
- path: p
- });
- ////console.log(3);
- // index++;
- upload(callback);
- }
- function compressImg(src,callback) {
- var filename = src.substring(src.lastIndexOf('/') + 1);
- var opions = {
- src: src,
- dst: '_doc/tmp/' + filename,
- overwrite: true,
- //width: '300px', //这里指定了宽度,同样可以修改
- format: 'jpg',
- quality: qualityNum //图片质量不再修改,以免失真
- };
- var successCB = function(evt) {
- // //console.log(JSON.stringify(evt));
- fname = filename;
- // files[0]={
- // name: "uploadkey",
- // path: evt.target
- // };
- files.push({
- name: "uploadkey" + index,
- path: evt.target
- });
- // index++;
- //上传
- upload(callback);
- //_this.avatar(evt.target);
- };
- var errorCB = function(err) {
- appendFile(src,callback);
- ////console.log(JSON.stringify(err));
- //mui.toast("图片压缩失败");
- };
- plus.zip.compressImage(opions, successCB, errorCB);
- };
- function openCamera(callback) {
- plus.nativeUI.actionSheet({
- cancel: "取消",
- buttons: [{
- title: "拍照"
- },
- {
- title: "从相册中选择"
- }
- ]
- }, function(e) { //1 是拍照 2 从相册中选择
- switch (e.index) {
- case 1:
- appendByCamera(callback);
- break;
- case 2:
- appendByGallery(callback);
- break;
- }
- });
- }
- $(".photos").on("tap", '.regConfirm', function() {
- // UP.init("accountBookImg", "test", "accountBookImgTag")
-
- UP.init("regConfirmImg", "test", "regConfirmImg")
- openCamera()
- })
-
-
- mui('.down').on('tap', '.btn', function() {
- var loginName = $('#loginName').val();
- var mobileCode = $('.yzm').val();
- var loginPwd = $('#loginPwd').val();
- var reUserPwd = $('#reUserPwd').val();
- var mobileCode1 = $('#mobileCode1').val() ? $('#mobileCode1').val() : "";//推荐人验证码
-
-
- pName = $('#pName').val();
-
- // var verifyCode = $('.tpyzm').val();
- var regConfirmImg = $('#regConfirmImg').val();
- if (loginName == '') {
- mui.alert('手机号不能为空!');
- return;
- }
- if (!(
- /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/
- .test(loginName))) {
- mui.alert("手机号码有误,请重填!");
- return;
- }
- if (mobileCode == '') {
- mui.alert('验证码不能为空!');
- return;
- }
- if (loginPwd == '') {
- mui.alert('密码不能为空!');
- return;
- }
- if (reUserPwd == '') {
- mui.alert('确认密码不能为空!');
- return;
- }
- if (loginPwd.length < 6) {
- mui.alert('密码不能小于6位!');
- return;
- }
- if (!(loginPwd == reUserPwd)) {
- mui.alert('两次密码不一致!');
- return;
- }
- if (regConfirmImg == '') {
- mui.alert('请上传确认书照片');
- return;
- }
- if (pName != '') {
- if(''==mobileCode1){
- mui.alert('请输入推荐人验证码');
- return;
- }
- }
- $(this).attr("disabled", true);
- mui.ajax('http://t.ect99.com/app/users/register', {
- data: {
- loginName: loginName,
- mobileCode: mobileCode,
- loginPwd: loginPwd,
- reUserPwd: reUserPwd,
- pName: pName,
- nameType: 3,
- regConfirmImg: regConfirmImg,
- mobileCode1:mobileCode1
- // verifyCode: verifyCode
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒
- success: function(data) {
- //服务器返回响应,根据响应结果,分析是否登录成功;
- mui.alert(data.msg);
-
- if (data.status == 1) {
- // mui.back();
- plus.runtime.open
- } else {
- // $('.yzmhh').attr('src', hyhUrl('mobile/users/getverify?rnd=' + Math.random()));
- }
- $('.btn').removeAttr('disabled');
- },
-
- error: function(xhr, type, errorThrown) {
- //异常处理;
- // mui.alert(type);
- }
- });
-
- })
-
-})
+// mui.init({
+// beforeback: function() { //获得父页面的webview
+// var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
+// mui.fire(list, 'refresh');
+// //返回true,继续页面关闭逻辑
+// return true;
+// }
+// });
+
+mui.plusReady(function() {
+ var wait = 120;
+ // var html =
+ // '
';
+ //
+ // $('.con').append(html);
+ // 判断手机号是否存在 格式是否正确
+ $('#loginName').on('blur', function() {
+ var loginName = $('#loginName').val();
+ JZL.ajax('http://t.ect99.com/app/users/check_login_name', {
+ loginName: loginName
+ }, function(data) {
+ // //console.log(data);
+ if (1 != data.status) {
+ mui.alert(data.msg)
+ }
+ })
+ })
+ // 推荐人信息
+ $('.pNameCode').hide();
+
+ var PName="";
+ $('#pName').on('blur', function() {
+ pName = $('#pName').val();
+ if ('' != pName) {
+ if (!(
+ /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/
+ .test(pName))) {
+ mui.alert("手机号码有误,请重填!");
+ return;
+ }
+ $('.pNameCode').show();
+
+ mui('.row').on('tap', '#mobileCode1', function() {
+ $(this).attr("disabled", true);
+ JZL.ajax('http://t.ect99.com/app/users/getPhoneVerifyCode',{userPhone:pName},function (data) {
+ if (1==data.status) {
+ time()
+ }else {
+ mui.alert(data.msg);
+ }
+ $('#mobileCode1').removeAttr('disabled');
+
+ })
+})
+
+
+
+ } else {
+ $('.pNameCode').hide();
+ }
+
+ })
+// JZL.ajax(qlgUrl('app/users/check_login_name'),{loginName:loginName},function (data) {
+// // //console.log(data);
+//
+// if (1 != data.status) {
+// mui.alert(data.msg)
+// }
+// })
+ function time() {
+ if (wait == 0) {
+ $('#mobileCode').removeAttr("disabled");
+ $('#mobileCode').val("重新发送");
+ wait = 120;
+ } else {
+ $('#mobileCode').attr("disabled", true);
+ $('#mobileCode').val("重新发送(" + wait + ")");
+ wait--;
+ setTimeout(function() {
+ time()
+ },
+ 1000)
+ }
+ }
+ //获取验证码
+ mui('.row').on('tap', '#mobileCode', function() {
+ var loginName = $('#loginName').val();
+ if (loginName == '') {
+ mui.alert('手机号不能为空!');
+ return;
+ }
+ // if (!(
+ // /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/
+ // .test(loginName))) {
+ // mui.alert("手机号码有误,请重填!");
+ // return;
+ // }
+ $(this).attr("disabled", true);
+ mui.ajax('http://t.ect99.com/app/users/getPhoneVerifyCode', {
+
+ data: {
+ userPhone: loginName
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒
+ success: function(data) {
+ //console.log(data);
+ //服务器返回响应,根据响应结果,分析是否登录成功;
+ if (data.status == 1) {
+ time();
+ } else {
+ mui.alert(data.msg);
+ }
+ $('#mobileCode').removeAttr('disabled');
+ },
+
+ error: function(xhr, type, errorThrown) {
+ //异常处理;
+ mui.alert(type)
+ // mui.alert(type);
+ }
+ });
+ })
+ //注册协议
+ mui.ajax('http://t.ect99.com/app/Tags/articleDetail', {
+ data: {
+ articleId: 114
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) {
+ //console.log(data);
+ // if(data.status==1){
+ // //console.log(1);
+ var html1 = ''
+ html1 = '
' + data.articleContent + '
'
+ $('.zcxycontent').append(html1)
+ // }
+ },
+ error: function(xhr, type, errorThrown) {
+
+ }
+ });
+ //上传图片
+
+ var files = []; //存储文件信息的数组
+ var fname = ""; //表示文件名,例如 XXXX.jpg;
+ var expire = 0;
+ var pathName = '';
+ var inpId = '';
+ var keyname = '';
+ var imgId='';
+ var isZip=1;
+ var qualityNum=90;
+ var response=';'
+ var UP = UP || {};
+ UP.isBatch=0;
+ UP.init = function(inputId, path,imageId,isBatch,isZipImg,quality) {
+ inpId = inputId;
+ pathName = path;
+ imgId = imageId;
+ if(typeof(isBatch) != 'undefined'){
+ UP.isBatch = isBatch;
+ }
+ if(typeof(isZipImg) != 'undefined'){
+ // //console.log(typeof(isZipImg));
+ isZip = isZipImg;
+ }
+ if(typeof(quality) != 'undefined'){
+ qualityNum = quality;
+ }
+
+ }
+
+ function send_request() {
+ var xmlhttp = null;
+ if (window.XMLHttpRequest) {
+ xmlhttp = new XMLHttpRequest();
+ } else if (window.ActiveXObject) {
+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+
+ if (xmlhttp != null) {
+ // //console.log(dir)
+ serverUrl = 'http://t.ect99.com/oss/get.php?dir=' + pathName;
+ // serverUrl = 'https://img.zgqlg.com.cn/oss/get.php?dir=' + pathName;
+
+ xmlhttp.open("GET", serverUrl, false);
+ xmlhttp.send(null);
+ return xmlhttp.responseText;
+ } else {
+ mui.alert("Your browser does not support XMLHTTP.");
+ }
+
+ }
+
+ function get_signature() {
+ //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲
+ now = timestamp = Date.parse(new Date()) / 1000;
+ if (expire < now + 3) {
+ body = send_request()
+ var obj = eval("(" + body + ")");
+ response = obj;
+ // //console.log(obj);
+ }
+ return response;
+ };
+ // 上传文件
+ function upload(callback) {
+ // //console.log(files);
+ if (files.length <= 0) {
+ mui.toast('没有添加上传文件');
+ return;
+ }
+ var obj = get_signature();
+ if (obj) {
+ server = obj['host'];
+ policyBase64 = obj['policy'];
+ accessid = obj['accessid'];
+ signature = obj['signature'];
+ expire = parseInt(obj['expire']);
+ callbackbody = obj['callback'];
+ path = obj['dir'];
+
+ } else {
+ mui.toast('初始化失败');
+ return;
+ }
+
+ var wt = plus.nativeUI.showWaiting();
+ var task = plus.uploader.createUpload(server, {
+ method: "POST"
+ }, function(t, status) {
+ //上传完成
+ if (status == 200) {
+ wt.close();
+ if(1 == UP.isBatch){
+ callback(t,status,keyname,server + '/'+keyname);
+ }else{
+ document.getElementById(inpId).value = keyname;
+ var ele=document.getElementById(imgId);
+ ele.src=server + '/'+keyname;
+ ele.setAttribute('data-src',keyname);
+ mui.toast('上传成功');
+ //至此上传成功,上传后的图片完整地址为server+testName
+ //keyname
+ }
+
+ } else {
+ wt.close();
+ mui.toast('上传失败:' + status);
+ }
+ });
+ var suffix1 = get_suffix(fname); //文件后缀 例如 .jpg
+ keyname = path + new Date().getTime() + suffix1;
+ task.addData("key", keyname);
+ task.addData("policy", policyBase64);
+ task.addData("OSSAccessKeyId", accessid);
+ task.addData("success_action_status", "200");
+ // task.addData("callback", callbackbody);
+ task.addData("signature", signature);
+ var f = files[files.length-1];
+ // //console.log(f)
+
+ task.addFile(f.path, {
+ key: "file",
+ name: "file",
+ mime: "image/jpeg"
+ });
+ //files.length = 0;
+ task.start();
+
+ }
+
+ //得到文件名的后缀
+ function get_suffix(filename) {
+ var pos = filename.lastIndexOf('.');
+ var suffix = '';
+ if (pos != -1) {
+ suffix = filename.substring(pos)
+ }
+ return suffix;
+ }
+ // 拍照添加文件
+ function appendByCamera(callback) {
+ plus.camera.getCamera().captureImage(function(p) {
+ uploadImg(p,callback);
+ });
+ }
+ // 从相册添加文件
+ function appendByGallery(callback) {
+ plus.gallery.pick(function(p) {
+ uploadImg(p,callback);
+ });
+ }
+
+ // 添加文件
+ var index = 1;
+ function uploadImg(p,callback){
+ if(1 == isZip){
+ compressImg(p,callback);
+ }else{
+ appendFile(p,callback)
+ }
+ }
+ function appendFile(p,callback) {
+ // var fe = document.getElementById(fileId);
+ var n = p.substr(p.lastIndexOf('/') + 1);
+ fname = n;
+ files.push({
+ name: "uploadkey" + index,
+ path: p
+ });
+ ////console.log(3);
+ // index++;
+ upload(callback);
+ }
+ function compressImg(src,callback) {
+ var filename = src.substring(src.lastIndexOf('/') + 1);
+ var opions = {
+ src: src,
+ dst: '_doc/tmp/' + filename,
+ overwrite: true,
+ //width: '300px', //这里指定了宽度,同样可以修改
+ format: 'jpg',
+ quality: qualityNum //图片质量不再修改,以免失真
+ };
+ var successCB = function(evt) {
+ // //console.log(JSON.stringify(evt));
+ fname = filename;
+ // files[0]={
+ // name: "uploadkey",
+ // path: evt.target
+ // };
+ files.push({
+ name: "uploadkey" + index,
+ path: evt.target
+ });
+ // index++;
+ //上传
+ upload(callback);
+ //_this.avatar(evt.target);
+ };
+ var errorCB = function(err) {
+ appendFile(src,callback);
+ ////console.log(JSON.stringify(err));
+ //mui.toast("图片压缩失败");
+ };
+ plus.zip.compressImage(opions, successCB, errorCB);
+ };
+ function openCamera(callback) {
+ plus.nativeUI.actionSheet({
+ cancel: "取消",
+ buttons: [{
+ title: "拍照"
+ },
+ {
+ title: "从相册中选择"
+ }
+ ]
+ }, function(e) { //1 是拍照 2 从相册中选择
+ switch (e.index) {
+ case 1:
+ appendByCamera(callback);
+ break;
+ case 2:
+ appendByGallery(callback);
+ break;
+ }
+ });
+ }
+ $(".photos").on("tap", '.regConfirm', function() {
+ // UP.init("accountBookImg", "test", "accountBookImgTag")
+
+ UP.init("regConfirmImg", "test", "regConfirmImg")
+ openCamera()
+ })
+
+
+ mui('.down').on('tap', '.btn', function() {
+ var loginName = $('#loginName').val();
+ var mobileCode = $('.yzm').val();
+ var loginPwd = $('#loginPwd').val();
+ var reUserPwd = $('#reUserPwd').val();
+ var mobileCode1 = $('#mobileCode1').val() ? $('#mobileCode1').val() : "";//推荐人验证码
+
+
+ pName = $('#pName').val();
+
+ // var verifyCode = $('.tpyzm').val();
+ var regConfirmImg = $('#regConfirmImg').val();
+ if (loginName == '') {
+ mui.alert('手机号不能为空!');
+ return;
+ }
+ if (!(
+ /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/
+ .test(loginName))) {
+ mui.alert("手机号码有误,请重填!");
+ return;
+ }
+ if (mobileCode == '') {
+ mui.alert('验证码不能为空!');
+ return;
+ }
+ if (loginPwd == '') {
+ mui.alert('密码不能为空!');
+ return;
+ }
+ if (reUserPwd == '') {
+ mui.alert('确认密码不能为空!');
+ return;
+ }
+ if (loginPwd.length < 6) {
+ mui.alert('密码不能小于6位!');
+ return;
+ }
+ if (!(loginPwd == reUserPwd)) {
+ mui.alert('两次密码不一致!');
+ return;
+ }
+ if (regConfirmImg == '') {
+ mui.alert('请上传确认书照片');
+ return;
+ }
+ if (pName != '') {
+ if(''==mobileCode1){
+ mui.alert('请输入推荐人验证码');
+ return;
+ }
+ }
+ $(this).attr("disabled", true);
+ mui.ajax('http://t.ect99.com/app/users/register', {
+ data: {
+ loginName: loginName,
+ mobileCode: mobileCode,
+ loginPwd: loginPwd,
+ reUserPwd: reUserPwd,
+ pName: pName,
+ nameType: 3,
+ regConfirmImg: regConfirmImg,
+ mobileCode1:mobileCode1
+ // verifyCode: verifyCode
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒
+ success: function(data) {
+ //服务器返回响应,根据响应结果,分析是否登录成功;
+ mui.alert(data.msg);
+
+ if (data.status == 1) {
+ // mui.back();
+ plus.runtime.open
+ } else {
+ // $('.yzmhh').attr('src', hyhUrl('mobile/users/getverify?rnd=' + Math.random()));
+ }
+ $('.btn').removeAttr('disabled');
+ },
+
+ error: function(xhr, type, errorThrown) {
+ //异常处理;
+ // mui.alert(type);
+ }
+ });
+
+ })
+
+})
diff --git a/static/app2/js/reviewsmanage.js b/static/app2/js/reviewsmanage.js
old mode 100755
new mode 100644
diff --git a/static/app2/js/saoyisao.js b/static/app2/js/saoyisao.js
old mode 100755
new mode 100644
index 9ca22d2..5ba2e70
--- a/static/app2/js/saoyisao.js
+++ b/static/app2/js/saoyisao.js
@@ -1,77 +1,77 @@
-scan = null; //扫描对象
- mui.plusReady(function() {
- mui.init();
- startRecognize();
- });
-
- function startRecognize() {
- try {
- var filter;
- //自定义的扫描控件样式
- var styles = {
- frameColor: "#29E52C",
- scanbarColor: "#29E52C",
- background: ""
- }
- //扫描控件构造
- scan = new plus.barcode.Barcode('bcid', filter, styles);
- scan.onmarked = onmarked;
- scan.onerror = onerror;
- scan.start();
- //打开关闭闪光灯处理
- var flag = false;
- document.getElementById("turnTheLight").addEventListener('tap', function() {
- if(flag == false) {
- scan.setFlash(true);
- flag = true;
- } else {
- scan.setFlash(false);
- flag = false;
- }
- });
- } catch(e) {
- mui.alert("出现错误啦:\n" + e);
- }
- };
-
- function onerror(e) {
- mui.alert(e);
- };
-
- function onmarked(type, result) {
- var text = '';
- switch(type) {
- case plus.barcode.QR:
- text = 'QR: ';
- break;
- case plus.barcode.EAN13:
- text = '条码: ';
- break;
- case plus.barcode.EAN8:
- text = '条码: ';
- break;
- }
-
- if('http' == result.substring(0,4)){
- console.log(result);
- plus.runtime.openURL(result);
- }else{
- mui.alert(text + " : " + result);
- }
-
- scan.cancel();
- scan.close();
-// scanDoit(result)
-
- };
-
- // 从相册中选择二维码图片
- function scanPicture() {
- plus.gallery.pick(function(path) {
- plus.barcode.scan(path, onmarked, function(error) {
- plus.nativeUI.alert("无法识别此图片");
- });
- }, function(err) {
- plus.nativeUI.alert("Failed: " + err.message);
- });
+scan = null; //扫描对象
+ mui.plusReady(function() {
+ mui.init();
+ startRecognize();
+ });
+
+ function startRecognize() {
+ try {
+ var filter;
+ //自定义的扫描控件样式
+ var styles = {
+ frameColor: "#29E52C",
+ scanbarColor: "#29E52C",
+ background: ""
+ }
+ //扫描控件构造
+ scan = new plus.barcode.Barcode('bcid', filter, styles);
+ scan.onmarked = onmarked;
+ scan.onerror = onerror;
+ scan.start();
+ //打开关闭闪光灯处理
+ var flag = false;
+ document.getElementById("turnTheLight").addEventListener('tap', function() {
+ if(flag == false) {
+ scan.setFlash(true);
+ flag = true;
+ } else {
+ scan.setFlash(false);
+ flag = false;
+ }
+ });
+ } catch(e) {
+ mui.alert("出现错误啦:\n" + e);
+ }
+ };
+
+ function onerror(e) {
+ mui.alert(e);
+ };
+
+ function onmarked(type, result) {
+ var text = '';
+ switch(type) {
+ case plus.barcode.QR:
+ text = 'QR: ';
+ break;
+ case plus.barcode.EAN13:
+ text = '条码: ';
+ break;
+ case plus.barcode.EAN8:
+ text = '条码: ';
+ break;
+ }
+
+ if('http' == result.substring(0,4)){
+ console.log(result);
+ plus.runtime.openURL(result);
+ }else{
+ mui.alert(text + " : " + result);
+ }
+
+ scan.cancel();
+ scan.close();
+// scanDoit(result)
+
+ };
+
+ // 从相册中选择二维码图片
+ function scanPicture() {
+ plus.gallery.pick(function(path) {
+ plus.barcode.scan(path, onmarked, function(error) {
+ plus.nativeUI.alert("无法识别此图片");
+ });
+ }, function(err) {
+ plus.nativeUI.alert("Failed: " + err.message);
+ });
}
\ No newline at end of file
diff --git a/static/app2/js/self_shop.js b/static/app2/js/self_shop.js
old mode 100755
new mode 100644
index b1fd8f0..5345061
--- a/static/app2/js/self_shop.js
+++ b/static/app2/js/self_shop.js
@@ -1,327 +1,328 @@
-$('.getquan').css('display', 'none');
-// $('#search').css('width', '80%');
-$('.saoyisao').hide();
-$('.class_block').eq(0).attr('data-classifyId', 5);
-$('.class_block').eq(1).attr('data-classifyId', 6);
-$('.class_block').eq(2).attr('data-classifyId', 7);
-$('.class_block').eq(3).attr('data-classifyId', 8);
-$('.class_block').eq(4).attr('data-classifyId', '');
-$('.zya_block').addClass('add_');
-mui.init({
- beforeback: function() { //获得父页面的webview
- var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
- mui.fire(list, 'refresh');
- //返回true,继续页面关闭逻辑
- return true;
- },
-});
-var data = '';
-var addr = '';
-var lat = '',
- lat1 = '',
- lng = '';
-var page = 1;
-var pageSize = 5;
-var count = 1;
-var isjiazai = 1;
-var nowPage = 1;
-var isLoading = false;
-mui.plusReady(function() {
- getLocation();
- function getLocation() {
- if (navigator.geolocation) {
- plus.geolocation.getCurrentPosition(showPosition, showError);
-
- } else {
- mui.alert("手机不支持定位")
- }
- }
- function showPosition(position) {
-
- lat = position.coords.latitude;
- lng = position.coords.longitude;
- localStorage.setItem('lat', lat);
- localStorage.setItem('lng', lng);
- getShopList(nowPage, pageSize);
- addr = position.address.city;
- localStorage.setItem('addr', addr);
- $('#location').html(addr);
- $('#location-r').html(addr);
-
- }
-
- function showError(error) {
- switch (error.code) {
- case error.TIMEOUT:
- mui.alert('请求超时,请重试')
- break;
- case error.POSITION_UNAVAILABLE:
- mui.alert('定位不到你的地址')
- break;
- case error.PERMISSION_DENIED:
- // case 22:
- mui.alert('您拒绝了地理位置请求')
- break;
- case error.UNKNOWN_ERROR:
- mui.alert('未知错误')
- break;
- default:
- mui.alert(error.message)
- break;
- }
- getShopList(nowPage, pageSize);
- }
- //bannerTop
- mui.ajax(qlgUrl('app/shopping/getCarousel'), {
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- if (data.status == 1) {
- var html = '';
- var data = data.data;
- $.each(data, function() {
- html += '
 + ')
';
- });
- $('#top_banner .swiper-wrapper').html(html);
- var swiper = new Swiper('#top_banner', {
- pagination: '#top_banner_pagination',
- spaceBetween: 0,
- loop: true,
- autoplay: 3500,
- autoplayDisableOnInteraction: false
- });
- var topBannerheight = localStorage.getItem('topBannerheight')
-
- $('#top_banner').height(topBannerheight)
- // $('#top_banner').height(($('#top_banner').width() )* 460 / 750);
- } else {
- mui.alert(data.msg)
- }
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(errorThrown);
- }
- });
-
- mui('.con').on('tap', '.bc_img', function() {
- var goodsId = $(this).attr('data-goodsId');
- JZL.openWindow('details.html', 'details.html' + goodsId, {data_id: goodsId});
- })
- function getShopList(nowPage, pageSize) {
-
- lat = localStorage.getItem('lat');
- lng = localStorage.getItem('lng');
-
- if (null == lat) {
- lat = 36.659565;
- lng = 117.125824;
- }
- var recommenddata = {
- shopType: 1,
- page: nowPage ? nowPage : 1,
- perPage: pageSize ? pageSize : 10,
- lat: lat,
- lng: lng
- }
- if (true == isLoading) return;
- isLoading = true;
- //console.log(lat);
- JZL.ajax(hyhUrl('app/shopping/getShops'), recommenddata, function(data) {
-
- var html = '';
- if (1 == data.status) {
- var data = data.data;
- // console.log(data);
- if ('' == data.Rows) {
- $('.shoplist').append(
- '
没有更多数据
');
- // isLoading = false;
- return;
- }
- $.each(data.Rows, function(index, element) {
- html +=
- '
' +
- this.shopName + '进店逛逛'
- if (0 != this.goods.length) {
- $.each(this.goods, function(idx, ele) {
-
- html += '
'
- })
- }
-
- html += '
距离:' + this.distance / 1000 +
- '公里'
- })
- if (nowPage == 1) {
- $('.shoplist').html(html);
- } else {
- $('.shoplist').append(html);
- }
- isLoading = false;
- } else {
- mui.alert(data.msg)
- }
- })
- }
- //加载
- document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
- if (scroll.y == scroll.maxScrollY) {
- if (isLoading == false) {
- nowPage++;
- // getShops(nowPage, pageSize);
- getShopList(nowPage, pageSize)
- }
- }
- })
- mui('.shoplist').on('tap', '.shops-content1-title', function() {
- // var goodsId = $(this).attr('data-goodsId');
- var shopName = $(this).attr("data-shopName");
- var shopId = $(this).attr("data-shopId");
- JZL.openWindow('storeout.html', 'storeout.html', {shopName: shopName,shopId: shopId});
- })
-})
-
-//获取推荐页
-function getRecommend(page, pagesize) {
- var recommenddata = {
- type:1,
- page: page ? page : 1,
- pagesize: pageSize ? pageSize : 10
- }
- if (isjiazai == 0) {
- return;
- } else {
- isjiazai = 0;
- }
- JZL.ajax(qlgUrl('app/shopping/getGoods'), recommenddata, function(data) {
- // console.log(data);
- // if (data.status == 1) {
- var html = '';
- // var data = data.data;
- if (data.Rows == '') {
- $('.self_shop_rem').append(
- '
没有更多商品
');
- isjiazai = 0;
- return;
- }
- $.each(data.Rows, function() {
- html += '
 +
- ')
' + this.goodsName + '
¥' + this.shopPrice +
- ' 满减
' + this.saleNum +
- '人购买
优惠率 ' + this.discountRate +
- '

';
- });
-
- if (page == 1) {
- $('.recommend_con').html(html);
- } else {
- $('.recommend_con').append(html);
- }
- isjiazai = 1;
- $('.rcb_title span').each(function() {
- if ($(this).attr('data-goodsId') == 1) {
- $(this).css('display', 'none');
- }
- })
- $('.rcb_img').height($('.rcb_img').width());
-
- // } else {
- // mui.alert(data.msg)
- // }
- })
-}
-$('.bcon_left').height($('.bcon_left').width() * 345 / 185);
-$('.bcon_left img').height($('.bcon_left img').width() * 345 / 185);
-$('.bcr_block').height($('.bcr_block').width());
-$('.addsct_block').height($('.addsct_block').width() * 225 / 355);
-$('.addscb_block').height($('.addscb_block').width() * 260 / 180);
-$('.zya_block').height($('.zya_block').width() * 185 / 355);
-
-var issx = 0;
-
-// 轮播图跳转
-$('#slider').on('tap', '.swiper-slide', function() {
- openAds($(this));
-})
-
-//导航栏
-document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
- if (-scroll.y < 0) {
- num = 0;
- } else if ((-scroll.y > 0 || scroll.y == 0) && -scroll.y < 150) {
- num = -scroll.y / 150;
- } else {
- num = 1;
- }
- $('.header').css('background-color', 'rgba(255,255,255,' + num + ')')
-
- if (-scroll.y < 75) {
- $('.saoyisao').attr('src', '../img/saoyisao.png');
- $('.msg').attr('src', '../img/icon_msg.png');
- $('.search').attr('src', '../img/icon_search.png');
- $('#search').css('background-color', 'white');
- $('.header').removeClass('shadown_wai');
- } else {
- $('.saoyisao').attr('src', '../img/saoyisao1.png');
- $('.msg').attr('src', '../img/icon_msg1.png');
- $('.search').attr('src', '../img/icon_search1.png');
- $('#search').css('background-color', '#d8d8d8');
- $('.header').addClass('shadown_wai');
- }
-
- if (scroll.y > 80 && issx == 0) {
- issx = 1;
- setTimeout(function() {
- location.reload()
- }, 1000)
- }
-})
-mui('.classify').on('tap', '.class_block', function() {
- var classifyId = $(this).attr('data-classifyId');
- var url = 'orSupermarket.html';
-
- if (classifyId == '') {
- url = 'ac3.html';
- }
- JZL.openWindow(url, url, {classifyId: classifyId});
-})
-
-//为你推荐
-getRecommend(page, pageSize);
-document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
- if (scroll.y == scroll.maxScrollY) {
- if (isjiazai == 1) {
- page++;
- getRecommend(page, pageSize);
- }
- }
-})
-//搜索
-$('.header').on('focus', '#keyword', function() {
- $(".search button").css('display', 'block');
-})
-$('.header').on('blur', '#keyword', function() {
- $(".search button").css('display', 'none');
-})
-$(".header").on('tap', '.search button', function(e) {
- var searchName = $('#keyword').val();
- JZL.openWindow('goodslist.html', 'goodslist.html', {data_keyword: searchName});
- $('#keyword').val("")
- // JZL.openWindow('shopsList.html', 'shopsList.html', {data_keyword: searchName});
- //JZL.openWindow('shopgoodList.html', 'shopgoodList.html', {data_keyword: searchName});
-});
-//跳转商品详情页
-mui("body").on('tap', '.bc_img', function() {
- var goodsId = $(this).attr('data-goodsId');
- var shopId = $(this).parent().parent().attr('data-shopId');
- JZL.openWindow('details.html', 'details.html' + goodsId, {data_id: goodsId,shopId: shopId});
+$('.getquan').css('display', 'none');
+// $('#search').css('width', '80%');
+$('.saoyisao').hide();
+$('.class_block').eq(0).attr('data-classifyId', 5);
+$('.class_block').eq(1).attr('data-classifyId', 6);
+$('.class_block').eq(2).attr('data-classifyId', 7);
+$('.class_block').eq(3).attr('data-classifyId', 8);
+$('.class_block').eq(4).attr('data-classifyId', '');
+$('.zya_block').addClass('add_');
+mui.init({
+ beforeback: function() { //获得父页面的webview
+ var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
+ mui.fire(list, 'refresh');
+ //返回true,继续页面关闭逻辑
+ return true;
+ },
+});
+var data = '';
+var addr = '';
+var lat = '',
+ lat1 = '',
+ lng = '';
+var page = 1;
+var pageSize = 5;
+var count = 1;
+var isjiazai = 1;
+var nowPage = 1;
+var isLoading = false;
+mui.plusReady(function() {
+ from_id=1;
+ getLocation();
+ function getLocation() {
+ if (navigator.geolocation) {
+ plus.geolocation.getCurrentPosition(showPosition, showError);
+
+ } else {
+ mui.alert("手机不支持定位")
+ }
+ }
+ function showPosition(position) {
+
+ lat = position.coords.latitude;
+ lng = position.coords.longitude;
+ localStorage.setItem('lat', lat);
+ localStorage.setItem('lng', lng);
+ getShopList(nowPage, pageSize);
+ addr = position.address.city;
+ localStorage.setItem('addr', addr);
+ $('#location').html(addr);
+ $('#location-r').html(addr);
+
+ }
+
+ function showError(error) {
+ switch (error.code) {
+ case error.TIMEOUT:
+ mui.alert('请求超时,请重试')
+ break;
+ case error.POSITION_UNAVAILABLE:
+ mui.alert('定位不到你的地址')
+ break;
+ case error.PERMISSION_DENIED:
+ // case 22:
+ mui.alert('您拒绝了地理位置请求')
+ break;
+ case error.UNKNOWN_ERROR:
+ mui.alert('未知错误')
+ break;
+ default:
+ mui.alert(error.message)
+ break;
+ }
+ getShopList(nowPage, pageSize);
+ }
+ //bannerTop
+ mui.ajax(qlgUrl('app/shopping/getCarousel'), {
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ if (data.status == 1) {
+ var html = '';
+ var data = data.data;
+ $.each(data, function() {
+ html += '
 + ')
';
+ });
+ $('#top_banner .swiper-wrapper').html(html);
+ var swiper = new Swiper('#top_banner', {
+ pagination: '#top_banner_pagination',
+ spaceBetween: 0,
+ loop: true,
+ autoplay: 3500,
+ autoplayDisableOnInteraction: false
+ });
+ var topBannerheight = localStorage.getItem('topBannerheight')
+
+ $('#top_banner').height(topBannerheight)
+ // $('#top_banner').height(($('#top_banner').width() )* 460 / 750);
+ } else {
+ mui.alert(data.msg)
+ }
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(errorThrown);
+ }
+ });
+
+ mui('.con').on('tap', '.bc_img', function() {
+ var goodsId = $(this).attr('data-goodsId');
+ JZL.openWindow('details.html', 'details.html' + goodsId, {data_id: goodsId});
+ })
+ function getShopList(nowPage, pageSize) {
+
+ lat = localStorage.getItem('lat');
+ lng = localStorage.getItem('lng');
+
+ if (null == lat) {
+ lat = 36.659565;
+ lng = 117.125824;
+ }
+ var recommenddata = {
+ shopType: 1,
+ page: nowPage ? nowPage : 1,
+ perPage: pageSize ? pageSize : 10,
+ lat: lat,
+ lng: lng
+ }
+ if (true == isLoading) return;
+ isLoading = true;
+ //console.log(lat);
+ JZL.ajax(hyhUrl('app/shopping/getShops'), recommenddata, function(data) {
+
+ var html = '';
+ if (1 == data.status) {
+ var data = data.data;
+ // console.log(data);
+ if ('' == data.Rows) {
+ $('.shoplist').append(
+ '
没有更多数据
');
+ // isLoading = false;
+ return;
+ }
+ $.each(data.Rows, function(index, element) {
+ html +=
+ '
' +
+ this.shopName + '进店逛逛'
+ if (0 != this.goods.length) {
+ $.each(this.goods, function(idx, ele) {
+
+ html += '
'
+ })
+ }
+
+ html += '
距离:' + this.distance / 1000 +
+ '公里'
+ })
+ if (nowPage == 1) {
+ $('.shoplist').html(html);
+ } else {
+ $('.shoplist').append(html);
+ }
+ isLoading = false;
+ } else {
+ mui.alert(data.msg)
+ }
+ })
+ }
+ //加载
+ document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
+ if (scroll.y == scroll.maxScrollY) {
+ if (isLoading == false) {
+ nowPage++;
+ // getShops(nowPage, pageSize);
+ getShopList(nowPage, pageSize)
+ }
+ }
+ })
+ mui('.shoplist').on('tap', '.shops-content1-title', function() {
+ // var goodsId = $(this).attr('data-goodsId');
+ var shopName = $(this).attr("data-shopName");
+ var shopId = $(this).attr("data-shopId");
+ JZL.openWindow('storeout.html', 'storeout.html', {shopName: shopName,shopId: shopId});
+ })
+})
+
+//获取推荐页
+function getRecommend(page, pagesize) {
+ var recommenddata = {
+ type:1,
+ page: page ? page : 1,
+ pagesize: pageSize ? pageSize : 10
+ }
+ if (isjiazai == 0) {
+ return;
+ } else {
+ isjiazai = 0;
+ }
+ JZL.ajax(qlgUrl('app/shopping/getGoods'), recommenddata, function(data) {
+ // console.log(data);
+ // if (data.status == 1) {
+ var html = '';
+ // var data = data.data;
+ if (data.Rows == '') {
+ $('.self_shop_rem').append(
+ '
没有更多商品
');
+ isjiazai = 0;
+ return;
+ }
+ $.each(data.Rows, function() {
+ html += '
 +
+ ')
' + this.goodsName + '
¥' + this.shopPrice +
+ ' 满减
' + this.saleNum +
+ '人购买
优惠率 ' + this.discountRate +
+ '

';
+ });
+
+ if (page == 1) {
+ $('.recommend_con').html(html);
+ } else {
+ $('.recommend_con').append(html);
+ }
+ isjiazai = 1;
+ $('.rcb_title span').each(function() {
+ if ($(this).attr('data-goodsId') == 1) {
+ $(this).css('display', 'none');
+ }
+ })
+ $('.rcb_img').height($('.rcb_img').width());
+
+ // } else {
+ // mui.alert(data.msg)
+ // }
+ })
+}
+$('.bcon_left').height($('.bcon_left').width() * 345 / 185);
+$('.bcon_left img').height($('.bcon_left img').width() * 345 / 185);
+$('.bcr_block').height($('.bcr_block').width());
+$('.addsct_block').height($('.addsct_block').width() * 225 / 355);
+$('.addscb_block').height($('.addscb_block').width() * 260 / 180);
+$('.zya_block').height($('.zya_block').width() * 185 / 355);
+
+var issx = 0;
+
+// 轮播图跳转
+$('#slider').on('tap', '.swiper-slide', function() {
+ openAds($(this));
+})
+
+//导航栏
+document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
+ if (-scroll.y < 0) {
+ num = 0;
+ } else if ((-scroll.y > 0 || scroll.y == 0) && -scroll.y < 150) {
+ num = -scroll.y / 150;
+ } else {
+ num = 1;
+ }
+ $('.header').css('background-color', 'rgba(255,255,255,' + num + ')')
+
+ if (-scroll.y < 75) {
+ $('.saoyisao').attr('src', '../img/saoyisao.png');
+ $('.msg').attr('src', '../img/icon_msg.png');
+ $('.search').attr('src', '../img/icon_search.png');
+ $('#search').css('background-color', 'white');
+ $('.header').removeClass('shadown_wai');
+ } else {
+ $('.saoyisao').attr('src', '../img/saoyisao1.png');
+ $('.msg').attr('src', '../img/icon_msg1.png');
+ $('.search').attr('src', '../img/icon_search1.png');
+ $('#search').css('background-color', '#d8d8d8');
+ $('.header').addClass('shadown_wai');
+ }
+
+ if (scroll.y > 80 && issx == 0) {
+ issx = 1;
+ setTimeout(function() {
+ location.reload()
+ }, 1000)
+ }
+})
+mui('.classify').on('tap', '.class_block', function() {
+ var classifyId = $(this).attr('data-classifyId');
+ var url = 'orSupermarket.html';
+
+ if (classifyId == '') {
+ url = 'ac3.html';
+ }
+ JZL.openWindow(url, url, {classifyId: classifyId});
+})
+
+//为你推荐
+getRecommend(page, pageSize);
+document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
+ if (scroll.y == scroll.maxScrollY) {
+ if (isjiazai == 1) {
+ page++;
+ getRecommend(page, pageSize);
+ }
+ }
+})
+//搜索
+$('.header').on('focus', '#keyword', function() {
+ $(".search button").css('display', 'block');
+})
+$('.header').on('blur', '#keyword', function() {
+ $(".search button").css('display', 'none');
+})
+$(".header").on('tap', '.search button', function(e) {
+ var searchName = $('#keyword').val();
+ JZL.openWindow('goodslist.html', 'goodslist.html', {data_keyword: searchName});
+ $('#keyword').val("")
+ // JZL.openWindow('shopsList.html', 'shopsList.html', {data_keyword: searchName});
+ //JZL.openWindow('shopgoodList.html', 'shopgoodList.html', {data_keyword: searchName});
+});
+//跳转商品详情页
+mui("body").on('tap', '.bc_img', function() {
+ var goodsId = $(this).attr('data-goodsId');
+ var shopId = $(this).parent().parent().attr('data-shopId');
+ JZL.openWindow('details.html', 'details.html' + goodsId, {data_id: goodsId,shopId: shopId});
})
diff --git a/static/app2/js/setting.js b/static/app2/js/setting.js
old mode 100755
new mode 100644
index 32b4146..1ce7749
--- a/static/app2/js/setting.js
+++ b/static/app2/js/setting.js
@@ -1,67 +1,81 @@
-$('.header_con .title').html('设置');
-$('#setting_loginInfo').hide();
-$('#connect_our').hide();
-mui.plusReady(function() {
- var token = localStorage.getItem('token');
- mui('.block').on('tap', '.row', function() {
- var url = $(this).attr('id');
- mui.openWindow({
- url: url + '.html',
- id: url + '.html',
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- // data_href: data_href
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
- })
- $('.loginout').on('tap', function() {
- ////console.log(111)
- mui.ajax(qlgUrl('app/users/logout'), {
- headers: {
- "HYH-Token": token
- },
- data: {},
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // //console.log(data.data.goodsFavoritesNum)
- localStorage.removeItem("token");
- mui.fire(plus.webview.getWebviewById('templete/my.html'), 'refresh');
- mui.fire(plus.webview.getWebviewById('templete/shoppingcart.html'), 'refresh');
- mui.back();
- var data = toJson(data, 1);
- if(data.status == 1) {
-
- }
-
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- })
+$('.header_con .title').html('设置');
+$('#setting_loginInfo').hide();
+$('#connect_our').hide();
+mui.plusReady(function() {
+ var token = localStorage.getItem('token');
+ mui('.block').on('tap', '.row', function() {
+ var url = $(this).attr('id');
+ mui.openWindow({
+ url: url + '.html',
+ id: url + '.html',
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ // data_href: data_href
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+ })
+ $('.loginout').on('tap', function() {
+ ////console.log(111)
+ mui.ajax(qlgUrl('app/users/logout'), {
+ headers: {
+ "HYH-Token": token
+ },
+ data: {},
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // //console.log(data.data.goodsFavoritesNum)
+ localStorage.removeItem("token");
+ localStorage.removeItem("userId");
+ localStorage.removeItem("userName");
+ mui.fire(plus.webview.getWebviewById('templete/my.html'), 'refresh');
+ mui.fire(plus.webview.getWebviewById('templete/shoppingcart_warp.html'), 'refresh');
+ mui.back();
+ var data = toJson(data, 1);
+ if(data.status == 1) {
+
+ }
+
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ })
+ $('.cancellation').on("tap", function(){
+ JZL.openWindow('cancellation.html', 'cancellation.html', {user_id: localStorage.getItem("userId")});
+ })
+ let counter = 0;
+ $('.title').on("tap", function(){
+ if(counter < 20){
+ counter ++ ;
+ }else{
+ counter = 0;
+ $(".hide").removeClass("hide")
+ }
+ })
})
\ No newline at end of file
diff --git a/static/app2/js/setting_address.js b/static/app2/js/setting_address.js
old mode 100755
new mode 100644
index 45bef1d..98eb8dd
--- a/static/app2/js/setting_address.js
+++ b/static/app2/js/setting_address.js
@@ -1,183 +1,183 @@
-$('.header_con .title').html('编辑收货地址');
-
-$('.mui-scroll-wrapper').addClass('scroll_out_t').removeClass('scroll_out');
-$('.footer_btn').css('z-index', '10000')
-
-mui.init({
- beforeback: function() { //获得父页面的webview
- //触发父页面的自定义事件(refresh),从而进行刷新
-
- //返回true,继续页面关闭逻辑
- return true;
- }
-});
-mui.plusReady(function() {
- window.addEventListener('reload', function(e) { //执行刷新
- location.reload();
- });
- var self = plus.webview.currentWebview();
- var isOrder = self.data_isOrder;
- if (isOrder == true) {
- $('.con').on('tap', '.block', function() {
- var addressId = $(this).attr('data-addressId');
- localStorage.setItem('addressId', addressId);
- var list = plus.webview.currentWebview().opener();
- mui.fire(list, 'setAddress');
- mui.back();
- })
- }
- mui.ajax(qlgUrl('app/useraddress/getList'), {
- data: {},
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- var data = toJson(data, 1);
- if (data.status == 1) {
- data = data.data;
- var html = '';
- $.each(data.addressList, function() {
- html += '
' + this.userName +
- '
' + this.userPhone + '
' + this.areaName + ' ' + this.userAddress +
- '
设为默认地址
'
- });
- $('.con').html(html)
- $('.btnout').each(function(num) {
- if ($(this).attr('data-isDefault') == 1) {
- $(this).children('.btn').addClass('on')
- }
- })
-
- } else {
- mui.alert(data.msg)
- }
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
-
- $('body').on('tap', '.footer_btn', function() {
- mui.openWindow({
- url: 'editAddress.html',
- id: 'editAddress.html',
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
-
- // data_href: data_href
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
- })
-
- $('.con').on('tap', '.bj', function(e) {
- e.stopPropagation();
- var data_addressId = $(this).parent().attr('data-addressId');
- mui.openWindow({
- url: 'editAddress.html',
- id: 'editAddress.html',
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- data_addressId: data_addressId
- // data_href: data_href
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
- })
- $('.con').on('tap', '.del', function() {
- var data_addressId = $(this).parent().attr('data-addressId');
- if (confirm('确认删除地址?')) {
- mui.ajax(hyhUrl('app/Useraddress/del'), {
- data: {
- id: data_addressId
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- var data = toJson(data, 1);
- if (data.status == 1) {
- location.reload()
-
- } else {
- mui.alert(data.msg)
- }
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- }
-
- })
- $('.con').on('tap', '.btnout', function() {
- $('.btnout').children('.btn').removeClass('on');
- $(this).children('.btn').addClass('on');
- var addressId = $(this).parent().attr('data-addressId')
- mui.ajax(hyhUrl('app/Useraddress/setDefault'), {
- data: {
- id: addressId
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- var data = toJson(data, 1);
- if (data.status == 1) {
- location.reload()
-
- } else {
- mui.alert(data.msg)
- }
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- })
+$('.header_con .title').html('编辑收货地址');
+
+$('.mui-scroll-wrapper').addClass('scroll_out_t').removeClass('scroll_out');
+$('.footer_btn').css('z-index', '10000')
+
+mui.init({
+ beforeback: function() { //获得父页面的webview
+ //触发父页面的自定义事件(refresh),从而进行刷新
+
+ //返回true,继续页面关闭逻辑
+ return true;
+ }
+});
+mui.plusReady(function() {
+ window.addEventListener('reload', function(e) { //执行刷新
+ location.reload();
+ });
+ var self = plus.webview.currentWebview();
+ var isOrder = self.data_isOrder;
+ if (isOrder == true) {
+ $('.con').on('tap', '.block', function() {
+ var addressId = $(this).attr('data-addressId');
+ localStorage.setItem('addressId', addressId);
+ var list = plus.webview.currentWebview().opener();
+ mui.fire(list, 'setAddress');
+ mui.back();
+ })
+ }
+ mui.ajax(qlgUrl('app/useraddress/getList'), {
+ data: {},
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ var data = toJson(data, 1);
+ if (data.status == 1) {
+ data = data.data;
+ var html = '';
+ $.each(data.addressList, function() {
+ html += '
' + this.userName +
+ '
' + this.userPhone + '
' + this.areaName + ' ' + this.userAddress +
+ '
设为默认地址
'
+ });
+ $('.con').html(html)
+ $('.btnout').each(function(num) {
+ if ($(this).attr('data-isDefault') == 1) {
+ $(this).children('.btn').addClass('on')
+ }
+ })
+
+ } else {
+ mui.alert(data.msg)
+ }
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+
+ $('body').on('tap', '.footer_btn', function() {
+ mui.openWindow({
+ url: 'editAddress.html',
+ id: 'editAddress.html',
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+
+ // data_href: data_href
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+ })
+
+ $('.con').on('tap', '.bj', function(e) {
+ e.stopPropagation();
+ var data_addressId = $(this).parent().attr('data-addressId');
+ mui.openWindow({
+ url: 'editAddress.html',
+ id: 'editAddress.html',
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ data_addressId: data_addressId
+ // data_href: data_href
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+ })
+ $('.con').on('tap', '.del', function() {
+ var data_addressId = $(this).parent().attr('data-addressId');
+ if (confirm('确认删除地址?')) {
+ mui.ajax(hyhUrl('app/Useraddress/del'), {
+ data: {
+ id: data_addressId
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ var data = toJson(data, 1);
+ if (data.status == 1) {
+ location.reload()
+
+ } else {
+ mui.alert(data.msg)
+ }
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ }
+
+ })
+ $('.con').on('tap', '.btnout', function() {
+ $('.btnout').children('.btn').removeClass('on');
+ $(this).children('.btn').addClass('on');
+ var addressId = $(this).parent().attr('data-addressId')
+ mui.ajax(hyhUrl('app/Useraddress/setDefault'), {
+ data: {
+ id: addressId
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ var data = toJson(data, 1);
+ if (data.status == 1) {
+ location.reload()
+
+ } else {
+ mui.alert(data.msg)
+ }
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ })
})
diff --git a/static/app2/js/setting_fogetPayPwd.js b/static/app2/js/setting_fogetPayPwd.js
old mode 100755
new mode 100644
index 60b7b5e..68532da
--- a/static/app2/js/setting_fogetPayPwd.js
+++ b/static/app2/js/setting_fogetPayPwd.js
@@ -1,200 +1,200 @@
$('#newPass').attr('type','text');
-$('#newPass2').attr('type','text');
-
-mui.plusReady(function() {
- var token = localStorage.getItem('token');
- var wait = 120;
-
- function time() {
-
- if(wait == 0) {
- $('#mobileCode').removeAttr("disabled");
- $('#mobileCode').val("重新发送");
- wait = 120;
- } else {
- $('#mobileCode').attr("disabled", true);
- $('#mobileCode').val("重新发送(" + wait + ")");
- wait--;
- setTimeout(function() {
- time();
- },
- 1000)
- }
-
- }
-
- mui.ajax(hyhUrl('app/users/backPayPass'), {
- headers: {
- "HYH-Token": token
- },
- data: {},
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- var data = toJson(data);
- if(data.status == 1) {
- data = data.data;
- if(data.userPhone) {
- $('#userPhone').val(data.userPhone);
- $('#userPhone').attr('disabled', 'disabled');
- } else {
- alert('未绑定手机请先绑定手机!');
- mui.openWindow({
- url: 'setting_phone.html',
- id: 'setting_phone.html',
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- // data_href: data_href
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
- }
- } else {
- alert(data.msg);
- }
-
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // alert(type);
- }
- });
- mui('.row').on('tap', '#mobileCode', function() {
- var that = $(this);
-
- $(this).attr("disabled", true);
- mui.ajax(hyhUrl('app/users/backpayCode'), {
-
- data: {},
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒
- success: function(data) {
- var data = toJson(data);
- //服务器返回响应,根据响应结果,分析是否登录成功;
- if(data.status == 1) {
- time();
- } else {
- alert(data.msg)
- }
- that.removeAttr('disabled');
- },
-
- error: function(xhr, type, errorThrown) {
- //异常处理;
- // alert(type)
- // alert(type);
- }
- });
- })
- mui('.down').on('tap', '#true', function() {
- var phoneCode = $('#phoneCode').val();
- var that = $(this);
- if(phoneCode == '') {
- alert('验证码不能为空!');
- return;
- } else if(phoneCode.length < 4) {
- alert('验证码格式不正确!');
- return;
- }
-
- that.attr('disabled', 'disabled');
- mui.ajax(hyhUrl('app/users/verifybackPay'), {
- headers: {
- "HYH-Token": token
- },
- data: {
- phoneCode: phoneCode
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // console.log(data.data.goodsFavoritesNum)
- // console.log(data.data.Rows)
- var data = toJson(data);
- if(data.status == 1) {
- $('#con1').css('display', 'none');
- $('#down1').css('display', 'none');
- $('#con2').css('display', 'block');
- $('#down2').css('display', 'block');
- } else {
- alert(data.msg);
- }
- that.removeAttr('disabled')
-
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // alert(type);
- }
- });
-
- })
- mui('.down').on('tap', '#true2', function() {
- var newPass = $('#newPass').val();
- var newPass2 = $('#newPass2').val();
- var that = $(this);
- if(newPass == '') {
- alert('支付密码不能为空!');
- return;
- } else if(newPass.length != 6) {
- alert('支付密码为6位!');
- return;
- } else if(newPass != newPass2) {
- alert('两次支付密码不相同!');
- return;
- }
-
- that.attr('disabled', 'disabled');
- mui.ajax(hyhUrl('app/users/resetbackPay'), {
- headers: {
- "HYH-Token": token
- },
- data: {
- newPass: newPass
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // console.log(data.data.goodsFavoritesNum)
- // console.log(data.data.Rows)
- var data = toJson(data);
- if(data.status == 1) {
- alert(data.msg);
- mui.back();
- } else {
- alert(data.msg);
- }
- that.removeAttr('disabled')
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // alert(type);
- }
- });
-
- })
-
+$('#newPass2').attr('type','text');
+
+mui.plusReady(function() {
+ var token = localStorage.getItem('token');
+ var wait = 120;
+
+ function time() {
+
+ if(wait == 0) {
+ $('#mobileCode').removeAttr("disabled");
+ $('#mobileCode').val("重新发送");
+ wait = 120;
+ } else {
+ $('#mobileCode').attr("disabled", true);
+ $('#mobileCode').val("重新发送(" + wait + ")");
+ wait--;
+ setTimeout(function() {
+ time();
+ },
+ 1000)
+ }
+
+ }
+
+ mui.ajax(hyhUrl('app/users/backPayPass'), {
+ headers: {
+ "HYH-Token": token
+ },
+ data: {},
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ var data = toJson(data);
+ if(data.status == 1) {
+ data = data.data;
+ if(data.userPhone) {
+ $('#userPhone').val(data.userPhone);
+ $('#userPhone').attr('disabled', 'disabled');
+ } else {
+ alert('未绑定手机请先绑定手机!');
+ mui.openWindow({
+ url: 'setting_phone.html',
+ id: 'setting_phone.html',
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ // data_href: data_href
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+ }
+ } else {
+ alert(data.msg);
+ }
+
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // alert(type);
+ }
+ });
+ mui('.row').on('tap', '#mobileCode', function() {
+ var that = $(this);
+
+ $(this).attr("disabled", true);
+ mui.ajax(hyhUrl('app/users/backpayCode'), {
+
+ data: {},
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒
+ success: function(data) {
+ var data = toJson(data);
+ //服务器返回响应,根据响应结果,分析是否登录成功;
+ if(data.status == 1) {
+ time();
+ } else {
+ alert(data.msg)
+ }
+ that.removeAttr('disabled');
+ },
+
+ error: function(xhr, type, errorThrown) {
+ //异常处理;
+ // alert(type)
+ // alert(type);
+ }
+ });
+ })
+ mui('.down').on('tap', '#true', function() {
+ var phoneCode = $('#phoneCode').val();
+ var that = $(this);
+ if(phoneCode == '') {
+ alert('验证码不能为空!');
+ return;
+ } else if(phoneCode.length < 4) {
+ alert('验证码格式不正确!');
+ return;
+ }
+
+ that.attr('disabled', 'disabled');
+ mui.ajax(hyhUrl('app/users/verifybackPay'), {
+ headers: {
+ "HYH-Token": token
+ },
+ data: {
+ phoneCode: phoneCode
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // console.log(data.data.goodsFavoritesNum)
+ // console.log(data.data.Rows)
+ var data = toJson(data);
+ if(data.status == 1) {
+ $('#con1').css('display', 'none');
+ $('#down1').css('display', 'none');
+ $('#con2').css('display', 'block');
+ $('#down2').css('display', 'block');
+ } else {
+ alert(data.msg);
+ }
+ that.removeAttr('disabled')
+
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // alert(type);
+ }
+ });
+
+ })
+ mui('.down').on('tap', '#true2', function() {
+ var newPass = $('#newPass').val();
+ var newPass2 = $('#newPass2').val();
+ var that = $(this);
+ if(newPass == '') {
+ alert('支付密码不能为空!');
+ return;
+ } else if(newPass.length != 6) {
+ alert('支付密码为6位!');
+ return;
+ } else if(newPass != newPass2) {
+ alert('两次支付密码不相同!');
+ return;
+ }
+
+ that.attr('disabled', 'disabled');
+ mui.ajax(hyhUrl('app/users/resetbackPay'), {
+ headers: {
+ "HYH-Token": token
+ },
+ data: {
+ newPass: newPass
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // console.log(data.data.goodsFavoritesNum)
+ // console.log(data.data.Rows)
+ var data = toJson(data);
+ if(data.status == 1) {
+ alert(data.msg);
+ mui.back();
+ } else {
+ alert(data.msg);
+ }
+ that.removeAttr('disabled')
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // alert(type);
+ }
+ });
+
+ })
+
})
\ No newline at end of file
diff --git a/static/app2/js/setting_fogetPwd.js b/static/app2/js/setting_fogetPwd.js
old mode 100755
new mode 100644
index e243908..78e19bc
--- a/static/app2/js/setting_fogetPwd.js
+++ b/static/app2/js/setting_fogetPwd.js
@@ -1,208 +1,208 @@
-mui.plusReady(function() {
- var wait = 120;
-
- function time() {
-
- if (wait == 0) {
- $('#mobileCode').removeAttr("disabled");
- $('#mobileCode').val("重新发送");
- wait = 120;
- } else {
- $('#mobileCode').attr("disabled", true);
- $('#mobileCode').val("重新发送(" + wait + ")");
- wait--;
- setTimeout(function() {
- time();
- },
- 1000)
- }
-
- }
-
- mui('.row').on('tap', '#mobileCode', function() {
- var that = $(this);
-
- $(this).attr("disabled", true);
- mui.ajax(qlgUrl('app/users/getfindPhone'), {
-
- data: {},
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒
- success: function(data) {
- var data = toJson(data);
- //服务器返回响应,根据响应结果,分析是否登录成功;
- if (data.status == 1) {
- time();
- } else {
- mui.alert(data.msg)
- }
- that.removeAttr('disabled');
- },
-
- error: function(xhr, type, errorThrown) {
- //异常处理;
- // mui.alert(type)
- // mui.alert(type);
- }
- });
- })
- mui('.down').on('tap', '#true0', function() {
- var loginName0 = $('#loginName0').val();
- var that = $(this);
- if (loginName0 == '') {
- mui.alert('用户名不能为空!');
- return;
- }
-
- that.attr('disabled', 'disabled');
- mui.ajax(qlgUrl('app/users/findPass'), {
-
- data: {
- loginName: loginName0,
- step: 1
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // //console.log(data.data.goodsFavoritesNum)
- // //console.log(data.data.Rows)
- var data = toJson(data);
- if (data.status == 1) {
- $('#con0').css('display', 'none');
- $('#down0').css('display', 'none');
- $('#con1').css('display', 'block');
- $('#down1').css('display', 'block');
- mui.ajax(hyhUrl('app/users/forgetPasst'), {
-
- data: {},
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // //console.log(data.data.goodsFavoritesNum)
- // //console.log(data.data.Rows)
- var data = toJson(data);
- if (data.status == 1) {
- $('#loginName').val(data.data.loginName);
- $('#loginName').attr('disabled', 'disabled');
- $('#userPhone').val(data.data.userPhone);
- $('#userPhone').attr('disabled', 'disabled');
-
- } else {
- mui.alert(data.msg);
- }
- that.removeAttr('disabled')
-
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- } else {
- mui.alert(data.msg);
- }
- that.removeAttr('disabled')
-
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
-
- })
- mui('.down').on('tap', '#true', function() {
- var phoneCode = $('#phoneCode').val();
- var that = $(this);
- if (phoneCode == '') {
- mui.alert('验证码不能为空!');
- return;
- } else if (phoneCode.length < 4) {
- mui.alert('验证码格式不正确!');
- return;
- }
-
- that.attr('disabled', 'disabled');
- mui.ajax(qlgUrl('app/users/findPass'), {
- data: {
- Checkcode: phoneCode,
- modes: 1,
- step: 2
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // //console.log(data.data.goodsFavoritesNum)
- // //console.log(data.data.Rows)
- var data = toJson(data);
- if (data.status == 1) {
- ////console.log(data);
- //alert(1)
- document.getElementById("con1").style.display = "none";
- document.getElementById("down1").style.display = "none";
- document.getElementById("con2").style.display = "block";
- document.getElementById("down2").style.display = "block";
-
- //$('#con1').css('display', 'none');
- //$('#down1').css('display', 'none');
- //$('#con2').css('display', 'block');
- //$('#down2').css('display', 'block');
- } else {
- mui.alert(data.msg);
- }
- that.removeAttr('disabled')
-
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- mui.alert(type);
- }
- });
-
- })
- mui('.down').on('tap', '#true2', function() {
- var loginPwd = $('#loginPwd').val();
- var repassword = $('#repassword').val();
- var that = $(this);
- if (loginPwd == '') {
- mui.alert('登录密码不能为空!');
- return;
- } else if (loginPwd.length < 6) {
- mui.alert('登录密码最少为6位!');
- return;
- } else if (loginPwd != repassword) {
- mui.alert('两次支付密码不相同!');
- return;
- }
-
- that.attr('disabled', 'disabled');
- mui.ajax(qlgUrl('app/users/findPass'), {
- data: {
- step: 3,
- loginPwd: loginPwd,
- repassword: repassword
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // //console.log(data.data.goodsFavoritesNum)
- // //console.log(data.data.Rows)
- var data = toJson(data);
- if (data.status == 1) {
- mui.alert(data.msg);
- mui.back();
- } else {
- mui.alert(data.msg);
- }
- that.removeAttr('disabled');
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
-
- })
-
+mui.plusReady(function() {
+ var wait = 120;
+
+ function time() {
+
+ if (wait == 0) {
+ $('#mobileCode').removeAttr("disabled");
+ $('#mobileCode').val("重新发送");
+ wait = 120;
+ } else {
+ $('#mobileCode').attr("disabled", true);
+ $('#mobileCode').val("重新发送(" + wait + ")");
+ wait--;
+ setTimeout(function() {
+ time();
+ },
+ 1000)
+ }
+
+ }
+
+ mui('.row').on('tap', '#mobileCode', function() {
+ var that = $(this);
+
+ $(this).attr("disabled", true);
+ mui.ajax(qlgUrl('app/users/getfindPhone'), {
+
+ data: {},
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒
+ success: function(data) {
+ var data = toJson(data);
+ //服务器返回响应,根据响应结果,分析是否登录成功;
+ if (data.status == 1) {
+ time();
+ } else {
+ mui.alert(data.msg)
+ }
+ that.removeAttr('disabled');
+ },
+
+ error: function(xhr, type, errorThrown) {
+ //异常处理;
+ // mui.alert(type)
+ // mui.alert(type);
+ }
+ });
+ })
+ mui('.down').on('tap', '#true0', function() {
+ var loginName0 = $('#loginName0').val();
+ var that = $(this);
+ if (loginName0 == '') {
+ mui.alert('用户名不能为空!');
+ return;
+ }
+
+ that.attr('disabled', 'disabled');
+ mui.ajax(qlgUrl('app/users/findPass'), {
+
+ data: {
+ loginName: loginName0,
+ step: 1
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // //console.log(data.data.goodsFavoritesNum)
+ // //console.log(data.data.Rows)
+ var data = toJson(data);
+ if (data.status == 1) {
+ $('#con0').css('display', 'none');
+ $('#down0').css('display', 'none');
+ $('#con1').css('display', 'block');
+ $('#down1').css('display', 'block');
+ mui.ajax(hyhUrl('app/users/forgetPasst'), {
+
+ data: {},
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // //console.log(data.data.goodsFavoritesNum)
+ // //console.log(data.data.Rows)
+ var data = toJson(data);
+ if (data.status == 1) {
+ $('#loginName').val(data.data.loginName);
+ $('#loginName').attr('disabled', 'disabled');
+ $('#userPhone').val(data.data.userPhone);
+ $('#userPhone').attr('disabled', 'disabled');
+
+ } else {
+ mui.alert(data.msg);
+ }
+ that.removeAttr('disabled')
+
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ } else {
+ mui.alert(data.msg);
+ }
+ that.removeAttr('disabled')
+
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+
+ })
+ mui('.down').on('tap', '#true', function() {
+ var phoneCode = $('#phoneCode').val();
+ var that = $(this);
+ if (phoneCode == '') {
+ mui.alert('验证码不能为空!');
+ return;
+ } else if (phoneCode.length < 4) {
+ mui.alert('验证码格式不正确!');
+ return;
+ }
+
+ that.attr('disabled', 'disabled');
+ mui.ajax(qlgUrl('app/users/findPass'), {
+ data: {
+ Checkcode: phoneCode,
+ modes: 1,
+ step: 2
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // //console.log(data.data.goodsFavoritesNum)
+ // //console.log(data.data.Rows)
+ var data = toJson(data);
+ if (data.status == 1) {
+ ////console.log(data);
+ //alert(1)
+ document.getElementById("con1").style.display = "none";
+ document.getElementById("down1").style.display = "none";
+ document.getElementById("con2").style.display = "block";
+ document.getElementById("down2").style.display = "block";
+
+ //$('#con1').css('display', 'none');
+ //$('#down1').css('display', 'none');
+ //$('#con2').css('display', 'block');
+ //$('#down2').css('display', 'block');
+ } else {
+ mui.alert(data.msg);
+ }
+ that.removeAttr('disabled')
+
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ mui.alert(type);
+ }
+ });
+
+ })
+ mui('.down').on('tap', '#true2', function() {
+ var loginPwd = $('#loginPwd').val();
+ var repassword = $('#repassword').val();
+ var that = $(this);
+ if (loginPwd == '') {
+ mui.alert('登录密码不能为空!');
+ return;
+ } else if (loginPwd.length < 6) {
+ mui.alert('登录密码最少为6位!');
+ return;
+ } else if (loginPwd != repassword) {
+ mui.alert('两次支付密码不相同!');
+ return;
+ }
+
+ that.attr('disabled', 'disabled');
+ mui.ajax(qlgUrl('app/users/findPass'), {
+ data: {
+ step: 3,
+ loginPwd: loginPwd,
+ repassword: repassword
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // //console.log(data.data.goodsFavoritesNum)
+ // //console.log(data.data.Rows)
+ var data = toJson(data);
+ if (data.status == 1) {
+ mui.alert(data.msg);
+ mui.back();
+ } else {
+ mui.alert(data.msg);
+ }
+ that.removeAttr('disabled');
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+
+ })
+
})
diff --git a/static/app2/js/setting_loginInfo.js b/static/app2/js/setting_loginInfo.js
old mode 100755
new mode 100644
index 76fcf0a..2e7a688
--- a/static/app2/js/setting_loginInfo.js
+++ b/static/app2/js/setting_loginInfo.js
@@ -1,34 +1,34 @@
-mui('.block').on('tap', '.row', function() {
- var url = $(this).attr('id');
- mui.openWindow({
- url: url + '.html',
- id: url + '.html',
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- // data_href: data_href
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
+mui('.block').on('tap', '.row', function() {
+ var url = $(this).attr('id');
+ mui.openWindow({
+ url: url + '.html',
+ id: url + '.html',
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ // data_href: data_href
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
})
\ No newline at end of file
diff --git a/static/app2/js/setting_payPwd.js b/static/app2/js/setting_payPwd.js
old mode 100755
new mode 100644
index 4d9220b..29af7f3
--- a/static/app2/js/setting_payPwd.js
+++ b/static/app2/js/setting_payPwd.js
@@ -1,58 +1,58 @@
-mui.plusReady(function() {
- var token = localStorage.getItem('token');
-
- mui('.down').on('tap', '#true', function() {
- var that = $(this)
- var oldPass = $('#oldPass').val();
- var newPass = $('#newPass').val();
- var newPass2 = $('#newPass2').val();
-
- if (oldPass == '') {
- mui.alert('原支付密码不能为空!');
- return;
- }
- if (newPass == '') {
- mui.alert('新支付密码不能为空!');
- return;
- }
- if (newPass.length != 6) {
- mui.alert('新支付密码长度为6位!');
- return;
- }
- if (!(newPass == newPass2)) {
- mui.alert('两次支付密码不一致!');
- return;
- }
-
- $(this).attr("disabled", true);
- mui.ajax(qlgUrl('app/users/editpayPwd'), {
-
- data: {
- oldPass: oldPass,
- newPass: newPass,
- reNewPass: newPass2
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒
- success: function(data) {
- var data = toJson(data);
- //服务器返回响应,根据响应结果,分析是否登录成功;
- if (data.status == 1) {
- mui.alert(data.msg);
- mui.back();
-
- } else {
- mui.alert(data.msg);
- }
- that.removeAttr('disabled');
- },
-
- error: function(xhr, type, errorThrown) {
- //异常处理;
- // mui.alert(type)
- }
- });
- })
-
+mui.plusReady(function() {
+ var token = localStorage.getItem('token');
+
+ mui('.down').on('tap', '#true', function() {
+ var that = $(this)
+ var oldPass = $('#oldPass').val();
+ var newPass = $('#newPass').val();
+ var newPass2 = $('#newPass2').val();
+
+ if (oldPass == '') {
+ mui.alert('原支付密码不能为空!');
+ return;
+ }
+ if (newPass == '') {
+ mui.alert('新支付密码不能为空!');
+ return;
+ }
+ if (newPass.length != 6) {
+ mui.alert('新支付密码长度为6位!');
+ return;
+ }
+ if (!(newPass == newPass2)) {
+ mui.alert('两次支付密码不一致!');
+ return;
+ }
+
+ $(this).attr("disabled", true);
+ mui.ajax(qlgUrl('app/users/editpayPwd'), {
+
+ data: {
+ oldPass: oldPass,
+ newPass: newPass,
+ reNewPass: newPass2
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒
+ success: function(data) {
+ var data = toJson(data);
+ //服务器返回响应,根据响应结果,分析是否登录成功;
+ if (data.status == 1) {
+ mui.alert(data.msg);
+ mui.back();
+
+ } else {
+ mui.alert(data.msg);
+ }
+ that.removeAttr('disabled');
+ },
+
+ error: function(xhr, type, errorThrown) {
+ //异常处理;
+ // mui.alert(type)
+ }
+ });
+ })
+
})
diff --git a/static/app2/js/setting_phone.js b/static/app2/js/setting_phone.js
old mode 100755
new mode 100644
index a77d2e8..b5d5cf7
--- a/static/app2/js/setting_phone.js
+++ b/static/app2/js/setting_phone.js
@@ -1,258 +1,258 @@
-mui.plusReady(function() {
- var token = localStorage.getItem('token');
- var isBang = 0;
- var isOver = 1;
- var wait = 120;
- var wait1 = 120;
-
- function time() {
-
- if (wait == 0) {
- $('#mobileCode').removeAttr("disabled");
- $('#mobileCode').val("重新发送");
- wait = 120;
- } else {
- $('#mobileCode').attr("disabled", true);
- $('#mobileCode').val("重新发送(" + wait + ")");
- wait--;
- setTimeout(function() {
- time();
- },
- 1000)
- }
-
- }
-
- function time1() {
-
- if (wait1 == 0) {
- $('#mobileCode1').removeAttr("disabled");
- $('#mobileCode1').val("重新发送");
- wait1 = 120;
- } else {
- $('#mobileCode1').attr("disabled", true);
- $('#mobileCode1').val("重新发送(" + wait1 + ")");
- wait1--;
- setTimeout(function() {
- time1();
- },
- 1000)
- }
-
- }
- mui.ajax(qlgUrl('app/users/editPhone'), {
- headers: {
- "HYH-Token": token
- },
- data: {},
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- var data = toJson(data);
- if (data.status == 1) {
- data = data.data;
-
- if (data.userPhone) {
- isBang = 1;
- $('#userPhone').val(data.userPhone);
- $('#userPhone').attr('disabled', 'disabled');
- $('#next_btn').css('display', 'block');
- } else {
- $('#true').css('display', 'block');
- }
- } else {
- mui.alert(data.msg);
- }
-
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- mui('.row').on('tap', '.codeBtn', function() {
- var that = $(this)
- var userPhone = $('#userPhone').val();
- var url = $(this).attr('id') == 'mobileCode' ? 'sendCodeEdit' : 'sendCodeTie'
- if (isBang == 0 || isOver == 0) {
- if (userPhone == '') {
- mui.alert('手机号不能为空!');
- return;
-
- }
- if (!(
- /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/
- .test(userPhone))) {
- mui.alert("手机号码有误,请重填!");
- return;
- }
- } else {
- userPhone = '';
- }
-
- $(this).attr("disabled", true);
- mui.ajax(qlgUrl('app/users/' + url), {
-
- data: {
- userPhone: userPhone
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒
- success: function(data) {
- var data = toJson(data);
- //服务器返回响应,根据响应结果,分析是否登录成功;
- if (data.status == 1) {
-
- if (that.attr('id') == 'mobileCode') {
- time();
- } else if (that.attr('id') == 'mobileCode1') {
- time1();
- }
-
- } else {
- mui.alert(data.msg)
- }
- that.removeAttr('disabled');
- },
-
- error: function(xhr, type, errorThrown) {
- //异常处理;
- // mui.alert(type)
- // mui.alert(type);
- }
- });
- })
- //未绑定手机
- mui('.down').on('tap', '#true', function() {
- var phoneCode = $('#phoneCode').val();
- var that = $(this);
- if (phoneCode == '') {
- mui.alert('验证码不能为空!');
- return;
- } else if (phoneCode.length < 4) {
- mui.alert('验证码格式不正确!');
- return;
- }
-
- that.attr('disabled', 'disabled');
- mui.ajax(qlgUrl('app/users/phoneEdit'), {
- headers: {
- "HYH-Token": token
- },
- data: {
- phoneCode: phoneCode
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // //console.log(data.data.goodsFavoritesNum)
- // //console.log(data.data.Rows)
- var data = toJson(data);
- if (data.status == 1) {
- mui.alert(data.msg);
- mui.back();
-
- } else {
- mui.alert(data.msg);
- }
- that.removeAttr('disabled')
-
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
-
- })
- //已绑定手机 1
- mui('.down').on('tap', '#next_btn', function() {
- var phoneCode = $('#phoneCode').val();
- var that = $(this);
- if (phoneCode == '') {
- mui.alert('验证码不能为空!');
- return;
- } else if (phoneCode.length < 4) {
- mui.alert('验证码格式不正确!');
- return;
- }
-
- that.attr('disabled', 'disabled');
- mui.ajax(qlgUrl('app/users/phoneEdito'), {
- headers: {
- "HYH-Token": token
- },
- data: {
- phoneCode: phoneCode
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // //console.log(data.data.goodsFavoritesNum)
- // //console.log(data.data.Rows)
- var data = toJson(data);
- if (data.status == 1) {
- $('#next_btn').css('display', 'none');
- $('#next_true').css('display', 'block');
- $('#userPhone').removeAttr('disabled');
- $('#userPhone').val('');
- $('#phoneCode').val('');
- $('#mobileCode').css('display', 'none');
- $('#mobileCode1').css('display', 'block');
- isOver = 0;
- } else {
- mui.alert(data.msg);
- }
- that.removeAttr('disabled');
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
-
- })
- //已绑定手机 2
- mui('.down').on('tap', '#next_true', function() {
- var phoneCode = $('#phoneCode').val();
- var that = $(this);
- if (phoneCode == '') {
- mui.alert('验证码不能为空!');
- return;
- } else if (phoneCode.length < 4) {
- mui.alert('验证码格式不正确!');
- return;
- }
-
- that.attr('disabled', 'disabled');
- mui.ajax(qlgUrl('app/users/phoneEdit'), {
- headers: {
- "HYH-Token": token
- },
- data: {
- phoneCode: phoneCode
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // //console.log(data.data.goodsFavoritesNum)
- // //console.log(data.data.Rows)
- var data = toJson(data);
- if (data.status == 1) {
- mui.alert(data.msg);
- mui.back();
- } else {
- mui.alert(data.msg);
- }
- that.removeAttr('disabled');
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
-
- })
-
+mui.plusReady(function() {
+ var token = localStorage.getItem('token');
+ var isBang = 0;
+ var isOver = 1;
+ var wait = 120;
+ var wait1 = 120;
+
+ function time() {
+
+ if (wait == 0) {
+ $('#mobileCode').removeAttr("disabled");
+ $('#mobileCode').val("重新发送");
+ wait = 120;
+ } else {
+ $('#mobileCode').attr("disabled", true);
+ $('#mobileCode').val("重新发送(" + wait + ")");
+ wait--;
+ setTimeout(function() {
+ time();
+ },
+ 1000)
+ }
+
+ }
+
+ function time1() {
+
+ if (wait1 == 0) {
+ $('#mobileCode1').removeAttr("disabled");
+ $('#mobileCode1').val("重新发送");
+ wait1 = 120;
+ } else {
+ $('#mobileCode1').attr("disabled", true);
+ $('#mobileCode1').val("重新发送(" + wait1 + ")");
+ wait1--;
+ setTimeout(function() {
+ time1();
+ },
+ 1000)
+ }
+
+ }
+ mui.ajax(qlgUrl('app/users/editPhone'), {
+ headers: {
+ "HYH-Token": token
+ },
+ data: {},
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ var data = toJson(data);
+ if (data.status == 1) {
+ data = data.data;
+
+ if (data.userPhone) {
+ isBang = 1;
+ $('#userPhone').val(data.userPhone);
+ $('#userPhone').attr('disabled', 'disabled');
+ $('#next_btn').css('display', 'block');
+ } else {
+ $('#true').css('display', 'block');
+ }
+ } else {
+ mui.alert(data.msg);
+ }
+
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ mui('.row').on('tap', '.codeBtn', function() {
+ var that = $(this)
+ var userPhone = $('#userPhone').val();
+ var url = $(this).attr('id') == 'mobileCode' ? 'sendCodeEdit' : 'sendCodeTie'
+ if (isBang == 0 || isOver == 0) {
+ if (userPhone == '') {
+ mui.alert('手机号不能为空!');
+ return;
+
+ }
+ if (!(
+ /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/
+ .test(userPhone))) {
+ mui.alert("手机号码有误,请重填!");
+ return;
+ }
+ } else {
+ userPhone = '';
+ }
+
+ $(this).attr("disabled", true);
+ mui.ajax(qlgUrl('app/users/' + url), {
+
+ data: {
+ userPhone: userPhone
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒
+ success: function(data) {
+ var data = toJson(data);
+ //服务器返回响应,根据响应结果,分析是否登录成功;
+ if (data.status == 1) {
+
+ if (that.attr('id') == 'mobileCode') {
+ time();
+ } else if (that.attr('id') == 'mobileCode1') {
+ time1();
+ }
+
+ } else {
+ mui.alert(data.msg)
+ }
+ that.removeAttr('disabled');
+ },
+
+ error: function(xhr, type, errorThrown) {
+ //异常处理;
+ // mui.alert(type)
+ // mui.alert(type);
+ }
+ });
+ })
+ //未绑定手机
+ mui('.down').on('tap', '#true', function() {
+ var phoneCode = $('#phoneCode').val();
+ var that = $(this);
+ if (phoneCode == '') {
+ mui.alert('验证码不能为空!');
+ return;
+ } else if (phoneCode.length < 4) {
+ mui.alert('验证码格式不正确!');
+ return;
+ }
+
+ that.attr('disabled', 'disabled');
+ mui.ajax(qlgUrl('app/users/phoneEdit'), {
+ headers: {
+ "HYH-Token": token
+ },
+ data: {
+ phoneCode: phoneCode
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // //console.log(data.data.goodsFavoritesNum)
+ // //console.log(data.data.Rows)
+ var data = toJson(data);
+ if (data.status == 1) {
+ mui.alert(data.msg);
+ mui.back();
+
+ } else {
+ mui.alert(data.msg);
+ }
+ that.removeAttr('disabled')
+
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+
+ })
+ //已绑定手机 1
+ mui('.down').on('tap', '#next_btn', function() {
+ var phoneCode = $('#phoneCode').val();
+ var that = $(this);
+ if (phoneCode == '') {
+ mui.alert('验证码不能为空!');
+ return;
+ } else if (phoneCode.length < 4) {
+ mui.alert('验证码格式不正确!');
+ return;
+ }
+
+ that.attr('disabled', 'disabled');
+ mui.ajax(qlgUrl('app/users/phoneEdito'), {
+ headers: {
+ "HYH-Token": token
+ },
+ data: {
+ phoneCode: phoneCode
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // //console.log(data.data.goodsFavoritesNum)
+ // //console.log(data.data.Rows)
+ var data = toJson(data);
+ if (data.status == 1) {
+ $('#next_btn').css('display', 'none');
+ $('#next_true').css('display', 'block');
+ $('#userPhone').removeAttr('disabled');
+ $('#userPhone').val('');
+ $('#phoneCode').val('');
+ $('#mobileCode').css('display', 'none');
+ $('#mobileCode1').css('display', 'block');
+ isOver = 0;
+ } else {
+ mui.alert(data.msg);
+ }
+ that.removeAttr('disabled');
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+
+ })
+ //已绑定手机 2
+ mui('.down').on('tap', '#next_true', function() {
+ var phoneCode = $('#phoneCode').val();
+ var that = $(this);
+ if (phoneCode == '') {
+ mui.alert('验证码不能为空!');
+ return;
+ } else if (phoneCode.length < 4) {
+ mui.alert('验证码格式不正确!');
+ return;
+ }
+
+ that.attr('disabled', 'disabled');
+ mui.ajax(qlgUrl('app/users/phoneEdit'), {
+ headers: {
+ "HYH-Token": token
+ },
+ data: {
+ phoneCode: phoneCode
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // //console.log(data.data.goodsFavoritesNum)
+ // //console.log(data.data.Rows)
+ var data = toJson(data);
+ if (data.status == 1) {
+ mui.alert(data.msg);
+ mui.back();
+ } else {
+ mui.alert(data.msg);
+ }
+ that.removeAttr('disabled');
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+
+ })
+
})
diff --git a/static/app2/js/setting_pwd.js b/static/app2/js/setting_pwd.js
old mode 100755
new mode 100644
index 2569bd1..0395d59
--- a/static/app2/js/setting_pwd.js
+++ b/static/app2/js/setting_pwd.js
@@ -1,60 +1,60 @@
-mui.plusReady(function() {
- var token = localStorage.getItem('token');
-
- mui('.down').on('tap', '#true', function() {
- var that = $(this)
- var oldPass = $('#oldPass').val();
- var newPass = $('#newPass').val();
- var newPass2 = $('#newPass2').val();
-
- if(oldPass == '') {
- mui.alert('原支付密码不能为空!');
- return;
- }
- if(newPass == '') {
- mui.alert('新支付密码不能为空!');
- return;
- }
- if(newPass.length < 6) {
- mui.alert('新支付密码不能小于6位!');
- return;
- }
- if(!(newPass == newPass2)) {
- mui.alert('两次支付密码不一致!');
- return;
- }
-
- $(this).attr("disabled", true);
- mui.ajax(qlgUrl('app/users/editloginPwd'), {
-
- data: {
- oldPass: oldPass,
- newPass: newPass
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒
- success: function(data) {
- var data = toJson(data);
- //服务器返回响应,根据响应结果,分析是否登录成功;
- //console.log(data.status)
- if(data.status == 1) {
-
- mui.alert(data.msg);
- mui.back();
-
- } else {
- mui.alert(data.msg);
- }
- that.removeAttr('disabled');
- },
-
- error: function(xhr, type, errorThrown) {
- //异常处理;
- // mui.alert(type)
- // mui.alert(type);
- }
- });
- })
-
+mui.plusReady(function() {
+ var token = localStorage.getItem('token');
+
+ mui('.down').on('tap', '#true', function() {
+ var that = $(this)
+ var oldPass = $('#oldPass').val();
+ var newPass = $('#newPass').val();
+ var newPass2 = $('#newPass2').val();
+
+ if(oldPass == '') {
+ mui.alert('原支付密码不能为空!');
+ return;
+ }
+ if(newPass == '') {
+ mui.alert('新支付密码不能为空!');
+ return;
+ }
+ if(newPass.length < 6) {
+ mui.alert('新支付密码不能小于6位!');
+ return;
+ }
+ if(!(newPass == newPass2)) {
+ mui.alert('两次支付密码不一致!');
+ return;
+ }
+
+ $(this).attr("disabled", true);
+ mui.ajax(qlgUrl('app/users/editloginPwd'), {
+
+ data: {
+ oldPass: oldPass,
+ newPass: newPass
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒
+ success: function(data) {
+ var data = toJson(data);
+ //服务器返回响应,根据响应结果,分析是否登录成功;
+ //console.log(data.status)
+ if(data.status == 1) {
+
+ mui.alert(data.msg);
+ mui.back();
+
+ } else {
+ mui.alert(data.msg);
+ }
+ that.removeAttr('disabled');
+ },
+
+ error: function(xhr, type, errorThrown) {
+ //异常处理;
+ // mui.alert(type)
+ // mui.alert(type);
+ }
+ });
+ })
+
})
\ No newline at end of file
diff --git a/static/app2/js/setting_recive.js b/static/app2/js/setting_recive.js
new file mode 100644
index 0000000..49ef140
--- /dev/null
+++ b/static/app2/js/setting_recive.js
@@ -0,0 +1,32 @@
+mui.plusReady(function(){
+
+ // TODO: some ajax
+ document.getElementById("realname").value = '';
+ document.getElementById("bank_name").value = '';
+ document.getElementById("bank_no").value = '';
+ document.getElementById("alipay_recive").value = '';
+ document.getElementById("wechat_recive").value = '';
+
+ $(".photos").on("tap", 'img', function() {
+ var _input = $(this).parent().parent().parent().prev()[0];
+ UP.init(_input.id, "test", this.id)
+ openCamera()
+ })
+
+ mui(".down").on("tap", "#true", function(){
+ var realname = document.getElementById("realname").value;
+ var bankName = document.getElementById("bank_name").value;
+ var bankNo = document.getElementById("bank_no").value;
+ var alipayRecive = document.getElementById("alipay_recive").value;
+ var wechatRecive = document.getElementById("wechat_recive").value;
+
+ var data = {
+ realname,
+ bankName,
+ bankNo,
+ alipayRecive,
+ wechatRecive,
+ }
+ console.log(data)
+ })
+})
\ No newline at end of file
diff --git a/static/app2/js/setting_user.js b/static/app2/js/setting_user.js
old mode 100755
new mode 100644
index 0a0dd05..8b0f102
--- a/static/app2/js/setting_user.js
+++ b/static/app2/js/setting_user.js
@@ -1,39 +1,39 @@
-$('.header_con .title').html('个人信息');
-
-$('.block').addClass('scroll_out_t')
-
-mui('.block').on('tap', '.row', function() {
- var url = $(this).attr('id');
- //console.log($(this));
- mui.openWindow({
- url: url + '.html',
- id: url + '.html',
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- // data_href: data_href
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
+$('.header_con .title').html('个人信息');
+
+$('.block').addClass('scroll_out_t')
+
+mui('.block').on('tap', '.row', function() {
+ var url = $(this).attr('id');
+ //console.log($(this));
+ mui.openWindow({
+ url: url + '.html',
+ id: url + '.html',
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ // data_href: data_href
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
})
\ No newline at end of file
diff --git a/static/app2/js/shangdu.js b/static/app2/js/shangdu.js
old mode 100755
new mode 100644
index c574e3d..97327f6
--- a/static/app2/js/shangdu.js
+++ b/static/app2/js/shangdu.js
@@ -1,225 +1,226 @@
-mui.plusReady(function() {
- // 获取申请信息
- var self = plus.webview.currentWebview();
- //console.log(self);
- var id = self.ssid ? self.ssid : '';
- JZL.ajax(qlgUrl('app/shops/getUserUpdate'), {
- applyLevel: 4
- }, function(data) {
- //console.log(data);
- if (1 == data.status & undefined != data.data) {
- var data = data.data;
-
- if (0 == data.status || 2 == data.status) {
- if (id == '') {
- id = data.id
- }
-
- getShopList(data.shopId);
-
- $('#confirm').attr('src', hyhImgUrl(data.confirmImg))
- $('#confirmImg').val(data.confirmImg)
-
- var imgs = data.shopImg
- imgs = Array.from(imgs.split(','))
- //console.log(imgs);
- var html = "";
- mui.each(imgs, function(index, element) {
- //console.log(index, element);
- html += '
 + ')
';
- })
- // var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1;
- var maxNum = imgs.length - 1;
- // //console.log(maxNum);
- // //console.log(num);
- // if (num == maxNum) {
- maxNum++;
- html += '

';
- $(".batchImg").html(html);
- // }
-
- //获取协议
- JZL.ajax(qlgUrl('app/Tags/articleDetail'), {
- articleId: 117
- }, function(data) {
- //console.log(data);
- // if (1==data.status) {
- // $('.zcxycontent').html(data.data.articleContent)
- $('.zcxycontent').html(data.articleContent)
-
- // }
-
- })
-
- } else if (1 == data.status) {
- //tiaozhuandao shangdu yemian
- }
- } else {
- getShopList();
- JZL.ajax(qlgUrl('app/Tags/articleDetail'), {
- articleId: 117
- }, function(data) {
- //console.log(data);
- // if (1==data.status) {
- // $('.zcxycontent').html(data.data.articleContent)
- $('.zcxycontent').html(data.articleContent)
-
- // }
-
- })
- }
- })
-
-
-
-
-
-
- // 上传图片
- $('.photos_con').on('tap', '.confirm', function() {
- UP.init("confirmImg", "test", "confirm")
- openCamera()
- })
- $(".batchImg").on("tap", '.galleryImg', function() {
- var num = $(this).attr('data-id');
- UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1);
- var that = $(this);
- openCamera(function(t, status, fileName, serverName) {
- var html = '


';
-
- that.html(html);
-
- var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1;
- if (num == maxNum) {
- maxNum++;
- html = '
';
- $(".batchImg").append(html);
- }
- });
- })
- //删除照片
- $(".batchImg").on('tap', '.delete', function(e) {
-
- e.preventDefault();
- e.stopPropagation()
-
- // //console.log(this);
- var that = $(this)
- //var idx = that.parent().attr('data-id');
- //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1;
- if (confirm('确认删除图片?')) {
- that.parent().remove()
- //delete galleryarr[idx];
- }
- })
-
- // 获取店铺信息
- function getShopList(defaultShopId) {
-
- JZL.ajax(qlgUrl('app/shops/userShopList'), {
- shopType: 1
- }, function(data) {
- //console.log(data);
- if (1 == data.status) {
- var html = "";
- html = `
`;
- if (undefined == typeof defaultShop) {
-
- mui.each(data.data, function() {
- // //console.log(index, element);
- html += `
`;
- })
- } else {
- mui.each(data.data, function() {
- if (this.shopId == defaultShopId) {
- selected = 'selected';
- } else {
- selected = '';
- }
- html += `
`;
- })
-
- }
- $("#shopId").html(html)
- } else {
- mui.alert(data.msg)
- }
- // })
- })
-
-
- }
-
-
-
-
-
- let click = 0
- $('.down').on('tap', '.btn', function() {
-
- if (click == 1) {
- return;
- }
- click = 1
- var imgs = '';
- var data = $('input[name="gallery[]"]');
- //console.log(data);
- $.each(data, function() {
- if ('' != $(this).val())
- imgs = $(this).val() + ',' + imgs;
- })
- imgs = imgs.substring(0, imgs.lastIndexOf(','));
- $('#shopImg').val(imgs);
- if ('' == $('#shopId option:selected').val()) {
- mui.alert('请选择要升级的店铺名称')
- return;
- }
-
- if ('' == $('#confirmImg').val()) {
- mui.alert('请上传确认书照片')
- return;
- }
- if ('' == $('#shopImg').val()) {
- mui.alert('请上传店铺照片')
- return;
- }
-
-
- var params = JZL.getParams(".inp");
-
- // var shopId=$("#chooseshop option:selected").val()
- // //console.log(shopId);
- // params.shopId=shopId;
- params.applyLevel = 4;
- if ("" != id) {
- params.id = id;
-
- }
- JZL.ajax(qlgUrl('app/shops/userUpdate'), params, function(data) {
- //console.log(data);
- if (1 == data.status) {
- mui.back()
- } else {
- mui.alert(data.msg)
- }
- })
- })
-
-
-
-
+from_id = 1
+mui.plusReady(function() {
+ // 获取申请信息
+ var self = plus.webview.currentWebview();
+ //console.log(self);
+ var id = self.ssid ? self.ssid : '';
+ JZL.ajax(qlgUrl('app/shops/getUserUpdate'), {
+ applyLevel: 4
+ }, function(data) {
+ //console.log(data);
+ if (1 == data.status & undefined != data.data) {
+ var data = data.data;
+
+ if (0 == data.status || 2 == data.status) {
+ if (id == '') {
+ id = data.id
+ }
+
+ getShopList(data.shopId);
+
+ $('#confirm').attr('src', hyhImgUrl(data.confirmImg))
+ $('#confirmImg').val(data.confirmImg)
+
+ var imgs = data.shopImg
+ imgs = Array.from(imgs.split(','))
+ //console.log(imgs);
+ var html = "";
+ mui.each(imgs, function(index, element) {
+ //console.log(index, element);
+ html += '
 + ')
';
+ })
+ // var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1;
+ var maxNum = imgs.length - 1;
+ // //console.log(maxNum);
+ // //console.log(num);
+ // if (num == maxNum) {
+ maxNum++;
+ html += '

';
+ $(".batchImg").html(html);
+ // }
+
+ //获取协议
+ JZL.ajax(qlgUrl('app/Tags/articleDetail'), {
+ articleId: 117
+ }, function(data) {
+ //console.log(data);
+ // if (1==data.status) {
+ // $('.zcxycontent').html(data.data.articleContent)
+ $('.zcxycontent').html(data.articleContent)
+
+ // }
+
+ })
+
+ } else if (1 == data.status) {
+ //tiaozhuandao shangdu yemian
+ }
+ } else {
+ getShopList();
+ JZL.ajax(qlgUrl('app/Tags/articleDetail'), {
+ articleId: 117
+ }, function(data) {
+ //console.log(data);
+ // if (1==data.status) {
+ // $('.zcxycontent').html(data.data.articleContent)
+ $('.zcxycontent').html(data.articleContent)
+
+ // }
+
+ })
+ }
+ })
+
+
+
+
+
+
+ // 上传图片
+ $('.photos_con').on('tap', '.confirm', function() {
+ UP.init("confirmImg", "test", "confirm")
+ openCamera()
+ })
+ $(".batchImg").on("tap", '.galleryImg', function() {
+ var num = $(this).attr('data-id');
+ UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1);
+ var that = $(this);
+ openCamera(function(t, status, fileName, serverName) {
+ var html = '


';
+
+ that.html(html);
+
+ var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1;
+ if (num == maxNum) {
+ maxNum++;
+ html = '
';
+ $(".batchImg").append(html);
+ }
+ });
+ })
+ //删除照片
+ $(".batchImg").on('tap', '.delete', function(e) {
+
+ e.preventDefault();
+ e.stopPropagation()
+
+ // //console.log(this);
+ var that = $(this)
+ //var idx = that.parent().attr('data-id');
+ //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1;
+ if (confirm('确认删除图片?')) {
+ that.parent().remove()
+ //delete galleryarr[idx];
+ }
+ })
+
+ // 获取店铺信息
+ function getShopList(defaultShopId) {
+
+ JZL.ajax(qlgUrl('app/shops/userShopList'), {
+ shopType: 1
+ }, function(data) {
+ //console.log(data);
+ if (1 == data.status) {
+ var html = "";
+ html = `
`;
+ if (undefined == typeof defaultShop) {
+
+ mui.each(data.data, function() {
+ // //console.log(index, element);
+ html += `
`;
+ })
+ } else {
+ mui.each(data.data, function() {
+ if (this.shopId == defaultShopId) {
+ selected = 'selected';
+ } else {
+ selected = '';
+ }
+ html += `
`;
+ })
+
+ }
+ $("#shopId").html(html)
+ } else {
+ mui.alert(data.msg)
+ }
+ // })
+ })
+
+
+ }
+
+
+
+
+
+ let click = 0
+ $('.down').on('tap', '.btn', function() {
+
+ if (click == 1) {
+ return;
+ }
+ click = 1
+ var imgs = '';
+ var data = $('input[name="gallery[]"]');
+ //console.log(data);
+ $.each(data, function() {
+ if ('' != $(this).val())
+ imgs = $(this).val() + ',' + imgs;
+ })
+ imgs = imgs.substring(0, imgs.lastIndexOf(','));
+ $('#shopImg').val(imgs);
+ if ('' == $('#shopId option:selected').val()) {
+ mui.alert('请选择要升级的店铺名称')
+ return;
+ }
+
+ if ('' == $('#confirmImg').val()) {
+ mui.alert('请上传确认书照片')
+ return;
+ }
+ if ('' == $('#shopImg').val()) {
+ mui.alert('请上传店铺照片')
+ return;
+ }
+
+
+ var params = JZL.getParams(".inp");
+
+ // var shopId=$("#chooseshop option:selected").val()
+ // //console.log(shopId);
+ // params.shopId=shopId;
+ params.applyLevel = 4;
+ if ("" != id) {
+ params.id = id;
+
+ }
+ JZL.ajax(qlgUrl('app/shops/userUpdate'), params, function(data) {
+ //console.log(data);
+ if (1 == data.status) {
+ mui.back()
+ } else {
+ mui.alert(data.msg)
+ }
+ })
+ })
+
+
+
+
})
diff --git a/static/app2/js/shop_decorate.js b/static/app2/js/shop_decorate.js
old mode 100755
new mode 100644
index 5ce4dd9..aca419c
--- a/static/app2/js/shop_decorate.js
+++ b/static/app2/js/shop_decorate.js
@@ -1,126 +1,126 @@
-mui.plusReady(function() {
- var self = plus.webview.currentWebview();
- //console.log(self);
- var shopId = self.id;
- //获取店铺相册
- JZL.ajax(qlgUrl('app/shops/getShopImg'), {
- shopId: shopId
- }, function(data) {
- //console.log(data);
- if (1 == data.status && '' != data.data.shopImg) {
- $('#shop').attr('src', hyhImgUrl(data.data.shopImg))
- $('#shopImg').val(data.data.shopImg)
- if ('' != data.data.shopAds) {
- var shopAds = data.data.shopAds;
-
- ads = shopAds.split(",")
- //console.log(ads);
- var html = '';
- mui.each(ads, function(index, element) {
- //console.log(element);
- html += '
 + ')
'
- })
- var maxNum = ads.length;
- html += '
';
- $('.batchImg').html(html)
-
- }
-
- } else {
- mui.alert(data.msg)
- }
- })
-
- $(".batchImg").on("tap", '.galleryImg', function() {
- var num = $(this).attr('data-id');
- UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1);
- var that = $(this);
- openCamera(function(t, status, fileName, serverName) {
- var html = '

';
-
- that.html(html);
-
- var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1;
- if (num == maxNum) {
- maxNum++;
- html = '

';
- $(".batchImg").append(html);
- }
- });
- })
-
-
- $(".oneImg").on("tap", '#shop', function() {
- // UP.init("accountBookImg", "test", "accountBookImgTag")
-
- UP.init("shopImg", "test", "shop")
- openCamera()
- })
- // 删除图片
- $(".batchImg").on('tap', '.delete', function(e) {
-
- e.preventDefault();
- e.stopPropagation()
-
- // //console.log(this);
- var that = $(this)
- //var idx = that.parent().attr('data-id');
- //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1;
- if (confirm('确认删除图片?')) {
- that.parent().remove()
- //delete galleryarr[idx];
- }
- })
- // 提交
- var click = false;
- $('.bc_btn').on('tap', function() {
- if (click == true) {
- return
- }
-
- var imgs = '';
- var data = $('input[name="gallery[]"]');
- // //console.log(data);
- $.each(data, function() {
- if ('' != $(this).val())
- imgs = $(this).val() + ',' + imgs;
-
- })
- imgs = imgs.substring(0, imgs.lastIndexOf(','));
- $('#shopAds').val(imgs);
- if ($.trim($('#shopImg').val()) == '') {
- mui.alert("请上传店铺主图")
- return
- }
- if ($.trim($('#shopAds').val()) == '') {
- mui.alert("请上传店铺图片")
- return
- }
- var params = JZL.getParams(".inp");
- params.shopId = shopId;
- click == true;
- JZL.ajax(qlgUrl('app/shops/uploadShopImg'), params, function(data) {
- if (data.status == 1) {
- mui.toast('保存成功');
- mui.back();
- } else {
- mui.alert(data.msg);
- }
- })
- })
-
-
-
+mui.plusReady(function() {
+ var self = plus.webview.currentWebview();
+ //console.log(self);
+ var shopId = self.id;
+ //获取店铺相册
+ JZL.ajax(qlgUrl('app/shops/getShopImg'), {
+ shopId: shopId
+ }, function(data) {
+ //console.log(data);
+ if (1 == data.status && '' != data.data.shopImg) {
+ $('#shop').attr('src', hyhImgUrl(data.data.shopImg))
+ $('#shopImg').val(data.data.shopImg)
+ if ('' != data.data.shopAds) {
+ var shopAds = data.data.shopAds;
+
+ ads = shopAds.split(",")
+ //console.log(ads);
+ var html = '';
+ mui.each(ads, function(index, element) {
+ //console.log(element);
+ html += '
 + ')
'
+ })
+ var maxNum = ads.length;
+ html += '
';
+ $('.batchImg').html(html)
+
+ }
+
+ } else {
+ mui.alert(data.msg)
+ }
+ })
+
+ $(".batchImg").on("tap", '.galleryImg', function() {
+ var num = $(this).attr('data-id');
+ UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1);
+ var that = $(this);
+ openCamera(function(t, status, fileName, serverName) {
+ var html = '

';
+
+ that.html(html);
+
+ var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1;
+ if (num == maxNum) {
+ maxNum++;
+ html = '

';
+ $(".batchImg").append(html);
+ }
+ });
+ })
+
+
+ $(".oneImg").on("tap", '#shop', function() {
+ // UP.init("accountBookImg", "test", "accountBookImgTag")
+
+ UP.init("shopImg", "test", "shop")
+ openCamera()
+ })
+ // 删除图片
+ $(".batchImg").on('tap', '.delete', function(e) {
+
+ e.preventDefault();
+ e.stopPropagation()
+
+ // //console.log(this);
+ var that = $(this)
+ //var idx = that.parent().attr('data-id');
+ //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1;
+ if (confirm('确认删除图片?')) {
+ that.parent().remove()
+ //delete galleryarr[idx];
+ }
+ })
+ // 提交
+ var click = false;
+ $('.bc_btn').on('tap', function() {
+ if (click == true) {
+ return
+ }
+
+ var imgs = '';
+ var data = $('input[name="gallery[]"]');
+ // //console.log(data);
+ $.each(data, function() {
+ if ('' != $(this).val())
+ imgs = $(this).val() + ',' + imgs;
+
+ })
+ imgs = imgs.substring(0, imgs.lastIndexOf(','));
+ $('#shopAds').val(imgs);
+ if ($.trim($('#shopImg').val()) == '') {
+ mui.alert("请上传店铺主图")
+ return
+ }
+ if ($.trim($('#shopAds').val()) == '') {
+ mui.alert("请上传店铺图片")
+ return
+ }
+ var params = JZL.getParams(".inp");
+ params.shopId = shopId;
+ click == true;
+ JZL.ajax(qlgUrl('app/shops/uploadShopImg'), params, function(data) {
+ if (data.status == 1) {
+ mui.toast('保存成功');
+ mui.back();
+ } else {
+ mui.alert(data.msg);
+ }
+ })
+ })
+
+
+
})
diff --git a/static/app2/js/shop_indent.js b/static/app2/js/shop_indent.js
old mode 100755
new mode 100644
index 6e6a85e..cba2acf
--- a/static/app2/js/shop_indent.js
+++ b/static/app2/js/shop_indent.js
@@ -1,44 +1,44 @@
-mui.init({
- beforeback: function() { //获得父页面的webview
- var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
- mui.fire(list, 'reload');
- //返回true,继续页面关闭逻辑
- return true;
- }
-})
-mui.plusReady(function() {
-
- var self = plus.webview.currentWebview();
- //console.log(self);
- var shopId=self.shopId;
- var data_href = self.data_href;
- if(data_href == 'all') {
- $('.title').html('全部订单');
-
- }
- if(data_href == 'waitPay') {
- $('.title').html('待付款');
- }
- if(data_href == 'waitDeliver') {
- $('.title').html('待发货');
- }
- if(data_href == 'waitReceive') {
- $('.title').html('待收货');
- }
- if(data_href == 'waitConfirm') {
- $('.title').html('待确认');
- }
- if(data_href == 'abnormal') {
- $('.title').html('退款/售后');
- }
- localStorage.setItem('shop_order_class', data_href);
- var bSize = 64 + (+localStorage.getItem('ipxSizeTop')) + 'px';
- var sub = plus.webview.create('shop_indentcon.html', data_href, {
- top: bSize,
- bottom: '0px',
- scrollIndicator: 'none',
-
- },{ shopId:shopId});
- self.append(sub);
-
+mui.init({
+ beforeback: function() { //获得父页面的webview
+ var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
+ mui.fire(list, 'reload');
+ //返回true,继续页面关闭逻辑
+ return true;
+ }
+})
+mui.plusReady(function() {
+
+ var self = plus.webview.currentWebview();
+ //console.log(self);
+ var shopId=self.shopId;
+ var data_href = self.data_href;
+ if(data_href == 'all') {
+ $('.title').html('全部订单');
+
+ }
+ if(data_href == 'waitPay') {
+ $('.title').html('待付款');
+ }
+ if(data_href == 'waitDeliver') {
+ $('.title').html('待发货');
+ }
+ if(data_href == 'waitReceive') {
+ $('.title').html('待收货');
+ }
+ if(data_href == 'waitConfirm') {
+ $('.title').html('待确认');
+ }
+ if(data_href == 'abnormal') {
+ $('.title').html('退款/售后');
+ }
+ localStorage.setItem('shop_order_class', data_href);
+ var bSize = 64 + (+localStorage.getItem('ipxSizeTop')) + 'px';
+ var sub = plus.webview.create('shop_indentcon.html', data_href, {
+ top: bSize,
+ bottom: '0px',
+ scrollIndicator: 'none',
+
+ },{ shopId:shopId});
+ self.append(sub);
+
})
\ No newline at end of file
diff --git a/static/app2/js/shop_indentcon.js b/static/app2/js/shop_indentcon.js
old mode 100755
new mode 100644
index eeafb1e..393abff
--- a/static/app2/js/shop_indentcon.js
+++ b/static/app2/js/shop_indentcon.js
@@ -1,831 +1,831 @@
-$('#content').after('
');
-var pay_name = 0;
-var token = localStorage.getItem('token');
-var order_class = localStorage.getItem('shop_order_class');
-var orderNo;
-var orderId;
-var getReasonUrl = '';
-var priceT = 0;
-var payCode = '';
-var shopId = '';
-var wxChannel = null; // 微信支付
-var aliChannel = null; // 支付宝支付
-var channel = null; //支付通道
-mui.init({
- pullRefresh: {
- container: '#pullrefresh',
- down: {
- style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式
- color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色
- height: '50px', //可选,默认50px.下拉刷新控件的高度,
- range: '100px', //可选 默认100px,控件可下拉拖拽的范围
- offset: '0px', //可选 默认0px,下拉刷新控件的起始位置
- // auto: true, //可选,默认false.首次加载自动上拉刷新一次
- contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容
- contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容
- contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容
- contentnomore: '没有更多数据了',
- callback: pulldownRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据;
- },
- up: {
- contentrefresh: '正在加载...',
- callback: pullupRefresh
- },
- beforeback: function() { //获得父页面的webview
- var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
- mui.fire(list, 'reload');
- //返回true,继续页面关闭逻辑
- return true;
- }
- }
-});
-var count = 1;
-
-function pullupRefresh() {
- count += 1;
- getData(count);
- mui('#pullrefresh').pullRefresh().endPullupToRefresh();
-}
-// //console.log(order_class);
-/**
- * 下拉刷新具体业务实现
- */
-function pulldownRefresh() {
- setTimeout(function() {
- window.location.reload();
- //mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed
- }, 1500);
-}
-var isLoad = false;
-
-function getData(page) {
- if (true == isLoad) return;
- isLoad = true;
- JZL.ajax(qlgUrl('app/Shoporders/getSellerOrderList'), {
- type: order_class,
- shopId: shopId,
- page: page,
- pagesize: 10
- }, function(data) {
- //console.log(data);
- var data = toJson(data);
- var html = '',
- html1 = "";
- if (1 == data.status) {
- // console.log(data);
- if ('' == data.data.Rows) {
- mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
- return;
- }
- $.each(data.data.Rows, function() {
- //this.pay_name = 1;
- var shopConfirmHtml = '';
- // console.log(this.orderStatus);
- // if ( == 0) {
- // if (0 == this.shopConfirm) {
- // shopConfirmHtml = '
待商家确认
';
- // } else if (1 == this.shopConfirm) {
- // shopConfirmHtml = '
商家已确认
';
- // }else if (2 == this.shopConfirm) {
- // shopConfirmHtml = '
商家未收款
';
- // }
- // }
- // html += '
' + this.shopName +
- // '
' +
- // this.status + '
' + shopConfirmHtml + '
'
- html += '
订单编号:' + this.orderNo +
- '
' + this.createTime +
- '
'
- $.each(this.list, function() {
- html += '
 +
- ')
' + this.goodsName +
- '
' + this.goodsSpecNames + '
¥' + this.goodsPrice +
- '
x' + this.goodsNum +
- '优惠优惠:0.52优惠:0.52
'
- // html += '
 +
- // ')
' + this.goodsName + '
' + this.goodsSpecNames +
- // '
¥' + this.goodsPrice + '
¥' + this.marketPrice + 'x' +
- // this.goodsNum + '';
- })
-
- html +=
- '
买家信息
共' +
- this.list.length + '件商品 合计:¥' + this.realTotalMoney + '(含运费¥0.00)
'
- html +=
- '
地址:
' +
- this.userAddress +
- '
电话:
' +
- this.userPhone + '
' + this.userName + '
'
- // html += '
共' + this.list.length + '件商品 合计:¥' + this.realTotalMoney +
- // '(含运费¥' + this.deliverMoney + ')
';
- if (this.orderStatus == -2) { //未付款
- html += '
'
- // html += '
立即付款
取消订单
';
- } else if (this.orderStatus == -1) {
- if (1 == this.isPay) {
- if (1 == this.isRefund) {
- //yituikuan
- // html += '
'
- html +=
- '
'
- } else {
- //tuikuancaozuoanniu
- // html += '
'
- html +=
- '
'
-
- }
- } else {
- html += '
'
- } //0 daiqueren 1 queren 2 jujue
- } else if (this.orderStatus == 0) {
- if (1 == this.shopConfirm) {
- html += '
'
- } else if (0 == this.shopConfirm) {
- html += '
'
- } else if (2 == this.shopConfirm) {
- html +=
- '
'
-
- }
-
- // html +='
'
- //html +=
- // '
'
- } else if (this.orderStatus == 1) {
- html += '
'
- } else if (this.orderStatus == 2) {
- html +=
- '
'
- } else if (this.orderStatus == -3) {
- // html += '
'
- if (1 == this.isPay) {
- if (1 == this.isRefund) {
- //yituikuan
- html +=
- '
'
-
- } else {
- //tuikuancaozuoanniu
- // html += '
'
- html +=
- '
'
- }
- }
- }
-
- // if(-1 == this.orderStatus || -3 ==this.orderStatus){
- // if(1 == this.isPay){
- // if(1 == this.isRefund){
- // //yituikuan
- // html += '
'
- //
- // }else{
- // //tuikuancaozuoanniu
- // html += '
'
- //
- // }
- // }
- // }
- html1 = '
产品券:' + this.productNum + '优惠券:' + this.couponsNum + '旺旺券:' +
- this.wangNum + '';
- html += ''
- })
-
- $('.con').append(html);
- $(".rcb").html(html1)
- } else {
- mui.alert(data.msg)
- }
- isLoad = false;
- })
-}
-mui.plusReady(function() {
- var self = plus.webview.currentWebview();
- // //console.log(self);
- shopId = self.shopId;
- getData(count);
- // window.addEventListener('refresh', function(e) { //执行刷新
- // location.reload();
- // });
- // //console.log(order_class)
- if (order_class == 'all') {
- order_class = '';
-
- }
- // 已付款 店家确认收款
- $('.con').on('tap', '.qrsk', function() {
- orderId = $(this).parent().parent().attr('data-id');
- $('.bg').css('display', 'block')
- $('#querenshoukuan').css('display', 'block')
- })
- $('#querenshoukuan').on('tap', '.pay_btn', function() {
- // orderId = $(this).parent().parent().attr('data-id');
- var confirmType = $('#querenshoukuan input[type="radio"]:checked').val();
- //console.log(confirmType,orderId,shopId);
- JZL.ajax(qlgUrl('app/Shoporders/orderConfirm'), {
- confirmType: confirmType,
- shopId: shopId,
- id: orderId
- }, function(data) {
- // console.log(data);
- if (1 == data.status) {
- $('.bg').css('display', 'none')
- $('#querenshoukuan').css('display', 'none')
- var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
- mui.fire(list, 'refresh');
- location.reload()
-
- // mui.back();
- } else {
- mui.alert(data.msg)
- }
- })
- })
- // 店家确认退款
- var content = "";
- $('.con').on('tap', '.qrtk', function() {
- orderId = $(this).parent().parent().attr('data-id');
- $('.bg').css('display', 'block')
- $('#querentuikuan').css('display', 'block')
- })
- $('#querentuikuan').on('tap', '.pay_btn', function() {
- // orderId = $(this).parent().parent().attr('data-id');
- var confirmType = $('#querentuikuan input[type="radio"]:checked').val();
- content = $("#refuse_con").val()
- // console.log(confirmType, orderId, shopId, content, $("#refuse_con"));
- if (-1 == confirmType) {
- if ('' == $.trim($("#refuse_con").val())) {
- mui.alert("请输入拒绝原因")
- return
- } else {}
- }
- JZL.ajax(qlgUrl('app/Shoporders/shopRefund'), {
- refundStatus: confirmType,
- content: content,
- shopId: shopId,
- id: orderId
- }, function(data) {
- //console.log(data);
- if (1 == data.status) {
- $('.bg').css('display', 'none')
- $('#querentuikuan').css('display', 'none')
- // location.reload();
- var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
- mui.fire(list, 'refresh');
- location.reload()
- // mui.back();
- } else {
- mui.alert(data.msg)
- }
-
- })
- })
- // 已付款 店家发货
- $('.con').on('tap', '.qrfh', function() {
- orderId = $(this).parent().parent().attr("data-id")
- $('.bg').show();
- $('.delivery').show();
- JZL.ajax(qlgUrl('app/Orders/getExpress'), {}, function(data) {
- // //console.log(data);
- if (data.status == 1) {
- // html = '';
- var html = '
'
- mui.each(data.data, function(index, element) {
- html += '
'
- })
- $('#expressId').append(html)
- } else {
- mui.alert(data.msg)
- }
- })
-
- })
- // 选择快递公司名称
-
-
-
- //确认发货
- $('.delivery').on('tap', '.pay_btn', function() {
- if (0 == $('#expressId option:selected').val()) {
- mui.alert('请选择快递公司名称')
- return;
- }
- if ('' == $('#expressNo').val()) {
- mui.alert('请输入快递单号')
- return;
- }
- var pargams = {}
- pargams.expressNo = $('#expressNo').val();
- pargams.expressId = $('#expressId').val();
- pargams.id = orderId;
- pargams.shopId = shopId;
- JZL.ajax(qlgUrl('app/ShopOrders/deliver'), pargams, function(data) {
- // console.log(data);
- if (1 == data.status) {
- // var data = data.data;
- mui.toast(data.msg)
- $('.delivery').css('display', 'none')
- $('.bg').css('display', 'none')
- var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
- mui.fire(list, 'refresh');
- location.reload()
-
- } else {
- mui.alert(data.msg)
- }
-
- })
- })
- // 返回
- $('.bg').on('tap', '.mui-icon-left-nav', function() {
- // $('.pay').css('display', 'block');
- $('.bg').css('display', 'none');
- $('.pay_way').css('display', 'none');
- })
- //提交凭证
- $('.con').on('tap', '.tjpz', function() {
- var orderId = $(this).parent().parent().attr("data-id")
- JZL.openWindow('shoperUploadVoucher.html', 'shoperUploadVoucher.html', {
- orderIds: orderId,
- shopId: shopId,
- });
- })
-
- // 关闭
- $('.bg').on('tap', '.mui-icon-closeempty', function() {
- $('.bg').css('display', 'none');
- // $(".pay").slideUp(300, function() {
- //
- // });
- })
- //
-
- // $('#pay_way').on('tap', '.row', function() {
- // $('#pay_way .row .mui-icon').removeClass('mui-icon-checkmarkempty');
- // $(this).children('.mui-icon').addClass('mui-icon-checkmarkempty');
- // $('.con_1 .on .row_right o').html($(this).children('.row_left').html());
- // $('.con_1 .on').attr('data-payCode', $(this).attr('data-payCode'))
- // $('.pay').css('display', 'block');
- // $('#pay_way').css('display', 'none');
- //
- // })
- // $('.pay').on('tap', '.con_1 .on', function() {
- // if ($(this).attr('data-payCode') == 'ect') {
- //
- // } else {
- // $('.pay').css('display', 'none');
- // $('#pay_way').css('display', 'block');
- // }
- //
- // })
- // $('.pay_btn').on('tap', function() {
- // payCode = $('.con_1 .on').attr('data-payCode');
- // ////console.log(payCode)
- // var that = $(this);
- // var data_ljfk = {
- // isBatch: 0,
- // orderNo: orderNo
- // }
- // that.attr('disabled', 'disabled');
- // mui.ajax(hyhUrl('app/orders/succeed'), {
- // data: data_ljfk,
- // dataType: 'json', //服务器返回json格式数据
- // type: 'post', //HTTP请求类型
- // timeout: 10000, //超时时间设置为10秒;
- // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // data = toJson(data);
- //
- // if (data.status == 1) {
- // if (payCode == 'qlgpay') {
- // JZL.ajax(hyhUrl('app/' + payCode + '/payment'), {
- // orderNo: orderNo,
- // isBatch: 0
- // }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // // //console.log(JSON.stringify(data));
- // var data = toJson(data);
- // // //console.log(JSON.stringify(data))
- // if (data.status == 1) {
- // $('.pay').css('display', 'none');
- // $('#qlg_pay_pwd').css('display', 'block');
- // if (data.data.payPwd == '0') {
- // mui.alert('还未设置支付密码请先设置操作密码!');
- // var url = 'setting_fogetPayPwd';
- // JZL.openWindow(url + '.html', url + '.html');
- // //return;
- // }
- // $('#totalMoney').html('付款总额:¥
' + data.data.needPay + '');
- // $('#productNum').val(data.data.product.useProduct);
- // if (data.data.product.useProduct > 0) {
- // var html1 = '
抵扣额' + data.data.product.useProductOk +
- // '
扣税 ' + data.data.product.useProductTaxFee +
- // '
手续费 ' + data.data.product.useProductHandlingFee +
- // '
';
- // // $('#productInfo').html('产品券[抵扣额:' + data.data.product.useProductOk + ',扣税:' + data.data.product.useProductTaxFee +
- // // ',手续费:' + data.data.product.useProductHandlingFee + ']');
- // $('.productInfo_').html(html1)
- //
- // }
- // $('#couponsNum').val(data.data.coupons.useCoupons);
- // if (data.data.coupons.useCoupons > 0) {
- // var html2 = '
抵扣额' + data.data.coupons.useCouponsOk +
- // '
扣税 ' + data.data.coupons.useCouponsTaxFee +
- // '
手续费 ' + data.data.coupons.useCouponsHandlingFee +
- // '
';
- // $('.couponsInfo_').html(html2)
- // // $('#couponsInfo').html('优惠券[抵扣额:' + data.data.coupons.useCouponsOk + ',扣税:' + data.data.coupons.useCouponsTaxFee +
- // // ',手续费:' + data.data.coupons.useCouponsHandlingFee + ']');
- // }
- // $('#wangNum').val(data.data.wang.useWang);
- // $('#moneyNum').val(data.data.money.useMoney);
- //
- // } else {
- // mui.alert(data.msg)
- // }
- // });
- // } else if (payCode == 'wallets' || payCode == 'ect') {
- // //跳输入密码的页面
- // mui.ajax(hyhUrl('app/' + payCode + '/payment'), {
- // data: {
- // orderNo: orderNo,
- // isBatch: 0
- // },
- // dataType: 'json', //服务器返回json格式数据
- // type: 'post', //HTTP请求类型
- // timeout: 10000, //超时时间设置为10秒;
- // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // // //console.log(data.data.goodsFavoritesNum)
- // var data = toJson(data);
- // if (data.status == 1) {
- // $('.pay').css('display', 'none');
- // $('#pay_pwd').css('display', 'block');
- // if (data.data.payPwd == '0') {
- // mui.alert('还未设置支付密码请先设置支付密码!');
- // var url = 'setting_fogetPayPwd';
- // mui.openWindow({
- // url: url + '.html',
- // id: url + '.html',
- // styles: {
- // top: '0px', //新页面顶部位置
- // bottom: '0px', //新页面底部位置
- // width: '100%', //新页面宽度,默认为100%
- // height: '100%' //新页面高度,默认为100%
- // },
- // extras: {
- // // data_href: data_href
- // // ..... //自定义扩展参数,可以用来处理页面间传值
- // },
- // createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- // show: {
- // // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // // extras: {} //窗口动画是否使用图片加速
- // },
- // waiting: {
- // autoShow: true, //自动显示等待框,默认为true
- // title: '正在加载...', //等待对话框上显示的提示内容
- // options: {
- // // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // // ......
- // }
- // }
- // })
- // }
- // }
- // },
- // error: function(xhr, type, errorThrown) { //异常处理;
- // // mui.alert(type);
- // }
- // });
- //
- // } else if (payCode == 'alipays') {
- // pay('alipay', orderNo);
- // // plus.nativeUI.showWaiting();
- // // mui.post(hyhUrl('app/Alipays/payment'), {
- // // orderNo: data.data,
- // // isBatch: 1
- // // var ALIPAYSERVER = hyhUrl('app/Alipays/payment?orderNo=' + data.data + '&isBatch=1');
- //
- // }
- //
- // that.removeAttr('disabled');
- // } else {
- // mui.alert('发生错误请刷新后重试!');
- // // location.reload();
- // }
- // },
- // error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- // }
- // })
- // })
- // $('#pay_pwd,#qlg_pay_pwd').on('tap', '.p9', function() {
- // var url = 'setting_fogetPayPwd';
- // JZL.openWindow(url + '.html', url + '.html');
- // })
- // $('#pay_pwd,#qlg_pay_pwd').on('tap', '.pay_btn_pwd', function() {
- // // var self = plus.webview.currentWebview();
- // // var data_href = self.id;
- // // //console.log(data_href)
- // // JZL.closeWindow('waitPay');
- // //return;
- // var payPwd = $('#payPwd').val();
- // if (payPwd == '') {
- // mui.alert('支付密码不能为空!');
- // return;
- // }
- // var that = $(this);
- // that.attr('disabled', 'disabled')
- // var srcc = ''
- // if (payCode == 'qlgpay') {
- // srcc = 'payByQlg';
- // } else if (payCode == 'ect') {
- // srcc = 'payByEct';
- // } else {
- // srcc = 'payByWallet';
- // }
- //
- // mui.ajax(hyhUrl('app/' + payCode + '/' + srcc), {
- //
- // data: {
- // orderNo: orderNo,
- // isBatch: 0,
- // payPwd: payPwd
- // },
- // dataType: 'json', //服务器返回json格式数据
- // type: 'post', //HTTP请求类型
- // timeout: 10000, //超时时间设置为10秒;
- // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // // //console.log(data.data.goodsFavoritesNum)
- // var data = toJson(data);
- // mui.alert(data.msg)
- // //console.log(data.status)
- // if (data.status == 1) {
- // JZL.openWindow('indent.html', 'waitDeliver', {
- // data_href: 'waitDeliver'
- // });
- // setTimeout(function() {
- // JZL.closeWindow(plus.webview.currentWebview().id);
- // // JZL.closeWindow('indent.html');
- // }, 700)
- // // var targetTab = plus.webview.getWebviewById("templete/my.html");
- // // mui.fire(targetTab, 'refresh');
- // // location.reload();
- // } else {
- //
- // }
- // that.removeAttr('disabled')
- //
- // },
- // error: function(xhr, type, errorThrown) { //异常处理;
- // // mui.alert(type);
- // }
- // });
- //
- // })
-
- mui('.con').on('tap', '.row_con', function() {
- var data_order_id = $(this).attr('data-id');
- mui.openWindow({
- url: 'order_out.html',
- id: 'order_out.html',
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- data_order_id: data_order_id
- // data_id: data_id
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
- })
- mui('.con').on('tap', '.ckwl', function() {
- var data_order_id = $(this).parent().parent().attr('data-id'); //$(this).attr('data-id');
- JZL.openWindow('logistics.html', 'logistics.html', {
- data_order_id: data_order_id
- });
- })
- //上传凭证
- mui('.con').on('tap', '.uploadCertificate', function() {
- var orderId = $(this).parent().parent().attr('data-id');
- // mui.alert('跳到上传凭证页' + orderId)
- JZL.openWindow("uploadVoucher.html", "uploadVoucher.html", {
- orderId: orderId
- })
- })
- $('.con').on('tap', '.qxdd_js', function() {
- orderNo = $(this).parent().parent().attr('data-orderNo');
- orderId = $(this).parent().parent().attr('data-id');
- if ($(this).html() == '取消订单') {
- getReasonUrl = 'getCancelCause';
- } else if ($(this).html() == '拒收') {
- getReasonUrl = 'getRejectCause';
- } else if ($(this).html() == '申请退款') {
- getReasonUrl = 'getRefundCause';
- JZL.ajax(hyhUrl('/app/Orders/getRefund'), {
- id: orderId
- }, function(data) { //服务器返回响应
- // //console.log(JSON.stringify(data));
- var data = toJson(data);
- if (data.status == 1) {
- data = data.data;
- var html = '';
- if ('qlgpay' == data.payFrom) {
- html = ' 退款产品券数量:
' +
- ' 退款优惠券数量:
' +
- ' 退款旺旺券数量:
' +
- ' 退款现金数量:' + data.moneyNum + ',现金方面请与商家协商' +
- // '
(金额不能超过¥' + data.realTotalMoney +
- ')
';
- } else {
- html = '
(金额不能超过¥' + data.realTotalMoney +
- ')
(积分数量:' + data.ectNum + ')
';
- }
-
- $('.tui').html(html)
- } else {
- mui.alert(data.msg)
- }
- });
- }
- $('.bg_').css('display', 'block');
- $('.bg_con').css('display', 'none');
- $('.bg_con').slideDown(300, function() {});
- mui.ajax(hyhUrl('/app/Orders/' + getReasonUrl), {
- data: {},
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // //console.log(data.data.goodsFavoritesNum)
- // //console.log(data.data.Rows)
- var data = toJson(data);
- if (data.status == 1) {
- var html = '
';
- $.each(data.data, function() {
- html += '
'
- });
- $('#select').html(html)
- } else {
- mui.alert(data.msg)
- }
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- })
-
- $('.bg_').on('tap', '.en_false', function() {
- $('.bg_').css('display', 'none');
-
- })
- $('.bg_').on('tap', '.en_true', function() {
- var setReasonUrl = '';
- var content = $('#content').val();
- var reason = $('#select').val();
- if ($('#select').val() == 0) {
- mui.alert('请选择原因!');
- return;
- }
- if ($('#select').val() == 10000 && content == '') {
- mui.alert('请输入其他原因!');
- return;
- }
- if (getReasonUrl == 'getCancelCause') {
- setReasonUrl = 'cancellation';
- mui.ajax(qlgUrl('app/Orders/' + setReasonUrl), {
- data: {
- reason: reason,
- id: orderId,
- content: content
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // //console.log(data.data.goodsFavoritesNum)
- // //console.log(data.data.Rows)
- var data = toJson(data);
- mui.alert(data.msg);
- if (data.status == 1) {
- // var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
- // mui.fire(list, 'refresh');
- if ('waitPay' == plus.webview.currentWebview().id) {
- location.reload();
- } else {
- JZL.openWindow('indent.html', 'abnormal', {
- data_href: 'abnormal'
- });
- setTimeout(function() {
- //plus.webview.currentWebview().close();
- JZL.closeWindow(plus.webview.currentWebview().id);
- }, 500)
- }
- // JZL.openWindow('indent.html', 'abnormal', {
- // data_href: 'abnormal'
- // });
- // setTimeout(function() {
- // plus.webview.currentWebview().close();
- // // JZL.closeWindow(plus.webview.currentWebview().id);
- // }, 500)
- //location.reload();
-
- }
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- } else if (getReasonUrl == 'getRejectCause') {
- setReasonUrl = 'reject';
- mui.ajax(hyhUrl('app/Orders/' + setReasonUrl), {
- data: {
- reason: reason,
- id: orderId,
- content: content
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // //console.log(data.data.goodsFavoritesNum)
- // //console.log(data.data.Rows)
- var data = toJson(data);
- mui.alert(data.msg);
- if (data.status == 1) {
- // var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
- // mui.fire(list, 'refresh');
- location.reload();
-
- }
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- } else if (getReasonUrl == 'getRefundCause') {
- var params = {}
- // params.money = $('#Tmoney').val();
- // if (params.money < 0 || params.money == 0) {
- // mui.alert('退款金额不能为0!');
- // return;
- // }
- params.productNum = $('#productNum').val();
- params.couponsNum = $('#couponsNum').val();
- params.wangNum = $('#wangNum').val();
- params.reason = reason;
- params.id = orderId;
- params.content = content;
- JZL.ajax(hyhUrl('app/Orderrefunds/refund'), params, function(data) {
- var data = toJson(data);
- mui.alert(data.msg);
- if (data.status == 1) {
- var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
- mui.fire(list, 'refresh');
- location.reload();
- }
- })
- }
- })
- $('#select').on('change', function() {
- if ($(this).val() == '10000') {
- $('#content').css('display', 'block');
- } else {
- $('#content').css('display', 'none');
- }
- })
+$('#content').after('
');
+var pay_name = 0;
+var token = localStorage.getItem('token');
+var order_class = localStorage.getItem('shop_order_class');
+var orderNo;
+var orderId;
+var getReasonUrl = '';
+var priceT = 0;
+var payCode = '';
+var shopId = '';
+var wxChannel = null; // 微信支付
+var aliChannel = null; // 支付宝支付
+var channel = null; //支付通道
+mui.init({
+ pullRefresh: {
+ container: '#pullrefresh',
+ down: {
+ style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式
+ color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色
+ height: '50px', //可选,默认50px.下拉刷新控件的高度,
+ range: '100px', //可选 默认100px,控件可下拉拖拽的范围
+ offset: '0px', //可选 默认0px,下拉刷新控件的起始位置
+ // auto: true, //可选,默认false.首次加载自动上拉刷新一次
+ contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容
+ contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容
+ contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容
+ contentnomore: '没有更多数据了',
+ callback: pulldownRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据;
+ },
+ up: {
+ contentrefresh: '正在加载...',
+ callback: pullupRefresh
+ },
+ beforeback: function() { //获得父页面的webview
+ var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
+ mui.fire(list, 'reload');
+ //返回true,继续页面关闭逻辑
+ return true;
+ }
+ }
+});
+var count = 1;
+
+function pullupRefresh() {
+ count += 1;
+ getData(count);
+ mui('#pullrefresh').pullRefresh().endPullupToRefresh();
+}
+// //console.log(order_class);
+/**
+ * 下拉刷新具体业务实现
+ */
+function pulldownRefresh() {
+ setTimeout(function() {
+ window.location.reload();
+ //mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed
+ }, 1500);
+}
+var isLoad = false;
+
+function getData(page) {
+ if (true == isLoad) return;
+ isLoad = true;
+ JZL.ajax(qlgUrl('app/Shoporders/getSellerOrderList'), {
+ type: order_class,
+ shopId: shopId,
+ page: page,
+ pagesize: 10
+ }, function(data) {
+ //console.log(data);
+ var data = toJson(data);
+ var html = '',
+ html1 = "";
+ if (1 == data.status) {
+ // console.log(data);
+ if ('' == data.data.Rows) {
+ mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
+ return;
+ }
+ $.each(data.data.Rows, function() {
+ //this.pay_name = 1;
+ var shopConfirmHtml = '';
+ // console.log(this.orderStatus);
+ // if ( == 0) {
+ // if (0 == this.shopConfirm) {
+ // shopConfirmHtml = '
待商家确认
';
+ // } else if (1 == this.shopConfirm) {
+ // shopConfirmHtml = '
商家已确认
';
+ // }else if (2 == this.shopConfirm) {
+ // shopConfirmHtml = '
商家未收款
';
+ // }
+ // }
+ // html += '
' + this.shopName +
+ // '
' +
+ // this.status + '
' + shopConfirmHtml + '
'
+ html += '
订单编号:' + this.orderNo +
+ '
' + this.createTime +
+ '
'
+ $.each(this.list, function() {
+ html += '
 +
+ ')
' + this.goodsName +
+ '
' + this.goodsSpecNames + '
¥' + this.goodsPrice +
+ '
x' + this.goodsNum +
+ '优惠优惠:0.52优惠:0.52
'
+ // html += '
 +
+ // ')
' + this.goodsName + '
' + this.goodsSpecNames +
+ // '
¥' + this.goodsPrice + '
¥' + this.marketPrice + 'x' +
+ // this.goodsNum + '';
+ })
+
+ html +=
+ '
买家信息
共' +
+ this.list.length + '件商品 合计:¥' + this.realTotalMoney + '(含运费¥0.00)
'
+ html +=
+ '
地址:
' +
+ this.userAddress +
+ '
电话:
' +
+ this.userPhone + '
' + this.userName + '
'
+ // html += '
共' + this.list.length + '件商品 合计:¥' + this.realTotalMoney +
+ // '(含运费¥' + this.deliverMoney + ')
';
+ if (this.orderStatus == -2) { //未付款
+ html += '
'
+ // html += '
立即付款
取消订单
';
+ } else if (this.orderStatus == -1) {
+ if (1 == this.isPay) {
+ if (1 == this.isRefund) {
+ //yituikuan
+ // html += '
'
+ html +=
+ '
'
+ } else {
+ //tuikuancaozuoanniu
+ // html += '
'
+ html +=
+ '
'
+
+ }
+ } else {
+ html += '
'
+ } //0 daiqueren 1 queren 2 jujue
+ } else if (this.orderStatus == 0) {
+ if (1 == this.shopConfirm) {
+ html += '
'
+ } else if (0 == this.shopConfirm) {
+ html += '
'
+ } else if (2 == this.shopConfirm) {
+ html +=
+ '
'
+
+ }
+
+ // html +='
'
+ //html +=
+ // '
'
+ } else if (this.orderStatus == 1) {
+ html += '
'
+ } else if (this.orderStatus == 2) {
+ html +=
+ '
'
+ } else if (this.orderStatus == -3) {
+ // html += '
'
+ if (1 == this.isPay) {
+ if (1 == this.isRefund) {
+ //yituikuan
+ html +=
+ '
'
+
+ } else {
+ //tuikuancaozuoanniu
+ // html += '
'
+ html +=
+ '
'
+ }
+ }
+ }
+
+ // if(-1 == this.orderStatus || -3 ==this.orderStatus){
+ // if(1 == this.isPay){
+ // if(1 == this.isRefund){
+ // //yituikuan
+ // html += '
'
+ //
+ // }else{
+ // //tuikuancaozuoanniu
+ // html += '
'
+ //
+ // }
+ // }
+ // }
+ html1 = '
产品券:' + this.productNum + '优惠券:' + this.couponsNum + '旺旺券:' +
+ this.wangNum + '';
+ html += ''
+ })
+
+ $('.con').append(html);
+ $(".rcb").html(html1)
+ } else {
+ mui.alert(data.msg)
+ }
+ isLoad = false;
+ })
+}
+mui.plusReady(function() {
+ var self = plus.webview.currentWebview();
+ // //console.log(self);
+ shopId = self.shopId;
+ getData(count);
+ // window.addEventListener('refresh', function(e) { //执行刷新
+ // location.reload();
+ // });
+ // //console.log(order_class)
+ if (order_class == 'all') {
+ order_class = '';
+
+ }
+ // 已付款 店家确认收款
+ $('.con').on('tap', '.qrsk', function() {
+ orderId = $(this).parent().parent().attr('data-id');
+ $('.bg').css('display', 'block')
+ $('#querenshoukuan').css('display', 'block')
+ })
+ $('#querenshoukuan').on('tap', '.pay_btn', function() {
+ // orderId = $(this).parent().parent().attr('data-id');
+ var confirmType = $('#querenshoukuan input[type="radio"]:checked').val();
+ //console.log(confirmType,orderId,shopId);
+ JZL.ajax(qlgUrl('app/Shoporders/orderConfirm'), {
+ confirmType: confirmType,
+ shopId: shopId,
+ id: orderId
+ }, function(data) {
+ // console.log(data);
+ if (1 == data.status) {
+ $('.bg').css('display', 'none')
+ $('#querenshoukuan').css('display', 'none')
+ var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
+ mui.fire(list, 'refresh');
+ location.reload()
+
+ // mui.back();
+ } else {
+ mui.alert(data.msg)
+ }
+ })
+ })
+ // 店家确认退款
+ var content = "";
+ $('.con').on('tap', '.qrtk', function() {
+ orderId = $(this).parent().parent().attr('data-id');
+ $('.bg').css('display', 'block')
+ $('#querentuikuan').css('display', 'block')
+ })
+ $('#querentuikuan').on('tap', '.pay_btn', function() {
+ // orderId = $(this).parent().parent().attr('data-id');
+ var confirmType = $('#querentuikuan input[type="radio"]:checked').val();
+ content = $("#refuse_con").val()
+ // console.log(confirmType, orderId, shopId, content, $("#refuse_con"));
+ if (-1 == confirmType) {
+ if ('' == $.trim($("#refuse_con").val())) {
+ mui.alert("请输入拒绝原因")
+ return
+ } else {}
+ }
+ JZL.ajax(qlgUrl('app/Shoporders/shopRefund'), {
+ refundStatus: confirmType,
+ content: content,
+ shopId: shopId,
+ id: orderId
+ }, function(data) {
+ //console.log(data);
+ if (1 == data.status) {
+ $('.bg').css('display', 'none')
+ $('#querentuikuan').css('display', 'none')
+ // location.reload();
+ var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
+ mui.fire(list, 'refresh');
+ location.reload()
+ // mui.back();
+ } else {
+ mui.alert(data.msg)
+ }
+
+ })
+ })
+ // 已付款 店家发货
+ $('.con').on('tap', '.qrfh', function() {
+ orderId = $(this).parent().parent().attr("data-id")
+ $('.bg').show();
+ $('.delivery').show();
+ JZL.ajax(qlgUrl('app/Orders/getExpress'), {}, function(data) {
+ // //console.log(data);
+ if (data.status == 1) {
+ // html = '';
+ var html = '
'
+ mui.each(data.data, function(index, element) {
+ html += '
'
+ })
+ $('#expressId').append(html)
+ } else {
+ mui.alert(data.msg)
+ }
+ })
+
+ })
+ // 选择快递公司名称
+
+
+
+ //确认发货
+ $('.delivery').on('tap', '.pay_btn', function() {
+ if (0 == $('#expressId option:selected').val()) {
+ mui.alert('请选择快递公司名称')
+ return;
+ }
+ if ('' == $('#expressNo').val()) {
+ mui.alert('请输入快递单号')
+ return;
+ }
+ var pargams = {}
+ pargams.expressNo = $('#expressNo').val();
+ pargams.expressId = $('#expressId').val();
+ pargams.id = orderId;
+ pargams.shopId = shopId;
+ JZL.ajax(qlgUrl('app/ShopOrders/deliver'), pargams, function(data) {
+ // console.log(data);
+ if (1 == data.status) {
+ // var data = data.data;
+ mui.toast(data.msg)
+ $('.delivery').css('display', 'none')
+ $('.bg').css('display', 'none')
+ var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
+ mui.fire(list, 'refresh');
+ location.reload()
+
+ } else {
+ mui.alert(data.msg)
+ }
+
+ })
+ })
+ // 返回
+ $('.bg').on('tap', '.mui-icon-left-nav', function() {
+ // $('.pay').css('display', 'block');
+ $('.bg').css('display', 'none');
+ $('.pay_way').css('display', 'none');
+ })
+ //提交凭证
+ $('.con').on('tap', '.tjpz', function() {
+ var orderId = $(this).parent().parent().attr("data-id")
+ JZL.openWindow('shoperUploadVoucher.html', 'shoperUploadVoucher.html', {
+ orderIds: orderId,
+ shopId: shopId,
+ });
+ })
+
+ // 关闭
+ $('.bg').on('tap', '.mui-icon-closeempty', function() {
+ $('.bg').css('display', 'none');
+ // $(".pay").slideUp(300, function() {
+ //
+ // });
+ })
+ //
+
+ // $('#pay_way').on('tap', '.row', function() {
+ // $('#pay_way .row .mui-icon').removeClass('mui-icon-checkmarkempty');
+ // $(this).children('.mui-icon').addClass('mui-icon-checkmarkempty');
+ // $('.con_1 .on .row_right o').html($(this).children('.row_left').html());
+ // $('.con_1 .on').attr('data-payCode', $(this).attr('data-payCode'))
+ // $('.pay').css('display', 'block');
+ // $('#pay_way').css('display', 'none');
+ //
+ // })
+ // $('.pay').on('tap', '.con_1 .on', function() {
+ // if ($(this).attr('data-payCode') == 'ect') {
+ //
+ // } else {
+ // $('.pay').css('display', 'none');
+ // $('#pay_way').css('display', 'block');
+ // }
+ //
+ // })
+ // $('.pay_btn').on('tap', function() {
+ // payCode = $('.con_1 .on').attr('data-payCode');
+ // ////console.log(payCode)
+ // var that = $(this);
+ // var data_ljfk = {
+ // isBatch: 0,
+ // orderNo: orderNo
+ // }
+ // that.attr('disabled', 'disabled');
+ // mui.ajax(hyhUrl('app/orders/succeed'), {
+ // data: data_ljfk,
+ // dataType: 'json', //服务器返回json格式数据
+ // type: 'post', //HTTP请求类型
+ // timeout: 10000, //超时时间设置为10秒;
+ // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // data = toJson(data);
+ //
+ // if (data.status == 1) {
+ // if (payCode == 'qlgpay') {
+ // JZL.ajax(hyhUrl('app/' + payCode + '/payment'), {
+ // orderNo: orderNo,
+ // isBatch: 0
+ // }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // // //console.log(JSON.stringify(data));
+ // var data = toJson(data);
+ // // //console.log(JSON.stringify(data))
+ // if (data.status == 1) {
+ // $('.pay').css('display', 'none');
+ // $('#qlg_pay_pwd').css('display', 'block');
+ // if (data.data.payPwd == '0') {
+ // mui.alert('还未设置支付密码请先设置操作密码!');
+ // var url = 'setting_fogetPayPwd';
+ // JZL.openWindow(url + '.html', url + '.html');
+ // //return;
+ // }
+ // $('#totalMoney').html('付款总额:¥
' + data.data.needPay + '');
+ // $('#productNum').val(data.data.product.useProduct);
+ // if (data.data.product.useProduct > 0) {
+ // var html1 = '
抵扣额' + data.data.product.useProductOk +
+ // '
扣税 ' + data.data.product.useProductTaxFee +
+ // '
手续费 ' + data.data.product.useProductHandlingFee +
+ // '
';
+ // // $('#productInfo').html('产品券[抵扣额:' + data.data.product.useProductOk + ',扣税:' + data.data.product.useProductTaxFee +
+ // // ',手续费:' + data.data.product.useProductHandlingFee + ']');
+ // $('.productInfo_').html(html1)
+ //
+ // }
+ // $('#couponsNum').val(data.data.coupons.useCoupons);
+ // if (data.data.coupons.useCoupons > 0) {
+ // var html2 = '
抵扣额' + data.data.coupons.useCouponsOk +
+ // '
扣税 ' + data.data.coupons.useCouponsTaxFee +
+ // '
手续费 ' + data.data.coupons.useCouponsHandlingFee +
+ // '
';
+ // $('.couponsInfo_').html(html2)
+ // // $('#couponsInfo').html('优惠券[抵扣额:' + data.data.coupons.useCouponsOk + ',扣税:' + data.data.coupons.useCouponsTaxFee +
+ // // ',手续费:' + data.data.coupons.useCouponsHandlingFee + ']');
+ // }
+ // $('#wangNum').val(data.data.wang.useWang);
+ // $('#moneyNum').val(data.data.money.useMoney);
+ //
+ // } else {
+ // mui.alert(data.msg)
+ // }
+ // });
+ // } else if (payCode == 'wallets' || payCode == 'ect') {
+ // //跳输入密码的页面
+ // mui.ajax(hyhUrl('app/' + payCode + '/payment'), {
+ // data: {
+ // orderNo: orderNo,
+ // isBatch: 0
+ // },
+ // dataType: 'json', //服务器返回json格式数据
+ // type: 'post', //HTTP请求类型
+ // timeout: 10000, //超时时间设置为10秒;
+ // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // // //console.log(data.data.goodsFavoritesNum)
+ // var data = toJson(data);
+ // if (data.status == 1) {
+ // $('.pay').css('display', 'none');
+ // $('#pay_pwd').css('display', 'block');
+ // if (data.data.payPwd == '0') {
+ // mui.alert('还未设置支付密码请先设置支付密码!');
+ // var url = 'setting_fogetPayPwd';
+ // mui.openWindow({
+ // url: url + '.html',
+ // id: url + '.html',
+ // styles: {
+ // top: '0px', //新页面顶部位置
+ // bottom: '0px', //新页面底部位置
+ // width: '100%', //新页面宽度,默认为100%
+ // height: '100%' //新页面高度,默认为100%
+ // },
+ // extras: {
+ // // data_href: data_href
+ // // ..... //自定义扩展参数,可以用来处理页面间传值
+ // },
+ // createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ // show: {
+ // // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // // extras: {} //窗口动画是否使用图片加速
+ // },
+ // waiting: {
+ // autoShow: true, //自动显示等待框,默认为true
+ // title: '正在加载...', //等待对话框上显示的提示内容
+ // options: {
+ // // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // // ......
+ // }
+ // }
+ // })
+ // }
+ // }
+ // },
+ // error: function(xhr, type, errorThrown) { //异常处理;
+ // // mui.alert(type);
+ // }
+ // });
+ //
+ // } else if (payCode == 'alipays') {
+ // pay('alipay', orderNo);
+ // // plus.nativeUI.showWaiting();
+ // // mui.post(hyhUrl('app/Alipays/payment'), {
+ // // orderNo: data.data,
+ // // isBatch: 1
+ // // var ALIPAYSERVER = hyhUrl('app/Alipays/payment?orderNo=' + data.data + '&isBatch=1');
+ //
+ // }
+ //
+ // that.removeAttr('disabled');
+ // } else {
+ // mui.alert('发生错误请刷新后重试!');
+ // // location.reload();
+ // }
+ // },
+ // error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ // }
+ // })
+ // })
+ // $('#pay_pwd,#qlg_pay_pwd').on('tap', '.p9', function() {
+ // var url = 'setting_fogetPayPwd';
+ // JZL.openWindow(url + '.html', url + '.html');
+ // })
+ // $('#pay_pwd,#qlg_pay_pwd').on('tap', '.pay_btn_pwd', function() {
+ // // var self = plus.webview.currentWebview();
+ // // var data_href = self.id;
+ // // //console.log(data_href)
+ // // JZL.closeWindow('waitPay');
+ // //return;
+ // var payPwd = $('#payPwd').val();
+ // if (payPwd == '') {
+ // mui.alert('支付密码不能为空!');
+ // return;
+ // }
+ // var that = $(this);
+ // that.attr('disabled', 'disabled')
+ // var srcc = ''
+ // if (payCode == 'qlgpay') {
+ // srcc = 'payByQlg';
+ // } else if (payCode == 'ect') {
+ // srcc = 'payByEct';
+ // } else {
+ // srcc = 'payByWallet';
+ // }
+ //
+ // mui.ajax(hyhUrl('app/' + payCode + '/' + srcc), {
+ //
+ // data: {
+ // orderNo: orderNo,
+ // isBatch: 0,
+ // payPwd: payPwd
+ // },
+ // dataType: 'json', //服务器返回json格式数据
+ // type: 'post', //HTTP请求类型
+ // timeout: 10000, //超时时间设置为10秒;
+ // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // // //console.log(data.data.goodsFavoritesNum)
+ // var data = toJson(data);
+ // mui.alert(data.msg)
+ // //console.log(data.status)
+ // if (data.status == 1) {
+ // JZL.openWindow('indent.html', 'waitDeliver', {
+ // data_href: 'waitDeliver'
+ // });
+ // setTimeout(function() {
+ // JZL.closeWindow(plus.webview.currentWebview().id);
+ // // JZL.closeWindow('indent.html');
+ // }, 700)
+ // // var targetTab = plus.webview.getWebviewById("templete/my.html");
+ // // mui.fire(targetTab, 'refresh');
+ // // location.reload();
+ // } else {
+ //
+ // }
+ // that.removeAttr('disabled')
+ //
+ // },
+ // error: function(xhr, type, errorThrown) { //异常处理;
+ // // mui.alert(type);
+ // }
+ // });
+ //
+ // })
+
+ mui('.con').on('tap', '.row_con', function() {
+ var data_order_id = $(this).attr('data-id');
+ mui.openWindow({
+ url: 'order_out.html',
+ id: 'order_out.html',
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ data_order_id: data_order_id
+ // data_id: data_id
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+ })
+ mui('.con').on('tap', '.ckwl', function() {
+ var data_order_id = $(this).parent().parent().attr('data-id'); //$(this).attr('data-id');
+ JZL.openWindow('logistics.html', 'logistics.html', {
+ data_order_id: data_order_id
+ });
+ })
+ //上传凭证
+ mui('.con').on('tap', '.uploadCertificate', function() {
+ var orderId = $(this).parent().parent().attr('data-id');
+ // mui.alert('跳到上传凭证页' + orderId)
+ JZL.openWindow("uploadVoucher.html", "uploadVoucher.html", {
+ orderId: orderId
+ })
+ })
+ $('.con').on('tap', '.qxdd_js', function() {
+ orderNo = $(this).parent().parent().attr('data-orderNo');
+ orderId = $(this).parent().parent().attr('data-id');
+ if ($(this).html() == '取消订单') {
+ getReasonUrl = 'getCancelCause';
+ } else if ($(this).html() == '拒收') {
+ getReasonUrl = 'getRejectCause';
+ } else if ($(this).html() == '申请退款') {
+ getReasonUrl = 'getRefundCause';
+ JZL.ajax(hyhUrl('/app/Orders/getRefund'), {
+ id: orderId
+ }, function(data) { //服务器返回响应
+ // //console.log(JSON.stringify(data));
+ var data = toJson(data);
+ if (data.status == 1) {
+ data = data.data;
+ var html = '';
+ if ('qlgpay' == data.payFrom) {
+ html = ' 退款产品券数量:
' +
+ ' 退款优惠券数量:
' +
+ ' 退款旺旺券数量:
' +
+ ' 退款现金数量:' + data.moneyNum + ',现金方面请与商家协商' +
+ // '
(金额不能超过¥' + data.realTotalMoney +
+ ')
';
+ } else {
+ html = '
(金额不能超过¥' + data.realTotalMoney +
+ ')
(积分数量:' + data.ectNum + ')
';
+ }
+
+ $('.tui').html(html)
+ } else {
+ mui.alert(data.msg)
+ }
+ });
+ }
+ $('.bg_').css('display', 'block');
+ $('.bg_con').css('display', 'none');
+ $('.bg_con').slideDown(300, function() {});
+ mui.ajax(hyhUrl('/app/Orders/' + getReasonUrl), {
+ data: {},
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // //console.log(data.data.goodsFavoritesNum)
+ // //console.log(data.data.Rows)
+ var data = toJson(data);
+ if (data.status == 1) {
+ var html = '
';
+ $.each(data.data, function() {
+ html += '
'
+ });
+ $('#select').html(html)
+ } else {
+ mui.alert(data.msg)
+ }
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ })
+
+ $('.bg_').on('tap', '.en_false', function() {
+ $('.bg_').css('display', 'none');
+
+ })
+ $('.bg_').on('tap', '.en_true', function() {
+ var setReasonUrl = '';
+ var content = $('#content').val();
+ var reason = $('#select').val();
+ if ($('#select').val() == 0) {
+ mui.alert('请选择原因!');
+ return;
+ }
+ if ($('#select').val() == 10000 && content == '') {
+ mui.alert('请输入其他原因!');
+ return;
+ }
+ if (getReasonUrl == 'getCancelCause') {
+ setReasonUrl = 'cancellation';
+ mui.ajax(qlgUrl('app/Orders/' + setReasonUrl), {
+ data: {
+ reason: reason,
+ id: orderId,
+ content: content
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // //console.log(data.data.goodsFavoritesNum)
+ // //console.log(data.data.Rows)
+ var data = toJson(data);
+ mui.alert(data.msg);
+ if (data.status == 1) {
+ // var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
+ // mui.fire(list, 'refresh');
+ if ('waitPay' == plus.webview.currentWebview().id) {
+ location.reload();
+ } else {
+ JZL.openWindow('indent.html', 'abnormal', {
+ data_href: 'abnormal'
+ });
+ setTimeout(function() {
+ //plus.webview.currentWebview().close();
+ JZL.closeWindow(plus.webview.currentWebview().id);
+ }, 500)
+ }
+ // JZL.openWindow('indent.html', 'abnormal', {
+ // data_href: 'abnormal'
+ // });
+ // setTimeout(function() {
+ // plus.webview.currentWebview().close();
+ // // JZL.closeWindow(plus.webview.currentWebview().id);
+ // }, 500)
+ //location.reload();
+
+ }
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ } else if (getReasonUrl == 'getRejectCause') {
+ setReasonUrl = 'reject';
+ mui.ajax(hyhUrl('app/Orders/' + setReasonUrl), {
+ data: {
+ reason: reason,
+ id: orderId,
+ content: content
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // //console.log(data.data.goodsFavoritesNum)
+ // //console.log(data.data.Rows)
+ var data = toJson(data);
+ mui.alert(data.msg);
+ if (data.status == 1) {
+ // var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
+ // mui.fire(list, 'refresh');
+ location.reload();
+
+ }
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ } else if (getReasonUrl == 'getRefundCause') {
+ var params = {}
+ // params.money = $('#Tmoney').val();
+ // if (params.money < 0 || params.money == 0) {
+ // mui.alert('退款金额不能为0!');
+ // return;
+ // }
+ params.productNum = $('#productNum').val();
+ params.couponsNum = $('#couponsNum').val();
+ params.wangNum = $('#wangNum').val();
+ params.reason = reason;
+ params.id = orderId;
+ params.content = content;
+ JZL.ajax(hyhUrl('app/Orderrefunds/refund'), params, function(data) {
+ var data = toJson(data);
+ mui.alert(data.msg);
+ if (data.status == 1) {
+ var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
+ mui.fire(list, 'refresh');
+ location.reload();
+ }
+ })
+ }
+ })
+ $('#select').on('change', function() {
+ if ($(this).val() == '10000') {
+ $('#content').css('display', 'block');
+ } else {
+ $('#content').css('display', 'none');
+ }
+ })
})
diff --git a/static/app2/js/shoperUploadVoucher.js b/static/app2/js/shoperUploadVoucher.js
old mode 100755
new mode 100644
index 79c2335..af253d2
--- a/static/app2/js/shoperUploadVoucher.js
+++ b/static/app2/js/shoperUploadVoucher.js
@@ -1,67 +1,67 @@
-mui.init({
- beforeback: function() { //获得父页面的webview
- var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
- mui.fire(list, 'reload');
- //返回true,继续页面关闭逻辑
- return true;
- },
-})
-mui.plusReady(function() {
- var orderId = '',
- id = '',
- shopId = '';
-
- var self = plus.webview.currentWebview();
- //console.log(self);
- orderIds = self.orderIds;
- shopId = self.shopId;
- if ('undefined' != typeof self.orderId) {
- id = self.orderId
- }
- if (id > 0) { //bianji
- JZL.ajax(qlgUrl('app/shopOrders/getCertificateInfo'), {
- shopId: shopId,
- id: id
- }, function(data) {
- //console.log(data);
- $('#content').val(data.data.content);
- $('#img').attr('src', hyhImgUrl(data.data.imgUrl))
- $('#imgUrl').val(data.data.imgUrl)
- })
- }
- // 上传图片
- $(".oneImg").on("tap", '#img', function() {
- // UP.init("accountBookImg", "test", "accountBookImgTag")
- UP.init("imgUrl", "test", "img")
- openCamera()
- })
-
- var click = false;
- $(".con").on("tap", '.bc_btn', function() {
- if (true == click) return;
- click = true;
- var params = JZL.getParams(".inp");
- params.orderIds = orderIds;
- params.shopId = shopId;
- if (id > 0) {
- params.id = id;
- }
- if ('' == $.trim($('#content').val())) {
- mui.alert("请输入凭证说明")
- return;
- }
- if ('' == $('#imgUrl').val()) {
- mui.alert("请上传凭证图片")
- return;
- }
- JZL.ajax(qlgUrl('app/Shoporders/uploadCertificate'), params, function(data) {
- //console.log(data);
- if (-1 == data.status) {
- mui.alert(data.msg)
- mui.back();
- } else {
- mui.alert(data.msg)
- }
- })
- })
+mui.init({
+ beforeback: function() { //获得父页面的webview
+ var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
+ mui.fire(list, 'reload');
+ //返回true,继续页面关闭逻辑
+ return true;
+ },
+})
+mui.plusReady(function() {
+ var orderId = '',
+ id = '',
+ shopId = '';
+
+ var self = plus.webview.currentWebview();
+ //console.log(self);
+ orderIds = self.orderIds;
+ shopId = self.shopId;
+ if ('undefined' != typeof self.orderId) {
+ id = self.orderId
+ }
+ if (id > 0) { //bianji
+ JZL.ajax(qlgUrl('app/shopOrders/getCertificateInfo'), {
+ shopId: shopId,
+ id: id
+ }, function(data) {
+ //console.log(data);
+ $('#content').val(data.data.content);
+ $('#img').attr('src', hyhImgUrl(data.data.imgUrl))
+ $('#imgUrl').val(data.data.imgUrl)
+ })
+ }
+ // 上传图片
+ $(".oneImg").on("tap", '#img', function() {
+ // UP.init("accountBookImg", "test", "accountBookImgTag")
+ UP.init("imgUrl", "test", "img")
+ openCamera()
+ })
+
+ var click = false;
+ $(".con").on("tap", '.bc_btn', function() {
+ if (true == click) return;
+ click = true;
+ var params = JZL.getParams(".inp");
+ params.orderIds = orderIds;
+ params.shopId = shopId;
+ if (id > 0) {
+ params.id = id;
+ }
+ if ('' == $.trim($('#content').val())) {
+ mui.alert("请输入凭证说明")
+ return;
+ }
+ if ('' == $('#imgUrl').val()) {
+ mui.alert("请上传凭证图片")
+ return;
+ }
+ JZL.ajax(qlgUrl('app/Shoporders/uploadCertificate'), params, function(data) {
+ //console.log(data);
+ if (-1 == data.status) {
+ mui.alert(data.msg)
+ mui.back();
+ } else {
+ mui.alert(data.msg)
+ }
+ })
+ })
})
diff --git a/static/app2/js/shopgoodlist.js b/static/app2/js/shopgoodlist.js
old mode 100755
new mode 100644
index ebefc13..1b21bbf
--- a/static/app2/js/shopgoodlist.js
+++ b/static/app2/js/shopgoodlist.js
@@ -1,100 +1,100 @@
-mui.plusReady(function() {
- window.addEventListener('reload', function(e) { //执行刷新
- location.reload();
- });
- var self = plus.webview.currentWebview();
- // //console.log(self);
- var shopId = self.id;
- $('.add1').on('tap', function() {
- JZL.openWindow('addgoods.html', parseInt(shopId));
- })
- //获取商品列表
- var page = 1;
- var pageSize = 10;
- var isjiazai = 1;
- getRecommend(page, pageSize);
-
- function getRecommend(page, pageSize) {
- var recommenddata = {
- page: page ? page : 1,
- pageSize: pageSize ? pageSize : 10
- }
- recommenddata.shopId = shopId
- if (isjiazai == 0) {
- return;
- } else {
- isjiazai = 0;
- }
- JZL.ajax(qlgUrl('app/shops/getGoodsList'), recommenddata, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- //console.log(data);
- if (data.status == 1) {
- var html = '';
- var status = '';
- var data = data.data;
- var status = "";
- if ('' == data.Rows) {
- $('.mui-scroll').append(
- '
没有更多数据
');
- isjiazai = 0;
- return;
- }
- $.each(data.Rows, function() {
- // //console.log(this.goodsStatus);
- if (0 == this.goodsStatus) {
- status = "等待审核"
- }
- if (1 == this.goodsStatus) {
- status = "已上架"
- }
- if (-1 == this.goodsStatus) {
- status = "已拒绝"
- }
- html += '
' + this.goodsName + '
价格:' +
- this.shopPrice +
- '
'
- })
- $('.con').append(html);
- } else {
- mui.alert(data.msg)
- }
- isjiazai = 1;
- })
- }
- document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
- if (scroll.y == scroll.maxScrollY) {
- if (isjiazai == 1) {
- page++;
- getRecommend(page, pageSize);
- }
- }
- })
- var goodsId = "";
- var isSpec = "";
- $('.con').on('tap', '.bj', function() {
- goodsId = $(this).attr('data-id')
- isSpec = $(this).parent().parent().parent().attr("data-spec")
- isSale = $(this).parent().parent().parent().attr("data-sale")
- JZL.openWindow('addgoods.html', parseInt(shopId), {
- goodsId: goodsId,
- isSpec: isSpec,
- isSale: isSale
- });
- })
- $('.con').on('tap', '.del', function() {
- goodsId = $(this).attr('data-id')
- if (confirm('确认删除?')) {
- JZL.ajax(qlgUrl("app/shops/delGoods"), {
- shopId: shopId,
- goodsId: goodsId
- }, function() {
- $(this).parent().parent().parent().remove();
- location.reload()
- })
- }
- })
+mui.plusReady(function() {
+ window.addEventListener('reload', function(e) { //执行刷新
+ location.reload();
+ });
+ var self = plus.webview.currentWebview();
+ // //console.log(self);
+ var shopId = self.id;
+ $('.add1').on('tap', function() {
+ JZL.openWindow('addgoods.html', parseInt(shopId));
+ })
+ //获取商品列表
+ var page = 1;
+ var pageSize = 10;
+ var isjiazai = 1;
+ getRecommend(page, pageSize);
+
+ function getRecommend(page, pageSize) {
+ var recommenddata = {
+ page: page ? page : 1,
+ pageSize: pageSize ? pageSize : 10
+ }
+ recommenddata.shopId = shopId
+ if (isjiazai == 0) {
+ return;
+ } else {
+ isjiazai = 0;
+ }
+ JZL.ajax(qlgUrl('app/shops/getGoodsList'), recommenddata, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ //console.log(data);
+ if (data.status == 1) {
+ var html = '';
+ var status = '';
+ var data = data.data;
+ var status = "";
+ if ('' == data.Rows) {
+ $('.mui-scroll').append(
+ '
没有更多数据
');
+ isjiazai = 0;
+ return;
+ }
+ $.each(data.Rows, function() {
+ // //console.log(this.goodsStatus);
+ if (0 == this.goodsStatus) {
+ status = "等待审核"
+ }
+ if (1 == this.goodsStatus) {
+ status = "已上架"
+ }
+ if (-1 == this.goodsStatus) {
+ status = "已拒绝"
+ }
+ html += '
' + this.goodsName + '
价格:' +
+ this.shopPrice +
+ '
'
+ })
+ $('.con').append(html);
+ } else {
+ mui.alert(data.msg)
+ }
+ isjiazai = 1;
+ })
+ }
+ document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
+ if (scroll.y == scroll.maxScrollY) {
+ if (isjiazai == 1) {
+ page++;
+ getRecommend(page, pageSize);
+ }
+ }
+ })
+ var goodsId = "";
+ var isSpec = "";
+ $('.con').on('tap', '.bj', function() {
+ goodsId = $(this).attr('data-id')
+ isSpec = $(this).parent().parent().parent().attr("data-spec")
+ isSale = $(this).parent().parent().parent().attr("data-sale")
+ JZL.openWindow('addgoods.html', parseInt(shopId), {
+ goodsId: goodsId,
+ isSpec: isSpec,
+ isSale: isSale
+ });
+ })
+ $('.con').on('tap', '.del', function() {
+ goodsId = $(this).attr('data-id')
+ if (confirm('确认删除?')) {
+ JZL.ajax(qlgUrl("app/shops/delGoods"), {
+ shopId: shopId,
+ goodsId: goodsId
+ }, function() {
+ $(this).parent().parent().parent().remove();
+ location.reload()
+ })
+ }
+ })
})
diff --git a/static/app2/js/shoppingcart.js b/static/app2/js/shoppingcart.js
old mode 100755
new mode 100644
index 8a72424..6b72f21
--- a/static/app2/js/shoppingcart.js
+++ b/static/app2/js/shoppingcart.js
@@ -1,586 +1,611 @@
-var num = 1;
-var isOver = 1;
-$('.mui-action-back').show();
-
-function getMsg(pageNum, pagesizeNum) {
-
- var data_msg = {
- page: pageNum ? pageNum : 1,
- pagesize: pagesizeNum ? pagesizeNum : 10
- }
-
- if (isOver == 0) {
- return;
- } else {
- isOver = 0;
- }
- mui.ajax(qlgUrl('app/Articles/headLine'), {
-
- // mui.ajax(kxUrl('app/Articles/headLine'), {
- data: data_msg,
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- var data = toJson(data, 1);
- if (data.status == 1) {
- var html = '';
- data = data.data;
- if (data.Rows == '') {
- if (pageNum == 1) {
- $('.recommend_con').html(
- '
没有更多内容
');
- } else if (pageNum > 1) {
- $('.recommend_con').append(
- '
没有更多内容
');
- }
-
- isOver = 0;
- return;
- }
- $.each(data.Rows, function() {
- html += '
 +
- ')
自营' + this.goodsName + '
¥' + this.shopPrice +
- ' 满减
可用木吉抵扣20%货款

';
- });
-
- if (pageNum == 1) {
- $('.recommend_con').html(html);
- } else if (pageNum > 1) {
- $('.recommend_con').append(html);
- }
- $('.recommend_title').css('display', 'block');
- $('.rcb_title span').each(function() {
- if ($(this).attr('data-goodsId') == 1) {
- $(this).css('display', 'none');
- }
- })
- $('.rcb_img').height($('.rcb_img').width());
- isOver = 1;
- } else {
- mui.alert(data.msg)
- }
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
-
-}
-
-
-
-mui.plusReady(function() {
- // var scroll = mui('.mui-scroll-wrapper').scroll({
- // deceleration: 0.002 //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006
- // });
- window.addEventListener('refresh', function(e) {
- location.reload();
- })
- getMsg(num, 10);
-
- function getCost() {
- var cost = 0;
- $('.check2').each(function() {
- if ($(this).children().hasClass('check_1')) {
-
- cost += ((+$(this).siblings('.b_con_r1').children('.bz').children('.cost').children('o').html()) * (+$(this).siblings(
- '.b_con_r1').children('.bz').children('.num').children('o').html()))
- }
- })
-
- $('.js_r span j').html('¥' + cost.toFixed(2));
- }
-
- function isChecks() {
-
- $('.check1').each(function() {
- var isChecks = 1;
- $(this).parent().siblings().children().find('.checks').each(function() {
- if ($(this).hasClass('check_0')) {
- isChecks = 0;
- }
- })
- if (isChecks == 0) {
- $(this).children().removeClass('check_1').addClass('check_0');
- } else {
- $(this).children().removeClass('check_0').addClass('check_1');
- }
- })
-
- }
- mui.ajax(qlgUrl('app/carts/index'), {
- // mui.ajax(hyhUrl('app/carts/index'), {
- data: {},
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- var data = toJson(data, 1);
- if (data.status == 1) {
- data = data.data;
- var html = '';
- $('header').html('购物车(' + data.all_carts_num + ')');
- var allids = [];
- $.each(data.carts, function() {
- var ids = [];
-
- $.each(this.list, function() {
- ids.push(this.cartId);
- allids.push(this.cartId);
- });
- var idsStr = ids.join(',');
- html += '


编辑
';
- $.each(this.list, function() {
-
- html += '
 +
- ')
' +
- this.goodsName + '
';
- $.each(this.specNames, function() {
- html += this.catName + ':' + this.itemName + ';';
- });
- var price;
- if (this.specPrice != null) {
- price = this.specPrice;
- } else {
- price = this.shopPrice;
- }
- html += '
¥' + price +
- ' ¥' + this.marketPrice +
- '×' + this.cartNum +
- '
';
- });
-
- html += '
';
-
- });
- var allIdsStr = allids.join(',');
-
- $('.con_').html(html)
- $('.check').attr('data-allIdsStr', allIdsStr);
- $('.checks').each(function() {
- if ($(this).parent().attr('data-isCheck') == '1') {
- $(this).removeClass('check_0').addClass('check_1');
- }
- })
- getCost();
- isChecks();
- } else {
- mui.alert(data.msg)
- }
-
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- $('.con_').on('tap', '.b_link', function() {
- var shopId = $(this).children('a').attr('data-shopId');
- var url = 'storeout.html';
- if (shopId == 1) {
- // url='self_shop.html'
- }
- mui.openWindow({
- url: url,
- id: url + shopId,
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- shopId: shopId
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
- })
- $('.con_').on('tap', '.b_con_r1', function() {
- var data_id = $(this).attr('data-goodsId');
- mui.openWindow({
- url: 'details.html',
- id: 'details.html' + data_id,
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- data_id: data_id
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
- })
-
- $('.check').on('tap', function() {
- var isCheck;
- var ids = $(this).attr('data-allIdsStr');
- if ($('.check').children('.checks').hasClass('check_0')) {
- $('.check').children('.checks').removeClass('check_0').addClass('check_1');
- $('.check1').children('.checks').removeClass('check_0').addClass('check_1');
- $('.check2').children('.checks').removeClass('check_0').addClass('check_1');
- isCheck = 1;
- } else {
- $('.check').children('.checks').removeClass('check_1').addClass('check_0');
- $('.check1').children('.checks').removeClass('check_1').addClass('check_0');
- $('.check2').children('.checks').removeClass('check_1').addClass('check_0');
- isCheck = 0;
- }
- getCost();
- isChecks();
- mui.ajax(qlgUrl('app/carts/batchChangeCartGoods'), {
- data: {
- ids: ids,
- isCheck: isCheck
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功;
- var data = toJson(data);
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- });
-
- $('.con_').on('tap', '.check1', function(e) {
- e.stopPropagation();
- var that = $(this);
- var isCheck;
- var ids = $(this).attr('data-idsStr');
- $('.check').children('.checks').removeClass('check_1').addClass('check_0');
- if (that.children('.checks').hasClass('check_0')) {
- isCheck = 1;
- that.children('.checks').removeClass('check_0').addClass('check_1');
- that.parent().siblings().children().find('.check2').children('.checks').removeClass('check_0').addClass(
- 'check_1');
- } else {
- isCheck = 0;
- that.children('.checks').removeClass('check_1').addClass('check_0');
- that.parent().siblings().children().find('.check2').children('.checks').removeClass('check_1').addClass(
- 'check_0');
- }
- getCost();
- isChecks();
- that.attr('disabled', 'disabled');
- mui.ajax(qlgUrl('app/carts/batchChangeCartGoods'), {
- data: {
- ids: ids,
- isCheck: isCheck
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功;
- var data = toJson(data);
- that.removeAttr('disabled');
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
-
- });
-
- $('.con_').on('tap', '.check2', function(e) {
- ////console.log()
- e.stopPropagation();
- var isCheck;
- var cartId = $(this).attr('data-cartId');
- var that = $(this);
- var buyNum = $(this).attr('data-cartNum');
- $('.check').children('.checks').removeClass('check_1').addClass('check_0');
- if ($(this).children().hasClass('check_0')) {
- $(this).parent().parent().siblings().children('.check1').children('.checks').removeClass('check_1').addClass(
- 'check_0');
- $(this).children('.checks').removeClass('check_0').addClass('check_1');
- isCheck = 1;
- } else {
- $(this).children('.checks').removeClass('check_1').addClass('check_0');
- isCheck = 0;
- }
- getCost();
- isChecks()
- $(this).attr('disabled', 'disabled');
- mui.ajax(qlgUrl('app/carts/changeCartGoods'), {
- data: {
- id: cartId,
- isCheck: isCheck,
- buyNum: buyNum
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功;
- var data = toJson(data, 1);
- that.removeAttr('disabled');
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
-
- });
-
- $('.con_').on('tap', '.btn_bj', function(e) {
- e.stopPropagation()
- if ($(this).html() == '编辑') {
- $(this).html('完成');
- $(this).parent().siblings().children().find('.b_con_r1').css('display', 'none');
- $(this).parent().siblings().children().find('.b_con_r2').css('display', 'block');
- } else {
- $(this).html('编辑');
- $(this).parent().siblings().children().find('.b_con_r2').css('display', 'none');
- $(this).parent().siblings().children().find('.b_con_r1').css('display', 'block');
- var inputArr = $(this).parent().siblings().find('input')
-
- $(this).parent().siblings().find('.num').each(function(num) {
- $(this).html('×
' + inputArr.eq(num).val() + '');
- })
-
- }
- // //console.log($(this).parent().siblings().find('.commodity_num'))
- // //console.log($(this).parent().siblings().find('input'));
- if ($(this).html() == '完成') {
- return;
- }
- getCost()
- })
-
- $('.con_').on('tap', '.jia', function() {
- // //console.log($(this).siblings('input').val())
- var that = $(this);
- var cartId = $(this).parent().attr('data-cartId')
- var num = +$(this).siblings('input').val() + 1;
- if (num <= 0) {
- mui.alert('购买数最小为1!');
- return;
- }
- $('.jia').attr('disabled', 'disabled');
- $('.jian').attr('disabled', 'disabled');
- $('input').attr('disabled', 'disabled');
- mui.ajax(hyhUrl('app/carts/changeCartGoods'), {
- data: {
- id: cartId,
- buyNum: num
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功;
- var data = toJson(data, 1);
- that.siblings('input').val(num);
- $('.jia').removeAttr('disabled');
- $('.jian').removeAttr('disabled');
- $('input').removeAttr('disabled');
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- })
- $('.con_').on('tap', '.jian', function() {
- var that = $(this);
- var cartId = $(this).parent().attr('data-cartId')
- var num = +$(this).siblings('input').val() - 1;
- if (num <= 0) {
- mui.alert('购买数最小为1!');
- return;
- }
- $('.jia').attr('disabled', 'disabled');
- $('.jian').attr('disabled', 'disabled');
- $('input').attr('disabled', 'disabled');
- mui.ajax(qlgUrl('app/carts/changeCartGoods'), {
- data: {
- id: cartId,
- buyNum: num
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功;
- var data = toJson(data, 1);
- that.siblings('input').val(num);
- $('.jia').removeAttr('disabled');
- $('.jian').removeAttr('disabled');
- $('input').removeAttr('disabled');
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- })
- $('.con_').on('blur', 'input', function() {
- var that = $(this);
- var cartId = $(this).parent().attr('data-cartId')
- var num = +$(this).val();
- if (num <= 0) {
- mui.alert('购买数最小为1!');
- return;
- }
- $('.jia').attr('disabled', 'disabled');
- $('.jian').attr('disabled', 'disabled');
- $('input').attr('disabled', 'disabled');
- mui.ajax(qlgUrl('app/carts/changeCartGoods'), {
- data: {
- id: cartId,
- buyNum: num
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功;
- var data = toJson(data, 1);
- that.siblings('input').val(num);
- $('.jia').removeAttr('disabled');
- $('.jian').removeAttr('disabled');
- $('input').removeAttr('disabled');
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- })
-
- $('.con_').on('tap', '.b_con_r2_del', function() {
- var cartId = $(this).attr('data-cartId');
-
- if (confirm('确定删除?')) {
- mui.ajax(hyhUrl('app/carts/delCart'), {
- data: {
- id: cartId
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功;
- var data = toJson(data, 1);
- location.reload();
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- }
- })
-
- // $('.changeclass').on('tap', '.selectclass', function() {
- // $('.mui-backdrop').show();
- // })
-
- //选择类型
- // $('.cclass1').on('tap', '.block', function() {
- // $(this).addClass('on').siblings().removeClass('on');
- // $(this).parent().attr('data-class', $(this).html());
- // })
-
- // $('.closecclass').on('tap', function() {
- // $('.mui-backdrop').css('display', 'none');
- // })
-
- // $('.ensure').on('tap', function() {
- // $('.mui-backdrop').css('display', 'none');
- // })
-
- mui('.js').on('tap', '.btn_tj', function() {
- var check_length = $('.check_1').length;
- if (check_length == 0) {
- mui.alert('请选择商品结算!');
- return;
- }
- mui.openWindow({
- url: 'confirmOrder.html',
- id: 'confirmOrder.html',
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- // data_id: data_id
-
- type: 0
-
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
-
- setTimeout(function() {
- JZL.closeWindow(plus.webview.currentWebview().id);
- }, 1000)
- })
- document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
- if (scroll.y == scroll.maxScrollY) {
- if (isOver == 1) {
- num++;
- getMsg(num, 10);
- }
- }
- })
+var num = 1;
+var isOver = 1;
+$('.mui-action-back').show();
+
+function getMsg(pageNum, pagesizeNum) {
+
+ var data_msg = {
+ from: from_id,
+ page: pageNum ? pageNum : 1,
+ pagesize: pagesizeNum ? pagesizeNum : 10
+ }
+
+ if (isOver == 0) {
+ return;
+ } else {
+ isOver = 0;
+ }
+ mui.ajax(qlgUrl('app/Articles/headLine'), {
+
+ // mui.ajax(kxUrl('app/Articles/headLine'), {
+ data: data_msg,
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ var data = toJson(data, 1);
+ if (data.status == 1) {
+ var html = '';
+ data = data.data;
+ if (data.Rows == '') {
+ if (pageNum == 1) {
+ $('.recommend_con').html(
+ '
没有更多内容
');
+ } else if (pageNum > 1) {
+ $('.recommend_con').append(
+ '
没有更多内容
');
+ }
+
+ isOver = 0;
+ return;
+ }
+ $.each(data.Rows, function() {
+ html += '
 +
+ ')
自营' + this.goodsName + '
¥' + this.shopPrice +
+ ' 满减
可用木吉抵扣20%货款

';
+ });
+
+ if (pageNum == 1) {
+ $('.recommend_con').html(html);
+ } else if (pageNum > 1) {
+ $('.recommend_con').append(html);
+ }
+ $('.recommend_title').css('display', 'block');
+ $('.rcb_title span').each(function() {
+ if ($(this).attr('data-goodsId') == 1) {
+ $(this).css('display', 'none');
+ }
+ })
+ $('.rcb_img').height($('.rcb_img').width());
+ isOver = 1;
+ } else {
+ mui.alert(data.msg)
+ }
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+
+}
+
+
+
+mui.plusReady(function() {
+ // var scroll = mui('.mui-scroll-wrapper').scroll({
+ // deceleration: 0.002 //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006
+ // });
+ var self = plus.webview.currentWebview();
+ from_id = self.from_id?self.from_id:0;
+ switch(from_id){
+ case 1:
+ $(".title").text("逛商都购物车")
+ break
+ case 2:
+ $(".title").text("助微吧购物车")
+ break
+ case 3:
+ $(".title").text("助购吧购物车")
+ break
+ }
+ window.addEventListener('refresh', function(e) {
+ location.reload();
+ })
+ getMsg(num, 10);
+
+ function getCost() {
+ var cost = 0;
+ $('.check2').each(function() {
+ if ($(this).children().hasClass('check_1')) {
+
+ cost += ((+$(this).siblings('.b_con_r1').children('.bz').children('.cost').children('o').html()) * (+$(this).siblings(
+ '.b_con_r1').children('.bz').children('.num').children('o').html()))
+ }
+ })
+
+ $('.js_r span j').html('¥' + cost.toFixed(2));
+ }
+
+ function isChecks() {
+
+ $('.check1').each(function() {
+ var isChecks = 1;
+ $(this).parent().siblings().children().find('.checks').each(function() {
+ if ($(this).hasClass('check_0')) {
+ isChecks = 0;
+ }
+ })
+ if (isChecks == 0) {
+ $(this).children().removeClass('check_1').addClass('check_0');
+ } else {
+ $(this).children().removeClass('check_0').addClass('check_1');
+ }
+ })
+ if($('.check2 .check_1').length===0 && $('.check2 .check_0').length > 0){
+ $(".js .checks").removeClass('check_1').addClass('check_0');
+ }else{
+ $(".js .checks").removeClass('check_0').addClass('check_1');
+ }
+ $(".btn_tj").text("结算("+$(".check2 .check_1").length+")")
+ }
+ mui.ajax(qlgUrl('app/carts/index'), {
+ // mui.ajax(hyhUrl('app/carts/index'), {
+ data: {from:from_id},
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ var data = toJson(data, 1);
+ if (data.status == 1) {
+ data = data.data;
+ var html = '';
+ $('header').html('购物车(' + data.all_carts_num + ')');
+ var allids = [];
+ $.each(data.carts, function() {
+ var ids = [];
+
+ $.each(this.list, function() {
+ ids.push(this.cartId);
+ allids.push(this.cartId);
+ });
+ var idsStr = ids.join(',');
+ html += '


编辑
';
+ $.each(this.list, function() {
+
+ html += '
 +
+ ')
' +
+ this.goodsName + '
';
+ $.each(this.specNames, function() {
+ html += this.catName + ':' + this.itemName + ';';
+ });
+ var price;
+ if (this.specPrice != null) {
+ price = this.specPrice;
+ } else {
+ price = this.shopPrice;
+ }
+ html += '
¥' + price +
+ ' ¥' + this.marketPrice +
+ '×' + this.cartNum +
+ '
';
+ });
+
+ html += '
';
+
+ });
+ var allIdsStr = allids.join(',');
+
+ $('.con_').html(html)
+ $('.check').attr('data-allIdsStr', allIdsStr);
+ $('.checks').each(function() {
+ if ($(this).parent().attr('data-isCheck') == '1') {
+ $(this).removeClass('check_0').addClass('check_1');
+ }
+ })
+ getCost();
+ isChecks();
+ } else {
+ mui.alert(data.msg)
+ }
+
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ $('.con_').on('tap', '.b_link', function() {
+ var shopId = $(this).children('a').attr('data-shopId');
+ var url = 'storeout.html';
+ if (shopId == 1) {
+ // url='self_shop.html'
+ }
+ mui.openWindow({
+ url: url,
+ id: url + shopId,
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ shopId: shopId
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+ })
+ $('.con_').on('tap', '.b_con_r1', function() {
+ var data_id = $(this).attr('data-goodsId');
+ mui.openWindow({
+ url: 'details.html',
+ id: 'details.html' + data_id,
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ data_id: data_id,
+ from_id: from_id,
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+ })
+
+ $('.check').on('tap', function() {
+ var isCheck;
+ var ids = $(this).attr('data-allIdsStr');
+ if ($('.check').children('.checks').hasClass('check_0')) {
+ $('.check').children('.checks').removeClass('check_0').addClass('check_1');
+ $('.check1').children('.checks').removeClass('check_0').addClass('check_1');
+ $('.check2').children('.checks').removeClass('check_0').addClass('check_1');
+ isCheck = 1;
+ } else {
+ $('.check').children('.checks').removeClass('check_1').addClass('check_0');
+ $('.check1').children('.checks').removeClass('check_1').addClass('check_0');
+ $('.check2').children('.checks').removeClass('check_1').addClass('check_0');
+ isCheck = 0;
+ }
+ getCost();
+ isChecks();
+ mui.ajax(qlgUrl('app/carts/batchChangeCartGoods'), {
+ data: {
+ from: from_id,
+ ids: ids,
+ isCheck: isCheck
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功;
+ var data = toJson(data);
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ });
+
+ $('.con_').on('tap', '.check1', function(e) {
+ e.stopPropagation();
+ var that = $(this);
+ var isCheck;
+ var ids = $(this).attr('data-idsStr');
+ $('.check').children('.checks').removeClass('check_1').addClass('check_0');
+ if (that.children('.checks').hasClass('check_0')) {
+ isCheck = 1;
+ that.children('.checks').removeClass('check_0').addClass('check_1');
+ that.parent().siblings().children().find('.check2').children('.checks').removeClass('check_0').addClass(
+ 'check_1');
+ } else {
+ isCheck = 0;
+ that.children('.checks').removeClass('check_1').addClass('check_0');
+ that.parent().siblings().children().find('.check2').children('.checks').removeClass('check_1').addClass(
+ 'check_0');
+ }
+ getCost();
+ isChecks();
+ that.attr('disabled', 'disabled');
+ mui.ajax(qlgUrl('app/carts/batchChangeCartGoods'), {
+ data: {
+ from: from_id,
+ ids: ids,
+ isCheck: isCheck
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功;
+ var data = toJson(data);
+ that.removeAttr('disabled');
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+
+ });
+
+ $('.con_').on('tap', '.check2', function(e) {
+ ////console.log()
+ e.stopPropagation();
+ var isCheck;
+ var cartId = $(this).attr('data-cartId');
+ var that = $(this);
+ var buyNum = $(this).attr('data-cartNum');
+ $('.check').children('.checks').removeClass('check_1').addClass('check_0');
+ if ($(this).children().hasClass('check_0')) {
+ $(this).parent().parent().siblings().children('.check1').children('.checks').removeClass('check_1').addClass(
+ 'check_0');
+ $(this).children('.checks').removeClass('check_0').addClass('check_1');
+ isCheck = 1;
+ } else {
+ $(this).children('.checks').removeClass('check_1').addClass('check_0');
+ isCheck = 0;
+ }
+ getCost();
+ isChecks()
+ $(this).attr('disabled', 'disabled');
+ mui.ajax(qlgUrl('app/carts/changeCartGoods'), {
+ data: {
+ from: from_id,
+ id: cartId,
+ isCheck: isCheck,
+ buyNum: buyNum
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功;
+ var data = toJson(data, 1);
+ that.removeAttr('disabled');
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+
+ });
+
+ $('.con_').on('tap', '.btn_bj', function(e) {
+ e.stopPropagation()
+ if ($(this).html() == '编辑') {
+ $(this).html('完成');
+ $(this).parent().siblings().children().find('.b_con_r1').css('display', 'none');
+ $(this).parent().siblings().children().find('.b_con_r2').css('display', 'block');
+ } else {
+ $(this).html('编辑');
+ $(this).parent().siblings().children().find('.b_con_r2').css('display', 'none');
+ $(this).parent().siblings().children().find('.b_con_r1').css('display', 'block');
+ var inputArr = $(this).parent().siblings().find('input')
+
+ $(this).parent().siblings().find('.num').each(function(num) {
+ $(this).html('×
' + inputArr.eq(num).val() + '');
+ })
+
+ }
+ // //console.log($(this).parent().siblings().find('.commodity_num'))
+ // //console.log($(this).parent().siblings().find('input'));
+ if ($(this).html() == '完成') {
+ return;
+ }
+ getCost()
+ })
+
+ $('.con_').on('tap', '.jia', function() {
+ // //console.log($(this).siblings('input').val())
+ var that = $(this);
+ var cartId = $(this).parent().attr('data-cartId')
+ var num = +$(this).siblings('input').val() + 1;
+ if (num <= 0) {
+ mui.alert('购买数最小为1!');
+ return;
+ }
+ $('.jia').attr('disabled', 'disabled');
+ $('.jian').attr('disabled', 'disabled');
+ $('input').attr('disabled', 'disabled');
+ mui.ajax(hyhUrl('app/carts/changeCartGoods'), {
+ data: {
+ from: from_id,
+ id: cartId,
+ buyNum: num
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功;
+ var data = toJson(data, 1);
+ that.siblings('input').val(num);
+ $('.jia').removeAttr('disabled');
+ $('.jian').removeAttr('disabled');
+ $('input').removeAttr('disabled');
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ })
+ $('.con_').on('tap', '.jian', function() {
+ var that = $(this);
+ var cartId = $(this).parent().attr('data-cartId')
+ var num = +$(this).siblings('input').val() - 1;
+ if (num <= 0) {
+ mui.alert('购买数最小为1!');
+ return;
+ }
+ $('.jia').attr('disabled', 'disabled');
+ $('.jian').attr('disabled', 'disabled');
+ $('input').attr('disabled', 'disabled');
+ mui.ajax(qlgUrl('app/carts/changeCartGoods'), {
+ data: {
+ id: cartId,
+ buyNum: num
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功;
+ var data = toJson(data, 1);
+ that.siblings('input').val(num);
+ $('.jia').removeAttr('disabled');
+ $('.jian').removeAttr('disabled');
+ $('input').removeAttr('disabled');
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ })
+ $('.con_').on('blur', 'input', function() {
+ var that = $(this);
+ var cartId = $(this).parent().attr('data-cartId')
+ var num = +$(this).val();
+ if (num <= 0) {
+ mui.alert('购买数最小为1!');
+ return;
+ }
+ $('.jia').attr('disabled', 'disabled');
+ $('.jian').attr('disabled', 'disabled');
+ $('input').attr('disabled', 'disabled');
+ mui.ajax(qlgUrl('app/carts/changeCartGoods'), {
+ data: {
+ from: from_id,
+ id: cartId,
+ buyNum: num
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功;
+ var data = toJson(data, 1);
+ that.siblings('input').val(num);
+ $('.jia').removeAttr('disabled');
+ $('.jian').removeAttr('disabled');
+ $('input').removeAttr('disabled');
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ })
+
+ $('.con_').on('tap', '.b_con_r2_del', function() {
+ var cartId = $(this).attr('data-cartId');
+
+ if (confirm('确定删除?')) {
+ mui.ajax(hyhUrl('app/carts/delCart'), {
+ data: {
+ from: from_id,
+ id: cartId
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功;
+ var data = toJson(data, 1);
+ location.reload();
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ }
+ })
+
+ // $('.changeclass').on('tap', '.selectclass', function() {
+ // $('.mui-backdrop').show();
+ // })
+
+ //选择类型
+ // $('.cclass1').on('tap', '.block', function() {
+ // $(this).addClass('on').siblings().removeClass('on');
+ // $(this).parent().attr('data-class', $(this).html());
+ // })
+
+ // $('.closecclass').on('tap', function() {
+ // $('.mui-backdrop').css('display', 'none');
+ // })
+
+ // $('.ensure').on('tap', function() {
+ // $('.mui-backdrop').css('display', 'none');
+ // })
+
+ mui('.js').on('tap', '.btn_tj', function() {
+ var check_length = $('.con_ .check_1').length;
+ if (check_length == 0) {
+ mui.alert('请选择商品结算!');
+ return;
+ }
+ mui.openWindow({
+ url: 'confirmOrder.html',
+ id: 'confirmOrder.html',
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ // data_id: data_id
+ type: 0,
+ from: from_id
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+
+ setTimeout(function() {
+ JZL.closeWindow(plus.webview.currentWebview().id);
+ }, 1000)
+ })
+ document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
+ if (scroll.y == scroll.maxScrollY) {
+ if (isOver == 1) {
+ num++;
+ getMsg(num, 10);
+ }
+ }
+ })
})
diff --git a/static/app2/js/shopsList.js b/static/app2/js/shopsList.js
old mode 100755
new mode 100644
index 874b210..f1a6fe8
--- a/static/app2/js/shopsList.js
+++ b/static/app2/js/shopsList.js
@@ -1,148 +1,148 @@
-var page = 1;
-var pagesize = 10;
-var condition = 1;
-var isjiazai = 1;
-var desc = 0;
-
-
-mui.plusReady(function() {
- var self = plus.webview.currentWebview();
- keyword = self.data_keyword;
- goodsType = self.goodsType ? self.goodsType :''
- function getData(page, pagesize, condition, keyword, desc,goodsType) {
- var data_set = {
- page: page,
- pagesize: pagesize,
- condition: condition,
- keyword: keyword,
- desc: desc,
- goodsType:goodsType
- }
- mui.ajax(qlgUrl('app/shops/pageQuery'), {
-
- data: data_set,
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // //console.log(data.data.goodsFavoritesNum)
- // //console.log(data.data.Rows)
-
- var data = toJson(data);
- data = data.data;
- var html = '';
- if (data.Rows == '') {
- $('.mui-scroll').append('
没有更多店铺
');
- isjiazai = 0;
- return;
- }
- $.each(data.Rows, function() {
- html += '
 + ')
' + this.shopName +
- '
' + this.shopCompany +
- '
进店
';
-
- $.each(this.goods, function() {
- html += '
 +
- ')
¥' + this.shopPrice + '
';
- });
- html += '
'
- });
- if (page == 1) {
- $('.con').html(html);
- } else {
- $('.con').append(html);
- }
- isjiazai = 1;
-
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // alert(type);
- }
- });
- }
-
- getData(page, pagesize, 1, keyword, 0, goodsType )
- mui('.con').on('tap', '.b_title', function() {
- var shopId = $(this).attr('data-shopId');
- var url = 'storeout.html';
- if (shopId == 1) {
- // url='self_shop.html'
- }
- mui.openWindow({
- url: url,
- id: url + shopId,
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- shopId: shopId
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
- })
- mui('.con').on('tap', '.bc_img', function() {
- var goodId = $(this).attr('data-goodId');
- mui.openWindow({
- url: 'details.html',
- id: 'details.html' + goodId,
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- data_id: goodId,
- goodsType:goodsType
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
- })
- document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
- if (scroll.y == scroll.maxScrollY) {
- if (isjiazai == 1) {
- isjiazai = 0;
- page++;
- getData(page, pagesize, 1, keyword, 0)
- }
- }
- })
+var page = 1;
+var pagesize = 10;
+var condition = 1;
+var isjiazai = 1;
+var desc = 0;
+
+
+mui.plusReady(function() {
+ var self = plus.webview.currentWebview();
+ keyword = self.data_keyword;
+ goodsType = self.goodsType ? self.goodsType :''
+ function getData(page, pagesize, condition, keyword, desc,goodsType) {
+ var data_set = {
+ page: page,
+ pagesize: pagesize,
+ condition: condition,
+ keyword: keyword,
+ desc: desc,
+ goodsType:goodsType
+ }
+ mui.ajax(qlgUrl('app/shops/pageQuery'), {
+
+ data: data_set,
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // //console.log(data.data.goodsFavoritesNum)
+ // //console.log(data.data.Rows)
+
+ var data = toJson(data);
+ data = data.data;
+ var html = '';
+ if (data.Rows == '') {
+ $('.mui-scroll').append('
没有更多店铺
');
+ isjiazai = 0;
+ return;
+ }
+ $.each(data.Rows, function() {
+ html += '
 + ')
' + this.shopName +
+ '
' + this.shopCompany +
+ '
进店
';
+
+ $.each(this.goods, function() {
+ html += '
 +
+ ')
¥' + this.shopPrice + '
';
+ });
+ html += '
'
+ });
+ if (page == 1) {
+ $('.con').html(html);
+ } else {
+ $('.con').append(html);
+ }
+ isjiazai = 1;
+
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // alert(type);
+ }
+ });
+ }
+
+ getData(page, pagesize, 1, keyword, 0, goodsType )
+ mui('.con').on('tap', '.b_title', function() {
+ var shopId = $(this).attr('data-shopId');
+ var url = 'storeout.html';
+ if (shopId == 1) {
+ // url='self_shop.html'
+ }
+ mui.openWindow({
+ url: url,
+ id: url + shopId,
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ shopId: shopId
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+ })
+ mui('.con').on('tap', '.bc_img', function() {
+ var goodId = $(this).attr('data-goodId');
+ mui.openWindow({
+ url: 'details.html',
+ id: 'details.html' + goodId,
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ data_id: goodId,
+ goodsType:goodsType
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+ })
+ document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
+ if (scroll.y == scroll.maxScrollY) {
+ if (isjiazai == 1) {
+ isjiazai = 0;
+ page++;
+ getData(page, pagesize, 1, keyword, 0)
+ }
+ }
+ })
})
diff --git a/static/app2/js/shopsetting.js b/static/app2/js/shopsetting.js
old mode 100755
new mode 100644
index 1d2e3f1..5acaa5e
--- a/static/app2/js/shopsetting.js
+++ b/static/app2/js/shopsetting.js
@@ -1,19 +1,19 @@
-mui.plusReady(function() {
-
- var self = plus.webview.currentWebview();
- //console.log(self);
- var shopId=self.id;
- var shopIdObj = {
- id: self.id
- }
- $('.row').on("tap", function() {
-
- var URL = $(this).attr("data-url");
- //console.log(URL);
- // JZL.openWindow('income-details.html', 'income-details.html')
- JZL.openWindow(URL + '.html',parseInt(shopId))
-
- })
-
-
-})
+mui.plusReady(function() {
+
+ var self = plus.webview.currentWebview();
+ //console.log(self);
+ var shopId=self.id;
+ var shopIdObj = {
+ id: self.id
+ }
+ $('.row').on("tap", function() {
+
+ var URL = $(this).attr("data-url");
+ //console.log(URL);
+ // JZL.openWindow('income-details.html', 'income-details.html')
+ JZL.openWindow(URL + '.html',parseInt(shopId))
+
+ })
+
+
+})
diff --git a/static/app2/js/start.js b/static/app2/js/start.js
old mode 100755
new mode 100644
index 2ae9c0e..e4f433e
--- a/static/app2/js/start.js
+++ b/static/app2/js/start.js
@@ -1,6 +1,6 @@
function init(data) {
- ////console.log(data.apk_version)
- // //console.log(localStorage.getItem('jsUrl'))
+ //console.log(data.apk_version)
+ // console.log(localStorage.getItem('jsUrl'))
apk_version = data.apk_version;
apkUrl = data.apk_down_url;
iosUrl = data.ios_down_url;
@@ -39,42 +39,20 @@ function init(data) {
}
});
} else if(/android/.test(ua)) {
-
if(apk_version > ver) {
if(must_update == 0) {
if(confirm("发现新版本:V" + apk_version + "是否更新")) {
- var dtask = plus.downloader.createDownload(apkUrl, {}, function(d, status) {
- if(status == 200) {
- plus.nativeUI.toast("正在准备环境,请稍后!");
- sleep(1000);
- var path = d.filename; //下载apk
- plus.runtime.install(path); // 自动安装apk文件
- } else {
- mui.alert('版本更新失败:' + status);
- }
- });
- dtask.start();
+ downloadUpdate(apkUrl)
}
} else {
if(confirm("发现新版本:V" + apk_version + "是否更新")) {
- var dtask = plus.downloader.createDownload(apkUrl, {}, function(d, status) {
- if(status == 200) {
- plus.nativeUI.toast("正在准备环境,请稍后!");
- sleep(1000);
- var path = d.filename; //下载apk
- plus.runtime.install(path); // 自动安装apk文件
- } else {
- mui.alert('版本更新失败:' + status);
- }
- });
- dtask.start();
+ downloadUpdate(apkUrl)
} else {
plus.runtime.quit();
}
}
-
} else {
- // //console.log('当前版本号已是最新');
+ // console.log('当前版本号已是最新');
return;
}
}
@@ -82,12 +60,49 @@ function init(data) {
})
})
};
-
+function downloadUpdate(apkUrl){
+ let waiting = plus.nativeUI.showWaiting("正在下载更新包");
+ var dtask = plus.downloader.createDownload(apkUrl, {}, function(d, status) {
+ if(status == 200) {
+ waiting.close()
+ plus.nativeUI.toast("正在准备环境,请稍后!");
+ var path = d.filename; //下载apk
+ plus.runtime.install(path,{},function(){
+ plus.nativeUI.alert("应用资源更新完成!",function(){
+ plus.runtime.restart();
+ });
+ },function(e){
+ plus.nativeUI.alert("更新失败["+e.code+"]:"+e.message);
+ }); // 自动安装apk文件
+ } else {
+ waiting.setTitle("下载失败")
+ setTimeout(function(){waiting.close()}, 2000)
+ mui.alert('版本更新失败:' + status);
+ }
+ });
+ dtask.start();
+ dtask.addEventListener("statechanged",function(download, status) {
+ if(download.state != 4){
+ var text = "("+(download.downloadedSize*100/download.totalSize).toFixed(2)+"%)"
+ waiting.setTitle('正在下载'+text)
+ }
+ if(download.state == 4){
+ // 下载完成
+ if(status == 200){
+ waiting.close()
+ }else{
+ waiting.setTitle("下载失败")
+ setTimeout(function(){waiting.close()}, 2000)
+ }
+ console.log("Download success: " + download.getFileName());
+ }
+ },false)
+}
function jumpPage(ipxSizeBottom) {
//跳转页面
var bSize = 50 + (+ipxSizeBottom) + 'px';
- var subpages = ['templete/home.html', 'templete/shops.html', '', 'templete/zhuweiba.html',
+ var subpages = ['templete/home.html', 'templete/shops.html', 'templete/zhugouba.html', 'templete/zhuweiba.html',
'templete/my.html'
];
var subpage_style = {
@@ -102,13 +117,15 @@ function jumpPage(ipxSizeBottom) {
window.addEventListener('refresh', function(e) {
var my = plus.webview.getWebviewById('templete/my.html'); //触发父页面的自定义事件(refresh),从而进行刷新
var zhuweiba = plus.webview.getWebviewById('templete/zhuweiba.html'); //触发父页面的自定义事件(refresh),从而进行刷新
+ var zhugouba = plus.webview.getWebviewById('templete/zhugouba.html'); //触发父页面的自定义事件(refresh),从而进行刷新
mui.fire(my, 'refresh');
mui.fire(zhuweiba, 'refresh');
+ mui.fire(zhugouba, 'refresh');
})
// launchScreen();
plus.screen.lockOrientation("portrait-primary");
// plus.navigator.setStatusBarStyle('dark');
- // //console.log(plus.navigator.getStatusBarStyle())
+ // console.log(plus.navigator.getStatusBarStyle())
var self = plus.webview.currentWebview();
for (var i = 0; i < subpages.length; i++) {
var temp = {};
@@ -159,7 +176,41 @@ function jumpPage(ipxSizeBottom) {
if (targetTab == 'templete/zhuweiba.html') {
var targetTab = plus.webview.getWebviewById(targetTab);
- mui.fire(targetTab, 'refresh');
+ mui.fire(targetTab, 'refresh');
+ var token = localStorage.getItem("token");
+ if (!token) {
+ mui.openWindow({
+ url: 'templete/login.html',
+ id: 'templete/login.html',
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ // data_href: data_href
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+ }
}
if (targetTab == 'templete/my.html') {
var targetTab = plus.webview.getWebviewById(targetTab);
@@ -175,13 +226,26 @@ function jumpPage(ipxSizeBottom) {
width: '100%', //新页面宽度,默认为100%
height: '100%' //新页面高度,默认为100%
},
- extras: {},
- createNew: false,
- show: {},
+ extras: {
+ // data_href: data_href
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
waiting: {
autoShow: true, //自动显示等待框,默认为true
title: '正在加载...', //等待对话框上显示的提示内容
- options: {}
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
}
})
}
@@ -190,17 +254,20 @@ function jumpPage(ipxSizeBottom) {
}
function nav(num) {
-//console.log(num);
$('.mui-tab-item span .img').each(function(a) {
-
- if (a == 2) {
-
- } else if (num == a && a != 2) {
- // //console.log(a);
- $(this).attr('src', 'http://img.zgqlg.com.cn/static/app2/img/nav_' + a + '_1.png?version='+localStorage.getItem('version'));
+ if (num == a) {
+ if(a == 2){
+ $(this).attr('src', './img/2_1.png');
+ }else{
+ $(this).attr('src', 'http://img.zgqlg.com.cn/static/app2/img/nav_' + a + '_1.png?version='+localStorage.getItem('version'));
+ }
} else {
- $(this).attr('src', 'http://img.zgqlg.com.cn/static/app2/img/nav_' + a + '_0.png?version='+localStorage.getItem('version'));
- }
+ if(a == 2){
+ $(this).attr('src', './img/2_0.png');
+ }else{
+ $(this).attr('src', 'http://img.zgqlg.com.cn/static/app2/img/nav_' + a + '_0.png?version='+localStorage.getItem('version'));
+ }
+ }
})
}
@@ -222,6 +289,7 @@ document.addEventListener('plusready', function() {
}, false);
// 判断启动方式
function checkArguments() {
+ // console.log("plus.runtime.launcher: " + plus.runtime.launcher);
var args = plus.runtime.arguments;
if (args) {
// 处理args参数,如打开新页面等
@@ -229,7 +297,7 @@ function checkArguments() {
var id;
var datago = {};
var arrgo = args.slice(args.indexOf('//') + 2).split(': ');
- // //console.log(args.slice(args.indexOf('//')+2).split(':'))
+ // console.log(args.slice(args.indexOf('//')+2).split(':'))
if (arrgo[0] == 'goods_id') {
url = 'details.html';
id = arrgo[1];
@@ -257,11 +325,21 @@ function checkArguments() {
},
extras: datago,
createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {},
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
waiting: {
autoShow: true, //自动显示等待框,默认为true
title: '正在加载...', //等待对话框上显示的提示内容
- options: {}
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
}
})
}
@@ -270,5 +348,6 @@ function checkArguments() {
// 处理从后台恢复
document.addEventListener('newintent', function() {
+ // console.log("addEventListener: newintent");
checkArguments();
}, false);
diff --git a/static/app2/js/store_commodity.js b/static/app2/js/store_commodity.js
old mode 100755
new mode 100644
index cd5fe59..76fcab5
--- a/static/app2/js/store_commodity.js
+++ b/static/app2/js/store_commodity.js
@@ -1,305 +1,309 @@
-$('.recommend_con').html('');
-var msort = 1;
-var shopId = localStorage.getItem('shopId');
-var nowpage = 1;
-var condition = 1;
-var desc = 0;
-var pagesize = 5;
-var isload = false;
-mui.init({
- pullRefresh: {
- container: '#pullrefresh',
- down: {
- style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式
- color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色
- height: '50px', //可选,默认50px.下拉刷新控件的高度,
- range: '100px', //可选 默认100px,控件可下拉拖拽的范围
- offset: '0px', //可选 默认0px,下拉刷新控件的起始位置
- // auto: true, //可选,默认false.首次加载自动上拉刷新一次
- contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容
- contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容
- contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容
- callback: pulldownRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据;
- },
- up: {
- contentrefresh: '正在加载...',
- callback: pullupRefresh
- }
- }
-});
-var count = 1;
-
-function pullupRefresh() {
- setTimeout(function() {
- // window.location.reload();
- mui('#pullrefresh').pullRefresh().endPullupToRefresh();
- nowpage += 1
- mui.ajax(qlgUrl('app/Shopping/getShopIndexGoodsList'), {
- data: {
- page: nowpage,
- PerPage: 10,
- shopId: shopId
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
-
-
- // var data = toJson(data, 1);
- if (data.status == 1) {
- //console.log(data);
-
- var html = '';
- var data = data.data;
- if (data.Rows == '') {
- // $('.recommend_con').append(
- // '
没有更多商品
');
- $('.mui-pull-caption').html("没有更多商品")
-
- return;
- }
- $.each(data.Rows, function() {
- html += '
 +
- ')
' + this.goodsName +
- '
¥' + this.shopPrice +
- ' 满减
' + this.saleNum +
- '人购买
优惠率 ' + this.discountRate +
- '%

';
- });
-
- $('#recommend_con_').append(html);
- $('.rcb_title span').each(function() {
- if ($(this).attr('data-goodsId') == 1) {
- $(this).css('display', 'none');
- }
- })
- $('.rcb_img').height($('.rcb_img').width());
- }
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- mui.alert(errorThrown);
- }
- });
- // //console.log(order_class)
- // mui.ajax(hyhUrl('app/Shops/getShopGoods'), {
- //
- // data: {
- // page: count,
- // shopId: shopId,
- // pageSize: 10,
- // msort: condition,
- // mdesc: desc
- // },
- // dataType: 'json', //服务器返回json格式数据
- // type: 'post', //HTTP请求类型
- // timeout: 10000, //超时时间设置为10秒;
- // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // // //console.log(data.data.goodsFavoritesNum)
- // // //console.log(data.data.Rows)
- //
- // var data = toJson(data);
- // data = data.data;
- // var html = '';
- // $.each(data.Rows, function() {
- // html += '
+')
自营'+this.goodsName+'
¥'+this.shopPrice+'满减
可用木吉抵扣20%货款

'
- // });
- // $('.recommend_con').append(html);
- //
- // },
- // error: function(xhr, type, errorThrown) { //异常处理;
- // // mui.alert(type);
- // }
- // });
- }, 500);
-}
-
-/**
- * 下拉刷新具体业务实现
- */
-function pulldownRefresh() {
- setTimeout(function() {
- window.location.reload();
- mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed
- }, 1500);
-}
-mui.plusReady(function() {
- var costnum = 0;
- getRecommend(nowpage, pagesize)
- $('.commoditylistnav').on('tap', '.nav_block', function() {
- page = 1;
- count = 1;
- $(this).addClass('on').siblings().removeClass('on');
- condition = $(this).attr('data-condition');
- if ($('#cost_btn').hasClass('on')) {
- costnum += 1;
- if (costnum % 2 == 1) {
- $('#cost_btn').html('价格

');
- desc = 0;
- } else if (costnum % 2 == 0) {
- $('#cost_btn').html('价格

');
- desc = 1;
- }
- } else {
- $('#cost_btn').html('价格

')
- costnum = 0;
- desc = 1
- }
- // mui.ajax(hyhUrl('app/Shops/getShopGoods'), {
- // data: {
- // shopId: shopId,
- // pageSize: 10,
- // page: 1,
- // msort: condition,
- // mdesc: desc
- // },
- // dataType: 'json', //服务器返回json格式数据
- // type: 'post', //HTTP请求类型
- // timeout: 10000, //超时时间设置为10秒;
- // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // var data = toJson(data);
- // data = data.data;
- // var html = '';
- // $.each(data.Rows, function() {
- // html += '
+')
自营'+this.goodsName+'
¥'+this.shopPrice+'满减
可用木吉抵扣20%货款

'
- // });
- // $('.recommend_con').html(html);
- // },
- // error: function(xhr, type, errorThrown) { //异常处理;
- // // mui.alert(type);
- // }
- // });
- })
- // mui.ajax(hyhUrl('app/Shops/getShopGoods'), {
- // data: {
- // shopId: shopId,
- // pageSize: 10,
- // page: 1,
- // msort: 1,
- // mdesc: 0
- // },
- // dataType: 'json', //服务器返回json格式数据
- // type: 'post', //HTTP请求类型
- // timeout: 10000, //超时时间设置为10秒;
- // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // var data = toJson(data);
- // data = data.data;
- // var html = '';
- // $.each(data.Rows, function() {
- // html += '
+')
自营'+this.goodsName+'
¥'+this.shopPrice+'满减
可用木吉抵扣20%货款

'
- // });
- // $('.recommend_con').html(html);
- // $('.recommend_con_block .img').height($('.recommend_con_block .img').width());
- //
- // // $('.recommend_con_block').height($('.recommend_con_block').width() * 266 / 198);
- // },
- // error: function(xhr, type, errorThrown) { //异常处理;
- // // mui.alert(type);
- // }
- // });
- $('.recommend_con').on('tap', '.recommend_con_block', function() {
- var good_id = $(this).attr('data-goodsId');
- mui.openWindow({
- url: 'details.html',
- id: 'details.html' + good_id,
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- data_id: good_id
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
- })
-
-
-
- function getRecommend(nowpage, pagesize) {
- var recommenddata = {
- page: nowpage ? nowpage : 1,
- PerPage: pagesize ? pagesize : 10
- }
- recommenddata.shopId = shopId
- //console.log(recommenddata);
- if (isload == true) {
- return;
- }
- isload = true
- mui.ajax(qlgUrl('app/Shopping/getShopIndexGoodsList'), {
- data: recommenddata,
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- console.log(recommenddata);
-
- // var data = toJson(data, 1);
- if (data.status == 1) {
- console.log(data);
-
- var html = '';
- var data = data.data;
- if (data.Rows == '') {
- $('.recommend_con').append(
- '
没有更多商品
');
-
- return;
- }
- $.each(data.Rows, function() {
- html += '
 +
- ')
' + this.goodsName +
- '
¥' + this.shopPrice +
- ' 满减
' + this.saleNum +
- '人购买
优惠率 ' + this.discountRate +
- '%

';
- });
- if (nowpage == 1) {
- //console.log(222);
- $('#recommend_con_').html(html);
- } else {
- $('#recommend_con_').append(html);
- }
- $('.rcb_title span').each(function() {
- if ($(this).attr('data-goodsId') == 1) {
- $(this).css('display', 'none');
- }
- })
- $('.rcb_img').height($('.rcb_img').width());
- } else {
- mui.alert(data.msg)
- }
- isload = false
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(errorThrown);
- }
- });
- }
-})
-
-setInterval(function() {
- $('.recommend_con_block img').height($('.recommend_con_block img').width());
- // $('.recommend_con_block').height($('.recommend_con_block').width() * 266 / 198);
+$('.recommend_con').html('');
+var msort = 1;
+var shopId = localStorage.getItem('shopId');
+var nowpage = 1;
+var condition = 1;
+var desc = 0;
+var pagesize = 5;
+var isload = false;
+mui.init({
+ pullRefresh: {
+ container: '#pullrefresh',
+ down: {
+ style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式
+ color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色
+ height: '50px', //可选,默认50px.下拉刷新控件的高度,
+ range: '100px', //可选 默认100px,控件可下拉拖拽的范围
+ offset: '0px', //可选 默认0px,下拉刷新控件的起始位置
+ // auto: true, //可选,默认false.首次加载自动上拉刷新一次
+ contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容
+ contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容
+ contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容
+ callback: pulldownRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据;
+ },
+ up: {
+ contentrefresh: '正在加载...',
+ callback: pullupRefresh
+ }
+ }
+});
+var count = 1;
+
+function pullupRefresh() {
+ setTimeout(function() {
+ // window.location.reload();
+ mui('#pullrefresh').pullRefresh().endPullupToRefresh();
+ nowpage += 1
+ mui.ajax(qlgUrl('app/Shopping/getShopIndexGoodsList'), {
+ data: {
+ from_id,
+ page: nowpage,
+ PerPage: 10,
+ shopId: shopId
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+
+
+ // var data = toJson(data, 1);
+ if (data.status == 1) {
+ //console.log(data);
+
+ var html = '';
+ var data = data.data;
+ if (data.Rows == '') {
+ // $('.recommend_con').append(
+ // '
没有更多商品
');
+ $('.mui-pull-caption').html("没有更多商品")
+
+ return;
+ }
+ $.each(data.Rows, function() {
+ html += '
 +
+ ')
' + this.goodsName +
+ '
¥' + this.shopPrice +
+ ' 满减
' + this.saleNum +
+ '人购买
优惠率 ' + this.discountRate +
+ '%

';
+ });
+
+ $('#recommend_con_').append(html);
+ $('.rcb_title span').each(function() {
+ if ($(this).attr('data-goodsId') == 1) {
+ $(this).css('display', 'none');
+ }
+ })
+ $('.rcb_img').height($('.rcb_img').width());
+ }
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ mui.alert(errorThrown);
+ }
+ });
+ // //console.log(order_class)
+ // mui.ajax(hyhUrl('app/Shops/getShopGoods'), {
+ //
+ // data: {
+ // page: count,
+ // shopId: shopId,
+ // pageSize: 10,
+ // msort: condition,
+ // mdesc: desc
+ // },
+ // dataType: 'json', //服务器返回json格式数据
+ // type: 'post', //HTTP请求类型
+ // timeout: 10000, //超时时间设置为10秒;
+ // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // // //console.log(data.data.goodsFavoritesNum)
+ // // //console.log(data.data.Rows)
+ //
+ // var data = toJson(data);
+ // data = data.data;
+ // var html = '';
+ // $.each(data.Rows, function() {
+ // html += '
+')
自营'+this.goodsName+'
¥'+this.shopPrice+'满减
可用木吉抵扣20%货款

'
+ // });
+ // $('.recommend_con').append(html);
+ //
+ // },
+ // error: function(xhr, type, errorThrown) { //异常处理;
+ // // mui.alert(type);
+ // }
+ // });
+ }, 500);
+}
+
+/**
+ * 下拉刷新具体业务实现
+ */
+function pulldownRefresh() {
+ setTimeout(function() {
+ window.location.reload();
+ mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed
+ }, 1500);
+}
+mui.plusReady(function() {
+ var costnum = 0;
+ var self = plus.webview.currentWebview();
+ from_id = self.from_id?self.from_id:0;
+ getRecommend(nowpage, pagesize)
+ $('.commoditylistnav').on('tap', '.nav_block', function() {
+ page = 1;
+ count = 1;
+ $(this).addClass('on').siblings().removeClass('on');
+ condition = $(this).attr('data-condition');
+ if ($('#cost_btn').hasClass('on')) {
+ costnum += 1;
+ if (costnum % 2 == 1) {
+ $('#cost_btn').html('价格

');
+ desc = 0;
+ } else if (costnum % 2 == 0) {
+ $('#cost_btn').html('价格

');
+ desc = 1;
+ }
+ } else {
+ $('#cost_btn').html('价格

')
+ costnum = 0;
+ desc = 1
+ }
+ // mui.ajax(hyhUrl('app/Shops/getShopGoods'), {
+ // data: {
+ // shopId: shopId,
+ // pageSize: 10,
+ // page: 1,
+ // msort: condition,
+ // mdesc: desc
+ // },
+ // dataType: 'json', //服务器返回json格式数据
+ // type: 'post', //HTTP请求类型
+ // timeout: 10000, //超时时间设置为10秒;
+ // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // var data = toJson(data);
+ // data = data.data;
+ // var html = '';
+ // $.each(data.Rows, function() {
+ // html += '
+')
自营'+this.goodsName+'
¥'+this.shopPrice+'满减
可用木吉抵扣20%货款

'
+ // });
+ // $('.recommend_con').html(html);
+ // },
+ // error: function(xhr, type, errorThrown) { //异常处理;
+ // // mui.alert(type);
+ // }
+ // });
+ })
+ // mui.ajax(hyhUrl('app/Shops/getShopGoods'), {
+ // data: {
+ // shopId: shopId,
+ // pageSize: 10,
+ // page: 1,
+ // msort: 1,
+ // mdesc: 0
+ // },
+ // dataType: 'json', //服务器返回json格式数据
+ // type: 'post', //HTTP请求类型
+ // timeout: 10000, //超时时间设置为10秒;
+ // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // var data = toJson(data);
+ // data = data.data;
+ // var html = '';
+ // $.each(data.Rows, function() {
+ // html += '
+')
自营'+this.goodsName+'
¥'+this.shopPrice+'满减
可用木吉抵扣20%货款

'
+ // });
+ // $('.recommend_con').html(html);
+ // $('.recommend_con_block .img').height($('.recommend_con_block .img').width());
+ //
+ // // $('.recommend_con_block').height($('.recommend_con_block').width() * 266 / 198);
+ // },
+ // error: function(xhr, type, errorThrown) { //异常处理;
+ // // mui.alert(type);
+ // }
+ // });
+ $('.recommend_con').on('tap', '.recommend_con_block', function() {
+ var good_id = $(this).attr('data-goodsId');
+ mui.openWindow({
+ url: 'details.html',
+ id: 'details.html' + good_id,
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ data_id: good_id,
+ from_id
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+ })
+
+
+
+ function getRecommend(nowpage, pagesize) {
+ var recommenddata = {
+ page: nowpage ? nowpage : 1,
+ PerPage: pagesize ? pagesize : 10
+ }
+ recommenddata.shopId = shopId
+ //console.log(recommenddata);
+ if (isload == true) {
+ return;
+ }
+ isload = true
+ mui.ajax(qlgUrl('app/Shopping/getShopIndexGoodsList'), {
+ data: recommenddata,
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ console.log(recommenddata);
+
+ // var data = toJson(data, 1);
+ if (data.status == 1) {
+ console.log(data);
+
+ var html = '';
+ var data = data.data;
+ if (data.Rows == '') {
+ $('.recommend_con').append(
+ '
没有更多商品
');
+
+ return;
+ }
+ $.each(data.Rows, function() {
+ html += '
 +
+ ')
' + this.goodsName +
+ '
¥' + this.shopPrice +
+ ' 满减
' + this.saleNum +
+ '人购买
优惠率 ' + this.discountRate +
+ '%

';
+ });
+ if (nowpage == 1) {
+ //console.log(222);
+ $('#recommend_con_').html(html);
+ } else {
+ $('#recommend_con_').append(html);
+ }
+ $('.rcb_title span').each(function() {
+ if ($(this).attr('data-goodsId') == 1) {
+ $(this).css('display', 'none');
+ }
+ })
+ $('.rcb_img').height($('.rcb_img').width());
+ } else {
+ mui.alert(data.msg)
+ }
+ isload = false
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(errorThrown);
+ }
+ });
+ }
+})
+
+setInterval(function() {
+ $('.recommend_con_block img').height($('.recommend_con_block img').width());
+ // $('.recommend_con_block').height($('.recommend_con_block').width() * 266 / 198);
}, 100)
diff --git a/static/app2/js/store_home.1.js b/static/app2/js/store_home.1.js
old mode 100755
new mode 100644
index b907f33..2a7d54f
--- a/static/app2/js/store_home.1.js
+++ b/static/app2/js/store_home.1.js
@@ -1,306 +1,309 @@
-$('.recommend_title img').eq(0).attr('src', hyhImgUrl('static/app2/img/goods_title.png'));
-$('.recommend_title img').eq(1).attr('src', hyhImgUrl('static/app2/img/coupon_title.png'));
-$('.recommend_title img').eq(0).css('display', 'none');
-$('.recommend_title img').eq(1).css('display', 'none');
-var shopId = localStorage.getItem('shopId');
-mui.plusReady(function() {
- // var data = JSON.parse(localStorage.getItem('shop_data'));
- // var Intent = plus.android.importClass("android.content.Intent");
- // //console.log(Intent)
- //
- mui.ajax(ectUrl('app/Shops/getHome'), {
- data: {
- shopId: shopId
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
-
- if (data.status == 1) {
- var data = data.data;
- if (data.shop.shopAds.length > 0) {
- var html = '';
- $.each(data.shop.shopAds, function() {
- html += '
 + ')
'
- });
- $('#top_banner .swiper-wrapper').html(html);
- var swiper = new Swiper('#top_banner', {
- pagination: '#top_banner_pagination',
- spaceBetween: 0,
- loop: true,
- autoplay: 3500,
- autoplayDisableOnInteraction: false
- });
- $('#top_banner').height($('#top_banner').width() * 420 / 715);
- $('#top_banner img').height($('#top_banner img').width() * 420 / 715);
- } else {
- $('#top_banner').remove()
- }
-
- if (data.couponList.coupons.length > 0) {
- var html_ = '';
- $.each(data.couponList.coupons, function(num) {
- html_ += '
 + '.png') +
- ')
点击领取
满' + this.useMoney + '使用
' + this.couponValue +
- '
'
- });
- $('#timer_swiper .swiper-wrapper').html(html_);
- $('.recommend_title img').eq(0).css('display', 'block');
- var swiper = new Swiper('#timer_swiper', {
- slidesPerView: 2.3,
- paginationClickable: true,
- spaceBetween: 0,
- freeMode: true
- });
- $('#timer_swiper .swiper-slide img').height($('#timer_swiper .swiper-slide img').width() * 140 / 300);
- $('#timer_swiper .swiper-slide').height($('#timer_swiper .swiper-slide').width() * 190 / 300);
- } else {
- $('.time').css('display', 'none');
- }
-
- // var html3 = '';
- // $.each(data.shopcats, function() {
- // html3 += '
' + this.catName + '
';
- // });
- // $('.label').html(html3);
- // $('.l_block').each(function(num) {
- // if((num + 1) % 4 == 0) {
- // $(this).addClass('lbrr');
- // }
- // })
- var html4 = '';
- if (data.rec == '') {
- $('.recommend_title').eq(1).css('display', 'none');
- } else {
- $.each(data.rec, function() {
- html4 += '
 +
- ')
自营' + this.goodsName +
- '
¥' + this.shopPrice +
- '满减
可用木吉抵扣20%货款

'
- });
- $('.recommend_con').html(html4);
- $('.recommend_title img').eq(1).css('display', 'block');
- $('.rcb_img').height($('.rcb_img').width())
- }
- } else {
- mui.alert(data.msg)
- }
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- //领取优惠券
- $('.time').on('tap', '.home_yhj', function() {
- var couponId = $(this).attr('data-couponId');
- mui.ajax(hyhUrl('addon/coupon-Coupons-receive'), {
- // headers: {
- // "HYH-Token": token
- // },
- data: {
- couponId: couponId
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
-
- var data = toJson(data);
- mui.alert(data.msg);
-
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- })
- $('.recommend_con').on('tap', '.recommend_con_block', function() {
- var good_id = $(this).attr('data-goodsId');
- mui.openWindow({
- url: 'details.html',
- id: 'details.html' + good_id,
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- data_id: good_id
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
- })
- localStorage.setItem('shop_data', '');
-})
-
-setInterval(function() {
- $('.cnxh_block img').height($('.cnxh_block img').width());
- $('.cnxh_block').height($('.cnxh_block').width() * 266 / 198);
-}, 200)
-
-var scheme = "";
-var arr = [];
-var title = {};
-$('.go').on("tap", function() {
- if (0 == arr.length) {
- //console.log(111)
- }
- //底部弹出选择地图软件
- plus.nativeUI.actionSheet({
- title: "请选择!",
- cancel: "取消",
- buttons: arr
- }, function(e) {
- var title = arr[e.index - 1].title;
- // var i1 = new Intent();
- switch (title) {
- case "百度地图":
- // plus.runtime.openURL( "baidumap://map/direction?origin=latlng:39.98871,116.43234|name:我的位置&destination=40.007623,116.360582&mode=driving&src=webapp.navi.hanguosoft.yinyijianghu", function(error){ alert("打开百度地图失败")});
- launchTest()
-// if (plus.os.name == "Android") {
-// plus.runtime.launchApplication({
-// pname: "com.android.browser",
-// extra: {
-// // url: "://map/direction?origin=latlng:33,33|name:我的位置&destination=latlng:43.335,39.966|name:beijing&mode=driving",
-// // url:"://map/direction?destination=latlng:33,44|name:geijign&mode=driving&" + // 导航路线方式
-// // "region=武汉"
-//
-// url:"http://www.html5plus.org"
-//
-// // url :"baidumap://map/direction?origin=name:对外经贸大学|latlng:39.98871,116.43234&destination=西直门&coord_type=bd09ll&mode=transit"
-// // url : "http://api.map.baidu.com/direction?origin=latlng:42.111,111|name:当前位置&destination=latlng:31,111|name:终点&mode=driving®ion=中国&output=html"
-// }
-// }, function(e) {
-// alert("Open system default browser failed: " + e.message);
-//
-// });
-// } else if (plus.os.name == "iOS") {
-// plus.runtime.launchApplication({
-// action: "://map/direction?origin=latlng:114,33|name:我的位置&destination=latlng:116.335, 39.966|name:beijing&mode=driving"//"第三方提供的uri"
-// }, function(e) {
-// alert("Open system default browser failed: " + e.message);
-// });
-// }
- break;
- case "高德地图":
-
- }
- });
-
-
-
-})
-var maps=[{pname:'com.baidu.BaiduMap',action:'baidumap',name:'百度地图'},{pname:'com.autonavi.minimap',action:'iosamap',name:'高德地图'},{pname:'com.google.android.apps.maps',action:'com.google.android.apps.maps',name:'谷歌地图'},{pname:'com.tencent.map',action:'com.google.android.apps.maps',name:'腾讯地图'}]
-// checkApp("com.baidu.BaiduMap", "baidumap", "百度地图")
-// checkApp("com.autonavi.minimap", "iosamap", "高德地图")
-// checkApp("com.google.android.apps.maps", "com.google.android.apps.maps", "谷歌地图")
-// 判断地图软件是否安装
-// maps= toJson(maps)
-// //console.log(maps)
-// $.each(maps,function(i,v){
-//
-// var that=this
-//
-// checkApp(that.pname, that.action, that.name)
-// })
-// function checkApp(pn, ac, name) {
-// if (plus.runtime.isApplicationExist({
-// pname: pn,//包名
-// action: ac //ios包名
-// })) {
-// // //console.log("微信应用已安装");
-// title = {
-// title: name
-// };
-// arr.push(title)
-// } else {
-// // //console.log("微信应用未安装");
-// // title={};
-// // arr.push(title)
-//
-// }
-// }
-
-function launchTest() {
- if (plus.os.name == "Android") {
- plus.runtime.launchApplication( {pname:"com.baidu.BaiduMap"
- ,extra:{url:"://map/direction?origin=name:对外经贸大学|latlng:39.98871,116.43234&destination=西直门&coord_type=bd09ll&mode=transit&sy=3&index=0&target=1&src=andr.baidu.openAPIdemo"}}, function ( e ) {
- alert( "Open system default browser failed: " + e.message );})
-// plus.runtime.launchApplication({
-//
-// pname: "com.baidu.BaiduMap",
-// // pname: "bdapp",
-//
-// // http://uri.amap.com/navigation?from=" + fromLongitude + "," + fromLatitude + "&to="+ longitude + "," + latitude + "&mode=car&src=nyx_super;
-//
-// extra: {
-// url:"baidumap://map/bikenavi?origin=39.98871,116.43234&destination=39.91441,116.40405&coord_type=bd09ll&src=andr.baidu.openAPIdemo"
-// // url:"bdapp://map/direction?destination=latlng:31,111|name:终点&mode=driving®ion=中国&src=andr.baidu.openAPIdemo"
-// // url:"http://baidu.com"
-// // url:"com.baidu.BaiduMap://map/direction?origin=中关村&destination=五道口&mode=driving®ion=北京 "
-// // url: "://map/direction?origin=latlng:114,33|name:我的位置&destination=latlng:116.335,39.966|name:beijing&mode=driving"
-// }
-// }, function(e) {
-// alert("Open system default browser failed: " + e.message);
-//
-// });
- } else if (plus.os.name == "iOS") {
- plus.runtime.launchApplication({
- action: "第三方提供的uri"
- }, function(e) {
- alert("Open system default browser failed: " + e.message);
- });
- }
-}
-
- launchTest()
-
-
-
-
-
-
-mui('.gothere').on("tap", ".gt_con", function(e) {
- var idx = $(this).index();
- var html = '';
-
- switch (idx) {
- case 0:
-
- break;
- case 1:
-
- break;
- case 2:
- // $('.gt_con_con1').css('display','none')
-
- $('.gt_con_con').toggle()
- html =
- '
'
- $('.row .name').css("width", "60%")
- $('.gt_con_con').html(html)
- break;
-
- }
-})
+$('.recommend_title img').eq(0).attr('src', hyhImgUrl('static/app2/img/goods_title.png'));
+$('.recommend_title img').eq(1).attr('src', hyhImgUrl('static/app2/img/coupon_title.png'));
+$('.recommend_title img').eq(0).css('display', 'none');
+$('.recommend_title img').eq(1).css('display', 'none');
+var shopId = localStorage.getItem('shopId');
+mui.plusReady(function() {
+ // var data = JSON.parse(localStorage.getItem('shop_data'));
+ // var Intent = plus.android.importClass("android.content.Intent");
+ // //console.log(Intent)
+ //
+ var self = plus.webview.currentWebview();
+ from_id = self.from_id?self.from_id:0;
+ mui.ajax(ectUrl('app/Shops/getHome'), {
+ data: {
+ shopId: shopId
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+
+ if (data.status == 1) {
+ var data = data.data;
+ if (data.shop.shopAds.length > 0) {
+ var html = '';
+ $.each(data.shop.shopAds, function() {
+ html += '
 + ')
'
+ });
+ $('#top_banner .swiper-wrapper').html(html);
+ var swiper = new Swiper('#top_banner', {
+ pagination: '#top_banner_pagination',
+ spaceBetween: 0,
+ loop: true,
+ autoplay: 3500,
+ autoplayDisableOnInteraction: false
+ });
+ $('#top_banner').height($('#top_banner').width() * 420 / 715);
+ $('#top_banner img').height($('#top_banner img').width() * 420 / 715);
+ } else {
+ $('#top_banner').remove()
+ }
+
+ if (data.couponList.coupons.length > 0) {
+ var html_ = '';
+ $.each(data.couponList.coupons, function(num) {
+ html_ += '
 + '.png') +
+ ')
点击领取
满' + this.useMoney + '使用
' + this.couponValue +
+ '
'
+ });
+ $('#timer_swiper .swiper-wrapper').html(html_);
+ $('.recommend_title img').eq(0).css('display', 'block');
+ var swiper = new Swiper('#timer_swiper', {
+ slidesPerView: 2.3,
+ paginationClickable: true,
+ spaceBetween: 0,
+ freeMode: true
+ });
+ $('#timer_swiper .swiper-slide img').height($('#timer_swiper .swiper-slide img').width() * 140 / 300);
+ $('#timer_swiper .swiper-slide').height($('#timer_swiper .swiper-slide').width() * 190 / 300);
+ } else {
+ $('.time').css('display', 'none');
+ }
+
+ // var html3 = '';
+ // $.each(data.shopcats, function() {
+ // html3 += '
' + this.catName + '
';
+ // });
+ // $('.label').html(html3);
+ // $('.l_block').each(function(num) {
+ // if((num + 1) % 4 == 0) {
+ // $(this).addClass('lbrr');
+ // }
+ // })
+ var html4 = '';
+ if (data.rec == '') {
+ $('.recommend_title').eq(1).css('display', 'none');
+ } else {
+ $.each(data.rec, function() {
+ html4 += '
 +
+ ')
自营' + this.goodsName +
+ '
¥' + this.shopPrice +
+ '满减
可用木吉抵扣20%货款

'
+ });
+ $('.recommend_con').html(html4);
+ $('.recommend_title img').eq(1).css('display', 'block');
+ $('.rcb_img').height($('.rcb_img').width())
+ }
+ } else {
+ mui.alert(data.msg)
+ }
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ //领取优惠券
+ $('.time').on('tap', '.home_yhj', function() {
+ var couponId = $(this).attr('data-couponId');
+ mui.ajax(hyhUrl('addon/coupon-Coupons-receive'), {
+ // headers: {
+ // "HYH-Token": token
+ // },
+ data: {
+ couponId: couponId
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+
+ var data = toJson(data);
+ mui.alert(data.msg);
+
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ })
+ $('.recommend_con').on('tap', '.recommend_con_block', function() {
+ var good_id = $(this).attr('data-goodsId');
+ mui.openWindow({
+ url: 'details.html',
+ id: 'details.html' + good_id,
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ data_id: good_id,
+ from_id
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+ })
+ localStorage.setItem('shop_data', '');
+})
+
+setInterval(function() {
+ $('.cnxh_block img').height($('.cnxh_block img').width());
+ $('.cnxh_block').height($('.cnxh_block').width() * 266 / 198);
+}, 200)
+
+var scheme = "";
+var arr = [];
+var title = {};
+$('.go').on("tap", function() {
+ if (0 == arr.length) {
+ //console.log(111)
+ }
+ //底部弹出选择地图软件
+ plus.nativeUI.actionSheet({
+ title: "请选择!",
+ cancel: "取消",
+ buttons: arr
+ }, function(e) {
+ var title = arr[e.index - 1].title;
+ // var i1 = new Intent();
+ switch (title) {
+ case "百度地图":
+ // plus.runtime.openURL( "baidumap://map/direction?origin=latlng:39.98871,116.43234|name:我的位置&destination=40.007623,116.360582&mode=driving&src=webapp.navi.hanguosoft.yinyijianghu", function(error){ alert("打开百度地图失败")});
+ launchTest()
+// if (plus.os.name == "Android") {
+// plus.runtime.launchApplication({
+// pname: "com.android.browser",
+// extra: {
+// // url: "://map/direction?origin=latlng:33,33|name:我的位置&destination=latlng:43.335,39.966|name:beijing&mode=driving",
+// // url:"://map/direction?destination=latlng:33,44|name:geijign&mode=driving&" + // 导航路线方式
+// // "region=武汉"
+//
+// url:"http://www.html5plus.org"
+//
+// // url :"baidumap://map/direction?origin=name:对外经贸大学|latlng:39.98871,116.43234&destination=西直门&coord_type=bd09ll&mode=transit"
+// // url : "http://api.map.baidu.com/direction?origin=latlng:42.111,111|name:当前位置&destination=latlng:31,111|name:终点&mode=driving®ion=中国&output=html"
+// }
+// }, function(e) {
+// alert("Open system default browser failed: " + e.message);
+//
+// });
+// } else if (plus.os.name == "iOS") {
+// plus.runtime.launchApplication({
+// action: "://map/direction?origin=latlng:114,33|name:我的位置&destination=latlng:116.335, 39.966|name:beijing&mode=driving"//"第三方提供的uri"
+// }, function(e) {
+// alert("Open system default browser failed: " + e.message);
+// });
+// }
+ break;
+ case "高德地图":
+
+ }
+ });
+
+
+
+})
+var maps=[{pname:'com.baidu.BaiduMap',action:'baidumap',name:'百度地图'},{pname:'com.autonavi.minimap',action:'iosamap',name:'高德地图'},{pname:'com.google.android.apps.maps',action:'com.google.android.apps.maps',name:'谷歌地图'},{pname:'com.tencent.map',action:'com.google.android.apps.maps',name:'腾讯地图'}]
+// checkApp("com.baidu.BaiduMap", "baidumap", "百度地图")
+// checkApp("com.autonavi.minimap", "iosamap", "高德地图")
+// checkApp("com.google.android.apps.maps", "com.google.android.apps.maps", "谷歌地图")
+// 判断地图软件是否安装
+// maps= toJson(maps)
+// //console.log(maps)
+// $.each(maps,function(i,v){
+//
+// var that=this
+//
+// checkApp(that.pname, that.action, that.name)
+// })
+// function checkApp(pn, ac, name) {
+// if (plus.runtime.isApplicationExist({
+// pname: pn,//包名
+// action: ac //ios包名
+// })) {
+// // //console.log("微信应用已安装");
+// title = {
+// title: name
+// };
+// arr.push(title)
+// } else {
+// // //console.log("微信应用未安装");
+// // title={};
+// // arr.push(title)
+//
+// }
+// }
+
+function launchTest() {
+ if (plus.os.name == "Android") {
+ plus.runtime.launchApplication( {pname:"com.baidu.BaiduMap"
+ ,extra:{url:"://map/direction?origin=name:对外经贸大学|latlng:39.98871,116.43234&destination=西直门&coord_type=bd09ll&mode=transit&sy=3&index=0&target=1&src=andr.baidu.openAPIdemo"}}, function ( e ) {
+ alert( "Open system default browser failed: " + e.message );})
+// plus.runtime.launchApplication({
+//
+// pname: "com.baidu.BaiduMap",
+// // pname: "bdapp",
+//
+// // http://uri.amap.com/navigation?from=" + fromLongitude + "," + fromLatitude + "&to="+ longitude + "," + latitude + "&mode=car&src=nyx_super;
+//
+// extra: {
+// url:"baidumap://map/bikenavi?origin=39.98871,116.43234&destination=39.91441,116.40405&coord_type=bd09ll&src=andr.baidu.openAPIdemo"
+// // url:"bdapp://map/direction?destination=latlng:31,111|name:终点&mode=driving®ion=中国&src=andr.baidu.openAPIdemo"
+// // url:"http://baidu.com"
+// // url:"com.baidu.BaiduMap://map/direction?origin=中关村&destination=五道口&mode=driving®ion=北京 "
+// // url: "://map/direction?origin=latlng:114,33|name:我的位置&destination=latlng:116.335,39.966|name:beijing&mode=driving"
+// }
+// }, function(e) {
+// alert("Open system default browser failed: " + e.message);
+//
+// });
+ } else if (plus.os.name == "iOS") {
+ plus.runtime.launchApplication({
+ action: "第三方提供的uri"
+ }, function(e) {
+ alert("Open system default browser failed: " + e.message);
+ });
+ }
+}
+
+ launchTest()
+
+
+
+
+
+
+mui('.gothere').on("tap", ".gt_con", function(e) {
+ var idx = $(this).index();
+ var html = '';
+
+ switch (idx) {
+ case 0:
+
+ break;
+ case 1:
+
+ break;
+ case 2:
+ // $('.gt_con_con1').css('display','none')
+
+ $('.gt_con_con').toggle()
+ html =
+ '
'
+ $('.row .name').css("width", "60%")
+ $('.gt_con_con').html(html)
+ break;
+
+ }
+})
diff --git a/static/app2/js/store_home.js b/static/app2/js/store_home.js
old mode 100755
new mode 100644
index 71a50ab..69dfc11
--- a/static/app2/js/store_home.js
+++ b/static/app2/js/store_home.js
@@ -1,351 +1,352 @@
-$('.recommend_title img').eq(0).attr('src', hyhImgUrl('static/app2/img/goods_title.png'));
-$('.recommend_title img').eq(1).attr('src', hyhImgUrl('static/app2/img/coupon_title.png'));
-$('.recommend_title img').eq(0).css('display', 'none');
-$('.recommend_title img').eq(1).css('display', 'none');
- var shopId = localStorage.getItem('shopId');
- var shopLat = localStorage.getItem('shopLat');
- var shopLng = localStorage.getItem('shopLng');
- var shopName = localStorage.getItem('shopName');
- var phone = localStorage.getItem('phone');
- var userName = localStorage.getItem('userName');
-mui.plusReady(function() {
- // var data = JSON.parse(localStorage.getItem('shop_data'));
-var self = plus.webview.currentWebview();
- var userLat='';
- var userLng='';
- var scheme = "";
- var arr = [];
- var title = {};
- var shopAddress="";
- // 加载地图
- getLocation(function(data) {
- // console.log(data);
- if (1 == data.status) {
- $('#lng').val(data.lng);
- $('#lat').val(data.lat);
- getMap(shopLng, shopLat)
- // //console.log(JSON.stringify(data));
- } else {
- mui.alert(data.errStr);
- return;
- }
- });
- $.getJSON('http://api.map.baidu.com/geocoder/v2/?ak=Zm7kae5pzZogp8a0uwIOlyyz&callback=?&location='+shopLat+','+shopLng+'&output=json&pois=1',function(res){
- // //console.log(res);
- //addressComponent => {city: "广州市", district: "天河区", province: "广东省", street: "广州大道", street_number: "中922号-之101-128"}
- // //console.log(res.result.addressComponent.city)
- $(".shopAddress").html(res.result.formatted_address);
- // $("#location-r").html(res.result.addressComponent.city);
-
- })
-// $.getScript('http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js',function(){
-// alert(remote_ip_info.country);//国家
-// alert(remote_ip_info.province);//省份
-// alert(remote_ip_info.city);//城市
-// });
-// 获取用户地址
-
-plus.geolocation.getCurrentPosition(function (p) {
- //console.log(p.coords.latitude);
- //console.log(p.coords.longitude);
-userLat=p.coords.latitude;
-userLng=p.coords.longitude
-},function (err) {
-
-})
-// mui.ajax(ectUrl('app/Shops/getHome'), {
-// data: {
-// shopId: shopId
-// },
-// dataType: 'json', //服务器返回json格式数据
-// type: 'post', //HTTP请求类型
-// timeout: 10000, //超时时间设置为10秒;
-// success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
-//
-// if (data.status == 1) {
-// var data = data.data;
-// if (data.shop.shopAds.length > 0) {
-// var html = '';
-// $.each(data.shop.shopAds, function() {
-// html += '
 + ')
'
-// });
-// $('#top_banner .swiper-wrapper').html(html);
-// var swiper = new Swiper('#top_banner', {
-// pagination: '#top_banner_pagination',
-// spaceBetween: 0,
-// loop: true,
-// autoplay: 3500,
-// autoplayDisableOnInteraction: false
-// });
-// $('#top_banner').height($('#top_banner').width() * 420 / 715);
-// $('#top_banner img').height($('#top_banner img').width() * 420 / 715);
-// } else {
-// $('#top_banner').remove()
-// }
-//
-// if (data.couponList.coupons.length > 0) {
-// var html_ = '';
-// $.each(data.couponList.coupons, function(num) {
-// html_ += '
 + '.png') +
-// ')
点击领取
满' + this.useMoney + '使用
' + this.couponValue +
-// '
'
-// });
-// $('#timer_swiper .swiper-wrapper').html(html_);
-// $('.recommend_title img').eq(0).css('display', 'block');
-// var swiper = new Swiper('#timer_swiper', {
-// slidesPerView: 2.3,
-// paginationClickable: true,
-// spaceBetween: 0,
-// freeMode: true
-// });
-// $('#timer_swiper .swiper-slide img').height($('#timer_swiper .swiper-slide img').width() * 140 / 300);
-// $('#timer_swiper .swiper-slide').height($('#timer_swiper .swiper-slide').width() * 190 / 300);
-// } else {
-// $('.time').css('display', 'none');
-// }
-//
-// // var html3 = '';
-// // $.each(data.shopcats, function() {
-// // html3 += '
' + this.catName + '
';
-// // });
-// // $('.label').html(html3);
-// // $('.l_block').each(function(num) {
-// // if((num + 1) % 4 == 0) {
-// // $(this).addClass('lbrr');
-// // }
-// // })
-// var html4 = '';
-// if (data.rec == '') {
-// $('.recommend_title').eq(1).css('display', 'none');
-// } else {
-// $.each(data.rec, function() {
-// html4 += '
 +
-// ')
自营' + this.goodsName +
-// '
¥' + this.shopPrice +
-// '满减
可用木吉抵扣20%货款

'
-// });
-// $('.recommend_con').html(html4);
-// $('.recommend_title img').eq(1).css('display', 'block');
-// $('.rcb_img').height($('.rcb_img').width())
-// }
-// } else {
-// mui.alert(data.msg)
-// }
-// },
-// error: function(xhr, type, errorThrown) { //异常处理;
-// // mui.alert(type);
-// }
-// });
- //领取优惠券
- $('.time').on('tap', '.home_yhj', function() {
- var couponId = $(this).attr('data-couponId');
- mui.ajax(hyhUrl('addon/coupon-Coupons-receive'), {
- // headers: {
- // "HYH-Token": token
- // },
- data: {
- couponId: couponId
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
-
- var data = toJson(data);
- mui.alert(data.msg);
-
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
- })
- $('.recommend_con').on('tap', '.recommend_con_block', function() {
- var good_id = $(this).attr('data-goodsId');
- mui.openWindow({
- url: 'details.html',
- id: 'details.html' + good_id,
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- data_id: good_id
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
- })
- localStorage.setItem('shop_data', '');
-
-
- setInterval(function() {
- $('.cnxh_block img').height($('.cnxh_block img').width());
- $('.cnxh_block').height($('.cnxh_block').width() * 266 / 198);
- }, 200)
-
-
-
-
-
- $('.go').on("tap", function() {
- isHasApp()
- })
-
-
- var maps = [{
- pname: 'com.baidu.BaiduMap',
- action: 'baidumap',
- name: '百度地图'
- }, {
- pname: 'com.autonavi.minimap',
- action: 'iosamap',
- name: '高德地图'
- }
- // , {
- // pname: 'com.google.android.apps.maps',
- // action: 'com.google.android.apps.maps',
- // name: '谷歌地图'
- // }
- // , {
- // pname: 'com.tencent.map',
- // action: 'com.google.android.apps.maps',
- // name: '腾讯地图'
- // },
- ]
- // checkApp("com.baidu.BaiduMap", "baidumap", "百度地图")
- // checkApp("com.autonavi.minimap", "iosamap", "高德地图")
- // checkApp("com.google.android.apps.maps", "com.google.android.apps.maps", "谷歌地图")
- // 判断地图软件是否安装
- // maps= toJson(maps)
- // //console.log(maps)
- $.each(maps, function(i, v) {//不能写进点击事件函数里 不然点击一次增加一个title
- var that = this
- checkApp(that.pname, that.action, that.name)
- })
- function isHasApp() {
- if (0 == arr.length) {
-// plus.nativeUI.confirm("没有地图软件??请安装", function(i) {
-// if (0 == i.index) {
- var startpos= bMapTransQQMap(userLng, userLat)
- var endpos = bMapTransQQMap(shopLng, shopLat)
- //console.log(userLng);
- var urlStr = encodeURI('http://uri.amap.com/navigation?from='+startpos.lng+','+startpos.lat+',startpoint&to='+endpos.lng+','+endpos.lat+',endpoint&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=0')
-plus.runtime.openURL(urlStr)
-// plus.runtime.openURL('http://uri.amap.com/navigation?from=116.43234,39.98871,当前位置&to=121,31,站点&mode=car&src=公司名称&callnative=0' // androidMarket('com.baidu.BaiduMap')
-// // }
-//
-// )
- return false
- }
- openMapApp()
- }
-
- function openMapApp() {
- //底部弹出选择地图软件
- plus.nativeUI.actionSheet({
- title: "请选择!",
- cancel: "取消",
- buttons: arr
- }, function(e) {
-
- var title = arr[e.index - 1].title;
- // var i1 = new Intent();
- switch (title) {
- case "百度地图":
- // if (plus.os.name == "Android") {
- // plus.runtime.openURL(
- // "baidumap://map/direction?origin=latlng:39.98871,116.43234|name:我的位置&destination=31.236244,121.480239&mode=driving&src=webapp.navi.hanguosoft.yinyijianghu",
- // function(error) {
- // mui.alert('打开' + title + '失败');
- // });
- // }
- goMaps(
- "baidumap://map/direction?origin=我的位置&destination="+shopLat+","+shopLng+"&mode=driving&src=webapp.navi.hanguosoft.yinyijianghu"
- )
-
- break;
- case "高德地图":
-
- var endpos = bMapTransQQMap(shopLng, shopLat)
- // plus.runtime.openURL('androidamap://navi?sourceApplication=nyx_super&lat=' + endpos.lat + '&lon=' + endpos.lng +
- // '&mode=driving®ion=www&output=html&src="全亮共"',
- // function(e) {
- // mui.alert('打开' + title + '失败');
- // })
- goMaps('androidamap://navi?sourceApplication=nyx_super&lat=' + endpos.lat + '&lon=' + endpos.lng +
- '&mode=driving®ion='+shopName+'&output=html&src="全亮共"')
-
- break;
- }
- })
- }
-
- function goMaps(url) {
- var mContext = plus.android.runtimeMainActivity();
- var Uri = plus.android.importClass('android.net.Uri');
- var Intent = plus.android.importClass('android.content.Intent');
- var intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
- mContext.startActivity(intent);
- }
-
- function checkApp(pn, ac, name) { // pname:android 包名 action:ios包名 name:用作底部弹出
-
- if (plus.runtime.isApplicationExist({
- pname: pn, //包名
- action: ac //ios包名
- })) {
- // //console.log("微信应用已安装");
- title = {
- title: name
- };
- arr.push(title)
- } else {
- // //console.log("微信应用未安装");
- // title={};
- // arr.push(title)
-
- }
- }
-
- mui('.gothere').on("tap", ".gt_con", function(e) {
- var idx = $(this).index();
- var html = '';
- switch (idx) {
- case 0:
- break;
- case 1:
- break;
- case 2:
- // $('.gt_con_con1').css('display','none')
-
- $('.gt_con_con').toggle()
- html =
- '
'
- $('.row .name').css("width", "60%")
- $('.gt_con_con').html(html)
- break;
-
- }
- })
-})
+$('.recommend_title img').eq(0).attr('src', hyhImgUrl('static/app2/img/goods_title.png'));
+$('.recommend_title img').eq(1).attr('src', hyhImgUrl('static/app2/img/coupon_title.png'));
+$('.recommend_title img').eq(0).css('display', 'none');
+$('.recommend_title img').eq(1).css('display', 'none');
+ var shopId = localStorage.getItem('shopId');
+ var shopLat = localStorage.getItem('shopLat');
+ var shopLng = localStorage.getItem('shopLng');
+ var shopName = localStorage.getItem('shopName');
+ var phone = localStorage.getItem('phone');
+ var userName = localStorage.getItem('userName');
+mui.plusReady(function() {
+ // var data = JSON.parse(localStorage.getItem('shop_data'));
+var self = plus.webview.currentWebview();
+from_id = self.from_id?self.from_id:0;
+ var userLat='';
+ var userLng='';
+ var scheme = "";
+ var arr = [];
+ var title = {};
+ var shopAddress="";
+ // 加载地图
+ getLocation(function(data) {
+ // console.log(data);
+ if (1 == data.status) {
+ $('#lng').val(data.lng);
+ $('#lat').val(data.lat);
+ getMap(shopLng, shopLat)
+ // //console.log(JSON.stringify(data));
+ } else {
+ mui.alert(data.errStr);
+ return;
+ }
+ });
+ $.getJSON('http://api.map.baidu.com/geocoder/v2/?ak=Zm7kae5pzZogp8a0uwIOlyyz&callback=?&location='+shopLat+','+shopLng+'&output=json&pois=1',function(res){
+ // //console.log(res);
+ //addressComponent => {city: "广州市", district: "天河区", province: "广东省", street: "广州大道", street_number: "中922号-之101-128"}
+ // //console.log(res.result.addressComponent.city)
+ $(".shopAddress").html(res.result.formatted_address);
+ // $("#location-r").html(res.result.addressComponent.city);
+
+ })
+// $.getScript('http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js',function(){
+// alert(remote_ip_info.country);//国家
+// alert(remote_ip_info.province);//省份
+// alert(remote_ip_info.city);//城市
+// });
+// 获取用户地址
+
+plus.geolocation.getCurrentPosition(function (p) {
+ //console.log(p.coords.latitude);
+ //console.log(p.coords.longitude);
+userLat=p.coords.latitude;
+userLng=p.coords.longitude
+},function (err) {
+
+})
+// mui.ajax(ectUrl('app/Shops/getHome'), {
+// data: {
+// shopId: shopId
+// },
+// dataType: 'json', //服务器返回json格式数据
+// type: 'post', //HTTP请求类型
+// timeout: 10000, //超时时间设置为10秒;
+// success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+//
+// if (data.status == 1) {
+// var data = data.data;
+// if (data.shop.shopAds.length > 0) {
+// var html = '';
+// $.each(data.shop.shopAds, function() {
+// html += '
 + ')
'
+// });
+// $('#top_banner .swiper-wrapper').html(html);
+// var swiper = new Swiper('#top_banner', {
+// pagination: '#top_banner_pagination',
+// spaceBetween: 0,
+// loop: true,
+// autoplay: 3500,
+// autoplayDisableOnInteraction: false
+// });
+// $('#top_banner').height($('#top_banner').width() * 420 / 715);
+// $('#top_banner img').height($('#top_banner img').width() * 420 / 715);
+// } else {
+// $('#top_banner').remove()
+// }
+//
+// if (data.couponList.coupons.length > 0) {
+// var html_ = '';
+// $.each(data.couponList.coupons, function(num) {
+// html_ += '
 + '.png') +
+// ')
点击领取
满' + this.useMoney + '使用
' + this.couponValue +
+// '
'
+// });
+// $('#timer_swiper .swiper-wrapper').html(html_);
+// $('.recommend_title img').eq(0).css('display', 'block');
+// var swiper = new Swiper('#timer_swiper', {
+// slidesPerView: 2.3,
+// paginationClickable: true,
+// spaceBetween: 0,
+// freeMode: true
+// });
+// $('#timer_swiper .swiper-slide img').height($('#timer_swiper .swiper-slide img').width() * 140 / 300);
+// $('#timer_swiper .swiper-slide').height($('#timer_swiper .swiper-slide').width() * 190 / 300);
+// } else {
+// $('.time').css('display', 'none');
+// }
+//
+// // var html3 = '';
+// // $.each(data.shopcats, function() {
+// // html3 += '
' + this.catName + '
';
+// // });
+// // $('.label').html(html3);
+// // $('.l_block').each(function(num) {
+// // if((num + 1) % 4 == 0) {
+// // $(this).addClass('lbrr');
+// // }
+// // })
+// var html4 = '';
+// if (data.rec == '') {
+// $('.recommend_title').eq(1).css('display', 'none');
+// } else {
+// $.each(data.rec, function() {
+// html4 += '
 +
+// ')
自营' + this.goodsName +
+// '
¥' + this.shopPrice +
+// '满减
可用木吉抵扣20%货款

'
+// });
+// $('.recommend_con').html(html4);
+// $('.recommend_title img').eq(1).css('display', 'block');
+// $('.rcb_img').height($('.rcb_img').width())
+// }
+// } else {
+// mui.alert(data.msg)
+// }
+// },
+// error: function(xhr, type, errorThrown) { //异常处理;
+// // mui.alert(type);
+// }
+// });
+ //领取优惠券
+ $('.time').on('tap', '.home_yhj', function() {
+ var couponId = $(this).attr('data-couponId');
+ mui.ajax(hyhUrl('addon/coupon-Coupons-receive'), {
+ // headers: {
+ // "HYH-Token": token
+ // },
+ data: {
+ couponId: couponId
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+
+ var data = toJson(data);
+ mui.alert(data.msg);
+
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+ })
+ $('.recommend_con').on('tap', '.recommend_con_block', function() {
+ var good_id = $(this).attr('data-goodsId');
+ mui.openWindow({
+ url: 'details.html',
+ id: 'details.html' + good_id,
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ data_id: good_id
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+ })
+ localStorage.setItem('shop_data', '');
+
+
+ setInterval(function() {
+ $('.cnxh_block img').height($('.cnxh_block img').width());
+ $('.cnxh_block').height($('.cnxh_block').width() * 266 / 198);
+ }, 200)
+
+
+
+
+
+ $('.go').on("tap", function() {
+ isHasApp()
+ })
+
+
+ var maps = [{
+ pname: 'com.baidu.BaiduMap',
+ action: 'baidumap',
+ name: '百度地图'
+ }, {
+ pname: 'com.autonavi.minimap',
+ action: 'iosamap',
+ name: '高德地图'
+ }
+ // , {
+ // pname: 'com.google.android.apps.maps',
+ // action: 'com.google.android.apps.maps',
+ // name: '谷歌地图'
+ // }
+ // , {
+ // pname: 'com.tencent.map',
+ // action: 'com.google.android.apps.maps',
+ // name: '腾讯地图'
+ // },
+ ]
+ // checkApp("com.baidu.BaiduMap", "baidumap", "百度地图")
+ // checkApp("com.autonavi.minimap", "iosamap", "高德地图")
+ // checkApp("com.google.android.apps.maps", "com.google.android.apps.maps", "谷歌地图")
+ // 判断地图软件是否安装
+ // maps= toJson(maps)
+ // //console.log(maps)
+ $.each(maps, function(i, v) {//不能写进点击事件函数里 不然点击一次增加一个title
+ var that = this
+ checkApp(that.pname, that.action, that.name)
+ })
+ function isHasApp() {
+ if (0 == arr.length) {
+// plus.nativeUI.confirm("没有地图软件??请安装", function(i) {
+// if (0 == i.index) {
+ var startpos= bMapTransQQMap(userLng, userLat)
+ var endpos = bMapTransQQMap(shopLng, shopLat)
+ //console.log(userLng);
+ var urlStr = encodeURI('http://uri.amap.com/navigation?from='+startpos.lng+','+startpos.lat+',startpoint&to='+endpos.lng+','+endpos.lat+',endpoint&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=0')
+plus.runtime.openURL(urlStr)
+// plus.runtime.openURL('http://uri.amap.com/navigation?from=116.43234,39.98871,当前位置&to=121,31,站点&mode=car&src=公司名称&callnative=0' // androidMarket('com.baidu.BaiduMap')
+// // }
+//
+// )
+ return false
+ }
+ openMapApp()
+ }
+
+ function openMapApp() {
+ //底部弹出选择地图软件
+ plus.nativeUI.actionSheet({
+ title: "请选择!",
+ cancel: "取消",
+ buttons: arr
+ }, function(e) {
+
+ var title = arr[e.index - 1].title;
+ // var i1 = new Intent();
+ switch (title) {
+ case "百度地图":
+ // if (plus.os.name == "Android") {
+ // plus.runtime.openURL(
+ // "baidumap://map/direction?origin=latlng:39.98871,116.43234|name:我的位置&destination=31.236244,121.480239&mode=driving&src=webapp.navi.hanguosoft.yinyijianghu",
+ // function(error) {
+ // mui.alert('打开' + title + '失败');
+ // });
+ // }
+ goMaps(
+ "baidumap://map/direction?origin=我的位置&destination="+shopLat+","+shopLng+"&mode=driving&src=webapp.navi.hanguosoft.yinyijianghu"
+ )
+
+ break;
+ case "高德地图":
+
+ var endpos = bMapTransQQMap(shopLng, shopLat)
+ // plus.runtime.openURL('androidamap://navi?sourceApplication=nyx_super&lat=' + endpos.lat + '&lon=' + endpos.lng +
+ // '&mode=driving®ion=www&output=html&src="全亮共"',
+ // function(e) {
+ // mui.alert('打开' + title + '失败');
+ // })
+ goMaps('androidamap://navi?sourceApplication=nyx_super&lat=' + endpos.lat + '&lon=' + endpos.lng +
+ '&mode=driving®ion='+shopName+'&output=html&src="全亮共"')
+
+ break;
+ }
+ })
+ }
+
+ function goMaps(url) {
+ var mContext = plus.android.runtimeMainActivity();
+ var Uri = plus.android.importClass('android.net.Uri');
+ var Intent = plus.android.importClass('android.content.Intent');
+ var intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
+ mContext.startActivity(intent);
+ }
+
+ function checkApp(pn, ac, name) { // pname:android 包名 action:ios包名 name:用作底部弹出
+
+ if (plus.runtime.isApplicationExist({
+ pname: pn, //包名
+ action: ac //ios包名
+ })) {
+ // //console.log("微信应用已安装");
+ title = {
+ title: name
+ };
+ arr.push(title)
+ } else {
+ // //console.log("微信应用未安装");
+ // title={};
+ // arr.push(title)
+
+ }
+ }
+
+ mui('.gothere').on("tap", ".gt_con", function(e) {
+ var idx = $(this).index();
+ var html = '';
+ switch (idx) {
+ case 0:
+ break;
+ case 1:
+ break;
+ case 2:
+ // $('.gt_con_con1').css('display','none')
+
+ $('.gt_con_con').toggle()
+ html =
+ '
'
+ $('.row .name').css("width", "60%")
+ $('.gt_con_con').html(html)
+ break;
+
+ }
+ })
+})
diff --git a/static/app2/js/store_info.js b/static/app2/js/store_info.js
old mode 100755
new mode 100644
diff --git a/static/app2/js/storeout.js b/static/app2/js/storeout.js
old mode 100755
new mode 100644
index 0361f85..b5e10ea
--- a/static/app2/js/storeout.js
+++ b/static/app2/js/storeout.js
@@ -1,323 +1,325 @@
-//$('.searchcon').css('display', 'none');
-$('.title').css('width', '50%');
-$('.gz_btn').hide()
-// var data = '';
-localStorage.removeItem('shopId');
-localStorage.removeItem('shopLat');
-localStorage.removeItem('shopLng');
-localStorage.removeItem('shopName');
-localStorage.removeItem('phone');
-localStorage.removeItem('userName');
-// $('.nav').html(
-// '
首页商品上新活动'
-// );
-// $('.searchcon').html(
-// '
'
-// );
-mui.plusReady(function() {
- var self = plus.webview.currentWebview();
- var shopId = self.shopId;
- var shopName = self.shopName;
- var shopLat="";
- var shopLng='';
- var phone='';
- var userName='';
- $('.title').html(shopName)
- localStorage.setItem('shopId', shopId);
- localStorage.setItem('shopName', shopName);
-
- JZL.ajax(qlgUrl('app/shopping/getShopInfo'),{
- shopId:shopId
- },function (data) {
- // console.log(data);
- if (data.status == 1) {
- var html = '';
- var data = data.data;
- shopLat=data.lat;
- shopLng=data.lng;
- phone=data.phone;
- userName=data.userName;
- //console.log(shopLng);
- localStorage.setItem('shopLat', shopLat);
- localStorage.setItem('shopLng', shopLng);
- localStorage.setItem('phone', phone);
- localStorage.setItem('userName', userName);
- var imgs=data.shopAds.split(",");
- var firstImg = '';
- var endImg='';
- $.each(imgs, function(index,val) {
- if(index == 0) firstImg='
';
- if(index == imgs.length-1) endImg='
';
- ////console.log(val);
- html+='
';
- //html += '
 + ')
';
- });
- $('#imgsw').html(html);
- $('#imgsw').prepend(endImg);
- $('#imgsw').append(firstImg);
- var slider = mui("#slider");
- slider.slider({
- interval: 2000
- });
- //$('#top_banner .swiper-wrapper').html(html);
- // var swiper = new Swiper('#top_banner', {
- // pagination: '#top_banner_pagination',
- // spaceBetween: 0,
- // loop: true,
- // autoplay: 3500,
- // autoplayDisableOnInteraction: false
- // });
- $('#slider').height($('#slider').width() * 460 / 750);
- } else{
- mui.alert(data.msg)
- }
- })
- // mui('.search').on('tap', '.classmenu', function() {
- // shopId = this.attributes["data-shopid"].nodeValue;
- // // //console.log(this.attributes["data-id"].nodeValue);
- // mui.openWindow({
- // url: 'store_class.html',
- // id: 'store_class.html',
- // styles: {
- // top: '0px', //新页面顶部位置
- // bottom: '0px', //新页面底部位置
- // width: '100%', //新页面宽度,默认为100%
- // height: '100%' //新页面高度,默认为100%
- // },
- // extras: {
- // shopId: shopId
- // // ..... //自定义扩展参数,可以用来处理页面间传值
- // },
- // createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- // show: {
- // // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // // extras: {} //窗口动画是否使用图片加速
- // },
- // waiting: {
- // autoShow: true, //自动显示等待框,默认为true
- // title: '正在加载...', //等待对话框上显示的提示内容
- // options: {
- // // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // // ......
- // }
- // }
- // })
- // })
-// mui('.footer').on('tap', '#dpxq', function() {
-// //console.log(11);
-// var w = plus.webview.create('store_info.html');
-// w.show()
-// })
-// mui('.footer').on('tap', '#rmfl', function() {
-//
-// $('.rmfl').css('display', 'block')
-// })
- // mui('.con').on('tap', '.gz_btn', function() {
- mui('.header_con').on('tap', '.gz_btn', function() {
- // var shopId = shopId;
- var that = $(this);
- //console.log(shopId)
- mui.ajax(qlgUrl('app/Favorites/add'), {
- data: {
- id: shopId,
- type: 1
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- //console.log(data)
- // //console.log(data.data.goodsFavoritesNum)
- // //console.log(data.data.Rows)
- var data = toJson(data);
- if (data.status == 1) {
- that.html('已关注');
- that.addClass('gz_btn1').removeClass('gz_btn');
- } else {
- ////console.log(data.status)
- }
-
- },
- error: function(xhr, type, errorThrown) { //异常处理;
- // mui.alert(type);
- }
- });
-
- })
- $('.header').on('focus', '#keyword', function() {
- $(".searchcon button").css('display', 'block');
- })
- $('.header').on('blur', '#keyword', function() {
- $(".searchcon button").css('display', 'none');
- })
-
- //店铺搜索
- $(".header").on('keypress', '#keyword', function(e) {
- var keycode = e.keyCode;
- var searchName = $('#keyword').val();
- if(keycode == '13') {
- // e.preventDefault();
- // //console.log(searchName)
- //请求搜索接口
- mui.openWindow({
- url: 'shopGoodsList.html',
- id: 'shopGoodsList.html',
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- data_keyword: searchName
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
-
- }
- });
- $(".header").on('tap', '.searchcon button', function(e) {
- var searchName = $('#keyword').val();
- // e.preventDefault();
- // //console.log(searchName)
- //请求搜索接口
- mui.openWindow({
- url: 'shopGoodsList.html',
- id: 'shopGoodsList.html',
- styles: {
- top: '0px', //新页面顶部位置
- bottom: '0px', //新页面底部位置
- width: '100%', //新页面宽度,默认为100%
- height: '100%' //新页面高度,默认为100%
- },
- extras: {
- data_keyword: searchName
- // ..... //自定义扩展参数,可以用来处理页面间传值
- },
- createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- // autoShow: true, //页面loaded事件发生后自动显示,默认为true
- // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
- // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
- // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
- // extras: {} //窗口动画是否使用图片加速
- },
- waiting: {
- autoShow: true, //自动显示等待框,默认为true
- title: '正在加载...', //等待对话框上显示的提示内容
- options: {
- // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
- // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
- // ......
- }
- }
- })
-
- });
-
-})
-
-function jumpPage() {
- //跳转页面
- // var bSize = 190 + (+localStorage.getItem('ipxSizeTop')) + 'px';
- var bSize = +localStorage.getItem('topBannerheight')+42+'px';
- var subpages = ['store_home.html', 'store_commodity.html'];
- // var subpages = ['store_home.html', 'store_commodity.html', 'store_new.html', 'store_activity.html'];
- // top: bSize,
- var subpage_style = {
- top: bSize,
- bottom: '0',
- scrollIndicator: 'none'
- };
-
- var aniShow = {}; //动画显示
- //当前激活选项
- var activeTab = subpages[0];
- //选项卡点击事件
- // mui('.footer').on('tap', 'a', function(e) {
-
- mui('.nav').on('tap', 'a', function(e) {
- var targetTab = this.getAttribute('href');
- // //console.log(targetTab);
- if (targetTab == activeTab) {
- return;
- }
- //显示目标选项卡
- //若为iOS平台或非首次显示,则直接显示
- if (mui.os.ios || aniShow[targetTab]) {
- plus.webview.show(targetTab);
- } else {
- //否则,使用fade-in动画,且保存变量
- var temp = {};
- temp[targetTab] = "true";
- mui.extend(aniShow, temp);
- plus.webview.show(targetTab, "fade-in", 300);
-
- }
- //隐藏当前;
- plus.webview.hide(activeTab);
- //更改当前活跃的选项卡
- activeTab = targetTab;
-
- // var html = $(this).html();
- // html = html.substring(0, html.indexOf('.png')) + '_on.png">';
- // $(this).html(html);
- $(this).addClass('on').siblings().removeClass('on');
- // $(this).siblings().each(function() {
- // if($(this).html().indexOf('_on') == -1) {
- // return
- // }
- // html = $(this).html().substring(0, $(this).html().indexOf('_on'))
- // html = html + '.png">';
- // $(this).html(html)
- // })
- });
-
- //首次启动切滑效果
-
- mui.plusReady(function() {
- // launchScreen();
- // plus.navigator.setStatusBarStyle('dark');
- // //console.log(plus.navigator.getStatusBarStyle())
- var self = plus.webview.currentWebview();
- shopId = self.shopId;
- // console.log(shopId);
- localStorage.setItem('shopId', shopId);
-
- for (var i = 0; i < subpages.length; i++) {
- var temp = {};
- //http://www.html5plus.org/doc/zh_cn/webview.html#plus.webview.create
- var sub = plus.webview.create(subpages[i], subpages[i], subpage_style);
- if (i > 0) {
- sub.hide();
- } else {
- temp[subpages[i]] = "true";
- mui.extend(aniShow, temp); //合并对象
- }
- self.append(sub);
- }
- });
-}
-jumpPage();
-
+//$('.searchcon').css('display', 'none');
+$('.title').css('width', '50%');
+$('.gz_btn').hide()
+// var data = '';
+localStorage.removeItem('shopId');
+localStorage.removeItem('shopLat');
+localStorage.removeItem('shopLng');
+localStorage.removeItem('shopName');
+localStorage.removeItem('phone');
+localStorage.removeItem('userName');
+// $('.nav').html(
+// '
首页商品上新活动'
+// );
+// $('.searchcon').html(
+// '
'
+// );
+mui.plusReady(function() {
+ var self = plus.webview.currentWebview();
+ var shopId = self.shopId;
+ var shopName = self.shopName;
+ from_id = self.from_id?self.from_id:0
+ var shopLat="";
+ var shopLng='';
+ var phone='';
+ var userName='';
+ $('.title').html(shopName)
+ localStorage.setItem('shopId', shopId);
+ localStorage.setItem('shopName', shopName);
+
+ JZL.ajax(qlgUrl('app/shopping/getShopInfo'),{
+ shopId:shopId
+ },function (data) {
+ // console.log(data);
+ if (data.status == 1) {
+ var html = '';
+ var data = data.data;
+ shopLat=data.lat;
+ shopLng=data.lng;
+ phone=data.phone;
+ userName=data.loginName;
+ //console.log(shopLng);
+ localStorage.setItem('shopLat', shopLat);
+ localStorage.setItem('shopLng', shopLng);
+ localStorage.setItem('phone', phone);
+ localStorage.setItem('userName', userName);
+ var imgs=data.shopAds.split(",");
+ var firstImg = '';
+ var endImg='';
+ $.each(imgs, function(index,val) {
+ if(index == 0) firstImg='
+')
';
+ if(index == imgs.length-1) endImg='
';
+ ////console.log(val);
+ html+='
';
+ //html += '
 + ')
';
+ });
+ $('#imgsw').html(html);
+ $('#imgsw').prepend(endImg);
+ $('#imgsw').append(firstImg);
+ var slider = mui("#slider");
+ slider.slider({
+ interval: 2000
+ });
+ //$('#top_banner .swiper-wrapper').html(html);
+ // var swiper = new Swiper('#top_banner', {
+ // pagination: '#top_banner_pagination',
+ // spaceBetween: 0,
+ // loop: true,
+ // autoplay: 3500,
+ // autoplayDisableOnInteraction: false
+ // });
+ $('#slider').height($('#slider').width() * 460 / 750);
+ } else{
+ mui.alert(data.msg)
+ }
+ })
+ // mui('.search').on('tap', '.classmenu', function() {
+ // shopId = this.attributes["data-shopid"].nodeValue;
+ // // //console.log(this.attributes["data-id"].nodeValue);
+ // mui.openWindow({
+ // url: 'store_class.html',
+ // id: 'store_class.html',
+ // styles: {
+ // top: '0px', //新页面顶部位置
+ // bottom: '0px', //新页面底部位置
+ // width: '100%', //新页面宽度,默认为100%
+ // height: '100%' //新页面高度,默认为100%
+ // },
+ // extras: {
+ // shopId: shopId
+ // // ..... //自定义扩展参数,可以用来处理页面间传值
+ // },
+ // createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ // show: {
+ // // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // // extras: {} //窗口动画是否使用图片加速
+ // },
+ // waiting: {
+ // autoShow: true, //自动显示等待框,默认为true
+ // title: '正在加载...', //等待对话框上显示的提示内容
+ // options: {
+ // // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // // ......
+ // }
+ // }
+ // })
+ // })
+// mui('.footer').on('tap', '#dpxq', function() {
+// //console.log(11);
+// var w = plus.webview.create('store_info.html');
+// w.show()
+// })
+// mui('.footer').on('tap', '#rmfl', function() {
+//
+// $('.rmfl').css('display', 'block')
+// })
+ // mui('.con').on('tap', '.gz_btn', function() {
+ mui('.header_con').on('tap', '.gz_btn', function() {
+ // var shopId = shopId;
+ var that = $(this);
+ //console.log(shopId)
+ mui.ajax(qlgUrl('app/Favorites/add'), {
+ data: {
+ id: shopId,
+ type: 1
+ },
+ dataType: 'json', //服务器返回json格式数据
+ type: 'post', //HTTP请求类型
+ timeout: 10000, //超时时间设置为10秒;
+ success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ //console.log(data)
+ // //console.log(data.data.goodsFavoritesNum)
+ // //console.log(data.data.Rows)
+ var data = toJson(data);
+ if (data.status == 1) {
+ that.html('已关注');
+ that.addClass('gz_btn1').removeClass('gz_btn');
+ } else {
+ ////console.log(data.status)
+ }
+
+ },
+ error: function(xhr, type, errorThrown) { //异常处理;
+ // mui.alert(type);
+ }
+ });
+
+ })
+ $('.header').on('focus', '#keyword', function() {
+ $(".searchcon button").css('display', 'block');
+ })
+ $('.header').on('blur', '#keyword', function() {
+ $(".searchcon button").css('display', 'none');
+ })
+
+ //店铺搜索
+ $(".header").on('keypress', '#keyword', function(e) {
+ var keycode = e.keyCode;
+ var searchName = $('#keyword').val();
+ if(keycode == '13') {
+ // e.preventDefault();
+ // //console.log(searchName)
+ //请求搜索接口
+ mui.openWindow({
+ url: 'shopGoodsList.html',
+ id: 'shopGoodsList.html',
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ data_keyword: searchName
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+
+ }
+ });
+ $(".header").on('tap', '.searchcon button', function(e) {
+ var searchName = $('#keyword').val();
+ // e.preventDefault();
+ // //console.log(searchName)
+ //请求搜索接口
+ mui.openWindow({
+ url: 'shopGoodsList.html',
+ id: 'shopGoodsList.html',
+ styles: {
+ top: '0px', //新页面顶部位置
+ bottom: '0px', //新页面底部位置
+ width: '100%', //新页面宽度,默认为100%
+ height: '100%' //新页面高度,默认为100%
+ },
+ extras: {
+ data_keyword: searchName
+ // ..... //自定义扩展参数,可以用来处理页面间传值
+ },
+ createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
+ show: {
+ // autoShow: true, //页面loaded事件发生后自动显示,默认为true
+ // aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
+ // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
+ // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
+ // extras: {} //窗口动画是否使用图片加速
+ },
+ waiting: {
+ autoShow: true, //自动显示等待框,默认为true
+ title: '正在加载...', //等待对话框上显示的提示内容
+ options: {
+ // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
+ // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
+ // ......
+ }
+ }
+ })
+
+ });
+
+})
+
+function jumpPage() {
+ //跳转页面
+ // var bSize = 190 + (+localStorage.getItem('ipxSizeTop')) + 'px';
+ var bSize = +localStorage.getItem('topBannerheight')+42+'px';
+ var subpages = ['store_home.html', 'store_commodity.html'];
+ // var subpages = ['store_home.html', 'store_commodity.html', 'store_new.html', 'store_activity.html'];
+ // top: bSize,
+ var subpage_style = {
+ top: bSize,
+ bottom: '0',
+ scrollIndicator: 'none'
+ };
+
+ var aniShow = {}; //动画显示
+ //当前激活选项
+ var activeTab = subpages[0];
+ //选项卡点击事件
+ // mui('.footer').on('tap', 'a', function(e) {
+
+ mui('.nav').on('tap', 'a', function(e) {
+ var targetTab = this.getAttribute('href');
+ // //console.log(targetTab);
+ if (targetTab == activeTab) {
+ return;
+ }
+ //显示目标选项卡
+ //若为iOS平台或非首次显示,则直接显示
+ if (mui.os.ios || aniShow[targetTab]) {
+ plus.webview.show(targetTab);
+ } else {
+ //否则,使用fade-in动画,且保存变量
+ var temp = {};
+ temp[targetTab] = "true";
+ mui.extend(aniShow, temp);
+ plus.webview.show(targetTab, "fade-in", 300);
+
+ }
+ //隐藏当前;
+ plus.webview.hide(activeTab);
+ //更改当前活跃的选项卡
+ activeTab = targetTab;
+
+ // var html = $(this).html();
+ // html = html.substring(0, html.indexOf('.png')) + '_on.png">';
+ // $(this).html(html);
+ $(this).addClass('on').siblings().removeClass('on');
+ // $(this).siblings().each(function() {
+ // if($(this).html().indexOf('_on') == -1) {
+ // return
+ // }
+ // html = $(this).html().substring(0, $(this).html().indexOf('_on'))
+ // html = html + '.png">';
+ // $(this).html(html)
+ // })
+ });
+
+ //首次启动切滑效果
+
+ mui.plusReady(function() {
+ // launchScreen();
+ // plus.navigator.setStatusBarStyle('dark');
+ // //console.log(plus.navigator.getStatusBarStyle())
+ var self = plus.webview.currentWebview();
+ shopId = self.shopId;
+ from_id = self.from_id?self.from_id:0;
+ // console.log(shopId);
+ localStorage.setItem('shopId', shopId);
+
+ for (var i = 0; i < subpages.length; i++) {
+ var temp = {};
+ //http://www.html5plus.org/doc/zh_cn/webview.html#plus.webview.create
+ var sub = plus.webview.create(subpages[i], subpages[i], subpage_style, {from_id});
+ if (i > 0) {
+ sub.hide();
+ } else {
+ temp[subpages[i]] = "true";
+ mui.extend(aniShow, temp); //合并对象
+ }
+ self.append(sub);
+ }
+ });
+}
+jumpPage();
+
diff --git a/static/app2/js/supermarket.js b/static/app2/js/supermarket.js
old mode 100755
new mode 100644
index f290ac9..a6c7a39
--- a/static/app2/js/supermarket.js
+++ b/static/app2/js/supermarket.js
@@ -1,225 +1,225 @@
-mui.plusReady(function() {
-
- var self = plus.webview.currentWebview();
- //console.log(self);
-
-
- var id = self.scid ? self.scid : '';
- JZL.ajax(qlgUrl('app/shops/getUserUpdate'), {
- applyLevel: 2
- }, function(data) {
- //console.log(data);
- if (1 == data.status && undefined != data.data) {
- var data = data.data;
-
- if (0 == data.status || 2 == data.status) {
- //console.log(id);
- if (id == "") {
- id = data.id
- }
- getShopList(data.shopId);
-
- $('#confirm').attr('src', hyhImgUrl(data.confirmImg))
- $('#confirmImg').val(data.confirmImg)
-
- var imgs = data.shopImg
- imgs = Array.from(imgs.split(','))
- //console.log(imgs);
- var html = "";
- mui.each(imgs, function(index, element) {
- //console.log(index, element);
- html += '
 + ')
';
- })
- // var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1;
- var maxNum = imgs.length - 1;
- // //console.log(maxNum);
- // //console.log(num);
- // if (num == maxNum) {
- maxNum++;
- html += '

';
- $(".batchImg").html(html);
- // }
-
- //获取协议
- JZL.ajax(qlgUrl('app/Tags/articleDetail'), {
- articleId: 115
- }, function(data) {
- //console.log(data);
- // if (1==data.status) {
- // $('.zcxycontent').html(data.data.articleContent)
- $('.zcxycontent').html(data.articleContent)
-
- // }
-
- })
-
- } else if (1 == data.status) {
- //tiaozhuandao shangdu yemian
- }
- } else if ('' == data.data) {
- getShopList();
- JZL.ajax(qlgUrl('app/Tags/articleDetail'), {
- articleId: 115
- }, function(data) {
- //console.log(data);
- // if (1==data.status) {
- // $('.zcxycontent').html(data.data.articleContent)
- $('.zcxycontent').html(data.articleContent)
-
- // }
-
- })
- }
- })
- // 上传图片
- $('.photos_con').on('tap', '.confirm', function() {
- UP.init("confirmImg", "test", "confirm")
- openCamera()
- })
- $(".batchImg").on("tap", '.galleryImg', function() {
- var num = $(this).attr('data-id');
- UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1);
- var that = $(this);
- openCamera(function(t, status, fileName, serverName) {
- var html = '


';
-
- that.html(html);
-
- var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1;
- if (num == maxNum) {
- maxNum++;
- html = '

';
- $(".batchImg").append(html);
- }
- });
- })
- //删除照片
- $(".batchImg").on('tap', '.delete', function(e) {
-
- e.preventDefault();
- e.stopPropagation()
-
- // //console.log(this);
- var that = $(this)
- //var idx = that.parent().attr('data-id');
- //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1;
- if (confirm('确认删除图片?')) {
- that.parent().remove()
- //delete galleryarr[idx];
- }
- })
- //获取协议
- JZL.ajax(qlgUrl('app/Tags/articleDetail'), {
- articleId: 115
- }, function(data) {
- //console.log(data);
- // if (1==data.status) {
- // $('.zcxycontent').html(data.data.articleContent)
- $('.zcxycontent').html(data.articleContent)
-
- // }
-
- })
- //获取店铺信息
- getShopList()
-
- function getShopList(defaultShopId) {
-
- JZL.ajax(qlgUrl('app/shops/userShopList'), {
- shopType: 1
- }, function(data) {
- //console.log(data);
- if (1 == data.status) {
- var html = "";
- html = `
`;
- if (undefined == typeof defaultShop) {
-
- mui.each(data.data, function() {
- // //console.log(index, element);
- html += `
`;
- })
- } else {
- mui.each(data.data, function() {
- if (this.shopId == defaultShopId) {
- selected = 'selected';
- } else {
- selected = '';
- }
- html += `
`;
- })
-
- }
- $("#shopId").html(html)
- } else {
- mui.alert(data.msg)
- }
- // })
- })
-
-
- }
- let click = 0;
- $('.down').on('tap', '.btn', function() {
-
- if (click == 1) {
- return;
- }
- click = 1
- var imgs = '';
- var data = $('input[name="gallery[]"]');
- //console.log(data);
- $.each(data, function() {
- if ('' != $(this).val())
- imgs = $(this).val() + ',' + imgs;
- })
- imgs = imgs.substring(0, imgs.lastIndexOf(','));
- $('#shopImg').val(imgs);
- if ('' == $('#shopId option:selected').val()) {
- mui.alert('请选择要升级的店铺名称')
- return;
- }
-
- if ('' == $('#confirmImg').val()) {
- mui.alert('请上传确认书照片')
- return;
- }
- if ('' == $('#shopImg').val()) {
- mui.alert('请上传店铺照片')
- return;
- }
-
-
- var params = JZL.getParams(".inp");
- params.applyLevel = 2;
- if ("" != id) {
- params.id = id;
- //console.log(params.id);
- }
- JZL.ajax(qlgUrl('app/shops/userUpdate'), params, function(data) {
- // //console.log(data);
- if (1 == data.status) {
- // mui.back()
- } else {
- mui.alert(data.msg)
- }
- })
- })
-
-
-
-
+mui.plusReady(function() {
+
+ var self = plus.webview.currentWebview();
+ //console.log(self);
+
+
+ var id = self.scid ? self.scid : '';
+ JZL.ajax(qlgUrl('app/shops/getUserUpdate'), {
+ applyLevel: 2
+ }, function(data) {
+ //console.log(data);
+ if (1 == data.status && undefined != data.data) {
+ var data = data.data;
+
+ if (0 == data.status || 2 == data.status) {
+ //console.log(id);
+ if (id == "") {
+ id = data.id
+ }
+ getShopList(data.shopId);
+
+ $('#confirm').attr('src', hyhImgUrl(data.confirmImg))
+ $('#confirmImg').val(data.confirmImg)
+
+ var imgs = data.shopImg
+ imgs = Array.from(imgs.split(','))
+ //console.log(imgs);
+ var html = "";
+ mui.each(imgs, function(index, element) {
+ //console.log(index, element);
+ html += '
 + ')
';
+ })
+ // var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1;
+ var maxNum = imgs.length - 1;
+ // //console.log(maxNum);
+ // //console.log(num);
+ // if (num == maxNum) {
+ maxNum++;
+ html += '

';
+ $(".batchImg").html(html);
+ // }
+
+ //获取协议
+ JZL.ajax(qlgUrl('app/Tags/articleDetail'), {
+ articleId: 115
+ }, function(data) {
+ //console.log(data);
+ // if (1==data.status) {
+ // $('.zcxycontent').html(data.data.articleContent)
+ $('.zcxycontent').html(data.articleContent)
+
+ // }
+
+ })
+
+ } else if (1 == data.status) {
+ //tiaozhuandao shangdu yemian
+ }
+ } else if ('' == data.data) {
+ getShopList();
+ JZL.ajax(qlgUrl('app/Tags/articleDetail'), {
+ articleId: 115
+ }, function(data) {
+ //console.log(data);
+ // if (1==data.status) {
+ // $('.zcxycontent').html(data.data.articleContent)
+ $('.zcxycontent').html(data.articleContent)
+
+ // }
+
+ })
+ }
+ })
+ // 上传图片
+ $('.photos_con').on('tap', '.confirm', function() {
+ UP.init("confirmImg", "test", "confirm")
+ openCamera()
+ })
+ $(".batchImg").on("tap", '.galleryImg', function() {
+ var num = $(this).attr('data-id');
+ UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1);
+ var that = $(this);
+ openCamera(function(t, status, fileName, serverName) {
+ var html = '


';
+
+ that.html(html);
+
+ var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1;
+ if (num == maxNum) {
+ maxNum++;
+ html = '

';
+ $(".batchImg").append(html);
+ }
+ });
+ })
+ //删除照片
+ $(".batchImg").on('tap', '.delete', function(e) {
+
+ e.preventDefault();
+ e.stopPropagation()
+
+ // //console.log(this);
+ var that = $(this)
+ //var idx = that.parent().attr('data-id');
+ //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1;
+ if (confirm('确认删除图片?')) {
+ that.parent().remove()
+ //delete galleryarr[idx];
+ }
+ })
+ //获取协议
+ JZL.ajax(qlgUrl('app/Tags/articleDetail'), {
+ articleId: 115
+ }, function(data) {
+ //console.log(data);
+ // if (1==data.status) {
+ // $('.zcxycontent').html(data.data.articleContent)
+ $('.zcxycontent').html(data.articleContent)
+
+ // }
+
+ })
+ //获取店铺信息
+ getShopList()
+
+ function getShopList(defaultShopId) {
+
+ JZL.ajax(qlgUrl('app/shops/userShopList'), {
+ shopType: 1
+ }, function(data) {
+ //console.log(data);
+ if (1 == data.status) {
+ var html = "";
+ html = `
`;
+ if (undefined == typeof defaultShop) {
+
+ mui.each(data.data, function() {
+ // //console.log(index, element);
+ html += `
`;
+ })
+ } else {
+ mui.each(data.data, function() {
+ if (this.shopId == defaultShopId) {
+ selected = 'selected';
+ } else {
+ selected = '';
+ }
+ html += `
`;
+ })
+
+ }
+ $("#shopId").html(html)
+ } else {
+ mui.alert(data.msg)
+ }
+ // })
+ })
+
+
+ }
+ let click = 0;
+ $('.down').on('tap', '.btn', function() {
+
+ if (click == 1) {
+ return;
+ }
+ click = 1
+ var imgs = '';
+ var data = $('input[name="gallery[]"]');
+ //console.log(data);
+ $.each(data, function() {
+ if ('' != $(this).val())
+ imgs = $(this).val() + ',' + imgs;
+ })
+ imgs = imgs.substring(0, imgs.lastIndexOf(','));
+ $('#shopImg').val(imgs);
+ if ('' == $('#shopId option:selected').val()) {
+ mui.alert('请选择要升级的店铺名称')
+ return;
+ }
+
+ if ('' == $('#confirmImg').val()) {
+ mui.alert('请上传确认书照片')
+ return;
+ }
+ if ('' == $('#shopImg').val()) {
+ mui.alert('请上传店铺照片')
+ return;
+ }
+
+
+ var params = JZL.getParams(".inp");
+ params.applyLevel = 2;
+ if ("" != id) {
+ params.id = id;
+ //console.log(params.id);
+ }
+ JZL.ajax(qlgUrl('app/shops/userUpdate'), params, function(data) {
+ // //console.log(data);
+ if (1 == data.status) {
+ // mui.back()
+ } else {
+ mui.alert(data.msg)
+ }
+ })
+ })
+
+
+
+
})
diff --git a/static/app2/js/swiper.min.js b/static/app2/js/swiper.min.js
old mode 100755
new mode 100644
diff --git a/static/app2/js/test.js b/static/app2/js/test.js
old mode 100755
new mode 100644
index c05bc22..76dea9f
--- a/static/app2/js/test.js
+++ b/static/app2/js/test.js
@@ -1,104 +1,104 @@
-mui.plusReady(function() {
- var btnArr = [];
-
- $('.selectfiles').each(function(num) {
- btnArr.push($(this).attr('id'));
- })
-
- $.each(btnArr, function(i, n) {
- var self = this.toString();
- var that = document.getElementById(this);
- var uploader = new plupload.Uploader({
- runtimes: 'html5,flash,silverlight,html4',
- browse_button: self,
- //multi_selection: false,
- // container: document.getElementById('container'),
- flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf',
- silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap',
- url: 'http://oss.aliyuncs.com',
- dir:'appraises',
-
- filters: {
- mime_types: [ //只允许上传图片和zip,rar文件
- {
- title: "Image files",
- extensions: "jpg,gif,png,bmp"
- },
- {
- title: "Zip files",
- extensions: "zip,rar"
- }
- ],
- max_file_size: '10mb', //最大只能上传10mb的文件
- prevent_duplicates: true //不允许选取重复文件
- },
-
- init: {
- PostInit: function() {
- document.getElementsByClassName('ossfile')[i].innerHTML = '';
- // document.getElementById('postfiles').onclick = function() {
- // set_upload_param(uploader, '', false);
- // return false;
- // };
- uploader.bind('FilesAdded', function() {
- set_upload_param(uploader, '', false,'appraises');
- return false;
- });
- },
-
- FilesAdded: function(up, files) {
- plupload.each(files, function(file) {
- document.getElementsByClassName('ossfile')[i].innerHTML += '
';
- });
- },
-
- BeforeUpload: function(up, file) {
- check_object_radio();
- set_upload_param(up, file.name, true);
- },
-
- UploadProgress: function(up, file) {
- var d = document.getElementById(file.id);
- d.getElementsByTagName('b')[0].innerHTML = '
' + file.percent + "%";
- var prog = d.getElementsByTagName('div')[0];
- var progBar = prog.getElementsByTagName('div')[0]
- progBar.style.width = 2 * file.percent + 'px';
- progBar.setAttribute('aria-valuenow', file.percent);
- },
-
- FileUploaded: function(up, file, info) {
- if(info.status == 200) {
- document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = '
) + ')
';
- } else {
- document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response;
- }
- //console.log(JSON.stringify(up))
- //console.log(JSON.stringify(file))
- //console.log(JSON.stringify(info))
- //console.log(file.name);
- //console.log((hyhImgUrl(get_uploaded_object_name(file.name))));
- },
-
- Error: function(up, err) {
- if(err.code == -600) {
- mui.alert("\n选择的文件太大了");
- } else if(err.code == -601) {
- mui.alert("\n选择的文件后缀不对");
- } else if(err.code == -602) {
- mui.alert("\n这个文件已经上传过一遍了");
- } else {
- mui.alert("\nError xml:" + err.response);
- }
- }
- }
- });
-
- uploader.init();
-
-
-})
- });
-
+mui.plusReady(function() {
+ var btnArr = [];
+
+ $('.selectfiles').each(function(num) {
+ btnArr.push($(this).attr('id'));
+ })
+
+ $.each(btnArr, function(i, n) {
+ var self = this.toString();
+ var that = document.getElementById(this);
+ var uploader = new plupload.Uploader({
+ runtimes: 'html5,flash,silverlight,html4',
+ browse_button: self,
+ //multi_selection: false,
+ // container: document.getElementById('container'),
+ flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf',
+ silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap',
+ url: 'http://oss.aliyuncs.com',
+ dir:'appraises',
+
+ filters: {
+ mime_types: [ //只允许上传图片和zip,rar文件
+ {
+ title: "Image files",
+ extensions: "jpg,gif,png,bmp"
+ },
+ {
+ title: "Zip files",
+ extensions: "zip,rar"
+ }
+ ],
+ max_file_size: '10mb', //最大只能上传10mb的文件
+ prevent_duplicates: true //不允许选取重复文件
+ },
+
+ init: {
+ PostInit: function() {
+ document.getElementsByClassName('ossfile')[i].innerHTML = '';
+ // document.getElementById('postfiles').onclick = function() {
+ // set_upload_param(uploader, '', false);
+ // return false;
+ // };
+ uploader.bind('FilesAdded', function() {
+ set_upload_param(uploader, '', false,'appraises');
+ return false;
+ });
+ },
+
+ FilesAdded: function(up, files) {
+ plupload.each(files, function(file) {
+ document.getElementsByClassName('ossfile')[i].innerHTML += '
';
+ });
+ },
+
+ BeforeUpload: function(up, file) {
+ check_object_radio();
+ set_upload_param(up, file.name, true);
+ },
+
+ UploadProgress: function(up, file) {
+ var d = document.getElementById(file.id);
+ d.getElementsByTagName('b')[0].innerHTML = '
' + file.percent + "%";
+ var prog = d.getElementsByTagName('div')[0];
+ var progBar = prog.getElementsByTagName('div')[0]
+ progBar.style.width = 2 * file.percent + 'px';
+ progBar.setAttribute('aria-valuenow', file.percent);
+ },
+
+ FileUploaded: function(up, file, info) {
+ if(info.status == 200) {
+ document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = '
) + ')
';
+ } else {
+ document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response;
+ }
+ //console.log(JSON.stringify(up))
+ //console.log(JSON.stringify(file))
+ //console.log(JSON.stringify(info))
+ //console.log(file.name);
+ //console.log((hyhImgUrl(get_uploaded_object_name(file.name))));
+ },
+
+ Error: function(up, err) {
+ if(err.code == -600) {
+ mui.alert("\n选择的文件太大了");
+ } else if(err.code == -601) {
+ mui.alert("\n选择的文件后缀不对");
+ } else if(err.code == -602) {
+ mui.alert("\n这个文件已经上传过一遍了");
+ } else {
+ mui.alert("\nError xml:" + err.response);
+ }
+ }
+ }
+ });
+
+ uploader.init();
+
+
+})
+ });
+
\ No newline at end of file
diff --git a/static/app2/js/trade_rule.js b/static/app2/js/trade_rule.js
new file mode 100644
index 0000000..31ce60a
--- /dev/null
+++ b/static/app2/js/trade_rule.js
@@ -0,0 +1,28 @@
+mui.plusReady(function(){
+ // some ajax
+})
+const app = new Vue({
+ el: '#app',
+ data() {
+ return {
+ ruleData: [
+ ]
+ }
+ },
+ created() {
+ console.log("Vue")
+ },
+ methods: {
+ detail(index){
+ console.log(this.ruleData[index])
+ // some jump
+ }
+ },
+ mounted() {
+ // some ajax
+ this.ruleData = [
+ {id: 1, name: '这个是个开发中的页面呢', announced_at: "2019-09-09 18:09:01"},
+ {id: 2, name: '待我来继续开发呢', announced_at: "2019-09-09 19:09:01"},
+ ]
+ }
+})
\ No newline at end of file
diff --git a/static/app2/js/upload.js b/static/app2/js/upload.js
old mode 100755
new mode 100644
index a98f0b9..6c7c85c
--- a/static/app2/js/upload.js
+++ b/static/app2/js/upload.js
@@ -1,134 +1,134 @@
-accessid = ''
-accesskey = ''
-host = ''
-policyBase64 = ''
-signature = ''
-callbackbody = ''
-filename = ''
-key = ''
-expire = 0
-g_object_name = ''
-g_object_name_type = ''
-now = timestamp = Date.parse(new Date()) / 1000;
-dir = 'images'
-
-function send_request() {
- var xmlhttp = null;
- if(window.XMLHttpRequest) {
- xmlhttp = new XMLHttpRequest();
- } else if(window.ActiveXObject) {
- xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
- }
-
- if(xmlhttp != null) {
-// //console.log(dir)
- serverUrl = hyhUrl('oss/get.php?dir='+dir);
- xmlhttp.open("GET", serverUrl, false);
- xmlhttp.send(null);
- return xmlhttp.responseText
- } else {
- mui.alert("Your browser does not support XMLHTTP.");
- }
-
-};
-
-function check_object_radio() {
- var tt = document.getElementsByName('myradio');
- for(var i = 0; i < tt.length; i++) {
- if(tt[i].checked) {
- g_object_name_type = tt[i].value;
- break;
- }
- }
-}
-
-function get_signature() {
- //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲
- now = timestamp = Date.parse(new Date()) / 1000;
- if(expire < now + 3) {
- body = send_request()
- var obj = eval("(" + body + ")");
- host = obj['host']
- policyBase64 = obj['policy']
- accessid = obj['accessid']
- signature = obj['signature']
- expire = parseInt(obj['expire'])
- callbackbody = obj['callback']
- key = obj['dir']
- return true;
- }
- return false;
-};
-
-function random_string(len) {
- len = len || 32;
- var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
- var maxPos = chars.length;
- var pwd = '';
- for(i = 0; i < len; i++) {
- pwd += chars.charAt(Math.floor(Math.random() * maxPos));
- }
- return pwd;
-}
-
-function get_suffix(filename) {
- pos = filename.lastIndexOf('.')
- suffix = ''
- if(pos != -1) {
- suffix = filename.substring(pos)
- }
- return suffix;
-}
-
-function calculate_object_name(filename) {
- if(g_object_name_type == 'local_name') {
- g_object_name += "${filename}"
- } else if(g_object_name_type == 'random_name') {
- suffix = get_suffix(filename)
- g_object_name = key + random_string(10) + suffix
- }
- return ''
-}
-
-function get_uploaded_object_name(filename) {
- if(g_object_name_type == 'local_name') {
- tmp_name = g_object_name
- tmp_name = tmp_name.replace("${filename}", filename);
- return tmp_name
- } else if(g_object_name_type == 'random_name') {
- return g_object_name
- }
-}
-
-function set_upload_param(up, filename, ret,savedir) {
- dir = savedir;
- if(ret == false) {
- ret = get_signature()
- }
- //console.log(filename);
- g_object_name = key;
- //console.log(g_object_name);
- if(filename != '') {
- suffix = get_suffix(filename)
- calculate_object_name(filename)
- }
-
-
- //console.log(g_object_name);
-// alert(g_object_name)
-// //console.log(g_object_name);
- new_multipart_params = {
- 'key': g_object_name,
- 'policy': policyBase64,
- 'OSSAccessKeyId': accessid,
- 'success_action_status': '200', //让服务端返回200,不然,默认会返回204
- 'callback': callbackbody,
- 'signature': signature,
- };
-// //console.log(callbackbody);
- up.setOption({
- 'url': host,
- 'multipart_params': new_multipart_params
- });
- up.start();
+accessid = ''
+accesskey = ''
+host = ''
+policyBase64 = ''
+signature = ''
+callbackbody = ''
+filename = ''
+key = ''
+expire = 0
+g_object_name = ''
+g_object_name_type = ''
+now = timestamp = Date.parse(new Date()) / 1000;
+dir = 'images'
+
+function send_request() {
+ var xmlhttp = null;
+ if(window.XMLHttpRequest) {
+ xmlhttp = new XMLHttpRequest();
+ } else if(window.ActiveXObject) {
+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+
+ if(xmlhttp != null) {
+// //console.log(dir)
+ serverUrl = hyhUrl('oss/get.php?dir='+dir);
+ xmlhttp.open("GET", serverUrl, false);
+ xmlhttp.send(null);
+ return xmlhttp.responseText
+ } else {
+ mui.alert("Your browser does not support XMLHTTP.");
+ }
+
+};
+
+function check_object_radio() {
+ var tt = document.getElementsByName('myradio');
+ for(var i = 0; i < tt.length; i++) {
+ if(tt[i].checked) {
+ g_object_name_type = tt[i].value;
+ break;
+ }
+ }
+}
+
+function get_signature() {
+ //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲
+ now = timestamp = Date.parse(new Date()) / 1000;
+ if(expire < now + 3) {
+ body = send_request()
+ var obj = eval("(" + body + ")");
+ host = obj['host']
+ policyBase64 = obj['policy']
+ accessid = obj['accessid']
+ signature = obj['signature']
+ expire = parseInt(obj['expire'])
+ callbackbody = obj['callback']
+ key = obj['dir']
+ return true;
+ }
+ return false;
+};
+
+function random_string(len) {
+ len = len || 32;
+ var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
+ var maxPos = chars.length;
+ var pwd = '';
+ for(i = 0; i < len; i++) {
+ pwd += chars.charAt(Math.floor(Math.random() * maxPos));
+ }
+ return pwd;
+}
+
+function get_suffix(filename) {
+ pos = filename.lastIndexOf('.')
+ suffix = ''
+ if(pos != -1) {
+ suffix = filename.substring(pos)
+ }
+ return suffix;
+}
+
+function calculate_object_name(filename) {
+ if(g_object_name_type == 'local_name') {
+ g_object_name += "${filename}"
+ } else if(g_object_name_type == 'random_name') {
+ suffix = get_suffix(filename)
+ g_object_name = key + random_string(10) + suffix
+ }
+ return ''
+}
+
+function get_uploaded_object_name(filename) {
+ if(g_object_name_type == 'local_name') {
+ tmp_name = g_object_name
+ tmp_name = tmp_name.replace("${filename}", filename);
+ return tmp_name
+ } else if(g_object_name_type == 'random_name') {
+ return g_object_name
+ }
+}
+
+function set_upload_param(up, filename, ret,savedir) {
+ dir = savedir;
+ if(ret == false) {
+ ret = get_signature()
+ }
+ //console.log(filename);
+ g_object_name = key;
+ //console.log(g_object_name);
+ if(filename != '') {
+ suffix = get_suffix(filename)
+ calculate_object_name(filename)
+ }
+
+
+ //console.log(g_object_name);
+// alert(g_object_name)
+// //console.log(g_object_name);
+ new_multipart_params = {
+ 'key': g_object_name,
+ 'policy': policyBase64,
+ 'OSSAccessKeyId': accessid,
+ 'success_action_status': '200', //让服务端返回200,不然,默认会返回204
+ 'callback': callbackbody,
+ 'signature': signature,
+ };
+// //console.log(callbackbody);
+ up.setOption({
+ 'url': host,
+ 'multipart_params': new_multipart_params
+ });
+ up.start();
}
\ No newline at end of file
diff --git a/static/app2/js/upload1.js b/static/app2/js/upload1.js
old mode 100755
new mode 100644
index 96cf7c8..c92a4a0
--- a/static/app2/js/upload1.js
+++ b/static/app2/js/upload1.js
@@ -1,306 +1,306 @@
-accessid = ''
-accesskey = ''
-host = ''
-policyBase64 = ''
-signature = ''
-callbackbody = ''
-filename = ''
-key = ''
-expire = 0
-g_object_name = ''
-g_object_name_type = ''
-now = timestamp = Date.parse(new Date()) / 1000;
-
-function send_request() {
- var xmlhttp = null;
- if(window.XMLHttpRequest) {
- xmlhttp = new XMLHttpRequest();
- } else if(window.ActiveXObject) {
- xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
- }
-
- if(xmlhttp != null) {
- serverUrl = '../php/get.php'
- xmlhttp.open("GET", serverUrl, false);
- xmlhttp.send(null);
- return xmlhttp.responseText
- } else {
- mui.alert("Your browser does not support XMLHTTP.");
- }
-};
-
-function check_object_radio() {
- var tt = document.getElementsByName('myradio');
- for(var i = 0; i < tt.length; i++) {
- if(tt[i].checked) {
- g_object_name_type = tt[i].value;
- break;
- }
- }
-}
-
-function get_signature() {
- //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲
- now = timestamp = Date.parse(new Date()) / 1000;
- if(expire < now + 3) {
- body = send_request()
- var obj = eval("(" + body + ")");
- host = obj['host']
- policyBase64 = obj['policy']
- accessid = obj['accessid']
- signature = obj['signature']
- expire = parseInt(obj['expire'])
- callbackbody = obj['callback']
- key = obj['dir']
- return true;
- }
- return false;
-};
-
-function random_string(len) {
- len = len || 32;
- var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
- var maxPos = chars.length;
- var pwd = '';
- for(i = 0; i < len; i++) {
- pwd += chars.charAt(Math.floor(Math.random() * maxPos));
- }
- return pwd;
-}
-
-function get_suffix(filename) {
- pos = filename.lastIndexOf('.')
- suffix = ''
- if(pos != -1) {
- suffix = filename.substring(pos)
- }
- return suffix;
-}
-
-function calculate_object_name(filename) {
- if(g_object_name_type == 'local_name') {
- g_object_name += "${filename}"
- } else if(g_object_name_type == 'random_name') {
- suffix = get_suffix(filename)
- g_object_name = key + random_string(10) + suffix
- }
- return ''
-}
-
-function get_uploaded_object_name(filename) {
- if(g_object_name_type == 'local_name') {
- tmp_name = g_object_name
- tmp_name = tmp_name.replace("${filename}", filename);
- return tmp_name
- } else if(g_object_name_type == 'random_name') {
- return g_object_name
- }
-}
-
-function set_upload_param(up, filename, ret) {
- if(ret == false) {
- ret = get_signature()
- }
- g_object_name = key;
- if(filename != '') {
- suffix = get_suffix(filename)
- calculate_object_name(filename)
- }
- new_multipart_params = {
- 'key': g_object_name,
- 'policy': policyBase64,
- 'OSSAccessKeyId': accessid,
- 'success_action_status': '200', //让服务端返回200,不然,默认会返回204
- 'callback': callbackbody,
- 'signature': signature,
- };
-
- up.setOption({
- 'url': host,
- 'multipart_params': new_multipart_params
- });
-
- up.start();
-}
-var html = '';
-for(i = 0; i < 3; i++) {
- html += '
你的浏览器不支持flash,Silverlight或者HTML5!
'
-}
-
-$('.con').html(html)
-
-var btnArr = [];
-
-$('.selectfiles').each(function(num) {
- btnArr.push($(this).attr('id'));
-})
-
-$.each(btnArr, function(i, n) {
- var self = this.toString();
- var that = document.getElementById(this);
- var uploader = new plupload.Uploader({
- runtimes: 'html5,flash,silverlight,html4',
- browse_button: self,
- //multi_selection: false,
- // container: document.getElementById('container'),
- flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf',
- silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap',
- url: 'http://oss.aliyuncs.com',
-
- filters: {
- mime_types: [ //只允许上传图片和zip,rar文件
- {
- title: "Image files",
- extensions: "jpg,gif,png,bmp"
- },
- {
- title: "Zip files",
- extensions: "zip,rar"
- }
- ],
- max_file_size: '10mb', //最大只能上传10mb的文件
- prevent_duplicates: true //不允许选取重复文件
- },
-
- init: {
- PostInit: function() {
- document.getElementsByClassName('ossfile')[i].innerHTML = '';
- // document.getElementById('postfiles').onclick = function() {
- // set_upload_param(uploader, '', false);
- // return false;
- // };
- uploader.bind('FilesAdded', function() {
- set_upload_param(uploader, '', false);
- return false;
- });
- },
-
- FilesAdded: function(up, files) {
- plupload.each(files, function(file) {
- document.getElementsByClassName('ossfile')[i].innerHTML += '
';
- });
- },
-
- BeforeUpload: function(up, file) {
- check_object_radio();
- set_upload_param(up, file.name, true);
- },
-
- UploadProgress: function(up, file) {
- var d = document.getElementById(file.id);
- d.getElementsByTagName('b')[0].innerHTML = '
' + file.percent + "%";
- var prog = d.getElementsByTagName('div')[0];
- var progBar = prog.getElementsByTagName('div')[0]
- progBar.style.width = 2 * file.percent + 'px';
- progBar.setAttribute('aria-valuenow', file.percent);
- },
-
- FileUploaded: function(up, file, info) {
- if(info.status == 200) {
- document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = '
 + ')
';
- } else {
- document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response;
- }
- },
-
- Error: function(up, err) {
- if(err.code == -600) {
- mui.alert("\n选择的文件太大了");
- } else if(err.code == -601) {
- mui.alert("\n选择的文件后缀不对");
- } else if(err.code == -602) {
- mui.alert("\n这个文件已经上传过一遍了");
- } else {
- mui.alert("\nError xml:" + err.response);
- }
- }
- }
- });
-
- uploader.init();
-});
-
-var uploader = new plupload.Uploader({
- runtimes: 'html5,flash,silverlight,html4',
- browse_button: 'selectfiles',
- //multi_selection: false,
- // container: document.getElementById('container'),
- flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf',
- silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap',
- url: 'http://oss.aliyuncs.com',
-
- filters: {
- mime_types: [ //只允许上传图片和zip,rar文件
- {
- title: "Image files",
- extensions: "jpg,gif,png,bmp"
- },
- {
- title: "Zip files",
- extensions: "zip,rar"
- }
- ],
- max_file_size: '10mb', //最大只能上传10mb的文件
- prevent_duplicates: true //不允许选取重复文件
- },
-
- init: {
- PostInit: function() {
- document.getElementById('ossfile').innerHTML = '';
- // document.getElementById('postfiles').onclick = function() {
- // set_upload_param(uploader, '', false);
- // return false;
- // };
- uploader.bind('FilesAdded', function() {
- set_upload_param(uploader, '', false);
- return false;
- });
- },
-
- FilesAdded: function(up, files) {
- plupload.each(files, function(file) {
- document.getElementById('ossfile').innerHTML += '
';
- });
- },
-
- BeforeUpload: function(up, file) {
- check_object_radio();
- set_upload_param(up, file.name, true);
- },
-
- UploadProgress: function(up, file) {
- var d = document.getElementById(file.id);
- d.getElementsByTagName('b')[0].innerHTML = '
' + file.percent + "%";
- var prog = d.getElementsByTagName('div')[0];
- var progBar = prog.getElementsByTagName('div')[0]
- progBar.style.width = 2 * file.percent + 'px';
- progBar.setAttribute('aria-valuenow', file.percent);
- },
-
- FileUploaded: function(up, file, info) {
- if(info.status == 200) {
- document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = '
 + ')
';
- } else {
- document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response;
- }
- },
-
- Error: function(up, err) {
- if(err.code == -600) {
- mui.alert("\n选择的文件太大了");
- } else if(err.code == -601) {
- mui.alert("\n选择的文件后缀不对");
- } else if(err.code == -602) {
- mui.alert("\n这个文件已经上传过一遍了");
- } else {
- mui.alert("\nError xml:" + err.response);
- }
- }
- }
-});
-
+accessid = ''
+accesskey = ''
+host = ''
+policyBase64 = ''
+signature = ''
+callbackbody = ''
+filename = ''
+key = ''
+expire = 0
+g_object_name = ''
+g_object_name_type = ''
+now = timestamp = Date.parse(new Date()) / 1000;
+
+function send_request() {
+ var xmlhttp = null;
+ if(window.XMLHttpRequest) {
+ xmlhttp = new XMLHttpRequest();
+ } else if(window.ActiveXObject) {
+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+
+ if(xmlhttp != null) {
+ serverUrl = '../php/get.php'
+ xmlhttp.open("GET", serverUrl, false);
+ xmlhttp.send(null);
+ return xmlhttp.responseText
+ } else {
+ mui.alert("Your browser does not support XMLHTTP.");
+ }
+};
+
+function check_object_radio() {
+ var tt = document.getElementsByName('myradio');
+ for(var i = 0; i < tt.length; i++) {
+ if(tt[i].checked) {
+ g_object_name_type = tt[i].value;
+ break;
+ }
+ }
+}
+
+function get_signature() {
+ //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲
+ now = timestamp = Date.parse(new Date()) / 1000;
+ if(expire < now + 3) {
+ body = send_request()
+ var obj = eval("(" + body + ")");
+ host = obj['host']
+ policyBase64 = obj['policy']
+ accessid = obj['accessid']
+ signature = obj['signature']
+ expire = parseInt(obj['expire'])
+ callbackbody = obj['callback']
+ key = obj['dir']
+ return true;
+ }
+ return false;
+};
+
+function random_string(len) {
+ len = len || 32;
+ var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
+ var maxPos = chars.length;
+ var pwd = '';
+ for(i = 0; i < len; i++) {
+ pwd += chars.charAt(Math.floor(Math.random() * maxPos));
+ }
+ return pwd;
+}
+
+function get_suffix(filename) {
+ pos = filename.lastIndexOf('.')
+ suffix = ''
+ if(pos != -1) {
+ suffix = filename.substring(pos)
+ }
+ return suffix;
+}
+
+function calculate_object_name(filename) {
+ if(g_object_name_type == 'local_name') {
+ g_object_name += "${filename}"
+ } else if(g_object_name_type == 'random_name') {
+ suffix = get_suffix(filename)
+ g_object_name = key + random_string(10) + suffix
+ }
+ return ''
+}
+
+function get_uploaded_object_name(filename) {
+ if(g_object_name_type == 'local_name') {
+ tmp_name = g_object_name
+ tmp_name = tmp_name.replace("${filename}", filename);
+ return tmp_name
+ } else if(g_object_name_type == 'random_name') {
+ return g_object_name
+ }
+}
+
+function set_upload_param(up, filename, ret) {
+ if(ret == false) {
+ ret = get_signature()
+ }
+ g_object_name = key;
+ if(filename != '') {
+ suffix = get_suffix(filename)
+ calculate_object_name(filename)
+ }
+ new_multipart_params = {
+ 'key': g_object_name,
+ 'policy': policyBase64,
+ 'OSSAccessKeyId': accessid,
+ 'success_action_status': '200', //让服务端返回200,不然,默认会返回204
+ 'callback': callbackbody,
+ 'signature': signature,
+ };
+
+ up.setOption({
+ 'url': host,
+ 'multipart_params': new_multipart_params
+ });
+
+ up.start();
+}
+var html = '';
+for(i = 0; i < 3; i++) {
+ html += '
你的浏览器不支持flash,Silverlight或者HTML5!
'
+}
+
+$('.con').html(html)
+
+var btnArr = [];
+
+$('.selectfiles').each(function(num) {
+ btnArr.push($(this).attr('id'));
+})
+
+$.each(btnArr, function(i, n) {
+ var self = this.toString();
+ var that = document.getElementById(this);
+ var uploader = new plupload.Uploader({
+ runtimes: 'html5,flash,silverlight,html4',
+ browse_button: self,
+ //multi_selection: false,
+ // container: document.getElementById('container'),
+ flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf',
+ silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap',
+ url: 'http://oss.aliyuncs.com',
+
+ filters: {
+ mime_types: [ //只允许上传图片和zip,rar文件
+ {
+ title: "Image files",
+ extensions: "jpg,gif,png,bmp"
+ },
+ {
+ title: "Zip files",
+ extensions: "zip,rar"
+ }
+ ],
+ max_file_size: '10mb', //最大只能上传10mb的文件
+ prevent_duplicates: true //不允许选取重复文件
+ },
+
+ init: {
+ PostInit: function() {
+ document.getElementsByClassName('ossfile')[i].innerHTML = '';
+ // document.getElementById('postfiles').onclick = function() {
+ // set_upload_param(uploader, '', false);
+ // return false;
+ // };
+ uploader.bind('FilesAdded', function() {
+ set_upload_param(uploader, '', false);
+ return false;
+ });
+ },
+
+ FilesAdded: function(up, files) {
+ plupload.each(files, function(file) {
+ document.getElementsByClassName('ossfile')[i].innerHTML += '
';
+ });
+ },
+
+ BeforeUpload: function(up, file) {
+ check_object_radio();
+ set_upload_param(up, file.name, true);
+ },
+
+ UploadProgress: function(up, file) {
+ var d = document.getElementById(file.id);
+ d.getElementsByTagName('b')[0].innerHTML = '
' + file.percent + "%";
+ var prog = d.getElementsByTagName('div')[0];
+ var progBar = prog.getElementsByTagName('div')[0]
+ progBar.style.width = 2 * file.percent + 'px';
+ progBar.setAttribute('aria-valuenow', file.percent);
+ },
+
+ FileUploaded: function(up, file, info) {
+ if(info.status == 200) {
+ document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = '
 + ')
';
+ } else {
+ document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response;
+ }
+ },
+
+ Error: function(up, err) {
+ if(err.code == -600) {
+ mui.alert("\n选择的文件太大了");
+ } else if(err.code == -601) {
+ mui.alert("\n选择的文件后缀不对");
+ } else if(err.code == -602) {
+ mui.alert("\n这个文件已经上传过一遍了");
+ } else {
+ mui.alert("\nError xml:" + err.response);
+ }
+ }
+ }
+ });
+
+ uploader.init();
+});
+
+var uploader = new plupload.Uploader({
+ runtimes: 'html5,flash,silverlight,html4',
+ browse_button: 'selectfiles',
+ //multi_selection: false,
+ // container: document.getElementById('container'),
+ flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf',
+ silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap',
+ url: 'http://oss.aliyuncs.com',
+
+ filters: {
+ mime_types: [ //只允许上传图片和zip,rar文件
+ {
+ title: "Image files",
+ extensions: "jpg,gif,png,bmp"
+ },
+ {
+ title: "Zip files",
+ extensions: "zip,rar"
+ }
+ ],
+ max_file_size: '10mb', //最大只能上传10mb的文件
+ prevent_duplicates: true //不允许选取重复文件
+ },
+
+ init: {
+ PostInit: function() {
+ document.getElementById('ossfile').innerHTML = '';
+ // document.getElementById('postfiles').onclick = function() {
+ // set_upload_param(uploader, '', false);
+ // return false;
+ // };
+ uploader.bind('FilesAdded', function() {
+ set_upload_param(uploader, '', false);
+ return false;
+ });
+ },
+
+ FilesAdded: function(up, files) {
+ plupload.each(files, function(file) {
+ document.getElementById('ossfile').innerHTML += '
';
+ });
+ },
+
+ BeforeUpload: function(up, file) {
+ check_object_radio();
+ set_upload_param(up, file.name, true);
+ },
+
+ UploadProgress: function(up, file) {
+ var d = document.getElementById(file.id);
+ d.getElementsByTagName('b')[0].innerHTML = '
' + file.percent + "%";
+ var prog = d.getElementsByTagName('div')[0];
+ var progBar = prog.getElementsByTagName('div')[0]
+ progBar.style.width = 2 * file.percent + 'px';
+ progBar.setAttribute('aria-valuenow', file.percent);
+ },
+
+ FileUploaded: function(up, file, info) {
+ if(info.status == 200) {
+ document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = '
 + ')
';
+ } else {
+ document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response;
+ }
+ },
+
+ Error: function(up, err) {
+ if(err.code == -600) {
+ mui.alert("\n选择的文件太大了");
+ } else if(err.code == -601) {
+ mui.alert("\n选择的文件后缀不对");
+ } else if(err.code == -602) {
+ mui.alert("\n这个文件已经上传过一遍了");
+ } else {
+ mui.alert("\nError xml:" + err.response);
+ }
+ }
+ }
+});
+
uploader.init();
\ No newline at end of file
diff --git a/static/app2/js/uploadVoucher.js b/static/app2/js/uploadVoucher.js
old mode 100755
new mode 100644
index 0a39dee..c5d7f95
--- a/static/app2/js/uploadVoucher.js
+++ b/static/app2/js/uploadVoucher.js
@@ -1,48 +1,50 @@
-mui.init({
- beforeback: function() { //获得父页面的webview
- var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
- mui.fire(list, 'reload');
- //返回true,继续页面关闭逻辑
- return true;
- },
-})
-mui.plusReady(function() {
- var orderId = '';
- var self = plus.webview.currentWebview()
- orderId = self.orderId
- // 上传图片
- $(".oneImg").on("tap", '#img', function() {
- // UP.init("accountBookImg", "test", "accountBookImgTag")
-
- UP.init("imgUrl", "test", "img")
- openCamera()
- })
-
- var click = false;
- $("body").on("tap", '.bc_btn', function() {
- if (click == true) return;
-
- click = true;
- var params = JZL.getParams(".inp");
- params.orderId = orderId
- if ('' == $.trim($('#content').val())) {
- mui.alert("请输入凭证说明")
- return;
- }
- if ('' == $('#imgUrl').val()) {
- mui.alert("请上传凭证图片")
- return;
- }
-
- JZL.ajax(qlgUrl('app/orders/uploadCertificate'), params, function(data) {
- if (1 == data.status) {
- mui.alert(data.msg);
- mui.back()
- } else {
- mui.alert(data.msg)
- }
- })
-
-
- })
+mui.init({
+ beforeback: function() { //获得父页面的webview
+ var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新
+ mui.fire(list, 'reload');
+ //返回true,继续页面关闭逻辑
+ return true;
+ },
+})
+mui.plusReady(function() {
+ var orderId = '';
+ var self = plus.webview.currentWebview()
+ orderId = self.orderId
+ // 上传图片
+ $(".oneImg").on("tap", '#img', function() {
+ // UP.init("accountBookImg", "test", "accountBookImgTag")
+
+ UP.init("imgUrl", "test", "img")
+ openCamera()
+ })
+
+ var click = false;
+ $("body").on("tap", '.bc_btn', function() {
+ if (click == true) return;
+
+ click = true;
+ var params = JZL.getParams(".inp");
+ params.orderId = orderId
+ if ('' == $.trim($('#content').val())) {
+ mui.alert("请输入凭证说明")
+ click = false;
+ return;
+ }
+ if ('' == $('#imgUrl').val()) {
+ mui.alert("请上传凭证图片")
+ click = false;
+ return;
+ }
+
+ JZL.ajax(qlgUrl('app/orders/uploadCertificate'), params, function(data) {
+ if (1 == data.status) {
+ mui.alert(data.msg);
+ mui.back()
+ } else {
+ mui.alert(data.msg)
+ }
+ })
+
+
+ })
})
diff --git a/static/app2/js/uploader.js b/static/app2/js/uploader.js
old mode 100755
new mode 100644
index b453401..6454476
--- a/static/app2/js/uploader.js
+++ b/static/app2/js/uploader.js
@@ -1,226 +1,226 @@
-var files = []; //存储文件信息的数组
-var fname = ""; //表示文件名,例如 XXXX.jpg;
-var expire = 0;
-var pathName = '';
-var inpId = '';
-var keyname = '';
-var imgId='';
-var isZip=1;
-var qualityNum=90;
-var response=';'
-var UP = UP || {};
-UP.isBatch=0;
-UP.init = function(inputId, path,imageId,isBatch,isZipImg,quality) {
- inpId = inputId;
- pathName = path;
- imgId = imageId;
- if(typeof(isBatch) != 'undefined'){
- UP.isBatch = isBatch;
- }
- if(typeof(isZipImg) != 'undefined'){
- // //console.log(typeof(isZipImg));
- isZip = isZipImg;
- }
- if(typeof(quality) != 'undefined'){
- qualityNum = quality;
- }
-
-}
-
-function send_request() {
- var xmlhttp = null;
- if (window.XMLHttpRequest) {
- xmlhttp = new XMLHttpRequest();
- } else if (window.ActiveXObject) {
- xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
- }
-
- if (xmlhttp != null) {
- // //console.log(dir)
- serverUrl = qlgUrl('oss/get.php?dir=' + pathName);
- // serverUrl = 'https://img.zgqlg.com.cn/oss/get.php?dir=' + pathName;
-
- xmlhttp.open("GET", serverUrl, false);
- xmlhttp.send(null);
- return xmlhttp.responseText;
- } else {
- mui.alert("Your browser does not support XMLHTTP.");
- }
-
-}
-
-function get_signature() {
- //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲
- now = timestamp = Date.parse(new Date()) / 1000;
- if (expire < now + 3) {
- body = send_request()
- var obj = eval("(" + body + ")");
- response = obj;
- // //console.log(obj);
- }
- return response;
-};
-// 上传文件
-function upload(callback) {
- // //console.log(files);
- if (files.length <= 0) {
- mui.toast('没有添加上传文件');
- return;
- }
- var obj = get_signature();
- if (obj) {
- server = obj['host'];
- policyBase64 = obj['policy'];
- accessid = obj['accessid'];
- signature = obj['signature'];
- expire = parseInt(obj['expire']);
- callbackbody = obj['callback'];
- path = obj['dir'];
-
- } else {
- mui.toast('初始化失败');
- return;
- }
-
- var wt = plus.nativeUI.showWaiting();
- var task = plus.uploader.createUpload(server, {
- method: "POST"
- }, function(t, status) {
- //上传完成
- if (status == 200) {
- wt.close();
- if(1 == UP.isBatch){
- callback(t,status,keyname,server + '/'+keyname);
- }else{
- document.getElementById(inpId).value = keyname;
- var ele=document.getElementById(imgId);
- ele.src=server + '/'+keyname;
- ele.setAttribute('data-src',keyname);
- mui.toast('上传成功');
- //至此上传成功,上传后的图片完整地址为server+testName
- //keyname
- }
-
- } else {
- wt.close();
- mui.toast('上传失败:' + status);
- }
- });
- var suffix1 = get_suffix(fname); //文件后缀 例如 .jpg
- keyname = path + new Date().getTime() + suffix1;
- task.addData("key", keyname);
- task.addData("policy", policyBase64);
- task.addData("OSSAccessKeyId", accessid);
- task.addData("success_action_status", "200");
- // task.addData("callback", callbackbody);
- task.addData("signature", signature);
- var f = files[files.length-1];
- // //console.log(f)
-
- task.addFile(f.path, {
- key: "file",
- name: "file",
- mime: "image/jpeg"
- });
- //files.length = 0;
- task.start();
-
-}
-
-//得到文件名的后缀
-function get_suffix(filename) {
- var pos = filename.lastIndexOf('.');
- var suffix = '';
- if (pos != -1) {
- suffix = filename.substring(pos)
- }
- return suffix;
-}
-// 拍照添加文件
-function appendByCamera(callback) {
- plus.camera.getCamera().captureImage(function(p) {
- uploadImg(p,callback);
- });
-}
-// 从相册添加文件
-function appendByGallery(callback) {
- plus.gallery.pick(function(p) {
- uploadImg(p,callback);
- });
-}
-
-// 添加文件
-var index = 1;
-function uploadImg(p,callback){
- if(1 == isZip){
- compressImg(p,callback);
- }else{
- appendFile(p,callback)
- }
-}
-function appendFile(p,callback) {
- // var fe = document.getElementById(fileId);
- var n = p.substr(p.lastIndexOf('/') + 1);
- fname = n;
- files.push({
- name: "uploadkey" + index,
- path: p
- });
- ////console.log(3);
- // index++;
- upload(callback);
-}
-function compressImg(src,callback) {
- var filename = src.substring(src.lastIndexOf('/') + 1);
- var opions = {
- src: src,
- dst: '_doc/tmp/' + filename,
- overwrite: true,
- //width: '300px', //这里指定了宽度,同样可以修改
- format: 'jpg',
- quality: qualityNum //图片质量不再修改,以免失真
- };
- var successCB = function(evt) {
- // //console.log(JSON.stringify(evt));
- fname = filename;
-// files[0]={
-// name: "uploadkey",
-// path: evt.target
-// };
- files.push({
- name: "uploadkey" + index,
- path: evt.target
- });
- // index++;
- //上传
- upload(callback);
- //_this.avatar(evt.target);
- };
- var errorCB = function(err) {
- appendFile(src,callback);
- ////console.log(JSON.stringify(err));
- //mui.toast("图片压缩失败");
- };
- plus.zip.compressImage(opions, successCB, errorCB);
-};
-function openCamera(callback) {
- plus.nativeUI.actionSheet({
- cancel: "取消",
- buttons: [{
- title: "拍照"
- },
- {
- title: "从相册中选择"
- }
- ]
- }, function(e) { //1 是拍照 2 从相册中选择
- switch (e.index) {
- case 1:
- appendByCamera(callback);
- break;
- case 2:
- appendByGallery(callback);
- break;
- }
- });
+var files = []; //存储文件信息的数组
+var fname = ""; //表示文件名,例如 XXXX.jpg;
+var expire = 0;
+var pathName = '';
+var inpId = '';
+var keyname = '';
+var imgId='';
+var isZip=1;
+var qualityNum=90;
+var response=';'
+var UP = UP || {};
+UP.isBatch=0;
+UP.init = function(inputId, path,imageId,isBatch,isZipImg,quality) {
+ inpId = inputId;
+ pathName = path;
+ imgId = imageId;
+ if(typeof(isBatch) != 'undefined'){
+ UP.isBatch = isBatch;
+ }
+ if(typeof(isZipImg) != 'undefined'){
+ // //console.log(typeof(isZipImg));
+ isZip = isZipImg;
+ }
+ if(typeof(quality) != 'undefined'){
+ qualityNum = quality;
+ }
+
+}
+
+function send_request() {
+ var xmlhttp = null;
+ if (window.XMLHttpRequest) {
+ xmlhttp = new XMLHttpRequest();
+ } else if (window.ActiveXObject) {
+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+
+ if (xmlhttp != null) {
+ // //console.log(dir)
+ serverUrl = qlgUrl('oss/get.php?dir=' + pathName);
+ // serverUrl = 'https://img.zgqlg.com.cn/oss/get.php?dir=' + pathName;
+
+ xmlhttp.open("GET", serverUrl, false);
+ xmlhttp.send(null);
+ return xmlhttp.responseText;
+ } else {
+ mui.alert("Your browser does not support XMLHTTP.");
+ }
+
+}
+
+function get_signature() {
+ //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲
+ now = timestamp = Date.parse(new Date()) / 1000;
+ if (expire < now + 3) {
+ body = send_request()
+ var obj = eval("(" + body + ")");
+ response = obj;
+ // //console.log(obj);
+ }
+ return response;
+};
+// 上传文件
+function upload(callback) {
+ // //console.log(files);
+ if (files.length <= 0) {
+ mui.toast('没有添加上传文件');
+ return;
+ }
+ var obj = get_signature();
+ if (obj) {
+ server = obj['host'];
+ policyBase64 = obj['policy'];
+ accessid = obj['accessid'];
+ signature = obj['signature'];
+ expire = parseInt(obj['expire']);
+ callbackbody = obj['callback'];
+ path = obj['dir'];
+
+ } else {
+ mui.toast('初始化失败');
+ return;
+ }
+
+ var wt = plus.nativeUI.showWaiting();
+ var task = plus.uploader.createUpload(server, {
+ method: "POST"
+ }, function(t, status) {
+ //上传完成
+ if (status == 200) {
+ wt.close();
+ if(1 == UP.isBatch){
+ callback(t,status,keyname,server + '/'+keyname);
+ }else{
+ document.getElementById(inpId).value = keyname;
+ var ele=document.getElementById(imgId);
+ ele.src=server + '/'+keyname;
+ ele.setAttribute('data-src',keyname);
+ mui.toast('上传成功');
+ //至此上传成功,上传后的图片完整地址为server+testName
+ //keyname
+ }
+
+ } else {
+ wt.close();
+ mui.toast('上传失败:' + status);
+ }
+ });
+ var suffix1 = get_suffix(fname); //文件后缀 例如 .jpg
+ keyname = path + new Date().getTime() + suffix1;
+ task.addData("key", keyname);
+ task.addData("policy", policyBase64);
+ task.addData("OSSAccessKeyId", accessid);
+ task.addData("success_action_status", "200");
+ // task.addData("callback", callbackbody);
+ task.addData("signature", signature);
+ var f = files[files.length-1];
+ // //console.log(f)
+
+ task.addFile(f.path, {
+ key: "file",
+ name: "file",
+ mime: "image/jpeg"
+ });
+ //files.length = 0;
+ task.start();
+
+}
+
+//得到文件名的后缀
+function get_suffix(filename) {
+ var pos = filename.lastIndexOf('.');
+ var suffix = '';
+ if (pos != -1) {
+ suffix = filename.substring(pos)
+ }
+ return suffix;
+}
+// 拍照添加文件
+function appendByCamera(callback) {
+ plus.camera.getCamera().captureImage(function(p) {
+ uploadImg(p,callback);
+ });
+}
+// 从相册添加文件
+function appendByGallery(callback) {
+ plus.gallery.pick(function(p) {
+ uploadImg(p,callback);
+ });
+}
+
+// 添加文件
+var index = 1;
+function uploadImg(p,callback){
+ if(1 == isZip){
+ compressImg(p,callback);
+ }else{
+ appendFile(p,callback)
+ }
+}
+function appendFile(p,callback) {
+ // var fe = document.getElementById(fileId);
+ var n = p.substr(p.lastIndexOf('/') + 1);
+ fname = n;
+ files.push({
+ name: "uploadkey" + index,
+ path: p
+ });
+ ////console.log(3);
+ // index++;
+ upload(callback);
+}
+function compressImg(src,callback) {
+ var filename = src.substring(src.lastIndexOf('/') + 1);
+ var opions = {
+ src: src,
+ dst: '_doc/tmp/' + filename,
+ overwrite: true,
+ //width: '300px', //这里指定了宽度,同样可以修改
+ format: 'jpg',
+ quality: qualityNum //图片质量不再修改,以免失真
+ };
+ var successCB = function(evt) {
+ // //console.log(JSON.stringify(evt));
+ fname = filename;
+// files[0]={
+// name: "uploadkey",
+// path: evt.target
+// };
+ files.push({
+ name: "uploadkey" + index,
+ path: evt.target
+ });
+ // index++;
+ //上传
+ upload(callback);
+ //_this.avatar(evt.target);
+ };
+ var errorCB = function(err) {
+ appendFile(src,callback);
+ ////console.log(JSON.stringify(err));
+ //mui.toast("图片压缩失败");
+ };
+ plus.zip.compressImage(opions, successCB, errorCB);
+};
+function openCamera(callback) {
+ plus.nativeUI.actionSheet({
+ cancel: "取消",
+ buttons: [{
+ title: "拍照"
+ },
+ {
+ title: "从相册中选择"
+ }
+ ]
+ }, function(e) { //1 是拍照 2 从相册中选择
+ switch (e.index) {
+ case 1:
+ appendByCamera(callback);
+ break;
+ case 2:
+ appendByGallery(callback);
+ break;
+ }
+ });
}
\ No newline at end of file
diff --git a/static/app2/js/uploaderBatch.js b/static/app2/js/uploaderBatch.js
old mode 100755
new mode 100644
index f98393f..28906ba
--- a/static/app2/js/uploaderBatch.js
+++ b/static/app2/js/uploaderBatch.js
@@ -1,219 +1,219 @@
-var files = []; //存储文件信息的数组
-var fname = ""; //表示文件名,例如 XXXX.jpg;
-var expire = 0;
-var pathName = '';
-var keyname = '';
-var isZip=1;
-var qualityNum=90;
-var UP = UP || {};
-UP.isOk=0;
-UP.init = function( path,isZipImg,quality) {
- pathName = path;
- if(typeof(isZipImg) != 'undefined'){
- // //console.log(typeof(isZipImg));
- isZip = isZipImg;
- }
- if(typeof(quality) != 'undefined'){
- qualityNum = quality;
- }
-}
-
-function send_request() {
- var xmlhttp = null;
- if (window.XMLHttpRequest) {
- xmlhttp = new XMLHttpRequest();
- } else if (window.ActiveXObject) {
- xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
- }
-
- if (xmlhttp != null) {
- // //console.log(dir)
- serverUrl = 'http://t.ect99.com/oss/get.php?dir=' + pathName;
- xmlhttp.open("GET", serverUrl, false);
- xmlhttp.send(null);
- return xmlhttp.responseText
- } else {
- mui.alert("Your browser does not support XMLHTTP.");
- }
-
-}
-
-function get_signature() {
- //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲
- now = timestamp = Date.parse(new Date()) / 1000;
- if (expire < now + 3) {
- body = send_request()
- var obj = eval("(" + body + ")");
- // //console.log(obj);
- return obj;
- }
- return false;
-};
-// 上传文件
-function uploadInit(){
- // //console.log(files);
- if (files.length <= 0) {
- mui.toast('没有添加上传文件');
- return;
- }
- var obj = get_signature();
- if (obj) {
- server = obj['host'];
- policyBase64 = obj['policy'];
- accessid = obj['accessid'];
- signature = obj['signature'];
- expire = parseInt(obj['expire']);
- callbackbody = obj['callback'];
- path = obj['dir'];
-
- } else {
- mui.toast('初始化失败');
- return;
- }
- var suffix1 = get_suffix(fname); //文件后缀 例如 .jpg
- keyname = path + new Date().getTime() + suffix1;
- task.addData("key", keyname);
- task.addData("policy", policyBase64);
- task.addData("OSSAccessKeyId", accessid);
- task.addData("success_action_status", "200");
- // task.addData("callback", callbackbody);
- task.addData("signature", signature);
- var f = files[files.length-1];
- // //console.log(f)
-
- task.addFile(f.path, {
- key: "file",
- name: "file",
- mime: "image/jpeg"
- });
- //files.length = 0;
- return true;
-}
-// //上传完成
-// if (status == 200) {
-//
-// //console.log(inpId);
-// document.getElementById(inpId).value = keyname;
-// var ele=document.getElementById(imgId);
-// ele.src=server + '/'+keyname;
-// ele.setAttribute('data-src',keyname);
-// wt.close();
-// mui.toast('上传成功');
-// UP.isOk=1;
-// if(1 == UP.isOk){
-// var html='
![]()
';
-// if($('#galleryImg['+num+']').length>0){
-// $('#galleryImg['+num+']').parent().html(html);
-//
-//
-// }else{
-// $(".photos_con").append(html);
-// var maxNum = $('.photos_con').children('.galleryImg').length-1;
-// if(num >= maxNum){
-// html='
![]()
';
-// $(".photos_con").append(html);
-// }
-//
-// }
-// }
- //至此上传成功,上传后的图片完整地址为server+testName
-
-
-//得到文件名的后缀
-function get_suffix(filename) {
- var pos = filename.lastIndexOf('.');
- var suffix = '';
- if (pos != -1) {
- suffix = filename.substring(pos)
- }
- return suffix;
-}
-// 拍照添加文件
-function appendByCamera() {
- plus.camera.getCamera().captureImage(function(p) {
- uploadImg(p);
- });
-}
-// 从相册添加文件
-function appendByGallery() {
- plus.gallery.pick(function(p) {
- uploadImg(p);
- });
-}
-
-// 添加文件
-var index = 1;
-function uploadImg(p){
- UP.isOk=0;
- if(1 == isZip){
- compressImg(p);
- }else{
- appendFile(p)
- }
-}
-function appendFile(p) {
- // var fe = document.getElementById(fileId);
- var n = p.substr(p.lastIndexOf('/') + 1);
- fname = n;
- files.push({
- name: "uploadkey" + index,
- path: p
- });
- ////console.log(3);
- // index++;
- upload();
-}
-function compressImg(src) {
- var filename = src.substring(src.lastIndexOf('/') + 1);
- var opions = {
- src: src,
- dst: '_doc/tmp/' + filename,
- overwrite: true,
- //width: '300px', //这里指定了宽度,同样可以修改
- format: 'jpg',
- quality: qualityNum //图片质量不再修改,以免失真
- };
- var successCB = function(evt) {
- // //console.log(JSON.stringify(evt));
- fname = filename;
-// files[0]={
-// name: "uploadkey",
-// path: evt.target
-// };
- files.push({
- name: "uploadkey" + index,
- path: evt.target
- });
- // index++;
- //上传
- upload();
- //_this.avatar(evt.target);
- };
- var errorCB = function(err) {
- appendFile(src);
- ////console.log(JSON.stringify(err));
- //mui.toast("图片压缩失败");
- };
- plus.zip.compressImage(opions, successCB, errorCB);
-};
-function openCamera() {
- plus.nativeUI.actionSheet({
- cancel: "取消",
- buttons: [{
- title: "拍照"
- },
- {
- title: "从相册中选择"
- }
- ]
- }, function(e) { //1 是拍照 2 从相册中选择
- switch (e.index) {
- case 1:
- appendByCamera();
- break;
- case 2:
- appendByGallery();
- break;
- }
- });
+var files = []; //存储文件信息的数组
+var fname = ""; //表示文件名,例如 XXXX.jpg;
+var expire = 0;
+var pathName = '';
+var keyname = '';
+var isZip=1;
+var qualityNum=90;
+var UP = UP || {};
+UP.isOk=0;
+UP.init = function( path,isZipImg,quality) {
+ pathName = path;
+ if(typeof(isZipImg) != 'undefined'){
+ // //console.log(typeof(isZipImg));
+ isZip = isZipImg;
+ }
+ if(typeof(quality) != 'undefined'){
+ qualityNum = quality;
+ }
+}
+
+function send_request() {
+ var xmlhttp = null;
+ if (window.XMLHttpRequest) {
+ xmlhttp = new XMLHttpRequest();
+ } else if (window.ActiveXObject) {
+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+
+ if (xmlhttp != null) {
+ // //console.log(dir)
+ serverUrl = 'http://t.ect99.com/oss/get.php?dir=' + pathName;
+ xmlhttp.open("GET", serverUrl, false);
+ xmlhttp.send(null);
+ return xmlhttp.responseText
+ } else {
+ mui.alert("Your browser does not support XMLHTTP.");
+ }
+
+}
+
+function get_signature() {
+ //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲
+ now = timestamp = Date.parse(new Date()) / 1000;
+ if (expire < now + 3) {
+ body = send_request()
+ var obj = eval("(" + body + ")");
+ // //console.log(obj);
+ return obj;
+ }
+ return false;
+};
+// 上传文件
+function uploadInit(){
+ // //console.log(files);
+ if (files.length <= 0) {
+ mui.toast('没有添加上传文件');
+ return;
+ }
+ var obj = get_signature();
+ if (obj) {
+ server = obj['host'];
+ policyBase64 = obj['policy'];
+ accessid = obj['accessid'];
+ signature = obj['signature'];
+ expire = parseInt(obj['expire']);
+ callbackbody = obj['callback'];
+ path = obj['dir'];
+
+ } else {
+ mui.toast('初始化失败');
+ return;
+ }
+ var suffix1 = get_suffix(fname); //文件后缀 例如 .jpg
+ keyname = path + new Date().getTime() + suffix1;
+ task.addData("key", keyname);
+ task.addData("policy", policyBase64);
+ task.addData("OSSAccessKeyId", accessid);
+ task.addData("success_action_status", "200");
+ // task.addData("callback", callbackbody);
+ task.addData("signature", signature);
+ var f = files[files.length-1];
+ // //console.log(f)
+
+ task.addFile(f.path, {
+ key: "file",
+ name: "file",
+ mime: "image/jpeg"
+ });
+ //files.length = 0;
+ return true;
+}
+// //上传完成
+// if (status == 200) {
+//
+// //console.log(inpId);
+// document.getElementById(inpId).value = keyname;
+// var ele=document.getElementById(imgId);
+// ele.src=server + '/'+keyname;
+// ele.setAttribute('data-src',keyname);
+// wt.close();
+// mui.toast('上传成功');
+// UP.isOk=1;
+// if(1 == UP.isOk){
+// var html='
![]()
';
+// if($('#galleryImg['+num+']').length>0){
+// $('#galleryImg['+num+']').parent().html(html);
+//
+//
+// }else{
+// $(".photos_con").append(html);
+// var maxNum = $('.photos_con').children('.galleryImg').length-1;
+// if(num >= maxNum){
+// html='
![]()
';
+// $(".photos_con").append(html);
+// }
+//
+// }
+// }
+ //至此上传成功,上传后的图片完整地址为server+testName
+
+
+//得到文件名的后缀
+function get_suffix(filename) {
+ var pos = filename.lastIndexOf('.');
+ var suffix = '';
+ if (pos != -1) {
+ suffix = filename.substring(pos)
+ }
+ return suffix;
+}
+// 拍照添加文件
+function appendByCamera() {
+ plus.camera.getCamera().captureImage(function(p) {
+ uploadImg(p);
+ });
+}
+// 从相册添加文件
+function appendByGallery() {
+ plus.gallery.pick(function(p) {
+ uploadImg(p);
+ });
+}
+
+// 添加文件
+var index = 1;
+function uploadImg(p){
+ UP.isOk=0;
+ if(1 == isZip){
+ compressImg(p);
+ }else{
+ appendFile(p)
+ }
+}
+function appendFile(p) {
+ // var fe = document.getElementById(fileId);
+ var n = p.substr(p.lastIndexOf('/') + 1);
+ fname = n;
+ files.push({
+ name: "uploadkey" + index,
+ path: p
+ });
+ ////console.log(3);
+ // index++;
+ upload();
+}
+function compressImg(src) {
+ var filename = src.substring(src.lastIndexOf('/') + 1);
+ var opions = {
+ src: src,
+ dst: '_doc/tmp/' + filename,
+ overwrite: true,
+ //width: '300px', //这里指定了宽度,同样可以修改
+ format: 'jpg',
+ quality: qualityNum //图片质量不再修改,以免失真
+ };
+ var successCB = function(evt) {
+ // //console.log(JSON.stringify(evt));
+ fname = filename;
+// files[0]={
+// name: "uploadkey",
+// path: evt.target
+// };
+ files.push({
+ name: "uploadkey" + index,
+ path: evt.target
+ });
+ // index++;
+ //上传
+ upload();
+ //_this.avatar(evt.target);
+ };
+ var errorCB = function(err) {
+ appendFile(src);
+ ////console.log(JSON.stringify(err));
+ //mui.toast("图片压缩失败");
+ };
+ plus.zip.compressImage(opions, successCB, errorCB);
+};
+function openCamera() {
+ plus.nativeUI.actionSheet({
+ cancel: "取消",
+ buttons: [{
+ title: "拍照"
+ },
+ {
+ title: "从相册中选择"
+ }
+ ]
+ }, function(e) { //1 是拍照 2 从相册中选择
+ switch (e.index) {
+ case 1:
+ appendByCamera();
+ break;
+ case 2:
+ appendByGallery();
+ break;
+ }
+ });
}
\ No newline at end of file
diff --git a/static/app2/js/uploadqiniu.js b/static/app2/js/uploadqiniu.js
old mode 100755
new mode 100644
index 725a0ce..9445677
--- a/static/app2/js/uploadqiniu.js
+++ b/static/app2/js/uploadqiniu.js
@@ -1,92 +1,92 @@
-function uploadInit(btnId,containerId,textElemId) {
- // 获取相关 DOM 节点的 ID
-// var btnId = editor.imgMenuId;
-// var containerId = editor.toolbarElemId;
-// var textElemId = editor.textElemId;
-// var btnId ='';
-// var containerId =''
-// var textElemId = ''
- // 创建上传对象
- var uploader = new Qiniu.uploader({
- runtimes: 'html5,flash,html4', //上传模式,依次退化
- browse_button: btnId, //上传选择的点选按钮,**必需**
- uptoken_url: '/uptoken',
- //Ajax请求upToken的Url,**强烈建议设置**(服务端提供)
- // uptoken : '
',
- //若未指定uptoken_url,则必须指定 uptoken ,uptoken由其他程序生成
- // unique_names: true,
- // 默认 false,key为文件名。若开启该选项,SDK会为每个文件自动生成key(文件名)
- // save_key: true,
- // 默认 false。若在服务端生成uptoken的上传策略中指定了 `sava_key`,则开启,SDK在前端将不对key进行任何处理
- domain: 'http://7xrjl5.com1.z0.glb.clouddn.com/',
- //bucket 域名,下载资源时用到,**必需**
- container: containerId, //上传区域DOM ID,默认是browser_button的父元素,
- max_file_size: '100mb', //最大文件体积限制
- flash_swf_url: '../js/plupload/Moxie.swf', //引入flash,相对路径
- filters: {
- mime_types: [
- //只允许上传图片文件 (注意,extensions中,逗号后面不要加空格)
- { title: "图片文件", extensions: "jpg,gif,png,bmp" }
- ]
- },
- max_retries: 3, //上传失败最大重试次数
- dragdrop: true, //开启可拖曳上传
- drop_element: textElemId, //拖曳上传区域元素的ID,拖曳文件或文件夹后可触发上传
- chunk_size: '4mb', //分块上传时,每片的体积
- auto_start: true, //选择文件后自动上传,若关闭需要自己绑定事件触发上传
- init: {
- 'FilesAdded': function(up, files) {
- plupload.each(files, function(file) {
- // 文件添加进队列后,处理相关的事情
- printLog('on FilesAdded');
- });
- },
- 'BeforeUpload': function(up, file) {
- // 每个文件上传前,处理相关的事情
- printLog('on BeforeUpload');
- },
- 'UploadProgress': function(up, file) {
- // 显示进度
- printLog('进度 ' + file.percent)
- },
- 'FileUploaded': function(up, file, info) {
- // 每个文件上传成功后,处理相关的事情
- // 其中 info 是文件上传成功后,服务端返回的json,形式如
- // {
- // "hash": "Fh8xVqod2MQ1mocfI4S4KpRL6D98",
- // "key": "gogopher.jpg"
- // }
- printLog(info);
- // 参考http://developer.qiniu.com/docs/v6/api/overview/up/response/simple-response.html
-
- var domain = up.getOption('domain');
- var res = $.parseJSON(info);
- var sourceLink = domain + res.key; //获取上传成功后的文件的Url
-
- printLog(sourceLink);
-
- // 插入图片到editor
- editor.cmd.do('insertHtml', '
')
- },
- 'Error': function(up, err, errTip) {
- //上传出错时,处理相关的事情
- printLog('on Error');
- },
- 'UploadComplete': function() {
- //队列文件处理完毕后,处理相关的事情
- printLog('on UploadComplete');
- }
- // Key 函数如果有需要自行配置,无特殊需要请注释
- //,
- // 'Key': function(up, file) {
- // // 若想在前端对每个文件的key进行个性化处理,可以配置该函数
- // // 该配置必须要在 unique_names: false , save_key: false 时才生效
- // var key = "";
- // // do something with key here
- // return key
- // }
- }
- // domain 为七牛空间(bucket)对应的域名,选择某个空间后,可通过"空间设置->基本设置->域名设置"查看获取
- // uploader 为一个plupload对象,继承了所有plupload的方法,参考http://plupload.com/docs
- });
-}
+function uploadInit(btnId,containerId,textElemId) {
+ // 获取相关 DOM 节点的 ID
+// var btnId = editor.imgMenuId;
+// var containerId = editor.toolbarElemId;
+// var textElemId = editor.textElemId;
+// var btnId ='';
+// var containerId =''
+// var textElemId = ''
+ // 创建上传对象
+ var uploader = new Qiniu.uploader({
+ runtimes: 'html5,flash,html4', //上传模式,依次退化
+ browse_button: btnId, //上传选择的点选按钮,**必需**
+ uptoken_url: '/uptoken',
+ //Ajax请求upToken的Url,**强烈建议设置**(服务端提供)
+ // uptoken : '',
+ //若未指定uptoken_url,则必须指定 uptoken ,uptoken由其他程序生成
+ // unique_names: true,
+ // 默认 false,key为文件名。若开启该选项,SDK会为每个文件自动生成key(文件名)
+ // save_key: true,
+ // 默认 false。若在服务端生成uptoken的上传策略中指定了 `sava_key`,则开启,SDK在前端将不对key进行任何处理
+ domain: 'http://7xrjl5.com1.z0.glb.clouddn.com/',
+ //bucket 域名,下载资源时用到,**必需**
+ container: containerId, //上传区域DOM ID,默认是browser_button的父元素,
+ max_file_size: '100mb', //最大文件体积限制
+ flash_swf_url: '../js/plupload/Moxie.swf', //引入flash,相对路径
+ filters: {
+ mime_types: [
+ //只允许上传图片文件 (注意,extensions中,逗号后面不要加空格)
+ { title: "图片文件", extensions: "jpg,gif,png,bmp" }
+ ]
+ },
+ max_retries: 3, //上传失败最大重试次数
+ dragdrop: true, //开启可拖曳上传
+ drop_element: textElemId, //拖曳上传区域元素的ID,拖曳文件或文件夹后可触发上传
+ chunk_size: '4mb', //分块上传时,每片的体积
+ auto_start: true, //选择文件后自动上传,若关闭需要自己绑定事件触发上传
+ init: {
+ 'FilesAdded': function(up, files) {
+ plupload.each(files, function(file) {
+ // 文件添加进队列后,处理相关的事情
+ printLog('on FilesAdded');
+ });
+ },
+ 'BeforeUpload': function(up, file) {
+ // 每个文件上传前,处理相关的事情
+ printLog('on BeforeUpload');
+ },
+ 'UploadProgress': function(up, file) {
+ // 显示进度
+ printLog('进度 ' + file.percent)
+ },
+ 'FileUploaded': function(up, file, info) {
+ // 每个文件上传成功后,处理相关的事情
+ // 其中 info 是文件上传成功后,服务端返回的json,形式如
+ // {
+ // "hash": "Fh8xVqod2MQ1mocfI4S4KpRL6D98",
+ // "key": "gogopher.jpg"
+ // }
+ printLog(info);
+ // 参考http://developer.qiniu.com/docs/v6/api/overview/up/response/simple-response.html
+
+ var domain = up.getOption('domain');
+ var res = $.parseJSON(info);
+ var sourceLink = domain + res.key; //获取上传成功后的文件的Url
+
+ printLog(sourceLink);
+
+ // 插入图片到editor
+ editor.cmd.do('insertHtml', '
')
+ },
+ 'Error': function(up, err, errTip) {
+ //上传出错时,处理相关的事情
+ printLog('on Error');
+ },
+ 'UploadComplete': function() {
+ //队列文件处理完毕后,处理相关的事情
+ printLog('on UploadComplete');
+ }
+ // Key 函数如果有需要自行配置,无特殊需要请注释
+ //,
+ // 'Key': function(up, file) {
+ // // 若想在前端对每个文件的key进行个性化处理,可以配置该函数
+ // // 该配置必须要在 unique_names: false , save_key: false 时才生效
+ // var key = "";
+ // // do something with key here
+ // return key
+ // }
+ }
+ // domain 为七牛空间(bucket)对应的域名,选择某个空间后,可通过"空间设置->基本设置->域名设置"查看获取
+ // uploader 为一个plupload对象,继承了所有plupload的方法,参考http://plupload.com/docs
+ });
+}
diff --git a/static/app2/js/vouchers.js b/static/app2/js/vouchers.js
old mode 100755
new mode 100644
index e6b79f6..bff4f29
--- a/static/app2/js/vouchers.js
+++ b/static/app2/js/vouchers.js
@@ -1,92 +1,92 @@
-var vouchersType = '',
- isExpected = '';
-var data_href = '';
-var pageSize = 10;
-var count = 1;
-var isLoading = false;
-mui.plusReady(function() {
-
- var self = plus.webview.currentWebview();
-
- vouchersType = self.data_type;
- isExpected = self.data_expect;
- data_href = self.data_href;
-
- getvoucherList(count, pageSize);
-
- switch (data_href) {
- case "expectedProduct":
- $('.title').html('预获产品券');
-
- break;
- case "expectedCoupons":
- $('.title').text('预获优惠券');
- break;
- case "expectedWang":
- $('.title').text('预获旺旺券');
- break
- case "coupons":
- $('.title').text('已获优惠券');
- break
- case "product":
- $('.title').text('已获产品券');
- break
- case "wang":
- $('.title').text('已获旺旺券');
- break
-
- }
-
-
- function getvoucherList(count, pageSize) {
- if (true == isLoading) return;
- isLoading = true;
- JZL.ajax(qlgUrl('app/Uservouchers/getVouchers'), {
- page: count,
- perPage: pageSize,
- vouchersType: vouchersType,
- isExpected: isExpected,
- }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- // console.log(data);
- var data = toJson(data);
- if (data.status == 1) {
- data = data.data;
- if (data.Rows == '') {
- $('.con').append(
- '没有更多数据
');
- return;
- }
- var html = ''
- $.each(data.Rows, function() {
- html += '' + this.num +
- '
' + this.remark + '
' + this.createTime +
- '
';
- })
- if (count == 1) {
- $('.con').html(html);
- } else {
- $('.con').append(html);
- }
- } else {
- mui.alert(data.msg)
- }
- isLoading = false;
- });
- }
-
-
- document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
- if (e.cancelable) {
- // 判断默认行为是否已经被禁用
- if (!e.defaultPrevented) {
- e.preventDefault();
- }
- }
- if (scroll.y == scroll.maxScrollY) {
- if (isLoading == false) {
- count++;
- getvoucherList(count, pageSize)
- }
- }
- })
+var vouchersType = '',
+ isExpected = '';
+var data_href = '';
+var pageSize = 10;
+var count = 1;
+var isLoading = false;
+mui.plusReady(function() {
+
+ var self = plus.webview.currentWebview();
+
+ vouchersType = self.data_type;
+ isExpected = self.data_expect;
+ data_href = self.data_href;
+
+ getvoucherList(count, pageSize);
+
+ switch (data_href) {
+ case "expectedProduct":
+ $('.title').html('预获产品券');
+
+ break;
+ case "expectedCoupons":
+ $('.title').text('预获优惠券');
+ break;
+ case "expectedWang":
+ $('.title').text('预获旺旺券');
+ break
+ case "coupons":
+ $('.title').text('已获优惠券');
+ break
+ case "product":
+ $('.title').text('已获产品券');
+ break
+ case "wang":
+ $('.title').text('已获旺旺券');
+ break
+
+ }
+
+
+ function getvoucherList(count, pageSize) {
+ if (true == isLoading) return;
+ isLoading = true;
+ JZL.ajax(qlgUrl('app/Uservouchers/getVouchers'), {
+ page: count,
+ perPage: pageSize,
+ vouchersType: vouchersType,
+ isExpected: isExpected,
+ }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ // console.log(data);
+ var data = toJson(data);
+ if (data.status == 1) {
+ data = data.data;
+ if (data.Rows == '') {
+ $('.con').append(
+ '没有更多数据
');
+ return;
+ }
+ var html = ''
+ $.each(data.Rows, function() {
+ html += '' + this.num +
+ '
' + this.remark + '
' + this.createTime +
+ '
';
+ })
+ if (count == 1) {
+ $('.con').html(html);
+ } else {
+ $('.con').append(html);
+ }
+ } else {
+ mui.alert(data.msg)
+ }
+ isLoading = false;
+ });
+ }
+
+
+ document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
+ if (e.cancelable) {
+ // 判断默认行为是否已经被禁用
+ if (!e.defaultPrevented) {
+ e.preventDefault();
+ }
+ }
+ if (scroll.y == scroll.maxScrollY) {
+ if (isLoading == false) {
+ count++;
+ getvoucherList(count, pageSize)
+ }
+ }
+ })
})
diff --git a/static/app2/js/yhk.js b/static/app2/js/yhk.js
old mode 100755
new mode 100644
index 1600e80..29a8b38
--- a/static/app2/js/yhk.js
+++ b/static/app2/js/yhk.js
@@ -1,124 +1,124 @@
-mui.plusReady(function() {
-
- window.addEventListener('reload', function(e) { //执行刷新
- location.reload();
- });
-
- $('.add1').on('tap', function() {
- JZL.openWindow('addyhk.html', 'addyhk.html');
- })
- var yhkid;
- mui('.con').on('tap', '.bj', function() {
- yhkid = $(this).attr("data-id");
- JZL.openWindow('addyhk.html', yhkid);
- })
-
- var page = 1;
- var pageSize = 10;
- var isjiazai = 1;
- getRecommend(page, pageSize);
-
- function getRecommend(page, pageSize) {
- var recommenddata = {
- page: page ? page : 1,
- pageSize: pageSize ? pageSize : 10
- }
- if (isjiazai == 0) {
- return;
- } else {
- isjiazai = 0;
- }
- JZL.ajax(qlgUrl('app/auth/getCompanyBankList'), recommenddata, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- //console.log(data);
- if (data.status == 1) {
- var html = '';
- var data = data.data;
- if ('' == data.Rows) {
- $('.mui-scroll').append(
- '没有更多数据
');
- isjiazai = 0;
- return;
- }
- $.each(data.Rows, function() {
- html += '' + this.accountName +
- '(' + this.bankNo +
- ')
';
- // //console.log(this.id);
-
-
- })
- if (page == 1) {
- $('.con').html(html);
- } else {
- $('.con').append(html);
- }
- } else {
- mui.alert(data.msg)
- }
- isjiazai = 1;
- })
-
- }
- document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
- if (scroll.y == scroll.maxScrollY) {
- if (isjiazai == 1) {
- page++;
- getRecommend(page, pageSize);
- }
- }
- })
-
- $('.con').on('tap', '.del', function() {
-
- yhkid = $(this).attr('data-id');
- if (confirm('确认删除?')) {
- var lxy_div =
- '';
-
- $('body').append(lxy_div);
-
- $('.lxy_zz').on('tap', function(e) {
- e.preventDefault();
- e.stopPropagation()
-
- })
- mui('.lxy_zz_btn').on('tap', '.cancle', function() {
- $('#home_zhezhao').remove();
- return;
- })
-
- mui('.lxy_zz_btn').on('tap', '.sure', function() {
- var payPwd = $('.payword').val();
- if (payPwd == '') {
- mui.alert("请输入密码")
- }
-
- JZL.ajax(qlgUrl('app/auth/delCompanyBank'), {
- id: yhkid,
- payPwd: payPwd
- }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
- //console.log(data);
- var data = toJson(data, 1);
- if (data.status == 1) {
- $('#home_zhezhao').remove();
- location.reload()
-
- } else {
- mui.alert(data.msg)
- }
- })
- // //console.log(data_addressId);
- // mui.ajax(hyhUrl('app/Useraddress/del'), {
-
- });
- }
-
- })
-
-
-
-
-
+mui.plusReady(function() {
+
+ window.addEventListener('reload', function(e) { //执行刷新
+ location.reload();
+ });
+
+ $('.add1').on('tap', function() {
+ JZL.openWindow('addyhk.html', 'addyhk.html');
+ })
+ var yhkid;
+ mui('.con').on('tap', '.bj', function() {
+ yhkid = $(this).attr("data-id");
+ JZL.openWindow('addyhk.html', yhkid);
+ })
+
+ var page = 1;
+ var pageSize = 10;
+ var isjiazai = 1;
+ getRecommend(page, pageSize);
+
+ function getRecommend(page, pageSize) {
+ var recommenddata = {
+ page: page ? page : 1,
+ pageSize: pageSize ? pageSize : 10
+ }
+ if (isjiazai == 0) {
+ return;
+ } else {
+ isjiazai = 0;
+ }
+ JZL.ajax(qlgUrl('app/auth/getCompanyBankList'), recommenddata, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ //console.log(data);
+ if (data.status == 1) {
+ var html = '';
+ var data = data.data;
+ if ('' == data.Rows) {
+ $('.mui-scroll').append(
+ '没有更多数据
');
+ isjiazai = 0;
+ return;
+ }
+ $.each(data.Rows, function() {
+ html += '' + this.accountName +
+ '(' + this.bankNo +
+ ')
';
+ // //console.log(this.id);
+
+
+ })
+ if (page == 1) {
+ $('.con').html(html);
+ } else {
+ $('.con').append(html);
+ }
+ } else {
+ mui.alert(data.msg)
+ }
+ isjiazai = 1;
+ })
+
+ }
+ document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
+ if (scroll.y == scroll.maxScrollY) {
+ if (isjiazai == 1) {
+ page++;
+ getRecommend(page, pageSize);
+ }
+ }
+ })
+
+ $('.con').on('tap', '.del', function() {
+
+ yhkid = $(this).attr('data-id');
+ if (confirm('确认删除?')) {
+ var lxy_div =
+ '';
+
+ $('body').append(lxy_div);
+
+ $('.lxy_zz').on('tap', function(e) {
+ e.preventDefault();
+ e.stopPropagation()
+
+ })
+ mui('.lxy_zz_btn').on('tap', '.cancle', function() {
+ $('#home_zhezhao').remove();
+ return;
+ })
+
+ mui('.lxy_zz_btn').on('tap', '.sure', function() {
+ var payPwd = $('.payword').val();
+ if (payPwd == '') {
+ mui.alert("请输入密码")
+ }
+
+ JZL.ajax(qlgUrl('app/auth/delCompanyBank'), {
+ id: yhkid,
+ payPwd: payPwd
+ }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
+ //console.log(data);
+ var data = toJson(data, 1);
+ if (data.status == 1) {
+ $('#home_zhezhao').remove();
+ location.reload()
+
+ } else {
+ mui.alert(data.msg)
+ }
+ })
+ // //console.log(data_addressId);
+ // mui.ajax(hyhUrl('app/Useraddress/del'), {
+
+ });
+ }
+
+ })
+
+
+
+
+
})
diff --git a/static/app2/js/zepto.min.js b/static/app2/js/zepto.min.js
old mode 100755
new mode 100644
index 8a76710..428f84a
--- a/static/app2/js/zepto.min.js
+++ b/static/app2/js/zepto.min.js
@@ -1,2 +1,2 @@
-/* Zepto v1.0rc1 - polyfill zepto event detect fx ajax form touch - zeptojs.com/license */
+/* Zepto v1.0rc1 - polyfill zepto event detect fx ajax form touch - zeptojs.com/license */
(function(a){String.prototype.trim===a&&(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),Array.prototype.reduce===a&&(Array.prototype.reduce=function(b){if(this===void 0||this===null)throw new TypeError;var c=Object(this),d=c.length>>>0,e=0,f;if(typeof b!="function")throw new TypeError;if(d==0&&arguments.length==1)throw new TypeError;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);while(e0?[].concat.apply([],a):a}function H(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function I(a){return a in i?i[a]:i[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function J(a,b){return typeof b=="number"&&!k[H(a)]?b+"px":b}function K(a){var b,c;return h[a]||(b=g.createElement(a),g.body.appendChild(b),c=j(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),c=="none"&&(c="block"),h[a]=c),h[a]}function L(b,d){return d===a?c(b):c(b).filter(d)}function M(a,b,c,d){return A(b)?b.call(a,c,d):b}function N(a,b,d){var e=a%2?b:b.parentNode;e?e.insertBefore(d,a?a==1?e.firstChild:a==2?b:null:b.nextSibling):c(d).remove()}function O(a,b){b(a);for(var c in a.childNodes)O(a.childNodes[c],b)}var a,b,c,d,e=[],f=e.slice,g=window.document,h={},i={},j=g.defaultView.getComputedStyle,k={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},l=/^\s*<(\w+|!)[^>]*>/,m=[1,3,8,9,11],n=["after","prepend","before","append"],o=g.createElement("table"),p=g.createElement("tr"),q={tr:g.createElement("tbody"),tbody:o,thead:o,tfoot:o,td:p,th:p,"*":g.createElement("div")},r=/complete|loaded|interactive/,s=/^\.([\w-]+)$/,t=/^#([\w-]+)$/,u=/^[\w-]+$/,v={}.toString,w={},x,y,z=g.createElement("div");return w.matches=function(a,b){if(!a||a.nodeType!==1)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=z).appendChild(a),d=~w.qsa(e,b).indexOf(a),f&&z.removeChild(a),d},x=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},y=function(a){return a.filter(function(b,c){return a.indexOf(b)==c})},w.fragment=function(b,d){d===a&&(d=l.test(b)&&RegExp.$1),d in q||(d="*");var e=q[d];return e.innerHTML=""+b,c.each(f.call(e.childNodes),function(){e.removeChild(this)})},w.Z=function(a,b){return a=a||[],a.__proto__=arguments.callee.prototype,a.selector=b||"",a},w.isZ=function(a){return a instanceof w.Z},w.init=function(b,d){if(!b)return w.Z();if(A(b))return c(g).ready(b);if(w.isZ(b))return b;var e;if(D(b))e=F(b);else if(C(b))e=[c.extend({},b)],b=null;else if(m.indexOf(b.nodeType)>=0||b===window)e=[b],b=null;else if(l.test(b))e=w.fragment(b.trim(),RegExp.$1),b=null;else{if(d!==a)return c(d).find(b);e=w.qsa(g,b)}return w.Z(e,b)},c=function(a,b){return w.init(a,b)},c.extend=function(c){return f.call(arguments,1).forEach(function(d){for(b in d)d[b]!==a&&(c[b]=d[b])}),c},w.qsa=function(a,b){var c;return a===g&&t.test(b)?(c=a.getElementById(RegExp.$1))?[c]:e:a.nodeType!==1&&a.nodeType!==9?e:f.call(s.test(b)?a.getElementsByClassName(RegExp.$1):u.test(b)?a.getElementsByTagName(b):a.querySelectorAll(b))},c.isFunction=A,c.isObject=B,c.isArray=D,c.isPlainObject=C,c.inArray=function(a,b,c){return e.indexOf.call(b,a,c)},c.trim=function(a){return a.trim()},c.uuid=0,c.map=function(a,b){var c,d=[],e,f;if(E(a))for(e=0;e0&&w.matches(this[0],a)},not:function(b){var d=[];if(A(b)&&b.call!==a)this.each(function(a){b.call(this,a)||d.push(this)});else{var e=typeof b=="string"?this.filter(b):E(b)&&A(b.item)?f.call(b):c(b);this.forEach(function(a){e.indexOf(a)<0&&d.push(a)})}return c(d)},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!B(a)?a:c(a)},last:function(){var a=this[this.length-1];return a&&!B(a)?a:c(a)},find:function(a){var b;return this.length==1?b=w.qsa(this[0],a):b=this.map(function(){return w.qsa(this,a)}),c(b)},closest:function(a,b){var d=this[0];while(d&&!w.matches(d,a))d=d!==b&&d!==g&&d.parentNode;return c(d)},parents:function(a){var b=[],d=this;while(d.length>0)d=c.map(d,function(a){if((a=a.parentNode)&&a!==g&&b.indexOf(a)<0)return b.push(a),a});return L(b,a)},parent:function(a){return L(y(this.pluck("parentNode")),a)},children:function(a){return L(this.map(function(){return f.call(this.children)}),a)},siblings:function(a){return L(this.map(function(a,b){return f.call(b.parentNode.children).filter(function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return this.map(function(){return this[a]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=null),j(this,"").getPropertyValue("display")=="none"&&(this.style.display=K(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){return this.each(function(){c(this).wrapAll(c(a)[0].cloneNode(!1))})},wrapAll:function(a){return this[0]&&(c(this[0]).before(a=c(a)),a.append(this)),this},unwrap:function(){return this.parent().each(function(){c(this).replaceWith(c(this).children())}),this},clone:function(){return c(this.map(function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(b){return(b===a?this.css("display")=="none":b)?this.show():this.hide()},prev:function(){return c(this.pluck("previousElementSibling"))},next:function(){return c(this.pluck("nextElementSibling"))},html:function(b){return b===a?this.length>0?this[0].innerHTML:null:this.each(function(a){var d=this.innerHTML;c(this).empty().append(M(this,b,a,d))})},text:function(b){return b===a?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=b})},attr:function(c,d){var e;return typeof c=="string"&&d===a?this.length==0||this[0].nodeType!==1?a:c=="value"&&this[0].nodeName=="INPUT"?this.val():!(e=this[0].getAttribute(c))&&c in this[0]?this[0][c]:e:this.each(function(a){if(this.nodeType!==1)return;if(B(c))for(b in c)this.setAttribute(b,c[b]);else this.setAttribute(c,M(this,d,a,this.getAttribute(c)))})},removeAttr:function(a){return this.each(function(){this.nodeType===1&&this.removeAttribute(a)})},prop:function(b,c){return c===a?this[0]?this[0][b]:a:this.each(function(a){this[b]=M(this,c,a,this[b])})},data:function(b,c){var d=this.attr("data-"+H(b),c);return d!==null?d:a},val:function(b){return b===a?this.length>0?this[0].value:a:this.each(function(a){this.value=M(this,b,a,this.value)})},offset:function(){if(this.length==0)return null;var a=this[0].getBoundingClientRect();return{left:a.left+window.pageXOffset,top:a.top+window.pageYOffset,width:a.width,height:a.height}},css:function(c,d){if(d===a&&typeof c=="string")return this.length==0?a:this[0].style[x(c)]||j(this[0],"").getPropertyValue(c);var e="";for(b in c)typeof c[b]=="string"&&c[b]==""?this.each(function(){this.style.removeProperty(H(b))}):e+=H(b)+":"+J(b,c[b])+";";return typeof c=="string"&&(d==""?this.each(function(){this.style.removeProperty(H(c))}):e=H(c)+":"+J(c,d)),this.each(function(){this.style.cssText+=";"+e})},index:function(a){return a?this.indexOf(c(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return this.length<1?!1:I(a).test(this[0].className)},addClass:function(a){return this.each(function(b){d=[];var e=this.className,f=M(this,a,b,e);f.split(/\s+/g).forEach(function(a){c(this).hasClass(a)||d.push(a)},this),d.length&&(this.className+=(e?" ":"")+d.join(" "))})},removeClass:function(b){return this.each(function(c){if(b===a)return this.className="";d=this.className,M(this,b,c,d).split(/\s+/g).forEach(function(a){d=d.replace(I(a)," ")}),this.className=d.trim()})},toggleClass:function(b,d){return this.each(function(e){var f=M(this,b,e,this.className);(d===a?!c(this).hasClass(f):d)?c(this).addClass(f):c(this).removeClass(f)})}},["width","height"].forEach(function(b){c.fn[b]=function(d){var e,f=b.replace(/./,function(a){return a[0].toUpperCase()});return d===a?this[0]==window?window["inner"+f]:this[0]==g?g.documentElement["offset"+f]:(e=this.offset())&&e[b]:this.each(function(a){var e=c(this);e.css(b,M(this,d,a,e[b]()))})}}),n.forEach(function(a,b){c.fn[a]=function(){var a=c.map(arguments,function(a){return B(a)?a:w.fragment(a)});if(a.length<1)return this;var d=this.length,e=d>1,f=b<2;return this.each(function(c,g){for(var h=0;h0&&this.bind(o,n),setTimeout(function(){m.css(i),e<=0&&setTimeout(function(){m.each(function(){n.call(this)})},0)},0),this},i=null}(Zepto),function($){function triggerAndReturn(a,b,c){var d=$.Event(b);return $(a).trigger(d,c),!d.defaultPrevented}function triggerGlobal(a,b,c,d){if(a.global)return triggerAndReturn(b||document,c,d)}function ajaxStart(a){a.global&&$.active++===0&&triggerGlobal(a,null,"ajaxStart")}function ajaxStop(a){a.global&&!--$.active&&triggerGlobal(a,null,"ajaxStop")}function ajaxBeforeSend(a,b){var c=b.context;if(b.beforeSend.call(c,a,b)===!1||triggerGlobal(b,c,"ajaxBeforeSend",[a,b])===!1)return!1;triggerGlobal(b,c,"ajaxSend",[a,b])}function ajaxSuccess(a,b,c){var d=c.context,e="success";c.success.call(d,a,e,b),triggerGlobal(c,d,"ajaxSuccess",[b,c,a]),ajaxComplete(e,b,c)}function ajaxError(a,b,c,d){var e=d.context;d.error.call(e,c,b,a),triggerGlobal(d,e,"ajaxError",[c,d,a]),ajaxComplete(b,c,d)}function ajaxComplete(a,b,c){var d=c.context;c.complete.call(d,b,a),triggerGlobal(c,d,"ajaxComplete",[b,c]),ajaxStop(c)}function empty(){}function mimeToDataType(a){return a&&(a==htmlType?"html":a==jsonType?"json":scriptTypeRE.test(a)?"script":xmlTypeRE.test(a)&&"xml")||"text"}function appendQuery(a,b){return(a+"&"+b).replace(/[&?]{1,2}/,"?")}function serializeData(a){isObject(a.data)&&(a.data=$.param(a.data)),a.data&&(!a.type||a.type.toUpperCase()=="GET")&&(a.url=appendQuery(a.url,a.data))}function serialize(a,b,c,d){var e=$.isArray(b);$.each(b,function(b,f){d&&(b=c?d:d+"["+(e?"":b)+"]"),!d&&e?a.add(f.name,f.value):(c?$.isArray(f):isObject(f))?serialize(a,f,c,b):a.add(b,f)})}var jsonpID=0,isObject=$.isObject,document=window.document,key,name,rscript=/