Commit 12b47549 by zhangzhen

细节优化

parent b5cecb6f
<template> <template>
<view class="store-list"> <view class="store-list-content">
<view class="flex-col" v-for="(val,i) in list" :key="i" @tap.stop="onNavToHome(val)"> <scroll-view class="scroll-view" scroll-y="true">
<view class="flex-row"> <view class="store-list">
<view class="room-img-box"> <view class="flex-col" v-for="(val,i) in list" :key="i" @tap.stop="onNavToHome(val)">
<image :src="val.images[0]" mode="aspectFill" @tap.stop="onPreview(val)"></image> <view class="flex-row">
</view> <view class="room-img-box">
<view class="flex-1 part-right"> <image :src="val.images[0]" mode="aspectFill" @tap.stop="onPreview(val)"></image>
<view class="part-title">
<view class='cu-tag radius sm bg-pink'>{{storeTypeEnum[val.storeType]}}</view>
<text class="text-title text-lg text-bold">{{val.name}}</text>
</view>
<view class="flex-between">
<view class="flex-row part-title">
<text class="cuIcon-location text-pink margin-right"></text>
<view class="flex-1">
<text class="text-gray text-sm">{{val.address}}</text>
</view>
</view> </view>
<!-- <view class="nav-icon" @tap.stop="onNavToMap(val)"> <view class="flex-1 part-right">
<image :src="assetsPath+'/map_icon.png'" mode="widthFix"></image> <view class="part-title">
</view> --> <view class='cu-tag radius sm bg-pink'>{{storeTypeEnum[val.storeType]}}</view>
</view> <text class="text-title text-lg text-bold">{{val.name}}</text>
<view class="flex-between part-title"> </view>
<view class='cu-tag radius line-pink'>距离{{Number(val.distance).toFixed(2)}}km</view> <view class="flex-between">
<view class="location"> <view class="flex-row part-title">
<button class="cu-btn bg-pink" >去预定</button> <text class="cuIcon-location text-pink margin-right"></text>
<view class="flex-1">
<text class="text-gray text-sm">{{val.address}}</text>
</view>
</view>
<!-- <view class="nav-icon" @tap.stop="onNavToMap(val)">
<image :src="assetsPath+'/map_icon.png'" mode="widthFix"></image>
</view> -->
</view>
<view class="flex-between part-title">
<view class='cu-tag radius line-pink'>距离{{Number(val.distance).toFixed(2)}}km</view>
<view class="location">
<button class="cu-btn bg-pink">去预定</button>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </scroll-view>
</view> </view>
</template> </template>
<script> <script>
...@@ -39,7 +42,7 @@ ...@@ -39,7 +42,7 @@
import { import {
getDictItem getDictItem
} from "@/utils/tools.js" } from "@/utils/tools.js"
export default { export default {
name: "storeList", name: "storeList",
props: { props: {
...@@ -52,7 +55,7 @@ ...@@ -52,7 +55,7 @@
return { return {
assetsPath: config.assetsPath, assetsPath: config.assetsPath,
list: [], list: [],
storeTypeEnum:{}, storeTypeEnum: {},
}; };
}, },
watch: { watch: {
...@@ -65,14 +68,14 @@ ...@@ -65,14 +68,14 @@
}, },
mounted() { mounted() {
let dicts = JSON.parse(uni.getStorageSync('dicts')) let dicts = JSON.parse(uni.getStorageSync('dicts'))
this.storeTypeEnum = getDictItem(dicts,"store_type"); this.storeTypeEnum = getDictItem(dicts, "store_type");
}, },
methods: { methods: {
onLoading() { onLoading() {
this.list = this.value; this.list = this.value;
}, },
onNavToHome(val){ onNavToHome(val) {
this.$emit("change",val.id) this.$emit("change", val.id)
}, },
onPreview(item) { onPreview(item) {
uni.previewImage({ uni.previewImage({
...@@ -86,7 +89,7 @@ ...@@ -86,7 +89,7 @@
longitude: Number(val.longitude), longitude: Number(val.longitude),
scale: 18, scale: 18,
name: val.address, name: val.address,
address:val.address, address: val.address,
success: (res) => { success: (res) => {
console.log(res) console.log(res)
}, },
...@@ -100,10 +103,24 @@ ...@@ -100,10 +103,24 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.store-list-content{
width: 100%;
height: 100%;
}
.scroll-view {
position: relative;
width: 100%;
height: 100%;
}
.store-list { .store-list {
position: absolute;
top: 0;
left: 2%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%; width: 96%;
>.flex-col { >.flex-col {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -114,6 +131,7 @@ ...@@ -114,6 +131,7 @@
overflow: hidden; overflow: hidden;
padding: 12upx; padding: 12upx;
margin: 12upx 0; margin: 12upx 0;
.room-img-box { .room-img-box {
display: flex; display: flex;
width: 200upx; width: 200upx;
...@@ -121,6 +139,7 @@ ...@@ -121,6 +139,7 @@
border-radius: 12upx; border-radius: 12upx;
overflow: hidden; overflow: hidden;
margin: 0 20upx 0 0; margin: 0 20upx 0 0;
image { image {
height: 100%; height: 100%;
} }
...@@ -196,12 +215,14 @@ ...@@ -196,12 +215,14 @@
} }
} }
} }
.nav-icon{
.nav-icon {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 80upx; width: 80upx;
image{
image {
display: block; display: block;
width: 100%; width: 100%;
height: auto; height: auto;
......
...@@ -183,11 +183,11 @@ ...@@ -183,11 +183,11 @@
</view> </view>
</view> </view>
<view class="tip-text"> <view class="tip-text">
<text class="text-title text-lg">本店当前时段所有包厢已被占用,您可以预约本店的其他时段,或者预定凑角附近的其它门店。</text> <text class="text-title text-lg">本店当前时段所有包厢已被预定,您可以预约本店的其他时段,或者预定凑角附近的其它门店。</text>
</view> </view>
<!-- 展示所有房间列表 --> <!-- 展示所有房间列表 -->
<view class="store-box"> <view class="store-box">
<StoreList v-model="popStoreList" @change="onStoreChage"></StoreList> <StoreList style="width: 100%;" v-model="popStoreList" @change="onStoreChage"></StoreList>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
......
...@@ -1899,10 +1899,17 @@ ...@@ -1899,10 +1899,17 @@
font-size: 32upx; font-size: 32upx;
} }
.line-black{
border: 1px solid #e03997;
color: #e03997;
}
.line-black::after{
border-color: transparent;
}
.line-pink { .line-pink {
display: flex; display: flex;
align-items: center; align-items: center;
// border-color: #e03997;
.cuIcon-edit { .cuIcon-edit {
margin-bottom: 7upx; margin-bottom: 7upx;
margin-left: 12upx; margin-left: 12upx;
......
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