123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272 |
- <template>
- <view class="">
- <view class="search">
- <view class="searchCard">
- <view class="input">
- <view style="min-width: 120rpx;">
- <text class="iconfont icon-sousuo2"></text>
- </view>
- <!-- <form @submit.prevent="submit"></form> -->
- <input style="margin-left: -34rpx;" type="text" placeholder="搜索店内服务" v-model="search"
- placeholder-class="co" />
- <view class="bnt" @click="submit">搜索</view>
- </view>
- </view>
- </view>
- <view class="">
- <view class="shopBody" v-for="(item, index) in shopList" :key="index" @tap="goBack(item)">
- <view class="classBody" style="margin-left: 30rpx;">
- <image class="classImg" :src="baseImagePath+item.logoUrl">
- <view style="padding: 0 0 0 22rpx;display: flex;flex-direction: column;justify-content: center;">
- <view class="classBodyHead">
- {{item.name}}
- </view>
- <view class="classBodyContent">
- {{item.address}}
- </view>
- </view>
- <view class="viewRight">
- <image class="location" :src="require('../../../static/address.png')">
- <view class="locationNum">
- {{item.distance}}km
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- getSelectStore
- } from "@/api/shop.js"
- const app = getApp();
- export default {
- data: function() {
- return {
- baseImagePath: this.baseImagePath,
- longitude: app.globalData.longitude,
- latitude: app.globalData.latitude,
- shopList: [],
- pageNo: 1,
- pageSize: 20,
- search:"",
- page:'',
- pageType : ''
- }
- },
- onLoad: function(option) { //option为object类型,会序列化上个页面传递的参数
- console.log('option',option);
- this.page = option.page
- this.pageType = option.type
- this.getPage()
-
- },
- onReachBottom() {
- this.getPage()
- },
- methods: {
- submit(){
- let that = this;
- that.pageNo = 1;
- that.shopList = [];
- let data = {
- pageNo: that.pageNo,
- pageSize: that.pageSize,
- type : 2,
- longitude: that.longitude,
- latitude: that.latitude,
- name:that.search,
- isRepair:null,
- isCarwash:null,
- }
- console.log(this.pageType === "washCar",'this.pageType === "washCar"');
- if(this.pageType === "washCar"){
- data.isCarwash = 1
- }else{
- data.isRepair = 1
- }
- getSelectStore(data).then(res => {
- that.shopList = that.shopList.concat(res.data.rows)
- that.pageNo++
- })
- },
- getPage(){
- let that = this;
- let data = {
- pageNo: that.pageNo,
- pageSize: that.pageSize,
- isRepair:null,
- isCarwash:null,
- type : 2,
- longitude: that.longitude,
- latitude: that.latitude
- }
- console.log(this.pageType === "washCar",'this.pageType === "washCar"');
- if(this.pageType === "washCar"){
- data.isCarwash = 1
- }else{
- data.isRepair = 1
- }
- getSelectStore(data).then(res => {
- that.shopList = that.shopList.concat(res.data.rows)
- that.pageNo++
- })
- },
- /* routerTo(item) {
- this.$yrouter.push({
- path: "/pages/shop/shopDetail/index?id=" + item.id
- });
- } */
- goBack(datas) {
- console.log(datas);
- if(this.page === 'index'){
- this.$yrouter.push({
- path: "/pages/shop/shopDetail/index?id=" + datas.id
- });
- }else{
- uni.setStorageSync('chooseShop',datas)
- uni.$emit('chooseShop',datas)
- uni.navigateBack({
- delta: 1
- })
- }
- },
- }
- }
- </script>
- <style>
- page {
- background: #EDEDED;
- }
- .classBodyHead {
- height: 31rpx;
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- line-height: 31rpx;
- margin-bottom: 32rpx;
- }
- .classBodyContent {
- width: 370rpx;
- height: 23rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- line-height: 31rpx;
- }
- .viewRight {
- height: calc(100% - 56rpx);
- display: flex;
- align-items: center;
- position: absolute;
- right: 30rpx;
- bottom: 0;
- }
- .location {
- width: 23rpx;
- height: 23rpx;
- }
- .locationNum {
- font-size: 24rpx;
- font-weight: 500;
- color: #333333;
- line-height: 31rpx;
- margin-left: 6rpx;
- }
- .classImg {
- width: 120rpx;
- height: 120rpx;
- background: linear-gradient(135deg, #D10498 0%, #D21728 100%);
- border-radius: 8rpx;
- }
- .classBody {
- display: flex;
- align-items: center;
- }
- .search {
- width: 100%;
- height: 90rpx;
- background: #FFFFFF;
- box-shadow: 0px 1px 0px 0px rgba(55, 55, 55, 0.1);
- }
- .searchCard {
- width: 710rpx;
- height: 70rpx;
- background: #ECECEC;
- border: 1px solid #FFFFFF;
- border-radius: 34rpx;
- margin-left: 20rpx;
- }
- .iconfont {
- font-family: "iconfont" !important;
- font-size: 35rpx;
- font-style: normal;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- background: #ECECEC;
- padding-left: 37rpx;
- line-height: 70rpx;
- border-radius: 34rpx;
- }
- .acea-row {
- display: flex;
- flex-wrap: wrap;
- }
- .co {
- background: #ECECEC;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- }
- .input {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .bnt {
- width: 130rpx;
- height: 58rpx;
- background: linear-gradient(0deg, #005AFF 0%, #0078FF 100%);
- border-radius: 29rpx;
- line-height: 58rpx;
- text-align: center;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- position: relative;
- right: 8rpx;
- }
- .shopBody {
- width: 710rpx;
- height: 170rpx;
- background: #FFFFFF;
- border-radius: 10rpx;
- margin-left: 20rpx;
- margin-top: 20rpx;
- position: relative;
- display: flex;
- align-items: center;
- }
- </style>
|