czj vor 4 Jahren
Ursprung
Commit
8f1814921b

+ 12 - 1
src/components/iphEmpty.vue

@@ -4,7 +4,7 @@
  * @Author: dream
  * @Date: 2021-03-28 15:09:24
  * @LastEditors: dream
- * @LastEditTime: 2021-03-30 15:50:43
+ * @LastEditTime: 2021-03-31 15:53:00
 -->
 <template>
 	<view
@@ -22,6 +22,10 @@
       <image class="empty-shopcat-img" src="~@/static/common/icon_quesheng_gwc.png" />
       <text class="empty-shopcat-text">购物车空空如也,快来挑好货吧</text>
     </block>
+    <block v-if="type === 3">
+      <image class="emty-address-img" src="~@/static/common/icon_quesheng_dw.png" />
+      <text class="empty-address-text">您还没有地址,赶快去添加吧</text>
+    </block>
     <slot />
   </view>
 </template>
@@ -74,5 +78,12 @@ export default {
     font-size: 28px;
     color: $iph-desc-text;
   }
+  .emty-address-img {
+    width: 188px;
+    height: 214px;
+  }
+  .empty-address-text {
+    @extend .empty-shopcat-text
+  }
 }
 </style>

+ 27 - 4
src/pageSubs/address/list.vue

@@ -4,7 +4,7 @@
  * @Author: dream
  * @Date: 2021-03-26 14:15:06
  * @LastEditors: dream
- * @LastEditTime: 2021-03-31 15:42:04
+ * @LastEditTime: 2021-03-31 15:55:52
 -->
 <template>
 	<view class="address-list-main" :style="{paddingBottom: `${pagePaddingBottom}px`}">
@@ -21,12 +21,13 @@
             <text class="u-m-l-24 u-font-22 u-line-32">设为默认地址</text>
           </u-checkbox>
           <view class="u-flex u-row-right">
-            <view class="oper-icon iph-icon-del"></view>
-            <view class="oper-icon u-m-l-62 iph-icon-update"></view>
+            <view class="oper-icon iph-icon-del" @click="delAddress(item)"></view>
+            <view class="oper-icon u-m-l-62 iph-icon-update" @click="toEditAddress(item)"></view>
           </view>
         </view>
       </view>
     </block>
+    <iph-empty :show="!addressList.length" :type="3" :marginTop="344" />
     <iph-fixed-bottom @getHeight="getFooterHeight">
       <navigator class="footer iph-bg-fff" url="./add">
         <button class="add-address-btn">添加收货地址</button>
@@ -37,8 +38,9 @@
 
 <script>
 import iphFixedBottom from '@/components/iphFixedBottom.vue'
+import IphEmpty from '@/components/iphEmpty.vue'
 export default {
-  components: { iphFixedBottom },
+  components: { iphFixedBottom, IphEmpty },
   name: 'addressList',
   data () {
     return {
@@ -59,6 +61,27 @@ export default {
   methods: {
     getFooterHeight (val) {
       this.pagePaddingBottom = val
+    },
+    delAddress (val) {
+      console.log(val)
+      uni.showModal({
+        title: '确定删除收货地址?',
+        cancelColor: '#007AFF',
+        confirmColor: '#007AFF',
+        success: (res) => {
+          if (res.confirm) {
+            console.log('用户点击确定')
+          } else if (res.cancel) {
+            console.log('用户点击取消')
+          }
+        }
+      })
+    },
+    toEditAddress (item) {
+      console.log(item)
+      uni.navigateTo({
+        url: './add'
+      })
     }
   }
 }

BIN
src/static/common/icon_quesheng_dw.png