Commit acde9d87 authored by lijiongliang's avatar lijiongliang

一键挪车页面修改

parent 54ea60d2
<template>
<view class="appCotent">
<div class="oneMoveCar">
<view class="appCotent">
<div class="oneMoveCar">
<div class="contentMoveCar">
<div class="car_item__one">
<div class="item__label item__label__one">
......@@ -36,7 +36,7 @@
拨打车主电话通知
</div>
<div class="move-car__btn" @click="wechat">
微信通知(上限3次)
微信通知(上限{{wxMaxNum}}次)
</div>
<!-- <div class="move-car__wx">
<u-checkbox-group placement="row">
......@@ -61,34 +61,35 @@
</div>
</div>
</div>
<u-action-sheet :actions="list" @close='close' @select="selectClick" closeOnClickOverlay round='6' :show="show"></u-action-sheet>
</div>
</view>
<u-action-sheet :actions="list" @close='close' @select="selectClick" closeOnClickOverlay round='6'
:show="show"></u-action-sheet>
</div>
</view>
</template>
<script>
export default {
export default {
data() {
return {
show:false,
show: false,
list: [
// {
// name:'2367虚拟号码345',
// color:'#333333',
// fontSize:'20',
// },
{
name:'2367虚拟号码345',
color:'#333333',
fontSize:'20',
},
{
name:'呼叫',
color:'#3A86F7',
fontSize:'18',
name: '呼叫',
color: '#3A86F7',
fontSize: '18',
},
{
name:'取消',
color:'#E6271D',
fontSize:'18',
name: '取消',
color: '#E6271D',
fontSize: '18',
},
],
checked:false,
checked: false,
moveCode: '',
appBusCar: {},
appBo: {
......@@ -116,6 +117,7 @@ export default {
notAllowPhoneReason: '',
notAllowWechatReason: '',
},
wxMaxNum:""
}
},
methods: {
......@@ -124,7 +126,7 @@ export default {
url: '/pages/main'
});
},
changeWechat(){
changeWechat() {
this.appBo.wechat = !this.appBo.wechat
},
call() {
......@@ -137,18 +139,21 @@ export default {
// this.appBo.wechat = true
this.appBo.moveCode = this.moveCode
let opts = { url: '/app/contact/phone/notice' , method: 'post' };
let opts = {
url: '/app/contact/phone/notice',
method: 'post'
};
this.http.httpTokenRequest(opts, this.appBo).then(res => {
if (res.data.code == 200) {
//请求成功逻辑,修改
this.noticeResult = res.data.data
if (this.noticeResult.allowPhone){
this.list[0].name = this.noticeResult.secretPhone
if (this.noticeResult.allowPhone) {
// this.list[0].name = this.noticeResult.secretPhone
this.show = true;
}
}else{
} else {
this.noticeResult = res.data.data
if (this.noticeResult){
if (this.noticeResult) {
uni.showModal({
content: this.noticeResult.notAllowPhoneReason,
})
......@@ -156,18 +161,21 @@ export default {
}
})
},
wechat(){
wechat() {
this.appBo.moveCode = this.moveCode
let opts = { url: '/app/contact/wechat/notice' , method: 'post' };
let opts = {
url: '/app/contact/wechat/notice',
method: 'post'
};
this.http.httpTokenRequest(opts, this.appBo).then(res => {
if (res.data.code == 200) {
uni.showModal({
content: "微信消息发送成功",
})
}else{
} else {
//请求成功逻辑,修改
this.noticeResult = res.data.data
if (this.noticeResult){
if (this.noticeResult) {
uni.showModal({
content: this.noticeResult.notAllowWechatReason,
})
......@@ -178,15 +186,15 @@ export default {
close() {
this.show = false;
},
goMyMoveCar(){
goMyMoveCar() {
},
selectClick(index){
if(index.name == "呼叫"){
selectClick(index) {
if (index.name == "呼叫") {
uni.makePhoneCall({
phoneNumber: this.noticeResult.secretPhone
});
}else if(index.name == "取消"){
} else if (index.name == "取消") {
this.show = false;
}
},
......@@ -195,20 +203,35 @@ export default {
url: '/pagesB/pages/move-car/myMoveCar'
})
},
getCarNumber(){
let opts = { url: '/app/moveCode/owner/' + this.moveCode, method: 'get' };
// 获取微信通知次数
getMoveCode() {
let opts = {
url: '/app/moveCode/notice/config',
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
this.wxMaxNum = res.data.data.wxMaxNum
}
})
},
getCarNumber() {
let opts = {
url: '/app/moveCode/owner/' + this.moveCode,
method: 'get'
};
//let opts = { url: '/app/moveCode/owner/MV123', method: 'get' };
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
if(JSON.stringify(res.data.data) != "{}"){
if (JSON.stringify(res.data.data) != "{}") {
this.appBo.carNo = res.data.data.carNo
}else{
} else {
uni.navigateTo({
url: '/pagesB/pages/move-car/scan?moveCode=' + this.moveCode
})
}
}else{
} else {
//查询挪车码失败
uni.showToast({
title: res.data.msg,
......@@ -217,8 +240,11 @@ export default {
}
})
},
getMoveLogInit(){
let opts = { url: '/app/moveLog/init', method: 'get' };
getMoveLogInit() {
let opts = {
url: '/app/moveLog/init',
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
//添加逻辑判断
......@@ -240,7 +266,7 @@ export default {
uni.showModal({
title: '温馨提示',
content: '无法获取当前位置,请手动开启授权',
success: function (res) {
success: function(res) {
if (res.confirm) {
//console.log('用户点击确定')
uni.openSetting({
......@@ -293,7 +319,7 @@ export default {
success(res) {
console.log(res);
if (res.statusCode === 200) {
if(res.data.status === '1') {
if (res.data.status === '1') {
let addressInfo = res.data
//详细地址
that.appBo.detailInfo = addressInfo.regeocode.formatted_address
......@@ -302,7 +328,7 @@ export default {
//市,直辖市有可能为空数组
that.appBo.cityName = addressInfo.regeocode.addressComponent.city
//为数组的时候设置为空
if(Array.isArray(that.appBo.cityName)) {
if (Array.isArray(that.appBo.cityName)) {
that.appBo.cityName = ''
}
//区
......@@ -325,7 +351,7 @@ export default {
// 在页面加载的时候去判断用户有没有授权地理位置,没授权的话引导用户去设置页手动授权
this.getAuthorize()
console.log(e)
if(e.scene) {
if (e.scene) {
//获取二维码携带的参数
//扫码后得到的参数
//let scene = decodeURIComponent(e.query.scene)
......@@ -340,24 +366,25 @@ export default {
},
onShow() {
this.getCarNumber()
this.getMoveCode()
},
created() {
},
}
}
</script>
<style lang="scss" scoped>
.u-notice-bar {
.u-notice-bar {
padding: 0 !important;
}
.oneMoveCar {
}
.oneMoveCar {
.u-checkbox-group {
display: inline-block !important;
}
/deep/.u-checkbox-group--row {
display: inline-block !important;
}
......@@ -478,7 +505,7 @@ export default {
line-height: 76rpx;
background: url(@/static/move-car/move-car-code7.png) no-repeat;
background-size: contain;
margin: 100rpx auto 30rpx auto;
margin: 40rpx auto 30rpx auto;
}
......@@ -519,5 +546,5 @@ export default {
}
}
}
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment