Files
car-repair-mini-app/pages/repair/repair.vue
xiaoshan c2dadc51b8 微信
2023-12-14 11:11:39 +08:00

276 lines
7.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view class="content">
<view style="height: 24rpx;" />
<view class="con_imgView">
<u-swiper height="370rpx" :list="list" :circular="true" imgMode="widthFix"></u-swiper>
</view>
<view class="positionView">
<view class="posTop">
<view class="posLeft">
<!-- <image class="leftImg" src="@/static/home/position.png" mode=""></image> -->
<u-icon name="map-fill" color="#3D3D3D" size="14"></u-icon>
<text class="leftTxt">选择门店</text>
</view>
<view class="posRight" @click="link('/pages/repair/selectCity')">
<text class="rightTxt">{{ citySave }}</text>
<u-icon name="arrow-right" color="#999999" size="10"></u-icon>
<!-- <image class="rightImg" src="@/static/home/Ricon.png" mode=""></image> -->
</view>
</view>
<z-paging ref="paging" :fixed="false" use-page-scroll auto-full-height v-model="dataList" @query="queryList">
<view class="posFoot">
<view class="footView" hover-class="hover-footView" v-for="(item,index) in dataList" :key="id" @click="link(`/pages/repair/repairDetail?id=${item.id}`,`${item.id}`)">
<view class="footLeft">
<image class="footLeft_img" src="@/static/home/footLeft.png"></image>
</view>
<view class="footRight">
<view :class="['FR_up', checkIds.indexOf(item.id) !== -1 && 'checked-imp']">{{item.name}}</view>
<view :class="['FR_centre', 'line-one', checkIds.indexOf(item.id) !== -1 && 'checked-imp']">
<text>{{item.distance}}km </text> <text class="suxian">|</text> <text> {{item.province + item.city + item.addressDetail}} </text>
</view>
<view class="FR_down">
<view class="down_L">
<text :class="[ checkIds.indexOf(item.id) !== -1 && 'checked-imp']">评分</text> <text class="redTxt"> 5.0 </text>
</view>
<view class="down_R">
<view class="down_R_icon" @click.stop="callPhone(JSON.stringify(item.phone))">
<image src="@/static/images/images/phone_fill.png" mode=""></image>
</view>
<view class="down_R_icon">
<image src="@/static/images/images/pos_icon.png" mode=""></image>
</view>
</view>
</view>
</view>
</view>
</view>
</z-paging>
</view>
</view>
</template>
<script>
import { getStoreList } from '@/api/index'
import { mapGetters } from 'vuex'
const QQMapWX = require('../../js_sdk/qqmap-wx-jssdk/qqmap-wx-jssdk.js');
var qqmapsdk = new QQMapWX({
key: 'SH4BZ-BN36N-UYSFP-SJMPC-LZMGK-EWF3P'
});
export default {
data() {
return {
dataList: [],
list: [
require('../../static/home/imgCar.png'),
require('../../static/home/imgCar1.png'),
require('../../static/home/imgCar2.png'),
],
query: {
latitude: '30',
longitude: '126'
}
}
},
computed: {...mapGetters(['checkIds', 'citySave'])},
onShow() {
uni.getLocation({
type: 'gcj02',
success:(res) => {
console.log(res);
qqmapsdk.reverseGeocoder({
location:{
latitude: res.latitude,
longitude: res.longitude
},
success: (res1) => {
console.log(res1.result.address_component.city);
this.$store.dispatch('SetCity', res1.result.address_component.city)
},
fail: (res) => {
console.log(res);
},
})
},
fail: (err) => {
console.log(err);
}
})
},
methods: {
queryList(pageNo, pageSize) {
getStoreList({limit: pageSize, page: pageNo, city: this.citySave, ...this.query}).then(res => {
console.log(res);
this.$refs.paging.complete(res.data.list);
}).catch( err => {
this.$refs.paging.complete(false);
})
},
callPhone(phoneNumber) {
console.log(phoneNumber);
uni.makePhoneCall({ phoneNumber })
},
link(url, id) {
if(id) {
this.$store.dispatch('CheckIds', id*1)
}
uni.navigateTo({
url,
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
background-color: #f5f5f5;
.con_imgView {
margin: 0 auto;
margin-bottom: 32rpx;
width: 686rpx;
height: 370rpx;
overflow: hidden;
}
.positionView {
padding: 0 24rpx 24rpx 24rpx;
.posTop {
// border: 1px solid;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 22rpx;
.posLeft {
display: flex;
.leftImg {
width: 24rpx;
height: 24rpx;
}
.leftTxt {
font-size: 32rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #444444;
margin-left: 5rpx;
}
}
.posRight {
display: flex;
.rightImg {
width: 10rpx;
height: 20rpx;
}
.rightTxt {
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #444444;
margin-right: 8rpx;
}
}
}
.posFoot {
// border: 1px solid red;
.footView {
display: flex;
padding: 32rpx 24rpx;
margin-bottom: 32rpx;
width: 702rpx;
background-color: #fff;
.footLeft {
width: 168rpx;
height: 140rpx;
.footLeft_img {
width: 168rpx;
height: 140rpx;
background-color: #AAAAAA;
}
}
.footRight {
padding-left: 16rpx;
width: 470rpx;
.FR_up {
font-size: 32rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #111111;
}
.FR_centre {
font-size: 26rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #111111;
margin-bottom: 16rpx;
.suxian {
font-size: 20rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #AAAAAA;
margin: 0 8rpx;
}
}
.FR_down {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
.down_L {
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #111111;
line-height: 1;
.redTxt {
font-size: 40rpx;
font-family: Roboto, Roboto;
font-weight: 500;
color: #F20808;
}
}
.down_R {
display: flex;
.down_R_icon {
image {
margin-left: 20rpx;
width: 48rpx;
height: 48rpx;
}
}
}
}
}
}
.hover-footView {
background-color: #f1f1f1;
}
}
}
}
.line-one {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.checked-imp {
color: #999999 !important;
}
</style>