Commit 75a36aea authored by 燕南天's avatar 燕南天

串接口,一系列操作

parent 89ac8db1
...@@ -51,7 +51,7 @@ module.exports = { ...@@ -51,7 +51,7 @@ module.exports = {
// Paths // Paths
assetsRoot: path.resolve(__dirname, '../dist'), assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static', assetsSubDirectory: 'static',
assetsPublicPath: '/', assetsPublicPath: './',
/** /**
* Source Maps * Source Maps
......
...@@ -17,6 +17,7 @@ export default { ...@@ -17,6 +17,7 @@ export default {
padding: 0; padding: 0;
margin: 0; margin: 0;
// font-size: 24/@r; // font-size: 24/@r;
box-sizing: border-box;
} }
body,html { body,html {
font-family:'微软雅黑'; font-family:'微软雅黑';
......
...@@ -8,20 +8,33 @@ export function getAdvertList() { ...@@ -8,20 +8,33 @@ export function getAdvertList() {
}) })
} }
export function getStoreList() { export function getStoreList(data) {
return request({ return request({
url: 'h5/index/getStoreList', url: 'h5/index/getStoreList',
method: 'post' method: 'post',
data:qs.stringify(data)
}) })
} }
export function getWorkerList() { export function getWorkerList(data) {
return request({ return request({
url: '/h5/index/getWorkerList', url: '/h5/index/getWorkerList',
method: 'post',
data:qs.stringify(data)
})
}
export function getCitys() {
return request({
url: 'pca/getCitys',
method: 'post' method: 'post'
}) })
} }
const host = "http://192.168.1.100:8080/store-system" const host = " http://47.105.32.6:8990/storeSystem"
export default host export default host
\ No newline at end of file
...@@ -13,7 +13,6 @@ service.interceptors.request.use(config => { ...@@ -13,7 +13,6 @@ service.interceptors.request.use(config => {
return config return config
}, error => { }, error => {
alert('请求拦截,出现错误了')
}) })
// respone interceptor // respone interceptor
...@@ -21,8 +20,7 @@ service.interceptors.response.use( ...@@ -21,8 +20,7 @@ service.interceptors.response.use(
response => response.data, response => response.data,
error => { error => {
alert('响应拦截出现错误了')
}) })
export default service export default service
import request from './request'
import qs from 'qs'
export function storeDetails(data) {
return request({
url: '/h5/shop/storeDetails',
method: 'post',
data:qs.stringify(data)
})
}
export function searchWorkerResult(data) {
return request({
url: '/h5/index/searchWorkerResult',
method: 'post',
data:qs.stringify(data)
})
}
import request from './request'
import qs from 'qs'
export function workerDetails(data) {
return request({
url: '/h5/worker/workerDetails',
method: 'post',
data:qs.stringify(data)
})
}
<template> <template>
<div class="header"> <div class="header" :class="{'seach-header':seach}">
<span v-if="!noBack" class="back" @click="bankFun">返回</span> <span v-if="!noBack" class="back" @click="bankFun">返回</span>
{{title}} <span v-if="!seach">{{title}}</span>
<div class="seach-wrapper" v-if="seach">
<input class="seach-input" type="text" placeholder="请输入关键字" v-model="storeName" @keyup.enter="handleSeach">
<span class="select-wrapper" @click='handleShowSheet'>{{cityItem.name}}</span>
<div class="city-bg" :class="{active:showSheet}" @click="handleCancle"></div>
<div class="choose-city" :class="{active:showSheet}">
<div class="choose-header">
<span class="choose-btn cancle" @click="handleCancle">取消</span>
<span>请选择地址</span>
<span class="choose-btn confirm" @click="handleConfirm">确定</span>
</div>
<div class="radio" v-for="(item,idx) in seach" :key="idx">
<input :id="item.codeC" name='chooseCity' type="radio" :value="item" v-model="cityItem">
<label :for="item.codeC"><span>{{item.name}}</span></label>
</div>
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
import {searchShopResult} from "../../api/shopList"
export default { export default {
props:['title','noBack'], props: ["title", "noBack", "seach"],
methods:{ data(){
bankFun(){ return {
this.$router.go(-1) storeName:'',
showSheet:false,
cityItem:{
name:'西安',codeC:'610100'
} }
}
},
beforeMount(){
let obj = {name:'西安',codeC:'610100'}
const cityItem = localStorage.getItem('cityItem')
this.cityItem = cityItem?JSON.parse(cityItem):obj
},
methods: {
bankFun() {
this.$router.go(-1);
},
handleShowSheet(){
this.showSheet = !this.showSheet;
},
handleCancle(){
this.showSheet = !this.showSheet;
},
handleConfirm(){
const cityItem = this.cityItem
localStorage.setItem('cityItem',JSON.stringify(cityItem))
this.$emit('emitChangeCity')
},
handleSeach(){
const name = this.storeName
this.$router.push({
path:'shopList',
query:{storeName:name}
})
// searchShopResult({storeName:this.storeName}).then(res=>{
// })
} }
} }
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@r:100rem; @r: 100rem;
.header{ .header {
font-size: 36/@r; font-size: 36 / @r;
line-height:90/@r; line-height: 90 / @r;
text-align: center; text-align: center;
border-bottom: solid 1px #dedede; border-bottom: solid 1px #dedede;
position: fixed;
width: 100%;
left: 0;
top: 0;
z-index: 10000;
background: #de4b4b;
color: #fff;
.back {
cursor: pointer;
position: absolute;
left: 30 / @r;
font-size: 28/@r;
}
&.seach-header {
background: none;
border: none;
text-align: left;
line-height: 90 / @r;
.seach-wrapper {
background: rgba(255,255,255,.6);
padding: 0 30 / @r;
border-radius: 60 / @r;
display: flex;
justify-content: space-between;
margin-top: 20/@r;
box-shadow: 2px 2px 2px rgba(0,0,0,.2)
}
input.seach-input {
width: 500/@r;
background: none;
border: none;
border: solid 1px #dedede;
height: 60 / @r;
border-radius: 60 / @r;
padding-left: 30 / @r;
outline: none;
position: relative;
top: 14/@r;
}
.select-wrapper{
right: 0/@r;
top: 0/@r;
background: none;
border: none;
outline: none;
font-size: 24/@r;
color: #de4b4b;
font-weight: 700;
}
.city-bg{
position: fixed; position: fixed;
width: 100%; width: 100%;
height: 100%;
left: 0; left: 0;
top: 0; top: 0;
z-index: 10000; background: rgba(0,0,0,.5);
display: none;
&.active{
display: block;
}
}
.choose-city{
position: fixed;
width: 100%;
left: 0;
background: #fff; background: #fff;
.back{ max-height: 400/@r;
cursor: pointer; overflow-y: auto;
position: absolute; opacity: 0;
left: 30/@r; bottom: -400/@r;
transition: all .3s;
&.active{
opacity: 1;
bottom: 0;
.choose-header{
opacity: 1;
bottom: 400/@r;
}
}
.choose-header{
position: fixed;
width: 100%;
height: 80/@r;
line-height: 80/@r;
left: 0;
bottom: 400/@r;
background: #de4b4b;
color: #fff;
font-size: 28/@r;
text-align: center;
opacity: 0;
bottom:-80/@r;
transition: all .3s;
.cancle,
.confirm{
position: absolute;
}
.cancle{
left: 0;
padding-left: 20/@r;
}
.confirm{
right: 0;
padding-right: 20/@r;
}
} }
// 自定义多选框的样式
label {
margin: 0;
cursor: pointer;
font-size: 28 / @r;
color: #555;
position: relative;
span {
font-size: 28 / @r;
color: #999;
display: inline-block;
width: 100%;
height: 80/@r;
text-align: center;
line-height: 80 / @r;
position: absolute;
left: 0;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Chrome/Safari/Opera */
-khtml-user-select: none; /* Konqueror */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
not supported by any browser */
}
}
input:focus {
outline: none;
}
input[type="radio"] + label::before,
input[type="checkbox"] + label::before {
margin: 0;
content: "\a0"; /*不换行空格*/
display: inline-block;
width: 100%;
background: #fafafa;
}
input[type="radio"]:checked + label::before,
input[type="checkbox"]:checked + label::before {
margin: 0;
content: "\a0";
background: #de4b4b;
}
input[type="radio"]:checked + label,
input[type="checkbox"]:checked + label {
span {
color: #fff;
}
}
input[type="radio"],
input[type="checkbox"] {
position: absolute;
clip: rect(0, 0, 0, 0);
outline: none;
}
} }
}
}
</style> </style>
......
<template>
<div class="nodata">
<div class="img">
<img :src="require('../../assets/images/nodata.png')" alt="">
</div>
<div class="text">暂无数据</div>
</div>
</template>
<style lang="less" scoped>
@r:100rem;
.nodata{
padding: 20/@r 0;
.img{
width: 300/@r;
margin: 0 auto;
img{
width: 100%;
}
}
.text{
text-align: center;
font-size: 30/@r;
color: #999;
}
}
</style>
...@@ -5,6 +5,8 @@ import Home from '@/views/home/index.vue' ...@@ -5,6 +5,8 @@ import Home from '@/views/home/index.vue'
import ShopList from '@/views/shopList/index.vue' import ShopList from '@/views/shopList/index.vue'
import WorkerList from '@/views/workerList/index.vue' import WorkerList from '@/views/workerList/index.vue'
import ShopDetails from '@/views/shopDetails/index.vue' import ShopDetails from '@/views/shopDetails/index.vue'
import WorkerDetails from '@/views/workerDetails/index.vue'
import WebView from '@/views/webView/index.vue' import WebView from '@/views/webView/index.vue'
...@@ -14,6 +16,10 @@ export default new Router({ ...@@ -14,6 +16,10 @@ export default new Router({
routes: [ routes: [
{ {
path: '/', path: '/',
redirect:'index'
},
{
path: '/index',
name: 'index', name: 'index',
component: Home component: Home
}, },
...@@ -28,11 +34,16 @@ export default new Router({ ...@@ -28,11 +34,16 @@ export default new Router({
component: WorkerList component: WorkerList
}, },
{ {
path: '/shopDetails', path: '/shopDetails/:id',
name: 'shopDetails', name: 'shopDetails',
component: ShopDetails component: ShopDetails
}, },
{ {
path: '/workerDetails/:id',
name: 'workerDetails',
component: WorkerDetails
},
{
path: '/webView', path: '/webView',
name: 'webView', name: 'webView',
component: WebView component: WebView
......
<template> <template>
<swiper :options="swiperOption"> <swiper :options="swiperOption">
<swiper-slide v-for="(item,index) in data" :key="index"> <swiper-slide v-for="(item,index) in data" :key="index">
<img :src="item.advertPicUrl" :alt="item.advertPicUrl" @click="toWebview(item)"> <div class="img" :style="{'background-image':`url(${item.advertPicUrl})`}" @click="toWebview(item)"></div>
</swiper-slide> </swiper-slide>
<div class="swiper-pagination swiper-pagination-bullets" slot="pagination"></div> <div class="swiper-pagination swiper-pagination-bullets" slot="pagination"></div>
...@@ -50,11 +50,12 @@ export default { ...@@ -50,11 +50,12 @@ export default {
} }
.swiper-slide { .swiper-slide {
height: 410 / @r; height: 410 / @r;
img { .img {
display: block;
width: 100%; width: 100%;
height: 100%; height: 100%;
background: #dedede; background-color: #dedede;
background-size:cover;
background-position:center center;
} }
} }
</style> </style>
......
...@@ -27,13 +27,13 @@ export default { ...@@ -27,13 +27,13 @@ export default {
padding:0 20/@r; padding:0 20/@r;
margin: 20/@r 0; margin: 20/@r 0;
line-height: 90/@r; line-height: 90/@r;
background: #dedede; background: #de4b4b;
.name{ .name{
font-size: 36/@r; font-size: 36/@r;
color: #333; color: #fff;
} }
.btn{ .btn{
color: #666; color: #fff;
font-size: 28/@r; font-size: 28/@r;
cursor: pointer; cursor: pointer;
} }
......
<template> <template>
<div class="shop-list-wrapper">
<div class="list-item"> <div class="list-item">
<div class="img"> <div class="img" :style="{'background-image':`url(${data.storeHomePic})`}"></div>
<img :src="data.storeHomePic" alt="">
</div>
<div class="item-infro"> <div class="item-infro">
<div class="name" >{{data.storeName}}</div> <div class="name" >{{data.storeName}}</div>
<div class="details">{{data.brief}}</div>
<div class="details">{{data.storePosition}}</div> <div class="details">{{data.storePosition}}</div>
</div> </div>
</div> </div>
</div>
</template> </template>
...@@ -37,7 +35,9 @@ export default { ...@@ -37,7 +35,9 @@ export default {
.img{ .img{
width: 120/@r; width: 120/@r;
height: 120/@r; height: 120/@r;
background: #dedede; background-color: #dedede;
background-size:cover;
background-position:center center;
} }
.item-infro{ .item-infro{
width: 540/@r; width: 540/@r;
......
<template> <template>
<div class="staff-item"> <div class="staff-item">
<img :src="data.workerHomePic" alt=""> <div class="img" :style="{'background-image':`url(${data.workerHomePic})`}"></div>
<div class="infro">{{data.workerName}}</div> <div class="infro">{{data.workerName}}:{{data.brief}}</div>
</div> </div>
</template> </template>
...@@ -22,23 +22,32 @@ export default { ...@@ -22,23 +22,32 @@ export default {
position: relative; position: relative;
margin-bottom: 15/@r; margin-bottom: 15/@r;
margin-left: 15/@r; margin-left: 15/@r;
box-shadow: 2px 2px 2px rgba(0,0,0,.2);
&:nth-child(3n+1){ &:nth-child(3n+1){
margin-left: 0; margin-left: 0;
} }
img{ .img{
display: block;
background: #dedede; background: #dedede;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #dedede;
background-size:cover;
background-position:center center;
} }
.infro{ .infro{
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 80/@r; // height: 80/@r;
left: 0; left: 0;
bottom: 0; bottom: 0;
font-size: 28/@r; font-size: 24/@r;
background: rgba(0, 0, 0, .5); background: rgba(0, 0, 0, .5);
color: #fff;
padding: 10/@r;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
} }
} }
</style> </style>
......
<template> <template>
<div class="page-wrapper"> <div class="">
<c-header title="首页" noBack="1"></c-header> <c-header ref="chanceCity" title="首页" noBack="1" :seach='citySelectData' @emitChangeCity='changeCityGetPgeData'></c-header>
<h-banner :data="bannerData"></h-banner> <h-banner :data="bannerData"></h-banner>
<h-item-title title="精选商家" href="/shopList"></h-item-title> <h-item-title title="精选商家" href="/shopList"></h-item-title>
<h-shop-list v-for="(item,index) in shopListData" :key="index" @click.native="toShopDetails(item.storeId)" :data="item"></h-shop-list> <div class="shop-list-wrapper" v-if="shopListData">
<h-shop-list v-for="(item,index) in shopListData" :key="index" @click.native="toShopDetails(item.storeId)" :data="item"></h-shop-list>
</div>
<no-data v-else></no-data>
<h-item-title title="闪亮之星" href="/workerList"></h-item-title> <h-item-title title="闪亮之星" href="/workerList"></h-item-title>
<div class="staff-wrapper"> <div class="staff-wrapper" v-if="staffData">
<h-staff v-for="(item,index) in staffData" :key="index" @click.native="toDetails(item.workerId)" :data="item"></h-staff> <h-staff v-for="(item,index) in staffData" :key="index" @click.native="toDetails(item.workerId)" :data="item"></h-staff>
</div> </div>
<no-data v-else></no-data>
</div> </div>
</template> </template>
<script> <script>
import CHeader from "@/components/CHeader"; import CHeader from "@/components/CHeader";
import NoData from "@/components/noData";
import HBanner from "./components/HBanner"; import HBanner from "./components/HBanner";
import HShopList from "./components/HShopList"; import HShopList from "./components/HShopList";
import HItemTitle from "./components/HItemTitle"; import HItemTitle from "./components/HItemTitle";
...@@ -25,14 +31,17 @@ import * as home from "../../api/home"; ...@@ -25,14 +31,17 @@ import * as home from "../../api/home";
import axios from "axios"; import axios from "axios";
export default { export default {
components: { CHeader, HBanner, HShopList, HItemTitle, HStaff }, components: { CHeader, HBanner, HShopList, HItemTitle, HStaff, NoData},
data() { data() {
return { return {
bannerData: [], bannerData: [],
shopListData: [], shopListData: [],
staffData: [] staffData: [],
citySelectData:null
}; };
}, },
...@@ -43,14 +52,18 @@ export default { ...@@ -43,14 +52,18 @@ export default {
methods: { methods: {
toShopDetails(id) { toShopDetails(id) {
this.$router.push({ name: "shopDetails", params: { id: id } }); this.$router.push({ path:`/shopDetails/${id}`})
}, },
toDetails(id) { toDetails(id) {
alert(id); this.$router.push({ path:`/workerDetails/${id}`})
}, },
getPageData(cb) { getPageData(cb) {
const cityItem = localStorage.getItem('cityItem')
let code = cityItem?JSON.parse(cityItem).codeC:'610100'
const getAdvertList = () => { const getAdvertList = () => {
home.getAdvertList().then(res => { home.getAdvertList().then(res => {
this.bannerData = res.data; this.bannerData = res.data;
...@@ -58,21 +71,51 @@ export default { ...@@ -58,21 +71,51 @@ export default {
}; };
const getStoreList = () => { const getStoreList = () => {
home.getStoreList().then(res => { home.getStoreList({cityId:code}).then(res => {
this.shopListData = res.data; this.shopListData = res.data;
}); });
}; };
const getWorkerList = () => { const getWorkerList = () => {
home.getWorkerList().then(res => { home.getWorkerList({}).then(res => {
this.staffData = res.data; this.staffData = res.data;
}); });
}; };
axios.all([getAdvertList(), getStoreList(),getWorkerList()]).then((s, f) => { const getCitys = () => {
home.getCitys().then(res => {
this.citySelectData = res.data;
});
};
axios.all([getAdvertList(), getStoreList(),getWorkerList(),getCitys()]).then((s, f) => {
cb ? cb() : ""; cb ? cb() : "";
}); });
},
changeCityGetPgeData(){
const cityItem = localStorage.getItem('cityItem')
let code = cityItem?JSON.parse(cityItem).codeC:'610100'
const getStoreList = () => {
home.getStoreList({cityId:code}).then(res => {
this.shopListData = res.data;
});
};
// const getWorkerList = () => {
// home.getWorkerList({cityId:code}).then(res => {
// this.staffData = res.data;
// });
// };
axios.all([getStoreList()]).then((s, f) => {
this.$refs.chanceCity.handleCancle()
});
} }
} }
}; };
</script> </script>
......
...@@ -38,6 +38,8 @@ export default { ...@@ -38,6 +38,8 @@ export default {
border-radius: 10/@r; border-radius: 10/@r;
background: #f0f0f0; background: #f0f0f0;
padding: 20/@r; padding: 20/@r;
font-size: 32/@r!important;
color: #666;
} }
} }
</style> </style>
......
...@@ -2,28 +2,24 @@ ...@@ -2,28 +2,24 @@
<div class="page-wrapper"> <div class="page-wrapper">
<c-header title="商家详情"></c-header> <c-header title="商家详情"></c-header>
<div class="shop-main-infro"> <div class="shop-main-infro">
<div class="shop-name">商家名称{{id}}</div> <div class="shop-name">{{shopData.storeName}}</div>
<div class="address">西安市雁塔区110号,欢迎您的光临</div> <div class="brief">{{shopData.brief}}</div>
<div class="address">{{shopData.province}} {{shopData.cityName}} {{shopData.county}} {{shopData.storePosition}}</div>
</div> </div>
<s-infro-content title="商家详情" :data="shopDetailsData" type='1'></s-infro-content> <s-infro-content title="商家详情" :data="shopData.storeDetails" type='1'></s-infro-content>
<s-infro-content title="在线员工" type='2'> <s-infro-content title="在线员工" type='2'>
<div class="employee-wrapper"> <div class="employee-wrapper" v-if="workerData">
<div class="employee-item">
<div class="img"></div>
<div class="infro">个人简介:我是水水,漂亮贤惠,温柔大方,快来找我吧!我喜欢听音乐,打篮球,交朋友</div>
</div>
<div class="employee-item">
<div class="img"></div>
<div class="infro">个人简介:我是水水,漂亮贤惠,温柔大方,快来找我吧!我喜欢听音乐,打篮球,交朋友</div>
</div>
<div class="employee-item"> <div class="employee-item" v-for="(item,idx) in workerData" :key="idx" @click="toWorkerDetails(item.workerId)">
<div class="img"></div> <div class="img" :style="{'background-image':`url(${item.workerHomePic})`}"></div>
<div class="infro">个人简介:我是水水,漂亮贤惠,温柔大方,快来找我吧!我喜欢听音乐,打篮球,交朋友</div> <div class="infro">个人简介:{{item.brief}}</div>
</div> </div>
</div>
<div class="nodata-wrapper" v-else>
<no-data></no-data>
</div> </div>
</s-infro-content> </s-infro-content>
...@@ -32,18 +28,42 @@ ...@@ -32,18 +28,42 @@
</template> </template>
<script> <script>
import CHeader from '@/components/CHeader' import CHeader from '@/components/CHeader'
import NoData from '@/components/noData'
import SInfroContent from './components/SInfroContent' import SInfroContent from './components/SInfroContent'
import * as shopDetails from "../../api/shopDetails"
export default { export default {
components:{CHeader,SInfroContent}, components:{CHeader,SInfroContent,NoData},
data(){ data(){
return { return {
id:'', shopData:{
shopDetailsData:"<p style='font-size:14px;color:#666'>试试是这个对不对</p>" storeName:'',
province:'',
cityName:'',
county:'',
storePosition:'',
storeDetails:''
},
workerData:[]
} }
}, },
beforeMount(){ beforeMount(){
const id = this.$route.params.id const id = this.$route.params.id
this.id = id; this.getPageData(id)
},
methods:{
getPageData(id){
const param = {storeId:id}
shopDetails.storeDetails(param).then(res=>{
this.shopData = res.data
shopDetails.searchWorkerResult(param).then(res=>{
this.workerData = res.data
})
})
},
toWorkerDetails(id){
this.$router.push({ path:`/workerDetails/${id}`})
}
} }
} }
</script> </script>
...@@ -55,7 +75,13 @@ export default { ...@@ -55,7 +75,13 @@ export default {
.shop-name{ .shop-name{
font-size: 40/@r; font-size: 40/@r;
color: #333; color: #333;
} font-weight: 700
}
.brief{
font-size: 32/@r;
color: #666;
margin-top: 10/@r;
}
.address{ .address{
font-size: 24/@r; font-size: 24/@r;
color: #666; color: #666;
...@@ -76,7 +102,10 @@ export default { ...@@ -76,7 +102,10 @@ export default {
margin-bottom: 30/@r; margin-bottom: 30/@r;
.img{ .img{
height: 250/@r; height: 250/@r;
background: #ca0c16 ; background: rgba(222,75,75,.5) ;
background-color: #dedede;
background-size:cover;
background-position:center center;
} }
.infro{ .infro{
...@@ -92,5 +121,9 @@ export default { ...@@ -92,5 +121,9 @@ export default {
} }
} }
.nodata-wrapper{
margin-top: 150/@r;
}
</style> </style>
...@@ -14,19 +14,14 @@ ...@@ -14,19 +14,14 @@
<div class="choose-item"> <div class="choose-item">
<div class="title">地址选择</div> <div class="title">地址选择</div>
<div class="item-content"> <div class="item-content">
<div class="select-wrapper">
<label>市区:</label>
<select v-model="CID" @change="chooseCityFun">
<option v-for="(item,idx) in CData" :key="idx" :value="item.codeC">{{item.name}}</option>
</select>
</div>
<div class="select-wrapper"> <div class="select-wrapper">
<label>县区:</label> <label>县区:</label>
<select v-model="AID"> <select v-model="AID">
<option v-for="(item,idx) in AData" :key="idx" :value="item.codeA">{{item.name}}</option> <option v-for="(item,idx) in AData" :key="idx" :value="item.codeA">{{item.name}}</option>
</select> </select>
</div> </div>
</div> </div>
</div> </div>
...@@ -70,9 +65,7 @@ export default { ...@@ -70,9 +65,7 @@ export default {
data() { data() {
return { return {
show: false, show: false,
CData: [],
CID: "",
AData: [], AData: [],
AID: "", AID: "",
...@@ -85,14 +78,14 @@ export default { ...@@ -85,14 +78,14 @@ export default {
}, },
methods: { methods: {
taggleModelFun() { taggleModelFun() {
this.getChooseData(() => { const cityItem = localStorage.getItem('cityItem')
let code = cityItem?JSON.parse(cityItem).codeC:'610100'
this.getChooseData(code,() => {
this.show = !this.show; this.show = !this.show;
}); });
}, },
handleCancle() { handleCancle() {
this.CData = [];
this.CID = "";
this.AData = []; this.AData = [];
this.AID = ""; this.AID = "";
this.priceData = []; this.priceData = [];
...@@ -103,28 +96,21 @@ export default { ...@@ -103,28 +96,21 @@ export default {
}, },
// 获取选择数据 // 获取选择数据
getChooseData(cb) { getChooseData(code,cb) {
this.getCData(() => { this.chooseCityFun(code,()=>{
this.getPriceData(() => { this.getPriceData(() => {
cb ? cb() : ""; cb ? cb() : "";
}); });
}); })
}, },
// 获取市区下拉数据
getCData(cb) {
this.AData = [];
this.AID = "";
getCityList({ codeP: "610000" }).then(res => {
this.CData = res.data;
cb ? cb() : "";
});
},
chooseCityFun() { chooseCityFun(code,cb) {
getAreaList({ codeC: this.CID }).then(res => { getAreaList({ codeC: code }).then(res => {
this.AData = res.data; this.AData = res.data;
cb ? cb() : "";
}); });
}, },
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div class="item-infro"> <div class="item-infro">
<div class="title">{{data.storeName}}</div> <div class="title">{{data.storeName}}</div>
<div class="infro">{{data.storePosition}}</div> <div class="infro">{{data.storePosition}}</div>
<div class="adress">管理员:{{data.administratorsName}}</div> <div class="adress">{{data.brief}}</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -24,6 +24,7 @@ export default { ...@@ -24,6 +24,7 @@ export default {
display: flex; display: flex;
box-sizing: border-box; box-sizing: border-box;
padding: 30/@r; padding: 30/@r;
.img { .img {
width: 160 / @r; width: 160 / @r;
height: 160 / @r; height: 160 / @r;
......
<template> <template>
<div class="page-wrapper"> <div class="page-wrapper">
<c-header title="商家列表"></c-header> <c-header title="商家列表"></c-header>
<s-item v-for="(item,index) in shopListData" :key="index" :data="item" @click.native="toDetails(item.id)"></s-item>
<div v-if="shopListData">
<s-item v-for="(item,index) in shopListData" :key="index" :data="item" @click.native="toDetails(item.storeId)"></s-item>
</div>
<div class="nodata-wrapper" v-else>
<no-data></no-data>
</div>
<more-shop ref="chooseMore" @emitSuccess="handleChooseSuccess"></more-shop> <more-shop ref="chooseMore" @emitSuccess="handleChooseSuccess"></more-shop>
</div> </div>
</template> </template>
<script> <script>
import CHeader from '@/components/CHeader' import CHeader from '@/components/CHeader'
import NoData from "@/components/noData";
import SItem from './components/SItem' import SItem from './components/SItem'
import MoreShop from './components/MoreShop' import MoreShop from './components/MoreShop'
import * as shopList from "../../api/shopList" import * as shopList from "../../api/shopList"
export default { export default {
components:{CHeader,SItem,MoreShop}, components:{CHeader,SItem,MoreShop,NoData},
data(){ data(){
return { return {
shopListData:[] shopListData:[]
} }
}, },
beforeMount(){ beforeMount(){
this.getPageData({}) const name = this.$route.query
const cityItem = localStorage.getItem('cityItem')
let code = cityItem?JSON.parse(cityItem).codeC:'610100'
let param
if(name){
param = {
storeName:name.storeName
}
}else{
param = {
cityId:code,
}
}
this.getPageData(param)
}, },
methods:{ methods:{
toDetails(id){ toDetails(id){
this.$router.push({ name: 'shopDetails', params: { id: id }}) this.$router.push({ path: `/shopDetails/${id}`})
}, },
handleChooseSuccess(data){ handleChooseSuccess(data){
alert('参数'+JSON.stringify(data))
this.getPageData(data,()=>{ this.getPageData(data,()=>{
this.$refs.chooseMore.handleCancle() this.$refs.chooseMore.handleCancle()
}) })
...@@ -46,3 +66,12 @@ export default { ...@@ -46,3 +66,12 @@ export default {
} }
</script> </script>
<style lang="less" scoped>
@r:100rem;
.nodata-wrapper{
padding-top: 200/@r;
}
</style>
...@@ -25,11 +25,9 @@ export default { ...@@ -25,11 +25,9 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
@r:100rem; @r:100rem;
.web-view-content{ .web-view-content{
background: #ff0;
padding: 20/@r; padding: 20/@r;
*{ font-size: 32/@r!important;
font-size: inherit!important; color: #666;
}
} }
</style> </style>
......
<template>
<div class="page-wrapper">
<c-header title="人员详情"></c-header>
<div class="worker-details">
<div class="img" :style="{'background-image':`url(${workerData.workerHomePic})`}"></div>
<div class="infro">
<div class="name">{{workerData.workerName}}</div>
<div class="bref-wrapper">{{workerData.brief}}</div>
<div class="bref" v-html="workerData.workerResume"></div>
</div>
</div>
</div>
</template>
<script>
import CHeader from "@/components/CHeader";
import * as workerDetails from "../../api/workerDetails"
export default {
components:{CHeader},
data(){
return {
workerData:{
workerName:'',
workerHomePic:'',
workerResume:''
}
}
},
beforeMount(){
const id = this.$route.params.id
this.getPageData(id)
},
methods:{
getPageData(id){
const param = {
workerId:id
}
workerDetails.workerDetails(param).then(res=>{
this.workerData = res.data
})
}
}
}
</script>
<style lang="less" scoped>
@r:100rem;
.worker-details{
.img{
height: 900/@r;
background-color: #dedede;
background-size:cover;
background-position:center center;
}
.infro{
padding: 20/@r;
.name{
font-size: 34/@r;
color: #333;
font-weight: 700;
}
.bref-wrapper{
font-size: 28/@r;
color: #666;
margin-top: 10/@r;
}
.bref{
background: #dedede;
min-height: 300/@r;
border-radius: 8/@r;
margin-top: 20/@r;
color: #666;
padding: 20/@r;
font-size: 24/@r!important;
color: #666;
}
}
}
</style>
<template> <template>
<div class="staff-item"> <div class="staff-item">
<img :src="data.workerHomePic" alt=""> <img :src="data.workerHomePic" alt="">
<div class="infro">{{data.workerName}}</div> <div class="infro">{{data.workerName}}:{{data.brief}}</div>
</div> </div>
</template> </template>
...@@ -19,6 +19,7 @@ export default { ...@@ -19,6 +19,7 @@ export default {
position: relative; position: relative;
margin-bottom: 15/@r; margin-bottom: 15/@r;
margin-left: 15/@r; margin-left: 15/@r;
box-shadow: 2px 2px 2px rgba(0,0,0,.2);
&:nth-child(3n+1){ &:nth-child(3n+1){
margin-left: 0; margin-left: 0;
} }
...@@ -34,8 +35,14 @@ export default { ...@@ -34,8 +35,14 @@ export default {
height: 80/@r; height: 80/@r;
left: 0; left: 0;
bottom: 0; bottom: 0;
font-size: 28/@r; font-size: 24/@r;
background: rgba(0, 0, 0, .5); background: rgba(0, 0, 0, .5);
color: #fff;
padding: 5/@r;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
} }
} }
</style> </style>
......
<template> <template>
<div class="page-wrapper"> <div class="page-wrapper">
<c-header title="人员列表"></c-header> <c-header title="人员列表"></c-header>
<div class="staff-wrapper"> <div class="staff-wrapper" v-if="staffData">
<w-staff v-for="(item,index) in staffData" :key="index" :data="item" @click.native="toWorkerDetails(item.workerId)"></w-staff> <w-staff v-for="(item,index) in staffData" :key="index" :data="item" @click.native="toWorkerDetails(item.workerId)"></w-staff>
</div> </div>
<div class="nodata-wrapper" v-else>
<no-data></no-data>
</div>
<more-worker ref="chooseMore" @emitSuccess="handleChooseSuccess"></more-worker> <more-worker ref="chooseMore" @emitSuccess="handleChooseSuccess"></more-worker>
</div> </div>
</template> </template>
<script> <script>
import CHeader from "@/components/CHeader"; import CHeader from "@/components/CHeader";
import NoData from "@/components/noData";
import WStaff from "./components/WStaff"; import WStaff from "./components/WStaff";
import MoreWorker from "./components/MoreWorker" import MoreWorker from "./components/MoreWorker"
import * as workerList from "../../api/workerList" import * as workerList from "../../api/workerList"
export default { export default {
components: { CHeader, WStaff,MoreWorker }, components: { CHeader, WStaff,MoreWorker,NoData },
data() { data() {
return { return {
staffData: [] staffData: []
...@@ -27,7 +32,7 @@ export default { ...@@ -27,7 +32,7 @@ export default {
}, },
methods:{ methods:{
toWorkerDetails(id){ toWorkerDetails(id){
alert(id) this.$router.push({ path:`/workerDetails/${id}`})
}, },
getPageData(data,cb){ getPageData(data,cb){
workerList.searchWorkerResult(data).then(res=>{ workerList.searchWorkerResult(data).then(res=>{
...@@ -37,7 +42,6 @@ export default { ...@@ -37,7 +42,6 @@ export default {
}, },
handleChooseSuccess(data){ handleChooseSuccess(data){
alert('参数'+JSON.stringify(data))
this.getPageData(data,()=>{ this.getPageData(data,()=>{
this.$refs.chooseMore.handleCancle() this.$refs.chooseMore.handleCancle()
}) })
...@@ -55,5 +59,8 @@ export default { ...@@ -55,5 +59,8 @@ export default {
padding: 0 30 / @r; padding: 0 30 / @r;
padding-top: 20/@r; padding-top: 20/@r;
} }
.nodata-wrapper{
padding-top: 200/@r;
}
</style> </style>
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
* @param prod==>正式上线环境 * @param prod==>正式上线环境
* */ * */
module.exports = { module.exports = {
sit:"http://192.168.1.100:8080/store-system",//毅豪本地 sit:"http://47.105.32.6:8990/storeSystem",//毅豪本地
// sit:"http://192.168.1.112:8080/store-system", // sit:"http://192.168.1.112:8080/store-system",
// ----------------------------------------------------------------- // -----------------------------------------------------------------
prod: "http:正式环境" prod: "http:正式环境"
......
...@@ -157,6 +157,16 @@ ...@@ -157,6 +157,16 @@
<el-row :gutter="15"> <el-row :gutter="15">
<el-col :span="3" class="content-left"><label>店铺简介</label></el-col>
<el-col :span="21" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" type="textarea" :rows="2" placeholder="请输入店铺简介" v-model="dialogBindData.brief"></el-input>
<span v-else>{{dialogBindData.brief}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="3" class="content-left"><label>管理员</label></el-col> <el-col :span="3" class="content-left"><label>管理员</label></el-col>
<el-col :span="21" class="content-right"> <el-col :span="21" class="content-right">
<el-select v-if="dialogType===1 || dialogType===2" v-model="dialogBindData.administratorsId" placeholder="请选择"> <el-select v-if="dialogType===1 || dialogType===2" v-model="dialogBindData.administratorsId" placeholder="请选择">
...@@ -429,6 +439,7 @@ export default { ...@@ -429,6 +439,7 @@ export default {
dialogBindData: { dialogBindData: {
storeId: "", storeId: "",
storeName: "", storeName: "",
brief:'',
contactNumber: "", contactNumber: "",
contacts: "", contacts: "",
qq: "", qq: "",
......
...@@ -152,6 +152,16 @@ ...@@ -152,6 +152,16 @@
<el-row :gutter="15"> <el-row :gutter="15">
<el-col :span="6" class="content-left"><label>简介</label></el-col>
<el-col :span="18" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" type="textarea" :rows="2" placeholder="请输入员工简介" v-model="dialogBindData.brief"></el-input>
<span v-else>{{dialogBindData.brief}}</span>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="6" class="content-left"><label>性别</label></el-col> <el-col :span="6" class="content-left"><label>性别</label></el-col>
<el-col :span="18" class="content-right"> <el-col :span="18" class="content-right">
...@@ -355,6 +365,7 @@ export default { ...@@ -355,6 +365,7 @@ export default {
workerId: "", workerId: "",
workerNumber: "", workerNumber: "",
workerName: "", workerName: "",
brief:'',
workerSex: 1, workerSex: 1,
workerAge: "", workerAge: "",
workerBirthday: "", workerBirthday: "",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment