| | |
| | | |
| | | |
| | | 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 |
| | |
| | | idCard, |
| | | carNo, |
| | | carImg, |
| | | drivingImg |
| | | drivingImg, |
| | | vehicleColour, |
| | | bodyofcarJpg |
| | | }) { |
| | | uni.showLoading({ title: '加载中...' }) |
| | | return new Promise((resolve, reject) => { |
| | |
| | | idCard, |
| | | carNo, |
| | | carImg, |
| | | drivingImg |
| | | drivingImg, |
| | | vehicleColour, |
| | | bodyofcarJpg |
| | | }, |
| | | header: { |
| | | 'Authorization': 'Basic c29jaWFsOnNvY2lhbA==', //app:app |
| | |
| | | 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]) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | // 响应失败的依赖性 |
| | |
| | | 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" |
| | | |
| | | |
| | | // 请求拦截 |
| | |
| | | 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] |
| | | } |
| | | }) |
| | |
| | | } |
| | | 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`, |
| | |
| | | console.log(res, '绑定结果'); |
| | | if (res.data.code === 1) { |
| | | this.$u.toast(res.data.msg ? res.data.msg : '绑定失败') |
| | | } else { |
| | | this.$u.toast('操作成功') |
| | | } |
| | | } |
| | | }) |
| | |
| | | <!-- 添加货代或司机 --> |
| | | <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> |
| | |
| | | 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> |
| | |
| | | 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="添加" |
| | |
| | | <view class="slot-content"><rich-text :nodes="deleteFleetContent"></rich-text></view> |
| | | </u-modal> |
| | | </view> |
| | | |
| | | <!-- 退出登录弹出框 --> |
| | | <view class="logoutModel"> |
| | | <u-modal :show="logoutShow" |
| | | :title="logoutTitle" |
| | |
| | | :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> |
| | |
| | | logoutTitle: '提示', |
| | | logoutContent: '是否确认退出', |
| | | // 用户信息对象 |
| | | userEntity: {} |
| | | userEntity: {}, |
| | | initPwdShow: false, |
| | | modifyPwdShow: false, |
| | | passwordModified: '' |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | 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; |
| | | }, |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | .modifyPwd { |
| | | width: 100%; |
| | | border: 1rpx solid rgb(220, 223, 230); |
| | | } |
| | | } |
| | | </style> |
| | |
| | | this.overTmWaixiao = value.overTmWaixiao |
| | | this.getWeightHouseObj.overTmWaixiao = value.overTmWaixiao |
| | | } |
| | | }, |
| | | onShow() { |
| | | this.init(); |
| | | |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | }); |
| | | this.coalDayPage(); //获取日志 |
| | | this.getTakeCoal(); //获取提煤单详情 |
| | | this.getgetService(); //获取客服 |
| | | |
| | | }, |
| | | // 获取客服openid |
| | | getgetService() { |
| | |
| | | }) |
| | | } |
| | | } |
| | | }).then(() => { |
| | | this.getgetService(); //获取客服 |
| | | }) |
| | | }, |
| | | // 日志查询 |
| | |
| | | } else { |
| | | wx.join1v1Chat({ |
| | | caller: { |
| | | nickname: uni.getStorageSync('name'), |
| | | nickname: uni.getStorageSync('username'), |
| | | openid: uni.getStorageSync( |
| | | 'openid') |
| | | }, |
| | |
| | | this.$u.toast('签到成功'); |
| | | setTimeout(() => { |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }, |
| | | 500 |
| | | ); |
| | | }); |
| | | delta: 1 |
| | | }); |
| | | }, 1000); |
| | | } else { |
| | | this.$u.toast(res.msg ? res.msg : '签到失败'); |
| | | } |
| | |
| | | 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('操作成功,即将返回上一页'); |
| | |
| | | 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() |
| | |
| | | <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"> |
| | |
| | | </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" |
| | |
| | | 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> |
| | |
| | | @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 { |
| | |
| | | drivingImg: '', |
| | | axleNum: '', |
| | | weight: '', |
| | | userId: '' |
| | | userId: '', |
| | | password: "", |
| | | isRegister: '' |
| | | }, |
| | | rules: { |
| | | name: { |
| | |
| | | logoutShow: false, |
| | | logoutTitle: '提示', |
| | | logoutContent: '是否确认退出', |
| | | BaseUrl |
| | | BaseUrl, |
| | | initPwdShow: false |
| | | |
| | | }; |
| | | }, |
| | | onShow() { |
| | |
| | | this.editUserInfo[item] = res.data[item]; |
| | | } |
| | | }); |
| | | this.editUserInfo.password = '' |
| | | }); |
| | | }, |
| | | // 修改按钮点击 |
| | |
| | | this.editUserInfo = { |
| | | ...this.editUserInfo, |
| | | carImg: uni.getStorageSync('carImg'), |
| | | drivingImg: uni.getStorageSync('drivingImg') |
| | | drivingImg: uni.getStorageSync('drivingImg'), |
| | | isRegister: 0 |
| | | }; |
| | | this.$refs.editRef |
| | | .validate() |
| | |
| | | .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; |
| | |
| | | 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%; |
| | |
| | | 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; |
| | |
| | | .car-information { |
| | | width: 100%; |
| | | position: relative; |
| | | top: vww(410); |
| | | @include flex justify-content: center; |
| | | |
| | | .information-main { |
| | |
| | | |
| | | .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%; |
| | |
| | | |
| | | <!-- <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> |
| | |
| | | :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> |
| | |
| | | // 退出模态框 |
| | | 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() { |
| | |
| | | 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; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | .modifyPwd { |
| | | width: 100%; |
| | | border: 1rpx solid rgb(220, 223, 230); |
| | | } |
| | | } |
| | | </style> |
| | |
| | | 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', |
| | |
| | | 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(); |
| | | //跳转页面 |
| | |
| | | <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:正常,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:正常,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> |
| | |
| | | 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 {} |
| | | } |
| | | }, |
| | |
| | | userAuthorization() { |
| | | wx.getSetting({ |
| | | success(res) { |
| | | // wx.startRecord(); |
| | | console.log('授权相机/麦克风权限success'); |
| | | 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('录音失败'); |
| | | } |
| | | }); |
| | | } |
| | |
| | | }, |
| | | fail() { |
| | | console.log('获取失败'); |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | // 初始化websocket |