Commit ce34c007 authored by tao.huang's avatar tao.huang

feat: 1.公共样式 2.store

parent eaaf1758
<script> <script>
export default { export default {
onLaunch: function() { onLaunch: function () {
console.log('App Launch') console.log("App Launch");
}, },
onShow: function() { onShow: function () {
console.log('App Show') console.log("App Show");
}, },
onHide: function() { onHide: function () {
console.log('App Hide') console.log("App Hide");
} },
} };
</script> </script>
<style> <style lang="less">
/*每个页面公共css */ /*每个页面公共css */
</style> ::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}
</style>
...@@ -6,7 +6,3 @@ export const userApi = { ...@@ -6,7 +6,3 @@ export const userApi = {
demo: (data) => api.post('/demo', data), demo: (data) => api.post('/demo', data),
} }
// 导出 http 实例,方便直接使用
export { api }
\ No newline at end of file
// 主题色
@color-gold-main: #D3A358; // 尊贵金,用于主题色
@color-gold-cover: #B27C1E; // 真诚棕,用于覆盖主题色等上层或其他场景重点高亮颜色
// 辅助色
@color-gold-light: #5FDE0A5; // 闪耀金,用于辅助色
@color-white-soft: #FEF7F2; // 柔和白,用于辅助色
@color-purple-energy: #A68DBB; // 能量紫,用于辅助色
@color-pink-cute: #E5C5DB; // 可爱粉,用于辅助色
// 中性色
@color-black-deep: #1D1E25; // 深黑,用于一级文字/图标等
@color-black-medium: #6F6D67; // 中黑,用于次级文字/图标等
@color-gray-medium: #DBDFE3; // 中灰,用于未选中/失效状态等
@color-gray-light: #F6F8FA; // 浅灰,用于页面背景色/卡片底色等
.hide-scrollbar {
&::-webkit-scrollbar {
display:none;
width:0;
height:0;
color:transparent;
}
}
...@@ -63,7 +63,9 @@ const handleTabClick = (index, item) => { ...@@ -63,7 +63,9 @@ const handleTabClick = (index, item) => {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
@import '@/common.less';
.tab-bar { .tab-bar {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
...@@ -122,7 +124,7 @@ const handleTabClick = (index, item) => { ...@@ -122,7 +124,7 @@ const handleTabClick = (index, item) => {
top: 81rpx; top: 81rpx;
&.active { &.active {
color: #b27c1e; color: @color-gold-cover;
font-weight: 500; font-weight: 500;
} }
} }
......
import App from "./App"; import App from "./App";
import apiRequest from "@/api/request.js";
import * as Pinia from 'pinia';
// #ifndef VUE3 // #ifndef VUE3
import Vue from "vue"; import Vue from "vue";
import "./uni.promisify.adaptor"; import "./uni.promisify.adaptor";
import { api } from "@/api/index.js";
// 全局挂载后使用 // 全局挂载后使用
Vue.prototype.$api = api; Vue.prototype.$api = apiRequest.api;
Vue.config.productionTip = false; Vue.config.productionTip = false;
App.mpType = "app"; App.mpType = "app";
...@@ -22,8 +22,11 @@ app.$mount(); ...@@ -22,8 +22,11 @@ app.$mount();
import { createSSRApp } from "vue"; import { createSSRApp } from "vue";
export function createApp() { export function createApp() {
const app = createSSRApp(App); const app = createSSRApp(App);
app.use(Pinia.createPinia());
app.config.globalProperties.$api = apiRequest.api;
return { return {
app, app,
Pinia
}; };
} }
// #endif // #endif
import { defineStore } from 'pinia';
export const useCounterStore = defineStore('counter', {
state: () => {
return { count: 0 };
},
// 也可以这样定义
// state: () => ({ count: 0 })
actions: {
increment() {
console.log(this.count);
this.count++;
},
},
});
\ No newline at end of file
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
// 品牌故事组件逻辑 // 品牌故事组件逻辑
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.brand-container { .brand-container {
padding: 20rpx; padding: 20rpx;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
// 首页组件逻辑 // 首页组件逻辑
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.home-container { .home-container {
padding: 20rpx; padding: 20rpx;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
// 积分服务组件逻辑 // 积分服务组件逻辑
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.integral-container { .integral-container {
padding: 20rpx; padding: 20rpx;
......
...@@ -194,7 +194,8 @@ onMounted(() => { ...@@ -194,7 +194,8 @@ onMounted(() => {
defineExpose({}); defineExpose({});
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
@import '@/common.less';
.my-container { .my-container {
min-height: 100vh; min-height: 100vh;
background-color: #f5f5f5; background-color: #f5f5f5;
...@@ -217,7 +218,7 @@ defineExpose({}); ...@@ -217,7 +218,7 @@ defineExpose({});
} }
.user-info { .user-info {
background-color: #fef7f2; background-color: @color-white-soft;
padding: 30rpx; padding: 30rpx;
width: 686rpx; width: 686rpx;
...@@ -325,7 +326,7 @@ defineExpose({}); ...@@ -325,7 +326,7 @@ defineExpose({});
.tool-title { .tool-title {
font-size: 32rpx; font-size: 32rpx;
font-weight: 500; font-weight: 500;
color: #1d1e25; color: @color-black-deep;
margin-left: 21rpx; margin-left: 21rpx;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment