Explorar o código

feat:推送-添加消息微信推送

zhangsiya %!s(int64=2) %!d(string=hai) anos
pai
achega
f47897e276

+ 27 - 0
src/assets/js/selector.js

@@ -559,6 +559,33 @@ export const pushFunctionData = [
     desc: '根据订阅条件,向您推送相关招投标公告信息。',
     showEdit: true
   },
+  {
+    classType: 'o_message',
+    type: 'o_msg_active',
+    subTitle: '活动通知',
+    name: '消息',
+    desc: '剑鱼将为您提供精准的消息推送服务',
+    showEdit: false
+  },
+  {
+    classType: 'o_message',
+    type: 'o_msg_service',
+    subTitle: '服务通知',
+    showEdit: false
+  },
+  {
+    classType: 'o_message',
+    type: 'o_msg_jyschool',
+    subTitle: '剑鱼学堂',
+    showEdit: false
+  },
+  {
+    classType: 'o_message',
+    type: 'o_msg_privateletter',
+    subTitle: '私信',
+    lastRow: true,
+    showEdit: false
+  },
   {
     type: 'o_follow_project',
     name: '项目进度监控',

+ 27 - 6
src/components/push-setting/setList.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="fun-list">
+  <div class="fun-list" :class="{'class-type': classType, 'last-row': lastRow}">
     <div class="f-l-left">
       <div class="title_box">
         <h4 class="list-name">{{ name }}</h4>
@@ -19,6 +19,7 @@
       <p class="list-desc">{{ desc }}</p>
     </div>
     <div class="f-l-middle">
+      <div class="switch-item sub-title" v-if="classType"><span>{{subTitle}}</span></div>
       <div class="switch-item" v-if="isMailShow">
         <span>邮件提醒</span>
         <el-switch :value="emailVal" active-color="#2ABED1" inactive-color="#E3E4E5" :active-value="1" :inactive-value="0"
@@ -65,7 +66,11 @@ export default {
     noMsgtip: {
       type: [Boolean, Number],
       default: 0
-    }
+    },
+    // 分类类别
+    classType: String,
+    subTitle: String,
+    lastRow: Boolean
   },
   components: {
     [Switch.name]: Switch,
@@ -91,6 +96,8 @@ export default {
       this.nomsgtipRadio = newVal || 0
     }
   },
+  mounted () {
+  },
   methods: {
     onEdit () {
       this.$emit('edit', {
@@ -136,18 +143,28 @@ export default {
   }
 }
 </script>
-
 <style lang="scss" scoped>
 .fun-list {
   display: flex;
   align-items: center;
   justify-content: space-between;
   padding: 12px 0;
-
   &:not(:last-child) {
     box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
   }
-
+  &.class-type{
+    box-shadow: none;
+    padding-top:16px;
+    padding-bottom:0;
+    .list-desc{
+      position: absolute;
+      top:17px;
+    }
+  }
+  &.last-row{
+    box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
+    padding-bottom:12px;
+  }
   .title_box {
     display: flex;
 
@@ -231,6 +248,7 @@ export default {
   }
 
   .f-l-left {
+    position: relative;
     width: 44%;
     @extend .flex-center;
     flex-direction: column;
@@ -276,6 +294,10 @@ export default {
     >span {
       margin-right: 12px;
     }
+    &.sub-title{
+      min-width:116px;
+      color: #686868;
+    }
   }
 
   .edit-text {
@@ -284,7 +306,6 @@ export default {
     cursor: pointer;
   }
 }
-
 ::v-deep {
   .el-switch__core {
     width: 48px !important;

+ 4 - 1
src/views/push-setting/index.vue

@@ -282,6 +282,9 @@ export default {
                 v.a_times = []
               }
               arr.push({
+                classType: v.classType, // 仅用于归类展示
+                subTitle: v.subTitle, // 仅用于归类展示的副标题
+                lastRow: v.lastRow, // 用于区分该分类最后一条数据
                 type: v.type,
                 name: v.name,
                 desc: v.desc,
@@ -294,7 +297,7 @@ export default {
                 noMsgtip: data[key].i_nomsgtip,
                 rateMode: data[key].i_ratemode,
                 times: v.type === 'o_subset' ? this.getRateTimes(data[key].i_ratemode, data[key].a_times) : data[key].a_times,
-                way: v.type === 'o_subset' ? this.getRateWay(data[key].i_ratemode, data[key].a_times) : data[key].a_times.toString()
+                way: v.type === 'o_subset' ? this.getRateWay(data[key].i_ratemode, data[key].a_times) : data[key].a_times?.toString()
               })
             }
           }