更新功能

This commit is contained in:
weipengfei 2023-11-13 18:42:30 +08:00
parent 6abc6ef833
commit 1f99af550c
8 changed files with 711 additions and 267 deletions

View File

@ -1,38 +1,57 @@
<template>
<view>
<uni-popup ref="popupRef" type="bottom">
<uni-popup ref="popupRef" type="bottom" @change="changeShow">
<view class="pop">
<view class="image">
<image src="../static/images/f2.png"></image>
<view class="border"></view>
</view>
<view class="white_card">
<view class="flex">
<view class="price"><text class="pro">10</text>.00</view>
<view>订货价</view>
</view>
<view class="short_name">商品名称</view>
<view class="shop_name">店铺名称</view>
<u-line></u-line>
<view class="m_title">规格选中</view>
<view class="flex">
<view class="attr">规格1</view>
<view class="attr">规格2</view>
</view>
<view class="m_title num">
<view>购买数量</view>
<view>1</view>
</view>
<view>
商品库存 200
</view>
<view class="button">
<view class="b_icon">
<image src="@/static/images/icon/car.png"></image>
<view>采购车</view>
<scroll-view scroll-y class="scroll">
<view class="image">
<swiper v-if="product.slider_image && product.slider_image.length>0" autoplay style="width: 100%;height: 100%;">
<swiper-item v-for="(item,index) in product.slider_image" :key="index">
<image class="img" :src="item"></image>
</swiper-item>
</swiper>
<image v-else class="img" :src="datas.image||defualtImg"></image>
<image class="close" src="@/static/images/icon/close.png" @click="close()"></image>
<view class="current"></view>
<view class="border"></view>
</view>
<view class="btn">加入采购清单</view>
<view class="white_card">
<view class="flex flex_end">
<view class="price"><text class="pro">{{leftPrice}}.</text>{{rightPrice}}
</view>
<view>订货价</view>
</view>
<view class="short_name">{{datas.store_name}}</view>
<view class="flex">
<view class="shop_name">
<image class="icon" src="@/static/images/icon/short.png"></image>
<view>{{datas.merchant.mer_name}}</view>
</view>
</view>
<u-line></u-line>
<view class="m_title">规格选中</view>
<view class="flex">
<view class="attr" :class="{'attr_active': item==sku_key}" v-for="item in sku_key_list" :key="item" @click="sku_key = item">{{item||'默认'}}</view>
</view>
<view class="m_title num">
<view>购买数量</view>
<view class="input">
<view class="input_item sub" @click="subCartNum">-</view>
<input class="input_item input_view" v-model="cart_num" type="number" @input="inputCartNum" />
<view class="input_item plus" @click="plusCartNum">+</view>
</view>
</view>
<view>
商品库存 <text style="margin-left: 20rpx;">{{(sku[sku_key] && sku[sku_key].stock)||change.stock}}</text>
</view>
</view>
</scroll-view>
<view class="button">
<view class="b_icon" @click="navgo('/pages/order_addcart/order_addcart')">
<image src="@/static/images/icon/car.png"></image>
<view>采购车</view>
<view class="badge" v-if="goodsNum">{{goodsNum}}</view>
</view>
<view class="btn" @click.stop="$u.throttle(addcart, 1500)">加入采购清单</view>
</view>
</view>
</uni-popup>
@ -40,20 +59,158 @@
</template>
<script>
import {
postCartAdd,
} from '@/api/store.js';
export default {
name: "shortPopup",
props: ['datas'],
data() {
return {
show: false
isShow: false, //
defualtImg: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/uploads/20230130/00ebcfdf75684f5494c0193075055d1.png',
datas: {
image: '',
store_name: '',
merchant: {
mer_name: ''
},
price: '',
},
product: {},
attrValue: [],
sku: {}, //
sku_key_list: [], //
sku_key: '', //
change: {
stock: ''
},
cart_num: 1, //
goodsNum: 0, //
};
},
mounted() {},
computed:{
leftPrice(){
return this.sku[this.sku_key]?.price?.split('.')[0]||'0';
},
rightPrice(){
return this.sku[this.sku_key]?.price?.split('.')[1]||'00';
}
},
methods: {
// ,
setDatas(datas, goodsNum) {
this.goodsNum = goodsNum;
this.datas = datas;
this.product = datas.product;
this.attrValue = datas.product?.attrValue;
this.change = this.attrValue[0];
this.cart_num = 1;
this.sku = datas.sku;
this.sku_key_list = Object.keys(this.sku);
this.sku_key = this.sku_key_list[0];
},
//
inputCartNum(e) {
if(this.sku){
if (+e.detail.value > this.sku[this.sku_key].stock) {
uni.showToast({
icon: 'none',
title: '不能超出库存哦'
})
this.$nextTick(() => {
this.cart_num = this.sku[this.sku_key].stock;
})
}
}else if (this.change.stock <= this.cart_num) {
uni.showToast({
icon: 'none',
title: '不能超出库存哦'
})
this.$nextTick(() => {
this.cart_num = this.change.stock;
})
}
},
//
subCartNum() {
if (this.cart_num <= 1) {
return uni.showToast({
icon: 'none',
title: '最少要买一件哦'
})
}
this.cart_num--;
},
//
plusCartNum() {
if(this.sku){
if (this.sku[this.sku_key].stock <= this.cart_num) {
return uni.showToast({
icon: 'none',
title: '不能超出库存哦'
})
}
}else if (this.change.stock <= this.cart_num) {
return uni.showToast({
icon: 'none',
title: '不能超出库存哦'
})
}
else this.cart_num++;
},
//
addcart() {
if (this.sku[this.sku_key]) {
if (this.cart_num > this.sku[this.sku_key].stock) return uni.showToast({
icon: 'none',
title: '不能超出库存哦'
})
let data = {
cart_num: this.cart_num,
is_new: 0,
product_attr_unique: this.sku[this.sku_key].unique,
product_id: this.datas.product_id,
product_type: this.datas.product_type,
// source: 103,
spread_id: "",
}
let that = this
let res = postCartAdd({
...data
}).then((res, err) => {
uni.showToast({
title: "加入成功",
duration: 1000,
})
this.close();
}).catch(err => {
uni.showToast({
title: err,
icon: "none",
duration: 1000,
})
})
} else {
uni.showToast({
icon: 'none',
title: '商品规格不存在'
})
}
},
navgo(url) {
uni.navigateTo({
url
})
},
open() {
this.$refs.popupRef.open();
},
close() {
this.$refs.popupRef.close();
},
changeShow(e) {
this.isShow = e.show;
}
}
}
@ -66,17 +223,41 @@
overflow: hidden;
position: relative;
.image{
.scroll{
height: calc(90vh - 150rpx);
}
.flex_end {
align-items: flex-end;
}
.image {
height: 750rpx;
width: 750rpx;
position: relative;
image{
.img {
width: 100%;
height: 100%;
border-radius: 31.54rpx 31.54rpx 0rpx 0rpx;
overflow: hidden;
}
.border{
.close {
position: absolute;
bottom: 0;
top: 30rpx;
right: 30rpx;
width: 50.82rpx;
height: 50.82rpx;
}
.current{
}
.border {
position: absolute;
bottom: -1rpx;
left: 0;
background-color: #fff;
height: 40rpx;
@ -84,39 +265,51 @@
border-radius: 40rpx 40rpx 0 0;
}
}
.white_card{
.white_card {
border-radius: 31.54rpx 31.54rpx 0rpx 0rpx;
background-color: #fff;
margin: 0 28rpx;
padding-bottom: 30rpx;
color: #737373;
font-size: 26.29rpx;
.price{
.price {
font-size: 35rpx;
font-family: SF Pro Display-Semibold, SF Pro Display;
font-weight: 600;
color: #F84221;
.pro{
padding-right: 30rpx;
.pro {
font-size: 49.07rpx;
}
}
.short_name{
.short_name {
font-size: 33rpx;
font-family: PingFang SC-Semibold, PingFang SC;
font-weight: 600;
color: #333333;
}
.shop_name{
display: inline-block;
.shop_name {
display: flex;
background: #FEF5F3;
padding: 0 16rpx;
border-radius: 26rpx 26rpx 26rpx 26rpx;
margin-top: 30rpx;
margin-bottom: 20rpx;
align-items: center;
.icon {
width: 31.54rpx;
height: 31.54rpx;
margin-right: 10rpx;
}
}
.m_title{
.m_title {
font-size: 30rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
@ -124,51 +317,124 @@
margin-top: 31rpx;
margin-bottom: 21rpx;
}
.attr{
background: #FEF5F3;
.attr {
opacity: 1;
border: 1rpx solid #F84221;
color: #333333;
padding: 15rpx 30rpx;
margin-right: 20rpx;
height: 63rpx;
line-height: 60rpx;
border-radius: 63rpx;
display: flex;
align-items: center;
justify-content: center;
}
.num{
.attr_active{
// background-color: #FEF5F3;
// color: #F84221;
background-color: #F84221;
color: #fff;
}
.num {
display: flex;
justify-content: space-between;
}
.button{
display: flex;
justify-content: space-around;
margin-top: 20rpx;
.b_icon{
align-items: center;
.input {
display: flex;
flex-direction: column;
align-items: center;
font-size: 19rpx;
font-weight: 400;
color: #333333;
image{
width: 50.82rpx;
height: 50.82rpx;
height: 48rpx;
.input_item {
width: 44rpx;
height: 44rpx;
text-align: center;
line-height: 40rpx;
border: 2rpx solid #fff;
font-size: 26rpx;
color: #333;
}
.input_view {
width: 60rpx;
}
.sub {
border: 2rpx solid #FCB9AD;
border-radius: 7rpx 0rpx 0rpx 7rpx;
background: #FFFFFF;
font-size: 26rpx;
color: #B3B3B3;
}
.plus {
border: 2rpx solid #FCB9AD;
border-radius: 0rpx 7rpx 7rpx 0rpx;
background: #FFFFFF;
font-size: 26rpx;
color: #B3B3B3;
}
}
.btn{
width: 575rpx;
height: 84rpx;
background: linear-gradient(270deg, #FF6D20 0%, #F84221 100%);
border-radius: 42rpx 42rpx 42rpx 42rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 30rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
}
}
.button {
padding: 28rpx;
margin-bottom: 28rpx;
background-color: #fff;
display: flex;
justify-content: space-around;
padding-bottom: constant(safe-area-inset-bottom); /// IOS<11.2/
padding-bottom: env(safe-area-inset-bottom); /// IOS>11.2/
padding-bottom: constant(safe-area-inset-bottom); /// IOS<11.2/
padding-bottom: env(safe-area-inset-bottom); /// IOS>11.2/
.b_icon {
display: flex;
flex-direction: column;
align-items: center;
font-size: 19rpx;
font-weight: 400;
color: #333333;
position: relative;
image {
width: 50.82rpx;
height: 50.82rpx;
}
.badge {
position: absolute;
top: -5rpx;
right: -10rpx;
color: #fff;
min-width: 28rpx;
height: 28rpx;
text-align: center;
line-height: 24rpx;
background: #F84221;
border-radius: 16rpx 16rpx 16rpx 16rpx;
border: 2rpx solid #FFFFFF;
}
}
.btn {
width: 575rpx;
height: 84rpx;
background: linear-gradient(270deg, #FF6D20 0%, #F84221 100%);
border-radius: 42rpx 42rpx 42rpx 42rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 30rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
}
}
}

View File

@ -97,10 +97,12 @@
hotSearchBox: false,
isAuto: false, //
isShowAuth: false, //
back: false
};
},
onLoad(options) {
this.searchValue = options.searchVal || ''
this.searchValue = options.searchVal || '';
if(options.back)this.back = true;
},
onShow: function() {
try {
@ -167,6 +169,7 @@
this.$set(this, 'searchValue', event.detail.value);
},
searchBut: function() {
if(this.back) return this.navigatorBack();
if(/^(\/@[1-9]{1}).*\*\//.test(this.searchValue)){
uni.showLoading({
title: '加载中',
@ -209,7 +212,6 @@
this.searchValue = ""
});
}else{
let status = false
this.tempStorage.forEach((el, index) => {
if (el == this.searchValue) {
@ -226,10 +228,17 @@
uni.navigateTo({
url: '/pages/columnGoods/goods_search_con/index?searchValue=' + this.searchValue
})
}
}
},
navigatorBack(){
if(this.searchValue!==''&&this.searchValue!==undefined&&this.searchValue!==null){
uni.navigateBack({
success:()=> {
uni.$emit('searchValue', this.searchValue);
}
});
}
}
}
}
</script>

View File

@ -4,23 +4,23 @@
<view class='productList' :style="viewColor">
<!-- 顶部 -->
<view class="top">
<view class="head_tit">
<view class="" style="display: flex;align-items: center;width: 100%;">
<view class="" style="display: flex;align-items: center;width: 100%;justify-content: space-between;">
<!-- <u--image :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx"
height="50.82rpx" @click='backjJump'></u--image> -->
<i class="iconfont icon-xiangzuo" style="font-size: 31.54rpx;text-align: left;" @click='backjJump'></i>
<view class=""
@click="navGoto(`/pages/nongKe/supply_chain/supplierB?type_id=10,17&street_id=${street_id}&townName=${street}&location=${latitude},${longitude}`)"
style="font-size: 31.54rpx;font-weight: 700;transform: skewX(-10deg);margin-left: 10rpx;">
供销综合云市场
<view style="display: flex;align-items: center;">
<i class="iconfont icon-xiangzuo" style="font-size: 31.54rpx;text-align: left;" @click='backjJump'></i>
<view class=""
@click="navGoto(`/pages/nongKe/supply_chain/supplierB?type_id=10,17&street_id=${street_id}&townName=${street}&location=${latitude},${longitude}`)"
style="font-size: 31.54rpx;font-weight: 700;margin-left: 10rpx;">
供销综合云市场
</view>
<view class=""
style="font-size: 31.54rpx;font-weight: 700;margin-left: 20rpx;color: #F84221;">
供销综合云商品
</view>
</view>
<view class=""
style="font-size: 31.54rpx;font-weight: 700;transform: skewX(-10deg);margin-left: 20rpx;color: #F84221;">
供销综合云商品
</view>
<view style="flex: 1; display: flex;align-items: center;justify-content: right;margin-left: 20rpx;"
<view style="display: flex;align-items: center;justify-content: right;margin-left: 20rpx;"
@click="showPicker=!showPicker">
<view class="town_name">{{street||'定位中'}}</view>
<u--image :showLoading="true" src="/static/images/GXSC/XL.png" width="33.29rpx"
@ -29,8 +29,8 @@
</view>
</view>
<view class="sswz">
<view style="position: relative;width: 694rpx;margin: 0 auto;">
<view class="sswz" @click="navToSearch">
<view style="position: relative;width: 694rpx;margin: 0 auto;pointer-events:none">
<u-search borderColor="#FF6D20" bgColor="white" :showAction="false" placeholder="搜索店铺或者名称"
v-model="storeParam.keyword" @search="onInputConfirm" class="serch_cls"></u-search>
<u--image @tap="searchSubmit" class="img_cls" :showLoading="true" src="/static/images/GXSC/SSBT.png"
@ -54,7 +54,7 @@
<view class="menu_cls">
<u-scroll-list indicatorActiveColor='#FF6D20' :indicator="true">
<view class="menu_li" :class="{'menu_li_on': item.cate_name==changeCategory.cate_name}"
<view class="menu_li" :class="{'menu_li_on': item.cate_name==merchant.cate_name}"
@click="changeMerchant(item)" v-for="item,index in cloudList" :key="index">
<u--image class="image" :showLoading="true" :src="item.pic" width="87.62rpx" height="87.62rpx"
shape="circle"></u--image>
@ -62,6 +62,11 @@
</view>
</view>
</u-scroll-list>
<view class="all" @click="showAllRef">
<view></view>
<view></view>
<image src="@/static/images/icon/all.png"></image>
</view>
</view>
</view>
@ -69,15 +74,20 @@
<view class="container">
<scroll-view scroll-y class="left-panel" @scrolltolower="loadMoreLeft">
<!-- 左侧内容 -->
<view class="left-panel_item" v-for="(item, index) in changeCategory.children" :class="{'left-panel_item_active': index==0}" @click="changeMerchantTow(1)">{{item.cate_name}}</view>
<view class="left-panel_item" v-for="(item, index) in merchant.children" :class="{'left-panel_item_active': item.cate_name==merchantTow.cate_name}" @click="changeMerchantTow(item)">{{item.cate_name}}</view>
<view style="height: 200rpx;"></view>
</scroll-view>
<view class="right-panel">
<view class="right-panel-head">
<view class="active">综合</view>
<view :class="{'active': storeParam.order==''}" @click="set_where('')">综合</view>
<view>
<view>销量</view>
<view>价格</view>
<view :class="{'active': storeParam.order=='sales'}" @click="set_where('sales')">销量</view>
<view :class="{'active': storeParam.order.includes('price')}" @click="set_where(price_order)">
<text style="margin-right: 5rpx;">价格</text>
<image class="icon" v-if="price_order=='price_asc'&&storeParam.order.includes('price')" :src="domain+'/static/diy/up'+keyColor+'.png'"></image>
<image class="icon" v-else-if="price_order=='price_desc'&&storeParam.order.includes('price')" :src="domain+'/static/diy/down'+keyColor+'.png'"></image>
<image class="icon" v-else src='/static/images/horn.png'></image>
</view>
</view>
</view>
<scroll-view scroll-y class="right-panel-view" @scrolltolower="loadMoreRight">
@ -97,7 +107,7 @@
<view class="r_type">
<view v-if="item.product.store_info">{{item.product.store_info}}</view>
</view>
<view class="r_btn" v-if="item.product.price">
<view class="r_btn" v-if="item.product && item.product.price">
<view><text style="font-size: 33rpx;">{{ item.product.price.split('.')[0] }}.</text>{{item.product.price.split('.')[1]}}</view>
<image src="@/static/images/icon/plus.png" style="width: 40rpx;height: 40rpx;border-radius: 40rpx;"></image>
</view>
@ -148,7 +158,22 @@
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker>
</view>
<shortPopup ref="shortPopupRef" :datas="changeItem"></shortPopup>
<uni-popup ref="allRef" type="right" @change="changeAllRef">
<view class="all_ref">
<view class="header">请选择商品分类</view>
<view class="all_list">
<view class="menu_li" :class="{'menu_li_on': item.cate_name==merchant.cate_name}"
@click="changeMerchant(item, true)" v-for="item,index in cloudList" :key="index">
<u--image class="image" :showLoading="true" :src="item.pic" width="87.62rpx" height="87.62rpx"
shape="circle"></u--image>
<view class="li_text" style="display: block;font-size: 26.29rpx;margin-top: 10rpx;">{{item.cate_name}}
</view>
</view>
</view>
</view>
</uni-popup>
<shortPopup ref="shortPopupRef"></shortPopup>
</view>
</template>
@ -201,6 +226,7 @@
import Cache from '@/utils/cache';
import shortPopup from "@/components/shortPopup.vue"
import { Toast } from '../../../libs/uniApi';
const app = getApp();
export default {
components: {
@ -238,6 +264,7 @@
street: "",
showPicker: false,
status: "loadmore",
price_order: 'price_asc', //(), price_asc, price_desc
//
downMenu: [{
title: '默认',
@ -260,15 +287,13 @@
order: 'location'
}
],
//
firstKey: 0,
//
storeList: [],
storeParam: {
keyword: '',
page: 1,
limit: 10,
order: 'location',
order: '',
category_id: '',
type_id: '',
street_id: '',
@ -276,8 +301,8 @@
},
storeKey: 0,
storeScroll: true,
changeCategory: '', //
category_tow_id: '', //id
merchant: '', //
merchantTow: '', //
mer_id: '',
sortId: '',
price_on: '',
@ -299,8 +324,8 @@
goodsNum: 0,
totalMoney: 0,
goodsList: [], //
changeItem: null, //
showLoading: false, //
allShow: false, //
};
},
async onLoad(options) {
@ -320,6 +345,7 @@
this.storeParam.type_id = options.type_id && options.type_id.split(',').toString() || ''
this.storeParam.category_id = options.cate_id && options.cate_id.split(',').toString() || ''
this.storeList = [];
this.showLoading = true;
await this.getCloundShop();
this.cartFn();
if (this.mer_location == 1) {
@ -371,21 +397,9 @@
type: 2
})
this.cloudList = data;
this.changeCategory = this.cloudList[0];
await townCloud({
street_code: this.street_id,
category_id: this.category_id,
location: this.latitude + ',' + this.longitude
}).then(res => {
this.trnList = []
this.goodsList = res.data.list;
this.goodsList.forEach(item => {
this.trnList.push({
left: 0,
bottom: 0
})
})
})
this.merchant = this.cloudList[0];
this.merchantTow = this.merchant?.children[0];
this.storeParam.category_id = this.merchantTow.store_category_id;
return null;
},
selectLocation() {
@ -439,10 +453,8 @@
},
onInputConfirm() {
this.showSerch = false
this.searchSubmit()
},
//
objToArr(data) {
@ -575,7 +587,10 @@
},
selfLocation() {
let self = this
if (uni.getStorageSync('RejectTarget')) return;
if (uni.getStorageSync('RejectTarget')){
this.getStoreList();
return;
}
if (this.$store?.state?.storage?.location?.lat) {
this.latitude = this.$store?.state?.storage?.location?.lat;
this.longitude = this.$store?.state?.storage?.location?.long;
@ -589,11 +604,13 @@
this.recommend_address = res.data.address.length > 4 ? res.data.address
.slice(0, 4) + '...' :
res.data.address;
this.getStoreList();
}).catch(err => {
uni.showToast({
title: err,
icon: 'none'
})
this.getStoreList();
})
} else uni.getLocation({
type: 'gcj02',
@ -618,11 +635,13 @@
this.recommend_address = res.data.address.length > 4 ? res.data.address
.slice(0, 4) + '...' :
res.data.address
this.getStoreList();
}).catch(err => {
uni.showToast({
title: err,
icon: 'none'
})
this.getStoreList();
})
},
fail: (res) => {
@ -651,20 +670,23 @@
},
//
searchSubmit: function() {
console.log('搜索', this.storeParam.keyword);
let that = this;
that.$set(that.storeParam, 'keyword', this.storeParam.keyword);
this.set_where(this.firstKey)
this.set_where('')
this.showSerch = false
},
//
set_where: function(e) {
if (this.loading) return
this.storeList = []
this.firstKey = e
this.storeParam.page = 1
// this.storeParam.order = this.downMenu[e].order
this.storeParam.order = 'location' //使
// this.storeParam.order = 'location' //使
this.storeParam.order = e //
this.getStoreList();
if(e=='price_asc') return this.price_order = 'price_desc';
if(e=='price_desc') return this.price_order = 'price_asc';
},
backjJump() {
uni.navigateBack({
@ -672,34 +694,39 @@
})
},
//
changeMerchant(item) {
this.changeMerchant = item;
this.storeParam.category_id = this.category_id;
changeMerchant(item, type=false) {
this.merchant = item;
this.merchantTow = item.children[0];
this.storeParam.category_id = this.merchant.store_category_id;
this.storeParam.page = 1;
this.goodsList = [];
if(type) this.$refs.allRef.close();
this.getStoreList()
},
//
changeMerchantTow(){
this.storeParam.category_id = this.category_id;
changeMerchantTow(item){
this.merchantTow = item;
this.storeParam.category_id = this.merchantTow.store_category_id;
this.storeParam.page = 1;
this.getStoreList()
},
//
getStoreList() {
console.log('加载商品');
getStoreList(load=false) {
this.showLoading = true
this.status = "loading"
this.storeParam.page = 1;
if(!load) {
this.storeParam.page = 1;
this.goodsList = [];
}
townCloud({
street_code: this.street_id,
category_id: this.category_id || "22",
// order: this.storeParam.order,
keyword: this.keyword,
category_id: this.storeParam.category_id,
order: this.storeParam.order,
keyword: this.storeParam.keyword,
page: this.storeParam.page,
location: this.latitude+','+this.longitude,
}).then(res => {
this.goodsList = res.data.list
this.goodsList = [...this.goodsList, ...res.data.list]
this.showLoading = false
this.goodsList.forEach(item => {
this.trnList.push({
@ -708,7 +735,7 @@
})
})
}).catch(e=>{
console.log(e);
Toast(e.msg||e.message||e)
this.showLoading = false;
})
},
@ -717,11 +744,14 @@
},
loadMoreRight() {
//
console.log('右侧');
this.storeParam.page++;
this.getStoreList(true);
},
//
cartFn() {
getCartList().then(res => {
getCartList({
source: 103
}).then(res => {
this.totalMoney = 0
this.cartList = res.data.list
this.cartList.forEach(e => {
@ -731,14 +761,35 @@
})
this.totalMoney = this.totalMoney.toFixed(2)
})
getCartCounts().then(res => {
getCartCounts({
source: 103
}).then(res => {
this.goodsNum = res.data[0].count
})
},
//
clickProduct(data){
this.changeItem = data;
this.$refs.shortPopupRef.setDatas(data, this.goodsNum);
this.$refs.shortPopupRef.open();
},
//
showAllRef(){
this.$refs.allRef.open();
},
changeAllRef(e){
this.allShow = e.show;
},
//
navToSearch(){
uni.navigateTo({
url: `/pages/columnGoods/goods_search/index?back=${true}&searchVal=${this.storeParam.keyword}`,
success:()=> {
uni.$once('searchValue', (e)=>{
this.storeParam.keyword = e;
this.searchSubmit();
})
}
})
}
},
//
@ -748,32 +799,16 @@
onShow() {
this.showSelect = false
},
//
onReachBottom() {
this.storeParam.page += 1
let rqData = {
keyword: this.storeParam.keyword,
page: this.storeParam.page,
limit: 10,
order: this.storeParam.order,
category_id: this.storeParam.category_id,
type_id: this.storeParam.type_id,
street_id: this.storeParam.street_id,
credit_buy: this.credit_buy
//
onBackPress() {
if(this.$refs.shortPopupRef.isShow){
this.$refs.shortPopupRef.close();
return true;
} else if(this.allShow){
this.$refs.allRef.close();
return true;
}
if (this.latitude) {
rqData.location = this.latitude + ',' + this.longitude
}
// console.log(rqData)
getStoreList(rqData).then(res => {
console.log(res.data.list.length);
if (res.data.list.length < rqData.limit) {
this.status = "nomore"
}
this.count = res.data.count
this.storeList.push(...res.data.list)
})
else return false;
}
}
@ -788,6 +823,64 @@
page {
background-color: #f5f5f5;
}
.all_ref{
height: 100vh;
width: 510rpx;
background-color: #fff;
padding: 30rpx;
.header{
height: 100rpx;
font-size: 33rpx;
font-weight: bold;
display: flex;
align-items: center;
}
.all_list{
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
align-items: flex-start;
}
.menu_li {
display: flex;
flex-direction: column;
align-items: center;
width: 150rpx;
height: 150rpx;
overflow: hidden;
// width: 120rpx;
// display: inline-block;
.image {
border-radius: 50%;
border: 5rpx solid #fff;
}
.li_text {
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: center;
padding: 4rpx 10rpx;
}
}
.menu_li_on {
.image {
border: 5rpx solid #ff6d20;
border-radius: 50%;
}
.li_text {
background-color: #ff6d20;
border-radius: 2em;
color: #fff;
padding: 4rpx 10rpx;
}
}
}
.com_name {
font-size: 33.29rpx;
@ -833,17 +926,34 @@
.content {
flex: 1;
padding: 20rpx;
padding-top: 0;
padding: 0 20rpx 10rpx 20rpx;
}
.menu_cls {
background-color: white;
// background-color: white;
// height: 199.77rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
padding: 20rpx 20rpx 0 20rpx;
padding: 10rpx 70rpx 0 0;
font-size: 26.29rpx;
height: 220rpx;
height: 155rpx;
overflow: hidden;
position: relative;
.all{
position: absolute;
top: 0;
right: 0;
padding: 0 15rpx;
height: 100%;
display: flex;
justify-content: center;
flex-direction: column;
background-color: #f5f5f5;
image{
width: 30rpx;
height: 30rpx;
}
}
.menu_li {
margin-right: 20rpx;
@ -858,6 +968,7 @@
// width: 120rpx;
// display: inline-block;
.image {
border-radius: 50%;
border: 5rpx solid #fff;
}
@ -889,7 +1000,7 @@
.container {
display: flex;
height: calc(100vh - 400rpx - var(--status-bar-height));
height: calc(100vh - 320rpx - var(--status-bar-height));
.left-panel {
width: 180rpx;
@ -936,7 +1047,7 @@
background-color: #fff;
.right-panel-head {
height: 100rpx;
height: 70rpx;
box-sizing: border-box;
display: flex;
justify-content: space-between;
@ -946,11 +1057,18 @@
view {
display: flex;
align-items: center;
margin-left: 40rpx;
}
.active {
color: #333;
font-weight: bold;
}
.icon{
height: 22rpx;
width: 18rpx;
}
}
@ -962,8 +1080,8 @@
display: flex;
.image {
height: 175.23rpx;
width: 175.23rpx;
height: 145.23rpx;
width: 145.23rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin-right: 20rpx;
flex-shrink: 0;
@ -1128,7 +1246,7 @@
}
.hot_serch {
height: 20rpx;
height: 0rpx;
}
.productList .search .input {
@ -1624,7 +1742,7 @@
}
.sswz {
margin-top: 30rpx;
margin-top: 10rpx;
display: flex;
justify-content: space-between;
box-sizing: border-box;

View File

@ -7,21 +7,23 @@
<view class="head_tit">
<view class="" style="display: flex;align-items: center;width: 100%;">
<view class="" style="display: flex;align-items: center;width: 100%;justify-content: space-between;">
<!-- <u--image :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx"
height="50.82rpx" @click='backjJump'></u--image> -->
<i class="iconfont icon-xiangzuo" style="font-size: 31.54rpx;text-align: left;"
@click='backjJump'></i>
<view class=""
style="font-size: 31.54rpx;font-weight: 700;transform: skewX(-10deg);margin-left: 10rpx;color: #F84221;">
供销综合云市场
</view>
<view class=""
@click="navGoto(`/pages/nongKe/cloud_entrepot/indexb?street_id=${street_id}&townName=${street}&location=${latitude},${longitude}`)"
style="font-size: 31.54rpx;font-weight: 700;transform: skewX(-10deg);margin-left: 20rpx;">
供销综合云商品
</view>
<view style="flex: 1; display: flex;align-items: center;justify-content: right;margin-left: 20rpx;" @click="showPicker=!showPicker">
<view style="display: flex;align-items: center;">
<i class="iconfont icon-xiangzuo" style="font-size: 31.54rpx;text-align: left;"
@click='backjJump'></i>
<view class=""
style="font-size: 31.54rpx;font-weight: 700;margin-left: 10rpx;color: #F84221;">
供销综合云市场
</view>
<view class=""
@click="navGoto(`/pages/nongKe/cloud_entrepot/indexb?street_id=${street_id}&townName=${street}&location=${latitude},${longitude}`)"
style="font-size: 31.54rpx;font-weight: 700;margin-left: 20rpx;">
供销综合云商品
</view>
</view>
<view style="display: flex;align-items: center;justify-content: right;margin-left: 20rpx;" @click="showPicker=!showPicker">
<view class="town_name">{{street||'定位中'}}</view>
<u--image :showLoading="true" src="/static/images/GXSC/XL.png" width="33.29rpx"
height="33.29rpx"></u--image>
@ -46,8 +48,8 @@
</view> -->
</view>
<view class="sswz">
<view style="position: relative;width: 694rpx;margin: 0 auto;">
<view class="sswz" @click="navToSearch">
<view style="position: relative;width: 694rpx;margin: 0 auto;pointer-events:none">
<u-search borderColor="#FF6D20" bgColor="white" @change="test" :showAction="false"
placeholder="搜索店铺或者名称" v-model="storeParam.keyword" @search="onInputConfirm"
class="serch_cls"></u-search>
@ -111,47 +113,53 @@
<view class="goods_list">
<view class="goods_card" @click="goStore(item.mer_id)" v-for="(item,index) in storeList"
:key="index">
<view class="left">
<u--image :showLoading="true" :src="item.mer_avatar" width="157.71rpx"
height="157.71rpx"></u--image>
</view>
<view class="right">
<view class="li head">
<text class="com_name">{{item.mer_name}}</text>
<text v-if="item.type_id==17"
style="font-weight: normal;font-size: 19.28rpx;color: red;padding:0 10rpx; border-radius: 10rpx; border: 1px solid red;">{{item.type_name}}</text>
</view>
<view class="li" style="align-items: center;">
<view class="score">
<view class="star">
<view
:style="{width: `${(item.service_score / 5 * 100).toFixed(0)}%`, backgroundImage: `url(${domain}/static/diy/score1${keyColor}.png)`}">
</view>
</view>
</view>
<text style="margin-left: 20rpx;color: #FF6D20;font-size: 22.78rpx; ">{{item.service_score}}</text>
<text style="font-size: 24.53rpx;">月销{{item.sales}}</text>
<text v-if="item.distance" style="font-size: 21.03rpx;color: #aaa;">{{item.distance}}</text>
</view>
<view class="li" style="align-items: center;">
<u--image :showLoading="true" src="/static/images/GXSC/DH.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text> {{item.service_phone}}</text>
<u--image :showLoading="true" src="/static/images/address.png" width="33.85rpx"
height="33.85rpx"></u--image>
<view >{{item.street_name}}</view>
</view>
<view class="li" style="align-items: center;">
<u--image :showLoading="true" src="/static/images/GXSC/SJ.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text>{{item.mer_take_time[0]}}-{{item.mer_take_time[1]}}</text>
</view>
<view class="li" style="align-items: center;">
<u--image :showLoading="true" src="/static/images/GXSC/DW.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text class="address">{{item.mer_address}}</text>
</view>
</view>
<view class="head">
<view class="li head">
<view style="display: flex;align-items: center;flex: 1;">
<text class="com_name">{{item.mer_name}}</text>
<text v-if="item.type_id==17"
style="font-weight: normal;font-size: 19.28rpx;color: red;padding:0 10rpx; border-radius: 10rpx; border: 1px solid red;flex-shrink: 0;">{{item.type_name}}</text>
</view>
<view style="font-size: 24.53rpx;font-weight: 400;color: #7f7f7f;">月销{{item.sales}}</view>
</view>
</view>
<u-line></u-line>
<view class="flex" style="padding-top: 16rpx;">
<view class="left">
<u--image :showLoading="true" :src="item.mer_avatar" width="140.19rpx"
height="140.19rpx"></u--image>
<view class="left_text">
<image src="@/static/images/location.png"></image>
<view>{{item.street_name}}</view>
</view>
</view>
<view class="right">
<view class="li" style="align-items: center;">
<view class="score">
<view class="star">
<view
:style="{width: `${(item.service_score / 5 * 100).toFixed(0)}%`, backgroundImage: `url(${domain}/static/diy/score1${keyColor}.png)`}">
</view>
</view>
</view>
<text style="margin-left: 20rpx;color: #FF6D20;font-size: 22.78rpx; ">{{item.service_score}}</text>
<text v-if="item.distance" style="font-size: 21.03rpx;color: #aaa;">{{item.distance}}</text>
</view>
<view class="li" style="align-items: center;">
<u--image :showLoading="true" src="/static/images/GXSC/DH.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text> {{item.service_phone}}</text>
<u--image :showLoading="true" src="/static/images/GXSC/SJ.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text>{{item.mer_take_time[0]}}-{{item.mer_take_time[1]}}</text>
</view>
<view class="li" style="align-items: center;">
<u--image :showLoading="true" src="/static/images/GXSC/DW.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text class="address">{{item.mer_address}}</text>
</view>
</view>
</view>
</view>
@ -843,6 +851,17 @@
this.storeParam.category_id = this.merchant_category_id;
this.storeParam.page = 1;
this.storeMerchantList()
},
navToSearch(){
uni.navigateTo({
url: `/pages/columnGoods/goods_search/index?back=${true}&searchVal=${this.storeParam.keyword}`,
success:()=> {
uni.$once('searchValue', (e)=>{
this.storeParam.keyword = e;
this.searchSubmit();
})
}
})
}
},
//
@ -896,12 +915,11 @@
font-size: 33.29rpx;
// background-color: red;
// max-width: 45vw;
max-width: 40vw;
white-space: nowrap;
/* 防止文字换行 */
overflow: hidden;
/* 超出部分隐藏 */
text-overflow: ellipsis;
// white-space: nowrap;
// /* */
// overflow: hidden;
// /* */
// text-overflow: ellipsis;
/* 使用省略号表示溢出的内容 */
// width: 200px;
/* 可根据实际情况调整容器宽度 */
@ -1011,40 +1029,73 @@
background-color: white;
padding: 20rpx;
// border-radius: 20rpx;
display: flex;
// display: flex;
border-radius: 21rpx 21rpx 21rpx 21rpx;
// align-items: center;
.left {
margin-right: 20rpx;
width: 158rpx;
height: 158rpx;
border-radius: 20rpx;
overflow: hidden;
}
.right {
flex: 1;
color: #737373;
.head{
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
.head {
font-weight: bold;
// color: red;
color: #333;
}
}
.li {
.left {
margin-right: 20rpx;
width: 140.19rpx;
height: 140.19rpx;
border-radius: 20rpx;
overflow: hidden;
position: relative;
.left_text{
position: absolute;
bottom: 0;
left: 0;
background-color: rgba(#000, 0.5);
width: 100%;
display: flex;
font-size: 28.04rpx;
margin-bottom: 10rpx;
align-items: center;
text {
margin: 0 20rpx 0 5rpx;
}
}
font-size: 21rpx;
font-weight: 400;
color: #FFFFFF;
display: flex;
justify-content: center;
align-items: center;
image{
width: 21.03rpx;
height: 21.03rpx;
flex-shrink: 0;
}
view{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
.right {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-evenly;
color: #737373;
}
.li {
width: 100%;
display: flex;
font-size: 28.04rpx;
margin-bottom: 10rpx;
align-items: center;
text {
margin: 0 20rpx 0 5rpx;
}
}
}
}
@ -1596,7 +1647,7 @@
}
.sswz {
margin-top: 30rpx;
margin-top: 10rpx;
display: flex;
justify-content: space-between;
box-sizing: border-box;

BIN
static/images/icon/all.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/images/location.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B