Ver Fonte

代码优化

喻文俊 há 3 anos atrás
pai
commit
88dd88e20d

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

@@ -4,14 +4,14 @@ spring:
   #数据源连接--start
   datasource:
     #本地连接数据库
-    driverClassName: com.mysql.jdbc.Driver
-    url: jdbc:mysql://192.168.2.100:3306/caimei?characterEncoding=UTF8&serverTimezone=Asia/Shanghai
-    username: developer
-    password: 05bZ/OxTB:X+yd%1
-    #测试连接数据库
-    #url: jdbc:mysql://120.79.25.27:3306/caimei?characterEncoding=UTF8&serverTimezone=Asia/Shanghai
+    #driverClassName: com.mysql.jdbc.Driver
+    #url: jdbc:mysql://192.168.2.100:3306/caimei?characterEncoding=UTF8&serverTimezone=Asia/Shanghai
     #username: developer
-    #password: J5p3tgOVazNl4ydf
+    #password: 05bZ/OxTB:X+yd%1
+    #测试连接数据库
+    url: jdbc:mysql://120.79.25.27:3306/caimei?characterEncoding=UTF8&serverTimezone=Asia/Shanghai
+    username: developer
+    password: J5p3tgOVazNl4ydf
     #type: com.zaxxer.hikari.HikariDataSource
     hikari:
       minimum-idle: 5
@@ -54,10 +54,10 @@ logging:
 # 服务域名
 caimei:
   siteEnv: 0 #网站环境,(2:正式环境,1:测试环境,0:开发环境)
-  #spiServer: https://spi-b.caimei365.com
-  spiServer: http://192.168.2.68:8008
-  #coreServer: https://core-b.caimei365.com
-  coreServer: http://192.168.2.68:18002
+  spiServer: https://spi-b.caimei365.com
+  #spiServer: http://192.168.2.68:8008
+  coreServer: https://core-b.caimei365.com
+  #coreServer: http://192.168.2.68:18002
   imageDomain: https://img-b.caimei365.com
   wwwDomain: http:localhost:8009
   destPath: D:/_PLAN_WORKSPACE/test/static

+ 3 - 2
src/main/resources/static/css/user-center/member/member-page.css

@@ -49,9 +49,10 @@
 .coupon-list>div .condition{font-size:12px;font-weight:400;color:#55331D}
 .coupon-list>div .receive-btn{width:48px;height:100%;position:absolute;right:0;top:0;z-index:9;font-size:14px;font-weight:400;color:#55331D;-webkit-writing-mode:vertical-lr;-ms-writing-mode:tb-lr;writing-mode:vertical-lr;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;cursor:pointer}
 /*商品列表*/
-.goods-list{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}
+.goods-list{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:flex-start;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}
 .goods-list .goods a:hover{color:unset}
-.goods-list .goods{width:173px}
+.goods-list .goods{width:173px;margin-right: 14px;}
+.goods-list .goods:last-child{margin-right: 0;}
 
 .goods-list .goods img{display:block;width:184px;height:184px;-webkit-box-sizing:border-box;box-sizing:border-box;border: 1px dashed #f1f1f1;}
 .goods-list .goods .goods-price,

+ 1 - 2
src/main/resources/static/js/pay/caimei-pay.js

@@ -179,9 +179,8 @@ var payContainer = new Vue({
                 var params = {
                     bankCode: this.payInfo.payBankNum,
                     returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_self.payAmount,
-                    userId: GLOBAL_USER_ID,
                     userType: _self.payInfo.payUserType,
-                    vipId: _self.vipId
+                    vipRecordId: _self.vipRecordId,
                 };
                 _self.PayVipPcMallPay(params);
             }

+ 6 - 6
src/main/resources/static/js/pay/caimei-paycash.js

@@ -52,6 +52,7 @@ var payContainer = new Vue({
         productID:'',//发布商品的ID
         is_Wechat_bowcr:false,
         comboInfo: null, //选中的svip套餐信息
+        vipRecordId: undefined,
     },
     filters: {
         NumFormat:function(value) {
@@ -433,9 +434,8 @@ var payContainer = new Vue({
                 if(_self.pageType == 2){
                     params = {
                         unpaidAmount:_self.payAmount,
-                        vipId:_self.comboInfo.id,
+                        vipRecordId: _self.vipRecordId,
                         payType:_self.payInfo.payType,
-                        userId: GLOBAL_USER_ID
                     }
                 }else{
                     params = {
@@ -550,9 +550,8 @@ var payContainer = new Vue({
             var params = {
                 bankCode: this.payInfo.payBankNum,
                 returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_self.payAmount,
-                userId: GLOBAL_USER_ID,
                 userType: _self.payInfo.payUserType,
-                vipId: _self.comboInfo.id
+                vipRecordId: _self.vipRecordId
             };
             PayApi.PayVipPcMallPay(params, function (response) {
                 if (response.code == 0) {
@@ -573,9 +572,8 @@ var payContainer = new Vue({
             var params = {
                 bankCode: _self.payInfo.payBankNum,
                 returnUrl: 'https://www.caimei365.com/',
-                userId: GLOBAL_USER_ID,
                 userType: _self.payInfo.payUserType,
-                vipId: _self.comboInfo.id
+                vipRecordId: _self.vipRecordId
             };
             console.log(params);
             PayApi.PayVipAliPay(params, function(response){
@@ -606,6 +604,7 @@ var payContainer = new Vue({
             this.payInfo.payData = {//二手
                 type: this.payInfo.payBankNum,
                 vipId: this.comboInfo.id,
+                vipRecordId: this.vipRecordId,
                 amount: this.payAmount,
                 duration: this.comboInfo.duration,
             };
@@ -618,6 +617,7 @@ var payContainer = new Vue({
         var _self = this;
         // 判断当前支付是订单支付
         _self.pageType = CAIMEI.getUrlParam('pageType');
+        _self.vipRecordId = parseInt(CAIMEI.getUrlParam('vipRecordId'));
         if (_self.pageType === '1') {//二手
             _self.productID = CAIMEI.getUrlParam('productID');
             _self.payAmount = _self.toFixedFn(100);

+ 4 - 1
src/main/resources/static/js/pay/caimei-paymobile.js

@@ -29,6 +29,7 @@ var payContainer = new Vue({
         productID:'',//商品ID
         duration: 0, // 购买的会员期限
         vipId: null, // vip套餐id
+        vipRecordId: undefined
     },
     filters: {
         NumFormat:function(value) {
@@ -119,10 +120,11 @@ var payContainer = new Vue({
                 };
             } else if (_self.pageType === '2') { // 微信支付会员
                 console.log('微信支付会员');
-                orderInfo = {//二手微信二维码参数
+                orderInfo = {
                     pageType: 2,
                     payAmount: _self.payAmount,
                     vipId: _self.vipId,
+                    vipRecordId: _self.vipRecordId
                 };
             } else {
                 orderInfo = {//普通订单微信二维码参数
@@ -215,6 +217,7 @@ var payContainer = new Vue({
             _self.payAmount = _self.payableAmount = payData.amount;
             _self.payInfo.payMobileUrl = payData.url;
             _self.vipId = payData.vipId;
+            _self.vipRecordId = payData.vipRecordId;
             _self.duration = payData.duration;
         }else{
             console.log('订单支付');

+ 4 - 1
src/main/resources/static/js/pay/caimei-wechatpay.js

@@ -11,7 +11,8 @@ var payContainer = new Vue({
         state:0,//随机数
         isRequest:false,
         productId:'',//二手商品ID
-        vipId: null // vip套餐id
+        vipId: null, // vip套餐id
+        vipRecordId: undefined
     },
     computed: {
 
@@ -28,6 +29,7 @@ var payContainer = new Vue({
                 _this.productId = _this.state.productId;
             }else if(_this.pageType == 2){
                 _this.vipId = _this.state.vipId;
+                _this.vipRecordId = _this.state.vipRecordId;
             }else{
                 _this.orderID = _this.state.orderID;
             }
@@ -48,6 +50,7 @@ var payContainer = new Vue({
                 code: _this.wechatcode,
                 state: _this.rand(1000, 9999),
                 vipId: _this.vipId,
+                vipRecordId: _this.vipRecordId,
                 returnUrl: 'https://www.caimei365.com/',
             };
             PayApi.PayVipMiniWxPay(params,function(response){

+ 4 - 4
src/main/resources/static/js/user-center/member/memberPage.js

@@ -118,11 +118,11 @@ var memberPage = new Vue({
             var currentCombo = this.comboInfo[this.currentIndex];
             var _self = this;
             UserApi.RegisterSuperPay({userId: GLOBAL_USER_ID, packageId: currentCombo.id}, function (response) {
-                if (response === 0) {
+                if (response.code === 0) {
                     console.log(response);
                     //本地保存一下选中的会员套餐信息
                     window.localStorage.setItem('comboInfo', JSON.stringify(currentCombo));
-                    window.open('/pay/caimei-paycash.html?pageType=2');
+                    window.open('/pay/caimei-paycash.html?pageType=2&vipRecordId=' + response.data);
                     _self.showRenewPopup = false;
                     _self.showMask = false;
                     // this.showConfirmPopup = true;
@@ -275,8 +275,8 @@ var memberPage = new Vue({
             var priceFlag = parseInt(product.priceFlag);  //商品可见度 0公开价格 1不公开价格 2仅对会员机构公开
             var userIdentity = parseInt(product.userIdentity);  //用户身份 0、个人  1、协销 2、资质机构 3、供应商 4,个人机构
             var shopID = parseInt(product.shopID); // 所属供应商id
-            var originalPrice = parseInt(product.originalPrice).toFixed(2);  //商品原价
-            var price = parseInt(product.price).toFixed(2); // 商品价格
+            var originalPrice = parseFloat(product.originalPrice).toFixed(2);  //商品原价
+            var price = parseFloat(product.price).toFixed(2); // 商品价格
             var priceGrade = parseInt(product.priceGrade); // 价格等级
 
             // 二手商品价格标识 2 :价格详聊

+ 10 - 9
src/main/resources/static/js/user-center/member/memberProduct.js

@@ -35,11 +35,6 @@ var memberProduct = new Vue({
     mounted: function () {
         this.productList = [];
         this.getSvipProductList();
-        this.$nextTick(function () {
-            setTimeout(function () {
-                $("img[data-original]").lazyload();
-            });
-        });
     },
     methods: {
         // 是否显示vip标签价格
@@ -57,6 +52,9 @@ var memberProduct = new Vue({
                 _self.totalPage = resultData.svipProductPage.totalPage;
                 _self.hasNextPage = resultData.svipProductPage.hasNextPage;
                 _self.bannerImage = resultData.adsImage;
+                setTimeout(function () {
+                    $("img[data-original]").lazyload();
+                });
                 if (isPC){
                     _self.productList = resultData.svipProductPage.results;
                 }else {
@@ -70,8 +68,8 @@ var memberProduct = new Vue({
             var priceFlag = parseInt(product.priceFlag);  //商品可见度 0公开价格 1不公开价格 2仅对会员机构公开
             var userIdentity = parseInt(product.userIdentity);  //用户身份 0、个人  1、协销 2、资质机构 3、供应商 4,个人机构
             var shopID = parseInt(product.shopID); // 所属供应商id
-            var originalPrice = parseInt(product.originalPrice).toFixed(2);  //商品原价
-            var price = parseInt(product.price).toFixed(2); // 商品价格
+            var originalPrice = parseFloat(product.originalPrice).toFixed(2);  //商品原价
+            var price = parseFloat(product.price).toFixed(2); // 商品价格
             var priceGrade = parseInt(product.priceGrade); // 价格等级
 
             // 二手商品价格标识 2 :价格详聊
@@ -115,11 +113,14 @@ var memberProduct = new Vue({
                 return this.jumpPageSize = '';
             }
             this.listQuery.pageNum = parseInt(pageNum);
-            // this.getList(); //获取列表
+            this.getSvipProductList(); //获取列表
         },
         //h5查看更多
         showMore() {
-            this.getSvipProductList()
+            if(this.hasNextPage){
+                this.listQuery.pageNum ++;
+                this.getSvipProductList();
+            }
         }
     }
 });