瀏覽代碼

报修代码完善

xiaoxin 2 年之前
父節點
當前提交
ef25fd04e0

+ 26 - 10
pagesRepairs/addGoods/addGoods.vue

@@ -13,7 +13,7 @@
 				<view class="left_item" :class="{ active: activeIndex === index }" v-for="(item, index) in list" :key="index" @click="handleChange(index)">{{ item }}</view>
 			</view>
 			<view class="body_right">
-				<view class="right_item" :class="{ active: activeIndex2 === index2 }" v-for="(ele, index2) in List2" :key="index2" @click="handleChange2(index2)">
+				<view class="right_item" :class="{ active: ele.isCheck }" v-for="(ele, index2) in list2" :key="index2" @click="handleChange2(index2)">
 					{{ ele.name }}
 				</view>
 			</view>
@@ -48,18 +48,21 @@ export default {
 			// 左边数组
 			list: [],
 			// 右边数组的索引
-			activeIndex2: 0,
+			activeIndex2: null,
 			// 右边数组
-			List2: [],
+			list2: [],
 			// 校区id
 			schoolId: '',
 			// 所有数据
-			allList: []
+			allList: [],
+			// 默认选择id
+			activeList: []
 		}
 	},
-	onLoad() {
+	onLoad(options) {
 		const userInfo = uni.getStorageSync('repairsUserInfo')
 		this.schoolId = userInfo.schoolId
+		this.activeList = JSON.parse(options.activeList)
 		this.getData()
 	},
 	methods: {
@@ -68,6 +71,7 @@ export default {
 			this.activeIndex2 = null
 			this.getData()
 		},
+		// 获取耗材列表数据
 		async getData() {
 			const res = await this.$myRequest_repairs({
 				url: '/repairArticleType/queryConsumeMaterial',
@@ -80,7 +84,12 @@ export default {
 			if (res.code === '200') {
 				this.allList = res.data
 				this.list = this.allList.map((ele) => ele.name)
-				this.List2 = this.allList[this.activeIndex].consumes || []
+				this.list2 = this.allList[this.activeIndex].consumes || []
+				this.list2.forEach((ele, index) => {
+					if (this.activeList.includes(ele.id)) {
+						ele.isCheck = true
+					}
+				})
 			}
 		},
 		// 确认按钮回调
@@ -117,13 +126,18 @@ export default {
 		handleChange(index) {
 			this.activeIndex = index
 			this.activeIndex2 = null
-			this.List2 = this.allList[this.activeIndex].consumes || []
+			this.list2 = this.allList[this.activeIndex].consumes || []
+			this.list2.forEach((ele, index) => {
+				if (this.activeList.includes(ele.id)) {
+					ele.isCheck = true
+				}
+			})
 		},
 		// 右边数组切换回调
 		handleChange2(index) {
 			this.activeIndex2 = index
 			uni.$emit('addConsumable', {
-				data: this.List2[this.activeIndex2],
+				data: this.list2[this.activeIndex2],
 				articleId: this.allList[this.activeIndex].id
 			})
 			uni.navigateBack(1)
@@ -173,14 +187,16 @@ export default {
 
 		.body_left {
 			box-sizing: border-box;
-			padding: 30rpx;
+			padding: 20rpx 30rpx 30rpx;
 			width: 199rpx;
 			border-right: 1rpx solid #cccccc;
 			overflow-y: auto;
 
 			.left_item {
+				display: flex;
+				align-items: center;
+				margin-bottom: 10rpx;
 				height: 80rpx;
-				// font-size: 28rpx;
 				font-weight: bold;
 			}
 

+ 21 - 2
pagesRepairs/box/box.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<!-- 首页 -->
-		<Home v-if="show === 'home'" />
+		<Home v-if="show === 'home'" :msgTotal="msgTotal" />
 		<!-- 工单管理 -->
 		<Management v-if="show === 'management'" />
 		<!-- 通讯录 -->
@@ -82,7 +82,9 @@ export default {
 			// box页面展示哪个组件
 			show: '',
 			// 当前显示组件的index
-			currentRouter: 0
+			currentRouter: 0,
+			// 未读信息总数
+			msgTotal: 0
 		}
 	},
 	mounted() {
@@ -107,6 +109,10 @@ export default {
 			})
 		}
 	},
+	onShow() {
+		// 获取未读信息条数
+		this.getUnreadMsgCount()
+	},
 	onLoad() {
 		uni.$on('goToRepairs', this.goToRepairs)
 		uni.$on('goToMyRepairs', this.goToMyRepairs)
@@ -116,6 +122,19 @@ export default {
 		uni.$off()
 	},
 	methods: {
+		// 获取未读信息条数数据
+		async getUnreadMsgCount() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairSystemMessages/queryMessageUnreadCount',
+				data: {
+					userId: uni.getStorageSync('repairsUserInfo').userId
+				}
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.msgTotal = res.data.count
+			}
+		},
 		// 全局自定义事件
 		goToRepairs(e) {
 			// console.log(e)

+ 1 - 1
pagesRepairs/components/recording.vue

@@ -84,7 +84,7 @@ export default {
 					//上锁不发送
 				} else {
 					//解锁发送,发送网络请求
-					if (res.duration < 1000)
+					if (res.duration < 1500)
 						uni.showToast({
 							title: '录音时间太短',
 							icon: 'none',

+ 3 - 4
pagesRepairs/help/help.vue

@@ -90,9 +90,7 @@ export default {
 		// 协作对象
 		peoples() {
 			let temList = []
-			this.info.collaboratorDatas.forEach((ele) => {
-				temList.push(ele.userName)
-			})
+			temList = this.info.collaboratorDatas.map((ele) => ele.userName || ele.name)
 			let res = temList.toString()
 			return res
 		},
@@ -180,6 +178,7 @@ export default {
 				content: '确认提交协作申请吗?',
 				success: async (res) => {
 					if (res.confirm) {
+						let temList = this.info.collaboratorDatas.map((ele) => ele.id)
 						const res = await this.$myRequest_repairs({
 							url: '/repairRecord/collaborateApply',
 							method: 'post',
@@ -188,7 +187,7 @@ export default {
 								userId: uni.getStorageSync('repairsUserInfo').userId,
 								voice: this.info.voice,
 								voiceLength: this.info.voiceLength,
-								collaborator: this.info.collaboratorDatas,
+								collaborator: temList,
 								remark: this.info.remark
 							}
 						})

+ 25 - 3
pagesRepairs/helpPeople/helpPeople.vue

@@ -15,7 +15,7 @@
 				<img src="../../static/images/repairsImg/photo.png" />
 				<view class="item_info">
 					<view class="info_msg">
-						{{ item.userName }}
+						{{ item.userName || item.name }}
 						<view class="msg_work">{{ item.workType }}</view>
 					</view>
 					<view class="info_phone">{{ item.userPhone }}</view>
@@ -48,20 +48,42 @@ export default {
 	},
 	onLoad(options) {
 		// console.log(options)
+		this.recordId = options.id
 		if (options.type) {
 			this.type = options.type
 			uni.setNavigationBarTitle({
 				title: '派单'
 			})
+			this.getData()
+		} else {
+			this.getHelpData()
 		}
 		if (options.info) {
 			this.info = JSON.parse(options.info)
 		}
-		this.recordId = options.id
-		this.getData()
 	},
 	methods: {
 		// 获取协作人列表数组
+		async getHelpData() {
+			const res = await this.$myRequest_repairs({
+				url: '/repairUser/queryPageCollaborator',
+				data: {
+					currentPage: 1,
+					pageCount: 999,
+					schoolId: uni.getStorageSync('repairsUserInfo').schoolId,
+					userId: uni.getStorageSync('repairsUserInfo').userId,
+					keyWord: this.searchValue
+				}
+			})
+			// console.log(res)
+			if (res.code === '200') {
+				this.list = res.data.list
+				this.list.forEach((ele) => {
+					ele.checked = false
+				})
+			}
+		},
+		// 获取派单人列表数组
 		async getData() {
 			const res = await this.$myRequest_repairs({
 				url: '/repairUser/queryPageRepairUsers',

+ 4 - 24
pagesRepairs/home/home.vue

@@ -199,13 +199,10 @@ export default {
 			// 每页多少条数据
 			pageCount: 100,
 			// 总条数
-			total: null,
-			// 信息列表
-			msgList: [],
-			// 信息总数
-			msgTotal: 0
+			total: null
 		}
 	},
+	props: ['msgTotal'],
 	mounted() {
 		const repairsUserInfo = uni.getStorageSync('repairsUserInfo')
 		this.btns = repairsUserInfo.btns
@@ -222,26 +219,10 @@ export default {
 		} else {
 			this.getCount()
 		}
+		// 获取图表数据
 		this.getWatchData()
-		this.getMsgList()
 	},
 	methods: {
-		// 获取信息列表数据
-		async getMsgList() {
-			const res = await this.$myRequest_repairs({
-				url: '/repairSystemMessages/querySystemMessagePage',
-				data: {
-					currentPage: 1,
-					pageCount: 8,
-					userId: this.userId
-				}
-			})
-			// console.log(res)
-			if (res.code === '200') {
-				this.msgTotal = res.data.totalCount
-				this.msgList = res.data.list
-			}
-		},
 		// 获取图表数据
 		async getChartData() {
 			const res = await this.$myRequest_repairs({
@@ -423,9 +404,8 @@ export default {
 
 		// 点击悬浮消息按钮回调
 		handleGoMsg() {
-			const list = JSON.stringify(this.msgList)
 			uni.navigateTo({
-				url: `/pagesRepairs/message/message?list=${list}&total=${this.msgTotal}`
+				url: `/pagesRepairs/message/message`
 			})
 		},
 		// 点击悬浮加号按钮回调

+ 288 - 215
pagesRepairs/management/management.vue

@@ -2,7 +2,7 @@
 	<scroll-view class="container" :scroll-y="scrollY" @scrolltolower="scrolltolower">
 		<view class="top_bg"></view>
 
-		<!-- 状态统计区域 后勤管理端 -->
+		<!-- 状态统计区域 管理端 -->
 		<view class="top_types2" v-if="btns.includes('工单管理分段器')">
 			<view class="top">
 				<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text" activeColor="#6FB6B8"></uni-segmented-control>
@@ -36,7 +36,7 @@
 			</view>
 		</view>
 
-		<!-- 状态统计区域 维修师傅端 -->
+		<!-- 状态统计区域 维修师傅 后勤端 -->
 		<view class="top_types" v-else>
 			<view class="types_box" :class="{ active: state === 1 }" @click="handleFilter(1)">
 				<view class="box_num">{{ receivingCount }}</view>
@@ -56,6 +56,11 @@
 				<view class="box_info">待审核</view>
 			</view>
 
+			<view class="types_box" v-if="btns.includes('分段器按钮')" :class="{ active: state === 6 }" @click="handleFilter(6)">
+				<view class="box_num">{{ logisticsCount }}</view>
+				<view class="box_info">待处理</view>
+			</view>
+
 			<view class="types_box" v-if="btns.includes('分段器按钮')" :class="{ active: state === 5 }" @click="handleFilter(5)">
 				<view class="box_num">{{ finishedCount }}</view>
 				<view class="box_info">已完成</view>
@@ -69,7 +74,7 @@
 		<!-- 订单列表区域 -->
 		<view class="body">
 			<!-- 每一个订单区域 -->
-			<view class="body_item" v-for="item in dataList" :key="item.id">
+			<view class="body_item" v-for="item in dataList" :key="item.id" @click="handleGoDetail(item)">
 				<!-- 工单编号 -->
 				<view class="item_title">
 					<img src="../../static/images/repairsImg/order.png" />
@@ -84,7 +89,8 @@
 					</view>
 					<view class="time_type" v-if="item.state === '待接单'">待接单</view>
 					<view class="time_type color_type" v-if="item.state === '维修中'">维修中</view>
-
+					<view class="time_type color_type" v-if="item.state === '协作待审核'">协作待审核</view>
+					<view class="time_type color_type" v-if="item.state === '转单待审核'">转单待审核</view>
 					<view class="time_type color_type2" v-if="item.state === '待审核'">待审核</view>
 					<view class="time_type color_type3" v-if="item.state === '已完成'">已完成</view>
 					<view class="time_type" v-if="item.state === '待确认'">待确认</view>
@@ -102,7 +108,7 @@
 				<!-- 报修电话 -->
 				<view class="item_box">
 					<view class="box_key">报修电话:</view>
-					<view class="box_value phone" @click="handleCallPhone(item.userPhone)">
+					<view class="box_value phone" @click.stop="handleCallPhone(item.userPhone)">
 						{{ item.userPhone }}
 						<img src="../../static/images/repairsImg/phone.png" />
 					</view>
@@ -132,10 +138,21 @@
 					<view class="box_value">{{ item.description }}</view>
 				</view>
 
+				<!-- 报修录音 -->
+				<view class="item_box" v-if="item.voice">
+					<view class="box_key">报修录音:</view>
+					<view class="box_value">
+						<view class="recording" @click.stop="handlePlayRecording(item)">
+							<img class="voiceImg" :src="item.status ? '../../static/images/repairsImg/play_active.png' : '../../static/images/repairsImg/play.png'" />
+							{{ item.voiceLength }}″
+						</view>
+					</view>
+				</view>
+
 				<!-- 上传图片 -->
 				<view class="item_img">
 					<view class="img_key">上传图片:</view>
-					<img class="img_value" mode="aspectFill" :src="item.images[0]" @click="handleLookImgs(item.images)" />
+					<img class="img_value" mode="aspectFill" :src="item.images[0]" @click.stop="handleLookImgs(item.images)" />
 				</view>
 
 				<!-- 维修师傅 -->
@@ -149,16 +166,16 @@
 				<!-- 师傅电话 -->
 				<view class="item_box" v-if="item.state !== '待接单' && item.state !== '待确认' && item.maintenancerPhone">
 					<view class="box_key">师傅电话:</view>
-					<view class="box_value phone" @click="handleCallPhone(item.maintenancerPhone)">
+					<view class="box_value phone" @click.stop="handleCallPhone(item.maintenancerPhone)">
 						{{ item.maintenancerPhone }}
 						<img src="../../static/images/repairsImg/phone.png" />
 					</view>
 				</view>
 
 				<!-- 维修费用 -->
-				<view class="item_box" v-if="(item.state === '待审核' || item.state === '已完成' || item.state === '待确认') && item.price">
+				<view class="item_box" v-if="item.price">
 					<view class="box_key">维修费用:</view>
-					<view class="box_value2 phone" @click="checkFeeDetail(item)">
+					<view class="box_value2 phone" @click.stop="checkFeeDetail(item)">
 						{{ item.price }}元
 						<img src="../../static/images/repairsImg/eye.png" />
 					</view>
@@ -167,92 +184,92 @@
 				<!-- 按钮区域 -->
 				<view class="item_btn">
 					<!-- 关闭按钮 -->
-					<img v-if="item.state === '待接单' || item.state === '维修中'" src="../../static/images/repairsImg/close.png" @click="handleClose(item)" />
+					<img v-if="item.state === '待接单'" src="../../static/images/repairsImg/close.png" @click.stop="handleClose(item)" />
 					<!-- 协作按钮 -->
-					<img class="img" src="../../static/images/repairsImg/help.png" v-if="item.state === '待接单' && btns.includes('协作')" @click="handleHelp(item)" />
+					<img class="img" src="../../static/images/repairsImg/help.png" v-if="item.state === '待接单' && btns.includes('协作')" @click.stop="handleHelp(item)" />
 					<!-- 延时按钮 -->
-					<view class="btn_box type" v-if="(item.state === '待接单' || item.state === '维修中') && btns.includes('延时')" @click="handleDelay(item)">延时</view>
+					<view class="btn_box type" v-if="(item.state === '待接单' || item.state === '维修中') && btns.includes('延时')" @click.stop="handleDelay(item)">延时</view>
 					<!-- 接单按钮 -->
-					<view class="btn_box type" v-if="item.state === '待接单' && btns.includes('接单')" @click="handleOrderReceiving(item)">接单</view>
+					<!-- <view class="btn_box type" v-if="item.state === '待接单' && btns.includes('接单')" @click.stop="handleOrderReceiving(item)">接单</view> -->
 					<!-- 转单按钮 -->
-					<view class="btn_box type2" v-if="item.state === '待接单' && btns.includes('转单')" @click="handleTransferOrder(item)">转单</view>
+					<view class="btn_box type2" v-if="item.state === '待接单' && btns.includes('转单')" @click.stop="handleTransferOrder(item)">转单</view>
 					<!-- 派单按钮 -->
-					<view class="btn_box type2" v-if="item.state === '待接单' && btns.includes('派单')" @click="handleSendOrder(item)">派单</view>
+					<!-- <view class="btn_box type2" v-if="item.state === '待接单' && btns.includes('派单')" @click.stop="handleSendOrder(item)">派单</view> -->
 					<!-- 报价按钮 -->
-					<view class="btn_box type" v-if="item.state === '维修中' && btns.includes('报价')" @click="handleOffer(item)">报价</view>
+					<view class="btn_box type" v-if="!item.price && item.state === '维修中' && btns.includes('报价')" @click.stop="handleOffer(item)">报价</view>
 					<!-- 维修完成按钮 -->
-					<view class="btn_box type2" v-if="item.state === '维修中' && btns.includes('维修完成')" @click="handleFinish(item)">维修完成</view>
+					<view class="btn_box type2" v-if="item.state === '维修中' && btns.includes('维修完成')" @click.stop="handleFinish(item)">维修完成</view>
 					<!-- 审核按钮 -->
-					<view class="btn_box type" v-if="(item.state === '协作审核' || item.state === '转单审核') && btns.includes('审核')" @click="handleAudit(item)">审核</view>
+					<view class="btn_box type" v-if="(item.state === '协作审核' || item.state === '转单审核') && btns.includes('审核')" @click.stop="handleAudit(item)">审核</view>
 					<!-- 改价按钮 -->
-					<view class="btn_box type" v-if="item.state === '待确认'" @click="handleChangeOffer(item)">改价</view>
+					<view class="btn_box type" v-if="item.state === '待确认'" @click.stop="handleChangeOffer(item)">改价</view>
 					<!-- 留言按钮 -->
-					<view class="btn_box type2" v-if="item.state === '待确认'" @click="handleLeaveWords">留言</view>
+					<view class="btn_box type2" v-if="item.state === '待确认'" @click.stop="handleLeaveWords">留言</view>
 				</view>
+			</view>
 
-				<!-- 关闭按钮弹窗 -->
-				<uni-popup ref="popup_close" :is-mask-click="false">
-					<view class="popup_close">
-						<view
-							:class="[{ active: activeIndex === index }, { radius: index === 0 }]"
-							class="close_box"
-							v-for="(ele, index) in closeList"
-							:key="ele.id"
-							@click="handleChangeItem(index)"
-						>
-							{{ ele.name }}
-						</view>
-						<view class="close_btn">
-							<view class="btn_box cancel" @click="$refs.popup_close[0].close()">取消</view>
-							<view class="btn_box confirm" @click="handleCloseConfirm">确定</view>
-						</view>
+			<!-- 关闭按钮弹窗 -->
+			<uni-popup ref="popup_close" :is-mask-click="false">
+				<view class="popup_close">
+					<view
+						:class="[{ active: activeIndex === index }, { radius: index === 0 }]"
+						class="close_box"
+						v-for="(ele, index) in closeList"
+						:key="ele.id"
+						@click="handleChangeItem(index)"
+					>
+						{{ ele.name }}
 					</view>
-				</uni-popup>
-
-				<!-- 留言弹窗 -->
-				<uni-popup ref="popup_leaveWords" :is-mask-click="false">
-					<view class="pop_leaveWords">
-						<view class="leaveWords_title">留言</view>
-						<view class="leaveWords_body">
-							<textarea placeholder-style="color:#CCCCCC" placeholder="请输入您宝贵的留言" v-model="leaveWords"></textarea>
-						</view>
-						<view class="leaveWords_btn">
-							<view class="btn_box cancel" @click="$refs.popup_leaveWords[0].close()">取消</view>
-							<view class="btn_box confirm" @click="handleLeaveWordsConfirm">确定</view>
-						</view>
+					<view class="close_btn">
+						<view class="btn_box cancel" @click="$refs.popup_close.close()">取消</view>
+						<view class="btn_box confirm" @click="handleCloseConfirm">确定</view>
 					</view>
-				</uni-popup>
-
-				<!-- 维修费用弹窗 -->
-				<uni-popup :is-mask-click="false" ref="popup_fee">
-					<view class="pop_fee">
-						<view class="fee_title">
-							维修费用
-							<text @click="$refs.popup_fee[0].close()">×</text>
-						</view>
-						<view class="fee_content">
-							<view class="fee_item" v-for="(element, index2) in goodsList" :key="index2">
-								<view class="fee_box">
-									耗材:
-									<text>{{ element.name }}</text>
-								</view>
-								<view class="fee_box">
-									耗材单价:
-									<text>{{ element.price }}元</text>
-								</view>
-								<view class="fee_box">
-									耗材数量:
-									<text>{{ element.num }}</text>
-								</view>
-								<view class="fee_box">
-									耗材费用:
-									<text>{{ element.count }}元</text>
-								</view>
+				</view>
+			</uni-popup>
+
+			<!-- 留言弹窗 -->
+			<uni-popup ref="popup_leaveWords" :is-mask-click="false">
+				<view class="pop_leaveWords">
+					<view class="leaveWords_title">留言</view>
+					<view class="leaveWords_body">
+						<textarea placeholder-style="color:#CCCCCC" placeholder="请输入您宝贵的留言" v-model="leaveWords"></textarea>
+					</view>
+					<view class="leaveWords_btn">
+						<view class="btn_box cancel" @click="$refs.popup_leaveWords.close()">取消</view>
+						<view class="btn_box confirm" @click="handleLeaveWordsConfirm">确定</view>
+					</view>
+				</view>
+			</uni-popup>
+
+			<!-- 维修费用弹窗 -->
+			<uni-popup :is-mask-click="false" ref="popup_fee">
+				<view class="pop_fee">
+					<view class="fee_title">
+						维修费用
+						<text @click="$refs.popup_fee.close()">×</text>
+					</view>
+					<view class="fee_content">
+						<view class="fee_item" v-for="(element, index2) in goodsList" :key="index2">
+							<view class="fee_box">
+								耗材:
+								<text>{{ element.name }}</text>
+							</view>
+							<view class="fee_box">
+								耗材单价:
+								<text>{{ element.price }}元</text>
+							</view>
+							<view class="fee_box">
+								耗材数量:
+								<text>{{ element.num }}</text>
+							</view>
+							<view class="fee_box">
+								耗材费用:
+								<text>{{ element.count }}元</text>
 							</view>
 						</view>
 					</view>
-				</uni-popup>
-			</view>
+				</view>
+			</uni-popup>
 		</view>
 
 		<!-- 没有数据时展示的图片 -->
@@ -264,6 +281,7 @@
 </template>
 
 <script>
+const innerAudioContext = uni.createInnerAudioContext()
 export default {
 	data() {
 		return {
@@ -288,6 +306,8 @@ export default {
 			schoolId: '',
 			// 用户ID
 			userId: '',
+			// 待处理
+			logisticsCount: '',
 			// 待审核
 			examineCount: '',
 			// 待接单
@@ -401,6 +421,9 @@ export default {
 			// console.log(res)
 			if (res.code === '200') {
 				this.total2 = res.data.totalCount
+				res.data.list.forEach((ele) => {
+					return (ele.status = false)
+				})
 				this.dataList = [...this.dataList, ...res.data.list]
 			}
 		},
@@ -419,6 +442,7 @@ export default {
 				this.finishedCount = res.data.finishedCount
 				this.timeoutCount = res.data.timeoutCount
 				this.closedCount = res.data.closedCount
+				this.logisticsCount = res.data.logisticsCount
 			}
 		},
 		// 获取团队订单数据
@@ -435,6 +459,9 @@ export default {
 			// console.log(res)
 			if (res.code === '200') {
 				this.total = res.data.totalCount
+				res.data.list.forEach((ele) => {
+					return (ele.status = false)
+				})
 				this.dataList = [...this.dataList, ...res.data.list]
 			}
 		},
@@ -443,13 +470,15 @@ export default {
 			if (this.leaveWords) {
 				uni.showToast({
 					title: '留言成功',
-					icon: 'success'
+					icon: 'success',
+					mask: true
 				})
-				this.$refs.popup_leaveWords[0].close()
+				this.$refs.popup_leaveWords.close()
 			} else {
 				uni.showToast({
 					title: '请输入留言内容',
-					icon: 'none'
+					icon: 'none',
+					mask: true
 				})
 			}
 		},
@@ -472,9 +501,10 @@ export default {
 						if (res.code === '200') {
 							uni.showToast({
 								title: '关单成功',
-								icon: 'success'
+								icon: 'success',
+								mask: true
 							})
-							this.$refs.popup_close[0].close()
+							this.$refs.popup_close.close()
 							setTimeout(() => {
 								this.handleResetData()
 							}, 1500)
@@ -485,6 +515,8 @@ export default {
 		},
 		// 重置当前页面获取最新数据
 		handleResetData() {
+			this.dataList = []
+			this.currentPage = 1
 			if ((this.btns.includes('工单管理分段器') || this.btns.includes('分段器按钮')) && this.current === 0) {
 				// 管理员身份或者后勤
 				this.getTeamCount()
@@ -513,7 +545,8 @@ export default {
 						if (res.code === '200') {
 							uni.showToast({
 								title: '接单成功',
-								icon: 'success'
+								icon: 'success',
+								mask: true
 							})
 							setTimeout(() => {
 								this.handleResetData()
@@ -527,7 +560,7 @@ export default {
 		handleClose(item) {
 			this.orderId = item.id
 			this.activeIndex = 0
-			this.$refs.popup_close[0].open('center')
+			this.$refs.popup_close.open('center')
 		},
 		// 关闭按钮弹窗选中按钮时回调
 		handleChangeItem(val) {
@@ -587,7 +620,7 @@ export default {
 		},
 		// 留言按钮回调
 		handleLeaveWords() {
-			this.$refs.popup_leaveWords[0].open('center')
+			this.$refs.popup_leaveWords.open('center')
 		},
 		// 延时按钮回调
 		handleDelay(item) {
@@ -617,7 +650,7 @@ export default {
 		checkFeeDetail(item) {
 			// console.log(item)
 			this.goodsList = item.goodsList
-			this.$refs.popup_fee[0].open('center')
+			this.$refs.popup_fee.open('center')
 		},
 		// 点击电话号码回调
 		handleCallPhone(phone) {
@@ -631,6 +664,32 @@ export default {
 			uni.previewImage({
 				urls: img
 			})
+		},
+		// 点击录音播放回调
+		handlePlayRecording(item) {
+			this.dataList.forEach((ele) => {
+				if (ele.id !== item.id) {
+					ele.status = false
+				}
+			})
+			innerAudioContext.src = item.voice
+			if (!item.status) {
+				item.status = true
+				innerAudioContext.play()
+
+				//播放结束
+				innerAudioContext.onEnded(() => {
+					item.status = false
+				})
+			} else {
+				item.status = false
+				innerAudioContext.stop()
+			}
+		},
+		handleGoDetail(item) {
+			uni.navigateTo({
+				url: `/pagesRepairs/repairDetails/repairDetails?id=${item.id}`
+			})
 		}
 	}
 }
@@ -734,6 +793,7 @@ export default {
 
 		.body_item {
 			margin-top: 20rpx;
+			padding-bottom: 35rpx;
 			border-radius: 11rpx;
 			box-shadow: 0 0 8rpx #d9d9d9;
 
@@ -751,7 +811,6 @@ export default {
 
 				.title_info {
 					margin-left: 16rpx;
-					// font-size: 28rpx;
 					font-size: 32rpx;
 				}
 			}
@@ -764,7 +823,6 @@ export default {
 				height: 79rpx;
 
 				.time_msg {
-					// font-size: 28rpx;
 					color: #808080;
 
 					text {
@@ -793,23 +851,43 @@ export default {
 
 			.item_box {
 				display: flex;
+				align-items: center;
 				padding: 0 30rpx;
-				height: 60rpx;
-				// font-size: 28rpx;
+				line-height: 60rpx;
 
 				.box_key {
+					width: 160rpx;
 					color: #808080;
 				}
 
 				.box_value {
 					display: flex;
+					align-items: center;
 					margin-right: auto;
+					min-width: calc(100% - width: 160rpx;);
 
 					img {
 						margin-left: 10rpx;
 						width: 45rpx;
 						height: 45rpx;
 					}
+
+					.recording {
+						display: flex;
+						align-items: center;
+						margin: 15rpx 0;
+						width: 130rpx;
+						height: 40rpx;
+						color: #000;
+						border-radius: 100rpx;
+						border: 1rpx solid #cccccc;
+
+						.voiceImg {
+							margin: 0 12rpx;
+							width: 30rpx;
+							height: 30rpx;
+						}
+					}
 				}
 
 				.box_type {
@@ -826,6 +904,7 @@ export default {
 
 				.box_value2 {
 					display: flex;
+					align-items: center;
 
 					img {
 						margin-top: -2rpx;
@@ -843,11 +922,9 @@ export default {
 			.item_img {
 				display: flex;
 				align-items: center;
-				margin-bottom: 10rpx;
 				padding: 0 30rpx;
 				height: 120rpx;
 				color: #808080;
-				// font-size: 28rpx;
 
 				.img_key {
 				}
@@ -869,7 +946,6 @@ export default {
 				img {
 					margin-right: auto;
 					margin-top: 45rpx;
-					margin-bottom: 40rpx;
 					width: 56rpx;
 					height: 56rpx;
 				}
@@ -878,7 +954,6 @@ export default {
 					margin-right: auto;
 					margin-left: -55rpx;
 					margin-top: 45rpx;
-					margin-bottom: 40rpx;
 					width: 62rpx;
 					height: 62rpx;
 				}
@@ -889,10 +964,8 @@ export default {
 					align-items: center;
 					margin-left: 16rpx;
 					margin-top: 45rpx;
-					margin-bottom: 40rpx;
 					width: 174rpx;
 					height: 68rpx;
-					// font-size: 28rpx;
 					border-radius: 11rpx;
 				}
 
@@ -907,159 +980,159 @@ export default {
 					border: 1rpx solid #6fb6b8;
 				}
 			}
+		}
 
-			.popup_close {
-				width: 690rpx;
-				border-radius: 19rpx;
-				background-color: #fff;
+		.popup_close {
+			width: 690rpx;
+			border-radius: 19rpx;
+			background-color: #fff;
+
+			.close_box {
+				height: 100rpx;
+				line-height: 100rpx;
+				text-align: center;
+				font-size: 32rpx;
+				border: 1rpx solid #e6e6e6;
+			}
 
-				.close_box {
-					height: 100rpx;
-					line-height: 100rpx;
-					text-align: center;
+			.radius {
+				border-radius: 19rpx 19rpx 0 0;
+			}
+
+			.active {
+				color: #fff;
+				background-color: #6fb6b8;
+			}
+
+			.close_btn {
+				display: flex;
+				align-items: center;
+				justify-content: space-evenly;
+				margin-top: 100rpx;
+				height: 121rpx;
+
+				.btn_box {
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					width: 203rpx;
+					height: 72rpx;
+					border-radius: 9rpx;
 					font-size: 32rpx;
-					border: 1rpx solid #e6e6e6;
 				}
 
-				.radius {
-					border-radius: 19rpx 19rpx 0 0;
+				.cancel {
+					background-color: #e5e5e5;
+					color: #6fb6b8;
 				}
 
-				.active {
-					color: #fff;
+				.confirm {
 					background-color: #6fb6b8;
+					color: #fff;
 				}
+			}
+		}
 
-				.close_btn {
-					display: flex;
-					align-items: center;
-					justify-content: space-evenly;
-					margin-top: 100rpx;
-					height: 121rpx;
+		.pop_leaveWords {
+			border-radius: 19rpx;
+			background-color: #fff;
 
-					.btn_box {
-						display: flex;
-						justify-content: center;
-						align-items: center;
-						width: 203rpx;
-						height: 72rpx;
-						border-radius: 9rpx;
-						font-size: 32rpx;
-					}
+			.leaveWords_title {
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				width: 690rpx;
+				height: 110rpx;
+				font-size: 32rpx;
+				font-weight: bold;
+				border-radius: 19rpx 19rpx 0 0;
+				border-bottom: 1rpx solid #e6e6e6;
+			}
 
-					.cancel {
-						background-color: #e5e5e5;
-						color: #6fb6b8;
-					}
+			.leaveWords_body {
+				height: 320rpx;
 
-					.confirm {
-						background-color: #6fb6b8;
-						color: #fff;
-					}
+				textarea {
+					box-sizing: border-box;
+					margin: 35rpx 40rpx;
+					padding: 20rpx;
+					width: 610rpx;
+					height: 312rpx;
+					// font-size: 28rpx;
+					border-radius: 14rpx;
+					border: 1rpx solid #e6e6e6;
 				}
 			}
 
-			.pop_leaveWords {
-				border-radius: 19rpx;
-				background-color: #fff;
+			.leaveWords_btn {
+				display: flex;
+				align-items: center;
+				justify-content: space-evenly;
+				height: 121rpx;
 
-				.leaveWords_title {
+				.btn_box {
 					display: flex;
 					justify-content: center;
 					align-items: center;
-					width: 690rpx;
-					height: 110rpx;
+					width: 203rpx;
+					height: 72rpx;
+					border-radius: 9rpx;
 					font-size: 32rpx;
-					font-weight: bold;
-					border-radius: 19rpx 19rpx 0 0;
-					border-bottom: 1rpx solid #e6e6e6;
 				}
 
-				.leaveWords_body {
-					height: 320rpx;
-
-					textarea {
-						box-sizing: border-box;
-						margin: 35rpx 40rpx;
-						padding: 20rpx;
-						width: 610rpx;
-						height: 312rpx;
-						// font-size: 28rpx;
-						border-radius: 14rpx;
-						border: 1rpx solid #e6e6e6;
-					}
+				.cancel {
+					background-color: #e5e5e5;
+					color: #6fb6b8;
 				}
 
-				.leaveWords_btn {
-					display: flex;
-					align-items: center;
-					justify-content: space-evenly;
-					height: 121rpx;
+				.confirm {
+					background-color: #6fb6b8;
+					color: #fff;
+				}
+			}
+		}
 
-					.btn_box {
-						display: flex;
-						justify-content: center;
-						align-items: center;
-						width: 203rpx;
-						height: 72rpx;
-						border-radius: 9rpx;
-						font-size: 32rpx;
-					}
+		.pop_fee {
+			padding-bottom: 50rpx;
+			border-radius: 19rpx;
+			background-color: #fff;
 
-					.cancel {
-						background-color: #e5e5e5;
-						color: #6fb6b8;
-					}
+			.fee_title {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				box-sizing: border-box;
+				padding: 0 31rpx 0 42rpx;
+				width: 690rpx;
+				height: 110rpx;
+				font-size: 32rpx;
+				font-weight: bold;
+				border-radius: 19rpx 19rpx 0 0;
+				border-bottom: 1rpx solid #e6e6e6;
 
-					.confirm {
-						background-color: #6fb6b8;
-						color: #fff;
-					}
+				text {
+					font-size: 45rpx;
+					font-weight: 400;
+					color: #808080;
 				}
 			}
 
-			.pop_fee {
-				padding-bottom: 50rpx;
-				border-radius: 19rpx;
-				background-color: #fff;
+			.fee_content {
+				max-height: 50vh;
+				overflow-y: auto;
 
-				.fee_title {
-					display: flex;
-					justify-content: space-between;
-					align-items: center;
-					box-sizing: border-box;
-					padding: 0 31rpx 0 42rpx;
-					width: 690rpx;
-					height: 110rpx;
-					font-size: 32rpx;
-					font-weight: bold;
-					border-radius: 19rpx 19rpx 0 0;
+				.fee_item {
 					border-bottom: 1rpx solid #e6e6e6;
-
-					text {
-						font-size: 45rpx;
-						font-weight: 400;
+					.fee_box {
+						display: flex;
+						align-items: center;
+						padding-left: 42rpx;
+						height: 80rpx;
+						// font-size: 28rpx;
 						color: #808080;
-					}
-				}
 
-				.fee_content {
-					max-height: 50vh;
-					overflow-y: auto;
-
-					.fee_item {
-						border-bottom: 1rpx solid #e6e6e6;
-						.fee_box {
-							display: flex;
-							align-items: center;
-							padding-left: 42rpx;
-							height: 80rpx;
-							// font-size: 28rpx;
-							color: #808080;
-
-							text {
-								color: #000000;
-							}
+						text {
+							color: #000000;
 						}
 					}
 				}

+ 24 - 7
pagesRepairs/message/message.vue

@@ -14,6 +14,12 @@
 				</view>
 			</view>
 		</view>
+
+		<!-- 没有数据时展示的图片 -->
+		<view class="no_data" v-if="msgList.length === 0">
+			<img src="../../pagesClockIn/static/imgs/nodata.png" />
+			<view>暂无数据</view>
+		</view>
 	</view>
 </template>
 
@@ -28,7 +34,7 @@ export default {
 			// 当前页
 			currentPage: 1,
 			// 每页多少条
-			pageCount: 8,
+			pageCount: 10,
 			// 总条数
 			total: null
 		}
@@ -36,12 +42,11 @@ export default {
 	onLoad(options) {
 		const repairsUserInfo = uni.getStorageSync('repairsUserInfo')
 		this.userId = repairsUserInfo.userId
-		if (options.list) {
-			this.msgList = JSON.parse(options.list)
-			this.total = options.total
-		} else {
-			this.getMsgList()
-		}
+	},
+	onShow() {
+		this.msgList = []
+		this.currentPage = 1
+		this.getMsgList()
 	},
 	// 页面上拉触底回调
 	onReachBottom() {
@@ -165,5 +170,17 @@ export default {
 			}
 		}
 	}
+
+	.no_data {
+		text-align: center;
+		color: #b3b3b3;
+		font-size: 24rpx;
+
+		img {
+			margin: 215rpx auto 0;
+			width: 480rpx;
+			height: 508rpx;
+		}
+	}
 }
 </style>

+ 77 - 5
pagesRepairs/myRepairs/myRepairs.vue

@@ -71,6 +71,17 @@
 					<view class="box_value">{{ item.descript }}</view>
 				</view>
 
+				<!-- 报修录音 -->
+				<view class="item_box" v-if="item.voice">
+					<view class="box_key">报修录音:</view>
+					<view class="box_value">
+						<view class="recording" @click.stop="handlePlayRecording(item)">
+							<img class="voiceImg" :src="item.status ? '../../static/images/repairsImg/play_active.png' : '../../static/images/repairsImg/play.png'" />
+							{{ item.voiceLength }}″
+						</view>
+					</view>
+				</view>
+
 				<!-- 上传图片 -->
 				<view class="item_img">
 					<view class="img_key">上传图片:</view>
@@ -190,6 +201,7 @@
 </template>
 
 <script>
+const innerAudioContext = uni.createInnerAudioContext()
 export default {
 	data() {
 		return {
@@ -252,6 +264,9 @@ export default {
 			})
 			// console.log(res)
 			if (res.code === '200') {
+				res.data.list.forEach((ele) => {
+					return (ele.status = false)
+				})
 				this.list = [...this.list, ...res.data.list]
 				this.total = res.data.totalCount
 				// 当页面没有数据时,页面禁止滚动
@@ -290,6 +305,7 @@ export default {
 			// 改变分段器索引
 			this.current = index
 			this.getRepairList()
+			this.getRepairCount()
 		},
 
 		// 转后勤弹窗确定按钮回调
@@ -314,7 +330,8 @@ export default {
 			if (res.code === '200') {
 				uni.showToast({
 					title: '转后勤成功',
-					icon: 'success'
+					icon: 'success',
+					mask: true
 				})
 				this.$refs.popup_logistics.close()
 				this.isClick = false
@@ -342,7 +359,8 @@ export default {
 						if (res.code === '200') {
 							uni.showToast({
 								title: '催单成功',
-								icon: 'success'
+								icon: 'success',
+								mask: true
 							})
 						}
 					}
@@ -368,7 +386,8 @@ export default {
 						if (res.code === '200') {
 							uni.showToast({
 								title: '撤销成功',
-								icon: 'success'
+								icon: 'success',
+								mask: true
 							})
 							setTimeout(() => {
 								this.list = []
@@ -429,7 +448,40 @@ export default {
 					price: item.price
 				}
 			})
-			console.log(res)
+			// console.log(res)
+			if (res.cdoe === '200') {
+				uni.showToast({
+					title: '支付成功',
+					icon: 'success',
+					mask: true
+				})
+				setTimeout(() => {
+					this.list = []
+					this.currentPage = 1
+					this.getRepairList()
+				}, 1500)
+			}
+		},
+		// 点击录音播放回调
+		handlePlayRecording(item) {
+			this.list.forEach((ele) => {
+				if (ele.id !== item.id) {
+					ele.status = false
+				}
+			})
+			innerAudioContext.src = item.voice
+			if (!item.status) {
+				item.status = true
+				innerAudioContext.play()
+
+				//播放结束
+				innerAudioContext.onEnded(() => {
+					item.status = false
+				})
+			} else {
+				item.status = false
+				innerAudioContext.stop()
+			}
 		}
 	}
 }
@@ -552,15 +604,18 @@ export default {
 			.item_box {
 				display: flex;
 				padding: 0 30rpx;
-				height: 60rpx;
+				line-height: 60rpx;
 				font-size: 28rpx;
 
 				.box_key {
+					width: 145rpx;
 					color: #808080;
 				}
 
 				.box_value {
+					max-width: calc(100% - 145rpx);
 					display: flex;
+					align-items: center;
 
 					img {
 						margin-top: 5rpx;
@@ -568,6 +623,23 @@ export default {
 						width: 28rpx;
 						height: 28rpx;
 					}
+
+					.recording {
+						display: flex;
+						align-items: center;
+						margin: 15rpx 0;
+						width: 130rpx;
+						height: 40rpx;
+						color: #000;
+						border-radius: 100rpx;
+						border: 1rpx solid #cccccc;
+
+						.voiceImg {
+							margin: 0 12rpx;
+							width: 30rpx;
+							height: 30rpx;
+						}
+					}
 				}
 
 				.box_value2 {

+ 16 - 3
pagesRepairs/offer/offer.vue

@@ -17,7 +17,14 @@
 			<view class="detail_box_item">
 				<view class="item_key">耗材单价</view>
 				<view class="item_value">
-					<input type="number" placeholder="请输入耗材单价" v-model="item.price" @blur="handleChangePrice($event, item)" />
+					<uni-easyinput
+						type="number"
+						:clearable="false"
+						v-model="item.price"
+						placeholder="请输入耗材单价"
+						placeholderStyle="font-size:16px"
+						@blur="handleChangePrice($event, item)"
+					></uni-easyinput>
 				</view>
 			</view>
 		</view>
@@ -186,8 +193,9 @@ export default {
 		},
 		// 添加耗材按钮回调
 		handleAdd() {
+			let temList = JSON.stringify(this.goodList.map((ele) => ele.consumeId))
 			uni.navigateTo({
-				url: '/pagesRepairs/addGoods/addGoods'
+				url: `/pagesRepairs/addGoods/addGoods?activeList=${temList}`
 			})
 		}
 	}
@@ -234,8 +242,13 @@ export default {
 			.item_value {
 				font-weight: bold;
 
-				input {
+				::v-deep .is-input-border {
 					text-align: right;
+					border: none;
+				}
+
+				::v-deep .uni-easyinput__content-input {
+					font-size: 32rpx;
 				}
 			}
 		}

+ 156 - 73
pagesRepairs/pending/pending.vue

@@ -3,7 +3,7 @@
 		<view class="top_bg" v-if="dataList.length"></view>
 		<view class="body" v-if="dataList.length">
 			<!-- 每一个订单区域 -->
-			<view class="body_item" v-for="item in dataList" :key="item.id">
+			<view class="body_item" :class="{ body_events: isClick }" v-for="item in dataList" :key="item.id" @click="handleGoDetail(item)">
 				<!-- 工单编号 -->
 				<view class="item_title">
 					<img src="../../static/images/repairsImg/order.png" />
@@ -27,7 +27,7 @@
 				<!-- 报修电话 -->
 				<view class="item_box">
 					<view class="box_key">报修电话:</view>
-					<view class="box_value phone" @click="handleCallPhone(item.userPhone)">
+					<view class="box_value phone" @click.stop="handleCallPhone(item.userPhone)">
 						{{ item.userPhone }}
 						<img src="../../static/images/repairsImg/phone.png" />
 					</view>
@@ -57,39 +57,58 @@
 					<view class="box_value">{{ item.description }}</view>
 				</view>
 
+				<!-- 报修录音 -->
+				<view class="item_box" v-if="item.voice">
+					<view class="box_key">报修录音:</view>
+					<view class="box_value">
+						<view class="recording" @click.stop="handlePlayRecording(item)">
+							<img class="voiceImg" :src="item.status ? '../../static/images/repairsImg/play_active.png' : '../../static/images/repairsImg/play.png'" />
+							{{ item.voiceLength }}″
+						</view>
+					</view>
+				</view>
+
 				<!-- 上传图片 -->
 				<view class="item_img">
 					<view class="img_key">上传图片:</view>
-					<img class="img_value" mode="aspectFill" :src="item.images[0]" @click="handleLookImgs(item.images)" />
+					<img class="img_value" mode="aspectFill" :src="item.images[0]" @click.stop="handleLookImgs(item.images)" />
 				</view>
 
 				<!-- 按钮区域 -->
 				<view class="item_btn">
-					<img src="../../static/images/repairsImg/close.png" @click="handleClose(item)" />
-					<view class="btn_box type" v-if="btns.includes('延时')" @click="handleDelay(item)">延时</view>
-					<view class="btn_box type" v-if="btns.includes('接单')" @click="handleOrderReceiving(item)">接单</view>
-					<view class="btn_box type2" v-if="btns.includes('派单')" @click="handleSendOrder(item)">派单</view>
+					<img src="../../static/images/repairsImg/close.png" @click.stop="handleClose(item)" />
+					<view class="btn_box type" v-if="btns.includes('延时')" @click.stop="handleDelay(item)">延时</view>
+					<view class="btn_box type" v-if="btns.includes('接单')" @click.stop="handleOrderReceiving(item)">接单</view>
+					<view class="btn_box type2" v-if="btns.includes('派单')" @click.stop="handleSendOrder(item)">派单</view>
 				</view>
+			</view>
 
-				<!-- 关闭按钮弹窗 -->
-				<uni-popup ref="popup_close" :is-mask-click="false">
-					<view class="popup_close">
+			<!-- 关闭按钮弹窗 -->
+			<uni-popup ref="popup_close" :is-mask-click="false">
+				<view class="popup_close" @click.stop="">
+					<view
+						:class="[{ active: activeIndex === index }, { radius: index === 0 }]"
+						class="close_box"
+						v-for="(ele, index) in closeList"
+						:key="ele.id"
+						@click="handleChangeItem(index)"
+					>
+						{{ ele.name }}
+					</view>
+					<view class="close_btn">
 						<view
-							:class="[{ active: activeIndex === index }, { radius: index === 0 }]"
-							class="close_box"
-							v-for="(ele, index) in closeList"
-							:key="ele.id"
-							@click="handleChangeItem(index)"
+							class="btn_box cancel"
+							@click="
+								$refs.popup_close.close()
+								isClick = false
+							"
 						>
-							{{ ele.name }}
-						</view>
-						<view class="close_btn">
-							<view class="btn_box cancel" @click="$refs.popup_close[0].close()">取消</view>
-							<view class="btn_box confirm" @click="handleCloseConfirm">确定</view>
+							取消
 						</view>
+						<view class="btn_box confirm" @click="handleCloseConfirm">确定</view>
 					</view>
-				</uni-popup>
-			</view>
+				</view>
+			</uni-popup>
 		</view>
 		<!-- 没有数据时展示的图片 -->
 		<view class="no_data" v-if="dataList.length === 0">
@@ -100,6 +119,7 @@
 </template>
 
 <script>
+const innerAudioContext = uni.createInnerAudioContext()
 export default {
 	data() {
 		return {
@@ -121,13 +141,18 @@ export default {
 			// 用户ID
 			userId: '',
 			// 订单id
-			orderId: ''
+			orderId: '',
+			// 校区Id
+			schoolId: '',
+			// 每一个订单点击时是否触发事件 true 不触发  false 触发
+			isClick: false
 		}
 	},
 	mounted() {
 		const repairsUserInfo = uni.getStorageSync('repairsUserInfo')
 		this.userId = repairsUserInfo.userId
 		this.btns = repairsUserInfo.btns
+		this.schoolId = repairsUserInfo.schoolId
 		this.getData()
 		this.getCloseList()
 	},
@@ -160,12 +185,16 @@ export default {
 				url: '/repairRecord/queryPendingOrder',
 				data: {
 					currentPage: this.currentPage,
-					pageCount: this.pageCount
+					pageCount: this.pageCount,
+					schoolId: this.schoolId
 				}
 			})
 			// console.log(res)
 			if (res.code === '200') {
 				this.total = res.data.totalCount
+				res.data.list.forEach((ele) => {
+					return (ele.status = false)
+				})
 				this.dataList = [...this.dataList, ...res.data.list]
 			}
 		},
@@ -187,7 +216,8 @@ export default {
 						if (res.code === '200') {
 							uni.showToast({
 								title: '接单成功',
-								icon: 'success'
+								icon: 'success',
+								mask: true
 							})
 							setTimeout(() => {
 								this.dataList = []
@@ -201,9 +231,10 @@ export default {
 		},
 		// 关闭图标点击回调
 		handleClose(item) {
+			this.isClick = true
 			this.orderId = item.id
 			this.activeIndex = 0
-			this.$refs.popup_close[0].open('center')
+			this.$refs.popup_close.open('center')
 		},
 		// 关闭弹窗确定按钮回调
 		handleCloseConfirm() {
@@ -224,15 +255,17 @@ export default {
 						if (res.code === '200') {
 							uni.showToast({
 								title: '关单成功',
-								icon: 'success'
+								icon: 'success',
+								mask: true
 							})
-							this.$refs.popup_close[0].close()
+							this.$refs.popup_close.close()
 							setTimeout(() => {
 								this.dataList = []
 								this.currentPage = 1
 								this.getData()
 							}, 1500)
 						}
+						this.isClick = false
 					}
 				}
 			})
@@ -266,6 +299,33 @@ export default {
 			uni.previewImage({
 				urls: img
 			})
+		},
+		// 点击录音播放回调
+		handlePlayRecording(item) {
+			this.dataList.forEach((ele) => {
+				if (ele.id !== item.id) {
+					ele.status = false
+				}
+			})
+			innerAudioContext.src = item.voice
+			if (!item.status) {
+				item.status = true
+				innerAudioContext.play()
+
+				//播放结束
+				innerAudioContext.onEnded(() => {
+					item.status = false
+				})
+			} else {
+				item.status = false
+				innerAudioContext.stop()
+			}
+		},
+		// 点击每一个订单回调
+		handleGoDetail(item) {
+			uni.navigateTo({
+				url: `/pagesRepairs/repairDetails/repairDetails?id=${item.id}`
+			})
 		}
 	}
 }
@@ -295,6 +355,7 @@ export default {
 
 		.body_item {
 			margin-bottom: 20rpx;
+			padding-bottom: 35rpx;
 			border-radius: 11rpx;
 			box-shadow: 0 0 8rpx #d9d9d9;
 
@@ -324,7 +385,6 @@ export default {
 				height: 79rpx;
 
 				.time_msg {
-					// font-size: 28rpx;
 					color: #808080;
 
 					text {
@@ -340,22 +400,42 @@ export default {
 
 			.item_box {
 				display: flex;
+				align-items: center;
 				padding: 0 30rpx;
-				height: 60rpx;
-				// font-size: 28rpx;
+				line-height: 60rpx;
 
 				.box_key {
+					width: 160rpx;
 					color: #808080;
 				}
 
 				.box_value {
+					max-width: calc(100% - 160rpx);
 					display: flex;
+					align-items: center;
 
 					img {
 						margin-left: 10rpx;
 						width: 45rpx;
 						height: 45rpx;
 					}
+
+					.recording {
+						display: flex;
+						align-items: center;
+						margin: 15rpx 0;
+						width: 130rpx;
+						height: 40rpx;
+						color: #000;
+						border-radius: 100rpx;
+						border: 1rpx solid #cccccc;
+
+						.voiceImg {
+							margin: 0 12rpx;
+							width: 30rpx;
+							height: 30rpx;
+						}
+					}
 				}
 
 				.phone {
@@ -386,7 +466,7 @@ export default {
 				align-items: center;
 				justify-content: flex-end;
 				padding: 0 30rpx;
-				height: 153rpx;
+				margin-top: 35rpx;
 
 				img {
 					margin-right: auto;
@@ -401,7 +481,6 @@ export default {
 					margin-left: 16rpx;
 					width: 174rpx;
 					height: 68rpx;
-					// font-size: 28rpx;
 					border-radius: 11rpx;
 				}
 
@@ -416,58 +495,62 @@ export default {
 					border: 1rpx solid #6fb6b8;
 				}
 			}
+		}
 
-			.popup_close {
-				width: 690rpx;
-				border-radius: 19rpx;
-				background-color: #fff;
+		.popup_close {
+			width: 690rpx;
+			border-radius: 19rpx;
+			background-color: #fff;
+
+			.close_box {
+				height: 100rpx;
+				line-height: 100rpx;
+				text-align: center;
+				font-size: 32rpx;
+				border: 1rpx solid #e6e6e6;
+			}
 
-				.close_box {
-					height: 100rpx;
-					line-height: 100rpx;
-					text-align: center;
-					font-size: 32rpx;
-					border: 1rpx solid #e6e6e6;
-				}
+			.radius {
+				border-radius: 19rpx 19rpx 0 0;
+			}
 
-				.radius {
-					border-radius: 19rpx 19rpx 0 0;
-				}
+			.active {
+				color: #fff;
+				background-color: #6fb6b8;
+			}
 
-				.active {
-					color: #fff;
-					background-color: #6fb6b8;
-				}
+			.close_btn {
+				display: flex;
+				align-items: center;
+				justify-content: space-evenly;
+				margin-top: 100rpx;
+				height: 121rpx;
 
-				.close_btn {
+				.btn_box {
 					display: flex;
+					justify-content: center;
 					align-items: center;
-					justify-content: space-evenly;
-					margin-top: 100rpx;
-					height: 121rpx;
-
-					.btn_box {
-						display: flex;
-						justify-content: center;
-						align-items: center;
-						width: 203rpx;
-						height: 72rpx;
-						border-radius: 9rpx;
-						font-size: 32rpx;
-					}
+					width: 203rpx;
+					height: 72rpx;
+					border-radius: 9rpx;
+					font-size: 32rpx;
+				}
 
-					.cancel {
-						background-color: #e5e5e5;
-						color: #6fb6b8;
-					}
+				.cancel {
+					background-color: #e5e5e5;
+					color: #6fb6b8;
+				}
 
-					.confirm {
-						background-color: #6fb6b8;
-						color: #fff;
-					}
+				.confirm {
+					background-color: #6fb6b8;
+					color: #fff;
 				}
 			}
 		}
+
+		.body_events {
+			pointer-events: none;
+		}
 	}
 
 	.no_data {

+ 100 - 36
pagesRepairs/repairDetails/repairDetails.vue

@@ -49,6 +49,16 @@
 			<view class="box_value">{{ detailInfo.description }}</view>
 		</view>
 
+		<view class="box" v-if="detailInfo.voice">
+			<view class="box_key">报修录音:</view>
+			<view class="box_value">
+				<view class="recording" @click="handlePlayRecording(detailInfo)">
+					<img class="voiceImg" :src="detailInfo.status ? '../../static/images/repairsImg/play_active.png' : '../../static/images/repairsImg/play.png'" />
+					{{ detailInfo.voiceLength }}″
+				</view>
+			</view>
+		</view>
+
 		<view class="box_img">
 			<view class="img_key">上传图片:</view>
 			<img class="img_value" mode="aspectFill" :src="detailInfo.images[0]" @click="handleLookImgs(detailInfo.images)" />
@@ -78,15 +88,21 @@
 		<view class="title top" v-if="detailInfo.tracks">报修跟踪</view>
 
 		<!-- 步骤条区域 -->
-		<!-- activeIcon="checkmark-circle-fill" -->
 		<uv-steps activeColor="#6FB6B8" direction="column" v-if="detailInfo.tracks" :current="detailInfo.tracks.length">
 			<uv-steps-item :customStyle="customStyle" v-for="item in detailInfo.tracks" :key="item.id">
 				<template v-slot:title>
 					<view class="steps_title" :class="{ active: true }">{{ item.state }}</view>
 				</template>
 				<template v-slot:desc>
-					<!-- <view class="steps_desc" v-for="(element, index) in item.desc" :key="index">{{ element }}</view> -->
 					<view class="steps_desc">{{ item.createTime }}</view>
+					<view class="steps_desc" v-if="item.userName">操作人:{{ item.userName }}({{ item.userZzstr }})</view>
+					<view class="steps_desc" v-if="item.voice">
+						上传录音
+						<view class="desc_recording" @click="handlePlayRecording(item)">
+							<img class="voiceImg" :src="item.status ? '../../static/images/repairsImg/play_active.png' : '../../static/images/repairsImg/play.png'" />
+							{{ item.voiceLength }}″
+						</view>
+					</view>
 					<view class="steps_desc" v-if="item.content">{{ item.content }}</view>
 				</template>
 			</uv-steps-item>
@@ -127,6 +143,7 @@
 </template>
 
 <script>
+const innerAudioContext = uni.createInnerAudioContext()
 export default {
 	data() {
 		return {
@@ -136,43 +153,12 @@ export default {
 			customStyle: {
 				marginBottom: '5px'
 			},
-			// 步骤条数据
-			stepsList: [
-				{
-					id: 1,
-					title: '提交订单',
-					type: true,
-					desc: ['2023-07-05 08:25:25']
-				},
-				{
-					id: 2,
-					title: '已接单',
-					type: true,
-					desc: ['2023-07-05 08:25:25']
-				},
-				{
-					id: 3,
-					title: '待确认',
-					type: true,
-					desc: ['2023-07-05 08:25:25', '张发财转后勤:太贵了', '系统管理员改价:耗材为螺丝刀,价格50元', '系统管理员改价:耗材为螺丝刀,价格50元']
-				},
-				{
-					id: 4,
-					title: '待确认',
-					type: false,
-					desc: ['2023-07-05 08:25:25']
-				},
-				{
-					id: 5,
-					title: '已完成',
-					type: false,
-					desc: ['2023-07-05 08:25:25']
-				}
-			],
 			// 订单id
 			recordId: '',
 			// 维修费用耗材明细列表
-			consumables: []
+			consumables: [],
+			// 定时器标识
+			timer: null
 		}
 	},
 	onLoad(options) {
@@ -190,7 +176,13 @@ export default {
 			})
 			// console.log(res)
 			if (res.code === '200') {
+				if (res.data.tracks.length) {
+					res.data.tracks.forEach((ele) => {
+						return (ele.status = false)
+					})
+				}
 				this.detailInfo = res.data
+				this.$set(this.detailInfo, 'status', false)
 			}
 		},
 		// 查看维修费用回调
@@ -209,6 +201,36 @@ export default {
 			uni.previewImage({
 				urls: img
 			})
+		},
+		// 点击录音播放回调
+		handlePlayRecording(item) {
+			// 先重置播放状态
+			if (this.detailInfo.id === item.id) {
+				this.detailInfo.tracks.forEach((ele) => {
+					ele.status = false
+				})
+			} else {
+				this.detailInfo.status = false
+				this.detailInfo.tracks.forEach((ele) => {
+					if (ele.id !== item.id) {
+						ele.status = false
+					}
+				})
+			}
+			// 赋值音频地址
+			innerAudioContext.src = item.voice
+			if (!item.status) {
+				item.status = true
+				innerAudioContext.play()
+
+				//播放结束
+				innerAudioContext.onEnded(() => {
+					item.status = false
+				})
+			} else {
+				item.status = false
+				innerAudioContext.stop()
+			}
 		}
 	}
 }
@@ -249,6 +271,22 @@ export default {
 				width: 28rpx;
 				height: 28rpx;
 			}
+
+			.recording {
+				display: flex;
+				align-items: center;
+				width: 130rpx;
+				height: 40rpx;
+				color: #000;
+				border-radius: 100rpx;
+				border: 1rpx solid #cccccc;
+
+				.voiceImg {
+					margin: 0 12rpx;
+					width: 30rpx;
+					height: 30rpx;
+				}
+			}
 		}
 
 		.box_value2 {
@@ -325,8 +363,34 @@ export default {
 	}
 
 	.steps_desc {
+		display: flex;
+		align-items: center;
 		line-height: 45rpx;
 		font-size: 24rpx;
+
+		img {
+			margin: 10rpx 0;
+			width: 80rpx;
+			height: 80rpx;
+			border-radius: 14rpx;
+		}
+
+		.desc_recording {
+			display: flex;
+			align-items: center;
+			margin-left: 10rpx;
+			width: 130rpx;
+			height: 40rpx;
+			color: #000;
+			border-radius: 100rpx;
+			border: 1rpx solid #cccccc;
+
+			.voiceImg {
+				margin: 0 12rpx;
+				width: 30rpx;
+				height: 30rpx;
+			}
+		}
 	}
 
 	.gap {

+ 17 - 4
pagesRepairs/repairRecord/repairRecord.vue

@@ -45,7 +45,14 @@
 			<view class="detail_box_item">
 				<view class="item_key">耗材单价</view>
 				<view class="item_value">
-					<input type="number" placeholder="请输入耗材单价" v-model="item.price" @blur="handleChangePrice($event, item)" />
+					<uni-easyinput
+						type="number"
+						:clearable="false"
+						v-model="item.price"
+						placeholder="请输入耗材单价"
+						placeholderStyle="font-size:16px"
+						@blur="handleChangePrice($event, item)"
+					></uni-easyinput>
 				</view>
 			</view>
 		</view>
@@ -295,8 +302,9 @@ export default {
 		},
 		// 添加耗材按钮回调
 		handleAdd() {
+			let temList = JSON.stringify(this.goodList.map((ele) => ele.consumeId))
 			uni.navigateTo({
-				url: '/pagesRepairs/addGoods/addGoods'
+				url: `/pagesRepairs/addGoods/addGoods?activeList=${temList}`
 			})
 		},
 		// 选择图片回调
@@ -567,8 +575,13 @@ export default {
 			.item_value {
 				font-weight: bold;
 
-				input {
+				::v-deep .is-input-border {
 					text-align: right;
+					border: none;
+				}
+
+				::v-deep .uni-easyinput__content-input {
+					font-size: 32rpx;
 				}
 			}
 		}
@@ -630,4 +643,4 @@ export default {
 		background-color: #6fb6b8;
 	}
 }
-</style>
+</style>

+ 14 - 22
pagesRepairs/repairs/repairs.vue

@@ -173,8 +173,8 @@ export default {
 			repairsNotice: '',
 			// 报修区域
 			repairsArea: '',
-			// 楼栋ID
-			buildId: null,
+			// 地址ID
+			addressId: null,
 			// 报修地址
 			repairsAddress: '',
 			// 报修物品
@@ -213,7 +213,9 @@ export default {
 			//画板边长默认是屏幕宽度,正方形画布
 			cw: uni.getSystemInfoSync().windowWidth,
 			// 当前校区Id
-			schoolId: null
+			schoolId: null,
+			// 楼栋Id
+			buildId: null
 		}
 	},
 	mounted() {
@@ -226,6 +228,8 @@ export default {
 		})
 		// 获取用户默认姓名
 		this.repairsName = uni.getStorageSync('repairsUserInfo').userName
+		// 获取用户默认手机号码
+		this.repairsPhone = uni.getStorageSync('repairsUserInfo').userPhone
 		this.getRepairNotice()
 		this.getSetPhone()
 	},
@@ -277,7 +281,7 @@ export default {
 									// 报修录音
 									voice: this.recordingPath,
 									// 报修录音时长
-									voiceLength: this.voiceLength,
+									voiceLength: this.recordingTime,
 									// 故障图片集合
 									images: this.subImgList,
 									// 报修姓名
@@ -288,31 +292,18 @@ export default {
 									userId: repairsUserInfo.userId,
 									// 校区ID
 									schoolId: this.schoolId,
-									// 楼栋ID
-									buildId: this.buildId
+									// 地址ID
+									buildId: this.addressId
 								}
 							})
 							// console.log(res)
 							if (res.code === '200') {
 								uni.showToast({
 									title: res.message,
-									icon: 'success'
+									icon: 'success',
+									mask: true
 								})
 
-								// 重置数据
-								// this.repairsArea = ''
-								// this.repairsAddress = ''
-								// this.repairsGoods = ''
-								// this.articleId = ''
-								// this.repairsDescription = ''
-								// this.recordingPath = ''
-								// this.imgList = []
-								// this.subImgList = []
-								// this.repairsName = ''
-								// this.repairsPhone = ''
-								// this.schoolId = null
-								// this.buildId = null
-
 								// 不是用户报修的单,则跳转回首页
 								if (repairsUserInfo.routes.includes('首页')) {
 									setTimeout(() => {
@@ -402,6 +393,7 @@ export default {
 			this.repairsArea = e.data
 			this.schoolId = e.schoolId
 			this.buildId = e.buildId
+			this.addressId = e.addressId
 		},
 		// 全局自定义事件
 		addRepairsGoods(e) {
@@ -522,7 +514,7 @@ export default {
 		// 点击报修区域回调
 		handleSelectArea() {
 			uni.navigateTo({
-				url: '/pagesRepairs/selectArea/selectArea'
+				url: `/pagesRepairs/selectArea/selectArea?schoolId=${this.schoolId}&buildId=${this.buildId}&addressId=${this.addressId}`
 			})
 		},
 		// 点击报修物品回调

+ 34 - 2
pagesRepairs/selectArea/selectArea.vue

@@ -36,6 +36,10 @@ export default {
 			current: 0,
 			// 校区ID
 			schoolId: 0,
+			// 楼栋Id
+			buildId: null,
+			// 地址Id
+			addressId: null,
 			// 左边分类数组
 			leftList: [],
 			// 左边分类数组当前索引
@@ -53,6 +57,13 @@ export default {
 	mounted() {
 		this.getSchoolList()
 	},
+	onLoad(options) {
+		if (options.schoolId) {
+			this.schoolId = options.schoolId
+			this.buildId = options.buildId
+			this.addressId = options.addressId
+		}
+	},
 	methods: {
 		// 获取校区数据
 		async getSchoolList() {
@@ -62,6 +73,12 @@ export default {
 			// console.log(res)
 			if (res.code === '200') {
 				this.schoolList = res.data
+				// 获取之前选择过的校区
+				this.schoolList.forEach((ele, index) => {
+					if (ele.id == this.schoolId) {
+						this.current = index
+					}
+				})
 				this.items = this.schoolList.map((ele) => ele.name)
 				this.schoolId = this.schoolList[this.current].id
 				this.getRepairAreaTree()
@@ -78,14 +95,28 @@ export default {
 			// console.log(res)
 			if (res.code === '200') {
 				this.areaTreeList = res.data
+				// 获取之前选择过的楼栋
+				this.areaTreeList.forEach((ele, index) => {
+					if (ele.id == this.buildId) {
+						this.active_left = index
+					}
+				})
 				this.leftList = this.areaTreeList.map((ele) => ele.name)
 				this.rightList = this.areaTreeList[this.active_left].children || []
+				// 获取之前选择过的地址
+				this.rightList.forEach((ele, index) => {
+					if (ele.id == this.addressId) {
+						this.active_right = index
+					}
+				})
 			}
 		},
 		// 顶部分段器切换选项回调
 		onClickItem(e) {
 			this.active_left = 0
 			this.active_right = null
+			this.buildId = null
+			this.addressId = null
 			if (this.current != e.currentIndex) {
 				this.current = e.currentIndex
 				this.schoolId = this.schoolList[this.current].id
@@ -105,7 +136,8 @@ export default {
 			uni.$emit('addRepairsArea', {
 				data: repairsArea,
 				schoolId: this.schoolId,
-				buildId: this.rightList[this.active_right].id
+				buildId: this.areaTreeList[this.active_left].id,
+				addressId: this.rightList[this.active_right].id
 			})
 			uni.navigateBack(1)
 		}
@@ -188,4 +220,4 @@ export default {
 ::v-deep .segmented-control {
 	height: 100rpx;
 }
-</style>
+</style>

二進制
static/images/repairsImg/play.png


二進制
static/images/repairsImg/play_active.png


+ 12 - 1
uni_modules/uni-easyinput/changelog.md

@@ -1,10 +1,21 @@
+## 1.1.9(2023-04-11)
+- 修复 vue3 下 keyboardheightchange 事件报错的bug
+## 1.1.8(2023-03-29)
+- 优化 trim 属性默认值
+## 1.1.7(2023-03-29)
+- 新增 cursor-spacing 属性
+## 1.1.6(2023-01-28)
+- 新增 keyboardheightchange 事件,可监听键盘高度变化
+## 1.1.5(2022-11-29)
+- 优化 主题样式
+## 1.1.4(2022-10-27)
+- 修复 props 中背景颜色无默认值的bug
 ## 1.1.0(2022-06-30)
 
 - 新增 在 uni-forms 1.4.0 中使用可以在 blur 时校验内容
 - 新增 clear 事件,点击右侧叉号图标触发
 - 新增 change 事件 ,仅在输入框失去焦点或用户按下回车时触发
 - 优化 组件样式,组件获取焦点时高亮显示,图标颜色调整等
--
 
 ## 1.0.5(2022-06-07)
 

+ 115 - 137
uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue

@@ -1,24 +1,7 @@
 <template>
-	<view
-		class="uni-easyinput"
-		:class="{ 'uni-easyinput-error': msg }"
-		:style="boxStyle"
-	>
-		<view
-			class="uni-easyinput__content"
-			:class="inputContentClass"
-			:style="inputContentStyle"
-		>
-			<slot name="prefixIcon">
-				<uni-icons
-					v-if="prefixIcon"
-					class="content-clear-icon"
-					:type="prefixIcon"
-					color="#c0c4cc"
-					@click="onClickIcon('prefix')"
-					size="22"
-				></uni-icons>
-			</slot>
+	<view class="uni-easyinput" :class="{ 'uni-easyinput-error': msg }" :style="boxStyle">
+		<view class="uni-easyinput__content" :class="inputContentClass" :style="inputContentStyle">
+			<uni-icons v-if="prefixIcon" class="content-clear-icon" :type="prefixIcon" color="#c0c4cc" @click="onClickIcon('prefix')" size="22"></uni-icons>
 			<textarea
 				v-if="type === 'textarea'"
 				class="uni-easyinput__content-textarea"
@@ -32,10 +15,12 @@
 				:maxlength="inputMaxlength"
 				:focus="focused"
 				:autoHeight="autoHeight"
+				:cursor-spacing="cursorSpacing"
 				@input="onInput"
 				@blur="_Blur"
 				@focus="_Focus"
 				@confirm="onConfirm"
+        @keyboardheightchange="onkeyboardheightchange"
 			></textarea>
 			<input
 				v-else
@@ -52,10 +37,12 @@
 				:maxlength="inputMaxlength"
 				:focus="focused"
 				:confirmType="confirmType"
+				:cursor-spacing="cursorSpacing"
 				@focus="_Focus"
 				@blur="_Blur"
 				@input="onInput"
 				@confirm="onConfirm"
+        @keyboardheightchange="onkeyboardheightchange"
 			/>
 			<template v-if="type === 'password' && passwordIcon">
 				<!-- 开启密码时显示小眼睛 -->
@@ -67,20 +54,10 @@
 					:size="22"
 					:color="focusShow ? primaryColor : '#c0c4cc'"
 					@click="onEyes"
-				>
-				</uni-icons>
+				></uni-icons>
 			</template>
-			<template v-else-if="suffixIcon || $slots.suffixIcon">
-				<slot name="suffixIcon">
-					<uni-icons
-						v-if="suffixIcon"
-						class="content-clear-icon"
-						:type="suffixIcon"
-						color="#c0c4cc"
-						@click="onClickIcon('suffix')"
-						size="22"
-					></uni-icons>
-				</slot>
+			<template v-else-if="suffixIcon">
+				<uni-icons v-if="suffixIcon" class="content-clear-icon" :type="suffixIcon" color="#c0c4cc" @click="onClickIcon('suffix')" size="22"></uni-icons>
 			</template>
 			<template v-else>
 				<uni-icons
@@ -124,6 +101,7 @@
  * @property {String}	suffixIcon	输入框尾部图标
  * @property {String}	primaryColor	设置主题色(默认#2979ff)
  * @property {Boolean}	trim	是否自动去除两端的空格
+ * @property {Boolean}	cursorSpacing	指定光标与键盘的距离,单位 px
  * @value both	去除两端空格
  * @value left	去除左侧空格
  * @value right	去除右侧空格
@@ -139,12 +117,10 @@
  * @event {Function}	blur	输入框失去焦点时触发
  * @event {Function}	confirm	点击完成按钮时触发
  * @event {Function}	iconClick	点击图标时触发
- * @slot prefixIcon 输入框头部插槽
- * @slot suffixIcon 输入框尾部插槽
  * @example <uni-easyinput v-model="mobile"></uni-easyinput>
  */
 function obj2strClass(obj) {
-	let classess = "";
+	let classess = '';
 	for (let key in obj) {
 		const val = obj[key];
 		if (val) {
@@ -155,7 +131,7 @@ function obj2strClass(obj) {
 }
 
 function obj2strStyle(obj) {
-	let style = "";
+	let style = '';
 	for (let key in obj) {
 		const val = obj[key];
 		style += `${key}:${val};`;
@@ -163,35 +139,24 @@ function obj2strStyle(obj) {
 	return style;
 }
 export default {
-	name: "uni-easyinput",
-	emits: [
-		"click",
-		"iconClick",
-		"update:modelValue",
-		"input",
-		"focus",
-		"blur",
-		"confirm",
-		"clear",
-		"eyes",
-		"change",
-	],
+	name: 'uni-easyinput',
+	emits: ['click', 'iconClick', 'update:modelValue', 'input', 'focus', 'blur', 'confirm', 'clear', 'eyes', 'change', 'keyboardheightchange'],
 	model: {
-		prop: "modelValue",
-		event: "update:modelValue",
+		prop: 'modelValue',
+		event: 'update:modelValue'
 	},
 	options: {
-		virtualHost: true,
+		virtualHost: true
 	},
 	inject: {
 		form: {
-			from: "uniForm",
-			default: null,
+			from: 'uniForm',
+			default: null
 		},
 		formItem: {
-			from: "uniFormItem",
-			default: null,
-		},
+			from: 'uniFormItem',
+			default: null
+		}
 	},
 	props: {
 		name: String,
@@ -199,91 +164,97 @@ export default {
 		modelValue: [Number, String],
 		type: {
 			type: String,
-			default: "text",
+			default: 'text'
 		},
 		clearable: {
 			type: Boolean,
-			default: true,
+			default: true
 		},
 		autoHeight: {
 			type: Boolean,
-			default: false,
+			default: false
 		},
 		placeholder: {
 			type: String,
-			default: " ",
+			default: ' '
 		},
 		placeholderStyle: String,
 		focus: {
 			type: Boolean,
-			default: false,
+			default: false
 		},
 		disabled: {
 			type: Boolean,
-			default: false,
+			default: false
 		},
 		maxlength: {
 			type: [Number, String],
-			default: 140,
+			default: 140
 		},
 		confirmType: {
 			type: String,
-			default: "done",
+			default: 'done'
 		},
 		clearSize: {
 			type: [Number, String],
-			default: 24,
+			default: 24
 		},
 		inputBorder: {
 			type: Boolean,
-			default: true,
+			default: true
 		},
 		prefixIcon: {
 			type: String,
-			default: "",
+			default: ''
 		},
 		suffixIcon: {
 			type: String,
-			default: "",
+			default: ''
 		},
 		trim: {
 			type: [Boolean, String],
-			default: true,
+			default: false
+		},
+		cursorSpacing: {
+			type: Number,
+			default: 0
 		},
 		passwordIcon: {
 			type: Boolean,
-			default: true,
+			default: true
 		},
 		primaryColor: {
 			type: String,
-			default: "#2979ff",
+			default: '#2979ff'
 		},
 		styles: {
 			type: Object,
 			default() {
 				return {
-					color: "#333",
-					disableColor: "#F7F6F6",
-					borderColor: "#e5e5e5",
+					color: '#333',
+					backgroundColor: '#fff',
+					disableColor: '#F7F6F6',
+					borderColor: '#e5e5e5'
 				};
-			},
+			}
 		},
 		errorMessage: {
 			type: [String, Boolean],
-			default: "",
-		},
+			default: ''
+		}
 	},
 	data() {
 		return {
 			focused: false,
-			val: "",
-			showMsg: "",
+			val: '',
+			showMsg: '',
 			border: false,
 			isFirstBorder: false,
 			showClearIcon: false,
 			showPassword: false,
 			focusShow: false,
-			localMsg: "",
+			localMsg: '',
+			isEnter: false // 用于判断当前是否是使用回车操作
 		};
 	},
 	computed: {
@@ -312,42 +283,34 @@ export default {
 
 		// 处理外层样式的style
 		boxStyle() {
-			return `color:${
-				this.inputBorder && this.msg ? "#e43d33" : this.styles.color
-			};`;
+			return `color:${this.inputBorder && this.msg ? '#e43d33' : this.styles.color};`;
 		},
 		// input 内容的类和样式处理
 		inputContentClass() {
 			return obj2strClass({
-				"is-input-border": this.inputBorder,
-				"is-input-error-border": this.inputBorder && this.msg,
-				"is-textarea": this.type === "textarea",
-				"is-disabled": this.disabled,
+				'is-input-border': this.inputBorder,
+				'is-input-error-border': this.inputBorder && this.msg,
+				'is-textarea': this.type === 'textarea',
+				'is-disabled': this.disabled,
+				'is-focused': this.focusShow
 			});
 		},
 		inputContentStyle() {
-			const focusColor = this.focusShow
-				? this.primaryColor
-				: this.styles.borderColor;
-			const borderColor = this.inputBorder && this.msg ? "#dd524d" : focusColor;
+			const focusColor = this.focusShow ? this.primaryColor : this.styles.borderColor;
+			const borderColor = this.inputBorder && this.msg ? '#dd524d' : focusColor;
 			return obj2strStyle({
-				"border-color": borderColor || "#e5e5e5",
-				"background-color": this.disabled
-					? this.styles.disableColor
-					: this.styles.backgroundColor,
+				'border-color': borderColor || '#e5e5e5',
+				'background-color': this.disabled ? this.styles.disableColor : this.styles.backgroundColor
 			});
 		},
 		// input右侧样式
 		inputStyle() {
-			const paddingRight =
-				this.type === "password" || this.clearable || this.prefixIcon
-					? ""
-					: "10px";
+			const paddingRight = this.type === 'password' || this.clearable || this.prefixIcon ? '' : '10px';
 			return obj2strStyle({
-				"padding-right": paddingRight,
-				"padding-left": this.prefixIcon ? "" : "10px",
+				'padding-right': paddingRight,
+				'padding-left': this.prefixIcon ? '' : '10px'
 			});
-		},
+		}
 	},
 	watch: {
 		value(newVal) {
@@ -361,13 +324,13 @@ export default {
 				this.focused = this.focus;
 				this.focusShow = this.focus;
 			});
-		},
+		}
 	},
 	created() {
 		this.init();
 		// TODO 处理头条vue3 computed 不监听 inject 更改的问题(formItem.errMsg)
 		if (this.form && this.formItem) {
-			this.$watch("formItem.errMsg", (newVal) => {
+			this.$watch('formItem.errMsg', newVal => {
 				this.localMsg = newVal;
 			});
 		}
@@ -385,7 +348,7 @@ export default {
 		init() {
 			if (this.value || this.value === 0) {
 				this.val = this.value;
-			} else if (this.modelValue || this.modelValue === 0) {
+			} else if (this.modelValue || this.modelValue === 0 || this.modelValue === '') {
 				this.val = this.modelValue;
 			} else {
 				this.val = null;
@@ -397,7 +360,7 @@ export default {
 		 * @param {Object} type
 		 */
 		onClickIcon(type) {
-			this.$emit("iconClick", type);
+			this.$emit('iconClick', type);
 		},
 
 		/**
@@ -405,7 +368,7 @@ export default {
 		 */
 		onEyes() {
 			this.showPassword = !this.showPassword;
-			this.$emit("eyes", this.showPassword);
+			this.$emit('eyes', this.showPassword);
 		},
 
 		/**
@@ -416,19 +379,19 @@ export default {
 			let value = event.detail.value;
 			// 判断是否去除空格
 			if (this.trim) {
-				if (typeof this.trim === "boolean" && this.trim) {
+				if (typeof this.trim === 'boolean' && this.trim) {
 					value = this.trimStr(value);
 				}
-				if (typeof this.trim === "string") {
+				if (typeof this.trim === 'string') {
 					value = this.trimStr(value, this.trim);
 				}
 			}
-			if (this.errMsg) this.errMsg = "";
+			if (this.errMsg) this.errMsg = '';
 			this.val = value;
 			// TODO 兼容 vue2
-			this.$emit("input", value);
+			this.$emit('input', value);
 			// TODO 兼容 vue3
-			this.$emit("update:modelValue", value);
+			this.$emit('update:modelValue', value);
 		},
 
 		/**
@@ -440,12 +403,12 @@ export default {
 			this.$nextTick(() => {
 				this.focused = true;
 			});
-			this.$emit("focus", null);
+			this.$emit('focus', null);
 		},
 
 		_Focus(event) {
 			this.focusShow = true;
-			this.$emit("focus", event);
+			this.$emit('focus', event);
 		},
 
 		/**
@@ -455,18 +418,20 @@ export default {
 		 */
 		onBlur() {
 			this.focused = false;
-			this.$emit("focus", null);
+			this.$emit('focus', null);
 		},
 		_Blur(event) {
 			let value = event.detail.value;
 			this.focusShow = false;
-			this.$emit("blur", event);
+			this.$emit('blur', event);
 			// 根据类型返回值,在event中获取的值理论上讲都是string
-			this.$emit("change", this.val);
+			if (this.isEnter === false) {
+				this.$emit('change', this.val);
+			}
 			// 失去焦点时参与表单校验
 			if (this.form && this.formItem) {
 				const { validateTrigger } = this.form;
-				if (validateTrigger === "blur") {
+				if (validateTrigger === 'blur') {
 					this.formItem.onFieldChange();
 				}
 			}
@@ -477,8 +442,12 @@ export default {
 		 * @param {Object} e
 		 */
 		onConfirm(e) {
-			this.$emit("confirm", this.val);
-			this.$emit("change", this.val);
+			this.$emit('confirm', this.val);
+			this.isEnter = true;
+			this.$emit('change', this.val);
+			this.$nextTick(() => {
+				this.isEnter = false;
+			});
 		},
 
 		/**
@@ -486,38 +455,47 @@ export default {
 		 * @param {Object} event
 		 */
 		onClear(event) {
-			this.val = "";
+			this.val = '';
 			// TODO 兼容 vue2
-			this.$emit("input", "");
+			this.$emit('input', '');
 			// TODO 兼容 vue2
 			// TODO 兼容 vue3
-			this.$emit("update:modelValue", "");
+			this.$emit('update:modelValue', '');
 			// 点击叉号触发
-			this.$emit("clear");
+			this.$emit('clear');
 		},
 
+    /**
+     * 键盘高度发生变化的时候触发此事件
+     * 兼容性:微信小程序2.7.0+、App 3.1.0+
+     * @param {Object} event
+     */
+    onkeyboardheightchange(event) {
+      this.$emit("keyboardheightchange",event);
+    },
+
 		/**
 		 * 去除空格
 		 */
-		trimStr(str, pos = "both") {
-			if (pos === "both") {
+		trimStr(str, pos = 'both') {
+			if (pos === 'both') {
 				return str.trim();
-			} else if (pos === "left") {
+			} else if (pos === 'left') {
 				return str.trimLeft();
-			} else if (pos === "right") {
+			} else if (pos === 'right') {
 				return str.trimRight();
-			} else if (pos === "start") {
+			} else if (pos === 'start') {
 				return str.trimStart();
-			} else if (pos === "end") {
+			} else if (pos === 'end') {
 				return str.trimEnd();
-			} else if (pos === "all") {
-				return str.replace(/\s+/g, "");
-			} else if (pos === "none") {
+			} else if (pos === 'all') {
+				return str.replace(/\s+/g, '');
+			} else if (pos === 'none') {
 				return str;
 			}
 			return str;
-		},
-	},
+		}
+	}
 };
 </script>
 

+ 1 - 1
uni_modules/uni-easyinput/package.json

@@ -1,7 +1,7 @@
 {
   "id": "uni-easyinput",
   "displayName": "uni-easyinput 增强输入框",
-  "version": "1.1.3",
+  "version": "1.1.9",
   "description": "Easyinput 组件是对原生input组件的增强",
   "keywords": [
     "uni-ui",