You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.4 KiB

3 years ago
<script>
import {
openSqlite,
isOpenSqlite,
closeSqlite,
executeSql,
selectFromTable
} from '@/common/sqlite.js'
export default {
methods: {
},
onLaunch: async function() {
console.log('App Launch')
// #ifdef APP-PLUS
try {
if (!isOpenSqlite()) {
await openSqlite()
}
await executeSql(`
create table if not exists property(
3 years ago
"assets_id" INTEGER PRIMARY KEY,
3 years ago
"serial" TEXT,
"name" TEXT,
"position" TEXT,
"worker_name" TEXT,
3 years ago
"worker_id" INTEGER,
2 years ago
"assets_status" TEXT,
3 years ago
"photo" TEXT,
"content" TEXT,
3 years ago
"is_check" INTEGER DEFAULT 0
);
`)
await executeSql(`
create table if not exists log(
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"type" INTEGER DEFAULT 0,
"remark" TEXT,
"created_at" TIMESTAMP DEFAULT (datetime('now','localtime'))
);
`)
3 years ago
await executeSql(`
create table if not exists worker(
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"name" TEXT
);
`)
3 years ago
} catch (err) {
throw new Error(err.message)
}
// #endif
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style lang="scss">
/*每个页面公共css */
@import "uview-ui/index.scss";
</style>