|  | @@ -1,37 +1,65 @@
 | 
											
												
													
														|  |  <template name="ranking">
 |  |  <template name="ranking">
 | 
											
												
													
														|  | -	<view class="container">
 |  | 
 | 
											
												
													
														|  | -	  <view class="description" wx:if="{{active.status == 1}}">
 |  | 
 | 
											
												
													
														|  | -	    <rich-text class="p" :nodes="fetch.info.buy_content"></rich-text>
 |  | 
 | 
											
												
													
														|  | -	  </view>
 |  | 
 | 
											
												
													
														|  | -	  <view class="score-cont" >
 |  | 
 | 
											
												
													
														|  | -	    <view class="tip {{active.status == 1?"":"noborder"}}">
 |  | 
 | 
											
												
													
														|  | -	      <text class="ico-refresh"></text>本排行榜每10分钟刷新一次
 |  | 
 | 
											
												
													
														|  | -	    </view>
 |  | 
 | 
											
												
													
														|  | -	    <view class="top3" wx:if="{{top.length>2}}">
 |  | 
 | 
											
												
													
														|  | -	      <view>
 |  | 
 | 
											
												
													
														|  | -	        <view class="no2">
 |  | 
 | 
											
												
													
														|  | -	          <view class="avatar-wrap"><image src="{{top[1].avatar||"http://7.jstyle.cn/1/2019/03/04/6a61895768f1ece65734553a69a29457.png"}}"></image></view>
 |  | 
 | 
											
												
													
														|  | -	          <view class="name">{{top[1].username||""}}<text>{{top[1].score?top[1].score+"分":top[1].num+"本"}}</text></view>
 |  | 
 | 
											
												
													
														|  | -	        </view>
 |  | 
 | 
											
												
													
														|  | -	        <view class="no1">
 |  | 
 | 
											
												
													
														|  | -	          <view class="avatar-wrap"><image src="{{top[0].avatar||"http://7.jstyle.cn/1/2019/03/04/6a61895768f1ece65734553a69a29457.png"}}"></image></view>
 |  | 
 | 
											
												
													
														|  | -	          <view class="name">{{top[0].username||""}}<text>{{top[0].score?top[0].score+"分":top[0].num+"本"}}</text></view>
 |  | 
 | 
											
												
													
														|  | -	        </view>
 |  | 
 | 
											
												
													
														|  | -	        <view class="no3">
 |  | 
 | 
											
												
													
														|  | -	          <view class="avatar-wrap"><image src="{{top[2].avatar||"http://7.jstyle.cn/1/2019/03/04/6a61895768f1ece65734553a69a29457.png"}}"></image></view>
 |  | 
 | 
											
												
													
														|  | -	          <view class="name">{{top[2].username||""}}<text>{{top[2].score?top[2].score+"分":top[2].num+"本"}}</text></view>
 |  | 
 | 
											
												
													
														|  | -	        </view>
 |  | 
 | 
											
												
													
														|  | -	      </view>
 |  | 
 | 
											
												
													
														|  | -	    </view>
 |  | 
 | 
											
												
													
														|  | -	    <view class="scorelist" wx:if="{{top.length>2}}">
 |  | 
 | 
											
												
													
														|  | -	      <view class="scoreitem" wx:for="{{top}}" wx:if="{{index>2}}">
 |  | 
 | 
											
												
													
														|  | -	        <view class="avatar"><text class="order-num">{{index<3?"":(index+1)}}</text><image src="{{item.avatar||"http://7.jstyle.cn/1/2019/03/04/6a61895768f1ece65734553a69a29457.png"}}"></image><text class="name">{{item.username||""}}</text></view>
 |  | 
 | 
											
												
													
														|  | -	        <view class="score">{{item.score?item.score+"分":item.num+"本"}}</view>
 |  | 
 | 
											
												
													
														|  | -	      </view> 
 |  | 
 | 
											
												
													
														|  | -	
 |  | 
 | 
											
												
													
														|  | -	        <view class="loading" style="display:{{loading?"block":"none"}};"><text>加载中</text></view>
 |  | 
 | 
											
												
													
														|  | -	    </view>
 |  | 
 | 
											
												
													
														|  | -	  </view>
 |  | 
 | 
											
												
													
														|  | 
 |  | +	<view class="container" :class="show ?'slidein':''" @touchstart="Dever.slide" @touchend="end">
 | 
											
												
													
														|  | 
 |  | +		<scroll-view scroll-x class="bg-white nav">
 | 
											
												
													
														|  | 
 |  | +			<view class="flex text-center">
 | 
											
												
													
														|  | 
 |  | +				<view class="cu-item flex-sub" :class="k == index?'text-orange cur':''" v-for="(v, k) in fetch.ranking" :key="k" @click="select(k)">
 | 
											
												
													
														|  | 
 |  | +					{{v.name}}
 | 
											
												
													
														|  | 
 |  | +				</view>
 | 
											
												
													
														|  | 
 |  | +			</view>
 | 
											
												
													
														|  | 
 |  | +		</scroll-view>
 | 
											
												
													
														|  | 
 |  | +		<scroll-view scroll-y class="container_content">
 | 
											
												
													
														|  | 
 |  | +			<view class="description" v-if="fetch.ranking.length > 0">
 | 
											
												
													
														|  | 
 |  | +				<rich-text class="p" :nodes="fetch.ranking[index].desc"></rich-text>
 | 
											
												
													
														|  | 
 |  | +			</view>
 | 
											
												
													
														|  | 
 |  | +			<view class="score-cont" >
 | 
											
												
													
														|  | 
 |  | +				<view class="tip noborder">
 | 
											
												
													
														|  | 
 |  | +					<text class="ico-refresh"></text>
 | 
											
												
													
														|  | 
 |  | +					<picker @change="change" :value="periods_index" :range="ranking_periods">
 | 
											
												
													
														|  | 
 |  | +						<view class="picker">
 | 
											
												
													
														|  | 
 |  | +							左滑关闭,当前是{{periods_index>=0?ranking_periods[periods_index]:'左滑关闭,点此查看往期'}}
 | 
											
												
													
														|  | 
 |  | +						</view>
 | 
											
												
													
														|  | 
 |  | +					</picker>
 | 
											
												
													
														|  | 
 |  | +				</view>
 | 
											
												
													
														|  | 
 |  | +				<view class="top3" v-if="fetch.ranking_data.length > 2">
 | 
											
												
													
														|  | 
 |  | +					<view>
 | 
											
												
													
														|  | 
 |  | +						<view class="no2">
 | 
											
												
													
														|  | 
 |  | +							<view class="avatar-wrap">
 | 
											
												
													
														|  | 
 |  | +								<image :src="fetch.ranking_data[1].user.avatar"></image>
 | 
											
												
													
														|  | 
 |  | +							</view>
 | 
											
												
													
														|  | 
 |  | +							<view class="name">{{fetch.ranking_data[1].user.username}}
 | 
											
												
													
														|  | 
 |  | +								<text>{{fetch.ranking_data[1].num}}{{fetch.ranking[index].unit}}</text>
 | 
											
												
													
														|  | 
 |  | +							</view>
 | 
											
												
													
														|  | 
 |  | +						</view>
 | 
											
												
													
														|  | 
 |  | +						<view class="no1">
 | 
											
												
													
														|  | 
 |  | +							<view class="avatar-wrap">
 | 
											
												
													
														|  | 
 |  | +								<image :src="fetch.ranking_data[0].user.avatar"></image>
 | 
											
												
													
														|  | 
 |  | +							</view>
 | 
											
												
													
														|  | 
 |  | +							<view class="name">{{fetch.ranking_data[0].user.username}}
 | 
											
												
													
														|  | 
 |  | +								<text>{{fetch.ranking_data[0].num}}{{fetch.ranking[index].unit}}</text>
 | 
											
												
													
														|  | 
 |  | +							</view>
 | 
											
												
													
														|  | 
 |  | +						</view>
 | 
											
												
													
														|  | 
 |  | +						<view class="no3">
 | 
											
												
													
														|  | 
 |  | +							<view class="avatar-wrap">
 | 
											
												
													
														|  | 
 |  | +								<image :src="fetch.ranking_data[2].user.avatar"></image>
 | 
											
												
													
														|  | 
 |  | +							</view>
 | 
											
												
													
														|  | 
 |  | +							<view class="name">{{fetch.ranking_data[2].user.username}}
 | 
											
												
													
														|  | 
 |  | +								<text>{{fetch.ranking_data[2].num}}{{fetch.ranking[index].unit}}</text>
 | 
											
												
													
														|  | 
 |  | +							</view>
 | 
											
												
													
														|  | 
 |  | +						</view>
 | 
											
												
													
														|  | 
 |  | +					</view>
 | 
											
												
													
														|  | 
 |  | +				</view>
 | 
											
												
													
														|  | 
 |  | +				<view class="scorelist" v-if="fetch.ranking_data.length > 2">
 | 
											
												
													
														|  | 
 |  | +					<view class="scoreitem" v-for="(v, k) in fetch.ranking_data" :key="k" v-if="k > 2">
 | 
											
												
													
														|  | 
 |  | +						<view class="avatar">
 | 
											
												
													
														|  | 
 |  | +							<text class="order-num">{{k+1}}</text>
 | 
											
												
													
														|  | 
 |  | +							<image :src="v.user.avatar"></image>
 | 
											
												
													
														|  | 
 |  | +							<text class="name">{{v.user.username}}</text>
 | 
											
												
													
														|  | 
 |  | +						</view>
 | 
											
												
													
														|  | 
 |  | +						<view class="score">{{v.num}}{{fetch.ranking[index].unit}}</view>
 | 
											
												
													
														|  | 
 |  | +					</view> 
 | 
											
												
													
														|  | 
 |  | +				</view>
 | 
											
												
													
														|  | 
 |  | +			</view>
 | 
											
												
													
														|  | 
 |  | +		</scroll-view>
 | 
											
												
													
														|  |  	</view>
 |  |  	</view>
 | 
											
												
													
														|  |  </template>
 |  |  </template>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -46,13 +74,14 @@ export default {
 | 
											
												
													
														|  |  	data() {
 |  |  	data() {
 | 
											
												
													
														|  |  		return {
 |  |  		return {
 | 
											
												
													
														|  |  			fetch : {
 |  |  			fetch : {
 | 
											
												
													
														|  | -				buy : [],
 |  | 
 | 
											
												
													
														|  | -				info : {},
 |  | 
 | 
											
												
													
														|  | 
 |  | +				ranking_periods : [],
 | 
											
												
													
														|  | 
 |  | +				ranking_data : [],
 | 
											
												
													
														|  | 
 |  | +				ranking : [],
 | 
											
												
													
														|  |  			},
 |  |  			},
 | 
											
												
													
														|  | 
 |  | +			periods_index : 0,
 | 
											
												
													
														|  |  			index : 0,
 |  |  			index : 0,
 | 
											
												
													
														|  | -			pay : false,
 |  | 
 | 
											
												
													
														|  | -			tip : false,
 |  | 
 | 
											
												
													
														|  |  			show : false,
 |  |  			show : false,
 | 
											
												
													
														|  | 
 |  | +			ranking_periods : [],
 | 
											
												
													
														|  |  		}
 |  |  		}
 | 
											
												
													
														|  |  	},
 |  |  	},
 | 
											
												
													
														|  |  	mounted() {
 |  |  	mounted() {
 | 
											
										
											
												
													
														|  | @@ -61,27 +90,42 @@ export default {
 | 
											
												
													
														|  |  	methods:{
 |  |  	methods:{
 | 
											
												
													
														|  |  		getData : function() {
 |  |  		getData : function() {
 | 
											
												
													
														|  |  			var self = this;
 |  |  			var self = this;
 | 
											
												
													
														|  | -			this.Dever.get(this, 'app/collection/?l=api.getBuy', {id:this.id}, function(t) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +			this.Dever.get(this, 'app/collection/?l=api.getRanking', {id:this.id,noloading:1}, function(t) {
 | 
											
												
													
														|  | 
 |  | +				if (t && t.ranking && t.ranking[self.index]) {
 | 
											
												
													
														|  | 
 |  | +					self.getRankingData(t.ranking[self.index].id, 0);
 | 
											
												
													
														|  | 
 |  | +				}
 | 
											
												
													
														|  | 
 |  | +			});
 | 
											
												
													
														|  | 
 |  | +		},
 | 
											
												
													
														|  | 
 |  | +		getRankingData : function(ranking_id, ranking_periods) {
 | 
											
												
													
														|  | 
 |  | +			var self = this;
 | 
											
												
													
														|  | 
 |  | +			this.fetch.ranking_data = [];
 | 
											
												
													
														|  | 
 |  | +			this.Dever.get(this, 'app/collection/?l=api.getRankingData', {id:this.id,ranking_id:ranking_id,ranking_periods:ranking_periods}, function(t) {
 | 
											
												
													
														|  |  				self.show = true;
 |  |  				self.show = true;
 | 
											
												
													
														|  | 
 |  | +				if (t && t.ranking_periods) {
 | 
											
												
													
														|  | 
 |  | +					for (var i in t.ranking_periods) {
 | 
											
												
													
														|  | 
 |  | +						self.ranking_periods[i] = t.ranking_periods[i].name;
 | 
											
												
													
														|  | 
 |  | +					}
 | 
											
												
													
														|  | 
 |  | +				}
 | 
											
												
													
														|  |  			});
 |  |  			});
 | 
											
												
													
														|  |  		},
 |  |  		},
 | 
											
												
													
														|  | -		//购买
 |  | 
 | 
											
												
													
														|  | -		buy : function(index) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +		select : function(index) {
 | 
											
												
													
														|  |  			this.index = index;
 |  |  			this.index = index;
 | 
											
												
													
														|  | 
 |  | +			this.periods_index = 0;
 | 
											
												
													
														|  | 
 |  | +			this.getRankingData(this.fetch.ranking[this.index].id, 0);
 | 
											
												
													
														|  |  		},
 |  |  		},
 | 
											
												
													
														|  | -		//拉起支付
 |  | 
 | 
											
												
													
														|  | -		buyAct : function() {
 |  | 
 | 
											
												
													
														|  | -			this.Dever.alert('拉起支付');
 |  | 
 | 
											
												
													
														|  | -		},
 |  | 
 | 
											
												
													
														|  | -		showTip : function() {
 |  | 
 | 
											
												
													
														|  | -			this.tip = true;
 |  | 
 | 
											
												
													
														|  | 
 |  | +		hideRanking : function() {
 | 
											
												
													
														|  | 
 |  | +			this.show = false;
 | 
											
												
													
														|  | 
 |  | +			this.$emit('hideRanking');
 | 
											
												
													
														|  |  		},
 |  |  		},
 | 
											
												
													
														|  | -		hideTip : function() {
 |  | 
 | 
											
												
													
														|  | -			this.tip = false;
 |  | 
 | 
											
												
													
														|  | 
 |  | +		end : function(e) {
 | 
											
												
													
														|  | 
 |  | +			var type = this.Dever.slideEnd(e);
 | 
											
												
													
														|  | 
 |  | +			if (type == 3 || type == 4) {
 | 
											
												
													
														|  | 
 |  | +				this.hideRanking();
 | 
											
												
													
														|  | 
 |  | +			}
 | 
											
												
													
														|  |  		},
 |  |  		},
 | 
											
												
													
														|  | -		hideBuy : function() {
 |  | 
 | 
											
												
													
														|  | -			this.show = false;
 |  | 
 | 
											
												
													
														|  | -			this.$emit('hideBuy');
 |  | 
 | 
											
												
													
														|  | 
 |  | +		change : function(e) {
 | 
											
												
													
														|  | 
 |  | +			this.periods_index = e.detail.value;
 | 
											
												
													
														|  | 
 |  | +			this.getRankingData(this.fetch.ranking[this.index].id, this.fetch.ranking_periods[this.periods_index].id);
 | 
											
												
													
														|  |  		}
 |  |  		}
 | 
											
												
													
														|  |  	},
 |  |  	},
 | 
											
												
													
														|  |  	components:{
 |  |  	components:{
 | 
											
										
											
												
													
														|  | @@ -91,12 +135,58 @@ export default {
 | 
											
												
													
														|  |  </script>
 |  |  </script>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  <style>
 |  |  <style>
 | 
											
												
													
														|  | -.container {
 |  | 
 | 
											
												
													
														|  | 
 |  | +.container {
 | 
											
												
													
														|  | 
 |  | +  background: white;
 | 
											
												
													
														|  |    flex: 1;
 |  |    flex: 1;
 | 
											
												
													
														|  |    display: flex;
 |  |    display: flex;
 | 
											
												
													
														|  | -  flex-direction: column;
 |  | 
 | 
											
												
													
														|  | 
 |  | +  flex-direction: column;
 | 
											
												
													
														|  | 
 |  | +  transform: translateY(100%);
 | 
											
												
													
														|  | 
 |  | +  transition-property: transform;
 | 
											
												
													
														|  | 
 |  | +  transition-duration: 0.3s;
 | 
											
												
													
														|  | 
 |  | +  transition-timing-function: ease-in;
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  | 
 |  | +.container.slidein{
 | 
											
												
													
														|  | 
 |  | +  transform: translateY(0);
 | 
											
												
													
														|  | 
 |  | +}
 | 
											
												
													
														|  | 
 |  | +.container_content {
 | 
											
												
													
														|  | 
 |  | +	height: 92%;
 | 
											
												
													
														|  | 
 |  | +}
 | 
											
												
													
														|  | 
 |  | +.btn-wrapper {
 | 
											
												
													
														|  | 
 |  | +  justify-content: space-around;
 | 
											
												
													
														|  | 
 |  | +  width: 100%;
 | 
											
												
													
														|  | 
 |  | +}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +.button {
 | 
											
												
													
														|  | 
 |  | +  height: 80rpx;
 | 
											
												
													
														|  | 
 |  | +  border: 1rpx solid #cc1619;
 | 
											
												
													
														|  | 
 |  | +  color: #cc1619;
 | 
											
												
													
														|  | 
 |  | +  font-size: 30rpx;
 | 
											
												
													
														|  | 
 |  | +  min-width: 300rpx;
 | 
											
												
													
														|  | 
 |  | +  border-radius: 40rpx;
 | 
											
												
													
														|  | 
 |  | +  text-align: center;
 | 
											
												
													
														|  | 
 |  | +  line-height: 80rpx;
 | 
											
												
													
														|  | 
 |  | +  display: block;
 | 
											
												
													
														|  | 
 |  | +  position: relative;
 | 
											
												
													
														|  | 
 |  | +}
 | 
											
												
													
														|  | 
 |  | +.button>button{
 | 
											
												
													
														|  | 
 |  | +  position: absolute;
 | 
											
												
													
														|  | 
 |  | +  width: 100%;
 | 
											
												
													
														|  | 
 |  | +  height: 100%;
 | 
											
												
													
														|  | 
 |  | +  left: 0;
 | 
											
												
													
														|  | 
 |  | +  top: 0;
 | 
											
												
													
														|  | 
 |  | +  opacity: 0;
 | 
											
												
													
														|  | 
 |  | +}
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +.button.primary {
 | 
											
												
													
														|  | 
 |  | +  background-color: #000;
 | 
											
												
													
														|  | 
 |  | +  color: #fff;
 | 
											
												
													
														|  | 
 |  | +}
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +.button.blk {
 | 
											
												
													
														|  | 
 |  | +  background-color: #000;
 | 
											
												
													
														|  | 
 |  | +  color: #fff;
 | 
											
												
													
														|  | 
 |  | +  border-color: #000;
 | 
											
												
													
														|  | 
 |  | +}
 | 
											
												
													
														|  |  .header .tit{
 |  |  .header .tit{
 | 
											
												
													
														|  |    font-size: 30rpx;
 |  |    font-size: 30rpx;
 | 
											
												
													
														|  |    line-height: 36rpx;
 |  |    line-height: 36rpx;
 | 
											
										
											
												
													
														|  | @@ -105,7 +195,8 @@ export default {
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  .description{
 |  |  .description{
 | 
											
												
													
														|  |    width: 710rpx;
 |  |    width: 710rpx;
 | 
											
												
													
														|  | -  margin: 0 auto;
 |  | 
 | 
											
												
													
														|  | 
 |  | +  margin: 0 auto;
 | 
											
												
													
														|  | 
 |  | +  padding-top: 40rpx;
 | 
											
												
													
														|  |    padding-bottom: 40rpx;
 |  |    padding-bottom: 40rpx;
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  .description image{
 |  |  .description image{
 |