|
|
@ -3,7 +3,8 @@ const app = getApp();
|
|
|
|
Page({
|
|
|
|
Page({
|
|
|
|
|
|
|
|
|
|
|
|
data: {
|
|
|
|
data: {
|
|
|
|
eduImgDir: global.config.eduImgDir
|
|
|
|
eduImgDir: global.config.eduImgDir,
|
|
|
|
|
|
|
|
buttons:[{text:"删除",type:"warn"}]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onLoad: function (options) {
|
|
|
|
onLoad: function (options) {
|
|
|
|
|
|
|
|
|
|
|
@ -58,7 +59,24 @@ Page({
|
|
|
|
this.setData({ accounts, user: res.user, currentAccountSaved, currentAccount,loading:0});
|
|
|
|
this.setData({ accounts, user: res.user, currentAccountSaved, currentAccount,loading:0});
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
removeAccount(e){
|
|
|
|
deleteAccount({user_id}){
|
|
|
|
|
|
|
|
accountManager.removeAccount({user_id});
|
|
|
|
|
|
|
|
if(this.data.user.user_id==user_id){
|
|
|
|
|
|
|
|
accountManager.clearCurrentAccount();
|
|
|
|
|
|
|
|
app.client.session.cookies = "";
|
|
|
|
|
|
|
|
app.client.synch = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
removeAccount2(e){
|
|
|
|
|
|
|
|
console.log(e);
|
|
|
|
|
|
|
|
let { currentTarget: { dataset: { id: user_id } } } = e;
|
|
|
|
|
|
|
|
this.deleteAccount({user_id});
|
|
|
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
|
|
|
this.refresh();
|
|
|
|
|
|
|
|
},300);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
removeAccount1(e){
|
|
|
|
console.log(e);
|
|
|
|
console.log(e);
|
|
|
|
let { currentTarget: { dataset: { id: user_id } } } = e;
|
|
|
|
let { currentTarget: { dataset: { id: user_id } } } = e;
|
|
|
|
var info = this.data.user.user_id == user_id?'退出登录并移除':"移除此账号";
|
|
|
|
var info = this.data.user.user_id == user_id?'退出登录并移除':"移除此账号";
|
|
|
@ -67,12 +85,7 @@ Page({
|
|
|
|
success:res=>{
|
|
|
|
success:res=>{
|
|
|
|
if(res.tapIndex==0){
|
|
|
|
if(res.tapIndex==0){
|
|
|
|
console.log(user_id);
|
|
|
|
console.log(user_id);
|
|
|
|
accountManager.removeAccount({user_id});
|
|
|
|
this.deleteAccount({user_id});
|
|
|
|
if(this.data.user.user_id==user_id){
|
|
|
|
|
|
|
|
accountManager.clearCurrentAccount();
|
|
|
|
|
|
|
|
app.client.session.cookies = "";
|
|
|
|
|
|
|
|
app.client.synch = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.refresh();
|
|
|
|
this.refresh();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|