Browse Source

首页对接接口

renmy 1 year ago
parent
commit
00bd722f06

+ 33 - 1
common/http.js

@@ -14,13 +14,45 @@ export function wxgetCode(params) {
 //登录
 export function wxLogin(params) {
     return new Promise((resolve, reject) => {
-        request.post("/user/login",params).then(result=>{
+        request.post("/mini/login",params).then(result=>{
             resolve(result)
         }).catch(err=>{
             reject(err)
         });
     })
 }
+//用户信息
+export function getInfoData(){
+	return request.get("/getInfo")
+}
+//首页-运维工单
+export function getOpsOrderOverview(stationCode){
+	return request.get("/mini/order/home/opsOrderOverview?stationCode=" + stationCode)
+}
+//首页-换电站供应商
+export function getStationOverview(){
+	return request.get("/mini/station/home/stationOverview")
+}
+//下拉框-获取权限内全部站点
+export function getHasStationCodeAndName(){
+	return request.get("/mini/station/hasStationCodeAndName")
+}
+//获取供货商列表
+export function getSupplierList(params){
+	return request.post("/mini/supplier/list",params)
+}
+//获取站点权限内用户下拉框
+export function getUserListByStationCode(stationCode){
+	return request.get("/system/user/getUserListByStationCode?stationCode=" + stationCode)
+}
+//工单上报
+export function addOrder(params){
+	return request.post("/mini/order/add",params)
+}
+
+
+
+
 //个人中心首页
 export function ucenterData(){
 	return request.post("/inquire/myData")

+ 1 - 1
common/request.js

@@ -21,7 +21,7 @@ export default {
 		
 		let users = storage.getJson("users");
 		let token = storage.getJson("token");
-		if(users != null && token != null){
+		if(token != null){
 			options.header = { "Authorization" : token };
 		}
 		this.console(options);

+ 1 - 1
config.js

@@ -1,6 +1,6 @@
 export default {
 	web_name: "智小狸",
-	uni_app_web_api_url: "https://zk.li-ai.com.cn/driver/api", //后端统一接口路径
+	uni_app_web_api_url: "http://localhost:8087/zl", //后端统一接口路径
 	web_socket_url:'wss://zk.li-ai.com.cn/driver/ws/',
 	// uni_app_web_api_url: "http://192.168.3.110:8088/driver/api",
 	// web_socket_url:'ws://192.168.3.110:8088/driver/ws/',

+ 334 - 357
pages/index/index.vue

@@ -1,12 +1,5 @@
 <template>
 	<view class="main-container">
-		<!-- <view class="navBarBox">
-			<view class="statusBar" :style="{ paddingTop: statusBarHeight + 'px' }"></view>
-			<view class="navBar">
-				<view class="navBar-title">首页</view>
-			</view>
-		</view> -->
-		<!-- <view class="place"></view> -->
 		<image class="set-bg" src="@/static/home_bg.png"></image>
 		<view class="page-content">
 			<view class="page-home-order-container">
@@ -26,7 +19,7 @@
 					<view class="page-home-order-item" @click="gotoOrder(0)">
 						<image class="page-home-order-img" src="@/static/home-order-second.png" mode=""></image>
 						<view class="page-home-order-name">
-							{{'待处理(' + noDeal + ')'}}
+							{{'待处理(' + pending + ')'}}
 						</view>
 						<view class="page-home-order-remark">
 							未完成的事项
@@ -35,7 +28,7 @@
 					<view class="page-home-order-item" @click="gotoOrder(2)">
 						<image class="page-home-order-img" src="@/static/home-order-third.png" mode=""></image>
 						<view class="page-home-order-name">
-							{{'已处理(' + noDeal + ')'}}
+							{{'已处理(' + closed + ')'}}
 						</view>
 						<view class="page-home-order-remark">
 							已完成可查看
@@ -44,7 +37,7 @@
 					<view class="page-home-order-item" @click="gotoOrder(1)">
 						<image class="page-home-order-img" src="@/static/home-order-four.png" mode=""></image>
 						<view class="page-home-order-name">
-							{{'未处理(' + noDeal + ')'}}
+							{{'未处理(' + notProcessed + ')'}}
 						</view>
 						<view class="page-home-order-remark">
 							已生成未处理工单
@@ -56,16 +49,16 @@
 				<view class="page-home-supplier-title">
 					换电站供应商
 				</view>
-				<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption">
-					<view class="page-home-supplier-items" v-for="(item,index) in stationDataVoList" :key="index" @click="gotoSupplier">
+				<!-- <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption"> -->
+					<view class="page-home-supplier-items" v-for="(item,index) in datalist" :key="index" @click="gotoSupplier(item)">
 						<view class="page-home-supplier-items-title">
 							{{item.stationName}}
 						</view>
 						<view class="page-home-supplier-number">
-							{{item.num}}
+							{{item.supCount}}
 						</view>
 					</view>
-				</mescroll-body>
+				<!-- </mescroll-body> -->
 			</view>
 		</view>
 		
@@ -80,78 +73,42 @@
 		mixins: [MescrollMixin],
 		data() {
 			return {
-				token: null,
-				userinfo: null,
-				// latitude: 29.632675, //纬度参数
-				// longitude: 106.569374, //经度参数
-				datalist: [],
-				current: 0,
-				params: {
-					lat: null,
-					lng: null,
-					page: 1,
-					pageSize: 10,
-					orderByWays: 'desc'
-				},
-				noData: null,
-				stationDataVoList: [
-					{stationName: '皋兰换电站', num: 2},
-					{stationName: '西安换电站', num: 3},
-					{stationName: '唐山换电站', num: 4},
-				],
-				isLoadAll: false,
-				totalPages: 0, // 总页数
-				upOption: {
-					page: {
-						size: 10,
-						num: 0,
-					},
-					noMoreSize: 1,
-					textNoMore: '没有更多了',
-					empty: {
-						use: true,
-						tip: "没有更多了",
-					}
-				},
-				noposition: null,
-				days: 0,
-				Authorize: false,
-				covers: [], //地图坐标数组
-				scale: 16,
-				Mapdetail:{},
-				// 状态栏高度
-				statusBarHeight: 0,
-				// 导航栏高度
-				navBarHeight: 82+11,
-				//商标名称
-				title: null,
-				//电话号码
-				phoneNum: '18580506017',
 				noDeal: 99,
-				
+				//工单信息数据对象
+				dataInfo: {},
+				//站点供应商数据列表
+				datalist: [],
+				//待处理
+				pending: 0,
+				//已完结
+				closed: 0,
+				//未处理
+				notProcessed: 0,
+				isLogin: '',
+			}
+		},
+		beforeCreate() {
+			let token = uni.getStorageSync('token')
+			if(!token) {
+				let url = '/pages/ucenter/index'
+				uni.navigateTo({
+					url: '/pages/public/login?topage=' + url
+				})
+			} else {
+				this.isLogin = token;
+				this.$http.getInfoData().then(response => {
+					this.$storage.setJson("user",response.user)
+				})
 			}
 		},
 		onShow() {
-			this.$store.dispatch("usersStatus").then(() => {
-				//微信用户第二次登录
-				this.token = this.$store.state.users.token
-				this.userinfo = this.$store.state.users
-				// this.getHomeCar()
-				// this.getUserDays()
-				// this.reloadList()
-				this.noData = null
-			}).catch(() => {
-				//微信用户首次登录
-				this.noData = '请先登录'
-			});
+			if(uni.getStorageSync('token')) {
+				this.getIndexOptionData();
+				this.getStationSupData();
+			}
 		},
 		onLoad() {
-			this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight'];
-			let systemInfoSync = uni.getSystemInfoSync();
-			this.screenHeight = systemInfoSync.screenHeight - 500;
-		},
-		mounted() {
-			// this.mapSelect()
+			
 		},
 		methods: {
 			//跳转工单上报
@@ -167,306 +124,326 @@
 				})
 			},
 			//跳转供应商页面
-			gotoSupplier() {
+			gotoSupplier(item) {
 				uni.navigateTo({
-					url: "/pages/index/supplier"
+					url: "/pages/index/supplier?stationCode=" + item.stationCode
 				})
 			},
-			//重新获取定位
-			resetPosition() {
-				this.mapSelect()
-			},
-			//点击搜索框
-			getInputFocus() {
-				uni.navigateTo({
-					url: '/pages/index/searchPage',
-					success: (res) => {
+			//获取首页工单信息数据
+			getIndexOptionData() {
+				this.dataInfo = {};
+				uni.showLoading({
+					title: '搜索中...',
+				})
+				this.$http.getOpsOrderOverview('').then(res => {
+					uni.hideLoading();
+					if(res.code == 200) {
+						let {pending, closed, notProcessed} = res.data
+						this.pending = pending;
+						this.closed = closed;
+						this.notProcessed = notProcessed;
+					} else {
+						this.$utils.msg(res.msg);
 					}
 				})
 			},
-			//拨打电话
-			toPhone() {
-				uni.makePhoneCall({
-					phoneNumber: this.phoneNum.toString(), //电话号码
+			//获取首页供应商数量信息
+			getStationSupData() {
+				this.datalist = [];
+				uni.showLoading({
+					title: '搜索中...',
 				})
-			},
-			//获取加入天数
-			getUserDays() {
-				this.$http.getDays().then(res => {
-					if (res.code === 0) {
-						this.days = res.data
+				this.$http.getStationOverview().then(res => {
+					uni.hideLoading();
+					if(res.code == 200) {
+						this.datalist = res.data || [];
 					} else {
 						this.$utils.msg(res.msg);
 					}
 				})
 			},
+			
+			
+			//重新获取定位
+			// resetPosition() {
+			// 	this.mapSelect()
+			// },
+			//获取加入天数
+			// getUserDays() {
+			// 	this.$http.getDays().then(res => {
+			// 		if (res.code === 0) {
+			// 			this.days = res.data
+			// 		} else {
+			// 			this.$utils.msg(res.msg);
+			// 		}
+			// 	})
+			// },
 			//拨打电话
-			makePhone(num) {
-				uni.makePhoneCall({
-					phoneNumber: num.toString(), //电话号码
-				})
-			},
-			reloadList() {
-				this.canReset && this.mescroll.resetUpScroll()
-				this.canReset && this.mescroll.scrollTo(0, 0)
-				this.canReset = true
-			},
-			//获取换电站信息
-			upCallback(page) {
-				if (this.Authorize == true) {
-					this.params.page = page.num
-					this.params.pageSize = page.size
-					this.$http.homeStation(this.params).then(res => {
-						uni.hideLoading();
-						if (res.code === 0) {
-							this.totalPages = res.data.total
-							if (page.num == 1) this.stationDataVoList = []
-							this.stationDataVoList = this.stationDataVoList.concat(res.data.list)
-							this.mescroll.endBySize(res.data.list.length, res.data.total);
+			// makePhone(num) {
+			// 	uni.makePhoneCall({
+			// 		phoneNumber: num.toString(), //电话号码
+			// 	})
+			// },
+			// reloadList() {
+			// 	this.canReset && this.mescroll.resetUpScroll()
+			// 	this.canReset && this.mescroll.scrollTo(0, 0)
+			// 	this.canReset = true
+			// },
+			// //获取换电站信息
+			// upCallback(page) {
+			// 	if (this.Authorize == true) {
+			// 		this.params.page = page.num
+			// 		this.params.pageSize = page.size
+			// 		this.$http.homeStation(this.params).then(res => {
+			// 			uni.hideLoading();
+			// 			if (res.code === 0) {
+			// 				this.totalPages = res.data.total
+			// 				if (page.num == 1) this.stationDataVoList = []
+			// 				this.stationDataVoList = this.stationDataVoList.concat(res.data.list)
+			// 				this.mescroll.endBySize(res.data.list.length, res.data.total);
 
-							this.scale = this.setMapZoomFunc(this.stationDataVoList[0].distance)
-							//地图撒点
-							let listArr = []
-							this.covers = this.stationDataVoList
-							this.covers.map(item => {
-								const obj = {
-									id: item.id,
-									width: 34,
-									height: 34,
-									callout:{
-										content: item.stationName,
-										 anchorY: 0,
-										 anchorX: 0,
-										 padding:5,
-										 borderRadius:5,
-										 // borderWidth:1,
-										 // borderColor:'#58be6b',
-										 display: 'BYCLICK',
-										 fontSize:16
-									},
-									// title: item.stationName,
-									//将经纬度进行重新赋值,不覆盖将默认latitude: 39.909,longitude: 116.39742,时地图移动到标点位置
-									latitude: item.lat,
-									longitude: item.lng,
-									iconPath: '/static/staIcon.png' //给每一个坐标添加图片
-								}
-								listArr.push(obj)
-							})
+			// 				//地图撒点
+			// 				let listArr = []
+			// 				this.covers = this.stationDataVoList
+			// 				this.covers.map(item => {
+			// 					const obj = {
+			// 						id: item.id,
+			// 						width: 34,
+			// 						height: 34,
+			// 						callout:{
+			// 							content: item.stationName,
+			// 							 anchorY: 0,
+			// 							 anchorX: 0,
+			// 							 padding:5,
+			// 							 borderRadius:5,
+			// 							 // borderWidth:1,
+			// 							 // borderColor:'#58be6b',
+			// 							 display: 'BYCLICK',
+			// 							 fontSize:16
+			// 						},
+			// 						// title: item.stationName,
+			// 						//将经纬度进行重新赋值,不覆盖将默认latitude: 39.909,longitude: 116.39742,时地图移动到标点位置
+			// 						latitude: item.lat,
+			// 						longitude: item.lng,
+			// 						iconPath: '/static/staIcon.png' //给每一个坐标添加图片
+			// 					}
+			// 					listArr.push(obj)
+			// 				})
 							
-							let minePotion = {
-								id: 10000,
-								width: 20,
-								height: 31,
-								latitude: this.params.lat,
-								longitude: this.params.lng,
-								iconPath: '/static/mine.png',//给每一个坐标添加图片
-								// callout:{
-								// 	content: '当前位置',
-								// 	 anchorY: 12,
-								// 	 anchorX: 20,
-								// 	 // display: 'ALWAYS',
-								// 	 display:'BYCLICK',
-								// 	 padding:5,
-								// 	 borderRadius:5,
-								// 	 color:'#FF0000'
-								// },
-							}
-							listArr.push(minePotion)
-							this.covers = listArr
-							this.covers[0].callout.display='ALWAYS'
-						} else {
-							this.$utils.msg(res.msg)
-							this.mescroll.endErr();
-						}
-					})
-				} else {
-					this.mescroll.endErr();
-				}
-			},
+			// 				let minePotion = {
+			// 					id: 10000,
+			// 					width: 20,
+			// 					height: 31,
+			// 					latitude: this.params.lat,
+			// 					longitude: this.params.lng,
+			// 					iconPath: '/static/mine.png',//给每一个坐标添加图片
+			// 					// callout:{
+			// 					// 	content: '当前位置',
+			// 					// 	 anchorY: 12,
+			// 					// 	 anchorX: 20,
+			// 					// 	 // display: 'ALWAYS',
+			// 					// 	 display:'BYCLICK',
+			// 					// 	 padding:5,
+			// 					// 	 borderRadius:5,
+			// 					// 	 color:'#FF0000'
+			// 					// },
+			// 				}
+			// 				listArr.push(minePotion)
+			// 				this.covers = listArr
+			// 				this.covers[0].callout.display='ALWAYS'
+			// 			} else {
+			// 				this.$utils.msg(res.msg)
+			// 				this.mescroll.endErr();
+			// 			}
+			// 		})
+			// 	} else {
+			// 		this.mescroll.endErr();
+			// 	}
+			// },
 			//获取车辆信息
-			getHomeCar() {
-				let params = {
-					page: 1,
-					pageSize: 10,
-					orderByWays: 'desc'
-				}
-				this.$http.homeCar(params).then(res => {
-					if (res.code === 0) {
-						if (res.data.length == 0) {
-							this.noData = '暂无记录'
-						} else {
-							this.datalist = res.data
-						}
-					} else {
-						this.$utils.msg(res.msg)
-					}
-				})
-			},
-			change(e) {
-				this.current = e.detail.current;
-			},
+			// getHomeCar() {
+			// 	let params = {
+			// 		page: 1,
+			// 		pageSize: 10,
+			// 		orderByWays: 'desc'
+			// 	}
+			// 	this.$http.homeCar(params).then(res => {
+			// 		if (res.code === 0) {
+			// 			if (res.data.length == 0) {
+			// 				this.noData = '暂无记录'
+			// 			} else {
+			// 				this.datalist = res.data
+			// 			}
+			// 		} else {
+			// 			this.$utils.msg(res.msg)
+			// 		}
+			// 	})
+			// },
+			// change(e) {
+			// 	this.current = e.detail.current;
+			// },
 			//打开地图导航
-			jumpmaps(lat, lng, address, name) {
-				if (lat && lng && address && name) {
-					uni.openLocation({
-						latitude: lat,
-						longitude: lng,
-						name: name,
-						address: address
-					})
-				} else {
-					this.$utils.msg("位置信息丢失");
-				}
-			},
+			// jumpmaps(lat, lng, address, name) {
+			// 	if (lat && lng && address && name) {
+			// 		uni.openLocation({
+			// 			latitude: lat,
+			// 			longitude: lng,
+			// 			name: name,
+			// 			address: address
+			// 		})
+			// 	} else {
+			// 		this.$utils.msg("位置信息丢失");
+			// 	}
+			// },
 			//获取用户经纬度
-			mapSelect() {
-				uni.showLoading({
-					title: '加载中'
-				});
-				const that = this
-				uni.getLocation({
-					type: 'gcj02',
-					isHighAccuracy: true,
-					success: function(res) {
-						that.params.lat = res.latitude
-						that.params.lng = res.longitude
-						that.Authorize = true
-						that.noposition = null
-						that.mescroll.resetUpScroll()
-						console.log(res, 'getLocation')
-					},
-					fail: () => {
-						uni.hideLoading();
-						that.noposition = '定位失败'
-						that.getMapLocation()
-						that.$utils.msg("定位失败")
-					},
-				})
-			},
+			// mapSelect() {
+			// 	uni.showLoading({
+			// 		title: '加载中'
+			// 	});
+			// 	const that = this
+			// 	uni.getLocation({
+			// 		type: 'gcj02',
+			// 		isHighAccuracy: true,
+			// 		success: function(res) {
+			// 			that.params.lat = res.latitude
+			// 			that.params.lng = res.longitude
+			// 			that.Authorize = true
+			// 			that.noposition = null
+			// 			that.mescroll.resetUpScroll()
+			// 			console.log(res, 'getLocation')
+			// 		},
+			// 		fail: () => {
+			// 			uni.hideLoading();
+			// 			that.noposition = '定位失败'
+			// 			that.getMapLocation()
+			// 			that.$utils.msg("定位失败")
+			// 		},
+			// 	})
+			// },
 			//提示用户打开位置信息
-			getMapLocation() {
-				uni.getSetting({
-					success: (res) => {
-						var status = res.authSetting
-						if (!status['scope.userLocation']) {
-							// 如果授权信息中没有地理位置的授权,则需要弹窗提示用户需要授权地理信息
-							uni.showModal({
-								title: '是否授权当前位置',
-								content: '需要获取您的地理位置,请确认授权,否则地图功能将无法使用',
-								success: (tip) => {
-									if (tip.confirm) {
-										// 如果用户同意授权地理信息,则打开授权设置页面,判断用户的操作
-										uni.openSetting({
-											success: (data) => {
-												// 如果用户授权了地理信息在,则提示授权成功
-												if (data.authSetting[
-														'scope.userLocation'] ===
-													true) {
-													uni.showToast({
-														title: '授权成功',
-														icon: 'success',
-														duration: 1000,
-													})
-													// 授权成功后,然后再次chooseLocation获取信息
-													this.mapSelect()
-												} else {
-													uni.hideLoading();
-													this.noposition = '授权失败'
-													this.Authorize = false
-												}
-											},
-										})
-									} else {
-										uni.hideLoading();
-										this.noposition = '授权失败'
-										this.Authorize = false
-									}
-								},
-							})
-						}
-						if (status['scope.userLocation'] === true && this.params.lat === null && this.params
-							.lng === null) {
-							uni.showToast({
-								title: '请开启您手机的位置信息!',
-								icon: 'none',
-								duration: 5000,
-							})
-						}
-					},
-					fail: (res) => {
-						uni.showToast({
-							title: '调用授权窗口失败',
-							icon: 'none',
-							duration: 1000,
-						})
-					},
-				})
-			},
+			// getMapLocation() {
+			// 	uni.getSetting({
+			// 		success: (res) => {
+			// 			var status = res.authSetting
+			// 			if (!status['scope.userLocation']) {
+			// 				// 如果授权信息中没有地理位置的授权,则需要弹窗提示用户需要授权地理信息
+			// 				uni.showModal({
+			// 					title: '是否授权当前位置',
+			// 					content: '需要获取您的地理位置,请确认授权,否则地图功能将无法使用',
+			// 					success: (tip) => {
+			// 						if (tip.confirm) {
+			// 							// 如果用户同意授权地理信息,则打开授权设置页面,判断用户的操作
+			// 							uni.openSetting({
+			// 								success: (data) => {
+			// 									// 如果用户授权了地理信息在,则提示授权成功
+			// 									if (data.authSetting[
+			// 											'scope.userLocation'] ===
+			// 										true) {
+			// 										uni.showToast({
+			// 											title: '授权成功',
+			// 											icon: 'success',
+			// 											duration: 1000,
+			// 										})
+			// 										// 授权成功后,然后再次chooseLocation获取信息
+			// 										this.mapSelect()
+			// 									} else {
+			// 										uni.hideLoading();
+			// 										this.noposition = '授权失败'
+			// 										this.Authorize = false
+			// 									}
+			// 								},
+			// 							})
+			// 						} else {
+			// 							uni.hideLoading();
+			// 							this.noposition = '授权失败'
+			// 							this.Authorize = false
+			// 						}
+			// 					},
+			// 				})
+			// 			}
+			// 			if (status['scope.userLocation'] === true && this.params.lat === null && this.params
+			// 				.lng === null) {
+			// 				uni.showToast({
+			// 					title: '请开启您手机的位置信息!',
+			// 					icon: 'none',
+			// 					duration: 5000,
+			// 				})
+			// 			}
+			// 		},
+			// 		fail: (res) => {
+			// 			uni.showToast({
+			// 				title: '调用授权窗口失败',
+			// 				icon: 'none',
+			// 				duration: 1000,
+			// 			})
+			// 		},
+			// 	})
+			// },
 			//获取描点的气泡内容
-			getStationMarker(e) {
-				console.log(e)
-				let clickmarkerId=e.detail.markerId
-				for (var i = 0; i < this.covers.length; i++) {
-					if(this.covers[i].id<10000){
-						this.covers[i].callout.display='BYCLICK'
-					}
-					if (this.covers[i].id == clickmarkerId && this.covers[i].id<10000) {
-						this.Mapdetail=this.covers[i]
-						this.Mapdetail.callout.display='ALWAYS'
-						console.log(this.Mapdetail,'Mapdetail')
-					}
-				}
-			},
+			// getStationMarker(e) {
+			// 	console.log(e)
+			// 	let clickmarkerId=e.detail.markerId
+			// 	for (var i = 0; i < this.covers.length; i++) {
+			// 		if(this.covers[i].id<10000){
+			// 			this.covers[i].callout.display='BYCLICK'
+			// 		}
+			// 		if (this.covers[i].id == clickmarkerId && this.covers[i].id<10000) {
+			// 			this.Mapdetail=this.covers[i]
+			// 			this.Mapdetail.callout.display='ALWAYS'
+			// 			console.log(this.Mapdetail,'Mapdetail')
+			// 		}
+			// 	}
+			// },
 			//计算我的位置到最近换电站的缩放比例
 			// 根据距离设置地图缩放级别 zoom是传过来的距离(m为单位)
 			// 返回的num是地图缩放的距离
-			setMapZoomFunc(zoom) {
-				let num = 16
-				zoom = Number(zoom)
-				if (0 < zoom && zoom <= 25) {
-					num = 18
-					return num;
-				} else if (25 < zoom && zoom <= 50) {
-					num = 17
-					return num;
-				} else if (50 < zoom && zoom <= 100) {
-					num = 16
-					return num;
-				} else if (100 < zoom && zoom <= 200) {
-					num = 15
-					return num;
-				} else if (200 < zoom && zoom <= 500) {
-					num = 14
-					return num;
-				} else if (500 < zoom && zoom <= 1000) {
-					num = 13
-					return num;
-				} else if (1000 < zoom && zoom <= 2000) {
-					num = 12
-					return num;
-				} else if (2000 < zoom && zoom <= 5000) {
-					num = 13
-					return num;
-				} else if (5000 < zoom && zoom <= 10000) {
-					num = 10
-					return num;
-				} else if (10000 < zoom && zoom <= 20000) {
-					num = 9
-					return num;
-				} else if (20000 < zoom && zoom <= 30000) {
-					num = 8
-					return num;
-				} else if (30000 < zoom && zoom <= 50000) {
-					num = 7
-					return num;
-				} else if (50000 < zoom && zoom <= 100000) {
-					num = 6
-					return num;
-				} else if (100000 < zoom && zoom <= 200000) {
-					num = 5
-					return num;
-				}
-			},
+			// setMapZoomFunc(zoom) {
+			// 	let num = 16
+			// 	zoom = Number(zoom)
+			// 	if (0 < zoom && zoom <= 25) {
+			// 		num = 18
+			// 		return num;
+			// 	} else if (25 < zoom && zoom <= 50) {
+			// 		num = 17
+			// 		return num;
+			// 	} else if (50 < zoom && zoom <= 100) {
+			// 		num = 16
+			// 		return num;
+			// 	} else if (100 < zoom && zoom <= 200) {
+			// 		num = 15
+			// 		return num;
+			// 	} else if (200 < zoom && zoom <= 500) {
+			// 		num = 14
+			// 		return num;
+			// 	} else if (500 < zoom && zoom <= 1000) {
+			// 		num = 13
+			// 		return num;
+			// 	} else if (1000 < zoom && zoom <= 2000) {
+			// 		num = 12
+			// 		return num;
+			// 	} else if (2000 < zoom && zoom <= 5000) {
+			// 		num = 13
+			// 		return num;
+			// 	} else if (5000 < zoom && zoom <= 10000) {
+			// 		num = 10
+			// 		return num;
+			// 	} else if (10000 < zoom && zoom <= 20000) {
+			// 		num = 9
+			// 		return num;
+			// 	} else if (20000 < zoom && zoom <= 30000) {
+			// 		num = 8
+			// 		return num;
+			// 	} else if (30000 < zoom && zoom <= 50000) {
+			// 		num = 7
+			// 		return num;
+			// 	} else if (50000 < zoom && zoom <= 100000) {
+			// 		num = 6
+			// 		return num;
+			// 	} else if (100000 < zoom && zoom <= 200000) {
+			// 		num = 5
+			// 		return num;
+			// 	}
+			// },
 		}
 	}
 </script>

+ 20 - 18
pages/index/order.vue

@@ -69,8 +69,6 @@
 			show: false,
 			siteList: [
 				{label: '全部站点', value: ''},
-				{label: '兰州皋兰站', value: '1'},
-				{label: '河北沧州站', value: '2'}
 			]
 	    }
 	  },
@@ -94,27 +92,17 @@
 		//页面显示
 		onShow() {
 	
+		},
+		mounted() {
+			this.getSites();
 		},
 		methods: {
 			// tabs通知swiper切换
 			tabsChange(index) {
 				console.log(index)
 				this.swiperCurrent = index;
-				let list = [
-					{name: '苹果', price: 3000, sb: '一类-化工', sl: 8},
-					{name: '苹果', price: 3000, sb: '一类-化工', sl: 8},
-					{name: '苹果', price: 3000, sb: '一类-化工', sl: 8},
-					{name: '苹果', price: 3000, sb: '一类-化工', sl: 8},
-					{name: '苹果', price: 3000, sb: '一类-化工', sl: 8},
-					{name: '苹果', price: 3000, sb: '一类-化工', sl: 8},
-					{name: '苹果', price: 3000, sb: '一类-化工', sl: 8},
-					{name: '苹果', price: 3000, sb: '一类-化工', sl: 8},
-					{name: '苹果', price: 3000, sb: '一类-化工', sl: 8},
-					{name: '苹果', price: 3000, sb: '一类-化工', sl: 8},
-					{name: '苹果', price: 3000, sb: '一类-化工', sl: 8},
-					{name: '苹果', price: 3000, sb: '一类-化工', sl: 8},
-				]
-				this.tabs[index].dataSet = this.tabs[index].dataSet.concat(list);
+				
+				// this.tabs[index].dataSet = this.tabs[index].dataSet.concat(list);
 			},
 			// swiper-item左右移动,通知tabs的滑块跟随移动
 			transition(e) {
@@ -144,7 +132,21 @@
 					url: '/pages/index/orderDetail?id=' + item.id
 				})
 			},
-			
+			//获取权限内所有站点列表
+			getSites() {
+				this.datalist = [];
+				uni.showLoading({
+					title: '搜索中...',
+				})
+				this.$http.getHasStationCodeAndName().then(res => {
+					uni.hideLoading();
+					if(res.code == 200) {
+						this.datalist = res.data || [];
+					} else {
+						this.$utils.msg(res.msg);
+					}
+				})
+			}
 		}	
 	}
 </script>

+ 208 - 59
pages/index/orderUp.vue

@@ -5,38 +5,40 @@
 			工单信息填写
 		</view>
 		<u-form :model="form" ref="uform" :rules="rules" label-align='left' label-width="150">
-			<u-form-item label="换电站名" prop="name">
-				<u-input type="select" :select-open="schoolSelectShow" placeholder="请选择换电站" v-model="form.name" @click="schoolSelectShow = true"/>
+			<u-form-item label="换电站名" prop="stationName">
+				<u-input type="select" :select-open="siteSelectShow" placeholder="请选择换电站" v-model="form.stationName" @click="siteSelectShow = true"/>
 			</u-form-item>
-			
-			<u-form-item label="设备名称" prop="intro">
-				<u-input v-model="form.intro" placeholder="请输入设备名称" />
+			<u-form-item label="设备名称" prop="deviceName">
+				<u-input v-model="form.deviceName" placeholder="请输入设备名称" />
 			</u-form-item>
-			<u-form-item label="设备编号" prop="intro">
-				<u-input v-model="form.intro" placeholder="请输入设备编号" />
+			<u-form-item label="设备编号" prop="sn">
+				<u-input v-model="form.sn" placeholder="请输入设备编号" />
 			</u-form-item>
-			<u-form-item label="故障等级" prop="intro">
-				<u-input type="select" :select-open="schoolSelectShow" placeholder="请选择故障等级" v-model="form.name" @click="schoolSelectShow = true"/>
+			<u-form-item label="故障等级" prop="levelText">
+				<u-input type="select" :select-open="levelSelectShow" placeholder="请选择故障等级" v-model="form.levelText" @click="levelSelectShow = true"/>
 			</u-form-item>
-			<u-form-item label="发生时间" prop="intro">
-				<u-input type="select" :select-open="show" placeholder="请选择发生时间" v-model="form.faultTime" @click="show = true"/>
+			<u-form-item label="发生时间" prop="occurrenceTime">
+				<u-input type="select" :select-open="show" placeholder="请选择发生时间" v-model="form.occurrenceTime" @click="show = true"/>
 			</u-form-item>
-			<u-form-item label="处理人员" prop="intro">
-				<u-input type="select" :select-open="show" placeholder="请选择处理人员" v-model="form.faultTime" @click="show = true"/>
+			<u-form-item label="处理人员" prop="nextPerson">
+				<u-input type="select" :select-open="showPerson" placeholder="请选择处理人员" v-model="form.nextPerson" @click="personHandle"/>
 			</u-form-item>
-			<u-form-item label="问题描述" prop="intro" :label-position="'top'">
-				<u-input placeholder="请输入问题描述 不超过15个字" :maxlength="15" v-model="form.faultTime" />
+			<u-form-item label="问题描述" prop="problemTitle" :label-position="'top'">
+				<u-input placeholder="请输入问题描述 不超过15个字" :maxlength="15" v-model="form.problemTitle" />
 			</u-form-item>
-			<u-form-item label="问题记录" prop="intro" :label-position="'top'">
-				<u-input type="textarea" placeholder="请输入问题记录 不超过200个字" :maxlength="200" v-model="form.faultTime" />
+			<u-form-item label="问题记录" prop="deviceProblem" :label-position="'top'">
+				<u-input type="textarea" placeholder="请输入问题记录 不超过200个字" :maxlength="200" v-model="form.deviceProblem" />
 			</u-form-item>
-			<u-form-item label="问题记录" prop="intro" :label-position="'top'">
-				<u-upload :action="action" :file-list="fileList" ></u-upload>
+			<u-form-item label="问题图片(不超过5张,5M以内)" prop="intro" :label-position="'top'">
+				<u-upload action="http://localhost:8087/zl/business/file/upload" multiple :fileList="fileList" @afterRead="afterRead" @delete="deletePic" name="1" :maxCount="5"></u-upload>
 			</u-form-item>
 		</u-form>
-		<u-select :list="schoolSelectList" v-model="schoolSelectShow" @confirm="schoolSelectCallback"> </u-select>
+		<u-select :list="siteSelectList" v-model="siteSelectShow" value-name="stationCode" label-name="stationName" @confirm="siteSelectCallback"> </u-select>
+		<u-select :list="levelSelectList" v-model="levelSelectShow" @confirm="levelSelectCallback"> </u-select>
+		<u-select :list="personSelectList" v-model="showPerson" value-name="userId" label-name="nickName" @confirm="personSelectCallback"> </u-select>
+		
 		<u-picker v-model="show" mode="time" :params="params" end-year="2050" :defaultTime="defaultTime" @confirm="timeHandle"></u-picker>
-		<u-button type="primary" class="commit-button" @click="submiHandle">上  报</u-button>
+		<u-button type="primary" class="commit-button" @click="submiHandle" :disabled="isClick">上  报</u-button>
 	</view>
 </template>
 
@@ -46,9 +48,19 @@
 			return {
 				//表单对象
 				form: {
-					name: '',
-					intro: '',
-					faultTime: '',
+					id: null,
+					stationName: null,
+					stationCode: null,
+					deviceName: null,
+					sn: null,
+					level: null,
+					levelText: null,
+					occurrenceTime: null,
+					nextPerson: null,
+					nextId: null,
+					source: 99,
+					problemTitle: null,
+					deviceProblem: null,
 				},
 				//时间picker 默认值
 				params: {
@@ -70,37 +82,69 @@
 				show: false,
 				//验证规则对象
 				rules: {
-					name: [
+					stationName: [
 						{ 
 							required: true, 
-							message: '请输入姓名', 
+							message: '请选择站点', 
 							// 可以单个或者同时写两个触发验证方式 
 							trigger: ['change','blur'],
 						}
 					],
-					intro: [
+					deviceName: [
+						{
+							// min: 5, 
+							// message: '简介不能少于5个字', 
+							trigger: ['change','blur'],
+							message: '请选择输入设备名称',
+							required: true, 
+						}
+					],
+					sn: [
 						{
-							min: 5, 
-							message: '简介不能少于5个字', 
-							trigger: 'blur',
+							// min: 5, 
+							// message: '简介不能少于5个字', 
+							trigger: ['change','blur'],
+							message: '请选择输入设备编号',
+							required: true, 
+						}
+					],
+					levelText: 
+					[
+						{ 
 							required: true, 
+							message: '请选择故障等级', 
+							trigger: ['change','blur'],
+						}
+					],
+					occurrenceTime: [
+						{ 
+							required: true, 
+							message: '请选择发生时间', 
+							trigger: ['change','blur'],
+						}
+					],
+					problemTitle: [
+						{ 
+							required: true, 
+							message: '请输入问题描述', 
+							trigger: ['change','blur'],
 						}
-					]
+					],
 				},
-				schoolSelectShow: false,
-				schoolSelectList: [{
-						value: 3,
-						label: '第三中学'
-					},
-					{
-						value: 6,
-						label: '第六中学'
-					},
-					{
-						value: 9,
-						label: '第九中学'
-					}
-				],
+				//是否显示站点弹窗
+				siteSelectShow: false,
+				//站点列表
+				siteSelectList: [],
+				//是否显示等级弹窗
+				levelSelectShow: false,
+				//等级列表
+				levelSelectList: [{label: '一级', value: 1},{label: '二级', value: 2},{label: '三级', value: 3}],
+				//是否显示人员选择
+				showPerson: false,
+				//人员列表
+				personSelectList: [],
+				//是否禁用
+				isClick: false,
 			}
 		},
 		computed: {
@@ -125,33 +169,138 @@
 		onReady() {
 		  this.$refs.uform.setRules(this.rules);
 		},
+		mounted() {
+			this.getSites();
+		},
 		methods: {
-			//选择框确定按钮
-			schoolSelectCallback(e) { // 拿到选中的索引值
+			//获取站点列表
+			getSites() {
+				this.datalist = [];
+				this.$http.getHasStationCodeAndName().then(res => {
+					uni.hideLoading();
+					if(res.code == 200) {
+						this.siteSelectList = res.data || [];
+					} else {
+						this.$utils.msg(res.msg);
+					}
+				})
+			},
+			//等级选择
+			levelSelectCallback(e) {
+				uni.hideKeyboard();
+				this.form.level = e[0].value;
+				this.form.levelText = e[0].label;
+			},
+			//选择站点框确定按钮
+			siteSelectCallback(e) { // 拿到选中的索引值
+				uni.hideKeyboard();
+				this.form.stationName = e[0].label;
+				this.form.stationCode = e[0].value;
+				this.getPersons(e[0].value);
+			},
+			//人员选择
+			personSelectCallback(e) {
 				uni.hideKeyboard();
-				this.form.name = e[0].label;
+				this.form.nextId = e[0].value;
+				this.form.nextPerson = e[0].label;
 			},
 			//时间选择
 			timeHandle(data) {
-				this.form.faultTime = data.year + '-' + data.month + '-' + data.day + ' ' + data.hour + ':' + data.minute;
+				this.form.occurrenceTime = data.year + '-' + data.month + '-' + data.day + ' ' + data.hour + ':' + data.minute + ':00';
+			},
+			//打开人员选择
+			personHandle() {
+				if(!this.form.stationCode) {
+					return uni.showToast({
+						title: '请先选择站点'
+					})
+				}
+				this.showPerson = true;
+			},
+			//获取站点下的人员列表
+			getPersons(code) {
+				this.personSelectList = [];
+				this.$http.getUserListByStationCode(code).then(res => {
+					uni.hideLoading();
+					if(res.code == 200) {
+						this.personSelectList = res.data || [];
+					} else {
+						this.$utils.msg(res.msg);
+					}
+				})
 			},
 			//提交
 			submiHandle() {
+				this.isClick = true;
 				this.$refs.uform.validate(valid => {
-					if (valid) {
-					    uni.showToast({
-					    	title: '11'
-					    })
+					if (!valid) {
+						this.isClick = false;
 						return
-					} else {
-						console.log("验证失败");
-						return;
-						console.log("验证通过");
-						   this.saveForm();    // 这里调用你保存数据的接口
-						   return;
 					}
+					this.$http.addOrder(this.form).then(res => {
+						this.isClick = false;
+						if(res.code == 200) {
+							uni.showToast({
+								title: '上报成功',
+								icon: 'success',
+								duration: 1000
+							})
+							setTimeout(() => {
+								uni.navigateBack();
+							}, 1000);
+						} else {
+							this.$utils.msg(res.msg);
+						}
+					})
 				});
 			},
+			// 删除图片
+			deletePic(event) {
+				this[`fileList${event.name}`].splice(event.index, 1)
+			},
+			// 新增图片
+			async afterRead(event) {
+				console.log(this.fileList, '3333')
+				// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
+				let lists = [].concat(event.file)
+				let fileListLen = this[`fileList${event.name}`].length
+				lists.map((item) => {
+					this[`fileList${event.name}`].push({
+						...item,
+						status: 'uploading',
+						message: '上传中'
+					})
+				})
+				for (let i = 0; i < lists.length; i++) {
+					const result = await this.uploadFilePromise(lists[i].url)
+					console.log(result, 'result')
+					let item = this[`fileList${event.name}`][fileListLen]
+					console.log(item, 'item')
+					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
+						status: 'success',
+						message: '',
+						url: result
+					}))
+					fileListLen++
+				}
+			},
+			uploadFilePromise(url) {
+				return new Promise((resolve, reject) => {
+					let a = uni.uploadFile({
+						url: 'http://localhost:8087/zl/business/file/upload', // 仅为示例,非真实的接口地址
+						filePath: url,
+						name: 'file',
+						formData: {
+							user: 'test'
+						},
+						success: (res) => {
+							setTimeout(() => {
+								resolve(res.data.data)
+							}, 1000)
+						}
+					});
+				})
+			},
 		}
 	}
 </script>

+ 30 - 7
pages/index/supplier.vue

@@ -3,14 +3,14 @@
 		<view class="supplier-info" v-for="(item, index) in dataList" :key="index" @click="gotoSupplierDetail(item)">
 			<view class="supplier-title">
 				<view class="supplier-title-text">
-					皋兰五金门店
+					{{item.name || '-'}}
 				</view>
 				<view class="supplier-title-contacts">
-					张三
+					{{item.contactName || '-'}}
 				</view>
 			</view>
 			<view class="supplier-tel">
-				18022222222
+				{{item.contactPhone || '-'}}
 			</view>
 		</view>
 	</view>
@@ -20,12 +20,17 @@
 	export default {
 	  data() {
 	    return {
-			dataList: [[],[],[],[],[]]
+			//列表数据
+			dataList: [],
+			//查询条件
+			param: {
+				stationCode: null,
+			}
 	    }
 	  },
 		//第一次加载
 		onLoad(e) {
-			  
+			this.param.stationCode = e.stationCode  
 		},
 	   onReady() {
 	        
@@ -33,14 +38,32 @@
 		//页面显示
 		onShow() {
 	
+		},
+		mounted() {
+			this.getSupplierListData();
 		},
 		methods: {
 			//跳转详情页
 			gotoSupplierDetail(item) {
 				uni.navigateTo({
-					url: '/pages/index/supplierDetail',
+					url: '/pages/index/supplierDetail?dataInfo=' + encodeURIComponent(JSON.stringify(item)),
 				})
-			}
+			},
+			//获取站点内供货商的列表
+			getSupplierListData() {
+				this.dataList = [];
+				uni.showLoading({
+					title: '搜索中...',
+				})
+				this.$http.getSupplierList(this.param).then(res => {
+					uni.hideLoading();
+					if(res.code == 200) {
+						this.dataList = res.data.list || [];
+					} else {
+						this.$utils.msg(res.msg);
+					}
+				})
+			},
 		}	
 	}
 </script>

+ 30 - 13
pages/index/supplierDetail.vue

@@ -3,36 +3,36 @@
 		<view class="supp-detail-info">
 			<view class="supplier-detail-title">
 				<view class="supplier-detail-title-text">
-					皋兰五金门店
+					{{detailData.name || '-'}}
 				</view>
 				<view class="supplier-detail-title-contacts">
-					张三
+					{{detailData.contactName || '-'}}
 				</view>
 			</view>
 			<view class="supplier-detail-tel">
-				18022222222
+				{{detailData.contactPhone || '-'}}
 			</view>
 		</view>
 		<view class="supplier-detail-basic">
 			<view class="supplier-detail-telphone" @click="makeOhoneHandle">
 				<u-icon name="phone"></u-icon>
-				<span style="margin-left: 10rpx;">18580506017</span>
+				<span style="margin-left: 10rpx;">{{detailData.contactPhone || '-'}}</span>
 			</view>
 			<view class="supplier-detail-address" @click="getLocalHandle">
 				<u-icon name="map"></u-icon>
-				<span style="margin-left: 10rpx;">重庆市渝北区汇流路美联广场15-2</span>
+				<span style="margin-left: 10rpx;">{{detailData.address || '-'}}</span>
 			</view>
 			<view class="supp-detail-scope-title">
 				供应范围
 			</view>
 			<view class="supp-detail-scope-text">
-				什么都有、什么都有、什么都有、什么都有、什么都有、什么都有、什么都有、什么都有、什么都有、什么都有、什么都有、什么都有、什么都有、什么都有、什么都有
+				{{detailData.radius || '-'}}
 			</view>
 			<view class="supp-detail-annex-title">
 				附件
 			</view>
 			<view class="supp-detail-annex-text">
-				<image class="supp-detail-annex-img" src="" mode=""></image>
+				<image :src="img" v-for="(img, i) in detailData.urls" :key="i" class="supp-detail-annex-img" @click="imageHandle(i)"></image>
 			</view>
 		</view>
 	</view>
@@ -42,11 +42,17 @@
 	export default {
 	  data() {
 	    return {
+			detailData: {},
 	    }
 	  },
 		//第一次加载
-		onLoad(e) {
-			  
+		onLoad(options) {
+			let data = decodeURIComponent(options.dataInfo)
+			let detailData = JSON.parse(data)
+			if(detailData.attachment) {
+				detailData.urls = detailData.attachment.split(',')
+			}
+			this.detailData = detailData
 		},
 	   onReady() {
 	        
@@ -59,12 +65,12 @@
 			//拨打电话
 			makeOhoneHandle() {
 				uni.makePhoneCall({
-					phoneNumber: '18580506017'
+					phoneNumber: this.detailData.contactPhone
 				})
 			},
 			//唤起导航
-			getLocalHandle(lat, lng, address, name) {
-				if (lat && lng && address && name) {
+			getLocalHandle() {
+				if (this.detailData.lat && this.detailData.lng && this.detailData.address && this.detailData.name) {
 					uni.openLocation({
 						latitude: lat,
 						longitude: lng,
@@ -74,7 +80,18 @@
 				} else {
 					this.$utils.msg("位置信息丢失");
 				}
-			}
+			},
+			//点击图片
+			imageHandle(data) {
+				let list = [];
+				this.detailData.urls.forEach(item => {
+					list.push(item)
+				})
+				uni.previewImage({
+					urls: list,
+					current: this.detailData.urls[data]
+				})
+			},
 		}	
 	}
 </script>

+ 13 - 14
pages/public/login.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view class="login-wrap">
-			<view class="logo"><image src="../../static/logo.png"></image></view>
+			<!-- <view class="logo"><image src="../../static/logo.png"></image></view> -->
 			<view class="wechat-title">微信授权登录</view>
 			<view class="wechat-desc">获得您的公开信息,以便为您提供更好的服务</view>
 			<button class="wechat-login-btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">授权手机号码一键登录</button>
@@ -32,7 +32,7 @@
 					encryptedData:null,
 					iv:null,
 				},
-				jumpPage:null,
+				topage:null,
 			}
 		},
 		onShow() {
@@ -43,9 +43,8 @@
 		onLoad(option) {
 			this.options=option.item
 			if(option.topage){
-				this.jumpPage=option.topage
+				this.topage=option.topage
 			}
-			console.log(this.jumpPage, 'jumpPagejumpPage')
 		},
 		methods: {
 			getPhoneNumber(e){
@@ -60,15 +59,15 @@
 					that.params.encryptedData=e.detail.encryptedData
 					that.params.iv=e.detail.iv
 					that.$http.wxLogin(that.params).then(res=>{
-						if(res.code === 0){
-							that.$store.commit("UPDATEMOBILE",res.data.mobile);
-							that.$store.commit("UPDATEUSERS",res.data);
-							that.$storage.setJson("token",res.data.token)
-							if(that.jumpPage){
-								uni.navigateBack({ delta: 1 })
-							}else{
-								that.$utils.switchTab('ucenter/index');
-							}
+						if(res.code == 200){
+							that.$storage.setJson("token",res.token)
+							that.$http.getInfoData().then(response => {
+								that.$storage.setJson("user",response.user)
+							})
+							// uni.switchTab({
+							// 	url: that.topage
+							// })
+							uni.navigateBack()
 							that.isSubmit = false;
 						}else{
 							that.$utils.msg(res.msg);
@@ -80,7 +79,7 @@
 				}
 			},
 			onGoHome(){
-				this.$utils.switchTab("index/index");
+				this.$utils.switchTab("/index/index");
 			},
 			checkboxChange(e){
 				let that =this

+ 8 - 7
pages/ucenter/index.vue

@@ -5,11 +5,11 @@
 		<view class="personal-info">
 			<view class="personal-info-left">
 				<view class="personal-name">
-					<span>张子熙</span>
-					<span class="personal-phone">{{' / ' + '18580506017'}}</span>
+					<span>{{userinfo.nickName}}</span>
+					<span class="personal-phone">{{' / ' + userinfo.phonenumber}}</span>
 				</view>
 				<view class="personal-role">
-					西南运维部/值守人员
+					{{userinfo.roles[0].roleName}}
 				</view>
 			</view>
 			<view class="personal-info-right">
@@ -43,23 +43,24 @@
 					  type: 0,
 					},
 					{
-					  title: '处理记录',
+					  title: '参与工单',
 					  path: '/pages/ucenter/mineNotes',
 					  type: 0,
 					}
 				],
 				dataInfo: {},
 				background: null,
-				userinfo: this.$store.state.users,
+				userinfo: {},
 			}
 		},
 		created() {
-			
+			let userinfo = uni.getStorageSync('user')
+			this.userinfo = JSON.parse(userinfo)
 		},
 		computed: {
 			usernameFirst: {
 				get() {
-			        let name = '李梓熙';
+			        let name = this.userinfo.nickName;
 			        let first = name?.charAt(0);
 			        if (new RegExp("[\u4E00-\u9FA5]+").test(first)) {
 						return first;

+ 2 - 2
pages/ucenter/mineNotes.vue

@@ -49,7 +49,7 @@
 			tabsList: [{
 				name: '工单上报'
 			}, {
-				name: '处理记录'
+				name: '参与工单'
 			}],
 			current: 0,
 			swiperCurrent: 0,
@@ -57,7 +57,7 @@
 			swiperContentHeight: 0,
 			tabs:[
 				  {name:'工单上报',index:0,dataSet:[]},
-				  {name:'处理记录2',index:1,dataSet:[]},
+				  {name:'参与工单',index:1,dataSet:[]},
 			],
 			formData: {
 				name: '全部站点',