twt 1 hónapja%!(EXTRA string=óta)
szülő
commit
bd17fa050d
8 módosított fájl, 76 hozzáadás és 29 törlés
  1. 3 3
      pages.json
  2. 2 2
      pages/brand.vue
  3. 4 1
      pages/ck.vue
  4. 6 5
      pages/conversations.vue
  5. 19 6
      pages/inquiry.vue
  6. 9 4
      pages/login.vue
  7. 29 6
      pages/mine.vue
  8. 4 2
      pages/qunfa.vue

+ 3 - 3
pages.json

@@ -60,8 +60,8 @@
 	  "style": {
 	    /* "navigationBarTitleText": "询价信息",
 	    "navigationBarBackgroundColor": "#F1F1F1" */
-	    "navigationStyle": "custom",
-	    "enablePullDownRefresh": true 
+	    "navigationStyle": "custom"
+	    ///"enablePullDownRefresh": true 
 	  }
 	},
 	{
@@ -207,7 +207,7 @@
   ],
   "globalStyle": {
     "navigationBarTextStyle": "black",
-    "navigationBarTitleText": "",
+    "navigationBarTitleText": "询价",
     "navigationBarBackgroundColor": "#F3F4F7",
     "backgroundColor": "#F8F8F8"
   },

+ 2 - 2
pages/brand.vue

@@ -16,14 +16,14 @@
 			}
 		},
 		onLoad() {
-          this.userId=uni.getStorageSync('users').userId
+          this.userId=uni.getStorageSync('loginInfo').userId
 		  this.brandsSupplier()
 		},
 		methods: {
           brandsSupplier(){
 			 
 			  this.$http('imSys/brandsSupplier', {
-			     userId:'431A242A-0694-4D6F-9657-C31AD25E7D15'//this.userId,
+			     userId:this.userId, //'431A242A-0694-4D6F-9657-C31AD25E7D15'//
 				
 			    },'GET').then(res => {
 					if(res.code==0){

+ 4 - 1
pages/ck.vue

@@ -70,6 +70,8 @@
 				</view>
 			</view>
 		</view>
+		<!-- <view>token:{{token}}</view>
+		<view>token:{{token}}</view> -->
 		<view class="qunfaBox">
 			<view class="qunfa" @click="qunfa">
 				一键群发
@@ -234,6 +236,7 @@
 						  userId:res.data.userId,
 						  name:res.data.users.name,
 						  avatar:'',
+						  id:res.data.userId,
 					  }
 					  this.currentUser=users
 					  this.connectGoEasy()
@@ -242,7 +245,7 @@
 		   },
 		   connectGoEasy(){
 			   console.log(this.currentUser)
-			   this.currentUser.id="1292F5DA-793B-4549-844E-C5F606869D0C"
+			   //this.currentUser.id="1292F5DA-793B-4549-844E-C5F606869D0C"
 			   uni.setStorageSync('currentUser', this.currentUser);
 			   GoEasy.connect({
 			     id: this.currentUser.id,

+ 6 - 5
pages/conversations.vue

@@ -3,8 +3,8 @@
 	  <view class="navBox">
 	  	<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
 	  	<view class="nav">
-	  		<view class="navLeft" @click="goBack">
-	  			<image src="../static/img/nav_icon_back.png" mode="aspectFit" class="backImg" @click="goback"></image>
+	  		<view class="navLeft" ><!-- @click="goBack" -->
+	  			<!-- <image src="../static/img/nav_icon_back.png" mode="aspectFit" class="backImg" @click="goback"></image> -->
 	  		</view>
 	  		<view class="title">询价</view>
 	  		<view class="goVin" ></view>
@@ -40,6 +40,7 @@
                 <text v-else-if="conversation.lastMessage.type === 'file'">[文件消息]</text>
                 <text v-else-if="conversation.lastMessage.type === 'order'">[自定义消息:订单]</text>
                 <text v-else-if="conversation.lastMessage.type === 'pic'">[图片消息]</text>
+				<text v-else-if="conversation.lastMessage.type === 'car'">[车辆信息]</text>
 				<text v-else>[[未识别内容]]</text>
               </view>
               <view class="item-info-top_content" v-else>
@@ -333,8 +334,8 @@
 
   .conversations .scroll-item_info .item-info-top {
     padding-top: 20rpx;
-    height: 60rpx;
-    line-height: 60rpx;
+   /* height: 60rpx;
+    line-height: 60rpx; */
     display: flex;
     align-items: center;
     justify-content: space-between;
@@ -342,7 +343,7 @@
   }
 
   .conversations .item-info-top_name {
-    font-size: 34rpx;
+    font-size: 30rpx;
     color: #262628;
   }
 

+ 19 - 6
pages/inquiry.vue

@@ -3,8 +3,8 @@
 		<view class="navBox">
 			<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
 			<view class="nav">
-				<view class="navLeft" @click="goBack">
-					<image src="../static/img/nav_icon_back.png" mode="aspectFit" class="backImg" @click="goback"></image>
+				<view class="navLeft" >
+					<!-- <image src="../static/img/nav_icon_back.png" mode="aspectFit" class="backImg" @click="goback"></image> -->
 				</view>
 				<view class="title">询价信息</view>
 				<view class="goVin" @click="vinScanFn">车架号查询</view>
@@ -13,6 +13,7 @@
 		<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
 		<view style="height: 44px;"></view>
 		<scroll-view class="conversations" scroll-y="true">
+		  <view @click="setClipboardData">token:{{token}}</view>
 		  <view v-if="conversations.length > 0">
 		    <view class="scroll-item" v-for="(conversation, key) in conversations" :key="key">
 		      <view class="item-head">
@@ -40,7 +41,8 @@
 		              <text v-else-if="conversation.lastMessage.type === 'file'">[文件消息]</text>
 		              <text v-else-if="conversation.lastMessage.type === 'order'">[自定义消息:订单]</text>
 		              <text v-else-if="conversation.lastMessage.type === 'pic'">[图片消息]</text>
-						<text v-else>[[未识别内容]]</text>
+					  <text v-else-if="conversation.lastMessage.type === 'car'">[车辆信息]</text>
+					  <text v-else>[[未识别内容]]</text>
 		            </view>
 		            <view class="item-info-top_content" v-else>
 		              <text>
@@ -91,6 +93,7 @@
     },
 	onLoad(opt) {
 		  this.token=opt.token
+		  uni.setStorageSync('token',  this.token);
 		this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 		 this.imLoginUrl()
 	},
@@ -137,6 +140,16 @@
           }
         });
       },
+	  setClipboardData(){
+		  uni.setClipboardData({
+		    data: this.token,
+		    success: () => {
+		      uni.showToast({
+		        title: '复制成功'
+		      });
+		    }
+		  });
+	  },
 	  imLoginUrl(){
 	  			   this.$http('imSys/imLoginUrl', {
 	  			      token:this.token,
@@ -377,8 +390,8 @@
 
   .conversations .scroll-item_info .item-info-top {
     padding-top: 20rpx;
-    height: 60rpx;
-    line-height: 60rpx;
+   /* height: 60rpx;
+    line-height: 60rpx; */
     display: flex;
     align-items: center;
     justify-content: space-between;
@@ -386,7 +399,7 @@
   }
 
   .conversations .item-info-top_name {
-    font-size: 34rpx;
+    font-size: 30rpx;
     color: #262628;
   }
 

+ 9 - 4
pages/login.vue

@@ -16,8 +16,8 @@
 		<view class="lineTitle">密码</view>
 		<view style="position: relative;">
 			<input  v-model="form.password" class="lineInput" placeholder="请输入密码"  type="text" :password="!password.visible">
-		   <image src="/static/img/yanjing.png" v-if="!password.visible" @click="switchPasswordVisible" mode="" class="yanjing"></image>
-		   <image src="/static/img/invisible.png" v-if="password.visible" @click="switchPasswordVisible" mode="" class="yanjing2"></image>
+		   <image src="/static/img/yanjing.png" v-if="password.visible" @click="switchPasswordVisible" mode="" class="yanjing"></image>
+		   <image src="/static/img/invisible.png" v-if="!password.visible" @click="switchPasswordVisible" mode="" class="yanjing2"></image>
 		</view>
 	</view>
 	
@@ -93,7 +93,11 @@
       }
     },
     onLoad() {
-      this.userSelector.users = restApi.findUsers();
+		var token= uni.getStorageSync("accessToken")
+		if(token){
+			 uni.switchTab({url: './conversations'});
+		}
+      //this.userSelector.users = restApi.findUsers();
     },
     methods: {
 	  goBack(){
@@ -144,7 +148,8 @@
 			  obj.password=this.form.password
 			  obj.phone=this.form.phone
 			  uni.setStorageSync('currentUser', obj);
-			  uni.setStorageSync('imAccessToken', res.data.imAccessToken);
+			  uni.setStorageSync('token', res.data.imAccessToken.accessToken);
+			  uni.setStorageSync('accessToken', res.data.imAccessToken.accessToken);
 			  uni.switchTab({url: './conversations'});
 		   }) 
          /* if (this.username.trim() !== '' && this.password.value.trim() !== '') {

+ 29 - 6
pages/mine.vue

@@ -10,13 +10,13 @@
     </view>
 	<view class="cont" style="margin-top: -50rpx;"> 
 		<view class="contBox">
-			<view class="line" >
+			<!-- <view class="line" >
 				<view class="lineName">
 					<image src="/static/img/my_icon_history@2x.png" mode="" class="lineIcon"></image>
 					语音播报提醒
 				</view>
 				<image src="/static/img/icon_arrow.png" mode="" class="jtImg"></image>
-			</view>
+			</view> -->
 			<view class="line" @click="goUp">
 				<view class="lineName">
 					<image src="/static/img/my_icon_psw@2x.png" mode="" class="lineIcon"></image>
@@ -32,7 +32,7 @@
 			</view>
 		</view>
 		
-		<view class="contBox" style="margin-top: 20rpx;">
+		<!-- <view class="contBox" style="margin-top: 20rpx;">
 			<view class="line">
 				<view class="lineName">当前版本</view>
 				<view class="version">version1.0.0</view>
@@ -41,13 +41,13 @@
 				<view class="lineName">清除缓存</view>
 				<image src="/static/img/icon_arrow.png" mode="" class="jtImg"></image>
 			</view>
-		</view>
+		</view> -->
 		
 		
 	</view>
     <view class="bottom">
       
-      <view class="logout" @click="logout">注销</view>
+      <view class="logout" @click="logout">退出</view>
     </view>
   </view>
 </template>
@@ -57,13 +57,36 @@
   export default {
     data() {
       return {
-        currentUser: null
+        currentUser: null,
+		token:'',
       }
     },
     onShow() {
       this.currentUser = uni.getStorageSync("currentUser")
+	  var token= uni.getStorageSync("accessToken")
+	  this.token=token
+	  if(token){
+	  	 //this.imLoginUrl()
+	  }else{
+		  uni.navigateTo({
+		    url: './login'
+		  })
+	  }
     },
     methods: {
+		imLoginUrl(){
+			this.$http('imSys/imLoginUrl', {
+			   token:this.token,
+			  },'POST').then(res => {
+			 	  console.log(res)	
+				  if(res.code!=0){
+					  uni.clearStorageSync();
+					  uni.navigateTo({
+					    url: './login'
+					  })
+				  }
+			  }) 
+		},
 		claerHc(){
 			uni.showToast({
 			  icon: 'none',

+ 4 - 2
pages/qunfa.vue

@@ -284,11 +284,13 @@
 		currentUser:'',
 		nLevelIDs:'',
 		vin:'',
+		carModelInfo:'',
       }
     },
     onLoad(options) {
 		this.vin=options.vin
 		this.nLevelIDs=options.nLevelIDs
+		this.carModelInfo=uni.getStorageSync("carModelInfo")
       //聊天对象
       //let id = options.to;
 	  this.friend = uni.getStorageSync("friend");
@@ -375,8 +377,8 @@
 					}
 					console.log(to)
 					 var car = {
-					        vin: 'JHMCM56557C404453',
-					        carModel: "本田 Accord-Sedan [雅阁-三厢] 2.4 自动变速器(AT)"
+					        vin: this.vin,
+					        carModel:this.carModelInfo.brand+this.carModelInfo.carModel
 					};
 					GoEasy.im.createCustomMessage({
 					 type: 'car',  //字符串,可以任意自定义类型,比如红包'hongbao', 订单'order,处方'chufang'