1
0
hyq 6 роки тому
батько
коміт
d68e25fc9b

+ 5 - 5
kmall-admin/src/main/webapp/WEB-INF/page/shop/goods.html

@@ -103,6 +103,11 @@
         <i-form ref="formValidate" :model="goods" :rules="ruleValidate" :label-width="140">
         <Tabs value="name1">
             <Tab-Pane label="通用信息" name="name1">
+                <Row>
+                    <i-col span="16" style="margin-top: -10px;">
+                        <span style="margin-left: 140px;color: red;font-size: 12px;">* 修改商品二级分类将清空商品参数列表</span>
+                    </i-col>
+                </Row>
                 <!--<i-form ref="formValidate" :model="goods" :rules="ruleValidate" :label-width="80">-->
                     <Form-item label="商品类型" prop="categoryId" style="height: 30px;">
                         <!--<i-input v-model="goods.categoryName" @on-click="categoryTree" icon="eye" readonly="readonly" placeholder="商品类型"/>-->
@@ -119,11 +124,6 @@
                             </i-option>
                         </i-select>
                     </Form-item>
-                    <Row>
-                        <i-col span="16" style="margin-top: -10px;">
-                            <span style="margin-left: 140px;color: red;font-size: 12px;">* 修改商品二级分类将清空商品参数列表</span>
-                        </i-col>
-                    </Row>
                     <Form-item label="商品编码" prop="goodsSn">
                         <i-input v-model="goods.goodsSn" placeholder="商品编码"/>
                     </Form-item>

+ 1 - 1
kmall-api/src/main/java/com/kmall/api/api/ApiGoodsController.java

@@ -594,7 +594,7 @@ public class ApiGoodsController extends ApiBaseAction {
         params.put("goodsBizType", goodsBizType);
         CategoryVo categoryVo = categoryService.queryObject(categoryId);
         if(categoryVo != null){
-            if(categoryVo.getSort_order()==0 && categoryVo.getParent_id() ==0){
+            if(categoryVo.getSort_order()!= null && categoryVo.getSort_order()== 0){
             }else{
                 params.put("category_parent_id", categoryId);
             }

+ 32 - 1
kmall-api/src/main/java/com/kmall/api/api/ApiRegionController.java

@@ -3,10 +3,14 @@ package com.kmall.api.api;
 import com.kmall.api.annotation.IgnoreAuth;
 import com.kmall.common.cache.RegionCacheUtil;
 import com.kmall.api.entity.RegionVo;
+import com.kmall.common.dao.SysRegionDao;
 import com.kmall.common.entity.SysRegionEntity;
 import com.kmall.api.service.ApiTopicService;
 import com.kmall.api.util.ApiBaseAction;
+import com.kmall.common.security.session.JedisSessionDAO;
+import com.kmall.common.service.SysRegionService;
 import com.kmall.common.utils.StringUtils;
+import com.kmall.common.utils.redis.JedisUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -27,13 +31,40 @@ import java.util.Map;
 public class ApiRegionController extends ApiBaseAction {
     @Autowired
     private ApiTopicService topicService;
+    @Autowired
+    private SysRegionService sysRegionService;
+    // session 在redis过期时间是30分钟30*60
+    private static int expireTime = 1800;
 
     /**
      */
     @IgnoreAuth
     @GetMapping("list")
     public Object list(Integer parentId) {
-        List<SysRegionEntity> regionEntityList = RegionCacheUtil.getChildrenByParentId(parentId);
+        List<SysRegionEntity> regionEntityList = new ArrayList();
+        Map<String,Object> queryListMap = new HashMap<>();
+        Map<String, Object> listMap = JedisUtil.getObjectMap("sysRegionEntityList");
+        if(listMap == null){
+            List<SysRegionEntity> sysRegionEntityList= sysRegionService.queryList(new HashMap<String, Object>());
+            queryListMap.put("sysRegionEntityList",sysRegionEntityList);
+            JedisUtil.setObjectMap("sysRegionEntityList", queryListMap, expireTime);
+            for (SysRegionEntity areaVo : sysRegionEntityList) {
+                if (null != areaVo.getParentId() && parentId.equals(areaVo.getParentId())) {
+                    regionEntityList.add(areaVo);
+                }
+            }
+        }else{
+            Map<byte[], byte[]> map = new HashMap<byte[], byte[]>();
+            for (Map.Entry<String, Object> e : listMap.entrySet()) {
+                List<Object> objectList =  (List<Object>)listMap.get(e.getKey());
+                for (Object o:objectList){
+                    SysRegionEntity sysRegionEntity = (SysRegionEntity)o;
+                    if (null != sysRegionEntity.getParentId() && parentId.equals(sysRegionEntity.getParentId())) {
+                        regionEntityList.add(sysRegionEntity);
+                    }
+                }
+            }
+        }
         List<RegionVo> regionVoList = new ArrayList();
         if (null != regionEntityList && regionEntityList.size() > 0) {
             for (SysRegionEntity sysRegionEntity : regionEntityList) {

+ 30 - 0
kmall-common/src/main/java/com/kmall/common/service/SysRegionService.java

@@ -0,0 +1,30 @@
+package com.kmall.common.service;
+
+import com.kmall.common.entity.SysLogEntity;
+import com.kmall.common.entity.SysRegionEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ * @author Scott
+ * @email
+ * @date 2017-03-08 10:40:56
+ */
+public interface SysRegionService {
+
+    SysRegionEntity queryObject(Long id);
+
+    List<SysRegionEntity> queryList(Map<String, Object> map);
+
+    int queryTotal(Map<String, Object> map);
+
+    void save(SysRegionEntity regionEntity);
+
+    void update(SysRegionEntity regionEntity);
+
+    void delete(Long id);
+
+    void deleteBatch(Long[] ids);
+}

+ 53 - 0
kmall-common/src/main/java/com/kmall/common/service/impl/SysRegionServiceImpl.java

@@ -0,0 +1,53 @@
+package com.kmall.common.service.impl;
+
+import com.kmall.common.dao.SysRegionDao;
+import com.kmall.common.entity.SysRegionEntity;
+import com.kmall.common.service.SysRegionService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+
+@Service("sysRegionService")
+public class SysRegionServiceImpl implements SysRegionService {
+	@Autowired
+	private SysRegionDao regionDao;
+	
+	@Override
+	public SysRegionEntity queryObject(Long id){
+		return regionDao.queryObject(id);
+	}
+	
+	@Override
+	public List<SysRegionEntity> queryList(Map<String, Object> map){
+		return regionDao.queryList(map);
+	}
+	
+	@Override
+	public int queryTotal(Map<String, Object> map){
+		return regionDao.queryTotal(map);
+	}
+	
+	@Override
+	public void save(SysRegionEntity sysRegionEntity){
+		regionDao.save(sysRegionEntity);
+	}
+	
+	@Override
+	public void update(SysRegionEntity sysRegionEntity){
+		regionDao.update(sysRegionEntity);
+	}
+	
+	@Override
+	public void delete(Long id){
+		regionDao.delete(id);
+	}
+	
+	@Override
+	public void deleteBatch(Long[] ids){
+		regionDao.deleteBatch(ids);
+	}
+	
+}

+ 1 - 1
wx-mall/app.json

@@ -55,7 +55,7 @@
   "window": {
     "backgroundTextStyle": "dark",
     "navigationBarBackgroundColor": "#fff",
-    "navigationBarTitleText": "中网跨境商",
+    "navigationBarTitleText": "中网跨境商",
     "navigationBarTextStyle": "black",
     "enablePullDownRefresh": false
   },

+ 1 - 1
wx-mall/app.wxss

@@ -268,7 +268,7 @@ view, text {
 .fast-nav {
   position: fixed;
   right: 20rpx;
-  bottom: 130rpx;
+  bottom: 180rpx;
   z-index: 9999;
   display: flex;
   flex-direction: column;

+ 4 - 0
wx-mall/pages/cart/cart.js

@@ -90,9 +90,13 @@ Page({
   getCartList: function () {//获取购物车数据
     let that = this;
     util.request(api.CartList).then(function (res) {
+      wx.showLoading({
+        title: '加载中...',
+      });
       if (res.errno === 0) {
         that.setCommonData(res);
       }
+      wx.hideLoading();
       //数据渲染选中
       that.setCheckedData();
     });

+ 1 - 1
wx-mall/pages/cart/cart.wxss

@@ -466,7 +466,7 @@ page {
   padding: 0 20rpx;
   margin: 11.5rpx 0 22rpx 0;
   text-align: center;
-  font-size: 30rpx;
+  font-size: 26rpx;
   color: #333;
 }
 

+ 1 - 1
wx-mall/pages/catalog/catalog.wxss

@@ -69,7 +69,7 @@ page {
 
 .catalog .nav .item.active {
   color: #ab2b2b;
-  font-size: 36rpx;
+  font-size: 30rpx;
   border-left: 6rpx solid #ab2b2b;
 }
 

+ 4 - 0
wx-mall/pages/goods/goods.js

@@ -44,6 +44,9 @@ Page({
     });
   },
   getGoodsInfo: function () {
+    wx.showLoading({
+      title: '加载中...',
+    });
     let that = this;
     util.request(api.GoodsDetail, { id: that.data.id, referrer: this.data.referrer }).then(function (res) {
       if (res.errno === 0) {
@@ -61,6 +64,7 @@ Page({
           cartNumber: res.data.cartNumber,
           defaultFreight: res.data.defaultFreight
         });
+        wx.hideLoading();
 
         if (res.data.userHasCollect == 1) {
           that.setData({

+ 1 - 1
wx-mall/pages/index/index.wxss

@@ -305,7 +305,7 @@
   display: block;
   color: #333;
   line-height: 50rpx;
-  font-size: 30rpx;
+  font-size: 26rpx;
 }
 
 .a-popular .b .desc {

+ 11 - 9
wx-mall/pages/ucenter/addressAdd/addressAdd.js

@@ -89,14 +89,16 @@ Page({
   },
   chooseRegion() {
     let that = this;
-    this.setData({
-      openSelectRegion: !this.data.openSelectRegion
+    that.setData({
+      openSelectRegion: !that.data.openSelectRegion
     });
+    console.log(that.data.openSelectRegion);
 
     //设置区域选择数据
-    let address = this.data.address;
+    let address = that.data.address;
+    console.log(address);
     if (address.provinceId > 0 && address.cityId > 0 && address.countyId > 0) {
-      let selectRegionList = this.data.selectRegionList;
+      let selectRegionList = that.data.selectRegionList;
       selectRegionList[0].id = address.provinceId;
       selectRegionList[0].name = address.provinceName;
       selectRegionList[0].parent_id = 1;
@@ -109,14 +111,14 @@ Page({
       selectRegionList[2].name = address.countyName;
       selectRegionList[2].parent_id = address.cityId;
 
-      this.setData({
+      that.setData({
         selectRegionList: selectRegionList,
         regionType: 3
       });
 
-      this.getRegionList(address.cityId);
+      that.getRegionList(address.cityId);
     } else {
-      this.setData({
+      that.setData({
         selectRegionList: [
           { id: 0, name: '省份', parent_id: 1, type: 1 },
           { id: 0, name: '城市', parent_id: 1, type: 2 },
@@ -124,10 +126,10 @@ Page({
         ],
         regionType: 1
       })
-      this.getRegionList(1);
+      that.getRegionList(1);
     }
 
-    this.setRegionDoneStatus();
+    that.setRegionDoneStatus();
 
   },
   onLoad: function (options) {

+ 6 - 6
wx-mall/pages/ucenter/index/index.wxss

@@ -29,8 +29,8 @@ page {
   /* position: absolute; */
   /* margin-left: 20rpx; */
   display: block;
-  width: 160rpx;
-  height: 160rpx;
+  width: 140rpx;
+  height: 140rpx;
   margin: 40rpx;
   /* margin-top: 80rpx; */
   border-radius: 50%;
@@ -54,13 +54,13 @@ page {
 }
 
 .userlevel {
-  font-size: 16px;
+  font-size: 14px;
   color: red;
 }
 .item-all {
   width: 100%;
-  height: 50rpx;
-  line-height: 50rpx;
+  height: 60rpx;
+  line-height: 60rpx;
   overflow: hidden;
   background: #fff;
   display: flex;
@@ -305,7 +305,7 @@ page {
 }
 .txt-info{
   display: block;
-  font-size: 15px;
+  font-size: 12px;
   color: red;
   height: 40rpx;
   border-radius: 50%;

+ 1 - 1
wx-mall/pages/ucenter/orderDetail/orderDetail.wxml

@@ -54,7 +54,7 @@
   </view>
   <view class="order-info">
     <view class="item-a"><image src="../../../static/images/service-hsdz.png" class="icon"></image> {{orderInfo.consignee}}     {{orderInfo.mobile}}</view>
-    <view class="item-b2">收货地址:{{orderInfo.address}}</view>
+    <view class="item-b2">收货地址:{{orderInfo.province}}{{orderInfo.city}}{{orderInfo.district}}{{orderInfo.address}}</view>
   </view>
 
   <view class="list-group goods-info">