From 499e036b5d8a4df2ac0f7531f9bce7b883dbe3f3 Mon Sep 17 00:00:00 2001
From: liudan <18634735655@163.com>
Date: Tue, 17 Oct 2023 16:02:17 +0800
Subject: [PATCH] 1
---
pages/qianggou/productDetails.vue | 77 ++++++++++++++++++-
pages/warehouse/buy.vue | 5 +-
unpackage/dist/build/h5/index.html | 2 +-
.../{index.08e28b8c.js => index.47f3836d.js} | 2 +-
.../pages-qianggou-productDetails.3b784f92.js | 1 +
.../pages-qianggou-productDetails.a9b84d55.js | 1 -
.../static/js/pages-warehouse-buy.2c2494f3.js | 1 +
.../static/js/pages-warehouse-buy.d3d9769d.js | 1 -
8 files changed, 81 insertions(+), 9 deletions(-)
rename unpackage/dist/build/h5/static/js/{index.08e28b8c.js => index.47f3836d.js} (99%)
create mode 100644 unpackage/dist/build/h5/static/js/pages-qianggou-productDetails.3b784f92.js
delete mode 100644 unpackage/dist/build/h5/static/js/pages-qianggou-productDetails.a9b84d55.js
create mode 100644 unpackage/dist/build/h5/static/js/pages-warehouse-buy.2c2494f3.js
delete mode 100644 unpackage/dist/build/h5/static/js/pages-warehouse-buy.d3d9769d.js
diff --git a/pages/qianggou/productDetails.vue b/pages/qianggou/productDetails.vue
index 8adb2f7..d896081 100644
--- a/pages/qianggou/productDetails.vue
+++ b/pages/qianggou/productDetails.vue
@@ -43,9 +43,12 @@
-
@@ -72,18 +75,86 @@ export default {
updatetime:null,
warehouse_id:null,
},
+ secondNum:"",
+ isDeadLine:true,
+ timer:null,
};
},
onLoad(params) {
- this.getDetailsHandle(params.id)
+ this.getDetailsHandle(params.id);
+
+ },
+ beforeDestroy(){
+ clearImmediate(this.timer)
+ this.timer = null;
},
-
methods: {
+ dateDifference(expire_time){//返回秒数
+ var timestamp = Date.parse(new Date());//当前时间
+ timestamp=timestamp/1000;
+ expire_time=parseInt(expire_time/1000);//过期时间
+ return expire_time-timestamp;
+ },
+ // dateCalculation (second) { //返回天、时、分
+ // if (second > 0) {
+ // var day = 0;
+ // var hour = 0;
+ // var minute = 0;
+ // var secondNum = 0;
+ // var data = {};
+ // minute = Math.floor(second / (60))
+ // if (parseInt(secondNum) > 60) {
+ // minute = parseInt(secondNum / 60);
+ // minute %= 60; //算出有多分钟
+ // }
+ // if (parseInt(minute) > 60) {
+ // hour = parseInt(minute / 60);
+ // minute %= 60; //算出有多分钟
+ // }
+ // if (parseInt(hour) > 24) {
+ // day = parseInt(hour / 24);
+ // hour %= 24; //算出有多分钟
+ // }
+ // data.day = day;
+ // data.hour = hour;
+ // data.minute = minute;
+ // return data;
+ // }
+ // },
+ timestampToTime(val) {
+ var date = new Date();
+ var Y = date.getFullYear() + '-';
+ var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1):date.getMonth()+1) + '-';
+ var D = (date.getDate()< 10 ? '0'+date.getDate():date.getDate())+ ' ';
+ var h = (date.getHours() < 10 ? '0'+date.getHours():date.getHours())+ ':';
+ var m = (date.getMinutes() < 10 ? '0'+date.getMinutes():date.getMinutes()) + ':';
+ var s = date.getSeconds() < 10 ? '0'+date.getSeconds():date.getSeconds();
+ if(val){
+ return Y+M+D+h+m+s;
+ }else{
+ return Y+M+D;
+ }
+ },
+
getDetailsHandle(id){
getgoodsDetail({id:id,custom: { auth: true }}).then(res=>{
this.swiperList.push({
url: res.data.image
})
+ let timeNum = res.data.warehouse.start
+ // let timeNum = "16:02";
+ let time = this.timestampToTime()+timeNum+":00"
+ let finishTime = this.dateDifference(new Date(time).getTime())
+ if(finishTime>0){
+ this.timer = setInterval(()=>{
+ this.secondNum = finishTime--
+ },1000)
+ this.isDeadLine = false;
+ }else{
+ clearImmediate(this.timer)
+ this.timer = null;
+ this.isDeadLine = true;
+ }
this.detailsObj = Object.assign({},this.detailsObj,res.data)
})
},
diff --git a/pages/warehouse/buy.vue b/pages/warehouse/buy.vue
index 149681a..f792cdb 100644
--- a/pages/warehouse/buy.vue
+++ b/pages/warehouse/buy.vue
@@ -286,9 +286,10 @@
})
},
tiquconfirmHandle(){
+ console.log(this.tiquSelected)
let params={
- pay_voucher:this.tiquSelected.id,
- id:item.id,
+ pay_voucher:this.tiquSelected.pay_voucher,
+ id:this.tiquSelected.id,
status:4
}
orderPay(params).then(res=>{
diff --git a/unpackage/dist/build/h5/index.html b/unpackage/dist/build/h5/index.html
index c7889b3..acd271c 100644
--- a/unpackage/dist/build/h5/index.html
+++ b/unpackage/dist/build/h5/index.html
@@ -1,2 +1,2 @@
商城
\ No newline at end of file
+ document.write('')