Эх сурвалжийг харах

style: 首页底部banner样式调整

cuiyalong 6 сар өмнө
parent
commit
0c25c7f26b

+ 79 - 66
apps/mobile/src/views/push/PushSetting.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="push-setting" ref="pushBox">
+  <div ref="pushBox" class="push-setting">
     <div class="push-module">
       <div class="push-module-title">
         <img src="@/assets/image/icon/wayForSend.png" alt="" />
@@ -7,12 +7,12 @@
       </div>
       <van-cell-group>
         <van-cell
-          @click="setMailEvent"
           class="email-cell"
           :class="{ emailbind: mailWay.isFollow }"
           is-link
           :value="mailWay.value"
           :label="mailWay.email"
+          @click="setMailEvent"
         >
           <template #title>
             <div class="email_title">
@@ -23,23 +23,23 @@
         </van-cell>
         <van-cell
           class="wx_cell"
-          @click="setWxEvent"
           :is-link="!wxWay.isFollow"
           :class="{ wxValue: wxWay.isFollow, wxBind: wxWay.isBind }"
           title="微信提醒"
           label="根据设置的推送时间通过微信公众号发送消息"
+          @click="setWxEvent"
         >
           <template #extra>
-            <span class="van-cell__value" v-html="wxWay.value"></span>
+            <span class="van-cell__value" v-html="wxWay.value" />
           </template>
         </van-cell>
         <van-cell
-          @click="setAppEvent"
           is-link
           title="APP提醒总开关"
           :value="appWay.value"
           :label="appWay.label"
-        ></van-cell>
+          @click="setAppEvent"
+        />
       </van-cell-group>
     </div>
     <div class="push-module">
@@ -49,19 +49,23 @@
       </div>
       <van-collapse v-model="activeName">
         <van-collapse-item
-          :border="false"
-          :name="index"
           v-for="(item, index) in pushFunction"
           :key="index"
+          :border="false"
+          :name="index"
         >
           <template #title>
-            <div class="collapse_title">{{ item.title }}</div>
-            <div class="collapse_label">{{ item.label }}</div>
+            <div class="collapse_title">
+              {{ item.title }}
+            </div>
+            <div class="collapse_label">
+              {{ item.label }}
+            </div>
           </template>
-          <div class="noMessage" v-if="item.title === '我的订阅'">
+          <div v-if="item.title === '我的订阅'" class="noMessage">
             <div class="left_">
               <div class="title">推荐消息提醒</div>
-              <div class="warm" @click.stop="PopupBox"></div>
+              <div class="warm" @click.stop="PopupBox" />
               <div class="states">
                 {{ item.i_nomsgtip ? '已开启' : '已关闭' }}
               </div>
@@ -73,57 +77,59 @@
               {{ !item.i_nomsgtip ? '点击开启' : '点击关闭' }}
             </div>
           </div>
-          <div class="collapse_content" v-if="item.title === '消息'">
-            <div class="msg_list" v-for="iitem in item.content" :key="iitem.id">
-              <div class="msg_list_title">{{ iitem.title }}</div>
+          <div v-if="item.title === '消息'" class="collapse_content">
+            <div v-for="iitem in item.content" :key="iitem.id" class="msg_list">
+              <div class="msg_list_title">
+                {{ iitem.title }}
+              </div>
               <div class="msg_list_switch switch_list">
-                <div class="list_way" v-if="iitem.isWxShow">
+                <div v-if="iitem.isWxShow" class="list_way">
                   <span>微信提醒</span>
                   <van-switch
-                    @change="ChangeEvent(item, 'wx', iitem)"
                     v-model="iitem.i_wxpush"
+                    @change="ChangeEvent(item, 'wx', iitem)"
                   />
                 </div>
-                <div class="list_way" v-if="showApp">
+                <div v-if="showApp" class="list_way">
                   <span>APP提醒</span>
                   <van-switch
-                    @change="ChangeEvent(item, 'app', iitem)"
                     v-model="iitem.i_apppush"
+                    @change="ChangeEvent(item, 'app', iitem)"
                   />
                 </div>
               </div>
             </div>
           </div>
-          <div class="collapse_content" v-else>
+          <div v-else class="collapse_content">
             <div class="switch_list">
-              <div class="list_way" v-if="item.isMailShow">
+              <div v-if="item.isMailShow" class="list_way">
                 <span>邮件提醒</span>
                 <van-switch
-                  @change="ChangeEvent(item, 'mail')"
                   v-model="item.i_mailpush"
+                  @change="ChangeEvent(item, 'mail')"
                 />
               </div>
-              <div class="list_way" v-if="item.isWxShow">
+              <div v-if="item.isWxShow" class="list_way">
                 <span>微信提醒</span>
                 <van-switch
-                  @change="ChangeEvent(item, 'wx')"
                   v-model="item.i_wxpush"
+                  @change="ChangeEvent(item, 'wx')"
                 />
               </div>
-              <div class="list_way" v-if="showApp">
+              <div v-if="showApp" class="list_way">
                 <span>APP提醒</span>
                 <van-switch
-                  @change="ChangeEvent(item, 'app')"
                   v-model="item.i_apppush"
+                  @change="ChangeEvent(item, 'app')"
                 />
               </div>
             </div>
             <div
-              class="set-push-time"
               v-if="
                 needEditTimesType.indexOf(item.param) > -1 &&
                 editResultTime[item.param]
               "
+              class="set-push-time"
             >
               <div class="push-time-left">
                 <span>推送时间:</span>
@@ -146,7 +152,7 @@
                   }}</span>
                 </span>
               </div>
-              <div @click="editTimeEvent(item)" class="push-time-right">
+              <div class="push-time-right" @click="editTimeEvent(item)">
                 编辑
               </div>
             </div>
@@ -170,10 +176,10 @@
           </template>
           <template #right-icon>
             <van-switch
-              @change="setInterestedEvent"
-              :class="{ active: recSwitch }"
               v-model="recSwitch"
-            ></van-switch>
+              :class="{ active: recSwitch }"
+              @change="setInterestedEvent"
+            />
           </template>
         </van-cell>
       </van-cell-group>
@@ -191,18 +197,18 @@
         "
         @closeIconClick="closePopup"
       >
-        <div class="select_push_time" slot="default">
+        <div slot="default" class="select_push_time">
           <van-cell-group>
             <van-cell
+              v-for="item in pushCycle"
+              :key="item.id"
               :class="
                 item.id === 2 && selectTimeSlot.length !== 0
                   ? `dayPush ${getHaveLine}`
                   : ''
               "
-              @click="setPushTime(item)"
               :title="item.title"
-              v-for="item in pushCycle"
-              :key="item.id"
+              @click="setPushTime(item)"
             >
               <template #right-icon>
                 <div class="select_right">
@@ -215,15 +221,15 @@
                   <van-icon v-if="item.id === 2" name="arrow" color="#9B9CA3" />
                 </div>
               </template>
-              <template #label v-if="item.id === 2">
+              <template v-if="item.id === 2" #label>
                 <div class="show-time-main">
-                  <div class="time-list" v-for="v in selectTimeSlot" :key="v">
+                  <div v-for="v in selectTimeSlot" :key="v" class="time-list">
                     <span v-if="v < 10">0{{ v }}:00</span>
                     <span v-if="v >= 10">{{ v }}:00</span>
                     <van-icon
-                      @click.stop="deleteTimeEvent(v)"
                       name="clear"
                       color="#2ABED1"
+                      @click.stop="deleteTimeEvent(v)"
                     />
                   </div>
                 </div>
@@ -231,7 +237,7 @@
             </van-cell>
           </van-cell-group>
         </div>
-        <div class="select_push_footer" slot="footer">
+        <div slot="footer" class="select_push_footer">
           <button @click="setTimeCancel">取消</button>
           <button @click="setTimeConfirm">确认</button>
         </div>
@@ -245,13 +251,13 @@
       get-container="body"
     >
       <PopupLayout title="选择时间" @closeIconClick="closeTimeListPopup">
-        <div class="select_push_time_list" slot="default">
+        <div slot="default" class="select_push_time_list">
           <div
-            @click="setTimeSlot(item)"
-            :class="{ active: item.active }"
-            class="time-btn"
             v-for="item in timeList"
             :key="item.time"
+            :class="{ active: item.active }"
+            class="time-btn"
+            @click="setTimeSlot(item)"
           >
             <span v-if="item.time < 10">0{{ item.time }}:00</span>
             <span v-if="item.time >= 10">{{ item.time }}:00</span>
@@ -263,7 +269,7 @@
             />
           </div>
         </div>
-        <div class="select_push_footer" slot="footer">
+        <div slot="footer" class="select_push_footer">
           <button @click="setTimeSlotCancel">取消</button>
           <button :disabled="isShowBtn" @click="setTimeSlotConfirm">
             确认
@@ -272,7 +278,7 @@
       </PopupLayout>
     </van-popup>
     <Dialog
-      :confirmButtonDisabled="confirmDisabled"
+      :confirm-button-disabled="confirmDisabled"
       title="绑定邮箱地址"
       :show-dialog="mailWay.mailDialog"
       @cancel="mailCancel"
@@ -280,18 +286,18 @@
     >
       <van-field
         slot="content"
-        @input="setEmailRule"
-        class="attachment-email-input"
         v-model="mailWay.filedEmail"
+        class="attachment-email-input"
         placeholder="输入邮箱地址"
+        @input="setEmailRule"
       />
     </Dialog>
     <Dialog
       :title="dparam.setTitle"
       :show-dialog="dparam.setDialog"
+      :confirm-button-text="dparam.confirmButtonText"
       @cancel="cancel"
       @confirm="confirm"
-      :confirmButtonText="dparam.confirmButtonText"
     >
       <p v-if="dparam.showTextP === 1" slot="content">
         您尚未关注微信公众号,无法开启微信提醒,建议您前往关注后再开启。
@@ -315,30 +321,33 @@
     </Dialog>
   </div>
 </template>
+
 <script>
 import {
-  CellGroup,
   Cell,
+  CellGroup,
   Collapse,
   CollapseItem,
-  Switch,
   Field,
+  Icon,
   Popup,
-  Icon
+  Switch
 } from 'vant'
+import { mapState } from 'vuex'
 import {
-  getUser,
+  getMergeInfo,
   getPushSet,
+  getUser,
   setPushSet,
-  setUser,
-  getMergeInfo
+  setUser
 } from '@/api/modules'
 import { openSystemNotification } from '@/utils/callFn/appFn'
 import Dialog from '@/components/common/Dialog.vue'
 import PopupLayout from '@/components/common/PopupLayout.vue'
-import { mapState } from 'vuex'
+import downloadApp from '@/utils/mixins/modules/to-download-app'
+
 export default {
-  name: 'push-setting',
+  name: 'PushSetting',
   components: {
     [CellGroup.name]: CellGroup,
     [Cell.name]: Cell,
@@ -351,6 +360,7 @@ export default {
     Dialog,
     PopupLayout
   },
+  mixins: [downloadApp],
   data() {
     return {
       confirmDisabled: false,
@@ -600,12 +610,12 @@ export default {
     },
     // 判断每日推送高度
     getHaveLine() {
-      let num = parseInt(this.selectTimeSlot.length / 3)
-      const remain = parseInt(this.selectTimeSlot.length % 3)
+      let num = Number.parseInt(this.selectTimeSlot.length / 3)
+      const remain = Number.parseInt(this.selectTimeSlot.length % 3)
       if (remain !== 0) {
         num++
       }
-      return 'line_' + num
+      return `line_${num}`
     },
     isShowBtn() {
       return (
@@ -683,7 +693,7 @@ export default {
         }
         this.timeList.forEach((item, index) => {
           item.active = false
-          if (this.selectTimeSlot.indexOf(item.time) > -1) {
+          if (this.selectTimeSlot.includes(item.time)) {
             item.active = true
           }
         })
@@ -740,7 +750,7 @@ export default {
       const param = {
         item: this.editTimesFlag || 'o_subset',
         setType: 'a_times',
-        ratemode: ratemode
+        ratemode
       }
       if (ratemode === 2) {
         const timeArr = []
@@ -789,7 +799,7 @@ export default {
             if (data[v.param]) {
               // 可编辑推送时间段
               if (
-                this.needEditTimesType.indexOf(v.param) > -1 &&
+                this.needEditTimesType.includes(v.param) &&
                 this.editResultTime[v.param]
               ) {
                 if (v.param === 'o_subset') {
@@ -935,7 +945,7 @@ export default {
       const newArr = []
       arr.forEach((v) => {
         v = v.slice(0, 2)
-        v = parseInt(v, 10)
+        v = Number.parseInt(v, 10)
         newArr.push(v)
       })
       return newArr
@@ -1045,7 +1055,8 @@ export default {
     PopupBox() {
       this.$dialog.confirm({
         title: '推荐消息提醒',
-        message: '根据您在平台的订阅词/搜索词/浏览标讯进行联想推荐,剑鱼标讯智能推荐为您推送新的标讯信息。',
+        message:
+          '根据您在平台的订阅词/搜索词/浏览标讯进行联想推荐,剑鱼标讯智能推荐为您推送新的标讯信息。',
         className: 'j-confirm-dialog',
         messageAlign: 'left',
         showCancelButton: false,
@@ -1080,8 +1091,7 @@ export default {
     },
     // 校验邮箱规则
     setEmailRule(value) {
-      const reg =
-        /^[a-zA-Z0-9]+([-_.][A-Za-zd]+)*@([a-zA-Z0-9]+[-.])+[A-Za-zd]{2,5}$/
+      const reg = /^[a-z0-9]+([-_.][A-Z]+)*@([a-z0-9]+[-.])+[A-Z]{2,5}$/i
       if (!reg.test(value)) {
         this.confirmDisabled = true
       } else {
@@ -1107,6 +1117,9 @@ export default {
     },
     // app提醒
     setAppEvent() {
+      if (this.$envs.inWxMini) {
+        return this.toFollowGuidePage()
+      }
       if (this.$env.platform === 'app') {
         // 实现轮询
         this.timer = window.setInterval(() => {

+ 3 - 3
apps/mobile/src/views/tabbar/Home.vue

@@ -852,9 +852,9 @@ export default {
     bottom: 16px;
     width: 100%;
     &.has-wx {
-      bottom: calc(13.333vw + 16px);
-      bottom: calc(13.333vw + 16px + constant(safe-area-inset-bottom));
-      bottom: calc(13.333vw + 16px + env(safe-area-inset-bottom));
+      bottom: calc(13.333vw + 8px);
+      bottom: calc(13.333vw + 8px + constant(safe-area-inset-bottom));
+      bottom: calc(13.333vw + 8px + env(safe-area-inset-bottom));
     }
     ::v-deep .close {
       top: -6px;