Browse Source

联调接口

liude 1 year ago
parent
commit
10d203202d

+ 17 - 2
src/api/client/business.js

@@ -15,7 +15,7 @@ export function getSellerList(params) {
   });
 }
 
-// 获取商详情信息
+// 获取商详情信息
 export function getSellsDetail(id, data) {
   return request({
     url: `/maintain/merchant/${id}`,
@@ -77,7 +77,7 @@ export function addFavorite(id) {
     url: `/maintain/merchant/${id}/favorite`,
     method: 'post',
     header: {
-      'Content-Type': 'application/x-www-form-urlencoded',
+      'Content-Type': 'application/json',
     },
   });
 }
@@ -104,6 +104,21 @@ export function cancelFavorite(id) {
   });
 }
 
+/**
+ * 预约接口 -取消预约
+ * @returns
+ */
+
+export function cancelReservation(id) {
+  return request({
+    url: `/maintain/reservation/${id}`,
+    method: 'PUT',
+    header: {
+      'content-type': 'application/json',
+    },
+  });
+}
+
 
 /**
  * 购物车接口 - 新增购物车商品

+ 3 - 3
src/api/client/home.js

@@ -37,9 +37,9 @@ export function getHomePageApi(data) {
 export function getSwiperListApi() {
   return request({
     url: '/maintain/listCarouselImages/',
-    methods: get,
+    method: 'get',
     header: {
-      'content-type': 'application/x-www-form-urlencoded',
+      'content-type': 'application/json',
     },
   });
 }
@@ -50,7 +50,7 @@ export function getSwiperListApi() {
 export function getCategoriesApi() {
   return request({
     url: '/maintain/categories',
-    methods: get,
+    methods: 'get',
     header: {
       'content-type': 'application/x-www-form-urlencoded',
     },

+ 1 - 1
src/components/service/index.vue

@@ -53,7 +53,7 @@ export default {
       this.show = false;
     },
 
-    // 点击跳转
+    // 点击跳转1
     handlerRouterSkip(item) {
       if (this.skipType == 0) {
         uni.navigateTo({

+ 271 - 297
src/pages/client/clientPackage/category.vue

@@ -1,54 +1,24 @@
 <template>
   <view class="u-wrap">
     <view class="u-menu-wrap">
-      <scroll-view
-        scroll-y
-        scroll-with-animation
-        class="u-tab-view menu-scroll-view"
-        :scroll-top="scrollTop"
-        :scroll-into-view="itemId"
-      >
-        <view
-          v-for="(item, index) in cateList"
-          :key="index"
-          class="u-tab-item"
-          :class="[current == index ? 'u-tab-item-active' : '']"
-          @tap.stop="handleLeftMenuClick(index)"
-        >
-          <text class="u-line-1">{{ item.description }}</text>
+      <scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop"
+        :scroll-into-view="itemId">
+        <view v-for="(item, index) in left_first_list" :key="index" class="u-tab-item"
+          :class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="handleLeftMenuClick(index)">
+          <text class="u-line-1">{{ item.name }}</text>
         </view>
       </scroll-view>
 
-      <scroll-view
-        :scroll-top="scrollRightTop"
-        scroll-y
-        scroll-with-animation
-        class="right-box"
-        @scroll="rightScroll"
-      >
+      <scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll">
         <view class="page-view">
-          <view
-            class="class-item"
-            :id="'item' + index"
-            v-for="(item, index) in cateList"
-            :key="index"
-          >
+          <view class="class-item" :id="'item' + index" v-for="(item, index) in left_first_list" :key="index">
             <view class="item-title">
-              <text>{{ item.description }}</text>
+              <text>{{ item.name }}</text>
             </view>
             <view class="item-container">
-              <view
-                class="thumb-box"
-                v-for="(child, childIndex) in item.children"
-                :key="childIndex"
-                @click="handleItemClick(child.id, child.name)"
-              >
-                <image
-                  v-if="child.icon != ''"
-                  class="item-menu-image"
-                  :src="child.icon"
-                  mode=""
-                ></image>
+              <view class="thumb-box" v-for="(child, childIndex) in item.children" :key="childIndex"
+                @click="handleItemClick(child.id, child.name)">
+                <image v-if="child.icon != ''" class="item-menu-image" :src="child.icon" mode=""></image>
                 <view v-else class="item-menu-image row-c" style="background-color: #f4f6f8">
                   <text style="font-size: 20rpx; color: #d0d0d0">加载失败</text>
                 </view>
@@ -63,287 +33,291 @@
 </template>
 
 <script>
-import { buildTree } from '@/utils/tools.js';
-import { maintainCategories } from '@/api/client/business.js';
-export default {
-  data() {
-    return {
-      scrollTop: 0, //tab标题的滚动条位置
-      oldScrollTop: 0, // tab标题的滚动条旧位置
-      current: 0, // 预设当前项的值
-      menuHeight: 0, // 左边菜单的高度
-      menuItemHeight: 0, // 左边菜单item的高度
-      itemId: '', // 栏目右边scroll-view用于滚动的id
-      cateList: [], // 渲染的数据
-      arr: [], // 储存距离顶部高度的数组
-      scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
-      timer: null, // 定时器
-      left_first_list: [], //左侧一级列表
-    };
-  },
-  onLoad() {
-    this.cateList = buildTree(this.getCache('categories'));
-  },
-  onReady() {
-    this.getMenuItemTop();
-  },
-  mounted() {
-    // 获取左侧一级列表信息
-    maintainCategories().then(res => {
-      this.left_first_list = res.data;
-    });
-  },
-  methods: {
-    /**
-     * 获取一个目标元素的高度
-     * @elClass 元素的类名
-     * @dataVal 储存高度的对象
-     */
-    getElRect(elClass, dataVal) {
-      new Promise((resolve, reject) => {
-        const query = uni.createSelectorQuery().in(this);
-        query
-          .select('.' + elClass)
-          .fields(
-            {
-              size: true,
-            },
-            res => {
-              // 如果节点尚未生成,res值为null,循环调用执行
-              if (!res) {
+  import {
+    buildTree
+  } from '@/utils/tools.js';
+  import {
+    maintainCategories
+  } from '@/api/client/business.js';
+  export default {
+    data() {
+      return {
+        scrollTop: 0, //tab标题的滚动条位置
+        oldScrollTop: 0, // tab标题的滚动条旧位置
+        current: 0, // 预设当前项的值
+        menuHeight: 0, // 左边菜单的高度
+        menuItemHeight: 0, // 左边菜单item的高度
+        itemId: '', // 栏目右边scroll-view用于滚动的id
+        cateList: [], // 渲染的数据
+        arr: [], // 储存距离顶部高度的数组
+        scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
+        timer: null, // 定时器
+        left_first_list: [], //左侧一级列表
+      };
+    },
+    onLoad() {
+      // this.cateList = buildTree(this.getCache('categories'));
+    },
+    onReady() {
+      this.getMenuItemTop();
+    },
+    mounted() {
+      // 获取左侧一级列表信息
+      maintainCategories().then(res => {
+        console.log('@@@@res',res);
+        this.left_first_list = res.data;
+      });
+    },
+    methods: {
+      /**
+       * 获取一个目标元素的高度
+       * @elClass 元素的类名
+       * @dataVal 储存高度的对象
+       */
+      getElRect(elClass, dataVal) {
+        new Promise((resolve, reject) => {
+          const query = uni.createSelectorQuery().in(this);
+          query
+            .select('.' + elClass)
+            .fields({
+                size: true,
+              },
+              res => {
+                // 如果节点尚未生成,res值为null,循环调用执行
+                if (!res) {
+                  setTimeout(() => {
+                    this.getElRect(elClass);
+                  }, 10);
+                  return;
+                }
+                this[dataVal] = res.height;
+                resolve();
+              },
+            )
+            .exec();
+        });
+      },
+      /**
+       * 获取右边菜单每个item到顶部的距离
+       * 储存到 arr 数组里面用于后面滚动判断
+       */
+      getMenuItemTop() {
+        new Promise(resolve => {
+          let selectorQuery = uni.createSelectorQuery();
+          selectorQuery
+            .selectAll('.class-item')
+            .boundingClientRect(rects => {
+              // 如果节点尚未生成,rects值为[](因为用selectAll,所以返回的是数组),循环调用执行
+              if (!rects.length) {
                 setTimeout(() => {
-                  this.getElRect(elClass);
+                  this.getMenuItemTop();
                 }, 10);
                 return;
               }
-              this[dataVal] = res.height;
-              resolve();
-            },
-          )
-          .exec();
-      });
-    },
-    /**
-     * 获取右边菜单每个item到顶部的距离
-     * 储存到 arr 数组里面用于后面滚动判断
-     */
-    getMenuItemTop() {
-      new Promise(resolve => {
-        let selectorQuery = uni.createSelectorQuery();
-        selectorQuery
-          .selectAll('.class-item')
-          .boundingClientRect(rects => {
-            // 如果节点尚未生成,rects值为[](因为用selectAll,所以返回的是数组),循环调用执行
-            if (!rects.length) {
-              setTimeout(() => {
-                this.getMenuItemTop();
-              }, 10);
-              return;
-            }
-            rects.forEach(rect => {
-              // 视情况而定,这里减去rects[0].top,是因为第一项顶部可能不是贴到导航栏(比如有个搜索框的情况)
-              // this.arr.push(rect.top - rects[0].top);
-              this.arr.push(rect.top);
-              resolve();
+              rects.forEach(rect => {
+                // 视情况而定,这里减去rects[0].top,是因为第一项顶部可能不是贴到导航栏(比如有个搜索框的情况)
+                // this.arr.push(rect.top - rects[0].top);
+                this.arr.push(rect.top);
+                resolve();
+              });
+            })
+            .exec();
+        });
+      },
+      /**
+       * 观测元素相交状态
+       * 检测右边scroll-view的id为itemxx的元素与right-box的相交状态
+       * 如果跟.right-box底部相交,就动态设置左边栏目的活动状态
+       */
+      async observer() {
+        this.cateList.map((val, index) => {
+          let observer = uni.createIntersectionObserver(this);
+          observer
+            .relativeTo('.right-box', {
+              top: 0,
+            })
+            .observe('#item' + index, res => {
+              if (res.intersectionRatio > 0) {
+                let id = res.id.substring(4);
+                this.leftMenuStatus(id);
+              }
             });
-          })
-          .exec();
-      });
-    },
-    /**
-     * 观测元素相交状态
-     * 检测右边scroll-view的id为itemxx的元素与right-box的相交状态
-     * 如果跟.right-box底部相交,就动态设置左边栏目的活动状态
-     */
-    async observer() {
-      this.cateList.map((val, index) => {
-        let observer = uni.createIntersectionObserver(this);
-        observer
-          .relativeTo('.right-box', {
-            top: 0,
-          })
-          .observe('#item' + index, res => {
-            if (res.intersectionRatio > 0) {
-              let id = res.id.substring(4);
-              this.leftMenuStatus(id);
-            }
-          });
-      });
-    },
-    /**
-     * 设置左边菜单的滚动状态
-     * @index 传入的 ID
-     */
-    async leftMenuStatus(index) {
-      this.current = index;
-      // 如果为0,意味着尚未初始化
-      if (this.menuHeight == 0 || this.menuItemHeight == 0) {
-        await this.getElRect('menu-scroll-view', 'menuHeight');
-        await this.getElRect('u-tab-item', 'menuItemHeight');
-      }
-      // 将菜单活动item垂直居中
-      this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2;
-    },
-    /**
-     * 点击左边的栏目切换
-     * @index 传入的 ID
-     */
-    async handleLeftMenuClick(index) {
-      if (this.arr.length == 0) {
-        await this.getMenuItemTop();
-      }
-      if (index == this.current) return;
-      this.scrollRightTop = this.oldScrollTop;
-      this.$nextTick(function () {
-        this.scrollRightTop = this.arr[index];
+        });
+      },
+      /**
+       * 设置左边菜单的滚动状态
+       * @index 传入的 ID
+       */
+      async leftMenuStatus(index) {
         this.current = index;
-        this.leftMenuStatus(index);
-      });
-    },
-    /**
-     * 右边菜单滚动
-     * 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可
-     */
-    async rightScroll(e) {
-      this.oldScrollTop = e.detail.scrollTop;
-      if (this.arr.length == 0) {
-        await this.getMenuItemTop();
-      }
-      if (this.timer) return;
-      if (!this.menuHeight) {
-        await this.getElRect('menu-scroll-view', 'menuHeight');
-      }
-      setTimeout(() => {
-        // 节流
-        this.timer = null;
-        // scrollHeight为右边菜单垂直中点位置
-        // let scrollHeight = e.detail.scrollTop + this.menuHeight / 2;
-        // scrollHeight为右边菜单头部位置
-        let scrollHeight = e.detail.scrollTop + 20;
-        for (let i = 0; i < this.arr.length; i++) {
-          let height1 = this.arr[i];
-          let height2 = this.arr[i + 1];
-          if (!height2 || (scrollHeight >= height1 && scrollHeight < height2)) {
-            this.leftMenuStatus(i);
-            return;
-          }
+        // 如果为0,意味着尚未初始化
+        if (this.menuHeight == 0 || this.menuItemHeight == 0) {
+          await this.getElRect('menu-scroll-view', 'menuHeight');
+          await this.getElRect('u-tab-item', 'menuItemHeight');
         }
-      }, 10);
-    },
-    handleItemClick(id, name) {
-      this.$Router.push(`/pages/client/clientPackage/storeList?id=${id}`);
+        // 将菜单活动item垂直居中
+        this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2;
+      },
+      /**
+       * 点击左边的栏目切换
+       * @index 传入的 ID
+       */
+      async handleLeftMenuClick(index) {
+        if (this.arr.length == 0) {
+          await this.getMenuItemTop();
+        }
+        if (index == this.current) return;
+        this.scrollRightTop = this.oldScrollTop;
+        this.$nextTick(function() {
+          this.scrollRightTop = this.arr[index];
+          this.current = index;
+          this.leftMenuStatus(index);
+        });
+      },
+      /**
+       * 右边菜单滚动
+       * 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可
+       */
+      async rightScroll(e) {
+        this.oldScrollTop = e.detail.scrollTop;
+        if (this.arr.length == 0) {
+          await this.getMenuItemTop();
+        }
+        if (this.timer) return;
+        if (!this.menuHeight) {
+          await this.getElRect('menu-scroll-view', 'menuHeight');
+        }
+        setTimeout(() => {
+          // 节流
+          this.timer = null;
+          // scrollHeight为右边菜单垂直中点位置
+          // let scrollHeight = e.detail.scrollTop + this.menuHeight / 2;
+          // scrollHeight为右边菜单头部位置
+          let scrollHeight = e.detail.scrollTop + 20;
+          for (let i = 0; i < this.arr.length; i++) {
+            let height1 = this.arr[i];
+            let height2 = this.arr[i + 1];
+            if (!height2 || (scrollHeight >= height1 && scrollHeight < height2)) {
+              this.leftMenuStatus(i);
+              return;
+            }
+          }
+        }, 10);
+      },
+      handleItemClick(id, name) {
+        this.$Router.push(`/pages/client/clientPackage/storeList?id=${id}`);
+      },
     },
-  },
-};
+  };
 </script>
 
 <style scoped>
-.u-wrap {
-  /* #ifdef H5 */
-  height: calc(100vh - var(--window-top));
-  /* #endif */
-  display: flex;
-  flex-direction: column;
-  height: 100vh;
-}
+  .u-wrap {
+    /* #ifdef H5 */
+    height: calc(100vh - var(--window-top));
+    /* #endif */
+    display: flex;
+    flex-direction: column;
+    height: 100vh;
+  }
 
-.u-search-box {
-  padding: 18rpx 30rpx;
-}
+  .u-search-box {
+    padding: 18rpx 30rpx;
+  }
 
-.u-menu-wrap {
-  flex: 1;
-  display: flex;
-  overflow: hidden;
-}
+  .u-menu-wrap {
+    flex: 1;
+    display: flex;
+    overflow: hidden;
+  }
 
-.u-tab-view {
-  width: 200rpx;
-  height: 100%;
-}
+  .u-tab-view {
+    width: 200rpx;
+    height: 100%;
+  }
 
-.u-tab-item {
-  height: 110rpx;
-  background: #f6f6f6;
-  box-sizing: border-box;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  font-size: 26rpx;
-  color: #444;
-  font-weight: 400;
-  line-height: 1;
-}
+  .u-tab-item {
+    height: 110rpx;
+    background: #f6f6f6;
+    box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    font-size: 26rpx;
+    color: #444;
+    font-weight: 400;
+    line-height: 1;
+  }
 
-.u-tab-item-active {
-  position: relative;
-  color: #06a446;
-  font-size: 30rpx;
-  font-weight: 500;
-  background: #d6ffe7;
-}
+  .u-tab-item-active {
+    position: relative;
+    color: #06a446;
+    font-size: 30rpx;
+    font-weight: 500;
+    background: #d6ffe7;
+  }
 
-.u-tab-item-active::before {
-  content: '';
-  position: absolute;
-  border-left: 4px solid #06a446;
-  height: 52rpx;
-  left: 0;
-  top: 29rpx;
-}
+  .u-tab-item-active::before {
+    content: '';
+    position: absolute;
+    border-left: 4px solid #06a446;
+    height: 52rpx;
+    left: 0;
+    top: 29rpx;
+  }
 
-.u-tab-view {
-  height: 100%;
-}
+  .u-tab-view {
+    height: 100%;
+  }
 
-.right-box {
-  background-color: rgb(250, 250, 250);
-}
+  .right-box {
+    background-color: rgb(250, 250, 250);
+  }
 
-.page-view {
-  padding: 16rpx;
-}
+  .page-view {
+    padding: 16rpx;
+  }
 
-.class-item {
-  margin-bottom: 30rpx;
-  background-color: #fff;
-  padding: 16rpx;
-  border-radius: 8rpx;
-}
+  .class-item {
+    margin-bottom: 30rpx;
+    background-color: #fff;
+    padding: 16rpx;
+    border-radius: 8rpx;
+  }
 
-.class-item:last-child {
-  min-height: 100vh;
-}
+  .class-item:last-child {
+    min-height: 100vh;
+  }
 
-.item-title {
-  font-size: 26rpx;
-  color: #06a446;
-  font-weight: bold;
-}
+  .item-title {
+    font-size: 26rpx;
+    color: #06a446;
+    font-weight: bold;
+  }
 
-.item-menu-name {
-  margin-top: 8rpx;
-  font-weight: normal;
-  font-size: 24rpx;
-  color: #06a446;
-}
+  .item-menu-name {
+    margin-top: 8rpx;
+    font-weight: normal;
+    font-size: 24rpx;
+    color: #06a446;
+  }
 
-.item-container {
-  display: flex;
-  flex-wrap: wrap;
-}
+  .item-container {
+    display: flex;
+    flex-wrap: wrap;
+  }
 
-.thumb-box {
-  width: 33.333333%;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  flex-direction: column;
-  margin-top: 20rpx;
-}
+  .thumb-box {
+    width: 33.333333%;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-direction: column;
+    margin-top: 20rpx;
+  }
 
-.item-menu-image {
-  width: 120rpx;
-  height: 120rpx;
-}
+  .item-menu-image {
+    width: 120rpx;
+    height: 120rpx;
+  }
 </style>

+ 1 - 1
src/pages/client/clientPackage/serviceDetail/index.vue

@@ -208,7 +208,7 @@
             break;
         }
       },
-      // 点击收藏
+      // 点击收藏1
       handlerFavorite() {
         if(this.goods.favorites){
           cancelFavorite(this.id).then(res => {

+ 40 - 4
src/pages/client/clientPackage/storeDetail.vue

@@ -28,7 +28,7 @@
         </view>
         <view class="info-icon">
           <view class="info-map" @click="handlerFavouriteShop">
-            <u-icon class="user-operate-icon" name='heart' size="24" />
+            <u-icon class="user-operate-icon" :name="merchant.favorites ? 'heart-fill' : 'heart' " size="24" />
             <view style="font-size: 20rpx; margin-top: 5rpx">收藏</view>
           </view>
           <view class="info-map">
@@ -69,7 +69,9 @@
               <text class="line">|</text>
               <text class="points">{{ item.score }}分</text>
             </view>
-            <view>{{ item.score }}单</view>
+            <view>
+            <!-- {{ item.score }}单 -->
+            </view>
           </view>
           <view class="list-item">
             <view class="list-price">
@@ -130,7 +132,9 @@
     getSellsDetail,
     addReservation,
     addShoppingCart,
-    getCartList
+    getCartList,
+    addFavorite,
+    cancelFavorite
   } from '@/api/client/business.js';
   import {
     getCurrentLocation,
@@ -315,7 +319,39 @@
       },
       // 收藏按钮
       handlerFavouriteShop() {
-
+        if(this.merchant.favorites){
+          cancelFavorite(this.ids).then(res=>{
+            if(res.code == 200){
+              this.handlerInitList()
+              uni.showToast({
+                title:'取消成功',
+                icon:'none'
+              })
+            }else{
+              uni.showToast({
+                title:res.msg,
+                icon:'none'
+              })
+              return
+            }
+          })
+        }else{
+          addFavorite(this.ids).then(res=>{
+            if(res.code == 200){
+              this.handlerInitList()
+              uni.showToast({
+                title:'收藏成功',
+                icon:'none'
+              })
+            }else{
+              uni.showToast({
+                title:res.msg,
+                icon:'none'
+              })
+              return
+            }
+          })
+        }
       },
       // 添加购物车
       handlerAddCart(e) {

+ 436 - 431
src/pages/client/clientPackage/storeList.vue

@@ -1,438 +1,443 @@
 <template>
-	<view class="container" @click="filterShow = false">
-		<view class="top-box">
-			<view class="search-box">
-				<view class="search-left">
-					<u-search placeholder="请输入搜索内容" :showAction="false" v-model="keyword" />
-				</view>
-				<view class="search-right">取消</view>
-			</view>
-			<view class="filter-box">
-				<view class="filter-item">
-					<view class="fiter1">
-						<u-icon name="map"></u-icon>
-						<span class="filter-l">贵阳市青少年人才社区</span>
-						<u-icon name="arrow-down-fill"></u-icon>
-					</view>
-					<view class="fiter2" @tap.stop="handlerSelectAllFilter(2)">
-						<span>{{ sortCondition }}</span>
-						<u-icon name="arrow-down-fill"></u-icon>
-					</view>
-					<view class="fiter1" @tap.stop="handlerSelectMenu(1)">
-						<span>筛选</span>
-						<u-icon name="arrow-down-fill"></u-icon>
-					</view>
-				</view>
-				<view class="filter-drapdown" v-show="filterShow">
-					<view class="filter1" v-show="filterType == 1">
-						<view class="scroll-box">
-							<scroll-view :scroll-top="scrollTop" scroll-y="true" class="filter-menu-left scroll-Y"
-								@scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll">
-								<view id="demo1" class="scroll-view-item uni-bg-red menu-item"
-									:class="current == index ? 'act-left-menu' : ''" v-for="(item, index) of menuList"
-									:key="index" @click.stop="handlerSelectLMenu(item, index)">{{ item.name }}
-								</view>
-							</scroll-view>
-							<scroll-view :scroll-top="scrollTop" scroll-y="true" class="filter-menu-right scroll-Y"
-								@scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll">
-								<view id="demo1" class="scroll-view-item uni-bg-red" v-for="item of 15" :key="item">
-									<view class="menu-right-title">洗车</view>
-									<view class="menu-right-contentbox">
-										<span class="menu-item" v-for="item of 7" :key="item">测试</span>
-									</view>
-								</view>
-							</scroll-view>
-						</view>
-					</view>
-					<view class="filter2" v-show="filterType == 2">
-						<view @tap="sellerListFillter(1)">离我最近</view>
-						<view @tap="sellerListFillter(2)">好评优先</view>
-						<view @tap="sellerListFillter(3)">销量优先</view>
-					</view>
-				</view>
-			</view>
-		</view>
-
-		<view class="content-box">
-			<view class="content-item" v-for="(item, index) in sellerList" :key="index" @tap="goSellerDetail(item.id)">
-				<view class="item-left">
-					<!-- <image class="img" :src="item.logo" mode="aspectFit"></image> -->
-					<image class="img"
-						:src="error || !loaded ? 'https://cdn.uviewui.com/uview/album/10.jpg' : item.logo"
-						mode="scaleToFill"></image>
-				</view>
-				<view class="item-right">
-					<view>
-						<view class="item-title">
-							<view class="tag">常去</view>
-							<view class="title">{{ `${item.name}(${item.address})` }}</view>
-						</view>
-						<view class="str-box">
-							<view class="srt-left">
-								<u-rate activeColor="#fc8400" :value="item.score" readonly></u-rate>
-								<text>{{ item.score }}</text>
-							</view>
-							<view class="border"></view>
-							<view class="srt-right">{{ item.sale }}单</view>
-						</view>
-					</view>
-
-					<view class="bottom-textbox">
-						<view class="bottom-left">宝安中心区美容洗车</view>
-						<view class="bottom-right">{{ (item.distance / 1000).toFixed(2) }}KM</view>
-					</view>
-				</view>
-			</view>
-			<u-empty v-if="sellerList.length == 0" mode="data"
-				icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty>
-		</view>
-	</view>
+  <view class="container" @click="filterShow = false">
+    <view class="top-box">
+      <view class="search-box">
+        <view class="search-left">
+          <u-search placeholder="请输入搜索内容" :showAction="false" v-model="sellerListParams.keyword" />
+        </view>
+        <view class="search-right" @click='handlerSearch'>搜索</view>
+      </view>
+      <view class="filter-box">
+        <view class="filter-item">
+          <view class="fiter1">
+            <u-icon name="map"></u-icon>
+            <span class="filter-l">贵阳市青少年人才社区</span>
+            <u-icon name="arrow-down-fill"></u-icon>
+          </view>
+          <view class="fiter2" @tap.stop="handlerSelectAllFilter(2)">
+            <span>{{ sortCondition }}</span>
+            <u-icon name="arrow-down-fill"></u-icon>
+          </view>
+          <view class="fiter1" @tap.stop="handlerSelectMenu(1)">
+            <span>筛选</span>
+            <u-icon name="arrow-down-fill"></u-icon>
+          </view>
+        </view>
+        <view class="filter-drapdown" v-show="filterShow">
+          <view class="filter1" v-show="filterType == 1">
+            <view class="scroll-box">
+              <scroll-view :scroll-top="scrollTop" scroll-y="true" class="filter-menu-left scroll-Y"
+                @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll">
+                <view id="demo1" class="scroll-view-item uni-bg-red menu-item"
+                  :class="current == index ? 'act-left-menu' : ''" v-for="(item, index) of menuList" :key="index"
+                  @click.stop="handlerSelectLMenu(item, index)">{{ item.name }}
+                </view>
+              </scroll-view>
+              <scroll-view :scroll-top="scrollTop" scroll-y="true" class="filter-menu-right scroll-Y"
+                @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll">
+                <view id="demo1" class="scroll-view-item uni-bg-red" v-for="item of 15" :key="item">
+                  <view class="menu-right-title">洗车</view>
+                  <view class="menu-right-contentbox">
+                    <span class="menu-item" v-for="item of 7" :key="item">测试</span>
+                  </view>
+                </view>
+              </scroll-view>
+            </view>
+          </view>
+          <view class="filter2" v-show="filterType == 2">
+            <view @tap="sellerListFillter(1)">离我最近</view>
+            <view @tap="sellerListFillter(2)">好评优先</view>
+            <view @tap="sellerListFillter(3)">销量优先</view>
+          </view>
+        </view>
+      </view>
+    </view>
+
+    <view class="content-box">
+      <view class="content-item" v-for="(item, index) in sellerList" :key="index" @tap="goSellerDetail(item.id)">
+        <view class="item-left">
+          <!-- <image class="img" :src="item.logo" mode="aspectFit"></image> -->
+          <image class="img" :src="error || !loaded ? 'https://cdn.uviewui.com/uview/album/10.jpg' : item.logo"
+            mode="scaleToFill"></image>
+        </view>
+        <view class="item-right">
+          <view>
+            <view class="item-title">
+              <view class="tag">常去</view>
+              <view class="title">{{ `${item.name}(${item.address})` }}</view>
+            </view>
+            <view class="str-box">
+              <view class="srt-left">
+                <u-rate activeColor="#fc8400" :value="item.score" readonly></u-rate>
+                <text>{{ item.score }}</text>
+              </view>
+              <view class="border"></view>
+              <view class="srt-right">{{ item.sale }}单</view>
+            </view>
+          </view>
+
+          <view class="bottom-textbox">
+            <view class="bottom-left">宝安中心区美容洗车</view>
+            <view class="bottom-right">{{ (item.distance / 1000).toFixed(2) }}KM</view>
+          </view>
+        </view>
+      </view>
+      <u-empty v-if="sellerList.length == 0" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty>
+    </view>
+  </view>
 </template>
 
 <script>
-	import {
-		getSellerList
-	} from '@/api/client/business.js';
-	import {
-		getCurrentLocation
-	} from '@/api/client/home.js';
-	import {
-		mapState
-	} from 'vuex';
-	export default {
-		async mounted() {
-			let data = {
-				longitude: this.longitude,
-				latitude: this.latitude,
-			};
-			try {
-				let obj = await getCurrentLocation(data);
-				this.sellerListParams.region = obj.data.id;
-				this.getData();
-			} catch (e) {}
-		},
-		computed: {
-			...mapState({
-				longitude: state => state.data.location.longitude,
-				latitude: state => state.data.location.latitude,
-			}),
-		},
-		data() {
-			return {
-				filterShow: false,
-				filterType: 0,
-				sortCondition: '综合排序',
-				current: 0,
-				menuList: [{
-						name: '汽车',
-					},
-					{
-						name: '汽车2',
-					},
-					{
-						name: '汽车3',
-					},
-					{
-						name: '汽车4',
-					},
-				],
-				sellerList: [],
-				sellerListParams: {
-					longitude: '',
-					latitude: '',
-					sort: 'SYNTHESE',
-					size: 10,
-					region: '', //地区编码
-					keyword: '', //关键字
-					categoryId: '', //分类ID
-				},
-			};
-		},
-		onLoad(option) {
-			this.sellerListParams.categoryId = option.id;
-		},
-		methods: {
-			// 点击综合排序
-			handlerSelectAllFilter(e) {
-				this.filterShow = true;
-				this.filterType = 2;
-			},
-			// 排序条件
-			sellerListFillter(e) {
-				switch (e) {
-					case 1:
-						this.sortCondition = '离我最近';
-						this.sellerListParams.sort = 'NEAREST';
-						break;
-					case 2:
-						this.sortCondition = '好评优先';
-						this.sellerListParams.sort = 'FAVORITE';
-						break;
-					case 3:
-						this.sortCondition = '销量优先';
-						this.sellerListParams.sort = 'BESTSELLING';
-						break;
-					default:
-						break;
-				}
-				this.getData();
-			},
-			// 获取初始化列表
-			getData() {
-				this.sellerListParams.latitude = this.latitude;
-				this.sellerListParams.longitude = this.longitude;
-				getSellerList(this.sellerListParams)
-					.then(res => {
-						this.sellerList = res.data;
-					})
-					.catch(err => {});
-			},
-			// 点击进入详情
-			goSellerDetail(id) {
-				uni.navigateTo({
-					url: `/pages/client/clientPackage/storeDetail?id=${id}`,
-				});
-			},
-			//
-			handlerSelectMenu(e) {
-				this.filterShow = true;
-				this.filterType = 1;
-			},
-			// 选择左侧菜单
-			handlerSelectLMenu(item, index) {
-				this.current = index;
-			},
-			scroll() {},
-			lower() {},
-			upper() {},
-		},
-	};
+  import {
+    getSellerList
+  } from '@/api/client/business.js';
+  import {
+    getCurrentLocation
+  } from '@/api/client/home.js';
+  import {
+    mapState
+  } from 'vuex';
+  export default {
+    async mounted() {
+      // let data = {
+      //   longitude: this.longitude,
+      //   latitude: this.latitude,
+      // };
+      // try {
+      //   let obj = await getCurrentLocation(data);
+      //   this.sellerListParams.region = obj.data.id;
+      //   this.getData();
+      // } catch (e) {}
+
+      // 微信小程序获取当前经纬度 - 暂定
+      this.getData();
+    },
+    computed: {
+      ...mapState({
+        longitude: state => state.data.location.longitude,
+        latitude: state => state.data.location.latitude,
+      }),
+    },
+    data() {
+      return {
+        filterShow: false,
+        filterType: 0,
+        sortCondition: '综合排序',
+        current: 0,
+        menuList: [{
+            name: '汽车',
+          },
+          {
+            name: '汽车2',
+          },
+          {
+            name: '汽车3',
+          },
+          {
+            name: '汽车4',
+          },
+        ],
+        sellerList: [],
+        sellerListParams: {
+          longitude: '',
+          latitude: '',
+          sort: 'SYNTHESE',
+          size: 10,
+          region: '370705', //地区编码
+          keyword: '', //关键字
+          categoryId: '', //分类ID
+        },
+      };
+    },
+    onLoad(option) {
+      this.sellerListParams.categoryId = option.id;
+    },
+    methods: {
+      // 点击综合排序
+      handlerSelectAllFilter(e) {
+        this.filterShow = true;
+        this.filterType = 2;
+      },
+      // 排序条件
+      sellerListFillter(e) {
+        switch (e) {
+          case 1:
+            this.sortCondition = '离我最近';
+            this.sellerListParams.sort = 'NEAREST';
+            break;
+          case 2:
+            this.sortCondition = '好评优先';
+            this.sellerListParams.sort = 'FAVORITE';
+            break;
+          case 3:
+            this.sortCondition = '销量优先';
+            this.sellerListParams.sort = 'BESTSELLING';
+            break;
+          default:
+            break;
+        }
+        this.getData();
+      },
+      // 获取初始化列表
+      getData() {
+        this.sellerListParams.latitude = this.latitude;
+        this.sellerListParams.longitude = this.longitude;
+        getSellerList(this.sellerListParams)
+          .then(res => {
+            this.sellerList = res.data;
+          })
+          .catch(err => {});
+      },
+      // 点击进入详情
+      goSellerDetail(id) {
+        uni.navigateTo({
+          url: `/pages/client/clientPackage/storeDetail?id=${id}`,
+        });
+      },
+      //
+      handlerSelectMenu(e) {
+        this.filterShow = true;
+        this.filterType = 1;
+      },
+      // 选择左侧菜单
+      handlerSelectLMenu(item, index) {
+        this.current = index;
+      },
+      scroll() {},
+      lower() {},
+      upper() {},
+      // 搜索
+      handlerSearch(){
+        this.getData()
+      }
+    },
+  };
 </script>
 
 <style lang="scss" scoped>
-	.container {
-		min-height: 100vh;
-		background-color: #efefef;
-
-		.top-box {
-			width: 100%;
-			background-color: #fff;
-			padding: 10rpx 20rpx;
-			box-sizing: border-box;
-
-			.search-box {
-				display: flex;
-				justify-content: space-around;
-				align-items: center;
-
-				.search-left {
-					width: 80%;
-				}
-
-				.search-right {
-					text-align: center;
-				}
-			}
-
-			.filter-box {
-				margin-top: 20rpx;
-
-				.filter-item {
-					display: flex;
-					justify-content: space-between;
-
-					.fiter1,
-					.fiter2 {
-						display: flex;
-						align-items: center;
-					}
-
-					.filter-l {
-						width: 200rpx;
-						overflow: hidden;
-						text-overflow: ellipsis;
-						white-space: nowrap;
-					}
-
-					.fiter1 {
-						color: #808080;
-						font-size: 24rpx;
-					}
-
-					.fiter2 {}
-				}
-
-				.filter-drapdown {
-					position: fixed;
-					left: 0;
-					width: 100%;
-					background-color: #fff;
-					// height: 300rpx;
-					z-index: 999;
-					box-shadow: 0 10rpx 20rpx -5rpx rgba(0, 0, 0, 0.2);
-
-					.filter1 {
-						.scroll-box {
-							display: flex;
-							max-height: 1200rpx;
-
-							.filter-menu-left {
-								width: 30%;
-								background-color: #ebebeb;
-								overflow-y: scroll;
-
-								.menu-item {
-									width: 100%;
-									height: 100rpx;
-									text-align: center;
-									line-height: 100rpx;
-									font-size: 30rpx;
-									background-color: #ebebeb;
-									color: #5a5a5a;
-								}
-
-								.act-left-menu {
-									background-color: #fff;
-									color: #5992bb;
-									border-right: 8rpx solid #5992bb !important;
-								}
-							}
-
-							.filter-menu-right {
-								background-color: #fff;
-								padding: 10rpx 20rpx;
-								box-sizing: border-box;
-								width: 70%;
-								overflow-y: scroll;
-
-								.menu-right-title {
-									font-size: 30rpx;
-									color: #000;
-									margin-bottom: 10rpx;
-								}
-
-								.menu-right-contentbox {
-									padding: 0 0 0 30rpx;
-									display: flex;
-									justify-content: left;
-									flex-wrap: wrap;
-
-									.menu-item {
-										// width: 100rpx;
-										padding: 0 20rpx;
-										height: 40rpx;
-										background-color: #cccccc;
-										color: #000;
-										text-align: center;
-										line-height: 40rpx;
-										margin: 10rpx 20rpx;
-									}
-								}
-							}
-						}
-					}
-
-					.filter2 {
-						padding: 20rpx 50rpx;
-						box-sizing: border-box;
-
-						view {
-							margin: 30rpx 0;
-						}
-					}
-				}
-			}
-		}
-
-		.content-box {
-			width: 100%;
-
-			.content-item {
-				background-color: #fff;
-				padding: 10rpx 20rpx;
-				box-sizing: border-box;
-				margin: 10rpx 0;
-				display: flex;
-
-				.item-left {
-					margin-right: 10rpx;
-
-					.img {
-						width: 200rpx;
-						height: 200rpx;
-						border-radius: 10rpx;
-					}
-				}
-
-				.item-right {
-					height: 200rpx;
-					align-content: space-between;
-
-					.item-title {
-						display: flex;
-						align-items: center;
-
-						.tag {
-							width: 80rpx;
-							height: 46rpx;
-							line-height: 35rpx;
-							padding: 4rpx;
-							font-size: 22rpx;
-							box-sizing: border-box;
-							background-color: #f6e7d4;
-							color: #f99a47;
-							border: 2rpx solid #f99a47;
-							text-align: center;
-							// align-items: center;
-							margin-right: 10rpx;
-						}
-
-						.title {
-							width: 85%;
-							font-size: 30rpx;
-							color: #000;
-							font-weight: bold;
-							overflow: hidden;
-							text-overflow: ellipsis;
-							display: -webkit-box;
-							-webkit-line-clamp: 2;
-							-webkit-box-orient: vertical;
-						}
-					}
-
-					.str-box {
-						display: flex;
-						margin-top: 10rpx;
-
-						.srt-left {
-							display: flex;
-							color: #fc8400;
-						}
-
-						.border {
-							border-left: 2rpx solid #cfcfcf;
-							margin: 0 20rpx;
-						}
-
-						.srt-right {}
-					}
-
-					.bottom-textbox {
-						display: flex;
-						justify-content: space-between;
-						font-size: 26rpx;
-						margin-top: 40rpx;
-
-						.bottom-left {
-							color: #c7c7c7;
-						}
-
-						.bottom-right {
-							color: #000;
-						}
-					}
-				}
-			}
-		}
-	}
-</style>
+  .container {
+    min-height: 100vh;
+    background-color: #efefef;
+
+    .top-box {
+      width: 100%;
+      background-color: #fff;
+      padding: 10rpx 20rpx;
+      box-sizing: border-box;
+
+      .search-box {
+        display: flex;
+        justify-content: space-around;
+        align-items: center;
+
+        .search-left {
+          width: 80%;
+        }
+
+        .search-right {
+          text-align: center;
+        }
+      }
+
+      .filter-box {
+        margin-top: 20rpx;
+
+        .filter-item {
+          display: flex;
+          justify-content: space-between;
+
+          .fiter1,
+          .fiter2 {
+            display: flex;
+            align-items: center;
+          }
+
+          .filter-l {
+            width: 200rpx;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+          }
+
+          .fiter1 {
+            color: #808080;
+            font-size: 24rpx;
+          }
+
+          .fiter2 {}
+        }
+
+        .filter-drapdown {
+          position: fixed;
+          left: 0;
+          width: 100%;
+          background-color: #fff;
+          // height: 300rpx;
+          z-index: 999;
+          box-shadow: 0 10rpx 20rpx -5rpx rgba(0, 0, 0, 0.2);
+
+          .filter1 {
+            .scroll-box {
+              display: flex;
+              max-height: 1200rpx;
+
+              .filter-menu-left {
+                width: 30%;
+                background-color: #ebebeb;
+                overflow-y: scroll;
+
+                .menu-item {
+                  width: 100%;
+                  height: 100rpx;
+                  text-align: center;
+                  line-height: 100rpx;
+                  font-size: 30rpx;
+                  background-color: #ebebeb;
+                  color: #5a5a5a;
+                }
+
+                .act-left-menu {
+                  background-color: #fff;
+                  color: #5992bb;
+                  border-right: 8rpx solid #5992bb !important;
+                }
+              }
+
+              .filter-menu-right {
+                background-color: #fff;
+                padding: 10rpx 20rpx;
+                box-sizing: border-box;
+                width: 70%;
+                overflow-y: scroll;
+
+                .menu-right-title {
+                  font-size: 30rpx;
+                  color: #000;
+                  margin-bottom: 10rpx;
+                }
+
+                .menu-right-contentbox {
+                  padding: 0 0 0 30rpx;
+                  display: flex;
+                  justify-content: left;
+                  flex-wrap: wrap;
+
+                  .menu-item {
+                    // width: 100rpx;
+                    padding: 0 20rpx;
+                    height: 40rpx;
+                    background-color: #cccccc;
+                    color: #000;
+                    text-align: center;
+                    line-height: 40rpx;
+                    margin: 10rpx 20rpx;
+                  }
+                }
+              }
+            }
+          }
+
+          .filter2 {
+            padding: 20rpx 50rpx;
+            box-sizing: border-box;
+
+            view {
+              margin: 30rpx 0;
+            }
+          }
+        }
+      }
+    }
+
+    .content-box {
+      width: 100%;
+
+      .content-item {
+        background-color: #fff;
+        padding: 10rpx 20rpx;
+        box-sizing: border-box;
+        margin: 10rpx 0;
+        display: flex;
+
+        .item-left {
+          margin-right: 10rpx;
+
+          .img {
+            width: 200rpx;
+            height: 200rpx;
+            border-radius: 10rpx;
+          }
+        }
+
+        .item-right {
+          height: 200rpx;
+          align-content: space-between;
+
+          .item-title {
+            display: flex;
+            align-items: center;
+
+            .tag {
+              width: 80rpx;
+              height: 46rpx;
+              line-height: 35rpx;
+              padding: 4rpx;
+              font-size: 22rpx;
+              box-sizing: border-box;
+              background-color: #f6e7d4;
+              color: #f99a47;
+              border: 2rpx solid #f99a47;
+              text-align: center;
+              // align-items: center;
+              margin-right: 10rpx;
+            }
+
+            .title {
+              width: 85%;
+              font-size: 30rpx;
+              color: #000;
+              font-weight: bold;
+              overflow: hidden;
+              text-overflow: ellipsis;
+              display: -webkit-box;
+              -webkit-line-clamp: 2;
+              -webkit-box-orient: vertical;
+            }
+          }
+
+          .str-box {
+            display: flex;
+            margin-top: 10rpx;
+
+            .srt-left {
+              display: flex;
+              color: #fc8400;
+            }
+
+            .border {
+              border-left: 2rpx solid #cfcfcf;
+              margin: 0 20rpx;
+            }
+
+            .srt-right {}
+          }
+
+          .bottom-textbox {
+            display: flex;
+            justify-content: space-between;
+            font-size: 26rpx;
+            margin-top: 40rpx;
+
+            .bottom-left {
+              color: #c7c7c7;
+            }
+
+            .bottom-right {
+              color: #000;
+            }
+          }
+        }
+      }
+    }
+  }
+</style>

+ 30 - 15
src/pages/client/clientPackage/uptickOrder.vue

@@ -61,12 +61,12 @@
 					<view class="coupon-right red-color"> -0.1 </view>
 				</view>
 				<u-line margin='20rpx 0'></u-line>
-				<view class="couon-box">
+				<view class="couon-box" @click="openCouponshow">
 					<view class="coupon-left">
 						<image class="img" src='@/static/images/coupon.png'></image>
 						<span>商家优惠券</span>
 					</view>
-					<view class="coupon-right" @click="coupon_show = true">
+					<view class="coupon-right" >
 						<view class="">暂无可用</view>
 						<u-icon name="arrow-right" size='13'></u-icon>
 					</view>
@@ -93,7 +93,7 @@
 			</view>
 		</view>
 
-		<u-popup :show="coupon_show" @close="coupon_show = false" mode='bottom' round='20' bgColor='#F4F4F4'>
+		<u-popup :show="coupon_show" @close="close" mode='bottom' round='20' bgColor='#F4F4F4'>
 			<view class="pop-box">
 				<view class="pop-title"> 商家优惠券 </view>
 				<u-line margin='20rpx 0'></u-line>
@@ -124,7 +124,7 @@
 				</view>
 
         <view class="pop-bottom">
-          <button class='coupon-btn' >确定</button>
+          <button class='coupon-btn' @click="handlerSelectCoupon">确定</button>
         </view>
 			</view>
 		</u-popup>
@@ -140,6 +140,7 @@
 
 <script>
   import { getShoppingCart ,generateOrder ,getCartList} from "@/api/client/business.js"
+  import { maintainCouponPaging } from "@/api/client/mine.js"
 	export default {
 		data() {
 			return {
@@ -181,6 +182,7 @@
 		},
     mounted(){
       this.handlerInitList()
+      this.handlerInitCouponList()
     },
     onLoad(option){
       this.merchantId = option.ids
@@ -199,15 +201,24 @@
       }
     },
 		methods:{
+      // 初始化列表接口
       handlerInitList(){
         getCartList(this.merchantId).then(res=>{
           this.init_list = res.data
-
+        })
+      },
+      // 初始化优惠券列表
+      handlerInitCouponList(){
+        let params = {
+          paging:'1,10',
+          merchantId:this.merchantId
+        }
+        maintainCouponPaging( params ).then(res=>{
+          console.log('@@@@res',res)
         })
       },
 			// 结算按钮
 			handlerSettleBtn(){
-
         let params = {
           payType:'2',
           cartIds:[],
@@ -228,19 +239,23 @@
             return
           }
         })
-
-
-				// wx.showLoading({
-				//   title: '结算中......',
-				// })
-
-				// setTimeout(function () {
-				//   wx.hideLoading()
-				// }, 3000)
 			},
       // 选择优惠券
       handlerSelectCoupon(){
 
+      },
+
+      close(){
+        this.coupon_show = false
+      },
+      // 点击展示优惠券pop
+      openCouponshow(){
+        console.log('@@@@')
+        this.coupon_show = true
+      },
+      // 选择优惠券 点击确定按钮
+      handlerSelectCoupon(){
+        this.coupon_show = false
       }
 		}
 	}

+ 95 - 99
src/pages/client/clientUser/collectList.vue

@@ -1,22 +1,14 @@
 <template>
   <view class="collect">
     <view class="collect_list">
-      <u-tabs
-        :list="listCollect"
-        @click="clickCollect"
-        lineWidth="30"
-        lineColor="#5992bb"
-        :activeStyle="{
+      <u-tabs :list="listCollect" @click="clickCollect" lineWidth="30" lineColor="#5992bb" :activeStyle="{
           color: '#303133',
           fontWeight: 'bold',
           transform: 'scale(1.05)',
-        }"
-        :inactiveStyle="{
+        }" :inactiveStyle="{
           color: '#606266',
           transform: 'scale(1)',
-        }"
-        itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;"
-      />
+        }" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;" />
     </view>
     <view>
       <view v-if="init_list.length > 0">
@@ -30,102 +22,106 @@
 </template>
 
 <script>
-import serviceItem from '@/components/service/index.vue';
-import { maintainFavoritePaging } from '@/api/client/mine.js';
-import { getCurrentLocation } from '@/api/client/home';
+  import serviceItem from '@/components/service/index.vue';
+  import {
+    maintainFavoritePaging
+  } from '@/api/client/mine.js';
+  import {
+    getCurrentLocation
+  } from '@/api/client/home';
 
-export default {
-  components: {
-    serviceItem,
-  },
-  data() {
-    return {
-      queryParams: {
-        size: 10,
-        type: 'MERCHANT',
-        region: null, //地区编码
-        longitude: null, //经度
-        latitude: null, //纬度
-      },
-      init_list: [],
-      listCollect: [
-        {
-          id: 1,
-          name: '商家',
-        },
-        {
-          id: 1,
-          name: '服务',
-        },
-      ],
-    };
-  },
-  onLoad() {
-    this.handlerInitLocation();
-  },
-  methods: {
-    // 获取当前经纬度
-    handlerInitLocation() {
-      uni.getLocation({
-        type: 'gcj02',
-        success: res => {
-          this.queryParams.longitude = res.longitude;
-          this.queryParams.latitude = res.latitude;
-          let point = {
-            latitude: res.latitude,
-            longitude: res.longitude,
-          };
-          getCurrentLocation(point).then(rc => {
-            this.queryParams.region = rc.data.id;
-            this.handlerInitList();
-          });
-        },
-        fail: rs => {
-          uni.showToast({
-            title: rs,
-            icon: 'none',
-          });
+  export default {
+    components: {
+      serviceItem,
+    },
+    data() {
+      return {
+        queryParams: {
+          size: 10,
+          type: 'MERCHANT',
+          region: null || '370705', //地区编码
+          longitude: null || '119.13279', //经度
+          latitude: null || '36.70864', //纬度
         },
-      });
+        init_list: [],
+        listCollect: [{
+            id: 1,
+            name: '商家',
+          },
+          {
+            id: 1,
+            name: '服务',
+          },
+        ],
+      };
     },
-    // 初始化列表信息
-    handlerInitList() {
-      maintainFavoritePaging(this.queryParams).then(res => {
-        if (res.code == 200 && res.data) {
-          res.data.map(rs => {
-            this.init_list.push(rs.simpleMerchantVO);
-          });
-        } else {
-          uni.showToast({
-            title: '数据请求失败',
-            icon: 'none',
-          });
-        }
-      });
+    onLoad() {
+      this.handlerInitLocation();
     },
+    methods: {
+      // 获取当前经纬度
+      handlerInitLocation() {
+        // uni.getLocation({
+        //   type: 'gcj02',
+        //   success: res => {
+        //     this.queryParams.longitude = res.longitude;
+        //     this.queryParams.latitude = res.latitude;
+        //     let point = {
+        //       latitude: res.latitude,
+        //       longitude: res.longitude,
+        //     };
+            // getCurrentLocation(point).then(rc => {
+            //   this.queryParams.region = rc.data.id;
+              this.handlerInitList();
+            // });
+        //   },
+        //   fail: rs => {
+        //     uni.showToast({
+        //       title: rs,
+        //       icon: 'none',
+        //     });
+        //   },
+        // });
+      },
+      // 初始化列表信息
+      handlerInitList() {
+        maintainFavoritePaging(this.queryParams).then(res => {
+          if (res.code == 200 && res.data) {
+            res.data.map(rs => {
+              this.init_list.push(rs.simpleMerchantVO);
+            });
+          } else {
+            uni.showToast({
+              title: '数据请求失败',
+              icon: 'none',
+            });
+          }
+        });
+      },
 
-    clickCollect(index) {},
-  },
-};
+      clickCollect(index) {},
+    },
+  };
 </script>
 
 <style lang="scss" scoped>
-.collect {
-  min-height: 100vh;
-  background-color: #efefef;
+  .collect {
+    min-height: 100vh;
+    background-color: #efefef;
 
-  &_list {
-    display: flex;
-    height: 70rpx;
-    justify-content: center;
-    align-items: center;
-    background-color: #fff;
-    margin-bottom: 40rpx;
-  }
-  .text {
-    text-align: center;
-    padding: 40rpx;
-    color: #999;
+    &_list {
+      display: flex;
+      height: 70rpx;
+      justify-content: center;
+      align-items: center;
+      background-color: #fff;
+      margin-bottom: 40rpx;
+    }
+
+    .text {
+      text-align: center;
+      padding: 40rpx;
+      color: #999;
+    }
   }
-}
 </style>

+ 18 - 7
src/pages/client/clientUser/mine/appoint/appoint.vue

@@ -40,14 +40,13 @@
 </template>
 
 <script>
-import { maintainReservations } from '@/api/client/mine.js';
+import { maintainReservations , cancelReservation } from '@/api/client/mine.js';
 export default {
   data() {
     return {
       queryParams: {
         size: 10,
       },
-
       init_list: [], //初始化列表
     };
   },
@@ -62,11 +61,23 @@ export default {
       });
     },
     // 点击取消商品
-    handlerClearItem() {
-      uni.showToast({
-        title: '么有',
-        icon: 'none',
-      });
+    handlerClearItem(item) {
+      cancelReservation(item.id).then(res=>{
+        if(res.code == 200){
+          uni.showToast({
+            title:'取消成功',
+            icon:'none'
+          })
+          this.handlerInitList()
+        }else{
+          uni.showToast({
+            title:res.msg,
+            icon:'none'
+          })
+          return
+        }
+      })
+
     },
     // 点击跳转到商品详情
     handlerSkipGoodsDetail(item, index) {

+ 15 - 10
src/pages/client/tabBar/home/index.vue

@@ -117,11 +117,12 @@ export default {
     return {
       list: [],
       keyword: '',
-      swiperList: [
-        'https://cdn.uviewui.com/uview/swiper/swiper1.png',
-        'https://cdn.uviewui.com/uview/swiper/swiper2.png',
-        'https://cdn.uviewui.com/uview/swiper/swiper3.png',
-      ],
+      // swiperList: [
+      //   'https://cdn.uviewui.com/uview/swiper/swiper1.png',
+      //   'https://cdn.uviewui.com/uview/swiper/swiper2.png',
+      //   'https://cdn.uviewui.com/uview/swiper/swiper3.png',
+      // ],
+      swiperList: [], // 轮播图
       homeData: {
         categories: [],
         nears: [],
@@ -177,7 +178,6 @@ export default {
   //   },
   // },
   onShow() {
-    this.getSwiperList();
     let params = {
           region: 370705,
           longitude: 119.13279,
@@ -207,13 +207,18 @@ export default {
       },
     });
   },
-
+  mounted() {
+    this.getSwiperList();
+  },
   methods: {
     /* 轮播图 */
     getSwiperList() {
-      // getSwiperListApi().then(res => {
-      //   console.log(res);
-      // });
+      getSwiperListApi().then(res => {
+        res.data.map(rs=>{
+          this.swiperList.push(rs.viewUrl)
+        })
+        console.log('this.swiperList',this.swiperList);
+      });
     },
 
     // 获取首页数据