Skip to content

Commit

Permalink
Merge pull request #106 from xixiIBN5100/master
Browse files Browse the repository at this point in the history
perf:增强了编辑卡片对用户的引导性
  • Loading branch information
xixiIBN5100 authored Sep 23, 2024
2 parents 20c460a + 1977058 commit 37d10fe
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/components/Alarm/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@
left: .7rem;
position: absolute;
display: inline-flex;
border-radius: 1000Px;
}
}
6 changes: 6 additions & 0 deletions src/components/Home/edit-panel/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ const validList = computed(() => {
});
const selectedList = computed(() => {
if(serviceStore.homecard.selected.length === 0 && serviceStore.homecard.initialization) {
store.commit("addHomeCardItem", "lessons-table-quick-view");
serviceStore.homecard.initialization = false
}
const list = serviceStore.homecard.selected;
console.log(list)
return list.filter(item => homeCards[item]).map(item => homeCards[item]);
});
Expand Down
4 changes: 2 additions & 2 deletions src/components/Home/index.module.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@import "@/style/theme.scss";

.edit-button {
width: 80rpx;
height: 80rpx;
width: 70rpx;
height: 70rpx;
display: flex;
background-color: var(--wjh-color-primary);
margin: 0 auto;
Expand Down
4 changes: 3 additions & 1 deletion src/components/Home/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
<card v-if="!(isBindZf || isBindYXY || isBindLibrary || isBindOauth)" title="提示">
还没有绑定任何服务,请到我的页面绑定
</card>

<view @tap="showEditPanel" :class="styles[`edit-button`]">
<view class="iconfont icon-edit" />
<view class="iconfont icon-add" style="font-size: 2rem; font-weight: bolder" />
</view>
</view>
<view v-else class="flex-column">
Expand Down Expand Up @@ -46,6 +47,7 @@ import FixedQuickView from "../FixedQuickView/index.vue";
import EditPanel from "./edit-panel/index.vue";
import styles from "./index.module.scss";
import { onMounted } from "vue";
import {WBadge} from "@/components";
const questionnairePath = questionnaireInfo.path; // 获取最新的问卷地址
Expand Down
12 changes: 12 additions & 0 deletions src/components/NavBar/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
@import "@/style/theme.scss";
.sub-text-container {
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
.sub-text {
font-size: 0.8rem;
line-height: 1.2rem;
color: var(--wjh-color-text-secondary);
}
}


.nav-bar-icon-wrapper {
padding: 0 16Px;
Expand Down
3 changes: 3 additions & 0 deletions src/components/NavBar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
</view>
</bottom-panel>
<pop-view v-model:show="showPop">
<view class="sub-text-container">
<text class="sub-text">部分功能卡片可通过点击首页下方的加号添加</text>
</view>
<app-list v-if="showPop" />
</pop-view>
</template>
Expand Down
8 changes: 6 additions & 2 deletions src/pages/bind/Oauth/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { Card, WButton, WModal } from "@/components";
import { helpText } from "@/constants/copywriting";
import { UserService } from "@/services";
import { serviceStore } from "@/store";
import store, { serviceStore } from "@/store";
import Taro from "@tarojs/taro";
import { ref, computed } from "vue";
Expand Down Expand Up @@ -32,6 +32,10 @@ async function bindOauthClick() {
icon: "success",
title: "绑定成功"
});
if(serviceStore.homecard.selected.length === 0 && serviceStore.homecard.initialization) {
store.commit("addHomeCardItem", "lessons-table-quick-view");
serviceStore.homecard.initialization = false
}
}
}
Expand All @@ -49,7 +53,7 @@ async function bindOauthClick() {
</template>
<text>统一验证系统</text>
<view>
<input v-if="!user.isBindOauth" password placeholder="默认密码为zjut+身份证后六位" v-model="oauthpass" />
<input v-if="!user.isBindOauth" password placeholder="请输入密码" v-model="oauthpass" />
<input v-else password placeholder="*******" v-model="oauthpass" />
</view>
<template #footer>
Expand Down
5 changes: 4 additions & 1 deletion src/pages/bind/YXY/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { YxyService } from "@/services";
import Taro from "@tarojs/taro";
import { onMounted, ref } from "vue";
import { useRequest } from "@/hooks";
import store from "@/store";
import store, {serviceStore} from "@/store";
const phoneNumber = ref("");
const graphCode = ref("");
Expand Down Expand Up @@ -61,6 +61,9 @@ const { run: loginYxyAPI } = useRequest(YxyService.loginYxy, {
Taro.showToast({ icon: "none", title: res.data.msg });
} else {
Taro.showToast({ icon: "success", title: "绑定成功" });
if(!serviceStore.homecard.selected.includes("school-card-quick-view")) {
store.commit("addHomeCardItem", "school-card-quick-view");
}
store.commit("setBindYXY", true);
}
},
Expand Down
7 changes: 5 additions & 2 deletions src/pages/bind/ZF/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { Card, WButton, WModal } from "@/components";
import { helpText } from "@/constants/copywriting";
import { UserService } from "@/services";
import { serviceStore } from "@/store";
import store, { serviceStore } from "@/store";
import Taro from "@tarojs/taro";
import { ref, computed } from "vue";
Expand Down Expand Up @@ -32,6 +32,9 @@ async function bindZFClick() {
icon: "success",
title: "绑定成功"
});
if(serviceStore.homecard.selected.length === 0 ) {
store.commit("addHomeCardItem", "lessons-table-quick-view");
}
} else {
await Taro.showToast({
icon: "none",
Expand All @@ -54,7 +57,7 @@ async function bindZFClick() {
</template>
<text>正方教务系统</text>
<view>
<input v-if="!user.isBindZF" password placeholder="默认密码为zjut+身份证后六位" v-model="zfpass" />
<input v-if="!user.isBindZF" password placeholder="请输入密码" v-model="zfpass" />
<input v-else password placeholder="*******" v-model="zfpass" />
</view>
<template #footer>
Expand Down
4 changes: 3 additions & 1 deletion src/store/service/homecard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { HomeCardName } from "@/constants/homeCards";

export interface HomeCardServiceType {
selected: Array<HomeCardName>
initialization: Boolean
}
export const HomeCardServiceStore = {
state: () => ({
selected: ["lessons-table-quick-view"]
selected: ["lessons-table-quick-view","score-quick-view"],
initialization: true
}),

mutations: {
Expand Down
6 changes: 5 additions & 1 deletion src/style/icons.scss

Large diffs are not rendered by default.

0 comments on commit 37d10fe

Please sign in to comment.