feat(首页)

This commit is contained in:
Ankkaya 2024-05-23 18:04:40 +08:00
parent 77f4ff3c58
commit eec95f90c1
3 changed files with 52 additions and 41 deletions

View File

@ -9,19 +9,18 @@
"pages": [ "pages": [
//pageshttps://uniapp.dcloud.io/collocation/pages //pageshttps://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/index/login", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "登录" "navigationBarTitleText": "uni-app"
}, },
"meta": { "meta": {
"auth": false "auth": false
} }
}, },
{ {
"path": "pages/index/index", "path": "pages/index/login",
"aliasPath": "/",
"style": { "style": {
"navigationBarTitleText": "uni-app" "navigationBarTitleText": "登录"
}, },
"meta": { "meta": {
"auth": false "auth": false

View File

@ -1,20 +1,32 @@
<template> <template>
<pb-layout <pb-layout navbar="inner" tabbar="/pages/index/index" :bgStyle="bgStyle">
title="首页" <view class="dashboard-module ss-p-x-30">
navbar="normal" <view class="merchant-info">
tabbar="/pages/index/index" <view class="merchant-info__logo ss-m-b-20">
:bgStyle="bgStyle" <image :src="state.merchantInfo.logo" mode="aspectFill"></image>
opacityBgUi="bg-white" </view>
color="black" <view class="merchant-info__name ss-m-b-20">{{ state.merchantInfo.name }}</view>
> <view class="merchant-info__description">{{ state.merchantInfo.description }}</view>
</view>
</view>
</pb-layout> </pb-layout>
</template> </template>
<script setup> <script setup>
import { ref } from 'vue'
const bgStyle = { const bgStyle = {
backgroundImage: backgroundImage:
'http://101.43.181.163:9001/mall-backend/24dd085ca57fbfaa27c3e16788237b1d7a95c854c01b5e3e219aad6709bbb748.jpg', 'http://101.43.181.163:9001/mall-backend/24dd085ca57fbfaa27c3e16788237b1d7a95c854c01b5e3e219aad6709bbb748.jpg',
backgroundColor: '', backgroundColor: '#fff',
description: '', description: '',
} }
const state = ref({
merchantInfo: {
name: '测试商家',
logo: 'http://101.43.181.163:9001/mall-backend/24dd085ca57fbfaa27c3e16788237b1d7a95c854c01b5e3e219aad6709bbb748.jpg',
description: '测试商家描述',
},
})
</script> </script>

View File

@ -1,17 +1,17 @@
import { ref } from "vue"; import { ref } from 'vue'
import { defineStore } from "pinia"; import { defineStore } from 'pinia'
const useSysStore = defineStore( const useSysStore = defineStore(
"sys", 'sys',
() => { () => {
const theme = ref(""); const theme = ref('')
const mode = ref("light"); const mode = ref('light')
const modeAuto = ref(false); const modeAuto = ref(false)
const fontSize = ref(1); const fontSize = ref(1)
function setTheme(stheme = "") { function setTheme(stheme = '') {
console.log("setTheme", stheme); console.log('setTheme', stheme)
theme.value = stheme ? stheme : "orange"; theme.value = stheme ? stheme : 'orange'
} }
return { return {
@ -20,14 +20,14 @@ const useSysStore = defineStore(
modeAuto, modeAuto,
fontSize, fontSize,
setTheme, setTheme,
}; }
}, },
{ {
persist: { persist: {
enabled: true, enabled: true,
strategies: [{ key: "sys-store" }], strategies: [{ key: 'sys-store' }],
}, },
} }
); )
export default useSysStore; export default useSysStore