Browse Source

订单页面优化

jiayubo 3 months ago
parent
commit
7a39ff0d63
3 changed files with 195 additions and 200 deletions
  1. 2 2
      config.js
  2. 188 178
      pages/common/orderList/userItem.vue
  3. 5 20
      pages/index.vue

+ 2 - 2
config.js

@@ -2,10 +2,10 @@
 const config = {
   // baseUrl: 'https://vue.ruoyi.vip/prod-api',
   //cloud后台网关地址
-  // baseUrl: 'http://192.168.100.139:9527', //嵘哥
+  baseUrl: 'http://192.168.100.139:9527', //嵘哥
   // baseUrl: 'http://192.168.100.127:9527',//龙哥
   // baseUrl: 'http://192.168.100.122:9527',
-  baseUrl: 'https://goldshulin.com/prod-api',
+  // baseUrl: 'https://goldshulin.com/prod-api',
   mapKey: 'KFEBZ-P2GKZ-A5PX4-7Q6Y7-KXOBF-XCB4C',
   appName: '金邻助家',
   // 应用信息

+ 188 - 178
pages/common/orderList/userItem.vue

@@ -1,38 +1,38 @@
 <template>
-    <view class="item">
-        <view class="item-img">
-            <up-image :show-loading="true" :src="data.volunteerPicture" width="112rpx" height="112rpx"></up-image>
+  <view class="item">
+    <view class="item-img">
+      <up-image :show-loading="true" :src="data.volunteerPicture"></up-image>
+    </view>
+    <view class="item-info">
+      <view class="item-title-box">
+        <view class="item-title">
+          <view class="item-name">
+            志愿者姓名:{{ data.name }}
+          </view>
+          <dict-tag :options="order_status" :value="String(data.orderStatus)" />
         </view>
-        <view class="item-info">
-            <view class="item-title-box">
-                <view class="item-title">
-                    <view class="item-name">
-                        志愿者姓名:{{ data.name }}
-                    </view>
-                    <dict-tag :options="order_status" :value="String(data.orderStatus)" />
-                </view>
-                <view class="item-de">
-                    服务类别:{{data.businessTierName}}
-                </view>
-                 <view class="item-de">
-                    下单日期:{{ data.createTime }}
-                </view>
-                <view class="item-time skill-description">
-                    服务描述:{{ data.businessDescribe }}
-                </view>
-            </view>
-            <view class="item-box">
-                <view class="item-btns">
-                    <view v-for="item in btns" :key="item.name">
-                        <view class="btn-m" v-if="item.show ? item.show(data) : true" :type="item.type" text="取消"
-                            @click="item.onClick(data)">
-                            {{item.name}}
-                        </view>
-                    </view>
-                </view>
+        <view class="item-de">
+          服务类别:{{ data.businessTierName }}
+        </view>
+        <view class="item-de">
+          下单日期:{{ data.createTime }}
+        </view>
+        <view class="item-time skill-description">
+          服务描述:{{ data.businessDescribe }}
+        </view>
+      </view>
+      <view class="item-box">
+        <view class="item-btns">
+          <view v-for="item in btns" :key="item.name">
+            <view class="btn-m" v-if="item.show ? item.show(data) : true" :type="item.type" text="取消"
+              @click="item.onClick(data)">
+              {{ item.name }}
             </view>
+          </view>
         </view>
+      </view>
     </view>
+  </view>
 </template>
 
 <script setup>
@@ -40,190 +40,200 @@ import { inject } from 'vue';
 import DictTag from '@/components/DictTag/index.vue'
 
 const props = defineProps({
-    data: {
-        type: Object,
-        default: () => {
-            return {}
-        }
-    },
+  data: {
+    type: Object,
+    default: () => {
+      return {}
+    }
+  },
 });
 
 const order_status = inject('order_status');
 
 const btns = [
-    {
-        name: '沟通',
-        onClick: (e) => {
-		console.log("TCL: e", e)
-        uni.navigateTo({
-            url: `/pages_orderuser/pages/talk/pages/index/index?orderId=${e.mainOrderId}`
-        });
-         },
-        type: 'primary'
-    },
-    {
-        name: '退款',
-        onClick: (e)=>handleRefund(e),
-        show: (item) => ['3'].includes(item.orderStatus),
-        type: 'error'
-    },
-    {
-        name: '取消',
-        onClick: (e)=>handleCancel(e),
-        show: (item) => ['1'].includes(item.orderStatus),
-        type: 'warning'
-    },
-    {
-        name: '查看',
-        onClick: (e)=>handlClick(e),
-        // show: (item) => item.orderStatus !== '1',
-        type: 'info'
+  {
+    name: '沟通',
+    onClick: (e) => {
+      console.log("TCL: e", e)
+      uni.navigateTo({
+        url: `/pages_orderuser/pages/talk/pages/index/index?orderId=${e.mainOrderId}`
+      });
     },
+    type: 'primary'
+  },
+  {
+    name: '退款',
+    onClick: (e) => handleRefund(e),
+    show: (item) => ['3'].includes(item.orderStatus),
+    type: 'error'
+  },
+  {
+    name: '取消',
+    onClick: (e) => handleCancel(e),
+    show: (item) => ['1'].includes(item.orderStatus),
+    type: 'warning'
+  },
+  {
+    name: '查看',
+    onClick: (e) => handlClick(e),
+    // show: (item) => item.orderStatus !== '1',
+    type: 'info'
+  },
 ]
 
 //申请退款 
 const handleRefund = (item) => {
-    const mainOrderId = item.mainOrderId; // 获取详情id
-    uni.navigateTo({
-        url: `/pages_classify/pages/requestaRefund/requestaRefund?mainOrderId=${mainOrderId}`
-    });
+  const mainOrderId = item.mainOrderId; // 获取详情id
+  uni.navigateTo({
+    url: `/pages_classify/pages/requestaRefund/requestaRefund?mainOrderId=${mainOrderId}`
+  });
 };
 // 取消订单
 const handleCancel = (item) => {
-    const mainOrderId = item.mainOrderId;
-    uni.navigateTo({
-        url: `/pages_classify/pages/cancelationOforder/cancelationOforder?mainOrderId=${mainOrderId}`
-    });
+  const mainOrderId = item.mainOrderId;
+  uni.navigateTo({
+    url: `/pages_classify/pages/cancelationOforder/cancelationOforder?mainOrderId=${mainOrderId}`
+  });
 };
 //查看
 const handlClick = (item) => {
-    const mainOrderId = item.mainOrderId; // 获取详情id
-    uni.navigateTo({
-        url: `/pages_classify/pages/orderItem/orderdetails?mainOrderId=${mainOrderId}`
-    });
+  const mainOrderId = item.mainOrderId; // 获取详情id
+  uni.navigateTo({
+    url: `/pages_classify/pages/orderItem/orderdetails?mainOrderId=${mainOrderId}`
+  });
 }
 </script>
 
 <style lang="scss" scoped>
 .item {
-    border-radius: 24rpx;
-    background: rgba(255, 255, 255, 1);
-    margin-bottom: 24rpx;
-    padding: 32rpx;
-    display: flex;
-    align-items: flex-start;
-
-    .item-img {
-        margin-right: 32rpx;
+  border-radius: 18rpx;
+  background: #FFFFFF;
+  box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.04);
+
+  margin-bottom: 24rpx;
+  padding: 32rpx;
+  display: flex;
+  align-items: flex-start;
+
+  .item-img {
+    width: 122rpx;
+    height: 122rpx;
+    border-radius: 200rpx;
+    overflow: hidden;
+    
+    :deep(image) {
+      width: 100%;
+      height: 100%;
+      object-fit: cover;
     }
+  }
 
-    .item-info {
+  .item-info {
+    display: flex;
+    flex-direction: column;
+    flex: 1;
+    justify-content: space-between;
+    height: 100%;
+
+    .item-title-box {
+      .item-title {
+        font-size: 30rpx;
+        font-weight: 400;
+        line-height: 45rpx;
+        color: rgba(26, 26, 26, 1);
         display: flex;
-        flex-direction: column;
-        flex: 1;
+        align-items: center;
         justify-content: space-between;
-        height: 100%;
-
-        .item-title-box {
-            .item-title {
-                font-size: 30rpx;
-                font-weight: 400;
-                line-height: 45rpx;
-                color: rgba(26, 26, 26, 1);
-                display: flex;
-                align-items: center;
-                justify-content: space-between;
-                margin-bottom: 15rpx;
-            }
-        }
+        margin-bottom: 15rpx;
+      }
+    }
 
-        .item-de {
-            display: flex;
-            font-size: 26rpx;
-            font-weight: 400;
-            line-height: 39rpx;
-            color: rgba(153, 153, 153, 1);
-            display: flex;
-            align-items: center;
-            justify-content: flex-start;
-        }
+    .item-de {
+      display: flex;
+      font-size: 26rpx;
+      font-weight: 400;
+      line-height: 39rpx;
+      color: rgba(153, 153, 153, 1);
+      display: flex;
+      align-items: center;
+      justify-content: flex-start;
+    }
 
-        .item-time {
-            font-size: 26rpx;
-            font-weight: 400;
-            letter-spacing: 0rpx;
-            line-height: 39rpx;
-            color: rgba(153, 153, 153, 1);
-            margin-bottom: 20rpx;
-        }
+    .item-time {
+      font-size: 26rpx;
+      font-weight: 400;
+      letter-spacing: 0rpx;
+      line-height: 39rpx;
+      color: rgba(153, 153, 153, 1);
+      margin-bottom: 20rpx;
+    }
+
+    .item-price {
+      font-size: 30rpx;
+      font-weight: 400;
+      letter-spacing: 0rpx;
+      line-height: 45rpx;
+      color: rgba(203, 26, 28, 1);
+      margin-bottom: 16rpx;
+    }
 
-        .item-price {
-            font-size: 30rpx;
-            font-weight: 400;
-            letter-spacing: 0rpx;
-            line-height: 45rpx;
-            color: rgba(203, 26, 28, 1);
-            margin-bottom: 16rpx;
+    .item-box {
+      display: flex;
+      align-items: center;
+      justify-content: flex-end;
+
+
+      .item-btns {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+
+        .btn-s {
+          font-size: 26rpx;
+          font-weight: 400;
+          color: rgba(221, 94, 69, 1);
+          text-align: center;
+          padding: 16rpx 0;
+          width: 156.03rpx;
+          border-radius: 8rpx;
+          background: rgba(0, 0, 0, 0);
+          display: flex;
+          justify-content: center;
+          border: 0rpx solid rgba(221, 94, 69, 1);
         }
 
-        .item-box {
-            display: flex;
-            align-items: center;
-            justify-content: flex-end;
-
-
-            .item-btns {
-                display: flex;
-                align-items: center;
-                justify-content: center;
-
-                .btn-s {
-                    font-size: 26rpx;
-                    font-weight: 400;
-                    color: rgba(221, 94, 69, 1);
-                    text-align: center;
-                    padding: 16rpx 0;
-                    width: 156.03rpx;
-                    border-radius: 8rpx;
-                    background: rgba(0, 0, 0, 0);
-                    display: flex;
-                    justify-content: center;
-                    border: 0rpx solid rgba(221, 94, 69, 1);
-                }
-
-                .btn-m {
-                    border-radius: 59rpx;
-                    font-size: 26rpx;
-                    text-align: left;
-                    margin-left: 24rpx;
-                    display: flex;
-                    justify-content: center;
-                    color: #dd5e45;
-                    padding: 12rpx 32rpx;
-                    border: 1px solid;
-                    border-radius: 59rpx;
-                }
-
-
-            }
+        .btn-m {
+          border-radius: 59rpx;
+          font-size: 26rpx;
+          text-align: left;
+          margin-left: 24rpx;
+          display: flex;
+          justify-content: center;
+          color: #dd5e45;
+          padding: 12rpx 32rpx;
+          border: 1px solid;
+          border-radius: 59rpx;
         }
+
+
+      }
     }
+  }
 }
 
 .item-time-text {
-    color: #dd5e45;
+  color: #dd5e45;
 }
 
 .skill-description {
-		display: -webkit-box;
-		-webkit-line-clamp: 2;
-		/* 限制两行 */
-		-webkit-box-orient: vertical;
-		overflow: hidden;
-		text-overflow: ellipsis;
-		line-height: 1.4;
-		min-height: 2.8em;
-		/* 两行高度 */
-	}
-
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  /* 限制两行 */
+  -webkit-box-orient: vertical;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  line-height: 1.4;
+  min-height: 2.8em;
+  /* 两行高度 */
+}
 </style>

+ 5 - 20
pages/index.vue

@@ -28,8 +28,6 @@
       </view>
     </view>
 
- 
-
     <view class="home-ranking">
       <ServIces :leftList="leftList" :rightList="rightList" :ValueZoneSwiper="ValueZoneSwiper" v-if="userType == 1">
       </ServIces>
@@ -40,23 +38,8 @@
       :loadingText="loadmoreInfo.loadmoreText" :nomoreText="loadmoreInfo.nomoreText" @loadmore="handleLoadmore"
       v-if="userType == 1" />
 
-    <view class="Wrapper">
-      <view class="home-g-bgc">
-        <Client />
-      </view>
-
-      <view class="hot-swiper" v-if="ValueZone.length > 0">
-        <up-swiper :list="ValueZone" :indicator="false" indicatorMode="line" circular></up-swiper>
-      </view>
-
-      <view class="home-ranking">
-        <ServIces :leftList="leftList" :rightList="rightList" v-if="userType == 1"></ServIces>
-        <RankingList v-if="userType === 2" />
-      </view>
-      <custom-tab-bar page="home" class="customTabBar" />
-
-      <view class="safe-area-bottom"></view>
-    </view>
+    <custom-tab-bar page="home" class="customTabBar" />
+    <view class="safe-area-bottom"></view>
   </view>
 </template>
 
@@ -151,7 +134,9 @@ const getList = async () => {
       pageSize: pages.value.pageSize,
       serviceCategory: pages.value.serviceCategory || '',
       businessManagementId: 0,
-      // appStatus:pages.value.appStatus,
+      provinceCode: data.address.cityCode?.code[0],
+      cityCode: data.address.cityCode?.code[1],
+      districtCode: data.address.cityCode?.code[2],
     }
     const res = await volunteerinfolist(params)