|
@@ -26,7 +26,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="box-ticket">
|
|
|
- <carousel :img-list="imgList" url-key="url" @selected="selectedBanner" />
|
|
|
+ <carousel :img-list="imgList" url-key="picUrl" @selected="selectedBanner" @changeTicket="getTicket" />
|
|
|
</view>
|
|
|
<view class="box-ticket-tip">100%保底必中</view>
|
|
|
<view class="box-start flex">
|
|
@@ -39,47 +39,7 @@
|
|
|
</view>
|
|
|
<custom-tab-bar :activeValue="'index'" />
|
|
|
|
|
|
- <u-popup :show="payShow" mode="bottom" @close="close" :closeable="true">
|
|
|
- <view class="choiceShow-wrap">
|
|
|
- <view class="flex goods">
|
|
|
- <view class="flex image-wrap">
|
|
|
- <image src="../../static/logo.png" mode="aspectFill"></image>
|
|
|
- </view>
|
|
|
- <view class="info">
|
|
|
- <view class="info-title">Apple iPhone 13 (A2634) 128GB 星光色 支持移动联通电信5G 双卡双待手机</view>
|
|
|
- <view class="info-stock">¥10.00</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="flex coupon" @click="toCoupon">
|
|
|
- <view class="flex coupon-left">
|
|
|
- <u-icon name="coupon" size="26" color="#333"></u-icon>
|
|
|
- <view class="txt">代金券</view>
|
|
|
- </view>
|
|
|
- <view class="flex coupon-right">
|
|
|
- <view class="txt">选择代金券</view>
|
|
|
- <u-icon name="arrow-right" size="16" color="#333"></u-icon>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="flex agreement">
|
|
|
- <view class="txt">同意<text>《盲票购买须知》</text></view>
|
|
|
- <view class="checked">
|
|
|
- <u-checkbox-group>
|
|
|
- <u-checkbox :value="checked" :checked="checked" shape="circle" activeColor="#E96737"
|
|
|
- @change="changeChecked"></u-checkbox>
|
|
|
- </u-checkbox-group>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="flex btn">
|
|
|
- <view class="flex btn-left">
|
|
|
- <view class="title">应付:</view>
|
|
|
- <view class="flex coin">¥10.00</view>
|
|
|
- </view>
|
|
|
- <view class="btn-right">
|
|
|
- <view class="confirm">立即支付</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </u-popup>
|
|
|
+ <pay-popup :pay-show="payShow" :pay-info="payInfo" @close="close" />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -87,39 +47,66 @@
|
|
|
import env from '../../config/env.js'
|
|
|
import $http from '@/utils/request.js'
|
|
|
import CustomTabBar from '../../components/custom-tab-bar/custom-tab-bar.vue'
|
|
|
- import carousel from '@/components/vear-carousel/vear-carousel'
|
|
|
+ import Carousel from '../../components/vear-carousel/vear-carousel'
|
|
|
+ import PayPopup from '../../components/pay-popup/pay-popup.vue'
|
|
|
export default {
|
|
|
components: {
|
|
|
CustomTabBar,
|
|
|
- carousel
|
|
|
+ Carousel,
|
|
|
+ PayPopup
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- imgList: [{
|
|
|
- url: 'https://z3.ax1x.com/2021/03/05/6ehghR.jpg',
|
|
|
- id: 1
|
|
|
- }, {
|
|
|
- url: 'https://z3.ax1x.com/2021/03/05/6ehnfI.jpg',
|
|
|
- id: 2
|
|
|
- }, {
|
|
|
- url: 'https://z3.ax1x.com/2021/03/05/6ehfc6.jpg',
|
|
|
- id: 3
|
|
|
- }, {
|
|
|
- url: 'https://z3.ax1x.com/2021/03/05/6efCqg.jpg',
|
|
|
- id: 4
|
|
|
- }, ],
|
|
|
+ imgList: [],
|
|
|
id: '',
|
|
|
value: 1,
|
|
|
payShow: false,
|
|
|
- checked: false
|
|
|
+ checked: false,
|
|
|
+
|
|
|
+ pageNum: 1,
|
|
|
+ total: 100,
|
|
|
+ list: [],
|
|
|
+
|
|
|
+ currentIndex: 0,
|
|
|
+
|
|
|
+ payInfo: {}
|
|
|
};
|
|
|
},
|
|
|
onLoad(opthios) {
|
|
|
this.id = opthios.id
|
|
|
+ this.getList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getList() {
|
|
|
+ let data = {
|
|
|
+ categoryId: '',
|
|
|
+ tagId: '',
|
|
|
+ type: 'online',
|
|
|
+ noToken: true
|
|
|
+ }
|
|
|
+ $http.post(`/api/v1/mp/user/mall/ticket/list?pageNum=${this.pageNum}&pageSize=100`, data).then(
|
|
|
+ res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ res.rows.forEach(item => {
|
|
|
+ let picUrlArr = item.picUrl.split(',')
|
|
|
+ item.picUrl = env.filePublic + picUrlArr[0]
|
|
|
+ })
|
|
|
+ this.total = res.total
|
|
|
+ this.imgList = this.imgList.concat(res.rows)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
selectedBanner(item, index) {
|
|
|
console.log('馃', item, index)
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/ticketBox/detail'
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ getTicket(index) {
|
|
|
+ console.log(index);
|
|
|
+ this.currentIndex = index
|
|
|
},
|
|
|
|
|
|
close() {
|
|
@@ -127,18 +114,32 @@
|
|
|
},
|
|
|
|
|
|
exchange() {
|
|
|
- this.payShow = true
|
|
|
- },
|
|
|
-
|
|
|
- changeChecked(e) {
|
|
|
- console.log(e);
|
|
|
- },
|
|
|
-
|
|
|
- toCoupon() {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/coupon/index'
|
|
|
+ url: '/pages/lucky/index'
|
|
|
})
|
|
|
- }
|
|
|
+ return
|
|
|
+ this.payInfo = this.imgList[this.currentIndex]
|
|
|
+ let data = {
|
|
|
+ couponIds: [],
|
|
|
+ autoCoupon: 1,
|
|
|
+ boxId: this.payInfo.boxId,
|
|
|
+ orderNum: 1
|
|
|
+ }
|
|
|
+ $http.post('/api/v1/mp/user/ticket/order/settle', data).then(res => {
|
|
|
+ console.log(res);
|
|
|
+ if (res.code == 0) {
|
|
|
+ let info = {
|
|
|
+ ...res.data,
|
|
|
+ ...this.payInfo
|
|
|
+ }
|
|
|
+ this.payInfo = info
|
|
|
+ this.payShow = true
|
|
|
+ console.log(info);
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ uni.$u.toast('开刮失败,请重试!');
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -239,111 +240,4 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- .choiceShow-wrap {
|
|
|
- min-height: 400rpx;
|
|
|
- padding: 80rpx 0 60rpx;
|
|
|
-
|
|
|
- .goods {
|
|
|
- padding: 0 20rpx;
|
|
|
- justify-content: space-between;
|
|
|
- margin-bottom: 20rpx;
|
|
|
-
|
|
|
- .image-wrap {
|
|
|
- width: 220rpx;
|
|
|
- height: 220rpx;
|
|
|
- border: 1px solid rgba(236, 236, 236, 100);
|
|
|
- border-radius: 10rpx;
|
|
|
-
|
|
|
- image {
|
|
|
- width: 174rpx;
|
|
|
- height: 174rpx;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .info {
|
|
|
- flex: 1;
|
|
|
- display: flex;
|
|
|
- height: 220rpx;
|
|
|
- flex-direction: column;
|
|
|
- justify-content: space-between;
|
|
|
- padding-left: 26rpx;
|
|
|
-
|
|
|
- &-title {
|
|
|
- font-size: 32rpx;
|
|
|
- line-height: 44rpx;
|
|
|
- font-weight: bold;
|
|
|
- }
|
|
|
-
|
|
|
- &-coin {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- font-size: 32rpx;
|
|
|
- line-height: 44rpx;
|
|
|
- color: rgba(235, 112, 9, 100);
|
|
|
- font-weight: bold;
|
|
|
-
|
|
|
- image {
|
|
|
- width: 42rpx;
|
|
|
- height: 42rpx;
|
|
|
- margin-right: 20rpx;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &-stock {
|
|
|
- line-height: 44rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .coupon {
|
|
|
- justify-content: space-between;
|
|
|
- padding: 30rpx 40rpx;
|
|
|
- border-top: 1px solid rgba(187, 187, 187, 100);
|
|
|
- border-bottom: 1px solid rgba(187, 187, 187, 100);
|
|
|
-
|
|
|
- .txt {
|
|
|
- margin: 0 24rpx;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .agreement {
|
|
|
- justify-content: space-between;
|
|
|
- padding: 50rpx 40rpx;
|
|
|
- border-bottom: 1px solid rgba(187, 187, 187, 100);
|
|
|
-
|
|
|
- .txt text {
|
|
|
- color: #007aff;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .btn {
|
|
|
- justify-content: space-between;
|
|
|
- padding: 20rpx 20rpx;
|
|
|
-
|
|
|
- &-left {
|
|
|
- .coin {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- font-size: 32rpx;
|
|
|
- line-height: 44rpx;
|
|
|
- color: rgba(235, 112, 9, 100);
|
|
|
- margin-left: 20rpx;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &-right {
|
|
|
- .confirm {
|
|
|
- width: 250rpx;
|
|
|
- height: 60rpx;
|
|
|
- line-height: 60rpx;
|
|
|
- border-radius: 8px;
|
|
|
- background-color: rgba(235, 112, 9, 100);
|
|
|
- color: rgba(255, 255, 255, 100);
|
|
|
- font-size: 28rpx;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
</style>
|