liumiaomiao 3 år sedan
förälder
incheckning
acd213fa49
84 ändrade filer med 4801 tillägg och 267 borttagningar
  1. 2 1
      config_formal/subscribepay_172.17.4.183/baseApi.json
  2. 3 1
      config_formal/subscribepay_172.17.4.183/bidfile.json
  3. 4 2
      config_formal/subscribepay_172.17.4.183/coupon.json
  4. 3 2
      config_formal/subscribepay_172.17.4.183/pay_config.json
  5. 12 0
      config_formal/subscribepay_172.17.4.183/resourcePack.json
  6. 2 2
      config_formal/subscribepay_172.17.4.183/time.txt
  7. 2 1
      config_formal/subscribepay_2_172.17.145.180/baseApi.json
  8. 3 1
      config_formal/subscribepay_2_172.17.145.180/bidfile.json
  9. 4 1
      config_formal/subscribepay_2_172.17.145.180/coupon.json
  10. 3 1
      config_formal/subscribepay_2_172.17.145.180/pay_config.json
  11. 12 0
      config_formal/subscribepay_2_172.17.145.180/resourcePack.json
  12. 2 2
      config_formal/subscribepay_2_172.17.145.180/time.txt
  13. 1 0
      src/jfw/front/commonPayWx.go
  14. 27 0
      src/jfw/front/wxMyOrder.go
  15. 1 0
      src/jfw/modules/app/src/app/front/commonPay.go
  16. 5 0
      src/jfw/modules/app/src/app/front/myorder.go
  17. 14 4
      src/jfw/modules/app/src/web/staticres/jyapp/me/js/mine.js
  18. 123 0
      src/jfw/modules/app/src/web/templates/commonPay/filePack/createorder.html
  19. 113 0
      src/jfw/modules/app/src/web/templates/commonPay/filePack/orderDetail.html
  20. 44 3
      src/jfw/modules/app/src/web/templates/commonPay/paySuccess.html
  21. 163 0
      src/jfw/modules/app/src/web/templates/frontRouter/fileRecord/sess/index.html
  22. 14 1
      src/jfw/modules/app/src/web/templates/me/mine.html
  23. 92 27
      src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html
  24. 1 1
      src/jfw/modules/bigmember/src/service/analysis/esquery.go
  25. 6 4
      src/jfw/modules/bigmember/src/service/use/use.go
  26. 2 1
      src/jfw/modules/common/src/qfw/util/jy/bigVipPower.go
  27. 20 0
      src/jfw/modules/common/src/qfw/util/jy/jy.go
  28. 2 0
      src/jfw/modules/subscribepay/src/a/init.go
  29. 2 1
      src/jfw/modules/subscribepay/src/baseApi.json
  30. 3 1
      src/jfw/modules/subscribepay/src/bidfile.json
  31. 17 7
      src/jfw/modules/subscribepay/src/config/config.go
  32. 4 1
      src/jfw/modules/subscribepay/src/coupon.json
  33. 270 0
      src/jfw/modules/subscribepay/src/entity/basePack.go
  34. 278 0
      src/jfw/modules/subscribepay/src/entity/commonApi.go
  35. 5 4
      src/jfw/modules/subscribepay/src/entity/dataExportPackApi.go
  36. 1 1
      src/jfw/modules/subscribepay/src/entity/member.go
  37. 182 0
      src/jfw/modules/subscribepay/src/entity/resourcePackStruct.go
  38. 48 0
      src/jfw/modules/subscribepay/src/entity/subscribeVip.go
  39. 7 0
      src/jfw/modules/subscribepay/src/pay/aliPay.go
  40. 11 1
      src/jfw/modules/subscribepay/src/pay/util.go
  41. 11 3
      src/jfw/modules/subscribepay/src/pay/wxPay.go
  42. 3 1
      src/jfw/modules/subscribepay/src/pay_config.json
  43. 11 0
      src/jfw/modules/subscribepay/src/resourcePack.json
  44. 88 0
      src/jfw/modules/subscribepay/src/service/basePack.go
  45. 13 0
      src/jfw/modules/subscribepay/src/service/payCallback.go
  46. 180 0
      src/jfw/modules/subscribepay/src/service/resourcePack.go
  47. 4 0
      src/jfw/modules/subscribepay/src/timetask/timetask.go
  48. 3 2
      src/jfw/modules/subscribepay/src/util/coupon.go
  49. 1 1
      src/jfw/modules/subscribepay/src/util/jylog.go
  50. 1 1
      src/jfw/modules/subscribepay/src/util/msgremind.go
  51. 37 0
      src/jfw/modules/subscribepay/src/util/rpc.go
  52. 9 4
      src/web/staticres/common-module/coupon/js/coupon-template.js
  53. 9 0
      src/web/staticres/common-module/coupon/js/pay-order-template.js
  54. BIN
      src/web/staticres/common-module/file-pack/images/icon-down-gray.png
  55. BIN
      src/web/staticres/common-module/file-pack/images/icon-down.png
  56. BIN
      src/web/staticres/common-module/file-pack/images/icon-rar.png
  57. BIN
      src/web/staticres/common-module/file-pack/images/icon-word.png
  58. 746 0
      src/web/staticres/common-module/file-pack/js/buy.js
  59. 319 0
      src/web/staticres/common-module/file-pack/js/index-wx.js
  60. 299 0
      src/web/staticres/common-module/file-pack/js/index.js
  61. BIN
      src/web/staticres/common-module/order-list/image/file.png
  62. 48 69
      src/web/staticres/common-module/order-list/js/order-detail.js
  63. 30 0
      src/web/staticres/common-module/order-list/js/order-list-config.js
  64. 51 0
      src/web/staticres/common-module/order-list/js/order-list.js
  65. 5 2
      src/web/staticres/common-module/portraitRecord/css/index.css
  66. BIN
      src/web/staticres/common-module/vipsubscribe/image/info/cut_04.jpg
  67. 3 0
      src/web/staticres/css/pc.css
  68. 83 21
      src/web/staticres/frontRouter/pc/seeBuyerHistory/js/index-pc.js
  69. 30 3
      src/web/staticres/js/login.js
  70. 10 1
      src/web/staticres/me/js/mine.js
  71. BIN
      src/web/staticres/order/image/file.png
  72. 4 4
      src/web/templates/common/pchead.html
  73. 261 0
      src/web/templates/frontRouter/pc/fileHistory/sess/index.html
  74. 191 0
      src/web/templates/frontRouter/wx/fileRecord/sess/index.html
  75. 324 0
      src/web/templates/order/pc/filePack/detail.html
  76. 39 0
      src/web/templates/order/pc/paySuccess.html
  77. 59 43
      src/web/templates/pc/biddetail_rec.html
  78. 19 1
      src/web/templates/pc/myOrder.html
  79. 1 1
      src/web/templates/pc/subscribe_new.html
  80. 123 0
      src/web/templates/weixin/commonPay/filePack/createorder.html
  81. 117 0
      src/web/templates/weixin/commonPay/filePack/orderDetail.html
  82. 43 3
      src/web/templates/weixin/commonPay/paySuccess.html
  83. 13 0
      src/web/templates/weixin/my.html
  84. 105 36
      src/web/templates/weixin/wxinfocontent_rec.html

+ 2 - 1
config_formal/subscribepay_172.17.4.183/baseApi.json

@@ -6,6 +6,7 @@
     "findPreview": "http://10.170.187.34:891/resources/findPreview",
     "findBalance": "http://10.170.187.34:891/resources/findBalance",
     "findRecord": "http://10.170.187.34:891/resources/findRecord",
-    "entdedupUrl": "http://10.170.187.34:891/data/deduplication"
+    "entdedupUrl": "http://10.170.187.34:891/data/deduplication",
+    "updateVipTime":"http://10.170.187.34:891/resources/updateVipTime"
   }
 }

+ 3 - 1
config_formal/subscribepay_172.17.4.183/bidfile.json

@@ -1,3 +1,5 @@
 {
-	"price":1500
+	"price":1500,
+	"file_number":10,
+	"attachmentRPC":"172.17.145.178:10082"
 }

+ 4 - 2
config_formal/subscribepay_172.17.4.183/coupon.json

@@ -17,8 +17,10 @@
                 "senior_5000":"1124",
                 "normal_1000":"1125",
                 "normal_3000":"1126",
-                "normal_5000":"1127"
-
+                "normal_5000":"1127",
+		"附件下载包-5个":"1141",
+                "附件下载包-10个":"1142",
+                "附件下载包-20个":"1143"
 	},
       "giveinfo":"http://172.17.4.182:880/giveInfo"
 }

+ 3 - 2
config_formal/subscribepay_172.17.4.183/pay_config.json

@@ -20,8 +20,8 @@
 			"bidfile_msg":"剑鱼标讯-招标文件解读",
 			"integral_msg":"剑鱼标讯-剑鱼币",
 			"dataPack_msg": "剑鱼标讯-数据包",
-			"areaPack_msg":"剑鱼标讯-省份订阅包"
-
+			"areaPack_msg":"剑鱼标讯-省份订阅包",
+			"filePack_msg":"剑鱼标讯-附件下载包"
 		}
 	},
     "aliPay": {
@@ -39,6 +39,7 @@
 	"Subject_integral":"剑鱼标讯-剑鱼币",
         "Subject_dataPack": "剑鱼标讯-数据包",
 	"Subject_areaPack":"剑鱼标讯-省份订阅包",
+	"Subject_filePack":"剑鱼标讯-附件下载包",
         "privateKey": "-----BEGIN RSA PRIVATE KEY-----\nMIIEogIBAAKCAQEAtO7CU4hpdcMmV43MEA8bqQJYYx+f6yvYkP0nFc/oCvU24bU6zAdK/H2H56quEwD8Dh5YtVTfUCcKqpcG9HXY11TXWKCEUQiK1tkb0o7oSSURwk6h1DdDbg8m1+H8s+k+mvMvcqVCYKYi03PIPQyJCuHmzx/vcaALXRr2HOrEFaFFA8WYST1rywiKeyrC9PCNX1aJjGADhCs3cGrdZEJc4k+2tIHTYJccx+mJ96QiEkzFhJTqEmSFPcNqNUX9uCPgeVhfHW2pRNyffvrhoEyeSr1QoOpaYyn0I5JD2axnypBFCbk6P69LY3eGNKtOe81lp9hiZbMYpXPqb6KwPXTVQQIDAQABAoIBAEbJQm276MaR2uZWK4f84S12JW5iaQZw2QGgiTIXbQkcdqRHawF3uPafhhQ0ynXU5MgBR2NqGRQasimbfLUXhgZ4wueBpUKuvOLhfekaz/YN8qy6ZsXH+TGN6/x6BYu9rSiiC+YmkZmOZgGkQqrfxJ3lU4+lRuCFZOzAJ5mYn652CHRJXy6eDgZfyFLP2ol4/ioJEhwnGFXV345DlsVgmXTEe+IfjTyuvzxBtjod4lfu3dj/f2PhPrcgvN0ZQf1ldZbS+6FkMWInMOQt/WsJ/ANfiKgQ4sPzlxIhmVjrvDlnYTc1lbFekyInzZumV0pDyId+1Y6LAjxJTAhnjFAlBSECgYEAwsQdxOiZNLtxZ8J8JCQHKERYIo7euArW0iAurF+3Q9VNeGj0voFrmfHPju5OF5BHtuc7D3lkwZG4Ac+pyQtxF5dsEMl4vBoNc6onRQFsSDVEEIpl7OBghGlg1as23tvPSMh7DKnILM9OzVfFQ9WLvwHJwLRGsM7LOtmNovq4UFsCgYEA7dE/9Avr5YtCUjij8Y2zkAxN6qb8+ggqFoPiCr91JNGaKNKV9D2K7D3Zk49TXFJm7SX2zgYFuqR2Pa9vAWh9jtmwsc8L0qpIym4J1MM5ud/Xiu9c8O/prQOr7JlICNdk8WfqGbUC83BYfWa5SDonlXFYi6x3LlXdZnvEfZF645MCgYAC2ZnR6tFrGx8StJ7abIiKR02+27ZYnRf9pSjprtDgtjtW+royG3S2oPo3jjcoUx0piQKtPEqEJpy5sg86+ObjwHx9VmVk40C1I5VFhjrOZ7EiSNQq/jGLXntjRQkdg7vpxb0/NzDNrw7pJFKnpnVQCzenkTvDlJMWvl47N04BJwKBgHnpVtuIcPlPFkSH/KMLfQ1PAXJVAEI8hTbdjLbtxuOE/34F1hFKqzjHzA2034roQxM27vpWZAF15Zdho4oZQqREPCwqc2kfGgmLt0Z2fdUnRptWcVKh6ixjQXMccKz3niuSlZNwE38wDGzciAbaqQgW/sk7NC1wnvq2X9fvCAw5AoGANG2usqWYF4x+LvbhcdrKpJsjtvkLa2u9g2/wNXdoj+tBrv310O22/YM5LOcq9MrKPlx1S1C1KLoQO9TWFZiYuQ9C/sk7/ZTNmKQxCxVV0FVPaBYp+meD6sjgoRVJvaqY0UxnJwlHWMrusPTFua7Mtogqx9cvzlQolWh5VX7N1DM=\n-----END RSA PRIVATE KEY-----",
         "callbackPublicKey":"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqFZfev75+sa7O0f29qwuWeqWRQ+p59c8hz2s4aeh5Ohc08P1ls5e8UmPhaN9ZTkGwabOKN658pOhmVoa16ldKFZQ5j1hLTDS6yfKcvVs/hf1mQvsbUjtZgCfMQx5NNf1R4MsTvAqbl2l6DXMu7gHjAhKNR0QQBELv7HmYuWPE35ELQqBH0eVcvWSNV3/3zOansftY5NIT749B+Bv1uirE8PNMp20sWWqx8fMNi2EZksnWNUmnVldBqUwMJIxcXolBH/RGX5ZjBlBenoIB3PVQ8/+SPz9Hip7+QNH8utSnUlrh2AsJVtdNKIQk74Eevkn+Q+WyUVGoY0ca9DzGwh4hQIDAQAB"
     }

+ 12 - 0
config_formal/subscribepay_172.17.4.183/resourcePack.json

@@ -0,0 +1,12 @@
+{
+	"product":{
+		"dataExportPack":"数据流量包",
+		"attachmentDownPack":"附件下载包"
+	},
+	"attachmentDownPackPrice":{
+		"5":1590,
+		"10":2990,
+		"20":4990
+	}
+}
+

+ 2 - 2
config_formal/subscribepay_172.17.4.183/time.txt

@@ -1,2 +1,2 @@
-#上次修改时间,比当前修改时间小就行
-2021-12-30 16:15:12
+#上次修改时间,比当前修改时间小就行
+2022-01-12 00:00:00

+ 2 - 1
config_formal/subscribepay_2_172.17.145.180/baseApi.json

@@ -6,6 +6,7 @@
     "findPreview": "http://10.170.187.34:891/resources/findPreview",
     "findBalance": "http://10.170.187.34:891/resources/findBalance",
     "findRecord": "http://10.170.187.34:891/resources/findRecord",
-    "entdedupUrl": "http://10.170.187.34:891/data/deduplication"
+    "entdedupUrl": "http://10.170.187.34:891/data/deduplication",
+    "updateVipTime":"http://10.170.187.34:891/resources/updateVipTime"
   }
 }

+ 3 - 1
config_formal/subscribepay_2_172.17.145.180/bidfile.json

@@ -1,3 +1,5 @@
 {
-	"price":1500
+	"price":1500,
+	"file_number":10,
+	"attachmentRPC":"172.17.145.178:10082"
 }

+ 4 - 1
config_formal/subscribepay_2_172.17.145.180/coupon.json

@@ -17,7 +17,10 @@
                 "senior_5000":"1124",
                 "normal_1000":"1125",
                 "normal_3000":"1126",
-                "normal_5000":"1127"
+                "normal_5000":"1127",
+		"附件下载包-5个":"1141",
+                "附件下载包-10个":"1142",
+                "附件下载包-20个":"1143"
 	},
       "giveinfo":"http://172.17.4.182:880/giveInfo"
 }

+ 3 - 1
config_formal/subscribepay_2_172.17.145.180/pay_config.json

@@ -20,7 +20,8 @@
 			"bidfile_msg":"剑鱼标讯-招标文件解读",
 			"integral_msg":"剑鱼标讯-剑鱼币",
 			"dataPack_msg": "剑鱼标讯-数据包",
-			"areaPack_msg":"剑鱼标讯-省份订阅包"
+			"areaPack_msg":"剑鱼标讯-省份订阅包",
+			"filePack_msg":"剑鱼标讯-附件下载包"
 
 		}
 	},
@@ -39,6 +40,7 @@
 	"Subject_integral":"剑鱼标讯-剑鱼币",
 	"Subject_dataPack": "剑鱼标讯-数据包",
 	"Subject_areaPack":"剑鱼标讯-省份订阅包",
+	"Subject_filePack":"剑鱼标讯-附件下载包",
         "privateKey": "-----BEGIN RSA PRIVATE KEY-----\nMIIEogIBAAKCAQEAtO7CU4hpdcMmV43MEA8bqQJYYx+f6yvYkP0nFc/oCvU24bU6zAdK/H2H56quEwD8Dh5YtVTfUCcKqpcG9HXY11TXWKCEUQiK1tkb0o7oSSURwk6h1DdDbg8m1+H8s+k+mvMvcqVCYKYi03PIPQyJCuHmzx/vcaALXRr2HOrEFaFFA8WYST1rywiKeyrC9PCNX1aJjGADhCs3cGrdZEJc4k+2tIHTYJccx+mJ96QiEkzFhJTqEmSFPcNqNUX9uCPgeVhfHW2pRNyffvrhoEyeSr1QoOpaYyn0I5JD2axnypBFCbk6P69LY3eGNKtOe81lp9hiZbMYpXPqb6KwPXTVQQIDAQABAoIBAEbJQm276MaR2uZWK4f84S12JW5iaQZw2QGgiTIXbQkcdqRHawF3uPafhhQ0ynXU5MgBR2NqGRQasimbfLUXhgZ4wueBpUKuvOLhfekaz/YN8qy6ZsXH+TGN6/x6BYu9rSiiC+YmkZmOZgGkQqrfxJ3lU4+lRuCFZOzAJ5mYn652CHRJXy6eDgZfyFLP2ol4/ioJEhwnGFXV345DlsVgmXTEe+IfjTyuvzxBtjod4lfu3dj/f2PhPrcgvN0ZQf1ldZbS+6FkMWInMOQt/WsJ/ANfiKgQ4sPzlxIhmVjrvDlnYTc1lbFekyInzZumV0pDyId+1Y6LAjxJTAhnjFAlBSECgYEAwsQdxOiZNLtxZ8J8JCQHKERYIo7euArW0iAurF+3Q9VNeGj0voFrmfHPju5OF5BHtuc7D3lkwZG4Ac+pyQtxF5dsEMl4vBoNc6onRQFsSDVEEIpl7OBghGlg1as23tvPSMh7DKnILM9OzVfFQ9WLvwHJwLRGsM7LOtmNovq4UFsCgYEA7dE/9Avr5YtCUjij8Y2zkAxN6qb8+ggqFoPiCr91JNGaKNKV9D2K7D3Zk49TXFJm7SX2zgYFuqR2Pa9vAWh9jtmwsc8L0qpIym4J1MM5ud/Xiu9c8O/prQOr7JlICNdk8WfqGbUC83BYfWa5SDonlXFYi6x3LlXdZnvEfZF645MCgYAC2ZnR6tFrGx8StJ7abIiKR02+27ZYnRf9pSjprtDgtjtW+royG3S2oPo3jjcoUx0piQKtPEqEJpy5sg86+ObjwHx9VmVk40C1I5VFhjrOZ7EiSNQq/jGLXntjRQkdg7vpxb0/NzDNrw7pJFKnpnVQCzenkTvDlJMWvl47N04BJwKBgHnpVtuIcPlPFkSH/KMLfQ1PAXJVAEI8hTbdjLbtxuOE/34F1hFKqzjHzA2034roQxM27vpWZAF15Zdho4oZQqREPCwqc2kfGgmLt0Z2fdUnRptWcVKh6ixjQXMccKz3niuSlZNwE38wDGzciAbaqQgW/sk7NC1wnvq2X9fvCAw5AoGANG2usqWYF4x+LvbhcdrKpJsjtvkLa2u9g2/wNXdoj+tBrv310O22/YM5LOcq9MrKPlx1S1C1KLoQO9TWFZiYuQ9C/sk7/ZTNmKQxCxVV0FVPaBYp+meD6sjgoRVJvaqY0UxnJwlHWMrusPTFua7Mtogqx9cvzlQolWh5VX7N1DM=\n-----END RSA PRIVATE KEY-----",
         "callbackPublicKey":"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqFZfev75+sa7O0f29qwuWeqWRQ+p59c8hz2s4aeh5Ohc08P1ls5e8UmPhaN9ZTkGwabOKN658pOhmVoa16ldKFZQ5j1hLTDS6yfKcvVs/hf1mQvsbUjtZgCfMQx5NNf1R4MsTvAqbl2l6DXMu7gHjAhKNR0QQBELv7HmYuWPE35ELQqBH0eVcvWSNV3/3zOansftY5NIT749B+Bv1uirE8PNMp20sWWqx8fMNi2EZksnWNUmnVldBqUwMJIxcXolBH/RGX5ZjBlBenoIB3PVQ8/+SPz9Hip7+QNH8utSnUlrh2AsJVtdNKIQk74Eevkn+Q+WyUVGoY0ca9DzGwh4hQIDAQAB"
     }

+ 12 - 0
config_formal/subscribepay_2_172.17.145.180/resourcePack.json

@@ -0,0 +1,12 @@
+{
+	"product":{
+		"dataExportPack":"数据流量包",
+		"attachmentDownPack":"附件下载包"
+	},
+	"attachmentDownPackPrice":{
+		"5":1590,
+		"10":2990,
+		"20":4990
+	}
+}
+

+ 2 - 2
config_formal/subscribepay_2_172.17.145.180/time.txt

@@ -1,2 +1,2 @@
-#上次修改时间,比当前修改时间小就行
-2021-12-30 16:15:12
+#上次修改时间,比当前修改时间小就行
+2022-01-12 00:00:00

+ 1 - 0
src/jfw/front/commonPayWx.go

@@ -27,6 +27,7 @@ var (
 		"onlineCourse": []string{"中标必听课"},
 		"dataPack":     []string{"数据流量包"},
 		"areaPack":     []string{"省份订阅包"},
+		"filePack":     []string{"附件下载包"},
 	}
 )
 

+ 27 - 0
src/jfw/front/wxMyOrder.go

@@ -34,6 +34,11 @@ type WxMyOrder struct {
 	subAccountDetail     xweb.Mapper `xweb:"/front/wxMyOrder/subAccountDetail/(\\w+)"`     //子账号订单详情
 	bidfileDetail        xweb.Mapper `xweb:"/front/wxMyOrder/bidfileDetail/(\\w+)"`        //招标文件解读订单详情
 	integralDetail       xweb.Mapper `xweb:"/front/wxMyOrder/integralDetail/(\\w+)"`       //剑鱼币订单详情
+
+	//创建订单
+	wxFilePackCreateOrder xweb.Mapper `xweb:"/swordfish/filePack/createOrder"` //附件下载包 wx
+	pcFilePackCreateOrder xweb.Mapper `xweb:"/front/filepack/createOrder"`     //pc
+	pcfilePackDetail      xweb.Mapper `xweb:"/front/file/packDetail"`
 }
 
 func init() {
@@ -320,3 +325,25 @@ func (t *WxMyOrder) IntegralDetail(order_code string) {
 	t.T["order_code"] = order_code
 	t.Render("/weixin/commonPay/integral/integralDetail.html", &t.T)
 }
+
+//
+func (t *WxMyOrder) WxFilePackCreateOrder() {
+	t.Render("/weixin/commonPay/filePack/createorder.html")
+}
+
+//
+func (t *WxMyOrder) PcFilePackCreateOrder() {
+	t.Render("/pc/filePack/createorder.html")
+}
+
+func (t *WxMyOrder) PcfilePackDetail() {
+	myOpenid, _ := t.GetSession("s_m_openid").(string)
+	t.T["signature"] = wx.SignJSSDK(t.Site() + t.Url())
+	t.T["openid"] = se.EncodeString(myOpenid)
+	mynickname, _ := t.Session().Get("s_nickname").(string)
+	myavatar, _ := t.Session().Get("s_avatar").(string)
+	t.T["nickname"] = mynickname
+	t.T["avatar"] = myavatar
+	t.T["order_code"] = t.GetString("order_code")
+	t.Render("/order/pc/filePack/detail.html", &t.T)
+}

+ 1 - 0
src/jfw/modules/app/src/app/front/commonPay.go

@@ -23,6 +23,7 @@ var (
 		"integral":     []string{"剑鱼币充值"},
 		"dataPack":     []string{"数据流量包"},
 		"areaPack":     []string{"省份订阅包"},
+		"filePack":     []string{"附件下载包"},
 	}
 )
 

+ 5 - 0
src/jfw/modules/app/src/app/front/myorder.go

@@ -29,6 +29,7 @@ type MyOrder struct {
 	cantInvoice      xweb.Mapper `xweb:"/jyapp/front/cantInvoice"`
 	viewPdf          xweb.Mapper `xweb:"/jyapp/front/viewPdf"`
 	tointegralDetail xweb.Mapper `xweb:"/jyapp/front/myorder/tointegralDetail"`
+	createOrder      xweb.Mapper `xweb:"/jyapp/filePack/createOrder"` //数据包创建订单
 }
 
 func init() {
@@ -321,3 +322,7 @@ func (t *MyOrder) CantInvoice() {
 func (t *MyOrder) ViewPdf() {
 	t.Render("/pdfjs/viewer.html")
 }
+
+func (t *MyOrder) CreateOrder() {
+	t.Render("/commonPay/filePack/createorder.html")
+}

+ 14 - 4
src/jfw/modules/app/src/web/staticres/jyapp/me/js/mine.js

@@ -138,6 +138,10 @@ var mine = {
         $('.my-dataPackage').on('click', function (e) {
             location.href = "/jyapp/dataPack/myIndex";
         })
+        // 附件下载包
+        $('.my-filePackage').on('click', function (e) {
+            location.href = "/jyapp/frontPage/fileRecord/sess/index";
+        })
         // 我的剑鱼币
         $('.my-points').on('click', function (e) {
           location.href = "/page_points_mobile/home";
@@ -244,9 +248,11 @@ var mine = {
 	                    if(res.data.vipStatus > 0 && res.data.viper ) {
 	                        $('.ent-follow-history').show()
 	                        $('.buyer-follow-history').show()
+                            $('.my-filePackage').show()
 	                    } else {
 	                        $('.ent-follow-history').hide()
 	                        $('.buyer-follow-history').hide()
+                            $('.my-filePackage').hide()
 	                    }
                     } else {
                         // 有采购单位全景分析权限的 不显示画像记录 没有的判断是否是超级订阅新用户
@@ -272,6 +278,10 @@ var mine = {
                     }
                     if ($.isArray(res.data.power)) {
                         pageUserInfo.power = res.data.power
+                        // 大会员没有附加下载包权限用户且新版超级订阅用户
+                        if (res.data.memberStatus > 0 && res.data.vipStatus > 0 && res.data.viper && res.data.power.indexOf(3) === -1) {
+                            $('.my-filePackage').show()
+                        }
                     }
                     if (res.data.viper) {
                         $('.ent-search').show().attr('data-href', '/jyapp/vipsubscribe/entSearch')
@@ -284,7 +294,7 @@ var mine = {
     setBigVipState: function () {
         // 设置企业关注->企业情报
         var power = pageUserInfo.power || []
-        
+
         if ($.isArray(power)) {
             // 企业情报-4,12,13
             var hasEntFollowVipPower = power.indexOf(4) != -1 || power.indexOf(12) != -1 || power.indexOf(13) != -1
@@ -343,7 +353,7 @@ var mine = {
                 }
             }
         })
-        
+
     }
 }
 
@@ -382,7 +392,7 @@ function afterJyObjInit() {
                     // }
                 }
             }
-            
+
         }
         redSpotOnMenu();
     });
@@ -460,7 +470,7 @@ var vNode = {
     this.getPointsInfo()
   },
   mounted() {
-      
+
   },
   methods: {
     signHandle: function () {

+ 123 - 0
src/jfw/modules/app/src/web/templates/commonPay/filePack/createorder.html

@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+    <!--引入公共资源头部-->
+    {{include "/big-member/meta.html"}}
+    <title>附件下载包充值</title>
+    <!--S-当前页面的css资源-->
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/reset-css/5.0.1/reset.min.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/icon/local.css />
+    <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/big-member/css/j-icons.css?v={{Msg "seo" "version"}}'>
+    <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/coupon/css/pay-order-template.css?v={{Msg "seo" "version"}}' />
+    <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/area-pack/css/buy.css?v={{Msg "seo" "version"}}' />
+    <style>
+      .notes-section .notes-section-content,
+      .notes-section .notes-section-title {
+        color: inherit;
+      }
+      .notes-section {
+        padding: 0;
+        border: 0;
+        font-size: 0.24rem;
+        font-weight: 500;
+        color: #9B9CA3;
+        line-height: 0.36rem;
+      }
+      .order-phone-group {
+        border-radius: 0;
+        margin: 0;
+      }
+      .top-tip-banner {
+        width: 7.5rem;
+        height: 0.88rem;
+        line-height: 0.88rem;
+        text-align: center;
+        background: #FEE9E8;
+        font-size: 0.26rem;
+        font-weight: 500;
+        color: #FB483D;
+      }
+    </style>
+</head>
+<body>
+  <div class="j-container">
+    {{include "/big-member/header.html"}}
+    <div class="j-main" id="app" v-cloak>
+      <div class="j-container">
+        <div class="j-main">
+          <div class="top-tip-banner">使用有效期至${endTime}<span v-if="endDay > 0">(剩 ${endDay} 天)</span></div>
+          <div class="spec-list-container border-line-t" v-if="buyType !== 'upgrade'">
+            <div class="spec-title" v-show="specTitleShow">请选择规格</div>
+            <div class="spec-list">
+              <div
+                class="spec-item"
+                :class="{ active: item.cycleType == specActive }"
+                v-for="(item, index) in specList"
+                @click="clickSpec(item)"
+                :key="index">
+                <span class="preferential-tag" v-if="preferentialShow">限时x折</span>
+                <div class="spec-i-label">
+                  <span class="spec-i-l-text">${item.label}</span>
+                  <span class="spec-i-l-info" v-if="item.labelSubInfo" v-html="item.labelSubInfo"></span>
+                </div>
+                <div class="spec-i-sub">
+                  <div class="spec-i-text del" v-show="item.before">&yen; ${ item.before || 0 }</div>
+                  <div class="spec-i-text"><span>&yen;</span> <span class="price-count">${ item.price }</span></div>
+                </div>
+<!--                <div class="spec-i-desc">${ item.desc }</div>-->
+              </div>
+            </div>
+          </div>
+          <div class="order-phone-group" :class="{ error: !validatorPhonePass }">
+            <label for="order_phone">手机号码</label>
+            <input id="order_phone" v-model="userInfo.phone" autocomplete='off' placeholder='请输入手机号码' maxlength='11' type='tel' />
+            <p class="error-message">手机号码输入错误</p>
+          </div>
+          <div class="notes-to-buy">
+            <section class="notes-section">
+              <p class="notes-section-title">购买须知</p>
+              <div class="notes-section-content" v-if="buyType === 'buy' || buyType === 'renew'">
+                1.仅限超级订阅用户充值附件下载个数时使用,可多次购买。<br />
+                2.使用有效期仅限超级订阅服务周期内的当月,次月清零,不可转赠。
+              </div>
+            </section>
+          </div>
+        </div>
+        <div class="j-footer">
+          <pay-order-template ref="couponRef" :config="bottomConf" @update="updateS" @save="savePageState" @update-coupon="afterUpdateCoupon"></pay-order-template>
+        </div>
+      </div>
+      <van-popup v-model="dialog.backTip" get-container="body" class="back-tip-wrapper" :close-on-click-overlay="false">
+        <div class="b-t-title">
+          <img src="/common-module/area-pack/images/messageTitle@3x.png" alt="">
+        </div>
+        <div class="b-t-content">
+          <div class="b-t-content-item">
+            多订阅1个省份,获取商机概率<br />增加一倍,邀您体验!
+          </div>
+          <div class="b-t-content-item bg-f-orange">
+            支持用户增加订阅区域时使用,每增购1个省可获取该省的招标采购信息
+          </div>
+          <div class="b-t-content-item bg-f-orange">
+            按时间(月/季/年)、订阅省份个数计价,${perMonthArea}元省/月起。
+          </div>
+        </div>
+        <div class="b-t-footer">
+          <button class="button cancel" @click="dialog.backTip = false;history.back()">取消</button>
+          <button class="button confirm" @click="dialog.backTip = false">去购买</button>
+        </div>
+      </van-popup>
+    </div>
+  </div>
+  <!--S-当前页面的资源-->
+  <script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
+  <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
+  <script src=//cdn-common.jianyu360.com/cdn/lib/zepto/1.2.0/zepto.min.js></script>
+  {{include "/big-member/commonjs.html"}}
+  <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/coupon/js/pay-order-template.js?v={{Msg "seo" "version"}}'></script>
+  <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/file-pack/js/buy.js?v={{Msg "seo" "version"}}'></script>
+  <!--E-当前页面的资源-->
+</body>
+
+</html>

+ 113 - 0
src/jfw/modules/app/src/web/templates/commonPay/filePack/orderDetail.html

@@ -0,0 +1,113 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+
+<head>
+    <!--引入公共资源头部-->
+    {{include "/big-member/meta.html"}}
+    <title>订单详情</title>
+    <!--S-当前页面的css资源-->
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/reset-css/5.0.1/reset.min.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/icon/local.css />
+    <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/big-member/css/j-icons.css?v={{Msg "seo" "version"}}'>
+    <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/order-list/css/order-detail.css?v={{Msg "seo" "version"}}' />
+</head>
+
+<body>
+    <div class="j-container transparent-header">
+        <div class="j-header jy-app-header border-line-b transparent-header">
+            <span class="header-left">
+                <span class="van-icon van-icon-arrow-left"></span>
+            </span>
+            <span class="header-title title-left">订单详情</span>
+            <span class="header-right"></span>
+        </div>
+        <div class="j-main order-detail" id="app" v-cloak>
+            <div class="j-container">
+                <div class="j-main no-scrollbar">
+                    <div class="wrapper">
+                        <div class="header-pic arc-container" :class="orderStateMap[orderInfo.state].bgcClassName">
+                            <div class="order-state">${ orderStateMap[orderInfo.state].text }</div>
+                            <div class="surplus-time" v-if="orderStateMap[orderInfo.state].surplusTimeShow && orderInfo.surplusTime > 0">
+                                <span>剩余支付时间:</span>
+                                <van-count-down @finish="onCountdownFinish" :time="orderInfo.surplusTime"></van-count-down>
+                            </div>
+                        </div>
+                        <div class="card-list">
+                            <div class="j-card report-p">
+                                <span class="rp-left" :class="'badge-' + (orderInfoFilter.badge || '')">
+                                    <img class="card-l-pic" :src="orderInfo.headerImg">
+                                </span>
+                                <span class="rp-right">
+                                    <span class="product-type">${ orderInfo.productType }</span>
+                                    <span class="pay-money">&yen; ${ orderInfo.payMoney }</span>
+                                </span>
+                            </div>
+                            <div class="j-card product-info">
+                                <div class="j-card-title">购买信息</div>
+                                <div class="j-card-items">
+                                    <div
+                                        class="j-card-item"
+                                        :class="item.className"
+                                        v-for="(item, index) in orderInfo.productInfoList"
+                                        :key="index"
+                                        v-show="item.text"
+                                    >
+                                        <span class="card-item-l">${ item.label + item.split }</span>
+                                        <span class="card-item-r" v-html="item.text"></span>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="j-card report-info">
+                                <div class="j-card-title">订单信息</div>
+                                <div class="j-card-items">
+                                    <div
+                                        class="j-card-item"
+                                        :class="item.className"
+                                        v-for="(item, index) in orderInfo.orderInfoList"
+                                        :key="index"
+                                        v-show="item.text"
+                                    >
+                                        <span class="card-item-l">${ item.label + item.split }</span>
+                                        <span class="card-item-r" v-html="item.text"></span>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div class="j-button-group j-footer" v-show="buttonGroupShow">
+                    <button
+                        class="j-button-confirm pay"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.pay"
+                        @click="onConfirmPay">立即支付</button>
+                    <button
+                        class="j-button-cancel invoke"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke"
+                        @click="lookInvoke">${ invokeButtonText }</button>
+                    <button
+                        class="j-button-confirm buy-again"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.buyAgain"
+                        @click="buyAgain">再次购买</button>
+                </div>
+            </div>
+        </div>
+    </div>
+    <!--S-当前页面的资源-->
+    <script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
+    <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
+    <script src=//cdn-common.jianyu360.com/cdn/lib/zepto/1.2.0/zepto.min.js></script>
+    {{include "/big-member/commonjs.html"}}
+    <script>
+        var pageInfo = {
+            platform: 'app',
+            version: {{Msg "seo" "version"}},
+        }
+    </script>
+    <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/order-list/js/order-list-config.js?v={{Msg "seo" "version"}}'></script>
+    <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/order-list/js/order-detail.js?v={{Msg "seo" "version"}}'></script>
+    <!--E-当前页面的资源-->
+    {{include "/common/baiducc.html"}}
+</body>
+
+</html>

+ 44 - 3
src/jfw/modules/app/src/web/templates/commonPay/paySuccess.html

@@ -17,6 +17,17 @@
     <link rel="stylesheet" type="text/css" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/layout.css"/>
     <link rel="stylesheet" type="text/css"
           href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/css/font.css?v={{Msg "seo" "version"}}"/>
+    <style>
+        .info-box .info-item span.light-text {
+            color: #2ABED1;
+        }
+        .info-box .info-item {
+            font-size: 0.26rem;
+            font-weight: 500;
+            color: #9B9CA3;
+            line-height: 0.36rem;
+        }
+    </style>
 </head>
 <body>
 <div class="app-layout-header jy-app-header">
@@ -35,7 +46,9 @@
                 </p>
             </div>
             <div class="info-box">
-                <div class="info-item"></div>
+            <div class="info-item" name="附件下载包" style="display: none">
+                <span>附件下载:<span class="light-text" name="file-num"></span></span>&nbsp;&nbsp;|&nbsp;&nbsp;<span>有效期至:<span class="light-text" name="file-time"></span></span>
+            </div>
             </div>
             <div class="info_box">
                 <div class="pay_mode">
@@ -95,7 +108,7 @@
                     继续浏览
                 </button>
             </div>
-        {{else if or (eq .T.doType "dataPack") (eq .T.doType "areaPack")}}
+        {{else if or (eq .T.doType "dataPack") (eq .T.doType "areaPack") (eq .T.doType "filePack")}}
             <div class="bottom_button j-button-group">
                 <button id ="order" class="j-button-confirm" onclick="window.location.href = '/jyapp/common/{{.T.doType}}/orderDetail?order_code={{.T.orderCode}}'">
                     查看订单
@@ -111,6 +124,34 @@
 <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/big-member/js/utils.js?v={{Msg "seo" "version"}}"></script>
 <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/common.js?v={{Msg "seo" "mod_version"}}"></script>
 <script>
+    $.ajax({
+        type: 'POST',
+        url: '/subscribepay/orderListDetails/getOrderPayAllMsg',
+        data: {
+            orderCode: {{.T.orderCode}}
+        },
+        success: function (res) {
+            if (res && res.errMsg === '' && res.data) {
+                console.log(res.data)
+                try {
+                    switch (res.data.order.product_type) {
+                        case '附件下载包': {
+                            var tempNode = $('.info-box .info-item[name="附件下载包"]')
+                            var tempInfo = JSON.parse(res.data.order.filter)
+                            tempNode.find('span[name="file-num"]').text('+' + tempInfo.num)
+                            tempNode.find('span[name="file-time"]').text(tempInfo.validTime.replace(/-/g, '/'))
+                            tempNode.show()
+                            document.title = '附件下载包充值'
+                            $('.header-title').text(document.title)
+                            break
+                        }
+                    }
+                } catch (e) {
+                    console.warn(e)
+                }
+            }
+        }
+    })
     $(function () {
         try {
             JyObj.hiddenBottom("0");
@@ -212,7 +253,7 @@
         if (orderFilter.give_cycle) {
             var giveCycle = orderFilter.give_cycle;
             var giveType = orderFilter.give_type; //时间类型:1/天、2/月
-            
+
             if (giveCycle) {
                 if (giveType==1) {
                     give = giveCycle+"天";

+ 163 - 0
src/jfw/modules/app/src/web/templates/frontRouter/fileRecord/sess/index.html

@@ -0,0 +1,163 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+    <!--引入公共资源头部-->
+    {{include "/big-member/meta.html"}}
+    <title>附件下载包</title>
+    <!--S-当前页面的css资源-->
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/reset-css/5.0.1/reset.min.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/icon/local.css />
+    <link rel="stylesheet" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/portraitRecord/css/index.css?v={{Msg "seo" "version"}}' />
+    <style>
+      .pro-log .on{
+        color: #2ABED1!important;
+      }
+      .file-list-item {
+          display: flex;
+          flex-direction: row;
+          align-items: flex-start;
+          padding: 0.32rem;
+          box-sizing: border-box;
+          margin-bottom: 0.16rem;
+          background: #FFFFFF;
+      }
+      .file-list-item .file-icon {
+          flex-shrink: 0;
+          width: 0.48rem;
+          height: 0.48rem;
+          margin-right: 0.16rem;
+          display: none;
+      }
+      .file-info-group {
+          width: 100%;
+          display: flex;
+          flex-direction: column;
+      }
+      .file-list-item .file-title {
+          font-size: 0.3rem;
+          font-weight: 500;
+          color: #171826;
+          line-height: 0.44rem;
+          margin-bottom: 0.16rem;
+          word-break: break-all;
+      }
+      .file-list-item a {
+          width: 6.22rem;
+          text-decoration: underline;
+          overflow: hidden;
+          white-space: nowrap;
+          text-overflow: ellipsis;
+          font-size: 0.26rem;
+          font-weight: 500;
+          color: #2ABED1;
+          line-height: 0.4rem;
+          margin-bottom: 0.24rem;
+      }
+      .file-list-item .file-info img {
+          width: 0.32rem;
+          height: 0.32rem;
+      }
+      .file-list-item .file-info {
+          display: flex;
+          flex-direction: row;
+          justify-content: space-between;
+          align-items: center;
+          font-size: 0.22rem;
+          font-weight: 500;
+          color: #9B9CA3;
+          line-height: 0.4rem;
+      }
+      [v-cloak] {
+          opacity: 0;
+          transition: all 0.2s;
+      }
+    </style>
+</head>
+<body>
+  <div class="j-container">
+    {{include "/big-member/header.html"}}
+    <div class="j-main portraited" id="proRecord" v-cloak>
+      <div class="j-container">
+        <div class="j-main">
+          <div class="t-bg flex" style="min-height:3.28rem;">
+            <div class="nums">
+              <span v-if="points.total>=0">{points.total}</span>个
+              <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/portraitRecord/image/help-p.png?v={{Msg "seo" "version"}}' @click="helpTiped" alt="">
+            </div>
+            <div class="btns flex">
+              <span>当月附件下载余额</span>
+              <van-button round type="primary"  @click="setBook">立即充值</van-button>
+            </div>
+          </div>
+          <div class="p1-date">
+            <div class="d-box flex">
+              使用记录
+              <van-field v-model="dValue" @click="usedHised" placeholder="选择年月" right-icon="play" readonly/>
+            </div>
+            <div class="word-tips">
+              当前已使用:<span>{points.usage}个</span>
+            </div>
+          </div>
+          <!-- 日期弹出框 -->
+          <van-popup v-model:show="pShow" round position="bottom">
+            <van-datetime-picker
+              class="record-time-d"
+              v-model="curDate"
+              type="year-month"
+              title="选择日期"
+              :formatter="formatter11"
+              :min-date="minDate"
+              :max-date="maxTime"
+              @confirm="confirmed"
+              @cancel="canceled"
+            />
+          </van-popup>
+          <div class="c-list">
+            <van-list
+              v-model="listInfo.loading"
+              :finished="listInfo.finished"
+              finished-text=""
+              @load="onLoad"
+            >
+                <div  class="file-list-item" v-for="(item, i) in list" :key="i">
+                    <div class="file-icon">
+                        <img v-if="item.icon === 'doc'"  src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/file-pack/images/icon-word.png?v={{Msg "seo" "version"}}" :alt="item.icon">
+                        <img v-else  src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/file-pack/images/icon-rar.png?v={{Msg "seo" "version"}}" :alt="item.icon">
+                    </div>
+                    <div class="file-info-group">
+                        <div class="file-title">{item.s_fileName}</div>
+                        <a :href="item.articleUrl">来源:{item.s_title}</a>
+                        <div class="file-info">
+                            <span>于{item.l_date}下载</span>
+                            <img @click="downFile(item)" src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/file-pack/images/icon-down.png?v={{Msg "seo" "version"}}" alt="down">
+                        </div>
+                    </div>
+               </div>
+            </van-list>
+          </div>
+<!--          <van-loading size="24px" vertical v-if="working">加载中...</van-loading>-->
+          <div class="emptycom" v-if="list.length==0 && empty">
+            <div class="emptyimg">
+              <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/image/img-empty.png?v={{Msg "seo" "version"}}' alt="">
+            </div>
+            <div class="emptytext">
+                暂无附件下载记录
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+  <!--S-当前页面的资源-->
+  <script src='https://cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js'></script>
+  <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
+  <script src=//cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js></script>
+  <!--E-当前页面的资源-->
+  {{include "/big-member/commonjs.html"}}
+  <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/public/js/china-map-data.js?v={{Msg "seo" "version"}}'></script>
+  <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/file-pack/js/index.js?v={{Msg "seo" "version"}}'></script>
+  {{include "/common/baiducc.html"}}
+</body>
+
+</html>

+ 14 - 1
src/jfw/modules/app/src/web/templates/me/mine.html

@@ -25,7 +25,10 @@
             background-image: url("{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/data-pack/images/export.png");
         }
         .icon-data-pack {
-            background-image: url("{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/data-pack/images/data.png");
+            background-image: url("/common-module/data-pack/images/data.png");
+        }
+        .icon-file-pack {
+            background-image: url("/common-module/file-pack/images/icon-down-gray.png");
         }
     </style>
 </head>
@@ -222,6 +225,16 @@
                             <span class="label">我的数据流量包</span>
                         </div>
                         <div class="menu_list_right">
+                            <div></div>
+                            <span class="j-icon base-icon icon-arrow-right"></span>
+                        </div>
+                    </div>
+                    <div class="menu_list my-filePackage" data-need-bind-phone style="display: none">
+                        <div class="menu_list_left"  style="flex: unset;margin-right: 0.16rem;">
+                            <span class="j-icon base-icon icon-file-pack"></span>
+                            <span class="label">我的附件下载包</span>
+                        </div>
+                        <div class="menu_list_right" style="flex: 1;justify-content: space-between;">
                             <div class="preferential-tag">New</div>
                             <span class="j-icon base-icon icon-arrow-right"></span>
                         </div>

+ 92 - 27
src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html

@@ -72,6 +72,15 @@
         font-size: .22rem;
         line-height: normal;
       }
+      .go-buy-file-pack {
+          display: none;
+          padding: 0.06rem .16rem;
+          background:  #2ABDD1;
+          border-radius: 8px;
+          color:#fff;
+          font-size: .22rem;
+          line-height: normal;
+      }
       .icon-help{
         display: none;
         width: .32rem;
@@ -141,7 +150,7 @@
         border-collapse: collapse!important;
         border-spacing: 0px !important;
       }
-      #h_content table tr td,.h_content table th{ 
+      #h_content table tr td,.h_content table th{
         border: 1px solid #EBEBEB;
         text-align: center;
       }
@@ -699,9 +708,10 @@
                         <div class="join">
                             附件下载
                             <span class="free-down-text">免费用户享有1次附件下载权益</span>
-                            <span class="file-count-tip">本月剩余:<em class="file-count"></em></span>
+                            <span class="file-count-tip">本月剩余:<em class="file-count"></em></span>
                             <span class="icon-help"></span>
                             <span class="concat-kf">联系客服</span>
+							<span class="go-buy-file-pack" style="display: none">立即充值</span>
                             <span class="free-open-tip" style="display: none;">
                               <span class="down-more-text">下载更多附件</span>
                               <span class="open-vip-btn">开通超级订阅</span>
@@ -1134,7 +1144,7 @@
                 //非大会员或大会员无此功能 且是新超级订阅用户
                 if (res.data && res.data.vipStatus > 0 && res.data.viper&&!window.isMemberAndPower) {
                   $('.file-count-tip').css('display', 'inline-block')
-                  $('.concat-kf').css('display', 'inline-block')
+                  $('.go-buy-file-pack').css('display', 'inline-block')
                   $('.icon-help').css('display', 'inline-block')
                   $('.file-count').html(res.data.fileNum)
                 }
@@ -1244,6 +1254,57 @@
         })
     })
 
+
+    function downFileOfVIP (fileName, callback) {
+        // 有下载次数
+        $.ajax({
+            type: 'post',
+            url: '/jypay/resourcePack/consumePack',
+            data: {
+                productName: '附件下载包',
+                platform: 'APP',
+                fileName: fileName,
+                id: id,
+                title: title
+            },
+            success: function (r) {
+                if (r&&r.r&&r.r.code&&r.r.code<0&&window.vipStatus>0){
+                    // 次数用完提醒联系客服
+                    vant.Dialog.confirm({
+                        message: '您本月附件下载机会已消耗完毕,如需下载更多附件,请前往充值。',
+                        showCancelButton: true,
+                        confirmButtonText: '立即充值',
+                        confirmButtonColor: '#2ABDD1',
+                        className: 'custom-dialog',
+                        width: 303
+
+                    }).then(() => {
+                        location.href = '/jyapp/filePack/createOrder'
+                    })
+                        .catch(() => {})
+                    return
+                }else if (r && r.m === '' && r.r) {
+                    var url = r.r.downUrl
+                    if (url){
+                        if (!r.r.isExists){
+                            window.fileNum = window.fileNum - 1;
+                            $('.file-count').html($('.file-count').text()-1)
+                        }
+                        if(mySysIsIos()){
+                            typeof callback === 'function' ? callback(url) : null
+                        } else {
+                            location.href = url
+                        }
+                    } else {
+                        EasyAlert.show('获取附件地址失败');
+                    }
+                } else {
+                    EasyAlert.show(r.m || '获取附件地址失败');
+                }
+            }
+        })
+    }
+
     // 附件下载展示
     function andownload() {
         $.ajax({
@@ -1296,6 +1357,8 @@
                           return
                         }else if(window.freeFile>0){
                           window.freeFile=-1
+                          //
+                          gotoFilePage($(this).find('a').text())
                         }
                       } else {
                         // 付费用户
@@ -1312,25 +1375,19 @@
                         if (window.vipStatus > 0) {
                           // 是新超级订阅用户
                           if (window.viper) {
-                            // 有下载次数
-                            if (window.fileNum <= 0) {
-                              // 次数用完提醒联系客服
-                              vant.Dialog.confirm({
-                                message: '您本月查看机会已经消耗完毕,如需要更多服务,请前往联系客服。',
-                                showCancelButton: true,
-                                confirmButtonText: '联系客服',
-                                confirmButtonColor: '#2ABDD1',
-                                className: 'custom-dialog',
-                                width: 303
-
-                              }).then(() => {
-                                location.href = '/jyapp/free/customer'
-                              })
-                              .catch(() => {})
-                              return
-                            }else{
-                              window.fileNum = window.fileNum - 1;
+                            var fileName = $(this).find('a').text()
+                            // IOS APP端特殊流程处理,先提示填写邮箱后扣次数
+                            if(mySysIsIos()) {
+                              return iosShow(url, fileName)
                             }
+                            downFileOfVIP(fileName)
+                            return
+                            //if (window.fileNum <= 0) {
+                            //}else{
+                              //window.fileNum = window.fileNum - 1;
+                              //gotoFilePageOfVip($(this).find('a').text())
+                              //return
+                            //}
                           } else {
                             // 老超级订阅用户 提醒升级
                             vant.Dialog.confirm({
@@ -1360,8 +1417,6 @@
                           return
                         }
                       }
-                      //
-                      gotoFilePage($(this).find('a').text())
                     })
                     $('.atta-list').show()
                 }else{
@@ -1379,7 +1434,7 @@
             }
         });
     }
-    //浏览附件
+
     function gotoFilePage(name){
       $.ajax({
             type:'post',
@@ -1408,7 +1463,7 @@
     }
     andownload()
     //如果是ios显示附件下载弹框
-    function iosShow(url){
+    function iosShow(url, fileName){
         var iptemail = ''
         var goemail = {{.T.email}}
         var downemail = sessionStorage.getItem('downemail')
@@ -1441,7 +1496,13 @@
 
                     //按下确定按钮执行的操作
                     //todo ....
-                    sendAlert(url,getinputemail)
+                    if (fileName) {
+                        downFileOfVIP(fileName, function (url) {
+                            sendAlert(url,getinputemail)
+                        })
+                    } else {
+                        sendAlert(url,getinputemail)
+                    }
                 }
 
                 if(button == 'cancel') {
@@ -2483,7 +2544,7 @@
       // 下载帮助
       $('.icon-help').click(function(){
         vant.Dialog.alert({
-          message: '点击附件即为下载,系统会扣除当月附件下载次数;每月下载次数有限,次月清零,请合理使用。',
+          message: '点击附件即为下载,系统会扣除当月附件下载个数;每月1号上月余额清零重新计算,请合理使用。',
           className: 'custom-dialog',
           confirmButtonText: '我知道了',
           confirmButtonColor: '#2ABDD1',
@@ -2494,6 +2555,10 @@
       $('.concat-kf').click(function(){
         location.href = '/jyapp/free/customer'
       })
+      // 购买附件下载包
+      $('.go-buy-file-pack').click(function(){
+       location.href = '/jyapp/filePack/createOrder'
+      })
     })
 </script>
 {{include "/common/baiducc.html"}}

+ 1 - 1
src/jfw/modules/bigmember/src/service/analysis/esquery.go

@@ -224,7 +224,7 @@ func DecQuery(area map[string]interface{}, buyerClass []string, business_scope [
 		}
 	}
 	qstr := fmt.Sprintf(query, strings.Join(shoulds, ","), strings.Join(musts, ","), strings.Join(bools, ","), boolsNum, entity.PSearch_DecField, entity.PSearch_DecSort, entity.PSearch_DecSimCount, query_aggs)
-	log.Println("str:", qstr)
+	// log.Println("str:", qstr)
 	return qstr
 }
 

+ 6 - 4
src/jfw/modules/bigmember/src/service/use/use.go

@@ -631,10 +631,12 @@ func (u *Use) IsAdd() {
 		var notBigFileBool = bigPower.Status <= 0 || !bigPower.PowerMap[3]
 		//超级订阅非大会员用户附件下载本月可用次数
 		uk := qu.If(notBigFileBool && bigPower.VipStatus > 0 && bigPower.Vip_BuySet.Upgrade == 1, "v", "f").(string)
-		// log.Println(uk, "-----", config.Config.FileUploadNum[uk])
-		d["fileNum"] = config.Config.FileUploadNum[uk] - redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.VipFileUploadNumKey, userid, fmt.Sprint(time.Now().Month())))
-		//新用户->新订阅设置页面||老用户无关键词
-		if config.Config.NewFreeUser < bigPower.Registedate || !hasKey {
+		//附件下载包的剩余次数
+		filePackKey := fmt.Sprintf(jy.FilePackNumKey, userid, fmt.Sprint(time.Now().Month()))
+		filePackNum := redis.GetInt(jy.PowerCacheDb, filePackKey)
+		d["fileNum"] = config.Config.FileUploadNum[uk] - redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.VipFileUploadNumKey, userid, fmt.Sprint(time.Now().Month()))) + filePackNum
+		//新用户->新订阅设置页面
+		if config.Config.NewFreeUser < bigPower.Registedate|| !hasKey  {
 			d["isUpgrade"] = true
 		}
 		uid := userid

+ 2 - 1
src/jfw/modules/common/src/qfw/util/jy/bigVipPower.go

@@ -49,7 +49,8 @@ const (
 	OneDay              = 60 * 60 * 24
 	UserUpdateAreaKey   = "free_area_num_%s_%s"
 	BaseAreaNum         = 1
-	VipFileUploadNumKey = "vip_file_num_%s_%s" //超级订阅附件本月一下载次数 %s:userid ; %s:当前月份-fmt.Sprint(time.Now().Month())
+	VipFileUploadNumKey = "vip_file_num_%s_%s"  //超级订阅附件本月一下载次数 %s:userid ; %s:当前月份-fmt.Sprint(time.Now().Month())
+	FilePackNumKey      = "file_pack_num_%s_%s" //附件下载包本月  剩余次数  %s:userid   %s 当前月份-fmt.Sprint(time.Now().Month())
 )
 
 //初始化大会员权益

+ 20 - 0
src/jfw/modules/common/src/qfw/util/jy/jy.go

@@ -300,3 +300,23 @@ func Getindustrys(industryname string, mongodb MongodbSim) (industry map[string]
 	}
 	return industry, sortArray
 }
+
+//对应月份
+//
+func GetMonth(mon string) int {
+	month := map[string]int{
+		"January":   1,
+		"February":  2,
+		"March":     3,
+		"April":     4,
+		"May":       5,
+		"June":      6,
+		"July":      7,
+		"August":    8,
+		"September": 9,
+		"October":   10,
+		"November":  11,
+		"December":  12,
+	}
+	return month[mon]
+}

+ 2 - 0
src/jfw/modules/subscribepay/src/a/init.go

@@ -72,4 +72,6 @@ func init() {
 	xweb.AddRouter("/subscribepay", &service.DataExportPack{})
 	//省份流量包
 	xweb.AddRouter("/jypay", &service.AreaPack{})
+	//公共资源包
+	xweb.AddRouter("/jypay", &service.ResourcePack{})
 }

+ 2 - 1
src/jfw/modules/subscribepay/src/baseApi.json

@@ -6,6 +6,7 @@
     "findPreview": "http://127.0.0.1:8124/resources/findPreview",
     "findBalance": "http://127.0.0.1:8124/resources/findBalance",
     "findRecord": "http://127.0.0.1:8124/resources/findRecord",
-    "entdedupUrl": "http://127.0.0.1:8888/data/deduplication"
+    "entdedupUrl": "http://127.0.0.1:8888/data/deduplication",
+    "updateVipTime":"http://127.0.0.1:8124/resources/updateVipTime"
   }
 }

+ 3 - 1
src/jfw/modules/subscribepay/src/bidfile.json

@@ -1,3 +1,5 @@
 {
-	"price":1500
+	"price":1500,
+	"file_number":10,
+	"attachmentRPC":"192.168.3.206:10082"
 }

+ 17 - 7
src/jfw/modules/subscribepay/src/config/config.go

@@ -158,7 +158,9 @@ type memberConfig struct {
 }
 
 type bidfileConfig struct {
-	Price float64
+	Price         float64
+	File_number   int
+	AttachmentRPC string
 }
 
 //数据导出配置文件
@@ -251,15 +253,21 @@ var JyApiConfig *ApiConfig
 type ApiConfig struct {
 	AppId   string `json:"appId"`
 	ApiList struct {
-		BuyBalance  string `json:"buyBalance"`  //购买资源
-		UseBalance  string `json:"useBalance"`  //使用资源
-		FindBalance string `json:"findBalance"` //查询账户余额接口
-		FindRecord  string `json:"findRecord"`  //查询流水账接口
-		FindPreview string `json:"findPreview"` //数据导出去重查询
-		EntDedupUrl string `json:"entdedupUrl"` //企业去重
+		BuyBalance    string `json:"buyBalance"`    //购买资源
+		UseBalance    string `json:"useBalance"`    //使用资源
+		FindBalance   string `json:"findBalance"`   //查询账户余额接口
+		FindRecord    string `json:"findRecord"`    //查询流水账接口
+		FindPreview   string `json:"findPreview"`   //数据导出去重查询
+		EntDedupUrl   string `json:"entdedupUrl"`   //企业去重
+		UpdateVipTime string `json:"updateVipTime"` //更新超级订阅到期时间接口
 	} `json:"apiList"`
 }
 
+type ResourceCfg struct {
+	Product                 map[string]string `json:"product"`
+	AttachmentDownPackPrice map[string]int    `json:"attachmentDownPackPrice"`
+}
+
 //数据导出配置文件-end
 
 var Config *config
@@ -269,6 +277,7 @@ var EntnicheConfig *entnicheConfig
 var MemberConfig *memberConfig
 var BidfileConfig *bidfileConfig
 var ExConf *DataExportConfig
+var ResConf *ResourceCfg
 
 var InvoiceConfig *Invoice
 
@@ -296,6 +305,7 @@ func init() {
 	qutil.ReadConfig("./integral.json", &IntegralConfig)
 	qutil.ReadConfig("./coupon.json", &CouponConfig)
 	qutil.ReadConfig("./baseApi.json", &JyApiConfig)
+	qutil.ReadConfig("./resourcePack.json", &ResConf)
 
 	for _, v := range Config.Mail {
 		mail := &mail.GmailAuth{

+ 4 - 1
src/jfw/modules/subscribepay/src/coupon.json

@@ -21,7 +21,10 @@
     "省份订阅包1个月":"1131",
     "省份订阅包3个月":"1132",
     "省份订阅包12个月":"1133",
-    "省份订阅包7天":"1134"
+    "省份订阅包7天":"1134",
+    "附件下载包-5个":"1141",
+    "附件下载包-10个":"1142",
+    "附件下载包-20个":"1143"
   },
   "giveinfo":"http://127.0.0.1:8888/giveInfo"
 }

+ 270 - 0
src/jfw/modules/subscribepay/src/entity/basePack.go

@@ -0,0 +1,270 @@
+package entity
+
+import (
+	"config"
+	"fmt"
+	"log"
+	. "mongodb"
+	qutil "qfw/util"
+	"qfw/util/jy"
+	"qfw/util/redis"
+	"time"
+	"util"
+)
+
+// 默认消费
+func (this *UseBalanceStruct) defaultConsume() (r map[string]interface{}, m string, c int) {
+	r, rerr := this.UseBalance()
+	if rerr != nil {
+		m = fmt.Sprintf("消费异常:%s", rerr.Error())
+	}
+	return
+}
+
+//附件下载消费 fui:免费赠送已使用次数;pui:付费权限已使用次数
+func (this *UseBalanceStruct) fileConsume() (r map[string]interface{}, m string, c int) {
+	_fileName := this.Remarks["fileName"].(string)
+	_id := this.Remarks["id"].(string)
+	BaseMsg := jy.GetBigVipUserBaseMsg(this.UserId, util.Mysql, util.MQFW)
+	if BaseMsg.Status > 0 && BaseMsg.PowerMap[3] {
+		r = fileAttachRpc(_fileName, _id)
+		go func(this *UseBalanceStruct, r map[string]interface{}) {
+			data := make(map[string]interface{})
+			data["p_type"] = "大会员用户附件下载"
+			data["p_userid"] = this.UserId
+			data["p_infoId"] = this.Remarks["id"].(string)
+			data["s_platform"] = this.Platform
+			data["p_create_time"] = time.Now().Unix()
+			data["p_rep"] = r
+			//存库记录
+			if util.MQFW.Save("filehistroy", data) == "" {
+				log.Println("大会员附件下载-历史记录异常:" + this.UserId)
+			}
+		}(this, r)
+	} else if BaseMsg.VipStatus > 0 {
+		isExists := false
+		//查询当月附件下载历史记录-如是已下载过的附件不再扣除次数
+		id := this.FindJyConsumePackRecord()
+		if id != "" && this.Remarks["downUrl"] != nil {
+			if util.MQFW.UpdateById(jyCC, id, map[string]interface{}{
+				"$set": map[string]interface{}{
+					"l_updateDate": time.Now().Unix(),
+				},
+			}) {
+				delete(this.Remarks, "id")
+				delete(this.Remarks, "title")
+				r = this.Remarks
+				r["isExists"] = true
+				isExists = true
+			}
+		}
+		// log.Println(this.Remarks, "++++++", this.AccountId, id, "-------------", isExists)
+		//当月未有消费记录
+		if !isExists {
+			isCanConsume_f := false
+			isCanConsume_p := false
+			//免费赠送已使用次数
+			mon_free := fmt.Sprintf(jy.VipFileUploadNumKey, this.UserId, fmt.Sprint(time.Now().Month()))
+			fui := redis.GetInt(jy.PowerCacheDb, mon_free)
+			if fui < config.BidfileConfig.File_number {
+				isCanConsume_f = true
+			} else if payCount := this.accountPack(); payCount > 0 { //付费未使用次数
+				isCanConsume_p = true
+			}
+			if isCanConsume_f || isCanConsume_p {
+				r = fileAttachRpc(_fileName, _id)
+				if r["downUrl"] != nil {
+					this.Remarks["downUrl"] = r["downUrl"]
+					this.Remarks["size"] = r["size"]
+					if this.saveJyConsumePackList() {
+						if isCanConsume_p {
+							//中台消费记录
+							rb, err := this.UseBalance()
+							if err != nil || (rb != nil && qutil.IntAll(rb["code"]) == 0) {
+								m = fmt.Sprintf("消费记录保存异常:%s", qutil.ObjToString(rb["message"]))
+							} else {
+								//更新redis 购买附件下载包数量
+								mon_pay := fmt.Sprintf(jy.FilePackNumKey, this.UserId, fmt.Sprint(time.Now().Month()))
+								if redis.GetInt(jy.PowerCacheDb, mon_pay) <= 0 || redis.Decrby(jy.PowerCacheDb, mon_pay, 1) < 0 {
+									log.Println(fmt.Sprintf("附件下载包 消费异常:%s,附件名称:%s", this.UserId, this.Remarks["fileName"].(string)))
+								}
+							}
+						} else if isCanConsume_f { //下载后自增一次 免费权限默认存储31d
+							if fui == 0 {
+								redis.Put(jy.PowerCacheDb, mon_free, 1, 60*60*24*31)
+							} else {
+								redis.Incr(jy.PowerCacheDb, mon_free)
+							}
+						}
+					}
+				} else {
+					m = "获取附件异常"
+				}
+			} else {
+				c = -1
+				m = "该用户下载权限当前月已用完"
+			}
+		}
+	} else {
+		//判断免费用户是否有留资下载权限
+		if _, _, freeFileNum := jy.FreeExperience(this.UserId); freeFileNum == 1 {
+			r = fileAttachRpc(_fileName, _id)
+			//免费用户下载后取消下载权限
+			redis.PutKV(fmt.Sprintf(jy.PowerCacheFileKey, this.UserId), -1)
+		} else {
+			c = -1
+			m = "该用户没有下载权限"
+		}
+	}
+	return
+}
+
+var jyCC = "jy_consumepack"
+
+//查询jy 消费日志记录
+func (this *UseBalanceStruct) FindJyConsumePackRecord() string {
+	query := map[string]interface{}{
+		"s_id":       this.Remarks["id"].(string),
+		"s_userId":   this.UserId,
+		"s_product":  this.Name,
+		"s_month":    time.Now().Format("2006-01"),
+		"s_fileName": this.Remarks["fileName"].(string),
+	}
+	res, ok := util.MQFW.FindOne(jyCC, query)
+	if ok && res != nil {
+		if (*res)["s_downUrl"] != nil {
+			this.Remarks["downUrl"] = (*res)["s_downUrl"]
+			this.Remarks["size"] = (*res)["s_fileSize"]
+		}
+	} else {
+		log.Println("查询附件下载日志异常:", this.UserId)
+	}
+	return BsonIdToSId((*res)["_id"])
+}
+
+//保存日志
+func (this *UseBalanceStruct) saveJyConsumePackList() (b bool) {
+	saveMap := map[string]interface{}{
+		"s_id":         this.Remarks["id"],
+		"s_userId":     this.UserId,
+		"s_product":    this.Name,
+		"l_date":       time.Now().Unix(),
+		"l_updateDate": time.Now().Unix(), //更新时间
+		"s_month":      time.Now().Format("2006-01"),
+		"s_fileName":   this.Remarks["fileName"],
+		"s_downUrl":    this.Remarks["downUrl"],
+		"s_fileSize":   this.Remarks["size"],
+		"s_title":      this.Remarks["title"],
+		"b_isPay":      b,
+		"s_platform":   this.Platform,
+	}
+	b = util.MQFW.Save(jyCC, saveMap) != ""
+	if !b {
+		log.Println("保存附件下载日志异常:", this.UserId)
+	}
+	return
+}
+
+//调rpc 获取附件信息
+func fileAttachRpc(fileName, id string) (r map[string]interface{}) {
+	r = make(map[string]interface{})
+	// 调用rpc 获取附件信息
+	req := util.JyFileRequest{id}
+	rep, err := util.Attachment(&req)
+	if err != nil {
+		log.Println("attachment  rpc调用失败")
+	} else {
+		if rep.Rep != nil && len(rep.Rep) > 0 {
+			//获取当前附件下载地址
+			for _, v := range rep.Rep {
+				if qutil.ObjToString(v["filename"]) == fileName {
+					r = map[string]interface{}{
+						"downUrl":  qutil.ObjToString(v["downurl"]),
+						"fileName": qutil.ObjToString(v["filename"]),
+						"size":     qutil.ObjToString(v["size"]),
+					}
+					break
+				}
+			}
+		}
+	}
+	return
+}
+
+//消费
+func JyConsumePack(userId, product, platform string, remarks map[string]interface{}) (r map[string]interface{}, m string, c int) {
+	CStruct := InitUseBalance(userId, product, product, "", "", nil, remarks, 1, platform)
+	switch product {
+	case "附件下载包":
+		r, m, c = CStruct.fileConsume()
+	default:
+		r, m, c = CStruct.defaultConsume()
+	}
+	return
+}
+
+//流水
+func JyFindRecordPack(userId, productName, queryTime, platform string, pageSize, pageNum int) (list []map[string]interface{}, total int, err error) {
+	RStruct := InitFindRecord(userId, productName, queryTime, platform, pageSize, pageNum, 0)
+	switch productName {
+	case "附件下载包":
+		list, total = RStruct.FindJyConsumePackAllRecord()
+	default:
+		list, total = RStruct.DefaultData()
+	}
+	return list, total, nil
+}
+
+//数据处理-附件下载包
+func (this *FindRecordStruct) FindJyConsumePackAllRecord() ([]map[string]interface{}, int) {
+	var articleAddMap = map[string]string{
+		"PC":  "/article/content/%s.html",
+		"WX":  "/article/content/%s.html",
+		"APP": "/jyapp/article/content/%s.html",
+	}
+	query := map[string]interface{}{
+		"s_userId":  this.UserId,
+		"s_product": this.Name,
+		"s_month":   this.QueryTime,
+	}
+	// log.Println("query:", query, "---", this.Page, this.PageSize)
+	//当月
+	total := util.MQFW.Count(jyCC, query)
+	// query["s_month"] = this.QueryTime
+	list, ok := util.MQFW.Find(jyCC, query, `{"l_updateDate":-1,"l_date":-1}`, `{"s_id":1,"s_fileName":1,"s_downUrl":1,"l_date":1,"s_title":1,"l_updateDate":1}`, false, (this.Page-1)*this.PageSize, this.PageSize)
+	if ok && list != nil {
+		if len(*list) >= 1 {
+			for _, item := range *list {
+				itemData := qutil.ObjToMap(item)
+				if itemData == nil || len(*itemData) == 0 {
+					continue
+				}
+				l_date := qutil.If((*itemData)["l_updateDate"] != nil, (*itemData)["l_updateDate"], (*itemData)["l_date"])
+				(*itemData)["l_date"] = qutil.FormatDateWithObj(&l_date, "2006/01/02")
+				(*itemData)["articleUrl"] = fmt.Sprintf(articleAddMap[this.Platform], qutil.EncodeArticleId2ByCheck((*itemData)["s_id"].(string)))
+				(*itemData)["s_id"] = qutil.EncodeArticleId2ByCheck((*itemData)["s_id"].(string))
+				delete((*itemData), "s_downUrl")
+				delete((*itemData), "_id")
+			}
+		} else {
+			log.Println("暂无附件下载记录:", this.UserId)
+		}
+	} else {
+		log.Println("查询附件下载记录异常:", this.UserId)
+	}
+
+	return *list, total
+}
+
+//数据处理-default
+func (this *FindRecordStruct) DefaultData() ([]map[string]interface{}, int) {
+	returnList, total, err := this.FindRecord()
+	if err != nil {
+		log.Println("默认资源包流水异常:", err)
+		return nil, 0
+	}
+	if total == 0 {
+		log.Println(fmt.Sprintf("暂无%s资源包流水", this.Name))
+	}
+	return qutil.ObjArrToMapArr(returnList), total
+}

+ 278 - 0
src/jfw/modules/subscribepay/src/entity/commonApi.go

@@ -0,0 +1,278 @@
+package entity
+
+import (
+	"config"
+	"encoding/json"
+	"fmt"
+	"log"
+	"net/url"
+	qu "qfw/util"
+	"qfw/util/jy"
+	"qfw/util/redis"
+	"strings"
+	"time"
+)
+
+//充值
+type PayStruct struct {
+	AccountId    string                 //用户身份
+	Name         string                 //资源名称
+	ResourceType string                 //资源类型
+	Number       string                 //数量
+	Spec         string                 //单位
+	EndTime      string                 //截止日期
+	Remarks      map[string]interface{} //备注
+	AppId        string                 //appId默认10000
+	VipTime      int64                  //超级订阅截止日期
+}
+
+func InitPurchase(userId, product, resourceType, num, spec, endTime string, remarks map[string]interface{}, vipEndTime int64) *PayStruct {
+	return &PayStruct{
+		AccountId:    userId,
+		Name:         product,      //资源名称
+		ResourceType: resourceType, //资源类型
+		Number:       num,          //数量
+		Spec:         spec,         //单位
+		EndTime:      endTime,      //截止日期
+		Remarks:      remarks,      //备注
+		AppId:        config.CouponConfig.AppId,
+		VipTime:      vipEndTime,
+	}
+}
+
+// @Summary 资源包充值【数据流量包、附件下载包。。】
+// @Param  &PayStruct
+func (this *PayStruct) PurchaseUserBalance() (bool, error) {
+	remarkBytes, err := json.Marshal(this.Remarks)
+	if err != nil {
+		return false, fmt.Errorf("remark pase error")
+	}
+	param := url.Values{
+		"accountId":    []string{this.AccountId},
+		"name":         []string{this.Name},
+		"resourceType": []string{this.ResourceType},
+		"number":       []string{this.Number},
+		"spec":         []string{this.Spec}, //规格*
+		"endTime":      []string{this.EndTime},
+		"remarks":      []string{string(remarkBytes)},
+		"appId":        []string{this.AppId},
+		"vipTime":      []string{fmt.Sprintf("%v", this.VipTime)},
+	}
+	rmap, err := commonPost(config.JyApiConfig.ApiList.BuyBalance, param)
+	log.Println("BuyBalance post err: ", rmap, err)
+	if err != nil {
+		return false, err
+	}
+	return true, nil
+}
+
+type FindBalanceStruct struct {
+	AccountId    string //账户标识
+	ResourceType string //产品类型
+}
+
+// @Summary 余额接口【数据流量包、附件下载包。。】
+// @Param  &FindBalanceStruct
+// @return map error
+func (this *FindBalanceStruct) FindBalance() (map[string]interface{}, error) {
+	param := url.Values{
+		"accountId":    []string{this.AccountId},
+		"resourceType": []string{this.ResourceType},
+	}
+	rmap, err := commonPost(config.JyApiConfig.ApiList.FindBalance, param)
+	if err != nil {
+		log.Println("FindBalance post err:", err)
+		return rmap, err
+	}
+	if rmap != nil && len(rmap) > 0 && this.ResourceType == "附件下载包" {
+		rdata, _ := rmap["data"].([]interface{})
+		rdataArr := qu.ObjArrToMapArr(rdata)
+		vipFileKey := fmt.Sprintf(jy.VipFileUploadNumKey, this.AccountId, fmt.Sprint(time.Now().Month()))
+		vipFileKeyNum := redis.GetInt(jy.PowerCacheDb, vipFileKey)
+		free_num := config.BidfileConfig.File_number - vipFileKeyNum //free
+		if len(rdata) > 0 {
+			for k, v := range rdataArr {
+				num := qu.IntAll(v["number"]) //buy
+				v["number"] = num + free_num
+				rdataArr[k] = v
+			}
+		} else {
+			rdataArr = append(rdataArr, map[string]interface{}{"name": this.ResourceType, "number": free_num, "resourceType": this.ResourceType, "thirtyNum": 0})
+		}
+		rmap["data"] = rdataArr
+	}
+	return rmap, err
+}
+
+//使用
+type UseBalanceStruct struct {
+	AccountId        string                 //账户标识
+	Name             string                 //资源名称
+	ResourceType     string                 //资源类型
+	Number           int                    //扣除数量
+	RuleId           string                 //规则标识
+	UserId           string                 //用户标识
+	AppId            string                 //默认10000
+	Remarks          map[string]interface{} //备注
+	DuplicateRemoval string                 //是否去重0不去1去重【数据流量包用到】
+	InfoId           []string               //数据Id,多个以逗号隔开【数据流量包用到】
+	Platform         string                 //平台:PC;APP;WX
+}
+
+//
+func InitUseBalance(userId, product, resourceType, ruleId, duplicateRemoval string, infoId []string, remarks map[string]interface{}, num int, platform string) *UseBalanceStruct {
+	return &UseBalanceStruct{
+		AccountId:        userId,
+		Name:             product,
+		ResourceType:     resourceType,
+		Number:           num,
+		RuleId:           ruleId,
+		UserId:           userId,
+		AppId:            config.CouponConfig.AppId,
+		Remarks:          remarks,          //备注
+		DuplicateRemoval: duplicateRemoval, //是否去重0不去1去重【数据流量包用到】
+		InfoId:           infoId,
+		Platform:         platform,
+	}
+}
+
+// @Summary 使用接口【数据流量包、附件下载包。。】
+// @Param  &UseBalanceStruct
+// @return map error
+func (this *UseBalanceStruct) UseBalance() (map[string]interface{}, error) {
+	remarkBytes, err := json.Marshal(this.Remarks)
+	if err != nil {
+		return nil, fmt.Errorf("remark pase error")
+	}
+	resMap, err := commonPost(config.JyApiConfig.ApiList.UseBalance, url.Values{
+		"accountId":        []string{this.UserId},                    //账户标识
+		"name":             []string{this.Name},                      //资源名称
+		"resourceType":     []string{this.ResourceType},              //资源类型
+		"number":           []string{fmt.Sprintf("%d", this.Number)}, //扣除数量
+		"ruleId":           []string{this.RuleId},                    //规则标识
+		"userId":           []string{this.UserId},                    //用户标识
+		"remarks":          []string{string(remarkBytes)},            //备注 查询条件、下载地址、导出时间、导出条数
+		"infoId":           []string{strings.Join(this.InfoId, ",")}, //数据Id,多个以逗号隔开
+		"duplicateRemoval": []string{this.DuplicateRemoval},          //是否去重0不去1去重
+	})
+	if err != nil {
+		log.Println("UseBalance post err:", err)
+		return resMap, err
+	}
+	return resMap, err
+}
+
+//流水
+type FindRecordStruct struct {
+	AccountId    string //账户标识
+	UserId       string //用户标识
+	Name         string //资源名称
+	PageSize     int    //每页多少条
+	Page         int    //当前页
+	State        int    // 0 查消耗记录 1 查充值记录
+	ResourceType string //资源类型
+	QueryTime    string //查询时间 格式2022-01
+	Platform     string //平台:PC;APP;WX
+
+}
+
+//定义结构体
+func InitFindRecord(userId, resourceType, queryTime, platform string, pageSize, pageNum, state int) *FindRecordStruct {
+	if pageSize == 0 {
+		pageSize = 10
+	}
+	if pageNum <= 0 {
+		pageNum = 1
+	}
+	if platform == "" {
+		platform = "PC"
+	}
+	return &FindRecordStruct{
+		AccountId:    userId,
+		UserId:       userId,
+		PageSize:     pageSize,
+		Page:         pageNum,
+		State:        state, //0 查消耗记录 1 查充值记录
+		ResourceType: resourceType,
+		Name:         resourceType,
+		QueryTime:    queryTime,
+		Platform:     platform,
+	}
+}
+
+// @Summary 流水接口【数据流量包、附件下载包。。】
+// @Param  &FindRecordStruct
+// @return list列表 , int数量 , error
+func (this *FindRecordStruct) FindRecord() ([]interface{}, int, error) {
+	log.Println("----", this.UserId, this.PageSize, this.Page, this.State, this.ResourceType, this.QueryTime)
+	resMap, err := commonPost(config.JyApiConfig.ApiList.FindRecord, url.Values{
+		"accountId":    []string{this.UserId},                      //账户标识
+		"userId":       []string{this.UserId},                      //用户标识
+		"pageSize":     []string{fmt.Sprintf("%d", this.PageSize)}, //每页多少条
+		"page":         []string{fmt.Sprintf("%d", this.Page)},     //当前页
+		"state":        []string{fmt.Sprintf("%d", this.State)},    // 0 查消耗记录 1 查充值记录
+		"resourceType": []string{this.ResourceType},
+		"queryTime":    []string{this.QueryTime}, //格式 2022-01
+	})
+	if err != nil {
+		return nil, -1, err
+	}
+	total := qu.IntAll(resMap["count"])
+	list, _ := resMap["data"].([]interface{})
+	return list, total, err
+}
+
+//
+
+type UpdateVipTimeStruct struct {
+	AccountId string //账户标识
+	VipTime   int64  //结束时间时间戳
+}
+
+// @Summary 更新超级订阅到期时间
+// @Param  &UpdateVipTimeStruct
+// @return list列表 , int数量 , error
+func (this *UpdateVipTimeStruct) UpdateVipEndTime() (bool, error) {
+	resMap, err := commonPost(config.JyApiConfig.ApiList.UpdateVipTime, url.Values{
+		"accountId": []string{this.AccountId},                  //账户标识
+		"vipTime":   []string{fmt.Sprintf("%v", this.VipTime)}, //到期时间戳
+	})
+	if err != nil {
+		return false, err
+	}
+	ok := qu.IntAll(resMap["code"]) == 1
+	log.Println(resMap)
+	return ok, nil
+}
+
+//账户信息
+func (this *UseBalanceStruct) accountPack() (payCount int) {
+	resMap, err := commonPost(config.JyApiConfig.ApiList.FindBalance, url.Values{
+		"accountId":    []string{this.UserId}, //账户标识*
+		"resourceType": []string{this.Name},   //产品名称
+	})
+	if err != nil {
+		log.Println(fmt.Sprintf("查看账户信息异常:%s,%s", this.UserId, this.Name))
+		payCount = -1
+		return
+	}
+	listObj, ok := resMap["data"].([]interface{})
+	if !ok {
+		log.Println(fmt.Errorf("packAccount 请求中台返回数据结构异常"))
+		payCount = -1
+		return
+	}
+	if len(listObj) > 0 {
+		for _, obj := range listObj {
+			packMap := qu.ObjToMap(obj)
+			if packMap == nil || len(*packMap) == 0 {
+				continue
+			}
+			if packType := qu.ObjToString((*packMap)["name"]); packType != this.Name {
+				continue
+			}
+			payCount = qu.IntAll((*packMap)["number"]) //总量
+		}
+	}
+	return
+}

+ 5 - 4
src/jfw/modules/subscribepay/src/entity/dataExportPackApi.go

@@ -14,9 +14,10 @@ import (
 )
 
 const (
-	PACKNAME = "数据流包"
-	NORMAL   = "标准字段包"
-	SENIOR   = "高级字段包"
+	PACKNAME   = "数据流包"
+	NORMAL     = "标准字段包"
+	SENIOR     = "高级字段包"
+	ATTACHMENT = "附件下载包"
 )
 
 func commonPost(path string, param url.Values) (map[string]interface{}, error) {
@@ -28,7 +29,7 @@ func commonPost(path string, param url.Values) (map[string]interface{}, error) {
 	defer res.Body.Close()
 	bs, _ := ioutil.ReadAll(res.Body)
 	resMap := map[string]interface{}{}
-	log.Println("req", param.Encode(), "body:", string(bs), "err", err)
+	// log.Println("req", param.Encode(), "body:", string(bs), "err", err)
 	err = json.Unmarshal(bs, &resMap)
 	if err != nil {
 		return nil, fmt.Errorf("%s 请求中台返回内容异常 %s", path, string(bs))

+ 1 - 1
src/jfw/modules/subscribepay/src/entity/member.go

@@ -25,7 +25,7 @@ func init() {
 			sid := qutil.IntAll(v["id"])
 			pid := qutil.IntAll(v["i_pid"])
 			count_year := qutil.IntAll(v["s_count_year"])
-			log.Println(pid, sid, count_year)
+			// log.Println(pid, sid, count_year)
 			if pid != 0 {
 				member_serice[sid] = map[int]int{
 					pid: count_year,

+ 182 - 0
src/jfw/modules/subscribepay/src/entity/resourcePackStruct.go

@@ -0,0 +1,182 @@
+package entity
+
+import (
+	"config"
+	"encoding/json"
+	"fmt"
+	"log"
+	"math"
+	qu "qfw/util"
+	"qfw/util/jy"
+	"qfw/util/redis"
+	"strconv"
+	"time"
+	"util"
+
+	"github.com/shopspring/decimal"
+)
+
+//资源包
+type resoucePackStruct struct {
+}
+
+var JyresoucePack resoucePackStruct
+
+// PayCallBack 支付完成回调
+func (this *resoucePackStruct) PayCallBack(param *CallBackParam) bool {
+	orderData := util.Mysql.FindOne("dataexport_order", map[string]interface{}{
+		"out_trade_no": param.OutTradeno,
+		"product_type": ATTACHMENT,
+	}, "id,order_status,order_code,filter,user_id,d_relation_id,dis_word,order_money,vip_starttime,vip_endtime", "")
+	if orderData != nil {
+		userId := qu.ObjToString((*orderData)["user_id"])
+		now := time.Now()
+		payTime := qu.FormatDate(&now, qu.Date_Full_Layout)
+		updateMap := map[string]interface{}{
+			"pay_money":    param.CashFee,
+			"pay_time":     payTime,
+			"order_status": 1,
+		}
+		if order_status := qu.IntAll((*orderData)["order_status"]); order_status == 0 {
+			filter := qu.ObjToString((*orderData)["filter"])
+			filterM := map[string]interface{}{}
+			if err := json.Unmarshal([]byte(filter), &filterM); err != nil {
+				log.Printf("获取用户%s已购买附件下载包内容异常:%v", userId, err)
+				return false
+			}
+			update := util.Mysql.Update("dataexport_order", map[string]interface{}{
+				"id": (*orderData)["id"],
+			}, updateMap)
+			if !update {
+				log.Printf("用户%s更新订单状态出错:%v", userId, (*orderData)["order_code"])
+				return false
+			}
+			go PayCancel(userId, ATTACHMENT, "")
+			udata, errs := util.MQFW.FindById("user", userId, `{"l_vip_endtime":1}`)
+			vipendtime := int64(0)
+			if udata != nil && errs {
+				vipendtime = qu.Int64All((*udata)["l_vip_endtime"])
+			}
+			//userId, product, resourceType, num, spec, endTime string, remarks map[string]interface{}, vipEndTime int64
+			okk, err := InitPurchase(userId, ATTACHMENT, ATTACHMENT, strconv.Itoa(qu.IntAll(filterM["num"])), "个",
+				JyresoucePack.LastDate(now).Format(qu.Date_Short_Layout), filterM, vipendtime).PurchaseUserBalance()
+			if !okk {
+				log.Printf("用户%sPurchaseUserBalance出错:%v", userId, (*orderData)["order_code"], err)
+				return false
+			}
+			//附件下载包剩余次数
+			filePackKey := fmt.Sprintf(jy.FilePackNumKey, userId, fmt.Sprint(time.Now().Month()))
+			filePackNum := redis.GetInt(jy.PowerCacheDb, filePackKey)
+			if filePackNum == 0 {
+				redis.Put(jy.PowerCacheDb, filePackKey, qu.IntAll(filterM["num"]), int(this.LastDate(now).Unix()-now.Unix()))
+			} else {
+				filePackNum += qu.IntAll(filterM["num"])
+				redis.Put(jy.PowerCacheDb, filePackKey, filePackNum, int(this.LastDate(now).Unix()-now.Unix()))
+			}
+			//卡卷使用
+			userLotteryId := qu.ObjToString((*orderData)["d_relation_id"])
+			order_code := qu.ObjToString((*orderData)["order_code"])
+			if userLotteryId != "" {
+				go func(userId, userLotteryId, order_code string) {
+					phone, name := util.GetMyPhoneAndName(userId)
+					if !util.UpdateCouponState(userId, userLotteryId, name, phone, order_code, ATTACHMENT, "0", 1, 0) {
+						log.Println(fmt.Sprintf("单号%s-消费失败-卡卷%s", order_code, userLotteryId))
+					}
+				}(userId, userLotteryId, order_code)
+			}
+			return true
+		} else {
+			return true
+		}
+	}
+	return false
+}
+
+type ReturnStruct struct {
+	Filter        map[string]interface{} `json:"filter"`                  //filter字段
+	Price         int                    `json:"price"`                   //价格
+	OrderMoney    int                    `json:"orderMoney"`              //订单金额
+	DiscountPrice int                    `json:"discountPrice,omitempty"` //优惠de金额
+	UserLotteryId string                 `json:"userLotteryId,omitempty"` //优惠关联id;--用户领取卡卷的记录id
+	Product       string                 `json:"product,omitempty"`       //产品类型 用户获取商品id
+}
+
+func (this *resoucePackStruct) Filter(product, userid, lotteryId, discountId string, m map[string]interface{}) (ReturnStruct, string) {
+	filter := map[string]interface{}{}
+	rs := ReturnStruct{}
+	msg := ""
+	//产品 计算价格 生成 filter
+	switch product {
+	case "dataExportPack":
+	//TODO
+	case "attachmentDownPack":
+		filter = m
+		if jy.GetBigVipUserBaseMsg(userid, util.Mysql, util.MQFW).VipStatus <= 0 {
+			msg = "非超级订阅用户,暂无权益"
+		}
+		log.Println(filter)
+		num := qu.IntAll(filter["num"])
+		products := fmt.Sprintf("附件下载包-%v个", num)
+		price := config.ResConf.AttachmentDownPackPrice[strconv.Itoa(num)]
+		if price == 0 {
+			msg = "金额校验异常"
+		}
+		validTime := this.LastDate(time.Now())
+		//先判断用户到期时间
+		rdata, ok := util.MQFW.FindById("user", userid, `{"l_vip_endtime":1}`)
+		if ok && rdata != nil {
+			if (*rdata)["l_vip_endtime"] != nil {
+				vip_endtime := qu.Int64All((*rdata)["l_vip_endtime"])
+				if validTime.After(time.Unix(vip_endtime, 0)) {
+					validTime = time.Unix(vip_endtime, 0)
+					filter["is_end"] = true
+				}
+			}
+		}
+		filter["validTime"] = validTime.Format("2006-01-02")
+		rs = ReturnStruct{Filter: filter, Price: price, OrderMoney: price, Product: products}
+
+	}
+
+	//卡券
+	var discount float64
+	full_price, reduce_price, userLotteryId := 0, 0, ""
+	if lotteryId != "" {
+		full_price, reduce_price, discount, userLotteryId = util.GetCouponInfo(userid, lotteryId, config.CouponConfig.Products[rs.Product])
+		if full_price <= rs.Price {
+			if discount == 100 {
+				rs.DiscountPrice = reduce_price
+				rs.OrderMoney = rs.Price - reduce_price
+			} else {
+				//折扣
+				// disCount_int := int(math.Ceil(discount * 100))
+				// rs.DiscountPrice = rs.Price - rs.Price*disCount_int/1000
+				// rs.OrderMoney = rs.Price * disCount_int / 1000
+
+				disCount_int := int(math.Ceil(discount * 1000))                   //折扣
+				DiscountPrice := (float64)(rs.Price*(10000-disCount_int)) / 10000 //优惠金额
+				DiscountPrice_float, _ := decimal.NewFromFloat(DiscountPrice / 100).Round(2).Float64()
+				rs.DiscountPrice = int(decimal.NewFromFloat(DiscountPrice_float * 100).Round(2).IntPart()) //算出价格
+				rs.OrderMoney = rs.Price - int(rs.DiscountPrice)                                           //优惠后价格
+			}
+			rs.UserLotteryId = userLotteryId
+		}
+	}
+	i_product, _ := strconv.Atoi(config.CouponConfig.Products[rs.Product])
+	i_discountId, _ := strconv.Atoi(discountId)
+	//赠品相关
+	if i_discountId > 0 {
+		if timeNum, timeType, _ := util.GiveInfo(userid, i_product, i_discountId, 0); timeNum > 0 {
+			filter["giveCycle"] = timeNum
+			filter["giveType"] = timeType
+		}
+	} //获取满赠
+
+	return rs, msg
+}
+
+//获取当月最后一天
+func (this *resoucePackStruct) LastDate(now time.Time) time.Time {
+	now = now.AddDate(0, 0, -now.Day()+1)
+	return time.Date(now.Year(), now.Month(), now.Day(), 23, 59, 59, 0, now.Location()).AddDate(0, 1, -1)
+}

+ 48 - 0
src/jfw/modules/subscribepay/src/entity/subscribeVip.go

@@ -200,6 +200,18 @@ func (this *vipSubscribeStruct) PayCallBack(param *CallBackParam) bool {
 		flag = JyVipSubStruct.UpgradeSubVip(userid, vmsg, qutil.ObjToString((*orderdata)["vip_endtime"]))
 	} else if vmsg.OrderType == 5 { //续费(可升降级)
 		flag = JyVipSubStruct.WillNew(userid, vmsg, qutil.ObjToString((*orderdata)["vip_starttime"]), qutil.ObjToString((*orderdata)["vip_endtime"]))
+
+	}
+	if vmsg.OrderType == 2 || vmsg.OrderType == 5 {
+		//延长【附件下载包】到期时间
+		etm, _ := time.ParseInLocation(qutil.Date_Full_Layout, qutil.ObjToString((*orderdata)["vip_endtime"]), time.Local)
+		updateT := &UpdateVipTimeStruct{
+			AccountId: userid,
+			VipTime:   etm.Unix(),
+		}
+		updateT.UpdateVipEndTime()
+		//修改附件下载包的到期时间
+		FilepackEndtime(userId)
 	}
 	//支付成功后
 	if flag {
@@ -817,3 +829,39 @@ func BuyerClassStatus(userid string) bool {
 	}
 	return false
 }
+
+//修改附件下载包到期时间
+func FilepackEndtime(userid string) bool {
+	now := time.Now()
+	lastdata := JyresoucePack.LastDate(now)
+	//获取本月第一天时间
+	start := time.Date(now.Year(), now.Month(), 1, 0, 0, 0, 0, now.Location())
+	end := lastdata.Format(qutil.Date_Full_Layout)
+	rdata := util.Mysql.SelectBySql(`select order_code,filter from dataexport_order where
+	 product_type ="附件下载包" and user_id =? and create_time >=? and create_time <=? and order_status>=0`, userid, start, end)
+	log.Println(start, "--", end)
+	if rdata != nil && len(*rdata) > 0 {
+		for _, v := range *rdata {
+			rmap := map[string]interface{}{}
+			order_code := qutil.ObjToString(v["order_code"])
+			filter := qutil.ObjToString(v["filter"])
+			if err := json.Unmarshal([]byte(filter), &rmap); err != nil {
+				log.Printf("%s Unmarshal 出错 [%s]\n", userid, filter)
+				return false
+			}
+			validTime := qutil.ObjToString(rmap["validTime"])
+			log.Println(order_code)
+			if validTime != lastdata.Format(qutil.Date_Full_Layout) && rmap["is_end"] != nil {
+				rmap["validTime_old"] = validTime
+				rmap["validTime"] = lastdata.Format(qutil.Date_Short_Layout)
+				filterStr, _ := json.Marshal(rmap)
+				if okk := util.Mysql.Update("dataexport_order", map[string]interface{}{"order_code": order_code}, map[string]interface{}{
+					"filter": string(filterStr),
+				}); !okk {
+					log.Println("修改到期时间失败", order_code)
+				}
+			}
+		}
+	}
+	return true
+}

+ 7 - 0
src/jfw/modules/subscribepay/src/pay/aliPay.go

@@ -35,6 +35,7 @@ type aliPayStruct struct {
 	Subject_integral       string          //剑鱼币支付小标题
 	Subject_dataPack       string          //数据包支付小标题
 	Subject_areaPack       string          //省份流量包支付小标题
+	Subject_filePack       string          //附件下载包支付小标题
 }
 
 var Alipay *aliPayStruct
@@ -68,6 +69,7 @@ func init() {
 		Subject_integral:       qutil.ObjToString(config.AliPayConf["Subject_integral"]),
 		Subject_dataPack:       qutil.ObjToString(config.AliPayConf["Subject_dataPack"]),
 		Subject_areaPack:       qutil.ObjToString(config.AliPayConf["Subject_areaPack"]),
+		Subject_filePack:       qutil.ObjToString(config.AliPayConf["Subject_filePack"]),
 	}
 }
 
@@ -110,6 +112,9 @@ const (
 
 	ALI_AREAPACK_APP    = "ALIA" //省份流量包-app支付
 	ALI_AREAPACK_NATIVE = "alia" //省份流量包-pc支付
+
+	ALI_FILEPACK_APP    = "ALIF" //附件下载包包 -app支付
+	ALI_FILEPACK_NATIVE = "alif" //附件下载包 -pc支付
 )
 
 func (w *aliPayStruct) GetTradeno(tradenoSign string) (string, string) {
@@ -138,6 +143,8 @@ func (w *aliPayStruct) GetTradeno(tradenoSign string) (string, string) {
 		subject = w.Subject_dataPack
 	} else if tradenoSign == ALI_AREAPACK_APP || tradenoSign == ALI_AREAPACK_NATIVE {
 		subject = w.Subject_areaPack
+	} else if tradenoSign == ALI_FILEPACK_APP || tradenoSign == ALI_FILEPACK_NATIVE {
+		subject = w.Subject_filePack
 	}
 	lenRandom := 6 - len([]rune(tradenoSign)) //控制长度
 	tradeno = fmt.Sprintf("%s_%d%s%s", tradenoSign, time.Now().UnixNano(), qutil.GetRandom(lenRandom), qutil.GetLetterRandom(6))

+ 11 - 1
src/jfw/modules/subscribepay/src/pay/util.go

@@ -123,7 +123,14 @@ var (
 		"ali_app": ALI_AREAPACK_APP,
 		"ali_pc":  ALI_AREAPACK_NATIVE,
 	}
-
+	//附件下载包
+	filePackMap = map[string]string{
+		"wx_js":   WX_FILEPACK_JSAPI,
+		"wx_app":  WX_FILEPACK_APP,
+		"wx_pc":   WX_FILEPACK_NATIVE,
+		"ali_app": ALI_FILEPACK_APP,
+		"ali_pc":  ALI_FILEPACK_NATIVE,
+	}
 	PayWayAndSign = map[string]map[string]string{
 		"subvip":         vipMap,
 		"entniche":       entnicheMap,
@@ -136,6 +143,7 @@ var (
 		"bidfile":        bifileMap,
 		"integral":       integralMap,
 		"areaPack":       areaPackMap,
+		"filePack":       filePackMap,
 		"VIP订阅":          vipMap,
 		"企业商机管理":         entnicheMap,
 		"历史数据":           dataexportMap,
@@ -149,6 +157,7 @@ var (
 		"剑鱼币":            integralMap,
 		"数据流量包":          dataPackMap,
 		"省份订阅包":          areaPackMap,
+		"附件下载包":          filePackMap,
 	}
 	varOrderCode *orderCode
 
@@ -163,6 +172,7 @@ var (
 		"integral":       "剑鱼币",
 		"dataPack":       "数据流量包",
 		"areaPack":       "省份订阅包",
+		"filePack":       "附件下载包",
 	}
 )
 

+ 11 - 3
src/jfw/modules/subscribepay/src/pay/wxPay.go

@@ -55,6 +55,10 @@ const (
 	WX_AREAPACK_JSAPI  = "WJA" //省份订阅包 微信js支付
 	WX_AREAPACK_APP    = "WAA" //省份订阅包 app微信支付
 	WX_AREAPACK_NATIVE = "WPA" //省份订阅包 微信pc支付
+
+	WX_FILEPACK_JSAPI  = "WJF" //附件下载包 微信js支付
+	WX_FILEPACK_APP    = "WAF" //附件下载包 app微信支付
+	WX_FILEPACK_NATIVE = "WPF" //附件下载包 微信pc支付
 )
 
 var WxStruct *WeixinStruct
@@ -80,6 +84,7 @@ type WeixinStruct struct {
 	Integral_msg       string
 	DataPack_msg       string
 	AreaPack_msg       string
+	FilePack_msg       string
 }
 
 func init() {
@@ -106,6 +111,7 @@ func init() {
 		Integral_msg:       util.ObjToString(payConfig["integral_msg"]),
 		DataPack_msg:       util.ObjToString(payConfig["dataPack_msg"]),
 		AreaPack_msg:       util.ObjToString(payConfig["areaPack_msg"]),
+		FilePack_msg:       util.ObjToString(payConfig["filePack_msg"]),
 	}
 }
 
@@ -150,16 +156,18 @@ func (w *WeixinStruct) CreatePrepayOrder(tradeno, ip, openid, detailmsg string,
 		attachmsg, bodymsg, detailmsg = w.DataPack_msg, w.DataPack_msg, w.DataPack_msg
 	} else if tradeno == WX_AREAPACK_APP || tradeno == WX_AREAPACK_JSAPI || tradeno == WX_AREAPACK_NATIVE {
 		attachmsg, bodymsg, detailmsg = w.AreaPack_msg, w.AreaPack_msg, w.AreaPack_msg
+	} else if tradeno == WX_FILEPACK_APP || tradeno == WX_FILEPACK_JSAPI || tradeno == WX_FILEPACK_NATIVE {
+		attachmsg, bodymsg, detailmsg = w.FilePack_msg, w.FilePack_msg, w.FilePack_msg
 	}
 	//支付类型分类
 
 	tradeType, appid := "", w.Appid
-	if tradeno == WX_REWARD_JSAPI || tradeno == WX_DATAEXPORT_JSAPI || tradeno == WX_DATAREPORT_JSAPI || tradeno == WX_SUBVIP_JSAPI || tradeno == WX_COURSE_JSAPI || tradeno == WX_COURSEONLINE_JSAPI || tradeno == WX_MEMBER_JSAPI || tradeno == WX_AIFORECASTPACK_JSAPI || tradeno == WX_BIDFILE_JSAPI || tradeno == WX_INTEGRAL_JSAPI || tradeno == WX_DATAPACK_JSAIP || tradeno == WX_AREAPACK_JSAPI { //微信js支付
+	if tradeno == WX_REWARD_JSAPI || tradeno == WX_DATAEXPORT_JSAPI || tradeno == WX_DATAREPORT_JSAPI || tradeno == WX_SUBVIP_JSAPI || tradeno == WX_COURSE_JSAPI || tradeno == WX_COURSEONLINE_JSAPI || tradeno == WX_MEMBER_JSAPI || tradeno == WX_AIFORECASTPACK_JSAPI || tradeno == WX_BIDFILE_JSAPI || tradeno == WX_INTEGRAL_JSAPI || tradeno == WX_DATAPACK_JSAIP || tradeno == WX_AREAPACK_JSAPI || tradeno == WX_FILEPACK_JSAPI { //微信js支付
 		tradeType = "JSAPI"
-	} else if tradeno == WX_DATAEXPORT_APP || tradeno == WX_DATAREPORT_APP || tradeno == WX_SUBVIP_APP || tradeno == WX_COURSE_APP || tradeno == WX_ENTNICHE_APP || tradeno == WX_COURSEONLINE_APP || tradeno == WX_MEMBER_APP || tradeno == WX_AIFORECASTPACK_APP || tradeno == WX_BIDFILE_APP || tradeno == WX_INTEGRAL_APP || tradeno == WX_DATAPACK_APP || tradeno == WX_AREAPACK_APP { //app支付
+	} else if tradeno == WX_DATAEXPORT_APP || tradeno == WX_DATAREPORT_APP || tradeno == WX_SUBVIP_APP || tradeno == WX_COURSE_APP || tradeno == WX_ENTNICHE_APP || tradeno == WX_COURSEONLINE_APP || tradeno == WX_MEMBER_APP || tradeno == WX_AIFORECASTPACK_APP || tradeno == WX_BIDFILE_APP || tradeno == WX_INTEGRAL_APP || tradeno == WX_DATAPACK_APP || tradeno == WX_AREAPACK_APP || tradeno == WX_FILEPACK_APP { //app支付
 		tradeType = "APP"
 		appid = w.Appid_app
-	} else if tradeno == WX_DATAEXPORT_NATIVE || tradeno == WX_COURSE_NATIVE || tradeno == WX_COURSEONLINE_NATIVE || tradeno == WX_DATAREPORT_NATIVE || tradeno == WX_ENTNICHE_NATIVE || tradeno == WX_SUBVIP_NATIVE || tradeno == WX_MEMBER_NATIVE || tradeno == WX_AIFORECASTPACK_NATIVE || tradeno == WX_BIDFILE_NATIVE || tradeno == WX_INTEGRAL_NATIVE || tradeno == WX_DATAPACK_NATIVE || tradeno == WX_AREAPACK_NATIVE { //扫码支付
+	} else if tradeno == WX_DATAEXPORT_NATIVE || tradeno == WX_COURSE_NATIVE || tradeno == WX_COURSEONLINE_NATIVE || tradeno == WX_DATAREPORT_NATIVE || tradeno == WX_ENTNICHE_NATIVE || tradeno == WX_SUBVIP_NATIVE || tradeno == WX_MEMBER_NATIVE || tradeno == WX_AIFORECASTPACK_NATIVE || tradeno == WX_BIDFILE_NATIVE || tradeno == WX_INTEGRAL_NATIVE || tradeno == WX_DATAPACK_NATIVE || tradeno == WX_AREAPACK_NATIVE || tradeno == WX_FILEPACK_NATIVE { //扫码支付
 		tradeType = "NATIVE"
 	}
 	tradeno = w.GetTradeno(tradeno)

+ 3 - 1
src/jfw/modules/subscribepay/src/pay_config.json

@@ -19,7 +19,8 @@
 			"bidfile_msg":"剑鱼标讯-招标文件解读",
 			"integral_msg":"剑鱼标讯-剑鱼币",
             "dataPack_msg": "剑鱼标讯-数据包",
-            "areaPack_msg":"剑鱼标讯-省份订阅包"
+            "areaPack_msg":"剑鱼标讯-省份订阅包",
+            "filePack_msg":"剑鱼标讯-附件下载包"
         },
         "openidSwitch": {
             "oIMvJvrVXG89597EFmYiSiznbyyY": "oHwE_wEQlEBvjZJOyZeNnQcgKQMo",
@@ -49,6 +50,7 @@
 		"Subject_integral":"剑鱼标讯-剑鱼币",
         "Subject_dataPack": "剑鱼标讯-数据包",
         "Subject_areaPack":"剑鱼标讯-省份订阅包",
+        "Subject_filePack":"剑鱼标讯-附件下载包",
         "privateKey": "-----BEGIN RSA PRIVATE KEY-----\nMIIEogIBAAKCAQEAtO7CU4hpdcMmV43MEA8bqQJYYx+f6yvYkP0nFc/oCvU24bU6zAdK/H2H56quEwD8Dh5YtVTfUCcKqpcG9HXY11TXWKCEUQiK1tkb0o7oSSURwk6h1DdDbg8m1+H8s+k+mvMvcqVCYKYi03PIPQyJCuHmzx/vcaALXRr2HOrEFaFFA8WYST1rywiKeyrC9PCNX1aJjGADhCs3cGrdZEJc4k+2tIHTYJccx+mJ96QiEkzFhJTqEmSFPcNqNUX9uCPgeVhfHW2pRNyffvrhoEyeSr1QoOpaYyn0I5JD2axnypBFCbk6P69LY3eGNKtOe81lp9hiZbMYpXPqb6KwPXTVQQIDAQABAoIBAEbJQm276MaR2uZWK4f84S12JW5iaQZw2QGgiTIXbQkcdqRHawF3uPafhhQ0ynXU5MgBR2NqGRQasimbfLUXhgZ4wueBpUKuvOLhfekaz/YN8qy6ZsXH+TGN6/x6BYu9rSiiC+YmkZmOZgGkQqrfxJ3lU4+lRuCFZOzAJ5mYn652CHRJXy6eDgZfyFLP2ol4/ioJEhwnGFXV345DlsVgmXTEe+IfjTyuvzxBtjod4lfu3dj/f2PhPrcgvN0ZQf1ldZbS+6FkMWInMOQt/WsJ/ANfiKgQ4sPzlxIhmVjrvDlnYTc1lbFekyInzZumV0pDyId+1Y6LAjxJTAhnjFAlBSECgYEAwsQdxOiZNLtxZ8J8JCQHKERYIo7euArW0iAurF+3Q9VNeGj0voFrmfHPju5OF5BHtuc7D3lkwZG4Ac+pyQtxF5dsEMl4vBoNc6onRQFsSDVEEIpl7OBghGlg1as23tvPSMh7DKnILM9OzVfFQ9WLvwHJwLRGsM7LOtmNovq4UFsCgYEA7dE/9Avr5YtCUjij8Y2zkAxN6qb8+ggqFoPiCr91JNGaKNKV9D2K7D3Zk49TXFJm7SX2zgYFuqR2Pa9vAWh9jtmwsc8L0qpIym4J1MM5ud/Xiu9c8O/prQOr7JlICNdk8WfqGbUC83BYfWa5SDonlXFYi6x3LlXdZnvEfZF645MCgYAC2ZnR6tFrGx8StJ7abIiKR02+27ZYnRf9pSjprtDgtjtW+royG3S2oPo3jjcoUx0piQKtPEqEJpy5sg86+ObjwHx9VmVk40C1I5VFhjrOZ7EiSNQq/jGLXntjRQkdg7vpxb0/NzDNrw7pJFKnpnVQCzenkTvDlJMWvl47N04BJwKBgHnpVtuIcPlPFkSH/KMLfQ1PAXJVAEI8hTbdjLbtxuOE/34F1hFKqzjHzA2034roQxM27vpWZAF15Zdho4oZQqREPCwqc2kfGgmLt0Z2fdUnRptWcVKh6ixjQXMccKz3niuSlZNwE38wDGzciAbaqQgW/sk7NC1wnvq2X9fvCAw5AoGANG2usqWYF4x+LvbhcdrKpJsjtvkLa2u9g2/wNXdoj+tBrv310O22/YM5LOcq9MrKPlx1S1C1KLoQO9TWFZiYuQ9C/sk7/ZTNmKQxCxVV0FVPaBYp+meD6sjgoRVJvaqY0UxnJwlHWMrusPTFua7Mtogqx9cvzlQolWh5VX7N1DM=\n-----END RSA PRIVATE KEY-----",
         "callbackPublicKey":"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqFZfev75+sa7O0f29qwuWeqWRQ+p59c8hz2s4aeh5Ohc08P1ls5e8UmPhaN9ZTkGwabOKN658pOhmVoa16ldKFZQ5j1hLTDS6yfKcvVs/hf1mQvsbUjtZgCfMQx5NNf1R4MsTvAqbl2l6DXMu7gHjAhKNR0QQBELv7HmYuWPE35ELQqBH0eVcvWSNV3/3zOansftY5NIT749B+Bv1uirE8PNMp20sWWqx8fMNi2EZksnWNUmnVldBqUwMJIxcXolBH/RGX5ZjBlBenoIB3PVQ8/+SPz9Hip7+QNH8utSnUlrh2AsJVtdNKIQk74Eevkn+Q+WyUVGoY0ca9DzGwh4hQIDAQAB"
     },

+ 11 - 0
src/jfw/modules/subscribepay/src/resourcePack.json

@@ -0,0 +1,11 @@
+{
+	"product":{
+		"dataExportPack":"数据流量包",
+		"attachmentDownPack":"附件下载包"
+	},
+	"attachmentDownPackPrice":{
+		"5":1590,
+		"10":2990,
+		"20":4990
+	}
+}

+ 88 - 0
src/jfw/modules/subscribepay/src/service/basePack.go

@@ -0,0 +1,88 @@
+package service
+
+import (
+	. "api"
+	"entity"
+	"fmt"
+	"log"
+	qutil "qfw/util"
+	"qfw/util/jy"
+	"time"
+	"util"
+)
+
+//“包”的消费
+func (this *ResourcePack) ConsumePack() {
+	userId, _ := this.GetSession("userId").(string)
+	productName := this.GetString("productName")
+	rData, errMsg := func() (interface{}, string) {
+		if this.Method() != "POST" {
+			return nil, "请求方式有误"
+		}
+		platform := this.GetString("platform")
+		if productName == "" || this.GetString("id") == "" {
+			return nil, "参数有误"
+		}
+		remarks := map[string]interface{}{
+			"title":    this.GetString("title"),                                //详情页标题
+			"fileName": this.GetString("fileName"),                             //附件名称
+			"id":       qutil.DecodeArticleId2ByCheck(this.GetString("id"))[0], //详情页id
+		}
+		Ret, Msg, Code := entity.JyConsumePack(userId, productName, platform, remarks)
+		if Msg != "" && Code == 0 {
+			return nil, fmt.Sprintf("%s 使用异常:%s", productName, Msg)
+		}
+		if Code < 0 {
+			Ret = map[string]interface{}{"code": Code}
+		}
+		return Ret, ""
+	}()
+	if errMsg != "" {
+		log.Printf("%s %s RecordList 异常:%s\n", userId, productName, errMsg)
+	}
+	this.ServeJson(map[string]interface{}{
+		"r": rData,
+		"m": errMsg,
+	})
+}
+
+//“包”的使用记录
+func (this *ResourcePack) RecordList() {
+	userId, _ := this.GetSession("userId").(string)
+	productName := this.GetString("productName")
+	rData, errMsg := func() (interface{}, error) {
+		pageSize, _ := this.GetInteger("pageSize")
+		pageNum, _ := this.GetInteger("pageNum")
+		queryTime := this.GetString("queryTime")
+		platform := this.GetString("platform")
+		if this.Method() != "POST" {
+			return "请求方式有误", nil
+		}
+		if productName == "" || platform == "" {
+			return "参数有误", nil
+		}
+		vipMsg := jy.GetBigVipUserBaseMsg(userId, util.Mysql, util.MQFW)
+		if vipMsg.VipStatus <= 0 {
+			return "无权限,请联系管理员", nil
+		}
+		if queryTime == "" {
+			queryTime = time.Now().Format("2006-01")
+		}
+		total := 0
+		returnList, total, err := entity.JyFindRecordPack(userId, productName, queryTime, platform, pageSize, pageNum)
+		if err != nil {
+			return nil, err
+		}
+		returnData := map[string]interface{}{
+			"list": returnList,
+		}
+		if total != -1 {
+			returnData["total"] = total
+		}
+		return returnData, nil
+	}()
+	if errMsg != nil {
+		log.Printf("%s %s RecordList 异常:%s\n", userId, productName, errMsg.Error())
+	}
+	this.ServeJson(NewResult(rData, errMsg))
+}

+ 13 - 0
src/jfw/modules/subscribepay/src/service/payCallback.go

@@ -106,6 +106,10 @@ func (this *PayCallBackAction) TestPay() {
 		if entity.AreaPackPrice.PayCallBack(thisParam) {
 			success = true
 		}
+	case "附件下载包":
+		if entity.JyresoucePack.PayCallBack(thisParam) {
+			success = true
+		}
 	default:
 		typeFlag = "未知类型"
 	}
@@ -213,6 +217,11 @@ func (a *PayCallBackAction) AliPayCallback() {
 				log.Println("支付宝个人数据包支付回调更新执行出错 %+v\n", thisParam)
 				return false
 			}
+		} else if strings.HasPrefix(thisParam.OutTradeno, pay.ALI_FILEPACK_APP) || strings.HasPrefix(thisParam.OutTradeno, pay.ALI_FILEPACK_NATIVE) {
+			if !entity.JyresoucePack.PayCallBack(thisParam) {
+				log.Println("支付宝附件下载包支付回调更新执行出错 %+v\n", thisParam)
+				return false
+			}
 		} else {
 			log.Printf("支付宝支付完成回调 未知订单类型%s\n", thisParam.OutTradeno)
 		}
@@ -308,6 +317,10 @@ func (p *PayCallBackAction) WxPayCallback() {
 			if update = entity.AreaPackPrice.PayCallBack(thisParam); !update {
 				log.Printf("微信个人数据包支付回调更新执行出错 %+v\n", thisParam)
 			}
+		} else if strings.HasPrefix(thisParam.OutTradeno, pay.WX_FILEPACK_APP) || strings.HasPrefix(thisParam.OutTradeno, pay.WX_FILEPACK_JSAPI) || strings.HasPrefix(thisParam.OutTradeno, pay.WX_FILEPACK_NATIVE) { //附件下载包
+			if update = entity.JyresoucePack.PayCallBack(thisParam); !update {
+				log.Printf("微信附件下载包支付回调更新执行出错 %+v\n", thisParam)
+			}
 		} else {
 			log.Printf("微信支付完成回调 未知订单类型%s\n", thisParam.OutTradeno)
 		}

+ 180 - 0
src/jfw/modules/subscribepay/src/service/resourcePack.go

@@ -0,0 +1,180 @@
+package service
+
+import (
+	. "api"
+	"config"
+	"encoding/json"
+	"entity"
+	"fmt"
+	"log"
+	"pay"
+	qu "qfw/util"
+	"qfw/util/jy"
+	"strconv"
+	"time"
+	"util"
+
+	"github.com/go-xweb/xweb"
+)
+
+//资源包相关(数据流量包,附件下载包...)
+
+type ResourcePack struct {
+	*xweb.Action
+	createOrder xweb.Mapper `xweb:"/resourcePack/createOrder"` //线上自助数据包充值-创建订单
+	account     xweb.Mapper `xweb:"/resourcePack/account"`     //个人账户
+	recordList  xweb.Mapper `xweb:"/resourcePack/recordList"`  //“资源包”使用记录
+	consumePack xweb.Mapper `xweb:"/resourcePack/consumePack"` //“资源包”消费
+	price       xweb.Mapper `xweb:"/resourcePack/price"`       //价格
+}
+
+const (
+	METHOD = "POST"
+)
+
+type OrderResult struct {
+	Status    int    `json:"status"`     //返回状态 0失败 1成功
+	OrderCode string `json:"order_code"` //订单编号
+	Msg       string `json:"msg"`        //消息
+}
+
+// @Summary 创建订单api
+// @Param product产品类型【dataExportPack、attachmentDownPack】 TODO
+// @Success"{"status":1,"order_code":123456789,"msg":"创建成功"}"
+// @Router /jypay/ResourcePack/createOrder [post]
+func (this *ResourcePack) CreateOrder() {
+	defer qu.Catch()
+	if this.Method() != METHOD {
+		this.ServeJson(OrderResult{Msg: "请求方式有误"})
+		return
+	}
+	openId, _ := this.GetSession("s_m_openid").(string)
+	nickname, _ := this.GetSession("s_nickname").(string)
+	userId, _ := this.GetSession("userId").(string)
+	if userId == "" {
+		this.ServeJson(OrderResult{Msg: "未登录"})
+		return
+	}
+	infoMap := map[string]interface{}{}
+	if string(this.Body()) == "" {
+		this.ServeJson(OrderResult{Msg: "参数错误"})
+		return
+	}
+	body := xweb.FilterXSS(string(this.Body()))
+	//接收参数
+	json.Unmarshal([]byte(body), &infoMap)
+	if len(infoMap) == 0 {
+		this.ServeJson(OrderResult{Msg: "参数错误"})
+		return
+	}
+	//产品类型
+	product, _ := infoMap["product"].(string)
+	if config.ResConf.Product[product] == "" {
+		this.ServeJson(OrderResult{Msg: "请求产品类型有误"})
+		return
+	}
+	//
+	data, _ := infoMap["data"].(map[string]interface{})
+	if len(data) <= 0 {
+		this.ServeJson(OrderResult{Msg: "参数错误"})
+		return
+	}
+	lotteryId := qu.ObjToString(infoMap["lotteryId"])
+	discountId := qu.ObjToString(infoMap["discountId"])
+	i_discountId, _ := strconv.Atoi(discountId)
+	filter, msg := entity.JyresoucePack.Filter(product, userId, lotteryId, discountId, data)
+	//错误信息
+	if msg != "" {
+		this.ServeJson(OrderResult{Msg: msg})
+		return
+	}
+	//生成订单号
+	orderCode := pay.GetOrderCode(userId)
+	order_phone := qu.ObjToString(infoMap["order_phone"])
+	now := time.Now()
+	filterStr, _ := json.Marshal(filter.Filter)
+	orderid := util.Mysql.Insert("dataexport_order", map[string]interface{}{
+		"order_money":    filter.OrderMoney,
+		"order_status":   0,
+		"service_status": 0,
+		"user_nickname":  nickname,
+		"user_openid":    openId,
+		"user_phone":     order_phone,
+		"order_code":     orderCode,
+		"product_type":   config.ResConf.Product[product],
+		"create_time":    qu.FormatDate(&now, qu.Date_Full_Layout),
+		"original_price": filter.Price,
+		"filter":         string(filterStr),
+		"user_id":        userId, //20190719 移动端数据导出 生订单添加用户id
+		"discount_price": filter.DiscountPrice,
+		"d_relation_id":  filter.UserLotteryId,
+	})
+	if orderid <= 0 {
+		this.ServeJson(OrderResult{Msg: "创建订单异常"})
+		return
+	}
+	//绑定核销卡券
+	if filter.UserLotteryId != "" && lotteryId != "" {
+		go func(userId, userLotteryId, orderCode string, i_discountId int) {
+			phone, nickname := util.GetMyPhoneAndName(userId)
+			if !util.UpdateCouponState(userId, userLotteryId, nickname, phone, orderCode, config.ResConf.Product[product], strconv.Itoa(i_discountId), 3, 0) {
+				log.Println(fmt.Sprintf("单号%s-绑定失败-卡卷%s", orderCode, userLotteryId))
+			}
+			if i_discountId > 0 {
+				if ulid := util.FindUserLotteryId(userId, orderid, i_discountId); ulid != 0 {
+					userLotteryId = strconv.Itoa(ulid)
+				}
+			}
+		}(userId, filter.UserLotteryId, orderCode, i_discountId)
+	}
+	this.ServeJson(OrderResult{OrderCode: orderCode, Status: 1})
+	return
+
+}
+
+// @Summary 账户信息
+// @Param product产品类型【dataExportPack、attachmentDownPack】
+// @Success"{"status":1,"order_code":123456789,"msg":"创建成功"}"
+// @Router /jypay/resourcePack/account [post]
+func (this *ResourcePack) Account() {
+	defer qu.Catch()
+	if this.Method() != METHOD {
+		this.ServeJson(Result{Error_msg: "请求方式有误"})
+		return
+	}
+	userId, _ := this.GetSession("userId").(string)
+	if userId == "" {
+		this.ServeJson(Result{Error_msg: "未登录"})
+		return
+	}
+	product := this.GetString("product")
+	if config.ResConf.Product[product] == "" {
+		this.ServeJson(Result{Error_msg: "参数错误"})
+		return
+	}
+	vipMsg := jy.GetBigVipUserBaseMsg(userId, util.Mysql, util.MQFW)
+	if vipMsg.VipStatus <= 0 {
+		this.ServeJson(Result{Error_msg: "无权限,请联系管理员"})
+		return
+	}
+	dbs := &entity.FindBalanceStruct{
+		AccountId:    userId,
+		ResourceType: config.ResConf.Product[product],
+	}
+	data, err := dbs.FindBalance()
+	if err != nil {
+		this.ServeJson(Result{Error_msg: "获取失败"})
+		return
+	}
+	this.ServeJson(Result{Data: data})
+}
+
+func (this *ResourcePack) Price() {
+	product := this.GetString("product")
+	switch product {
+	case "attachmentDownPack":
+		this.ServeJson(Result{Data: config.ResConf.AttachmentDownPackPrice})
+		return
+	}
+	this.ServeJson(Result{Error_msg: "参数错误"})
+}

+ 4 - 0
src/jfw/modules/subscribepay/src/timetask/timetask.go

@@ -314,6 +314,10 @@ func checkIsExpire() {
 				go jy.ClearBigVipUserPower(_id)
 				log.Println("用户", _id, i_vip_status, l_vip_endtime, "修改已到期状态")
 				redis.Del("other", "p1_indexMessage_"+_id) //清除redis中vip状态
+				filePackKey := fmt.Sprintf(jy.FilePackNumKey, _id, fmt.Sprint(time.Now().Month()))
+				redis.Del(jy.PowerCacheDb, filePackKey) //清除redis中附件下载包次数
+				vipFileUploadNumKey := fmt.Sprintf(jy.VipFileUploadNumKey, _id, fmt.Sprint(time.Now().Month()))
+				redis.Del(jy.PowerCacheDb, vipFileUploadNumKey) //清除redis中vip使用次数
 			} else if l_vip_endtime-now_unix <= threeday && i_vip_expire_tip != 1 {
 				updateOk := util.MQFW.UpdateById("user", _id, map[string]interface{}{
 					"$set": map[string]interface{}{

+ 3 - 2
src/jfw/modules/subscribepay/src/util/coupon.go

@@ -17,6 +17,7 @@ import (
 func GetCouponInfo(userId, lotteryId, pCode string) (full, reduce int, discount float64, userLotteryId string) {
 	lttid := qutil.SE.Decode4Hex(lotteryId)
 	getUrl := fmt.Sprintf("%s?userId=%s&appId=%s&lotteryId=%s", config.CouponConfig.CouponInfo, userId, config.CouponConfig.AppId, lttid)
+	log.Println("url:", getUrl)
 	res, err := http.Get(getUrl)
 	if err != nil {
 		log.Println(err.Error())
@@ -49,7 +50,8 @@ func GetCouponInfo(userId, lotteryId, pCode string) (full, reduce int, discount
 				for _, pv := range useProductList {
 					//当前产品是否可用
 					productCode := strconv.FormatInt(qutil.Int64All(pv["productCode"]), 10) //104
-					if productCode == pCode || string([]rune(pCode)[:3]) == productCode {
+					// parentCode := strconv.FormatInt(qutil.Int64All(pv["parentCode"]), 10)
+					if productCode == pCode || string([]rune(pCode)[:3]) == productCode /*|| string([]rune(pCode)[:3]) == parentCode */ {
 						isExists = true
 						break
 					}
@@ -69,7 +71,6 @@ func GetCouponInfo(userId, lotteryId, pCode string) (full, reduce int, discount
 				endDate = thisTime.Unix()
 			}
 			//未开始 已结束 则不可用
-			log.Println(beginDate, "---", time.Now().Unix(), "---", endDate)
 			if beginDate > time.Now().Unix() || endDate < time.Now().Unix() {
 				isExists = false
 			}

+ 1 - 1
src/jfw/modules/subscribepay/src/a/jylog.go → src/jfw/modules/subscribepay/src/util/jylog.go

@@ -1,4 +1,4 @@
-package initxweb
+package util
 
 /**
 日志文件自动切换,默认保留15天内日志

+ 1 - 1
src/jfw/modules/subscribepay/src/util/msgremind.go

@@ -48,7 +48,7 @@ type unpaidOrder struct {
  *@param productType 产品类型
  */
 func (m *msgRemind) add(orderId, orderMoney, vipType, remindStatus int, orderCode, userId string, createTime int64, productType string) {
-	log.Println("未支付待提醒订单加入", orderId, orderCode, userId, createTime)
+	// log.Println("未支付待提醒订单加入", orderId, orderCode, userId, createTime)
 	m.unpaidOrders.Store(orderId, &unpaidOrder{
 		orderCode:    orderCode,
 		userId:       userId,

+ 37 - 0
src/jfw/modules/subscribepay/src/util/rpc.go

@@ -0,0 +1,37 @@
+package util
+
+import (
+	"config"
+	"log"
+	"net/rpc"
+	"qfw/util"
+)
+
+type JyFileRequest struct {
+	InfoId string
+}
+
+type JyFileResponse struct {
+	Rep []map[string]interface{}
+}
+
+//附件下载
+func Attachment(am *JyFileRequest) (rep *JyFileResponse, err error) {
+	util.Try(func() {
+		client, e := rpc.DialHTTP("tcp", config.BidfileConfig.AttachmentRPC)
+		defer client.Close()
+		if e != nil {
+			err = e
+			log.Println(err.Error())
+			return
+		}
+		err = client.Call("JyService.Download", am, &rep)
+		if err == nil && rep != nil {
+			return
+		}
+		if err != nil {
+			log.Println(err.Error())
+		}
+	}, func(e interface{}) {})
+	return
+}

+ 9 - 4
src/web/staticres/common-module/coupon/js/coupon-template.js

@@ -103,8 +103,8 @@ Vue.component('coupon-list', {
     toUseFn: function (coupon) {
       var id = coupon.lotteryId
       var str = coupon.products
-      /* 
-        1.判断是wx还是app 
+      /*
+        1.判断是wx还是app
         2.判断该优惠券是适用单产品还是多产品,多产品跳选择产品列表页面;单产品(超级订阅)新用户跳购买页面,老用户跳订阅设置首页.
       */
       var isWeiXinBrowser = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
@@ -112,6 +112,7 @@ Vue.component('coupon-list', {
       var isSingleVip = this.getSinglePro(str, '超级订阅'); // 是否单超级订阅优惠券
       var isSingleAreaPack = this.getSinglePro(str, '省份订阅包'); // 是否单省份订阅包优惠券
       var isSingleCourse = this.getSinglePro(str, 'jyxsapp'); // 是否单省份订阅包优惠券
+      var isSingleFile = this.getSinglePro(str, '附件下载包');
       if (isWeiXinBrowser) {
         // 是否单超级订阅优惠券
         if (isSingleVip) {
@@ -129,6 +130,8 @@ Vue.component('coupon-list', {
           }
         } else if (isSingleCourse) {
           location.href = '/jyxsapp/';
+        } else if (isSingleFile) {
+          location.href = '/swordfish/filePack/createOrder'
         } else {
           location.href = '/weixin/frontPage/coupon/free/selectProduct?couponId=' + id;
         }
@@ -147,6 +150,8 @@ Vue.component('coupon-list', {
           }
         } else if (isSingleCourse) {
           location.href = '/jyxsapp/?source=app_kongkim'
+        } else if (isSingleFile) {
+          location.href = '/jyapp/filePack/createOrder'
         } else {
           location.href = '/jyapp/frontPage/coupon/free/selectProduct?couponId=' + id;
         }
@@ -190,7 +195,7 @@ Vue.component('coupon-list', {
           }
         }
       })
-      
+
     },
     changeRadio: function (item){
       this.couponList.forEach(function(v){
@@ -200,4 +205,4 @@ Vue.component('coupon-list', {
       this.$emit('child-select-coupon', item)
     }
   }
-})
+})

+ 9 - 0
src/web/staticres/common-module/coupon/js/pay-order-template.js

@@ -352,6 +352,15 @@ var couponTem = {
         case 'areaPack-1year':
           id = 1133
           break;
+        case 'filePack-1':
+          id = 1141
+          break;
+        case 'filePack-2':
+          id = 1142
+          break;
+        case 'filePack-3':
+          id = 1143
+          break;
       }
       return id;
     },

BIN
src/web/staticres/common-module/file-pack/images/icon-down-gray.png


BIN
src/web/staticres/common-module/file-pack/images/icon-down.png


BIN
src/web/staticres/common-module/file-pack/images/icon-rar.png


BIN
src/web/staticres/common-module/file-pack/images/icon-word.png


+ 746 - 0
src/web/staticres/common-module/file-pack/js/buy.js

@@ -0,0 +1,746 @@
+var vm = new Vue({
+  delimiters: ['${', '}'],
+  el: '#app',
+  data: function () {
+    return {
+      endTime: '',
+      endDay: -1,
+      sessKey: '$data-file-pack-buy',
+      preferentialShow: false,
+      specTitleShow: false,
+      buyType: 'buy', // buy购买, renew续费, upgrade升级
+      userInfo: {
+        phone: ''
+      },
+      // 已经购买的信息
+      alreadyBuyInfo: {
+        loaded: false,
+        ppstart: 0,
+        ppend: 0,
+        areanum: 0, // 可调整地区次数
+        provincenum: 0, // 已购买省份数量
+        area: {},
+        simulatedAmount: false, // 模拟金额(购买时候进入,省份数量不足购买条件,默认展示1个月价格)
+      },
+      // 选择的省份数量
+      areaInfo: '', // 空字符串或者null表示未选择省份,空对象表示全国/provinceMaxCount
+      priceInfo: {
+        provinceFreeCount: 1, // 免费省份数量
+        provinceMaxCount: 15, // 选择的大于15表示全国
+        month: {}
+      },
+      priceMap: {},
+      specActive: 1,
+      specList: [
+        {
+          cycleType: 1, // 月
+          label: '5个附件',
+          value: '1',
+          price: 0,
+          desc: '',
+          perDayPrice: 0,
+          productId: 1141,
+          id: 5
+        },
+        {
+          cycleType: 2, // 季
+          label: '10个附件',
+          value: '2',
+          price: 0,
+          desc: '',
+          perDayPrice: 0,
+          productId: 1142,
+          id: 10
+        },
+        {
+          cycleType: 3, // 年
+          label: '20个附件',
+          value: '3',
+          price: 0,
+          desc: '',
+          perDayPrice: 0,
+          productId: 1143,
+          id: 20
+        }
+      ],
+      bottomConf: {
+        type: '',
+        initPrice: 0,
+        realPrice: 0,
+        disPrice: 0,
+        checkboxStatus: false,
+        hideCoupon: false,
+        links: [
+          {
+            text: '《剑鱼标讯线上购买与服务条款》',
+            url: '',
+            event: this.readEvent
+          }
+        ],
+        buttons: {
+          submit: this.submitOrder
+        }
+      },
+      dialog: {
+        backTip: false,
+        backTipShowCount: 0
+      }
+    }
+  },
+  computed: {
+    buyTypeText: function () {
+      if (this.buyType === 'upgrade') {
+        return '升级'
+      } else if (this.buyType === 'renew') {
+        return '续费'
+      } else {
+        return '购买'
+      }
+    },
+    perMonthArea: function () {
+      var info = this.priceInfo
+      if (!info.month) return 0
+      if (!info.month.oneProvince_allBuyerClass) return 0
+      return info.month.oneProvince_allBuyerClass / 100
+    },
+    selectAreaText: function () {
+      var text = ''
+      if (this.areaInfo) {
+        var keys = Object.keys(this.areaInfo)
+        if (keys.length) {
+          text = keys.join('、')
+        } else {
+          text = '全国'
+        }
+      }
+      return text
+    },
+    // 选中的省份数量
+    selectAreaCount: function () {
+      var count = 0
+      if (this.areaInfo) {
+        var keyLength = Object.keys(this.areaInfo).length
+        if (keyLength === 0 || keyLength > this.priceInfo.provinceMaxCount) {
+          count = -1 // -1表示全国
+        } else {
+          count = keyLength
+        }
+      }
+      return count
+    },
+    buyAreaText: function () {
+      var buyAreaCount = this.buyAreaCount
+      if (buyAreaCount === -1) {
+        return '全国'
+      } else {
+        return (buyAreaCount >= 0 ? buyAreaCount : 0) + ' 个省'
+      }
+    },
+    // 购买的省份数量 = 选中数量 - 免费数量
+    buyAreaCount: function () {
+      if (this.buyType === 'renew') {
+        return this.renewAreaCount
+      } else {
+        var selectCount = this.selectAreaCount
+        if (selectCount === -1) {
+          return selectCount
+        } else {
+          var buyCount = selectCount - this.priceInfo.provinceFreeCount
+          return buyCount >= 0 ? buyCount : 0
+        }
+      }
+    },
+    renewAreaCount: function () {
+      var buyCount = this.alreadyBuyInfo.provincenum
+      if (buyCount) {
+        return buyCount
+      } else {
+        return 0
+      }
+    },
+    upgradeAreaText: function () {
+      if (this.upgradeAreaCount === -1) {
+        return '全国'
+      } else {
+        return this.upgradeAreaCount + '个省'
+      }
+    },
+    // 升级数量 = 选中数量 - 已购买数量 - 免费数量
+    upgradeAreaCount: function () {
+      var alreadyBuyCount = this.getAlreadyBuyCount()
+      return this.selectAreaCount - alreadyBuyCount - this.priceInfo.provinceFreeCount
+    },
+    // 选中的规格卡片info
+    selectedSpecItem: function () {
+      var _this = this
+      var t = {}
+      this.specList.some(function (item) {
+        var gotThis = item.cycleType == _this.specActive
+        if (gotThis) {
+          t = item
+        }
+        return gotThis
+      })
+      return t
+    },
+    // 手机号校验是否通过
+    validatorPhonePass: function () {
+      var phone = this.userInfo.phone
+      if (!phone) return true
+      return /^1\d{10}$/.test(phone)
+    },
+  },
+  watch: {
+    validatorPhonePass: function () {
+      this.checkStatus()
+    },
+  },
+  created: function () {
+    this.getVipEndTime()
+  },
+  mounted: function () {
+    var restore = this.restoreState()
+    if (restore) {
+      this.getPrice()
+    } else {
+      this.getGoodsList()
+      this.getUserInfo()
+      this.getGiftInfo()
+    }
+    this.setTitle()
+    this.checkConfirmButtonDisabled()
+    utils.iosBackRefresh()
+    // if (this.buyType === 'buy') {
+    //   this.addBackTip()
+    // }
+  },
+  methods: {
+    getMonthEndTime: function (date) {
+      var tempDate = new Date(date)
+      let month = tempDate.getMonth()
+      var new_year = tempDate.getFullYear(); //取当前的年份
+      var new_month = ++month; //取下一个月的第一天,方便计算(最后一天不固定)
+      if (month > 12) {
+        new_month -= 12; //月份减
+        new_year++; //年份增
+      }
+      var new_date = new Date(new_year, new_month, 1); //取当年当月中的第一天
+      return (new Date(new_date.getTime() - 1000));
+    },
+    getDayDiff: function (date1, date2, unit) {
+      var myDate1 = typeof date1 === 'string' && date1.includes('-') ? date1.replace(/-/g, '/') : date1;
+      var myDate2 = typeof date2 === 'string' && date2.includes('-') ? date2.replace(/-/g, '/') : date2;
+      var map = {
+        day: 1000 * 60 * 60 * 24,
+        hour: 1000 * 60 * 60,
+        minute: 1000 * 60,
+        second: 1000,
+        ms: 1,
+      };
+      return ((new Date(myDate2) - new Date(myDate1)) / (map[unit]));
+    },
+    getEndTime: function (vipEndTime) {
+      var nowDate = new Date().getTime()
+      var monthEndDate = this.getMonthEndTime(nowDate)
+      if (vipEndTime) {
+        var vipEndDate = new Date(vipEndTime)
+        if (vipEndDate.getTime() < monthEndDate.getTime()) {
+          monthEndDate = vipEndDate
+        }
+      }
+      var diffDay = this.getDayDiff(nowDate, monthEndDate.getTime(), 'day')
+      const result = Math.ceil(diffDay)
+      this.endTime = monthEndDate.pattern('yyyy.MM.dd')
+      this.endDay = result
+    },
+    getVipEndTime: function () {
+      $.ajax({
+        url: '/subscribepay/vipsubscribe/getSubBuyMsg',
+        type: 'GET',
+        success: function (res) {
+          console.log(res)
+          if (res && res.data && res.data.endTime) {
+            this.getEndTime(res.data.endTime * 1000)
+          }
+        }.bind(this)
+      })
+    },
+    showLoading: function () {
+      return this.$toast.loading({
+        duration: 0,
+        forbidClick: true,
+        message: 'loading...',
+      })
+    },
+    showToast: function (message) {
+      return this.$toast({
+        duration: 1500,
+        forbidClick: true,
+        message: message,
+      })
+    },
+    showDialog: function (conf) {
+      var defaultConf = {
+        title: '提示',
+        message: 'message',
+        className: 'j-confirm-dialog',
+        showConfirmButton: true,
+        showCancelButton: true,
+        confirmButtonColor: '#2abed1'
+      }
+      if (conf) {
+        Object.assign(defaultConf, conf)
+      }
+      return this.$dialog.confirm(defaultConf)
+    },
+    setTitle: function () {
+      var titleMap = {
+        buy: '附件下载包充值',
+        renew: '续费省份订阅包',
+        upgrade: '升级省份订阅包',
+      }
+      var title = titleMap[this.buyType]
+      document.title = title
+      try {
+        setHeaderTitle(title)
+      } catch (error) {}
+    },
+    getUrlArea: function () {
+      var area = utils.getParam('area')
+      if (area) {
+        var areaInfo = JSON.parse(decodeURIComponent(area))
+        if (!Array.isArray(areaInfo)) {
+          this.areaInfo = areaInfo
+        }
+      }
+    },
+    getAlreadyBuyCount: function () {
+      var buyInfo = this.alreadyBuyInfo
+      if (!buyInfo) return 0
+      if (!buyInfo.provincenum) return 0
+      return buyInfo.provincenum
+    },
+    // 获取用户信息
+    getUserInfo: function () {
+      var _this = this
+      $.ajax({
+        url: '/jypay/user/getAccountInfo?t=' + Date.now(),
+        type: 'GET',
+        success: function (res) {
+          if (res && res.error_code === 0) {
+            Object.assign(_this.userInfo, res.data)
+          }
+        }
+      })
+    },
+    getGoodsList: function () {
+      var _this = this
+      var loading = this.showLoading()
+      $.ajax({
+        url: '/jypay/resourcePack/price',
+        type: 'POST',
+        data: {
+          'product': 'attachmentDownPack'
+        },
+        success: function (res) {
+          loading && loading.clear()
+          if (res && res.data) {
+
+            Object.assign(_this.priceMap, res.data)
+            // _this.getBuyInfo()
+            _this.getPrice()
+          }
+        },
+        error: function () {
+          loading && loading.clear()
+        }
+      })
+    },
+    // 获取已购买信息
+    getBuyInfo: function () {
+      var _this = this
+      var loading = this.showLoading()
+      $.ajax({
+        url: '/publicapply/free/subscribe',
+        type: 'POST',
+        success: function (res) {
+          loading && loading.clear()
+          _this.alreadyBuyInfo.loaded = true
+          if (res && res.error_code === 0) {
+            // _this.checkBuyStatus(res.data)
+            for (var key in res.data) {
+              _this.$set(_this.alreadyBuyInfo, key, res.data[key])
+            }
+            _this.getUrlArea()
+            if (!_this.areaInfo) {
+              _this.$set(_this, 'areaInfo', res.data.area)
+            }
+            _this.getPrice()
+          }
+        },
+        error: function () {
+          loading && loading.clear()
+          _this.getPrice()
+          _this.alreadyBuyInfo.loaded = true
+        }
+      })
+    },
+    // 检查是否满足购买/续费/升级的条件
+    checkBuyStatus: function (data) {
+      if (!data) return
+      var buyCount = data.provincenum
+      if (buyCount === -1) {
+        if (this.buyType !== 'renew') {
+          this.buyType === 'renew'
+        }
+      }
+    },
+    // 获取赠品信息
+    getGiftInfo: function () {
+      var _this = this
+      this.specList.forEach(function (spec) {
+        $.ajax({
+          url: '/jyCoupon/giveInfo',
+          type: 'POST',
+          data: {
+            useProduct: spec.productId,
+            useProductType: 0
+          },
+          success: function (res) {
+            if (res && res.error_code === 0) {
+              _this.$set(spec, 'giftList', res.data)
+              _this.renderGiftInfo(spec)
+            }
+          }
+        })
+      })
+    },
+    renderGiftInfo: function (spec) {
+      var price = spec.price
+      var giftContent = this.calcGiftInfo(spec.giftList)
+      // 赠品信息展示
+      if (giftContent && price) {
+        var labelSubInfo = `&nbsp&nbsp<span class="highlight-text">赠${giftContent.giveTimeText}</span>`
+        this.$set(spec, 'labelSubInfo', labelSubInfo)
+        this.$set(spec, 'discountId', giftContent.discountId)
+      } else {
+        this.$set(spec, 'labelSubInfo', '')
+        this.$set(spec, 'discountId', '')
+      }
+    },
+    calcGiftInfo: function (infoList) {
+      if (!Array.isArray(infoList) || infoList.length === 0) return
+      var info = infoList[0]
+      var timeType = ''
+      if (info.timeType == 1) {
+        timeType = '天'
+      } else if (info.timeType == 2) {
+        timeType = '月'
+      }
+      return {
+        discountId: info.discountId,
+        giveTimeText: `${info.time}${timeType}`
+      }
+    },
+    // 通用计算价格方法
+    commonGetPrice: function (buyAreaCount, cycleType) {
+      var info = this.priceInfo
+      var isGreaterThanMaxArea = buyAreaCount === -1 // 是否购买全国
+      var priceInfo = {
+        price: 0,
+        perDayPrice: 0
+      }
+
+      switch (cycleType) {
+        // 1个月
+        case 1: {
+          var monthPriceFen = isGreaterThanMaxArea ? info.month.allProvince_allBuyerClass : info.month.oneProvince_allBuyerClass * buyAreaCount
+          priceInfo.price = monthPriceFen / 100
+          priceInfo.perDayPrice = buyAreaCount === 0 ? 0 : (priceInfo.price / 30).toFixed(2)
+          break
+        }
+        // 1个季度
+        case 2: {
+          var quarterPriceFen = isGreaterThanMaxArea ? info.quarter.allProvince_allBuyerClass : info.quarter.oneProvince_allBuyerClass * buyAreaCount
+          priceInfo.price = quarterPriceFen / 100
+          priceInfo.perDayPrice = buyAreaCount === 0 ? 0 : (priceInfo.price / (30 * 3)).toFixed(2)
+          break
+        }
+        // 1年
+        case 3: {
+          var yearPriceFen = isGreaterThanMaxArea ? info.year.allProvince_allBuyerClass : info.year.oneProvince_allBuyerClass * buyAreaCount
+          priceInfo.price = yearPriceFen / 100
+          priceInfo.perDayPrice = buyAreaCount === 0 ? 0 : (priceInfo.price / 365).toFixed(2)
+          break
+        }
+        default: {
+          return priceInfo
+        }
+      }
+
+      return priceInfo
+    },
+    getUpgradePrice: function () {
+      var buyInfo = this.alreadyBuyInfo
+      // 获取剩余周期
+      var lastCycle = getDateSub(buyInfo.ppstart, buyInfo.ppend)
+      var lastYear = lastCycle[0]
+      var lastMonth = lastCycle[1]
+      console.log(`剩余周期:年:${lastYear},月:${lastMonth}`)
+
+      var beforePrice = 0
+      var newPrice = 0
+
+      var oldBuyAreaCount = this.alreadyBuyInfo.provincenum
+      var newBuyAreaCount = this.buyAreaCount
+
+      if (lastMonth !== 0) {
+        beforePrice += this.commonGetPrice(oldBuyAreaCount, this.specList[0].cycleType).price * lastMonth * 100
+        newPrice += this.commonGetPrice(newBuyAreaCount, this.specList[0].cycleType).price * lastMonth * 100
+      }
+
+      if (lastYear !== 0) {
+        beforePrice += this.commonGetPrice(oldBuyAreaCount, this.specList[2].cycleType).price * lastYear * 100
+        newPrice += this.commonGetPrice(newBuyAreaCount, this.specList[2].cycleType).price * lastYear * 100
+      }
+
+      var priceDiff = (newPrice - beforePrice) / 100
+      console.log('差价:' + priceDiff)
+      return priceDiff >= 0 ? priceDiff : 0
+    },
+    getPrice: function () {
+      this.sortPrice()
+      this.calcPrice()
+    },
+    // 根据请求返回值,计算卡片展示金额
+    sortPrice: function () {
+      var priceInfoArr = []
+
+      this.specList.forEach(function (spec) {
+        spec.price = this.priceMap[spec.id] / 100
+        this.renderGiftInfo(spec)
+      }.bind(this))
+      return priceInfoArr
+    },
+    // 计算支付总金额
+    calcPrice: function () {
+      var p = 0
+      if (this.buyType === 'buy' || this.buyType === 'renew') {
+        // 获取被选中的规格卡片info
+        var specItem = this.selectedSpecItem
+        this.bottomConf.type = 'filePack-' + specItem.value
+        p = specItem.price
+      } else {
+        p = this.getUpgradePrice()
+      }
+      this.updatePrice(p)
+    },
+    clickSpec: function (item) {
+      this.specActive = item.cycleType
+      this.calcPrice()
+    },
+    addBackTip: function () {
+      var _this = this
+      var pushContent = {
+        info: '购买省份订阅包返回',
+        url: '#tip'
+      }
+      if (!history.state && this.dialog.backTipShowCount < 1) {
+        history.pushState(pushContent, null, pushContent.url);
+      }
+      $(window).on('popstate', function () {
+        _this.dialog.backTip = true
+        _this.dialog.backTipShowCount++
+      })
+    },
+    toBuyArea: function () {
+      if (this.buyType === 'renew') return
+      this.savePageState()
+      location.href = './buy_area'
+    },
+    updateS: function (data) {
+      var check = data.check
+      var callback = data.callback
+      callback(this.checkSubmitStatus(check))
+    },
+    checkSubmitStatus: function (checkStatus) {
+      this.bottomConf.checkboxStatus = checkStatus
+      return checkStatus && this.validatorPhonePass && this.bottomConf.initPrice && !this.alreadyBuyInfo.simulatedAmount
+    },
+    // 保证mounted之后执行
+    checkConfirmButtonDisabled: function () {
+      var status = this.bottomConf.checkboxStatus && this.validatorPhonePass && this.bottomConf.initPrice && !this.alreadyBuyInfo.simulatedAmount
+      this.$refs.couponRef.submitStatus = !status
+    },
+    // 调用此方法,即可检测当前页面表单是否满足条件(可计算出提交按钮是否可用)
+    checkStatus: function () {
+      // 此处取反,因为在调用couponRef.chooseCheckbox时候,会对checkbox再次取反
+      this.bottomConf.checkboxStatus = !this.bottomConf.checkboxStatus
+      this.$refs.couponRef.chooseCheckbox()
+    },
+    readEvent: function () {
+      this.saveState()
+      if (utils.isWeiXinBrowser) {
+        location.href = '/front/staticPage/wx-serviceterms.html'
+      } else {
+        location.href = '/jyapp/front/staticPage/dataExport_serviceterms.html'
+      }
+    },
+    submitOrder: function () {
+      var _this = this
+      var loading = this.showLoading()
+      var data = {
+        "product":"attachmentDownPack",
+        "data":{
+          "num": this.selectedSpecItem.id
+        },
+        order_phone: this.userInfo.phone,
+        lotteryId: this.$refs.couponRef.coupon.lotteryId,
+        useProduct: this.$refs.couponRef.getProductId(),
+        disWord: utils.getParam('disWord'),
+        discountId: this.selectedSpecItem.discountId
+      }
+      $.ajax({
+        url: '/jypay/resourcePack/createOrder',
+        contentType: "application/json;charset=UTF-8",
+        dataType: "json",
+        type: "post",
+        processData: false,
+        data: JSON.stringify(data),
+        success: function (res) {
+          loading && loading.clear()
+          if (res.status === 1) {
+            if (res.order_code) {
+              if (utils.isWeiXinBrowser) {
+                history.replaceState({}, '', '/weixin/common/filePack/orderDetail?order_code=' + res.order_code);
+                location.href = '/weixin/pay/checkout_filePack?orderCode=' + res.order_code
+              } else {
+                history.replaceState({}, '', '/jyapp/common/filePack/orderDetail?order_code=' + res.order_code);
+                location.href = "/jyapp/pay/checkout_filePack?orderCode=" + res.order_code + '&from=' + _this.buyType
+              }
+            } else {
+              _this.showToast(res.msg)
+            }
+          } else {
+            if (res.msg) {
+              _this.showToast(res.msg)
+            } else {
+              _this.showToast('请稍后重试')
+            }
+          }
+        },
+        error: function () {
+          loading && loading.clear()
+        }
+      })
+    },
+    afterUpdateCoupon: function (coupon) {
+      // console.log('券后价:', this.$refs.couponRef.realPrice)
+    },
+    updatePrice: function (before) {
+      // console.trace()
+      this.bottomConf.initPrice = before;
+      this.$refs.couponRef.getCoupon()
+    },
+    restoreState: function () {
+      var $data = sessionStorage.getItem(this.sessKey)
+      if ($data) {
+        $data = JSON.parse($data)
+
+        Object.assign(this.dialog, $data.dialog)
+        this.$set(this, 'alreadyBuyInfo', $data.alreadyBuyInfo)
+        this.$set(this, 'areaInfo', $data.areaInfo)
+        this.$set(this, 'priceMap', $data.priceMap)
+        Object.assign(this.priceInfo, $data.priceInfo)
+        Object.assign(this.userInfo, $data.userInfo)
+        this.specActive = $data.specActive
+        this.giftInfo = $data.giftInfo
+        Object.assign(this.specList, $data.specList)
+        Object.assign(this.bottomConf, $data.bottomConf)
+
+        sessionStorage.removeItem(this.sessKey)
+      }
+      return !!$data
+    },
+    saveState: function () {
+      this.savePageState()
+      this.saveSubmitComponentState()
+    },
+    savePageState: function () {
+      var data = {
+        dialog: this.dialog,
+        alreadyBuyInfo: this.alreadyBuyInfo,
+        areaInfo: this.areaInfo,
+        priceInfo: this.priceInfo,
+        userInfo: this.userInfo,
+        specActive: this.specActive,
+        giftInfo: this.giftInfo,
+        specList: this.specList,
+        bottomConf: {
+          initPrice: this.bottomConf.initPrice,
+          realPrice: this.bottomConf.realPrice,
+          disPrice: this.bottomConf.disPrice,
+          checkboxStatus: this.bottomConf.checkboxStatus
+        },
+        priceMap: this.priceMap
+      }
+      sessionStorage.setItem(this.sessKey, JSON.stringify(data))
+    },
+    saveSubmitComponentState: function () {
+      this.$refs.couponRef.saveSelectedCoupon()
+    }
+  }
+})
+
+// 计算时间间隔差函数 [年个数, 月个数]
+function getDateSub (start, end) {
+  let startTime = new Date(start * 1000);
+  let endTime = new Date(end * 1000);
+
+  let startYear = startTime.getFullYear();
+  let startMonth = startTime.getMonth();
+  let startDay = startTime.getDate();
+
+  let endYear = endTime.getFullYear();
+  let endMonth = endTime.getMonth();
+  let endDay = endTime.getDate();
+
+  let finalMonthNum = 0;
+  let finalYearNum = 0;
+  if (startYear === endYear) {
+    if (startMonth === endMonth) {
+      finalMonthNum = 1;
+    } else {
+      if (endDay > startDay) {
+        finalMonthNum = endMonth - startMonth + 1;
+      } else {
+        finalMonthNum = endMonth - startMonth;
+      }
+    }
+  } else {
+    if (startMonth === endMonth) {
+      if (endDay <= startDay) {
+        finalMonthNum = (endYear - startYear) * 12;
+      } else {
+        finalMonthNum = (endYear - startYear) * 12 + 1;
+      }
+    } else if (endMonth > startMonth) {
+        if (endDay <= startDay) {
+          finalMonthNum = (endYear - startYear) * 12 + (endMonth - startMonth);
+        } else {
+          finalMonthNum = (endYear - startYear) * 12 + (endMonth - startMonth) + 1;
+        }
+    } else {
+        if (endDay <= startDay) {
+          finalMonthNum = (endYear - startYear - 1) * 12 + (12 - startMonth + endMonth);
+        } else {
+          finalMonthNum = (endYear - startYear - 1) * 12 + (12 - startMonth + endMonth) + 1;
+        }
+    }
+    finalYearNum = Math.floor(finalMonthNum / 12);
+    if (finalYearNum > 0) {
+      finalMonthNum = finalMonthNum - finalYearNum * 12
+    }
+  }
+  return [finalYearNum, finalMonthNum]
+}

+ 319 - 0
src/web/staticres/common-module/file-pack/js/index-wx.js

@@ -0,0 +1,319 @@
+function getShortName (comName) {
+  var areaMap = chinaMapJSON || []
+  var shortname = comName
+  // 1. 循环省份城市进行替换
+  areaMap.forEach(function (item) {
+    var p = item.name.replace(/[省市]/, '')
+    if (shortname.indexOf(p) !== -1) {
+      shortname = shortname.replace(item.name, '').replace(p, '')
+      console.log(p + ' -> \'\'')
+    }
+    item.city.forEach(function (iitem) {
+      var c = iitem.name.replace(/[省市]/, '')
+      if (shortname.indexOf(c) !== -1) {
+        shortname = shortname.replace(iitem.name, '').replace(c, '')
+        console.log(c + ' -> \'\'')
+      }
+      iitem.area.forEach(function (iiitem) {
+        if (shortname.indexOf(iiitem) !== -1) {
+          shortname = shortname.replace(iiitem, '')
+          console.log(iiitem + ' -> \'\'')
+        }
+      })
+    })
+  })
+  var matchRes = shortname.match(/[\u4e00-\u9fa5]{4}/gm)
+  var shortname = matchRes ? matchRes[0] : shortname.slice(0, 4)
+  if (shortname.length < 4) {
+    shortname = shortname.slice(0, 4)
+  }
+  return shortname
+}
+
+function mySysIsIos() {
+  //ios终端
+  var flag1 = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
+  var flag2 = !!navigator.userAgent.match(/\(M[^;]+; Intel Mac OS X/);
+  return flag1 || flag2
+
+}
+
+function openFileDown (url) {
+  try {
+    if (!mySysIsIos() && /\.(jpeg|jpg|png)$/.test(url)) {
+      wx.previewImage({
+        current: url, // 当前显示图片的http链接
+        urls: [url] // 需要预览的图片http链接列表
+      })
+    } else {
+      location.href = url
+    }
+  } catch (e) {
+    console.log(e)
+    if (vm && typeof vm.$toast === 'function') {
+      vm.$toast("附件微信端打开失败,请联系客服!");
+    }
+  }
+}
+
+var formatter11 = (type, val) => {
+  if (type === 'year') {
+    return `${val}年`;
+  }
+  if (type === 'month') {
+    return `${val}月`;
+  }
+  return val;
+}
+
+var vm = new Vue({
+  el: '#proRecord',
+  delimiters: ['{', '}'],
+  data: function () {
+    return {
+      dValue: '',
+      pShow: false,
+      working: false,
+      empty: false,
+      curDate: '',
+      minDate: '',
+      maxTime: '',
+      points: {
+    	total: 0,
+		usage: 0
+      },
+      years: '',
+      months: '',
+      contracted: false,
+      listInfo: {
+        value: '',
+        pageNum: 1,
+        pageSize: 10,
+        total: -1,
+        loading: true,
+        finished: false
+      },
+      statusEnum: ['存续', '吊销', '停业', '撤销'],
+      statusColors: ['#2CB7CA', '#F5AF5C', '#58A1E7', '#51CEA2'],
+      list: [],
+      ptype:""
+    }
+  },
+  created: function () {
+      this.getPType("type")
+      this.years = new Date().getFullYear()
+      this.months = parseInt(new Date().getMonth() + 1)
+      this.dValue = this.years + '年' + this.months + '月'
+      this.curDate = new Date()
+      this.minDate = new Date(2021, 0)
+      this.maxTime = new Date(this.years, this.months - 1)
+      this.subPoint()
+      this.onLoad()
+    	this.initHtml()
+  },
+  methods: {
+	initHtml(){
+		if(this.ptype=="1"){
+			document.title = '采购单位画像记录'
+            typeof setHeaderTitle === 'function' ? setHeaderTitle(document.title) : null
+			$(".btns span").text("当月采购单位画像剩余数")
+			$(".emptytext").text("暂无采购单位画像记录")
+		}
+	},
+	getPType(paraName){
+      	let _this = this
+		var url = document.location.toString();
+	   var arrObj = url.split("?");
+	   if (arrObj.length > 1) {
+      	var arrPara = arrObj[1].split("&");
+      	var arr;
+      	for (var i = 0; i < arrPara.length; i++) {
+        	arr = arrPara[i].split("=");
+        	if (arr != null && arr[0] == paraName) {
+          	_this.ptype =  arr[1];
+        	}
+      	}
+    	}
+	},
+    usedHised() {
+      let _this = this
+      _this.pShow = true
+    },
+    subPoint() {
+      $.ajax({
+        url: '/jypay/resourcePack/account',
+        type: 'POST',
+        contentType: 'application/x-www-form-urlencoded',
+        data: {
+          product: 'attachmentDownPack'
+        },
+        dataType: 'json'
+      }).done(res => {
+          if (res.error_msg === '' && res.data && res.data.data) {
+            try {
+              var tempInfo = res.data.data[0]
+              this.points.total = tempInfo.number
+            } catch (e) {
+              console.warn(e)
+            }
+          } else {
+            this.$toast(res.error_msg || '请稍后重试')
+        }
+      })
+    },
+    onLoad () {
+      this.ajaxEntList().done(this.doFormatList.bind(this))
+    },
+    doFormatList (r) {
+      if (r && r.error_msg == '' && r.data) {
+    	this.points.usage = r.data.total
+        this.working = false
+        this.empty = true
+        if (this.listInfo.pageNum === 1) {
+          if (r.data.total || r.data.total === 0) {
+            this.listInfo.total = r.data.total
+          } else {
+            this.listInfo.finished = true
+          }
+        }
+        this.listInfo.pageNum++
+
+        if (Array.isArray(r.data.list) && r.data.list.length !== 0) {
+          this.list = this.list.concat(r.data.list.map(function (v) {
+            var isDoc = /.doc(x{0,})$/.test(v.s_fileName)
+            v.icon = isDoc ? 'doc' : 'rar'
+            return v
+          }))
+        } else {
+          this.listInfo.finished = true
+        }
+
+        this.listInfo.loading = false
+        if (this.listInfo.total !== -1 && this.listInfo.total <= this.list.length) {
+          this.listInfo.finished = true
+        }
+      }
+    },
+    getDatas() {
+      return {
+        queryTime: new Date(this.years, this.months-1, 1).pattern('yyyy-MM'),
+        platform: navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1 ? 'WX' : 'APP',
+        productName: '附件下载包',
+        pageSize: this.listInfo.pageSize,
+        pageNum: this.listInfo.pageNum
+      }
+    },
+    ajaxEntList() {
+      this.working = true
+      this.empty = false
+      return $.ajax({
+        url: '/jypay/resourcePack/recordList',
+        type: 'POST',
+        contentType: 'application/x-www-form-urlencoded',
+        data: this.getDatas(),
+        dataType: 'json'
+      })
+    },
+    downFile (item) {
+	    $.ajax({
+	        type: 'post',
+	        url: '/jypay/resourcePack/consumePack',
+	        data: {
+	            productName: '附件下载包',
+	            platform: 'WX',
+	            fileName: item.s_fileName,
+	            id: item.s_id,
+	            title: item.s_title
+	        },
+	        success: function (r) {
+				if (r && r.m === '' && r.r) {
+                  openFileDown(r.r.downUrl)
+                }else{
+                	vant.Dialog.alert({
+                        message: '附件下载异常,请联系管理员,谢谢!',
+                        className: 'custom-dialog',
+                        confirmButtonText: '我知道了',
+                        confirmButtonColor: '#2ABDD1',
+                        width: 303,
+                      }).then(() => {})
+                }
+			}
+		})
+    },
+    commonDialogFn (message, confirmText, callBack) {
+      if (this.ptype == "1") {
+        var curDay = new Date().pattern('yyyy/MM/dd')
+        localStorage.setItem('show-buyer-dialog', curDay)
+      } else {
+        var curDay = new Date().pattern('yyyy/MM/dd')
+        localStorage.setItem('show-ent-dialog', curDay)
+      }
+      this.$dialog.confirm({
+        message: message,
+        width: 303,
+        className: 'pro-log',
+        messageAlign: 'left',
+        showCancelButton: 'true',
+        confirmButtonColor: '#2ABED1',
+        confirmButtonText: confirmText,
+        showCancelButton: true
+      }).then(function () {
+        callBack && callBack()
+      }).catch(function () { })
+    },
+    usedDialog () {
+      this.commonDialogFn('超级订阅用户每月享有下载10个附件的权限,也可充值附件下载包増加当月附件下载个数,每月1号上月余额清零重新计算。', '我知道了')
+    },
+    helpTiped() {
+        this.$dialog.alert({
+          width: 303,
+        message: '超级订阅用户每月享有下载<span class="on">10</span>个附件的权限,也可充值附件下载包増加当月附件下载个数,每月1号上月余额清零重新计算。',
+          className: 'pro-log',
+          messageAlign: 'left',
+          confirmButtonColor: '#2ABED1',
+          confirmButtonText: '我知道了',
+        })
+    },
+    confirmed(val) {
+      this.years = val.getFullYear()
+      this.months = val.getMonth() + 1
+      this.listInfo.pageNum = 1
+      this.list = []
+      this.listInfo.total = -1
+      this.listInfo.finished = false
+      this.listInfo.loading = true
+      this.onLoad()
+      this.dValue = this.years + '年' + this.months + '月'
+      this.pShow = false
+    },
+    canceled() {
+      this.pShow = false
+    },
+    ChangeDate (time){
+        var d = new Date(time)
+        var Y = d.getFullYear() + '年'
+        var M = (d.getMonth()+1 < 10 ? '0'+(d.getMonth()+1) : d.getMonth()+1) + '月'
+        return (Y + M).replace(/^\s+|\s+$/g,"")
+    },
+    detailed(ids) {
+    	if(this.ptype==""){
+        	location.href = '/weixin/frontPage/collection/sess/ent_portrait?eId=' + ids + '&svip=1'
+        }else{
+			location.href='/big/wx/page/unit_portrayal?entName=' + ids + '&svip=1'
+		}
+    },
+    contractPerson() {
+      // location.href = '400-108-6670'
+      location.href = '/big/wx/page/customer'
+    },
+    setBook() {
+      var temp = {
+        wx: '/swordfish/filePack/createOrder',
+        app: '/jyapp/filePack/createOrder'
+      }
+      var isWeixin = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
+      location.href = temp[isWeixin ? 'wx' : 'app']
+    }
+  }
+})
+

+ 299 - 0
src/web/staticres/common-module/file-pack/js/index.js

@@ -0,0 +1,299 @@
+function getShortName (comName) {
+  var areaMap = chinaMapJSON || []
+  var shortname = comName
+  // 1. 循环省份城市进行替换
+  areaMap.forEach(function (item) {
+    var p = item.name.replace(/[省市]/, '')
+    if (shortname.indexOf(p) !== -1) {
+      shortname = shortname.replace(item.name, '').replace(p, '')
+      console.log(p + ' -> \'\'')
+    }
+    item.city.forEach(function (iitem) {
+      var c = iitem.name.replace(/[省市]/, '')
+      if (shortname.indexOf(c) !== -1) {
+        shortname = shortname.replace(iitem.name, '').replace(c, '')
+        console.log(c + ' -> \'\'')
+      }
+      iitem.area.forEach(function (iiitem) {
+        if (shortname.indexOf(iiitem) !== -1) {
+          shortname = shortname.replace(iiitem, '')
+          console.log(iiitem + ' -> \'\'')
+        }
+      })
+    })
+  })
+  var matchRes = shortname.match(/[\u4e00-\u9fa5]{4}/gm)
+  var shortname = matchRes ? matchRes[0] : shortname.slice(0, 4)
+  if (shortname.length < 4) {
+    shortname = shortname.slice(0, 4)
+  }
+  return shortname
+}
+
+var formatter11 = (type, val) => {
+  if (type === 'year') {
+    return `${val}年`;
+  }
+  if (type === 'month') {
+    return `${val}月`;
+  }
+  return val;
+}
+
+var vm = new Vue({
+  el: '#proRecord',
+  delimiters: ['{', '}'],
+  data: function () {
+    return {
+      dValue: '',
+      pShow: false,
+      working: false,
+      empty: false,
+      curDate: '',
+      minDate: '',
+      maxTime: '',
+      points: {
+    	total: 0,
+		usage: 0
+      },
+      years: '',
+      months: '',
+      contracted: false,
+      listInfo: {
+        value: '',
+        pageNum: 1,
+        pageSize: 10,
+        total: -1,
+        loading: true,
+        finished: false
+      },
+      statusEnum: ['存续', '吊销', '停业', '撤销'],
+      statusColors: ['#2CB7CA', '#F5AF5C', '#58A1E7', '#51CEA2'],
+      list: [],
+      ptype: ""
+    }
+  },
+  created: function () {
+    this.getPType("type")
+    this.years = new Date().getFullYear()
+    this.months = parseInt(new Date().getMonth() + 1)
+    this.dValue = this.years + '年' + this.months + '月'
+    this.curDate = new Date()
+    this.minDate = new Date(2021, 0)
+    this.maxTime = new Date(this.years, this.months - 1)
+    this.subPoint()
+    this.onLoad()
+    this.initHtml()
+  },
+  methods: {
+    initHtml () {
+      if (this.ptype == "1") {
+        document.title = '采购单位画像记录'
+        typeof setHeaderTitle === 'function' ? setHeaderTitle(document.title) : null
+        $(".btns span").text("当月采购单位画像剩余数")
+        $(".emptytext").text("暂无采购单位画像记录")
+      }
+    },
+    getPType (paraName) {
+      let _this = this
+      var url = document.location.toString();
+      var arrObj = url.split("?");
+      if (arrObj.length > 1) {
+        var arrPara = arrObj[1].split("&");
+        var arr;
+        for (var i = 0; i < arrPara.length; i++) {
+          arr = arrPara[i].split("=");
+          if (arr != null && arr[0] == paraName) {
+            _this.ptype = arr[1];
+          }
+        }
+      }
+    },
+    usedHised () {
+      let _this = this
+      _this.pShow = true
+    },
+    subPoint () {
+      $.ajax({
+        url: '/jypay/resourcePack/account',
+        type: 'POST',
+        contentType: 'application/x-www-form-urlencoded',
+        data: {
+          product: 'attachmentDownPack'
+        },
+        dataType: 'json'
+      }).done(res => {
+          if (res.error_msg === '' && res.data && res.data.data) {
+            try {
+              var tempInfo = res.data.data[0]
+              this.points.total = tempInfo.number
+
+            } catch (e) {
+              console.warn(e)
+            }
+          } else {
+            this.$toast(res.error_msg || '请稍后重试')
+          }
+      })
+    },
+    onLoad () {
+      this.ajaxEntList().done(this.doFormatList.bind(this))
+    },
+    doFormatList (r) {
+      if (r && r.error_msg == '' && r.data) {
+    	this.points.usage = r.data.total
+        this.working = false
+        this.empty = true
+        if (this.listInfo.pageNum === 1) {
+          if (r.data.total || r.data.total === 0) {
+            this.listInfo.total = r.data.total
+          } else {
+            this.listInfo.finished = true
+          }
+        }
+        this.listInfo.pageNum++
+
+        if (Array.isArray(r.data.list) && r.data.list.length !== 0) {
+          this.list = this.list.concat(r.data.list.map(function (v) {
+            var isDoc = /.doc(x{0,})$/.test(v.s_fileName)
+            v.icon = isDoc ? 'doc' : 'rar'
+            return v
+          }))
+        } else {
+          this.listInfo.finished = true
+        }
+
+        this.listInfo.loading = false
+        if (this.listInfo.total !== -1 && this.listInfo.total <= this.list.length) {
+          this.listInfo.finished = true
+        }
+      }
+    },
+    getDatas () {
+      return {
+        queryTime: new Date(this.years, this.months-1, 1).pattern('yyyy-MM'),
+        platform: navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1 ? 'WX' : 'APP',
+        productName: '附件下载包',
+        pageSize: this.listInfo.pageSize,
+        pageNum: this.listInfo.pageNum
+      }
+    },
+    ajaxEntList () {
+      this.working = true
+      this.empty = false
+      return $.ajax({
+        url: '/jypay/resourcePack/recordList',
+        type: 'POST',
+        contentType: 'application/x-www-form-urlencoded',
+        data: this.getDatas(),
+        dataType: 'json'
+      })
+    },
+    downFile (item) {
+      //location.href = item.s_downUrl
+		   $.ajax({
+		       type: 'post',
+		       url: '/jypay/resourcePack/consumePack',
+		       data: {
+		           productName: '附件下载包',
+		           platform: 'APP',
+		           fileName: item.s_fileName,
+		           id: item.s_id,
+		           title: item.s_title
+		       },
+		       success: function (r) {
+				if (r && r.m === '' && r.r) {
+                        location.href = r.r.downUrl
+		              }else{
+		              	vant.Dialog.alert({
+		                      message: '附件下载异常,请联系管理员,谢谢!',
+		                      className: 'custom-dialog',
+		                      confirmButtonText: '我知道了',
+		                      confirmButtonColor: '#2ABDD1',
+		                      width: 303,
+		                    }).then(() => {})
+		              }
+			}
+		})
+    },
+    commonDialogFn (message, confirmText, callBack) {
+      if (this.ptype == "1") {
+        var curDay = new Date().pattern('yyyy/MM/dd')
+        localStorage.setItem('show-buyer-dialog', curDay)
+      } else {
+        var curDay = new Date().pattern('yyyy/MM/dd')
+        localStorage.setItem('show-ent-dialog', curDay)
+      }
+      this.$dialog.confirm({
+        message: message,
+        width: 303,
+        className: 'pro-log',
+        messageAlign: 'left',
+        showCancelButton: 'true',
+        confirmButtonColor: '#2ABED1',
+        confirmButtonText: confirmText,
+        showCancelButton: true
+      }).then(function () {
+        callBack && callBack()
+      }).catch(function () { })
+    },
+    usedDialog () {
+      this.commonDialogFn('超级订阅用户每月享有下载10个附件的权限,也可充值附件下载包増加当月附件下载个数,每月1号上月余额清零重新计算。', '我知道了')
+    },
+    helpTiped () {
+      this.$dialog.alert({
+        width: 303,
+        message: '超级订阅用户每月享有下载<span class="on">10</span>个附件的权限,也可充值附件下载包増加当月附件下载个数,每月1号上月余额清零重新计算。',
+        className: 'pro-log',
+        messageAlign: 'left',
+        confirmButtonColor: '#2ABED1',
+        confirmButtonText: '我知道了',
+      })
+    },
+    confirmed (val) {
+      this.years = val.getFullYear()
+      this.months = val.getMonth() + 1
+      this.listInfo.pageNum = 1
+      this.list = []
+      this.listInfo.total = -1
+      this.listInfo.finished = false
+      this.listInfo.loading = true
+      this.onLoad()
+      this.dValue = this.years + '年' + this.months + '月'
+      this.pShow = false
+    },
+    canceled () {
+      this.pShow = false
+    },
+    ChangeDate (time) {
+      var d = new Date(time)
+      var Y = d.getFullYear() + '年'
+      var M = (d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1) + '月'
+      return (Y + M).replace(/^\s+|\s+$/g, "")
+    },
+    detailed (ids) {
+      if (this.ptype == "") {
+        location.href = '/jyapp/big/page/ent_portrait?eId=' + ids + '&svip=1'
+      } else {
+        location.href = '/jyapp/big/page/unit_portrayal?entName=' + ids + '&svip=1'
+      }
+    },
+    contractPerson () {
+      location.href = '/jyapp/free/customer'
+      // try {
+      //   JyObj.callPhone('400-108-6670')
+      // } catch (error) {
+      //   console.log(error)
+      // }
+    },
+    setBook() {
+      var temp = {
+        wx: '/swordfish/filePack/createOrder',
+        app: '/jyapp/filePack/createOrder'
+      }
+      var isWeixin = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
+      location.href = temp[isWeixin ? 'wx' : 'app']
+    }
+  }
+})
+

BIN
src/web/staticres/common-module/order-list/image/file.png


+ 48 - 69
src/web/staticres/common-module/order-list/js/order-detail.js

@@ -264,12 +264,10 @@ var vm = new Vue({
       var productType = order.product_type
       var platform = this.platform
       var headerImgUrl = ''
-      if (productType === '省份订阅包') {
-        headerImgUrl = assetsConf.areaPackLink.imgMap.headerImg[platform]
-      }else if (productType === '数据流量包') {
-        headerImgUrl = assetsConf.dataPackLink.imgMap.headerImg[platform]
+      var productKey = assetsConf.productionTypeMap[productType]
+      if (productKey) {
+        headerImgUrl =  assetsConf[productKey].imgMap.headerImg[platform]
       }
-
       return headerImgUrl
     },
     getSurplusTimeTime: function (order) {
@@ -422,80 +420,37 @@ var vm = new Vue({
       })
     },
     onConfirmPay: function () {
-      var order = this.reqOrder
-      var productType = order.product_type
-      var orderCode = order.order_code
-      var platform = this.platform
-      switch (productType) {
-        case '数据流量包': {
-          var href = assetsConf.dataPackLink.pay[platform]
-          if (href) {
-            this.goToLink(`${href}?orderCode=${orderCode}`)
-          }
-          break
-        }
-        case '省份订阅包': {
-          var href = assetsConf.areaPackLink.pay[platform]
-          if (href) {
-            this.goToLink(`${href}?orderCode=${orderCode}`)
-          }
-          break
-        }
-        default: {
-          break
-        }
+      var link = this.getPublicLinkOfKey(this.reqOrder.product_type, 'pay')
+      if (link) {
+        this.goToLink(`${link}?orderCode=${this.reqOrder.order_code}`)
       }
     },
-    renew: function () {
+    getPublicLinkOfKey (productKey, key) {
       var order = this.reqOrder
       var orderCode = order.order_code
       var productType = order.product_type
       var platform = this.platform
-      switch (productType) {
-        case '数据流量包': {
-          var href = assetsConf.dataPackLink.renew[platform]
-          if (href) {
-            this.goToLink(`${href}?orderCode=${orderCode}`)
-          }
-          break
-        }
-        case '省份订阅包': {
-            var href = assetsConf.areaPackLink.renew[platform]
-            if (href) {
-              this.goToLink(`${href}&orderCode=${orderCode}`)
-            }
-            break
-        }
-        default: {
-          break
+      var productKey = assetsConf.productionTypeMap[productType]
+      var tempValue = ''
+      if (productKey) {
+        try {
+          tempValue = assetsConf[productKey][key][platform]
+        } catch (e) {
+          console.warn(e)
         }
       }
+      return tempValue
+    },
+    renew: function () {
+      var link = this.getPublicLinkOfKey(this.reqOrder.product_type, 'renew')
+      if (link) {
+        this.goToLink(`${link}?orderCode=${this.reqOrder.order_code}`)
+      }
     },
     buyAgain: function () {
-      var _this = this
-      var order = this.reqOrder
-      var productType = order.product_type
-      var orderCode = order.order_code
-      var platform = this.platform
-
-      switch (productType) {
-        case '数据流量包': {
-          var href = assetsConf.dataPackLink.buyAgain[platform]
-          if (href) {
-            this.goToLink(`${href}?orderCode=${orderCode}`)
-          }
-          break
-        }
-        case '省份订阅包': {
-          var href = assetsConf.areaPackLink.buyAgain[platform]
-          if (href) {
-            this.goToLink(`${href}&orderCode=${orderCode}`)
-          }
-          break
-        }
-        default: {
-          break
-        }
+      var link = this.getPublicLinkOfKey(this.reqOrder.product_type, 'buyAgain')
+      if (link) {
+        this.goToLink(`${link}?orderCode=${this.reqOrder.order_code}`)
       }
     },
     getProductInfoList: function (info) {
@@ -513,6 +468,10 @@ var vm = new Vue({
           infoList = this.getAreaPackInfo(order)
           break
         }
+        case '附件下载包': {
+          infoList = this.getFilePackInfo(order)
+          break
+        }
         default: {
           break
         }
@@ -520,6 +479,26 @@ var vm = new Vue({
 
       return infoList
     },
+    // 附件下载包订单卡片信息整理
+    getFilePackInfo: function (order) {
+      var filterInfo = JSON.parse(order.filter)
+      var payNum = filterInfo.num + '个'
+      if(filterInfo.give_cycle){
+        payNum += '<span class="highlight-text">&nbsp赠' +	filterInfo.give_cycle + '个</span>'
+      }
+      var numInfo = {
+        label: '附件个数',
+        split: ':',
+        text: payNum
+      }
+      var date = {
+        label: '有效期至',
+        split: ':',
+        text: filterInfo.validTime.replace(/-/g, '/')
+      }
+
+      return [numInfo, date]
+    },
     // 省份订阅包订单卡片信息整理
     getAreaPackInfo: function (order) {
       var filterInfo = JSON.parse(order.filter)

+ 30 - 0
src/web/staticres/common-module/order-list/js/order-list-config.js

@@ -3,6 +3,12 @@
 var assetsConf = {
   version: pageInfo.version,
   platform: pageInfo.platform,
+  // 维护 KeyMap 用于公用订单详情页
+  productionTypeMap: {
+    '数据流量包': 'dataPackLink',
+    '省份订阅包': 'areaPackLink',
+    '附件下载包': 'filePackLink'
+  },
   // 产品集合
   productionTypeList: [
     '历史数据',
@@ -18,12 +24,14 @@ var assetsConf = {
     '招标文件解读',
     '剑鱼币',
     '数据流量包',
+    '附件下载包',
     '省份订阅包'
   ],
   // 支持再次购买的产品集合
   canBuyAgainProductions: [
     '历史数据',
     '数据流量包',
+    '附件下载包',
   ],
   // 支持开发票的产品product_type
   canInvokeProductions: [
@@ -40,6 +48,7 @@ var assetsConf = {
     '招标文件解读',
     '剑鱼币',
     '数据流量包',
+    '附件下载包',
     '省份订阅包'
   ],
   init: function () {
@@ -334,6 +343,27 @@ var assetsConf = {
       }
     }
   },
+  // 附件下载包
+  filePackLink: {
+    pay: {
+      wx: '/weixin/pay/checkout_filePack',
+      app: '/jyapp/pay/checkout_filePack'
+    },
+    orderDetail: {
+      wx: '/weixin/common/filePack/orderDetail',
+      app: '/jyapp/common/filePack/orderDetail'
+    },
+    buyAgain: {
+      wx: '/swordfish/filePack/createOrder',
+      app: '/jyapp/filePack/createOrder'
+    },
+    imgMap: {
+      headerImg: {
+        wx: '/common-module/order-list/image/file.png',
+        app: '/common-module/order-list/image/file.png'
+      }
+    }
+  },
   // 省份订阅包
   areaPackLink: {
     pay: {

+ 51 - 0
src/web/staticres/common-module/order-list/js/order-list.js

@@ -714,6 +714,16 @@ var vm = new Vue({
           }
           break
         }
+        case '附件下载包': {
+          try {
+            info.contentImgUrl = assetsConf.filePackLink.imgMap.headerImg[platform]
+            info.contentList = this.getFilePackInfo(order)
+          } catch (error) {
+            info.contentList = []
+            console.log(error)
+          }
+          break
+        }
         case '省份订阅包': {
           try {
             info.contentImgUrl = assetsConf.areaPackLink.imgMap.headerImg[platform]
@@ -1101,6 +1111,13 @@ var vm = new Vue({
           }
           break
         }
+        case '附件下载包': {
+          var href = assetsConf.filePackLink.pay[platform]
+          if (href) {
+            this.goToLink(`${href}?orderCode=${orderCode}`)
+          }
+          break
+        }
         case '省份订阅包': {
           var href = assetsConf.areaPackLink.pay[platform]
           if (href) {
@@ -1188,6 +1205,13 @@ var vm = new Vue({
           }
           break
         }
+        case '附件下载包': {
+          var href = assetsConf.filePackLink.buyAgain[platform]
+          if (href) {
+            this.goToLinkAndSaveState(`${href}?orderCode=${orderCode}`)
+          }
+          break
+        }
         case '省份订阅包': {
           // buyState  1续费 2再次购买
           var buyState = bConf.buyState
@@ -1329,6 +1353,13 @@ var vm = new Vue({
           }
           break
         }
+        case '附件下载包': {
+          var href = assetsConf.filePackLink.orderDetail[platform]
+          if (href) {
+            goToFn(`${href}?order_code=${orderCode}`)
+          }
+          break
+        }
         case '省份订阅包': {
           var href = assetsConf.areaPackLink.orderDetail[platform]
           if (href) {
@@ -2081,6 +2112,26 @@ var vm = new Vue({
       specs.text = specMap[filterInfo.pType]
       return [prodType, buyCount, date, specs]
     },
+    // 附件下载包订单卡片信息整理
+    getFilePackInfo: function (order) {
+      var filterInfo = JSON.parse(order.filter)
+    	  var payNum = filterInfo.num + '个'
+	  if(filterInfo.give_cycle){
+		payNum += '<span class="highlight-text">&nbsp赠' +	filterInfo.give_cycle + '个</span>'
+	  }
+      var numInfo = {
+        label: '附件个数',
+        split: ':',
+        text: payNum
+      }
+      var date = {
+        label: '有效期至',
+        split: ':',
+        text: filterInfo.validTime.replace(/-/g, '/')
+      }
+
+      return [numInfo, date]
+    },
     // 省份订阅包订单卡片信息整理
     getAreaPackInfo: function (order) {
       var filterInfo = JSON.parse(order.filter)

+ 5 - 2
src/web/staticres/common-module/portraitRecord/css/index.css

@@ -14,7 +14,7 @@
 }
 .portraited {
     width: 100%;
-    
+
 }
 .portraited .t-bg {
     width: 100%;
@@ -26,6 +26,7 @@
 .portraited .t-bg {
     flex-direction: column;
     padding: .46rem 0;
+    flex-shrink: 0;
 }
 .portraited .btns {
     flex-direction: column;
@@ -53,8 +54,10 @@
     margin: .24rem 0;
 }
 .portraited .t-bg .btns .van-button {
+    flex-shrink: 0;
     width: 3.3rem;
     height: .8rem;
+    min-height: .8rem;
     background: #2ABED1;
     border-color: #2ABED1;
 }
@@ -373,4 +376,4 @@
 
 .van-loading {
     margin-top: 1.2rem;
-}
+}

BIN
src/web/staticres/common-module/vipsubscribe/image/info/cut_04.jpg


+ 3 - 0
src/web/staticres/css/pc.css

@@ -159,6 +159,9 @@ form{
     background-color: #f4f4f7 !important;
     color: #2cb7ca !important;
 }
+.userInfo .infoList .myorderDiv.fileRecord {
+	display: flex;
+}
 .userInfo .infoList .myorderDiv{
 	height: 45px;
 	border-top: none;

+ 83 - 21
src/web/staticres/frontRouter/pc/seeBuyerHistory/js/index-pc.js

@@ -29,6 +29,31 @@ function getShortName (comName) {
   }
   return shortname
 }
+function debounce(func, wait) {
+  var timeout;
+  return function () {
+    var context = this;
+    var args = Array.prototype.slice.call(arguments);
+    if (timeout) clearTimeout(timeout);
+    var callNow = !timeout;
+    timeout = setTimeout(function () {
+      timeout = null;
+    }, wait);
+    if (callNow) func.apply(context, args);
+  };
+}
+function downFile (src, name) {
+  var a = document.createElement('a')
+  var event = new MouseEvent('click')
+  a.download = name || '附件名称'
+  a.href = src
+  a.dispatchEvent(event)
+}
+
+var downFileOfURL = debounce(function (src , name) {
+  return downFile(src, name)
+}, 1500)
+
 var vm = new Vue({
   el: '.see-container',
   delimiters: ['{', '}'],
@@ -69,6 +94,36 @@ var vm = new Vue({
     this.subRecord()
   },
   methods: {
+    cellClick (row, column, cell, event) {
+      console.log(row, column, cell, event)
+      if (column.label === '附件') {
+    	$.ajax({
+	        type: 'post',
+	        url: '/jypay/resourcePack/consumePack',
+	        data: {
+	            productName: '附件下载包',
+	            platform: 'PC',
+	            fileName: row.s_fileName,
+	            id: row.s_id,
+	            title: row.s_title
+	        },
+	        success: function (r) {
+				if (r && r.m === '' && r.r) {
+					downFileOfURL(r.r.downUrl, row.s_fileName);
+                }else{
+                	console.log("附件下载异常,请联系管理员,谢谢!")
+                }
+			}
+		})
+        return
+      }
+      if (column.label === '公告来源') {
+        location.href = row.articleUrl
+      }
+    },
+    indexMethod (index) {
+      return ((this.seeList.pageNum - 1) * this.seeList.pageSize) + index + 1
+    },
     showTip () {
       this.tipDialog = true
     },
@@ -84,34 +139,48 @@ var vm = new Vue({
     subPoint () {
       var _this = this
       $.ajax({
-        url: '/bigmember/portrait/subVipPortrait/usage?p_type=1',
+        url: '/jypay/resourcePack/account',
         type: 'POST',
         contentType: 'application/x-www-form-urlencoded',
-        data: '',
+        data: {
+          product: 'attachmentDownPack'
+        },
         dataType: 'json'
       }).done(res => {
-        if (res.error_code == 0) {
-          _this.points = res.data
-          if (res.data.total == res.data.usage) {
-            _this.tipDialog = true
+          if (res.error_msg === '' && res.data && res.data.data) {
+            this.points = {
+              total: 0,
+              usage: 0
+            }
+            try {
+              var tempInfo = res.data.data[0]
+              this.points = {
+                total: tempInfo.number,
+                usage: tempInfo.number
+              }
+              if (this.points.usage > tempInfo.thirtyNum) {
+                this.points.usage = tempInfo.thirtyNum
+              }
+            } catch (e) {
+              console.warn(e)
+          }
           }
-        }
       })
     },
     getDatas () {
       return {
-        year: this.years,
-        month: this.months,
+        queryTime: new Date(this.years, this.months - 1, 1).pattern('yyyy-MM'),
+        platform: 'PC',
+        productName: '附件下载包',
         pageSize: this.seeList.pageSize,
-        pageNum: this.seeList.pageNum - 1,
-        p_type: 1
+        pageNum: this.seeList.pageNum
       }
     },
     subRecord () {
       this.working = true
       this.empty = false
       $.ajax({
-        url: '/bigmember/portrait/subVipPortrait/record',
+       url: '/jypay/resourcePack/recordList',
         type: 'POST',
         contentType: 'application/x-www-form-urlencoded',
         data: this.getDatas(),
@@ -128,15 +197,7 @@ var vm = new Vue({
             res.data.list = []
             return
           }
-          this.seeList.list = this.seeList.list.concat(res.data.list.map(function (v) {
-            return {
-              name: v.name,
-              province: v.province,
-              city: v.city,
-              buyerclass: v.buyerclass,
-              checked: false
-            }
-          }))
+          this.seeList.list = this.seeList.list.concat(res.data.list)
         }
       })
     },
@@ -149,6 +210,7 @@ var vm = new Vue({
       this.years = val.getFullYear()
       this.months = val.getMonth() + 1
       this.seeList.pageNum = 1
+      this.seeList.total = 0
       this.seeList.list = []
       this.subRecord()
     },

+ 30 - 3
src/web/staticres/js/login.js

@@ -313,6 +313,24 @@ function checkBigStatus () {
         if (res.data.power.indexOf(5) == -1 && res.data.vipStatus>0&&res.data.viper) {
           $(".myorderDiv.buyerPortraitRecord").show()
         }
+		if (res.data.memberStatus<=0&&res.data.vipStatus>0&&res.data.viper){
+			$(".myorderDiv.portraitRecord").show()
+		}
+	   if (res.data.memberStatus > 0 && res.data.vipStatus > 0 && res.data.viper && res.data.power.indexOf(3) === -1) {
+		  $('.fileRecord').show()
+	   }
+
+	   if (res.data.memberStatus <= 0 && res.data.vipStatus > 0 && res.data.viper) {
+		   $('.fileRecord').show()
+	   }
+
+
+		if ($.isArray(res.data.power)) {
+		  // 大会员没有附加下载包权限用户且新版超级订阅用户
+		  if (res.data.memberStatus > 0 && res.data.vipStatus > 0 && res.data.viper && res.data.power.indexOf(3) === -1) {
+			  $('.fileRecord').show()
+		  }
+		}
       }
     }
   })
@@ -390,8 +408,13 @@ var logic = function(data,num){
 					+"<div class='usernameDiv'>"
 						+data.s_nickname
           +"</div>"
-			+"<div class=\"myorderDiv\" onclick=\"window.location.href='/front/dataPack/index'\">"
+			+"<div class=\"myorderDiv\" style=\"display:flex;align-items: center;\" onclick=\"window.location.href='/front/dataPack/index'\">"
 			+"<span>我的数据</span>"
+			+"<span class=\"new_msg\" >NEW</span>"
+			+"</div>"
+			+"<div class=\"myorderDiv fileRecord\" style=\"display:none;align-items: center;\" onclick=\"window.location.href='/swordfish/frontPage/fileHistory/sess/index'\">"
+			+"<span>附件下载包</span>"
+			+"<span class=\"new_msg\" >NEW</span>"
 			+"</div>"
           +"<div class=\"myorderDiv\" style=\"border-bottom:0;\" onclick=\"window.location.href='/swordfish/docs//user/docs'\">"
             +"<span>我的文库</span>"
@@ -650,7 +673,7 @@ var haslogin = function(num,kyorpn,url){
 	thurl = url;//列表也跳转快照页url
 	$.post("/front/hasSign",function(data, location){
 		if(data){
-			loginflag = true;  
+			loginflag = true;
 			encryptId = data.encryptId
 			if(data.s_nickname!=null&&data.s_nickname.length>11){
 				data.s_nickname = data.s_nickname.substring(0,11);
@@ -682,6 +705,10 @@ var haslogin = function(num,kyorpn,url){
 			+"<span>我的数据</span>"
             +"<span class=\"new_msg\" >NEW</span>"
 			+"</div>"
+			+"<div class=\"myorderDiv fileRecord\" style=\"display:none;align-items: center;\" onclick=\"window.location.href='/swordfish/frontPage/fileHistory/sess/index'\">"
+			+"<span>附件下载包</span>"
+			+"<span class=\"new_msg\" >NEW</span>"
+			+"</div>"
             +"<div class=\"myorderDiv\" style=\"border-bottom:0;\" onclick=\"window.location.href='/swordfish/docs//user/docs'\">"
               +"<span>我的文库</span>"
             +"</div>"
@@ -750,7 +777,7 @@ function loginBtnType(){
             $(".loginBtn").attr("onmouseover","this.style.borderColor='#2cb7ca'; this.style.color='#2cb7ca';");
             $(".loginBtn").attr("onmouseout","this.style.borderColor='#e0e0e0'; this.style.color='#252627';");
         }
-       
+
 	}else if(href.indexOf("topics")>-1){
 		$(".loginBtn").css({"border":"none"});
 	}else{

+ 10 - 1
src/web/staticres/me/js/mine.js

@@ -99,9 +99,11 @@ var mine = {
                       if(res.data.vipStatus > 0 && res.data.viper ) {
                         $('#ent-follow-history').show()
                         $('#buyer-follow-history').show()
+                        $('#file-pack').show()
                       } else {
                         $('#ent-follow-history').hide()
                         $('#buyer-follow-history').hide()
+                        $('#file-pack').hide()
                       }
                   } else {
                     // 有采购单位全景分析权限的 不显示画像记录 没有的判断是否是超级订阅新用户
@@ -125,6 +127,13 @@ var mine = {
                       }
                     }
                   }
+                  if ($.isArray(res.data.power)) {
+                      // 大会员没有附加下载包权限用户且新版超级订阅用户
+                      if (res.data.memberStatus > 0 && res.data.vipStatus > 0 && res.data.viper && res.data.power.indexOf(3) === -1) {
+                          $('#file-pack').show()
+                      }
+                  }
+
               }
           }
       })
@@ -295,7 +304,7 @@ var vNode = {
     this.getPointsInfo()
   },
   mounted() {
-      
+
   },
   methods: {
     signHandle: function () {

BIN
src/web/staticres/order/image/file.png


+ 4 - 4
src/web/templates/common/pchead.html

@@ -1120,12 +1120,12 @@ function infoListCss(){
 	$useronline.css('position','relative');
 	$infoList.css({
 		'position':'absolute',
-		'left':'-99px',
+		'left':'-109px',
 		'top':'42px',
 		'z-index':'999',
 		'cursor': 'pointer',
 		'height':'auto',
-		'min-width':'142px',
+		'min-width':'152px',
 		'box-shadow':' 0 0 20px rgba(0,0,0, .2)'
 	})
 	$('.userInfo .one').css({
@@ -1134,7 +1134,7 @@ function infoListCss(){
 	    'height': '0px',
 	    'border': '1px solid #ccc',
 	    'position': 'absolute',
-	    'left': '109px',
+	    'left': '119px',
 	    'top': '-11px',
 	    'border-width': '6px',
 	    'border-color': 'transparent transparent #e0e0e0 transparent'
@@ -1146,7 +1146,7 @@ function infoListCss(){
 	    'height': '0px',
 	    'border': '1px solid #fff',
 	    'position': 'absolute',
-	    'left': '109px',
+	    'left': '119px',
 	    'top': '-10px',
 	    'border-width': '6px',
 	    'border-color': 'transparent transparent #fff transparent',

+ 261 - 0
src/web/templates/frontRouter/pc/fileHistory/sess/index.html

@@ -0,0 +1,261 @@
+<html lang="zh-cn">
+
+<head>
+  <title>附件下载记录_{{Msg "seo" "qfw.swordfishsl.title"}}</title>
+  <meta name="Keywords" content="{{Msg "seo" "qfw.swordfishsl.key"}}" />
+  <meta name="Description" content="{{Msg "seo" "qfw.swordfishsl.description"}}" />
+  <meta name="renderer" content="webkit">
+  <meta content="telephone=no" name="format-detection" />
+  <meta content="附件下载记录" theme="light" name="enable-header" />
+  {{include "/common/pnc.html"}}
+  <link href="{{Msg "seo" "cdn"}}/css/pc.css?v={{Msg "seo" "version"}}" rel="stylesheet" />
+  <link href="{{Msg "seo" "cdn"}}/css/dev2/reset_pc.css?v={{Msg "seo" "version"}}" rel="stylesheet" />
+  <link href="{{Msg "seo" "cdn"}}/pccss/public-nav-1200.css?v={{Msg "seo" "version"}}" rel="stylesheet" />
+
+  <script src="{{Msg "seo" "cdn"}}/js/jquery.cookie.js"></script>
+  <script src="{{Msg "seo" "cdn"}}/js/public-nav.js?v={{Msg "seo" "version"}}"></script>
+
+  <link href="//cdn-common.jianyu360.com/cdn/lib/element-ui/2.15.7/lib/theme-chalk/index.css" rel="stylesheet" />
+  <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/css/ele-reset.css?v={{Msg "seo" "version"}}'>
+  <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/css/selector/selector.css?v={{Msg "seo" "version"}}'>
+  <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/frontRouter/pc/seeBuyerHistory/css/index-pc.css?v={{Msg "seo" "version"}}'>
+  <style>
+    .w1080 {
+      width: 1080px;
+      margin: 0 auto;
+    }
+    .show-total-info-group button {
+      width: 132px;
+      height: 36px;
+      background: #FFFFFF;
+      border-radius: 6px 6px 6px 6px;
+      font-size: 16px;
+      font-weight: 400;
+      color: #2CB7CA;
+    }
+    .show-total-info-group {
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+      justify-content: space-between;
+      margin-top: 24px;
+      width: 1080px;
+      min-height: 122px;
+      background: linear-gradient(315deg, #14A7D6 0%, #1EC2DB 99%);
+      font-size: 14px;
+      font-weight: 400;
+      color: rgba(255, 255, 255, 0.9);
+      line-height: 22px;
+      padding: 28px 32px;
+      box-sizing: border-box;
+      border-radius: 6px;
+    }
+    .show-total-info-item > span {
+      display: inline-block;
+      margin-top: 8px;
+      font-size: 14px;
+      font-weight: 400;
+      color: rgba(255, 255, 255, 0.9);
+      line-height: 22px;
+    }
+    .show-total-info-item {
+      font-size: 16px;
+      font-weight: bold;
+      color: #FFFFFF;
+      line-height: 24px;
+      margin-bottom: 8px;
+    }
+    .show-total-info-item .file-pack-total {
+      font-size: 36px;
+      line-height: 36px;
+      padding: 0 8px;
+    }
+    .el-table th.el-table__cell>.cell {
+      font-size: 14px;
+      font-weight: bold;
+      color: #1D1D1D;
+      padding-left: 24px;
+      padding-right: 24px;
+    }
+    .el-table .cell {
+      padding: 4px 24px;
+      font-size: 14px;
+      font-weight: 400;
+      color: #1D1D1D;
+    }
+    .el-table .el-table__cell.text-center {
+      text-align: center;
+    }
+
+    .el-table td.el-table__cell.file-name .cell {
+      font-size: 14px;
+      font-weight: 400;
+      color: #2CB7CA;
+      text-decoration: underline;
+      cursor: pointer;
+    }
+    .el-table td.el-table__cell.title-name .cell {
+      display: -webkit-box;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      -webkit-line-clamp: 2;
+      -webkit-box-orient: vertical;
+      cursor: pointer;
+    }
+    .el-table .el-table__cell.first-index {
+      padding-left: 6px;
+    }
+    .el-table th.el-table__cell.is-leaf {
+      border-bottom-color: transparent;
+    }
+    .el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell {
+      background: #F5F5FB;
+    }
+    .tab-title {
+      font-size: 18px;
+      font-weight: 400;
+      color: #1D1D1D;
+      line-height: 28px;
+    }
+  </style>
+</head>
+
+<body>
+  {{include "/common/pchead.html"}}
+
+  <section class="see-container" v-cloak>
+    <div class="see-header flex w">
+      <div class="w1080">
+        <h3 class="tab-title">线上自助充值帐户</h3>
+        <div class="show-total-info-group">
+          <div class="show-total-info-item">
+            <div>附件下载包帐户余额<span class="file-pack-total">{points.total?points.total:0}</span>个</div>
+            <span>注:超级订阅用户每月享有下载10个附件的权限,也可充值附件下载包增加当月附件下载个数;每月1号上月附件下载余额清零重新计算。</span>
+          </div>
+          <button onclick="location.href = '/swordfish/page_big_pc/free/filePack/buy'">立即充值</button>
+        </div>
+      </div>
+    </div>
+    <div class="see-header flex w w1080" style=" margin-bottom: 30px;">
+      <div class="l-tabs flex">
+        <h3 class="tab-title">使用记录(当月已使用{seeList.total || 0}个)</h3>
+      </div>
+      <div class="l-tabs r-tabs">
+        <span class="r-word">选择月份</span>
+        <el-date-picker class="date-class" v-model="dateVal" type="month" format="yyyy年MM月" @change="dateHandler"
+          placeholder="请选择月份" :clearable="false" :editable="false">
+        </el-date-picker>
+        <i class="el-icon-arrow-down r-icons" ></i>
+      </div>
+    </div>
+    <div class="see-content w w1080" v-show="seeList.list.length !== 0 && empty">
+      <el-table
+              :data="seeList.list"
+              @cell-click="cellClick"
+              style="width: 100%">
+        <el-table-column
+                width="94"
+                type="index"
+                class-name="first-index"
+                label="序号"
+                :index="indexMethod">
+        </el-table-column>
+        <el-table-column
+                prop="s_fileName"
+                class-name="file-name"
+                label="附件"
+                width="384">
+        </el-table-column>
+        <el-table-column
+                prop="s_title"
+                width="384"
+                class-name="title-name ex-line2"
+                label="公告来源">
+        </el-table-column>
+        <el-table-column
+                prop="l_date"
+                width="218"
+                class-name="text-center"
+                label="下载时间">
+        </el-table-column>
+      </el-table>
+      <div class="el-pagination-container" v-show="seeList.total">
+        <el-pagination background layout="prev, pager, next, ->" :hide-on-single-page="true"
+          :current-page="seeList.pageNum" :page-size="seeList.pageSize" :total="seeList.total"
+          @current-change="onPageChange"></el-pagination>
+      </div>
+    </div>
+    <div class="no-data" v-if="working">
+      <el-image src="/images/working.gif"></el-image>
+      <div class="tip-text">
+        <p>剑鱼标讯正在努力工作中...</p>
+      </div>
+    </div>
+    <div class="no-data" v-if="seeList.list == 0 && empty">
+      <el-image src="/images/pc_12.png"></el-image>
+      <div class="tip-text">
+        <p>暂无数据</p>
+      </div>
+    </div>
+    <el-dialog
+      :visible.sync="helpDialog"
+      :show-close="false"
+      custom-class="custom-dialog"
+      width="380"
+      center>
+      <div>
+        每购买1个省,每月可查看<i>5个</i>采购单位画像,<i>上限为80个</i>,每月1号上月余额清零重新计算。
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="helpDialog = false">我知道了</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog
+      :visible.sync="tipDialog"
+      :show-close="false"
+      custom-class="custom-dialog"
+      width="380"
+      center>
+      <div>
+        每购买1个省,每月可查看<i>5个</i>采购单位画像,<i>上限为80个</i>,您当前订阅了
+        <span v-if="points.provin == -1">全国,查看机会已经消耗完毕,如需要更多服务,请前往联系客服。</span>
+        <span v-else>{points.provin}个省,如需查看更多,前往订阅更多省份。</span>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="tipDialog = false">取 消</el-button>
+        <el-button type="primary" @click.stop="goHandle(dialogBtnText)">{dialogBtnText}</el-button>
+      </div>
+    </el-dialog>
+  </section>
+
+  {{include "/common/pcbottom.html"}}
+  {{include "/common/baiducc.html"}}
+
+  <script>
+    haslogin({{.T.logid}})
+
+    function baiduEvent(name) {
+      try {
+        console.log(name, 'name')
+        _hmt.push(['_trackEvent', '超级订阅-pc', 'click', name]);
+      } catch (e) {
+        console.log('未初始化百度统计')
+      }
+    }
+  </script>
+  <script src="https://cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js"></script>
+  <script src="//cdn-common.jianyu360.com/cdn/lib/element-ui/2.15.7/lib/index.js"></script>
+  <script src='{{Msg "seo" "cdn"}}/common-module/public/js/china-map-data.js?v={{Msg "seo" "version"}}'></script>
+  <script>
+    function closeDialog() {
+      $(".dialog").css("display", "none")
+    }
+
+    function showTip() {
+      $(".dialog").css("display", "unset")
+    }
+  </script>
+  <script src='{{Msg "seo" "cdn"}}/frontRouter/pc/seeBuyerHistory/js/index-pc.js?v={{Msg "seo" "version"}}'></script>
+</body>
+
+</html>

+ 191 - 0
src/web/templates/frontRouter/wx/fileRecord/sess/index.html

@@ -0,0 +1,191 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+    <meta charset="utf-8">
+    <meta name="keywords" content="剑鱼标讯">
+    <meta name="description" content="剑鱼标讯">
+    <meta name="author" content="剑鱼标讯">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
+    <meta name="browsermode" content="application">
+    <meta name="x5-orientation" content="portrait">
+    <meta name="screen-orientation" content="portrait">
+    <meta name="x5-page-mode" content="app">
+    <meta name="apple-mobile-web-app-capable" content="yes">
+    <meta name="apple-mobile-web-app-status-bar-style" content="black">
+    <meta name="format-detection" content="telephone=no">
+    <title>附件下载包</title>
+    <script src="/big-member/js/rem.js"></script>
+    <!--S-当前页面的css资源-->
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/reset-css/5.0.1/reset.min.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/icon/local.css />
+    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/big-member/css/public.css">
+    <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/common-module/portraitRecord/css/index.css?v={{Msg "seo" "version"}}' />
+    <script src='https://cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js'></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/loadjs/4.2.0/dist/loadjs.umd.js"></script>
+    <style>
+      .pro-log .on{
+        color: #2ABED1!important;
+      }
+      .c-list{
+        background: rgb(245, 246, 247);
+      }
+      .c-list .ent-search-item{
+        margin-bottom: .12rem;
+      }
+      .ent-info-status-box{
+        display: flex;
+      }
+      .file-list-item {
+          display: flex;
+          flex-direction: row;
+          align-items: flex-start;
+          padding: 0.32rem;
+          box-sizing: border-box;
+          margin-bottom: 0.16rem;
+          background: #FFFFFF;
+      }
+      .file-list-item .file-icon img {
+          width: 0.48rem;
+          height: 0.48rem;
+          display: inline-block;
+      }
+      .file-list-item .file-icon {
+          flex-shrink: 0;
+          line-height: 0;
+          margin-right: 0.16rem;
+          display: none;
+      }
+      .file-info-group {
+          width: 100%;
+          display: flex;
+          flex-direction: column;
+      }
+      .file-list-item .file-title {
+          font-size: 0.3rem;
+          font-weight: 500;
+          color: #171826;
+          line-height: 0.44rem;
+          margin-bottom: 0.16rem;
+          word-break: break-all;
+      }
+      .file-list-item a {
+          width: 6.22rem;
+          text-decoration: underline;
+          overflow: hidden;
+          white-space: nowrap;
+          text-overflow: ellipsis;
+          font-size: 0.26rem;
+          font-weight: 500;
+          color: #2ABED1;
+          line-height: 0.4rem;
+          margin-bottom: 0.24rem;
+      }
+      .file-list-item .file-info img {
+          width: 0.32rem;
+          height: 0.32rem;
+      }
+      .file-list-item .file-info {
+          display: flex;
+          flex-direction: row;
+          justify-content: space-between;
+          align-items: center;
+          font-size: 0.22rem;
+          font-weight: 500;
+          color: #9B9CA3;
+          line-height: 0.4rem;
+      }
+      [v-cloak] {
+          opacity: 0;
+          transition: all 0.2s;
+      }
+    </style>
+    <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
+</head>
+<body>
+  <div class="j-container">
+    {{include "/big-member/header.html"}}
+    <div class="j-main portraited" id="proRecord" v-cloak>
+      <div class="j-container">
+        <div class="j-main">
+          <div class="t-bg flex">
+            <div class="nums">
+              <span v-if="points.total>=0">{points.total}</span>个
+              <img src='{{Msg "seo" "cdn"}}/common-module/portraitRecord/image/help-p.png?v={{Msg "seo" "version"}}' @click="helpTiped" alt="">
+            </div>
+            <div class="btns flex">
+              <span>当月附件下载余额</span>
+              <van-button round type="primary"  @click="setBook">立即充值</van-button>
+            </div>
+          </div>
+          <div class="p1-date" style="background: #F5F6F7;">
+            <div class="d-box flex">
+              使用记录
+              <van-field v-model="dValue" @click="usedHised" placeholder="选择年月" right-icon="play" readonly/>
+            </div>
+            <div class="word-tips">
+              当前已使用:<span>{points.usage}个</span>
+            </div>
+          </div>
+          <!-- 日期弹出框 -->
+          <van-popup v-model:show="pShow" round position="bottom">
+            <van-datetime-picker
+              v-model="curDate"
+              type="year-month"
+              title="选择日期"
+              :formatter="formatter11"
+              :min-date="minDate"
+              :max-date="maxTime"
+              @confirm="confirmed"
+              @cancel="canceled"
+            />
+          </van-popup>
+          <div class="c-list">
+            <van-list
+              v-model="listInfo.loading"
+              :finished="listInfo.finished"
+              finished-text=""
+              @load="onLoad"
+            >
+                <div  class="file-list-item" v-for="(item, i) in list" :key="i">
+                    <div class="file-icon">
+                        <img v-if="item.icon === 'doc'"  src="{{Msg "seo" "cdn"}}/common-module/file-pack/images/icon-word.png?v={{Msg "seo" "version"}}" :alt="item.icon">
+                        <img v-else  src="{{Msg "seo" "cdn"}}/common-module/file-pack/images/icon-rar.png?v={{Msg "seo" "version"}}" :alt="item.icon">
+                                </div>
+                    <div class="file-info-group">
+                        <div class="file-title">{item.s_fileName}</div>
+                        <a :href="item.articleUrl">来源:{item.s_title}</a>
+                        <div class="file-info">
+                            <span>于{item.l_date}下载</span>
+                            <img @click="downFile(item)" src="{{Msg "seo" "cdn"}}/common-module/file-pack/images/icon-down.png?v={{Msg "seo" "version"}}" alt="down">
+                        </div>
+                    </div>
+                </div>
+            </van-list>
+          </div>
+          <div class="emptycom" v-if="list.length==0 && empty">
+            <div class="emptyimg">
+              <img src='{{Msg "seo" "cdn"}}/common-module/collection/image/img-empty.png?v={{Msg "seo" "version"}}' alt="">
+            </div>
+            <div class="emptytext">
+              暂无附件下载记录
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+  <!--S-当前页面的资源-->
+  <script src='https://cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js'></script>
+  <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
+  <script src=//cdn-common.jianyu360.com/cdn/lib/zepto/1.2.0/zepto.min.js></script>
+  <!--E-当前页面的资源-->
+  {{include "/big-member/commonjs.html"}}
+  <script src='{{Msg "seo" "cdn"}}/common-module/public/js/utils.js'></script>
+  <script src='{{Msg "seo" "cdn"}}/common-module/public/js/china-map-data.js?v={{Msg "seo" "version"}}'></script>
+  <script src='{{Msg "seo" "cdn"}}/common-module/file-pack/js/index-wx.js?v={{Msg "seo" "version"}}'></script>
+  {{include "/common/baiducc.html"}}
+</body>
+
+</html>

+ 324 - 0
src/web/templates/order/pc/filePack/detail.html

@@ -0,0 +1,324 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <title>订单详情</title>
+    <meta content="增值服务" theme="light" name="enable-header"/>
+    <script>
+        var myPageNavIsNormal = true;
+    </script>
+    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/course/css/bootstrap.min.css?v={{Msg "seo" "version"}}">
+    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/course/iconfont/iconfont.css?v={{Msg "seo" "version"}}">
+    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/course/css/reset_pc.css?v={{Msg "seo" "version"}}">
+    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/course/css/order_detail.css?v={{Msg "seo" "version"}}">
+    {{include "/common/pnc.html"}}
+    <link href="{{Msg "seo" "cdn"}}/css/pc.css?v={{Msg "seo" "version"}}" rel="stylesheet">
+    <link href="{{Msg "seo" "cdn"}}/css/dev2/reset_pc.css?v={{Msg "seo" "version"}}" rel="stylesheet">
+    <link rel="stylesheet" type="text/css"
+          href="{{Msg "seo" "cdn"}}/pccss/public-nav-1200.css?v={{Msg "seo" "version"}}"/>
+    <script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/public-nav.js?v={{Msg "seo" "version"}}3"></script>
+    <!--[if lt IE 9]>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/html5shiv/3.7.3/html5shiv.min.js"></script>
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/respond-js/1.4.2/respond.min.js"></script>
+    <![endif]-->
+    <style>
+        .filter_data p {
+            font-size: 14px;
+            margin-bottom: 10px;
+        }
+
+        #order_detail {
+            line-height: 1;
+            padding-top: 76px;
+            padding-bottom: 0px !important;
+            background-color: #fff;
+        }
+
+        .qxBg {
+            border-top: 2px solid #999999;
+            background-color: #ececec;
+        }
+
+        .qxBgFont {
+            color: #686868;
+        }
+    </style>
+</head>
+<body>
+{{include "/common/pchead.html"}}
+<!-- header -->
+<!-- main  START -->
+<div class="order_detail" id="order_detail">
+    <div class="w order_crumb">
+        <a href="#" onclick="window.location.href='/front/swordfish/toMyOrder'">我的订单</a><em> > </em>
+        <a href="#" class="active">订单详情</a>
+    </div>
+    <div class="w order_main">
+        <!-- greenBg 为绿色背景及边框 redBg为红色背景及边框 -->
+        <div id="bg" class="o_m_thead greenBg">
+            <p class="order_id"></p>
+            <p class="clearfix order_state">
+                <!--greenFont为绿色字体 redFont为红色字体 -->
+                <span class="greenFont hide" id="status_success">已完成</span>
+                <span class="redFont hide" id="status_wait_pay">待付款</span>
+                <span class="qxBgFont hide" id="status_cancelled">已取消</span>
+
+                <a class="go_pay payOrder" style="display: none;">去支付</a>
+
+                <!-- 当状态为已完成时显示开发票 或 查看发票 -->
+                <a class="openinvoice go_pay" style="display: none;">开发票</a>
+                <a class="lookinvoice go_pay" style="display: none;">查看发票</a>
+            </p>
+        </div>
+
+        <div class="o_m_tbody">
+            <div class="b_list">
+                <div class="list_thead">
+                    <span class="fl">购买信息</span>
+                </div>
+                <div class="clearfix list_tbody">
+                    <div class="filter_data">
+                        <p><span class="hy_text">附件个数</span>:<span class="hysl"></span>个<span class="give_num"  style="color:#2CB7CA"></span></p>
+                        <p><span class="zq_text">有效期至</span>:<span class="dyzq"></span></p>
+                    </div>
+                </div>
+            </div>
+            <div class="b_list">
+                <div class="list_thead">
+                    <span class="fl">订单信息</span>
+                </div>
+                <div class="clearfix list_tbody">
+                    <div class="filter_data">
+                        <p>订单编号:<span class="order_code"></span></p>
+                        <p>下单时间:<span class="order_time"></span></p>
+                        <p class="pay_time_p" style="display: none;">支付时间:<span class="pay_time"></span></p>
+                        <p class="pay_way_p" style="display:none">支付方式:<span class="pay_way"></span></p>
+                        <p class="pay_num_p" style="display:none">支付单号:<span class="pay_num"></span></p>
+                        <p class="price_p" data-need-before-money>商品总价:<span class="price"></span> &nbsp; <span class="valuationList"
+                                                                                                                style="color:#2CB7CA;display:none;cursor:pointer">计费清单</span>
+                        </p>
+                    </div>
+                </div>
+            </div>
+        </div>
+
+    </div>
+    <div style="margin-top: 20px;"></div>
+    <!-- main END -->
+    {{include "/common/pcbottom.html"}}
+    {{include "/common/baiducc.html"}}
+    <script src="{{Msg "seo" "cdn"}}/course/js/jquery-2.1.4.min.js?v={{Msg "seo" "version"}}"></script>
+    <script src="{{Msg "seo" "cdn"}}/course/js/bootstrap.min.js?v={{Msg "seo" "version"}}"></script>
+    <!-- footer -->
+    <script>
+        $(function () {
+            $("#public-nav").css("background", "#fff");
+            $(".public-nav").css("border-bottom", "1px solid #e0e0e0");
+            $("section[id='drder']").css("padding-top", "80px");
+            haslogin({{.T.logid}});
+
+            var orderCode = getParam("order_code");
+            $(".order_id").text("订单编号:" + orderCode);
+            $.post("/subscribepay/orderListDetails/getOrderPayAllMsg", {"orderCode": orderCode}, function (r) {
+                if (r == '{"error":"需要登录!"}') {
+                    location.href = '/';
+                }
+                if (r.success) {
+                    //订单信息
+                    $(".order_code").text(orderCode);
+                    var filterObj = JSON.parse(r.data.order.filter);
+                    if (r.data.order.create_time) {
+                        $(".order_time").text(r.data.order.create_time.replace(/-/g, "."));
+                    }
+
+                    /*---S-优惠券---*/
+                    function insetMoneyItem () {
+                        // 商品总价=订单金额(order_money)+优惠金额(order.discount_price)
+                        var order_money = (r.data.order.order_money / 100)
+                        var getPayMoney = (r.data.order.pay_money / 100)
+                        var getCouponMoney = (r.data.order.discount_price / 100) || 0
+                        var prodMoney = (order_money * 100) + (getCouponMoney * 100)
+                        var insetDom = $('*[data-need-before-money]')
+
+                        $(".price").text("¥ " + formatMoney(prodMoney / 100) + "元");
+                        // 已取消和已退款订单不显示优惠信息
+                        if (r.data.order.order_status != -2 && r.data.order.order_status != -3) {
+                            if (getPayMoney) {
+                                insetDom.after('<p>实付金额:¥' + formatMoney(getPayMoney) +'元</p>')
+                            }
+                            if (getCouponMoney) {
+                                insetDom.after('<p>优惠金额:-¥' + formatMoney(getCouponMoney) +'元</p>')
+                            }
+                        }
+
+                    }
+                    insetMoneyItem()
+                    /*---E-优惠券---*/
+
+                    //优惠码
+                    if (r.data.order.isUsedActiveCode) {
+                        $(".discount-container").removeClass("hide");
+                        $(".highlight-text").text("赠送30天");
+                    }
+                    var give_cycle=filterObj.give_cycle;
+                    if (give_cycle!=undefined){
+                        give_cycle = give_cycle < 12 ? (give_cycle + '个月') : ('1年');
+                    }
+                    if (give_cycle) {
+                        $(".discount-container").removeClass("hide");
+                        $(".highlight-text").text("赠送"+give_cycle);
+                    }
+                    if (r.data.order.order_status == 1) {
+                        $("#status_success").removeClass("hide");
+                        if (r.data.order.pay_time){
+                            $(".pay_time_p").css("display", "");
+                            $(".pay_time").text(r.data.order.pay_time.replace("-", ".").replace("-", "."));
+                        }
+                        //支付方式
+                        if (r.data.order.pay_way && r.data.order.pay_way.indexOf("wx") > -1) {
+                            $(".pay_way_p").css("display", "");
+                            $(".pay_way").text("微信支付");
+                        } else if (r.data.order.pay_way && r.data.order.pay_way.indexOf("ali") > -1) {
+                            $(".pay_way").text("支付宝支付");
+                            $(".pay_way_p").css("display", "");
+                        }
+                        if (r.data.order.original_price == 0) {
+                            $(".pay_time_p").css("display", "none");
+                            $(".vip_type").text("(试用)");
+                        } else if (r.data.order.pay_money > 0){
+                            $(".pay_num_p").css("display", "");
+                            if (r.data.transaction_id) $(".pay_num").text(r.data.transaction_id);
+                            //发票
+                            if (r.data.order.applybill_status === 0) {
+                                $(".openinvoice").css("display", "");
+                            } else if (r.data.applybill_status === 1 || r.data.applybill_status === 2) {
+                                $(".lookinvoice").css("display", "").on("click", function () {
+                                    checkinvoice(r.data.applybill_status, orderCode)//查看发票
+                                })
+                            }
+                        }
+                    }
+                    if (r.data.order.order_status == -2 || r.data.order.order_status == -3) {
+                        $("#status_cancelled").removeClass("hide");
+                        $("#bg").addClass("qxBg").removeClass("greenBg");
+                    }
+                    if (r.data.order.order_status == 0) {
+                        $("#status_wait_pay").removeClass("hide");
+                        $("#bg").addClass("redBg").removeClass("greenBg");
+                        $(".payOrder").show();
+                    }
+                    // 展示字段
+                    $('.filter_data .level').text(filterObj.pType == '1' ? '标准' : '高级')
+                    $('.filter_data .dyzq').text(filterObj.validTime.replace(/-/g, '.'))
+                    $('.filter_data .hysl').text(filterObj.num)
+                    $('.filter_data .give_num').text((filterObj.give_cycle > 0 ? ' 赠'+filterObj.give_cycle + '个' : ''))
+                    $(".payOrder").on("click", function () {
+                        location.href = "/front/filePack/orderPay/" + orderCode;
+                    })
+
+                    //计价清单
+                    var filterObj = JSON.parse(r.data.order.filter);
+                    var upgradeSubtotail = filterObj.upgradeSubtotail;
+                    if (upgradeSubtotail) {	//有则显示
+                        $(".valuationList").css("display", "");
+                        $(".valuationList").on("click", function () {
+                            window.location.href = "/front/order/valuationList/" + orderCode;
+                        })
+                    }
+                }
+            })
+
+
+            $(".openinvoice").on("click", function () {
+                //return false // 待可开发票时删除
+                $.post("/subscribepay/orderListDetails/isOver", {"order_code": orderCode}, function (r) {
+                    if (r.status != 1) {
+                        window.open("/front/order/invoicetimeOut", '_self');
+                    } else {
+                        window.open("/front/order/invoice/" + orderCode, '_self');
+                    }
+                })
+            })
+        })
+
+        // 格式化金钱的函数
+        // s: 金额(number) 必传
+        // n: 保留小数的位数(int:0-100)
+        function formatMoney(s, n) {
+            if (n === undefined) {
+                n = -1
+            } else {
+                n = n > 0 && n <= 20 ? n : 2;
+            }
+            var intS = parseInt(s)
+            var point = '.'
+            var left;
+            var right;
+            s = parseFloat((s + '').replace(/[^\d\.-]/g, ''))
+            // 没传n,默认(如果为整数,则不保留小数。如果为浮点数,则保留两位小数)
+            if (n === -1) {
+                if (s === intS) {
+                    n = 0
+                    right = ''
+                    point = ''
+                } else {
+                    n = 2
+                    s = s.toFixed(n);
+                    right = s.split('.')[1];
+                }
+                s = s + ''
+                left = s.split('.')[0].split("").reverse();
+            } else {
+                s = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(n) + '';
+                left = s.split('.')[0].split('').reverse();
+                right = s.split('.')[1];
+            }
+
+            t = "";
+            for (i = 0; i < left.length; i++) {
+                t += left[i] + ((i + 1) % 3 == 0 && (i + 1) != left.length ? ',' : '');
+            }
+
+            var money = t.split('').reverse().join('') + point + right;
+            return money;
+        }
+
+
+        /******* 获取url参数(正则)********/
+        function getParam(name) {
+            var search = document.location.search;
+            // alert(search);
+            var pattern = new RegExp("[?&]" + name + "\=([^&]+)", "g");
+            var matcher = pattern.exec(search);
+            var items = null;
+            if (null != matcher) {
+                try {
+                    items = decodeURIComponent(decodeURIComponent(matcher[1]));
+                } catch (e) {
+                    try {
+                        items = decodeURIComponent(matcher[1]);
+                    } catch (e) {
+                        items = matcher[1];
+                    }
+                }
+            }
+            return items;
+        };
+        //查看发票
+        function checkinvoice(flag, orderCode) {
+            if (flag === 2) {
+                var showHtml = '<div style="width: 100%;height: 100%;z-index: 999; position: absolute;top: 0;background: rgba(0, 0, 0, 0.65);">   <div style="position: fixed;z-index: 9999;width: 540px;height: 262px;left: 50%;top: 30%;margin-left: -270px;background-color: #fff;border-radius: 6px;padding: 32px;display: flex;flex-direction: column;justify-items: center;align-items: center;">       <div class="invoice_title" style="color: #1D1D1D;font-size: 18px;line-height: 28px;">提示</div>       <div class="invoice_body"            style="height: 78px;margin: 20px 0px;font-size: 14px;line-height: 24px;text-align: center;">           您已开具发票<br>           如有问题请联系客服<br>           400-108-6670       </div>       <div class="invoice_control"            style="width: 132px;height: 36px;text-align: center;background: #2CB7CA;border-radius: 6px;font-size: 16px;line-height: 36px;color: #FFFFFF;cursor: pointer;"            onclick="document.querySelector(\'#invoice_tip\').remove()"       >           我知道了       </div>   </div>\n</div>'
+                var div_invoice_tip = document.createElement('div');
+                div_invoice_tip.innerHTML = showHtml;
+                div_invoice_tip.id = "invoice_tip"
+                document.body.appendChild(div_invoice_tip)
+                return
+            }
+            window.open("/front/order/check_invoice/" + orderCode, '_self');
+        }
+    </script>
+</body>
+</html>

+ 39 - 0
src/web/templates/order/pc/paySuccess.html

@@ -45,6 +45,11 @@
                 <p style="margin-top: 6px;"> 充值成功!</p>
                 <p class="datapackage-money-tip-group">¥<span></span></p>
                 <p class="datapackage-tip-group">数据流量包+<span></span>条</p>
+            {{else if eq .T.orderType "filePack"}}
+                <p style="margin-top: 6px;"> 充值成功!</p>
+                <p class="file-info datapackage-money-tip-group">¥<span name="file-price"></span></p>
+                <p class="file-info datapackage-tip-group"><span name="file-num"></span>个附件下载</p>
+                <p class="file-info datapackage-tip-group">有效期至<span name="file-time"></span></p>
             {{else}}
                 <p>支付成功!</p>
             {{end}}
@@ -93,6 +98,8 @@
                 <a class="check_order" href="/front/aiForecastPack/aiForecastPackDetail?order_code={{.T.orderCode}}">查看订单</a>
             {{else if eq .T.orderType "bidfile"}}
                 <a class="check_order" href="/front/bidfile/bidfileDetail?order_code={{.T.orderCode}}">查看订单</a>
+            {{else if eq .T.orderType "filePack"}}
+                <a class="check_order" href="/front/file/packDetail?order_code={{.T.orderCode}}">查看订单</a>
             {{else if eq .T.orderType "integral"}}
              <p class="order_item">
                 <span>剑鱼币余额:</span>
@@ -107,6 +114,38 @@
 {{include "/common/pcbottom.html"}}
 <script type="text/javascript">
     var myPageNavIsNormal = true;
+    var orderType = {{.T.orderType}}
+    if (orderType === 'filePack') {
+        getFilePackInfo()
+    }
+    function getFilePackInfo () {
+        $.ajax({
+            type: 'POST',
+            url: '/subscribepay/orderListDetails/getOrderPayAllMsg',
+            data: {
+                orderCode: {{.T.orderCode}}
+            },
+            success: function (res) {
+                if (res && res.errMsg === '' && res.data) {
+                    console.log(res.data)
+                    try {
+                        switch (res.data.order.product_type) {
+                            case '附件下载包': {
+                                var tempNode = $('.file-info')
+                                var tempInfo = JSON.parse(res.data.order.filter)
+                                tempNode.find('span[name="file-price"]').text(res.data.order.pay_money / 100)
+                                tempNode.find('span[name="file-num"]').text('+' + tempInfo.num)
+                                tempNode.find('span[name="file-time"]').text(tempInfo.validTime.replace(/-/g, '/'))
+                                break
+                            }
+                        }
+                    } catch (e) {
+                        console.warn(e)
+                    }
+                }
+            }
+        })
+    }
     $(function () {
         var payway = getParam('payway')
         if (payway) {

+ 59 - 43
src/web/templates/pc/biddetail_rec.html

@@ -925,9 +925,9 @@
           <span style="font-weight: 400;font-size: 16px">附件下载</span>
           <span class="free-download">免费下载1次</span>
           <span class="super-vip-show" style="display:none;">
-            <span class="file-count-tip">本月剩余:<i class="file-count"></i> 次</span>
+            <span class="file-count-tip">本月剩余:  <i class="file-count"></i>个</span>
             <img class="file-icon-help" src="/images/help-b.png" alt="">
-            <span class="concat-kf open-customer">联系客服</span>
+            <span class="concat-kf recharge-new">立即充值</span>
           </span>
           <span class="free-go-open" style="display:none;">
             <span>如需下载更多附件,请开通超级订阅</span>
@@ -3479,18 +3479,59 @@ function fromwhere(text){
   function cjdyDownload (fname) {
 	  $.ajax({
 		  type:'post',
-		  url:'/publicapply/attachment/get',
+		  //url:'/publicapply/attachment/get',
+		  url:'/jypay/resourcePack/consumePack',
 		  data:{
-			  infoId:{{.T.obj._id}}
+		    id:{{.T.obj._id}},
+			productName:"附件下载包",
+			platform:"PC",
+			fileName:fname,
+			title:{{.T.obj.title}}
   		  },
-		  success:function(data){
-			  if(data.data && data.data.attachment !=null && data.data.attachment.length!==0){
-				  for(var i=0;i<data.data.attachment.length;i++) {
-					  //console.log(fname)
-					  if(fname == data.data.attachment[i].filename){
-						  goDownload(data.data.attachment[i].downurl)
+	  success:function(data){
+        if(data){
+          if (data.r&&data.r.code&&data.r.code<0&&window.vipStatus>0){
+            // 次数用完提醒去充值
+						bidVue.$confirm('您本月附件下载机会已消耗完毕,如需下载更多附件,请前往充值。', {
+							showClose:false,
+							center: true,
+							confirmButtonText: '立即充值',
+							customClass: 'custom-alert',
+							showCancelButton: true,
+							confirmButtonClass: 'custom-confirm-btn',
+							cancelButtonClass: 'custom-cancel-btn',
+							cancelButtonText: '取消'
+						}).then(function(data){
+              location.href = '/swordfish/page_big_pc/free/filePack/buy'
+						}).catch(function(){
+							//$('.open-customer').trigger('click')
+							//$('body').trigger('click')
+						});
+          }else if ((data.m && data.m!="")||data.r["downUrl"]==undefined||data.r["downUrl"]==""){
+            bidVue.$confirm('附件下载异常,请前往联系客服。', {
+							showClose:false,
+							center: true,
+							confirmButtonText: '取消',
+							customClass: 'custom-alert',
+							showCancelButton: true,
+							confirmButtonClass: 'custom-cancel-btn',
+							cancelButtonClass: 'custom-confirm-btn',
+							cancelButtonText: '联系客服'
+						}).then(function(data){
+
+						}).catch(function(){
+							$('.open-customer').trigger('click')
+							$('body').trigger('click')
+						});
+          }else{
+            if(data.r&&fname == data.r["fileName"]){
+              if (!data.r["isExists"]){
+                $(".file-count").text($(".file-count").text()-1);
+              }
+              location.href = data.r["downUrl"]
+              //goDownload(data.r["downUrl"])
 					  }
-				  }
+          }
 			  }
 	  }
   });
@@ -3521,16 +3562,6 @@ function fromwhere(text){
             $("#attach-list").css("display","").find(".download-list").html(html)
           }
 			$(".downs").click(function (){
-        if (isPCWeChat()){
-          bidVue.$alert('请您使用谷歌等浏览器登录剑鱼标讯官网,使用附件下载服务,官网地址:https://www.jianyu360.cn', {
-						showClose:false,
-						center: true,
-						confirmButtonText: '我知道了',
-						customClass: 'custom-alert',
-						confirmButtonClass: 'custom-confirm-btn'
-					});
-					return
-        }
 				var name = $(this).find('a').text()
 				var fname = name.replace(/^\d+./, '')
 				if(window.isFree){
@@ -3539,6 +3570,7 @@ function fromwhere(text){
             // 弹窗留资弹框,第一个参数为source,第二个是留资成功后是否需要刷新页面 可不传,不传即为不刷新
             vm.noCallApiFn('article_attach_freeuser', true)
 					}else if (window.freeFile > 0 ){
+            window.freeFile = -1
 						// 留过资 更新下载次数 进入附件下载页面
 						cjdyDownload(fname)
 					}else {
@@ -3566,27 +3598,7 @@ function fromwhere(text){
 					if (window.vipStatus > 0) {
 						// 是新超级订阅用户
 						if (window.viper) {
-							// 有下载次数
-							if (window.fileNum > 0 ) {
-								cjdyDownload(fname)
-							} else {
-								// 次数用完提醒联系客服
-								bidVue.$confirm('您本月查看机会已经消耗完毕,如需要更多服务,请前往联系客服。', {
-									showClose:false,
-									center: true,
-									confirmButtonText: '取消',
-									customClass: 'custom-alert',
-									showCancelButton: true,
-									confirmButtonClass: 'custom-cancel-btn',
-									cancelButtonClass: 'custom-confirm-btn',
-									cancelButtonText: '联系客服'
-								}).then(function(data){
-
-								}).catch(function(){
-									$('.open-customer').trigger('click')
-									$('body').trigger('click')
-								});
-							}
+              cjdyDownload(fname)
 						} else {
 							// 老超级订阅用户 提醒升级
 							bidVue.$alert('对不起,暂无权限,您可升级超级订阅解锁附件下载', '升级超级订阅', {
@@ -3651,6 +3663,10 @@ function fromwhere(text){
     if (window.vipStatus > 0 && window.viper) {
       $('.super-vip-show').show()
       $('.super-vip-show .file-count').html(window.fileNum)
+      $('.recharge-new').unbind("click").bind("click",function(){
+        //超级订阅附件下载立即充值页面
+        window.open("/swordfish/page_big_pc/free/filePack/buy")
+      })
     }
 	  // 大会员隐藏次数
 	  if(window.memberStatus >0 && window.memberPower.indexOf(3) >= 0){
@@ -3671,7 +3687,7 @@ function fromwhere(text){
     }, 1000);
     // 下载提示
     $('.file-icon-help').click(function() {
-      bidVue.$alert('点击附件即为下载,系统会扣除当月附件下载次数;每月下载次数有限,次月清零,请合理使用。',  {
+      bidVue.$alert('点击附件即为下载,系统会扣除当月附件下载个数;每月1号上月余额清零重新计算,请合理使用。',  {
         showClose:false,
         center: true,
         confirmButtonText: '我知道了',

+ 19 - 1
src/web/templates/pc/myOrder.html

@@ -273,6 +273,10 @@
                                     <p>使用有效期:@#item.filter.validYear#@年</p>
                                     <p>数据规格:@#item.filter.pType == '1' ? '标准' : '高级'#@字段包</p>
                                 </div>
+                                <div class="fl shop_main" v-if="item.product_type === '附件下载包'">
+                                    <p>附件个数:@#item.filter.num#@个<span style="color: #2cb7ca;"> @#item.filter.give_cycle >0 ? '赠' + item.filter.give_cycle +'个': ''#@</span></p>
+                                    <p>有效期至:@#item.filter.validTime | FormatStrSplit#@</p>
+                                </div>
                                 <div class="fl shop_main" v-if="item.product_type === '中标必听课'">
                                     <p>课程名称:@#item.filter.s_name#@</p>
                                     <p>课程类型:中标必听课</p>
@@ -596,7 +600,7 @@
       delimiters: ['@#', '#@'],
       data: function () {
         return {
-          typeEnum: ["VIP订阅", "中标必听课", "企业商机管理", "剑鱼币", "历史数据", "大会员", "大会员-AI中标预测包", "大会员-子账号", "大会员-招标文件解读", "大会员-补充包", "招标文件解读", "数据报告", '数据流量包', '省份订阅包'],
+          typeEnum: ["VIP订阅", "中标必听课", "企业商机管理", "剑鱼币", "历史数据", "大会员", "大会员-AI中标预测包", "大会员-子账号", "大会员-招标文件解读", "大会员-补充包", "招标文件解读", "数据报告", '数据流量包', '省份订阅包', '附件下载包'],
           imgMap: {
             'VIP订阅': {
               icon: '/electronic_invoice/image/vipBook.png'
@@ -610,6 +614,9 @@
             '剑鱼币': {
               icon: '/order/image/jianyubi.png'
             },
+            '附件下载包': {
+              icon: '/order/image/file.png'
+            },
             '历史数据': {
               icon: '/electronic_invoice/image/dataOutput.png'
             },
@@ -703,6 +710,9 @@
         FormatDateFn: function (value) {
           return new Date(value * 1000).Format('yyyy/MM/dd')
         },
+        FormatStrSplit: function (value) {
+          return value.replace(/-/g, '.')
+        },
         formatAreaText: function (value, old) {
             return value === -1  ? '全国' : ((old ? (value - old) : value)  + '个省')
         },
@@ -987,6 +997,10 @@
               href = '/front/integral/orderPay/' + item.order_code
               break
             }
+            case '附件下载包': {
+              href = '/front/filePack/orderPay/' + item.order_code
+              break
+            }
             case '数据流量包': {
                 var tempTotal = Number(item.filter.pNum) + Number(item.filter.give_cycle > 0 ? item.filter.give_cycle : 0)
                 href = '/front/datapackage/orderPay/' + item.order_code + "?total=" + tempTotal
@@ -1170,6 +1184,10 @@
               href = '/front/integral/integralDetail?order_code=' + item.order_code
               break
             }
+            case '附件下载包': {
+              href = '/front/file/packDetail?order_code=' + item.order_code
+              break
+            }
             case '数据流量包': {
               href = '/front/dataPack/packDetail?order_code=' + item.order_code
               break

+ 1 - 1
src/web/templates/pc/subscribe_new.html

@@ -320,7 +320,7 @@
                     </li>
                     <li class="double">50个画像/省</li>
                     <li class="gold double">5个画像/省</li>
-                    <li class=" double">10/月</li>
+                    <li class=" double">10/月</li>
                     <li class="gold"><i class="right"></i></li>
                     <li>300组</li>
                     <li>招标公告+国家企业公示</li>

+ 123 - 0
src/web/templates/weixin/commonPay/filePack/createorder.html

@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+    <!--引入公共资源头部-->
+    {{include "/big-member/wx/meta.html"}}
+    <title>附件下载包充值</title>
+    <!--S-当前页面的css资源-->
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/reset-css/5.0.1/reset.min.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/icon/local.css />
+    <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/big-member/css/j-icons.css?v={{Msg "seo" "version"}}'>
+    <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/common-module/coupon/css/pay-order-template.css?v={{Msg "seo" "version"}}' />
+    <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/common-module/area-pack/css/buy.css?v={{Msg "seo" "version"}}' />
+    <style>
+      .notes-section .notes-section-content,
+      .notes-section .notes-section-title {
+        color: inherit;
+      }
+      .notes-section {
+        padding: 0;
+        border: 0;
+        font-size: 0.24rem;
+        font-weight: 500;
+        color: #9B9CA3;
+        line-height: 0.36rem;
+      }
+      .order-phone-group {
+        border-radius: 0;
+        margin: 0;
+      }
+      .top-tip-banner {
+        width: 7.5rem;
+        height: 0.88rem;
+        line-height: 0.88rem;
+        text-align: center;
+        background: #FEE9E8;
+        font-size: 0.26rem;
+        font-weight: 500;
+        color: #FB483D;
+      }
+    </style>
+</head>
+<body>
+<div class="j-container">
+    {{include "/big-member/header.html"}}
+    <div class="j-main" id="app" v-cloak>
+        <div class="j-container">
+            <div class="j-main">
+          <div class="top-tip-banner">使用有效期至${endTime}<span v-if="endDay > 0">(剩 ${endDay} 天)</span></div>
+                <div class="spec-list-container border-line-t" v-if="buyType !== 'upgrade'">
+                    <div class="spec-title" v-show="specTitleShow">请选择规格</div>
+                    <div class="spec-list">
+                        <div
+                                class="spec-item"
+                                :class="{ active: item.cycleType == specActive }"
+                                v-for="(item, index) in specList"
+                                @click="clickSpec(item)"
+                                :key="index">
+                            <span class="preferential-tag" v-if="preferentialShow">限时x折</span>
+                            <div class="spec-i-label">
+                                <span class="spec-i-l-text">${item.label}</span>
+                                <span class="spec-i-l-info" v-if="item.labelSubInfo" v-html="item.labelSubInfo"></span>
+                            </div>
+                            <div class="spec-i-sub">
+                                <div class="spec-i-text del" v-show="item.before">&yen; ${ item.before || 0 }</div>
+                                <div class="spec-i-text"><span>&yen;</span> <span class="price-count">${ item.price }</span></div>
+                            </div>
+<!--                <div class="spec-i-desc">${ item.desc }</div>-->
+                        </div>
+                    </div>
+                </div>
+                <div class="order-phone-group" :class="{ error: !validatorPhonePass }">
+                    <label for="order_phone">手机号码</label>
+                    <input id="order_phone" v-model="userInfo.phone" autocomplete='off' placeholder='请输入手机号码' maxlength='11' type='tel' />
+                    <p class="error-message">手机号码输入错误</p>
+                </div>
+                <div class="notes-to-buy">
+                    <section class="notes-section">
+                        <p class="notes-section-title">购买须知</p>
+                        <div class="notes-section-content" v-if="buyType === 'buy' || buyType === 'renew'">
+                1.仅限超级订阅用户充值附件下载个数时使用,可多次购买。<br />
+                2.使用有效期仅限超级订阅服务周期内的当月,次月清零,不可转赠。
+                        </div>
+                    </section>
+                </div>
+            </div>
+            <div class="j-footer">
+                <pay-order-template ref="couponRef" :config="bottomConf" @update="updateS" @save="savePageState" @update-coupon="afterUpdateCoupon"></pay-order-template>
+            </div>
+        </div>
+        <van-popup v-model="dialog.backTip" get-container="body" class="back-tip-wrapper" :close-on-click-overlay="false">
+            <div class="b-t-title">
+                <img src="/common-module/area-pack/images/messageTitle@3x.png" alt="">
+            </div>
+            <div class="b-t-content">
+                <div class="b-t-content-item">
+                    多订阅1个省份,获取商机概率<br />增加一倍,邀您体验!
+                </div>
+                <div class="b-t-content-item bg-f-orange">
+                    支持用户增加订阅区域时使用,每增购1个省可获取该省的招标采购信息
+                </div>
+                <div class="b-t-content-item bg-f-orange">
+                    按时间(月/季/年)、订阅省份个数计价,${perMonthArea}元省/月起。
+                </div>
+            </div>
+            <div class="b-t-footer">
+                <button class="button cancel" @click="dialog.backTip = false;history.back()">取消</button>
+                <button class="button confirm" @click="dialog.backTip = false">去购买</button>
+            </div>
+        </van-popup>
+    </div>
+</div>
+<!--S-当前页面的资源-->
+<script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
+<script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
+<script src=//cdn-common.jianyu360.com/cdn/lib/zepto/1.2.0/zepto.min.js></script>
+{{include "/big-member/wx/commonjs.html"}}
+<script src='{{Msg "seo" "cdn"}}/common-module/coupon/js/pay-order-template.js?v={{Msg "seo" "version"}}'></script>
+<script src='{{Msg "seo" "cdn"}}/common-module/file-pack/js/buy.js?v={{Msg "seo" "version"}}'></script>
+<!--E-当前页面的资源-->
+</body>
+
+</html>

+ 117 - 0
src/web/templates/weixin/commonPay/filePack/orderDetail.html

@@ -0,0 +1,117 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+    <meta charset="utf-8">
+    <meta name="keywords" content="剑鱼标讯">
+    <meta name="description" content="剑鱼标讯">
+    <meta name="author" content="剑鱼标讯">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
+    <meta name="browsermode" content="application">
+    <meta name="x5-orientation" content="portrait">
+    <meta name="screen-orientation" content="portrait">
+    <meta name="x5-page-mode" content="app">
+    <meta name="apple-mobile-web-app-capable" content="yes">
+    <meta name="apple-mobile-web-app-status-bar-style" content="black">
+    <meta name="format-detection" content="telephone=no">
+    <title>订单详情</title>
+    <!--S-当前页面的css资源-->
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/reset-css/5.0.1/reset.min.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/icon/local.css />
+    <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/big-member/css/j-icons.css?v={{Msg "seo" "version"}}'>
+    <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/big-member/css/public.css?v={{Msg "seo" "version"}}'>
+    <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/common-module/order-list/css/order-detail.css?v={{Msg "seo" "version"}}' />
+</head>
+<body>
+    <div class="j-container">
+        <div class="j-main order-detail" id="app" v-cloak>
+            <div class="j-container">
+                <div class="j-main no-scrollbar">
+                    <div class="wrapper">
+                        <div class="header-pic arc-container" :class="orderStateMap[orderInfo.state].bgcClassName">
+                            <div class="order-state">${ orderStateMap[orderInfo.state].text }</div>
+                            <div class="surplus-time" v-if="orderStateMap[orderInfo.state].surplusTimeShow && orderInfo.surplusTime > 0">
+                                <span>剩余支付时间:</span>
+                                <van-count-down @finish="onCountdownFinish" :time="orderInfo.surplusTime"></van-count-down>
+                            </div>
+                        </div>
+                        <div class="card-list">
+                            <div class="j-card report-p">
+                                <span class="rp-left" :class="'badge-' + (orderInfoFilter.badge || '')">
+                                    <img class="card-l-pic" :src="orderInfo.headerImg">
+                                </span>
+                                <span class="rp-right">
+                                    <span class="product-type">${ orderInfo.productType }</span>
+                                    <span class="pay-money">&yen; ${ orderInfo.payMoney }</span>
+                                </span>
+                            </div>
+                            <div class="j-card product-info">
+                                <div class="j-card-title">购买信息</div>
+                                <div class="j-card-items">
+                                    <div
+                                        class="j-card-item"
+                                        :class="item.className"
+                                        v-for="(item, index) in orderInfo.productInfoList"
+                                        :key="index"
+                                        v-show="item.text"
+                                    >
+                                        <span class="card-item-l">${ item.label + item.split }</span>
+                                        <span class="card-item-r" v-html="item.text"></span>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="j-card report-info">
+                                <div class="j-card-title">订单信息</div>
+                                <div class="j-card-items">
+                                    <div
+                                        class="j-card-item"
+                                        :class="item.className"
+                                        v-for="(item, index) in orderInfo.orderInfoList"
+                                        :key="index"
+                                        v-show="item.text"
+                                    >
+                                        <span class="card-item-l">${ item.label + item.split }</span>
+                                        <span class="card-item-r" v-html="item.text"></span>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div class="j-button-group j-footer" v-show="buttonGroupShow">
+                    <button
+                        class="j-button-confirm pay"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.pay"
+                        @click="onConfirmPay">立即支付</button>
+                    <button
+                        class="j-button-cancel invoke"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.invoke"
+                        @click="lookInvoke">${ invokeButtonText }</button>
+                    <button
+                        class="j-button-confirm buy-again"
+                        v-if="orderStateMap[orderInfo.state].bottomButtonShow.buyAgain"
+                        @click="buyAgain">再次购买</button>
+                </div>
+            </div>
+        </div>
+    </div>
+    <!--S-当前页面的资源-->
+    <script src="/big-member/js/rem.js"></script>
+    <script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
+    <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
+    <script src=//cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js></script>
+    <!--E-当前页面的资源-->
+    <script>
+        var pageInfo = {
+            platform: 'wx',
+            version: {{Msg "seo" "version"}},
+        }
+    </script>
+    <script src='{{Msg "seo" "cdn"}}/big-member/js/utils.js?v={{Msg "seo" "version"}}'></script>
+    <script src='{{Msg "seo" "cdn"}}/common-module/order-list/js/order-list-config.js?v={{Msg "seo" "version"}}'></script>
+    <script src='{{Msg "seo" "cdn"}}/common-module/order-list/js/order-detail.js?v={{Msg "seo" "version"}}'></script>
+    {{include "/common/baiducc.html"}}
+</body>
+
+</html>

+ 43 - 3
src/web/templates/weixin/commonPay/paySuccess.html

@@ -12,6 +12,17 @@
     <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wxCommonPay/css/public.css?v={{Msg "seo" "version"}}">
     <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wxCommonPay/css/pay_success.css?v={{Msg "seo" "version"}}">
     <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/css/wxbutton.css?v={{Msg "seo" "version"}}">
+    <style>
+        .info-box .info-item span.light-text {
+            color: #2ABED1;
+        }
+        .info-box .info-item {
+            font-size: 0.26rem;
+            font-weight: 500;
+            color: #9B9CA3;
+            line-height: 0.36rem;
+        }
+    </style>
 </head>
 <body>
 <div class="vip_pay_success layout_top-bottom">
@@ -25,7 +36,9 @@
             </p>
         </div>
         <div class="info-box">
-            <div class="info-item"></div>
+            <div class="info-item" name="附件下载包" style="display: none">
+                <span>附件下载:<span class="light-text" name="file-num"></span></span>&nbsp;&nbsp;|&nbsp;&nbsp;<span>有效期至:<span class="light-text" name="file-time"></span></span>
+            </div>
         </div>
         <div class="info_box">
             <div class="pay_mode">
@@ -79,7 +92,7 @@
             继续浏览
         </button>
     </div>
-    {{else if or (eq .T.doType "dataPack") (eq .T.doType "areaPack")}}
+    {{else if or (eq .T.doType "dataPack") (eq .T.doType "areaPack") (eq .T.doType "filePack")}}
         <div class="bottom_button j-button-group">
             <button id ="order" class="j-button-confirm" onclick="window.location.href = '/weixin/common/{{.T.doType}}/orderDetail?order_code={{.T.orderCode}}'">
                 查看订单
@@ -91,6 +104,33 @@
 <script src="https://cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js"></script>
 <script src="{{Msg "seo" "cdn"}}/big-member/js/utils.js?v={{Msg "seo" "version"}}"></script>
 <script>
+    $.ajax({
+        type: 'POST',
+        url: '/subscribepay/orderListDetails/getOrderPayAllMsg',
+        data: {
+            orderCode: {{.T.orderCode}}
+        },
+        success: function (res) {
+            if (res && res.errMsg === '' && res.data) {
+                console.log(res.data)
+                try {
+                    switch (res.data.order.product_type) {
+                        case '附件下载包': {
+                            var tempNode = $('.info-box .info-item[name="附件下载包"]')
+                            var tempInfo = JSON.parse(res.data.order.filter)
+                            tempNode.find('span[name="file-num"]').text('+' + tempInfo.num)
+                            tempNode.find('span[name="file-time"]').text(tempInfo.validTime.replace(/-/g, '/'))
+                            tempNode.show()
+                            document.title = '附件下载包充值'
+                            break
+                        }
+                    }
+                } catch (e) {
+                    console.warn(e)
+                }
+            }
+        }
+    })
     $(function () {
         var payTime = {{.T.payTime}}
         var price ={{.T.price}}
@@ -179,7 +219,7 @@
         if (orderFilter.give_cycle) {
             var giveCycle = orderFilter.give_cycle;
             var giveType = orderFilter.give_type; //时间类型:1/天、2/月
-            
+
             if (giveCycle) {
                 if (giveType==1) {
                     give = giveCycle+"天";

+ 13 - 0
src/web/templates/weixin/my.html

@@ -23,6 +23,9 @@
 .icon-data-pack {
     background-image: url("/common-module/data-pack/images/data.png");
 }
+.icon-file-pack {
+    background-image: url("/common-module/file-pack/images/icon-down-gray.png");
+}
 </style>
 
 <body>
@@ -197,6 +200,16 @@
                             <span class="j-icon base-icon icon-data-pack"></span>
                             <span class="m-l-i-label">我的数据流量包</span>
                         </div>
+                        <div class="m-l-i-right">
+                            <div></div>
+                            <span class="j-icon base-icon icon-arrow-right"></span>
+                        </div>
+                    </div>
+                    <div style="display: none" class="menu-list-item clickable data-pack" id="file-pack" data-href="/weixin/frontPage/fileRecord/sess/index">
+                        <div class="m-l-i-left" style="flex: unset;margin-right: 0.16rem;">
+                            <span class="j-icon base-icon icon-file-pack"></span>
+                            <span class="m-l-i-label">我的附件下载包</span>
+                        </div>
                         <div class="m-l-i-right">
                             <div class="preferential-tag">New</div>
                             <span class="j-icon base-icon icon-arrow-right"></span>

+ 105 - 36
src/web/templates/weixin/wxinfocontent_rec.html

@@ -654,6 +654,15 @@ pre {
   font-size: .22rem;
   line-height: normal;
 }
+.go-buy-file-pack {
+  display: none;
+  padding: 0.06rem .16rem;
+  background:  #2ABDD1;
+  border-radius: 8px;
+  color:#fff;
+  font-size: .22rem;
+  line-height: normal;
+}
 .icon-help{
   display: none;
   width: .32rem;
@@ -738,7 +747,7 @@ em {
         border-spacing: 0px !important;
         text-align: center;
       }
-      #h_content table tr td,.h_content table th{ 
+      #h_content table tr td,.h_content table th{
         border: 1px solid #EBEBEB;
       }
 </style>
@@ -1105,9 +1114,10 @@ em {
                         <div class="join">
                             附件下载
                             <span class="free-down-text">免费用户享有1次附件下载权益</span>
-                            <span class="file-count-tip">本月剩余:<em class="file-count"></em></span>
+                            <span class="file-count-tip">本月剩余:<em class="file-count"></em></span>
                             <span class="icon-help"></span>
                             <span class="concat-kf">联系客服</span>
+							<span class="go-buy-file-pack" style="display: none">立即充值</span>
                             <span class="free-open-tip" style="display: none;">
                               <span class="down-more-text">下载更多附件</span>
                               <span class="open-vip-btn">开通超级订阅</span>
@@ -1706,7 +1716,7 @@ function isOpening() {
           //非大会员或大会员无此功能 且是新超级订阅用户
           if (res.data && res.data.vipStatus > 0 && res.data.viper&&!window.isMemberAndPower) {
             $('.file-count-tip').css('display', 'inline-block')
-            $('.concat-kf').css('display', 'inline-block')
+            $('.go-buy-file-pack').css('display', 'inline-block')
             $('.icon-help').css('display', 'inline-block')
             $('.file-count').html(res.data.fileNum)
           }
@@ -1739,6 +1749,23 @@ function getDrainInfo () {
 		})
 }
 
+function openFileDown (url) {
+	try {
+		if (!mySysIsIos() && /\.(jpeg|jpg|png)$/.test(url)) {
+			wx.previewImage({
+				current: url, // 当前显示图片的http链接
+				urls: [url] // 需要预览的图片http链接列表
+			})
+		} else {
+			location.href = url
+		}
+	} catch (e) {
+		console.log(e)
+		EasyAlert.show("附件微信端打开失败,请联系客服!");
+	}
+
+}
+
 andownload()
 // 附件下载展示
 function andownload() {
@@ -1801,41 +1828,79 @@ function andownload() {
                       return
                     }else if(window.freeFile>0){
                       window.freeFile=-1
+                      gotoFilePage($(this).find('a').text())
                     }
                   }else{
                     // 付费用户
                     // 大会员用户 有下载权限
                     if (window.isMemberAndPower) {
-                      return location.href = '/big/wx/page/open_app?type=article-file-download'
-                      if(mySysIsIos()){
-                        iosShow(url)
-                      } else {
-                        location.href = url
-                      }
-                      return
+                      // return location.href = '/big/wx/page/open_app?type=article-file-download'
+                      // if(mySysIsIos()){
+                      //   iosShow(url)
+                      // } else {
+						try {
+							openFileDown($(this).find('a').attr('data-href') || url)
+						} catch (e) {
+							console.log(e)
+							openFileDown(url)
+						}
+					  return
+                      // }
                     }
                     //超级订阅
                     if (window.vipStatus>0){
                       //超级订阅新用户
                       if(window.viper){
+                        $.ajax({
+                            type: 'post',
+                            url: '/jypay/resourcePack/consumePack',
+                            data: {
+                                productName: '附件下载包',
+                                platform: 'WX',
+                                fileName: $(this).find('a').text(),
+                                id: id,
+                                title: title
+                            },
+                            success: function (r) {
+                                if (r&&r.r&&r.r.code&&r.r.code<0&&window.vipStatus>0){
+                                  vant.Dialog.confirm({
+                                    message: '您本月附件下载机会已消耗完毕,如需下载更多附件,请前往充值。',
+                                    showCancelButton: true,
+                                        confirmButtonText: '立即充值',
+                                    confirmButtonColor: '#2ABDD1',
+                                    className: 'custom-dialog',
+                                    width: 303
+
+                                  }).then(() => {
+                                        location.href = '/swordfish/filePack/createOrder'
+                                  })
+                                  .catch(() => {})
+                                  return
+                                }else if (r && r.m === '' && r.r) {
+                                  var url = r.r.downUrl
+                                  if (url){
+                                    if (!r.r.isExists){
+                                      window.fileNum = window.fileNum - 1;
+                                      $('.file-count').html($('.file-count').text()-1)
+                                    }
+									  openFileDown(url)
+                                  } else {
+                                      EasyAlert.show('获取附件地址失败');
+                                  }
+                              } else {
+                                  EasyAlert.show(r.m || '获取附件地址失败');
+                              }
+                            }
+                        })
+					  return
                         // 次数用完提醒联系客服
-                        if (window.fileNum<=0){
-                          vant.Dialog.confirm({
-                            message: '您本月查看机会已经消耗完毕,如需要更多服务,请前往联系客服。',
-                            showCancelButton: true,
-                            confirmButtonText: '联系客服',
-                            confirmButtonColor: '#2ABDD1',
-                            className: 'custom-dialog',
-                            width: 303
-
-                          }).then(() => {
-                            location.href = '/big/wx/page/customer'
-                          })
-                          .catch(() => {})
-                          return
-                        }else{
-                          window.fileNum = window.fileNum - 1;
-                        }
+                        //if (window.fileNum<=0){
+
+                        //}else{
+                          //window.fileNum = window.fileNum - 1;
+                         // gotoFilePageOfVip($(this).find('a').text())
+                        //  return
+                        //}
                       }else{
                         //超级订阅老用户  提醒升级
                         vant.Dialog.confirm({
@@ -1865,8 +1930,8 @@ function andownload() {
                       return
                     }
                   }
-                  return location.href = '/big/wx/page/open_app?type=article-file-download'
-                  // gotoFilePage($(this).find('a').text())
+                  // return location.href = '/big/wx/page/open_app?type=article-file-download'
+                  gotoFilePage($(this).find('a').text())
                 })
                 //if (window.isNoMember) {
                   //向所有用户开放
@@ -1887,7 +1952,7 @@ function andownload() {
         }
     });
 }
-//浏览附件
+
 function gotoFilePage(name){
   $.ajax({
         type:'post',
@@ -1901,11 +1966,11 @@ function gotoFilePage(name){
               if (name!=""&&name == r.data.attachment[i].filename){
                 var url = r.data.attachment[i].downurl
                 if (url){
-                  if(mySysIsIos()){
-                      iosShow(url)
-                  } else {
-                      location.href = url
-                  }
+                  // if(mySysIsIos()){
+                  //     iosShow(url)
+                  // } else {
+						openFileDown(url)
+                  // }
                 }
                 break
               }
@@ -2769,7 +2834,7 @@ $(function(){
     // 下载帮助
     $('.icon-help').click(function(){
       vant.Dialog.alert({
-        message: '点击附件即为下载,系统会扣除当月附件下载次数;每月下载次数有限,次月清零,请合理使用。',
+        message: '点击附件即为下载,系统会扣除当月附件下载个数;每月1号上月余额清零重新计算,请合理使用。',
         className: 'custom-dialog',
         confirmButtonText: '我知道了',
         confirmButtonColor: '#2ABDD1',
@@ -2780,6 +2845,10 @@ $(function(){
     $('.concat-kf').click(function(){
       location.href = '/big/wx/page/customer'
     })
+    // 购买附件下载包
+  $('.go-buy-file-pack').click(function(){
+   location.href = '/swordfish/filePack/createOrder'
+  })
 })
 function reward(){
 	window.location.href = "/jypay/weixin/reward/redirect?id={{.T.obj._id}}&source=m";