|
|
@@ -12,16 +12,29 @@ Page({
|
|
|
currentLetter: ''
|
|
|
},
|
|
|
async getShipOwnerList(type) {
|
|
|
+ if (!wx.getStorageSync('loginAccountId')) {
|
|
|
+ wx.showToast({
|
|
|
+ title: '尚未登录',
|
|
|
+ icon: "error"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
let res = await postApi('/ship/list', {
|
|
|
loginAccountId: wx.getStorageSync('loginAccountId'),
|
|
|
term: this.data.term
|
|
|
})
|
|
|
if (type) wx.stopPullDownRefresh()
|
|
|
- let shipOwnerList = res.data.result
|
|
|
- shipOwnerList.push(shipOwnerList.shift())
|
|
|
- this.setData({
|
|
|
- shipOwnerList
|
|
|
- })
|
|
|
+ if (res.data.status == 0) {
|
|
|
+ let shipOwnerList = res.data.result
|
|
|
+ shipOwnerList.push(shipOwnerList.shift())
|
|
|
+ this.setData({
|
|
|
+ shipOwnerList
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.setData({
|
|
|
+ shipOwnerList: []
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
call(e) {
|
|
|
wx.makePhoneCall({
|
|
|
@@ -29,6 +42,13 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
addShipOwner() {
|
|
|
+ if (!wx.getStorageSync('loginAccountId')) {
|
|
|
+ wx.showToast({
|
|
|
+ title: '尚未登录',
|
|
|
+ icon: "error"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
wx.navigateTo({
|
|
|
url: '../addShipOnwer/addShipOnwer',
|
|
|
})
|
|
|
@@ -39,7 +59,7 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
onLoad() {
|
|
|
- this.getShipOwnerList()
|
|
|
+
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
this.setData({
|
|
|
@@ -48,9 +68,6 @@ Page({
|
|
|
this.getShipOwnerList(1)
|
|
|
},
|
|
|
onShow() {
|
|
|
- if (wx.getStorageSync('apiStatus') == "success") {
|
|
|
- this.getShipOwnerList()
|
|
|
- wx.removeStorageSync('apiStatus')
|
|
|
- }
|
|
|
+ this.getShipOwnerList()
|
|
|
}
|
|
|
})
|