123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <import src="../../modal/dialogBrainLack.wxml" />
- <import src="../../modal/dialogNoRank.wxml" />
- <image class="head" src="{{banner}}">
- <view class="head-button" bindtap="goToPoster"></view>
- </image>
- <view class="scroll-view-bg">
- <scroll-view scroll-y scroll-with-animation scroll-into-view="{{scrollBottomId}}">
- <view wx:for="{{fragmentsList}}" wx:for-index="i" wx:key=" ">
- <view class="fragment-bg" bindtap="goToPK" id="{{'a' + i}}">
- <image class="fragment-icon" src="{{'../../resource/fragments_list_' + (i > currentFragment ? 'n' : 's') + '_' + i + '.png'}}"></image>
- <view class="fragment-content">
- <view class="fragment-content-top">
- <view class="fragment-content-name">{{fragmentsList[i].name}}</view>
- <image class="fragment-content-icon" src="../../resource/ic_brain_coin.png"></image>
- <view class="fragment-content-consume">{{tools.changeUnits(fragmentsList[i].cellRankCost)}}</view>
- </view>
- <!-- 已完成段位 -->
- <view wx:if="{{i < currentFragment}}" class="fragment-content-bottom">
- <image wx:for="{{tools.starNum(fragmentsList[i].star)}}" wx:key = " " class="fragment-content-star" src="../../resource/fragments_list_star_s.png"></image>
- </view>
- <!-- 当前段位 -->
- <view wx:elif="{{i == currentFragment}}" class="fragment-content-bottom">
- <image wx:if="{{i == allFragmentsNum - 1}}" class="fragment-content-star" src="../../resource/fragments_list_star_s.png"></image>
- <view wx:if="{{i == allFragmentsNum - 1}}" class="fragment-content-fragment-top">* {{currentStarNum}}</view>
- <image wx:for="{{tools.starNum(fragmentsList[i].star)}}" wx:for-index="sn" wx:key = " " class="fragment-content-star" src="{{tools.starImg(currentStarNum, sn)}}"></image>
- </view>
- <!-- 未开启段位 -->
- <view wx:else class="fragment-content-bottom">
- <image wx:if="{{i == allFragmentsNum - 1}}" class="fragment-content-star" src="../../resource/fragments_list_star_s.png"></image>
- <view wx:if="{{i == allFragmentsNum - 1}}" class="fragment-content-fragment-top">* 0</view>
- <image wx:for="{{tools.starNum(fragmentsList[i].star)}}" wx:key = " " class="fragment-content-star-bg" src="../../resource/fragments_list_star_n.png"></image>
- </view>
- </view>
- </view>
- <view wx:if="{{i > currentFragment}}" class="fragment-shade"></view>
- <view class="fragment-interval"></view>
- </view>
- </scroll-view>
- </view>
- <view class="ranking-view">我的世界排名为{{rank}}名</view>
- <view class="bottom-button" bindtap="goToRecord">
- <view class="bottom-button-title">查看脑力排行榜</view>
- <image class="bottom-button-icon" src="../../resource/fragments_arrow.png"></image>
- </view>
- <template is="dialogBrainLack" data="{{...dialogBrainLack}}"/>
- <template is="dialogNoRank" data="{{...dialogRank}}"/>
- <wxs module="tools">
- var starNum = function(n) {
- var arr = []
- for (var i = 0; i < n; i ++) {
- arr += i
- }
- return arr
- }
- var starImg = function(c, n) {
- if (c > n) {
- return "../../resource/fragments_list_star_s.png"
- } else {
- return "../../resource/fragments_list_star_n.png"
- }
- }
- var changeUnits = function(u) {
- if (u >= 10000) {
- return u / 10000 + "亿"
- } else {
- return u + "万"
- }
- }
- module.exports.starNum = starNum
- module.exports.starImg = starImg
- module.exports.changeUnits = changeUnits
- </wxs>
|