暂无菜单项

【7B2主题美化】签到弹窗

发布于 更新于
29,532

截图

1、主题文件夹中的 /b2/Modules/Templates/Footer.php文件里面的304行下面插入html

[content_hide]

            <!--弹窗-->
            <div id="xutianPopup" v-show="Popup" v-cloak>
                <div class="Modal-wrapper undefined Modal-enter-done">
                    <div class="Modal-backdrop"></div>
                    <div class="Modal Modal--large CreatorVideoSupportModal" tabindex="0">
                        <div class="Modal-inner">
                            <div class="Modal-content">
                                <div class="CreatorVideoSupportModal-content">
                                    <div class="CreatorVideoSupportModal-decorateTitle">
                                        <span class="CreatorVideoSupportModal-decorateTitleArrowLeft"></span>
                                        <span class="CreatorVideoSupportModal-decorateTitleText"></span>
                                        <span class="CreatorVideoSupportModal-decorateTitleArrowRight"></span>
                                    </div>
                                    <div class="CreatorVideoSupportModal-image">
                                        <div class="background"></div>
                                        <div class="CreatorVideoSupportModal-liukanshanImage"></div>
                                        <div class="CreatorVideoSupportModal-title" v-text="title">权益已成功开启</div>
                                        <div class="CreatorVideoSupportModal-text" v-text="content">希望新权益能为你带来更多收获,也期待你创作更多优质内容。</div>
                                    </div>
                                </div>
                                <div class="CreatorVideoSupportModal-confirm">
                                    <button @click="close()">确认</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>'

2、主题文件b2/Assets/fontend/main.js文件中最下方插入js


var xutianPopup = new Vue({
    el:'#xutianPopup',
    data:{
        Popup:false,
        title:'',
        content:''
    },
    methods:{
        close(){
            if(this.Popup == true){
                this.Popup = false
            }else{
                this.Popup = true
            }
        },
    }
})

3、css放入父主题或者子主题的style.css文件中

.Modal-wrapper {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 203;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-transition: opacity 0.3s ease-out;
  transition: opacity 0.3s ease-out;
}

.Modal-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  background-color: rgba(18, 18, 18, 0.65);
  -webkit-transition: background-color 0.3s ease-out;
  transition: background-color 0.3s ease-out;
}

.CreatorVideoSupportModal {
  width: 400px;
}
.Modal--large {
  width: 536px;
}
.Modal {
    position: relative;
    z-index: 1;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    width: 400px;
    max-height: calc(100vh - 48px);
    margin-right: auto;
    margin-left: auto;
    -webkit-box-shadow: 0 5px 20px rgba(18, 18, 18, 0.1);
    box-shadow: 0 5px 20px rgba(18, 18, 18, 0.1);
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-transition: max-height 0.8s ease;
    transition: max-height 0.8s ease;
    -webkit-animation: xutian-show 2s ease-in-out 0s 1 normal forwards;
}

.Modal-inner {
  overflow: auto;
  background: #fff;
  border-radius: 2px;
  border-radius: 10px;
}

.CreatorVideoSupportModal .Modal-content {
  margin-top: 0;
  padding: 0 0 24px;
}
.Modal-content {
  -webkit-box-flex: 1;
  -ms-flex: 1 1;
  flex: 1 1;
  padding: 0 24px 32px;
  margin-top: 24px;
  line-height: 1.7;
  opacity: 1;
}

.CreatorVideoSupportModal-content,
.CreatorVideoSupportModal-decorateTitle {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}
.CreatorVideoSupportModal-content {
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
}

.CreatorVideoSupportModal-decorateTitle {
  color: #fff;
  font-size: 24px;
  height: 33px;
  position: absolute;
  top: -24px;
  -webkit-transform: translateY(-100%);
  transform: translateY(-100%);
  font-weight: 600;
  font-synthesis: style;
}
.CreatorVideoSupportModal-content,
.CreatorVideoSupportModal-decorateTitle {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

.CreatorVideoSupportModal-decorateTitle img {
  height: 7px;
  width: 44px;
}

.CreatorVideoSupportModal-confirm{
    display:flex;
    justify-content:center;
}

.CreatorVideoSupportModal-decorateTitleArrowLeft{
    background-image: url(//mo.ecyxq.com/wp-content/uploads/2023/06/2023063014321419.png);
    height: 7px;
    width: 44px;
    background-size: contain;
    
}

.CreatorVideoSupportModal-decorateTitleArrowRight{
    background-image: url(//mo.ecyxq.com/wp-content/uploads/2023/06/2023063014321419.png);
    height: 7px;
    width: 44px;
    background-size: contain;
    -webkit-transform: rotate(180deg);
}

.CreatorVideoSupportModal-decorateTitleText {
    height: 25px;
    width: 150px;
    background-repeat: no-repeat;
    background-size: contain;
    display: inline-block;
    background-image: url(//mo.ecyxq.com/wp-content/uploads/2023/06/2023063015593784.png);
    margin-left:20px;
    margin-right: 20px;
}

4、在主题文件b2/Assets/fontend/main.js文件中搜索 mission(){ 替换mission全部

        mission(){
            if(!b2token){
                login.show = true
            }else{
                if(this.data.mission.credit){
                    Qmsg['warning'](b2_global.js_text.global.has_mission,{html:true});
                    xutianPopup.title = '你已签到成功',
                    xutianPopup.content= userTools.role.user_data.name + ',您本次签到获取的积分为' + this.data.mission.credit + '个',
                    xutianPopup.Popup = true
                    return
                }
                if(this.locked == true) return
                this.locked = true
                this.$http.post(b2_rest_url+'userMission').then(res=>{
                    this.$nextTick(()=>{
                        this.data.mission = res.data.mission
                        this.locked = false,
                        xutianPopup.title = '签到成功',
                        xutianPopup.content= userTools.role.user_data.name + ',您本次签到获取的积分为' + this.data.mission.credit + '个',
                        xutianPopup.Popup = true
                    })
                }).catch(err=>{
                    Qmsg['warning'](err.response.data.message,{html:true});
                    this.locked = false
                })
            }
        }

教程到此

[/content_hide]

0 点赞
0 收藏
分享
0 讨论
反馈
0 讨论
热门最新
总结
暂无总结
0 / 600

内容作者

小星
实力担当
银卡会员
近期热门