Przeglądaj źródła

wesmiler 更新第5期升级

wesmiler 5 lat temu
rodzic
commit
0e4c37f600

+ 1 - 1
public/themes/default/weixin/match/index.html

@@ -13,7 +13,7 @@
     <div class="followTips" v-if="hasFollow==0">关注拾光公众号,接收微信申请和结果反馈<a @click="showFollow()">立即关注</a><span @click="hasFollow=true">x</span></div>
     <div :class="'box'+(!hasFollow? ' has' : '')">
         <div id="recommends" class="recommend-box">
-            <div class="tips" v-if="tipsArr.length>0" :style="'right: '+tips.left+'%;'">
+            <div class="tips" v-if="tipsArr.length>0" :style="'width:'+(tips.width)+'px;right: '+(tips.left>=0?'auto' : tips.left)+'%;">
                 <a href="/weixin/member/complain"><span v-html="tips.content"></span></a>
             </div>
             <div class="join"><a href="/weixin/activity/book?id=15">我要推荐</a></div>

+ 3 - 3
public/themes/default/weixin/public/assets/css/match.css

@@ -405,9 +405,9 @@ body {
     z-index: 996;
     border-radius: 16px;
     padding: 0px 8px;
-    width: 100%;
+    width: 85%;
     text-align: center;
-    right: -90%;
+    right: -100%;
     height: 30px;
     line-height: 30px;
     overflow: hidden;
@@ -417,7 +417,7 @@ body {
     display: block;
     color: red;
     width: 100%;
-    min-width: 300px;
+    min-width: 200px;
     font-size: 14px;
 }
 

+ 11 - 5
public/themes/default/weixin/public/assets/js/match.js

@@ -67,8 +67,8 @@ var app = new Vue({
         slideIndex: 0,
         tipsArr: [],
         tips: {
-            content: '测试用户1已被举报信息作假,点击查看详情',
-            left: -90,
+            content: '',
+            left: -95,
         },
         tipParams: {
             page: 1,
@@ -178,8 +178,7 @@ var app = new Vue({
             $.post('/api/member/complainList', _this.tipParams, function (res) {
                 if (res.code == 'success'){
                     var dataList = typeof(res.data.data) != 'undefined'? res.data.data : [];
-                    console.log(dataList)
-                    if(res.data.total>0 && _this.tipsArr.length<res.data.total){
+                    if(dataList.length>0 && res.data.total>0 && _this.tipsArr.length<res.data.total){
                         if(dataList.length<_this.tipParams.pageSize){
                             _this.tipsArr = _this.tipsArr.concat(dataList)
                         }else{
@@ -207,6 +206,7 @@ var app = new Vue({
         initTips: function(index){
             var _this = this
             var num = _this.tipsArr.length
+
             if(num>0){
                 var data = typeof(_this.tipsArr[index]) != 'undefined'? _this.tipsArr[index] : {};
                 if(!data){
@@ -215,6 +215,12 @@ var app = new Vue({
 
                 clearInterval(_this.tipsTimerId)
                 _this.tips.content = '提示:用户<em>'+data.user_nickname+'</em>因被举报核实已拉黑,点击查看'
+                var strs = _this.tips.content? _this.tips.content.split('') : [];
+                if(strs.length>9){
+                    _this.tips.width = (strs.length-9)*13
+                }else{
+                    _this.tips.width = 280
+                }
                 _this.tipsTimerId = setInterval(function(){
                    if(_this.tips.left>=100){
                        _this.tips.left = -100;
@@ -225,7 +231,7 @@ var app = new Vue({
                    }
 
                     _this.tips.left += 0.25;
-                }, 20);
+                }, 50);
             }
 
         },