用户授权手机

This commit is contained in:
3321822538@qq.com 2024-10-15 17:59:04 +08:00
parent 147e16a632
commit 765d42adaa
7 changed files with 88 additions and 30 deletions

View File

@ -19,8 +19,8 @@ const install = (Vue, vm) => {
// }, // },
// }); // });
Vue.prototype.$u.http.setConfig({ Vue.prototype.$u.http.setConfig({
baseUrl: 'http://192.168.2.106:10002', // baseUrl: 'http://192.168.2.15:10002',
// baseUrl: 'https://kg.chuangtewl.com/prod-api', baseUrl: 'https://kg.chuangtewl.com/prod-api',
// loadingText: '努力加载中~', // loadingText: '努力加载中~',
// loadingTime: 1000, // loadingTime: 1000,
// 设置自定义头部content-type // 设置自定义头部content-type

View File

@ -641,7 +641,7 @@
}) })
} else { } else {
if (this.ver_data == '') { if (this.ver_data == '') {
this.czflag = true this.czflag = true
uni.showLoading({ uni.showLoading({
title: '蓝牙连接中' title: '蓝牙连接中'
}) })

View File

@ -12,10 +12,6 @@
<view class="tit"> 身份证号</view> <view class="tit"> 身份证号</view>
<view class="but"> <input type="text" placeholder="请输入身份证号" v-model="names" /> </view> <view class="but"> <input type="text" placeholder="请输入身份证号" v-model="names" /> </view>
</view> </view>
<view class="listval">
<view class="tit"> 手机号</view>
<view class="but"> <input type="text" placeholder="请输入手机号" v-model="tel" /> </view>
</view>
<view class="listval"> <view class="listval">
<view class="yz" v-if="yzflag"> <view class="yz" v-if="yzflag">
</view> </view>
@ -85,7 +81,7 @@
let data = { let data = {
realName: this.name, realName: this.name,
realIdCard: this.names, realIdCard: this.names,
realPhone: this.tel // realPhone: this.tel
} }
this.$u.put('/app/user/realName', data).then(res => { this.$u.put('/app/user/realName', data).then(res => {
if (res.code == 200) { if (res.code == 200) {

View File

@ -54,9 +54,9 @@
<text v-if="detailobj.suitFeeType == 4">分时段计时收费</text></text> <text v-if="detailobj.suitFeeType == 4">分时段计时收费</text></text>
</view> </view>
<view class="nav" v-if="detailobj.suitFeeType == 2 || detailobj.suitFeeType == 3"> <view class="nav" v-if="detailobj.suitFeeType == 2 || detailobj.suitFeeType == 3">
<text class="shen">使用度数</text><text class="qian">{{Number(detailobj.suitEndEle) - Number(detailobj.suitStartEle)}}</text> <text class="shen">使用度数</text><text class="qian">{{Number(detailobj.suitEndEle).toFixed(2) - Number(detailobj.suitStartEle).toFixed(2)}}</text>
</view> </view>
<view class="nav" v-else> <view class="nav" v-else>
<text class="shen">套餐时长</text><text class="qian">{{detailobj.suitTime == undefined ? '--' : detailobj.suitTime}} <text class="shen">套餐时长</text><text class="qian">{{detailobj.suitTime == undefined ? '--' : detailobj.suitTime}}
<text v-if="detailobj.suitTimeUnit == 1">天</text> <text v-if="detailobj.suitTimeUnit == 2">时</text> <text v-if="detailobj.suitTimeUnit == 3">分钟</text> <text v-if="detailobj.suitTimeUnit == 4"></text> <text v-if="detailobj.suitTimeUnit == 1">天</text> <text v-if="detailobj.suitTimeUnit == 2">时</text> <text v-if="detailobj.suitTimeUnit == 3">分钟</text> <text v-if="detailobj.suitTimeUnit == 4"></text>
</text> </text>

View File

@ -35,6 +35,9 @@
<view class="nav"> <view class="nav">
<text class="shen">用户</text><text class="qian">{{detailobj.userName == undefined ? '--' : detailobj.userName}}</text> <text class="shen">用户</text><text class="qian">{{detailobj.userName == undefined ? '--' : detailobj.userName}}</text>
</view> </view>
<view class="nav" v-if="detailobj.userMobile ">
<text class="shen">用户手机</text><text class="qian">{{detailobj.userMobile == undefined ? '--' : detailobj.userMobile}}</text>
</view>
<view class="nav"> <view class="nav">
<text class="shen">设备名称</text><text class="qian">{{detailobj.deviceName == undefined ? '--' : detailobj.deviceName}}</text> <text class="shen">设备名称</text><text class="qian">{{detailobj.deviceName == undefined ? '--' : detailobj.deviceName}}</text>
</view> </view>
@ -58,7 +61,7 @@
<text v-if="detailobj.suitFeeType == 4">分时段计时收费</text></text> <text v-if="detailobj.suitFeeType == 4">分时段计时收费</text></text>
</view> </view>
<view class="nav" v-if="detailobj.suitFeeType == 2 || detailobj.suitFeeType == 3"> <view class="nav" v-if="detailobj.suitFeeType == 2 || detailobj.suitFeeType == 3">
<text class="shen">使用度数</text><text class="qian">{{Number(detailobj.suitEndEle) - Number(detailobj.suitStartEle)}}</text> <text class="shen">使用度数</text><text class="qian">{{Number(detailobj.suitEndEle).toFixed(2) - Number(detailobj.suitStartEle),toFixed(2)}}</text>
</view> </view>
<view class="nav" v-else> <view class="nav" v-else>
<text class="shen">套餐时长</text><text class="qian">{{detailobj.suitTime == undefined ? '--' : detailobj.suitTime}} <text class="shen">套餐时长</text><text class="qian">{{detailobj.suitTime == undefined ? '--' : detailobj.suitTime}}
@ -96,9 +99,6 @@
margin-top: 30rpx;align-items: center;"> margin-top: 30rpx;align-items: center;">
退款 退款
</view> </view>
<!-- <view class="pic" @click="btnad">
<image :src="imgad" mode="" class="pic"></image>
</view> -->
</view> </view>
<!-- 退款弹窗 --> <!-- 退款弹窗 -->
<view class="tanc" v-if="maskflag"> <view class="tanc" v-if="maskflag">
@ -128,7 +128,6 @@
return { return {
billId:'', billId:'',
detailobj:{}, detailobj:{},
imgad:'',
maskflag:false, maskflag:false,
inptext:'', inptext:'',
userType:{}, userType:{},
@ -141,7 +140,6 @@
if(option.billId){ if(option.billId){
this.billId = option.billId this.billId = option.billId
this.getlist() this.getlist()
// this.getad()
} }
}, },
// //
@ -218,9 +216,6 @@
}, },
btntz(){ btntz(){
this.maskflag = true this.maskflag = true
// uni.navigateTo({
// url:'/page_user/sbdetail?id=' + this.detailobj.deviceId + '&flag=' + true
// })
}, },
getlist(){ getlist(){
this.$u.get(`/app/bill/${this.billId}`).then((res) => { this.$u.get(`/app/bill/${this.billId}`).then((res) => {
@ -285,9 +280,6 @@
.page { .page {
width: 750rpx; width: 750rpx;
// position: fixed;
// top: 0;
// left: 0;
.tanc { .tanc {
width: 594rpx; width: 594rpx;
@ -334,9 +326,7 @@
.shuzhi { .shuzhi {
display: flex; display: flex;
align-items: center; align-items: center;
// justify-content: space-between;
justify-content: center; justify-content: center;
// padding: 0 60rpx;
margin-top: 50rpx; margin-top: 50rpx;
box-sizing: border-box; box-sizing: border-box;

View File

@ -37,7 +37,7 @@
<view class="order_bd"> <view class="order_bd">
<view class="order_fu"> <view class="order_fu">
<view class="name"> <view class="name">
用户手机{{item.userName == null ? '--' : item.userName}} 用户{{item.userName == null ? '--' : item.userName}}
</view> </view>
<view class=""> <view class="">
订单费用{{item.money == null ? '--' : item.money}} 订单费用{{item.money == null ? '--' : item.money}}

View File

@ -101,8 +101,21 @@
</view> </view>
</view> </view>
<view class="mask" v-if="weiflag"></view> <view class="mask" v-if="weiflag"></view>
<!-- 获取手机号弹窗 -->
<view class="huoqutel" v-if="huoqutelflag">
<view class="xxx" @click="huoqutelflag = false">
x
</view>
<view class="top">
请先获取手机号再进入商家中心
</view>
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">获取手机号</button>
</view>
<view class="huoqutelflag" v-if="huoqutelflag"></view>
</view> </view>
</view> </view>
</template> </template>
@ -110,6 +123,7 @@
export default { export default {
data() { data() {
return { return {
huoqutelflag:false,
weiflag: false, weiflag: false,
listflag: false, listflag: false,
params: { params: {
@ -143,7 +157,8 @@
sylist: [], sylist: [],
networkInterval: null, networkInterval: null,
wangluo: true, wangluo: true,
billNo: '' billNo: '',
phonenumber:''
}; };
}, },
onLoad(option) { onLoad(option) {
@ -473,9 +488,13 @@
duration: 2000 duration: 2000
}) })
}else{ }else{
uni.switchTab({ if(this.phonenumber == ''){
url: '/pages/index/index' this.huoqutelflag = true
}) }else{
uni.switchTab({
url: '/pages/index/index'
})
}
} }
} else if (res.code == 401) { } else if (res.code == 401) {
uni.reLaunch({ uni.reLaunch({
@ -502,7 +521,23 @@
}) })
} }
}, },
//
getPhoneNumber(e){
this.$u.put(`/app/user/bindWxMobile?mobileCode=${e.detail.code}`).then(res =>{
if(res.code == 200){
this.huoqutelflag = false
uni.switchTab({
url: '/pages/index/index'
})
}else{
uni.showToast({
title: res.msg,
icon: 'none',
duration: 1000
})
}
})
},
// //
onControltap(control) { onControltap(control) {
this.setMapScale() this.setMapScale()
@ -681,6 +716,7 @@
uni.setStorageSync('userType', res.data) uni.setStorageSync('userType', res.data)
this.userType = res.data.userType this.userType = res.data.userType
this.deviceCount = res.data.deviceCount this.deviceCount = res.data.deviceCount
this.phonenumber = res.data.phonenumber
} else { } else {
this.jmlogin() this.jmlogin()
} }
@ -741,6 +777,42 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.huoqutelflag{
width: 100%;
height: 100vh;
background-color: #000;
z-index: 998;
position: fixed;
top: 0;
left: 0;
opacity: .6;
}
.huoqutel{
position: fixed;
bottom:0;
left: 50%;
transform: translateX(-50%);
width:100%;
text-align: center;
height: 300rpx;
background-color: #fff;
border-radius: 30rpx;
z-index: 999;
.top{
font-size: 32rpx;
}
.xxx{
font-size: 40rpx;
width: 100%;
text-align: right;
padding-right: 60rpx;
margin-top: 20rpx;
}
button{
margin-top: 30rpx;
width: 640rpx;
}
}
.weizf { .weizf {
position: fixed; position: fixed;
z-index: 99; z-index: 99;