12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <template>
- <view class="main">
- 分类
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- config: {},
- user: {},
- }
- },
- onLoad: async function(e) {
- const that = this;
- uni.setNavigationBarTitle({
- title: e && e.title || '分类'
- });
- await that.searchOther();
- that.searchConfig();
- that.searchToken();
- that.search();
- },
- methods: {
- searchToken() {
- const that = this;
- try {
- const res = uni.getStorageSync('token');
- if (res) that.$set(that, `user`, res);
- } catch (e) {
- uni.showToast({
- title: err.errmsg,
- icon: 'error',
- duration: 2000
- });
- }
- },
- searchConfig() {
- const that = this;
- try {
- const res = uni.getStorageSync('config');
- if (res) that.$set(that, `config`, res);
- } catch (e) {
- uni.showToast({
- title: err.errmsg,
- icon: 'error',
- duration: 2000
- });
- }
- },
- // 查询
- async search() {
- const that = this;
- let res;
- },
- async searchOther() {
- const that = this;
- }
- }
- }
- </script>
- <style>
- .main {}
- </style>
|