代码更新
This commit is contained in:
parent
0f11c59662
commit
44df92ccf9
@ -4,10 +4,8 @@
|
||||
<view class="bg-img">
|
||||
<img :src="bgColor" alt="">
|
||||
</view>
|
||||
<view class="" style="height: 40rpx;">
|
||||
|
||||
</view>
|
||||
<!-- <view class="site-box flex_a_c_j_sb">
|
||||
|
||||
<view class="site-box 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>
|
||||
@ -17,12 +15,13 @@
|
||||
<view class="iconfont icon-xiaoxi" style="color:#fff;"></view>
|
||||
</navigator>
|
||||
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- 搜索栏 -->
|
||||
<navigator url="/pages/columnGoods/goods_search/index" hover-class="none" class="search_content flex_a_c_j_sb">
|
||||
<view class="flex_a_c">
|
||||
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
|
||||
<input type="text" v-model="keyword" placeholder="搜索产品或店铺" placeholder-style="font-size: 30rpx;" disabled>
|
||||
<input type="text" v-model="keyword" placeholder="搜索产品或店铺" placeholder-style="font-size: 30rpx;"
|
||||
disabled>
|
||||
</view>
|
||||
<button class="search_btn">搜索</button>
|
||||
</navigator>
|
||||
@ -33,8 +32,7 @@
|
||||
indicator-active-color="#fff">
|
||||
<block v-for="(item,index) in swiper['url']" :key="index">
|
||||
<swiper-item class="swi_item" @click="swiperClick(item)">
|
||||
<u--image :showLoading="true" :src="item.img" width="724rpx" height="259rpx"
|
||||
mode="aspectFill">
|
||||
<u--image :showLoading="true" :src="item.img" width="724rpx" height="259rpx" mode="aspectFill">
|
||||
</u--image>
|
||||
</swiper-item>
|
||||
</block>
|
||||
@ -116,7 +114,7 @@
|
||||
mounted() {
|
||||
this.appLocation()
|
||||
},
|
||||
|
||||
|
||||
methods: {
|
||||
swiperClick(item) {
|
||||
const url = item.info[1].value
|
||||
@ -206,9 +204,11 @@
|
||||
} = e.detail;
|
||||
if (source === 'autoplay' || source === 'touch') {
|
||||
this.bgColor = this.swiper.url[e.detail.current]['img']
|
||||
this.$emit('kkchange',this.bgColor)
|
||||
this.$emit('kkchange', this.bgColor)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 对象转数组
|
||||
objToArr(data) {
|
||||
let obj = Object.keys(data).sort();
|
||||
@ -251,7 +251,7 @@
|
||||
transform: translate(-50%, 0);
|
||||
width: 102%;
|
||||
height: 133px;
|
||||
border-radius: 30px 30px 0 0;
|
||||
border-radius: 30px 30px 0 0;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="gather">
|
||||
<view class="site-box flex_a_c_j_sb">
|
||||
<view class="place_wrapper flex_a_c" >
|
||||
<view class="place_wrapper flex_a_c" @click="selectLocation">
|
||||
<view class="iconfont icon-weizhi" style="margin-left: 20rpx;"></view>
|
||||
<view class="town_name">{{street}}</view>
|
||||
</view>
|
||||
@ -253,6 +253,8 @@
|
||||
</view>
|
||||
</template>
|
||||
</m-tabbar> -->
|
||||
<u-picker :defaultIndex="[0,0]" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm"
|
||||
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker>
|
||||
<view class="" v-if='jurisdiction==false&&isShow==false'>
|
||||
<emptyPage title="暂无信息"></emptyPage>
|
||||
</view>
|
||||
@ -261,9 +263,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Cache from '@/utils/cache';
|
||||
import mTabbar from '@/components/m-tabbar/m-tabbar.vue'
|
||||
import emptyPage from '@/components/emptyPage.vue';
|
||||
import zbpSwiper from '@/components/zbpSwiper'
|
||||
import {
|
||||
getArea,
|
||||
getStreet
|
||||
} from '@/api/article.js';
|
||||
import {
|
||||
mapState,
|
||||
mapGetters
|
||||
@ -287,7 +294,7 @@
|
||||
import {
|
||||
getDiy
|
||||
} from '@/api/api.js'
|
||||
|
||||
|
||||
export default {
|
||||
components: {
|
||||
mTabbar,
|
||||
@ -309,14 +316,18 @@
|
||||
isShow: false,
|
||||
bgColor: '',
|
||||
isFshow: false,
|
||||
street:''
|
||||
street: '',
|
||||
showPicker: false,
|
||||
columnData: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo', 'location', 'isLogin'])
|
||||
},
|
||||
created() {},
|
||||
onLoad() {},
|
||||
onLoad() {
|
||||
this.Area()
|
||||
},
|
||||
onShow() {
|
||||
if (this.isLogin) {
|
||||
this.emptyText = '暂无可用应用'
|
||||
@ -328,6 +339,20 @@
|
||||
this.getUserInfo()
|
||||
this.appLocation()
|
||||
},
|
||||
watch: {
|
||||
street: {
|
||||
handler(newVal, oldVal) {
|
||||
this.street = newVal
|
||||
let arr = Cache.get('ADRESS_LOCATION')
|
||||
console.log(arr,'2')
|
||||
if (arr.length > 0) {
|
||||
this.street=arr.split(',')[0]
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.getUserInfo()
|
||||
uni.stopPullDownRefresh()
|
||||
@ -335,10 +360,10 @@
|
||||
mounted() {
|
||||
this.appLocation()
|
||||
// #ifdef H5
|
||||
// 监听页面滚动事件
|
||||
// 监听页面滚动事件
|
||||
window.addEventListener("scroll", this.scrolling);
|
||||
// #endif
|
||||
|
||||
|
||||
|
||||
},
|
||||
// #ifdef APP-PLUS
|
||||
@ -355,7 +380,50 @@
|
||||
// #endif
|
||||
|
||||
methods: {
|
||||
appLocation() {
|
||||
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);
|
||||
});
|
||||
},
|
||||
selectLocation() {
|
||||
this.showPicker = true
|
||||
},
|
||||
confirm(e) {
|
||||
this.street = e.value[1].name
|
||||
Cache.set('ADRESS_LOCATION',
|
||||
e.value[1].name + ',' + e.value[1].name + ',' +
|
||||
|
||||
e.value[1].code
|
||||
)
|
||||
this.showPicker = false
|
||||
},
|
||||
appLocation() {
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
timeout: '10',
|
||||
@ -388,7 +456,7 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
scrolling() {
|
||||
// 滚动条距文档顶部的距离
|
||||
let scrollTop =
|
||||
@ -491,7 +559,12 @@
|
||||
|
||||
.site-box {
|
||||
width: 100%;
|
||||
height: 120rpx;
|
||||
/* #ifdef MP || APP-PLUS */
|
||||
height: 170rpx;
|
||||
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
height: 120rpx;
|
||||
/* #endif */
|
||||
margin-bottom: 26.32rpx;
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
|
@ -1,364 +1,376 @@
|
||||
<template>
|
||||
<view class="Circle_friends">
|
||||
<view class="circle_friends_wrapper">
|
||||
<view class="Circle_friends">
|
||||
<view class="circle_friends_wrapper">
|
||||
|
||||
<zbpSwiper></zbpSwiper>
|
||||
<zbpSwiper></zbpSwiper>
|
||||
|
||||
<view class="tabs_wrapper">
|
||||
<u-tabs :list="tabsData.list" @click="tabsChange" lineColor="#F84221" keyName="cate_name"></u-tabs>
|
||||
</view>
|
||||
<view class="tabs_wrapper">
|
||||
<u-tabs :list="tabsData.list" @click="tabsChange" lineColor="#F84221" keyName="cate_name"></u-tabs>
|
||||
</view>
|
||||
|
||||
<view class="goods">
|
||||
<block v-for="(item,index) in cateGoods" :key="index">
|
||||
<view class="goods_item" @click="gogogo(item)">
|
||||
<image class="goods_img" :src="item.image[0]" mode="aspectFill"></image>
|
||||
<view class="botm">
|
||||
<view class="title">{{item.title}}</view>
|
||||
<view class="goods_info flex_a_c">
|
||||
<view class="l_info flex_a_c">
|
||||
<image :src="(item.author && item.author.avatar) || '/static/images/f.png'" mode="aspectFill"
|
||||
class="g_img"></image>
|
||||
<view class="g_name">{{item.author && item.author.nickname}}</view>
|
||||
</view>
|
||||
<view class="nice_box" @click.stop="giveStart(item)">
|
||||
<text class="iconfont" :class="item.relevance_id ? 'icon-shoucang1' : 'icon-dianzan'"></text>
|
||||
<text class="collect">{{item.count_start}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</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>
|
||||
<view class="goods">
|
||||
<block v-for="(item,index) in cateGoods" :key="index">
|
||||
<view class="goods_item" @click="gogogo(item)">
|
||||
<image class="goods_img" :src="item.image[0]" mode="aspectFill"></image>
|
||||
<view class="botm">
|
||||
<view class="title">{{item.title}}</view>
|
||||
<view class="goods_info flex_a_c">
|
||||
<view class="l_info flex_a_c">
|
||||
<image :src="(item.author && item.author.avatar) || '/static/images/f.png'"
|
||||
mode="aspectFill" class="g_img"></image>
|
||||
<view class="g_name">{{item.author && item.author.nickname}}</view>
|
||||
</view>
|
||||
<view class="nice_box" @click.stop="giveStart(item)">
|
||||
<text class="iconfont"
|
||||
:class="item.relevance_id ? 'icon-shoucang1' : 'icon-dianzan'"></text>
|
||||
<text class="collect">{{item.count_start}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</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>
|
||||
<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> -->
|
||||
<!-- <view class="bg_color"></view> -->
|
||||
|
||||
<!-- <m-tabbar native>
|
||||
<!-- <m-tabbar native>
|
||||
<template v-slot:tabbar_index_2>
|
||||
<view class="custom_style">
|
||||
<view class="custom_style_icon"></view>
|
||||
</view>
|
||||
</template>
|
||||
</m-tabbar> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mTabbar from '@/components/m-tabbar/m-tabbar.vue'
|
||||
import zbpSwiper from '@/components/zbpSwiper'
|
||||
import { getSlideAPI } from '@/api/lihai.js'
|
||||
import { graphicLstApi, getTopicList, graphicStartApi } from '@/api/community.js'
|
||||
import { getIndexData, getDiy } 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
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
bgColor: '',
|
||||
showPicker: false,
|
||||
columnData: [],
|
||||
show: false,
|
||||
swiper: {
|
||||
url: [{
|
||||
img: ''
|
||||
}],
|
||||
indicatorDots: true, // 显示面板指示点
|
||||
vertical: false, // 滑动方向是否为纵向
|
||||
autoplay: true, // 是否自动切换
|
||||
interval: 2000, // 自动切换时间间隔
|
||||
duration: 500 // 滑动动画时长
|
||||
},
|
||||
tabsData: {
|
||||
list: [],
|
||||
tabsActive: 0
|
||||
},
|
||||
where: {
|
||||
category_id: 0,
|
||||
page: 1,
|
||||
limit: 30
|
||||
},
|
||||
currentItemId: 69, // 默认获取 社区的数据 0 表示推荐 || 69 社区
|
||||
keyword: '',
|
||||
location: '',
|
||||
emptyShow: false,
|
||||
street: '',
|
||||
cateGoods: []
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.getCateList()
|
||||
this.getGoods()
|
||||
this.selfLocation()
|
||||
this.Area()
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
onLoad() {
|
||||
this.getCateList()
|
||||
this.getGoods()
|
||||
this.selfLocation()
|
||||
this.Area()
|
||||
},
|
||||
onShow() {},
|
||||
methods: {
|
||||
confirm(e) {
|
||||
this.where.street_id = 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);
|
||||
});
|
||||
},
|
||||
gogogo(item) {
|
||||
if (this.tabsData.tabsActive == 1) {
|
||||
uni.navigateTo({
|
||||
//#ifdef APP
|
||||
url: '/pages/short_video/appSwiper/index?id=' + item.community_id
|
||||
//#endif
|
||||
//#ifndef APP
|
||||
url: '/pages/short_video/nvueSwiper/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 => {
|
||||
Toast(res.message)
|
||||
this.getGoods()
|
||||
})
|
||||
},
|
||||
dianji() {
|
||||
this.show = !this.show
|
||||
},
|
||||
// 获取发现商品
|
||||
getGoods: function() {
|
||||
// 数据写死:默认社区数据 category_id=69&page=1&limit=30
|
||||
graphicLstApi(this.where).then(res => {
|
||||
this.cateGoods = res.data.list
|
||||
res.data.list.length <= 0 ? this.emptyShow = true : this.emptyShow = false
|
||||
})
|
||||
},
|
||||
/*获取分类列表*/
|
||||
async getCateList() {
|
||||
const {
|
||||
data
|
||||
} = await getTopicList()
|
||||
this.tabsData.list = [{
|
||||
cate_name: "推荐",
|
||||
category_id: 0
|
||||
}, {
|
||||
cate_name: "视频",
|
||||
category_id: -1,
|
||||
children: []
|
||||
}, ...data]
|
||||
},
|
||||
tabsChange(item) {
|
||||
this.where.category_id = item.category_id
|
||||
this.getGoods()
|
||||
this.street_id = item.id
|
||||
this.tabsData.tabsActive = item.index
|
||||
if (item.index == 1) {
|
||||
uni.navigateTo({
|
||||
// #ifdef MP || H5
|
||||
url: '/pages/short_video/nvueSwiper/index?id=' + this.cateGoods[0].community_id
|
||||
// #endif
|
||||
// #ifdef APP
|
||||
url: `/pages/short_video/appSwiper/index?id=${this.cateGoods[0].community_id}`
|
||||
// #endif
|
||||
})
|
||||
}
|
||||
},
|
||||
selfLocation() {
|
||||
uni.getLocation({
|
||||
type: 'gcj02',
|
||||
success: (res) => {
|
||||
let latitude, longitude;
|
||||
latitude = res.latitude.toString();
|
||||
longitude = res.longitude.toString();
|
||||
getGeocoder({ lat: latitude, long: longitude }).then(res => {
|
||||
this.$store.commit('setLocation', res.data)
|
||||
this.street = res.data.address_component.street
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err,
|
||||
icon: 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
title: err.errMsg,
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
import mTabbar from '@/components/m-tabbar/m-tabbar.vue'
|
||||
import zbpSwiper from '@/components/zbpSwiper'
|
||||
import {
|
||||
getSlideAPI
|
||||
} from '@/api/lihai.js'
|
||||
import {
|
||||
graphicLstApi,
|
||||
getTopicList,
|
||||
graphicStartApi
|
||||
} from '@/api/community.js'
|
||||
import {
|
||||
getIndexData,
|
||||
getDiy
|
||||
} 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
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
bgColor: '',
|
||||
showPicker: false,
|
||||
columnData: [],
|
||||
show: false,
|
||||
swiper: {
|
||||
url: [{
|
||||
img: ''
|
||||
}],
|
||||
indicatorDots: true, // 显示面板指示点
|
||||
vertical: false, // 滑动方向是否为纵向
|
||||
autoplay: true, // 是否自动切换
|
||||
interval: 2000, // 自动切换时间间隔
|
||||
duration: 500 // 滑动动画时长
|
||||
},
|
||||
tabsData: {
|
||||
list: [],
|
||||
tabsActive: 0
|
||||
},
|
||||
where: {
|
||||
category_id: 0,
|
||||
page: 1,
|
||||
limit: 30
|
||||
},
|
||||
currentItemId: 69, // 默认获取 社区的数据 0 表示推荐 || 69 社区
|
||||
keyword: '',
|
||||
location: '',
|
||||
emptyShow: false,
|
||||
street: '',
|
||||
cateGoods: []
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.getCateList()
|
||||
this.getGoods()
|
||||
this.selfLocation()
|
||||
this.Area()
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
onLoad() {
|
||||
this.getCateList()
|
||||
this.getGoods()
|
||||
this.selfLocation()
|
||||
this.Area()
|
||||
},
|
||||
onShow() {},
|
||||
methods: {
|
||||
confirm(e) {
|
||||
this.where.street_id = 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);
|
||||
});
|
||||
},
|
||||
gogogo(item) {
|
||||
if (this.tabsData.tabsActive == 1) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/short_video/appSwiper/index?id=${this.cateGoods[0].community_id}`
|
||||
})
|
||||
|
||||
} 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 => {
|
||||
Toast(res.message)
|
||||
this.getGoods()
|
||||
})
|
||||
},
|
||||
dianji() {
|
||||
this.show = !this.show
|
||||
},
|
||||
// 获取发现商品
|
||||
getGoods: function() {
|
||||
// 数据写死:默认社区数据 category_id=69&page=1&limit=30
|
||||
graphicLstApi(this.where).then(res => {
|
||||
this.cateGoods = res.data.list
|
||||
res.data.list.length <= 0 ? this.emptyShow = true : this.emptyShow = false
|
||||
})
|
||||
},
|
||||
/*获取分类列表*/
|
||||
async getCateList() {
|
||||
const {
|
||||
data
|
||||
} = await getTopicList()
|
||||
this.tabsData.list = [{
|
||||
cate_name: "推荐",
|
||||
category_id: 0
|
||||
}, {
|
||||
cate_name: "视频",
|
||||
category_id: -1,
|
||||
children: []
|
||||
}, ...data]
|
||||
},
|
||||
tabsChange(item) {
|
||||
this.where.category_id = item.category_id
|
||||
this.getGoods()
|
||||
this.street_id = item.id
|
||||
this.tabsData.tabsActive = item.index
|
||||
if (item.index == 1) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/short_video/appSwiper/index?id=${this.cateGoods[0].community_id}`
|
||||
})
|
||||
}
|
||||
},
|
||||
selfLocation() {
|
||||
uni.getLocation({
|
||||
type: 'gcj02',
|
||||
success: (res) => {
|
||||
let latitude, longitude;
|
||||
latitude = res.latitude.toString();
|
||||
longitude = res.longitude.toString();
|
||||
getGeocoder({
|
||||
lat: latitude,
|
||||
long: longitude
|
||||
}).then(res => {
|
||||
this.$store.commit('setLocation', res.data)
|
||||
this.street = res.data.address_component.street
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err,
|
||||
icon: 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
title: err.errMsg,
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
// background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%);
|
||||
}
|
||||
page {
|
||||
// background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%);
|
||||
}
|
||||
|
||||
.Circle_friends {
|
||||
position: relative;
|
||||
padding: 0 0 87.72rpx 0;
|
||||
background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%);
|
||||
}
|
||||
.Circle_friends {
|
||||
position: relative;
|
||||
padding: 0 0 87.72rpx 0;
|
||||
background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%);
|
||||
}
|
||||
|
||||
.circle_friends_wrapper {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
.circle_friends_wrapper {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
|
||||
.search_wrapper {
|
||||
width: 694.74rpx;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.search_wrapper {
|
||||
width: 694.74rpx;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.tabs_wrapper {
|
||||
width: 694.74rpx;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 21.05rpx;
|
||||
}
|
||||
.tabs_wrapper {
|
||||
width: 694.74rpx;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 21.05rpx;
|
||||
}
|
||||
|
||||
.empty_wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.empty_wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.goods {
|
||||
margin: 0 auto;
|
||||
width: 694.74rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
.goods {
|
||||
margin: 0 auto;
|
||||
width: 694.74rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
|
||||
.goods_item {
|
||||
width: 342.11rpx;
|
||||
height: 491.23rpx;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 10.53rpx;
|
||||
.goods_item {
|
||||
width: 342.11rpx;
|
||||
height: 491.23rpx;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 10.53rpx;
|
||||
|
||||
.goods_img {
|
||||
width: 100%;
|
||||
height: 294.74rpx;
|
||||
}
|
||||
.goods_img {
|
||||
width: 100%;
|
||||
height: 294.74rpx;
|
||||
}
|
||||
|
||||
.botm {
|
||||
flex: 1;
|
||||
padding: 0 14.04rpx;
|
||||
padding-bottom: 21.05rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
.botm {
|
||||
flex: 1;
|
||||
padding: 0 14.04rpx;
|
||||
padding-bottom: 21.05rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
.title {
|
||||
margin: 12px 0;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
.title {
|
||||
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;
|
||||
.goods_info {
|
||||
justify-content: space-between;
|
||||
|
||||
.g_img {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.g_img {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.g_name {
|
||||
margin-left: 8.77rpx;
|
||||
width: 100.63rpx;
|
||||
text-overflow: ellipsis;
|
||||
/* 溢出显示省略号 */
|
||||
overflow: hidden;
|
||||
/* 溢出隐藏 */
|
||||
white-space: nowrap;
|
||||
/* 强制不换行 */
|
||||
}
|
||||
.g_name {
|
||||
margin-left: 8.77rpx;
|
||||
width: 100.63rpx;
|
||||
text-overflow: ellipsis;
|
||||
/* 溢出显示省略号 */
|
||||
overflow: hidden;
|
||||
/* 溢出隐藏 */
|
||||
white-space: nowrap;
|
||||
/* 强制不换行 */
|
||||
}
|
||||
|
||||
.nice_box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.nice_box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.isshow {
|
||||
color: #FE3530 !important;
|
||||
}
|
||||
.isshow {
|
||||
color: #FE3530 !important;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.iconfont {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.icon-shoucang1 {
|
||||
color: #F84221;
|
||||
}
|
||||
.icon-shoucang1 {
|
||||
color: #F84221;
|
||||
}
|
||||
|
||||
.collect {
|
||||
font-size: 24rpx;
|
||||
margin-left: 5rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.collect {
|
||||
font-size: 24rpx;
|
||||
margin-left: 5rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -2,18 +2,26 @@
|
||||
<view class="Circle_friends">
|
||||
<view class="circle_friends_wrapper">
|
||||
|
||||
<view class="site-box flex_a_c_j_sb">
|
||||
<view class="place_wrapper flex_a_c" >
|
||||
<view class="iconfont icon-weizhi" style="margin-left: 20rpx;"></view>
|
||||
<view class="town_name">{{street}}</view>
|
||||
|
||||
<view class="">
|
||||
<view :class="['site-box ','flex_a_c_j_sb',isFshow?'sitbox':'']">
|
||||
<view :class="['place_wrapper','flex_a_c',isFshow?'sitbox':'']" @click="selectLocation">
|
||||
<view :class="['iconfont','icon-weizhi',isFshow?'sitbox':'']" 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?'sitbox':'']" style="color:#fff;"></view>
|
||||
</navigator>
|
||||
|
||||
</view>
|
||||
<view :class="['site-box ','flex_a_c_j_sb',isFshow?'sistbox':'']" v-if="isFshow">
|
||||
<view class="bg-img">
|
||||
<img :src="bgColor" alt="">
|
||||
</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 class="bg-img" v-if="isFshow">
|
||||
<img :src="bgColor" alt="">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@ -23,14 +31,50 @@
|
||||
|
||||
<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>
|
||||
:activeStyle="activeStyle" itemStyle="padding-left: 0px; height: 33px;"></u-tabs>
|
||||
</view>
|
||||
<view class="">
|
||||
|
||||
</view>
|
||||
<view class="goodslist">
|
||||
|
||||
|
||||
<view class="goods">
|
||||
<view v-for="(item,index) in cateGoods" :key="index" v-if='index%2!=0'>
|
||||
<view v-for="(item,index) in cateGoods" :key="index">
|
||||
|
||||
<view :class="[index%2==0?'goods_item':'goods_items']" @click="gogogo(item)">
|
||||
<view class="kk" v-if="index%2==0">
|
||||
|
||||
<image :src="item.image[0]" mode="aspectFill" style="width:'365rpx';height:251rpx">
|
||||
</image>
|
||||
</view>
|
||||
<view style="width:'365rpx';height:336rpx" v-else>
|
||||
<image :src="item.image[0]" mode="aspectFill" style="width:'365rpx';height:336rpx">
|
||||
</image>
|
||||
</view>
|
||||
<view class="goods_item_img" v-if="item.video_link.length>0">
|
||||
<image src="@/static/images/sp.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="botm">
|
||||
<view class="title">{{item.title}}</view>
|
||||
<view class="goods_info flex_a_c">
|
||||
<view class="l_info flex_a_c">
|
||||
<image :src="(item.author && item.author.avatar) || '/static/images/f.png'"
|
||||
mode="aspectFill" class="g_img"></image>
|
||||
<view class="g_name">{{item.author && item.author.nickname}}</view>
|
||||
</view>
|
||||
<view class="nice_box" @click.stop="giveStart(item)">
|
||||
<text class="iconfont"
|
||||
:class="item.relevance_id ? 'icon-shoucang1' : 'icon-dianzan'"></text>
|
||||
<text class="collect">{{item.count_start}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--<view class="goods">
|
||||
<view v-for="(item,i) in cateGoods" :key="i" v-if='i%2!=0'>
|
||||
<view class="goods_item" @click="gogogo(item)">
|
||||
<view style="height: 251rpx;">
|
||||
<u--image :src="item.image[0]" width="356rpx" height="251rpx" :showLoading="true"
|
||||
@ -62,40 +106,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods">
|
||||
<view v-for="(item,index) in cateGoods" :key="index" v-if='index%2==0'>
|
||||
<view class="goods_items" @click="gogogo(item)">
|
||||
|
||||
<view style="height: 336rpx;">
|
||||
<u--image :src="item.image[0]" width="356rpx" height="336rpx" :showLoading="true"
|
||||
lazyLoad fade duration="450">
|
||||
<template v-slot:loading>
|
||||
<u-loading-icon color="#f5f5f5"></u-loading-icon>
|
||||
</template>
|
||||
</u--image>
|
||||
</view>
|
||||
|
||||
<view class="goods_item_img" v-if="item.video_link.length>0">
|
||||
<image src="@/static/images/sp.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="botm">
|
||||
<view class="title">{{item.title}}</view>
|
||||
<view class="goods_info flex_a_c">
|
||||
<view class="l_info flex_a_c">
|
||||
<image :src="(item.author && item.author.avatar) || '/static/images/f.png'"
|
||||
mode="aspectFill" class="g_img"></image>
|
||||
<view class="g_name">{{item.author && item.author.nickname}}</view>
|
||||
</view>
|
||||
<view class="nice_box" @click.stop="giveStart(item)">
|
||||
<text class="iconfont"
|
||||
:class="item.relevance_id ? 'icon-shoucang1' : 'icon-dianzan'"></text>
|
||||
<text class="collect">{{item.count_start}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
-->
|
||||
|
||||
|
||||
|
||||
@ -132,7 +143,7 @@
|
||||
import mTabbar from '@/components/m-tabbar/m-tabbar.vue'
|
||||
import zbpSwiper from '@/components/zbpSwiper'
|
||||
import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue';
|
||||
|
||||
import Cache from '@/utils/cache';
|
||||
import {
|
||||
getSlideAPI
|
||||
} from '@/api/lihai.js'
|
||||
@ -190,7 +201,7 @@
|
||||
where: {
|
||||
category_id: 0,
|
||||
page: 1,
|
||||
limit: 15
|
||||
limit: 6
|
||||
},
|
||||
currentItemId: 69, // 默认获取 社区的数据 0 表示推荐 || 69 社区
|
||||
keyword: '',
|
||||
@ -206,14 +217,29 @@
|
||||
isFshow: false,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
street: {
|
||||
handler(newVal, oldVal) {
|
||||
this.street = newVal
|
||||
let arr = Cache.get('ADRESS_LOCATION')
|
||||
console.log(arr, '1')
|
||||
if (arr.length > 0) {
|
||||
this.street = arr.split(',')[0]
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.getCateList()
|
||||
this.cateGoods = []
|
||||
this.getGoods()
|
||||
this.selfLocation()
|
||||
|
||||
this.Area()
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
|
||||
this.getCateList()
|
||||
@ -236,36 +262,37 @@
|
||||
})
|
||||
|
||||
},
|
||||
onShow() {},
|
||||
|
||||
onReachBottom() {
|
||||
if (this.status == 'nomore') return;
|
||||
this.status = 'loading';
|
||||
this.where.limit = 2
|
||||
this.where.page = ++this.where.page;
|
||||
this.getGoods()
|
||||
},
|
||||
mounted() {
|
||||
// #ifdef H5
|
||||
|
||||
// #endif
|
||||
// 监听页面滚动事件
|
||||
window.addEventListener("scroll", this.scrolling);
|
||||
// #endif
|
||||
|
||||
|
||||
},
|
||||
// #ifdef APP-PLUS
|
||||
onPageScroll(e) {
|
||||
// this.scrollTop = e.scrollTop;
|
||||
console.log(e.scrollTop)
|
||||
if(e.scrollTop>0){
|
||||
this.isFshow=true
|
||||
}else{
|
||||
this.isFshow=false
|
||||
if (e.scrollTop > 0) {
|
||||
this.isFshow = true
|
||||
} else {
|
||||
this.isFshow = false
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// #endif
|
||||
|
||||
|
||||
methods: {
|
||||
|
||||
|
||||
scrolling() {
|
||||
// 滚动条距文档顶部的距离
|
||||
let scrollTop =
|
||||
@ -357,8 +384,16 @@
|
||||
res.data.length > 0 ? this.isYunCang = 1 : this.isYunCang = 0
|
||||
})
|
||||
},
|
||||
selectLocation() {
|
||||
this.showPicker = true
|
||||
},
|
||||
confirm(e) {
|
||||
this.where.street_id = e.value[1].code
|
||||
this.street = e.value[1].name
|
||||
Cache.set('ADRESS_LOCATION',
|
||||
e.value[1].name + ',' + e.value[1].name + ',' +
|
||||
|
||||
e.value[1].code
|
||||
)
|
||||
this.showPicker = false
|
||||
},
|
||||
changeHandler(e) {
|
||||
@ -458,10 +493,6 @@
|
||||
this.tabsData.list = [{
|
||||
cate_name: "推荐",
|
||||
category_id: 0
|
||||
}, {
|
||||
cate_name: "视频",
|
||||
category_id: -1,
|
||||
children: []
|
||||
}, ...data]
|
||||
},
|
||||
tabsChange(item) {
|
||||
@ -643,10 +674,30 @@
|
||||
background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%);
|
||||
}
|
||||
|
||||
|
||||
.sistbox {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
@keyframes fadenum {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
50% {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-img {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
top: 0;
|
||||
/* #ifdef MP || APP-PLUS */
|
||||
z-index: -100;
|
||||
@ -657,7 +708,7 @@
|
||||
z-index: -100;
|
||||
filter: blur(0);
|
||||
overflow: hidden;
|
||||
|
||||
transition: fadenum 3s linear;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
@ -667,15 +718,36 @@
|
||||
}
|
||||
}
|
||||
|
||||
.sitbox {
|
||||
opacity: 1 !important;
|
||||
background: #ac3525 !important;
|
||||
}
|
||||
|
||||
.site-box {
|
||||
width: 100%;
|
||||
height: 120rpx;
|
||||
/* #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;
|
||||
padding-top: 30rpx;
|
||||
/* #ifdef MP || APP-PLUS */
|
||||
padding-top: 75rpx;
|
||||
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
padding-top: 25rpx;
|
||||
/* #endif */
|
||||
// background-color: #e5e5e5;
|
||||
// opacity: 0;
|
||||
/* 初始时设置元素不透明 */
|
||||
transition: opacity 0.2s ease-in;
|
||||
transition-delay: 1.5s;
|
||||
transition: background 0.2s ease-in;
|
||||
padding-right: 20rpx;
|
||||
|
||||
// 位置
|
||||
@ -683,6 +755,9 @@
|
||||
color: #fff;
|
||||
margin-right: 24.56rpx;
|
||||
font-size: 30rpx;
|
||||
opacity: 0;
|
||||
transition: opacity 1s ease-in;
|
||||
transition-delay: 1.5s;
|
||||
|
||||
.town_name {
|
||||
margin-left: 21rpx;
|
||||
@ -690,6 +765,9 @@
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-size: 30rpx;
|
||||
|
||||
|
||||
font-size: 35.09rpx;
|
||||
}
|
||||
}
|
||||
@ -804,7 +882,7 @@
|
||||
}
|
||||
|
||||
.goodslist {
|
||||
display: flex;
|
||||
// display: flex;
|
||||
margin: 0 auto;
|
||||
width: 725rpx;
|
||||
}
|
||||
@ -813,9 +891,13 @@
|
||||
margin: 0 auto;
|
||||
width: 725rpx;
|
||||
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
|
||||
.goods_item {
|
||||
width: 356rpx;
|
||||
height: 450rpx;
|
||||
border: 1px solid;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
@ -823,6 +905,12 @@
|
||||
flex-direction: column;
|
||||
margin-bottom: 10.53rpx;
|
||||
position: relative;
|
||||
margin-top: -40rpx;
|
||||
|
||||
.kk {
|
||||
width: 365rpx;
|
||||
height: 251rpx;
|
||||
}
|
||||
|
||||
.goods_item_img {
|
||||
position: absolute;
|
||||
@ -919,7 +1007,7 @@
|
||||
|
||||
.goods_items {
|
||||
width: 356rpx;
|
||||
height: 536rpx;
|
||||
|
||||
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
|
@ -20,8 +20,8 @@
|
||||
】
|
||||
-->
|
||||
<!-- 头部导航 -->
|
||||
<view v-if="!isUser" class="header" :style="{backgroundColor:currentNav==1?'':'#fff'}" >
|
||||
<!-- <view class="items" @click.stop="navTap(2)">
|
||||
<!-- <view v-if="!isUser" class="header" :style="{backgroundColor:currentNav==1?'':'#000'}" >
|
||||
<view class="items" @click.stop="navTap(2)">
|
||||
<text class="tName" :class="currentNav==2?'on':''">关注</text>
|
||||
</view>
|
||||
<view class="items" @click.stop="navTap(1)">
|
||||
@ -29,14 +29,14 @@
|
||||
</view>
|
||||
<view class="items" @click.stop="navTap(3)">
|
||||
<text class="tName" :class="currentNav==3?'on':''">列表</text>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="noVideo acea-row row-center-wrapper" v-if="!dataList.length && !loadVideo">
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="noVideo acea-row row-center-wrapper" v-if="!dataList.length && !loadVideo">
|
||||
<view>
|
||||
<image :src="imgHost+'/static/no-video.png'" class="pictrue"></image>
|
||||
<text class="tips">暂无短视频内容哦~</text>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view v-if="currentNav !== 3" :style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;'">
|
||||
<!--
|
||||
1.这里的 swiper 不是用来控制视频滑动的,而是用来控制左右滑动的,如果不需要的可以改成 view
|
||||
@ -49,7 +49,7 @@
|
||||
-->
|
||||
<list @loadmore="getData" @scroll="scrolls" :loadmoreoffset="wHeight*1" :show-scrollbar="false" ref="listBox"
|
||||
:pagingEnabled="true" :scrollable="true">
|
||||
<!-- 刷新模块 -->
|
||||
|
||||
<refresh class="refresh" @refresh="onrefresh" @pullingdown="onpullingdown"
|
||||
:display="refreshing ? 'show' : 'hide'">
|
||||
<loading style="background-color: #FFFFFF;">
|
||||
@ -63,7 +63,7 @@
|
||||
<!-- 用div把视频模组套起来 -->
|
||||
<div :style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;'">
|
||||
<!-- <view v-if="Math.abs(k-i)<=1"> -->
|
||||
<view v-if="max > i">
|
||||
<view v-if="Math.abs(k-i)<=1">
|
||||
<view class="root">
|
||||
<!--
|
||||
具体视频参数可以参考官方文档
|
||||
@ -300,6 +300,7 @@
|
||||
<view class="fixed-head">
|
||||
<view class="sys-head" :style="{height:statusBarHeight}"></view>
|
||||
<view class="tool-bar" @click='goBack()'>
|
||||
|
||||
<image class="icon-xiangzuo" src="../static/img/index/icon-back.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
@ -368,7 +369,7 @@
|
||||
newTime: 0, //跟手滑动后的最新时间💗
|
||||
timeNumber: 0, //🌟💗
|
||||
ProgressBarBottom: 20, //进度条离底部的距离💗
|
||||
object_fit: 'contain', //视频样式默认包含🌟💗
|
||||
object_fit: 'cover', //视频样式默认包含🌟💗
|
||||
mode: 'aspectFit', //图片封面样式🌟💗
|
||||
timeout: "", //🌟用来阻止 setTimeout()方法
|
||||
voice: "", //🌟用来阻止 setTimeout()方法
|
||||
@ -1633,6 +1634,7 @@
|
||||
|
||||
.root {
|
||||
background-color: #000000;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
|
@ -1198,7 +1198,7 @@
|
||||
this.isTriggered = true;
|
||||
const newList = this.goods.reverse();
|
||||
this.goods = newList;
|
||||
this.getProductSpu()
|
||||
// this.getProductSpu()
|
||||
setTimeout(() => {
|
||||
this.isTriggered = false;
|
||||
}, 500)
|
||||
@ -1210,7 +1210,7 @@
|
||||
// 模拟触底刷新
|
||||
if (this.tabActive == 0) {
|
||||
setTimeout(() => {
|
||||
this.goods.push(...this.goods);
|
||||
// this.goods.push(...this.goods);
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
@ -1220,7 +1220,8 @@
|
||||
setTimeout(() => {
|
||||
const newList = this.goods.reverse();
|
||||
this.goods = newList;
|
||||
this.getProductSpu()
|
||||
// this.getGoods()
|
||||
// this.getProductSpu()
|
||||
// uni.startPullDownRefresh();
|
||||
// uni.stopPullDownRefresh();
|
||||
}, 500)
|
||||
|
@ -84,7 +84,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<u-picker :defaultIndex="defaInd" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm"
|
||||
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker> columnData: [],
|
||||
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker>
|
||||
<!-- <view class="bg_color"></view> -->
|
||||
|
||||
<!-- <m-tabbar native>
|
||||
@ -98,6 +98,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Cache from '@/utils/cache';
|
||||
import zbpSwiper from '@/components/zbpSwiper'
|
||||
import {
|
||||
getArea,
|
||||
@ -180,6 +181,21 @@
|
||||
// #endif
|
||||
|
||||
|
||||
},
|
||||
watch: {
|
||||
street: {
|
||||
handler(newVal, oldVal) {
|
||||
this.street = newVal
|
||||
let arr = Cache.get('ADRESS_LOCATION')
|
||||
console.log(arr,'3')
|
||||
if (arr.length > 0) {
|
||||
this.street=arr.split(',')[0]
|
||||
this.town = arr.split(',')[1]
|
||||
this.street_id =arr.split(',')[2]
|
||||
this.getCloudShopMerId(this.street_id)
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
// #ifdef APP-PLUS
|
||||
onPageScroll(e) {
|
||||
@ -196,11 +212,16 @@
|
||||
methods: {
|
||||
confirm(e) {
|
||||
this.street = e.value[1].name
|
||||
this.town= e.value[1].name
|
||||
this.town = e.value[1].name
|
||||
this.showPicker = false
|
||||
this.street_id = e.value[1].id
|
||||
this.getCloudShopMerId(e.value[1].id)
|
||||
|
||||
this.street_id = e.value[1].code
|
||||
this.getCloudShopMerId(e.value[1].code)
|
||||
|
||||
Cache.set('ADRESS_LOCATION',
|
||||
this.street + ','+ this.town+','+
|
||||
|
||||
this.street_id
|
||||
)
|
||||
},
|
||||
changeHandler(e) {
|
||||
const {
|
||||
@ -304,9 +325,15 @@
|
||||
lat: latitude,
|
||||
long: longitude
|
||||
}).then(res => {
|
||||
this.street = res.data.address_component.street
|
||||
this.street = res.data.address_component.street
|
||||
this.town = res.data.address_reference.town.title
|
||||
this.street_id = res.data.address_reference.town.id
|
||||
|
||||
Cache.set('ADRESS_LOCATION',
|
||||
this.street + ','+ this.town+','+
|
||||
this.street_id
|
||||
)
|
||||
|
||||
this.getCloudShopMerId(this.street_id)
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
@ -325,12 +352,12 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
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 => {
|
||||
@ -432,7 +459,12 @@
|
||||
|
||||
.site-box {
|
||||
width: 100%;
|
||||
height: 120rpx;
|
||||
/* #ifdef MP || APP-PLUS */
|
||||
height: 170rpx;
|
||||
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
height: 120rpx;
|
||||
/* #endif */
|
||||
margin-bottom: 26.32rpx;
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
|
Loading…
x
Reference in New Issue
Block a user