123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779 |
- <template>
- <view class="container">
- <view class="head">
- <image class="img" :src="detail.icon" mode="aspectFill"></image>
- <view class="info">
- <view class="title row">
- {{ detail.name || '' }}
- </view>
- <view class="row">
- <view class="price">
- ¥{{ detail.price || 0 }}
- <span class="text fontPFR">/张明信片</span>
- </view>
- <image
- @click="$navigateTo('/pages/rule/rule', { type: 1 })"
- class="button"
- :src="'https://file.rongcyl.cn/festatic/bkm/imgv2/invite/button1.png'"
- mode="widthFix"
- ></image>
- </view>
- <view class="row">
- <!-- <view class="users">
- <image class="photo" :style="'left:' + index * 11 + 'px'" :src="'https://file.rongcyl.cn/festatic/bkm/imgv2/Frame1.png'"
- v-for="(item, index) in userList" mode="widthFix"></image>
- </view> -->
- <!-- <view class="hot">
- <image :src="'https://file.rongcyl.cn/festatic/bkm/imgv2' + /first/hot.png" mode="widthFix"></image>
- {{ detail.hotNum }}
- </view> -->
- </view>
- </view>
- </view>
- <div v-if="detail.subType.includes('110')" class="oubox flex justify-around items-center">
- <div class="flex items-center" @click="showList">
- <img src="https://file.rongcyl.cn/festatic/bkm/ouking_a.png" class="w-10 h-10" />
- <div class="ml-1">
- <div class="fontPFSCS" style="font-size: 30rpx">欧王奖励</div>
- <div style="font-size: 24rpx">{{ ouCount }}届欧王</div>
- </div>
- </div>
- <div class="flex items-center">
- <img
- src="https://file.rongcyl.cn/festatic/bkm/x_a.png"
- class="w-10 h-10"
- v-if="detail.subType.includes('111')"
- />
- <img src="https://file.rongcyl.cn/festatic/bkm/x.png" class="w-10 h-10" v-else />
- <div class="ml-1" :style="{ color: detail.subType.includes('111') ? '' : '#a9bcd1' }">
- <div class="fontPFSCS" style="font-size: 30rpx">随机掉落</div>
- <div style="font-size: 24rpx">
- {{ detail.subType.includes('111') ? '已开启' : '未开启' }}
- </div>
- </div>
- </div>
- <div class="flex items-center">
- <img
- src="https://file.rongcyl.cn/festatic/bkm/free_a.png"
- class="w-10 h-10"
- v-if="detail.subType.includes('112')"
- />
- <img src="https://file.rongcyl.cn/festatic/bkm/free.png" class="w-10 h-10" v-else />
- <div class="ml-1" :style="{ color: detail.subType.includes('112') ? '' : '#a9bcd1' }">
- <div class="fontPFSCS" style="font-size: 30rpx">随机免单</div>
- <div style="font-size: 24rpx">
- {{ detail.subType.includes('112') ? '已开启' : '未开启' }}
- </div>
- </div>
- </div>
- </div>
- <view class="box" v-if="detail.subType && !detail.subType.includes('110')">
- <view class="boxContent">
- <view class="boxLeft">
- <view class="row1">
- <view class="text">连击 × {{ combos || 0 }}</view>
- <view class="text">
- {{ combos || 0 }}
- <span class="text1">/300</span>
- </view>
- </view>
- <view class="row2">
- <view class="row2content">
- <p>每连击300发未出传说赏,可获得一个宝箱。</p>
- <p>如果中间抽出传说赏,则清空连击次数。</p>
- </view>
- </view>
- </view>
- <view class="boxRiaht">
- <image
- class="icon"
- :src="'https://file.rongcyl.cn/festatic/bkm/imgv2/drawCard_infinite/icon1.png'"
- mode="widthFix"
- ></image>
- </view>
- </view>
- </view>
- <view class="buttons1">
- <image
- class="button"
- @click="tabClick(1)"
- style="margin-right: 40rpx"
- :src="'https://file.rongcyl.cn/festatic/bkm/imgv2' + `/drawCard_infinite/button1${active1 == 1 ? 'A' : ''}.png`"
- mode="widthFix"
- ></image>
- <image
- class="button"
- @click="tabClick(2)"
- :src="'https://file.rongcyl.cn/festatic/bkm/imgv2' + `/drawCard_infinite/button2${active1 == 2 ? 'A' : ''}.png`"
- mode="widthFix"
- ></image>
- </view>
- <view class="prizeList" v-if="active1 == 1">
- <view class="prizeRow" v-for="(item, index) in prizeList">
- <image
- class="bk"
- :src="'https://file.rongcyl.cn/festatic/bkm/imgv2/drawCard_infinite/bk.png'"
- mode="scaleToFill"
- ></image>
- <view class="prizeRowContent">
- <view class="prizesTitle">
- <span>
- <span style="font-size: 36rpx; margin-right: 10rpx; font-weight: 600">
- {{ $selectDictLabel(rewardType, item.type) }}
- </span>
- <span style="font-weight: 600">概率 {{ item.probability }}%</span>
- </span>
- <span class="sp">各类别赏中赏概率不代表具体产品中赏概率</span>
- </view>
- <view class="prizesItems">
- <view class="prize" v-for="(item2, index2) in item.prizeList" @click="showImg(item2)">
- <view class="kaImg">
- <image
- class="kabk"
- :src="'https://file.rongcyl.cn/festatic/bkm/imgv2/drawCard_infinite/kaBk.png'"
- mode="widthFix"
- ></image>
- <image class="img" :src="item2.icon" mode="aspectFit"></image>
- </view>
- <view class="kaName">
- {{ item2.name }}
- </view>
- <view class="price">
- <span class="priceText">¥{{ detail.price }}</span>
- 参考价
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="winningRecord" v-if="active1 == 2">
- <view class="card" v-for="(item, index) in winningRecordList" :key="index">
- <view class="row">
- <view class="left">
- <image class="photo" :src="item.userAvtar" mode="aspectFill"></image>
- <span class="name">{{ item.userName }}</span>
- </view>
- <view class="right text1">
- <span style="margin-right: 10rpx">{{ item.creatTime }}</span>
- <span>No.{{ item.id }}</span>
- </view>
- </view>
- <view class="row" style="margin-top: 20rpx">
- <view class="left">
- <image class="img" :src="item.prizeIcon" mode="aspectFill"></image>
- <span class="name">{{ item.prizeName }}</span>
- </view>
- <view class="right" style="font-size: 28rpx">{{ $selectDictLabel(rewardType, item.prizeType) }} × 1</view>
- </view>
- </view>
- <div class="text-center" v-if="winningRecordList.length == 0">
- <image
- style="width: 80vw; margin: auto; margin-top: -80rpx"
- :src="'https://file.rongcyl.cn/festatic/bkm/imgv2/noData.png'"
- mode="widthFix"
- ></image>
- <view class="text-center" style="margin-top: -60rpx; color: #999999">啊哦,没有任何内容</view>
- </div>
- </view>
- <view class="buttons2">
- <img
- @click="submit(1)"
- src="https://file.rongcyl.cn/festatic/bkm/1fuck.png"
- style="width: 116rpx; height: 116rpx"
- />
- <img
- @click="submit(3)"
- src="https://file.rongcyl.cn/festatic/bkm/3fuck.png"
- style="width: 116rpx; height: 116rpx"
- />
- <img
- @click="submit(5)"
- src="https://file.rongcyl.cn/festatic/bkm/5fuck.png"
- style="width: 116rpx; height: 116rpx"
- />
- <img
- @click="submit(10)"
- src="https://file.rongcyl.cn/festatic/bkm/10fuck.png"
- style="width: 116rpx; height: 116rpx"
- />
- </view>
- <paymentPopup ref="paymentPopup" @callBack="paymentSuccess" />
- <uni-popup ref="popup">
- <view class="popup-content oulist">
- <img src="https://file.rongcyl.cn/festatic/bkm/oulist.png" class="w-full h-full" />
- <div class="absolute left-0 right-0 bottom-0 overflow-scroll py-2" style="height: 540rpx">
- <div v-for="(ou, i) in ouList" :key="i" class="flex justify-between items-center px-2 py-2">
- <div class="flex mr-2">
- <img
- :src="`https://file.rongcyl.cn/festatic/bkm/${i + 1}.png`"
- v-if="i < 3"
- class="inline-block mt-1"
- style="width: 56rpx; height: 56rpx"
- />
- <span
- v-else
- class="bold inline-block mt-1"
- style="width: 56rpx; height: 56rpx; text-align: center; line-height: 56rpx"
- >
- {{ i + 1 }}
- </span>
- <img
- :src="ou.userAvtar"
- style="width: 68rpx; height: 68rpx; border-radius: 50%"
- class="inline-block ml-2"
- />
- </div>
- <div class="flex-1">
- <div style="font-size: 28rpx" class="bold">{{ ou.userName }}</div>
- <div style="font-size: 22rpx; color: #666666">
- <span style="margin-right: 36rpx">在线{{ ou.onlineTime }}分钟</span>
- <img src="https://file.rongcyl.cn/festatic/bkm/tri.png" class="w-4 h-4 inline-block relative top-1" />
- <span style="font-size: 24rpx; color: #666666">{{ ou.reward }} 奖励</span>
- </div>
- </div>
- <div>
- <span v-if="ou.status" style="color: #00c537; font-size: 24rpx">在线中</span>
- <span v-else style="font-size: 24rpx; color: #666666">{{ ou.downTime | formatTime }}下线</span>
- </div>
- </div>
- </div>
- </view>
- <div @click="closeList">
- <img
- src="https://file.rongcyl.cn/festatic/bkm/close.png"
- class="w-9 h-9 mt-6"
- style="margin-left: 50%; transform: translateX(-50%); z-index: 9999; position: relative"
- />
- </div>
- </uni-popup>
- <imgPopup ref="imgPopup" />
- <view style="width: 100%; height: 200rpx"></view>
- </view>
- </template>
- <script>
- import noData from '@/component/noData.vue'
- import { rewardType } from '@/utils/commonConfig.js'
- import { raffleDetailApi, prizeListApi, prizeUserListApi, combosApi, getOuCount, getOuList } from '@/api/drawCard.js'
- import { cardType, formatSeconds } from '@/utils/utils.js'
- import paymentPopup from '@/component/paymentPopup.vue'
- import imgPopup from '@/component/imgPopup.vue'
- export default {
- components: {
- paymentPopup,
- noData,
- imgPopup,
- },
- onLoad(query) {
- console.log(query, 'query')
- if (query.id) {
- this.raffleId = query.id
- this.init()
- }
- },
- data() {
- return {
- rewardType: rewardType,
- active1: 1,
- detail: {},
- raffleId: null,
- prizeList: [],
- userIds: [],
- prizeUserList: [],
- winningRecordList: [],
- combos: 0,
- ouCount: 0,
- ouList: [],
- }
- },
- filters: {
- formatTime(dateString) {
- let month = dateString.substring(5, 7)
- let day = dateString.substring(8, 10)
- let time = dateString.substring(11, 16)
- return month + '/' + day + ' ' + time
- },
- },
- methods: {
- showImg(value) {
- this.$refs.imgPopup.show(value)
- },
- showList() {
- this.getOuKingList()
- this.$refs.popup.open('center')
- },
- closeList() {
- this.$refs.popup.close()
- },
- subType(value) {
- let index = null
- if (value == 120) {
- index = 1
- } else if (value == 110) {
- index = 2
- } else if (value == 111) {
- index = 3
- } else if (value == 112) {
- index = 4
- }
- return index
- },
- init() {
- // 获取卡包详情
- this.getDetail()
- this.tabClick(1)
- // 判断是否登录
- let hasLogin = getApp().globalData.hasLogin
- if (hasLogin) {
- this.getCombos()
- }
- },
- // 支付成功后回调
- paymentSuccess() {
- this.init()
- },
- clickDrawCard() {
- this.$refs.paymentPopup.show(this.raffleId, this.selectIndex, this.detail)
- },
- tabClick(index) {
- this.active1 = index
- if (index == 1) {
- //获取奖池
- this.getPrizeList()
- } else if (index == 2) {
- // 获取中奖记录
- this.getPrizeUserList()
- }
- },
- getOuKingList() {
- getOuList({
- raffleId: this.raffleId,
- page: 1,
- limit: 1000,
- }).then(rs => {
- this.ouList = rs.data
- })
- },
- getDetail() {
- let params = {
- raffleId: this.raffleId,
- }
- raffleDetailApi(params).then(res => {
- console.log(res, '详情')
- this.detail = res.data
- if (res.data.subType.includes('110')) {
- getOuCount(params).then(rs => {
- this.ouCount = rs.data
- })
- }
- })
- this.getOuKingList()
- },
- getPrizeList() {
- let params = {
- raffleId: this.raffleId,
- }
- prizeListApi(params).then(res => {
- console.log(res, '奖池预览')
- let newArray = res.data
- for (var i = 0; i < res.data.length; i++) {
- if (res.data[i].type == 23) {
- newArray = []
- newArray.push(res.data[i])
- res.data.splice(i, 1)
- newArray.push(...res.data)
- break
- }
- }
- this.prizeList = newArray
- })
- },
- getPrizeUserList() {
- let params = {
- limit: 999,
- page: 1,
- raffleId: this.raffleId,
- }
- prizeUserListApi(params).then(res => {
- this.winningRecordList = res.data
- })
- },
- getCombos() {
- let params = {
- raffleId: this.raffleId,
- }
- combosApi(params).then(res => {
- console.log(res, '连击数')
- this.combos = res.data.combos
- })
- },
- submit(number) {
- let params = {
- raffleId: this.raffleId,
- }
- this.$refs.paymentPopup.show(params, number, this.detail)
- },
- },
- }
- </script>
- <style>
- .container >>> .uni-popup__wrapper.center {
- border-radius: 24rpx !important;
- }
- </style>
- <style scoped lang="scss">
- .oulist {
- width: 660rpx;
- height: 816rpx;
- overflow: hidden;
- position: relative;
- }
- .container {
- background: #9ec8f9;
- padding-top: 30rpx;
- overflow: auto;
- .head {
- background: #fff;
- border: 20rpx;
- padding: 30rpx;
- border-radius: 20rpx 20rpx 0 0;
- display: flex;
- justify-content: space-between;
- margin-bottom: 40rpx;
- .img {
- width: 212rpx;
- height: 212rpx;
- border-radius: 10rpx;
- overflow: hidden;
- margin-right: 20rpx;
- }
- .info {
- display: flex;
- flex-direction: column;
- justify-content: start;
- flex: 1;
- .row {
- margin: 10rpx 0;
- display: flex;
- justify-content: space-between;
- color: #999999;
- .button {
- width: 134rpx;
- }
- .hot {
- display: flex;
- font-size: 24rpx;
- color: #999999;
- image {
- width: 32rpx;
- }
- }
- .users {
- position: relative;
- .photo {
- position: absolute;
- width: 40rpx;
- height: 40rpx;
- border-radius: 50%;
- }
- }
- }
- .title {
- height: 42rpx;
- font-weight: 600;
- color: #000;
- }
- .price {
- font-size: 32rpx;
- font-weight: 600;
- color: #ff2c43;
- .text {
- font-size: 28rpx;
- color: #999999;
- font-weight: 500;
- }
- }
- }
- }
- .oubox {
- width: 95vw;
- height: 148rpx;
- background: rgba(255, 255, 255, 0.85);
- box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(176, 123, 255, 0.3);
- border-radius: 48rpx;
- margin: auto;
- opacity: 1;
- border: 2rpx solid rgba(58, 67, 207, 1);
- }
- .box {
- margin: 0 20rpx 20rpx 20rpx;
- padding: 4rpx;
- background: linear-gradient(90deg, rgba(211, 252, 111, 1), rgba(61, 248, 255, 1));
- box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(176, 123, 255, 0.3);
- border-radius: 48rpx;
- .boxContent {
- background: linear-gradient(90deg, #a4fcff 0%, #d3fc6e 100%);
- border-radius: 48rpx;
- opacity: 1;
- display: flex;
- padding: 16rpx 30rpx;
- .boxLeft {
- position: relative;
- flex: 1;
- .row1 {
- display: flex;
- justify-content: space-between;
- font-size: 36rpx;
- margin-bottom: 8rpx;
- .text {
- color: #000000;
- font-weight: 600;
- text-shadow: -4rpx -2rpx 0rpx rgba(255, 255, 255, 1);
- font-family: auto;
- }
- .text1 {
- text-shadow: none;
- font-weight: 500;
- }
- }
- .row2 {
- position: relative;
- top: 6rpx;
- height: 12vw;
- border-radius: 6vw;
- background: linear-gradient(90deg, #65c3e5 0%, #b1ff29 100%);
- .row2content {
- position: relative;
- top: -6rpx;
- background: #0d2a2c;
- height: 12vw;
- border-radius: 6vw;
- font-size: 20rpx;
- color: rgba(255, 255, 255, 0.9);
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: flex-start;
- padding: 0 26rpx;
- }
- }
- }
- .boxRiaht {
- padding-left: 8vw;
- padding-right: 30rpx;
- display: flex;
- align-items: center;
- .icon {
- width: 12vw;
- height: 12vw;
- }
- }
- }
- }
- .buttons1 {
- display: flex;
- justify-content: center;
- .button {
- width: 38vw;
- height: 10vw;
- }
- }
- .prizeList {
- .prizeRow {
- position: relative;
- margin: 0 20rpx 20rpx 20rpx;
- padding-bottom: 20rpx;
- .bk {
- position: relative;
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0;
- z-index: 1;
- }
- .prizeRowContent {
- position: relative;
- width: calc(100% - 60rpx);
- padding: 20rpx 30rpx;
- z-index: 2;
- .prizesTitle {
- font-size: 24rpx;
- padding-bottom: 10rpx;
- width: 100%;
- color: #fff;
- display: flex;
- justify-content: space-between;
- .sp {
- color: rgba(255, 255, 255, 0.7);
- padding-top: 16rpx;
- font-size: 20rpx;
- }
- }
- .prizesItems {
- background: #fffbe8;
- display: flex;
- width: calc(100% - 32rpx);
- padding: 16rpx;
- border-radius: 16rpx;
- .prize {
- width: 22vw;
- .kaImg {
- position: relative;
- .kabk {
- width: 100%;
- height: 100%;
- }
- .img {
- position: absolute;
- top: 0;
- width: 70%;
- height: 80%;
- left: 52%;
- top: 50%;
- transform: translateX(-50%) translateY(-50%);
- }
- }
- .kaName {
- width: 100%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- font-size: 24rpx;
- font-weight: 600;
- text-align: center;
- }
- .price {
- text-align: center;
- font-size: 20rpx;
- color: #999999;
- .priceText {
- color: #ff2c43;
- font-weight: 600;
- font-size: 24rpx;
- }
- }
- }
- }
- }
- }
- }
- .buttons2 {
- position: fixed;
- bottom: 10vw;
- display: flex;
- z-index: 4;
- justify-content: space-around;
- width: 100%;
- .button {
- width: 13vw;
- height: 13vw;
- font-size: 32rpx;
- color: #fff;
- background: linear-gradient(270deg, #531dbb 0%, #6e2fe5 100%);
- text-align: center;
- line-height: 13vw;
- border-radius: 8rpx;
- box-shadow: inset 0rpx 4rpx 6rpx 0rpx rgba(255, 255, 255, 0.25);
- position: relative;
- transform: rotate(45deg);
- font-weight: 600;
- p {
- transform: rotate(-45deg);
- }
- }
- }
- .winningRecord {
- .card {
- margin: 20rpx 20rpx 0 20rpx;
- border-radius: 16rpx;
- background: #fff;
- padding: 20rpx;
- .row {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .left {
- display: flex;
- align-items: center;
- .photo {
- margin-right: 10rpx;
- width: 60rpx;
- height: 60rpx;
- border-radius: 50%;
- }
- .name {
- font-size: 28rpx;
- font-weight: 600;
- }
- .img {
- width: 80rpx;
- height: 80rpx;
- border-radius: 4rpx;
- margin-right: 10rpx;
- }
- }
- .text1 {
- color: #666666;
- font-size: 24rpx;
- }
- }
- }
- }
- }
- </style>
|