123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341 |
- <template>
- <view class="cu-modal bottom-modal" :class="{ show: visible }">
- <view class="prince-rank-mask" @click="close"></view>
- <view class="cu-dialog wrapper">
- <view class="paddingY25 flex-align-center relative">
- <image
- v-if="tabIndex == 0"
- :src="resource.prince_this_title_active"
- class="title"
- />
- <image
- v-else
- :src="resource.prince_this_title"
- class="title"
- @click="tabIndex = 0"
- />
- <image
- v-if="tabIndex == 1"
- :src="resource.prince_last_title_active"
- class="title marginL40"
- />
- <image
- v-else
- :src="resource.prince_last_title"
- class="title marginL40"
- @click="tabIndex = 1"
- />
- <image :src="resource.icon_x" class="x" @click="close" />
- </view>
- <view v-if="tabIndex == 0" style="height: 348px">
- <scroll-view
- style="height: 300px"
- scroll-y
- v-if="tableData && tableData.length > 0"
- >
- <view
- v-for="(item, index) in tableData"
- :key="index"
- class="cell flex-align"
- style="margin-bottom: 10px"
- >
- <view class="index bold color-white">{{ index + 1 }}</view>
- <image
- v-if="index === 0"
- class="rank_flag translateY"
- :src="resource.prince_rank_1"
- />
- <image
- v-if="index === 1"
- class="rank_flag translateY"
- :src="resource.prince_rank_2"
- />
- <image
- v-if="index === 2"
- class="rank_flag translateY"
- :src="resource.prince_rank_3"
- />
- <image
- :src="item.avatar"
- style="width: 52rpx; height: 52rpx; border-radius: 26rpx"
- />
- <view class="color-white font2 marginL12 flex1">{{ item.nickname }}</view>
- <view class="flex-shrink0 num">{{ item.quantity }}源力值</view>
- </view>
- </scroll-view>
- <empty v-if="!tableData || tableData.length === 0" :top="0" />
- <view v-if="tabIndex == 0 && myData" class="cell my flex-align">
- <image
- v-if="myData.quantity >= luckKing.reachLuckQuantity && myData.index === 0"
- class="rank_flag translateY"
- :src="resource.prince_rank_1"
- />
- <image
- v-else-if="
- myData.quantity >= luckKing.reachLuckQuantity && myData.index === 1
- "
- class="rank_flag translateY"
- :src="resource.prince_rank_2"
- />
- <image
- v-else-if="
- myData.quantity >= luckKing.reachLuckQuantity && myData.index === 2
- "
- class="rank_flag translateY"
- :src="resource.prince_rank_3"
- />
- <view
- v-if="myData.quantity < luckKing.reachLuckQuantity"
- class="index color-white"
- >
- 未在进阶区
- </view>
- <view
- v-else-if="
- myData.quantity >= luckKing.reachLuckQuantity && myData.index < 50
- "
- class="index bold color-white"
- >
- {{ myData.index + 1 }}
- </view>
- <view v-else class="index"></view>
- <image
- :src="myData.avatar"
- style="width: 52rpx; height: 52rpx; border-radius: 26rpx"
- />
- <view class="color-white font2 marginL12 flex1">{{ myData.nickname }}</view>
- <view class="flex-shrink0 num">{{ myData.quantity }}源力值</view>
- </view>
- </view>
- <view v-if="tabIndex == 1" style="height: 348px">
- <view v-if="pre" class="text-center paddingB10 color-white">
- 共瓜分{{ pre.magicQuantity }}源石
- </view>
- <scroll-view
- style="height: 300px"
- scroll-y
- v-if="pre && pre.periodKingList && pre.periodKingList.length > 0"
- >
- <view
- v-for="(item, index) in pre.periodKingList"
- :key="index"
- class="cell flex-align"
- style="margin-bottom: 10px"
- >
- <view class="index bold color-white">{{ index + 1 }}</view>
- <image
- v-if="index === 0"
- class="rank_flag translateY"
- :src="resource.prince_rank_1"
- />
- <image
- v-if="index === 1"
- class="rank_flag translateY"
- :src="resource.prince_rank_2"
- />
- <image
- v-if="index === 2"
- class="rank_flag translateY"
- :src="resource.prince_rank_3"
- />
- <image
- :src="item.avatar"
- style="width: 52rpx; height: 52rpx; border-radius: 26rpx"
- />
- <view class="color-white font2 marginL12 flex1">{{ item.nickname }}</view>
- <view class="flex-shrink0 num">瓜分{{ item.magicQuantity }}源石</view>
- </view>
- </scroll-view>
- <empty
- v-if="!pre || !pre.periodKingList || pre.periodKingList.length === 0"
- :top="0"
- />
- </view>
- </view>
- </view>
- </template>
- <script>
- import pageMixin from '@/mixin/page'
- import resource from '@/utils/resource'
- import empty from '@/components/empty'
- export default {
- // mixins: [pageMixin],
- components: { empty },
- props: {
- poolId: Number,
- luckKing: Object
- },
- data() {
- return {
- tabIndex: 0,
- tableData: null,
- pre: null,
- resource,
- visible: false,
- refreshing: false,
- myData: null
- }
- },
- methods: {
- show() {
- this.$parent.$parent.$parent.lock = true
- this.visible = true
- this.refresh()
- },
- close() {
- this.$parent.$parent.$parent.lock = false
- this.visible = false
- this.tableData = null
- this.myData = null
- this.pre = null
- },
- refresh() {
- this.loadData()
- this.getPre()
- },
- async getPre() {
- const res = await this.$service.award.preKing(this.poolId)
- this.pre = res
- },
- async loadData(loading = false) {
- const res = await this.$service.award.kingUser(this.poolId, loading)
- if (res) {
- this.tableData = res.periodKingList
- if (res.myPeriodKing) {
- let my = res.myPeriodKing
- let flag = 50
- for (let i = 0; i < this.tableData.length; i++) {
- if (my.userId === this.tableData[i].userId) {
- flag = i
- break
- }
- }
- my.index = flag
- this.myData = my
- }
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .prince-rank-mask {
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- }
- .wrapper {
- padding: 0 28rpx 64rpx;
- background: #171b1e;
- border-radius: 15px 15px 2px 2px;
- .title {
- width: 176rpx;
- height: 28rpx;
- }
- .x {
- position: absolute;
- right: 28rpx;
- top: 50%;
- margin-top: -16rpx;
- width: 32rpx;
- height: 32rpx;
- }
- .cell {
- position: relative;
- height: 48px;
- background: rgba(34, 35, 53, 0.6);
- border-radius: 4px;
- border: 1px solid rgba(255, 255, 255, 0.1);
- padding-left: 13px;
- padding-right: 48px;
- .index {
- width: 82px;
- }
- .num {
- color: #44e5e3;
- font-size: 12px;
- }
- &.my {
- background: rgba(91, 92, 116, 0.6);
- border: 1px solid rgba(255, 255, 255, 0.1);
- }
- .rank_flag {
- width: 21px;
- height: 20px;
- position: absolute;
- left: 35px;
- }
- }
- .user-wrapper {
- width: 280rpx;
- height: 324rpx;
- position: relative;
- margin-top: -10px;
- .bg-user {
- position: absolute;
- width: 280rpx;
- height: 324rpx;
- left: 0;
- top: 0;
- }
- .tx {
- border: 1px solid #00a2e7;
- width: 60px;
- height: 60px;
- border-radius: 30px;
- }
- .bg-text-wrapper {
- width: 164rpx;
- height: 50rpx;
- position: relative;
- margin-top: 10px;
- .bg-text {
- position: absolute;
- left: 0;
- top: 0;
- width: 164rpx;
- height: 50rpx;
- }
- }
- }
- .item {
- width: 200rpx;
- height: 238rpx;
- position: relative;
- border-radius: 8rpx;
- overflow: hidden;
- .goods-wrapper {
- position: absolute;
- right: 0;
- top: 0;
- width: 100%;
- height: 100%;
- }
- .image {
- width: 200rpx;
- height: 238rpx;
- }
- }
- }
- </style>
|