瀏覽代碼

超时团购禁用购买按钮

zhanghui 1 年之前
父節點
當前提交
41d7e73787
共有 1 個文件被更改,包括 21 次插入2 次删除
  1. 21 2
      pages/groupbuying_details/index.vue

+ 21 - 2
pages/groupbuying_details/index.vue

@@ -113,7 +113,7 @@
 												</view>
 
 												<view>
-													<u-number-box :min=0 :max="10" v-model="storeInfo.goodsList[index].num" @change="addGoodsNum"></u-number-box>
+													<u-number-box :disabled="!isShowBottom" :min=0 :max="10" v-model="storeInfo.goodsList[index].num" @change="addGoodsNum"></u-number-box>
 												</view>
 											</view>
 										</view>
@@ -141,7 +141,8 @@
 					</view>
 				</scroll-view>
 			</view>
-			<view class="footer acea-row row-between-wrapper">
+
+			<view v-if="isShowBottom" class="footer acea-row row-between-wrapper">
 				<navigator hover-class="none" class="item skeleton-rect" open-type="switchTab" url="/pages/index/index">
 					<view class="iconfont icon-shouye6"></view>
 					<view class="p_center">{{ $t(`首页`) }}</view>
@@ -337,6 +338,7 @@ export default {
 	data () {
 		let that = this;
 		return {
+			isShowBottom:true,
 			albumWidth: 0,
 			availableCheck: false,
 			addGoodPopupShow: false,
@@ -909,9 +911,26 @@ export default {
       console.log(that.id)
       detailGroupon({grouponId: that.id}).then((res) => {
         that.storeInfo = res.data
+		  this.isShowBottom = this.getIsShowBottom(res.data.grouponEndTime)
+		  console.log('+++++++++++isShowBottom++++++++++++++',this.isShowBottom)
       })
     },
 
+
+		getIsShowBottom(date){
+			let endDate = new Date(date)
+			let newDate = new Date();
+
+			console.log('+++++++++++endDate++++++++++++++',endDate)
+			console.log('+++++++++++newDate++++++++++++++',newDate)
+			console.log(newDate)
+			if (endDate.getTime() > newDate.getTime()){
+				return true
+			}else{
+				return false
+			}
+		},
+
 		/**
 		 * 获取产品详情
 		 *