chore(组件): 组件尽量使用异步导入模式

This commit is contained in:
2026-01-04 14:40:00 +08:00
parent 4da852944e
commit 9415f397d2
172 changed files with 11520 additions and 10979 deletions

View File

@@ -12,88 +12,88 @@
</template>
<script>
export default {
components: {},
data() {
return {
state: ''
};
},
onLoad(option) {
export default {
components: {},
data() {
return {
state: ''
};
},
onLoad(option) {
if (option.back) this.back = option.back;
if (option.back) this.back = option.back;
// 判断登录
if (!this.storeToken) {
this.$util.redirectTo('/pages_tool/login/login');
} else {
this.getStatus();
}
},
methods: {
getStatus() {
this.$api.sendRequest({
success: res => {
if (res.code >= 0) {
this.state = res.data.state;
if (res.data.state == 1) {
this.$store.commit('setToken', '');
this.$store.commit('setMemberInfo', '');
this.$store.dispatch('emptyCart');
this.$util.redirectTo('/pages/index/index');
}
// 判断登录
if (!this.storeToken) {
this.$util.redirectTo('/pages_tool/login/login');
} else {
this.getStatus();
}
},
methods: {
getStatus() {
this.$api.sendRequest({
success: res => {
if (res.code >= 0) {
this.state = res.data.state;
if (res.data.state == 1) {
this.$store.commit('setToken', '');
this.$store.commit('setMemberInfo', '');
this.$store.dispatch('emptyCart');
this.$util.redirectTo('/pages/index/index');
}
}
});
}
}
});
}
};
}
};
</script>
<style lang="scss" scoped>
.cancel-wrap {
padding-top: 84rpx;
text-align: center;
.cancel-wrap {
padding-top: 84rpx;
text-align: center;
.cancel-img {
width: 100rpx;
height: 100rpx;
display: inline-block;
.cancel-img {
width: 100rpx;
height: 100rpx;
display: inline-block;
image {
width: 100%;
height: 100%;
}
}
.cancel-title {
text-align: center;
font-size: 24rpx;
line-height: 24rpx;
margin-top: 30rpx;
}
.cancel-reason {
color: #838383;
font-size: 20rpx;
line-height: 40rpx;
margin-top: 20rpx;
padding: 0 175rpx;
}
.cancel-btn {
image {
width: 100%;
margin-top: 173rpx;
button {
display: inline-block;
width: 300rpx;
height: 80rpx;
font-size: 28rpx;
line-height: 80rpx;
margin: 0 15rpx;
color: #ffffff;
}
height: 100%;
}
}
.cancel-title {
text-align: center;
font-size: 24rpx;
line-height: 24rpx;
margin-top: 30rpx;
}
.cancel-reason {
color: #838383;
font-size: 20rpx;
line-height: 40rpx;
margin-top: 20rpx;
padding: 0 175rpx;
}
.cancel-btn {
width: 100%;
margin-top: 173rpx;
button {
display: inline-block;
width: 300rpx;
height: 80rpx;
font-size: 28rpx;
line-height: 80rpx;
margin: 0 15rpx;
color: #ffffff;
}
}
}
</style>