Commit 54a40cf4 authored by 潘永坪's avatar 潘永坪

格式统一

parent 51611c38
...@@ -364,7 +364,6 @@ export default { ...@@ -364,7 +364,6 @@ export default {
} }
this.scenicList=[] this.scenicList=[]
this.$request('/scenic/groupGood/findGroupGoodProductList', data).then(res => { this.$request('/scenic/groupGood/findGroupGoodProductList', data).then(res => {
uni.hideLoading()
if (res.code == '00') { if (res.code == '00') {
let merchantList=res.data.merchantList||[] let merchantList=res.data.merchantList||[]
merchantList.forEach(item=>{ merchantList.forEach(item=>{
...@@ -414,8 +413,6 @@ export default { ...@@ -414,8 +413,6 @@ export default {
icon: 'none' icon: 'none'
}) })
} }
}).catch(err => {
uni.hideLoading()
}) })
}, },
//---初始化详情 //---初始化详情
......
...@@ -501,61 +501,53 @@ export default { ...@@ -501,61 +501,53 @@ export default {
latitude, latitude,
longitude longitude
} }
uni.showLoading({ this.$request('/scenic/groupGood/getGroupProducts', data).then(res => {
title: '加载中' if (res.code == '00') {
}) this.scenicList = res.data.merchantList || []
this.$request('/scenic/groupGood/getGroupProducts', data) this.groupId = res.data.groupId || ''
.then(res => { this.groupChannelId = res.data.groupChannelId || ''
uni.hideLoading() this.scenicList.forEach((item, index) => {
if (res.code == '00') { //获取当前景区图片,把当前景区放在第一位
this.scenicList = res.data.merchantList || [] if (item.id == this.merchantId) {
this.groupId = res.data.groupId || '' this.imgList = item.imgList
this.groupChannelId = res.data.groupChannelId || '' this.scenicList.splice(index, 1)
this.scenicList.forEach((item, index) => { this.scenicList.unshift(item)
//获取当前景区图片,把当前景区放在第一位 item.productListCopy = item.productList
if (item.id == this.merchantId) { } else {
this.imgList = item.imgList item.productListCopy = item.productList.slice(0, 2)
this.scenicList.splice(index, 1) }
this.scenicList.unshift(item) //预订时间为当天时,当前时间大于最早预订时间显示未开售,当前时间大于最晚预订时间显示已售罄
item.productListCopy = item.productList let times = new Date().Format('hh:mm:ss')
} else { let timeNumber = parseInt(this.$commonjs.changeTime(times)) //将当前时间转化为数字
item.productListCopy = item.productList.slice(0, 2) item.productList.forEach(item2 => {
} item2.timeNumber1 = parseInt(this.$commonjs.changeTime(item2.earlyBookTime))
//预订时间为当天时,当前时间大于最早预订时间显示未开售,当前时间大于最晚预订时间显示已售罄 item2.timeNumber2 = parseInt(this.$commonjs.changeTime(item2.bookTime))
let times = new Date().Format('hh:mm:ss') if (item2.aheadBookDays == 0) {
let timeNumber = parseInt(this.$commonjs.changeTime(times)) //将当前时间转化为数字 if (item2.status == 2) {
item.productList.forEach(item2 => { item2.statusName = '已售罄'
item2.timeNumber1 = parseInt(this.$commonjs.changeTime(item2.earlyBookTime)) } else {
item2.timeNumber2 = parseInt(this.$commonjs.changeTime(item2.bookTime)) if (timeNumber < item2.timeNumber1) {
if (item2.aheadBookDays == 0) { item2.status = 2
if (item2.status == 2) { item2.statusName = '未开售'
}
if (timeNumber > item2.timeNumber2) {
item2.status = 2
item2.statusName = '已售罄' item2.statusName = '已售罄'
} else {
if (timeNumber < item2.timeNumber1) {
item2.status = 2
item2.statusName = '未开售'
}
if (timeNumber > item2.timeNumber2) {
item2.status = 2
item2.statusName = '已售罄'
}
} }
} }
}) }
})
this.$nextTick(() => {
this.countSwiper()
})
} else {
uni.showToast({
title: res.message,
icon: 'none'
}) })
} })
}) this.$nextTick(() => {
.catch(err => { this.countSwiper()
uni.hideLoading() })
}) } else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
}, },
//---跳转填写订单页面 //---跳转填写订单页面
goFillorder() { goFillorder() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment