diff --git a/pages/point/detail/detail.vue b/pages/point/detail/detail.vue
index dc2028f..9408e09 100644
--- a/pages/point/detail/detail.vue
+++ b/pages/point/detail/detail.vue
@@ -8,7 +8,7 @@
- 78326478
+ {{point_data.point}}
@@ -48,15 +57,117 @@
export default {
data(){
return {
- date: ''
+ date: '',
+ nowDate: '',
+ point_data: '',
+ list: [],
+ page: 1,
+ isPage: true,
+ loadingClass: true,
+ loadingText: '正在加载中',
+ scrollH: 0,
+ nav_height: 0,
+ isRefresher: true,
+ pageSize: 10
+ }
+ },
+ computed: {
+ autoHeight(){
+ return `calc(${this.scrollH}px - ${this.nav_height}px - 660rpx)`;
}
},
onLoad(){
-
+ let info = uni.getSystemInfoSync();
+ this.scrollH = info.screenHeight;
+ var date1 = new Date();
+ var date2 = new Date(date1);
+ date2.setDate(date1.getDate());
+ this.nowDate = this.$shared.recordTime(date2, '-', 'date')
+ this.getPointNum();
+ this.getPointList();
},
methods: {
dateChange(event){
this.date = event.detail.value;
+ this.getPointList();
+ },
+ getPointNum(){
+ this.$http.get({
+ api: 'api/users/point',
+ header: {
+ Authorization: this.$cookieStorage.get('user_token')
+ }
+ }).then(res => {
+ this.point_data = res.data.data
+ console.log(this.point_data)
+ })
+ },
+ // 页面触底,加载下一页
+ onScrolltolower(){
+ if(this.isPage){
+ this.page = this.page + 1;
+ this.getPointList();
+ }
+ },
+ // 下拉刷新处理
+ refreshFn(options){
+ this.page = 1;
+ this.isPage = true;
+ this.loadingClass = true;
+ this.list = []
+ this.loadingText = '正在加载中';
+ this.getPointList(options);
+ },
+ // scroll-view 下拉刷新
+ onRefresherrefresh(){
+ this.isRefresher = true;
+ this.refreshFn({type: 'scrollRefresh'});
+ },
+ getPointList(options = {}){
+ this.$http.get({
+ api: 'api/users/point/list',
+ data: {
+ day: this.date || this.nowDate
+ },
+ header: {
+ Authorization: this.$cookieStorage.get('user_token')
+ }
+ }).then(res => {
+ console.log("----", res);
+ let isPage = this.page < res.data.meta.pagination.total_pages?true:false;
+ this.isPage = isPage;
+ if(!isPage) {
+ this.loadingClass = false;
+ this.loadingText = '没有更多数据啦~';
+ }
+ if(options.type == 'pageRefresh') {
+ uni.stopPullDownRefresh();
+ }else if(options.type == 'scrollRefresh') {
+ this.isRefresher = false;
+ }
+ if(this.page == 1) {
+ let list = res.data.data;
+ list.forEach((item,index) => {
+ if(item.value.indexOf('-') != -1) {
+ this.$set(item,'ifNegative',true)
+ }else {
+ this.$set(item,'ifNegative',false)
+ }
+ })
+ this.list = list;
+ }else {
+ let list = res.data.data;
+ list.forEach((item,index) => {
+ if(item.value.indexOf('-') != -1) {
+ this.$set(item,'ifNegative',true)
+ }else {
+ this.$set(item,'ifNegative',false)
+ }
+ })
+ this.list.push(...list);
+ }
+
+ })
}
}
}
diff --git a/pages/shop/seckillList.vue b/pages/shop/seckillList.vue
index db9c390..39747e2 100644
--- a/pages/shop/seckillList.vue
+++ b/pages/shop/seckillList.vue
@@ -1,29 +1,38 @@
-
-
-
-
- TODO已有0人购买
-
-
-
- {{ item.goods.name }}
- 距离开始还剩余 20:34:18
+
+
+
+
+
+ 已有{{item.sell_num}}人购买
-
-
- ¥{{ item.goods.max_price }}
- ¥{{ item.goods.market_price }}
+
+
+ {{ item.goods.name }}
+ 距离开始还剩余 {{item.seckill.start_left_time[0]}}天{{item.seckill.start_left_time[1]}}时{{item.seckill.start_left_time[2]}}分{{item.seckill.start_left_time[3]}}秒
+ 距离结束还剩余 {{item.seckill.end_left_time[0]}}天{{item.seckill.end_left_time[1]}}时{{item.seckill.end_left_time[2]}}分{{item.seckill.end_left_time[3]}}秒
+
+
+
+ ¥{{ item.goods.max_price }}
+ ¥{{ item.goods.market_price }}
+
+ 立即秒杀
- 立即秒杀
+
+
+ {{ loadingText }}
+
+
-
-
+
@@ -32,19 +41,71 @@
export default {
data(){
return {
- list: []
+ list: [],
+ page: 1,
+ isPage: true,
+ loadingClass: true,
+ loadingText: '正在加载中',
+ scrollH: 0,
+ nav_height: 0,
+ isRefresher: true,
+ pageSize: 10
+ }
+ },
+ computed: {
+ autoHeight(){
+ return `calc(${this.scrollH}px - ${this.nav_height}px - 180rpx)`;
}
},
onLoad(){
+ let info = uni.getSystemInfoSync();
+ this.scrollH = info.screenHeight;
this.getSeckillList();
},
methods: {
- getSeckillList(){
+ // 页面触底,加载下一页
+ onScrolltolower(){
+ if(this.isPage){
+ this.page = this.page + 1;
+ this.getMyActivity();
+ }
+ },
+ // 下拉刷新处理
+ refreshFn(options){
+ this.page = 1;
+ this.isPage = true;
+ this.loadingClass = true;
+ this.list = []
+ this.loadingText = '正在加载中';
+ this.getSeckillList(options);
+ },
+ // scroll-view 下拉刷新
+ onRefresherrefresh(){
+ this.isRefresher = true;
+ this.refreshFn({type: 'scrollRefresh'});
+ },
+ getSeckillList(options = {}){
this.$http.get({
api: 'api/seckill/all'
}).then(res => {
console.log("----", res);
- this.list = res.data.data;
+ let isPage = this.page < res.data.meta.pagination.total_pages?true:false;
+ this.isPage = isPage;
+ if(!isPage) {
+ this.loadingClass = false;
+ this.loadingText = '没有更多数据啦~';
+ }
+ if(options.type == 'pageRefresh') {
+ uni.stopPullDownRefresh();
+ }else if(options.type == 'scrollRefresh') {
+ this.isRefresher = false;
+ }
+ if(this.page == 1) {
+ this.list = res.data.data;
+ }else {
+ this.list.push(...res.data.data);
+ }
+
})
}
}
@@ -112,7 +173,7 @@
}
.desc{
width: 281rpx;
- height: 35rpx;
+ height: max-content;
border-radius: 3rpx;
background-color: #E9F2F2;
font-size: 24rpx;
@@ -120,7 +181,6 @@
display: flex;
justify-content: center;
align-items: center;
- margin-top: 10rpx;
}
.price>text:nth-child(1){
font-size: 36rpx;