云仓未登录查看
This commit is contained in:
parent
31763a09eb
commit
c0ce60f21d
8
api/requesta.js
Normal file
8
api/requesta.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import request from "@/utils/requesta.js";
|
||||||
|
|
||||||
|
export function getCityCloundShop(data) {
|
||||||
|
return request.get("city/get_cloud_shop", data);
|
||||||
|
}
|
||||||
|
export function cloudWarehouse(data) {
|
||||||
|
return request.get("store/product/cloudWarehouse", data);
|
||||||
|
}
|
@ -140,7 +140,7 @@
|
|||||||
this.$emit('change', e)
|
this.$emit('change', e)
|
||||||
this.street = e.value[1].name
|
this.street = e.value[1].name
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$bus.$emit('value-updated',e.value[1].name + ',' +e.value[1].code);
|
this.$bus.$emit('value-updated', e.value[1].name + ',' + e.value[1].code);
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
353
components/zbpSwiperb.vue
Normal file
353
components/zbpSwiperb.vue
Normal file
@ -0,0 +1,353 @@
|
|||||||
|
<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" style="padding-top: var(--status-bar-height)">
|
||||||
|
|
||||||
|
<view class="place_wrapper flex_a_c" @click="selectLocation">
|
||||||
|
<view class="iconfont icon-weizhi"></view>
|
||||||
|
<view class="town_name">{{street}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="" style="display: flex;">
|
||||||
|
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
|
||||||
|
<view class="iconfont icon-xiaoxi" style="color:#fff;margin-right: 20rpx;"></view>
|
||||||
|
</navigator>
|
||||||
|
<navigator url="/pages/columnGoods/goods_search/index" hover-class="none">
|
||||||
|
<view class="iconfont icon-sousuo" style="font-size: 39rpx;color: white;"></view>
|
||||||
|
</navigator>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</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" style="font-size: 39rpx;"></view>
|
||||||
|
<input type="text" v-model="keyword" placeholder="搜索产品或店铺" placeholder-style="font-size: 30rpx;"
|
||||||
|
disabled>
|
||||||
|
</view>
|
||||||
|
<button class="search_btn">搜索</button>
|
||||||
|
</navigator> -->
|
||||||
|
<!-- 轮播图 -->
|
||||||
|
<view class="supply_chains-head">
|
||||||
|
<swiper class="swiper " @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" @click="swiperClick(item)">
|
||||||
|
<!-- <u--image :showLoading="true" :src="item.img" width="750rpx" height="259rpx" mode="aspectFit">
|
||||||
|
</u--image> -->
|
||||||
|
<u--image :showLoading="true" :src="item.img" width="750rpx" height="600rpx">
|
||||||
|
</u--image>
|
||||||
|
</swiper-item>
|
||||||
|
</block>
|
||||||
|
</swiper>
|
||||||
|
</view>
|
||||||
|
<u-picker :defaultIndex="defaInd" :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'
|
||||||
|
import {
|
||||||
|
Toast
|
||||||
|
} from '../libs/uniApi';
|
||||||
|
import Cache from '@/utils/cache';
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
isSelectPlace: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
location_Arr: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
|
},
|
||||||
|
town: {
|
||||||
|
type: String,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
defaInd: [0, 0],
|
||||||
|
street: '',
|
||||||
|
|
||||||
|
showPicker: false,
|
||||||
|
styleConfig: [],
|
||||||
|
columnData: [],
|
||||||
|
homeCombData: [],
|
||||||
|
keyword: '',
|
||||||
|
bgColor: '',
|
||||||
|
swiper: {
|
||||||
|
url: [{
|
||||||
|
img: ''
|
||||||
|
}],
|
||||||
|
indicatorDots: true, // 显示面板指示点
|
||||||
|
vertical: false, // 滑动方向是否为纵向
|
||||||
|
autoplay: true, // 是否自动切换
|
||||||
|
interval: 2000, // 自动切换时间间隔
|
||||||
|
duration: 400 // 滑动动画时长
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
street(nval, val) {
|
||||||
|
this.street = nval
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
|
||||||
|
this.getBanner()
|
||||||
|
this.Area()
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.$bus.$on('value-updated', (newValue) => {
|
||||||
|
// 更新组件的值
|
||||||
|
this.street = newValue.split(',')[0]
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
swiperClick(item) {
|
||||||
|
const url = item.info[1].value
|
||||||
|
uni.navigateTo({
|
||||||
|
url: url
|
||||||
|
})
|
||||||
|
},
|
||||||
|
selectLocation() {
|
||||||
|
this.isSelectPlace ? this.showPicker = true : ''
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
confirm(e) {
|
||||||
|
|
||||||
|
this.showPicker = false
|
||||||
|
this.$emit('selectPlce', e)
|
||||||
|
this.$emit('change', e)
|
||||||
|
this.street = e.value[1].name
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$bus.$emit('value-updated', e.value[1].name + ',' + e.value[1].code);
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
changeHandler(e) {
|
||||||
|
const {
|
||||||
|
columnIndex,
|
||||||
|
value,
|
||||||
|
values,
|
||||||
|
index,
|
||||||
|
picker = this.$refs.uPicker
|
||||||
|
} = e;
|
||||||
|
if (columnIndex === 0) {
|
||||||
|
getStreet({
|
||||||
|
area_code: value[0]['code']
|
||||||
|
}).then(res => {
|
||||||
|
picker.setColumnValues(1, res.data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Area() {
|
||||||
|
getArea({
|
||||||
|
city_code: 510500
|
||||||
|
}).then(res => {
|
||||||
|
this.$refs.uPicker.setColumnValues(0, res.data);
|
||||||
|
this.Street(res.data[0]['code']);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
Street(code) {
|
||||||
|
getStreet({
|
||||||
|
area_code: code
|
||||||
|
}).then(res => {
|
||||||
|
this.$refs.uPicker.setColumnValues(1, res.data);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
swiperChange(e) {
|
||||||
|
let {
|
||||||
|
current,
|
||||||
|
source
|
||||||
|
} = e.detail;
|
||||||
|
if (source === 'autoplay' || source === 'touch') {
|
||||||
|
this.bgColor = this.swiper.url[e.detail.current]['img']
|
||||||
|
this.$emit('kkchange', this.bgColor)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 对象转数组
|
||||||
|
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" scoped>
|
||||||
|
.zbp-head-wrapper {
|
||||||
|
position: relative;
|
||||||
|
// padding-top: 78.95rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
// background-color: green;
|
||||||
|
height: 600rpx;
|
||||||
|
|
||||||
|
// .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: 750rpx;
|
||||||
|
height: 66.67rpx;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
// margin-bottom: 26.32rpx;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 9999;
|
||||||
|
padding-right: 20rpx;
|
||||||
|
|
||||||
|
|
||||||
|
// 位置
|
||||||
|
.place_wrapper {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
color: #fff;
|
||||||
|
margin-right: 24.56rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
|
||||||
|
.town_name {
|
||||||
|
margin-left: 21rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
font-size: 35.09rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-main {
|
||||||
|
transition: background-color .5s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search_content {
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 724rpx;
|
||||||
|
height: 74rpx;
|
||||||
|
padding: 2px 2px 2px 21.05rpx;
|
||||||
|
border-radius: 175rpx;
|
||||||
|
background: #fff;
|
||||||
|
margin-bottom: 21rpx;
|
||||||
|
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: 750rpx;
|
||||||
|
height: 600rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
// border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.swi_item {
|
||||||
|
width: 750rpx;
|
||||||
|
height: 600rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -177,7 +177,6 @@
|
|||||||
height="400.09rpx"></u--image>
|
height="400.09rpx"></u--image>
|
||||||
<view class="" style="text-align: center;">
|
<view class="" style="text-align: center;">
|
||||||
暂无商品
|
暂无商品
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -244,17 +243,19 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="empty" style="" v-else>
|
<view class="empty" style="" v-else>
|
||||||
<view style="height: var(--status-bar-height);"></view>
|
<view style="height: var(--status-bar-height);"></view>
|
||||||
|
<view style="padding: 10rpx;">
|
||||||
|
<u--image :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx" height="50.82rpx"
|
||||||
|
@click='goBack'></u--image>
|
||||||
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
|
|
||||||
<u--image :showLoading="true" src="/static/images/noCart.png" width="400.09rpx"
|
<u--image :showLoading="true" src="/static/images/noCart.png" width="400.09rpx"
|
||||||
height="400.09rpx"></u--image>
|
height="400.09rpx"></u--image>
|
||||||
<view class="" style="text-align: center;">
|
<view class="" style="text-align: center;">
|
||||||
暂无商家
|
当前区域暂无云仓
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="" :style="`height:${appInfo.bottom}px;background-color:white`">
|
<view class="" :style="`height:${appInfo.bottom}px;background-color:white`">
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -266,7 +267,7 @@
|
|||||||
import {
|
import {
|
||||||
cloudWarehouse,
|
cloudWarehouse,
|
||||||
getCityCloundShop
|
getCityCloundShop
|
||||||
} from '@/api/api.js'
|
} from '@/api/requesta.js'
|
||||||
import {
|
import {
|
||||||
Toast
|
Toast
|
||||||
} from '@/libs/uniApi';
|
} from '@/libs/uniApi';
|
||||||
@ -335,7 +336,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.cartFn()
|
// this.cartFn()
|
||||||
this.appInfo = this.$appInfo.safeAreaInsets
|
this.appInfo = this.$appInfo.safeAreaInsets
|
||||||
this.winHeight = this.$appInfo.windowHeight
|
this.winHeight = this.$appInfo.windowHeight
|
||||||
this.street_code = e.street
|
this.street_code = e.street
|
||||||
@ -344,7 +345,7 @@
|
|||||||
// console.log(this.appInfo, "手机信息")
|
// console.log(this.appInfo, "手机信息")
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.cartFn()
|
// this.cartFn()
|
||||||
},
|
},
|
||||||
// 分页
|
// 分页
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
|
76
utils/requesta.js
Normal file
76
utils/requesta.js
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
import {
|
||||||
|
HTTP_REQUEST_URL,
|
||||||
|
HEADER,
|
||||||
|
TOKENNAME
|
||||||
|
} from '@/config/app';
|
||||||
|
import {
|
||||||
|
checkLogin
|
||||||
|
} from '../libs/login';
|
||||||
|
import store from '../store';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送请求
|
||||||
|
*/
|
||||||
|
function baseRequest(url, method, data, {
|
||||||
|
noAuth = false,
|
||||||
|
noVerify = false
|
||||||
|
}) {
|
||||||
|
let Url = HTTP_REQUEST_URL,
|
||||||
|
header = HEADER;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token;
|
||||||
|
|
||||||
|
return new Promise((reslove, reject) => {
|
||||||
|
uni.request({
|
||||||
|
url: Url + '/api/' + url,
|
||||||
|
method: method || 'GET',
|
||||||
|
header: header,
|
||||||
|
data: data || {},
|
||||||
|
success: (res) => {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
// console.log('app', Url + '/api/' + url, res.data);
|
||||||
|
// #endif
|
||||||
|
if (noVerify)
|
||||||
|
reslove(res.data, res);
|
||||||
|
else if (res.data.status == 200)
|
||||||
|
reslove(res.data, res);
|
||||||
|
else if ([410000, 410001, 410002, 40000].indexOf(res.data.status) !== -1) {
|
||||||
|
|
||||||
|
reject(res.data);
|
||||||
|
} else if (res.data.status == 501) {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/error/index'
|
||||||
|
})
|
||||||
|
reject(res.data);
|
||||||
|
} else
|
||||||
|
reject(res.data.message || '系统错误');
|
||||||
|
},
|
||||||
|
fail: (message) => {
|
||||||
|
reject('请求失败');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const request = {};
|
||||||
|
|
||||||
|
['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach((method) => {
|
||||||
|
request[method] = (api, data, opt) => baseRequest(api, method, data, opt || {})
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export default request;
|
Loading…
x
Reference in New Issue
Block a user