智慧保安互联网APP
shuishen
2021-10-11 b48a5f64fe196bee6f1c7eb0be1b78c9ebec0860
components/contacts/contacts.vue
@@ -9,7 +9,7 @@
            </view>
            <view class="content-wrap">
               <text class="name">{{Pdata.recipientName}}</text>
               <text class="mess">{{Pdata.postMessage}}</text>
               <text class="mess">{{isJSON(Pdata.postMessage) == true ?  '[语音]' : Pdata.postMessage}}</text>
            </view>
            <view class="data-wrap">
               <text class="data">{{Pdata.postTime}}</text>
@@ -66,6 +66,23 @@
         }
      },
      methods: {
         isJSON(str) {
            if (typeof str == 'string') {
               try {
                  var obj = JSON.parse(str);
                  if (typeof obj == 'object' && obj) {
                     return true;
                  } else {
                     return false;
                  }
               } catch (e) {
                  return false;
               }
            }
         },
         beginObj() {
            this.bmainb = '3rem';
            //#ifdef MP-WEIXIN