|
@@ -1,14 +1,14 @@
|
|
|
<template>
|
|
|
+
|
|
|
<view class="jpmain ">
|
|
|
+ <u-navbar title="绑定地锁" ></u-navbar>
|
|
|
<u-picker mode="selector"
|
|
|
v-model="isswitchshow"
|
|
|
:range="columns" range-key="label"
|
|
|
:default-selector="columnsindex"
|
|
|
@confirm="switchBtn" ></u-picker>
|
|
|
|
|
|
- <view class="body">
|
|
|
- <u-steps :list="numList" mode="number" :current="current" un-active-color="#999999"></u-steps>
|
|
|
- </view>
|
|
|
+
|
|
|
<view class="list" @click="gotoscan">
|
|
|
<view class="item">
|
|
|
<view class="name">
|
|
@@ -44,7 +44,7 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="list">
|
|
|
- <view class="item" >
|
|
|
+ <!-- <view class="item" >
|
|
|
<view class="name">
|
|
|
所属停车场
|
|
|
|
|
@@ -53,7 +53,7 @@
|
|
|
<view>{{bindInfo.parkingIdN?bindInfo.parkingIdN:'请选择所属停车场'}}</view>
|
|
|
<u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
<view class="item" v-if="bindInfo.lockNo">
|
|
|
<view class="name">
|
|
|
车位类型
|
|
@@ -87,7 +87,7 @@
|
|
|
<view class="floating-button">
|
|
|
<view class="button" @click="submit" >
|
|
|
|
|
|
- 提交申请
|
|
|
+ 提交绑定
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
@@ -97,8 +97,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import * as API from '@/apis/pagejs/index.js'
|
|
|
+
|
|
|
+ import * as API from '@/apis/pagejs/deviceTab.js'
|
|
|
|
|
|
+ import * as WxJsApi from '@/apis/utils/wxJsApi.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -123,10 +125,18 @@
|
|
|
}],
|
|
|
};
|
|
|
},
|
|
|
- onLoad() {
|
|
|
+ onLoad(op) {
|
|
|
+ this.bindInfo.parkingId=op.parkingId
|
|
|
this.userInfo = this.jphelp.getPersonInfo()
|
|
|
this.bindInfo.phone=this.userInfo.phone
|
|
|
},
|
|
|
+ onReady() {
|
|
|
+ WxJsApi.getWxConfig([ 'scanQRCode']).then((res) => {
|
|
|
+ // //(res)
|
|
|
+ }).catch(error => {
|
|
|
+ //(res)
|
|
|
+ })
|
|
|
+ },
|
|
|
computed:{
|
|
|
columns(){
|
|
|
var sz=[]
|
|
@@ -188,6 +198,14 @@
|
|
|
},
|
|
|
submit(){
|
|
|
|
|
|
+ if(!this.bindInfo.lockNo){
|
|
|
+ uni.showToast({
|
|
|
+ title: "请扫码识别地锁",
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
if(!this.bindInfo.name){
|
|
|
uni.showToast({
|
|
|
title: "请填写用户真实姓名",
|
|
@@ -220,11 +238,23 @@
|
|
|
})
|
|
|
API.add( this.bindInfo ).then((res) => {
|
|
|
|
|
|
- uni.redirectTo({
|
|
|
- url:"/pages/mylock/bindLockStatus?id="+res.data.applicationRecord.id
|
|
|
+
|
|
|
+ uni.hideLoading();
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ showCancel: false,
|
|
|
+ content: "操作成功",
|
|
|
+ success: res1 => {
|
|
|
+ if (res1.confirm) {
|
|
|
+ uni.navigateBack()
|
|
|
+ } else if (res1.cancel) {
|
|
|
+ //('用户点击取消');
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
- uni.hideLoading();
|
|
|
+ const eventChannel = this.getOpenerEventChannel();
|
|
|
|
|
|
+ eventChannel.emit('acceptDataFromOpenerPage', { data: 'data from starter page' })
|
|
|
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|
|
@@ -246,14 +276,26 @@
|
|
|
},
|
|
|
gotoscan() {
|
|
|
|
|
|
- // #ifdef H5
|
|
|
- this.gotoscanH5()
|
|
|
- // #endif
|
|
|
+ // // #ifdef H5
|
|
|
+ //
|
|
|
+ // // #endif
|
|
|
+
|
|
|
+ // // #ifdef MP-WEIXIN
|
|
|
+
|
|
|
+ // this.gotoscanMP()
|
|
|
+ // // #endif
|
|
|
+ if (process.env.NODE_ENV === "development"){
|
|
|
+ this.gotoscanH5()
|
|
|
+ }else{
|
|
|
+ WxJsApi.scanQRCode(1).then(res => {
|
|
|
+ var url=res;
|
|
|
+ this.getscan(url)
|
|
|
+ }).catch(error => {
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
|
|
|
- this.gotoscanMP()
|
|
|
- // #endif
|
|
|
},
|
|
|
getscan(val) {
|
|
|
|
|
@@ -267,7 +309,7 @@
|
|
|
|
|
|
}).then((res) => {
|
|
|
uni.hideLoading();
|
|
|
- if (res.data.openBind) {
|
|
|
+ if (res.data.openBind||1) {
|
|
|
|
|
|
var nowscan=res.data.floorlockInfoList;
|
|
|
if(nowscan&&nowscan.length){
|