diff --git a/src/App.ts b/src/App.ts index 7f95018..000d87b 100644 --- a/src/App.ts +++ b/src/App.ts @@ -38,6 +38,10 @@ function App() { success(res) { setStorage('brand', res.brand || 'pc') // 保存本机系统信息 + console.log('获取系统主题信息',JSON.stringify(res,undefined,4),) + // console.log(res,'监听系统主题变化,获取系统主题信息','res.osTheme',res.osTheme) + + store.commit('serveInfo/saveSysTheme',res.osTheme) // 详细字段信息参考 https://uniapp.dcloud.net.cn/api/system/info.html#%E7%B3%BB%E7%BB%9F%E4%BF%A1%E6%81%AF%E7%9A%84%E6%A6%82%E5%BF%B5 store.commit('serveInfo/setSystemInfo', JSON.stringify(res)) }, diff --git a/src/App.vue b/src/App.vue index 5d7c995..630ec0b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,3 +1,5 @@ + + - diff --git a/src/api/https/merchant.ts b/src/api/https/merchant.ts index 3cf3a33..a371505 100644 --- a/src/api/https/merchant.ts +++ b/src/api/https/merchant.ts @@ -246,7 +246,7 @@ const merchant = { /** * 设置美团门店IM线上状态 * @param {object} params 请求参数 - * @return {object} appPoiCode:美团门店id imStatus:状态 0-关闭 1-开启 + * @return {object} appPoiCode:美团门店id imStatus:状态 0-关闭 1-开启 京东 0:忙碌;1:在线 v.ImStatus */ set_mt_store_im_status: async (params: AnyObject): Promise => { return request.api('/v2/im/SetPoiIMStatus', 'POST', params) diff --git a/src/components/dialog/dialogCom.vue b/src/components/dialog/dialogCom.vue index 1fa79c9..e1f1033 100644 --- a/src/components/dialog/dialogCom.vue +++ b/src/components/dialog/dialogCom.vue @@ -97,11 +97,14 @@ function itemClick(type: string) { } - \ No newline at end of file diff --git a/src/components/jx-login-empty/jx-login-empty.vue b/src/components/jx-login-empty/jx-login-empty.vue index 10014c3..c8e8b9e 100644 --- a/src/components/jx-login-empty/jx-login-empty.vue +++ b/src/components/jx-login-empty/jx-login-empty.vue @@ -33,7 +33,7 @@ - \ No newline at end of file diff --git a/src/pages/goods-manager/component/left-bar/left-bar.scss b/src/pages/goods-manager/component/left-bar/left-bar.scss index 917801d..e91aad1 100644 --- a/src/pages/goods-manager/component/left-bar/left-bar.scss +++ b/src/pages/goods-manager/component/left-bar/left-bar.scss @@ -1,6 +1,6 @@ // 一级 .one-item { - background-color: #fff; + // background-color: #fff; height: 90rpx; overflow: hidden; transition: all 0.4s; @@ -42,4 +42,56 @@ border-left: 7rpx solid transparent; } } +} + + + +// 一级展开动画 +.one-item-active { + height: v-bind(oneHeight) !important; + background-color: rgb(236, 252, 233); + + // 三角图标动画 + .icon-jiantou1 { + display: inline-block; + transform: rotate(90deg) !important; + } +} + +// 一级选中高亮 +.never-pen-active { + background-color: $jx-primary; + color: #fff; + border-bottom: 1rpx solid #fff; +} + +// 一级展开背景 +.item-name { + color: $jx-primary; + .noe-seat-active { + border-left: 7rpx solid $jx-primary !important; + } +} + +// 二级高亮 +.tow-item-active { + color: $jx-primary; + background-color: #fff; + + // 二级选中高亮 + .tow-seat-active { + border-left: 7rpx solid $jx-primary !important; + } +} + +@media (prefers-color-scheme: light) { + .one-item{ + background-color: #fff; + } +} + +@media (prefers-color-scheme: dark) { + .one-item{ + background-color: #000; + } } \ No newline at end of file diff --git a/src/pages/goods-manager/component/left-bar/left-bar.vue b/src/pages/goods-manager/component/left-bar/left-bar.vue index 42b7264..00d0340 100644 --- a/src/pages/goods-manager/component/left-bar/left-bar.vue +++ b/src/pages/goods-manager/component/left-bar/left-bar.vue @@ -3,6 +3,7 @@ v-for="(item, index) in cat" :key="index" class="one-item" + :style="{'color': appTheme ? '': oneActive == index && item.children.length == 0 ? '#4eb331' : '#ffffff'}" :class="{ 'one-item-active': index == oneActive && item.children.length != 0 && isOpen, @@ -25,6 +26,7 @@ @@ -221,32 +224,4 @@ page { \ No newline at end of file diff --git a/src/pages/merchant/index.ts b/src/pages/merchant/index.ts index 431c2d1..64bd94b 100644 --- a/src/pages/merchant/index.ts +++ b/src/pages/merchant/index.ts @@ -2,7 +2,7 @@ import { computed, onBeforeUnmount, ref } from 'vue' import { timeFormatD } from '@/utils/tools' import { getStorage } from '@/utils/storage' -import { onLoad, onPullDownRefresh,onShow } from '@dcloudio/uni-app' +import { onLoad, onPullDownRefresh,onReady,onShow } from '@dcloudio/uni-app' import { store } from '@/store' import useGlobalFunc from '@/composables/useGlobalFunc' import merchant from "@/api/https/merchant" @@ -13,17 +13,22 @@ import merchant from "@/api/https/merchant" const merchantFn = function () { const { logOutFn, getMtStoreIMStatus } = useGlobalFunc() + const appTheme = computed(() => { return store.getters['serveInfo/appTheme'] === 'light'}) + // onReady(() => { + + // }) + + onShow(() => { - if(getStorage('token')){ - uni.setNavigationBarColor({ - frontColor: '#ffffff', // 前景文字颜色,必选 - backgroundColor: '#000000', // 背景颜色,必选 - animation: { - duration: 400, // 过渡动画时长,单位 ms - timingFunc: 'easeInOut' // 动画效果 - } - }); - } + uni.setNavigationBarColor({ + frontColor: getStorage('token') || !appTheme.value ? '#ffffff' : '#000000', // 前景文字颜色,必选 + backgroundColor: appTheme.value ? '#4eb331' : '#000000', // 背景颜色,必选 + }); + + uni.setTabBarStyle({backgroundColor:appTheme.value ? '#ffffff' : '#111111'}) + // console.log('监听系统主题的变化,商家中心',appTheme.value) + // console.log('监听系统主题变化,appTheme',appTheme.value) + }) /************************************************* diff --git a/src/pages/merchant/index.vue b/src/pages/merchant/index.vue index 6e41f77..2491355 100644 --- a/src/pages/merchant/index.vue +++ b/src/pages/merchant/index.vue @@ -79,7 +79,7 @@ const { .status_bar { height: calc(var(--status-bar-height) + 20rpx); width: 100%; - background-color: $jx-primary; + // background-color: $jx-primary; } .new-msg { display: flex; @@ -145,4 +145,16 @@ const { justify-content: center; align-items: center; } + +@media (prefers-color-scheme: light) { + .status_bar{ + background-color: $jx-primary; + } +} + +@media (prefers-color-scheme: dark) { + .status_bar{ + background-color:#000; + } +} \ No newline at end of file diff --git a/src/pages/merchant/options/options.scss b/src/pages/merchant/options/options.scss index 68449e4..71c128c 100644 --- a/src/pages/merchant/options/options.scss +++ b/src/pages/merchant/options/options.scss @@ -1,18 +1,14 @@ .options-root { position: relative; - background-color: #fff; + // background-color: #fff; margin-top: 20rpx; box-sizing: border-box; padding: 20rpx; - // border:1px solid red; :deep(.popupAnimation) { z-index: 1000000; } - - - .grid-item-box { position: relative; flex: 1; @@ -20,14 +16,6 @@ flex-direction: column; align-items: center; justify-content: center; - - // width: 100px; - width: 130rpx; - // flex: 1 1 25%; /* 这将确保每个项目占据大约1/3的宽度 */ - // max-width: 25%; /* 限制最大宽度以防止内容溢出 */ - // box-sizing: border-box; /* 包括padding和border在内的总宽度 */ - padding: 10px; /* 可选:添加一些内边距 */ - .image { width: 75rpx; height: 75rpx; @@ -43,7 +31,8 @@ // 我的账单 .bill-new { position: absolute; - top: 15rpx; + // top: 15rpx; + top: 0rpx; right: 15rpx; background-color: $jx-warring; color: #fff; @@ -73,7 +62,8 @@ // 差评管理 .evaluate-number { position: absolute; - top: 20rpx; + // top: 20rpx; + top: 0rpx; right: 30rpx; color: #fff; background-color: $jx-warring; @@ -122,4 +112,34 @@ 100% { transform: scale(1.05); } +} + +.grid-box{ + display:grid; + grid-template-columns: repeat(auto-fill, minmax(175rpx, 1fr)) +} + + +.grid-box-item{ + margin-bottom: 50rpx; +} + +@media (prefers-color-scheme: light) { + .options-root{ + background-color:#fff; + } + + .grid-box{ + color:#000; + } +} + +@media (prefers-color-scheme: dark) { + .options-root{ + background-color:#1c1c1c; + } + + .grid-box{ + color:#fff; + } } \ No newline at end of file diff --git a/src/pages/merchant/options/options.vue b/src/pages/merchant/options/options.vue index 20ca0f2..8fbfc0a 100644 --- a/src/pages/merchant/options/options.vue +++ b/src/pages/merchant/options/options.vue @@ -54,12 +54,12 @@ --> - + @@ -192,12 +192,13 @@ const grindListData = ref([ title: '门店评分', isIos: false, }, - { - id: 10, - icon: '/static/merchant-icon/11.png', - title: '帮助中心', - isIos: false, - }, + // 找不到源码,无法进行深色模式适配,暂时注释 + // { + // id: 10, + // icon: '/static/merchant-icon/11.png', + // title: '帮助中心', + // isIos: false, + // }, { id: 11, icon: '/static/merchant-icon/12.png', @@ -318,9 +319,9 @@ function grindData(title: number) { url: '/subPages/merchantChild/storeScore/storeScore', }) // 门店评分 break - case 10: - uni.navigateTo({ url: '/subPages/merchantChild/helpCenter/helpCenter' }) // 帮助中心 - break + // case 10: + // uni.navigateTo({ url: '/subPages/merchantChild/helpCenter/helpCenter' }) // 帮助中心 + // break case 11: uni.navigateTo({ url: '/subPages/orderChild/getPhone/getPhone' }) // 联系客服 break diff --git a/src/pages/merchant/orderData/orderData.scss b/src/pages/merchant/orderData/orderData.scss index c993de9..4475168 100644 --- a/src/pages/merchant/orderData/orderData.scss +++ b/src/pages/merchant/orderData/orderData.scss @@ -1,6 +1,6 @@ .order-data-root { box-sizing: border-box; - background-color: #fff; + // background-color: #fff; padding: 20rpx; } @@ -46,4 +46,18 @@ .afterNumber::before{ content: '-'; } +} + +@media (prefers-color-scheme: light) { + .order-data-root{ + background-color:#fff; + color:#000; + } +} + +@media (prefers-color-scheme: dark) { + .order-data-root{ + background-color:#1c1c1c; + color:#fff; + } } \ No newline at end of file diff --git a/src/pages/merchant/orderDataJxgy/orderDataJxgy.scss b/src/pages/merchant/orderDataJxgy/orderDataJxgy.scss index b630f68..d278caa 100644 --- a/src/pages/merchant/orderDataJxgy/orderDataJxgy.scss +++ b/src/pages/merchant/orderDataJxgy/orderDataJxgy.scss @@ -42,4 +42,18 @@ padding: 30rpx 0; } } +} + +@media (prefers-color-scheme: light) { + .order-data-root{ + background-color:#fff; + color:#000; + } +} + +@media (prefers-color-scheme: dark) { + .order-data-root{ + background-color:#1c1c1c; + color:#fff; + } } \ No newline at end of file diff --git a/src/pages/merchant/userInfo/userInfo.scss b/src/pages/merchant/userInfo/userInfo.scss index 7a1f798..cf5f6bd 100644 --- a/src/pages/merchant/userInfo/userInfo.scss +++ b/src/pages/merchant/userInfo/userInfo.scss @@ -3,9 +3,9 @@ top: 0; z-index: 9; box-sizing: border-box; - background-color: #4eb331; + // background-color: #4eb331; z-index: 1; - + .store-timer { text-align: center; color: #fcff06; @@ -56,7 +56,7 @@ .timer-root { margin-top: 5rpx; line-height: 1; - padding: 10rpx 10rpx; + padding: 10rpx 10rpx 10rpx 0rpx; background-color: rgba(0, 0, 0, 0.15); border-radius: 10rpx; } @@ -197,4 +197,21 @@ // padding: 20rpx; // border-radius: 15rpx; // } +} + +@media (prefers-color-scheme: light) { + .merchant-root{ + background-color:$jx-primary; + } +} + +@media (prefers-color-scheme: dark) { + .merchant-root{ + background-color:#000; + } + + .esc-btn, + .swithcStore-btn{ + background-color: #222; + } } \ No newline at end of file diff --git a/src/pages/merchant/userInfo/userInfo.ts b/src/pages/merchant/userInfo/userInfo.ts index b92272e..3780250 100644 --- a/src/pages/merchant/userInfo/userInfo.ts +++ b/src/pages/merchant/userInfo/userInfo.ts @@ -13,7 +13,7 @@ import useGlobalFunc from "@/composables/useGlobalFunc"; function userInfo() { // vuex - const { newMessage, logOutFn, isTxd, getMtStoreIMStatus } = useGlobalFunc() + const { newMessage, logOutFn, getMtStoreIMStatus } = useGlobalFunc() /** @@ -124,38 +124,7 @@ function userInfo() { * 切换门店 */ function switchStore() { - console.log('你有反应吗') - uni.navigateTo({ url: "/subPages/switchStore/switchStore", - complete(res){ - console.log('你有反应吗,为啥不跳转',JSON.stringify(res,undefined,4)) - } - }); - // store.commit('storeInfo/jxLoadingFn', true) - // console.log('切换门店11111111111',JSON.stringify(uni.getSystemInfoSync(),undefined,4)) - // openAppProduct({ - // success: (res : any) => { - // console.log('切换门店,,,,,,,,success: ', JSON.stringify(res,undefined,4)); - // }, - // fail: (err : any) => { - // console.error('切换门店,,,,,,,,,,,,fail: ', JSON.stringify(err,undefined,4)); - // }, - // complete: (res : any) => { - // console.log('切换门店,,,,,,,,,,,,complete: ', JSON.stringify(res,undefined,4)); - // } - // }); - - // vibrator.hasVibrator().then((hasVibrator:any) => { - // if (hasVibrator) { - // // 执行振动,参数可以是预定义的模式或者自定义的时长数组 - // vibrator.vibrate(new Array(0, 1000), () => { - // console.log('振动完成'); - // }); - // } else { - // console.log('设备不支持振动'); - // } - // }).catch((error:any) => { - // console.error('获取振动服务失败', error); - // }); + uni.navigateTo({ url: "/subPages/switchStore/switchStore"}) } /** diff --git a/src/pages/merchant/userInfo/userInfo.vue b/src/pages/merchant/userInfo/userInfo.vue index 9a50e18..92374ff 100644 --- a/src/pages/merchant/userInfo/userInfo.vue +++ b/src/pages/merchant/userInfo/userInfo.vue @@ -5,7 +5,6 @@ - >([]) + const appTheme = computed(() => store.getters['serveInfo/appTheme'] === 'light' ) + // onReady(() => { + + // }) + /************************************************* * 获取用户列表 */ onShow(async () => { - console.log('你登录了吗') - // uni.setNavigationBarColor({ - // frontColor: "#ffffff", - // backgroundColor: "#ff0000", - // animation: { - // duration: 400, - // timingFunc: "easeIn", - // }, - // }); - - + uni.setNavigationBarColor({ + frontColor: appTheme.value ? '#000000': '#ffffff', // 前景文字颜色,必选 + backgroundColor: appTheme.value ? '#ffffff' : '#000000', // 背景颜色,必选 + }); + uni.setTabBarStyle({backgroundColor:appTheme.value ? '#ffffff' : '#111111'}) if(getStorage('storeMessge')){ if(store.state.storeInfo.allStoreInfo.id !== getStorage('storeID')) await store.dispatch('storeInfo/getOneStore',getStorage("storeID")) await getMtStoreIMStatus() // 获取美团im单聊状态 @@ -81,6 +80,8 @@ const messageFn = function () { if(brr && brr.length>0){ let mtVendorIDInfo = brr.find((item:AnyObject) => item.vendorID === 1) let ebVendorIDInfo = brr.find((item:AnyObject) => item.vendorID === 3) + let jdVendorIDInfo = brr.find((item:AnyObject) => item.vendorID === 0) + // console.log(jdVendorIDInfo,'brr,999999999*****',brr) if(mtVendorIDInfo){ arr.push({ vendorStoreID: mtVendorIDInfo.vendorStoreID, @@ -96,6 +97,14 @@ const messageFn = function () { appID: ebVendorIDInfo.vendorOrgCode }) } + + if(jdVendorIDInfo){ + arr.push({ + vendorStoreID: jdVendorIDInfo.vendorStoreID, + vendorID: "0", + appID: jdVendorIDInfo.vendorOrgCode + }) + } } return arr } @@ -109,6 +118,9 @@ const messageFn = function () { } let venderIDInfo = arr.find((item:AnyObject) => item.vendorID === '1') let ebStore = arr.find((item:AnyObject) => item.vendorID === '3') + let jdStore = arr.find((item:AnyObject) => item.vendorID === '0') + // console.log(jdStore,'jdStore',JSON.stringify(arr,undefined,4)) + // let jdStore = arr.find((item:AnyObject) => item.vendorID === '3') let res = await message.get_IM_user_list(data) // res = msgInfo.userList // 模拟数据 @@ -118,9 +130,11 @@ const messageFn = function () { let newArr: any = [] let fmtUserList = venderIDInfo ? res.data[`${venderIDInfo.appID}:${venderIDInfo.vendorStoreID}:1`] || [] : [] // 美团 let febUserList = ebStore && JSON.stringify(ebStore) !== '{}' ? res.data[`${ebStore.appID}:${ebStore.vendorStoreID}:3`] || [] : [] // 饿百 + let jdUserList = jdStore && JSON.stringify(jdStore) !== '{}' ? res.data[`${jdStore.appID}:${jdStore.vendorStoreID}:0`] || [] : [] // 饿百 // let febUserList = res.data[`${ebStore.appID}:${ebStore.vendorStoreID}:3`] || [] let reverseList = fmtUserList.reverse() let reverseListEb = febUserList.reverse() + let reverseListJD = jdUserList.reverse() // 格式化数据 reverseList.map((element: any) => { let resData = JSON.parse(element) @@ -195,6 +209,23 @@ const messageFn = function () { }) } + if(reverseListJD && reverseListJD.length>0){ + reverseListJD.forEach((element:string) => { + let resData = JSON.parse(element) + console.log('京东消息,用户列表',resData) + let latestMsgHandler = resData.latestMsg + + let userList = { + ...resData, + latestMsg: latestMsgHandler, + latestTime: timeFormatDHM(+new Date(resData.latestTime )), + orderInfo: {}, + orderDesc: '' + } + newArr.push(userList) + }); + } + userListData.value = newArr } else { toast('获取信息异常') @@ -238,7 +269,8 @@ const messageFn = function () { charItem, // 进入聊天页面 userListData, // 用户列表 jumpToSetUp, // 跳到设置页面 - store + store, + appTheme } } diff --git a/src/pages/message/index.vue b/src/pages/message/index.vue index 432ca70..3444d70 100644 --- a/src/pages/message/index.vue +++ b/src/pages/message/index.vue @@ -18,16 +18,18 @@ - - @@ -52,11 +52,21 @@ charItem, // 聊天详情 userListData, // 用户列表 jumpToSetUp, // 跳到设置页面 - store + store, + appTheme } = messageFn() \ No newline at end of file diff --git a/src/pages/order-manager/childPages/component/orderListTop.vue b/src/pages/order-manager/childPages/component/orderListTop.vue index 69609ff..d8227c9 100644 --- a/src/pages/order-manager/childPages/component/orderListTop.vue +++ b/src/pages/order-manager/childPages/component/orderListTop.vue @@ -383,13 +383,13 @@ const isShow = computed(() => { align-items: center; justify-content: space-between; padding: 20rpx 15rpx; - background-color: #fff; + // background-color: #fff; border-bottom: 6rpx dashed #e7e7e7; .order { .timer { margin-top: 6rpx; - color: rgb(0, 0, 0); + // color: rgb(0, 0, 0); } } @@ -440,7 +440,7 @@ const isShow = computed(() => { .order-title { display: flex; justify-content: space-between; - background-color: #ffffff; + // background-color: #ffffff; // padding: 15rpx; padding: 10rpx; border-bottom: 2rpx dashed #e7e7e7; @@ -507,4 +507,29 @@ const isShow = computed(() => { line-height:25px; margin:auto 10px; } + +@media (prefers-color-scheme: light) { + .order-info, + .order-title{ + background-color: #fff + } + + .num-root, + .timer{ + color:#000; + } + +} + +@media (prefers-color-scheme: dark) { + .order-info, + .order-title{ + background-color: #000; + } + + .num-root, + .timer{ + color: #fff; + } +} \ No newline at end of file diff --git a/src/pages/order-manager/childPages/jx-tab/jx-tab.scss b/src/pages/order-manager/childPages/jx-tab/jx-tab.scss index daa7aa1..26fa08f 100644 --- a/src/pages/order-manager/childPages/jx-tab/jx-tab.scss +++ b/src/pages/order-manager/childPages/jx-tab/jx-tab.scss @@ -1,8 +1,23 @@ +@media (prefers-color-scheme: light) { + .jx-tabs{ + background-color: #fff; + color: #000; + } +} + +@media (prefers-color-scheme: dark) { + .jx-tabs{ + background-color: #000; + color: #fff; + } +} + + .jx-tabs { position: relative; z-index: 9; border-top: 1rpx solid #f8f8f8; - background-color: #fff; + // background-color: #fff; border-bottom: 1rpx solid rgb(214, 214, 214); // border: 1px solid red; diff --git a/src/pages/order-manager/childPages/order-filter/order-filter.scss b/src/pages/order-manager/childPages/order-filter/order-filter.scss index a3e1c77..be25b1b 100644 --- a/src/pages/order-manager/childPages/order-filter/order-filter.scss +++ b/src/pages/order-manager/childPages/order-filter/order-filter.scss @@ -1,9 +1,43 @@ +@media (prefers-color-scheme: light) { + .switch-filter{ + background-color: #fff + } + + .condition, + .title{ + color:#999; + } + + .confirm, + .cancel{ + color: #696969; + } +} + +@media (prefers-color-scheme: dark) { + .switch-filter{ + background-color: #222; + } + + .condition, + .title, + .value{ + color:#fff; + } + + .confirm, + .cancel{ + color:#fff; + } +} + + .switch-filter { - background-color: #fff; + // background-color: #fff; .condition { text-align: center; - color: #999999; + // color: #999999; margin-top: var(--status-bar-height); } @@ -24,9 +58,9 @@ } } - .title { - color: #999999; - } + // .title { + // color: #999999; + // } .value { padding: 5rpx 15rpx; @@ -43,14 +77,14 @@ .cancel, .confirm { - color: #696969; + // color: #696969; text-align: center; width: 100%; padding: 20rpx; } .confirm { - color: #000; + // color: #000; border-left: 1rpx solid #999999; } } diff --git a/src/pages/order-manager/childPages/pending-distribution/pending-distribution.vue b/src/pages/order-manager/childPages/pending-distribution/pending-distribution.vue index f1b321d..712d50f 100644 --- a/src/pages/order-manager/childPages/pending-distribution/pending-distribution.vue +++ b/src/pages/order-manager/childPages/pending-distribution/pending-distribution.vue @@ -211,7 +211,7 @@ function handleSelfDelivered() { } .distribution-root { position: relative; - background-color: #fff; + // background-color: #fff; padding-bottom: 20rpx; } @@ -320,4 +320,26 @@ function handleSelfDelivered() { color: #999999; margin-right: 25rpx; } + + +@media (prefers-color-scheme: light) { + .distribution-root{ + background-color: #fff + } + + .address{ + color:#000; + } +} + +@media (prefers-color-scheme: dark) { + .distribution-root{ + background-color: #000; + border:1rpx solid #eee; + } + + .address{ + color:#fff; + } +} \ No newline at end of file diff --git a/src/pages/order-manager/childPages/pending-order/pending-order.vue b/src/pages/order-manager/childPages/pending-order/pending-order.vue index 9180955..df01bfe 100644 --- a/src/pages/order-manager/childPages/pending-order/pending-order.vue +++ b/src/pages/order-manager/childPages/pending-order/pending-order.vue @@ -82,7 +82,7 @@ async function AcceptOrRefuseOrder( \ No newline at end of file diff --git a/src/pages/order-manager/childPages/pending-picking/pending-picking.vue b/src/pages/order-manager/childPages/pending-picking/pending-picking.vue index b86c232..862df92 100644 --- a/src/pages/order-manager/childPages/pending-picking/pending-picking.vue +++ b/src/pages/order-manager/childPages/pending-picking/pending-picking.vue @@ -79,7 +79,7 @@ async function pickingComplete(vendorOrderID: string, vendorID: string) { } .pending-picking-root { position: relative; - background-color: #fff; + // background-color: #fff; .remarks { padding: 15rpx; @@ -122,4 +122,23 @@ async function pickingComplete(vendorOrderID: string, vendorID: string) { } } } + +@media (prefers-color-scheme: light) { + .pending-picking-root{ + background-color: #fff + } + + +} + +@media (prefers-color-scheme: dark) { + .pending-picking-root{ + background-color: #000; + border:1rpx solid #eee; + } + + .remarks{ + color: #fff; + } +} \ No newline at end of file diff --git a/src/pages/order-manager/main.ts b/src/pages/order-manager/main.ts index 37c13d4..15b7010 100644 --- a/src/pages/order-manager/main.ts +++ b/src/pages/order-manager/main.ts @@ -3,10 +3,10 @@ import { store } from '@/store' import { getStorage } from '@/utils/storage' import toast from '@/utils/toast' import { timeFormatD, jx_trembling } from '@/utils/tools' -import { onLoad, onShow, onReady } from '@dcloudio/uni-app' -import { watch, ref, onBeforeUnmount } from 'vue' +import { onLoad, onReady, onShow } from '@dcloudio/uni-app' +import { watch, ref, onBeforeUnmount, computed } from 'vue' import order from "@/api/https/order" -import merchant from "@/api/https/merchant" + /** * 订单管理方法 * @author zhangshuwie <2966211270@qq.com> @@ -32,6 +32,11 @@ function orderInfoFn() { await store.dispatch('storeInfo/getOneStore',getStorage("storeID")) } + const appTheme = computed(() => { return store.getters['serveInfo/appTheme'] === 'light'}) + // onReady(() => { + + // }) + /** * tab单击事件 @@ -130,6 +135,15 @@ function orderInfoFn() { * 安卓通知情况 */ onShow(() => { + uni.setTabBarStyle({backgroundColor:appTheme.value ? '#ffffff' : '#111111'}) + // uni.setNavigationBarColor({ + // frontColor: '#ffffff', // 前景文字颜色,必选 + // backgroundColor: '#000000', // 背景颜色,必选 + // animation: { + // duration: 400, // 过渡动画时长,单位 ms + // timingFunc: 'easeInOut' // 动画效果 + // } + // }); let port = uni.getSystemInfoSync().platform switch (port) { case 'android': @@ -169,16 +183,11 @@ function orderInfoFn() { const isRest = ref(true) const isStatu = ref(false) onShow(async () => { - - - // uni.setNavigationBarColor({ - // frontColor: '#ffffff', // 前景文字颜色,必选 - // backgroundColor: '#000000', // 背景颜色,必选 - // animation: { - // duration: 400, // 过渡动画时长,单位 ms - // timingFunc: 'easeInOut' // 动画效果 - // } - // }); + console.log('监听系统主题的变化,订单页面',appTheme.value) + uni.setNavigationBarColor({ + frontColor: appTheme.value ? '#000000' : '#ffffff', // 前景文字颜色,必选 + backgroundColor: '#000000', // 背景颜色,必选 + }); uni.removeTabBarBadge({ index: 0 }) if (!store.state.storeInfo.allStoreInfo.id) { @@ -475,6 +484,7 @@ function orderInfoFn() { notice, // 通知 lockScreen, // 锁屏 setNotice, // 设置来单不响 + appTheme, // 主题 } } diff --git a/src/pages/order-manager/main.vue b/src/pages/order-manager/main.vue index 894ad6b..63fdca2 100644 --- a/src/pages/order-manager/main.vue +++ b/src/pages/order-manager/main.vue @@ -10,7 +10,6 @@ @touchstart="touchS()" @touchend="touchE($event, 1)" /> - 更多条件 @@ -75,7 +71,7 @@ refresher-enabled :refresher-triggered="triggered" @refresherrefresh="refresherrefresh" - refresher-background="#efefef" + :refresher-background="appTheme ? '#efefef' : '#000000'" @scrolltolower="scrolltolower" > @@ -241,6 +237,7 @@ const { notice, // 通知 lockScreen, // 锁屏 setNotice, // 设置来单不响 + appTheme, // 主题 } = orderInfoFn() /** * 联系运营页面跳转 @@ -335,8 +332,30 @@ function touchE(e: AnyObject, type: number) { .status_bar { height: var(--status-bar-height); width: 100%; - background-color: #fff; } + +@media (prefers-color-scheme: light) { + .filter-order, + .filter-root, + .status_bar{ + background-color: #fff + } + +} + +@media (prefers-color-scheme: dark) { + .filter-order, + .filter-root, + .status_bar{ + background-color: #000; + } + + .uni-search-bar{ + border:1rpx solid #eee; + } +} + + .open-status-msg { position: absolute; z-index: 99999999999; @@ -377,7 +396,6 @@ function touchE(e: AnyObject, type: number) { box-sizing: border-box; height: 90rpx; padding: 15rpx; - background-color: #fff; display: flex; align-items: center; @@ -474,7 +492,7 @@ page { padding: 15rpx; display: flex; justify-content: space-between; - background-color: #fff; + // background-color: #fff; view { box-sizing: border-box; diff --git a/src/store/useServeInfoStore/getters.ts b/src/store/useServeInfoStore/getters.ts index 90d8460..115c166 100644 --- a/src/store/useServeInfoStore/getters.ts +++ b/src/store/useServeInfoStore/getters.ts @@ -10,5 +10,25 @@ export default { */ getUpdateOrder(state: ServeinfoStoreType) { return state.updateOrder + }, + + /** + * 主题颜色 + */ + appTheme(state:ServeinfoStoreType){ + console.log(state,'获取设备信息,state',JSON.parse(state.sysInfo)) + let flag = state.sysTheme + // #ifdef APP-HARMONY + // flag = JSON.parse(state.sysInfo).osTheme || 'light' + // #endif + // console.log(JSON.parse(state.sysInfo),'JSON.parse(state.sysInfo)') + // #ifndef APP-HARMONY + // flag = JSON.parse(state.sysInfo).theme || 'light' + flag = 'dark' + + // #endif + + return flag + } } \ No newline at end of file diff --git a/src/store/useServeInfoStore/index.ts b/src/store/useServeInfoStore/index.ts index 6da4606..ecc3758 100644 --- a/src/store/useServeInfoStore/index.ts +++ b/src/store/useServeInfoStore/index.ts @@ -21,6 +21,7 @@ export interface ServeinfoStoreType { isAgreement: boolean // 是否同意用户协议 isAgreementIf: boolean // 勾选协议问题 serviceInfo: object // 服务信息 + sysTheme:string // 系统主题 } /** @@ -38,7 +39,8 @@ export const serveInfo: Module = { isNetWork: true, // 手机是否连接上网络默认有网 isAgreement: false, // 是否同意用户协议 isAgreementIf: false, // 勾选协议问题 - serviceInfo: {} // 服务信息 + serviceInfo: {}, // 服务信息 + sysTheme:'light' // 系统主题 light / dark }), mutations, actions, diff --git a/src/store/useServeInfoStore/mutations.ts b/src/store/useServeInfoStore/mutations.ts index 1c0df96..3eff76b 100644 --- a/src/store/useServeInfoStore/mutations.ts +++ b/src/store/useServeInfoStore/mutations.ts @@ -88,5 +88,13 @@ export default { */ setServiceInfo(state: ServeinfoStoreType, payload: Object) { state.serviceInfo = payload + }, + + + /************************************************* + * 保存系统主题 + */ + saveSysTheme(state:ServeinfoStoreType,payload:string){ + state.sysTheme = payload } } \ No newline at end of file diff --git a/src/store/useStoreInfoStore/getters.ts b/src/store/useStoreInfoStore/getters.ts index ed5df60..85b183b 100644 --- a/src/store/useStoreInfoStore/getters.ts +++ b/src/store/useStoreInfoStore/getters.ts @@ -48,6 +48,13 @@ export default { return state.imOnlineStatus.filter(item => item.vendorID === 3) }, + /** + * 淘宝闪购im单聊状态 + */ + imJdStatus(state: StoreInfoStoreType) { + return state.imOnlineStatus.filter(item => item.vendorID === 0) + }, + /** * 单聊状态(消息) @@ -56,6 +63,7 @@ export default { let str = '' if (getters.imMtStatus.length > 0 && !getters.imMtStatus[0].errMsg && getters.imMtStatus[0].imStatus === 0) str = '美团' if (getters.imEbStatus.length > 0 && !getters.imEbStatus[0].errMsg && getters.imEbStatus[0].imStatus === 0) str = str ? str + '/淘宝闪购':'淘宝闪购' + if (getters.imJdStatus.length > 0 && !getters.imJdStatus[0].errMsg && getters.imJdStatus[0].imStatus === 0) str = str ? str + '/京东':'京东' return str }, diff --git a/src/store/useStoreInfoStore/mutations.ts b/src/store/useStoreInfoStore/mutations.ts index 7f35db0..a4ad40d 100644 --- a/src/store/useStoreInfoStore/mutations.ts +++ b/src/store/useStoreInfoStore/mutations.ts @@ -71,6 +71,7 @@ export default { */ jxLoadingFn(state: StoreInfoStoreType, payload: boolean) { state.jxLoading = payload + // state.jxLoading = true }, diff --git a/src/subPages/agreement/jxcs.vue b/src/subPages/agreement/jxcs.vue index efdab7a..1d83f44 100644 --- a/src/subPages/agreement/jxcs.vue +++ b/src/subPages/agreement/jxcs.vue @@ -1,15 +1,37 @@ \ No newline at end of file diff --git a/src/subPages/agreement/updateVersion.vue b/src/subPages/agreement/updateVersion.vue index 3cb9d24..2cdf8df 100644 --- a/src/subPages/agreement/updateVersion.vue +++ b/src/subPages/agreement/updateVersion.vue @@ -47,18 +47,27 @@ \ No newline at end of file diff --git a/src/subPages/merchantChild/accountBalance/accountBalance.vue b/src/subPages/merchantChild/accountBalance/accountBalance.vue index dbc8364..818787f 100644 --- a/src/subPages/merchantChild/accountBalance/accountBalance.vue +++ b/src/subPages/merchantChild/accountBalance/accountBalance.vue @@ -40,8 +40,8 @@ import useGlobalFunc from '@/composables/useGlobalFunc' import { store } from '@/store' import { getStorage } from '@/utils/storage' import toast from '@/utils/toast' -import { onShow } from '@dcloudio/uni-app' -import { ref } from 'vue' +import { onReady, onShow } from '@dcloudio/uni-app' +import { computed, ref } from 'vue' const { openWeixin } = useGlobalFunc() const deliveryList = ref>([]) @@ -72,6 +72,15 @@ onShow(() => { getStoreMoney() // 门店账号余额 deliveryList.value = store.state.storeInfo.allStoreInfo.StoreMaps }) + +const appTheme = computed(() => { return store.getters['serveInfo/appTheme'] === 'light'}) +onReady(() => { + uni.setNavigationBarColor({ + frontColor: appTheme.value ? '#000000' : '#ffffff', // 前景文字颜色,必选 + backgroundColor: appTheme.value ? '#ffffff' : '#000000', // 背景颜色,必选 + }); +}) + const accountBalance = ref(0) /************************************************* * 品牌门店余额 @@ -142,7 +151,7 @@ function handleChargeNow(type: number) { align-items: center; padding: 20rpx; border-bottom: 1rpx solid rgb(235, 235, 235); - background-color: #fff; + // background-color: #fff; box-sizing: border-box; } @@ -154,7 +163,7 @@ function handleChargeNow(type: number) { } .delivery-root { - background-color: #fff; + // background-color: #fff; border-bottom: 1rpx solid rgb(235, 235, 235); .delivery { @@ -204,4 +213,18 @@ function handleChargeNow(type: number) { display: flex; justify-content: space-between; } + +@media (prefers-color-scheme: light) { + .delivery-root, + .balance{ + background-color:#fff; + } +} + +@media (prefers-color-scheme: dark) { + .delivery-root, + .balance{ + background-color:#000; + } +} \ No newline at end of file diff --git a/src/subPages/merchantChild/activity/activity.vue b/src/subPages/merchantChild/activity/activity.vue index cd1c238..a2f5516 100644 --- a/src/subPages/merchantChild/activity/activity.vue +++ b/src/subPages/merchantChild/activity/activity.vue @@ -6,14 +6,23 @@ import { getStorage } from '@/utils/storage' import toast from '@/utils/toast' import { timeFormatD } from '@/utils/tools' -import { onShow } from '@dcloudio/uni-app' -import { ref } from 'vue' +import { onReady, onShow } from '@dcloudio/uni-app' +import { computed, ref } from 'vue' import merchant from '@/api/https/merchant' +import { store } from '@/store' onShow(async () => { await QueryActivity() }) +const appTheme = computed(() => { return store.getters['serveInfo/appTheme'] === 'light'}) +onReady(() => { + uni.setNavigationBarColor({ + frontColor: appTheme.value ? '#000000' : '#ffffff',// 前景文字颜色,必选 + backgroundColor: appTheme.value ? '#ffffff' : '#000000', // 背景颜色,必选 + }); +}) + /** * 获取店铺活动信息 */ diff --git a/src/subPages/merchantChild/bill/bill.scss b/src/subPages/merchantChild/bill/bill.scss index b7f3045..436e5e1 100644 --- a/src/subPages/merchantChild/bill/bill.scss +++ b/src/subPages/merchantChild/bill/bill.scss @@ -3,7 +3,7 @@ .list-cell { position: relative; margin: 20rpx 20rpx 0; - background: white; + // background: white; border-radius: 10rpx; height: 144rpx; border: 1rpx solid #ddd; @@ -19,7 +19,7 @@ .bill-name { font-size: 36rpx; - color: #373c40; + // color: #373c40; line-height: 1; } @@ -82,4 +82,25 @@ 100% { transform: scale(1.05); } +} + + +@media (prefers-color-scheme: light) { + .list-cell{ + background-color:#fff; + } + + .bill-name{ + color:#373c40; + } +} + +@media (prefers-color-scheme: dark) { + .list-cell{ + background-color:#000; + } + + .bill-name{ + color:#fff; + } } \ No newline at end of file diff --git a/src/subPages/merchantChild/bill/bill.vue b/src/subPages/merchantChild/bill/bill.vue index 3c6706e..bcf89fa 100644 --- a/src/subPages/merchantChild/bill/bill.vue +++ b/src/subPages/merchantChild/bill/bill.vue @@ -34,7 +34,7 @@ import JxEmpty from '@/components/jx-empty/jx-empty.vue' import { store } from '@/store' import { getStorage } from '@/utils/storage' import { onLoad, onShow } from '@dcloudio/uni-app' -import { Ref, ref } from 'vue' +import { computed, Ref, ref } from 'vue' interface BillListType { billName: string @@ -60,6 +60,8 @@ onLoad((options) => { billList.value = JSON.parse(options?.billList) }) +const appTheme = computed(() => { return store.getters['serveInfo/appTheme'] === 'light'}) + function goLatestBill(url: string, index: string | number) { uni.navigateTo({ url: `/subPages/merchantChild/billDetaile/billDetaile?url=${url}&index=${index}`, @@ -71,6 +73,10 @@ function goLatestBill(url: string, index: string | number) { */ const newOrder = ref(true) onShow(() => { + uni.setNavigationBarColor({ + frontColor: appTheme.value ? '#000000' : '#ffffff', // 前景文字颜色,必选 + backgroundColor: appTheme.value ? '#ffffff' : '#000000', // 背景颜色,必选 + }); newOrder.value = getStorage('newBillUrl') === store.state.serveInfo.orderUrl }) diff --git a/src/subPages/merchantChild/billDetaile/billDetaile.vue b/src/subPages/merchantChild/billDetaile/billDetaile.vue index da3ff1c..1af7bbd 100644 --- a/src/subPages/merchantChild/billDetaile/billDetaile.vue +++ b/src/subPages/merchantChild/billDetaile/billDetaile.vue @@ -1,6 +1,7 @@