This commit is contained in:
liuye
2024-06-28 09:51:53 +08:00
parent 4cfbe99918
commit a997a3089c
6 changed files with 63 additions and 49 deletions

View File

@@ -43,7 +43,7 @@ export default {
}).then(res => { }).then(res => {
if (res?.data) { if (res?.data) {
this.list = this.current == 1 ? res.data.records : [this.list, res.data.records].flat() this.list = this.current == 1 ? res.data.records : [this.list, res.data.records].flat()
this.pages = res.data.total this.pages = res.data.pages
} }
}).finally(() => uni.hideLoading()) }).finally(() => uni.hideLoading())
}, },

View File

@@ -1,12 +1,20 @@
<template> <template>
<div class="AppStore"> <div class="AppStore">
<u-navbar :is-back="false" title="门店" title-color="#000" title-width="300" title-size="32" :title-bold="true" :background="backgroundNavbar" :is-fixed="true" height="44"></u-navbar> <div class="header">
<div class="status-bar" :style="{height: statusBarHeight + 'px'}"></div>
<div class="nav-bar" :style="{
height: '44px',
lineHeight: '44px'
}">
<h2>门店</h2>
</div>
<div class="tab"> <div class="tab">
<u-tabs :list="tabList" :is-scroll="false" :current="tabIndex" @change="change" inactive-color="#222" active-color="#222" <u-tabs :list="tabList" :is-scroll="false" :current="tabIndex" @change="change" inactive-color="#222" active-color="#222"
height="100" :bar-style="barStyle"></u-tabs> height="100" :bar-style="barStyle"></u-tabs>
</div> </div>
</div>
<Situation v-if="tabIndex != 1" @toStoreDetail="toStoreDetail"></Situation> <Situation v-if="tabIndex != 1" @toStoreDetail="toStoreDetail"></Situation>
<Evaluate v-else @toEvaluateForm="toEvaluateForm" @toStoreDetail="toStoreDetail" :tabHeight="tabHeight"></Evaluate> <Evaluate v-else @toEvaluateForm="toEvaluateForm" @toStoreDetail="toStoreDetail" ref="Evaluate"></Evaluate>
</div> </div>
</template> </template>
@@ -19,22 +27,14 @@ export default {
name: 'AppStore', name: 'AppStore',
appName: '门店', appName: '门店',
components: {Situation, Evaluate}, components: {Situation, Evaluate},
navigationBarBackgroundColor: '#ffffff',
navigationBarTextStyle: 'black',
customNavigation: true, customNavigation: true,
data() { data() {
return { return {
tabList: [{name: '门店情况'}, {name: '我要评价'}], tabList: [{name: '门店情况'}, {name: '我要评价'}],
tabIndex: 0, tabIndex: 0,
barStyle: { statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
'width': '20px',
'height': '3px',
'border-radius': '2px',
'bottom': '-3px',
'background': '#2D7DFF'
},
backgroundNavbar: {
background: '#fff',
},
tabHeight: 0
} }
}, },
computed: { computed: {
@@ -44,30 +44,23 @@ export default {
if(e.tabIndex) { if(e.tabIndex) {
this.tabIndex = e.tabIndex this.tabIndex = e.tabIndex
} }
let info = uni.createSelectorQuery().select(".tab");
info.boundingClientRect((data)=> { //data - 各种参数
this.tabHeight = data.height
console.log(this.tabHeight)
}).exec()
},
onShow() {
}, },
methods: { methods: {
change(e) { change(e) {
this.tabIndex = e this.tabIndex = e
}, },
toEvaluateForm(e) { toEvaluateForm(e) {
console.log(e)
uni.navigateTo({url: `./EvaluateForm?shopId=${e.shopId}`}) uni.navigateTo({url: `./EvaluateForm?shopId=${e.shopId}`})
}, },
toStoreDetail(e) { toStoreDetail(e) {
console.log(e)
uni.navigateTo({url: `./StoreDetail?shopId=${e.shopId}`}) uni.navigateTo({url: `./StoreDetail?shopId=${e.shopId}`})
}, },
}, },
onReachBottom() {
if(this.tabIndex == 1) {
this.$refs.Evaluate.getNextList()
}
}
} }
</script> </script>
@@ -79,6 +72,27 @@ page{
.AppStore { .AppStore {
background-color: #F4F5FA; background-color: #F4F5FA;
height: 100vh; height: 100vh;
.header {
position: fixed;
left: 0;
top: 0;
z-index: 111;
width: 100%;
opacity: 1;
transition: all 0.2s ease;
.status-bar {
background: #fff;
}
.nav-bar {
position: relative;
color: #000;
font-size: 32px;
font-weight: 600;
background: #fff;
text-align: center;
}
}
.tab { .tab {
position: fixed; position: fixed;
left: 0; left: 0;

View File

@@ -86,6 +86,8 @@ export default {
name: 'EvaluateForm', name: 'EvaluateForm',
appName: '我要评价', appName: '我要评价',
customNavigation: true, customNavigation: true,
navigationBarBackgroundColor: '#ffffff',
navigationBarTextStyle: 'black',
data() { data() {
return { return {
form: { form: {

View File

@@ -70,6 +70,8 @@
export default { export default {
name: 'StoreDetail', name: 'StoreDetail',
appName: '门店情况', appName: '门店情况',
navigationBarBackgroundColor: '#ffffff',
navigationBarTextStyle: 'black',
customNavigation: true, customNavigation: true,
data() { data() {
return { return {
@@ -130,7 +132,7 @@ export default {
item.wxzStar = wxz <= 0 ? 0 : wxz item.wxzStar = wxz <= 0 ? 0 : wxz
}) })
this.assessList = this.current == 1 ? res.data.records : [this.list, res.data.records].flat() this.assessList = this.current == 1 ? res.data.records : [this.list, res.data.records].flat()
this.pages = res.data.total this.pages = res.data.pages
} }
}).finally(() => uni.hideLoading()) }).finally(() => uni.hideLoading())
}, },

View File

@@ -1,6 +1,6 @@
<template> <template>
<div class="Evaluate"> <div class="Evaluate" :style="{paddingTop: (statusBarHeight + 94) + 'px'}">
<div class="search" :style="{'top': navHeight+'px'}"> <div class="search">
<div class="search-input"> <div class="search-input">
<u-search v-model="searchVal" :clearabled="true" placeholder="搜索门店名称" :show-action="false" <u-search v-model="searchVal" :clearabled="true" placeholder="搜索门店名称" :show-action="false"
bg-color="#F4F5FA" search-icon-color="#666" color="#222" height="72" @search="getListInit" @clear="getListInit"> bg-color="#F4F5FA" search-icon-color="#666" color="#222" height="72" @search="getListInit" @clear="getListInit">
@@ -81,12 +81,7 @@ export default {
searchStoreLevel: {}, searchStoreLevel: {},
searchOperatorType: {}, searchOperatorType: {},
girdInfo: {gridName: ''}, girdInfo: {gridName: ''},
navHeight: '' statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
}
},
props: {
tabHeight: {
type: String
} }
}, },
created() { created() {
@@ -97,13 +92,9 @@ export default {
this.getList() this.getList()
}) })
}, },
mounted() {
setTimeout(() => {
this.navHeight = uni.getSystemInfoSync().statusBarHeight + Number(this.tabHeight) + 44
}, 600)
},
methods: { methods: {
getList() { getList() {
console.log(this.current, this.pages)
if(this.current > this.pages) return if(this.current > this.pages) return
this.$loading() this.$loading()
this.$instance.post(`/app/appshoparchives/list`, null, { this.$instance.post(`/app/appshoparchives/list`, null, {
@@ -123,10 +114,14 @@ export default {
item.wxzStar = wxz <= 0 ? 0 : wxz item.wxzStar = wxz <= 0 ? 0 : wxz
}) })
this.list = this.current == 1 ? res.data.records : [this.list, res.data.records].flat() this.list = this.current == 1 ? res.data.records : [this.list, res.data.records].flat()
this.pages = res.data.total this.pages = res.data.pages
} }
}).finally(() => uni.hideLoading()) }).finally(() => uni.hideLoading())
}, },
getNextList() {
this.current ++
this.getList()
},
confirmOperatorType(e) { confirmOperatorType(e) {
this.searchOperatorType = e[0] this.searchOperatorType = e[0]
this.getListInit() this.getListInit()
@@ -187,7 +182,7 @@ export default {
} }
} }
.list-content { .list-content {
padding: 340px 32px 0; padding: 240px 32px 64px;
box-sizing: border-box; box-sizing: border-box;
.item { .item {
width: 100%; width: 100%;

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="Situation" :style="{paddingTop: (statusBarHeight + 110) + 'px'}"> <div class="Situation" :style="{paddingTop: (statusBarHeight + 94) + 'px'}">
<div class="title"> <div class="title">
<div class="left">门店台账</div> <div class="left">门店台账</div>
</div> </div>
@@ -77,7 +77,8 @@ export default {
month: '', month: '',
monthText: '', monthText: '',
table: [], table: [],
numInfo: {} numInfo: {},
statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
} }
}, },
created() { created() {
@@ -128,9 +129,9 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.Situation { .Situation {
padding-top: 100px; height: 100%;
height: calc(100% - 100px);
background-color: #F4F5FA; background-color: #F4F5FA;
box-sizing: border-box;
.title { .title {
line-height: 40px; line-height: 40px;
padding: 32px; padding: 32px;