From cace1ce69d76fe7f8d694edcf4701d2dcdd24646 Mon Sep 17 00:00:00 2001
From: Enzo <1284707383@qq.com>
Date: Fri, 24 Sep 2021 14:07:16 +0800
Subject: [PATCH] =?UTF-8?q?=E7=A7=AF=E5=88=86=E5=88=97=E8=A1=A8/=E7=A7=AF?=
=?UTF-8?q?=E5=88=86=E4=BD=99=E9=A2=9D/=E7=A7=92=E6=9D=80=E5=95=86?=
=?UTF-8?q?=E5=93=81=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/js/config.js | 2 +-
pages/point/detail/detail.vue | 110 ++++++++++++++++++++++++++++++----
pages/shop/seckillList.vue | 106 +++++++++++++++++++++++++-------
3 files changed, 182 insertions(+), 36 deletions(-)
diff --git a/common/js/config.js b/common/js/config.js
index 8c40c53..4279dca 100644
--- a/common/js/config.js
+++ b/common/js/config.js
@@ -16,7 +16,7 @@ export default {
//https://demo-guojiang-ec-api.guojiang.club/
baseUrl: process.env.NODE_ENV === 'development' ?
- 'http://192.168.3.29/' : 'https://v3-ec-admin-dev.guojiang.club/', // 运行时自动替换变量
+ 'http://192.168.3.81/' : 'https://v3-ec-admin-dev.guojiang.club/', // 运行时自动替换变量
},
PACKAGES: {
activity: false,
diff --git a/pages/point/detail/detail.vue b/pages/point/detail/detail.vue
index dc2028f..12690d8 100644
--- a/pages/point/detail/detail.vue
+++ b/pages/point/detail/detail.vue
@@ -8,7 +8,7 @@
- 78326478
+ {{point_data.point}}
-
-
- {{ index % 2 ? '-250' : '+80' }}
- 2021-09-01 18:27:58
-
-
- 商城内消费
-
-
+
+
+
+ {{ index % 2 ? '-250' : '+80' }}
+ 2021-09-01 18:27:58
+
+
+ 商城内消费
+
+
+
+
+ {{ loadingText }}
+
+
+
@@ -48,15 +57,92 @@
export default {
data(){
return {
- date: ''
+ date: '',
+ 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;
+ this.getPointNum();
+ this.getPointList();
},
methods: {
dateChange(event){
this.date = event.detail.value;
+ },
+ 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.getMyActivity();
+ }
+ },
+ // 下拉刷新处理
+ 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',
+ 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) {
+ this.list = res.data.data;
+ }else {
+ this.list.push(...res.data.data);
+ }
+
+ })
}
}
}
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;