|
@@ -32,12 +32,12 @@
|
|
|
:current='currentIndex' lineColor="#F9822C " :activeStyle="{
|
|
|
color: '#333 ',
|
|
|
transform: 'scale(1.1)',
|
|
|
- width: '120px'
|
|
|
+ width: '100px'
|
|
|
}" :inactiveStyle="{
|
|
|
color: '#999',
|
|
|
transform: 'scale(1)',
|
|
|
- width: '120px'
|
|
|
- }" itemStyle="padding-left: 20px; padding-right: 15px; height: 44px; text-align: center;">
|
|
|
+ width: '100px'
|
|
|
+ }" itemStyle="height: 44px; text-align: center;">
|
|
|
</u-tabs>
|
|
|
</view>
|
|
|
<!-- 商品状态 -->
|
|
@@ -92,7 +92,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 优惠券 -->
|
|
|
- <view class="prize-coupon" v-else>
|
|
|
+ <view class="prize-coupon" v-if="state == 1">
|
|
|
<view class="prize-coupon-list">
|
|
|
<view @click="toPrizeDetail(item)" class="prize-coupon-list-item" v-for="(item, index) in list" :key="index">
|
|
|
<view class="content flex">
|
|
@@ -125,6 +125,32 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <!-- 红包 -->
|
|
|
+ <view class="prize-red" v-if="state == 2">
|
|
|
+ <view class="prize-red-list">
|
|
|
+ <view class="prize-red-list-item" v-for="(item, index) in list" :key="index">
|
|
|
+ <view class="content flex">
|
|
|
+ <view class="content-left flex">
|
|
|
+ <image src="https://mp-public-1310078123.cos.ap-shanghai.myqcloud.com/static/redPkg2.png" mode="scaleToFill"></image>
|
|
|
+ </view>
|
|
|
+ <view class="content-right flex">
|
|
|
+ <view class="title ells-one">{{ item.title }}</view>
|
|
|
+ <view class="desc">{{ item.value / 100 }}<text>元</text></view>
|
|
|
+ </view>
|
|
|
+ <view class="content-btn">
|
|
|
+ <view class="btn" @click="toDrawShow(item)">立即领取</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <u-loadmore :line="true" v-if="list.length>4" :status="status" :loading-text="'努力加载中'" :nomore-text="'已经到底了'" />
|
|
|
+ </view>
|
|
|
+ <view class="flex empty" v-if="!list.length && !loading">
|
|
|
+ <view class="center">
|
|
|
+ <image class="center-img" src="https://mp-public-1310078123.cos.ap-shanghai.myqcloud.com/v2/nodata_1.png" mode="scaleToFill"></image>
|
|
|
+ <view class="center-font">还没有红包</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view class="prize-action">
|
|
|
<!-- 实物商品提货 -->
|
|
|
<view class="flex prize-action-goods" v-if="state == 0 && statusIndex == 1">
|
|
@@ -142,6 +168,11 @@
|
|
|
<view class="title">优惠券使用记录</view>
|
|
|
<u-icon name="arrow-right" size="15" color="#999"></u-icon>
|
|
|
</view>
|
|
|
+ <!-- 红包提现记录 -->
|
|
|
+ <view class="flex prize-action-coupon" @click="toRedpkg" v-if="state == 2">
|
|
|
+ <view class="title">红包领取记录</view>
|
|
|
+ <u-icon name="arrow-right" size="15" color="#999"></u-icon>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 兑换成功 -->
|
|
@@ -160,6 +191,19 @@
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
|
|
|
+ <!-- 红包领取 -->
|
|
|
+ <u-popup :show="drawShow" mode="center">
|
|
|
+ <view class="tip-show">
|
|
|
+ <view class="tip-show-title" style="text-align: center;">
|
|
|
+ <view>确认领取该微信红包吗?</view>
|
|
|
+ </view>
|
|
|
+ <view class="flex tip-show-btn">
|
|
|
+ <view class="close" @click="drawShow = false">取消</view>
|
|
|
+ <view class="prize" @click="drawSubmit">确认</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+
|
|
|
<!-- 商品选择sku -->
|
|
|
<sku-popup
|
|
|
:popup-show="skuPopupShow"
|
|
@@ -186,10 +230,13 @@
|
|
|
return {
|
|
|
status: 'nomore',//上拉刷新状态
|
|
|
loading: false,
|
|
|
+ drawLoading: false,
|
|
|
stateArr: [{
|
|
|
name: ' 商品',
|
|
|
}, {
|
|
|
name: ' 优惠券',
|
|
|
+ }, {
|
|
|
+ name: ' 红包',
|
|
|
}],
|
|
|
// typeList: [{
|
|
|
// name: '待提货'
|
|
@@ -205,7 +252,8 @@
|
|
|
pageNum: 1,
|
|
|
total: 0,
|
|
|
list: [],
|
|
|
-
|
|
|
+ drawShow: false,//红包弹框
|
|
|
+ drawId: '',//要提现的红包id
|
|
|
currentIndex: 0,
|
|
|
|
|
|
statusIndex: 1,
|
|
@@ -214,7 +262,7 @@
|
|
|
skuPopupShow: false,//选择框
|
|
|
skuList: [],
|
|
|
skuListInit: [],
|
|
|
- tipShow: false,
|
|
|
+ tipShow: false, //选择多sku
|
|
|
tipData: {},
|
|
|
payInfo: {},
|
|
|
// infoItem: {},
|
|
@@ -231,6 +279,9 @@
|
|
|
if (opthios.coupon == 1) {
|
|
|
this.currentIndex = 1
|
|
|
this.state = 1
|
|
|
+ } else if(opthios.coupon == 2) {
|
|
|
+ this.currentIndex = 2
|
|
|
+ this.state = 2
|
|
|
} else {
|
|
|
this.currentIndex = 0
|
|
|
this.state = 0
|
|
@@ -240,10 +291,8 @@
|
|
|
methods: {
|
|
|
getList() {
|
|
|
let _this = this
|
|
|
- let url = _this.state == 0 ? '/api/v1/mp/user/mine/prize/list' : '/api/v1/mp/user/mine/coupon/list'
|
|
|
- let data = _this.state == 0 ? { } : {
|
|
|
- status: 1
|
|
|
- }
|
|
|
+ let url = _this.state == 0 ? '/api/v1/mp/user/mine/prize/list' : _this.state == 1 ?'/api/v1/mp/user/mine/coupon/list': '/api/v1/mp/user/mine/red/pkg/list'//商品、优惠券、红包
|
|
|
+ let data = _this.state == 0 ? { } : _this.state == 1 ? { status: 1 }: { status: 0 }
|
|
|
this.loading = true
|
|
|
this.checkedAll = false
|
|
|
$http.post(`${ url }?pageNum=${_this.pageNum}&pageSize=20`, data).then(res => {
|
|
@@ -327,6 +376,8 @@
|
|
|
this.statusIndex = 1
|
|
|
} else if (e.index == 1) {
|
|
|
this.state = 1
|
|
|
+ } else if (e.index == 2) {
|
|
|
+ this.state = 2
|
|
|
}
|
|
|
this.pageList()
|
|
|
this.checkedAll = false
|
|
@@ -335,6 +386,8 @@
|
|
|
close() {
|
|
|
this.skuPopupShow = false
|
|
|
this.tipShow = false
|
|
|
+ this.drawId = ''
|
|
|
+ this.drawShow = false
|
|
|
},
|
|
|
skuSuccess(data) {
|
|
|
this.tipData = data
|
|
@@ -428,6 +481,12 @@
|
|
|
url: '/packagePrize/coupon/use'
|
|
|
})
|
|
|
},
|
|
|
+ // 查看红包提现记录
|
|
|
+ toRedpkg() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/packagePrize/prize/redpkg'
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
// 立即提货
|
|
|
toSettlement() {
|
|
@@ -506,23 +565,33 @@
|
|
|
$http.post(`/api/v1/mp/user/mine/coupon/list?pageNum=1&pageSize=20`, {
|
|
|
status: 1
|
|
|
}).then(data => {
|
|
|
- if (res.code == 0) {
|
|
|
- this.stateArr = [{
|
|
|
- name: ' 商品 (' + res.total + ') '
|
|
|
- },
|
|
|
- {
|
|
|
- name: ' 优惠券 (' + data.total + ') '
|
|
|
- },
|
|
|
- ]
|
|
|
- } else {
|
|
|
- this.stateArr = [{
|
|
|
- name: ' 商品 (0)'
|
|
|
- },
|
|
|
- {
|
|
|
- name: ' 优惠券 (0)'
|
|
|
- },
|
|
|
- ]
|
|
|
- }
|
|
|
+ $http.post(`/api/v1/mp/user/mine/red/pkg/list?pageNum=1&pageSize=20`, {
|
|
|
+ status: 0
|
|
|
+ }).then(item => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.stateArr = [{
|
|
|
+ name: ' 商品 (' + res.total + ') '
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: ' 优惠券 (' + data.total + ') '
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: ' 红包 (' + item.total + ') '
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ } else {
|
|
|
+ this.stateArr = [{
|
|
|
+ name: ' 商品 (0)'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: ' 优惠券 (0)'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: ' 红包 (0)'
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
});
|
|
|
},
|
|
@@ -532,6 +601,31 @@
|
|
|
url: `/packagePrize/goods/detail?id=${ item.goodsId }`
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ toDrawShow(item) {
|
|
|
+ this.drawShow = true
|
|
|
+ this.drawId = item.id
|
|
|
+ },
|
|
|
+ drawSubmit() {
|
|
|
+ if(this.drawLoading) return
|
|
|
+ this.drawLoading = true
|
|
|
+ uni.showLoading({
|
|
|
+ title: '提现中'
|
|
|
+ });
|
|
|
+ $http.post('/api/v1/mp/user/mine/red/pkg/draw', { id: this.drawId }).then(res => {
|
|
|
+ uni.hideLoading();
|
|
|
+ this.drawLoading = false
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.pageList()
|
|
|
+ this.couponNum()
|
|
|
+ this.close()
|
|
|
+ }
|
|
|
+ uni.$u.toast(res.msg);
|
|
|
+ }).catch(() => {
|
|
|
+ uni.hideLoading();
|
|
|
+ this.drawLoading = false
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
toPrizeDetail(item) {
|
|
|
let boxIds = JSON.stringify(item.boxIds)
|
|
@@ -796,6 +890,88 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 红包
|
|
|
+ .prize-red {
|
|
|
+ margin-top: 85rpx;
|
|
|
+ padding: 20rpx 20rpx 150rpx;
|
|
|
+
|
|
|
+ &-list {
|
|
|
+ &-item {
|
|
|
+ // padding-top: 30rpx;
|
|
|
+ margin-bottom: 30rpx;
|
|
|
+ background-color: #fff;
|
|
|
+
|
|
|
+ .content {
|
|
|
+ width: 100%;
|
|
|
+ height: 178rpx;
|
|
|
+ justify-content: flex-start;
|
|
|
+
|
|
|
+ &-left {
|
|
|
+ width: 186rpx;
|
|
|
+ height: 100%;
|
|
|
+ background-color: #FFD6BE;
|
|
|
+ margin-right: 36rpx;
|
|
|
+
|
|
|
+ image {
|
|
|
+ width: 148rpx;
|
|
|
+ height: 128rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &-right {
|
|
|
+ flex: 1;
|
|
|
+ align-items: flex-start;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+ height: 100%;
|
|
|
+ padding: 24rpx 0;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ font-size: 30rpx;
|
|
|
+ line-height: 30rpx;
|
|
|
+ height: 30rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
+
|
|
|
+ .desc {
|
|
|
+ font-size: 32rpx;
|
|
|
+ line-height: 32rpx;
|
|
|
+ color: #FA352A;
|
|
|
+ font-weight: 500;
|
|
|
+
|
|
|
+ text {
|
|
|
+ font-size: 22rpx
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &-btn {
|
|
|
+ padding: 20rpx 0 22rpx;
|
|
|
+ margin: 0 30rpx 0;
|
|
|
+
|
|
|
+ .btn {
|
|
|
+ padding: 0 36rpx;
|
|
|
+ display: inline-block;
|
|
|
+ height: 68rpx;
|
|
|
+ background: linear-gradient(270deg, #FF9056 0%, #FF5137 100%);
|
|
|
+ border-radius: 2px;
|
|
|
+ font-size: 30rpx;
|
|
|
+ line-height: 68rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &-item:last-child {
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
.prize-action {
|
|
|
position: fixed;
|