diff --git a/App.vue b/App.vue index 56830bc..0832d65 100644 --- a/App.vue +++ b/App.vue @@ -4,6 +4,7 @@ import { peachInit } from './peach' onLaunch(() => { // 隐藏原生导航栏 使用自定义底部导航 + uni.hideTabBar() peachInit() }) diff --git a/pages.json b/pages.json index 2121f31..30f2813 100644 --- a/pages.json +++ b/pages.json @@ -8,6 +8,15 @@ }, "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages + { + "path": "pages/index/my", + "style": { + "navigationBarTitleText": "我的" + }, + "meta": { + "auth": false + } + }, { "path": "pages/index/index", "style": { @@ -27,9 +36,9 @@ } }, { - "path": "pages/index/category", + "path": "pages/index/product", "style": { - "navigationBarTitleText": "uni-app" + "navigationBarTitleText": "产品" }, "meta": { "auth": false @@ -45,6 +54,23 @@ } } ], + "tabBar": { + "list": [ + { + "pagePath": "pages/index/index" + }, + { + "pagePath": "pages/index/product" + }, + { + "pagePath": "pages/index/icons" + }, + { + "pagePath": "pages/index/my" + } + ] + }, + "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "uni-app", diff --git a/pages/index/index.vue b/pages/index/index.vue index 1dca059..6e7c004 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,73 +1,174 @@ diff --git a/pages/index/my.vue b/pages/index/my.vue new file mode 100644 index 0000000..7a2b7c9 --- /dev/null +++ b/pages/index/my.vue @@ -0,0 +1,181 @@ + + + + + diff --git a/pages/index/category.vue b/pages/index/product.vue similarity index 100% rename from pages/index/category.vue rename to pages/index/product.vue diff --git a/peach/store/app.js b/peach/store/app.js index a56ba34..1309b11 100644 --- a/peach/store/app.js +++ b/peach/store/app.js @@ -1,185 +1,181 @@ -import { ref } from "vue"; -import { defineStore } from "pinia"; -import $platform from "@/peach/platform"; -import $router from "@/peach/router"; -import user from "./user"; -import useSysStore from "./sys"; +import { ref } from 'vue' +import { defineStore } from 'pinia' +import $platform from '@/peach/platform' +import $router from '@/peach/router' +import user from './user' +import useSysStore from './sys' const useAppStore = defineStore( - "app", - () => { - /** - * @description 应用信息 - * @param string name 应用名称 - * @param string logo 应用logo - * @param string version 应用版本 - * @param string copyright 版权信息 - * @param string copyrightTime 版权时间 - * @param string cdnurl 静态资源域名 - * @param string filesystem 文件系统 - */ - const info = ref({ - name: "", - logo: "", - version: "", - copyright: "", - copytime: "", - cdnurl: "", - filesystem: "", - }); + 'app', + () => { + /** + * @description 应用信息 + * @param string name 应用名称 + * @param string logo 应用logo + * @param string version 应用版本 + * @param string copyright 版权信息 + * @param string copyrightTime 版权时间 + * @param string cdnurl 静态资源域名 + * @param string filesystem 文件系统 + */ + const info = ref({ + name: '', + logo: '', + version: '', + copyright: '', + copytime: '', + cdnurl: '', + filesystem: '', + }) - /** - * @description 平台信息 - * @param Array share.methods 分享方式 - * @param Object share.forwardInfo 转发信息 - * @param Object share.posterInfo 海报信息 - * @param string share.linkAddress 分享链接地址 - * @param number bindMobile 绑定手机号提醒 0: 提醒 1: 不提醒 - */ - const platform = ref({ - share: { - methods: [], - forwardInfo: {}, - posterInfo: {}, - linkAddress: "", - }, - bindMobile: 0, - }); - - const chat = ref({}); - - /** - * @description 模板信息 - * @param Object basic 基础模板 - * @param Object tabbar 底部导航模板 - */ - const template = ref({ - basic: { - tabbar: { - items: [ - { - activeIconUrl: - "http://mall.yudao.iocoder.cn/static/images/1-002.png", - iconUrl: "http://mall.yudao.iocoder.cn/static/images/1-001.png", - text: "首页", - url: "/pages/index/index", + /** + * @description 平台信息 + * @param Array share.methods 分享方式 + * @param Object share.forwardInfo 转发信息 + * @param Object share.posterInfo 海报信息 + * @param string share.linkAddress 分享链接地址 + * @param number bindMobile 绑定手机号提醒 0: 提醒 1: 不提醒 + */ + const platform = ref({ + share: { + methods: [], + forwardInfo: {}, + posterInfo: {}, + linkAddress: '', }, - { - activeIconUrl: - "http://mall.yudao.iocoder.cn/static/images/2-002.png", - iconUrl: "http://mall.yudao.iocoder.cn/static/images/2-001.png", - text: "分类", - url: "/pages/index/category?id=3", + bindMobile: 0, + }) + + const chat = ref({}) + + /** + * @description 模板信息 + * @param Object basic 基础模板 + * @param Object tabbar 底部导航模板 + */ + const template = ref({ + basic: { + tabbar: { + items: [ + { + activeIconUrl: 'http://mall.yudao.iocoder.cn/static/images/1-002.png', + iconUrl: 'http://mall.yudao.iocoder.cn/static/images/1-001.png', + text: '首页', + url: '/pages/index/index', + }, + { + activeIconUrl: 'http://mall.yudao.iocoder.cn/static/images/2-002.png', + iconUrl: 'http://mall.yudao.iocoder.cn/static/images/2-001.png', + text: '产品', + url: '/pages/index/product', + }, + { + activeIconUrl: 'http://mall.yudao.iocoder.cn/static/images/3-002.png', + iconUrl: 'http://mall.yudao.iocoder.cn/static/images/3-001.png', + text: '购物车', + url: '/pages/index/icons', + }, + { + activeIconUrl: 'http://mall.yudao.iocoder.cn/static/images/4-002.png', + iconUrl: 'http://mall.yudao.iocoder.cn/static/images/4-001.png', + text: '我的', + url: '/pages/index/my', + }, + ], + style: { + activeColor: '#fc4141', + bgColor: '#fff', + bgType: 'color', + color: '#282828', + }, + theme: 'red', + }, }, - { - activeIconUrl: - "http://mall.yudao.iocoder.cn/static/images/3-002.png", - iconUrl: "http://mall.yudao.iocoder.cn/static/images/3-001.png", - text: "购物车", - url: "/pages/index/icons", - }, - { - activeIconUrl: - "http://mall.yudao.iocoder.cn/static/images/4-002.png", - iconUrl: "http://mall.yudao.iocoder.cn/static/images/4-001.png", - text: "我的", - url: "/pages/index/user", - }, - ], - style: { - activeColor: "#fc4141", - bgColor: "#fff", - bgType: "color", - color: "#282828", - }, - theme: "red", - }, - }, - }); + }) - // 全局分享信息 - const shareInfo = ref({}); + // 全局分享信息 + const shareInfo = ref({}) - // 小程序发货信息管理 0: 没有 1:有 - const hasWechatTradeManaged = ref(0); + // 小程序发货信息管理 0: 没有 1:有 + const hasWechatTradeManaged = ref(0) - /** - * @author Ankkaya - * @description 小程序初始化 - * @param {Type} - - * @returns {Type} - */ - async function init() { - // 检查网络 - const networkStatus = await $platform.checkNetwork(); - if (!networkStatus) { - $router.error("NetworkError"); - } + /** + * @author Ankkaya + * @description 小程序初始化 + * @param {Type} - + * @returns {Type} + */ + async function init() { + // 检查网络 + const networkStatus = await $platform.checkNetwork() + if (!networkStatus) { + $router.error('NetworkError') + } - if (true) { - this.info = { - name: "🍑商城", - logo: "https://static.iocoder.cn/ruoyi-vue-pro-logo.png", - version: "1.0.0", - copyright: "全部开源,个人与企业可 100% 免费使用", - copytime: "Copyright© 2018-2024", + if (true) { + this.info = { + name: '🍑商城', + logo: 'https://static.iocoder.cn/ruoyi-vue-pro-logo.png', + version: '1.0.0', + copyright: '全部开源,个人与企业可 100% 免费使用', + copytime: 'Copyright© 2018-2024', - cdnurl: "https://file.sheepjs.com", // 云存储域名 - filesystem: "qcloud", // 云存储平台 - }; - this.platform = { - share: { - methods: ["poster", "link"], - linkAddress: "https://shopro.sheepjs.com/#/", - posterInfo: { - user_bg: "/static/img/shop/config/user-poster-bg.png", - goods_bg: "/static/img/shop/config/goods-poster-bg.png", - groupon_bg: "/static/img/shop/config/groupon-poster-bg.png", - }, - }, - bind_mobile: 0, - }; - this.chat = { - chat_domain: "https://api.shopro.sheepjs.com/chat", - room_id: "admin", - }; - this.has_wechat_trade_managed = 0; + cdnurl: 'https://file.sheepjs.com', // 云存储域名 + filesystem: 'qcloud', // 云存储平台 + } + this.platform = { + share: { + methods: ['poster', 'link'], + linkAddress: 'https://shopro.sheepjs.com/#/', + posterInfo: { + user_bg: '/static/img/shop/config/user-poster-bg.png', + goods_bg: '/static/img/shop/config/goods-poster-bg.png', + groupon_bg: '/static/img/shop/config/groupon-poster-bg.png', + }, + }, + bind_mobile: 0, + } + this.chat = { + chat_domain: 'https://api.shopro.sheepjs.com/chat', + room_id: 'admin', + } + this.has_wechat_trade_managed = 0 - // 加载主题 - const sysStore = useSysStore(); - sysStore.setTheme(); + // 加载主题 + const sysStore = useSysStore() + sysStore.setTheme() - // 模拟用户登录 - const userStore = user(); - if (userStore.isLogin) { - userStore.loginAfter(); + // 模拟用户登录 + const userStore = user() + if (userStore.isLogin) { + userStore.loginAfter() + } + return Promise.resolve(true) + } else { + $router.error('InitError', res.msg || '加载失败') + } } - return Promise.resolve(true); - } else { - $router.error("InitError", res.msg || "加载失败"); - } - } - return { - info, - platform, - chat, - template, - shareInfo, - hasWechatTradeManaged, - init, - }; - }, - { - persist: { - enabled: true, - strategies: [ - { - key: "app-store", - }, - ], + return { + info, + platform, + chat, + template, + shareInfo, + hasWechatTradeManaged, + init, + } }, - } -); + { + persist: { + enabled: true, + strategies: [ + { + key: 'app-store', + }, + ], + }, + } +) -export default useAppStore; +export default useAppStore diff --git a/peach/ui/pb-layout/pb-layout.vue b/peach/ui/pb-layout/pb-layout.vue index f220797..a9743cb 100644 --- a/peach/ui/pb-layout/pb-layout.vue +++ b/peach/ui/pb-layout/pb-layout.vue @@ -136,8 +136,9 @@ const navbarMode = computed(() => { const bgMain = computed(() => { if (navbarMode.value === 'inner') { return { - background: `${props.bgStyle.backgroundColor} url(${peach.$url.cdn( - props.bgStyle.backgroundImage + background: `${props.bgStyle.backgroundColor} url(${peach.$url.static( + props.bgStyle.backgroundImage, + props.bgStyle.imageType )}) no-repeat top center / 100% auto`, } } @@ -148,8 +149,9 @@ const bgMain = computed(() => { const bgBody = computed(() => { if (navbarMode.value === 'normal') { return { - background: `${props.bgStyle.backgroundColor} url(${peach.$url.cdn( - props.bgStyle.backgroundImage + background: `${props.bgStyle.backgroundColor} url(${peach.$url.static( + props.bgStyle.backgroundImage, + props.bgStyle.imageType )}) no-repeat top center / 100% auto`, } } diff --git a/static/bg-page.png b/static/bg-page.png new file mode 100644 index 0000000..0afce86 Binary files /dev/null and b/static/bg-page.png differ diff --git a/static/buycent.png b/static/buycent.png new file mode 100644 index 0000000..0febeb5 Binary files /dev/null and b/static/buycent.png differ diff --git a/static/dispensecent.png b/static/dispensecent.png new file mode 100644 index 0000000..3a6be9d Binary files /dev/null and b/static/dispensecent.png differ diff --git a/static/rule.png b/static/rule.png new file mode 100644 index 0000000..b7e93c1 Binary files /dev/null and b/static/rule.png differ diff --git a/static/withdraw.png b/static/withdraw.png new file mode 100644 index 0000000..567ef13 Binary files /dev/null and b/static/withdraw.png differ