zengh
2022-09-14 8ea19a6bb34daab1410f6186992a4c1e90299c92
components/contacts/contacts.vue
@@ -1,6 +1,6 @@
<template>
   <view class="pColumn">
      <view class="inPColumn" >
   <view class="pColumn" >
      <view class="inPColumn" v-if="fromW == 0">
         <view class="left" @click="chating">
            <view class="top">
               <view class="userImg">
@@ -10,6 +10,30 @@
               <view class="t-id">{{Pdata.postTime}}</view>
            </view>
            <view class="bottom">{{Pdata.postMessage}}</view>
         </view>
      </view>
      <view class="inPColumn" v-if="fromW == 1">
         <view class="left" @click="QZchating">
            <view class="top">
               <view class="userImg">
                  <img class="img" :src=Pdata.avatar>
               </view>
               <view class="t-type">{{Pdata.GroupName}}</view>
               <!-- <view class="t-id">{{Pdata.postTime}}</view> -->
            </view>
            <view class="bottom">{{Pdata.GroupContent}}</view>
         </view>
      </view>
      <view class="inPColumn" v-if="fromW == 2">
         <view class="left" @click="TXLchating">
            <view class="top">
               <view class="userImg">
                  <img class="img" :src=Pdata.avatar>
               </view>
               <view class="t-type">{{Pdata.realName}}</view>
               <!-- <view class="t-id">{{Pdata.postTime}}</view> -->
            </view>
            <view class="bottom">电话:{{Pdata.phone}}</view>
         </view>
      </view>
   </view>
@@ -31,54 +55,35 @@
            this.bmainb = '0';
            //#endif
         },
         receives() {
            var url = this.$store.state.piAPI + "blade-jfpts/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);
               }
            })
         },
         chating(){
         //发起聊天
         var datas = this.Pdata;
         //alert(datas.name)
         uni.navigateTo({
             url: '/pages/groupChat/chating?chatID=' + datas.recipientId.toString()
         });
            //发起聊天
            var datas = this.Pdata;
            //alert(datas.name)
            uni.navigateTo({
               url: '/pages/groupChat/chating?chatID=' + datas.recipientId.toString()
            });
         },
         QZchating(){
            //发起聊天
            var datas = this.Pdata;
            //alert(datas.name)
            uni.navigateTo({
                url: '/pages/groupChat/chatingQZ?chatID=' + datas.id.toString()
            });
         },
         TXLchating(){
            //发起聊天
            var datas = this.Pdata;
            //alert(datas.name)
            uni.navigateTo({
               url: '/pages/groupChat/chating?chatID=' + datas.id.toString()
            });
         },
         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();