zhaogongxue hai 8 meses
pai
achega
e1b8ded911
Modificáronse 100 ficheiros con 1652 adicións e 847 borrados
  1. 74 20
      App.vue
  2. 11 0
      commont/emoji.js
  3. 85 0
      commont/fuxing.js
  4. 725 0
      components/kj-chat/kj-chat.vue
  5. 1 1
      components/zh-slidingMenu/zhSlidingMenu/zhSlidingMenu.vue
  6. 17 12
      main.js
  7. 478 538
      pageA/chat/chat.vue
  8. 39 18
      pageA/chat/news.vue
  9. 9 3
      pageA/productdetails.vue
  10. 2 1
      pageA/shoplist.vue
  11. 206 252
      pageC/accountSetup/accountSetup.vue
  12. 2 1
      pages.json
  13. 3 0
      pages/login/login.vue
  14. BIN=BIN
      static/imagess/Scanning.png
  15. BIN=BIN
      static/imagess/address.png
  16. BIN=BIN
      static/imagess/address1.png
  17. BIN=BIN
      static/imagess/addressicon.png
  18. BIN=BIN
      static/imagess/bg.png
  19. BIN=BIN
      static/imagess/bianji.png
  20. BIN=BIN
      static/imagess/biaoqing.png
  21. BIN=BIN
      static/imagess/close.png
  22. BIN=BIN
      static/imagess/del.png
  23. BIN=BIN
      static/imagess/dianzan.png
  24. BIN=BIN
      static/imagess/dianzan3.png
  25. BIN=BIN
      static/imagess/dizhi.png
  26. BIN=BIN
      static/imagess/employment.png
  27. BIN=BIN
      static/imagess/fabu1.png
  28. BIN=BIN
      static/imagess/fabu2.png
  29. BIN=BIN
      static/imagess/gongsi-bg.png
  30. BIN=BIN
      static/imagess/index-header.png
  31. BIN=BIN
      static/imagess/index.png
  32. BIN=BIN
      static/imagess/index1.png
  33. BIN=BIN
      static/imagess/jianli.png
  34. BIN=BIN
      static/imagess/jianli2.png
  35. BIN=BIN
      static/imagess/jianpan.png
  36. BIN=BIN
      static/imagess/jingli-img.png
  37. BIN=BIN
      static/imagess/juxing.png
  38. BIN=BIN
      static/imagess/liulan.png
  39. BIN=BIN
      static/imagess/logo.png
  40. BIN=BIN
      static/imagess/luntan.png
  41. BIN=BIN
      static/imagess/luntan1.png
  42. BIN=BIN
      static/imagess/mine-bg.png
  43. BIN=BIN
      static/imagess/mine-huiyuan.png
  44. BIN=BIN
      static/imagess/mine-other1.png
  45. BIN=BIN
      static/imagess/mine-other2.png
  46. BIN=BIN
      static/imagess/mine-other3.png
  47. BIN=BIN
      static/imagess/mine-other4.png
  48. BIN=BIN
      static/imagess/mine-qiehuan.png
  49. BIN=BIN
      static/imagess/mine-setting.png
  50. BIN=BIN
      static/imagess/mine-tabs-bg.png
  51. BIN=BIN
      static/imagess/mine-zhaopin.png
  52. BIN=BIN
      static/imagess/mine-zixun.png
  53. BIN=BIN
      static/imagess/mine.png
  54. BIN=BIN
      static/imagess/mine1.png
  55. BIN=BIN
      static/imagess/more1.png
  56. BIN=BIN
      static/imagess/more2.png
  57. BIN=BIN
      static/imagess/more3.png
  58. BIN=BIN
      static/imagess/more4.png
  59. BIN=BIN
      static/imagess/moren.jpg
  60. BIN=BIN
      static/imagess/nan.png
  61. BIN=BIN
      static/imagess/nv.png
  62. BIN=BIN
      static/imagess/pdf.png
  63. BIN=BIN
      static/imagess/pinglun.png
  64. BIN=BIN
      static/imagess/plus.png
  65. BIN=BIN
      static/imagess/plus1.png
  66. BIN=BIN
      static/imagess/pop.png
  67. BIN=BIN
      static/imagess/qiehuan.png
  68. BIN=BIN
      static/imagess/qiuzhi.png
  69. BIN=BIN
      static/imagess/quanzi.png
  70. BIN=BIN
      static/imagess/rencai-shaixuan.png
  71. BIN=BIN
      static/imagess/rencai.png
  72. BIN=BIN
      static/imagess/rencai1.png
  73. BIN=BIN
      static/imagess/renzheng.png
  74. BIN=BIN
      static/imagess/shezhi.png
  75. BIN=BIN
      static/imagess/unverified.png
  76. BIN=BIN
      static/imagess/vip-popup.png
  77. BIN=BIN
      static/imagess/weirenzheng.png
  78. BIN=BIN
      static/imagess/wenjian.png
  79. BIN=BIN
      static/imagess/woek.png
  80. BIN=BIN
      static/imagess/xiangguan.png
  81. BIN=BIN
      static/imagess/xiaoxi.png
  82. BIN=BIN
      static/imagess/xiaoxi1.png
  83. BIN=BIN
      static/imagess/yaoqing.png
  84. BIN=BIN
      static/imagess/yiguobao.png
  85. BIN=BIN
      static/imagess/yinsi.png
  86. BIN=BIN
      static/imagess/zhiye.png
  87. BIN=BIN
      static/imagess/zixun.png
  88. BIN=BIN
      static/imagess/zixun1.png
  89. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map
  90. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/common/runtime.js.map
  91. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map
  92. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/components/kj-chat/kj-chat.js.map
  93. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/components/kj-flow/kj-flow.js.map
  94. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/components/kj-tabbar/kj-tabbar.js.map
  95. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/components/zh-slidingMenu/zhSlidingMenu/zhSlidingMenu.js.map
  96. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/pageA/changelange.js.map
  97. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/pageA/chat/chat.js.map
  98. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/pageA/chat/news.js.map
  99. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/pageA/comment.js.map
  100. 0 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pageA/common/vendor.js.map

+ 74 - 20
App.vue

@@ -1,24 +1,78 @@
 <script>
-export default {
-  onLaunch: function () {
-    // console.log('App Launch')
-  },
-  onShow: function () {
-    // console.log('App Show')
-  },
-  onHide: function () {
-    // console.log('App Hide')
-  },
-};
+	import {
+		conn
+	} from './utils/WebIM';
+	// import {
+	// 	index
+	// } from "@/units/inquire.js"
+	export default {
+		onLaunch: function() {
+			// console.log('App Launch')
+			setTimeout(() => {
+				if (uni.getStorageSync("token")) {
+					this.HXlogin()
+					/* if (uni.getStorageSync("company_id") == 0) {
+						if (getCurrentPages()[0].route != 'pages/login/login') {
+							uni.reLaunch({
+								url: "/pages/login/login"
+							})
+						}
+					} else {
+						index().then(res => {
+							if (res.code != 1) {
+								if (getCurrentPages()[0].route != 'pages/login/login') {
+									uni.reLaunch({
+										url: "/pages/login/login"
+									})
+								}
+							}
+						})
+					} */
+				} else {
+					// if (getCurrentPages()[0].route != 'pages/login/login') {
+					// 	uni.reLaunch({
+					// 		url: "/pages/login/login"
+					// 	})
+					// }
+				}
+			}, 800)
+		},
+		onShow: function() {
+			// console.log('App Show')
+		},
+		onHide: function() {
+			// console.log('App Hide')
+		},
+		methods: {
+			HXlogin() {
+				if (uni.getStorageSync('user_no') && uni.getStorageSync('pwd')) {
+					var user_no = uni.getStorageSync('user_no')
+					var pwd = uni.getStorageSync('pwd')
+					conn.open({
+						user: user_no,
+						pwd: pwd,
+						appKey: conn.appkey
+					}).then(() => {
+						console.log('res');
+					}).catch(reason => {
+						console.log('失败', reason);
+					})
+
+				}
+			}
+		}
+	};
 </script>
 
 <style lang="scss">
-page {
-  background-color: #f4f4f4;
-}
-.uni-bar {
-  background-color: #f4f4f4;
-}
-/*每个页面公共css */
-@import "@/uview-ui/index.scss";
-</style>
+	page {
+		background-color: #f4f4f4;
+	}
+
+	.uni-bar {
+		background-color: #f4f4f4;
+	}
+
+	/*每个页面公共css */
+	@import "@/uview-ui/index.scss";
+</style>

+ 11 - 0
commont/emoji.js

@@ -0,0 +1,11 @@
+var emoji = [
+	'😀', '😃', '😄', '😁', '😆', '🥹', '😅', '😂', '🤣', '🥲', '😊', '😇', '🙂', '🙃', '😉', '😌', '😍', '🥰',
+	'😘', '😗', '😙', '😋', '😛', '😝', '😜', '🤪', '🤨', '🧐', '🤓', '😎', '🥸', '🤩', '🥳', '😏', '😒', '😞',
+	'😔', '😟', '😕', '🙁',
+	'😣', '😖', '😫', '😩', '🥺', '😢', '😭', '😤', '😠', '😡', '🤬', '🤯', '😳', '🥵', '🥶', '😶‍🌫️', '😱', '😨',
+	'😰', '😥', '😓', '🤗', '🤔', '🫣', '🤭', '🫢', '🫡', '🤫', '🫠', '🤥', '😶', '🫥', '😐', '🫤', '😑', '😬',
+	'🙄', '😯', '😦', '😧', '😮',
+	'😲', '🥱', '😴', '🤤', '😪', '😮‍💨', '😵', '😵‍💫', '🤐', '🥴', '🤢', '🤮', '🤧', '😷', '🤒', '🤕', '🤑',
+	'🤠', '😈', '👿'
+]
+export default emoji

+ 85 - 0
commont/fuxing.js

@@ -0,0 +1,85 @@
+var list = [
+	'欧阳',
+	'太史',
+	'端木',
+	'上官',
+	'司马',
+	'东方',
+	'独孤',
+	'南宫',
+	'万俟',
+	'闻人',
+	'夏侯',
+	'诸葛',
+	'尉迟',
+	'公羊',
+	'赫连',
+	'澹台',
+	'皇甫',
+	'宗政',
+	'濮阳',
+	'公冶',
+	'太叔',
+	'申屠',
+	'公孙',
+	'慕容',
+	'仲孙',
+	'钟离',
+	'长孙',
+	'宇文',
+	'司徒',
+	'鲜于',
+	'司空',
+	'闾丘',
+	'子车',
+	'亓官',
+	'司寇',
+	'巫马',
+	'公西',
+	'颛孙',
+	'壤驷',
+	'公良',
+	'漆雕',
+	'乐正',
+	'宰父',
+	'谷梁',
+	'拓跋',
+	'夹谷',
+	'轩辕',
+	'令狐',
+	'段干',
+	'百里',
+	'呼延',
+	'东郭',
+	'南门',
+	'羊舌',
+	'微生',
+	'公户',
+	'公玉',
+	'公仪',
+	'梁丘',
+	'公仲',
+	'公上',
+	'公门',
+	'公山',
+	'公坚',
+	'左丘',
+	'公伯',
+	'西门',
+	'公祖',
+	'第五',
+	'公乘',
+	'贯丘',
+	'公皙',
+	'南荣',
+	'东里',
+	'东宫',
+	'仲长',
+	'子书',
+	'子桑',
+	'即墨',
+	'达奚',
+	'褚师'
+]
+
+export default list

+ 725 - 0
components/kj-chat/kj-chat.vue

@@ -0,0 +1,725 @@
+<template>
+	<view class="chat-bottom">
+		<view :style="{height: height}"></view>
+		<view class="safe-area-inset-bottom"></view>
+		<view class="chat-down-box u-flex-col u-col-center">
+			<view class="chat-down-btn u-flex u-row-between" v-if="isjianpan">
+				<image @click="openchangyong" v-if="showtype == 2" class="img2" src="@/static/imagess/jianpan.png"
+					mode=""></image>
+				<input class="input" :cursor-spacing="15" v-model="text" type="text" confirm-type="send" @confirm="send"
+					placeholder="请输入消息内容…">
+				<image @click="openemoji" class="img1" src="@/static/imagess/biaoqing.png" mode=""></image>
+				<text @click="send" v-if="text" class="send">发送</text>
+				<image @click="openmore" v-else-if="showtype == 1" class="img2" src="@/static/imagess/jianpan.png"
+					mode="">
+				</image>
+				<image @click="openmore" v-else-if="showtype != 1" class="img2" src="@/static/imagess/wenjian.png"
+					mode=""></image>
+			</view>
+			<view class="chat-down-btn luyin u-flex u-row-between" v-else>
+				<image @click="isjianpan = true" class="img2" src="@/static/imagess/jianpan.png" mode=""></image>
+				<button class="record-btn" :class="longPress == '1' ? 'record-btn-1' : 'record-btn-2'"
+					@longpress="longpressBtn()" @touchend="touchendBtn()">
+					<!-- <image src="@/static/images/luyin.png" mode="" style="changyong" /> -->
+					<text>{{longPress == '1' ? '按住说话' : '说话中...'}}</text>
+				</button>
+			</view>
+			<view class="prompt-layer prompt-layer-1" v-if="longPress == '2'">
+				<view class="prompt-loader">
+					<view class="em" v-for="(item,index) in 15" :key="index"></view>
+				</view>
+				<text class="span">松手结束录音</text>
+			</view>
+
+
+			<view v-if="showtype == 1" class="more-box u-flex acenter">
+				<!-- <view class="more-item u-flex-col u-col-center">
+					<view class="item-img u-flex u-row-center">
+						<image src="../static/images/more1.png" mode=""></image>
+					</view>
+					<view class="item-text">
+						发简历
+					</view>
+				</view> -->
+				<view class="more-item u-flex-col u-col-center" @click="toalbum">
+					<view class="item-img u-flex u-row-center">
+						<image src="/static/imagess/more2.png" mode=""></image>
+					</view>
+					<view class="item-text">
+						相册
+					</view>
+				</view>
+				<view class="more-item u-flex-col u-col-center" @click="tocapture">
+					<view class="item-img u-flex u-row-center">
+						<image src="/static/imagess/more3.png" mode=""></image>
+					</view>
+					<view class="item-text">
+						拍摄
+					</view>
+				</view>
+				<view class="more-item u-flex-col u-col-center" @click="isjianpan = false;showtype = 0">
+					<view class="item-img u-flex u-row-center">
+						<image src="/static/imagess/more4.png" mode=""></image>
+					</view>
+					<view class="item-text">
+						语音
+					</view>
+				</view>
+			</view>
+			<view v-if="showtype == 2" class="changyong-box u-flex-col">
+				<scroll-view scroll-y="true" class="changyong-scroll u-flex-1">
+					<view class="changyong-text" v-for="(a,b) in changlist" :key="b" @click="select(a)">{{a.content}}
+					</view>
+				</scroll-view>
+				<view class="changyong-btn u-flex u-row-between">
+					<text class="text1" @click="toadd">新增</text>
+					<text class="text2"></text>
+					<text class="text1" @click="tolist">管理</text>
+				</view>
+			</view>
+			<scroll-view v-if="showtype == 3" scroll-y="true" class="emoji-scroll">
+				<view class="empji-box u-flex u-flex-wrap">
+					<text v-for="(a,b) in emoji" :key="b" @click="changeemoji(a)">{{a}}</text>
+				</view>
+			</scroll-view>
+			<view class="safe-area-inset-bottom"></view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		conn,
+	} from '@/utils/WebIM';
+	import WebIM from '@/newSDK/Easemob-chat-4.1.7.js'
+	import emoji from "@/commont/emoji.js"
+
+	const recorderManager = uni.getRecorderManager()
+	var init // 录制时长计时器
+
+	export default {
+		props: {
+			to: {
+				typeof: String,
+				default: ''
+			},
+
+			list: {
+				typeof: Array,
+				default: []
+			},
+			user_other:{
+				type:Object,
+				default:{}
+			}
+		},
+		data() {
+			return {
+				height: '100rpx',
+				showtype: 0, //默认0,1显示更多,2显示常用,3显示表情
+				emoji: emoji,
+				text: '',
+				changlist: [],
+				isjianpan: true,
+				longPress: '1',
+				time: 0, //录音时长
+				duration: 60000, //录音最大值ms 60000/1分钟
+				tempFilePath: '', //音频路径
+				playStatus: 0, //录音播放状态 0:未播放 1:正在播放
+			}
+		},
+		created() {
+
+		},
+
+		methods: {
+			longpressBtn() {
+				this.longPress = '2';
+				// this.countdown(60); // 倒计时
+				// clearInterval(init) // 清除定时器
+				recorderManager.onStop((res) => {
+					console.log('onstop', res);
+					this.tempFilePath = res.tempFilePath;
+					this.recordingTimer(this.time);
+				})
+				const options = {
+					duration: this.duration, // 指定录音的时长,单位 ms
+					sampleRate: 16000, // 采样率
+					numberOfChannels: 1, // 录音通道数
+					encodeBitRate: 96000, // 编码码率
+					format: 'mp3', // 音频格式,有效值 aac/mp3
+					frameSize: 10, // 指定帧大小,单位 KB
+				}
+				this.recordingTimer();
+				recorderManager.start(options);
+				// 监听音频开始事件
+				recorderManager.onStart((res) => {})
+				recorderManager.onError((res) => {})
+			},
+			// 长按松开录音事件
+			touchendBtn() {
+				let _this = this
+				this.longPress = '1';
+				recorderManager.onStop((res) => {
+					this.tempFilePath = res.tempFilePath
+					uni.uploadFile({
+						url: 'https://hire.hdlkeji.com/api/common/upload',
+						filePath: _this.tempFilePath,
+						name: 'file',
+						success: (res) => {
+							uni.hideLoading()
+							if (JSON.parse(res.data).code == 1) {
+								_this.sendluyin(JSON.parse(res.data).data.fullurl);
+							} else {
+								_this.$u.toast(JSON.parse(res.data).msg)
+							}
+						},
+						fail: (e) => {
+							console.log(e);
+						}
+					})
+				})
+				this.recordingTimer(this.time)
+				recorderManager.stop()
+			},
+			recordingTimer(time) {
+				var that = this;
+				if (time == undefined) {
+					// 将计时器赋值给init
+					init = setInterval(function() {
+						that.time++
+					}, 1000);
+				} else {
+					clearInterval(init)
+				}
+			},
+			sendluyin(url) {
+				var option = {
+					type: "audio",
+					chatType: "singleChat",
+					filename: url,
+					// 消息接收方:单聊为对端用户 ID,群聊和聊天室分别为群组 ID 和聊天室 ID。
+					to: this.to,
+					body: {
+						//文件 URL。
+						url: url,
+						//文件类型。
+						type: "audio",
+						//文件名。
+						filename: url,
+						// 音频文件时长,单位为秒。
+						length: this.time,
+					},
+				};
+				let msg = new WebIM.message.create(option);
+				// 调用 `send` 方法发送该语音消息。
+				conn.send(msg).then((res) => {
+						// 语音消息成功发送。
+						console.log("Success");
+						setTimeout(() => {
+							this.$emit('success', true)
+						}, 800)
+					})
+					.catch((e) => {
+						// 语音消息发送失败。
+						console.log("Fail", e);
+					});
+			},
+			send() {
+				let _this = this
+				if (this.text == '' || this.text == null) {
+					this.$u.toast('发送消息不能为空')
+					return
+				}
+
+				let id = conn.getUniqueId(); // 生成本地消息id
+
+				let msg = new WebIM.message('txt', id); // 创建文本消息
+				console.log(msg);
+				msg.set({
+					msg: this.text, // 消息内容
+					to: this.to, // 接收消息对象(用户id)
+					chatType: 'singleChat', // 设置为单聊
+					ext: {
+						shopname:this.user_other.merchant_name,
+						image:this.user_other.image,
+					},
+					success: function(id, serverMsgId) {
+						console.log('成功发送消息');
+						setTimeout(() => {
+							_this.$emit('success', true)
+						}, 800);
+					},
+					fail: function(e) {
+						console.log("发送消息失败");
+					}
+				});
+				conn.send(msg.body);
+				this.text = ''
+			},
+			toalbum() {
+				let _this = this
+				uni.chooseImage({
+					count: 1,
+					sizeType: ["original", "compressed"],
+					sourceType: ["album"],
+					success(img) {
+						uni.showLoading({
+							mask: true,
+							title: "请稍后"
+						})
+						console.log('img', img);
+						uni.uploadFile({
+							url: 'https://hire.hdlkeji.com/api/common/upload',
+							filePath: img.tempFilePaths[0],
+							name: 'file',
+							success: (res) => {
+								uni.hideLoading()
+								if (JSON.parse(res.data).code == 1) {
+									console.log('data', JSON.parse(res.data).data.fullurl);
+									_this.sendPrivateImg(JSON.parse(res.data).data.fullurl);
+								} else {
+									_this.$u.toast(JSON.parse(res.data).msg)
+								}
+							},
+							fail: (e) => {
+								console.log(e);
+							}
+						})
+					},
+				});
+			},
+			tocapture() {
+				let _this = this
+				uni.chooseImage({
+					count: 1,
+					sizeType: ["original", "compressed"],
+					sourceType: ["camera"],
+					success(img) {
+						uni.showLoading({
+							mask: true,
+							title: "请稍后"
+						})
+						uni.uploadFile({
+							url: 'https://hire.hdlkeji.com/api/common/upload',
+							filePath: img.tempFilePaths[0],
+							name: 'file',
+							success: (res) => {
+								uni.hideLoading()
+								if (JSON.parse(res.data).code == 1) {
+									_this.sendPrivateImg(JSON.parse(res.data).data.fullurl);
+								} else {
+									_this.$u.toast(JSON.parse(res.data).msg)
+								}
+							},
+							fail: (e) => {
+								console.log(e);
+							}
+						})
+					},
+				});
+			},
+			sendPrivateImg(res) {
+				console.log('sendPrivateImg', res);
+				let option = {
+					chatType: "singleChat",
+					// 消息类型。
+					type: "img",
+					// 图片文件的 URL 地址。
+					url: res,
+					// 消息接收方:单聊为对方用户 ID,群聊和聊天室分别为群组 ID 和聊天室 ID。
+					to: this.to,
+					ext: {
+						shopname:this.user_other.merchant_name,
+						image:this.user_other.image
+					},
+				};
+				// 创建一条图片消息。
+				let msg = new WebIM.message.create(option);
+				// 调用 `send` 方法发送该图片消息。
+				conn.send(msg).then((res) => {
+					console.log('发送图片成功');
+					setTimeout(() => {
+						this.$emit('success', true)
+					}, 800)
+				});
+			},
+
+			select(item) {
+				this.text = item.content
+			},
+			tolist() {
+				uni.navigateTo({
+					url: "/pagesC/changyong-list"
+				})
+			},
+			toadd() {
+				uni.navigateTo({
+					url: "/pagesC/changyong-add"
+				})
+			},
+			changeemoji(item) {
+				this.text = this.text + item
+			},
+			openemoji() {
+				this.showtype = this.showtype == 3 ? 0 : 3
+				this.height = this.showtype == 3 ? '400rpx' : '100rpx'
+			},
+			openmore() {
+				this.showtype = this.showtype == 1 ? 0 : 1
+				this.height = this.showtype == 1 ? '300rpx' : '100rpx'
+			},
+			openchangyong() {
+				this.showtype = this.showtype == 2 ? 0 : 2
+				this.height = this.showtype == 2 ? '600rpx' : '100rpx'
+				this.isjianpan = true
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.send {
+		font-size: 26rpx;
+		color: #fff;
+		padding: 16rpx 20rpx;
+		background: #0C66C2;
+		border-radius: 16rpx;
+	}
+
+	.chat-bottom {
+
+		.chat-down-box {
+			position: fixed;
+			bottom: 0;
+			left: 0;
+			z-index: 99;
+			width: 750rpx;
+			background-color: #fff;
+
+			.emoji-scroll {
+				height: 300rpx;
+
+				.empji-box {
+					width: 750rpx;
+
+					text {
+						padding: 10rpx 0;
+						text-align: center;
+						width: 10%;
+						font-size: 40rpx;
+					}
+				}
+			}
+
+			.changyong-box {
+				height: 500rpx;
+				width: 100%;
+
+				.changyong-scroll {
+					min-height: 1rpx;
+					padding: 0 32rpx;
+					width: 100%;
+					box-sizing: border-box;
+					border-top: 2rpx solid #F0F0F0;
+
+					.changyong-text {
+						border-bottom: 2rpx solid #F0F0F0;
+						padding: 32rpx 0;
+						font-size: 30rpx;
+						font-family: PingFangSC-Regular, PingFang SC;
+						font-weight: 400;
+						color: #222222;
+					}
+
+					.changyong-text:last-child {
+						border: none;
+					}
+				}
+
+				.changyong-btn {
+					height: 90rpx;
+					width: 100%;
+					box-shadow: 0rpx -1rpx 0rpx 0rpx rgba(0, 0, 0, 0.2);
+
+					.text2 {
+						height: 44rpx;
+						border: 2rpx solid #E5E5E5;
+					}
+
+					.text1 {
+						line-height: 90rpx;
+						width: 45%;
+						text-align: center;
+						font-size: 32rpx;
+						font-family: PingFangSC-Regular, PingFang SC;
+						font-weight: 400;
+						color: #0C66C2;
+					}
+				}
+			}
+
+			.more-box {
+				height: 200rpx;
+				padding: 0 60rpx;
+				width: 100%;
+				box-sizing: border-box;
+
+				.more-item {
+					margin: 0 58rpx 0 0;
+
+					.item-text {
+						font-size: 22rpx;
+						font-family: PingFangSC-Regular, PingFang SC;
+						font-weight: 400;
+						color: #444444;
+					}
+
+					.item-img {
+						width: 114rpx;
+						height: 114rpx;
+						background: #F3F3F3;
+						border-radius: 20rpx;
+						margin-bottom: 24rpx;
+
+						.hide {
+							position: absolute;
+							top: 0;
+							right: 0;
+							min-width: 100%;
+							min-height: 100%;
+							filter: alpha(opacity=0);
+							opacity: 0;
+							cursor: inherit;
+							display: none;
+						}
+
+						image {
+							width: 52rpx;
+							height: 52rpx;
+						}
+					}
+				}
+			}
+
+			.chat-down-btn {
+				margin: 12rpx auto;
+				width: 686rpx;
+				height: 84rpx;
+				background: #F3F3F3;
+				border-radius: 42rpx;
+				padding: 0 28rpx;
+
+				.input {
+					flex: 1;
+					margin-left: 28rpx;
+					font-size: 28rpx;
+				}
+
+				.img1 {
+					width: 44rpx;
+					height: 44rpx;
+					margin: 0 28rpx;
+				}
+
+				.img2 {
+					width: 44rpx;
+					height: 44rpx;
+				}
+
+				.changyong {
+					width: 44rpx;
+					height: 44rpx;
+					line-height: 44rpx;
+					border: 3rpx solid #131415;
+					text-align: center;
+					border-radius: 100rpx;
+					font-size: 26rpx;
+					font-family: PingFangSC-Medium, PingFang SC;
+					font-weight: 500;
+					color: #131415;
+				}
+			}
+		}
+
+		.record-box {
+			width: 100%;
+			position: relative;
+		}
+
+		.luyin button::after {
+			border: none;
+		}
+
+		.luyin button {
+			font-size: 14px;
+			line-height: 38px;
+			width: 100%;
+			height: 38px;
+			border-radius: 8px;
+			text-align: center;
+			background: #f3f3f3;
+		}
+
+		.luyin button image {
+			width: 16px;
+			height: 16px;
+			margin-right: 4px;
+			vertical-align: middle;
+		}
+
+		.record-btn-2 {
+			background: rgba(255, 211, 0, 0.2);
+		}
+
+		/* 提示小弹窗 */
+		.prompt-layer {
+			border-radius: 8px;
+			background: #fff;
+			padding: 8px 16px;
+			box-sizing: border-box;
+			position: absolute;
+			left: 50%;
+			transform: translateX(-50%);
+		}
+
+		.prompt-layer::after {
+			content: '';
+			display: block;
+			border: 6px solid rgba(0, 0, 0, 0);
+			border-top-color: rgba(255, 211, 0, 1);
+			position: absolute;
+			bottom: -10px;
+			left: 50%;
+			transform: translateX(-50%);
+		}
+
+		.prompt-layer-1 {
+			font-size: 12px;
+			width: 128px;
+			text-align: center;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			justify-content: center;
+			top: -80px;
+		}
+
+		.prompt-layer-1 .p {
+			color: #000000;
+		}
+
+		.prompt-layer-1 .span {
+			color: rgba(0, 0, 0, .6);
+		}
+
+		.prompt-loader .em {}
+
+		/* 语音音阶------------- */
+		.prompt-loader {
+			width: 96px;
+			height: 20px;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			margin-bottom: 6px;
+		}
+
+		.prompt-loader .em {
+			display: block;
+			background: #333333;
+			width: 1px;
+			height: 10%;
+			margin-right: 2.5px;
+			float: left;
+		}
+
+		.prompt-loader .em:last-child {
+			margin-right: 0px;
+		}
+
+		.prompt-loader .em:nth-child(1) {
+			animation: load 2.5s 1.4s infinite linear;
+		}
+
+		.prompt-loader .em:nth-child(2) {
+			animation: load 2.5s 1.2s infinite linear;
+		}
+
+		.prompt-loader .em:nth-child(3) {
+			animation: load 2.5s 1s infinite linear;
+		}
+
+		.prompt-loader .em:nth-child(4) {
+			animation: load 2.5s 0.8s infinite linear;
+		}
+
+		.prompt-loader .em:nth-child(5) {
+			animation: load 2.5s 0.6s infinite linear;
+		}
+
+		.prompt-loader .em:nth-child(6) {
+			animation: load 2.5s 0.4s infinite linear;
+		}
+
+		.prompt-loader .em:nth-child(7) {
+			animation: load 2.5s 0.2s infinite linear;
+		}
+
+		.prompt-loader .em:nth-child(8) {
+			animation: load 2.5s 0s infinite linear;
+		}
+
+		.prompt-loader .em:nth-child(9) {
+			animation: load 2.5s 0.2s infinite linear;
+		}
+
+		.prompt-loader .em:nth-child(10) {
+			animation: load 2.5s 0.4s infinite linear;
+		}
+
+		.prompt-loader .em:nth-child(11) {
+			animation: load 2.5s 0.6s infinite linear;
+		}
+
+		.prompt-loader .em:nth-child(12) {
+			animation: load 2.5s 0.8s infinite linear;
+		}
+
+		.prompt-loader .em:nth-child(13) {
+			animation: load 2.5s 1s infinite linear;
+		}
+
+		.prompt-loader .em:nth-child(14) {
+			animation: load 2.5s 1.2s infinite linear;
+		}
+
+		.prompt-loader .em:nth-child(15) {
+			animation: load 2.5s 1.4s infinite linear;
+		}
+
+		@keyframes load {
+			0% {
+				height: 10%;
+			}
+
+			50% {
+				height: 100%;
+			}
+
+			100% {
+				height: 10%;
+			}
+		}
+
+		/* 语音音阶-------------------- */
+		.prompt-layer-2 {
+			top: -40px;
+		}
+
+		.prompt-layer-2 .text {
+			color: rgba(0, 0, 0, 1);
+			font-size: 12px;
+		}
+	}
+</style>

+ 1 - 1
components/zh-slidingMenu/zhSlidingMenu/zhSlidingMenu.vue

@@ -104,7 +104,7 @@
 				arr: [], //左侧菜单距离登录距离列表
 				scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
 				timer: null, // 定时器
-				language: ''
+				language: 'zh-CN'
 			}
 		},
 		mounted() {

+ 17 - 12
main.js

@@ -11,9 +11,9 @@ Vue.use(VueI18n);
 Vue.config.productionTip = false;
 // 多国语言包配置
 const i18n = new VueI18n({
-  locale: "zh-CN",
-  // locale: "en-US",
-  messages,
+	locale: "zh-CN",
+	// locale: "en-US",
+	messages,
 });
 
 Vue.prototype._i18n = i18n;
@@ -21,10 +21,13 @@ Vue.prototype._i18n = i18n;
 Vue.use(uView);
 App.mpType = "app";
 const app = new Vue({
-  i18n,
-  ...App,
+	i18n,
+	...App,
 });
-// 引入请求封装,将app参数传递到配置中
+
+// import WebIM from "./utils/WebIM.js"
+// Vue.use(WebIM,app)
+// 引入请求封装,将app参数传递到配置中  
 // require('./commont/http.interceptor.js')(app)
 import httpInterceptor from '@/commont/http.interceptor.js'
 // 这里需要写在最后,是为了等Vue创建对象完成,引入"app"对象(也即页面的"this"实例)
@@ -34,11 +37,13 @@ app.$mount();
 // #endif
 
 // #ifdef VUE3
-import { createSSRApp } from "vue";
+import {
+	createSSRApp
+} from "vue";
 export function createApp() {
-  const app = createSSRApp(App);
-  return {
-    app,
-  };
+	const app = createSSRApp(App);
+	return {
+		app,
+	};
 }
-// #endif
+// #endif

+ 478 - 538
pageA/chat/chat.vue

@@ -1,153 +1,208 @@
 <template>
-	<!-- 聊天记录 -->
-	<view class="chat">
-		<view class="chat-list">
-			<view class="more-btn" @click="tomore">
-				{{showmore ? '点击查看更多' : '没有更多了'}}
+	<view class="chat-pages">
+		<u-navbar :border="false" @leftClick="return1">
+			<view class="u-nav-slot" slot="left" style="display: flex;">
+				<image src="@/static/images/index/dianhua.png" mode=""
+					style="width: 40rpx;height: 40rpx;margin-left: 22rpx;"></image>
 			</view>
-			<view v-for="(item,index) in list" :key="index">
-				<view class="u-flex u-row-between" style="margin-bottom: 10rpx;">
-					<text :style="{opacity:item.type == 2 ? 1 : 0}"
-						style="margin-bottom: -20rpx;">{{item.create_at}}</text>
-					<text :style="{opacity:item.type == 2 ? 0: 1}">{{item.create_at}}</text>
+			<view class=" u-flex-col u-row-center" slot="center">
+				<text class="title">{{user_other.merchant_name}}</text>
+				<!-- <text>{{user_other.company_name || ''}}·{{user_other.type || ''}}</text> -->
+			</view>
+		</u-navbar>
+
+
+		<view class="" style="height: 200rpx;"></view>
+
+		<view class="chat-item" v-for="(item,index) in list" :key="index">
+			<view class="chat-time">
+				{{renderTime(item.time)}}
+			</view>
+			<view class="chat-item-box u-flex u-col-top acenter" v-if="item.from == user_other_no">
+				<image :src="user_other.image" class="user-img" mode=""></image>
+				<view style="max-width: 80%;" class="" v-if="item.type == 'txt' && !item.ext.type">
+					<view class="chat-text" :style="{background:item.from == user_no ? '#D3E5FB' : '#fff'}">
+						{{item.msg}}
+					</view>
 				</view>
-				<view class="chat-item u-flex u-col-top u-row-between">
-					<image :src="item.headimg" :style="{opacity:item.type == 2 ? 1 : 0}" class="user-head" mode="">
-					</image>
-					<view class="item-box u-flex-1 u-flex-col"
-						:style="{alignItems: item.type == 2 ? 'flex-start' : 'flex-end'}">
-						<text>{{item.name}}</text>
-						<text v-if="item.is_url == 0"
-							:class="item.type == 2 ? 'text1' : 'text2'">{{item.content}}</text>
-						<view class="" v-if="item.is_url == '1'" @tap="onPlay(item,index)"
-							:class="item.type == 2 ? 'back1' : 'back2'">
-							<view class="record" v-if="item.type==1">
-								<text style="#fff">{{item.time}}</text> "
-								<u-icon custom-style="transform: rotate(-90deg) !important;" name="wifi"
-									size="28"></u-icon>
-							</view>
-							<view class="record1" v-if="item.type==2">
-								<u-icon custom-style="transform: rotate(90deg) !important;" name="wifi"
-									size="28"></u-icon>
-								"
-								<text>{{item.time}}</text>
+				<view style="max-width: 80%;" v-if="item.type == 'audio'">
+					<view class="chat-text hflex acenter" style="background: #D3E5FB;max-width: 550rpx;"
+						@click="playaudio(item.url)">
+						<image src="static/yuyin-left.png" mode="" style="width: 20rpx;height: 20rpx;"></image>
+						<text :style="'padding-right: ' + item.length * 10 + 'rpx'">{{item.length}}</text>
+					</view>
+				</view>
+				<image :src="item.msg ? item.msg : item.url" v-if="item.type === 'img'" mode="widthFix"
+					style="width: 200px;text-align: right;" @click="previewimg(item.url)"></image>
+				<view class="chat-header" v-if="item.type == 'txt' && item.ext.type == 'cand'"
+					:style="{top:(statusheight + 58) + 'px'}" @click="toinfo(item,'pos')">
+					<view class="header-top u-flex u-row-between">
+						<view class="header-left">
+							<view class="u-flex">
+								<text class="text1">{{item.ext.order.name}}</text>
 							</view>
 						</view>
+						<view class="header-right">
+							<image :src="item.ext.order.avatar" class="right-img" mode=""></image>
+							<image src="../static/images/nan.png" class="sex" mode=""
+								v-if="item.ext.order.sex == 'male'"></image>
+							<image src="../static/images/nv.png" class="sex" mode="" v-else></image>
+						</view>
+					</view>
+					<view class="goutong-time">
+						{{renderTime(item.time)}} 发起沟通
+					</view>
+				</view>
+				<view class="chat-header1" v-if="item.type == 'txt' && item.ext.type == 'pos'"
+					:style="{top:(statusheight + 58) + 'px'}" @click="toinfo(item,'pos')">
+					<view class="header1-top u-flex u-row-between">
+						<text>{{item.ext.order.title}}</text>
+						<text>{{item.ext.order.salary}}K</text>
+					</view>
+					<view class="goutong-time1">
+						{{renderTime(item.time)}} 发起沟通
+					</view>
+				</view>
+				<view class="chat-header1" v-if="item.type == 'txt' && item.ext.type == 'order'"
+					:style="{top:(statusheight + 58) + 'px'}" @click="toinfo(item,'order')">
+					<view class="header1-top u-flex u-row-between">
+						<text>{{item.ext.order.title}}</text>
+						<text>{{item.ext.order.salary}}K</text>
+					</view>
+					<view class="goutong-time1">
+						{{renderTime(item.time)}} 发起沟通
 					</view>
-					<image :src="item.headimg" :style="{opacity:item.type == 2 ? 0 : 1}" class="user-head" mode="">
-					</image>
 				</view>
 			</view>
-			<view class="" v-for="(item,index) in chatlist" :key="index">
-				<view class="u-flex u-row-between" style="margin-bottom: 10rpx;">
-					<text :style="{opacity:item.type == 2 ? 1 : 0}"
-						style="margin-bottom: -20rpx;">{{item.create_at}}</text>
-					<text :style="{opacity:item.type == 2 ? 0: 1}">{{item.create_at}}</text>
+			<view class="chat-item-box u-flex u-col-top jend" v-if="item.from == user_no">
+				<view style="max-width: 80%;" class="" v-if="item.type == 'txt' && !item.ext.type">
+					<view class="chat-text" :style="{background:item.from == user_no ? '#D3E5FB' : '#fff'}">
+						{{item.msg}}
+					</view>
 				</view>
-				<view class="chat-item u-flex u-col-top u-row-between">
-					<image :src="item.headimg" :style="{opacity:item.type == 2 ? 1 : 0}" class="user-head" mode="">
-					</image>
-					<view class="item-box u-flex-1 u-flex-col"
-						:style="{alignItems: item.type == 2 ? 'flex-start' : 'flex-end'}">
-						<text>{{item.name}}</text>
-						<text v-if="item.type1 != 'record'"
-							:class="item.type == 2 ? 'text1' : 'text2'">{{item.content}}</text>
-						<view class="record" v-if="item.type1 == 'record'" :class="item.type == 2 ? 'text1' : 'text2'"
-							@tap="onPlay1(item,index)">
-							<view class="record" v-if="item.type==1">
-								<text>{{item.message}}</text>"<u-icon name="wifi" size="28"></u-icon>
-							</view>
-							<view class="record1" v-if="item.type==2">
-								<u-icon name="wifi" size="28"></u-icon>
-								"
-								<text>{{item.message}}</text>
+				<view style="max-width: 80%;" v-if="item.type == 'audio'">
+					<view class="chat-text hflex acenter jend" style="background: #D3E5FB;max-width: 550rpx;"
+						@click="playaudio(item.url)">
+						<text :style="'padding-left: ' + item.length * 10 + 'rpx'">{{item.length}}</text>
+						<image src="static/yuyin-right.png" mode="" style="width: 20rpx;height: 20rpx;"></image>
+					</view>
+				</view>
+				<image :src="item.msg ? item.msg : item.url" v-if="item.type === 'img'" mode="widthFix"
+					style="width: 200px;text-align: right;" @click="previewimg(item.url)"></image>
+				<view class="chat-header" v-if="item.type == 'txt' && item.ext.type == 'cand'"
+					:style="{top:(statusheight + 58) + 'px'}" @click="toinfo(item,'pos')">
+					<view class="header-top u-flex u-row-between">
+						<view class="header-left">
+							<view class="u-flex">
+								<text class="text1">{{item.ext.order.name}}</text>
 							</view>
 						</view>
+						<view class="header-right">
+							<image :src="item.ext.order.avatar" class="right-img" mode=""></image>
+							<image src="../static/images/nan.png" class="sex" mode=""
+								v-if="item.ext.order.sex == 'male'"></image>
+							<image src="../static/images/nv.png" class="sex" mode="" v-else></image>
+						</view>
+					</view>
+					<view class="goutong-time">
+						{{renderTime(item.time)}} 发起沟通
+					</view>
+				</view>
+				<view class="chat-header1" v-if="item.type == 'txt' && item.ext.type == 'pos'"
+					:style="{top:(statusheight + 58) + 'px'}" @click="toinfo(item,'pos')">
+					<view class="header1-top u-flex u-row-between">
+						<text>{{item.ext.order.title}}</text>
+						<text>{{item.ext.order.salary}}K</text>
+					</view>
+					<view class="goutong-time1">
+						{{renderTime(item.time)}} 发起沟通
+					</view>
+				</view>
+				<view class="chat-header1" v-if="item.type == 'txt' && item.ext.type == 'order'"
+					:style="{top:(statusheight + 58) + 'px'}" @click="toinfo(item,'order')">
+					<view class="header1-top u-flex u-row-between">
+						<text>{{item.ext.order.title}}</text>
+						<text>{{item.ext.order.salary}}K</text>
+					</view>
+					<view class="goutong-time1">
+						{{renderTime(item.time)}} 发起沟通
 					</view>
-					<image :src="item.headimg" :style="{opacity:item.type == 2 ? 0 : 1}" class="user-head" mode="">
-					</image>
 				</view>
+				<image v-if="item.from == user_no" :src="user.avatar" class="user-img" mode=""></image>
 			</view>
 		</view>
-		<view class="" style="height: 170rpx;"></view>
-		<view class="chat-btn u-flex u-row-between">
-			<u-icon v-if="show == false" @click="startRecord" name="mic" size="44"></u-icon>
-			<u-icon v-if="show == true" @click="startRecord1" name="more-circle-fill" size="44"></u-icon>
-			<nb-voice-record v-if="show == true" :vibrate="false" @startRecord="start" @endRecord="end"
-				@cancelRecord="cancel"></nb-voice-record>
-			<input v-if="show == false" type="text" placeholder="请输入" v-model="text">
-			<text v-if="show == false" class="post" @click="send(text)">发送</text>
-		</view>
+		<view class="" style="height: 55rpx;"></view>
+		<!-- <kj-chat></kj-chat> -->
+		<kj-chat :to="user_other_no" :list="changyong_list" :user_other='user_other' @success="getdata"></kj-chat>
 	</view>
 </template>
 
 <script>
+	import vueBus from '@/utils/vueBus.js'
+	import WebIM from '@/newSDK/Easemob-chat-4.1.7.js'
+	import {
+		conn
+	} from '@/utils/WebIM';
+	import {
+		renderTime
+	} from '@/utils/index'
+	const innerAudioContext = uni.createInnerAudioContext()
 	export default {
 		data() {
 			return {
-				bgAudioManager: '', // 全局音频播放
-				show: false,
-				text: '',
-				hx_username: '',
-				worker_id: '',
-				page: 1,
+				user_other_no: '',
+				user_no: '',
+				user: {},
+				user_other: {},
+				pageSize: 20,
+				loadText: '',
 				list: [],
-				chatlist: [],
-				myname: '',
-				myheadimg: '',
-				workername: '',
-				workerheadimg: '',
-				voicePath: '',
-				userinfoheadimg: "",
-				ossdata: {},
-				duration: 0,
-				time1: 0,
-				url: "",
-				url1: ""
+				renderTime,
+				playStatus: 0, //录音播放状态 0:未播放 1:正在播放
+				statusheight: '',
 			}
 		},
-		onLoad(option) {
-			this.hx_username = option.hx_username
-			this.worker_id = option.worker_id
-			console.log(this.worker_id);
-			console.log(this.hx_username);
-			this.myname = uni.getStorageSync("name")
-			this.myheadimg = uni.getStorageSync("headimg")
-			this.getlist()
-			this.getworker()
-			this.getmsg()
-			let self = this;
-			this.getoss()
-			// this.getaudio()
-		},
-		computed: {
-			showmore() {
-				if (this.list.length % 20 == 0 && this.list.length > 0) {
-					return true
-				} else {
-					return false
-				}
+		onLoad(options) {
+			this.user = options.user_info
+			this.user_other = JSON.parse(decodeURIComponent(options.user_other))
+			// this.statusheight = uni.getSystemInfoSync().statusBarHeight,
+			this.user_other_no = options.user_other_no
+			console.log(this.user_other);
+			// this.user_other = options.user_other, //用户信息
+			if (uni.getStorageSync('user_no')) {
+				this.user_no = uni.getStorageSync('user_no')
+			} else {
+				// index().then((res) => {
+
+
+				// })
 			}
+			vueBus.$on('message', this.getdata)
+		},
+		onShow() {
+			this.getdata()
 		},
 		methods: {
-			onPlay(e, index) {
-				let that = this
-				if (this.url && this.url == e.content) return
-				if (this.url && this.url !== e.content) {
-					this.bgAudioManager.stop()
-					let obj = this.list.find(item => item.content == this.url)
-					clearTimeout(obj.timeOut)
-					obj.time = obj.defaultTime
-				}
-				this.url = e.content
-
-
-				// 我这里没有写暂停播放 需要的可以 设置变量 根据变量状态判断 pause 或 play
-				this.bgAudioManager = uni.createInnerAudioContext()
-				this.bgAudioManager.src = e.content
-				this.bgAudioManager.play()
-				this.time1 = e.time
-
+			previewimg(url) {
+				let urls = []
+				urls.push(url)
+				uni.previewImage({
+					urls: urls,
+					longPressActions: {
+						itemList: ['发送给朋友', '保存图片', '收藏'],
+						success: function(data) {
+							console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
+						},
+						fail: function(err) {
+							console.log(err.errMsg);
+						}
+					}
+				});
+			},
+			playaudio(url) {
+				let _this = this
+				innerAudioContext.src = url
+				console.log(url);
 				var music = wx.setInnerAudioOption({
 					obeyMuteSwitch: false,
 					success: function(res) {
@@ -158,479 +213,364 @@
 						console.log("静音设置失败");
 					},
 				});
-
-				this.bgAudioManager.onPlay(() => {
-					function time_a(obj) {
-						obj.timeOut = setTimeout(() => {
-							obj.time--
-							obj.time < 0 ? obj.time = that.time1 : time_a(obj)
-						}, 1000)
-					}
-					time_a(this.list[index])
-
-				})
-
-				this.bgAudioManager.onEnded(() => {
-					this.url = ''
-					// this.list[index].time = this.time1
-					this.bgAudioManager.offPlay()
-					this.bgAudioManager.offEnded()
-					this.bgAudioManager = null
-				})
-			},
-			onPlay1(e, index) {
-				let that = this
-				if (this.url1 && this.url1 == e.content) return
-				if (this.url1 && this.url1 !== e.content) {
-					this.bgAudioManager.stop()
-					let obj = this.chatlist.find(item => item.content == this.url1)
-					clearTimeout(obj.timeOut)
-					obj.message = obj.defaultTime
+				console.log(this.playStatus);
+				if (this.playStatus == 0) {
+					innerAudioContext.play()
+					innerAudioContext.onPlay(() => {
+						console.log('开始播放');
+						_this.playStatus = 1
+					});
+				} else {
+					innerAudioContext.pause()
+					innerAudioContext.onPause(() => {
+						console.log('暂停播放');
+						_this.playStatus = 0
+					});
 				}
-				this.url1 = e.content
-
-				this.bgAudioManager = uni.createInnerAudioContext()
-				this.bgAudioManager.src = e.content
-				this.bgAudioManager.play()
-				// this.bgAudioManager.obeyMuteSwitch = false
-				this.time1 = e.message
-				console.log(that.time1);
-				var music = wx.setInnerAudioOption({
-					obeyMuteSwitch: false,
-					success: function(res) {},
-					fail: function(err) {},
+				innerAudioContext.onError((res) => {
+					console.log('onError', res.errMsg);
+					console.log('onError', res.errCode);
 				});
-				this.bgAudioManager.onPlay(() => {
-					function time_a(obj) {
-						obj.timeOut = setTimeout(() => {
-							obj.message--
-							// obj.message < 0 ? obj.message = that.time1 : time_a(obj)
-							if (obj.message < 0) {
-								obj.message = that.time1
-								clearTimeout(obj.timeOut)
-								that.bgAudioManager.offPlay()
-								that.bgAudioManager.offEnded()
-								that.bgAudioManager = null
-								that.url1 = ''
-							} else {
-								// console.log(time_a(obj));
-								// time_a(obj)
-								obj.message = obj.message
-								time_a(obj)
-							}
-						}, 1000)
-					}
-					time_a(this.chatlist[index])
+				innerAudioContext.onEnded((res) => {
+					_this.playStatus = 0
 				})
 			},
-			start() {
-				// 开始录音
+			return1() {
+				uni.navigateBack()
 			},
-			getoss() {
-				this.$u.post('/api/Upload/getSignedUrl').then(res => {
-					this.ossdata = res.data
+			getuser() {
+				let that = this
+				getEmchatUsersData({
+					user_no: this.user_no + ',' + this.user_other_no,
+				}).then((res) => {
+					if (res.code == 1) {
+						this.user = res.data[0]
+						this.user_other = res.data[1]
+					} else {
+						that.$u.toast(res.msg)
+					}
 				})
 			},
-			end(event) {
-				// 结束录音并处理得到的录音文件
-				// event中,app端仅有tempFilePath字段,微信小程序还有duration和fileSize两个字段
-				// this.sendPrivateAudio(event.tempFilePath,event.duration)
-				if (event.duration < 1000) {
-					this.$u.toast("说话时间太短了")
-				} else {
-
-					this.duration = event.duration
-					var key = this.ossdata.key + new Date().getTime() + Math.floor(Math.random() * 150) + '.mp3'
-					uni.uploadFile({
-						url: this.ossdata.host, //输入你的bucketname.endpoint
-						filePath: event.tempFilePath,
-						name: 'file',
-						formData: {
-							key: key,
-							policy: this.ossdata.policy, // 输入你获取的的policy
-							OSSAccessKeyId: this.ossdata.OSSAccessKeyId, // 输入你的AccessKeyId
-							success_action_status: '200', // 让服务端返回200,不然,默认会返回204
-							signature: this.ossdata.Signature, // 输入你获取的的signature
-						},
-						success: (res) => {
-							if (res.statusCode == 200) {
-								this.userinfoheadimg = this.ossdata.host + '/' + key
-								this.send1(this.userinfoheadimg, this.duration)
-							}
-						},
-						fail: (err) => {
-							console.log(err);
+			getdata() {
+				let option2 = {
+					chatType: "singleChat", // 会话类型,设置为单聊。
+					type: "channel", // 消息类型。
+					to: this.user_other_no, // 接收消息对象的用户 ID。
+				};
+				let msg2 = new WebIM.message.create(option2);
+				conn.send(msg2);
+				let options = {
+					// 对方的用户 ID 或者群组 ID 或聊天室 ID。
+					targetId: this.user_other_no,
+					// 每页期望获取的消息条数。取值范围为 [1,50],默认值为 20。
+					pageSize: this.pageSize,
+					// 查询的起始消息 ID。若该参数设置为 `-1`、`null` 或空字符串,从最新消息开始。
+					cursor: -1,
+					// 会话类型:(默认) `singleChat`:单聊;`groupChat`:群聊。
+					chatType: "singleChat",
+					// 消息搜索方向:(默认)`up`:按服务器收到消息的时间的逆序获取;`down`:按服务器收到消息的时间的正序获取。
+					searchDirection: "up",
+				};
+				conn.getHistoryMessages(options).then((res) => {
+						// 成功获取历史消息。
+						console.log('kkkk', res);
+						if (res.isLast) {
+							this.loadText = '已无更多数据';
 						}
-					})
-				}
-
-			},
-			cancel() {
-				// 用户取消录音
-				console.log(3333);
-			},
-			startRecord() {
-				this.show = true
-			},
-			startRecord1() {
-				this.show = false
-			},
-			tomore() {
-				if (this.showmore) {
-					this.page++
-					this.getlist()
-				}
-			},
-			getmsg() {
-				this.$WebIM.conn.addEventHandler('getmsg', {
-					// 当前用户收到文本消息。
-					onTextMessage: (message) => {
-						console.log(message);
-						this.chatlist.push({
-							content: message.msg,
-							create_at: this.$u.timeFormat(message.time, 'yyyy-mm-dd hh:MM:ss'),
-							headimg: message.from == uni.getStorageSync("hx_username") ? this
-								.myheadimg : this.workerheadimg,
-							name: message.from == uni.getStorageSync("hx_username") ? this.myname :
-								this.workername,
-							type: message.from == uni.getStorageSync("hx_username") ? 1 : 2,
-						})
-						this.$nextTick(() => {
-							uni.pageScrollTo({
-								scrollTop: 99999
-							})
-						})
-					},
-					onAudioMessage: (message) => {
-						this.chatlist.push({
-							// defaultTime:message.length,
-							content: message.url,
-							create_at: this.$u.timeFormat(message.time, 'yyyy-mm-dd hh:MM:ss'),
-							headimg: message.from == uni.getStorageSync("hx_username") ? this
-								.myheadimg : this.workerheadimg,
-							name: message.from == uni.getStorageSync("hx_username") ? this.myname :
-								this.workername,
-							type: message.from == uni.getStorageSync("hx_username") ? 1 : 2,
-							type1: "record",
-							message: message.length
-						})
+						this.list = res.messages.reverse()
+						console.log(this.list);
 						this.$nextTick(() => {
 							uni.pageScrollTo({
 								scrollTop: 99999
 							})
 						})
-					},
-				})
-			},
-			getworker() {
-				this.$u.post('/api/News/get_worker_info', {
-					worker_id: this.worker_id
-				}).then(res => {
-					this.workername = res.data.name
-					this.workerheadimg = res.data.headimg
-				})
+					})
+					.catch((e) => {
+						// 获取失败。
+						console.log('失败', e);
+					});
 			},
-			getlist() {
-				uni.showLoading({
-					mask: true,
-					title: "请稍后"
-				})
-				this.$u.post('/api/News/news_list', {
-					worker_id: this.worker_id,
-					page_num: 20,
-					page: this.page
-				}).then(res => {
-					var list = res.data
-					list.forEach(val => {
-						val.defaultTime = val.time
-						this.list.unshift(val)
+			toinfo(item, type) {
+				if (type == 'pos' && item.ext.order.item_url) {
+					uni.navigateTo({
+						url: "/pagesB/details?id=" + item.ext.order.item_url
 					})
-					if (this.page == 1) {
-						this.$nextTick(() => {
-							uni.pageScrollTo({
-								scrollTop: 99999
-							})
-						})
-					}
+				} else if (type == 'cand') {
+					uni.navigateTo({
+						url: "/pagesC/rencai-info?id=" + item.ext.order.item_url
+					})
+				} else if (type == 'order') {
+					uni.navigateTo({
+						url: "/pagesD/order-detail?id=" + item.ext.order.item_url
+					})
+				}
+			}
+		}
+	}
+</script>
 
-				})
-			},
-			send1(tempFilePath, duration) {
-				var option = {
-					type: "audio",
-					chatType: "singleChat",
-					filename: "tempFilePath",
-					from: uni.getStorageSync("hx_username"),
-					// 消息接收方:单聊为对端用户 ID,群聊和聊天室分别为群组 ID 和聊天室 ID。
-					to: this.hx_username,
-					body: {
-						//文件 URL。
-						url: tempFilePath,
-						//文件类型。
-						type: "audio",
-						//文件名。
-						filename: "tempFilePath",
-						// 音频文件时长,单位为秒。
-						length: Math.ceil(duration / 1000),
-					},
-				};
+<style lang="scss">
+	.title{
+		font-family: PingFangSC, PingFang SC;
+		font-weight: 500;
+		font-size: 36rpx;
+		color: #222222;
+		line-height: 50rpx;
+		text-align: left;
+		font-style: normal;
+	}
+	.jend {
+		justify-content: flex-end;
+	}
 
-				// let option = {
-				// 	// 消息类型。
-				// 	type: "audio",
-				// 	file: tempFilePath,
-				// 	// 语音文件长度,单位为秒。
-				// 	length: Math.ceil(duration / 1000),
-				// 	// 消息接收方:单聊为对方用户 ID,群聊和聊天室分别为群组 ID 和聊天室 ID。
-				// 	to: this.hx_username,
-				// 	// 会话类型:单聊、群聊和聊天室分别为 `singleChat`、`groupChat` 和 `chatRoom`。
-				// 	chatType: "singleChat",
-				// 	// 语音文件上传失败。
-				// 	// onFileUploadError: function() {
-				// 	// 	console.log("onFileUploadError");
-				// 	// },
-				// 	// // 语音文件上传进度。
-				// 	// onFileUploadProgress: function(e) {
-				// 	// 	console.log(e);
-				// 	// },
-				// 	// // 语音文件上传成功。
-				// 	// onFileUploadComplete: function() {
-				// 	// 	console.log("onFileUploadComplete");
-				// 	// },
-				// 	// ext: {},
-				// };
-				// let option = {
-				// 	// 消息类型。
-				// 	type: "txt",
-				// 	// 消息内容。
-				// 	msg: tempFilePath,
-				// 	// 消息发送方:单聊为对方用户 ID,群聊和聊天室分别为群组 ID 和聊天室 ID。
-				// 	from: uni.getStorageSync("hx_username"),
-				// 	// 消息接收方:单聊为对方用户 ID,群聊和聊天室分别为群组 ID 和聊天室 ID。
-				// 	to: this.hx_username,
-				// 	// 会话类型:单聊、群聊和聊天室分别为 `singleChat`、`groupChat` 和 `chatRoom`,默认为单聊。
-				// 	chatType: "singleChat",
-				// };
-				let msg = this.$WebIM.message.create(option);
-				console.log(msg);
-				this.$WebIM.conn.send(msg).then(res => {
-					this.$u.post('/api/News/send_news', {
-						worker_id: this.worker_id,
-						content: tempFilePath,
-						type1: "record",
-						time: msg.body.length
-					}).then(res => {
-						this.chatlist.push({
-							defaultTime: msg.body.length,
-							content: tempFilePath,
-							create_at: this.$u.timeFormat(msg.time, 'yyyy-mm-dd hh:MM:ss'),
-							headimg: this.myheadimg,
-							name: this.myname,
-							type: 1,
-							type1: "record",
-							message: msg.body.length
-						})
-						this.$nextTick(() => {
-							uni.pageScrollTo({
-								scrollTop: 99999
-							})
-						})
+	.chat-pages {
+		.chat-header1 {
+			width: 702rpx;
+			background: #FFFFFF;
+			border-radius: 16rpx;
+			position: sticky;
+			left: 24rpx;
+			// z-index: 20;
+			margin: 10px auto;
+			padding: 0 20rpx;
+
+			.goutong-time1 {
+				line-height: 80rpx;
+				font-size: 24rpx;
+				font-family: SFPro-Regular, SFPro;
+				font-weight: 400;
+				color: #777777;
+				border-top: 2rpx solid #F0F0F0;
+			}
 
-						console.log(this.chatlist);
-					})
-				})
-			},
+			.zhiwei-text {
+				font-size: 26rpx;
+				font-family: PingFangSC-Regular, PingFang SC;
+				font-weight: 400;
+				color: #555555;
+				padding-bottom: 20rpx;
+				border-bottom: 2rpx solid #F0F0F0;
+			}
+
+			.zhiwei-title {
+				font-size: 26rpx;
+				font-family: PingFangSC-Regular, PingFang SC;
+				font-weight: 400;
+				color: #555555;
+				margin-bottom: 20rpx;
+			}
 
+			.chat-label1 {
+				padding: 8rpx 0 10rpx 0;
+
+				text {
+					margin-right: 10rpx;
+					margin-bottom: 10rpx;
+					line-height: 40rpx;
+					background: #F3F3F3;
+					border-radius: 4rpx;
+					padding: 0 12rpx;
+					font-size: 24rpx;
+					font-family: PingFangSC-Regular, PingFang SC;
+					font-weight: 400;
+					color: #555555;
+				}
+			}
 
+			.jingli1-box {
+				font-size: 24rpx;
+				font-family: PingFangSC-Regular, PingFang SC;
+				font-weight: 400;
+				color: #555555;
+				margin-bottom: 20rpx;
+			}
 
+			.header1-top {
+				padding: 24rpx 0 20rpx 0;
 
-			send(text) {
-				if (!text) {
-					this.$u.toast("请输入内容")
-					return
+				text:frist-child {
+					font-size: 32rpx;
+					font-family: PingFangSC-Medium, PingFang SC;
+					font-weight: 500;
+					color: #222222;
 				}
-				this.text = ''
-				let option = {
-					// 消息类型。
-					type: "txt",
-					// 消息内容。
-					msg: text,
-					// 消息发送方:单聊为对方用户 ID,群聊和聊天室分别为群组 ID 和聊天室 ID。
-					from: uni.getStorageSync("hx_username"),
-					// 消息接收方:单聊为对方用户 ID,群聊和聊天室分别为群组 ID 和聊天室 ID。
-					to: this.hx_username,
-					// 会话类型:单聊、群聊和聊天室分别为 `singleChat`、`groupChat` 和 `chatRoom`,默认为单聊。
-					chatType: "singleChat",
-				};
-				// 创建文本消息。
-				let msg = this.$WebIM.message.create(option);
-				// console.log(msg);
-				this.$WebIM.conn.send(msg).then(res => {
-					this.$u.post('/api/News/send_news', {
-						worker_id: this.worker_id,
-						content: text
-					}).then(res => {
-						this.chatlist.push({
-							content: msg.msg,
-							create_at: this.$u.timeFormat(msg.time, 'yyyy-mm-dd hh:MM:ss'),
-							headimg: this.myheadimg,
-							name: this.myname,
-							type: 1,
-						})
-						this.$nextTick(() => {
-							uni.pageScrollTo({
-								scrollTop: 99999
-							})
-						})
 
-						// console.log(this.chatlist);
-					})
-				})
+				text:last-child {
+					font-size: 32rpx;
+					font-family: DINAlternate-Bold, DINAlternate;
+					font-weight: bold;
+					color: #0C66C2;
+				}
 			}
 		}
-	}
-</script>
 
-<style lang="scss" scoped>
-	page {
-		background-color: #F2F2F2;
-	}
+		.chat-item {
+			padding: 0 24rpx;
+			margin-bottom: 20rpx;
+
+			.chat-item-box {
+
+				.chat-text {
+					border-radius: 20rpx;
+					background-color: #fff;
+					max-width: 100%;
+					margin: 0 20rpx;
+					font-size: 30rpx;
+					font-family: PingFangSC-Regular, PingFang SC;
+					font-weight: 400;
+					color: #141414;
+					padding: 20rpx 24rpx;
+				}
 
-	.record {
-		display: flex;
-		align-items: center;
-		background-color: #1F7EFF;
-		color: #fff;
-		border-radius: 20rpx;
-		box-sizing: border-box;
-	}
+				.user-img {
+					width: 92rpx;
+					height: 92rpx;
+					border-radius: 100rpx;
+				}
+			}
 
-	.record1 {
-		display: flex;
-		align-items: center;
-		background-color: #eee;
-		color: #000;
-		border-radius: 20rpx;
-		box-sizing: border-box;
-	}
+			.chat-time {
+				text-align: center;
+				margin-bottom: 30rpx;
+				font-size: 24rpx;
+				font-family: PingFangSC-Regular, PingFang SC;
+				font-weight: 400;
+				color: #777777;
+			}
+		}
 
-	.quxiao {
+		.chat-header {
+			width: 702rpx;
+			background: #FFFFFF;
+			border-radius: 16rpx;
+			position: sticky;
+			left: 24rpx;
+			z-index: 20;
+			margin: 10px auto;
+			padding: 0 20rpx;
+
+			.goutong-time {
+				line-height: 80rpx;
+				font-size: 24rpx;
+				font-family: SFPro-Regular, SFPro;
+				font-weight: 400;
+				color: #777777;
+				border-top: 2rpx solid #F0F0F0;
+			}
 
-		background: #1F7EFF;
-		border-radius: 12rpx;
-		font-size: 30rpx;
-		font-family: PingFangSC-Medium, PingFang SC;
-		font-weight: 500;
-		color: #000;
-		text-align: center;
-		height: 84rpx;
-		line-height: 84rpx;
-	}
+			.chat-label {
+				padding: 8rpx 0 10rpx 0;
+
+				text {
+					margin-right: 10rpx;
+					margin-bottom: 10rpx;
+					line-height: 40rpx;
+					background: #F3F3F3;
+					border-radius: 4rpx;
+					padding: 0 12rpx;
+					font-size: 24rpx;
+					font-family: PingFangSC-Regular, PingFang SC;
+					font-weight: 400;
+					color: #555555;
+				}
+			}
 
-	.fasong {
-		background: limegreen;
-		border-radius: 12rpx;
-		font-size: 30rpx;
-		font-family: PingFangSC-Medium, PingFang SC;
-		font-weight: 500;
-		color: #fff;
-		text-align: center;
-		height: 84rpx;
-		line-height: 84rpx;
-	}
+			.jingli-box {
+				margin-bottom: 12rpx;
 
-	.chat {
-		.chat-list {
-			padding: 24rpx;
+				.img {
+					width: 28rpx;
+					height: 28rpx;
+				}
 
-			.more-btn {
-				padding: 10rpx 0;
-				text-align: center;
+				.text1 {
+					font-size: 28rpx;
+					font-family: PingFangSC-Regular, PingFang SC;
+					font-weight: 400;
+					color: #222222;
+					margin: 0 12rpx;
+					flex: 1;
+				}
+
+				.text2 {
+					font-size: 22rpx;
+					font-family: SFPro-Regular, SFPro;
+					font-weight: 400;
+					color: #888888;
+				}
 			}
 
-			.chat-item {
-				margin-bottom: 44rpx;
+			.header-top {
+				height: 150rpx;
 
-				.item-box {
-					text:first-child {
-						font-size: 28rpx;
-						font-weight: 500;
-						// color: #666666;
-						padding: 8rpx 24rpx;
+				.header-right {
+					width: 96rpx;
+					height: 96rpx;
+					position: relative;
+
+					.sex {
+						position: absolute;
+						bottom: 0;
+						right: 4rpx;
+						width: 20rpx;
+						height: 20rpx;
 					}
 
-					text:last-child {
+					.right-img {
+						width: 96rpx;
+						height: 96rpx;
+						border-radius: 100rpx;
+					}
+				}
 
-						padding: 9rpx 24rpx;
-						border-radius: 20rpx;
+				.header-left {
+					.text3 {
+						font-size: 26rpx;
+						font-family: SFPro-Regular, SFPro;
+						font-weight: 400;
+						color: #666666;
+						margin-top: 10rpx;
 					}
 
 					.text1 {
-						background-color: #fff;
-						border-radius: 20rpx;
+						font-size: 36rpx;
+						font-family: PingFangSC-Medium, PingFang SC;
+						font-weight: 500;
+						color: #222222;
+						margin-right: 28rpx;
 					}
 
 					.text2 {
-						background-color: #1F7EFF;
-						color: #fff;
-						border-radius: 20rpx;
+						font-size: 26rpx;
+						font-family: PingFangSC-Regular, PingFang SC;
+						font-weight: 400;
+						color: #222222;
 					}
 				}
-
-				.user-head {
-					width: 70rpx;
-					height: 70rpx;
-					border-radius: 100rpx;
-				}
 			}
 		}
 
-		.chat-btn {
-			position: fixed;
-			bottom: 0;
-			left: 0;
-			width: 750rpx;
-			height: 166rpx;
-			background: #FFFFFF;
-			z-index: 10;
-			padding: 0 24rpx 60rpx 24rpx;
-
-			input {
-				// width: 540rpx;
-				flex: 1;
-				margin-right: 20rpx;
-				height: 58rpx;
-				background: #F2F2F2;
-				border-radius: 30rpx;
-				padding: 0 28rpx;
-				box-sizing: border-box;
+		.chat-navbar {
+			flex: 1;
+			// padding-left: 100rpx;
+
+			text:first-child {
+				font-size: 36rpx;
+				font-family: PingFangSC-Medium, PingFang SC;
+				font-weight: 500;
+				color: #141414;
 			}
 
-			.post {
-				width: 102rpx;
-				line-height: 58rpx;
-				background: #1F7EFF;
-				border-radius: 30rpx;
-				text-align: center;
-				font-size: 24rpx;
-				// font-family: PingFangSC-Regular, PingFang SC;
+			text:last-child {
+				font-size: 22rpx;
+				font-family: PingFangSC-Regular, PingFang SC;
 				font-weight: 400;
-				color: #FFFFFF;
+				color: #777777;
 			}
 		}
 	}
 
-	::v-deep .record-btn {
-		width: 80vw !important;
-		text-align: center !important;
-		flex: 1 !important;
-	}
-
-	::v-deep .record .u-icon.data-v-6e20bb40 {
-		transform: rotate(-90deg) !important;
-	}
-
-	::v-deep .record1 .u-icon.data-v-6e20bb40 {
-		transform: rotate(90deg) !important;
+	page {
+		background-color: #F3F3F3;
 	}
 </style>

+ 39 - 18
pageA/chat/news.vue

@@ -20,18 +20,23 @@
 				</view>
 			</view>
 		</view>
-		<view class="box " >
-			<view class="u-flex " style="margin-bottom: 26rpx;" v-for="(item,idx) in  6" @click="chat">
-				<image src="/pageA/static/images/kefu.png" style="width: 88rpx;height: 88rpx;" mode=""></image>
-				<view class="u-row-between"
-					style="display: flex;flex-direction: column;margin-left: 20rpx;width: 85%;">
+		<view class="box ">
+			<view class="u-flex " style="margin-bottom: 26rpx;" v-for="(item,idx) in  list" :key="idx"
+				@click="chat(item.lastMessage)">
+				<image :src="item.lastMessage.ext.image" style="width: 88rpx;height: 88rpx;" mode=""></image>
+				<view class="u-row-between" style="display: flex;flex-direction: column;margin-left: 20rpx;width: 85%;">
 					<view class="u-flex u-row-between">
-						<view class="name">官方客服</view>
-						<view class="time">14:09</view>
+						<view class="name">{{item.lastMessage.ext.shopname}}</view>
+						<view class="time">
+							{{new Date(item.lastMessage.time).getFullYear()}}-{{new Date(item.lastMessage.time).getMonth() + 1}}-{{new Date(item.lastMessage.time).getDate()}}
+							{{new Date(item.lastMessage.time).toTimeString().substr(0, 8)}}
+						</view>
 					</view>
-					<view class="u-flex u-row-between" style="border-bottom: 2rpx solid #979797;padding-bottom: 26rpx;margin-top: 10rpx;">
-						<text class="news">[卡片]</text>
-						<u-badge :type="type" max="99" :value="value"></u-badge>
+					<view class="u-flex u-row-between"
+						style="border-bottom: 2rpx solid #979797;padding-bottom: 26rpx;margin-top: 10rpx;">
+						<text v-if="item.lastMessage.msg" class="news">{{item.lastMessage.msg}}</text>
+						<text v-if="item.lastMessage.type == 'img'" class="news">图片</text>
+						<u-badge :type="type" max="99" :value="item.unReadCount"></u-badge>
 					</view>
 				</view>
 			</view>
@@ -40,24 +45,40 @@
 </template>
 
 <script>
+	import {
+		conn,
+	} from '@/utils/WebIM';
 	export default {
 		data() {
 			return {
 				type: "error",
-				value: 1
+				value: 1,
+				list: []
 			};
 		},
-		methods:{
-			tokefu(){
-				uni.navigateTo({
-					url:'/pageA/service/service'
+		onLoad() {
+			this.getlist()
+		},
+		methods: {
+			getlist() {
+				conn.getServerConversations({
+					pageSize: 50,
+					cursor: ''
+				}).then((res) => {
+					console.log(res);
+					this.list = res.data.conversations
 				})
 			},
-			chat(){
+			tokefu() {
 				uni.navigateTo({
-					url:'/pageA/chat/chat'
+					url: '/pageA/service/service'
 				})
-			}
+			},
+			// chat(item) {
+			// 	uni.navigateTo({
+			// 		url: '/pageA/chat/chat?user_other_no=' + item.from
+			// 	})
+			// }  
 		}
 	}
 </script>

+ 9 - 3
pageA/productdetails.vue

@@ -234,13 +234,14 @@
 				<view class="" style="height: 158rpx"></view>
 				<view class="fix u-flex u-row-between">
 					<view class="u-flex" style="column-gap: 35rpx">
-						<view class="u-flex" style="justify-content: center; flex-direction: column">
+						<view class="u-flex" style="justify-content: center; flex-direction: column" @click="chat">
 							<image src="../static/images/index/service.png" style="width: 40rpx; height: 40rpx" mode="">
 							</image>
 							<view class="ke">{{ i18n.Customer }}</view>
 						</view>
 						<view class="u-flex" style="justify-content: center; flex-direction: column" @click="shopping">
-							<image src="../static/cart1.png" style="width: 40rpx; height: 40rpx" mode=""></image>
+							<image src="../static/cart1.png" style="width: 40rpx; height: 40rpx" mode="">
+							</image>
 							<view class="ke">{{ i18n.Shopping }}</view>
 						</view>
 						<view class="u-flex" style="
@@ -494,6 +495,11 @@
 			this.guarantee()
 		},
 		methods: {
+			chat() {
+				uni.navigateTo({
+					url: '/pageA/chat/chat?user_other=' + encodeURIComponent(JSON.stringify(this.goodinfo.merchant)) +'&user_other_no=' + this.goodinfo.merchant.member.easemob_username
+				})
+			},
 			sharea() {
 				this.share = true
 			},
@@ -594,7 +600,7 @@
 					.then((res) => {
 						console.log(res);
 						this.goodinfo = res;
-						console.log('goodinfo.discount_price',this.goodinfo.discount_price);
+						console.log('goodinfo.discount_price', this.goodinfo.discount_price);
 						this.comment();
 						this.rate = res.merchant.score;
 					})

+ 2 - 1
pageA/shoplist.vue

@@ -107,7 +107,7 @@
 				goodsid: '',
 				title: '',
 				parent_id: '',
-				language: '',
+				language: 'zh-CN',
 				page: 1,
 				weight_range_start: '', //重量区间 start
 				weight_range_end: '', //重量区间 end
@@ -188,6 +188,7 @@
 						})
 					}
 					this.list1 = categoryArr.reverse()
+					console.log(this.list1);
 				}).catch(() => {
 
 				})

+ 206 - 252
pageC/accountSetup/accountSetup.vue

@@ -1,259 +1,213 @@
 <template>
-  <view class="page">
-    <view class="set-top">
-      <view
-        class="information"
-        @click="toNextPage('/pageC/personalInformation/personalInformation')"
-      >
-        <view class="information-lift">
-          <image
-            src="http://pic.imeitou.com/uploads/allimg/240522/10-240522162434-50.jpg"
-            class="header-img"
-            mode=""
-          ></image>
-          <view class="name"> 张三 </view>
-        </view>
-        <image
-          class="right-icon"
-          src="../../static/mine/325.png"
-          mode=""
-        ></image>
-      </view>
-      <view
-        class="address"
-        @click="toNextPage('/pageC/addressManagement/addressManagement')"
-      >
-        <view class="address-manage">
-          {{ i18n.address }}
-        </view>
-        <view class="text-right">
-          <text>{{ i18n.addAndEdit }}</text>
-          <image
-            src="../../static/mine/325.png"
-            class="right-icon"
-            mode=""
-          ></image>
-        </view>
-      </view>
-    </view>
-
-    <view class="set-center">
-      <view
-        class="security"
-        @click="toNextPage('/pageC/accountSecurity/accountSecurity')"
-      >
-        <text>{{ i18n.account }}</text>
-        <view class="text-right">
-          <text>{{ i18n.password }}</text>
-          <image
-            src="../../static/mine/325.png"
-            class="right-icon"
-            mode=""
-          ></image>
-        </view>
-      </view>
-      <view
-        class="switch"
-        @click="toNextPage('/pageC/switchLanguage/switchLanguage')"
-      >
-        <text>{{ i18n.switch }}</text>
-        <image
-          src="../../static/mine/325.png"
-          class="right-icon"
-          mode=""
-        ></image>
-      </view>
-    </view>
-
-    <view class="set-bottom">
-      <view class="text-1">
-        <text>{{ i18n.user }}</text>
-        <image
-          src="../../static/mine/325.png"
-          class="right-icon"
-          mode=""
-        ></image>
-      </view>
-      <view
-        class="text-1"
-        @click="toNextPage('/pageC/privacyPolicy/privacyPolicy')"
-      >
-        <text>{{ i18n.privacy }}</text>
-        <image
-          src="../../static/mine/325.png"
-          class="right-icon"
-          mode=""
-        ></image>
-      </view>
-      <view class="text-1">
-        <text>{{ i18n.platform }}</text>
-        <image
-          src="../../static/mine/325.png"
-          class="right-icon"
-          mode=""
-        ></image>
-      </view>
-      <view class="text-2">
-        <text>{{ i18n.merchant }}</text>
-        <image
-          src="../../static/mine/325.png"
-          class="right-icon"
-          mode=""
-        ></image>
-      </view>
-    </view>
-
-    <button class="layout" @click="layout">{{ i18n.layout }}</button>
-  </view>
+	<view class="page">
+		<view class="set-top">
+			<view class="information" @click="toNextPage('/pageC/personalInformation/personalInformation')">
+				<view class="information-lift">
+					<image src="http://pic.imeitou.com/uploads/allimg/240522/10-240522162434-50.jpg" class="header-img"
+						mode=""></image>
+					<view class="name"> 张三 </view>
+				</view>
+				<image class="right-icon" src="../../static/mine/325.png" mode=""></image>
+			</view>
+			<view class="address" @click="toNextPage('/pageC/addressManagement/addressManagement')">
+				<view class="address-manage">
+					{{ i18n.address }}
+				</view>
+				<view class="text-right">
+					<text>{{ i18n.addAndEdit }}</text>
+					<image src="../../static/mine/325.png" class="right-icon" mode=""></image>
+				</view>
+			</view>
+		</view>
+
+		<view class="set-center">
+			<view class="security" @click="toNextPage('/pageC/accountSecurity/accountSecurity')">
+				<text>{{ i18n.account }}</text>
+				<view class="text-right">
+					<text>{{ i18n.password }}</text>
+					<image src="../../static/mine/325.png" class="right-icon" mode=""></image>
+				</view>
+			</view>
+			<view class="switch" @click="toNextPage('/pageC/switchLanguage/switchLanguage')">
+				<text>{{ i18n.switch }}</text>
+				<image src="../../static/mine/325.png" class="right-icon" mode=""></image>
+			</view>
+		</view>
+
+		<view class="set-bottom">
+			<view class="text-1">
+				<text>{{ i18n.user }}</text>
+				<image src="../../static/mine/325.png" class="right-icon" mode=""></image>
+			</view>
+			<view class="text-1" @click="toNextPage('/pageC/privacyPolicy/privacyPolicy')">
+				<text>{{ i18n.privacy }}</text>
+				<image src="../../static/mine/325.png" class="right-icon" mode=""></image>
+			</view>
+			<view class="text-1">
+				<text>{{ i18n.platform }}</text>
+				<image src="../../static/mine/325.png" class="right-icon" mode=""></image>
+			</view>
+			<view class="text-2">
+				<text>{{ i18n.merchant }}</text>
+				<image src="../../static/mine/325.png" class="right-icon" mode=""></image>
+			</view>
+		</view>
+
+		<button class="layout" @click="layout">{{ i18n.layout }}</button>
+	</view>
 </template>
 
 <script>
-import AllRight from "../mineComponent/allRight/allRight.vue";
-export default {
-  components: {
-    AllRight,
-  },
-  computed: {
-    i18n() {
-      return this.$t("index");
-    },
-  },
-  onShow() {
-    uni.setNavigationBarTitle({
-      title: this.i18n.setup,
-    });
-  },
-  data() {
-    return {};
-  },
-  methods: {
-    //退出登录
-    layout() {
-      uni.navigateTo({
-        url: "/pages/login/login",
-      });
-    },
-    toNextPage(url) {
-      uni.navigateTo({
-        url: url,
-      });
-    },
-  },
-  mounted() {
-    uni.setNavigationBarTitle({
-      title: this.i18n.setup,
-    });
-  },
-  created() {},
-};
+	import AllRight from "../mineComponent/allRight/allRight.vue";
+	export default {
+		components: {
+			AllRight,
+		},
+		computed: {
+			i18n() {
+				return this.$t("index");
+			},
+		},
+		onShow() {
+			uni.setNavigationBarTitle({
+				title: this.i18n.setup,
+			});
+		},
+		data() {
+			return {};
+		},
+		methods: {
+			//退出登录
+			layout() {
+				uni.clearStorage()
+				uni.navigateTo({
+					url: "/pages/login/login",
+				});
+
+			},
+			toNextPage(url) {
+				uni.navigateTo({
+					url: url,
+				});
+			},
+		},
+		mounted() {
+			uni.setNavigationBarTitle({
+				title: this.i18n.setup,
+			});
+		},
+		created() {},
+	};
 </script>
 
 <style lang="scss" scoped>
-.page {
-  padding: 20rpx 24rpx;
-
-  .set-top {
-    background-color: #fff;
-    border-radius: 16rpx;
-    padding: 0 20rpx;
-
-    .information {
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-      width: 100%;
-      height: 176rpx;
-
-      .information-lift {
-        display: flex;
-        align-items: center;
-
-        .header-img {
-          border-radius: 50%;
-          height: 116rpx;
-          width: 116rpx;
-          margin-right: 20rpx;
-        }
-
-        .name {
-          font-size: 36rpx;
-        }
-      }
-    }
-
-    .address {
-      display: flex;
-      justify-content: space-between;
-      height: 106rpx;
-      align-items: center;
-      border-top: 2rpx solid rgba(151, 151, 151, 0.2);
-    }
-  }
-
-  .set-center {
-    margin-top: 20rpx;
-    background-color: #fff;
-    border-radius: 16rpx;
-    padding: 0 20rpx;
-
-    .security {
-      display: flex;
-      height: 102rpx;
-      border-bottom: 2rpx solid rgba(151, 151, 151, 0.2);
-      justify-content: space-between;
-      align-items: center;
-    }
-
-    .switch {
-      display: flex;
-      justify-content: space-between;
-      height: 104rpx;
-      align-items: center;
-    }
-  }
-
-  .set-bottom {
-    border-radius: 16rpx;
-    padding: 0 20rpx;
-    background-color: #fff;
-    margin-top: 20rpx;
-
-    .text-1 {
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-      height: 102rpx;
-      border-bottom: 2rpx solid rgba(151, 151, 151, 0.2);
-    }
-
-    .text-2 {
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-      height: 102rpx;
-    }
-  }
-
-  .layout {
-    border-radius: 16rpx;
-    background-color: #fff;
-    color: #f83224;
-    font-size: 32rpx;
-    height: 92rpx;
-    margin-top: 20rpx;
-  }
-
-  .right-icon {
-    width: 32rpx;
-    height: 32rpx;
-  }
-  .text-right {
-    display: flex;
-    align-items: center;
-    text {
-      font-size: 30rpx;
-      color: rgba(34, 34, 34, 0.5);
-    }
-  }
-}
-</style>
+	.page {
+		padding: 20rpx 24rpx;
+
+		.set-top {
+			background-color: #fff;
+			border-radius: 16rpx;
+			padding: 0 20rpx;
+
+			.information {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				width: 100%;
+				height: 176rpx;
+
+				.information-lift {
+					display: flex;
+					align-items: center;
+
+					.header-img {
+						border-radius: 50%;
+						height: 116rpx;
+						width: 116rpx;
+						margin-right: 20rpx;
+					}
+
+					.name {
+						font-size: 36rpx;
+					}
+				}
+			}
+
+			.address {
+				display: flex;
+				justify-content: space-between;
+				height: 106rpx;
+				align-items: center;
+				border-top: 2rpx solid rgba(151, 151, 151, 0.2);
+			}
+		}
+
+		.set-center {
+			margin-top: 20rpx;
+			background-color: #fff;
+			border-radius: 16rpx;
+			padding: 0 20rpx;
+
+			.security {
+				display: flex;
+				height: 102rpx;
+				border-bottom: 2rpx solid rgba(151, 151, 151, 0.2);
+				justify-content: space-between;
+				align-items: center;
+			}
+
+			.switch {
+				display: flex;
+				justify-content: space-between;
+				height: 104rpx;
+				align-items: center;
+			}
+		}
+
+		.set-bottom {
+			border-radius: 16rpx;
+			padding: 0 20rpx;
+			background-color: #fff;
+			margin-top: 20rpx;
+
+			.text-1 {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				height: 102rpx;
+				border-bottom: 2rpx solid rgba(151, 151, 151, 0.2);
+			}
+
+			.text-2 {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				height: 102rpx;
+			}
+		}
+
+		.layout {
+			border-radius: 16rpx;
+			background-color: #fff;
+			color: #f83224;
+			font-size: 32rpx;
+			height: 92rpx;
+			margin-top: 20rpx;
+		}
+
+		.right-icon {
+			width: 32rpx;
+			height: 32rpx;
+		}
+
+		.text-right {
+			display: flex;
+			align-items: center;
+
+			text {
+				font-size: 30rpx;
+				color: rgba(34, 34, 34, 0.5);
+			}
+		}
+	}
+</style>

+ 2 - 1
pages.json

@@ -108,7 +108,8 @@
 					"path": "chat/chat",
 					"style": {
 						"navigationBarTitleText": "",
-						"enablePullDownRefresh": false
+						"enablePullDownRefresh": false,
+						"navigationStyle": "custom"
 					}
 				},
 				{

+ 3 - 0
pages/login/login.vue

@@ -102,6 +102,7 @@
 															uni.setStorageSync("token", res.token);
 															uni.setStorageSync("openid", res
 																.openid);
+															uni.setStorageSync("user_info", res);
 															setTimeout(() => {
 																uni.navigateTo({
 																	url: "/pageA/changelange",
@@ -114,6 +115,7 @@
 										} else {
 											uni.setStorageSync("token", res.token);
 											uni.setStorageSync("openid", res.openid);
+											uni.setStorageSync("user_info", res);
 											setTimeout(() => {
 												uni.navigateTo({
 													url: "/pageA/changelange",
@@ -155,6 +157,7 @@
 					})
 					.then((res) => {
 						uni.setStorageSync("token", res.token);
+						uni.setStorageSync("user_info", res);
 						uni.setStorageSync('user_no',res.easemob_username)
 						uni.setStorageSync('pwd',res.easemob_password)
 						var options = {

BIN=BIN
static/imagess/Scanning.png


BIN=BIN
static/imagess/address.png


BIN=BIN
static/imagess/address1.png


BIN=BIN
static/imagess/addressicon.png


BIN=BIN
static/imagess/bg.png


BIN=BIN
static/imagess/bianji.png


BIN=BIN
static/imagess/biaoqing.png


BIN=BIN
static/imagess/close.png


BIN=BIN
static/imagess/del.png


BIN=BIN
static/imagess/dianzan.png


BIN=BIN
static/imagess/dianzan3.png


BIN=BIN
static/imagess/dizhi.png


BIN=BIN
static/imagess/employment.png


BIN=BIN
static/imagess/fabu1.png


BIN=BIN
static/imagess/fabu2.png


BIN=BIN
static/imagess/gongsi-bg.png


BIN=BIN
static/imagess/index-header.png


BIN=BIN
static/imagess/index.png


BIN=BIN
static/imagess/index1.png


BIN=BIN
static/imagess/jianli.png


BIN=BIN
static/imagess/jianli2.png


BIN=BIN
static/imagess/jianpan.png


BIN=BIN
static/imagess/jingli-img.png


BIN=BIN
static/imagess/juxing.png


BIN=BIN
static/imagess/liulan.png


BIN=BIN
static/imagess/logo.png


BIN=BIN
static/imagess/luntan.png


BIN=BIN
static/imagess/luntan1.png


BIN=BIN
static/imagess/mine-bg.png


BIN=BIN
static/imagess/mine-huiyuan.png


BIN=BIN
static/imagess/mine-other1.png


BIN=BIN
static/imagess/mine-other2.png


BIN=BIN
static/imagess/mine-other3.png


BIN=BIN
static/imagess/mine-other4.png


BIN=BIN
static/imagess/mine-qiehuan.png


BIN=BIN
static/imagess/mine-setting.png


BIN=BIN
static/imagess/mine-tabs-bg.png


BIN=BIN
static/imagess/mine-zhaopin.png


BIN=BIN
static/imagess/mine-zixun.png


BIN=BIN
static/imagess/mine.png


BIN=BIN
static/imagess/mine1.png


BIN=BIN
static/imagess/more1.png


BIN=BIN
static/imagess/more2.png


BIN=BIN
static/imagess/more3.png


BIN=BIN
static/imagess/more4.png


BIN=BIN
static/imagess/moren.jpg


BIN=BIN
static/imagess/nan.png


BIN=BIN
static/imagess/nv.png


BIN=BIN
static/imagess/pdf.png


BIN=BIN
static/imagess/pinglun.png


BIN=BIN
static/imagess/plus.png


BIN=BIN
static/imagess/plus1.png


BIN=BIN
static/imagess/pop.png


BIN=BIN
static/imagess/qiehuan.png


BIN=BIN
static/imagess/qiuzhi.png


BIN=BIN
static/imagess/quanzi.png


BIN=BIN
static/imagess/rencai-shaixuan.png


BIN=BIN
static/imagess/rencai.png


BIN=BIN
static/imagess/rencai1.png


BIN=BIN
static/imagess/renzheng.png


BIN=BIN
static/imagess/shezhi.png


BIN=BIN
static/imagess/unverified.png


BIN=BIN
static/imagess/vip-popup.png


BIN=BIN
static/imagess/weirenzheng.png


BIN=BIN
static/imagess/wenjian.png


BIN=BIN
static/imagess/woek.png


BIN=BIN
static/imagess/xiangguan.png


BIN=BIN
static/imagess/xiaoxi.png


BIN=BIN
static/imagess/xiaoxi1.png


BIN=BIN
static/imagess/yaoqing.png


BIN=BIN
static/imagess/yiguobao.png


BIN=BIN
static/imagess/yinsi.png


BIN=BIN
static/imagess/zhiye.png


BIN=BIN
static/imagess/zixun.png


BIN=BIN
static/imagess/zixun1.png


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/common/runtime.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/components/kj-chat/kj-chat.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/components/kj-flow/kj-flow.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/components/kj-tabbar/kj-tabbar.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/components/zh-slidingMenu/zhSlidingMenu/zhSlidingMenu.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pageA/changelange.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pageA/chat/chat.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pageA/chat/news.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pageA/comment.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pageA/common/vendor.js.map


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio