Compare commits
	
		
			2 Commits
		
	
	
		
			9a46dfe0ef
			...
			bbcbd9ef97
		
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | bbcbd9ef97 | |
|  | 66558d876f | 
|  | @ -1,8 +1,8 @@ | ||||||
| { | { | ||||||
|   "editor.formatOnSave": true, |   "editor.formatOnSave": true, | ||||||
|   "editor.codeActionsOnSave": { |   "editor.codeActionsOnSave": { | ||||||
|     "source.fixAll.eslint": true, |     "source.fixAll.eslint": "explicit", | ||||||
|     "source.organizeImports": true |     "source.organizeImports": "explicit" | ||||||
|   }, |   }, | ||||||
|   "editor.defaultFormatter": "esbenp.prettier-vscode", |   "editor.defaultFormatter": "esbenp.prettier-vscode", | ||||||
|   "[vue]": { |   "[vue]": { | ||||||
|  |  | ||||||
							
								
								
									
										11
									
								
								App.vue
								
								
								
								
							
							
						
						
									
										11
									
								
								App.vue
								
								
								
								
							|  | @ -1,4 +1,3 @@ | ||||||
| 
 |  | ||||||
| <script> | <script> | ||||||
| import { setToken } from '@/config/auth.js' | import { setToken } from '@/config/auth.js' | ||||||
| export default { | export default { | ||||||
|  | @ -9,7 +8,7 @@ export default { | ||||||
|       setToken(options.query?.token) |       setToken(options.query?.token) | ||||||
|     } |     } | ||||||
|     const whiteList = [ |     const whiteList = [ | ||||||
|       // 'pages/shareRegist/index', |       'pages/shareRegist/index', | ||||||
|       // 'pages/shareRegist/success', |       // 'pages/shareRegist/success', | ||||||
|       'pages/login/index', |       'pages/login/index', | ||||||
|       // 'pages/wechatPay/bfPay/', |       // 'pages/wechatPay/bfPay/', | ||||||
|  | @ -31,13 +30,13 @@ export default { | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| <style lang="scss"> | <style lang="scss"> | ||||||
| 	body{ | body { | ||||||
|   background-color: #f2f2f2; |   background-color: #f2f2f2; | ||||||
| 	} | } | ||||||
| /*每个页面公共css */ | /*每个页面公共css */ | ||||||
| @import '@/uni_modules/uview-ui/index.scss'; | @import '@/uni_modules/uview-ui/index.scss'; | ||||||
| 
 | 
 | ||||||
| ::v-deep .uni-picker-container{ | ::v-deep .uni-picker-container { | ||||||
|   z-index: 100000!important; |   z-index: 100000 !important; | ||||||
| } | } | ||||||
| </style> | </style> | ||||||
|  |  | ||||||
|  | @ -108,7 +108,6 @@ export default { | ||||||
|     }, |     }, | ||||||
|     handleProductClick(item) { |     handleProductClick(item) { | ||||||
|       // 商品点击事件,可根据需求实现跳转或其他逻辑 |       // 商品点击事件,可根据需求实现跳转或其他逻辑 | ||||||
|       console.log(item, '....ite?') |  | ||||||
|       this.$emit('product-click', item) |       this.$emit('product-click', item) | ||||||
|     }, |     }, | ||||||
|     handleAddToCart(item) { |     handleAddToCart(item) { | ||||||
|  |  | ||||||
|  | @ -6,6 +6,7 @@ | ||||||
|         <area-product-list |         <area-product-list | ||||||
|           :list="registList" |           :list="registList" | ||||||
|           :title="regist.name" |           :title="regist.name" | ||||||
|  |           @product-click="redirectList" | ||||||
|         ></area-product-list> |         ></area-product-list> | ||||||
|       </view> |       </view> | ||||||
|     </view> |     </view> | ||||||
|  | @ -15,6 +16,7 @@ | ||||||
|         <area-product-list |         <area-product-list | ||||||
|           :list="upgradeList" |           :list="upgradeList" | ||||||
|           :title="upgrade.name" |           :title="upgrade.name" | ||||||
|  |           @product-click="redirectList" | ||||||
|         ></area-product-list> |         ></area-product-list> | ||||||
|       </view> |       </view> | ||||||
|     </view> |     </view> | ||||||
|  | @ -24,6 +26,7 @@ | ||||||
|         <area-product-list |         <area-product-list | ||||||
|           :list="repurchaseList" |           :list="repurchaseList" | ||||||
|           :title="repurchase.name" |           :title="repurchase.name" | ||||||
|  |           @product-click="redirectList" | ||||||
|         ></area-product-list> |         ></area-product-list> | ||||||
|       </view> |       </view> | ||||||
|     </view> |     </view> | ||||||
|  | @ -33,6 +36,7 @@ | ||||||
|         <area-product-list |         <area-product-list | ||||||
|           :list="rescissionList" |           :list="rescissionList" | ||||||
|           :title="rescission.name" |           :title="rescission.name" | ||||||
|  |           @product-click="redirectList" | ||||||
|         ></area-product-list> |         ></area-product-list> | ||||||
|       </view> |       </view> | ||||||
|     </view> |     </view> | ||||||
|  | @ -94,6 +98,11 @@ export default { | ||||||
|         } |         } | ||||||
|       }) |       }) | ||||||
|     }, |     }, | ||||||
|  |     redirectList(item) { | ||||||
|  |       uni.navigateTo({ | ||||||
|  |         url: `/pages/specialArea/list?specialArea=${item.specialArea}&id=${item.pkId}`, | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|   }, |   }, | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|  | @ -152,6 +152,13 @@ | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
| import * as api from '@/config/goods' | import * as api from '@/config/goods' | ||||||
|  | import { | ||||||
|  |   REGIEST_AREA, | ||||||
|  |   UPGRADE_AREA, | ||||||
|  |   REPURCHASE_AREA, | ||||||
|  |   REISSUE_AREA, | ||||||
|  | } from '@/util/specialAreaMap' | ||||||
|  | import { MEMBER_SIGN } from '@/util/common' | ||||||
| 
 | 
 | ||||||
| export default { | export default { | ||||||
|   data() { |   data() { | ||||||
|  | @ -345,8 +352,9 @@ export default { | ||||||
|       }) |       }) | ||||||
|       uni.setStorageSync('allGoods', JSON.stringify(shoppArr)) |       uni.setStorageSync('allGoods', JSON.stringify(shoppArr)) | ||||||
|       if ( |       if ( | ||||||
|         this.goodsCheck[0].specialArea == 1 || |         [REGIEST_AREA.id, UPGRADE_AREA.id].includes( | ||||||
|         this.goodsCheck[0].specialArea == 24 |           this.goodsCheck[0].specialArea | ||||||
|  |         ) | ||||||
|       ) { |       ) { | ||||||
|         let deleteList = [] |         let deleteList = [] | ||||||
|         shoppArr.forEach(item => { |         shoppArr.forEach(item => { | ||||||
|  | @ -430,22 +438,6 @@ export default { | ||||||
|               }) |               }) | ||||||
|             } |             } | ||||||
|           } |           } | ||||||
|         } else if (this.goodsCheck[0].specialArea == 31) { |  | ||||||
|           if (this.totalPrice < 1000) { |  | ||||||
|             uni.showToast({ |  | ||||||
|               title: '购买商品总价格不能低于1000元', |  | ||||||
|               icon: 'none', |  | ||||||
|               duration: 1500, |  | ||||||
|             }) |  | ||||||
|           } else { |  | ||||||
|             uni.navigateTo({ |  | ||||||
|               url: |  | ||||||
|                 '/pages/other/index?specialArea=' + |  | ||||||
|                 this.goodsCheck[0].specialArea + |  | ||||||
|                 '&shoppArr=' + |  | ||||||
|                 JSON.stringify(shoppArr), |  | ||||||
|             }) |  | ||||||
|           } |  | ||||||
|         } else { |         } else { | ||||||
|           uni.navigateTo({ |           uni.navigateTo({ | ||||||
|             url: |             url: | ||||||
|  |  | ||||||
|  | @ -49,3 +49,5 @@ export const getUpgradeLevel = params => | ||||||
| // 下单前校验
 | // 下单前校验
 | ||||||
| export const validRelation = params => | export const validRelation = params => | ||||||
|   http.post('sale/api/retail-order/valid-relation', { params }) |   http.post('sale/api/retail-order/valid-relation', { params }) | ||||||
|  | 
 | ||||||
|  | // 升级订单
 | ||||||
|  |  | ||||||
|  | @ -20,7 +20,7 @@ module.exports = vm => { | ||||||
| 
 | 
 | ||||||
|     //#ifdef DEV_SERVER
 |     //#ifdef DEV_SERVER
 | ||||||
|     console.log('DEV_SERVER') |     console.log('DEV_SERVER') | ||||||
|     config.baseURL = 'http://192.168.0.100:8080' |     config.baseURL = 'http://192.168.0.102:8080' | ||||||
|     //#endif
 |     //#endif
 | ||||||
| 
 | 
 | ||||||
|     //#ifdef QA_SERVER
 |     //#ifdef QA_SERVER
 | ||||||
|  |  | ||||||
|  | @ -0,0 +1,22 @@ | ||||||
|  | const http = uni.$u.http | ||||||
|  | 
 | ||||||
|  | // 获取分享码
 | ||||||
|  | export const getShareCode = params => | ||||||
|  |   http.get('/member/api/share/share-code', { params }) | ||||||
|  | 
 | ||||||
|  | // 根据短码获取memberCode
 | ||||||
|  | export const getMemberCode = code => | ||||||
|  |   http.get(`/member/api/share/find-share-code/${code}`) | ||||||
|  | 
 | ||||||
|  | // 获取手机验证码
 | ||||||
|  | export const getPhoneCode = params => | ||||||
|  |   http.get('/member/api/share/share-sms-code', { params }) | ||||||
|  | 
 | ||||||
|  | // 注册
 | ||||||
|  | 
 | ||||||
|  | export const getRegister = data => | ||||||
|  |   http.post('/member/api/share/share-register', data) | ||||||
|  | 
 | ||||||
|  | // 自动登录
 | ||||||
|  | export const autoLogin = data => | ||||||
|  |   http.post('/retail-member/api/retail-auth/auto-login', data) | ||||||
|  | @ -17,6 +17,7 @@ | ||||||
|         "js-cookie": "^3.0.5", |         "js-cookie": "^3.0.5", | ||||||
|         "qrcodejs2": "0.0.2", |         "qrcodejs2": "0.0.2", | ||||||
|         "swiper": "^3.4.2", |         "swiper": "^3.4.2", | ||||||
|  |         "uqrcodejs": "^4.0.7", | ||||||
|         "vue-clipboard2": "^0.3.3", |         "vue-clipboard2": "^0.3.3", | ||||||
|         "vue-i18n": "^9.2.2", |         "vue-i18n": "^9.2.2", | ||||||
|         "vue-tree-color": "^2.3.2", |         "vue-tree-color": "^2.3.2", | ||||||
|  | @ -6373,6 +6374,12 @@ | ||||||
|         "yarn": "*" |         "yarn": "*" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |     "node_modules/uqrcodejs": { | ||||||
|  |       "version": "4.0.7", | ||||||
|  |       "resolved": "https://registry.npmjs.org/uqrcodejs/-/uqrcodejs-4.0.7.tgz", | ||||||
|  |       "integrity": "sha512-84+aZmD2godCVI+93lxE3YUAPNY8zAJvNA7xRS7R7U+q57KzMDepBSfNCwoRUhWOfR6eHFoAOcHRPwsP6ka1cA==", | ||||||
|  |       "license": "Apache-2.0" | ||||||
|  |     }, | ||||||
|     "node_modules/uri-js": { |     "node_modules/uri-js": { | ||||||
|       "version": "4.4.1", |       "version": "4.4.1", | ||||||
|       "resolved": "https://mirrors.cloud.tencent.com/npm/uri-js/-/uri-js-4.4.1.tgz", |       "resolved": "https://mirrors.cloud.tencent.com/npm/uri-js/-/uri-js-4.4.1.tgz", | ||||||
|  |  | ||||||
|  | @ -12,6 +12,7 @@ | ||||||
|     "js-cookie": "^3.0.5", |     "js-cookie": "^3.0.5", | ||||||
|     "qrcodejs2": "0.0.2", |     "qrcodejs2": "0.0.2", | ||||||
|     "swiper": "^3.4.2", |     "swiper": "^3.4.2", | ||||||
|  |     "uqrcodejs": "^4.0.7", | ||||||
|     "vue-clipboard2": "^0.3.3", |     "vue-clipboard2": "^0.3.3", | ||||||
|     "vue-i18n": "^9.2.2", |     "vue-i18n": "^9.2.2", | ||||||
|     "vue-tree-color": "^2.3.2", |     "vue-tree-color": "^2.3.2", | ||||||
|  |  | ||||||
							
								
								
									
										10
									
								
								pages.json
								
								
								
								
							
							
						
						
									
										10
									
								
								pages.json
								
								
								
								
							|  | @ -262,10 +262,14 @@ | ||||||
|       "path": "pages/shareRegist/index", |       "path": "pages/shareRegist/index", | ||||||
|       "style": { |       "style": { | ||||||
|         "navigationBarTitleText": "注册", |         "navigationBarTitleText": "注册", | ||||||
|         "navigationBarBackgroundColor": "#F33030", |         "navigationBarBackgroundColor": "#fff" | ||||||
|         "app-plus": { |  | ||||||
|           "titleNView": false |  | ||||||
|       } |       } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |       "path": "pages/mine/share/index", | ||||||
|  |       "style": { | ||||||
|  |         "navigationBarTitleText": "个人推广二维码", | ||||||
|  |         "navigationBarBackgroundColor": "#fff" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|  |  | ||||||
|  | @ -403,6 +403,13 @@ export default { | ||||||
|           menuKey: 'selfHelp', |           menuKey: 'selfHelp', | ||||||
|           ifshow: false, |           ifshow: false, | ||||||
|         }, |         }, | ||||||
|  |         { | ||||||
|  |           url: '/pages/mine/share/index', | ||||||
|  |           name: '个人推广', | ||||||
|  |           imgurl: '../../static/images/promotion.svg', | ||||||
|  |           menuKey: 'share', | ||||||
|  |           ifshow: true, | ||||||
|  |         }, | ||||||
|         { |         { | ||||||
|           url: '/pages/userSecure/index', |           url: '/pages/userSecure/index', | ||||||
|           name: '账号安全', |           name: '账号安全', | ||||||
|  |  | ||||||
|  | @ -0,0 +1,456 @@ | ||||||
|  | <template> | ||||||
|  |   <view class="share-container"> | ||||||
|  |     <!-- This is the content that will be shared as an image --> | ||||||
|  |     <view class="share-content" :class="{ 'is-loaded': isLoaded }"> | ||||||
|  |       <view class="title">扫码注册</view> | ||||||
|  |       <image | ||||||
|  |         class="qr-code" | ||||||
|  |         :src="qrCodeImage" | ||||||
|  |         mode="aspectFit" | ||||||
|  |         v-if="qrCodeImage" | ||||||
|  |       ></image> | ||||||
|  |       <view v-else class="qr-code-placeholder"> | ||||||
|  |         <view class="loader"></view> | ||||||
|  |       </view> | ||||||
|  |       <view class="tip">扫描二维码,即可完成操作</view> | ||||||
|  |     </view> | ||||||
|  | 
 | ||||||
|  |     <button | ||||||
|  |       class="share-button" | ||||||
|  |       :class="{ 'is-loaded': isLoaded }" | ||||||
|  |       @click="sharePage" | ||||||
|  |     > | ||||||
|  |       保存图片并分享 | ||||||
|  |     </button> | ||||||
|  | 
 | ||||||
|  |     <!-- Canvas for generating the share image, positioned off-screen --> | ||||||
|  |     <canvas | ||||||
|  |       canvas-id="shareCanvas" | ||||||
|  |       :style="{ | ||||||
|  |         width: canvasWidth + 'px', | ||||||
|  |         height: canvasHeight + 'px', | ||||||
|  |         position: 'fixed', | ||||||
|  |         left: '200%', | ||||||
|  |       }" | ||||||
|  |     /> | ||||||
|  |   </view> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  | import { getShareCode } from '@/config/share' | ||||||
|  | 
 | ||||||
|  | export default { | ||||||
|  |   name: 'ShareQRCode', | ||||||
|  |   data() { | ||||||
|  |     return { | ||||||
|  |       qrCodeImage: '', | ||||||
|  |       // Set canvas dimensions. It's better to get device screen width for this. | ||||||
|  |       canvasWidth: 375, | ||||||
|  |       canvasHeight: 550, | ||||||
|  |       isLoaded: false, | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   onLoad() { | ||||||
|  |     this.handleGetShareCode() | ||||||
|  |     // Get screen width to set canvas width dynamically | ||||||
|  |     uni.getSystemInfo({ | ||||||
|  |       success: res => { | ||||||
|  |         this.canvasWidth = res.windowWidth | ||||||
|  |         // Adjust height proportionally or keep it fixed | ||||||
|  |         this.canvasHeight = res.windowWidth * 1.4 | ||||||
|  |       }, | ||||||
|  |     }) | ||||||
|  |   }, | ||||||
|  |   onReady() { | ||||||
|  |     // Use a short timeout to ensure the initial render is complete before animation | ||||||
|  |     setTimeout(() => { | ||||||
|  |       this.isLoaded = true | ||||||
|  |     }, 100) | ||||||
|  |   }, | ||||||
|  |   methods: { | ||||||
|  |     handleGetShareCode() { | ||||||
|  |       // Don't show loading toast, use the placeholder loader instead | ||||||
|  |       // uni.showLoading({ title: '加载中...' }) | ||||||
|  |       getShareCode() | ||||||
|  |         .then(res => { | ||||||
|  |           // The screenshot shows the base64 string is in data.datStr | ||||||
|  |           if (res.code === 200 && res.data && res.data.dataStr) { | ||||||
|  |             this.qrCodeImage = 'data:image/png;base64,' + res.data.dataStr | ||||||
|  |           } else { | ||||||
|  |             uni.showToast({ | ||||||
|  |               title: '获取分享码失败', | ||||||
|  |               icon: 'none', | ||||||
|  |             }) | ||||||
|  |           } | ||||||
|  |         }) | ||||||
|  |         .catch(err => { | ||||||
|  |           console.error('getShareCode error:', err) | ||||||
|  |           uni.showToast({ | ||||||
|  |             title: '网络错误,请稍后再试', | ||||||
|  |             icon: 'none', | ||||||
|  |           }) | ||||||
|  |         }) | ||||||
|  |     }, | ||||||
|  | 
 | ||||||
|  |     async sharePage() { | ||||||
|  |       if (!this.qrCodeImage) { | ||||||
|  |         uni.showToast({ | ||||||
|  |           title: '二维码尚未生成', | ||||||
|  |           icon: 'none', | ||||||
|  |         }) | ||||||
|  |         return | ||||||
|  |       } | ||||||
|  |       uni.showLoading({ title: '正在生成图片...' }) | ||||||
|  | 
 | ||||||
|  |       try { | ||||||
|  |         const tempImagePath = await this.base64ToTempFilePath(this.qrCodeImage) | ||||||
|  |         if (!tempImagePath) { | ||||||
|  |           throw new Error('图片处理失败') | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         const ctx = uni.createCanvasContext('shareCanvas', this) | ||||||
|  |         this.drawShareImage(ctx, tempImagePath) | ||||||
|  | 
 | ||||||
|  |         ctx.draw(false, () => { | ||||||
|  |           this.saveCanvasToAlbum() | ||||||
|  |         }) | ||||||
|  |       } catch (error) { | ||||||
|  |         uni.hideLoading() | ||||||
|  |         uni.showToast({ title: error.message || '图片生成失败', icon: 'none' }) | ||||||
|  |         console.error('sharePage error:', error) | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  | 
 | ||||||
|  |     drawShareImage(ctx, tempImagePath) { | ||||||
|  |       const canvasWidth = this.canvasWidth | ||||||
|  |       const canvasHeight = this.canvasHeight | ||||||
|  | 
 | ||||||
|  |       // White background | ||||||
|  |       ctx.fillStyle = '#FFFFFF' | ||||||
|  |       ctx.fillRect(0, 0, canvasWidth, canvasHeight) | ||||||
|  | 
 | ||||||
|  |       // Title | ||||||
|  |       ctx.setFontSize(22) | ||||||
|  |       ctx.fillStyle = '#1e1e1e' | ||||||
|  |       ctx.textAlign = 'center' | ||||||
|  |       ctx.fillText('扫码注册', canvasWidth / 2, 70) | ||||||
|  | 
 | ||||||
|  |       // QR Code Image | ||||||
|  |       const qrCodeSize = canvasWidth * 0.7 | ||||||
|  |       const qrCodeX = (canvasWidth - qrCodeSize) / 2 | ||||||
|  |       const qrCodeY = 120 | ||||||
|  |       ctx.drawImage(tempImagePath, qrCodeX, qrCodeY, qrCodeSize, qrCodeSize) | ||||||
|  | 
 | ||||||
|  |       // Tip text | ||||||
|  |       ctx.setFontSize(15) | ||||||
|  |       ctx.fillStyle = '#888' | ||||||
|  |       ctx.textAlign = 'center' | ||||||
|  |       ctx.fillText( | ||||||
|  |         '扫描二维码,即可完成操作', | ||||||
|  |         canvasWidth / 2, | ||||||
|  |         qrCodeY + qrCodeSize + 50 | ||||||
|  |       ) | ||||||
|  |     }, | ||||||
|  | 
 | ||||||
|  |     saveCanvasToAlbum() { | ||||||
|  |       uni.canvasToTempFilePath( | ||||||
|  |         { | ||||||
|  |           canvasId: 'shareCanvas', | ||||||
|  |           success: res => { | ||||||
|  |             // #ifdef H5 | ||||||
|  |             // For H5, trigger download instead of saving to album | ||||||
|  |             const link = document.createElement('a') | ||||||
|  |             link.href = res.tempFilePath | ||||||
|  |             link.download = `share_qrcode_${Date.now()}.png` | ||||||
|  |             document.body.appendChild(link) | ||||||
|  |             link.click() | ||||||
|  |             document.body.removeChild(link) | ||||||
|  |             uni.hideLoading() | ||||||
|  |             uni.showToast({ | ||||||
|  |               title: '图片已开始下载', | ||||||
|  |               icon: 'success', | ||||||
|  |             }) | ||||||
|  |             // #endif | ||||||
|  | 
 | ||||||
|  |             // #ifndef H5 | ||||||
|  |             // For App and Mini Programs | ||||||
|  |             uni.saveImageToPhotosAlbum({ | ||||||
|  |               filePath: res.tempFilePath, | ||||||
|  |               success: () => { | ||||||
|  |                 uni.hideLoading() | ||||||
|  |                 uni.showToast({ | ||||||
|  |                   title: '图片已保存到相册', | ||||||
|  |                   icon: 'success', | ||||||
|  |                 }) | ||||||
|  |               }, | ||||||
|  |               fail: err => { | ||||||
|  |                 uni.hideLoading() | ||||||
|  |                 if ( | ||||||
|  |                   err.errMsg && | ||||||
|  |                   (err.errMsg.includes('auth deny') || | ||||||
|  |                     err.errMsg.includes('auth denied')) | ||||||
|  |                 ) { | ||||||
|  |                   uni.showModal({ | ||||||
|  |                     title: '提示', | ||||||
|  |                     content: '需要您授权保存相册', | ||||||
|  |                     showCancel: false, | ||||||
|  |                     success: () => { | ||||||
|  |                       uni.openSetting({ | ||||||
|  |                         success(settingdata) { | ||||||
|  |                           if ( | ||||||
|  |                             settingdata.authSetting['scope.writePhotosAlbum'] | ||||||
|  |                           ) { | ||||||
|  |                             uni.showToast({ | ||||||
|  |                               title: '授权成功,请重试', | ||||||
|  |                               icon: 'none', | ||||||
|  |                             }) | ||||||
|  |                           } else { | ||||||
|  |                             uni.showToast({ | ||||||
|  |                               title: '获取权限失败', | ||||||
|  |                               icon: 'none', | ||||||
|  |                             }) | ||||||
|  |                           } | ||||||
|  |                         }, | ||||||
|  |                       }) | ||||||
|  |                     }, | ||||||
|  |                   }) | ||||||
|  |                 } else { | ||||||
|  |                   uni.showToast({ title: '保存失败', icon: 'none' }) | ||||||
|  |                   console.error('saveImageToPhotosAlbum fail:', err) | ||||||
|  |                 } | ||||||
|  |               }, | ||||||
|  |             }) | ||||||
|  |             // #endif | ||||||
|  |           }, | ||||||
|  |           fail: err => { | ||||||
|  |             uni.hideLoading() | ||||||
|  |             uni.showToast({ title: '图片转换失败', icon: 'none' }) | ||||||
|  |             console.error('canvasToTempFilePath fail:', err) | ||||||
|  |           }, | ||||||
|  |         }, | ||||||
|  |         this | ||||||
|  |       ) | ||||||
|  |     }, | ||||||
|  | 
 | ||||||
|  |     base64ToTempFilePath(base64) { | ||||||
|  |       return new Promise((resolve, reject) => { | ||||||
|  |         // #ifdef H5 | ||||||
|  |         // For H5, we load the base64 into an Image to ensure it's valid, | ||||||
|  |         // but resolve with the base64 string to avoid Uniapp's internal errors | ||||||
|  |         // when its functions expect a string path instead of an Image object. | ||||||
|  |         const image = new Image() | ||||||
|  |         // Resolve CORS issue for QR code from different origin | ||||||
|  |         image.crossOrigin = 'Anonymous' | ||||||
|  |         image.src = base64 | ||||||
|  |         image.onload = () => { | ||||||
|  |           // Resolve with the string, not the object. | ||||||
|  |           resolve(base64) | ||||||
|  |         } | ||||||
|  |         image.onerror = err => { | ||||||
|  |           console.error('Failed to load image for canvas on H5', err) | ||||||
|  |           reject(new Error('H5图片加载失败')) | ||||||
|  |         } | ||||||
|  |         // #endif | ||||||
|  | 
 | ||||||
|  |         // #ifndef H5 | ||||||
|  |         // For App and Mini Programs, write to a temp file and return the path. | ||||||
|  |         const formattedBase64 = base64.replace(/^data:image\/\w+;base64,/, '') | ||||||
|  |         // Use a standard path for user data directory. | ||||||
|  |         const filePath = `${uni.env.USER_DATA_PATH}/share_${Date.now()}.png` | ||||||
|  |         uni.getFileSystemManager().writeFile({ | ||||||
|  |           filePath, | ||||||
|  |           data: formattedBase64, | ||||||
|  |           encoding: 'base64', | ||||||
|  |           success: () => { | ||||||
|  |             resolve(filePath) | ||||||
|  |           }, | ||||||
|  |           fail: err => { | ||||||
|  |             console.error('Failed to write temp file', err) | ||||||
|  |             reject(new Error('临时文件写入失败')) | ||||||
|  |           }, | ||||||
|  |         }) | ||||||
|  |         // #endif | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|  |   }, | ||||||
|  | } | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <style lang="scss" scoped> | ||||||
|  | .share-container { | ||||||
|  |   display: flex; | ||||||
|  |   flex-direction: column; | ||||||
|  |   align-items: center; | ||||||
|  |   justify-content: center; | ||||||
|  |   padding: 40rpx; | ||||||
|  |   background: linear-gradient(to bottom, #e0f7fa 0%, #ffffff 100%); | ||||||
|  |   min-height: 100vh; | ||||||
|  |   box-sizing: border-box; | ||||||
|  |   position: relative; | ||||||
|  |   overflow: hidden; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | @keyframes float { | ||||||
|  |   0% { | ||||||
|  |     transform: translateY(0px) scale(1); | ||||||
|  |     opacity: 0.7; | ||||||
|  |   } | ||||||
|  |   50% { | ||||||
|  |     transform: translateY(-20px) scale(1.03); | ||||||
|  |     opacity: 1; | ||||||
|  |   } | ||||||
|  |   100% { | ||||||
|  |     transform: translateY(0px) scale(1); | ||||||
|  |     opacity: 0.7; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .share-container::before, | ||||||
|  | .share-container::after { | ||||||
|  |   content: ''; | ||||||
|  |   position: absolute; | ||||||
|  |   border-radius: 50%; | ||||||
|  |   background: linear-gradient( | ||||||
|  |     to top, | ||||||
|  |     rgba(0, 198, 255, 0.05), | ||||||
|  |     rgba(0, 114, 255, 0.1) | ||||||
|  |   ); | ||||||
|  |   z-index: 1; | ||||||
|  |   pointer-events: none; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .share-container::before { | ||||||
|  |   width: 400rpx; | ||||||
|  |   height: 400rpx; | ||||||
|  |   top: -150rpx; | ||||||
|  |   left: -150rpx; | ||||||
|  |   animation: float 12s ease-in-out infinite; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .share-container::after { | ||||||
|  |   width: 500rpx; | ||||||
|  |   height: 500rpx; | ||||||
|  |   bottom: -200rpx; | ||||||
|  |   right: -200rpx; | ||||||
|  |   animation: float 15s ease-in-out infinite -5s; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .share-content { | ||||||
|  |   background: radial-gradient( | ||||||
|  |     circle at 50% 0%, | ||||||
|  |     rgba(220, 235, 255, 0.9), | ||||||
|  |     #ffffff 80% | ||||||
|  |   ); | ||||||
|  |   border-radius: 30rpx; | ||||||
|  |   padding: 80rpx 50rpx; | ||||||
|  |   display: flex; | ||||||
|  |   flex-direction: column; | ||||||
|  |   align-items: center; | ||||||
|  |   width: 100%; | ||||||
|  |   box-shadow: | ||||||
|  |     0 16rpx 48rpx rgba(0, 0, 0, 0.1), | ||||||
|  |     inset 0 1px 2px rgba(255, 255, 255, 0.7); | ||||||
|  |   margin-bottom: 60rpx; | ||||||
|  |   position: relative; | ||||||
|  |   z-index: 2; | ||||||
|  |   opacity: 0; | ||||||
|  |   transform: translateY(40rpx); | ||||||
|  |   transition: | ||||||
|  |     transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), | ||||||
|  |     opacity 0.6s ease; | ||||||
|  |   overflow: hidden; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .share-content::before { | ||||||
|  |   content: ''; | ||||||
|  |   position: absolute; | ||||||
|  |   top: 0; | ||||||
|  |   left: 0; | ||||||
|  |   right: 0; | ||||||
|  |   height: 6rpx; | ||||||
|  |   background-image: linear-gradient(90deg, #00c6ff, #0072ff); | ||||||
|  |   opacity: 0.9; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .share-content.is-loaded { | ||||||
|  |   opacity: 1; | ||||||
|  |   transform: translateY(0); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .title { | ||||||
|  |   font-size: 44rpx; | ||||||
|  |   font-weight: 500; | ||||||
|  |   color: #1e1e1e; | ||||||
|  |   margin-bottom: 60rpx; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .qr-code { | ||||||
|  |   width: 450rpx; | ||||||
|  |   height: 450rpx; | ||||||
|  |   margin-bottom: 30rpx; | ||||||
|  |   border-radius: 16rpx; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .qr-code-placeholder { | ||||||
|  |   width: 450rpx; | ||||||
|  |   height: 450rpx; | ||||||
|  |   background-color: #f0f2f5; | ||||||
|  |   display: flex; | ||||||
|  |   align-items: center; | ||||||
|  |   justify-content: center; | ||||||
|  |   margin-bottom: 30rpx; | ||||||
|  |   border-radius: 16rpx; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .loader { | ||||||
|  |   width: 100rpx; | ||||||
|  |   height: 100rpx; | ||||||
|  |   border: 8rpx solid rgba(0, 0, 0, 0.1); | ||||||
|  |   border-left-color: #0072ff; | ||||||
|  |   border-radius: 50%; | ||||||
|  |   animation: spin 1s linear infinite; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | @keyframes spin { | ||||||
|  |   to { | ||||||
|  |     transform: rotate(360deg); | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .tip { | ||||||
|  |   font-size: 30rpx; | ||||||
|  |   color: #888; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .share-button { | ||||||
|  |   margin-top: 0; | ||||||
|  |   width: 90%; | ||||||
|  |   background-image: linear-gradient(90deg, #0072ff, #00c6ff); | ||||||
|  |   color: white; | ||||||
|  |   border-radius: 50rpx; | ||||||
|  |   font-size: 34rpx; | ||||||
|  |   height: 100rpx; | ||||||
|  |   line-height: 100rpx; | ||||||
|  |   box-shadow: 0 10rpx 20rpx rgba(0, 114, 255, 0.25); | ||||||
|  |   border: none; | ||||||
|  |   transition: | ||||||
|  |     transform 0.2s ease, | ||||||
|  |     box-shadow 0.2s ease; | ||||||
|  |   z-index: 2; | ||||||
|  |   opacity: 0; | ||||||
|  |   transform: translateY(40rpx); | ||||||
|  |   transition: | ||||||
|  |     transform 0.6s cubic-bezier(0.25, 1, 0.5, 1) 0.1s, | ||||||
|  |     opacity 0.6s ease 0.1s; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .share-button.is-loaded { | ||||||
|  |   opacity: 1; | ||||||
|  |   transform: translateY(0); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .share-button:active { | ||||||
|  |   transform: translateY(2rpx); | ||||||
|  |   box-shadow: 0 6rpx 12rpx rgba(0, 114, 255, 0.3); | ||||||
|  | } | ||||||
|  | </style> | ||||||
|  | @ -18,7 +18,7 @@ | ||||||
|     </view> --> |     </view> --> | ||||||
|     <view class="context"> |     <view class="context"> | ||||||
|       <u-form :model="form" labelWidth="75" :rules="rules" ref="uForm"> |       <u-form :model="form" labelWidth="75" :rules="rules" ref="uForm"> | ||||||
|         <u-form-item :label="'申请级别'" borderBottom prop="pkGradeVal"> |         <u-form-item :label="formLevelLabel" borderBottom prop="pkGradeVal"> | ||||||
|           <u-input |           <u-input | ||||||
|             v-model="form.pkGradeVal" |             v-model="form.pkGradeVal" | ||||||
|             border="none" |             border="none" | ||||||
|  | @ -26,47 +26,59 @@ | ||||||
|             disabled |             disabled | ||||||
|           /> |           /> | ||||||
|         </u-form-item> |         </u-form-item> | ||||||
|         <!-- <u-form-item |         <u-form-item | ||||||
|           :label="'自然国家'" |           v-show="isRegiest" | ||||||
|           @tap="changeCountry(0)" |           :label="'推荐编号'" | ||||||
|  |           required | ||||||
|           borderBottom |           borderBottom | ||||||
|  |           prop="parent" | ||||||
|         > |         > | ||||||
|           <view class="disFlex justBwn"> |  | ||||||
|             <view class="disFlex"> |  | ||||||
|               <img class="countImg" :src="form.pkCountryImg" alt="" /> |  | ||||||
|               <view>{{ form.pkCountryLabel }}</view> |  | ||||||
|             </view> |  | ||||||
|             <u-icon name="arrow-right"></u-icon> |  | ||||||
|           </view> |  | ||||||
|         </u-form-item> --> |  | ||||||
| 
 |  | ||||||
|         <!-- @tap="changeCountry(1)" --> |  | ||||||
|         <!-- <u-form-item :label="'结算国家'" borderBottom> |  | ||||||
|           <view class="disFlex justBwn"> |  | ||||||
|             <view class="disFlex"> |  | ||||||
|               <img class="countImg" :src="form.pkSettleCountryImg" alt="" /> |  | ||||||
|               <view>{{ form.pkSettleCountryLabel }}</view> |  | ||||||
|             </view> |  | ||||||
|             <u-icon name="arrow-right"></u-icon> |  | ||||||
|           </view> |  | ||||||
|         </u-form-item> --> |  | ||||||
|         <u-form-item :label="'推荐编号'" required borderBottom prop="parent"> |  | ||||||
|           <u-input |           <u-input | ||||||
|             v-model="form.parent" |             v-model="form.parent" | ||||||
|             @blur="getValidPcode()" |             @blur="getValidPcode()" | ||||||
|             border="none" |             border="none" | ||||||
|           /> |           /> | ||||||
|         </u-form-item> |         </u-form-item> | ||||||
|         <u-form-item :label="'推荐姓名'" borderBottom prop="parentName"> |         <u-form-item | ||||||
|  |           v-show="isRegiest" | ||||||
|  |           :label="'推荐姓名'" | ||||||
|  |           borderBottom | ||||||
|  |           prop="parentName" | ||||||
|  |         > | ||||||
|           <u-input v-model="form.parentName" disabled border="none" /> |           <u-input v-model="form.parentName" disabled border="none" /> | ||||||
|         </u-form-item> |         </u-form-item> | ||||||
| 
 |         <u-form-item | ||||||
|         <u-form-item label="会员昵称" required borderBottom prop="memberName"> |           v-if="!isRegiest" | ||||||
|           <u-input :maxlength="40" v-model="form.memberName" border="none" /> |           label="会员编号" | ||||||
|  |           required | ||||||
|  |           borderBottom | ||||||
|  |           prop="memberCode" | ||||||
|  |         > | ||||||
|  |           <u-input | ||||||
|  |             :disabled="isRegiest" | ||||||
|  |             :maxlength="40" | ||||||
|  |             v-model="form.memberCode" | ||||||
|  |             border="none" | ||||||
|  |           /> | ||||||
|         </u-form-item> |         </u-form-item> | ||||||
|         <u-form-item :label="'联系方式'" required borderBottom prop="phone"> |         <u-form-item label="会员昵称" required borderBottom prop="memberName"> | ||||||
|  |           <u-input | ||||||
|  |             :disabled="isRegiest" | ||||||
|  |             :maxlength="40" | ||||||
|  |             v-model="form.memberName" | ||||||
|  |             border="none" | ||||||
|  |           /> | ||||||
|  |         </u-form-item> | ||||||
|  |         <u-form-item | ||||||
|  |           v-show="isRegiest" | ||||||
|  |           :label="'联系方式'" | ||||||
|  |           required | ||||||
|  |           borderBottom | ||||||
|  |           prop="phone" | ||||||
|  |         > | ||||||
|           <u-input |           <u-input | ||||||
|             v-model="form.phone" |             v-model="form.phone" | ||||||
|  |             :disabled="isRegiest" | ||||||
|             maxlength="11" |             maxlength="11" | ||||||
|             type="number" |             type="number" | ||||||
|             border="none" |             border="none" | ||||||
|  | @ -366,14 +378,7 @@ | ||||||
|       :columns="countryList" |       :columns="countryList" | ||||||
|       keyName="label" |       keyName="label" | ||||||
|     ></u-picker> |     ></u-picker> | ||||||
|     <!-- 选择安置位置 --> | 
 | ||||||
|     <u-picker |  | ||||||
|       :show="isPlace" |  | ||||||
|       @cancel="isPlace = false" |  | ||||||
|       @confirm="surePlace" |  | ||||||
|       :columns="placeList" |  | ||||||
|       keyName="label" |  | ||||||
|     ></u-picker> |  | ||||||
|     <!-- 发货方式 --> |     <!-- 发货方式 --> | ||||||
|     <u-picker |     <u-picker | ||||||
|       :show="isDelivery" |       :show="isDelivery" | ||||||
|  | @ -467,19 +472,6 @@ export default { | ||||||
|       isDelivery: false, |       isDelivery: false, | ||||||
|       isBank: false, |       isBank: false, | ||||||
|       isTrans: false, |       isTrans: false, | ||||||
|       placeList: [ |  | ||||||
|         [ |  | ||||||
|           { |  | ||||||
|             id: 1, |  | ||||||
|             label: '安置左区', |  | ||||||
|           }, |  | ||||||
|           { |  | ||||||
|             id: 2, |  | ||||||
|             label: '安置右区', |  | ||||||
|           }, |  | ||||||
|         ], |  | ||||||
|       ], |  | ||||||
|       isPlace: false, |  | ||||||
|       countryIndex: 0, |       countryIndex: 0, | ||||||
|       isCountry: false, |       isCountry: false, | ||||||
|       userInfo: '', |       userInfo: '', | ||||||
|  | @ -614,6 +606,14 @@ export default { | ||||||
|       selTable: [], |       selTable: [], | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|  |   computed: { | ||||||
|  |     formLevelLabel() { | ||||||
|  |       return this.specialArea == UPGRADE_AREA.id ? '升级级别' : '申请级别' | ||||||
|  |     }, | ||||||
|  |     isRegiest() { | ||||||
|  |       return this.specialArea == REGIEST_AREA.id | ||||||
|  |     }, | ||||||
|  |   }, | ||||||
|   onLoad(options) { |   onLoad(options) { | ||||||
|     const user = uni.getStorageSync('User') |     const user = uni.getStorageSync('User') | ||||||
|     this.pkCountry = user.pkSettleCountry |     this.pkCountry = user.pkSettleCountry | ||||||
|  | @ -805,8 +805,7 @@ export default { | ||||||
|       // this.allGoodsData.deleteList = deleteList |       // this.allGoodsData.deleteList = deleteList | ||||||
|       // console.log(this.shoppingArr, '....allGoodsData') |       // console.log(this.shoppingArr, '....allGoodsData') | ||||||
|       // return |       // return | ||||||
|       api |       const params = { | ||||||
|         .memLevel({ |  | ||||||
|         firstCheck: 0, |         firstCheck: 0, | ||||||
|         specialArea: this.specialArea, |         specialArea: this.specialArea, | ||||||
|         shopList: this.shoppingArr.map(id => { |         shopList: this.shoppingArr.map(id => { | ||||||
|  | @ -814,9 +813,22 @@ export default { | ||||||
|             shoppingId: id, |             shoppingId: id, | ||||||
|           } |           } | ||||||
|         }), |         }), | ||||||
|         }) |       } | ||||||
|         .then(res => { |       if (this.specialArea == UPGRADE_AREA.id) { | ||||||
|  |         params.upgradeMemberCode = this.form.parent | ||||||
|  |       } | ||||||
|  |       api.memLevel(params).then(res => { | ||||||
|  |         if (res.code == 200) { | ||||||
|  |           if (res.data.isEnough) { | ||||||
|             this.form.pkGradeVal = res.data.pkGradeVal |             this.form.pkGradeVal = res.data.pkGradeVal | ||||||
|  |           } else { | ||||||
|  |             this.form.pkGradeVal = '' | ||||||
|  |             uni.showToast({ | ||||||
|  |               title: res.data.msg, | ||||||
|  |               icon: 'none', | ||||||
|  |             }) | ||||||
|  |           } | ||||||
|  |         } | ||||||
|       }) |       }) | ||||||
|     }, |     }, | ||||||
|     checkAddress() {}, |     checkAddress() {}, | ||||||
|  |  | ||||||
|  | @ -5,89 +5,80 @@ | ||||||
|  * @Date: 2022-11-21 15:11:22 |  * @Date: 2022-11-21 15:11:22 | ||||||
| --> | --> | ||||||
| <template> | <template> | ||||||
|   <view > |   <view> | ||||||
|     <view v-if="!pkCountry" class="content1"> |     <view v-if="!pkCountry" class="content1"> | ||||||
|       <!-- <view class="index_header"> |       <!-- <view class="index_header"> | ||||||
|       <view>注册</view> |       <view>注册</view> | ||||||
|     </view> --> |     </view> --> | ||||||
|  |       <view class="title">欢迎注册</view> | ||||||
|       <!-- <view class="tit" v-if="!pkCountry">{{ '嗨粉扫天下' }}</view> --> |       <!-- <view class="tit" v-if="!pkCountry">{{ '嗨粉扫天下' }}</view> --> | ||||||
|       <!-- 海粉 --> |       <!-- 海粉 --> | ||||||
|     <view class="formed1" |       <view class="formed1"> | ||||||
|          > |         <u-form :model="form" labelWidth="90px" ref="uForm" :rules="rules"> | ||||||
|       <u-form :model="form" |           <u-form-item label="推荐编号" prop="parentCode"> | ||||||
|               labelWidth="80px" |             <u-input v-model="form.parentCode" disabled> </u-input> | ||||||
|               ref="uForm" |           </u-form-item> | ||||||
|               :rules="rules"> |           <u-form-item label="会员姓名" prop="memberName"> | ||||||
|         <u-form-item label="" |             <u-input | ||||||
|                      prop="memberCode"> |               v-model="form.memberName" | ||||||
|           <u-input v-model="form.memberCode" |               :placeholder="'请输入会员姓名'" | ||||||
|  |             /> | ||||||
|  |           </u-form-item> | ||||||
|  |           <u-form-item label="联系方式" prop="phone"> | ||||||
|  |             <u-input | ||||||
|  |               v-model="form.phone" | ||||||
|  |               :placeholder="'请输入联系方式'" | ||||||
|               type="number" |               type="number" | ||||||
|                    disabled> |               maxlength="20" | ||||||
|             <u--text :text="howHeader" |             /> | ||||||
|                      slot="prefix" |  | ||||||
|                      margin="0 3px 0 0" |  | ||||||
|                      type="tips"></u--text> |  | ||||||
|           </u-input> |  | ||||||
|         </u-form-item> |  | ||||||
|         <u-form-item label="" |  | ||||||
|                      prop="memberName"> |  | ||||||
|           <u-input v-model="form.memberName" |  | ||||||
|           :placeholder="'请输入会员姓名'" /> |  | ||||||
|         </u-form-item> |  | ||||||
|         <u-form-item label="" |  | ||||||
|                      prop="phone"> |  | ||||||
|           <u-input v-model="form.phone" @blur="setMemberCode" |  | ||||||
|           :placeholder="'请输入联系方式'" type="number"  maxlength="20" /> |  | ||||||
|           </u-form-item> |           </u-form-item> | ||||||
| 
 | 
 | ||||||
|         <u-form-item label="" |           <u-form-item label="登录密码" prop="loginPwd"> | ||||||
|                      prop="loginPassword"> |             <u-input | ||||||
|           <u-input :password="isPwd" |               :password="isPwd" | ||||||
|               :placeholder="'请输入登录密码'" |               :placeholder="'请输入登录密码'" | ||||||
|                    v-model="form.loginPassword"> |               v-model="form.loginPwd" | ||||||
|             <template slot="suffix"> |             > | ||||||
|               <u-icon name="eye" |               <template #suffix> | ||||||
|                       @tap="isPwd=!isPwd" |                 <u-icon name="eye" @tap="isPwd = !isPwd" v-if="!isPwd"></u-icon> | ||||||
|                       v-if="!isPwd"></u-icon> |                 <u-icon name="eye-off" @tap="isPwd = !isPwd" v-else></u-icon> | ||||||
|               <u-icon name="eye-off" |  | ||||||
|                       @tap="isPwd=!isPwd" |  | ||||||
|                       v-else></u-icon> |  | ||||||
|               </template> |               </template> | ||||||
|             </u-input> |             </u-input> | ||||||
|           </u-form-item> |           </u-form-item> | ||||||
|         <u-form-item label="" |           <u-form-item label="支付密码" prop="payPwd"> | ||||||
|                      prop="payPassword"> |             <u-input | ||||||
|           <u-input :password="isPwd2" |               :password="isPwd2" | ||||||
|               :placeholder="'请输入支付密码'" |               :placeholder="'请输入支付密码'" | ||||||
|                    v-model="form.payPassword"> |               v-model="form.payPwd" | ||||||
|             <template slot="suffix"> |             > | ||||||
|               <u-icon name="eye" |               <template #suffix> | ||||||
|                       @tap="isPwd2=!isPwd2" |                 <u-icon | ||||||
|                       v-if="!isPwd2"></u-icon> |                   name="eye" | ||||||
|               <u-icon name="eye-off" |                   @tap="isPwd2 = !isPwd2" | ||||||
|                       @tap="isPwd2=!isPwd2" |                   v-if="!isPwd2" | ||||||
|                       v-else></u-icon> |                 ></u-icon> | ||||||
|  |                 <u-icon name="eye-off" @tap="isPwd2 = !isPwd2" v-else></u-icon> | ||||||
|               </template> |               </template> | ||||||
|             </u-input> |             </u-input> | ||||||
|           </u-form-item> |           </u-form-item> | ||||||
|         <u-form-item label="" |           <u-form-item label="验证码" prop="smsCode"> | ||||||
|                      prop="code"> |             <u-input v-model="form.smsCode" :placeholder="'请输入验证码'"> | ||||||
|           <u-input v-model="form.code" |               <template #suffix> | ||||||
|           :placeholder="'请输入验证码'"> |                 <view class="getCode" @tap="getVilCode">{{ getCode }}</view> | ||||||
|             <template slot="suffix"> |  | ||||||
|               <view class="getCode" |  | ||||||
|                     @tap="getVilCode">{{ getCode }}</view> |  | ||||||
|               </template> |               </template> | ||||||
|             </u-input> |             </u-input> | ||||||
|           </u-form-item> |           </u-form-item> | ||||||
|         </u-form> |         </u-form> | ||||||
|       <u-button type="success" |         <u-button | ||||||
|  |           type="success" | ||||||
|           class="uBtn" |           class="uBtn" | ||||||
|           shape="circle" |           shape="circle" | ||||||
|           color="linear-gradient(to right, #005BAC, #005BAC )" |           color="linear-gradient(to right, #005BAC, #005BAC )" | ||||||
|           :loading="isLoading" |           :loading="isLoading" | ||||||
|           :loadingText="'注册中'" |           :loadingText="'注册中'" | ||||||
|                 @click="toLogin">{{ '立即注册' }}</u-button> |           @click="toLogin" | ||||||
|  |           >{{ '立即注册' }}</u-button | ||||||
|  |         > | ||||||
|       </view> |       </view> | ||||||
|     </view> |     </view> | ||||||
|     <view v-else class="content"> |     <view v-else class="content"> | ||||||
|  | @ -139,10 +130,10 @@ | ||||||
|           </view> |           </view> | ||||||
|         </u-form-item> |         </u-form-item> | ||||||
|         <u-form-item label="" |         <u-form-item label="" | ||||||
|                      prop="loginPassword"> |                      prop="loginPwd"> | ||||||
|           <u-input :password="isPwd1" |           <u-input :password="isPwd1" | ||||||
|                    :placeholder="'请输入登录密码'" |                    :placeholder="'请输入登录密码'" | ||||||
|                    v-model="form.loginPassword"> |                    v-model="form.loginPwd"> | ||||||
|             <template slot="suffix"> |             <template slot="suffix"> | ||||||
|               <u-icon name="eye" |               <u-icon name="eye" | ||||||
|                       @tap="isPwd1=!isPwd1" |                       @tap="isPwd1=!isPwd1" | ||||||
|  | @ -154,10 +145,10 @@ | ||||||
|           </u-input> |           </u-input> | ||||||
|         </u-form-item> |         </u-form-item> | ||||||
|         <u-form-item label="" |         <u-form-item label="" | ||||||
|                      prop="payPassword"> |                      prop="payPwd"> | ||||||
|           <u-input :password="isPwd2" |           <u-input :password="isPwd2" | ||||||
|           :placeholder="'请输入支付密码'" |           :placeholder="'请输入支付密码'" | ||||||
|                    v-model="form.payPassword"> |                    v-model="form.payPwd"> | ||||||
|             <template slot="suffix"> |             <template slot="suffix"> | ||||||
|               <u-icon name="eye" |               <u-icon name="eye" | ||||||
|                       @tap="isPwd2=!isPwd2" |                       @tap="isPwd2=!isPwd2" | ||||||
|  | @ -185,23 +176,64 @@ | ||||||
| 
 | 
 | ||||||
|     </view> --> |     </view> --> | ||||||
|     </view> |     </view> | ||||||
|   <view class="mask" v-if="isTrue"> |     <u-modal | ||||||
| 
 |       :show="showSuccessModal" | ||||||
|  |       title="注册成功" | ||||||
|  |       :show-cancel-button="true" | ||||||
|  |       cancel-text="复制" | ||||||
|  |       confirm-text="自动登录" | ||||||
|  |       @confirm="onModalConfirm" | ||||||
|  |       @cancel="onModalCancel" | ||||||
|  |       @close="showSuccessModal = false" | ||||||
|  |     > | ||||||
|  |       <view class="slot-content" v-if="successData"> | ||||||
|  |         <view class="success-item"> | ||||||
|  |           <text class="item-label">会员编号:</text> | ||||||
|  |           <text class="item-value">{{ successData.memberCode }}</text> | ||||||
|  |         </view> | ||||||
|  |         <view class="success-item"> | ||||||
|  |           <text class="item-label">会员姓名:</text> | ||||||
|  |           <text class="item-value">{{ successData.memberName }}</text> | ||||||
|  |         </view> | ||||||
|  |         <view class="success-item"> | ||||||
|  |           <text class="item-label">联系方式:</text> | ||||||
|  |           <text class="item-value">{{ successData.phone }}</text> | ||||||
|  |         </view> | ||||||
|  |         <view class="success-item"> | ||||||
|  |           <text class="item-label">登录密码:</text> | ||||||
|  |           <text class="item-value">{{ successData.loginPassword }}</text> | ||||||
|  |         </view> | ||||||
|  |         <view class="success-item"> | ||||||
|  |           <text class="item-label">支付密码:</text> | ||||||
|  |           <text class="item-value">{{ successData.payPassword }}</text> | ||||||
|  |         </view> | ||||||
|  |       </view> | ||||||
|  |     </u-modal> | ||||||
|   </view> |   </view> | ||||||
| </view> |  | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
| import * as api from '@/config/goods' | import * as api from '@/config/goods' | ||||||
|  | import { | ||||||
|  |   getMemberCode, | ||||||
|  |   getPhoneCode, | ||||||
|  |   getRegister, | ||||||
|  |   autoLogin, | ||||||
|  | } from '@/config/share' | ||||||
| export default { | export default { | ||||||
|   components: {}, |   components: {}, | ||||||
|   data() { |   data() { | ||||||
|     return { |     return { | ||||||
|       isTrue:false, |       isTrue: false, | ||||||
|       howHeader: 'HF', |       howHeader: 'HF', | ||||||
|       pkParent: '', |       pkParent: '', | ||||||
|       form: { |       form: { | ||||||
|         memberName: '', |         memberName: '', | ||||||
|  |         smsCode: '', | ||||||
|  |         loginPwd: '', | ||||||
|  |         payPwd: '', | ||||||
|  |         parentCode: '', | ||||||
|  |         phone: '', | ||||||
|       }, |       }, | ||||||
|       isLoading: false, |       isLoading: false, | ||||||
|       getCode: '获取验证码', |       getCode: '获取验证码', | ||||||
|  | @ -214,47 +246,49 @@ export default { | ||||||
|       isPwd: true, |       isPwd: true, | ||||||
|       isPwd1: true, |       isPwd1: true, | ||||||
|       isPwd2: true, |       isPwd2: true, | ||||||
|  |       showSuccessModal: false, | ||||||
|  |       successData: null, | ||||||
|       rules: { |       rules: { | ||||||
|         memberCode: [ |         parentCode: [ | ||||||
|           { |           { | ||||||
|             required: true, |             required: true, | ||||||
|             asyncValidator: this.memberCodeRule, |             message: '请输入推荐编号', | ||||||
|             trigger: ['blur'], |             trigger: ['blur'], | ||||||
|           }, |           }, | ||||||
|         ], |         ], | ||||||
|         memberName: [ |         memberName: [ | ||||||
|           { |           { | ||||||
|             required: true, |             required: true, | ||||||
|             message:'请输入会员姓名', |             message: '请输入会员姓名', | ||||||
|             trigger: [ 'blur'], |             trigger: ['blur'], | ||||||
|           }, |           }, | ||||||
|         ], |         ], | ||||||
|         phone: [ |         phone: [ | ||||||
|           { |           { | ||||||
|             required: true, |             required: true, | ||||||
|             message: '请输入联系方式', |             message: '请输入联系方式', | ||||||
|             trigger: [ 'blur'], |             trigger: ['blur'], | ||||||
|           }, |           }, | ||||||
|         ], |         ], | ||||||
|         code: [ |         smsCode: [ | ||||||
|           { |           { | ||||||
|             required: true, |             required: true, | ||||||
|             message: '请输入验证码', |             message: '请输入验证码', | ||||||
|             trigger: ['blur'], |             trigger: ['blur'], | ||||||
|           }, |           }, | ||||||
|         ], |         ], | ||||||
|         loginPassword: [ |         loginPwd: [ | ||||||
|           { |           { | ||||||
|             required: true, |             required: true, | ||||||
|             message: '请输入登录密码', |             message: '请输入登录密码', | ||||||
|             trigger: ['blur'], |             trigger: ['blur'], | ||||||
|           }, |           }, | ||||||
|         ], |         ], | ||||||
|         payPassword: [ |         payPwd: [ | ||||||
|           { |           { | ||||||
|             required: true, |             required: true, | ||||||
|             message: '请输入支付密码', |             message: '请输入支付密码', | ||||||
|             trigger: [ 'blur'], |             trigger: ['blur'], | ||||||
|           }, |           }, | ||||||
|         ], |         ], | ||||||
|       }, |       }, | ||||||
|  | @ -280,14 +314,14 @@ export default { | ||||||
|             trigger: ['change', 'blur'], |             trigger: ['change', 'blur'], | ||||||
|           }, |           }, | ||||||
|         ], |         ], | ||||||
|         loginPassword: [ |         loginPwd: [ | ||||||
|           { |           { | ||||||
|             required: true, |             required: true, | ||||||
|             message: '请输入登录密码', |             message: '请输入登录密码', | ||||||
|             trigger: ['change', 'blur'], |             trigger: ['change', 'blur'], | ||||||
|           }, |           }, | ||||||
|         ], |         ], | ||||||
|         payPassword: [ |         payPwd: [ | ||||||
|           { |           { | ||||||
|             required: true, |             required: true, | ||||||
|             message: '请输入支付密码', |             message: '请输入支付密码', | ||||||
|  | @ -303,11 +337,12 @@ export default { | ||||||
|     this.pkCountry = options.country || '' |     this.pkCountry = options.country || '' | ||||||
|     this.getGenerate() |     this.getGenerate() | ||||||
|     if (this.pkCountry) { |     if (this.pkCountry) { | ||||||
|       |       // this.getCountry() | ||||||
|       this.getCountry() |  | ||||||
|       this.form.pkCountry = this.pkCountry |       this.form.pkCountry = this.pkCountry | ||||||
|       uni.setStorageSync('pkCountry',this.pkCountry) |       uni.setStorageSync('pkCountry', this.pkCountry) | ||||||
|       uni.redirectTo({ url: '/pages/shareArea/hiList?pkParent=' + this.pkParent}) |       uni.redirectTo({ | ||||||
|  |         url: '/pages/shareArea/hiList?pkParent=' + this.pkParent, | ||||||
|  |       }) | ||||||
|       // this.$refs.uForm1.setRules(this.rules1) |       // this.$refs.uForm1.setRules(this.rules1) | ||||||
|     } else { |     } else { | ||||||
|       // 获取前缀 |       // 获取前缀 | ||||||
|  | @ -318,15 +353,11 @@ export default { | ||||||
|   }, |   }, | ||||||
|   onShow() {}, |   onShow() {}, | ||||||
|   methods: { |   methods: { | ||||||
|     setMemberCode(){ |     selCountry() { | ||||||
|       // this.form.memberCode = this.form.phone |  | ||||||
|       this.$set(this.form,'memberCode',this.form.phone) |  | ||||||
|     }, |  | ||||||
|     selCountry(){ |  | ||||||
|       uni.showModal({ |       uni.showModal({ | ||||||
|         title: '提示', |         title: '提示', | ||||||
|         content: '确认更换自然国', |         content: '确认更换自然国', | ||||||
| 			  success: (res) => { |         success: res => { | ||||||
|           if (res.confirm) { |           if (res.confirm) { | ||||||
|             this.isCountry = true |             this.isCountry = true | ||||||
|           } |           } | ||||||
|  | @ -340,7 +371,7 @@ export default { | ||||||
|         if (value.length < 10 || value.length > 20) { |         if (value.length < 10 || value.length > 20) { | ||||||
|           callback(new Error('请输入10-20位数字')) |           callback(new Error('请输入10-20位数字')) | ||||||
|         } else { |         } else { | ||||||
|           api.validateMember(value).then((res) => { |           api.validateMember(value).then(res => { | ||||||
|             if (res.code == 200) { |             if (res.code == 200) { | ||||||
|               callback() |               callback() | ||||||
|             } else { |             } else { | ||||||
|  | @ -351,47 +382,101 @@ export default { | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     getHeader() { |     getHeader() { | ||||||
|       api.checkShare().then((res) => { |       getMemberCode(this.pkParent).then(res => { | ||||||
|        if(res.code != 200){ |         this.$set(this.form, 'parentCode', res.data) | ||||||
|         this.isTrue = true |         console.log(this.form) | ||||||
|        }else{ |  | ||||||
|         this.isTrue = false |  | ||||||
|        } |  | ||||||
|       }) |       }) | ||||||
|       // api.prefix(this.pkParent).then((res) => { |       // api.prefix(this.pkParent).then((res) => { | ||||||
|       //   this.howHeader = res.msg |       //   this.howHeader = res.msg | ||||||
|       // }) |       // }) | ||||||
|     }, |     }, | ||||||
|     getGenerate() { |     getGenerate() { | ||||||
|       api.generate().then((res) => { |       api.generate().then(res => { | ||||||
|         uni.setStorageSync('mToken', res.msg) |         uni.setStorageSync('mToken', res.msg) | ||||||
|       }) |       }) | ||||||
|     }, |     }, | ||||||
|     toLogin() { |     toLogin() { | ||||||
|       this.$refs.uForm.validate().then((res) => { |       this.$refs.uForm.validate().then(() => { | ||||||
|         this.isLoading = true |         this.isLoading = true | ||||||
|         api |         getRegister(Object.assign({}, this.form, { parentCode: this.pkParent })) | ||||||
|           .regShareMember( |           .then(res => { | ||||||
|             Object.assign({}, this.form, { parent: this.pkParent }) |  | ||||||
|           ) |  | ||||||
|           .then((res) => { |  | ||||||
|             this.isLoading = false |             this.isLoading = false | ||||||
|             if (res.code == 200) { |             if (res.code == 200) { | ||||||
|               uni.redirectTo({ |               this.successData = res.data | ||||||
|                 url: |               this.showSuccessModal = true | ||||||
|                   '/pages/shareRegist/success?allData=' + |             } else { | ||||||
|                   JSON.stringify(res.data), |               uni.showToast({ | ||||||
|  |                 title: res.msg || '注册失败', | ||||||
|  |                 icon: 'none', | ||||||
|               }) |               }) | ||||||
|             } |             } | ||||||
|           }) |           }) | ||||||
|  |           .catch(() => { | ||||||
|  |             this.isLoading = false | ||||||
|  |             uni.showToast({ | ||||||
|  |               title: '注册请求失败', | ||||||
|  |               icon: 'none', | ||||||
|  |             }) | ||||||
|  |           }) | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|  |     onModalConfirm() { | ||||||
|  |       if (this.successData) { | ||||||
|  |         this.handleAutoLogin(this.successData) | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     onModalCancel() { | ||||||
|  |       if (this.successData) { | ||||||
|  |         const modalContent = `会员编号: ${this.successData.memberCode}\n会员姓名: ${this.successData.memberName}\n联系方式: ${this.successData.phone}\n登录密码: ${this.successData.loginPassword}\n支付密码: ${this.successData.payPassword}` | ||||||
|  |         uni.setClipboardData({ | ||||||
|  |           data: modalContent, | ||||||
|  |           success: function () { | ||||||
|  |             uni.showToast({ | ||||||
|  |               title: '复制成功', | ||||||
|  |               icon: 'success', | ||||||
|  |             }) | ||||||
|  |           }, | ||||||
|  |         }) | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     handleAutoLogin(loginData) { | ||||||
|  |       autoLogin({ | ||||||
|  |         username: loginData.memberCode, | ||||||
|  |         password: loginData.loginPassword, | ||||||
|  |         uuid: loginData.uuid, | ||||||
|  |       }) | ||||||
|  |         .then(loginRes => { | ||||||
|  |           if (loginRes.code === 200) { | ||||||
|  |             uni.showToast({ | ||||||
|  |               title: '登录成功', | ||||||
|  |               icon: 'success', | ||||||
|  |               duration: 1500, | ||||||
|  |             }) | ||||||
|  |             setTimeout(() => { | ||||||
|  |               uni.reLaunch({ | ||||||
|  |                 url: '/pages/index/index', | ||||||
|  |               }) | ||||||
|  |             }, 1500) | ||||||
|  |           } else { | ||||||
|  |             uni.showToast({ | ||||||
|  |               title: loginRes.msg || '自动登录失败', | ||||||
|  |               icon: 'none', | ||||||
|  |             }) | ||||||
|  |           } | ||||||
|  |         }) | ||||||
|  |         .catch(() => { | ||||||
|  |           uni.showToast({ | ||||||
|  |             title: '自动登录请求失败', | ||||||
|  |             icon: 'none', | ||||||
|  |           }) | ||||||
|         }) |         }) | ||||||
|     }, |     }, | ||||||
|     hiLogin() { |     hiLogin() { | ||||||
|       this.$refs.uForm1.validate().then((res) => { |       this.$refs.uForm1.validate().then(res => { | ||||||
|         this.isLoading = true |         this.isLoading = true | ||||||
|         api |         api | ||||||
|           .hiRegister(Object.assign({}, this.form, { pkParent: this.pkParent })) |           .hiRegister(Object.assign({}, this.form, { pkParent: this.pkParent })) | ||||||
|           .then((res) => { |           .then(res => { | ||||||
|             this.isLoading = false |             this.isLoading = false | ||||||
|             if (res.code == 200) { |             if (res.code == 200) { | ||||||
|               uni.redirectTo({ |               uni.redirectTo({ | ||||||
|  | @ -409,16 +494,16 @@ export default { | ||||||
|       this.isCountry = false |       this.isCountry = false | ||||||
|     }, |     }, | ||||||
|     getCountry() { |     getCountry() { | ||||||
|       api.getCountry().then((res) => { |       api.getCountry().then(res => { | ||||||
|         this.countryList = [ |         this.countryList = [ | ||||||
|           res.data.map((item) => { |           res.data.map(item => { | ||||||
|             return { |             return { | ||||||
|               label: item.shortName, |               label: item.shortName, | ||||||
|               id: item.pkId, |               id: item.pkId, | ||||||
|             } |             } | ||||||
|           }), |           }), | ||||||
|         ] |         ] | ||||||
|         this.countryList[0].forEach((item) => { |         this.countryList[0].forEach(item => { | ||||||
|           if (this.pkCountry == item.id) { |           if (this.pkCountry == item.id) { | ||||||
|             this.form.jsName = item.label |             this.form.jsName = item.label | ||||||
|             this.form.pkCountryName = item.label |             this.form.pkCountryName = item.label | ||||||
|  | @ -429,12 +514,12 @@ export default { | ||||||
|     // 获取验证码 |     // 获取验证码 | ||||||
|     getVilCode() { |     getVilCode() { | ||||||
|       this.startTime() |       this.startTime() | ||||||
|       api |       getPhoneCode({ | ||||||
|         .verification({ |  | ||||||
|         phone: this.form.phone, |         phone: this.form.phone, | ||||||
|  |         parentCode: this.pkParent, | ||||||
|       }) |       }) | ||||||
|         .then((res) => {}) |         .then(res => {}) | ||||||
|         .catch((err) => { |         .catch(err => { | ||||||
|           this.beginTime = 0 |           this.beginTime = 0 | ||||||
|         }) |         }) | ||||||
|     }, |     }, | ||||||
|  | @ -460,13 +545,14 @@ export default { | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| <style lang="scss" scoped> | <style lang="scss" scoped> | ||||||
| .content1{ | .content1 { | ||||||
|   background-image: url('@/static/images/haiRgeiest1.jpg'); |   background: linear-gradient(-45deg, #005bac, #0077c2, #0099e0, #00bfff); | ||||||
|   background-size: 100%; |   background-size: 400% 400%; | ||||||
|     background-repeat: no-repeat; |   animation: gradient 15s ease infinite; | ||||||
|   height: 100vh; |   height: 100vh; | ||||||
|  |   overflow: auto; | ||||||
| } | } | ||||||
| .content{ | .content { | ||||||
|   background-image: url('@/static/images/huan.jpg'); |   background-image: url('@/static/images/huan.jpg'); | ||||||
|   // background-image: url('@/static/images/regiestBg.jpg'); |   // background-image: url('@/static/images/regiestBg.jpg'); | ||||||
|   background-size: cover; |   background-size: cover; | ||||||
|  | @ -474,21 +560,22 @@ export default { | ||||||
|   background-position: center; |   background-position: center; | ||||||
|   height: 100vh; |   height: 100vh; | ||||||
| } | } | ||||||
| .tit{ | .title { | ||||||
|   font-size: 48px; |   font-size: 48rpx; | ||||||
| font-family: PangMenZhengDao-Regular, PangMenZhengDao; |   font-weight: bold; | ||||||
| font-weight: 400; |   color: #333; | ||||||
| color: #FFFFFF; |   text-align: center; | ||||||
| text-align: center; |   padding-top: 120rpx; | ||||||
| padding-top: 80px; |   padding-bottom: 80rpx; | ||||||
| margin-bottom: 20px; |  | ||||||
| } | } | ||||||
| .index_header { | .index_header { | ||||||
|   background: #f9f9f9;; |   background: #f9f9f9; | ||||||
|   height: 330rpx; |   height: 330rpx; | ||||||
| 
 | 
 | ||||||
|   font-size: 18px; |   font-size: 18px; | ||||||
|   font-family: PingFang SC-Semibold, PingFang SC; |   font-family: | ||||||
|  |     PingFang SC-Semibold, | ||||||
|  |     PingFang SC; | ||||||
|   font-weight: 600; |   font-weight: 600; | ||||||
|   color: #333333; |   color: #333333; | ||||||
|   text-align: center; |   text-align: center; | ||||||
|  | @ -498,14 +585,18 @@ margin-bottom: 20px; | ||||||
|   padding: 0 120rpx; |   padding: 0 120rpx; | ||||||
| } | } | ||||||
| .formed1 { | .formed1 { | ||||||
|   padding: 0 120rpx; |   margin: 0 40rpx; | ||||||
|   padding-top: 550rpx; |   padding: 40rpx 30rpx; | ||||||
|  |   background-color: rgba(255, 255, 255, 0.85); | ||||||
|  |   border-radius: 16rpx; | ||||||
| } | } | ||||||
| .getCode { | .getCode { | ||||||
|   font-size: 10px; |   font-size: 10px; | ||||||
|   font-family: PingFang SC-Regular, PingFang SC; |   font-family: | ||||||
|  |     PingFang SC-Regular, | ||||||
|  |     PingFang SC; | ||||||
|   font-weight: 400; |   font-weight: 400; | ||||||
|   color: #005BAC; |   color: #005bac; | ||||||
| } | } | ||||||
| .uBtn { | .uBtn { | ||||||
|   margin-top: 120rpx; |   margin-top: 120rpx; | ||||||
|  | @ -521,14 +612,47 @@ margin-bottom: 20px; | ||||||
|   padding: 6px 9px; |   padding: 6px 9px; | ||||||
|   background: #fff; |   background: #fff; | ||||||
| } | } | ||||||
| ::v-deep .u-input{ | ::v-deep .u-input { | ||||||
|   background: #fff; |   background: #fff; | ||||||
| } | } | ||||||
| .mask{ | .mask { | ||||||
|   position: fixed; |   position: fixed; | ||||||
|   background: rgba(0,0,0,0.5); |   background: rgba(0, 0, 0, 0.5); | ||||||
|   width: 100%; |   width: 100%; | ||||||
|   height: 100vh; |   height: 100vh; | ||||||
|   top: 0; |   top: 0; | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | @keyframes gradient { | ||||||
|  |   0% { | ||||||
|  |     background-position: 0% 50%; | ||||||
|  |   } | ||||||
|  |   50% { | ||||||
|  |     background-position: 100% 50%; | ||||||
|  |   } | ||||||
|  |   100% { | ||||||
|  |     background-position: 0% 50%; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .slot-content { | ||||||
|  |   padding: 30rpx 20rpx; | ||||||
|  |   font-size: 28rpx; | ||||||
|  | } | ||||||
|  | .success-item { | ||||||
|  |   display: flex; | ||||||
|  |   justify-content: space-between; | ||||||
|  |   align-items: center; | ||||||
|  |   padding: 10rpx 0; | ||||||
|  | } | ||||||
|  | .item-label { | ||||||
|  |   color: #606266; | ||||||
|  |   margin-right: 20rpx; | ||||||
|  |   flex-shrink: 0; | ||||||
|  | } | ||||||
|  | .item-value { | ||||||
|  |   color: #303133; | ||||||
|  |   word-break: break-all; | ||||||
|  |   text-align: right; | ||||||
|  | } | ||||||
| </style> | </style> | ||||||
|  |  | ||||||
|  | @ -35,5 +35,6 @@ export default { | ||||||
|   background: #f2f2f2; |   background: #f2f2f2; | ||||||
|   // padding: 0 20rpx; |   // padding: 0 20rpx; | ||||||
|   min-height: 94vh; |   min-height: 94vh; | ||||||
|  |   padding-bottom: 100rpx; | ||||||
| } | } | ||||||
| </style> | </style> | ||||||
|  |  | ||||||
|  | @ -10,13 +10,6 @@ | ||||||
|     <view class="index_header"> |     <view class="index_header"> | ||||||
|       <view>{{ titLabel }}</view> |       <view>{{ titLabel }}</view> | ||||||
|     </view> |     </view> | ||||||
|     <view class="shareImg" v-if="specialArea == 7" @click="goShare"> |  | ||||||
|       <u-icon name="share-square" size="24" color="#005BAC"> </u-icon> |  | ||||||
|     </view> |  | ||||||
|     <view class="shareImg1" v-if="specialArea == 1" @tap="changeCountry"> |  | ||||||
|       <img :src="pkCountryImg" alt="" /> |  | ||||||
|       <u-icon name="arrow-down" color="#999"></u-icon> |  | ||||||
|     </view> |  | ||||||
|     <u-scroll-list |     <u-scroll-list | ||||||
|       :indicator="false" |       :indicator="false" | ||||||
|       v-if="itemChildren.length > 1" |       v-if="itemChildren.length > 1" | ||||||
|  | @ -107,12 +100,6 @@ | ||||||
|               <view class="pv" v-if="specialArea == 10"> |               <view class="pv" v-if="specialArea == 10"> | ||||||
|                 积分可抵扣:{{ item.deductMoney | numberToCurrency }} |                 积分可抵扣:{{ item.deductMoney | numberToCurrency }} | ||||||
|               </view> |               </view> | ||||||
|               <view |  | ||||||
|                 class="pv" |  | ||||||
|                 v-if="specialArea == 31 && userInfo.isMakerSpace == 0" |  | ||||||
|               > |  | ||||||
|                 业绩:{{ item.waresAchieve | numberToCurrency }} |  | ||||||
|               </view> |  | ||||||
|               <view class="pv" v-if="specialArea == 13"> |               <view class="pv" v-if="specialArea == 13"> | ||||||
|                 BV:{{ item.assAchieve | numberToCurrency }} |                 BV:{{ item.assAchieve | numberToCurrency }} | ||||||
|               </view> |               </view> | ||||||
|  | @ -181,6 +168,15 @@ import { mapGetters, mapActions } from 'vuex' | ||||||
| import * as api from '@/config/goods' | import * as api from '@/config/goods' | ||||||
| import clTabbar from '@/components/cl-tabbar.vue' | import clTabbar from '@/components/cl-tabbar.vue' | ||||||
| import selSpaceGoods from '@/components/selSpaceGoods.vue' | import selSpaceGoods from '@/components/selSpaceGoods.vue' | ||||||
|  | import { | ||||||
|  |   REGIEST_AREA, | ||||||
|  |   UPGRADE_AREA, | ||||||
|  |   REPURCHASE_AREA, | ||||||
|  |   REISSUE_AREA, | ||||||
|  | } from '@/util/specialAreaMap' | ||||||
|  | import { MEMBER_SIGN } from '@/util/common' | ||||||
|  | import areaProductList from '@/components/area-product-list/index.vue' | ||||||
|  | import { getAreaGoods } from '@/config/special-area' | ||||||
| 
 | 
 | ||||||
| export default { | export default { | ||||||
|   components: { |   components: { | ||||||
|  | @ -221,13 +217,13 @@ export default { | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   onLoad(options) { |   onLoad(options) { | ||||||
|     if (JSON.parse(options.children).length > 0) { |     if (JSON.parse(options?.children || '[]').length > 0) { | ||||||
|       let arr = [] |       let arr = [] | ||||||
|       if (options.childArea) { |       if (options.childArea) { | ||||||
|         this.specialArea = options.childArea |         this.specialArea = options.childArea | ||||||
|         // this.diff = 1 |         // this.diff = 1 | ||||||
|       } else { |       } else { | ||||||
|         JSON.parse(options.children).forEach(item => { |         JSON.parse(options?.children || '[]').forEach(item => { | ||||||
|           if (item.isShow) { |           if (item.isShow) { | ||||||
|             arr.push(item.value) |             arr.push(item.value) | ||||||
|           } |           } | ||||||
|  | @ -242,40 +238,36 @@ export default { | ||||||
|       this.specialArea = options.specialArea |       this.specialArea = options.specialArea | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     this.titLabel = options.label |     // this.titLabel = options.label | ||||||
|     let tempArr = JSON.parse(options.children) |     // let tempArr = JSON.parse(options?.children || '[]') | ||||||
|     if (this.specialArea != 18) { |     // if (this.specialArea != 18) { | ||||||
|       api.menuList().then(res => { |     //   api.menuList().then(res => { | ||||||
|         tempArr = tempArr.filter(item => |     //     tempArr = tempArr.filter(item => | ||||||
|           res.data.find(ctem => ctem.menuKey == item.name) |     //       res.data.find(ctem => ctem.menuKey == item.name) | ||||||
|         ) |     //     ) | ||||||
|         this.itemChildren = tempArr |     //     this.itemChildren = tempArr | ||||||
|       }) |     //   }) | ||||||
|     } |     // } | ||||||
|     // 修改标题 |     // 修改标题 | ||||||
|  |     const areaMap = { | ||||||
|  |       [REGIEST_AREA.id]: REGIEST_AREA.name, | ||||||
|  |       [UPGRADE_AREA.id]: UPGRADE_AREA.name, | ||||||
|  |       [REPURCHASE_AREA.id]: REPURCHASE_AREA.name, | ||||||
|  |       [REISSUE_AREA.id]: REISSUE_AREA.name, | ||||||
|  |     } | ||||||
|  |     this.titLabel = areaMap[this.specialArea] | ||||||
|     uni.setNavigationBarTitle({ |     uni.setNavigationBarTitle({ | ||||||
|       title: this.titLabel, |       title: this.titLabel, | ||||||
|       success: () => {}, |       success: () => { | ||||||
|  |         console.log(title) | ||||||
|  |       }, | ||||||
|     }) |     }) | ||||||
|     // 获取一级分类并获取商品列表 |     // 获取一级分类并获取商品列表 | ||||||
|     // this.getClassIfy() |     // this.getClassIfy() | ||||||
| 
 | 
 | ||||||
|     this.userInfo = uni.getStorageSync('User') |     this.userInfo = uni.getStorageSync('User') | ||||||
|     console.log( | 
 | ||||||
|       '%c [ this.userInfo ]-242', |     this.pkCountry = this.userInfo.pkCountry || 1 | ||||||
|       'font-size:13px; background:#cb38d2; color:#ff7cff;', |  | ||||||
|       this.userInfo |  | ||||||
|     ) |  | ||||||
|     if (this.specialArea == 1) { |  | ||||||
|       if (uni.getStorageSync('pkCountry')) { |  | ||||||
|         this.pkCountry = uni.getStorageSync('pkCountry') |  | ||||||
|       } else { |  | ||||||
|         this.pkCountry = this.userInfo.pkSettleCountry |  | ||||||
|         uni.setStorageSync('pkCountry', this.pkCountry + '') |  | ||||||
|       } |  | ||||||
|     } else { |  | ||||||
|       this.pkCountry = this.userInfo.pkSettleCountry |  | ||||||
|     } |  | ||||||
|     this.setSpecial({ |     this.setSpecial({ | ||||||
|       value: this.specialArea, |       value: this.specialArea, | ||||||
|     }) |     }) | ||||||
|  | @ -299,7 +291,6 @@ export default { | ||||||
|     this.setSmallCarLength(0) |     this.setSmallCarLength(0) | ||||||
|   }, |   }, | ||||||
|   beforeDestroy() { |   beforeDestroy() { | ||||||
|     console.log('beforeDestroy........?') |  | ||||||
|     this.setSmallCarLength(0) |     this.setSmallCarLength(0) | ||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
|  | @ -342,18 +333,8 @@ export default { | ||||||
|       }) |       }) | ||||||
|     }, |     }, | ||||||
|     setSpecial(item) { |     setSpecial(item) { | ||||||
|       if (item.value == 21) { |  | ||||||
|         // uni.navigateTo({ |  | ||||||
|         //   url: |  | ||||||
|         //     '/pages/specialArea/haIndex?label=' + |  | ||||||
|         //     this.titLabel + |  | ||||||
|         //     '&specialArea=21&children=' + |  | ||||||
|         //     JSON.stringify(this.itemChildren), |  | ||||||
|         // }) |  | ||||||
|       } else { |  | ||||||
|       this.specialArea = item.value |       this.specialArea = item.value | ||||||
|       this.getClassIfy() |       this.getClassIfy() | ||||||
|       } |  | ||||||
|     }, |     }, | ||||||
|     addCar(item) { |     addCar(item) { | ||||||
|       let carList = { |       let carList = { | ||||||
|  | @ -363,12 +344,6 @@ export default { | ||||||
|         waresCode: item.waresCode, |         waresCode: item.waresCode, | ||||||
|         productGroup: item.productGroup, |         productGroup: item.productGroup, | ||||||
|       } |       } | ||||||
|       if ( |  | ||||||
|         item.isMakerGift == 2 && |  | ||||||
|         (item.specialArea == 1 || item.specialArea == 3) |  | ||||||
|       ) { |  | ||||||
|         this.$refs.selSpaceGoods.getData(carList) |  | ||||||
|       } else { |  | ||||||
|       api.addShopping(carList).then(res => { |       api.addShopping(carList).then(res => { | ||||||
|         if (res.code == 200) { |         if (res.code == 200) { | ||||||
|           uni.showToast({ |           uni.showToast({ | ||||||
|  | @ -377,15 +352,12 @@ export default { | ||||||
|             mask: true, |             mask: true, | ||||||
|           }) |           }) | ||||||
|           setTimeout(() => { |           setTimeout(() => { | ||||||
|               this.$store |             this.$store.dispatch('getCarLength', this.specialArea).then(res => { | ||||||
|                 .dispatch('getCarLength', this.specialArea) |  | ||||||
|                 .then(res => { |  | ||||||
|               this.shopCarLength = res.data.smallCount |               this.shopCarLength = res.data.smallCount | ||||||
|             }) |             }) | ||||||
|           }, 200) |           }, 200) | ||||||
|         } |         } | ||||||
|       }) |       }) | ||||||
|       } |  | ||||||
|     }, |     }, | ||||||
|     getCatLength() { |     getCatLength() { | ||||||
|       this.$store.dispatch('getCarLength', this.specialArea).then(res => { |       this.$store.dispatch('getCarLength', this.specialArea).then(res => { | ||||||
|  | @ -429,14 +401,12 @@ export default { | ||||||
|         }) |         }) | ||||||
|     }, |     }, | ||||||
|     getAllGoods(id) { |     getAllGoods(id) { | ||||||
|       api |       getAreaGoods({ | ||||||
|         .getAllGoods({ |  | ||||||
|         pkCountry: this.pkCountry, |         pkCountry: this.pkCountry, | ||||||
|         specialArea: Number(this.specialArea), |         specialArea: Number(this.specialArea), | ||||||
|         pkAreaClassify: id ? id : '', |         pkAreaClassify: id ? id : '', | ||||||
|         }) |       }).then(res => { | ||||||
|         .then(res => { |         this.goodList = res.data || [] | ||||||
|           this.goodList = res.data |  | ||||||
|         this.goodList.forEach(item => { |         this.goodList.forEach(item => { | ||||||
|           if (item.waresName.length > 11) { |           if (item.waresName.length > 11) { | ||||||
|             item.waresName = item.waresName.substring(0, 11) + '...' |             item.waresName = item.waresName.substring(0, 11) + '...' | ||||||
|  | @ -445,14 +415,12 @@ export default { | ||||||
|       }) |       }) | ||||||
|     }, |     }, | ||||||
|     getAllGoods1(id) { |     getAllGoods1(id) { | ||||||
|       api |       getAreaGoods({ | ||||||
|         .getAllGoods({ |  | ||||||
|         pkCountry: this.pkCountry, |         pkCountry: this.pkCountry, | ||||||
|         specialArea: this.specialArea, |         specialArea: this.specialArea, | ||||||
|         waresName: this.waresName, |         waresName: this.waresName, | ||||||
|         pkAreaClassify: id ? id : this.oneId, |         pkAreaClassify: id ? id : this.oneId, | ||||||
|         }) |       }).then(res => { | ||||||
|         .then(res => { |  | ||||||
|         this.goodList = res.data |         this.goodList = res.data | ||||||
|         this.goodList.forEach(item => { |         this.goodList.forEach(item => { | ||||||
|           if (item.waresName.length > 11) { |           if (item.waresName.length > 11) { | ||||||
|  |  | ||||||
|  | @ -0,0 +1 @@ | ||||||
|  | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1749519102102" class="icon" viewBox="128 128 768 768" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4253" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400"><path d="M435.456 128h-256a51.2 51.2 0 0 0-51.2 51.2v256a51.2 51.2 0 0 0 51.2 51.2h256a51.2 51.2 0 0 0 51.2-51.2v-256a51.2 51.2 0 0 0-51.2-51.2zM435.456 537.6h-256a51.2 51.2 0 0 0-51.2 51.2v256a51.2 51.2 0 0 0 51.2 51.2h256a51.2 51.2 0 0 0 51.2-51.2v-256a51.2 51.2 0 0 0-51.2-51.2zM844.544 128h-256a51.2 51.2 0 0 0-51.2 51.2v256a51.2 51.2 0 0 0 51.2 51.2h256a51.2 51.2 0 0 0 51.2-51.2v-256a51.2 51.2 0 0 0-51.2-51.2zM591.9744 610.9696a24.4736 24.4736 0 0 0-24.5248 24.5248v224.0512a24.576 24.576 0 0 0 49.0496 0v-224.0512a24.576 24.576 0 0 0-24.5248-24.5248zM716.544 680.5504a24.576 24.576 0 0 0-24.5248 24.5248v154.4704a24.576 24.576 0 0 0 49.0496 0v-154.4704a24.576 24.576 0 0 0-24.5248-24.5248zM842.3936 547.0208a24.576 24.576 0 0 0-24.5248 24.5248v288a24.576 24.576 0 0 0 49.0496 0v-288a24.576 24.576 0 0 0-24.5248-24.5248z" p-id="4254" fill="#f52a10"></path></svg> | ||||||
| After Width: | Height: | Size: 1.2 KiB | 
		Loading…
	
		Reference in New Issue