From cebc13c52d4889151a5af95b02649f1799da042d Mon Sep 17 00:00:00 2001 From: chenlong Date: Wed, 13 Sep 2023 18:12:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=E8=81=94?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/other.js | 14 ++ components/FooterNav/index.vue | 5 +- pages.json | 20 ++ pages/AboutUs/AboutUs.vue | 27 +++ pages/Index/components/OrderPage/index.vue | 31 ++- pages/Index/components/UserPage/index.vue | 20 +- pages/Index/index.vue | 7 +- pages/PrivacyPolicy/PrivacyPolicy.vue | 29 +++ pages/UserCoupons/index.vue | 85 ++++--- pages/UserDetail/index.vue | 21 +- pages/UserOrderPage/components/index.scss | 224 +++++++++++++++++++ pages/UserOrderPage/index.vue | 245 +++++++++++++++++++++ utils/functions.js | 2 +- 13 files changed, 665 insertions(+), 65 deletions(-) create mode 100644 pages/AboutUs/AboutUs.vue create mode 100644 pages/PrivacyPolicy/PrivacyPolicy.vue create mode 100644 pages/UserOrderPage/components/index.scss create mode 100644 pages/UserOrderPage/index.vue diff --git a/api/other.js b/api/other.js index a904552..dd4211f 100644 --- a/api/other.js +++ b/api/other.js @@ -12,4 +12,18 @@ export function getSTS(data) { method: "get", data }); +} + +/** + * 获取配置 + * @param sign + * @returns {Promise | Promise} + */ +export function getConfig(sign){ + return request({ + url:`/get-config`, + data:{ + sign:sign + } + }) } \ No newline at end of file diff --git a/components/FooterNav/index.vue b/components/FooterNav/index.vue index 2078f1b..6de9e1c 100644 --- a/components/FooterNav/index.vue +++ b/components/FooterNav/index.vue @@ -7,7 +7,8 @@ @@ -38,7 +39,7 @@ } }, onLoad() { - + console.log(this.footGroup) }, methods: { selectItem(index){ diff --git a/pages.json b/pages.json index 5af8c8e..cb583b0 100644 --- a/pages.json +++ b/pages.json @@ -90,6 +90,26 @@ "style": { "navigationBarTitleText": "创建修改萌宠" } + }, + { + "path": "pages/UserOrderPage/index", + "style": { + "navigationBarTitleText": "我的订单" + } + }, + { + "path": "pages/PrivacyPolicy/PrivacyPolicy", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/AboutUs/AboutUs", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": true + } } ], "globalStyle": { diff --git a/pages/AboutUs/AboutUs.vue b/pages/AboutUs/AboutUs.vue new file mode 100644 index 0000000..953d5fe --- /dev/null +++ b/pages/AboutUs/AboutUs.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/pages/Index/components/OrderPage/index.vue b/pages/Index/components/OrderPage/index.vue index 3c1c03b..0b20f13 100644 --- a/pages/Index/components/OrderPage/index.vue +++ b/pages/Index/components/OrderPage/index.vue @@ -155,7 +155,9 @@ orderList:[], dayActive: 0, statusActive: 1, - page:1 + page:1, + start_time:'', + end_time:'', } }, onLoad() { @@ -176,12 +178,12 @@ }, getOrderList(filter = { status: "", - start_time: "", - end_time: "" + start_time: this.start_time, + end_time: this.end_time, }){ - filter.is_worker = this.$store.state.userInfo.store_id ? 1 : 0; + filter.is_worker = 1; filter.page = this.page++; - filter.limit = 1; + filter.limit = 5; if (this.screenCheck !== '') { filter.status = this.screenCheck; } @@ -191,13 +193,13 @@ } this.status = 'loading'; getOrderList(filter).then(data => { - this.orderList.push.apply(this.orderList,data.data); - this.orderList.push.apply(this.orderList,data.data); - if (data.data.length < filter.limit) { - this.status = 'nomore'; + if (filter.page === 1){ + this.orderList = data.data; }else{ - this.status = 'loadmore'; + this.orderList.push(...data.data); } + + this.status = data.data.length < filter.limit ? 'nomore' : 'loadmore'; }); }, dayActiveToggle(date){ @@ -205,6 +207,15 @@ this.page = 1; this.orderList = []; this.status = "loadmore"; + + let currentTime = new Date().getTime(); + let unitDay = 86400000; + let today = uni.$u.timeFormat(currentTime, 'yyyy-mm-dd'); + let tomorrow = uni.$u.timeFormat(currentTime + unitDay, 'yyyy-mm-dd'); + let acquired = uni.$u.timeFormat(currentTime + unitDay * 2, 'yyyy-mm-dd'); + this.start_time = ['', today, tomorrow][date.value]; + this.end_time = ['', tomorrow, acquired][date.value]; + this.getOrderList(); }, }, diff --git a/pages/Index/components/UserPage/index.vue b/pages/Index/components/UserPage/index.vue index 5d52a18..2f0ff4b 100644 --- a/pages/Index/components/UserPage/index.vue +++ b/pages/Index/components/UserPage/index.vue @@ -1,6 +1,6 @@