瀏覽代碼

优惠券

zhengjinyi 3 年之前
父節點
當前提交
688ccd364a
共有 41 個文件被更改,包括 914 次插入776 次删除
  1. 4 4
      src/main/resources/config/dev/application-dev.yml
  2. 3 1
      src/main/resources/static/css/base/base.h5.css
  3. 6 1
      src/main/resources/static/css/product/detail.h5.css
  4. 7 2
      src/main/resources/static/css/product/detail.pc.css
  5. 13 2
      src/main/resources/static/css/shopping/shopping.css
  6. 1 1
      src/main/resources/static/css/user-center/account/coupon-collection.css
  7. 41 1
      src/main/resources/static/css/user-center/account/coupon-exchange.css
  8. 2 0
      src/main/resources/static/css/user-center/account/coupon.css
  9. 二進制
      src/main/resources/static/img/account/icon-coupon-alertbg@2x.png
  10. 二進制
      src/main/resources/static/img/account/icon-coupon-alertbg@h52x.png
  11. 二進制
      src/main/resources/static/img/account/icon-coupon-alertbtnbg@2x.png
  12. 二進制
      src/main/resources/static/img/account/icon-coupon-alertbtnbg@h52x.png
  13. 二進制
      src/main/resources/static/img/account/icon-coupon-bg@2x.png
  14. 二進制
      src/main/resources/static/img/account/icon-coupon-bg@h52x.png
  15. 3 1
      src/main/resources/static/js/base.js
  16. 128 1
      src/main/resources/static/js/common/serviceapi/product.service.js
  17. 46 2
      src/main/resources/static/js/common/serviceapi/shopping.service.js
  18. 13 1
      src/main/resources/static/js/common/serviceapi/user.service.js
  19. 77 106
      src/main/resources/static/js/product/detail.js
  20. 29 31
      src/main/resources/static/js/product/product-coupon.js
  21. 154 121
      src/main/resources/static/js/shopping/cart.js
  22. 46 70
      src/main/resources/static/js/shopping/confirm.js
  23. 59 152
      src/main/resources/static/js/user-center/account/coupon-collection.js
  24. 47 3
      src/main/resources/static/js/user-center/account/coupon-exchange.js
  25. 61 170
      src/main/resources/static/js/user-center/account/coupon.js
  26. 11 9
      src/main/resources/static/js/user-center/dashboard.js
  27. 1 1
      src/main/resources/templates/components/header.html
  28. 3 3
      src/main/resources/templates/index.html
  29. 5 0
      src/main/resources/templates/product/beautytopic.html
  30. 24 16
      src/main/resources/templates/product/detail.html
  31. 4 4
      src/main/resources/templates/product/instruelist.html
  32. 3 3
      src/main/resources/templates/product/instrument.html
  33. 4 4
      src/main/resources/templates/product/list.html
  34. 7 7
      src/main/resources/templates/product/product-coupon.html
  35. 27 17
      src/main/resources/templates/shopping/cart.html
  36. 14 9
      src/main/resources/templates/shopping/confirm.html
  37. 8 8
      src/main/resources/templates/supplier/index.html
  38. 14 9
      src/main/resources/templates/user-center/account/coupon-collection.html
  39. 30 2
      src/main/resources/templates/user-center/account/coupon-exchange.html
  40. 18 13
      src/main/resources/templates/user-center/account/coupon.html
  41. 1 1
      src/main/resources/templates/user-center/dashboard.html

+ 4 - 4
src/main/resources/config/dev/application-dev.yml

@@ -53,10 +53,10 @@ logging:
 # 服务域名
 caimei:
   siteEnv: 0 #网站环境,(2:正式环境,1:测试环境,0:开发环境)
-  spiServer: https://spi-b.caimei365.com
-#  spiServer: http://192.168.2.67:8008
-  coreServer: https://core-b.caimei365.com
-#  coreServer: http://192.168.2.67:18002
+#  spiServer: https://spi-b.caimei365.com
+  spiServer: http://192.168.2.67:8008
+#  coreServer: https://core-b.caimei365.com
+  coreServer: http://192.168.2.67:18002
   imageDomain: https://img-b.caimei365.com
   wwwDomain: http:localhost:8009
   destPath: D:/_PLAN_WORKSPACE/test/static

+ 3 - 1
src/main/resources/static/css/base/base.h5.css

@@ -227,7 +227,9 @@
     display: inline-block;
 }
 /*采美豆弹窗样式*/
-.cmbeans-alert-box{width: 100%;height: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;position: fixed;left: 0;top: 0;background: rgba(51,51,51,0.5);z-index: 99999;}
+.cmbeans-alert-box{width: 100%;height: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;position: fixed;left: 0;top: 0;background: rgba(51,51,51,0.5);z-index: 99999;opacity: 0;}
+.cmbeans-alert-box.hide{opacity: 0;}
+.cmbeans-alert-box.show{opacity: 1;}
 .cmbeans-alert-image{width: 87.2vw;height: 68.6vw;position: absolute;top: 0;left: 0;bottom: 0;right: 0;margin: auto;box-sizing: border-box;}
 .cmbeans-alert-image img{width: 87.2vw;height: 68.6vw;display: block;}
 .cmbeans-alert-image .mIcon{width:8vw;height:8vw;display: block;position: absolute;top: 45px;right: -3px;cursor: pointer;}

+ 6 - 1
src/main/resources/static/css/product/detail.h5.css

@@ -85,7 +85,9 @@ li{list-style:none}
 .noprice .mIcon::before{width: 5vw;height: 4vw;background-position: -48.2vw -69.2vw;position: relative;top: 1vw}
 .Beautyfair .tag{width: 11.3vw;height: 4.3vw;line-height: 4.3vw;font-size: 2.8vw;float: left;margin-right: 1.3vw;text-align: center;color: #FFFFFF !important;background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);border-radius: 0px 2.7vw 0px 0px;margin-top: 1vw;}
 /*优惠券弹窗*/
-.coupon-popup{width:100%;height:100%;position:fixed;bottom:0;left:0;background-color:rgba(0,0,0,.4);z-index: 99999;}
+.coupon-popup{width:100%;height:100%;position:fixed;bottom:0;left:0;background-color:rgba(0,0,0,.4);z-index: 99999;opacity: 0;}
+.coupon-popup.hide{opacity: 0;}
+.coupon-popup.show{opacity: 1;}
 .coupon-popup .coupon-popup-model-content{width:100%;height:106.7vw;position:absolute;bottom:0;left:0;right:0;bottom:0;background-color:#FFFFFF;margin:auto;border-radius:2px;box-sizing:border-box}
 .coupon-popup .title{width:100%;height:11vw;float:left;box-sizing:border-box;position:relative;padding:2.3vw 0;background-color: #f8f8f8;}
 .coupon-popup .title p{font-size:3.4vw;line-height:6.4vw;text-align:center;color:#333333;font-weight: bold;}
@@ -97,6 +99,9 @@ li{list-style:none}
 .coupon-popup .popup-tabs-cell span{display: block;line-height: 11vw;height: 11vw;font-size: 3.4vw;color: #333;cursor: pointer;box-sizing: border-box;text-align: center;}
 .coupon-popup .popup-tabs-cell.active span{color: #E15621;border-bottom: 1px solid #E15621;}
 .coupon-popup .coupon-popup-content{width:100%;height:84.7vw;box-sizing:border-box;padding: 4vw 0;float: left;}
+.coupon-popup .coupon-popup-content .empty{padding: 15vw 0;}
+.coupon-popup .coupon-popup-content .empty img{width: 20vw;height: 20vw;}
+.coupon-popup .coupon-popup-content .empty .msg{color: #999;font-size: 3vw;}
 .coupon-popup .coupon-popup-scroll{width:100%;height:100%;box-sizing:border-box;float:left;overflow:hidden;overflow-y:auto}
 .coupon-popup .coupon-list-cell{width: 93.1vw;height: 33vw;float: left;margin: 0 0 2.4vw 0;position: relative;border-radius: 1vw;}
 .coupon-popup .coupon-list-cell .coupon-list-le{width: 77.6vw;height: 33vw;float: left;box-sizing: border-box;padding: 6.8vw 3.7vw 3.3vw 3.7vw;}

+ 7 - 2
src/main/resources/static/css/product/detail.pc.css

@@ -152,7 +152,9 @@ input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appear
 .WechatBg p{font-size: 12px;text-align: center;width: 120px;margin: auto;}
 .Beautyfair .tag{width: 44px;height: 18px;line-height: 18px;font-size: 12px;float: left;margin-right: 5px;text-align: center;color: #FFFFFF !important;background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);border-radius: 0px 10px 0px 0px;margin-top: 8px;}
 /*优惠券弹窗*/
-.coupon-popup{width:100%;height:100%;position:fixed;top:0;left:0;background-color:rgba(0,0,0,.4);z-index: 99999;}
+.coupon-popup{width:100%;height:100%;position:fixed;top:0;left:0;background-color:rgba(0,0,0,.4);z-index: 99999;opacity: 0;}
+.coupon-popup.hide{opacity: 0;}
+.coupon-popup.show{opacity: 1;}
 .coupon-popup .coupon-popup-model-content{width:540px;height:492px;position:absolute;top:0;left:0;right:0;bottom:0;background-color:#FFFFFF;margin:auto;border-radius:2px;box-sizing:border-box}
 .coupon-popup .title{width:100%;height:50px;float:left;box-sizing:border-box;position:relative;padding:0 24px;background-color: #f8f8f8;}
 .coupon-popup .title p{font-size:16px;line-height:50px;text-align:left;color:#333333;float:left;font-weight: bold;}
@@ -164,6 +166,9 @@ input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appear
 .coupon-popup .popup-tabs-cell span{display: block;line-height: 57px;height: 57px;font-size: 16px;color: #333;cursor: pointer;box-sizing: border-box;text-align: center;}
 .coupon-popup .popup-tabs-cell.active span{color: #E15621;border-bottom: 1px solid #E15621;}
 .coupon-popup .coupon-popup-content{width:100%;height:385px;box-sizing:border-box;padding: 16px 0;float: left;}
+.coupon-popup .coupon-popup-content .empty{padding: 60px 0;}
+.coupon-popup .coupon-popup-content .empty img{width: 120px;height: 120px;}
+.coupon-popup .coupon-popup-content .empty .msg{color: #999;}
 .coupon-popup .coupon-popup-scroll{width:100%;height:100%;box-sizing:border-box;padding:0 45px;float:left;overflow:hidden;overflow-y:auto}
 .coupon-popup .coupon-list-cell{width: 369px;height: 148px;float: left;margin-bottom:24px;position: relative;background: url("/img/account/icon-coupon-uesb@2x.png") no-repeat;background-size: cover;}
 .coupon-popup .coupon-list-cell.none{background: url("/img/account/icon-coupon-received@2x.png") no-repeat;background-size: cover;}
@@ -173,6 +178,6 @@ input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appear
 .coupon-popup .coupon-list-cell .coupon-list-name{width: 100%;height: 22px;line-height: 22px;color: #333333;font-size: 14px;text-align: left;margin-top: 13px;}
 .coupon-popup .coupon-list-cell .coupon-list-time{width: 100%;height: 22px;line-height: 22px;color: #999999;font-size: 12px;text-align: left;}
 .coupon-popup .coupon-list-cell .coupon-list-ri{width: 70px;height: 148px;float: left;box-sizing: border-box;padding: 54px 27px;font-size: 16px;color: #FFF;cursor: pointer;}
-.coupon-popup .coupon-list-cell .coupon-list-ri.none{padding: 45px 27px;}
+.coupon-popup .coupon-list-cell .coupon-list-ri.none{padding: 45px 27px;color: #FFFFFF;}
 .coupon-popup .coupon-list-cell .coupon-tags{height: 24px;line-height: 24px;text-align: center;border-radius: 8px 0 8px 0;position: absolute;top: 0;left: 0;padding: 0 10px;background-color: #f94b4b;color: #FFF;}
 

+ 13 - 2
src/main/resources/static/css/shopping/shopping.css

@@ -33,6 +33,7 @@ li{list-style:none}
     .listWrap .supplierTit{border-bottom:1px solid #F7F7F7;height:60px;line-height:60px;text-align:left}
     .listWrap .supplierTit .img{width:auto;height:32px;border:1px solid #F7F7F7;margin-right:10px}
     .listWrap .supplierTit .name{color:#9aa5b5}
+    .listWrap .supplierTit .couponTag{cursor: pointer;}
     .listWrap .cartTit,.listWrap .supplierBtn{height:60px;line-height:60px}
     .listWrap .cartTit{color:#333333}
     .listWrap .supplierItem,.listWrap .supplierBtn{color:#22272E}
@@ -195,7 +196,9 @@ li{list-style:none}
     .invoiceForm .formLine input[disabled]{border:none}
 
     /*优惠券弹窗*/
-    .coupon-popup{width:100%;height:100%;position:fixed;top:0;left:0;background-color:rgba(0,0,0,.4);z-index: 99999;}
+    .coupon-popup{width:100%;height:100%;position:fixed;top:0;left:0;background-color:rgba(0,0,0,.4);z-index: 99999;opacity: 0;}
+    .coupon-popup.hide{opacity: 0;}
+    .coupon-popup.show{opacity: 1;}
     .coupon-popup .coupon-popup-model-content{width:540px;height:492px;position:absolute;top:0;left:0;right:0;bottom:0;background-color:#FFFFFF;margin:auto;border-radius:2px;box-sizing:border-box}
     .coupon-popup .title{width:100%;height:50px;float:left;box-sizing:border-box;position:relative;padding:0 24px;background-color: #f8f8f8;}
     .coupon-popup .title p{font-size:16px;line-height:50px;text-align:left;color:#333333;float:left;font-weight: bold;}
@@ -207,6 +210,9 @@ li{list-style:none}
     .coupon-popup .popup-tabs-cell span{display: block;line-height: 57px;height: 57px;font-size: 16px;color: #333;cursor: pointer;box-sizing: border-box;text-align: center;}
     .coupon-popup .popup-tabs-cell.active span{color: #E15621;border-bottom: 1px solid #E15621;}
     .coupon-popup .coupon-popup-content{width:100%;height:385px;box-sizing:border-box;padding: 16px 0;float: left;}
+    .coupon-popup .coupon-popup-content .empty{padding: 60px 0;}
+    .coupon-popup .coupon-popup-content .empty img{width: 120px;height: 120px;}
+    .coupon-popup .coupon-popup-content .empty .msg{color: #999;}
     .coupon-popup .coupon-popup-scroll{width:100%;height:100%;box-sizing:border-box;padding:0 45px;float:left;overflow:hidden;overflow-y:auto}
     .coupon-popup .coupon-list-cell{width: 369px;height: 148px;float: left;margin-bottom:24px;position: relative;background: url("/img/account/icon-coupon-uesb@2x.png") no-repeat;background-size: cover;}
     .coupon-popup .coupon-list-cell.none{background: url("/img/account/icon-coupon-received@2x.png") no-repeat;background-size: cover;}
@@ -358,7 +364,9 @@ li{list-style:none}
     .invoiceWrap .formLine .diyBox {width: 28vw;}
 
     /*优惠券弹窗*/
-    .coupon-popup{width:100%;height:100%;position:fixed;bottom:0;left:0;background-color:rgba(0,0,0,.4);z-index: 99999;}
+    .coupon-popup{width:100%;height:100%;position:fixed;bottom:0;left:0;background-color:rgba(0,0,0,.4);z-index: 99999;opacity: 0;}
+    .coupon-popup.hide{opacity: 0;}
+    .coupon-popup.show{opacity: 1;}
     .coupon-popup .coupon-popup-model-content{width:100%;height:106.7vw;position:absolute;bottom:0;left:0;right:0;bottom:0;background-color:#FFFFFF;margin:auto;border-radius:2px;box-sizing:border-box}
     .coupon-popup .title{width:100%;height:11vw;float:left;box-sizing:border-box;position:relative;padding:2.3vw 0;background-color: #f8f8f8;}
     .coupon-popup .title p{font-size:3.4vw;line-height:6.4vw;text-align:center;color:#333333;font-weight: bold;}
@@ -370,6 +378,9 @@ li{list-style:none}
     .coupon-popup .popup-tabs-cell span{display: block;line-height: 11vw;height: 11vw;font-size: 3.4vw;color: #333;cursor: pointer;box-sizing: border-box;text-align: center;}
     .coupon-popup .popup-tabs-cell.active span{color: #E15621;border-bottom: 1px solid #E15621;}
     .coupon-popup .coupon-popup-content{width:100%;height:84.7vw;box-sizing:border-box;padding: 4vw 0;float: left;}
+    .coupon-popup .coupon-popup-content .empty{padding: 15vw 0;}
+    .coupon-popup .coupon-popup-content .empty img{width: 20vw;height: 20vw;}
+    .coupon-popup .coupon-popup-content .empty .msg{color: #999;font-size: 3vw;}
     .coupon-popup .coupon-popup-scroll{width:100%;height:100%;box-sizing:border-box;float:left;overflow:hidden;overflow-y:auto}
     .coupon-popup .coupon-list-cell{width: 93.1vw;height: 33vw;float: left;margin: 0 0 2.4vw 0;position: relative;border-radius: 1vw;}
     .coupon-popup .coupon-list-cell .coupon-list-le{width: 77.6vw;height: 33vw;float: left;box-sizing: border-box;padding: 6.8vw 3.7vw 3.3vw 3.7vw;}

+ 1 - 1
src/main/resources/static/css/user-center/account/coupon-collection.css

@@ -10,7 +10,7 @@ li{list-style:none}
     .coupon-title .coupon-name-use:hover{color: #E15621;}
     .pageWrap{width: 968px;}
     .navLayout{min-height: 500px;}
-    .coupon-container{width: 100%;min-height: 500px;background-color: #FFFFFF;}
+    .coupon-container{width: 100%;min-height: 600px;background-color: #FFFFFF;}
     .coupon-content-list{width: 100%;height: auto;box-sizing: border-box;padding:24px 13px 7px 13px;}
     .coupon-list-cell{width: 369px;height: 148px;float: left;margin: 0 24px 17px 0;position: relative;background: url("/img/account/icon-coupon-uesb@2x.png") no-repeat;background-size: cover;}
     .coupon-list-cell:nth-child(3n){margin-right: 0;}

+ 41 - 1
src/main/resources/static/css/user-center/account/coupon-exchange.css

@@ -7,7 +7,7 @@ li{list-style:none}
     /*采美豆右侧*/
     .crumbs{font-size: 16px;}
     .pageWrap{width: 968px;}
-    .navLayout{min-height: 500px;}
+    .navLayout{min-height: 600px;}
     .coupon-container{width: 100%;min-height: 500px;background-color: #FFFFFF;}
     .coupon-content{width: 100%;height: auto;box-sizing: border-box;padding:40px 128px;}
     .coupon-input{width: 100%;height: 36px;box-sizing: border-box;margin-bottom: 48px;}
@@ -16,6 +16,26 @@ li{list-style:none}
     .coupon-text{width: 100%;height: auto;color: #4a4f58;}
     .coupon-text h1{width: 100%;height: auto;font-size: 16px;line-height: 40px;text-align: left;font-weight: normal;}
     .coupon-text p{width: 100%;height: auto;font-size: 14px;line-height: 35px;text-align: left;}
+    /*优惠券弹窗样式*/
+    .cmcoupon-alert-box{width: 100%;height: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;position: fixed;left: 0;top: 0;background: rgba(51,51,51,0.7);z-index: 99999;opacity: 0;}
+    .cmcoupon-alert-box.hide{opacity: 0;}
+    .cmcoupon-alert-box.show{opacity: 1;}
+    .cmcoupon-alert-content{width: 353px;height: 367px;position: absolute;top: 0;left: 0;bottom: 0;right: 0;margin: auto;box-sizing: border-box;padding-top: 61px;background-size: cover;}
+    .cmcoupon-alert-content .cmcoupon-main{width: 100%;height: 307px;background: url("/img/account/icon-coupon-alertbg@2x.png") no-repeat;background-size: cover;box-sizing: border-box;padding: 136px 23px 0 23px;}
+    .cmcoupon-alert-content .icon{width:30px;height:30px;display: block;position: absolute;top: 0;right: 0;cursor: pointer;}
+    .cmcoupon-alert-content .icon:before{width:33px;height:33px;background-position:-197px -550px}
+    .cmcoupon-alert-content .coupon-list{width: 306px;height: 85px;background: url("/img/account/icon-coupon-bg@2x.png") no-repeat;background-size: cover;float: left;position: relative;margin-bottom: 20px;}
+    .cmcoupon-alert-content .list-cell-tags{height: 18px;line-height: 18px;padding: 0 6px;background-color: #f94b4b;border-radius: 8px 0 8px 0;font-size: 12px;color: #FFF;position: absolute;left:0 ;top: 0;}
+    .cmcoupon-alert-content .list-cell-le{width: 91px;height: 100%;box-sizing: border-box;padding: 18px 0 0 0;float: left;}
+    .cmcoupon-alert-content .coupon-maxMoney{width: 100%;height: 31px;line-height: 31px;font-size: 24px;color: #f94b4b;text-align: center;margin-top: 2px;font-weight: bold;}
+    .cmcoupon-alert-content .coupon-maxMoney .small{font-size: 12px;font-weight: normal;}
+    .cmcoupon-alert-content .coupon-minMoney{width: 100%;height: 16px;float: left;box-sizing: border-box;display:flex;justify-content: center;align-items: center; margin-top: 2px;}
+    .cmcoupon-alert-content .coupon-minMoney .txt{display: flex;height: 16px;line-height: 16px;font-size: 12px;color: #f94b4b;text-align: center;padding: 0 5px;background-color: #fff1eb;border-radius: 4px;float: left;}
+    .cmcoupon-alert-content .list-cell-ri{width: 215px;height: 100%;box-sizing: border-box;padding:18px 10px;float: left;}
+    .cmcoupon-alert-content .list-cell-top{width: 100%;height: 28px;line-height: 28px;font-size: 14px;color: #333333;float: left;}
+    .cmcoupon-alert-content .list-cell-time{width: 100%;height: 24px;line-height: 24px;text-align: left;font-size: 12px;color: #999999;}
+    .cmcoupon-alert-content .coupon-btn{width: 100%;height: 46px;cursor: pointer;background: url("/img/account/icon-coupon-alertbtnbg@2x.png") no-repeat;background-size: cover;line-height: 46px;text-align: center;color: #FFFFFF;font-size: 20px;float: left;}
+
 }
 
 /**
@@ -30,5 +50,25 @@ li{list-style:none}
     .coupon-text{width: 100%;height: auto;color: #4a4f58;}
     .coupon-text h1{width: 100%;height: auto;font-size: 3.4vw;line-height: 7.2vw;text-align: left;font-weight: normal;}
     .coupon-text p{width: 100%;height: auto;font-size: 2.4vw;line-height:5vw;text-align: left;}
+    /*优惠券弹窗样式*/
+    .cmcoupon-alert-box{width: 100%;height: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;position: fixed;left: 0;top: 0;background: rgba(51,51,51,0.7);z-index: 99999;opacity: 0;}
+    .cmcoupon-alert-box.hide{opacity: 0;}
+    .cmcoupon-alert-box.show{opacity: 1;}
+    .cmcoupon-alert-content{width: 70.9vw;height: 61.7vw;position: absolute;top: 0;left: 0;bottom: 0;right: 0;margin: auto;box-sizing: border-box;background-size: cover;}
+    .cmcoupon-alert-content .cmcoupon-main{width: 100%;height: 61.7vw;background: url("/img/account/icon-coupon-alertbg@h52x.png") no-repeat;background-size: cover;box-sizing: border-box;padding: 27.3vw 4.7vw 0 4.7vw;}
+    .cmcoupon-alert-content .mIcon{width:8vw;height:8vw;display: block;position: absolute;top: -12vw;right: 0;cursor: pointer;}
+    .cmcoupon-alert-content .mIcon:before{width:8vw;height:8vw;background-position:-34.1vw -77.9vw;}
+    .cmcoupon-alert-content .coupon-list{width: 61.5vw;height: 17.3vw;background: url("/img/account/icon-coupon-bg@h52x.png") no-repeat;background-size: cover;float: left;position: relative;margin-bottom: 3.7vw;}
+    .cmcoupon-alert-content .list-cell-tags{height: 3.5vw;line-height: 3.5vw;padding: 0 1.1vw;background-color: #f94b4b;border-radius: 1.6vw 0 1.6vw 0;font-size: 2vw;color: #FFF;position: absolute;left:0 ;top: 0;}
+    .cmcoupon-alert-content .list-cell-le{width: 18.3vw;height: 100%;box-sizing: border-box;padding: 3.5vw 0 0 0;float: left;}
+    .cmcoupon-alert-content .coupon-maxMoney{width: 100%;height: 6.5vw;line-height: 6.5vw;font-size: 4.9vw;color: #f94b4b;text-align: center;margin-top: 0.4vw;font-weight: bold;}
+    .cmcoupon-alert-content .coupon-maxMoney .small{font-size: 2.4vw;font-weight: normal;}
+    .cmcoupon-alert-content .coupon-minMoney{width: 100%;height: 3.2vw;float: left;box-sizing: border-box;display:flex;justify-content: center;align-items: center; margin-top: 2px;}
+    .cmcoupon-alert-content .coupon-minMoney .txt{display: flex;height: 3.2vw;line-height: 3.2vw;font-size: 1.8vw;color: #f94b4b;text-align: center;padding: 0 0.8vw;background-color: #fff1eb;border-radius: 0.4vw;float: left;}
+    .cmcoupon-alert-content .list-cell-ri{width: 43.2vw;height: 100%;box-sizing: border-box;padding:3.5vw 0 3.5vw 1.9vw;float: left;}
+    .cmcoupon-alert-content .list-cell-top{width: 100%;height: 5vw;line-height: 5vw;font-size: 3.2vw;color: #333333;float: left;}
+    .cmcoupon-alert-content .list-cell-time{width: 100%;height: 5vw;;line-height:5vw;text-align: left;font-size: 2vw;color: #999999;float: left;margin-top: 1vw;}
+    .cmcoupon-alert-content .coupon-btn{width: 100%;height: 9.2vw;cursor: pointer;background: url("/img/account/icon-coupon-alertbtnbg@h52x.png") no-repeat;background-size: cover;line-height: 9.2vw;text-align: center;color: #FFFFFF;font-size: 4.2vw;float: left;font-weight: bold;}
+
 }
 

+ 2 - 0
src/main/resources/static/css/user-center/account/coupon.css

@@ -34,6 +34,7 @@ li{list-style:none}
     .coupon-list-cell.none{background: url("/img/account/icon-coupon-none@2x.png") no-repeat;background-size: cover;}
     .empty{width: 100%;float: left;}
     .empty img{width: 180px;height: 180px;}
+    .empty .msg{color: #999;}
 
 }
 
@@ -67,6 +68,7 @@ li{list-style:none}
     .coupon-list-cell.none{background: url("/img/account/icon-coupon-none@h52x.png") no-repeat;background-size: cover;}
     .empty{width: 100%;float: left;}
     .empty img{width: 36vw;height: 36vw;}
+    .empty .msg{color: #999;}
 
 }
 

二進制
src/main/resources/static/img/account/icon-coupon-alertbg@2x.png


二進制
src/main/resources/static/img/account/icon-coupon-alertbg@h52x.png


二進制
src/main/resources/static/img/account/icon-coupon-alertbtnbg@2x.png


二進制
src/main/resources/static/img/account/icon-coupon-alertbtnbg@h52x.png


二進制
src/main/resources/static/img/account/icon-coupon-bg@2x.png


二進制
src/main/resources/static/img/account/icon-coupon-bg@h52x.png


+ 3 - 1
src/main/resources/static/js/base.js

@@ -630,7 +630,8 @@ function setSearchProductList(list, userId, callback) {//处理搜索
 function setProductPrice(productList, productIds, userId, callback){
     $.getJSON(coreServer+"/commodity/price/list",{
         userId: userId,
-        productIds: productIds
+        productIds: productIds,
+        source: 1
     }).done(function (r) {
         if (r.code === 0 && r.data) {
             var priceList = r.data;
@@ -644,6 +645,7 @@ function setProductPrice(productList, productIds, userId, callback){
                         product.priceLoaded = true;
                         product.ladderPriceFlag = item.ladderPriceFlag;
                         product.actStatus =item.actStatus;
+                        product.couponsLogo =item.couponsLogo;
                         product.promotions =item.promotions;
                     }
                 });

+ 128 - 1
src/main/resources/static/js/common/serviceapi/product.service.js

@@ -205,5 +205,132 @@ var ProductApi = {
             .then(function (res) {
                 callback(res);
             });
-        }
+        },
+        /**
+         * @优惠券-活动商品页列表数据
+         * @param:userId 用户userId(未登录传0)
+         * @param:pageNum 每页页码
+         * @param:pageSize 条数
+         * @param:couponId 优惠券ID
+         */
+        QueryCouponActivityList:function (params, callback) {//获取促销活动详情
+            Http.AjaxService({
+                url:'/commodity/coupon/activity/page',
+                type:'get',
+                data:params,
+                json:true,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res);
+            });
+        },
+        /**
+         * @商品详情-查看相关优惠券
+         * @param:userId 用户userId
+         * @param:productId 商品ID
+         * @param:source 来源 1 WWW 2小程序
+         * @param:status 状态 1 未领取 2已领取
+         */
+        QueryProductDetilsCoupons:function (params, callback) {
+            Http.AjaxService({
+                url:'/commodity/coupon/details/coupons',
+                type:'get',
+                data:params,
+                json:true,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res);
+            });
+        },
+        /**
+         * @优惠券-领取中心优惠券列表
+         * @param:userId 用户userId(未登录传0)
+         * @param:pageNum 每页页码
+         * @param:pageSize 条数
+         */
+        QueryCouponCollarList:function (params, callback) {//获取促销活动详情
+            Http.AjaxService({
+                url:'/commodity/coupon/collar/list',
+                type:'get',
+                data:params,
+                json:true,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res);
+            });
+        },
+        /**
+         * @优惠券-个人中心优惠券列表
+         * @param:userId 用户userId(必传)
+         * @param:pageNum 页码
+         * @param:pageSize 每页条数
+         * @param:status 使用状态 1未使用 2已使用 3已失效
+         */
+        QueryCouponCenter:function (params, callback) {//获取促销活动详情
+            Http.AjaxService({
+                url:'/commodity/coupon/center',
+                type:'get',
+                data:params,
+                json:true,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res);
+            });
+        },
+        /**
+         * @优惠券-领取优惠券
+         * @param:userId 用户userId
+         * @param:couponId 优惠券Id
+         * @param:source 来源: 1WWW 2小程序
+         */
+        ReceiveCoupon:function (params, callback) {//获取促销活动详情
+            Http.AjaxService({
+                url:'/commodity/coupon/collar',
+                type:'post',
+                data:params,
+                json:false,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res);
+            });
+        },
+        /**
+         * @优惠券-兑换优惠券
+         * @param:userId 用户userId
+         * @param:redemptionCode 优惠券兑换码
+         * @param:source 来源: 1WWW 2小程序
+         */
+        ExchangeCoupon:function (params, callback) {//获取促销活动详情
+            Http.AjaxService({
+                url:'/commodity/coupon/redeem',
+                type:'post',
+                data:params,
+                json:false,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res);
+            });
+        },
+        /**
+         * @优惠券-我的优惠券数量统计
+         * @param:userId 用户userId
+         */
+        QueryCouponsCount:function (params, callback) {//获取促销活动详情
+            Http.AjaxService({
+                url:'/commodity/coupon/coupons/count',
+                type:'get',
+                data:params,
+                json:true,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res);
+            });
+        },
 };

+ 46 - 2
src/main/resources/static/js/common/serviceapi/shopping.service.js

@@ -4,7 +4,11 @@
  * auther ZHJY
  */
 var ShoppingApi = {
-        GetShoppingCartList: function (params, callback) {//网银支付链接初始化数据
+        /**
+         * @购物车列表
+         * @param:userId 用户userId
+         */
+        QueryShoppingCartList: function (params, callback) {
             Http.AjaxService({
                 url:'/shoppingCart/list',
                 type:'GET',
@@ -15,7 +19,11 @@ var ShoppingApi = {
                 callback(res);
             });
         },
-        DeleteCartProducts: function (params, callback) {//查询跳转网银页面
+        /**
+         * @购物车-删除商品
+         * @param:userId 用户userId
+         */
+        DeleteCartProducts: function (params, callback) {
             Http.AjaxService({
                 url:'/shoppingCart/delete',
                 type:'POST',
@@ -25,5 +33,41 @@ var ShoppingApi = {
             .then(function(res){
                 callback(res);
             });
+        },
+        /**
+         * @购物车-更新商品数量
+         * @param:userId 用户userId
+         * @param:productCount 商品数量
+         * @param:productID 商品Id
+         */
+        ShoppingCartUpdate: function (params, callback) {
+            Http.AjaxService({
+                url:'/shoppingCart/update',
+                type:'POST',
+                data:params,
+                json:false
+            })
+            .then(function(res){
+                callback(res);
+            });
+        },
+        /**
+         * @购物车-查看相关优惠券
+         * @param:userId 用户userId
+         * @param:shopId 供应商Id
+         * @param:source 来源 1 WWW 2小程序
+         * @param:status 状态 1 未领取 2已领取
+         */
+        ShoppingCartGetCoupon:function (params, callback) {
+            Http.AjaxService({
+                url:'/shoppingCart/get/coupon',
+                type:'get',
+                data:params,
+                json:true,
+                isHost:false
+            })
+                .then(function(res){
+                    callback(res);
+                });
         }
 };

+ 13 - 1
src/main/resources/static/js/common/serviceapi/user.service.js

@@ -120,7 +120,7 @@ var UserApi = {
                 callback(res);
             });
         },
-        GetMyPcCenterInfo : function(params,callback) {//机构个人中心数据查询
+        GetMyPcCenterInfo : function(params,callback) {//机构个人中心数据查询(暂时废除)
             Http.AjaxService({
                 url:'/pcCenter/myPcCenter',
                 type:'get',
@@ -283,6 +283,18 @@ var UserApi = {
                 callback(res)
             });
         },
+        GetUserClubHome : function(params,callback) {// 机构个人中心
+            Http.AjaxService({
+                url:'/user/club/home',
+                type:'get',
+                data:params,
+                json:false,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res)
+            });
+        },
         GetUserClubBeansList : function(params,callback) {//机构采美豆收支明细
             Http.AjaxService({
                 url:'/user/club/beans/history',

+ 77 - 106
src/main/resources/static/js/product/detail.js

@@ -37,123 +37,38 @@ var productDetail = new Vue({
         beautyActFlag:'',
         trainingMethodText:'',
         trainingType:'',
-        isShowPopup:true,
-        currentTab:0,
-        dataList:[
-            {
-                maxMoney:5000,
-                minMoney:1000,
-                couponType:1,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:0,
-            },
-            {
-                maxMoney:2000,
-                minMoney:200,
-                couponType:2,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:2,
-                couponBtnType:0,
-                status:1,
-            },
-            {
-                maxMoney:4000,
-                minMoney:800,
-                couponType:3,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:3,
-                couponBtnType:0,
-                status:2,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:4,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:0,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:4,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:0,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:4,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:1,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:4,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:2,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:5,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:2,
-                couponBtnType:0,
-                status:1,
-            }
-        ],
+        isShowPopup:false,
+        currentTab:1,
+        couponParam:{// 获取弹窗优惠券领取参数
+            userId:0,
+            productId:0,
+            status:1,
+            source:1
+        },
+        isCouponEmpty:false,
+        productCoupon:[], 							// 优惠券
+        productCouponList:[],						// 优惠券弹窗列表
+
     },
     filters: {
         TypeFormat:function(value) {
             switch (value) {
-                case 1:
+                case 0:
                     return  '活动券';
                     break;
-                case 2:
+                case 1:
                     return  '品类券';
                     break;
+                case 2:
+                    return  '用户专享券';
+                    break;
                 case 3:
                     return  '店铺券';
                     break;
                 case 4:
-                    return  '专享券';
-                    break;
-                case 5:
                     return  '新用户券';
                     break;
             }
-        },
-        TypeFormatText:function(value) {
-            switch (value) {
-                case 1:
-                    return  '全商城商品通用';
-                    break;
-                case 2:
-                    return  '仅限购买仪器类商品';
-                    break;
-                case 3:
-                    return  '仅可购买店铺';
-                    break;
-            }
         }
     },
     computed: {},
@@ -379,13 +294,68 @@ var productDetail = new Vue({
                 }
             });
         },
+        queryProductDetilsCoupons(){// 初始化商品详情优惠券信息
+            var  _self = this;
+            ProductApi.QueryProductDetilsCoupons(_self.couponParam, function (response) {
+                if(response.code == 0){
+                    var data = response.data;
+                    if(isPC){
+                        _self.productCoupon = response.data.list.splice(0,3);
+                    }else{
+                        _self.productCoupon = response.data.list.splice(0,2);
+                    }
+                }else{
+                    console.log('获取优惠券列表失败');
+                }
+            })
+        },
+        queryPopupCoupons:function(){// 获取弹窗优惠券列表
+            var  _self = this;
+            ProductApi.QueryProductDetilsCoupons(_self.couponParam, function (response) {
+                if(response.code == 0){
+                    var data = response.data;
+                    if(data.couponList && data.couponList.length >0){
+                        _self.productCouponList = data.couponList;
+                        _self.isCouponEmpty = false;
+                        console.log('有优惠券')
+                        console.log(_self.productCouponList)
+                    }else{
+                        console.log('没有优惠券')
+                        _self.isCouponEmpty = true;
+                    }
+                }else{
+                    console.log('获取优惠券列表失败')
+                }
+            })
+        },
+        receiveCoupon:function(coupon){// 点击领取优惠券
+            var  _self = this;
+            ProductApi.ReceiveCoupon({userId:_self.couponParam.userId, couponId:coupon.couponId, source:1}, function (response) {
+                if(response.code == 0){
+                    _self.currentTab = 2;
+                    _self.couponParam.status = 2;
+                    _self.queryPopupCoupons();
+                }else{
+                    CAIMEI.Alert(response.msg, '确定', false);
+                }
+            })
+        },
         queryCouponTabs:function (value){// 切换优惠券
             var _self = this;
-            _self.currentTab = value;
+            _self.currentTab = _self.couponParam.status = value;
+            _self.queryPopupCoupons();
         },
         showPopup:function(){// 显示优惠券弹窗
             var _self = this;
-            _self.isShowPopup = true;
+            if(_self.userId>0){
+                _self.productCouponList = [];
+                _self.currentTab = 1;
+                _self.couponParam.status = 1;
+                _self.queryPopupCoupons();
+                _self.isShowPopup = true;
+            }else{
+                window.location.href='/login.html';
+            }
         },
         hidePopup:function(){// 隐藏优惠券弹窗
             var _self = this;
@@ -397,7 +367,7 @@ var productDetail = new Vue({
         }
     },
     created: function () {
-        this.productId = $("#productId").val();
+        this.productId = this.couponParam.productId = $("#productId").val();
         this.productStock = $("#productStock").val();
         this.getImages();
         // identity: 0个人,1协销,2会员机构,3供应商,4普通机构
@@ -410,10 +380,11 @@ var productDetail = new Vue({
         }
     },
     mounted: function () {
-        this.userId = GLOBAL_USER_ID;
+        this.userId = this.couponParam.userId = GLOBAL_USER_ID;
         this.getProductDetails();
         this.getProductPrice();
         this.getParameters();
+        this.queryProductDetilsCoupons();
         // $('.productInfo').slide({
         //     mainCell:".tabCon"
         //     ,titCell:".tabTit span"

+ 29 - 31
src/main/resources/static/js/product/product-coupon.js

@@ -6,19 +6,19 @@ var productList = new Vue({
         requestFlag: true,
         noMore: false,
         listQuery:{
-            keyword: '测试',
-            identity: GLOBAL_USER_IDENTITY,
+            userId:0,
+            couponId: 0,
             pageSize: 18,
             pageNum: 1,
-            sortField: '',
-            sortType: 1
+            source: 1
         },
         listData: [], //priceflag 0公开价格 1不公开价格 2仅对会员机构公开,//userIdentity: 2-会员机构, 4-普通机构
         listRecord: 0,
         userId: 0,
         shopID:0,
         userIdentity: '',
-        userToken: '',
+        appletsBanner:'',
+        pcBanner:'',
         addhtml:'<span class="tag">美博会</span>'
     },
     filters: {
@@ -32,24 +32,22 @@ var productList = new Vue({
     methods: {
         getListByKeyword: function () {
             var _self = this;
-            ProductApi.GetProductSearchList(_self.listQuery,function (res) {
-                console.log(res);
-                if (res.code === 0 && res.data ) {
-                    var result = JSON.parse(res.data);
-                    _self.listRecord = result.total;
-                    var resultData = setSearchProductList(result.items, _self.userId, function(){
-                        _self.$forceUpdate();
-                        setTimeout(function(){
-                            // 图片懒加载
-                            $("img[data-original]").lazyload();
-                        },500);
-                    });
-                    _self.listData = _self.listData.concat(resultData);
-                    console.log(_self.listData)
+            ProductApi.QueryCouponActivityList(_self.listQuery,function (response) {
+                if (response.code === 0 ) {
+                    var data = response.data;
+                    _self.appletsBanner = data.coupon.appletsBanner;
+                    _self.pcBanner = data.coupon.pcBanner;
+                    _self.listRecord = data.pageInfo.total;
+                    _self.listData = _self.listData.concat(data.pageInfo.list);
+                    console.log(_self.listData);
                     _self.listLoading = false;
                     _self.requestFlag = true;
+                    setTimeout(function(){
+                        // 图片懒加载
+                        $("img[data-original]").lazyload();
+                    },500);
                 }else {
-                    CAIMEI.Alert(res.msg, '确定');
+                    CAIMEI.Alert(response.msg, '确定');
                 }
             });
         },
@@ -62,26 +60,26 @@ var productList = new Vue({
                 }
             }
             return false
-        },
-
+        }
     },
     created: function () {
+
+    },
+    mounted: function () {
+        var _self = this;
         if(globalUserData){
-            this.userId = globalUserData.userId;
-            this.userIdentity = globalUserData.identity;
-            this.userToken = globalUserData.token;
+            _self.userId = _self.listQuery.userId = globalUserData.userId;
+            _self.userIdentity = globalUserData.identity;
+            _self.listQuery.couponId = CAIMEI.getUrlParam('couponId');
         }
         var userInfo = localStorage.getItem('userInfo');
         if(userInfo){
-            this.userId = JSON.parse(userInfo).userId;
-            this.shopID = JSON.parse(userInfo).shopId;
+            _self.userId = JSON.parse(userInfo).userId;
+            _self.shopID = JSON.parse(userInfo).shopId;
         }
         // 获取列表数据
         this.getListByKeyword();
-    },
-    mounted: function () {
-        var _self = this;
-            //上垃加载更多
+        //上垃加载更多
         if(!isPC) {
             $('footer').addClass("noneImportant");
         }

+ 154 - 121
src/main/resources/static/js/shopping/cart.js

@@ -8,6 +8,8 @@ var shoppingCart = new Vue({
         listData: [],
         invalidData: [],
         promotionsList: [],
+        totalCouponList:[],						// 优惠券算列表
+        eligibleCoupons:[],						// 最终需要用到优惠券
         kindCount: 0,
         totalCount: 0,
         totalPrice: 0,
@@ -16,89 +18,20 @@ var shoppingCart = new Vue({
         allChecked: true,
         submitIds: [],//去结算商品Ids
         isShowPopup:false,
-        currentTab:0,
-        dataList:[
-            {
-                maxMoney:5000,
-                minMoney:1000,
-                couponType:1,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:0,
-            },
-            {
-                maxMoney:2000,
-                minMoney:200,
-                couponType:2,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:2,
-                couponBtnType:0,
-                status:1,
-            },
-            {
-                maxMoney:4000,
-                minMoney:800,
-                couponType:3,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:3,
-                couponBtnType:0,
-                status:2,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:4,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:0,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:4,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:0,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:4,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:1,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:4,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:2,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:5,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:2,
-                couponBtnType:0,
-                status:1,
-            }
-        ],
+        currentTab:1,
+        couponParam:{// 获取弹窗优惠券领取参数
+            userId:0,
+            shopId:0,
+            status:1,
+            source:1
+        },
+        isCouponEmpty:false,
+        productCoupon:[], 							// 优惠券
+        productCouponList:[],						// 优惠券弹窗列表
+        couponPrice:0,							// 优惠金额
+        totalDiscountAmount:0,					// 总共减去金额
+        isDiscount:false,						// 控制显示优惠明细
+
     },
     watch:{
         listData: {
@@ -115,49 +48,38 @@ var shoppingCart = new Vue({
         },
         TypeFormat:function(value) {
             switch (value) {
-                case 1:
+                case 0:
                     return  '活动券';
                     break;
-                case 2:
+                case 1:
                     return  '品类券';
                     break;
+                case 2:
+                    return  '用户专享券';
+                    break;
                 case 3:
                     return  '店铺券';
                     break;
                 case 4:
-                    return  '专享券';
-                    break;
-                case 5:
                     return  '新用户券';
                     break;
             }
-        },
-        TypeFormatText:function(value) {
-            switch (value) {
-                case 1:
-                    return  '全商城商品通用';
-                    break;
-                case 2:
-                    return  '仅限购买仪器类商品';
-                    break;
-                case 3:
-                    return  '仅可购买店铺';
-                    break;
-            }
         }
     },
     methods: {
         getCartLists: function () {
             var _self = this;
             if(this.userId ===0){return;}
-            tokenAjax("get", "/shoppingCart/list", {userId: this.userId},function (r) {
-                if (r.code === 0 && r.data) {
-                    _self.listData = r.data.list;
-                    _self.invalidData = r.data.invalid;
-                    _self.kindCount = r.data.kindCount;
-                    _self.totalCount = r.data.totalCount;
-                    _self.totalPrice = r.data.totalPrice;
-                    _self.promotionsList = r.data.promotions;
+            ShoppingApi.QueryShoppingCartList({userId: this.userId},function(response){
+                if(response.code === 0){
+                    var data = response.data;
+                    _self.listData = data.list;
+                    _self.invalidData = data.invalid;
+                    _self.kindCount = data.kindCount;
+                    _self.totalCount = data.totalCount;
+                    _self.totalPrice = data.totalPrice;
+                    _self.promotionsList = data.promotions;
+                    _self.totalCouponList = data.couponList
                     // 默认全选
                     _self.listData.forEach(function(supplier){
                         supplier.checked = true;
@@ -169,9 +91,11 @@ var shoppingCart = new Vue({
                     });
                     _self.allChecked = true;
                     _self.computedPrice();
+                    _self.listLoading = false;
+                }else{
+                    CAIMEI.Alert(response.msg,'确定',true, function(){});
                 }
-                _self.listLoading = false;
-            });
+            })
         },
         toggleThisLadder: function(event){
             var el = event.currentTarget;
@@ -318,7 +242,77 @@ var shoppingCart = new Vue({
                 _self.originalPrice = originalPrice;
                 _self.kindCount = kindCount;
                 _self.totalCount = totalCount;
+                // 计算优惠券
+                if(_self.totalCouponList.length>0){
+                    _self.calculationCoupon();
+                }
+                // 最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
+                _self.totalDiscountAmount = _self.reducedPrice + _self.couponPrice;
+                console.log('totalDiscountAmount',_self.totalDiscountAmount);
+                // 控制显示优惠明细
+                if(_self.totalDiscountAmount > 0 ){
+                    _self.isDiscount = true;
+                }else{
+                    _self.isDiscount = false;
+                }
             });
+
+        },
+        calculationCoupon:function(){// 优惠券计算
+            var _self = this;
+            var eligibleCoupons = [];
+            _self.listData.forEach(function(shop,index){
+                shop.cartList.forEach(function(pros){
+                    if(_self.submitIds.includes(pros.productId*1)){
+                        _self.totalCouponList.map(function (coupon,index){//循环优惠券
+                            var couponType = coupon.couponType;
+                            if(couponType == 0){// 活动券
+                                if(coupon.productType == 1){// 活动券-全商城商品
+                                    if(_self.totalPrice>=coupon.touchPrice){
+                                        eligibleCoupons.push(coupon)
+                                        eligibleCoupons.sort((a,b)=> b.couponAmount - a.couponAmount )
+                                    }
+                                }else if(coupon.productType == 2){// 活动券-指定商品
+                                    if(coupon.productIds && coupon.productIds.includes(pros.productId)){
+                                        if(_self.totalPrice>=coupon.touchPrice){
+                                            eligibleCoupons.push(coupon)
+                                            eligibleCoupons.sort((a,b)=> b.couponAmount - a.couponAmount )
+                                        }
+                                    }else{
+                                        return false
+                                    }
+                                }
+                                // 品类券适用于产品或者仪器,购买产品类或仪器类的商品,商品金额达到优惠标准即可使用优惠券
+                            }else if(couponType == 1){// 品类券 categoryType(commodityType) : 1 产品  2 仪器
+                                if( coupon.categoryType && coupon.categoryType == pros.commodityType){
+                                    if(_self.totalPrice>=coupon.touchPrice){
+                                        eligibleCoupons.push(coupon)
+                                        eligibleCoupons.sort((a,b)=> b.couponAmount - a.couponAmount )
+                                    }
+                                }
+                                // 适用于商城全部商品
+                            }else if(couponType == 2 || couponType == 4){// 用户专享券和新用户券
+                                if(_self.totalPrice>=coupon.touchPrice){
+                                    eligibleCoupons.push(coupon)
+                                    eligibleCoupons.sort((a,b)=> b.couponAmount - a.couponAmount )
+                                }
+                                // 店铺券适用于某个供应商的全部商品
+                            }else if(couponType == 3){// 店铺券 supplierId
+                                if(coupon.shopId && pros.supplierId == coupon.shopId){
+                                    if(_self.totalPrice>=coupon.touchPrice){
+                                        eligibleCoupons.push(coupon)
+                                        eligibleCoupons.sort((a,b)=> b.couponAmount - a.couponAmount )
+                                    }
+                                }
+                            }
+                        })
+                    }
+                })
+            })
+            if(eligibleCoupons.length>0){
+                _self.eligibleCoupons.push(eligibleCoupons[0])
+                _self.couponPrice = _self.eligibleCoupons.sort((a,b)=> b.couponAmount - a.couponAmount)[0].couponAmount
+            }
         },
         cartNumberSub: function(cart){
             cart.number -= cart.step;
@@ -358,13 +352,13 @@ var shoppingCart = new Vue({
             });
         },
         updateCart: function(cart){
-            tokenAjax("post", "/shoppingCart/update", {
-                userID: this.userId,
-                productID: cart.productId,
-                productCount: cart.number
-            },function (res) {
-                console.log(res);
-            });
+            ShoppingApi.ShoppingCartUpdate({userID:_self.userId,productID: cart.productId,productCount: cart.number},function(response){
+                if(response.code === 0){
+                    console.log('更新购物车商品数量成功');
+                }else{
+                    CAIMEI.Alert(response.msg,'确定',true, function(){});
+                }
+            })
         },
         deleteCart: function(productIds){
             var _self = this;
@@ -413,12 +407,51 @@ var shoppingCart = new Vue({
                 window.location.href = '/shopping/confirm.html?type=1';
             }
         },
+        queryPopupCoupons:function(){// 获取弹窗优惠券列表
+            var  _self = this;
+            ShoppingApi.ShoppingCartGetCoupon(_self.couponParam, function (response) {
+                if(response.code == 0){
+                    var data = response.data;
+                    if(data.couponList && data.couponList.length >0){
+                        _self.productCouponList = data.couponList;
+                        _self.isCouponEmpty = false;
+                        console.log('有优惠券')
+                        console.log(_self.productCouponList)
+                    }else{
+                        console.log('没有优惠券')
+                        _self.isCouponEmpty = true;
+                    }
+                }else{
+                    console.log('获取优惠券列表失败')
+                }
+            })
+        },
+        receiveCoupon:function(coupon){// 点击领取优惠券
+            var  _self = this;
+            ProductApi.ReceiveCoupon({userId:_self.couponParam.userId, couponId:coupon.couponId, source:1}, function (response) {
+                if(response.code == 0){
+                    CAIMEI.dialog('领取成功',true,function () {
+                        _self.currentTab = 2;
+                        _self.couponParam.status = 2;
+                        _self.queryPopupCoupons();
+                    });
+                }else{
+                    CAIMEI.Alert(response.msg, '确定', false);
+                }
+            })
+        },
         queryCouponTabs:function (value){
             var _self = this;
-            _self.currentTab = value;
+            _self.currentTab = _self.couponParam.status = value;
+            _self.queryPopupCoupons();
         },
-        showPopup:function(){// 显示优惠券弹窗
+        showPopup:function(shop){// 显示优惠券弹窗
             var _self = this;
+            _self.productCouponList = [];
+            _self.currentTab = 1;
+            _self.couponParam.status = 1;
+            _self.couponParam.shopId = shop.id
+            _self.queryPopupCoupons();
             _self.isShowPopup = true;
         },
         hidePopup:function(){// 隐藏优惠券弹窗
@@ -428,7 +461,7 @@ var shoppingCart = new Vue({
     },
     created: function () {
         if(globalUserData){
-            this.userId = globalUserData.userId;
+            this.userId = this.couponParam.userId = globalUserData.userId;
             this.userIdentity = globalUserData.identity;
             this.userToken = globalUserData.token;
         }

+ 46 - 70
src/main/resources/static/js/shopping/confirm.js

@@ -10,7 +10,9 @@ var shoppingConfirm = new Vue({
         kindCount: 0,
         totalCount: 0,
         totalPrice: 0,
-        reducedPrice: 0,
+        reducedPrice: 0,          // 满减金额
+        couponAmount:0,	  		  // 优惠券金额
+        totalDiscountAmount:0,	  // 共减金额
         address: {
             id: '',
             townId: '',
@@ -61,6 +63,7 @@ var shoppingConfirm = new Vue({
             freight: 0.00,          //邮费
             freePostFlag:-1      // 0包邮 -1到付 1 有运费
         },
+        clubCouponId:0,			  // 用户关联优惠Id
         invoice: {
             id:'',
             type: 0,
@@ -80,41 +83,8 @@ var shoppingConfirm = new Vue({
         hanldUserBeans:0,
         submitLoading: false,
         checkedIndex:null,
-        dataList:[
-            {
-                maxMoney:5000,
-                minMoney:1000,
-                couponType:1,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:0,
-                ischecked:false
-            },
-            {
-                maxMoney:2000,
-                minMoney:200,
-                couponType:2,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:2,
-                couponBtnType:0,
-                status:1,
-                ischecked:false
-            },
-            {
-                maxMoney:4000,
-                minMoney:800,
-                couponType:3,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:3,
-                couponBtnType:0,
-                status:2,
-                ischecked:false
-            }
-        ]
+        couponList:[], // 可用优惠券列表
+        isCouponShow:false,
     },
     computed: {
 
@@ -130,35 +100,22 @@ var shoppingConfirm = new Vue({
         },
         TypeFormat:function(value) {
             switch (value) {
-                case 1:
+                case 0:
                     return  '活动券';
                     break;
-                case 2:
+                case 1:
                     return  '品类券';
                     break;
+                case 2:
+                    return  '用户专享券';
+                    break;
                 case 3:
                     return  '店铺券';
                     break;
                 case 4:
-                    return  '专享券';
-                    break;
-                case 5:
                     return  '新用户券';
                     break;
             }
-        },
-        TypeFormatText:function(value) {
-            switch (value) {
-                case 1:
-                    return  '全商城商品通用';
-                    break;
-                case 2:
-                    return  '仅限购买仪器类商品';
-                    break;
-                case 3:
-                    return  '仅可购买店铺';
-                    break;
-            }
         }
     },
     methods: {
@@ -173,19 +130,27 @@ var shoppingConfirm = new Vue({
                 userId: _self.userId,
                 count: productCount,
                 productIds: this.productIds
-            },function(r){
-                if (r.code === 0 && r.data) {
-                    _self.listData = r.data.list;
-                    _self.totalPrice =  r.data.totalPrice;
-                    _self.reducedPrice = r.data.reducedPrice;
-                    _self.totalCount =  r.data.totalCount;
-                    _self.kindCount = r.data.kindCount;
-                    _self.balance.userMoney = r.data.userMoney;
-                    _self.balance.originUserMoney = r.data.userMoney;
-                    _self.payInfo.orderShouldPayFee = r.data.totalPrice;
-                    if(r.data.invoice){
-                        r.data.invoice.type = 0;
-                        _self.invoice =  r.data.invoice;
+            },function(response){
+                if (response.code === 0 ) {
+                    var data = response.data;
+                    _self.listData = data.list;
+                    _self.totalPrice =  data.totalPrice;
+                    _self.reducedPrice = data.reducedPrice;
+                    _self.totalCount =  data.totalCount;
+                    _self.couponList = data.couponList;
+                    _self.kindCount = data.kindCount;
+                    _self.balance.userMoney = data.userMoney;
+                    _self.balance.originUserMoney = data.userMoney;
+                    _self.payInfo.orderShouldPayFee = data.totalPrice;
+                    if(_self.couponList.length>0){
+                        _self.isCouponShow = true;
+                        _self.couponList.forEach((el,index) => {
+                            _self.dataList.push(Object.assign({},el,{ischecked:false}))
+                        })
+                    }
+                    if(data.invoice){
+                        data.invoice.type = 0;
+                        _self.invoice =  data.invoice;
                     }
                     _self.getAddressList(_self.userId,20);
                 }else{
@@ -459,15 +424,25 @@ var shoppingConfirm = new Vue({
         },
         checkedCoupon:function(coupon,idx){// 选择优惠券
             var _self = this;
+            var coupon = { couponAmount:0,clubCouponId:0 };
             _self.checkedIndex = idx;
-            _self.dataList.forEach((el,index) => {
+            _self.couponList.forEach((el,index) => {
                 if(_self.checkedIndex == index){
                     el.ischecked = !el.ischecked;
                 }else{
-                    el.ischecked = false
+                    el.ischecked = false;
+                }
+                if(el.ischecked){
+                    coupon.couponAmount = el.couponAmount;
+                    coupon.clubCouponId = el.clubCouponId;
                 }
             })
-            console.log('this.dataList===>',this.dataList)
+            _self.couponAmount = coupon.couponAmount;
+            _self.totalDiscountAmount = _self.reducedPrice + _self.couponAmount;
+            _self.clubCouponId = coupon.clubCouponId;
+            console.log('couponAmount',_self.couponAmount)
+            console.log('totalDiscountAmount',_self.totalDiscountAmount)
+            console.log('clubCouponId',_self.clubCouponId)
         },
         toggleThisLadder: function(event){
             var el = event.currentTarget;
@@ -691,6 +666,7 @@ var shoppingConfirm = new Vue({
                     userBeans:this.hanldUserBeans
                 };
             var params = {
+                    clubCouponId:this.clubCouponId,
                     cartType: this.type,
                     orderSource: 1,            // 购买类型:(1购物车提交[对应表cm_cart],2直接购买提交, 3协销下单)
                     serviceProviderId: '',     // 协销ID(小程序忽略)

+ 59 - 152
src/main/resources/static/js/user-center/account/coupon-collection.js

@@ -6,132 +6,35 @@ var orderPage = new Vue({
         noMore: false,
         tabsListIndex:0,
         listQuery:{
-            userId: 0,
-            year:'',
-            month:'',
-            type:0,
+            userId:0,
             pageNum:1,
-            pageSize:10
+            pageSize:9
         },
         beansList:[],
         listRecord: 0,
         pageInput: '1',
         modelType:0,
-        dataList:[
-            {
-                maxMoney:5000,
-                minMoney:1000,
-                couponType:1,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:0,
-            },
-            {
-                maxMoney:2000,
-                minMoney:200,
-                couponType:2,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:2,
-                couponBtnType:0,
-                status:1,
-            },
-            {
-                maxMoney:4000,
-                minMoney:800,
-                couponType:3,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:3,
-                couponBtnType:0,
-                status:2,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:4,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:0,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:4,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:0,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:4,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:1,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:4,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:2,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:5,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:2,
-                couponBtnType:0,
-                status:1,
-            }
-        ],
+        coupinList:[],
     },
     filters: {
         TypeFormat:function(value) {
             switch (value) {
-                case 1:
+                case 0:
                     return  '活动券';
                     break;
-                case 2:
+                case 1:
                     return  '品类券';
                     break;
+                case 2:
+                    return  '用户专享券';
+                    break;
                 case 3:
                     return  '店铺券';
                     break;
                 case 4:
-                    return  '专享券';
-                    break;
-                case 5:
                     return  '新用户券';
                     break;
             }
-        },
-        TypeFormatText:function(value) {
-            switch (value) {
-                case 1:
-                    return  '全商城商品通用';
-                    break;
-                case 2:
-                    return  '仅限购买仪器类商品';
-                    break;
-                case 3:
-                    return  '仅可购买店铺';
-                    break;
-            }
         }
     },
     computed: {
@@ -155,40 +58,10 @@ var orderPage = new Vue({
         }
     },
     methods: {
-        tabClick:function(index){//点击Tab切换查询列表
-            var  _self = this;
-            _self.tabsListIndex = index;
-            _self.listQuery.type = index;
-            _self.GetQueryBeansListData();
-        },
-        initDate:function(){//初始化获取当前年月
-            var _self = this;
-
-        },
-        reduceMonth:function(){//减月份
-            var _self = this;
-            _self.listQuery.month--;
-            if(_self.listQuery.month == 0){
-                _self.listQuery.year--;
-                _self.listQuery.month = 12;
-            }
-            _self.GetQueryBeansListData();
-            console.log('年==========>', _self.listQuery.year);
-            console.log('月==========>', _self.listQuery.month);
-        },
-        addMonth:function(){//加月份
-            var _self = this;
-            _self.listQuery.month++;
-            if(_self.listQuery.month > 12){
-                _self.listQuery.year++;
-                _self.listQuery.month = 1;
-            }
-            _self.GetQueryBeansListData();
-        },
         toPagination: function (pageNum) {//点击切换分页
             if (pageNum <= this.pageTotal) {
                 this.listQuery.pageNum = pageNum;
-                this.GetQueryBeansListData();
+                this.QueryCouponCollarList();
             }
         },
         checkNum: function () {//输入跳转分页
@@ -207,23 +80,21 @@ var orderPage = new Vue({
             _self.listQuery.endTime = '';
             _self.listQuery.pageNum = 1;
             _self.isRequset = true;
-            _self.GetQueryBeansListData()
+            _self.QueryCouponCollarList()
         },
-        GetQueryBeansListData:function(){//查询订单列表
+        QueryCouponCollarList:function(){//查询订单列表
             var _self = this;
-            UserApi.GetUserClubBeansList(_self.listQuery,function (response) {
+            ProductApi.QueryCouponCollarList(_self.listQuery,function (response) {
                 if(response.code == 0){
                     var data = response.data;
-                    var pageInfo = data.pageInfo;
-                    _self.userBeans = data.userBeans;
-                    if( pageInfo.list && pageInfo.list.length>0) {
-                        _self.beansList = [];
-                        _self.beansList = pageInfo.list;
-                        _self.listRecord = pageInfo.total;
+                    if( data.list && data.list.length>0) {
+                        _self.coupinList = [];
+                        _self.coupinList = data.list;
+                        _self.listRecord = data.total;
                     }else{
-                        _self.beansList = [];
-                        _self.beansList = pageInfo.list;
-                        _self.listRecord = pageInfo.total;
+                        _self.coupinList = [];
+                        _self.coupinList = data.list;
+                        _self.listRecord = data.total;
                     }
                     _self.isRequset = false;
                 }else{
@@ -231,21 +102,57 @@ var orderPage = new Vue({
                 }
             })
         },
-        receiveCoupon:function(coupon){
+        receiveCoupon:function(coupon){// 点击领取按钮事件处理
             var  _self = this;
             if(_self.listQuery.userId == 0){
                 window.location.href='/login.html';
             }else{
-                coupon.couponBtnType = 1;
+                ProductApi.ReceiveCoupon({userId:_self.listQuery.userId, couponId:coupon.couponId, source:1}, function (response) {
+                    if(response.code == 0){
+                        coupon.couponBtnType = 1;
+                    }else{
+                        CAIMEI.Alert(response.msg, '确定', false);
+                    }
+                })
             }
         },
-        myClickCoupon:function (){
+        myClickCoupon:function (){// 我的优惠券跳转
             var  _self = this;
             if(_self.listQuery.userId>0){
                 window.location.href='/user/coupon.html';
             }else{
                 window.location.href='/login.html';
             }
+        },
+        toUseCoupon:function (coupon){// 去使用跳转路径
+            console.log('coupon',coupon)
+            switch (coupon.couponType) {
+                case 0:// 活动券跳转到商城首页 / 或者活动页(看是否指定了商品)
+                    if(coupon.productType == 1){
+                        window.location.href='/index.html';
+                    }else{
+                        window.location.href='/product/product-coupon.html?couponId='+coupon.couponId;
+                    }
+                    break;
+                case 1:// 品类券:跳转到产品 / 仪器页
+                    if(coupon.categoryType == 1){
+                        window.location.href='/product/type-287.html';
+                    }else{
+                        window.location.href='/product/type-286.html';
+                    }
+                    break;
+                case 2:// 专享券:跳转到商城首页
+                    window.location.href='/index.html';
+                    break;
+                case 3:// 店铺券:跳转到店铺首页
+                    console.log('22222222222')
+                    window.location.href='/supplier-'+coupon.shopId+'.html';
+                    debugger
+                    break;
+                case 4:// 新用户券:跳转到商城首页
+                    window.location.href='/index.html';
+                    break;
+            }
         }
     },
     mounted: function () {
@@ -253,7 +160,7 @@ var orderPage = new Vue({
         if(globalUserData){
             _self.userId = globalUserData.userId;
             _self.listQuery.userId = this.userId;
-            _self.GetQueryBeansListData();
+            _self.QueryCouponCollarList();
         }
     }
 });

+ 47 - 3
src/main/resources/static/js/user-center/account/coupon-exchange.js

@@ -3,26 +3,70 @@ var orderPage = new Vue({
     el: "#beansPage",
     data: {
         params:{
-            couponCode:'',
+            userId:0,
+            redemptionCode:'',
+            source:2
         },
+        isCouponModel:false,
+        coupon:{},
         userId: 0,
     },
     computed: {
 
+    },
+    filters: {
+        TypeFormat:function(value) {
+            switch (value) {
+                case 0:
+                    return  '活动券';
+                    break;
+                case 1:
+                    return  '品类券';
+                    break;
+                case 2:
+                    return  '用户专享券';
+                    break;
+                case 3:
+                    return  '店铺券';
+                    break;
+                case 4:
+                    return  '新用户券';
+                    break;
+            }
+        }
     },
     methods: {
         exchangeConfirm:function(){//查询订单列表
             var _self = this;
-            if( _self.params.couponCode == ''){
+            if( _self.params.redemptionCode == ''){
                 CAIMEI.dialog('请输入位兑换码',false)
                 return
             }
+            _self.ExchangeCoupon(_self.params);
+        },
+        ExchangeCoupon: function (){// 兑换优惠券
+            var _self = this;
+            ProductApi.ExchangeCoupon(_self.params,function (response) {
+                if(response.code == 0){
+                    _self.coupon = response.data
+                    _self.isCouponModel = true
+                }else{
+                    CAIMEI.Alert(response.msg, '确定', false);
+                }
+            })
+        },
+        handleClickCancel:function (){
+            var _self = this;
+            _self.isCouponModel = false
+            setTimeout(function(){
+                window.location.href='/user/coupon.html';
+            },500)
         }
     },
     mounted: function () {
         var _self = this;
         if(globalUserData){
-            _self.userId = globalUserData.userId;
+            _self.params.userId = globalUserData.userId;
         }
     }
 });

+ 61 - 170
src/main/resources/static/js/user-center/account/coupon.js

@@ -11,14 +11,12 @@ var orderPage = new Vue({
             {value: 2,text: '已失效'}
         ],
         listQuery:{
-            userId: 0,
-            year:'',
-            month:'',
-            type:0,
+            userId:0,
             pageNum:1,
-            pageSize:10
+            pageSize:6,
+            status:1
         },
-        beansList:[],
+        coupinList:[],
         listRecord: 0,
         pageInput: '1',
         userBeans:0,
@@ -33,134 +31,40 @@ var orderPage = new Vue({
         hanldOrderData:{},//监听点击的单个订单项的按钮
         confrimsBtn:true,
         listClass:'used',
-        dataList:[
-            {
-                maxMoney:5000,
-                minMoney:1000,
-                couponType:1,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:0,
-            },
-            {
-                maxMoney:2000,
-                minMoney:200,
-                couponType:2,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:2,
-                couponBtnType:0,
-                status:1,
-            },
-            {
-                maxMoney:4000,
-                minMoney:800,
-                couponType:3,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:3,
-                couponBtnType:0,
-                status:2,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:4,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:0,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:4,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:0,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:4,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:1,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:4,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:1,
-                couponBtnType:0,
-                status:2,
-            },
-            {
-                maxMoney:6000,
-                minMoney:1000,
-                couponType:5,
-                couponTime:'2021.06.28~2021.07.28',
-                couponText:'华熙生物技术有限公司',
-                useType:2,
-                couponBtnType:0,
-                status:1,
-            }
-        ],
+        dataList:[],
     },
     filters: {
         TypeBtnFormat:function(value){
             switch (value) {
-                case 0:
+                case 1:
                     return  '去使用';
                     break;
-                case 1:
+                case 2:
                     return  '已使用';
                     break;
-                case 2:
+                case 3:
                     return  '已失效';
                     break;
             }
         },
         TypeFormat:function(value) {
             switch (value) {
-                case 1:
+                case 0:
                     return  '活动券';
                     break;
-                case 2:
+                case 1:
                     return  '品类券';
                     break;
+                case 2:
+                    return  '用户专享券';
+                    break;
                 case 3:
                     return  '店铺券';
                     break;
                 case 4:
-                    return  '专享券';
-                    break;
-                case 5:
                     return  '新用户券';
                     break;
             }
-        },
-        TypeFormatText:function(value) {
-            switch (value) {
-                case 1:
-                    return  '全商城商品通用';
-                    break;
-                case 2:
-                    return  '仅限购买仪器类商品';
-                    break;
-                case 3:
-                    return  '仅可购买店铺';
-                    break;
-            }
         }
     },
     computed: {
@@ -191,49 +95,37 @@ var orderPage = new Vue({
             switch(_self.tabsListIndex){
                 case 0:
                     _self.listClass = 'used'
+                    _self.listQuery.status = 1
                     break;
                 case 1:
                     _self.listClass = 'none'
+                    _self.listQuery.status = 2
                     break;
                 case 2:
                     _self.listClass = 'none'
+                    _self.listQuery.status = 3
                     break;
             }
-            _self.listQuery.type = index;
-            _self.GetQueryBeansListData();
-        },
-        initDate:function(){//初始化获取当前年月
-            var _self = this;
-            var _Date = new Date();
-            _self.listQuery.year = _Date.getFullYear();
-            _self.listQuery.month = _Date.getMonth()+1;
-            console.log('当前年份==========>', _self.listQuery.year);
-            console.log('当前月份==========>', _self.listQuery.month);
-        },
-        reduceMonth:function(){//减月份
-            var _self = this;
-            _self.listQuery.month--;
-            if(_self.listQuery.month == 0){
-                _self.listQuery.year--;
-                _self.listQuery.month = 12;
-            }
-            _self.GetQueryBeansListData();
-            console.log('年==========>', _self.listQuery.year);
-            console.log('月==========>', _self.listQuery.month);
+            _self.listQuery.pageNum = 1;
+            _self.QueryCouponCenter();
         },
-        addMonth:function(){//加月份
+        getQueryCouponsCount: function (){// 获取优惠券数量
             var _self = this;
-            _self.listQuery.month++;
-            if(_self.listQuery.month > 12){
-                _self.listQuery.year++;
-                _self.listQuery.month = 1;
-            }
-            _self.GetQueryBeansListData();
+            ProductApi.QueryCouponsCount({userId:this.listQuery.userId,},function (response) {
+                if(response.code == 0){
+                    let data = response.data
+                    _self.tabsList[0].num = data.unusedNum
+                    _self.tabsList[1].num = data.usedNum
+                    _self.tabsList[2].num = data.expiredNum
+                }else{
+                    CAIMEI.Alert(response.msg, '确定', false);
+                }
+            })
         },
         toPagination: function (pageNum) {//点击切换分页
             if (pageNum <= this.pageTotal) {
                 this.listQuery.pageNum = pageNum;
-                this.GetQueryBeansListData();
+                this.QueryCouponCenter();
             }
         },
         checkNum: function () {//输入跳转分页
@@ -243,31 +135,19 @@ var orderPage = new Vue({
                 this.pageInput = 1;
             }
         },
-        changeOrderFn:function(index,status){
-            var  _self = this;
-            _self.orderTabBarIndex = index;
-            _self.listQuery.orderState = status;
-            _self.listQuery.searchNo = '';
-            _self.listQuery.beginTime = '';
-            _self.listQuery.endTime = '';
-            _self.listQuery.pageNum = 1;
-            _self.isRequset = true;
-            _self.GetQueryBeansListData()
-        },
-        GetQueryBeansListData:function(){//查询订单列表
+        QueryCouponCenter:function(){//查询订单列表
             var _self = this;
-            UserApi.GetUserClubBeansList(_self.listQuery,function (response) {
+            ProductApi.QueryCouponCenter(_self.listQuery,function (response) {
                 if(response.code == 0){
                     var data = response.data;
-                    var pageInfo = data.pageInfo;
-                    if( pageInfo.list && pageInfo.list.length>0) {
-                        _self.beansList = [];
-                        _self.beansList = pageInfo.list;
-                        _self.listRecord = pageInfo.total;
+                    if( data.list && data.list.length>0) {
+                        _self.coupinList = [];
+                        _self.coupinList = data.list;
+                        _self.listRecord = data.total;
                     }else{
-                        _self.beansList = [];
-                        _self.beansList = pageInfo.list;
-                        _self.listRecord = pageInfo.total;
+                        _self.coupinList = [];
+                        _self.coupinList = data.list;
+                        _self.listRecord = data.total;
                     }
                     _self.isRequset = false;
                 }else{
@@ -276,21 +156,32 @@ var orderPage = new Vue({
             })
         },
         toUseCoupon:function(coupon){// 点击去使用跳转路由处理
-            if(coupon.status == 0){
+            console.log(coupon)
+            if(coupon.useStatus == 1){
                 switch (coupon.couponType) {
-                    case 1:// 活动券跳转到商城首页 / 或者活动页(看是否指定了商品)
-                        window.location.href='/product/product-coupon.html';
+                    case 0:// 活动券跳转到商城首页 / 或者活动页(看是否指定了商品)
+                        if(coupon.productType == 1){
+                            window.location.href='/index.html';
+                        }else{
+                            window.location.href='/product/product-coupon.html?couponId='+coupon.couponId;
+                        }
                         break;
-                    case 2:// 品类券:跳转到产品 / 仪器页
-                        window.location.href='/product/type-287.html';
+                    case 1:// 品类券:跳转到产品 / 仪器页
+                        if(coupon.categoryType == 1){
+                            window.location.href='/product/type-287.html';
+                        }else{
+                            window.location.href='/product/type-286.html';
+                        }
                         break;
-                    case 3:// 店铺券:跳转到店铺首页
+                    case 2:// 专享券:跳转到商城首页
                         window.location.href='/index.html';
                         break;
-                    case 4:// 专享券:跳转到商城首页
-                        window.location.href='/index.html';
+                    case 3:// 店铺券:跳转到店铺首页
+                        console.log('22222222222')
+                        window.location.href='/supplier-'+coupon.shopId+'.html';
+                        debugger
                         break;
-                    case 5:// 新用户券:跳转到商城首页
+                    case 4:// 新用户券:跳转到商城首页
                         window.location.href='/index.html';
                         break;
                 }
@@ -304,8 +195,8 @@ var orderPage = new Vue({
         if(globalUserData){
             _self.userId = globalUserData.userId;
             _self.listQuery.userId = this.userId;
-            _self.initDate();
-            _self.GetQueryBeansListData();
+            _self.getQueryCouponsCount();
+            _self.QueryCouponCenter();
         }
     }
 });

+ 11 - 9
src/main/resources/static/js/user-center/dashboard.js

@@ -8,17 +8,18 @@ var helpSuggestion = new Vue({
         degree:'',
         userInfo:{},
         formData:new FormData(),
-        unReadMessageCount:'',//消息数
-        confirmedCount:'',//待確認數量
-        paymentCount:'',//待付款
-        waitShipmentsCount:'',//待发货
-        shipmentsCount:'',//已发货
-        salesReturnCount:'',//退货款
-        productList:[],//推荐商品
-        newsList:[],//新闻动态
+        unReadMessageCount:'',// 消息数
+        confirmedCount:'',// 待確認數量
+        paymentCount:'',// 待付款
+        waitShipmentsCount:'',// 待发货
+        shipmentsCount:'',// 已发货
+        salesReturnCount:'',// 退货款
+        productList:[],// 推荐商品
+        newsList:[],// 新闻动态
         isShowBeansAlet:false,
-        bgImagePath:'',//根据类型显示图片标记
+        bgImagePath:'',// 根据类型显示图片标记
         beanNumber:100,
+        couponNum:0,// 优惠券数量
         beansType:1
     },
     methods: {
@@ -37,6 +38,7 @@ var helpSuggestion = new Vue({
                     _self.salesReturnCount = _self.showBadge(data.salesReturnCount);
                     _self.productList = data.homePageAdvertiseList;
                     _self.newsList = data.homePageInfoList;
+                    _self.couponNum = data.couponNum;
                     _self.isRequset = false;
                 }else{
                     CAIMEI.Alert(response.msg, '确定', false);

+ 1 - 1
src/main/resources/templates/components/header.html

@@ -110,7 +110,7 @@
     <div class="baseTopNav">
         <div class="wrap clear">
             <div class="baseTopNav_nav">
-                <a class="classBtn nav on" href="javascript:void(0);">分类展示</a>
+                <a class="classBtn nav on" href="javascript:void(0);">商品分类</a>
                 <a class="home nav" href="/">首页</a>
                 <div class="navBox">
                     <ul class="clear">

+ 3 - 3
src/main/resources/templates/index.html

@@ -165,7 +165,7 @@
                                                 <!-- 正常商品 -->
                                                 <template v-if="pros.product.productCategory == 1">
                                                     <div class="price_text_tag">
-                                                        <p class="couponTag">优惠券</p>
+                                                        <p class="couponTag" v-if="pros.product.couponsLogo">优惠券</p>
                                                         <p class="listTag" v-if="pros.product.actStatus ==1 && pros.product.promotions">
                                                             <span v-text="pros.product.promotions.name"></span>
                                                             <template v-if="PromotionsFormat(pros.product.promotions)">
@@ -290,8 +290,8 @@
                                                         <div th:attr="class=*{'main_price_text product_'+productId}, data-id=*{productId}">
                                                             <!-- 正常商品 -->
                                                             <th:block th:if="*{productCategory}==1">
-                                                                <div class="price_text_tag" th:if="${pros.get('product').containsKey('actStatus')}">
-                                                                    <p class="couponTag">优惠券</p>
+                                                                <div class="price_text_tag">
+                                                                    <p class="couponTag" th:if="*{couponsLogo}">优惠券</p>
                                                                     <p class="listTag" th:if="*{actStatus}==1 and ${pros.get('product').get('promotions')}!=null">
                                                                         <template th:text="*{promotions.name}"></template>
                                                                         <th:block th:if="*{promotions.type}==1 and *{promotions.mode}==1">

+ 5 - 0
src/main/resources/templates/product/beautytopic.html

@@ -101,6 +101,7 @@
                                                     <!--价格未公开-->
                                                     <div class="main_price_text">
                                                         <div class="price_text_tag">
+															<p class="couponTag" v-if="pros.couponsLogo">优惠券</p>
                                                             <p class="listTag" v-if="pros.actStatus==1">{{pros.promotions.name}}</p>
                                                         </div>
                                                         <div class="main_price_unde">¥价格未公开</div>
@@ -111,6 +112,7 @@
                                                     <template v-if="(pros.price1TextFlag==0 && pros.userIdentity!=3) || pros.userIdentity==2 || (pros.userIdentity==3 && pros.shopID==GLOBAL_SHOP_ID)">
                                                         <div class="main_price_text" v-if="pros.productCategory == 1">
                                                             <div class="price_text_tag">
+																<p class="couponTag" v-if="pros.couponsLogo">优惠券</p>
                                                                 <p class="listTag" v-if="pros.actStatus==1">
                                                                     {{pros.promotions.name}}
                                                                     <span v-if="pros.priceFlag != 1">:¥{{pros.retailPrice | NumFormat}}</span>
@@ -125,6 +127,7 @@
                                                     <template v-else-if="pros.price1TextFlag==2 && pros.userIdentity==4">
                                                         <div class="main_price_text">
                                                             <div class="price_text_tag">
+																<p class="couponTag" v-if="pros.couponsLogo">优惠券</p>
                                                                 <p class="listTag" v-if="pros.actStatus==1">{{pros.promotions.name}}</p>
                                                             </div>
                                                             <div class="main_price_unde">¥会员可见</div>
@@ -132,6 +135,7 @@
                                                     </template>
                                                     <template v-else>
                                                         <div class="price_text_tag">
+															<p class="couponTag" v-if="pros.couponsLogo">优惠券</p>
                                                             <p class="listTag" v-if="pros.actStatus==1">{{pros.promotions.name}}</p>
                                                         </div>
                                                         <div class="main_price_none">
@@ -155,6 +159,7 @@
                                         <template v-else>
                                             <template v-if="pros.productCategory == 1">
                                                 <div class="price_text_tag ">
+													<p class="couponTag" v-if="pros.couponsLogo">优惠券</p>
                                                     <p class="listTag" v-if="pros.actStatus==1">{{pros.promotions.name}}</p>
                                                 </div>
                                                 <div class="main_price_none">

+ 24 - 16
src/main/resources/templates/product/detail.html

@@ -13,7 +13,7 @@
 <template th:replace="components/header"></template>
 
 <!-- 商品详情 -->
-<div id="productDetail" v-show="showProduct">
+<div id="productDetail" v-show="showProduct" v-cloak>
     <input type="hidden" th:value="${productId}" id="productId">
     <input type="hidden" th:value="${product?.stock}" id="productStock">
     <input type="hidden" th:value="${product?.visibility}" id="productVisibility">
@@ -142,8 +142,7 @@
                         <span class="l">优惠券</span>
                         <i>:</i>
                         <span class="coupon-tags">
-                            <em class="couponTag">满50000减400</em>
-                            <em class="couponTag">满50000减400</em>
+                            <em class="couponTag" v-for="(coupon, index) in productCoupon" :key="index">满{{ coupon.touchPrice }}减{{ coupon.couponAmount }} </em>
                             <em class="couponTag-more" @click="showPopup">更多></em>
                         </span>
                     </div>
@@ -300,31 +299,40 @@
             </div>
         </div>
         <!--优惠券弹窗-->
-        <div class="coupon-popup" v-show="isShowPopup">
+        <div class="coupon-popup" v-show="isShowPopup" :class="isShowPopup ? 'show' : 'hide'">
             <div class="coupon-popup-model-content">
                 <div class="title"><p>优惠券</p><i class="icon mIcon" @click="hidePopup"></i></div>
                 <div class="coupon-popup-main">
                     <div class="coupon-popup-tabs">
-                        <div class="popup-tabs-cell" :class="currentTab == 0 ? 'active' : ''" @click="queryCouponTabs(0)"><span>未领取</span></div>
-                        <div class="popup-tabs-cell" :class="currentTab == 1 ? 'active' : ''" @click="queryCouponTabs(1)"><span>已领取</span></div>
+                        <div class="popup-tabs-cell" :class="currentTab == 1 ? 'active' : ''" @click="queryCouponTabs(1)"><span>未领取</span></div>
+                        <div class="popup-tabs-cell" :class="currentTab == 2 ? 'active' : ''" @click="queryCouponTabs(2)"><span>已领取</span></div>
                     </div>
                     <div class="coupon-popup-content">
-                        <div class="coupon-popup-scroll">
-                            <div class="coupon-list-cell" v-for="(coupon, index) in dataList" :key="index" :class="currentTab == 1 ? 'none' : ''">
+                        <div class="empty" v-if="isCouponEmpty">
+                            <img src="/img/account/icon-coupon-empty@2x.png">
+                            <div class="msg"><p>暂无可领的优惠券</p></div>
+                        </div>
+                        <div class="coupon-popup-scroll" v-else>
+                            <div class="coupon-list-cell" v-for="(coupon, index) in productCouponList" :key="index" :class="currentTab == 2 ? 'none' : ''">
                                 <div class="coupon-list-le">
                                     <div class="coupon-list-money">
-                                        <p>¥<span class="maxMoney">{{ coupon.maxMoney }}</span><span class="minMoney">满{{ coupon.minMoney }}可用</span></p>
+                                        <p>¥<span class="maxMoney">{{ coupon.couponAmount }}</span><span class="minMoney">满{{ coupon.touchPrice }}可用</span></p>
                                     </div>
                                     <div class="coupon-list-name">
-                                        <p v-if="coupon.useType == 1">{{ coupon.useType | TypeFormatText }}</p>
-                                        <p v-if="coupon.useType == 2">{{ coupon.useType | TypeFormatText }}</p>
-                                        <p v-if="coupon.useType == 3">{{ coupon.useType | TypeFormatText }}{{ coupon.couponText }}的商品</p>
+                                        <p v-if="coupon.couponType == 0">
+                                            {{ coupon.productType && coupon.productType == 1 ? '全商城商品通用' : '仅可购买指定商品'  }}
+                                        </p>
+                                        <p v-if="coupon.couponType == 1">
+                                            {{ coupon.categoryType == 1 ? '仅限购买产品类商品' : '仅限购买仪器类商品' }}
+                                        </p>
+                                        <p v-if="coupon.couponType == 3">仅限购买店铺【{{ coupon.shopName }}】的商品</p>
+                                        <p v-if="coupon.couponType == 4 || coupon.couponType == 2">全商城商品通用</p>
                                     </div>
-                                    <div class="coupon-list-time">{{ coupon.couponTime }}</div>
+                                    <div class="coupon-list-time">{{ coupon.endDate }}</div>
                                 </div>
-                                <div class="coupon-list-ri" :class="currentTab == 1 ? 'none' : ''">
-                                    <span v-if="currentTab == 0" @click="receiveCoupon(coupon)">领取</span>
-                                    <span v-if="currentTab == 1">已领取</span>
+                                <div class="coupon-list-ri" :class="currentTab == 2 ? 'none' : ''">
+                                    <span v-if="currentTab == 1" @click="receiveCoupon(coupon)">领取</span>
+                                    <span v-if="currentTab == 2">已领取</span>
                                 </div>
                                 <div class="coupon-tags">{{ coupon.couponType | TypeFormat }}</div>
                             </div>

+ 4 - 4
src/main/resources/templates/product/instruelist.html

@@ -95,7 +95,7 @@
                                     <template v-else>
                                         <template v-if="(p.priceFlag==0 && p.userIdentity!=3) || p.userIdentity==2 || (p.userIdentity==3 && p.shopId==GLOBAL_SHOP_ID)">
                                            <div class="price_text_tag">
-                                                <p class="couponTag">优惠券</p>
+                                                <p class="couponTag"v-if="p.couponsLogo">优惠券</p>
                                                 <p class="listTag" v-if="p.actStatus==1">
                                                     {{p.promotions.name}}
                                                     <span v-if="p.priceFlag != 1 && PromotionsFormat(p.promotions)">:¥{{p.price | NumFormat}}</span>
@@ -107,14 +107,14 @@
                                         </template>
                                         <template v-else-if="p.priceFlag==2 && p.userIdentity==4">
                                              <div class="price_text_tag">
-                                                <p class="couponTag">优惠券</p>
+                                                <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                                 <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
                                             </div>
                                             <div class="main_price_unde">¥会员可见</div>
                                         </template>
                                         <template v-else>
                                          <div class="price_text_tag">
-                                            <p class="couponTag">优惠券</p>
+                                            <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                             <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
                                         </div>
                                         <div class="price_grade"><span class="bold">¥</span><i :class="'icon mIcon i'+p.priceGrade"></i></div>
@@ -123,7 +123,7 @@
                                 </template>
                                 <template v-else>
                                      <div class="price_text_tag ">
-                                         <p class="couponTag">优惠券</p>
+                                         <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                          <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
                                       </div>
                                       <div class="price_grade "><span class="bold">¥</span><i :class="'icon mIcon i'+p.priceGrade"></i></div>

+ 3 - 3
src/main/resources/templates/product/instrument.html

@@ -118,7 +118,7 @@
                                         <!-- 正常商品 -->
                                             <template v-if="pros.product.productCategory == 1">
                                                 <div class="price_text_tag">
-                                                    <p class="couponTag">优惠券</p>
+                                                    <p class="couponTag" v-if="pros.product.couponsLogo">优惠券</p>
                                                     <p class="listTag" v-if="pros.product.actStatus ==1 && pros.product.promotions">
                                                         <span v-text="pros.product.promotions.name"></span>
                                                         <template v-if="PromotionsFormat(pros.product.promotions)">
@@ -242,8 +242,8 @@
                                                     <div th:attr="class=*{'main_price_text product_'+productId}, data-id=*{productId}">
                                                         <!-- 正常商品 -->
                                                         <th:block th:if="*{productCategory}==1">
-                                                            <div class="price_text_tag" th:if="${pros.get('product').containsKey('actStatus')}">
-                                                                <p class="couponTag">优惠券</p>
+                                                            <div class="price_text_tag">
+                                                                <p class="couponTag" th:if="*{couponsLogo}">优惠券</p>
                                                                 <p class="listTag" th:if="*{actStatus}==1 and ${pros.get('product').get('promotions')}!=null">
                                                                     <template th:text="*{promotions.name}"></template>
                                                                     <th:block th:if="*{promotions.type}==1 and *{promotions.mode}==1">

+ 4 - 4
src/main/resources/templates/product/list.html

@@ -124,7 +124,7 @@
                             <template v-else>
                                 <template v-if="(p.priceFlag==0 && p.userIdentity!=3) || p.userIdentity==2 || (p.userIdentity==3 && p.shopId==GLOBAL_SHOP_ID)">
                                     <div class="price_text_tag">
-                                        <p class="couponTag">优惠券</p>
+                                        <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                         <p class="listTag" v-if="p.actStatus==1">
                                             {{p.promotions.name}}
                                             <span v-if="p.priceFlag != 1 && PromotionsFormat(p.promotions)">:¥{{p.price | NumFormat}}</span>
@@ -136,14 +136,14 @@
                                 </template>
                                 <template v-else-if="p.priceFlag==2 && p.userIdentity==4">
                                     <div class="price_text_tag">
-                                        <p class="couponTag">优惠券</p>
+                                        <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                         <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
                                     </div>
                                     <div class="main_price_unde">¥会员可见</div>
                                 </template>
                                 <template v-else>
                                     <div class="price_text_tag">
-                                        <p class="couponTag">优惠券</p>
+                                        <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                         <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
                                     </div>
                                     <div class="price_grade"><span class="bold">¥</span><i :class="'icon mIcon i'+p.priceGrade"></i></div>
@@ -152,7 +152,7 @@
                         </template>
                         <template v-else>
                             <div class="price_text_tag ">
-                                <p class="couponTag">优惠券</p>
+                                <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                 <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
                             </div>
                             <div class="price_grade "><span class="bold">¥</span><i :class="'icon mIcon i'+p.priceGrade"></i></div>

+ 7 - 7
src/main/resources/templates/product/product-coupon.html

@@ -20,8 +20,8 @@
         <!--banner图-->
         <div class="coupon-banner">
             <a href='javascript:void(0)'>
-                <img src="https://img-b.caimei365.com/group1/M00/03/2F/Cmgy62CLqkKALo9yAAXXb7lOUDg193.jpg" v-if="isPC">
-                <img src="https://img-b.caimei365.com/group1/M00/03/2F/Cmgy62CLqkKAN-QJAAKb1_mLtyU768.jpg" v-else>
+                <img :src="pcBanner" v-if="isPC">
+                <img :src="appletsBanner" v-else>
             </a>
         </div>
         <!--商品列表-->
@@ -42,9 +42,9 @@
                                     <div class="main_price_unde">¥价格未公开</div>
                                 </template>
                                 <template v-else>
-                                    <template v-if="(p.priceFlag==0 && p.userIdentity!=3) || p.userIdentity==2 || (p.userIdentity==3 && p.shopId==GLOBAL_SHOP_ID)">
+                                    <template v-if="(p.priceFlag==0 && p.userIdentity!=3) || p.userIdentity==2 || p.userIdentity==3">
                                         <div class="price_text_tag">
-                                            <p class="couponTag">优惠券</p>
+                                            <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                             <p class="listTag" v-if="p.actStatus==1">
                                                 {{p.promotions.name}}
                                                 <span v-if="p.priceFlag != 1 && PromotionsFormat(p.promotions)">:¥{{p.price | NumFormat}}</span>
@@ -56,14 +56,14 @@
                                     </template>
                                     <template v-else-if="p.priceFlag==2 && p.userIdentity==4">
                                         <div class="price_text_tag">
-                                            <p class="couponTag">优惠券</p>
+                                            <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                             <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
                                         </div>
                                         <div class="main_price_unde">¥会员可见</div>
                                     </template>
                                     <template v-else>
                                         <div class="price_text_tag">
-                                            <p class="couponTag">优惠券</p>
+                                            <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                             <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
                                         </div>
                                         <div class="price_grade"><span class="bold">¥</span><i :class="'icon mIcon i'+p.priceGrade"></i></div>
@@ -72,7 +72,7 @@
                             </template>
                             <template v-else>
                                 <div class="price_text_tag ">
-                                    <p class="couponTag">优惠券</p>
+                                    <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                     <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
                                 </div>
                                 <div class="price_grade "><span class="bold">¥</span><i :class="'icon mIcon i'+p.priceGrade"></i></div>

+ 27 - 17
src/main/resources/templates/shopping/cart.html

@@ -78,7 +78,7 @@
                                 </div>
                             </div>
                         </div>
-                        <div class="couponTag">领券</div>
+                        <div class="couponTag" v-if="supplier.couponsLogo" @click="showPopup(supplier)">领券</div>
                     </div>
                 </div>
                 <div class="cartItem clear"  v-for="cart in supplier.cartList" >
@@ -202,39 +202,48 @@
             </div>
             <div class="right">
                 <a class="submit" href="javascript:void(0);" @click="submitCart()" onclick="_czc.push(['_trackEvent','购物车去结算','点击','去结算','','Um_Event_CartConfirmOrder'])">去结算</a>
-                <div  :class="reducedPrice>0?'item priceTotal':'item'">
-                    <p class="priceTotal-t">合计:<em>¥{{totalPrice | NumFormat}}</em></p>
-                    <p class="priceTotal-b" v-if="reducedPrice>0"><em>共减¥{{reducedPrice | NumFormat}}</em></p>
+                <div  :class="isDiscount ?'item priceTotal':'item'">
+                    <p class="priceTotal-t">合计:<em>¥{{ totalPrice | NumFormat }}</em></p>
+                    <p class="priceTotal-b" v-if="isDiscount"><em>共减¥{{ totalDiscountAmount | NumFormat }}</em></p>
                 </div>
             </div>
         </div>
     </div>
     <!--优惠券弹窗-->
-    <div class="coupon-popup" v-show="isShowPopup">
+    <div class="coupon-popup" v-show="isShowPopup" :class="isShowPopup ? 'show' : 'hide'">
         <div class="coupon-popup-model-content">
             <div class="title"><p>优惠券</p><i class="icon mIcon" @click="hidePopup"></i></div>
             <div class="coupon-popup-main">
                 <div class="coupon-popup-tabs">
-                    <div class="popup-tabs-cell" :class="currentTab == 0 ? 'active' : ''" @click="queryCouponTabs(0)"><span>未领取</span></div>
-                    <div class="popup-tabs-cell" :class="currentTab == 1 ? 'active' : ''" @click="queryCouponTabs(1)"><span>已领取</span></div>
+                    <div class="popup-tabs-cell" :class="currentTab == 1 ? 'active' : ''" @click="queryCouponTabs(1)"><span>未领取</span></div>
+                    <div class="popup-tabs-cell" :class="currentTab == 2 ? 'active' : ''" @click="queryCouponTabs(2)"><span>已领取</span></div>
                 </div>
                 <div class="coupon-popup-content">
-                    <div class="coupon-popup-scroll">
-                        <div class="coupon-list-cell" v-for="(coupon, index) in dataList" :key="index" :class="currentTab == 1 ? 'none' : ''">
+                    <div class="empty" v-if="isCouponEmpty">
+                        <img src="/img/account/icon-coupon-empty@2x.png">
+                        <div class="msg"><p>暂无可领的优惠券</p></div>
+                    </div>
+                    <div class="coupon-popup-scroll" v-else>
+                        <div class="coupon-list-cell" v-for="(coupon, index) in productCouponList" :key="index" :class="currentTab == 2 ? 'none' : ''">
                             <div class="coupon-list-le">
                                 <div class="coupon-list-money">
-                                    <p>¥<span class="maxMoney">{{ coupon.maxMoney }}</span><span class="minMoney">满{{ coupon.minMoney }}可用</span></p>
+                                    <p>¥<span class="maxMoney">{{ coupon.couponAmount }}</span><span class="minMoney">满{{ coupon.touchPrice }}可用</span></p>
                                 </div>
                                 <div class="coupon-list-name">
-                                    <p v-if="coupon.useType == 1">{{ coupon.useType | TypeFormatText }}</p>
-                                    <p v-if="coupon.useType == 2">{{ coupon.useType | TypeFormatText }}</p>
-                                    <p v-if="coupon.useType == 3">{{ coupon.useType | TypeFormatText }}{{ coupon.couponText }}的商品</p>
+                                    <p v-if="coupon.couponType == 0">
+                                        {{ coupon.productType && coupon.productType == 1 ? '全商城商品通用' : '仅可购买指定商品'  }}
+                                    </p>
+                                    <p v-if="coupon.couponType == 1">
+                                        {{ coupon.categoryType == 1 ? '仅限购买产品类商品' : '仅限购买仪器类商品' }}
+                                    </p>
+                                    <p v-if="coupon.couponType == 3">仅限购买店铺【{{ coupon.shopName }}】的商品</p>
+                                    <p v-if="coupon.couponType == 4 || coupon.couponType == 2">全商城商品通用</p>
                                 </div>
-                                <div class="coupon-list-time">{{ coupon.couponTime }}</div>
+                                <div class="coupon-list-time">{{ coupon.endDate }}</div>
                             </div>
-                            <div class="coupon-list-ri" :class="currentTab == 1 ? 'none' : ''">
-                                <span v-if="currentTab == 0" @click="receiveCoupon(coupon)">领取</span>
-                                <span v-if="currentTab == 1">已领取</span>
+                            <div class="coupon-list-ri" :class="currentTab == 2 ? 'none' : ''">
+                                <span v-if="currentTab == 1" @click="receiveCoupon(coupon)">领取</span>
+                                <span v-if="currentTab == 2">已领取</span>
                             </div>
                             <div class="coupon-tags">{{ coupon.couponType | TypeFormat }}</div>
                         </div>
@@ -248,6 +257,7 @@
 <!-- 引入底部 -->
 <template th:replace="components/footer"></template>
 <template th:replace="components/foot-link"></template>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/product.service.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/shopping.service.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/shopping/cart.js(v=${version})}"></script>
 </body>

+ 14 - 9
src/main/resources/templates/shopping/confirm.html

@@ -287,23 +287,28 @@
                 <span class="text">剩余:<span class="red">¥{{balance.surplusMoney | NumFormat}}</span></span>
             </label>
         </div>
-        <h2 class="title">
+        <h2 class="title" v-if="isCouponShow">
             优惠券
             <a href="/user/coupon-exchange.html">兑换优惠券</a>
         </h2>
-        <div class="couponWrap">
-            <div class="coupon-list-cell" v-for="(coupon, index) in dataList" :key="index"  @click="checkedCoupon(coupon,index)">
+        <div class="couponWrap" v-if="isCouponShow">
+            <div class="coupon-list-cell" v-for="(coupon, index) in couponList" :key="index">
                 <div class="coupon-list-le">
                     <div class="coupon-list-money">
-                        <p>¥<span class="maxMoney">{{ coupon.maxMoney }}</span><span class="minMoney">满{{ coupon.minMoney }}可用</span></p>
+                        <p>¥<span class="maxMoney">{{ coupon.couponAmount }}</span><span class="minMoney">满{{ coupon.touchPrice }}可用</span></p>
                     </div>
                     <div class="coupon-list-name">
-                        <p v-if="coupon.useType == 1">{{ coupon.useType | TypeFormatText }}</p>
-                        <p v-if="coupon.useType == 2">{{ coupon.useType | TypeFormatText }}</p>
-                        <p v-if="coupon.useType == 3">{{ coupon.useType | TypeFormatText }}{{ coupon.couponText }}的商品</p>
+                        <p v-if="coupon.couponType == 0">
+                            {{ coupon.productType && coupon.productType == 1 ? '全商城商品通用' : '仅可购买指定商品'  }}
+                        </p>
+                        <p v-if="coupon.couponType == 1">
+                            {{ coupon.categoryType == 1 ? '仅限购买产品类商品' : '仅限购买仪器类商品' }}
+                        </p>
+                        <p v-if="coupon.couponType == 3">仅限购买店铺【{{ coupon.shopName }}】的商品</p>
+                        <p v-if="coupon.couponType == 4 || coupon.couponType == 2">全商城商品通用</p>
                     </div>
-                    <div class="coupon-list-time">{{ coupon.couponTime }}</div>
-                    <input class="coupon-list-checked" v-model="coupon.ischecked" name="useBalance" type="checkbox">
+                    <div class="coupon-list-time">{{ coupon.endDate }}</div>
+                    <input class="coupon-list-checked" v-model="coupon.ischecked" name="useBalance" type="checkbox" @click="checkedCoupon(coupon,index)">
                 </div>
                 <div class="coupon-list-ri"><span>已领取</span></div>
                 <div class="coupon-tags">{{ coupon.couponType | TypeFormat }}</div>

+ 8 - 8
src/main/resources/templates/supplier/index.html

@@ -72,7 +72,7 @@
                                         <template v-else>
                                             <template v-if="(p.priceFlag==0 && p.userIdentity!=3) || p.userIdentity==2 || (p.userIdentity==3 && p.shopId==GLOBAL_SHOP_ID)">
                                                 <div class="price_text_tag">
-                                                    <p class="couponTag">优惠券</p>
+                                                    <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                                     <p class="listTag" v-if="p.actStatus==1">
                                                         {{p.promotions.name}}
                                                         <span v-if="p.priceFlag != 1 && PromotionsFormat(p.promotions)">:¥{{p.price | NumFormat}}</span>
@@ -84,14 +84,14 @@
                                             </template>
                                             <template v-else-if="p.priceFlag==2 && p.userIdentity==4">
                                                 <div class="price_text_tag">
-                                                    <p class="couponTag">优惠券</p>
+                                                    <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                                     <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
                                                 </div>
                                                 <div class="main_price_unde">¥会员可见</div>
                                             </template>
                                             <template v-else>
                                                 <div class="price_text_tag">
-                                                    <p class="couponTag">优惠券</p>
+                                                    <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                                     <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
                                                 </div>
                                                 <div class="price_grade"><span class="bold">¥</span><i :class="'icon mIcon i'+p.priceGrade"></i></div>
@@ -100,7 +100,7 @@
                                     </template>
                                     <template v-else>
                                         <div class="price_text_tag ">
-                                            <p class="couponTag">优惠券</p>
+                                            <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                             <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
                                         </div>
                                         <div class="price_grade "><span class="bold">¥</span><i :class="'icon mIcon i'+p.priceGrade"></i></div>
@@ -131,7 +131,7 @@
                                         <template v-else>
                                             <template v-if="(p.priceFlag==0 && p.userIdentity!=3) || p.userIdentity==2 || (p.userIdentity==3 && p.shopId==GLOBAL_SHOP_ID)">
                                                 <div class="price_text_tag">
-                                                    <p class="couponTag">优惠券</p>
+                                                    <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                                     <p class="listTag" v-if="p.actStatus==1">
                                                         {{p.promotions.name}}
                                                         <span v-if="p.priceFlag != 1 && PromotionsFormat(p.promotions)">:¥{{p.price | NumFormat}}</span>
@@ -143,14 +143,14 @@
                                             </template>
                                             <template v-else-if="p.priceFlag==2 && p.userIdentity==4">
                                                 <div class="price_text_tag">
-                                                    <p class="couponTag">优惠券</p>
+                                                    <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                                     <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
                                                 </div>
                                                 <div class="main_price_unde">¥会员可见</div>
                                             </template>
                                             <template v-else>
                                                 <div class="price_text_tag">
-                                                    <p class="couponTag">优惠券</p>
+                                                    <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                                     <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
                                                 </div>
                                                 <div class="price_grade"><span class="bold">¥</span><i :class="'icon mIcon i'+p.priceGrade"></i></div>
@@ -159,7 +159,7 @@
                                     </template>
                                     <template v-else>
                                         <div class="price_text_tag ">
-                                            <p class="couponTag">优惠券</p>
+                                            <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
                                             <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
                                         </div>
                                         <div class="price_grade "><span class="bold">¥</span><i :class="'icon mIcon i'+p.priceGrade"></i></div>

+ 14 - 9
src/main/resources/templates/user-center/account/coupon-collection.html

@@ -24,22 +24,27 @@
           <img src="/img/base/loading.gif">
         </div>
         <div class="coupon-container clear" v-else>
-          <div class="coupon-content-list clear" v-if="!beansList.length > 0">
-            <div class="coupon-list-cell" v-for="(coupon, index) in dataList" :key="index">
+          <div class="coupon-content-list clear" v-if="coupinList.length > 0">
+            <div class="coupon-list-cell" v-for="(coupon, index) in coupinList" :key="index">
               <div class="coupon-list-le">
                 <div class="coupon-list-money">
-                  <p>¥<span class="maxMoney">{{ coupon.maxMoney }}</span><span class="minMoney">满{{ coupon.minMoney }}可用</span></p>
+                  <p>¥<span class="maxMoney">{{ coupon.couponAmount }}</span><span class="minMoney">满{{ coupon.touchPrice }}可用</span></p>
                 </div>
                 <div class="coupon-list-name">
-                  <p v-if="coupon.useType == 1">{{ coupon.useType | TypeFormatText }}</p>
-                  <p v-if="coupon.useType == 2">{{ coupon.useType | TypeFormatText }}</p>
-                  <p v-if="coupon.useType == 3">{{ coupon.useType | TypeFormatText }}{{ coupon.couponText }}的商品</p>
+                  <p v-if="coupon.couponType == 0">
+                    {{ coupon.productType && coupon.productType == 1 ? '全商城商品通用' : '仅可购买指定商品'  }}
+                  </p>
+                  <p v-if="coupon.couponType == 1">
+                    {{ coupon.categoryType == 1 ? '仅限购买产品类商品' : '仅限购买仪器类商品' }}
+                  </p>
+                  <p v-if="coupon.couponType == 3">仅限购买店铺【{{ coupon.shopName }}】的商品</p>
+                  <p v-if="coupon.couponType == 4 || coupon.couponType == 2">全商城商品通用</p>
                 </div>
-                <div class="coupon-list-time">{{ coupon.couponTime }}</div>
+                <div class="coupon-list-time">{{ coupon.endDate }}</div>
               </div>
               <div class="coupon-list-ri" :class="coupon.couponBtnType == 1 ? 'none' : ''">
                 <span v-if="coupon.couponBtnType == 0" @click="receiveCoupon(coupon)">领取</span>
-                <span v-if="coupon.couponBtnType == 1">去使用</span>
+                <span v-if="coupon.couponBtnType == 1" @click="toUseCoupon(coupon)">去使用</span>
               </div>
               <div class="coupon-tags">{{ coupon.couponType | TypeFormat }}</div>
             </div>
@@ -70,7 +75,7 @@
 <!-- 引入底部 -->
 <template th:replace="components/footer"></template>
 <template th:replace="components/foot-link"></template>
-<script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/user.service.js(v=${version})}"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/product.service.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/user-center/account/coupon-collection.js(v=${version})}"></script>
 </body>
 </html>

+ 30 - 2
src/main/resources/templates/user-center/account/coupon-exchange.html

@@ -26,7 +26,7 @@
         <div class="coupon-container clear">
           <div class="coupon-content">
               <div class="coupon-input">
-                <input class="input" type="text"  v-model="params.couponCode" placeholder="请输入16位兑换码">
+                <input class="input" type="text"  v-model="params.redemptionCode" placeholder="请输入16位兑换码">
                 <a href="javascript:void(0);" class="coupon-btn" @click="exchangeConfirm">立即兑换</a>
               </div>
               <div class="coupon-text">
@@ -40,12 +40,40 @@
       </div>
     </div>
   </div>
+  <!-- 采美豆弹窗 -->
+  <div class="cmcoupon-alert-box" v-if="isCouponModel" :class="isCouponModel ? 'show' : 'hide'">
+      <div class="cmcoupon-alert-content">
+        <div class="cmcoupon-main">
+          <div class="coupon-list">
+            <div class="list-cell-tags">{{ coupon.couponType | TypeFormat }}</text></div>
+            <div class="list-cell-le">
+              <div class="coupon-maxMoney">
+                <span class="small">¥</span>
+                <span> {{ coupon.couponAmount }}</span>
+              </div>
+              <div class="coupon-minMoney"><span class="txt">满{{ coupon.touchPrice }}可用</span></div>
+            </div>
+            <div class="list-cell-ri">
+              <div class="list-cell-top">
+                <p v-if="coupon.couponType == 0">{{ coupon.productType && coupon.productType == 1 ? '全商城商品通用' : '仅可购买指定商品'  }}</p>
+                <p v-if="coupon.couponType == 1">{{ coupon.categoryType == 1 ? '仅限购买产品类商品' : '仅限购买仪器类商品' }}</p>
+                <p v-if="coupon.couponType == 3">仅限购买店铺【{{ coupon.shopName }}】的商品</p>
+                <p v-if="coupon.couponType == 4 || coupon.couponType == 2">全商城商品通用</p>
+              </div>
+              <div class="list-cell-time">有效期:{{ coupon.endDate }}</div>
+            </div>
+          </div>
+          <div class="coupon-btn" @click.stop="handleClickCancel">立即收下</div>
+        </div>
+        <i class="icon mIcon" @click.stop="handleClickCancel"></i>
+      </div>
+  </div>
 </div>
 <!-- 引入底部 -->
 <template th:replace="components/footer"></template>
 <template th:replace="components/foot-link"></template>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/center.js(v=${version})}"></script>
-<script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/user.service.js(v=${version})}"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/product.service.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/user-center/account/coupon-exchange.js(v=${version})}"></script>
 </body>
 </html>

+ 18 - 13
src/main/resources/templates/user-center/account/coupon.html

@@ -48,26 +48,31 @@
             </div>
           </div>
           <!--数据为空-->
-          <div class="coupon-content-list clear" v-if="beansList.length > 0">
-              <div class="coupon-list-cell" v-for="(coupon, index) in dataList" :key="index" :class="listClass">
+          <div class="coupon-content-list clear" v-if="coupinList.length > 0">
+              <div class="coupon-list-cell" v-for="(coupon, index) in coupinList" :key="index" :class="coupon.useStatus == 2 || coupon.useStatus == 3 ? 'none' : 'used'">
                 <div class="coupon-list-le">
-                  <div class="coupon-list-money" :class="listClass">
-                    <p>¥<span class="maxMoney">{{ coupon.maxMoney }}</span><span class="minMoney">满{{ coupon.minMoney }}可用</span></p>
+                  <div class="coupon-list-money" :class="coupon.useStatus == 2 || coupon.useStatus == 3 ? 'none' : 'used'">
+                    <p>¥<span class="maxMoney">{{ coupon.couponAmount }}</span><span class="minMoney">满{{ coupon.touchPrice }}可用</span></p>
                   </div>
-                  <div class="coupon-list-name" :class="listClass">
-                    <p v-if="coupon.useType == 1">{{ coupon.useType | TypeFormatText }}</p>
-                    <p v-if="coupon.useType == 2">{{ coupon.useType | TypeFormatText }}</p>
-                    <p v-if="coupon.useType == 3">{{ coupon.useType | TypeFormatText }}{{ coupon.couponText }}的商品</p>
+                  <div class="coupon-list-name" :class="coupon.useStatus == 2 || coupon.useStatus == 3 ? 'none' : 'used'">
+                    <p v-if="coupon.couponType == 0">
+                      {{ coupon.productType && coupon.productType == 1 ? '全商城商品通用' : '仅可购买指定商品'  }}
+                    </p>
+                    <p v-if="coupon.couponType == 1">
+                      {{ coupon.categoryType == 1 ? '仅限购买产品类商品' : '仅限购买仪器类商品' }}
+                    </p>
+                    <p v-if="coupon.couponType == 3">仅限购买店铺【{{ coupon.shopName }}】的商品</p>
+                    <p v-if="coupon.couponType == 4 || coupon.couponType == 2">全商城商品通用</p>
                   </div>
-                  <div class="coupon-list-time" :class="listClass">{{ coupon.couponTime }}</div>
+                  <div class="coupon-list-time" :class="coupon.useStatus == 2 || coupon.useStatus == 3 ? 'none' : 'used'">{{ coupon.endDate }}</div>
                 </div>
-                <div class="coupon-list-ri" :class="listClass" @click="toUseCoupon(coupon)">{{ coupon.status | TypeBtnFormat }}</div>
-                <div class="coupon-tags" :class="listClass">{{ coupon.couponType | TypeFormat }}</div>
+                <div class="coupon-list-ri" :class="coupon.useStatus == 2 || coupon.useStatus == 3 ? 'none' : 'used'" @click="toUseCoupon(coupon)">{{ coupon.useStatus | TypeBtnFormat }}</div>
+                <div class="coupon-tags" :class="coupon.useStatus == 2 || coupon.useStatus == 3 ? 'none' : 'used'">{{ coupon.couponType | TypeFormat }}</div>
               </div>
           </div>
           <div v-else class="empty">
             <img src="/img/account/icon-coupon-empty@2x.png">
-            <div class="msg"><p>暂无数据</p></div>
+            <div class="msg"><p>暂无优惠券数据~</p></div>
           </div>
         </div>
         <!--分页-->
@@ -93,7 +98,7 @@
 <template th:replace="components/footer"></template>
 <template th:replace="components/foot-link"></template>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/center.js(v=${version})}"></script>
-<script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/user.service.js(v=${version})}"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/product.service.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/user-center/account/coupon.js(v=${version})}"></script>
 </body>
 </html>

+ 1 - 1
src/main/resources/templates/user-center/dashboard.html

@@ -71,7 +71,7 @@
                                 </a>
                                 <a href="/user/coupon.html" class="account-cell">
                                     <span>优惠券:</span>
-                                    <span class="red">{{ userInfo.userBeans }}</span>
+                                    <span class="red">{{ couponNum }}</span>
                                 </a>
                             </div>
                         </div>