|
|
|
@@ -5,6 +5,7 @@ import { View } from '@tarojs/components' |
|
|
|
import './index.scss' |
|
|
|
import {weappAuth} from "../../utils"; |
|
|
|
import {GroupedPassRecords, usePassRecordsStore} from "../../stores/pass-records"; |
|
|
|
import {useContactsStore} from "../../stores/contacts"; |
|
|
|
|
|
|
|
const state = reactive<{ |
|
|
|
isPageDataLoading: boolean, |
|
|
|
@@ -16,6 +17,7 @@ const state = reactive<{ |
|
|
|
groupedPassRecords: [], |
|
|
|
}) |
|
|
|
const passRecords = usePassRecordsStore() |
|
|
|
const contacts = useContactsStore() |
|
|
|
|
|
|
|
|
|
|
|
init() |
|
|
|
@@ -26,10 +28,17 @@ function init() { |
|
|
|
weappAuth().then(r => { |
|
|
|
console.log(r) |
|
|
|
passRecords.loadPassRecordsFromServer().then( passRecords => { |
|
|
|
state.isPageDataLoading = false |
|
|
|
state.groupedPassRecords = passRecords |
|
|
|
console.log("aaa",state.groupedPassRecords ) |
|
|
|
// console.log(state.groupedPassRecords) |
|
|
|
contacts.loadContactsFromServer().then( contacts => { |
|
|
|
state.isPageDataLoading = false |
|
|
|
}) |
|
|
|
.catch(contactError => { |
|
|
|
console.log("error", contactError) |
|
|
|
state.isAuthError = true |
|
|
|
state.isPageDataLoading = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(error => { |
|
|
|
console.log("error", error) |
|
|
|
|