解决冲突

This commit is contained in:
cc_zbp 2023-05-16 09:17:58 +08:00
commit d66e47d9ba
3 changed files with 824 additions and 442 deletions

View File

@ -1,3 +1,4 @@
<<<<<<< HEAD
<template>
<view class="zbp-head-wrapper">
<view class="color-lump"></view>
@ -243,3 +244,326 @@
}
}
</style>
=======
<template>
<view class="zbp-head-wrapper">
<view class="color-lump"></view>
<view class="bg-img">
<img :src="bgColor" alt="">
</view>
<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">{{recommend_address}}</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>
<!-- 搜索栏 -->
<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"></view>
<input type="text" v-model="keyword" placeholder="搜索产品或店铺">
</view>
<button class="search_btn">搜索</button>
</navigator>
<!-- 轮播图 -->
<view class="supply_chains-head">
<swiper class="swiper l_center" @change="swiperChange" :indicator-dots="swiper.indicatorDots"
:autoplay="swiper.autoplay" :interval="swiper.interval" :duration="swiper.duration"
indicator-active-color="#fff">
<block v-for="(item,index) in swiper['url']" :key="index">
<swiper-item class="swi_item">
<u--image radius="15" :showLoading="true" :src="item.img" width="694.74rpx" height="242.11rpx"
mode="aspectFill">
</u--image>
</swiper-item>
</block>
</swiper>
</view>
<u-picker :defaultIndex="[0,0]" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm"
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker>
</view>
</template>
<script>
import {
getArea,
getStreet
} from '@/api/article.js';
import {
getIndexData,
getDiy
} from '@/api/api.js'
import {getGeocoder } from '@/api/store.js';
import {
mapGetters
} from 'vuex'
export default {
props: {
isSelectPlace: {
type: Boolean,
default: false
}
},
data() {
return {
showPicker: false,
styleConfig: [],
columnData: [],
homeCombData:[],
keyword: '',
recommend_address: '',
bgColor: '',
swiper: {
url: [{
img: ''
}],
indicatorDots: true, //
vertical: false, //
autoplay: true, //
interval: 2000, //
duration: 400 //
},
}
},
// computed: mapGetters(['location']),
watch: {},
created() {
//#ifdef APP
this.selfLocation()
//#endif
// const loca = JSON.parse(this.location)
// this.street = loca.address_component.street
this.getBanner()
this.Area()
},
methods: {
selectLocation() {
this.isSelectPlace ? this.showPicker = true : ''
},
confirm(e) {
this.showPicker = false
this.$emit('selectPlce', e)
},
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);
});
},
selfLocation() {
let self = this
uni.getLocation({
type: 'gcj02',
success: (res) => {
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();
this.latitude = res.latitude
this.longitude = res.longitude
getGeocoder({
lat: latitude,
long: longitude
}).then(res => {
console.log(res)
this.detaile_address = res.data.address;
this.location_address = res.data.address;
this.recommend_address = res.data.formatted_addresses.recommend.length > 4 ? res.data.formatted_addresses.recommend.slice(0,7) + '...' : res.data.formatted_addresses.recommend
}).catch(err => {
uni.showToast({
title: err,
icon: 'none'
})
})
},
fail: (res) => {
uni.showToast({
title: res,
icon: 'none',
duration: 1000
});
},
});
},
swiperChange(e) {
let {
current,
source
} = e.detail;
if (source === 'autoplay' || source === 'touch') {
this.bgColor = this.swiper.url[e.detail.current]['img']
}
},
//
objToArr(data) {
let obj = Object.keys(data).sort();
let m = obj.map(key => data[key]);
return m;
},
async getBanner(id) {
let that = this;
const {
data
} = await getDiy({
id: 0
})
that.styleConfig = that.objToArr(data.value);
/* 循环数组得到数据*/
that.styleConfig.forEach((item, index, arr) => {
if (item.name == 'headerSerch' || item.name == 'homeComb') {
if (item.name == 'homeComb') {
that.swiper.url = item.swiperConfig.list
}
}
})
this.bgColor = this.swiper.url[0].img
},
}
}
</script>
<style lang="scss">
.zbp-head-wrapper {
position: relative;
padding-top: 78.95rpx;
overflow: hidden;
.color-lump {
z-index: 1;
position: absolute;
bottom: -86px;
left: 50%;
transform: translate(-50%, 0);
width: 102%;
height: 133px;
border-radius: 30px 30px 0 0;
background-color: #fff;
}
.bg-img {
position: absolute;
width: 100%;
height: 100%;
top: 0;
/* #ifdef MP || APP-PLUS */
z-index: -1;
/* #endif */
/* #ifdef H5 */
z-index: 0;
/* #endif */
z-index: 0;
filter: blur(0);
overflow: hidden;
img {
width: 100%;
height: 100%;
filter: blur(30rpx);
transform: scale(1.5);
}
}
.site-box {
margin: 0 auto;
width: 694.74rpx;
height: 66.67rpx;
margin-bottom: 26.32rpx;
position: relative;
//
.place_wrapper {
color: #fff;
margin-right: 24.56rpx;
font-size: 31.58rpx;
.town_name {
margin-left: 10.53rpx;
}
}
.iconfont {
font-size: 35.09rpx;
}
}
.my-main {
transition: background-color .5s ease;
}
.search_content {
margin: 0 auto;
width: 694.74rpx;
height: 61.4rpx;
padding: 2px 2px 2px 21.05rpx;
border-radius: 100px;
background: #fff;
margin-bottom: 17.54rpx;
position: relative;
box-sizing: border-box;
.icon-sousuo {
font-size: 26.32rpx;
font-weight: bold;
color: #c8c7c6;
margin-right: 17.54rpx;
}
.search_btn {
color: #fff;
width: 105.26rpx;
height: 52.63rpx;
line-height: 52.63rpx;
background: #f84221;
border-radius: 100px;
font-size: 28.07rpx;
}
}
.supply_chains-head {
margin-bottom: 17.54rpx;
position: relative;
z-index: 2;
.swiper {
width: 694.74rpx;
height: 242.11rpx;
margin: 0 auto;
.swi_item {
width: 100%;
height: 242.11rpx;
}
}
}
}
</style>
>>>>>>> a46be7373a3ace79168d4e9e55683ef59cd9db8d

View File

@ -17,12 +17,13 @@
<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>
<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="iconfont"
:class="item.relevance_id ? 'icon-shoucang1' : 'icon-dianzan'"></text>
<text class="collect">{{item.count_start}}</text>
</view>
</view>
@ -53,12 +54,29 @@
<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'
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,
@ -109,6 +127,7 @@
}
},
onLoad() {
this.getBanner()
this.getCateList()
this.getGoods()
this.selfLocation()
@ -118,7 +137,10 @@
methods: {
//
swiperChange(e) {
let { current, source } = e.detail;
let {
current,
source
} = e.detail;
if (source === 'autoplay' || source === 'touch') {
this.bgColor = this.swiper.url[e.detail.current]['img']
}
@ -128,28 +150,45 @@
this.showPicker = false
},
changeHandler(e) {
const { columnIndex, value, values, index, picker = this.$refs.uPicker } = e;
const {
columnIndex,
value,
values,
index,
picker = this.$refs.uPicker
} = e;
if (columnIndex === 0) {
getStreet({ area_code: value[0]['code'] }).then(res => {
getStreet({
area_code: value[0]['code']
}).then(res => {
this.$refs.uPicker.setColumnValues(1, res.data);
});
}
},
Area() {
getArea({ city_code: 510500 }).then(res => {
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 => {
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({
@ -159,7 +198,9 @@
},
giveStart(item) {
let status = item.relevance_id ? 0 : 1
graphicStartApi(item.community_id, { status: status }).then(res => {
graphicStartApi(item.community_id, {
status: status
}).then(res => {
Toast(res.message)
this.getGoods()
})
@ -177,11 +218,17 @@
},
/*获取分类列表*/
async getCateList() {
const { data } = await getTopicList()
const {
data
} = await getTopicList()
this.tabsData.list = [{
cate_name: "推荐",
category_id: 0
}, { cate_name: "视频", category_id: -1, children: [] }, ...data]
}, {
cate_name: "视频",
category_id: -1,
children: []
}, ...data]
},
tabsChange(item) {
this.where.category_id = item.category_id
@ -195,7 +242,11 @@
}
},
async getBanner() {
const { data } = await getDiy({ id: 0 })
const {
data
} = await getDiy({
id: 0
})
if (data.value['1683638943100000']) {
this.swiper.url = data.value['1683638943100000'].swiperConfig.list
} else {
@ -210,11 +261,17 @@
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();
getGeocoder({ lat: latitude, long: longitude }).then(res => {
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' })
uni.showToast({
title: err,
icon: 'none'
})
})
},
fail: (err) => {
@ -228,6 +285,7 @@
},
},
onPullDownRefresh() {
this.getBanner()
this.getCateList()
this.getGoods()
this.selfLocation()

View File

@ -1,7 +1,7 @@
<template>
<view class="Circle_friends">
<view class="circle_friends_wrapper">
<zbpSwiper :isSelectPlace="true" @selectPlce="selectPlce"></zbpSwiper>
<zbpSwiper></zbpSwiper>
<view class="shop_wrapper">
<navigator class="l_yun" hover-class="none"
:url="`/pages/nongKe/supply_chain/supplier?type_id=10&street_id=${street_id}`">
@ -162,7 +162,7 @@
}
</script>
<style lang="scss">
<style lang="scss" scoped>
page {
background-color: #F5F5F5;
}
@ -188,7 +188,7 @@
.l_yun {
width: 456.14rpx;
border-radius: 8px;
border-radius: 16rpx;
background-image: url("@/static/images/zonghe.png");
background-repeat: no-repeat;
background-size: cover;
@ -223,7 +223,7 @@
.iconlihai {
font-size: 24.56rpx;
margin-left: 8px;
margin-left: 16rpx;
}
}
@ -250,7 +250,7 @@
background: url("@/static/images/lihaiyun.png") no-repeat;
background-size: cover;
box-sizing: border-box;
border-radius: 8px;
border-radius: 16rpx;
color: #fff;
font-weight: bold;
@ -271,7 +271,7 @@
width: 694.74rpx;
margin: 0 auto;
background-color: #fff;
border-radius: 8px;
border-radius: 16rpx;
padding: 0 24.56rpx;
box-sizing: border-box;