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

167 lines
3.1 KiB

5 months ago
<template>
<view>
<image src="@/static/bg.png" mode="" style="width: 100%;height: 928rpx;"></image>
<view class="top" @click="previous">
<view class="xuzou">
<uni-icons type="left" size="18"></uni-icons>
4 months ago
<text class="title">门店列表</text>
</view>
5 months ago
</view>
<view class="mendian">
4 months ago
<view class="mddz" v-for="(item,index) in mendainlist" :key="index" @click="xzmd(item)">
5 months ago
<view class="mddz1">
4 months ago
<image class="mddz1img" :src="item.image.url" mode=""></image>
4 months ago
<view class="mddz1wz">{{item.name}}</view>
5 months ago
</view>
<view class="mddz2">
4 months ago
<view class="" @click="handleNavigation(item)">
4 months ago
<image class="mddz1img1" src="@/static/定位1.png" mode=""></image>
<text class="dz">地址{{item.address}}</text>
</view>
4 months ago
<image class="mddz1img2" src="@/static/电话o.png" mode="" @click="makePhoneCall(item.mobile)"></image>
5 months ago
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
4 months ago
mendainlist: [],
iswanjie:false,
page:1,
isshouye:''
}
},
onLoad(e) {
console.log(123,e);
this.isshouye=e.item
},
onShow() {
this.storeList(this.page)
},
onReachBottom(){
if(!iswanjie){
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) {
4 months ago
this.mendainlist=[]
4 months ago
this.$api.storeList({
page: page
}).then(res => {
let arr = res.data.list
if(arr.length<res.data.total){
this.iswanjie=true
}
this.mendainlist = [...this.mendainlist, ...arr]
})
},
5 months ago
}
}
</script>
<style scoped>
4 months ago
.top {
5 months ago
display: flex;
position: absolute;
top: 96rpx;
left: 20rpx;
}
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 {
margin-top: 32rpx;
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;
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;
height: 152rpx;
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 {
5 months ago
position: absolute;
top: 152rpx;
left: 24rpx;
}
4 months ago
</style>