111
This commit is contained in:
		
							parent
							
								
									739f6524a4
								
							
						
					
					
						commit
						9189b9f669
					
				|  | @ -2,18 +2,18 @@ | |||
| 	<view class="pages"> | ||||
| 		<view class="title"> | ||||
| 			<image src="https://api.ccttiot.com/smartmeter/img/static/us3fy7PWk14FUljNypKh" mode="" | ||||
| 				style="width: 52rpx;height: 52rpx;margin-right: 10rpx;vertical-align: bottom;vertical-align: bottom;" | ||||
| 				style="width: 60rpx;height: 60rpx;margin-right: 10rpx;vertical-align: bottom;vertical-align: bottom;" | ||||
| 				@click="btnshouye"></image> | ||||
| 			<text style="width: 80%;text-align: center;display: inline-block;">扫码床垫</text> | ||||
| 			<view class="wz" @click="call" style="text-align: right;padding-right: 20rpx;" | ||||
| 			<text style="width: 80%;text-align: center;display: inline-block;">{{obj.deviceName}}</text> | ||||
| 			<view class="wz" @click="call" style="text-align: right;padding-right: 50rpx;" | ||||
| 				v-if="obj.storeContactMobile == null"> | ||||
| 				<image style="width: 48rpx;height: 50rpx;vertical-align: middle;" | ||||
| 					src="https://api.ccttiot.com/smartmeter/img/static/u9bYsfyXGAMwKMFfQAmL" mode=""></image> | ||||
| 				<!-- <text>客服</text> --> | ||||
| 			</view> | ||||
| 			<view class="wz" @click="call" | ||||
| 				style="text-align: right;padding-right: 20rpx;display: flex;align-items: center;" v-else> | ||||
| 				<image style="width: 48rpx;height: 50rpx;vertical-align: middle;" | ||||
| 				style="text-align: right;padding-right: 50rpx;" v-else> | ||||
| 				<image style="width: 60rpx;height: 64rpx;vertical-align: middle;" | ||||
| 					src="https://api.ccttiot.com/smartmeter/img/static/u9bYsfyXGAMwKMFfQAmL" mode=""></image> | ||||
| 				<!-- <text>客服</text> --> | ||||
| 			</view> | ||||
|  | @ -32,7 +32,7 @@ | |||
| 						¥{{item.price}} | ||||
| 					</view> | ||||
| 					<view class="time" :class="activeindex == item.suitId ? 'active' : ''"> | ||||
| 						可使用{{item.value}}小时 | ||||
| 						可使用{{item.value}} {{item.timeUnit == 3 ? '分钟' : '小时'}} | ||||
| 					</view> | ||||
| 				</view> | ||||
| 			</view> | ||||
|  | @ -52,7 +52,7 @@ | |||
| 				填充物:{{obj.fill == undefined ? '--' : obj.fill}} | ||||
| 			</view> | ||||
| 			<view class="shuomwz"> | ||||
| 				所属房间:{{obj.room == undefined ? '--' : obj.room}} | ||||
| 				设备地址:{{sbobj.storeName == undefined ? '' : sbobj.storeName}} {{obj.room == undefined ? '--' : obj.room}} | ||||
| 			</view> | ||||
| 		</view> | ||||
| 
 | ||||
|  | @ -102,6 +102,8 @@ | |||
| 				suitGearTime:'', | ||||
| 				suitFeeMode:'', | ||||
| 				suitFeeType:'', | ||||
| 				title:'', | ||||
| 				sbobj:{} | ||||
| 			} | ||||
| 		}, | ||||
| 		onLoad(option) { | ||||
|  | @ -161,6 +163,7 @@ | |||
| 					if (res.code == 200) { | ||||
| 						this.list = res.data.suitList | ||||
| 						this.obj = res.data | ||||
| 						this.getsb(res.data.deviceId) | ||||
| 					}else if(res.code == 401){ | ||||
| 						uni.navigateTo({ | ||||
| 							url:'/pages/login/login' | ||||
|  | @ -168,95 +171,111 @@ | |||
| 					} | ||||
| 				}) | ||||
| 			}, | ||||
| 			// 查询设备详情 | ||||
| 			getsb(id){ | ||||
| 				this.$u.get(`app/device/${id}`).then((res) => { | ||||
| 					if (res.code == 200) { | ||||
| 						this.sbobj = res.data | ||||
| 					} | ||||
| 				}) | ||||
| 			}, | ||||
| 			// 点击支付	 | ||||
| 			btnzhifu() { | ||||
| 				if(this.checked == false){ | ||||
| 				if(this.sbobj.onlineStatus == 0){ | ||||
| 					uni.showToast({ | ||||
| 						title: '请勾选用户服务协议 !', | ||||
| 						icon: 'none', | ||||
| 						duration: 1000 | ||||
| 					}) | ||||
| 				}else if(this.activeindex == -1){ | ||||
| 					uni.showToast({ | ||||
| 						title: '请选择套餐 !', | ||||
| 						title: '该设备离线,暂不能使用', | ||||
| 						icon: 'none', | ||||
| 						duration: 1000 | ||||
| 					}) | ||||
| 				}else{ | ||||
| 					// 不允许一直点击支付 | ||||
| 					this.zhifuflag = false | ||||
| 					let that = this | ||||
| 					let data = { | ||||
| 						deviceNo: that.id, | ||||
| 						suitId: that.zfobj.suitId, | ||||
| 						money: that.zfobj.price, | ||||
| 						suitTime: that.zfobj.value, | ||||
| 						suitTimeUnit:that.suitTimeUnit, | ||||
| 						suitFeeMode:that.suitFeeMode, | ||||
| 						suitFeeType:that.suitFeeType, | ||||
| 						suitGearAmount:that.suitGearAmount, | ||||
| 						suitGearTime:that.suitGearTime, | ||||
| 						suitPrice:that.suitPrice | ||||
| 					} | ||||
| 					that.$u.post('/app/bill/recharge', data).then(res => { | ||||
| 						if(res.code == 200){ | ||||
| 							that.orderno = res.data | ||||
| 							let data = { | ||||
| 								billNo:that.orderno, | ||||
| 								channelId:1 | ||||
| 							} | ||||
| 							that.$u.get(`app/pay/wx/${that.orderno}`).then(res => { | ||||
| 								if(res.code == 200){ | ||||
| 									that.payNo = res.data.payBill.payNo | ||||
| 									uni.requestPayment({ | ||||
| 										provider: 'wxpay', | ||||
| 										timeStamp: res.data.payParams.timeStamp, | ||||
| 										nonceStr: res.data.payParams.nonceStr, | ||||
| 										package: res.data.payParams.packageVal, | ||||
| 										signType: res.data.payParams.signType, | ||||
| 										paySign: res.data.payParams.paySign, | ||||
| 										success: (res) => { | ||||
| 											that.zhifuflag = true | ||||
| 											that.$u.put(`/app/bill/${that.payNo}/refreshPayResult`).then(res => {}) | ||||
| 											// 支付成功逻辑 | ||||
| 											uni.reLaunch({ | ||||
| 												// url:'/page_user/mydetail?id=' + that.orderno | ||||
| 												url:'/pages/index/index' | ||||
| 											}) | ||||
| 										}, | ||||
| 										fail(err) { | ||||
| 											that.zhifuflag = true | ||||
| 											// 支付失败逻辑 | ||||
| 											uni.showToast({ | ||||
| 												title: '支付失败', | ||||
| 												icon: 'none', | ||||
| 												duration: 2000 | ||||
| 											}) | ||||
| 										} | ||||
| 									}) | ||||
| 								}else{ | ||||
| 									uni.showToast({ | ||||
| 										title: res.msg, | ||||
| 										icon: 'none', | ||||
| 										duration: 2000 | ||||
| 									}) | ||||
| 									setTimeout(()=>{ | ||||
| 										this.zhifuflag = true | ||||
| 									},2000) | ||||
| 								} | ||||
| 							}) | ||||
| 						}else{ | ||||
| 							uni.showToast({ | ||||
| 								title: res.msg, | ||||
| 								icon: 'none', | ||||
| 								duration: 2000 | ||||
| 							}) | ||||
| 							setTimeout(()=>{ | ||||
| 								this.zhifuflag = true | ||||
| 							},2000) | ||||
| 					if(this.checked == false){ | ||||
| 						uni.showToast({ | ||||
| 							title: '请勾选用户服务协议 !', | ||||
| 							icon: 'none', | ||||
| 							duration: 1000 | ||||
| 						}) | ||||
| 					}else if(this.activeindex == -1){ | ||||
| 						uni.showToast({ | ||||
| 							title: '请选择套餐 !', | ||||
| 							icon: 'none', | ||||
| 							duration: 1000 | ||||
| 						}) | ||||
| 					}else{ | ||||
| 						// 不允许一直点击支付 | ||||
| 						this.zhifuflag = false | ||||
| 						let that = this | ||||
| 						let data = { | ||||
| 							deviceNo: that.id, | ||||
| 							suitId: that.zfobj.suitId, | ||||
| 							money: that.zfobj.price, | ||||
| 							suitTime: that.zfobj.value, | ||||
| 							suitTimeUnit:that.suitTimeUnit, | ||||
| 							suitFeeMode:that.suitFeeMode, | ||||
| 							suitFeeType:that.suitFeeType, | ||||
| 							suitGearAmount:that.suitGearAmount, | ||||
| 							suitGearTime:that.suitGearTime, | ||||
| 							suitPrice:that.suitPrice | ||||
| 						} | ||||
| 					}) | ||||
| 					 | ||||
| 						that.$u.post('/app/bill/recharge', data).then(res => { | ||||
| 							if(res.code == 200){ | ||||
| 								that.orderno = res.data | ||||
| 								let data = { | ||||
| 									billNo:that.orderno, | ||||
| 									channelId:1 | ||||
| 								} | ||||
| 								that.$u.get(`app/pay/wx/${that.orderno}`).then(res => { | ||||
| 									if(res.code == 200){ | ||||
| 										that.payNo = res.data.payBill.payNo | ||||
| 										uni.requestPayment({ | ||||
| 											provider: 'wxpay', | ||||
| 											timeStamp: res.data.payParams.timeStamp, | ||||
| 											nonceStr: res.data.payParams.nonceStr, | ||||
| 											package: res.data.payParams.packageVal, | ||||
| 											signType: res.data.payParams.signType, | ||||
| 											paySign: res.data.payParams.paySign, | ||||
| 											success: (res) => { | ||||
| 												that.zhifuflag = true | ||||
| 												that.$u.put(`/app/bill/${that.payNo}/refreshPayResult`).then(res => {}) | ||||
| 												// 支付成功逻辑 | ||||
| 												uni.reLaunch({ | ||||
| 													// url:'/page_user/mydetail?id=' + that.orderno | ||||
| 													url:'/pages/index/index' | ||||
| 												}) | ||||
| 											}, | ||||
| 											fail(err) { | ||||
| 												that.zhifuflag = true | ||||
| 												// 支付失败逻辑 | ||||
| 												uni.showToast({ | ||||
| 													title: '支付失败', | ||||
| 													icon: 'none', | ||||
| 													duration: 2000 | ||||
| 												}) | ||||
| 											} | ||||
| 										}) | ||||
| 									}else{ | ||||
| 										uni.showToast({ | ||||
| 											title: res.msg, | ||||
| 											icon: 'none', | ||||
| 											duration: 2000 | ||||
| 										}) | ||||
| 										setTimeout(()=>{ | ||||
| 											this.zhifuflag = true | ||||
| 										},2000) | ||||
| 									} | ||||
| 								}) | ||||
| 							}else{ | ||||
| 								uni.showToast({ | ||||
| 									title: res.msg, | ||||
| 									icon: 'none', | ||||
| 									duration: 2000 | ||||
| 								}) | ||||
| 								setTimeout(()=>{ | ||||
| 									this.zhifuflag = true | ||||
| 								},2000) | ||||
| 							} | ||||
| 						}) | ||||
| 						 | ||||
| 					} | ||||
| 				} | ||||
| 			}, | ||||
| 
 | ||||
|  | @ -464,7 +483,7 @@ | |||
| 			.wz { | ||||
| 				font-weight: 400; | ||||
| 				font-size: 32rpx; | ||||
| 				margin-top: 30rpx; | ||||
| 				margin-top: 10rpx; | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  |  | |||
|  | @ -14,7 +14,7 @@ | |||
| 				<image src="https://api.ccttiot.com/smartmeter/img/static/ujJcBAlIiMjakFEBQV8O" mode=""></image> | ||||
| 				<view class="quan"> | ||||
| 					<view class="one"> | ||||
| 						{{detailobj.suitTime == undefined ? '--' : detailobj.suitTime}}小时 | ||||
| 						{{detailobj.suitTime == undefined ? '--' : detailobj.suitTime}}{{detailobj.timeUnit == 3 ? '分钟' : '小时'}} | ||||
| 					</view> | ||||
| 					<view class="two"> | ||||
| 						套餐时长 | ||||
|  |  | |||
|  | @ -41,7 +41,7 @@ | |||
| 			</view> | ||||
| 			<view class="xiao"> | ||||
| 				 <view>套餐时长</view> | ||||
| 				 <view>{{obj.suitTime == undefined ? '--' : obj.suitTime}}小时</view> | ||||
| 				 <view>{{obj.suitTime == undefined ? '--' : obj.suitTime}}{{obj.timeUnit == 3 ? '分钟' : '小时'}}</view> | ||||
| 			</view> | ||||
| 			<view class="xiao"> | ||||
| 				 <view>支付类型</view> | ||||
|  |  | |||
|  | @ -58,7 +58,7 @@ | |||
| 				  </view> | ||||
| 				  <view class="xiao"> | ||||
| 				  	 <view>套餐时长</view> | ||||
| 				  	 <view>{{item.suitTime}}小时</view> | ||||
| 				  	 <view>{{item.suitTime}}{{item.timeUnit == 3 ? '分钟' : '小时'}}</view> | ||||
| 				  </view> | ||||
| 				  <view class="xiao"> | ||||
| 				  	 <view>合作伙伴信息</view> | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user