Browse Source

酒景购物车

master
jiazhipeng 2 years ago
parent
commit
898bba7a14
  1. 9
      pages/info/postProductInfo/index.wxml
  2. 16
      pages/order/components/date/index.js
  3. 22
      pages/order/scene/index.js

9
pages/info/postProductInfo/index.wxml

@ -126,18 +126,15 @@
</view>
</view>
<view class="btns" wx:if="{{info&&info.is_package}}">
<view class="btn" style="border-radius: 39rpx;" bindtap="showOrder" wx:if="{{info && info.flag==1}}">立即购买</view>
<view class="btn disable" style="border-radius: 39rpx;" wx:elif="{{info}}">该商品已下架</view>
</view>
<view class="btns" wx:if="{{info&&!info.is_package}}">
<view class="btns">
<view class="btn" bindtap="showCart">加入购物车</view>
<view class="btn" bindtap="showOrder" wx:if="{{info && info.flag==1}}">立即购买</view>
<view class="btn disable" wx:elif="{{info}}">该商品已下架</view>
</view>
</view>
<!-- 购物车悬浮框 -->
<navigator wx:if="{{!info.is_package}}" url="/pages/user/cartlist/list" catchtap="pagePoint" data-event='product_cart_click' class="cart-box" id="cart">
<navigator url="/pages/user/cartlist/list" catchtap="pagePoint" data-event='product_cart_click' class="cart-box" id="cart">
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/cart.png" mode="widthFix"></image>
<view class="cart-num">{{cartCount}}</view>
</navigator>

16
pages/order/components/date/index.js

@ -118,14 +118,16 @@ Component({
})
let seldDate = ''
if (app.globalData.product.changeFlag) {
res.data.forEach(item=> {
if (item.date == app.globalData.product.date.date) {
seldDate = item
if( app.globalData.product.date) {
res.data.forEach(item=> {
if (item.date == app.globalData.product.date.date) {
seldDate = item
}
})
}
})
setTimeout(() => {
this.changeDate(seldDate)
})
setTimeout(() => {
this.changeDate(seldDate)
})
// this.setData({
// activeDate:seldDate
// })

22
pages/order/scene/index.js

@ -66,7 +66,7 @@ Page({
is_authentication:app.globalData.product.sku.sku_model.is_authentication,
is_real_name:app.globalData.product.sku.sku_model.is_real_name,
date: app.globalData.product.date,
time: app.globalData.product.time,
time: app.globalData.product.time || {},
showYhq:app.globalData.listName?false:true
})
console.log('-------',this.data.showYhq,this.data.time);
@ -74,11 +74,13 @@ Page({
console.log('-------',app.globalData.product.sku.sku_model.is_need_idcard);
console.log('---是否实名----',app.globalData.product.sku.sku_model.is_authentication);
console.log('---一证一票----',app.globalData.product.sku.sku_model.is_real_name);
if (!app.globalData.product) {
util.back();
return;
}
if (!app.globalData.product.time) {
app.globalData.product.time = {}
}
if (app.globalData.product.productNum) {
this.setData({
productNum: app.globalData.product.productNum < 1 ? 1 : app.globalData.product.productNum
@ -421,6 +423,22 @@ Page({
return
}
}
// 判断时间日期
if (!date && this.data.ticket_type == 1) {
wx.showToast({
title: '请选择使用日期',
icon: 'none'
})
return
}
if (!time && date && date.is_time_stock == true) {
wx.showToast({
title: '请选择使用时间',
icon: 'none'
})
return
}
let data = {
coupon_id: this.data.coupon ? this.data.coupon.id : null,
source: "WECHATXCX",

Loading…
Cancel
Save