gjy 2 years ago
parent
commit
ee23e37782
4 changed files with 36 additions and 29 deletions
  1. 25 23
      components/search.vue
  2. 3 1
      pages/business/businessNew.vue
  3. 2 2
      pages/business/record.vue
  4. 6 3
      pages/business/release.vue

+ 25 - 23
components/search.vue

@@ -2,8 +2,8 @@
 	<view class="content">
 		<view class="search-box">
 			<!-- mSearch组件 如果使用原样式,删除组件元素-->
-			<mSearch class="mSearch-input-box" :mode="2" button="inside" :placeholder="defaultKeyword"
-				@search="doSearch(false)" @input="inputChange" @confirm="doSearch(false)" :oldsearch='keyword2' v-model="keyword"></mSearch>
+			<mSearch ref='msearch' class="mSearch-input-box" :mode="2" button="inside" :placeholder="defaultKeyword"
+				@search="doSearch(false)" @input="inputChange" @confirm="doSearch(false)" v-model="keyword"></mSearch>
 			<view class="cancel" @click="cancel">
 				取消
 			</view>
@@ -96,33 +96,35 @@
 			this.init();
 		},
 		watch: {
-			searchcontent:{
-				handler(oldValue, newValue) {
-					this.keyword=oldValue
-					// if (val != '') {
-					// 	this.place = val
-					// }
-				},
-				deep:true,
-				immediate:true,
-			},
-			keyword:{
-				handler(oldValue, newValue) {
-					this.keyword2=oldValue
-					console.log(oldValue, newValue,11111111)
-					// if (val != '') {
-					// 	this.place = val
-					// }
-				},
-				deep:true,
-				immediate:true,
-			},
+			// searchcontent:{
+			// 	handler(oldValue, newValue) {
+			// 		this.keyword=oldValue
+			// 		// if (val != '') {
+			// 		// 	this.place = val
+			// 		// }
+			// 	},
+			// 	deep:true,
+			// 	immediate:true,
+			// },
+			// keyword:{
+			// 	handler(oldValue, newValue) {
+			// 		this.keyword2=oldValue
+			// 		console.log(oldValue, newValue,11111111)
+			// 		// if (val != '') {
+			// 		// 	this.place = val
+			// 		// }
+			// 	},
+			// 	deep:true,
+			// 	immediate:true,
+			// },
 		},
 		methods: {
 			cancel() {
 				this.$emit('searchVal', '')
 			},
 			init() {
+				this.$refs.msearch.getFocus()
+				console.log(this.$refs.msearch)
 				this.loadDefaultKeyword();
 				this.loadOldKeyword();
 				this.loadHotKeyword();

+ 3 - 1
pages/business/businessNew.vue

@@ -105,7 +105,7 @@
 				:content-style="contentStyle" showCancelButton='true' @confirm="cancelFollow" @cancel="show=false">
 			</u-modal>
 		</view>
-		<search :searchcontent='keyword1' v-if="isShowSearch" @searchVal='searchVal'></search>
+		<search  :searchcontent='keyword1' v-if="isShowSearch" @searchVal='searchVal'></search>
 		<u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
 			:content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
 			showCancelButton='false' content="尚未登录,是否立即登录" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
@@ -141,6 +141,7 @@
 				selectType: '',
 				isSHowReleaseAlert: null,
 				canReset: false,
+				focus:false,
 				selectPlace: '',
 				mescroll: null,
 				isShowAlert: false,
@@ -319,6 +320,7 @@
 
 				this.keyword1 = this.keyword
 				uni.setStorageSync('jiaoyikeyword', this.keyword)
+				uni.setStorageSync('jiaoyifocus', true)
 				this.isShowSearch = true
 			},
 			follow(val, type) {

+ 2 - 2
pages/business/record.vue

@@ -49,9 +49,9 @@
 				</view>
 			</view>
 		</mescroll-body>
-		<view class="add" @click="release">
+	<!-- 	<view class="add" @click="release">
 			<u-icon name="plus" color="#fff" size="34" bold></u-icon>
-		</view>
+		</view> -->
 		<u-toast ref="uToast" />
 		<u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
 			:content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'

+ 6 - 3
pages/business/release.vue

@@ -72,9 +72,9 @@
 			<view class="edit-nickname">
 				<view>昵称长度限制在2-24个字符内</view>
 				<u-input v-model="dataObj.publisher" border class='nickname-input' />
-				<view style="display:flex;justify-content: space-between;">
-					<u-button type="default" size="medium" class="nickname-btn" @click="showNickname=false">取消</u-button>
-					<u-button type="success" size="medium" class="nickname-btn" @click="nickNamesubmit">保存</u-button>
+				<view style="text-align: center;display:flex;justify-content: space-between;">
+					<u-button style='flex:1;margin-right:20rpx;' type="default" size="medium" class="nickname-btn" @click="showNickname=false">取消</u-button>
+					<u-button style='flex:1;' type="success" size="medium" class="nickname-btn" @click="nickNamesubmit">保存</u-button>
 					
 				</view>
 			</view>
@@ -461,6 +461,9 @@
 </script>
 
 <style lang="scss" scoped>
+	/deep/.u-size-medium{
+		padding:0 60rpx;
+	}
 	.content {
 		// overflow: hidden;
 		padding-bottom: 100rpx;