You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jiansheng/pages/mendainlist/mendainlist.vue

208 lines
3.9 KiB

5 months ago
<template>
<view>
3 months ago
<image src="@/static/bg.png" mode="widthFix" class="bg" style="width: 100%;height: 928rpx;"></image>
<view class="top" @click="previous" :style="{'padding-top': top+'px'}">
5 months ago
<view class="xuzou">
3 months ago
<uni-icons type="left" size="24" style="margin-left: 25rpx;"></uni-icons>
4 months ago
<text class="title">门店列表</text>
</view>
3 months ago
<image src="@/static/bg.png" mode="widthFix" class="hs"></image>
5 months ago
</view>
3 months ago
<view class="content" :style="{'top': (top+44)+'px'}">
<view class="mendian">
<view class="mddz" v-for="(item,index) in mendainlist" :key="index" @click="xzmd(item)">
<view class="mddz1">
<image class="mddz1img" :src="item.image.url" mode=""></image>
<view class="mddz1wz">{{item.name}}</view>
4 months ago
</view>
3 months ago
<view class="mddz2">
<view class="mdleft" @click="handleNavigation(item)">
<image class="mddz1img1" src="@/static/定位1.png" mode=""></image>
<text class="dz">地址{{item.address}}</text>
</view>
4 months ago
3 months ago
<image class="mddz1img2" src="@/static/电话o.png" mode="" @click="makePhoneCall(item.mobile)"></image>
</view>
5 months ago
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
4 months ago
mendainlist: [],
iswanjie:false,
page:1,
3 months ago
isshouye:'',
top: 0
4 months ago
}
},
onLoad(e) {
3 months ago
this.top = uni.getSystemInfoSync().statusBarHeight
4 months ago
this.isshouye=e.item
},
onShow() {
3 months ago
this.mendainlist=[]
4 months ago
this.storeList(this.page)
},
onReachBottom(){
3 months ago
if(!this.iswanjie){
4 months ago
this.storeList(this.page+1)
5 months ago
}
},
methods: {
4 months ago
handleNavigation(i) {
uni.openLocation({
longitude:Number(i.longitude),
latitude:Number(i.latitude),
name:i.name,
address: i.address,
success: function(res) {
console.log('打开系统位置地图成功')
},
fail: function(error) {
console.log(error)
}
})
},
makePhoneCall(e){
uni.makePhoneCall({
phoneNumber: e //仅为示例
});
},
4 months ago
xzmd(item){
if(this.isshouye!='shouye'){
var item=JSON.stringify(item)
uni.setStorageSync('xzmd','')
uni.setStorageSync('xzmd',item)
uni.navigateBack()
}
},
previous() {
5 months ago
uni.navigateBack()
},
4 months ago
storeList(page) {
this.$api.storeList({
page: page
}).then(res => {
let arr = res.data.list
3 months ago
this.mendainlist = [...this.mendainlist, ...arr]
if(this.mendainlist.length>=res.data.total){
4 months ago
this.iswanjie=true
}
})
},
5 months ago
}
}
</script>
<style scoped>
3 months ago
.mdleft{
3 months ago
width: 620rpx;
}
.bg{
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 1;
background: #f5f5f5;
}
.content{
width: 100%;
position: relative;
left: 0;
top: 0;
z-index: 2;
3 months ago
}
4 months ago
.top {
3 months ago
width: 100%;
left: 0;
z-index: 22;
height: 88rpx;
overflow: hidden;
position: fixed;
}
.top .xuzou{
width: 100%;
height: 88rpx;
5 months ago
display: flex;
3 months ago
position: fixed;
align-items: center;
position: relative;
z-index: 23;
}
.top .hs{
width: 100%;
height: 100%;
5 months ago
position: absolute;
3 months ago
left: 0;
top: 0;
z-index: 1;
5 months ago
}
4 months ago
.title {
5 months ago
padding-left: 14rpx;
}
4 months ago
5 months ago
.mddz1img2 {
width: 44rpx;
height: 44rpx;
}
4 months ago
5 months ago
.mddz2 {
3 months ago
margin-top: 25rpx;
4 months ago
display: flex;
justify-content: space-between;
5 months ago
}
4 months ago
5 months ago
.dz {
margin-left: 17rpx;
4 months ago
font-family: PingFang SC;
font-weight: 500;
font-size: 26rpx;
color: #999999;
5 months ago
}
4 months ago
5 months ago
.mddz1img1 {
width: 22rpx;
height: 27rpx;
}
4 months ago
5 months ago
.mddz1 {
display: flex;
}
4 months ago
5 months ago
.mddz1img {
width: 60rpx;
3 months ago
border-radius: 10rpx;
5 months ago
height: 60rpx;
}
4 months ago
5 months ago
.mddz1wz {
font-family: PingFang SC;
font-weight: bold;
font-size: 30rpx;
color: #222222;
margin-left: 21rpx;
margin-top: 12rpx;
}
4 months ago
5 months ago
.mddz {
width: 680rpx;
3 months ago
/* height: 152rpx; */
5 months ago
background: #FFFFFF;
box-shadow: 0rpx 3rpx 9rpx 0rpx rgba(19, 14, 4, 0.08);
border-radius: 20rpx;
margin-top: 24rpx;
padding: 20rpx 17rpx;
}
4 months ago
.mendian {
3 months ago
padding: 0 25rpx 25rpx;
overflow: hidden;
5 months ago
}
4 months ago
</style>