ccjgmwz 3 anos atrás
pai
commit
7c3fbe3a12
4 arquivos alterados com 97 adições e 48 exclusões
  1. 1 1
      pages/sale/information.vue
  2. 10 0
      pages/task/my_task.vue
  3. 13 10
      pages/user/user.vue
  4. 73 37
      websocket_sdk.js

+ 1 - 1
pages/sale/information.vue

@@ -569,7 +569,7 @@
 		margin-right:10px;
 	}
 	.yesterday{
-		font-size:18px;
+		font-size:14px;
 		font-weight:600;
 		vertical-align: middle;
 	}

+ 10 - 0
pages/task/my_task.vue

@@ -38,8 +38,12 @@
 </template>
 
 <script>
+	import {
+		mapState
+	} from 'vuex';
 	export default {
 		name: "task",
+		
 		data() {
 			return {
 				PageCur: "task",
@@ -59,8 +63,13 @@
 				keyword:""
 			};
 		},
+		computed: {
+			...mapState(['hasLogin', 'userInfo'])
+		},
 		onShow() {
 			this.getIndexBuyData()
+			this.userInfo =  uni.getStorageSync("userInfo")
+			this.warehouseInOutInfo.phone = this.userInfo.phone
 		},
 		// onLoad(options) {
 		// 	this.getIndexBuyData()
@@ -144,6 +153,7 @@
 					title:"正在加载"
 				})
 				this.warehouseInOutInfo.statusFlag = this.statusFlag
+				this.warehouseInOutInfo.phone = this.userInfo.phone
 				//this.warehouseInOutInfo.status = this.status
 				this.$api.doRequest('get', '/warehouseInOutInfo/selectInfo', this.warehouseInOutInfo).then(res => {
 					if (res.data.code == 200) {

+ 13 - 10
pages/user/user.vue

@@ -18,7 +18,7 @@
 		<view class="indexUp flex">
 			<image v-bind:src="headUrl" class="headPortrait"></image>
 			<view class="personal">
-				<view class="information">{{username}}</view>
+				<view @click="toLogin" class="information">{{hasLogin? username : '立即登录' }}</view>
 				<view class="information">{{userphone}}</view>
 			</view>
 
@@ -35,8 +35,8 @@
 						<text class="text-grey">{{item.name}}</text>
 					</view>
 					<view>
-						<text v-if='item.num==4&&taskTip' class='badge_user'>{{taskTip}}</text>
-						<text v-if='item.num==2&&contractTip' class='badge_user'>{{contractTip}}</text>
+						<text v-if='item.num==2&&taskTip' class='badge_user'>{{taskTip}}</text>
+						<text v-if='item.num==1&&contractTip' class='badge_user'>{{contractTip}}</text>
 						<text class='tip_text cuIcon-right'></text>
 					</view>
 					<!-- <image src="../../static/img/sign/authentication@3x.png" mode=""></image> -->
@@ -255,16 +255,19 @@
 		onShow() {
 			uni.showTabBar()
 			this.loadData()
-			if(this.userInfo.avatarUrl == "" || this.userInfo.avatarUrl == null){
-					this.headUrl = "../../static/img/myimg/YongHu@3x.png"
-			}else if(this.userInfo.avatarUrl != "" || this.userInfo.avatarUrl != null){
+			this.userInfo =  uni.getStorageSync("userInfo")
+			if(!this.userInfo.avatarUrl){
+				this.headUrl = "../../static/img/myimg/YongHu@3x.png"
+			}else{
 				this.headUrl = this.userInfo.avatarUrl
 			}
-			this.username = this.userInfo.userName
-			if(	this.username == null || this.username == ""){
+			if(!this.username){
 				this.username = "请更改昵称"
 			}
-			if(this.userInfo.phone != null || this.userInfo.phone != ""){
+			else{
+				this.username = this.userInfo.userName
+			}
+			if(this.userInfo.phone){
 				this.userphone = this.userInfo.phone
 			}
 		},
@@ -383,7 +386,7 @@
 			toLogin() {
 				if (!this.hasLogin) {
 					uni.navigateTo({
-						url: '/pages/public/login'
+						url: '/pages/public/login_account_number'
 					})
 				}
 				// else if(!this.userInfo.nickname){

+ 73 - 37
websocket_sdk.js

@@ -274,45 +274,81 @@ export default class Websocket {
 					}
 				})
 			}
-			let accessToken = userInfo ? userInfo.accessToken : ''
-			var data = {}
-			var _mt = 'getTips'
-			var _gp = 'integral'
 			uni.request({
-				url: baseUrl + '/m.api',
-				data: {
-					...data,
-					_gp,
-					_mt
-				},
-				method: 'POST',
-				header: {
-					'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
-					'ACCESSTOKEN': accessToken
-				},
-				success: (res) => {						
-					if (res.statusCode === 200) {
-						let name = 'myTip';
-						let value = res.data.data.myTips;
-						store.commit('$uStore', {
-							name,
-							value
-						});
-						name = 'taskTip';
-						value = res.data.data.task;
-						store.commit('$uStore', {
-							name,
-							value
-						});
-						name = 'contractTip';
-						value = res.data.data.contract;
-						store.commit('$uStore', {
-							name,
-							value
-						});
-					}
-				}
+			    url: baseUrlNew + '/salePlanInfo/getTips',
+			    data: {
+			    	phone: userInfo.phone
+			    },
+			    method: 'GET',
+			    success: (res) => {			
+			    	if (res.statusCode === 200) {
+			    		let name = 'myTip';
+			    		let value = res.data.data.myTip;
+			    		store.commit('$uStore', {
+			    			name,
+			    			value
+			    		});
+						if(value != 0){
+							uni.setTabBarBadge({
+								index:3,
+								text:value+""
+							})
+						}
+			    		name = 'taskTip';
+			    		value = res.data.data.taskTip;
+			    		store.commit('$uStore', {
+			    			name,
+			    			value
+			    		});
+			    		name = 'contractTip';
+			    		value = res.data.data.contractTip;
+			    		store.commit('$uStore', {
+			    			name,
+			    			value
+			    		});
+			    	}
+			    }
 			})
+			
+			// let accessToken = userInfo ? userInfo.accessToken : ''
+			// var data = {}
+			// var _mt = 'getTips'
+			// var _gp = 'integral'
+			// uni.request({
+			// 	url: baseUrl + '/m.api',
+			// 	data: {
+			// 		...data,
+			// 		_gp,
+			// 		_mt
+			// 	},
+			// 	method: 'POST',
+			// 	header: {
+			// 		'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
+			// 		'ACCESSTOKEN': accessToken
+			// 	},
+			// 	success: (res) => {						
+			// 		if (res.statusCode === 200) {
+			// 			let name = 'myTip';
+			// 			let value = res.data.data.myTips;
+			// 			store.commit('$uStore', {
+			// 				name,
+			// 				value
+			// 			});
+			// 			name = 'taskTip';
+			// 			value = res.data.data.task;
+			// 			store.commit('$uStore', {
+			// 				name,
+			// 				value
+			// 			});
+			// 			name = 'contractTip';
+			// 			value = res.data.data.contract;
+			// 			store.commit('$uStore', {
+			// 				name,
+			// 				value
+			// 			});
+			// 		}
+			// 	}
+			// })
 		})
 	}
 	getInfo(){