From 3f10299a92e23fd902e4bd51a6d59f9bf0c7d7ec Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期二, 20 六月 2023 10:08:18 +0800 Subject: [PATCH] 增加用户绑定页面 --- pages/customer-page/customer-my/userMange/userManageEdit/userManageEdit.vue | 460 +++++++++++--------- pages/login/login.vue | 11 pages/public-page/messageDetails/messageDetails.vue | 88 ++- pages.json | 47 +- pages/tabbar-page/index-tabbar/index-tabbar.vue | 20 App.vue | 4 store/index.js | 2 pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue | 37 + api/globalApi.js | 7 pages/bindBackground/index.scss | 105 ++++ pages/bindBackground/bindBackground.vue | 103 ++++ pages/public-page/message/message.vue | 362 +++++++++------- pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue | 16 13 files changed, 822 insertions(+), 440 deletions(-) diff --git a/App.vue b/App.vue index 72d23d5..758985e 100644 --- a/App.vue +++ b/App.vue @@ -9,9 +9,11 @@ }, onShow() { - console.log('appvueZI鏄剧ず'); + console.log('appvue鏄剧ず'); if (!this.globalisconnect && !this.globalisUploadimg) { this.$store.dispatch('websocketInit') + this.changeisconnect(false); + console.log('appvue鐨剋s'); } }, methods: { diff --git a/api/globalApi.js b/api/globalApi.js index a1f913f..79af198 100644 --- a/api/globalApi.js +++ b/api/globalApi.js @@ -368,5 +368,12 @@ updateTmTaskCoalState: { url: '/wrzs/tmtaskcoal/updateTmTaskCoalState', method: 'POST' + }, + /** + @description 鍚庡彴鐢ㄦ埛缁戝畾 + */ + setUpWxOpenid: { + url: '/admin/user/setUpWxOpenid', + method: 'POST' } } \ No newline at end of file diff --git a/pages.json b/pages.json index 03831ef..d2b59a4 100644 --- a/pages.json +++ b/pages.json @@ -196,17 +196,22 @@ "enablePullDownRefresh": false } + }, { + "path": "pages/driver-page/driver-index/bill-of-lading-details/completeOutSale/completeOutSale", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + + }, { + "path": "pages/bindBackground/bindBackground", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + } - ,{ - "path" : "pages/driver-page/driver-index/bill-of-lading-details/completeOutSale/completeOutSale", - "style" : - { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - - } - ], + ], "subPackages": [{ "root": "pages/register", "pages": [{ @@ -235,7 +240,7 @@ }, { "path": "messageDetails/messageDetails", "style": { - "navigationBarTitleText": "", + "navigationBarTitleText": "娑堟伅璇︽儏", "enablePullDownRefresh": false } @@ -246,16 +251,14 @@ "enablePullDownRefresh": false } - } ,{ - "path" : "mapRoute/mapRoute", - "style" : - { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - - } - ] + }, { + "path": "mapRoute/mapRoute", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + + }] }, { "root": "pages/driver-page/appointment", "pages": [{ @@ -371,4 +374,4 @@ "query": "" //鍚姩鍙傛暟锛屽湪椤甸潰鐨刼nLoad鍑芥暟閲岄潰寰楀埌 }] } -} +} \ No newline at end of file diff --git a/pages/bindBackground/bindBackground.vue b/pages/bindBackground/bindBackground.vue new file mode 100644 index 0000000..44b6d22 --- /dev/null +++ b/pages/bindBackground/bindBackground.vue @@ -0,0 +1,103 @@ +<template> + <view class="main"> + <view class="list"> + <view class="list-call"> + <u--input v-model="username" + clearable + maxlength="32" + type="text" + placeholder="璇疯緭鍏ユ墜鏈哄彿" + prefixIcon="account" + prefixIconStyle="font-size: 22px;color: #909399"></u--input> + </view> + <view class="list-call"> + <u--input v-model="password" + clearable + maxlength="32" + type="password" + placeholder="璇疯緭鍏ュ瘑鐮�" + prefixIcon="lock" + prefixIconStyle="font-size: 22px;color: #909399"></u--input> + </view> + </view> + <view class="loginBtn"><u-button type="primary" + text="纭" + @click="submit()"></u-button></view> + </view> +</template> + +<script> + import { BaseUrl } from '@/api/publicInterface.js' + export default { + data() { + return { + username: '', + password: '', + code: '' + }; + }, + methods: { + submit() { + if (this.username.length === 0) { + return this.$u.toast('璇疯緭鍏ユ墜鏈哄彿') + } + if (this.password.length === 0) { + return this.$u.toast('璇疯緭鍏ュ瘑鐮�') + } + this.setUpWxOpenid(this.username, this.password, uni.getStorageSync('bindCode')) + }, + setUpWxOpenid(userName, passWord, code) { + uni.request({ + url: `${BaseUrl}/admin/user/setUpWxOpenid`, + data: { + userName, + passWord, + code + }, + method: 'POST', + header: { + 'content-type': 'application/x-www-form-urlencoded' + }, + success: (res) => { + console.log(res, '缁戝畾缁撴灉'); + if (res.data.code === 1) { + this.$u.toast(res.data.msg ? res.data.msg : '缁戝畾澶辫触') + } + } + }) + }, + onShow() { + uni.login({ + success(res) { + if (res.code) { + console.log(res.code, '鑾峰彇code'); + this.code = res.code + uni.setStorageSync('bindCode', this.code) + } else { + uni.showToast({ + title: '鍑虹幇閿欒', + duration: 2000 + }); + } + } + }) + }, + } + } +</script> + +<style lang="scss" + scoped> + @import 'index.scss'; + + .main { + width: 100%; + height: 100%; + margin: 0 auto; + } + + .loginBtn { + width: 80%; + margin: 0 auto; + } +</style> \ No newline at end of file diff --git a/pages/bindBackground/index.scss b/pages/bindBackground/index.scss new file mode 100644 index 0000000..75cbbca --- /dev/null +++ b/pages/bindBackground/index.scss @@ -0,0 +1,105 @@ +.list { + margin: vww(20) auto; + display: flex; + flex-direction: column; + padding: 40rpx 70rpx 40rpx 70rpx; +} + +.list-call { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + padding-top: 10rpx; + height: 120rpx; + font-weight: normal; + color: #333333; + border-bottom: 0.5px solid #e2e2e2; +} + +.list-call .u-input { + flex: 1; + font-size: 39rpx; + text-align: left; + margin-left: 16rpx; +} + +.list-call .u-icon-right { + color: #aaaaaa; + width: 50rpx; + height: 40rpx; +} + +.button { + color: #ffffff; + font-size: 32rpx; + width: 80%; + height: 80rpx; + background: #497bff; + box-shadow: 0rpx 0rpx 13rpx 0rpx rgba(15, 168, 250, 0.4); + border-radius: 10rpx; + line-height: 80rpx; + text-align: center; + margin: 50rpx auto 0; +} + +.img-valid-code img { + width: 30rpx; + heigth: 50rpx; +} + +.btn-valid-code { + color: #da7918; + font-size: 30rpx; + line-height: 48rpx; + padding: 6rpx 35rpx; + border: 1rpx solid #da7918; + border-radius: 50rpx; +} + +.btn-valid-code-hover { + background-color: #f3f3f3; +} + +.btn-valid-codes { + color: #999999 !important; + border: 1rpx solid #999999; +} + +.login-bottom-box { + position: fixed; + bottom: 40rpx; + text-align: center; + width: 100%; +} + +.copyright { + text-align: center; + color: #939393; + width: 100%; + font-size: 24rpx; + + .u-link { + margin: 0 10rpx; + font-size: 24rpx !important; + } +} + +.pages-sys-login-index, +.pages-sys-login-reg, +.pages-sys-login-forget { + .u-checkbox__label { + font-size: 28rpx !important; + } + + .u-label { + flex: 0 0 35px !important; + width: 35px !important; + } +} + +.reg-text { + font-size: 42rpx; + color: #000; + padding: 40rpx 70rpx 10rpx; +} diff --git a/pages/customer-page/customer-my/userMange/userManageEdit/userManageEdit.vue b/pages/customer-page/customer-my/userMange/userManageEdit/userManageEdit.vue index 3d56130..4b56a60 100644 --- a/pages/customer-page/customer-my/userMange/userManageEdit/userManageEdit.vue +++ b/pages/customer-page/customer-my/userMange/userManageEdit/userManageEdit.vue @@ -1,237 +1,283 @@ <template> <view class="main"> <view class="main-block"> - <u--form labelPosition="left" :model="model1" :rules="rules" ref="uForm" :errorType="errorType"> - <u-form-item label="鏈嶅姟閮ㄩ棬" labelWidth="20%" @click="treeOpen" borderBottom prop="deptIds"> - <u--input placeholder="璇烽�夋嫨鏈嶅姟閮ㄩ棬" v-model="model1.deptIds" class="input" type="text"></u--input> - <qian-tree ref="tkitree" :range="department" confirmColor="#4e8af7" :multiple="true" :selectParent="true" title="閫夋嫨閮ㄩ棬" @confirm="treeChooseValue" /> + <u--form labelPosition="left" + :model="model1" + :rules="rules" + ref="uForm" + :errorType="errorType"> + <u-form-item label="鏈嶅姟閮ㄩ棬" + labelWidth="20%" + @click="treeOpen" + borderBottom + prop="deptIds"> + <u--input placeholder="璇烽�夋嫨鏈嶅姟閮ㄩ棬" + v-model="model1.deptIds" + class="input" + type="text"></u--input> + <qian-tree ref="tkitree" + :range="department" + confirmColor="#4e8af7" + :multiple="true" + :selectParent="true" + title="閫夋嫨閮ㄩ棬" + @confirm="treeChooseValue" /> </u-form-item> - <u-form-item label="韬唤璇�" labelWidth="20%" borderBottom prop="idCard"> - <u--input border="none" v-model="model1.idCard" placeholder="璇疯緭鍏ヨ韩浠借瘉"></u--input> + <u-form-item label="韬唤璇�" + labelWidth="20%" + borderBottom + prop="idCard"> + <u--input border="none" + v-model="model1.idCard" + placeholder="璇疯緭鍏ヨ韩浠借瘉"></u--input> </u-form-item> - <u-form-item label="鐪熷疄濮撳悕" labelWidth="20%" borderBottom prop="name"> - <u--input border="none" v-model="model1.name" placeholder="璇疯緭鍏ョ湡瀹炲鍚�"></u--input> + <u-form-item label="鐪熷疄濮撳悕" + labelWidth="20%" + borderBottom + prop="name"> + <u--input border="none" + v-model="model1.name" + placeholder="璇疯緭鍏ョ湡瀹炲鍚�"></u--input> </u-form-item> - <u-form-item label="鎵嬫満鍙�" labelWidth="20%" borderBottom prop="phone"> - <u--input border="none" v-model="model1.phone" placeholder="璇疯緭鍏ユ墜鏈哄彿"></u--input> + <u-form-item label="鎵嬫満鍙�" + labelWidth="20%" + borderBottom + prop="phone"> + <u--input border="none" + v-model="model1.phone" + placeholder="璇疯緭鍏ユ墜鏈哄彿"></u--input> </u-form-item> - <u-form-item label="瀵嗙爜" labelWidth="20%" borderBottom prop="password"> - <u--input border="none" v-model="model1.password" placeholder="璇疯緭鍏ュ瘑鐮�"></u--input> + <u-form-item label="瀵嗙爜" + labelWidth="20%" + borderBottom + prop="password"> + <u--input border="none" + v-model="model1.password" + placeholder="璇疯緭鍏ュ瘑鐮�"></u--input> </u-form-item> </u--form> </view> - <view class="submit-button"><u-button :text="userId ? '纭淇敼' : '纭鎻愪氦'" type="primary" @click="submitMsg"></u-button></view> + <view class="submit-button"><u-button :text="userId ? '纭淇敼' : '纭鎻愪氦'" + type="primary" + @click="submitMsg"></u-button></view> </view> </template> <script> -let url = 'http://192.168.31.14:9999'; -import qianTree from '@/components/qian-tree/qian-tree.vue'; -export default { - components: { - qianTree - }, - data() { - return { - department: [], - model1: { - departmentName: '', - idCard: '', - name: '', - phone: '', - password: '', - deptIds: '', - isHostUser: 1 - }, - tempdeptIds: '', - userId: '', - diffdeptId: '', - ismodifyDept: false, - rules: { - deptIds: { - type: 'string', - required: true, - message: '璇疯嚦灏戦�夋嫨涓�涓儴闂�', - trigger: ['blur', 'change'] - }, - idCard: { - type: 'string', - required: true, - message: '璇峰~鍐欒韩浠借瘉鍙风爜', - trigger: ['blur', 'change'] - }, - name: { - type: 'string', - required: true, - message: '璇峰~鍐欏鍚�', - trigger: ['blur', 'change'] - }, - phone: { - type: 'string', - required: true, - message: '璇峰~鍐欐墜鏈哄彿', - trigger: ['blur', 'change'] - }, - password: { - type: 'string', - required: true, - message: '璇峰~鍐欏瘑鐮�', - trigger: ['blur', 'change'] - } - }, - errorType: 'message' - }; - }, - onLoad(params) { - if (params.userId) { - this.userId = params.userId; - } - }, - onShow() { - if (this.userId) { - this.viewInfo(); - } - this.$refs.tkitree._hide(); - }, - onReady() { - this.$refs.uForm.setRules(this.rules); - }, - created() { - this.fetchTree(); - }, - methods: { - fetchTree() { - uni.request({ - url: `${url}/admin/dept/ownTree`, - header: { - Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'), - CLIENT_TOC: 'Y' - }, - success: res => { - this.department = res.data.data; - } - }); + let url = 'http://192.168.31.14:9999'; + import qianTree from '@/components/qian-tree/qian-tree.vue'; + import { BaseUrl } from '@/api/publicInterface.js' + export default { + components: { + qianTree }, - viewInfo(v) { - uni.showLoading({ - title: '鍔犺浇涓�' - }); - this.$reqGet('getAppById', { userId: this.userId.toString() }).then(res => { - uni.hideLoading(); - if (res.code == 0) { - this.tempdeptIds = res.data.deptIds; - if (res.data.deptIds == null) { - this.diffdeptId = '鍏ㄩ儴'; - } else { - this.diffdeptId = this.findNameById(this.department, res.data.deptIds.split(',')).join(); + data() { + return { + department: [], + model1: { + departmentName: '', + idCard: '', + name: '', + phone: '', + password: '', + deptIds: '', + isHostUser: 1 + }, + tempdeptIds: '', + userId: '', + diffdeptId: '', + ismodifyDept: false, + rules: { + deptIds: { + type: 'string', + required: true, + message: '璇疯嚦灏戦�夋嫨涓�涓儴闂�', + trigger: ['blur', 'change'] + }, + idCard: { + type: 'string', + required: true, + message: '璇峰~鍐欒韩浠借瘉鍙风爜', + trigger: ['blur', 'change'] + }, + name: { + type: 'string', + required: true, + message: '璇峰~鍐欏鍚�', + trigger: ['blur', 'change'] + }, + phone: { + type: 'string', + required: true, + message: '璇峰~鍐欐墜鏈哄彿', + trigger: ['blur', 'change'] + }, + password: { + type: 'string', + required: true, + message: '璇峰~鍐欏瘑鐮�', + trigger: ['blur', 'change'] } - this.model1 = { - ...res.data, - password: '', - deptIds: this.diffdeptId - }; - } else { - this.$u.toast('鍔犺浇澶辫触'); - } - }); + }, + errorType: 'message' + }; }, - treeOpen() { - this.$refs.tkitree._show(); - }, - treeClose() { - this.$refs.tkitree._hide(); - }, - treeChooseValue(v) { - this.$refs.tkitree._hide(); - this.model1.deptIds = this.findNameById(this.department, v).join(); - this.diffdeptId = v.join(); - this.ismodifyDept = true; - this.$refs.uForm.clearValidate('deptIds'); - }, - findNameById(tree, idArr) { - let result = []; - - function traverse(node, idArr) { - if (!node) return; - if (idArr.includes(node.id)) { - result.push(node.name); - } - if (node.children && node.children.length > 0) { - node.children.forEach(child => { - traverse(child, idArr); - }); - } + onLoad(params) { + if (params.userId) { + this.userId = params.userId; } - - tree.forEach(node => { - traverse(node, idArr); - }); - - return result; }, - submitMsg() { - this.$refs.uForm - .validate() - .then(res => { - if (this.userId) { - this.model1.deptIds = this.ismodifyDept ? this.diffdeptId : this.tempdeptIds; - this.$reqAllJson('appUpdateById', this.model1, { method: 'PUT', 'Content-type': 'application/json' }).then(res => { - if (res.code == 0) { - this.$u.toast('淇敼鎴愬姛'); - let timer = setTimeout(() => { - uni.navigateBack({ - delta: 1 - }); - }, 500); - } else { - this.$u.toast('淇敼澶辫触'); - } - }); - } else { + onShow() { + if (this.userId) { + this.viewInfo(); + } + this.$refs.tkitree._hide(); + }, + onReady() { + this.$refs.uForm.setRules(this.rules); + }, + created() { + this.fetchTree(); + }, + methods: { + fetchTree() { + uni.request({ + url: `${BaseUrl}/admin/dept/ownTree`, + header: { + Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'), + CLIENT_TOC: 'Y' + }, + success: res => { + this.department = res.data.data; + } + }); + }, + viewInfo(v) { + uni.showLoading({ + title: '鍔犺浇涓�' + }); + this.$reqGet('getAppById', { userId: this.userId.toString() }).then(res => { + uni.hideLoading(); + if (res.code == 0) { + this.tempdeptIds = res.data.deptIds; + if (res.data.deptIds == null) { + this.diffdeptId = '鍏ㄩ儴'; + } else { + this.diffdeptId = this.findNameById(this.department, res.data.deptIds.split(',')) + .join(); + } this.model1 = { - ...this.model1, + ...res.data, + password: '', deptIds: this.diffdeptId }; - this.$reqPost('appSave', this.model1, 'json').then(result => { - if (result.code == 0) { - this.$u.toast('鎻愪氦鎴愬姛'); - let timer = setTimeout(() => { - uni.navigateBack({ - delta: 1 - }); - }, 500); - } else { - this.$u.toast(result.msg ? result.msg : '鎻愪氦澶辫触'); - } + } else { + this.$u.toast('鍔犺浇澶辫触'); + } + }); + }, + treeOpen() { + this.$refs.tkitree._show(); + }, + treeClose() { + this.$refs.tkitree._hide(); + }, + treeChooseValue(v) { + this.$refs.tkitree._hide(); + this.model1.deptIds = this.findNameById(this.department, v).join(); + this.diffdeptId = v.join(); + this.ismodifyDept = true; + this.$refs.uForm.clearValidate('deptIds'); + }, + findNameById(tree, idArr) { + let result = []; + + function traverse(node, idArr) { + if (!node) return; + if (idArr.includes(node.id)) { + result.push(node.name); + } + if (node.children && node.children.length > 0) { + node.children.forEach(child => { + traverse(child, idArr); }); } - }) - .catch(error => { - console.log(error); + } + + tree.forEach(node => { + traverse(node, idArr); }); + + return result; + }, + submitMsg() { + this.$refs.uForm + .validate() + .then(res => { + if (this.userId) { + this.model1.deptIds = this.ismodifyDept ? this.diffdeptId : this.tempdeptIds; + this.$reqAllJson('appUpdateById', this + .model1, { method: 'PUT', 'Content-type': 'application/json' }).then(res => { + if (res.code == 0) { + this.$u.toast('淇敼鎴愬姛'); + let timer = setTimeout(() => { + uni.navigateBack({ + delta: 1 + }); + }, 500); + } else { + this.$u.toast('淇敼澶辫触'); + } + }); + } else { + this.model1 = { + ...this.model1, + deptIds: this.diffdeptId + }; + this.$reqPost('appSave', this.model1, 'json').then(result => { + if (result.code == 0) { + this.$u.toast('鎻愪氦鎴愬姛'); + let timer = setTimeout(() => { + uni.navigateBack({ + delta: 1 + }); + }, 500); + } else { + this.$u.toast(result.msg ? result.msg : '鎻愪氦澶辫触'); + } + }); + } + }) + .catch(error => { + console.log(error); + }); + } } - } -}; + }; </script> -<style lang="scss" scoped> -.main { - width: 100%; - &-block { - width: 94%; - margin: vww(15); - } - .submit-button { - position: relative; - bottom: vww(-20); - /deep/ .u-button { - width: 631rpx; - height: 74rpx; - border: 2px solid #3b56eb; - background-color: #fff; - color: #3b56eb; - border-radius: 37rpx 37rpx 37rpx 37rpx; +<style lang="scss" + scoped> + .main { + width: 100%; + + &-block { + width: 94%; + margin: vww(15); + } + + .submit-button { + position: relative; + bottom: vww(-20); + + /deep/ .u-button { + width: 631rpx; + height: 74rpx; + border: 2px solid #3b56eb; + background-color: #fff; + color: #3b56eb; + border-radius: 37rpx 37rpx 37rpx 37rpx; + } } } -} -</style> +</style> \ No newline at end of file diff --git a/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue b/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue index 7042ecc..6831ae7 100644 --- a/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue +++ b/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue @@ -242,7 +242,7 @@ return this.coalDetailsData.hair !== 0 || this.coalDetailsData.skin !== 0; }, isapproach() { - return this.currentPageCoalStatus <= 3; + return this.currentPageCoalStatus !== 3; } }, methods: { @@ -272,14 +272,12 @@ this.$reqGet('getCallOutList', this.getServiceOpenid).then(res => { console.log(res, '瀹㈡湇openid'); if (res.code != 0) { - this.$u.toast('鑾峰彇瀹㈡湇淇℃伅澶辫触'); + this.$u.toast(res.msg ? res.msg : '鑾峰彇瀹㈡湇淇℃伅澶辫触'); } else { - if (res.data.length > 0) { - this.serviceInfoObj.openId = res.data[0].openId; - this.serviceInfoObj.openName = res.data[0].openName; - uni.setStorageSync('customeropenId', this.serviceInfoObj.openId); - uni.setStorageSync('customerName', this.serviceInfoObj.openName); - } + this.serviceInfoObj.openId = res.data.openId; + this.serviceInfoObj.openName = res.data.openName; + uni.setStorageSync('customeropenId', this.serviceInfoObj.openId); + uni.setStorageSync('customerName', this.serviceInfoObj.openName); } }); }, @@ -411,7 +409,7 @@ nickname: uni.getStorageSync('customerName'), openid: uni.getStorageSync( 'customeropenId') - }, // 杩欓噷鐨刼penid鏄痜yy鐨勶紝鍏呭綋鍥哄畾鐨勫鏈峯penid + }, backgroundType: 2, roomType: 'voice', success() { diff --git a/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue b/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue index 064437c..ffe5e41 100644 --- a/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue +++ b/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue @@ -103,15 +103,36 @@ style="width: 100%;height: 40rpx;"></view> <view class="bottom-block"> <view class="block-main"> - <view class="main-information"> + <view class="main-information" + v-if="weighList.orderType=='杞叆'||weighList.orderType=='杞嚭'"> + <view class="prefix"> + 鍙戣揣鍦扮叅鍦�: + </view> + <view class="suffix"> + {{ weighList.filedName || '' }} + </view> + </view> + <view class="main-information" + v-if="weighList.orderType=='杞叆'||weighList.orderType=='杞嚭'"> + <view class="prefix"> + 鏀惰揣鍦扮叅鍦�: + </view> + <view class="suffix"> + {{ weighList.toFiledName || '' }} + </view> + </view> + <view class="main-information" + v-if="weighList.orderType!=='杞叆'||weighList.orderType!=='杞嚭'"> <view class="prefix">瀹㈡埛:</view> <view class="suffix">{{ weighList.customerName }}</view> </view> - <view class="main-information"> - <view class="prefix">鐭垮満锛�</view> + <view class="main-information" + v-if="weighList.orderType!=='杞叆'||weighList.orderType!=='杞嚭'"> + <view class="prefix">鐭垮満:</view> <view class="suffix">{{ weighList.deptName || '' }}</view> </view> - <view class="main-information"> + <view class="main-information" + v-if="weighList.orderType!=='杞叆'||weighList.orderType!=='杞嚭'"> <view class="prefix">鐓ゅ満:</view> <view class="suffix">{{ weighList.filedName || '' }}</view> </view> @@ -327,13 +348,17 @@ isEvacuation() { if (this.weighList.orderType == '澶栭攢' || this.weighList.orderType == '鍐呴攢' || this.weighList.orderType == '杞嚭') { - return this.weighList.skin == this.temporaryWeighObj.hair || this.temporaryWeighObj.skin == this + return (this.weighList.skin === 0 ? this.temporaryWeighObj.skin : this.weighList.skin) == this .temporaryWeighObj.hair; + // return this.weighList.skin == this.temporaryWeighObj.hair || this.temporaryWeighObj.skin == this + // .temporaryWeighObj.hair; } if (this.weighList.orderType == '澶栬喘' || this.weighList.orderType == '鍐呰喘' || this.weighList.orderType == '杞叆') { - return this.weighList.hair == this.temporaryWeighObj.skin || this.temporaryWeighObj.skin == this + return (this.weighList.hair === 0 ? this.temporaryWeighObj.skin : this.weighList.hair) == this .temporaryWeighObj.hair; + // return this.weighList.hair == this.temporaryWeighObj.skin || this.temporaryWeighObj.skin == this + // .temporaryWeighObj.hair; } }, sideline() { diff --git a/pages/login/login.vue b/pages/login/login.vue index d697aee..5d31eb0 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -12,6 +12,11 @@ type="primary" text="寰俊涓�閿櫥褰�"></u-button> </view> + <!-- <view class="loginBtn"> + <u-button @click.stop="jumpBindBack" + type="primary" + text="涓�閿粦瀹氭祴璇�"></u-button> + </view> --> <view class="register" @click="registerClick"><text>娉ㄥ唽</text></view> <view class="login-bottom-box"> @@ -160,6 +165,12 @@ uni.navigateTo({ url: '/pages/register/register' }); + }, + // 姝ゆ柟娉曞彧杩涜缁戝畾娴嬭瘯锛屽悗鏈熼�氳繃鎵爜瑙e喅 + jumpBindBack() { + uni.navigateTo({ + url: '/pages/bindBackground/bindBackground' + }) } } }; diff --git a/pages/public-page/message/message.vue b/pages/public-page/message/message.vue index 592a6e4..804d860 100644 --- a/pages/public-page/message/message.vue +++ b/pages/public-page/message/message.vue @@ -1,184 +1,222 @@ <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 @scroll="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 !== 1"></u-badge> - <u-cell size="large" :title="item.title" @click="messageDetails(item, index)"> - <u-parse :content="item.content" slot="label"></u-parse> + <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> + <view class="message-list"> + <u-list @scrolltolower="scrolltolower" + :height="1400"> + <u-list-item> + <u-swipe-action> + <u-swipe-action-item :options="options1" + :threshold="50" + v-for="(item, index) in messageList" + :key="item.id" + @click="deleteMsg(item, index)"> + <u-badge :isDot="true" + type="error" + v-if="item.status !== 1"></u-badge> + <u-cell size="large" + :title="item.title" + @click="messageDetails(item, index)"> + <u-parse :content="item.content" + slot="label"></u-parse> - <view class="prepose" slot="icon"><u-icon name="volume" color="#035CFB" size="40"></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 class="prepose" + slot="icon"><u-icon name="volume" + color="#035CFB" + size="40"></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> + </view> + <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: [ - { + export default { + data() { + return { + pageNum: 1, + pageSize: 10, + total: '', + messageList: [], + showMoreData: false, + options1: [{ text: '鍒犻櫎' - } - ], - show: false, - content: '鏄惁纭鍒犻櫎', - id: '', - index: '' - }; - }, - onShow() { - this.messageReq(); - }, - onHide() { - this.messageList = []; - this.pageNum = 1; - }, - methods: { - // 瑙﹀簳鍔犺浇 - scrolltolower() { - if (this.pageNum * this.pageSize >= this.total) return (this.showMoreData = true); - this.pageNum++; + }], + show: false, + content: '鏄惁纭鍒犻櫎', + id: '', + index: '' + }; + }, + onShow() { 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; - const regex = /<[^>]*>([^<]*)<\/[^>]*>/g; - - const solveHandle = v => { - const regex = /<[^>]*>([^<]*)<\/[^>]*>/g; - let result = v.replace(regex, (match, p1) => { - return p1.length > 8 ? p1.slice(0, 8) + '...' : p1; - }); - return result; - }; - if (this.pageNum > 1) { - this.messageList = this.messageList.concat(res.data.records); - this.messageList = this.messageList.map(v => { - return { - ...v, - content: solveHandle(v.content) - }; - }); - } else if (this.pageNum == 1) { - this.messageList = res.data.records; - this.messageList = this.messageList.map(v => { - return { - ...v, - content: solveHandle(v.content) - }; - }); - } - } else { - this.$u.toast('鍔犺浇澶辫触'); - } - }); + onHide() { + this.messageList = []; + this.pageNum = 1; }, - // 宸茶娑堟伅 - messageDetails(value, index) { - if (value.status == 0) { - this.$reqAllJson('readMessage', { id: value.id, status: value.status }, { method: 'PUT', 'Content-Type': 'application/json' }).then(res => { + 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.navigateTo({ - url: `/pages/public-page/messageDetails/messageDetails?messageId=${value.messageId}&id=${value.id}` - }); + uni.hideLoading(); + this.total = res.data.total; + + function removeTags(str) { + return str.replace(/<\/?[^>]+>/gi, ''); + } + if (this.pageNum > 1) { + this.messageList = this.messageList.concat(res.data.records); + this.messageList = this.messageList.map(v => { + return { + ...v, + title: v.title.slice(0, 8) + '...', + content: removeTags(v.content).trim().slice(0, 8) + '...' + }; + }); + } else if (this.pageNum == 1) { + this.messageList = res.data.records; + this.messageList = this.messageList.map(v => { + return { + ...v, + title: v.title.slice(0, 8) + '...', + content: removeTags(v.content).trim().slice(0, 8) + '...' + }; + }); + } + } else { + this.$u.toast('鍔犺浇澶辫触'); } }); - } else { - uni.navigateTo({ - url: `/pages/public-page/messageDetails/messageDetails?messageId=${value.messageId}&id=${value.id}` - }); - } - }, - // 鍒犻櫎娑堟伅 - 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); + }, + // 宸茶娑堟伅 + 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?messageId=${value.messageId}&id=${value.id}` + }); + } + }); } else { - this.$u.toast('鍒犻櫎澶辫触'); + uni.navigateTo({ + url: `/pages/public-page/messageDetails/messageDetails?messageId=${value.messageId}&id=${value.id}` + }); } - }); - }, - cancel() { - this.show = false; + }, + // 鍒犻櫎娑堟伅 + 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 = []; + this.pageNum = 1 + this.messageList = res.data.records; + }); + }, 800); + } else { + this.$u.toast('鍒犻櫎澶辫触'); + } + }); + }, + cancel() { + this.show = false; + } } - } -}; + }; </script> -<style lang="scss" scoped> -@mixin flex { - display: flex; - justify-content: center; - align-items: center; -} -::v-deep .u-list-item- { - position: relative; - .u-badge { - position: absolute; - left: vww(45); - top: vww(13); +<style lang="scss" + scoped> + @mixin flex { + display: flex; + justify-content: center; + align-items: center; } -} -::v-deep .u-cell__title-text { - height: 32rpx; - font-size: 34rpx !important; - font-weight: bold; - color: #2f2f2f !important; - margin-bottom: vww(18); -} -.message-body { - width: 100%; - height: 100%; - .prepose { - width: 89rpx; - height: 89rpx; - background: rgba(237, 240, 245, 0.75); - border-radius: 50%; - @include flex; - margin-right: vww(32); + + ::v-deep .u-list-item- { + position: relative; + + .u-badge { + position: absolute; + left: vww(45); + top: vww(13); + } } - .more-text { - color: #999; - font-size: 24rpx; - text-align: center; + + ::v-deep .u-cell__title-text { + height: 32rpx; + font-size: 34rpx !important; + font-weight: bold; + color: #2f2f2f !important; + margin-bottom: vww(18); } -} -</style> + + .message-body { + width: 100%; + height: 100%; + + .message-list { + margin: vww(5) 0; + } + + .prepose { + width: 89rpx; + height: 89rpx; + background: rgba(237, 240, 245, 0.75); + border-radius: 50%; + @include flex; + margin-right: vww(32); + } + + .more-text { + color: #999; + font-size: 24rpx; + text-align: center; + } + } +</style> \ No newline at end of file diff --git a/pages/public-page/messageDetails/messageDetails.vue b/pages/public-page/messageDetails/messageDetails.vue index a67ad5b..a54c670 100644 --- a/pages/public-page/messageDetails/messageDetails.vue +++ b/pages/public-page/messageDetails/messageDetails.vue @@ -1,37 +1,67 @@ <template> - <view> - <combined-title title="娑堟伅璇︽儏"></combined-title> - <u-parse :content="content" :lazyLoad="true" :selectable="true"></u-parse> + <view class="main"> + <view class="main-title"> + {{title}} + </view> + <u-divider text="杩欐槸涓�鏉″垎鍓茬嚎" + textColor="#2979ff" + lineColor="#2979ff" + textSize='20'></u-divider> + <view class="main-content"> + <u-parse :content="content" + :lazyLoad="true" + :selectable="true"></u-parse> + </view> </view> </template> <script> -export default { - data() { - return { - index: '', - detail: {}, - messageId: '', - id: '', - content: '' - }; - }, - onLoad(v) { - this.messageId = v.messageId; - this.id = v.id; - }, - onShow() { - this.getDetail(); - }, - methods: { - getDetail() { - this.$reqGet('getMsgDetail', { messageId: this.messageId, id: this.id }).then(res => { - this.detail = res.data; - this.content = this.detail.content; - }); + export default { + data() { + return { + index: '', + detail: {}, + messageId: '', + id: '', + content: '', + title: '' + }; + }, + onLoad(v) { + this.messageId = v.messageId; + this.id = v.id; + }, + onShow() { + this.getDetail(); + }, + methods: { + getDetail() { + this.$reqGet('getMsgDetail', { messageId: this.messageId, id: this.id }).then(res => { + this.detail = res.data; + this.content = this.detail.content; + this.title = this.detail.title; + }); + } } - } -}; + }; </script> -<style></style> +<style lang="scss" + scoped> + @mixin flex { + display: flex; + justify-content: center; + align-items: center; + } + + .main { + width: 100%; + height: 100%; + + .main-title, + .main-content { + width: 94%; + margin: vww(10) auto; + } + } +</style> \ No newline at end of file diff --git a/pages/tabbar-page/index-tabbar/index-tabbar.vue b/pages/tabbar-page/index-tabbar/index-tabbar.vue index 78d1d35..04a8ca5 100644 --- a/pages/tabbar-page/index-tabbar/index-tabbar.vue +++ b/pages/tabbar-page/index-tabbar/index-tabbar.vue @@ -29,7 +29,7 @@ :title="messageList.title" @confirm="messageconfirm" confirm-text="鍓嶅幓鏌ョ湅"> - <view class="slot-content"><rich-text :nodes="messageList.content"></rich-text></view> + <view class="slot-content"><u-parse :content="messageList.content"></u-parse></view> </u-modal> <!-- <view class="white-block"></view> --> </view> @@ -132,7 +132,10 @@ indexHistoryCoalData: [], indexdriverBillOfLoadingData: {}, messagePushShow: false, - messageList: {}, + messageList: { + title: '', + content: "", + }, isconnect: false, dotShow: false, appHide: false @@ -153,15 +156,26 @@ } } } else if (v.startsWith('msg')) { + function removeTags(str) { + return str.replace(/<\/?[^>]+>/gi, ''); + } this.messageList = JSON.parse(v.slice(5)); + this.messageList = { + ...this.messageList, + title: this.messageList.title.slice(0, 8) + '...', + content: removeTags(this.messageList.content).trim().slice(0, 8) + '...' + } this.messagePushShow = true; } else {} } }, onShow() { this.init(); - if (!this.globalisconnect) { + console.log(this.globalisconnect); + if (this.globalisconnect) { this.$store.dispatch('websocketInit') + this.changeisconnect(false) + console.log(this.globalisconnect, 'index鐨剋s蹇冧簨鈥�'); } this.userAuthorization(); this.messageReq(); diff --git a/store/index.js b/store/index.js index e420446..1ce1db3 100644 --- a/store/index.js +++ b/store/index.js @@ -72,7 +72,7 @@ weight: '', userId: '' }, - globalisconnect: false, + globalisconnect: true, globalisUploadimg: false, globalisLogin: false, socketTask: null, -- Gitblit v1.9.1