|
@@ -258,7 +258,7 @@
|
|
|
readerHeight: '',
|
|
readerHeight: '',
|
|
|
readerWidth: '',
|
|
readerWidth: '',
|
|
|
userInfo: {},
|
|
userInfo: {},
|
|
|
- storeId: '1710635498257108993',
|
|
|
|
|
|
|
+ storeId: '',
|
|
|
storeName: '',
|
|
storeName: '',
|
|
|
currService: null,
|
|
currService: null,
|
|
|
qqMap:new QQMapWX({key: 'ZIABZ-543WB-747UM-JL5Y7-NDS4E-HWB4M',vm: this})
|
|
qqMap:new QQMapWX({key: 'ZIABZ-543WB-747UM-JL5Y7-NDS4E-HWB4M',vm: this})
|
|
@@ -270,10 +270,7 @@
|
|
|
this.sysHeight = sysInfo.windowHeight - (sysInfo.windowWidth / 750) * 400 + 'px'
|
|
this.sysHeight = sysInfo.windowHeight - (sysInfo.windowWidth / 750) * 400 + 'px'
|
|
|
this.readerHeight = sysInfo.windowHeight + 'px'
|
|
this.readerHeight = sysInfo.windowHeight + 'px'
|
|
|
this.readerWidth = sysInfo.windowWidth + 'px'
|
|
this.readerWidth = sysInfo.windowWidth + 'px'
|
|
|
- // this.storeId = uni.getStorageSync('storeId')
|
|
|
|
|
- this.storeName = uni.getStorageSync('storeName')
|
|
|
|
|
this.getUserInfo()
|
|
this.getUserInfo()
|
|
|
- this.currServiceInfo()
|
|
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
this.userInfo = uni.getStorageSync('userInfo')
|
|
this.userInfo = uni.getStorageSync('userInfo')
|
|
@@ -335,6 +332,14 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
addService() {
|
|
addService() {
|
|
|
|
|
+ if (!this.currService){
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon: 'error',
|
|
|
|
|
+ duration: 2000,
|
|
|
|
|
+ title: '没有服务对象'
|
|
|
|
|
+ });
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
this.serviceProjectListIndex = 0
|
|
this.serviceProjectListIndex = 0
|
|
|
this.$api.service.serviceProjectList().then(res=>{
|
|
this.$api.service.serviceProjectList().then(res=>{
|
|
|
this.serviceProjectList= res.data.data
|
|
this.serviceProjectList= res.data.data
|
|
@@ -387,6 +392,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
takePlace() {
|
|
takePlace() {
|
|
|
|
|
+ if (!this.currService){
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon: 'error',
|
|
|
|
|
+ duration: 2000,
|
|
|
|
|
+ title: '没有服务对象'
|
|
|
|
|
+ });
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
this.showLike = true
|
|
this.showLike = true
|
|
|
this.$api.service.takePlace({
|
|
this.$api.service.takePlace({
|
|
|
orderServiceId: this.currService.orderServiceId
|
|
orderServiceId: this.currService.orderServiceId
|
|
@@ -427,6 +440,15 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
settle() {
|
|
settle() {
|
|
|
|
|
+ if (!this.currService){
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon: 'error',
|
|
|
|
|
+ duration: 2000,
|
|
|
|
|
+ title: '没有服务对象'
|
|
|
|
|
+ });
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
this.previousServiceOrderId = this.currService.serviceObjectId
|
|
this.previousServiceOrderId = this.currService.serviceObjectId
|
|
|
this.$api.service.settle({
|
|
this.$api.service.settle({
|
|
|
orderServiceId: this.currService.orderServiceId
|
|
orderServiceId: this.currService.orderServiceId
|
|
@@ -459,7 +481,7 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
next() {
|
|
next() {
|
|
|
- if (!this.storeId){
|
|
|
|
|
|
|
+ if (!this.userInfo.signIn){
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
icon: 'error',
|
|
icon: 'error',
|
|
|
duration: 2000,
|
|
duration: 2000,
|
|
@@ -487,11 +509,16 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
currServiceInfo() {
|
|
currServiceInfo() {
|
|
|
- if (this.storeId === '' || this.storeId === null){
|
|
|
|
|
|
|
+ if (!this.userInfo.signIn){
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon: 'error',
|
|
|
|
|
+ duration: 2000,
|
|
|
|
|
+ title: '请先扫码签到'
|
|
|
|
|
+ });
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
this.$api.service.currServiceInfo({
|
|
this.$api.service.currServiceInfo({
|
|
|
- storeId: this.storeId
|
|
|
|
|
|
|
+ storeId: this.userInfo.workStoreId
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
console.log(res.data.data)
|
|
console.log(res.data.data)
|
|
|
this.currService = res.data.data
|
|
this.currService = res.data.data
|
|
@@ -508,6 +535,7 @@
|
|
|
getUserInfo() {
|
|
getUserInfo() {
|
|
|
this.$api.user.getUserInfo().then(res => {
|
|
this.$api.user.getUserInfo().then(res => {
|
|
|
this.userInfo = res.data.data
|
|
this.userInfo = res.data.data
|
|
|
|
|
+ this.storeId = res.data.data.workStoreId
|
|
|
uni.setStorageSync('userInfo', this.userInfo )
|
|
uni.setStorageSync('userInfo', this.userInfo )
|
|
|
if (this.userInfo.avatar){
|
|
if (this.userInfo.avatar){
|
|
|
this.getImgUrlByOssId(this.userInfo.avatar)
|
|
this.getImgUrlByOssId(this.userInfo.avatar)
|
|
@@ -530,14 +558,11 @@
|
|
|
url: '/pages/scanCode/scanCode',
|
|
url: '/pages/scanCode/scanCode',
|
|
|
events: {
|
|
events: {
|
|
|
getScancode: function(data) {
|
|
getScancode: function(data) {
|
|
|
- that.storeId = JSON.parse(data).storeId
|
|
|
|
|
- that.timestamp = JSON.parse(data).timestamp
|
|
|
|
|
- uni.setStorageSync('storeId', that.storeId)
|
|
|
|
|
- uni.setStorageSync('timestamp', that.timestamp)
|
|
|
|
|
let param ={
|
|
let param ={
|
|
|
- storeId:that.storeId,
|
|
|
|
|
- timestamp:that.timestamp
|
|
|
|
|
|
|
+ storeId:JSON.parse(data).storeId,
|
|
|
|
|
+ timestamp:JSON.parse(data).timestamp
|
|
|
}
|
|
}
|
|
|
|
|
+ this.getUserInfo()
|
|
|
console.log(param)
|
|
console.log(param)
|
|
|
that.$api.service.clockIn(param).then(res=>{
|
|
that.$api.service.clockIn(param).then(res=>{
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -545,6 +570,8 @@
|
|
|
duration: 2000,
|
|
duration: 2000,
|
|
|
title: '签到成功'
|
|
title: '签到成功'
|
|
|
});
|
|
});
|
|
|
|
|
+ that.userInfo.signIn = true
|
|
|
|
|
+ uni.setStorageSync('userInfo', that.userInfo )
|
|
|
that.currServiceInfo()
|
|
that.currServiceInfo()
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|