Просмотр исходного кода

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-app

achao 2 лет назад
Родитель
Сommit
3a175e2d06
4 измененных файлов с 101 добавлено и 60 удалено
  1. 25 23
      components/search.vue
  2. 18 8
      pages/business/businessNew.vue
  3. 2 2
      pages/business/record.vue
  4. 56 27
      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();

+ 18 - 8
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) {
@@ -370,14 +372,22 @@
 					this.isShowAlert = true;
 
 				} else {
-					if (!uni.getStorageSync('userInfo').transactionStatus || uni.getStorageSync('userInfo')
-						.transactionStatus && uni.getStorageSync('userInfo').transactionStatus != '禁止发布') {
-						uni.navigateTo({
-							url: 'release'
+					this.$api.doRequest('get', '/commonUser/getInfo', {id:uni.getStorageSync('userInfo').id}).then(
+						res => {
+							console.log(res.data)
+							if (!res.data.data.transactionStatus || res.data.data.transactionStatus && res.data.data.transactionStatus != '禁止发布') {
+								uni.navigateTo({
+									url: 'release'
+								})
+							} else {
+								uni.showToast({
+									title: '暂未获得发布权限!',
+									icon:'none'
+								})
+							}
 						})
-					} else {
-
-					}
+					
+					
 
 				}
 

+ 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='提示'

+ 56 - 27
pages/business/release.vue

@@ -72,11 +72,16 @@
 			<view class="edit-nickname">
 				<view>昵称长度限制在2-24个字符内</view>
 				<u-input v-model="dataObj.publisher" border class='nickname-input' />
-				<view style="text-align: center;">
-					<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>
 		</u-popup>
+		<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>
 	</view>
 </template>
 
@@ -128,6 +133,7 @@
 						disabled: false
 					}
 				],
+				isShowAlert:false,
 				businesslicense: [],
 				value: '',
 				action: this.$uploadUrl,
@@ -257,6 +263,34 @@
 			closePopup() {
 				this.dataObj.publisher = this.userInfo.wechatNo
 			},
+			cancelClick() {
+				this.isShowAlert = false
+			},
+			alertBtn() {
+				uni.showLoading({
+					title: '数据加载中',
+					mask: true
+				
+				})
+				
+				this.dataObj.urlImg = this.imgList.toString()
+				this.dataObj.remark3 = this.dateFormat(new Date().getTime())
+				this.$api.doRequest('post', '/transactionExchangeInfo/addInfo', this.dataObj).then(res => {
+					console.log(res)
+					if (res.data.code == 200) {
+						this.num = 0
+						uni.navigateBack({
+							delta: 1
+						})
+					} else {
+						uni.showToast({
+							title: res.message,
+							icon: 'none',
+							duration: 2000
+						})
+					}
+				})
+			},
 			nickNamesubmit() {
 				if (this.dataObj.publisher == null || this.dataObj.publisher == "") {
 					this.$api.msg('请输入昵称!')
@@ -320,38 +354,30 @@
 				console.log(this.dataObj)
 				this.showNickname = true
 			},
-			submit() {
-
+			async submit() {
+				
 				if (!this.dataObj.publishingContent && this.businesslicense.length == 0) {
 					uni.showToast({
 						title: "图片和文字不能同时为空,错误提示“发布内容不能为空",
 						icon: 'none',
 						duration: 2000
 					})
+					return
 				}
-				uni.showLoading({
-					title: '数据加载中',
-					mask: true
-
-				})
-
-				this.dataObj.urlImg = this.imgList.toString()
-				this.dataObj.remark3 = this.dateFormat(new Date().getTime())
-				this.$api.doRequest('post', '/transactionExchangeInfo/addInfo', this.dataObj).then(res => {
-					console.log(res)
-					if (res.data.code == 200) {
-						this.num = 0
-						uni.navigateBack({
-							delta: 1
-						})
-					} else {
-						uni.showToast({
-							title: res.message,
-							icon: 'none',
-							duration: 2000
-						})
-					}
-				})
+				var that = this
+				await this.$api.doRequest('get', '/commonUser/getInfo', {id:uni.getStorageSync('userInfo').id}).then(
+					res => {
+						if (!res.data.data.transactionStatus || res.data.data.transactionStatus && res.data.data.transactionStatus != '禁止发布') {
+							that.isShowAlert = true
+						} else {
+							uni.showToast({
+								title: '暂未获得发布权限!',
+								icon:'none'
+							})
+						}
+					})
+				
+				
 			},
 			dateFormat(time) {
 				let date = new Date(time);
@@ -435,6 +461,9 @@
 </script>
 
 <style lang="scss" scoped>
+	/deep/.u-size-medium{
+		padding:0 60rpx;
+	}
 	.content {
 		// overflow: hidden;
 		padding-bottom: 100rpx;