diff --git a/api/qianxian.js b/api/qianxian.js index 9da7bd1..5eec447 100644 --- a/api/qianxian.js +++ b/api/qianxian.js @@ -267,3 +267,25 @@ export function getShareHousekeeper(id) { export function getJiaLouStewardDetail(id) { return request.get('/travel/steward/' + id, {}, {login: true}) } + +/** + * 获取县城资讯详情 + */ +export function getCityNewsDetail(id) { + return request.get('/countyFamous/news/' + id, {}, {login: true}) +} + + +/** + * 获取县城资讯类别 + */ +export function getCityNewsCategory() { + return request.get('/countyFamous/newsCategory', {}, {login: true}) +} + +/** + * 获取县城店铺列表 + */ +export function getCityShopList(params) { + return request.get('/countyFamous/hotel', params, {login: true}) +} diff --git a/mixins/goCartMixins.js b/mixins/goCartMixins.js index 6b84eef..3ae1a2e 100644 --- a/mixins/goCartMixins.js +++ b/mixins/goCartMixins.js @@ -14,7 +14,7 @@ export default { isOpen: false, attrTxt: '', attrValue: '', - id: null, + m_id: null, productValueArr: [], attr: { cartAttr: false, @@ -51,7 +51,7 @@ export default { } }, getSkuActiveStatus(selectedSku) { - getProductSkuBySelected({ id: this.id, selectedSku }).then(res => { + getProductSkuBySelected({ id: this.m_id, selectedSku }).then(res => { const { success, data } = res if (success) { for (const key in data) { @@ -75,7 +75,7 @@ export default { }) }, productCon() { - getProductDetail(this.id).then(res => { + getProductDetail(this.m_id).then(res => { const { data } = res this.storeInfo = {...data.storeInfo} if(data.storeInfo.stock === 0) { @@ -235,7 +235,7 @@ export default { // 点击加入购物车按钮 addToCart(item, id = 'id') { console.log(item, 'addToCart --------- item'); - this.id = item[id] + this.m_id = item[id] this.$nextTick(() => { this.productCon() @@ -259,7 +259,7 @@ export default { return } const q = { - productId: this.id, + productId: this.m_id, cartNum: this.attr.productSelect.cart_num, new: 0, uniqueId: this.attr.productSelect !== undefined ? this.attr.productSelect.unique : '' diff --git a/pages.json b/pages.json index b9c2321..05e06d0 100644 --- a/pages.json +++ b/pages.json @@ -612,6 +612,12 @@ "navigationStyle": "custom" } }, + { + "path": "views/newsInfo", + "style": { + "navigationBarTitleText": "资讯详情" + } + }, { "path": "views/famousQianxianTheme", "style": { diff --git a/pkg_common/views/message.vue b/pkg_common/views/message.vue index 366bf97..9ea2599 100644 --- a/pkg_common/views/message.vue +++ b/pkg_common/views/message.vue @@ -33,21 +33,22 @@ - {{ comment.parentReply }} - - - {{ "@" + comment.replyAt.atNickName + ' ' }} {{ comment.reply }} + + {{ comment.parentReply }} + + + + + + + {{ item.name }} + + + + @@ -222,7 +237,83 @@ :class="item.hasZan ? 'on' : ''" class="seeNum-txt" >{{ item.zan }} + + + + {{ item.replyCount || 0}} + + + + + + + + @@ -374,54 +465,24 @@ - - - - 产业项目 - - - - - - - 暂无产业项目 - - - - - + - - - - {{ tab.name }} - - - + + + + + 招商政策 + + + + 更多政策> + + + - - - 更多政策 + + - + + + + + + {{ tab.name }} + + + + + + + + + + + {{ shop.address }} + + + + + + {{ shop.content }} + + + + + {{ shop.name }} + + + + + + 暂无店铺 + + + + + + { + if(res.status === 200) { + this.newsCategoryList = [{name: '全部', id: ''}].concat(res.data || []) + } + }) + }, + changeNewsTab(index) { + if (this.newsCurrent === index) return + this.newsCurrent = index + this.getInfoReq() + }, + formatterTime(time) { + const now = new Date(); + const date = new Date(time); + const diff = now - date; + const diffMin = Math.floor(diff / 1000 / 60); + const diffHour = Math.floor(diff / 1000 / 60 / 60); + const diffDay = Math.floor(diff / 1000 / 60 / 60 / 24); + if (diffMin < 1) { + return "刚刚"; + } else if (diffHour < 1) { + return diffMin + "分钟前"; + } else if (diffDay < 1) { + return diffHour + "小时前"; + } else if (diffDay < 7) { + return diffDay + "天前"; + } else { + return date.getFullYear() + "年" + (date.getMonth() + 1) + "月" + date.getDate() + "日"; + } + }, + infoClick(info) { + this.$yrouter.push('/pkg_product/views/newsInfo?id=' + info.id) + }, showFunctionGuide() { if(this._step == this.functionGuideData.step) return if(this.functionGuideData.step == 1) { @@ -1181,10 +1366,12 @@ export default { _this.isLoadInfoListSuccess = false _this.loading = true _this.infoArray = [] + const categoryId = this.newsCategoryList[this.newsCurrent] ? this.newsCategoryList[this.newsCurrent].id : '' getCountyFamousCityNews({ page: 1, limit: 9999, - countyFamousDataId: _this.id + countyFamousDataId: _this.id, + categoryId: categoryId }).then(res => { const { data } = res _this.loading = false @@ -1345,9 +1532,6 @@ export default { }) }) }, - infoClick(info) { - // this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id) - }, coverPlay(){ this.videoPlayers.forEach(player => { const playerCtx = uni.createVideoContext(player, this) @@ -1471,6 +1655,16 @@ export default { this.jiaLouList = res.data.records || [] }) } + if(index === 1) { + const params = { + countyFamousDataId: this.id, + page: 1, + limit: 9999 + } + getCityShopList(params).then(res => { + this.shopList = res.data.records || [] + }) + } }, fileItemClick(file) { const url = file.attachment || '' @@ -1874,6 +2068,31 @@ export default { padding: 22rpx; } .info-section { + .news-category { + padding-bottom: 20rpx; + .news-category-scroll { + white-space: nowrap; + width: 100%; + } + .news-category-wrapper { + overflow: scroll; + display: flex; + justify-content: space-between; + } + .category-item { + display: inline-block; + padding: 10rpx 30rpx; + margin-right: 20rpx; + border-radius: 16rpx; + font-size: 28rpx; + font-weight: bold; + color: #333; + &.active { + color: #fff; + background: #C52733 + } + } + } .info-item + .info-item { margin: 22rpx 0 0 0; } diff --git a/pkg_product/views/newsInfo.vue b/pkg_product/views/newsInfo.vue new file mode 100644 index 0000000..1705ea6 --- /dev/null +++ b/pkg_product/views/newsInfo.vue @@ -0,0 +1,933 @@ + + + + +