Merge branch 'master' of http://git.excellentkk.cn/C.C/nk-shop2.0
This commit is contained in:
commit
17dcf15a47
@ -14,7 +14,10 @@ export function seachBarCodeAPI(data) {
|
|||||||
export function getProductSpuAPI(id) {
|
export function getProductSpuAPI(id) {
|
||||||
return request.get(`product/spu/cloud_merchant/${id}`, {}, { noAuth: true });
|
return request.get(`product/spu/cloud_merchant/${id}`, {}, { noAuth: true });
|
||||||
}
|
}
|
||||||
|
//获取云仓库店铺id
|
||||||
|
export function get_cloud_shop(street_code) {
|
||||||
|
return request.get(`city/get_cloud_shop?street_code=${street_code}`, {}, { noAuth: true });
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 公共接口 ,优惠券接口 , 行业此讯 , 手机号码注册
|
* 公共接口 ,优惠券接口 , 行业此讯 , 手机号码注册
|
||||||
*
|
*
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<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="place_wrapper flex_a_c" @click="selectLocation">
|
||||||
<view class="iconfont icon-weizhi"></view>
|
<view class="iconfont icon-weizhi"></view>
|
||||||
<view class="town_name">{{recommend_address}}</view>
|
<view class="town_name">{{location_Arr.location_name}}</view>
|
||||||
</view>
|
</view>
|
||||||
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
|
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
|
||||||
<view class="iconfont icon-xiaoxi" style="color:#fff;"></view>
|
<view class="iconfont icon-xiaoxi" style="color:#fff;"></view>
|
||||||
@ -50,6 +50,10 @@
|
|||||||
isSelectPlace: {
|
isSelectPlace: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
location_Arr:{
|
||||||
|
type:Object,
|
||||||
|
default:()=>({})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -59,7 +63,6 @@
|
|||||||
columnData: [],
|
columnData: [],
|
||||||
homeCombData: [],
|
homeCombData: [],
|
||||||
keyword: '',
|
keyword: '',
|
||||||
recommend_address: '',
|
|
||||||
bgColor: '',
|
bgColor: '',
|
||||||
swiper: {
|
swiper: {
|
||||||
url: [{
|
url: [{
|
||||||
@ -78,7 +81,7 @@
|
|||||||
created() {
|
created() {
|
||||||
this.getBanner()
|
this.getBanner()
|
||||||
this.Area()
|
this.Area()
|
||||||
this.selfLocation()
|
// this.selfLocation()
|
||||||
// const loca = JSON.parse(this.location)
|
// const loca = JSON.parse(this.location)
|
||||||
// this.street = loca.address_component.street
|
// this.street = loca.address_component.street
|
||||||
},
|
},
|
||||||
@ -121,30 +124,7 @@
|
|||||||
this.$refs.uPicker.setColumnValues(1, res.data);
|
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 => Toast(err))
|
|
||||||
},
|
|
||||||
fail: (err) => { Toast(err) },
|
|
||||||
});
|
|
||||||
},
|
|
||||||
swiperChange(e) {
|
swiperChange(e) {
|
||||||
let { current, source } = e.detail;
|
let { current, source } = e.detail;
|
||||||
if (source === 'autoplay' || source === 'touch') {
|
if (source === 'autoplay' || source === 'touch') {
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="Circle_friends">
|
<view class="Circle_friends">
|
||||||
<view class="circle_friends_wrapper">
|
<view class="circle_friends_wrapper">
|
||||||
<zbpSwiper :isSelectPlace="true" @selectPlce="selectPlce"></zbpSwiper>
|
<zbpSwiper :isSelectPlace="true" @selectPlce="selectPlce" :location_Arr="locationArr"></zbpSwiper>
|
||||||
<view class="shop_wrapper">
|
<view class="shop_wrapper">
|
||||||
<navigator class="l_yun" hover-class="none"
|
<navigator class="l_yun" hover-class="none"
|
||||||
:url="`/pages/nongKe/supply_chain/supplier?type_id=10&street_id=${street_id}`"
|
:url="`/pages/nongKe/supply_chain/supplier?type_id=10&street_id=${locationArr.address_reference.town.id}`"
|
||||||
:style=" {'background-image': `url(${bgData[0].pic})`}">
|
:style=" {'background-image': `url(${bgData[0].pic})`}">
|
||||||
<view class=" text-name">
|
<view class=" text-name">
|
||||||
<text>{{town||JSON.parse(location).address_component.street}}</text>
|
<text>{{locationArr.location_name}}</text>
|
||||||
<view class="name_town">-供销综合云市场-</view>
|
<view class="name_town">-供销综合云市场-</view>
|
||||||
</view>
|
</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
<navigator class="r_lihai" hover-class="none" :url="`/pages/store/home/index?id=${store_id}&LihaiYun=Lihai`"
|
<view class="r_lihai" hover-class="none" @click="go_shop()"
|
||||||
:style=" {'background-image': `url(${bgData[1].pic})`}">
|
:style=" {'background-image': `url(${bgData[1].pic})`}">
|
||||||
<view class="title">里海云仓</view>
|
<view class="title">里海云仓</view>
|
||||||
</navigator>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="tabs_wrapper flex_a_c_j_sb">
|
<view class="tabs_wrapper flex_a_c_j_sb">
|
||||||
<view class="title flex_a_c">热点资讯</view>
|
<view class="title flex_a_c">热点资讯</view>
|
||||||
@ -25,7 +25,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="article_box">
|
<view class="article_box">
|
||||||
<block v-for="(item, index) in recoList.slice(0,2)" :key="index">
|
<block v-for="(item, index) in recoList.slice(0,2)" :key="index">
|
||||||
<navigator :url='"/pages/news_details/index?id="+item.article_id' hover-class='none' class='article-item'>
|
<navigator :url='"/pages/news_details/index?id="+item.article_id' hover-class='none'
|
||||||
|
class='article-item'>
|
||||||
<view class='text'>
|
<view class='text'>
|
||||||
<view class='name'>{{item.title}}</view>
|
<view class='name'>{{item.title}}</view>
|
||||||
<view class="time">{{item.create_time}}</view>
|
<view class="time">{{item.create_time}}</view>
|
||||||
@ -49,12 +50,13 @@
|
|||||||
<view class="title">{{item.title}}</view>
|
<view class="title">{{item.title}}</view>
|
||||||
<view class="goods_info flex_a_c">
|
<view class="goods_info flex_a_c">
|
||||||
<view class="l_info flex_a_c">
|
<view class="l_info flex_a_c">
|
||||||
<image :src="(item.author && item.author.avatar) || '/static/images/f.png'" mode="aspectFill"
|
<image :src="(item.author && item.author.avatar) || '/static/images/f.png'"
|
||||||
class="g_img"></image>
|
mode="aspectFill" class="g_img"></image>
|
||||||
<view class="g_name">{{item.author}}</view>
|
<view class="g_name">{{item.author}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="nice_box" @click.stop="giveStart(item)">
|
<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>
|
<text class="collect">{{item.count_start}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -81,12 +83,28 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import zbpSwiper from '@/components/zbpSwiper'
|
import zbpSwiper from '@/components/zbpSwiper'
|
||||||
import { mapGetters } from 'vuex'
|
import {
|
||||||
|
mapGetters
|
||||||
|
} from 'vuex'
|
||||||
import mTabbar from '@/components/m-tabbar/m-tabbar.vue'
|
import mTabbar from '@/components/m-tabbar/m-tabbar.vue'
|
||||||
import { graphicStartApi } from '@/api/community.js'
|
import {
|
||||||
import { getArticleList, getArticleCategoryList } from '@/api/api.js'
|
graphicStartApi
|
||||||
import { getHotBanner } from '@/api/store.js'
|
} from '@/api/community.js'
|
||||||
import { Toast } from '@/libs/uniApi'
|
import {
|
||||||
|
getArticleList,
|
||||||
|
getArticleCategoryList,
|
||||||
|
get_cloud_shop
|
||||||
|
} from '@/api/api.js'
|
||||||
|
import {
|
||||||
|
getHotBanner
|
||||||
|
} from '@/api/store.js'
|
||||||
|
import {
|
||||||
|
Toast
|
||||||
|
} from '@/libs/uniApi'
|
||||||
|
import {
|
||||||
|
getGeocoder
|
||||||
|
} from '@/api/store.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
mTabbar,
|
mTabbar,
|
||||||
@ -103,10 +121,18 @@
|
|||||||
articleList: [],
|
articleList: [],
|
||||||
recoList: [],
|
recoList: [],
|
||||||
street_id: '',
|
street_id: '',
|
||||||
bgData: [{ pic: '' }, { pic: '' }],
|
bgData: [{
|
||||||
store_id: ''
|
pic: ''
|
||||||
|
}, {
|
||||||
|
pic: ''
|
||||||
|
}],
|
||||||
|
store_id: '',
|
||||||
|
locationArr: ({}),
|
||||||
|
setrecommend_address: "",
|
||||||
|
mer_id: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
getHotBanner('good').then(res => {
|
getHotBanner('good').then(res => {
|
||||||
this.bgData = res.data
|
this.bgData = res.data
|
||||||
@ -115,17 +141,53 @@
|
|||||||
console.log('resetLocation');
|
console.log('resetLocation');
|
||||||
})
|
})
|
||||||
this.getArticle()
|
this.getArticle()
|
||||||
|
this.selfLocation()
|
||||||
getArticleList(19).then(res => {
|
getArticleList(19).then(res => {
|
||||||
this.recoList = res.data.list
|
this.recoList = res.data.list
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onShow() {},
|
onShow() {},
|
||||||
computed: mapGetters(['location']),
|
|
||||||
methods: {
|
methods: {
|
||||||
|
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 => {
|
||||||
|
this.locationArr = res.data
|
||||||
|
this.locationArr.location_name = res.data.address_component.street
|
||||||
|
get_cloud_shop(res.data.address_reference.town.id).then(re => {
|
||||||
|
if(re.data.mer_id){
|
||||||
|
this.mer_id = re.data.mer_id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(err => Toast(err))
|
||||||
|
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
Toast(err)
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
selectPlce(e) {
|
selectPlce(e) {
|
||||||
|
|
||||||
this.street_id = e.value[1].code
|
this.street_id = e.value[1].code
|
||||||
this.store_id = e.value[1].id
|
this.store_id = e.value[1].id
|
||||||
this.town = e.value[1].name
|
this.town = e.value[1].name
|
||||||
|
get_cloud_shop(e.value[1].code).then(re => {
|
||||||
|
this.mer_id = re.data.mer_id
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
navigat() {
|
navigat() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@ -137,9 +199,22 @@
|
|||||||
url: '/pages/news_details/index?id=' + item.article_id
|
url: '/pages/news_details/index?id=' + item.article_id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
go_shop(id) {
|
||||||
|
if (this.mer_id == 0) {
|
||||||
|
Toast('当前区域没有云仓库')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
console.log(this.mer_id)
|
||||||
|
uni.navigateTo({
|
||||||
|
|
||||||
|
url: '/pages/store/home/index?id=' + this.mer_id + '&LihaiYun=Lihai'
|
||||||
|
})
|
||||||
|
},
|
||||||
async getArticle() {
|
async getArticle() {
|
||||||
let list = []
|
let list = []
|
||||||
const { data } = await getArticleCategoryList()
|
const {
|
||||||
|
data
|
||||||
|
} = await getArticleCategoryList()
|
||||||
data.map((item, index) => {
|
data.map((item, index) => {
|
||||||
if (item.title !== '推荐') {
|
if (item.title !== '推荐') {
|
||||||
list.push(item)
|
list.push(item)
|
||||||
@ -149,7 +224,9 @@
|
|||||||
this.getArticleList(list[0].article_category_id)
|
this.getArticleList(list[0].article_category_id)
|
||||||
},
|
},
|
||||||
async getArticleList(id) {
|
async getArticleList(id) {
|
||||||
const { data } = await getArticleList(id)
|
const {
|
||||||
|
data
|
||||||
|
} = await getArticleList(id)
|
||||||
this.articleList = data.list
|
this.articleList = data.list
|
||||||
},
|
},
|
||||||
// 点赞
|
// 点赞
|
||||||
|
Loading…
x
Reference in New Issue
Block a user