diff --git a/README.md b/README.md index 6736ff6..a2addb2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ @@ -318,5 +318,7 @@ update update - alarmDetails - 修改 详情地址转化方式 + - 增加 进入/离开状态显示 - packageList - - 修改 微信支付方式 \ No newline at end of file + - 修改 微信支付方式 + diff --git a/src/views/alarm/alarm-details.vue b/src/views/alarm/alarm-details.vue index 685528c..5a2f2c0 100644 --- a/src/views/alarm/alarm-details.vue +++ b/src/views/alarm/alarm-details.vue @@ -10,7 +10,7 @@
-

{{ params.address }}(附近)

+

{{ params.address }}

{{ params.time }} @@ -22,6 +22,7 @@ :key="index" :type="item.type" :icon="item.icon" + v-show="item.show" @click="onErrorReport(item.name)" >{{ item.text }}
@@ -48,7 +49,6 @@ export default { inject: ["reload"], data(){ return { - title: '进入涉水区域警报', alarm: { message: '你的孩子靠近水域危险区', address: '', @@ -62,8 +62,8 @@ export default { lat: '' }, buttonList: [ - { name: 'goHere', text: '去这里', type: 'primary', icon: 'guide-o' }, - { name: 'errorReport', text: '误报', type: 'primary', icon: 'warn-o' }, + { name: 'goHere', text: '去这里', type: 'primary', icon: 'guide-o', show: true}, + { name: 'errorReport', text: '误报', type: 'primary', icon: 'warn-o', show: true }, ], map: { geocoder: null, @@ -90,8 +90,14 @@ export default { time: '' }, isPageShow: null, + status: 1 } }, + computed: { + title() { + return this.status === "1" ? '进入涉水区域警报' : '离开涉水区域警报'; + } + }, created() { this.getAuth(); this.getParams(); @@ -111,6 +117,9 @@ export default { if (isNotNull(params)) { console.log("params", params); this.params = {...params}; + this.buttonList[1].show = params.status === "1"; + this.status = params.status; + this.alarm.message = params.status === "1" ? '你的孩子靠近水域危险区': '你的孩子离开水域危险区'; this.isPageShow = true; this.initAmap(); console.log("this.params", this.params); @@ -183,7 +192,7 @@ export default { if (status == "complete" && result.info == "OK") { this.currentAddress.address = result.regeocode.formattedAddress; this.alarm.address = result.regeocode.formattedAddress; - console.log("当前地址", this.currentAddress.address); + console.log("使用高德逆地理解析得到的地址", this.currentAddress.address); } }); },