1305 lines
28 KiB
Vue
1305 lines
28 KiB
Vue
|
<template>
|
||
|
<view class="Circle_friends">
|
||
|
<view class="circle_friends_wrapper">
|
||
|
<view v-if="isFshow">
|
||
|
<view class="site-box flex_a_c_j_sb" :style="{ 'opacity': backColor,}">
|
||
|
<view :class="['place_wrapper', 'flex_a_c', isFshow ? 'sitebox' : '']" @click="selectLocation">
|
||
|
<view :class="['iconfont', 'icon-weizhi', isFshow ? 'sitebox' : '']"
|
||
|
style=" margin-left: 20rpx">
|
||
|
</view>
|
||
|
<view class="town_name">{{ street }}</view>
|
||
|
</view>
|
||
|
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
|
||
|
<view :class="['iconfont', 'icon-xiaoxi', isFshow ? 'sitebox' : '']"></view>
|
||
|
</navigator>
|
||
|
</view>
|
||
|
<!--<view class="site-box ','flex_a_c_j_sb'" v-if="ishshow">
|
||
|
<view class="bg-img">
|
||
|
<img :src="bgColor" alt="">
|
||
|
</view>
|
||
|
</view> -->
|
||
|
</view>
|
||
|
<view class="" v-if="!isFshow">
|
||
|
<view class="site-box1 flex_a_c_j_sb">
|
||
|
|
||
|
<view class="place_wrapper flex_a_c" @click="selectLocation">
|
||
|
<view class="iconfont icon-weizhi"></view>
|
||
|
<view class="town_name">{{street}}</view>
|
||
|
</view>
|
||
|
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none" >
|
||
|
<view class="iconfont icon-xiaoxi" style="color:#fff;"> </view>
|
||
|
</navigator>
|
||
|
</view>
|
||
|
</view>
|
||
|
|
||
|
|
||
|
<zbpSwiper ref="list" :isSelectPlace="true" :town="street" :show="show" :location_Arr="locationArr"
|
||
|
@change="dchange">
|
||
|
</zbpSwiper>
|
||
|
|
||
|
|
||
|
|
||
|
<view class="tabs_wrapper">
|
||
|
<!-- <u-tabs :list="tabsData.list" @click="tabsChange" lineColor="#F84221" keyName="cate_name"
|
||
|
:activeStyle="activeStyle" itemStyle="padding-left: 0px; height: 33px;"></u-tabs>
|
||
|
<view class="tabs_wrapper-img">
|
||
|
<image src="@/static/images/zk.png" mode=""></image>
|
||
|
</view> -->
|
||
|
|
||
|
<view class="" style="width: 670rpx;">
|
||
|
<u-tabs :list="tabsData.list" @click="tabsChange" itemStyle=" height: 33px;" lineColor="#F84221"
|
||
|
:current="current" keyName="cate_name" :activeStyle="activeStyle"></u-tabs>
|
||
|
</view>
|
||
|
<view class="tabs_wrapper-img" @click="open">
|
||
|
<image src="@/static/images/zk.png" mode=""></image>
|
||
|
</view>
|
||
|
</view>
|
||
|
<view class=""> </view>
|
||
|
<view class="goodslist">
|
||
|
<WaterfallsFlow :wfList="productList" @itemTap='itemTap' :type="1" />
|
||
|
</view>
|
||
|
<view class='loadingicon acea-row row-center-wrapper' v-if='productList.length > 0'>
|
||
|
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
|
||
|
</view>
|
||
|
<view class="empty_wrapper" v-if="emptyShow">
|
||
|
<u-empty :show="emptyShow" mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png"></u-empty>
|
||
|
</view>
|
||
|
</view>
|
||
|
|
||
|
<u-picker :defaultIndex="[0, 0]" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm"
|
||
|
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker>
|
||
|
|
||
|
<!-- <view class="bg_color"></view> -->
|
||
|
|
||
|
<!--<m-tabbar native>
|
||
|
<template v-slot:tabbar_index_2>
|
||
|
<view class="custom_style">
|
||
|
<view class="custom_style_icon"></view>
|
||
|
<view class="custom_style-txt" style="color: #282828;">
|
||
|
发布
|
||
|
</view>
|
||
|
</view>
|
||
|
</template>
|
||
|
</m-tabbar> -->
|
||
|
|
||
|
<uni-popup ref="popup" type="bottom">
|
||
|
|
||
|
<view class="classpage">
|
||
|
<view class="classpage-one">
|
||
|
全部分类
|
||
|
<image src="@/static/images/cuo.png" mode="" @click="cuo"></image>
|
||
|
</view>
|
||
|
<view class="classpage-two">
|
||
|
点击进入分类
|
||
|
</view>
|
||
|
<view class="classpage-three">
|
||
|
<view class="" v-for="(item,i) in tabsData.list" :key='i' @click="tabsChange2(item,i)">
|
||
|
{{item.cate_name}}
|
||
|
</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
</uni-popup>
|
||
|
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"
|
||
|
:isGoIndex="false"></authorize>
|
||
|
<view class="location" v-if="isshow">
|
||
|
<view class="locationa"> 位置权限使用说明 </view>
|
||
|
<view class="locationb"> 用于向你推荐最近门店 </view>
|
||
|
</view>
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import mTabbar from '@/components/m-tabbar/m-tabbar.vue'
|
||
|
import zbpSwiper from '@/components/zbpSwiper'
|
||
|
import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue';
|
||
|
import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlows.vue'
|
||
|
import authorize from '@/components/Authorize';
|
||
|
import {
|
||
|
getUserInfo
|
||
|
} from '@/api/user.js';
|
||
|
import {
|
||
|
getSlideAPI
|
||
|
} from '@/api/lihai.js'
|
||
|
import {
|
||
|
graphicLstApi,
|
||
|
getTopicList,
|
||
|
graphicStartApi
|
||
|
} from '@/api/community.js'
|
||
|
import {
|
||
|
getIndexData,
|
||
|
getDiy,
|
||
|
getArticleList,
|
||
|
getArticleCategoryLists
|
||
|
} from '@/api/api.js'
|
||
|
import {
|
||
|
getGeocoder,
|
||
|
merClassifly
|
||
|
} from '@/api/store.js';
|
||
|
import {
|
||
|
getArea,
|
||
|
getStreet
|
||
|
} from '@/api/article.js';
|
||
|
import {
|
||
|
Toast
|
||
|
} from '@/libs/uniApi'
|
||
|
export default {
|
||
|
components: {
|
||
|
mTabbar,
|
||
|
zbpSwiper,
|
||
|
easyLoadimage,
|
||
|
WaterfallsFlow,
|
||
|
authorize
|
||
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
|
||
|
isAuto: false, //没有授权的不会自动授权
|
||
|
isShowAuth: false, //是否隐藏授权
|
||
|
activeStyle: {
|
||
|
color: '#333333',
|
||
|
fontWeight: 'bold',
|
||
|
transform: 'scale(1.04)'
|
||
|
},
|
||
|
isshow: false,
|
||
|
locationArr: ({}),
|
||
|
bgColor: '',
|
||
|
showPicker: false,
|
||
|
columnData: [],
|
||
|
show: false,
|
||
|
tabsData: {
|
||
|
list: [],
|
||
|
tabsActive: 0
|
||
|
},
|
||
|
tabsData1: {
|
||
|
list: [],
|
||
|
tabsActive: 0
|
||
|
},
|
||
|
where: {
|
||
|
category_id: 0,
|
||
|
page: 1,
|
||
|
limit: 10
|
||
|
},
|
||
|
loadend: false,
|
||
|
loading: false,
|
||
|
loadTitle: '加载更多',
|
||
|
currentItemId: 69, // 默认获取 社区的数据 0 表示推荐 || 69 社区
|
||
|
keyword: '',
|
||
|
location: '',
|
||
|
emptyShow: false,
|
||
|
street: '',
|
||
|
productList: [],
|
||
|
recoList: [],
|
||
|
articleList: [],
|
||
|
streeta_id: '',
|
||
|
street: '',
|
||
|
bgColor: '',
|
||
|
backColor: 0,
|
||
|
isFshow: false,
|
||
|
scrollTop: 0,
|
||
|
show: true,
|
||
|
userid: '',
|
||
|
current: 0
|
||
|
}
|
||
|
},
|
||
|
|
||
|
onPullDownRefresh() {
|
||
|
this.getCateList()
|
||
|
this.getGoods(true)
|
||
|
this.Area()
|
||
|
uni.stopPullDownRefresh()
|
||
|
},
|
||
|
|
||
|
onLoad() {
|
||
|
this.selfLocation()
|
||
|
this.getCateList()
|
||
|
//this.getArticle()
|
||
|
this.getGoods(true)
|
||
|
this.Area()
|
||
|
//this.setPermissions()
|
||
|
// this.openTongZhi()
|
||
|
|
||
|
},
|
||
|
|
||
|
onTabItemTap(e) {
|
||
|
uni.pageScrollTo({
|
||
|
selector: ".Circle_friends",
|
||
|
scrollTop: 0
|
||
|
})
|
||
|
|
||
|
},
|
||
|
onHide() {
|
||
|
|
||
|
uni.setTabBarItem({
|
||
|
index: 0,
|
||
|
text: "泸州",
|
||
|
iconPath: '/static/tabbar_icon/a.png',
|
||
|
selectedIconPath: '/static/tabbar_icon/a-a.png'
|
||
|
});
|
||
|
this.isFshow = false
|
||
|
|
||
|
},
|
||
|
onReachBottom() {
|
||
|
|
||
|
if (this.productList.length > 0) {
|
||
|
setTimeout(() => {
|
||
|
this.getGoods(false);
|
||
|
}, 1000)
|
||
|
}
|
||
|
|
||
|
},
|
||
|
|
||
|
mounted() {
|
||
|
this.getUserInfo()
|
||
|
|
||
|
|
||
|
this.selfLocation()
|
||
|
// #ifdef H5
|
||
|
// 监听页面滚动事件
|
||
|
window.addEventListener("scroll", this.scrolling);
|
||
|
// #endif
|
||
|
|
||
|
this.$bus.$on('value-updated', (newValue) => {
|
||
|
// 更新父组件的值
|
||
|
this.street = newValue.split(',')[0]
|
||
|
});
|
||
|
|
||
|
},
|
||
|
|
||
|
// #ifdef APP-PLUS
|
||
|
onPageScroll(e) {
|
||
|
|
||
|
const scrollTop = e.scrollTop;
|
||
|
|
||
|
// 导航条颜色透明渐变
|
||
|
|
||
|
if (scrollTop <= 20) {
|
||
|
this.backColor = 0
|
||
|
this.isFshow = false
|
||
|
this.show = true
|
||
|
uni.setTabBarItem({
|
||
|
index: 0,
|
||
|
text: "泸州",
|
||
|
iconPath: '/static/tabbar_icon/a.png',
|
||
|
selectedIconPath: '/static/tabbar_icon/a-a.png'
|
||
|
});
|
||
|
} else if (20 < scrollTop && scrollTop <= 100) {
|
||
|
this.backColor = 0.5
|
||
|
this.isFshow = true
|
||
|
this.show = false
|
||
|
} else if (scrollTop > 100) {
|
||
|
this.backColor = 1
|
||
|
this.isFshow = true
|
||
|
this.show = false
|
||
|
this.$nextTick(() => {
|
||
|
uni.setTabBarItem({
|
||
|
index: 0,
|
||
|
text: '返回顶部',
|
||
|
iconPath: '/static/tabbar_icon/top.png',
|
||
|
selectedIconPath: '/static/tabbar_icon/top.png'
|
||
|
});
|
||
|
})
|
||
|
}
|
||
|
|
||
|
|
||
|
},
|
||
|
// #endif
|
||
|
beforeDestroy() {
|
||
|
// 销毁监听事件
|
||
|
this.$bus.$off('value-updated')
|
||
|
},
|
||
|
methods: {
|
||
|
//弹出
|
||
|
open() {
|
||
|
this.$refs.popup.open()
|
||
|
},
|
||
|
//隐藏
|
||
|
cuo() {
|
||
|
this.$refs.popup.close()
|
||
|
},
|
||
|
// 授权回调
|
||
|
onLoadFun(data) {
|
||
|
this.getUserInfo();
|
||
|
this.isShowAuth = false;
|
||
|
},
|
||
|
/**
|
||
|
* 获取个人用户信息
|
||
|
*/
|
||
|
getUserInfo() {
|
||
|
getUserInfo().then(res => {
|
||
|
this.userid = res.data.uid
|
||
|
});
|
||
|
},
|
||
|
//分栏视频 图文查看
|
||
|
itemTap(item) {
|
||
|
|
||
|
if (this.userid) {
|
||
|
if (item.video_link.length > 0) {
|
||
|
uni.navigateTo({
|
||
|
// #ifdef MP || H5
|
||
|
url: `/pages/short_video/nvueSwiper/index?id=${item.community_id}&uid=${this.userid}&user=1`
|
||
|
// #endif
|
||
|
// #ifdef APP
|
||
|
url: `/pages/short_video/appSwiper/index?id=${item.community_id}&uid=${this.userid}&user=1`
|
||
|
// #endif
|
||
|
})
|
||
|
} else {
|
||
|
uni.navigateTo({
|
||
|
url: `/pages/plantGrass/plant_detail/index?id=${item.community_id}`
|
||
|
})
|
||
|
}
|
||
|
} else {
|
||
|
this.isAuto = true;
|
||
|
this.isShowAuth = true
|
||
|
}
|
||
|
|
||
|
},
|
||
|
// 授权关闭
|
||
|
authColse: function(e) {
|
||
|
this.isShowAuth = e
|
||
|
},
|
||
|
scrolling() {
|
||
|
// 滚动条距文档顶部的距离
|
||
|
let scrollTop =
|
||
|
window.pageYOffset ||
|
||
|
document.documentElement.scrollTop ||
|
||
|
document.body.scrollTop;
|
||
|
// 滚动条滚动的距离
|
||
|
let scrollStep = scrollTop - this.oldScrollTop;
|
||
|
// console.log("header 滚动距离 ", scrollTop);
|
||
|
// 更新——滚动前,滚动条距文档顶部的距离
|
||
|
this.oldScrollTop = scrollTop;
|
||
|
//变量windowHeight是可视区的高度
|
||
|
let windowHeight =
|
||
|
document.documentElement.clientHeight || document.body.clientHeight;
|
||
|
//变量scrollHeight是滚动条的总高度
|
||
|
let scrollHeight =
|
||
|
document.documentElement.scrollHeight || document.body.scrollHeight;
|
||
|
|
||
|
//滚动条到底部的条件
|
||
|
if (scrollTop + windowHeight == scrollHeight) {
|
||
|
//你想做的事情
|
||
|
// console.log("header 你已经到底部了");
|
||
|
}
|
||
|
if (scrollTop <= 20) {
|
||
|
this.backColor = 0
|
||
|
this.isFshow = false
|
||
|
uni.setTabBarItem({
|
||
|
index: 0,
|
||
|
text: "泸州",
|
||
|
iconPath: '/static/tabbar_icon/a.png',
|
||
|
selectedIconPath: '/static/tabbar_icon/a-a.png'
|
||
|
});
|
||
|
} else if (20 < scrollTop && scrollTop <= 100) {
|
||
|
this.backColor = 0.5
|
||
|
this.isFshow = true
|
||
|
} else if (scrollTop > 100) {
|
||
|
this.backColor = 1
|
||
|
this.isFshow = true
|
||
|
|
||
|
uni.setTabBarItem({
|
||
|
index: 0,
|
||
|
text: '返回顶部',
|
||
|
iconPath: '/static/tabbar_icon/top.png',
|
||
|
selectedIconPath: '/static/tabbar_icon/top.png'
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
},
|
||
|
|
||
|
tabsChange1(item) {
|
||
|
|
||
|
this.getArticleList(item.article_category_id)
|
||
|
this.streeta_id = item.id
|
||
|
this.tabsData1.tabsActive = item.index
|
||
|
},
|
||
|
async getArticle() {
|
||
|
let list = []
|
||
|
|
||
|
const {
|
||
|
data
|
||
|
} = await getArticleCategoryLists()
|
||
|
data.map((item, index) => {
|
||
|
if (item.title !== '首页推荐') {
|
||
|
list.push(item)
|
||
|
} else {
|
||
|
getArticleList(item.article_category_id).then(res => {
|
||
|
this.recoList = res.data.list
|
||
|
})
|
||
|
}
|
||
|
})
|
||
|
|
||
|
this.tabsData1.list = list
|
||
|
this.getArticleList(list[0].article_category_id)
|
||
|
},
|
||
|
async getArticleList(id) {
|
||
|
let obj = {
|
||
|
is_home: 1
|
||
|
}
|
||
|
const {
|
||
|
data
|
||
|
} = await getArticleList(id)
|
||
|
this.articleList = data.list
|
||
|
},
|
||
|
article(item) {
|
||
|
uni.navigateTo({
|
||
|
url: '/pages/news_details/index?id=' + item.article_id
|
||
|
})
|
||
|
},
|
||
|
selectPlce(e) {
|
||
|
this.street_id = e.value[1].code
|
||
|
this.town = e.value[1].name
|
||
|
this.getCloudShopMerId(e.value[1].code)
|
||
|
},
|
||
|
getCloudShopMerId(id) {
|
||
|
get_cloud_shop(id).then(res => {
|
||
|
res.data.length > 0 ? this.isYunCang = 1 : this.isYunCang = 0
|
||
|
})
|
||
|
},
|
||
|
selectLocation() {
|
||
|
this.showPicker = true
|
||
|
},
|
||
|
confirm(e) {
|
||
|
|
||
|
this.street = e.value[1].name
|
||
|
|
||
|
this.$nextTick(() => {
|
||
|
this.$bus.$emit('value-updated', e.value[1].name + ',' + e.value[1].code);
|
||
|
|
||
|
})
|
||
|
this.showPicker = false
|
||
|
},
|
||
|
changeHandler(e) {
|
||
|
const {
|
||
|
columnIndex,
|
||
|
value,
|
||
|
values,
|
||
|
index,
|
||
|
picker = this.$refs.uPicker
|
||
|
} = e;
|
||
|
if (columnIndex === 0) {
|
||
|
getStreet({
|
||
|
area_code: value[0]['code']
|
||
|
}).then(res => {
|
||
|
this.$refs.uPicker.setColumnValues(1, res.data);
|
||
|
});
|
||
|
}
|
||
|
},
|
||
|
Area() {
|
||
|
getArea({
|
||
|
city_code: 510500
|
||
|
}).then(res => {
|
||
|
this.$refs.uPicker.setColumnValues(0, res.data);
|
||
|
this.Street(res.data[0]['code']);
|
||
|
});
|
||
|
},
|
||
|
Street(code) {
|
||
|
getStreet({
|
||
|
area_code: code
|
||
|
}).then(res => {
|
||
|
this.$refs.uPicker.setColumnValues(1, res.data);
|
||
|
});
|
||
|
},
|
||
|
dchange(e) {
|
||
|
|
||
|
this.$refs.list.street = e.value[1].name
|
||
|
this.street = e.value[1].name
|
||
|
},
|
||
|
gogogo(item) {
|
||
|
if (item.video_link.length > 0) {
|
||
|
uni.navigateTo({
|
||
|
// #ifdef MP || H5
|
||
|
url: `/pages/short_video/nvueSwiper/index?id=${item.community_id}`
|
||
|
// #endif
|
||
|
// #ifdef APP
|
||
|
url: `/pages/short_video/appSwiper/index?id=${item.community_id}`
|
||
|
// #endif
|
||
|
})
|
||
|
|
||
|
} else {
|
||
|
uni.navigateTo({
|
||
|
|
||
|
url: `/pages/plantGrass/plant_detail/index?id=${item.community_id}`
|
||
|
})
|
||
|
}
|
||
|
},
|
||
|
giveStart(item) {
|
||
|
let status = item.relevance_id ? 0 : 1
|
||
|
graphicStartApi(item.community_id, {
|
||
|
status: status
|
||
|
}).then(res => {
|
||
|
if (item.relevance_id) {
|
||
|
item.count_start--;
|
||
|
item.count_start = item.count_start == 0 ? 0 : item.count_start
|
||
|
item.relevance_id = false
|
||
|
} else {
|
||
|
item.count_start++;
|
||
|
item.relevance_id = true
|
||
|
}
|
||
|
})
|
||
|
},
|
||
|
getGoods: function(isPage) {
|
||
|
let that = this;
|
||
|
if (that.loadend) return;
|
||
|
if (that.loading) return;
|
||
|
|
||
|
if (isPage === true) that.$set(that, 'productList', []);
|
||
|
|
||
|
that.loading = true;
|
||
|
that.loadTitle = '';
|
||
|
graphicLstApi(that.where).then(res => {
|
||
|
let list = res.data.list;
|
||
|
let productList = that.$util.SplitArray(list, that.productList);
|
||
|
let loadend = list.length < that.where.limit;
|
||
|
that.loadend = loadend;
|
||
|
that.loading = false;
|
||
|
that.loadTitle = loadend ? '已全部加载' : '加载更多';
|
||
|
setTimeout(() => {
|
||
|
that.$set(that, 'productList', productList);
|
||
|
}, 500)
|
||
|
|
||
|
// console.log(that.productList)
|
||
|
that.$set(that.where, 'page', that.where.page + 1);
|
||
|
if (that.where.page == 1 && res.data.list.length <= 0) that.emptyShow = true
|
||
|
}).catch(err => {
|
||
|
that.loading = false;
|
||
|
that.loadTitle = '加载更多';
|
||
|
});
|
||
|
},
|
||
|
/*获取分类列表*/
|
||
|
async getCateList() {
|
||
|
const {
|
||
|
data
|
||
|
} = await getTopicList()
|
||
|
this.tabsData.list = [{
|
||
|
cate_name: "热门推荐",
|
||
|
category_id: 0
|
||
|
}, ...data]
|
||
|
},
|
||
|
tabsChange(item) {
|
||
|
|
||
|
this.productList = []
|
||
|
this.where.category_id = item.category_id
|
||
|
this.emptyShow = false
|
||
|
this.loadend = false;
|
||
|
this.$set(this.where, 'page', 1)
|
||
|
this.getGoods(true)
|
||
|
this.street_id = item.id
|
||
|
this.tabsData.tabsActive = item.index
|
||
|
this.current = item.index
|
||
|
|
||
|
},
|
||
|
tabsChange2(item, index) {
|
||
|
// console.log(item,index)
|
||
|
|
||
|
this.productList = []
|
||
|
this.where.category_id = item.category_id
|
||
|
this.$refs.popup.close()
|
||
|
this.emptyShow = false
|
||
|
this.loadend = false;
|
||
|
this.$set(this.where, 'page', 1)
|
||
|
this.getGoods(true)
|
||
|
this.tabsData.tabsActive = index
|
||
|
this.current = index
|
||
|
|
||
|
},
|
||
|
selfLocation() {
|
||
|
|
||
|
if (uni.getStorageSync('loction') == true) {
|
||
|
this.isshow = false
|
||
|
} else {
|
||
|
this.isshow = true
|
||
|
uni.setStorageSync('loction', true);
|
||
|
}
|
||
|
uni.getLocation({
|
||
|
type: 'wgs84',
|
||
|
timeout: '1000',
|
||
|
success: (res) => {
|
||
|
|
||
|
this.isshow = false
|
||
|
let latitude, longitude;
|
||
|
latitude = res.latitude.toString();
|
||
|
longitude = res.longitude.toString();
|
||
|
getGeocoder({
|
||
|
lat: latitude,
|
||
|
long: longitude
|
||
|
}).then(res => {
|
||
|
|
||
|
let town = res.data.address_reference.town.title
|
||
|
let street_id = res.data.address_reference.town.id
|
||
|
this.street = res.data.address_component.street
|
||
|
|
||
|
this.$nextTick(() => {
|
||
|
this.$bus.$emit('value-updated', this.street + ',' +
|
||
|
street_id);
|
||
|
|
||
|
})
|
||
|
}).catch(err => {
|
||
|
this.isshow = false
|
||
|
uni.showToast({
|
||
|
title: err,
|
||
|
icon: 'none'
|
||
|
})
|
||
|
})
|
||
|
},
|
||
|
fail: (err) => {
|
||
|
this.isshow = false
|
||
|
|
||
|
}
|
||
|
});
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 设置手机通知权限
|
||
|
*/
|
||
|
setPermissions() {
|
||
|
// #ifdef APP-PLUS
|
||
|
if (plus.os.name == 'Android') { // 判断是Android
|
||
|
var main = plus.android.runtimeMainActivity();
|
||
|
var pkName = main.getPackageName();
|
||
|
var uid = main.getApplicationInfo().plusGetAttribute("uid");
|
||
|
var NotificationManagerCompat = plus.android.importClass(
|
||
|
"android.support.v4.app.NotificationManagerCompat");
|
||
|
//android.support.v4升级为androidx
|
||
|
if (NotificationManagerCompat == null) {
|
||
|
NotificationManagerCompat = plus.android.importClass(
|
||
|
"androidx.core.app.NotificationManagerCompat");
|
||
|
}
|
||
|
var areNotificationsEnabled = NotificationManagerCompat.from(main).areNotificationsEnabled();
|
||
|
// 未开通‘允许通知’权限,则弹窗提醒开通,并点击确认后,跳转到系统设置页面进行设置
|
||
|
if (!areNotificationsEnabled) {
|
||
|
uni.showModal({
|
||
|
title: '通知权限开启提醒',
|
||
|
content: '您还没有开启通知权限,无法接受到消息通知,请前往设置!',
|
||
|
showCancel: false,
|
||
|
confirmText: '去设置',
|
||
|
success: function(res) {
|
||
|
if (res.confirm) {
|
||
|
var Intent = plus.android.importClass('android.content.Intent');
|
||
|
var Build = plus.android.importClass("android.os.Build");
|
||
|
//android 8.0引导
|
||
|
if (Build.VERSION.SDK_INT >= 26) {
|
||
|
var intent = new Intent(
|
||
|
'android.settings.APP_NOTIFICATION_SETTINGS');
|
||
|
intent.putExtra('android.provider.extra.APP_PACKAGE', pkName);
|
||
|
} else if (Build.VERSION.SDK_INT >= 21) { //android 5.0-7.0
|
||
|
var intent = new Intent(
|
||
|
'android.settings.APP_NOTIFICATION_SETTINGS');
|
||
|
intent.putExtra("app_package", pkName);
|
||
|
intent.putExtra("app_uid", uid);
|
||
|
} else { //(<21)其他--跳转到该应用管理的详情页
|
||
|
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||
|
var uri = Uri.fromParts("package", mainActivity
|
||
|
.getPackageName(),
|
||
|
null);
|
||
|
intent.setData(uri);
|
||
|
}
|
||
|
// 跳转到该应用的系统通知设置页
|
||
|
main.startActivity(intent);
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
} else if (plus.os.name == 'iOS') { // 判断是ISO
|
||
|
var isOn = undefined;
|
||
|
var types = 0;
|
||
|
var app = plus.ios.invoke('UIApplication', 'sharedApplication');
|
||
|
var settings = plus.ios.invoke(app, 'currentUserNotificationSettings');
|
||
|
if (settings) {
|
||
|
types = settings.plusGetAttribute('types');
|
||
|
plus.ios.deleteObject(settings);
|
||
|
} else {
|
||
|
types = plus.ios.invoke(app, 'enabledRemoteNotificationTypes');
|
||
|
}
|
||
|
plus.ios.deleteObject(app);
|
||
|
isOn = (0 != types);
|
||
|
if (isOn == false) {
|
||
|
uni.showModal({
|
||
|
title: '通知权限开启提醒',
|
||
|
content: '您还没有开启通知权限,无法接受到消息通知,请前往设置!',
|
||
|
showCancel: false,
|
||
|
confirmText: '去设置',
|
||
|
success: function(res) {
|
||
|
if (res.confirm) {
|
||
|
var app = plus.ios.invoke('UIApplication', 'sharedApplication');
|
||
|
var setting = plus.ios.invoke('NSURL', 'URLWithString:',
|
||
|
'app-settings:');
|
||
|
plus.ios.invoke(app, 'openURL:', setting);
|
||
|
plus.ios.deleteObject(setting);
|
||
|
plus.ios.deleteObject(app);
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
// #endif
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style lang="scss" scoped>
|
||
|
page {
|
||
|
background-color: #f4f7fe;
|
||
|
|
||
|
// background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%);
|
||
|
}
|
||
|
|
||
|
.location {
|
||
|
background-color: #f6f6f6;
|
||
|
width: 680rpx;
|
||
|
height: 150rpx;
|
||
|
position: absolute;
|
||
|
top: 0;
|
||
|
z-index: 9999;
|
||
|
border-radius: 20rpx;
|
||
|
left: 50%;
|
||
|
margin-left: -340rpx;
|
||
|
margin-top: 80rpx;
|
||
|
padding-left: 20rpx;
|
||
|
|
||
|
.locationa {
|
||
|
font-size: 28rpx;
|
||
|
color: #000;
|
||
|
font-weight: 500;
|
||
|
margin-top: 30rpx;
|
||
|
margin-bottom: 15rpx;
|
||
|
}
|
||
|
|
||
|
.locationb {
|
||
|
font-size: 20rpx;
|
||
|
color: #5a5a5a;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.Circle_friends {
|
||
|
position: relative;
|
||
|
padding: 0 0 87.72rpx 0;
|
||
|
|
||
|
background: linear-gradient(180deg, #ffffff 0%, #f6f6f6 100%);
|
||
|
}
|
||
|
|
||
|
.classpage {
|
||
|
width: 100%;
|
||
|
height: calc(100vh - 50px);
|
||
|
background-color: #fff;
|
||
|
position: relative;
|
||
|
padding-top: 40rpx;
|
||
|
padding-left: 40rpx;
|
||
|
padding-right: 10rpx;
|
||
|
|
||
|
.classpage-one {
|
||
|
|
||
|
text-align: center;
|
||
|
|
||
|
image {
|
||
|
position: absolute;
|
||
|
right: 25rpx;
|
||
|
width: 42rpx;
|
||
|
height: 42rpx;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.classpage-two {
|
||
|
font-size: 26rpx;
|
||
|
font-family: PingFang SC-Regular, PingFang SC;
|
||
|
font-weight: 400;
|
||
|
color: #333333;
|
||
|
margin-top: 77rpx;
|
||
|
}
|
||
|
|
||
|
.classpage-three {
|
||
|
display: flex;
|
||
|
flex-direction: row;
|
||
|
flex-wrap: wrap;
|
||
|
margin-top: 35rpx;
|
||
|
|
||
|
view {
|
||
|
margin-right: 20rpx;
|
||
|
margin-bottom: 14rpx;
|
||
|
width: 210rpx;
|
||
|
height: 81rpx;
|
||
|
line-height: 81rpx;
|
||
|
text-align: center;
|
||
|
background: #FFFFFF;
|
||
|
border-radius: 11rpx 11rpx 11rpx 11rpx;
|
||
|
opacity: 1;
|
||
|
border: 2rpx solid #707070;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// .bg-img {
|
||
|
// position: absolute;
|
||
|
// width: 100%;
|
||
|
// height: 100%;
|
||
|
|
||
|
// top: 0;
|
||
|
// /* #ifdef MP || APP-PLUS */
|
||
|
// z-index: -100;
|
||
|
// /* #endif */
|
||
|
// /* #ifdef H5 */
|
||
|
// z-index: -100;
|
||
|
// /* #endif */
|
||
|
// z-index: -100;
|
||
|
// filter: blur(0);
|
||
|
// overflow: hidden;
|
||
|
|
||
|
// img {
|
||
|
// width: 100%;
|
||
|
// height: 100%;
|
||
|
// filter: blur(30rpx);
|
||
|
// transform: scale(1.5);
|
||
|
// }
|
||
|
// }
|
||
|
|
||
|
.sitebox {
|
||
|
animation-name: fadeIn;
|
||
|
animation-duration: 3s;
|
||
|
animation-fill-mode: forwards;
|
||
|
}
|
||
|
|
||
|
@keyframes fadeIn {
|
||
|
from {
|
||
|
opacity: 0;
|
||
|
}
|
||
|
|
||
|
to {
|
||
|
opacity: 1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.site-box1 {
|
||
|
width: 706rpx;
|
||
|
/* #ifdef MP || APP-PLUS */
|
||
|
height: 160rpx;
|
||
|
/* #endif */
|
||
|
/* #ifdef H5 */
|
||
|
height: 120rpx;
|
||
|
/* #endif */
|
||
|
margin-bottom: 26.32rpx;
|
||
|
position: absolute;
|
||
|
top: 45rpx;
|
||
|
left: 20rpx;
|
||
|
|
||
|
z-index: 999;
|
||
|
// 位置
|
||
|
.place_wrapper {
|
||
|
color: #fff;
|
||
|
margin-right: 0rpx;
|
||
|
|
||
|
font-size: 30rpx;
|
||
|
|
||
|
.town_name {
|
||
|
margin-left: 21rpx;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.iconfont {
|
||
|
font-size: 35.09rpx;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
.site-box {
|
||
|
width: 100%;
|
||
|
/* #ifdef MP || APP-PLUS */
|
||
|
height: 160rpx;
|
||
|
/* #endif */
|
||
|
/* #ifdef H5 */
|
||
|
height: 120rpx;
|
||
|
/* #endif */
|
||
|
margin-bottom: 26.32rpx;
|
||
|
position: absolute;
|
||
|
top: 0rpx;
|
||
|
position: fixed;
|
||
|
z-index: 999;
|
||
|
/* #ifdef MP || APP-PLUS */
|
||
|
padding-top: 75rpx;
|
||
|
/* #endif */
|
||
|
/* #ifdef H5 */
|
||
|
padding-top: 25rpx;
|
||
|
/* #endif */
|
||
|
// background-color: #e5e5e5;
|
||
|
background: url('@/static/images/bg2.png') no-repeat;
|
||
|
background-size: 100% 100%;
|
||
|
|
||
|
padding-right: 20rpx;
|
||
|
|
||
|
// 位置
|
||
|
.place_wrapper {
|
||
|
color: #fff;
|
||
|
margin-right: 24.56rpx;
|
||
|
font-size: 30rpx;
|
||
|
|
||
|
opacity: 0;
|
||
|
|
||
|
.town_name {
|
||
|
margin-left: 21rpx;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.iconfont {
|
||
|
opacity: 0;
|
||
|
color: #fff;
|
||
|
font-size: 30rpx;
|
||
|
font-size: 35.09rpx;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.circle_friends_wrapper {
|
||
|
position: relative;
|
||
|
|
||
|
z-index: 2;
|
||
|
}
|
||
|
|
||
|
/deep/.u-tabs__wrapper__nav__line {
|
||
|
width: 46rpx;
|
||
|
margin-left: -2rpx;
|
||
|
}
|
||
|
|
||
|
/deep/.u-tabs__wrapper__nav__item {
|
||
|
// padding: 0 0px;
|
||
|
padding-left: 0rpx;
|
||
|
padding-right: 20rpx;
|
||
|
}
|
||
|
|
||
|
.search_wrapper {
|
||
|
width: 694.74rpx;
|
||
|
margin: 0 auto;
|
||
|
}
|
||
|
|
||
|
.tabs_wrapper {
|
||
|
width: 720rpx;
|
||
|
|
||
|
margin: 0 auto;
|
||
|
margin-bottom: 21.05rpx;
|
||
|
// margin-left: -20rpx;
|
||
|
position: relative;
|
||
|
}
|
||
|
|
||
|
.tabs_wrapper-img {
|
||
|
width: 40rpx;
|
||
|
height: 60rpx;
|
||
|
position: absolute;
|
||
|
z-index: 888;
|
||
|
|
||
|
background-color: #fff;
|
||
|
right: 0rpx;
|
||
|
top: 0;
|
||
|
|
||
|
image {
|
||
|
width: 40rpx;
|
||
|
height: 40rpx;
|
||
|
margin-top: 10rpx;
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.empty_wrapper {
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
justify-content: center;
|
||
|
}
|
||
|
|
||
|
.article_box {
|
||
|
height: 100%;
|
||
|
width: 694.74rpx;
|
||
|
margin: 0 auto;
|
||
|
background-color: #fff;
|
||
|
border-radius: 16rpx;
|
||
|
padding: 0 24.56rpx;
|
||
|
box-sizing: border-box;
|
||
|
|
||
|
.title-box {
|
||
|
height: 87.72rpx;
|
||
|
|
||
|
text {
|
||
|
font-size: 28.07rpx;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.article-item {
|
||
|
display: flex;
|
||
|
// height: 175.44rpx;
|
||
|
justify-content: space-between;
|
||
|
border-bottom: 1px solid #f0f0f0;
|
||
|
padding: 21.05rpx 0;
|
||
|
|
||
|
.text {
|
||
|
flex: 1;
|
||
|
height: 122.81rpx;
|
||
|
margin-right: 17.54rpx;
|
||
|
font-size: 24rpx;
|
||
|
color: #999;
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
justify-content: space-between;
|
||
|
|
||
|
.name {
|
||
|
font-size: 26.32rpx;
|
||
|
color: #282828;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.pictrue {
|
||
|
width: 175.44rpx;
|
||
|
height: 122.81rpx;
|
||
|
|
||
|
image {
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
border-radius: 8px;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.tabs_wrapper {
|
||
|
width: 723rpx;
|
||
|
margin: 0rpx auto;
|
||
|
margin-bottom: 21.05rpx;
|
||
|
|
||
|
.title {
|
||
|
font-size: 31.58rpx;
|
||
|
font-weight: bold;
|
||
|
|
||
|
&::before {
|
||
|
content: "";
|
||
|
display: inline-block;
|
||
|
width: 3px;
|
||
|
height: 31.58rpx;
|
||
|
background-color: #f84221;
|
||
|
margin-right: 7.02rpx;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.goodslist {
|
||
|
// display: flex;
|
||
|
margin: 0 auto;
|
||
|
width: 725rpx;
|
||
|
}
|
||
|
|
||
|
.goods {
|
||
|
margin: 0 auto;
|
||
|
width: 725rpx;
|
||
|
|
||
|
display: flex;
|
||
|
flex-wrap: wrap;
|
||
|
justify-content: space-between;
|
||
|
|
||
|
.goods_item {
|
||
|
width: 356rpx;
|
||
|
border: 1px solid;
|
||
|
border-radius: 8px;
|
||
|
overflow: hidden;
|
||
|
background-color: #fff;
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
margin-bottom: 10.53rpx;
|
||
|
position: relative;
|
||
|
margin-top: -40rpx;
|
||
|
|
||
|
.kk {
|
||
|
width: 365rpx;
|
||
|
height: 251rpx;
|
||
|
}
|
||
|
|
||
|
.goods_item_img {
|
||
|
position: absolute;
|
||
|
top: 18rpx;
|
||
|
right: 18rpx;
|
||
|
width: 52rpx;
|
||
|
height: 52rpx;
|
||
|
|
||
|
image {
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.goods_img {
|
||
|
width: 100%;
|
||
|
height: 294.74rpx;
|
||
|
|
||
|
/deep/.easy-loadimage {
|
||
|
width: 100%;
|
||
|
height: 294.74rpx;
|
||
|
// border-radius: 8rpx;
|
||
|
position: relative;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.botm {
|
||
|
flex: 1;
|
||
|
padding: 0 14.04rpx;
|
||
|
padding-bottom: 21.05rpx;
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
justify-content: space-between;
|
||
|
|
||
|
.title {
|
||
|
font-size: 30rpx;
|
||
|
font-family: PingFang SC-Medium, PingFang SC;
|
||
|
font-weight: 500;
|
||
|
color: #333333;
|
||
|
margin: 12px 0;
|
||
|
width: 100%;
|
||
|
overflow: hidden;
|
||
|
text-overflow: ellipsis;
|
||
|
display: -webkit-box;
|
||
|
-webkit-line-clamp: 2;
|
||
|
-webkit-box-orient: vertical;
|
||
|
}
|
||
|
|
||
|
.goods_info {
|
||
|
justify-content: space-between;
|
||
|
|
||
|
.g_img {
|
||
|
width: 49rpx;
|
||
|
height: 49rpx;
|
||
|
border-radius: 50%;
|
||
|
}
|
||
|
|
||
|
.g_name {
|
||
|
margin-left: 8.77rpx;
|
||
|
width: 100.63rpx;
|
||
|
text-overflow: ellipsis;
|
||
|
/* 溢出显示省略号 */
|
||
|
overflow: hidden;
|
||
|
/* 溢出隐藏 */
|
||
|
white-space: nowrap;
|
||
|
/* 强制不换行 */
|
||
|
}
|
||
|
|
||
|
.nice_box {
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
|
||
|
.isshow {
|
||
|
color: #fe3530 !important;
|
||
|
}
|
||
|
|
||
|
.iconfont {
|
||
|
font-size: 30rpx;
|
||
|
}
|
||
|
|
||
|
.icon-shoucang1 {
|
||
|
color: #f84221;
|
||
|
}
|
||
|
|
||
|
.collect {
|
||
|
font-size: 24rpx;
|
||
|
margin-left: 5rpx;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.goods_items {
|
||
|
width: 356rpx;
|
||
|
|
||
|
border-radius: 8px;
|
||
|
overflow: hidden;
|
||
|
background-color: #fff;
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
margin-bottom: 10.53rpx;
|
||
|
position: relative;
|
||
|
|
||
|
.goods_item_img {
|
||
|
position: absolute;
|
||
|
top: 18rpx;
|
||
|
right: 18rpx;
|
||
|
width: 52rpx;
|
||
|
height: 52rpx;
|
||
|
|
||
|
image {
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.goods_img {
|
||
|
width: 100%;
|
||
|
height: 294.74rpx;
|
||
|
|
||
|
/deep/.easy-loadimage {
|
||
|
width: 100%;
|
||
|
height: 294.74rpx;
|
||
|
// border-radius: 8rpx;
|
||
|
position: relative;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.botm {
|
||
|
flex: 1;
|
||
|
padding: 0 14.04rpx;
|
||
|
padding-bottom: 21.05rpx;
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
justify-content: space-between;
|
||
|
|
||
|
.title {
|
||
|
font-size: 30rpx;
|
||
|
font-family: PingFang SC-Medium, PingFang SC;
|
||
|
font-weight: 500;
|
||
|
color: #333333;
|
||
|
margin: 12px 0;
|
||
|
width: 100%;
|
||
|
overflow: hidden;
|
||
|
text-overflow: ellipsis;
|
||
|
display: -webkit-box;
|
||
|
-webkit-line-clamp: 2;
|
||
|
-webkit-box-orient: vertical;
|
||
|
}
|
||
|
|
||
|
.goods_info {
|
||
|
justify-content: space-between;
|
||
|
|
||
|
.g_img {
|
||
|
width: 49rpx;
|
||
|
height: 49rpx;
|
||
|
border-radius: 50%;
|
||
|
}
|
||
|
|
||
|
.g_name {
|
||
|
margin-left: 8.77rpx;
|
||
|
width: 100.63rpx;
|
||
|
text-overflow: ellipsis;
|
||
|
/* 溢出显示省略号 */
|
||
|
overflow: hidden;
|
||
|
/* 溢出隐藏 */
|
||
|
white-space: nowrap;
|
||
|
/* 强制不换行 */
|
||
|
}
|
||
|
|
||
|
.nice_box {
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
|
||
|
.isshow {
|
||
|
color: #fe3530 !important;
|
||
|
}
|
||
|
|
||
|
.iconfont {
|
||
|
font-size: 30rpx;
|
||
|
}
|
||
|
|
||
|
.icon-shoucang1 {
|
||
|
color: #f84221;
|
||
|
}
|
||
|
|
||
|
.collect {
|
||
|
font-size: 24rpx;
|
||
|
margin-left: 5rpx;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</style>
|