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

228 lines
4.4 KiB

4 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'}">
4 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>
4 months ago
</view>
3 months ago
<view class="content" :style="{'top': (top+44)+'px'}">
<view class="mendian">
3 months ago
<view class="mddz" v-for="(item,index) in mendainlist" :key="index">
<view class="mddz1" @click="xzmd(item)">
3 months ago
<image class="mddz1img" :src="item.image.url" mode=""></image>
2 months ago
<view class="mddz1wz">{{item.name}}
<image src="@/static/zaixian.png"></image><text class="num">{{item.one_line_num}}</text>
</view>
4 months ago
</view>
3 months ago
<view class="mddz2">
3 months ago
<view class="mdleft" @click.stop="handleNavigation(item)">
3 months ago
<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.stop="makePhoneCall(item.mobile)"></image>
3 months ago
</view>
4 months ago
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
4 months ago
mendainlist: [],
iswanjie:false,
page:1,
3 months ago
isshouye:'',
3 months ago
top: 0,
id: ""
4 months ago
}
},
onLoad(e) {
3 months ago
this.top = uni.getSystemInfoSync().statusBarHeight
4 months ago
this.isshouye=e.item
3 months ago
this.id = e.id
console.log(e)
4 months ago
},
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)
4 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()
3 months ago
}else{
uni.$emit("changeStoreInfo",item)
uni.navigateBack()
4 months ago
}
},
previous() {
4 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]
3 months ago
if(res.data.total >=1){
this.mendainlist.map(a=>a.id = a.store_id)
}
3 months ago
if(this.mendainlist.length>=res.data.total){
4 months ago
this.iswanjie=true
}
})
},
4 months ago
}
}
</script>
2 months ago
<style lang="scss" 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;
4 months ago
display: flex;
3 months ago
position: fixed;
align-items: center;
position: relative;
z-index: 23;
}
.top .hs{
width: 100%;
height: 100%;
4 months ago
position: absolute;
3 months ago
left: 0;
top: 0;
z-index: 1;
4 months ago
}
4 months ago
.title {
4 months ago
padding-left: 14rpx;
}
4 months ago
4 months ago
.mddz1img2 {
width: 44rpx;
height: 44rpx;
}
4 months ago
4 months ago
.mddz2 {
3 months ago
margin-top: 25rpx;
4 months ago
display: flex;
justify-content: space-between;
4 months ago
}
4 months ago
4 months ago
.dz {
margin-left: 17rpx;
4 months ago
font-family: PingFang SC;
font-weight: 500;
font-size: 26rpx;
color: #999999;
4 months ago
}
4 months ago
4 months ago
.mddz1img1 {
width: 22rpx;
height: 27rpx;
}
4 months ago
4 months ago
.mddz1 {
display: flex;
}
4 months ago
4 months ago
.mddz1img {
width: 60rpx;
3 months ago
border-radius: 10rpx;
4 months ago
height: 60rpx;
}
4 months ago
4 months ago
.mddz1wz {
font-family: PingFang SC;
font-weight: bold;
font-size: 30rpx;
color: #222222;
2 months ago
margin-left: 15rpx;
4 months ago
margin-top: 12rpx;
2 months ago
image{
width: 28rpx;
height: 28rpx;
vertical-align: middle;
}
.num{
font-size: 22rpx;
color: rgb(11, 229, 0);
font-weight: normal;
}
4 months ago
}
.mddz {
width: 680rpx;
3 months ago
/* height: 152rpx; */
4 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;
4 months ago
}
4 months ago
</style>