From be0045b4b09a0a21b29d7876d219170aa807d5dc Mon Sep 17 00:00:00 2001 From: THK3121 Date: Mon, 9 Oct 2023 20:22:16 +0800 Subject: [PATCH] =?UTF-8?q?im=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 16 +- config/app.js | 6 +- pages.json | 25 +- pages/business/business.vue | 316 +++++----- pages/business/talkDetil1.nvue | 224 ------- pages/oaHome/oaHome.vue | 74 ++- static/mp3/im.mp3 | Bin 0 -> 7149 bytes static/mp3/im.wav | Bin 0 -> 1258 bytes .../chatMang/index.vue | 560 ++++++++---------- subpkg/property/buyCar.vue | 64 ++ utils/aa.js | 201 ++++--- 11 files changed, 703 insertions(+), 783 deletions(-) delete mode 100644 pages/business/talkDetil1.nvue create mode 100644 static/mp3/im.mp3 create mode 100644 static/mp3/im.wav rename pages/business/talkDetail.vue => subpkg/chatMang/index.vue (51%) create mode 100644 subpkg/property/buyCar.vue diff --git a/App.vue b/App.vue index f67f4da..61c08ab 100644 --- a/App.vue +++ b/App.vue @@ -64,13 +64,23 @@ } }, onShow: function() { - const audioContext = uni.createInnerAudioContext() - // 设置音频文件地址 - audioContext.src = '/static/mp3/order.mp3' + jpushModule.initJPushService() + // const audioContext = uni.createInnerAudioContext() + // // 设置音频文件地址 + // audioContext.src = '/static/mp3/order.mp3' // 播放音频 //#ifdef APP-PLUS jpushModule.addNotificationListener(res => { + const audioContext = uni.createInnerAudioContext() + if(res.content.includes(':')){ + audioContext.src = '/static/mp3/im.wav' + audioContext.play() + uni.vibrateLong(); + console.log("im") + return + } if (res.notificationEventType == 'notificationOpened') return + audioContext.src = '/static/mp3/order.mp3' audioContext.play() uni.vibrateLong(); console.log("app的监听") diff --git a/config/app.js b/config/app.js index 1db8661..dfa40af 100644 --- a/config/app.js +++ b/config/app.js @@ -3,8 +3,8 @@ let httpApi; // 总域名 let httpApiTwo; // 物流系统域名 let httpApiTest -const env = 'dev'; // 开发 -// const env = 'prod'; // 生产 +// const env = 'dev'; // 开发 +const env = 'prod'; // 生产 // const env = 'prew'; // 预上线 switch (env) { @@ -22,7 +22,7 @@ switch (env) { httpApi = 'https://ceshi-worker-task.lihaink.cn' //测试 httpApiThree = 'https://ceshi-worker-task.lihaink.cn' //测试 httpApiTwo = 'https://ceshi-logistics.lihaink.cn' //测试环境 - httpApiTest = 'http://192.168.1.9:8081' //测试环境 + httpApiTest = 'http://192.168.1.13:8081' //测试环境 } diff --git a/pages.json b/pages.json index 61c09e0..edb8cd7 100644 --- a/pages.json +++ b/pages.json @@ -31,10 +31,8 @@ "navigationBarTitleText": "商机信息", "navigationBarBackgroundColor": "#0122C7", "navigationBarTextStyle": "white", - "app-plus": { - //手机软键盘升起不让其将页面头部上推 - "softinputMode": "adjustResize" - } + "enablePullDownRefresh": true + } }, @@ -277,6 +275,16 @@ "navigationBarTextStyle": "white" } + },{ + "path": "chatMang/index", + "style": { + "navigationBarTitleText": "聊天", + "enablePullDownRefresh": false, + "navigationBarBackgroundColor": "#0122C7", + "navigationBarTextStyle": "white", + "enablePullDownRefresh": true + } + }, { "path": "topUp/topUp", "style": { @@ -593,6 +601,15 @@ "navigationBarTextStyle": "white" } + }, { + "path": "property/buyCar", + "style": { + "navigationBarTitleText": "车辆购买", + "enablePullDownRefresh": false, + "navigationBarBackgroundColor": "#0122C7", + "navigationBarTextStyle": "white" + } + }, { "path": "property/success", "style": { diff --git a/pages/business/business.vue b/pages/business/business.vue index ba3f1fb..ba66194 100644 --- a/pages/business/business.vue +++ b/pages/business/business.vue @@ -1,14 +1,16 @@ - - - \ No newline at end of file diff --git a/pages/oaHome/oaHome.vue b/pages/oaHome/oaHome.vue index 6b9cea5..d7f7181 100644 --- a/pages/oaHome/oaHome.vue +++ b/pages/oaHome/oaHome.vue @@ -110,6 +110,25 @@ + + + + + + {{managerInfo.manager_name}} + + + + + 99 + + + + + + + + 工作管理 @@ -215,6 +234,9 @@ import { import { noticeList } from "@/api/notice.js"; +import { + getAreaManagerApi + } from "@/api/bussness.js" // import tabbar from '../components/tabbar' import { getIndexListAPI, @@ -241,6 +263,7 @@ export default { }, data () { return { + brange:0, options: { data: '', }, @@ -248,6 +271,7 @@ export default { page_num: 1, flag: false, uniMP: false, + managerInfo:{}, id: "", is_captain: 0, notArr: [], @@ -292,11 +316,16 @@ export default { await this.$onLaunched; this.is_captain = JSON.parse(uni.getStorageSync("USER_INFO")||'{}')?.is_captain this.options.data = bj; + let user_id= JSON.parse( uni.getStorageSync("USER_INFO")).id + getAreaManagerApi({user_id}).then(res=>{ + console.log(res.data) + this.managerInfo=res.data + }) //#ifdef APP-PLUS let that = this; jpushModule.addNotificationListener(function (result) { if (!that.notArr.includes(result.messageID)) { - that.$refs.globalPopup.showPopu(); + // that.$refs.globalPopup.showPopu(); that.getOrderList(); console.log("idnex的"); that.notArr.push(result.messageID); @@ -408,14 +437,21 @@ export default { methods: { // 通知 noticeFn () { - const audioContext = uni.createInnerAudioContext() - audioContext.src = '/static/mp3/order.mp3' - jpushModule.addNotificationListener(res => { + jpushModule.addNotificationListener(res => { + const audioContext = uni.createInnerAudioContext() + if(res.content.includes(':')){ + audioContext.src = '/static/mp3/im.wav' + audioContext.play() + uni.vibrateLong(); + console.log("im") + return + } if (res.notificationEventType == 'notificationOpened') return + audioContext.src = '/static/mp3/order.mp3' audioContext.play() uni.vibrateLong(); this.getOrderList() - this.$refs.globalPopup.showPopu(); + // this.$refs.globalPopup.showPopu(); console.log("index的监听") }) }, @@ -958,4 +994,32 @@ export default { } } } +.chat{ + margin-top: 1000px; + // margin-top: 2000rpx; + width: 694.74rpx; + margin: 0 auto; + background-color: white; + border-radius: 12px; + padding:20rpx; + // padding-top: 10rpx; + padding-right: 24rpx; + display: flex; + justify-content: space-between; + align-items: center; + .chat-l{ + display: flex; + align-items: center; + } +} +.brange{ + color: white; + background-color: red; + width: 40rpx; + height: 40rpx; + border-radius: 40rpx; + font-size: 12px; + text-align: center; + lighting-color: 40rpx; +} \ No newline at end of file diff --git a/static/mp3/im.mp3 b/static/mp3/im.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..dc94c500a0424a1559c5ca18a52a4892b9875c4d GIT binary patch literal 7149 zcmeI1do+|=AIF~=w{foqNp4ML5C$c;PVUUOuJ!C^uf2cI{^Rp~_HXaCH^%fh7r>F+ zRTEnq8%_nzdCms~15r^?YUeL$?1=N;3E9;yfn5T-1a=AR64)iMOJJA4E`ePFy99O# z>=M`|@DC*bZlym500})Kr=ODqXqTx<8`%(m0q3{@dCs{2jGGHW?EFw;I|=pJz}0dc zzs9AaNpHHT1|e|ywYLZxiVE;9!yp^W?|X7h`wrv3*$oH;dAjs+#e(=Gm|()b{0|a_ zw7sJ2mp_W+{iFecFii@YAmIuJzkw<8x25)mt6egKm6q;DfZ$AJ*!C2;w$lQNI}krx zx*t_kLI?lWk8BxIQAPs6)la(KOfZR5I~C65EDVXb6Mb4G9)?BCd(0f-?%Xk84^lO_lLEg; z#n(S_wIn}+nXHH&GlzgHfd{t=QWwqJ2|9RH;u{Vx8iT^P&E z44*NVN&y*mH{^wYV*3YY!H&0icnu1={N(%c zi_@zG)$KB80;h0GxEF;F437Z8KFNSzkOQJbQU@xLr0!-lc6->lrZ;xSAvNNJxi&U6 zB(1B=yk>-C-|{|m`cP}7VR=R;k0crijyI{E`jW3BcrPtfJr{=kSUi^E8Jbv-G@^K|Zx`HGL1x|EhsqC_?O^EVl@Jg^#p`qEn zf!qjHhH5U<>sV64pnQCBP*K@e91TIl_g5nCX7dOsR8{NiO*Kgpm=~hWl~4|;0}0l` z#<)w-cC@EK61jY*G*Ah1&Kz*o=1=Mga+B6XjEX)pd3yDwU9zn0qWhl^j=$J+jXNWWLPV`P9Ad%9|0{eh{a*`V|a)f}|uc3Yr(^L3X?gQpK;<-BEIAPAp5A9v7aQ-<$Q z@XU9x2m?A^#uB}J%z$o6U@4fMF@HA zVp8`!$eY-j6jl5({aWjnNZP#Gt^{_I!+pAR;p-Ygw(Ovby>H$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g/chatMang/index.vue similarity index 51% rename from pages/business/talkDetail.vue rename to subpkg/chatMang/index.vue index 1f2d4ad..f6c738f 100644 --- a/pages/business/talkDetail.vue +++ b/subpkg/chatMang/index.vue @@ -1,29 +1,21 @@ - \ No newline at end of file diff --git a/utils/aa.js b/utils/aa.js index 1a7164a..ce76829 100644 --- a/utils/aa.js +++ b/utils/aa.js @@ -1,118 +1,127 @@ import { - httpApiTest, - HEADER, - TOKENNAME, + HTTP_REQUEST_URL_THREE, + HEADER, + TOKENNAME, } from '@/config/app'; import { - Toast + Toast } from '../libs/uniApi'; // import { checkLogin } from '../libs/login'; import store from '../store'; function toLogin() { - uni.showToast({ - title: '请先登录', - icon: 'none', - duration: 1000 - }); + uni.showToast({ + title: '请先登录', + icon: 'none', + duration: 1000 + }); } function baseRequestTwo(url, method, data, { - noAuth = false, - noVerify = false + noAuth = false, + noVerify = false, + onReLogin = false }) { - let Url = httpApiTest, - header = HEADER; - if (!noAuth) { - // 已经未登录了,禁止请求 - if (!store.state.config.request) return Promise.reject({ - msg: '未登录' - }); - //登录过期自动登录 - if (!store.state.app.token) { - toLogin(); - store.commit("SET_REQUEST", false); - return Promise.reject({ - msg: '未登录' - }); - } - } + let Url = HTTP_REQUEST_URL_THREE, + header = HEADER; + if (!noAuth) { + // 已经未登录了,禁止请求 + if (!store.state.config.request) return Promise.reject({ + msg: '未登录' + }); + //登录过期自动登录 + if (!store.state.app.token) { + toLogin(); + store.commit("SET_REQUEST", false); + return Promise.reject({ + msg: '未登录' + }); + } + } - // if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token; - if (store.state.app.token) header[TOKENNAME] = store.state.app.token; + // if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token; + if (store.state.app.token) header[TOKENNAME] = store.state.app.token; - // header[TOKENNAME] = 'Bearer sdjflidshjgfkbdasgjmasbgvhauuiavhkesvndkaesbvkjsdbv'; - return new Promise((reslove, reject) => { - // uni.showLoading({ - // title: '加载中' - // }) - uni.request({ - // url: Url + '/api/v1' + url, - url: Url + url, - method: method || 'GET', - header: { - ...header - - }, - data: method != 'GET' ? data || {} : {}, - params: method == 'GET' ? data : {}, - success: (res) => { - // uni.hideLoading() - if (noVerify) - // reslove(res.data, res); - reslove(res.data); - else if (res.data.code == -1) { - store.commit("LOGOUT"); - store.commit("SET_REQUEST", false); - reject(res.data); - } else if (res.data.code == 0) { - // uni.hideLoading(); - if (res.data.show != 1 && res.data.msg != '无登录信息') { - uni.showToast({ - title: res.data.msg || '请检查网络', - icon: 'none', - }) - } - reject(res.data); - } else if (res.data.code == 1) { - store.commit("SET_REQUEST"); - reslove(res.data); - } else if (res.data.code == 200) { - store.commit("SET_REQUEST"); - reslove(res.data.data); - } else if ([410000, 410001, 410002, 40000].indexOf(res.data.code) !== -1) { - toLogin(); - reject(res.data); - } else if (res.data.code == 501) { - // uni.reLaunch({ - // url: '/pages/error/index' - // }) - reject(res.data); - } else { - // uni.hideLoading(); - uni.showToast({ - title: res.data.msg || '请检查网络', - icon: 'none' - }) - reject(res.data.msg || '请检查网络'); - } - }, - fail: (message) => { - // uni.hideLoading() - uni.showToast({ - title: '网络错误', - icon: 'none' - }) - reject('请求失败'); - } - }) - }); + // header[TOKENNAME] = 'Bearer sdjflidshjgfkbdasgjmasbgvhauuiavhkesvndkaesbvkjsdbv'; + return new Promise((reslove, reject) => { + // uni.showLoading({ + // title: '加载中' + // }) + uni.request({ + // url: Url + '/api/v1' + url, + url: Url + url, + method: method || 'GET', + header: { + ...header + }, + data: method != 'GET' ? data || {} : {}, + params: method == 'GET' ? data : {}, + success: (res) => { + if (noVerify) + reslove(res.data); + else if (res.data.code == -1) { + if(onReLogin) { + store.commit('LOGOUT'); + return reject(); + } + // 如果登录超时,自动重新登录并且继续发送请求 + store.dispatch("RE_LOGIN", { + url: url, + method: method, + data: data, + opt: { + noAuth, + noVerify + } + }).then((e)=>{ + reslove(e); + }).catch((err)=>{ + reject(res.data); + }) + // store.commit("SET_REQUEST", false); + } else if (res.data.code == 0) { + if (res.data.msg != '无登录信息') { + uni.showToast({ + title: res.data.msg || '请检查网络', + icon: 'none', + }) + } + reject(res.data); + } else if (res.data.code == 1) { + store.commit("SET_REQUEST"); + reslove(res.data); + } else if (res.data.code == 200) { + store.commit("SET_REQUEST"); + reslove(res.data.data); + } else if ([410000, 410001, 410002, 40000].indexOf(res.data.code) !== -1) { + toLogin(); + reject(res.data); + } else if (res.data.code == 501) { + reject(res.data); + } else { + uni.showToast({ + title: res.data.msg || '请检查网络', + icon: 'none' + }) + reject(res.data.msg || '请检查网络'); + } + }, + fail: (message) => { + // uni.hideLoading() + uni.showToast({ + title: '网络错误', + icon: 'none' + }) + reject('请求失败'); + } + }) + }); } const oahttp = {}; ['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach((method) => { - oahttp[method] = (api, data, opt) => baseRequestTwo(api, method, data, opt || {}) + oahttp[method] = (api, data, opt) => baseRequestTwo(api, method, data, opt || {}) }); export default oahttp; \ No newline at end of file