提交 77e2e151 authored 作者: lihuihui's avatar lihuihui

添加loading

上级 963fd204
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
</div> </div>
</template> </template>
<script> <script>
import { Toast } from 'vant'
import action from '@action' import action from '@action'
import topTitle from '../../components/topTitle.vue' import topTitle from '../../components/topTitle.vue'
export default { export default {
...@@ -88,8 +89,13 @@ export default { ...@@ -88,8 +89,13 @@ export default {
} }
}, },
getDetail() { getDetail() {
Toast.loading({
message: '加载中...',
duration: 3000
})
const id = this.$route.query.id || this.$route.query.activity_id const id = this.$route.query.id || this.$route.query.activity_id
action.List.getLiveDetail(id).then((res) => { action.List.getLiveDetail(id).then((res) => {
Toast.clear()
if (res.code === 0) { if (res.code === 0) {
this.detailData = res.data.activity_info this.detailData = res.data.activity_info
this.liveData = res.data.live_info this.liveData = res.data.live_info
...@@ -111,8 +117,13 @@ export default { ...@@ -111,8 +117,13 @@ export default {
return year + '-' + month + '-' + date + ' ' + hours + ':' + minute + ':' + second return year + '-' + month + '-' + date + ' ' + hours + ':' + minute + ':' + second
}, },
getDetailUser() { getDetailUser() {
Toast.loading({
message: '加载中...',
duration: 3000
})
const id = this.$route.query.id || this.$route.query.activity_id const id = this.$route.query.id || this.$route.query.activity_id
action.List.getDetailUser(id).then((res) => { action.List.getDetailUser(id).then((res) => {
Toast.clear()
if (res.code === 0) { if (res.code === 0) {
this.userList = res.data.list this.userList = res.data.list
} }
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
</template> </template>
<script> <script>
import { Toast } from 'vant'
import action from '@action' import action from '@action'
import tabbar from '../../components/tabbar.vue' import tabbar from '../../components/tabbar.vue'
export default { export default {
...@@ -68,7 +69,12 @@ export default { ...@@ -68,7 +69,12 @@ export default {
}, },
methods: { methods: {
getList() { getList() {
Toast.loading({
message: '加载中...',
duration: 3000
})
action.List.getLiveList().then((res) => { action.List.getLiveList().then((res) => {
Toast.clear()
if (res.code === 0) { if (res.code === 0) {
this.listData = res.data.list this.listData = res.data.list
} }
......
...@@ -108,8 +108,12 @@ export default { ...@@ -108,8 +108,12 @@ export default {
this.form.accountLogin1.activity_id = this.$route.query.activity_id this.form.accountLogin1.activity_id = this.$route.query.activity_id
this.form.accountLogin1.source = this.$route.query.source this.form.accountLogin1.source = this.$route.query.source
} }
console.log(this.$route.query.activity_id) Toast.loading({
message: '加载中...',
duration: 3000
})
action.Login.login(this.loginType ? this.form.accountLogin2 : this.form.accountLogin1).then((res) => { action.Login.login(this.loginType ? this.form.accountLogin2 : this.form.accountLogin1).then((res) => {
Toast.clear()
if (res.code === 0) { if (res.code === 0) {
this.$router.push({ this.$router.push({
path: '/details', path: '/details',
...@@ -127,7 +131,12 @@ export default { ...@@ -127,7 +131,12 @@ export default {
param.activity_id = this.$route.query.activity_id param.activity_id = this.$route.query.activity_id
param.source = this.$route.query.source param.source = this.$route.query.source
} }
Toast.loading({
message: '加载中...',
duration: 3000
})
action.Login.login(param).then((res) => { action.Login.login(param).then((res) => {
Toast(res.msg)
if (res.code === 5004) { if (res.code === 5004) {
this.$router.push({ this.$router.push({
path: '/details', path: '/details',
...@@ -144,7 +153,12 @@ export default { ...@@ -144,7 +153,12 @@ export default {
Toast('填写正确信息') Toast('填写正确信息')
return false return false
} }
Toast.loading({
message: '加载中...',
duration: 3000
})
action.Login.register(this.form.register).then((res) => { action.Login.register(this.form.register).then((res) => {
Toast.clear()
Toast(res.msg) Toast(res.msg)
}) })
}, },
...@@ -159,7 +173,12 @@ export default { ...@@ -159,7 +173,12 @@ export default {
return false return false
} }
if (this.time.second === 60) { if (this.time.second === 60) {
Toast.loading({
message: '加载中...',
duration: 3000
})
action.Login.getSendCode({ mobile: this.form.register.mobile }).then((res) => { action.Login.getSendCode({ mobile: this.form.register.mobile }).then((res) => {
Toast.clear()
res.code === 0 && (this.tickCode()) res.code === 0 && (this.tickCode())
Toast(res.msg) Toast(res.msg)
}) })
...@@ -172,7 +191,12 @@ export default { ...@@ -172,7 +191,12 @@ export default {
return false return false
} }
if (this.time.second === 60) { if (this.time.second === 60) {
Toast.loading({
message: '加载中...',
duration: 3000
})
action.Login.getSendCode({ mobile: this.form.accountLogin2.mobile }).then((res) => { action.Login.getSendCode({ mobile: this.form.accountLogin2.mobile }).then((res) => {
Toast.clear()
res.code === 0 && (this.tickCode()) res.code === 0 && (this.tickCode())
Toast(res.msg) Toast(res.msg)
}) })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论