提交 848e9136 authored 作者: 正反's avatar 正反

地图修改

上级 fdd25152
......@@ -31,6 +31,15 @@ export function SFView(status){
})
}
export function GetSFOrderTypeQty(status){
return http({
url:'/api/Order/GetSFOrderTypeQty',
data:{
status:status
}
})
}
/**
* @param {String} fileid 文件id值
......
......@@ -5,20 +5,21 @@
<u-icon name="/static/images/screenList.png" label-color="#f0f5ff" size="50rpx" @cilck="show"></u-icon>
</view>
<view>
<u-popup v-model="showPopup" mode="right" width="80%">
<u-popup v-model="showPopup" mode="right" width="80%" class="showPopup">
<view class="topBox">
<text style="display: block;">订单状态</text>
<view>
<u-checkbox-group @change="checkboxGroupChange" active-color="#7D5AFC">
<u-checkbox v-model="item.checked"
v-for="(item, index) in Slist" :key="index" :name="item.name">{{item.name}}
<u-checkbox v-model="item.checked" v-for="(item, index) in Slist" :key="index"
:name="item.name">{{item.name}}
</u-checkbox>
</u-checkbox-group>
</view>
</view>
<view class="topBox">
<text style="display: inline-block;">自定义日期</text>
<u-switch v-model="showChoiceTime" size="30" @change="change" active-color="#7D5AFC" style="display: inline-block;"></u-switch>
<u-switch v-model="showChoiceTime" size="30" @change="change" active-color="#7D5AFC"
style="display: inline-block;"></u-switch>
<view v-if="showChoiceTime==false">
<u-radio-group v-model="value" @change="radioGroupChange" active-color="#7D5AFC">
<u-radio @change="radioChange" v-for="(item, index) in list" :key="index"
......@@ -28,16 +29,17 @@
</u-radio-group>
</view>
<view v-else>
<text class="ctext" @click="showTimeList=true">请选择起止日期</text>
<text class="tText" style="color: red;">*请至少选择一个日期</text>
<text class="ctext" @click="showTimeList=true">{{timeText}}</text>
<text class="tText" style="color: red;" :class="{'show':dispalyText}">*请至少选择一个日期</text>
<view>
<u-calendar v-model="showTimeList" :mode="mode" max-date="2100-01-01"
active-bg-color="#55d65b" range-bg-color="rgba(17, 255, 164, 0.1)"
toolTip="请选择订单起止时间" range-color="#55d65b" btn-type="default">
toolTip="请选择订单起止时间" range-color="#55d65b" btn-type="default" @change="timeChange">
</u-calendar>
</view>
</view>
</view>
<button class="button" @click="confirm" :disabled="buttonDisabled">确认</button>
</u-popup>
</view>
</map>
......@@ -46,6 +48,9 @@
</template>
<script>
import {
GetSFOrderTypeQty
} from '../../api/apis.js'
export default {
onLoad() {
this.getUserLocation()
......@@ -53,6 +58,8 @@
},
data() {
return {
buttonDisabled: false,
dispalyText: false,
//经度
longitude: '',
//纬度
......@@ -101,7 +108,9 @@
disabled: false
}
],
value:'今天',
value: '今天',
timeText: '请选择起止日期',
timeChoice: ''
}
},
methods: {
......@@ -121,55 +130,62 @@
}
})
setInterval(wx.startLocationUpdateBackground({
success:(res)=>{
//成功的逻辑
wx.onLocationChange((res)=>{ //获取实时的定位信息
console.log(res)
console.log("用户位置信息:",res)
that.markers[0].longitude = res.longitude
that.markers[0].latitude = res.latitude
wx.stopLocationUpdate()
})
},
fail:(err)=>{
//失败的逻辑
//1.wx.showModal引导用户授权
//2.通过wx.openSetting让用户开启权限
wx.showModal({ //引导用户授权
content: '小程序需要实时获取位置,请设置为后台前台都可运行',
confirmText: "确认",
cancelText: "取消",
success: function (res) {
//点击“确认”时打开设置页面
if (res.confirm) {
wx.openSetting({ //打开设置页面让用户选择权限
success: (res) => {
if(res.authSetting["scope.userLocationBackground"] == true){
wx.onLocationChange((res)=>{ //实时获取用户最新的经纬度信息
console.log(res)
console.log("用户位置信息:",res)
that.markers[0].longitude = res.longitude
that.markers[0].latitude = res.latitude
wx.stopLocationUpdate()
})
}
}
})
} else { //取消打开设置授权页面
wx.showToast({
title: "取消授权~",
icon: 'none',
})
}
}
})
}
}),1000)
success: (res) => {
//成功的逻辑
wx.onLocationChange((res) => { //获取实时的定位信息
console.log(res)
console.log("用户位置信息:", res)
that.markers[0].longitude = res.longitude
that.markers[0].latitude = res.latitude
wx.stopLocationUpdate()
})
},
fail: (err) => {
//失败的逻辑
//1.wx.showModal引导用户授权
//2.通过wx.openSetting让用户开启权限
wx.showModal({ //引导用户授权
content: '小程序需要实时获取位置,请设置为后台前台都可运行',
confirmText: "确认",
cancelText: "取消",
success: function(res) {
//点击“确认”时打开设置页面
if (res.confirm) {
wx.openSetting({ //打开设置页面让用户选择权限
success: (res) => {
if (res.authSetting[
"scope.userLocationBackground"
] == true) {
wx.onLocationChange((
res
) => { //实时获取用户最新的经纬度信息
console.log(res)
console.log("用户位置信息:",
res)
that.markers[0]
.longitude = res
.longitude
that.markers[0]
.latitude = res
.latitude
wx.stopLocationUpdate()
})
}
}
})
} else { //取消打开设置授权页面
wx.showToast({
title: "取消授权~",
icon: 'none',
})
}
}
})
}
}), 1000)
},
show() {
this.showPopup = true
......@@ -177,7 +193,11 @@
},
change(status) {
if (status) {
if (this.dispalyText === false) {
this.buttonDisabled = true
}
} else {
this.buttonDisabled = false
}
},
checkboxGroupChange(e) {
......@@ -185,6 +205,27 @@
},
radioGroupChange(e) {
},
timeChange(e) {
console.log(e)
this.timeChoice = e
this.timeText = e.startDate + '至' + e.endDate
if (e) {
this.dispalyText = true
this.buttonDisabled = false
} else {
this.dispalyText = false
this.buttonDisabled = true
}
},
confirm() {
this.showPopup = false
GetSFOrderTypeQty().then((res) => {
if (res.data.code == 0) {
console.log(res)
}
})
}
}
}
......@@ -220,11 +261,26 @@
.ctext {
display: inline-block;
background-color: #b3b3b3;
margin-top:20rpx;
margin-top: 20rpx;
}
.tText {
display: block;
margin-top: 10rpx;
}
.button {
position: absolute;
bottom: 20rpx;
width: 90%;
left: 5%
}
.showPopup {
position: relative;
}
.show {
display: none;
}
</style>
......@@ -912,10 +912,10 @@
//设置付款方式
switch (val.Maindata[0].FPayWay) {
case '1':
this.payWay = '下单支付'
this.payWay = '平台支付'
break
case '2':
this.payWay = '验收完成支付'
this.payWay = '平台支付'
break
case '3':
this.payWay = '业主现场支付'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论