|
@@ -3,12 +3,14 @@
|
|
|
<admin-frame :useTop="false" :usePage="false" :useNav="false">
|
|
|
<template v-slot:info>
|
|
|
<van-button v-for="(i, index) in menu" :key="`menu-${index}`" @click="$router.push(i.router)">{{ i.label }}</van-button>
|
|
|
+ <!-- <van-button @click="toAdd()">添加用户</van-button> -->
|
|
|
</template>
|
|
|
</admin-frame>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+const { textname } = require('@frame/src/layout/test');
|
|
|
import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: personal } = createNamespacedHelpers('personal');
|
|
@@ -74,14 +76,38 @@ export default {
|
|
|
router: '/account/index',
|
|
|
},
|
|
|
],
|
|
|
+ list: [],
|
|
|
+ textname: textname,
|
|
|
};
|
|
|
},
|
|
|
- async created() {
|
|
|
- await this.search();
|
|
|
- },
|
|
|
+ async created() {},
|
|
|
methods: {
|
|
|
- ...personal({ personalCreate: 'create' }),
|
|
|
- search({ skip = 0, limit = this.limit, ...info } = {}) {},
|
|
|
+ ...personal(['create', 'query']),
|
|
|
+ async search({ skip = 0, limit = this.limit, ...info } = {}) {
|
|
|
+ for (const val of this.textname) {
|
|
|
+ let res = await this.query({ phone: val });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ if (res.total > 0) {
|
|
|
+ console.log('1');
|
|
|
+ } else {
|
|
|
+ let data = {
|
|
|
+ name: val,
|
|
|
+ phone: val,
|
|
|
+ password: '111111',
|
|
|
+ type: '4',
|
|
|
+ code: 'JLKJQYCGD',
|
|
|
+ status: '1',
|
|
|
+ };
|
|
|
+ let p1 = await this.create(data);
|
|
|
+ console.log(p1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 添加用户
|
|
|
+ toAdd() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|