|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onShow() { | 
|---|
|  |  |  | console.log('appvueZI显示'); | 
|---|
|  |  |  | console.log('appvue显示'); | 
|---|
|  |  |  | if (!this.globalisconnect && !this.globalisUploadimg) { | 
|---|
|  |  |  | this.$store.dispatch('websocketInit') | 
|---|
|  |  |  | this.changeisconnect(false); | 
|---|
|  |  |  | console.log('appvue的ws'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | 
|---|
|  |  |  | updateTmTaskCoalState: { | 
|---|
|  |  |  | url: '/wrzs/tmtaskcoal/updateTmTaskCoalState', | 
|---|
|  |  |  | method: 'POST' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | @description 后台用户绑定 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | setUpWxOpenid: { | 
|---|
|  |  |  | url: '/admin/user/setUpWxOpenid', | 
|---|
|  |  |  | method: 'POST' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | "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": [{ | 
|---|
|  |  |  | 
|---|
|  |  |  | }, { | 
|---|
|  |  |  | "path": "messageDetails/messageDetails", | 
|---|
|  |  |  | "style": { | 
|---|
|  |  |  | "navigationBarTitleText": "", | 
|---|
|  |  |  | "navigationBarTitleText": "消息详情", | 
|---|
|  |  |  | "enablePullDownRefresh": false | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | "enablePullDownRefresh": false | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }    ,{ | 
|---|
|  |  |  | "path" : "mapRoute/mapRoute", | 
|---|
|  |  |  | "style" : | 
|---|
|  |  |  | { | 
|---|
|  |  |  | "navigationBarTitleText": "", | 
|---|
|  |  |  | "enablePullDownRefresh": false | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ] | 
|---|
|  |  |  | }, { | 
|---|
|  |  |  | "path": "mapRoute/mapRoute", | 
|---|
|  |  |  | "style": { | 
|---|
|  |  |  | "navigationBarTitleText": "", | 
|---|
|  |  |  | "enablePullDownRefresh": false | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }] | 
|---|
|  |  |  | }, { | 
|---|
|  |  |  | "root": "pages/driver-page/appointment", | 
|---|
|  |  |  | "pages": [{ | 
|---|
|  |  |  | 
|---|
|  |  |  | "query": "" //启动参数,在页面的onLoad函数里面得到 | 
|---|
|  |  |  | }] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | <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> | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | .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; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | 
|---|
|  |  |  | return this.coalDetailsData.hair !== 0 || this.coalDetailsData.skin !== 0; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | isapproach() { | 
|---|
|  |  |  | return this.currentPageCoalStatus <= 3; | 
|---|
|  |  |  | return this.currentPageCoalStatus !== 3; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | nickname: uni.getStorageSync('customerName'), | 
|---|
|  |  |  | openid: uni.getStorageSync( | 
|---|
|  |  |  | 'customeropenId') | 
|---|
|  |  |  | }, // 这里的openid是fyy的,充当固定的客服openid | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | backgroundType: 2, | 
|---|
|  |  |  | roomType: 'voice', | 
|---|
|  |  |  | success() { | 
|---|
|  |  |  | 
|---|
|  |  |  | 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> | 
|---|
|  |  |  | 
|---|
|  |  |  | 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() { | 
|---|
|  |  |  | 
|---|
|  |  |  | 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"> | 
|---|
|  |  |  | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: '/pages/register/register' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 此方法只进行绑定测试,后期通过扫码解决 | 
|---|
|  |  |  | jumpBindBack() { | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: '/pages/bindBackground/bindBackground' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | 
|---|
|  |  |  | :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> | 
|---|
|  |  |  | 
|---|
|  |  |  | indexHistoryCoalData: [], | 
|---|
|  |  |  | indexdriverBillOfLoadingData: {}, | 
|---|
|  |  |  | messagePushShow: false, | 
|---|
|  |  |  | messageList: {}, | 
|---|
|  |  |  | messageList: { | 
|---|
|  |  |  | title: '', | 
|---|
|  |  |  | content: "", | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | isconnect: false, | 
|---|
|  |  |  | dotShow: false, | 
|---|
|  |  |  | appHide: false | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } 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的ws心事’'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.userAuthorization(); | 
|---|
|  |  |  | this.messageReq(); | 
|---|
|  |  |  | 
|---|
|  |  |  | weight: '', | 
|---|
|  |  |  | userId: '' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | globalisconnect: false, | 
|---|
|  |  |  | globalisconnect: true, | 
|---|
|  |  |  | globalisUploadimg: false, | 
|---|
|  |  |  | globalisLogin: false, | 
|---|
|  |  |  | socketTask: null, | 
|---|