ccjgmwz 2 anni fa
parent
commit
3e80fb849d

+ 38 - 25
xiaochengxu/pages/cardHolder/scanCodeAddCard.vue

@@ -334,9 +334,9 @@
 		onLoad(options) {
 			that = this
 			console.log(options)
+			this.id = options.id.indexOf(",") ? options.id.split(",")[0] : options.id
 			if (uni.getStorageSync("userInfo").phone) {
 				this.userInfo = uni.getStorageSync("userInfo")
-				this.id = options.id.indexOf(",") ? options.id.split(",")[0] : options.id
 				// this.commonId = options.id.indexOf(",") ? options.id.split(",")[1] : ''
 				
 				this.getList()
@@ -392,38 +392,51 @@
 					});
 					return
 				}
-				uni.showLoading({
-					title: '数据加载中',
-					mask: true
-				})
-				this.$request.baseRequest('admin.unimall.cardHolderInfo', 'add', {
-					cardHolderInfo: JSON.stringify({
-						cardId: this.cardInfo.id,
-						remark: this.cardInfo.remark,
-						cardCommonId: this.commonId,
-						myCardId: this.cardInfo.myCardId,
-						commonId: uni.getStorageSync("userInfo").id,
-						classify: this.cardInfo.classify
-					})
+				this.$request.baseRequest('admin.unimall.cardHolderInfo', 'getAdded', {
+					commonId: uni.getStorageSync("userInfo").id,
+					cardId: this.cardInfo.id,
 				}, failres => {
+					console.log('res+++++', failres.errmsg)
 					uni.showToast({
 						icon: "none",
 						title: failres.errmsg,
 						duration: 3000
 					});
-					uni.hideLoading()
-				}).then(res => {
-					uni.showToast({
-						icon: "success",
-						title: '保存成功!',
-						duration: 2000
-					});
-					 uni.setStorageSync("scanAddCardToIndex",1)
-					uni.switchTab({
-						url: "/pages/cardHolder/cardHolder"
-
+				}).then(res1 => {
+					uni.showLoading({
+						title: '数据加载中',
+						mask: true
+					})
+					this.$request.baseRequest('admin.unimall.cardHolderInfo', 'add', {
+						cardHolderInfo: JSON.stringify({
+							cardId: this.cardInfo.id,
+							remark: this.cardInfo.remark,
+							cardCommonId: this.commonId,
+							myCardId: this.cardInfo.myCardId,
+							commonId: uni.getStorageSync("userInfo").id,
+							classify: this.cardInfo.classify
+						})
+					}, failres => {
+						uni.showToast({
+							icon: "none",
+							title: failres.errmsg,
+							duration: 3000
+						});
+						uni.hideLoading()
+					}).then(res => {
+						uni.showToast({
+							icon: "success",
+							title: '保存成功!',
+							duration: 2000
+						});
+						 uni.setStorageSync("scanAddCardToIndex",1)
+						uni.switchTab({
+							url: "/pages/cardHolder/cardHolder"
+					
+						})
 					})
 				})
+				
 			},
 			cancel() {
 				uni.switchTab({

+ 13 - 8
xiaochengxu/pages/cardHolder/search.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<d-search-log :placeholder="'搜索名片'" :color_border="color_border" :color_text="color_border"
-			:search_list_old_man_num='15' :search_list_hot="search_list_hot" :store_key="store_key"
+			:search_list_old_man_num='15' :search_list_hot="search_list_hot" :store_key="store_key" :input_text="input_text"
 			@onClickDelAllApi="onClickDelAll" @onSearchNameApi="onSearchName" @onSearchvoiceApi='onSearchvoice'></d-search-log>
 		<u-popup :show="isRecorderManager" mode="bottom">
 			<view class="shqx" v-if="longPress == '2'">
@@ -51,7 +51,8 @@
 				store_key: 'search_list',
 				isRecorderManager: false,
 				is_clock: true,
-				startPoint: ""
+				startPoint: "",
+				input_text:""
 			};
 		},
 		onLoad(options) {
@@ -100,16 +101,21 @@
 				console.log("录音结束")
 				let that = this
 				this.longPress = '1'; 
+				that.isRecorderManager = false
 				recorderManager.onStop((res) => {
 					this.tempFilePath = res.tempFilePath
 					let _file = ''
 					if (that.is_clock) {
 						_file = uni.getFileSystemManager().readFileSync(res.tempFilePath, "base64")
 						console.log(_file)
+						uni.showLoading({
+							title:"正在识别"
+						})
 						that.$request.baseRequest('admin.unimall.certificateManagementInfo', 'speechRecognition', {
 							voiceMessage: _file,
 						}, failres => {
 							console.log('res+++++', failres.errmsg)
+							uni.hideLoading()
 							uni.showToast({
 								icon:"none",
 								title: failres.errmsg,
@@ -123,12 +129,12 @@
 							}else{
 								var text = res.data.text
 							}
-							
-							uni.setStorageSync('search_val', text);
-							uni.switchTab({
-								url: "/pages/cardHolder/cardHolder"
+							that.input_text = text
+							// uni.setStorageSync('search_val', text);
+							// uni.switchTab({
+							// 	url: "/pages/cardHolder/search"
 
-							})
+							// })
 
 						})
 					}
@@ -146,7 +152,6 @@
 				uni.setStorageSync('search_val', text);
 				uni.switchTab({
 					url: "/pages/cardHolder/cardHolder"
-
 				})
 			}
 		}

+ 1 - 1
xiaochengxu/uni_modules/d-search-log/components/d-search-log/d-search-log.vue

@@ -125,7 +125,7 @@
 					this.search_input = newVal
 					// this.search_input = search_input.toLowerCase()
 					
-					this.saveKeyword()
+					// this.saveKeyword()
 				}
 			},