Merge branch 'ymf' of https://e.coding.net/g-cphe0354/duanju/video_app into test
This commit is contained in:
156
components/pop-ling-qu.vue
Normal file
156
components/pop-ling-qu.vue
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<u-popup v-model="show" mode="center">
|
||||||
|
<view class="bg">
|
||||||
|
<view class="title">恭喜您获得</view>
|
||||||
|
<view class="goods">
|
||||||
|
<template v-if="result&&result.type==3">
|
||||||
|
<view class="u-flex u-col-center u-row-center">
|
||||||
|
<image style="height: 42px;" src="/static/red-pack.png" mode="heightFix"></image>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-row-center">
|
||||||
|
<view class="type">物品</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<template v-if="result&&result.type==2">
|
||||||
|
<view class="u-flex color-money u-col-center u-row-center">
|
||||||
|
<view class="money">{{result.number}}</view>
|
||||||
|
<view class="font-bold" style="margin-top: 20rpx;">元</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-row-center">
|
||||||
|
<view class="type">现金红包</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-row-center btn-box">
|
||||||
|
<view class="btn" @click="lingqu">立即领取</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
show: false,
|
||||||
|
result: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open(data) {
|
||||||
|
console.log(data);
|
||||||
|
this.result = data
|
||||||
|
this.show = true
|
||||||
|
},
|
||||||
|
lingqu() {
|
||||||
|
const {
|
||||||
|
orderId,
|
||||||
|
id
|
||||||
|
} = this.result
|
||||||
|
this.$Request.postJson('app/discSpinning/receive', this.result).then(res => {
|
||||||
|
this.result = ''
|
||||||
|
console.log(res)
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '领取成功',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
this.$emit('success')
|
||||||
|
this.close()
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '领取失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.show = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
::v-deep .u-mode-center-box {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-money {
|
||||||
|
color: #E42F00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.money {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 72rpx;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg {
|
||||||
|
width: 628rpx;
|
||||||
|
height: 770rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
background-color: transparent;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center center;
|
||||||
|
background-size: cover;
|
||||||
|
background-image: url("~static/images/zhuanpan/ling-qu.png");
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
@media (-webkit-min-device-pixel-ratio: 2),
|
||||||
|
(min-device-pixel-ratio: 2) {
|
||||||
|
background-image: url("~static/images/zhuanpan/ling-qu@2x.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
position: absolute;
|
||||||
|
top: 238rpx;
|
||||||
|
text-align: center;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 58rpx;
|
||||||
|
color: #AF6920;
|
||||||
|
letter-spacing: 4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods {
|
||||||
|
position: absolute;
|
||||||
|
top: 326rpx;
|
||||||
|
text-align: center;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.type {
|
||||||
|
padding: 6rpx 28rpx;
|
||||||
|
border-radius: 100rpx;
|
||||||
|
background: #E25B41;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-box {
|
||||||
|
position: absolute;
|
||||||
|
top: 574rpx;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
padding: 10rpx 60rpx 10rpx 64rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 44rpx;
|
||||||
|
color: #AF6920;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="almost-lottery">
|
<view class="almost-lottery min-page">
|
||||||
<!-- head -->
|
<!-- head -->
|
||||||
<view class="almost-lottery__head">
|
<view class="almost-lottery__head">
|
||||||
<view class="btn-group u-flex u-row-between">
|
<view class="btn-group u-flex u-row-between">
|
||||||
@@ -25,14 +25,16 @@
|
|||||||
|
|
||||||
<!-- lottery -->
|
<!-- lottery -->
|
||||||
<view class="almost-lottery__wheel">
|
<view class="almost-lottery__wheel">
|
||||||
|
<view class="almost-lottery__count">
|
||||||
|
<text class="text">剩余免费抽奖 {{ freeNum }} 次</text>
|
||||||
|
</view>
|
||||||
|
<!-- <button @click="showLingPop">showLingPop</button> -->
|
||||||
<almost-lottery :lottery-size="lotteryConfig.lotterySize" :action-size="lotteryConfig.actionSize"
|
<almost-lottery :lottery-size="lotteryConfig.lotterySize" :action-size="lotteryConfig.actionSize"
|
||||||
:ring-count="2" :duration="1" :self-rotaty="false" :img-circled="true" :canvasCached="true"
|
:ring-count="2" :duration="1" :self-rotaty="false" :img-circled="true" :canvasCached="true"
|
||||||
:prize-list="prizeList" :prize-index="prizeIndex" :lotteryBg="lotteryBg" :actionBg="actionBg"
|
:prize-list="prizeList" :prize-index="prizeIndex" :lotteryBg="lotteryBg" :actionBg="actionBg"
|
||||||
@reset-index="prizeIndex = -1" @draw-before="handleDrawBefore" @draw-start="handleDrawStart"
|
@reset-index="prizeIndex = -1" @draw-before="handleDrawBefore" @draw-start="handleDrawStart"
|
||||||
@draw-end="handleDrawEnd" @finish="handleDrawFinish" v-if="prizeList.length" />
|
@draw-end="handleDrawEnd" @finish="handleDrawFinish" v-if="prizeList.length" />
|
||||||
<view class="almost-lottery__count">
|
|
||||||
<text class="text">剩余免费抽奖 {{ freeNum }} 次</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- rule -->
|
<!-- rule -->
|
||||||
<view class="almost-lottery__rule">
|
<view class="almost-lottery__rule">
|
||||||
@@ -74,11 +76,13 @@
|
|||||||
</template> -->
|
</template> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<ling-qu ref="refLingqu" @success="getRedPack"></ling-qu>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AlmostLottery from '@/uni_modules/almost-lottery/components/almost-lottery/almost-lottery.vue'
|
import AlmostLottery from '@/uni_modules/almost-lottery/components/almost-lottery/almost-lottery.vue'
|
||||||
|
import lingQu from '@/components/pop-ling-qu.vue'
|
||||||
import {
|
import {
|
||||||
clearCacheFile,
|
clearCacheFile,
|
||||||
clearStore
|
clearStore
|
||||||
@@ -86,7 +90,7 @@
|
|||||||
export default {
|
export default {
|
||||||
name: 'Home',
|
name: 'Home',
|
||||||
components: {
|
components: {
|
||||||
AlmostLottery
|
AlmostLottery,lingQu
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -311,7 +315,6 @@
|
|||||||
|
|
||||||
// 还有免费数次
|
// 还有免费数次
|
||||||
if (this.freeNum > 0) {
|
if (this.freeNum > 0) {
|
||||||
this.freeNum--
|
|
||||||
flag = true
|
flag = true
|
||||||
} else {
|
} else {
|
||||||
flag = false
|
flag = false
|
||||||
@@ -328,7 +331,6 @@
|
|||||||
console.log('触发抽奖按钮')
|
console.log('触发抽奖按钮')
|
||||||
if (this.prizeing) return
|
if (this.prizeing) return
|
||||||
this.prizeing = true
|
this.prizeing = true
|
||||||
|
|
||||||
this.tryLotteryDraw()
|
this.tryLotteryDraw()
|
||||||
},
|
},
|
||||||
// 尝试发起抽奖
|
// 尝试发起抽奖
|
||||||
@@ -418,9 +420,8 @@
|
|||||||
async remoteGetPrizeIndex() {
|
async remoteGetPrizeIndex() {
|
||||||
this.result=''
|
this.result=''
|
||||||
console.warn('###当前处于模拟的请求接口,并返回了中奖信息###')
|
console.warn('###当前处于模拟的请求接口,并返回了中奖信息###')
|
||||||
const res = await this.$Request.getT('app/discSpinning/draw', {
|
const res = await this.$Request.getT('app/discSpinning/draw')
|
||||||
orderId: this.option.orderId||2145
|
this.freeNum--
|
||||||
})
|
|
||||||
this.getCount()
|
this.getCount()
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if (res.code != 0) {
|
if (res.code != 0) {
|
||||||
@@ -461,6 +462,11 @@
|
|||||||
tipContent = `恭喜您,获得 ${name}${this.result.type==2?(this.result.number+'元'):''} !`
|
tipContent = `恭喜您,获得 ${name}${this.result.type==2?(this.result.number+'元'):''} !`
|
||||||
}
|
}
|
||||||
const _this=this;
|
const _this=this;
|
||||||
|
console.log(this.result);
|
||||||
|
this.showLingPop({...this.result})
|
||||||
|
this.result=''
|
||||||
|
this.prizeing = false
|
||||||
|
return
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
content: tipContent,
|
content: tipContent,
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
@@ -523,6 +529,9 @@
|
|||||||
if(res.code==0){
|
if(res.code==0){
|
||||||
this.freeNum=res.count||0
|
this.freeNum=res.count||0
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
showLingPop(data){
|
||||||
|
this.$refs.refLingqu.open(data)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(opt) {
|
onLoad(opt) {
|
||||||
@@ -598,25 +607,6 @@
|
|||||||
background-image: url("~static/gift.png");
|
background-image: url("~static/gift.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
.gold {
|
|
||||||
width: 44rpx;
|
|
||||||
height: 44rpx;
|
|
||||||
margin-right: 10rpx;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position: center center;
|
|
||||||
background-size: contain;
|
|
||||||
background-image: url("~static/images/lottery/gold.png");
|
|
||||||
|
|
||||||
@media (-webkit-min-device-pixel-ratio: 2),
|
|
||||||
(min-device-pixel-ratio: 2) {
|
|
||||||
background-image: url("~static/images/lottery/gold@2x.png");
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (-webkit-min-device-pixel-ratio: 3),
|
|
||||||
(min-device-pixel-ratio: 3) {
|
|
||||||
background-image: url("~static/images/lottery/gold@3x.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.num {
|
.num {
|
||||||
color: #F9FC31;
|
color: #F9FC31;
|
||||||
@@ -633,14 +623,16 @@
|
|||||||
|
|
||||||
.almost-lottery__wheel {
|
.almost-lottery__wheel {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
z-index: 3;
|
||||||
|
margin-top: -50rpx;
|
||||||
.almost-lottery__count {
|
.almost-lottery__count {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 40rpx 0;
|
padding: 20rpx 0 40rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
|
|||||||
BIN
static/images/zhuanpan/ling-qu.png
Normal file
BIN
static/images/zhuanpan/ling-qu.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 78 KiB |
BIN
static/images/zhuanpan/ling-qu@2x.png
Normal file
BIN
static/images/zhuanpan/ling-qu@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 239 KiB |
Reference in New Issue
Block a user