This commit is contained in:
weipengfei 2024-03-14 15:23:31 +08:00
parent 43f1362501
commit 4ba58024a2
37 changed files with 1104 additions and 332 deletions

View File

@ -87,6 +87,15 @@ export function getCategoryList() {
noAuth: true
});
}
/**
* 获取商品分类列表
*
*/
export function getCategoryIndexList() {
return request.get('store/product/category/index', {}, {
noAuth: true
});
}
/**
* 获取产品列表
* @param object data

View File

@ -6,9 +6,18 @@
<view v-if="item.border_pic" :style="{ backgroundImage: `url(${item.border_pic})` }" class="border-picture"></view>
</view>
<view class="text">
<view class='name line2'>{{item.store_name}}</view>
<view class="acea-row row-middle">
<view class='money'><text class='num'>{{item.price}}</text></view>
<view class='name line2'>{{item.store_name}}</view>
<view class="item_tags">
<!-- 商品标签 -->
<!-- <text v-if="item.product_type == 0 && item.merchant.type_name" class="font-bg-red b-color">{{item.merchant.type_name}}</text>
<text v-else-if="item.product_type == 0 && item.merchant.is_trader" class="font-bg-red b-color">自营</text> -->
<text v-if="item.product_type != 0" :class="'font_bg-red type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text>
<text class="tags_item ticket" v-if="item.issetCoupon">领券</text>
<text class="tags_item delivery" v-if="item.delivery_free == 1">包邮</text>
</view>
<view class="acea-row row-middle" style="display: flex;justify-content: space-between;">
<view class='money'><text class='num'>{{item.price}}</text></view>
<image class="car" src="@/static/assets/car.png"></image>
</view>
<view v-if="item.show_svip_info && item.show_svip_info.show_svip_price && item.svip_price" class="acea-row row-middle svip">
<text class='vip-money'>{{item.svip_price}}</text>
@ -16,13 +25,6 @@
<image :src="`${domain}/static/images/svip.png`"></image>
</view>
</view>
<view class="item_tags">
<text v-if="item.product_type == 0 && item.merchant.type_name" class="font-bg-red b-color">{{item.merchant.type_name}}</text>
<text v-else-if="item.product_type == 0 && item.merchant.is_trader" class="font-bg-red b-color">自营</text>
<text v-if="item.product_type != 0" :class="'font_bg-red type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text>
<text class="tags_item ticket" v-if="item.issetCoupon">领券</text>
<text class="tags_item delivery" v-if="item.delivery_free == 1">包邮</text>
</view>
</view>
</view>
<view v-else-if="type == 1" class="wf-page1" :style="viewColor">
@ -33,22 +35,23 @@
</view>
<view class='text'>
<view class='name line2'>{{item.store_name}}</view>
<view class='money'>
<text class='num'>{{item.price}}</text>
</view>
<view v-if="item.show_svip_info.show_svip && item.show_svip_info.show_svip_price" class="acea-row row-middle svip">
<text class='vip-money'>{{item.svip_price}}</text>
<view class="vipImg">
<image :src="`${domain}/static/images/svip.png`"></image>
</view>
</view>
<view class="item_tags acea-row">
<text v-if="item.merchant.type_name && item.product_type == 0" class="font-bg-red b-color">{{item.merchant.type_name}}</text>
<text v-else-if="item.merchant.is_trader && item.product_type == 0" class="font-bg-red b-color">自营</text>
<!-- 商品标签 -->
<!-- <text v-if="item.merchant.type_name && item.product_type == 0" class="font-bg-red b-color">{{item.merchant.type_name}}</text>
<text v-else-if="item.merchant.is_trader && item.product_type == 0" class="font-bg-red b-color">自营</text> -->
<text v-if="item.product_type != 0" :class="'font_bg-red type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text>
<text class="tags_item ticket" v-if="item.issetCoupon">领券</text>
<text class="tags_item delivery" v-if="item.delivery_free == 1">包邮</text>
</view>
<view class='money'>
<text class='num'>{{item.price}}</text>
</view>
<view v-if="item.show_svip_info.show_svip && item.show_svip_info.show_svip_price" class="acea-row row-middle svip">
<text class='vip-money'>{{item.svip_price}}</text>
<view class="vipImg">
<image :src="`${domain}/static/images/svip.png`"></image>
</view>
</view>
<view class="score">{{item.rate}}评分 {{item.reply_count}}条评论</view>
<view class="company" v-if="item.merchant" @click.stop="goShop(item.merchant.mer_id)">
<text class="line1">{{item.merchant.mer_name}}</text>
@ -299,8 +302,10 @@ export default {
border: 1px solid var(--view-theme);
}
.item_tags .tags_item.delivery{
color: #FF9000;
border: 1px solid #FF9000;
// color: #FF9000;
// border: 1px solid #FF9000;
color: var(--view-theme);
border: 1px solid var(--view-theme);
}
.wf-page1 .text .money .ticket-big {
display: flex;
@ -355,4 +360,8 @@ export default {
margin-right: 10rpx;
}
}
.car{
width: 40rpx;
height: 40rpx;
}
</style>

View File

@ -5,7 +5,7 @@
</view>
<!-- nav导航 -->
<view class="nav">
<view class="nav" v-if="showTab">
<view class="nav-item" @click="navTo('/pages/cloud_warehouse/home/home')">
<view class="nav-item-up">
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/1c050202403121539159687.png" mode=""></image>
@ -24,7 +24,7 @@
<view class="nav-item-down-desc">综合线上大市场</view>
</view>
</view>
<view class="nav-item">
<view class="nav-item" @click="navTo('/pages/cloud_warehouse/specialty/specialty')">
<view class="nav-item-up">
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/cef80202403121539479409.png" mode=""></image>
</view>
@ -36,7 +36,7 @@
</view>
<!-- tab导航 -->
<view class="tabs">
<view class="tabs" v-if="showTab">
<block v-for="(item,indx) in tabsArr" :key="indx">
<view :class="{'tabs-item-active':item.val==currTabs}" class="tabs-item" @click="changeTab(item.val)">
<view class="tabs-item-main">{{item.name}}</view>
@ -52,15 +52,6 @@
</template>
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import {
mapGetters
} from "vuex";
@ -77,7 +68,7 @@
import {
HTTP_REQUEST_URL
} from '@/config/app';
import { Toast } from "../../libs/uniApi";
import { Toast } from "../../libs/uniApi";
export default {
components: {
WaterfallsFlow
@ -90,6 +81,10 @@ import { Toast } from "../../libs/uniApi";
return [];
}
},
showTab: {
type: Boolean,
default: false
},
indexP: {
type: Boolean,
default: false
@ -124,21 +119,12 @@ import { Toast } from "../../libs/uniApi";
},
mounted() {
},
onPullDownRefresh() {
//
setTimeout(() => {
const newList = this.hostProduct.reverse();
this.hostProduct = newList;
uni.stopPullDownRefresh();
}, 500)
},
methods: {
changeTab(e) {
this.currTabs = e;
this.$emit('changeRecommedTab', e)
},
navTo(url){
uni.navigateTo({
url: url,
@ -147,7 +133,6 @@ import { Toast } from "../../libs/uniApi";
}
})
},
goDetail(item) {
goShopDetail(item, this.uid).then(res => {
if (this.isLogin) {

View File

@ -240,6 +240,14 @@
"navigationStyle": "custom",
"onReachBottomDistance": 300
}
},
{
"path" : "pages/select_address_n/select_address_n",
"style" :
{
"navigationBarTitleText" : "选择地址",
"enablePullDownRefresh" : false
}
}
],
"subPackages": [{
@ -290,6 +298,14 @@
"enablePullDownRefresh" : false,
"navigationStyle": "custom"
}
},
{
"path" : "specialty/specialty",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
}]
}, {
"root": "pages/users",
@ -1469,38 +1485,38 @@
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/index/index",
"iconPath": "static/images/1-001.png",
"selectedIconPath": "static/images/1-002.png",
"iconPath": "static/tabbar_icon/a.png",
"selectedIconPath": "static/tabbar_icon/a-a.png",
"text": "首页"
},
{
"pagePath": "pages/whole_sale/index",
"iconPath": "static/images/2-001.png",
"selectedIconPath": "static/images/2-002.png",
"iconPath": "static/tabbar_icon/b.png",
"selectedIconPath": "static/tabbar_icon/b-a.png",
"text": "批发"
},
// {
// "pagePath": "pages/plant_grass/index",
// "iconPath": "static/images/5-001.png",
// "selectedIconPath": "static/images/5-002.png",
// "iconPath": "static/tabbar_icon/b.png",
// "selectedIconPath": "static/tabbar_icon/b-a.png",
// "text": "逛逛"
// },
{
"pagePath": "pages/gather/gather",
"iconPath": "static/images/2-001.png",
"selectedIconPath": "static/images/2-002.png",
"iconPath": "static/tabbar_icon/c.png",
"selectedIconPath": "static/tabbar_icon/c-a.png",
"text": "工作台"
},
{
"pagePath": "pages/order_addcart/order_addcart",
"iconPath": "static/images/3-001.png",
"selectedIconPath": "static/images/3-002.png",
"iconPath": "static/tabbar_icon/d.png",
"selectedIconPath": "static/tabbar_icon/d-a.png",
"text": "购物车"
},
{
"pagePath": "pages/user/index",
"iconPath": "static/images/4-001.png",
"selectedIconPath": "static/images/4-002.png",
"iconPath": "static/tabbar_icon/e.png",
"selectedIconPath": "static/tabbar_icon/e-a.png",
"text": "我的"
}
]

View File

@ -232,11 +232,11 @@
<view class="category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :class="{'category-item-active': index==cate_change}" @click="changeCate(index)">
<u-image class="category-item-img" width="108rpx" :src="item.pic" height="108rpx" shape="circle" :lazy-load="true">
<u--image class="category-item-img" width="108rpx" :src="item.pic" height="108rpx" shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u-image>
</u--image>
<text class="category-item-text">{{item.cate_name}}</text>
</view>
</block>

View File

@ -299,9 +299,14 @@
<view class="wholeSale-header">
<!-- 适配不同机 -->
<view style="height: var(--status-bar-height);background-color: #40af37;"></view>
<view style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;">
<view style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;justify-content: space-between;">
<view style="display: flex;font-weight: bold;"><u-icon style="margin-right: 20rpx;" name="arrow-left" size="20"
color="#fff" @click="navBack"></u-icon>供销综合云市场</view>
<view style="display: flex;" @click="changeMap">
<view style="width: 250rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;text-align: right;">{{street}}</view>
<u-icon name="arrow-down" size="14"
color="#fff" @click="navBack"></u-icon>
</view>
</view>
</view>
@ -327,12 +332,11 @@
<block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :class="{'category-item-active': index==cate_change}"
@click="changeCate(index)">
<u-image class="category-item-img" width="108rpx" :src="item.background" height="108rpx" shape="circle"
:lazy-load="true">
<u--image class="category-item-img" width="108rpx" :src="item.background" height="108rpx" shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u-image>
</u--image>
<text class="category-item-text">{{item.category_name}}</text>
</view>
</block>
@ -345,7 +349,11 @@
<view class="goods_list">
<view class="goods" v-for="(item, index) in goodsList" :key="index" @click="goStore(item.mer_id)">
<view class="avatar">
<image style="width: 100%;height: 100%;" :src="item.mer_avatar" lazy-load></image>
<u--image style="width: 100%;height: 100%;" :src="item.mer_avatar">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
</view>
<view class="content">
<view class="content-head">
@ -414,6 +422,7 @@
cate_change: 0,
goodsList: [],
isLoading: 0,
street: '定位中',
where: {
page: 1,
limit: 20,
@ -421,7 +430,7 @@
order: 'location',
type_id: '10,17,21',
merchant_category_id: '',
location: '28.909126,105.428016'
location: ''
}
}
},
@ -435,6 +444,8 @@
}, mapGetters(['viewColor', 'keyColor'])),
},
onLoad(option) {
this.where.location = `${this.$store.state.storage.location.lat},${this.$store.state.storage.location.long}`;
this.street = this.$store.state.storage.address.townName;
this.merClassifly();
this.storeMerchantList();
},
@ -482,26 +493,33 @@
if(res.data.list.length<this.where.limit) this.isLoading = -1;
})
},
goDetail(item) {
goShopDetail(item, this.uid).then(res => {
if (this.isLogin) {
initiateAssistApi(item.activity_id).then(res => {
let id = res.data.product_assist_set_id;
uni.hideLoading();
uni.navigateTo({
url: '/pages/activity/assist_detail/index?id=' + id
});
}).catch((err) => {
uni.showToast({
title: err,
icon: 'none'
})
});
} else {
toLogin();
}
})
}
//
changeMap() {
uni.navigateTo({
url: `/pages/select_address_n/select_address_n`,
success: () => {
uni.$once('changeAddress', (e) => {
this.street = e.street.name;
this.$store.commit('setAddress', {
street_id: e.street.code,
townName: e.street.name
});
if (e.longitude) {
let latitude = e.latitude;
let longitude = e.longitude;
this.where.location = `${latitude},${longitude}`;
this.$store.commit('setLocation', {
lat: e.latitude,
long: e.longitude,
});
this.$nextTick(()=>{
this.storeMerchantList();
})
}
})
}
})
},
}
}
</script>

View File

@ -0,0 +1,394 @@
<style lang="scss" scoped>
page {
background-color: #f8fafb !important;
}
.wholeSale {
background-color: #f8fafb !important;
.wholeSale-header {
margin-bottom: 20rpx;
// background-color: #40AE36;
.scrollview {
display: flex;
align-items: center;
height: 98rpx;
padding-left: 32rpx;
.scrollview-item {
margin-right: 30rpx;
font-size: 28rpx;
color: #FFFFFF;
}
.scrollview-active {
position: relative;
font-weight: bold;
font-size: 36rpx;
color: #FFFFFF;
&::after {
content: "";
display: inline-block;
position: absolute;
bottom: -6rpx;
left: 50%;
transform: translateX(-50%);
width: 100%;
height: 6rpx;
background-color: #FFFFFF;
}
}
}
}
.wholeSale-con {
margin: 0 20rpx;
.wholeSale-nav{
display: flex;
align-items: center;
margin-bottom: 40rpx;
.icon{
margin-right: 20rpx;
}
}
.search_content {
// margin-bottom: 40rpx;
flex: 1;
height: 70rpx;
padding: 2px 2px 2px 21.05rpx;
border-radius: 80rpx;
pic: #EDEFF2;
position: relative;
box-sizing: border-box;
.search_content_wrap {
width: 100%;
.icon-sousuo {
font-size: 26.32rpx;
font-weight: bold;
color: #c8c7c6;
margin-right: 17.54rpx;
}
input {
width: 80%;
}
}
.search_btn {
width: 106rpx;
height: 60rpx;
line-height: 60rpx;
pic: #40AE36;
border-radius: 100px;
font-size: 28rpx;
color: #fff;
}
}
.category {
width: 100%;
overflow: auto;
margin-bottom: 20rpx;
.category-wrap {
display: flex;
padding-bottom: 20rpx;
.category-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-right: 38rpx;
text {
margin-top: 16rpx;
font-size: 24rpx;
color: #666666;
white-space: nowrap;
}
.category-item-text {
width: 120rpx;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.category-item-active {
position: relative;
.category-item-img {
border: 2px solid #40AE36;
border-radius: 50%;
}
text {
background-color: #40AE36;
color: #fff;
padding: 2rpx 10rpx 6rpx 10rpx;
border-radius: 50rpx;
}
}
}
}
.cate {
width: 100%;
overflow: auto;
margin-bottom: 30rpx;
.cate-wrap {
display: flex;
padding-bottom: 8rpx;
.cate-item {
text {
padding: 4rpx 16rpx;
white-space: nowrap;
font-size: 30rpx;
color: #333;
}
}
.cate-item-active {
text {
color: #40AE36;
font-weight: bold;
}
}
}
}
.comprehensive {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 50rpx;
[class^=comprehensive-] {
display: flex;
align-items: center;
text {
margin-right: 12rpx;
font-size: 26rpx;
color: #666666;
}
image {
width: 28rpx;
height: 28rpx;
}
.loudou {
width: 24rpx;
height: 24rpx;
}
}
}
}
}
</style>
<template>
<view class="wholeSale">
<!-- 顶部 -->
<view class="wholeSale-header" style="position: fixed;top: 0;left: 0;width: 100%;z-index: 999;">
<!-- 适配不同机 -->
<view style="height: var(--status-bar-height);background-color: #40af37;"></view>
<view style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;">
<view style="display: flex;font-weight: bold;"><u-icon style="margin-right: 20rpx;" name="arrow-left" size="20" color="#fff" @click="navBack"></u-icon>名优特产</view>
</view>
</view>
<!-- 内容 -->
<view class="wholeSale-con" style="padding-top: calc(var(--status-bar-height) + 100rpx);">
<view class="wholeSale-nav">
<!-- <u-icon class="icon" name="arrow-left" size="20" @click="navBack"></u-icon> -->
<!-- 搜索 -->
<navigator url="/pages/columnGoods/goods_search/index" hover-class="none"
class="search_content flex_a_c_j_sb">
<view class="flex_a_c search_content_wrap">
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<input type="text" placeholder="搜索您需要批发进货的产品名称" placeholder-style="font-size: 30rpx;color:#999;"
disabled style="pointer-events: none;">
</view>
<!-- <button class="search_btn">搜索</button> -->
</navigator>
</view>
<!-- 商品大分类 -->
<view class="category">
<scroll-view scroll-x="true">
<view class="category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :class="{'category-item-active': index==cate_change}" @click="changeCate(index)">
<u--image class="category-item-img" width="108rpx" :src="item.pic" height="108rpx" shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<text class="category-item-text">{{item.cate_name}}</text>
</view>
</block>
</view>
</scroll-view>
</view>
<!-- 商品小分类 -->
<view class="cate" v-if="store_category_children.length>1">
<scroll-view scroll-x="true">
<view class="cate-wrap">
<block v-for="(item,index) in store_category_children" :key="index">
<view class="cate-item" :class="{'cate-item-active':index == cate_change_children}" @click="changeChildrenCate(index)">
<text>{{item.cate_name}}</text>
</view>
</block>
</view>
</scroll-view>
</view>
<!-- 综合查询 -->
<!-- <view class="comprehensive">
<view class="comprehensive-price">
<text>价格</text>
<image src="@/static/new_define/priceChange.png"></image>
</view>
<view class="comprehensive-sales_num">
<text>销量</text>
</view>
<view class="comprehensive-discount">
<text>抵扣</text>
<image class="loudou" src="@/static/new_define/loudou.png"></image>
</view>
</view> -->
<!-- 流水瀑布 -->
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
<loadmore :type="isLoading"></loadmore>
</view>
</view>
</template>
<script>
import {
goShopDetail
} from '@/libs/order.js'
import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
import {
getCategoryIndexList,
getProductslist
} from "@/api/store.js"
export default {
components: {
WaterfallsFlow
},
data() {
return {
hostProduct: [],
store_category: [], //
store_category_children: [], //
cate_change: 0,
cate_change_children: 0,
isLoading: 0,
where:{
page: 1,
limit: 20,
cate_pid: '',
keyword: '',
label_name: '名优特产'
}
}
},
onLoad(option){
this.getCategoryIndexList();
this.getProductslist(true);
},
onReachBottom() {
this.getProductslist();
},
methods: {
navBack(){
uni.navigateBack();
},
tabsChange(e) {
this.tabsCurr = e;
},
changeCate(e){
this.cate_change = e;
this.store_category_children = [{
cate_name: '全部',
store_category_id: ''
}];
if(this.store_category[e].children) this.store_category_children = [...this.store_category_children, ...this.store_category[e].children];
this.cate_change_children = 0;
this.where.cate_pid = this.store_category[e].store_category_id;
this.getProductslist(true);
},
changeChildrenCate(e){
this.cate_change_children = e;
this.where.cate_pid = this.store_category_children[e].store_category_id;
if(e==0) this.where.cate_pid = this.store_category[this.cate_change].store_category_id; // , id
this.getProductslist(true);
},
getCategoryIndexList(){
getCategoryIndexList().then(res=>{
this.store_category = [{
cate_name: '全部',
pic: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/de2be202312151001024597.png',
store_category_id: ''
}, ...res.data];
this.store_category_children = this.store_category[0].children || [];
this.store_category_children.unshift({
cate_name: '全部',
store_category_id: ''
})
})
},
getProductslist(reLoad=false){
if(reLoad){
this.where.page = 1;
this.hostProduct = [];
this.isLoading = 0;
}
if(this.isLoading==-1)return;
this.isLoading = 1;
getProductslist(this.where).then(res=>{
this.hostProduct = [...this.hostProduct, ...res.data.list];
this.where.page++;
this.isLoading = 0;
if(res.data.list.length<this.where.limit) this.isLoading = -1;
})
},
goDetail(item) {
goShopDetail(item, this.uid).then(res => {
if (this.isLogin) {
initiateAssistApi(item.activity_id).then(res => {
let id = res.data.product_assist_set_id;
uni.hideLoading();
uni.navigateTo({
url: '/pages/activity/assist_detail/index?id=' + id
});
}).catch((err) => {
uni.showToast({
title: err,
icon: 'none'
})
});
} else {
toLogin();
}
})
}
}
}
</script>

View File

@ -63,6 +63,9 @@
import {
configMap
} from '@/utils';
import {
getGeocoder
} from "@/api/store.js"
export default {
name: 'homeComb',
props: {
@ -188,6 +191,7 @@
})
},
mounted() {
this.getLocation();
let that = this;
if (that.tabTitle.length > 0 && that.tabTitle[0]['value'] != '推荐') {
that.tabTitle.unshift({
@ -217,6 +221,65 @@
})
},
methods: {
//
changeMap() {
uni.navigateTo({
url: `/pages/select_address_n/select_address_n`,
success: () => {
uni.$once('changeAddress', (e) => {
this.street = e.street.name;
this.town = e.street.name;
this.$store.commit('setAddress', {
street_id: e.street.code,
townName: this.town
});
if (e.longitude) {
this.longitude = e.longitude;
this.latitude = e.latitude;
this.$store.commit('setLocation', {
lat: e.latitude,
long: e.longitude,
});
}
})
}
})
},
getLocation(){
uni.getLocation({
type: 'gcj02',
success: (res) => {
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();
this.$store.commit('setLocation', {
lat: res.latitude.toFixed(6),
long: res.longitude.toFixed(6),
});
getGeocoder({
lat: latitude,
long: longitude
}).then(res => {
let town = res.data.address_reference.town.title
let street_id = street_id = res.data.address_reference.town.id
this.street = res.data.address_reference.town.title;
this.$store.commit('setAddress', {
street_id: street_id,
townName: town
});
uni.$emit('getLocation_succees', {
street_id,
})
}).catch(err => {
uni.showToast({
title: err,
icon: 'none'
})
this.street = '定位失败'
})
}
})
},
goDetail(url) {
let urls = url.info[1].value
this.$util.JumpPath(urls);

View File

@ -13,7 +13,6 @@
:dataConfig="homeCombData" :userInfo="userInfo" :isFixed="isFixed" :isScrolled="isScrolled"
@changeDiy="changeDiy"></homeComb>
<!-- <card></card> -->
<view v-for="(item, index) in styleConfig" :key="index">
<block
v-if="item.name != 'headerSerch' && item.name != 'tabNav' && item.name != 'shopList' && item.name != 'homeComb' && item.name != 'hotRanking' && item.name != 'pageFoot'">
@ -89,8 +88,8 @@
<!-- 首页推荐 -->
<view v-if="recommend_switch == 1" class="index-product-wrapper">
<!-- 首发新品 -->
<recommend :hostProduct="hostProduct" :indexP="true" :isLogin="isLogin"></recommend>
<view class="loadingicon acea-row row-center-wrapper" v-if="hostProduct.length > 0">
<recommend ref="recommendRef" :hostProduct="hostProduct" @changeRecommedTab="changeRecommedTab" showTab :indexP="true" :isLogin="isLogin"></recommend>
<view class="loadingicon acea-row row-center-wrapper" v-if="hostProduct.length > 0 || hotLoading">
<text class="loading iconfont icon-jiazai" :hidden="hotLoading == false"></text>
{{ hotTitle }}
</view>
@ -784,7 +783,7 @@
if (item.name == 'menus') {
that.isMenu = true;
}
if (that.recommend_switch == 1) that.get_host_product()
if (that.recommend_switch == 1) that.loadGoods();
uni.pageScrollTo({
scrollTop: 0,
})
@ -996,6 +995,25 @@
that.loadTitle = '加载更多';
});
},
/**
* 点击组件选项卡
*/
changeRecommedTab(e){
this.hotPage = 1;
this.hotScroll = true;
this.$set(this, 'hostProduct', []);
this.loadGoods(e);
},
loadGoods(e=1){
if(e==1) return this.get_host_product();
if(e==2) return this.get_host_home({
mer_id: 259
});
if(e==3) return this.get_host_home();
if(e==4) return this.get_host_home({
label_name: '名优特产'
});
},
/**
* 获取我的推荐
*/
@ -1005,7 +1023,7 @@
if (!that.hotScroll) return;
if (that.hotLoading) return;
that.hotLoading = true;
that.hotTitle = '';
that.hotTitle = '加载中';
getProductHot(that.hotPage, that.hotLimit).then(res => {
let list = res.data.list;
let productList = that.$util.SplitArray(list, that.hostProduct);
@ -1017,6 +1035,32 @@
that.$set(that, 'hotPage', that.hotPage + 1);
});
},
/**
* 获取里海云仓, 云市场, 名优特产
*/
get_host_home: function(query={}) {
let that = this;
let num = that.hotLimit;
if (!that.hotScroll) return;
if (that.hotLoading) return;
that.hotLoading = true;
that.hotTitle = '加载中';
query.page = that.hotPage;
query.limit = that.hotLimit;
getProductslist({
...query
}).then(res => {
let list = res.data.list;
let productList = that.$util.SplitArray(list, that.hostProduct);
let hotScroll = list.length <= num && list.length != 0;
that.hotScroll = hotScroll;
that.hotLoading = false;
that.hotTitle = !hotScroll ? '已全部加载' : '加载更多';
that.$set(that, 'hostProduct', productList);
that.$set(that, 'hotPage', that.hotPage + 1);
});
},
getCateData() {
getCateData().then(res => {
res.data.unshift({
@ -1112,7 +1156,7 @@
onReachBottom() {
if (this.recommend_switch == 1 && this.navIndex == 0) {
//
this.get_host_product();
this.loadGoods(this.$refs.recommendRef.currTabs || 1);
} else if (this.navIndex == 1) {
//
if (this.sortProduct.length > 0) {

View File

@ -0,0 +1,414 @@
<template>
<view class="" style="background-color: #fff;">
<u-sticky customNavHeight="0">
<view class="head_top">
<!-- <u-search placeholder="搜索小区、办公楼等" @custom="searchMap"></u-search>
<view style="height: 20rpx;"></view> -->
<u-tabs :list="tabsList" itemStyle="font-size: 32rpx;height: 74rpx;" :current="current" @change="changeCurrent"
lineColor="#FF6D20" lineWidth="105rpx" height="7rpx"></u-tabs>
</u-tabs>
</view>
</u-sticky>
<view style="background-color: #f4f4f4;height: 30rpx;"></view>
<view class="address-box" v-if="current==0" style="padding: 0;">
<map style="width: 750rpx;height: 750rpx;" :longitude="longitude" :latitude="latitude" :markers="[markers]"
show-location @tap="handleMapTap"></map>
<view class="head_item" style="padding: 10rpx 20rpx;">
<view class="re-location">
<view style="width: 120rpx;"><text class="text">当前位置: </text></view>
<view style="flex: 1;">
<text
class="text">{{locationInfo.formatted_addresses?locationInfo.formatted_addresses.recommend:locationInfo.address}}</text>
</view>
</view>
<view class="re-btn" @click="reGetLocation">
<image class="re-address-img" src="@/static/images/re_address.png"></image><text class="text">重新定位</text>
</view>
</view>
<u-button text="确认" @click="submitAddress"></u-button>
</view>
<view class="address-box" v-if="current==1">
<view class="head_item_tips">
<view><text class="text">泸州区县</text></view>
</view>
<view class="area">
<view class="area-item" :class="{'area-item-on': item.code==area_change}" v-for="(item, index) in areaList"
:key="index" @click="changeArea(item)">
<text class="text">{{item.name}}</text>
</view>
</view>
<view class="head_item_tips">
<view><text class="text">选择街道/镇</text></view>
</view>
<view class="street">
<view class="letter-item" v-for="key in mapKey" :key="key">
<view class="letter"><text class="text">{{key}}</text></view>
<view class="item-box">
<view class="street-item" v-for="item in mapList[key]" :key="item.code" @click="changeStreet(item)">
<text class="text">{{item.name}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
getGeocoder,
merClassifly,
getProductslist
} from '@/api/store.js';
import {
getArea,
getStreet
} from "@/api/article.js";
import { Toast } from '@/libs/uniApi';
import { wgsToGcj } from "@/utils/wgs.js";
export default {
data() {
return {
tabsList: [{
name: '地图定位',
}, {
name: '泸州区县',
}],
current: 0,
latitude: '28.87',
longitude: '105.44',
markers: {
id: 1,
longitude: '28.87',
latitude: '105.44',
iconPath: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/cbbd5202311241523412538.png',
width: 28,
height: 28
},
locationInfo: {},
town: '',
street_id: '',
street: '',
areaList: [],
streetList: [],
mapList: {},
area_change: '',
street_change: '',
}
},
onLoad(options) {
this.getLoaction();
this.loadArea();
},
onShow() {},
computed: {
mapKey() {
return Object.keys(this.mapList).sort()
}
},
methods: {
changeCurrent(e) {
this.current = e.index;
},
getLoaction() {
this.street = '定位中'
this.locationInfo = {};
this.locationInfo.formatted_addresses = {};
this.locationInfo.formatted_addresses.recommend = '定位中'
uni.setStorageSync('RejectTarget', false);
uni.getLocation({
type: 'gcj02',
success: (res) => {
// res = wgsToGcj(res);
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();
this.latitude = res.latitude.toFixed(6);
this.longitude = res.longitude.toFixed(6);
this.$store.commit('setLocation', {
lat: res.latitude.toFixed(6),
long: res.longitude.toFixed(6),
});
getGeocoder({
lat: latitude,
long: longitude
}).then(res => {
this.locationInfo = res.data;
this.town = res.data.address_reference.town.title
this.street_id = res.data.address_reference.town.id
this.street = res.data.address_reference.town.title;
}).catch(err => {
uni.showToast({
title: err,
icon: 'none'
})
this.street = '定位失败'
})
},
fail: (err) => {
console.log('定位失败');
this.isshow = false
Toast('定位失败,请检查定位权限是否开启')
this.street = '定位失败'
this.locationInfo.formatted_addresses.recommend = '定位失败'
// uni.showToast({
// title: "获取定位超时",
// icon: 'none',
// duration: 2000
// });
}
});
},
reGetLocation() {
this.getLoaction()
},
loadArea() {
getArea({
city_code: 510500
}).then((res) => {
this.areaList = res.data;
this.changeArea(this.areaList[0]);
})
},
loadStreet(area_code) {
this.street_change = '';
getStreet({
area_code
}).then((res) => {
this.streetList = res.data;
this.initPinyin();
})
},
initPinyin() {
this.mapList = {};
this.streetList.forEach((item) => {
let str = item.pinyin?.toUpperCase();
str = str ? str : '#';
if (this.mapList[str]) {
this.mapList[str].push(item);
} else {
this.mapList[str] = [];
this.mapList[str].push(item)
}
})
},
changeArea(item) {
this.area_change = item.code;
this.loadStreet(this.area_change);
},
// 选择位置
changeStreet(item) {
uni.navigateBack({
success: () => {
uni.$emit('changeAddress', {
area: this.area_change,
street: item
})
}
})
},
// 点击地图
handleMapTap(e) {
// console.log('点击地图', e);
// #ifdef H5
return Toast('H5暂不支持选择坐标');
// #endif
let longitude = e.detail.longitude;
let latitude = e.detail.latitude;
this.markers.longitude = longitude;
this.markers.latitude = latitude;
// console.log('修改成功', this.markers);
getGeocoder({
lat: latitude,
long: longitude
}).then(res => {
// console.log(res);
this.locationInfo = res.data;
}).catch(err => {
uni.showToast({
title: err,
icon: 'none'
})
this.locationInfo = {};
this.locationInfo.formatted_addresses = {};
this.locationInfo.formatted_addresses.recommend = '定位失败'
})
},
submitAddress() {
console.log(this.locationInfo);
try {
this.town = this.locationInfo.address_reference.town.title;
this.street_id = this.locationInfo.address_reference.town.id;
this.street = this.locationInfo.address_reference.town.title;
let obj = {
area: this.locationInfo.ad_info.adcode,
street: {
name: this.street,
code: this.street_id
},
latitude: this.latitude,
longitude: this.longitude
}
console.log({...obj});
uni.navigateBack({
success: () => {
uni.$emit('changeAddress', obj)
}
})
} catch (e) {
return Toast('地址有误,请重新选择')
}
},
searchMap(){
uni.request({
url: 'https://restapi.amap.com/v3/place/text?keywords=北京大学&city=beijing&offset=20&page=1&key=0799f37420c0784f1e6cba230a68bdb1&extensions=all',
success: (res) => {
console.log(res);
},
fail: (e) => {
console.log(e);
}
})
}
},
onPullDownRefresh() {
uni.stopPullDownRefresh()
}
}
</script>
<style>
/* page {
background-color: #fff;
} */
.text {
font-size: 28rpx;
white-space: normal;
}
.head_top {
background-color: #fff;
padding: 28rpx;
}
.address-box {
border-radius: 21rpx 21rpx 0rpx 0rpx;
padding: 30rpx 28rpx;
width: 750rpx;
}
.head_item {
width: 750rpx;
flex-direction: row;
justify-content: space-between;
padding-bottom: 28rpx;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
}
.re-location {
flex-direction: row;
flex-wrap: nowrap;
width: 480rpx;
align-items: center;
}
.re-address-img {
width: 38.55rpx;
height: 38.55rpx;
margin-right: 10rpx;
}
.re-btn {
flex-direction: row;
padding-left: 10rpx;
width: 200rpx;
height: 100rpx;
align-items: center;
}
.head_item_tips {
height: 44rpx;
font-size: 32rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #737373;
}
.address-list {
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
height: 80rpx;
line-height: 75rpx;
border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
}
.area {
flex-direction: row;
flex-wrap: wrap;
padding-top: 30rpx;
justify-content: flex-start;
}
.area-item {
height: 64rpx;
/* width: 100px; */
background-color: #fff;
border-radius: 11rpx 11rpx 11rpx 11rpx;
border: 2rpx solid #B3B3B3;
flex-direction: row;
align-items: center;
justify-content: center;
padding: 0 20rpx;
font-size: 28rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #737373;
margin-bottom: 22rpx;
margin-right: 22rpx;
}
.area-item-on {
color: #ff6d20;
border: 2rpx solid #ff6d20;
}
.street {
padding-top: 28rpx;
}
.letter-item {
flex-direction: row;
}
.letter {
margin-right: 28rpx;
font-size: 25rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
width: 40rpx;
text-align: center;
color: #737373;
}
.item-box {
flex: 1;
}
.street-item {
width: 100%;
padding-bottom: 28rpx;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #333333;
}
</style>

View File

@ -566,6 +566,7 @@
groupOrderList({
page: that.page,
limit: that.limit,
sale_type: 1 //1-, 2-
}).then(res => {
that.isReady = true;
let list = res.data.list || [];
@ -585,6 +586,7 @@
status: that.orderStatus - 1,
page: that.page,
limit: that.limit,
sale_type: 1 //1-, 2-
}).then(res => {
let list = res.data.list || [];
let loadend = list.length < that.limit;

BIN
static/assets/car.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 541 B

View File

@ -1,232 +0,0 @@
@font-face {
font-family: "iconfont2";
/* Project id 3861260 */
src: url('//at.alicdn.com/t/c/font_3861260_kcyv21x2z6e.woff2?t=1683356048406') format('woff2'),
url('//at.alicdn.com/t/c/font_3861260_kcyv21x2z6e.woff?t=1683356048406') format('woff'),
url('//at.alicdn.com/t/c/font_3861260_kcyv21x2z6e.ttf?t=1683356048406') format('truetype'),
url('//at.alicdn.com/t/c/font_3861260_kcyv21x2z6e.svg?t=1683356048406#iconfont2') format('svg');
}
.iconfont2 {
font-family: "iconfont2" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.custom-icona-zu2901:before {
content: "\e648";
}
.custom-iconoasa1:before {
content: "\e649";
}
.custom-icongengduo:before {
content: "\e64a";
}
.custom-iconyijian:before {
content: "\e644";
}
.custom-icongongzi:before {
content: "\e645";
}
.custom-iconwendang:before {
content: "\e646";
}
.custom-iconweixin:before {
content: "\e647";
}
.custom-iconoaha:before {
content: "\e634";
}
.custom-iconoamy:before {
content: "\e635";
}
.custom-iconoamya:before {
content: "\e63e";
}
.custom-iconoasa:before {
content: "\e63f";
}
.custom-iconoara:before {
content: "\e640";
}
.custom-iconoar:before {
content: "\e641";
}
.custom-iconoah:before {
content: "\e642";
}
.custom-iconoas:before {
content: "\e643";
}
.custom-iconhangye:before {
content: "\e636";
}
.custom-iconhangye-a:before {
content: "\e637";
}
.custom-iconxinwen:before {
content: "\e638";
}
.custom-icongonying:before {
content: "\e639";
}
.custom-icongonying-a:before {
content: "\e63a";
}
.custom-iconmy-a:before {
content: "\e63b";
}
.custom-iconxiaoxi-a:before {
content: "\e63c";
}
.custom-iconmy:before {
content: "\e63d";
}
.custom-iconchuang:before {
content: "\e631";
}
.custom-iconyouhuiquan:before {
content: "\e632";
}
.custom-iconmeishi:before {
content: "\e633";
}
.custom-iconsmfw:before {
content: "\e62c";
}
.custom-iconzxyy:before {
content: "\e62d";
}
.custom-iconzxjd:before {
content: "\e62e";
}
.custom-iconhtqd:before {
content: "\e62f";
}
.custom-iconzxsg:before {
content: "\e630";
}
.custom-iconhbxs:before {
content: "\e622";
}
.custom-iconmsgy:before {
content: "\e623";
}
.custom-iconylbj:before {
content: "\e624";
}
.custom-iconfwzx:before {
content: "\e625";
}
.custom-iconjypx:before {
content: "\e626";
}
.custom-iconshfw:before {
content: "\e627";
}
.custom-iconnfcp:before {
content: "\e628";
}
.custom-iconsczl:before {
content: "\e629";
}
.custom-iconscfw:before {
content: "\e62a";
}
.custom-iconwyly:before {
content: "\e62b";
}
.custom-iconmdtj:before {
content: "\e615";
}
.custom-iconxjjb:before {
content: "\e616";
}
.custom-iconcmtxl:before {
content: "\e617";
}
.custom-iconcunwu:before {
content: "\e618";
}
.custom-iconysdt:before {
content: "\e619";
}
.custom-icongsrz:before {
content: "\e61a";
}
.custom-icongstz:before {
content: "\e61b";
}
.custom-iconxzcg:before {
content: "\e61c";
}
.custom-iconcaiwu:before {
content: "\e61d";
}
.custom-iconshce:before {
content: "\e61e";
}
.custom-iconsqhf:before {
content: "\e61f";
}
.custom-iconxxlr:before {
content: "\e620";
}
.custom-icondangwu:before {
content: "\e621";
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -18,7 +18,6 @@ import {
import Cache from '../../utils/cache';
const state = {
location: Cache.get('LOCATION_DATA', true) || {},
address: Cache.get('address') || {},
token: Cache.get(LOGIN_STATUS) || null,
uuid: uni.getStorageSync('uuid') || "",
backgroundColor: "#fff",
@ -36,10 +35,6 @@ const mutations = {
setLocation(state, data) {
state.location = data
Cache.set('LOCATION_DATA', data);
},
SET_ADDRESS(state, data) {
state.address = data
Cache.set('address', data);
},
LOGIN(state, opt) {
state.token = opt.token;

View File

@ -8,6 +8,8 @@
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import app from "./app";
import storage from "./storage.js";
export default {
app
};
app,
storage
};

53
store/modules/storage.js Normal file
View File

@ -0,0 +1,53 @@
import {
getUserInfo,
Appversion
} from "../../api/user.js";
import {
LOGIN_STATUS,
UID,
USER_INFO
} from '../../config/cache';
import Cache from '../../utils/cache';
const state = {
storage: {},
location: uni.getStorageSync('S_location') || {
lat: null,
long: null,
},
address: uni.getStorageSync('S_address') || {
street_id: '',
townName: ''
}
};
const mutations = {
setStorage(state, data) {
state.storage = data;
},
setLocation(state, data){
state.location.lat = data.lat;
state.location.long = data.long;
uni.setStorageSync('S_location', {
lat: data.lat,
long: data.long
})
},
setAddress(state, data){
state.address.street_id = data.street_id;
state.address.townName = data.townName;
uni.setStorageSync('S_address', {
street_id: data.street_id,
townName: data.townName
})
}
};
const actions = {
};
export default {
state,
mutations,
actions
};