فهرست منبع

订单列表优化

shish 6 سال پیش
والد
کامیت
f3a16dfd08

+ 2 - 2
mall/src/components/module/app-order-list.vue

@@ -3,7 +3,7 @@
 		<block v-if="!$util.isEmpty(info)">
 			<div class="list-left">
 				<div class="image">
-					<img :src="imgUrl | default_img" alt="商品图片" />
+					<img :src="imgUrl | default_img" alt="商品图片" mode="aspectFill" style="width:80px;height:80px;" />
 				</div>
 				<div class="list-msg">
 					<div class="title">{{ info.goodsName || info.title }}</div>
@@ -55,7 +55,7 @@ export default {
 				width: 140px;
 			}
 			.list-msg {
-				margin-left: 20px;
+				margin-left: 28px;
 				.title {
 					font-size: 28px;
 					color: $fontColor2;

+ 5 - 4
mall/src/pages/goods/components/sel-popup.vue

@@ -85,10 +85,10 @@ export default {
       } else {
         return "";
       }
-	},
-	maxStock(){
-		return this.info.stock == -1 ? 99999 : this.info.stock
-	}
+    },
+    maxStock() {
+      return this.info.stock == -1 ? 99999 : this.info.stock;
+    }
   },
   methods: {
     change(e) {
@@ -104,6 +104,7 @@ export default {
       uni.setStorageSync("buyGoodsDetil", this.info);
       this.$util.pageTo({
         url: "/pages/order/buy",
+        type: 2,
         query: {
           goodsId: this.info.id,
           goodsStyleId: this.$util.isEmpty(this.info.goodsStyleList)

+ 2 - 4
mall/src/pages/order/buy.vue

@@ -12,9 +12,7 @@
     <!-- 配送 -->
     <form @submit="formSubmit">
       <block v-if="tabIndex == 0">
-        <app-delivery-module 
-        ref="appDelivery" 
-        @changeAddress="changeAddress" />
+        <app-delivery-module ref="appDelivery" @changeAddress="changeAddress" />
       </block>
       <!-- 自取 -->
       <block v-else>
@@ -39,7 +37,6 @@
         <div class="module-tit">商品信息</div>
         <div class="module-det">
           <app-list-module v-if="!$util.isEmpty(goodsInfo)" :info="goodsInfo" />
-
           <div class="shop-prompt" v-if="!$util.isEmpty(orderShop)" @click="showAlert = true">
             <div>
               <span>{{ `运费(${showDistance}公里)` }}</span>
@@ -254,6 +251,7 @@ export default {
         uni.removeStorageSync("buyGoodsDetil");
         this.$util.pageTo({
           url: "/pages/callback/index",
+          type: 2,
           query: {
             pageStatus: 1,
             ...res.data

+ 111 - 96
mall/src/pages/order/list.vue

@@ -1,28 +1,39 @@
 <template>
-	<div class="app-content">
-		<block v-if="!$util.isEmpty(list.data)">
-			<div class="list-wrap" v-for="(item, index) in list.data" :key="index" @click="pageTo({
+  <div class="app-content">
+    <block v-if="!$util.isEmpty(list.data)">
+      <div
+        class="list-wrap"
+        v-for="(item, index) in list.data"
+        :key="index"
+        @click="pageTo({
 			url: '/pages/order/detail',
 			query: {
 				id: item.id
 			}
-		})">
-				<div class="list-top flex-center-between">
-					<div class="app-color-3">编号:{{ item.sendNum }}</div>
-					<div class="app-price">{{ item.status | constantfilter('ORDER_STATUS') }}</div>
-				</div>
-				<div class="list-blo">
-					<block v-if="!$util.isEmpty(item.goodsInfoList)">
-						<list-module v-for="(items, subIndex) in item.goodsInfoList" :key="subIndex" :info="items" />
-					</block>
-				</div>
-				<div class="list-bottom flex-center-between">
-					<div>
-						<span>应付金额:</span>
-						<span class="app-size-30 app-bold">¥{{ item.actPrice }}</span>
-					</div>
-					<block v-if="item.status == 0">
-						<button class="button-com red" @click.stop="pageTo({
+		})"
+      >
+        <div class="list-top flex-center-between">
+          <div class="app-color-3">编号:{{ item.sendNum }}</div>
+          <div class="app-price">{{ item.status | constantfilter('ORDER_STATUS') }}</div>
+        </div>
+        <div class="list-blo">
+          <block v-if="!$util.isEmpty(item.goodsInfoList)">
+            <list-module
+              v-for="(items, subIndex) in item.goodsInfoList"
+              :key="subIndex"
+              :info="items"
+            />
+          </block>
+        </div>
+        <div class="list-bottom flex-center-between">
+          <div>
+            <span>应付金额:</span>
+            <span class="app-size-30 app-bold">¥{{ item.actPrice }}</span>
+          </div>
+          <block v-if="item.status == 0">
+            <button
+              class="button-com red"
+              @click.stop="pageTo({
 						url: '/pages/callback/index',
 						query: {
 							pageStatus: 1,
@@ -30,98 +41,102 @@
 							totalPrice: item.prePrice,
 							couponId: item.couponId
 						}
-					})">立即付款</button>
-					</block>
-					<!-- <block v-if="item.status == 1">
+					})"
+            >立即付款</button>
+          </block>
+          <!-- <block v-if="item.status == 1">
 						<button class="button-com red defalut" @click.stop="pageTo({
 						url: '/pages/order/buy',
 						query: {
 							id: item.id
 						}
 					})">填写收花地址</button>
-					</block> -->
-					<block v-if="item.status == 5">
-						<button class="button-com red defalut" @click.stop="pageTo({
+          </block>-->
+          <block v-if="item.status == 5">
+            <button
+              class="button-com red defalut"
+              @click.stop="pageTo({
 						url: '/pages/order/comment',
 						query: {
 							id: item.id
 						}
-					})">评价</button>
-					</block>
-				</div>
-			</div>
-		</block>
-		<block v-else>
-			<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
-		</block>
-	</div>
+					})"
+            >评价</button>
+          </block>
+        </div>
+      </div>
+    </block>
+    <block v-else>
+      <app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+    </block>
+  </div>
 </template>
 
 <script>
-import ListModule from '@/components/module/app-order-list'
-import AppWrapperEmpty from '@/components/app-wrapper-empty'
-import { list } from '@/mixins'
+import ListModule from "@/components/module/app-order-list";
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { list } from "@/mixins";
 // api
-import { getList } from '@/api/order'
+import { getList } from "@/api/order";
 export default {
-	name: 'order-list',
-	components: {
-		ListModule,
-		AppWrapperEmpty
-	},
-	mixins: [list],
-	data() {
-		return {}
-	},
-	onPullDownRefresh() {
-		this.resetList()
-		this._list().then(res => {
-			uni.stopPullDownRefresh()
-		})
-	},
-	// 加载更多
-	onReachBottom() {
-		if (this.list.moreData == 1) {
-			this._list().then(res => {
-				uni.stopPullDownRefresh()
-			})
-		} else {
-			uni.stopPullDownRefresh()
-		}
-	},
-	onLoad: function() {
-		// this.init()
-	},
-	methods: {
-		async init() {
-			this._list()
-		},
-		_list() {
-			return getList({ status: this.tabIndex }).then(res => {
-				this.completes(res)
-			})
-		}
-	}
-}
+  name: "order-list",
+  components: {
+    ListModule,
+    AppWrapperEmpty
+  },
+  mixins: [list],
+  data() {
+    return {};
+  },
+  onPullDownRefresh() {
+    this.resetList();
+    this._list().then(res => {
+      uni.stopPullDownRefresh();
+    });
+  },
+  // 加载更多
+  onReachBottom() {
+    if (this.list.moreData == 1) {
+      this._list().then(res => {
+        uni.stopPullDownRefresh();
+      });
+    } else {
+      uni.stopPullDownRefresh();
+    }
+  },
+  onLoad: function() {
+    // this.init()
+  },
+  methods: {
+    async init() {
+      this._list();
+    },
+    _list() {
+      return getList({ status: this.tabIndex }).then(res => {
+        this.completes(res);
+      });
+    }
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-	.app-content {
-		padding-top: 20px;
-		padding-bottom: 1px;
-		.list-wrap {
-			padding: 0 30px;
-			background-color: #fff;
-			margin-bottom: 20px;
-			.list-top,
-			.list-bottom {
-				padding: 20px 0;
-				border-bottom: 1px solid $borderColor;
-				.button-com {
-					padding-top: 15px;
-					padding-bottom: 15px;
-				}
-			}
-		}
-	}
+.app-content {
+  padding-top: 20px;
+  padding-bottom: 1px;
+  .list-wrap {
+    padding: 0 30px;
+    background-color: #fff;
+    margin-bottom: 20px;
+    .list-top,
+    .list-bottom {
+      padding: 20px 0;
+      border-bottom: 1px solid $borderColor;
+      .button-com {
+        padding-top: 15px;
+        padding-bottom: 15px;
+      }
+    }
+  }
+}
 </style>