登录修改
This commit is contained in:
parent
ce78ac2c24
commit
f4240ffa9c
|
@ -88,6 +88,19 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="phone_box" v-if="lastArea.serviceName1!=''&&lastArea.serviceName1&&lastArea.servicePhone1!=''&&lastArea.servicePhone1" @click="callPhone(lastArea.servicePhone1)">
|
||||||
|
<view class="img">
|
||||||
|
<image src="https://lxnapi.ccttiot.com/bike/img/static/u6VebEXfsdk8f4NbTWQs" mode=""></image>
|
||||||
|
</view>
|
||||||
|
<view class="info">
|
||||||
|
<view class="name">
|
||||||
|
订单或押金问题
|
||||||
|
</view>
|
||||||
|
<view class="phone">
|
||||||
|
{{lastArea.servicePhone1}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<image class="close" src="https://lxnapi.ccttiot.com/bike/img/static/ulwJylk0JSmOdmU3FnnG" mode="" @click="showkf=false"></image>
|
<image class="close" src="https://lxnapi.ccttiot.com/bike/img/static/ulwJylk0JSmOdmU3FnnG" mode="" @click="showkf=false"></image>
|
||||||
</view>
|
</view>
|
||||||
<u-mask :show="isbackcar" :z-index='100' duration='0' @click="isbackcar = false" />
|
<u-mask :show="isbackcar" :z-index='100' duration='0' @click="isbackcar = false" />
|
||||||
|
@ -147,76 +160,37 @@
|
||||||
classlist:[],
|
classlist:[],
|
||||||
wordlist:[],
|
wordlist:[],
|
||||||
isbackcar:false,
|
isbackcar:false,
|
||||||
showkf:false
|
showkf:false,
|
||||||
|
lastArea:{}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getarea()
|
this.getarea()
|
||||||
this.getclass()
|
this.getclass()
|
||||||
|
// this.getlastPhone()
|
||||||
|
this.getuserInfo()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getlastPhone(user){
|
||||||
|
this.$u.get('/appVerify/latestServicePhone?userId=' + user.userId).then(res => {
|
||||||
|
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.lastArea=res.data
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
getuserInfo(){
|
getuserInfo(){
|
||||||
uni.showLoading({
|
|
||||||
title:'加载中'
|
|
||||||
})
|
|
||||||
this.$u.get("/getAppInfo").then((res) => {
|
this.$u.get("/getAppInfo").then((res) => {
|
||||||
|
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
uni.hideLoading()
|
console.log(res);
|
||||||
|
this.getlastPhone(res.user)
|
||||||
this.getarea()
|
|
||||||
// if( res.user.role==2){
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url:'/page_fix/fix_index'
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
let areaId=uni.getStorageSync('areaId');
|
|
||||||
if(areaId){
|
|
||||||
let that =this
|
|
||||||
wx.login({
|
|
||||||
success(res) {
|
|
||||||
if (res.code) {
|
|
||||||
console.log('登录!', res);
|
|
||||||
let data = {
|
|
||||||
wxOpenId: res.code,
|
|
||||||
|
|
||||||
};
|
|
||||||
let areaId = uni.getStorageSync('areaId');
|
|
||||||
that.$u.post('/loginByopenid?jsCode=' + res.code + '&areaId=' + areaId).then(
|
|
||||||
res => {
|
|
||||||
uni.hideLoading();
|
|
||||||
if (res.code == 200) {
|
|
||||||
uni.setStorageSync('token', res.token);
|
|
||||||
that.getuserInfo()
|
|
||||||
|
|
||||||
|
|
||||||
} else if (res.code == 501) {
|
|
||||||
uni.showToast({
|
|
||||||
title: res.msg,
|
|
||||||
icon: 'none',
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// console.log("老用户登录",res.data)
|
|
||||||
uni.redirectTo({
|
|
||||||
url: '/pages/login/login'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
|
||||||
}else{
|
|
||||||
uni.showToast({
|
|
||||||
title: '请授权位置信息后再尝试',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 4000
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -337,6 +311,7 @@
|
||||||
width: 86rpx;
|
width: 86rpx;
|
||||||
height: 86rpx;
|
height: 86rpx;
|
||||||
image{
|
image{
|
||||||
|
margin-left: 30rpx;
|
||||||
width: 86rpx;
|
width: 86rpx;
|
||||||
height: 86rpx;
|
height: 86rpx;
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,6 +167,15 @@
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"enablePullDownRefresh" : false
|
"enablePullDownRefresh" : false
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "Qrcode",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : "",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"enablePullDownRefresh" : false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1122,7 +1122,8 @@
|
||||||
deviceGps: {
|
deviceGps: {
|
||||||
|
|
||||||
},
|
},
|
||||||
tozf: false
|
tozf: false,
|
||||||
|
islogin:true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -1214,6 +1215,7 @@
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.timestare()
|
this.timestare()
|
||||||
|
this.getUserInfo()
|
||||||
this.backfalse = 0
|
this.backfalse = 0
|
||||||
this.carstause = false
|
this.carstause = false
|
||||||
// 检查蓝牙权限状态
|
// 检查蓝牙权限状态
|
||||||
|
@ -1422,6 +1424,15 @@
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getUserInfo(){
|
||||||
|
this.$u.get(`/getAppInfo?`).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.islogin=true
|
||||||
|
} else {
|
||||||
|
this.islogin=false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
tocard(){
|
tocard(){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/page_vip/checkCard?orderId='+this.orderinfo.orderNo
|
url:'/page_vip/checkCard?orderId='+this.orderinfo.orderNo
|
||||||
|
@ -1464,9 +1475,7 @@
|
||||||
|
|
||||||
// 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构
|
// 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构
|
||||||
const polylines = this.convertBoundaryToPolyline(res.data.boundaryStr)
|
const polylines = this.convertBoundaryToPolyline(res.data.boundaryStr)
|
||||||
// console.log(polylines,'polylinespolylinespolylines');
|
|
||||||
// .filter(area => area.boundaryStr) // 过滤掉boundary为空的数据
|
|
||||||
// .map(area => this.convertBoundaryToPolyline(area.boundaryStr));
|
|
||||||
// 更新折线数据
|
// 更新折线数据
|
||||||
this.areaInfo = res.data
|
this.areaInfo = res.data
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -1485,7 +1494,7 @@
|
||||||
this.getmarks()
|
this.getmarks()
|
||||||
// this.getlist()
|
// this.getlist()
|
||||||
this.getParking()
|
this.getParking()
|
||||||
if (uni.getStorageSync('token')) {
|
if (uni.getStorageSync('token')&&this.islogin) {
|
||||||
this.getisInOrder()
|
this.getisInOrder()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1538,16 +1547,7 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if(!hasShownPopup){
|
|
||||||
// console.log(typeof(hasShownPopup),'hasShownPopuphasShownPopup');
|
|
||||||
// this.showTips=uni.getStorageSync('hasShownPopup')
|
|
||||||
// }else{
|
|
||||||
// this.showTips=true
|
|
||||||
// uni.setStorageSync('hasShownPopup', true);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// this.$store.commit('SET_SHOWTIPS', true);
|
|
||||||
// console.log(this.polyline);
|
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
|
@ -1576,25 +1576,11 @@
|
||||||
if (this.areaInfo.areaId != res.data.areaId) {
|
if (this.areaInfo.areaId != res.data.areaId) {
|
||||||
this.getArea()
|
this.getArea()
|
||||||
}
|
}
|
||||||
// this.routePlanning(res.data.latitude, res.data.longitude)
|
|
||||||
// setTimeout(() => {
|
|
||||||
|
|
||||||
// // this.deviceIndex = 1;
|
|
||||||
// }, 600)
|
|
||||||
} else {
|
} else {
|
||||||
// if (this.deviceInfos.onlineStatus == 0) {
|
|
||||||
// wx.showToast({
|
|
||||||
// title: '车辆离线中,请使用其他车辆',
|
|
||||||
// icon: 'none',
|
|
||||||
// duration: 4000
|
|
||||||
// });
|
|
||||||
// } else
|
|
||||||
if (this.deviceInfos.status == 0) {
|
if (this.deviceInfos.status == 0) {
|
||||||
// uni.showToast({
|
|
||||||
// title: '车辆未上架,请使用其他车辆',
|
|
||||||
// icon: 'none',
|
|
||||||
// duration: 4000
|
|
||||||
// });
|
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '车辆未上架,请使用其他车辆',
|
title: '车辆未上架,请使用其他车辆',
|
||||||
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
|
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
|
||||||
|
@ -1604,11 +1590,7 @@
|
||||||
// icon: false
|
// icon: false
|
||||||
})
|
})
|
||||||
} else if (this.deviceInfos.status == 2) {
|
} else if (this.deviceInfos.status == 2) {
|
||||||
// uni.showToast({
|
|
||||||
// title: '车辆预约中,请使用其他车辆',
|
|
||||||
// icon: 'none',
|
|
||||||
// duration: 4000
|
|
||||||
// });
|
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '车辆预约中,请使用其他车辆',
|
title: '车辆预约中,请使用其他车辆',
|
||||||
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
|
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
|
||||||
|
@ -1618,11 +1600,7 @@
|
||||||
// icon: false
|
// icon: false
|
||||||
})
|
})
|
||||||
} else if (this.deviceInfos.status == 3) {
|
} else if (this.deviceInfos.status == 3) {
|
||||||
// uni.showToast({
|
|
||||||
// title: '车辆骑行中,请使用其他车辆',
|
|
||||||
// icon: 'none',
|
|
||||||
// // duration: 4000
|
|
||||||
// });
|
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '车辆骑行中,请使用其他车辆',
|
title: '车辆骑行中,请使用其他车辆',
|
||||||
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
|
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
|
||||||
|
@ -1632,11 +1610,7 @@
|
||||||
// icon: false
|
// icon: false
|
||||||
})
|
})
|
||||||
} else if (this.deviceInfos.status == 4) {
|
} else if (this.deviceInfos.status == 4) {
|
||||||
// uni.showToast({
|
|
||||||
// title: '车辆临时锁车中,请使用其他车辆',
|
|
||||||
// icon: 'none',
|
|
||||||
// // duration: 4000
|
|
||||||
// });
|
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '车辆临时锁车中,请使用其他车辆',
|
title: '车辆临时锁车中,请使用其他车辆',
|
||||||
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
|
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
|
||||||
|
@ -1646,11 +1620,7 @@
|
||||||
// icon: false
|
// icon: false
|
||||||
})
|
})
|
||||||
} else if (this.deviceInfos.status == 6) {
|
} else if (this.deviceInfos.status == 6) {
|
||||||
// uni.showToast({
|
|
||||||
// title: '车辆调度中,请使用其他车辆',
|
|
||||||
// icon: 'none',
|
|
||||||
// // duration: 4000
|
|
||||||
// });
|
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '车辆调度中,请使用其他车辆',
|
title: '车辆调度中,请使用其他车辆',
|
||||||
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
|
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
|
||||||
|
@ -1660,11 +1630,7 @@
|
||||||
// icon: false
|
// icon: false
|
||||||
})
|
})
|
||||||
} else if (this.deviceInfos.status == 8) {
|
} else if (this.deviceInfos.status == 8) {
|
||||||
// uni.showToast({
|
|
||||||
// title: '车辆下线中,请使用其他车辆',
|
|
||||||
// icon: 'none',
|
|
||||||
// duration: 4000
|
|
||||||
// });
|
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '车辆下线中,请使用其他车辆',
|
title: '车辆下线中,请使用其他车辆',
|
||||||
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
|
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
|
||||||
|
@ -1674,11 +1640,7 @@
|
||||||
// icon: false
|
// icon: false
|
||||||
})
|
})
|
||||||
} else if (this.deviceInfos.status == 9) {
|
} else if (this.deviceInfos.status == 9) {
|
||||||
// uni.showToast({
|
|
||||||
// title: '车辆已废弃,请使用其他车辆',
|
|
||||||
// icon: 'none',
|
|
||||||
// duration: 4000
|
|
||||||
// });
|
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '车辆已废弃,请使用其他车辆',
|
title: '车辆已废弃,请使用其他车辆',
|
||||||
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
|
// 如果不传此type参数,默认为default,也可以手动写上 type: 'default'
|
||||||
|
@ -1730,173 +1692,7 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (uni.getStorageSync('token')) {
|
|
||||||
|
|
||||||
|
|
||||||
// } else {
|
|
||||||
// console.log('判断2');
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url: '/pages/login/login'
|
|
||||||
// });
|
|
||||||
// // wx.login({
|
|
||||||
// // success: (res) => {
|
|
||||||
// // if (res.code) {
|
|
||||||
// // console.log('登录!', res);
|
|
||||||
// // let data = {
|
|
||||||
// // wxOpenId: res.code,
|
|
||||||
// // };
|
|
||||||
// // let areaId = uni.getStorageSync('areaId');
|
|
||||||
// // if (areaId) {
|
|
||||||
// // this.$u.post('/loginByopenid?jsCode=' + res.code + '&areaId=' +
|
|
||||||
// // areaId)
|
|
||||||
// // .then((
|
|
||||||
// // res) => {
|
|
||||||
// // // uni.hideLoading();
|
|
||||||
// // if (res.code == 200) {
|
|
||||||
// // uni.setStorageSync('token', res.token);
|
|
||||||
// // this.getinfo()
|
|
||||||
// // if (this.sn) {
|
|
||||||
// // this.$u.get('/app/device/info?sn=' + this.sn)
|
|
||||||
// // .then((
|
|
||||||
// // res) => {
|
|
||||||
// // if (res.code === 200) {
|
|
||||||
// // this.isqrcode = true
|
|
||||||
// // this.deviceInfos = res.data;
|
|
||||||
// // this.getlist(res.data.modelId)
|
|
||||||
// // if (num == 0) {
|
|
||||||
// // // this.routePlanning(res.data.latitude,
|
|
||||||
// // // res.data.longitude)
|
|
||||||
// // this.showdevice = true;
|
|
||||||
// // this.type = 0;
|
|
||||||
// // } else {
|
|
||||||
// // // if (this.deviceInfos
|
|
||||||
// // // .onlineStatus ==
|
|
||||||
// // // 0) {
|
|
||||||
// // // uni.showToast({
|
|
||||||
// // // title: '车辆离线中,请使用其他车辆',
|
|
||||||
// // // icon: 'none',
|
|
||||||
// // // duration: 4000
|
|
||||||
// // // });
|
|
||||||
// // // } else
|
|
||||||
// // if (this.deviceInfos
|
|
||||||
// // .status ==
|
|
||||||
// // 0) {
|
|
||||||
// // uni.showToast({
|
|
||||||
// // title: '车辆未上架,请使用其他车辆',
|
|
||||||
// // icon: 'none',
|
|
||||||
// // duration: 4000
|
|
||||||
// // });
|
|
||||||
// // } else if (this.deviceInfos
|
|
||||||
// // .status ==
|
|
||||||
// // 2) {
|
|
||||||
// // uni.showToast({
|
|
||||||
// // title: '车辆预约中,请使用其他车辆',
|
|
||||||
// // icon: 'none',
|
|
||||||
// // duration: 4000
|
|
||||||
// // });
|
|
||||||
// // } else if (this.deviceInfos
|
|
||||||
// // .status ==
|
|
||||||
// // 3) {
|
|
||||||
// // uni.showToast({
|
|
||||||
// // title: '车辆骑行中,请使用其他车辆',
|
|
||||||
// // icon: 'none',
|
|
||||||
// // duration: 4000
|
|
||||||
// // });
|
|
||||||
// // } else if (this.deviceInfos
|
|
||||||
// // .status ==
|
|
||||||
// // 4) {
|
|
||||||
// // uni.showToast({
|
|
||||||
// // title: '车辆临时锁车中,请使用其他车辆',
|
|
||||||
// // icon: 'none',
|
|
||||||
// // duration: 4000
|
|
||||||
// // });
|
|
||||||
// // } else if (this.deviceInfos
|
|
||||||
// // .status ==
|
|
||||||
// // 6) {
|
|
||||||
// // uni.showToast({
|
|
||||||
// // title: '车辆调度中,请使用其他车辆',
|
|
||||||
// // icon: 'none',
|
|
||||||
// // duration: 4000
|
|
||||||
// // });
|
|
||||||
// // } else if (this.deviceInfos
|
|
||||||
// // .status ==
|
|
||||||
// // 8) {
|
|
||||||
// // uni.showToast({
|
|
||||||
// // title: '车辆下线中,请使用其他车辆',
|
|
||||||
// // icon: 'none',
|
|
||||||
// // duration: 4000
|
|
||||||
// // });
|
|
||||||
// // } else if (this.deviceInfos
|
|
||||||
// // .status ==
|
|
||||||
// // 9) {
|
|
||||||
// // uni.showToast({
|
|
||||||
// // title: '车辆已废弃,请使用其他车辆',
|
|
||||||
// // icon: 'none',
|
|
||||||
// // duration: 4000
|
|
||||||
// // });
|
|
||||||
// // } else if (this.deviceInfos
|
|
||||||
// // .status ==
|
|
||||||
// // 7) {
|
|
||||||
// // uni.showToast({
|
|
||||||
// // title: '车辆未上线,请使用其他车辆',
|
|
||||||
// // icon: 'none',
|
|
||||||
// // duration: 4000
|
|
||||||
// // });
|
|
||||||
// // } else if (this.deviceInfos
|
|
||||||
// // .status ==
|
|
||||||
// // 1) {
|
|
||||||
// // // this.routePlanning(res.data
|
|
||||||
// // // .latitude, res.data
|
|
||||||
// // // .longitude)
|
|
||||||
// // if (this.areaInfo != res.data
|
|
||||||
// // .areaId) {
|
|
||||||
// // this.getArea()
|
|
||||||
// // }
|
|
||||||
// // // this.routePlanning(res.data.latitude, res.data.longitude)
|
|
||||||
// // setTimeout(() => {
|
|
||||||
// // this.showdevice =
|
|
||||||
// // true
|
|
||||||
// // this.type = 1;
|
|
||||||
// // this.deviceIndex =
|
|
||||||
// // 1;
|
|
||||||
// // }, 600)
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// // } else {
|
|
||||||
// // this.showdevice = false;
|
|
||||||
// // this.deviceIndex = 0;
|
|
||||||
// // this.type = 0;
|
|
||||||
// // uni.showToast({
|
|
||||||
// // title: res.msg,
|
|
||||||
// // icon: 'none',
|
|
||||||
// // duration: 2000
|
|
||||||
// // });
|
|
||||||
// // }
|
|
||||||
// // });
|
|
||||||
|
|
||||||
// // }
|
|
||||||
|
|
||||||
// // } else if (res.code == 501) {
|
|
||||||
// // uni.showToast({
|
|
||||||
// // title: res.msg,
|
|
||||||
// // icon: 'none',
|
|
||||||
// // duration: 2000
|
|
||||||
// // });
|
|
||||||
// // } else {
|
|
||||||
// // uni.redirectTo({
|
|
||||||
// // url: '/pages/login/login'
|
|
||||||
// // });
|
|
||||||
// // }
|
|
||||||
// // });
|
|
||||||
|
|
||||||
// // }
|
|
||||||
|
|
||||||
// // }
|
|
||||||
// // },
|
|
||||||
// // });
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -2468,7 +2264,7 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
taploadmask(num) {
|
taploadmask(num) {
|
||||||
if(uni.getStorageSync('token')){
|
if(uni.getStorageSync('token')&&this.islogin){
|
||||||
this.maskepage = 0
|
this.maskepage = 0
|
||||||
this.loadimg = 'https://lxnapi.ccttiot.com/bike/img/static/uRxPPoVoqmnmng6wKlij'
|
this.loadimg = 'https://lxnapi.ccttiot.com/bike/img/static/uRxPPoVoqmnmng6wKlij'
|
||||||
if (num == 1) {
|
if (num == 1) {
|
||||||
|
@ -3059,7 +2855,7 @@
|
||||||
// 确认开锁
|
// 确认开锁
|
||||||
sub1() {
|
sub1() {
|
||||||
// uni.showLoading({});
|
// uni.showLoading({});
|
||||||
if (uni.getStorageSync('token')) {
|
if (uni.getStorageSync('token')&&this.islogin) {
|
||||||
let data = {
|
let data = {
|
||||||
userId: this.userId,
|
userId: this.userId,
|
||||||
sn: this.sn,
|
sn: this.sn,
|
||||||
|
@ -5182,7 +4978,7 @@
|
||||||
} else if (num == 1) {
|
} else if (num == 1) {
|
||||||
|
|
||||||
this.maskloading = false
|
this.maskloading = false
|
||||||
if (uni.getStorageSync('token')) {
|
if (uni.getStorageSync('token')&&this.islogin) {
|
||||||
if (this.areaInfo.authentication == 1) {
|
if (this.areaInfo.authentication == 1) {
|
||||||
this.$u.get("/getAppInfo").then(res => {
|
this.$u.get("/getAppInfo").then(res => {
|
||||||
|
|
||||||
|
@ -5358,7 +5154,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (num == 5) {
|
} else if (num == 5) {
|
||||||
if (uni.getStorageSync('token')) {
|
if (uni.getStorageSync('token')&&this.islogin) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/page_user/gzsb'
|
url: '/page_user/gzsb'
|
||||||
})
|
})
|
||||||
|
@ -5385,11 +5181,19 @@
|
||||||
url: '/page_user/gzsb?sn=' + this.sn
|
url: '/page_user/gzsb?sn=' + this.sn
|
||||||
})
|
})
|
||||||
} else if (num == 9) {
|
} else if (num == 9) {
|
||||||
uni.navigateTo({
|
if (uni.getStorageSync('token')&&this.islogin) {
|
||||||
url: '/page_user/khfw/khfw'
|
uni.navigateTo({
|
||||||
})
|
url: '/page_user/khfw/khfw'
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.seeDetail = true
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/login/login?isindex=true'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}else if(num == 10){
|
}else if(num == 10){
|
||||||
if (uni.getStorageSync('token')) {
|
if (uni.getStorageSync('token')&&this.islogin) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/page_user/good_list'
|
url: '/page_user/good_list'
|
||||||
})
|
})
|
||||||
|
|
123
pages_admin/Qrcode.vue
Normal file
123
pages_admin/Qrcode.vue
Normal file
|
@ -0,0 +1,123 @@
|
||||||
|
<template>
|
||||||
|
<view class="page">
|
||||||
|
<u-navbar title="设备二维码" :border-bottom="false" :background="bgc" title-color='#000'
|
||||||
|
title-size='36' height='45'></u-navbar>
|
||||||
|
<view class="ewm" style="margin-top: 300rpx;width: 750rpx;display: flex;justify-content: center;">
|
||||||
|
<canvas id="qrcode" canvas-id="qrcode" style="width: 600rpx;height:700rpx;" />
|
||||||
|
</view>
|
||||||
|
<view class="saveQr" @click="saveQrcode()">
|
||||||
|
保存二维码
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import UQRCode from 'uqrcodejs';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
sn:'',
|
||||||
|
deptId:null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(e) {
|
||||||
|
this.sn = e.sn;
|
||||||
|
this.deptId = uni.getStorageSync('deptId');
|
||||||
|
this.generateQrcode();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
generateQrcode() {
|
||||||
|
const qr = new UQRCode();
|
||||||
|
const qrSizeRpx = 600; // 二维码大小为600rpx
|
||||||
|
const qrSizePx = uni.upx2px(qrSizeRpx); // 将rpx转换为px
|
||||||
|
|
||||||
|
if (this.deptId == 100) {
|
||||||
|
qr.data = 'https://dche.ccttiot.com?sn=' + this.sn;
|
||||||
|
} else if (this.deptId == 101) {
|
||||||
|
qr.data = 'https://dianche.chuantewulian.cn?sn=' + this.sn;
|
||||||
|
}
|
||||||
|
qr.size = qrSizePx; // 设置二维码大小为像素值
|
||||||
|
|
||||||
|
// 创建 canvas 上下文
|
||||||
|
const ctx = uni.createCanvasContext('qrcode', this);
|
||||||
|
|
||||||
|
// 设置 qr 的 canvas 上下文
|
||||||
|
qr.canvasContext = ctx;
|
||||||
|
qr.make(); // 生成二维码数据
|
||||||
|
|
||||||
|
// 绘制二维码
|
||||||
|
qr.drawCanvas();
|
||||||
|
|
||||||
|
// 手动绘制二维码的同时添加设备序列号(sn)
|
||||||
|
const sn = this.sn ? 'SN: ' + this.sn : 'SN未知';
|
||||||
|
|
||||||
|
// 延迟绘制,确保二维码绘制完成后再绘制文字
|
||||||
|
setTimeout(() => {
|
||||||
|
// 添加sn到二维码下面
|
||||||
|
ctx.setFontSize(24); // 设置字体大小
|
||||||
|
ctx.setFillStyle('black'); // 设置字体颜色
|
||||||
|
ctx.setTextAlign('center'); // 设置文本居中
|
||||||
|
|
||||||
|
// 在二维码下方绘制sn,调整y坐标确保sn显示在二维码下方且不被裁剪
|
||||||
|
ctx.fillText(sn, qrSizePx / 2, qrSizePx + 40);
|
||||||
|
|
||||||
|
// 传入 true,保留之前绘制的内容
|
||||||
|
ctx.draw(true);
|
||||||
|
}, 100); // 延迟100毫秒确保二维码绘制完成
|
||||||
|
this.showqr = true;
|
||||||
|
},
|
||||||
|
saveQrcode() {
|
||||||
|
uni.canvasToTempFilePath({
|
||||||
|
canvasId: 'qrcode',
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: uni.upx2px(600),
|
||||||
|
height: uni.upx2px(700),
|
||||||
|
success: (res) => {
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: res.tempFilePath,
|
||||||
|
success: () => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '保存成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
this.showqr = false;
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '保存失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '生成二维码失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.page{
|
||||||
|
.saveQr{
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 100rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 502rpx;
|
||||||
|
height: 68rpx;
|
||||||
|
background: #4C97E7;
|
||||||
|
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -436,74 +436,12 @@
|
||||||
this.showqr=false
|
this.showqr=false
|
||||||
},
|
},
|
||||||
generateQrcode() {
|
generateQrcode() {
|
||||||
const qr = new UQRCode();
|
uni.navigateTo({
|
||||||
if(this.deptId==100){
|
url:'/pages_admin/Qrcode?sn='+this.deviceInfos.sn
|
||||||
qr.data = 'https://dche.ccttiot.com?sn=' + this.deviceInfos.sn;
|
})
|
||||||
}else if(this.deptId==101){
|
|
||||||
qr.data = 'https://dianche.chuantewulian.cn?sn=' + this.deviceInfos.sn;
|
|
||||||
}
|
|
||||||
qr.size = 150;
|
|
||||||
// 创建 canvas 上下文
|
|
||||||
const ctx = uni.createCanvasContext('qrcode', this);
|
|
||||||
|
|
||||||
// 设置 qr 的 canvas 上下文
|
|
||||||
qr.canvasContext = ctx;
|
|
||||||
qr.make(); // 生成二维码数据
|
|
||||||
|
|
||||||
// 绘制二维码
|
|
||||||
qr.drawCanvas();
|
|
||||||
|
|
||||||
// 手动绘制二维码的同时添加设备序列号(sn)
|
|
||||||
const sn = this.deviceInfos && this.deviceInfos.sn ? 'SN: ' + this.deviceInfos.sn : 'SN未知';
|
|
||||||
|
|
||||||
// 延迟绘制,确保二维码绘制完成后再绘制文字
|
|
||||||
setTimeout(() => {
|
|
||||||
// 添加sn到二维码下面
|
|
||||||
ctx.setFontSize(12); // 设置字体大小
|
|
||||||
ctx.setFillStyle('black'); // 设置字体颜色
|
|
||||||
ctx.setTextAlign('center'); // 设置文本居中
|
|
||||||
ctx.fillText(sn, qr.size / 2, qr.size + 20); // 在二维码下方绘制sn,偏移20像素
|
|
||||||
|
|
||||||
// 保留二维码,绘制文字
|
|
||||||
ctx.draw(true); // 传入 true,保留之前绘制的内容
|
|
||||||
}, 100); // 延迟100毫秒确保二维码绘制完成
|
|
||||||
this.showqr = true;
|
|
||||||
},
|
},
|
||||||
// generateQrcode() {
|
|
||||||
// const qr = new UQRCode();
|
|
||||||
// qr.data = 'https://znb.ccttiot.com/w?sn=' + this.deviceInfos.sn;
|
|
||||||
// qr.size = 157;
|
|
||||||
|
|
||||||
// // 创建 canvas 上下文
|
|
||||||
// const ctx = uni.createCanvasContext('qrcode', this);
|
|
||||||
|
|
||||||
// // 设置 qr 的 canvas 上下文
|
|
||||||
// qr.canvasContext = ctx;
|
|
||||||
// qr.make(); // 生成二维码数据
|
|
||||||
|
|
||||||
// // 计算绘制二维码的起始位置
|
|
||||||
// const startX = (uni.getSystemInfoSync().windowWidth - qr.size) / 2; // 计算中心位置
|
|
||||||
|
|
||||||
// // 绘制二维码
|
|
||||||
// qr.drawCanvas(startX, 0); // 指定绘制起始位置
|
|
||||||
|
|
||||||
// // 手动绘制二维码的同时添加设备序列号(sn)
|
|
||||||
// const sn = this.deviceInfos && this.deviceInfos.sn ? 'SN: ' + this.deviceInfos.sn : 'SN未知';
|
|
||||||
|
|
||||||
// // 延迟绘制,确保二维码绘制完成后再绘制文字
|
|
||||||
// setTimeout(() => {
|
|
||||||
// // 添加sn到二维码下面
|
|
||||||
// ctx.setFontSize(12); // 设置字体大小
|
|
||||||
// ctx.setFillStyle('black'); // 设置字体颜色
|
|
||||||
// ctx.setTextAlign('center'); // 设置文本居中
|
|
||||||
// ctx.fillText(sn, uni.getSystemInfoSync().windowWidth / 2, qr.size + 20); // 在二维码下方绘制sn,居中
|
|
||||||
|
|
||||||
// // 保留二维码,绘制文字
|
|
||||||
// ctx.draw(true); // 传入 true,保留之前绘制的内容
|
|
||||||
// }, 100); // 延迟100毫秒确保二维码绘制完成
|
|
||||||
|
|
||||||
// this.showqr = true;
|
|
||||||
// },
|
|
||||||
saveQrcode() {
|
saveQrcode() {
|
||||||
uni.canvasToTempFilePath({
|
uni.canvasToTempFilePath({
|
||||||
canvasId: 'qrcode',
|
canvasId: 'qrcode',
|
||||||
|
|
|
@ -126,7 +126,7 @@
|
||||||
租赁费
|
租赁费
|
||||||
</view>
|
</view>
|
||||||
<view class="info_li" style="color:#4C97E7 ;">
|
<view class="info_li" style="color:#4C97E7 ;">
|
||||||
调度费
|
调度费(运营区外)
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@
|
||||||
预约费
|
预约费
|
||||||
</view>
|
</view>
|
||||||
<view class="info_li" style="color:#4C97E7 ;">
|
<view class="info_li" style="color:#4C97E7 ;">
|
||||||
管理费
|
调度费 (停车区外)
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user