|
@@ -2,7 +2,7 @@
|
|
|
<view class="grades-terms-page">
|
|
|
<view class="icon-title-navBar-box">
|
|
|
<!-- 返回按钮↓ -->
|
|
|
- <view class="nav-bar-icon"></view>
|
|
|
+ <view class="nav-bar-icon" @click="handleBack"></view>
|
|
|
</view>
|
|
|
<view class="grades-body">
|
|
|
<view class="grades-change-title"></view>
|
|
@@ -26,7 +26,8 @@
|
|
|
<script setup>
|
|
|
import {
|
|
|
reactive,
|
|
|
- toRefs
|
|
|
+ toRefs,
|
|
|
+ ref,
|
|
|
} from "vue";
|
|
|
import {
|
|
|
nianji_list,
|
|
@@ -37,7 +38,7 @@
|
|
|
} from "@dcloudio/uni-app";
|
|
|
import {getUserIdentity} from "@/utils/common.js"
|
|
|
import cacheManager from "@/utils/cacheManager.js"
|
|
|
-
|
|
|
+
|
|
|
function useSelectGrade() {
|
|
|
const userCode = getUserIdentity();
|
|
|
const data = reactive({
|
|
@@ -66,6 +67,7 @@
|
|
|
uni.showToast({
|
|
|
title: "请选择年级",
|
|
|
duration: 2000,
|
|
|
+ icon: 'error'
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
@@ -74,6 +76,7 @@
|
|
|
uni.showToast({
|
|
|
title: "请选择学科",
|
|
|
duration: 2000,
|
|
|
+ icon: 'error'
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
@@ -102,10 +105,17 @@
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+ function handleBack() {
|
|
|
+ if (userCode !== 'Visitor') {
|
|
|
+ uni.redirectTo({ url: `/pages/study/index`})
|
|
|
+ } else {
|
|
|
+ uni.redirectTo({url: '/pages/login/index'})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return {
|
|
|
...toRefs(data),
|
|
|
-
|
|
|
+ handleBack,
|
|
|
// 方法
|
|
|
handleConfirm, // 选择年级+学科
|
|
|
};
|
|
@@ -114,7 +124,8 @@
|
|
|
const {
|
|
|
activeNianji,
|
|
|
activeXueke,
|
|
|
- handleConfirm
|
|
|
+ handleConfirm,
|
|
|
+ handleBack
|
|
|
} = useSelectGrade()
|
|
|
|
|
|
function handleSelectGrade(item) {
|
|
@@ -124,4 +135,6 @@
|
|
|
function handleSelectXueke(item) {
|
|
|
activeXueke.value = item.id;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
</script>
|