فهرست منبع

报道打卡修改

zhanghui 2 سال پیش
والد
کامیت
c9ba486572
6فایلهای تغییر یافته به همراه113 افزوده شده و 132 حذف شده
  1. 17 1
      common/js/service.js
  2. 1 1
      common/js/user.js
  3. 1 3
      pages/index/index.rpx.css
  4. 88 119
      pages/index/index.vue
  5. 6 8
      pages/my/my.vue
  6. BIN
      static/index/nullAva.png

+ 17 - 1
common/js/service.js

@@ -104,7 +104,7 @@ export default {
     // 报道打卡
     clockIn(param) {
         return request({
-            url: '/business/tech/clockIn?storeId='+param.storeId + '&longitude=' + param.longitude + '&latitude=' + param.latitude,
+            url: '/business/tech/clockIn?storeId='+param.storeId + '&longitude=' + param.longitude + '&latitude=' + param.latitude + '&timestamp=' + param.timestamp,
             method: 'POST'
         })
     },
@@ -132,7 +132,23 @@ export default {
         })
     },
 
+    //查询服务人员
+    serviceUserList(param) {
+        return request({
+            url: '/business/tech/serviceUser/list',
+            method: 'GET',
+            data:param
+        })
+    },
 
+    //获取图片
+    getImgUrlByOssId(param) {
+        return request({
+            url: '/resource/oss/listByIds/' + param.ossId,
+            method: 'GET'
+
+        })
+    },
 
 
 }

+ 1 - 1
common/js/user.js

@@ -5,7 +5,7 @@ export default {
     //账号密码登录
     getUserInfo() {
         return request({
-            url: '/system/user/getUserInfo',
+            url: '/business/tech/info',
             method: 'GET'
         })
     }

+ 1 - 3
pages/index/index.rpx.css

@@ -201,8 +201,8 @@
 }
 .addService{
     width: 750rpx;
-    height: 1012rpx;
     background: #FFFFFF;
+    padding: 24rpx 0;
     border-radius: 24rpx 24rpx 0rpx 0rpx;
 }
 .popupTitle{
@@ -221,9 +221,7 @@
 
 .scrollY1{
     height: 870rpx;
-    margin-top: 34rpx;
     margin-bottom: 24rpx;
-    padding-top: 24rpx;
 }
 .serviceItems{
     width: 684rpx;

+ 88 - 119
pages/index/index.vue

@@ -2,19 +2,19 @@
 	<view class="page">
 		<uni-nav-bar  :fixed="true" background-color="#FFE05C" :border="false" :statusBar="true"  title="首页" />
 		<view class="flex-row tuni ">
-			<image class="profile" :src="userInfo.avatar || '/static/logo.png'"></image>
+			<image class="profile" :src="userInfo.avatarUrl || '/static/index/nullAva.png'"></image>
 			<view class="tuniMsg">
 				<view class="name ">
-					<text >{{userInfo.nickName}}</text>
+					<text >{{userInfo.name}}</text>
 				</view>
 				<view>
-					<text class="biaoqian ">高级技师</text>
+					<text class="biaoqian ">{{userInfo.post}}</text>
 				</view>
 			</view>
 			<view class="flex-row justify-around tuni-right ">
 				<view class="flex-col " @click="userScanCode">
 					<view class="flex-row justify-center dakaIcon ">
-						<text>12</text>
+						<text>{{userInfo.subNumber}}</text>
 					</view>
 					<view class="flex-row justify-center dakaText ">
 						<text>预约人数</text>
@@ -41,7 +41,7 @@
 		</view>
 
 		<view class="flex-row justify-around buttons">
-			<view class="buttonItem" @click="call" v-if="currService.callState=='2'">
+			<view class="buttonItem" @click="call" v-if="currService && currService.callState == '2'">
 				<text>叫号</text>
 			</view>
 			<view class="buttonItem" @click="next" v-else>
@@ -66,10 +66,11 @@
 						<view class="flex-row justify-between ">
 							<view class="flex-row">
 								<view class="flex-col justify-center ">
-									<text class="servicename">张辉</text>
+									<text class="servicename">{{currService.serviceObjectName}}</text>
 								</view>
 								<view class="flex-col justify-center ">
-									<text class="biaoqian">会员用户</text>
+									<text v-if="currService.isVip" class="biaoqian">会员客户</text>
+									<text v-else class="biaoqian">现金客户</text>
 								</view>
 							</view>
 
@@ -95,7 +96,7 @@
 				</view>
 				<view class="flex-row justify-center ">
 					<view class="imgs">
-						<view class="mmImgView" :class="{floatRight: (index+1) % 2==0,marginTop:index>1}" v-for="(i,index) in 5" :key="index">
+						<view class="mmImgView" :class="{floatRight: (index+1) % 2==0,marginTop:index>1}" v-for="(i,index) in 0" :key="index">
 							<image class="mmImg" mode="widthFix" src="/static/mn1.webp"></image>
 						</view>
 					</view>
@@ -104,10 +105,9 @@
 
 				<view class="flex-row justify-center">
 					<view class="like">
-						<text>用户爱好用户爱好用户爱好用户爱好用户爱好用户爱好用户爱好用户爱好用户爱好用户爱好用户爱好</text>
+						<text>{{currService.preference || '暂无'}}</text>
 					</view>
 				</view>
-
 			</view>
 
 			<view class="flex-col" :style="{'height':sysHeight}" v-else>
@@ -123,9 +123,6 @@
 
 		<uni-popup ref="addServicePopup" @change="popupChange" type="bottom">
 			<view class="addService">
-
-
-
 				<scroll-view class="scrollY1 " scroll-y>
 					<view class="flex-col">
 						<view class="popupTitle">
@@ -133,8 +130,10 @@
 						</view>
 						<view class="flex-row justify-center">
 							<view class="serviceItems ">
-								<view class="serviceItem "  :class="{vBackGround: serviceProjectListIndex === index,marginLeft16: (index+3) % 3!==0,marginTop24:index>2}" v-for="(item,index) in 10" :key="index" @click="serviceProjectListIndex = index">
-									<text>单间造型服务</text>
+								<view class="serviceItem "
+									  :class="{vBackGround: serviceProjectListIndex === index,marginLeft16: (index+3) % 3!==0,marginTop24:index>2}"
+									  v-for="(item,index) in serviceProjectList" :key="index" @click="selectProject(item,index)">
+									<text>{{item.serviceName}}</text>
 								</view>
 							</view>
 						</view>
@@ -144,12 +143,13 @@
 
 						<view class="flex-row justify-center">
 							<view class="serviceItems ">
-								<view class="flex-col serviceTeach "  :class="{marginLeft28: (index+4) % 4!==0,marginTop24:index>3}" v-for="(item,index) in 10" :key="index" @click="serviceProjectListIndex = index">
-									<image class="serviceTeachImg"  src="/static/mm.webp" :class="{vBackGround: serviceProjectListIndex === index}"></image>
+								<view class="flex-col serviceTeach "
+									  :class="{marginLeft28: (index+4) % 4!==0,marginTop24:index>3}" v-for="(item,index) in servicePersonList" :key="index" @click="servicePersonListIndex = index">
+									<image class="serviceTeachImg"  :src="item.facePhotoUrl ||'/static/index/nullAva.png'" :class="{vBackGround: servicePersonListIndex === index}"></image>
 									<view class="serviceTeachName">
-										<text>庞启俊</text>
+										<text>{{item.personName}}</text>
 									</view>
-									<image v-if="serviceProjectListIndex === index" class="vImage" src="/static/index/xuanzhong.png"></image>
+									<image v-if="servicePersonListIndex === index" class="vImage" src="/static/index/xuanzhong.png"></image>
 								</view>
 							</view>
 						</view>
@@ -169,41 +169,8 @@
 				</view>
 			</view>
 		</uni-popup>
-		<uni-popup ref="connectPopup" @change="popupChange" type="bottom">
-			<view class="addService">
-
-				<view class="popupTitle">
-					<text>选择交接人员</text>
-				</view>
-
-				<scroll-view class="scrollY" scroll-y>
-					<view class="flex-row teachItem" :class="{'vBackGround': servicePersonListIndex === index}" v-for="(item,index) in servicePersonList" :key="index"  @click="servicePersonListIndex = index">
-						<image class="teachImage" src="/static/index/dataNull.png"></image>
-						<view class="flex-col teachMsg ">
-							<view class="flex-row">
-								<text class="techName">{{item.personName}}</text>
-								<view v-if="i<2" class="teachTag" v-for="(iter,i) in item.postList" :key="i">
-									<text>{{iter.levelName}}</text>
-								</view>
-							</view>
-							<text class="declaration">优质服务,从我做起</text>
-						</view>
-						<image v-if="servicePersonListIndex === index" class="vImage" src="/static/index/xuanzhong.png"></image>
-					</view>
-				</scroll-view>
-
-				<view class="flex-row justify-around">
-					<view class="cancelButton" @click="closeConnectPopup">
-						<text>取消</text>
-					</view>
-					<view class="confirmButton" @click="handover">
-						<text>确定</text>
-					</view>
-				</view>
-			</view>
-		</uni-popup>
 		<uni-popup ref="selectServiceObjectPopup" @change="popupChange" type="bottom">
-			<view class="addService">
+			<view class="addService" >
 
 				<view class="popupTitle">
 					<text>切换服务对象</text>
@@ -211,7 +178,7 @@
 
 				<scroll-view class="scrollY" scroll-y>
 					<view class="flex-row objectItem" :class="{'vBackGround': selectServiceObjectIndex === index}" v-for="(item,index) in selectServiceObjectList" :key="index"  @click="selectServiceObjectIndex = index">
-						<image class="objectImage" :src="item.facePhoto || '/static/index/dataNull.png'"></image>
+						<image class="objectImage" :src="item.facePhotoUrl || '/static/index/dataNull.png'"></image>
 						<view class="flex-col objectName ">
 							<text>{{item.nickName}}</text>
 						</view>
@@ -244,16 +211,16 @@
 				selectServiceObjectList:[],
 				selectServiceObjectIndex:-1,
 				servicePersonList:[],
-				servicePersonListIndex:-1,
+				servicePersonListIndex:0,
 				serviceProjectList:[],
-				serviceProjectListIndex:-1,
+				serviceProjectListIndex:0,
 				tabIndex: 0,
 				sysHeight: '',
 				readerHeight: '',
 				readerWidth: '',
 				userInfo: {},
-				storeId: '1710635498257108993',
-				storeName: '娇骄儿白云店',
+				storeId: '',
+				storeName: '',
 				currService: null,
 				qqMap:new QQMapWX({key: 'ZIABZ-543WB-747UM-JL5Y7-NDS4E-HWB4M',vm: this})
 
@@ -264,8 +231,8 @@
 			this.sysHeight = sysInfo.windowHeight - (sysInfo.windowWidth / 750) * 400 + 'px'
 			this.readerHeight = sysInfo.windowHeight + 'px'
 			this.readerWidth = sysInfo.windowWidth + 'px'
-			// this.storeId = uni.getStorageSync('storeId')
-			// this.storeName = uni.getStorageSync('storeName')
+			this.storeId = uni.getStorageSync('storeId')
+			this.storeName = uni.getStorageSync('storeName')
 			this.getUserInfo()
 			this.currServiceInfo()
 
@@ -279,11 +246,27 @@
 					orderServiceId:this.currService.orderServiceId,
 				}).then(res=>{
 					this.selectServiceObjectList= res.data.data
+					this.getServiceObjectUrl(this.selectServiceObjectList)
 					uni.hideTabBar()
 					this.$refs.selectServiceObjectPopup.open()
 				})
 			},
 
+			// 获取图片
+			getServiceObjectUrl(items) {
+				for (let i = 0; i < items.length; i++) {
+					let ptoto = items[i].facePhoto || items[i].personPhoto
+					if (ptoto) {
+						this.$api.service.getImgUrlByOssId({
+							ossId: ptoto
+						}).then(res => {
+							items[i].facePhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
+							this.$forceUpdate()
+						})
+					}
+				}
+			},
+
 			closeSelectServiceObjectPopup(){
 				this.serviceProjectListIndex = -1
 				this.$refs.selectServiceObjectPopup.close()
@@ -307,31 +290,41 @@
 			},
 
 			addService() {
-
+				this.serviceProjectListIndex = 0
 				this.$api.service.serviceProjectList().then(res=>{
 					this.serviceProjectList= res.data.data
+					this.serviceUserList(res.data.data[0])
 					uni.hideTabBar()
 					this.$refs.addServicePopup.open()
 				})
 			},
 
+			selectProject(item,index){
+				this.serviceProjectListIndex = index
+				this.serviceUserList(item)
+			},
+			serviceUserList(item){
+				this.$api.service.serviceUserList({
+					serviceProjectId:item.id,
+					storeId:this.storeId
+				}).then(res=>{
+					this.servicePersonListIndex = 0
+					this.servicePersonList=res.data.data
+					this.getServiceObjectUrl(this.servicePersonList)
+				})
+			},
+
 			closeAddServicePopup(){
-				this.serviceProjectListIndex = -1
+				this.serviceProjectListIndex = 0
 				this.$refs.addServicePopup.close()
 			},
 			addServiceProject(){
-				if (this.serviceProjectListIndex === -1){
-					uni.showToast({
-						icon: 'none',
-						duration: 2000,
-						title: '请选择服务项目'
-					});
-					return
-				}
+
 				this.$api.service.addServiceProject(
 						{
 							orderServiceId:this.currService.orderServiceId,
-							serviceProjectId:this.serviceProjectList[this.serviceProjectListIndex].id
+							serviceProjectId:this.serviceProjectList[this.serviceProjectListIndex].id,
+							serviceUserId:this.servicePersonList[this.servicePersonListIndex].personId
 						}
 				).then(res=>{
 					uni.showToast({
@@ -349,36 +342,7 @@
 					uni.showTabBar()
 				}
 			},
-			connect() {
 
-				this.$api.service.getServicePerson({storeId:this.storeId}).then((res) => {
-					this.servicePersonList = res.data.data;
-					uni.hideTabBar()
-					this.$refs.connectPopup.open()
-				})
-			},
-			closeConnectPopup(){
-				this.servicePersonListIndex = -1
-				this.$refs.connectPopup.close()
-			},
-			handover(){
-				if (this.servicePersonListIndex === -1){
-					uni.showToast({
-						icon: 'none',
-						duration: 2000,
-						title: '请选择服务技师'
-					});
-					return
-				}
-				this.$api.service.handover({
-					orderServiceId:this.currService.orderServiceId,
-					serviceUserId:this.servicePersonList[this.servicePersonListIndex].personId
-				}).then(res=>{
-					this.closeConnectPopup()
-					this.closeAddServicePopup()
-				})
-
-			},
 
 			takePlace() {
 				this.$api.service.takePlace({
@@ -448,10 +412,16 @@
 
 			getUserInfo() {
 				this.$api.user.getUserInfo().then(res => {
-					this.userInfo = res.data.data.user
+					this.userInfo = res.data.data
+					this.getImgUrlByOssId(this.userInfo.avatar)
 					uni.setStorageSync('userInfo', this.userInfo )
 				})
 			},
+			 getImgUrlByOssId(ossId){
+				this.$api.service.getImgUrlByOssId({ossId:ossId}).then(res=>{
+					this.$set(this.userInfo,'avatarUrl', res.data.data[0].url.replace(/^http:/, "https:"))
+				})
+			},
 
 			userScanCode() {
 				let that = this
@@ -459,32 +429,33 @@
 					url: '/pages/scanCode/scanCode',
 					events: {
 						getScancode: function(data) {
-							that.storeId = JSON.parse(data).storeId
-							that.storeName = JSON.parse(data).storeName
-							uni.setStorageSync('storeId', that.storeId)
-							uni.setStorageSync('storeName', that.storeName)
-
-							console.log('++++++++++getScancode+++++++++++++',that.storeId,that.storeName)
 
 							uni.getLocation({
 								type: 'gcj02',
 								success: (e) => {
-									console.log('++++++++++getLocation++success+++++++++++',e.longitude,e.latitude)
+									// that.qqMap.reverseGeocoder({   //根据经纬度解析地址信息
+									// 	location: {
+									// 		latitude: e.latitude,
+									// 		longitude: e.longitude
+									// 	},
+									// })
+									that.storeId = JSON.parse(data).storeId
+									that.timestamp = JSON.parse(data).timestamp
+									uni.setStorageSync('storeId', that.storeId)
+									uni.setStorageSync('timestamp', that.timestamp)
 									let param ={
 										storeId:that.storeId,
+										timestamp:that.timestamp,
 										longitude:e.longitude,
 										latitude:e.latitude
 									}
-									that.qqMap.reverseGeocoder({
-										location: {
-											latitude: e.latitude,
-											longitude: e.longitude
-										},
-										success: function(res1){
-											console.log('+++++++++++++++++地址信息++++++++++++++++++++++++',res1)
-										}
-									})
+									console.log(param)
 									that.$api.service.clockIn(param).then(res=>{
+										uni.showToast({
+											icon: 'success',
+											duration: 2000,
+											title: '签到成功'
+										});
 										that.currServiceInfo()
 									})
 								},
@@ -492,8 +463,6 @@
 									console.log('++++++++++getLocation++fail+++++++++++',err)
 								}
 							})
-
-
 						},
 					}
 				})

+ 6 - 8
pages/my/my.vue

@@ -39,7 +39,7 @@
 							<text>今日业绩(次)</text>
 						</view>
 						<view class="flex-row justify-center statisticsValue">
-							<text>{{staticsData.serviceTotal || 0}}</text>
+							<text>{{staticsData.todayTotal || 0}}</text>
 						</view>
 					</view>
 					<view class="statisticsItem statisticsItemBorder flex-col ">
@@ -47,10 +47,10 @@
 							<u-icon name="/static/my/benyueyeji.png" size="28"></u-icon>
 						</view>
 						<view class="flex-row justify-center statisticsKey">
-							<text>本业绩(次)</text>
+							<text>本业绩(次)</text>
 						</view>
 						<view class="flex-row justify-center statisticsValue">
-							<text>{{staticsData.avgServiceTime || 0}}</text>
+							<text>{{staticsData.monthTotal || 0}}</text>
 						</view>
 					</view>
 				</view>
@@ -69,7 +69,7 @@
 							<text>今日任务</text>
 						</view>
 						<view class="flex-row justify-center statisticsValue">
-							<text>{{staticsData.serviceTotal || 0}}</text>
+							<text>{{staticsData.todayTask || 0}}</text>
 						</view>
 					</view>
 
@@ -81,7 +81,7 @@
 							<text>完成任务</text>
 						</view>
 						<view class="flex-row justify-center statisticsValue">
-							<text>{{staticsData.avgServiceTime || 0}}</text>
+							<text>{{staticsData.finishTask || 0}}</text>
 						</view>
 					</view>
 				</view>
@@ -118,9 +118,7 @@
 		onShow(){
 			this.storeId = uni.getStorageSync('storeId')
 			this.getUserInfo()
-			if (!(this.storeId === '' || this.storeId === null)){
-				this.statics()
-			}
+			this.statics()
 		},
 
 		methods: {

BIN
static/index/nullAva.png