tremble 5 年 前
コミット
73e47fd138

+ 0 - 3
config/api.js

@@ -1,7 +1,4 @@
 const API_BASE_URL = 'https://testshop.4dkankan.com/platform-framework/api/';
-
-// const API_BASE_URL = 'https://bat6d.4dkankan.com/4dkankan-shop/api/';
-
 // const API_BASE_URL = 'http://192.168.0.207:8080/platform-framework/api/';
 
 

+ 0 - 1
pages/cart/cart.wxss

@@ -96,7 +96,6 @@ page{
     height: auto;
     width: 100%;
     overflow: hidden;
-    /* padding-bottom: 180rpx; */
 }
 
 .cart-view .group-item{

+ 1 - 0
pages/catalog/catalog.wxml

@@ -24,6 +24,7 @@
                 <image class="icon" src="{{item.wap_banner_url}}"></image>
                 <text class="txt">{{item.name}}</text>
             </navigator>
+            <view class="no-data" wx-if="{{currentCategory.subCategoryList && !currentCategory.subCategoryList.length}}">暂无商品</view>
         </view>
     </scroll-view>
   </view>

+ 5 - 0
pages/catalog/catalog.wxss

@@ -174,3 +174,8 @@ page {
   height: 72rpx;
   width: 160rpx;
 }
+
+.no-data {
+  text-align: center;
+  padding-top: 100rpx;
+}

+ 1 - 1
pages/category/category.js

@@ -43,7 +43,7 @@ Page({
     let that = this;
     util.request(api.GoodsCategory, { id: this.data.id })
       .then(function (res) {
-
+        
         if (res.errno == 0) {
           that.setData({
             navList: res.data.brotherCategory,

+ 2 - 1
pages/category/category.wxml

@@ -10,11 +10,12 @@
 
     <view class="cate-item">
         <view class="b">
-            <navigator hover-class="none" class="item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}"   url="/pages/goods/goods?id={{iitem.id}}" wx:for="{{goodsList}}" wx:for-item="iitem" wx:for-index="iindex" >
+            <navigator hover-class="none" class="item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}"   url="/pages/goods/goods?id={{iitem.id}}" wx:for="{{ goodsList }}" wx:for-item="iitem" wx:for-index="iindex" >
                 <image mode="aspectFit" class="img" src="{{iitem.list_pic_url}}" background-size="cover"></image>
                 <text class="name">{{iitem.name}}</text>
                 <text class="price">¥{{iitem.retail_price}}</text>
             </navigator>
+            <view class="no-data" wx-if="{{goodsList && !goodsList.length}}">暂无商品</view>
         </view>
     </view>
 

+ 4 - 0
pages/category/category.wxss

@@ -132,6 +132,10 @@
 .loadmore text {
   color: #999;
 }
+.no-data {
+  text-align: center;
+  padding-top: 100rpx;
+}
 
 @keyframes loading {
   0% {transform: rotate(0deg)}

+ 1 - 1
pages/goods/goods.js

@@ -186,7 +186,7 @@ Router({
 
   },
   getCheckedProductItem: function (key) {
-    console.log(this.data.productList)
+    console.log(this.data.productList, '1')
     return this.data.productList.filter(function (v) {
       console.log('----',v)
       console.log('--key--', key)

+ 2 - 2
pages/goods/goods.wxss

@@ -684,11 +684,11 @@
     display: inline-block;
     height: 62rpx;
     padding: 0 35rpx;
-    line-height: 56rpx;
+    line-height: 60rpx;
     text-align: center;
     margin-right: 25rpx;
     margin-bottom: 16.5rpx;
-    border: 1px solid #333;
+    border: 1px solid #ccc;
     font-size: 25rpx;
     color: #333;
 }

+ 1 - 1
pages/shopping/address/address.wxss

@@ -52,7 +52,7 @@ page{
 .address-list .default{
     width: 62.5rpx;
     height: 28rpx;
-    line-height: 28rpx;
+    line-height: 26rpx;
     text-align: center;
     font-size: 20rpx;
     color: #1fe4dc;

+ 12 - 0
pages/shopping/addressAdd/addressAdd.js

@@ -316,6 +316,18 @@ Page({
         wx.navigateBack({
           url: '/pages/shopping/address/address',
         })
+      } else{
+
+        wx.showModal({
+          title: '提示',
+          content: res.errmsg,
+          showCancel: false,
+          confirmColor:'#1fe4dc',
+          success: function (res) {
+
+          }
+        })
+     
       }
     });
 

+ 10 - 16
pages/shopping/checkout/checkout.js

@@ -41,7 +41,7 @@ Router({
     let that = this;
     var url = api.CartCheckout
     let buyType = this.data.isBuy ? 'buy' : 'cart'
-    util.request(url, { addressId: that.data.addressId, couponId: that.data.couponId, type: buyType }).then(function (res) {
+    return util.request(url, { addressId: that.data.addressId, couponId: that.data.couponId, type: buyType }).then(function (res) {
       if (res.errno === 0) {
         that.setData({
           checkedGoodsList: res.data.checkedGoodsList,
@@ -95,21 +95,15 @@ Router({
     wx.showLoading({
       title: '加载中...',
     })
-    this.getCheckoutInfo(); 
-    try {
-      setTimeout(()=>{
-        var addressId = wx.getStorageSync('addressId');
-        if (addressId) {
-          this.setData({
-            'addressId': addressId
-          });
-        }
-        this.getAddressDetail(addressId)
-      })
-    } catch (e) {
-      // Do something when catch error
-    }
-
+    this.getCheckoutInfo().then(res => {
+      var addressId = wx.getStorageSync('addressId');
+      if (addressId) {
+        this.setData({
+          'addressId': addressId
+        });
+      }
+      this.getAddressDetail(addressId)
+    })
   },
 
   /**

+ 1 - 1
project.config.json

@@ -21,7 +21,7 @@
 	},
 	"compileType": "miniprogram",
 	"libVersion": "2.10.3",
-	"appid": "wxb4c0527aa20a6e9a",
+	"appid": "wx0509bd21546d1597",
 	"projectname": "wxshop",
 	"simulatorType": "wechat",
 	"simulatorPluginLibVersion": {},