MONSTER-ygh 1 年間 前
コミット
e9b7450060
5 ファイル変更233 行追加21 行削除
  1. 5 0
      common/apiurl.js
  2. 7 0
      pages.json
  3. 70 14
      pages/index/index.vue
  4. 51 7
      pages/me/index.vue
  5. 100 0
      pages/networkAuth/index.vue

+ 5 - 0
common/apiurl.js

@@ -89,6 +89,11 @@ const apiurl = {
 		url: '/member/auth/personsLoginCheck',
 		type: 'get'
 	},
+	// 银联签约入网地址
+	getUnionAccessUrl: {
+		url: '/member/marketPersons/getUnionAccessUrl',
+		type: 'get'
+	},
 }
 
 

+ 7 - 0
pages.json

@@ -93,6 +93,13 @@
 				"navigationBarTitleText": "修改密码",
 				"navigationStyle": "custom"
 			}
+		},
+		{
+			"path": "pages/networkAuth/index",
+			"style": {
+				"navigationBarTitleText": "银联支付入网签约认证",
+				"navigationStyle": "custom"
+			}
 		}
 	],
 	"globalStyle": {

+ 70 - 14
pages/index/index.vue

@@ -9,7 +9,7 @@
 				:is-left="false"
 				:customNavbarInfo='{}'>
 					<view slot="right">
-						<image v-if="isShowQrcode" @click="getRetailQrcode()" style="width: 44rpx;height: 44rpx;" :src="fengxiang" mode=""></image>
+						<image @click="getRetailQrcode()" style="width: 44rpx;height: 44rpx;" :src="fengxiang" mode=""></image>
 					</view>
 				</customNavbar>
 				<u-search 
@@ -66,7 +66,7 @@
 		:title="title1" 
 		:content='content'
 		cancelText='取消'
-		confirmText='去认证'
+		:confirmText='confirmText'
 		showCancelButton
 		confirmColor='#ED0000'
 		@confirm='networkConfirm'
@@ -90,10 +90,11 @@
 				fengxiang: this.$commonConfig.staticUrl+'index/fengxiang.png',
 				
 				// 入网认证
-				isShowQrcode: false, // 是否展示 推广码
-				show: true,
+				isShowQrcode: -1, // 是否展示 推广码
+				show: false,
 				title1:'入网提示',
 				content:'你还未进行银联支付入网签约认证,请先完成签约认证!',
+				confirmText: '去认证',
 			}
 		},
 		onLoad() {
@@ -190,17 +191,33 @@
 			 */
 			async getRetailQrcode(){
 				try{
-					let res = await this.$u.api.getRetailQrcode({
-						noSign: 1,
-						userid: this.distribution_user_info.userId
-					})
+					await this.getUserInfo()
+					if(this.isShowQrcode != 1) {
+						if(this.isShowQrcode == 0) {
+							this.content = '你还未进行银联支付入网签约认证,请先完成签约认证!'
+							this.confirmText = '去认证'
+						}else if(this.isShowQrcode == 2) {
+							this.content = '银联支付入网签约认证中,请耐心等待!'
+							this.confirmText = '去查看'
+						}else if(this.isShowQrcode == 3) {
+							this.content = '银联支付入网签约认证失败,请重新认证!'
+							this.confirmText = '重新认证'
+						}
+						this.show = true
+					}else {
+						let res = await this.$u.api.getRetailQrcode({
+							noSign: 1,
+							userid: this.distribution_user_info.userId
+						})
+						
+						if(res && res.code ===200) {
+							this.$refs.customPromotionCode.initData(res.data)
+							// #ifdef H5
+							//window.history.pushState(null, null, document.URL)
+							// #endif
+						} 
+					}
 					
-					if(res && res.code ===200) {
-						this.$refs.customPromotionCode.initData(res.data)
-						// #ifdef H5
-						//window.history.pushState(null, null, document.URL)
-						// #endif
-					} 
 				}catch(e){
 					//TODO handle the exception
 					console.error("e===",e)
@@ -210,10 +227,49 @@
 			/** 入网认证  */
 			networkConfirm() {
 				this.show = false
+				this.navigateToFun('/pages/networkAuth/index')
+				//this.getUnionAccessUrlFun()
 			},
 			networkCancel() {
 				this.show = false
 			},
+			/**
+			 * 获取用户信息
+			 */
+			async getUserInfo() {
+				try{
+					let res = await this.$u.api.getInfo({
+						noSign: 1,
+						userid: this.distribution_user_info.userId
+					})
+					if(res && res.code ===200) {
+						this.isShowQrcode = res.data.unionFlag
+					}
+				}catch(e){
+					//TODO handle the exception
+					console.error("e===",e)
+					this.isShowQrcode = -1
+				}
+			},
+			/** 银联签约入网地址  */
+			async getUnionAccessUrlFun(){
+				try{
+					let res = await this.$u.api.getUnionAccessUrl({
+						userid: this.distribution_user_info.userId
+					})
+					
+					if(res && res.code ===200) {
+						this.show = false
+						location.href = res.data.jumpUrl
+					} else {
+						this.show = true
+					}
+				}catch(e){
+					//TODO handle the exception
+					this.show = true
+					console.error("e===",e)
+				}
+			}
 		}
 	}
 </script>

+ 51 - 7
pages/me/index.vue

@@ -32,7 +32,7 @@
 				v-for="(item,index) in tool"
 				:key="index"
 				@click="navigateToFun(item)"
-				v-if="(withdrawInfo.allowWithdraw == 1 && item.title=='余额提现')||item.title=='邀请统计'||(isShowQrcode && item.title=='我的推广码')"
+				v-if="(withdrawInfo.allowWithdraw == 1 && item.title=='余额提现')||item.title!='余额提现'"
 				>
 					<image 
 					class="me-tool-item-icon"
@@ -60,7 +60,7 @@
 		:title="title1" 
 		:content='content'
 		cancelText='取消'
-		confirmText='去认证'
+		:confirmText='confirmText'
 		showCancelButton
 		confirmColor='#ED0000'
 		@confirm='networkConfirm'
@@ -88,10 +88,11 @@
 				withdrawInfo: {},
 				
 				// 入网认证
-				isShowQrcode: false, // 是否展示 推广码
-				show: true,
+				isShowQrcode: -1, // 是否展示 推广码
+				show: false,
 				title1:'入网提示',
 				content:'你还未进行银联支付入网签约认证,请先完成签约认证!',
+				confirmText: '去认证',
 			}
 		},
 	
@@ -99,6 +100,7 @@
 		mounted() {
 			console.log('wpsdfsfasdfads')
 			this.statusBarHeight = getApp().globalData.statusBarHeight
+			this.show = false
 			this.getUserInfo() 
 			// #ifdef H5
 			//window.addEventListener('popstate', this.browserBack)
@@ -113,11 +115,30 @@
 			 * @author ygh
 			 * @data 2023-12-20
 			 */
-			navigateToFun(item){
+			async navigateToFun(item){
 				if(item.url) {
 					navigateTo(item.url)
 				}else {
-					this.getRetailQrcode()
+					let res = await this.$u.api.getInfo({
+						noSign: 1,
+						userid: this.distribution_user_info.userId
+					})
+					this.isShowQrcode = res.data.unionFlag
+					if(this.isShowQrcode != 1) {
+						if(this.isShowQrcode == 0) {
+							this.content = '你还未进行银联支付入网签约认证,请先完成签约认证!'
+							this.confirmText = '去认证'
+						}else if(this.isShowQrcode == 2) {
+							this.content = '银联支付入网签约认证中,请耐心等待!'
+							this.confirmText = '去查看'
+						}else if(this.isShowQrcode == 3) {
+							this.content = '银联支付入网签约认证失败,请重新认证!'
+							this.confirmText = '重新认证'
+						}
+						this.show = true
+					}else {
+						this.getRetailQrcode()
+					}
 				}
 				
 			},
@@ -136,11 +157,13 @@
 					})
 					if(res && res.code ===200) {
 						this.userInfo = res.data
-					} 
+						this.isShowQrcode = res.data.unionFlag
+					}
 					if(res1 && res1.code === 200){
 						this.withdrawInfo = res.data
 					}
 				}catch(e){
+					this.isShowQrcode = -1
 					//TODO handle the exception
 					console.error("e===",e)
 				}
@@ -254,10 +277,31 @@
 			/** 入网认证  */
 			networkConfirm() {
 				this.show = false
+				navigateTo('/pages/networkAuth/index')
+				//this.getUnionAccessUrlFun()
 			},
 			networkCancel() {
 				this.show = false
 			},
+			/** 银联签约入网地址  */
+			async getUnionAccessUrlFun(){
+				try{
+					let res = await this.$u.api.getUnionAccessUrl({
+						userid: this.distribution_user_info.userId
+					})
+					
+					if(res && res.code ===200) {
+						this.show = false
+						location.href = res.data.jumpUrl
+					} else {
+						this.show = true
+					}
+				}catch(e){
+					//TODO handle the exception
+					this.show = true
+					console.error("e===",e)
+				}
+			}
 		}
 	}
 </script>

+ 100 - 0
pages/networkAuth/index.vue

@@ -0,0 +1,100 @@
+<template>
+	<view class="inspage-content" :style="{'--status-bar-': statusBarHeight}">
+		<view class="inspage-content-info">
+			<!-- 头部主要内容 开始 -->
+			<view class="inspage-content-header">	
+				<customNavbar 
+				title="银联支付入网签约认证" 
+				bgColor="#fff"
+				:contentStyle="{color: '#000'}"
+				></customNavbar>
+			</view>
+			<!-- 头部主要内容 结束 -->
+			
+			<!-- userInfo内容 开始 -->
+			
+			<view class="inspage-content-userinfo">
+				<iframe :src="jumpUrl" frameborder="0"></iframe>
+				<!-- <web-view :src="jumpUrl"></web-view> -->
+			</view>
+			<!-- userInfo内容 结束 -->
+		</view>
+	</view>
+</template>
+
+<script>
+	import { navigateTo } from "@/utils/util.js"
+	export default {
+		data() {
+			return {
+				title: '统计分销',
+				statusBarHeight: 0, // 状态栏安全距离
+				jumpUrl: null
+			}
+		},
+		onLoad() {
+			this.getUnionAccessUrlFun()
+		},
+		onShow() {
+			this.statusBarHeight = getApp().globalData.statusBarHeight
+		},
+		methods: {
+			/** 银联签约入网地址  */
+			async getUnionAccessUrlFun(){
+				try{
+					let res = await this.$u.api.getUnionAccessUrl({
+						userid: this.distribution_user_info.userId
+					})
+					
+					if(res && res.code ===200) {
+						//this.show = false
+						this.jumpUrl = res.data.jumpUrl
+						//location.href = res.data.jumpUrl
+					} 
+				}catch(e){
+					//TODO handle the exception
+					console.error("e===",e)
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.inspage-content {
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		--header-h: 90rpx;
+		.inspage-content-info {
+			width: 100%;
+			box-sizing: border-box;
+		}
+	}
+	/** 头部主要内容 开始 */
+	.inspage-content-header {
+		width: 100%;
+		height: var(--header-h);
+		box-sizing: border-box;
+		::v-deep .u-search {
+			padding: 0 30rpx !important;
+		}
+		::v-deep .u-search__action {
+			color: #fff !important;
+		}
+	}
+	/** 头部主要内容 结束  **/
+	
+	/** userInfo内容 开始 */
+	.inspage-content-userinfo {
+		width: 100%;
+		height: calc( 100vh - var(--header-h) );
+		box-sizing: border-box;
+		>iframe {
+			width: 100%;
+			height: 100%;
+		}
+	}
+	/** userInfo内容 结束  **/
+</style>