Kaynağa Gözat

按钮点击事件判断提醒

zhanghui 2 yıl önce
ebeveyn
işleme
0dc777906d

+ 2 - 2
common/js/env.js

@@ -2,8 +2,8 @@
 
 // let baseUrl = `https://jje.admin.xinyuekj.com.cn`
 // let baseUrl = `https://jje.admin.xinyuekj.com.cn/test-api`
-// let baseUrl = `http://65i1sxopd9qp.ngrok.xiaomiqiu123.top`
-let baseUrl = `https://jje.xinyuekj.com.cn/prod-api`
+let baseUrl = `http://65i1sxopd9qp.ngrok.xiaomiqiu123.top`
+// let baseUrl = `https://jje.xinyuekj.com.cn/prod-api`
 
 
 

+ 2 - 2
pages/index/index.rpx.css

@@ -1,7 +1,7 @@
 .page {
 	/* background-image:url('https://wine.gzzzyd.com/tech/static/index/bgImg.png'); */
-	/*background-image: url('https://jje.admin.xinyuekj.com.cn/tech/static/index/bgImg.png');*/
-	background-image: url('https://jje.xinyuekj.com.cn/prod-api/tech/static/index/bgImg.png');
+	background-image: url('https://jje.admin.xinyuekj.com.cn/test-api/tech/static/index/bgImg.png');
+	/*background-image: url('https://jje.xinyuekj.com.cn/prod-api/tech/static/index/bgImg.png');*/
 	background-repeat: no-repeat;
 	background-size: 100%;
 	background-color: #f7f7f7;

+ 40 - 13
pages/index/index.vue

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

+ 2 - 2
pages/my/index.rpx.css

@@ -1,6 +1,6 @@
 .page {
-	/*background-image: url('https://jje.admin.xinyuekj.com.cn/tech/static/my/bg1.png');*/
-	background-image: url('https://jje.xinyuekj.com.cn/prod-api/tech/static/my/bg1.png');
+	background-image: url('https://jje.admin.xinyuekj.com.cn/test-api/tech/static/my/bg1.png');
+	/*background-image: url('https://jje.xinyuekj.com.cn/prod-api/tech/static/my/bg1.png');*/
 	background-repeat: no-repeat;
 	background-size: 100% 30%;
 	background-color: #f7f7f7;

+ 9 - 9
pages/userInfo/userInfo.vue

@@ -45,15 +45,15 @@
 <!--						<u-icon name="arrow-right" color="#666" size="18"></u-icon>-->
 					</view>
 				</view>
-				<view class="flex-row justify-between bordBot" >
-					<view class="key flex-col justify-center ">
-						<text>修改密码</text>
-					</view>
-					<view class="flex-row justify-end groupItemContent " @click="updatePassword">
-						<text>点击修改</text>
-						<u-icon name="arrow-right" color="#666" size="18"></u-icon>
-					</view>
-				</view>
+<!--				<view class="flex-row justify-between bordBot" >-->
+<!--					<view class="key flex-col justify-center ">-->
+<!--						<text>修改密码</text>-->
+<!--					</view>-->
+<!--					<view class="flex-row justify-end groupItemContent " @click="updatePassword">-->
+<!--						<text>点击修改</text>-->
+<!--						<u-icon name="arrow-right" color="#666" size="18"></u-icon>-->
+<!--					</view>-->
+<!--				</view>-->
 			</form>
 		</view>