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 @@
@@ -12,9 +13,10 @@
-
\ No newline at end of file
diff --git a/src/subPages/merchantChild/businessLicense/businessLicense.scss b/src/subPages/merchantChild/businessLicense/businessLicense.scss
index 08bced0..be25b23 100644
--- a/src/subPages/merchantChild/businessLicense/businessLicense.scss
+++ b/src/subPages/merchantChild/businessLicense/businessLicense.scss
@@ -1,7 +1,7 @@
// 营业执照
.business-license {
.title {
- color: #999;
+ // color: #999;
font-size: 28rpx;
padding: 20rpx;
font-weight: 400;
@@ -9,7 +9,7 @@
.cell {
padding: 20rpx;
- background: white;
+ // background: white;
border-top: 1rpx solid #e5e5e5;
display: flex;
@@ -38,7 +38,7 @@
.time {
width: 200rpx;
text-align: center;
- background: #efefef;
+ // background: #efefef;
border-radius: 8rpx;
padding: 10rpx 0;
}
@@ -57,4 +57,54 @@
width: 100%;
bottom: 0;
}
+}
+
+@media (prefers-color-scheme: light) {
+ .business-license{
+ background-color:#eee;
+ }
+
+ .cell{
+ background-color:#fff;
+
+ }
+
+ .time{
+ background-color: #efefef;
+ }
+
+ .title{
+ color:#999;
+ }
+
+ .cell>text,
+ .cell>input,
+ .licence-type,
+ .darkMode{
+ color:#000;
+ }
+}
+
+@media (prefers-color-scheme: dark) {
+ .business-license,
+ .time{
+ background-color:#222;
+ }
+
+ .cell{
+ background-color: #000;
+ }
+
+ .business-license,
+ .title,
+ .cell>text,
+ .cell>input,
+ .licence-type,
+ .darkMode{
+ color:#fff;
+ }
+
+ .item{
+ color:#000;
+ }
}
\ No newline at end of file
diff --git a/src/subPages/merchantChild/businessLicense/businessLicense.ts b/src/subPages/merchantChild/businessLicense/businessLicense.ts
index d07df0f..f63240b 100644
--- a/src/subPages/merchantChild/businessLicense/businessLicense.ts
+++ b/src/subPages/merchantChild/businessLicense/businessLicense.ts
@@ -6,7 +6,7 @@ import merchant from "@/api/https/merchant"
import toast from "@/utils/toast"
import { computed, ref } from "vue"
import { qiniuyun } from '@/utils/qiniuUploader'
-import { onLoad } from "@dcloudio/uni-app"
+import { onLoad,onReady } from "@dcloudio/uni-app"
import { store } from "@/store"
import { getStorage } from "@/utils/storage"
@@ -14,6 +14,13 @@ import { getStorage } from "@/utils/storage"
function businessLicense() {
const qiniuyunUploadImg = qiniuyun() // 七牛云sdk
+ const appTheme = computed(() => { return store.getters['serveInfo/appTheme'] === 'light'})
+ onReady(() => {
+ uni.setNavigationBarColor({
+ frontColor: appTheme.value ? '#000000' : '#ffffff', // 前景文字颜色,必选
+ backgroundColor: appTheme.value ? '#4eb331' : '#000000', // 背景颜色,必选
+ });
+ })
/**
* 获取营业执照信息
@@ -213,6 +220,7 @@ function businessLicense() {
imgChangeLicence2Image, // 上传图片
confirmSubmit, // 提交修改
imgUrls, // 上传的图片
+ appTheme
}
}
diff --git a/src/subPages/merchantChild/businessLicense/businessLicense.vue b/src/subPages/merchantChild/businessLicense/businessLicense.vue
index 031884c..f4b6183 100644
--- a/src/subPages/merchantChild/businessLicense/businessLicense.vue
+++ b/src/subPages/merchantChild/businessLicense/businessLicense.vue
@@ -56,7 +56,7 @@
>
{{ businessData.licenceValid || '请选择' }}
- 至
+ 至
@@ -97,16 +98,14 @@
>
{{ businessData.licence2Valid || '请选择' }}
- 至
+ 至
- {{
- businessData.licence2Expire || '请选择'
- }}
+ {{ businessData.licence2Expire || '请选择' }}
@@ -137,6 +136,7 @@ const {
imgChangeLicence2Image, // 上传图片
confirmSubmit, // 提交修改
imgUrls, // 上传的图片
+ appTheme
} = businessLicense()
diff --git a/src/subPages/merchantChild/evaluateM/commentList/commentList.scss b/src/subPages/merchantChild/evaluateM/commentList/commentList.scss
index a90f3d3..ec81d1f 100644
--- a/src/subPages/merchantChild/evaluateM/commentList/commentList.scss
+++ b/src/subPages/merchantChild/evaluateM/commentList/commentList.scss
@@ -14,7 +14,7 @@
.id {
font-size: 30rpx;
- color: #333;
+ // color: #333;
font-weight: 400;
}
@@ -27,7 +27,7 @@
// 评分
.score {
- background: white;
+ // background: white;
height: 80rpx;
border-bottom: 1rpx solid rgba(204, 204, 204, 0.4);
display: flex;
@@ -35,7 +35,7 @@
.text {
font-size: 28rpx;
- color: #666;
+ // color: #666;
font-weight: 400;
margin-right: 20rpx;
}
@@ -65,7 +65,7 @@
font-weight: 400;
color: #333;
padding: 30rpx 20rpx 40rpx;
- background: white;
+ // background: white;
text-indent: 2em;
text-align: justify;
}
@@ -73,7 +73,7 @@
// tag
.tag {
padding: 20rpx;
- background: white;
+ // background: white;
.span {
display: inline-block;
diff --git a/src/subPages/merchantChild/evaluateM/commentList/commentList.vue b/src/subPages/merchantChild/evaluateM/commentList/commentList.vue
index 10c97d7..dbd421f 100644
--- a/src/subPages/merchantChild/evaluateM/commentList/commentList.vue
+++ b/src/subPages/merchantChild/evaluateM/commentList/commentList.vue
@@ -46,7 +46,7 @@
@@ -124,6 +124,7 @@
+
-
+
+
@@ -162,10 +164,10 @@
\ No newline at end of file
diff --git a/src/subPages/merchantChild/setUp/setUp.scss b/src/subPages/merchantChild/setUp/setUp.scss
index 5c0f444..2e58547 100644
--- a/src/subPages/merchantChild/setUp/setUp.scss
+++ b/src/subPages/merchantChild/setUp/setUp.scss
@@ -11,7 +11,7 @@
// 来单提示
.tips-root {
background-color: #fff;
- margin-top: 20rpx;
+ // margin-top: 20rpx;
.item {
@extend %item;
@@ -78,11 +78,12 @@
}
.title-tip {
- background-color: rgb(245, 245, 245);
- padding: 0 0 20rpx 25rpx;
- font-size: 30rpx;
+ // background-color: rgb(245, 245, 245);
+ padding: 20rpx 0 20rpx 25rpx;
+ font-size: 34rpx;
color: #616161;
border-bottom: 1rpx solid rgb(220, 220, 220);
+ font-weight: bold;
}
.outLogin-root {
@@ -112,7 +113,7 @@
.jx-popup-update {
box-sizing: border-box;
padding: 20rpx;
- background-color: #fff;
+ // background-color: #fff;
border-radius: 0 0 15rpx 15rpx;
.text {
@@ -183,4 +184,29 @@
// padding: 20rpx;
// border-radius: 15rpx;
// }
+}
+
+@media (prefers-color-scheme: light) {
+ .title-tip{
+ background-color: rgb(245, 245, 245);
+ }
+
+ .jx-popup-update{
+ background-color: #fff;
+ }
+}
+
+@media (prefers-color-scheme: dark) {
+ .title-tip{
+ background-color:#191919;
+ }
+
+ .item{
+ background-color: #000;
+ }
+
+ .jx-popup-update{
+ background-color: #222;
+ color:#fff;
+ }
}
\ No newline at end of file
diff --git a/src/subPages/merchantChild/setUp/setUp.ts b/src/subPages/merchantChild/setUp/setUp.ts
index 9918154..74040fa 100644
--- a/src/subPages/merchantChild/setUp/setUp.ts
+++ b/src/subPages/merchantChild/setUp/setUp.ts
@@ -6,7 +6,7 @@ import merchant from "@/api/https/merchant"
import { store } from '@/store'
import { getStorage, setStorage } from '@/utils/storage'
import toast from '@/utils/toast'
-import { onShow } from '@dcloudio/uni-app'
+import { onReady, onShow } from '@dcloudio/uni-app'
import { computed, nextTick, ref } from 'vue'
import useGlobalFunc from '@/composables/useGlobalFunc'
@@ -22,24 +22,40 @@ function setUp() {
// IM单聊状态是否开启-饿百
const imEbStoreStatus = ref(0)
+ // IM单聊状态是否开启-京东
+ const imJdStoreStatus = ref(0)
+
// 美团门店信息
const mtStoreInfo = ref({})
// 饿百门店信息
const ebStoreInfo = ref({})
+ // 京东门店信息
+ const jdStoreInfo = ref({})
+
// 是否含有美团门店
const isExistMtStore = ref(false)
// 是否含有饿百门店
const isExistEbStore = ref(false)
+ // 是否含有京东门店
+ const isExistJdStore = ref(false)
+
/**
* 获取页面初始化信息
*/
onShow(async () => {
await getStoreMsg()
})
+ const appTheme = computed(() => { return store.getters['serveInfo/appTheme'] === 'light'})
+ onReady(() => {
+ uni.setNavigationBarColor({
+ frontColor: appTheme.value ? '#000000' : '#ffffff', // 前景文字颜色,必选
+ backgroundColor: appTheme.value ? '#ffffff' : '#000000', // 背景颜色,必选
+ });
+ })
// 打印机品牌
const printerData = ref({
0: '未绑定',
@@ -69,9 +85,11 @@ function setUp() {
// 获取第三方美团门店
if (JSON.stringify(store.state.storeInfo.allStoreInfo) !== '{}') {
let mtStore = store.state.storeInfo.allStoreInfo.StoreMaps.find((item: { vendorID: number }) => item.vendorID === 1)
+
if (mtStore && JSON.stringify(mtStore) !== '{}') {
mtStoreInfo.value = mtStore
isExistMtStore.value = true
+ // console.log(isExistMtStore.value,'获取第三方美团门店,mtStore,1111111111',mtStore)
let mtStatus = store.state.storeInfo.imOnlineStatus.filter(item => item.vendorID === 1)
imMtStoreStatus.value = mtStatus.length > 0 ? mtStatus[0].imStatus : 0
}
@@ -83,7 +101,17 @@ function setUp() {
let ebStataus = store.state.storeInfo.imOnlineStatus.filter(item => item.vendorID === 3)
imEbStoreStatus.value = ebStataus.length > 0 ? ebStataus[0].imStatus : 0
}
+
+ // let jdStore = store.state.storeInfo.allStoreInfo.StoreMaps.find((item: { vendorID: number }) => item.vendorID === 0)
+ // console.log('打印京东门店,是否存在京东',jdStore)
+ // if (jdStore && JSON.stringify(jdStore) !== '{}') {
+ // jdStoreInfo.value = jdStore
+ // isExistJdStore.value = true
+ // // let jdStataus = store.state.storeInfo.imOnlineStatus.filter(item => item.vendorID === 0)
+ // // imJdStoreStatus.value = jdStataus.length > 0 ? jdStataus[0].imStatus : 0
+ // }
}
+ // console.log(isExistMtStore.value,'获取第三方美团门店,mtStore')
// 网络打印机
netPrinter.value = (store.state.serveInfo.serviceInfo as any).printerVendorInfo
for (let i in netPrinter.value) {
@@ -130,7 +158,7 @@ function setUp() {
{
id: 1,
title: '用户协议',
- url: 'https://www.jxc4.com/managerApp/jxdjService.html',
+ url: `https://www.jxc4.com/managerApp/jxdjService.html`,
},
{
id: 2,
@@ -375,10 +403,10 @@ function setUp() {
*/
async function switchImMtStoreStatus(e: AnyObject, vendorID: number) {
let data = [
- {
+ {
vendorID: vendorID,
- vendorStoreID: vendorID === 1 ? mtStoreInfo.value.vendorStoreID + '' : ebStoreInfo.value.vendorStoreID + '',
- vendorOrgCode: vendorID === 1 ? mtStoreInfo.value.vendorOrgCode + '' : ebStoreInfo.value.vendorOrgCode + '',
+ vendorStoreID: vendorID === 1 ? mtStoreInfo.value.vendorStoreID + '' : vendorID === 3 ? ebStoreInfo.value.vendorStoreID + '' : jdStoreInfo.value.vendorStoreID,
+ vendorOrgCode: vendorID === 1 ? mtStoreInfo.value.vendorOrgCode + '' : vendorID === 3 ? ebStoreInfo.value.vendorOrgCode + '' : jdStoreInfo.value.vendorOrgCode,
imStatus: e.detail.value ? 1 : 0
}
]
@@ -562,9 +590,11 @@ function setUp() {
switchprinterDisabled, // 网络打印机禁用开关,
imMtStoreStatus, // IM单聊状态是否开启
imEbStoreStatus, // IM单聊状态是否开启 饿百
+ imJdStoreStatus, // IM单聊状态是否开启 京东
switchImMtStoreStatus, // 更改IM单聊门店状态
isExistMtStore, // 是否绑定美团门店
isExistEbStore, // 是否绑定饿百门店
+ isExistJdStore, // 是否绑定京东门店
printerFontSize, // 蓝牙打印机字体大小
retryActive, // 默认选中重试次数
changeRetry, // 选择重试次数
diff --git a/src/subPages/merchantChild/setUp/setUp.vue b/src/subPages/merchantChild/setUp/setUp.vue
index 697b522..bd58471 100644
--- a/src/subPages/merchantChild/setUp/setUp.vue
+++ b/src/subPages/merchantChild/setUp/setUp.vue
@@ -135,8 +135,8 @@
-->
-
-
+
+
消息设置
美团IM单聊状态
@@ -160,6 +160,17 @@
/>
未知状态
+
@@ -254,9 +265,11 @@ const {
switchprinterDisabled, // 网络打印机禁用开关
imMtStoreStatus, // IM单聊状态是否开启
imEbStoreStatus, // IM单聊状态是否开启 饿百
+ imJdStoreStatus, // IM单聊状态是否开启 京东
switchImMtStoreStatus, // 更改IM单聊门店状态
isExistMtStore, // 是否绑定美团门店
isExistEbStore, // 是否绑定饿百门店
+ isExistJdStore, // 是否绑定京东门店
printerFontSize, // 蓝牙打印机字体大小
retryActive, // 默认选中重试次数
changeRetry, // 选择重试次数
diff --git a/src/subPages/merchantChild/shareStore/shareStore.scss b/src/subPages/merchantChild/shareStore/shareStore.scss
index 733434d..5378f85 100644
--- a/src/subPages/merchantChild/shareStore/shareStore.scss
+++ b/src/subPages/merchantChild/shareStore/shareStore.scss
@@ -1,6 +1,6 @@
.store-vender {
min-height: 90rpx;
- background: white;
+ // background: white;
border-top: 1rpx solid #e5e5e5;
border-bottom: 1rpx solid #e5e5e5;
display: flex;
@@ -39,7 +39,7 @@
.code-text {
font-size: 26rpx;
- color: rgb(71, 71, 71);
+ // color: rgb(71, 71, 71);
}
}
}
@@ -89,4 +89,25 @@
padding: 20rpx;
color: #fff;
}
+}
+
+
+@media (prefers-color-scheme: light) {
+ .store-vender{
+ background-color: #fff;
+ }
+
+ .code-text{
+ color: rgb(71, 71, 71);
+ }
+}
+
+@media (prefers-color-scheme: dark) {
+ .store-vender{
+ background-color: #000;
+ }
+
+ .code-text{
+ color: #fff;
+ }
}
\ No newline at end of file
diff --git a/src/subPages/merchantChild/shareStore/shareStore.vue b/src/subPages/merchantChild/shareStore/shareStore.vue
index f0c53a7..1a9c2bb 100644
--- a/src/subPages/merchantChild/shareStore/shareStore.vue
+++ b/src/subPages/merchantChild/shareStore/shareStore.vue
@@ -13,7 +13,7 @@
}}
-
+
店铺码
@@ -43,15 +43,26 @@
import merchant from "@/api/https/merchant"
import configCms from '@/utils/configCms'
import { getStorage } from '@/utils/storage'
-import { onLoad } from '@dcloudio/uni-app'
+import { onLoad, onReady } from '@dcloudio/uni-app'
import { computed, onBeforeUnmount, ref } from 'vue'
import drawQrcode from '@/utils/weapp.qrcode.esm.js'
import { clearList } from '@/utils/tools'
+import { store } from "@/store"
onLoad(async () => {
await getStoreInfo()
})
+
+const appTheme = computed(() => { return store.getters['serveInfo/appTheme'] === 'light'})
+onReady(() => {
+ uni.setNavigationBarColor({
+ frontColor: appTheme.value ? '#000000' : '#ffffff', // 前景文字颜色,必选
+ backgroundColor: appTheme.value ? '#4eb331' : '#000000', // 背景颜色,必选
+ });
+})
+
+
/**
* 获取店铺数据
*/
@@ -63,6 +74,7 @@ async function getStoreInfo() {
let storeInfoRes = await merchant.get_stores(data)
// storeMaps.value = storeInfoRes.data.stores[0].StoreMaps
storeMaps.value = storeInfoRes.data.stores[0].StoreMaps.filter((item:AnyObject) => item.vendorID !== 16 && item.vendorID !== 14)
+ console.log('storeMaps,查看门店店铺信息',JSON.stringify(storeInfoRes,undefined,4))
}
/**
diff --git a/src/subPages/merchantChild/storeScore/storeScore.scss b/src/subPages/merchantChild/storeScore/storeScore.scss
index 975dc2f..f06cd0e 100644
--- a/src/subPages/merchantChild/storeScore/storeScore.scss
+++ b/src/subPages/merchantChild/storeScore/storeScore.scss
@@ -12,7 +12,7 @@
margin-bottom: 20rpx;
align-items: center;
padding: 20rpx;
- background: white;
+ // background: white;
box-sizing: border-box;
border: 1rpx solid #eee;
}
@@ -47,7 +47,7 @@
flex: 1;
.storeName {
- color: black;
+ // color: black;
font-size: 36rpx;
}
@@ -69,4 +69,24 @@
color: #666;
text-align: center;
font-size: 32rpx;
+}
+
+@media (prefers-color-scheme: light) {
+ .score-item{
+ background-color: #fff;
+ }
+
+ .storeName{
+ color:#000;
+ }
+}
+
+@media (prefers-color-scheme: dark) {
+ .score-item{
+ background-color: #000;
+ }
+
+ .storeName{
+ color: #fff;
+ }
}
\ No newline at end of file
diff --git a/src/subPages/merchantChild/storeScore/storeScore.vue b/src/subPages/merchantChild/storeScore/storeScore.vue
index c1a1da6..b4a9269 100644
--- a/src/subPages/merchantChild/storeScore/storeScore.vue
+++ b/src/subPages/merchantChild/storeScore/storeScore.vue
@@ -35,11 +35,12 @@
-
\ No newline at end of file
diff --git a/src/subPages/merchantChild/useInfo/useInfo.vue b/src/subPages/merchantChild/useInfo/useInfo.vue
index 0252eba..e50d51d 100644
--- a/src/subPages/merchantChild/useInfo/useInfo.vue
+++ b/src/subPages/merchantChild/useInfo/useInfo.vue
@@ -30,6 +30,7 @@
import login from '@/api/https/login'
import useGlobalFunc from '@/composables/useGlobalFunc'
+import { store } from '@/store'
import { getStorage } from '@/utils/storage'
import toast from '@/utils/toast'
+import { onReady } from '@dcloudio/uni-app'
import md5 from 'js-md5'
-import { ref } from 'vue'
+import { computed, ref } from 'vue'
const { copyInfo, logOutFn, previewImage } = useGlobalFunc()
// 原密码
@@ -81,6 +86,13 @@ const oldPwd = ref('')
// 新密码
const newPwd1 = ref('')
const newPwd2 = ref('')
+const appTheme = computed(() => { return store.getters['serveInfo/appTheme'] === 'light'})
+onReady(() => {
+ uni.setNavigationBarColor({
+ frontColor: appTheme.value ? '#000000' : '#ffffff', // 前景文字颜色,必选
+ backgroundColor: appTheme.value ? '#ffffff' : '#000000', // 背景颜色,必选
+ });
+})
/*************************************************
* 确认修改密码
@@ -108,6 +120,12 @@ async function submist(pwd: string) {
\ No newline at end of file
diff --git a/src/subPages/messageChild/msgChat/msgChat.ts b/src/subPages/messageChild/msgChat/msgChat.ts
index 22ccccf..817e886 100644
--- a/src/subPages/messageChild/msgChat/msgChat.ts
+++ b/src/subPages/messageChild/msgChat/msgChat.ts
@@ -1,5 +1,5 @@
-import { onLoad, onShow } from '@dcloudio/uni-app'
-import { nextTick, onBeforeUnmount, ref, watch } from 'vue'
+import { onLoad, onReady, onShow } from '@dcloudio/uni-app'
+import { computed, nextTick, onBeforeUnmount, ref, watch } from 'vue'
import { store } from "@/store"
import message from "@/api/https/message"
import toast from '@/utils/toast'
@@ -11,6 +11,7 @@ import { qiniuyun } from '@/utils/qiniuUploader'
import { getStorage } from "@/utils/storage";
const { analyEmoji } = useGlobalFunc()
const qiniuyunUploadImg = qiniuyun() // 七牛云sdk
+
/*************************************************
* 聊天详情
*/
@@ -24,17 +25,19 @@ const msgChatFn = function () {
const platformID = ref('')
- const isShowEmoji = ref(false) // 是否显示emoji
+ // const isShowEmoji = ref(false) // 是否显示emoji
- const editorCtx = ref() // editor编辑器初始化
+ // const editorCtx = ref() // editor编辑器初始化
const readOnly = ref(false)
+ const appTheme = computed(() => { return store.getters['serveInfo/appTheme'] === 'light'})
/*************************************************
* 接收数据
*/
let useData: AnyObject = {}
let ebStore: AnyObject = {}
+ let jdStore: AnyObject = {}
onLoad((potion: any) => {
let res:any = getStorage('vendorUserInfo')
if(JSON.stringify(potion) === '{}') {
@@ -50,19 +53,28 @@ const msgChatFn = function () {
useData = useInfo
}
if (store.state.storeInfo.allStoreInfo.StoreMaps && store.state.storeInfo.allStoreInfo.StoreMaps.length > 0) ebStore = store.state.storeInfo.allStoreInfo.StoreMaps.find((item: { vendorID: number }) => item.vendorID === 3) // 饿百
+ if (store.state.storeInfo.allStoreInfo.StoreMaps && store.state.storeInfo.allStoreInfo.StoreMaps.length > 0) jdStore = store.state.storeInfo.allStoreInfo.StoreMaps.find((item: { vendorID: number }) => item.vendorID === 0) // 京东
// 修改标题
uni.setNavigationBarTitle({
title:
useData.vendorID == 1
? `【美团${useData.orderDesc}】${useData.userID === '0' ? '群发消息' : useData.userID}`
- : `【淘宝闪购】${useData.userID}`,
+ : useData.vendorID == 3 ? `【淘宝闪购】${useData.userID}` : `【京东】${useData.userID}`,
})
// 获取聊天数据
getChatDetail()
})
+ onReady(() => {
+ uni.setNavigationBarColor({
+ frontColor: appTheme.value ? '#000000' : '#ffffff', // 前景文字颜色,必选
+ backgroundColor: appTheme.value ? '#ffffff' : '#000000', // 背景颜色,必选
+ });
+ })
+
onShow(async () => {
+
if (useData.NewMessageNum == 0) return
await SetMsgRead()
})
@@ -74,8 +86,8 @@ const msgChatFn = function () {
async function SetMsgRead() {
let venderIDInfo = store.state.storeInfo.vendorStoreIDS
let data = {
- appID: useData.vendorID === 1 ? venderIDInfo.appID : ebStore.vendorOrgCode,
- vendorStoreID: useData.vendorID === 1 ? venderIDInfo.MT : ebStore.vendorStoreID,
+ appID: useData.vendorID === 1 ? venderIDInfo.appID : useData.vendorID === 3 ? ebStore.vendorOrgCode : jdStore.vendorOrgCode,
+ vendorStoreID: useData.vendorID === 1 ? venderIDInfo.MT : useData.vendorID === 3 ? ebStore.vendorStoreID : jdStore.vendorStoreID,
vendorID: "" + useData.vendorID,
orderID: "" + useData.orderID ? useData.orderID : '0',
userID: useData.userID
@@ -92,15 +104,15 @@ const msgChatFn = function () {
let venderIDInfo = store.state.storeInfo.vendorStoreIDS
let data = {
payLoad: JSON.stringify([{
- vendorStoreID: useData.vendorID === 1 ? venderIDInfo.MT : ebStore.vendorStoreID,
+ vendorStoreID: useData.vendorID === 1 ? venderIDInfo.MT : useData.vendorID === 3 ? ebStore.vendorStoreID : jdStore.vendorStoreID,
vendorID: "" + useData.vendorID,
- appID: useData.vendorID === 1 ? venderIDInfo.appID : ebStore.vendorOrgCode,
+ appID: useData.vendorID === 1 ? venderIDInfo.appID : useData.vendorID === 3 ? ebStore.vendorOrgCode : jdStore.vendorOrgCode,
userID: useData.userID
}])
}
let res = await message.get_IM_chat_detail(data)
// res = msgInfo.chatDetail // 模拟数据
-
+ // console.log('获取聊天详情',res)
if (res.code == 0) {
let newArr: any = []
if (useData.vendorID === 1) {
@@ -121,7 +133,7 @@ const msgChatFn = function () {
newArr.push(msgList)
}
})
- } else {
+ } else if(useData.vendorID === 3){
// 饿百
let newMsg = res.data[`${ebStore.vendorOrgCode}:${ebStore.vendorStoreID}:${useData.vendorID}:${useData.userID}`] || []
newMsg.map((element: any, index: number) => {
@@ -162,6 +174,27 @@ const msgChatFn = function () {
newArr.push(msgList)
}
})
+ }else if(useData.vendorID === 0){
+ let newMsg = res.data[`${jdStore.vendorOrgCode}:${jdStore.vendorStoreID}:${useData.vendorID}:${useData.userID}`] || []
+ newMsg.forEach((element:string) => {
+ let resData = jxParse(element)
+ if(resData.msgContent){
+ let msg = JSON.parse(resData.msgContent.extendJsonData)
+ let content = msg.body.type === 'text' ? msg.body.content : msg.body.type === 'image' ? msg.body.url : msg.body.content
+ // console.log(msg,'msg','获取聊天详情,resData',resData,'useData',useData.userID)
+
+ let msgList = {
+ sendType:'jd',
+ ...msg,
+ msg_content: msg.body.type === 'text' ? analyEmoji(content) : msg.body.type === 'image' ? content : '未知' ,
+ msg_source: useData.userID === msg.from.pin ? 2 : 1, // 目前全是客户发的消息
+ msg_type: msg.body.type === 'text' ? 1 : msg.body.type === 'image' ? 2 : 99 // 目前只支持文本消息
+ }
+ newArr.push(msgList)
+ }
+
+ })
+
}
chatData.value = newArr
@@ -210,8 +243,7 @@ const msgChatFn = function () {
filePath,
(res: any) => {
// 得到图片网址
- let url = 'https://image.jxc4.com/'
- let imgUrl = url + res.key
+ let imgUrl = 'https://image.jxc4.com/' + res.key
sendClick({ msg: imgUrl, type: 2 })
},
(err: AnyObject) => {
@@ -228,75 +260,78 @@ const msgChatFn = function () {
}
}
- /*************************************************
- * 编辑器初始化完成时触发
- */
- function onEditorReady() {
- uni.createSelectorQuery().select('#editor').context((res: any) => {
- editorCtx.value = res.context
- }).exec()
- }
+ // /*************************************************
+ // * 编辑器初始化完成时触发
+ // */
+ // function onEditorReady() {
+ // uni.createSelectorQuery().select('#editor').context((res: any) => {
+ // editorCtx.value = res.context
+ // }).exec()
+ // }
+ let sendMeg = ref('') // sendClick({ msg: str, type: 1 })
/*************************************************
* 编辑器的内容(实时)
*/
- function onInput(params: any) {
- // console.log('params', params)
+ function onInput(params: AnyObject) {
+ console.log('params,', JSON.stringify(params,undefined,4))
+ console.log('params,', params.detail.value)
+ sendMeg.value = params.detail.value
}
- /*************************************************
- * 失去焦点
- */
- function onBlur(e: any) {
- console.log('失去焦点', e.detail.delta.ops)
- // isShowEmoji.value = false
+ // /*************************************************
+ // * 失去焦点
+ // */
+ // function onBlur(e: any) {
+ // console.log('失去焦点', e.detail.delta.ops)
+ // // isShowEmoji.value = false
- }
+ // }
- /**
- * 编辑器聚焦时
- */
- function onFocus(e: any) {
- console.log('查看编辑器是否聚焦', e)
- isShowEmoji.value = false
- }
+ // /**
+ // * 编辑器聚焦时
+ // */
+ // function onFocus(e: any) {
+ // console.log('查看编辑器是否聚焦', e)
+ // isShowEmoji.value = false
+ // }
- /*************************************************
- * 打开emoji
- */
- function openEmoji() {
- // uni.hideKeyboard()
- readOnly.value = true
- isShowEmoji.value = true
- // hideKeyBoard()
- }
- function closeEmoji() {
- isShowEmoji.value = false
- closeReadOnly()
- }
+ // /*************************************************
+ // * 打开emoji
+ // */
+ // function openEmoji() {
+ // // uni.hideKeyboard()
+ // readOnly.value = true
+ // isShowEmoji.value = true
+ // // hideKeyBoard()
+ // }
+ // function closeEmoji() {
+ // isShowEmoji.value = false
+ // closeReadOnly()
+ // }
- /*************************************************
- * 选择emoji
- */
- function selectEmoji(emoji: AnyObject) {
- // readOnly.value = true
- editorCtx.value.insertImage({
- src: `https://www.jxc4.com/emoji/${emoji.symbol}.png`,
- alt: emoji.text,
- width: '20px',
- height: '20px',
- nowrap: true
- })
+ // /*************************************************
+ // * 选择emoji
+ // */
+ // function selectEmoji(emoji: AnyObject) {
+ // // readOnly.value = true
+ // editorCtx.value.insertImage({
+ // src: `https://www.jxc4.com/emoji/${emoji.symbol}.png`,
+ // alt: emoji.text,
+ // width: '20px',
+ // height: '20px',
+ // nowrap: true
+ // })
- // let timer = setTimeout(() => {
- // readOnly.value = false
- // clearTimeout(timer)
- // }, 1000);
- const timer = setTimeout(() => {
- closeReadOnly()
- clearTimeout(timer)
- }, 2000)
- }
+ // // let timer = setTimeout(() => {
+ // // readOnly.value = false
+ // // clearTimeout(timer)
+ // // }, 1000);
+ // const timer = setTimeout(() => {
+ // closeReadOnly()
+ // clearTimeout(timer)
+ // }, 2000)
+ // }
// uni.onKeyboardHeightChange(res => {
// console.log(res, '监听键盘高度的变化', res.height)
@@ -321,29 +356,32 @@ const msgChatFn = function () {
* 发送消息
*/
function sendMessage() {
- editorCtx.value.getContents({
- complete(res: any) {
+ sendClick({ msg: sendMeg.value, type: 1 })
- if (res.errMsg === 'getContents:ok') {
- let str = ''
- res.delta.ops.forEach((item: any) => {
- let type = typeof item.insert
- if (type === 'string') {
- str = str + item.insert
- } else {
- str = str + item.attributes.alt
- }
- })
- str = str.replace(/\n/g, '') // 除去回车符
- if (str.length > 0) {
- // console.log('str', str)
- sendClick({ msg: str, type: 1 })
- editorCtx.value.clear()
- closeReadOnly()
- }
- }
- }
- })
+ // editorCtx.value.getContents({
+ // complete(res: any) {
+ // console.log('发送消息',res)
+ // if (res.errMsg === 'getContents:ok' || res.errMsg === 'ok') {
+ // let str = ''
+ // // res.delta.ops.forEach((item: any) => {
+ // // let type = typeof item.insert
+ // // if (type === 'string') {
+ // // str = str + item.insert
+ // // } else {
+ // // str = str + item.attributes.alt
+ // // }
+ // // })
+ // str = res.text
+ // str = str.replace(/\n/g, '') // 除去回车符
+ // if (str.length > 0) {
+ // // console.log('str', str)
+ // sendClick({ msg: str, type: 1 })
+ // editorCtx.value.clear()
+ // closeReadOnly()
+ // }
+ // }
+ // }
+ // })
// sendClick({ msg: initValue.value, type: 1 })
// initValue.value = ''
@@ -355,11 +393,11 @@ const msgChatFn = function () {
* 发送数据
*/
async function sendClick(msgData: AnyObject) {
- let venderIDInfo = useData.vendorID === 1 ? store.state.storeInfo.vendorStoreIDS : ebStore.vendorOrgCode
+ let venderIDInfo = useData.vendorID === 1 ? store.state.storeInfo.vendorStoreIDS : useData.vendorID === 3 ? ebStore.vendorOrgCode : jdStore.vendorOrgCode
let data = {
- sendType: useData.vendorID === 1 ? "mt" : "elm",
- app_id: useData.vendorID === 1 ? venderIDInfo.appID : ebStore.vendorOrgCode,
- app_poi_code: useData.vendorID === 1 ? venderIDInfo.MT : ebStore.vendorStoreID,
+ sendType: useData.vendorID === 1 ? "mt" : useData.vendorID === 3 ? "elm" : 'jd',
+ app_id: useData.vendorID === 1 ? venderIDInfo.appID : useData.vendorID === 3 ? ebStore.vendorOrgCode : jdStore.vendorOrgCode,
+ app_poi_code: useData.vendorID === 1 ? venderIDInfo.MT : useData.vendorID === 3 ? ebStore.vendorStoreID : jdStore.vendorStoreID,
cts: Math.round(new Date().getTime() / 1000).toString(),
msg_content: msgData.type === 1 ? analyEmoji(msgData.msg) : msgData.msg,
msg_id: Math.round(new Date().getTime()).toString(),
@@ -396,7 +434,7 @@ const msgChatFn = function () {
}
})
}
- } else {
+ } else if(useData.vendorID === 3){
let chatDataItem = chatData.value.filter(item => item.msg_source === 2)
sendMsg = {
platformShopId: chatDataItem[0].platformShopId,
@@ -426,8 +464,47 @@ const msgChatFn = function () {
data: { ...sendMsg }
})
}
+ }else if(useData.vendorID === 0){
+ sendMsg = {
+ vendorOrgCode: jdStore.vendorOrgCode,
+ sendData:JSON.stringify({
+ vendorID: 0,
+ storeId:jdStore.storeID,
+ data:{
+ id: '' + Math.round(new Date().getTime()).toString() + 184572 , // uuid //随机生成一个字符串
+ lang: "zh_CN",
+ type: "chat_message",
+ from: {
+ pin:chatData.value[0].to.pin,
+ app:'im.waiter', // 固定不变
+ clientType:'android'
+ },
+ to: {
+ pin:chatData.value[0].from.pin,
+ app:'im.customer', // 固定不变
+ },
+ body: {
+ type:msgData.type === 1 ? "text" : "image", // 消息类型
+ content:msgData.msg,
+ chatinfo:{
+ venderId:chatData.value[0].body.chatinfo.venderId,
+ askAllocateType:chatData.value[0].body.chatinfo.askAllocateType,
+ sid:chatData.value[0].body.chatinfo.sid,
+ source:chatData.value[0].body.chatinfo.source
+ },
+ template:{
+ source:'dd_msg_583984a984834b1889f853be6e449f39_e66c448b9fbe4704901925d3217081a3' // 文本固定不变 //卡片类消息必传
+ },
+ mt:60,
+ },
+ timestamp:new Date().getTime(), // 时间戳
+ clientTime:new Date().getTime() // 客户端时间
+ }
+ })
+ }
}
-
+ console.log('发送的消息体,传递的参数',sendMsg)
+ // return
let res = await message.send_to_vendor(sendMsg)
if (res.code == 0) {
} else {
@@ -439,10 +516,30 @@ const msgChatFn = function () {
}
})
}
-
+ sendMeg.value = ''
SetMsgRead()
}
+ /**
+ * 生成随机字符串
+ */
+ const generateRandomString = (length:number) => {
+ // // 方法二
+ // const { v4: uuidv4 } = require('uuid');
+ // return uuidv4().slice(0, length);
+
+ // return
+ // 方法一
+ var result = '';
+ var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
+ for (var i = 0; i < length; i++) {
+ var randomIndex = Math.floor(Math.random() * characters.length);
+ result += characters.charAt(randomIndex);
+ }
+ return result;
+ }
+
+
// ******************** 监听IM新信息 *****************************
//#region
watch(() => store.state.storeInfo.imMessage, (val) => {
@@ -457,12 +554,12 @@ const msgChatFn = function () {
})
//#endregion
- /*************************************************
- * 关闭editor的只读属性
- */
- function closeReadOnly() {
- readOnly.value = false
- }
+ // /*************************************************
+ // * 关闭editor的只读属性
+ // */
+ // function closeReadOnly() {
+ // readOnly.value = false
+ // }
/**
* 收尾 工作
@@ -476,18 +573,19 @@ const msgChatFn = function () {
scrollToView, // 滚动到底部
chatData, // 聊天信息
isItem, // 聊天界面的数据是否请求完毕
- isShowEmoji, // emoji是否发生偏移
- onEditorReady, // 编辑器初始化
+ // isShowEmoji, // emoji是否发生偏移
+ // onEditorReady, // 编辑器初始化
onInput, // 编辑器的内容(实时)
- onBlur, // 编辑器失去焦点
- onFocus, // 编辑器聚焦时
+ // onBlur, // 编辑器失去焦点
+ // onFocus, // 编辑器聚焦时
selectImg, // 选择图片
- openEmoji, // 打开emoji
- closeEmoji, // 关闭emoji
- selectEmoji, // 选择emoji
+ // openEmoji, // 打开emoji
+ // closeEmoji, // 关闭emoji
+ // selectEmoji, // 选择emoji
sendMessage, // 发送消息
readOnly, // 是否为只读
- closeReadOnly // 关闭editor的只读属性
+ // closeReadOnly, // 关闭editor的只读属性
+ appTheme // 主题
}
}
diff --git a/src/subPages/messageChild/msgChat/msgChat.vue b/src/subPages/messageChild/msgChat/msgChat.vue
index bdb72f7..2b6ef25 100644
--- a/src/subPages/messageChild/msgChat/msgChat.vue
+++ b/src/subPages/messageChild/msgChat/msgChat.vue
@@ -1,9 +1,9 @@
@@ -25,9 +25,9 @@
-
-
-
+
+
+
-
+
@@ -50,13 +51,11 @@
-
+
@@ -68,18 +67,19 @@ const {
scrollToView, // 滚动到底部
chatData, // 聊天信息
isItem, // 聊天界面的数据是否请求完毕
- isShowEmoji, // emoji是否发生偏移
- onEditorReady, // 编辑器初始化
+ // isShowEmoji, // emoji是否发生偏移
+ // onEditorReady, // 编辑器初始化
onInput, // 编辑器的内容(实时)
- onBlur, // 编辑器失去焦点
- onFocus, // 编辑器聚焦时
+ // onBlur, // 编辑器失去焦点
+ // onFocus, // 编辑器聚焦时
selectImg, // 选择图片
- openEmoji, // 打开emoji
- closeEmoji, // 关闭emoji
- selectEmoji, // 选择emoji,
+ // openEmoji, // 打开emoji
+ // closeEmoji, // 关闭emoji
+ // selectEmoji, // 选择emoji,
sendMessage, // 发送消息
readOnly, // 是否为只读
- closeReadOnly // 关闭editor的只读属性
+ // closeReadOnly, // 关闭editor的只读属性
+ appTheme // 主题
} = msgChatFn()
@@ -96,10 +96,42 @@ const {
display:flex;
align-items: center;
}
+
+@media (prefers-color-scheme: light) {
+ .chatPage,
+ .chat-input-root>input{
+ background-color:#fff;
+ }
+
+ .chat-input-bar{
+ background-color: #f8f8f8;
+ }
+
+ .chat-input-root>input{
+ color:#000;
+ }
+}
+
+@media (prefers-color-scheme: dark) {
+ .chatPage,
+ .chat-input-root>input{
+ background-color:#222;
+ }
+
+ .chat-input-bar{
+ background-color: #000;
+ }
+
+ .chat-input-root>input{
+ color: #fff;
+ }
+}
\ No newline at end of file
diff --git a/src/subPages/messageChild/msgChat/msgChatChild/chat-item.vue b/src/subPages/messageChild/msgChat/msgChatChild/chat-item.vue
index b328e0c..015a536 100644
--- a/src/subPages/messageChild/msgChat/msgChatChild/chat-item.vue
+++ b/src/subPages/messageChild/msgChat/msgChatChild/chat-item.vue
@@ -23,7 +23,7 @@
>
{{
item.msg_source == 2
- ? (item.order_id ? item.sendType.toUpperCase() + '客户(' + item.order_id + ')':item.sendType.toUpperCase() + '客户')
+ ? (item.order_id ? item.sendType.toUpperCase() + '客户(' + item.order_id + ')': item.sendType.toUpperCase() + '客户')
: getStorage('storeName')
}}
@@ -33,12 +33,12 @@
:style="{
'display':'flex',
'justify-content':item.msg_source === 1?'flex-end':'flex-start',
- 'margin-right':item.msg_source === 1?'20rpx':'0rpx'
- }" >
-
+ 'margin-right':item.msg_source === 1?'20rpx':'0rpx'}" >
-
+
skuid:{{ item.msg_content }} 查看商品
{{ JSON.parse(item.msg_content).food_desc }}
@@ -113,7 +115,7 @@
- 【未知信息】
+ 【未知信息】
@@ -121,7 +123,7 @@
-