liuyg
2022-03-11 67d794932cdf67b221287e7406633bd75524f8ce
+加判断是否首次弹窗
6 files modified
3 files added
194 ■■■■■ changed files
pages/home/home.vue 57 ●●●●● patch | view | raw | blame | history
static/home/img/laba.png patch | view | raw | blame | history
static/home/img/laba2.png patch | view | raw | blame | history
static/home/img/paper.jpg patch | view | raw | blame | history
static/style/app.scss 113 ●●●●● patch | view | raw | blame | history
store/actions.js 12 ●●●● patch | view | raw | blame | history
store/mutations.js 2 ●●●●● patch | view | raw | blame | history
store/state.js 1 ●●●● patch | view | raw | blame | history
store/websocket.js 9 ●●●● patch | view | raw | blame | history
pages/home/home.vue
@@ -1,6 +1,24 @@
<template>
    <view class="container">
        <!-- 头部 start -->
        <!-- <view> -->
        <u-popup v-model="showOnceLogin" mode="center" :closeable="true" :custom-style="OnceLoginStyle"
            class="OnceLoginStyles">
                <img class="imgs1" src="../../static/home/img/laba2.png" mode=""></img>
                <view class="onceBody">
                    <view class="names">
                        管理员{{$store.state.puserName}}:
                    </view>
                    <view class="texts">
                        恭喜您加入洪城义警,
                        我们期待与您共建平安家园,
                        即日起您可参与治安防范巡查等任务,获得积分
                    </view>
                </view>
                <!-- <button type="default" class="buts">点击进入</button> -->
        </u-popup>
        <u-button @click="showOnceLogin = true">打开</u-button>
        <!-- </view> -->
        <view class="head">
            <u-navbar :is-fixed="false" :border-bottom="false" :is-back="false" title=""
                :background="{ background: '#103289' }">
@@ -119,6 +137,7 @@
        <u-toast ref="uToast" />
        <!-- 底部导航条 -->
        <u-tabbar :list="tabbar" :mid-button="false" height="50px" icon-size="40"></u-tabbar>
    </view>
</template>
@@ -150,7 +169,14 @@
                tabbar: this.$store.state.tabbar,
                gdlist: [
                    '南昌一波重磅“官宣”!来了!'
                ]
                ],
                showOnceLogin: true, //首次进入显示祝贺信
                OnceLoginStyle: {
                    // width: '60%',
                    // height: '50%',
                    // backgroundColor: '#fff',
                    // margin: 'auto'
                }
            };
        },
        onShow() {
@@ -181,6 +207,8 @@
            });
            //获取新闻信息
            this.getArtcilePageList();
            //读取是否是第一次进入
        },
        onReachBottom() {
            if (this.status == 'nomore') return;
@@ -189,6 +217,33 @@
                this.getArtcilePageList();
            }, 2000);
        },
        computed: {
            firstlogin() {
                return this.$store.state.firstlogin;
            }
        },
        watch: {
            firstlogin: {
                handler(newVal, oldVal) {
                    if (this.$store.state.firstlogin == '1' || this.$store.state.firstlogin == 1) {
                        this.showOnceLogin = true;
                    }
                },
                immediate: true
            },
            showOnceLogin() {
                if (!this.showOnceLogin) {
                    console.log("窗口已关闭")
                    uni.request({
                        url: this.$store.state.piAPI + '/blade-user/firstLogin?id=' + this.$store.state.puserID,
                        method: 'GET',
                        success: (res) => {
                            // console.log(res)
                        }
                    });
                }
            }
        },
        methods: {
            //温馨提示跳转页面
            wxtsGo(){
static/home/img/laba.png
static/home/img/laba2.png
static/home/img/paper.jpg
static/style/app.scss
@@ -125,3 +125,116 @@
        
    }
        
        // .OnceLoginStyles {
        //     .u-mode-center-box{
        //         background-color: transparent !important;
        //         width: 80% !important;
        //         height: 50% !important;
        //         .backimgs{
        //             background-image: url('/static/home/img/paper.jpg');
        //             width: 100% !important;
        //             height: 300px !important;
        //             border-radius: 100px 100px 0 0;
        //         }
        //         .onceHead{
        //             height: 50% !important;
        //             width: 100% !important;
        //             border-radius: 100px;
        //         }
        //         .onceBody{
        //             display: flex !important;
        //                     align-items: center !important;
        //                     justify-content: center !important;
        //                     flex-direction: column;
        //             height:50% !important;
        //             width: 100% !important;
        //             position: relative;
        //             top: -25%;
        //             .names{
        //                 font-size: 1.4rem;
        //                 font-weight: 500;
        //             }
        //             .texts{
        //                 font-size: 1.4rem;
        //                 text-indent: 2rem;
        //                 line-height: 2rem;
        //             }
        //         }
        //     }
        // }
        .OnceLoginStyles {
            .u-mode-center-box{
                // background-color: transparent !important;
                background-color: #fff !important;
                width: 80% !important;
                height: auto !important;
                border-radius: 20px;
                // .backimgs{
                // background-image: url('/static/home/img/paper.jpg');
                // padding: 20px;
                //     width: 100% !important;
                //     height: 300px !important;
                //     border-radius: 100px 100px 0 0;
                // }
                position: relative;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                $iconsize:30px;
                // &::after{
                //     content: "";
                //     // background-color: red;
                //     width: $iconsize;
                //     height: $iconsize;
                //     position: absolute;
                //     top: -$iconsize;
                //     left: -$iconsize;
                // }
                .imgs1{
                    width: $iconsize !important;
                    height: $iconsize !important;
                    position: absolute;
                    top: 0px;
                    left: 5px;
                }
                // .onceHead{
                //     width: 30px !important;
                //     height: 30px !important;
                //     background-color: red !important;
                //     top: -10px !important;
                //     left: -0px !important;
                // }
                .onceBody{
                    margin: 30px 20px 20px 20px;
                    // height:100% !important;
                    // width: 100% !important;
                //     position: relative;
                //     top: -25%;
                $fontsize:1.1rem;
                    .names{
                        font-size: $fontsize;
                        font-weight: 500;
                    }
                    .texts{
                        font-size: $fontsize;
                        text-indent: $fontsize * 2;
                        line-height: 2rem;
                    }
                }
                // .buts{
                //     width: calc(100% + 2px);
                //     position: relative;
                //     left: -1px;
                //     top: 2px;
                //     border-radius: 0 0 20px 20px ;
                //     background-color: #103289 !important;
                //     color: #fff;
                // }
            }
        }
store/actions.js
@@ -63,14 +63,14 @@
                    data.isit = true
                    store.state.roleid = res.data.role_id; //角色id
                    store.state.Jurisdiction = res.data.workjurisdiction; //角色辖区
                    data.userName = res.data.nick_name //警袁姓名
                    data.userID = res.data.user_id //警袁id
                    data.avatar = res.data.avatar //头像
                    data.accounts = data.name
                    data.pass = data.pass
                    data.userName = res.data.nick_name; //警袁姓名
                    data.userID = res.data.user_id; //警袁id
                    data.avatar = res.data.avatar; //头像
                    data.accounts = data.name;
                    data.pass = data.pass;
                    data.firstlogin = res.data.firstlogin;
                    // data.userPhon = res.user_id;
                    store.commit('login', data)
                    wx.request({
                        url: "http://223.82.109.183:2080/api/userVip/getUserVipInfo?idCardNo=" +
                            res
store/mutations.js
@@ -13,6 +13,8 @@
            state.puserName = data.userName;
            state.puserID = data.userID;
            state.avatar = data.avatar;
            state.avatar = data.avatar;
            state.firstlogin = data.firstlogin;
        }
        $store.dispatch("connectws");
        //储存用户
store/state.js
@@ -20,6 +20,7 @@
    // piAPI: 'http://192.168.0.222:83/',
    //piAPI: 'http://223.82.109.183:2082/api/',
    BaopiAPI: 'http://223.82.109.183:2080/api/',
    firstlogin: null,
    puserName: '',
    puserID: '',
    puserIphone: '',
store/websocket.js
@@ -139,7 +139,14 @@
                        }
                    },
                });
            } else if (type === "change") {
                let routes = getCurrentPages(); //获取当前页面栈
                let curRoute = routes[routes.length - 1].route; //获取当前页面的路由
                let d = {
                    serid: uni.getStorageSync("ids") || $store.state.puserID,
                    type: 0,
                    tasktype: route == "grabOrdersZAXC" ? 0 : (route == "grabOrdersZAYWXC" ? 1 : 2)
                };
            }
        },
        //本地建造数据传递