shenhao před 4 roky
rodič
revize
1acdc20e36
31 změnil soubory, kde provedl 814 přidání a 6 odebrání
  1. 3 0
      src/main/java/com/ssj/dao/weixin/sales/dao/LibOrderDetailsDao.java
  2. 2 1
      src/main/java/com/ssj/service/weixin/order/service/impl/OrderServiceImpl.java
  3. 9 0
      src/main/java/com/ssj/service/weixin/sales/service/LibOrderDetailsService.java
  4. 1 0
      src/main/java/com/ssj/service/weixin/sales/service/LibSalesPriceService.java
  5. 54 2
      src/main/java/com/ssj/service/weixin/sales/service/impl/LibOrderDetailsServiceImpl.java
  6. 5 0
      src/main/java/com/ssj/service/weixin/sales/service/impl/LibSalesPriceServiceImpl.java
  7. 104 0
      src/main/java/com/ssj/weixin/activity/controller/ActivityController.java
  8. 6 3
      src/main/java/com/ssj/weixin/interceptor/SetControlDataInterceptor.java
  9. 4 0
      src/main/java/com/ssj/weixin/payment/controller/PaymentController.java
  10. 152 0
      src/main/resources/static/extension/css/style.css
  11. binární
      src/main/resources/static/extension/favicon.ico
  12. binární
      src/main/resources/static/extension/images/ercode.png
  13. binární
      src/main/resources/static/extension/images/index_a1.png
  14. binární
      src/main/resources/static/extension/images/index_a2.png
  15. binární
      src/main/resources/static/extension/images/index_a3.png
  16. binární
      src/main/resources/static/extension/images/index_a4.png
  17. binární
      src/main/resources/static/extension/images/index_a5.png
  18. binární
      src/main/resources/static/extension/images/index_a6.png
  19. binární
      src/main/resources/static/extension/images/index_a7.png
  20. binární
      src/main/resources/static/extension/images/index_a8.png
  21. binární
      src/main/resources/static/extension/images/index_a9.png
  22. binární
      src/main/resources/static/extension/images/index_icon.png
  23. binární
      src/main/resources/static/extension/images/select_tick.png
  24. binární
      src/main/resources/static/extension/images/success_tick.png
  25. binární
      src/main/resources/static/extension/images/success_top.png
  26. binární
      src/main/resources/static/extension/images/tel_icon.png
  27. 242 0
      src/main/resources/static/extension/js/activity.js
  28. 5 0
      src/main/resources/static/extension/js/jquery.min.js
  29. 2 0
      src/main/resources/static/extension/js/layer_mobile/layer.js
  30. 1 0
      src/main/resources/static/extension/js/layer_mobile/need/layer.css
  31. 224 0
      src/main/resources/templates/weixin/activity/extension/index.html

+ 3 - 0
src/main/java/com/ssj/dao/weixin/sales/dao/LibOrderDetailsDao.java

@@ -176,4 +176,7 @@ public interface LibOrderDetailsDao extends JpaRepository<LibOrderDetails, Strin
 	 * @return
 	 */
 	List<LibOrderDetails> findByVipIdAndPriceSpeciesAndOrderStatusAndAppTypeOrderByCreateTimeDesc(String vipId, String priceSpecies, int orderStatus, int appType);
+
+	@Query(nativeQuery = true, value ="select count(1) from tb_lib_order_details where price_species=?1 and user_id=?2 ")
+	int getOrderTimesBySpeciesAndUserId(String species, String userId);
 }

+ 2 - 1
src/main/java/com/ssj/service/weixin/order/service/impl/OrderServiceImpl.java

@@ -448,7 +448,8 @@ public class OrderServiceImpl extends BaseServiceImpl<Order, String> implements
 		String orderNo = OrderUtil.getOrderCode();//生成订单号
 		
 		OrderHelper orderHelper = new OrderHelper();
-		String url ="https://book.sharingschool.com/weixin/payment/pay_vip_callback.html";
+		String baseUrl = SystemResourceLocator.getValue("gz_book_url").toString();
+		String url = baseUrl +"/weixin/payment/pay_vip_callback.html";
 		try {
 			//请求微信统一下单接口,获取最重要的prepay_id.
 			Map<String,Object> map = orderHelper.reqestOrder(user.getAccount(),libOrderDetails.getPrice().multiply(new BigDecimal(100)).setScale(0,BigDecimal.ROUND_HALF_UP).toString(),orderNo,desc,url);

+ 9 - 0
src/main/java/com/ssj/service/weixin/sales/service/LibOrderDetailsService.java

@@ -346,4 +346,13 @@ public interface LibOrderDetailsService extends BaseService<LibOrderDetails, Str
 	List<LibOrderDetails> findOrderDetailList(String vipId, String priceSpecies, int appType);
 
 
+    void saveS009OrderDetails(LibOrderDetails libOrderDetails);
+
+	/**
+	 * 计算用户购买了几次产品
+	 * @param s009
+	 * @param userId
+	 * @return
+	 */
+	int getOrderTimesBySpeciesAndUserId(String s009, String userId);
 }

+ 1 - 0
src/main/java/com/ssj/service/weixin/sales/service/LibSalesPriceService.java

@@ -36,4 +36,5 @@ public interface LibSalesPriceService extends BaseService<LibSalesPrice, String>
 	 
 	 public List<LibSalesPrice> findByLibIdAndSpeciesAndType(String species);
 
+	LibSalesPrice findTopBySpecies(String s009);
 }

+ 54 - 2
src/main/java/com/ssj/service/weixin/sales/service/impl/LibOrderDetailsServiceImpl.java

@@ -12,6 +12,11 @@ import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import com.alibaba.fastjson.JSONObject;
+import com.ssj.dao.weixin.order.dao.OrderDetailsDao;
+import com.ssj.weixin.api.activity.entity.SignUpEntity;
+import com.ssj.weixin.api.activity.service.ISignUpService;
+import com.ssj.weixin.api.activity.vo.SignUpBase;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -125,6 +130,9 @@ public class LibOrderDetailsServiceImpl extends BaseServiceImpl<LibOrderDetails,
 	private TbClassService tbClassService;
 	@Autowired
 	private TbClassStudentService tbClassStudentService;
+
+	@Autowired
+	private ISignUpService signUpService;
 	
 	@Override
 	public PagingAndSortingRepository<LibOrderDetails, String> getDao() {
@@ -1465,6 +1473,8 @@ public class LibOrderDetailsServiceImpl extends BaseServiceImpl<LibOrderDetails,
 		return libOrderDetailsDao.findByVipIdAndPriceSpeciesAndOrderStatusAndAppTypeOrderByCreateTimeDesc(vipId, priceSpecies, 1, appType);
 	}
 
+
+
 	public void updateExitLibRecord(String vipId, String oldLibId, String newLibId) {
 		if (StringUtils.isNotBlank(oldLibId)) {
 			//已绑定馆,切换时需要保存已离馆记录至redis
@@ -1591,6 +1601,48 @@ public class LibOrderDetailsServiceImpl extends BaseServiceImpl<LibOrderDetails,
 		}
 		
 	}
-	
-	
+
+	@Override
+	@Transactional
+	public void saveS009OrderDetails(LibOrderDetails libOrderDetails) {
+		logger.info("小塾学伴缴费体验19.9,添加订单--"+DateHelper.getDateTime(libOrderDetails.getCreateTime()));
+
+		//支付成功
+		libOrderDetails.setOrderStatus(1);
+		try {
+			Date startTime=new Date();
+
+
+			//添加报名信息
+			SignUpBase req = JSON.parseObject(libOrderDetails.getSchool(), SignUpBase.class);
+			SignUpEntity entity = new SignUpEntity();
+			entity.setSubmitJson(JSONObject.toJSONString(req.getList()));
+			entity.setPhoneNum(libOrderDetails.getPhone());
+			entity.setCreateTime(startTime);
+			entity.setType(req.getType());
+			entity.setUserId(libOrderDetails.getUserId());
+			signUpService.save(entity);
+
+			//查询用户是否有绑定手机号码
+			User user = userService.getById(libOrderDetails.getUserId());
+			if(StringUtils.isBlank(user.getMobile())){
+				user.setMobile(libOrderDetails.getPhone());
+				userService.save(user);
+			}
+
+			libOrderDetails.setStartTime(startTime);
+			libOrderDetails = this.save(libOrderDetails);
+			logger.info("小塾学伴缴费体验19.9支付成功后,添加销售订单"+libOrderDetails.getId());
+
+		}catch(Exception e){
+			e.printStackTrace();
+			logger.error("保存购卡信息异常");
+		}
+	}
+
+	@Override
+	public int getOrderTimesBySpeciesAndUserId(String species, String userId) {
+		return libOrderDetailsDao.getOrderTimesBySpeciesAndUserId(species,userId);
+	}
+
 }

+ 5 - 0
src/main/java/com/ssj/service/weixin/sales/service/impl/LibSalesPriceServiceImpl.java

@@ -77,4 +77,9 @@ public class LibSalesPriceServiceImpl extends BaseServiceImpl<LibSalesPrice, Str
 		return libSalesPriceDao.findByLibIdAndSpeciesAndType(species);
 	}
 
+	@Override
+	public LibSalesPrice findTopBySpecies(String s009) {
+		return libSalesPriceDao.findTopBySpecies(s009);
+	}
+
 }

+ 104 - 0
src/main/java/com/ssj/weixin/activity/controller/ActivityController.java

@@ -0,0 +1,104 @@
+package com.ssj.weixin.activity.controller;
+
+import com.ssj.bean.weixin.libmy.domain.TbLibJoin;
+import com.ssj.bean.weixin.sales.domain.LibOrderDetails;
+import com.ssj.bean.weixin.sales.domain.LibSalesPrice;
+import com.ssj.bean.weixin.user.domain.User;
+import com.ssj.framework.core.common.controller.BaseController;
+import com.ssj.framework.core.security.manager.TokenManager;
+import com.ssj.framework.core.util.ResponseConstant;
+import com.ssj.framework.core.util.ResponseEntity;
+import com.ssj.service.conch.parents.service.ParentService;
+import com.ssj.service.weixin.sales.service.LibOrderDetailsService;
+import com.ssj.service.weixin.sales.service.LibSalesPriceService;
+import com.ssj.weixin.api.activity.vo.ActivityLogin;
+import com.ssj.weixin.manager.entity.TbLibReadManager;
+import com.ssj.weixin.util.UserUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author sh
+ * @className ActivityController
+ * @description con
+ * @date 2021/4/27
+ */
+@Controller
+@RequestMapping("/weixin/activity")
+public class ActivityController extends BaseController {
+
+    @Autowired
+    private TokenManager tokenManager;
+
+    @Autowired
+    private ParentService parentService;
+
+    @Autowired
+    private LibSalesPriceService libSalesPriceService;
+
+    @Autowired
+    private LibOrderDetailsService libOrderDetailsService;
+
+
+
+    @RequestMapping("/index")
+    public String index(Model model, String type) {
+        String userId = UserUtil.getUserId(request);
+        //查询用户支付次数
+        int times = libOrderDetailsService.getOrderTimesBySpeciesAndUserId("S009",userId);
+        //通用的收费标准,150/月
+        LibSalesPrice salesPrice=libSalesPriceService.findTopBySpecies("S009");
+
+        model.addAttribute("libId", salesPrice.getLibId());
+        model.addAttribute("salesPrice", salesPrice);
+        //推广渠道
+        model.addAttribute("type",type);
+        //1还可以购买,2不可购买了
+        model.addAttribute("timeLimit",times<3?1:2);
+        return "weixin/activity/extension/index";
+    }
+
+    @RequestMapping(value="/sendCode",method = RequestMethod.POST)
+    @ResponseBody
+    public ResponseEntity sendCode(ActivityLogin req){
+        ResponseEntity responseEntity = new ResponseEntity();
+        if(StringUtils.isBlank(req.getPhoneNum())){
+            return responseEntity.failure(ResponseConstant.CODE_000,"请输入电话号码");
+        }
+        Map<String,Object> data = new HashMap<>();
+        try {
+            String codeKey = "repeatCode_".concat(req.getPhoneNum());
+            if(tokenManager.exists(codeKey)){
+                return responseEntity.failure("请于上次发送成功后60秒后再重新尝试!");
+            }
+            responseEntity = parentService.sendSmsV2(req.getPhoneNum().trim());
+            responseEntity.success(data,"验证码发送成功");
+        }catch (Exception e){
+            responseEntity.failure(ResponseConstant.CODE_000,"发送短信验证码失败,请稍后重试");
+        }
+        return  responseEntity;
+    }
+
+    @RequestMapping(value="/checkCode",method = RequestMethod.POST)
+    @ResponseBody
+    public ResponseEntity checkCode(ActivityLogin req){
+        ResponseEntity responseEntity = new ResponseEntity();
+        if(StringUtils.isBlank(req.getPhoneNum())){
+            return responseEntity.failure(ResponseConstant.CODE_000,"请输入电话号码");
+        }
+        if(StringUtils.isBlank(req.getMsgCode())){
+            return responseEntity.failure(ResponseConstant.CODE_000,"请输入验证码");
+        }
+        responseEntity = parentService.confirmSmsV2(req.getPhoneNum().trim(),req.getMsgCode());
+        return   responseEntity;
+    }
+}

+ 6 - 3
src/main/java/com/ssj/weixin/interceptor/SetControlDataInterceptor.java

@@ -76,8 +76,11 @@ public class SetControlDataInterceptor extends HandlerInterceptorAdapter {
 	        notCheckPhoneList.add("/weixin/story/explainForm.html");
 	        notCheckPhoneList.add("/weixin/story/explainForm/save");
 		 	notCheckPhoneList.add("/weixin/story/maskForm.html");
-		 	notCheckPhoneList.add("/weixin/story/mask/save");
-	        
+		 	notCheckPhoneList.add("/weixin/activity/index.html");
+		 	notCheckPhoneList.add("/weixin/activity/sendCode");
+		 	notCheckPhoneList.add("/weixin/activity/checkCode");
+		 	notCheckPhoneList.add("/weixin/payment/payService");
+
 	  }
 
 	// Controller 前执行
@@ -123,7 +126,7 @@ public class SetControlDataInterceptor extends HandlerInterceptorAdapter {
         	tokenManager.createWxOpenId(openid, subscribe);
         }
         modelAndView.addObject("subscribe",subscribe);
-        modelAndView.addObject("sysUrl", "https://book.sharingschool.com");
+        modelAndView.addObject("sysUrl", SystemResourceLocator.getValue("gz_book_url"));
        // modelAndView.addObject("sysUrl", "http://127.0.0.1:8081");
         modelAndView.addObject("imgUrl", SystemResourceLocator.getValue("STATIC_FILE_URL"));
 

+ 4 - 0
src/main/java/com/ssj/weixin/payment/controller/PaymentController.java

@@ -282,6 +282,10 @@ public class PaymentController extends BaseController {
 										//小塾学伴缴费
 										libOrderDetailsService.saveServiceOrderDetails(libOrderDetails);
 									
+									} else if("S009".equals(priceSpecies)){
+										//小塾学伴缴费(体验19.9)
+										libOrderDetailsService.saveS009OrderDetails(libOrderDetails);
+
 									} else if ("S003".equals(priceSpecies) && "newZybMethod".equals(libOrderDetails.getIsType())) {
 										//作业吧服务(NEW)  saveZybOrderDetails
 										libOrderDetailsService.saveBatchZybOrderDetails(libOrderDetails);

+ 152 - 0
src/main/resources/static/extension/css/style.css

@@ -0,0 +1,152 @@
+@charset "UTF-8";
+body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;font-family:"微软雅黑";-webkit-tap-highlight-color:transparent}
+table {border-collapse:collapse;border-spacing:0}
+fieldset,img{border:0;vertical-align: middle;}
+address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:400}
+ol,ul{list-style:none}
+caption,th{text-align:left}
+h1,h2,h3,h4,h5,h6{font-weight:400}
+q:before,q:after{content: ''}
+abbr,acronym{border:0}
+a{text-decoration:none}
+html{font-family: sans-serif;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;}
+html,body{margin: 0 auto;width: 100%;height: 100%;background: #fff;}
+body{position: relative;
+    font: 28px/1.2 sans-serif;
+    -webkit-tap-highlight-color: transparent;
+    -webkit-overflow-scrolling: touch;
+    -webkit-text-size-adjust: 100%;
+    -webkit-user-select: none;}
+i{font-style:normal}
+.clear:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}
+.clear{display:inline-table}
+* html .clear{height:1%}
+a{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none}
+.fl{float:left}
+.fr{float:right}
+.pr{position:relative}
+.pa{position:absolute}
+.dn{display:none}
+.vn{visibility:hidden}
+.center{text-align:center}
+.tr{text-align:right}
+.tl{text-align:right}
+a:hover,a:focus{color:#16191e}
+a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset: -2px}
+.swiper-container{width:100%;height:100%}
+section{overflow:hidden}
+.img-box {position:absolute;width:100%;height:100%}
+.img-box img{position:absolute}
+html.no-scroll {
+    overflow-y: scroll !important;
+    overflow: hidden !important;
+    height: 100% !important;
+}
+
+#container{position: absolute;top: 0;width: 100%;height: 100%;overflow: hidden;}
+.wrap_inner{width: 100%;height: 100%;overflow: auto;}
+.wrap_index{width: 100%;height: auto;display: flex;flex-direction: column;align-items: flex-start;}
+.index_pic{width: 7.5rem;}
+.index_pic1{height:11.32rem;background:url(https://img.sharingschool.com/activity/images/index_a1.png?v=1) no-repeat center/ 100% 100%;}
+.index_pic2{height:4.85rem;margin-top:0.02rem;background:url(https://img.sharingschool.com/activity/images/index_a2.png?v=1) no-repeat center/ 100% 100%;}
+.index_pic3{height:5.98rem;margin-top:0.11rem;background:url(https://img.sharingschool.com/activity/images/index_a3.png?v=1) no-repeat center/ 100% 100%;}
+.index_pic4{height:5.1rem;margin-top:0.38rem;background:url(https://img.sharingschool.com/activity/images/index_a4.png?v=1) no-repeat center/ 100% 100%;}
+.index_pic5{height:16.86rem;background:url(https://img.sharingschool.com/activity/images/index_a5.png?v=1) no-repeat center/ 100% 100%;}
+.index_pic6{height:14.55rem;background:url(https://img.sharingschool.com/activity/images/index_a6.png?v=1) no-repeat center/ 100% 100%;}
+.index_pic7{height:6.05rem;background:url(https://img.sharingschool.com/activity/images/index_a7.png?v=1) no-repeat center/ 100% 100%;}
+.index_pic8{height:7.8rem;margin-top:0.31rem;background:url(https://img.sharingschool.com/activity/images/index_a8.png?v=1) no-repeat center/ 100% 100%;}
+.index_pic9{height:10.5rem;margin-top:0.27rem;background:url(https://img.sharingschool.com/activity/images/index_a9.png?v=1) no-repeat center/ 100% 100%;}
+.index_pic0{height:1.94rem;background: #FFF;}
+
+/*跑马灯*/
+.index_pic1_marquee{width: 4.12rem;height: .46rem;top:.33rem;right:.2rem;background: rgba(62,3,19,.35);border-radius: 23px;font-size: .24rem;line-height:.46rem;font-family: PingFang SC;font-weight: 400;color: #FFFFFF;text-align: center;overflow: hidden;}
+.index_pic1_marquee ul{}
+.index_pic1_marquee ul li{width: 100%;height: .46rem;line-height:.46rem;}
+
+
+/*底部免费报名*/
+.wrap_footer{position: fixed;width: 7.5rem;height: 1.94rem;bottom:0;left:50%;transform:translate(-50%,0);background: #FFF;box-shadow: 0px 0px 16px 0px rgba(113, 53, 9, 0.4);}
+.wrap_footer_text{width: 100%;height: 0.3rem;top:.29rem;left:50%;transform:translate(-45%,0);font-size: 0.3rem;font-family: Source Han Sans CN;font-weight: bold;color: #E22331;line-height: 0.3rem;text-align: center;letter-spacing: 0.02rem;
+}
+.wrap_footer_icon{width: .62rem;height: .62rem;bottom: .66rem;left:.51rem;}
+.wrap_footer_icon img{width: 100%;line-height: .62rem;vertical-align: top;}
+#wrap_footer_btn{width: 5.02rem;height: .88rem;bottom: .5rem;left:50%;transform:translate(-45%,0);background: linear-gradient(187deg, #E12331, #E22331);border-radius: .44rem;text-align: center;letter-spacing: 0.02rem;cursor: pointer;}
+#wrap_footer_btn.disabled{background: #BFBFBF;opacity: .9;}
+.wrap_footer_btn h3{font-size: .36rem;font-family: Source Han Sans CN;font-weight: 400;color: #FFF;}
+.wrap_footer_btn h3 span{font-size: .48rem;font-family: Source Han Sans CN;font-weight: bold;color: #FFF;}
+.wrap_footer_btn p{font-size: .24rem;font-family: Source Han Sans CN;font-weight: 400;color: #FFFFFF;}
+.wrap_footer_btn_tip{width: 1.84rem;height: .4rem;background: #FFB500;border-radius: .21rem .2rem .2rem 0;top:-.08rem;right:-.6rem;font-size: .24rem;font-family: Source Han Sans CN;font-weight: bold;color: #FFFFFF;line-height: .4rem;text-align: center;}
+
+/* 选择练习册 */
+.wrap_select{width: 100%;height: 100%;background: #F2F5F8;left: 0;top: 0;display: none;}
+.wrap_select_register{width: 6.22rem;height: auto;padding:.3rem;background: #fff;margin:0 auto;margin-top: .3rem;box-shadow: 0px 0px 18px 0px rgba(199, 216, 232, 0.15);border-radius: .2rem;overflow: hidden;}
+.wrap_select_workbook{width: 6.22rem;height: auto;padding:.3rem;background: #FFF;margin:0 auto;margin-top: .2rem;box-shadow: 0px 0px 18px 0px rgba(199, 216, 232, 0.15);border-radius: .2rem;overflow: hidden;}
+.wrap_select_payment{width: 100%;height: 1.38rem;background: #FFF;box-shadow: 0px -2px 24px 0px rgba(199, 216, 232, 0.54);position: fixed;bottom: 0;left:50%;transform:translate(-50%,0);}
+.select_register_tel{width: 100%;height: 1.4rem;border-bottom: 0.01rem solid #E6E6E6;position: relative;}
+.select_register_yzm{width: 100%;height: 1rem;margin-top:.2rem;position: relative;}
+.select_register_tel span, .select_register_yzm span{float:left;display:inline-block;height:1rem;margin-right:.15rem;font-size: .36rem;font-family: Source Han Sans CN;font-weight: 500;color: #333;line-height: 1rem;}
+.select_register_tel input, .select_register_yzm input{float:left;height:.6rem;padding:.2rem 0;background: transparent;border: 0;outline: none;text-align: left;font-size: .3rem;font-family: NotoSansHans;font-weight: 400;color: #1A1A1A;line-height: .6rem;cursor: pointer;}
+.select_register_tel input:focus, .select_register_yzm input:focus{background: none;}
+.select_register_tel input{width:3.3rem;}
+.select_register_yzm input{width:2.5rem;}
+.select_register_yzm_tip1{width: 1.6rem;height: .3rem;font-size: .24rem;font-family: Source Han Sans CN;font-weight: 400;color: #3DBA40;line-height: .3rem;position: absolute;right: 0;top:36%;transform: translateY(-50%);display: none;}
+.select_register_yzm_tip2{width: 100%;height: .3rem;font-size: .24rem;font-family: Source Han Sans CN;font-weight: 400;color: #3DBA40;line-height: .3rem;position: absolute;left: 0;bottom: 0.05rem;}
+.select_register_yzm_tip1 i,.select_register_yzm_tip2 i{float:left;display: inline-block;width: .26rem;height: .26rem;margin:0.02rem 0;background:url(../images/tel_icon.png?v=1) no-repeat center/ 100% 100%;}
+.select_register_yzm_btn{width: 2.3rem;height: .78rem;background: #FFF;position:absolute;right:0;top:.1rem;border: 0.01px solid #EA3844;border-radius: .39rem;text-align: center;font-size: .28rem;font-family: Source Han Sans CN;font-weight: 400;color: #EA3844;line-height: .78rem;cursor: pointer;}
+
+.wrap_select_payment p{float:left;width:30%;height:1.38rem;line-height:1.38rem;font-size: .58rem;font-weight: bold;color: #EA3844;text-align: center;}
+.wrap_select_payment p span{font-size: .36rem;}
+
+.select_payment_btn{float:right;width: 3rem;height: .88rem;line-height:.88rem;background: #EA3844;border-radius: .44rem;margin:.25rem .3rem .25rem 0;text-align: center;font-size: .38rem;font-family: Source Han Sans CN;font-weight: 500;color: #FFF;cursor: pointer;border:0;outline: none;}
+.select_payment_btn:disabled{background: #F5A4A9;}
+
+.select_wrokbook_title{width: 100%;height: .5rem;line-height: .5rem;}
+.select_wrokbook_title p{font-size: .36rem;font-family: Source Han Sans CN;font-weight: 500;color: #333;}
+.select_wrokbook_title p span{font-size: .28rem;font-family: Source Han Sans CN;font-weight: 400;color: #CCC;}
+.select_wrokbook_content{width: 100%;height: auto;margin:.4rem auto;overflow: hidden;}
+.select_wrokbook_content_tit{width: calc(100% - 0.04rem);height: .78rem;background: #FFF;margin-bottom:.5rem;border: .01rem solid #EA3844;border-radius: .39rem;}
+.select_wrokbook_content_tit ul li{float: left;width: 30%;height: .78rem;line-height:.8rem;font-size: .32rem;font-family: Source Han Sans CN;font-weight: 400;color: #EA3844;text-align: center;border-radius: .39rem;}
+.select_wrokbook_content_tit ul li+li{margin-left: 5%;}
+.select_wrokbook_content_tit ul li.ton{background: #EA3844;color: #fff;position: relative;}
+.select_wrokbook_content_tit ul li.ton::before{content: '';width: 0;height: 0;border-left: .2rem solid transparent;border-right: .2rem solid transparent;border-top: .2rem solid #EA3844;position: absolute;bottom: -.14rem;left: 50%;transform: translateX(-50%);}
+
+.select_dlist_box{width: 100%;height: auto;overflow: hidden;}
+.select_dlist_box2,.select_dlist_box3{display: none;}
+.select_dlist_box ul li{float: left;width: auto;height: .68rem;padding: 0 .34rem;margin-right: .14rem;margin-bottom:.16rem;background: #FFFFFF;box-sizing:border-box;border: .01rem solid #EA3844;border-radius: .34rem;text-align: center;font-size: .28rem;font-family: NotoSansHans;font-weight: 400;color: #EA3844;line-height: .68rem;position: relative;}
+.select_dlist_box ul li input{position: absolute;left: 0;top: 0;width: 100%;height: 100%;opacity: 0;cursor: pointer;}
+
+/* 选中的元素添加一个 √ 的箭头 */
+/* #select_tlist_ul li.ok::after, */
+.select_dlist_box li input:checked + .select_dlist_name::after{
+  content: '';
+  position: absolute;
+  display:inline-block;
+  width:.28rem;
+  height: .28rem;
+  bottom: 0.04rem;
+  right: 0.04rem;
+  background: url(../images/select_tick.png?v=1) no-repeat center/ 100% 100%;
+  z-index: 2;
+}
+
+/* 支付成功页面 */
+.wrap_success{width: 100%;height: 100%;background: #EA3844;left: 0;top: 0;display: none;}
+.success_toppic{width:5.98rem;height:3.75rem;margin:0 auto;background:url(https://img.sharingschool.com/activity/images/success_top.png?v=1) no-repeat center/ 100% 100%;position: relative;}
+.success_toppic_tick{width: .77rem;height: .67rem;background:url(https://img.sharingschool.com/activity/images/success_tick.png?v=1) no-repeat center/ 100% 100%;position: absolute;left: 50%;top: 50%;transform: translate(-50%, -50%);}
+.success_toppic p{width: 100%;height: .4rem;line-height:.4rem;font-size: .33rem;font-family: Source Han Sans CN;font-weight: 500;color: #FFF;text-align: center;position: absolute;left: 50%;top: 66%;transform: translate(-50%, -50%);}
+.success_baibox{width: 6.63rem;height: 6.17rem;padding-top:.5rem;margin:0 auto;background: #FFF;border-radius: .2rem;}
+.success_next_text1{width: 100%;height: .5rem;font-size: .4rem;font-family: Source Han Sans CN;font-weight: 500;color: #313131;line-height: .5rem;text-align: center;}
+.success_next_text2{width: 100%;height: .5rem;margin-top:.17rem;font-size: .4rem;font-family: Source Han Sans CN;font-weight: bold;color: #313131;line-height: .5rem;text-align: center;}
+.success_next_ercode{width: 2.6rem;height: 2.6rem;margin:0 auto;margin-top:.51rem;text-align:center;line-height:2.68rem;overflow:hidden;}
+.success_next_ercode img{width: 100%;}
+.success_next_text3{width: 100%;height: .5rem;margin-top:.5rem;font-size: .38rem;font-family: Source Han Sans CN;font-weight: bold;color: #EA3844;line-height: .5rem;text-align: center;}
+
+@media screen and (max-width:320px){
+    html{font-size:10px;}
+}
+@media screen and (min-width:321px)and(max-width:750px){
+    html{font-size:12px;}
+}
+@media screen and (min-width:751px){
+    html{font-size:14px;}
+}

binární
src/main/resources/static/extension/favicon.ico


binární
src/main/resources/static/extension/images/ercode.png


binární
src/main/resources/static/extension/images/index_a1.png


binární
src/main/resources/static/extension/images/index_a2.png


binární
src/main/resources/static/extension/images/index_a3.png


binární
src/main/resources/static/extension/images/index_a4.png


binární
src/main/resources/static/extension/images/index_a5.png


binární
src/main/resources/static/extension/images/index_a6.png


binární
src/main/resources/static/extension/images/index_a7.png


binární
src/main/resources/static/extension/images/index_a8.png


binární
src/main/resources/static/extension/images/index_a9.png


binární
src/main/resources/static/extension/images/index_icon.png


binární
src/main/resources/static/extension/images/select_tick.png


binární
src/main/resources/static/extension/images/success_tick.png


binární
src/main/resources/static/extension/images/success_top.png


binární
src/main/resources/static/extension/images/tel_icon.png


+ 242 - 0
src/main/resources/static/extension/js/activity.js

@@ -0,0 +1,242 @@
+$(function () {
+  var _tel, _vfy
+  let timer, count = 59
+
+  const CHECKBXOX_SELECTOR = 'input[type="checkbox"]'
+  const exerciseBookList = $('.select_wrokbook_content_con .select_dlist_box') // 练习册tabs
+  let accessToken,userStatus,userState
+
+  // 弹出练习册选择页
+  $('#wrap_footer_btn').click(function (event) {
+    if(times == 2){
+      layerNotify('您已超过支付限制次数!', 3)
+      return false
+    }
+    $('.wrap_select').show();
+    // 清空原选择
+    $('#telphone').val('');
+    $('#verify').val('');
+
+    _tel = $('#telphone').val()
+    if (_tel != '') {
+      $('.select_register_yzm_tip2').hide();
+      $('.select_register_yzm_tip1').show();
+    }else{
+      $('.select_register_yzm_tip1').hide();
+      $('.select_register_yzm_tip2').show();
+    }
+    $("#telphone").focus(function(){
+      $('.select_register_yzm_tip2').hide();
+      $('.select_register_yzm_tip1').show();
+    });
+    $("#telphone").blur(function(){
+      _tel = $('#telphone').val();
+      if (!phoneVerify(_tel)) {
+        layerNotify('手机号格式错误!', 1.52)
+        return false
+      }
+    })
+    //点击获取验证码
+    $('#sendyzm').click(function () {
+      const sendButton = $('#sendyzm');
+      _tel = $('#telphone').val();
+      if (_tel === '') {
+        layerNotify('请输入手机号码', 1.38)
+        return false
+      }
+      if (!phoneVerify(_tel)) {
+        layerNotify('手机号格式错误!', 1.52)
+        return false
+      }
+
+      if (_tel) {
+        $('.select_register_yzm_tip2').hide();
+        $('.select_register_yzm_tip1').show();
+       // 发起Ajax请求
+        $.ajax({
+          url: sysUrl+"/weixin/activity/sendCode",
+          type: "post",
+          dataType: "json",
+          ansyc: false,
+          data: {
+            phoneNum: _tel
+          },
+          success:function(data) {
+            if(data && data.code == 999){
+              layerNotify('验证码发送成功!')
+              sendButton.prop('disabled', true)
+              $('#sendyzm').html('重新发送(' + count + ')')
+              timer = setInterval(function () {
+                $('#sendyzm').html('重新发送(' + --count + ')')
+                if (!count) {
+                  count = 59
+                  sendButton.prop('disabled', false)
+                  $('#sendyzm').html('重新发送')
+                  clearInterval(timer)
+                }
+              }, 1000)
+            }else{
+              layerNotify(data.msg, 1.52)
+            }
+          },
+          error: function (error) {
+            console.log(error)
+          }
+        })
+      }
+
+    })
+  });
+
+  // 切换科目
+  $('#select_tlist_ul li').click(function(){
+    var index = $('#select_tlist_ul li').index(this);
+    $(this).addClass('ton').siblings().removeClass('ton');
+    $('.select_wrokbook_content_con div.select_dlist_box').eq(index).show().siblings().hide();
+  });
+
+  $('.select_wrokbook_content_con').on('click', ({ target }) => {
+    // console.log(target)
+    // 点击练习册的复选框
+    if (target.tagName === 'INPUT' && target.type === 'checkbox') {
+      const currentCheckedLength = $(CHECKBXOX_SELECTOR + ':checked').length
+      // console.log($(target).val());
+      console.log(currentCheckedLength);
+      if(currentCheckedLength > 0 && codeCheck){
+        $('.select_payment_btn').prop('disabled', false)
+      }else{
+        $('.select_payment_btn').prop('disabled', true)
+      }
+    }
+  });
+
+  $('#verify').bind('input propertychange', function() {
+    var code = $("#verify").val();
+
+    _tel = $('#telphone').val();
+    if(_tel == ''){
+      layerNotify('请输入电话号码!',2)
+      return;
+    }
+    if(code.length===6){
+      $.ajax({
+        url: sysUrl+"/weixin/activity/checkCode",
+        type: "post",
+        dataType: "json",
+        ansyc: false,
+        data: {
+          phoneNum: _tel,
+          msgCode: code
+        },
+        success:function(data) {
+          if(data && data.code == 999){
+            layerNotify('验证码正确!')
+            codeCheck = true;
+            const currentCheckedLength = $(CHECKBXOX_SELECTOR + ':checked').length
+            if(currentCheckedLength>1){
+              $('.select_payment_btn').prop('disabled', false);
+            }
+          }else{
+            layerNotify(data.msg, 1.52)
+          }
+        },
+        error: function (error) {
+          console.log(error)
+        }
+      })
+    }
+  });
+
+  //点击 免费报名
+  $('.select_payment_btn').click(function () {
+
+    const selectedValues = doGetCheckedIds()
+    const currentCheckedLength = $(CHECKBXOX_SELECTOR + ':checked').length
+    if(currentCheckedLength<1){
+      return layerNotify('请至少选择一个练习册', 1.8)
+    }
+    console.log(selectedValues);
+    pay(selectedValues);
+  })
+
+  //获取数据函数
+  function doGetCheckedIds() {
+    const _cacheData = {
+      type: type,
+      list: []
+    }
+
+    exerciseBookList.each((i, item) => {
+      _cacheData.list[i] = {
+        subject: item.dataset.subject,
+        bookList: [...$(item).find('input[type="checkbox"]:checked').map((_, it) => it.value)]
+      }
+    })
+    return _cacheData
+  }
+
+  function layerNotify(content, time = 2, width = 1.38) {
+    const layerStyle = `height:.8rem;position:absolute;top:50%;left:50%;bottom:0;margin-left: -` + width + `rem;margin-top: -1.2rem;color:#fff;background-color:rgba(0,0,0,.8); border:none;z-index:9999` //自定风格
+    layer.open({
+      style: layerStyle,
+      skin: 'msg',
+      content,
+      time,
+    })
+  }
+
+  function phoneVerify(da) {
+    var myreg = /^1[3456789]\d{9}$/
+    return myreg.test(da)
+  }
+
+  function pay(selectedValues) {
+    var know = '19.9体验活动';
+    var details="小塾学伴19.9体验活动";
+    $('.select_payment_btn').prop('disabled', true)
+    $.ajax({
+      url :  sysUrl+"/weixin/payment/payService",
+      type : 'post',
+      data : {
+        'salesPriceId':salesPriceId,//购买类型id
+        'number':1,//数量
+        'libId' :libId,
+        'know' : know,
+        'details' : details,
+        'phone':$('#telphone').val(),
+        'school':JSON.stringify(selectedValues),
+        'isBuy':1,
+        'vipStatus':1
+      },
+      dataType: 'json',
+      success: function(data){
+        if(data && data.code == 999){
+          var payInfo = eval(data.data); //数组
+          var orderNo=payInfo.orderNo;
+          WeixinJSBridge.invoke('getBrandWCPayRequest',{
+            "appId" : payInfo.appId,                  //公众号名称,由商户传入
+            "timeStamp": payInfo.timeStamp,          //时间戳,自 1970 年以来的秒数
+            "nonceStr" : payInfo.nonceStr,         //随机串
+            "package" : payInfo.packageValue,      //商品包信息
+            "signType" : payInfo.signType,        //微信签名方式'MD5'
+            "paySign" : payInfo.paySign           //微信签名
+          },function(res){
+            if(res.err_msg == "get_brand_wcpay_request:ok" ) {
+              $('.wrap_select').hide();
+              $('.wrap_success').show();
+            }else{
+              $('.select_payment_btn').prop('disabled', false)
+            }
+          });
+        }else{
+          layerNotify("数据加载失败,请稍后再试!","2");
+          $('.select_payment_btn').prop('disabled', false)
+        }
+      },
+      error: function(XMLHttpRequest,textStatus,errorThrown) {
+        layerNotify("网络或系统故障,请稍后再试!","2");
+        $('.select_payment_btn').prop('disabled', false)
+      }
+    });
+  }
+})

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 5 - 0
src/main/resources/static/extension/js/jquery.min.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2 - 0
src/main/resources/static/extension/js/layer_mobile/layer.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 0
src/main/resources/static/extension/js/layer_mobile/need/layer.css


+ 224 - 0
src/main/resources/templates/weixin/activity/extension/index.html

@@ -0,0 +1,224 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:th="http://www.thymeleaf.org">
+
+<head>
+	<meta charset="utf-8">
+	<meta name="viewport"
+		content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
+	<title>小塾学伴体验限时抢</title>
+	<link href="activity/index.css" type="text/css" th:href="@{/static/extension/css/style.css}" rel="stylesheet"/>
+	<script src="./js/jquery.js" th:src="@{/static/extension/js/layer_mobile/layer.js}"></script>
+
+	<script src="js/jquery.form.min.js" th:src="@{/static/extension/js/jquery.min.js}"></script>
+	<script src="js/flexible.js" th:src="@{/static/extension/js/activity.js}"></script>
+
+	<script type="text/javascript">
+		var sysUrl = '[[${sysUrl}]]';
+		var imgUrl = '[[${imgUrl}]]';
+	</script>
+</head>
+
+<body>
+	<div id="container" class="wrap">
+		<div class="pr wrap_inner">
+			<div class="wrap_index">
+				<div class="index_pic index_pic1">
+					<div class="pa index_pic1_marquee" id="index_pic1_marquee">
+						<ul class="mUl">
+<!--							<li><span class="index_pic1_marquee_tel">137****2317</span><span class="index_pic1_marquee_time">20分钟前</span>报名成功!</li>-->
+<!--							<li><span class="index_pic1_marquee_tel">139****0752</span><span class="index_pic1_marquee_time">10分钟前</span>报名成功!</li>-->
+<!--							<li><span class="index_pic1_marquee_tel">158****2317</span><span class="index_pic1_marquee_time">14分钟前</span>报名成功!</li>-->
+						</ul>
+					</div>
+				</div>
+				<div class="index_pic index_pic2"></div>
+				<div class="index_pic index_pic3"></div>
+				<div class="index_pic index_pic4"></div>
+				<div class="index_pic index_pic5"></div>
+				<div class="index_pic index_pic6"></div>
+				<div class="index_pic index_pic7"></div>
+				<div class="index_pic index_pic8"></div>
+				<div class="index_pic index_pic9"></div>
+				<div class="index_pic index_pic0"></div>
+			</div>
+			<div class="wrap_footer">
+				<div class="pa wrap_footer_icon"><a href="https://im.7x24cc.com/phone_webChat.html?accountId=N000000015632&chatId=e42d388a-85ae-4d6c-b1e3-4fbd149d2011">
+						<img th:src="@{/static/extension/images/index_icon.png}" alt="客服" />
+				</a></div>
+				<div class="pa wrap_footer_btn" id="wrap_footer_btn">
+					<h3>¥<span>19.9</span>元</h3>
+					<p>立即报名</p>
+					<div class="pa wrap_footer_btn_tip">抽更多好礼</div>
+				</div>
+			</div>
+		</div>
+		<!-- 练习册 -->
+		<div class="pa wrap_select" id="wrap_select">
+			<div class="wrap_select_register">
+				<div class="select_register_tel">
+					<span>手机号</span><input type="text" name="telphone" id="telphone" maxlength="11" autocomplete="off" placeholder="请输入手机号" />
+					<div class="select_register_yzm_tip1"><i></i>手机号加密</div>
+					<div class="select_register_yzm_tip2"><i></i>手机号加密,仅用于老师督学</div>
+				</div>
+				<div class="select_register_yzm">
+					<span>验证码</span><input type="text" name="verify" id="verify" maxlength="6" autocomplete="off" placeholder="请输入验证码" />
+					<div class="select_register_yzm_btn" id="sendyzm">获取验证码</div>
+				</div>
+			</div>
+			<div class="wrap_select_workbook" id="wrap_select_workbook">
+				<div class="select_wrokbook_title">
+					<p>选择练习册<span>(至少需要选择1本)</span></p>
+				</div>
+				<div class="select_wrokbook_content">
+					<div class="select_wrokbook_content_tit">
+						<ul id="select_tlist_ul">
+							<li class="ton">语文</li>
+							<li>数学</li>
+							<li>英语</li>
+						</ul>
+					</div>
+					<div class="select_wrokbook_content_con">
+						<div class="select_dlist_box select_dlist_box1" data-subject="语文" id="select_dlist_box1">
+							<ul>
+								<li>
+									<input type="checkbox" name="ywlxc" value="黄冈小状元作业本" />
+									<span class="select_dlist_name">黄冈小状元作业本</span>
+								</li>
+								<li>
+									<input type="checkbox" name="ywlxc" value="补充习题">
+									<span class="select_dlist_name">补充习题</span>
+								</li>
+								<li>
+									<input type="checkbox" name="ywlxc" value="全易通">
+									<span class="select_dlist_name">全易通</span>
+								</li>
+								<li>
+									<input type="checkbox" name="ywlxc" value="阳光同学优化作业本">
+									<span class="select_dlist_name">阳光同学优化作业本</span>
+								</li>
+								<li>
+									<input type="checkbox" name="ywlxc" value="练习与测试小学语文">
+									<span class="select_dlist_name">练习与测试小学语文</span>
+								</li>
+							</ul>
+						</div>
+						<div class="select_dlist_box select_dlist_box2" data-subject="数学" id="select_dlist_box2">
+							<ul>
+								<li>
+									<input type="checkbox" name="sxlxc" value="黄冈小状元作业本">
+									<span class="select_dlist_name">黄冈小状元作业本</span>
+								</li>
+								<li>
+									<input type="checkbox" name="sxlxc" value="补充习题">
+									<span class="select_dlist_name">补充习题</span>
+								</li>
+								<li>
+									<input type="checkbox" name="sxlxc" value="全易通">
+									<span class="select_dlist_name">全易通</span>
+								</li>
+								<li>
+									<input type="checkbox" name="sxlxc" value="阳光同学优化作业">
+									<span class="select_dlist_name">阳光同学优化作业本</span>
+								</li>
+								<li>
+									<input type="checkbox" name="sxlxc" value="练习与测试小学数">
+									<span class="select_dlist_name">练习与测试小学数学</span>
+								</li>
+							</ul>
+						</div>
+						<div class="select_dlist_box select_dlist_box3" data-subject="英语" id="select_dlist_box3">
+							<ul>
+								<li>
+									<input type="checkbox" name="yylxc" value="黄冈小状元作业本">
+									<span class="select_dlist_name">黄冈小状元作业本</span>
+								</li>
+								<li>
+									<input type="checkbox" name="yylxc" value="课课练小学英语">
+									<span class="select_dlist_name">课课练小学英语</span>
+								</li>
+								<li>
+									<input type="checkbox" name="yylxc" value="补充习题">
+									<span class="select_dlist_name">补充习题</span>
+								</li>
+							</ul>
+						</div>
+					</div>
+				</div>
+			</div>
+			<div class="wrap_select_payment">
+				<p><span>¥</span>19.9</p>
+				<button class="select_payment_btn" disabled="disabled">确认支付</button>
+			</div>
+		</div>
+		<!-- 成功页面 -->
+		<div class="pa wrap_success" id="wrap_success">
+			<div class="success_toppic">
+				<div class="success_toppic_tick"></div>
+				<p>报名成功</p>
+			</div>
+			<div class="success_baibox">
+				<p class="success_next_text1">长按识别二维码,加老师微信</p>
+				<p class="success_next_text2">开启5天打卡学习之旅</p>
+				<div class="success_next_ercode"><img th:src="@{/static/extension/images/ercode.png}" alt="小私塾二维码" /></div>
+				<p class="success_next_text3">你离奖品只差最后一步啦!</p>
+			</div>
+		</div>
+	</div>
+</body>
+<script type="text/javascript">
+	(function (doc, win) {
+		var html = doc.getElementsByTagName("html")[0],
+			reEvt = "orientationchange" in win ? "orientationchange" : "resize",
+			reFontSize = function () {
+				var clientW = doc.documentElement.clientWidth || doc.body.clientWidth;
+				if (!clientW) {
+					return;
+				}
+				html.style.fontSize = 100 * (clientW / 750) + "px";
+			}
+		win.addEventListener(reEvt, reFontSize);
+		doc.addEventListener("DOMContentLoaded", reFontSize);
+	})(document, window);
+
+	var box=$('#index_pic1_marquee'),oUl=box.find('.mUl');
+	var times = '[[${timeLimit}]]';
+	var codeCheck = false;
+	var libId = '[[${libId}]]';
+	var type = '[[${type}]]';
+	var salesPriceId ='[[${salesPrice.id}]]';
+
+	function ajax(){
+		var result=null;
+		$.ajax({
+			url:'https://book.sharingschool.com/api/activity/signUpList',  //请求地址
+			type:'post',
+			dataType:'json',
+			ansyc:false,
+			data: {},
+			success:function(msg){
+				result=msg.data;
+				// console.log(msg.data.list);
+				for(var i=0;i<result.list.length;i++){
+					oUl.append('<li><span class="index_pic1_marquee_tel">'+result.list[i].phone_num+'</span>  <span class="index_pic1_marquee_time">'+result.list[i].timeMsg+'</span>报名成功!</li>')
+				}
+				if ($("#index_pic1_marquee ul li").length > 0) {
+					setInterval('AutoScroll("#index_pic1_marquee")', 3000);
+				} else {
+					$("#index_pic1_marquee").hide();
+				}
+			},
+			error:function(err){
+				console.log(err);
+			}
+		})
+	}
+	ajax();
+
+	// 跑马灯效果
+  var AutoScroll = function (a) {
+    $(a).find("ul:first").animate({ marginTop: "-0.46rem" }, 500, function () {
+      $(this).css({ marginTop: "0px" }).find("li:first").appendTo(this)
+    })
+  }
+</script>
+</html>