浏览代码

列表 ui完成

zxl 11 月之前
父节点
当前提交
c0319edeef
共有 2 个文件被更改,包括 56 次插入176 次删除
  1. 55 176
      src/components/service/serviceItem.vue
  2. 1 0
      src/pagesHome/marketer/index.vue

+ 55 - 176
src/components/service/serviceItem.vue

@@ -1,208 +1,87 @@
 <template>
-  <view class="sort">
-<!--    <u-swipe-action>
-      <u-swipe-action-item :options="options1"
-        @click="handlerClearItem(itm,index)"> -->
-        <view class="list_item" :key="index" v-for="(itm, index) of item">
-          <view class="list" @click="handlerRouterSkip(itm, index)">
-            <view class="list-img">
-              <!-- <image class="img" :src="error || !loaded ? 'https://cdn.uviewui.com/uview/album/10.jpg' : itm.logo"
-                mode="scaleToFill"></image> -->
-                <image class="img" :src="itm.logo"  mode="aspectFill"></image>
-            </view>
-
-            <view class="list-main">
-              <view class="item-text">{{  itm.name }}</view>
-              <!-- <view class="item-flex">
-                <view class="star">
-                  <u-rate :count="itm.score" disabled :size="14" />
-                  <text class="line">|</text>
-                  <text class="points">{{ itm.score }}分</text>
-                </view>
-                <view>{{ itm.sale }}单</view>
-                <view></view>
-              </view> -->
-              <view class="list-item">
-                <view class="item-l">{{ itm.address }}</view>
-                <view class="item-r">{{ (itm.distance / 1000).toFixed(2) }}KM</view>
-              </view>
-            </view>
-          </view>
+  <view class='container'>
+    <view class='item-box' v-for="(itm, index) of item" :key="index" @click='handlerRouterSkip(itm)'>
+      <image :src='itm.logo' mode="aspectFill" class='img'></image>
+      <view class='item-right'>
+        <view class='right-top'>{{ itm.name }}</view>
+        <view class='right-bottom'>
+          <view class='bottom-left'>{{ itm.address }}</view>
+          <view class='bottom-right'>{{ (itm.distance / 1000).toFixed(2) }}KM</view>
         </view>
-
-<!--      </u-swipe-action-item>
-    </u-swipe-action> -->
+      </view>
+    </view>
   </view>
 </template>
 
 <script>
-  import {
-    cancelFavorite
-  } from '@/api/client/business.js';
   export default {
     data() {
       return {
-        show: false,
-        showDate: false,
-        value1: Number(new Date()),
-        count: 2,
-        value: 10,
-        options1: [{
-          text: '删除'
-        }]
-      };
+
+      }
     },
-    props: ['item', 'skipType'],
+    props: ['item'],
     methods: {
-      click(item) {},
-      open() {},
-      close() {
-        this.show = false;
-      },
-
-      // 点击跳转1
-      handlerRouterSkip(item) {
-        // if (this.skipType == 0) {
+      handlerRouterSkip(itm) {
         uni.navigateTo({
-          url: `/pagesHome/marketer/index?id=${item.id}`,
+          url: `/pagesHome/marketer/index?id=${itm.id}`,
         });
-        // } else if (this.skipType == 1) {
-        //   uni.navigateTo({
-        //     url: `/pages/client/clientPackage/serviceDetail/index?id=${item.id}`,
-        //   });
-        // }
       },
-      // 点击取消
-      handlerClearItem(item, index) {
-        cancelFavorite(item.id).then(res => {
-          if (res.code == 'OK') {
-            uni.showToast({
-              title: '取消成功',
-              icon: 'none'
-            })
-            this.$emit('uploadIniList', 0)
-          } else {
-            uni.showToast({
-              title: res.message,
-              icon: 'none'
-            })
-            return
-          }
-        })
-      }
-    },
-  };
+    }
+  }
 </script>
 
 <style lang="scss" scoped>
-  /*商家服务分类的是实现 */
-
-  .sort {
-    min-height: 100vh;
-    .list_item{
-      // height: 200rpx;
-    }
-    .list {
-      // height: 200rpx;
+  .container {
+    padding: 32rpx;
+    box-sizing: border-box;
+
+    .item-box {
+      margin-bottom: 16rpx;
+      width: 100%;
+      height: 172rpx;
+      border-radius: 8rpx;
       background-color: #fff;
-      padding:10rpx 20rpx;
-      margin-bottom: 3rpx;
+      padding: 16rpx;
+      box-sizing: border-box;
       display: flex;
-
-      .list-img {
-
-        // background-color: #ec5729;
-        margin-right: 20rpx;
-
-        image {
-          width: 150rpx;
-          height:150rpx;
-          margin-top: 10rpx;
-        }
-      }
-
-      .list-main {
-        width: calc(100% - 180rpx);
-      }
-
-      .item-text {
-        font-weight: bold;
-        font-size: 32rpx;
-        margin: 10rpx 0 10rpx;
-        color: #333;
+      align-items: center;
+      box-sizing: 0 0rpx 5rpx 0rpx rgba(0,0,0,1);
+      .img {
+        width: 140rpx;
+        height: 140rpx;
+        border-radius: 8rpx;
       }
 
-      .item-flex {
+      .item-right {
+        width: calc( 100% - 180rpx );
+        height: 100%;
+        margin-left: 20rpx;
         display: flex;
-        justify-content: space-between;
-        font-size: 28rpx;
-        margin: 0 20rpx 10rpx 0;
-        color: #0d0d0d66;
+        flex-direction: column;
+        justify-content: space-around;
 
-        .star {
-          display: flex;
-
-          .line {
-            margin-left: 16rpx;
-            margin-top: 5rpx;
-            font-size: 22rpx;
-          }
-
-          .points {
-            color: #ff4b04;
-            font-size: 22rpx;
-            margin-top: 6rpx;
-            margin-left: 10rpx;
-          }
+        .right-top {
+          color: #0C1223;
         }
-      }
 
-      .list-item {
-        display: flex;
-        justify-content: space-between;
-        margin-top: 30rpx;
-        flex:1;
-        .item-l {
-          color: #cfcfcf;
-          font-size: 28rpx;
-        }
-
-        .item-r {
-          color: #252525;
+        .right-bottom {
+          display: flex;
+          justify-content: space-between;
+           color:#999999;
+          .bottom-left {
+            width: 70%;
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            font-size: 28rpx;
+          }
 
-          .Buy {
-            width: 40px;
-            height: 32px;
-            color: #fff;
-            line-height: 32px;
-            text-align: center;
-            display: inline-block;
-            border-radius: 0 16px 16px 0;
-            background-color: #ec5729;
-            padding-bottom: 20rpx;
+          .bottom-right {
+            font-size: 24rpx;
           }
         }
       }
     }
   }
-
-  .u-page {
-    padding: 0;
-  }
-
-  .u-demo-block__title {
-    padding: 10px 0 2px 15px;
-  }
-
-  .swipe-action {
-    &__content {
-      padding: 25rpx 0;
-
-      &__text {
-        font-size: 15px;
-        color: $u-main-color;
-        padding-left: 30rpx;
-      }
-    }
-  }
 </style>

+ 1 - 0
src/pagesHome/marketer/index.vue

@@ -195,6 +195,7 @@
       };
     },
     onLoad(option) {
+      console.log("@@@@option",option)
       this.ids = option.id
       this.queryParams.id = option.id;
     },