Compare commits
	
		
			1 Commits 
		
	
	
		
			static-pro
			...
			onLine-pro
		
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | d40c69909b | 
							
								
								
									
										27
									
								
								App.vue
								
								
								
								
							
							
						
						
									
										27
									
								
								App.vue
								
								
								
								
							|  | @ -1,34 +1,14 @@ | ||||||
| <script> | <script> | ||||||
| 	import { themeEv } from '@/jsFile/public-api.js'; |  | ||||||
| 	export default { | 	export default { | ||||||
| 		globalData:{ | 		globalData:{ | ||||||
| 			projectname:'', // 项目名称 | 			projectname:'', // 项目名称 | ||||||
| 			lat:'', // 公司地址维度 | 			lat:'', // 公司地址维度 | ||||||
| 			lng:''  ,// 公司地址经度 | 			lng:''  ,// 公司地址经度 | ||||||
| 			hostapi:'https://www.cdxidoudou.cn' ,// 域名配置 | 			hostapi:'https://www.baidu.com' // 域名配置 | ||||||
| 			// hostapi:'https:caimall.scdxtc.cn',// 测试域名 |  | ||||||
| 		}, | 		}, | ||||||
| 		// 优先于show方法 | 		// 优先于show方法 | ||||||
| 		onLaunch: function() { | 		onLaunch: function() { | ||||||
| 			uni.login({ | 			 | ||||||
| 				success: (res) => { |  | ||||||
| 					uni.request({ |  | ||||||
| 						url: this.globalData.hostapi +'/api/user/login', |  | ||||||
| 						data:{code:res.code}, |  | ||||||
| 						success: (result) => { |  | ||||||
| 							if(result.data.data.is_active) { |  | ||||||
| 								uni.setStorageSync('userId',result.data.account_id); |  | ||||||
| 								uni.setStorageSync('token',result.data.data.token);//缓存token |  | ||||||
| 								uni.setStorageSync('openid',result.data.data.openid);//缓存openid |  | ||||||
| 								uni.setStorageSync('expire',result.data.data.expire);//缓存失效时间(时间戳格式) |  | ||||||
| 								uni.setStorageSync('phone_active',result.data.data.phone_active);//是否授权手机号 |  | ||||||
| 								uni.setStorageSync('is_active',result.data.data.is_active);//是否授权头像和昵称 |  | ||||||
| 								uni.setStorageSync('invite_code',result.data.data.invite_code);//缓存邀请码 |  | ||||||
| 							} |  | ||||||
| 						} |  | ||||||
| 					}) |  | ||||||
| 				} |  | ||||||
| 			}) |  | ||||||
| 		}, | 		}, | ||||||
| 		onShow: function() { | 		onShow: function() { | ||||||
| 			if(uni.getStorageSync('token')){ | 			if(uni.getStorageSync('token')){ | ||||||
|  | @ -37,7 +17,7 @@ | ||||||
| 		}, | 		}, | ||||||
| 		onHide: function() { | 		onHide: function() { | ||||||
| 			 | 			 | ||||||
| 		}, | 		} | ||||||
| 	}; | 	}; | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
|  | @ -57,7 +37,6 @@ | ||||||
| 	/* 动画样式 start */ | 	/* 动画样式 start */ | ||||||
| 	@import url("./commons/animate.min.css"); | 	@import url("./commons/animate.min.css"); | ||||||
| 	/* 动画样式 end */ | 	/* 动画样式 end */ | ||||||
| 	@import url("./commons/loading.css"); |  | ||||||
| 	 | 	 | ||||||
| 	page {background-color: #f4f4f4;} | 	page {background-color: #f4f4f4;} | ||||||
| 	.textc{ | 	.textc{ | ||||||
|  |  | ||||||
|  | @ -329,18 +329,11 @@ button:after{content: none!important;} | ||||||
| .pad-s10{padding-top: 10rpx;} | .pad-s10{padding-top: 10rpx;} | ||||||
| .pad-s20{padding-top: 20rpx;} | .pad-s20{padding-top: 20rpx;} | ||||||
| .pad-s25{padding-top: 25rpx;} | .pad-s25{padding-top: 25rpx;} | ||||||
| .pad-s28{padding-top: 28rpx;} |  | ||||||
| .pad-s30{padding-top: 30rpx;} | .pad-s30{padding-top: 30rpx;} | ||||||
| .pad-s32{padding-top: 32rpx;} | .pad-s32{padding-top: 32rpx;} | ||||||
| .pad-s36{padding-top: 36rpx;} | .pad-s36{padding-top: 36rpx;} | ||||||
| .pad-s40{padding-top: 40rpx;} | .pad-s40{padding-top: 40rpx;} | ||||||
| .pad-s50{padding-top: 50rpx;} | .pad-s50{padding-top: 50rpx;} | ||||||
| .pad-s60{padding-top: 60rpx;} |  | ||||||
| .pad-s70{padding-top: 70rpx;} |  | ||||||
| .pad-s80{padding-top: 80rpx;} |  | ||||||
| .pad-s90{padding-top: 90rpx;} |  | ||||||
| .pad-s100{padding-top: 100rpx;} |  | ||||||
| .pad-s110{padding-top: 110rpx;} |  | ||||||
| .pad-s120{padding-top: 120rpx;} | .pad-s120{padding-top: 120rpx;} | ||||||
| .pad-s140{padding-top: 140rpx;} | .pad-s140{padding-top: 140rpx;} | ||||||
| .pad-s160{padding-top: 160rpx;} | .pad-s160{padding-top: 160rpx;} | ||||||
|  |  | ||||||
|  | @ -1,874 +0,0 @@ | ||||||
| .loading-box { |  | ||||||
|     display: flex; |  | ||||||
| 	justify-content: center; |  | ||||||
| 	width: 100%; |  | ||||||
| 	padding-top: 20px; |  | ||||||
|     font-size: 30px; |  | ||||||
|     color: rgba(253, 82, 75, 1); |  | ||||||
|     vertical-align: top; |  | ||||||
|     -webkit-transition: .3s color, .3s border; |  | ||||||
|     transition: .3s color, .3s border; |  | ||||||
| } |  | ||||||
| /* .loading-box:hover { |  | ||||||
|     color: #d60b52; |  | ||||||
|     font-size: 0; |  | ||||||
|     padding: 0; |  | ||||||
|     border-width: 3px; |  | ||||||
|     line-height: 200px; |  | ||||||
| } |  | ||||||
| .loading-box:hover [class*="loader-"] { |  | ||||||
|     font-size: 70px; |  | ||||||
|     line-height: 200px; |  | ||||||
| } */ |  | ||||||
| [class*="loader-"] { |  | ||||||
|     display: inline-block; |  | ||||||
|     width: 1em; |  | ||||||
|     height: 1em; |  | ||||||
|     color: inherit; |  | ||||||
|     vertical-align: middle; |  | ||||||
|     pointer-events: none; |  | ||||||
| } |  | ||||||
| .loader-01 { |  | ||||||
|     border: .2em dotted currentcolor; |  | ||||||
|     border-radius: 50%; |  | ||||||
|     -webkit-animation: 1s loader-01 linear infinite; |  | ||||||
|     animation: 1s loader-01 linear infinite; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-01 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: rotate(0deg); |  | ||||||
|         transform: rotate(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: rotate(360deg); |  | ||||||
|         transform: rotate(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-01 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: rotate(0deg); |  | ||||||
|         transform: rotate(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: rotate(360deg); |  | ||||||
|         transform: rotate(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-02 { |  | ||||||
|     border: .2em solid transparent; |  | ||||||
|     border-left-color: currentcolor; |  | ||||||
|     border-right-color: currentcolor; |  | ||||||
|     border-radius: 50%; |  | ||||||
|     -webkit-animation: 1s loader-02 linear infinite; |  | ||||||
|     animation: 1s loader-02 linear infinite; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-02 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: rotate(0deg); |  | ||||||
|         transform: rotate(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: rotate(360deg); |  | ||||||
|         transform: rotate(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-02 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: rotate(0deg); |  | ||||||
|         transform: rotate(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: rotate(360deg); |  | ||||||
|         transform: rotate(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-03 { |  | ||||||
|     border: .2em solid currentcolor; |  | ||||||
|     border-bottom-color: transparent; |  | ||||||
|     border-radius: 50%; |  | ||||||
|     -webkit-animation: 1s loader-03 linear infinite; |  | ||||||
|     animation: 1s loader-03 linear infinite; |  | ||||||
|     position: relative; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-03 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: rotate(0deg); |  | ||||||
|         transform: rotate(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: rotate(360deg); |  | ||||||
|         transform: rotate(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-03 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: rotate(0deg); |  | ||||||
|         transform: rotate(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: rotate(360deg); |  | ||||||
|         transform: rotate(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-04 { |  | ||||||
|     border: 1px solid currentcolor; |  | ||||||
|     border-radius: 50%; |  | ||||||
|     -webkit-animation: 1s loader-04 linear infinite; |  | ||||||
|     animation: 1s loader-04 linear infinite; |  | ||||||
|     position: relative; |  | ||||||
| } |  | ||||||
| .loader-04:before { |  | ||||||
|     content: ''; |  | ||||||
|     display: block; |  | ||||||
|     width: 0; |  | ||||||
|     height: 0; |  | ||||||
|     position: absolute; |  | ||||||
|     top: -.2em; |  | ||||||
|     left: 50%; |  | ||||||
|     border: .2em solid currentcolor; |  | ||||||
|     border-radius: 50%; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-04 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: rotate(0deg); |  | ||||||
|         transform: rotate(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: rotate(360deg); |  | ||||||
|         transform: rotate(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-04 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: rotate(0deg); |  | ||||||
|         transform: rotate(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: rotate(360deg); |  | ||||||
|         transform: rotate(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-05 { |  | ||||||
|     border: .2em solid transparent; |  | ||||||
|     border-top-color: currentcolor; |  | ||||||
|     border-radius: 50%; |  | ||||||
|     -webkit-animation: 1s loader-05 linear infinite; |  | ||||||
|     animation: 1s loader-05 linear infinite; |  | ||||||
|     position: relative; |  | ||||||
| } |  | ||||||
| .loader-05:before { |  | ||||||
|     content: ''; |  | ||||||
|     display: block; |  | ||||||
|     width: inherit; |  | ||||||
|     height: inherit; |  | ||||||
|     position: absolute; |  | ||||||
|     top: -.2em; |  | ||||||
|     left: -.2em; |  | ||||||
|     border: .2em solid currentcolor; |  | ||||||
|     border-radius: 50%; |  | ||||||
|     opacity: .5; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-05 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: rotate(0deg); |  | ||||||
|         transform: rotate(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: rotate(360deg); |  | ||||||
|         transform: rotate(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-05 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: rotate(0deg); |  | ||||||
|         transform: rotate(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: rotate(360deg); |  | ||||||
|         transform: rotate(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-06 { |  | ||||||
|     border: .2em solid currentcolor; |  | ||||||
|     border-radius: 50%; |  | ||||||
|     -webkit-animation: loader-06 1s ease-out infinite; |  | ||||||
|     animation: loader-06 1s ease-out infinite; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-06 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: scale(0); |  | ||||||
|         transform: scale(0); |  | ||||||
|         opacity: 0; |  | ||||||
|     } |  | ||||||
|     50% { |  | ||||||
|         opacity: 1; |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: scale(1); |  | ||||||
|         transform: scale(1); |  | ||||||
|         opacity: 0; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-06 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: scale(0); |  | ||||||
|         transform: scale(0); |  | ||||||
|         opacity: 0; |  | ||||||
|     } |  | ||||||
|     50% { |  | ||||||
|         opacity: 1; |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: scale(1); |  | ||||||
|         transform: scale(1); |  | ||||||
|         opacity: 0; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-07 { |  | ||||||
|     border: 0 solid transparent; |  | ||||||
|     border-radius: 50%; |  | ||||||
|     position: relative; |  | ||||||
| } |  | ||||||
| .loader-07:before, |  | ||||||
| .loader-07:after { |  | ||||||
|     content: ''; |  | ||||||
|     border: .2em solid currentcolor; |  | ||||||
|     border-radius: 50%; |  | ||||||
|     width: inherit; |  | ||||||
|     height: inherit; |  | ||||||
|     position: absolute; |  | ||||||
|     top: 0; |  | ||||||
|     left: 0; |  | ||||||
|     -webkit-animation: loader-07 1s linear infinite; |  | ||||||
|     animation: loader-07 1s linear infinite; |  | ||||||
|     opacity: 0; |  | ||||||
| } |  | ||||||
| .loader-07:before { |  | ||||||
|     -webkit-animation-delay: 1s; |  | ||||||
|     animation-delay: 1s; |  | ||||||
| } |  | ||||||
| .loader-07:after { |  | ||||||
|     -webkit-animation-delay: .5s; |  | ||||||
|     animation-delay: .5s; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-07 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: scale(0); |  | ||||||
|         transform: scale(0); |  | ||||||
|         opacity: 0; |  | ||||||
|     } |  | ||||||
|     50% { |  | ||||||
|         opacity: 1; |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: scale(1); |  | ||||||
|         transform: scale(1); |  | ||||||
|         opacity: 0; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-07 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: scale(0); |  | ||||||
|         transform: scale(0); |  | ||||||
|         opacity: 0; |  | ||||||
|     } |  | ||||||
|     50% { |  | ||||||
|         opacity: 1; |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: scale(1); |  | ||||||
|         transform: scale(1); |  | ||||||
|         opacity: 0; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-08 { |  | ||||||
|     position: relative; |  | ||||||
| } |  | ||||||
| .loader-08:before, |  | ||||||
| .loader-08:after { |  | ||||||
|     content: ''; |  | ||||||
|     width: inherit; |  | ||||||
|     height: inherit; |  | ||||||
|     border-radius: 50%; |  | ||||||
|     background-color: currentcolor; |  | ||||||
|     opacity: 0.6; |  | ||||||
|     position: absolute; |  | ||||||
|     top: 0; |  | ||||||
|     left: 0; |  | ||||||
|     -webkit-animation: loader-08 2.0s infinite ease-in-out; |  | ||||||
|     animation: loader-08 2.0s infinite ease-in-out; |  | ||||||
| } |  | ||||||
| .loader-08:after { |  | ||||||
|     -webkit-animation-delay: -1.0s; |  | ||||||
|     animation-delay: -1.0s; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-08 { |  | ||||||
|     0%, 100% { |  | ||||||
|         -webkit-transform: scale(0); |  | ||||||
|         transform: scale(0); |  | ||||||
|     } |  | ||||||
|     50% { |  | ||||||
|         -webkit-transform: scale(1); |  | ||||||
|         transform: scale(1); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-08 { |  | ||||||
|     0%, 100% { |  | ||||||
|         -webkit-transform: scale(0); |  | ||||||
|         transform: scale(0); |  | ||||||
|     } |  | ||||||
|     50% { |  | ||||||
|         -webkit-transform: scale(1); |  | ||||||
|         transform: scale(1); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-09 { |  | ||||||
|     background-color: currentcolor; |  | ||||||
|     border-radius: 50%; |  | ||||||
|     -webkit-animation: loader-09 1.0s infinite ease-in-out; |  | ||||||
|     animation: loader-09 1.0s infinite ease-in-out; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-09 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: scale(0); |  | ||||||
|         transform: scale(0); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: scale(1); |  | ||||||
|         transform: scale(1); |  | ||||||
|         opacity: 0; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-09 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: scale(0); |  | ||||||
|         transform: scale(0); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: scale(1); |  | ||||||
|         transform: scale(1); |  | ||||||
|         opacity: 0; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-10 { |  | ||||||
|     position: relative; |  | ||||||
|     -webkit-animation: loader-10-1 2.0s infinite linear; |  | ||||||
|     animation: loader-10-1 2.0s infinite linear; |  | ||||||
| } |  | ||||||
| .loader-10:before, |  | ||||||
| .loader-10:after { |  | ||||||
|     content: ''; |  | ||||||
|     width: 0; |  | ||||||
|     height: 0; |  | ||||||
|     border: .5em solid currentcolor; |  | ||||||
|     display: block; |  | ||||||
|     position: absolute; |  | ||||||
|     border-radius: 100%; |  | ||||||
|     -webkit-animation: loader-10-2 2s infinite ease-in-out; |  | ||||||
|     animation: loader-10-2 2s infinite ease-in-out; |  | ||||||
| } |  | ||||||
| .loader-10:before { |  | ||||||
|     top: 0; |  | ||||||
|     left: 50%; |  | ||||||
| } |  | ||||||
| .loader-10:after { |  | ||||||
|     bottom: 0; |  | ||||||
|     right: 50%; |  | ||||||
|     -webkit-animation-delay: -1s; |  | ||||||
|     animation-delay: -1s; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-10-1 { |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: rotate(360deg); |  | ||||||
|         transform: rotate(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-10-1 { |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: rotate(360deg); |  | ||||||
|         transform: rotate(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-10-2 { |  | ||||||
|     0%, 100% { |  | ||||||
|         -webkit-transform: scale(0); |  | ||||||
|         transform: scale(0); |  | ||||||
|     } |  | ||||||
|     50% { |  | ||||||
|         -webkit-transform: scale(1); |  | ||||||
|         transform: scale(1); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-10-2 { |  | ||||||
|     0%, 100% { |  | ||||||
|         -webkit-transform: scale(0); |  | ||||||
|         transform: scale(0); |  | ||||||
|     } |  | ||||||
|     50% { |  | ||||||
|         -webkit-transform: scale(1); |  | ||||||
|         transform: scale(1); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-11 { |  | ||||||
|     background-color: currentcolor; |  | ||||||
|     -webkit-animation: loader-11 1.2s infinite ease-in-out; |  | ||||||
|     animation: loader-11 1.2s infinite ease-in-out; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-11 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg); |  | ||||||
|         transform: perspective(120px) rotateX(0deg) rotateY(0deg); |  | ||||||
|     } |  | ||||||
|     50% { |  | ||||||
|         -webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg); |  | ||||||
|         transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg); |  | ||||||
|         transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-11 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg); |  | ||||||
|         transform: perspective(120px) rotateX(0deg) rotateY(0deg); |  | ||||||
|     } |  | ||||||
|     50% { |  | ||||||
|         -webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg); |  | ||||||
|         transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg); |  | ||||||
|         transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-12 { |  | ||||||
|     position: relative; |  | ||||||
| } |  | ||||||
| .loader-12:before, |  | ||||||
| .loader-12:after { |  | ||||||
|     content: ''; |  | ||||||
|     display: block; |  | ||||||
|     position: absolute; |  | ||||||
|     background-color: currentcolor; |  | ||||||
|     left: 50%; |  | ||||||
|     right: 0; |  | ||||||
|     top: 0; |  | ||||||
|     bottom: 50%; |  | ||||||
|     box-shadow: -.5em 0 0 currentcolor; |  | ||||||
|     -webkit-animation: loader-12 1s linear infinite; |  | ||||||
|     animation: loader-12 1s linear infinite; |  | ||||||
| } |  | ||||||
| .loader-12:after { |  | ||||||
|     top: 50%; |  | ||||||
|     bottom: 0; |  | ||||||
|     -webkit-animation-delay: .25s; |  | ||||||
|     animation-delay: .25s; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-12 { |  | ||||||
|     0%, 100% { |  | ||||||
|         box-shadow: -.5em 0 0 transparent; |  | ||||||
|         background-color: currentcolor; |  | ||||||
|     } |  | ||||||
|     50% { |  | ||||||
|         box-shadow: -.5em 0 0 currentcolor; |  | ||||||
|         background-color: transparent; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-12 { |  | ||||||
|     0%, 100% { |  | ||||||
|         box-shadow: -.5em 0 0 transparent; |  | ||||||
|         background-color: currentcolor; |  | ||||||
|     } |  | ||||||
|     50% { |  | ||||||
|         box-shadow: -.5em 0 0 currentcolor; |  | ||||||
|         background-color: transparent; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-13:before, |  | ||||||
| .loader-13:after, |  | ||||||
| .loader-13 { |  | ||||||
|     border-radius: 50%; |  | ||||||
|     -webkit-animation-fill-mode: both; |  | ||||||
|     animation-fill-mode: both; |  | ||||||
|     -webkit-animation: loader-13 1.8s infinite ease-in-out; |  | ||||||
|     animation: loader-13 1.8s infinite ease-in-out; |  | ||||||
| } |  | ||||||
| .loader-13 { |  | ||||||
|     color: currentcolor; |  | ||||||
|     position: relative; |  | ||||||
|     -webkit-transform: translateZ(0); |  | ||||||
|     transform: translateZ(0); |  | ||||||
|     -webkit-animation-delay: -0.16s; |  | ||||||
|     animation-delay: -0.16s; |  | ||||||
|     top: -1em; |  | ||||||
| } |  | ||||||
| .loader-13:before { |  | ||||||
|     right: 100%; |  | ||||||
|     -webkit-animation-delay: -0.32s; |  | ||||||
|     animation-delay: -0.32s; |  | ||||||
| } |  | ||||||
| .loader-13:after { |  | ||||||
|     left: 100%; |  | ||||||
| } |  | ||||||
| .loader-13:before, |  | ||||||
| .loader-13:after { |  | ||||||
|     content: ''; |  | ||||||
|     display: block; |  | ||||||
|     position: absolute; |  | ||||||
|     top: 0; |  | ||||||
|     width: inherit; |  | ||||||
|     height: inherit; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-13 { |  | ||||||
|     0%, 80%, 100% { |  | ||||||
|         box-shadow: 0 1em 0 -1em; |  | ||||||
|     } |  | ||||||
|     40% { |  | ||||||
|         box-shadow: 0 1em 0 -.2em; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-13 { |  | ||||||
|     0%, 80%, 100% { |  | ||||||
|         box-shadow: 0 1em 0 -1em; |  | ||||||
|     } |  | ||||||
|     40% { |  | ||||||
|         box-shadow: 0 1em 0 -.2em; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-14 { |  | ||||||
|     border-radius: 50%; |  | ||||||
|     box-shadow: 0 1em 0 -.2em currentcolor; |  | ||||||
|     position: relative; |  | ||||||
|     -webkit-animation: loader-14 0.8s ease-in-out alternate infinite; |  | ||||||
|     animation: loader-14 0.8s ease-in-out alternate infinite; |  | ||||||
|     -webkit-animation-delay: 0.32s; |  | ||||||
|     animation-delay: 0.32s; |  | ||||||
|     top: -1em; |  | ||||||
| } |  | ||||||
| .loader-14:after, |  | ||||||
| .loader-14:before { |  | ||||||
|     content: ''; |  | ||||||
|     position: absolute; |  | ||||||
|     width: inherit; |  | ||||||
|     height: inherit; |  | ||||||
|     border-radius: inherit; |  | ||||||
|     box-shadow: inherit; |  | ||||||
|     -webkit-animation: inherit; |  | ||||||
|     animation: inherit; |  | ||||||
| } |  | ||||||
| .loader-14:before { |  | ||||||
|     left: -1em; |  | ||||||
|     -webkit-animation-delay: 0.48s; |  | ||||||
|     animation-delay: 0.48s; |  | ||||||
| } |  | ||||||
| .loader-14:after { |  | ||||||
|     right: -1em; |  | ||||||
|     -webkit-animation-delay: 0.16s; |  | ||||||
|     animation-delay: 0.16s; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-14 { |  | ||||||
|     0% { |  | ||||||
|         box-shadow: 0 2em 0 -.2em currentcolor; |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         box-shadow: 0 1em 0 -.2em currentcolor; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-14 { |  | ||||||
|     0% { |  | ||||||
|         box-shadow: 0 2em 0 -.2em currentcolor; |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         box-shadow: 0 1em 0 -.2em currentcolor; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-15 { |  | ||||||
|     background: currentcolor; |  | ||||||
|     position: relative; |  | ||||||
|     -webkit-animation: loader-15 1s ease-in-out infinite; |  | ||||||
|     animation: loader-15 1s ease-in-out infinite; |  | ||||||
|     -webkit-animation-delay: 0.4s; |  | ||||||
|     animation-delay: 0.4s; |  | ||||||
|     width: .25em; |  | ||||||
|     height: .5em; |  | ||||||
| } |  | ||||||
| .loader-15:after, |  | ||||||
| .loader-15:before { |  | ||||||
|     content: ''; |  | ||||||
|     position: absolute; |  | ||||||
|     width: inherit; |  | ||||||
|     height: inherit; |  | ||||||
|     background: inherit; |  | ||||||
|     -webkit-animation: inherit; |  | ||||||
|     animation: inherit; |  | ||||||
| } |  | ||||||
| .loader-15:before { |  | ||||||
|     right: .5em; |  | ||||||
|     -webkit-animation-delay: 0.2s; |  | ||||||
|     animation-delay: 0.2s; |  | ||||||
| } |  | ||||||
| .loader-15:after { |  | ||||||
|     left: .5em; |  | ||||||
|     -webkit-animation-delay: 0.6s; |  | ||||||
|     animation-delay: 0.6s; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-15 { |  | ||||||
|     0%, 100% { |  | ||||||
|         box-shadow: 0 0 0 currentcolor, 0 0 0 currentcolor; |  | ||||||
|     } |  | ||||||
|     50% { |  | ||||||
|         box-shadow: 0 -.25em 0 currentcolor, 0 .25em 0 currentcolor; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-15 { |  | ||||||
|     0%, 100% { |  | ||||||
|         box-shadow: 0 0 0 currentcolor, 0 0 0 currentcolor; |  | ||||||
|     } |  | ||||||
|     50% { |  | ||||||
|         box-shadow: 0 -.25em 0 currentcolor, 0 .25em 0 currentcolor; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-16 { |  | ||||||
|     -webkit-transform: rotateZ(45deg); |  | ||||||
|     transform: rotateZ(45deg); |  | ||||||
|     -webkit-perspective: 1000px; |  | ||||||
|     perspective: 1000px; |  | ||||||
|     border-radius: 50%; |  | ||||||
| } |  | ||||||
| .loader-16:before, |  | ||||||
| .loader-16:after { |  | ||||||
|     content: ''; |  | ||||||
|     display: block; |  | ||||||
|     position: absolute; |  | ||||||
|     top: 0; |  | ||||||
|     left: 0; |  | ||||||
|     width: inherit; |  | ||||||
|     height: inherit; |  | ||||||
|     border-radius: 50%; |  | ||||||
|     -webkit-animation: 1s spin linear infinite; |  | ||||||
|     animation: 1s spin linear infinite; |  | ||||||
| } |  | ||||||
| .loader-16:before { |  | ||||||
|     -webkit-transform: rotateX(70deg); |  | ||||||
|     transform: rotateX(70deg); |  | ||||||
| } |  | ||||||
| .loader-16:after { |  | ||||||
|     -webkit-transform: rotateY(70deg); |  | ||||||
|     transform: rotateY(70deg); |  | ||||||
|     -webkit-animation-delay: .4s; |  | ||||||
|     animation-delay: .4s; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes rotate { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: translate(-50%, -50%) rotateZ(0deg); |  | ||||||
|         transform: translate(-50%, -50%) rotateZ(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: translate(-50%, -50%) rotateZ(360deg); |  | ||||||
|         transform: translate(-50%, -50%) rotateZ(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes rotate { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: translate(-50%, -50%) rotateZ(0deg); |  | ||||||
|         transform: translate(-50%, -50%) rotateZ(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: translate(-50%, -50%) rotateZ(360deg); |  | ||||||
|         transform: translate(-50%, -50%) rotateZ(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @-webkit-keyframes rotateccw { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: translate(-50%, -50%) rotate(0deg); |  | ||||||
|         transform: translate(-50%, -50%) rotate(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: translate(-50%, -50%) rotate(-360deg); |  | ||||||
|         transform: translate(-50%, -50%) rotate(-360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes rotateccw { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: translate(-50%, -50%) rotate(0deg); |  | ||||||
|         transform: translate(-50%, -50%) rotate(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: translate(-50%, -50%) rotate(-360deg); |  | ||||||
|         transform: translate(-50%, -50%) rotate(-360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @-webkit-keyframes spin { |  | ||||||
|     0%, 100% { |  | ||||||
|         box-shadow: .2em 0px 0 0px currentcolor; |  | ||||||
|     } |  | ||||||
|     12% { |  | ||||||
|         box-shadow: .2em .2em 0 0 currentcolor; |  | ||||||
|     } |  | ||||||
|     25% { |  | ||||||
|         box-shadow: 0 .2em 0 0px currentcolor; |  | ||||||
|     } |  | ||||||
|     37% { |  | ||||||
|         box-shadow: -.2em .2em 0 0 currentcolor; |  | ||||||
|     } |  | ||||||
|     50% { |  | ||||||
|         box-shadow: -.2em 0 0 0 currentcolor; |  | ||||||
|     } |  | ||||||
|     62% { |  | ||||||
|         box-shadow: -.2em -.2em 0 0 currentcolor; |  | ||||||
|     } |  | ||||||
|     75% { |  | ||||||
|         box-shadow: 0px -.2em 0 0 currentcolor; |  | ||||||
|     } |  | ||||||
|     87% { |  | ||||||
|         box-shadow: .2em -.2em 0 0 currentcolor; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes spin { |  | ||||||
|     0%, 100% { |  | ||||||
|         box-shadow: .2em 0px 0 0px currentcolor; |  | ||||||
|     } |  | ||||||
|     12% { |  | ||||||
|         box-shadow: .2em .2em 0 0 currentcolor; |  | ||||||
|     } |  | ||||||
|     25% { |  | ||||||
|         box-shadow: 0 .2em 0 0px currentcolor; |  | ||||||
|     } |  | ||||||
|     37% { |  | ||||||
|         box-shadow: -.2em .2em 0 0 currentcolor; |  | ||||||
|     } |  | ||||||
|     50% { |  | ||||||
|         box-shadow: -.2em 0 0 0 currentcolor; |  | ||||||
|     } |  | ||||||
|     62% { |  | ||||||
|         box-shadow: -.2em -.2em 0 0 currentcolor; |  | ||||||
|     } |  | ||||||
|     75% { |  | ||||||
|         box-shadow: 0px -.2em 0 0 currentcolor; |  | ||||||
|     } |  | ||||||
|     87% { |  | ||||||
|         box-shadow: .2em -.2em 0 0 currentcolor; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-17 { |  | ||||||
|     position: relative; |  | ||||||
|     background-color: currentcolor; |  | ||||||
|     border-radius: 50%; |  | ||||||
| } |  | ||||||
| .loader-17:after, |  | ||||||
| .loader-17:before { |  | ||||||
|     content: ""; |  | ||||||
|     position: absolute; |  | ||||||
|     width: .25em; |  | ||||||
|     height: .25em; |  | ||||||
|     border-radius: 50%; |  | ||||||
|     opacity: .8; |  | ||||||
| } |  | ||||||
| .loader-17:after { |  | ||||||
|     left: -.5em; |  | ||||||
|     top: -.25em; |  | ||||||
|     background-color: currentcolor; |  | ||||||
|     -webkit-transform-origin: .75em 1em; |  | ||||||
|     transform-origin: .75em 1em; |  | ||||||
|     -webkit-animation: loader-17 1s linear infinite; |  | ||||||
|     animation: loader-17 1s linear infinite; |  | ||||||
|     opacity: .6; |  | ||||||
| } |  | ||||||
| .loader-17:before { |  | ||||||
|     left: -1.25em; |  | ||||||
|     top: -.75em; |  | ||||||
|     background-color: currentcolor; |  | ||||||
|     -webkit-transform-origin: 1.5em 1em; |  | ||||||
|     transform-origin: 1.5em 1em; |  | ||||||
|     -webkit-animation: loader-17 2s linear infinite; |  | ||||||
|     animation: loader-17 2s linear infinite; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-17 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: rotateZ(0deg) translate3d(0, 0, 0); |  | ||||||
|         transform: rotateZ(0deg) translate3d(0, 0, 0); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: rotateZ(360deg) translate3d(0, 0, 0); |  | ||||||
|         transform: rotateZ(360deg) translate3d(0, 0, 0); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-17 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: rotateZ(0deg) translate3d(0, 0, 0); |  | ||||||
|         transform: rotateZ(0deg) translate3d(0, 0, 0); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: rotateZ(360deg) translate3d(0, 0, 0); |  | ||||||
|         transform: rotateZ(360deg) translate3d(0, 0, 0); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-18 { |  | ||||||
|     position: relative; |  | ||||||
| } |  | ||||||
| .loader-18:before, |  | ||||||
| .loader-18:after { |  | ||||||
|     content: ''; |  | ||||||
|     display: block; |  | ||||||
|     position: absolute; |  | ||||||
|     border-radius: 50%; |  | ||||||
|     border: .1em solid transparent; |  | ||||||
|     border-bottom-color: currentcolor; |  | ||||||
|     top: 0; |  | ||||||
|     left: 0; |  | ||||||
|     -webkit-animation: 1s loader-18 linear infinite; |  | ||||||
|     animation: 1s loader-18 linear infinite; |  | ||||||
| } |  | ||||||
| .loader-18:before { |  | ||||||
|     width: 1em; |  | ||||||
|     height: 1em; |  | ||||||
| } |  | ||||||
| .loader-18:after { |  | ||||||
|     width: .8em; |  | ||||||
|     height: .8em; |  | ||||||
|     top: .1em; |  | ||||||
|     left: .1em; |  | ||||||
|     -webkit-animation-direction: reverse; |  | ||||||
|     animation-direction: reverse; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-18 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: rotate(0deg); |  | ||||||
|         transform: rotate(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: rotate(360deg); |  | ||||||
|         transform: rotate(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-18 { |  | ||||||
|     0% { |  | ||||||
|         -webkit-transform: rotate(0deg); |  | ||||||
|         transform: rotate(0deg); |  | ||||||
|     } |  | ||||||
|     100% { |  | ||||||
|         -webkit-transform: rotate(360deg); |  | ||||||
|         transform: rotate(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| .loader-19 { |  | ||||||
|     border-top: .2em solid currentcolor; |  | ||||||
|     border-right: .2em solid transparent; |  | ||||||
|     -webkit-animation: loader-19 1s linear infinite; |  | ||||||
|     animation: loader-19 1s linear infinite; |  | ||||||
|     border-radius: 100%; |  | ||||||
|     position: relative; |  | ||||||
| } |  | ||||||
| @-webkit-keyframes loader-19 { |  | ||||||
|     to { |  | ||||||
|         -webkit-transform: rotate(360deg); |  | ||||||
|         transform: rotate(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @keyframes loader-19 { |  | ||||||
|     to { |  | ||||||
|         -webkit-transform: rotate(360deg); |  | ||||||
|         transform: rotate(360deg); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
|  | @ -59,7 +59,7 @@ | ||||||
| 	animation: scale_name 1s linear alternate infinite; | 	animation: scale_name 1s linear alternate infinite; | ||||||
| } | } | ||||||
| @keyframes scale_name{ | @keyframes scale_name{ | ||||||
| 	from{transform: scale(.9);} | 	from{transform: scale(1);} | ||||||
| 	to{transform: scale(1);} | 	to{transform: scale(1.2);} | ||||||
| } | } | ||||||
| </style> | </style> | ||||||
|  |  | ||||||
|  | @ -5,9 +5,9 @@ | ||||||
| 			boxShadow: `-10rpx 0rpx 20rpx rgba( 0, 0, 0, ${boxShadowNum})` | 			boxShadow: `-10rpx 0rpx 20rpx rgba( 0, 0, 0, ${boxShadowNum})` | ||||||
| 		}"> | 		}"> | ||||||
| 		<!-- 后台动态改变的icon与标题 start --> | 		<!-- 后台动态改变的icon与标题 start --> | ||||||
| 		<view @tap="choosefoot(index)" class="item-box" v-for="(item,index) in onLineList || footList" :key="index"> | 		<view @tap="choosefoot(index)" class="item-box" v-for="(item,index) in footList" :key="index"> | ||||||
| 			<view class="item-image-box disjcac" :class="current*1===index ? 'activeImg' : 'moImg'"> | 			<view class="item-image-box disjcac" :class="current*1===index ? 'activeImg' : 'moImg'"> | ||||||
| 				<view class="item-spot disjcac fon24" v-if="index==2 && cartNum*1">{{cartNum}}</view> | 				<view class="item-spot disjcac fon24" v-if="index==2 && num*1">{{num}}</view> | ||||||
| 				<image :class="isIcon==index ? 'bulge' : ''" :style="{width:[39,41,39,32][index]+'rpx',height:[40,41,38,38][index]+'rpx'}" :src="current == index ? item.selectedIconPath : item.iconPath" mode="widthFix"></image> | 				<image :class="isIcon==index ? 'bulge' : ''" :style="{width:[39,41,39,32][index]+'rpx',height:[40,41,38,38][index]+'rpx'}" :src="current == index ? item.selectedIconPath : item.iconPath" mode="widthFix"></image> | ||||||
| 			</view> | 			</view> | ||||||
| 			<view class="clips1 fon24" :class="current==index ? 'activeclass' : 'defaultclass'">{{item.title}}</view> | 			<view class="clips1 fon24" :class="current==index ? 'activeclass' : 'defaultclass'">{{item.title}}</view> | ||||||
|  | @ -16,8 +16,6 @@ | ||||||
| 	</view> | 	</view> | ||||||
| </template> | </template> | ||||||
| <script> | <script> | ||||||
| 	import {themeEv,getCartNum} from '@/jsFile/public-api.js'; |  | ||||||
| 	import { mapState } from 'vuex'//引入mapState |  | ||||||
|     export default { |     export default { | ||||||
|         name:'foot-tab', |         name:'foot-tab', | ||||||
| 		props:{ | 		props:{ | ||||||
|  | @ -26,6 +24,11 @@ | ||||||
| 				type:String, | 				type:String, | ||||||
| 				default:'0' | 				default:'0' | ||||||
| 			}, | 			}, | ||||||
|  | 			// 点的数量 | ||||||
|  | 			num: { | ||||||
|  | 				type:String, | ||||||
|  | 				default:'10' | ||||||
|  | 			}, | ||||||
| 			// 默认哪个图标突出 | 			// 默认哪个图标突出 | ||||||
| 			isIcon:{ | 			isIcon:{ | ||||||
| 				type:String, | 				type:String, | ||||||
|  | @ -100,27 +103,18 @@ | ||||||
| 			query.select('.foot-box').boundingClientRect((rect) => { | 			query.select('.foot-box').boundingClientRect((rect) => { | ||||||
| 				this.$store.commit('footHeightEv',rect.height); | 				this.$store.commit('footHeightEv',rect.height); | ||||||
| 			}).exec() | 			}).exec() | ||||||
| 			// 查询底部导航图标 |  | ||||||
| 			themeEv(); |  | ||||||
| 			// 查询购物车数量 |  | ||||||
| 			getCartNum(); |  | ||||||
| 		}, |  | ||||||
| 		computed:{ |  | ||||||
| 			...mapState({ |  | ||||||
| 				onLineList: state => state.moduleA.onLineList, |  | ||||||
| 				cartNum: state=> state.moduleA.cartNum |  | ||||||
| 			}), |  | ||||||
| 		}, | 		}, | ||||||
|         methods:{ |         methods:{ | ||||||
|             choosefoot(index){ |             choosefoot(index){ | ||||||
| 				if(index==0){ | 				if(index==0){ | ||||||
| 					uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'}) | 					uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'}) | ||||||
| 				}else if(index==1){ | 				} else { | ||||||
| 				 	uni.reLaunch({url:'/pages/tabbar/cate/cate'}) | 					// if(!this.$toolAll.tools.judgeAuth()) { | ||||||
| 				 }else { |  | ||||||
| 					if(this.$toolAll.tools.judgeAuth()) { |  | ||||||
| 						// 已授权 | 						// 已授权 | ||||||
| 						switch (index){ | 						switch (index){ | ||||||
|  | 							case 1: | ||||||
|  | 							uni.reLaunch({url:'/pages/tabbar/cate/cate'}) | ||||||
|  | 								break; | ||||||
| 							case 2: | 							case 2: | ||||||
| 							uni.reLaunch({url:'/pages/tabbar/cart/cart'}) | 							uni.reLaunch({url:'/pages/tabbar/cart/cart'}) | ||||||
| 								break; | 								break; | ||||||
|  | @ -128,7 +122,12 @@ | ||||||
| 							uni.reLaunch({url:'/pages/tabbar/my/my'}) | 							uni.reLaunch({url:'/pages/tabbar/my/my'}) | ||||||
| 								break; | 								break; | ||||||
| 						} | 						} | ||||||
| 					} | 					// } else { | ||||||
|  | 					// 	// 未授权 | ||||||
|  | 					// 	uni.navigateTo({ | ||||||
|  | 					// 		url:'/pages/login/login' | ||||||
|  | 					// 	}) | ||||||
|  | 					// } | ||||||
| 				} | 				} | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -2,11 +2,10 @@ | ||||||
| 	<view class="disac fw" :style="{paddingBottom:itemTop,backgroundColor: backc}"> | 	<view class="disac fw" :style="{paddingBottom:itemTop,backgroundColor: backc}"> | ||||||
| 		<block v-for="(item,index) in list" :key="index"> | 		<block v-for="(item,index) in list" :key="index"> | ||||||
| 			<view @tap="chooseGe(item.url,index)" class="disjcac fc pad-s30" :style="{width:['50%','50%','50%','33.3%','25%','20%'][rowNum],paddingTop:itemTop}"> | 			<view @tap="chooseGe(item.url,index)" class="disjcac fc pad-s30" :style="{width:['50%','50%','50%','33.3%','25%','20%'][rowNum],paddingTop:itemTop}"> | ||||||
| 				<view class="disjcac icon-box posir" :style="{width:iconwh,height:iconwh}" :class="ifShadow ? 'haveShadow' : ''"> | 				<view class="disjcac icon-box" :style="{width:iconwh,height:iconwh}" :class="ifShadow ? 'haveShadow' : ''"> | ||||||
| 					<image :src="item.iconsrc" mode="aspectFill" :style="{width: item.iconWidth +'rpx',height: item.iconHeight +'rpx'}"></image> | 					<image :src="item.iconsrc" mode="aspectFill" :style="{width: item.iconWidth +'rpx',height: item.iconHeight +'rpx'}"></image> | ||||||
| 					<!-- <view class="posia fon24 textc bacf" v-if="item.num" style="right: -54rpx;bottom: -39rpx;border-radius: 100%; color: #666;">({{item.num}})</view> --> |  | ||||||
| 				</view> | 				</view> | ||||||
| 				<view class="clips1" :style="{color:titlec,fontSize:fonts,marginTop:titleTop}">{{item.title}}<text v-if="item.num" style="margin-left:3px; color:#666">({{item.num}})</text></view> | 				<view class="clips1" :style="{color:titlec,fontSize:fonts,marginTop:titleTop}">{{item.title}}</view> | ||||||
| 			</view> | 			</view> | ||||||
| 		</block> | 		</block> | ||||||
| 	</view> | 	</view> | ||||||
|  | @ -19,13 +18,13 @@ | ||||||
| 				type:Array, | 				type:Array, | ||||||
| 				default:()=>{ | 				default:()=>{ | ||||||
| 					return [ | 					return [ | ||||||
| 						{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题一',num:0}, | 						{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题一'}, | ||||||
| 						{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题二',num:0}, | 						{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题二'}, | ||||||
| 						{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题三',num:0}, | 						{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题三'}, | ||||||
| 						{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题四',num:0}, | 						{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题四'}, | ||||||
| 						{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五',num:0}, | 						{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五'}, | ||||||
| 						{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五',num:0}, | 						{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五'}, | ||||||
| 						{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五',num:0}, | 						{url:'',iconsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',iconWidth:60,iconHeight:60,title:'标题五'}, | ||||||
| 					] | 					] | ||||||
| 				} | 				} | ||||||
| 			}, | 			}, | ||||||
|  | @ -78,11 +77,8 @@ | ||||||
| 			// 找图标高度最大值 | 			// 找图标高度最大值 | ||||||
| 			maxHeight() { | 			maxHeight() { | ||||||
| 				let arr = []; | 				let arr = []; | ||||||
| 				let max = ''; |  | ||||||
| 				this.list.forEach(item=>{arr.push(item.iconHeight);}) | 				this.list.forEach(item=>{arr.push(item.iconHeight);}) | ||||||
| 				if(arr.length) { | 				let max = arr.reduce((a,b)=>{return b > a ? b : a}) | ||||||
| 					max = arr.reduce((a,b)=>{return b > a ? b : a}) |  | ||||||
| 				} |  | ||||||
| 				return max; | 				return max; | ||||||
| 			}, | 			}, | ||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ | ||||||
| 	<view> | 	<view> | ||||||
| 		<view class="fon36 colb bold mar-x40" v-if="ifTitle">{{title}}</view> | 		<view class="fon36 colb bold mar-x40" v-if="ifTitle">{{title}}</view> | ||||||
| 		<view class="disjbac fw"> | 		<view class="disjbac fw"> | ||||||
| 			<view class="width48_5 fon30 mar-x30" @tap="goDetail(item.id)" v-for="(item,index) in dataList" :key="index"> | 			<view class="width48_5 fon30 mar-x30" @tap="goDetail(index)" v-for="(item,index) in dataList" :key="index"> | ||||||
| 				<view class="" style="height: 342rpx;"> | 				<view class="" style="height: 342rpx;"> | ||||||
| 					<image class="radius30 width100" :src="item.imgsrc" mode="aspectFill" style="height: 342rpx;"></image> | 					<image class="radius30 width100" :src="item.imgsrc" mode="aspectFill" style="height: 342rpx;"></image> | ||||||
| 				</view> | 				</view> | ||||||
|  | @ -10,28 +10,17 @@ | ||||||
| 					<view class="line-h50 mar-sx25 clips2" style="height: 90rpx;">{{item.title}}</view> | 					<view class="line-h50 mar-sx25 clips2" style="height: 90rpx;">{{item.title}}</view> | ||||||
| 					<view class="textc disjbac"> | 					<view class="textc disjbac"> | ||||||
| 						<view class="">¥{{item.price}}</view> | 						<view class="">¥{{item.price}}</view> | ||||||
| 						<i @tap.stop="addCartEv(item.skuId)" class="icon icon-shop-cart" style="font-size: 40rpx;"></i> | 						<i @tap.stop="addCartEv(index)" class="icon icon-shop-cart" style="font-size: 40rpx;"></i> | ||||||
| 					</view> | 					</view> | ||||||
| 				</view> | 				</view> | ||||||
| 			</view> | 			</view> | ||||||
| 		</view> | 		</view> | ||||||
| 		<view class="mar-s60" v-if="total==dataList.length"> |  | ||||||
| 			<pitera textStr="—— 到底啦 ——"></pitera> |  | ||||||
| 		</view> |  | ||||||
| 		<view class="loading-box mar-s60" v-show="ifLoading"> |  | ||||||
| 		    <view class="loader-16"></view> |  | ||||||
| 		</view> |  | ||||||
| 	</view> | 	</view> | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
| 	import pitera from '@/components/nothing/pitera'; |  | ||||||
| 	import {getCartNum} from '@/jsFile/public-api.js'; |  | ||||||
| 	export default { | 	export default { | ||||||
| 		name:"list-one", | 		name:"list-one", | ||||||
| 		components:{ |  | ||||||
| 			pitera |  | ||||||
| 		}, |  | ||||||
| 		props:{ | 		props:{ | ||||||
| 			// 是否显示标题 | 			// 是否显示标题 | ||||||
| 			ifTitle:{ | 			ifTitle:{ | ||||||
|  | @ -47,80 +36,29 @@ | ||||||
| 		data() { | 		data() { | ||||||
| 			return { | 			return { | ||||||
| 				dataList:[ | 				dataList:[ | ||||||
| 					// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖入海盐太妃糖入海盐太妃糖入海盐太妃糖入海盐太妃糖',price:'2,000'}, | 					{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖入海盐太妃糖入海盐太妃糖入海盐太妃糖入海盐太妃糖',price:'2,000'}, | ||||||
| 					// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | 					{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | ||||||
| 					// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | 					{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | ||||||
| 					// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | 					{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | ||||||
| 					// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | 					{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | ||||||
| 					// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | 					{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | ||||||
| 					// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | 					{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | ||||||
| 					// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | 					{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | ||||||
| 					// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | 					{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | ||||||
| 					// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | 					{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | ||||||
| 					// {id:1,skuId:1,imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | 					{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title:'人气热销-16入海盐太妃糖',price:'2,000'}, | ||||||
| 				], | 				] | ||||||
| 				ifLoading:false, |  | ||||||
| 				total:0, |  | ||||||
| 				page:1, |  | ||||||
| 				size:10 |  | ||||||
| 			}; | 			}; | ||||||
| 		}, | 		}, | ||||||
| 		mounted() { |  | ||||||
| 			this.getList(); |  | ||||||
| 		}, |  | ||||||
| 		methods:{ | 		methods:{ | ||||||
| 			moreEv() { |  | ||||||
| 				if(this.total!=this.dataList.length) { |  | ||||||
| 					this.page++; |  | ||||||
| 					this.getList(); |  | ||||||
| 				} |  | ||||||
| 				 |  | ||||||
| 			}, |  | ||||||
| 			// 列表查询 |  | ||||||
| 			getList(){ |  | ||||||
| 				this.ifLoading = true; |  | ||||||
| 				let params = { |  | ||||||
| 					keyword:'', |  | ||||||
| 					page:this.page, |  | ||||||
| 					size:this.size |  | ||||||
| 				} |  | ||||||
| 				this.$requst.post('/api/spu/home',params).then(res=>{ |  | ||||||
| 					if(res.code==0) { |  | ||||||
| 						this.total = res.data.total; |  | ||||||
| 						if(this.page==1) this.dataList = []; |  | ||||||
| 						if(res.data.list.length) { |  | ||||||
| 							res.data.list.forEach(item=>{ |  | ||||||
| 								let obj = { |  | ||||||
| 									id:item.id, |  | ||||||
| 									skuId:item.skuId, |  | ||||||
| 									imgsrc:item.cover, |  | ||||||
| 									title:item.name, |  | ||||||
| 									price:item.original_price |  | ||||||
| 								} |  | ||||||
| 								this.dataList.push(obj); |  | ||||||
| 							}) |  | ||||||
| 						} |  | ||||||
| 					} |  | ||||||
| 					this.ifLoading = false; |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 			// 加入购物车 | 			// 加入购物车 | ||||||
| 			addCartEv(id) { | 			addCartEv(id) { | ||||||
| 				if(this.$toolAll.tools.judgeAuth()) { | 				this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)') | ||||||
| 					this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{ |  | ||||||
| 						if(res.code==0) { |  | ||||||
| 							this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)'); |  | ||||||
| 							getCartNum(); |  | ||||||
| 						} else { |  | ||||||
| 							this.$toolAll.tools.showToast(res.msg) |  | ||||||
| 						} |  | ||||||
| 					}) |  | ||||||
| 				} |  | ||||||
| 			}, | 			}, | ||||||
| 			// 去详情 | 			// 去详情 | ||||||
| 			goDetail(id) { | 			goDetail(id) { | ||||||
| 				uni.navigateTo({ | 				uni.navigateTo({ | ||||||
| 					url:`/pagesB/shop-detail/shop-detail?id=${id}` | 					url:'/pagesB/shop-detail/shop-detail' | ||||||
| 				}) | 				}) | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | @ -1,55 +1,62 @@ | ||||||
| <template> | <template> | ||||||
| 	<view class="pad-x120"> | 	<view class="pad-x120"> | ||||||
| 		<view class="slide-box mar-x20 animated" v-for="(item, index) in listData" :key="index" :class="item.ifExit ? 'fadeIn' : 'fadeOutDown'" :style="{display: item.ifShow ? 'flex' : 'none'}"> | 		<view class="slide-box mar-x20 animated" v-for="(item, index) in listData" :key="index" :class="item.ifExit ? 'fadeInUp' : 'fadeOutDown'" :style="{display: item.ifShow ? 'flex' : 'none'}"> | ||||||
| 			<view class="slide-list" :style="{ transform: 'translate3d(' + item.slide_x + 'px, 0, 0)' }"> | 			<view class="slide-list"  | ||||||
| 				<view class="now-message-info" :style="{ width: windowWidth + 'px' }"> | 				@touchstart="touchStart($event, index)"  | ||||||
|  | 				@touchend="touchEnd($event, index)" | ||||||
|  | 				@touchmove="touchMove($event, index)"  | ||||||
|  | 				@tap="recover(index)" | ||||||
|  | 				:style="{ transform: 'translate3d(' + item.slide_x + 'px, 0, 0)' }"> | ||||||
|  | 				<view class="now-message-info" :style="{ width: windowWidth + 'px' }" @click="clickItemMethod(item)"> | ||||||
| 					<!-- <view class="mo-item flexs" @tap.stop="chooseEv(index)" :class="item.ifcheck ? 'active-item' : ''"></view> --> | 					<!-- <view class="mo-item flexs" @tap.stop="chooseEv(index)" :class="item.ifcheck ? 'active-item' : ''"></view> --> | ||||||
| 					<label class="radio"><radio :checked="item.ifcheck" @tap.stop="chooseEv(index)" color="#ff3673" style="transform: scale(.8);"/></label> | 					<label class="radio"><radio :checked="item.ifcheck" color="#ff3673" style="transform: scale(.8);"/></label> | ||||||
| 					<view class="shopp-img imgH mar-y20 mar-z10" @tap="goDetail(item.spuId)"> | 					<view class="shopp-img imgH mar-y20 mar-z10" @tap.stop="chooseEv(index)"> | ||||||
| 						<image class="shopp-img imgH width100" :src="item.image" mode="aspectFill"></image> | 						<image class="shopp-img imgH width100" :src="item.image" mode="aspectFill"></image> | ||||||
| 					</view> | 					</view> | ||||||
| 					<view class="imgH disjb fc fon24 width100"> | 					<view class="imgH disjb fc fon24 width100"> | ||||||
| 						<view class="" @tap="goDetail(item.spuId)"> | 						<view class=""> | ||||||
| 							<view class="fon28 bold clips2">{{item.title}}</view> | 							<view class="fon28 bold clips2">{{item.title}}</view> | ||||||
| 							<view class="clips2 line-h40">单位:{{item.content}}</view> | 							<view class="clips2 line-h40">单位:{{item.content}}</view> | ||||||
| 						</view> | 						</view> | ||||||
| 						<view class="disjbac"> | 						<view class="disjbac"> | ||||||
| 							<!-- 商品价格 --> | 							<!-- 商品价格 --> | ||||||
| 							<view class="fon24 textc bold">¥<span class="fon28 ">{{item.price}}</span></view> | 							<view class="fon24 textc bold">¥<span class="fon28 ">{{$toolAll.tools.changeNum(item.price)}}</span></view> | ||||||
| 							<!-- 商品数量 --> | 							<!-- 商品数量 --> | ||||||
| 							<view class="disac"> | 							<view class="disac"> | ||||||
| 								<!-- 减数量 --> | 								<!-- 减数量 --> | ||||||
| 								<i class="icon icon-cut countBtn disjcac" @tap.stop="addCutEv(index,0)" :style="{backgroundColor: item.num==minNum || item.slide_x!=0 ? '#cccccc': '#ff3673'}"></i> | 								<i class="icon icon-cut countBtn disjcac" @tap.stop="addCutEv(index,0)" :style="{backgroundColor: item.num==minNum || item.slide_x!=0 ? '#cccccc' : '#ff3673'}"></i> | ||||||
| 								<!-- 实际数量 --> | 								<!-- 实际数量 --> | ||||||
| 								<input type="digit" @blur="blurEv(index,$event)" @focus="focusEv(item.num)" class="fon24 tcenter countInput borbot-cc" :disabled="item.slide_x!=0" v-model="item.num"> | 								<input type="digit" @blur="blurEv(index,$event)" @focus="focusEv(item.num)" class="fon24 tcenter countInput borbot-cc" :disabled="item.slide_x!=0" v-model="item.num"> | ||||||
| 								<!-- 加数量 --> | 								<!-- 加数量 --> | ||||||
| 								<i class="icon icon-add countBtn disjcac" @tap.stop="addCutEv(index,1)" :style="{backgroundColor: item.num==maxNum || item.slide_x!=0 ? '#cccccc': '#ff3673'}"></i> | 								<i class="icon icon-add countBtn disjcac" @tap.stop="addCutEv(index,1)" :style="{backgroundColor: item.num==maxNum || item.slide_x!=0 ? '#cccccc' : '#ff3673'}"></i> | ||||||
| 							</view> | 							</view> | ||||||
| 						</view> | 						</view> | ||||||
| 					</view> | 					</view> | ||||||
| 				</view> | 				</view> | ||||||
|  | 				<view class="group-btn"> | ||||||
|  | 					<view class="btn-div" v-for="(value, key) in button" :key="key" | ||||||
|  | 						@tap.stop="clickMethod(item, value, index,key)" :style="{background: value.background}"> | ||||||
|  | 						{{value.title}} | ||||||
|  | 					</view> | ||||||
|  | 				</view> | ||||||
| 			</view> | 			</view> | ||||||
| 		</view> | 		</view> | ||||||
| 		<!-- 全选 --> | 		<!-- 底部导航 --> | ||||||
| 		<view class="disjbac cart-foot-box fon24" :style="{bottom: footHeight+'px'}"> | 		<view class="disjbac cart-foot-box fon24" :style="{bottom: footHeight+'px'}"> | ||||||
| 			<label class="disac" @tap="chooseAll"><radio :checked="allChoose" color="#ff3673" style="transform: scale(.8);"/><text>全选</text></label> | 			<label class="disac" @tap="chooseAll"><radio :checked="allChoose" color="#ff3673" style="transform: scale(.8);"/><text>全选</text></label> | ||||||
| 			<view class="disac"> | 			<view class="disac"> | ||||||
| 				<view class="fon24 mar-y30">合计:<span>¥{{allPrice}}</span></view> | 				<view class="fon24 mar-y30">合计:<span>¥{{$toolAll.tools.changeNum(allPrice)}}</span></view> | ||||||
| 				<view class="fon32" :style="{background: !buyNum ? '#cccccc' : 'linear-gradient(to right,#ff3771 0%,#fd5549 100%)'}" @tap="submitEv">{{allPrice==0 ? '去购物' : `提交订单 (${buyNum})`}}</view> | 				<view class="fon32 cart-submit-btn" :style="{background: !buyNum ? '#cccccc' : 'linear-gradient(to right,#ff3771 0%,#fd5549 100%)'}" @tap="submitEv">{{allPrice==0 ? '去购物' : `提交订单 (${buyNum})`}}</view> | ||||||
| 			</view>  | 			</view>  | ||||||
| 		</view>  | 		</view>  | ||||||
| 		<view class="" v-if="listData.length!=0 && total==listData.length"><pitera textStr="—— 到底啦 ——"></pitera></view> |  | ||||||
| 		<nothing-page v-if="!ifLoading && !listData.length" content="你的购物车:这也空空,那也空空(*^▽^*)"></nothing-page> | 		<nothing-page v-if="!ifLoading && !listData.length" content="你的购物车:这也空空,那也空空(*^▽^*)"></nothing-page> | ||||||
| 		<view class="loading-box" v-show="ifMore"> | 		<pitera textStr="——到底啦——"></pitera> | ||||||
| 		    <view class="loader-16"></view> |  | ||||||
| 		</view> |  | ||||||
| 	</view>  | 	</view>  | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
| 	import { mapState,mapGetters,mapMutations } from 'vuex'//引入mapState | 	import { mapState,mapGetters,mapMutations } from 'vuex'//引入mapState | ||||||
| 	import pitera from '@/components/nothing/pitera'; | 	import pitera from '@/components/nothing/pitera'; | ||||||
| 	import {getCartNum} from '@/jsFile/public-api.js'; |  | ||||||
| 	export default { | 	export default { | ||||||
| 		components:{ | 		components:{ | ||||||
| 			pitera | 			pitera | ||||||
|  | @ -60,12 +67,12 @@ | ||||||
| 				type: Array, | 				type: Array, | ||||||
| 				default () { | 				default () { | ||||||
| 					return [ | 					return [ | ||||||
| 						// {id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true}, | 						{id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true}, | ||||||
| 						// {id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true}, | 						{id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true}, | ||||||
| 						// {id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true}, | 						{id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true}, | ||||||
| 						// {id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true}, | 						{id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true}, | ||||||
| 						// {id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true}, | 						{id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true}, | ||||||
| 						// {id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true}, | 						{id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true}, | ||||||
| 					]; | 					]; | ||||||
| 				} | 				} | ||||||
| 			}, | 			}, | ||||||
|  | @ -78,9 +85,9 @@ | ||||||
| 					]; | 					]; | ||||||
| 				} | 				} | ||||||
| 			}, | 			}, | ||||||
| 			skuId:{ | 			customB:{ | ||||||
| 				type:String, | 				type:String, | ||||||
| 				default:0 | 				default:'0' | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		computed: { | 		computed: { | ||||||
|  | @ -92,13 +99,12 @@ | ||||||
| 				let allPrice = 0; | 				let allPrice = 0; | ||||||
| 				this.listData.forEach(item=>{ | 				this.listData.forEach(item=>{ | ||||||
| 					if(item.ifcheck) { | 					if(item.ifcheck) { | ||||||
| 						allPrice += item.price*item.num; | 						allPrice += this.$toolAll.tools.operationEv(item.price,item.num,'*',2)*1; | ||||||
| 					} | 					} | ||||||
| 				}) | 				}) | ||||||
| 				// return this.$toolAll.tools.addXiaoShu(allPrice); | 				// return this.$toolAll.tools.addXiaoShu(allPrice); | ||||||
| 				return allPrice.toString(); | 				return allPrice.toString(); | ||||||
| 			}, | 			}, | ||||||
| 			 |  | ||||||
| 			// 要删除的数量 | 			// 要删除的数量 | ||||||
| 			buyNum() { | 			buyNum() { | ||||||
| 				let buyNum = 0; | 				let buyNum = 0; | ||||||
|  | @ -109,7 +115,6 @@ | ||||||
| 				}) | 				}) | ||||||
| 				return buyNum; | 				return buyNum; | ||||||
| 			}, | 			}, | ||||||
| 			 |  | ||||||
| 			// 全选 | 			// 全选 | ||||||
| 			allChoose() { | 			allChoose() { | ||||||
| 				let ifAll = false; | 				let ifAll = false; | ||||||
|  | @ -133,57 +138,17 @@ | ||||||
| 				startTime: 0, | 				startTime: 0, | ||||||
| 				itemIndex: 0, | 				itemIndex: 0, | ||||||
| 				originalNum:0,//当前输入框原值 | 				originalNum:0,//当前输入框原值 | ||||||
| 				maxNum:99999,//最大可输入数量 | 				maxNum:20,//最大可输入数量 | ||||||
| 				minNum:1,//最小可输入数量 | 				minNum:1,//最小可输入数量 | ||||||
| 				ifLoading:true, | 				ifLoading:true, | ||||||
| 				page:1, |  | ||||||
| 				size:10, |  | ||||||
| 				total:0, |  | ||||||
| 				ifMore:false |  | ||||||
| 			}; | 			}; | ||||||
| 		}, | 		}, | ||||||
| 		mounted() { | 		mounted() { | ||||||
| 			this.listData = this.list; | 			this.listData = this.list; | ||||||
| 			this.getList(); | 			this.ifLoading = false; | ||||||
| 		}, | 		}, | ||||||
| 		methods: { | 		methods: { | ||||||
| 			getList(){ | 			getList(){ | ||||||
| 				console.log('触底'); |  | ||||||
| 				this.total = 0; |  | ||||||
| 				this.ifMore = true; |  | ||||||
| 				let params = { |  | ||||||
| 					page:this.page, |  | ||||||
| 					size:this.size |  | ||||||
| 				} |  | ||||||
| 				this.$requst.post('/api/order/shopping-cart',params).then(res=>{ |  | ||||||
| 					if(res.code==0){ |  | ||||||
| 						this.total = res.data.total; |  | ||||||
| 						if(this.page==1) this.listData = []; |  | ||||||
| 						if(res.data.list.length){ |  | ||||||
| 							res.data.list.forEach(item=>{ |  | ||||||
| 								let obj = { |  | ||||||
| 									id: item.id, |  | ||||||
| 									spuId:item.spu.id, |  | ||||||
| 									skuId:item.sku_id, |  | ||||||
| 									coding:item.sku.coding, |  | ||||||
| 									image: item.spu.spu_cover, |  | ||||||
| 									title: item.spu.spu_name, |  | ||||||
| 									content: item.spu.unit, |  | ||||||
| 									slide_x: 0, |  | ||||||
| 									price:item.spu.original_price, |  | ||||||
| 									num:item.num, |  | ||||||
| 									ifcheck:this.skuId==item.sku_id ? true : false, |  | ||||||
| 									ifExit:true, |  | ||||||
| 									ifShow:true, |  | ||||||
| 								} |  | ||||||
| 								this.listData.push(obj); |  | ||||||
| 								console.log(this.listData); |  | ||||||
| 							}) |  | ||||||
| 						} |  | ||||||
| 					} |  | ||||||
| 					this.ifMore = false; |  | ||||||
| 					this.ifLoading = false; |  | ||||||
| 				}) |  | ||||||
| 				// for (let i = 0; i < 10; i++) { | 				// for (let i = 0; i < 10; i++) { | ||||||
| 				// 	this.listData.push({id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true}) | 				// 	this.listData.push({id: 1,image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',title: '标题',content: '描述描述描述描述描述描述',slide_x: 0,price:199,num:1,ifcheck:false,ifExit:true,ifShow:true}) | ||||||
| 				// } | 				// } | ||||||
|  | @ -202,23 +167,9 @@ | ||||||
| 				if(this.allPrice==0) { | 				if(this.allPrice==0) { | ||||||
| 					// 去购物 | 					// 去购物 | ||||||
| 					console.log('去购物'); | 					console.log('去购物'); | ||||||
| 					uni.reLaunch({ |  | ||||||
| 						url:`/pages/tabbar/cate/cate?index=0` |  | ||||||
| 					}) |  | ||||||
| 				} else { | 				} else { | ||||||
| 					// 去结算 | 					// 去结算 | ||||||
| 					console.log('去结算'); | 					console.log('去结算'); | ||||||
| 					let buyList = []; |  | ||||||
| 					this.listData.forEach(item=>{ |  | ||||||
| 						if(item.ifcheck) { |  | ||||||
| 							let obj = { |  | ||||||
| 								sku_coding: item.coding, |  | ||||||
| 								num: item.num |  | ||||||
| 							} |  | ||||||
| 							buyList.push(obj); |  | ||||||
| 						} |  | ||||||
| 					}) |  | ||||||
| 					uni.setStorageSync('buyList',buyList); |  | ||||||
| 					uni.navigateTo({ | 					uni.navigateTo({ | ||||||
| 						url:'/pagesB/settlement/settlement' | 						url:'/pagesB/settlement/settlement' | ||||||
| 					}) | 					}) | ||||||
|  | @ -228,6 +179,12 @@ | ||||||
| 			chooseEv(index) { | 			chooseEv(index) { | ||||||
| 				this.listData[index].ifcheck = !this.listData[index].ifcheck; | 				this.listData[index].ifcheck = !this.listData[index].ifcheck; | ||||||
| 			}, | 			}, | ||||||
|  | 			// 去商品详情事件 | ||||||
|  | 			goDetail(id) { | ||||||
|  | 				uni.navigateTo({ | ||||||
|  | 					url:'/pagesB/shop-detail/shop-detail' | ||||||
|  | 				}) | ||||||
|  | 			}, | ||||||
| 			// 数量加减事件 | 			// 数量加减事件 | ||||||
| 			addCutEv(index,num) { | 			addCutEv(index,num) { | ||||||
| 				if(this.listData[index].slide_x==0){ | 				if(this.listData[index].slide_x==0){ | ||||||
|  | @ -240,44 +197,11 @@ | ||||||
| 						// 减 ,如果当前商品数量大于最小值 | 						// 减 ,如果当前商品数量大于最小值 | ||||||
| 						if(this.listData[index].num > this.minNum) { | 						if(this.listData[index].num > this.minNum) { | ||||||
| 							this.listData[index].num--; | 							this.listData[index].num--; | ||||||
| 						}else{ |  | ||||||
| 							uni.showModal({ |  | ||||||
| 								title: '提示', |  | ||||||
| 								content: '是否将该商品移除购物车?', |  | ||||||
| 								success: (res)=> { |  | ||||||
| 									if (res.confirm) { |  | ||||||
| 										this.delShopEv(this.listData[index].id); |  | ||||||
| 									} |  | ||||||
| 								} |  | ||||||
| 							}); |  | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 					this.$requst.post('/api/order/shopping-cart-change-num',{id:this.listData[index].id,num:this.listData[index].num}).then(res=>{ | 					console.log(this.allPrice,'总价'); | ||||||
| 						if(res.code!=0){ |  | ||||||
| 							this.$toolAll.tools.showToast(res.msg); |  | ||||||
| 						} |  | ||||||
| 					}) |  | ||||||
| 				} | 				} | ||||||
| 			}, | 			}, | ||||||
| 			// 删除商品 |  | ||||||
| 			delShopEv(id){ |  | ||||||
| 				this.$requst.post('/api/order/shopping-cart-del',{id:id}).then(res=>{ |  | ||||||
| 					if(res.code==0){ |  | ||||||
| 						this.$toolAll.tools.showToast('删除成功'); |  | ||||||
| 						this.getList(); |  | ||||||
| 					}else{ |  | ||||||
| 						this.$toolAll.tools.showToast(res.msg) |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			// 查看商品详情 |  | ||||||
| 			goDetail(id) { |  | ||||||
| 				uni.navigateTo({ |  | ||||||
| 					url:'/pagesB/shop-detail/shop-detail?id='+id |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			// 输入框获取焦点事件 | 			// 输入框获取焦点事件 | ||||||
| 			focusEv(num) { | 			focusEv(num) { | ||||||
| 				// 储存当前商品的原始数值 | 				// 储存当前商品的原始数值 | ||||||
|  | @ -290,6 +214,133 @@ | ||||||
| 				// 如果当前输入框的值不等于0或空,并且当前输入框的值大于最大值,当前商品的数量 = 最大值, 否则为当前输入框输入的值 | 				// 如果当前输入框的值不等于0或空,并且当前输入框的值大于最大值,当前商品的数量 = 最大值, 否则为当前输入框输入的值 | ||||||
| 				this.listData[index].num = currentNum ? currentNum > this.maxNum ? this.maxNum : currentNum : this.originalNum; | 				this.listData[index].num = currentNum ? currentNum > this.maxNum ? this.maxNum : currentNum : this.originalNum; | ||||||
| 			}, | 			}, | ||||||
|  | 			clone(data) { | ||||||
|  | 				const type = typeof data | ||||||
|  | 				let obj; | ||||||
|  | 				if (type === 'array') { | ||||||
|  | 					obj = []; | ||||||
|  | 				} else if (type === 'object') { | ||||||
|  | 					obj = {}; | ||||||
|  | 				} else { | ||||||
|  | 					// 不再具有下一层次 | ||||||
|  | 					return data; | ||||||
|  | 				} | ||||||
|  | 				if (type === 'array') { | ||||||
|  | 					for (let i = 0, len = data.length; i < len; i++) { | ||||||
|  | 						obj.push(this.clone(data[i])); | ||||||
|  | 					} | ||||||
|  | 				} else if (type === 'object') { | ||||||
|  | 					// 对原型上的方法也拷贝了.... | ||||||
|  | 					for (const key in data) { | ||||||
|  | 						obj[key] = this.clone(data[key]); | ||||||
|  | 					} | ||||||
|  | 				} | ||||||
|  | 				return obj; | ||||||
|  | 			}, | ||||||
|  | 
 | ||||||
|  | 			// 滑动开始 | ||||||
|  | 			touchStart(e, index) { | ||||||
|  | 				if (this.itemIndex == index) { | ||||||
|  | 					this.itemIndex = index | ||||||
|  | 				} | ||||||
|  | 				//记录手指放上去的时间 | ||||||
|  | 				this.startTime = e.timeStamp; | ||||||
|  | 				//记录滑块的初始位置 | ||||||
|  | 				this.start_slide_x = this.listData[index].slide_x; | ||||||
|  | 				// 按钮宽度 | ||||||
|  | 				//#ifdef MP-WEIXIN | ||||||
|  | 				uni.createSelectorQuery().in(this).selectAll('.group-btn').boundingClientRect(res => { | ||||||
|  | 					if (res != null) { | ||||||
|  | 						this.btnWidth = res[index].width * -1; | ||||||
|  | 					} | ||||||
|  | 				}).exec(); | ||||||
|  | 				//#endif | ||||||
|  | 				//#ifdef H5 || APP-PLUS | ||||||
|  | 				uni.createSelectorQuery() | ||||||
|  | 					.selectAll('.group-btn') | ||||||
|  | 					.boundingClientRect() | ||||||
|  | 					.exec(res => { | ||||||
|  | 						if (res[0] != null) { | ||||||
|  | 							this.btnWidth = res[0][index].width * -1; | ||||||
|  | 						} | ||||||
|  | 					}); | ||||||
|  | 				//#endif | ||||||
|  | 				// 记录上一次开始时手指所处位置 | ||||||
|  | 				this.startX = e.touches[0].pageX; | ||||||
|  | 				// 记录上一次手指位置 | ||||||
|  | 				this.lastX = this.startX; | ||||||
|  | 				//初始化非当前滑动消息列的位置			 | ||||||
|  | 				for (var i in this.listData) { | ||||||
|  | 					if (index != i) { | ||||||
|  | 						this.listData[i].slide_x = 0; | ||||||
|  | 					} | ||||||
|  | 				} | ||||||
|  | 			}, | ||||||
|  | 			// 滑动中 | ||||||
|  | 			touchMove(e, index) { | ||||||
|  | 				const endX = e.touches[0].pageX; | ||||||
|  | 				const distance = endX - this.lastX; | ||||||
|  | 				// 预测滑块所处位置 | ||||||
|  | 				const duang = this.listData[index].slide_x + distance; | ||||||
|  | 				// 如果在可行区域内 | ||||||
|  | 				if (duang <= 0 && duang >= this.btnWidth) { | ||||||
|  | 					this.listData[index].slide_x = duang; | ||||||
|  | 				} | ||||||
|  | 				// 此处手指所处位置将成为下次手指移动时的上一次位置 | ||||||
|  | 				this.lastX = endX; | ||||||
|  | 			}, | ||||||
|  | 			// 滑动结束 | ||||||
|  | 			touchEnd(e, index) { | ||||||
|  | 				let distance = 10; | ||||||
|  | 				const endTime = e.timeStamp; | ||||||
|  | 				const x_end_distance = this.startX - this.lastX; | ||||||
|  | 				if (Math.abs(endTime - this.startTime) > 200) { | ||||||
|  | 					distance = this.btnWidth / -2; | ||||||
|  | 				} | ||||||
|  | 				// 判断手指最终位置与手指开始位置的位置差距 | ||||||
|  | 				if (x_end_distance > distance) { | ||||||
|  | 					this.listData[index].slide_x = this.btnWidth; | ||||||
|  | 				} else if (x_end_distance < distance * -1) { | ||||||
|  | 					this.listData[index].slide_x = 0; | ||||||
|  | 				} else { | ||||||
|  | 					this.listData[index].slide_x = this.start_slide_x; | ||||||
|  | 				} | ||||||
|  | 			}, | ||||||
|  | 			// 点击回复原状 | ||||||
|  | 			recover(index) { | ||||||
|  | 				this.listData[index].slide_x = 0; | ||||||
|  | 			}, | ||||||
|  | 			/**  | ||||||
|  | 			 * 点击按钮触发事件 | ||||||
|  | 			 * @param {Object} item 列表数据  | ||||||
|  | 			 * @param {Object} buttonItem 按钮数据 | ||||||
|  | 			 * @param {Object} index 列表数据key | ||||||
|  | 			 */ | ||||||
|  | 			clickMethod(item, buttonItem, index,key) { | ||||||
|  | 				// this.$emit("change", item, buttonItem, index); | ||||||
|  | 				// if(key) { | ||||||
|  | 					// 进入删除 | ||||||
|  | 					// 修改为不存在的商品 | ||||||
|  | 					this.listData[index].ifExit = false; | ||||||
|  | 					// 修改该商品不被选中 | ||||||
|  | 					this.listData[index].ifcheck = false; | ||||||
|  | 					setTimeout(()=>{ | ||||||
|  | 						// 隐藏该商品 | ||||||
|  | 						this.listData[index].ifShow = false; | ||||||
|  | 					},1000) | ||||||
|  | 					setTimeout(()=>{ | ||||||
|  | 						// 重构数组列表,去除不存在的商品 | ||||||
|  | 						this.listData = this.listData.filter(item=>item.ifExit==true); | ||||||
|  | 					},1000) | ||||||
|  | 				// } | ||||||
|  | 			}, | ||||||
|  | 			/** | ||||||
|  | 			 * 点击按钮触发事件 | ||||||
|  | 			 * @param {Object} item 列表数据  | ||||||
|  | 			 */ | ||||||
|  | 			clickItemMethod(item) { | ||||||
|  | 				this.$emit("click", item) | ||||||
|  | 			} | ||||||
| 		} | 		} | ||||||
| 	}; | 	}; | ||||||
| </script> | </script> | ||||||
|  | @ -347,7 +398,7 @@ | ||||||
| 	} | 	} | ||||||
| 	.countBtn{font-size: 36rpx;width: 40rpx;height: 40rpx;background-color: #000000;color: #FFFFFF; border-radius: 10rpx;} | 	.countBtn{font-size: 36rpx;width: 40rpx;height: 40rpx;background-color: #000000;color: #FFFFFF; border-radius: 10rpx;} | ||||||
| 	.countInput{background-color: #FFFFFF;width: 80rpx;height: 40rpx!important; border-radius: 10rpx;padding: 0rpx 0;margin: 0 10rpx;} | 	.countInput{background-color: #FFFFFF;width: 80rpx;height: 40rpx!important; border-radius: 10rpx;padding: 0rpx 0;margin: 0 10rpx;} | ||||||
| 	.cart-foot-box{position: fixed;bottom: 0;right: 0;left: 0;background-color: #FFFFFF;z-index: 2; padding: 20rpx 20rpx;box-shadow: -6rpx 0rpx 10rpx rgba(0, 0, 0, 0);} | 	.cart-foot-box{position: fixed;bottom: 0;right: 0;left: 0;background-color: #FFFFFF; padding: 20rpx 20rpx;box-shadow: -6rpx 0rpx 10rpx rgba(0, 0, 0, 0);} | ||||||
| 	.cart-submit-btn{ | 	.cart-submit-btn{ | ||||||
| 		 | 		 | ||||||
| 		color: #FFFFFF; | 		color: #FFFFFF; | ||||||
|  |  | ||||||
|  | @ -132,14 +132,7 @@ | ||||||
| 			}, | 			}, | ||||||
| 			//返回事件 | 			//返回事件 | ||||||
| 			backEv(){ | 			backEv(){ | ||||||
| 				uni.navigateBack({ | 				uni.navigateBack({delta:1}) | ||||||
| 					delta:1, |  | ||||||
| 					fail: () => { |  | ||||||
| 						uni.reLaunch({ |  | ||||||
| 							url:'/pages/tabbar/pagehome/pagehome' |  | ||||||
| 						}) |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -13,7 +13,7 @@ | ||||||
| 			</view> | 			</view> | ||||||
| 			<!-- 下划线 --> | 			<!-- 下划线 --> | ||||||
| 			<view class="tab__line" | 			<view class="tab__line" | ||||||
| 				:style="{background: lineColor, width: lineStyle.width, transform: lineStyle.transform}"> | 				:style="{background: lineColor, width: lineStyle.width, transform: lineStyle.transform,transitionDuration: lineStyle.transitionDuration}"> | ||||||
| 			</view> | 			</view> | ||||||
| 		</scroll-view> | 		</scroll-view> | ||||||
| 	</view> | 	</view> | ||||||
|  | @ -159,10 +159,9 @@ | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		.tab__line { | 		.tab__line { | ||||||
| 			display: inline-block; | 			display: block; | ||||||
| 			// height: 6rpx; | 			// height: 6rpx; | ||||||
| 			position: absolute; | 			position: absolute; | ||||||
| 			width: 0; |  | ||||||
| 			height: 64rpx; | 			height: 64rpx; | ||||||
| 			bottom: 0rpx; | 			bottom: 0rpx; | ||||||
| 			left: 0; | 			left: 0; | ||||||
|  |  | ||||||
|  | @ -112,6 +112,7 @@ | ||||||
| 			}; | 			}; | ||||||
| 		}, | 		}, | ||||||
| 		mounted() { | 		mounted() { | ||||||
|  | 			// 缓存状态栏+标题栏的高度 | ||||||
| 			const query = wx.createSelectorQuery().in(this) | 			const query = wx.createSelectorQuery().in(this) | ||||||
| 			query.select('.posi-sticky').boundingClientRect((rect) => { | 			query.select('.posi-sticky').boundingClientRect((rect) => { | ||||||
| 				console.log(rect.height); | 				console.log(rect.height); | ||||||
|  |  | ||||||
|  | @ -75,7 +75,7 @@ | ||||||
| 		methods:{ | 		methods:{ | ||||||
| 			// 图片点击事件 | 			// 图片点击事件 | ||||||
| 			chooseImg(index,url){ | 			chooseImg(index,url){ | ||||||
| 				console.log('当前banner图',index,url); | 				// console.log('当前banner图',index); | ||||||
| 				this.bcurrent = index | 				this.bcurrent = index | ||||||
| 				if(this.browseP){ | 				if(this.browseP){ | ||||||
| 					let imgList = [] | 					let imgList = [] | ||||||
|  | @ -104,13 +104,11 @@ | ||||||
| 						current:this.bcurrent, | 						current:this.bcurrent, | ||||||
| 						sources:imgList | 						sources:imgList | ||||||
| 					}) | 					}) | ||||||
| 				} | 				} else { | ||||||
| 				if(url){ |  | ||||||
| 					// 有链接,跳转链接 | 					// 有链接,跳转链接 | ||||||
| 					uni.navigateTo({ | 					uni.navigateTo({ | ||||||
| 						url:`/${url}` | 						url:`/${url}` | ||||||
| 					}) | 					}) | ||||||
| 					console.log(`/${url}`,'跳转链接'); |  | ||||||
| 				} | 				} | ||||||
| 			}, | 			}, | ||||||
| 			// 切换后获取当前索引 | 			// 切换后获取当前索引 | ||||||
|  |  | ||||||
|  | @ -1,47 +1,4 @@ | ||||||
| import requst from './requst.js'; | import request from './requst.js'; | ||||||
| import store from '@/store/index.js' | export function uploadImg(data) { | ||||||
| // 查询轮播位置
 |   return request.upload("/universal/api.upload/upload", data); | ||||||
| export function slidePosition(data) { |  | ||||||
|   return requst.get("/api/common/slide-positions"); |  | ||||||
| } |  | ||||||
| //查询主题色,图标配置
 |  | ||||||
| export function themeEv(){ |  | ||||||
| 	return requst.get('/api/index/mini-program-setting').then(res=>{ |  | ||||||
| 		if(res.code==0){ |  | ||||||
| 			let list = []; |  | ||||||
| 			if(res.data.footBar.length){//底部导航
 |  | ||||||
| 				res.data.footBar.forEach(item=>{ |  | ||||||
| 					let obj = { |  | ||||||
| 						iconPath: item.icon, |  | ||||||
| 						selectedIconPath: item.icon, |  | ||||||
| 						title:item.name |  | ||||||
| 					} |  | ||||||
| 					list.push(obj); |  | ||||||
| 				}) |  | ||||||
| 				store.commit('updateState', {list}) |  | ||||||
| 			} |  | ||||||
| 			let geList = []; |  | ||||||
| 			if(res.data.recommend.length){//底部导航
 |  | ||||||
| 				res.data.recommend.forEach((item,index)=>{ |  | ||||||
| 					let obj = { |  | ||||||
| 						url:item.link, |  | ||||||
| 						iconsrc:item.icon, |  | ||||||
| 						iconWidth:[48,56,64,48,56,58,48,44,54,52][index], |  | ||||||
| 						iconHeight:[50,54,46,48,58,52,54,56,50,52][index], |  | ||||||
| 						title:item.name |  | ||||||
| 					} |  | ||||||
| 					geList.push(obj); |  | ||||||
| 				}) |  | ||||||
| 				store.commit('setGe', {geList}) |  | ||||||
| 			} |  | ||||||
| 		} |  | ||||||
| 	}) |  | ||||||
| } |  | ||||||
| // 查询购物车数量
 |  | ||||||
| export function getCartNum(){ |  | ||||||
| 	return requst.get('/api/order/shopping-cart-count').then(res=>{ |  | ||||||
| 		if(res.code==0){ |  | ||||||
| 			store.commit('setNum', res.data.count) |  | ||||||
| 		} |  | ||||||
| 	}) |  | ||||||
| } | } | ||||||
|  | @ -2,64 +2,73 @@ | ||||||
| const goLogin = () => { | const goLogin = () => { | ||||||
|     uni.clearStorageSync(); |     uni.clearStorageSync(); | ||||||
|     uni.navigateTo({ |     uni.navigateTo({ | ||||||
|         url: '/pagesB/login/login' |         url: '/pages/login/login' | ||||||
|     }) |     }) | ||||||
| } | } | ||||||
| let flag = true; | let flag = true; | ||||||
| // 刷新token并跳转到当前页面
 | // 刷新token并跳转到当前页面
 | ||||||
| var authTimer = null; |  | ||||||
| const refreshTokenPage = () => { | const refreshTokenPage = () => { | ||||||
| 	clearTimeout(authTimer); | 	uni.login({ | ||||||
| 	uni.showToast({ | 		provider: 'weixin', | ||||||
| 		title: `请授权登录`, | 		success: (result)=> { | ||||||
| 		icon:'none', | 			uni.request({ | ||||||
| 		duration: 1000 | 				url: `${getApp().globalData.hostapi}user/login`, | ||||||
|  | 				method: 'post', | ||||||
|  | 				data: {code:result.code}, | ||||||
|  | 				success: res => { | ||||||
|  | 					if(res.data.data.token!=''){ | ||||||
|  | 						flag = true; | ||||||
|  | 						uni.setStorageSync('token',res.data.data.token); // 缓存token
 | ||||||
|  | 						uni.setStorageSync('openid',res.data.data.openid)//缓存openid
 | ||||||
|  | 						uni.setStorageSync('expire',res.data.data.expire); // 缓存失效时间(时间戳格式)
 | ||||||
|  | 						uni.reLaunch({ // 重新进入当前页面
 | ||||||
|  | 							url:uni.getStorageSync('page-path-options') | ||||||
|  | 						}) | ||||||
|  | 					} | ||||||
|  | 				} | ||||||
|  | 			}) | ||||||
|  | 		}, | ||||||
| 	}); | 	}); | ||||||
| 	authTimer = setTimeout(()=>{ |  | ||||||
| 		uni.reLaunch({url:'/pagesB/login/login'}); |  | ||||||
| 	},1000) |  | ||||||
| 	flag = true; |  | ||||||
| } | } | ||||||
| // 请求错误处理
 | // 请求错误处理
 | ||||||
| const checkError = (e) => { | const checkError = (e) => { | ||||||
| 	console.log('500接口错误'); |  | ||||||
|     // console.error("----接口错误----", e)
 |     // console.error("----接口错误----", e)
 | ||||||
|     if (e.data) { |     if (e.data) { | ||||||
|         if (e.data.code) { |         if (e.data.code) { | ||||||
|             switch (Number(e.data.code)) { |             switch (Number(e.data.code)) { | ||||||
| 				case 500: | 				case 500: | ||||||
| 					// 接口错误
 | 				// 接口错误
 | ||||||
| 					console.log('500接口错误'); | 				console.log('500接口错误'); | ||||||
|                 case 4003: |                 case 4003: | ||||||
| 					// 参数错误
 | 				// 参数错误
 | ||||||
| 					console.log('4003参数错误'); | 				console.log('4003参数错误'); | ||||||
|                     break; |                     break; | ||||||
| 				case 4004: | 				case 4004: | ||||||
| 					// 记录不存在
 | 				// 记录不存在
 | ||||||
| 					console.log('4004记录不存在'); | 				console.log('4004记录不存在'); | ||||||
| 				    break; | 				    break; | ||||||
| 				case 5001: | 				case 5001: | ||||||
| 					// xxx错误
 | 				// xxx错误
 | ||||||
| 					console.log('5001xxx错误'); | 				console.log('5001xxx错误'); | ||||||
| 				    break; | 				    break; | ||||||
| 				case 5050: | 				case 5050: | ||||||
| 					// 服务器错误,请稍后重试
 | 				// 服务器错误,请稍后重试
 | ||||||
| 					console.log('5050服务器错误,请稍后重试'); | 				console.log('5050服务器错误,请稍后重试'); | ||||||
| 					// 调用到登录页
 | 				// 调用到登录页
 | ||||||
| 					goLogin(); | 				goLogin(); | ||||||
| 				    break; | 				    break; | ||||||
| 				case 5051: | 				case 5051: | ||||||
| 					// 未知错误
 | 				// 未知错误
 | ||||||
| 					console.log('5051未知错误'); | 				console.log('5051未知错误'); | ||||||
| 				    break; | 				    break; | ||||||
| 				case 6001: | 				case 6001: | ||||||
| 					// token验证失败或已失效
 | 				// token验证失败或已失效
 | ||||||
| 					console.log('6001token验证失败或已失效'); | 				console.log('6001token验证失败或已失效'); | ||||||
| 					if(flag) { | 				if(flag) { | ||||||
| 						flag = false; | 					flag = false; | ||||||
| 						// 调用刷新token事件并跳转到当前页面
 | 					// 调用刷新token事件并跳转到当前页面
 | ||||||
| 						refreshTokenPage(); | 					refreshTokenPage(); | ||||||
| 					} | 				} | ||||||
| 				    break; | 				    break; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  | @ -102,8 +111,10 @@ const request = (method, url, options) => { | ||||||
| 			success: res => { | 			success: res => { | ||||||
| 				console.log(`${url}返的结果===>`,res); | 				console.log(`${url}返的结果===>`,res); | ||||||
| 				if (res.statusCode == 200) { | 				if (res.statusCode == 200) { | ||||||
| 					resolve(res.data); | 					if (res.data.code == 0) { | ||||||
| 					if(res.data.code !== 0){ | 						// 接口调用成功
 | ||||||
|  | 						resolve(res.data); | ||||||
|  | 					} else { | ||||||
| 						// 接口返回错误信息
 | 						// 接口返回错误信息
 | ||||||
| 						checkError(res); | 						checkError(res); | ||||||
| 					} | 					} | ||||||
|  |  | ||||||
|  | @ -270,7 +270,7 @@ const tools = { | ||||||
| 		}) | 		}) | ||||||
| 		.replace('<section', '<div') | 		.replace('<section', '<div') | ||||||
| 		.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, (match, p1) => { | 		.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, (match, p1) => { | ||||||
| 		    return `<img mode="widthFix" style="max-width:100%!important;height:auto" src='${p1.indexOf('http') > -1 ? p1 : 'https://www.cdxidoudou.cn' + p1}' />` | 		    return `<img mode="widthFix" style="max-width:100%!important;height:auto" src='${p1.indexOf('http') > -1 ? p1 : 'https://oss.hmzfyy.cn' + p1}' />` | ||||||
| 		}) | 		}) | ||||||
| 	}, | 	}, | ||||||
| 	/** | 	/** | ||||||
|  | @ -384,9 +384,9 @@ const tools = { | ||||||
| 		let auth = false; | 		let auth = false; | ||||||
| 		clearTimeout(this.authTimer); | 		clearTimeout(this.authTimer); | ||||||
| 		if(!uni.getStorageSync('token')) { | 		if(!uni.getStorageSync('token')) { | ||||||
| 			this.showToast('请授权登录'); | 			this.showToast('请登录'); | ||||||
| 			this.authTimer = setTimeout(()=>{ | 			this.authTimer = setTimeout(()=>{ | ||||||
| 				uni.reLaunch({url:'/pagesB/login/login'}); | 				uni.navigateTo({url:'/pages/login/login'}); | ||||||
| 			},2000) | 			},2000) | ||||||
| 		} else { | 		} else { | ||||||
| 			auth = true; | 			auth = true; | ||||||
|  | @ -578,9 +578,7 @@ const tools = { | ||||||
| 					success: (res) => { | 					success: (res) => { | ||||||
| 						uni.saveImageToPhotosAlbum({ | 						uni.saveImageToPhotosAlbum({ | ||||||
| 							filePath: res.tempFilePath, | 							filePath: res.tempFilePath, | ||||||
| 							success: ()=> { | 							success: ()=> {}, | ||||||
| 								uni.showToast({title:'保存成功',icon:'error'}) |  | ||||||
| 							}, |  | ||||||
| 							fail: () => { | 							fail: () => { | ||||||
| 								uni.showToast({title:'保存失败',icon:'error'}) | 								uni.showToast({title:'保存失败',icon:'error'}) | ||||||
| 							} | 							} | ||||||
|  |  | ||||||
							
								
								
									
										6
									
								
								main.js
								
								
								
								
							
							
						
						
									
										6
									
								
								main.js
								
								
								
								
							|  | @ -17,16 +17,10 @@ Vue.prototype.$toolAll = tools; | ||||||
| import requst from '@/jsFile/requst.js'; | import requst from '@/jsFile/requst.js'; | ||||||
| Vue.prototype.$requst = requst; | Vue.prototype.$requst = requst; | ||||||
| 
 | 
 | ||||||
| //不显示console.log
 |  | ||||||
| if (uni.getSystemInfoSync().platform !== "devtools") { |  | ||||||
| 	console.log = () => {} |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| App.mpType = 'app'; | App.mpType = 'app'; | ||||||
| 
 | 
 | ||||||
| const app = new Vue({ | const app = new Vue({ | ||||||
| 	store, | 	store, | ||||||
|     ...App |     ...App | ||||||
| }) | }) | ||||||
| 
 |  | ||||||
| app.$mount() | app.$mount() | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| { | { | ||||||
|     "name" : "喜兜兜", |     "name" : "app适配微信小程序", | ||||||
|     "appid" : "__UNI__768F35C", |     "appid" : "__UNI__768F35C", | ||||||
|     "description" : "这是一款基于uniapp开发的app和微信小程序的模板框架", |     "description" : "这是一款基于uniapp开发的app和微信小程序的模板框架", | ||||||
|     "versionName" : "1.0.0", |     "versionName" : "1.0.0", | ||||||
|  | @ -69,7 +69,7 @@ | ||||||
|     /* 快应用特有相关 */ |     /* 快应用特有相关 */ | ||||||
|     "mp-weixin" : { |     "mp-weixin" : { | ||||||
|         /* 小程序特有相关 */ |         /* 小程序特有相关 */ | ||||||
|         "appid" : "wx9cfa3ee7718b714e", |         "appid" : "wxa02e44170bc722cd", | ||||||
|         "setting" : { |         "setting" : { | ||||||
|             "urlCheck" : true, |             "urlCheck" : true, | ||||||
|             "es6" : true |             "es6" : true | ||||||
|  |  | ||||||
							
								
								
									
										11
									
								
								pages.json
								
								
								
								
							
							
						
						
									
										11
									
								
								pages.json
								
								
								
								
							|  | @ -4,7 +4,7 @@ | ||||||
|             "path": "pages/tabbar/pagehome/pagehome", |             "path": "pages/tabbar/pagehome/pagehome", | ||||||
|             "style": { |             "style": { | ||||||
|                 "navigationBarTitleText": "", |                 "navigationBarTitleText": "", | ||||||
| 				"enablePullDownRefresh": false, |                 "enablePullDownRefresh": false, | ||||||
|                 "navigationStyle": "custom", //禁用原生导航栏,微信小程序可用 |                 "navigationStyle": "custom", //禁用原生导航栏,微信小程序可用 | ||||||
|                 "navigationBarTextStyle": "black", |                 "navigationBarTextStyle": "black", | ||||||
|                 "app-plus": { |                 "app-plus": { | ||||||
|  | @ -37,7 +37,16 @@ | ||||||
|     "subPackages": [{ //A包 |     "subPackages": [{ //A包 | ||||||
|             "root": "pagesA", |             "root": "pagesA", | ||||||
|             "pages": [ |             "pages": [ | ||||||
|  | 				{ | ||||||
|  |                     "path" : "shopping-cart-slide/shopping-cart-slide", | ||||||
|  |                     "style" :                                                                                     | ||||||
|                 { |                 { | ||||||
|  |                     "navigationBarTitleText": "", | ||||||
|  |                     "enablePullDownRefresh": false | ||||||
|  |                 } | ||||||
|  |                  | ||||||
|  |                 } | ||||||
|  |                 ,{ | ||||||
|                     "path" : "order-list/order-list", |                     "path" : "order-list/order-list", | ||||||
|                     "style" :                                                                                     |                     "style" :                                                                                     | ||||||
|                 { |                 { | ||||||
|  |  | ||||||
|  | @ -1,456 +1,41 @@ | ||||||
| <template> | <template> | ||||||
| 	<view class="pad-x160"> | 	<view class="pad-x160"> | ||||||
| 		<status-nav :ifReturn="true" navBarTitle="购物车" :marginBottom="0"></status-nav> | 		<status-container :ifReturn="false" titlet="购物车" :ifCustomer='false'> | ||||||
| 		<view class="cart-content"> | 			<view slot="content" style="margin: 0rpx -20rpx 0 -20rpx;"> | ||||||
| 			<!-- <view class="cart-admin" v-if="listData.length>0" @tap="showDel=!showDel"><text>购物车信息</text>{{showDel?'取消':'管理'}}</view> --> | 				<cart-slide ref="cart"></cart-slide> | ||||||
| 			<view class="slide-list"> |  | ||||||
| 				<view class="slide-item" v-for="(item, index) in listData" :key="index"> |  | ||||||
| 					<view class="slide-item-li" @click="clickItemMethod(item)"> |  | ||||||
| 						<label class="radio"><radio :checked="item.ifcheck" @tap.stop="chooseEv(index)" color="#ff3673"/></label> |  | ||||||
| 						<view class="shop-img" @tap="goDetail(item.spuId,item.is_series)"> |  | ||||||
| 							<image :src="item.image" mode="widthFix"></image> |  | ||||||
| 						</view> |  | ||||||
| 						<view class="shop-txt"> |  | ||||||
| 							<view class="shop-txt-top" @tap="goDetail(item.spuId,item.is_series)"> |  | ||||||
| 								<view class="fon28 bold clips2">{{item.title}}</view> |  | ||||||
| 								<view class="fon24 clips2 line-h40">单位:{{item.content}}</view> |  | ||||||
| 							</view> |  | ||||||
| 							<view class="shop-txt-bottom"> |  | ||||||
| 								<!-- 商品价格 --> |  | ||||||
| 								<view class="fon24 textc bold">¥<span class="fon28 ">{{item.price}}</span></view> |  | ||||||
| 								<!-- 商品数量 --> |  | ||||||
| 								<view class="num"> |  | ||||||
| 									<!-- 减数量 --> |  | ||||||
| 									<i class="icon icon-cut count-btn" @tap.stop="addCutEv(index,0)" :style="{backgroundColor: item.num==minNum || item.slide_x!=0 ? '#d3d3d3' : '#ff3673'}"></i> |  | ||||||
| 									<!-- 实际数量 --> |  | ||||||
| 									<input class="input" type="digit" @blur="blurEv(index,$event)" @focus="focusEv(item.num)" :disabled="item.slide_x!=0" v-model="item.num"> |  | ||||||
| 									<!-- 加数量 --> |  | ||||||
| 									<i class="icon icon-add count-btn" @tap.stop="addCutEv(index,1)" :style="{backgroundColor: item.num==maxNum || item.slide_x!=0 ? '#d3d3d3' : '#ff3673'}"></i> |  | ||||||
| 								</view> |  | ||||||
| 							</view> |  | ||||||
| 						</view> |  | ||||||
| 					</view> |  | ||||||
| 				</view> |  | ||||||
| 			</view> | 			</view> | ||||||
| 			 | 		</status-container>  | ||||||
| 			<!-- 全选 --> | 		<!-- 底部tab --> | ||||||
| 			<view class="change-all"> | 		<view class="foot-box"><foot-tab current="2"></foot-tab></view> | ||||||
| 				<label class="label" @tap="chooseAll"><radio :checked="allChoose" color="#ff3673" style="transform: scale(.8);margin-left: -6rpx;"/><text>全选</text></label> |  | ||||||
| 				<view class="all-price" v-if="showDel"> |  | ||||||
| 					<view class="btn" style="background-color: #ff3673;" @tap="delShopEv">删除</view> |  | ||||||
| 				</view> |  | ||||||
| 				<view class="all-price" v-else> |  | ||||||
| 					<view class="price">合计:<span>¥{{allPrice}}</span></view> |  | ||||||
| 					<view class="btn cart-submit-btn" :style="{background: !buyNum?'#cccccc':'linear-gradient(to right,#ff3771 0%,#fd5549 100%)'}" @tap="submitEv">{{allPrice==0 ? '去购物' : `提交订单 (${buyNum})`}}</view> |  | ||||||
| 				</view> |  | ||||||
| 			</view> |  | ||||||
| 			<!-- 暂无更多内容 --> |  | ||||||
| 			<view class="more-txt" v-if="listData.length!==0 && noMore"><pitera textStr="—— 到底啦 ——"></pitera></view> |  | ||||||
| 			<nothing-page v-if="isLoading && listData.length==0" content="您的购物车,空空如也(*^▽^*)"></nothing-page> |  | ||||||
| 		</view>  |  | ||||||
| 	</view> | 	</view> | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
| 	// 底部组件 | 	// 底部组件 | ||||||
| 	import statusNav from '@/components/status-navs/status-nav.vue'; | 	import footTab from '@/components/foot-tabs/foot-tab.vue'; | ||||||
| 	import {getCartNum} from '@/jsFile/public-api.js'; | 	import cartSlide from '@/components/shopping-carts/cart-slide'; | ||||||
| 	import pitera from '@/components/nothing/pitera'; |  | ||||||
| 	import {mapState} from 'vuex'//引入mapState |  | ||||||
| 	export default { | 	export default { | ||||||
| 		components:{ | 		components:{ | ||||||
| 			statusNav, | 			'foot-tab' :footTab, | ||||||
| 			pitera | 			cartSlide | ||||||
| 		}, | 		}, | ||||||
| 		data() { | 		data() { | ||||||
| 			return { | 			return {  | ||||||
| 				statusHeight:uni.getSystemInfoSync().statusBarHeight, | 				 | ||||||
| 				originalNum:0,//当前输入框原值 |  | ||||||
| 				maxNum:99999,//最大可输入数量 |  | ||||||
| 				minNum:1,//最小可输入数量 |  | ||||||
| 				skuId:'', |  | ||||||
| 				listData: [], |  | ||||||
| 				page:1, |  | ||||||
| 				size:1000, |  | ||||||
| 				total:0, |  | ||||||
| 				delIds:'', //删除ids |  | ||||||
| 				noMore:false, //没有更多 |  | ||||||
| 				isLoading:true, |  | ||||||
| 				flag:true, |  | ||||||
| 				showDel:false, |  | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		onShow() { |  | ||||||
| 			uni.removeStorageSync('buyList'); |  | ||||||
| 			this.listData = []; |  | ||||||
| 			// 查询购物车列表 |  | ||||||
| 			this.getList(); |  | ||||||
| 		}, |  | ||||||
| 		onReachBottom() { | 		onReachBottom() { | ||||||
| 			if(!this.noMore){ | 			this.$refs.cart.getList(); | ||||||
| 				this.page++; |  | ||||||
| 				// 获取商品列表 |  | ||||||
| 				this.getList(); |  | ||||||
| 			} |  | ||||||
| 		}, | 		}, | ||||||
| 		computed: { | 		onLoad() { | ||||||
| 			// 获取宽度 |  | ||||||
| 			windowWidth() { |  | ||||||
| 				return uni.getSystemInfoSync().windowWidth; |  | ||||||
| 			}, |  | ||||||
| 			 | 			 | ||||||
| 			// 总价及合计 |  | ||||||
| 			allPrice() { |  | ||||||
| 				let allPrice = 0; |  | ||||||
| 				this.listData.forEach(item=>{ |  | ||||||
| 					if(item.ifcheck) { |  | ||||||
| 						allPrice += item.price*item.num; |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 				return this.$toolAll.tools.addXiaoShu(allPrice); |  | ||||||
| 				// return allPrice; |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			// 要删除的数量 |  | ||||||
| 			buyNum() { |  | ||||||
| 				let buyNum = 0; |  | ||||||
| 				this.listData.forEach(item=>{ |  | ||||||
| 					if(item.ifcheck) { |  | ||||||
| 						buyNum += 1; |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 				return buyNum; |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			// 全选 |  | ||||||
| 			allChoose() { |  | ||||||
| 				let ifAll = false; |  | ||||||
| 				if(this.listData.length) { |  | ||||||
| 					let temparr = this.listData.filter(item=>{return item.ifcheck==false}) |  | ||||||
| 						temparr.length==0 ? ifAll = true : ifAll = false; |  | ||||||
| 					let delTemparr = this.listData.filter(item=>{return item.ifcheck==true}) |  | ||||||
| 					let delArr = []; |  | ||||||
| 					delTemparr.forEach(item=>{ |  | ||||||
| 						delArr.push(item.id) |  | ||||||
| 					}) |  | ||||||
| 					// 删除购物车 |  | ||||||
| 					this.delIds = delArr.join(','); |  | ||||||
| 				} |  | ||||||
| 				return ifAll |  | ||||||
| 			}, |  | ||||||
| 		}, | 		}, | ||||||
| 		methods: { | 		methods: { | ||||||
| 			// 获取商品列表 |  | ||||||
| 			getList(){ |  | ||||||
| 				uni.showLoading(); |  | ||||||
| 				this.total = 0; |  | ||||||
| 				let params = { |  | ||||||
| 					page:this.page, |  | ||||||
| 					size:this.size |  | ||||||
| 				} |  | ||||||
| 				this.$requst.post('/api/order/shopping-cart',params).then(res=>{ |  | ||||||
| 					if(res.code==0){ |  | ||||||
| 						console.log(res,'购物车列表'); |  | ||||||
| 						this.total = res.data.total; |  | ||||||
| 						let cartArr = []; |  | ||||||
| 						res.data.list.forEach(item=>{ |  | ||||||
| 							let obj = { |  | ||||||
| 								id: item.id, |  | ||||||
| 								spuId:item.spu.id, |  | ||||||
| 								skuId:item.sku_id, |  | ||||||
| 								coding:item.sku.coding, |  | ||||||
| 								image: item.spu.spu_cover, |  | ||||||
| 								title: item.spu.spu_name, |  | ||||||
| 								content: item.spu.unit, |  | ||||||
| 								slide_x: 0, |  | ||||||
| 								price:item.spu.original_price, |  | ||||||
| 								num:item.num, |  | ||||||
| 								ifcheck:this.skuId==item.sku_id ? true : false, |  | ||||||
| 								ifExit:true, |  | ||||||
| 								ifShow:true, |  | ||||||
| 							} |  | ||||||
| 							cartArr.push(obj); |  | ||||||
| 						}) |  | ||||||
| 						this.listData = this.listData.concat(cartArr); |  | ||||||
| 						if(this.listData.length == this.total){ |  | ||||||
| 							this.noMore = true; |  | ||||||
| 						} |  | ||||||
| 					} |  | ||||||
| 					uni.hideLoading(); |  | ||||||
| 					this.isLoading = true; |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 			 | 			 | ||||||
| 			// 选中事件 |  | ||||||
| 			chooseEv(index) { |  | ||||||
| 				this.listData[index].ifcheck = !this.listData[index].ifcheck; |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			// 全选事件 |  | ||||||
| 			chooseAll(){ |  | ||||||
| 				let exit = this.listData.filter(item=>item.ifcheck==false); |  | ||||||
| 				if(exit.length){ |  | ||||||
| 					this.listData.forEach(item=>item.ifcheck = true); |  | ||||||
| 				} else { |  | ||||||
| 					this.listData.forEach(item=>{item.ifcheck = false}); |  | ||||||
| 				} |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			// 去购物、去结算、删除 |  | ||||||
| 			submitEv(){ |  | ||||||
| 				if(this.allPrice==0) { |  | ||||||
| 					// 去购物 |  | ||||||
| 					uni.reLaunch({ |  | ||||||
| 						url:`/pages/tabbar/cate/cate?index=0` |  | ||||||
| 					}) |  | ||||||
| 				} else { |  | ||||||
| 					// 去结算 |  | ||||||
| 					let buyList = []; |  | ||||||
| 					this.listData.forEach(item=>{ |  | ||||||
| 						if(item.ifcheck) { |  | ||||||
| 							let obj = { |  | ||||||
| 								sku_coding: item.coding, |  | ||||||
| 								num: item.num |  | ||||||
| 							} |  | ||||||
| 							buyList.push(obj); |  | ||||||
| 						} |  | ||||||
| 					}) |  | ||||||
| 					uni.setStorageSync('buyList',buyList); |  | ||||||
| 					uni.navigateTo({ |  | ||||||
| 						url:'/pagesB/settlement/settlement' |  | ||||||
| 					}) |  | ||||||
| 				} |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			// 数量加减事件 |  | ||||||
| 			addCutEv(index,num) { |  | ||||||
| 				if(this.listData[index].slide_x==0){ |  | ||||||
| 					if(num) { |  | ||||||
| 						// 加 ,如果当前商品数量不等于最大值 |  | ||||||
| 						if(this.listData[index].num != this.maxNum) { |  | ||||||
| 							this.listData[index].num++; |  | ||||||
| 						} |  | ||||||
| 					} else { |  | ||||||
| 						// 减 ,如果当前商品数量大于最小值 |  | ||||||
| 						if(this.listData[index].num > this.minNum) { |  | ||||||
| 							this.listData[index].num--; |  | ||||||
| 						}else{ |  | ||||||
| 							// 移除购物车 |  | ||||||
| 							uni.showModal({ |  | ||||||
| 								title: '提示', |  | ||||||
| 								content: '是否将该商品移除购物车?', |  | ||||||
| 								success: (res)=> { |  | ||||||
| 									if (res.confirm) { |  | ||||||
| 										this.delShopEv(this.listData[index].id); |  | ||||||
| 									} |  | ||||||
| 								} |  | ||||||
| 							}); |  | ||||||
| 						} |  | ||||||
| 					} |  | ||||||
| 					this.$requst.post('/api/order/shopping-cart-change-num',{id:this.listData[index].id,num:this.listData[index].num}).then(res=>{ |  | ||||||
| 						if(res.code!=0){ |  | ||||||
| 							this.$toolAll.tools.showToast(res.msg); |  | ||||||
| 						} |  | ||||||
| 					}) |  | ||||||
| 				} |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			// 删除商品 |  | ||||||
| 			delShopEv(id){ |  | ||||||
| 				this.$requst.post('/api/order/shopping-cart-del',{id:id}).then(res=>{ |  | ||||||
| 					if(res.code==0){ |  | ||||||
| 						this.listData = this.listData.filter(item => item.id !== id); |  | ||||||
| 						this.$toolAll.tools.showToast('删除成功'); |  | ||||||
| 						// this.getList(); |  | ||||||
| 					}else{ |  | ||||||
| 						this.$toolAll.tools.showToast(res.msg) |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			// 批量删除 |  | ||||||
| 			// delShopEv(){ |  | ||||||
| 			// 	if(this.delIds!==''){ |  | ||||||
| 			// 		uni.showModal({ |  | ||||||
| 			// 			title: '提示', |  | ||||||
| 			// 			content: '是否删除选中商品?', |  | ||||||
| 			// 			success: (res)=> { |  | ||||||
| 			// 				if (res.confirm) { |  | ||||||
| 			// 					// 确认删除 |  | ||||||
| 			// 					this.confirmDel(); |  | ||||||
| 			// 				} else if (res.cancel) { |  | ||||||
| 			// 					console.log('用户点击取消'); |  | ||||||
| 			// 				} |  | ||||||
| 			// 			} |  | ||||||
| 			// 		}); |  | ||||||
| 			// 	} |  | ||||||
| 			// }, |  | ||||||
| 			 |  | ||||||
| 			// 确认删除 |  | ||||||
| 			// confirmDel(){ |  | ||||||
| 			// 	this.$requst.post('/api/order/shopping-cart-del',{id:this.delIds.toString()}).then(res=>{ |  | ||||||
| 			// 		if(res.code==0){ |  | ||||||
| 			// 			this.listData = this.listData.filter(item=>item.ifcheck==false) |  | ||||||
| 			// 			this.$toolAll.tools.showToast('删除成功'); |  | ||||||
| 			// 		}else{ |  | ||||||
| 			// 			this.$toolAll.tools.showToast(res.msg) |  | ||||||
| 			// 		} |  | ||||||
| 			// 	}) |  | ||||||
| 			// }, |  | ||||||
| 			 |  | ||||||
| 			// 查看商品详情 |  | ||||||
| 			goDetail(id) { |  | ||||||
| 				uni.navigateTo({ |  | ||||||
| 					url:'/pagesB/shop-detail/shop-detail?id='+id |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			// 输入框获取焦点事件 |  | ||||||
| 			focusEv(num) { |  | ||||||
| 				// 储存当前商品的原始数值 |  | ||||||
| 				this.originalNum = num; |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			// 输入框失去焦点事件 |  | ||||||
| 			blurEv(index,e) { |  | ||||||
| 				// 失去焦点时,获取当前输入框里的数值 |  | ||||||
| 				let currentNum = e.detail.value*1; |  | ||||||
| 				// 如果当前输入框的值不等于0或空,并且当前输入框的值大于最大值,当前商品的数量 = 最大值, 否则为当前输入框输入的值 |  | ||||||
| 				this.listData[index].num = currentNum ? currentNum > this.maxNum ? this.maxNum : currentNum : this.originalNum; |  | ||||||
| 			}, |  | ||||||
| 		} | 		} | ||||||
| 	}; | 	} | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| <style scoped> | <style> | ||||||
| 	.cart-admin{ | 
 | ||||||
| 		box-sizing: border-box; |  | ||||||
| 		display: flex; |  | ||||||
| 		justify-content: space-between; |  | ||||||
| 		padding: 20rpx 30rpx; |  | ||||||
| 		font-size: 30rpx; |  | ||||||
| 		background-color: #FFFFFF; |  | ||||||
| 		border-bottom: 2rpx solid #eaeaea; |  | ||||||
| 		margin-top: 20rpx; |  | ||||||
| 		color: #666666; |  | ||||||
| 	} |  | ||||||
| 	.cart-admin>text{ |  | ||||||
| 		color: #000000; |  | ||||||
| 	} |  | ||||||
| 	.slide-item{ |  | ||||||
| 		margin-top: 25rpx; |  | ||||||
| 	} |  | ||||||
| 	.slide-item-li{ |  | ||||||
| 		box-sizing: border-box; |  | ||||||
| 		display: flex; |  | ||||||
| 		align-items: center; |  | ||||||
| 		padding: 20rpx 30rpx; |  | ||||||
| 		background-color: #FFFFFF; |  | ||||||
| 	} |  | ||||||
| 	.slide-item-li .radio>radio{ |  | ||||||
| 		transform: scale(.8); |  | ||||||
| 		margin-left: -6rpx; |  | ||||||
| 	} |  | ||||||
| 	.slide-item-li .shop-img{ |  | ||||||
| 		width: 230rpx; |  | ||||||
| 		height: 150rpx; |  | ||||||
| 		border-radius: 10rpx; |  | ||||||
| 		margin: 0 24rpx 0 6rpx; |  | ||||||
| 		overflow: hidden; |  | ||||||
| 	} |  | ||||||
| 	.slide-item-li .shop-img image{ |  | ||||||
| 		width: 230rpx; |  | ||||||
| 		min-height: 150rpx; |  | ||||||
| 	} |  | ||||||
| 	.slide-item-li .shop-txt{ |  | ||||||
| 		width: calc(100% - 300rpx); |  | ||||||
| 	} |  | ||||||
| 	.shop-txt-top{ |  | ||||||
| 		min-height: 100rpx; |  | ||||||
| 	} |  | ||||||
| 	.shop-txt-top .title{ |  | ||||||
| 		font-size: 30rpx; |  | ||||||
| 		line-height: 1.5; |  | ||||||
| 		color: #000000; |  | ||||||
| 		font-weight: bold; |  | ||||||
| 	} |  | ||||||
| 	.shop-txt-top .specs{ |  | ||||||
| 		font-size: 24rpx; |  | ||||||
| 		line-height: 1.5; |  | ||||||
| 		color: #8c8c9b; |  | ||||||
| 		margin: 3rpx; |  | ||||||
| 	} |  | ||||||
| 	.shop-txt-bottom{ |  | ||||||
| 		display: flex; |  | ||||||
| 		justify-content: space-between; |  | ||||||
| 		align-items: center; |  | ||||||
| 		width: 100%; |  | ||||||
| 		height: 50rpx; |  | ||||||
| 	} |  | ||||||
| 	.shop-txt-bottom .price{ |  | ||||||
| 		font-size: 30rpx; |  | ||||||
| 		line-height: 1.5; |  | ||||||
| 		color: #f81c1c; |  | ||||||
| 	} |  | ||||||
| 	.shop-txt-bottom .num{ |  | ||||||
| 		display: flex; |  | ||||||
| 		justify-content: space-between; |  | ||||||
| 		align-items: center; |  | ||||||
| 		width: 170rpx; |  | ||||||
| 		font-size: 24rpx; |  | ||||||
| 	} |  | ||||||
| 	.shop-txt-bottom .num>.count-btn{ |  | ||||||
| 		display: flex; |  | ||||||
| 		justify-content: center; |  | ||||||
| 		align-items: center; |  | ||||||
| 		font-size: 24rpx; |  | ||||||
| 		width: 40rpx; |  | ||||||
| 		height: 40rpx; |  | ||||||
| 		background-color: #000000; |  | ||||||
| 		color: #FFFFFF;  |  | ||||||
| 		border-radius: 10rpx; |  | ||||||
| 	} |  | ||||||
| 	.shop-txt-bottom .num>.input{ |  | ||||||
| 		box-sizing: border-box; |  | ||||||
| 		width: 78rpx; |  | ||||||
| 		height: 40rpx; |  | ||||||
| 		border: 2rpx solid #d3d3d3; |  | ||||||
| 		border-radius: 10rpx; |  | ||||||
| 		text-align: center; |  | ||||||
| 	} |  | ||||||
| 	.change-all{ |  | ||||||
| 		box-sizing: border-box; |  | ||||||
| 		display: flex; |  | ||||||
| 		justify-content: space-between; |  | ||||||
| 		align-items: center; |  | ||||||
| 		width: 100vw; |  | ||||||
| 		height: 130rpx; |  | ||||||
| 		padding: 0 30rpx; |  | ||||||
| 		position: fixed; |  | ||||||
| 		left: 0; |  | ||||||
| 		bottom: 0; |  | ||||||
| 		z-index: 99; |  | ||||||
| 		background-color: #FFFFFF; |  | ||||||
| 	} |  | ||||||
| 	.change-all .label{ |  | ||||||
| 		display: flex; |  | ||||||
| 		align-items: center; |  | ||||||
| 		font-size: 24rpx; |  | ||||||
| 	} |  | ||||||
| 	.all-price{ |  | ||||||
| 		display: flex; |  | ||||||
| 		align-items: center; |  | ||||||
| 	} |  | ||||||
| 	.all-price .price{ |  | ||||||
| 		font-size: 24rpx; |  | ||||||
| 		margin-right: 25rpx; |  | ||||||
| 		color: #000000; |  | ||||||
| 	} |  | ||||||
| 	.all-price .btn{ |  | ||||||
| 		line-height: 84rpx; |  | ||||||
| 		padding: 0 30rpx; |  | ||||||
| 		border-radius: 10rpx; |  | ||||||
| 		font-size: 32rpx; |  | ||||||
| 		color: #FFFFFF; |  | ||||||
| 	} |  | ||||||
| </style> | </style> | ||||||
|  |  | ||||||
|  | @ -1,49 +1,41 @@ | ||||||
| <template> | <template> | ||||||
| 	<view v-if="isLoding"> | 	<view> | ||||||
| 		<status-container :ifReturn="false" titlet="分类"> | 		<status-container :ifReturn="false" titlet="分类"> | ||||||
| 			<view slot="content" style="margin: -20rpx -20rpx 0 -20rpx;"> | 			<view slot="content" style="margin: -20rpx -20rpx 0 -20rpx;"> | ||||||
| 				<view class="dis"> | 				<view class="dis"> | ||||||
| 					<view class="cate-left-box"> | 					<view> | ||||||
| 						<scroll-view scroll-y :style="{height: scrollHeight +'px'}" class="bacf"> | 						<scroll-view scroll-y :style="{height: scrollHeight +'px'}" class="bacf"> | ||||||
| 							<view> | 							<view class="pad-x160"> | ||||||
| 								<view class="flexs clips1 pad-z20 fon24"  | 								<view class="flexs clips1 pad-z20 fon24"  | ||||||
| 								@tap="chooseCate(index)" :style="{backgroundColor: current==index ? '#ff3673' : '#FFFFFF',color: current==index ? '#FFFFFF' : '#000000'}"  | 								@tap="chooseCate(index)" :style="{backgroundColor: current==index ? '#ff3673' : '#FFFFFF',color: current==index ? '#FFFFFF' : '#000000'}"  | ||||||
| 								v-for="(item,index) in cateList" :key="index" style="min-width: 160rpx;height: 86rpx;line-height: 86rpx;box-sizing: border-box;" >{{item.title}}</view> | 								v-for="(item,index) in cateList" :key="index" style="min-width: 160rpx;height: 86rpx;line-height: 86rpx;box-sizing: border-box;" >{{item.title}}</view> | ||||||
| 							</view> | 							</view> | ||||||
| 						</scroll-view> | 						</scroll-view> | ||||||
| 					</view> | 					</view> | ||||||
| 					<view class="pad-zy20" style="width: 100%;position: relative;"> | 					<view class="pad-zy20"> | ||||||
| 						<view class="cate-title">{{cateList[current].title}}</view> | 						<view class="pad-sx20" :style="{width: newWidth+'px'}"> | ||||||
| 						<scroll-view :style="{height: scrollHeight +'px'}" style="padding-top: 60rpx;box-sizing: border-box;"  | 							<swiper-tab-jl :list="secendCateList" v-model="activeIndex" @changeEv="clickTab" itemColor="#FFFFFF"></swiper-tab-jl> | ||||||
| 							scroll-y="true"  | 						</view> | ||||||
| 							:scroll-into-view="doms" | 						<view class="disac bbt-d9 pad-sx30" @tap="goDetail(index)" v-for="(item,index) in dataList" :key="index"> | ||||||
| 							scroll-with-animation | 							<image class="radius30 flexs borbot-cc" :src="item.imgsrc" mode="aspectFill" style="width: 240rpx;height: 240rpx;"></image> | ||||||
| 							@scroll="scrolls" | 							<view class="width100 disjb fc mar-z20" style="height: 240rpx;"> | ||||||
| 							@scrolltolower="scrollBottomEv"> | 								<view class="fon30 colb clips2">{{item.title}}</view> | ||||||
| 							<view class="posir" :id="'product'+index" v-for="(item,index) in dataList" :key="index"> | 								<view class=""> | ||||||
| 								<view class="disac bbt-d9 pad-sx30" @tap="goDetail(item1.id)" v-for="(item1,index1) in item" :key="index1"> | 									<view class="fon36 textc mar-x36">¥{{$toolAll.tools.changeNum(item.price)}}</view> | ||||||
| 									<view class="cate-txt"> | 									<view @tap.stop="addCartEv(index)" class="colf disjcac fon24 radius30  cate-btn"> | ||||||
| 										<image class="radius30 flexs borbot-cc" :src="item1.imgsrc" mode="aspectFill" style="width: 240rpx;height: 240rpx;"></image> | 										<i class="icon icon-shop-cart mar-y10" style="font-size: 36rpx;"></i> | ||||||
| 										<view class="width100 disjb fc mar-z20" style="height: 240rpx;"> | 										立即选购 | ||||||
| 											<view class="fon30 colb clips2">{{item1.title}}</view> |  | ||||||
| 											<view class=""> |  | ||||||
| 												<view class="fon36 textc mar-x36">¥{{item1.price}}</view> |  | ||||||
| 												<view @tap.stop="addCartEv(item1.skuId)" class="colf disjcac fon24 radius30  cate-btn"> |  | ||||||
| 													<i class="icon icon-shop-cart mar-y10" style="font-size: 36rpx;"></i> |  | ||||||
| 													立即选购 |  | ||||||
| 												</view> |  | ||||||
| 											</view> |  | ||||||
| 										</view> |  | ||||||
| 									</view> | 									</view> | ||||||
| 								</view> | 								</view> | ||||||
| 							</view> | 							</view> | ||||||
| 						</scroll-view> | 						</view> | ||||||
|  | 						<view class="mar-s40"><pitera textStr="——到底啦——"></pitera></view> | ||||||
| 					</view> | 					</view> | ||||||
| 				</view> | 				</view> | ||||||
| 			</view> | 			</view> | ||||||
| 		</status-container> | 		</status-container> | ||||||
| 		<!-- 底部tab --> | 		<!-- 底部tab --> | ||||||
| 		<foot-tab current="1"></foot-tab> | 		<foot-tab current="1"></foot-tab>  | ||||||
| 	</view> | 	</view> | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
|  | @ -53,8 +45,6 @@ | ||||||
| 	import swiperTabJl from '@/components/swiper-tab/swiper-tab-jl.vue'; | 	import swiperTabJl from '@/components/swiper-tab/swiper-tab-jl.vue'; | ||||||
| 	// 底部组件 | 	// 底部组件 | ||||||
| 	import footTab from '@/components/foot-tabs/foot-tab.vue'; | 	import footTab from '@/components/foot-tabs/foot-tab.vue'; | ||||||
| 	import {getCartNum} from '@/jsFile/public-api.js'; |  | ||||||
| 	import { mapState } from 'vuex'//引入mapState |  | ||||||
| 	export default { | 	export default { | ||||||
| 		components:{ | 		components:{ | ||||||
| 			'foot-tab' :footTab, | 			'foot-tab' :footTab, | ||||||
|  | @ -66,193 +56,78 @@ | ||||||
| 			return { | 			return { | ||||||
| 				current:0, | 				current:0, | ||||||
| 				scrollHeight:uni.getSystemInfoSync().windowHeight - uni.getSystemInfoSync().statusBarHeight - 50, | 				scrollHeight:uni.getSystemInfoSync().windowHeight - uni.getSystemInfoSync().statusBarHeight - 50, | ||||||
| 				newWidth:uni.getSystemInfoSync().windowWidth, | 				newWidth:uni.getSystemInfoSync().windowWidth - 100, | ||||||
| 				cateList:[], //分类导航列表 | 				cateList:[ | ||||||
|  | 					{id:1,title:'推荐套装'}, | ||||||
|  | 					{id:1,title:'推荐套装'}, | ||||||
|  | 					{id:1,title:'推荐套装'}, | ||||||
|  | 					{id:1,title:'推荐套装'}, | ||||||
|  | 					{id:1,title:'推荐套装'}, | ||||||
|  | 					{id:1,title:'推荐套装'}, | ||||||
|  | 					{id:1,title:'推荐套装'}, | ||||||
|  | 					{id:1,title:'推荐套装'}, | ||||||
|  | 					{id:1,title:'推荐套装'}, | ||||||
|  | 					{id:1,title:'推荐套装'}, | ||||||
|  | 				], | ||||||
|  | 				secendCateList:[ | ||||||
|  | 					{title:'标题一'}, | ||||||
|  | 					{title:'标题二标题二'}, | ||||||
|  | 					{title:'标题三'}, | ||||||
|  | 					{title:'标题四'}, | ||||||
|  | 					{title:'标题五'}, | ||||||
|  | 					{title:'标题六标题六标题六'}, | ||||||
|  | 					{title:'标题七'}, | ||||||
|  | 					{title:'标题八'}, | ||||||
|  | 					{title:'标题九'}, | ||||||
|  | 				], | ||||||
| 				activeIndex:0, | 				activeIndex:0, | ||||||
| 				secendCateList:[], | 				dataList:[ | ||||||
| 				dataList:[], //商品列表 | 					{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题',price:199}, | ||||||
| 				total:0, | 					{imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', title:'标题标题标题标题标题标题标题',price:20000}, | ||||||
| 				flag:true, | 				], | ||||||
| 				ifLoading:false, | 				ifloading:false, | ||||||
| 				pid:'',//分类id | 				flag:true | ||||||
| 				doms:'', |  | ||||||
| 				topList:[], |  | ||||||
| 				heightData: 0, |  | ||||||
| 				scroll:true, |  | ||||||
| 				cateCurrent:0, |  | ||||||
| 				isLoding:false, |  | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		computed:{ |  | ||||||
| 			...mapState({ |  | ||||||
| 				footHeight: state => state.moduleA.footHeight, |  | ||||||
| 			}), |  | ||||||
| 		}, |  | ||||||
| 		onLoad(op) { | 		onLoad(op) { | ||||||
| 			this.scrollHeight = this.scrollHeight - this.footHeight; |  | ||||||
| 			if(op.index) { | 			if(op.index) { | ||||||
| 				this.cateCurrent = op.index; | 				this.current = op.index; | ||||||
| 			} |  | ||||||
| 			this.checkShopCate(); |  | ||||||
| 		}, |  | ||||||
| 		onShareAppMessage() { |  | ||||||
| 			return { |  | ||||||
| 				title:'喜兜兜-分类', |  | ||||||
| 				path:uni.getStorageSync('page-path-options'), |  | ||||||
| 				imageUrl:'/static/public/xdd-logo.png' |  | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		methods: { | 		methods: { | ||||||
| 			// 查询商品列表 | 			scrollBottomEv(e){ | ||||||
| 			checkShopList(){ | 				if(this.flag){ | ||||||
| 				uni.showLoading({ | 					this.flag = false; | ||||||
| 					title:'加载中' | 					this.ifloading = true; | ||||||
| 				}) | 					setTimeout(()=>{ | ||||||
| 				for(let i=0;i<this.cateList.length;i++){ | 						for (let i = 0; i < 2; i++) { | ||||||
| 					this.ifLoading = true; | 							let obj = { | ||||||
| 					let params = { | 								title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99 | ||||||
| 						page:1, |  | ||||||
| 						size:9999, |  | ||||||
| 						category_id:this.cateList[i].id |  | ||||||
| 					} |  | ||||||
| 					this.$requst.post('/api/spu/list',params).then(res=>{ |  | ||||||
| 						if(res.code==0) { |  | ||||||
| 							this.total = res.data.total; |  | ||||||
| 							let newArr = []; |  | ||||||
| 							res.data.list.forEach(item=>{ |  | ||||||
| 								let obj = { |  | ||||||
| 									id:item.id, |  | ||||||
| 									skuId:item.skuId, |  | ||||||
| 									imgsrc:item.cover,  |  | ||||||
| 									title:item.name, |  | ||||||
| 									price:item.price |  | ||||||
| 								} |  | ||||||
| 								newArr.push(obj); |  | ||||||
| 							}) |  | ||||||
| 							this.dataList[i] = newArr; |  | ||||||
| 							if(i == this.cateList.length-1){ |  | ||||||
| 								this.current = this.cateCurrent; |  | ||||||
| 								this.doms = 'product'+this.current; |  | ||||||
| 								setTimeout(()=>{ |  | ||||||
| 									const query = uni.createSelectorQuery().in(this); |  | ||||||
| 									query.select('.cate-title').boundingClientRect(data => { |  | ||||||
| 										this.heightData = data.height |  | ||||||
| 									}).exec(); |  | ||||||
| 								},200) |  | ||||||
| 								this.getNodesInfo(); |  | ||||||
| 								this.ifLoading = false; |  | ||||||
| 								uni.hideLoading(); |  | ||||||
| 								this.isLoding =true; |  | ||||||
| 							} | 							} | ||||||
|  | 							this.dataList[e].push(obj); | ||||||
| 						} | 						} | ||||||
| 					}) | 						this.ifloading = false; | ||||||
|  | 						this.flag = true; | ||||||
|  | 					},1000) | ||||||
|  | 					// 重新渲染组件 | ||||||
|  | 					this.$forceUpdate(); | ||||||
| 				} | 				} | ||||||
| 			}, | 			}, | ||||||
| 			 |  | ||||||
| 			// 查询左侧分类列表 |  | ||||||
| 			checkShopCate(){ |  | ||||||
| 				this.$requst.post('/api/spu/category',{hasChildren:1}).then(res=>{ |  | ||||||
| 					if(res.code==0) { |  | ||||||
| 						this.cateList = res.data; |  | ||||||
| 						setTimeout(()=>{ |  | ||||||
| 							// 获取元素宽 |  | ||||||
| 							const query = wx.createSelectorQuery().in(this) |  | ||||||
| 							query.select('.cate-left-box').boundingClientRect((rect) => { |  | ||||||
| 								this.newWidth = this.newWidth - rect.width - 20; |  | ||||||
| 							}).exec() |  | ||||||
| 						},200) |  | ||||||
| 						this.checkShopList(); |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			scrollBottomEv(){ |  | ||||||
| 				console.log('触底了'); |  | ||||||
| 				// setTimeout(()=>{ |  | ||||||
| 				// 	this.current =this.cateList.length - 1; |  | ||||||
| 				// },80) |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			// 一级分类选择 | 			// 一级分类选择 | ||||||
| 			chooseCate(index) { | 			chooseCate(index) { | ||||||
| 				if(this.scroll){ | 				this.current = index; | ||||||
| 					if(this.current !== index){ |  | ||||||
| 						this.scroll =false; |  | ||||||
| 						this.current =index |  | ||||||
| 						this.doms = 'product'+index |  | ||||||
| 					} |  | ||||||
| 					this.scroll = true; |  | ||||||
| 				} |  | ||||||
| 			}, | 			}, | ||||||
| 			 |  | ||||||
| 			// 滚动 |  | ||||||
| 			scrolls(e){ |  | ||||||
| 				this.scroll =false; |  | ||||||
| 				let scrollTop = e.target.scrollTop |  | ||||||
| 				for(let i =0;i<this.topList.length;i++){ |  | ||||||
| 					let h1 = this.topList[i]; |  | ||||||
| 					let h2 = this.topList[i+1]; |  | ||||||
| 					if(scrollTop>=h1&&scrollTop<h2-5){ |  | ||||||
| 						this.current = i |  | ||||||
| 					} |  | ||||||
| 				} |  | ||||||
| 				this.scroll =true; |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			// 改变topList |  | ||||||
| 			getNodesInfo(){ |  | ||||||
| 				setTimeout(()=>{ |  | ||||||
| 					const query = uni.createSelectorQuery().in(this); |  | ||||||
| 					query.selectAll('.posir').boundingClientRect().exec((res)=>{ |  | ||||||
| 						let nodes = res[0] |  | ||||||
| 						let rel =[]; |  | ||||||
| 						nodes.map(item=>{ |  | ||||||
| 							rel.push(item.top-uni.getSystemInfoSync().statusBarHeight-50-this.heightData) |  | ||||||
| 						}) |  | ||||||
| 						this.topList = rel |  | ||||||
| 						// console.log(this.topList,234) |  | ||||||
| 					}) |  | ||||||
| 				},200) |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			 |  | ||||||
| 			// 计算顶部距离 |  | ||||||
| 			setTop(){ |  | ||||||
| 				this.getElementData('#index-cate-bg', (res) => { |  | ||||||
| 					let el = res[0]; |  | ||||||
| 					this.scrollTop = el.top; |  | ||||||
| 					if(this.scrollTop==this.statusHeight+35){ |  | ||||||
| 						this.isShow = false; |  | ||||||
| 					}else{ |  | ||||||
| 						this.isShow = true; |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			// 获取DOM距离 |  | ||||||
| 			getElementData(el, callback) { |  | ||||||
| 				uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => { |  | ||||||
| 					callback(data[0]); |  | ||||||
| 				}); |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			// 跳转详情页 |  | ||||||
| 			goDetail(id) { | 			goDetail(id) { | ||||||
| 				uni.navigateTo({ | 				uni.navigateTo({ | ||||||
| 					url:'/pagesB/shop-detail/shop-detail?id='+id | 					url:'/pagesB/shop-detail/shop-detail' | ||||||
| 				}) | 				}) | ||||||
| 			}, | 			}, | ||||||
| 			 |  | ||||||
| 			// 加入购物车 |  | ||||||
| 			addCartEv(id) { | 			addCartEv(id) { | ||||||
| 				this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{ | 				this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)') | ||||||
| 					if(res.code==0) { | 			}, | ||||||
| 						this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)'); | 			// tab点击事件 | ||||||
| 						getCartNum(); | 			clickTab(index){ | ||||||
| 					} else { | 				this.activeIndex = index; | ||||||
| 						this.$toolAll.tools.showToast(res.msg) |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 			}, | 			}, | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | @ -260,9 +135,4 @@ | ||||||
| 
 | 
 | ||||||
| <style> | <style> | ||||||
| .cate-btn{background: linear-gradient(to right,#ff3772 0%,#fd5549 100%);width: 170rpx;height: 60rpx;box-shadow: 0rpx 6rpx 10rpx rgba(255, 55, 114, .3);} | .cate-btn{background: linear-gradient(to right,#ff3772 0%,#fd5549 100%);width: 170rpx;height: 60rpx;box-shadow: 0rpx 6rpx 10rpx rgba(255, 55, 114, .3);} | ||||||
| .disac {flex-wrap: wrap;} |  | ||||||
| .cate-txt{ |  | ||||||
| 	display: flex; |  | ||||||
| } |  | ||||||
| .cate-title{position: absolute;left:0; top:0; width: 100%; background-color: #fff; font-size: 24rpx;line-height: 60rpx;color: #666; z-index: 9;text-indent: 20rpx;} |  | ||||||
| </style> | </style> | ||||||
|  |  | ||||||
|  | @ -1,13 +1,13 @@ | ||||||
| <template> | <template> | ||||||
| 	<view class="pad-x180"> | 	<view class="pad-x180"> | ||||||
| 		<status-nav :ifReturn="false" titleColor="#FFFFFF" navBarTitle="个人中心" backgroudColor="#fe4b57"></status-nav> | 		<status-nav :ifReturn="false" titleColor="#FFFFFF" navBarTitle="个人中心" backgroudColor="transparent"></status-nav> | ||||||
| 		<view class="head-box" style="background: linear-gradient( to top, #ff3574 0%, #fe4b57 100%); padding: 0 0 20px; margin-top: -20rpx;"> | 		<view class="head-box" :style="{paddingTop: padt+'px'}" style="background: linear-gradient( to top, #ff3574 0%, #fd5646 100%);position: fixed;top: 0;left: 0;right: 0;z-index: 2;"> | ||||||
| 			<view class="mar-zy40 mar-s20 mar-x90 disac colf fon36"> | 			<view class="mar-zy40 mar-s20 mar-x90 disac colf fon36"> | ||||||
| 				<image :src="userImg" mode="aspectFill" style="width: 126rpx;height: 126rpx;border-radius: 100%;border: 6rpx solid #FFFFFF;"></image> | 				<image src="https://s6.jpg.cm/2022/02/14/L4oDhy.jpg" mode="aspectFill" style="width: 126rpx;height: 126rpx;border-radius: 100%;border: 6rpx solid #FFFFFF;"></image> | ||||||
| 				<view class="mar-z30">{{userName}}</view> | 				<view class="mar-z30">Anita Rose</view> | ||||||
| 			</view> | 			</view> | ||||||
| 		</view> | 		</view> | ||||||
| 		<view class="pad-zy40" style="position: relative;z-index: 3;"> | 		<view class="pad-zy40" :style="{paddingTop: headHeight+'px'}" style="position: relative;z-index: 3;"> | ||||||
| 			<view class="bacf radius20" style="margin-top: -80rpx;"> | 			<view class="bacf radius20" style="margin-top: -80rpx;"> | ||||||
| 				<view class="pad-zy30"> | 				<view class="pad-zy30"> | ||||||
| 					<column-function :ifLine="false" :list="list1" fonts="36" @chooseEv="chooseEv"></column-function> | 					<column-function :ifLine="false" :list="list1" fonts="36" @chooseEv="chooseEv"></column-function> | ||||||
|  | @ -21,16 +21,15 @@ | ||||||
| 			</view> | 			</view> | ||||||
| 		</view> | 		</view> | ||||||
| 		<!-- 添加微信 --> | 		<!-- 添加微信 --> | ||||||
| 		<view class="addwxpop" v-if="ifWx" :style="{top: padt+'px'}" @tap="ifWx=false"> | 		<view class="" v-if="ifWx" :style="{top: padt+'px'}" @tap="ifWx=false" style="position: fixed;right: 0;bottom: 0;left: 0;background-color: rgba(0, 0, 0, 0.86);z-index: 4;"> | ||||||
| 			<view class="pad-s80 pad-zy50"> | 			<view class="pad-s120 pad-zy50"> | ||||||
| 				<view class="bacf pad20 disjcac" style="width: 420rpx;height: 420rpx;margin: 0 auto;"> | 				<view class="bacf pad20 disjcac" style="width: 420rpx;height: 420rpx;margin: 0 auto;"> | ||||||
| 					<image :src="imgsrc" style="" mode="aspectFill"></image> | 					<image :src="imgsrc" style="width: 380rpx;height: 380rpx;" mode="aspectFill"></image> | ||||||
| 				</view> | 				</view> | ||||||
| 				<view class="colf line-h56 mar-sx30"> | 				<view class="colf line-h56 mar30"> | ||||||
| 					<!-- <view class="fon36">请扫描二维码添加微信告知您的订单号并支付定金 ,发货前请支付尾款。</view> | 					<view class="fon36">请扫描二维码添加微信告知您的订单号并支付定金 ,发货前请支付尾款。</view> | ||||||
| 					<view class="fon24 tcenter">(支付定金后,我们才会开始制作哦,如您有特别的要求可以在微信上提出哦!)</view> | 					<view class="fon24 tcenter">(支付定金后,我们才会开始制作哦,如您有特别的要求可以在微信上提出哦!)</view> | ||||||
| 					<view class="fon36 tcenter">祝您幸福美满!</view> --> | 					<view class="fon36 tcenter">祝您幸福美满!</view> | ||||||
| 					<rich-text :nodes="addwxcontent"></rich-text> |  | ||||||
| 				</view> | 				</view> | ||||||
| 				<view @tap.stop="saveImg" class="navigate-to-where radius30 colf fon36 tcenter mar-s50 bold mar-zy30">保存二维码</view> | 				<view @tap.stop="saveImg" class="navigate-to-where radius30 colf fon36 tcenter mar-s50 bold mar-zy30">保存二维码</view> | ||||||
| 			</view> | 			</view> | ||||||
|  | @ -60,10 +59,10 @@ | ||||||
| 				padt:uni.getSystemInfoSync().statusBarHeight + 50, | 				padt:uni.getSystemInfoSync().statusBarHeight + 50, | ||||||
| 				headHeight:'',//头部导航高 | 				headHeight:'',//头部导航高 | ||||||
| 				list:[ | 				list:[ | ||||||
| 					{url:'',iconsrc:'/static/public/icon-payment.png',iconWidth:50,iconHeight:44,title:'已下单',num:0}, | 					{url:'',iconsrc:'/static/public/icon-payment.png',iconWidth:50,iconHeight:44,title:'已下单'}, | ||||||
| 					{url:'',iconsrc:'/static/public/icon-send-goods.png',iconWidth:46,iconHeight:40,title:'制作中',num:0}, | 					{url:'',iconsrc:'/static/public/icon-send-goods.png',iconWidth:46,iconHeight:40,title:'制作中'}, | ||||||
| 					{url:'',iconsrc:'/static/public/icon-take.png',iconWidth:48,iconHeight:42,title:'已发货',num:0}, | 					{url:'',iconsrc:'/static/public/icon-take.png',iconWidth:48,iconHeight:42,title:'已发货'}, | ||||||
| 					{url:'',iconsrc:'/static/public/icon-finish.png',iconWidth:49,iconHeight:44,title:'已送达',num:0}, | 					{url:'',iconsrc:'/static/public/icon-finish.png',iconWidth:49,iconHeight:44,title:'已完成'}, | ||||||
| 				], | 				], | ||||||
| 				list1: [ | 				list1: [ | ||||||
| 					{url:'/pagesA/order-list/order-list',iconsrc:'',iconWidth:60,iconHeight:60,title:'我的订单',content:'全部订单',contentColor:'#999999',ifNext:true}, | 					{url:'/pagesA/order-list/order-list',iconsrc:'',iconWidth:60,iconHeight:60,title:'我的订单',content:'全部订单',contentColor:'#999999',ifNext:true}, | ||||||
|  | @ -75,10 +74,7 @@ | ||||||
| 					{url:'/pagesB/business-profile/business-profile',iconsrc:'/static/public/icon-aboutus.png',iconWidth:34,iconHeight:32,title:'商家简介',content:'',contentColor:'#999999',ifNext:true}, | 					{url:'/pagesB/business-profile/business-profile',iconsrc:'/static/public/icon-aboutus.png',iconWidth:34,iconHeight:32,title:'商家简介',content:'',contentColor:'#999999',ifNext:true}, | ||||||
| 				], | 				], | ||||||
| 				ifWx:false, | 				ifWx:false, | ||||||
| 				imgsrc:'', | 				imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg' | ||||||
| 				userImg:'', |  | ||||||
| 				userName:'', |  | ||||||
| 				addwxcontent:'' |  | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		onReachBottom() { | 		onReachBottom() { | ||||||
|  | @ -87,36 +83,14 @@ | ||||||
| 		onHide() { | 		onHide() { | ||||||
| 			this.ifWx = false; | 			this.ifWx = false; | ||||||
| 		}, | 		}, | ||||||
| 		onShow() { |  | ||||||
| 			this.getUserInfo(); |  | ||||||
| 		}, |  | ||||||
| 		onLoad() { | 		onLoad() { | ||||||
| 			// 缓存状态栏+标题栏的高度 | 			// 缓存状态栏+标题栏的高度 | ||||||
| 			const query = wx.createSelectorQuery().in(this) | 			const query = wx.createSelectorQuery().in(this) | ||||||
| 			query.select('.head-box').boundingClientRect((rect) => { | 			query.select('.head-box').boundingClientRect((rect) => { | ||||||
| 				this.headHeight = rect.height - this.padt; | 				this.headHeight = rect.height - this.padt; | ||||||
| 			}).exec(); | 			}).exec() | ||||||
| 			this.$requst.get('/api/index/add-wechat').then(res=>{ |  | ||||||
| 				if(res.code==0) { |  | ||||||
| 					this.addwxcontent = this.$toolAll.tools.escape2Html(res.data.content); |  | ||||||
| 					this.imgsrc = res.data.wechat; |  | ||||||
| 				} |  | ||||||
| 			}) |  | ||||||
| 		}, | 		}, | ||||||
| 		methods: { | 		methods: { | ||||||
| 			getUserInfo(){ |  | ||||||
| 				this.$requst.get('/api/user/info').then(res=>{ |  | ||||||
| 					console.log(res,'用户信息') |  | ||||||
| 					if(res.code==0) { |  | ||||||
| 						this.userImg = res.data.headimgurl; |  | ||||||
| 						this.userName = res.data.nickname; |  | ||||||
| 						this.list[0].num = res.data.order_count.order_placed; |  | ||||||
| 						this.list[1].num = res.data.order_count.makeing; |  | ||||||
| 						this.list[2].num = res.data.order_count.shipped; |  | ||||||
| 						this.list[3].num = res.data.order_count.arrived; |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 			chooseEv(obj) { | 			chooseEv(obj) { | ||||||
| 				if(obj.url) { | 				if(obj.url) { | ||||||
| 					uni.navigateTo({ | 					uni.navigateTo({ | ||||||
|  | @ -132,6 +106,7 @@ | ||||||
| 				uni.navigateTo({ | 				uni.navigateTo({ | ||||||
| 					url:`/pagesA/order-list/order-list?index=${[1,2,3,4][obj.index]}` | 					url:`/pagesA/order-list/order-list?index=${[1,2,3,4][obj.index]}` | ||||||
| 				}) | 				}) | ||||||
|  | 				console.log(obj); | ||||||
| 			}, | 			}, | ||||||
| 			// 保存二维码 | 			// 保存二维码 | ||||||
| 			saveImg(){ | 			saveImg(){ | ||||||
|  | @ -144,6 +119,4 @@ | ||||||
| <style> | <style> | ||||||
| 	page{background-color: #f7f7f7;} | 	page{background-color: #f7f7f7;} | ||||||
| 	.navigate-to-where {height: 98rpx;line-height: 98rpx;background: linear-gradient(to right, #ff3772 0%,#fd5548 100%);box-shadow: 0rpx 6rpx 10rpx rgba(255, 55, 114, .6);} | 	.navigate-to-where {height: 98rpx;line-height: 98rpx;background: linear-gradient(to right, #ff3772 0%,#fd5548 100%);box-shadow: 0rpx 6rpx 10rpx rgba(255, 55, 114, .6);} | ||||||
| 	.addwxpop{position: fixed;right: 0;bottom: 0;left: 0;background-color: rgba(0, 0, 0, 0.86);z-index: 4;overflow: hidden;overflow-y: scroll;padding-bottom: 180rpx;} |  | ||||||
| 	.addwxpop::-webkit-scrollbar{display: none;} |  | ||||||
| </style> | </style> | ||||||
|  |  | ||||||
|  | @ -1,24 +1,27 @@ | ||||||
| <template> | <template> | ||||||
| 	<view class="pad-x180"> | 	<view class="pad-x180"> | ||||||
| 		<status-nav :ifReturn="false" titleColor="#FFFFFF" navBarTitle="首页" backgroudColor="#fe4b57"></status-nav> | 		<status-nav :ifReturn="false" titleColor="#FFFFFF" navBarTitle="首页" backgroudColor="transparent"></status-nav> | ||||||
| 		<view class="head-box" style="background: linear-gradient( to top, #ff3574 0%, #fe4b57 100%); padding: 0 0 20px; margin-top: -20rpx;"> | 		<view class="head-box" :style="{paddingTop: padt+'px'}" style="background: linear-gradient( to top, #ff3574 0%, #fd5745 100%);position: fixed;top: 0;left: 0;right: 0;z-index: 2;"> | ||||||
| 			<view class=" mar-zy40 radius30 pad-zy30 disac" style="background-color: rgba(255, 255, 255, 0.2);"> | 			<view class=" mar-zy40 radius30 pad-zy30 mar-x30 disac" style="background-color: rgba(255, 255, 255, 0.2);"> | ||||||
| 				<image src="/static/public/icon-search.png" mode="widthFix" style="width: 40rpx;height: 40rpx;"></image> | 				<image src="/static/public/icon-search.png" mode="widthFix" style="width: 40rpx;height: 40rpx;"></image> | ||||||
| 				<input @confirm="goSearch" v-model="keyword" class="width100 colf fon30 mar-z20" type="text" placeholder="搜索" style="height: 90rpx;" placeholder-style="color: #FFFFFF"> | 				<input @confirm="goSearch" v-model="keyword" class="width100 colf fon30 mar-z20" type="text" placeholder="搜索" style="height: 90rpx;" placeholder-style="color: #FFFFFF"> | ||||||
| 			</view> | 			</view> | ||||||
| 		</view> | 		</view> | ||||||
| 		<view class="pad-zy20" :style="{paddingTop: 15+'px'}"> | 		<view class="pad-zy20" :style="{paddingTop: headHeight+'px'}"> | ||||||
| 			<!-- 轮播图 --> | 			<!-- 轮播图 --> | ||||||
| 			<swiper-pu newRadius="40rpx" :bannerList="bannerList" newHeight="400rpx" newBottom="20rpx" :isplay='isplay'></swiper-pu> | 			<swiper-pu newRadius="40rpx" newHeight="400rpx" newBottom="20rpx" :isplay='isplay'></swiper-pu> | ||||||
| 		</view> | 		</view> | ||||||
| 		<view class="pad-sx20"> | 		<view class="pad-sx20"> | ||||||
| 			<!-- 分类宫格 --> | 			<!-- 分类宫格 --> | ||||||
| 			<gong-ge-function itemTop="40rpx" @chooseGe="chooseGe" :list="geList"></gong-ge-function> | 			<gong-ge-function itemTop="40rpx" @chooseGe="chooseGe" :list="list"></gong-ge-function> | ||||||
| 		</view> | 		</view> | ||||||
| 		<view class="pad-zy20"> | 		<view class="pad-zy20"> | ||||||
| 			<list-one ref="listhome" :ifTitle="true"></list-one> | 			<list-one :ifTitle="true"></list-one> | ||||||
| 		</view> | 		</view> | ||||||
| 		<customer-one :nbottom="150"></customer-one> | 		<view class="mar-s60"> | ||||||
|  | 			<pitera textStr="——到底啦——"></pitera> | ||||||
|  | 		</view> | ||||||
|  | 		<customer-one></customer-one> | ||||||
| 		<!-- 底部tab --> | 		<!-- 底部tab --> | ||||||
| 		<foot-tab></foot-tab> | 		<foot-tab></foot-tab> | ||||||
| 	</view> | 	</view> | ||||||
|  | @ -30,9 +33,8 @@ | ||||||
| 	import footTab from '@/components/foot-tabs/foot-tab.vue'; | 	import footTab from '@/components/foot-tabs/foot-tab.vue'; | ||||||
| 	import gongGeFunction from '@/components/function-list/gong-ge/gong-ge-function.vue'; | 	import gongGeFunction from '@/components/function-list/gong-ge/gong-ge-function.vue'; | ||||||
| 	import listOne from '@/components/list/list-one'; | 	import listOne from '@/components/list/list-one'; | ||||||
|  | 	import pitera from '@/components/nothing/pitera'; | ||||||
| 	import customerOne from '@/components/customer/customer-one'; | 	import customerOne from '@/components/customer/customer-one'; | ||||||
| 	import {slidePosition} from '@/jsFile/public-api.js'; |  | ||||||
| 	import { mapState } from 'vuex'//引入mapState |  | ||||||
| 	export default { | 	export default { | ||||||
| 		components:{ | 		components:{ | ||||||
| 			'foot-tab' :footTab, | 			'foot-tab' :footTab, | ||||||
|  | @ -40,6 +42,7 @@ | ||||||
| 			statusNav, | 			statusNav, | ||||||
| 			swiperPu, | 			swiperPu, | ||||||
| 			listOne, | 			listOne, | ||||||
|  | 			pitera, | ||||||
| 			customerOne | 			customerOne | ||||||
| 		}, | 		}, | ||||||
| 		data() { | 		data() { | ||||||
|  | @ -47,54 +50,34 @@ | ||||||
| 				padt:uni.getSystemInfoSync().statusBarHeight + 50, | 				padt:uni.getSystemInfoSync().statusBarHeight + 50, | ||||||
| 				headHeight:'',//头部导航高 | 				headHeight:'',//头部导航高 | ||||||
| 				list:[ | 				list:[ | ||||||
| 					{url:'/pages/tabbar/cate/cate?index=0',iconsrc:'/static/deleteImg/icon-ge-01.png',iconWidth:48,iconHeight:50,title:'推荐套装'}, | 					{url:'/pages/tabbar/cate/cate?index=0',iconsrc:'/static/deleteImg/icon-ge-01.png',iconWidth:60,iconHeight:60,title:'推荐套装'}, | ||||||
| 					{url:'/pages/tabbar/cate/cate?index=1',iconsrc:'/static/deleteImg/icon-ge-02.png',iconWidth:56,iconHeight:54,title:'喜糖组合'}, | 					{url:'/pages/tabbar/cate/cate?index=1',iconsrc:'/static/deleteImg/icon-ge-02.png',iconWidth:60,iconHeight:60,title:'喜糖组合'}, | ||||||
| 					{url:'/pages/tabbar/cate/cate?index=2',iconsrc:'/static/deleteImg/icon-ge-03.png',iconWidth:64,iconHeight:46,title:'喜盒自选'}, | 					{url:'/pages/tabbar/cate/cate?index=2',iconsrc:'/static/deleteImg/icon-ge-03.png',iconWidth:60,iconHeight:60,title:'喜盒自选'}, | ||||||
| 					{url:'/pages/tabbar/cate/cate?index=3',iconsrc:'/static/deleteImg/icon-ge-04.png',iconWidth:48,iconHeight:48,title:'喜糖自选'}, | 					{url:'/pages/tabbar/cate/cate?index=3',iconsrc:'/static/deleteImg/icon-ge-04.png',iconWidth:60,iconHeight:60,title:'喜糖自选'}, | ||||||
| 					{url:'/pages/tabbar/cate/cate?index=4',iconsrc:'/static/deleteImg/icon-ge-05.png',iconWidth:56,iconHeight:58,title:'迎宾糖散糖'}, | 					{url:'/pages/tabbar/cate/cate?index=4',iconsrc:'/static/deleteImg/icon-ge-05.png',iconWidth:60,iconHeight:60,title:'迎宾糖散糖'}, | ||||||
| 					{url:'/pages/tabbar/cate/cate?index=5',iconsrc:'/static/deleteImg/icon-ge-06.png',iconWidth:58,iconHeight:52,title:'瓜子花生'}, | 					{url:'/pages/tabbar/cate/cate?index=5',iconsrc:'/static/deleteImg/icon-ge-06.png',iconWidth:60,iconHeight:60,title:'瓜子花生'}, | ||||||
| 					{url:'/pages/tabbar/cate/cate?index=6',iconsrc:'/static/deleteImg/icon-ge-07.png',iconWidth:48,iconHeight:54,title:'伴手礼'}, | 					{url:'/pages/tabbar/cate/cate?index=6',iconsrc:'/static/deleteImg/icon-ge-07.png',iconWidth:60,iconHeight:60,title:'伴手礼'}, | ||||||
| 					{url:'/pagesB/buy-read/buy-read',iconsrc:'/static/deleteImg/icon-ge-08.png',iconWidth:44,iconHeight:56,title:'购买须知'}, | 					{url:'/pagesB/buy-read/buy-read',iconsrc:'/static/deleteImg/icon-ge-08.png',iconWidth:60,iconHeight:60,title:'购买须知'}, | ||||||
| 					{url:'/pagesB/business-profile/business-profile',iconsrc:'/static/deleteImg/icon-ge-09.png',iconWidth:54,iconHeight:50,title:'商家简介'}, | 					{url:'/pagesB/business-profile/business-profile',iconsrc:'/static/deleteImg/icon-ge-09.png',iconWidth:60,iconHeight:60,title:'商家简介'}, | ||||||
| 					{url:'/pages/tabbar/cate/cate?index=0',iconsrc:'/static/deleteImg/icon-ge-10.png',iconWidth:52,iconHeight:52,title:'其他推荐'}, | 					{url:'/pages/tabbar/cate/cate?index=0',iconsrc:'/static/deleteImg/icon-ge-10.png',iconWidth:60,iconHeight:60,title:'其他推荐'}, | ||||||
| 				], | 				], | ||||||
| 				keyword:'', | 				keyword:'', | ||||||
| 				isplay:false, | 				isplay:false, | ||||||
| 				playTimer:null, | 				playTimer:null | ||||||
| 				bannerList:[] |  | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		computed:{ | 		onReachBottom() { | ||||||
| 			...mapState({ | 			 | ||||||
| 				geList: state => state.moduleA.geList, |  | ||||||
| 			}), |  | ||||||
| 		}, |  | ||||||
| 		onShareAppMessage() { |  | ||||||
| 			return { |  | ||||||
| 				title:'喜兜兜', |  | ||||||
| 				path:uni.getStorageSync('page-path-options'), |  | ||||||
| 				imageUrl:'/static/public/xdd-logo.png' |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 		onReachBottom(e) { |  | ||||||
| 			this.$refs.listhome.moreEv(); |  | ||||||
| 		}, | 		}, | ||||||
| 		onHide() { | 		onHide() { | ||||||
| 			clearTimeout(this.playTimer); | 			clearTimeout(this.playTimer); | ||||||
| 			this.isplay = false; |  | ||||||
| 		}, | 		}, | ||||||
| 		onShow() { | 		onShow() { | ||||||
| 			slidePosition().then(res=>{ |  | ||||||
| 				if(res.code==0) { |  | ||||||
| 					console.log(res.data,74); |  | ||||||
| 				} |  | ||||||
| 			}) |  | ||||||
| 			this.playTimer = setTimeout(()=>{ | 			this.playTimer = setTimeout(()=>{ | ||||||
| 				this.isplay = true; | 				this.isplay = true; | ||||||
| 			},2000) | 			},2000) | ||||||
| 		}, | 		}, | ||||||
| 		onLoad() { | 		onLoad() { | ||||||
| 			this.getBanner(); |  | ||||||
| 			// 缓存状态栏+标题栏的高度 | 			// 缓存状态栏+标题栏的高度 | ||||||
| 			const query = wx.createSelectorQuery().in(this) | 			const query = wx.createSelectorQuery().in(this) | ||||||
| 			query.select('.head-box').boundingClientRect((rect) => { | 			query.select('.head-box').boundingClientRect((rect) => { | ||||||
|  | @ -102,25 +85,6 @@ | ||||||
| 			}).exec() | 			}).exec() | ||||||
| 		}, | 		}, | ||||||
| 		methods: { | 		methods: { | ||||||
| 			// 获取轮播图事件 |  | ||||||
| 			getBanner(){ |  | ||||||
| 				this.$requst.get('/api/common/slides',{position:'home-banner'}).then(res=>{ |  | ||||||
| 					if(res.data.length!=0){ |  | ||||||
| 						res.data.forEach(item=>{ |  | ||||||
| 							let isVideo = false |  | ||||||
| 							if(item.type!='img') isVideo = true |  | ||||||
| 							let banObj = { |  | ||||||
| 								imgSrc:item.src, |  | ||||||
| 								url:item.url, |  | ||||||
| 								isVideo:isVideo, |  | ||||||
| 								poster:item.src, |  | ||||||
| 							} |  | ||||||
| 							this.bannerList.push(banObj) |  | ||||||
| 						}) |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 			// 宫格点击事件 |  | ||||||
| 			chooseGe(obj) { | 			chooseGe(obj) { | ||||||
| 				let exist = obj.url.slice(0,18); | 				let exist = obj.url.slice(0,18); | ||||||
| 				if(exist=='/pages/tabbar/cate') { | 				if(exist=='/pages/tabbar/cate') { | ||||||
|  | @ -133,12 +97,11 @@ | ||||||
| 					}) | 					}) | ||||||
| 				} | 				} | ||||||
| 			}, | 			}, | ||||||
| 			// 去搜索页面 |  | ||||||
| 			goSearch(){ | 			goSearch(){ | ||||||
| 				uni.navigateTo({ | 				uni.navigateTo({ | ||||||
| 					url:`/pagesB/search/search?keyword=${this.keyword}` | 					url:`/pagesB/search/search?keyword=${this.keyword}` | ||||||
| 				}) | 				}) | ||||||
| 			}, | 			} | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|  | @ -2,47 +2,8 @@ | ||||||
| 	<view> | 	<view> | ||||||
| 		<status-container titlet="订单管理" :ifCustomer='false'> | 		<status-container titlet="订单管理" :ifCustomer='false'> | ||||||
| 			<view slot="content" style="margin: -20rpx -20rpx 0 -20rpx;"> | 			<view slot="content" style="margin: -20rpx -20rpx 0 -20rpx;"> | ||||||
| 				<view class="bacf posir"> | 				<view class="bacf"> | ||||||
| 					<view class="posi-sticky pad-x20 pad-zy20" :style="{top: newTop +'px'}"> | 					<swiperTabSlide @scrollBottom="scrollBottomEv" :list="dataList" :ifloading="ifloading" :tagList="tagList" :tagIndex="tagIndex"></swiperTabSlide> | ||||||
| 						<!-- <scrollTextSlide @changeEv="tabTap" :list="tagList" :activeIndex="activeIndex"></scrollTextSlide> --> |  | ||||||
| 						<swiper-tab-jl :list="tagList" v-model="activeIndex" @changeEv="tabTap" itemColor="#FFFFFF"></swiper-tab-jl> |  | ||||||
| 					</view> |  | ||||||
| 					<swiper :style="{height: swiperHeight + 'px'}" class="fon30" style="background-color: #f4f4f4;" :current="activeIndex" @change="swiperChange"> |  | ||||||
| 						<swiper-item v-for="(item,index) in dataList" :key="index" class="pad-sx30"> |  | ||||||
| 							<scroll-view scroll-y @scrolltolower="scrollBottomEv" style="height: 100%;"> |  | ||||||
| 								<!-- 列表数据 --> |  | ||||||
| 								<view class="radius20 bacf pad-zy30 mar-x25 mar-zy40" @tap="goDetail(item1.id)" v-for="(item1,index1) in dataList[index]" :key="index1"> |  | ||||||
| 									<view class="disjbac bbot pad30" style="margin: 0 -30rpx;"> |  | ||||||
| 										<view class="">订单号:{{item1.coding}}</view> |  | ||||||
| 										<view class="" :style="{color: ['#f83030','#f83030','#f83030','#a0a0a0','#a0a0a0'][0]}">{{item1.status_text}}</view> |  | ||||||
| 									</view> |  | ||||||
| 									<view class="disjb borbot pad-sx30" v-for="(item2,index2) in item1.skus" :key="index2"> |  | ||||||
| 										<image class="mar-y30 flexs radius40" :src="item2.spu_cover" mode="" style="width: 210rpx;height: 210rpx;"></image> |  | ||||||
| 										<view class="width100 disjb fc" style="height: 210rpx;"> |  | ||||||
| 											<view class="clips2 fon24">{{item2.spu_name}}</view> |  | ||||||
| 											<view class=""> |  | ||||||
| 												<view class="fon24 mar-x30" style="color: #8c8c9b;">单位:{{item2.sku_unit}}</view> |  | ||||||
| 												<view class="disjbac "> |  | ||||||
| 													<view class="textc bold">¥{{item2.price}}</view> |  | ||||||
| 													<view class="fon24" style="color: #8c8c9b;">x{{item2.num}}</view> |  | ||||||
| 												</view> |  | ||||||
| 											</view> |  | ||||||
| 										</view> |  | ||||||
| 									</view> |  | ||||||
| 									<view class="disjbac tbot pad30" style="margin: 0 -30rpx;"> |  | ||||||
| 										<view class="bold" style="color: #f83030;">合计:¥{{item1.original_price}}</view> |  | ||||||
| 										<view class="btn" @tap.stop="cancleEv(item1.coding)" v-if="item1.status == 'order_placed'">取消订单</view> |  | ||||||
| 										<view class="btn csbtn" @tap.stop="buyEv(index1)" v-if="item1.status == 'completed' || item1.status == 'cancel'">再次购买</view> |  | ||||||
| 										<!-- <view class="btn csbtn" @tap.stop="affirmEv(item1.id)" v-if="item1.status == 'shipped' || item1.status == 'arrived'">确认收货</view> --> |  | ||||||
| 									</view> |  | ||||||
| 								</view> |  | ||||||
| 								<view class="pad-x40" v-if="total==totalAll"><pitera textStr="—— 到底啦 ——"></pitera></view> |  | ||||||
| 							</scroll-view> |  | ||||||
| 						</swiper-item> |  | ||||||
| 					</swiper> |  | ||||||
| 					<view class="loading-box" v-show="ifLoading" style="position: absolute;bottom: 20rpx; left: 50%;transform: translateX(-50%);"> |  | ||||||
| 					    <view class="loader-16"></view> |  | ||||||
| 					</view> |  | ||||||
| 				</view> | 				</view> | ||||||
| 			</view> | 			</view> | ||||||
| 		</status-container> | 		</status-container> | ||||||
|  | @ -50,175 +11,89 @@ | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
|  | 	import swiperTabSlide from '@/components/swiper-tab/swiper-tab-slide.vue'; | ||||||
| 	// 底部组件 | 	// 底部组件 | ||||||
| 	import footTab from '@/components/foot-tabs/foot-tab.vue'; | 	import footTab from '@/components/foot-tabs/foot-tab.vue'; | ||||||
| 	import swiperTabJl from '@/components/swiper-tab/swiper-tab-jl.vue'; |  | ||||||
| 	import pitera from '@/components/nothing/pitera'; |  | ||||||
| 	export default { | 	export default { | ||||||
| 		components:{ | 		components:{ | ||||||
| 			'foot-tab' :footTab, | 			'foot-tab' :footTab, | ||||||
| 			swiperTabJl, | 			swiperTabSlide | ||||||
| 			pitera |  | ||||||
| 		}, | 		}, | ||||||
| 		data() { | 		data() { | ||||||
| 			return { | 			return { | ||||||
| 				tagList:[ | 				tagList:[ | ||||||
| 					{title:'全部',tag:'all'}, | 					{title:'全部'}, | ||||||
| 					{title:'已下单',tag:'order_placed'}, | 					{title:'已下单'}, | ||||||
| 					{title:'制作中',tag:'makeing'}, | 					{title:'制作中'}, | ||||||
| 					{title:'已发货',tag:'shipped'}, | 					{title:'已发货'}, | ||||||
| 					{title:'已送达',tag:'arrived'}, | 					{title:'已完成'}, | ||||||
| 					{title:'已取消',tag:'cancel'}, | 					{title:'已取消'}, | ||||||
| 				], | 				], | ||||||
| 				activeIndex:0, | 				tagIndex:0, | ||||||
| 				dataList:[[],[],[],[],[],[]], | 				dataList:[ | ||||||
| 				flag:true, | 						[ | ||||||
| 				swiperHeight:uni.getSystemInfoSync().windowHeight, | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
| 				newTop:uni.getSystemInfoSync().statusBarHeight + 50, | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
| 				ifLoading:false, | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
| 				total:0, | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
| 				totalAll:0, | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
| 				page: 1, | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
| 				size: 10, | 						], | ||||||
| 				tag: 'all' | 						[ | ||||||
|  | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
|  | 						], | ||||||
|  | 						[ | ||||||
|  | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
|  | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
|  | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
|  | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
|  | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
|  | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
|  | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
|  | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
|  | 						], | ||||||
|  | 						[ | ||||||
|  | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
|  | 						], | ||||||
|  | 						[ | ||||||
|  | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
|  | 						], | ||||||
|  | 						[ | ||||||
|  | 							{title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99}, | ||||||
|  | 						], | ||||||
|  | 					], | ||||||
|  | 					ifloading:false, | ||||||
|  | 					flag:true | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		onLoad(op) { | 		onLoad(op) { | ||||||
| 			const query = wx.createSelectorQuery().in(this) |  | ||||||
| 			query.select('.posi-sticky').boundingClientRect((rect) => { |  | ||||||
| 				this.swiperHeight = this.swiperHeight - this.newTop - rect.height; |  | ||||||
| 			}).exec() |  | ||||||
| 			if(op.index) { | 			if(op.index) { | ||||||
| 				this.activeIndex = op.index; | 				this.tagIndex = op.index; | ||||||
| 			} | 			} | ||||||
| 			this.getOrderList(); |  | ||||||
| 		}, | 		}, | ||||||
| 		methods: { | 		methods: { | ||||||
| 			tabTap(e) { | 			scrollBottomEv(e){ | ||||||
| 				this.activeIndex = e; | 				if(this.flag){ | ||||||
| 				this.page = 1; | 					this.flag = false; | ||||||
| 				this.dataList = [[],[],[],[],[],[]]; | 					this.ifloading = true; | ||||||
| 				this.getOrderList(); | 					setTimeout(()=>{ | ||||||
| 			}, | 						for (let i = 0; i < 2; i++) { | ||||||
| 			swiperChange(e) { | 							let obj = { | ||||||
| 				this.activeIndex = e.detail.current; | 								title:'标题',content:'描述描述描述描述描述描述描述描述描述描述描述描述',price:199,xiaol:99 | ||||||
| 			}, |  | ||||||
| 			scrollBottomEv(e) { |  | ||||||
| 				console.log('到底了...') |  | ||||||
| 				this.ifLoading = true; |  | ||||||
| 				let pageSize = Math.floor(this.totalAll/this.size) |  | ||||||
| 				if(this.page <= pageSize){ |  | ||||||
| 					this.page++; |  | ||||||
| 					this.getOrderList(); |  | ||||||
| 				}else{ |  | ||||||
| 					this.ifLoading = false; |  | ||||||
| 					return false; |  | ||||||
| 				} |  | ||||||
| 				setTimeout(()=>{ |  | ||||||
| 					this.ifLoading = false; |  | ||||||
| 				},2000) |  | ||||||
| 			}, |  | ||||||
| 			// 获取订单列表 |  | ||||||
| 			getOrderList(){ |  | ||||||
| 				let params = { |  | ||||||
| 					page: this.page, |  | ||||||
| 					size: this.size, |  | ||||||
| 					tag: this.tagList[this.activeIndex].tag |  | ||||||
| 				} |  | ||||||
| 				this.$requst.get('/api/user/order',params).then(res=>{ |  | ||||||
| 					if(res.data.length!=0){ |  | ||||||
| 						this.totalAll = res.data.total; |  | ||||||
| 						res.data.list.forEach(item=>{ |  | ||||||
| 							let dataObj = { |  | ||||||
| 								id: item.id, //id |  | ||||||
| 								coding: item.coding, //订单号 |  | ||||||
| 								original_price: item.original_price, //总价 |  | ||||||
| 								status: item.status, //订单状态英文 |  | ||||||
| 								status_text: item.status_text, //订单状态中文 |  | ||||||
| 								skus: item.skus //订单详情 |  | ||||||
| 							} | 							} | ||||||
| 							this.dataList[this.activeIndex].push(dataObj) | 							this.dataList[e].push(obj); | ||||||
| 						}) |  | ||||||
| 						console.log(this.dataList[this.activeIndex],'订单列表') |  | ||||||
| 						if(this.page == Math.floor(this.totalAll/this.size)+1){ |  | ||||||
| 							this.total = this.totalAll; |  | ||||||
| 						} | 						} | ||||||
| 					} | 						this.ifloading = false; | ||||||
| 				}) | 						this.flag = true; | ||||||
| 			}, | 					},1000) | ||||||
| 			// 去详情 | 					// 重新渲染组件 | ||||||
| 			goDetail(id){ | 					this.$forceUpdate(); | ||||||
| 				uni.navigateTo({ |  | ||||||
| 					url:'/pagesB/order-detail/order-detail?id='+id |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 			// 取消订单 |  | ||||||
| 			cancleEv(coding){ |  | ||||||
| 				let params = { |  | ||||||
| 					order_coding: coding //订单号 |  | ||||||
| 				} | 				} | ||||||
| 				this.$requst.post('/api/order/cancel',params).then(res=>{ |  | ||||||
| 					if(res.code==0) { |  | ||||||
| 						this.$toolAll.tools.showToast('取消订单成功(*^▽^*)'); |  | ||||||
| 						this.dataList = [[],[],[],[],[],[]]; |  | ||||||
| 						this.page = 1; |  | ||||||
| 						this.getOrderList(); |  | ||||||
| 					} else { |  | ||||||
| 						this.$toolAll.tools.showToast(res.msg) |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 			// 确认收货 |  | ||||||
| 			affirmEv(id){ |  | ||||||
| 				let params = { |  | ||||||
| 					order_id: id //订单号 |  | ||||||
| 				} |  | ||||||
| 				this.$requst.post('/api/order/accepted',params).then(res=>{ |  | ||||||
| 					if(res.code==0) { |  | ||||||
| 						this.$toolAll.tools.showToast('确认收货成功(*^▽^*)'); |  | ||||||
| 						this.dataList = [[],[],[],[],[],[]]; |  | ||||||
| 						this.page = 1; |  | ||||||
| 						this.getOrderList(); |  | ||||||
| 					} else { |  | ||||||
| 						this.$toolAll.tools.showToast(res.msg) |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 			// 再次购买 |  | ||||||
| 			buyEv(index){ |  | ||||||
| 				let buyList = []; |  | ||||||
| 				let newArr = this.dataList[this.activeIndex][index]; |  | ||||||
| 				newArr.skus.forEach(item=>{ |  | ||||||
| 					let obj = { |  | ||||||
| 						sku_coding: item.coding, |  | ||||||
| 						num: item.num |  | ||||||
| 					} |  | ||||||
| 					buyList.push(obj); |  | ||||||
| 				}) |  | ||||||
| 				uni.setStorageSync('buyList',buyList); |  | ||||||
| 				uni.navigateTo({ |  | ||||||
| 					url:'/pagesB/settlement/settlement' |  | ||||||
| 				}) |  | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| <style> | <style> | ||||||
| .btn{ | 
 | ||||||
| 	width: 150rpx; |  | ||||||
| 	height: 64rpx; |  | ||||||
| 	line-height: 64rpx; |  | ||||||
| 	color: #8c8c9b; |  | ||||||
| 	border: 2rpx solid #d3d3d3; |  | ||||||
| 	border-radius: 20rpx; |  | ||||||
| 	text-align: center; |  | ||||||
| 	box-sizing: border-box; |  | ||||||
| } |  | ||||||
| .csbtn{ |  | ||||||
| 	border: none; |  | ||||||
| 	background: linear-gradient(to right,#ff3772 0%,#fd5549 100%); |  | ||||||
| 	color: #FFFFFF; |  | ||||||
| 	box-shadow: 0rpx 6rpx 10rpx rgba(255, 55, 114, .3); |  | ||||||
| } |  | ||||||
| </style> | </style> | ||||||
|  |  | ||||||
|  | @ -0,0 +1,75 @@ | ||||||
|  | <template> | ||||||
|  | 	<view> | ||||||
|  | 		<status-container titlet="购物车"> | ||||||
|  | 			<view slot="content"> | ||||||
|  | 				<cart-slide :list="list" :button="buttonList" :border="true" @click="clickMethod" @change="changeMethod"></cart-slide> | ||||||
|  | 			</view> | ||||||
|  | 		</status-container> | ||||||
|  | 	</view> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  | 	import cartSlide from '@/components/shopping-carts/cart-slide';  | ||||||
|  | 	export default { | ||||||
|  | 		components:{ | ||||||
|  | 			cartSlide | ||||||
|  | 		}, | ||||||
|  | 		data() { | ||||||
|  | 			return { | ||||||
|  | 				list : [ | ||||||
|  | 					{ | ||||||
|  | 						id: 1, | ||||||
|  | 						image: 'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', | ||||||
|  | 						title: '张三', | ||||||
|  | 						rightDetail: '2019-03-18', | ||||||
|  | 						detail: 'XXXXXXXXXXXXXXXXXXX公司', | ||||||
|  | 						slide_x: 0 | ||||||
|  | 					}, | ||||||
|  | 					{ | ||||||
|  | 						id: 2, | ||||||
|  | 						surname: '李', | ||||||
|  | 						title: '李二', | ||||||
|  | 						rightDetail: '2019-03-17', | ||||||
|  | 						detail: 'XXXXXXXXXXXXXXXXXXX公司', | ||||||
|  | 						slide_x: 0 | ||||||
|  | 					}, | ||||||
|  | 					{ | ||||||
|  | 						id: 3, | ||||||
|  | 						title: '王五', | ||||||
|  | 						rightDetail: '2019-03-18', | ||||||
|  | 						slide_x: 0 | ||||||
|  | 					}, | ||||||
|  | 					{ | ||||||
|  | 						id: 4, | ||||||
|  | 						surname: '李', | ||||||
|  | 						detail: 'XXXXXXXXXXXXXXXXXXX公司', | ||||||
|  | 						slide_x: 0 | ||||||
|  | 					} | ||||||
|  | 				], | ||||||
|  | 				buttonList: [ | ||||||
|  | 					{ | ||||||
|  | 						title: '分享', | ||||||
|  | 						background: '#c4c7cd' | ||||||
|  | 					}, | ||||||
|  | 					{ | ||||||
|  | 						title: '删除', | ||||||
|  | 						background: '#ff3b32' | ||||||
|  | 					} | ||||||
|  | 				] | ||||||
|  | 			} | ||||||
|  | 		}, | ||||||
|  | 		methods: { | ||||||
|  | 			changeMethod(data, button, index){ | ||||||
|  | 				console.log('滑动按钮回调', data) | ||||||
|  | 				console.log('滑动按钮回调', button) | ||||||
|  | 			}, | ||||||
|  | 			clickMethod(data){ | ||||||
|  | 				console.log('点击行回调', data) | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <style> | ||||||
|  | 
 | ||||||
|  | </style> | ||||||
|  | @ -3,8 +3,8 @@ | ||||||
| 		<status-container titlet="关于我们" :ifCustomer='false'> | 		<status-container titlet="关于我们" :ifCustomer='false'> | ||||||
| 			<view slot="content"> | 			<view slot="content"> | ||||||
| 				<view class="pad20"> | 				<view class="pad20"> | ||||||
| 					<view class="radius30 bacf pad-sx40 pad-zy40 mar-x30" v-if="company_name"> | 					<view class="radius30 bacf pad-sx40 pad-zy40 mar-x30" v-if="username"> | ||||||
| 						<view class="fon36 colb">{{company_name}}</view> | 						<view class="fon36 colb">{{name}}</view> | ||||||
| 						<view class="fon30 colb mar-s20 mar-x10">{{phone}}({{username}})</view> | 						<view class="fon30 colb mar-s20 mar-x10">{{phone}}({{username}})</view> | ||||||
| 						<view class="fon24" style="color: #8c8c9b;">{{address}}</view> | 						<view class="fon24" style="color: #8c8c9b;">{{address}}</view> | ||||||
| 					</view> | 					</view> | ||||||
|  | @ -27,33 +27,26 @@ | ||||||
| 				richText:'', | 				richText:'', | ||||||
| 				lat:'', | 				lat:'', | ||||||
| 				lng:'', | 				lng:'', | ||||||
| 				company_name:'', | 				name:'', | ||||||
| 				address:'' | 				address:'' | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		onLoad() { |  | ||||||
| 			this.checkAboutUs(); |  | ||||||
| 		}, |  | ||||||
| 		methods: { | 		methods: { | ||||||
| 			// 查询关于我们信息 | 			// 查询关于我们信息 | ||||||
| 			checkAboutUs(){ | 			checkAboutUs(){ | ||||||
| 				this.$requst.post('/api/index/about').then(res=>{ | 				this.$requst.post('/api/index/about').then(res=>{ | ||||||
| 					if(res.code==0){ | 					if(res.code==0){ | ||||||
| 						let obj = res.data; | 						this.lat = res.data.lat; | ||||||
| 						this.lat = obj.lat; | 						this.lng = res.data.lon; | ||||||
| 						this.lng = obj.lon; | 						this.richText = this.$toolAll.tools.escape2Html(res.data.content); | ||||||
| 						this.phone = obj.phone | 						this.address = res.data.address; | ||||||
| 						this.username = obj.contacts; |  | ||||||
| 						this.richText = this.$toolAll.tools.escape2Html(obj.content); |  | ||||||
| 						this.address = obj.address; |  | ||||||
| 						this.company_name = obj.company_name; |  | ||||||
| 					} else { | 					} else { | ||||||
| 						this.$toolAll.tools.showToast(res.msg); | 						this.$toolAll.tools.showToast(res.msg); | ||||||
| 					} | 					} | ||||||
| 				}) | 				}) | ||||||
| 			}, | 			}, | ||||||
| 			goThere(){ | 			goThere(){ | ||||||
| 				this.$toolAll.tools.goThere(this.lat,this.lng,this.company_name,this.address); | 				this.$toolAll.tools.goThere(this.lat,this.lng,this.name,this.address); | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ | ||||||
| 	<view> | 	<view> | ||||||
| 		<status-container titlet="购买须知" :ifCustomer='false'> | 		<status-container titlet="购买须知" :ifCustomer='false'> | ||||||
| 			<view slot="content"> | 			<view slot="content"> | ||||||
| 				<rich-text :nodes="richText" class="fon24 colpeili line-h46"></rich-text> | 				<rich-text :nodes="content"></rich-text> | ||||||
| 			</view> | 			</view> | ||||||
| 		</status-container> | 		</status-container> | ||||||
| 	</view> | 	</view> | ||||||
|  | @ -12,17 +12,11 @@ | ||||||
| 	export default { | 	export default { | ||||||
| 		data(){ | 		data(){ | ||||||
| 			return { | 			return { | ||||||
| 				richText:'' | 				 | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		onLoad() { | 		onLoad() { | ||||||
| 			this.$requst.post('/api/index/purchaseinstructions').then(res=>{ | 			 | ||||||
| 				if(res.code==0){ |  | ||||||
| 					this.richText = this.$toolAll.tools.escape2Html(res.data.content); |  | ||||||
| 				} else { |  | ||||||
| 					this.$toolAll.tools.showToast(res.msg); |  | ||||||
| 				} |  | ||||||
| 			}) |  | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|  | @ -16,7 +16,7 @@ | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		onLoad() { | 		onLoad() { | ||||||
| 			this.checkDisclaimerEv(); | 			 | ||||||
| 		}, | 		}, | ||||||
| 		methods: { | 		methods: { | ||||||
| 			// 查询免责声明信息 | 			// 查询免责声明信息 | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| <template> | <template> | ||||||
| 	<view class="pad-x50" style="background-color: #fff;"> | 	<view class="pad-x50"> | ||||||
| 		<status-container titlet="完成"> | 		<status-container titlet="完成"> | ||||||
| 			<view slot="content"> | 			<view slot="content"> | ||||||
| 				<view class="pad-zy40 fon30"> | 				<view class="pad-zy40 fon30"> | ||||||
|  | @ -8,11 +8,10 @@ | ||||||
| 					</view> | 					</view> | ||||||
| 					<view class="tcenter" style="color: #0c0c0c;">已完成提交</view> | 					<view class="tcenter" style="color: #0c0c0c;">已完成提交</view> | ||||||
| 					<view class="col9 tcenter mar-sx50 line-h50"> | 					<view class="col9 tcenter mar-sx50 line-h50"> | ||||||
| 						<rich-text :nodes="richText"></rich-text> | 						请扫描二维码添加微信告知您的订单<br /> | ||||||
| 						<!-- 请扫描二维码添加微信告知您的订单<br /> |  | ||||||
| 						号并支付定金 ,发货前请支付尾款。<br /> | 						号并支付定金 ,发货前请支付尾款。<br /> | ||||||
| 						(支付定金后,我们才会开始制作哦,如您有特<br /> | 						(支付定金后,我们才会开始制作哦,如您有特<br /> | ||||||
| 						别的要求可以在微信上提出哦!)<br />
						祝您幸福美满! --> | 						别的要求可以在微信上提出哦!)<br />
						祝您幸福美满! | ||||||
| 					</view> | 					</view> | ||||||
| 					<view @tap="saveImg" class="navigate-to-where radius30 colf fon36 tcenter">保存二维码</view> | 					<view @tap="saveImg" class="navigate-to-where radius30 colf fon36 tcenter">保存二维码</view> | ||||||
| 					<view @tap="goShop" class="navigate-to-where radius30 colf fon36 tcenter mar-s50" style="background: #e00c34;">继续购物</view> | 					<view @tap="goShop" class="navigate-to-where radius30 colf fon36 tcenter mar-s50" style="background: #e00c34;">继续购物</view> | ||||||
|  | @ -26,17 +25,11 @@ | ||||||
| 	export default { | 	export default { | ||||||
| 		data() { | 		data() { | ||||||
| 			return { | 			return { | ||||||
| 				imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg', | 				imgsrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg' | ||||||
| 				richText:'' |  | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		onLoad(op) { | 		onLoad() { | ||||||
| 			this.$requst.get('/api/order/orderQrCode',{id:op.id}).then(res=>{ | 			 | ||||||
| 				if(res.code==0) { |  | ||||||
| 					this.imgsrc = res.data.path; |  | ||||||
| 					this.richText = this.$toolAll.tools.escape2Html(res.data.content); |  | ||||||
| 				} |  | ||||||
| 			}) |  | ||||||
| 		}, | 		}, | ||||||
| 		methods: { | 		methods: { | ||||||
| 			// 提交 | 			// 提交 | ||||||
|  |  | ||||||
|  | @ -1,15 +1,15 @@ | ||||||
| <template> | <template> | ||||||
| 	<view> | 	<view> | ||||||
| 		<status-nav :titleVal="'登录'" :tabcolor="'rgba(244, 244, 244,1)'" :whereCome="1*1" :statusTitle="true" :backgroudColor="'rgba(244, 244, 244,1)'"></status-nav> | 		<status-nav :titleVal="'登录'" :tabcolor="'rgba(244, 244, 244,1)'" :whereCome="1*1" :statusTitle="true" :backgroudColor="'rgba(244, 244, 244,1)'"></status-nav> | ||||||
| 		<view class='login-header'> | 		<!-- <view class='login-header'> | ||||||
| 			<image class="infoImg" :style="{boxShadow: '0px 0px 20px rgba(0,0,0,.8)'}" mode="aspectFill" :src="userInfo.avatarUrl || imgSrc"></image> | 			<image class="infoImg" :style="{boxShadow: '0px 0px 20px '+ publicColor}" mode="aspectFit" :src="userInfo.avatarUrl || imgSrc"></image> | ||||||
| 			<view class="logo-name">{{appletName}}</view> | 			<view class="logo-name">恒美植发</view> | ||||||
| 		</view> | 		</view> | ||||||
| 		<view class="login-box"> | 		<view class="login-box"> | ||||||
| 			<button class='login-btn' :style="{background:publicColor || 'linear-gradient(to right, #ff3772 0%,#fd5548 100%)'}" type='primary' @click="bindGetUserInfo">微信授权</button> | 			<button class='login-btn' :style="{background:publicColor}" type='primary' @click="bindGetUserInfo">微信授权</button> | ||||||
| 			<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon" style="color: #ff3772;">《用户服务协议》</text></view> | 			<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon">《用户服务协议》</text></view> | ||||||
| 		</view> | 		</view> | ||||||
| 		<!-- <view v-if="isShowP" class="disjcac posAll"> | 		<view v-if="isShowP" class="disjcac posAll"> | ||||||
| 			<view class="bacf radius20 width100 tank-box"> | 			<view class="bacf radius20 width100 tank-box"> | ||||||
| 				<view class="tc tank-box-itemone">请授权绑定手机号</view> | 				<view class="tc tank-box-itemone">请授权绑定手机号</view> | ||||||
| 				<view class="fon28 colf pad-x30 pad-zy30 tc disjb"> | 				<view class="fon28 colf pad-x30 pad-zy30 tc disjb"> | ||||||
|  | @ -21,13 +21,13 @@ | ||||||
| 				</view> | 				</view> | ||||||
| 			</view> | 			</view> | ||||||
| 		</view> --> | 		</view> --> | ||||||
| 		<!-- <view class='login-header'> | 		<view class='login-header'> | ||||||
| 			<image class="infoImg" :style="{boxShadow: '0px 0px 20px rgba(0,0,0,.8)'}" mode="aspectFill" :src="userInfo.avatarUrl || imgSrc"></image> | 			<image class="infoImg" :style="{boxShadow: '0px 0px 20px '+ publicColor}" mode="aspectFit" :src="userInfo.avatarUrl || imgSrc"></image> | ||||||
| 			<view class="logo-name">{{appletName}}</view> | 			<view class="logo-name">{{appletName}}</view> | ||||||
| 		</view> | 		</view> | ||||||
| 		<view class="login-box"> | 		<view class="login-box"> | ||||||
| 			<view> | 			<view @tap="setMiniColor"> | ||||||
| 				<button class='login-btn' open-type="getPhoneNumber" @getphonenumber="getphonenumber" :style="{background:publicColor || 'linear-gradient(to right, #ff3772 0%,#fd5548 100%)'}" type='primary'>手机号授权登录</button> | 				<button class='login-btn' open-type="getPhoneNumber" @getphonenumber="getphonenumber" :style="{background:publicColor}" type='primary'>手机号授权登录</button> | ||||||
| 			</view> | 			</view> | ||||||
| 			<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon">《用户服务协议》</text></view> | 			<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon">《用户服务协议》</text></view> | ||||||
| 		</view> | 		</view> | ||||||
|  | @ -42,7 +42,7 @@ | ||||||
| 					</view> | 					</view> | ||||||
| 				</view> | 				</view> | ||||||
| 			</view> | 			</view> | ||||||
| 		</view> --> | 		</view> | ||||||
| 	</view> | 	</view> | ||||||
| </template> | </template> | ||||||
| <script> | <script> | ||||||
|  | @ -51,16 +51,37 @@ | ||||||
| 			return { | 			return { | ||||||
| 				userInfo: {},//用户信息 | 				userInfo: {},//用户信息 | ||||||
| 				canIGetUserProfile: false, | 				canIGetUserProfile: false, | ||||||
| 				imgSrc: '/static/public/login-cover.png',//默认logo头像 | 				imgSrc: '/static/public/logo.png',//默认logo头像 | ||||||
| 				appletName:'商城小程序',//小程序名称 | 				appletName:'恒美植发',//小程序名称 | ||||||
| 				isShowP:false, | 				isShowP:false, | ||||||
| 			}; | 			}; | ||||||
| 		}, | 		}, | ||||||
| 		onLoad() { | 		computed: { | ||||||
|  | 			// 主题颜色 | ||||||
|  | 			publicColor() { | ||||||
|  | 				return this.$store.state.publicColor | ||||||
|  | 			} | ||||||
|  | 		}, | ||||||
|  | 		onLoad(options) { | ||||||
|  | 			// 检测当前运行环境并缓存域名 | ||||||
|  | 			this.$toolAll.tools.currentContext(); | ||||||
|  | 			this.setLogo(); | ||||||
|  | 			this.$toolAll.tools.isVedio(); | ||||||
|  | 			// let ya = this; | ||||||
|  | 			// // 微信扫码后会自动编码,所以需要解码 | ||||||
|  | 			// if (options && options.q) { | ||||||
|  | 			// 	let arr = decodeURIComponent(options.q).split('?')[1].split('&') | ||||||
|  | 			// 	let obj = {} | ||||||
|  | 			// 	arr.forEach(item => { | ||||||
|  | 			// 		let brr = item.split('=') | ||||||
|  | 			// 		obj[brr[0]] = brr[1] | ||||||
|  | 			// 	}) | ||||||
|  | 			// 	// console.log(obj) //得到参数组成的对象 | ||||||
|  | 			// 	ya.invite_code = obj.invite_code | ||||||
|  | 			// } | ||||||
| 			if (uni.getUserProfile) { | 			if (uni.getUserProfile) { | ||||||
| 				this.canIGetUserProfile = true; | 				this.canIGetUserProfile = true; | ||||||
| 			} | 			} | ||||||
| 			// this.setLogo(); |  | ||||||
| 		}, | 		}, | ||||||
| 		methods: { | 		methods: { | ||||||
| 			// 设置logo图 | 			// 设置logo图 | ||||||
|  | @ -75,11 +96,18 @@ | ||||||
| 				this.$toolAll.tools.showToast('登录成功','success') | 				this.$toolAll.tools.showToast('登录成功','success') | ||||||
| 				uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'}) | 				uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'}) | ||||||
| 			}, | 			}, | ||||||
|  | 			// 设置主题色 | ||||||
|  | 			setMiniColor(){ | ||||||
|  | 				this.$requst.get(`index/mini-program-setting`).then(res=>{ | ||||||
|  | 					this.publicColor = res.data.mainColor; | ||||||
|  | 					uni.setStorageSync('publicColor', res.data.mainColor) //#3875F6 #2E8B57 | ||||||
|  | 				}) | ||||||
|  | 			}, | ||||||
| 			getphonenumber(e){//授权绑定手机号 | 			getphonenumber(e){//授权绑定手机号 | ||||||
| 				let ya = this; | 				let ya = this; | ||||||
| 				wx.login({ | 				wx.login({ | ||||||
| 					success:(res)=>{ | 					success:(res)=>{ | ||||||
| 						this.$requst.post('/api/user/login',{code:res.code}).then(result => { | 						this.$requst.post('user/login',{code:res.code}).then(result => { | ||||||
| 							if(e.detail.errMsg=="getPhoneNumber:ok"){ | 							if(e.detail.errMsg=="getPhoneNumber:ok"){ | ||||||
| 								this.$requst.post('user/bind-phone',{openid: result.data.openid,session_key:result.data.session_key, iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{ | 								this.$requst.post('user/bind-phone',{openid: result.data.openid,session_key:result.data.session_key, iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{ | ||||||
| 									console.log('手机号信息:',res); | 									console.log('手机号信息:',res); | ||||||
|  | @ -100,7 +128,7 @@ | ||||||
| 			}, | 			}, | ||||||
| 			goXie(){ | 			goXie(){ | ||||||
| 				uni.navigateTo({ | 				uni.navigateTo({ | ||||||
| 					url:'/pagesB/login/xiey' | 					url:'/pages/login/xiey' | ||||||
| 				}) | 				}) | ||||||
| 			}, | 			}, | ||||||
| 			//调起登录授权 | 			//调起登录授权 | ||||||
|  | @ -148,24 +176,30 @@ | ||||||
| 					language:ya.userInfo.language,//语言 | 					language:ya.userInfo.language,//语言 | ||||||
| 					is_active:1 | 					is_active:1 | ||||||
| 				} | 				} | ||||||
| 				this.$requst.post('/api/user/login',params).then(res => { | 				this.$requst.post('user/login',params).then(res => { | ||||||
| 					if(res.code == 0){ | 					if(res.data.token!=''){ | ||||||
|  | 						uni.setStorageSync('params',params) | ||||||
| 						uni.setStorageSync('userId',res.data.account_id) | 						uni.setStorageSync('userId',res.data.account_id) | ||||||
| 						uni.setStorageSync('token',res.data.token)//缓存token | 						uni.setStorageSync('token',res.data.token)//缓存token | ||||||
| 						uni.setStorageSync('openid',res.data.openid)//缓存openid | 						uni.setStorageSync('openid',res.data.openid)//缓存openid | ||||||
| 						uni.setStorageSync('expire',res.data.expire)//缓存失效时间(时间戳格式) | 						uni.setStorageSync('expire',res.data.expire)//缓存失效时间(时间戳格式) | ||||||
| 						uni.setStorageSync('phone_active',res.data.phone_active)//是否授权手机号 | 						uni.setStorageSync('phone_active',res.data.phone_active)//是否第一次授权 | ||||||
| 						uni.setStorageSync('is_active',res.data.is_active)//是否授权头像和昵称 | 						uni.setStorageSync('is_active',res.data.is_active)//是否第一次授权 | ||||||
| 						uni.setStorageSync('invite_code',res.data.invite_code)//缓存邀请码 | 						uni.setStorageSync('invite_code',res.data.invite_code) | ||||||
| 						if(uni.getStorageSync('page-path-options')) { | 						uni.hideToast() | ||||||
| 							uni.reLaunch({ // 重新进入当前页面 | 						// if(res.data.phone_active!=1){ | ||||||
| 								url:uni.getStorageSync('page-path-options') | 						// 	this.isShowP = true; | ||||||
| 							}) | 						// } else { | ||||||
| 						} else { | 							if(uni.getStorageSync('urlparams')) { | ||||||
| 							uni.reLaunch({ | 								uni.reLaunch({ // 重新进入当前页面 | ||||||
| 								url:'/pages/tabbar/pagehome/pagehome' | 									url:uni.getStorageSync('urlparams') | ||||||
| 							}) | 								}) | ||||||
| 						} | 							} else { | ||||||
|  | 								uni.reLaunch({ | ||||||
|  | 									url:'/pages/tabbar/pagehome/pagehome' | ||||||
|  | 								}) | ||||||
|  | 							} | ||||||
|  | 						// } | ||||||
| 					} | 					} | ||||||
| 				},error => {}) | 				},error => {}) | ||||||
| 			} | 			} | ||||||
|  | @ -177,9 +211,9 @@ | ||||||
| 	@tcolorp:#3875F6; | 	@tcolorp:#3875F6; | ||||||
| 	.login-header {display: flex;justify-content: center;align-items: center;flex-direction: column;margin-top: 40%;} | 	.login-header {display: flex;justify-content: center;align-items: center;flex-direction: column;margin-top: 40%;} | ||||||
| 	.infoImg {width: 192rpx;height: 192rpx;border-radius: 100%;} | 	.infoImg {width: 192rpx;height: 192rpx;border-radius: 100%;} | ||||||
| 	.logo-name {font-size: 30rpx;font-weight: bold;margin-top: 30rpx;color: @tcolor;} | 	.logo-name {font-size: 30rpx;font-weight: bold;margin-top: 20rpx;color: @tcolor;} | ||||||
| 	.login-box {margin-top: 60rpx;text-align: center;} | 	.login-box {margin-top: 60rpx;text-align: center;} | ||||||
| 	.login-btn {width: 80%;margin-top: 50%;box-shadow: 0rpx 6rpx 10rpx rgba(255, 55, 114, .6);} | 	.login-btn {width: 80%;margin-top: 50%;} | ||||||
| 	.xie-box{display: flex;justify-content: center;align-items: center;color: @tcolor;margin-top: 30rpx;} | 	.xie-box{display: flex;justify-content: center;align-items: center;color: @tcolor;margin-top: 30rpx;} | ||||||
| 	.xieCon{color: @tcolorp;} | 	.xieCon{color: @tcolorp;} | ||||||
| </style> | </style> | ||||||
|  |  | ||||||
|  | @ -1,35 +1,49 @@ | ||||||
| <template> | <template> | ||||||
| 	<view> | 	<view> | ||||||
| 		<status-container titlet="用户服务协议" :ifCustomer='false'> | 		<status-nav :titleVal="'用户协议及隐私声明'" :statusTitle="true"></status-nav> | ||||||
| 			<view slot="content"> | 		<view :style="{paddingTop: statusHeight+'px'}" class="mar20 line-h50 fon30"> | ||||||
| 				<rich-text :nodes="richText" class="fon30 line-h50" style="color: #8c8c9b;"></rich-text> | 			<!-- <rich-text :nodes="content"></rich-text> --> | ||||||
|  | 			<view class="text2">本协议为您与本小程序管理者之间所订立的契约,具有合同的法律效力,请您仔细阅读。</view> | ||||||
|  | 			<view>一、本协议内容、生效、变更。本协议内容包括协议正文及所有本小程序已经发布的或将来可能发布的各类规则。所有规则为本协议不可分割的组成部分,与协议正文具有同等法律效力。如您对协议有任何疑问,应向本小程序咨询。您在同意所有协议条款并完成注册程序,才能成为本站的正式用户,您登录即代表同意“用户服务协议”,本协议即生效,对双方产生约束力。只要您使用本小程序平台服务,则本协议即对您产生约束,届时您不应以未阅读本协议的内容或者未获得本小程序对您问询的解答等理由,主张本协议无效,或要求撤销本协议。您确认:本协议条款是处理双方权利义务的契约,始终有效,法律另有强制性规定或双方另有特别约定的,依其规定。 您承诺接受并遵守本协议的约定。如果您不同意本协议的约定,您应立即停止注册程序或停止使用本小程序平台服务。本小程序有权根据需要不定期地制订、修改本协议及/或各类规则,并在本小程序平台公示,不再另行单独通知用户。变更后的协议和规则一经在网站公布,立即生效。如您不同意相关变更,应当立即停止使用本小程序平台服务。您继续使用本小程序平台服务的,即表明您接受修订后的协议和规则。</view> | ||||||
|  | 			<view>二、注册资格用户须具有法定的相应权利能力和行为能力的自然人、法人或其他组织,能够独立承担法律责任。您完成注册程序或其他本小程序平台同意的方式实际使用本平台服务时,即视为您确认自己具备主体资格,能够独立承担法律责任。若因您不具备主体资格,而导致的一切后果,由您及您的监护人自行承担。</view> | ||||||
|  | 			<view class="text2"> | ||||||
|  | 				<view class="text2">2.1用户应自行诚信向本站提供注册资料,用户同意其提供的注册资料真实、准确、完整、合法有效,用户注册资料如有变动的,应及时更新其注册资料。如果用户提供的注册资料不合法、不真实、不准确、不详尽的,用户需承担因此引起的相应责任及后果,并且本小程序保留终止用户使用本平台各项服务的权利。</view> | ||||||
|  | 				<view class="text2">2.2用户在本站进行浏览等活动时,涉及用户真实姓名/名称、通信地址、联系电话、电子邮箱等隐私信息的,本站将予以严格保密,除非得到用户的授权或法律另有规定,本站不会向外界披露用户隐私信息。为完成创建账号,用户需提供以下信息:用户的微信昵称、性别、姓名、手机号等信息。用户提供的上述信息,将在用户使用本服务期间持续授权我们使用。在用户注销账号时,我们将停止使用并删除上述信息。上述信息将存储于中华人民共和国境内。如需跨境传输,我们将会单独征得用户的授权同意。</view> | ||||||
| 			</view> | 			</view> | ||||||
| 		</status-container> | 			<view>三、账户</view> | ||||||
|  | 			<view> | ||||||
|  | 				<view class="text2">3.1您注册成功后,即成为本小程序平台的用户,将持有本小程序平台唯一编号的账户信息。</view> | ||||||
|  | 				<view class="text2">3.2您设置的姓名为真实姓名,不得侵犯或涉嫌侵犯他人合法权益。否则,本小程序有权终止向您提供服务,注销您的账户。</view> | ||||||
|  | 				<view class="text2">3.3您应谨慎合理的保存、使用您的会员名和密码,应对通过您的会员名和密码实施的行为负责。除非有法律规定或司法裁定,且征得本小程序的同意,否则,会员名和密码不得以任何方式转让、赠与或继承(与账户相关的财产权益除外)。</view> | ||||||
|  | 				<view class="text2">3.4用户不得将在本站注册获得的账户借给他人使用,否则用户应承担由此产生的全部责任,并与实际使用人承担连带责任。</view> | ||||||
|  | 				<view class="text2">3.5如果发现任何非法使用等可能危及您的账户安全的情形时,您应当立即以有效方式通知本小程序要求暂停相关服务,并向公安机关报案。您理解本小程序对您的请求采取行动需要合理时间,本小程序对在采取行动前已经产生的后果(包括但不限于您的任何损失)不承担任何责任。</view> | ||||||
|  | 			</view> | ||||||
|  | 			<view>四、用户信息的合理使用</view> | ||||||
|  | 			<view> | ||||||
|  | 				<view class="text2">4.1您同意本小程序平台拥有通过短信、电话、微信消息提醒等形式,向在本站注册用户发送信息等告知信息的权利。</view> | ||||||
|  | 				<view class="text2">4.2您了解并同意,本小程序有权应国家司法、行政等主管部门的要求,向其提供您在本小程序平台填写的注册信息和交易记录等必要信息。如您涉嫌侵犯他人知识产权,则本小程序亦有权在初步判断涉嫌侵权行为存在的情况下,向权利人提供您必要的身份信息。</view> | ||||||
|  | 				<view class="text2">4.3用户同意本小程序有权使用用户的注册信息、用户名、密码等信息,登陆进入用户的注册账户,进行证据保全,包括但不限于公证、见证等。</view> | ||||||
|  | 			</view> | ||||||
|  | 			<view>五、免责条款</view> | ||||||
|  | 			<view class="text2">5.1 本平台仅提供信息对接,发生一切纠纷问题皆与本平台无关,请通过仲裁部门维护各自权益。</view> | ||||||
|  | 		</view> | ||||||
| 	</view> | 	</view> | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
| 	 |  | ||||||
| 	export default { | 	export default { | ||||||
| 		data() { | 		data(){ | ||||||
| 			return { | 			return { | ||||||
| 				richText:'', | 				 | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		methods: { | 		computed:{ | ||||||
| 			// 查询关于我们信息 | 			statusHeight() { | ||||||
| 			checkAboutUs(){ | 				return this.$store.state.statusHeight | ||||||
| 				this.$requst.post('/api/index/about').then(res=>{ | 			} | ||||||
| 					if(res.code==0){ | 		}, | ||||||
| 						this.lat = res.data.lat; | 		onLoad() { | ||||||
| 						this.lng = res.data.lon; | 			// this.$toolAll.tools.escape2Html(this.content) | ||||||
| 						this.richText = this.$toolAll.tools.escape2Html(res.data.content); |  | ||||||
| 						this.address = res.data.address; |  | ||||||
| 					} else { |  | ||||||
| 						this.$toolAll.tools.showToast(res.msg); |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|  | @ -1,48 +1,51 @@ | ||||||
| <template> | <template> | ||||||
| 	<view> | 	<view class="pad-x140"> | ||||||
| 		<status-container titlet="订单详情"> | 		<status-container titlet="订单详情"> | ||||||
| 			<view slot="content"> | 			<view slot="content"> | ||||||
| 				<view class="pad-zy20"> | 				<view class="pad-zy20"> | ||||||
| 					<view class="bacf radius30 pad-sx30 pad-zy40 fon30 mar-x25"> | 					<view class="bacf radius30 pad-sx30 pad-zy40 fon30 mar-x25"> | ||||||
| 						<view class="disjbac"> | 						<view class="disjbac"> | ||||||
| 							<view class="">订单编号</view> | 							<view class="">订单编号</view> | ||||||
| 							<view class="bold">{{orderDetail.coding}}</view> | 							<view class="bold">2928392832</view> | ||||||
| 						</view> | 						</view> | ||||||
| 						<view class="disjbac mar-sx30"> | 						<view class="disjbac mar-sx30"> | ||||||
| 							<view class="">下单时间</view> | 							<view class="">下单时间</view> | ||||||
| 							<view class="bold">{{orderDetail.status_text}}</view> | 							<view class="bold">2021-11-30 23:30</view> | ||||||
| 						</view> | 						</view> | ||||||
| 						<view class="disjbac"> | 						<view class="disjbac"> | ||||||
| 							<view class="">订单状态</view> | 							<view class="">订单状态</view> | ||||||
| 							<view class="bold">{{orderDetail.coding}}</view> | 							<view class="bold">已发货</view> | ||||||
| 						</view> | 						</view> | ||||||
| 					</view> | 					</view> | ||||||
| 					<view class="bacf radius30 pad-sx30 pad-zy40 fon30 mar-x25"> | 					<view class="bacf radius30 pad-sx30 pad-zy40 fon30 mar-x25"> | ||||||
| 						<view class="">订单信息</view> | 						<view class="">订单信息</view> | ||||||
| 						<view class="disjb bbot pad-sx30" v-for="(item,index) in orderDetail.skus" :key="index"> | 						<view class="disjb bbot pad-sx30" v-for="(item,index) in 2" :key="index"> | ||||||
| 							<image class="mar-y30 flexs radius30" :src="item.sku_cover" mode="widthFix" style="width: 210rpx;height: 210rpx;"></image> | 							<image class="mar-y30 flexs radius30" src="https://s6.jpg.cm/2022/05/06/Lx4T45.jpg" mode="" style="width: 210rpx;height: 210rpx;"></image> | ||||||
| 							<view class="width100 disjb fc line-h40" style="height: 210rpx;"> | 							<view class="width100 disjb fc line-h40" style="height: 210rpx;"> | ||||||
| 								<view class="clips2 fon24">{{item.spu_name}} </view> | 								<view class="clips2 fon24">于亿年宝藏中臻选1的宝石级钻石每年开采数LOVE100 星座光的原石挑选 </view> | ||||||
| 								<view class=""> | 								<view class=""> | ||||||
| 									<view class="fon24 mar-x30" style="color: #8c8c9b;">单位:{{item.sku_unit}}</view> | 									<view class="fon24 mar-x30" style="color: #8c8c9b;">单位:盒</view> | ||||||
| 									<view class="disjbac "> | 									<view class="disjbac "> | ||||||
| 										<view class="textc bold">¥{{item.price}}</view> | 										<view class="textc bold">¥{{$toolAll.tools.changeNum(2000)}}</view> | ||||||
| 										<view class="fon24" style="color: #8c8c9b;">x{{item.num}}</view> | 										<view class="fon24" style="color: #8c8c9b;">x1</view> | ||||||
| 									</view> | 									</view> | ||||||
| 								</view> | 								</view> | ||||||
| 							</view> | 							</view> | ||||||
| 						</view> | 						</view> | ||||||
| 						<view class="disje pad-s30">总计:<text class="fon36 bold textc" style="margin-top: -6rpx;">¥{{orderDetail.original_price}}</text></view> | 						<view class="disje pad-s30">总计:<text class="fon36 bold textc" style="margin-top: -6rpx;">¥4000</text></view> | ||||||
| 					</view> | 					</view> | ||||||
| 					<view class="bacf radius30 pad-sx30 pad-zy40 fon30 mar-x25"> | 					<view class="bacf radius30 pad-sx30 pad-zy40 fon30 mar-x25"> | ||||||
| 						<view class="mar-x30">联系信息</view> | 						<view class="mar-x30">联系信息</view> | ||||||
| 						<view class="bold">{{orderDetail.contacts}} {{orderDetail.phone}}</view> | 						<view class="bold">徐卫 546546515315</view> | ||||||
| 						<view class="fon24"> | 						<view class="fon24"> | ||||||
| 							<view class="mar-sx10" style="color: #8c8c9b;">{{orderDetail.address}}</view> | 							<view class="mar-sx10" style="color: #8c8c9b;">四川省成都市双店路奥园广场3期1419号</view> | ||||||
| 							<view class="" style="color: #8c8c9b;">婚期:{{orderDetail.wedding_date}}</view> | 							<view class="" style="color: #8c8c9b;">婚期:2022-12-23</view> | ||||||
| 							<view class="mar-s10" style="color: #8c8c9b;">希望到货时间:{{orderDetail.expected_delivery_date}}</view> | 							<view class="mar-s10" style="color: #8c8c9b;">希望到货时间:2022-12-21</view> | ||||||
| 						</view> | 						</view> | ||||||
| 					</view> | 					</view> | ||||||
|  | 					<view class="posixzy bacf pad-sx20 pad-zy50" style="box-shadow: 0rpx -2rpx 10rpx rgba(0, 0, 0, 0.06);"> | ||||||
|  | 						<view class="navigate-to-where radius30 colf fon36 tcenter">确认收货</view> | ||||||
|  | 					</view> | ||||||
| 				</view> | 				</view> | ||||||
| 			</view> | 			</view> | ||||||
| 		</status-container> | 		</status-container> | ||||||
|  | @ -53,7 +56,7 @@ | ||||||
| 	export default { | 	export default { | ||||||
| 		data() { | 		data() { | ||||||
| 			return { | 			return { | ||||||
| 				orderDetail: [] | 				 | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		onShareAppMessage(res) { | 		onShareAppMessage(res) { | ||||||
|  | @ -64,30 +67,11 @@ | ||||||
| 		 	}; | 		 	}; | ||||||
| 		  return shareObj; | 		  return shareObj; | ||||||
| 		}, | 		}, | ||||||
| 		onLoad(op) { | 		onLoad() { | ||||||
| 			this.getDetail(op.id); | 			 | ||||||
| 		}, | 		}, | ||||||
| 		methods: { | 		methods: { | ||||||
| 			getDetail(id){ | 			 | ||||||
| 				this.$requst.post('/api/user/order-detail',{id}).then(res=>{ |  | ||||||
| 					if(res.code==0) { |  | ||||||
| 						let dataObj = { |  | ||||||
| 							coding: res.data.coding, //订单号 |  | ||||||
| 							created_at: res.data.created_at, //下单时间 |  | ||||||
| 							status_text: res.data.status_text, //订单状态 |  | ||||||
| 							expected_delivery_date: res.data.expected_delivery_date, //期望到货时间 |  | ||||||
| 							wedding_date: res.data.wedding_date, //婚期 |  | ||||||
| 							original_price: res.data.original_price, //总价 |  | ||||||
| 							contacts: res.data.contacts, //收件人姓名 |  | ||||||
| 							address: res.data.address, //收件地址 |  | ||||||
| 							phone: res.data.phone, //联系电话 |  | ||||||
| 							skus: res.data.skus //订单详情列表 |  | ||||||
| 						} |  | ||||||
| 						this.orderDetail = dataObj; |  | ||||||
| 						console.log(this.orderDetail,'订单详情2') |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 			} |  | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| <template> | <template> | ||||||
| 	<view > | 	<view> | ||||||
| 		<status-container titlet="搜索"> | 		<status-container titlet="搜索"> | ||||||
| 			<view slot="content" style="margin: -20rpx 0rpx 0 0rpx;"> | 			<view slot="content" style="margin: -20rpx 0rpx 0 0rpx;"> | ||||||
| 				<view class="pad-x30 pad-s20" style="position: sticky;background-color: #f4f4f4;" :style="{top: padt+'px'}"> | 				<view class="pad-x30 pad-s20" style="position: sticky;background-color: #f4f4f4;" :style="{top: padt+'px'}"> | ||||||
|  | @ -7,27 +7,11 @@ | ||||||
| 						<image src="/static/public/icon-searcht.png" mode="widthFix" style="width: 40rpx;height: 40rpx;"></image> | 						<image src="/static/public/icon-searcht.png" mode="widthFix" style="width: 40rpx;height: 40rpx;"></image> | ||||||
| 						<input @confirm="goSearch" @focus="ifResult=false" v-model="keyword" class="width100 fon30 mar-z20" type="text" placeholder="搜索" style="height: 90rpx;color: #8c8c9b;" placeholder-style="color: #8c8c9b"> | 						<input @confirm="goSearch" @focus="ifResult=false" v-model="keyword" class="width100 fon30 mar-z20" type="text" placeholder="搜索" style="height: 90rpx;color: #8c8c9b;" placeholder-style="color: #8c8c9b"> | ||||||
| 					</view> | 					</view> | ||||||
| 					<view class="fon30 bold" v-if="keyword && ifResult">结果:{{keyword}}<text class="textc">({{total}})</text></view> | 					<view class="fon30 bold" v-if="keyword && ifResult">结果:{{keyword}}<text v-if="num" class="textc">({{num}})</text></view> | ||||||
| 				</view> | 				</view> | ||||||
| 				<view class="disjbac fw"> | 				<list-one></list-one> | ||||||
| 					<view class="width48_5 fon30 mar-x30" @tap="goDetail(item.id)" v-for="(item,index) in dataList" :key="index"> | 				<view class="mar-s60"> | ||||||
| 						<view class="" style="height: 342rpx;"> | 					<pitera textStr="——到底啦——"></pitera> | ||||||
| 							<image class="radius30 width100" :src="item.imgsrc" mode="aspectFill" style="height: 342rpx;"></image> |  | ||||||
| 						</view> |  | ||||||
| 						<view class="pad-zy20"> |  | ||||||
| 							<view class="line-h50 mar-sx25 clips2" style="height: 90rpx;">{{item.title}}</view> |  | ||||||
| 							<view class="textc disjbac"> |  | ||||||
| 								<view class="">¥{{item.price}}</view> |  | ||||||
| 								<i @tap.stop="addCartEv(item.skuId)" class="icon icon-shop-cart" style="font-size: 40rpx;"></i> |  | ||||||
| 							</view> |  | ||||||
| 						</view> |  | ||||||
| 					</view> |  | ||||||
| 				</view> |  | ||||||
| 				<view class="mar-s60" v-if="total==dataList.length"> |  | ||||||
| 					<pitera textStr="—— 到底啦 ——"></pitera> |  | ||||||
| 				</view> |  | ||||||
| 				<view class="loading-box mar-s60" v-show="ifLoading"> |  | ||||||
| 				    <view class="loader-16"></view> |  | ||||||
| 				</view> | 				</view> | ||||||
| 			</view> | 			</view> | ||||||
| 		</status-container> | 		</status-container> | ||||||
|  | @ -37,7 +21,6 @@ | ||||||
| <script> | <script> | ||||||
| 	import listOne from '@/components/list/list-one'; | 	import listOne from '@/components/list/list-one'; | ||||||
| 	import pitera from '@/components/nothing/pitera'; | 	import pitera from '@/components/nothing/pitera'; | ||||||
| 	import {getCartNum} from '@/jsFile/public-api.js'; |  | ||||||
| 	export default { | 	export default { | ||||||
| 		components:{ | 		components:{ | ||||||
| 			listOne, | 			listOne, | ||||||
|  | @ -46,76 +29,17 @@ | ||||||
| 		data() { | 		data() { | ||||||
| 			return { | 			return { | ||||||
| 				padt:uni.getSystemInfoSync().statusBarHeight + 50, | 				padt:uni.getSystemInfoSync().statusBarHeight + 50, | ||||||
| 				windowHeigh:uni.getSystemInfoSync().windowHeight, |  | ||||||
| 				keyword:'', | 				keyword:'', | ||||||
| 				num:11, | 				num:11, | ||||||
| 				ifResult:true, | 				ifResult:true | ||||||
| 				dataList:[], |  | ||||||
| 				ifLoading:false, |  | ||||||
| 				total:0, |  | ||||||
| 				page:1, |  | ||||||
| 				size:10 |  | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		onReachBottom(e) { |  | ||||||
| 			this.$refs.list.moreEv(); |  | ||||||
| 		}, |  | ||||||
| 		onLoad(op) { | 		onLoad(op) { | ||||||
| 			if(op.keyword) this.keyword = op.keyword; | 			if(op.keyword) this.keyword = op.keyword; | ||||||
| 			this.getList(); |  | ||||||
| 		}, | 		}, | ||||||
| 		methods: { | 		methods: { | ||||||
| 			goSearch(){ | 			goSearch(){ | ||||||
| 				this.ifResult = true; | 				this.ifResult = true; | ||||||
| 				// 列表查询 |  | ||||||
| 				this.getList() |  | ||||||
| 			}, |  | ||||||
| 			// 列表查询 |  | ||||||
| 			getList(){ |  | ||||||
| 				this.ifLoading = true; |  | ||||||
| 				let params = { |  | ||||||
| 					keyword:this.keyword, |  | ||||||
| 					page:this.page, |  | ||||||
| 					size:this.size |  | ||||||
| 				} |  | ||||||
| 				this.$requst.post('/api/spu/list',params).then(res=>{ |  | ||||||
| 					if(res.code==0) { |  | ||||||
| 						this.total = res.data.total; |  | ||||||
| 						if(this.page==1) this.dataList = []; |  | ||||||
| 						if(res.data.list.length) { |  | ||||||
| 							res.data.list.forEach(item=>{ |  | ||||||
| 								let obj = { |  | ||||||
| 									id:item.id, |  | ||||||
| 									skuId:item.skuId, |  | ||||||
| 									imgsrc:item.cover, |  | ||||||
| 									title:item.name, |  | ||||||
| 									price:item.original_price  |  | ||||||
| 								} |  | ||||||
| 								this.dataList.push(obj); |  | ||||||
| 							}) |  | ||||||
| 						} |  | ||||||
| 					} |  | ||||||
| 					this.ifLoading = false; |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 			// 加入购物车 |  | ||||||
| 			addCartEv(id) { |  | ||||||
| 				if(this.$toolAll.tools.judgeAuth()) { |  | ||||||
| 					this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{ |  | ||||||
| 						if(res.code==0) { |  | ||||||
| 							this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)') |  | ||||||
| 							getCartNum(); |  | ||||||
| 						} else { |  | ||||||
| 							this.$toolAll.tools.showToast(res.msg) |  | ||||||
| 						} |  | ||||||
| 					}) |  | ||||||
| 				} |  | ||||||
| 			}, |  | ||||||
| 			// 去详情 |  | ||||||
| 			goDetail(id) { |  | ||||||
| 				uni.navigateTo({ |  | ||||||
| 					url:`/pagesB/shop-detail/shop-detail?id=${id}` |  | ||||||
| 				}) |  | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -17,15 +17,15 @@ | ||||||
| 						</picker> | 						</picker> | ||||||
| 					</view> | 					</view> | ||||||
| 					<view class="posir fon30 mar-x50"> | 					<view class="posir fon30 mar-x50"> | ||||||
| 						<text class="col9 posia pad-zy10 input-title">收货地址(必填)</text> | 						<text class="col9 posia pad-zy10 input-title">收货地址</text> | ||||||
| 						<input type="text" v-model="address" @tap="chooseEv(2)" class="input-box width100 radius20  pad-zy30" :class="current==2 ? 'focusc' : ''" placeholder="请填写收货地址" placeholder-style="color:#000000"> | 						<input type="text" v-model="address" @tap="chooseEv(2)" class="input-box width100 radius20  pad-zy30" :class="current==2 ? 'focusc' : ''" placeholder="请填写收货地址" placeholder-style="color:#000000"> | ||||||
| 					</view> | 					</view> | ||||||
| 					<view class="posir fon30 mar-x50"> | 					<view class="posir fon30 mar-x50"> | ||||||
| 						<text class="col9 posia pad-zy10 input-title">收货联系人(必填)</text> | 						<text class="col9 posia pad-zy10 input-title">收货联系人</text> | ||||||
| 						<input type="text" v-model="name" @tap="chooseEv(3)" class="input-box width100 radius20  pad-zy30" :class="current==3 ? 'focusc' : ''" placeholder="请填写联系人" placeholder-style="color:#000000"> | 						<input type="text" v-model="name" @tap="chooseEv(3)" class="input-box width100 radius20  pad-zy30" :class="current==3 ? 'focusc' : ''" placeholder="请填写联系人" placeholder-style="color:#000000"> | ||||||
| 					</view> | 					</view> | ||||||
| 					<view class="posir fon30 mar-x50"> | 					<view class="posir fon30 mar-x50"> | ||||||
| 						<text class="col9 posia pad-zy10 input-title">收货电话(必填)</text> | 						<text class="col9 posia pad-zy10 input-title">收货电话</text> | ||||||
| 						<input type="number" v-model="phone" maxlength="11" @tap="chooseEv(4)" class="input-box width100 radius20  pad-zy30" :class="current==4 ? 'focusc' : ''" placeholder="请填写联系电话" placeholder-style="color:#000000"> | 						<input type="number" v-model="phone" maxlength="11" @tap="chooseEv(4)" class="input-box width100 radius20  pad-zy30" :class="current==4 ? 'focusc' : ''" placeholder="请填写联系电话" placeholder-style="color:#000000"> | ||||||
| 					</view> | 					</view> | ||||||
| 					<view @tap="submit" class="navigate-to-where radius30 colf fon36 tcenter">提交完成</view> | 					<view @tap="submit" class="navigate-to-where radius30 colf fon36 tcenter">提交完成</view> | ||||||
|  | @ -49,55 +49,21 @@ | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		onLoad() { | 		onLoad() { | ||||||
| 			console.log(uni.getStorageSync('buyList'),'缓存数组') | 			 | ||||||
| 		}, |  | ||||||
| 		onShow() { |  | ||||||
| 			this.getUserInfo() |  | ||||||
| 		}, | 		}, | ||||||
| 		methods: { | 		methods: { | ||||||
| 			// 获取默认信息 |  | ||||||
| 			getUserInfo(){ |  | ||||||
| 				this.$requst.get('/api/user/info').then(res=>{ |  | ||||||
| 					console.log(res,'用户信息') |  | ||||||
| 					if(res.code==0) { |  | ||||||
| 						this.address = res.data.address; //地址 |  | ||||||
| 						this.name = res.data.contacts; //联系人 |  | ||||||
| 						this.phone = res.data.mobile; //电话 |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 			// 提交 | 			// 提交 | ||||||
| 			submit(){ | 			submit(){ | ||||||
| 				if(this.checkEmpty() && this.flag){ | 				if(this.checkEmpty() && this.flag){ | ||||||
| 					this.flag = false; | 					this.flag = false; | ||||||
| 					let params = { | 					uni.navigateTo({ | ||||||
| 						sku_list: uni.getStorageSync('buyList'), | 						url:'/pagesB/finish/finish' | ||||||
| 						phone: this.phone, |  | ||||||
| 						contacts: this.name, |  | ||||||
| 						address: this.address, |  | ||||||
| 						expected_delivery_date: this.totime, |  | ||||||
| 						wedding_date: this.lasttime, |  | ||||||
| 					} |  | ||||||
| 					this.$requst.post('/api/order/create',params).then(res=>{ |  | ||||||
| 						if(res.code==0) { |  | ||||||
| 							uni.reLaunch({ |  | ||||||
| 								url:`/pagesB/finish/finish?id=${res.data.id}` |  | ||||||
| 							}) |  | ||||||
| 						}else{ |  | ||||||
| 							console.log(res.msg,'提示信息') |  | ||||||
| 							this.$toolAll.tools.showToast(res.msg); |  | ||||||
| 							this.flag = true; |  | ||||||
| 						} |  | ||||||
| 					}) | 					}) | ||||||
| 				} | 				} | ||||||
| 			}, | 			}, | ||||||
| 			checkEmpty(){ | 			checkEmpty(){ | ||||||
| 				let result = false; | 				let result = false; | ||||||
| 				if(!this.lasttime) { | 				if(!this.address) { | ||||||
| 					this.$toolAll.tools.showToast('请选择婚期'); |  | ||||||
| 				} else if(!this.totime) { |  | ||||||
| 					this.$toolAll.tools.showToast('请选择希望送到日期'); |  | ||||||
| 				} else if(!this.address) { |  | ||||||
| 					this.$toolAll.tools.showToast('请填写收货地址'); | 					this.$toolAll.tools.showToast('请填写收货地址'); | ||||||
| 				} else if(!this.name) { | 				} else if(!this.name) { | ||||||
| 					this.$toolAll.tools.showToast('请填写联系人'); | 					this.$toolAll.tools.showToast('请填写联系人'); | ||||||
|  |  | ||||||
|  | @ -1,12 +1,12 @@ | ||||||
| <template> | <template> | ||||||
| 	<view class="pad-x180"> | 	<view class="pad-x140"> | ||||||
| 		<status-container titlet="详情"> | 		<status-container titlet="详情"> | ||||||
| 			<view slot="content" style="margin: -20rpx -20rpx 0 -20rpx;"> | 			<view slot="content" style="margin: -20rpx -20rpx 0 -20rpx;"> | ||||||
| 				<swiper-pu newRadius="0rpx" :bannerList="bannerList" :newHeight="swiperH+'px'" newBottom="40rpx" :isplay="isplay"></swiper-pu> | 				<swiper-pu newRadius="0rpx" :newHeight="swiperH+'px'" newBottom="40rpx" :isplay="isplay"></swiper-pu> | ||||||
| 				<view class="pad-zy20 bacf pad-sx20"> | 				<view class="pad-zy20 bacf pad-sx20"> | ||||||
| 					<view class="fon42 colb mar-x10">{{shopObj.name}}</view> | 					<view class="fon42 colb mar-x10">如意饼</view> | ||||||
| 					<view class="fon24 col6 mar-x20">{{shopObj.subtitle}}</view> | 					<view class="fon24 col6 mar-x20">如意饼 事事如意</view> | ||||||
| 					<view class="textc bold fon30 ">¥{{shopObj.original_price}}/<text class="fon24">{{shopObj.unit}}</text></view> | 					<view class="textc bold fon30 ">¥46,854/<text class="fon24">盒</text></view> | ||||||
| 				</view> | 				</view> | ||||||
| 				<view class="fon36 colb tcenter pad-sx30 bold">商品介绍</view> | 				<view class="fon36 colb tcenter pad-sx30 bold">商品介绍</view> | ||||||
| 				<view class="pad-zy20"> | 				<view class="pad-zy20"> | ||||||
|  | @ -15,15 +15,14 @@ | ||||||
| 			</view> | 			</view> | ||||||
| 		</status-container> | 		</status-container> | ||||||
| 		<view class="disjbac posixzy bacf pad-sx20 pad-zy50"> | 		<view class="disjbac posixzy bacf pad-sx20 pad-zy50"> | ||||||
| 			<view class="btn buy-btn" @tap="buyEv(shopObj.skuId)">立即购买</view> | 			<view class="btn buy-btn" @tap="buyEv">立即购买</view> | ||||||
| 			<view class="btn" @tap="addCartEv(shopObj.skuId)">加入购物车</view> | 			<view class="btn" @tap="addCartEv">加入购物车</view> | ||||||
| 		</view> | 		</view> | ||||||
| 	</view> | 	</view> | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
| 	import swiperPu from '@/components/swipers/swiper-pu'; | 	import swiperPu from '@/components/swipers/swiper-pu'; | ||||||
| 	import {getCartNum} from '@/jsFile/public-api.js'; |  | ||||||
| 	export default { | 	export default { | ||||||
| 		components:{ | 		components:{ | ||||||
| 			swiperPu | 			swiperPu | ||||||
|  | @ -33,82 +32,27 @@ | ||||||
| 				swiperH:uni.getSystemInfoSync().windowWidth, | 				swiperH:uni.getSystemInfoSync().windowWidth, | ||||||
| 				richText:'', | 				richText:'', | ||||||
| 				isplay:false, | 				isplay:false, | ||||||
| 				playTimer:null, | 				playTimer:null | ||||||
| 				shopObj:'', |  | ||||||
| 				bannerList:[ |  | ||||||
| 					// {imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',url:'',isVideo:false,poster:''}, |  | ||||||
| 					// {imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',url:'',isVideo:false,poster:''}, |  | ||||||
| 					// {imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',url:'',isVideo:false,poster:''}, |  | ||||||
| 				] |  | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		onHide() { | 		onHide() { | ||||||
| 			clearTimeout(this.playTimer); | 			clearTimeout(this.playTimer); | ||||||
| 		}, | 		}, | ||||||
| 		onShareAppMessage() { |  | ||||||
| 			return { |  | ||||||
| 				title:this.shopObj.name, |  | ||||||
| 				path:uni.getStorageSync('page-path-options'), |  | ||||||
| 				imageUrl:this.bannerList[0].imgSrc |  | ||||||
| 			} |  | ||||||
| 		}, |  | ||||||
| 		onShow() { | 		onShow() { | ||||||
| 			this.playTimer = setTimeout(()=>{ | 			this.playTimer = setTimeout(()=>{ | ||||||
| 				this.isplay = true; | 				this.isplay = true; | ||||||
| 			},2000) | 			},2000) | ||||||
| 		}, | 		}, | ||||||
| 		onLoad(op) { |  | ||||||
| 			this.getDetail(op.id); |  | ||||||
| 		}, |  | ||||||
| 		methods: { | 		methods: { | ||||||
| 			 |  | ||||||
| 			// 查询详情事件 |  | ||||||
| 			getDetail(id){ |  | ||||||
| 				this.$requst.post('/api/spu/detail',{id}).then(res=>{ |  | ||||||
| 					if(res.code==0) { |  | ||||||
| 						this.shopObj = res.data.detail; |  | ||||||
| 						this.richText = this.$toolAll.tools.escape2Html(this.shopObj.content); |  | ||||||
| 						if(this.shopObj.images.length){ |  | ||||||
| 							this.shopObj.images.forEach(item=>{ |  | ||||||
| 								let obj = { |  | ||||||
| 									imgSrc:item, |  | ||||||
| 									url:'', |  | ||||||
| 									isVideo:false, |  | ||||||
| 									poster:'' |  | ||||||
| 								} |  | ||||||
| 								this.bannerList.push(obj); |  | ||||||
| 							}) |  | ||||||
| 						} |  | ||||||
| 					} |  | ||||||
| 				}) |  | ||||||
| 			}, |  | ||||||
| 			 |  | ||||||
| 			// 立即购买 | 			// 立即购买 | ||||||
| 			buyEv(id){ | 			buyEv(){ | ||||||
| 				this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{ | 				uni.reLaunch({ | ||||||
| 					if(res.code==0) { | 					url:'/pages/tabbar/cart/cart' | ||||||
| 						uni.reLaunch({ |  | ||||||
| 							url:`/pages/tabbar/cart/cart?skuId=${id}` |  | ||||||
| 						}) |  | ||||||
| 						getCartNum(); |  | ||||||
| 					} else { |  | ||||||
| 						this.$toolAll.tools.showToast(res.msg) |  | ||||||
| 					} |  | ||||||
| 				}) | 				}) | ||||||
| 			}, | 			}, | ||||||
| 			 |  | ||||||
| 			// 加入购物车 | 			// 加入购物车 | ||||||
| 			addCartEv(id) { | 			addCartEv(id) { | ||||||
| 				if(this.$toolAll.tools.judgeAuth()) { | 				this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)') | ||||||
| 					this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{ |  | ||||||
| 						if(res.code==0) { |  | ||||||
| 							this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)'); |  | ||||||
| 							getCartNum(); |  | ||||||
| 						} else { |  | ||||||
| 							this.$toolAll.tools.showToast(res.msg) |  | ||||||
| 						} |  | ||||||
| 					}) |  | ||||||
| 				} |  | ||||||
| 			}, | 			}, | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 9.9 KiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 8.5 KiB | 
|  | @ -21,21 +21,10 @@ export default { | ||||||
| 		obj:{ | 		obj:{ | ||||||
| 			a:'吃鸡腿', | 			a:'吃鸡腿', | ||||||
| 			b:'吃自助餐' | 			b:'吃自助餐' | ||||||
| 		}, | 		} | ||||||
| 		titleList:[], |  | ||||||
| 		imgList:[], |  | ||||||
| 		onLineList:[], |  | ||||||
| 		cartNum:0, |  | ||||||
| 		geList:[] |  | ||||||
| 	}, | 	}, | ||||||
| 	// Vuex中store数据改变的唯一方法就是mutations 不适合异步方法
 | 	// Vuex中store数据改变的唯一方法就是mutations 不适合异步方法
 | ||||||
| 	mutations: { | 	mutations: { | ||||||
| 		setNum(state,num){ |  | ||||||
| 			state.cartNum = num; |  | ||||||
| 		}, |  | ||||||
| 		setGe(state,payload){ |  | ||||||
| 			state.geList = payload.geList; |  | ||||||
| 		}, |  | ||||||
| 		footHeightEv(state,str){ | 		footHeightEv(state,str){ | ||||||
| 			state.footHeight = str; | 			state.footHeight = str; | ||||||
| 		}, | 		}, | ||||||
|  | @ -57,9 +46,6 @@ export default { | ||||||
| 		// 新增字段方法
 | 		// 新增字段方法
 | ||||||
| 		newProp(state,payload) { | 		newProp(state,payload) { | ||||||
| 			state.obj = { ...state.obj, c: payload.c }; | 			state.obj = { ...state.obj, c: payload.c }; | ||||||
| 		}, |  | ||||||
| 		updateState(state, payload) { |  | ||||||
| 			state.onLineList = payload.list; |  | ||||||
| 		} | 		} | ||||||
| 	}, | 	}, | ||||||
| 	// 可以执行任意的同步和异步操作
 | 	// 可以执行任意的同步和异步操作
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue