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