Browse Source

对接接口

1.0
396316021 2 years ago
parent
commit
0f5c226dce
  1. 23
      pages/Cron/detail.vue
  2. 18
      pages/Index/index.vue

23
pages/Cron/detail.vue

@ -44,10 +44,11 @@
:custom-style="{padding:'0 26rpx',boxSizing:'border-box'}"
>
<u-list-item
v-for="(item, index) in lists[this.current-1]"
v-for="(item, index) in lists[this.current]"
:key="index"
>
<u-cell
v-for="(item, index) in lists[this.current]"
:title="item.describe"
:label="item.create_time"
:icon="staticImage.bg"
@ -153,12 +154,6 @@ export default {
wx.navigateTo({
url: '/pages/ChatDetail/index?id=' + item.id
});
},
checkSection(index) {
this.current = edit;
},
scrollToLower() {
},
getBalance() {
cronBalance().then((res) => {
@ -166,29 +161,31 @@ export default {
})
},
getCron(nextPage = false,index = 1) {
if (this.end[this.current - 1]) {
if (this.end[index]) {
return false;
}
cronList({
type: index,
limit: 10,
page: this.page[this.current - 1],
page: this.page[index],
}).then((res) => {
this.lists[this.current-1] = this.lists[this.current-1].concat(res.data)
this.lists[index] = this.lists[index].concat(res.data)
if (res.data.length === 0) {
this.end[this.current - 1] = true;
this.end[index] = true;
}
})
if (nextPage) {
this.page[this.current - 1]++;
this.page[index]++;
}
},
tabChange(e) {
console.log(e)
this.page[e.index] = 1;
this.end[e.index] = false;
this.lists = [[],[]];
this.getCron(true,e.index+1);
this.current = index;
this.getCron(true,e.index);
}
},
options: {

18
pages/Index/index.vue

@ -134,6 +134,10 @@ export default {
}
this.footCheck = item.name;
this.title = item.title;
let token = uni.getStorageSync('token');
if (token && this.footCheck === 'user') {
this.getUserExtend();
}
},
change1(e) {
this.value1 = e
@ -171,10 +175,7 @@ export default {
},
onShow() {
console.log('show123123')
this.$nextTick(() => {
})
},
created() {
// this.pagePadding = (api.navHeight().navPaddingTop+
@ -183,21 +184,10 @@ export default {
mounted() {
this.title = this.$store.state.title;
let token = uni.getStorageSync('token');
// let user = uni.getStorageSync('user');
// let userExtends = uni.getStorageSync('user-extends');
// if (!token) {
// this.show = true;
// } else if (!user) {
// this.getUserDetail();
// } else if (!userExtends) {
if (token) {
this.getUserExtend();
}
// } else {
// this.$store.commit('userInfo', user);
// this.$store.commit('userExtends', userExtends);
// }
},
watch: {
"$store.state.footCheck": {

Loading…
Cancel
Save