diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..46301c4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.vscode/settings.json diff --git a/java-mall-app-shop-admin/.env.dev b/java-mall-app-shop-admin/.env.dev index 717fd2e..f6b9165 100644 --- a/java-mall-app-shop-admin/.env.dev +++ b/java-mall-app-shop-admin/.env.dev @@ -1,2 +1,2 @@ VUE_APP_BASE_API = '/mobile' -VUE_APP_BACK_ADMIN_API = '/api/admin' \ No newline at end of file +VUE_APP_BACK_ADMIN_API = '/api/admin' diff --git a/java-mall-app-shop-admin/.gitignore b/java-mall-app-shop-admin/.gitignore index cf54c73..9c4c159 100644 --- a/java-mall-app-shop-admin/.gitignore +++ b/java-mall-app-shop-admin/.gitignore @@ -14,6 +14,7 @@ yarn-debug.log* yarn-error.log* pnpm-debug.log* + # Editor directories and files .idea *.suo @@ -46,4 +47,5 @@ public/video src/vab/styles/themes/red.scss /src/vab/styles/themes/red-black.scss /src/vab/styles/themes/red-white.scss -unpackage/ \ No newline at end of file +unpackage/ +/.vscode/settings.json \ No newline at end of file diff --git a/java-mall-app-shop-admin/App.vue b/java-mall-app-shop-admin/App.vue index f30521d..9483819 100644 --- a/java-mall-app-shop-admin/App.vue +++ b/java-mall-app-shop-admin/App.vue @@ -2,7 +2,7 @@ // #ifdef APP-PLUS import APPUpdate, { getCurrentNo } from "@/config/appUpdate"; // #endif - +import { mapState, mapActions } from "vuex"; export default { data() { return { @@ -10,17 +10,34 @@ export default { }; }, onLaunch: function () { + uni.setStorageSync("isImSound", true); // #ifdef APP-PLUS getCurrentNo((res) => { this.version = res.version; }); this.onAPPUpdate(); // #endif + setTimeout(() => { + uni.hideTabBar(); + }, 500); + }, + computed: { + ...mapState("user", ["uid", "userInfo", "socket"]), + }, + onShow: function () { + setTimeout(() => { + uni.hideTabBar(); + }, 500); + setTimeout(() => { + if (this.userInfo && Object.keys(this.userInfo).length > 0) { + this.connectSocket(this.userInfo); + } + }); }, - onShow: function () {}, onHide: function () {}, onBackPress: function () {}, methods: { + ...mapActions("user", ["connectSocket"]), onAPPUpdate() { APPUpdate(this.version); }, diff --git a/java-mall-app-shop-admin/api/appUpdate.js b/java-mall-app-shop-admin/api/appUpdate.js new file mode 100644 index 0000000..7cc6385 --- /dev/null +++ b/java-mall-app-shop-admin/api/appUpdate.js @@ -0,0 +1,25 @@ +import http from '../utils/http'; +import config from '../config/config'; + +/** + * 获取商店基础信息 + * @author Seven + * @data 2025-3-27 + * @returns { } + * @see https://mall.gpxscs.cn/mobile/admin/app-market-update/check/version + */ + +export function GetAPPversions(params) { + return new Promise((resolve, reject) => { + http({ + url: '/admin/app-market-update/check/version', + method: 'post', + data: params, + baseURL: config.baseApi, + }) + .then((res) => { + resolve(res); + }) + .catch((e) => reject(console.warn(e))); + }); +} diff --git a/java-mall-app-shop-admin/api/audit.js b/java-mall-app-shop-admin/api/audit.js index 0138b85..2b3d71d 100644 --- a/java-mall-app-shop-admin/api/audit.js +++ b/java-mall-app-shop-admin/api/audit.js @@ -121,7 +121,7 @@ export function GetAuditInfo(params) { data: params, }) .then((res) => { - if (res && res.status == 200) { + if (res && res.data && res.status == 200) { uni.setStorageSync('approvalStatus', res.data.approval_status); } resolve(res); @@ -240,7 +240,6 @@ export function GetBizCategoryList(params) { }); } - /** * 搜索银行(支行)分页列表 * @author Seven diff --git a/java-mall-app-shop-admin/api/im.js b/java-mall-app-shop-admin/api/im.js index af8d43d..5bb6631 100644 --- a/java-mall-app-shop-admin/api/im.js +++ b/java-mall-app-shop-admin/api/im.js @@ -1,5 +1,5 @@ -import http from '../utils/http'; -import config from '../config/config'; +import http from "../utils/http"; +import config from "../config/config"; /** * 获取聊天配置 @@ -12,8 +12,8 @@ import config from '../config/config'; export function GetImConfig(params) { return http({ - url: '/sns/im/getImConfig', - method: 'get', + url: "/sns/im/getImConfig", + method: "get", params, baseURL: config.baseApi, }); @@ -30,8 +30,8 @@ export function GetImConfig(params) { export function GetImMsgList(params) { return http({ - url: 'https://mall.gpxscs.cn/api/mobile/sns/userMessage/listChatMsg', - method: 'get', + url: "https://mall.gpxscs.cn/api/mobile/sns/userMessage/listChatMsg", + method: "get", params, baseURL: config.apiMobile, }); @@ -48,9 +48,27 @@ export function GetImMsgList(params) { export function GetSendMsgAdd(params) { return http({ - url: 'https://mall.gpxscs.cn/api/mobile/sns/userMessage/add', - method: 'get', + url: "https://mall.gpxscs.cn/api/mobile/sns/userMessage/add", + method: "get", params, baseURL: config.apiMobile, }); } + +/** + * 设置消息已读 + * @author Seven + * @data 2025-1-27 + * @param {message_id} + * @returns { } + * @see https://mall.gpxscs.cn/mobile/sns/userMessage/setRead + */ + +export function SetMsgRead(params) { + return http({ + url: "https://mall.gpxscs.cn/mobile/sns/userMessage/setRead", + method: "post", + data: params, + baseURL: config.baseApi, + }); +} diff --git a/java-mall-app-shop-admin/api/user.js b/java-mall-app-shop-admin/api/user.js index 7fc984b..4bdc791 100644 --- a/java-mall-app-shop-admin/api/user.js +++ b/java-mall-app-shop-admin/api/user.js @@ -27,7 +27,8 @@ export function GetAccountDashboard() { export function OutLogin() { return http({ - url: 'https://mall.gpxscs.cn/api/mobile/account/login/doLogout', + url: '/account/login/doLogout', method: 'get', + baseURL: config.apiMobile, }); } diff --git a/java-mall-app-shop-admin/components/t-chat-bar/t-chat-bar.vue b/java-mall-app-shop-admin/components/t-chat-bar/t-chat-bar.vue index 9f5c254..7b8273a 100644 --- a/java-mall-app-shop-admin/components/t-chat-bar/t-chat-bar.vue +++ b/java-mall-app-shop-admin/components/t-chat-bar/t-chat-bar.vue @@ -1,15 +1,17 @@ @@ -157,6 +217,7 @@ // import emoji from "@/utils/emoji.js"; import emoji from "../../static/im/emojiData.js"; import uParse from "../../uni_modules/uview-ui/components/u-parse/u-parse.vue"; +const recorderManager = uni.getRecorderManager(); export default { components: { uParse }, name: "tChatBar", @@ -226,8 +287,26 @@ export default { isEmoji: false, editorContent: "", isIos: false, + showVoiceMask: false, + voicePopupTouches: {}, + voicelength: 0, + needCancel: false, + startX: 0, + startY: 0, + timer: 0, + maskBottomRect: null, + isRecording: false, + isOutside: false, + tempFilePath: null, + startTime: 0, }; }, + computed: { + // 计算语音条宽度 + getVoiceBarWidth() { + return 230 + this.voicelength * 4 + "rpx"; + }, + }, watch: { isHideKeyBoard: { handler(newVal, oldVal) { @@ -332,6 +411,122 @@ export default { uploadVideo() { this.$emit("uploadVideo"); }, + async getMaskBottomRect() { + return new Promise((resolve) => { + const query = uni.createSelectorQuery().in(this); + query + .select(".mask-bottom") + .boundingClientRect((data) => { + this.maskBottomRect = data; + console.log("元素位置信息:", data); // 调试用 + resolve(data); + }) + .exec(); + }); + }, + + async handleTouchStart(e) { + console.log("handleTouchStart", e); + this.$emit("showVoicePopup"); + this.showVoiceMask = true; + + // 等待 DOM 更新 + await this.$nextTick(); + + if (!this.maskBottomRect) { + await this.getMaskBottomRect(); + } + + recorderManager.start({ + format: "mp3", + }); + + this.voicelength = 1; + this.startX = e.touches[0].pageX; + this.startY = e.touches[0].pageY; + this.timer = setInterval(() => { + this.voicelength += 1; + if (this.voicelength >= 60) { + clearInterval(this.timer); + this.handleTouchEnd(); + } + }, 1000); + this.isRecording = true; + this.isOutside = false; + }, + + handleTouchMove(e) { + // 检查是否在mask-bottom区域外 + if (!this.maskBottomRect) return; + + const touchX = e.touches[0].pageX; + const touchY = e.touches[0].pageY; + + // 检查是否在mask-bottom区域外 + // 更精确的边界检查 + const SAFE_MARGIN = 5; // 像素单位 + const isNowOutside = + touchX < this.maskBottomRect.left - SAFE_MARGIN || + touchX > + this.maskBottomRect.left + this.maskBottomRect.width + SAFE_MARGIN || + touchY < this.maskBottomRect.top - SAFE_MARGIN || + touchY > + this.maskBottomRect.top + this.maskBottomRect.height + SAFE_MARGIN; + + // 调试输出 + console.log( + `触摸点: (${touchX}, ${touchY})`, + `元素区域: [${this.maskBottomRect.left}, ${this.maskBottomRect.top}, ${this.maskBottomRect.width}, ${this.maskBottomRect.height}]`, + `是否在外: ${isNowOutside}` + ); + + // 如果状态发生变化(进入或离开区域) + if (isNowOutside !== this.isOutside) { + this.isOutside = isNowOutside; + + if (this.isOutside) { + // 离开区域,暂停录制 + recorderManager.pause(); + console.log("已离开区域,暂停录制"); + this.needCancel = true; + } else { + // 回到区域,继续录制 + recorderManager.resume(); + console.log("已回到区域,继续录制"); + this.needCancel = false; + } + } + }, + + async handleTouchEnd(e) { + clearInterval(this.timer); + recorderManager.stop(); + + console.log("松开"); + + if (!this.needCancel) { + recorderManager.onStop((res) => { + const message = { + voice: res.tempFilePath, + length: this.voicelength, + }; + console.log("recorderManager", res); + this.inputSubmit(message, 2); + }); + } else { + this.inputSubmit(); + } + this.showVoiceMask = false; + this.needCancel = false; + }, + + inputSubmit(msg = {}, types = "") { + if (msg && types) { + this.$emit("voiceEnd", msg); + } else { + this.$emit("voiceEnd"); + } + }, }, }; @@ -416,7 +611,7 @@ export default { display: flex; flex-direction: column; box-sizing: border-box; - z-index: 999; + z-index: 1; .tui-chat-tabbar { width: 100%; @@ -619,7 +814,6 @@ export default { position: fixed; left: 0; top: 0; - z-index: 990; background-color: $uni-bg-color-mask; visibility: hidden; transition: all 0.3s ease; @@ -649,4 +843,158 @@ export default { } } } + +.voice-mask { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + background-color: rgba(0, 0, 0, 0.8); + z-index: 200; /* 确保足够高 */ + display: flex; + justify-content: center; + align-items: center; +} +.voice-bar { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -30%); + height: 150rpx; + background-color: #51ff50; + border-radius: 26rpx; + margin-bottom: 220rpx; + z-index: 200; +} +.voiceDel { + left: 80rpx; + top: 50%; + width: 170rpx !important; + transform: translateX(0%); + transform: translateY(-30%); + background-color: red; +} +.voice-volume { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 160rpx; + height: 36rpx; +} +.volumeDel { + width: 80rpx; +} +.trangle-bottom { + position: absolute; + bottom: -38rpx; + left: 50%; + transform: translateX(-50%); + border-width: 20rpx; + border-style: solid; + border-color: #51ff50 transparent transparent transparent; + z-index: 9999; +} +.trangleDel { + border-color: red transparent transparent transparent; +} +.voice-send { + position: relative; + bottom: 0; + width: 100%; + height: 100%; + z-index: 9999; +} +.voice-middle-wrapper { + width: 100%; + display: flex; + position: absolute; + justify-content: space-between; + align-items: flex-end; + margin-bottom: 40rpx; + bottom: 15%; +} +.voice-left-wrapper { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-end; +} +.cancel-del { + display: none; +} +.delTip { + display: block; + color: #bfbfbf; + margin: 0 22rpx 18rpx 0; +} +.voice-middle-inner { + display: flex; + justify-content: center; + align-items: center; + background-color: #595959; + width: 140rpx; + height: 140rpx; + border-radius: 50%; +} +.close { + transform: rotate(350deg); + margin-left: 80rpx; +} +.bigger { + width: 170rpx; + height: 170rpx; + background: #ececec; +} +.to-text { + transform: rotate(10deg); + margin-right: 80rpx; +} +.close-icon { + width: 80rpx; + height: 80rpx; + color: #fff; +} +.wen { + font-size: 40rpx; + color: #bfbfbf; +} +.send-tip { + position: absolute; + left: 50%; + bottom: 0rpx; + transform: translate(-50%, 36%); + color: #bfbfbf; +} +.sendTipNone { + display: none; +} +.mask-bottom { + position: absolute; + left: 0; + right: 0; + bottom: 0; + width: 100%; + height: 180rpx; + border-top: #bababb 8rpx solid; + border-radius: 50% 50% 0 0; + background-image: linear-gradient(#949794, #e1e3e1); + z-index: 9999; +} +.mask-bottom image { + position: absolute; + width: 60rpx; + height: 60rpx; + top: 0; + right: 0; + bottom: 0; + left: 0; + margin: auto; +} + +.no-area { + border-color: #595959; + background-image: linear-gradient(#595959, #595959); +} diff --git a/java-mall-app-shop-admin/components/tabbar/tabbar.vue b/java-mall-app-shop-admin/components/tabbar/tabbar.vue new file mode 100644 index 0000000..af3b1c9 --- /dev/null +++ b/java-mall-app-shop-admin/components/tabbar/tabbar.vue @@ -0,0 +1,192 @@ + + + diff --git a/java-mall-app-shop-admin/config/componentConfig.js b/java-mall-app-shop-admin/config/componentConfig.js index f0dde0c..4380af0 100644 --- a/java-mall-app-shop-admin/config/componentConfig.js +++ b/java-mall-app-shop-admin/config/componentConfig.js @@ -1,21 +1,21 @@ /**** 此文件说明请看注释 *****/ // 可以用自己项目的请求方法 // 请求配置说明:https://ext.dcloud.net.cn/plugin?id=822 -import { GetAPPversion } from '../api/checkAPPupdate'; +import { GetAPPversion } from "../api/checkAPPupdate"; /**** 结束 *****/ const platform = uni.getSystemInfoSync().platform; const phoneInfo = uni.getSystemInfoSync(); export default { // 发起ajax请求获取服务端版本号 getServerNo: async (version, isPrompt = false, callback) => { - if (platform != 'android') { + if (platform != "android") { let appleId = 1549638327; //app的appleId plus.runtime.launchApplication( { action: `itms-apps://itunes.apple.com/cn/app/id${appleId}?mt=8`, }, function (e) { - console.log('Open system default browser failed: ' + e.message); + console.log("Open system default browser failed: " + e.message); } ); @@ -47,22 +47,22 @@ export default { phoneInfo.brand = phoneInfo.brand.toLowerCase(); switch (phoneInfo.brand) { - case 'xiaomi': + case "xiaomi": marketId = 1; break; - case 'huawei': + case "huawei": marketId = 2; break; - case 'tengxun': + case "tengxun": marketId = 3; break; - case 'oppo': + case "oppo": marketId = 4; break; - case 'vivo': + case "vivo": marketId = 5; break; - case 'samsung': + case "samsung": marketId = 6; break; default: @@ -70,12 +70,12 @@ export default { break; } - console.log('marketId', marketId); - console.log('phoneInfo.brand', phoneInfo.brand); + console.log("marketId", marketId); + console.log("phoneInfo.brand", phoneInfo.brand); let params = { - marketId: marketId, - packageName: 'com.xiaofa.shopAdmin', + marketId: 100, + packageName: "com.xiaofa.shopAdmin", currVersionKey: version, }; @@ -83,9 +83,9 @@ export default { if (res && res.status == 200) { if (res.data) { - res.data.updateType = 'solicit'; + res.data.updateType = "solicit"; if (res.data.is_force_update == 1) { - res.data.updateType = 'forcibly'; + res.data.updateType = "forcibly"; callback && callback(res.data); } else { callback && callback(res.data); @@ -128,7 +128,7 @@ export default { /****************以上是示例*******************/ }, // 弹窗主颜色(不填默认粉色) - appUpdateColor: 'f00', + appUpdateColor: "f00", // 弹窗图标(不填显示默认图标,链接配置示例如: '/static/demo/ic_attention.png') - appUpdateIcon: '/static/ic_ar.png', + appUpdateIcon: "/static/ic_ar.png", }; diff --git a/java-mall-app-shop-admin/manifest.json b/java-mall-app-shop-admin/manifest.json index 6a8a607..43e1599 100644 --- a/java-mall-app-shop-admin/manifest.json +++ b/java-mall-app-shop-admin/manifest.json @@ -1,151 +1,150 @@ { - "name" : "小发同城商家版", - "appid" : "__UNI__95F809F", - "package" : "com.xiaofa.shopAdmin", - "description" : "", - "versionName" : "1.0.0", - "versionCode" : 100, - "transformPx" : false, - /* 5+App特有相关 */ - "app-plus" : { - "usingComponents" : true, - "nvueStyleCompiler" : "uni-app", - "compilerVersion" : 3, - "splashscreen" : { - "alwaysShowBeforeRender" : true, - "waiting" : true, - "autoclose" : true, - "delay" : 0 + "name": "小发同城商家版", + "appid": "__UNI__95F809F", + "package": "com.xiaofa.shopAdmin", + "description": "", + "versionName": "1.0.0", + "versionCode": 100, + "transformPx": false, + /* 5+App特有相关 */ + "app-plus": { + "usingComponents": true, + "nvueStyleCompiler": "uni-app", + "compilerVersion": 3, + "splashscreen": { + "alwaysShowBeforeRender": true, + "waiting": true, + "autoclose": true, + "delay": 0 + }, + /* 模块配置 */ + "modules": { + "Maps": {}, + "Camera": {}, + "Record": {}, + "VideoPlayer": {}, + "UIWebview": {} + }, + /* 应用发布信息 */ + "distribute": { + /* android打包配置 */ + "android": { + "permissions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + /* ios打包配置 */ + "ios": { + "privacyDescription": { + "NSPhotoLibraryAddUsageDescription": "此App会在上传头像图片服务中访问您的相机权限", + "NSPhotoLibraryUsageDescription": "此App会在上传头像图片服务中访问您的相机权限", + "NSCameraUsageDescription": "此App会在上传头像图片服务中访问您的相机权限", + "NSMicrophoneUsageDescription": "此APP会在使用声音识别服务中使用您的麦克风权限", + "NSLocationWhenInUseUsageDescription": "此App会在使用导航服务中使用您的定位权限", + "NSLocationAlwaysUsageDescription": "此App会在使用导航服务中使用您的定位权限", + "NSLocationAlwaysAndWhenInUseUsageDescription": "此App会在使用导航服务中使用您的定位权限" }, - /* 模块配置 */ - "modules" : { - "Maps" : {}, - "Camera" : {}, - "Record" : {}, - "VideoPlayer" : {}, - "UIWebview" : {} + "dSYMs": false + }, + /* SDK配置 */ + "sdkConfigs": { + "maps": {} + }, + "icons": { + "android": { + "hdpi": "unpackage/res/icons/72x72.png", + "xhdpi": "unpackage/res/icons/96x96.png", + "xxhdpi": "unpackage/res/icons/144x144.png", + "xxxhdpi": "unpackage/res/icons/192x192.png" }, - /* 应用发布信息 */ - "distribute" : { - /* android打包配置 */ - "android" : { - "permissions" : [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ] - }, - /* ios打包配置 */ - "ios" : { - "privacyDescription" : { - "NSPhotoLibraryAddUsageDescription" : "此App会在上传头像图片服务中访问您的相机权限", - "NSPhotoLibraryUsageDescription" : "此App会在上传头像图片服务中访问您的相机权限", - "NSCameraUsageDescription" : "此App会在上传头像图片服务中访问您的相机权限", - "NSMicrophoneUsageDescription" : "此APP会在使用声音识别服务中使用您的麦克风权限", - "NSLocationWhenInUseUsageDescription" : "此App会在使用导航服务中使用您的定位权限", - "NSLocationAlwaysUsageDescription" : "此App会在使用导航服务中使用您的定位权限", - "NSLocationAlwaysAndWhenInUseUsageDescription" : "此App会在使用导航服务中使用您的定位权限" - }, - "dSYMs" : false - }, - /* SDK配置 */ - "sdkConfigs" : { - "maps" : {} - }, - "icons" : { - "android" : { - "hdpi" : "unpackage/res/icons/72x72.png", - "xhdpi" : "unpackage/res/icons/96x96.png", - "xxhdpi" : "unpackage/res/icons/144x144.png", - "xxxhdpi" : "unpackage/res/icons/192x192.png" - }, - "ios" : { - "appstore" : "unpackage/res/icons/1024x1024.png", - "ipad" : { - "app" : "unpackage/res/icons/76x76.png", - "app@2x" : "unpackage/res/icons/152x152.png", - "notification" : "unpackage/res/icons/20x20.png", - "notification@2x" : "unpackage/res/icons/40x40.png", - "proapp@2x" : "unpackage/res/icons/167x167.png", - "settings" : "unpackage/res/icons/29x29.png", - "settings@2x" : "unpackage/res/icons/58x58.png", - "spotlight" : "unpackage/res/icons/40x40.png", - "spotlight@2x" : "unpackage/res/icons/80x80.png" - }, - "iphone" : { - "app@2x" : "unpackage/res/icons/120x120.png", - "app@3x" : "unpackage/res/icons/180x180.png", - "notification@2x" : "unpackage/res/icons/40x40.png", - "notification@3x" : "unpackage/res/icons/60x60.png", - "settings@2x" : "unpackage/res/icons/58x58.png", - "settings@3x" : "unpackage/res/icons/87x87.png", - "spotlight@2x" : "unpackage/res/icons/80x80.png", - "spotlight@3x" : "unpackage/res/icons/120x120.png" - } - } - } + "ios": { + "appstore": "unpackage/res/icons/1024x1024.png", + "ipad": { + "app": "unpackage/res/icons/76x76.png", + "app@2x": "unpackage/res/icons/152x152.png", + "notification": "unpackage/res/icons/20x20.png", + "notification@2x": "unpackage/res/icons/40x40.png", + "proapp@2x": "unpackage/res/icons/167x167.png", + "settings": "unpackage/res/icons/29x29.png", + "settings@2x": "unpackage/res/icons/58x58.png", + "spotlight": "unpackage/res/icons/40x40.png", + "spotlight@2x": "unpackage/res/icons/80x80.png" + }, + "iphone": { + "app@2x": "unpackage/res/icons/120x120.png", + "app@3x": "unpackage/res/icons/180x180.png", + "notification@2x": "unpackage/res/icons/40x40.png", + "notification@3x": "unpackage/res/icons/60x60.png", + "settings@2x": "unpackage/res/icons/58x58.png", + "settings@3x": "unpackage/res/icons/87x87.png", + "spotlight@2x": "unpackage/res/icons/80x80.png", + "spotlight@3x": "unpackage/res/icons/120x120.png" + } } + } + } + }, + /* 快应用特有相关 */ + "quickapp": {}, + /* 小程序特有相关 */ + "mp-weixin": { + "appid": "", + "setting": { + "urlCheck": false }, - /* 快应用特有相关 */ - "quickapp" : {}, - /* 小程序特有相关 */ - "mp-weixin" : { - "appid" : "", - "setting" : { - "urlCheck" : false - }, - "usingComponents" : true - }, - "h5" : { - // "devServer" : { - // "https" : true, - // "host" : "127.0.0.1", - // "port" : 8080, - // "disableHostCheck" : true, - // "proxy" : { - // "/place/v2/suggestion" : { - // "target" : "https://api.map.baidu.com", - // "changeOrigin" : true, - // "secure" : false - // }, - // "/admin/shop/shop-base-product-category/list" : { - // "target" : "https://mall.gpxscs.cn", - // "changeOrigin" : true - // } - // } - // }, - "title" : "小发商城商家中心", - "template" : "index.html", - "router" : { - "mode" : "history", - "base" : "/mchapp/" - } - }, - "mp-alipay" : { - "usingComponents" : true - }, - "mp-baidu" : { - "usingComponents" : true - }, - "mp-toutiao" : { - "usingComponents" : true - }, - "uniStatistics" : { - "enable" : false - }, - "vueVersion" : "2" + "usingComponents": true + }, + "h5": { + // "devServer" : { + // "https" : true, + // "host" : "127.0.0.1", + // "port" : 8080, + // "disableHostCheck" : true, + // "proxy" : { + // "/place/v2/suggestion" : { + // "target" : "https://api.map.baidu.com", + // "changeOrigin" : true, + // "secure" : false + // }, + // "/admin/shop/shop-base-product-category/list" : { + // "target" : "https://mall.gpxscs.cn", + // "changeOrigin" : true + // } + // } + // }, + "title": "小发商城商家中心", + "template": "index.html", + "router": { + "mode": "history", + "base": "/mchapp/" + } + }, + "mp-alipay": { + "usingComponents": true + }, + "mp-baidu": { + "usingComponents": true + }, + "mp-toutiao": { + "usingComponents": true + }, + "uniStatistics": { + "enable": false + }, + "vueVersion": "2" } /* 5+App特有相关 */ - diff --git a/java-mall-app-shop-admin/pages.json b/java-mall-app-shop-admin/pages.json index 769a758..a89eb4f 100644 --- a/java-mall-app-shop-admin/pages.json +++ b/java-mall-app-shop-admin/pages.json @@ -1,5 +1,6 @@ { - "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages + "pages": [ + //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages { "path": "pages/index/index", "style": { @@ -19,25 +20,25 @@ } }, { - "path":"pages/audit/businessType", - "style":{ - "navigationBarTitleText":"选择经营品类" + "path": "pages/audit/businessType", + "style": { + "navigationBarTitleText": "选择经营品类" } }, { - "path":"pages/audit/shop2", - "style":{ + "path": "pages/audit/shop2", + "style": { "navigationStyle": "custom" } }, { - "path":"pages/audit/shop3", - "style":{ + "path": "pages/audit/shop3", + "style": { "navigationStyle": "custom" } }, { - "path":"pages/audit/checkAudit", + "path": "pages/audit/checkAudit", "style": { "navigationStyle": "custom" } @@ -55,7 +56,6 @@ "style": { "navigationBarTitleText": "注册", "navigationBarTextStyle": "white" - } } }, @@ -69,65 +69,70 @@ "path": "pages/forgetPassword/forgetPassword", "style": { "navigationBarTitleText": "忘记密码" - } }, { - "path": "pages/order/order", - "style": { + "path": "pages/order/order", + "style": { "navigationStyle": "custom" // "onReachBottomDistance": 105, // "enablePullDownRefresh": true } - }, + }, { - "path": "pages/IM/IM", - "style": { + "path": "pages/IM/IM", + "style": { "navigationStyle": "custom" } - }, + }, { - "path": "pages/IM/IMmsgContent", - "style": { + "path": "pages/IM/IMmsgContent", + "style": { "navigationStyle": "custom" } - }, + }, { - "path": "pages/viewCenter/viewCenter", - "style": { + "path": "pages/IM/IMsetting", + "style": { + "navigationBarTitleText": "聊天设置" + } + }, + { + "path": "pages/viewCenter/viewCenter", + "style": { "navigationStyle": "custom" } - }, + }, { - "path": "pages/manage/manage", - "style": { + "path": "pages/manage/manage", + "style": { "navigationStyle": "custom" } - }, + }, { - "path": "pages/my/my", - "style": { + "path": "pages/my/my", + "style": { "navigationStyle": "custom" } - }, + }, { - "path": "pages/my/shopInfo", - "style": { - "navigationBarTitleText": "店铺信息" + "path": "pages/my/shopInfo", + "style": { + "navigationBarTitleText": "店铺信息" } - }, + }, { - "path": "pages/my/setting", - "style": { - "navigationBarTitleText": "设置" + "path": "pages/my/setting", + "style": { + "navigationBarTitleText": "设置" } - }, + }, { - "path": "pages/my/contract", - "style": { - "navigationBarTitleText": "合同" + "path": "pages/my/contract", + "style": { + "navigationBarTitleText": "合同" } - }, + }, { "path": "pages/my/printer/printerList", "style": { @@ -161,53 +166,52 @@ { "path": "pages/my/aboutUs/records", "style": { - "navigationBarTitleText": "网址" + "navigationBarTitleText": "网址" } }, { "path": "pages/my/versions", "style": { - "navigationBarTitleText": "版本号" + "navigationBarTitleText": "版本号" } } - ], - "globalStyle": { - "navigationBarTextStyle": "black", - "navigationBarTitleText": "uni-app", - "navigationBarBackgroundColor": "#FFFFFF", - "backgroundColor": "#FFFFFF", + ], + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "uni-app", + "navigationBarBackgroundColor": "#FFFFFF", + "backgroundColor": "#FFFFFF", "pageOrientation": "portrait", "adjustPosition": true - }, - "tabBar": { - "color": "#000", - "selectedColor": "#4b71ff", - "borderStyle": "black", - "backgroundColor": "#ffffff", + }, + "tabBar": { + "custom": true, + "color": "#000", + "selectedColor": "#4b71ff", + "borderStyle": "black", + "backgroundColor": "#ffffff", "iconfontSrc": "/static/font/iconfont.ttf", - "fontSize":"14px", - "height": "58px", - "spacing":"5px", - "list": [ + "fontSize": "14px", + "list": [ { "pagePath": "pages/order/order", "iconfont": { "text": "\ue607", "selectedText": "\ue607", "selectedColor": "#4b71ff", - "color":"#000", - "fontSize":"20px" + "color": "#000", + "fontSize": "20px" }, "text": "工作台" - }, + }, { "pagePath": "pages/IM/IM", "iconfont": { "text": "\ue66c", "selectedText": "\ue66c", "selectedColor": "#4b71ff", - "color":"#000", - "fontSize":"22px" + "color": "#000", + "fontSize": "22px" }, "text": "消息" }, @@ -217,8 +221,8 @@ "text": "\ue6bc", "selectedText": "\ue6bc", "selectedColor": "#4b71ff", - "color":"#000", - "fontSize":"20px" + "color": "#000", + "fontSize": "20px" }, "text": "视图中心" }, @@ -228,12 +232,11 @@ "text": "\ue64c", "selectedText": "\ue64c", "selectedColor": "#4b71ff", - "color":"#000", - "fontSize":"24px" + "color": "#000", + "fontSize": "24px" }, "text": "我的" } ] - } - + } } diff --git a/java-mall-app-shop-admin/pages/IM/IM.vue b/java-mall-app-shop-admin/pages/IM/IM.vue index b9539f4..fc37351 100644 --- a/java-mall-app-shop-admin/pages/IM/IM.vue +++ b/java-mall-app-shop-admin/pages/IM/IM.vue @@ -4,12 +4,24 @@ {{ msgInfo.mine.user_nickname }} - - arrow-down + + - arrow-down - arrow-down + + @@ -45,8 +57,18 @@ > - + + {{ item.username }} @@ -60,6 +82,7 @@ + @@ -69,10 +92,12 @@ import tuiTabs from "../../components/tui-tabs.vue"; import { GetImConfig } from "../../api/im"; import statusBar from "../../components/status-bar.vue"; import { mapState } from "vuex"; +import tabbar from "@/components/tabbar/tabbar.vue"; export default { components: { tuiTabs, statusBar, + tabbar, }, data() { return { @@ -102,7 +127,49 @@ export default { }, onLoad() {}, computed: { - ...mapState("user", ["uid"]), + ...mapState("user", ["uid", "userInfo", "socket", "imWeidu", "getMsg"]), + }, + watch: { + imWeidu: { + handler(newValue, oldValue) { + if (newValue) { + this.msgList = this.msgList.map((item) => { + if (this.imWeidu.hasOwnProperty(item.id) && item.id !== "userId") { + // 如果存在,则将obj中对应的值合并到当前项 + return { + ...item, // 保留原数组项的所有属性 + ...this.imWeidu[item.id], // 合并obj中对应id的值 + }; + } + return item; + }); + } + }, + deep: true, + }, + getMsg: { + handler(newValue, oldValue) { + if (newValue) { + const exists = this.msgList.some((item) => item.id == newValue.id); + + if (!exists) { + const newItem = { + user_id: newValue.user_id, + friend_id: newValue.friend_id, + username: newValue.username, + avatar: newValue.avatar, + user_nickname: newValue.username, + user_avatar: newValue.avatar, + rid: 2, + id: newValue.id, + weidu: 1, + }; + + this.msgList = [...this.msgList, newItem]; + } + } + }, + }, }, methods: { async getImConfig() { @@ -112,7 +179,20 @@ export default { this.msgInfo = res.data; if (res.data.friend.length > 0) { - this.msgList = res.data.friend[0].list; + let _imWeiDu = uni.getStorageSync("imWeiDu"); + if (_imWeiDu) { + this.msgList = res.data.friend[0].list.map((item) => { + if (_imWeiDu.hasOwnProperty(item.id) && item.id !== "userId") { + return { + ...item, + ..._imWeiDu[item.id], + }; + } + return item; + }); + } else { + this.msgList = res.data.friend[0].list; + } } } }, @@ -120,10 +200,44 @@ export default { this.currentTab = e.index; }, skiupMsg(item) { + this.$store.commit("user/REMOVE_IM_KEY", item.id.toString()); + debugger; uni.navigateTo({ url: `/pages/IM/IMmsgContent?item=${JSON.stringify(item)}`, }); }, + senMsgAdmin() { + let item = { + user_friend_id: 36, + user_id: 10001, + friend_id: 10001, + friend_note: "", + user_friend_addtime: "2025-05-09 10:03:33", + friend_state: 2, + friend_invite: 2, + username: "系统客服", + avatar: + "https://media-mall-prod-1259811287.cos.ap-guangzhou.myqcloud.com/media/media/plantform/20250307/c4cab676e06a49b282c2cbbe481f0fa1.png", + sign: "", + level_name: "v1", + user_nickname: "系统客服", + user_avatar: + "https://media-mall-prod-1259811287.cos.ap-guangzhou.myqcloud.com/media/media/plantform/20250307/c4cab676e06a49b282c2cbbe481f0fa1.png", + user_sign: "", + user_level_name: "v1", + rid: 2, + id: 776395489, + }; + + uni.navigateTo({ + url: `/pages/IM/IMmsgContent?item=${JSON.stringify(item)}`, + }); + }, + skipuIMsetting() { + uni.navigateTo({ + url: "/pages/IM/IMsetting", + }); + }, }, }; @@ -133,6 +247,7 @@ export default { .IM-setting { display: flex; justify-content: space-between; + align-items: center; padding: 32rpx 40rpx; .IM-status { @@ -161,6 +276,7 @@ export default { margin-bottom: 40rpx; .user-img-content { + position: relative; .user-img-block { width: 80rpx; height: 80rpx; @@ -172,6 +288,11 @@ export default { height: 100%; } } + .im-weidu-badge { + position: absolute; + right: -50%; + top: 0; + } } .msg-info-block { @@ -197,5 +318,12 @@ export default { } } } + .u-icon { + flex-direction: column-reverse; + } + + .icon-kefu { + margin-right: 40rpx; + } } - \ No newline at end of file + diff --git a/java-mall-app-shop-admin/pages/IM/IMmsgContent.vue b/java-mall-app-shop-admin/pages/IM/IMmsgContent.vue index 270dbf3..a1cb35d 100644 --- a/java-mall-app-shop-admin/pages/IM/IMmsgContent.vue +++ b/java-mall-app-shop-admin/pages/IM/IMmsgContent.vue @@ -1,8 +1,12 @@ + diff --git a/java-mall-app-shop-admin/pages/IM/voicePopup.vue b/java-mall-app-shop-admin/pages/IM/voicePopup.vue new file mode 100644 index 0000000..6dc729c --- /dev/null +++ b/java-mall-app-shop-admin/pages/IM/voicePopup.vue @@ -0,0 +1,380 @@ + + + + + diff --git a/java-mall-app-shop-admin/pages/audit/checkAudit.vue b/java-mall-app-shop-admin/pages/audit/checkAudit.vue index cf5c6e7..afed228 100644 --- a/java-mall-app-shop-admin/pages/audit/checkAudit.vue +++ b/java-mall-app-shop-admin/pages/audit/checkAudit.vue @@ -31,7 +31,13 @@ 审核中,1-7个工作日内答复,请耐心等待 - 申请时间:{{ auditInfo.created_at }} + + + 暂无申请记录! + + 申请时间:{{ auditInfo.created_at }}