Commit 59a6ea42 authored by wdy's avatar wdy

商铺接口

parent 586f490f
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
<!-- 分割线上方 --> <!-- 分割线上方 -->
<view class="shopName"> <view class="shopName">
<!-- 商铺名称 --> <!-- 商铺名称 -->
<text>{{shopName}}</text> <text>{{newList.name}}</text>
</view> </view>
<view class="address"> <view class="address">
<!-- 地址 --> <!-- 地址 -->
<text>{{address}}</text> <text>{{location}}</text>
</view> </view>
</view> </view>
<!-- 分割线 --> <!-- 分割线 -->
...@@ -25,39 +25,48 @@ ...@@ -25,39 +25,48 @@
<!-- 分割线下方 所在楼层 --> <!-- 分割线下方 所在楼层 -->
<view class="locations"> <view class="locations">
<u-icon name="map"></u-icon> <u-icon name="map"></u-icon>
<text>所在楼层:<text class="location">{{location}}</text></text> <text>所在楼层:<text class="location">{{newList.position}}</text></text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="lowNav"> <view class="lowNav">
<!-- 底部样式 --> <!-- 底部样式 -->
<view class="minlow"> <view class="minlow">
<text class="textModel">已有{{person}}人点赞</text> <text class="textModel">已有{{person}}人点赞</text>
</view> </view>
<view class="dianzan"> <view class="dianzan">
<u-rate :count="1" active-icon="heart-fill" inactive-icon="heart" inactive-color="#ff0000" @change="dianzan"></u-rate> <u-rate :count="1" active-icon="heart-fill" inactive-icon="heart" inactive-color="#ff0000"
@change="dianzan"></u-rate>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default{ export default {
data(){ data() {
return { return {
img: 'http://192.144.239.97:20043/file/banner/20230605/6F749760FE1148369C4081EBD3248C6C.jpeg', img: '',
shopName:'龙江烧烤', shopName: '',
address:'天津复悦里', location: '天津复悦里',
location:'A2-107', position: '',
person:0, person: 0,
flag: true flag: true,
newList: []
} }
}, },
methods:{ onLoad(options) {
dianzan(){ console.log('options',options.location)
this.person= this.flag ? this.person + 1 : this.person - 1; this.newList = JSON.parse(decodeURIComponent(options.data))
console.log('newList', this.newList);
this.img = this.newList.img
this.location = options.location
},
methods: {
dianzan() {
this.person = this.flag ? this.person + 1 : this.person - 1;
this.flag = !this.flag; this.flag = !this.flag;
} }
} }
...@@ -65,84 +74,84 @@ ...@@ -65,84 +74,84 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.detail{ .detail {
background-color: #eeeeee; background-color: #eeeeee;
min-height: 100vh; min-height: 100vh;
//上半样式 //上半样式
.upModel{ .upModel {
padding: 25rpx 25rpx 0 ; padding: 25rpx 25rpx 0;
//卡片 //卡片
.card{ .card {
width: 100%; width: 100%;
height: 50vh; height: 50vh;
background-color: #fff; background-color: #fff;
border-radius: 20px; border-radius: 20px;
//View1 //View1
.View1{ .View1 {
height: 60%; height: 60%;
background-color: antiquewhite; background-color: antiquewhite;
border-radius: 20px 20px 0 0; border-radius: 20px 20px 0 0;
} }
//图片父级样式 //图片父级样式
.priture{ .priture {
width: 100%; width: 100%;
height: 60%; height: 60%;
// border-radius: 20px 20px 0 0; // border-radius: 20px 20px 0 0;
} }
//图片 //图片
.image{ .image {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 20px 20px 0 0; border-radius: 20px 20px 0 0;
} }
//图片底部区域 //图片底部区域
.lowArea{ .lowArea {
padding: 0 30rpx 0 30rpx; padding: 0 30rpx 0 30rpx;
height: 20vh; height: 20vh;
//分割线上方 //分割线上方
.up-line{ .up-line {
margin: 28rpx 0 28rpx 0; margin: 28rpx 0 28rpx 0;
//商铺名称 //商铺名称
.shopName{ .shopName {
font-size: 40rpx; font-size: 40rpx;
} }
//地址 //地址
.address{ .address {
margin-top: 14rpx; margin-top: 14rpx;
font-size: 26rpx; font-size: 26rpx;
color: #787878; color: #787878;
} }
} }
//分割线下方 所造楼层 //分割线下方 所造楼层
.locations{ .locations {
margin-top: 40rpx; margin-top: 40rpx;
margin-bottom: auto; margin-bottom: auto;
display: flex; display: flex;
font-size: 26rpx; font-size: 26rpx;
//楼层数 //楼层数
.location{ .location {
color: #787878; color: #787878;
} }
} }
} }
} }
} }
//底部样式 //底部样式
.lowNav{ .lowNav {
background-color: #fff; background-color: #fff;
height: 120rpx; height: 120rpx;
width: 100%; width: 100%;
...@@ -150,19 +159,20 @@ ...@@ -150,19 +159,20 @@
z-index: 100; z-index: 100;
bottom: 0; bottom: 0;
position: fixed; position: fixed;
box-shadow: 0 20px 20px 16px rgba(0, 0, 0, 0.4); /* 添加阴影效果 */ box-shadow: 0 20px 20px 16px rgba(0, 0, 0, 0.4);
/* 添加阴影效果 */
//文字部分 //文字部分
.minlow{ .minlow {
font-size: 30rpx; font-size: 30rpx;
color: #787878; color: #787878;
margin-left: 30rpx; margin-left: 30rpx;
margin-top: auto; margin-top: auto;
margin-bottom: auto; margin-bottom: auto;
} }
//点赞 //点赞
.dianzan{ .dianzan {
margin-left: 30rpx; margin-left: 30rpx;
margin-top: auto; margin-top: auto;
margin-bottom: auto; margin-bottom: auto;
......
<template> <template>
<view class="shop"> <view class="shop">
<!-- 搜索框 --> <!-- 搜索框 -->
<view class="u-search-box"> <view class="u-search-box">
<view class="u-search-inner"> <view class="u-search-inner">
<u-icon name="search" color="#909399" :size="28"></u-icon> <u-icon name="search" color="#909399" :size="28"></u-icon>
<u-input class="u-search-text" :disabled="ture" type="text" height="50" @click="toSearch" placeholder="搜商品名称" /> <u-input class="u-search-text" v-model="name" :disabled="ture" type="text" height="50" placeholder="搜商品名称" />
</view> </view>
<view class="button">
<u-button size="mini" shape="circle" hover-class="none" @click="search">
<u-icon name="search"></u-icon>
</u-button>
</view>
</view> </view>
<!-- 选择框 --> <!-- 选择框 -->
<view class="container" style="border-radius: 12px;"> <view class="container" style="border-radius: 12px;">
<u-tabs style="border-radius: 12px;" :list="list" active-color="#fa3534" :current="current" @change="change"></u-tabs> <u-tabs style="border-radius: 12px;" :list="list" active-color="#fa3534" :current="current"
@change="change"></u-tabs>
</view> </view>
<!-- 列表区 --> <!-- 列表区 -->
<view class="gl-body"> <view class="gl-body">
<view class="list" v-for="(item,index) in newList" :key="index" > <view class="list" v-for="(item,index) in newList" :key="index">
<!-- 图片 --> <!-- 图片 -->
<image :src="item.img" :mode=mode style="height: 50%;width: 80%;" @click="toDetail"></image> <image :src="item.img" :mode=mode style="height: 50%;width: 80%;" @click="toDetail(item)"></image>
<!-- 类别 --> <!-- 商铺 -->
<view class="test1">{{item.category}}</view> <view class="test1">{{item.name}}</view>
<!-- 地点 --> <!-- 商圈 -->
<view class="test2">{{item.locations}}</view> <view class="test2">{{location}}</view>
<!-- 位置 --> <!-- 位置 -->
<view class="test1">{{item.position}}</view> <view class="test1">{{item.position}}</view>
</view> </view>
...@@ -28,140 +35,196 @@ ...@@ -28,140 +35,196 @@
</template> </template>
<script> <script>
export default{ export default {
data() { data() {
return{ return {
mode: 'aspectFill', tenantId: '',
keyword:'', floor: '',
current: 0, name: '',
newList: [ mode: 'aspectFill',
{ keyword: '',
img: 'http://192.144.239.97:20043/file/banner/20230605/6F749760FE1148369C4081EBD3248C6C.jpeg', current: 0,
category: '生活类', location: '',
locations: '天津复悦里', newList: [],
position: 'A1-A区' list: []
} }
], },
img: 'http://192.144.239.97:20043/file/banner/20230605/6F749760FE1148369C4081EBD3248C6C.jpeg', onShow() {
list: [{ this.getFloor()
name: 'A1' },
}, methods: {
{ getFloor() {
name: 'A2' let list = []
}, const that = this
{ let tenantId = ''
name: 'A3' let floor = ''
}, // let location = ''
{ uni.getStorage({
name: 'A4' key: 'business',
}, success: function(res) {
{ console.log('res', res);
name: 'A5' that.$u.get('/shop/mobile/selectShopFloor?tenantId=' + res.data.id).then(lres => {
}, console.log('lres', lres);
tenantId = res.data.id
{ that.tenantId = res.data.id
name: 'A6' that.location = res.data.name
}, that.floor = lres[0]
for (const index in lres) {
{ const item = lres[index]
name: 'A7' let obj = {
}, name: item
}
{ list.push(obj)
name: 'A8' }
}, console.log('list', list)
{ that.list = list
name: 'A9' const baseApi = that.baseApi;
}, that.$u.get('/shop/mobile/selectShopList?tenantId=' + tenantId + '&floor=' + lres[0]).then(llres => {
{ console.log('llres', llres);
name: 'B1' that.newList = llres
}, let list = llres;
{ for (const index in list) {
name: 'B2' const item = list[index];
}, item.img = baseApi + '/file/getImgStream?idFile=' + item
.img
{ item.position = item.floor + '-' + item.floorNumber
name: 'B3' item.name = item.name
}, }
{ that.newList = list
name: 'B4' })
},] })
} }
}, })
onShow() { },
this.getFloor() toDetail(item) {
}, const data = JSON.stringify(item)
methods: { uni.navigateTo({
getFloor(){ url: '/homePage/shop/detail/index?location=' + this.location + '&data=' + encodeURIComponent(data)
this.$u.get('/shop/mobile/selectShopFloor').then(res => { })
console.log('res',res) },
}) toSearch() {
},
toDetail(){
uni.navigateTo({
url:'/homePage/shop/detail/index'
})
},
toSearch(){
console.log('点击搜索框') console.log('点击搜索框')
const baseApi = this.baseApi;
this.$u.get('/shop/mobile/selectShopList?tenantId=' + this.tenantId + '&floor=' + this.floor +"&name=" + this.name)
.then(res => {
console.log('res', res);
let list = res;
for (const index in list) {
const item = list[index];
item.img = baseApi + '/file/getImgStream?idFile=' + item.img
item.position = item.floor + '-' + item.floorNumber
item.name = item.name
}
this.newList = list
})
}, },
change(index) { change(index) {
this.current = index; this.current = index;
console.log('tenantId', this.tenantId)
console.log('list', this.list[index])
const baseApi = this.baseApi;
this.$u.get('/shop/mobile/selectShopList?tenantId=' + this.tenantId + '&floor=' + this.list[index].name)
.then(res => {
console.log('res', res);
let list = res;
for (const index in list) {
const item = list[index];
item.img = baseApi + '/file/getImgStream?idFile=' + item.img
item.position = item.floor + '-' + item.floorNumber
item.name = item.name
}
this.newList = list
})
},
search() {
console.log('点击搜索')
const baseApi = this.baseApi;
this.$u.get('/shop/mobile/selectShopList?tenantId=' + this.tenantId + '&floor=' + this.floor +"&name=" + this.name)
.then(res => {
console.log('res', res);
let list = res;
for (const index in list) {
const item = list[index];
item.img = baseApi + '/file/getImgStream?idFile=' + item.img
item.position = item.floor + '-' + item.floorNumber
item.name = item.name
}
this.newList = list
})
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.shop{ .shop {
background-color: #eeeeee; background-color: #eeeeee;
min-height: 100vh; min-height: 100vh;
.u-search-box {
padding: 10rpx 30rpx; .u-search-box {
.u-search-inner { padding: 10rpx 30rpx;
background-color: rgb(234, 234, 234);
border-radius: 100rpx;
display: flex; display: flex;
align-items: center;
padding: 10rpx 16rpx; .u-search-inner {
} background-color: rgb(234, 234, 234);
.u-search-text { border-radius: 100rpx;
font-size: 24rpx; display: flex;
color: $u-tips-color; align-items: center;
margin-left: 10rpx; padding: 10rpx 16rpx;
}
}
.container{
margin-left: 4%;
width: 92%;
height: 6vh;
border-radius: 12px 12px 12px 12px;
background-color: #fff;
}
.gl-body {
display: grid;
grid-template-columns: auto auto;
grid-column-gap: 40rpx;
margin: 30rpx;
.list{
margin-bottom: 30rpx;
width: 100%;
height: 20vh;
.test1{
margin-top: 10rpx;
font-size: 28rpx;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: chocolate;
} }
.test2{
margin-top: 10rpx; .button{
font-size: 36rpx; background-color: rgb(234, 234, 234);
font-family: Source Han Sans CN-Medium, Source Han Sans CN; border-radius: 100rpx;
font-weight: 700; display: flex;
align-items: center;
padding: 10rpx 16rpx;
margin-left: 20rpx;
}
.u-search-text {
font-size: 24rpx;
color: $u-tips-color;
margin-left: 10rpx;
}
}
.container {
margin-left: 4%;
width: 92%;
height: 6vh;
border-radius: 12px 12px 12px 12px;
background-color: #fff;
}
.gl-body {
display: grid;
grid-template-columns: auto auto;
grid-column-gap: 40rpx;
margin: 30rpx;
.list {
margin-bottom: 30rpx;
width: 100%;
height: 20vh;
.test1 {
margin-top: 10rpx;
font-size: 28rpx;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: chocolate;
}
.test2 {
margin-top: 10rpx;
font-size: 36rpx;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 700;
}
} }
} }
}
} }
</style> </style>
\ No newline at end of file
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