|
@@ -64,6 +64,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <p class="btimap" v-if="booFetch && !item.list.length">暂无数据</p>
|
|
|
</van-tab>
|
|
|
</van-tabs>
|
|
|
<!--选择-->
|
|
@@ -177,7 +178,8 @@
|
|
|
<p class="count">
|
|
|
<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 v-else>¥{{ objCurrentPlaceInfo.place_price | fen2Yuan }}</span>
|
|
|
</p>
|
|
@@ -195,9 +197,10 @@
|
|
|
|
|
|
<script>
|
|
|
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 { platform } from '../../../utils/platform'
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
|
|
|
export default {
|
|
|
name: 'index',
|
|
@@ -212,8 +215,6 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
platform: platform,
|
|
|
- BarList: [], // 门店列表
|
|
|
- objCurrentBarInfo: {}, // 当前门店信息
|
|
|
placeList: [],
|
|
|
objCurrentPlaceInfo: {}, // 当前座位信息
|
|
|
active: 0,
|
|
@@ -225,10 +226,14 @@ export default {
|
|
|
order_user_name: '', // 订单联系人姓名
|
|
|
order_user_sex: '先生', // 订单联系人性别
|
|
|
order_pay_type: 2, // 支付方式(1微信2支付宝)
|
|
|
- booLock: false
|
|
|
+ booLock: false,
|
|
|
+ booFetch: false
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ objCurrentBarInfo: 'common/objCurrentBarInfo'
|
|
|
+ }),
|
|
|
phone () {
|
|
|
return this.$store.getters['common/phone'] || getCookieValue('afhousephone')
|
|
|
},
|
|
@@ -236,13 +241,21 @@ export default {
|
|
|
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) {
|
|
|
this.order_pay_type = 1
|
|
|
} else if (platform.isAlipay) {
|
|
|
this.order_pay_type = 2
|
|
|
}
|
|
|
- this.fetchBarList()
|
|
|
},
|
|
|
async mounted () {
|
|
|
await this.$nextTick()
|
|
@@ -250,39 +263,24 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
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 () {
|
|
|
+ const { id } = this.objCurrentBarInfo
|
|
|
+ if (!id) {
|
|
|
+ return
|
|
|
+ }
|
|
|
try {
|
|
|
- const { data, status, msg } = await apiPlaceList(this.bar_id)
|
|
|
+ const { data, status, msg } = await apiPlaceList(id)
|
|
|
if (status) {
|
|
|
- const { bar, place } = data
|
|
|
- this.objCurrentBarInfo = bar
|
|
|
+ const { place } = data
|
|
|
this.placeList = place
|
|
|
} else {
|
|
|
Toast(msg)
|
|
|
}
|
|
|
- } catch (err) {}
|
|
|
+ this.booFetch = true
|
|
|
+ } catch (err) {
|
|
|
+ this.booFetch = true
|
|
|
+ }
|
|
|
},
|
|
|
handleShowPopup (place, week) {
|
|
|
if (!(this.phone && this.token)) {
|