更新首页内容

This commit is contained in:
jia 2023-08-31 21:15:39 +08:00
parent bd284d477f
commit 0f11c59662
12 changed files with 793 additions and 151 deletions

View File

@ -4,7 +4,10 @@
<view class="bg-img"> <view class="bg-img">
<img :src="bgColor" alt=""> <img :src="bgColor" alt="">
</view> </view>
<view class="site-box flex_a_c_j_sb"> <view class="" style="height: 40rpx;">
</view>
<!-- <view class="site-box flex_a_c_j_sb">
<view class="place_wrapper flex_a_c" @click="selectLocation"> <view class="place_wrapper flex_a_c" @click="selectLocation">
<view class="iconfont icon-weizhi"></view> <view class="iconfont icon-weizhi"></view>
<view class="town_name">{{street}}</view> <view class="town_name">{{street}}</view>
@ -14,12 +17,12 @@
<view class="iconfont icon-xiaoxi" style="color:#fff;"></view> <view class="iconfont icon-xiaoxi" style="color:#fff;"></view>
</navigator> </navigator>
</view> </view> -->
<!-- 搜索栏 --> <!-- 搜索栏 -->
<navigator url="/pages/columnGoods/goods_search/index" hover-class="none" class="search_content flex_a_c_j_sb"> <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="flex_a_c">
<view class="iconfont icon-sousuo"></view> <view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<input type="text" v-model="keyword" placeholder="搜索产品或店铺" disabled> <input type="text" v-model="keyword" placeholder="搜索产品或店铺" placeholder-style="font-size: 30rpx;" disabled>
</view> </view>
<button class="search_btn">搜索</button> <button class="search_btn">搜索</button>
</navigator> </navigator>
@ -30,7 +33,7 @@
indicator-active-color="#fff"> indicator-active-color="#fff">
<block v-for="(item,index) in swiper['url']" :key="index"> <block v-for="(item,index) in swiper['url']" :key="index">
<swiper-item class="swi_item" @click="swiperClick(item)"> <swiper-item class="swi_item" @click="swiperClick(item)">
<u--image :showLoading="true" :src="item.img" width="694.74rpx" height="242.11rpx" <u--image :showLoading="true" :src="item.img" width="724rpx" height="259rpx"
mode="aspectFill"> mode="aspectFill">
</u--image> </u--image>
</swiper-item> </swiper-item>
@ -94,18 +97,26 @@
}, },
} }
}, },
watch: {
street: {
handler(newVal, oldVal) {
this.street = newVal
},
}
},
created() { created() {
this.appLocation()
this.getBanner() this.getBanner()
this.Area() this.Area()
}, },
onShow() {
this.street = uni.getStorageSync('adress_location') mounted() {
this.appLocation()
}, },
methods: { methods: {
swiperClick(item) { swiperClick(item) {
const url = item.info[1].value const url = item.info[1].value
@ -117,7 +128,7 @@
this.isSelectPlace ? this.showPicker = true : '' this.isSelectPlace ? this.showPicker = true : ''
}, },
async appLocation() { appLocation() {
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'wgs84',
timeout: '10', timeout: '10',
@ -131,11 +142,8 @@
lat: latitude, lat: latitude,
long: longitude long: longitude
}).then(res => { }).then(res => {
this.street = res.data.address_component.street this.street = res.data.address_component.street
uni.setStorageSync('adress_location', res.data.address_component Cache.set('ADRESS_LOCATION', this.street)
.street)
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err, title: err,
@ -154,12 +162,10 @@
}); });
}, },
confirm(e) { confirm(e) {
this.street = uni.setStorageSync('adress_location', e.value[1].name) ? uni.setStorageSync( this.street = e.value[1].name
'adress_location', e.value[1].name) : e.value[1].name
this.showPicker = false this.showPicker = false
this.$emit('selectPlce', e) this.$emit('selectPlce', e)
uni.setStorageSync('adress_location', e.value[1].name) Cache.set('ADRESS_LOCATION', e.value[1].name)
}, },
changeHandler(e) { changeHandler(e) {
const { const {
@ -200,6 +206,7 @@
} = e.detail; } = e.detail;
if (source === 'autoplay' || source === 'touch') { if (source === 'autoplay' || source === 'touch') {
this.bgColor = this.swiper.url[e.detail.current]['img'] this.bgColor = this.swiper.url[e.detail.current]['img']
this.$emit('kkchange',this.bgColor)
} }
}, },
// //
@ -244,7 +251,7 @@
transform: translate(-50%, 0); transform: translate(-50%, 0);
width: 102%; width: 102%;
height: 133px; height: 133px;
border-radius: 30px 30px 0 0; border-radius: 30px 30px 0 0;
background-color: #fff; background-color: #fff;
} }
@ -282,10 +289,10 @@
.place_wrapper { .place_wrapper {
color: #fff; color: #fff;
margin-right: 24.56rpx; margin-right: 24.56rpx;
font-size: 31.58rpx; font-size: 30rpx;
.town_name { .town_name {
margin-left: 10.53rpx; margin-left: 21rpx;
} }
} }
@ -300,12 +307,12 @@
.search_content { .search_content {
margin: 0 auto; margin: 0 auto;
width: 694.74rpx; width: 724rpx;
height: 61.4rpx; height: 74rpx;
padding: 2px 2px 2px 21.05rpx; padding: 2px 2px 2px 21.05rpx;
border-radius: 100px; border-radius: 175rpx;
background: #fff; background: #fff;
margin-bottom: 17.54rpx; margin-bottom: 21rpx;
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
@ -333,15 +340,15 @@
z-index: 2; z-index: 2;
.swiper { .swiper {
width: 694.74rpx; width: 724rpx;
height: 242.11rpx; height: 259rpx;
margin: 0 auto; margin: 0 auto;
border-radius: 15px; border-radius: 20rpx 20rpx 20rpx 20rpx;
overflow: hidden; overflow: hidden;
.swi_item { .swi_item {
width: 100%; width: 100%;
height: 242.11rpx; height: 259rpx;
} }
} }
} }

View File

@ -38,4 +38,6 @@ module.exports = {
CACHE_LONGITUDE: 'LONGITUDE', CACHE_LONGITUDE: 'LONGITUDE',
//缓存纬度 //缓存纬度
CACHE_LATITUDE: 'LATITUDE', CACHE_LATITUDE: 'LATITUDE',
//缓存地址信息
ADRESS_LOCATION:'ADRESS_LOCATION'
} }

View File

@ -2,8 +2,8 @@
"name" : "惠农生活", "name" : "惠农生活",
"appid" : "__UNI__3A527D1", "appid" : "__UNI__3A527D1",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.1.0",
"versionCode" : 100, "versionCode" : 110,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

View File

@ -280,6 +280,7 @@
// console.log(res) // console.log(res)
this.detaile_address = res.data.address; this.detaile_address = res.data.address;
this.recommend_address = res.data.address.length > 4 ? res.data.address.slice(0,4) + '...' : res.data.address this.recommend_address = res.data.address.length > 4 ? res.data.address.slice(0,4) + '...' : res.data.address
uni.setStorageSync('adress_location',res.data.address)
}) })
}, },
fail: (res) => { fail: (res) => {

View File

@ -1,6 +1,20 @@
<template> <template>
<view class="gather"> <view class="gather">
<zbpSwiper :isSelectPlace="true" :location_Arr="locationArr"></zbpSwiper> <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>
<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>
<zbpSwiper :isSelectPlace="true" :location_Arr="locationArr" @kkchange='kkchange'></zbpSwiper>
<u-empty :show="jurisdiction" marginTop="260" mode="permission" :text="emptyText" <u-empty :show="jurisdiction" marginTop="260" mode="permission" :text="emptyText"
icon="http://cdn.uviewui.com/uview/empty/permission.png"></u-empty> icon="http://cdn.uviewui.com/uview/empty/permission.png"></u-empty>
<block v-if="isShow"> <block v-if="isShow">
@ -127,7 +141,7 @@
</image> </image>
<text class="text">商户设置</text> <text class="text">商户设置</text>
</view> </view>
<!-- <view class="examine" <!-- <view class="examine"
@click="navigator(`/pages/users/trading_hall/index?mer_id=${mer_id}`)"> @click="navigator(`/pages/users/trading_hall/index?mer_id=${mer_id}`)">
<image class="icon_img" src="@/static/images/diaohuo.png" mode="aspectFill"> <image class="icon_img" src="@/static/images/diaohuo.png" mode="aspectFill">
</image> </image>
@ -239,7 +253,7 @@
</view> </view>
</template> </template>
</m-tabbar> --> </m-tabbar> -->
<view class="" v-if='jurisdiction==false&&isShow==false'> <view class="" v-if='jurisdiction==false&&isShow==false'>
<emptyPage title="暂无信息"></emptyPage> <emptyPage title="暂无信息"></emptyPage>
</view> </view>
@ -263,6 +277,7 @@
getUserInfo getUserInfo
} from '@/api/user.js' } from '@/api/user.js'
import { import {
getGeocoder,
microSeachBarCode, microSeachBarCode,
microEadtProduct microEadtProduct
} from '@/api/store.js' } from '@/api/store.js'
@ -272,6 +287,7 @@
import { import {
getDiy getDiy
} from '@/api/api.js' } from '@/api/api.js'
export default { export default {
components: { components: {
mTabbar, mTabbar,
@ -280,7 +296,7 @@
}, },
data() { data() {
return { return {
locationArr: ({}), locationArr: ({}),
emptyText: '暂无可用应用', emptyText: '暂无可用应用',
jurisdiction: false, // jurisdiction: false, //
mer_id: '', mer_id: '',
@ -290,7 +306,10 @@
} }
}, },
prefix: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/11/', prefix: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/11/',
isShow: false isShow: false,
bgColor: '',
isFshow: false,
street:''
}; };
}, },
computed: { computed: {
@ -307,13 +326,111 @@
this.jurisdiction = true this.jurisdiction = true
} }
this.getUserInfo() this.getUserInfo()
this.appLocation()
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getUserInfo() this.getUserInfo()
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}, },
mounted() {
this.appLocation()
// #ifdef H5
//
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
}
},
// #endif
methods: { methods: {
appLocation() {
uni.getLocation({
type: 'wgs84',
timeout: '10',
success: (res) => {
// console.log(res)
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();
getGeocoder({
lat: latitude,
long: longitude
}).then(res => {
this.street = res.data.address_component.street
Cache.set('ADRESS_LOCATION', this.street)
}).catch(err => {
uni.showToast({
title: err,
icon: 'none'
})
})
},
fail: (err) => {
uni.showToast({
title: "获取定位超时",
icon: 'none',
duration: 2000
});
}
});
},
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 (scrollStep < 0) {
this.isFshow = false
console.log("header 滚动条向上滚动了!");
} else {
this.isFshow = true
console.log("header 滚动条向下滚动了!");
}
//
if (scrollTop <= 0) {
this.isFshow = false
console.log("header 到了最顶部")
}
},
kkchange(e) {
this.bgColor = e
},
navigator(url, t) { navigator(url, t) {
// if (this.userInfoData.is_wsxx === 0 && t != '') return Toast(""); // if (this.userInfoData.is_wsxx === 0 && t != '') return Toast("");
uni.navigateTo({ uni.navigateTo({
@ -348,6 +465,58 @@
background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%); background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%);
} }
.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);
}
}
.site-box {
width: 100%;
height: 120rpx;
margin-bottom: 26.32rpx;
position: absolute;
top: 0rpx;
position: fixed;
z-index: 999;
padding-top: 30rpx;
padding-right: 20rpx;
//
.place_wrapper {
color: #fff;
margin-right: 24.56rpx;
font-size: 30rpx;
.town_name {
margin-left: 21rpx;
}
}
.iconfont {
font-size: 35.09rpx;
}
}
.top_box { .top_box {
// padding-top: 180rpx; // padding-top: 180rpx;
background: linear-gradient(#36A2FF, #fff); background: linear-gradient(#36A2FF, #fff);

View File

@ -1350,7 +1350,7 @@
postCartAdd(q) postCartAdd(q)
.then(function(res) { .then(function(res) {
that.isOpen = that.attr.cartAttr = false; that.isOpen = that.attr.cartAttr = false;
console.log(that.storeInfo); // console.log(that.storeInfo);
if (news) { if (news) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/users/order_confirm/index?cartId=${res.data.cart_id}&type_id=${that.storeInfo.merchant.type_id}` url: `/pages/users/order_confirm/index?cartId=${res.data.cart_id}&type_id=${that.storeInfo.merchant.type_id}`

View File

@ -2,94 +2,103 @@
<view class="Circle_friends"> <view class="Circle_friends">
<view class="circle_friends_wrapper"> <view class="circle_friends_wrapper">
<zbpSwiper :isSelectPlace="true" :location_Arr="locationArr"></zbpSwiper> <view class="site-box flex_a_c_j_sb">
<view class="tabs_wrapper flex_a_c_j_sb" style="margin-top: 30rpx;"> <view class="place_wrapper flex_a_c" >
<view class="title flex_a_c">热点资讯</view> <view class="iconfont icon-weizhi" style="margin-left: 20rpx;"></view>
<navigator class="flex_a_c" hover-class="none" url="/pages/news_list/index?type=1"> <view class="town_name">{{street}}</view>
更多 </view>
<view class="iconfont icon-gengduo3"></view>
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
<view class="iconfont icon-xiaoxi" style="color:#fff;"></view>
</navigator> </navigator>
</view> <view class="bg-img" v-if="isFshow">
<view class="article_box"> <img :src="bgColor" alt="">
<block v-for="(item, index) in recoList.slice(0,2)" :key="index"> </view>
<navigator :url='"/pages/news_details/index?id="+item.article_id' hover-class='none'
class='article-item'>
<view class='text'>
<view class='name'>{{item.title}}</view>
<view class="time">{{item.create_time}}</view>
</view>
<view class='pictrue'>
<image :src='item.image_input'></image>
</view>
</navigator>
</block>
</view>
<view class="empty_wrapper" v-if="recoList.length==0">
<u-empty></u-empty>
</view>
<view class="tabs_wrapper">
<u-tabs :list="tabsData1.list" @click="tabsChange1" keyName="title" lineColor="#F84221"></u-tabs>
</view> </view>
<view class="goods">
<block v-for="(item,index) in articleList" :key="index"> <zbpSwiper :isSelectPlace="true" :location_Arr="locationArr" @kkchange='kkchange'></zbpSwiper>
<view class="goods_item" @click="article(item)">
<image class="goods_img" :src="item.image_input" 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}}</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="articleList.length==0">
<u-empty></u-empty>
</view>
<view class="tabs_wrapper"> <view class="tabs_wrapper">
<u-tabs :list="tabsData.list" @click="tabsChange" lineColor="#F84221" keyName="cate_name"></u-tabs> <u-tabs :list="tabsData.list" @click="tabsChange" lineColor="#F84221" keyName="cate_name"
:activeStyle="activeStyle" itemStyle="padding-left: 0px; height: 33px;"></u-tabs>
</view> </view>
<view class=""> <view class="">
</view> </view>
<view class="goodslist">
<view class="goods">
<view v-for="(item,index) in cateGoods" :key="index" v-if='index%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"
lazyLoad fade duration="450">
<template v-slot:loading>
<u-loading-icon color="#f5f5f5"></u-loading-icon>
</template>
</u--image>
</view>
<view class="goods"> <view class="goods_item_img" v-if="item.video_link.length>0">
<block v-for="(item,index) in cateGoods" :key="index"> <image src="@/static/images/sp.png" mode="aspectFill"></image>
<view class="goods_item" @click="gogogo(item)"> </view>
<view style="height: 294.74rpx;"> <view class="botm">
<u--image :src="item.image[0]" width="342.11rpx" height="294.74rpx" :showLoading="true" <view class="title">{{item.title}}</view>
lazyLoad fade duration="450"> <view class="goods_info flex_a_c">
<template v-slot:loading> <view class="l_info flex_a_c">
<u-loading-icon color="#f5f5f5"></u-loading-icon> <image :src="(item.author && item.author.avatar) || '/static/images/f.png'"
</template> mode="aspectFill" class="g_img"></image>
</u--image> <view class="g_name">{{item.author && item.author.nickname}}</view>
</view> </view>
<view class="botm"> <view class="nice_box" @click.stop="giveStart(item)">
<view class="title">{{item.title}}</view> <text class="iconfont"
<view class="goods_info flex_a_c"> :class="item.relevance_id ? 'icon-shoucang1' : 'icon-dianzan'"></text>
<view class="l_info flex_a_c"> <text class="collect">{{item.count_start}}</text>
<image :src="(item.author && item.author.avatar) || '/static/images/f.png'" </view>
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> </view>
</block> </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>
</view> </view>
<view class="empty_wrapper" v-if="emptyShow"> <view class="empty_wrapper" v-if="emptyShow">
<u-empty :show="emptyShow" mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png"></u-empty> <u-empty :show="emptyShow" mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png"></u-empty>
@ -157,7 +166,12 @@
}, },
data() { data() {
return { return {
activeStyle: {
color: '#333333',
fontWeight: 'bold',
transform: 'scale(1.04)'
},
isshow: false, isshow: false,
locationArr: ({}), locationArr: ({}),
status: 'loadmore', status: 'loadmore',
@ -186,7 +200,10 @@
cateGoods: [], cateGoods: [],
recoList: [], recoList: [],
articleList: [], articleList: [],
streeta_id: '' streeta_id: '',
street: '',
bgColor: '',
isFshow: false,
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
@ -226,7 +243,72 @@
this.where.page = ++this.where.page; this.where.page = ++this.where.page;
this.getGoods() this.getGoods()
}, },
mounted() {
// #ifdef H5
// #endif
//
window.addEventListener("scroll", this.scrolling);
},
// #ifdef APP-PLUS
onPageScroll(e) {
// this.scrollTop = e.scrollTop;
console.log(e.scrollTop)
if(e.scrollTop>0){
this.isFshow=true
}else{
this.isFshow=false
}
},
// #endif
methods: { methods: {
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 (scrollStep < 0) {
this.isFshow = false
console.log("header 滚动条向上滚动了!");
} else {
this.isFshow = true
console.log("header 滚动条向下滚动了!");
}
//
if (scrollTop <= 0) {
this.isFshow = false
console.log("header 到了最顶部")
}
},
kkchange(e) {
this.bgColor = e
},
tabsChange1(item) { tabsChange1(item) {
this.getArticleList(item.article_category_id) this.getArticleList(item.article_category_id)
this.streeta_id = item.id this.streeta_id = item.id
@ -311,7 +393,7 @@
}); });
}, },
gogogo(item) { gogogo(item) {
if (this.tabsData.tabsActive == 1) { if (item.video_link.length > 0) {
uni.navigateTo({ uni.navigateTo({
// #ifdef MP || H5 // #ifdef MP || H5
@ -412,10 +494,11 @@
lat: latitude, lat: latitude,
long: longitude long: longitude
}).then(res => { }).then(res => {
uni.setStorageSync('adress_location',res.data.address) uni.setStorageSync('adress_location', res.data.address)
// that.$store.dispatch('setLocation', res.data) // that.$store.dispatch('setLocation', res.data)
// that.street = res.data.address_component.street this.street = res.data.address_component.street
Cache.set('ADRESS_LOCATION', this.street)
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err, title: err,
@ -521,6 +604,8 @@
<style lang="scss"> <style lang="scss">
page { page {
background-color: #F4F7FE;
;
// background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%); // background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%);
} }
@ -554,14 +639,77 @@
.Circle_friends { .Circle_friends {
position: relative; position: relative;
padding: 0 0 87.72rpx 0; padding: 0 0 87.72rpx 0;
background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%); background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%);
} }
.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);
}
}
.site-box {
width: 100%;
height: 120rpx;
margin-bottom: 26.32rpx;
position: absolute;
top: 0rpx;
position: fixed;
z-index: 999;
padding-top: 30rpx;
padding-right: 20rpx;
//
.place_wrapper {
color: #fff;
margin-right: 24.56rpx;
font-size: 30rpx;
.town_name {
margin-left: 21rpx;
}
}
.iconfont {
font-size: 35.09rpx;
}
}
.circle_friends_wrapper { .circle_friends_wrapper {
position: relative; position: relative;
z-index: 2; z-index: 2;
} }
/deep/.u-tabs__wrapper__nav__line {
width: 46rpx;
}
/deep/.u-tabs__wrapper__nav__item {
padding: 0 0px;
padding-right: 10rpx;
}
.search_wrapper { .search_wrapper {
width: 694.74rpx; width: 694.74rpx;
@ -569,9 +717,11 @@
} }
.tabs_wrapper { .tabs_wrapper {
width: 694.74rpx; width: 720rpx;
margin: 0 auto; margin: 0 auto;
margin-bottom: 21.05rpx; margin-bottom: 21.05rpx;
// margin-left: -20rpx;
} }
.empty_wrapper { .empty_wrapper {
@ -634,8 +784,8 @@
} }
.tabs_wrapper { .tabs_wrapper {
width: 694.74rpx; width: 723rpx;
margin: 38.6rpx auto; margin: 0rpx auto;
margin-bottom: 21.05rpx; margin-bottom: 21.05rpx;
.title { .title {
@ -653,22 +803,39 @@
} }
} }
.goodslist {
display: flex;
margin: 0 auto;
width: 725rpx;
}
.goods { .goods {
margin: 0 auto; margin: 0 auto;
width: 694.74rpx; width: 725rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.goods_item { .goods_item {
width: 342.11rpx; width: 356rpx;
height: 491.23rpx; height: 450rpx;
border-radius: 8px; border-radius: 8px;
overflow: hidden; overflow: hidden;
background-color: #fff; background-color: #fff;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-bottom: 10.53rpx; 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 { .goods_img {
width: 100%; width: 100%;
@ -691,6 +858,10 @@
justify-content: space-between; justify-content: space-between;
.title { .title {
font-size: 30rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
margin: 12px 0; margin: 12px 0;
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
@ -704,8 +875,8 @@
justify-content: space-between; justify-content: space-between;
.g_img { .g_img {
width: 60rpx; width: 49rpx;
height: 60rpx; height: 49rpx;
border-radius: 50%; border-radius: 50%;
} }
@ -744,5 +915,111 @@
} }
} }
} }
.goods_items {
width: 356rpx;
height: 536rpx;
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> </style>

View File

@ -20,8 +20,8 @@
--> -->
<!-- 头部导航 --> <!-- 头部导航 -->
<view v-if="!isUser" class="header" :style="{backgroundColor:'#FC4E09'}" > <view v-if="!isUser" class="header" :style="{backgroundColor:currentNav==1?'':'#fff'}" >
<view class="items" @click.stop="navTap(2)"> <!-- <view class="items" @click.stop="navTap(2)">
<text class="tName" :class="currentNav==2?'on':''">关注</text> <text class="tName" :class="currentNav==2?'on':''">关注</text>
</view> </view>
<view class="items" @click.stop="navTap(1)"> <view class="items" @click.stop="navTap(1)">
@ -29,7 +29,7 @@
</view> </view>
<view class="items" @click.stop="navTap(3)"> <view class="items" @click.stop="navTap(3)">
<text class="tName" :class="currentNav==3?'on':''">列表</text> <text class="tName" :class="currentNav==3?'on':''">列表</text>
</view> </view> -->
</view> </view>
<view class="noVideo acea-row row-center-wrapper" v-if="!dataList.length && !loadVideo"> <view class="noVideo acea-row row-center-wrapper" v-if="!dataList.length && !loadVideo">
<view> <view>

View File

@ -15,7 +15,7 @@
<!-- 头部导航 --> <!-- 头部导航 -->
<view v-if="!isUser" class="header" :style="{backgroundColor:'#FC4E09'}"> <view v-if="!isUser" class="header" :style="{backgroundColor:currentNav==1?'':'#ffffff'}">
<view class="tool-bar"> <view class="tool-bar">
<view class='iconfont icon-xiangzuo' @tap='goBack'></view> <view class='iconfont icon-xiangzuo' @tap='goBack'></view>

View File

@ -2,7 +2,22 @@
<view class="Circle_friends"> <view class="Circle_friends">
<view class="circle_friends_wrapper"> <view class="circle_friends_wrapper">
<zbpSwiper :isSelectPlace="true" @selectPlce="selectPlce" :location_Arr="locationArr"></zbpSwiper> <view class="site-box flex_a_c_j_sb">
<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>
<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>
<zbpSwiper :isSelectPlace="true" @kkchange='kkchange' :location_Arr="locationArr">
</zbpSwiper>
<view class="shop_wrapper"> <view class="shop_wrapper">
<!-- locationArr.address_reference.town.id --> <!-- locationArr.address_reference.town.id -->
<navigator class="l_yun" hover-class="none" <navigator class="l_yun" hover-class="none"
@ -68,7 +83,8 @@
<u-empty :show="emptyShow" mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png"></u-empty> <u-empty :show="emptyShow" mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png"></u-empty>
</view> </view>
</view> </view>
<u-picker :defaultIndex="defaInd" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm"
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker> columnData: [],
<!-- <view class="bg_color"></view> --> <!-- <view class="bg_color"></view> -->
<!-- <m-tabbar native> <!-- <m-tabbar native>
@ -83,6 +99,10 @@
<script> <script>
import zbpSwiper from '@/components/zbpSwiper' import zbpSwiper from '@/components/zbpSwiper'
import {
getArea,
getStreet
} from '@/api/article.js';
import { import {
mapGetters mapGetters
} from 'vuex' } from 'vuex'
@ -111,6 +131,7 @@
}, },
data() { data() {
return { return {
defaInd: [0, 0],
tabsData: { tabsData: {
list: [], list: [],
tabsActive: 0 tabsActive: 0
@ -120,7 +141,7 @@
emptyShow: false, emptyShow: false,
articleList: [], articleList: [],
recoList: [], recoList: [],
columnData: [],
bgData: [{ bgData: [{
pic: '' pic: ''
}, { }, {
@ -129,10 +150,15 @@
store_id: '', store_id: '',
locationArr: ({}), locationArr: ({}),
setrecommend_address: "", setrecommend_address: "",
isYunCang: 0 isYunCang: 0,
bgColor: '',
isFshow: false,
street: '',
showPicker: false,
} }
}, },
onLoad() { onLoad() {
this.Area()
this.appLocation() this.appLocation()
getHotBanner('good').then(res => { getHotBanner('good').then(res => {
// console.log(res); // console.log(res);
@ -142,14 +168,129 @@
getArticleList(19).then(res => { getArticleList(19).then(res => {
this.recoList = res.data.list this.recoList = res.data.list
}) })
this.getTownAndStoreId() // this.getTownAndStoreId()
}, },
onShow() {}, onShow() {},
computed: mapGetters(['location']), // computed: mapGetters(['location']),
mounted() {
// #ifdef H5
//
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
}
},
// #endif
methods: { methods: {
appLocation() { confirm(e) {
this.street = 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)
},
changeHandler(e) {
const {
columnIndex,
value,
values,
index,
picker = this.$refs.uPicker
} = e;
if (columnIndex === 0) {
getStreet({
area_code: value[0]['code']
}).then(res => {
picker.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);
});
},
swiperChange(e) {
let {
current,
source
} = e.detail;
if (source === 'autoplay' || source === 'touch') {
this.bgColor = this.swiper.url[e.detail.current]['img']
this.$emit('kkchange', this.bgColor)
}
},
selectLocation() {
this.showPicker = true
},
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 (scrollStep < 0) {
this.isFshow = false
console.log("header 滚动条向上滚动了!");
} else {
this.isFshow = true
console.log("header 滚动条向下滚动了!");
}
//
if (scrollTop <= 0) {
this.isFshow = false
console.log("header 到了最顶部")
}
},
kkchange(e) {
this.bgColor = e
},
async appLocation() {
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'wgs84',
@ -163,10 +304,10 @@
lat: latitude, lat: latitude,
long: longitude long: longitude
}).then(res => { }).then(res => {
console.log(res.data.address_reference.town) this.street = res.data.address_component.street
this.town = res.data.address_reference.town.title this.town = res.data.address_reference.town.title
this.street_id = res.data.address_reference.town.id this.street_id = res.data.address_reference.town.id
this.getCloudShopMerId(res.data.address_reference.town.id) this.getCloudShopMerId(this.street_id)
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err, title: err,
@ -184,18 +325,12 @@
} }
}); });
}, },
getTownAndStoreId() {
const LOCA = this.location
this.street_id = LOCA.address_reference.town.id
this.getCloudShopMerId(this.street_id)
this.town = LOCA.address_component.street ?? ''
},
selectPlce(e) { selectPlce(e) {
this.street_id = e.value[1].code this.street_id = e.value[1].code
this.town = e.value[1].name this.town = e.value[1].name
this.getCloudShopMerId(e.value[1].code) this.getCloudShopMerId(e.value[1].code)
// console.log( e.value[1].name)
uni.setStorageSync('adress_location', e.value[1].name)
}, },
getCloudShopMerId(id) { getCloudShopMerId(id) {
get_cloud_shop(id).then(res => { get_cloud_shop(id).then(res => {
@ -271,6 +406,57 @@
background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%); background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%);
} }
.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);
}
}
.site-box {
width: 100%;
height: 120rpx;
margin-bottom: 26.32rpx;
position: absolute;
top: 0rpx;
position: fixed;
z-index: 999;
padding-top: 30rpx;
padding-right: 20rpx;
//
.place_wrapper {
color: #fff;
margin-right: 24.56rpx;
font-size: 30rpx;
.town_name {
margin-left: 21rpx;
}
}
.iconfont {
font-size: 35.09rpx;
}
}
.shop_wrapper { .shop_wrapper {
height: 192.98rpx; height: 192.98rpx;
width: 694.74rpx; width: 694.74rpx;

View File

@ -677,7 +677,7 @@
// #endif // #endif
}, },
/** /**
* 点击去评价 * 提示
*/ */
dePay() { dePay() {

BIN
static/images/sp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB