From 1ef0e393913961c11ea05f868a537015572d7b7c Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期三, 12 四月 2023 08:07:04 +0800
Subject: [PATCH] 微信小程序增加查看消息
---
api/publicInterface.js | 4
api/globalApi.js | 117 +++++++------
components/card/card.vue | 6
pages/public-page/messageDetails/messageDetails.vue | 55 ++++++
api/request.js | 8
pages.json | 18 ++
pages/customer-page/customer-index/customer-index.vue | 3
main.js | 18 +
pages/tabbar-page/index-tabbar/index-tabbar.vue | 28 +++
api/index.js | 63 ++++---
pages/public-page/message/message.vue | 146 ++++++++++++++++++
11 files changed, 361 insertions(+), 105 deletions(-)
diff --git a/api/globalApi.js b/api/globalApi.js
index f51a4c4..dd627c7 100644
--- a/api/globalApi.js
+++ b/api/globalApi.js
@@ -2,7 +2,7 @@
// 缁戝畾寰俊
wxBind: {
url: '/wrzs/social/bind',
- method: "POST"
+ method: 'POST'
},
// 鎻愮叅鍗�
@@ -27,8 +27,8 @@
// 瀹㈡埛棰嗗彇
customerGet: {
- url: "/wrzs/wx/customerGet",
- method: "POST"
+ url: '/wrzs/wx/customerGet',
+ method: 'POST'
},
// 杞彂
// forward: {
@@ -39,29 +39,29 @@
* @description 杞彂淇敼
*/
forward: {
- url: "/wrzs/userOperation/forwardList",
- method: "POST"
+ url: '/wrzs/userOperation/forwardList',
+ method: 'POST'
},
/**
* @description 杞彂淇敼鍥炴樉
*/
forwardList: {
- url: "/wrzs/userOperation/forwardListData",
- method: "GET"
+ url: '/wrzs/userOperation/forwardListData',
+ method: 'GET'
},
/**
* @description 鍒犻櫎涓�缁勮浆鍙�
*/
deleteForward: {
- url: "/wrzs/userOperation/deleteForward",
- method: "POST"
+ url: '/wrzs/userOperation/deleteForward',
+ method: 'POST'
},
/**
* @description 鑾峰彇鍘嗗彶鎻愮叅鍗�
*/
getJhOrderPlanDataPage: {
url: '/wrzs/userOperation/getJhOrderPlanDataPage',
- method: "GET"
+ method: 'GET'
},
// 璐т唬棣栭〉鍒楄〃
// huoDaiList: {
@@ -72,8 +72,8 @@
* @璐т唬棣栭〉鍒楄〃淇敼
*/
huoDaiList: {
- url: "/wrzs/userOperation/huoDaiList ",
- method: "GET"
+ url: '/wrzs/userOperation/huoDaiList ',
+ method: 'GET'
},
//鍙告満棣栭〉鍒楄〃
@@ -85,8 +85,8 @@
* @鍙告満棣栭〉鍒楄〃淇敼
*/
qiangDanList: {
- url: "/wrzs/userOperation/qiangDanList",
- method: "GET"
+ url: '/wrzs/userOperation/qiangDanList',
+ method: 'GET'
},
//鎶㈠崟
@@ -98,14 +98,14 @@
* @鎶㈠崟淇敼
*/
qiangDan: {
- url: "/wrzs/userOperation/qiangDan",
- method: "POST"
+ url: '/wrzs/userOperation/qiangDan',
+ method: 'POST'
},
//鍙栨秷鎶㈠崟
quXiaoQiangDan: {
- url: "/wrzs/wx/quXiaoQiangDan",
- method: "POST"
+ url: '/wrzs/wx/quXiaoQiangDan',
+ method: 'POST'
},
//棰勭害鍒楄〃
// yuYueList: {
@@ -116,8 +116,8 @@
* @棰勭害鍒楄〃淇敼
*/
yuYueList: {
- url: "/wrzs/userOperation/yuYueList",
- method: "GET"
+ url: '/wrzs/userOperation/yuYueList',
+ method: 'GET'
},
//棰勭害
@@ -129,8 +129,8 @@
* @棰勭害淇敼
*/
yuYue: {
- url: "/wrzs/userOperation/yuYue",
- method: "POST"
+ url: '/wrzs/userOperation/yuYue',
+ method: 'POST'
},
//鑾峰彇鎻愮叅鍗曡鎯�
@@ -142,8 +142,8 @@
* @鑾峰彇鎻愮叅鍗曡鎯呬慨鏀瑰悗
*/
getTakeCoal: {
- url: "/wrzs/userOperation/getTakeCoal",
- method: "GET"
+ url: '/wrzs/userOperation/getTakeCoal',
+ method: 'GET'
},
// 鐢ㄦ埛
@@ -154,8 +154,8 @@
},
// 淇敼鐢ㄦ埛淇℃伅
updateUser: {
- url: "/wrzs/wx/updateUser",
- method: "POST"
+ url: '/wrzs/wx/updateUser',
+ method: 'POST'
},
// 鑾峰彇鐢ㄦ埛淇℃伅
getUserById: {
@@ -164,56 +164,56 @@
},
//鑾峰彇璐т唬鍒楄〃
getAllHuoDaiByCustomerId: {
- url: "/wrzs/wx/getAllHuoDaiByCustomerId",
- method: "GET"
+ url: '/wrzs/wx/getAllHuoDaiByCustomerId',
+ method: 'GET'
},
//閭�璇疯揣浠�
bindHuoDai: {
- url: "/wrzs/wx/bindHuoDai",
- method: "POST"
+ url: '/wrzs/wx/bindHuoDai',
+ method: 'POST'
},
//鍒犻櫎璐т唬
deleteHuoDai: {
- url: "/wrzs/wx/deleteHuoDai",
- method: "POST"
+ url: '/wrzs/wx/deleteHuoDai',
+ method: 'POST'
},
//鑾峰彇璐т唬璇︽儏
getHuoDaiDetail: {
- url: "/wrzs/wx/getHuoDaiDetail",
- method: "GET"
+ url: '/wrzs/wx/getHuoDaiDetail',
+ method: 'GET'
},
//鑾峰彇鍙告満鍒楄〃
GetUserFleet: {
- url: "/wrzs/wx/getUserFleet",
- method: "GET"
+ url: '/wrzs/wx/getUserFleet',
+ method: 'GET'
},
//閭�璇峰徃鏈�
bindUserFleet: {
- url: "/wrzs/wx/bindUserFleet",
- method: "POST"
+ url: '/wrzs/wx/bindUserFleet',
+ method: 'POST'
},
//鍒犻櫎鍙告満
deleteSiJi: {
- url: "/wrzs/wx/deleteSiJi",
- method: "POST",
+ url: '/wrzs/wx/deleteSiJi',
+ method: 'POST',
},
// 杞﹁締
// 鑾峰彇杞﹂槦鍒楄〃
getFleet: {
- url: "/wrzs/wx/getFleet",
- method: "GET"
+ url: '/wrzs/wx/getFleet',
+ method: 'GET'
},
//鏂板杞﹂槦
saveFleet: {
- url: "/wrzs/wx/saveFleet",
- method: "POST"
+ url: '/wrzs/wx/saveFleet',
+ method: 'POST'
},
// 鍒犻櫎杞﹂槦
deleteFleet: {
- url: "/wrzs/wx/deleteFleet",
- method: "POST"
+ url: '/wrzs/wx/deleteFleet',
+ method: 'POST'
},
/**
@@ -228,17 +228,17 @@
*/
// 鏂板
saveRCSQ: {
- url: "/wrzs/tminapply/save",
+ url: '/wrzs/tminapply/save',
method: 'POST'
},
// 淇敼
updateByIdRCSQ: {
- url: "/wrzs/tminapply/updateById",
+ url: '/wrzs/tminapply/updateById',
method: 'PUT'
},
// 鏌ヨ
pageRCSQ: {
- url: "/wrzs/tminapply/page",
+ url: '/wrzs/tminapply/page',
method: 'GET'
},
@@ -246,14 +246,14 @@
* @description 绗竴娆℃斁绌�
*/
getOneEvacuation: {
- url: "/wrzs/userOperation/getOneEvacuation",
+ url: '/wrzs/userOperation/getOneEvacuation',
method: 'POST'
},
/**
* @description 绗簩娆℃斁绌�
*/
getTwoEvacuation: {
- url: "/wrzs/userOperation/getTwoEvacuation",
+ url: '/wrzs/userOperation/getTwoEvacuation',
method: 'POST'
},
/**
@@ -265,7 +265,7 @@
},
// 鑾峰彇绉伴噸淇℃伅
weighList: {
- url: "/wrzs/userOperation/weighList",
+ url: '/wrzs/userOperation/weighList',
method: 'GET'
},
// 鍔犲噺鐓�
@@ -275,13 +275,13 @@
},
// 鑾峰彇鎵�鍦ㄧ鎴�
getWeighHouse: {
- url: "/wrzs/jccoalweighhouse/getWeighHouse",
+ url: '/wrzs/jccoalweighhouse/getWeighHouse',
method: 'GET'
},
// 鎻愮叅鍗曟棩蹇楁煡璇�
coalDayPage: {
- url: "/wrzs/tmtaskcoallog/getTmId",
+ url: '/wrzs/tmtaskcoallog/getTmId',
method: 'GET'
},
@@ -289,5 +289,12 @@
getCallOutList: {
url: '/wrzs/callout/getCallOutList',
method: 'GET'
- }
+ },
+ // 鑾峰彇娑堟伅鍒楄〃
+ getMessageByUser: {
+ url: '/wrzs/appMessage/getMessageByUser',
+ method: 'GET'
+ },
+ readMessage: { url: '/wrzs/appMessage/readMessage' },
+ delteMessage: { url: '/wrzs/appMessage/deleteMessage', method: 'GET' }
}
diff --git a/api/index.js b/api/index.js
index 3d4d824..fbcc0ce 100644
--- a/api/index.js
+++ b/api/index.js
@@ -1,60 +1,61 @@
-import {
- fetch
-} from '@/api/request.js';
+import { fetch } from '@/api/request.js'
const typeObj = {
- headerGET: {
- "Content-type": 'application/x-www-from-urlencoded'
- },
- headerPOST: {
- "Content-type": 'application/x-www-from-urlencoded'
- },
- jsonPOST: {
- "Content-type": 'application/json'
- },
- utfPOSt: {
- 'content-type': 'application/x-www-form-urlencoded;charset=utf-8'
- }
+ headerGET: { 'Content-type': 'application/x-www-from-urlencoded' },
+ headerPOST: { 'Content-type': 'application/x-www-from-urlencoded' },
+ jsonPOST: { 'Content-type': 'application/json' },
+ utfPOSt: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }
}
// 閫氱敤鎺ュ彛璇锋眰
export const reqAll = (url, params, opt = {}) => {
- opt.data = params;
- opt.header = typeObj['headerPOST'];
+ opt.data = params
+ opt.header = typeObj['headerPOST']
return fetch(url, opt)
}
-
+export const reqAllJson = (url, params, opt = {}) => {
+ opt.data = params
+ opt.header = typeObj['jsonPOST']
+ return fetch(url, opt)
+}
+// deltete璇锋眰
+export const reqDelete = (url, params, opt = {}) => {
+ opt.header = typeObj['jsonPOST']
+ opt.method = 'DELETE'
+ opt.data = params
+ return fetch(url, opt)
+}
// get璇锋眰
// urlParam鏄嫾鎺ヨ矾寰勭殑鍙傛暟
export const reqGet = (url, params, opt = {}) => {
- opt.header = typeObj['headerGET'];
- opt.method = "GET";
- opt.data = params;
+ opt.header = typeObj['headerGET']
+ opt.method = 'GET'
+ opt.data = params
return fetch(url, opt)
}
// post璇锋眰
// urlType鏄寚瀹氭嫾鎺ヨ矾寰勮繕鏄紶json鏍煎紡鍙傛暟
export const reqPost = (url, params, urlType, opt = {}) => {
- opt.method = "POST";
+ opt.method = 'POST'
if (urlType == 'params') {
Object.keys(params).map(item => {
// 杩欓噷闈笉鑳界敤params.item锛岀偣杩愮畻绗﹀姞鏍囪瘑绗︾殑褰㈠紡鍙栧�硷紝鍥犱负item鏄疧bject.keys鐢熸垚鐨勬瘡涓�椤归敭閮芥槸瀛楃涓诧紝涓嶆槸鏍囪瘑绗︼紝鍙互鐢╗]鐨勫舰寮忚闂�
if (params[item] == null) {
- params[item] = '';
+ params[item] = ''
}
})
- opt.params = params;
- opt.header = typeObj['headerPOST'];
+ opt.params = params
+ opt.header = typeObj['headerPOST']
} else if (urlType == 'json') {
- opt.header = typeObj['jsonPOST'];
- opt.data = params;
+ opt.header = typeObj['jsonPOST']
+ opt.data = params
} else if (urlType == 'utf8') {
- opt.header = typeObj['utfPOSt'];
- opt.data = params;
+ opt.header = typeObj['utfPOSt']
+ opt.data = params
} else {
- opt.data = params;
- opt.header = typeObj['headerPOST'];
+ opt.data = params
+ opt.header = typeObj['headerPOST']
}
return fetch(url, opt, urlType)
}
diff --git a/api/publicInterface.js b/api/publicInterface.js
index e850135..59e40cc 100644
--- a/api/publicInterface.js
+++ b/api/publicInterface.js
@@ -3,9 +3,9 @@
import { BaseUrl as wrBaseUrl } from '@/api/request.js'
-const BaseUrl = 'http://192.168.31.14:9999'
+// const BaseUrl = 'http://192.168.31.14:9999'
// const BaseUrl = "http://hesuancj.cn:9999"
-// const BaseUrl = 'https://mx.jzeg.cn:9095'
+const BaseUrl = 'https://mx.jzeg.cn:9095'
// const BaseUrl = 'http://192.168.31.18:9999'
// 鐧诲綍
diff --git a/api/request.js b/api/request.js
index be2601b..639bd3d 100644
--- a/api/request.js
+++ b/api/request.js
@@ -81,14 +81,14 @@
// const BaseUrl = "http://192.168.31.18:9997"
// const webSocketUrl = "ws://192.168.31.18:9997/wrzs/ws/info"
-const BaseUrl = "http://192.168.31.14:9997";
-const webSocketUrl = "ws://192.168.31.14:9997/wrzs/ws/info"
+// const BaseUrl = "http://192.168.31.14:9997";
+// const webSocketUrl = "ws://192.168.31.14:9997/wrzs/ws/info"
// // 绾夸笂寮�鍙�
// const BaseUrl = "http://hesuancj.cn:9997";
// const webSocketUrl = "ws://hesuancj.cn:9997/wrzs/ws/info"
// // 绾夸笂鐢熶骇
-// const BaseUrl = "https://mx.jzeg.cn:9095";
-// const webSocketUrl = "wss://mx.jzeg.cn:9095/wrzs/ws/info"
+const BaseUrl = "https://mx.jzeg.cn:9095";
+const webSocketUrl = "wss://mx.jzeg.cn:9095/wrzs/ws/info"
// 璇锋眰鎷︽埅
diff --git a/components/card/card.vue b/components/card/card.vue
index 0865234..4dd5b4f 100644
--- a/components/card/card.vue
+++ b/components/card/card.vue
@@ -4,10 +4,10 @@
:style="{
background:
backgroundType == 0
- ? 'url(https://hesuancj.cn:9095/appimg/image/background/customer-blue.png) no-repeat'
+ ? 'url(https://mx.jzeg.cn:9095/appimg/image/background/customer-blue.png) no-repeat'
: backgroundType == 1
- ? 'url(https://hesuancj.cn:9095/appimg/image/background/huoDai.png) no-repeat'
- : 'url(https://hesuancj.cn:9095/appimg/image/background/driver.png) no-repeat',
+ ? 'url(https://mx.jzeg.cn:9095/appimg/image/background/huoDai.png) no-repeat'
+ : 'url(https://mx.jzeg.cn:9095/appimg/image/background/driver.png) no-repeat',
backgroundSize: '100% 100%'
}"
>
diff --git a/main.js b/main.js
index 6d629e2..424d202 100644
--- a/main.js
+++ b/main.js
@@ -6,7 +6,7 @@
App.mpType = 'app'
uni.$u.config.unit = 'rpx'
-Vue.use('tab-bar', tabbar);
+Vue.use('tab-bar', tabbar)
// 寮曞叆鍏ㄥ眬 uView 妗嗘灦
import uView from '@/uni_modules/uview-ui'
@@ -20,12 +20,16 @@
import {
reqAll,
reqGet,
- reqPost
-} from '@/api/index.js';
-Vue.prototype.$reqAll = reqAll;
-Vue.prototype.$reqGet = reqGet;
-Vue.prototype.$reqPost = reqPost;
-Vue.prototype.$store = store;
+ reqPost,
+ reqAllJson,
+ reqDelete
+} from '@/api/index.js'
+Vue.prototype.$reqAll = reqAll
+Vue.prototype.$reqAllJson = reqAllJson
+Vue.prototype.$reqGet = reqGet
+Vue.prototype.$reqPost = reqPost
+Vue.prototype.$reqDelete = reqDelete
+Vue.prototype.$store = store
// 鐢变簬寰俊灏忕▼搴忕殑杩愯鏈哄埗闂锛岄渶澹版槑濡備笅涓�琛岋紝H5鍜孉PP闈炲繀濉�
const app = new Vue({
store,
diff --git a/pages.json b/pages.json
index c56e227..7f71f99 100644
--- a/pages.json
+++ b/pages.json
@@ -186,7 +186,23 @@
"navigationBarTitleText": "杞彂",
"enablePullDownRefresh": false
}
- }]
+ }, {
+ "path": "message/message",
+ "style": {
+ "navigationBarTitleText": "娑堟伅",
+ "enablePullDownRefresh": true
+ }
+
+ } ,{
+ "path" : "messageDetails/messageDetails",
+ "style" :
+ {
+ "navigationBarTitleText": "",
+ "enablePullDownRefresh": false
+ }
+
+ }
+ ]
}, {
"root": "pages/driver-page/appointment",
"pages": [{
diff --git a/pages/customer-page/customer-index/customer-index.vue b/pages/customer-page/customer-index/customer-index.vue
index 120d1d7..2f2a50b 100644
--- a/pages/customer-page/customer-index/customer-index.vue
+++ b/pages/customer-page/customer-index/customer-index.vue
@@ -10,7 +10,7 @@
</view>
<view class="card-left__utils">
<u-button @tap.stop="receiveClick(item)" text="棰嗗彇" type="primary" v-if="item.carNum - item.cars2 != 0" shape="circle"></u-button>
- <u-button text="杞彂" type="primary" @tap.stop="forwardClick(item)" shape="circle" v-if="item.carNumSurplus1 != 0"></u-button>
+ <u-button text="杞彂" type="primary" @tap.stop="forwardClick(item)" shape="circle"></u-button>
</view>
</template>
<template v-slot:right-top>
@@ -154,6 +154,7 @@
this.loading = true;
this.$reqGet('getJhOrderPlanDataPage', { current: this.pageCurrent, size: this.pageSize }).then(res => {
if (res.data.records) {
+ this.total = res.data.total;
if (this.pageCurrent > 1) {
this.historyCoalData = this.historyCoalData.concat(res.data.records);
this.loading = false;
diff --git a/pages/public-page/message/message.vue b/pages/public-page/message/message.vue
new file mode 100644
index 0000000..710e11d
--- /dev/null
+++ b/pages/public-page/message/message.vue
@@ -0,0 +1,146 @@
+<template>
+ <view class="message-body">
+ <u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" v-if="messageList.length == 0" width="400" height="400" textSize="18"></u-empty>
+ <u-list @scrolltolower="scrolltolower" :height="1400">
+ <u-list-item>
+ <u-swipe-action>
+ <u-swipe-action-item :options="options1" v-for="(item, index) in messageList" :key="item.id" @click="deleteMsg(item, index)">
+ <u-badge :isDot="true" type="error" v-if="item.status === 0"></u-badge>
+ <u-cell size="large" :title="item.title" :label="item.content" @click="messageDetails(item, index)">
+ <view class="prepose" slot="icon"><u-icon name="file-text" color="#a299a0" size="80"></u-icon></view>
+ </u-cell>
+ </u-swipe-action-item>
+ </u-swipe-action>
+ </u-list-item>
+ <view class="more-text" v-if="showMoreData && messageList.length !== 0">娌℃湁鏁版嵁浜�...</view>
+ </u-list>
+ <u-modal :show="show" :content="content" :showCancelButton="true" @confirm="confirm" @cancel="cancel"></u-modal>
+ </view>
+</template>
+
+<script>
+export default {
+ data() {
+ return {
+ pageNum: 1,
+ pageSize: 10,
+ total: '',
+ messageList: [],
+ showMoreData: false,
+ options1: [
+ {
+ text: '鍒犻櫎'
+ }
+ ],
+ show: false,
+ content: '鏄惁纭鍒犻櫎',
+ id: '',
+ index: ''
+ };
+ },
+ onShow() {
+ this.messageReq();
+ },
+ methods: {
+ // 瑙﹀簳鍔犺浇
+ scrolltolower() {
+ if (this.pageNum * this.pageSize >= this.total) return (this.showMoreData = true);
+ this.pageNum++;
+ this.messageReq();
+ },
+ // 鑾峰彇娑堟伅鍒楄〃
+ messageReq() {
+ uni.showLoading({
+ title: '鍔犺浇涓�'
+ });
+ this.$reqGet('getMessageByUser', { current: this.pageNum, size: this.pageSize }).then(res => {
+ if (res.code == 0) {
+ uni.hideLoading();
+ this.total = res.data.total;
+ if (this.pageNum > 1) {
+ this.messageList = this.messageList.concat(res.data.records);
+ } else if (this.pageNum == 1) {
+ this.messageList = res.data.records;
+ }
+ } else {
+ this.$u.toast('鍔犺浇澶辫触');
+ }
+ });
+ },
+ // 宸茶娑堟伅
+ messageDetails(value, index) {
+ if (value.status == 0) {
+ this.$reqAllJson('readMessage', { id: value.id, status: value.status }, { method: 'PUT', 'Content-Type': 'application/json' }).then(res => {
+ if (res.code == 0) {
+ uni.navigateTo({
+ url: `/pages/public-page/messageDetails/messageDetails?index=${index}`
+ });
+ // uni.showLoading({
+ // title: '鍔犺浇涓�'
+ // });
+ // this.$reqGet('getMessageByUser', { current: 1, size: this.pageSize }).then(res => {
+ // uni.hideLoading();
+ // this.total = res.data.total;
+ // this.messageList = res.data.records;
+ // });
+ }
+ });
+ } else {
+ uni.navigateTo({
+ url: `/pages/public-page/messageDetails/messageDetails?index=${index}`
+ });
+ }
+ },
+ // 鍒犻櫎娑堟伅
+ deleteMsg(value, index) {
+ this.show = true;
+ this.id = value.id;
+ },
+ // 纭鍒犻櫎
+ confirm() {
+ this.show = false;
+ this.$reqGet('delteMessage', { id: this.id }).then(res => {
+ if (res.code == 0) {
+ this.$u.toast('鍒犻櫎鎴愬姛');
+ setTimeout(() => {
+ uni.showLoading({
+ title: '鍔犺浇涓�'
+ });
+ this.$reqGet('getMessageByUser', { current: 1, size: this.pageSize }).then(res => {
+ uni.hideLoading();
+ this.total = res.data.total;
+ this.messageList = res.data.records;
+ });
+ }, 800);
+ } else {
+ this.$u.toast('鍒犻櫎澶辫触');
+ }
+ });
+ },
+ cancel() {
+ this.show = false;
+ }
+ }
+};
+</script>
+
+<style lang="scss">
+::v-deep .u-list-item- {
+ position: relative;
+ .u-badge {
+ position: absolute;
+ right: vww(10);
+ top: vww(10);
+ }
+}
+.message-body {
+ width: 100%;
+ height: 100%;
+
+ .more-text {
+ color: #999;
+ font-size: 24rpx;
+ text-align: center;
+ }
+}
+</style>
diff --git a/pages/public-page/messageDetails/messageDetails.vue b/pages/public-page/messageDetails/messageDetails.vue
new file mode 100644
index 0000000..87b45f4
--- /dev/null
+++ b/pages/public-page/messageDetails/messageDetails.vue
@@ -0,0 +1,55 @@
+<template>
+ <view>
+ <combined-title title="娑堟伅璇︽儏"></combined-title>
+ <view class="compDetails" v-for="(item, index) in detail" :key="index">
+ <uni-table border stripe emptyText="鏆傛棤鏇村鏁版嵁">
+ <uni-tr>
+ <uni-th align="left">娑堟伅鏍囬</uni-th>
+ <uni-td align="left">{{ item.title || '' }}</uni-td>
+ </uni-tr>
+ <uni-tr>
+ <uni-th align="left">娑堟伅鍐呭</uni-th>
+ <uni-td align="left">{{ item.content || '' }}</uni-td>
+ </uni-tr>
+ <uni-tr>
+ <uni-th align="left">鍒涘缓鏃堕棿</uni-th>
+ <uni-td align="left">{{ item.createTime || '' }}</uni-td>
+ </uni-tr>
+ </uni-table>
+ </view>
+ </view>
+</template>
+
+<script>
+export default {
+ data() {
+ return {
+ index: '',
+ detail: []
+ };
+ },
+ onLoad(v) {
+ this.index = v.index;
+ },
+ onShow() {
+ this.messageReq();
+ },
+ methods: {
+ messageReq() {
+ uni.showLoading({
+ title: '鍔犺浇涓�'
+ });
+ this.$reqGet('getMessageByUser', { current: 1, size: 10 }).then(res => {
+ if (res.code == 0) {
+ uni.hideLoading();
+ this.detail = res.data.records.filter((v, i) => i == this.index);
+ } else {
+ this.$u.toast('鍔犺浇澶辫触');
+ }
+ });
+ }
+ }
+};
+</script>
+
+<style></style>
diff --git a/pages/tabbar-page/index-tabbar/index-tabbar.vue b/pages/tabbar-page/index-tabbar/index-tabbar.vue
index 2fc1f58..e2db085 100644
--- a/pages/tabbar-page/index-tabbar/index-tabbar.vue
+++ b/pages/tabbar-page/index-tabbar/index-tabbar.vue
@@ -1,5 +1,8 @@
<template>
<view>
+ <view class="search-bar">
+ <view class="icon-box" @click="messagePage"><u-icon name="chat" color="#000" size="50"></u-icon></view>
+ </view>
<customer-index v-if="roleType == 1" ref="customerIndexRef" :orderPlanDataStore="orderPlanDataStore"></customer-index>
<freight-forwarder-index
v-if="roleType == 2"
@@ -106,6 +109,11 @@
this.userAuthorization();
},
methods: {
+ messagePage() {
+ uni.navigateTo({
+ url: '/pages/public-page/message/message'
+ });
+ },
init() {
this.roleType = uni.getStorageSync('roleType');
switch (this.roleType) {
@@ -172,4 +180,22 @@
};
</script>
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.search-bar {
+ height: vww(20);
+ width: 96%;
+ margin: vww(3) auto;
+ position: relative;
+ .icon-box {
+ width: vww(30);
+ height: vww(30);
+ background-color: #eee;
+ border-radius: 50%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ position: absolute;
+ right: vww(-3);
+ }
+}
+</style>
--
Gitblit v1.9.1