<template>
|
<view class="pColumn">
|
<view class="inPColumn">
|
<view class="left">
|
<view class="top">
|
<view class="t-type">{{Pdata.alarmType}} </view>
|
<view class="t-id"> 警单编号:{{Pdata.id}}</view>
|
</view>
|
<view class="image-time">
|
<image src="../../static/images/pColumn/alarm.png"></image>
|
<view class="t-time"> {{Pdata.alarmTime}}</view>
|
</view>
|
<view class="image-place">
|
<image src="../../static/images/pColumn/position-bule.png"></image>
|
<view class="place">{{Pdata.place}}</view>
|
</view>
|
</view>
|
<view class="right">
|
<button type="default" @click="PClick">{{fromW == 0?'详情':fromW == 1?'接受':""}}</button>
|
<view class="butPopup" v-show="popuShow">
|
<view class="b-main" :style="{bottom: bmainb}">
|
<view class="b-m-title">
|
是否接该任务
|
</view>
|
<button class="b-m-Y" hover-class='b-m-Y-hove' type="default" @click="popupBY">接受</button>
|
<button class="b-m-N" hover-class='b-m-N-hove' type="default" @click="popupBN">取消</button>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
props: ['fromW', 'Pdata'],
|
data() {
|
return {
|
popuShow: false,
|
bmainb: ''
|
}
|
},
|
methods: {
|
beginObj() {
|
this.bmainb = '3rem';
|
//#ifdef MP-WEIXIN
|
this.bmainb = '0';
|
//#endif
|
},
|
receives() {
|
var url = this.$store.state.piAPI + "/alarm/alarm/APP-setAlarm",
|
Pid = this.Pdata.id,
|
id = this.$store.state.puserID, //警察id
|
name = this.$store.state.puserName, //警察id
|
data = {
|
id: Pid,
|
securityId: id,
|
alarmPeople: name
|
},
|
that = this;
|
// console.log(data);
|
wx.request({
|
url: url,
|
data: data,
|
header: {
|
"content-type": "application/x-www-form-urlencoded"
|
},
|
method: 'POST',
|
success(res) {
|
// console.log(res.data.msg);
|
}
|
})
|
},
|
PClick(val) {
|
if (this.fromW == 0) { //打开详情页面
|
// wx.navigateTo({url: '/pages/map/map'});
|
var datas = this.Pdata;
|
datas.state = 0;
|
datas.dtype = 0;
|
datas.size = 300;
|
// console.log(datas)
|
var data = [datas]; //传给地图的参数
|
wx.navigateTo({
|
url: '/pages/map/map?data=' + JSON.stringify(data)
|
});
|
} else if (this.fromW == 1) { //打开提交弹窗
|
this.popuShow = true;
|
}
|
},
|
onClose() { //触摸遮罩事件
|
this.setData({
|
popuShow: false
|
});
|
},
|
popupBY() {
|
this.receives();
|
// console.log('接收成功');
|
this.$emit('refreshTask', this.fromW)
|
// this.triggerEvent('myevent', this.data.fromW);
|
this.popuShow = false;
|
},
|
popupBN() {
|
// console.log('接收取消');
|
this.popuShow = false;
|
}
|
},
|
mounted() {
|
this.beginObj();
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
/* components/pColumn/pColumn.wxss */
|
.pColumn,
|
.inPColumn,
|
.left,
|
.right,
|
.image-time,
|
.image-place,
|
.top {
|
display: flex;
|
}
|
|
.pColumn {
|
width: 100%;
|
align-items: center;
|
justify-content: center;
|
padding-top: 0.8rem;
|
|
.inPColumn {
|
// background-color: #00BFFF;
|
margin: 0.2rem 0 0.4rem 0;
|
width: 95%;
|
height: 5rem;
|
border-bottom: 1px rgb(207, 207, 207) solid;
|
align-items: center;
|
justify-content: space-between;
|
|
.left {
|
width: 80%;
|
/* border: 1px rgb(114, 250, 159) solid; */
|
flex-direction: column;
|
|
.top {
|
.t-type {
|
font-size: 1.1rem;
|
color: #ff0000;
|
letter-spacing: 1px;
|
}
|
|
.t-id {
|
color: #00aaff;
|
font-size: 0.8rem;
|
line-height: 1.6rem;
|
position: relative;
|
left: 0.7rem;
|
}
|
}
|
|
.image-time{
|
align-items: center;
|
height: 30px;
|
|
image{
|
width: 35rpx;
|
height: 35rpx;
|
}
|
|
.t-time{
|
font-size: 0.8rem;
|
color: #808080;
|
height: 20rpx;
|
line-height: 20rpx;
|
margin-left: 15rpx;
|
}
|
}
|
|
.image-place{
|
align-items: center;
|
height: 20px;
|
|
image{
|
width: 35rpx;
|
height: 35rpx;
|
}
|
|
.place {
|
font-size: 0.8rem;
|
margin-left: 15rpx;
|
color: #808080;
|
height: 20rpx;
|
line-height: 20rpx;
|
}
|
}
|
|
}
|
|
.right {
|
width: 20%;
|
/* border: 1px rgb(143, 114, 250) solid; */
|
justify-content: space-around;
|
|
/* align-items: center; */
|
.butPopup {
|
z-index: 4;
|
position: fixed;
|
top: 0;
|
left: 0;
|
width: 100%;
|
height: 100%;
|
background-color: rgba($color: #000000, $alpha: 0.5);
|
|
.b-main {
|
position: absolute;
|
z-index: 2;
|
// bottom: 3rem;//小程序不兼容
|
width: 100%;
|
// border: 1px solid #007AFF;
|
border-radius: 1.5rem;
|
background-color: #fff;
|
|
// height: 20rem;
|
.b-m-title {
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
width: 100%;
|
height: 2.8rem;
|
}
|
|
.b-m-Y,
|
.b-m-N {
|
color: #fff;
|
border-radius: 0;
|
}
|
|
.b-m-Y {
|
background-color: #07C160 !important;
|
}
|
|
.b-m-Y-hove {
|
background-color: #048c44 !important;
|
}
|
|
.b-m-N {
|
background-color: #FF976A !important;
|
}
|
|
.b-m-N-hove {
|
background-color: #e1855d !important;
|
}
|
}
|
}
|
}
|
}
|
}
|
|
|
|
|
// .buttitle {
|
// display: flex;
|
// align-items: center;
|
// justify-content: center;
|
// width: 100%;
|
// height: 2.8rem;
|
// }
|
|
// .popups {
|
// width: 100%;
|
// padding-bottom: 0 !important;
|
// /* border: 1px solid seagreen; */
|
// }
|
</style>
|