123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387 |
- <template>
- <view>
- <view v-if="pagesNum > 1">
- <u-navbar title="获奖名单" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
- </view>
- <view v-else>
- <u-navbar leftIconSize="0" :placeholder="true" bgColor="#fff" title="获奖名单">
- <view class="nav-left flex" slot="left" @click="toActivity">
- <u-icon name="arrow-left" size="20" color="#333"></u-icon>
- </view>
- </u-navbar>
- </view>
- <view class="list">
- <view v-for="(item,index) in list" :key="index" class="list-view">
- <view class="award flex">
- <view class="award-avatar">
- <image :src="item.avatar" mode="scaleToFill"></image>
- </view>
- <view class="award-nickNames">
- <view class="nickName"><text>{{item.nickName}}</text>
- <view v-if="item.awardName == '一等奖'" class="awardName">
- <image src="../static/activity/one.png" mode="scaleToFill">
- </image>
- <text style="color: #FFD225;">{{item.awardName}}</text>
- </view>
- <view v-else-if="item.awardName == '二等奖'" class="awardName">
- <image src="../static/activity/two.png" mode="scaleToFill">
- </image>
- <text style="color: #94CBEC;">{{item.awardName}}</text>
- </view>
- <view v-else-if="item.awardName == '三等奖'" class="awardName">
- <image src="../static/activity/three.png" mode="scaleToFill"></image>
- <text style="color: #F2B47A;">{{item.awardName}}</text>
- </view>
- <view v-else-if="item.awardName == '四等奖'" class="awardName">
- <image src="../static/activity/five.jpg" mode="scaleToFill"></image>
- <text style="color: #f07695;">{{item.awardName}}</text>
- </view>
- <view v-else-if="item.awardName == '五等奖'" class="awardName">
- <image src="../static/activity/four.jpg" mode="scaleToFill"></image>
- <text style="color: #c595e7;">{{item.awardName}}</text>
- </view>
- </view>
- <view class="prize">中奖码:{{item.code}}</view>
- <view v-if="item.prizeType =='COIN'" class="ells-one prize">盲豆 x{{item.value}}</view>
- <view v-else class="ells-one prize">{{item.prizeTitle}}</view>
- </view>
- </view>
- </view>
- </view>
- <!-- 中奖 -->
- <u-popup :show="activityShow" mode="center" round="11" @close="close" :closeable="true" overlayOpacity="0.5"
- @touchmove.prevent.stop>
- <view class="activityShow-wrap">
- <view class="activityShow-wrap-award">
- <view class="award">恭喜你 获得{{listData.awardName}}</view>
- <view v-if="listData.prizeType && listData.prizeType =='COIN'" class="award-name ells-one">盲豆 x{{listData.value}}</view>
- <view v-else class="award-name ells-one">{{listData.prizeTitle}}</view>
- </view>
- <view class="activityShow-wrap-rela">
- <image :src="listData.prizePicUrl" mode="aspectFit" class="relaimg"></image>
- </view>
- <view v-if="listData.prizeType && listData.prizeType !='COIN'" class="activityShow-wrap-library">
- 奖品已放入我的仓库</view>
- <view v-else class="activityShow-wrap-library">奖品已放入“我的盲豆”</view>
- <view class="flex activityShow-wrap-btn">
- <button @click="toPrize()" v-if="listData.prizeType && listData.prizeType !='COIN'" class="btnone"
- style="">前往查看</button>
- <button @click="toCore()" v-else class="btnone">去兑换商品</button>
- <button @click="close()" class="btntwo" style="">关闭</button>
- </view>
- </view>
- </u-popup>
- <!-- 未中奖 -->
- <u-popup :show="closeShow" mode="center" round="11" @close="close" :closeable="true" overlayOpacity="0.5"
- @touchmove.prevent.stop>
- <view class="choiceShow-wrap">
- <view class="choiceShow-wrap-award">
- <view></view>
- <view class="awardone">
- 很遗憾, 您未中奖
- </view>
- <!-- <view class="awardtwo">
- 欢迎继续参与其他抽奖, 好运就在你身边
- </view> -->
- </view>
- <button @click="close()" class="btntwo">确定</button>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import env from '../../config/env.js'
- import $http from '@/utils/request.js'
- export default {
- data() {
- return {
- list: [],
- marketingId: '',
- closeShow: false,
- activityShow: false,
- listData: {},
- pagesNum: "",
- }
- },
- onLoad(opthios) {
- this.marketingId = opthios.id
- this.pageList()
- },
- onShow() {
- this.pagesNum = getCurrentPages().length
- },
- methods: {
- toActivity() {
- uni.reLaunch({
- url: `/pages/activity/index`
- })
- },
- toCore() {
- uni.reLaunch({
- url: '/pages/core/index'
- })
- },
- pageList() {
- this.pageNum = 1
- this.list = []
- this.getList()
- },
- getList() {
- uni.showLoading({
- title: '加载中'
- });
- this.loading = true
- $http.post(`/api/v1/mp/user/marketing/hit/prize/list`, {
- marketingId: this.marketingId,
- }).then(res => {
- uni.hideLoading();
- this.loading = false
- if (res.code == 0) {
- res.rows.forEach(item => {
- let prizePicUrlArr = item.prizePicUrl.split(',')
- item.prizePicUrl = env.filePublic + prizePicUrlArr[0] + '?imageView2/2/w/170'
- item.avatar = env.filePublic + item.avatar + '?imageView2/2/w/170'
- })
- this.list = this.list.concat(res.rows)
- }
- }).catch(() => {
- uni.hideLoading();
- this.loading = false
- });
- try {
- const value = uni.getStorageSync(this.marketingId);
- if (value) {
- } else {
- this.successFail()
- uni.setStorageSync(this.marketingId, this.marketingId);
- }
- } catch (e) {
- // error
- }
- },
- close() {
- this.closeShow = false
- this.activityShow = false
- },
- toPrize() {
- if (this.listData.prizeType != 'GOODS') {
- uni.navigateTo({
- url: '/packagePrize/prize/index?coupon=1'
- })
- }else{
- uni.navigateTo({
- url: '/packagePrize/prize/index?coupon=0'
- })
- }
- },
- successFail() {
- this.listData = {}
- $http.post(`/api/v1/mp/user/marketing/hit/prize/isHit/${this.marketingId}`, {}).then(
- res => {
- if (res.code == 0 && res.data && res.data.isHit == 1) {
- let prizePicUrlArr = res.data.prizePicUrl.split(',')
- res.data.prizePicUrl = env.filePublic + prizePicUrlArr[0] + '?imageView2/2/w/170'
- this.listData = res.data
- this.activityShow = true
- }
- if (res.code == 0 && res.data && res.data.isHit == 0) {
- this.closeShow = true
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .list {
- &-view {
- padding: 10rpx 20rpx;
- .award {
- justify-content: flex-start;
- border-radius: 22rpx;
- width: 100%;
- height: 108px;
- background-color: #fff;
- overflow: hidden;
- &-avatar {
- padding: 50rpx 32rpx;
- image {
- height: 100rpx;
- width: 100rpx;
- border-radius: 100rpx;
- }
- }
- &-nickNames {
- flex: 1;
- padding: 30rpx 0;
- .prize {
- line-height: 46rpx;
- color: #666666;
- }
- .nickName {
- line-height: 60rpx;
- font-size: 30rpx;
- .awardName {
- display: inline-block;
-
- // &-view {
- // // width: 40rpx;
- // display: inline-block;
- // margin-left: 30rpx;
- // }
- image {
- width: 40rpx;
- height: 36rpx;
- margin-left: 30rpx;
- vertical-align: -10%;
- }
- text {
- display: inline-block;
- font-size: 26rpx;
- line-height: 26rpx;
- }
- }
- }
- }
- }
- }
- // 设置ios刘海屏底部横线安全区域
- padding-bottom: constant(safe-area-inset-bottom);
- padding-bottom: env(safe-area-inset-bottom);
- }
- .activityShow-wrap {
- border-radius: 22rpx;
- overflow: hidden;
- width: 550rpx;
- height: 630rpx;
- &-rela {
- position: relative;
- .relaimg {
- margin-top: 130rpx;
- height: 270rpx;
- position: absolute;
- top: -280rpx;
- left: 102rpx;
- width: 350rpx;
- }
- }
- &-award {
- width: 100%;
- height: 320rpx;
- text-align: center;
- // background: linear-gradient(0deg, #FF866B, #FFAE64);
- // box-shadow: 0px 6px 6px 0px rgba(26, 109, 190, 0.1);
- background: linear-gradient(180deg, #FC981B, #F4641B);
- box-shadow: 0px 6px 6px 0px rgba(26, 109, 190, 0.1);
- text-align: center;
- .award {
- font-size: 40rpx;
- color: #fff;
- font-weight: bold;
- line-height: 80rpx;
- padding-top: 30rpx;
- &-name {
- font-size: 30rpx;
- color: #fff;
- font-weight: bold;
- padding: 0 34rpx;
- }
- }
- }
- &-library {
- text-align: center;
- margin-top: 110rpx;
- font-size: 24rpx;
- color: #999;
- line-height: 80rpx;
- }
- &-btn {
- padding: 10rpx 20rpx 40rpx;
- .btnone {
- width: 200rpx;
- height: 78rpx;
- font-size: 26rpx;
- line-height: 74rpx;
- background-color: #fff;
- color: #F8832C;
- border: 2rpx solid #F8832C;
- }
- .btntwo {
- width: 200rpx;
- height: 78rpx;
- font-size: 26rpx;
- line-height: 74rpx;
- background-color: #F8832C;
- color: #fff;
- border: 2rpx solid #F8832C;
- }
- }
- }
- .choiceShow-wrap {
- border-radius: 22rpx;
- overflow: hidden;
- width: 550rpx;
- height: 340rpx;
- &-award {
- width: 100%;
- height: 190rpx;
- text-align: center;
- font-weight: bold;
- // background: linear-gradient(0deg, #FF866B, #FFAE64);
- // box-shadow: 0px 6px 6px 0px rgba(26, 109, 190, 0.1);
- background: linear-gradient(180deg, #FC981B, #F4641B);
- box-shadow: 0px 6px 6px 0px rgba(26, 109, 190, 0.1);
- text-align: center;
- .awardone {
- padding-top: 70rpx; color: #fff;font-size: 40rpx;
- }
- .awardtwo {
- padding-top: 60rpx;color: #fff;font-size: 30rpx;
- }
- }
- .btntwo {
- width: 252rpx;
- height: 82rpx;
- font-size: 26rpx;
- line-height: 82rpx;
- background-color: #F8832C;
- color: #fff;
- margin-top: 30rpx;
- }
- }
- </style>
|