Commit acde9d87 authored by lijiongliang's avatar lijiongliang

一键挪车页面修改

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