新增全局颜色变量

This commit is contained in:
gyq 2025-01-07 09:53:45 +08:00
parent 96c378c54c
commit b3f2901e3b
4 changed files with 221 additions and 93 deletions

View File

@ -9,74 +9,75 @@
}
},
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},{
"path": "pages/video/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},{
"path": "pages/task/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},{
"path": "pages/chasingDrama/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},{
"path": "pages/me/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录",
"navigationStyle": "custom"
}
},{
"path": "pages/login/register",
"style": {
"navigationBarTitleText": "注册",
"navigationStyle": "custom"
}
},{
"path": "pages/login/registerApp",
"style": {
"navigationBarTitleText": "注册",
"navigationStyle": "custom"
}
},{
"path": "pages/login/forgetPwd",
"style": {
"navigationBarTitleText": "忘记密码",
"navigationStyle": "custom"
}
},{
"path": "pages/me/userInfo",
"style": {
"navigationBarTitleText": "个人资料"
}
},
{
"path" : "pages/index/search/index",
"style" :
{
"navigationBarTitleText" : "搜索"
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
}, {
"path": "pages/video/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
}, {
"path": "pages/task/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
}, {
"path": "pages/chasingDrama/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
}, {
"path": "pages/watching_history/watching_history"
}, {
"path": "pages/me/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
}, {
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录",
"navigationStyle": "custom"
}
}, {
"path": "pages/login/register",
"style": {
"navigationBarTitleText": "注册",
"navigationStyle": "custom"
}
}, {
"path": "pages/login/registerApp",
"style": {
"navigationBarTitleText": "注册",
"navigationStyle": "custom"
}
}, {
"path": "pages/login/forgetPwd",
"style": {
"navigationBarTitleText": "忘记密码",
"navigationStyle": "custom"
}
}, {
"path": "pages/me/userInfo",
"style": {
"navigationBarTitleText": "个人资料"
}
},
{
"path": "pages/index/search/index",
"style": {
"navigationBarTitleText": "搜索"
}
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
@ -89,13 +90,12 @@
"selectedColor": "#FF7581",
"backgroundColor": "#FFFFFF",
"borderStyle": "black",
"list": [
{
"list": [{
"pagePath": "pages/index/index",
"iconPath": "static/tabbar/index.png",
"selectedIconPath": "static/tabbar/index_2.png",
"text": "小剧场"
},{
}, {
"pagePath": "pages/video/index",
"iconPath": "static/tabbar/learn.png",
"selectedIconPath": "static/tabbar/learn_2.png",
@ -107,7 +107,7 @@
"selectedIconPath": "static/tabbar/task_2.png",
"text": "任务"
},
{
"pagePath": "pages/chasingDrama/index",
"iconPath": "static/tabbar/zhuiju.png",

View File

@ -4,7 +4,7 @@
<view class="list-wrap">
<view class="title-wrap">
<view class="title">最近观看</view>
<view class="more">更多</view>
<navigator class="more" url="/pages/watching_history/watching_history?type=3">更多</navigator>
</view>
<view class="list">
<view class="item">
@ -62,7 +62,7 @@
<view class="list-wrap">
<view class="title-wrap">
<view class="title">我的追剧</view>
<view class="more">更多</view>
<navigator class="more" url="/pages/watching_history/watching_history?type=1">更多</navigator>
</view>
<view class="list">
<view class="item">

View File

@ -0,0 +1,126 @@
<template>
<view class="container">
<view class="list">
<view class="item" v-for="item in listData.list" :key="item.id">
<view class="cover">
<image class="img" :src="item.titleImg" mode="aspectFill"></image>
</view>
<view class="info">
<view class="title">
{{ item.title }}
</view>
<view class="record">看到{{ item.courseDetailsName }}</view>
<view class="btm">
<view class="num">
<view v-if="item.courseDetailsCount">更新{{ item.courseDetailsCount }}</view>
</view>
<view class="btn">继续观看</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
import { selectByUserId } from '@/api/me/me.js';
const type = ref(1);
const typeList = ref([
{
type: 1,
label: '我的追剧'
},
{
type: 3,
label: '最近观看'
}
]);
const listData = reactive({
list: [],
page: 1,
size: 10
});
//
async function selectByUserIdAjax() {
try {
const res = await selectByUserId({
page: listData.page,
limit: listData.size,
classify: type.value
});
console.log(res);
if (res.code === 0) {
listData.list = res.data.records;
}
} catch (error) {
console.log(error);
}
}
onReachBottom(() => {
listData.page++;
selectByUserIdAjax();
});
onLoad((e) => {
if (e.type) {
type.value = e.type;
uni.setNavigationBarTitle({
title: typeList.value.find((item) => item.type == type.value).label
});
}
selectByUserIdAjax();
});
</script>
<style scoped lang="scss">
.container {
padding: 28upx;
color: #333;
font-size: 29upx;
}
.list {
.item {
padding: 28upx 0;
display: flex;
.cover {
width: 150upx;
height: 200upx;
margin-right: 28upx;
.img {
width: 100%;
height: 100%;
display: block;
border-radius: 20upx;
}
}
.info {
display: flex;
flex-direction: column;
gap: 4px;
.title {
font-size: 32upx;
font-weight: bold;
}
.record {
color: $uni-zj-color-primary;
}
.btm {
display: flex;
justify-content: space-between;
.btn {
padding: 4upx 12upx;
color: #fff;
background: $uni-zj-color-primary;
}
}
}
}
}
</style>

View File

@ -13,6 +13,8 @@
*/
/* 颜色变量 */
$uni-zj-color-primary: #ff7581;
$uni-zj-color-primary-active: #cb5d68;
/* 行为相关颜色 */
$uni-color-primary: #007aff;
@ -21,32 +23,32 @@ $uni-color-warning: #f0ad4e;
$uni-color-error: #dd524d;
/* 文字基本颜色 */
$uni-text-color:#333;//基本色
$uni-text-color-inverse:#fff;//反色
$uni-text-color-grey:#999;//辅助灰色如加载更多的提示信息
$uni-text-color: #333; //基本色
$uni-text-color-inverse: #fff; //反色
$uni-text-color-grey: #999; //辅助灰色如加载更多的提示信息
$uni-text-color-placeholder: #808080;
$uni-text-color-disable:#c0c0c0;
$uni-text-color-disable: #c0c0c0;
/* 背景颜色 */
$uni-bg-color:#ffffff;
$uni-bg-color-grey:#f8f8f8;
$uni-bg-color-hover:#f1f1f1;//点击状态颜色
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
$uni-bg-color: #ffffff;
$uni-bg-color-grey: #f8f8f8;
$uni-bg-color-hover: #f1f1f1; //点击状态颜色
$uni-bg-color-mask: rgba(0, 0, 0, 0.4); //遮罩颜色
/* 边框颜色 */
$uni-border-color:#c8c7cc;
$uni-border-color: #c8c7cc;
/* 尺寸变量 */
/* 文字尺寸 */
$uni-font-size-sm:12px;
$uni-font-size-base:14px;
$uni-font-size-lg:16px;
$uni-font-size-sm: 12px;
$uni-font-size-base: 14px;
$uni-font-size-lg: 16px;
/* 图片尺寸 */
$uni-img-size-sm:20px;
$uni-img-size-base:26px;
$uni-img-size-lg:40px;
$uni-img-size-sm: 20px;
$uni-img-size-base: 26px;
$uni-img-size-lg: 40px;
/* Border Radius */
$uni-border-radius-sm: 2px;
@ -68,10 +70,10 @@ $uni-spacing-col-lg: 12px;
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
/* 文章场景相关 */
$uni-color-title: #2C405A; // 文章标题颜色
$uni-font-size-title:20px;
$uni-color-title: #2c405a; // 文章标题颜色
$uni-font-size-title: 20px;
$uni-color-subtitle: #555555; // 二级标题颜色
$uni-font-size-subtitle:26px;
$uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:15px;
@import 'uview-plus/theme.scss';
$uni-font-size-subtitle: 26px;
$uni-color-paragraph: #3f536e; // 文章段落颜色
$uni-font-size-paragraph: 15px;
@import 'uview-plus/theme.scss';