|
@@ -114,7 +114,8 @@
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<uni-calendar @monthSwitch="chnageMonth" :date="selectDate" :selected="selected" clearDate ref="calendar"
|
|
<uni-calendar @monthSwitch="chnageMonth" :date="selectDate" :selected="selected" clearDate ref="calendar"
|
|
- :showMonth="false" style="z-index: 999;" @change="selectChange" :insert="false" @confirm="confirm" @close="closeCalendar">
|
|
|
|
|
|
+ :showMonth="false" style="z-index: 999;" @change="selectChange" :insert="false" @confirm="confirm"
|
|
|
|
+ @close="closeCalendar">
|
|
</uni-calendar>
|
|
</uni-calendar>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -188,14 +189,17 @@ export default {
|
|
title: '请选择出发日期',
|
|
title: '请选择出发日期',
|
|
icon: 'none'
|
|
icon: 'none'
|
|
});
|
|
});
|
|
- this.openCalendar()
|
|
|
|
|
|
+ this.chnageMonth({
|
|
|
|
+ year: new Date().getFullYear(),
|
|
|
|
+ month: new Date().getMonth() + 1
|
|
|
|
+ }, true)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.info.reserveTime = this.reserveTime
|
|
this.info.reserveTime = this.reserveTime
|
|
if (!this.info.realStockNum) return
|
|
if (!this.info.realStockNum) return
|
|
let that = this
|
|
let that = this
|
|
if (uni.getStorageSync('token')) {
|
|
if (uni.getStorageSync('token')) {
|
|
- if(JSON.parse(uni.getStorageSync('userInfo')).setMealCode != 0){
|
|
|
|
|
|
+ if (JSON.parse(uni.getStorageSync('userInfo')).setMealCode != 0) {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: `/study/pay/order`,
|
|
url: `/study/pay/order`,
|
|
success: function (res) {
|
|
success: function (res) {
|
|
@@ -203,22 +207,22 @@ export default {
|
|
res.eventChannel.emit('pay', that.info)
|
|
res.eventChannel.emit('pay', that.info)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
uni.showModal({
|
|
uni.showModal({
|
|
- title:'此商品需要开通会员才能购买',
|
|
|
|
- cancelText:'下次再说',
|
|
|
|
- confirmText:'立即开通',
|
|
|
|
|
|
+ title: '此商品需要开通会员才能购买',
|
|
|
|
+ cancelText: '下次再说',
|
|
|
|
+ confirmText: '立即开通',
|
|
success(res) {
|
|
success(res) {
|
|
- if(res.confirm){
|
|
|
|
|
|
+ if (res.confirm) {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url:'/my/memberCenter/index'
|
|
|
|
|
|
+ url: '/my/memberCenter/index'
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
uni.showModal({
|
|
uni.showModal({
|
|
title: '请登录',
|
|
title: '请登录',
|
|
@@ -257,9 +261,9 @@ export default {
|
|
} catch (error) {
|
|
} catch (error) {
|
|
}
|
|
}
|
|
this.info.reservationDate = content.msg
|
|
this.info.reservationDate = content.msg
|
|
- if(content.newlyTime){
|
|
|
|
|
|
+ if (content.newlyTime) {
|
|
this.selectDate = this.$u.timeFormat(new Date(content.newlyTime), 'yyyy-mm-dd')
|
|
this.selectDate = this.$u.timeFormat(new Date(content.newlyTime), 'yyyy-mm-dd')
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '无可购买日期',
|
|
title: '无可购买日期',
|
|
duration: 2000,
|
|
duration: 2000,
|
|
@@ -299,7 +303,7 @@ export default {
|
|
closeCalendar() {
|
|
closeCalendar() {
|
|
this.isSubscribe = false
|
|
this.isSubscribe = false
|
|
},
|
|
},
|
|
- selectChange({ fulldate }){
|
|
|
|
|
|
+ selectChange({ fulldate }) {
|
|
console.log(fulldate)
|
|
console.log(fulldate)
|
|
this.selectDate = fulldate
|
|
this.selectDate = fulldate
|
|
},
|
|
},
|
|
@@ -330,7 +334,7 @@ export default {
|
|
|
|
|
|
},
|
|
},
|
|
// 更改月份后获取新月份的可售卖日期
|
|
// 更改月份后获取新月份的可售卖日期
|
|
- chnageMonth({ year, month }) {
|
|
|
|
|
|
+ chnageMonth({ year, month }, open = false) {
|
|
goodsBuyStatistic({
|
|
goodsBuyStatistic({
|
|
goodsId: this.info.goodsId,
|
|
goodsId: this.info.goodsId,
|
|
year,
|
|
year,
|
|
@@ -356,6 +360,9 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+ if (open) {
|
|
|
|
+ this.openCalendar()
|
|
|
|
+ }
|
|
// this.selectDate = this.selected.find(e => !e.disable)?.date;
|
|
// this.selectDate = this.selected.find(e => !e.disable)?.date;
|
|
// console.log('this.selectDate', this.selectDate);
|
|
// console.log('this.selectDate', this.selectDate);
|
|
// if (!this.selectDate) {
|
|
// if (!this.selectDate) {
|