|
@@ -64,6 +64,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <p class="btimap" v-if="booFetch && !item.list.length">暂无数据</p>
|
|
</van-tab>
|
|
</van-tab>
|
|
</van-tabs>
|
|
</van-tabs>
|
|
<!--选择-->
|
|
<!--选择-->
|
|
@@ -177,7 +178,8 @@
|
|
<p class="count">
|
|
<p class="count">
|
|
<span>预付:</span>
|
|
<span>预付:</span>
|
|
<span
|
|
<span
|
|
- v-if="objCurrentPlaceInfo.place_pre_type === 1">¥{{ objCurrentPlaceInfo.place_price * order_user_num | fen2Yuan
|
|
|
|
|
|
+ v-if="objCurrentPlaceInfo.place_pre_type === 1">¥{{
|
|
|
|
+ objCurrentPlaceInfo.place_price * order_user_num | fen2Yuan
|
|
}}</span>
|
|
}}</span>
|
|
<span v-else>¥{{ objCurrentPlaceInfo.place_price | fen2Yuan }}</span>
|
|
<span v-else>¥{{ objCurrentPlaceInfo.place_price | fen2Yuan }}</span>
|
|
</p>
|
|
</p>
|
|
@@ -195,9 +197,10 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { Tabs, Tab, Icon, Popup, Field, Toast, Button } from 'vant'
|
|
import { Tabs, Tab, Icon, Popup, Field, Toast, Button } from 'vant'
|
|
-import { apiBarList, apiPlaceList, apiPlacePreOrder } from './api'
|
|
|
|
|
|
+import { apiPlaceList, apiPlacePreOrder } from './api'
|
|
import { getCookieValue } from '../../../utils'
|
|
import { getCookieValue } from '../../../utils'
|
|
import { platform } from '../../../utils/platform'
|
|
import { platform } from '../../../utils/platform'
|
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'index',
|
|
name: 'index',
|
|
@@ -212,8 +215,6 @@ export default {
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
platform: platform,
|
|
platform: platform,
|
|
- BarList: [], // 门店列表
|
|
|
|
- objCurrentBarInfo: {}, // 当前门店信息
|
|
|
|
placeList: [],
|
|
placeList: [],
|
|
objCurrentPlaceInfo: {}, // 当前座位信息
|
|
objCurrentPlaceInfo: {}, // 当前座位信息
|
|
active: 0,
|
|
active: 0,
|
|
@@ -225,10 +226,14 @@ export default {
|
|
order_user_name: '', // 订单联系人姓名
|
|
order_user_name: '', // 订单联系人姓名
|
|
order_user_sex: '先生', // 订单联系人性别
|
|
order_user_sex: '先生', // 订单联系人性别
|
|
order_pay_type: 2, // 支付方式(1微信2支付宝)
|
|
order_pay_type: 2, // 支付方式(1微信2支付宝)
|
|
- booLock: false
|
|
|
|
|
|
+ booLock: false,
|
|
|
|
+ booFetch: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
|
|
+ ...mapGetters({
|
|
|
|
+ objCurrentBarInfo: 'common/objCurrentBarInfo'
|
|
|
|
+ }),
|
|
phone () {
|
|
phone () {
|
|
return this.$store.getters['common/phone'] || getCookieValue('afhousephone')
|
|
return this.$store.getters['common/phone'] || getCookieValue('afhousephone')
|
|
},
|
|
},
|
|
@@ -236,13 +241,21 @@ export default {
|
|
return this.$store.getters['common/token'] || getCookieValue('afhousetoken')
|
|
return this.$store.getters['common/token'] || getCookieValue('afhousetoken')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- created () {
|
|
|
|
|
|
+ watch: {
|
|
|
|
+ 'objCurrentBarInfo.id': {
|
|
|
|
+ immediate: true,
|
|
|
|
+ handler: function () {
|
|
|
|
+ console.log(111)
|
|
|
|
+ this.fetchPlaceList()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async created () {
|
|
if (platform.isWeixin) {
|
|
if (platform.isWeixin) {
|
|
this.order_pay_type = 1
|
|
this.order_pay_type = 1
|
|
} else if (platform.isAlipay) {
|
|
} else if (platform.isAlipay) {
|
|
this.order_pay_type = 2
|
|
this.order_pay_type = 2
|
|
}
|
|
}
|
|
- this.fetchBarList()
|
|
|
|
},
|
|
},
|
|
async mounted () {
|
|
async mounted () {
|
|
await this.$nextTick()
|
|
await this.$nextTick()
|
|
@@ -250,39 +263,24 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
handleChange () {},
|
|
handleChange () {},
|
|
- // 获取门店列表
|
|
|
|
- async fetchBarList () {
|
|
|
|
- try {
|
|
|
|
- const { data, status, msg } = await apiBarList()
|
|
|
|
- if (status) {
|
|
|
|
- this.BarList = data
|
|
|
|
- if (this.BarList.length) {
|
|
|
|
- // 暂时只有一家门店
|
|
|
|
- const { id } = this.BarList[0]
|
|
|
|
- this.bar_id = id
|
|
|
|
- this.fetchPlaceList()
|
|
|
|
- } else {
|
|
|
|
- Toast('门店不存在')
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- Toast(msg)
|
|
|
|
- }
|
|
|
|
- } catch (err) {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
// 获取订座列表
|
|
// 获取订座列表
|
|
async fetchPlaceList () {
|
|
async fetchPlaceList () {
|
|
|
|
+ const { id } = this.objCurrentBarInfo
|
|
|
|
+ if (!id) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
try {
|
|
try {
|
|
- const { data, status, msg } = await apiPlaceList(this.bar_id)
|
|
|
|
|
|
+ const { data, status, msg } = await apiPlaceList(id)
|
|
if (status) {
|
|
if (status) {
|
|
- const { bar, place } = data
|
|
|
|
- this.objCurrentBarInfo = bar
|
|
|
|
|
|
+ const { place } = data
|
|
this.placeList = place
|
|
this.placeList = place
|
|
} else {
|
|
} else {
|
|
Toast(msg)
|
|
Toast(msg)
|
|
}
|
|
}
|
|
- } catch (err) {}
|
|
|
|
|
|
+ this.booFetch = true
|
|
|
|
+ } catch (err) {
|
|
|
|
+ this.booFetch = true
|
|
|
|
+ }
|
|
},
|
|
},
|
|
handleShowPopup (place, week) {
|
|
handleShowPopup (place, week) {
|
|
if (!(this.phone && this.token)) {
|
|
if (!(this.phone && this.token)) {
|