mirror of
https://gitee.com/java110/PropertyApp.git
synced 2026-02-24 05:46:09 +08:00
104 lines
1.9 KiB
JavaScript
104 lines
1.9 KiB
JavaScript
import url from '../../constant/url.js';
|
|
export function queryOwners(_that,_data){
|
|
return new Promise(function(reslove,reject){
|
|
_that.context.get({
|
|
url: url.queryOwners,
|
|
data:_data,
|
|
success: function(res) {
|
|
reslove(res.data);
|
|
},
|
|
fail: function(e) {
|
|
wx.showToast({
|
|
title: "服务器异常了",
|
|
icon: 'none',
|
|
duration: 2000
|
|
})
|
|
}
|
|
})
|
|
});
|
|
}
|
|
export function queryOwnerAccount(_that,_data){
|
|
return new Promise(function(reslove,reject){
|
|
_that.context.get({
|
|
url: url.queryOwnerAccount,
|
|
data:_data,
|
|
success: function(res) {
|
|
if(res.data.code == 0){
|
|
reslove(res.data);
|
|
}else{
|
|
wx.showToast({
|
|
title: "服务器异常了",
|
|
icon: 'none',
|
|
duration: 2000
|
|
})
|
|
}
|
|
},
|
|
fail: function(e) {
|
|
wx.showToast({
|
|
title: "服务器异常了",
|
|
icon: 'none',
|
|
duration: 2000
|
|
})
|
|
}
|
|
})
|
|
});
|
|
}
|
|
|
|
|
|
|
|
export function queryOwnerAndMembers(_that,_data){
|
|
return new Promise(function(reslove,reject){
|
|
_that.context.get({
|
|
url: url.queryOwnerAndMembers,
|
|
data:_data,
|
|
success: function(res) {
|
|
reslove(res.data);
|
|
},
|
|
fail: function(e) {
|
|
wx.showToast({
|
|
title: "服务器异常了",
|
|
icon: 'none',
|
|
duration: 2000
|
|
})
|
|
}
|
|
})
|
|
});
|
|
}
|
|
|
|
export function saveRoomOwner(_that,_data){
|
|
return new Promise(function(reslove,reject){
|
|
_that.context.post({
|
|
url: url.saveRoomOwner,
|
|
data:_data,
|
|
success: function(res) {
|
|
reslove(res.data);
|
|
},
|
|
fail: function(e) {
|
|
wx.showToast({
|
|
title: "服务器异常了",
|
|
icon: 'none',
|
|
duration: 2000
|
|
})
|
|
}
|
|
})
|
|
});
|
|
}
|
|
|
|
export function deleteOwner(_that,_data) {
|
|
return new Promise(function(reslove,reject){
|
|
_that.context.post({
|
|
url: url.deleteOwner,
|
|
data:_data,
|
|
success: function(res) {
|
|
reslove(res.data);
|
|
},
|
|
fail: function(e) {
|
|
wx.showToast({
|
|
title: "服务器异常了",
|
|
icon: 'none',
|
|
duration: 2000
|
|
})
|
|
}
|
|
})
|
|
});
|
|
} |