diff --git a/api/join.js b/api/join.js
index a32d760..3854c48 100644
--- a/api/join.js
+++ b/api/join.js
@@ -65,6 +65,11 @@ export function getHotelInfo(params) {
return request.get("merchantApply/info/hotel", params, {login: true})
}
+// 获取千县名品店铺类型列表
+export function getCountyFamousHotelType() {
+ return request.get("/countyFamous/hotelType", {}, {login: true})
+}
+
/**
* 旅居管家入驻申请详情
*/
diff --git a/api/qianxian.js b/api/qianxian.js
index 14a7f86..110268d 100644
--- a/api/qianxian.js
+++ b/api/qianxian.js
@@ -312,3 +312,7 @@ export function getCityNewsCategory() {
export function getCityShopList(params) {
return request.get('/countyFamous/hotel', params, {login: true})
}
+
+export function getCountyFamousHotelType() {
+ return request.get('/countyFamous/hotelType', {}, {login: true})
+}
diff --git a/pkg_join/views/shop.vue b/pkg_join/views/shop.vue
index c04c33e..ca8587c 100644
--- a/pkg_join/views/shop.vue
+++ b/pkg_join/views/shop.vue
@@ -175,6 +175,33 @@
+
+
+
+ *
+
+
+
+
+
+
+
+
+
@@ -316,7 +343,15 @@
*
-
+
+
{
- this.columnsType = data.hotelTypeList
+ this.hotelTypeList = data.hotelTypeList || []
+ this.columnsType = this.hotelTypeList
this.notice = data.merchantApplyNotice
- this.initInfo()
+ getCountyFamousHotelType().then(res => {
+ const listData = Array.isArray(res.data)
+ ? res.data
+ : (res.data && (res.data.hotelTypeList || res.data.list || res.data.records)) || []
+ this.countyFamousHotelTypeList = listData || []
+ this.initInfo()
+ }).catch(() => {
+ this.initInfo()
+ })
})
},
@@ -685,6 +742,10 @@ export default {
// 店铺图片
this.pics = []
this.form = data.hotelInfo
+ if (!this.form.serviceTime || !this.form.serviceEndTime) {
+ this.form.serviceTime = ''
+ this.form.serviceEndTime = ''
+ }
this.form.coverVideo = this.form.coverType === 2 ? this.form.cover : ''
const picsTemp = this.form.pics.split(',')
if (picsTemp.length > 0) {
@@ -704,7 +765,16 @@ export default {
}
})
}
- this.indexType = this.columnsType.findIndex(item => item.id === this.form.type)
+ if (this.form.isCountyFamous !== 1 && this.form.isCountyFamous !== 0) {
+ this.form.isCountyFamous = 0
+ }
+ if (this.form.isCountyFamous === 1) {
+ this.columnsType = this.countyFamousHotelTypeList
+ this.indexType = this.columnsType.findIndex(item => item.id === this.form.countyFamousHotelType)
+ } else {
+ this.columnsType = this.hotelTypeList
+ this.indexType = this.columnsType.findIndex(item => item.id === this.form.type)
+ }
if (this.indexType !== -1) {
this.form.typeText = this.columnsType[this.indexType].name
}
@@ -767,13 +837,42 @@ export default {
})
}
},
+ countyFamousChange(e) {
+ const value = parseInt(e)
+ this.form.isCountyFamous = value
+ if (value === 1) {
+ if (this.countyFamousHotelTypeList.length === 0) {
+ getCountyFamousHotelType().then(res => {
+ const listData = Array.isArray(res.data)
+ ? res.data
+ : (res.data && (res.data.hotelTypeList || res.data.list || res.data.records)) || []
+ this.countyFamousHotelTypeList = listData || []
+ this.columnsType = this.countyFamousHotelTypeList
+ })
+ } else {
+ this.columnsType = this.countyFamousHotelTypeList
+ }
+ this.indexType = 0
+ this.form.typeText = ''
+ this.form.countyFamousHotelType = null
+ } else {
+ this.columnsType = this.hotelTypeList
+ this.indexType = 0
+ this.form.typeText = ''
+ this.form.type = 0
+ }
+ },
typeChange(e) {
const idx = parseInt(e.detail.value)
this.columnsType.map((item, index) => {
if (index === idx) {
this.form.typeText = item.name
this.indexType = index
- this.form.type = item.id
+ if (this.form.isCountyFamous === 1) {
+ this.form.countyFamousHotelType = item.id
+ } else {
+ this.form.type = item.id
+ }
}
})
},
diff --git a/pkg_product/views/famousQianxianShop.vue b/pkg_product/views/famousQianxianShop.vue
index b449d69..7e48443 100644
--- a/pkg_product/views/famousQianxianShop.vue
+++ b/pkg_product/views/famousQianxianShop.vue
@@ -552,6 +552,16 @@
+
+
+ {{ type.name }}
+
+
{
this.jiaLouList = res.data.records || []
})
}
- if(index === 1) {
- const params = {
- countyFamousDataId: this.id,
- page: 1,
- limit: 9999
+ if (index === 1) {
+ this.shopTypeActive = ''
+ if (this.shopTypeList.length === 0) {
+ this.getShopTypeList()
}
- getCityShopList(params).then(res => {
- this.shopList = res.data.records || []
- })
+ this.getShopList()
}
},
+ getShopTypeList() {
+ getCountyFamousHotelType().then(res => {
+ const listData = Array.isArray(res.data)
+ ? res.data
+ : (res.data && (res.data.hotelTypeList || res.data.list || res.data.records)) || []
+ this.shopTypeList = [{ name: '全部', id: '' }].concat(listData || [])
+ })
+ },
+ getShopList() {
+ const params = {
+ countyFamousDataId: this.id,
+ countyFamousHotelType: this.shopTypeActive,
+ page: 1,
+ limit: 9999
+ }
+ getCityShopList(params).then(res => {
+ this.shopList = (res.data && (res.data.records || res.data.list)) || []
+ })
+ },
+ handleShopType(type) {
+ if (this.shopTypeActive === type.id) return
+ this.shopTypeActive = type.id
+ this.getShopList()
+ },
fileItemClick(file) {
const url = file.attachment || ''
if (!url) return