Эх сурвалжийг харах

Merge branch 'yann_0511' of https://gogs.njnet.vip/baolei/GululuQ-mp into yann_0511

zrug 5 сар өмнө
parent
commit
8f6c244cd1

+ 1 - 0
app.json

@@ -11,6 +11,7 @@
       "pages/Mall/newCommodity/newCommodity",
       "pages/Mall/hotCommodity/hotCommodity",
       "pages/order/confirmOrder/confirmOrder",
+      "pages/order/orderDetail/orderDetail",
       "pages/my/addressManage/addressManage",
       "pages/my/addAddress/addAddress",
       "pages/my/myOrder/myOrder"

+ 5 - 20
pages/index/index.js

@@ -11,9 +11,7 @@ Page({
     prodClassList: [],
     showAddCartModal: false,
     currentProduct: null,
-
-    isCategoryMini_1: false,
-    isCategoryMini_2: false
+    isCategoryMini: false
   },
   // 显示商品属性模态框
   showAddCartModal(e) {
@@ -83,26 +81,13 @@ Page({
 
   onPageScroll: function(e) {
     wx.createSelectorQuery()
-      .select('.brand-bar-1')
-      .boundingClientRect((rect) => {
-        if (rect) {
-          const shouldBeMini = rect.top <= 40; // 在brand-bar进入顶部时,category切换为mini模式
-          if (this.data.isCategoryMini_1 !== shouldBeMini) {
-            this.setData({
-              isCategoryMini_1: shouldBeMini
-            });
-          }
-        }
-      })
-      .exec();
-    wx.createSelectorQuery()
-      .select('.brand-bar-2')
+      .select('.brand-bar')
       .boundingClientRect((rect) => {
         if (rect) {
           const shouldBeMini = rect.top <= 40; // 在brand-bar进入顶部时,category切换为mini模式
-          if (this.data.isCategoryMini_2 !== shouldBeMini) {
+          if (this.data.isCategoryMini !== shouldBeMini) {
             this.setData({
-              isCategoryMini_2: shouldBeMini
+              isCategoryMini: shouldBeMini
             });
           }
         }
@@ -110,4 +95,4 @@ Page({
       .exec();
   }
   
-})
+})

+ 8 - 28
pages/index/index.wxml

@@ -17,7 +17,7 @@
   </view>
   <!-- <banner position="index" bannerList="{{bannerList}}"/> -->
 
-  <view class="hot-bar hot-bar-1">
+  <view class="hot-bar">
     <view class="hot-A">
       <image src="/images/index/hot-left.png" class="hot-image" bind:tap="hotBut"></image>
     </view>
@@ -28,38 +28,18 @@
       <image src="/images/index/hot-right.png" class="hot-image" bind:tap="presaleBut"></image>
     </view>
   </view>
-  <view class="brand-bar brand-bar-1">
+  <view class="brand-bar">
     <view wx:for="{{ipInfoList}}" wx:key="index" class="brand-item">
       <image src="{{item.ipUrl}}" data-item="{{item}}" class="brand-image"></image>
       <!-- <text class="brand-name">{{item.name}}</text> -->
     </view>
   </view>
-  <view class="category category-1 {{isCategoryMini_1 ? 'mini' : ''}}">
-    <view wx:for="{{prodClassList}}" wx:key="index" class="category-item">
-      <image src="{{item.classUrl}}" data-item="{{item}}" class="category-image"></image>
-      <span>{{ item.title }}</span>
+  <!-- <view class="slider">
+    <view class="slider-item">
+      slider
     </view>
-  </view>
-
-
-  <view class="hot-bar hot-bar-2">
-    <view class="hot-A">
-      <image src="/images/index/hot-left.png" class="hot-image" bind:tap="hotBut"></image>
-    </view>
-    <view class="hot-B">
-      <image src="/images/index/hot-middle.png" class="hot-image" bind:tap="newBut"></image>
-    </view>
-    <view class="hot-C">
-      <image src="/images/index/hot-right.png" class="hot-image" bind:tap="presaleBut"></image>
-    </view>
-  </view>
-  <view class="brand-bar brand-bar-2">
-    <view wx:for="{{ipInfoList}}" wx:key="index" class="brand-item">
-      <image src="{{item.ipUrl}}" data-item="{{item}}" class="brand-image"></image>
-      <!-- <text class="brand-name">{{item.name}}</text> -->
-    </view>
-  </view>
-  <view class="category category-2 {{isCategoryMini_2 ? 'mini' : ''}}">
+  </view> -->
+  <view class="category {{isCategoryMini ? 'mini' : ''}}">
     <view wx:for="{{prodClassList}}" wx:key="index" class="category-item">
       <image src="{{item.classUrl}}" data-item="{{item}}" class="category-image"></image>
       <span>{{ item.title }}</span>
@@ -72,4 +52,4 @@
   <!-- 商品属性模态框 -->
   <addCartModel visible="{{showAddCartModal}}" product="{{currentProduct}}" bindclose="handleCloseAddCartModal"></addCartModel>
 
-</view>
+</view>

+ 5 - 11
pages/index/index.wxss

@@ -25,7 +25,7 @@ page {
   display:block;
 }
 
-.hot-bar, .hot-bar-1, .hot-bar-2 {
+.hot-bar {
   padding: 14rpx 30rpx 10rpx;
   display: flex;
   flex-direction: row;
@@ -37,7 +37,7 @@ page {
   width: 220rpx;
   height: 300rpx;
 }
-.brand-bar, .brand-bar-1, .brand-bar-2 {
+.brand-bar {
   padding: 14rpx 30rpx 10rpx;
   display: flex;
   flex-direction: row;
@@ -67,7 +67,7 @@ page {
   display: block;
   border-radius: 25rpx;
 }
-.category, .category-1, .category-2 {
+.category {
   position: relative;
   height: 300rpx;
   margin: 14rpx 30rpx 10rpx 30rpx;
@@ -87,18 +87,12 @@ page {
 .category.mini {
   position: fixed; /* 固定在页面顶部 */
   z-index: 1000;
+  top: 0px; 
   height: 80rpx;
   padding: 0 20rpx;
   flex-wrap: nowrap;
   overflow-x: auto;
 }
-.category-1.mini {
-  top: 0rpx;
-}
-.category-2.mini {
-  top: 90rpx;
-}
-
 
 .category.mini .category-item {
   width: auto;
@@ -130,4 +124,4 @@ page {
   width: 100%;
   height: 124rpx;
   background-color: #57c6b1;
-}
+}

+ 10 - 1
pages/my/myOrder/myOrder.js

@@ -21,7 +21,16 @@ Page({
   // 获取订单列表
   getOrderLists(){
       API.getOrderLists({pageNum:this.data.pageNum,pageSize:10}).then(res=>{
-          console.log(res);
+          this.setData({
+              orderList:res.orderDTOS
+          })
+      })
+  },
+  // 订单详情
+  goOrderDetail(e){
+      let orderId = e.currentTarget.dataset.orderid;
+      wx.navigateTo({
+        url: '/pages/order/orderDetail/orderDetail?orderId='+orderId,
       })
   },
   /**

+ 10 - 10
pages/my/myOrder/myOrder.wxml

@@ -8,21 +8,21 @@
 
    <!-- 订单列表 -->
    <view class="orderList">
-       <view class="itemOrder" wx:for="{{3}}" wx:key="index">
+       <view class="itemOrder" wx:for="{{orderList}}" wx:key="index">
           <view class="orderInfo">
                 <view class="leftInfo">
                     <view class="prodsImg">
-                        <image class="coverImg" src="/images/index/category-item.png" mode="" wx:for="{{1}}" wx:key="index"/>
+                        <image class="coverImg" src="{{item2.imageDTOS[0].picUrl}}" mode="" wx:for="{{item.orderDetailDTOS}}" wx:key="this" wx:for-index="index2" wx:for-item="item2" wx:if="{{index2 < 4}}"/>
                     </view>
-                    <view class="prodInfo">
-                       <text>商品描述高领长袖T恤露脐短装</text>
-                       <text>白色/M</text>
-                       <text>¥:1297</text>
+                    <view class="prodInfo" wx:if="{{item.orderDetailDTOS.length == 1}}">
+                       <text>{{item.orderDetailDTOS[0].prodName}}</text>
+                       <text>{{item.orderDetailDTOS[0].prodAttrName}}</text>
+                       <text>¥:{{item.orderDetailDTOS[0].price}}</text>
                     </view>
                 </view>
               <view class="statistics">
                  <text>
-                    ¥82900.00
+                    ¥{{item.orderAmount}}
                     共5件
                  </text>
               </view>
@@ -32,17 +32,17 @@
                 <text class="name">状态</text>
                 <text>未收货</text>
              </view>
-             <image class="editIcon" src="/images/my/edit.png" mode=""/>
+             <image class="editIcon" src="/images/my/edit.png" mode="" data-orderId="{{item.orderId}}" catchtap="goOrderDetail"/>
              <image class="logistics" src="/images/my/logistics.png" mode=""/>
           </view>
        </view>
    </view>
 
    <!-- 商品总价 -->
-   <view class="totalPrice">
+   <!-- <view class="totalPrice">
       <text>商品总价</text>
       <text>¥:82900.00</text>
-   </view>
+   </view> -->
 
    <!-- 推荐 -->
    <view class="recommend">

+ 79 - 0
pages/order/orderDetail/orderDetail.js

@@ -0,0 +1,79 @@
+import { API } from "../../../service/api"
+
+// pages/order/orderDetail/orderDetail.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    prods:[],
+    orderDetail:''
+  },
+  // 获取订单详情
+  getOrderDetail(orderId){
+      API.getOrderDetail({orderId}).then(res=>{
+        //   console.log(res);
+          this.setData({
+              orderDetail:res.orderDTO,
+              prods:res.orderDetailDTOS
+          })
+      })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    console.log(options);
+    this.getOrderDetail(options.orderId);
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 5 - 0
pages/order/orderDetail/orderDetail.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "existProduct":"/components/existProduct-list/existProduct-list"
+  }
+}

+ 17 - 0
pages/order/orderDetail/orderDetail.wxml

@@ -0,0 +1,17 @@
+<!--pages/order/orderDetail/orderDetail.wxml-->
+<!-- 地址 -->
+<view class="address" bindtap="goAddressMange">
+    <text class="icon">收货地址</text>
+    <view class="addressInfo">
+        <view class="userInfo">
+          <text>{{orderDetail.recName}}</text>
+          <text>{{orderDetail.recMobile}}</text>
+        </view>
+        <text>{{orderDetail.recProv}} {{orderDetail.recCity}} {{orderDetail.recDistrict}} {{orderDetail.recAddress}}</text>
+    </view>
+    <image class="more" src="/images/mall/back.png" mode="widthFix" srcset=""/>
+</view>
+
+<!-- 商品 -->
+<existProduct prods="{{prods}}"></existProduct>
+

+ 24 - 0
pages/order/orderDetail/orderDetail.wxss

@@ -0,0 +1,24 @@
+/* pages/order/orderDetail/orderDetail.wxss */
+.address{
+    width: 650rpx;
+    height: 176rpx;
+    background: #F7F7F7;
+    border-radius: 30rpx;
+    margin: 64rpx auto;
+    box-shadow: 0 0 10rpx 10rpx #F0F0F0;
+    display: flex;
+    align-items: center;
+    justify-content: space-around;
+}
+.address .userInfo{
+    display: flex;
+    justify-content: space-between;
+}
+.address .icon{
+    width: 170rpx;
+}
+.address .more{
+    width: 30rpx;
+    transform: rotate(180deg);
+    margin: 0 20px;
+}

+ 4 - 0
service/api.js

@@ -293,5 +293,9 @@ export const API = {
     // 获取订单列表
     getOrderLists: function(playload){
         return http.post("/api/store/order/orders",playload)
+    },
+    // 获取订单详情
+    getOrderDetail:function(playload){
+        return http.get("/api/store/order/detail",playload)
     }
 }