feat: 5.21 update

This commit is contained in:
chenhao 2026-05-21 17:23:54 +08:00
parent 7047232930
commit 736adae554
14 changed files with 99 additions and 174 deletions

View File

@ -1,2 +1,2 @@
VITE_API_URL = "https://m.taigurun.cn"
VITE_OSS_URL = "https://m.taigurun.cn"
VITE_OSS_URL = "https://m.taigurun.cn/uploads"

View File

@ -1,2 +1,2 @@
VITE_API_URL = "https://m.taigurun.cn"
VITE_OSS_URL = "https://m.taigurun.cn"
VITE_OSS_URL = "https://m.taigurun.cn/uploads"

View File

@ -101,7 +101,7 @@ export default {
this.$showConfirmDialog({
title: "确认退出?",
}).then(() => {
this.$ls.remove('token');
this.$ls.remove('member_token');
location.replace('#/Login');
setTimeout(() => {
location.reload();

View File

@ -53,9 +53,24 @@ datadicStore.init()
const userStore = useUserStore()
// 全局前置守卫
router.beforeEach((to, from, next) => {
if (to.meta.title) {
document.title = to.meta.title;
}
if (to.meta.noLogin) {
return next();
}
const isLogin = userStore.isLogin;
if (!isLogin) {
return next({ name: 'Login', query: { redirect: to.fullPath } });
}
next();
});
app.config.globalProperties.$datadic = {
get: (code) => dictCache[code] || null,
getContent: (code) => dictCache[code] ? dictCache[code].contents : '',
get: (code) => dictCache[code] || null,
getContent: (code) => dictCache[code] ? dictCache[code].contents : '',
}
app.config.globalProperties.$userInfo = userStore.getUserInfo;

View File

@ -30,7 +30,7 @@ const routes = [
path: '/My',
name: 'My',
component: () => import('./views/User/My.vue'),
meta: { title: '我的' }
meta: { title: '我的', cache: true }
},
],
meta: { noLogin: true }
@ -176,31 +176,31 @@ const routes = [
path: '/Business_School',
name: 'Business_School',
component: () => import('./views/Platform/Business_School.vue'),
meta: { title: '商学院' }
meta: { title: '商学院', noLogin: true, }
},
{
path: '/School_detail',
name: 'School_detail',
component: () => import('./views/Platform/School_Detail.vue'),
meta: { title: '商学院详情' }
meta: { title: '商学院详情', noLogin: true, }
},
{
path: '/School_Category',
name: 'School_Category',
component: () => import('./views/Platform/School_Category.vue'),
meta: { title: '商学院分类' }
meta: { title: '商学院分类', noLogin: true, }
},
{
path: '/Column',
name: 'Column',
component: () => import('./views/Platform/Column.vue'),
meta: { title: '栏目列表' }
meta: { title: '栏目列表', noLogin: true, }
},
{
path: '/ColumnDetail',
name: 'ColumnDetail',
component: () => import('./views/Platform/ColumnDetail.vue'),
meta: { title: '栏目详情' }
meta: { title: '栏目详情', noLogin: true, }
},
{
path: '/GoodsDetail',
@ -212,7 +212,7 @@ const routes = [
path: '/Category',
name: 'Category',
component: () => import('./views/Goods/Category.vue'),
meta: { title: '全部分类' }
meta: { title: '全部分类', noLogin: true, }
},
{
path: '/Operations',
@ -340,19 +340,3 @@ const router = createRouter({
})
export default router
// 全局前置守卫
router.beforeEach((to, from, next) => {
const userStore = useUserStore();
if (to.meta.title) {
document.title = to.meta.title;
}
if (to.meta.noLogin) {
return next();
}
const isLogin = userStore.isLogin;
if (!isLogin) {
return next({ name: 'Login', query: { redirect: to.fullPath } });
}
next();
});

View File

@ -134,6 +134,10 @@
.box-center-center;
margin-top: 5.6vw;
width: 100%;
a {
color: #f00;
}
}
.toLogin {
@ -5058,12 +5062,18 @@
}
.list {
.box;
.box-tb;
.box-align-center;
width: 100%;
margin-top: 4vw;
padding: 0 4vw;
overflow: hidden;
.item {
.box;
.box-align-center;
width: 100%;
margin-bottom: 4vw;
img {

View File

@ -2303,14 +2303,11 @@ img {
max-width: 80vw;
max-height: 90vh;
overflow-y: auto;
border-radius: 2.67vw;
.share_box {
.box;
.box-tb;
.box-align-center;
.box-pack-center;
margin: 0 auto;
padding: 6.8vw 9.2vw;
width: 100%;
@ -2321,21 +2318,35 @@ img {
border-radius: 2.67vw;
}
.logo {
width: 18.93vw;
height: 22.27vw;
}
.bottom_box {
.box;
.box-align-center;
.box-pack-around;
width: 100%;
padding: 3.33vw 0;
.logo {
width: 18.93vw;
height: 22.27vw;
}
.qrcode {
.box;
.box-tb;
.box-align-center;
img {
width: 17.07vw;
height: 17.07vw;
margin-bottom: 1.2vw;
}
}
}
.share_userinfo {
.box;
.box-align-center;
margin: 0 auto;
position: relative;
img {
@ -2357,7 +2368,7 @@ img {
// padding: 1.2vw 4vw 6vw;
padding-left: 6vw;
padding-right: 4vw;
margin-left: -3.33vw;
margin-left: -4.33vw;
height: 8vw;
text-align: center;
@ -2412,20 +2423,6 @@ img {
}
}
.qrcode {
.box;
.box-tb;
.box-align-center;
margin-top: 3.33vw;
padding-bottom: 3vw;
img {
width: 17.07vw;
height: 17.07vw;
margin-bottom: 1.2vw;
}
}
.share_result {
// margin-top: 4vw;
text-align: center;

View File

@ -161,7 +161,7 @@ a {
.box {
display: flex;
flex-wrap: nowrap;
flex-shrink: 0;
// flex-shrink: 0;
}
/*从左至右*/

View File

@ -83,7 +83,7 @@
<span>邀请人</span>
</div>
<div class="input_box">
<input type="text" placeholder="请填写邀请人账号(选填)" v-model="formData.Recommend" />
<input type="text" maxlength="11" placeholder="请填写邀请人账号(选填)" v-model="formData.Recommend" />
<van-icon v-if="formData.Recommend" @click="formData.Recommend = ''" name="cross" size="5vw"></van-icon>
</div>
</div>
@ -314,10 +314,10 @@ export default {
return
}
//
if (this.formData.SmsCode !== this.smsCode) {
this.$showFailToast?.('验证码错误')
return
}
// if (this.formData.SmsCode !== this.smsCode) {
// this.$showFailToast?.('')
// return
// }
if (!this.formData.Password) {
this.$showFailToast?.('请输入密码')
return
@ -335,7 +335,8 @@ export default {
this.$post('/v1/client/AuthClient/register', {
cellphone: this.formData.Phone,
userpwd: this.formData.Password,
pcellphone: this.formData.Recommend
pcellphone: this.formData.Recommend,
code: this.formData.SmsCode
}).then(data => {
this.loading = false
if (data.status !== 200) {

View File

@ -125,8 +125,6 @@
<van-popup v-model:show="show" class="shareimgbox" style="max-width: 80vw;">
<div class="share_box" id="bsCard">
<div class="share_userinfo">
<img :src="$file($userInfo.userimg)" alt="">
<div class="name"><span>{{ $userInfo.nickname }}友情推荐</span></div>

View File

@ -1,9 +1,8 @@
<template>
<router-view v-slot="{ Component, route }">
<keep-alive>
<component :is="Component" :key="route.name" v-if="route.meta.cache" />
<keep-alive :include="cacheList">
<component :is="Component" :key="route.name" />
</keep-alive>
<component :is="Component" :key="route.name" v-if="!route.meta.cache" />
</router-view>
<van-tabbar v-model="DefaultActive" placeholder @change="changeActive" active-color="#841e36" inactive-color="#1b1b1b"
fixed>
@ -51,6 +50,12 @@ export default {
],
}
},
computed: {
cacheList() {
const routes = this.$router.getRoutes()
return routes.filter(r => r.meta.cache).map(r => r.name)
}
},
watch: {
'$route.path': {
handler() {

View File

@ -91,6 +91,13 @@ export default {
.content {
max-width: 100%;
padding: 3.333vw;
overflow: hidden;
img {
max-width: 100%;
display: block;
margin: 10px auto;
}
}
}
</style>

View File

@ -1,6 +1,6 @@
<template>
<div class="index-page">
<van-swipe v-if="data && data.Carousel" @change="onSwipe" :autoplay="3000" indicator-color="white">
<van-swipe v-if="data && data.Carousel" :autoplay="3000" indicator-color="white">
<van-swipe-item v-for="item in data.Carousel">
<a @click="item.link ? $openUrl(item.Url) : ''"><img :src="$file(item.img) || '/img/avatar.png'"
width="100%"></a>
@ -16,10 +16,12 @@
</div>
<van-swipe vertical v-bind:touchable="false" class="notice-swipe" style="height: 12vw" :autoplay="3000"
v-bind:show-indicators="false">
<van-swipe-item class="v" style="height: 12vw; line-height: 6vw" v-for="item in data.Trends" :key="index">
<a :key="item.id" @click="$navigate(`/ColumnDetail?id=${item.id}`)">
<span></span>{{ item.name }}
</a>
<van-swipe-item class="v" style="height: 12vw; line-height: 6vw" v-for="(group, index) in trendsGrouped" :key="index">
<template v-for="item in group">
<a @click="$navigate(`/ColumnDetail?id=${item.id}`)">
<span></span>{{ item.name }}
</a>
</template>
</van-swipe-item>
</van-swipe>
</div>
@ -117,33 +119,27 @@
</template>
<script>
// import date from "../utils/date.js";
import date from "../../utils/date.js"
export default {
name: 'Home',
mounted() {
this.init();
this.data = { Carousel: [], News: [], Trends: [], Video: null };
this.options = [];
},
data() {
return {
data: {},
month: date.getMonth_C(),
showcreate: false,
showcreateing: false,
checked: 0,
tempData: {},
showRegion: false,
options: [],
defaultProps: {
value: "id",
text: "name",
},
region: '',
loading: false,
}
},
computed: {
trendsGrouped() {
if (!this.data.Trends) return [];
const result = [];
for (let i = 0; i < this.data.Trends.length; i += 2) {
result.push(this.data.Trends.slice(i, i + 2));
}
return result;
}
},
methods: {
@ -165,94 +161,6 @@ export default {
this.$showFailToast(err.message || '数据加载失败');
});
},
create() {
// this.showcreate = true;
this.$post('Member/GetApplyAgent').then(res => {
const data = res.data || res;
if (!data.AgentCode)
this.showcreate = true;
else {
this.showcreateing = true;
}
}).catch(err => {
this.$showFailToast(err.message);
});
},
changebox(e) {
this.checked = e;
this.tempData.AgentRegion = '';
this.tempData.AgentRegionName = '';
this.region = '';
},
onChange(e) {
if (e.selectedOptions.length > 0 && e.selectedOptions[0].level == 'province' && this.checked == 4) {
e.selectedOptions[e.tabIndex].children = null;
this.showRegion = false;
return;
}
else if (e.selectedOptions.length > 1 && e.selectedOptions[1].level == 'city' && this.checked == 3) {
e.selectedOptions[e.tabIndex].children = null;
this.showRegion = false;
return;
}
else if (e.selectedOptions.length > 2 && e.selectedOptions[2].level == 'district' && this.checked == 2) {
e.selectedOptions[e.tabIndex].children = null;
this.showRegion = false;
return;
}
if (e.selectedOptions[e.tabIndex].leaf) {
e.selectedOptions[e.tabIndex].children = null;
this.showRegion = false;
return;
}
else if (!e.selectedOptions[e.tabIndex].children || e.selectedOptions[e.tabIndex].children.length == 0) {
this.$post('Common/GetRegions', { value: e.value }).then(res => {
const data = res.data || res;
if (data.length > 0) {
data.forEach(x => { x.children = [] });
e.selectedOptions[e.tabIndex].children = data;
}
else {
e.selectedOptions[e.tabIndex].children = null;
this.showRegion = false;
}
});
}
},
onFinish(e) {
this.showRegion = false;
this.tempData.AgentRegion = e.selectedOptions.map(x => x.id).join(';');
this.tempData.AgentRegionName = e.selectedOptions.map(x => x.name).join('');
},
submit() {
if (!this.tempData.AgentName) {
this.$showFailToast('请输入姓名');
return;
}
if (!this.tempData.AgentPhone) {
this.$showFailToast('请输入手机号');
return;
}
if (!this.$validPhone(this.tempData.AgentPhone)) {
this.$showFailToast('手机号格式错误');
return;
}
if (!this.tempData.AgentRegion) {
this.$showFailToast('请选择共创区域');
return;
}
this.loading = true;
this.$post('Member/ApplyAgent', this.tempData).then(res => {
this.tempData = {};
this.$showSuccessToast('提交成功');
this.showcreate = false;
}).catch(err => {
this.$showFailToast(err.message);
}).finally(() => {
this.loading = false;
});
},
}
}
</script>

View File

@ -281,7 +281,7 @@ export default {
this.$showConfirmDialog({
title: "确认退出?",
}).then(() => {
this.$ls.remove('token');
this.$ls.remove('member_token');
location.replace('#/Login');
setTimeout(() => {
location.reload();
@ -365,7 +365,7 @@ export default {
confirmButtonText: '确定',
}).then(() => {
this.saving = false;
this.$ls.remove('token');
this.$ls.remove('member_token');
location.replace('#/Login');
});
} else {