diff --git a/README.md b/README.md index 7110566704a60856672283321921625f98dec33b..fe71c133af524d517936ad975b198a250210d5f2 100644 --- a/README.md +++ b/README.md @@ -9,41 +9,6 @@ litemall = Spring Boot后端 + Vue管理员前端 + 微信小程序用户前端 * [FAQ](https://linlinjava.gitbook.io/litemall/faq) * [API](https://linlinjava.gitbook.io/litemall/api) -## 项目实例 - -### 小商场实例 - -* renard-wx模块实例 - -![](./doc/pics/readme/renard_wx_demo.png) - -> 注意:此实例是真实小商场,开发者可以购买商品和付款,但请不要尝试退款操作。 - -* litemall-wx模块实例 - -![](./doc/pics/readme/litemall_wx_demo.png) - -> 注意:此实例是测试小商场,开发者请不要尝试购买商品、付款、退款操作。 - -### 轻商场实例 - -请手机扫描以下二维码访问: - -![](./doc/pics/readme/mobmall.png) - -或者浏览器采用手机模式访问以下网址: [http://122.51.199.160:8080/vue/index.html#/](http://122.51.199.160:8080/vue/index.html#/) - -注意: -> 1. 由于第一次加载数据量较大,建议wifi网络访问,且耐心等待数秒。 -> 2. 此实例是测试轻商场,不支持支付,而且处于开发中还不完善。 - -### 管理后台实例 - -![](./doc/pics/readme/admin-dashboard.png) - -1. 浏览器打开,输入以下网址: [http://122.51.199.160:8080/#/login](http://122.51.199.160:8080/#/login) -2. 管理员用户名`admin123`,管理员密码`admin123` -> 注意:此实例只是测试管理后台,不是前两个小商城的管理后台。 ## 项目代码 @@ -152,98 +117,6 @@ litemall = Spring Boot后端 + Vue管理员前端 + 微信小程序用户前端 注意: > 现在功能很不稳定,处在开发阶段。 -## 开发计划 - -当前版本[v1.7.0](https://linlinjava.gitbook.io/litemall/changelog) - -目前项目开发中,存在诸多不足,以下是目前规划的开发计划。 - -V 1.0.0 完成以下目标: - -1. 除了部分功能(如优惠券等),小商城的优化和改进基本结束; -2. 管理后台基本实现所有表的CRUD操作; -3. 后端服务能够对参数进行检验。 - -V 2.0.0 完成以下目标: - -1. 小商城和管理后台完成所有基本业务; -2. 管理后台实现统计功能、日志功能、权限功能; -3. 业务代码和细节代码进行调整优化; -4. 轻商城的开发; - -V 3.0.0 完成以下目标: - -1. 管理后台一些辅助功能 -2. 后端服务加强安全功能、配置功能 -3. 缓存功能以及优化一些性能 - -## 警告 - -> 1. 本项目仅用于学习练习 -> 2. 本项目还不完善,仍处在开发中,不承担任何使用后果 -> 3. 本项目代码开源[MIT](./LICENSE),项目文档采用 [署名-禁止演绎 4.0 国际协议许可](https://creativecommons.org/licenses/by-nd/4.0/deed.zh) - -## 致谢 - -本项目基于或参考以下项目: - -1. [nideshop-mini-program](https://github.com/tumobi/nideshop-mini-program) - - 项目介绍:基于Node.js+MySQL开发的开源微信小程序商城(微信小程序) - - 项目参考: - - 1. litemall项目数据库基于nideshop-mini-program项目数据库; - 2. litemall项目的litemall-wx模块基于nideshop-mini-program开发。 - -2. [vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) - - 项目介绍: 一个基于Vue和Element的后台集成方案 - - 项目参考:litemall项目的litemall-admin模块的前端框架基于vue-element-admin项目修改扩展。 - -3. [mall-admin-web](https://github.com/macrozheng/mall-admin-web) - - 项目介绍:mall-admin-web是一个电商后台管理系统的前端项目,基于Vue+Element实现。 - - 项目参考:litemall项目的litemall-admin模块的一些页面布局样式参考了mall-admin-web项目。 - -4. [biu](https://github.com/CaiBaoHong/biu) - - 项目介绍:管理后台项目开发脚手架,基于vue-element-admin和springboot搭建,前后端分离方式开发和部署。 - - 项目参考:litemall项目的权限管理功能参考了biu项目。 - -5. [vant--mobile-mall](https://github.com/qianzhaoy/vant--mobile-mall) - - 项目介绍:基于有赞 vant 组件库的移动商城。 - - 项目参考:litemall项目的litemall-vue模块基于vant--mobile-mall项目开发。 - -## 推荐 - -1. [Flutter_Mall](https://github.com/youxinLu/mall) - - 项目介绍:Flutter_Mall是一款Flutter开源在线商城应用程序。 - -2. [Taro_Mall](https://github.com/jiechud/taro-mall) - - 项目介绍:Taro_Mall是一款多端开源在线商城应用程序,后台是基于litemall基础上进行开发,前端采用Taro框架编写。 - - -## 问题 - -![](doc/pics/readme/qq3.png) - - * 开发者有问题或者好的建议可以用Issues反馈交流,请给出详细信息 - * 在开发交流群中应讨论开发、业务和合作问题 - * 如果真的需要QQ群里提问,请在提问前先完成以下过程: - * 请仔细阅读本项目文档,特别是是[**FAQ**](https://linlinjava.gitbook.io/litemall/faq),查看能否解决; - * 请阅读[提问的智慧](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md); - * 请百度或谷歌相关技术; - * 请查看相关技术的官方文档,例如微信小程序的官方文档; - * 请提问前尽可能做一些DEBUG或者思考分析,然后提问时给出详细的错误相关信息以及个人对问题的理解。 - ## License [MIT](https://github.com/linlinjava/litemall/blob/master/LICENSE) diff --git a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/service/AdminOrderService.java b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/service/AdminOrderService.java index daae6ee23d44b77950009ea7feaada7be94f138a..95ad409fdc1a37fcd1fd0f02a9c3d65a037221e1 100644 --- a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/service/AdminOrderService.java +++ b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/service/AdminOrderService.java @@ -6,6 +6,10 @@ import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.WxPayService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.subject.Subject; +import org.linlinjava.litemall.core.express.ExpressService; +import org.linlinjava.litemall.core.express.dao.ExpressInfo; import org.linlinjava.litemall.core.notify.NotifyService; import org.linlinjava.litemall.core.notify.NotifyType; import org.linlinjava.litemall.core.util.JacksonUtil; @@ -21,6 +25,7 @@ import org.springframework.util.StringUtils; import java.math.BigDecimal; import java.time.LocalDateTime; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -50,10 +55,22 @@ public class AdminOrderService { private LogHelper logHelper; @Autowired private LitemallCouponUserService couponUserService; + @Autowired + private LitemallWalletService walletService; + @Autowired + private ExpressService expressService; public Object list(Integer userId, String orderSn, LocalDateTime start, LocalDateTime end, List orderStatusArray, Integer page, Integer limit, String sort, String order) { - List orderList = orderService.querySelective(userId, orderSn, start, end, orderStatusArray, page, limit, + Subject currentUser = SecurityUtils.getSubject(); + LitemallAdmin admin = (LitemallAdmin) currentUser.getPrincipal(); + if(admin.getRoleIds()[0] == 3) { + List orderList = orderService.queryByPromotion(userId, orderSn, admin.getId(), start, end, orderStatusArray, page, limit, + sort, order); + return ResponseUtil.okList(orderList); + } + + List orderList = orderService.querySelective(userId, orderSn, start, end, orderStatusArray, page, limit, sort, order); return ResponseUtil.okList(orderList); } @@ -66,6 +83,16 @@ public class AdminOrderService { data.put("order", order); data.put("orderGoods", orderGoods); data.put("user", user); + + String mobile = order.getMobile(); + mobile = mobile.substring(7); + ExpressInfo ei = expressService.getExpressInfo(order.getShipChannel(), order.getShipSn(), mobile); + if(ei == null){ + data.put("expressInfo", null); + } + else { + data.put("expressInfo", ei); + } return ResponseUtil.ok(data); } @@ -96,8 +123,10 @@ public class AdminOrderService { if (StringUtils.isEmpty(refundMoney)) { return ResponseUtil.badArgument(); } - + System.out.println(orderId); LitemallOrder order = orderService.findById(orderId); + + if (order == null) { return ResponseUtil.badArgument(); } @@ -111,6 +140,56 @@ public class AdminOrderService { return ResponseUtil.fail(ORDER_CONFIRM_NOT_ALLOWED, "订单不能确认收货"); } + //钱包退款,购买时订单中标记了是否余额钱包支付 + //TODO:优化重复逻辑 + if(order.getRefundType()!=null && order.getRefundType().compareToIgnoreCase("钱包")==0){ + String resn = order.getOrderSn();//DbUtil.randomString(10); + walletService.recharge(resn,order.getUserId(),order.getActualPrice(),1); + walletService.DoDeposit(order.getUserId(),order.getActualPrice()); + // 设置订单取消状态 + order.setOrderStatus(OrderUtil.STATUS_REFUND_CONFIRM); + + // 记录订单退款相关信息 + LocalDateTime now = LocalDateTime.now(); + order.setEndTime(now); + order.setRefundAmount(order.getActualPrice()); + order.setRefundType("钱包退款接口"); + order.setRefundContent(order.getOrderSn()); + order.setRefundTime(now); + + System.out.println("钱包退款"); + orderService.updateWithOptimisticLocker(order); + // 商品货品数量增加 + List orderGoodsList = orderGoodsService.queryByOid(orderId); + for (LitemallOrderGoods orderGoods : orderGoodsList) { + Integer productId = orderGoods.getProductId(); + Short number = orderGoods.getNumber(); + if (productService.addStock(productId, number) == 0) { + throw new RuntimeException("商品货品库存增加失败"); + } + } + + // 返还优惠券 + List couponUsers = couponUserService.findByOid(orderId); + for (LitemallCouponUser couponUser: couponUsers) { + // 优惠券状态设置为可使用 + couponUser.setStatus(CouponUserConstant.STATUS_USABLE); + couponUser.setUpdateTime(LocalDateTime.now()); + couponUserService.update(couponUser); + } + + LitemallUser userinfo = userService.findById(order.getUserId()); + + //TODO 发送邮件和短信通知,这里采用异步发送 + // 退款成功通知用户, 例如“您申请的订单退款 [ 单号:{1} ] 已成功,请耐心等待到账。” + // 注意订单号只发后6位 + notifyService.notifySmsTemplate(userinfo.getMobile(), NotifyType.REFUND, + new String[]{order.getOrderSn().substring(8, 14)}); + + logHelper.logOrderSucceed("余额退款", "订单编号 " + order.getOrderSn()); + return ResponseUtil.ok(); + } + // 微信退款 WxPayRefundRequest wxPayRefundRequest = new WxPayRefundRequest(); wxPayRefundRequest.setOutTradeNo(order.getOrderSn()); @@ -168,10 +247,12 @@ public class AdminOrderService { couponUserService.update(couponUser); } + LitemallUser userinfo = userService.findById(order.getUserId()); + //TODO 发送邮件和短信通知,这里采用异步发送 // 退款成功通知用户, 例如“您申请的订单退款 [ 单号:{1} ] 已成功,请耐心等待到账。” // 注意订单号只发后6位 - notifyService.notifySmsTemplate(order.getMobile(), NotifyType.REFUND, + notifyService.notifySmsTemplate(userinfo.getMobile(), NotifyType.REFUND, new String[]{order.getOrderSn().substring(8, 14)}); logHelper.logOrderSucceed("退款", "订单编号 " + order.getOrderSn()); @@ -217,7 +298,7 @@ public class AdminOrderService { //TODO 发送邮件和短信通知,这里采用异步发送 // 发货会发送通知短信给用户: * // "您的订单已经发货,快递公司 {1},快递单 {2} ,请注意查收" - notifyService.notifySmsTemplate(order.getMobile(), NotifyType.SHIP, new String[]{shipChannel, shipSn}); + //notifyService.notifySmsTemplate(order.getMobile(), NotifyType.SHIP, new String[]{shipChannel, shipSn}); logHelper.logOrderSucceed("发货", "订单编号 " + order.getOrderSn()); return ResponseUtil.ok(); diff --git a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/shiro/AdminAuthorizingRealm.java b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/shiro/AdminAuthorizingRealm.java index 505f3ec453e52ef56f840d9a9cf383107a551567..164140df2e54d601daf2ba93db5f70777dc0606e 100644 --- a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/shiro/AdminAuthorizingRealm.java +++ b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/shiro/AdminAuthorizingRealm.java @@ -15,6 +15,7 @@ import org.linlinjava.litemall.db.service.LitemallRoleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.Assert; import org.springframework.util.StringUtils; +import org.springframework.util.DigestUtils; import java.util.List; import java.util.Set; @@ -67,10 +68,16 @@ public class AdminAuthorizingRealm extends AuthorizingRealm { BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); if (!encoder.matches(password, admin.getPassword())) { - throw new UnknownAccountException("找不到用户(" + username + ")的帐号信息"); + if(!admin.getPassword().equalsIgnoreCase( getMD5(password) )) { + throw new UnknownAccountException("找不到用户(" + username + ")的帐号信息"); + } } return new SimpleAuthenticationInfo(admin, password, getName()); } + + private String getMD5(String base) { + return DigestUtils.md5DigestAsHex(base.getBytes()); + } } diff --git a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/shiro/AdminWebSessionManager.java b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/shiro/AdminWebSessionManager.java index e2795bbb0ea25a155c6d84bee97fe8fb9bf0549b..0bc0d371084847d547cd0f2fa680f3c8b84d2fb7 100644 --- a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/shiro/AdminWebSessionManager.java +++ b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/shiro/AdminWebSessionManager.java @@ -14,6 +14,10 @@ public class AdminWebSessionManager extends DefaultWebSessionManager { public static final String LOGIN_TOKEN_KEY = "X-Litemall-Admin-Token"; private static final String REFERENCED_SESSION_ID_SOURCE = "Stateless request"; + public AdminWebSessionManager() { + this.setGlobalSessionTimeout(3600*1000); //1个小时session超时 + } + @Override protected Serializable getSessionId(ServletRequest request, ServletResponse response) { String id = WebUtils.toHttp(request).getHeader(LOGIN_TOKEN_KEY); diff --git a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/util/PermissionUtil.java b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/util/PermissionUtil.java index 7b6a0c2aaf03a5c4b83f3c264ab6a01c6c6b6961..30d99197842fb9ea202b3a6b8b490f42565bf3c6 100644 --- a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/util/PermissionUtil.java +++ b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/util/PermissionUtil.java @@ -78,7 +78,7 @@ public class PermissionUtil { // TODO // 目前限制Controller里面每个方法的RequiresPermissionsDesc注解是唯一的 // 如果允许相同,可能会造成内部权限不一致。 - throw new RuntimeException("权限已经存在,不能添加新权限"); + // throw new RuntimeException("权限已经存在,不能添加新权限"); } } diff --git a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAdminController.java b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAdminController.java index a8bc1b2b4d7fc1259125f729b034c1895ec6bd57..aecd29cedd7493b48016b17b6bd8885ad6a4b6f1 100644 --- a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAdminController.java +++ b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAdminController.java @@ -14,13 +14,17 @@ import org.linlinjava.litemall.core.validator.Order; import org.linlinjava.litemall.core.validator.Sort; import org.linlinjava.litemall.db.domain.LitemallAdmin; import org.linlinjava.litemall.db.service.LitemallAdminService; +import org.linlinjava.litemall.db.service.LitemallSystemConfigService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.validation.constraints.NotNull; + +import java.util.HashMap; import java.util.List; +import java.util.Map; import static org.linlinjava.litemall.admin.util.AdminResponseCode.*; @@ -34,6 +38,8 @@ public class AdminAdminController { private LitemallAdminService adminService; @Autowired private LogHelper logHelper; + @Autowired + private LitemallSystemConfigService systemConfigService; @RequiresPermissions("admin:admin:list") @RequiresPermissionsDesc(menu = {"系统管理", "管理员管理"}, button = "查询") @@ -98,10 +104,10 @@ public class AdminAdminController { @RequiresPermissionsDesc(menu = {"系统管理", "管理员管理"}, button = "编辑") @PostMapping("/update") public Object update(@RequestBody LitemallAdmin admin) { - Object error = validate(admin); - if (error != null) { - return error; - } +// Object error = validate(admin); +// if (error != null) { +// return error; +// } Integer anotherAdminId = admin.getId(); if (anotherAdminId == null) { @@ -139,4 +145,78 @@ public class AdminAdminController { logHelper.logAuthSucceed("删除管理员", admin.getUsername()); return ResponseUtil.ok(); } + + @RequiresPermissions("admin:admin:userlist") + @RequiresPermissionsDesc(menu = {"系统管理", "商场管理员及推广人员管理"}, button = "查询") + @GetMapping("/userlist") + public Object userlist(String nikename, Integer usertype, + @RequestParam(defaultValue = "1") Integer page, + @RequestParam(defaultValue = "10") Integer limit, + @Sort @RequestParam(defaultValue = "add_time") String sort, + @Order @RequestParam(defaultValue = "desc") String order) { + List adminList = adminService.querySelective(nikename, usertype, page, limit, sort, order); + return ResponseUtil.okList(adminList); + } + + @PostMapping("/createuser") + public Object createUser(@RequestBody LitemallAdmin admin) { + if(admin.getRoleIds().length > 0 && admin.getRoleIds()[0] == 3) { + Map config = systemConfigService.queryAll(); + for(Map.Entry entry : config.entrySet()){ + String mapKey = entry.getKey(); + + if(mapKey.equals("litemall_promocode_last")) { + String mapValue = entry.getValue(); + int value = Integer.valueOf(mapValue); + mapValue = String.format("%04d", value+1); + admin.setPromoCode(mapValue); + + Map map = new HashMap(); //数据采用的哈希表结构 + map.put("litemall_promocode_last", mapValue); + systemConfigService.updateConfig(map); + break; + } + } + } + + return create(admin); + } + + @PostMapping("/updateuser") + public Object updateUser(@RequestBody LitemallAdmin admin) { + return update(admin); + } + + @PostMapping("/deleteuser") + public Object deleteUser(@RequestBody LitemallAdmin admin) { + return delete(admin); + } + + @GetMapping("/resetpassword") + public Object resetPassword(Integer id) { + Integer anotherAdminId = id; + if (anotherAdminId == null) { + return ResponseUtil.badArgument(); + } + + LitemallAdmin admin = new LitemallAdmin(); + admin.setId(id); + + String rawPassword = "123456"; + BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); + String encodedPassword = encoder.encode(rawPassword); + admin.setPassword(encodedPassword); + + adminService.updateById(admin); + return ResponseUtil.ok(); + } + + @GetMapping("/userinfo") + public Object userInfo() { + Subject currentUser = SecurityUtils.getSubject(); + LitemallAdmin admin = (LitemallAdmin) currentUser.getPrincipal(); + + LitemallAdmin adminInfo = adminService.findAdmin(admin.getId()); + return ResponseUtil.ok(adminInfo); + } } diff --git a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAftersaleController.java b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAftersaleController.java index 55877548989e6dc72860671dcbf00914d127b78f..74367cf358a18eb6dddfc23e9b69c40115da30e6 100644 --- a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAftersaleController.java +++ b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAftersaleController.java @@ -20,9 +20,13 @@ import org.linlinjava.litemall.db.domain.LitemallAftersale; import org.linlinjava.litemall.db.domain.LitemallGoodsProduct; import org.linlinjava.litemall.db.domain.LitemallOrder; import org.linlinjava.litemall.db.domain.LitemallOrderGoods; +import org.linlinjava.litemall.db.domain.LitemallUser; import org.linlinjava.litemall.db.service.*; import org.linlinjava.litemall.db.util.AftersaleConstant; +import org.linlinjava.litemall.db.util.DbUtil; import org.linlinjava.litemall.db.util.OrderUtil; +import org.linlinjava.litemall.db.domain.LitemallDepositLog; +import org.linlinjava.litemall.db.domain.LitemallWallet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -53,9 +57,13 @@ public class AdminAftersaleController { private WxPayService wxPayService; @Autowired private NotifyService notifyService; - + @Autowired + private LitemallWalletService walletService; + @Autowired + private LitemallUserService userService; + @RequiresPermissions("admin:aftersale:list") - @RequiresPermissionsDesc(menu = {"商城管理", "售后管理"}, button = "查询") + @RequiresPermissionsDesc(menu = {"商场管理", "售后管理"}, button = "查询") @GetMapping("/list") public Object list(Integer orderId, String aftersaleSn, Short status, @RequestParam(defaultValue = "1") Integer page, @@ -67,7 +75,7 @@ public class AdminAftersaleController { } @RequiresPermissions("admin:aftersale:recept") - @RequiresPermissionsDesc(menu = {"商城管理", "售后管理"}, button = "审核通过") + @RequiresPermissionsDesc(menu = {"商场管理", "售后管理"}, button = "审核通过") @PostMapping("/recept") public Object recept(@RequestBody LitemallAftersale aftersale) { Integer id = aftersale.getId(); @@ -89,7 +97,7 @@ public class AdminAftersaleController { } @RequiresPermissions("admin:aftersale:batch-recept") - @RequiresPermissionsDesc(menu = {"商城管理", "售后管理"}, button = "批量通过") + @RequiresPermissionsDesc(menu = {"商场管理", "售后管理"}, button = "批量通过") @PostMapping("/batch-recept") public Object batchRecept(@RequestBody String body) { List ids = JacksonUtil.parseIntegerList(body, "ids"); @@ -117,7 +125,7 @@ public class AdminAftersaleController { } @RequiresPermissions("admin:aftersale:reject") - @RequiresPermissionsDesc(menu = {"商城管理", "售后管理"}, button = "审核拒绝") + @RequiresPermissionsDesc(menu = {"商场管理", "售后管理"}, button = "审核拒绝") @PostMapping("/reject") public Object reject(@RequestBody LitemallAftersale aftersale) { Integer id = aftersale.getId(); @@ -139,7 +147,7 @@ public class AdminAftersaleController { } @RequiresPermissions("admin:aftersale:batch-reject") - @RequiresPermissionsDesc(menu = {"商城管理", "售后管理"}, button = "批量拒绝") + @RequiresPermissionsDesc(menu = {"商场管理", "售后管理"}, button = "批量拒绝") @PostMapping("/batch-reject") public Object batchReject(@RequestBody String body) { List ids = JacksonUtil.parseIntegerList(body, "ids"); @@ -163,7 +171,7 @@ public class AdminAftersaleController { } @RequiresPermissions("admin:aftersale:refund") - @RequiresPermissionsDesc(menu = {"商城管理", "售后管理"}, button = "退款") + @RequiresPermissionsDesc(menu = {"商场管理", "售后管理"}, button = "退款") @PostMapping("/refund") public Object refund(@RequestBody LitemallAftersale aftersale) { Integer id = aftersale.getId(); @@ -176,32 +184,40 @@ public class AdminAftersaleController { } Integer orderId = aftersaleOne.getOrderId(); LitemallOrder order = orderService.findById(orderId); - - // 微信退款 - WxPayRefundRequest wxPayRefundRequest = new WxPayRefundRequest(); - wxPayRefundRequest.setOutTradeNo(order.getOrderSn()); - wxPayRefundRequest.setOutRefundNo("refund_" + order.getOrderSn()); - // 元转成分 - Integer totalFee = aftersaleOne.getAmount().multiply(new BigDecimal(100)).intValue(); - wxPayRefundRequest.setTotalFee(order.getActualPrice().multiply(new BigDecimal(100)).intValue()); - wxPayRefundRequest.setRefundFee(totalFee); - - WxPayRefundResult wxPayRefundResult; - try { - wxPayRefundResult = wxPayService.refund(wxPayRefundRequest); - } catch (WxPayException e) { - logger.error(e.getMessage(), e); - return ResponseUtil.fail(ORDER_REFUND_FAILED, "订单退款失败"); - } - if (!wxPayRefundResult.getReturnCode().equals("SUCCESS")) { - logger.warn("refund fail: " + wxPayRefundResult.getReturnMsg()); - return ResponseUtil.fail(ORDER_REFUND_FAILED, "订单退款失败"); + if(order.getRefundType().compareToIgnoreCase("钱包")==0){ + String resn = order.getOrderSn();//DbUtil.randomString(10); + walletService.recharge(resn,order.getUserId(),order.getActualPrice(),1); + walletService.DoDeposit(order.getUserId(),order.getActualPrice()); + System.out.println("钱包退款"); } - if (!wxPayRefundResult.getResultCode().equals("SUCCESS")) { - logger.warn("refund fail: " + wxPayRefundResult.getReturnMsg()); - return ResponseUtil.fail(ORDER_REFUND_FAILED, "订单退款失败"); + else{ + // 微信退款 + WxPayRefundRequest wxPayRefundRequest = new WxPayRefundRequest(); + wxPayRefundRequest.setOutTradeNo(order.getOrderSn()); + wxPayRefundRequest.setOutRefundNo("refund_" + order.getOrderSn()); + // 元转成分 + Integer totalFee = aftersaleOne.getAmount().multiply(new BigDecimal(100)).intValue(); + wxPayRefundRequest.setTotalFee(totalFee); + wxPayRefundRequest.setRefundFee(totalFee); + + WxPayRefundResult wxPayRefundResult; + try { + wxPayRefundResult = wxPayService.refund(wxPayRefundRequest); + } catch (WxPayException e) { + logger.error(e.getMessage(), e); + return ResponseUtil.fail(ORDER_REFUND_FAILED, "订单退款失败"); + } + if (!wxPayRefundResult.getReturnCode().equals("SUCCESS")) { + logger.warn("refund fail: " + wxPayRefundResult.getReturnMsg()); + return ResponseUtil.fail(ORDER_REFUND_FAILED, "订单退款失败"); + } + if (!wxPayRefundResult.getResultCode().equals("SUCCESS")) { + logger.warn("refund fail: " + wxPayRefundResult.getReturnMsg()); + return ResponseUtil.fail(ORDER_REFUND_FAILED, "订单退款失败"); + } } + aftersaleOne.setStatus(AftersaleConstant.STATUS_REFUND); aftersaleOne.setHandleTime(LocalDateTime.now()); aftersaleService.updateById(aftersaleOne); @@ -219,11 +235,13 @@ public class AdminAftersaleController { goodsProductService.addStock(productId, number); } } + + LitemallUser userinfo = userService.findById(order.getUserId()); // 发送短信通知,这里采用异步发送 // 退款成功通知用户, 例如“您申请的订单退款 [ 单号:{1} ] 已成功,请耐心等待到账。” // TODO 注意订单号只发后6位 - notifyService.notifySmsTemplate(order.getMobile(), NotifyType.REFUND, + notifyService.notifySmsTemplate(userinfo.getMobile(), NotifyType.REFUND, new String[]{order.getOrderSn().substring(8, 14)}); logHelper.logOrderSucceed("退款", "订单编号 " + order.getOrderSn() + " 售后编号 " + aftersale.getAftersaleSn()); diff --git a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminConfigController.java b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminConfigController.java index f9232014d981c006feed4a9317481909036f5035..852400a6d6c8f5bab0d506221109e91fa4e08d0f 100644 --- a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminConfigController.java +++ b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminConfigController.java @@ -8,10 +8,17 @@ import org.linlinjava.litemall.core.system.SystemConfig; import org.linlinjava.litemall.core.util.JacksonUtil; import org.linlinjava.litemall.core.util.ResponseUtil; import org.linlinjava.litemall.db.service.LitemallSystemConfigService; +import org.linlinjava.litemall.db.service.LitemallWalletService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.type.CollectionLikeType; + +import java.util.HashMap; +import java.util.List; import java.util.Map; @RestController @@ -23,6 +30,9 @@ public class AdminConfigController { @Autowired private LitemallSystemConfigService systemConfigService; + @Autowired + private LitemallWalletService walletService; + @RequiresPermissions("admin:config:mall:list") @RequiresPermissionsDesc(menu = {"配置管理", "商场配置"}, button = "详情") @GetMapping("/mall") @@ -93,4 +103,29 @@ public class AdminConfigController { SystemConfig.updateConfigs(data); return ResponseUtil.ok(); } + + @RequiresPermissions("admin:config:express:list") + @RequiresPermissionsDesc(menu = {"配置管理", "充值配置"}, button = "详情") + @GetMapping("/recharge") + public Object rechargepolicy() { + List> data = walletService.listRechargeConfig(); + return ResponseUtil.ok(data); + } + + @RequiresPermissions("admin:config:express:updateConfigs") + @RequiresPermissionsDesc(menu = {"配置管理", "充值配置"}, button = "编辑") + @PostMapping("/recharge") + public Object updateRechargepolicy(@RequestBody String body) { + Map data = JacksonUtil.toMap(body); + Map newdata = new HashMap(); + for(String key : data.keySet()){ + newdata.put(key.substring(1),data.get(key)); + } + System.out.println(body); + System.out.println(newdata); + walletService.updateRechargeConfig(newdata); + + + return ResponseUtil.ok(); + } } diff --git a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminIntelligenceController.java b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminIntelligenceController.java new file mode 100644 index 0000000000000000000000000000000000000000..14b0d96989a5ee3c62b8e8e51b3210d536c17499 --- /dev/null +++ b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminIntelligenceController.java @@ -0,0 +1,53 @@ +package org.linlinjava.litemall.admin.web; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.linlinjava.litemall.admin.annotation.RequiresPermissionsDesc; +import org.linlinjava.litemall.core.util.ResponseUtil; +import org.linlinjava.litemall.core.validator.Order; +import org.linlinjava.litemall.core.validator.Sort; +import org.linlinjava.litemall.db.domain.LitemallFeedback; +import org.linlinjava.litemall.db.domain.LitemallIntelligence; +import org.linlinjava.litemall.db.domain.LitemallUser; +import org.linlinjava.litemall.db.service.LitemallFeedbackService; +import org.linlinjava.litemall.db.service.LitemallIntelligenceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author Yogeek + * @date 2018/8/26 1:11 + */ +@RestController +@RequestMapping("/admin/intelligence") +@Validated +public class AdminIntelligenceController { + private final Log logger = LogFactory.getLog(AdminIntelligenceController.class); + + @Autowired + private LitemallIntelligenceService intelligenceService; + + @RequiresPermissions("admin:intelligence:list") + @RequiresPermissionsDesc(menu = {"用户管理", "资质审核"}, button = "查询") + @GetMapping("/list") + public Object list(String enterprise, String username, String mobile, + @RequestParam(defaultValue = "1") Integer page, + @RequestParam(defaultValue = "10") Integer limit) { + List feedbackList = intelligenceService.querySelective(enterprise, username, mobile, page, limit); + return ResponseUtil.okList(feedbackList); + } + + @PostMapping("/review") + public Object userReview(@RequestBody LitemallIntelligence record) { + return ResponseUtil.ok(intelligenceService.updateById(record)); + } +} diff --git a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminUserController.java b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminUserController.java index 839a83d8397f0c2db3e7af9cb1b5a5bab0c06d1d..f42ccc471527521977422462c3ba1cf510b5ef07 100644 --- a/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminUserController.java +++ b/litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminUserController.java @@ -5,10 +5,13 @@ import org.apache.commons.logging.LogFactory; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.linlinjava.litemall.admin.annotation.RequiresPermissionsDesc; import org.linlinjava.litemall.core.util.ResponseUtil; +import org.linlinjava.litemall.core.util.bcrypt.BCryptPasswordEncoder; import org.linlinjava.litemall.core.validator.Order; import org.linlinjava.litemall.core.validator.Sort; import org.linlinjava.litemall.db.domain.LitemallUser; +import org.linlinjava.litemall.db.domain.LitemallWallet; import org.linlinjava.litemall.db.service.LitemallUserService; +import org.linlinjava.litemall.db.service.LitemallWalletService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; @@ -30,6 +33,8 @@ public class AdminUserController { @Autowired private LitemallUserService userService; + @Autowired + private LitemallWalletService walletService; @RequiresPermissions("admin:user:list") @RequiresPermissionsDesc(menu = {"用户管理", "会员管理"}, button = "查询") @@ -55,4 +60,49 @@ public class AdminUserController { public Object userUpdate(@RequestBody LitemallUser user) { return ResponseUtil.ok(userService.updateById(user)); } + + @GetMapping("/resetpassword") + public Object resetPassword(Integer id) { + Integer anotherAdminId = id; + if (anotherAdminId == null) { + return ResponseUtil.badArgument(); + } + + LitemallUser user = new LitemallUser(); + user.setId(id); + + String rawPassword = "123456"; + BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); + String encodedPassword = encoder.encode(rawPassword); + user.setPassword(encodedPassword); + + userService.updateById(user); + return ResponseUtil.ok(); + } + + @RequiresPermissions("admin:user:rechargelist") + @RequiresPermissionsDesc(menu = {"用户管理", "充值记录"}, button = "查询") + @GetMapping("/rechargelist") + public Object rechargeList(String username, String mobile, String userId, + @RequestParam(defaultValue = "1") Integer page, + @RequestParam(defaultValue = "10") Integer limit) { + return ResponseUtil.okList(walletService.getRechargeList(username, mobile, userId, page, limit)); + } + + @RequiresPermissions("admin:user:wallet") + @RequiresPermissionsDesc(menu = {"用户管理", "账户余额"}, button = "查询") + @GetMapping("/walletlist") + public Object walletList(String username, String mobile, String userId, + @RequestParam(defaultValue = "1") Integer page, + @RequestParam(defaultValue = "10") Integer limit) { + return ResponseUtil.okList(walletService.getWalletList(username, mobile, userId, page, limit)); + } + + @RequiresPermissions("admin:user:wallet") + @RequiresPermissionsDesc(menu = {"用户管理", "账户余额"}, button = "编辑") + @PostMapping("/deposit") + public Object DoDeposit(@RequestBody LitemallWallet user) { + walletService.updateDeposite(user.getUser_id(), user.getDeposite()); + return ResponseUtil.ok(); + } } diff --git a/litemall-admin/.env.deployment b/litemall-admin/.env.deployment index 5e42a2e892059a4bf17dff5b337e41c23206d95a..10758ff50d1b3deb1f928981337952ec58f48a67 100644 --- a/litemall-admin/.env.deployment +++ b/litemall-admin/.env.deployment @@ -4,5 +4,5 @@ NODE_ENV = production ENV = 'deploymenet' # base api -VUE_APP_BASE_API = 'http://122.51.199.160:8080/admin' +VUE_APP_BASE_API = 'http://shop.qibentang.com/admin' diff --git a/litemall-admin/.env.development b/litemall-admin/.env.development index 0ddbf114b798498f2a4c193f9f3e89a83b93a735..8b0b6154744434aa69a0d1d0f3cf7880286ce342 100644 --- a/litemall-admin/.env.development +++ b/litemall-admin/.env.development @@ -2,7 +2,7 @@ ENV = 'development' # base api -VUE_APP_BASE_API = 'http://localhost:8080/admin' +VUE_APP_BASE_API = 'http://localhost:8085/admin' # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, # to control whether the babel-plugin-dynamic-import-node plugin is enabled. diff --git a/litemall-admin/.env.production b/litemall-admin/.env.production index 4c05b967776c4189facc4988bdce4961d87ceee0..d1b200fe93f34bb1bd85457e7527058ef3732844 100644 --- a/litemall-admin/.env.production +++ b/litemall-admin/.env.production @@ -4,5 +4,5 @@ NODE_ENV = production ENV = 'production' # base api -VUE_APP_BASE_API = 'https://www.example.com/admin' +VUE_APP_BASE_API = 'https://shop.qibentang.com/admin' diff --git a/litemall-admin/package.json b/litemall-admin/package.json index 870fa83fdc7de00aa241865062df2cc210e93448..68b2a3a756db3a13f4c5777c1688208e81e81448 100644 --- a/litemall-admin/package.json +++ b/litemall-admin/package.json @@ -43,7 +43,7 @@ "url": "https://github.com/linlinjava/litemall/issues" }, "dependencies": { - "@tinymce/tinymce-vue": "3.0.1", + "@tinymce/tinymce-vue": "3.2.0", "lodash": "^4.17.11", "v-charts": "1.19.0", "axios": "0.18.1", diff --git a/litemall-admin/public/XtyQMzde3K.txt b/litemall-admin/public/XtyQMzde3K.txt new file mode 100644 index 0000000000000000000000000000000000000000..0aa7414e75149704047b70f5d798d5b27ae92bca --- /dev/null +++ b/litemall-admin/public/XtyQMzde3K.txt @@ -0,0 +1 @@ +bb647d27496d292dcb054ab3bb0455f2 \ No newline at end of file diff --git a/litemall-admin/public/app.html b/litemall-admin/public/app.html new file mode 100644 index 0000000000000000000000000000000000000000..64ad3cc56474edea93667b3cad9368eaf93dff5c --- /dev/null +++ b/litemall-admin/public/app.html @@ -0,0 +1,21 @@ + + + + + + + + 祁本堂商城 + + + 祁本堂药业有限公司是一家通过GMP认证的生产企业,公司品种齐全,药厂直接发货。 +
+
+ 联系电话:400-078-1617 +
+
+ 扫描下方二维码进入祁本堂小程序商城 +
+ + + diff --git a/litemall-admin/public/app.png b/litemall-admin/public/app.png new file mode 100644 index 0000000000000000000000000000000000000000..8cdaef8935928b0c89d529d5c6630c5bda5ab921 Binary files /dev/null and b/litemall-admin/public/app.png differ diff --git a/litemall-admin/public/userid/XtyQMzde3K.txt b/litemall-admin/public/userid/XtyQMzde3K.txt new file mode 100644 index 0000000000000000000000000000000000000000..0aa7414e75149704047b70f5d798d5b27ae92bca --- /dev/null +++ b/litemall-admin/public/userid/XtyQMzde3K.txt @@ -0,0 +1 @@ +bb647d27496d292dcb054ab3bb0455f2 \ No newline at end of file diff --git a/litemall-admin/src/api/admin.js b/litemall-admin/src/api/admin.js index e7db202a3e027e35c51813139582e8bc5bb38277..eb30c29c051b382a11a9ee5f0d4a0c11282a6338 100644 --- a/litemall-admin/src/api/admin.js +++ b/litemall-admin/src/api/admin.js @@ -39,3 +39,51 @@ export function deleteAdmin(data) { data }) } + +export function listUser(query) { + return request({ + url: '/admin/userlist', + method: 'get', + params: query + }) +} + +export function updateUser(data) { + return request({ + url: '/admin/updateuser', + method: 'post', + data + }) +} + +export function createUser(data) { + return request({ + url: '/admin/createuser', + method: 'post', + data + }) +} + +export function deleteUser(data) { + return request({ + url: '/admin/deleteuser', + method: 'post', + data + }) +} + +export function resetPassword(query) { + return request({ + url: '/admin/resetpassword', + method: 'get', + params: query + }) +} + +export function userInfo(query) { + return request({ + url: '/admin/userinfo', + method: 'get', + params: query + }) +} diff --git a/litemall-admin/src/api/config.js b/litemall-admin/src/api/config.js index 2b129b84ec8ec5f9075f812db477cf3102301eb2..38bd48ec824da6b1e630d56765e285aa6490c844 100644 --- a/litemall-admin/src/api/config.js +++ b/litemall-admin/src/api/config.js @@ -59,3 +59,18 @@ export function updateWx(data) { data }) } + +export function listRecharge() { + return request({ + url: '/config/recharge', + method: 'get' + }) +} + +export function updateRecharge(data) { + return request({ + url: '/config/recharge', + method: 'post', + data + }) +} diff --git a/litemall-admin/src/api/user.js b/litemall-admin/src/api/user.js index 33dc2f515bcf1bd53cb39bf7e863c9047789c1f3..ab4c816fc04e20b414ae52ef4e9c0f9e7c32f90d 100644 --- a/litemall-admin/src/api/user.js +++ b/litemall-admin/src/api/user.js @@ -12,7 +12,7 @@ export function userDetail(id) { return request({ url: '/user/detail', method: 'get', - params: {id} + params: { id } }) } @@ -24,6 +24,14 @@ export function updateUser(data) { }) } +export function resetPassword(query) { + return request({ + url: '/user/resetpassword', + method: 'get', + params: query + }) +} + export function listAddress(query) { return request({ url: '/address/list', @@ -63,3 +71,43 @@ export function listHistory(query) { params: query }) } + +export function listIntelligence(query) { + return request({ + url: '/intelligence/list', + method: 'get', + params: query + }) +} + +export function reviewIntelligence(data) { + return request({ + url: '/intelligence/review', + method: 'post', + data + }) +} + +export function listRecharge(query) { + return request({ + url: '/user/rechargelist', + method: 'get', + params: query + }) +} + +export function listWallet(query) { + return request({ + url: '/user/walletlist', + method: 'get', + params: query + }) +} + +export function updateWallet(data) { + return request({ + url: '/user/deposit', + method: 'post', + data + }) +} diff --git a/litemall-admin/src/router/index.js b/litemall-admin/src/router/index.js index 836d62e878584495c3d67ca129e25991b8203414..6296a2145b11ad4f8e6b165fc06992211fc23a45 100644 --- a/litemall-admin/src/router/index.js +++ b/litemall-admin/src/router/index.js @@ -142,6 +142,36 @@ export const asyncRoutes = [ title: '意见反馈', noCache: true } + }, + { + path: 'intelligence', + component: () => import('@/views/user/intelligence'), + name: 'intelligence', + meta: { + perms: ['GET /admin/intelligence/list'], + title: '资质审核', + noCache: true + } + }, + { + path: 'recharge', + component: () => import('@/views/user/recharge'), + name: 'recharge', + meta: { + perms: ['GET /admin/user/rechargelist'], + title: '充值记录', + noCache: true + } + }, + { + path: 'wallet', + component: () => import('@/views/user/wallet'), + name: 'wallet', + meta: { + perms: ['GET /admin/user/walletlist'], + title: '账户余额', + noCache: true + } } ] }, @@ -294,6 +324,16 @@ export const asyncRoutes = [ icon: 'chart' }, children: [ + { + path: 'chargepolicy', + component: () => import('@/views/promotion/chargepolicy'), + name: 'chargepolicy', + meta: { + perms: ['GET /admin/ad/list', 'POST /admin/ad/create', 'GET /admin/ad/read', 'POST /admin/ad/update', 'POST /admin/ad/delete'], + title: '充值管理', + noCache: true + } + }, { path: 'ad', component: () => import('@/views/promotion/ad'), @@ -401,6 +441,26 @@ export const asyncRoutes = [ noCache: true } }, + { + path: 'storeadmin', + component: () => import('@/views/sys/storeadmin'), + name: 'storeadmin', + meta: { + perms: ['GET /admin/admin/userlist'], + title: '后台管理员', + noCache: true + } + }, + { + path: 'promoter', + component: () => import('@/views/sys/promoter'), + name: 'promoter', + meta: { + perms: ['GET /admin/admin/userlist'], + title: '推广员管理', + noCache: true + } + }, { path: 'notice', component: () => import('@/views/sys/notice'), @@ -541,47 +601,6 @@ export const asyncRoutes = [ } ] }, - { - path: 'external-link', - component: Layout, - redirect: 'noredirect', - alwaysShow: true, - name: 'externalLink', - meta: { - title: '外链', - icon: 'link' - }, - children: [ - { - path: 'https://cloud.tencent.com/product/cos', - meta: { title: '腾讯云存储', icon: 'link' } - }, - { - path: 'https://cloud.tencent.com/product/sms', - meta: { title: '腾讯云短信', icon: 'link' } - }, - { - path: 'https://pay.weixin.qq.com/index.php/core/home/login', - meta: { title: '微信支付', icon: 'link' } - }, - { - path: 'https://mpkf.weixin.qq.com/', - meta: { title: '小程序客服', icon: 'link' } - }, - { - path: 'https://www.alibabacloud.com/zh/product/oss', - meta: { title: '阿里云存储', icon: 'link' } - }, - { - path: 'https://www.qiniu.com/products/kodo', - meta: { title: '七牛云存储', icon: 'link' } - }, - { - path: 'http://www.kdniao.com/api-track', - meta: { title: '快递鸟', icon: 'link' } - } - ] - }, { path: '/profile', component: Layout, @@ -599,6 +618,12 @@ export const asyncRoutes = [ component: () => import('@/views/profile/notice'), name: 'notice', meta: { title: '通知中心', noCache: true } + }, + { + path: 'userinfo', + component: () => import('@/views/profile/userinfo'), + name: 'userinfo', + meta: { title: '个人资料', noCache: true } } ], hidden: true diff --git a/litemall-admin/src/views/goods/create.vue b/litemall-admin/src/views/goods/create.vue index 312edefa27f77167c11bd347f6a9e009f8db278d..b884e5a96979ab31d818e6dbc19fb83688fa7259 100644 --- a/litemall-admin/src/views/goods/create.vue +++ b/litemall-admin/src/views/goods/create.vue @@ -105,6 +105,18 @@ +

商品规格

+ + + + 统货 + 选货 + + + +
+ +

商品规格

@@ -247,7 +259,7 @@
- +

商品参数

添加 @@ -359,10 +371,10 @@ export default { specVisiable: false, specForm: { specification: '', value: '', picUrl: '' }, multipleSpec: false, - specifications: [{ specification: '规格', value: '标准', picUrl: '' }], + specifications: [{ specification: '规格', value: '统货', picUrl: '' }], productVisiable: false, productForm: { id: 0, specifications: [], price: 0.00, number: 0, url: '' }, - products: [{ id: 0, specifications: ['标准'], price: 0.00, number: 0, url: '' }], + products: [{ id: 0, specifications: ['统货'], price: 0.00, number: 0, url: '' }], attributeVisiable: false, attributeForm: { attribute: '', value: '' }, attributes: [], @@ -374,6 +386,9 @@ export default { language: 'zh_CN', height: 500, convert_urls: false, + force_br_newlines: true, + force_p_newlines: false, + forced_root_block: '', plugins: ['advlist anchor autolink autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools importcss insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount'], toolbar: ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen'], images_upload_handler: function(blobInfo, success, failure) { @@ -487,11 +502,11 @@ export default { }, specChanged: function(label) { if (label === false) { - this.specifications = [{ specification: '规格', value: '标准', picUrl: '' }] - this.products = [{ id: 0, specifications: ['标准'], price: 0.00, number: 0, url: '' }] + this.specifications = [{ specification: '规格', value: '统货', picUrl: '' }] + this.products = [{ id: 0, specifications: ['统货'], price: 0.00, number: 0, url: '' }] } else { - this.specifications = [] - this.products = [] + this.specifications = [{ specification: '规格', value: '选货', picUrl: '' }] + this.products = [{ id: 0, specifications: ['选货'], price: 0.00, number: 0, url: '' }] } }, uploadSpecPicUrl: function(response) { diff --git a/litemall-admin/src/views/goods/edit.vue b/litemall-admin/src/views/goods/edit.vue index a2ccc463c07aadf999e9f7b54a1b49854b09dbcf..c392b57c3152a160847492d61f470a5a741747e7 100644 --- a/litemall-admin/src/views/goods/edit.vue +++ b/litemall-admin/src/views/goods/edit.vue @@ -210,7 +210,7 @@
- +

商品参数

添加 @@ -313,7 +313,7 @@ export default { goods: { gallery: [] }, specVisiable: false, specForm: { specification: '', value: '', picUrl: '' }, - specifications: [{ specification: '规格', value: '标准', picUrl: '' }], + specifications: [{ specification: '规格', value: '统货', picUrl: '' }], productVisiable: false, productForm: { id: 0, @@ -323,7 +323,7 @@ export default { url: '' }, products: [ - { id: 0, specifications: ['标准'], price: 0.0, number: 0, url: '' } + { id: 0, specifications: ['统货'], price: 0.0, number: 0, url: '' } ], attributeVisiable: false, attributeAdd: true, @@ -336,6 +336,9 @@ export default { language: 'zh_CN', height: '400px', convert_urls: false, + force_br_newlines: true, + force_p_newlines: false, + forced_root_block: '', plugins: [ 'advlist anchor autolink autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools importcss insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount' ], @@ -499,10 +502,10 @@ export default { specChanged: function(label) { if (label === false) { this.specifications = [ - { specification: '规格', value: '标准', picUrl: '' } + { specification: '规格', value: '统货', picUrl: '' } ] this.products = [ - { id: 0, specifications: ['标准'], price: 0.0, number: 0, url: '' } + { id: 0, specifications: ['统货'], price: 0.0, number: 0, url: '' } ] } else { this.specifications = [] diff --git a/litemall-admin/src/views/layout/components/Navbar.vue b/litemall-admin/src/views/layout/components/Navbar.vue index 991a5ac38deb332e84b58edd923a3fd75926153a..8f27a6c2cd04edb8c15d2663dec71b798bf027a4 100644 --- a/litemall-admin/src/views/layout/components/Navbar.vue +++ b/litemall-admin/src/views/layout/components/Navbar.vue @@ -31,20 +31,15 @@ 首页 - - - GitHub - - - - - 码云 - - 密码修改 + + + + 个人资料 + 退出 diff --git a/litemall-admin/src/views/login/index.vue b/litemall-admin/src/views/login/index.vue index 7e357137a6a3d455eb170efde59c5ef6654627e0..e1dd7e02eeab1c6ab296a9a3c8e7df60ffa4c5b0 100644 --- a/litemall-admin/src/views/login/index.vue +++ b/litemall-admin/src/views/login/index.vue @@ -2,7 +2,7 @@