Parcourir la source

工人待维修工单列表,提交维修结果页

xyg il y a 2 ans
Parent
commit
1940806190

BIN
nnzwminiapp/pages/images/worker.png


+ 169 - 169
nnzwminiapp/pages/myCenter/myCenter.js

@@ -1,191 +1,191 @@
 // pages/nais/nais.js
 import {
-	imgUrl
+    imgUrl
 } from "../api/request"
 
 import {
-	cacheGet
+    cacheGet
 } from "../../utils/cacheUtil"
 let app = getApp();
 Page({
-	/**
-	 * 页面的初始数据
-	 */
-	data: {
-		canIUseGetUserProfile: true,
-		nickName: "",
-		avatarUrl: "",
-		hasUserInfo: false,
-		imgUrl: imgUrl,
-		show: false
-	},
-	// 自定义函数
-	toCanteen: function (e) {
-		wx.navigateTo({
-			url: '/pages/ourCanteen/ourCanteen'
-		})
-    },
-    
-    toWorkOrder:function(e) {
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        canIUseGetUserProfile: true,
+        nickName: "",
+        avatarUrl: "",
+        hasUserInfo: false,
+        imgUrl: imgUrl,
+        show: false
+    },
+    // 自定义函数
+    toCanteen: function (e) {
+        wx.navigateTo({
+            url: '/pages/ourCanteen/ourCanteen'
+        })
+    },
+
+    toWorkOrder: function (e) {
         wx.navigateTo({
-          url: '/pagesPublic/pages/work-order/work-order',
+            url: '/pagesPublic/pages/work-order/work-order',
         });
     },
 
-	handleAction() {
-		var that = this
-		wx.showActionSheet({
-			itemList: ['退出登录'],
-			success(res) {
-				console.log(res.tapIndex)
-				wx.clearStorageSync();
-				that.setData({
-					show: false,
-					canIUseGetUserProfile: true,
-					hasUserInfo: false
-				})
-			},
-			fail(res) {
-				console.log(res.errMsg)
-			}
-		})
-	},
+    handleAction() {
+        var that = this
+        wx.showActionSheet({
+            itemList: ['退出登录'],
+            success(res) {
+                console.log(res.tapIndex)
+                wx.clearStorageSync();
+                that.setData({
+                    show: false,
+                    canIUseGetUserProfile: true,
+                    hasUserInfo: false
+                })
+            },
+            fail(res) {
+                console.log(res.errMsg)
+            }
+        })
+    },
 
-	/**
-	 * 生命周期函数--监听页面初次渲染完成
-	 */
-	onReady() {
-		if (typeof this.getTabBar === 'function' &&
-			this.getTabBar()) {
-			this.getTabBar().setData({
-				selected: 4
-			})
-		}
-	},
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+        if (typeof this.getTabBar === 'function' &&
+            this.getTabBar()) {
+            this.getTabBar().setData({
+                selected: 4
+            })
+        }
+    },
 
-	/**
-	 * 生命周期函数--监听页面显示
-	 */
-	onShow() {
-		// let token = wx.getStorageSync('token');
-		let token = cacheGet('token');
-		if (token != null && token != '') {
-			this.setData({
-				canIUseGetUserProfile: false,
-				nickName: wx.getStorageSync('nickName'),
-				avatarUrl: wx.getStorageSync('imgUrl'),
-				hasUserInfo: true
-			})
-		} else {
-			this.setData({
-				hasUserInfo: false,
-				canIUseGetUserProfile: true
-			})
-		}
-		if (typeof this.getTabBar === 'function' &&
-			this.getTabBar()) {
-			this.getTabBar().setData({
-				selected: 4
-			})
-		}
-	},
-	onHide() {
-		if (typeof this.getTabBar === 'function' &&
-			this.getTabBar()) {
-			this.getTabBar().setData({
-				selected: -1
-			})
-		}
-	},
-	onLoad() {
-		// let token = wx.getStorageSync('token');
-		let token = cacheGet('token');
-		if (token != null && token != '') {
-			this.setData({
-				nickName: wx.getStorageSync('nickName'),
-				avatarUrl: wx.getStorageSync('imgUrl'),
-				hasUserInfo: true
-			})
-		}
-	},
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+        // let token = wx.getStorageSync('token');
+        let token = cacheGet('token');
+        if (token != null && token != '') {
+            this.setData({
+                canIUseGetUserProfile: false,
+                nickName: wx.getStorageSync('nickName'),
+                avatarUrl: wx.getStorageSync('imgUrl'),
+                hasUserInfo: true
+            })
+        } else {
+            this.setData({
+                hasUserInfo: false,
+                canIUseGetUserProfile: true
+            })
+        }
+        if (typeof this.getTabBar === 'function' &&
+            this.getTabBar()) {
+            this.getTabBar().setData({
+                selected: 4
+            })
+        }
+    },
+    onHide() {
+        if (typeof this.getTabBar === 'function' &&
+            this.getTabBar()) {
+            this.getTabBar().setData({
+                selected: -1
+            })
+        }
+    },
+    onLoad() {
+        // let token = wx.getStorageSync('token');
+        let token = cacheGet('token');
+        if (token != null && token != '') {
+            this.setData({
+                nickName: wx.getStorageSync('nickName'),
+                avatarUrl: wx.getStorageSync('imgUrl'),
+                hasUserInfo: true
+            })
+        }
+    },
 
-	/**
-	 * 生命周期函数--监听页面卸载
-	 */
-	onUnload() {
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
 
-	},
+    },
 
-	/**
-	 * 页面相关事件处理函数--监听用户下拉动作
-	 */
-	onPullDownRefresh() {
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
 
-	},
+    },
 
-	/**
-	 * 页面上拉触底事件的处理函数
-	 */
-	onReachBottom() {
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
 
-	},
+    },
 
-	/**
-	 * 用户点击右上角分享
-	 */
-	onShareAppMessage() {
-		return {
-			title: '个人中心'
-		}
-	},
-	toLike() {
-		wx.navigateTo({
-			url: '/pagesPublic/pages/like/like',
-		})
-	},
-	navto() {
-		wx.navigateTo({
-			url: '/pagesPublic/pages/menu/menu',
-		})
-	},
-	// toPersonalData() {
-	// 	wx.navigateTo({
-	// 		url: '/pagesPublic/pages/personalData/index/personalData',
-	// 	})
-	// },
-	gotoMyCollection() {
-		wx.navigateTo({
-			url: '/pagesPublic/pages/myCollection/myCollection',
-		})
-	},
-	toMyComment() {
-		wx.navigateTo({
-			url: '/pagesPublic/pages/myComment/myComment',
-		})
-	},
-	tologin() {
-		wx.navigateTo({
-			url: '/pages/login/login',
-		})
-	},
-	getUserInfo() {
-		// this.setData({
-		// 	nickName: wx.getStorageSync('nickName'),
-		// 	avatarUrl: wx.getStorageSync('imgUrl'),
-		// 	hasUserInfo: true
-		// })
-	},
-	// logout(){
-	// 	this.setData({
-	// 		hasUserInfo: false,
-	// 		nickName:"",
-	// 		avatarUrl:""
-	// 	})
-	// 	wx.removeStorage({
-	// 	  key: 'nickName',
-	// 	})(option)
-	// 	wx.removeStorage({
-	// 		key: 'imgUrl',
-	// 	  })(option)
-	// }
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+        return {
+            title: '个人中心'
+        }
+    },
+    toLike() {
+        wx.navigateTo({
+            url: '/pagesPublic/pages/like/like',
+        })
+    },
+    navto() {
+        wx.navigateTo({
+            url: '/pagesPublic/pages/menu/menu',
+        })
+    },
+    // toPersonalData() {
+    // 	wx.navigateTo({
+    // 		url: '/pagesPublic/pages/personalData/index/personalData',
+    // 	})
+    // },
+    gotoMyCollection() {
+        wx.navigateTo({
+            url: '/pagesPublic/pages/myCollection/myCollection',
+        })
+    },
+    toMyComment() {
+        wx.navigateTo({
+            url: '/pagesPublic/pages/myComment/myComment',
+        })
+    },
+    tologin() {
+        wx.navigateTo({
+            url: '/pages/login/login',
+        })
+    },
+    getUserInfo() {
+        // this.setData({
+        // 	nickName: wx.getStorageSync('nickName'),
+        // 	avatarUrl: wx.getStorageSync('imgUrl'),
+        // 	hasUserInfo: true
+        // })
+    },
+    // logout(){
+    // 	this.setData({
+    // 		hasUserInfo: false,
+    // 		nickName:"",
+    // 		avatarUrl:""
+    // 	})
+    // 	wx.removeStorage({
+    // 	  key: 'nickName',
+    // 	})(option)
+    // 	wx.removeStorage({
+    // 		key: 'imgUrl',
+    // 	  })(option)
+    // }
 })

+ 12 - 1
nnzwminiapp/pagesPublic/pages/work-order-detail/work-order-detail.js

@@ -10,7 +10,7 @@ Page({
      */
     data: {
         imgUrl: imgUrl,
-
+        isWorker: false
     },
 
     /**
@@ -68,4 +68,15 @@ Page({
     backTap() {
         wx.navigateBack();
     },
+
+    /**
+     * 上传报修结果图片
+     */
+    uploadImage() {
+        wx.chooseMedia({
+            success(res) {
+                console.info(res);
+            }
+        });
+    },
 })

+ 29 - 1
nnzwminiapp/pagesPublic/pages/work-order-detail/work-order-detail.wxml

@@ -36,7 +36,8 @@
         </view>
     </view>
 </view>
-<view class="progressBox">
+
+<view class="progressBox" wx:if="{{isWorker}}">
     <view class="progress-head">
         <image class="head-image" src="/pages/images/hourglass.png" mode="" />
         <text class="head-title">维修进度</text>
@@ -78,4 +79,31 @@
             <view class="status-text">待确认</view>
         </view>
     </view>
+</view>
+
+<view class="progressBox" wx:else="{{isWorker}}">
+    <view class="progress-head">
+        <image class="head-image2" src="/pages/images/worker.png" mode="" />
+        <text class="head-title2">维修结果填报</text>
+    </view>
+    <view class="report-form">
+        <form bindsubmit="submitReport">
+            <view class="report-row">
+                <label for="" class="report-label">是否完成维修:</label>
+                <radio-group bindchange="">
+                    <label for="">
+                        <radio value="已完成" checked="true" />已完成
+                    </label>
+                    <label for="">
+                        <radio value="未完成" />未完成
+                    </label>
+                </radio-group>
+            </view>
+            <view class="report-row" style="align-items: flex-start;">
+                <label for="" class="report-label">维修结果:</label>
+                <image class="report-photo" src="/pages/images/photo2.png" mode="" bindtap="uploadImage" />
+            </view>
+            <button class="report-submit" form-type="submit">提 交</button>
+        </form>
+    </view>
 </view>

+ 66 - 1
nnzwminiapp/pagesPublic/pages/work-order-detail/work-order-detail.wxss

@@ -71,7 +71,7 @@ page {
     border-radius: 10rpx;
     margin-left: 35rpx;
     margin-right: 27rpx;
-    height: 900rpx;
+    height: 700rpx;
     /* margin-top: -10rpx; */
 }
 
@@ -180,4 +180,69 @@ page {
 .status-text.checked {
     color: #3A9C68;
     font-weight: 500;
+}
+
+.head-image2 {
+    width: 28rpx;
+    height: 33rpx;
+    margin-left: 20rpx;
+}
+
+.head-title2 {
+    font-size: 28rpx;
+    font-family: PingFang SC;
+    font-weight: 500;
+    color: #4189FF;
+    margin-left: 16rpx;
+}
+
+.report-row {
+    margin-top: 65rpx;
+    margin-left: 15rpx;
+    display: inline-flex;
+    flex-direction: row;
+    align-items: center;
+    font-size: 28rpx;
+}
+
+.report-label {
+    width: 200rpx;
+    text-align: right;
+    color: #333333;
+}
+
+radio-group label:aria-checked {
+    color: #508FF4;
+}
+
+radio-group radio:aria-checked {
+    color: #508FF4;
+}
+
+radio-group label {
+    color: #999999;
+}
+
+radio-group label:nth-child(2) {
+    margin-left: 100rpx;
+}
+
+.report-photo {
+    width: 44rpx;
+    height: 40rpx;
+    background: #E9E9E9 113rpx 113rpx;
+    padding: 36rpx 35rpx;
+}
+
+.report-submit {
+    position: absolute;
+    left: 0;
+    bottom: 0;
+    width: 100%;
+    height: 96rpx;
+    background: #508FF4;
+    color: #FFFFFF;
+    font-size: 28rpx;
+    line-height: 96rpx;
+    border-radius: 0;
 }

+ 56 - 0
nnzwminiapp/pagesPublic/pages/work-order/work-order-worker.wxml

@@ -0,0 +1,56 @@
+<!--pagesPublic/pages/work-order/work-order-worker.wxml-->
+<view>
+    <view class="navBox">
+        <view class="titleBox" bindtap="titleClick" data-idx="0">
+            <text class="{{0 == currentIndex ? 'fontColorBox' : ''}}">待维修工单</text>
+            <hr class="{{0 == currentIndex ? 'lineBox' : 'notLineBox'}}" />
+        </view>
+        <view class="titleBox" bindtap="titleClick" data-idx="1">
+            <text class="{{1 == currentIndex ? 'fontColorBox' : ''}}">已完成工单</text>
+            <hr class="{{1 == currentIndex ? 'lineBox' : 'notLineBox'}}" />
+        </view>
+    </view>
+    <swiper class="swiperBox" bindchange="pagechange" current="{{currentIndex}}">
+        <swiper-item class="swiperTtemBox">
+            <scroll-view class="viewBox" wx:for="{{list}}" wx:for-item="item" wx:key="index">
+                <view class="item" bindtap="toDetail">
+                    <view class="item-row">
+                        <text class="item-label">报修类型:</text>
+                        <text class="item-value">{{item.type}}</text>
+                    </view>
+                    <view class="item-row">
+                        <text class="item-label">维修地址:</text>
+                        <text class="item-value">{{item.address}}</text>
+                    </view>
+                    <view class="item-row">
+                        <text class="item-label">预约时间:</text>
+                        <text class="item-value">{{item.time}}</text>
+                    </view>
+                </view>
+            </scroll-view>
+        </swiper-item>
+        <swiper-item class="swiperTtemBox">
+            <scroll-view class="viewBox" wx:for="{{list}}" wx:for-item="item" wx:key="index">
+                <view class="item" bindtap="toDetail">
+                    <image class="item-status" src="/pages/images/status-complete.png" mode="" />
+                    <view class="item-row">
+                        <text class="item-label">报修类型:</text>
+                        <text class="item-value">{{item.type}}</text>
+                    </view>
+                    <view class="item-row">
+                        <text class="item-label">维修地址:</text>
+                        <text class="item-value">{{item.address}}</text>
+                    </view>
+                    <view class="item-row">
+                        <text class="item-label">维修结果:</text>
+                        <text class="item-value">{{item.time}}</text>
+                    </view>
+                    <view class="item-row">
+                        <text class="item-label">原因:</text>
+                        <text class="item-value">{{item.time}}</text>
+                    </view>
+                </view>
+            </scroll-view>
+        </swiper-item>
+    </swiper>
+</view>

+ 7 - 0
nnzwminiapp/pagesPublic/pages/work-order/work-order.js

@@ -7,6 +7,7 @@ Page({
      * 页面的初始数据
      */
     data: {
+        isWorker: false,
         currentIndex: 0,
         date: '2023-10-01',
         time: '12:00',
@@ -130,5 +131,11 @@ Page({
         wx.navigateTo({
             url: '../work-order-detail/work-order-detail',
         });
+    },
+
+    toRepairDetail() {
+        wx.navigateTo({
+            url: '../work-order-detail/work-order-detail',
+        });
     }
 })

+ 59 - 5
nnzwminiapp/pagesPublic/pages/work-order/work-order.wxml

@@ -1,5 +1,5 @@
 <!--pagesPublic/pages/work-order/work-order.wxml-->
-<view>
+<view wx:if="{{isWorker}}">
     <view class="navBox">
         <view class="titleBox" bindtap="titleClick" data-idx="0">
             <text class="{{0 == currentIndex ? 'fontColorBox' : ''}}">发起工单</text>
@@ -27,7 +27,7 @@
                         <label for="" class="form-item-label">问题描述:</label>
                         <input type="text" class="form-input" name="description" maxlength="500" placeholder="请描述您的问题" placeholder-style="color:#999999" />
                     </view>
-                    <view class="form-item">
+                    <view class="form-item" style="align-items: flex-start;">
                         <label for="" class="form-item-label">报修物品图片:</label>
                         <image class="form-photo" src="/pages/images/photo2.png" mode="" bindtap="uploadImage" />
                         <input type="text" name="" style="display: none;" />
@@ -40,9 +40,7 @@
                         <label for="" class="form-item-label">预约上门时间:</label>
                         <picker class="form-item-picker" mode="multiSelector" value="{{dateTime}}" bindchange="changeDateTime" bindcolumnchange="changeDateTimeColumn" range="{{dateTimeArray}}">
                             <input type="text" class="form-input" style="width: 100%;" name="arriveTime" disabled="true" placeholder="请选择上门时间" placeholder-style="color:#999999" value="{{dateTimeArray[0][dateTime[0]]}}-{{dateTimeArray[1][dateTime[1]]}}-{{dateTimeArray[2][dateTime[2]]}} {{dateTimeArray[3][dateTime[3]]}}:{{dateTimeArray[4][dateTime[4]]}}:{{dateTimeArray[5][dateTime[5]]}}" />
-                            <!-- <image class="form-icon" src="/pages/images/arrow.png" alt="" bindtap="pickArriveTime"></image> -->
                         </picker>
-                        <!-- <input type="text" class="form-input" name="arriveTime" disabled="true" placeholder="请选择上门时间" placeholder-style="color:#999999" /> -->
                         <image class="form-icon" src="/pages/images/arrow.png" alt="" bindtap="pickArriveTime"></image>
                     </view>
                 </view>
@@ -50,7 +48,7 @@
             </form>
         </swiper-item>
         <swiper-item class="swiperTtemBox">
-            <scroll-view class="viewBox" wx:for="{{list}}" wx:for-item="item">
+            <scroll-view class="viewBox" wx:for="{{list}}" wx:for-item="item" wx:key="index">
                 <view class="item" bindtap="toDetail">
                     <image class="item-status" src="/pages/images/status-complete.png" mode="" />
                     <view class="item-row">
@@ -69,4 +67,60 @@
             </scroll-view>
         </swiper-item>
     </swiper>
+</view>
+
+<view wx:else>
+    <view class="navBox">
+        <view class="titleBox" bindtap="titleClick" data-idx="0">
+            <text class="{{0 == currentIndex ? 'fontColorBox' : ''}}">待维修工单</text>
+            <hr class="{{0 == currentIndex ? 'lineBox' : 'notLineBox'}}" />
+        </view>
+        <view class="titleBox" bindtap="titleClick" data-idx="1">
+            <text class="{{1 == currentIndex ? 'fontColorBox' : ''}}">已完成工单</text>
+            <hr class="{{1 == currentIndex ? 'lineBox' : 'notLineBox'}}" />
+        </view>
+    </view>
+    <swiper class="swiperBox" bindchange="pagechange" current="{{currentIndex}}">
+        <swiper-item class="swiperTtemBox">
+            <scroll-view class="viewBox" wx:for="{{list}}" wx:for-item="item" wx:key="index">
+                <view class="item" bindtap="toRepairDetail">
+                    <view class="item-row">
+                        <text class="item-label">报修类型:</text>
+                        <text class="item-value">{{item.type}}</text>
+                    </view>
+                    <view class="item-row">
+                        <text class="item-label">维修地址:</text>
+                        <text class="item-value">{{item.address}}</text>
+                    </view>
+                    <view class="item-row">
+                        <text class="item-label">预约时间:</text>
+                        <text class="item-value">{{item.time}}</text>
+                    </view>
+                </view>
+            </scroll-view>
+        </swiper-item>
+        <swiper-item class="swiperTtemBox">
+            <scroll-view class="viewBox" wx:for="{{list}}" wx:for-item="item" wx:key="index">
+                <view class="item" bindtap="toDetail">
+                    <image class="item-status" src="/pages/images/status-complete.png" mode="" />
+                    <view class="item-row">
+                        <text class="item-label">报修类型:</text>
+                        <text class="item-value">{{item.type}}</text>
+                    </view>
+                    <view class="item-row">
+                        <text class="item-label">维修地址:</text>
+                        <text class="item-value">{{item.address}}</text>
+                    </view>
+                    <view class="item-row">
+                        <text class="item-label">维修结果:</text>
+                        <text class="item-value">{{item.time}}</text>
+                    </view>
+                    <view class="item-row">
+                        <text class="item-label">原因:</text>
+                        <text class="item-value">{{item.time}}</text>
+                    </view>
+                </view>
+            </scroll-view>
+        </swiper-item>
+    </swiper>
 </view>