diff --git a/js/cancellation.js b/js/cancellation.js index 9c2b381..b319161 100644 --- a/js/cancellation.js +++ b/js/cancellation.js @@ -72,6 +72,8 @@ mui.plusReady(function(){ }) mui('.down').on('tap', '#true', function() { var phoneCode = $('#phoneCode').val(); + var op_content = $('#reason').val(); + var op_user = $('#userName').val(); var that = $(this); if(phoneCode == '') { alert('验证码不能为空!'); @@ -80,6 +82,53 @@ mui.plusReady(function(){ alert('验证码格式不正确!'); return; } - alert('功能开发中'); + if (op_user == '') { + alert('操作用户不能为空!'); + return; + } + $.ajax({ + url: qlgUrl('app/users/unregister'), + method: 'POST', + data: { + op_user: op_user, + op_content: op_content, + code: phoneCode, + }, + dataType: 'json', + success(res) { + mui.alert(res.msg, '提示') + 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.fire(self.parent, 'refresh'); + mui.back(); + var data = toJson(data, 1); + if(data.status == 1) { + + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + }, + error(err) { + mui.alert('请求异常', '提示') + } + }) }) }) \ No newline at end of file diff --git a/js/my.js b/js/my.js index 40c4fcb..4da971a 100644 --- a/js/my.js +++ b/js/my.js @@ -5,6 +5,9 @@ mui.plusReady(function() { window.addEventListener('reload', function(e) { //执行刷新 location.reload(); }); + $('.mydata-content').on('tap', '.tradeRule', function() { + JZL.openWindow('trade_rule.html', 'trade_rule.html') + }) var token = localStorage.getItem('token'); var authType = 0; //0 未认证 1 个人认证 2 合作认证 var userId = 0; @@ -274,9 +277,6 @@ var localAuthType = localStorage.getItem("authType"); $('.mydata-content').on('tap', '.setting', function() { JZL.openWindow('setting.html', 'setting.html') }) - $('.mydata-content').on('tap', '.tradeRule', function() { - JZL.openWindow('trade_rule.html', 'trade_rule.html') - }) $('.mydata-content').on('tap', '.shoppingcart', function() { JZL.openWindow('shoppingcart_warp.html', 'shoppingcart_warp.html') }) diff --git a/js/trade_rule.js b/js/trade_rule.js index 4cb4b9c..7c8753b 100644 --- a/js/trade_rule.js +++ b/js/trade_rule.js @@ -21,7 +21,7 @@ const app = new Vue({ url: qlgUrl("app/trade_rule/index"), method: "GET", dataType: 'json', - success: function(res){ + success: (res)=>{ if(res.status == 1){ this.ruleData = res.data; localStorage.setItem("LOCAL_RULE", JSON.stringify(res.data)); diff --git a/templete/cancellation.html b/templete/cancellation.html index f25ad60..20f59ff 100644 --- a/templete/cancellation.html +++ b/templete/cancellation.html @@ -19,9 +19,9 @@
特别声明:
-
一、成功注销后您不能二次使用!
-
二、成功注销后您的亲人不能二次使用!
-
三、请您更深入了解避免以后后悔莫及!
+
一、您成功注销后不能二次使用!
+
二、注销后您的亲人不能二次使用!
+
三、请您更深入了解避免注销失误!