From 82a7eba143cc761b303b99889193f7aad2dc9d08 Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期一, 28 八月 2023 08:56:08 +0800 Subject: [PATCH] 修改bug,称重页面增加历史和异常原因填写 --- pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue | 95 ++++++ api/publicInterface.js | 17 pages/login/userPassword.vue | 227 +++++++------- pages/driver-page/drvier-my/drvier-my.vue | 134 +++++++- pages/login/login.vue | 2 pages/tabbar-page/index-tabbar/index-tabbar.vue | 19 pages/customer-page/customer-my/customer-my.vue | 89 +++++ pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue | 216 +++++++------ pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue | 5 pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock.vue | 8 api/request.js | 52 ++ pages/bindBackground/bindBackground.vue | 23 + pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue | 9 13 files changed, 618 insertions(+), 278 deletions(-) diff --git a/api/publicInterface.js b/api/publicInterface.js index dac4f12..13a7b23 100644 --- a/api/publicInterface.js +++ b/api/publicInterface.js @@ -3,10 +3,11 @@ import { BaseUrl as wrBaseUrl } from '@/api/request.js' -// const BaseUrl = 'http://192.168.31.14:9999' -const BaseUrl = 'https://mx.jzeg.cn:9095' -// const BaseUrl = 'http://192.168.31.18:9999' - +const BaseUrl = 'http://192.168.31.14:9999' +// const BaseUrl = 'https://mx.jzeg.cn:9096' +// const BaseUrl = 'http://192.168.31.18:9999' +// const BaseUrl = 'http://192.168.0.100:9999' +// const BaseUrl = 'http://192.168.0.108:9999' // 鐧诲綍 // function apiLogin({ // code @@ -58,7 +59,9 @@ idCard, carNo, carImg, - drivingImg + drivingImg, + vehicleColour, + bodyofcarJpg }) { uni.showLoading({ title: '鍔犺浇涓�...' }) return new Promise((resolve, reject) => { @@ -75,7 +78,9 @@ idCard, carNo, carImg, - drivingImg + drivingImg, + vehicleColour, + bodyofcarJpg }, header: { 'Authorization': 'Basic c29jaWFsOnNvY2lhbA==', //app:app diff --git a/api/request.js b/api/request.js index 661dcba..d1c1d26 100644 --- a/api/request.js +++ b/api/request.js @@ -1,13 +1,35 @@ import { globalApi } from '@/api/globalApi.js'; +import { + apiLoginPassword +} from './publicInterface'; // 鎴愬姛 const responseOK = (response) => { const { data } = response; + test(data); return data; +} +const test = (obj) => { + if (obj instanceof Array) { + obj.forEach(e => { + test(e); + }) + } else if (obj instanceof Object) { + for (let key in obj) { + if (obj[key] == null) { + obj[key] = ""; + } else { + if (obj[key] instanceof Array || obj[key] instanceof Object) { + test(obj[key]) + } + } + } + } + } // 鍝嶅簲澶辫触鐨勪緷璧栨�� @@ -78,16 +100,20 @@ 500: responseError } -// 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://192.168.0.106:9997"; -// const webSocketUrl = "ws://192.168.0.106:9997/wrzs/ws/info" -// // 绾夸笂鐢熶骇 -const BaseUrl = "https://mx.jzeg.cn:9095"; -const webSocketUrl = "wss://mx.jzeg.cn:9095/wrzs/ws/info" +// const BaseUrl = "http://localhost:9997"; +// const webSocketUrl = "ws://localhost:9997/wrzs/ws/info" +export const onlineurl = "https://mx.jzeg.cn:9096"; +// const BaseUrl = "http://192.168.0.100:9997"; +// const webSocketUrl = "ws://192.168.0.100:9997/wrzs/ws/info" + +// const BaseUrl = "http://192.168.0.108:9997"; +// const webSocketUrl = "ws://192.168.0.108:9997/wrzs/ws/info" +// 绾夸笂鐢熶骇 +// const BaseUrl = "https://mx.jzeg.cn:9096"; +// const webSocketUrl = "wss://mx.jzeg.cn:9096/wrzs/ws/info" // 璇锋眰鎷︽埅 @@ -116,9 +142,17 @@ return new Promise((resolve, reject) => { let options = {} + if (opt.data) { + Object.keys(opt.data).map(key => { + if (opt.data[key] == '' || opt.data[key] == "") { + opt.data[key] = null; + } + }); + } Object.keys(opt).map(key => { if (key !== "params") { + return options[key] = opt[key] } }) diff --git a/pages/bindBackground/bindBackground.vue b/pages/bindBackground/bindBackground.vue index 44b6d22..2d6eec6 100644 --- a/pages/bindBackground/bindBackground.vue +++ b/pages/bindBackground/bindBackground.vue @@ -46,6 +46,27 @@ } this.setUpWxOpenid(this.username, this.password, uni.getStorageSync('bindCode')) }, + getUserAuth() { + wx.getSetting({ + withSubscriptions: true, + success(res) { + if (res.subscriptionsSetting == null || res.subscriptionsSetting == undefined || + res.subscriptionsSetting.itemSettings == null || res.subscriptionsSetting + .itemSettings == undefined || res.subscriptionsSetting[ + "bvDqcHRRKEewTz7XVrdwUbrF6ZewSRmiUIB1V_IBJq4"] != 'accept') { + wx.requestSubscribeMessage({ + tmplIds: ['bvDqcHRRKEewTz7XVrdwUbrF6ZewSRmiUIB1V_IBJq4'], + success(res) { + console.log(res, '鑾峰彇璁㈤槄娑堟伅'); + }, + fail(e) { + console.log(e, '璁㈤槄娑堟伅澶辫触'); + } + }) + } + } + }) + }, setUpWxOpenid(userName, passWord, code) { uni.request({ url: `${BaseUrl}/admin/user/setUpWxOpenid`, @@ -62,6 +83,8 @@ console.log(res, '缁戝畾缁撴灉'); if (res.data.code === 1) { this.$u.toast(res.data.msg ? res.data.msg : '缁戝畾澶辫触') + } else { + this.$u.toast('鎿嶄綔鎴愬姛') } } }) diff --git a/pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue b/pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue index 4bf211f..e80422a 100644 --- a/pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue +++ b/pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue @@ -2,121 +2,137 @@ <!-- 娣诲姞璐т唬鎴栧徃鏈� --> <view class="addTo-freightForwarder-drvier"> <view class="addForm"> - <u--form labelPosition="top" ref="form1"> - <u-form-item labelWidth="20%" label="濮撳悕" ref="item1"><u--input v-model="name" :customStyle="{ border: '1px solid #dddddd' }"></u--input></u-form-item> - <u-form-item labelWidth="25%" label="鎵嬫満鍙�" ref="item1"><u--input v-model="phone" :customStyle="{ border: '1px solid #dddddd' }"></u--input></u-form-item> - <u-form-item labelWidth="25%" label="姹借溅杞︾墝鍙�" ref="item1" v-if="role == 2"> - <u--input v-model="carNo" :customStyle="{ border: '1px solid #dddddd' }"></u--input> + <u--form labelPosition="top" + ref="form1"> + <u-form-item labelWidth="20%" + label="濮撳悕" + ref="item1"><u--input v-model="name" + :customStyle="{ border: '1px solid #dddddd' }"></u--input></u-form-item> + <u-form-item labelWidth="25%" + label="鎵嬫満鍙�" + ref="item1"><u--input v-model="phone" + :customStyle="{ border: '1px solid #dddddd' }"></u--input></u-form-item> + <u-form-item labelWidth="25%" + label="姹借溅杞︾墝鍙�" + ref="item1" + v-if="role == 2"> + <u--input v-model="carNo" + :customStyle="{ border: '1px solid #dddddd' }"></u--input> </u-form-item> </u--form> </view> - <view class="addBtn"><u-button text="閭�璇�" type="primary" @click="addToHuoDaiOrDriver"></u-button></view> + <view class="addBtn"><u-button text="閭�璇�" + type="primary" + @click="addToHuoDaiOrDriver"></u-button></view> </view> </template> <script> -import { customerId } from '@/utils/status.js'; -import { mapMutations } from 'vuex'; -export default { - onLoad(params) { - this.role = params.role; - if (params.fleetId) { - this.fleetId = params.fleetId; - } - }, - data() { - return { - role: null, // 鍐冲畾娣诲姞璐т唬鍙告満锛岃繕鏄溅闃熷徃鏈� - fleetId: null, - name: '', - phone: '', - carNo: '', - customerId - }; - }, - methods: { - ...mapMutations(['lengthchange']), - init() {}, - addToHuoDaiOrDriver() { - switch (this.role) { - case '1': - if (this.name == '' || this.phone == '') { - uni.showToast({ - title: '璇疯鑼冭緭鍏ワ紒', - icon: 'error', - duration: 2000 - }); - } else { - this.bindHuoDai(); - } - break; - case '2': - if (this.name == '' || this.phone == '' || this.carNo == '') { - uni.showToast({ - title: '璇疯鑼冭緭鍏ワ紒', - icon: 'error', - duration: 2000 - }); - } else { - this.bindUserFleet(); - } - default: - break; + import { customerId } from '@/utils/status.js'; + import { mapMutations } from 'vuex'; + export default { + onLoad(params) { + this.role = params.role; + if (params.fleetId) { + this.fleetId = params.fleetId; } }, - // 閭�璇疯揣浠� - bindHuoDai() { - // this.$reqPost('bindHuoDai', { customerId: this.customerId, name: this.name, phone: this.phone }, 'params').then(res => { - this.$reqPost('bindHuoDai', { name: this.name, phone: this.phone }, 'params').then(res => { - if (res.code == 0) { - this.$u.toast('娣诲姞鎴愬姛'); - setTimeout(() => { + data() { + return { + role: null, // 鍐冲畾娣诲姞璐т唬鍙告満锛岃繕鏄溅闃熷徃鏈� + fleetId: null, + name: '', + phone: '', + carNo: '', + customerId + }; + }, + methods: { + ...mapMutations(['lengthchange']), + init() {}, + addToHuoDaiOrDriver() { + switch (this.role) { + case '1': + if (this.name == '' || this.phone == '') { + uni.showToast({ + title: '璇疯鑼冭緭鍏ワ紒', + icon: 'error', + duration: 2000 + }); + } else { + this.bindHuoDai(); + } + break; + case '2': + if (this.name == '' || this.phone == '' || this.carNo == '') { + uni.showToast({ + title: '璇疯鑼冭緭鍏ワ紒', + icon: 'error', + duration: 2000 + }); + } else { + this.bindUserFleet(); + } + default: + break; + } + }, + // 閭�璇疯揣浠� + bindHuoDai() { + // this.$reqPost('bindHuoDai', { customerId: this.customerId, name: this.name, phone: this.phone }, 'params').then(res => { + this.$reqPost('bindHuoDai', { name: this.name, phone: this.phone }, 'params').then(res => { + if (res.code == 0) { + this.$u.toast('娣诲姞鎴愬姛'); + setTimeout(() => { + uni.navigateBack({ + delta: 1 + }); + }, 1000); + } else { + this.$u.toast(res.msg ? res.msg : '鏈垚鍔熸坊鍔�'); + } + }); + }, + // 閭�璇峰徃鏈� + bindUserFleet() { + this.$reqPost('bindUserFleet', { fleetId: this.fleetId, name: this.name, phone: this.phone, carNo: this + .carNo }, 'params').then(res => { + console.log('閭�璇峰徃鏈�', res); + if (res.code == 0) { + this.$u.toast(res.msg ? res.msg : '鎿嶄綔鎴愬姛'); + this.$reqGet('GetUserFleet', { fleetId: this.fleetId }).then(response => { + this.lengthchange(response.data.length); + }); uni.navigateBack({ delta: 1 }); - }, 1000); - } else { - this.$u.toast(res.msg ? res.msg : '鏈垚鍔熸坊鍔�'); - } - }); - }, - // 閭�璇峰徃鏈� - bindUserFleet() { - this.$reqPost('bindUserFleet', { fleetId: this.fleetId, name: this.name, phone: this.phone, carNo: this.carNo }, 'params').then(res => { - console.log('閭�璇峰徃鏈�', res); - if (res.code == 0) { - this.$u.toast(res.msg ? res.msg : '鎿嶄綔鎴愬姛'); - this.$reqGet('GetUserFleet', { fleetId: this.fleetId }).then(response => { - this.lengthchange(response.data.length); - }); - uni.navigateBack({ - delta: 1 - }); - } else { - uni.showToast({ - title: res.msg ? res.msg : '鎿嶄綔澶辫触', - icon: 'null', - duration: 2000 - }); - } - }); + } else { + uni.showToast({ + title: res.msg ? res.msg : '鎿嶄綔澶辫触', + duration: 2000 + }); + } + }); + } } - } -}; + }; </script> -<style lang="scss" scoped> -::v-deep.addTo-freightForwarder-drvier { - width: 90%; - margin: 0 auto; - .addForm { - margin: 0 auto; - } - .addBtn { +<style lang="scss" + scoped> + ::v-deep.addTo-freightForwarder-drvier { width: 90%; - position: fixed; - bottom: vww(48); margin: 0 auto; + + .addForm { + margin: 0 auto; + } + + .addBtn { + width: 90%; + position: fixed; + bottom: vww(48); + margin: 0 auto; + } } -} -</style> +</style> \ No newline at end of file diff --git a/pages/customer-page/customer-my/customer-my.vue b/pages/customer-page/customer-my/customer-my.vue index a2d91a3..2a9bcf2 100644 --- a/pages/customer-page/customer-my/customer-my.vue +++ b/pages/customer-page/customer-my/customer-my.vue @@ -75,6 +75,12 @@ type="primary" @click="userManage" v-if="roleType == 1 && userEntity.isHostUser === '0'"></u-button></view> + <view class="logout"><u-button text="淇敼瀵嗙爜" + type="primary" + @click="modifyPwd"></u-button></view> + <view class="logout"><u-button text="閲嶇疆瀵嗙爜" + type="primary" + @click="initPwd"></u-button></view> <view class="logout"><u-button text="閫�鍑虹櫥褰�" type="primary" @click="logout()"></u-button></view> @@ -103,9 +109,6 @@ border="none" placeholder="璇疯緭鍏ヨ溅闃熷悕绉�"></u--input> </u-form-item> - <!-- <u-form-item label="杞︾墝" borderBottom ref="cars" labelWidth="80"> - <u--textarea maxlength="2000" v-model="addGroupForm.carNums" placeholder="璇疯緭鍏ヨ溅鐗�" height="150"></u--textarea> - </u-form-item> --> </u--form> </view> <view class="addCarButton"><u-button text="娣诲姞" @@ -138,7 +141,7 @@ <view class="slot-content"><rich-text :nodes="deleteFleetContent"></rich-text></view> </u-modal> </view> - + <!-- 閫�鍑虹櫥褰曞脊鍑烘 --> <view class="logoutModel"> <u-modal :show="logoutShow" :title="logoutTitle" @@ -146,6 +149,30 @@ :content="logoutContent" @confirm="logoutConfirm" @cancel="logoutCancel"></u-modal> + </view> + <!-- 閲嶇疆瀵嗙爜寮瑰嚭妗� --> + <view class="initPwdModal"> + <u-modal :show="initPwdShow" + title="閲嶇疆瀵嗙爜" + showCancelButton + content="鍒濆瀵嗙爜灏嗗彉鏇翠负123456,鏄惁纭閲嶇疆" + @confirm="initPwdConfirm" + @cancel="initPwdCancel"></u-modal> + </view> + <!-- 淇敼瀵嗙爜寮瑰嚭妗� --> + <view class="modifyPwdModal"> + <u-modal :show="modifyPwdShow" + title="淇敼瀵嗙爜" + showCancelButton + @confirm="modifyPwdConfirm" + @cancel="modifyPwdCancel"> + <view class="modifyPwd"> + <u-input v-model="passwordModified" + placeholder="璇疯緭鍏ヤ慨鏀瑰悗鐨勫瘑鐮�" + border="surround" + type="password"></u-input> + </view> + </u-modal> </view> </view> </template> @@ -185,7 +212,10 @@ logoutTitle: '鎻愮ず', logoutContent: '鏄惁纭閫�鍑�', // 鐢ㄦ埛淇℃伅瀵硅薄 - userEntity: {} + userEntity: {}, + initPwdShow: false, + modifyPwdShow: false, + passwordModified: '' }; }, computed: { @@ -355,6 +385,50 @@ url: `/pages/customer-page/fleet-management/fleet-management?id=${id}` }); }, + updateInfo() { + this.$reqPost('updateUser', this.userEntity, 'json').then(res => { + uni.hideLoading() + if (res.code == 0) { + uni.showToast({ + title: '閲嶇疆鎴愬姛', + duration: 2000, + icon: 'success' + }) + } else { + this.$u.toast(res.msg ? res.msg : '淇敼澶辫触'); + } + }).catch(err => { + this.$u.toast('淇敼澶辫触'); + }); + }, + initPwd() { + this.initPwdShow = true + }, + initPwdConfirm() { + this.initPwdShow = false + uni.showLoading({ + title: '鍔犺浇涓�' + }) + this.userEntity.password = '123456' + this.updateInfo() + }, + initPwdCancel() { + this.initPwdShow = false + }, + modifyPwd() { + this.modifyPwdShow = true + }, + modifyPwdConfirm() { + if (this.passwordModified.length === 0) { + return this.$u.toast('瀵嗙爜涓嶈兘涓虹┖') + } + this.modifyPwdShow = false + this.userEntity.password = this.passwordModified + this.updateInfo() + }, + modifyPwdCancel() { + this.modifyPwdShow = false + }, logout() { this.logoutShow = true; }, @@ -515,5 +589,10 @@ } } } + + .modifyPwd { + width: 100%; + border: 1rpx solid rgb(220, 223, 230); + } } </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 26d35ac..fae8472 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 @@ -142,7 +142,10 @@ this.overTmWaixiao = value.overTmWaixiao this.getWeightHouseObj.overTmWaixiao = value.overTmWaixiao } + }, + onShow() { this.init(); + }, data() { return { @@ -263,7 +266,7 @@ }); this.coalDayPage(); //鑾峰彇鏃ュ織 this.getTakeCoal(); //鑾峰彇鎻愮叅鍗曡鎯� - this.getgetService(); //鑾峰彇瀹㈡湇 + }, // 鑾峰彇瀹㈡湇openid getgetService() { @@ -333,6 +336,8 @@ }) } } + }).then(() => { + this.getgetService(); //鑾峰彇瀹㈡湇 }) }, // 鏃ュ織鏌ヨ @@ -399,7 +404,7 @@ } else { wx.join1v1Chat({ caller: { - nickname: uni.getStorageSync('name'), + nickname: uni.getStorageSync('username'), openid: uni.getStorageSync( 'openid') }, diff --git a/pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock.vue b/pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock.vue index e3521ea..d5a45e6 100644 --- a/pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock.vue +++ b/pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock.vue @@ -88,11 +88,9 @@ this.$u.toast('绛惧埌鎴愬姛'); setTimeout(() => { uni.navigateBack({ - delta: 1 - }, - 500 - ); - }); + delta: 1 + }); + }, 1000); } else { this.$u.toast(res.msg ? res.msg : '绛惧埌澶辫触'); } 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 90bfe6c..1ee26ca 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 @@ -528,7 +528,8 @@ sceneId: this.weighData.sceneId, carNo: this.weighData.carNo, tmId: this.weighData.tmId, - filedId: this.weighData.filedId + filedId: this.weighData.filedId, + equipmentCode: this.weighData.equipmentCode }, 'json').then(res => { if (res.code == 0) { this.$u.toast('鎿嶄綔鎴愬姛锛屽嵆灏嗚繑鍥炰笂涓�椤�'); @@ -592,7 +593,7 @@ this.tmTaskCoalList = res.data.tmTaskCoalList /** * @description true鐨勮瘽鏄笉寮傚父 false灏辨槸寮傚父 娌℃湁鍘嗗彶锛屽钩鍧囩毊閲嶄负0鏄涓�娆℃甯� */ - this.isAbnormalAvgSkin = (Array.isArray(this.tmTaskCoalList.length === 0) && this + this.isAbnormalAvgSkin = (Array.isArray(this.tmTaskCoalList) && this .tmTaskCoalList.length === 0 || !this.tmTaskCoalList) && this.avgSkin == 0 } else { uni.hideLoading() diff --git a/pages/driver-page/drvier-my/drvier-my.vue b/pages/driver-page/drvier-my/drvier-my.vue index fbe15ca..3ef0684 100644 --- a/pages/driver-page/drvier-my/drvier-my.vue +++ b/pages/driver-page/drvier-my/drvier-my.vue @@ -1,17 +1,31 @@ <template> <view class="driver-my"> - <view class="driver-banner"> - <view class="navgation">鎴戠殑</view> - <view class="avatar"> - <view class="avatar-imgage" - style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/driverava.png')no-repeat;background-size: cover;"> + <view class="" + style="height: 446rpx;width: 100%;"> + <view class="driver-banner"> + <view class="navgation">鎴戠殑</view> + <view class="avatar"> + <view class="avatar-imgage" + style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/driverava.png')no-repeat;background-size: cover;"> + </view> + <view class="avatar-name">{{ userInfo.name || '' }}</view> + <view class="edit-button"><u-button type="primary" + @click="editBtnClick" + shape="circle" + :disabled="userInfo.isRegister!==2" + plain>缂栬緫涓汉璧勬枡</u-button></view> </view> - <view class="avatar-name">{{ userInfo.name || '' }}</view> - <view class="edit-button"><u-button type="primary" - @click="editBtnClick" - shape="circle" - plain>缂栬緫涓汉璧勬枡</u-button></view> </view> + </view> + <view class="process-state"> + <view class="state-text"> + 瀹℃牳鐘舵�� + </view> + <u--text :type="userInfo.isRegister===0?'primary':userInfo.isRegister===1?'error':'success'" + :text="userInfo.isRegister===0?'寰呭鏍�':userInfo.isRegister===1?'鏈�氳繃':'宸插鏍�'" + size="32"></u--text> + </view> + <view class="information-block"> <view class="personal-information"> <view class="personal-information-block"> <view class="block-main"> @@ -111,6 +125,11 @@ </view> </view> <view class="loginout"> + <view class="loginout-main"><u-button text="閲嶇疆瀵嗙爜" + type="primary" + @click="initPwd" + shape="circle" + plain></u-button></view> <view class="loginout-main"><u-button text="閫�鍑虹櫥褰�" type="primary" @click="logout" @@ -148,6 +167,14 @@ prop="name" required> <u--input v-model="editUserInfo.name" + border="none" + inputAlign="left"></u--input> + </u-form-item> + <u-form-item labelWidth="20%" + label="瀵嗙爜" + prop="password" + required> + <u--input v-model="editUserInfo.password" border="none" inputAlign="left"></u--input> </u-form-item> @@ -238,11 +265,19 @@ @confirm="logoutConfirm" @cancel="logoutCancel"></u-modal> </view> + <view class="initPwdModal"> + <u-modal :show="initPwdShow" + title="閲嶇疆瀵嗙爜" + showCancelButton + content="鍒濆瀵嗙爜灏嗗彉鏇翠负123456,鏄惁纭閲嶇疆" + @confirm="initPwdConfirm" + @cancel="initPwdCancel"></u-modal> + </view> </view> </template> <script> - import { customerId, userInfo, redirectLogin } from '@/utils/status'; + import { redirectLogin } from '@/utils/status'; import { BaseUrl } from '@/api/publicInterface.js'; import { mapMutations } from 'vuex'; export default { @@ -262,7 +297,9 @@ drivingImg: '', axleNum: '', weight: '', - userId: '' + userId: '', + password: "", + isRegister: '' }, rules: { name: { @@ -359,7 +396,9 @@ logoutShow: false, logoutTitle: '鎻愮ず', logoutContent: '鏄惁纭閫�鍑�', - BaseUrl + BaseUrl, + initPwdShow: false + }; }, onShow() { @@ -397,6 +436,7 @@ this.editUserInfo[item] = res.data[item]; } }); + this.editUserInfo.password = '' }); }, // 淇敼鎸夐挳鐐瑰嚮 @@ -496,7 +536,8 @@ this.editUserInfo = { ...this.editUserInfo, carImg: uni.getStorageSync('carImg'), - drivingImg: uni.getStorageSync('drivingImg') + drivingImg: uni.getStorageSync('drivingImg'), + isRegister: 0 }; this.$refs.editRef .validate() @@ -519,6 +560,35 @@ .catch(err => { this.$u.toast('淇敼澶辫触'); }); + }, + initPwd() { + this.initPwdShow = true + }, + initPwdConfirm() { + this.initPwdShow = false + uni.showLoading({ + title: '鍔犺浇涓�...' + }); + this.editUserInfo.password = '123456'; + this.editUserInfo.carImg = uni.getStorageSync('carImg'); + this.editUserInfo.drivingImg = uni.getStorageSync('drivingImg') + this.$reqPost('updateUser', this.editUserInfo, 'json').then(res => { + uni.hideLoading() + if (res.code == 0) { + uni.showToast({ + title: '閲嶇疆鎴愬姛', + duration: 2000, + icon: 'success' + }) + } else { + this.$u.toast(res.msg ? res.msg : '淇敼澶辫触'); + } + }).catch(err => { + this.$u.toast('淇敼澶辫触'); + }); + }, + initPwdCancel() { + this.initPwdShow = false }, logout() { this.logoutShow = true; @@ -549,15 +619,11 @@ align-items: center; } - .statistics { - margin-top: vww(10); - margin-bottom: vww(10); - } ::v-deep.driver-my { width: 100%; margin: 0 auto; - padding-bottom: vww(60); + padding-bottom: vww(100); .driver-banner { width: 100%; @@ -610,13 +676,32 @@ top: vww(4); } } + } + + .process-state { + width: 300rpx; + height: 50rpx; + margin: 0 auto; + position: fixed; + top: 284rpx; + left: 37rpx; + display: flex; + align-items: center; + + .state-text { + margin-right: vww(6); + } + } + + .information-block { + width: 100%; .personal-information { width: 100%; display: flex; justify-content: center; position: relative; - top: vww(20); + top: vww(-30); &-block { width: 690rpx; @@ -676,7 +761,6 @@ .car-information { width: 100%; position: relative; - top: vww(410); @include flex justify-content: center; .information-main { @@ -720,11 +804,13 @@ .loginout { width: 100%; - height: 74rpx; + height: 200rpx; @include flex; - justify-content: center; + justify-content: space-around; + flex-direction: column; + align-items: center; position: relative; - bottom: vww(-430); + top: vww(20); .loginout-main { width: 84%; diff --git a/pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue b/pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue index 0930398..e3cbe92 100644 --- a/pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue +++ b/pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue @@ -75,6 +75,12 @@ <!-- <view class="statistics"><u-button text="鍙戣繍缁熻" type="primary" @click="statistics"></u-button></view> --> <view class="utils-button"> + <view class="utils"><u-button text="淇敼瀵嗙爜" + type="primary" + @click="modifyPwd"></u-button></view> + <view class="utils"><u-button text="閲嶇疆瀵嗙爜" + type="primary" + @click="initPwd"></u-button></view> <view class="utils"><u-button text="閫�鍑虹櫥褰�" type="primary" @click="logout"></u-button></view> @@ -99,6 +105,30 @@ :content="logoutContent" @confirm="logoutConfirm" @cancel="logoutCancel"></u-modal> + </view> + <!-- 閲嶇疆瀵嗙爜寮瑰嚭妗� --> + <view class="initPwdModal"> + <u-modal :show="initPwdShow" + title="閲嶇疆瀵嗙爜" + showCancelButton + content="鍒濆瀵嗙爜灏嗗彉鏇翠负123456,鏄惁纭閲嶇疆" + @confirm="initPwdConfirm" + @cancel="initPwdCancel"></u-modal> + </view> + <!-- 淇敼瀵嗙爜寮瑰嚭妗� --> + <view class="modifyPwdModal"> + <u-modal :show="modifyPwdShow" + title="淇敼瀵嗙爜" + showCancelButton + @confirm="modifyPwdConfirm" + @cancel="modifyPwdCancel"> + <view class="modifyPwd"> + <u-input v-model="passwordModified" + placeholder="璇疯緭鍏ヤ慨鏀瑰悗鐨勫瘑鐮�" + border="surround" + type="password"></u-input> + </view> + </u-modal> </view> </view> </template> @@ -126,15 +156,27 @@ // 閫�鍑烘ā鎬佹 logoutShow: false, logoutTitle: '鎻愮ず', - logoutContent: '鏄惁纭閫�鍑�' + logoutContent: '鏄惁纭閫�鍑�', + initPwdShow: false, + modifyPwdShow: false, + passwordModified: '', + // 鐢ㄦ埛淇℃伅瀵硅薄 + userEntity: {}, }; }, - onShow() { + onLoad() { this.init(); }, methods: { init() { this.getFleet(); + this.getUserEntity() + }, + // 鑾峰彇鐢ㄦ埛淇℃伅 + getUserEntity() { + this.$reqGet('getUserEntity').then(res => { + this.userEntity = res.data; + }); }, // 鑾峰彇杞﹂槦 getFleet() { @@ -204,6 +246,50 @@ uni.navigateTo({ url: `/pages/customer-page/fleet-management/fleet-management?id=${id}` }); + }, + updateInfo() { + this.$reqPost('updateUser', this.userEntity, 'json').then(res => { + uni.hideLoading() + if (res.code == 0) { + uni.showToast({ + title: '閲嶇疆鎴愬姛', + duration: 2000, + icon: 'success' + }) + } else { + this.$u.toast(res.msg ? res.msg : '淇敼澶辫触'); + } + }).catch(err => { + this.$u.toast('淇敼澶辫触'); + }); + }, + initPwd() { + this.initPwdShow = true + }, + initPwdConfirm() { + this.initPwdShow = false + uni.showLoading({ + title: '鍔犺浇涓�' + }) + this.userEntity.password = '123456' + this.updateInfo() + }, + initPwdCancel() { + this.initPwdShow = false + }, + modifyPwd() { + this.modifyPwdShow = true + }, + modifyPwdConfirm() { + if (this.passwordModified.length === 0) { + return this.$u.toast('瀵嗙爜涓嶈兘涓虹┖') + } + this.modifyPwdShow = false + this.userEntity.password = this.passwordModified + this.updateInfo() + }, + modifyPwdCancel() { + this.modifyPwdShow = false }, logout() { this.logoutShow = true; @@ -348,5 +434,10 @@ } } } + + .modifyPwd { + width: 100%; + border: 1rpx solid rgb(220, 223, 230); + } } </style> \ No newline at end of file diff --git a/pages/login/login.vue b/pages/login/login.vue index 62d395b..13aa2af 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -137,6 +137,7 @@ wx.request({ url: `https://api.weixin.qq.com/sns/jscode2session?appid=${this.appid}&secret=${this.secret}&js_code=${code}&grant_type=authorization_code`, success(res) { + console.log(res, 'openid'); uni.setStorageSync('openid', res.data.openid); // uni.showToast({ // title: '鎴愬姛鑾峰彇娴嬭瘯openid', @@ -157,6 +158,7 @@ this.$reqGet('getUserEntity').then(res => { this.setUserTabbar(res.data.type); uni.setStorageSync('roleType', res.data.type); + uni.setStorageSync("userId", res.data.userId) setCustomerId(res.data.customerid); uni.hideLoading(); //璺宠浆椤甸潰 diff --git a/pages/login/userPassword.vue b/pages/login/userPassword.vue index 036390e..b39078a 100644 --- a/pages/login/userPassword.vue +++ b/pages/login/userPassword.vue @@ -2,144 +2,145 @@ <view> <view class="list"> <view class="list-call"> - <u--input - v-model="username" + <u--input v-model="username" clearable maxlength="32" type="text" placeholder="璇疯緭鍏ユ墜鏈哄彿" prefixIcon="account" - prefixIconStyle="font-size: 22px;color: #909399" - ></u--input> + prefixIconStyle="font-size: 22px;color: #909399"></u--input> </view> <view class="list-call"> - <u--input - v-model="password" + <u--input v-model="password" clearable maxlength="32" type="password" placeholder="璇疯緭鍏ュ瘑鐮�" prefixIcon="lock" - prefixIconStyle="font-size: 22px;color: #909399" - ></u--input> + prefixIconStyle="font-size: 22px;color: #909399"></u--input> </view> </view> - <view class="loginBtn"><u-button type="primary" :text="btnText == 1 ? '缁戝畾' : '鐧诲綍'" @click="submit()"></u-button></view> + <view class="loginBtn"><u-button type="primary" + :text="btnText == 1 ? '缁戝畾' : '鐧诲綍'" + @click="submit()"></u-button></view> </view> </template> <script> -import { apiLoginPassword } from '@/api/publicInterface.js'; -import { mapMutations } from 'vuex'; -import { setName, setToken, setRefreshToken, setUsernameKey, setCustomerId, redirectHome } from '@/utils/status.js'; -export default { - name: 'userPassword', - props: { - //0:姝e父锛�1锛氬井淇$粦瀹� - btnText: { - type: Number, - default: 0 - } - }, - data() { - return { - username: '', // 瀹㈡埛 - // username:'13333333331',//璐т唬 - // username: '13333333332',// 鍙告満 - password: '', - remember: true, - baseUrl: '' - }; - }, - methods: { - ...mapMutations(['setUserTabbar']), - //鐧诲綍 - async submit() { - uni.showLoading({ - title: '鐧诲綍涓�...' - }); - //琛ㄥ崟鏍¢獙 - if (this.username.length === 0) { - this.$u.toast('璇疯緭鍏ヨ处鍙�'); - return; + import { apiLoginPassword } from '@/api/publicInterface.js'; + import { mapMutations } from 'vuex'; + import { setName, setToken, setRefreshToken, setUsernameKey, setCustomerId, redirectHome } from '@/utils/status.js'; + export default { + name: 'userPassword', + props: { + //0:姝e父锛�1锛氬井淇$粦瀹� + btnText: { + type: Number, + default: 0 } - if (this.password.length === 0) { - this.$u.toast('璇疯緭鍏ュ瘑鐮�'); - return; - } - let grant_type = 'password'; - //鐧诲綍鎺ュ彛 - await apiLoginPassword({ - username: this.username, - password: this.password, - grant_type, - scope: 'server' - }) - .then(res => { - setToken(res.access_token); - setRefreshToken(res.refresh_token); - if (this.btnText == 0) { - if (res.code != 1) { - // 鐧婚檰鎴愬姛锛屽瓨鍌ㄧ浉鍏充俊鎭� - setToken(res.access_token); - setRefreshToken(res.refresh_token); - setUsernameKey(res.username); - //鏌ヨ鐢ㄦ埛璇︾粏淇℃伅骞跺偍瀛� - this.$reqGet('getUserEntity') - .then(res => { - this.$u.toast('鐧诲綍鎴愬姛'); - this.setUserTabbar(res.data.type); - uni.setStorageSync('roleType', res.data.type); - setCustomerId(res.data.customerid); - setName(res.name); - uni.hideLoading(); - //璺宠浆椤甸潰 - this.$nextTick(() => { - redirectHome(); + }, + data() { + return { + username: '', // 瀹㈡埛 + // username:'13333333331',//璐т唬 + // username: '13333333332',// 鍙告満 + password: '', + remember: true, + baseUrl: '' + }; + }, + methods: { + ...mapMutations(['setUserTabbar']), + //鐧诲綍 + async submit() { + uni.showLoading({ + title: '鐧诲綍涓�...' + }); + //琛ㄥ崟鏍¢獙 + if (this.username.length === 0) { + this.$u.toast('璇疯緭鍏ヨ处鍙�'); + return; + } + if (this.password.length === 0) { + this.$u.toast('璇疯緭鍏ュ瘑鐮�'); + return; + } + let grant_type = 'password'; + //鐧诲綍鎺ュ彛 + await apiLoginPassword({ + username: this.username, + password: this.password, + grant_type, + scope: 'server' + }) + .then(res => { + setToken(res.access_token); + setRefreshToken(res.refresh_token); + if (this.btnText == 0) { + if (res.code != 1) { + // 鐧婚檰鎴愬姛锛屽瓨鍌ㄧ浉鍏充俊鎭� + setToken(res.access_token); + setRefreshToken(res.refresh_token); + setUsernameKey(res.username); + //鏌ヨ鐢ㄦ埛璇︾粏淇℃伅骞跺偍瀛� + this.$reqGet('getUserEntity') + .then(res => { + this.$u.toast('鐧诲綍鎴愬姛'); + this.setUserTabbar(res.data.type); + uni.setStorageSync('roleType', res.data.type); + uni.setStorageSync("userId", res.data.userId) + setCustomerId(res.data.customerid); + setName(res.name); + uni.hideLoading(); + //璺宠浆椤甸潰 + this.$nextTick(() => { + redirectHome(); + }); + }) + .catch(err => { + this.$u.toast('鐧诲綍寮傚父锛�'); + console.log(err); }); - }) - .catch(err => { - this.$u.toast('鐧诲綍寮傚父锛�'); - console.log(err); - }); - } else { - uni.hideLoading(); - this.$u.toast(res.msg); - } - } else { - uni.login({ - success: res => { - if (res.code) { - uni.setStorageSync('bindcode', res.code); - } - } - }); - if (uni.getStorageSync('bindcode')) { - this.$reqPost('wxBind', { state: 'MINI', code: uni.getStorageSync('bindcode') }, 'params').then(res => { + } else { uni.hideLoading(); - if (res.code == 0) { - this.$u.toast('缁戝畾鎴愬姛锛佸嵆灏嗗洖鍒扮櫥褰曢〉锛�'); - setTimeout(() => { - uni.navigateBack(); - }, 1000); - } else { - this.$u.toast(res.msg ? res.msg : '缁戝畾澶辫触'); + this.$u.toast(res.msg); + } + } else { + uni.login({ + success: res => { + if (res.code) { + uni.setStorageSync('bindcode', res.code); + } } }); + if (uni.getStorageSync('bindcode')) { + this.$reqPost('wxBind', { state: 'MINI', code: uni.getStorageSync('bindcode') }, + 'params').then(res => { + uni.hideLoading(); + if (res.code == 0) { + this.$u.toast('缁戝畾鎴愬姛锛佸嵆灏嗗洖鍒扮櫥褰曢〉锛�'); + setTimeout(() => { + uni.navigateBack(); + }, 1000); + } else { + this.$u.toast(res.msg ? res.msg : '缁戝畾澶辫触'); + } + }); + } } - } - }) - .catch(e => { - this.$u.toast(e); - }); + }) + .catch(e => { + this.$u.toast(e); + }); + } } - } -}; + }; </script> <style lang="scss"> -@import 'index.scss'; -.dengluBtn { - margin-top: 80rpx; -} -</style> + @import 'index.scss'; + + .dengluBtn { + margin-top: 80rpx; + } +</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 d97cb70..ca55d78 100644 --- a/pages/tabbar-page/index-tabbar/index-tabbar.vue +++ b/pages/tabbar-page/index-tabbar/index-tabbar.vue @@ -169,7 +169,9 @@ title: this.messageList.title.slice(0, 8) + '...', content: removeTags(this.messageList.content).trim().slice(0, 8) + '...' } - this.messagePushShow = true; + if (uni.getStorageSync('userId') === this.messageList.appUserId) { + this.messagePushShow = true; + } } else {} } }, @@ -235,29 +237,26 @@ userAuthorization() { wx.getSetting({ success(res) { - // wx.startRecord(); - console.log('鎺堟潈鐩告満/楹﹀厠椋庢潈闄恠uccess'); + console.log(res); if (!res.authSetting['scope.record'] || !res.authSetting['scope.camera']) { if (!res.authSetting['scope.camera']) { wx.authorize({ scope: 'scope.camera', success() { - // 鐢ㄦ埛宸茬粡鍚屾剰灏忕▼搴忎娇鐢ㄥ綍闊冲姛鑳斤紝鍚庣画璋冪敤 wx.startRecord 鎺ュ彛涓嶄細寮圭獥璇㈤棶 - console.log('鎺堟潈鎴愬姛'); + console.log('鐩告満鎴愬姛'); }, fail() { - console.log('鎺堟潈澶辫触'); + console.log('鐩告満澶辫触'); } }); } else if (!res.authSetting['scope.record']) { wx.authorize({ scope: 'scope.record', success() { - // 鐢ㄦ埛宸茬粡鍚屾剰灏忕▼搴忎娇鐢ㄥ綍闊冲姛鑳斤紝鍚庣画璋冪敤 wx.startRecord 鎺ュ彛涓嶄細寮圭獥璇㈤棶 - console.log('鎺堟潈鎴愬姛'); + console.log('褰曢煶鎴愬姛'); }, fail: () => { - console.log('鎺堟潈澶辫触'); + console.log('褰曢煶澶辫触'); } }); } @@ -265,7 +264,7 @@ }, fail() { console.log('鑾峰彇澶辫触'); - } + }, }); }, // 鍒濆鍖杦ebsocket -- Gitblit v1.9.1