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,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<!-- 分割线下方 所在楼层 --> <!-- 分割线下方 所在楼层 -->
<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>
...@@ -37,27 +37,36 @@ ...@@ -37,27 +37,36 @@
<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,23 +74,23 @@ ...@@ -65,23 +74,23 @@
</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;
...@@ -89,35 +98,35 @@ ...@@ -89,35 +98,35 @@
} }
//图片父级样式 //图片父级样式
.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;
...@@ -125,14 +134,14 @@ ...@@ -125,14 +134,14 @@
} }
//分割线下方 所造楼层 //分割线下方 所造楼层
.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;
} }
} }
...@@ -142,7 +151,7 @@ ...@@ -142,7 +151,7 @@
} }
//底部样式 //底部样式
.lowNav{ .lowNav {
background-color: #fff; background-color: #fff;
height: 120rpx; height: 120rpx;
width: 100%; width: 100%;
...@@ -150,10 +159,11 @@ ...@@ -150,10 +159,11 @@
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;
...@@ -162,7 +172,7 @@ ...@@ -162,7 +172,7 @@
} }
//点赞 //点赞
.dianzan{ .dianzan {
margin-left: 30rpx; margin-left: 30rpx;
margin-top: auto; margin-top: auto;
margin-bottom: auto; margin-bottom: auto;
......
...@@ -4,22 +4,29 @@ ...@@ -4,22 +4,29 @@
<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,96 +35,137 @@ ...@@ -28,96 +35,137 @@
</template> </template>
<script> <script>
export default{ export default {
data() { data() {
return{ return {
tenantId: '',
floor: '',
name: '',
mode: 'aspectFill', mode: 'aspectFill',
keyword:'', keyword: '',
current: 0, current: 0,
newList: [ location: '',
{ newList: [],
img: 'http://192.144.239.97:20043/file/banner/20230605/6F749760FE1148369C4081EBD3248C6C.jpeg', list: []
category: '生活类',
locations: '天津复悦里',
position: 'A1-A区'
}
],
img: 'http://192.144.239.97:20043/file/banner/20230605/6F749760FE1148369C4081EBD3248C6C.jpeg',
list: [{
name: 'A1'
},
{
name: 'A2'
},
{
name: 'A3'
},
{
name: 'A4'
},
{
name: 'A5'
},
{
name: 'A6'
},
{
name: 'A7'
},
{
name: 'A8'
},
{
name: 'A9'
},
{
name: 'B1'
},
{
name: 'B2'
},
{
name: 'B3'
},
{
name: 'B4'
},]
} }
}, },
onShow() { onShow() {
this.getFloor() this.getFloor()
}, },
methods: { methods: {
getFloor(){ getFloor() {
this.$u.get('/shop/mobile/selectShopFloor').then(res => { let list = []
console.log('res',res) const that = this
let tenantId = ''
let floor = ''
// let location = ''
uni.getStorage({
key: 'business',
success: function(res) {
console.log('res', res);
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
that.location = res.data.name
that.floor = lres[0]
for (const index in lres) {
const item = lres[index]
let obj = {
name: item
}
list.push(obj)
}
console.log('list', list)
that.list = list
const baseApi = that.baseApi;
that.$u.get('/shop/mobile/selectShopList?tenantId=' + tenantId + '&floor=' + lres[0]).then(llres => {
console.log('llres', llres);
that.newList = llres
let list = llres;
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
}
that.newList = list
})
})
}
}) })
}, },
toDetail(){ toDetail(item) {
const data = JSON.stringify(item)
uni.navigateTo({ uni.navigateTo({
url:'/homePage/shop/detail/index' url: '/homePage/shop/detail/index?location=' + this.location + '&data=' + encodeURIComponent(data)
}) })
}, },
toSearch(){ 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 { .u-search-box {
padding: 10rpx 30rpx; padding: 10rpx 30rpx;
display: flex;
.u-search-inner { .u-search-inner {
background-color: rgb(234, 234, 234); background-color: rgb(234, 234, 234);
border-radius: 100rpx; border-radius: 100rpx;
...@@ -125,36 +173,51 @@ ...@@ -125,36 +173,51 @@
align-items: center; align-items: center;
padding: 10rpx 16rpx; padding: 10rpx 16rpx;
} }
.button{
background-color: rgb(234, 234, 234);
border-radius: 100rpx;
display: flex;
align-items: center;
padding: 10rpx 16rpx;
margin-left: 20rpx;
}
.u-search-text { .u-search-text {
font-size: 24rpx; font-size: 24rpx;
color: $u-tips-color; color: $u-tips-color;
margin-left: 10rpx; margin-left: 10rpx;
} }
} }
.container{
.container {
margin-left: 4%; margin-left: 4%;
width: 92%; width: 92%;
height: 6vh; height: 6vh;
border-radius: 12px 12px 12px 12px; border-radius: 12px 12px 12px 12px;
background-color: #fff; background-color: #fff;
} }
.gl-body { .gl-body {
display: grid; display: grid;
grid-template-columns: auto auto; grid-template-columns: auto auto;
grid-column-gap: 40rpx; grid-column-gap: 40rpx;
margin: 30rpx; margin: 30rpx;
.list{
.list {
margin-bottom: 30rpx; margin-bottom: 30rpx;
width: 100%; width: 100%;
height: 20vh; height: 20vh;
.test1{
.test1 {
margin-top: 10rpx; margin-top: 10rpx;
font-size: 28rpx; font-size: 28rpx;
font-family: Source Han Sans CN-Medium, Source Han Sans CN; font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500; font-weight: 500;
color: chocolate; color: chocolate;
} }
.test2{
.test2 {
margin-top: 10rpx; margin-top: 10rpx;
font-size: 36rpx; font-size: 36rpx;
font-family: Source Han Sans CN-Medium, Source Han Sans CN; font-family: Source Han Sans CN-Medium, Source Han Sans CN;
......
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