随手拍

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