| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  | <!DOCTYPE html> | 
					
						
							|  |  |  |  | <html lang="zh-CN"> | 
					
						
							|  |  |  |  | <head> | 
					
						
							|  |  |  |  |     <meta charset="UTF-8"> | 
					
						
							|  |  |  |  |     <meta name="viewport" content="width=device-width, initial-scale=1.0"> | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |     <title>积分换购 - 已选择商品</title> | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |     <style> | 
					
						
							|  |  |  |  |         * { | 
					
						
							|  |  |  |  |             margin: 0; | 
					
						
							|  |  |  |  |             padding: 0; | 
					
						
							|  |  |  |  |             box-sizing: border-box; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         body { | 
					
						
							|  |  |  |  |             font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; | 
					
						
							|  |  |  |  |             background-color: rgba(0, 0, 0, 0.5); | 
					
						
							|  |  |  |  |             display: flex; | 
					
						
							|  |  |  |  |             justify-content: center; | 
					
						
							|  |  |  |  |             align-items: center; | 
					
						
							|  |  |  |  |             min-height: 100vh; | 
					
						
							|  |  |  |  |             padding: 20px; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .modal { | 
					
						
							|  |  |  |  |             background: white; | 
					
						
							|  |  |  |  |             border-radius: 8px; | 
					
						
							|  |  |  |  |             box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); | 
					
						
							|  |  |  |  |             width: 100%; | 
					
						
							|  |  |  |  |             max-width: 500px; | 
					
						
							|  |  |  |  |             position: relative; | 
					
						
							|  |  |  |  |             overflow: hidden; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .modal-header { | 
					
						
							|  |  |  |  |             display: flex; | 
					
						
							|  |  |  |  |             justify-content: space-between; | 
					
						
							|  |  |  |  |             align-items: center; | 
					
						
							|  |  |  |  |             padding: 20px 24px; | 
					
						
							|  |  |  |  |             border-bottom: 1px solid #f0f0f0; | 
					
						
							|  |  |  |  |             background-color: #fafafa; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .modal-title { | 
					
						
							|  |  |  |  |             font-size: 18px; | 
					
						
							|  |  |  |  |             font-weight: 600; | 
					
						
							|  |  |  |  |             color: #333; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |         .points-type-badge { | 
					
						
							|  |  |  |  |             background: #fa8c16; | 
					
						
							|  |  |  |  |             color: white; | 
					
						
							|  |  |  |  |             padding: 4px 8px; | 
					
						
							|  |  |  |  |             border-radius: 4px; | 
					
						
							|  |  |  |  |             font-size: 12px; | 
					
						
							|  |  |  |  |             margin-left: 8px; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |         .close-btn { | 
					
						
							|  |  |  |  |             width: 24px; | 
					
						
							|  |  |  |  |             height: 24px; | 
					
						
							|  |  |  |  |             border: none; | 
					
						
							|  |  |  |  |             background: none; | 
					
						
							|  |  |  |  |             cursor: pointer; | 
					
						
							|  |  |  |  |             display: flex; | 
					
						
							|  |  |  |  |             align-items: center; | 
					
						
							|  |  |  |  |             justify-content: center; | 
					
						
							|  |  |  |  |             color: #666; | 
					
						
							|  |  |  |  |             font-size: 18px; | 
					
						
							|  |  |  |  |             border-radius: 4px; | 
					
						
							|  |  |  |  |             transition: background-color 0.2s; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .close-btn:hover { | 
					
						
							|  |  |  |  |             background-color: #f5f5f5; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .modal-content { | 
					
						
							|  |  |  |  |             padding: 24px; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .product-info { | 
					
						
							|  |  |  |  |             margin-bottom: 24px; | 
					
						
							|  |  |  |  |             padding: 16px; | 
					
						
							|  |  |  |  |             background-color: #f8f9fa; | 
					
						
							|  |  |  |  |             border-radius: 6px; | 
					
						
							|  |  |  |  |             border: 1px solid #e9ecef; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .info-row { | 
					
						
							|  |  |  |  |             display: flex; | 
					
						
							|  |  |  |  |             margin-bottom: 8px; | 
					
						
							|  |  |  |  |             font-size: 14px; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .info-row:last-child { | 
					
						
							|  |  |  |  |             margin-bottom: 0; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .info-label { | 
					
						
							|  |  |  |  |             color: #666; | 
					
						
							|  |  |  |  |             width: 80px; | 
					
						
							|  |  |  |  |             flex-shrink: 0; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .info-value { | 
					
						
							|  |  |  |  |             color: #333; | 
					
						
							|  |  |  |  |             flex: 1; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .form-group { | 
					
						
							|  |  |  |  |             margin-bottom: 20px; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .form-label { | 
					
						
							|  |  |  |  |             display: block; | 
					
						
							|  |  |  |  |             margin-bottom: 8px; | 
					
						
							|  |  |  |  |             font-size: 14px; | 
					
						
							|  |  |  |  |             color: #333; | 
					
						
							|  |  |  |  |             font-weight: 500; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .required { | 
					
						
							|  |  |  |  |             color: #ff4757; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .input-wrapper { | 
					
						
							|  |  |  |  |             position: relative; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .form-input { | 
					
						
							|  |  |  |  |             width: 100%; | 
					
						
							|  |  |  |  |             padding: 10px 12px; | 
					
						
							|  |  |  |  |             border: 1px solid #d9d9d9; | 
					
						
							|  |  |  |  |             border-radius: 4px; | 
					
						
							|  |  |  |  |             font-size: 14px; | 
					
						
							|  |  |  |  |             transition: border-color 0.2s; | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |             background-color: #f5f5f5; | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .form-input:focus { | 
					
						
							|  |  |  |  |             outline: none; | 
					
						
							|  |  |  |  |             border-color: #1890ff; | 
					
						
							|  |  |  |  |             box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .number-input-group { | 
					
						
							|  |  |  |  |             display: flex; | 
					
						
							|  |  |  |  |             align-items: center; | 
					
						
							|  |  |  |  |             border: 1px solid #d9d9d9; | 
					
						
							|  |  |  |  |             border-radius: 4px; | 
					
						
							|  |  |  |  |             overflow: hidden; | 
					
						
							|  |  |  |  |             background: white; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .number-input-group:focus-within { | 
					
						
							|  |  |  |  |             border-color: #1890ff; | 
					
						
							|  |  |  |  |             box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .number-btn { | 
					
						
							|  |  |  |  |             width: 32px; | 
					
						
							|  |  |  |  |             height: 40px; | 
					
						
							|  |  |  |  |             border: none; | 
					
						
							|  |  |  |  |             background: #fafafa; | 
					
						
							|  |  |  |  |             cursor: pointer; | 
					
						
							|  |  |  |  |             display: flex; | 
					
						
							|  |  |  |  |             align-items: center; | 
					
						
							|  |  |  |  |             justify-content: center; | 
					
						
							|  |  |  |  |             font-size: 16px; | 
					
						
							|  |  |  |  |             color: #666; | 
					
						
							|  |  |  |  |             transition: background-color 0.2s; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .number-btn:hover { | 
					
						
							|  |  |  |  |             background-color: #f0f0f0; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .number-btn:disabled { | 
					
						
							|  |  |  |  |             cursor: not-allowed; | 
					
						
							|  |  |  |  |             color: #ccc; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .number-input { | 
					
						
							|  |  |  |  |             flex: 1; | 
					
						
							|  |  |  |  |             border: none; | 
					
						
							|  |  |  |  |             padding: 10px 12px; | 
					
						
							|  |  |  |  |             font-size: 14px; | 
					
						
							|  |  |  |  |             text-align: center; | 
					
						
							|  |  |  |  |             outline: none; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |         .exchange-info { | 
					
						
							|  |  |  |  |             background: #fff2e8; | 
					
						
							|  |  |  |  |             border: 1px solid #ffbb96; | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |             border-radius: 4px; | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |             padding: 12px; | 
					
						
							| 
									
										
										
										
											2025-08-12 18:11:53 +00:00
										 |  |  |  |             margin-top: 8px; | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |             font-size: 13px; | 
					
						
							|  |  |  |  |             color: #d4380d; | 
					
						
							| 
									
										
										
										
											2025-08-12 18:11:53 +00:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |         .exchange-note { | 
					
						
							|  |  |  |  |             background: #e6f7ff; | 
					
						
							|  |  |  |  |             border: 1px solid #91d5ff; | 
					
						
							|  |  |  |  |             border-radius: 4px; | 
					
						
							|  |  |  |  |             padding: 12px; | 
					
						
							|  |  |  |  |             margin-top: 8px; | 
					
						
							|  |  |  |  |             font-size: 13px; | 
					
						
							|  |  |  |  |             color: #0050b3; | 
					
						
							| 
									
										
										
										
											2025-08-12 18:22:14 +00:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |         .modal-footer { | 
					
						
							|  |  |  |  |             padding: 16px 24px; | 
					
						
							|  |  |  |  |             border-top: 1px solid #f0f0f0; | 
					
						
							|  |  |  |  |             display: flex; | 
					
						
							|  |  |  |  |             gap: 12px; | 
					
						
							|  |  |  |  |             justify-content: flex-end; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .btn { | 
					
						
							|  |  |  |  |             padding: 8px 24px; | 
					
						
							|  |  |  |  |             border-radius: 4px; | 
					
						
							|  |  |  |  |             font-size: 14px; | 
					
						
							|  |  |  |  |             cursor: pointer; | 
					
						
							|  |  |  |  |             transition: all 0.2s; | 
					
						
							|  |  |  |  |             border: 1px solid; | 
					
						
							|  |  |  |  |             min-width: 80px; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .btn-cancel { | 
					
						
							|  |  |  |  |             background: white; | 
					
						
							|  |  |  |  |             color: #666; | 
					
						
							|  |  |  |  |             border-color: #d9d9d9; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .btn-cancel:hover { | 
					
						
							|  |  |  |  |             background: #f5f5f5; | 
					
						
							|  |  |  |  |             border-color: #bfbfbf; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .btn-primary { | 
					
						
							|  |  |  |  |             background: #1890ff; | 
					
						
							|  |  |  |  |             color: white; | 
					
						
							|  |  |  |  |             border-color: #1890ff; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         .btn-primary:hover { | 
					
						
							|  |  |  |  |             background: #40a9ff; | 
					
						
							|  |  |  |  |             border-color: #40a9ff; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         @media (max-width: 480px) { | 
					
						
							|  |  |  |  |             .modal { | 
					
						
							|  |  |  |  |                 margin: 0; | 
					
						
							|  |  |  |  |                 border-radius: 0; | 
					
						
							|  |  |  |  |                 height: 100vh; | 
					
						
							|  |  |  |  |                 max-width: none; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |              | 
					
						
							|  |  |  |  |             .modal-content { | 
					
						
							|  |  |  |  |                 padding: 20px; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |              | 
					
						
							|  |  |  |  |             .modal-footer { | 
					
						
							|  |  |  |  |                 padding: 16px 20px; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |              | 
					
						
							|  |  |  |  |             .btn { | 
					
						
							|  |  |  |  |                 flex: 1; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |     </style> | 
					
						
							|  |  |  |  | </head> | 
					
						
							|  |  |  |  | <body> | 
					
						
							|  |  |  |  |     <div class="modal"> | 
					
						
							|  |  |  |  |         <div class="modal-header"> | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |             <h2 class="modal-title"> | 
					
						
							|  |  |  |  |                 已选择商品 | 
					
						
							|  |  |  |  |                 <span class="points-type-badge">积分换购</span> | 
					
						
							|  |  |  |  |             </h2> | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |             <button class="close-btn" onclick="closeModal()">×</button> | 
					
						
							|  |  |  |  |         </div> | 
					
						
							|  |  |  |  |          | 
					
						
							|  |  |  |  |         <div class="modal-content"> | 
					
						
							|  |  |  |  |             <div class="product-info"> | 
					
						
							|  |  |  |  |                 <div class="info-row"> | 
					
						
							|  |  |  |  |                     <span class="info-label">商品ID:</span> | 
					
						
							|  |  |  |  |                     <span class="info-value">192401649879976960</span> | 
					
						
							|  |  |  |  |                 </div> | 
					
						
							|  |  |  |  |                 <div class="info-row"> | 
					
						
							|  |  |  |  |                     <span class="info-label">商品名称:</span> | 
					
						
							| 
									
										
										
										
											2025-08-12 04:04:52 +00:00
										 |  |  |  |                     <span class="info-value">黑木耳</span> | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |                 </div> | 
					
						
							|  |  |  |  |                 <div class="info-row"> | 
					
						
							|  |  |  |  |                     <span class="info-label">归属摊位:</span> | 
					
						
							|  |  |  |  |                     <span class="info-value">牛生蔬菜店</span> | 
					
						
							|  |  |  |  |                 </div> | 
					
						
							| 
									
										
										
										
											2025-08-12 04:04:52 +00:00
										 |  |  |  |                 <div class="info-row"> | 
					
						
							|  |  |  |  |                     <span class="info-label">规格名称:</span> | 
					
						
							|  |  |  |  |                     <span class="info-value">小份</span> | 
					
						
							|  |  |  |  |                 </div> | 
					
						
							|  |  |  |  |                 <div class="info-row"> | 
					
						
							|  |  |  |  |                     <span class="info-label">SKU-ID:</span> | 
					
						
							|  |  |  |  |                     <span class="info-value">194105142774503836</span> | 
					
						
							|  |  |  |  |                 </div> | 
					
						
							| 
									
										
										
										
											2025-08-12 18:22:14 +00:00
										 |  |  |  |                 <div class="info-row"> | 
					
						
							|  |  |  |  |                     <span class="info-label">商品原价:</span> | 
					
						
							|  |  |  |  |                     <span class="info-value">¥12.80</span> | 
					
						
							|  |  |  |  |                 </div> | 
					
						
							| 
									
										
										
										
											2025-08-14 12:18:52 +00:00
										 |  |  |  |                 <div class="info-row"> | 
					
						
							|  |  |  |  |                     <span class="info-label">当前剩余库存:</span> | 
					
						
							|  |  |  |  |                     <span class="info-value">50</span> | 
					
						
							|  |  |  |  |                 </div> | 
					
						
							| 
									
										
										
										
											2025-08-12 18:22:14 +00:00
										 |  |  |  |             </div> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             <div class="form-group"> | 
					
						
							| 
									
										
										
										
											2025-08-14 12:18:52 +00:00
										 |  |  |  |                 <label class="form-label">添加库存(负数代表减少库存) <span class="required">*</span></label> | 
					
						
							| 
									
										
										
										
											2025-08-12 18:22:14 +00:00
										 |  |  |  |                 <div class="number-input-group"> | 
					
						
							|  |  |  |  |                     <button class="number-btn" onclick="decreaseStock()">-</button> | 
					
						
							|  |  |  |  |                     <input type="number" class="number-input" id="stockInput" value="10" min="0"> | 
					
						
							|  |  |  |  |                     <button class="number-btn" onclick="increaseStock()">+</button> | 
					
						
							|  |  |  |  |                 </div> | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |             </div> | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-12 18:11:53 +00:00
										 |  |  |  |             <div class="form-group"> | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |                 <label class="form-label">兑换所需积分设置 <span class="required">*</span></label> | 
					
						
							|  |  |  |  |                 <div class="number-input-group"> | 
					
						
							|  |  |  |  |                     <button class="number-btn" onclick="decreasePoints()">-</button> | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |                     <input type="number" class="number-input" id="pointsInput" value="1280" min="1"> | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |                     <button class="number-btn" onclick="increasePoints()">+</button> | 
					
						
							|  |  |  |  |                 </div> | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |                 <div class="exchange-info"> | 
					
						
							|  |  |  |  |                     用户需要支付 <span id="pointsDisplay">1280</span> 积分 + ¥0.01 即可兑换此商品 | 
					
						
							|  |  |  |  |                 </div> | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |             </div> | 
					
						
							| 
									
										
										
										
											2025-08-17 16:49:06 +00:00
										 |  |  |  |              | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |             <div class="form-group"> | 
					
						
							| 
									
										
										
										
											2025-08-17 16:49:06 +00:00
										 |  |  |  |                 <label class="form-label">最低兑换金额(商业支付最少0.01元)</label> | 
					
						
							|  |  |  |  |                 <div class="input-wrapper"> | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |                     <input type="text" class="form-input" value="¥0.01" readonly> | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |                 </div> | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |                 <div class="exchange-note"> | 
					
						
							|  |  |  |  |                     提示:为符合商业支付规范,用户在使用积分兑换时仍需支付最少0.01元的金额 | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |                 </div> | 
					
						
							|  |  |  |  |             </div> | 
					
						
							|  |  |  |  |         </div> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         <div class="modal-footer"> | 
					
						
							|  |  |  |  |             <button class="btn btn-cancel" onclick="closeModal()">取消</button> | 
					
						
							|  |  |  |  |             <button class="btn btn-primary" onclick="confirmSelection()">确认</button> | 
					
						
							|  |  |  |  |         </div> | 
					
						
							|  |  |  |  |     </div> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     <script> | 
					
						
							| 
									
										
										
										
											2025-08-12 18:22:14 +00:00
										 |  |  |  |         // 积分设置(兑换专用) | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |         function increasePoints() { | 
					
						
							|  |  |  |  |             const input = document.getElementById('pointsInput'); | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |             input.value = parseInt(input.value) + 10; | 
					
						
							|  |  |  |  |             updateExchangeInfo(); | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         function decreasePoints() { | 
					
						
							|  |  |  |  |             const input = document.getElementById('pointsInput'); | 
					
						
							|  |  |  |  |             const currentValue = parseInt(input.value); | 
					
						
							|  |  |  |  |             if (currentValue > 1) { | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |                 input.value = Math.max(1, currentValue - 10); | 
					
						
							|  |  |  |  |                 updateExchangeInfo(); | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-12 18:22:14 +00:00
										 |  |  |  |         // 库存设置 | 
					
						
							|  |  |  |  |         function increaseStock() { | 
					
						
							|  |  |  |  |             const input = document.getElementById('stockInput'); | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |             input.value = parseInt(input.value) + 1; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-12 18:22:14 +00:00
										 |  |  |  |         function decreaseStock() { | 
					
						
							|  |  |  |  |             const input = document.getElementById('stockInput'); | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |             const currentValue = parseInt(input.value); | 
					
						
							|  |  |  |  |             if (currentValue > 0) { | 
					
						
							|  |  |  |  |                 input.value = currentValue - 1; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |         // 更新兑换信息提示 | 
					
						
							|  |  |  |  |         function updateExchangeInfo() { | 
					
						
							|  |  |  |  |             const points = document.getElementById('pointsInput').value; | 
					
						
							|  |  |  |  |             document.getElementById('pointsDisplay').textContent = points; | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2025-08-12 18:22:14 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |         // 关闭弹窗 | 
					
						
							|  |  |  |  |         function closeModal() { | 
					
						
							|  |  |  |  |             console.log('关闭弹窗'); | 
					
						
							| 
									
										
										
										
											2025-08-12 18:22:14 +00:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |         // 确认选择 | 
					
						
							|  |  |  |  |         function confirmSelection() { | 
					
						
							|  |  |  |  |             const stock = document.getElementById('stockInput').value; | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |             const points = document.getElementById('pointsInput').value; | 
					
						
							|  |  |  |  |              | 
					
						
							|  |  |  |  |             if (!points || !stock) { | 
					
						
							|  |  |  |  |                 alert('请填写所有必填项'); | 
					
						
							|  |  |  |  |                 return; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             if (parseInt(points) < 1) { | 
					
						
							|  |  |  |  |                 alert('兑换积分不能小于1'); | 
					
						
							|  |  |  |  |                 return; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-08-12 18:22:14 +00:00
										 |  |  |  |              | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |             const data = { | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |                 productId: '192401649879976960', | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |                 productName: '黑木耳', | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |                 shopName: '牛生蔬菜店', | 
					
						
							|  |  |  |  |                 skuId: '194105142774503836', | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |                 pointsType: 'exchange', | 
					
						
							|  |  |  |  |                 stock: stock, | 
					
						
							|  |  |  |  |                 points: points, | 
					
						
							|  |  |  |  |                 minPayment: 0.01 | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |             }; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             console.log('提交数据:', data); | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |             alert('积分换购设置成功!'); | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |         // 监听积分输入变化 | 
					
						
							|  |  |  |  |         document.getElementById('pointsInput').addEventListener('input', updateExchangeInfo); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |         // 键盘事件处理 | 
					
						
							|  |  |  |  |         document.addEventListener('keydown', function(e) { | 
					
						
							|  |  |  |  |             if (e.key === 'Escape') { | 
					
						
							|  |  |  |  |                 closeModal(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         }); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         // 点击背景关闭弹窗 | 
					
						
							|  |  |  |  |         document.addEventListener('click', function(e) { | 
					
						
							|  |  |  |  |             if (e.target === document.body) { | 
					
						
							|  |  |  |  |                 closeModal(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         }); | 
					
						
							| 
									
										
										
										
											2025-08-12 18:22:14 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |         // 页面加载时初始化 | 
					
						
							| 
									
										
										
										
											2025-08-12 18:22:14 +00:00
										 |  |  |  |         document.addEventListener('DOMContentLoaded', function() { | 
					
						
							| 
									
										
										
										
											2025-08-18 18:35:25 +00:00
										 |  |  |  |             updateExchangeInfo(); | 
					
						
							| 
									
										
										
										
											2025-08-12 18:22:14 +00:00
										 |  |  |  |         }); | 
					
						
							| 
									
										
										
										
											2025-08-05 17:26:41 +00:00
										 |  |  |  |     </script> | 
					
						
							|  |  |  |  | </body> | 
					
						
							|  |  |  |  | </html> |