|
@@ -1,14 +1,16 @@
|
|
|
<template>
|
|
|
<view class="center">
|
|
|
<scroll-view scroll-y="true" style="padding-bottom: 20rpx;">
|
|
|
- <view class="shopBox">
|
|
|
- <view class="shopBox-top">
|
|
|
- <view class="left"><image src="../../static/img/index4.png" mode=""></image></view>
|
|
|
- <view class="between" style="margin-left: -340rpx;">
|
|
|
- <text id="one">{{ list.data?list.data.name:'' }}</text>
|
|
|
- <text id="two">{{ list.lun }}轮</text>
|
|
|
+ <view class="shopBox" v-for="(item, index) in list.open_times" :key="index" v-if="item.ifShow">
|
|
|
+ <view class="shopBox-top flex" >
|
|
|
+ <view class="left-box flex">
|
|
|
+ <view class="left-bg"><image src="../../static/img/index4.png" mode=""></image></view>
|
|
|
+ <view class="one">{{ list.data ? list.data.name : '' }}</view>
|
|
|
+ <view class="two">{{ index+1 }}轮</view>
|
|
|
</view>
|
|
|
- <text id="three">预约中</text>
|
|
|
+ <view class="three" style="color: #FF4C4C;" v-if="item.type == 1">预约中</view>
|
|
|
+ <view class="three" style="color: ##44969D;" v-if="item.type == 2">待上架</view>
|
|
|
+ <view class="three" style="color: ##6D7C88;" v-if="item.type == 3">已开奖</view>
|
|
|
</view>
|
|
|
<view class="shopBox-between">
|
|
|
<view class="number">
|
|
@@ -29,96 +31,15 @@
|
|
|
</view>
|
|
|
<view class="appointmentTime">
|
|
|
预约时间:
|
|
|
- <text>{{ list.start }}-{{ list.end }}</text>
|
|
|
+ <text>{{ list.start }}-{{ item.end }}</text>
|
|
|
</view>
|
|
|
<view class="lotteryTime">
|
|
|
开奖时间:
|
|
|
- <text>{{ list.jiang }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="btn-box flex">
|
|
|
- <view class="submit" @click="buy()">预购</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="shopBox">
|
|
|
- <view class="shopBox-top">
|
|
|
- <view class="left"><image src="../../static/img/index4.png" mode=""></image></view>
|
|
|
- <view class="between" style="margin-left: -340rpx;">
|
|
|
- <text id="one">{{ list.data?list.data.name:'' }}</text>
|
|
|
- <text id="two">{{ list.lun+1 }}轮</text>
|
|
|
- </view>
|
|
|
- <text id="three" style="color: #44969D;">待上架</text>
|
|
|
- </view>
|
|
|
- <view class="shopBox-between">
|
|
|
- <view class="number">
|
|
|
- <text class="number-left">{{ 1 * list.data.cost }}</text>
|
|
|
- <text class="number-right">{{ list.data.cost_money_type }}/份</text>
|
|
|
- </view>
|
|
|
- <view class="quotient"><text class="quotient-children">每轮限购1组,每组限购一份</text></view>
|
|
|
- </view>
|
|
|
- <image :src="list.data.background_image" style="width: 635rpx; height: 170rpx; margin: 40rpx 0;" mode=""></image>
|
|
|
- <view class="shopBox-bottom">
|
|
|
- <view class="forward">
|
|
|
- <view class="forward-left"></view>
|
|
|
- <view class="forward-right">每组分数:  {{ list.data.join_number }}份</view>
|
|
|
- </view>
|
|
|
- <view class="consume">
|
|
|
- GAS消耗:
|
|
|
- <text>{{ 1 * list.data.ticket }}{{ list.data.ticket_money_type }}</text>
|
|
|
- </view>
|
|
|
- <view class="appointmentTime">
|
|
|
- 预约时间:
|
|
|
- <text>{{ list.nstart }}-{{ list.nend }}</text>
|
|
|
- </view>
|
|
|
- <view class="lotteryTime">
|
|
|
- 开奖时间:
|
|
|
- <text>{{ list.njiang }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="btn-box flex">
|
|
|
- <view class="submit1">带上架</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view v-if="'history'">
|
|
|
- <view class="shopBox" v-for="(item,index) in list.history_list" :key="index" v-if="item.group_num*1 != 0">
|
|
|
- <view class="shopBox-top">
|
|
|
- <view class="left"><image src="../../static/img/index4.png" mode=""></image></view>
|
|
|
- <view class="between" style="margin-left: -340rpx;">
|
|
|
- <text id="one">{{ list.data?list.data.name:'' }}</text>
|
|
|
- <text id="two">{{ item.group_num*1 }}轮</text>
|
|
|
- </view>
|
|
|
- <text id="three" style="color: #6D7C88;">已开奖</text>
|
|
|
- </view>
|
|
|
- <view class="shopBox-between">
|
|
|
- <view class="number">
|
|
|
- <text class="number-left">{{ 1 * list.data.cost }}</text>
|
|
|
- <text class="number-right">{{ list.data.cost_money_type }}/份</text>
|
|
|
- </view>
|
|
|
- <view class="quotient"><text class="quotient-children">每轮限购1组,每组限购一份</text></view>
|
|
|
- </view>
|
|
|
- <image :src="list.data.background_image" style="width: 635rpx; height: 170rpx; margin: 40rpx 0;" mode=""></image>
|
|
|
- <view class="shopBox-bottom">
|
|
|
- <view class="forward">
|
|
|
- <view class="forward-left"></view>
|
|
|
- <view class="forward-right">每组分数:  {{ list.data.join_number }}份</view>
|
|
|
- </view>
|
|
|
- <view class="consume">
|
|
|
- GAS消耗:
|
|
|
- <text>{{ 1 * list.data.ticket }}{{ list.data.ticket_money_type }}</text>
|
|
|
- </view>
|
|
|
- <view class="appointmentTime">
|
|
|
- 预约时间:
|
|
|
- <text>{{ item.hstart }}-{{ item.hend }}</text>
|
|
|
- </view>
|
|
|
- <view class="lotteryTime">
|
|
|
- 开奖时间:
|
|
|
- <text>{{ item.hjiang }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="btn-box flex">
|
|
|
- <view class="submit1">已开奖</view>
|
|
|
+ <text>{{ item.name }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="btn-box flex" v-if="item.type == 1" @click="buy()"><view class="submit" >预约</view></view>
|
|
|
+ <view class="btn-box flex" v-else ><view class="submit1" >{{item.type == 2 ? '待上架' : '已开奖'}}</view></view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
<u-popup v-model="show" mode="bottom" border-radius="40" height="868rpx" :closeable="true">
|
|
@@ -137,11 +58,11 @@
|
|
|
</view>
|
|
|
<view class="info-box">
|
|
|
<view class="info-left">预约金额:</view>
|
|
|
- <view class="info-right">{{money}}</view>
|
|
|
+ <view class="info-right">{{ money }}</view>
|
|
|
</view>
|
|
|
<view class="info-box">
|
|
|
<view class="info-left">预约手续费:</view>
|
|
|
- <view class="info-right">{{souxu}}</view>
|
|
|
+ <view class="info-right">{{ souxu }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="btn" @click="submit()">确定</view>
|
|
@@ -161,8 +82,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { lalaDetial,buylala } from '@/api/product.js';
|
|
|
-import {getTime} from '@/utils/rocessor.js'
|
|
|
+import { lalaDetial, buylala } from '@/api/product.js';
|
|
|
+import { getTime } from '@/utils/rocessor.js';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -171,19 +92,19 @@ export default {
|
|
|
page: 1,
|
|
|
id: '',
|
|
|
list: {
|
|
|
- data:{
|
|
|
- name:'',
|
|
|
- cost:''
|
|
|
+ data: {
|
|
|
+ name: '',
|
|
|
+ cost: ''
|
|
|
}
|
|
|
},
|
|
|
- history:false,
|
|
|
+ history: false,
|
|
|
show: false, //支付数量
|
|
|
show1: false, //支付密码
|
|
|
password: '',
|
|
|
value: 1,
|
|
|
- money:'',
|
|
|
- souxu:'',
|
|
|
- max: 1,
|
|
|
+ money: '',
|
|
|
+ souxu: '',
|
|
|
+ max: 1
|
|
|
};
|
|
|
},
|
|
|
onLoad(option) {
|
|
@@ -192,10 +113,10 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
loadData() {
|
|
|
- uni.showLoading({
|
|
|
- title:'加载中'
|
|
|
- })
|
|
|
- const obj = this
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ });
|
|
|
+ const obj = this;
|
|
|
if (obj.loding == 'nomore') {
|
|
|
return;
|
|
|
}
|
|
@@ -205,55 +126,58 @@ export default {
|
|
|
limit: obj.limit
|
|
|
},
|
|
|
obj.id
|
|
|
- ).then(({ data }) => {
|
|
|
-
|
|
|
- obj.list = data;
|
|
|
- if('history_list' in data){
|
|
|
- obj.history = true;
|
|
|
- obj.list.lun = 1*data.history_list[0].group_num+1
|
|
|
- obj.list.history_list.forEach(e => {
|
|
|
- let hjiang = getTime(e.open_time*1)
|
|
|
- let hend = getTime(e.open_time*1 - data.close_join*60);
|
|
|
- let hstart = getTime(e.open_time*1 - data.close_join*60 - 2*60*60);
|
|
|
- obj.$set(e,'hend',hend)
|
|
|
- obj.$set(e,'hstart',hstart)
|
|
|
- obj.$set(e,'hjiang',hjiang)
|
|
|
+ )
|
|
|
+ .then(({ data }) => {
|
|
|
+ let date = data.open_times[0].name.split(" ")
|
|
|
+ let start = date[0] + ' ' + data.lala_pink_open
|
|
|
+
|
|
|
+ obj.$set(data, 'start', start);
|
|
|
+ // data.open_times.filter(e => {
|
|
|
+ // return this.isToday(e.value*1000)
|
|
|
+ // })
|
|
|
+ data.open_times.forEach((e,index) => {
|
|
|
+ let end = getTime(e.value - data.close_join*60)
|
|
|
+ let type = 0
|
|
|
+
|
|
|
+ console.log();
|
|
|
+
|
|
|
+ if (e.value == data.next_pink.value){
|
|
|
+ type = 1
|
|
|
+ console.log(1)
|
|
|
+ }else if(e.value > data.next_pink.value){
|
|
|
+ type = 2
|
|
|
+ console.log(2)
|
|
|
+ }else if(e.value < data.next_pink.value){
|
|
|
+ type =3
|
|
|
+ console.log(3)
|
|
|
+ }
|
|
|
+ e.end = end
|
|
|
+ if(this.isToday(e.value*1000)){
|
|
|
+ e.ifShow = true;
|
|
|
+ }else{
|
|
|
+ e.ifShow = false;
|
|
|
+ }
|
|
|
+ e.type = type
|
|
|
})
|
|
|
- }else{
|
|
|
- obj.history = false;
|
|
|
- obj.list.lun = 1
|
|
|
- }
|
|
|
- let end = getTime(data.next_pink - data.close_join*60);
|
|
|
- let start = getTime(data.next_pink - data.close_join*60 - 2*60*60);
|
|
|
- let jiang = getTime(data.next_pink);
|
|
|
- obj.$set(obj.list,'end',end)
|
|
|
- obj.$set(obj.list,'start',start)
|
|
|
- obj.$set(obj.list,'jiang',jiang)
|
|
|
- let nend = getTime(data.next_next_pink - data.close_join*60);
|
|
|
- let nstart = getTime(data.next_next_pink - data.close_join*60 - 2*60*60);
|
|
|
- let njiang = getTime(data.next_next_pink);
|
|
|
- obj.$set(obj.list,'nend',nend)
|
|
|
- obj.$set(obj.list,'nstart',nstart)
|
|
|
- obj.$set(obj.list,'njiang',njiang)
|
|
|
- uni.hideLoading();
|
|
|
- console.log(obj.list);
|
|
|
- }).catch(e =>{
|
|
|
- console.log(e)
|
|
|
- });
|
|
|
+ obj.list = data;
|
|
|
+
|
|
|
+ console.log(obj.list)
|
|
|
+ uni.hideLoading();
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ });
|
|
|
},
|
|
|
buy() {
|
|
|
- this.money = (1*this.list.data.cost) + this.list.data.cost_money_type;
|
|
|
- this.souxu = this.list.data.ticket+this.list.data.ticket_money_type;
|
|
|
+ this.money = 1 * this.list.data.cost + this.list.data.cost_money_type;
|
|
|
+ this.souxu = this.list.data.ticket + this.list.data.ticket_money_type;
|
|
|
this.show = true;
|
|
|
},
|
|
|
- valChange(e) {
|
|
|
-
|
|
|
- },
|
|
|
+ valChange(e) {},
|
|
|
submit() {
|
|
|
- if(this.value == 0){
|
|
|
- this.$api.msg("预约份数不能为0")
|
|
|
- }
|
|
|
- else{
|
|
|
+ if (this.value == 0) {
|
|
|
+ this.$api.msg('预约份数不能为0');
|
|
|
+ } else {
|
|
|
this.show = false;
|
|
|
this.show1 = true;
|
|
|
}
|
|
@@ -263,18 +187,30 @@ export default {
|
|
|
this.show1 = false;
|
|
|
},
|
|
|
pswQd() {
|
|
|
- buylala({
|
|
|
- trade_psw: this.password
|
|
|
- },this.id).then(e => {
|
|
|
- this.password = ''
|
|
|
- this.show1 = false;
|
|
|
- console.log(e)
|
|
|
- }).catch(e => {
|
|
|
- this.password = ''
|
|
|
- this.show1 = false;
|
|
|
- console.log(e)
|
|
|
- })
|
|
|
+ buylala(
|
|
|
+ {
|
|
|
+ trade_psw: this.password
|
|
|
+ },
|
|
|
+ this.id
|
|
|
+ )
|
|
|
+ .then(e => {
|
|
|
+ this.password = '';
|
|
|
+ this.show1 = false;
|
|
|
+ console.log(e);
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.password = '';
|
|
|
+ this.show1 = false;
|
|
|
+ console.log(e);
|
|
|
+ });
|
|
|
},
|
|
|
+ isToday(str) {
|
|
|
+ if (new Date(str).toDateString() === new Date().toDateString()) {
|
|
|
+ return true
|
|
|
+ } else{
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -292,29 +228,35 @@ export default {
|
|
|
|
|
|
.shopBox-top {
|
|
|
padding-top: 26rpx;
|
|
|
- display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
-
|
|
|
- image {
|
|
|
- height: 46rpx;
|
|
|
- width: 48rpx;
|
|
|
- }
|
|
|
-
|
|
|
- #one {
|
|
|
- font-size: 34rpx;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-weight: bold;
|
|
|
- color: #0f253a;
|
|
|
- }
|
|
|
-
|
|
|
- #two {
|
|
|
- margin-left: 11rpx;
|
|
|
- font-size: 26rpx;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-weight: 500;
|
|
|
- color: #6d7c88;
|
|
|
+ .left-box {
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: center;
|
|
|
+ .left-bg {
|
|
|
+ height: 46rpx;
|
|
|
+ width: 48rpx;
|
|
|
+ image {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .one {
|
|
|
+ margin-left: 10rpx;
|
|
|
+ font-size: 34rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #0f253a;
|
|
|
+ }
|
|
|
+ .two {
|
|
|
+ margin-left: 10rpx;
|
|
|
+ font-size: 26rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #6d7c88;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
|
|
|
#three {
|
|
|
font-size: 26rpx;
|
|
@@ -387,7 +329,7 @@ export default {
|
|
|
.consume > text,
|
|
|
.appointmentTime > text,
|
|
|
.lotteryTime > text {
|
|
|
- font-size: 10rpx;
|
|
|
+ font-size: 24rpx;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 500;
|
|
|
color: #000000;
|
|
@@ -408,7 +350,7 @@ export default {
|
|
|
.submit1 {
|
|
|
width: 600px;
|
|
|
height: 70rpx;
|
|
|
- background: #ECECEC;
|
|
|
+ background: #ececec;
|
|
|
border-radius: 35rpx;
|
|
|
font-size: 32rpx;
|
|
|
font-family: PingFang SC;
|
|
@@ -480,34 +422,34 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.psw-wrapper {
|
|
|
- width: 548rpx;
|
|
|
- height: 344rpx;
|
|
|
- background-color: #FFFFFF;
|
|
|
- .psw-title {
|
|
|
- width: 100%;
|
|
|
- font-size: 35rpx;
|
|
|
- padding: 43rpx 0 49rpx;
|
|
|
- text-align: center;
|
|
|
- font-weight: 800;
|
|
|
- }
|
|
|
- .psw-ipt {
|
|
|
- display: block;
|
|
|
- background-color: #dce3ed;
|
|
|
- height: 90rpx;
|
|
|
- width: 464rpx;
|
|
|
- padding-left: 30rpx;
|
|
|
- margin: 0 auto;
|
|
|
- font-size: 80rpx;
|
|
|
- }
|
|
|
- .psw-btn text{
|
|
|
- display: inline-block;
|
|
|
- text-align: center;
|
|
|
- width: 50%;
|
|
|
- padding-top: 29rpx;
|
|
|
- font-size: 35rpx;
|
|
|
- }
|
|
|
- .psw-qd {
|
|
|
- color:#45969B;
|
|
|
- }
|
|
|
+ width: 548rpx;
|
|
|
+ height: 344rpx;
|
|
|
+ background-color: #ffffff;
|
|
|
+ .psw-title {
|
|
|
+ width: 100%;
|
|
|
+ font-size: 35rpx;
|
|
|
+ padding: 43rpx 0 49rpx;
|
|
|
+ text-align: center;
|
|
|
+ font-weight: 800;
|
|
|
+ }
|
|
|
+ .psw-ipt {
|
|
|
+ display: block;
|
|
|
+ background-color: #dce3ed;
|
|
|
+ height: 90rpx;
|
|
|
+ width: 464rpx;
|
|
|
+ padding-left: 30rpx;
|
|
|
+ margin: 0 auto;
|
|
|
+ font-size: 80rpx;
|
|
|
}
|
|
|
+ .psw-btn text {
|
|
|
+ display: inline-block;
|
|
|
+ text-align: center;
|
|
|
+ width: 50%;
|
|
|
+ padding-top: 29rpx;
|
|
|
+ font-size: 35rpx;
|
|
|
+ }
|
|
|
+ .psw-qd {
|
|
|
+ color: #45969b;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|