Explorar o código

Merge branch 'master' of http://git.zthymaoyi.com/wangchao/businessCard

achao %!s(int64=2) %!d(string=hai) anos
pai
achega
5af1860489

+ 3 - 1
xiaochengxu/manifest.json

@@ -42,7 +42,9 @@
             },
             "ios" : {},
             /* ios打包配置 */
-            "sdkConfigs" : {}
+            "sdkConfigs" : {
+                "share" : {}
+            }
         }
     },
     /* SDK配置 */

+ 9 - 0
xiaochengxu/pages.json

@@ -173,6 +173,15 @@
             }
             
         }
+        ,{
+            "path" : "pages/mySet/lookCard",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "证件分享",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"tabBar": {
 		"custom": false,

+ 86 - 0
xiaochengxu/pages/mySet/lookCard.vue

@@ -0,0 +1,86 @@
+<template>
+	<view>
+		<view v-for='(item,index) in cardList' class="">
+			{{item.certificateName}}
+			<text v-if='item.personNo'>({{item.personNo1}})</text>
+			<u-icon v-if='item.personNo' @click='clip(0,item)' name="file-text-fill" color="#2979ff" size="28"></u-icon>
+			<text v-if='item.bankNo'>({{item.bankNo1}})</text>
+			<u-icon v-if='item.bankNo' @click='clip(1,item)' name="file-text-fill" color="#2979ff" size="28"></u-icon>
+			<view @click='imageOCR(item)'>{{text}}</view>
+			<image  :src="item.certificateImage" mode=""></image>
+		</view>
+		<u-picker @cancel='show=false' @confirm='pickerConfirm' title='识别类型' :show="show" :columns="columns"></u-picker>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				cardList:[],
+				show:false,
+				currectData:{},
+				text:'识别号码'
+			}
+		},
+		onLoad(options) {
+			this.cardList=options.cardList
+		},
+		methods: {
+			imageOCR(item){
+				this.currectData=item
+				this.show=true
+			},
+			getCountdownTime(e) {
+				this.countdownTime = 60
+				let timer = setInterval(() => {
+					this.countdownTime--;
+					if (this.countdownTime < 1) {
+						clearInterval(timer)
+						this.countdownTime = 0
+						uni.showLoading({
+								title: '数据加载中',
+								mask:true
+							})
+						var type='',type1=''
+						if(e.value[0]=='识别身份证号'){
+							type='admin.unimall.certificateManagementInfo'
+							type1='personShibie'
+						}else if(e.value[0]=='识别银行卡号'){
+							type='admin.unimall.certificateManagementInfo'
+							type1='bankShibie'
+						}
+						this.$request.baseRequest(type, type1,{certificateImage:this.currectData.certificateImage}, failres => {
+							console.log('res+++++', failres.errmsg)
+							this.$refs.uToast.show({
+								type: 'error',
+								message: failres.errmsg,
+							})
+							uni.hideLoading()
+						}).then(res => {
+							console.log(res.data)
+							this.$refs.uToast.show({
+								type: 'success',
+								message: '识别成功',
+							})
+							uni.hideLoading()
+							this.credentials=res.data
+							this.credentialsShow=true
+						})		
+					}
+				}, 1000)
+			},
+			pickerConfirm(e){
+				
+				this.show=false
+				this.getCountdownTime(e)
+				console.log(e)
+				
+			},
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 102 - 22
xiaochengxu/pages/mySet/myCard.vue

@@ -18,7 +18,13 @@
 			<mescroll-body v-if='!addstatus&&cardList.length==0||cardList.length>0' :up="upOption" ref="mescrollRef" @init="mescrollInit" @up="upCallback" @down="downCallback">
 				<view v-if='cardList.length>0' class="">
 				<view v-for='(item,index) in cardList' class="">
-					<view v-if='!item.editstatus'>{{item.certificateName}}</view>
+					<view v-if='!item.editstatus'>
+					{{item.certificateName}}  
+					<text v-if='item.personNo'>({{item.personNo1}})</text>
+					<u-icon v-if='item.personNo' @click='clip(0,item)' name="file-text-fill" color="#2979ff" size="28"></u-icon>
+					<text v-if='item.bankNo'>({{item.bankNo1}})</text>
+					<u-icon v-if='item.bankNo' @click='clip(1,item)' name="file-text-fill" color="#2979ff" size="28"></u-icon>
+				</view>
 					<u--input v-else
 					v-model="item.certificateName"
 					placeholder="输入证件名称"
@@ -100,7 +106,23 @@
 		    </view>
 		</u-popup>
 		<u-modal @cancel='modalshow=false' confirmText='删除' showCancelButton='true' @confirm='delConfirm' :show="modalshow" title="提示" content='确定删除证件?'></u-modal>
-		<u-modal @cancel='modalshow=false' confirmText='删除' showCancelButton='true' @confirm='delConfirm' :show="modalshow" title="提示" content='确定删除证件?'></u-modal>
+		<u-modal @cancel='credentialscancel' cancelText='重新识别'  confirmText='确认号码' showCancelButton='true' @confirm='credentialsConfirm' :show="credentialsShow" title="提示" >
+			<view class="slot-content">
+				证件号码
+				<u--input
+				v-if='shibie=="识别身份证号"'
+				v-model="credentials.recPersonNo"
+				placeholder="输入证件名称"
+				border="none"
+				></u--input>
+				<u--input
+				v-if='shibie=="识别银行卡号"'
+				v-model="credentials.bankNo"
+				placeholder="输入证件名称"
+				border="none"
+				></u--input>
+			</view>
+		</u-modal>
 		<u-modal :show="modalstatusshow" confirmText='继续返回'  cancelText='取消' @confirm='confirm' @cancel='cancel' showCancelButton='true' title="提示" content='有证件处于编辑状态未提交。'></u-modal>
 		<u-toast ref="uToast"></u-toast>
 	</view>
@@ -127,7 +149,10 @@
 				checkedList:[],
 				addstatus:false,
 				id:'',
-				credentialsShow:false
+				credentialsShow:false,
+				credentials:{},
+				shibie:'',
+				shibieList:[]
 			};
 		},
 		onLoad() {
@@ -138,27 +163,39 @@
 			this.userInfo = uni.getStorageSync("userInfo")
 			this.cardData.commonId=uni.getStorageSync("userInfo").id
 		},
+		// onShareAppMessage(res) {
+		// 	console.log(res,111111111111)
+		// 	return {
+		// 	    title: '页面分享的标题',
+		// 	    path: '/pages/mySet/lookCard',
+		// 		imageUrl: '/static/imgs/mylogo.png'
+		// 	}
+		// },
+
+		// onShareTimeline() {
+		// 	return {
+		// 		title: '商通线上商城',
+		// 		path: '/pages/index/index',
+		// 		imageUrl: 'https://cdn.uviewui.com/uview/swiper/1.jpg'
+		// 	};
+		// },
 		methods: {
-			onShareAppMessage(res) {
-				    return {
-				      title: '页面分享的标题',
-				      path: '/pages/my/my',
-					  imageUrl: '/static/imgs/mylogo.png'
-				    }
-			},
-			onShareAppMessage(res) {
-				    return {
-				      title: '页面分享的标题',
-				      path: '/pages/my/my',
-					  imageUrl: '/static/imgs/mylogo.png'
+			clip(status,item){
+				uni.setClipboardData({
+				    data: status==1?item.bankNo:item.personNo, // e是你要保存的内容
+				    success: function () {
+						uni.showToast({
+							title:'复制成功',
+							icon:'none'
+						})
 				    }
+				})
 			},
-			onShareTimeline() {
-				return {
-					title: '商通线上商城',
-					path: '/pages/index/index',
-					imageUrl: 'https://cdn.uviewui.com/uview/swiper/1.jpg'
-				};
+			toUrl() {
+				uni.navigateTo({
+					url: '/pages/share/poster?carId=' + this.carInfo.car_id,
+				})
+				this.handleHiddenShare()
 			},
 			edit(item){
 				if(item.editstatus){
@@ -207,7 +244,13 @@
 			pickerConfirm(e){
 				this.show=false
 				console.log(e)
+				uni.showLoading({
+						title: '数据加载中',
+						mask:true
+					})
 				var type='',type1=''
+				this.shibie=e.value[0]
+				this.shibieList=JSON.parse(JSON.stringify(this.cardList[this.checkedList[0]]))
 				if(e.value[0]=='识别身份证号'){
 					type='admin.unimall.certificateManagementInfo'
 					type1='personShibie'
@@ -223,12 +266,14 @@
 					})
 					uni.hideLoading()
 				}).then(res => {
+					console.log(res.data)
 					this.$refs.uToast.show({
 						type: 'success',
 						message: '识别成功',
 					})
 					uni.hideLoading()
-					this.credentialsShow
+					this.credentials=res.data
+					this.credentialsShow=true
 				})
 			},
 			checkboxChange(e,i){
@@ -275,6 +320,39 @@
 				}
 				this.show=true
 			},
+			credentialsConfirm(){
+				var type='',type1=''
+				if(this.shibie=='识别身份证号'){
+					this.shibieList.personNo=this.credentials.recPersonNo
+				}else if(this.shibie=='识别银行卡号'){
+					this.shibieList.bankNo=this.credentials.bankNo
+				}
+				// if(this.shibie=='识别身份证号'){
+				// 	type='admin.unimall.certificateManagementInfo'
+				// 	type1='personShibie'
+				// }else if(this.shibie=='识别银行卡号'){
+				// 	type='admin.unimall.certificateManagementInfo'
+				// 	type1='bankShibie'
+				// }
+
+				this.$request.baseRequest('admin.unimall.certificateManagementInfo', 'update',{certificateManagementInfo:JSON.stringify(this.shibieList)}, failres => {
+					console.log('res+++++', failres.errmsg)
+					this.$refs.uToast.show({
+						type: 'error',
+						message: failres.errmsg,
+					})
+					uni.hideLoading()
+				}).then(res => {
+					this.$refs.uToast.show({
+						type: 'success',
+						message: '编辑成功',
+					})
+					this.credentialsShow=false
+					this.checkedList=[]
+					uni.hideLoading()
+					this.mescroll.resetUpScroll( )
+				})
+			},
 			confirm(){
 				uni.navigateBack()
 			},
@@ -413,6 +491,8 @@
 					if(res.data.items.length>0){
 						for(var i=0;i<res.data.items.length;i++){
 							res.data.items[i].editstatus=false
+							if(res.data.items[i].personNo) res.data.items[i].personNo1='*'+(res.data.items[i].personNo.substring(res.data.items[i].personNo.length-4))
+							if(res.data.items[i].bankNo) res.data.items[i].bankNo1='*'+(res.data.items[i].bankNo.substring(res.data.items[i].bankNo.length-4))
 						}
 					}
 					this.cardList=this.cardList.concat(res.data.items)

+ 53 - 4
xiaochengxu/pages/mySet/set.vue

@@ -2,16 +2,17 @@
 	<view>
 		<view class='flex'>
 			<text>允许他人分享我的名片</text>
-			<u-switch v-model="value3" ></u-switch>
+			<u-switch  v-model="value1" :activeValue='true' :inactiveValue='false' @change="change($event,1)"></u-switch>
 		</view>
 		<view class="flex">
 			<text>允许圈子成员查看我的主页</text>
-			<u-switch v-model="value3" ></u-switch>
+			<u-switch v-model="value2"  @change="change($event,2)"></u-switch>
 		</view>
 		<view class="flex">
 			<text>自动接受换名片邀请</text>
-			<u-switch v-model="value3" ></u-switch>
+			<u-switch v-model="value3"  @change="change($event,3)"></u-switch>
 		</view>
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
@@ -19,8 +20,56 @@
 	export default {
 		data() {
 			return {
-				
+				value1:false,
+				value2:false,
+				value3:false
 			};
+		},
+		onShow() {
+			this.value1=(uni.getStorageSync("userInfo").shareCard==1?true:false)
+			this.value2=(uni.getStorageSync("userInfo").lookPage==1?true:false)
+			this.value3=(uni.getStorageSync("userInfo").autoAccept==1?true:false)
+		},
+		methods: {
+			change(e,status){
+				console.log(e)
+				var data={id:uni.getStorageSync("userInfo").id}
+				if(status==1){
+					if(e) data.shareCard=1
+					else data.shareCard=0
+				}else if(status==2){
+					if(e) data.lookPage=1
+					else data.lookPage=0
+				}else if(status==3){
+					if(e) data.autoAccept=1
+					else data.autoAccept=0
+				}
+				this.$request.baseRequest('admin.unimall.commonUserInfo', 'update',{commonUserInfo:JSON.stringify(data)}, failres => {
+					console.log('res+++++', failres.errmsg)
+					this.$refs.uToast.show({
+						type: 'error',
+						message: failres.errmsg,
+					})
+					uni.hideLoading()
+				}).then(res => {
+					this.$refs.uToast.show({
+						type: 'success',
+						message: '设置成功',
+					})
+					var userInfo=uni.getStorageSync("userInfo")
+					if(status==1){
+						if(e) userInfo.shareCard=1
+						else userInfo.shareCard=0
+					}else if(status==2){
+						if(e) userInfo.lookPage=1
+						else userInfo.lookPage=0
+					}else if(status==3){
+						if(e) userInfo.autoAccept=1
+						else userInfo.autoAccept=0
+					}
+					uni.setStorageSync("userInfo",userInfo)
+				})
+			}
 		}
 	}
 </script>