Selaa lähdekoodia

商品详情:默认选中商品规格

Xiao_123 1 vuosi sitten
vanhempi
commit
0f770c908e

+ 2 - 2
pages/order/aftersale/list.vue

@@ -10,9 +10,9 @@
         :current="state.currentTab"
       />
     </su-sticky>
-    <s-empty v-if="state.pagination.total === 0" icon="/static/data-empty.png" text="暂无数据" />
+    <s-empty v-if="!state.pagination.list.length" icon="/static/data-empty.png" text="暂无售后订单" />
     <!-- 列表 -->
-    <view v-if="state.pagination.total > 0">
+    <view v-else>
       <view
         class="list-box ss-m-y-20"
         v-for="order in state.pagination.list"

+ 1 - 1
pages/user/goods-collect.vue

@@ -94,7 +94,7 @@
       }"
       @tap="loadMore"
     />
-    <s-empty v-if="state.pagination.total === 0" text="暂无收藏" icon="/static/collect-empty.png" />
+    <s-empty v-if="!state.pagination.list.length" text="暂无收藏商品" icon="/static/collect-empty.png" />
   </s-layout>
 </template>
 

+ 16 - 8
sheep/components/s-order-card/s-order-card.vue

@@ -37,6 +37,14 @@
       type: 'unpaid',
       count: 'unpaidCount',
     },
+    {
+      title: '待发货',
+      value: '2',
+      icon: '/static/img/shop/order/no_comment.png',
+      path: '/pages/order/list',
+      type: 'noget',
+      count: 'undeliveredCount',
+    },
     {
       title: '待收货',
       value: '3',
@@ -45,14 +53,14 @@
       type: 'noget',
       count: 'deliveredCount',
     },
-    {
-      title: '待评价',
-      value: '4',
-      icon: '/static/img/shop/order/no_comment.png',
-      path: '/pages/order/list',
-      type: 'nocomment',
-      count: 'uncommentedCount',
-    },
+    // {
+    //   title: '待评价',
+    //   value: '4',
+    //   icon: '/static/img/shop/order/no_comment.png',
+    //   path: '/pages/order/list',
+    //   type: 'nocomment',
+    //   count: 'uncommentedCount',
+    // },
     {
       title: '售后单',
       value: '0',

+ 17 - 10
sheep/components/s-select-sku/s-select-sku.vue

@@ -28,22 +28,20 @@
 					<view class="sku-item ss-m-b-20" v-for="property in propertyList" :key="property.id">
 						<view class="label-text ss-m-b-20">{{ property.name }}</view>
 						<view class="ss-flex ss-col-center ss-flex-wrap">
-							<button class="ss-reset-button spec-btn" v-for="value in property.values" :class="[
-                  {
-                    'ui-BG-Main-Gradient': state.currentPropertyArray[property.id] === value.id,
-                  },
-                  {
-                    'disabled-btn': value.disabled === true,
-                  },
-                ]" :key="value.id" :disabled="value.disabled === true" @tap="onSelectSku(property.id, value.id)">
+							<button class="ss-reset-button spec-btn" v-for="value in property.values" 
+								:class="[
+                  { 'ui-BG-Main-Gradient': state.currentPropertyArray[property.id] === value.id },
+                  { 'disabled-btn': value.disabled === true }
+                ]"
+								:key="value.id" :disabled="value.disabled === true" @tap="onSelectSku(property.id, value.id)"
+							>
 								{{ value.name }}
 							</button>
 						</view>
 					</view>
 					<view class="buy-num-box ss-flex ss-col-center ss-row-between ss-m-b-40">
 						<view class="label-text">购买数量</view>
-						<su-number-box :min="1" :max="state.selectedSku.stock" :step="1"
-                           v-model="state.selectedSku.goods_num" @change="onNumberChange($event)" />
+						<su-number-box :min="1" :max="state.selectedSku.stock" :step="1" v-model="state.selectedSku.goods_num" @change="onNumberChange($event)" />
 					</view>
 				</scroll-view>
 			</view>
@@ -269,6 +267,15 @@
 	}
 
 	changeDisabled(false);
+
+	// 默认选中规格
+	if (propertyList && propertyList.length) {
+		propertyList.forEach(e => {
+			if (e.values && e.values.length) onSelectSku(e.id, e.values[0].id)
+		})
+	}
+
+
   // TODO 芋艿:待讨论的优化点:1)单规格,要不要默认选中;2)默认要不要选中第一个规格
 </script>