|
@@ -1,785 +1,796 @@
|
|
|
-<template>
|
|
|
- <view class="ticket-wrap">
|
|
|
- <!-- #ifdef MP-ALIPAY -->
|
|
|
- <view v-if="pagesNum > 1">
|
|
|
- <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="盲票详情" leftIconSize="0"></u-navbar>
|
|
|
- </view>
|
|
|
- <view v-else>
|
|
|
- <u-navbar leftIconSize="0" :placeholder="true" bgColor="#fff" title="盲票详情">
|
|
|
- <view class="nav-left flex" slot="left" @click="$toIndex()">
|
|
|
- <u-icon name="home" size="20" color="#333"></u-icon>
|
|
|
- <view class="nav-left__code">首页</view>
|
|
|
- </view>
|
|
|
- </u-navbar>
|
|
|
- </view>
|
|
|
- <!-- #endif -->
|
|
|
- <!-- #ifndef MP-ALIPAY -->
|
|
|
- <view v-if="pagesNum > 1">
|
|
|
- <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="盲票详情"></u-navbar>
|
|
|
- </view>
|
|
|
- <view v-else>
|
|
|
- <u-navbar leftIconSize="0" :placeholder="true" bgColor="#fff" title="盲票详情">
|
|
|
- <view class="nav-left flex" slot="left" @click="$toIndex()">
|
|
|
- <u-icon name="home" size="20" color="#333"></u-icon>
|
|
|
- <view class="nav-left__code">首页</view>
|
|
|
- </view>
|
|
|
- </u-navbar>
|
|
|
- </view>
|
|
|
- <!-- #endif -->
|
|
|
-
|
|
|
- <!-- 奖品轮播 -->
|
|
|
- <view class="prize">
|
|
|
- <!-- 查看规则 -->
|
|
|
- <view class="prize-rule" @click="toRule">
|
|
|
- <!-- #ifndef MP-ALIPAY -->
|
|
|
- <view class="prize-rule-content flex">
|
|
|
- <image src="../../static/index/index_tip.png" mode="scaleToFill"></image>
|
|
|
- <text>查看规则</text>
|
|
|
- </view>
|
|
|
- <!-- #endif -->
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 奖品 -->
|
|
|
- <swiper class="prize-swiper" previous-margin="100px" next-margin="100px" :interval="4000" :autoplay="true" :circular="true" @change="changePrizeSwiper">
|
|
|
- <swiper-item :class="prizeIndex == index ? 'swiper-item' : 'swiper-item-side'" v-for="(item, index) in prizeList.slice(0, 10)" :key="index">
|
|
|
- <view class="prize-swiper-item flex" @click="toPrizeGoods(item)">
|
|
|
- <image :class="prizeIndex == index ? 'img' : 'img-side'" :src="item.picUrl" mode="aspectFit"></image>
|
|
|
- </view>
|
|
|
- </swiper-item>
|
|
|
- </swiper>
|
|
|
-
|
|
|
- <!-- 奖品价格 -->
|
|
|
- <view class="prize-price flex">
|
|
|
- <view class="prize-price-present" v-if="prizeInfo.prizeType != 'coin'">¥{{ $numberFormat(prizeInfo.value) }}</view>
|
|
|
- <view class="prize-price-present" v-else>{{ prizeInfo.value }}个</view>
|
|
|
- <view class="prize-price-txt ells-one">{{ prizeInfo.title }}</view>
|
|
|
- <view class="prize-price__ticket-price flex">
|
|
|
- <image src="../../static/ticketBox/ticket_block.png" mode="scaleToFill"></image>
|
|
|
- <view class="txt">¥{{ $numberFormat(info.salePrice) }}</view>
|
|
|
- </view>
|
|
|
- <view class="prize-price-past" v-if="info.originPrice != 0">原价:¥{{ $numberFormat(info.originPrice) }}</view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 开启盲票 -->
|
|
|
- <view class="ticket-btn flex">
|
|
|
- <!-- <image class="ticket-btn-game" src="../../static/ticketBox/ticket_game.png" mode="scaleToFill" @click="toRollingGame"></image> -->
|
|
|
- <image class="ticket-btn-game" src="" mode="scaleToFill" ></image>
|
|
|
- <view class="ticket-btn-center flex" @click="exchange">
|
|
|
- <image src="../../static/ticketBox/ticket_btn_center.png" mode="scaleToFill"></image>
|
|
|
- <view class="ticket-btn-center-txt">刮开盲票</view>
|
|
|
- </view>
|
|
|
- <view class="ticket-btn-share flex">
|
|
|
- <!-- #ifdef MP-WEIXIN -->
|
|
|
- <image src="../../static/ticketBox/ticket_share.png" mode="scaleToFill" @click="toShare"></image>
|
|
|
- <button type="default" open-type="share" v-if="loginState"></button>
|
|
|
- <!-- #endif -->
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 盲票奖品说明 -->
|
|
|
- <view class="explain flex">
|
|
|
- <image class="image-left" src="../../static/ticketBox/ticket_explain_left.png" mode="aspectFit"></image>
|
|
|
- <view class="explain-title">刮开必出以下宝贝之一</view>
|
|
|
- <image class="image-right" src="../../static/ticketBox/ticket_explain_right.png" mode="aspectFit"></image>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 盲票奖品数量、概率 -->
|
|
|
- <view class="prize-total">
|
|
|
- <view class="prize-total-num">共{{ total }}款</view>
|
|
|
- <!-- 中奖概率 -->
|
|
|
- <view class="prize-total-chance flex">
|
|
|
- <view class="prize-total-chance-content flex" v-for="(item, index) in info.ticketAwardsLabelList">
|
|
|
- <image :src="item.picUrl" mode="scaleToFill"></image>
|
|
|
- <text>{{ item.hitRate }}%</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <!-- 文字说明 -->
|
|
|
- <view class="prize-total-txt">因概率对小数点后三位进行四舍五入处理,故存在总值不为100%的可能。商品抽奖存在概率性,付费请谨慎!未成年人请在家长监督下使用。</view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 盲票奖品列表 -->
|
|
|
- <view class="prize-list">
|
|
|
- <view class="prize-list-item flex" v-for="(item, index) in prizeList" :key="index" @click="toPrizeGoods(item)">
|
|
|
- <image :src="item.picUrl" mode="aspectFit"></image>
|
|
|
- <view class="prize-list-item-info flex">
|
|
|
- <view class="title ells">{{ item.title }}</view>
|
|
|
- <view class="price" v-if="item.prizeType != 'coin'">¥{{ $numberFormat(item.value) }}</view>
|
|
|
- <view class="price" v-else>{{ item.value }}个</view>
|
|
|
- </view>
|
|
|
- <view class="prize-list-item-grade">
|
|
|
- <image :src="item.awardsLabelPicUrl" />
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <u-loadmore :line="true" v-if="prizeList.length>10" :status="status" :loading-text="'努力加载中'" :nomore-text="'已经到底了'" />
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="footer-fixed" v-if="btnFixed">
|
|
|
- <view class="footer-fixed-btn flex">
|
|
|
- <view class="footer-fixed-btn-center flex" @click="exchange">
|
|
|
- <image src="../../static/ticketBox/ticket_btn_center.png" mode="scaleToFill"></image>
|
|
|
- <view class="footer-fixed-btn-center-txt">刮开盲票</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 支付弹层 -->
|
|
|
- <pay-popup :pay-show="payShow" :pay-info="payInfo" @close="close" @success="toProcess" v-if="payShow" />
|
|
|
- </view>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
- import env from '../../config/env.js'
|
|
|
- import $http from '@/utils/request.js'
|
|
|
- import appId from '@/config/appId.js'
|
|
|
- import PayPopup from '../../components/pay-popup/pay-popup.vue'
|
|
|
- export default {
|
|
|
- components: {
|
|
|
- PayPopup
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- boxId: '',
|
|
|
- picUrlArr: [],
|
|
|
- info: {},
|
|
|
- status: 'nomore',//上拉刷新状态
|
|
|
- pageNum: 1,
|
|
|
- total: 0,
|
|
|
- prizeList: [],
|
|
|
-
|
|
|
- payShow: false,
|
|
|
- payInfo: {},
|
|
|
- sceneArr: null,
|
|
|
-
|
|
|
- prizeIndex: 0,
|
|
|
- contnetHeight: 0,
|
|
|
- btnFixed: false,
|
|
|
- prizeInfo: {},
|
|
|
- userInfo: {},
|
|
|
- loginState: false,
|
|
|
- pagesNum: '',
|
|
|
- };
|
|
|
- },
|
|
|
- onLoad(opthios) {
|
|
|
- //票赢天下跳转
|
|
|
- if (opthios.scene) {
|
|
|
- let sceneStr = decodeURIComponent(opthios.scene)
|
|
|
- this.sceneArr = sceneStr.split('&')
|
|
|
- this.boxId = this.sceneArr[0]
|
|
|
- uni.setStorageSync('shareUid', this.sceneArr[1])
|
|
|
- if (this.sceneArr[1] === undefined || this.sceneArr[1] === 'undefined') {
|
|
|
- uni.getSystemInfo({
|
|
|
- success(res) {
|
|
|
- log.error(
|
|
|
- `基础库:${ res.SDKVersion },设备:${ res.model }-${ res.system },页面:/pages/ticketBox/detail.vue,来源:票赢天下小程序分享盲票,`
|
|
|
- )
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- uni.setStorageSync('shareType', this.sceneArr[2])
|
|
|
- }
|
|
|
-
|
|
|
- if (opthios.boxId) {
|
|
|
- this.boxId = opthios.boxId
|
|
|
- }
|
|
|
- if (opthios.userId) {
|
|
|
- uni.setStorageSync('shareUid', opthios.userId != 'undefined' ? opthios.userId:null)
|
|
|
- if (opthios.userId === undefined || opthios.userId === 'undefined') {
|
|
|
- uni.getSystemInfo({
|
|
|
- success(res) {
|
|
|
- log.error(
|
|
|
- `基础库:${ res.SDKVersion },设备:${ res.model }-${ res.system },页面:/pages/ticketBox/detail.vue.`
|
|
|
- )
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- if (opthios.type) {
|
|
|
- uni.setStorageSync('shareType', opthios.type)
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 外部app跳转接受的参数
|
|
|
- * shareUid: 用户ID
|
|
|
- * shareType: 分享类型
|
|
|
- * */
|
|
|
- if(opthios.uid) {
|
|
|
- uni.setStorageSync('shareUid', opthios.uid != 'undefined' ? opthios.uid:null)
|
|
|
- if (opthios.uid === undefined || opthios.uid === 'undefined') {
|
|
|
- uni.getSystemInfo({
|
|
|
- success(res) {
|
|
|
- log.error(
|
|
|
- `基础库:${ res.SDKVersion },设备:${ res.model }-${ res.system },页面:/pages/ticketBox/detail.vue,来源:外部app,`
|
|
|
- )
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- uni.setStorageSync('shareType', opthios.t)
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- mounted() {
|
|
|
- let _this = this;
|
|
|
- let info = uni.createSelectorQuery().select(".prize");
|
|
|
- info.boundingClientRect(function(data) { //data - 各种参数
|
|
|
- _this.contnetHeight = data.height
|
|
|
- }).exec()
|
|
|
- },
|
|
|
-
|
|
|
- onPageScroll: function(e) {
|
|
|
- let _this = this;
|
|
|
- _this.btnFixed = _this.contnetHeight <= e.scrollTop;
|
|
|
- },
|
|
|
-
|
|
|
- onShow() {
|
|
|
- this.pagesNum = getCurrentPages().length
|
|
|
- this.loginState = uni.getStorageSync('token') ? true : false
|
|
|
- if(this.loginState) {
|
|
|
- this.getBaseInfo()
|
|
|
- }
|
|
|
- if (this.boxId && this.boxId != undefined) {
|
|
|
- this.getDetail()
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- methods: {
|
|
|
- changePrizeSwiper({ detail }) {
|
|
|
- this.prizeIndex = detail.current
|
|
|
- this.prizeInfo = this.prizeList[detail.current]
|
|
|
- },
|
|
|
-
|
|
|
- getDetail() {
|
|
|
- $http.post('/api/v1/mp/user/mall/ticket/detail/new', {
|
|
|
- boxId: this.boxId,
|
|
|
- noToken: true
|
|
|
- }).then(res => {
|
|
|
- if (res.code == 0) {
|
|
|
- this.info = {
|
|
|
- ...res.data,
|
|
|
- picUrl: res.data.picUrl.split(',').map(item => env.filePublic + item + '?imageView2/2/w/375'),
|
|
|
- ticketAwardsLabelList: res.data.ticketAwardsLabelList.map(item => {
|
|
|
- return { ...item, picUrl: env.filePublic + item.picUrl }
|
|
|
- })
|
|
|
- }
|
|
|
- this.pageNum = 1
|
|
|
- this.total = 0
|
|
|
- this.prizeList = []
|
|
|
- this.getPrizeList()
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- })
|
|
|
- },
|
|
|
- getPrizeList() {
|
|
|
- $http.post(`/api/v1/mp/user/ticket/prize/list/${this.boxId}?pageNum=${this.pageNum}&pageSize=10`,{}).then(res => {
|
|
|
- if (res.code == 0) {
|
|
|
- let prizeList = res.rows
|
|
|
- prizeList.forEach(item => {
|
|
|
- item.picUrl = env.filePublic + item.picUrl.split(',')[0] + '?imageView2/2/w/375'
|
|
|
- item.awardsLabelPicUrl = env.filePublic + item.awardsLabelPicUrl
|
|
|
- })
|
|
|
- this.total = res.total
|
|
|
- this.prizeList = this.prizeList.concat(prizeList)
|
|
|
- this.prizeInfo = this.prizeList[this.prizeIndex]
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- getPageNum() {
|
|
|
- let pages = getCurrentPages();
|
|
|
- },
|
|
|
-
|
|
|
- close() {
|
|
|
- this.payShow = false
|
|
|
- },
|
|
|
-
|
|
|
- toProcess(id) {
|
|
|
- this.payShow = false
|
|
|
- // uni.navigateTo({
|
|
|
- // url: `/packagePrize/rolling/index?boxId=${ this.info.boxId }&orderId=${ id }&isTry=0`
|
|
|
- // })
|
|
|
- uni.navigateTo({
|
|
|
- url: `/packagePrize/purchase/index?boxId=${ this.info.boxId }&orderId=${ id }&isTry=0`
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- exchange() {
|
|
|
- let data = {
|
|
|
- userCouponIds: [],
|
|
|
- autoCoupon: 1,
|
|
|
- boxId: this.info.boxId,
|
|
|
- orderNum: 1,
|
|
|
- appSource: appId
|
|
|
- }
|
|
|
- $http.post('/api/v1/mp/user/ticket/order/settle', data).then(res => {
|
|
|
- if (res.code == 0) {
|
|
|
- let info = {
|
|
|
- ...res.data,
|
|
|
- ...this.info,
|
|
|
- picUrl: this.info.picUrl[0],
|
|
|
- couponTitle: res.data && res.data.couponList && res.data.couponList.length && res
|
|
|
- .data.couponList[0].title,
|
|
|
- couponId: res.data && res.data.couponList && res.data.couponList.length && res.data
|
|
|
- .couponList[0].id
|
|
|
- }
|
|
|
- this.payInfo = info
|
|
|
- this.payShow = true
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- toRollingGame() {
|
|
|
- if (!uni.getStorageSync('token')) {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/login/index'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- uni.navigateTo({
|
|
|
- url: `/packagePrize/rolling/index?boxId=${ this.info.boxId }&isTry=1`
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- toShare() {
|
|
|
- this.getBaseInfo()
|
|
|
- // if (!uni.getStorageSync('token')) {
|
|
|
- // uni.navigateTo({
|
|
|
- // url: "/pages/login/index"
|
|
|
- // })
|
|
|
- // return
|
|
|
- // }
|
|
|
- // uni.navigateTo({
|
|
|
- // url: `/packageOperate/share/index?boxId=${ this.info.boxId }`
|
|
|
- // })
|
|
|
- },
|
|
|
-
|
|
|
- // 点击规则说明
|
|
|
- toRule() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/packageOther/rule/index'
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- toPrizeGoods(item) {
|
|
|
- if (item.prizeType == "goods") {
|
|
|
- uni.navigateTo({
|
|
|
- url: `/packagePrize/goods/detail?id=${ item.refId }`
|
|
|
- })
|
|
|
- }
|
|
|
- //门店优惠券
|
|
|
- if (item.prizeType == "coupon" || item.prizeType == "coupon_pkg") {
|
|
|
- uni.navigateTo({
|
|
|
- url: `/packagePrize/goods/detail?id=425`
|
|
|
- })
|
|
|
- }
|
|
|
- // 盲豆
|
|
|
- if (item.prizeType == "coin") {
|
|
|
- uni.navigateTo({
|
|
|
- url: `/packagePrize/goods/detail?id=424`
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- getBaseInfo() {
|
|
|
- $http.post('/api/v1/mp/user/getLoginUserinfo', { appSource: appId }).then(res => {
|
|
|
- uni.hideLoading();
|
|
|
- if (res.code == 0) {
|
|
|
- this.userInfo = res.data
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- },
|
|
|
-
|
|
|
- onShareAppMessage(res) {
|
|
|
- return {
|
|
|
- title: '一起来刮盲票吧',
|
|
|
- path: `/pages/ticketBox/detail?boxId=${ this.info.boxId }&userId=${ this.userInfo.userId }&type=1`,
|
|
|
- type: 2,
|
|
|
- }
|
|
|
- },
|
|
|
- //分享朋友圈
|
|
|
- onShareTimeline() {
|
|
|
- return {
|
|
|
- title: '一起来刮盲票吧',
|
|
|
- query: `boxId=${ this.info.boxId }&userId=${ this.userInfo.userId?this.userInfo.userId:null }&type=1`
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
- onReachBottom() {
|
|
|
- if(this.total < this.pageNum * 10) return ;
|
|
|
- this.status = 'loading';
|
|
|
- ++this.pageNum
|
|
|
- if(this.total < this.pageNum * 10) this.status = 'nomore';
|
|
|
- else this.status = 'loading';
|
|
|
- this.getPrizeList()
|
|
|
- },
|
|
|
- }
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="scss" scoped>
|
|
|
- .ticket-wrap {
|
|
|
- background: #FFF3EB;
|
|
|
- padding-bottom: 100rpx;
|
|
|
- }
|
|
|
- .nav-left {
|
|
|
- &__code {
|
|
|
- margin-left: 10rpx;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 奖品轮播
|
|
|
- .prize {
|
|
|
- // height: 71vh;
|
|
|
- background: url(https://mp-public-1310078123.cos.ap-shanghai.myqcloud.com/v2/detail_3.png) center center no-repeat;
|
|
|
- background-size: 100vw 71vh;
|
|
|
- margin-bottom: 14rpx;
|
|
|
-
|
|
|
- // 查看规则
|
|
|
- &-rule {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- height: 34rpx;
|
|
|
- padding: 44rpx 0 0 34rpx;
|
|
|
- margin-bottom: 60rpx;
|
|
|
-
|
|
|
- &-content {
|
|
|
- image {
|
|
|
- width: 34rpx;
|
|
|
- height: 34rpx;
|
|
|
- margin-right: 14rpx;
|
|
|
- }
|
|
|
-
|
|
|
- text {
|
|
|
- font-size: 40rpx;
|
|
|
- font-family: 'YouSheBiaoTiHei';
|
|
|
- font-weight: 400;
|
|
|
- color: #FFFFFF;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 奖品轮播
|
|
|
- &-swiper {
|
|
|
- height: 534rpx;
|
|
|
-
|
|
|
- .swiper-item {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- // 80
|
|
|
- }
|
|
|
-
|
|
|
- .swiper-item-side {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- margin: 0;
|
|
|
- }
|
|
|
-
|
|
|
- &-item {
|
|
|
- height: 267px;
|
|
|
-
|
|
|
- .img {
|
|
|
- position: absolute;
|
|
|
-
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- animation: prizeBig .3s;
|
|
|
- }
|
|
|
-
|
|
|
- .img-side {
|
|
|
- width: 60%;
|
|
|
- height: 60%;
|
|
|
- animation: prizeMini .3s;
|
|
|
- opacity: .5;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 奖品价格
|
|
|
- &-price {
|
|
|
- flex-direction: column;
|
|
|
- justify-content: space-between;
|
|
|
- height: 14vh;
|
|
|
- margin-bottom: 30rpx;
|
|
|
-
|
|
|
- &-present {
|
|
|
- font-size: 26rpx;
|
|
|
- font-weight: bold;
|
|
|
- }
|
|
|
-
|
|
|
- &-txt {
|
|
|
- padding: 0 34rpx;
|
|
|
- font-size: 30rpx;
|
|
|
- font-weight: bold;
|
|
|
- }
|
|
|
-
|
|
|
- &__ticket-price {
|
|
|
- position: relative;
|
|
|
- height: 66rpx;
|
|
|
-
|
|
|
- image {
|
|
|
- width: 276rpx;
|
|
|
- height: 66rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .txt {
|
|
|
- position: absolute;
|
|
|
- font-size: 40rpx;
|
|
|
- line-height: 66rpx;
|
|
|
- font-family: YouSheBiaoTiHei;
|
|
|
- font-weight: 400;
|
|
|
- color: #FFFFFF;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &-past {
|
|
|
- font-size: 26rpx;
|
|
|
- font-weight: bold;
|
|
|
- text-decoration: line-through;
|
|
|
- color: #5E3909;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 开启盲票
|
|
|
- .ticket-btn {
|
|
|
- justify-content: space-between;
|
|
|
- height: 10vh;
|
|
|
- padding: 0 34rpx;
|
|
|
-
|
|
|
- &-game {
|
|
|
- width: 110rpx;
|
|
|
- height: 110rpx;
|
|
|
- }
|
|
|
-
|
|
|
- &-center {
|
|
|
- position: relative;
|
|
|
- height: 100%;
|
|
|
-
|
|
|
- image {
|
|
|
- height: 100%;
|
|
|
- width: 55vw;
|
|
|
- }
|
|
|
-
|
|
|
- &-txt {
|
|
|
- position: absolute;
|
|
|
- top: 30rpx;
|
|
|
- font-size: 72rpx;
|
|
|
- line-height: 72rpx;
|
|
|
- font-family: YouSheBiaoTiHei;
|
|
|
- font-weight: 400;
|
|
|
- color: #FFFFFF;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &-share {
|
|
|
- position: relative;
|
|
|
- width: 110rpx;
|
|
|
- height: 110rpx;
|
|
|
-
|
|
|
- image {
|
|
|
- position: absolute;
|
|
|
- width: 110rpx;
|
|
|
- height: 110rpx;
|
|
|
- }
|
|
|
-
|
|
|
- ::v-deep button {
|
|
|
- position: absolute;
|
|
|
- z-index: 5;
|
|
|
- width: 110rpx;
|
|
|
- height: 110rpx;
|
|
|
- background: none;
|
|
|
- border: none !important;
|
|
|
- }
|
|
|
- ::v-deep uni-button:after {
|
|
|
- border: none !important;
|
|
|
- }
|
|
|
- ::v-deep button:after {
|
|
|
- border: none !important;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 盲票奖品说明
|
|
|
- .explain {
|
|
|
- width: 100vw;
|
|
|
- position: relative;
|
|
|
- height: 40rpx;
|
|
|
- margin-bottom: 32rpx;
|
|
|
-
|
|
|
- .image-left {
|
|
|
- width: 18vw;
|
|
|
- height: 40rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .image-right {
|
|
|
- width: 18vw;
|
|
|
- height: 40rpx;
|
|
|
- }
|
|
|
-
|
|
|
- &-title {
|
|
|
- font-size: 46rpx;
|
|
|
- line-height: 46rpx;
|
|
|
- font-family: YouSheBiaoTiHei;
|
|
|
- font-weight: 400;
|
|
|
- color: #5E3909;
|
|
|
- padding: 0 8rpx;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 盲票奖品数量、概率
|
|
|
- .prize-total {
|
|
|
- margin-bottom: 34rpx;
|
|
|
-
|
|
|
- &-num {
|
|
|
- font-size: 26rpx;
|
|
|
- text-align: center;
|
|
|
- font-weight: bold;
|
|
|
- color: #744111;
|
|
|
- margin-bottom: 24rpx;
|
|
|
- }
|
|
|
-
|
|
|
- &-chance {
|
|
|
- margin-bottom: 32rpx;
|
|
|
-
|
|
|
- &-content {
|
|
|
- margin-right: 40rpx;
|
|
|
-
|
|
|
- image {
|
|
|
- width: 56rpx;
|
|
|
- height: 50rpx;
|
|
|
- }
|
|
|
-
|
|
|
- text {
|
|
|
- font-size: 28rpx;
|
|
|
- font-family: YouSheBiaoTiHei;
|
|
|
- font-weight: 400;
|
|
|
- color: #622C06;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &-content:last-child {
|
|
|
- margin: 0;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &-txt {
|
|
|
- padding: 0 100rpx;
|
|
|
- font-size: 26rpx;
|
|
|
- font-weight: 500;
|
|
|
- color: #956B33;
|
|
|
- line-height: 42rpx;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 盲票奖品列表
|
|
|
- .prize-list {
|
|
|
- padding: 0 34rpx 70rpx;
|
|
|
-
|
|
|
- &-item {
|
|
|
- position: relative;
|
|
|
- padding: 0 110rpx 0 84rpx;
|
|
|
- justify-content: flex-start;
|
|
|
- height: 264rpx;
|
|
|
- background: #FFFFFF;
|
|
|
- border-radius: 22rpx;
|
|
|
- margin-bottom: 26rpx;
|
|
|
-
|
|
|
- image {
|
|
|
- width: 166rpx;
|
|
|
- height: 166rpx;
|
|
|
- margin-right: 34rpx;
|
|
|
- }
|
|
|
-
|
|
|
- &-info {
|
|
|
- height: 166rpx;
|
|
|
- flex: 1;
|
|
|
- flex-direction: column;
|
|
|
- align-items: flex-start;
|
|
|
- justify-content: space-between;
|
|
|
-
|
|
|
- .title {
|
|
|
- font-size: 30rpx;
|
|
|
- font-weight: bold;
|
|
|
- line-height: 42rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .price {
|
|
|
- font-size: 36rpx;
|
|
|
- font-weight: bold;
|
|
|
- color: #FF4208;
|
|
|
- line-height: 42rpx;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &-grade {
|
|
|
- position: absolute;
|
|
|
- top: -12rpx;
|
|
|
- left: 0;
|
|
|
-
|
|
|
- image {
|
|
|
- width: 66rpx;
|
|
|
- height: 60rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 滚动固定按钮
|
|
|
- .footer-fixed {
|
|
|
- position: fixed;
|
|
|
- bottom: var(--window-bottom);
|
|
|
- left: 0;
|
|
|
- right: 0;
|
|
|
-
|
|
|
- &-btn {
|
|
|
- height: 10vh;
|
|
|
-
|
|
|
- &-center {
|
|
|
- position: relative;
|
|
|
- height: 100%;
|
|
|
-
|
|
|
- image {
|
|
|
- height: 100%;
|
|
|
- width: 55vw;
|
|
|
- }
|
|
|
-
|
|
|
- &-txt {
|
|
|
- position: absolute;
|
|
|
- top: 30rpx;
|
|
|
- font-size: 72rpx;
|
|
|
- line-height: 72rpx;
|
|
|
- font-family: YouSheBiaoTiHei;
|
|
|
- font-weight: 400;
|
|
|
- color: #FFFFFF;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 奖品缩小动画
|
|
|
- @keyframes prizeMini
|
|
|
- {
|
|
|
- from {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
- to {
|
|
|
- width: 60%;
|
|
|
- height: 60%;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 奖品放大动画
|
|
|
- @keyframes prizeBig
|
|
|
- {
|
|
|
- from {
|
|
|
- width: 60%;
|
|
|
- height: 60%;
|
|
|
- }
|
|
|
- to {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
- }
|
|
|
-</style>
|
|
|
+<template>
|
|
|
+ <view class="ticket-wrap">
|
|
|
+ <!-- #ifdef MP-ALIPAY -->
|
|
|
+ <view v-if="pagesNum > 1">
|
|
|
+ <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="盲票详情"
|
|
|
+ leftIconSize="0"></u-navbar>
|
|
|
+ </view>
|
|
|
+ <view v-else>
|
|
|
+ <u-navbar leftIconSize="0" :placeholder="true" bgColor="#fff" title="盲票详情">
|
|
|
+ <view class="nav-left flex" slot="left" @click="$toIndex()">
|
|
|
+ <u-icon name="home" size="20" color="#333"></u-icon>
|
|
|
+ <view class="nav-left__code">首页</view>
|
|
|
+ </view>
|
|
|
+ </u-navbar>
|
|
|
+ </view>
|
|
|
+ <!-- #endif -->
|
|
|
+ <!-- #ifndef MP-ALIPAY -->
|
|
|
+ <view v-if="pagesNum > 1">
|
|
|
+ <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="盲票详情"></u-navbar>
|
|
|
+ </view>
|
|
|
+ <view v-else>
|
|
|
+ <u-navbar leftIconSize="0" :placeholder="true" bgColor="#fff" title="盲票详情">
|
|
|
+ <view class="nav-left flex" slot="left" @click="$toIndex()">
|
|
|
+ <u-icon name="home" size="20" color="#333"></u-icon>
|
|
|
+ <view class="nav-left__code">首页</view>
|
|
|
+ </view>
|
|
|
+ </u-navbar>
|
|
|
+ </view>
|
|
|
+ <!-- #endif -->
|
|
|
+
|
|
|
+ <!-- 奖品轮播 -->
|
|
|
+ <view class="prize">
|
|
|
+ <!-- 查看规则 -->
|
|
|
+ <view class="prize-rule" @click="toRule">
|
|
|
+ <!-- #ifndef MP-ALIPAY -->
|
|
|
+ <view class="prize-rule-content flex">
|
|
|
+ <image src="../../static/index/index_tip.png" mode="scaleToFill"></image>
|
|
|
+ <text>查看规则</text>
|
|
|
+ </view>
|
|
|
+ <!-- #endif -->
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 奖品 -->
|
|
|
+ <swiper class="prize-swiper" previous-margin="100px" next-margin="100px" :interval="4000" :autoplay="true"
|
|
|
+ :circular="true" @change="changePrizeSwiper">
|
|
|
+ <swiper-item :class="prizeIndex == index ? 'swiper-item' : 'swiper-item-side'"
|
|
|
+ v-for="(item, index) in prizeList.slice(0, 10)" :key="index">
|
|
|
+ <view class="prize-swiper-item flex" @click="toPrizeGoods(item)">
|
|
|
+ <image :class="prizeIndex == index ? 'img' : 'img-side'" :src="item.picUrl" mode="aspectFit"></image>
|
|
|
+ </view>
|
|
|
+ </swiper-item>
|
|
|
+ </swiper>
|
|
|
+
|
|
|
+ <!-- 奖品价格 -->
|
|
|
+ <view class="prize-price flex">
|
|
|
+ <view class="prize-price-present" v-if="prizeInfo.prizeType != 'coin'">¥{{ $numberFormat(prizeInfo.value) }}
|
|
|
+ </view>
|
|
|
+ <view class="prize-price-present" v-else>{{ prizeInfo.value }}个</view>
|
|
|
+ <view class="prize-price-txt ells-one">{{ prizeInfo.title }}</view>
|
|
|
+ <view class="prize-price__ticket-price flex">
|
|
|
+ <image src="../../static/ticketBox/ticket_block.png" mode="scaleToFill"></image>
|
|
|
+ <view class="txt">¥{{ $numberFormat(info.salePrice) }}</view>
|
|
|
+ </view>
|
|
|
+ <view class="prize-price-past" v-if="info.originPrice != 0">原价:¥{{ $numberFormat(info.originPrice) }}</view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 开启盲票 -->
|
|
|
+ <view class="ticket-btn flex">
|
|
|
+ <!-- <image class="ticket-btn-game" src="../../static/ticketBox/ticket_game.png" mode="scaleToFill" @click="toRollingGame"></image> -->
|
|
|
+ <image class="ticket-btn-game" src="" mode="scaleToFill"></image>
|
|
|
+ <view class="ticket-btn-center flex" @click="exchange">
|
|
|
+ <image src="../../static/ticketBox/ticket_btn_center.png" mode="scaleToFill"></image>
|
|
|
+ <view class="ticket-btn-center-txt">刮开盲票</view>
|
|
|
+ </view>
|
|
|
+ <view class="ticket-btn-share flex">
|
|
|
+ <!-- #ifdef MP-WEIXIN -->
|
|
|
+ <image src="../../static/ticketBox/ticket_share.png" mode="scaleToFill" @click="toShare"></image>
|
|
|
+ <button type="default" open-type="share" v-if="loginState"></button>
|
|
|
+ <!-- #endif -->
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 盲票奖品说明 -->
|
|
|
+ <view class="explain flex">
|
|
|
+ <image class="image-left" src="../../static/ticketBox/ticket_explain_left.png" mode="aspectFit"></image>
|
|
|
+ <view class="explain-title">刮开必出以下宝贝之一</view>
|
|
|
+ <image class="image-right" src="../../static/ticketBox/ticket_explain_right.png" mode="aspectFit"></image>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 盲票奖品数量、概率 -->
|
|
|
+ <view class="prize-total">
|
|
|
+ <view class="prize-total-num">共{{ total }}款</view>
|
|
|
+ <!-- 中奖概率 -->
|
|
|
+ <view class="prize-total-chance flex">
|
|
|
+ <view class="prize-total-chance-content flex" v-for="(item, index) in info.ticketAwardsLabelList" :key="index">
|
|
|
+ <image :src="item.picUrl" mode="scaleToFill"></image>
|
|
|
+ <text>{{ item.hitRate }}%</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- 文字说明 -->
|
|
|
+ <view class="prize-total-txt">因概率对小数点后三位进行四舍五入处理,故存在总值不为100%的可能。商品抽奖存在概率性,付费请谨慎!未成年人请在家长监督下使用。</view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 盲票奖品列表 -->
|
|
|
+ <view class="prize-list">
|
|
|
+ <view class="prize-list-item flex" v-for="(item, index) in prizeList" :key="index" @click="toPrizeGoods(item)">
|
|
|
+ <image :src="item.picUrl" mode="aspectFit"></image>
|
|
|
+ <view class="prize-list-item-info flex">
|
|
|
+ <view class="title ells">{{ item.title }}</view>
|
|
|
+ <view class="price" v-if="item.prizeType != 'coin'">¥{{ $numberFormat(item.value) }}</view>
|
|
|
+ <view class="price" v-else>{{ item.value }}个</view>
|
|
|
+ </view>
|
|
|
+ <view class="prize-list-item-grade">
|
|
|
+ <image :src="item.awardsLabelPicUrl" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <u-loadmore :line="true" v-if="prizeList.length>10" :status="status" :loading-text="'努力加载中'"
|
|
|
+ :nomore-text="'已经到底了'" />
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="footer-fixed" v-if="btnFixed">
|
|
|
+ <view class="footer-fixed-btn flex">
|
|
|
+ <view class="footer-fixed-btn-center flex" @click="exchange">
|
|
|
+ <image src="../../static/ticketBox/ticket_btn_center.png" mode="scaleToFill"></image>
|
|
|
+ <view class="footer-fixed-btn-center-txt">刮开盲票</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 支付弹层 -->
|
|
|
+ <pay-popup :pay-show="payShow" :pay-info="payInfo" @close="close" @success="toProcess" v-if="payShow" />
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import env from '../../config/env.js'
|
|
|
+ import $http from '@/utils/request.js'
|
|
|
+ import appId from '@/config/appId.js'
|
|
|
+ import PayPopup from '../../components/pay-popup/pay-popup.vue'
|
|
|
+ export default {
|
|
|
+ components: {
|
|
|
+ PayPopup
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ boxId: '',
|
|
|
+ picUrlArr: [],
|
|
|
+ info: {},
|
|
|
+ status: 'nomore', //上拉刷新状态
|
|
|
+ pageNum: 1,
|
|
|
+ total: 0,
|
|
|
+ prizeList: [],
|
|
|
+
|
|
|
+ payShow: false,
|
|
|
+ payInfo: {},
|
|
|
+ sceneArr: null,
|
|
|
+
|
|
|
+ prizeIndex: 0,
|
|
|
+ contnetHeight: 0,
|
|
|
+ btnFixed: false,
|
|
|
+ prizeInfo: {},
|
|
|
+ userInfo: {},
|
|
|
+ loginState: false,
|
|
|
+ pagesNum: '',
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onLoad(opthios) {
|
|
|
+ //票赢天下跳转
|
|
|
+ if (opthios.scene) {
|
|
|
+ let sceneStr = decodeURIComponent(opthios.scene)
|
|
|
+ this.sceneArr = sceneStr.split('&')
|
|
|
+ this.boxId = this.sceneArr[0]
|
|
|
+ uni.setStorageSync('shareUid', this.sceneArr[1])
|
|
|
+ if (this.sceneArr[1] === undefined || this.sceneArr[1] === 'undefined') {
|
|
|
+ uni.getSystemInfo({
|
|
|
+ success(res) {
|
|
|
+ log.error(
|
|
|
+ `基础库:${ res.SDKVersion },设备:${ res.model }-${ res.system },页面:/pages/ticketBox/detail.vue,来源:票赢天下小程序分享盲票,`
|
|
|
+ )
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ uni.setStorageSync('shareType', this.sceneArr[2])
|
|
|
+ }
|
|
|
+
|
|
|
+ if (opthios.boxId) {
|
|
|
+ this.boxId = opthios.boxId
|
|
|
+ }
|
|
|
+ if (opthios.userId) {
|
|
|
+ uni.setStorageSync('shareUid', opthios.userId != 'undefined' ? opthios.userId : null)
|
|
|
+ if (opthios.userId === undefined || opthios.userId === 'undefined') {
|
|
|
+ uni.getSystemInfo({
|
|
|
+ success(res) {
|
|
|
+ log.error(
|
|
|
+ `基础库:${ res.SDKVersion },设备:${ res.model }-${ res.system },页面:/pages/ticketBox/detail.vue.`
|
|
|
+ )
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (opthios.type) {
|
|
|
+ uni.setStorageSync('shareType', opthios.type)
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 外部app跳转接受的参数
|
|
|
+ * shareUid: 用户ID
|
|
|
+ * shareType: 分享类型
|
|
|
+ * */
|
|
|
+ if (opthios.uid) {
|
|
|
+ uni.setStorageSync('shareUid', opthios.uid != 'undefined' ? opthios.uid : null)
|
|
|
+ if (opthios.uid === undefined || opthios.uid === 'undefined') {
|
|
|
+ uni.getSystemInfo({
|
|
|
+ success(res) {
|
|
|
+ log.error(
|
|
|
+ `基础库:${ res.SDKVersion },设备:${ res.model }-${ res.system },页面:/pages/ticketBox/detail.vue,来源:外部app,`
|
|
|
+ )
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ uni.setStorageSync('shareType', opthios.t)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ mounted() {
|
|
|
+ let _this = this;
|
|
|
+ let info = uni.createSelectorQuery().select(".prize");
|
|
|
+ info.boundingClientRect(function(data) { //data - 各种参数
|
|
|
+ _this.contnetHeight = data.height
|
|
|
+ }).exec()
|
|
|
+ },
|
|
|
+
|
|
|
+ onPageScroll: function(e) {
|
|
|
+ let _this = this;
|
|
|
+ _this.btnFixed = _this.contnetHeight <= e.scrollTop;
|
|
|
+ },
|
|
|
+
|
|
|
+ onShow() {
|
|
|
+ this.pagesNum = getCurrentPages().length
|
|
|
+ this.loginState = uni.getStorageSync('token') ? true : false
|
|
|
+ if (this.loginState) {
|
|
|
+ this.getBaseInfo()
|
|
|
+ }
|
|
|
+ if (this.boxId && this.boxId != undefined) {
|
|
|
+ this.getDetail()
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ changePrizeSwiper({ detail }) {
|
|
|
+ this.prizeIndex = detail.current
|
|
|
+ this.prizeInfo = this.prizeList[detail.current]
|
|
|
+ },
|
|
|
+
|
|
|
+ getDetail() {
|
|
|
+ $http.post('/api/v1/mp/user/mall/ticket/detail/new', {
|
|
|
+ boxId: this.boxId,
|
|
|
+ noToken: true
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.info = {
|
|
|
+ ...res.data,
|
|
|
+ picUrl: res.data.picUrl.split(',').map(item => env.filePublic + item + '?imageView2/2/w/375'),
|
|
|
+ ticketAwardsLabelList: res.data.ticketAwardsLabelList.map(item => {
|
|
|
+ return { ...item, picUrl: env.filePublic + item.picUrl }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.pageNum = 1
|
|
|
+ this.total = 0
|
|
|
+ this.prizeList = []
|
|
|
+ this.getPrizeList()
|
|
|
+ }
|
|
|
+ }).catch(() => {})
|
|
|
+ },
|
|
|
+ getPrizeList() {
|
|
|
+ $http.post(`/api/v1/mp/user/ticket/prize/list/${this.boxId}?pageNum=${this.pageNum}&pageSize=10`, {}).then(
|
|
|
+ res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ let prizeList = res.rows
|
|
|
+ prizeList.forEach(item => {
|
|
|
+ item.picUrl = env.filePublic + item.picUrl.split(',')[0] + '?imageView2/2/w/375'
|
|
|
+ item.awardsLabelPicUrl = env.filePublic + item.awardsLabelPicUrl
|
|
|
+ })
|
|
|
+ this.total = res.total
|
|
|
+ this.prizeList = this.prizeList.concat(prizeList)
|
|
|
+ this.prizeInfo = this.prizeList[this.prizeIndex]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ getPageNum() {
|
|
|
+ let pages = getCurrentPages();
|
|
|
+ },
|
|
|
+
|
|
|
+ close() {
|
|
|
+ this.payShow = false
|
|
|
+ },
|
|
|
+
|
|
|
+ toProcess(id) {
|
|
|
+ this.payShow = false
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: `/packagePrize/rolling/index?boxId=${ this.info.boxId }&orderId=${ id }&isTry=0`
|
|
|
+ // })
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/packagePrize/purchase/index?boxId=${ this.info.boxId }&orderId=${ id }&isTry=0`
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ exchange() {
|
|
|
+ let data = {
|
|
|
+ userCouponIds: [],
|
|
|
+ autoCoupon: 1,
|
|
|
+ boxId: this.info.boxId,
|
|
|
+ orderNum: 1,
|
|
|
+ appSource: appId
|
|
|
+ }
|
|
|
+ $http.post('/api/v1/mp/user/ticket/order/settle', data).then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ let info = {
|
|
|
+ ...res.data,
|
|
|
+ ...this.info,
|
|
|
+ picUrl: this.info.picUrl[0],
|
|
|
+ couponTitle: res.data && res.data.couponList && res.data.couponList.length && res
|
|
|
+ .data.couponList[0].title,
|
|
|
+ couponId: res.data && res.data.couponList && res.data.couponList.length && res.data
|
|
|
+ .couponList[0].id
|
|
|
+ }
|
|
|
+ this.payInfo = info
|
|
|
+ this.payShow = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ toRollingGame() {
|
|
|
+ if (!uni.getStorageSync('token')) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/login/index'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/packagePrize/rolling/index?boxId=${ this.info.boxId }&isTry=1`
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ toShare() {
|
|
|
+ this.getBaseInfo()
|
|
|
+ // if (!uni.getStorageSync('token')) {
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: "/pages/login/index"
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: `/packageOperate/share/index?boxId=${ this.info.boxId }`
|
|
|
+ // })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 点击规则说明
|
|
|
+ toRule() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/packageOther/rule/index'
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ toPrizeGoods(item) {
|
|
|
+ if (item.prizeType == "goods") {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/packagePrize/goods/detail?id=${ item.refId }`
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //门店优惠券
|
|
|
+ if (item.prizeType == "coupon" || item.prizeType == "coupon_pkg") {
|
|
|
+ if (item.couponDetail) {
|
|
|
+ uni.setStorageSync('couponDetail', item.couponDetail);
|
|
|
+ }
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/packagePrize/goods/detail?id=425`
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 盲豆
|
|
|
+ if (item.prizeType == "coin") {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/packagePrize/goods/detail?id=424`
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ getBaseInfo() {
|
|
|
+ $http.post('/api/v1/mp/user/getLoginUserinfo', { appSource: appId }).then(res => {
|
|
|
+ uni.hideLoading();
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.userInfo = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+ onShareAppMessage(res) {
|
|
|
+ return {
|
|
|
+ title: '一起来刮盲票吧',
|
|
|
+ path: `/pages/ticketBox/detail?boxId=${ this.info.boxId }&userId=${ this.userInfo.userId }&type=1`,
|
|
|
+ type: 2,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //分享朋友圈
|
|
|
+ onShareTimeline() {
|
|
|
+ return {
|
|
|
+ title: '一起来刮盲票吧',
|
|
|
+ query: `boxId=${ this.info.boxId }&userId=${ this.userInfo.userId?this.userInfo.userId:null }&type=1`
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+ if (this.total < this.pageNum * 10) return;
|
|
|
+ this.status = 'loading';
|
|
|
+ ++this.pageNum
|
|
|
+ if (this.total < this.pageNum * 10) this.status = 'nomore';
|
|
|
+ else this.status = 'loading';
|
|
|
+ this.getPrizeList()
|
|
|
+ },
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .ticket-wrap {
|
|
|
+ background: #FFF3EB;
|
|
|
+ padding-bottom: 100rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .nav-left {
|
|
|
+ &__code {
|
|
|
+ margin-left: 10rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 奖品轮播
|
|
|
+ .prize {
|
|
|
+ // height: 71vh;
|
|
|
+ background: url(https://mp-public-1310078123.cos.ap-shanghai.myqcloud.com/v2/detail_3.png) center center no-repeat;
|
|
|
+ background-size: 100vw 71vh;
|
|
|
+ margin-bottom: 14rpx;
|
|
|
+
|
|
|
+ // 查看规则
|
|
|
+ &-rule {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ height: 34rpx;
|
|
|
+ padding: 44rpx 0 0 34rpx;
|
|
|
+ margin-bottom: 60rpx;
|
|
|
+
|
|
|
+ &-content {
|
|
|
+ image {
|
|
|
+ width: 34rpx;
|
|
|
+ height: 34rpx;
|
|
|
+ margin-right: 14rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ text {
|
|
|
+ font-size: 40rpx;
|
|
|
+ font-family: 'YouSheBiaoTiHei';
|
|
|
+ font-weight: 400;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 奖品轮播
|
|
|
+ &-swiper {
|
|
|
+ height: 534rpx;
|
|
|
+
|
|
|
+ .swiper-item {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ // 80
|
|
|
+ }
|
|
|
+
|
|
|
+ .swiper-item-side {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ margin: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-item {
|
|
|
+ height: 267px;
|
|
|
+
|
|
|
+ .img {
|
|
|
+ position: absolute;
|
|
|
+
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ animation: prizeBig .3s;
|
|
|
+ }
|
|
|
+
|
|
|
+ .img-side {
|
|
|
+ width: 60%;
|
|
|
+ height: 60%;
|
|
|
+ animation: prizeMini .3s;
|
|
|
+ opacity: .5;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 奖品价格
|
|
|
+ &-price {
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+ height: 14vh;
|
|
|
+ margin-bottom: 30rpx;
|
|
|
+
|
|
|
+ &-present {
|
|
|
+ font-size: 26rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-txt {
|
|
|
+ padding: 0 34rpx;
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ &__ticket-price {
|
|
|
+ position: relative;
|
|
|
+ height: 66rpx;
|
|
|
+
|
|
|
+ image {
|
|
|
+ width: 276rpx;
|
|
|
+ height: 66rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .txt {
|
|
|
+ position: absolute;
|
|
|
+ font-size: 40rpx;
|
|
|
+ line-height: 66rpx;
|
|
|
+ font-family: YouSheBiaoTiHei;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &-past {
|
|
|
+ font-size: 26rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ text-decoration: line-through;
|
|
|
+ color: #5E3909;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 开启盲票
|
|
|
+ .ticket-btn {
|
|
|
+ justify-content: space-between;
|
|
|
+ height: 10vh;
|
|
|
+ padding: 0 34rpx;
|
|
|
+
|
|
|
+ &-game {
|
|
|
+ width: 110rpx;
|
|
|
+ height: 110rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-center {
|
|
|
+ position: relative;
|
|
|
+ height: 100%;
|
|
|
+
|
|
|
+ image {
|
|
|
+ height: 100%;
|
|
|
+ width: 55vw;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-txt {
|
|
|
+ position: absolute;
|
|
|
+ top: 30rpx;
|
|
|
+ font-size: 72rpx;
|
|
|
+ line-height: 72rpx;
|
|
|
+ font-family: YouSheBiaoTiHei;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &-share {
|
|
|
+ position: relative;
|
|
|
+ width: 110rpx;
|
|
|
+ height: 110rpx;
|
|
|
+
|
|
|
+ image {
|
|
|
+ position: absolute;
|
|
|
+ width: 110rpx;
|
|
|
+ height: 110rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep button {
|
|
|
+ position: absolute;
|
|
|
+ z-index: 5;
|
|
|
+ width: 110rpx;
|
|
|
+ height: 110rpx;
|
|
|
+ background: none;
|
|
|
+ border: none !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep uni-button:after {
|
|
|
+ border: none !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep button:after {
|
|
|
+ border: none !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 盲票奖品说明
|
|
|
+ .explain {
|
|
|
+ width: 100vw;
|
|
|
+ position: relative;
|
|
|
+ height: 40rpx;
|
|
|
+ margin-bottom: 32rpx;
|
|
|
+
|
|
|
+ .image-left {
|
|
|
+ width: 18vw;
|
|
|
+ height: 40rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .image-right {
|
|
|
+ width: 18vw;
|
|
|
+ height: 40rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-title {
|
|
|
+ font-size: 46rpx;
|
|
|
+ line-height: 46rpx;
|
|
|
+ font-family: YouSheBiaoTiHei;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #5E3909;
|
|
|
+ padding: 0 8rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 盲票奖品数量、概率
|
|
|
+ .prize-total {
|
|
|
+ margin-bottom: 34rpx;
|
|
|
+
|
|
|
+ &-num {
|
|
|
+ font-size: 26rpx;
|
|
|
+ text-align: center;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #744111;
|
|
|
+ margin-bottom: 24rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-chance {
|
|
|
+ margin-bottom: 32rpx;
|
|
|
+
|
|
|
+ &-content {
|
|
|
+ margin-right: 40rpx;
|
|
|
+
|
|
|
+ image {
|
|
|
+ width: 56rpx;
|
|
|
+ height: 50rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ text {
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-family: YouSheBiaoTiHei;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #622C06;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &-content:last-child {
|
|
|
+ margin: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &-txt {
|
|
|
+ padding: 0 100rpx;
|
|
|
+ font-size: 26rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #956B33;
|
|
|
+ line-height: 42rpx;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 盲票奖品列表
|
|
|
+ .prize-list {
|
|
|
+ padding: 0 34rpx 70rpx;
|
|
|
+
|
|
|
+ &-item {
|
|
|
+ position: relative;
|
|
|
+ padding: 0 110rpx 0 84rpx;
|
|
|
+ justify-content: flex-start;
|
|
|
+ height: 264rpx;
|
|
|
+ background: #FFFFFF;
|
|
|
+ border-radius: 22rpx;
|
|
|
+ margin-bottom: 26rpx;
|
|
|
+
|
|
|
+ image {
|
|
|
+ width: 166rpx;
|
|
|
+ height: 166rpx;
|
|
|
+ margin-right: 34rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-info {
|
|
|
+ height: 166rpx;
|
|
|
+ flex: 1;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: flex-start;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 42rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .price {
|
|
|
+ font-size: 36rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #FF4208;
|
|
|
+ line-height: 42rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &-grade {
|
|
|
+ position: absolute;
|
|
|
+ top: -12rpx;
|
|
|
+ left: 0;
|
|
|
+
|
|
|
+ image {
|
|
|
+ width: 66rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 滚动固定按钮
|
|
|
+ .footer-fixed {
|
|
|
+ position: fixed;
|
|
|
+ bottom: var(--window-bottom);
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+
|
|
|
+ &-btn {
|
|
|
+ height: 10vh;
|
|
|
+
|
|
|
+ &-center {
|
|
|
+ position: relative;
|
|
|
+ height: 100%;
|
|
|
+
|
|
|
+ image {
|
|
|
+ height: 100%;
|
|
|
+ width: 55vw;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-txt {
|
|
|
+ position: absolute;
|
|
|
+ top: 30rpx;
|
|
|
+ font-size: 72rpx;
|
|
|
+ line-height: 72rpx;
|
|
|
+ font-family: YouSheBiaoTiHei;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 奖品缩小动画
|
|
|
+ @keyframes prizeMini {
|
|
|
+ from {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ to {
|
|
|
+ width: 60%;
|
|
|
+ height: 60%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 奖品放大动画
|
|
|
+ @keyframes prizeBig {
|
|
|
+ from {
|
|
|
+ width: 60%;
|
|
|
+ height: 60%;
|
|
|
+ }
|
|
|
+
|
|
|
+ to {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|