bayi před 1 rokem
rodič
revize
d2dfcd0e9f
10 změnil soubory, kde provedl 27 přidání a 3 odebrání
  1. 1 1
      pages/invite/index.js
  2. 3 1
      pages/invite/index.wxml
  3. binární
      static/10q.png
  4. binární
      static/15q.png
  5. binární
      static/2q.png
  6. binární
      static/30q.png
  7. binární
      static/5q.png
  8. binární
      static/60q.png
  9. binární
      static/vipModal.png
  10. 23 1
      utils/filter.wxs

+ 1 - 1
pages/invite/index.js

@@ -281,7 +281,7 @@ Page({
             top: 9676,
             left: 194
         }],
-        count: 0
+        count: 50
     },
 
     async onShow() {

+ 3 - 1
pages/invite/index.wxml

@@ -1,10 +1,12 @@
+<wxs src="../../utils/filter.wxs" module="filters" />
+
 <view class="invite">
     <image src="/static/phb.png" class="ranking" />
     <image src="/static/yqgl.png" class="strategy" />
     <view class="body">
         <view class="pennant" wx:for="{{list}}" wx:key="num" id="p{{item.num}}"
             style="top:{{item.top}}rpx;left:{{item.left}}rpx">
-            <image src="/static/pennant.png" class='icon' />
+            <image src="{{filters.showPennant(count,item.num)}}" class='icon' />
             <view class="num">邀{{item.num}}人</view>
         </view>
         <image wx:for="{{treasureList}}" wx:key='id' src="{{item.close}}"

binární
static/10q.png


binární
static/15q.png


binární
static/2q.png


binární
static/30q.png


binární
static/5q.png


binární
static/60q.png


binární
static/vipModal.png


+ 23 - 1
utils/filter.wxs

@@ -62,9 +62,31 @@ function numFilter(num) {
 function twoDecimal(num) {
     return (num / 100).toFixed(2)
 }
+
+// 切换旗帜图片
+function showPennant(count, num) {
+    if (count >= num) {
+        if (num <= 2) {
+            return '/static/2q.png'
+        } else if (num <= 5) {
+            return '/static/5q.png'
+        } else if (num <= 10) {
+            return '/static/10q.png'
+        } else if (num <= 15) {
+            return '/static/15q.png'
+        } else if (num <= 30) {
+            return '/static/30q.png'
+        } else if (num <= 60) {
+            return '/static/60q.png'
+        }
+    } else {
+        return '/static/pennant.png'
+    }
+}
 module.exports = {
     formatDate: formatDate,
     gradeFilter: gradeFilter,
     numFilter: numFilter,
-    twoDecimal: twoDecimal
+    twoDecimal: twoDecimal,
+    showPennant: showPennant
 }