随手拍

This commit is contained in:
liuye
2024-10-24 11:16:03 +08:00
parent 137891332a
commit fd73698c48

View File

@@ -92,11 +92,12 @@
<div class="btn-wrapper"> <div class="btn-wrapper">
<div class="btn" hover-class="text-hover" @click="submit">提交</div> <div class="btn" hover-class="text-hover" @click="submit">提交</div>
</div> </div>
<AiLogin ref="login" @success="getAuth()"/>
</div> </div>
</template> </template>
<script> <script>
import {mapState} from 'vuex' import {mapActions, mapState} from 'vuex'
export default { export default {
appName: "上报随手拍", appName: "上报随手拍",
@@ -121,15 +122,19 @@ export default {
}, },
computed: { computed: {
...mapState(['user']) ...mapState(['user', 'token'])
}, },
onLoad() { onLoad() {
this.getDict() this.getDict()
this.form.phone = this.user.phone this.form.phone = this.user.phone
this.form.name = this.user.realName || '' this.form.name = this.user.realName || ''
if (!this.token) {
this.$refs.login.show();
}
}, },
methods: { methods: {
...mapActions(['getUserInfo']),
chooseAddress() { chooseAddress() {
uni.authorize({ uni.authorize({
scope: 'scope.userLocation', scope: 'scope.userLocation',
@@ -175,6 +180,9 @@ export default {
}) })
}, },
submit() { submit() {
if (!this.token) {
return this.$refs.login.show();
}
if (!this.form.groupId) { if (!this.form.groupId) {
return this.$toast('请选择事件类型') return this.$toast('请选择事件类型')
} }
@@ -222,6 +230,11 @@ export default {
}, },
handleSelectGrid(v) { handleSelectGrid(v) {
this.form.girdName = v.girdName this.form.girdName = v.girdName
},
getAuth() {
this.$nextTick(() => {
this.token && this.getUserInfo()
})
} }
} }
} }