xiaobin.zhang 2 år sedan
förälder
incheckning
f0c0d22b95

+ 14 - 10
App.vue

@@ -56,12 +56,14 @@
 			});
 			WebIM.conn.listen({
 				onOpened(message) {
+					console.log('监听onOpened>>>>>',message);
+					
 					if (
-						getCurrentRoute() == "pages/login/login" ||
+						getCurrentRoute() == "pages/user/user" ||
 						getCurrentRoute() == "pages/login_token/login_token"
 					) {
 						me.globalData.onLoginSuccess(
-							uni.getStorageSync("myUsername").toLowerCase()
+							uni.getStorageSync("myUsername")
 						);
 					}
 				},
@@ -309,15 +311,16 @@
 				closed: false,
 				curOpenOpt: {},
 				open(opt) {
-					uni.showLoading({
-						title: "正在初始化客户端..",
-						mask: true,
-					});
+					// uni.showLoading({
+					// 	title: "加载中...",
+					// 	mask: true,
+					// });
 					this.curOpenOpt = opt;
 					WebIM.conn.open(opt).then(() => {
 						//token获取成功,即可开始请求用户属性。
 						disp.fire("em.mian.profile.update");
 						disp.fire("em.mian.friendProfile.update");
+						console.log('>>>>>token成功')
 					}).catch((err) => {
 						console.log('>>>>>token获取失败', err)
 					});
@@ -333,12 +336,12 @@
 				},
 			},
 			onLoginSuccess: function(myName) {
-				uni.hideLoading();
-				uni.redirectTo({
-					url: "../conversation/conversation?myName=" + myName,
+				// uni.hideLoading();
+				uni.navigateTo({
+					url: "/chat/conversation/conversation?myName=" + myName,
 				});
 			},
-
+			
 			getUserInfo(cb) {
 				var me = this;
 
@@ -641,6 +644,7 @@
 					let newName = curMember.split(myName)[0]
 					let chatMsgs;
 					chatMsgs = uni.getStorageSync(curMember) || [];
+					console.log('chatMsgs>>>>>',chatMsgs);
 					//过滤消息来源与当前登录ID一致的消息,不计入总数中。
 					chatMsgs = chatMsgs.filter((msg) => msg.yourname !== myName);
 					if (pushAry.includes(newName)) return result

+ 1 - 0
chat/chatroom/chatroom.vue

@@ -21,6 +21,7 @@ export default {
   props: {},
   // options = 系统传入的 url 参数
   onLoad(options) {
+	  console.log('options>>>',options)
     let username = JSON.parse(options.username);
     this.setData({
       username: username

+ 26 - 17
chat/components/chat/inputbar/suit/main/main.css

@@ -1,4 +1,3 @@
-
 .text-input {
 	width: 100%;
 	/* height: 100rpx; */
@@ -13,7 +12,7 @@
 	display: inline-block;
 	margin: 10rpx;
 	line-height: 48rpx;
-	position:relative;
+	position: relative;
 	top: 0;
 	background-color: #fff;
 	border-radius: 16px;
@@ -35,31 +34,41 @@
 	background-color: #fff;
 }
 
-.f-row{
+.f-row {
 	/* height:100rpx; */
-	display:flex;
-	align-items:center;
+	display: flex;
+	align-items: center;
 	background-color: #f2f2f2;
 }
-.send-btn-style{
-	font-size: 10px;
-	background-color: #2196F3;
-	color: #fff;
-    margin-right: 10px;
+
+.send-btn-style {
+	font-size: 10px !important;
+	background-color: #2196F3 !important;
+	color: #fff !important;
+	margin-right: 10px !important;
+	border-radius: 5px !important;
+	margin-right: auto !important;
+	overflow: hidden !important;
+	padding-left: 28rpx !important;
+	padding-right: 28rpx !important;
+	line-height: 2.6 !important;
 }
-.hover{
-	background-color:#075ca1
+
+.hover {
+	background-color: #075ca1
 }
-.icon-mic{
+
+.icon-mic {
 	width: 22px;
-    height: 22px;
+	height: 22px;
 	padding: 5px 10px;
 	position: relative;
 	top: 2px;
 }
-.f-row-x{
+
+.f-row-x {
 	padding-bottom: 30px;
-	display:flex;
-	align-items:center;
+	display: flex;
+	align-items: center;
 	background-color: #f2f2f2;
 }

+ 4 - 1
chat/components/chat/msglist/msglist.vue

@@ -58,6 +58,9 @@
 <script>
 	let msgStorage = require("../msgstorage");
 	let disp = require("../../../../hxChatSDK/utils/broadcast");
+	let timeFormats = require("../../../../hxChatSDK/utils/timeFormat");
+	
+	
 	let LIST_STATUS = {
 		SHORT: "scroll_view_change",
 		NORMAL: "scroll_view"
@@ -218,7 +221,7 @@
 			//处理时间显示
 			handleTime() {
 				return (item) => {
-					return this.$u.timeFormat(item.time, 'mm/dd/hh:MM')
+					return timeFormats.timeFormat(item.time, 'mm/dd/hh:MM')
 				}
 			}
 		},

+ 7 - 2
chat/conversation/conversation.vue

@@ -95,7 +95,9 @@
 </template>
 
 <script>
+	const req = require("../../utils/request.js");
 	let disp = require("../../hxChatSDK/utils/broadcast");
+	let timeFormats = require("../../hxChatSDK/utils/timeFormat");
 	var WebIM = require("../../hxChatSDK/utils/WebIM")["default"];
 	let isfirstTime = true;
 	import swipeDelete from "../../chat/components/chat/swipedelete/swipedelete";
@@ -221,7 +223,7 @@
 			//处理时间显示
 			handleTime() {
 				return (item) => {
-					return this.$u.timeFormat(item.time, 'mm/dd/hh:MM')
+					return timeFormats.timeFormat(item.time, 'mm/dd/hh:MM')
 				}
 			}
 		},
@@ -470,12 +472,15 @@
 				var my = uni.getStorageSync("myUsername");
 				var nameList = {
 					myName: my,
-					your: detail.username,
+					// your: detail.username,
+					your: '测试号'
 				};
 				const friendUserInfoMap = getApp().globalData.friendUserInfoMap;
 				if (friendUserInfoMap.has(nameList.your) && friendUserInfoMap.get(nameList.your)?.nickname) {
 					nameList.yourNickName = friendUserInfoMap.get(nameList.your).nickname;
 				}
+
+				console.log('JSON.stringify(nameList)》》》》', JSON.stringify(nameList));
 				uni.navigateTo({
 					url: "../chatroom/chatroom?username=" + JSON.stringify(nameList),
 				});

+ 1 - 1
hxChatSDK/utils/WebIMConfig.js

@@ -37,7 +37,7 @@ let config = {
   /*
    * Application AppKey
    */
-  appkey: "easemob#easeim",
+  appkey: "1124230724161884#lly",
 
   /*
    * Whether to use HTTPS      '1177161227178308#xcx'

+ 55 - 0
hxChatSDK/utils/timeFormat.js

@@ -0,0 +1,55 @@
+// padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
+// 所以这里做一个兼容polyfill的兼容处理
+if (!String.prototype.padStart) {
+	// 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
+	String.prototype.padStart = function(maxLength, fillString = ' ') {
+		if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
+			'fillString must be String')
+		let str = this
+		// 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
+		if (str.length >= maxLength) return String(str)
+
+		let fillLength = maxLength - str.length,
+			times = Math.ceil(fillLength / fillString.length)
+		while (times >>= 1) {
+			fillString += fillString
+			if (times === 1) {
+				fillString += fillString
+			}
+		}
+		return fillString.slice(0, fillLength) + str;
+	}
+}
+
+// 其他更多是格式化有如下:
+// yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
+function timeFormat(dateTime = null, fmt = 'yyyy-mm-dd') {
+	// 如果为null,则格式化当前时间
+	if (!dateTime) dateTime = Number(new Date());
+	// 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
+	if (dateTime.toString().length == 10) dateTime *= 1000;
+	let date = new Date(Number(dateTime));
+	let ret;
+	let opt = {
+		"y+": date.getFullYear().toString(), // 年
+		"m+": (date.getMonth() + 1).toString(), // 月
+		"d+": date.getDate().toString(), // 日
+		"h+": date.getHours().toString(), // 时
+		"M+": date.getMinutes().toString(), // 分
+		"s+": date.getSeconds().toString() // 秒
+		// 有其他格式化字符需求可以继续添加,必须转化成字符串
+	};
+	for (let k in opt) {
+		ret = new RegExp("(" + k + ")").exec(fmt);
+		if (ret) {
+			fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
+		};
+	};
+	return fmt;
+}
+
+
+
+module.exports = {
+	timeFormat: timeFormat,
+}

+ 388 - 388
pages/user/user.vue

@@ -2,20 +2,25 @@
 	<view>
 		<view :class="'mine' + (skinNotColor ? ' not-color' : '')">
 			<view :style="'height:' + systems.barHeight + 'rpx;'"></view>
-			<view :style="'top:' + systems.ktxStatusHeight + 'rpx;z-index:3;position: absolute;'+'line-height: '+ systems.navigationHeight+'rpx;text-align: center;left: 0;font-size: 34rpx;right: 0;color: #FFFFFF;'">
+			<view
+				:style="'top:' + systems.ktxStatusHeight + 'rpx;z-index:3;position: absolute;'+'line-height: '+ systems.navigationHeight+'rpx;text-align: center;left: 0;font-size: 34rpx;right: 0;color: #FFFFFF;'">
 				我的
 			</view>
-			<image src="../../static/pages/images/userBg.png" class="wdbg" @click="jumpUrl('mine/userinfo/userinfo')"></image>
+			<image src="../../static/pages/images/userBg.png" class="wdbg" @click="jumpUrl('mine/userinfo/userinfo')">
+			</image>
 			<view class="minec">
 				<view class="minec-img" @click="jumpUrl('mine/set/index')">
-					<image :src="userInfos.avatar ? userInfos.avatar : '/static/pages/images/userimg.png'" mode="aspectFit" class="user"></image>
+					<image :src="userInfos.avatar ? userInfos.avatar : '/static/pages/images/userimg.png'"
+						mode="aspectFit" class="user"></image>
 				</view>
 				<view class="mines" @click="jumpUrl('mine/set/index')" v-if="isLogin">
 					<view class="ddflex">
 						{{ userInfos.nickName }}
-						<image src="../../static/pages/images/rz_qy_h.png" class="auth-img" v-if="userInfos.authStatus == 2"></image>
+						<image src="../../static/pages/images/rz_qy_h.png" class="auth-img"
+							v-if="userInfos.authStatus == 2"></image>
 						<image src="../../static/pages/images/rz_qy.png" class="auth-img" v-else></image>
-						<image src="../../static/pages/images/rz_gr_h.png" class="auth-img" v-if="userInfos.companyStatus == 2"></image>
+						<image src="../../static/pages/images/rz_gr_h.png" class="auth-img"
+							v-if="userInfos.companyStatus == 2"></image>
 						<image src="../../static/pages/images/rz_gr.png" class="auth-img" v-else></image>
 					</view>
 					<text class="edu" v-if="userInfos.mobile">{{ styleHintPhoneText(userInfos.mobile) }}</text>
@@ -28,17 +33,14 @@
 				<!-- </navigator> -->
 			</view>
 			<view class="datas dflex">
-				<navigator url="" hover-class="none" class="li" v-if="is_open_wallet.isOpenWallet == 1" @click="jumpUrl('wallet/index/index')">
+				<navigator url="" hover-class="none" class="li" v-if="is_open_wallet.isOpenWallet == 1"
+					@click="jumpUrl('wallet/index/index')">
 					<text>{{ userMoney ? userMoney : '0.00' }}</text>
 					钱包
 				</navigator>
-				<navigator
-					url=""
-					hover-class="none"
-					class="li"
+				<navigator url="" hover-class="none" class="li"
 					:style="is_open_wallet.isOpenWallet != 1 && Open_Points_Mall != 1 ? 'width:50%' : ''"
-					@click="jumpUrl('mine/coupons/coupons')"
-				>
+					@click="jumpUrl('mine/coupons/coupons')">
 					<text>{{ userInfos.coupon ? userInfos.coupon : '0' }}</text>
 					优惠券
 				</navigator>
@@ -46,13 +48,9 @@
 					<text>{{ userInfos.integral ? userInfos.integral : '0' }}</text>
 					积分
 				</navigator>
-				<navigator
-					url=""
-					hover-class="none"
-					class="li"
+				<navigator url="" hover-class="none" class="li"
 					:style="is_open_wallet.isOpenWallet != 1 && Open_Points_Mall != 1 ? 'width:50%' : ''"
-					@click="jumpUrl('mine/collect/collect')"
-				>
+					@click="jumpUrl('mine/collect/collect')">
 					<text>{{ userInfos.collect ? userInfos.collect : '0' }}</text>
 					收藏
 				</navigator>
@@ -81,7 +79,7 @@
 				</view>
 			</view>
 		</view>
-		
+
 		<view class="con">
 			<view class="order">
 				<navigator url="" hover-class="none" class="tits dflex" @click="jumpUrl('mine/order/order')">
@@ -126,7 +124,7 @@
 				</view>
 			</view>
 		</view>
-		
+
 		<view class="box mlist">
 			<navigator class="li ddflex" url="/promote/invite/invite" hover-class="none">
 				<image :src="picUrlss + 'scrm/mico_fx.png'" class="mico"></image>
@@ -134,15 +132,17 @@
 				<image src="../../static/pages/images/more.png" class="rico"></image>
 			</navigator>
 		</view>
-		
+
 		<view class="box mlist">
 			<view class="li ddflex">
 				<view class="fflex">
-					<contact-button class-name="ddflex" :img-url="picUrlss+'scrm/mico_kf.png'" img-style='width: 49rpx;height: 49rpx;margin: 0 25rpx 0 0;' button-text="联系客服" styles="line-height:initial;"></contact-button>
+					<contact-button class-name="ddflex" :img-url="picUrlss+'scrm/mico_kf.png'"
+						img-style='width: 49rpx;height: 49rpx;margin: 0 25rpx 0 0;' button-text="联系客服"
+						styles="line-height:initial;"></contact-button>
 				</view>
 				<image src="../../static/pages/images/more.png" class="rico"></image>
 			</view>
-			<navigator  class="li ddflex" url="/mine/help/help" hover-class="none">
+			<navigator class="li ddflex" url="/mine/help/help" hover-class="none">
 				<image :src="picUrlss+'ruiteng/my_service5.png'" class="mico" mode="aspectFit"></image>
 				<view class="fflex">帮助中心</view>
 				<image src="../../static/pages/images/more.png" class="rico"></image>
@@ -161,16 +161,10 @@
 		<footer-copyright></footer-copyright>
 		<!-- <view class="placeholder-view" :style="'height:' + (bottomBlankHeignt + 115) + 'rpx'"></view> -->
 		<foot channel="user"></foot>
-		<update-userinfo
-			:update-info="isUpdateInfo"
-			:update-mobile="isUpdateMobile"
-			v-if="isShowUpdate"
-			@closeUpdate="closeUpdate"
-			@updateInfo="updateInfo"
-			@updateMobile="updateMobile"
-		></update-userinfo>
-		
-		<view class="lt ddflex" @click="jumpUrl('chat/conversation/conversation')">
+		<update-userinfo :update-info="isUpdateInfo" :update-mobile="isUpdateMobile" v-if="isShowUpdate"
+			@closeUpdate="closeUpdate" @updateInfo="updateInfo" @updateMobile="updateMobile"></update-userinfo>
+
+		<view class="lt ddflex" @click="jumpConversation()">
 			<view class="ddflex" style="position: relative;width: 100%;height: 100%;">
 				<image src="../../static/pages/images/lt.png"></image>
 				<view class="lt-num">1</view>
@@ -180,404 +174,410 @@
 </template>
 
 <script>
-// pages/user/user.js
-const app = getApp();
-const req = require('../../utils/request.js');
-const util = require('../../utils/util.js');
-const route = require('../../utils/route');
-import foot from '../../components/nav-bar/index';
-import footerCopyright from '../../components/footer-copyright/footer-copyright';
-
-export default {
-	data() {
-		return {
-			systems: {},
-			skinNotColor: req.public.skinNotColor,
-			picUrlss: req.public.picUrls,
-			bottomBlankHeignt: app.globalData.isIPhoneX ? 68 : 0,
-			// merchantId: '',
-			iconSrc: req.public.iconSrc,
-			//头部页面背景链接
-			isHideVip: true,
-			//隐藏会员
-			isVip: true,
-			//是否是会员
-			IS_secondary_members: 0,
-			distr: '',
-			userinfovip: '',
-			userMoney: '',
-			istetphone: '',
-			logo: '',
-			name: '',
-			is_open_wallet: '',
-			Open_Points_Mall: '',
-			statistics: '',
-			vipList: '',
-			rongkang: req.header.appId,
-			isSign: '',
-			sign: 0,
-			isLogin: false,
-			noLogin: false,
-			is_open_shop: '',
-			isShowSign: false, //是否显示签到按钮
-			config: {},
-			userInfo:{},
-			userInfos: {},
-			isShowUpdate: false, //是否显示更新信息弹窗
-			isUpdateInfo: false, //更新用户信息
-			isUpdateMobile: false, //绑定手机号
-		};
-	},
-
-	components: {
-		foot,
-		footerCopyright
-	},
-	props: {},
-
-	onLoad(options) {
-		uni.hideTabBar();
-
-		uni.setNavigationBarColor({
-			frontColor: this.skinNotColor ? '#000' : '#ffffff',
-			backgroundColor: this.skinNotColor ? '#fff' : req.public.titleTopBgColor
-		});
-
-		if (JSON.parse(req.getStorage('configRes')).IS_secondary_members) {
-			let IS_secondary_members = JSON.parse(req.getStorage('configRes')).IS_secondary_members;
-			console.log(IS_secondary_members);
-			this.setData({
-				IS_secondary_members: IS_secondary_members
-			});
-		}
-		this.userInfo = req.getStorage('userInfo');
-		// #ifdef MP-WEIXIN
-		let userInfo = req.getStorage('userInfo');
-		if (req.isAuth()) {
-			setTimeout(res => {
-				if (!userInfo.avatar || userInfo.nickName == '微信用户' || this.userInfos.nickName == '微信用户') {
-					this.isShowUpdate = true;
-					this.isUpdateInfo = true;
-				}
-				if (userInfo.avatar && !userInfo.mobile && (this.userInfos && !this.userInfos.mobile)) {
-					this.isShowUpdate = true;
-					this.isUpdateMobile = true;
-				}
-			}, 2000);
-		}
-		// #endif
-	},
-
-	onShow: function() {
-		let userInfo = req.getStorage('userInfo');
-		this.isLogin = req.isLogins(false);
-		if (this.isLogin) {
-			this.getMy();
-			this.getAbout();
-			this.getRule();
-			this.noLogin = true;
-		} else {
-			this.noLogin = false;
-		}
-	},
-	methods: {
-		styleHintPhoneText(phone) {
-			var phones=util.styleHintPhoneText(phone);
-			return phones;
-		},
+	// pages/user/user.js
+	const app = getApp();
+	const req = require('../../utils/request.js');
+	const util = require('../../utils/util.js');
+	const route = require('../../utils/route');
+	import foot from '../../components/nav-bar/index';
+	import footerCopyright from '../../components/footer-copyright/footer-copyright';
 
-		jumpUrl(url) {
-			if (req.isLogins(true)) {
-				app.globalData.navigateTo(url);
-			}
+	export default {
+		data() {
+			return {
+				systems: {},
+				skinNotColor: req.public.skinNotColor,
+				picUrlss: req.public.picUrls,
+				bottomBlankHeignt: app.globalData.isIPhoneX ? 68 : 0,
+				// merchantId: '',
+				iconSrc: req.public.iconSrc,
+				//头部页面背景链接
+				isHideVip: true,
+				//隐藏会员
+				isVip: true,
+				//是否是会员
+				IS_secondary_members: 0,
+				distr: '',
+				userinfovip: '',
+				userMoney: '',
+				istetphone: '',
+				logo: '',
+				name: '',
+				is_open_wallet: '',
+				Open_Points_Mall: '',
+				statistics: '',
+				vipList: '',
+				rongkang: req.header.appId,
+				isSign: '',
+				sign: 0,
+				isLogin: false,
+				noLogin: false,
+				is_open_shop: '',
+				isShowSign: false, //是否显示签到按钮
+				config: {},
+				userInfo: {},
+				userInfos: {},
+				isShowUpdate: false, //是否显示更新信息弹窗
+				isUpdateInfo: false, //更新用户信息
+				isUpdateMobile: false, //绑定手机号
+			};
 		},
 
-		jumpMerchantManage() {
-			let token = req.getStorage('AUTH_TOKEN');
-			this.jumpUrl('merchant/index?appId=' + req.header.appId + '&token=' + token);
+		components: {
+			foot,
+			footerCopyright
 		},
-		// 是否签到{}
-		isSignFun() {
-			req.getRequest('/api/integral/isSign', {}, res => {
-				this.setData({
-					isSign: res
-				});
+		props: {},
+
+		onLoad(options) {
+			uni.hideTabBar();
+
+			uni.setNavigationBarColor({
+				frontColor: this.skinNotColor ? '#000' : '#ffffff',
+				backgroundColor: this.skinNotColor ? '#fff' : req.public.titleTopBgColor
 			});
-		},
 
-		gouserInfo() {
-			app.globalData.navigateTo('mine/userinfo/userinfo');
-		},
-		getDistributionConfig() {
-			req.postRequest('/api/distribution/config', {}, res => {
+			if (JSON.parse(req.getStorage('configRes')).IS_secondary_members) {
+				let IS_secondary_members = JSON.parse(req.getStorage('configRes')).IS_secondary_members;
+				console.log(IS_secondary_members);
 				this.setData({
-					distr: res
+					IS_secondary_members: IS_secondary_members
 				});
-			});
+			}
+			this.userInfo = req.getStorage('userInfo');
+			// #ifdef MP-WEIXIN
+			let userInfo = req.getStorage('userInfo');
+			if (req.isAuth()) {
+				setTimeout(res => {
+					if (!userInfo.avatar || userInfo.nickName == '微信用户' || this.userInfos.nickName == '微信用户') {
+						this.isShowUpdate = true;
+						this.isUpdateInfo = true;
+					}
+					if (userInfo.avatar && !userInfo.mobile && (this.userInfos && !this.userInfos.mobile)) {
+						this.isShowUpdate = true;
+						this.isUpdateMobile = true;
+					}
+				}, 2000);
+			}
+			// #endif
+		},
+
+		onShow: function() {
+			let userInfo = req.getStorage('userInfo');
+			this.isLogin = req.isLogins(false);
+			if (this.isLogin) {
+				this.getMy();
+				this.getAbout();
+				this.getRule();
+				this.noLogin = true;
+			} else {
+				this.noLogin = false;
+			}
 		},
-		// 签到
-		signFun() {
-			req.postRequest('/api/integral/sign', {}, data => {
-				if (data) {
-					req.msg('连续签到' + data.continuityDay + '天' + ',获得' + data.IntegralChange + '积分');
+		methods: {
+			styleHintPhoneText(phone) {
+				var phones = util.styleHintPhoneText(phone);
+				return phones;
+			},
+
+			jumpUrl(url) {
+				if (req.isLogins(true)) {
+					app.globalData.navigateTo(url);
+				}
+			},
+
+			jumpMerchantManage() {
+				let token = req.getStorage('AUTH_TOKEN');
+				this.jumpUrl('merchant/index?appId=' + req.header.appId + '&token=' + token);
+			},
+			// 是否签到{}
+			isSignFun() {
+				req.getRequest('/api/integral/isSign', {}, res => {
 					this.setData({
-						sign: 1
+						isSign: res
 					});
-					this.getOpenPonints();
-				}
-			});
-		},
-		getuserVip() {
-			req.getRequest('/api/user/levelDetails', {}, data => {
-				let expireTime = Array;
-
-				if (data.expireTime) {
-					expireTime = data.expireTime.split(' ');
-					data.expireTime = data.expireTime.replace(/-/g, '/');
-				} // 解决苹果不兼容---日期
-				// data.expireTime=data.expireTime.replace(/-/g, '/')
-
-				let nowTime = new Date().getTime();
-				let endTime = new Date(data.expireTime).getTime();
-				let times = parseInt((endTime - nowTime) / 1000); // var expireTime= new Date(data.expireTime)
-				// var time1=expireTime.getTime();
-
-				// console.log(times, nowTime, endTime, data.expireTime);
-				this.setData({
-					userinfovip: data,
-					['userinfovip.expireTime']: expireTime[0]
 				});
+			},
 
-				if (times <= 0) {
+			gouserInfo() {
+				app.globalData.navigateTo('mine/userinfo/userinfo');
+			},
+			getDistributionConfig() {
+				req.postRequest('/api/distribution/config', {}, res => {
 					this.setData({
-						['userinfovip.end']: true
+						distr: res
 					});
-				} else {
+				});
+			},
+			// 签到
+			signFun() {
+				req.postRequest('/api/integral/sign', {}, data => {
+					if (data) {
+						req.msg('连续签到' + data.continuityDay + '天' + ',获得' + data.IntegralChange + '积分');
+						this.setData({
+							sign: 1
+						});
+						this.getOpenPonints();
+					}
+				});
+			},
+			getuserVip() {
+				req.getRequest('/api/user/levelDetails', {}, data => {
+					let expireTime = Array;
+
+					if (data.expireTime) {
+						expireTime = data.expireTime.split(' ');
+						data.expireTime = data.expireTime.replace(/-/g, '/');
+					} // 解决苹果不兼容---日期
+					// data.expireTime=data.expireTime.replace(/-/g, '/')
+
+					let nowTime = new Date().getTime();
+					let endTime = new Date(data.expireTime).getTime();
+					let times = parseInt((endTime - nowTime) / 1000); // var expireTime= new Date(data.expireTime)
+					// var time1=expireTime.getTime();
+
+					// console.log(times, nowTime, endTime, data.expireTime);
 					this.setData({
-						['userinfovip.end']: false
+						userinfovip: data,
+						['userinfovip.expireTime']: expireTime[0]
 					});
-				}
 
-				// console.log(data);
-			});
-		},
-		getOpenPonints() {
-			req.getRequest('/api/integral/returnIntegral', {}, res => {
-				this.setData({
-					integral: res
-				});
-			});
-		},
-		getMy() {
-			let that = this;
-			req.getRequest('/api/user/my', {}, data => {
-				// data.merchantId = req.getStorage('userInfo').merchantId
-				data.nickName = req.excludeSpecial(data.nickName);
-				this.userInfos = data;
-				// that.setData(data); // this.isbindmobile();
-				console.log('userinfo==' + JSON.stringify(data));
-				this.isSignFun();
-				this.getstatistics(data);
-				this.getDistributionConfig();
-				this.getuserVip();
-				this.getuserMoney();
-				this.getVip();
-				this.getOpenPonints();
-				// console.log(this);
-			});
-		},
+					if (times <= 0) {
+						this.setData({
+							['userinfovip.end']: true
+						});
+					} else {
+						this.setData({
+							['userinfovip.end']: false
+						});
+					}
 
-		getuserMoney() {
-			let is_open_wallet = JSON.parse(req.getStorage('configRes')).is_open_wallet;
-
-			if (is_open_wallet) {
-				if (JSON.parse(is_open_wallet).isOpenWallet == 1) {
-					route.extendNew({}, res => {
-						// console.log(parseFloat(res.all).toFixed(2));
-						if (res)
-							this.setData({
-								userMoney: parseFloat(res.all).toFixed(2)
-							});
+					// console.log(data);
+				});
+			},
+			getOpenPonints() {
+				req.getRequest('/api/integral/returnIntegral', {}, res => {
+					this.setData({
+						integral: res
 					});
-				}
-			}
-		},
+				});
+			},
+			getMy() {
+				let that = this;
+				req.getRequest('/api/user/info', {}, data => {
+					// data.merchantId = req.getStorage('userInfo').merchantId
+					data.nickName = req.excludeSpecial(data.nickName);
+					this.userInfos = data;
+					// that.setData(data); // this.isbindmobile();
+					console.log('userinfo==' + JSON.stringify(data));
+					this.isSignFun();
+					this.getstatistics(data);
+					this.getDistributionConfig();
+					this.getuserVip();
+					this.getuserMoney();
+					this.getVip();
+					this.getOpenPonints();
+					// console.log(this);
+				});
+			},
 
-		getAbout() {
-			var _this = this;
+			getuserMoney() {
+				let is_open_wallet = JSON.parse(req.getStorage('configRes')).is_open_wallet;
 
-			req.getRequest('/api/config', {}, function(res) {
-				_this.phone = res.CONFIG_SERVICE_HOT_MOBILE;
-				_this.config = res;
-				_this.setData({
-					istetphone: res.user_bind_mobile,
-					logo: res.CONFIG_PROJECT_LOGO,
-					name: res.CONFIG_PROJECT_TITLE
-				});
+				if (is_open_wallet) {
+					if (JSON.parse(is_open_wallet).isOpenWallet == 1) {
+						route.extendNew({}, res => {
+							// console.log(parseFloat(res.all).toFixed(2));
+							if (res)
+								this.setData({
+									userMoney: parseFloat(res.all).toFixed(2)
+								});
+						});
+					}
+				}
+			},
+
+			getAbout() {
+				var _this = this;
 
-				// console.log(res);
-				if (res && res.is_open_wallet) {
+				req.getRequest('/api/config', {}, function(res) {
+					_this.phone = res.CONFIG_SERVICE_HOT_MOBILE;
+					_this.config = res;
 					_this.setData({
-						is_open_wallet: JSON.parse(res.is_open_wallet)
+						istetphone: res.user_bind_mobile,
+						logo: res.CONFIG_PROJECT_LOGO,
+						name: res.CONFIG_PROJECT_TITLE
 					});
-				}
 
-				if (res.is_open_shop) {
-					_this.is_open_shop = res.is_open_shop;
-				}
+					// console.log(res);
+					if (res && res.is_open_wallet) {
+						_this.setData({
+							is_open_wallet: JSON.parse(res.is_open_wallet)
+						});
+					}
 
-				// if (res.user_bind_mobile == '1') {
-				// 	let userInfo = req.getStorage('userInfo');
+					if (res.is_open_shop) {
+						_this.is_open_shop = res.is_open_shop;
+					}
 
-				// 	if (userInfo && (userInfo.mobile == null || userInfo.mobile == '')) {
-				// 		app.globalData.openPage('pages/authorize/authorize?bindmobile=1');
-				// 	}
-				// }
-			});
-			// 是否开启积分商城
-			req.getRequest(
-				'/api/params/value',
-				{
-					type: 'Open_Points_Mall'
-				},
-				res => {
-					this.setData({
-						Open_Points_Mall: res
-					});
-				}
-			);
-		},
+					// if (res.user_bind_mobile == '1') {
+					// 	let userInfo = req.getStorage('userInfo');
 
-		callPhone() {
-			if (req.isLogins(true)) {
-				uni.makePhoneCall({
-					phoneNumber: this.phone
+					// 	if (userInfo && (userInfo.mobile == null || userInfo.mobile == '')) {
+					// 		app.globalData.openPage('pages/authorize/authorize?bindmobile=1');
+					// 	}
+					// }
 				});
-			}
-		},
+				// 是否开启积分商城
+				req.getRequest(
+					'/api/params/value', {
+						type: 'Open_Points_Mall'
+					},
+					res => {
+						this.setData({
+							Open_Points_Mall: res
+						});
+					}
+				);
+			},
 
-		goUrl() {
-			app.globalData.openPage('mine/vip/vip');
-		},
+			callPhone() {
+				if (req.isLogins(true)) {
+					uni.makePhoneCall({
+						phoneNumber: this.phone
+					});
+				}
+			},
 
-		// 门店统计
-		getstatistics(data) {
-			let from = {};
+			goUrl() {
+				app.globalData.openPage('mine/vip/vip');
+			},
 
-			if (data.listShopBase && data.listShopBase != null && data.listShopBase.length > 0) {
-				from.shopId = data.listShopBase[0].id;
-			}
+			// 门店统计
+			getstatistics(data) {
+				let from = {};
 
-			if (data.listMerchant && data.listMerchant != null && data.listMerchant.length > 0 && data.listShopBase.length < 1) {
-				from.merchantId = data.listMerchant[0].id;
-			}
+				if (data.listShopBase && data.listShopBase != null && data.listShopBase.length > 0) {
+					from.shopId = data.listShopBase[0].id;
+				}
 
-			req.getRequest('/api/order/statistics', from, data => {
-				this.setData({
-					statistics: data
-				});
-				console.log(data);
-			});
-		},
-		getRule() {
-			let that = this;
-			req.getRequest('/api/integral/config', {}, res => {
-				if (res && res.length > 0) {
-					res.map(it => {
-						if (it.illustrate && it.illustrate.indexOf('签到') > -1) {
-							if (it.state == 2) {
-								that.isShowSign = true;
-							}
-						}
-					});
+				if (data.listMerchant && data.listMerchant != null && data.listMerchant.length > 0 && data.listShopBase
+					.length < 1) {
+					from.merchantId = data.listMerchant[0].id;
 				}
-			});
-		},
-		getVipListOrg() {
-			if (this.vipList && this.userinfovip) {
-				if (!this.userinfovip.levelGrade) {
-					this.vipList.map((it, index) => {
-						this.vipList[0].isShowInfo = true;
+
+				req.getRequest('/api/order/statistics', from, data => {
+					this.setData({
+						statistics: data
 					});
-				} else {
-					this.vipList.map((it, index) => {
-						if (this.userinfovip.level == it.id) {
-							if (index < this.vipList.length - 1) {
-								this.vipList[index + 1].isShowInfo = true;
+					console.log(data);
+				});
+			},
+			getRule() {
+				let that = this;
+				req.getRequest('/api/integral/config', {}, res => {
+					if (res && res.length > 0) {
+						res.map(it => {
+							if (it.illustrate && it.illustrate.indexOf('签到') > -1) {
+								if (it.state == 2) {
+									that.isShowSign = true;
+								}
 							}
-						}
-					});
+						});
+					}
+				});
+			},
+			getVipListOrg() {
+				if (this.vipList && this.userinfovip) {
+					if (!this.userinfovip.levelGrade) {
+						this.vipList.map((it, index) => {
+							this.vipList[0].isShowInfo = true;
+						});
+					} else {
+						this.vipList.map((it, index) => {
+							if (this.userinfovip.level == it.id) {
+								if (index < this.vipList.length - 1) {
+									this.vipList[index + 1].isShowInfo = true;
+								}
+							}
+						});
+					}
 				}
-			}
-		},
-		getVip() {
-			req.getRequest('/api/levelStrategy/userLevelList', {}, data => {
-				if (data && data.length > 0) {
-					data.map((it, index) => {
-						it.upgradeTerm = JSON.parse(it.upgradeTerm);
+			},
+			getVip() {
+				req.getRequest('/api/levelStrategy/userLevelList', {}, data => {
+					if (data && data.length > 0) {
+						data.map((it, index) => {
+							it.upgradeTerm = JSON.parse(it.upgradeTerm);
+							it.isShowInfo = false;
+							// if(index == 0) it.isShowInfo = true;
+							return it;
+						});
+						this.vipList = data;
+						this.getVipListOrg();
+					}
+				});
+			},
+			showInfo(index) {
+				if (!this.vipList[index].isShowInfo) {
+					this.vipList.map(it => {
 						it.isShowInfo = false;
-						// if(index == 0) it.isShowInfo = true;
 						return it;
 					});
-					this.vipList = data;
-					this.getVipListOrg();
 				}
-			});
-		},
-		showInfo(index) {
-			if (!this.vipList[index].isShowInfo) {
-				this.vipList.map(it => {
-					it.isShowInfo = false;
-					return it;
-				});
-			}
-			this.vipList[index].isShowInfo = !this.vipList[index].isShowInfo;
-		},
-		closeUpdate() {
-			this.isShowUpdate = false;
-		},
-		updateInfo(e) {
-			this.isUpdateInfo = e;
-			this.getMy();
-		},
-		updateMobile(e) {
-			this.isUpdateMobile = e;
-			this.getMy();
+				this.vipList[index].isShowInfo = !this.vipList[index].isShowInfo;
+			},
+			closeUpdate() {
+				this.isShowUpdate = false;
+			},
+			updateInfo(e) {
+				this.isUpdateInfo = e;
+				this.getMy();
+			},
+			updateMobile(e) {
+				this.isUpdateMobile = e;
+				this.getMy();
+			},
+
+
+			jumpConversation() {
+				req.jumpConversation();
+			},
+
+			// 判断强制绑定手机号
+			// isbindmobile() {
+			//   if (req.getStorage('configRes')) {
+			//     let configRes = JSON.parse(req.getStorage('configRes'))
+			//     this.setData({ istetphone: configRes.user_bind_mobile, logo: configRes.CONFIG_PROJECT_LOGO, name: configRes.CONFIG_PROJECT_TITLE })
+			//   } else {
+			//     req.g('/api/config', (res) => {
+			//       req.setStorage('configRes', JSON.stringify(res))
+			//       this.setData({ istetphone: res.user_bind_mobile, logo: res.CONFIG_PROJECT_LOGO, name: res.CONFIG_PROJECT_TITLE })
+			//     })
+			//   }
+			//   if(this.data.istetphone=='1'){
+			//       // 获取用户手机号
+			//     let userInfo= req.getStorage('userInfo')
+			//     if(userInfo.mobile==null||userInfo.mobile==''){
+			//       console.log("获取用户手机号===============================")
+			//       app.openPage('pages/authorize/authorize?bindmobile=1')
+			//     }
+			//   }
+			// },
 		},
-		// 判断强制绑定手机号
-		// isbindmobile() {
-		//   if (req.getStorage('configRes')) {
-		//     let configRes = JSON.parse(req.getStorage('configRes'))
-		//     this.setData({ istetphone: configRes.user_bind_mobile, logo: configRes.CONFIG_PROJECT_LOGO, name: configRes.CONFIG_PROJECT_TITLE })
-		//   } else {
-		//     req.g('/api/config', (res) => {
-		//       req.setStorage('configRes', JSON.stringify(res))
-		//       this.setData({ istetphone: res.user_bind_mobile, logo: res.CONFIG_PROJECT_LOGO, name: res.CONFIG_PROJECT_TITLE })
-		//     })
-		//   }
-		//   if(this.data.istetphone=='1'){
-		//       // 获取用户手机号
-		//     let userInfo= req.getStorage('userInfo')
-		//     if(userInfo.mobile==null||userInfo.mobile==''){
-		//       console.log("获取用户手机号===============================")
-		//       app.openPage('pages/authorize/authorize?bindmobile=1')
-		//     }
-		//   }
-		// },
-	},
-	created() {
-		const systemInfo = uni.getSystemInfoSync();
-		// px转换到rpx的比例
-		let pxToRpxScale = 750 / systemInfo.windowWidth;
-		let systems = {
-			ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
-			navigationHeight: 44 * pxToRpxScale // 导航栏的高度
-		};
-		systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
-		this.systems = systems;
-	}
-};
+		created() {
+			const systemInfo = uni.getSystemInfoSync();
+			// px转换到rpx的比例
+			let pxToRpxScale = 750 / systemInfo.windowWidth;
+			let systems = {
+				ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
+				navigationHeight: 44 * pxToRpxScale // 导航栏的高度
+			};
+			systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
+			this.systems = systems;
+		}
+	};
 </script>
 <style>
-@import './user.css';
-</style>
+	@import './user.css';
+</style>

+ 91 - 39
utils/request.js

@@ -1,4 +1,6 @@
 const app = getApp();
+let WebIM = (wx.WebIM = require("../hxChatSDK/utils/WebIM")["default"]);
+
 const env = {
 	NODE_ENV: 'pota',
 	dev: {
@@ -11,10 +13,10 @@ const env = {
 		// apiUrl: 'http://192.168.110.98:8098'   
 		// apiUrl: 'http://192.168.110.180:8098' ,//f
 		// apiUrl: 'http://192.168.110.182:8098' ,//z
-		// apiUrl: 'http://192.168.110.176:8098' //y
+		apiUrl: 'http://192.168.110.176:8098' //y
 		// apiUrl: 'http://192.168.110.117:8098'//l
 		// apiUrl: 'http://192.168.110.216:8098'
-		apiUrl: 'http://192.168.110.180:8098' //wjg
+		// apiUrl: 'http://192.168.110.180:8098' //wjg
 	}
 }
 
@@ -34,7 +36,7 @@ const publics = {
 	'storemanagers': 'https://websmall.zhiqiyun.com?appId=', //saas门店管理地址(智企云所有)
 	'channel': '', //处方中间渠道号  SAAS系统为空
 	'is_customer_pick_up': false,
-	
+
 	// 'adGroupId': '1196269897935630352', //享团-宜得了
 	'mapLBSKEY': 'YQZBZ-6LMC4-IGQUO-XE64O-4UJL6-YNB77',
 	'iconSrc': 'red/',
@@ -94,10 +96,11 @@ const silenceLogin = (parentId, merchantId) => {
 				}
 				return new Promise((resolve, reject) => {
 					postRequest('/api/v3/silence/login', params, data => {
-						if(data.token) setStorage('AUTH_TOKEN',data.token);
-						getRequest('/api/user/my', {}, suc => {
+						if (data.token) setStorage('AUTH_TOKEN', data.token);
+						getRequest('/api/user/info', {}, suc => {
 							data.isDistriUser = suc.isDistriUser;
 							setStorage('userInfo', data);
+							getIMToken(false);
 						});
 						resolve();
 					});
@@ -108,6 +111,54 @@ const silenceLogin = (parentId, merchantId) => {
 	// #endif
 }
 
+
+const getIMToken = (isUpdatToken) => {
+	var user = getStorage('userInfo');
+	getRequest('/api/im/msg/userToken', {}, suc => {
+		setStorage('imToken', suc);
+		if (isUpdatToken) {
+			//更新token
+			
+			
+			uni.setStorage({
+			    key: "myUsername",
+			    data: 'RS_' + user.id
+			});
+			getApp().globalData.conn.open({
+				user: 'RS_' + user.id,
+				accessToken: getStorage('imToken'),
+			});
+			getApp().globalData.onLoginSuccess(uni.getStorageSync("myUsername"));
+		} else {
+			//初始化IM
+			uni.setStorage({
+			    key: "myUsername",
+			    data: 'RS_' + user.id
+			});
+			getApp().globalData.conn.open({
+				apiUrl: WebIM.config.apiURL,
+				user: 'RS_' + user.id,
+				pwd: getStorage('imToken'),
+				accessToken: getStorage('imToken'),
+				//grant_type: this.data.grant_type,
+				appKey: WebIM.config.appkey
+			});
+		}
+	}, true);
+}
+
+/**
+ * 跳转进入消息列表
+ */
+const jumpConversation = () => {
+	if (!isLogins(true)) { //未登录
+		return;
+	}
+
+	getIMToken(true);
+
+}
+
 const getWXUserProfile = (suc) => {
 	let that = this;
 	var sessionKey = '';
@@ -189,11 +240,11 @@ const baseRequest = (url, data, method, success, isLoad) => {
 	getToken(token => {
 		if (!isLoad) uni.showNavigationBarLoading();
 		header.authorityToken = token;
-		if (url.indexOf('/v3') != -1 || url.indexOf('/paper/create') != -1) {
-			header['content-type'] = 'application/json;charset=UTF-8'
-		} else {
-			header['content-type'] = 'application/x-www-form-urlencoded'
-		}
+		// if (url.indexOf('/v3') != -1 || url.indexOf('/paper/create') != -1) {
+		// 	header['content-type'] = 'application/json;charset=UTF-8'
+		// } else {
+		header['content-type'] = 'application/json;charset=UTF-8'
+		// }
 		uni.request({
 			url: env[env.NODE_ENV].apiUrl + url,
 			data: clearValueEmpty(data),
@@ -237,22 +288,22 @@ const loadIng = (msg) => {
 
 /**POST请求 */
 const postRequest = (url, data, success, isLoad) => {
-	header['content-type'] = 'application/x-www-form-urlencoded'
+	header['content-type'] = 'application/json;charset=UTF-8'
 	baseRequest(url, data, 'post', success, isLoad);
 }
 const postRequestLoding = (url, data, success, isLoding) => {
-	header['content-type'] = 'application/x-www-form-urlencoded'
+	header['content-type'] = 'application/json;charset=UTF-8'
 	baseRequest(url, data, 'post', success, false, isLoding);
 }
 
 /**GET请求 */
 const getRequest = (url, data, success, isLoad) => {
-	header['content-type'] = 'application/x-www-form-urlencoded'
+	header['content-type'] = 'application/json;charset=UTF-8'
 	baseRequest(url, data, 'get', success, isLoad);
 }
 /**Put请求 */
 const putRequest = (url, data, success, isLoad) => {
-	header['content-type'] = 'application/x-www-form-urlencoded'
+	header['content-type'] = 'application/json;charset=UTF-8'
 	baseRequest(url, data, 'put', success, isLoad)
 }
 const putRequestJson = (url, data, success, isLoad) => {
@@ -512,7 +563,7 @@ const removeStorage = (key) => {
 // }
 
 //微信支付订单公共方法 
-const payOrder = (id,success) => {
+const payOrder = (id, success) => {
 	var loctionAddressMap = getStorage('loctionAddressMap');
 	var datas = {
 		id: id
@@ -521,26 +572,26 @@ const payOrder = (id,success) => {
 		datas.province = loctionAddressMap.province;
 		datas.city = loctionAddressMap.city;
 	};
-	if(getStorage('isVideoScene')){
+	if (getStorage('isVideoScene')) {
 		uni.checkBeforeAddOrder({
-			success (res){ 
-				console.log('下单前置检查',res)
+			success(res) {
+				console.log('下单前置检查', res)
 				let data = res.data;
 				data.requiredFundType = 0;
 				datas.sceneCheckStr = JSON.stringify(data);
-				wexinPay(datas,success)
+				wexinPay(datas, success)
 			},
 		})
-	}else{
-		wexinPay(datas,success)
+	} else {
+		wexinPay(datas, success)
 	}
-	
+
 }
 
 //支付中或已支付
-const payStatus = (json, id, success) =>{
-	if(json&&json.code === 115){
-		setTimeout(res=>{
+const payStatus = (json, id, success) => {
+	if (json && json.code === 115) {
+		setTimeout(res => {
 			uni.hideLoading();
 			isShowLoading = false;
 			uni.showModal({
@@ -548,10 +599,9 @@ const payStatus = (json, id, success) =>{
 				content: '当前订单正在支付或30秒后重试',
 				confirmText: '我知道了',
 				showCancel: false,
-				success(res) {
-				}
+				success(res) {}
 			})
-		},3000)
+		}, 3000)
 		return false;
 	}
 	if (json.type === 2 || json.type === 3) {
@@ -575,7 +625,7 @@ const payStatus = (json, id, success) =>{
 }
 
 // 支付成功回调
-const paySuccess = (id,success) =>{
+const paySuccess = (id, success) => {
 	console.log('支付成功')
 	let i = 0;
 	let timer = setInterval(() => {
@@ -593,7 +643,7 @@ const paySuccess = (id,success) =>{
 	}, 500);
 }
 // 支付失败回调
-const payFail = (id) =>{
+const payFail = (id) => {
 	console.log('支付失败')
 	postRequest('/api/order/cancelPay', {
 		id: id
@@ -615,10 +665,10 @@ const wexinPay = (datas, success) => {
 	postRequest('/api/order/weixin/pay', datas, json => {
 		// console.log('json',json)
 		payStatus(json, datas.id, success)
-		
+
 		const sceneCheckStr = datas.sceneCheckStr;
-		
-		if(sceneCheckStr && JSON.parse(sceneCheckStr).requiredFundType === 1){ 
+
+		if (sceneCheckStr && JSON.parse(sceneCheckStr).requiredFundType === 1) {
 			console.log('拉起收银台')
 			wx.requestOrderPayment({
 				timeStamp: json.timeStamp,
@@ -628,14 +678,14 @@ const wexinPay = (datas, success) => {
 				orderInfo: json.orderInfo,
 				paySign: json.sign,
 				success: function() {
-					paySuccess(datas.id,success)
+					paySuccess(datas.id, success)
 				},
 				fail: function(res) {
 					console.log(res);
 					payFail(datas.id)
 				}
 			})
-		}else{
+		} else {
 			uni.requestPayment({
 				timeStamp: json.timeStamp,
 				nonceStr: json.nonceStr,
@@ -643,7 +693,7 @@ const wexinPay = (datas, success) => {
 				signType: json.signType,
 				paySign: json.sign,
 				success: function() {
-					paySuccess(datas.id,success)
+					paySuccess(datas.id, success)
 				},
 				fail: function(res) {
 					console.log(res);
@@ -683,7 +733,7 @@ const wexinPay = (datas, success) => {
 			provider: 'alipay',
 			orderInfo: json.packages,
 			success: function() {
-				paySuccess(datas.id,success)
+				paySuccess(datas.id, success)
 			},
 			fail: function(res) {
 				payFail(datas.id)
@@ -1069,7 +1119,7 @@ var tab = [{
 		click: 'goFound',
 		channel: 'found',
 		index: 3,
-		show:true
+		show: true
 	},
 	{
 		text: "我的",
@@ -1123,5 +1173,7 @@ module.exports = {
 	getWXUserProfile: getWXUserProfile,
 	updataWxInfos: updataWxInfos,
 	saveBehavior: saveBehavior,
-	getBehavior: getBehavior
+	getBehavior: getBehavior,
+	getIMToken: getIMToken,
+	jumpConversation: jumpConversation
 }