howard 1 year ago
commit
dbb2df97a7
100 changed files with 32272 additions and 0 deletions
  1. 21 0
      .gitignore
  2. 20 0
      .hbuilderx/launch.json
  3. 247 0
      App.vue
  4. 5 0
      EaseIM/config/index.js
  5. 35 0
      EaseIM/constant/grayInform.js
  6. 180 0
      EaseIM/constant/index.js
  7. 46 0
      EaseIM/emApis/emAboutAck.js
  8. 38 0
      EaseIM/emApis/emConnect.js
  9. 123 0
      EaseIM/emApis/emContacts.js
  10. 91 0
      EaseIM/emApis/emConversation.js
  11. 265 0
      EaseIM/emApis/emGroups.js
  12. 134 0
      EaseIM/emApis/emMessages.js
  13. 136 0
      EaseIM/emApis/emPresence.js
  14. 72 0
      EaseIM/emApis/emSilent.js
  15. 80 0
      EaseIM/emApis/emUserInfos.js
  16. 20 0
      EaseIM/emApis/index.js
  17. 25 0
      EaseIM/emListener/emConnectListener.js
  18. 139 0
      EaseIM/emListener/emContactsListener.js
  19. 18 0
      EaseIM/emListener/emErrorListener.js
  20. 221 0
      EaseIM/emListener/emGroupListener.js
  21. 147 0
      EaseIM/emListener/emMessagesListener.js
  22. 19 0
      EaseIM/emListener/emMountGlobalListener.js
  23. 23 0
      EaseIM/emListener/emPresenceListener.js
  24. 10 0
      EaseIM/emListener/index.js
  25. 10 0
      EaseIM/index.js
  26. 23 0
      EaseIM/utils/convertGroupDetailsToGroupList.js
  27. 22 0
      EaseIM/utils/emHandleReconnect.js
  28. 11 0
      EaseIM/utils/getCurrentRoute.js
  29. 15 0
      EaseIM/utils/getEMKey.js
  30. 32 0
      EaseIM/utils/handlePresence.js
  31. 12 0
      EaseIM/utils/index.js
  32. 86 0
      EaseIM/utils/paseEmoji.js
  33. 103 0
      chat/contacts/contacts.css
  34. 380 0
      chat/contacts/contacts.vue
  35. 1042 0
      chatIndex/storemanagement/index.vue
  36. 173 0
      commit/api.js
  37. 55 0
      commit/config.js
  38. 179 0
      commit/item.js
  39. 27 0
      commit/order.js
  40. 67 0
      commit/request.js
  41. 59 0
      commit/shop.js
  42. 319 0
      constant/emoji.js
  43. 33 0
      constant/index.js
  44. 320 0
      emChat/emChatContainer/emChatNavbar/index.vue
  45. 238 0
      emChat/emChatContainer/emGrayMessageContainer/index.vue
  46. 55 0
      emChat/emChatContainer/emInputBarContainer/editMessageContainer/index.vue
  47. 50 0
      emChat/emChatContainer/emInputBarContainer/emojiPickerContainer/index.vue
  48. 481 0
      emChat/emChatContainer/emInputBarContainer/index.vue
  49. 125 0
      emChat/emChatContainer/emInputBarContainer/inputMessages/sendFileMessage/index.vue
  50. 194 0
      emChat/emChatContainer/emInputBarContainer/inputMessages/sendImageMessage/index.vue
  51. 65 0
      emChat/emChatContainer/emInputBarContainer/moreFuncContainer/index.css
  52. 86 0
      emChat/emChatContainer/emInputBarContainer/moreFuncContainer/index.vue
  53. 447 0
      emChat/emChatContainer/emInputBarContainer/recordAudioContainer/index.vue
  54. 252 0
      emChat/emChatContainer/emInputBarContainer/replyMessageContainer/index.vue
  55. 72 0
      emChat/emChatContainer/emMessageListContainer/index.css
  56. 281 0
      emChat/emChatContainer/emMessageListContainer/index.vue
  57. 80 0
      emChat/emChatContainer/emMessageListContainer/messagesItem/audioMsgItem/index.css
  58. 118 0
      emChat/emChatContainer/emMessageListContainer/messagesItem/audioMsgItem/index.vue
  59. 247 0
      emChat/emChatContainer/emMessageListContainer/messagesItem/fileMsgItem/index.vue
  60. 63 0
      emChat/emChatContainer/emMessageListContainer/messagesItem/imageMsgItem/index.vue
  61. 120 0
      emChat/emChatContainer/emMessageListContainer/messagesItem/productCardItem/index.vue
  62. 149 0
      emChat/emChatContainer/emMessageListContainer/messagesItem/textMsgItem/index.vue
  63. 93 0
      emChat/emChatContainer/emMessageListContainer/messagesItem/userCardItem/index.vue
  64. 54 0
      emChat/emChatContainer/emMessageListContainer/msgQuoteContainer/index.vue
  65. 273 0
      emChat/emChatContainer/emMessagePopup/index.vue
  66. 0 0
      emChat/emChatContainer/emSelectUserCard/index.css
  67. 270 0
      emChat/emChatContainer/emSelectUserCard/index.vue
  68. 18 0
      emChat/emChatContainer/index.css
  69. 421 0
      emChat/emChatContainer/index.vue
  70. 26 0
      encryption/index.js
  71. 20 0
      index.html
  72. 29 0
      main.js
  73. 116 0
      manifest.json
  74. 528 0
      openmerchant/amountopening/index.vue
  75. 88 0
      openmerchant/guide/index.vue
  76. 884 0
      openmerchant/shopentry/process.vue
  77. 244 0
      openmerchant/shopentry/processaudit.vue
  78. 591 0
      openmerchant/shopentry/processidentity.vue
  79. 733 0
      openmerchant/shopentry/processstore.vue
  80. 13580 0
      package-lock.json
  81. 9 0
      package.json
  82. 274 0
      pages.json
  83. 742 0
      pages/cashier/index.vue
  84. 102 0
      pages/index/bottombat.vue
  85. 142 0
      pages/index/index.vue
  86. 338 0
      pages/my/index.vue
  87. 403 0
      pages/ordermanagement/index.vue
  88. 50 0
      pages/storemanagement/index.vue
  89. 502 0
      pages/user/login/index - 副本.vue
  90. 543 0
      pages/user/login/index.vue
  91. 30 0
      project.config.json
  92. 7 0
      project.private.config.json
  93. 685 0
      shop/commodity/details.vue
  94. 676 0
      shop/commodity/order.vue
  95. 188 0
      shop/department/management.vue
  96. 262 0
      shop/department/managementadd.vue
  97. 280 0
      shop/employee/list.vue
  98. 328 0
      shop/employee/listadd.vue
  99. 537 0
      shop/perating/activitecode.vue
  100. 0 0
      shop/perating/consumption.vue

+ 21 - 0
.gitignore

@@ -0,0 +1,21 @@
1
+# Logs
2
+logs
3
+*.log
4
+npm-debug.log*
5
+yarn-debug.log*
6
+yarn-error.log*
7
+pnpm-debug.log*
8
+lerna-debug.log*
9
+
10
+node_modules
11
+.DS_Store
12
+dist
13
+*.local
14
+
15
+# Editor directories and files
16
+.idea
17
+*.suo
18
+*.ntvs*
19
+*.njsproj
20
+*.sln
21
+*.sw?

+ 20 - 0
.hbuilderx/launch.json

@@ -0,0 +1,20 @@
1
+{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
2
+  // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
3
+    "version": "0.0",
4
+    "configurations": [{
5
+     	"app-plus" : 
6
+     	{
7
+     		"launchtype" : "local"
8
+     	},
9
+     	"default" : 
10
+     	{
11
+     		"launchtype" : "local"
12
+     	},
13
+     	"mp-weixin" : 
14
+     	{
15
+     		"launchtype" : "local"
16
+     	},
17
+     	"type" : "uniCloud"
18
+     }
19
+    ]
20
+}

+ 247 - 0
App.vue

@@ -0,0 +1,247 @@
1
+<script>
2
+	import {
3
+		EMClient
4
+	} from "@/EaseIM";
5
+	import {
6
+		emConnectListener,
7
+		emMountGlobalListener
8
+	} from "@/EaseIM/emListener";
9
+	import {
10
+		emConnect,
11
+		emUserInfos,
12
+		emConversation
13
+	} from "@/EaseIM/emApis";
14
+	import {
15
+		CONNECT_CALLBACK_TYPE,
16
+		HANDLER_EVENT_NAME
17
+	} from "@/EaseIM/constant";
18
+	import {
19
+		emHandleReconnect
20
+	} from "@/EaseIM/utils";
21
+	// import readAppInfo from './utils/readAppInfo.js';
22
+	const {
23
+		fetchUserInfoWithLoginId,
24
+		fetchOtherInfoFromServer
25
+	} =
26
+	emUserInfos();
27
+	//获取会话列表
28
+	const {
29
+		fetchConversationFromServer,
30
+		fetchPinConversationFromServer,
31
+		getLocalConversations
32
+	} = emConversation();
33
+
34
+
35
+	export default {
36
+		onLaunch() {
37
+			console.log('App Launch')
38
+			//传给监听callback回调
39
+			return;
40
+
41
+
42
+			const connectedCallback = (type) => {
43
+				console.log(">>>>>IM连接回调", type);
44
+				if (type === CONNECT_CALLBACK_TYPE.CONNECT_CALLBACK) {
45
+					this.onConnectedSuccess();
46
+				}
47
+				if (type === CONNECT_CALLBACK_TYPE.DISCONNECT_CALLBACK) {
48
+					this.onDisconnect();
49
+				}
50
+				if (type === CONNECT_CALLBACK_TYPE.RECONNECTING_CALLBACK) {
51
+					this.onReconnecting();
52
+				}
53
+			};
54
+
55
+			/* 链接所需监听回调 */
56
+			emConnectListener(connectedCallback);
57
+			/* 全局类型监听集合、消息、联系人、群组等... */
58
+			emMountGlobalListener();
59
+			this.handleAutoLoginEaseIM();
60
+
61
+		},
62
+		computed: {
63
+			loginStoreStatus() {
64
+				return this.$store.state.LoginStore.loginStatus;
65
+			},
66
+			loginStoreUserBaseInfos() {
67
+				return this.$store.state.LoginStore.loginUserBaseInfos;
68
+			},
69
+		},
70
+		onShow: function() {
71
+			console.log('appshow===>>>>>>')
72
+			// 读取url参数信息,存储app传递的用户相关信息
73
+			// readAppInfo(() => {
74
+			// 	// uni.redirectTo({
75
+			// 	// 	url: "/pages/my/index"
76
+			// 	// });
77
+			// });
78
+			// uni.redirectTo({
79
+			// 	url: "/pages/my/index"
80
+			// });
81
+
82
+
83
+
84
+		},
85
+		methods: {
86
+			//获取会话列表
87
+			getConversationFromServer() {
88
+
89
+				const uIds = [];
90
+				EMClient.getServerConversations({
91
+					pageSize: 100,
92
+					cursor: ''
93
+				}).then((res) => {
94
+					res.data.conversations && res.data.conversations.forEach((item) => {
95
+						console.log('会话item', item)
96
+						uIds.push(item.conversationId)
97
+					})
98
+					console.log('用户列表id', uIds);
99
+					uni.setStorage({
100
+						key: 'uIds',
101
+						data: uIds
102
+					})
103
+					// EMClient.fetchUserInfoById(uIds).then((resData)=>{
104
+					// 	console.log('用户列表',resData.data);
105
+					// })
106
+				}).catch((error) => {
107
+					console.log(error);
108
+				})
109
+			},
110
+			//登录环信
111
+			async loginWithUserId() {
112
+
113
+				try {
114
+					const res = await loginWithPassword(
115
+						uni.getStorageSync('im_userid'),
116
+						uni.getStorageSync('im_pass')
117
+					);
118
+					this.$store.commit('SET_LOGIN_USER_BASE_INFOS', {
119
+						loginUserId: uni.getStorageSync('im_userid'),
120
+					});
121
+					this.setEMUserLoginInfosToStorage(
122
+						uni.getStorageSync('im_userid').toLowerCase(),
123
+						res.accessToken
124
+					);
125
+				} catch (error) {
126
+					console.log('>>>>>>环信登录失败', error);
127
+					uni.showToast({
128
+						title: '登录失败',
129
+						icon: 'none',
130
+					});
131
+				} finally {
132
+
133
+				}
134
+			},
135
+			setEMUserLoginInfosToStorage(userId, token) {
136
+				const params = {
137
+					key: `EM_LOGIN_INFOS`,
138
+					data: {
139
+						userId: userId,
140
+						token: token
141
+					},
142
+				};
143
+				uni.setStorage({
144
+					...params
145
+				});
146
+			},
147
+			//自动登录
148
+			handleAutoLoginEaseIM() {
149
+				const {
150
+					actionEMReconnect
151
+				} = emHandleReconnect();
152
+				const loginInfos = uni.getStorageSync(`EM_LOGIN_INFOS`);
153
+				console.log('loginInfos', loginInfos)
154
+				if (!loginInfos) return;
155
+				actionEMReconnect();
156
+			},
157
+			onConnectedSuccess() {
158
+				const {
159
+					loginUserId
160
+				} = this.loginStoreUserBaseInfos || {};
161
+				const finalLoginUserId = loginUserId || EMClient.user;
162
+				if (!this.loginStoreStatus) {
163
+					this.fetchLoginUserNeedData();
164
+					uni.hideLoading();
165
+					console.log(">>>>>>开始跳转至会话列表页面");
166
+					//
167
+					this.getConversationFromServer();
168
+					uni.redirectTo({
169
+						url: "../home/home?myName=" + finalLoginUserId,
170
+					});
171
+				}
172
+				this.$store.commit("SET_LOGIN_USER_BASE_INFOS", {
173
+					loginUserId: finalLoginUserId,
174
+				});
175
+				this.$store.commit("SET_LOGIN_STATUS", true);
176
+
177
+			},
178
+			onDisconnect() {
179
+				const {
180
+					closeEaseIM
181
+				} = emConnect();
182
+				const {
183
+					actionEMReconnect
184
+				} = emHandleReconnect();
185
+				//断开回调触发后,如果业务登录状态为true则说明异常断开需要重新登录
186
+				if (!this.loginStatus) {
187
+					uni.showToast({
188
+						title: "退出登录",
189
+						icon: "none",
190
+						duration: 2000,
191
+					});
192
+					uni.redirectTo({
193
+						url: "../login/login",
194
+					});
195
+					closeEaseIM();
196
+				} else {
197
+					console.log(">>>>>需执行重登逻辑");
198
+					//执行通过token进行重新登录
199
+					actionEMReconnect();
200
+				}
201
+			},
202
+			onReconnecting() {
203
+				uni.showToast({
204
+					title: "IM 重连中...",
205
+					icon: "none",
206
+				});
207
+			},
208
+			//获取登录所需基础参数
209
+			async fetchLoginUserNeedData() {
210
+				await this.$store.dispatch("fetchFriendList");
211
+				//获取好友用户属性
212
+				await this.$store.dispatch("fetchFriendUserInfoCollection");
213
+				//获取当前登录用户好友信息
214
+				await this.$store.dispatch("fetchLoginUserProfile");
215
+				await this.$store.dispatch("fetchBlockUserList");
216
+				// 在线状态订阅
217
+				await this.$store.dispatch("subscribePresenceStatus");
218
+				this.fetchJoinedGroupList();
219
+				//初始化缓存本地的新邀请列表
220
+				this.$store.commit("INIT_RECEIVE_INVITE_LIST");
221
+			},
222
+			//获取加入的群组列表
223
+			async fetchJoinedGroupList() {
224
+				//获取群组列表
225
+				await this.$store.dispatch("fetchJoinedGroupList", {
226
+					isInit: true,
227
+				});
228
+			},
229
+		},
230
+
231
+		onHide: function() {
232
+			console.log('App Hide')
233
+		},
234
+	}
235
+</script>
236
+
237
+<style>
238
+	/*每个页面公共css */
239
+	* {
240
+		padding: 0;
241
+		margin: 0;
242
+		/* background-color: rgb(247, 248, 252); */
243
+		/* background-color: green; */
244
+	}
245
+
246
+	@import "@/uni_modules/uview-ui/index.scss";
247
+</style>

+ 5 - 0
EaseIM/config/index.js

@@ -0,0 +1,5 @@
1
+export const EM_API_URL = 'https://a1.easemob.com';
2
+export const EM_WEB_SOCKET_URL = 'wss://im-api-wechat.easemob.com/websocket';
3
+export const EM_APP_KEY = '1154240320150538#cxb-yhc';
4
+// export const EM_APP_KEY = 'easemob-demo#support';
5
+

+ 35 - 0
EaseIM/constant/grayInform.js

@@ -0,0 +1,35 @@
1
+/**
2
+ * 此常量非SDK内置,而是基于SDK回调事件演化而来,
3
+ * 用于在聊天界面能够展示灰色小字通知
4
+ * 如不需要,可以不做引入。
5
+ * */
6
+//灰色通知好友类型
7
+export const GRAY_INFORM_TEMPLATE_NAME = {
8
+  USER: '[XXX]',
9
+  GROUP_USER_FROM: '[AXX]',
10
+  GROUP_USER_TO: '[BXX]',
11
+  GROUP_ID: '[X_GROUP_ID_X]',
12
+};
13
+export const GRAY_INFORM_TYPE_SINGLE = {
14
+  CONTACT_ADDED: 'contactAdded',
15
+  CONTACT_AGREED: 'contactAgreed',
16
+};
17
+//灰色通知对应好友文本展示,[XXX]用于替换为实际用户ID或昵称
18
+export const GRAY_INFORM_MAP_SINGLE_TEXT = {
19
+  [GRAY_INFORM_TYPE_SINGLE.CONTACT_ADDED]: `你已添加了${GRAY_INFORM_TEMPLATE_NAME.USER},打个招呼吧!`,
20
+  [GRAY_INFORM_TYPE_SINGLE.CONTACT_AGREED]: `${GRAY_INFORM_TEMPLATE_NAME.USER}通过了你的好友申请,打个招呼吧!`,
21
+};
22
+//灰色通知群聊
23
+export const GRAY_INFORM_TYPE_GROUP = {
24
+  MEMBER_PRESENCE: 'memberPresence', // 有用户加入群组。除了新成员,其他群成员会收到该回调。
25
+  MEMBER_ABSENCE: 'memberAbsence', //群成员主动退出群组
26
+  CHANGE_OWNER: 'changeOwner', // 转让群组。原群主和新群主会收到该回调。
27
+  MEMBER_REMOVE: 'removeMember', // 用户被移出群组。被踢出群组的成员会收到该回调。
28
+};
29
+
30
+export const GRAY_INFORM_MAP_GROUP_TEXT = {
31
+  [GRAY_INFORM_TYPE_GROUP.MEMBER_PRESENCE]: `${GRAY_INFORM_TEMPLATE_NAME.GROUP_USER_FROM}加入了群组`,
32
+  [GRAY_INFORM_TYPE_GROUP.MEMBER_ABSENCE]: `${GRAY_INFORM_TEMPLATE_NAME.GROUP_USER_FROM}退出了群组`,
33
+  [GRAY_INFORM_TYPE_GROUP.CHANGE_OWNER]: `${GRAY_INFORM_TEMPLATE_NAME.GROUP_USER_FROM}移交群组至${GRAY_INFORM_TEMPLATE_NAME.GROUP_USER_TO}`,
34
+  [GRAY_INFORM_TYPE_GROUP.MEMBER_REMOVE]: `您已被移出${GRAY_INFORM_TEMPLATE_NAME.GROUP_ID}该群组!`,
35
+};

+ 180 - 0
EaseIM/constant/index.js

@@ -0,0 +1,180 @@
1
+import {
2
+  GRAY_INFORM_TYPE_SINGLE,
3
+  GRAY_INFORM_MAP_SINGLE_TEXT,
4
+  GRAY_INFORM_TYPE_GROUP,
5
+  GRAY_INFORM_MAP_GROUP_TEXT,
6
+  GRAY_INFORM_TEMPLATE_NAME,
7
+} from './grayInform';
8
+/* 灰色通知类型 */
9
+export {
10
+  GRAY_INFORM_TYPE_SINGLE,
11
+  GRAY_INFORM_MAP_SINGLE_TEXT,
12
+  GRAY_INFORM_TYPE_GROUP,
13
+  GRAY_INFORM_MAP_GROUP_TEXT,
14
+  GRAY_INFORM_TEMPLATE_NAME,
15
+};
16
+export const CHAT_TYPE = {
17
+  SINGLE_CHAT: 'singleChat',
18
+  GROUP_CHAT: 'groupChat',
19
+};
20
+export const INFORM_TYPE = {
21
+  CONTACTS: 'contacts',
22
+  GROUPS: 'groups',
23
+};
24
+export const HANDLER_EVENT_NAME = {
25
+  CONNECT_EVENT: 'connectEvent',
26
+  MESSAGES_EVENT: 'messagesEvent',
27
+  CONTACTS_EVENT: 'contactsEvent',
28
+  GROUP_EVENT: 'groupEvent',
29
+  ERROR_EVENT: 'errorEvent',
30
+  PRESENCE_EVENT:'presenceEvent'
31
+};
32
+
33
+export const CONNECT_CALLBACK_TYPE = {
34
+  CONNECT_CALLBACK: 'connected',
35
+  DISCONNECT_CALLBACK: 'disconnected',
36
+  RECONNECTING_CALLBACK: 'reconnecting',
37
+  ERROR_CALLBACK: 'onerror',
38
+};
39
+//定义消息状态
40
+export const MESSAGE_STATUS = {
41
+  READ: 'read',
42
+  UNREAD: 'unread',
43
+  DELETE: 'deleted',
44
+  PENDING: 'pending',
45
+  RECALL: 'recalled',
46
+  FAIL: 'fail',
47
+};
48
+export const MESSAGE_TYPE = {
49
+  IMAGE: 'img',
50
+  TEXT: 'txt',
51
+  LOCATION: 'location',
52
+  VIDEO: 'video',
53
+  AUDIO: 'audio',
54
+  EMOJI: 'emoji',
55
+  FILE: 'file',
56
+  CUSTOM: 'custom',
57
+  CMD: 'cmd',
58
+  GRAY_INFORM: 'gray_inform', //此类型非SDK正式类型,此类型为自定义的本地插入用于灰色通知类型。
59
+};
60
+export const SESSION_MESSAGE_TYPE = {
61
+  [MESSAGE_TYPE.IMAGE]: '[图片]',
62
+  [MESSAGE_TYPE.FILE]: '[文件]',
63
+  [MESSAGE_TYPE.AUDIO]: '[语音]',
64
+  [MESSAGE_TYPE.LOCATION]: '[位置]',
65
+  [MESSAGE_TYPE.VIDEO]: '[视频]',
66
+  [MESSAGE_TYPE.PRODUCTLINK]: '[商品链接]',
67
+};
68
+export const CUSTOM_EVENT_NAME = {
69
+  USER_CARD: 'userCard',
70
+  PRODUCTLINK:'productLink',
71
+};
72
+export const CUSTOM_TYPE = {
73
+  [CUSTOM_EVENT_NAME.USER_CARD]: '个人名片',
74
+  [CUSTOM_EVENT_NAME.PRODUCTLINK]: '[商品链接]',
75
+};
76
+
77
+export const EMOJI = {
78
+  path: '@/static/images/faces',
79
+  map: {
80
+    '[):]': 'ee_1.png',
81
+    '[:D]': 'ee_2.png',
82
+    '[;)]': 'ee_3.png',
83
+    '[:-o]': 'ee_4.png',
84
+    '[:p]': 'ee_5.png',
85
+    '[(H)]': 'ee_6.png',
86
+    '[:@]': 'ee_7.png',
87
+    '[:s]': 'ee_8.png',
88
+    '[:$]': 'ee_9.png',
89
+    '[:(]': 'ee_10.png',
90
+    "[:'(]": 'ee_11.png',
91
+    '[<o)]': 'ee_12.png',
92
+    '[(a)]': 'ee_13.png',
93
+    '[8o|]': 'ee_14.png',
94
+    '[8-|]': 'ee_15.png',
95
+    '[+o(]': 'ee_16.png',
96
+    '[|-)]': 'ee_17.png',
97
+    '[:|]': 'ee_18.png',
98
+    '[*-)]': 'ee_19.png',
99
+    '[:-#]': 'ee_20.png',
100
+    '[^o)]': 'ee_21.png',
101
+    '[:-*]': 'ee_22.png',
102
+    '[8-)]': 'ee_23.png',
103
+    '[del]': 'btn_del.png',
104
+    '[(|)]': 'ee_24.png',
105
+    '[(u)]': 'ee_25.png',
106
+    '[(S)]': 'ee_26.png',
107
+    '[(*)]': 'ee_27.png',
108
+    '[(#)]': 'ee_28.png',
109
+    '[(R)]': 'ee_29.png',
110
+    '[({)]': 'ee_30.png',
111
+    '[(})]': 'ee_31.png',
112
+    '[(k)]': 'ee_32.png',
113
+    '[(F)]': 'ee_33.png',
114
+    '[(W)]': 'ee_34.png',
115
+    '[(D)]': 'ee_35.png',
116
+  },
117
+};
118
+export const EMOJIOBJ = {
119
+  // 相对 emoji.js 路径
120
+  path: '/static/images/faces',
121
+  map1: {
122
+    '[):]': 'ee_1.png',
123
+    '[:D]': 'ee_2.png',
124
+    '[;)]': 'ee_3.png',
125
+    '[:-o]': 'ee_4.png',
126
+    '[:p]': 'ee_5.png',
127
+    '[(H)]': 'ee_6.png',
128
+    '[:@]': 'ee_7.png',
129
+  },
130
+  map2: {
131
+    '[:s]': 'ee_8.png',
132
+    '[:$]': 'ee_9.png',
133
+    '[:(]': 'ee_10.png',
134
+    "[:'(]": 'ee_11.png',
135
+    '[<o)]': 'ee_12.png',
136
+    '[(a)]': 'ee_13.png',
137
+    '[8o|]': 'ee_14.png',
138
+  },
139
+  map3: {
140
+    '[8-|]': 'ee_15.png',
141
+    '[+o(]': 'ee_16.png',
142
+    '[|-)]': 'ee_17.png',
143
+    '[:|]': 'ee_18.png',
144
+    '[*-)]': 'ee_19.png',
145
+    '[:-#]': 'ee_20.png',
146
+    '[del]': 'del.png',
147
+  },
148
+  map4: {
149
+    '[^o)]': 'ee_21.png',
150
+    '[:-*]': 'ee_22.png',
151
+    '[8-)]': 'ee_23.png',
152
+    '[(|)]': 'ee_24.png',
153
+    '[(u)]': 'ee_25.png',
154
+    '[(S)]': 'ee_26.png',
155
+    '[(*)]': 'ee_27.png',
156
+  },
157
+  map5: {
158
+    '[(#)]': 'ee_28.png',
159
+    '[(R)]': 'ee_29.png',
160
+    '[({)]': 'ee_30.png',
161
+    '[(})]': 'ee_31.png',
162
+    '[(k)]': 'ee_32.png',
163
+    '[(F)]': 'ee_33.png',
164
+    '[(W)]': 'ee_34.png',
165
+    '[(D)]': 'ee_35.png',
166
+  },
167
+  map6: {
168
+    '[del]': 'del.png',
169
+  },
170
+};
171
+export const GROUP_ROLE_TYPE_NAME = {
172
+  OWNER: 'owner',
173
+  ADMIN: 'admin',
174
+  MEMBER: 'member',
175
+};
176
+export const GROUP_ROLE_TYPE = {
177
+  [GROUP_ROLE_TYPE_NAME.OWNER]: 0,
178
+  [GROUP_ROLE_TYPE_NAME.ADMIN]: 1,
179
+  [GROUP_ROLE_TYPE_NAME.MEMBER]: 2,
180
+};

+ 46 - 0
EaseIM/emApis/emAboutAck.js

@@ -0,0 +1,46 @@
1
+/* read ack、channel ack、recall ack*/
2
+import { EaseSDK, EMClient } from '../index';
3
+const emSendReadAck = () => {
4
+  // 处理未读消息回执
5
+  const sendReadAckMsg = (receivemsg) => {
6
+    const { chatType, from, id } = receivemsg;
7
+    let option = {
8
+      type: 'read', // 消息是否已读。
9
+      chatType: chatType, // 会话类型,这里为单聊。
10
+      to: from, // 消息接收方的用户 ID。
11
+      id: id, // 需要发送已读回执的消息 ID。
12
+    };
13
+    let msg = EaseSDK.message.create(option);
14
+    EMClient.send(msg);
15
+  };
16
+  //发送撤回ack
17
+  const sendRecallAckMsg = (recallSourceMsg) => {
18
+    const { chatType, to, mid } = recallSourceMsg;
19
+    let option = {
20
+      // 要撤回消息的消息 ID。
21
+      mid: mid,
22
+      // 消息接收方:单聊为对方用户 ID,群聊和聊天室分别为群组 ID 和聊天室 ID。
23
+      to: to,
24
+      // 会话类型:单聊、群聊和聊天室分别为 `singleChat`、`groupChat` 和 `chatRoom`。
25
+      chatType: chatType,
26
+    };
27
+    return new Promise((resolve, reject) => {
28
+      EMClient.recallMessage(option)
29
+        .then((res) => {
30
+          console.log('recall success', res);
31
+          resolve(res);
32
+        })
33
+        .catch((error) => {
34
+          // 消息撤回失败,原因可能是超过了撤销时限(超过 2 分钟)。
35
+          console.log('fail', error);
36
+          reject(error);
37
+        });
38
+    });
39
+  };
40
+  return {
41
+    sendReadAckMsg,
42
+    sendRecallAckMsg,
43
+  };
44
+};
45
+
46
+export default emSendReadAck;

+ 38 - 0
EaseIM/emApis/emConnect.js

@@ -0,0 +1,38 @@
1
+import { EMClient } from '../index';
2
+const emConnect = () => {
3
+  const loginWithPassword = (hxUserId, hxPassword) => {
4
+    if (!hxUserId || !hxPassword) throw Error('empty params');
5
+    return new Promise((resolve, reject) => {
6
+      EMClient.open({
7
+        user: hxUserId,
8
+        pwd: hxPassword,
9
+      })
10
+        .then((res) => {
11
+          resolve(res);
12
+        })
13
+        .catch((err) => reject(err));
14
+    });
15
+  };
16
+  const loginWithAccessToken = (hxUserId, hxAccessToken) => {
17
+    if (!hxUserId || !hxAccessToken) throw Error('empty params');
18
+    return new Promise((resolve, reject) => {
19
+      EMClient.open({
20
+        user: hxUserId,
21
+        accessToken: hxAccessToken,
22
+      })
23
+        .then((res) => {
24
+          resolve(res);
25
+        })
26
+        .catch((err) => reject(err));
27
+    });
28
+  };
29
+  const closeEaseIM = () => {
30
+    EMClient.close();
31
+  };
32
+  return {
33
+    loginWithPassword,
34
+    loginWithAccessToken,
35
+    closeEaseIM,
36
+  };
37
+};
38
+export default emConnect;

+ 123 - 0
EaseIM/emApis/emContacts.js

@@ -0,0 +1,123 @@
1
+import { EMClient } from '../index';
2
+const emContacts = () => {
3
+  const fetchContactsListFromServer = () => {
4
+    return new Promise((resolve, reject) => {
5
+      EMClient.getAllContacts()
6
+        .then((res) => {
7
+          const { data } = res;
8
+          console.log('>>>>>获取全部好友列表');
9
+          resolve(data);
10
+        })
11
+        .catch((error) => {
12
+          reject(error);
13
+        });
14
+    });
15
+  };
16
+  const removeContactFromServer = (contactId) => {
17
+    if (contactId) {
18
+      return new Promise((resolve, reject) => {
19
+        EMClient.deleteContact(contactId)
20
+          .then((res) => {
21
+            resolve(res);
22
+          })
23
+          .catch((error) => {
24
+            reject(error);
25
+          });
26
+      });
27
+    }
28
+  };
29
+  const addContactFromServer = (contactId, applyMsg = '加个好友吧') => {
30
+    if (contactId) {
31
+      return new Promise((resolve, reject) => {
32
+        EMClient.addContact(contactId, applyMsg)
33
+          .then((res) => {
34
+            resolve(res);
35
+          })
36
+          .catch((error) => {
37
+            reject(error);
38
+          });
39
+      });
40
+    }
41
+  };
42
+
43
+  const acceptContactInvite = (contactId) => {
44
+    if (contactId) {
45
+      return new Promise((resolve, reject) => {
46
+        EMClient.acceptContactInvite(contactId)
47
+          .then((res) => {
48
+            resolve(res);
49
+          })
50
+          .catch((error) => {
51
+            reject(error);
52
+          });
53
+      });
54
+      //   EMClient.acceptContactInvite(contactId);
55
+    }
56
+  };
57
+  const declineContactInvite = (contactId) => {
58
+    if (contactId) {
59
+      EMClient.declineContactInvite(contactId);
60
+    }
61
+  };
62
+  const getBlocklistFromServer = () => {
63
+    return new Promise((resolve, reject) => {
64
+      EMClient.getBlocklist()
65
+        .then((res) => {
66
+          const { data } = res;
67
+          resolve(data);
68
+        })
69
+        .catch((error) => {
70
+          reject(error);
71
+        });
72
+    });
73
+  };
74
+  const addUsersToBlocklist = (userList) => {
75
+    return new Promise((resolve, reject) => {
76
+      EMClient.addUsersToBlocklist({ name: [...userList] })
77
+        .then((res) => {
78
+          const { data } = res;
79
+          resolve(data);
80
+        })
81
+        .catch((error) => {
82
+          reject(error);
83
+        });
84
+    });
85
+  };
86
+  const removeUsersFromBlocklist = (userList) => {
87
+    return new Promise((resolve, reject) => {
88
+      EMClient.removeUserFromBlocklist({ name: [...userList] })
89
+        .then((res) => {
90
+          resolve(res);
91
+        })
92
+        .catch((error) => {
93
+          reject(error);
94
+        });
95
+    });
96
+  };
97
+  const setContactRemarkFromServer = (contactId, remark) => {
98
+    return new Promise((resolve, reject) => {
99
+      EMClient.setContactRemark({
100
+        userId: contactId,
101
+        remark,
102
+      })
103
+        .then((res) => {
104
+          resolve(res);
105
+        })
106
+        .catch((error) => {
107
+          reject(error);
108
+        });
109
+    });
110
+  };
111
+  return {
112
+    fetchContactsListFromServer,
113
+    removeContactFromServer,
114
+    addContactFromServer,
115
+    acceptContactInvite,
116
+    declineContactInvite,
117
+    getBlocklistFromServer,
118
+    addUsersToBlocklist,
119
+    removeUsersFromBlocklist,
120
+    setContactRemarkFromServer,
121
+  };
122
+};
123
+export default emContacts;

+ 91 - 0
EaseIM/emApis/emConversation.js

@@ -0,0 +1,91 @@
1
+import { EaseSDK, EMClient } from '../index';
2
+import { CHAT_TYPE } from '../constant';
3
+const emConversation = () => {
4
+  //从服务端获取置顶会话列表
5
+  const fetchPinConversationFromServer = (pageSize = 50, cursor = '') => {
6
+    return new Promise((resolve, reject) => {
7
+      EMClient.getServerPinnedConversations({ pageSize, cursor })
8
+        .then((res) => {
9
+          console.log('>>>>置顶会话列表数据获取成功',res);
10
+          resolve(res);
11
+        })
12
+        .catch((error) => {
13
+          reject(error);
14
+        });
15
+    });
16
+  };
17
+  //置顶会话列表
18
+  const pinConversationItem = (params) => {
19
+    const { conversationId, conversationType, isPinned } = params;
20
+    return new Promise((resolve, reject) => {
21
+      EMClient.pinConversation({
22
+        conversationId,
23
+        conversationType,
24
+        isPinned,
25
+      })
26
+        .then((res) => {
27
+          console.log('>>>>置顶会话列表添加成功');
28
+          resolve(res);
29
+        })
30
+        .catch((error) => {
31
+          reject(error);
32
+        });
33
+    });
34
+  };
35
+  //从服务端获取会话列表
36
+  const fetchConversationFromServer = (
37
+    options = { pageSize: 20, cursor: '' }
38
+  ) => {
39
+    return new Promise((resolve, reject) => {
40
+      //支持分页这里写死只取二十条
41
+      EMClient.getServerConversations({ ...options })
42
+        .then((res) => {
43
+          console.log('>>>>会话列表数据获取成功',res);
44
+          const result = res.data.conversations;
45
+          resolve(result);
46
+        })
47
+        .catch((error) => {
48
+          reject(error);
49
+        });
50
+    });
51
+  };
52
+  //从服务端删除会话
53
+  const removeConversationFromServer = (
54
+    channel,
55
+    chatType = CHAT_TYPE.SINGLE_CHAT,
56
+    deleteRoam = false
57
+  ) => {
58
+    if (!channel) return;
59
+    return new Promise((resolve, reject) => {
60
+      EMClient.deleteConversation({ channel, chatType, deleteRoam })
61
+        .then((res) => {
62
+          console.log('>>>>会话删除成功');
63
+          resolve(res);
64
+        })
65
+        .catch((error) => {
66
+          reject(error);
67
+        });
68
+    });
69
+  };
70
+  //发送会话已读回执
71
+  const sendChannelAck = (targetId, chatType = CHAT_TYPE.SINGLE_CHAT) => {
72
+    if (!targetId) return;
73
+    let option = {
74
+      chatType: chatType, // 会话类型,设置为单聊。
75
+      type: 'channel', // 消息类型。
76
+      to: targetId, // 接收消息对象的用户 ID。
77
+    };
78
+    const msg = EaseSDK.message.create(option);
79
+    EMClient.send(msg);
80
+  };
81
+  
82
+  return {
83
+    fetchPinConversationFromServer,
84
+    pinConversationItem,
85
+    fetchConversationFromServer,
86
+    removeConversationFromServer,
87
+    sendChannelAck,
88
+  };
89
+};
90
+
91
+export default emConversation;

+ 265 - 0
EaseIM/emApis/emGroups.js

@@ -0,0 +1,265 @@
1
+import { EMClient } from '@/EaseIM';
2
+const emGroups = () => {
3
+  const fetchJoinedGroupListFromServer = (pageNum = 0, pageSize = 20) => {
4
+    return new Promise((resolve, reject) => {
5
+      console.log('>>>>开始获取加入的群组列表');
6
+      EMClient.getJoinedGroups({
7
+        pageNum,
8
+        pageSize,
9
+        needAffiliations: true,
10
+        needRole: true,
11
+      })
12
+        .then((res) => {
13
+          resolve(res);
14
+        })
15
+        .catch((error) => {
16
+          reject(error);
17
+        });
18
+    });
19
+  };
20
+  const createNewGroup = (params) => {
21
+    return new Promise((resolve, reject) => {
22
+      console.log('>>>>开始创建群组');
23
+      EMClient.createGroup({ data: { ...params } })
24
+        .then((res) => {
25
+          resolve(res.data);
26
+        })
27
+        .catch((error) => {
28
+          reject(error);
29
+        });
30
+    });
31
+  };
32
+  const getGroupInfosFromServer = (groupId) => {
33
+    return new Promise((resolve, reject) => {
34
+      EMClient.getGroupInfo({
35
+        groupId,
36
+      })
37
+        .then((res) => {
38
+          resolve(res.data);
39
+        })
40
+        .catch((error) => {
41
+          reject(error);
42
+        });
43
+    });
44
+  };
45
+  const getGroupMembersFromServer = (groupId) => {
46
+    //暂且仅取前100个群成员
47
+    const pageNum = 1,
48
+      pageSize = 100;
49
+    return new Promise((resolve, reject) => {
50
+      EMClient.listGroupMembers({
51
+        pageNum: pageNum,
52
+        pageSize: pageSize,
53
+        groupId,
54
+      })
55
+        .then((res) => {
56
+          resolve(res.data);
57
+        })
58
+        .catch((error) => {
59
+          reject(error);
60
+        });
61
+    });
62
+  };
63
+  const inviteUsersToGroup = (groupId, memberIdList) => {
64
+    return new Promise((resolve, reject) => {
65
+      EMClient.inviteUsersToGroup({
66
+        groupId: groupId,
67
+        users: memberIdList,
68
+      })
69
+        .then((res) => {
70
+          resolve(res.data);
71
+        })
72
+        .catch((error) => {
73
+          reject(error);
74
+        });
75
+    });
76
+  };
77
+  const leaveGroupFromServer = (groupId) => {
78
+    return new Promise((resolve, reject) => {
79
+      EMClient.leaveGroup({ groupId })
80
+        .then((res) => {
81
+          resolve(res.data);
82
+        })
83
+        .catch((error) => {
84
+          reject(error);
85
+        });
86
+    });
87
+  };
88
+  const destroyGroupFromServer = (groupId) => {
89
+    return new Promise((resolve, reject) => {
90
+      EMClient.destroyGroup({ groupId })
91
+        .then((res) => {
92
+          resolve(res.data);
93
+        })
94
+        .catch((error) => {
95
+          reject(error);
96
+        });
97
+    });
98
+  };
99
+  const acceptGroupInvite = (invitee, groupId) => {
100
+    return new Promise((resolve, reject) => {
101
+      EMClient.acceptGroupInvite({
102
+        groupId: groupId,
103
+        invitee: invitee,
104
+      })
105
+        .then((res) => {
106
+          resolve(res.data);
107
+        })
108
+        .catch((error) => {
109
+          reject(error);
110
+        });
111
+    });
112
+  };
113
+  const rejectGroupInvite = (invitee, groupId) => {
114
+    return new Promise((resolve, reject) => {
115
+      EMClient.rejectGroupInvite({
116
+        groupId: groupId,
117
+        invitee: invitee,
118
+      })
119
+        .then((res) => {
120
+          resolve(res.data);
121
+        })
122
+        .catch((error) => {
123
+          reject(error);
124
+        });
125
+    });
126
+  };
127
+  const joinPublicGroup = (groupId) => {
128
+    return new Promise((resolve, reject) => {
129
+      EMClient.joinGroup({ groupId, message: 'I want to join the group' })
130
+        .then((res) => {
131
+          resolve(res.data);
132
+        })
133
+        .catch((error) => {
134
+          reject(error);
135
+        });
136
+    });
137
+  };
138
+  const modifyGroupInfo = (groupId, params) => {
139
+    return new Promise((resolve, reject) => {
140
+      EMClient.modifyGroup({
141
+        groupId,
142
+        ...params,
143
+      })
144
+        .then((res) => {
145
+          resolve(res);
146
+        })
147
+        .catch((error) => {
148
+          reject(error);
149
+        });
150
+    });
151
+  };
152
+  const removeGroupMembers = (groupId, users) => {
153
+    return new Promise((resolve, reject) => {
154
+      EMClient.removeGroupMembers({
155
+        groupId,
156
+        users,
157
+      })
158
+        .then((res) => {
159
+          resolve(res.data);
160
+        })
161
+        .catch((error) => {
162
+          reject(error);
163
+        });
164
+    });
165
+  };
166
+  const changeGroupOwner = (groupId, newOwner) => {
167
+    return new Promise((resolve, reject) => {
168
+      EMClient.changeGroupOwner({ groupId, newOwner })
169
+        .then((res) => {
170
+          resolve(res);
171
+        })
172
+        .catch((error) => {
173
+          reject(error);
174
+        });
175
+    });
176
+  };
177
+  //分页获取群组列表
178
+  const listGroupMembersFromServer = (params) => {
179
+    const { pageNum = 1, pageSize = 100, groupId } = params;
180
+    return new Promise((resolve, reject) => {
181
+      EMClient.listGroupMembers({
182
+        ...params,
183
+      })
184
+        .then((res) => {
185
+          resolve(res.data);
186
+        })
187
+        .catch((error) => {
188
+          reject(error);
189
+        });
190
+    });
191
+  };
192
+  /* 群组属性相关 */
193
+  //获取单个用户属性
194
+  const getSingleGroupAttributesFromServer = (groupId, userId) => {
195
+    let options = {
196
+      groupId,
197
+      userId,
198
+    };
199
+    return new Promise((resolve, reject) => {
200
+      EMClient.getGroupMemberAttributes({ ...options })
201
+        .then((res) => {
202
+          resolve(res);
203
+        })
204
+        .catch((error) => {
205
+          reject(error);
206
+        });
207
+    });
208
+  };
209
+  //设置单个群组属性
210
+  const setSingleGroupAttributesFromServer = (params) => {
211
+    const { groupId, userId, memberAttributes } = params;
212
+    return new Promise((resolve, reject) => {
213
+      EMClient.setGroupMemberAttributes({
214
+        groupId,
215
+        userId,
216
+        memberAttributes: { ...memberAttributes },
217
+      })
218
+        .then((res) => {
219
+          resolve(res);
220
+        })
221
+        .catch((error) => {
222
+          reject(error);
223
+        });
224
+    });
225
+  };
226
+  //根据key获取多个群组成员自定义属性
227
+  const getMultiGroupAttributesFromServer = (params) => {
228
+    const { groupId, userIds, keys } = params;
229
+    return new Promise((resolve, reject) => {
230
+      EMClient.getGroupMembersAttributes({
231
+        groupId,
232
+        userIds,
233
+        keys,
234
+      })
235
+        .then((res) => {
236
+          resolve(res.data);
237
+        })
238
+        .catch((error) => {
239
+          reject(error);
240
+        });
241
+    });
242
+  };
243
+
244
+  return {
245
+    fetchJoinedGroupListFromServer,
246
+    createNewGroup,
247
+    getGroupInfosFromServer,
248
+    getGroupMembersFromServer,
249
+    inviteUsersToGroup,
250
+    leaveGroupFromServer,
251
+    destroyGroupFromServer,
252
+    acceptGroupInvite,
253
+    rejectGroupInvite,
254
+    joinPublicGroup,
255
+    modifyGroupInfo,
256
+    changeGroupOwner,
257
+    removeGroupMembers,
258
+    listGroupMembersFromServer,
259
+    getSingleGroupAttributesFromServer,
260
+    getMultiGroupAttributesFromServer,
261
+    setSingleGroupAttributesFromServer,
262
+  };
263
+};
264
+
265
+export default emGroups;

+ 134 - 0
EaseIM/emApis/emMessages.js

@@ -0,0 +1,134 @@
1
+import { EaseSDK, EMClient } from '../index';
2
+import { MESSAGE_TYPE } from '../constant';
3
+import { getEMKey } from '@/EaseIM/utils';
4
+import store from '@/store';
5
+const emMessages = () => {
6
+  const reportMessages = (params) => {
7
+    const { reportType, reportReason, messageId } = params;
8
+    return new Promise((resolve, reject) => {
9
+      EMClient.reportMessage({
10
+        reportType: reportType, // 举报类型
11
+        reportReason: reportReason, // 举报原因。
12
+        messageId: messageId, // 上报消息id
13
+      })
14
+        .then((res) => {
15
+          resolve(res);
16
+        })
17
+        .catch((error) => {
18
+          reject(error);
19
+        });
20
+    });
21
+  };
22
+  const fetchHistoryMessagesFromServer = (params) => {
23
+    const { targetId, cursor, chatType } = params;
24
+    return new Promise((resolve, reject) => {
25
+      let options = {
26
+        // 对方的用户 ID 或者群组 ID 或聊天室 ID。
27
+        targetId: targetId,
28
+        // 每页期望获取的消息条数。取值范围为 [1,50],默认值为 20。
29
+        pageSize: 20,
30
+        // 查询的起始消息 ID。若该参数设置为 `-1`、`null` 或空字符串,从最新消息开始。
31
+        cursor: cursor || -1,
32
+        // 会话类型:(默认) `singleChat`:单聊;`groupChat`:群聊。
33
+        chatType: chatType,
34
+        // 消息搜索方向:(默认)`up`:按服务器收到消息的时间的逆序获取;`down`:按服务器收到消息的时间的正序获取。
35
+        searchDirection: 'up',
36
+      };
37
+      EMClient.getHistoryMessages(options)
38
+        .then((res) => {
39
+          resolve(res);
40
+        })
41
+        .catch((e) => {
42
+          // 获取失败。
43
+          reject(e);
44
+        });
45
+    });
46
+  };
47
+  const sendDisplayMessages = (messageBody) => {
48
+    messageBody.from = EMClient.user;
49
+    const key = getEMKey(
50
+      EMClient.user,
51
+      messageBody.from,
52
+      messageBody.to,
53
+      messageBody.chatType
54
+    );
55
+    console.log('>>>>要发送的消息key', key);
56
+    return new Promise((resolve, reject) => {
57
+      const message = EaseSDK.message.create(messageBody);
58
+      console.log('>>>>构建的消息msg', message);
59
+      EMClient.send(message)
60
+        .then((res) => {
61
+          const { message: resMessage } = res;
62
+          //   message.id = res.serverMsgId;
63
+          console.log('>>>>>res更新后的消息体', res);
64
+          store.commit('UPDATE_MESSAGE_COLLECTION', {
65
+            key,
66
+            message: resMessage,
67
+          });
68
+          resolve(res);
69
+          //   store.commit('UPDATE_CONVERSATION_ITEM', {
70
+          //     conversationId: messageBody.to,
71
+          //     lastMessage: message,
72
+          //   });
73
+        })
74
+        .catch((err) => {
75
+          reject(err);
76
+          console.log('>>>>>发送失败', err);
77
+        });
78
+    });
79
+  };
80
+  const sendCommandMessages = (messageBody) => {
81
+    return new Promise((resolve, reject) => {
82
+      console.log('messageBody', messageBody);
83
+      const message = EaseSDK.message.create(messageBody);
84
+      console.log('>>>>构建的命令消息msg', message);
85
+      EMClient.send(message)
86
+        .then((res) => {
87
+          resolve(res);
88
+        })
89
+        .catch((e) => {
90
+          reject(e);
91
+        });
92
+    });
93
+  };
94
+  //修改展示类消息【暂只支持文本消息】
95
+  const modifyDisplayMessages = (messageBody) => {
96
+    const { msg, to, id, chatType } = messageBody;
97
+    const textMessage = EaseSDK.message.create({
98
+      type: MESSAGE_TYPE.TEXT,
99
+      msg: msg,
100
+      to: to,
101
+      chatType: chatType,
102
+    });
103
+    const key = getEMKey(
104
+      EMClient.user,
105
+      messageBody.from || EMClient.user,
106
+      messageBody.to,
107
+      messageBody.chatType
108
+    );
109
+    return new Promise((resolve, reject) => {
110
+      EMClient.modifyMessage({ messageId: id, modifiedMessage: textMessage })
111
+        .then((res) => {
112
+          console.log(res.message);
113
+          store.commit('MODIFY_MESSAGE_FROM_COLLECTION', {
114
+            key: key,
115
+            mid: res.message.id,
116
+            message: { ...res.message },
117
+          });
118
+          resolve(res);
119
+        })
120
+        .catch((e) => {
121
+          console.log(e);
122
+          reject(e);
123
+        });
124
+    });
125
+  };
126
+  return {
127
+    reportMessages,
128
+    fetchHistoryMessagesFromServer,
129
+    sendDisplayMessages,
130
+    sendCommandMessages,
131
+    modifyDisplayMessages,
132
+  };
133
+};
134
+export default emMessages;

+ 136 - 0
EaseIM/emApis/emPresence.js

@@ -0,0 +1,136 @@
1
+import {
2
+	EaseSDK,
3
+	EMClient
4
+} from '../index';
5
+const _chunkArr = (oldArr, num) => {
6
+	oldArr.sort((a, b) => {
7
+		return a - b;
8
+	});
9
+	if (oldArr.length <= 0) return oldArr;
10
+	let newArr = [];
11
+	if (Math.ceil(oldArr.length / num) <= 1) {
12
+		newArr.push(oldArr);
13
+		return newArr;
14
+	}
15
+	for (let i = 0; i < oldArr.length; i = i + num) {
16
+		newArr.push(oldArr.slice(i, i + num));
17
+	}
18
+	return newArr;
19
+};
20
+const emPresence = () => {
21
+	// 发布自定义在线状态
22
+	const publishPresence = (presenceMsg) => {
23
+		return new Promise((resolve, reject) => {
24
+			EMClient.publishPresence({
25
+					description: presenceMsg,
26
+
27
+				})
28
+				.then((res) => {
29
+					resolve(res)
30
+				})
31
+				.catch((error) => {
32
+					reject(error);
33
+				});
34
+		});
35
+	};
36
+	// 订阅用户的在线状态
37
+	const subscribePresence = (userList) => {
38
+		let friendList = [];
39
+		friendList = Object.assign([], userList);
40
+		return new Promise((resolve, reject) => {
41
+			if (friendList.length && friendList.length < 99) {
42
+				EMClient.subscribePresence({
43
+						usernames: friendList,
44
+						expiry: 7 * 24 * 3600
45
+					})
46
+					.then((res) => {
47
+						const {
48
+							data
49
+						} = res;
50
+						resolve(data.result);
51
+					})
52
+					.catch((error) => {
53
+						reject(error);
54
+					});
55
+			} else {
56
+				let newArr = _chunkArr(friendList, 99);
57
+				for (let i = 0; i < newArr.length; i++) {
58
+					EMClient.subscribePresence({
59
+						usernames: newArr[i],
60
+						expiry: 7 * 24 * 3600
61
+					} )
62
+						.then((res) => {
63
+							const {
64
+								data
65
+							} = res;
66
+							resolve(data.result);
67
+						})
68
+						.catch((error) => {
69
+							reject(error);
70
+						});
71
+				}
72
+			}
73
+		});
74
+	};
75
+	// 获取用户的当前在线状态
76
+	const getPresenceStatus = (userList) => {
77
+		let friendList = [];
78
+		friendList = Object.assign([], userList);
79
+		return new Promise((resolve, reject) => {
80
+			if (friendList.length && friendList.length < 99) {
81
+				EMClient.getPresenceStatus({
82
+						usernames: friendList
83
+					})
84
+					.then((res) => {
85
+						const {
86
+							data
87
+						} = res;
88
+						resolve(data.result);
89
+					})
90
+					.catch((error) => {
91
+						reject(error);
92
+					});
93
+			} else {
94
+				let newArr = _chunkArr(friendList, 99);
95
+				for (let i = 0; i < newArr.length; i++) {
96
+					EMClient.getPresenceStatus({
97
+							usernames: newArr[i]
98
+						})
99
+						.then((res) => {
100
+							const {
101
+								data
102
+							} = res;
103
+							resolve(data.result);
104
+						})
105
+						.catch((error) => {
106
+							reject(error);
107
+						});
108
+				}
109
+			}
110
+		});
111
+	};
112
+	// 取消订阅
113
+	const unsubscribePresence = (userName) => {
114
+		return new Promise((resolve, reject) => {
115
+			EMClient.unsubscribePresence({
116
+					usernames: [userName]
117
+	
118
+				})
119
+				.then((res) => {
120
+					console.log("取消订阅成功")
121
+					resolve(res)
122
+				})
123
+				.catch((error) => {
124
+					reject(error);
125
+				});
126
+		});
127
+	};
128
+	return {
129
+		publishPresence,
130
+		subscribePresence,
131
+		getPresenceStatus,
132
+		unsubscribePresence
133
+	};
134
+};
135
+
136
+export default emPresence;

+ 72 - 0
EaseIM/emApis/emSilent.js

@@ -0,0 +1,72 @@
1
+import { EMClient } from '../index';
2
+const emSilent = () => {
3
+  const getSilentModeForConversation = (conversationId, type) => {
4
+    return new Promise((resolve, reject) => {
5
+      EMClient.getSilentModeForConversation({
6
+        conversationId,
7
+        type,
8
+      })
9
+        .then((res) => {
10
+          resolve(res);
11
+        })
12
+        .catch((err) => reject(err));
13
+    });
14
+  };
15
+  const getSilentModeForConversationList = (conversationList) => {
16
+    return new Promise((resolve, reject) => {
17
+      EMClient.getSilentModeForConversations({ conversationList })
18
+        .then((res) => {
19
+          resolve(res);
20
+        })
21
+        .catch((err) => reject(err));
22
+    });
23
+  };
24
+  const getSilentModeForAll = () => {
25
+    return new Promise((resolve, reject) => {
26
+      EMClient.getSilentModeForAll()
27
+        .then((res) => {
28
+          resolve(res);
29
+        })
30
+        .catch((err) => reject(err));
31
+    });
32
+  };
33
+  const setSilentModeForAll = ({ paramType = 0, remindType = 'ALL' }) => {
34
+    return new Promise((resolve, reject) => {
35
+      EMClient.setSilentModeForAll({ options: { paramType, remindType } })
36
+        .then((res) => {
37
+          resolve(res);
38
+        })
39
+        .catch((err) => reject(err));
40
+    });
41
+  };
42
+  const setSilentModeForConversation = (params) => {
43
+    const { conversationId, type, options } = params;
44
+    return new Promise((resolve, reject) => {
45
+      EMClient.setSilentModeForConversation({ conversationId, type, options })
46
+        .then((res) => {
47
+          resolve(res);
48
+        })
49
+        .catch((err) => reject(err));
50
+    });
51
+  };
52
+  const clearRemindTypeForConversation = (params) => {
53
+    const { conversationId, type } = params;
54
+    return new Promise((resolve, reject) => {
55
+      EMClient.clearRemindTypeForConversation({ conversationId, type })
56
+        .then((res) => {
57
+          resolve(res);
58
+        })
59
+        .catch((err) => reject(err));
60
+    });
61
+  };
62
+  return {
63
+    getSilentModeForAll,
64
+    setSilentModeForAll,
65
+    getSilentModeForConversation,
66
+    getSilentModeForConversationList,
67
+    setSilentModeForConversation,
68
+    clearRemindTypeForConversation,
69
+  };
70
+};
71
+
72
+export default emSilent;

+ 80 - 0
EaseIM/emApis/emUserInfos.js

@@ -0,0 +1,80 @@
1
+import { EMClient } from '../index';
2
+const _chunkArr = (oldArr, num) => {
3
+  oldArr.sort((a, b) => {
4
+    return a - b;
5
+  });
6
+  if (oldArr.length <= 0) return oldArr;
7
+  let newArr = [];
8
+  if (Math.ceil(oldArr.length / num) <= 1) {
9
+    newArr.push(oldArr);
10
+    return newArr;
11
+  }
12
+  for (let i = 0; i < oldArr.length; i = i + num) {
13
+    newArr.push(oldArr.slice(i, i + num));
14
+  }
15
+  return newArr;
16
+};
17
+
18
+const emUserInofs = () => {
19
+  const fetchUserInfoWithLoginId = () => {
20
+    const userId = EMClient.user;
21
+    return new Promise((resolve, reject) => {
22
+      if (userId) {
23
+        EMClient.fetchUserInfoById(userId)
24
+          .then((res) => {
25
+            const { data } = res;
26
+            resolve(data);
27
+          })
28
+          .catch((error) => {
29
+            reject(error);
30
+          });
31
+      }
32
+    });
33
+  };
34
+  const fetchOtherInfoFromServer = (userList) => {
35
+    let friendList = [];
36
+    friendList = Object.assign([], userList);
37
+    return new Promise((resolve, reject) => {
38
+      if (friendList.length && friendList.length < 99) {
39
+        EMClient.fetchUserInfoById(friendList)
40
+          .then((res) => {
41
+            const { data } = res;
42
+            resolve(data);
43
+          })
44
+          .catch((error) => {
45
+            reject(error);
46
+          });
47
+      } else {
48
+        let newArr = _chunkArr(friendList, 99);
49
+        for (let i = 0; i < newArr.length; i++) {
50
+          EMClient.fetchUserInfoById(newArr[i])
51
+            .then((res) => {
52
+              const { data } = res;
53
+              resolve(data);
54
+            })
55
+            .catch((error) => {
56
+              reject(error);
57
+            });
58
+        }
59
+      }
60
+    });
61
+  };
62
+  const updateUserInfosFromServer = (params) => {
63
+    return new Promise((resolve, reject) => {
64
+      EMClient.updateUserInfo({ ...params })
65
+        .then((res) => {
66
+          const { data } = res;
67
+          resolve(data);
68
+        })
69
+        .catch((error) => {
70
+          reject(error);
71
+        });
72
+    });
73
+  };
74
+  return {
75
+    fetchUserInfoWithLoginId,
76
+    fetchOtherInfoFromServer,
77
+    updateUserInfosFromServer,
78
+  };
79
+};
80
+export default emUserInofs;

+ 20 - 0
EaseIM/emApis/index.js

@@ -0,0 +1,20 @@
1
+import emConnect from './emConnect';
2
+import emUserInfos from './emUserInfos';
3
+import emContacts from './emContacts';
4
+import emGroups from './emGroups';
5
+import emAboutAck from './emAboutAck';
6
+import emConversation from './emConversation';
7
+import emMessages from './emMessages';
8
+import emSilent from './emSilent';
9
+import emPresence from './emPresence';
10
+export {
11
+  emConnect,
12
+  emUserInfos,
13
+  emContacts,
14
+  emGroups,
15
+  emAboutAck,
16
+  emConversation,
17
+  emMessages,
18
+  emSilent,
19
+  emPresence
20
+};

+ 25 - 0
EaseIM/emListener/emConnectListener.js

@@ -0,0 +1,25 @@
1
+import { EMClient } from '../index';
2
+import { CONNECT_CALLBACK_TYPE, HANDLER_EVENT_NAME } from '../constant';
3
+export const emConnectListener = (callback, listenerEventName) => {
4
+  console.log('>>>>连接监听已挂载');
5
+  const connectListenFunc = {
6
+    onConnected: () => {
7
+      console.log('connected...');
8
+      callback && callback(CONNECT_CALLBACK_TYPE.CONNECT_CALLBACK);
9
+    },
10
+    onDisconnected: () => {
11
+      callback && callback(CONNECT_CALLBACK_TYPE.DISCONNECT_CALLBACK);
12
+      console.log('disconnected...');
13
+    },
14
+    onReconnecting: () => {
15
+      callback && callback(CONNECT_CALLBACK_TYPE.RECONNECTING_CALLBACK);
16
+    },
17
+  };
18
+  EMClient.removeEventHandler(
19
+    listenerEventName || HANDLER_EVENT_NAME.CONNECT_EVENT
20
+  );
21
+  EMClient.addEventHandler(
22
+    listenerEventName || HANDLER_EVENT_NAME.CONNECT_EVENT,
23
+    connectListenFunc
24
+  );
25
+};

+ 139 - 0
EaseIM/emListener/emContactsListener.js

@@ -0,0 +1,139 @@
1
+import { EMClient } from "../index";
2
+import { getEMKey } from "@/EaseIM/utils";
3
+import emContacts from "../emApis/emContacts";
4
+import {
5
+  HANDLER_EVENT_NAME,
6
+  CHAT_TYPE,
7
+  INFORM_TYPE,
8
+  MESSAGE_TYPE,
9
+  GRAY_INFORM_TYPE_SINGLE,
10
+} from "../constant";
11
+import store from "@/store";
12
+
13
+export const emContactsListener = (callback, listenerEventName) => {
14
+  console.log(">>>>>好友关系监听挂载");
15
+  //自动通过用户好友申请
16
+  const { acceptContactInvite } = emContacts();
17
+  const handleAutoAcceptInvitation = async (contactsInform) => {
18
+    const { from } = contactsInform;
19
+    const res = uni.getStorageSync(`EM_${EMClient.user}_GENNERAL_CONFIG`);
20
+    const { isAutoAcceptFriendRequest } = res || {};
21
+    //未开启则新增好友邀请消息
22
+    if (!isAutoAcceptFriendRequest) {
23
+      reveiveFriendInvite({
24
+        chatType: CHAT_TYPE.SINGLE_CHAT,
25
+        ...contactsInform,
26
+      });
27
+      return;
28
+    }
29
+    try {
30
+      await acceptContactInvite(from);
31
+      uni.showToast({
32
+        title: "自动通过好友申请",
33
+        icon: "none",
34
+        duration: 2000,
35
+      });
36
+    } catch (error) {
37
+      uni.showToast({
38
+        title: "自动通过好友申请失败",
39
+        icon: "none",
40
+        duration: 2000,
41
+      });
42
+    }
43
+  };
44
+  //变更当前好友列表数据
45
+  const changeFriendList = (type, params) => {
46
+    if (type === "INCREMENT") {
47
+      const param = {
48
+        remark: null,
49
+        userId: params.from,
50
+      };
51
+      store.commit("SET_FROEND_LIST", param);
52
+      store.dispatch("fetchFriendUserInfo", params.from);
53
+      store.dispatch("subscribePresenceStatus", params.from);
54
+    }
55
+    if (type === "DECREMENT") {
56
+      const friendId = params.from;
57
+      store.commit("DELETE_FRIEND_ITEM", friendId);
58
+      store.dispatch("unsubscribePresenceStatus", friendId);
59
+      store.commit("DELETE_PRESENCE_ITEM", friendId);
60
+    }
61
+  };
62
+  const addNewInformFunc = (params) => {
63
+    store.commit("ADD_NEW_INFORM", {
64
+      informType: INFORM_TYPE.CONTACTS,
65
+      inform: params,
66
+    });
67
+  };
68
+  //处理新邀请更新至邀请信息缓存store
69
+  const reveiveFriendInvite = (params) => {
70
+    store.commit("ADD_NEW_RECEIVE_INVITE_MSG", params);
71
+  };
72
+  //构造inform消息体
73
+  const addGrayInformMessage = (params) => {
74
+    const message = {
75
+      from: params.from,
76
+      to: params.to,
77
+      chatType: CHAT_TYPE.SINGLE_CHAT,
78
+      type: MESSAGE_TYPE.GRAY_INFORM,
79
+      time: Date.now(),
80
+      grayInformType: params.grayInformType,
81
+    };
82
+
83
+    const key = getEMKey(
84
+      EMClient.user,
85
+      message.from,
86
+      message.to,
87
+      message.chatType
88
+    );
89
+    store.commit("ADD_NEW_GRAY_INFORM_MESSAGE", { key, message });
90
+  };
91
+  const contactsListenFunc = {
92
+    // 当前用户收到好友请求。用户 B 向用户 A 发送好友请求,用户 A 收到该事件。
93
+    onContactInvited: function (msg) {
94
+      const contactsInform = Object.assign({}, msg);
95
+      callback && callback(contactsInform);
96
+      //   addNewInformFunc({ ...msg });
97
+      //如果本地配置开启了自动通过好友申请,则自动调用同意好友申请
98
+      handleAutoAcceptInvitation(contactsInform);
99
+    },
100
+    // 当前用户被其他用户从联系人列表上移除。用户 B 将用户 A 从联系人列表上删除,用户 A 收到该事件。
101
+    onContactDeleted: function (msg) {
102
+      callback && callback(msg);
103
+      addNewInformFunc(msg);
104
+      changeFriendList("DECREMENT", msg);
105
+    },
106
+    // 当前用户新增了联系人。用户 B 向用户 A 发送好友请求,用户 A 同意该请求,用户 A 收到该事件,而用户 B 收到 `onContactAgreed` 事件。
107
+    onContactAdded: function (msg) {
108
+      callback && callback(msg);
109
+      addNewInformFunc(msg);
110
+      const msgBody = Object.assign({}, msg);
111
+      msgBody.grayInformType = GRAY_INFORM_TYPE_SINGLE.CONTACT_ADDED;
112
+      //增加聊天页内灰色通知消息
113
+      addGrayInformMessage(msgBody);
114
+      //更新好友列表
115
+      changeFriendList("INCREMENT", msgBody);
116
+    },
117
+    // 当前用户发送的好友请求被拒绝。用户 A 向用户 B 发送好友请求,用户 B 收到好友请求后,拒绝加好友,则用户 A 收到该事件。
118
+    onContactRefuse: function (msg) {
119
+      callback && callback(msg);
120
+      addNewInformFunc(msg);
121
+    },
122
+    // 当前用户发送的好友请求经过了对方同意。用户 A 向用户 B 发送好友请求,用户 B 收到好友请求后,同意加好友,则用户 A 收到该事件。
123
+    onContactAgreed: function (msg) {
124
+      callback && callback(msg);
125
+      addNewInformFunc(msg);
126
+      const msgBody = Object.assign({}, msg);
127
+      msgBody.grayInformType = GRAY_INFORM_TYPE_SINGLE.CONTACT_AGREED;
128
+      addGrayInformMessage(msgBody);
129
+      changeFriendList("INCREMENT", msgBody);
130
+    },
131
+  };
132
+  EMClient.removeEventHandler(
133
+    listenerEventName || HANDLER_EVENT_NAME.CONTACTS_EVENT
134
+  );
135
+  EMClient.addEventHandler(
136
+    listenerEventName || HANDLER_EVENT_NAME.CONTACTS_EVENT,
137
+    contactsListenFunc
138
+  );
139
+};

+ 18 - 0
EaseIM/emListener/emErrorListener.js

@@ -0,0 +1,18 @@
1
+import { EMClient } from '../index';
2
+import { HANDLER_EVENT_NAME } from '../constant';
3
+export const emErrorListener = (callback, listenerEventName) => {
4
+  console.log('>>>>error监听已挂载');
5
+  const errorListenFunc = {
6
+    onError: (e) => {
7
+      console.log('>>>>>onError', e);
8
+      callback && callback(HANDLER_EVENT_NAME.ERROR_EVENT, e);
9
+    },
10
+  };
11
+  EMClient.removeEventHandler(
12
+    listenerEventName || HANDLER_EVENT_NAME.ERROR_EVENT
13
+  );
14
+  EMClient.addEventHandler(
15
+    listenerEventName || HANDLER_EVENT_NAME.ERROR_EVENT,
16
+    errorListenFunc
17
+  );
18
+};

+ 221 - 0
EaseIM/emListener/emGroupListener.js

@@ -0,0 +1,221 @@
1
+import { EMClient } from '../index';
2
+import { getEMKey } from '@/EaseIM/utils';
3
+import emGroups from '../emApis/emGroups';
4
+import {
5
+  HANDLER_EVENT_NAME,
6
+  CHAT_TYPE,
7
+  MESSAGE_TYPE,
8
+  GRAY_INFORM_TYPE_GROUP,
9
+} from '../constant';
10
+import store from '@/store';
11
+export const emGroupListener = (callback, listenerEventName) => {
12
+  console.log('>>>>群组事件监听挂载');
13
+  //处理新邀请更新至邀请信息缓存store
14
+  const reveiveFriendInvite = (params) => {
15
+    store.commit('ADD_NEW_RECEIVE_INVITE_MSG', params);
16
+  };
17
+  //构造inform消息体
18
+  const addGrayInformMessage = (params) => {
19
+    const message = {
20
+      from: params.from,
21
+      to: params.id,
22
+      chatType: CHAT_TYPE.GROUP_CHAT,
23
+      type: MESSAGE_TYPE.GRAY_INFORM,
24
+      time: Date.now(),
25
+      grayInformType: params.grayInformType,
26
+    };
27
+    const key = getEMKey(
28
+      EMClient.user,
29
+      message.from,
30
+      message.to,
31
+      message.chatType
32
+    );
33
+    store.commit('ADD_NEW_GRAY_INFORM_MESSAGE', { key, message });
34
+  };
35
+  //初始化更新当前群组列表
36
+  const initJoinedGroupList = async () => {
37
+    try {
38
+      await store.dispatch('fetchJoinedGroupList', {
39
+        isInit: true,
40
+      });
41
+    } catch (error) {
42
+      uni.showToast({
43
+        icon: 'none',
44
+        title: '初始化群组列表失败',
45
+        duration: 2000,
46
+      });
47
+    }
48
+  };
49
+  //自动通过群组邀请
50
+  const { acceptGroupInvite } = emGroups();
51
+  const handleAutoAcceptInvitation = async (event) => {
52
+    console.log('>>>>>自动处理群组邀请', event);
53
+    const { id: groupId } = event;
54
+    const res = uni.getStorageSync(`EM_${EMClient.user}_GENNERAL_CONFIG`);
55
+    const { isAutoAcceptGroupRequest } = res || {};
56
+    if (!isAutoAcceptGroupRequest) {
57
+      //未开启则新增一条邀请信息
58
+      reveiveFriendInvite({ chatType: CHAT_TYPE.GROUP_CHAT, ...event });
59
+      return;
60
+    }
61
+    try {
62
+      await acceptGroupInvite(EMClient.user, groupId);
63
+      initJoinedGroupList();
64
+      uni.showToast({
65
+        icon: 'none',
66
+        title: '自动加入群组成功',
67
+        duration: 2000,
68
+      });
69
+    } catch (error) {
70
+      uni.showToast({
71
+        icon: 'none',
72
+        title: '自动加入群组失败',
73
+        duration: 2000,
74
+      });
75
+    }
76
+  };
77
+
78
+  const groupListenFunc = {
79
+    onGroupEvent: (event) => {
80
+      console.log('>>>>群组事件监听触发', event);
81
+      const { operation, from, id: groupId } = event;
82
+      const msgBody = Object.assign({}, event);
83
+      callback(HANDLER_EVENT_NAME.GROUP_EVENT, event);
84
+      switch (operation) {
85
+        // 有新群组创建。群主的其他设备会收到该回调。
86
+        case 'create':
87
+          break;
88
+        // 关闭群组一键禁言。群组所有成员(除操作者外)会收到该回调。
89
+        case 'unmuteAllMembers':
90
+          break;
91
+        // 开启群组一键禁言。群组所有成员(除操作者外)会收到该回调。
92
+        case 'muteAllMembers':
93
+          break;
94
+        // 有成员从群白名单中移出。被移出的成员及群主和群管理员(除操作者外)会收到该回调。
95
+        case 'removeAllowlistMember':
96
+          break;
97
+        // 有成员添加至群白名单。被添加的成员及群主和群管理员(除操作者外)会收到该回调。
98
+        case 'addUserToAllowlist':
99
+          break;
100
+        // 删除群共享文件。群组所有成员会收到该回调。
101
+        case 'deleteFile':
102
+          break;
103
+        // 上传群共享文件。群组所有成员会收到该回调。
104
+        case 'uploadFile':
105
+          break;
106
+        // 删除群公告。群组所有成员会收到该回调。
107
+        case 'deleteAnnouncement':
108
+          break;
109
+        // 更新群公告。群组所有成员会收到该回调。
110
+        case 'updateAnnouncement':
111
+          break;
112
+        // 更新群组信息,如群组名称和群组描述。群组所有成员会收到该回调。
113
+        case 'updateInfo':
114
+          break;
115
+        // 有成员被移出禁言列表。被解除禁言的成员及群主和群管理员(除操作者外)会收到该回调。
116
+        case 'unmuteMember':
117
+          break;
118
+        // 有群组成员被加入禁言列表。被禁言的成员及群主和群管理员(除操作者外)会收到该回调。
119
+        case 'muteMember':
120
+          break;
121
+        // 有管理员被移出管理员列表。群主、被移除的管理员和其他管理员会收到该回调。
122
+        case 'removeAdmin':
123
+          break;
124
+        // 设置管理员。群主、新管理员和其他管理员会收到该回调。
125
+        case 'setAdmin':
126
+          break;
127
+        // 转让群组。原群主和新群主会收到该回调。
128
+        case 'changeOwner':
129
+          //TODO 待处理store中的owner变更
130
+          msgBody.grayInformType = GRAY_INFORM_TYPE_GROUP.CHANGE_OWNER;
131
+          addGrayInformMessage(msgBody);
132
+          break;
133
+        // 群组所有者和管理员拉用户进群时,无需用户确认时会触发该回调。被拉进群的用户会收到该回调。
134
+        case 'directJoined':
135
+          //强制被拉入群,更新加入的群组列表
136
+          console.log('>>>>被拉入群组当中。');
137
+          setTimeout(() => {
138
+            initJoinedGroupList();
139
+          }, 1000);
140
+
141
+          break;
142
+        // 群成员主动退出群组。除了退群的成员,其他群成员会收到该回调。
143
+        case 'memberAbsence':
144
+          store.commit('DELETE_GROUP_MEMBERS_PROFILE', {
145
+            groupId,
146
+            memberList: [from],
147
+          });
148
+          store.commit('CHANGE_AFFILIATIONS_COUNT', {
149
+            groupId,
150
+            count: -1,
151
+          });
152
+          msgBody.grayInformType = GRAY_INFORM_TYPE_GROUP.MEMBER_ABSENCE;
153
+          addGrayInformMessage(msgBody);
154
+          break;
155
+        // 有用户加入群组。除了新成员,其他群成员会收到该回调。
156
+        case 'memberPresence':
157
+          console.log('>>>>memberPresence', groupId);
158
+          store.dispatch('fetchGroupMembersProfile', {
159
+            groupId,
160
+            memberList: [from],
161
+          });
162
+          store.commit('CHANGE_AFFILIATIONS_COUNT', {
163
+            groupId,
164
+            count: 1,
165
+          });
166
+          msgBody.grayInformType = GRAY_INFORM_TYPE_GROUP.MEMBER_PRESENCE;
167
+          addGrayInformMessage(msgBody);
168
+          break;
169
+        // 用户被移出群组。被踢出群组的成员会收到该回调。
170
+        case 'removeMember':
171
+          {
172
+            initJoinedGroupList();
173
+          }
174
+          break;
175
+        // 当前用户的入群邀请被拒绝。邀请人会收到该回调。例如,用户 B 拒绝了用户 A 的入群邀请,用户 A 会收到该回调。
176
+        case 'rejectInvite':
177
+          break;
178
+        // 当前用户的入群邀请被接受。邀请人会收到该回调。例如,用户 B 接受了用户 A 的入群邀请,则用户 A 会收到该回调。
179
+        case 'acceptInvite':
180
+          break;
181
+        // 当前用户收到了入群邀请。受邀用户会收到该回调。例如,用户 B 邀请用户 A 入群,则用户 A 会收到该回调。
182
+        case 'inviteToJoin':
183
+          {
184
+            handleAutoAcceptInvitation(event);
185
+          }
186
+          break;
187
+        // 当前用户的入群申请被拒绝。申请人会收到该回调。例如,用户 B 拒绝用户 A 的入群申请后,用户 A 会收到该回调。
188
+        case 'joinPublicGroupDeclined':
189
+          break;
190
+        // 当前用户的入群申请被接受。申请人会收到该回调。例如,用户 B 接受用户 A 的入群申请后,用户 A 会收到该回调。
191
+        case 'acceptRequest':
192
+          {
193
+            initJoinedGroupList();
194
+          }
195
+          break;
196
+        // 当前用户发送入群申请。群主和群管理员会收到该回调。
197
+        case 'requestToJoin':
198
+          console.log('>>>>>requestToJoin', event);
199
+          break;
200
+        // 群组被解散。群主解散群组时,所有群成员均会收到该回调。
201
+        case 'destroy':
202
+          {
203
+            initJoinedGroupList();
204
+          }
205
+          break;
206
+        // 设置群成员的自定义属性。群组内其他成员均会收到该回调。
207
+        case 'memberAttributesUpdate':
208
+          break;
209
+        default:
210
+          break;
211
+      }
212
+    },
213
+  };
214
+  EMClient.removeEventHandler(
215
+    listenerEventName || HANDLER_EVENT_NAME.GROUP_EVENT
216
+  );
217
+  EMClient.addEventHandler(
218
+    listenerEventName || HANDLER_EVENT_NAME.GROUP_EVENT,
219
+    groupListenFunc
220
+  );
221
+};

+ 147 - 0
EaseIM/emListener/emMessagesListener.js

@@ -0,0 +1,147 @@
1
+import { EMClient } from '../index';
2
+import store from '@/store';
3
+import { CHAT_TYPE, HANDLER_EVENT_NAME, MESSAGE_STATUS } from '../constant';
4
+import { getEMKey } from '@/EaseIM/utils';
5
+export const emMessagesListener = (callback, listenerEventName) => {
6
+  console.log('消息监听已挂载');
7
+  //处理展示类型消息(txt、image、file...)
8
+  const handleReciveDisPlayMessages = (message) => {
9
+    console.log('>>>>开始处理收到的消息', message);
10
+    let key = getEMKey(
11
+      EMClient.user,
12
+      message.from,
13
+      message.to,
14
+      message.chatType
15
+    );
16
+    //向消息集合中添加新消息
17
+    store.commit('UPDATE_MESSAGE_COLLECTION', {
18
+      key,
19
+      message,
20
+    });
21
+    store.commit('UPDATE_CONVERSATION_ITEM', {
22
+      conversationId: key,
23
+      lastMessage: message,
24
+    });
25
+    // messageStore.updateMessageCollection(key, message);
26
+    // conversationStore.updateConversationLastMessage(key, message);
27
+    // }
28
+  };
29
+  //处理回执类型消息
30
+  const handleReciveAckMessages = (message) => {
31
+    console.log('>>>>开始处理回执类型消息');
32
+  };
33
+  //处理撤回类型消息
34
+  const handleReciveRecallMessage = (message) => {
35
+    const { mid } = message;
36
+    //收集消息状态--撤回
37
+    store.commit('UPDATE_MESSAGE_COLLECTION_STATUS', {
38
+      key: mid,
39
+      status: MESSAGE_STATUS.RECALL,
40
+    });
41
+    console.log('>>>>开始处理撤回类型消息', message);
42
+  };
43
+  //处理command 命令消息
44
+  const handleReciveCommandMessage = (message) => {
45
+    console.log('>>>>开始处理命令消息', message);
46
+    //action TypingBegin
47
+    const { action, from } = message;
48
+    switch (action) {
49
+      //处理对方正在输入状态
50
+      case 'TypingBegin':
51
+        {
52
+          const chattingId = store.getters.chattingId;
53
+          const chattingTypingStatus = store.getters.chattingTypingStatus;
54
+          if (from === chattingId && chattingTypingStatus === false) {
55
+            store.commit('SET_CHATING_USER_INFO_TYPING_STATUS', true);
56
+            setTimeout(() => {
57
+              //5s重置输入中的状态
58
+              store.commit('SET_CHATING_USER_INFO_TYPING_STATUS', false);
59
+            }, 5000);
60
+          }
61
+        }
62
+        break;
63
+
64
+      default:
65
+        break;
66
+    }
67
+  };
68
+  const messagesListenFunc = {
69
+    // 当前用户收到文本消息。
70
+    onTextMessage: function (message) {
71
+      handleReciveDisPlayMessages({ ...message });
72
+    },
73
+    // 当前用户收到图片消息。
74
+    onImageMessage: function (message) {
75
+      handleReciveDisPlayMessages({ ...message });
76
+    },
77
+    // 当前用户收到透传消息。
78
+    onCmdMessage: function (message) {
79
+      handleReciveCommandMessage({ ...message });
80
+    },
81
+    // 当前用户收到语音消息。
82
+    onAudioMessage: function (message) {
83
+      handleReciveDisPlayMessages({ ...message });
84
+    },
85
+    // 当前用户收到位置消息。
86
+    onLocationMessage: function (message) {
87
+      handleReciveDisPlayMessages({ ...message });
88
+    },
89
+    // 当前用户收到文件消息。
90
+    onFileMessage: function (message) {
91
+      handleReciveDisPlayMessages({ ...message });
92
+    },
93
+    // 当前用户收到自定义消息。
94
+    onCustomMessage: function (message) {
95
+      handleReciveDisPlayMessages({ ...message });
96
+    },
97
+	// 当前用户收到自定义消息。
98
+	onCustomMessage1: function (message) {
99
+	  handleReciveDisPlayMessages({ ...message });
100
+	},
101
+    // 当前用户收到视频消息。
102
+    onVideoMessage: function (message) {
103
+      handleReciveDisPlayMessages({ ...message });
104
+    },
105
+    // 当前用户收到的消息被消息发送方撤回。
106
+    onRecallMessage: function (message) {
107
+      handleReciveRecallMessage({ ...message });
108
+    },
109
+    // 当前用户发送的消息被接收方收到。
110
+    onReceivedMessage: function (message) {
111
+      handleReciveAckMessages({ ...message });
112
+    },
113
+    // 当前用户收到消息送达回执。
114
+    onDeliveredMessage: function (message) {
115
+      handleReciveAckMessages({ ...message });
116
+    },
117
+    // 当前用户收到消息已读回执。
118
+    onReadMessage: function (message) {
119
+      handleReciveAckMessages({ ...message });
120
+    },
121
+    // 当前用户收到会话已读回执。
122
+    onChannelMessage: function (message) {
123
+      handleReciveAckMessages({ ...message });
124
+    },
125
+    //监听到有用户修改消息
126
+    onModifiedMessage: function (message) {
127
+      let key = getEMKey(
128
+        EMClient.user,
129
+        message.from,
130
+        message.to,
131
+        message.chatType
132
+      );
133
+      store.commit('MODIFY_MESSAGE_FROM_COLLECTION', {
134
+        key,
135
+        mid: message.id,
136
+        message,
137
+      });
138
+    },
139
+  };
140
+  EMClient.removeEventHandler(
141
+    listenerEventName || HANDLER_EVENT_NAME.MESSAGES_EVENT
142
+  );
143
+  EMClient.addEventHandler(
144
+    listenerEventName || HANDLER_EVENT_NAME.MESSAGES_EVENT,
145
+    messagesListenFunc
146
+  );
147
+};

+ 19 - 0
EaseIM/emListener/emMountGlobalListener.js

@@ -0,0 +1,19 @@
1
+import { emContactsListener } from './emContactsListener';
2
+import { emGroupListener } from './emGroupListener';
3
+import { emMessagesListener } from './emMessagesListener';
4
+import { emErrorListener } from './emErrorListener';
5
+import { emPresenceListener } from './emPresenceListener';
6
+export const emMountGlobalListener = (cb = () => {}) => {
7
+  if (typeof cb === 'function') {
8
+    // 参数是一个函数
9
+    emMessagesListener(cb);
10
+    emContactsListener(cb);
11
+    emGroupListener(cb);
12
+    emErrorListener(cb);
13
+    emPresenceListener(cb);
14
+  } else {
15
+    // 参数不是一个函数
16
+    console.error('传入的参数不是一个函数');
17
+  }
18
+  console.log('>>>>全局监听');
19
+};

+ 23 - 0
EaseIM/emListener/emPresenceListener.js

@@ -0,0 +1,23 @@
1
+import { EMClient } from "../index";
2
+import { CONNECT_CALLBACK_TYPE, HANDLER_EVENT_NAME } from "../constant";
3
+import store from "@/store";
4
+export const emPresenceListener = (callback, listenerEventName) => {
5
+  console.log(">>>>在线状态订阅监听已挂载");
6
+  const handlePresence = (message) => {
7
+    store.dispatch("handlePresenceChanges", message);
8
+  };
9
+  const presenceListenFunc = {
10
+    onPresenceStatusChange: function (message) {
11
+      console.log(">>>>状态变化了", message);
12
+
13
+      handlePresence(...message);
14
+    },
15
+  };
16
+  EMClient.removeEventHandler(
17
+    listenerEventName || HANDLER_EVENT_NAME.PRESENCE_EVENT
18
+  );
19
+  EMClient.addEventHandler(
20
+    listenerEventName || HANDLER_EVENT_NAME.PRESENCE_EVENT,
21
+    presenceListenFunc
22
+  );
23
+};

+ 10 - 0
EaseIM/emListener/index.js

@@ -0,0 +1,10 @@
1
+import { emConnectListener } from "./emConnectListener";
2
+import { emContactsListener } from "./emContactsListener";
3
+import { emMountGlobalListener } from "./emMountGlobalListener";
4
+import { emPresenceListener } from "./emPresenceListener";
5
+export {
6
+  emMountGlobalListener,
7
+  emConnectListener,
8
+  emContactsListener,
9
+  emPresenceListener,
10
+};

+ 10 - 0
EaseIM/index.js

@@ -0,0 +1,10 @@
1
+import EaseSDK from 'easemob-websdk/uniApp/Easemob-chat';
2
+import { EM_APP_KEY, EM_API_URL, EM_WEB_SOCKET_URL } from './config';
3
+let EMClient = (uni.EMClient = {});
4
+EMClient = new EaseSDK.connection({
5
+  appKey: EM_APP_KEY,
6
+  apiUrl: EM_API_URL,
7
+  url: EM_WEB_SOCKET_URL,
8
+});
9
+uni.EMClient = EMClient;
10
+export { EaseSDK, EMClient };

+ 23 - 0
EaseIM/utils/convertGroupDetailsToGroupList.js

@@ -0,0 +1,23 @@
1
+export default function convertGroupDetailsToGroupList(detailsData) {
2
+  const groupListData = {};
3
+  // 转换重合字段名
4
+  groupListData.groupName = detailsData.name;
5
+  groupListData.groupId = detailsData.id;
6
+  groupListData.maxUsers = detailsData.maxusers;
7
+  groupListData.allowInvites = detailsData.allowinvites;
8
+  groupListData.affiliationsCount = detailsData.affiliations_count;
9
+  //将返回群列表里面的不存在的属性从群详情新增。
10
+  groupListData.shieldgroup = detailsData.shieldgroup;
11
+  groupListData.affiliations = detailsData.affiliations;
12
+  groupListData.mute = detailsData.mute;
13
+  groupListData.custom = detailsData.custom;
14
+  groupListData.created = detailsData.created;
15
+  groupListData.owner = detailsData.owner;
16
+  groupListData.membersonly = detailsData.membersonly;
17
+  //两个数据结构重合的属性值
18
+  groupListData.description = detailsData.description;
19
+  groupListData.disabled = detailsData.disabled;
20
+  groupListData.public = detailsData.public;
21
+
22
+  return groupListData;
23
+}

+ 22 - 0
EaseIM/utils/emHandleReconnect.js

@@ -0,0 +1,22 @@
1
+import { EMClient } from '../index';
2
+import emConnect from '../emApis/emConnect';
3
+const { loginWithAccessToken, closeEaseIM } = emConnect();
4
+const emHandleReconnect = () => {
5
+  const getEMClientSocketState = () => {
6
+    //三种状态 undefined false 为SDK 断开连接,true 正在连接中。
7
+	// console.log(EMClient.isOpened(),'三种状态 undefined false 为SDK 断开连接,true 正在连接中')
8
+    return EMClient.isOpened();
9
+  };
10
+  const actionEMReconnect = () => {
11
+    closeEaseIM();
12
+    setTimeout(() => {
13
+      const loginInfos = uni.getStorageSync(`EM_LOGIN_INFOS`);
14
+      loginWithAccessToken(loginInfos.userId, loginInfos.token);
15
+    }, 300);
16
+  };
17
+  return {
18
+    getEMClientSocketState,
19
+    actionEMReconnect,
20
+  };
21
+};
22
+export default emHandleReconnect;

+ 11 - 0
EaseIM/utils/getCurrentRoute.js

@@ -0,0 +1,11 @@
1
+//通过uni-app提供的方法调用getCurrentPages 获取当前页面路由url
2
+const getCurrentRoute = () => {
3
+  let pages = getCurrentPages();
4
+  if (pages.length > 0) {
5
+    let currentPage = pages[pages.length - 1];
6
+    return currentPage.route;
7
+  }
8
+  return '/';
9
+};
10
+
11
+export default getCurrentRoute;

+ 15 - 0
EaseIM/utils/getEMKey.js

@@ -0,0 +1,15 @@
1
+/* 用以获取消息存储格式时的key */
2
+const getEMKey = (loginId, fromId, toId, chatType) => {
3
+  let key = '';
4
+  if (chatType === 'singleChat') {
5
+    if (loginId === fromId) {
6
+      key = toId;
7
+    } else {
8
+      key = fromId;
9
+    }
10
+  } else if (chatType === 'groupChat') {
11
+    key = toId;
12
+  }
13
+  return key;
14
+};
15
+export default getEMKey;

+ 32 - 0
EaseIM/utils/handlePresence.js

@@ -0,0 +1,32 @@
1
+const handleStatusDetails = (params) => {
2
+  let resultArr = [];
3
+
4
+  if (Array.isArray(params)) {
5
+    resultArr = [...params];
6
+    return resultArr;
7
+  }
8
+
9
+  if (params instanceof Object) {
10
+    for (const key in params) {
11
+      if (params.hasOwnProperty(key)) {
12
+        const status = params[key];
13
+        resultArr.push({ device: key, status: Number(status) });
14
+      }
15
+    }
16
+  }
17
+
18
+  return resultArr;
19
+};
20
+
21
+export default function (statusBody) {
22
+  return {
23
+    uid: statusBody.uid || statusBody.userId,
24
+    expiry: statusBody.expiry || statusBody.expire,
25
+    lastTime: statusBody.lastTime || statusBody.last_time,
26
+    statusDetails: handleStatusDetails(
27
+      statusBody.status || statusBody.statusDetails
28
+    ),
29
+
30
+    ext: statusBody.ext,
31
+  };
32
+}

+ 12 - 0
EaseIM/utils/index.js

@@ -0,0 +1,12 @@
1
+import paseEmoji from './paseEmoji';
2
+import getEMKey from './getEMKey';
3
+import convertGroupDetailsToGroupList from './convertGroupDetailsToGroupList';
4
+import emHandleReconnect from './emHandleReconnect';
5
+import handlePresence from './handlePresence';
6
+export {
7
+  paseEmoji,
8
+  getEMKey,
9
+  convertGroupDetailsToGroupList,
10
+  emHandleReconnect,
11
+  handlePresence,
12
+};

+ 86 - 0
EaseIM/utils/paseEmoji.js

@@ -0,0 +1,86 @@
1
+const Emoji = {
2
+  path: '../static/images/faces/',
3
+  map: {
4
+    '[):]': 'ee_1.png',
5
+    '[:D]': 'ee_2.png',
6
+    '[;)]': 'ee_3.png',
7
+    '[:-o]': 'ee_4.png',
8
+    '[:p]': 'ee_5.png',
9
+    '[(H)]': 'ee_6.png',
10
+    '[:@]': 'ee_7.png',
11
+    '[:s]': 'ee_8.png',
12
+    '[:$]': 'ee_9.png',
13
+    '[:(]': 'ee_10.png',
14
+    "[:'(]": 'ee_11.png',
15
+    '[<o)]': 'ee_12.png',
16
+    '[(a)]': 'ee_13.png',
17
+    '[8o|]': 'ee_14.png',
18
+    '[8-|]': 'ee_15.png',
19
+    '[+o(]': 'ee_16.png',
20
+    '[|-)]': 'ee_17.png',
21
+    '[:|]': 'ee_18.png',
22
+    '[*-)]': 'ee_19.png',
23
+    '[:-#]': 'ee_20.png',
24
+    '[^o)]': 'ee_21.png',
25
+    '[:-*]': 'ee_22.png',
26
+    '[8-)]': 'ee_23.png',
27
+    '[del]': 'btn_del.png',
28
+    '[(|)]': 'ee_24.png',
29
+    '[(u)]': 'ee_25.png',
30
+    '[(S)]': 'ee_26.png',
31
+    '[(*)]': 'ee_27.png',
32
+    '[(#)]': 'ee_28.png',
33
+    '[(R)]': 'ee_29.png',
34
+    '[({)]': 'ee_30.png',
35
+    '[(})]': 'ee_31.png',
36
+    '[(k)]': 'ee_32.png',
37
+    '[(F)]': 'ee_33.png',
38
+    '[(W)]': 'ee_34.png',
39
+    '[(D)]': 'ee_35.png',
40
+  },
41
+};
42
+
43
+const parseEmoji = (msg) => {
44
+  if (typeof Emoji === 'undefined' || typeof Emoji.map === 'undefined') {
45
+    return msg;
46
+  }
47
+
48
+  var emoji = Emoji,
49
+    reg = null;
50
+  var msgList = [];
51
+  var objList = [];
52
+
53
+  for (var face in emoji.map) {
54
+    if (emoji.map.hasOwnProperty(face)) {
55
+      while (msg.indexOf(face) > -1) {
56
+        msg = msg.replace(face, '^' + emoji.map[face] + '^');
57
+      }
58
+    }
59
+  }
60
+
61
+  var ary = msg.split('^');
62
+  var reg = /^e.*g$/;
63
+
64
+  for (var i = 0; i < ary.length; i++) {
65
+    if (ary[i] != '') {
66
+      msgList.push(ary[i]);
67
+    }
68
+  }
69
+
70
+  for (var i = 0; i < msgList.length; i++) {
71
+    if (reg.test(msgList[i])) {
72
+      var obj = {};
73
+      obj.data = msgList[i];
74
+      obj.type = 'emoji';
75
+      objList.push(obj);
76
+    } else {
77
+      var obj = {};
78
+      obj.data = msgList[i];
79
+      obj.type = 'txt';
80
+      objList.push(obj);
81
+    }
82
+  }
83
+
84
+  return objList;
85
+};
86
+export default parseEmoji;

+ 103 - 0
chat/contacts/contacts.css

@@ -0,0 +1,103 @@
1
+
2
+.but{
3
+	width:80%;
4
+	height:40px;
5
+	line-height: 40px;
6
+	text-align: center;
7
+	border-radius: 20px;
8
+	background-color:#007aff ;
9
+	color:#fff;
10
+	margin:0 auto;
11
+	margin-top: 100px;
12
+}.contacts_container {
13
+  box-sizing: border-box;
14
+  /* height: 100%; */
15
+  /* overflow-y: auto; */
16
+}
17
+.contacts_navbar_center {
18
+  width: 98px;
19
+  height: 22px;
20
+}
21
+.u-nav-slot {
22
+  display:  flex;
23
+  align-items: center;
24
+  justify-content: space-between;
25
+  border-width: 0.5px;
26
+  border-radius: 100px;
27
+  border-color: #ccc;
28
+  padding: 3px 7px;
29
+
30
+}
31
+.contacts_header_container {
32
+  background: #fff;
33
+}
34
+.search_container {
35
+  height: 40px;
36
+  width: 100%;
37
+  box-sizing: border-box;
38
+  padding: 4px;
39
+  background: #fff;
40
+  margin-bottom: 5px;
41
+}
42
+.searching_container {
43
+  height: 40px;
44
+  width: 100%;
45
+  box-sizing: border-box;
46
+  padding: 4px;
47
+  background: #fff;
48
+  margin-bottom: 5px;
49
+}
50
+
51
+.search_icon_box {
52
+  width: 100%;
53
+  height: 36px;
54
+  background: #f1f2f3;
55
+  display: flex;
56
+  flex-direction: row;
57
+  align-items: center;
58
+  justify-content: center;
59
+  border-radius: 4px;
60
+}
61
+.search_text {
62
+  /* Input */
63
+
64
+  width: 32px;
65
+  height: 22px;
66
+
67
+  /* 简体中文/文本/大 */
68
+  font-family: 'PingFang SC';
69
+  font-style: normal;
70
+  font-weight: 400;
71
+  font-size: 16px;
72
+  line-height: 22px;
73
+  /* identical to box height, or 138% */
74
+
75
+  /* Neutral/6 */
76
+  color: #919ba1;
77
+
78
+  /* Inside auto layout */
79
+  flex: none;
80
+  order: 1;
81
+  flex-grow: 0;
82
+}
83
+.header_title {
84
+  /* 简体中文/次级标题/中 */
85
+  font-family: 'PingFang SC';
86
+  font-style: normal;
87
+  font-weight: 500;
88
+  font-size: 16px;
89
+  line-height: 22px;
90
+  /* identical to box height, or 138% */
91
+
92
+  /* Neutral/1 */
93
+  color: #171a1c;
94
+
95
+  /* Inside auto layout */
96
+  flex: none;
97
+  order: 0;
98
+  flex-grow: 0;
99
+}
100
+
101
+.contacts_item_cell {
102
+  background: #fff;
103
+}

+ 380 - 0
chat/contacts/contacts.vue

@@ -0,0 +1,380 @@
1
+<template>
2
+    <view class="contacts_container">
3
+        <!-- navbar -->
4
+        <!-- #ifdef H5 || APP-PLUS -->
5
+        <u-navbar title="联系人" :placeholder="true">
6
+            <u-avatar size="32" slot="left" shape="square" :src="loginUserAvatar">
7
+            </u-avatar>
8
+            <view slot="center">
9
+                <image class="contacts_navbar_center" src="/static/images/new_ui/contacts_log.png" />
10
+            </view>
11
+            <u-icon slot="right" size="24" name="/static/images/new_ui/contacts/add_contacts.png"
12
+                @click="entryAddContactsPage"></u-icon>
13
+        </u-navbar>
14
+        <!-- #endif -->
15
+        <!-- #ifndef H5 || APP-PLUS-->
16
+        <u-navbar title="联系人" :placeholder="true">
17
+            <view class="u-nav-slot" slot="left">
18
+                <u-avatar size="32" shape="square" :src="loginUserAvatar"> </u-avatar>
19
+                <u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
20
+                <u-icon size="24" name="/static/images/new_ui/contacts/add_contacts.png"
21
+                    @click="entryAddContactsPage"></u-icon>
22
+            </view>
23
+
24
+            <view slot="center">
25
+                <image class="contacts_navbar_center" src="/static/images/new_ui/contacts_log.png" />
26
+            </view>
27
+
28
+        </u-navbar>
29
+
30
+        <!-- #endif -->
31
+		
32
+		
33
+        <!-- search -->
34
+        <!-- 搜索好友列表相关 -->
35
+        <view>
36
+            <view class="search_container" v-if="isShowDefaultSearch">
37
+                <view class="search_icon_box" @click="openSearch">
38
+                    <u-icon size="22" name="/static/images/new_ui/search_icon.png"></u-icon>
39
+                    <text class="search_text">搜索</text>
40
+                </view>
41
+            </view>
42
+            <!-- 好友搜索结果展示 -->
43
+            <view class="searching_container" v-if="!isShowDefaultSearch">
44
+                <u-search v-model.trim="searchInputKeywords" shape="square" placeholder="搜索联系人" :actionText="'取消'"
45
+                    :actionStyle="{
46
+            color: '#0873de',
47
+        }" :clearabled="true" :focus="true" @search="onSearchContacts" @input="onSearchContacts"
48
+                    @custom="cancelSearch"></u-search>
49
+            </view>
50
+        </view>
51
+        <!-- 搜索结果list -->
52
+        <template v-if="!isShowDefaultSearch">
53
+            <u-index-list class="index_list_container" :index-list="indexList" @select="onSelectIndex"
54
+                activeColor="#009EFF" customNavHeight="90">
55
+                <template v-for="(item, index) in searchFriendResultList">
56
+                    <u-index-item>
57
+                        <u-index-anchor :text="indexList[index]" bgColor="#FFF" color="#75828A"
58
+                            height="32px"></u-index-anchor>
59
+                        <u-cell class="contacts_item_cell" v-for="(cell, index1) in item"
60
+                            :key="cell.initial + cell.userId" :border="false">
61
+                            <!-- 头像 -->
62
+                            <u-avatar slot="icon" shape="square" size="40" :src="showFriendAvatar(cell.userId)"
63
+                                customStyle="margin: -3px 5px -3px 0"></u-avatar>
64
+                            <!-- name -->
65
+                            <view class="conversation_item_title" slot="title">
66
+                                <u--text class="conversation_item_title_text" :lines="1"
67
+                                    :text="showFriendNickname(cell)" iconStyle="margin-left: 2px;">
68
+                                </u--text>
69
+                            </view>
70
+                        </u-cell>
71
+                    </u-index-item>
72
+                </template>
73
+            </u-index-list>
74
+        </template>
75
+        <!-- 默认好友列表list -->
76
+        <template v-else>
77
+            <u-index-list :index-list="indexList" @select="onSelectIndex" activeColor="#009EFF" customNavHeight="90">
78
+                <!-- Contacts -->
79
+                <view slot="header" class="contacts_header_container">
80
+                    <u-cell-group :border="false">
81
+                        <u-cell :clickable="true" :isLink="true" @click="entryNewInvitePage">
82
+                            <text slot="title" class="header_title">新邀请</text>
83
+                            <u-badge slot="value" type="primary" max="99" :value="newInviteMsgNum"></u-badge>
84
+                        </u-cell>
85
+                        <u-cell :clickable="true" :isLink="true" @click="entryGroupListPage">
86
+                            <text slot="title" class="header_title">群聊</text>
87
+                            <text slot="value">{{ joinedGroupTotal }}</text>
88
+                        </u-cell>
89
+                        <u-cell :clickable="true" :isLink="true" @click="entryBlockMembersPage">
90
+                            <text slot="title" class="header_title">黑名单</text>
91
+                            <text slot="value">{{ blockUserList.length }}</text>
92
+                        </u-cell>
93
+                    </u-cell-group>
94
+                </view>
95
+                <template>
96
+                    <u-index-item v-for="(item, index) in sortedContactsList" :key="index">
97
+                        <u-index-anchor :text="indexList[index]" bgColor="#FFF" color="#75828A"
98
+                            height="32px"></u-index-anchor>
99
+                        <u-cell class="contacts_item_cell" v-for="(cell, index1) in item" :key="cell.userId"
100
+                            :border="false" @click="entryContactsDetailPage(cell.userId)">
101
+                            <!-- 头像 -->
102
+                            <u-avatar slot="icon" shape="square" size="40" :src="showFriendAvatar(cell.userId)"
103
+                                customStyle="margin: -3px 5px -3px 0"></u-avatar>
104
+                            <!-- name -->
105
+                            <view class="conversation_item_title" slot="title">
106
+                                <u--text class="conversation_item_title_text" :lines="1"
107
+                                    :text="showFriendNickname(cell)" iconStyle="margin-left: 2px;">
108
+                                </u--text>
109
+                            </view>
110
+                        </u-cell>
111
+                    </u-index-item>
112
+                </template>
113
+                <view slot="footer" class="u-safe-area-inset--bottom">
114
+                    <text class="list__footer"></text>
115
+                    <u-divider :text="`${friendList.length}个联系人`" :hairline="true"></u-divider>
116
+                </view>
117
+            </u-index-list>
118
+        </template>
119
+		<view class="but" @click="gotoPage('/pages/storemanagement/index')">
120
+			查看会话列表
121
+		</view>
122
+    </view>
123
+</template>
124
+
125
+<script>
126
+import { CHAT_TYPE } from "@/EaseIM/constant";
127
+const indexList = () => {
128
+    const indexList = [];
129
+    const charCodeOfA = "A".charCodeAt(0);
130
+    for (let i = 0; i < 26; i++) {
131
+        indexList.push(String.fromCharCode(charCodeOfA + i));
132
+    }
133
+    indexList.push("#");
134
+    return indexList;
135
+};
136
+export default {
137
+    data() {
138
+        return {
139
+            isShowDefaultSearch: true,
140
+            searchInputKeywords: "",
141
+            searchFriendResultList: [],
142
+            defaultAvatar: "/static/images/new_ui/defaultAvatar.png",
143
+            indexList: [],
144
+            //   indexList: indexList(),
145
+            sortedContactsList: [],
146
+        };
147
+    },
148
+    mounted() {
149
+        uni.hideHomeButton && uni.hideHomeButton();
150
+        this.getBrandsList(this.friendList);
151
+    },
152
+    computed: {
153
+        loginUserProfiles() {
154
+            return this.$store.state.LoginStore.loginUserProfiles;
155
+        },
156
+        loginUserAvatar() {
157
+            if (this.loginUserProfiles.avatarurl) {
158
+                return this.loginUserProfiles?.avatarurl;
159
+            } else {
160
+                return this.defaultAvatar;
161
+            }
162
+        },
163
+        //好友列表
164
+        friendList() {
165
+            return this.$store.state.ContactsStore.friendList;
166
+        },
167
+        friendUserInfoCollection() {
168
+            return this.$store.getters.friendUserInfoCollection;
169
+        },
170
+        blockUserList() {
171
+            return this.$store.state.ContactsStore.blockUserList;
172
+        },
173
+        newInviteMsgNum() {
174
+            return (
175
+                this.$store.getters.getReceiveInviteList?.length &&
176
+                this.$store.getters.getReceiveInviteList.filter(
177
+                    (inform) => !inform.isHandled
178
+                ).length
179
+            );
180
+        },
181
+        //群组总数
182
+        joinedGroupTotal() {
183
+            return this.$store.getters.joinedGroupTotal;
184
+        },
185
+        //好友头像展示
186
+        showFriendAvatar() {
187
+            return (hxId) => {
188
+                if (
189
+                    this.friendUserInfoCollection[hxId] &&
190
+                    this.friendUserInfoCollection[hxId]?.avatarurl
191
+                ) {
192
+                    return this.friendUserInfoCollection[hxId].avatarurl;
193
+                } else {
194
+                    return this.defaultAvatar;
195
+                }
196
+            };
197
+        },
198
+        //好友昵称展示
199
+        showFriendNickname() {
200
+            return (userItem) => {
201
+                const { userId, remark } = userItem;
202
+                if (remark) {
203
+                    return remark;
204
+                }
205
+                if (
206
+                    this.friendUserInfoCollection[userId] &&
207
+                    this.friendUserInfoCollection[userId]?.nickname
208
+                ) {
209
+                    return this.friendUserInfoCollection[userId].nickname;
210
+                } else {
211
+                    return userId;
212
+                }
213
+            };
214
+        },
215
+    },
216
+    watch: {
217
+        friendList() {
218
+            this.getBrandsList(this.friendList);
219
+        },
220
+    },
221
+    methods: {
222
+		gotoPage(url){
223
+			// uni.navigateTo({
224
+			//   url: url,
225
+			// });
226
+			uni.switchTab({
227
+				url:url
228
+			})
229
+		},
230
+        //开启搜索模式
231
+        openSearch() {
232
+            this.isShowDefaultSearch = false;
233
+        },
234
+        cancelSearch() {
235
+            this.isShowDefaultSearch = true;
236
+            this.searchInputKeywords = "";
237
+            this.searchFriendResultList = [];
238
+            this.getBrandsList(this.friendList);
239
+        },
240
+        onSearchContacts() {
241
+            let searchValue = this.searchInputKeywords;
242
+            let member = this.friendList;
243
+            let serchList = [];
244
+            member.forEach((friendItem) => {
245
+                if (String(friendItem.userId).indexOf(searchValue) > -1) {
246
+                    serchList.push(friendItem);
247
+                } else if (
248
+                    this.friendUserInfoCollection[friendItem.userId] &&
249
+                    this.friendUserInfoCollection[friendItem.userId]?.nickname
250
+                ) {
251
+                    if (
252
+                        this.friendUserInfoCollection[friendItem.userId].nickname.indexOf(
253
+                            searchValue
254
+                        ) > -1
255
+                    ) {
256
+                        serchList.push(friendItem);
257
+                    }
258
+                }
259
+            });
260
+            this.getBrandsList(serchList, "search");
261
+        },
262
+        //删除好友
263
+        //二次确认&执行删除
264
+        async deleteFriend(event) {
265
+            console.log(">>>>执行删除好友", event);
266
+            const { name: delFriendId } = event;
267
+            const res = await uni.showModal({
268
+                title: "确认删除?+ delFriendId",
269
+                confirmText: "删除",
270
+            });
271
+            if (res.confirm) {
272
+                removeContactFromServer(delFriendId);
273
+                updateFriendList();
274
+            }
275
+        },
276
+
277
+        //前往系统通知页面
278
+        entryTabNnotificationPage: function () {
279
+            uni.navigateTo({
280
+                url: "../notification/notification",
281
+            });
282
+        },
283
+        //前往群组页面
284
+        entryGroupsPage: function () {
285
+            uni.navigateTo({
286
+                url: "../groups/groups?myName=" + this.myName,
287
+            });
288
+        },
289
+        //前往单聊页面
290
+        entryemChat: function (params) {
291
+            const chatType = CHAT_TYPE.SINGLE_CHAT;
292
+            uni.navigateTo({
293
+                url: `../emChatContainer/index?targetId=${params.name}&chatType=${chatType}`,
294
+            });
295
+        },
296
+        //前往添加好友页面
297
+        entryAddNewFreiend: function (event) {
298
+            uni.navigateTo({
299
+                url: "../addNewFriend/addNewFriend",
300
+            });
301
+        },
302
+        //构建indexList
303
+        //type为构建indexList init search
304
+        getBrandsList(friendsList, type) {
305
+            const reg = /[a-z]/i;
306
+            let contactsObj = {};
307
+            let indexList = [];
308
+
309
+            friendsList.length &&
310
+                friendsList.forEach((friendItem) => {
311
+                    const { userId, remark } = friendItem;
312
+                    const params = {};
313
+                    params.userId = userId;
314
+                    params.remark = remark;
315
+                    console.log("friendItem", friendItem);
316
+                    if (reg.test(userId.substring(0, 1))) {
317
+                        const initial = userId.substring(0, 1).toUpperCase();
318
+                        if (!contactsObj[initial]) {
319
+                            contactsObj[initial] = [];
320
+                        }
321
+                        params.initial = initial;
322
+                        contactsObj[initial].push(params);
323
+                        indexList.push(userId.substring(0, 1).toUpperCase());
324
+                    } else {
325
+                        const initial = "#";
326
+                        params.initial = initial;
327
+                        if (!contactsObj[initial]) {
328
+                            contactsObj[initial] = [];
329
+                        }
330
+                        contactsObj[initial].push({ ...params });
331
+                        indexList.push("#");
332
+                    }
333
+                });
334
+            if (type === "search") {
335
+                this.searchFriendResultList = Object.values(contactsObj);
336
+            } else {
337
+                this.sortedContactsList = Object.values(contactsObj);
338
+            }
339
+            this.indexList = [...new Set(indexList)];
340
+            console.log("contactsList", Object.values(contactsObj));
341
+        },
342
+        onSelectIndex(value) {
343
+            console.log(">>>>>>>", value);
344
+        },
345
+        //前往添加联系人页面
346
+        entryAddContactsPage() {
347
+            uni.navigateTo({
348
+                url: "../addContacts/index",
349
+            });
350
+        },
351
+        //前往新邀请页面
352
+        entryNewInvitePage() {
353
+            uni.navigateTo({
354
+                url: "../newInvite/index",
355
+            });
356
+        },
357
+        //前往群组列表页面
358
+        entryGroupListPage() {
359
+            uni.navigateTo({
360
+                url: "../groupList/index",
361
+            });
362
+        },
363
+        //前往黑名单列表页面
364
+        entryBlockMembersPage() {
365
+            uni.navigateTo({
366
+                url: "../blockMembers/index",
367
+            });
368
+        },
369
+        //前往联系人详情页面
370
+        entryContactsDetailPage(userId) {
371
+            uni.navigateTo({
372
+                url: `../contactsDetail/index?userId=${userId}`,
373
+            });
374
+        },
375
+    },
376
+};
377
+</script>
378
+<style>
379
+@import "./contacts.css";
380
+</style>

File diff suppressed because it is too large
+ 1042 - 0
chatIndex/storemanagement/index.vue


+ 173 - 0
commit/api.js

@@ -0,0 +1,173 @@
1
+import { 
2
+ myRequest 
3
+} from './request.js'
4
+ 
5
+// 查询所有权限
6
+export function queryJurisdiction(data) { 
7
+ return myRequest({ 
8
+  url: 'merchant_service/StoreBranch/queryJurisdiction', 
9
+  method: 'get', 
10
+  data 
11
+ }) 
12
+} 
13
+// 门店下添加部门
14
+export function addStoreBranch(data) { 
15
+ return myRequest({ 
16
+  url: 'merchant_service/StoreBranch/addStoreBranch', 
17
+  method: 'post', 
18
+  data 
19
+ }) 
20
+} 
21
+// 根据门店查询所有部门
22
+export function queryStoreBranchBymerid(data) { 
23
+ return myRequest({ 
24
+  url: 'merchant_service/StoreBranch/queryStoreBranchBymerid', 
25
+  method: 'post', 
26
+  data 
27
+ }) 
28
+} 
29
+// 添加门店员工
30
+export function storeStafAdd(data) { 
31
+ return myRequest({ 
32
+  url: 'merchant_service/StoreStall/storeStafAdd', 
33
+  method: 'post', 
34
+  data 
35
+ }) 
36
+} 
37
+// 根据部门id查询所有员工
38
+export function queryStoreStaff(data) { 
39
+ return myRequest({ 
40
+  url: 'merchant_service/StoreStall/queryStoreStaff', 
41
+  method: 'post', 
42
+  data 
43
+ }) 
44
+} 
45
+// 修改门店员工信息
46
+export function updateStoreStaff(data) { 
47
+ return myRequest({ 
48
+  url: 'merchant_service/StoreStall/updateStoreStaff', 
49
+  method: 'post', 
50
+  data 
51
+ }) 
52
+} 
53
+//获取验证码
54
+export function userPhoneLogOnCode(data) { 
55
+ return myRequest({ 
56
+  url: 'userCenter_service/userLogOnService/userPhoneLogOnCode', 
57
+  method: 'post', 
58
+  data 
59
+ }) 
60
+} 
61
+// 登录注册
62
+export function userPhoneLogOn(data) { 
63
+ return myRequest({ 
64
+  url: 'userCenter_service/userLogOnService/userPhoneLogOn', 
65
+  method: 'post', 
66
+  data 
67
+ }) 
68
+} 
69
+// 用户状态判断
70
+export function selectMerchant(data) { 
71
+ return myRequest({ 
72
+  url: 'merchant_service/merchantSettleInService/selectMerchant', 
73
+  method: 'post', 
74
+  data 
75
+ }) 
76
+} 
77
+// 上传照片
78
+export function uploadPicture(data) { 
79
+ return myRequest({ 
80
+  url: 'merchant_service/merchantSettleInService/uploadPicture', 
81
+  method: 'post', 
82
+  data 
83
+ }) 
84
+} 
85
+
86
+// 银行列表
87
+export function settlementBank(data) { 
88
+ return myRequest({ 
89
+  url: 'merchant_service/merchantSettleInService/settlementBank', 
90
+  method: 'post', 
91
+  data 
92
+ }) 
93
+} 
94
+
95
+// 省市区
96
+export function addressList(data) { 
97
+ return myRequest({ 
98
+  url: 'merchant_service/merchantSettleInService/addressList', 
99
+  method: 'post', 
100
+  data 
101
+ }) 
102
+} 
103
+
104
+// 门店分类
105
+export function selectMerchantSort(data) { 
106
+ return myRequest({ 
107
+  url: 'wares_service/waresServiceMerchant/selectMerchantSort', 
108
+  method: 'get', 
109
+  data 
110
+ }) 
111
+} 
112
+
113
+// 提交店铺申请
114
+export function merchaSettlen(data) { 
115
+ return myRequest({ 
116
+  url: 'merchant_service/merchantSettleInService/merchaSettlen', 
117
+  method: 'post', 
118
+  data 
119
+ }) 
120
+} 
121
+
122
+// 修改店铺申请
123
+export function updateMerchaSettlen(data) { 
124
+ return myRequest({ 
125
+  url: 'merchant_service/merchantSettleInService/updateMerchaSettlen', 
126
+  method: 'post', 
127
+  data 
128
+ }) 
129
+} 
130
+
131
+// 更具商户ID查询商户提交的数据
132
+export function selectMerchaSettlen(data) { 
133
+ return myRequest({ 
134
+  url: 'merchant_service/merchantSettleInService/selectMerchaSettlen', 
135
+  method: 'post', 
136
+  data 
137
+ }) 
138
+} 
139
+
140
+// 激活码
141
+export function updateActivationCode(data) { 
142
+ return myRequest({ 
143
+  url: 'merchant_service/merchantSettleInService/updateActivationCode', 
144
+  method: 'post', 
145
+  data 
146
+ }) 
147
+} 
148
+
149
+// 创建支付订单
150
+export function insterMerchantOrder(data) { 
151
+ return myRequest({ 
152
+  url: 'merchant_service/merchantSettleInService/insterMerchantOrder', 
153
+  method: 'post', 
154
+  data 
155
+ }) 
156
+} 
157
+// 通过部门id查询权限
158
+export function queryStoreBranch(data) { 
159
+ return myRequest({ 
160
+  url: 'merchant_service/StoreStall/queryStoreBranch', 
161
+  method: 'post', 
162
+  data 
163
+ }) 
164
+} 
165
+// 环信注册
166
+export function getImUser(data) { 
167
+ return myRequest({ 
168
+  url: 'merchant_service/cashierService/getImUser', 
169
+  method: 'post', 
170
+  data 
171
+ }) 
172
+} 
173
+

+ 55 - 0
commit/config.js

@@ -0,0 +1,55 @@
1
+import {
2
+	myRequest
3
+} from './request.js'
4
+// 店铺信息头
5
+export function queyrConfig(data) {
6
+	return myRequest({
7
+		url: 'merchant_service/systemConfigValue/queyrConfig',
8
+		method: 'post',
9
+		data
10
+	})
11
+}
12
+
13
+
14
+
15
+// 获取门店分润值
16
+export function getShopBonusSetting(data) {
17
+	return myRequest({
18
+		url: 'merchant_service/systemConfigValue/getShopBonusSetting',
19
+		method: 'post',
20
+		data
21
+	})
22
+}
23
+
24
+// 修改门店分润值
25
+export function updateShopBonusSetting(data) {
26
+	return myRequest({
27
+		url: 'merchant_service/systemConfigValue/updateShopBonusSetting',
28
+		method: 'post',
29
+		data
30
+	})
31
+}
32
+// 锁定用户信息
33
+export function queryOrderUser(data) {
34
+	return myRequest({
35
+		url: 'order_service/orderService/queryOrderUser',
36
+		method: 'post',
37
+		data
38
+	})
39
+}
40
+// 锁定用户信息
41
+export function merchantYxadd(data) {
42
+	return myRequest({
43
+		url: 'merchant_service/merchantYx/add',
44
+		method: 'post',
45
+		data
46
+	})
47
+}
48
+// 查询音响是否绑定
49
+export function queryByMerId(data) {
50
+	return myRequest({
51
+		url: 'merchant_service/merchantYx/queryByMerId ',
52
+		method: 'post',
53
+		data
54
+	})
55
+}

+ 179 - 0
commit/item.js

@@ -0,0 +1,179 @@
1
+// this.$time.dateFormat('yyyy-MM-dd',new Date())
2
+//                          格式        时间
3
+import {
4
+        encryptDes,
5
+        decryptDes
6
+} from '@/encryption/index.js' // 引用路径根据自己的文件结构而定
7
+import
8
+Base64
9
+from 'base-64'
10
+export default {
11
+  // 时间格式化
12
+  dateFormat: function(fmt, date) {
13
+	 if (date == null) return ''
14
+    if (typeof date === 'string') {
15
+      date = new Date(Date.parse(date.replace(/-/g, '/').replace('.0', '')))
16
+    } else {
17
+      date = new Date(date)
18
+    }
19
+    let ret
20
+    const opt = {
21
+      'y+': date.getFullYear().toString(), // 年
22
+      'M+': (date.getMonth() + 1).toString(), // 月
23
+      'd+': date.getDate().toString(), // 日
24
+      'H+': date.getHours().toString(), // 时
25
+      'm+': date.getMinutes().toString(), // 分
26
+      'S+': date.getSeconds().toString() // 秒
27
+      // 有其他格式化字符需求可以继续添加,必须转化成字符串
28
+    }
29
+    for (const k in opt) {
30
+      ret = new RegExp('(' + k + ')').exec(fmt)
31
+      // opt = opt.replace('-','/')
32
+      if (ret) {
33
+        fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, '0')))
34
+      }
35
+    }
36
+    return fmt
37
+  },
38
+  // 秒数转换分钟秒
39
+  minuteSecond: function(second) {
40
+    var second = Math.floor(second)
41
+    return this.dateFormat(
42
+      'mm:SS',
43
+      '2000/03/02 05:' + Math.floor(second / 60) + ':' + (second % 60)
44
+    )
45
+  },
46
+  // 根据给定日期算出星期
47
+  getWeek: function(date) {
48
+	  if (date == null) return ''
49
+    if (typeof date === 'string') {
50
+      date = new Date(Date.parse(date.replace(/-/g, '/').replace('.0', '')))
51
+    }
52
+    var week = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
53
+    return week[date.getDay()]
54
+  },
55
+  // 上传图片
56
+  uploadPictures(successCallback) {
57
+	let userinfo = uni.getStorageSync('userinfo')
58
+	let d = new Date()
59
+  	let Fzitem = this.dateFormat("yyyy-MM-dd HH:mm:SS", d) //2022-08-08 14:02:59
60
+  	let shijian = '123456789/' + Fzitem //定义时间 + 封装时间
61
+  	let jmi = encryptDes(shijian, "bjtdba123")
62
+  	let bas = Base64.encode(jmi + "," + Fzitem)
63
+	
64
+  	uni.chooseFile({ 
65
+  		count: 1,
66
+		mediaType: ['image'],
67
+  		success: function (data) {
68
+			console.log('---------2', data)
69
+  			uni.uploadFile({
70
+  				url: '/gateway/merchant_service/merchantSettleInService/uploadPicture',
71
+  				filePath: data.tempFiles[0].path,
72
+  				name: 'file',
73
+  				formData: {
74
+  					'uid': userinfo.uid
75
+  				},
76
+  				header: {
77
+  					'authorization': uni.getStorageSync('token'), //请求头信息 
78
+  					'volunteerdes': bas // DES+B64加密
79
+  				},
80
+  				success: function(res) {
81
+  					let filedata = res.data ? JSON.parse(res.data) : {};
82
+  					if (filedata.status == 200) {
83
+  						successCallback && successCallback(filedata.data.urlMap.url)
84
+  					} else {
85
+  						uni.showToast({
86
+  							title: filedata.message,
87
+  							icon: "none"
88
+  						})
89
+  					}
90
+  				},
91
+  				fail: function(res) {
92
+					console.log('url = ',url,'res = ',res,)
93
+  					uni.showToast({
94
+  						title:res.data.message,
95
+  						icon: "none"
96
+  					})
97
+  				}
98
+  			})
99
+  		},
100
+		fail: function (error) {
101
+			console.log('---------3',error)
102
+			uni.showToast({
103
+				title:error.message,
104
+				icon: "none"
105
+			})
106
+		}
107
+  	});
108
+	
109
+	
110
+	// wx.chooseImage({
111
+		
112
+	//     //count表示一次可以选择多少照片
113
+	//       count: 1,
114
+	//       //sizeType所选的图片的尺寸,original原图,compressed压缩图
115
+	//       sizeType: ['original', 'compressed'],
116
+	//       //如果sourceType为camera则调用摄像头,为album时调用相册
117
+	//       sourceType: [that.data.sourceType[tapIndex]],
118
+	//       success(res) {
119
+	// 		  console.log('---------3')
120
+	//         // tempFilePath可以作为img标签的src属性显示图片
121
+	//         const tempFilePaths = res.tempFilePaths
122
+	//         //将选择到的图片缓存到本地storage中
123
+	//         wx.setStorageSync('tempFilePaths', tempFilePaths)
124
+	//         /*
125
+	// 		由于在我们选择图片后图片只是保存到storage中,所以我们需要调用一次   	        setHeader()方法来使页面上的头像更新
126
+	// 		*/
127
+	//         that.setHeader();
128
+	//         wx.showToast({
129
+	//           title: '设置成功',
130
+	//           icon: 'success',
131
+	//           duration: 2000
132
+	//         })
133
+	//       }
134
+	//     })
135
+	
136
+	// wx.chooseMessageFile({
137
+	// 	success: chooseImageRes => {
138
+	// 		const tempFilePaths = chooseImageRes.tempFiles;
139
+	// 		console.log('chooseImageRes=",chooseImageRes);
140
+	// 		let repeatImg = this.uploadImg.find(item => {
141
+	// 			return item.name == chooseImageRes.tempFiles[0].name;
142
+	// 		});
143
+	// 		console.log('tempFilePaths=',tempFilePaths[0])
144
+	// 		if(repeatImg == undefined){
145
+	// 			uni.uploadFile({
146
+	// 				url:filePath: tempFilePaths[0].path,
147
+	// 				name: 'file',
148
+	// 				formData:{
149
+	// 					user: "test'
150
+	// 				},
151
+	// 				success: uploadFileRes => {
152
+	// 					console.log('uploadFileRes==',uploadFileRes)
153
+	// 					console.log(JsoN.parse(uploadFileRes.data));
154
+	// 					let temporaryImg=JSON.parse(uploadFileRes.data);
155
+	// 					this.uploadImg.push({ name: chooseImageRes.tempFiles[0].name, url: temporaryImg.data[0].data.url });
156
+	// 					console.log('上传====',this.uploadImg);
157
+	// 				}
158
+	// 			});
159
+		
160
+	// 		} else {
161
+	// 			this.msgType = 'error';
162
+	// 			this.message 
163
+	// 			this.open(); 
164
+	// 		}
165
+	// 	}
166
+	// });
167
+	
168
+  },
169
+  
170
+  // 验证邮箱
171
+  isEmailAvailable(emailInput) {
172
+  	var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
173
+  	if (!myreg.test(emailInput)) {
174
+  		return false;
175
+  	} else {
176
+  		return true;
177
+  	}
178
+  }
179
+}

+ 27 - 0
commit/order.js

@@ -0,0 +1,27 @@
1
+import { 
2
+ myRequest 
3
+} from './request.js'
4
+// 正向订单状态数
5
+export function getOrderStstusAmount(data) { 
6
+ return myRequest({ 
7
+  url: 'order_service/orderService/getOrderStstusAmount', 
8
+  method: 'post', 
9
+  data 
10
+ }) 
11
+} 
12
+// 正向订单列表
13
+export function orderList(data) { 
14
+ return myRequest({ 
15
+  url: 'order_service/orderService/orderList', 
16
+  method: 'post', 
17
+  data 
18
+ }) 
19
+} 
20
+// 订单详情页面
21
+export function getOrderDetails(data) { 
22
+ return myRequest({ 
23
+  url: 'order_service/orderService/getOrderDetails', 
24
+  method: 'post', 
25
+  data 
26
+ }) 
27
+} 

+ 67 - 0
commit/request.js

@@ -0,0 +1,67 @@
1
+let is = 2
2
+var baseURL = '' // API访问的地址
3
+ if(is==1){
4
+	  baseURL = 'https://test.hebeiyhc.com/gateway/';//测试环境
5
+ }else if(is==2){
6
+	 // baseURL = 'https://api.hebeiyhc.com/gateway/'; //生产环境
7
+	 // baseURL = 'https://api.hebeiyhc.com/gateway/'; //生产环境
8
+	 baseURL = '/gateway/'; //生产环境
9
+ }else{
10
+	  baseURL = 'https://pre.bjtdba.com/gateway/'; //预生产环境
11
+ }
12
+let token = ''; // 用户的token
13
+let volunteerToken = ''; // DES+B64加密
14
+import time from '@/commit/item.js';
15
+import {
16
+	encryptDes,
17
+	decryptDes
18
+} from '@/encryption/index.js' // 引用路径根据自己的文件结构而定
19
+import
20
+Base64
21
+from 'base-64'
22
+var d = new Date(); //标准时间
23
+let Fzitem = time.dateFormat("yyyy-MM-dd HH:mm:SS", d) //2022-08-08 14:02:59
24
+let shijian = '123456789/' + Fzitem //定义时间 + 封装时间
25
+let jmi = encryptDes(shijian, "bjtdba123")
26
+let bas = Base64.encode(jmi + "," + Fzitem)
27
+ 
28
+export const myRequest = (options) => {
29
+	return new Promise((resolve, reject) => {
30
+		uni.request({
31
+			url: baseURL + options.url, //接口地址:前缀+方法中传入的地址 
32
+			method: options.method || 'GET', //请求方法:传入的方法或者默认是“GET” 
33
+			data: options.data || {}, //传递参数:传入的参数或者默认传递空集合 
34
+			header: {
35
+				// 'Content-Type': 'application/x-www-form-urlencoded',
36
+				'X-token': uni.getStorageSync('authorization'), //请求头信息
37
+				'volunteerdes': bas // DES+B64加密
38
+			},
39
+
40
+			success: (res) => {
41
+				console.log('url = ',baseURL + options.url)
42
+				console.log('params = ',options.data)
43
+				// debugger
44
+				resolve(res, "查看")
45
+				//返回的数据(不固定,看后端接口,这里是做了一个判断,如果不为true,用uni.showToast方法提示获取数据失败) 
46
+				// 如果不满足上述判断就输出数据 
47
+				if (res.data.status == 200) { //接口返回200走一下操作
48
+					resolve(res)
49
+				} else if (res.data.status == 500) {//接口返回500走一下操作
50
+					return uni.showToast({
51
+						title: res.data.error,
52
+						icon: 'none'
53
+					})
54
+				} else { //除了500都会走以下操作
55
+					return uni.showToast({
56
+						title: res.data.message,
57
+						icon: 'none'
58
+					})
59
+				}
60
+			},
61
+			// 这里的接口请求,如果出现问题就输出接口请求失败 
62
+			fail: (err) => {
63
+				reject(err)
64
+			}
65
+		})
66
+	})
67
+}

+ 59 - 0
commit/shop.js

@@ -0,0 +1,59 @@
1
+import { 
2
+ myRequest 
3
+} from './request.js'
4
+// 店铺信息头
5
+export function selectMerchant(data) { 
6
+ return myRequest({ 
7
+  url: 'merchant_service/cashierService/selectMerchant', 
8
+  method: 'post', 
9
+  data 
10
+ }) 
11
+} 
12
+// 今日昨日收益
13
+export function selectMerchantOrder(data) { 
14
+ return myRequest({ 
15
+  url: 'merchant_service/cashierService/selectMerchantOrder', 
16
+  method: 'post', 
17
+  data 
18
+ }) 
19
+} 
20
+// 今日昨日收益
21
+export function payUserList(data) { 
22
+ return myRequest({ 
23
+  url: 'merchant_service/cashierService/payUserList', 
24
+  method: 'post', 
25
+  data 
26
+ }) 
27
+} 
28
+// 消费分页面
29
+export function merchantConsumption(data) { 
30
+ return myRequest({ 
31
+  url: 'merchant_service/cashierService/merchantConsumption', 
32
+  method: 'post', 
33
+  data 
34
+ }) 
35
+} 
36
+// 开通消费分接口
37
+export function updateConsumptionScore(data) { 
38
+ return myRequest({ 
39
+  url: 'merchant_service/cashierService/updateConsumptionScore', 
40
+  method: 'post', 
41
+  data 
42
+ }) 
43
+} 
44
+// 消费分明细
45
+export function selectMerchantConsumption(data) { 
46
+ return myRequest({ 
47
+  url: 'merchant_service/cashierService/selectMerchantConsumption', 
48
+  method: 'post', 
49
+  data 
50
+ }) 
51
+} 
52
+// 收款二维码隐藏显示
53
+export function queryByKey(data) { 
54
+ return myRequest({ 
55
+  url: 'system_service/sysconfig/wxQueryByKey', 
56
+  method: 'get', 
57
+  data 
58
+ }) 
59
+} 

+ 319 - 0
constant/emoji.js

@@ -0,0 +1,319 @@
1
+export const emojis = [
2
+  '😀',
3
+  '😃',
4
+  '😄',
5
+  '😁',
6
+  '😆',
7
+  '😅',
8
+  '🤣',
9
+  '😂',
10
+  '🙂',
11
+  '🙃',
12
+  '😉',
13
+  '😊',
14
+  '😇',
15
+  '😍',
16
+  '🤩',
17
+  '😘',
18
+  '😗',
19
+  '😚',
20
+  '😙',
21
+  '😋',
22
+  '😛',
23
+  '😜',
24
+  '🤪',
25
+  '😝',
26
+  '🤑',
27
+  '🤗',
28
+  '🤭',
29
+  '🤫',
30
+  '🤔',
31
+  '🤐',
32
+  '🤨',
33
+  '😐',
34
+  '😑',
35
+  '😶',
36
+  '😏',
37
+  '😒',
38
+  '🙄',
39
+  '😬',
40
+  '🤥',
41
+  '😌',
42
+  '😔',
43
+  '😪',
44
+  '🤤',
45
+  '😴',
46
+  '😷',
47
+  '🤒',
48
+  '🤕',
49
+  '🤢',
50
+  '🤮',
51
+  '🤧',
52
+  '😵',
53
+  '🤯',
54
+  '🤠',
55
+  '😎',
56
+  '🤓',
57
+  '🧐',
58
+  '😕',
59
+  '😟',
60
+  '🙁',
61
+  '😮',
62
+  '😯',
63
+  '😲',
64
+  '😳',
65
+  '😦',
66
+  '😧',
67
+  '😨',
68
+  '😰',
69
+  '😥',
70
+  '😢',
71
+  '😭',
72
+  '😱',
73
+  '😖',
74
+  '😣',
75
+  '😞',
76
+  '😓',
77
+  '😩',
78
+  '😫',
79
+  '😤',
80
+  '😡',
81
+  '😠',
82
+  '🤬',
83
+  '😈',
84
+  '👿',
85
+  '💀',
86
+  '💩',
87
+  '🤡',
88
+  '👹',
89
+  '👺',
90
+  '👻',
91
+  '👽',
92
+  '👾',
93
+  '🤖',
94
+  '😺',
95
+  '😸',
96
+  '😹',
97
+  '😻',
98
+  '😼',
99
+  '😽',
100
+  '🙀',
101
+  '😿',
102
+  '😾',
103
+  '💋',
104
+  '👋',
105
+  '🤚',
106
+  '🖐',
107
+  '✋',
108
+  '🖖',
109
+  '👌',
110
+  '🤞',
111
+  '🤟',
112
+  '🤘',
113
+  '🤙',
114
+  '👈',
115
+  '👉',
116
+  '👆',
117
+  '🖕',
118
+  '👇',
119
+  '👍',
120
+  '👎',
121
+  '✊',
122
+  '👊',
123
+  '🤛',
124
+  '🤜',
125
+  '👏',
126
+  '🙌',
127
+  '👐',
128
+  '🤲',
129
+  '🤝',
130
+  '🙏',
131
+  '💅',
132
+  '🤳',
133
+  '💪',
134
+  '👂',
135
+  '👃',
136
+  '🧠',
137
+  '👀',
138
+  '👁',
139
+  '👅',
140
+  '👄',
141
+  '👶',
142
+  '🧒',
143
+  '👦',
144
+  '👧',
145
+  '🧑',
146
+  '👱',
147
+  '👨',
148
+  '🧔',
149
+  '👱‍',
150
+  '👨‍',
151
+  '👨‍',
152
+  '👩',
153
+  '👱‍',
154
+  '👩‍',
155
+  '👩‍',
156
+  '👩‍',
157
+  '👩‍',
158
+  '🧓',
159
+  '👴',
160
+  '👵',
161
+  '🙍',
162
+  '🙅',
163
+  '🙆',
164
+  '💁',
165
+  '🙋',
166
+  '🙇',
167
+  '🙇‍',
168
+  '🙇‍',
169
+  '🤦',
170
+  '🤷',
171
+  '🤷‍',
172
+  '🤷‍',
173
+  '👨‍⚕️',
174
+  '👩‍⚕️',
175
+  '👨‍🎓',
176
+  '👩‍🎓',
177
+  '👨‍🏫',
178
+  '👩‍🏫',
179
+  '👨‍⚖️',
180
+  '👩‍⚖️',
181
+  '👨‍🌾',
182
+  '👩‍🌾',
183
+  '👨‍🍳',
184
+  '👩‍🍳',
185
+  '👨‍🔧',
186
+  '👩‍🔧',
187
+  '👨‍🏭',
188
+  '👩‍🏭',
189
+  '👨‍💼',
190
+  '👩‍💼',
191
+  '👨‍🔬',
192
+  '👩‍🔬',
193
+  '👨‍💻',
194
+  '👩‍💻',
195
+  '👨‍🎤',
196
+  '👩‍🎤',
197
+  '👨‍🎨',
198
+  '👩‍🎨',
199
+  '👨‍✈️',
200
+  '👩‍✈️',
201
+  '👨‍🚀',
202
+  '👩‍🚀',
203
+  '👨‍🚒',
204
+  '👩‍🚒',
205
+  '👮',
206
+  '👮‍♂️',
207
+  '👮‍♀️',
208
+  '🕵',
209
+  '🕵️‍♂️',
210
+  '🕵️‍♀️',
211
+  '💂',
212
+  '💂‍',
213
+  '💂‍',
214
+  '👷',
215
+  '👷‍',
216
+  '👷‍',
217
+  '🤴',
218
+  '👸',
219
+  '👳',
220
+  '👳‍',
221
+  '👳‍',
222
+  '👲',
223
+  '🧕',
224
+  '🤵',
225
+  '👰',
226
+  '🤰',
227
+  '🤱',
228
+  '👼',
229
+  '🎅',
230
+  '🤶',
231
+  '🧙',
232
+  '🧚',
233
+  '🧛',
234
+  '🧜',
235
+  '🧝',
236
+  '🧞',
237
+  '🧟',
238
+  '💆',
239
+  '💇',
240
+  '🚶',
241
+  '🏃',
242
+  '💃',
243
+  '🕺',
244
+  '🕴',
245
+  '👯',
246
+  '🧖',
247
+  '🧖‍',
248
+  '🧖‍',
249
+  '🧘',
250
+  '👭',
251
+  '👫',
252
+  '👬',
253
+  '💏',
254
+  '👨‍',
255
+  '👩‍',
256
+  '💑',
257
+  '👨‍',
258
+  '👩‍',
259
+  '👪',
260
+  '👨‍👩‍👦',
261
+  '👨‍👩‍👧',
262
+  '👨‍👩‍👧‍👦',
263
+  '👨‍👩‍👦‍👦',
264
+  '👨‍👩‍👧‍👧',
265
+  '👨‍👨‍👦',
266
+  '👨‍👨‍👧',
267
+  '👨‍👨‍👧‍👦',
268
+  '👩‍👩‍👦',
269
+  '👩‍👩‍👧',
270
+  '👩‍👩‍👧‍👦',
271
+  '👩‍👩‍👦‍👦',
272
+  '👩‍👩‍👧‍👧',
273
+  '👨‍👦',
274
+  '👨‍👦‍👦',
275
+  '👨‍👧',
276
+  '👨‍👧‍👦',
277
+  '👨‍👧‍👧',
278
+  '👩‍👦',
279
+  '👩‍👦‍👦',
280
+  '👩‍👧',
281
+  '👩‍👧‍👦',
282
+  '👩‍👧‍👧',
283
+  '🗣',
284
+  '👤',
285
+  '👥',
286
+  '👣',
287
+  '🌂',
288
+  '☂',
289
+  '👓',
290
+  '🕶',
291
+  '👔',
292
+  '👕',
293
+  '👖',
294
+  '🧣',
295
+  '🧤',
296
+  '🧥',
297
+  '🧦',
298
+  '👗',
299
+  '👘',
300
+  '👙',
301
+  '👚',
302
+  '👛',
303
+  '👜',
304
+  '👝',
305
+  '🎒',
306
+  '👞',
307
+  '👟',
308
+  '👠',
309
+  '👡',
310
+  '👢',
311
+  '👑',
312
+  '👒',
313
+  '🎩',
314
+  '🎓',
315
+  '🧢',
316
+  '💄',
317
+  '💍',
318
+  '💼',
319
+];

+ 33 - 0
constant/index.js

@@ -0,0 +1,33 @@
1
+import * as emoji from './emoji';
2
+export { emoji };
3
+//群成员页面为复用页面,定义三种展示形态
4
+export const GROUP_MEMEBERS_SHOW_TYPE = {
5
+  READ_ONLY: 1, //只读
6
+  TRANSFER_OWNER: 2, //转让群主
7
+  ADD_NEW_MEMBER: 3, //新增群成员
8
+  DEL_MEMBER: 4, //删除群成员
9
+};
10
+//个人信息编辑类型
11
+export const PERSONAL_INFO_EDIT_TYPE = {
12
+  NICKNAME: 1,
13
+  SIGN: 2,
14
+};
15
+//uni.$emit 事件名称
16
+export const EVENT_BUS_NAME = {
17
+  EASEIM_MESSAGE_COLLECTION_UPDATE: 'easeim-message-collection-update',
18
+  EASEIM_MESSAGE_COLLECTION_DELETE: 'easeim-message-collection-delete',
19
+  EASEIM_MESSAGE_COLLECTION_MODIFY: 'easeim-message-collection-modify',
20
+};
21
+/* 录音相关 */
22
+export const RECORD_STATUS = {
23
+  SHOW: 0,
24
+  HIDE: 1,
25
+  HOLD: 2,
26
+  SWIPE: 3,
27
+  RELEASE: 4,
28
+};
29
+export const RECOED_DESC = {
30
+  0: '长按开始录音',
31
+  2: '向上滑动取消',
32
+  3: '松开手取消',
33
+};

+ 320 - 0
emChat/emChatContainer/emChatNavbar/index.vue

@@ -0,0 +1,320 @@
1
+<template>
2
+  <!-- #ifdef H5 || APP-PLUS -->
3
+  <u-navbar :placeholder="true">
4
+    <u-icon
5
+      slot="left"
6
+      size="20"
7
+      name="arrow-left"
8
+      @click="onArrowLeftBackClick"
9
+    ></u-icon>
10
+    <!-- <u-avatar
11
+      slot="left"
12
+      size="32"
13
+      shape="square"
14
+      :src="navbarAvatar"
15
+    ></u-avatar> -->
16
+    <view slot="left" class="chat_name">
17
+      <text v-show="!chattingTypingStatus" class="chat_name_text">
18
+        {{ navigatorName }}
19
+      </text>
20
+      <text v-show="chattingTypingStatus" class="chat_name_text"
21
+        >对方正在输入...</text
22
+      >
23
+      <text class="presence_status_text">{{ presenceStatus }}</text>
24
+    </view>
25
+
26
+    <u-icon
27
+      slot="right"
28
+      @click="onRightIconClick"
29
+      size="36"
30
+      name="/static/images/new_ui/more_icon.png"
31
+    ></u-icon>
32
+  </u-navbar>
33
+  <!-- #endif -->
34
+  <!-- #ifndef H5 || APP-PLUS-->
35
+<!--  <u-navbar :placeholder="true">
36
+    <view class="u-nav-slot" slot="left">
37
+      <u-icon
38
+        slot="left"
39
+        size="20"
40
+        name="arrow-left"
41
+        @click="onArrowLeftBackClick"
42
+      ></u-icon>
43
+     <u-avatar
44
+        slot="left"
45
+        size="32"
46
+        shape="square"
47
+        :src="navbarAvatar"
48
+      ></u-avatar>
49
+      <view slot="center" class="chat_name">
50
+        <text v-show="!chattingTypingStatus" class="chat_name_text">
51
+          客服11
52
+        </text>
53
+       <text v-show="chattingTypingStatus" class="chat_name_text"
54
+          >对方正在输入...</text
55
+        >
56
+        <text class="presence_status_text">{{ presenceStatus }}</text>
57
+      </view>
58
+      <u-line
59
+        direction="column"
60
+        :hairline="false"
61
+        length="12"
62
+        margin="0 5px"
63
+      ></u-line>
64
+      <u-icon
65
+        @click="onRightIconClick"
66
+        size="36"
67
+        name="/static/images/new_ui/more_icon.png"
68
+      ></u-icon>
69
+    </view>
70
+  </u-navbar> -->
71
+  
72
+  <u-navbar :placeholder="true">
73
+    <view class="u-nav-slot" slot="left">
74
+      <u-icon
75
+        slot="left"
76
+        size="20"
77
+        name="arrow-left"
78
+        @click="onArrowLeftBackClick"
79
+      ></u-icon>
80
+    </view>
81
+	<view slot="center">
82
+		<view slot="center" class="chat_name">
83
+		  <text v-show="!chattingTypingStatus" class="chat_name_text">
84
+		    客服
85
+		  </text>
86
+		 <text v-show="chattingTypingStatus" class="chat_name_text"
87
+		    >对方正在输入...</text
88
+		  >
89
+		  <text class="presence_status_text">{{ presenceStatus }}</text>
90
+		</view>
91
+	</view>
92
+  </u-navbar>
93
+  <!-- #endif -->
94
+</template>
95
+
96
+<script>
97
+import { CHAT_TYPE } from "@/EaseIM/constant";
98
+export default {
99
+  props: {
100
+    targetId: {
101
+      type: String,
102
+      default: "",
103
+    },
104
+    chatType: {
105
+      type: String,
106
+      default: CHAT_TYPE.SINGLE_CHAT,
107
+    },
108
+  },
109
+  data() {
110
+    return {
111
+      // defaultAvatar: "/static/images/new_ui/defaultAvatar.png",
112
+	  nowConversationIntem:uni.getStorageSync('nowConversationIntem'),
113
+      defaultAvatar: "https://app.bjtdba.com/uploads/logo.jpg",
114
+      defaultGroupAvatar: "/static/images/new_ui/defaultGroupAvatar.png",
115
+    };
116
+  },
117
+ //  onHide() {
118
+	// console.log('页面消失');
119
+ //  	uni.removeStorageSync('nowConversationIntem');
120
+ //  },
121
+  computed: {
122
+    chattingId() {
123
+		console.log('chattingId',this.$store.getters.chattingId);
124
+      return this.$store.getters.chattingId;
125
+	  
126
+    },
127
+    loginUserPresence() {
128
+      return this.$store.state.ContactsStore.subscribeStatusInfoMap;
129
+    },
130
+    chattingChatType() {
131
+      return this.$store.getters.chattingChatType;
132
+    },
133
+    chattingTypingStatus() {
134
+      return this.$store.getters.chattingTypingStatus;
135
+    },
136
+    friendUserInfoCollection() {
137
+      return this.$store.getters.friendUserInfoCollection;
138
+    },
139
+    joinedGroupList() {
140
+      return this.$store.getters.joinedGroupList;
141
+    },
142
+    // navbarAvatar() {
143
+    //   if (this.chattingChatType === CHAT_TYPE.SINGLE_CHAT) {
144
+    //     const userId = this.chattingId;
145
+    //     if (
146
+    //       uni.getStorageSync('nowConversationIntem')&&
147
+		  // uni.getStorageSync('nowConversationIntem').avatarurl
148
+    //     ) {
149
+    //       return (
150
+    //         uni.getStorageSync('nowConversationIntem').avatarurl
151
+    //       );
152
+    //     } else {
153
+    //       return this.defaultAvatar;
154
+    //     }
155
+    //   }
156
+    //   if (this.chattingChatType === CHAT_TYPE.GROUP_CHAT) {
157
+    //     return this.defaultGroupAvatar;
158
+    //   }
159
+    // },
160
+    // navigatorName() {
161
+    //   if (this.chattingChatType === CHAT_TYPE.SINGLE_CHAT) {
162
+    //     const userId = this.chattingId;
163
+    //     if (
164
+    //       uni.getStorageSync('nowConversationIntem') &&
165
+    //       uni.getStorageSync('nowConversationIntem').nickname
166
+    //     ) {
167
+         
168
+		  // return uni.getStorageSync('nowConversationIntem').nickname;
169
+    //     } else {
170
+          
171
+    //       return uni.getStorageSync('nowConversationIntem').nickname;
172
+    //     }
173
+    //   }
174
+    //   if (this.chattingChatType === CHAT_TYPE.GROUP_CHAT) {
175
+    //     const group = this.joinedGroupList.find(
176
+    //       (group) => group.groupId == this.chattingId
177
+    //     );
178
+    //     if (group) {
179
+    //       return group.groupName || group.groupId;
180
+    //     } else {
181
+    //       return this.chattingId;
182
+    //     }
183
+    //   }
184
+    // },
185
+    presenceStatus() {
186
+      const presenceInfo = this.loginUserPresence[this.chattingId];
187
+      if (presenceInfo) {
188
+        const statusDetails = presenceInfo.statusDetails;
189
+        let isOnline = false;
190
+
191
+        for (const item of statusDetails) {
192
+          if (item.status === 1) {
193
+            isOnline = true;
194
+            break;
195
+          }
196
+        }
197
+
198
+        if (isOnline) {
199
+          if (presenceInfo.ext) {
200
+            switch (presenceInfo.ext) {
201
+              case "Cloaking":
202
+                return "请勿打扰";
203
+              case "Online":
204
+                return "在线";
205
+              case "Leave":
206
+                return "离开";
207
+              case "Offline":
208
+                return "离线";
209
+              default:
210
+                return presenceInfo.ext;
211
+            }
212
+          } else {
213
+            return "在线";
214
+          }
215
+        } else {
216
+          return "离线";
217
+        }
218
+      }
219
+    },
220
+  },
221
+  methods: {
222
+    onArrowLeftBackClick() {
223
+      uni.navigateBack();
224
+    },
225
+    onRightIconClick() {
226
+      if (this.chatType === CHAT_TYPE.SINGLE_CHAT) {
227
+        this.entryFriendDetail();
228
+      }
229
+      if (this.chatType === CHAT_TYPE.GROUP_CHAT) {
230
+        this.entryGroupDetail();
231
+      }
232
+    },
233
+    //前往好友详情页面
234
+    entryFriendDetail() {
235
+      const friendId = this.targetId;
236
+      uni.navigateTo({
237
+        url: `../contactsDetail/index?userId=${friendId}`,
238
+      });
239
+    },
240
+    //前往群组详情页面
241
+    entryGroupDetail() {
242
+      const groupId = this.targetId;
243
+      if (groupId) {
244
+        uni.navigateTo({
245
+          url: "../groupDetail/index?groupId=" + groupId,
246
+        });
247
+      }
248
+    },
249
+  },
250
+};
251
+</script>
252
+
253
+<style scoped>
254
+.u-nav-slot {
255
+  display: flex;
256
+  align-items: center;
257
+  justify-content: space-between;
258
+  border-width: 0.5px;
259
+  border-radius: 100px;
260
+  border-color: #ccc;
261
+  padding: 3px 7px;
262
+  /* opacity: 0.8; */
263
+}
264
+.chat_name {
265
+  display: flex;
266
+  flex-direction: column;
267
+  justify-content: flex-start;
268
+  /* align-items: center; */
269
+  width: 150px;
270
+  height: 36px;
271
+  margin-left: 10px;
272
+}
273
+.chat_name_text {
274
+  /* Frame 28 */
275
+
276
+  /* Auto layout */
277
+  padding: 0px;
278
+  width: 128px;
279
+  height: 22px;
280
+
281
+  /* 简体中文/次级标题/中 */
282
+  font-family: "PingFang SC";
283
+  font-style: normal;
284
+  font-weight: 400;
285
+  font-size: 16px;
286
+  line-height: 22px;
287
+  /* identical to box height, or 138% */
288
+
289
+  /* Neutral/1 */
290
+  color: #171a1c;
291
+
292
+  /* Inside auto layout */
293
+  flex: none;
294
+  order: 0;
295
+  flex-grow: 0;
296
+  overflow: hidden;
297
+  white-space: nowrap;
298
+  text-overflow: ellipsis;
299
+  text-align: center;
300
+}
301
+.presence_status_text {
302
+  /* Subtitle */
303
+
304
+  width: 100px;
305
+  height: 14px;
306
+  left: 40px;
307
+  top: 22px;
308
+
309
+  /* 简体中文/文本/超小 */
310
+  font-family: "PingFang SC";
311
+  font-style: normal;
312
+  font-weight: 400;
313
+  font-size: 11px;
314
+  line-height: 14px;
315
+  /* identical to box height, or 127% */
316
+
317
+  /* Neutral/5 */
318
+  color: #75828a;
319
+}
320
+</style>

+ 238 - 0
emChat/emChatContainer/emGrayMessageContainer/index.vue

@@ -0,0 +1,238 @@
1
+<template>
2
+  <view class="message_gray_item">
3
+    <!-- 撤回类型通知消息 -->
4
+    <template
5
+      v-if="msgBody.type !== MESSAGE_TYPE.GRAY_INFORM && msgType !== ''"
6
+    >
7
+      <text class="message_time">{{ messageTime(msgBody.time) }}</text>
8
+      <view
9
+        v-if="msgType === MESSAGE_STATUS.RECALL"
10
+        class="recall_msg_item_container"
11
+      >
12
+        <view v-if="isSelf">
13
+          <text>你撤回了一条消息</text>
14
+          <text
15
+            class="re_edit_text"
16
+            v-if="msgBody.type === MESSAGE_TYPE.TEXT"
17
+            @click="callReEditTextMessage"
18
+            >重新编辑</text
19
+          >
20
+        </view>
21
+        <view v-else>
22
+          <text>“{{ msgBody.from }}”</text>
23
+          <text>撤回了一条消息</text>
24
+        </view>
25
+      </view>
26
+    </template>
27
+    <!-- 单聊好友关系变更类型的通知消息 -->
28
+    <template
29
+      v-if="
30
+        msgBody.chatType === CHAT_TYPE.SINGLE_CHAT &&
31
+        GRAY_INFORM_MAP_SINGLE_TEXT[msgBody.grayInformType]
32
+      "
33
+    >
34
+      <text class="message_time">{{ messageTime(msgBody.time) }}</text>
35
+      <view class="common_msg_item_container">
36
+        <text>{{ replaceStr }}</text>
37
+      </view>
38
+    </template>
39
+    <!-- 群组事件系统通知 -->
40
+    <template
41
+      v-if="
42
+        msgBody.chatType === CHAT_TYPE.GROUP_CHAT &&
43
+        GRAY_INFORM_MAP_GROUP_TEXT[msgBody.grayInformType]
44
+      "
45
+    >
46
+      <text class="message_time">{{ messageTime(msgBody.time) }}</text>
47
+      <view class="common_msg_item_container">
48
+        <text>{{ replaceStr }}</text>
49
+      </view>
50
+    </template>
51
+  </view>
52
+</template>
53
+
54
+<script>
55
+import {
56
+  CHAT_TYPE,
57
+  MESSAGE_STATUS,
58
+  MESSAGE_TYPE,
59
+  GRAY_INFORM_TYPE_SINGLE,
60
+  GRAY_INFORM_MAP_SINGLE_TEXT,
61
+  GRAY_INFORM_TEMPLATE_NAME,
62
+  GRAY_INFORM_TYPE_GROUP,
63
+  GRAY_INFORM_MAP_GROUP_TEXT,
64
+} from '@/EaseIM/constant';
65
+export default {
66
+  props: {
67
+    msgBody: {
68
+      type: Object,
69
+      default: () => ({}),
70
+      required: true,
71
+    },
72
+  },
73
+  data() {
74
+    return {
75
+      CHAT_TYPE,
76
+      MESSAGE_STATUS,
77
+      MESSAGE_TYPE,
78
+      GRAY_INFORM_TYPE_SINGLE,
79
+      GRAY_INFORM_MAP_SINGLE_TEXT,
80
+      GRAY_INFORM_TEMPLATE_NAME,
81
+      GRAY_INFORM_TYPE_GROUP,
82
+      GRAY_INFORM_MAP_GROUP_TEXT,
83
+    };
84
+  },
85
+  computed: {
86
+    isSelf() {
87
+      const { from } = this.msgBody;
88
+      return (
89
+        from === this.$store.state.LoginStore.loginUserBaseInfos.loginUserId
90
+      );
91
+    },
92
+    messageTime() {
93
+      return (time) => {
94
+        return this.$u.timeFrom(time);
95
+      };
96
+    },
97
+    messageCollectionStatus() {
98
+      return this.$store.getters.messageStatusCollection;
99
+    },
100
+    friendUserInfoCollection() {
101
+      return this.$store.getters.friendUserInfoCollection;
102
+    },
103
+    groupMembersProfileData() {
104
+      return this.$store.getters.groupMembersProfile;
105
+    },
106
+    // 灰色通知消息类型
107
+    msgType() {
108
+      const msgBody = this.msgBody;
109
+      let msgStatus = '';
110
+      if (msgBody.id) {
111
+        if (
112
+          this.messageCollectionStatus &&
113
+          this.messageCollectionStatus[msgBody.id] === MESSAGE_STATUS.DELETE
114
+        ) {
115
+          msgStatus = MESSAGE_STATUS.DELETE;
116
+        } else if (
117
+          this.messageCollectionStatus &&
118
+          this.messageCollectionStatus[msgBody.id] === MESSAGE_STATUS.RECALL
119
+        ) {
120
+          msgStatus = MESSAGE_STATUS.RECALL;
121
+        }
122
+      }
123
+      return msgStatus;
124
+    },
125
+    //将灰色系统通知包含昵称模版的进一步替换替换字符串[XXX]为用户昵称或ID
126
+    replaceStr() {
127
+      const { chatType, grayInformType, from, to } = this.msgBody;
128
+      if (chatType === CHAT_TYPE.SINGLE_CHAT) {
129
+        let str = GRAY_INFORM_MAP_SINGLE_TEXT[grayInformType];
130
+        if (str) {
131
+          return (str = str.replace(
132
+            GRAY_INFORM_TEMPLATE_NAME.USER,
133
+            this.getFriendNickname(from)
134
+          ));
135
+        }
136
+        return str;
137
+      }
138
+      if (chatType === CHAT_TYPE.GROUP_CHAT) {
139
+        const groupId = to;
140
+        let str = GRAY_INFORM_MAP_GROUP_TEXT[grayInformType];
141
+        if (str) {
142
+          if (str.includes(GRAY_INFORM_TEMPLATE_NAME.GROUP_USER_FROM)) {
143
+            return (str = str.replace(
144
+              GRAY_INFORM_TEMPLATE_NAME.GROUP_USER_FROM,
145
+              this.getMemberGroupNickname(from, groupId)
146
+            ));
147
+          } else {
148
+            return str;
149
+          }
150
+        }
151
+        return str;
152
+      }
153
+    },
154
+  },
155
+  methods: {
156
+    callReEditTextMessage() {
157
+      const { msg } = this.msgBody;
158
+      if (msg) {
159
+        this.$emit('reEditTextMessage', msg);
160
+      }
161
+    },
162
+    getFriendNickname(userId) {
163
+      if (
164
+        this.friendUserInfoCollection[userId] &&
165
+        this.friendUserInfoCollection[userId]?.nickname
166
+      ) {
167
+        return `“${this.friendUserInfoCollection[userId].nickname}”`;
168
+      } else {
169
+        return `“${userId}”`;
170
+      }
171
+    },
172
+    //获取用户对应群组昵称
173
+    getMemberGroupNickname(userId, groupId) {
174
+      const groupMemberData = this.groupMembersProfileData[groupId];
175
+      console.log(groupMemberData);
176
+      let nickname = '';
177
+      if (groupMemberData) {
178
+        nickname =
179
+          groupMemberData[userId]?.nickName ||
180
+          groupMemberData[userId]?.nickname ||
181
+          userId;
182
+        return `“${nickname}”`;
183
+      } else {
184
+        return `“${userId}”`;
185
+      }
186
+    },
187
+  },
188
+};
189
+</script>
190
+
191
+<style scoped>
192
+.message_gray_item {
193
+  width: 100%;
194
+}
195
+.recall_msg_item_container,
196
+.common_msg_item_container {
197
+  width: 100%;
198
+  height: 16px;
199
+  text-align: center;
200
+  /* 简体中文/标签/小 */
201
+  font-family: 'PingFang SC';
202
+  font-style: normal;
203
+  font-weight: 400;
204
+  font-size: 12px;
205
+  line-height: 16px;
206
+  /* identical to box height, or 133% */
207
+
208
+  /* Neutral/5 */
209
+  color: #75828a;
210
+
211
+  /* Inside auto layout */
212
+  flex: none;
213
+  order: 1;
214
+  flex-grow: 0;
215
+}
216
+.re_edit_text {
217
+  color: #3e91fa;
218
+  font-size: 13px;
219
+}
220
+.message_time {
221
+  display: flex;
222
+  flex-direction: row;
223
+  align-items: center;
224
+  justify-content: center;
225
+  width: 100%;
226
+  height: 16px;
227
+  /* Alphabet/Body/Small */
228
+  font-family: 'SF Pro';
229
+  font-style: normal;
230
+  font-weight: 400;
231
+  font-size: 12px;
232
+  line-height: 16px;
233
+  /* identical to box height, or 133% */
234
+  /* Neutral/7 */
235
+  color: #acb4b9;
236
+  margin: 10px 0 5px 0;
237
+}
238
+</style>

+ 55 - 0
emChat/emChatContainer/emInputBarContainer/editMessageContainer/index.vue

@@ -0,0 +1,55 @@
1
+<template>
2
+  <view class="edit_message_container">
3
+    <view class="edit_message_container_left">
4
+      <u-icon class="edit_message_container_left_icon"></u-icon>
5
+      <text class="edit_message_container_left_text">正在编辑...</text>
6
+    </view>
7
+    <view class="edit_message_container_right">
8
+      <u-icon
9
+        @click="$emit('onShowEditMessageContainer')"
10
+        class="edit_message_container_right_icon"
11
+        name="/static/images/new_ui/message/replyMessage/close_icon.png"
12
+      ></u-icon>
13
+    </view>
14
+  </view>
15
+</template>
16
+
17
+<script>
18
+export default {};
19
+</script>
20
+
21
+<style scoped>
22
+.edit_message_container {
23
+  width: 100%;
24
+  height: 30px;
25
+  background-color: #eff0f1;
26
+  box-sizing: border-box;
27
+  padding: 0 8px;
28
+  display: flex;
29
+  flex-direction: row;
30
+  align-items: center;
31
+  justify-content: space-between;
32
+}
33
+.edit_message_container_left_text {
34
+  /* Nickname */
35
+
36
+  width: 36px;
37
+  height: 16px;
38
+
39
+  /* 简体中文/标签/小 */
40
+  font-family: 'PingFang SC';
41
+  font-style: normal;
42
+  font-weight: 400;
43
+  font-size: 12px;
44
+  line-height: 16px;
45
+  /* identical to box height, or 133% */
46
+
47
+  /* Neutral Special/5 */
48
+  color: #5270ad;
49
+
50
+  /* Inside auto layout */
51
+  flex: none;
52
+  order: 1;
53
+  flex-grow: 0;
54
+}
55
+</style>

+ 50 - 0
emChat/emChatContainer/emInputBarContainer/emojiPickerContainer/index.vue

@@ -0,0 +1,50 @@
1
+<template>
2
+  <view>
3
+    <scroll-view scroll-y="true" class="scroll-emoji-box">
4
+      <view
5
+        class="emoji-item"
6
+        v-for="(item, index) in emoji.emojis"
7
+        :key="index"
8
+        @click="handleClick(item)"
9
+        >{{ item }}</view
10
+      >
11
+    </scroll-view>
12
+  </view>
13
+</template>
14
+
15
+<script>
16
+import { emoji } from '@/constant';
17
+export default {
18
+  data() {
19
+    return {
20
+      emoji,
21
+    };
22
+  },
23
+  methods: {
24
+    handleClick(emoji) {
25
+      this.$emit('appendEmojiIcon', emoji);
26
+    },
27
+  },
28
+};
29
+</script>
30
+
31
+<style scoped>
32
+.scroll-emoji-box {
33
+  height: 200px;
34
+  width: 100%;
35
+  display: flex;
36
+  flex-direction: row;
37
+  flex-wrap: wrap;
38
+  justify-content: space-between;
39
+  align-items: center;
40
+}
41
+.emoji-item {
42
+  width: 10%;
43
+  height: 37px;
44
+  font-size: 26px;
45
+  display: inline-block;
46
+  text-align: center;
47
+  line-height: 36px;
48
+  box-sizing: border-box;
49
+}
50
+</style>

+ 481 - 0
emChat/emChatContainer/emInputBarContainer/index.vue

@@ -0,0 +1,481 @@
1
+<template>
2
+  <view class="chat-input-bar-container">
3
+    <reply-message-container
4
+      ref="replyMessageContainerComps"
5
+      v-show="isShowReplyMessageContainer"
6
+      @onShowReplyMessageContainer="onShowReplyMessageContainer"
7
+      :checkedPopupMsgBody="checkedPopupMsgBody"
8
+    />
9
+    <edit-message-container
10
+      v-show="isShowEditMessageContainer"
11
+      @onShowEditMessageContainer="onShowEditMessageContainer"
12
+    />
13
+    <view class="chat-input-bar">
14
+      <!-- <template v-if="!isShowEditMessageContainer">
15
+        <image
16
+          class="chat-audio-icon-container"
17
+          @click="onShowAudioMessageContainer"
18
+          src="/static/images/new_ui/inputbar/audio_click_icon.png"
19
+        ></image>
20
+      </template> -->
21
+      <!-- 文本输入input -->
22
+      <view class="chat-input-container">
23
+        <input
24
+          class="chat-input"
25
+          v-model="msgContent"
26
+          :cursor-spacing="cursorSpacing"
27
+          confirm-type="send"
28
+          type="text"
29
+          :always-embed="true"
30
+          :adjust-position="false"
31
+          @focus="onInputFocus"
32
+          @blur="onInputBlur"
33
+          @confirm="sendTextMessage"
34
+          @input="onInput"
35
+        />
36
+      </view>
37
+      <template v-if="isShowEditMessageContainer">
38
+        <image
39
+          class="chat-emoji-icon-container"
40
+          @click="actionModifyMessage"
41
+          src="/static/images/new_ui/message/send_edit_msg_icon.png"
42
+        ></image>
43
+      </template>
44
+    </view>
45
+    <!-- 输入框底部功能栏 -->
46
+    <view class="chat-input-bottom-bar">
47
+      <!-- 语音 -->
48
+     <!-- <view class="input-bottom-bar-icon" @click="onShowAudioMessageContainer">
49
+        <image
50
+          src="/static/images/new_ui/inputbar/tofeipeng/icons/mic_stroke@2x.png"
51
+        ></image>
52
+      </view> -->
53
+      <!-- 图库 -->
54
+      <view class="input-bottom-bar-icon" @click="openPhotoAlbum('album')">
55
+        <image
56
+          src="/static/images/new_ui/inputbar/tofeipeng/icons/img@2x.png"
57
+        ></image>
58
+      </view>
59
+      <!-- 拍照 -->
60
+      <view class="input-bottom-bar-icon" @click="openPhotoAlbum('camera')">
61
+        <image
62
+          src="/static/images/new_ui/inputbar/tofeipeng/icons/camera@2x.png"
63
+        ></image>
64
+      </view>
65
+      <!-- 文件 -->
66
+      <!-- <view class="input-bottom-bar-icon">
67
+        <image
68
+          src="/static/images/new_ui/inputbar/tofeipeng/icons/folder@2x.png"
69
+        ></image>
70
+      </view> -->
71
+      <!-- <SendFileMessage
72
+        ref="fileComps"
73
+        @onCloseAllShowContainer="onCloseAllShowContainer"
74
+      >
75
+        <view class="input-bottom-bar-icon">
76
+          <image
77
+            src="/static/images/new_ui/inputbar/tofeipeng/icons/folder@2x.png"
78
+          ></image>
79
+        </view>
80
+      </SendFileMessage> -->
81
+      <!-- emoji -->
82
+      <view class="input-bottom-bar-icon" @click="onShowEmojiIconContainer">
83
+        <image
84
+          src="/static/images/new_ui/inputbar/tofeipeng/icons/face@2x.png"
85
+        ></image>
86
+      </view>
87
+      <!-- 更多 -->
88
+     <!-- <view class="input-bottom-bar-icon" @click="onShowMoreFuncContainer">
89
+        <image
90
+          src="/static/images/new_ui/inputbar/tofeipeng/icons/plus_in_circle@2x.png"
91
+        ></image>
92
+      </view> -->
93
+    </view>
94
+    <!-- 音频发送板块 -->
95
+    <view v-if="isShowAudioMessageContainer" class="chat-audio-container">
96
+      <RecordAudioContainer
97
+        @changeRecordAudioContainer="
98
+          () => (isShowAudioMessageContainer = false)
99
+        "
100
+      />
101
+    </view>
102
+    <!-- Emoji Icon选择板块 -->
103
+    <view v-if="isShowEmojiIconContainer" class="chat-emoji-picker-container">
104
+      <EmojiPickerContainer @appendEmojiIcon="appendEmojiIcon" />
105
+    </view>
106
+    <!-- 更多功能选择板块 -->
107
+    <view v-if="isShowMoreFuncContainer" class="chat-more-icon-container">
108
+      <MoreFuncContainer @onCloseAllShowContainer="onCloseAllShowContainer" />
109
+    </view>
110
+    <!-- 发送图片 -->
111
+    <SendImageMessage
112
+      ref="imageComps"
113
+      @onCloseAllShowContainer="onCloseAllShowContainer"
114
+    />
115
+    <!-- 软键盘弹起占位容器 -->
116
+    <view
117
+      class="softkeyword-placeholder"
118
+      :style="{ height: softkeyboardHeight + 'px' }"
119
+    ></view>
120
+    <!-- #ifdef H5 || APP-PLUS -->
121
+    <!-- 小程序的宿主一般自带底部安全区 -->
122
+    <view class="chat-input-bar-bottom-placeholder"></view>
123
+    <!-- #endif -->
124
+  </view>
125
+</template>
126
+
127
+<script>
128
+import { EMClient } from '@/EaseIM';
129
+import { CHAT_TYPE } from '@/EaseIM/constant';
130
+import { emMessages } from '@/EaseIM/emApis';
131
+import RecordAudioContainer from './recordAudioContainer';
132
+import EmojiPickerContainer from './emojiPickerContainer';
133
+import MoreFuncContainer from './moreFuncContainer';
134
+import ReplyMessageContainer from './replyMessageContainer';
135
+import EditMessageContainer from './editMessageContainer';
136
+import SendImageMessage from './inputMessages/sendImageMessage';
137
+import SendFileMessage from './inputMessages/sendFileMessage';
138
+import { MESSAGE_TYPE } from '../../../EaseIM/constant';
139
+const { sendDisplayMessages, sendCommandMessages, modifyDisplayMessages } =
140
+  emMessages();
141
+export default {
142
+  name: 'chat-input-bar',
143
+  components: {
144
+    RecordAudioContainer,
145
+    EmojiPickerContainer,
146
+    MoreFuncContainer,
147
+    ReplyMessageContainer,
148
+    EditMessageContainer,
149
+    SendImageMessage,
150
+    SendFileMessage,
151
+  },
152
+  props: {
153
+    checkedPopupMsgBody: {
154
+      type: Object,
155
+      default: () => ({}),
156
+    },
157
+  },
158
+  data() {
159
+    return {
160
+      msgContent: '',
161
+      cursorSpacing: 20,
162
+      softkeyboardHeight: 0,
163
+      isShowAudioMessageContainer: false,
164
+      isShowEmojiIconContainer: false,
165
+      isShowMoreFuncContainer: false,
166
+      isShowReplyMessageContainer: false,
167
+      isShowEditMessageContainer: false,
168
+      isOpenedTypingBeginStatus: false,
169
+    };
170
+  },
171
+  mounted() {
172
+    // #ifndef APP-NVUE
173
+    const query = uni.createSelectorQuery().in(this);
174
+    query
175
+      .select('.chat-input-bar-bottom-placeholder')
176
+      .boundingClientRect((data) => {
177
+        if (data && data.height) {
178
+          this.cursorSpacing = data.height + 20;
179
+        }
180
+      })
181
+      .exec();
182
+    // #endif
183
+    this.getLocalInputingStatus();
184
+    //监听键盘高度变化
185
+    //监听键盘抬起事件
186
+    uni.onKeyboardHeightChange &&
187
+      uni.onKeyboardHeightChange(this.listenerKeyboardHeight);
188
+  },
189
+  computed: {
190
+    chattingId() {
191
+      return this.$store.getters.chattingId;
192
+    },
193
+    chattingChatType() {
194
+      return this.$store.getters.chattingChatType;
195
+    },
196
+  },
197
+  methods: {
198
+    onInputFocus() {
199
+      // input focus的时候重新设置一下input内容以修复在微信小程序&QQ小程序中input focus后位置偏移的bug
200
+      // #ifdef MP-WEIXIN || MP-QQ
201
+      //   this.msgContent += ' ';
202
+      //   this.$nextTick(() => {
203
+      //     this.msgContent = this.msgContent.slice(0, -1);
204
+      //   });
205
+      // #endif
206
+      this.onCloseAllShowContainer();
207
+    },
208
+    listenerKeyboardHeight(e) {
209
+      if (e.height > 0) {
210
+        this.softkeyboardHeight = e.height;
211
+      } else {
212
+        this.softkeyboardHeight = 0;
213
+      }
214
+    },
215
+    onInputBlur() {
216
+      this.onCloseAllShowContainer();
217
+    },
218
+    onInput() {
219
+      if (
220
+        this.isShowEditMessageContainer === false &&
221
+        this.isOpenedTypingBeginStatus
222
+      ) {
223
+        //节流正在输入中信令发送调用 10s发送一次。
224
+        uni.$u.throttle(this.sendTypingBeginMessage, 10000, true);
225
+      }
226
+    },
227
+    //发送文本消息
228
+    async sendTextMessage() {
229
+      if (this.msgContent.match(/^\s*$/)) {
230
+        uni.showToast({
231
+          title: '请输入内容',
232
+          icon: 'none',
233
+        });
234
+        return;
235
+      }
236
+      let params = {
237
+        // 消息类型。
238
+        type: 'txt',
239
+        // 消息内容。
240
+        msg: this.msgContent,
241
+        // 消息接收方:单聊为对方用户 ID,群聊和聊天室分别为群组 ID 和聊天室 ID。
242
+        to: this.chattingId,
243
+        // 会话类型:单聊、群聊和聊天室分别为 `singleChat`、`groupChat` 和 `chatRoom`。
244
+        chatType: this.chattingChatType,
245
+        ext: {},
246
+      };
247
+      //如果此时为编辑模式则直接return 并调用编辑消息
248
+      if (this.isShowEditMessageContainer) {
249
+        this.actionModifyMessage();
250
+        return;
251
+      }
252
+      //检测是否存在引用消息
253
+      if (this.isShowReplyMessageContainer) {
254
+        params.ext.msgQuote = {};
255
+        params.ext.msgQuote =
256
+          this.$refs.replyMessageContainerComps.extractMessageBodyValue();
257
+        console.log('>>>存在引用', params);
258
+      }
259
+      try {
260
+        const res = await sendDisplayMessages({ ...params });
261
+        console.log('>>>>>文本消息发送成功', res);
262
+      } catch (error) {
263
+        console.log('>>>>>文本消息发送失败', error);
264
+        if (error.type === 508) {
265
+          uni.showToast({
266
+            title: '发送内容不合规',
267
+            icon: 'none',
268
+          });
269
+        } else {
270
+          uni.showToast({
271
+            title: '消息发送失败',
272
+            icon: 'none',
273
+          });
274
+        }
275
+      } finally {
276
+        this.msgContent = '';
277
+        this.onCloseAllShowContainer();
278
+        this.isShowReplyMessageContainer &&
279
+          (this.isShowReplyMessageContainer = false);
280
+      }
281
+    },
282
+    //编辑修改已发送文本消息
283
+    async actionModifyMessage() {
284
+      const editMessageContent = {
285
+        msg: this.msgContent,
286
+        to: this.checkedPopupMsgBody.to,
287
+        id: this.checkedPopupMsgBody.id,
288
+        chatType: CHAT_TYPE.SINGLE_CHAT,
289
+      };
290
+      try {
291
+        const res = await modifyDisplayMessages(editMessageContent);
292
+        console.log('>>>>>>消息修改成功', res);
293
+      } catch (error) {
294
+        console.log('>>>>>>修改消息失败', error);
295
+        if (error?.type === 50) {
296
+          uni.showToast({
297
+            icon: 'none',
298
+            title: '该消息可编辑次数已达上限',
299
+          });
300
+        } else {
301
+          uni.showToast({
302
+            icon: 'none',
303
+            title: '消息编辑失败请稍后重试',
304
+          });
305
+        }
306
+      } finally {
307
+        this.isShowEditMessageContainer = false;
308
+        this.msgContent = '';
309
+      }
310
+    },
311
+    //获取当前键入中开启状态
312
+    getLocalInputingStatus() {
313
+      const res = uni.getStorageSync(`EM_${EMClient.user}_GENNERAL_CONFIG`);
314
+      const { isShowInputingStatus } = res || {};
315
+      this.isOpenedTypingBeginStatus = isShowInputingStatus;
316
+    },
317
+    //发送正在键入command
318
+    async sendTypingBeginMessage() {
319
+      const params = {
320
+        type: MESSAGE_TYPE.CMD,
321
+        // 消息类型。
322
+        action: 'TypingBegin',
323
+        // 消息接收方:单聊为对方用户 ID,群聊和聊天室分别为群组 ID 和聊天室 ID。
324
+        to: this.chattingId,
325
+        // 会话类型:单聊、群聊和聊天室分别为 `singleChat`、`groupChat` 和 `chatRoom`。
326
+        chatType: this.chattingChatType,
327
+      };
328
+      try {
329
+        await sendCommandMessages(params);
330
+      } catch (error) {
331
+        console.log('>>>>>发送失败', error);
332
+      }
333
+    },
334
+    onShowAudioMessageContainer() {
335
+      this.isShowAudioMessageContainer = !this.isShowAudioMessageContainer;
336
+      this.isShowEmojiIconContainer && (this.isShowEmojiIconContainer = false);
337
+      this.isShowMoreFuncContainer && (this.isShowMoreFuncContainer = false);
338
+      this.$emit('resetScrollHeight', 200);
339
+    },
340
+    onShowEmojiIconContainer() {
341
+      this.isShowEmojiIconContainer = !this.isShowEmojiIconContainer;
342
+      this.isShowAudioMessageContainer &&
343
+        (this.isShowAudioMessageContainer = false);
344
+      this.isShowMoreFuncContainer && (this.isShowMoreFuncContainer = false);
345
+    },
346
+    onShowMoreFuncContainer() {
347
+      this.isShowMoreFuncContainer = !this.isShowMoreFuncContainer;
348
+      this.isShowAudioMessageContainer &&
349
+        (this.isShowAudioMessageContainer = false);
350
+      this.isShowEmojiIconContainer && (this.isShowEmojiIconContainer = false);
351
+    },
352
+    onShowReplyMessageContainer() {
353
+      this.isShowReplyMessageContainer = !this.isShowReplyMessageContainer;
354
+      this.isShowEditMessageContainer &&
355
+        (this.isShowEditMessageContainer = false);
356
+      this.onCloseAllShowContainer();
357
+    },
358
+    onShowEditMessageContainer() {
359
+      if (this.isShowEditMessageContainer === false) {
360
+        this.msgContent = this.checkedPopupMsgBody.msg;
361
+      }
362
+      this.isShowEditMessageContainer = !this.isShowEditMessageContainer;
363
+      this.isShowReplyMessageContainer &&
364
+        (this.isShowReplyMessageContainer = false);
365
+      this.onCloseAllShowContainer();
366
+    },
367
+    onCloseAllShowContainer() {
368
+      this.isShowAudioMessageContainer = false;
369
+      this.isShowEmojiIconContainer = false;
370
+      this.isShowMoreFuncContainer = false;
371
+    },
372
+    appendEmojiIcon(emoji) {
373
+      this.msgContent += emoji;
374
+    },
375
+    appendReEditTextMessage(content) {
376
+      if (this.msgContent !== '') {
377
+        this.msgContent += content;
378
+      } else {
379
+        this.msgContent = content;
380
+      }
381
+    },
382
+    openPhotoAlbum(type) {
383
+      if (type === 'camera') {
384
+        this.$refs.imageComps.openCamera();
385
+      } else if (type === 'album') {
386
+        this.$refs.imageComps.openPhotoAlbum();
387
+      }
388
+    },
389
+  },
390
+  beforeDestroy() {
391
+    uni.offKeyboardHeightChange &&
392
+      uni.offKeyboardHeightChange(this.listenerKeyboardHeight);
393
+  },
394
+};
395
+</script>
396
+
397
+<style scoped>
398
+.chat-input-bar {
399
+  display: flex;
400
+  flex-direction: row;
401
+  align-items: center;
402
+  border-top: solid 1px #f5f5f5;
403
+  background-color: #f8f8f8;
404
+  padding: 10rpx 15rpx;
405
+}
406
+.chat-input-bar-bottom-placeholder {
407
+  background-color: #f8f8f8;
408
+  /* #ifndef APP-PLUS */
409
+  height: env(safe-area-inset-bottom);
410
+  /* #endif */
411
+}
412
+.softkeyword-placeholder {
413
+  width: 100%;
414
+  background-color: white;
415
+}
416
+.chat-input-container {
417
+  flex: 1;
418
+  display: flex;
419
+  /* #ifndef APP-NVUE */
420
+  padding: 15rpx;
421
+  /* #endif */
422
+  /* #ifdef APP-NVUE */
423
+  padding: 10rpx;
424
+  /* #endif */
425
+  background-color: white;
426
+  border-radius: 10rpx;
427
+}
428
+.chat-input-bottom-bar {
429
+  width: 100%;
430
+  height: 100rpx;
431
+  display: flex;
432
+  flex-direction: row;
433
+  justify-content: space-between;
434
+  align-items: center;
435
+  padding: 0 50rpx;
436
+  box-sizing: border-box;
437
+  background-color: white;
438
+}
439
+.input-bottom-bar-icon {
440
+  width: 60rpx;
441
+  height: 60rpx;
442
+}
443
+.input-bottom-bar-icon image {
444
+  width: 100%;
445
+  height: 100%;
446
+}
447
+.chat-input {
448
+  flex: 1;
449
+  font-size: 28rpx;
450
+}
451
+.chat-input-send {
452
+  background-color: #007aff;
453
+  margin: 10rpx 10rpx 10rpx 20rpx;
454
+  border-radius: 10rpx;
455
+  padding: 10rpx 30rpx;
456
+}
457
+.chat-input-send-text {
458
+  color: white;
459
+  font-size: 26rpx;
460
+}
461
+.chat-audio-icon-container,
462
+.chat-emoji-icon-container,
463
+.chat-cancel-icon-container {
464
+  width: 30px;
465
+  height: 30px;
466
+}
467
+.chat-audio-container {
468
+  width: 100%;
469
+  height: 200px;
470
+  display: flex;
471
+  flex-direction: row;
472
+  align-items: center;
473
+  justify-content: space-around;
474
+  background: #fff;
475
+}
476
+.chat-emoji-picker-container {
477
+  width: 100%;
478
+  /* height: 300px; */
479
+  background: #fff;
480
+}
481
+</style>

+ 125 - 0
emChat/emChatContainer/emInputBarContainer/inputMessages/sendFileMessage/index.vue

@@ -0,0 +1,125 @@
1
+<template>
2
+  <view>
3
+    <lsj-upload
4
+      ref="lsjUpload"
5
+      childId="upload1"
6
+      :option="option"
7
+      :size="size"
8
+      :formats="formats"
9
+      :debug="debug"
10
+      :instantly="instantly"
11
+      :width="width"
12
+      :height="height"
13
+      @uploadEnd="onUploadEnd"
14
+      @onProgress="onProgress"
15
+    >
16
+      <view>
17
+        <slot></slot>
18
+      </view>
19
+    </lsj-upload>
20
+  </view>
21
+</template>
22
+
23
+<script>
24
+/* EaseIM */
25
+import { EMClient } from '@/EaseIM';
26
+import { MESSAGE_TYPE } from '@/EaseIM/constant';
27
+import { emMessages } from '@/EaseIM/emApis';
28
+const { sendDisplayMessages } = emMessages();
29
+const apiUrl = EMClient.apiUrl;
30
+const orgName = EMClient.orgName;
31
+const appName = EMClient.appName;
32
+const token = EMClient.token;
33
+const uploadTargetUrl = `${apiUrl}/${orgName}/${appName}/chatfiles`;
34
+export default {
35
+  data() {
36
+    return {
37
+      option: {
38
+        url: uploadTargetUrl,
39
+        name: 'file',
40
+        header: {
41
+          Authorization: `Bearer ${token}`,
42
+        },
43
+      },
44
+      // 选择文件后是否立即自动上传,true=选择后立即上传
45
+      instantly: true,
46
+      // 必传宽高且宽高应与slot宽高保持一致
47
+      //   width: '64px',
48
+      //   height: '62px',
49
+      width: '30px',
50
+      height: '27px',
51
+      // 限制允许选择的格式,空串=不限制,默认为空
52
+      formats: '',
53
+      // 文件上传大小限制
54
+      size: 10,
55
+      // 是否打印日志
56
+      debug: true,
57
+    };
58
+  },
59
+  computed: {
60
+    chattingId() {
61
+      return this.$store.getters.chattingId;
62
+    },
63
+    chattingChatType() {
64
+      return this.$store.getters.chattingChatType;
65
+    },
66
+  },
67
+  methods: {
68
+    //发送附件消息
69
+    async sendFileMessage(payload) {
70
+      console.log('>>>>>sendFileMessage payload', payload);
71
+      const { dataObj, filename, file_length } = payload;
72
+      let params = {
73
+        // 消息类型。
74
+        type: MESSAGE_TYPE.FILE,
75
+        // 单聊、群聊和聊天室分别为 `singleChat`、`groupChat` 和 `chatRoom`。
76
+        chatType: this.chattingChatType,
77
+        // 消息接收方:单聊为对方用户 ID,群聊和聊天室分别为群组 ID 和聊天室 ID。
78
+        to: this.chattingId,
79
+        body: {
80
+          // 文件 URL。
81
+          url: dataObj.uri + '/' + dataObj.entities[0].uuid,
82
+          // 文件类型。
83
+          type: 'filetype',
84
+          // 文件名称。
85
+          filename: filename,
86
+          // 文件大小。
87
+          file_length: file_length,
88
+        },
89
+        ext: {},
90
+      };
91
+      // 发送消息。
92
+      console.log('>>>>>要发送的消息params', params);
93
+      try {
94
+        await sendDisplayMessages(params);
95
+        console.log('>>>>>文件发送成功');
96
+      } catch (error) {
97
+        console.log('>>>>>文件消息发送失败', error);
98
+        uni.showToast({
99
+          title: '消息发送失败',
100
+          icon: 'none',
101
+        });
102
+      } finally {
103
+        uni.hideLoading();
104
+        this.$emit('onCloseAllShowContainer');
105
+      }
106
+    },
107
+    onUploadEnd(res) {
108
+      const dataObj = JSON.parse(res.responseText); // 接收上传文件对象
109
+      const payload = {
110
+        dataObj,
111
+        filename: res.name,
112
+        file_length: res.size,
113
+      };
114
+      this.sendFileMessage(payload);
115
+      uni.hideLoading();
116
+    },
117
+    //onProgress
118
+    onProgress(evt) {
119
+      uni.showLoading({ title: '文件上传中,请稍后' });
120
+    },
121
+  },
122
+};
123
+</script>
124
+
125
+<style></style>

+ 194 - 0
emChat/emChatContainer/emInputBarContainer/inputMessages/sendImageMessage/index.vue

@@ -0,0 +1,194 @@
1
+<template>
2
+  <view> </view>
3
+</template>
4
+
5
+<script>
6
+import { EMClient } from '@/EaseIM';
7
+import { MESSAGE_TYPE } from '@/EaseIM/constant';
8
+import { emMessages } from '@/EaseIM/emApis';
9
+const { sendDisplayMessages } = emMessages();
10
+const apiUrl = EMClient.apiUrl;
11
+const orgName = EMClient.orgName;
12
+const appName = EMClient.appName;
13
+const uploadTargetUrl = `${apiUrl}/${orgName}/${appName}/chatfiles`;
14
+const token = EMClient.token;
15
+export default {
16
+  data() {
17
+    return {
18
+      platForm: '',
19
+    };
20
+  },
21
+  computed: {
22
+    chattingId() {
23
+      return this.$store.getters.chattingId;
24
+    },
25
+    chattingChatType() {
26
+      return this.$store.getters.chattingChatType;
27
+    },
28
+  },
29
+  mounted() {
30
+    const res = uni.getSystemInfoSync();
31
+    this.platForm = res?.uniPlatform;
32
+  },
33
+  methods: {
34
+    //打开图库
35
+    openPhotoAlbum() {
36
+      // #ifdef MP-WEIXIN  || MP-TOUTIAO || MP-LARK || MP-JD
37
+      uni.chooseMedia({
38
+        count: 1,
39
+        mediaType: ['image'],
40
+        sourceType: ['album'],
41
+        camera: 'back',
42
+        success: (res) => {
43
+          console.log('拍照选取的图片', res);
44
+          this.upLoadImage(res);
45
+        },
46
+        fail: (err) => {
47
+          uni.showToast({
48
+            title: err.errMsg,
49
+            icon: 'none',
50
+          });
51
+        },
52
+      });
53
+      // #endif
54
+      uni.chooseImage({
55
+        count: 1,
56
+        sizeType: ['original', 'compressed'],
57
+        sourceType: ['album'],
58
+        success: (res) => {
59
+          this.upLoadImage(res);
60
+        },
61
+        fail: (err) => {
62
+          uni.showToast({
63
+            title: err.errMsg,
64
+            icon: 'none',
65
+          });
66
+        },
67
+      });
68
+    },
69
+    //打开相机
70
+    openCamera() {
71
+      // #ifdef MP-WEIXIN  || MP-TOUTIAO || MP-LARK || MP-JD
72
+      uni.chooseMedia({
73
+        count: 1,
74
+        mediaType: ['image'],
75
+        sourceType: ['camera'],
76
+        camera: 'back',
77
+        success: (res) => {
78
+          console.log('拍照选取的图片', res);
79
+          this.upLoadImage(res);
80
+        },
81
+        fail: (err) => {
82
+          uni.showToast({
83
+            title: err.errMsg,
84
+            icon: 'none',
85
+          });
86
+        },
87
+      });
88
+      // #endif
89
+      uni.chooseImage({
90
+        count: 1,
91
+        sizeType: ['original', 'compressed'],
92
+        sourceType: ['camera'],
93
+
94
+        success: (res) => {
95
+          this.upLoadImage(res);
96
+        },
97
+        fail: (err) => {
98
+          uni.showToast({
99
+            title: err.errMsg,
100
+            icon: 'none',
101
+          });
102
+        },
103
+      });
104
+    },
105
+    async upLoadImage(res) {
106
+      const tempFile = res?.tempFiles[0];
107
+      const tempFilePath =
108
+        (res && res.tempFilePaths && res.tempFilePaths[0]) ||
109
+        (res && res.tempFiles && res.tempFiles[0].tempFilePath);
110
+
111
+      console.log('tempFilePath', tempFilePath);
112
+      const imageName = tempFile?.name || 'image' + Date.now();
113
+      const imageType = tempFile?.type?.split('/')[1] || '';
114
+      let width = '';
115
+      let height = '';
116
+      uni.getImageInfo({
117
+        src: tempFilePath,
118
+        success: (res) => {
119
+          console.log('>>>>获取图片信息成功', res);
120
+          width = res.width;
121
+          height = res.height;
122
+        },
123
+        fail: (err) => {
124
+          console.log('>>>>>>获取图片信息失败', err);
125
+        },
126
+      });
127
+      uni.uploadFile({
128
+        url: uploadTargetUrl,
129
+        filePath: tempFilePath,
130
+        fileType: 'image',
131
+        name: 'file',
132
+        header: {
133
+          Authorization: 'Bearer ' + token,
134
+        },
135
+        success: (res) => {
136
+          console.log('上传图片成功', res);
137
+          if (res.statusCode === 400) {
138
+            // 图片上传阿里云检验不合法
139
+            var errData = JSON.parse(res.data);
140
+            if (errData.error === 'content improper') {
141
+              uni.showToast({ title: '图片不合法', icon: 'none' });
142
+              return false;
143
+            }
144
+          }
145
+          this.sendImagesMessage(res, { imageName, width, height, imageType });
146
+          console.log(
147
+            '>>>>>>>执行发送图片信息',
148
+            imageName,
149
+            width,
150
+            height,
151
+            imageType
152
+          );
153
+          uni.showToast({ title: '图片已上传', icon: 'none' });
154
+        },
155
+        fail: (e) => {
156
+          console.log('>>>>>上传失败', e);
157
+          uni.showToast({ title: '图片上传失败', icon: 'none' });
158
+        },
159
+      });
160
+    },
161
+    async sendImagesMessage(res, { imageName, width, height, imageType }) {
162
+      console.log('>>>>>开始执行发送图片消息', res);
163
+      const dataObj = JSON.parse(res.data); // 接收消息对象
164
+      var params = {
165
+        type: MESSAGE_TYPE.IMAGE,
166
+        width: width,
167
+        height: height,
168
+        url: dataObj.uri + '/' + dataObj.entities[0].uuid,
169
+        // 消息接收方:单聊为对方用户 ID,群聊和聊天室分别为群组 ID 和聊天室 ID。
170
+        to: this.chattingId,
171
+        // 会话类型:单聊、群聊和聊天室分别为 `singleChat`、`groupChat` 和 `chatRoom`。
172
+        chatType: this.chattingChatType,
173
+        ext: {
174
+          imageName: imageName,
175
+          imageType: imageType,
176
+        },
177
+      };
178
+      try {
179
+        const res = await sendDisplayMessages({ ...params });
180
+      } catch (error) {
181
+        console.log('>>>>>图片消息发送失败', error);
182
+        uni.showToast({
183
+          title: '消息发送失败',
184
+          icon: 'none',
185
+        });
186
+      } finally {
187
+        this.$emit('onCloseAllShowContainer');
188
+      }
189
+    },
190
+  },
191
+};
192
+</script>
193
+
194
+<style scoped></style>

+ 65 - 0
emChat/emChatContainer/emInputBarContainer/moreFuncContainer/index.css

@@ -0,0 +1,65 @@
1
+.more_func_container {
2
+  width: 100%;
3
+  height: 200px;
4
+  padding: 16px 0;
5
+  background: #fff;
6
+
7
+  display: flex;
8
+  flex-direction: row;
9
+  flex-wrap: wrap;
10
+  justify-content: flex-start;
11
+  align-items: flex-start;
12
+  padding: 0 30px;
13
+}
14
+.more_func_item {
15
+  /* flex-basis: 25%; */
16
+  box-sizing: border-box;
17
+  display: flex;
18
+  flex-direction: column;
19
+  align-items: center;
20
+}
21
+.more_func_item text {
22
+  /* 照片 */
23
+
24
+  width: 24px;
25
+  height: 16px;
26
+
27
+  /* 简体中文/文本/小 */
28
+  font-family: 'PingFang SC';
29
+  font-style: normal;
30
+  font-weight: 400;
31
+  font-size: 12px;
32
+  line-height: 16px;
33
+  /* identical to box height, or 133% */
34
+  text-align: center;
35
+
36
+  /* Neutral/3 */
37
+  color: #464e53;
38
+
39
+  /* Inside auto layout */
40
+  flex: none;
41
+  order: 1;
42
+  flex-grow: 0;
43
+}
44
+.more_func_item_icon {
45
+  width: 64px;
46
+  height: 64px;
47
+  border-radius: 12px;
48
+  background-color: #f1f2f3;
49
+  display: flex;
50
+  justify-content: center;
51
+  align-items: center;
52
+}
53
+
54
+.more_func_item_icon_img {
55
+  width: 32px;
56
+  height: 32px;
57
+}
58
+.more_func_item_icon_common {
59
+  width: 26.67px;
60
+  height: 21.33px;
61
+}
62
+.more_func_item_icon_profile {
63
+  width: 21.33px;
64
+  height: 24px;
65
+}

+ 86 - 0
emChat/emChatContainer/emInputBarContainer/moreFuncContainer/index.vue

@@ -0,0 +1,86 @@
1
+<template>
2
+  <view class="more_func_container">
3
+    <!-- 照片 -->
4
+    <!-- <view class="more_func_item" @click="openPhotoAlbum('album')">
5
+      <view class="more_func_item_icon">
6
+        <image
7
+          class="more_func_item_icon_img"
8
+          src="/static/images/new_ui/inputbar/more_picture_icon.png "
9
+        ></image>
10
+      </view>
11
+      <text>照片</text>
12
+    </view> -->
13
+    <!-- 相机 -->
14
+    <!-- <view class="more_func_item" @click="openPhotoAlbum('camera')">
15
+      <view class="more_func_item_icon">
16
+        <image
17
+          class="more_func_item_icon_common"
18
+          src="/static/images/new_ui/inputbar/more_camera_icon.png"
19
+        ></image>
20
+      </view>
21
+      <text>相机</text>
22
+    </view> -->
23
+    <!-- 文件 -->
24
+    <!-- <view class="more_func_item">
25
+      <SendFileMessage
26
+        ref="fileComps"
27
+        @onCloseAllShowContainer="onCloseAllShowContainer"
28
+      >
29
+        <view class="more_func_item_icon">
30
+          <image
31
+            class="more_func_item_icon_common"
32
+            src="/static/images/new_ui/inputbar/more_file_icon.png"
33
+          ></image>
34
+        </view>
35
+      </SendFileMessage>
36
+      <text>文件</text>
37
+    </view> -->
38
+    <!-- 名片 -->
39
+    <view class="more_func_item" @click="entrySelectUserCard">
40
+      <view class="more_func_item_icon">
41
+        <image
42
+          class="more_func_item_icon_profile"
43
+          src="/static/images/new_ui/inputbar/more_profile_card_icon.png"
44
+        ></image>
45
+      </view>
46
+      <text>名片</text>
47
+    </view>
48
+    <SendImageMessage
49
+      ref="imageComps"
50
+      @onCloseAllShowContainer="onCloseAllShowContainer"
51
+    />
52
+  </view>
53
+</template>
54
+
55
+<script>
56
+import SendImageMessage from '../inputMessages/sendImageMessage';
57
+import SendFileMessage from '../inputMessages/sendFileMessage';
58
+export default {
59
+  components: { SendImageMessage, SendFileMessage },
60
+  data() {
61
+    return {};
62
+  },
63
+  methods: {
64
+    openPhotoAlbum(type) {
65
+      if (type === 'camera') {
66
+        this.$refs.imageComps.openCamera();
67
+      } else if (type === 'album') {
68
+        this.$refs.imageComps.openPhotoAlbum();
69
+      }
70
+    },
71
+    onCloseAllShowContainer() {
72
+      this.$emit('onCloseAllShowContainer');
73
+    },
74
+    entrySelectUserCard() {
75
+      uni.navigateTo({
76
+        url: '../emChatContainer/emSelectUserCard/index',
77
+      });
78
+      this.onCloseAllShowContainer();
79
+    },
80
+  },
81
+};
82
+</script>
83
+
84
+<style scoped>
85
+@import './index.css';
86
+</style>

+ 447 - 0
emChat/emChatContainer/emInputBarContainer/recordAudioContainer/index.vue

@@ -0,0 +1,447 @@
1
+<template>
2
+  <view>
3
+    <view class="audio_start_box" @click="startRecordAudio">
4
+      <image src="/static/images/new_ui/inputbar/audio_click_start_icon.png">
5
+      </image>
6
+      <text>点击录音</text>
7
+    </view>
8
+    <u-popup :show="isStartRecording" @close="isStartRecording = false">
9
+      <view class="audio_record_box">
10
+        <image
11
+          class="audio_icon"
12
+          @click="cannelRecordAudio"
13
+          src="/static/images/new_ui/inputbar/audio_delete_icon.png"
14
+        ></image>
15
+        <view class="record_statistics_box">
16
+          <view class="record_length_text">{{ recordTime }}s</view>
17
+          <text>正在录音</text>
18
+        </view>
19
+
20
+        <image
21
+          class="audio_icon"
22
+          @click="sendAudioMessage"
23
+          src="/static/images/new_ui/inputbar/audio_send_icon.png"
24
+        ></image>
25
+      </view>
26
+    </u-popup>
27
+  </view>
28
+</template>
29
+
30
+<script>
31
+import { EMClient } from '@/EaseIM';
32
+import { emMessages } from '@/EaseIM/emApis';
33
+import { RECORD_STATUS, RECOED_DESC } from '@/constant';
34
+const { sendDisplayMessages } = emMessages();
35
+let recordTimeInterval = null;
36
+export default {
37
+  data() {
38
+    return {
39
+      RECOED_DESC,
40
+      RECORD_STATUS,
41
+      isStartRecording: false,
42
+      recordStatus: RECORD_STATUS.HIDE,
43
+      recorderManager: null, //全局唯一录音管理器
44
+      recording: false, //是否正在录音中
45
+      recordTime: 0,
46
+      webRecorderManager: null, // h5 audio record
47
+      platFormInfo: uni.getSystemInfoSync(),
48
+    };
49
+  },
50
+  mounted() {
51
+    this.platFormInfo = uni.getSystemInfoSync();
52
+    if (this.platFormInfo !== 'web') {
53
+      this.recorderManager = uni.getRecorderManager();
54
+    }
55
+  },
56
+  watch: {
57
+    recordTime(newVal, oldVal) {
58
+      if (this.recording && newVal > 50) {
59
+        uni.showToast({
60
+          icon: 'none',
61
+          title: '录音时长最大60秒,注意时长!',
62
+          duration: 2000,
63
+        });
64
+        this.cannelRecordAudio();
65
+      }
66
+      if (this.recording && newVal > 60) {
67
+        uni.showToast({
68
+          icon: 'none',
69
+          title: '录音时长最大60秒',
70
+          duration: 2000,
71
+        });
72
+        this.cannelRecordAudio();
73
+      }
74
+    },
75
+  },
76
+  computed: {
77
+    chattingId() {
78
+      return this.$store.getters.chattingId;
79
+    },
80
+    chattingChatType() {
81
+      return this.$store.getters.chattingChatType;
82
+    },
83
+  },
84
+  methods: {
85
+    startRecordAudio() {
86
+      console.log('>>>>>开始采集');
87
+      this.isStartRecording = true;
88
+      this.handleRecording();
89
+    },
90
+    handleRecording() {
91
+      // h5不支持uni.getRecorderManager, 需要单独处理
92
+      if (this.platFormInfo.uniPlatform === 'web') {
93
+        console.log('>>>>>>>>++++++');
94
+        this.executeWebAudioRecord();
95
+      } else {
96
+        setTimeout(() => {
97
+          //请求授权
98
+          this.requestMiniProgramAuthorization();
99
+        }, 350);
100
+      }
101
+    },
102
+
103
+    //web平台采集音频录音
104
+    //#ifdef WEB
105
+    executeWebAudioRecord() {
106
+      import('../../../../recorderCore/src/recorder-core').then((Recorder) => {
107
+        require('../../../../recorderCore/src/engine/mp3');
108
+        require('../../../../recorderCore/src/engine/mp3-engine');
109
+        this.initStartRecord();
110
+        this.webRecorderManager = new Recorder.default({
111
+          type: 'mp3',
112
+        });
113
+        this.webRecorderManager.open(
114
+          () => {
115
+            console.log('>>>>>>web 录音开始执行');
116
+            this.recording = true;
117
+            this.saveRecordTime();
118
+            this.webRecorderManager.start();
119
+          },
120
+          (msg, isUserNotAllow) => {
121
+            if (isUserNotAllow) {
122
+              uni.showToast({
123
+                title: '鉴权失败,请重试',
124
+                icon: 'none',
125
+              });
126
+            } else {
127
+              uni.showToast({
128
+                title: `开启失败,请重试`,
129
+                icon: 'none',
130
+              });
131
+            }
132
+          }
133
+        );
134
+      });
135
+    },
136
+    // #endif
137
+    requestMiniProgramAuthorization() {
138
+      const onSuccess = (res) => {
139
+        this.initStartRecord();
140
+        const recordAuth = res.authSetting['scope.record'];
141
+        if (!recordAuth) {
142
+          // 已申请过授权,但是用户拒绝
143
+          uni.openSetting({
144
+            success: function (res) {
145
+              const recordAuth = res.authSetting['scope.record'];
146
+              if (recordAuth == true) {
147
+                uni.showToast({
148
+                  title: '授权成功',
149
+                  icon: 'success',
150
+                });
151
+              } else {
152
+                uni.showToast({
153
+                  title: '请授权录音',
154
+                  icon: 'none',
155
+                });
156
+              }
157
+            },
158
+          });
159
+          return;
160
+        }
161
+        // 用户已经同意授权
162
+        if (recordAuth) {
163
+          this.executeMiniProgramRecord();
164
+          return;
165
+        }
166
+        // 第一次进来,未发起授权
167
+        uni.authorize({
168
+          scope: 'scope.record',
169
+          success: () => {
170
+            // 授权成功
171
+            uni.showToast({
172
+              title: '授权成功',
173
+              icon: 'icon',
174
+            });
175
+            this.executeMiniProgramRecord();
176
+          },
177
+        });
178
+      };
179
+      const onFail = (res) => {
180
+        uni.showToast({
181
+          title: '鉴权失败,请重试',
182
+          icon: 'none',
183
+        });
184
+      };
185
+      if (uni.getSetting) {
186
+        uni.getSetting({
187
+          success: onSuccess,
188
+          fail: onFail,
189
+        });
190
+        return;
191
+      } else {
192
+        this.executeMiniProgramRecord();
193
+        return;
194
+      }
195
+    },
196
+    //针对mini program 平台采集音频录音
197
+    executeMiniProgramRecord() {
198
+      this.initStartRecord();
199
+      let recorderManager = this.recorderManager || uni.getRecorderManager();
200
+      recorderManager.onStart(() => {
201
+        this.recording = true;
202
+        this.saveRecordTime();
203
+      });
204
+      recorderManager.start({
205
+        format: 'mp3',
206
+      });
207
+    },
208
+    // 初始化开始录音状态
209
+    initStartRecord() {
210
+      clearInterval(recordTimeInterval);
211
+      this.recordTime = 0;
212
+      this.recording = false;
213
+    },
214
+    getRecorderCollectionData() {
215
+      const recorderManager = this.recorderManager;
216
+      const webRecorderManager = this.webRecorderManager;
217
+      const duration = this.recordTime * 1000;
218
+      return new Promise((resolve, reject) => {
219
+        if (webRecorderManager && this.platFormInfo.uniPlatform === 'web') {
220
+          this.webRecorderManager.stop(
221
+            (blob) => {
222
+              clearInterval(recordTimeInterval);
223
+              if (duration <= 1000) {
224
+                uni.showToast({
225
+                  title: '录音时间太短',
226
+                  icon: 'none',
227
+                });
228
+              } else {
229
+                const tempFilePath = window.URL.createObjectURL(blob);
230
+                resolve({ tempFilePath, duration });
231
+              }
232
+              this.recordTime = 0;
233
+            },
234
+            (s) => {
235
+              reject(s);
236
+              console.log('结束出错:' + s, 1);
237
+            },
238
+            true
239
+          );
240
+        } else if (recorderManager) {
241
+          recorderManager.onStop((res) => {
242
+            if (duration <= 1000) {
243
+              uni.showToast({
244
+                title: '录音时间太短',
245
+                icon: 'none',
246
+              });
247
+            } else {
248
+              // 上传
249
+              resolve({ tempFilePath: res.tempFilePath, duration });
250
+            }
251
+            this.initStartRecord();
252
+          });
253
+          // 停止录音
254
+          recorderManager.stop();
255
+        }
256
+      });
257
+    },
258
+    //取消录音
259
+    cannelRecordAudio() {
260
+      //调用对应管理器结束录音采集
261
+      if (this.platFormInfo.uniPlatform === 'web' && this.webRecorderManager) {
262
+        this.webRecorderManager.close(() => {
263
+          this.initStartRecord();
264
+        });
265
+      } else if (this.recorderManager) {
266
+        this.recorderManager.onStop(() => {
267
+          this.initStartRecord();
268
+        });
269
+        this.recorderManager.stop();
270
+      }
271
+      this.isStartRecording = false;
272
+      this.$emit('changeRecordAudioContainer');
273
+    },
274
+    //上传录音附件资源至环信服务器
275
+    async uploadRecordFile(tempFilePath) {
276
+      if (!tempFilePath) return;
277
+      const apiUrl = EMClient.apiUrl;
278
+      const orgName = EMClient.orgName;
279
+      const appName = EMClient.appName;
280
+      const uploadTargetUrl = `${apiUrl}/${orgName}/${appName}/chatfiles`;
281
+      const accessToken = EMClient.token;
282
+      return new Promise((resolve, reject) => {
283
+        const requestParams = {
284
+          url: uploadTargetUrl,
285
+          filePath: tempFilePath,
286
+          fileType: 'audio',
287
+          name: 'file',
288
+          header: {
289
+            Authorization: 'Bearer ' + accessToken,
290
+          },
291
+          success: (res) => {
292
+            console.log('>>>>>录音上传成功', res);
293
+            uni.showToast({ title: '音源已上传...', icon: 'none' });
294
+            resolve(res);
295
+          },
296
+          fail: (e) => {
297
+            console.log('>>>>>上传失败', e);
298
+            uni.showToast({ title: '录音上传失败', icon: 'none' });
299
+            reject(e);
300
+          },
301
+        };
302
+        uni.uploadFile(requestParams);
303
+      });
304
+    },
305
+    //发送语音消息
306
+    async sendAudioMessage() {
307
+      try {
308
+        //获取对应音频源文件
309
+        const { tempFilePath, duration } =
310
+          await this.getRecorderCollectionData();
311
+        //进行文件上传
312
+        const uploadFileRes = await this.uploadRecordFile(tempFilePath);
313
+        const dataObj = JSON.parse(uploadFileRes.data); // 接收消息对象
314
+        const bodys = {
315
+          url: dataObj.uri + '/' + dataObj.entities[0].uuid,
316
+          filename: `${new Date().getTime()}.mp3`,
317
+          filetype: 'mp3',
318
+          length: Math.ceil(duration / 1000),
319
+        };
320
+        const params = {
321
+          // 消息类型。
322
+          type: 'audio',
323
+          body: { ...bodys },
324
+          filename: bodys.filename,
325
+          // 消息接收方:单聊为对方用户 ID,群聊和聊天室分别为群组 ID 和聊天室 ID。
326
+          to: this.chattingId,
327
+          // 会话类型:单聊、群聊和聊天室分别为 `singleChat`、`groupChat` 和 `chatRoom`。
328
+          chatType: this.chattingChatType,
329
+          ext: {},
330
+        };
331
+        const res = await sendDisplayMessages({ ...params });
332
+        console.log('>>>>>>已发送', res);
333
+      } catch (error) {
334
+        console.log('>>>>>语音消息发送失败', error);
335
+        uni.showToast({
336
+          title: `消息发送失败${error}`,
337
+          icon: 'none',
338
+        });
339
+      } finally {
340
+        this.isStartRecording = false;
341
+        this.$emit('changeRecordAudioContainer');
342
+      }
343
+    },
344
+    // 记录录音时长
345
+    saveRecordTime() {
346
+      recordTimeInterval = setInterval(() => {
347
+        this.recordTime++;
348
+      }, 1000);
349
+    },
350
+  },
351
+  beforeDestroy() {
352
+    clearInterval(recordTimeInterval);
353
+    this.recordTime = 0;
354
+  },
355
+};
356
+</script>
357
+
358
+<style scoped>
359
+.audio_record_box {
360
+  width: 100%;
361
+  height: 200px;
362
+  display: flex;
363
+  flex-direction: row;
364
+  align-items: center;
365
+  justify-content: space-around;
366
+  background: #fff;
367
+}
368
+.audio_start_box {
369
+  width: 100%;
370
+  height: 200px;
371
+  display: flex;
372
+  flex-direction: column;
373
+  align-items: center;
374
+  justify-content: center;
375
+}
376
+.audio_start_box image {
377
+  width: 48px;
378
+  height: 48px;
379
+}
380
+.audio_start_box text {
381
+  /* 点击录音 */
382
+
383
+  width: 56px;
384
+  height: 18px;
385
+
386
+  /* 简体中文/标签/中 */
387
+  font-family: 'PingFang SC';
388
+  font-style: normal;
389
+  font-weight: 500;
390
+  font-size: 14px;
391
+  line-height: 18px;
392
+  /* identical to box height, or 129% */
393
+  text-align: center;
394
+
395
+  /* Neutral/5 */
396
+  color: #75828a;
397
+
398
+  /* Inside auto layout */
399
+  flex: none;
400
+  order: 1;
401
+  flex-grow: 0;
402
+}
403
+.audio_icon {
404
+  width: 36px;
405
+  height: 36px;
406
+}
407
+.record_statistics_box {
408
+  display: flex;
409
+  flex-direction: column;
410
+  align-items: center;
411
+  width: 80px;
412
+  height: 82px;
413
+}
414
+.record_length_text {
415
+  width: 80px;
416
+  height: 48px;
417
+  line-height: 48px;
418
+  text-align: center;
419
+  background: #009eff;
420
+  border-radius: 45px;
421
+  border: 10px solid #e5f5ff;
422
+  color: #e5f5ff;
423
+}
424
+.record_statistics_box text {
425
+  /* 正在录音 */
426
+
427
+  width: 56px;
428
+  height: 18px;
429
+
430
+  /* 简体中文/标签/中 */
431
+  font-family: 'PingFang SC';
432
+  font-style: normal;
433
+  font-weight: 500;
434
+  font-size: 14px;
435
+  line-height: 18px;
436
+  /* identical to box height, or 129% */
437
+  text-align: center;
438
+
439
+  /* Neutral/5 */
440
+  color: #75828a;
441
+
442
+  /* Inside auto layout */
443
+  flex: none;
444
+  order: 1;
445
+  flex-grow: 0;
446
+}
447
+</style>

+ 252 - 0
emChat/emChatContainer/emInputBarContainer/replyMessageContainer/index.vue

@@ -0,0 +1,252 @@
1
+<template>
2
+  <view class="reply_msg_container" @click="extractMessageBodyValue">
3
+    <view class="reply_msg_content_box">
4
+      <view class="reply_msg_content_box_left">
5
+        <view class="reply_msg_target">
6
+          <!-- <u-icon
7
+            name="/static/images/new_ui/message/replyMessage/replying_icon.png"
8
+            size="16"
9
+          ></u-icon> -->
10
+          正在回复:
11
+          <text class="reply_msg_target_name u-line-1">{{
12
+            previewMsgFromNickname
13
+          }}</text>
14
+        </view>
15
+        <view class="reply_msg_content u-line-1"
16
+          >{{ previewText }}
17
+          <!-- 音频length含展示length -->
18
+          <text
19
+            class="reply_msg_audio_length"
20
+            v-if="this.checkedPopupMsgBody.length"
21
+          >
22
+            {{ this.checkedPopupMsgBody.length }}″</text
23
+          >
24
+        </view>
25
+      </view>
26
+      <view
27
+        v-if="this.checkedPopupMsgBody.type !== MESSAGE_TYPE.TEXT"
28
+        class="reply_msg_content_box_rigth"
29
+      >
30
+        <u-icon :name="previewFileIcon" size="36"></u-icon>
31
+      </view>
32
+    </view>
33
+    <u-icon
34
+      @click="closeReplyMsgContainer"
35
+      name="/static/images/new_ui/message/replyMessage/close_icon.png"
36
+      size="20"
37
+    ></u-icon>
38
+  </view>
39
+</template>
40
+
41
+<script>
42
+import {
43
+  MESSAGE_TYPE,
44
+  CUSTOM_EVENT_NAME,
45
+  SESSION_MESSAGE_TYPE,
46
+} from '@/EaseIM/constant';
47
+import { CHAT_TYPE } from '../../../../EaseIM/constant';
48
+
49
+export default {
50
+  props: {
51
+    checkedPopupMsgBody: {
52
+      type: Object,
53
+      default: () => ({}),
54
+    },
55
+  },
56
+  data() {
57
+    return {
58
+      MESSAGE_TYPE,
59
+      CUSTOM_EVENT_NAME,
60
+      SESSION_MESSAGE_TYPE,
61
+      rootImageUrl: '/static/images/new_ui/message/replyMessage/',
62
+    };
63
+  },
64
+  computed: {
65
+    isSelf() {
66
+      const checkedPopupMsgBody = this.checkedPopupMsgBody;
67
+      return (
68
+        checkedPopupMsgBody.from ===
69
+        this.$store.state.LoginStore.loginUserBaseInfos.loginUserId
70
+      );
71
+    },
72
+    friendUserInfoCollection() {
73
+      return this.$store.getters.friendUserInfoCollection;
74
+    },
75
+    groupMembersProfileData() {
76
+      return this.$store.getters.groupMembersProfile;
77
+    },
78
+    previewText() {
79
+      if (this.checkedPopupMsgBody?.type === MESSAGE_TYPE.TEXT) {
80
+        return this.checkedPopupMsgBody?.msg || '';
81
+      } else if (this.checkedPopupMsgBody?.type === MESSAGE_TYPE.FILE) {
82
+        return '[文件] ' + this.checkedPopupMsgBody?.filename || '[文件]';
83
+      } else if (
84
+        this.checkedPopupMsgBody?.type === MESSAGE_TYPE.CUSTOM &&
85
+        this.checkedPopupMsgBody.customEvent === CUSTOM_EVENT_NAME.USER_CARD
86
+      ) {
87
+        return '[个人名片]';
88
+      } else if (
89
+        this.checkedPopupMsgBody?.type === MESSAGE_TYPE.CUSTOM &&
90
+        this.checkedPopupMsgBody.customEvent === CUSTOM_EVENT_NAME.PRODUCTLINK
91
+      ) {
92
+        return '[商品链接]';
93
+      }else {
94
+        return SESSION_MESSAGE_TYPE[this.checkedPopupMsgBody?.type] || '';
95
+      }
96
+    },
97
+    previewFileIcon() {
98
+      if (this.checkedPopupMsgBody?.type === MESSAGE_TYPE.IMAGE) {
99
+        //图片如果包含缩略图字段则优先展示缩略图作为icon预览
100
+        if (this.checkedPopupMsgBody?.thumb) {
101
+          return this.checkedPopupMsgBody.thumb;
102
+        }
103
+        return this.rootImageUrl + 'reply_msg_img.png';
104
+      }
105
+      if (this.checkedPopupMsgBody?.type === MESSAGE_TYPE.AUDIO) {
106
+        return this.rootImageUrl + 'reply_msg_audio.png';
107
+      }
108
+      if (this.checkedPopupMsgBody?.type === MESSAGE_TYPE.VIDEO) {
109
+        return this.rootImageUrl + 'reply_msg_video.png';
110
+      }
111
+    },
112
+    previewMsgFromNickname() {
113
+      if (this.isSelf) {
114
+        return '我';
115
+      }
116
+      if (this.checkedPopupMsgBody?.chatType === CHAT_TYPE.SINGLE_CHAT) {
117
+        const userId = this.checkedPopupMsgBody.from;
118
+        if (
119
+          this.friendUserInfoCollection[userId] &&
120
+          this.friendUserInfoCollection[userId]?.nickname
121
+        ) {
122
+          return this.friendUserInfoCollection[userId].nickname;
123
+        } else {
124
+          return userId;
125
+        }
126
+      }
127
+      if (this.checkedPopupMsgBody?.chatType === CHAT_TYPE.GROUP_CHAT) {
128
+        const groupId = this.checkedPopupMsgBody.to;
129
+        const userId = this.checkedPopupMsgBody.from;
130
+        const groupMemberData = this.groupMembersProfileData[groupId];
131
+        if (groupMemberData) {
132
+          return (
133
+            groupMemberData[userId]?.nickName ||
134
+            groupMemberData[userId]?.nickname ||
135
+            userId
136
+          );
137
+        } else {
138
+          return userId;
139
+        }
140
+      }
141
+    },
142
+  },
143
+  methods: {
144
+    //关闭消息引用框
145
+    closeReplyMsgContainer() {
146
+      this.$emit('onShowReplyMessageContainer');
147
+    },
148
+    //提取原始消息内容至待发送的引用参数内
149
+    extractMessageBodyValue() {
150
+      const { type, msg: msgContent, id: mid, from } = this.checkedPopupMsgBody;
151
+      //引用消息必传参数
152
+      let msgQuote = {
153
+        msgID: '', //引用消息id
154
+        msgPreview: '', //引用消息预览
155
+        msgSender: '', //引用消息发送人
156
+        msgType: '', //引用消息类型
157
+      };
158
+      msgQuote.msgID = mid;
159
+      msgQuote.msgType = type;
160
+      msgQuote.msgSender = this.previewMsgFromNickname;
161
+      if (type === MESSAGE_TYPE.TEXT) {
162
+        msgQuote.msgPreview = msgContent;
163
+      } else if (
164
+        type === MESSAGE_TYPE.CUSTOM &&
165
+        this.checkedPopupMsgBody.customEvent === CUSTOM_EVENT_NAME.USER_CARD
166
+      ) {
167
+        msgQuote.msgPreview = '[个人名片]';
168
+      } else if(
169
+		type === MESSAGE_TYPE.CUSTOM &&
170
+		this.checkedPopupMsgBody.customEvent === CUSTOM_EVENT_NAME.PRODUCTLINK
171
+	  ){
172
+		   msgQuote.msgPreview = '[商品链接]';
173
+	  }else{
174
+        msgQuote.msgPreview = SESSION_MESSAGE_TYPE[type];
175
+      }
176
+      console.log('msgQuote', msgQuote);
177
+      return msgQuote;
178
+    },
179
+  },
180
+};
181
+</script>
182
+
183
+<style scoped>
184
+.reply_msg_container {
185
+  width: 100%;
186
+  min-height: 52px;
187
+  box-sizing: border-box;
188
+  background: #f1f2f3;
189
+  display: flex;
190
+  justify-content: space-between;
191
+  align-items: center;
192
+  padding: 0 5px;
193
+}
194
+.reply_msg_content_box {
195
+  width: 100%;
196
+  display: flex;
197
+  flex-direction: row;
198
+}
199
+.reply_msg_content_box_left {
200
+  flex: 1;
201
+}
202
+
203
+.reply_msg_target {
204
+  display: flex;
205
+  flex-direction: row;
206
+  align-items: center;
207
+  /* Nickname */
208
+  height: 16px;
209
+
210
+  /* 简体中文/标签/小 */
211
+  font-family: 'PingFang SC';
212
+  font-style: normal;
213
+  font-weight: 400;
214
+  font-size: 12px;
215
+  line-height: 16px;
216
+  /* identical to box height, or 133% */
217
+
218
+  /* Neutral Special/5 */
219
+  color: #5270ad;
220
+
221
+  /* Inside auto layout */
222
+  flex: none;
223
+  order: 3;
224
+  flex-grow: 0;
225
+}
226
+.reply_msg_target_name {
227
+  font-weight: bold;
228
+}
229
+.reply_msg_content {
230
+  /* 感恩陪伴 */
231
+  height: 16px;
232
+
233
+  /* 简体中文/文本/小 */
234
+  font-family: 'PingFang SC';
235
+  font-style: normal;
236
+  font-weight: 400;
237
+  font-size: 12px;
238
+  line-height: 16px;
239
+  /* identical to box height, or 133% */
240
+
241
+  /* Neutral/5 */
242
+  color: #75828a;
243
+
244
+  /* Inside auto layout */
245
+  flex: none;
246
+  order: 0;
247
+  flex-grow: 0;
248
+}
249
+.reply_msg_audio_length {
250
+  margin-left: 4px;
251
+}
252
+</style>

+ 72 - 0
emChat/emChatContainer/emMessageListContainer/index.css

@@ -0,0 +1,72 @@
1
+.message_container {
2
+  width: 100%;
3
+  background: #f8f9f9;
4
+}
5
+.message_list_item {
6
+  width: 100%;
7
+  display: flex;
8
+  /* padding: 0 10px; */
9
+  box-sizing: border-box;
10
+  flex-direction: row;
11
+  justify-content: flex-start;
12
+  align-items: flex-end;
13
+}
14
+.message_list_item_content {
15
+  display: flex;
16
+  flex-direction: column;
17
+  max-width: 70%;
18
+}
19
+.message_list_item_mine {
20
+  flex-direction: row-reverse;
21
+}
22
+.message_list_item_avatar {
23
+  margin: 0 10px;
24
+}
25
+.message_list_item_content_nickname {
26
+  /* Nickname */
27
+  height: 16px;
28
+
29
+  /* 简体中文/标签/小 */
30
+  font-family: 'PingFang SC';
31
+  font-style: normal;
32
+  font-weight: 400;
33
+  font-size: 12px;
34
+  line-height: 16px;
35
+  /* identical to box height, or 133% */
36
+
37
+  /* Neutral Special/5 */
38
+  color: #5270ad;
39
+}
40
+.message_list_item_content_nickname_mine {
41
+  text-align: right;
42
+}
43
+.message_time {
44
+  display: flex;
45
+  flex-direction: row;
46
+  align-items: center;
47
+  justify-content: center;
48
+  width: 100%;
49
+  height: 16px;
50
+  /* Alphabet/Body/Small */
51
+  font-family: 'SF Pro';
52
+  font-style: normal;
53
+  font-weight: 400;
54
+  font-size: 12px;
55
+  line-height: 16px;
56
+  /* identical to box height, or 133% */
57
+  /* Neutral/7 */
58
+  color: #acb4b9;
59
+  margin: 10px 0 5px 0;
60
+}
61
+
62
+/* 引用消息闪烁 */
63
+/* 闪烁动画 */
64
+@keyframes blinkAnimation {
65
+  50% {
66
+    background-color: #eff0f1; /* 闪烁颜色 */
67
+  }
68
+}
69
+/* 应用于元素的闪烁效果 */
70
+.quote_msg_avtive {
71
+  animation: blinkAnimation 1s; /* 动画持续时间 */
72
+}

+ 281 - 0
emChat/emChatContainer/emMessageListContainer/index.vue

@@ -0,0 +1,281 @@
1
+<template>
2
+  <view>
3
+    <text v-if="isNeedShowMessageTime" class="message_time">{{
4
+      messageTime(msgBody.time)
5
+    }}</text>
6
+    <view
7
+      :class="[
8
+        'message_list_item',
9
+        !isSelf(msgBody) || 'message_list_item_mine',
10
+        msgBody.id == quoteMsgId && 'quote_msg_avtive',
11
+      ]"
12
+    >
13
+      <!--user avatar -->
14
+      <view class="message_list_item_avatar">
15
+        <u-avatar
16
+          :src="messageItemAvatar"
17
+          shape="square"
18
+          :size="28"
19
+          @click="entryContactsDetailPage"
20
+        />
21
+      </view>
22
+      <view class="message_list_item_content" @longpress="callMessagePopup">
23
+        <text
24
+          :class="[
25
+            'message_list_item_content_nickname',
26
+            isSelf(msgBody) && 'message_list_item_content_nickname_mine',
27
+          ]"
28
+          >{{ messageItemNickName }}</text
29
+        >
30
+
31
+        <!-- 文本消息 -->
32
+        <template v-if="msgBody.type === MESSAGE_TYPE.TEXT">
33
+          <text-msg-item :msgBody="msgBody" />
34
+        </template>
35
+        <!-- 图片消息 -->
36
+        <template v-if="msgBody.type === MESSAGE_TYPE.IMAGE">
37
+          <image-msg-item :msgBody="msgBody" />
38
+        </template>
39
+        <!-- 语音消息 -->
40
+        <template v-if="msgBody.type === MESSAGE_TYPE.AUDIO">
41
+          <audio-msg-item
42
+            :msgBody="msgBody"
43
+            :playAudioMid="playAudioMid"
44
+            @onClickPlayAudio="onClickPlayAudio"
45
+          />
46
+        </template>
47
+        <!-- 附件消息 -->
48
+
49
+        <template v-if="msgBody.type === MESSAGE_TYPE.FILE">
50
+          <file-msg-item :msgBody="msgBody" />
51
+        </template>
52
+
53
+        <!-- 个人名片 -->
54
+        <template
55
+          v-if="
56
+            msgBody.type === MESSAGE_TYPE.CUSTOM &&
57
+            msgBody.customEvent === CUSTOM_EVENT_NAME.USER_CARD
58
+          "
59
+        >
60
+          <user-card-msg-item
61
+            @click.native="entryContactsDetailPage(CUSTOM_EVENT_NAME.USER_CARD)"
62
+            :msgBody="msgBody"
63
+          />
64
+        </template>
65
+		
66
+		<!-- 商品链接 -->
67
+		<template
68
+		  v-if="
69
+		    msgBody.type === MESSAGE_TYPE.CUSTOM &&
70
+		    msgBody.customEvent === CUSTOM_EVENT_NAME.PRODUCTLINK
71
+		  "
72
+		>
73
+		  <product-card-item
74
+			 @click.native="entryProductDetailPage(CUSTOM_EVENT_NAME.PRODUCTLINK)"
75
+		    :msgBody="msgBody"
76
+		  />
77
+		  
78
+		</template>
79
+		
80
+		
81
+        <msg-quote-container
82
+          v-if="msgBody.ext && msgBody.ext.msgQuote"
83
+          :msgQuoteContent="msgBody.ext.msgQuote"
84
+          @click.native="callScrollToQuoteMsg(msgBody.ext.msgQuote)"
85
+        />
86
+      </view>
87
+    </view>
88
+  </view>
89
+</template>
90
+
91
+<script>
92
+import { MESSAGE_TYPE, CUSTOM_EVENT_NAME, CHAT_TYPE } from "@/EaseIM/constant";
93
+import TextMsgItem from "./messagesItem/textMsgItem";
94
+import ImageMsgItem from "./messagesItem/imageMsgItem";
95
+import AudioMsgItem from "./messagesItem/audioMsgItem";
96
+import FileMsgItem from "./messagesItem/fileMsgItem";
97
+import UserCardMsgItem from "./messagesItem/userCardItem";
98
+import ProductCardItem from "./messagesItem/productCardItem";
99
+import MsgQuoteContainer from "./msgQuoteContainer";
100
+import { EMClient } from "@/EaseIM";
101
+export default {
102
+  components: {
103
+    TextMsgItem,
104
+    ImageMsgItem,
105
+    AudioMsgItem,
106
+    FileMsgItem,
107
+    UserCardMsgItem,
108
+	ProductCardItem,
109
+    MsgQuoteContainer,
110
+  },
111
+  props: {
112
+    msgBody: {
113
+      type: Object,
114
+      default: () => ({}),
115
+      required: true,
116
+    },
117
+    isNeedShowMessageTime: {
118
+      type: Boolean,
119
+      default: false,
120
+    },
121
+    quoteMsgId: {
122
+      type: String,
123
+      default: "",
124
+    },
125
+  },
126
+
127
+  data() {
128
+    return {
129
+      MESSAGE_TYPE,
130
+      CUSTOM_EVENT_NAME,
131
+      playAudioMid: "",
132
+	
133
+      // defaultAvatar: "/static/images/new_ui/defaultAvatar.png",
134
+	  defaultAvatar:uni.getStorageSync('nowConversationIntem').avatarurl,
135
+      defaultAvatarMe: uni.getStorageSync('selectmerchant').merchantIntention.logo,
136
+      defaultNicknameMe: uni.getStorageSync('selectmerchant').merchantIntention.mer_name,
137
+    };
138
+  },
139
+  computed: {
140
+    isSelf() {
141
+      return (item) => {
142
+        return (
143
+          item.from ===
144
+          this.$store.state.LoginStore.loginUserBaseInfos.loginUserId
145
+        );
146
+      };
147
+    },
148
+    loginUserProfiles() {
149
+      return this.$store.state.LoginStore.loginUserProfiles;
150
+    },
151
+    messageTime() {
152
+      return (time) => {
153
+        return this.$u.timeFrom(time);
154
+      };
155
+    },
156
+
157
+    friendUserInfoCollection() {
158
+      return this.$store.getters.friendUserInfoCollection;
159
+    },
160
+    groupMembersProfileData() {
161
+      return this.$store.getters.groupMembersProfile;
162
+    },
163
+    messageItemAvatar() {
164
+      if (this.isSelf(this.msgBody)) {
165
+        return this.loginUserProfiles?.avatarurl || this.defaultAvatarMe;
166
+      }
167
+      if (this.msgBody.chatType === CHAT_TYPE.SINGLE_CHAT) {
168
+        const userId = this.msgBody.from;
169
+        if (
170
+          this.friendUserInfoCollection[userId] &&
171
+          this.friendUserInfoCollection[userId]?.avatarurl
172
+        ) {
173
+          return (
174
+            this.friendUserInfoCollection[userId].avatarurl ||
175
+            this.defaultAvatar
176
+          );
177
+        } else {
178
+          return this.defaultAvatar;
179
+        }
180
+      }
181
+      if (this.msgBody.chatType === CHAT_TYPE.GROUP_CHAT) {
182
+        const groupId = this.msgBody.to;
183
+        const userId = this.msgBody.from;
184
+        const groupMemberData = this.groupMembersProfileData[groupId];
185
+        if (groupMemberData) {
186
+          return groupMemberData[userId]?.avatarurl || this.defaultAvatar;
187
+        } else {
188
+          return this.defaultAvatar;
189
+        }
190
+      }
191
+    },
192
+    messageItemNickName() {
193
+      if (this.isSelf(this.msgBody)) {
194
+		// console.log('this.loginUserProfiles>>>>>>>>>>>>',this.loginUserProfiles)
195
+		// console.log('EMClient.user>>>>>>>>>>>>',EMClient.user)
196
+        return this.loginUserProfiles?.nickname || this.defaultNicknameMe;
197
+      }
198
+      if (this.msgBody.chatType === CHAT_TYPE.SINGLE_CHAT) {
199
+        // const userId = this.msgBody.from;
200
+		const userId=uni.getStorageSync('nowConversationIntem').nickname
201
+		
202
+        if (
203
+          this.friendUserInfoCollection[userId] &&
204
+          this.friendUserInfoCollection[userId]?.nickname
205
+        ) {
206
+          // return this.friendUserInfoCollection[userId].nickname;
207
+          return uni.getStorageSync('nowConversationIntem').nickname;
208
+        } else {
209
+          return userId;
210
+        }
211
+      }
212
+      if (this.msgBody.chatType === CHAT_TYPE.GROUP_CHAT) {
213
+        const groupId = this.msgBody.to;
214
+        const userId = this.msgBody.from;
215
+        const groupMemberData = this.groupMembersProfileData[groupId];
216
+        if (groupMemberData) {
217
+          return (
218
+            groupMemberData[userId]?.nickName ||
219
+            groupMemberData[userId]?.nickname ||
220
+            userId
221
+          );
222
+        } else {
223
+          return userId;
224
+        }
225
+      }
226
+    },
227
+  },
228
+  methods: {
229
+    onClickPlayAudio(mid) {
230
+      this.playAudioMid = mid;
231
+      console.log("mid", mid);
232
+      console.log("++++++++");
233
+    },
234
+    callMessagePopup() {
235
+      this.$emit("alertMessagePopup", this.msgBody);
236
+    },
237
+    callScrollToQuoteMsg(msgQuote) {
238
+      this.$emit("scrollToQuoteMessge", msgQuote);
239
+    },
240
+    //前往联系人详情页面
241
+    entryContactsDetailPage(type) {
242
+      if (type === CUSTOM_EVENT_NAME.USER_CARD) {
243
+        const {
244
+          customExts: { uid: userId },
245
+        } = this.msgBody;
246
+        uni.navigateTo({
247
+          url: `../contactsDetail/index?userId=${userId}`,
248
+        });
249
+      } else {
250
+        if (this.msgBody.from === EMClient.user) return;
251
+        const userId = this.msgBody.from;
252
+        uni.navigateTo({
253
+          url: `../contactsDetail/index?userId=${userId}`,
254
+        });
255
+      }
256
+    },
257
+	//跳转商品详情
258
+	entryProductDetailPage(){
259
+		const {
260
+		  customExts: { uid: uid,productId:productId },
261
+		} = this.msgBody;
262
+		uni.navigateToMiniProgram({
263
+			      appId: 'wx9082e5ac2fdb513f',
264
+			      path: `pages/store/product/detail?id=${productId}`,
265
+			  	  envVersion: 'trial', // develop(开发版),trial(体验版),release(正式版)
266
+			      success(res) {
267
+			        // 打开成功
268
+			        console.log(res);
269
+			      },
270
+			      fail: (error) => {
271
+			        console.log(error);
272
+			      }
273
+		})
274
+	}
275
+  },
276
+};
277
+</script>
278
+
279
+<style scoped>
280
+@import "./index.css";
281
+</style>

+ 80 - 0
emChat/emChatContainer/emMessageListContainer/messagesItem/audioMsgItem/index.css

@@ -0,0 +1,80 @@
1
+.audio_msg_container {
2
+  width: 125px;
3
+  height: 36px;
4
+  display: flex;
5
+  justify-content: space-between;
6
+  padding: 0 8px;
7
+  align-items: center;
8
+}
9
+.audio_msg_container_mine {
10
+  color: #f9fafa;
11
+  background: #009eff;
12
+  border-radius: 16px 12px 4px 16px;
13
+}
14
+.audio_msg_container_other {
15
+  flex-direction: row-reverse;
16
+  color: #171a1c;
17
+  background: #e5f5ff;
18
+  border-radius: 12px 16px 16px 4px;
19
+}
20
+.audio_msg_play_icon {
21
+  width: 16px;
22
+  height: 15px;
23
+}
24
+/* mine */
25
+.audio_msg_play_icon_mine {
26
+  background: url('~@/static/images/new_ui/message/audio/mine_playing_icon.png')
27
+    no-repeat;
28
+  background-size: 100% 100%;
29
+}
30
+
31
+@keyframes mine_play_icon {
32
+  0% {
33
+    background: url('~@/static/images/new_ui/message/audio/mine_playing2_icon.png')
34
+      no-repeat;
35
+
36
+    background-size: 100% 100%;
37
+  }
38
+  50% {
39
+    background: url('~@/static/images/new_ui/message/audio/mine_playing_icon.png')
40
+      no-repeat;
41
+    background-size: 100% 100%;
42
+  }
43
+  100% {
44
+    background: url('~@/static/images/new_ui/message/audio/mine_playing2_icon.png')
45
+      no-repeat;
46
+    background-size: 100% 100%;
47
+  }
48
+}
49
+.start_mine_play_audio {
50
+  animation: mine_play_icon 2s;
51
+  animation-iteration-count: infinite;
52
+}
53
+/* other */
54
+.audio_msg_play_icon_other {
55
+  background: url('~@/static/images/new_ui/message/audio/other_playing_icon.png')
56
+    no-repeat;
57
+  background-size: 100% 100%;
58
+}
59
+@keyframes other_play_icon {
60
+  0% {
61
+    background: url('~@/static/images/new_ui/message/audio/other_playing2_icon.png')
62
+      no-repeat;
63
+
64
+    background-size: 100% 100%;
65
+  }
66
+  50% {
67
+    background: url('~@/static/images/new_ui/message/audio/other_playing_icon.png')
68
+      no-repeat;
69
+    background-size: 100% 100%;
70
+  }
71
+  100% {
72
+    background: url('~@/static/images/new_ui/message/audio/other_playing2_icon.png')
73
+      no-repeat;
74
+    background-size: 100% 100%;
75
+  }
76
+}
77
+.start_other_play_audio {
78
+  animation: other_play_icon 2s;
79
+  animation-iteration-count: infinite;
80
+}

+ 118 - 0
emChat/emChatContainer/emMessageListContainer/messagesItem/audioMsgItem/index.vue

@@ -0,0 +1,118 @@
1
+<template>
2
+  <view
3
+    :class="[
4
+      'audio_msg_container',
5
+      isSelf ? 'audio_msg_container_mine' : 'audio_msg_container_other',
6
+    ]"
7
+    @click="playAudioMessage"
8
+  >
9
+    <view
10
+      :class="[
11
+        'audio_msg_play_icon',
12
+        isSelf ? 'audio_msg_play_icon_mine' : 'audio_msg_play_icon_other',
13
+        playAudioMid == msgBody.id
14
+          ? isSelf
15
+            ? 'start_mine_play_audio'
16
+            : 'start_other_play_audio'
17
+          : '',
18
+      ]"
19
+    >
20
+    </view>
21
+    <view class="audio_msg_length">{{ audioLength }}''</view>
22
+  </view>
23
+</template>
24
+
25
+<script>
26
+import { EMClient } from '@/EaseIM';
27
+const loginAccessToken = EMClient.token;
28
+
29
+export default {
30
+  props: {
31
+    msgBody: {
32
+      type: Object,
33
+      default: () => ({}),
34
+    },
35
+    playAudioMid: {
36
+      type: String,
37
+      default: '',
38
+    },
39
+  },
40
+
41
+  data() {
42
+    return {
43
+      innerAudioContext: null,
44
+      isPlaying: false,
45
+    };
46
+  },
47
+  computed: {
48
+    isSelf() {
49
+      const { from } = this.msgBody;
50
+      return (
51
+        from === this.$store.state.LoginStore.loginUserBaseInfos.loginUserId
52
+      );
53
+    },
54
+    audioLength() {
55
+      const { length, body } = this.msgBody;
56
+      return length || body?.length;
57
+    },
58
+  },
59
+  mounted() {
60
+    this.innerAudioContext = uni.createInnerAudioContext({
61
+      obeyMuteSwitch: false,
62
+    });
63
+    this.innerAudioContext.onPlay(() => {
64
+      console.log('>>>>>播放中');
65
+    });
66
+    this.innerAudioContext.onEnded(() => {
67
+      this.$emit('onClickPlayAudio', '');
68
+    });
69
+    this.innerAudioContext.onError((res) => {
70
+      console.log(res.errMsg);
71
+      uni.showToast({ title: '播放失败', icon: 'none' });
72
+    });
73
+  },
74
+  methods: {
75
+    //转换为mp3格式
76
+    formatAudioToMp3() {
77
+      const { url, body } = this.msgBody;
78
+      uni.downloadFile({
79
+        url: url || body?.url,
80
+        header: {
81
+          'X-Requested-With': 'XMLHttpRequest',
82
+          Accept: 'audio/mp3',
83
+          Authorization: 'Bearer ' + loginAccessToken,
84
+        },
85
+
86
+        success: (res) => {
87
+          console.log('>>>>>成功拿到播放地址', res);
88
+          const tempFilePath = res.tempFilePath;
89
+          this.innerAudioContext.src = tempFilePath;
90
+          console.log(this.innerAudioContext.src);
91
+          this.innerAudioContext.play();
92
+        },
93
+
94
+        fail: (e) => {
95
+          console.log('downloadFile failed', e);
96
+          uni.showToast({
97
+            title: '语音转mp3失败',
98
+            duration: 2000,
99
+          });
100
+        },
101
+      });
102
+    },
103
+    playAudioMessage() {
104
+      const { id } = this.msgBody;
105
+      this.formatAudioToMp3();
106
+      console.log('>>>>>通知进行播放');
107
+      this.$emit('onClickPlayAudio', id);
108
+    },
109
+  },
110
+  beforeDestroy() {
111
+    this.innerAudioContext && this.innerAudioContext.destroy();
112
+  },
113
+};
114
+</script>
115
+
116
+<style scoped>
117
+@import './index.css';
118
+</style>

+ 247 - 0
emChat/emChatContainer/emMessageListContainer/messagesItem/fileMsgItem/index.vue

@@ -0,0 +1,247 @@
1
+<template>
2
+  <view
3
+    :class="[
4
+      'file_msg_container',
5
+      isSelf ? 'file_msg_container_mine' : 'file_msg_container_other',
6
+    ]"
7
+    @tap="previewFile"
8
+  >
9
+    <view class="file_msg_content">
10
+      <text class="name u-line-1">
11
+        {{ msgBody.filename || msgBody.body.filename }}
12
+      </text>
13
+      <text class="size">{{
14
+        formatMoney(msgBody.file_length || msgBody.body.file_length)
15
+      }}</text>
16
+    </view>
17
+    <image
18
+      class="file_msg_icon"
19
+      src="/static/images/new_ui/message/file_msg_icon.png"
20
+    />
21
+  </view>
22
+</template>
23
+
24
+<script>
25
+import formatFileSize from "@/utils/formatFileSize";
26
+const ATTACH_KEY = "filePathCache";
27
+export default {
28
+  props: {
29
+    msgBody: {
30
+      type: Object,
31
+      default: () => ({}),
32
+    },
33
+  },
34
+  data() {
35
+    return {};
36
+  },
37
+  computed: {
38
+    isSelf() {
39
+      const { from } = this.msgBody;
40
+      return (
41
+        from === this.$store.state.LoginStore.loginUserBaseInfos.loginUserId
42
+      );
43
+    },
44
+    formatMoney() {
45
+      return (value) => {
46
+        return formatFileSize(value);
47
+      };
48
+    },
49
+  },
50
+  methods: {
51
+    storageFilePath({ id, path }) {
52
+      uni.getStorage({
53
+        key: ATTACH_KEY,
54
+        success: (res) => {
55
+          let dt = res.data || {};
56
+          uni.setStorage({
57
+            key: ATTACH_KEY,
58
+            data: {
59
+              ...dt,
60
+              [id]: path,
61
+            },
62
+          });
63
+        },
64
+        fail: (e) => {
65
+          uni.setStorage({
66
+            key: ATTACH_KEY,
67
+            data: {
68
+              [id]: path,
69
+            },
70
+          });
71
+        },
72
+      });
73
+    },
74
+    downloadFile() {
75
+      // 下载完存储filePath,下次预览直接访问
76
+      console.log("this.msgBody?.url", this.msgBody?.url);
77
+      uni.downloadFile({
78
+        url: `${this.msgBody?.url}`,
79
+        success: (res) => {
80
+          console.log("downloadFile", res);
81
+          let filePath = res.tempFilePath;
82
+          // #ifdef MP-WEIXIN  || MP-TOUTIAO || MP-QQ
83
+          this.saveFileUseManager(filePath);
84
+          // #endif
85
+          // #ifndef MP-WEIXIN  || MP-TOUTIAO || MP-QQ
86
+          this.saveFile(filePath);
87
+          // #endif
88
+        },
89
+        fail: (err) => {
90
+          console.log(">>>>>文件下载失败", err);
91
+          uni.hideLoading();
92
+          uni.showToast({
93
+            icon: "none",
94
+            title: "失败请重新下载",
95
+          });
96
+        },
97
+      });
98
+    },
99
+    saveFile(filePath) {
100
+      uni.saveFile({
101
+        tempFilePath: filePath,
102
+        success: (res) => {
103
+          let savedFilePath = res.savedFilePath;
104
+          this.storageFilePath({
105
+            id: this.msgBody.id,
106
+            path: savedFilePath,
107
+          });
108
+          this.openFile(savedFilePath);
109
+        },
110
+        fail: function (e) {
111
+          uni.hideLoading();
112
+          uni.showToast({
113
+            icon: "none",
114
+            title: "保存失败",
115
+          });
116
+        },
117
+      });
118
+    },
119
+    saveFileUseManager(filePath) {
120
+      console.log(">>>>小程序保存文件调用", filePath);
121
+      const fileExtension =
122
+        this.msgBody.filename.split(".").pop() ||
123
+        this.msgBody.body.filename.split(".").pop();
124
+      const savedFilePath =
125
+        uni.env.USER_DATA_PATH + "/document." + fileExtension;
126
+
127
+      uni.getFileSystemManager().copyFile({
128
+        srcPath: filePath,
129
+        destPath: savedFilePath,
130
+        success: () => {
131
+          console.log(">>>>>小程序savedFilePath", savedFilePath);
132
+          this.storageFilePath({
133
+            id: this.msgBody.id,
134
+            path: savedFilePath,
135
+          });
136
+          this.openFile(savedFilePath);
137
+        },
138
+        fail: (e) => {
139
+          uni.showToast({
140
+            title: "下载失败",
141
+            icon: "none",
142
+          });
143
+        },
144
+      });
145
+    },
146
+    openFile(filePath) {
147
+      uni.openDocument({
148
+        filePath,
149
+        success: function (res) {
150
+          uni.hideLoading();
151
+        },
152
+        fail(e) {
153
+          uni.showToast({
154
+            title: "暂不支持此类型",
155
+            duration: 2000,
156
+          });
157
+          uni.hideLoading();
158
+        },
159
+      });
160
+    },
161
+    previewFile() {
162
+      let sysInfo = uni.getSystemInfoSync();
163
+      if (sysInfo.uniPlatform === "web") {
164
+        uni.showToast({
165
+          title: "H5暂不支持预览文件消息",
166
+          duration: 2000,
167
+          icon: "none",
168
+        });
169
+        return;
170
+      }
171
+      uni.showLoading();
172
+      uni.getStorage({
173
+        key: ATTACH_KEY,
174
+        success: (res) => {
175
+          let dt = res.data || {};
176
+          let path = dt[this.msgBody.id];
177
+          if (path) {
178
+            this.openFile(path);
179
+          } else {
180
+            this.downloadFile();
181
+          }
182
+        },
183
+        fail: (e) => {
184
+          this.downloadFile();
185
+        },
186
+      });
187
+    },
188
+  },
189
+};
190
+</script>
191
+
192
+<style>
193
+.file_msg_container {
194
+  width: 245px;
195
+  height: 60px;
196
+  display: flex;
197
+  align-items: center;
198
+  justify-content: space-between;
199
+  padding: 0 8px;
200
+  box-sizing: border-box;
201
+}
202
+.file_msg_container_mine {
203
+  flex-direction: row-reverse;
204
+  color: #f9fafa;
205
+  background-color: #009eff;
206
+  border-radius: 16px 12px 4px 16px;
207
+}
208
+.file_msg_container_other {
209
+  color: #171a1c;
210
+  background-color: #e5f5ff;
211
+  border-radius: 12px 16px 16px 4px;
212
+}
213
+.file_msg_icon {
214
+  width: 44px;
215
+  height: 44px;
216
+}
217
+.file_msg_content {
218
+  display: flex;
219
+  flex-direction: column;
220
+  height: 42px;
221
+  align-items: flex-start;
222
+}
223
+.file_msg_content .name {
224
+  /* Credo dalle tre alle */
225
+
226
+  height: 24px;
227
+
228
+  /* 简体中文/次级标题/中 */
229
+  font-family: "PingFang SC";
230
+  font-style: normal;
231
+  font-weight: 400;
232
+  font-size: 16px;
233
+  line-height: 22px;
234
+}
235
+.file_msg_content .size {
236
+  /* Alphabet/Body/Medium */
237
+  font-family: "SF Pro";
238
+  font-style: normal;
239
+  font-weight: 400;
240
+  font-size: 14px;
241
+  line-height: 18px;
242
+  /* identical to box height, or 129% */
243
+  letter-spacing: 0.001em;
244
+
245
+  /* Neutral/95 */
246
+}
247
+</style>

+ 63 - 0
emChat/emChatContainer/emMessageListContainer/messagesItem/imageMsgItem/index.vue

@@ -0,0 +1,63 @@
1
+<template>
2
+  <view class="image_msg_container">
3
+    <u--image
4
+      @click="onPrevieImage"
5
+      mode="aspectFit"
6
+      :src="msgBody.thumb || msgBody.url"
7
+      :width="imgSize.width"
8
+      :height="imgSize.height"
9
+      :radius="5 + 'px'"
10
+    >
11
+    </u--image>
12
+  </view>
13
+</template>
14
+
15
+<script>
16
+export default {
17
+  props: {
18
+    msgBody: {
19
+      type: Object,
20
+      default: () => ({}),
21
+    },
22
+  },
23
+  computed: {
24
+    imgSize() {
25
+      let imgSize = {
26
+        width: '',
27
+        height: '',
28
+      };
29
+      if (this.msgBody.width > 1000 || this.msgBody.height > 1000) {
30
+        imgSize.width = this.msgBody.width / 10 + 'px';
31
+        imgSize.height = this.msgBody.height / 10 + 'px';
32
+      } else if (
33
+        this.msgBody.width > 800 < 1000 ||
34
+        this.msgBody.height > 800 < 1000
35
+      ) {
36
+        imgSize.width = this.msgBody.width / 3 + 'px';
37
+        imgSize.height = this.msgBody.height / 3 + 'px';
38
+      } else if (this.msgBody.width < 100 || this.msgBody.height < 100) {
39
+        imgSize.width = this.msgBody.width + 'px';
40
+        imgSize.height = this.msgBody.height + 'px';
41
+      } else {
42
+        imgSize.width = this.msgBody.width / 2 + 'px';
43
+        imgSize.height = this.msgBody.height / 2 + 'px';
44
+      }
45
+      return imgSize;
46
+    },
47
+  },
48
+  data() {
49
+    return {
50
+      src: 'https://cdn.uviewui.com/uview/album/1.jpg',
51
+    };
52
+  },
53
+  methods: {
54
+    onPrevieImage() {
55
+      uni.previewImage({
56
+        urls: [this.msgBody.url],
57
+      });
58
+    },
59
+  },
60
+};
61
+</script>
62
+
63
+<style scoped></style>

+ 120 - 0
emChat/emChatContainer/emMessageListContainer/messagesItem/productCardItem/index.vue

@@ -0,0 +1,120 @@
1
+<template>
2
+ <!-- <view
3
+    :class="[
4
+      'user_card_msg_container',
5
+      isSelf ? 'user_card_msg_container_mine' : 'user_card_msg_container_other',
6
+    ]"
7
+  > -->
8
+  <view>
9
+   <!-- <view class="user_card_content">
10
+      <view class="user_card_content_header">
11
+        <u-avatar shape="square" :src="avatarUrl" size="30"></u-avatar>
12
+        <text class="nickName">{{ msgBody.nickName }} {{msgBody}}</text>
13
+      </view>
14
+      <u-line></u-line>
15
+      <text class="user_card_footer">商品卡片</text>
16
+    </view> -->
17
+	<view class="user_card_content">
18
+			<view class="title">商品名称:{{msgBody.customExts.title}}</view>
19
+			<view>商品价格:¥{{msgBody.customExts.price}}</view>
20
+			<view class="img">
21
+				<img :src="msgBody.customExts.image" alt="">
22
+			</view>
23
+			<!-- <view class="">
24
+				msgBody.from:{{msgBody.from}}
25
+			</view> -->
26
+	</view>
27
+  </view>
28
+</template>
29
+
30
+<script>
31
+export default {
32
+  props: {
33
+    msgBody: {
34
+      type: Object,
35
+      default: () => ({}),
36
+    },
37
+  },
38
+  data() {
39
+    return {
40
+      defaultAvatar: 'https://app.bjtdba.com/uploads/logo.jpg', //默认头像
41
+    };
42
+  },
43
+  computed: {
44
+    // isSelf() {
45
+    //   const { from } = this.msgBody;
46
+    //   return (
47
+    //     from === this.$store.state.LoginStore.loginUserBaseInfos.loginUserId
48
+    //   );
49
+    // },
50
+    // avatarUrl() {
51
+    //   return this.msgBody?.customExts?.avatarurl || this.defaultAvatar;
52
+    // },
53
+    // nickName() {
54
+    //   return (
55
+    //     this.msgBody?.customExts?.nickname || this.msgBody?.customExts?.uid
56
+    //   );
57
+    // },
58
+  },
59
+};
60
+</script>
61
+
62
+<style scoped>
63
+.user_card_msg_container {
64
+  width: 245px;
65
+  height: 60px;
66
+  padding: 5px 8px;
67
+  box-sizing: border-box;
68
+  flex-direction: column;
69
+  align-items: center;
70
+}
71
+.user_card_msg_container_mine {
72
+  flex-direction: row-reverse;
73
+  color: #f9fafa;
74
+  background-color: #009eff;
75
+  border-radius: 16px 12px 4px 16px;
76
+}
77
+.user_card_msg_container_other {
78
+  color: #171a1c;
79
+  background-color: #e5f5ff;
80
+  border-radius: 12px 16px 16px 4px;
81
+}
82
+.user_card_content {
83
+  width:100%;
84
+  height: 100%;
85
+  display: flex;
86
+  box-sizing: border-box;
87
+  padding:10px;
88
+  flex-direction: column;
89
+  justify-content: space-around;
90
+  box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
91
+  background: #eee;
92
+}
93
+.title{
94
+	margin-bottom: 10px;
95
+}
96
+.img{
97
+	width: 200px;
98
+}
99
+.img img{
100
+	width:100%;
101
+	box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
102
+	margin-top: 10px;
103
+}
104
+.user_card_content_header {
105
+  display: flex;
106
+  align-items: center;
107
+  justify-content: flex-start;
108
+}
109
+.user_card_content_header text {
110
+  font-family: 'PingFang SC';
111
+  font-style: normal;
112
+  font-weight: 400;
113
+  font-size: 16px;
114
+  line-height: 22px;
115
+  margin: 0 4px;
116
+}
117
+.user_card_footer {
118
+  font-size: 12px;
119
+}
120
+</style>

+ 149 - 0
emChat/emChatContainer/emMessageListContainer/messagesItem/textMsgItem/index.vue

@@ -0,0 +1,149 @@
1
+<template>
2
+  <view
3
+    :class="[
4
+      'text_msg_contatiner',
5
+      isSelf(msgBody)
6
+        ? 'text_msg_contatiner_mine'
7
+        : 'text_msg_contatiner_other',
8
+    ]"
9
+  >
10
+    {{ msgBody.msg }}
11
+    <text
12
+      :class="isSelf(msgBody) ? 'edited_text_msg' : 'edited_text_msg_other'"
13
+      v-if="msgBody.modifiedInfo"
14
+      >已编辑</text
15
+    >
16
+  </view>
17
+</template>
18
+
19
+<script>
20
+export default {
21
+  props: {
22
+    msgBody: {
23
+      type: Object,
24
+      default: () => ({}),
25
+    },
26
+  },
27
+  data() {
28
+    return {};
29
+  },
30
+  computed: {
31
+    isSelf() {
32
+      return (item) => {
33
+        return (
34
+          item.from ===
35
+          this.$store.state.LoginStore.loginUserBaseInfos.loginUserId
36
+        );
37
+      };
38
+    },
39
+  },
40
+  methods: {},
41
+};
42
+</script>
43
+
44
+<style scoped>
45
+.text_msg_contatiner {
46
+  /* 简体中文/文本/大 */
47
+  font-family: 'PingFang SC';
48
+  font-style: normal;
49
+  font-weight: 400;
50
+  font-size: 16px;
51
+  line-height: 22px;
52
+  /* or 138% */
53
+
54
+  /* Neutral/1 */
55
+  color: #171a1c;
56
+  /* Inside auto layout */
57
+  flex: none;
58
+  order: 0;
59
+  flex-grow: 0;
60
+}
61
+.text_msg_contatiner_other {
62
+  /* Frame 613 */
63
+
64
+  /* Auto layout */
65
+  display: flex;
66
+  flex-direction: column;
67
+  align-items: flex-start;
68
+  padding: 7px 12px;
69
+  /* Primary/5 */
70
+
71
+  background: #e6f5ff;
72
+  border-radius: 12px 16px 16px 4px;
73
+
74
+  /* Alphabet/Body/Large */
75
+  font-family: 'SF Pro';
76
+  font-style: normal;
77
+  font-weight: 400;
78
+  font-size: 16px;
79
+  line-height: 22px;
80
+  /* or 138% */
81
+  letter-spacing: 0.002em;
82
+
83
+  /* Neutral/98 */
84
+  color: #171a1c;
85
+
86
+  /* Inside auto layout */
87
+  flex: none;
88
+  order: 0;
89
+  flex-grow: 0;
90
+}
91
+.text_msg_contatiner_mine {
92
+  /* Frame 613 */
93
+
94
+  /* Auto layout */
95
+  display: flex;
96
+  flex-direction: column;
97
+  align-items: flex-start;
98
+  padding: 7px 12px;
99
+
100
+  /* Primary/95 */
101
+  background: #009eff;
102
+  border-radius: 16px 12px 4px 16px;
103
+
104
+  /* Sei la cosa più bella che mi sia mai capitata, non so stare senza te. */
105
+
106
+  /* Alphabet/Body/Large */
107
+  font-family: 'SF Pro';
108
+  font-style: normal;
109
+  font-weight: 400;
110
+  font-size: 16px;
111
+  line-height: 22px;
112
+  /* or 138% */
113
+  letter-spacing: 0.002em;
114
+
115
+  /* Neutral/1 */
116
+  color: #f9fafa;
117
+
118
+  /* Inside auto layout */
119
+  flex: none;
120
+  order: 0;
121
+  flex-grow: 0;
122
+}
123
+.edited_text_msg,
124
+.edited_text_msg_other {
125
+  /* 已编辑 */
126
+  width: 100%;
127
+  /* 简体中文/文本/超小 */
128
+  font-family: 'PingFang SC';
129
+  font-style: normal;
130
+  font-weight: 400;
131
+  font-size: 11px;
132
+  line-height: 14px;
133
+  /* identical to box height, or 127% */
134
+  text-align: right;
135
+
136
+  /* Neutral Special/98 */
137
+  color: #f8f9fc;
138
+
139
+  /* Inside auto layout */
140
+  flex: none;
141
+  order: 1;
142
+  flex-grow: 0;
143
+  text-align: right;
144
+}
145
+.edited_text_msg_other {
146
+  color: #5270ad;
147
+  text-align: left;
148
+}
149
+</style>

+ 93 - 0
emChat/emChatContainer/emMessageListContainer/messagesItem/userCardItem/index.vue

@@ -0,0 +1,93 @@
1
+<template>
2
+  <view
3
+    :class="[
4
+      'user_card_msg_container',
5
+      isSelf ? 'user_card_msg_container_mine' : 'user_card_msg_container_other',
6
+    ]"
7
+  >
8
+    <view class="user_card_content">
9
+      <view class="user_card_content_header">
10
+        <u-avatar shape="square" :src="avatarUrl" size="30"></u-avatar>
11
+        <text class="nickName">{{ nickName }}</text>
12
+      </view>
13
+      <u-line></u-line>
14
+      <text class="user_card_footer">个人名片</text>
15
+    </view>
16
+  </view>
17
+</template>
18
+
19
+<script>
20
+export default {
21
+  props: {
22
+    msgBody: {
23
+      type: Object,
24
+      default: () => ({}),
25
+    },
26
+  },
27
+  data() {
28
+    return {
29
+      defaultAvatar: '/static/images/new_ui/defaultAvatar.png',
30
+    };
31
+  },
32
+  computed: {
33
+    isSelf() {
34
+      const { from } = this.msgBody;
35
+      return (
36
+        from === this.$store.state.LoginStore.loginUserBaseInfos.loginUserId
37
+      );
38
+    },
39
+    avatarUrl() {
40
+      return this.msgBody?.customExts?.avatarurl || this.defaultAvatar;
41
+    },
42
+    nickName() {
43
+      return (
44
+        this.msgBody?.customExts?.nickname || this.msgBody?.customExts?.uid
45
+      );
46
+    },
47
+  },
48
+};
49
+</script>
50
+
51
+<style scoped>
52
+.user_card_msg_container {
53
+  width: 245px;
54
+  height: 60px;
55
+  padding: 5px 8px;
56
+  box-sizing: border-box;
57
+  flex-direction: column;
58
+  align-items: center;
59
+}
60
+.user_card_msg_container_mine {
61
+  flex-direction: row-reverse;
62
+  color: #f9fafa;
63
+  background-color: #009eff;
64
+  border-radius: 16px 12px 4px 16px;
65
+}
66
+.user_card_msg_container_other {
67
+  color: #171a1c;
68
+  background-color: #e5f5ff;
69
+  border-radius: 12px 16px 16px 4px;
70
+}
71
+.user_card_content {
72
+  height: 100%;
73
+  display: flex;
74
+  flex-direction: column;
75
+  justify-content: space-around;
76
+}
77
+.user_card_content_header {
78
+  display: flex;
79
+  align-items: center;
80
+  justify-content: flex-start;
81
+}
82
+.user_card_content_header text {
83
+  font-family: 'PingFang SC';
84
+  font-style: normal;
85
+  font-weight: 400;
86
+  font-size: 16px;
87
+  line-height: 22px;
88
+  margin: 0 4px;
89
+}
90
+.user_card_footer {
91
+  font-size: 12px;
92
+}
93
+</style>

+ 54 - 0
emChat/emChatContainer/emMessageListContainer/msgQuoteContainer/index.vue

@@ -0,0 +1,54 @@
1
+<template>
2
+  <view class="msg_quote_container u-line-2">
3
+    <text>{{ msgQuoteContent.msgSender }}</text
4
+    >:<text>{{ msgQuotePreview }}</text></view
5
+  >
6
+</template>
7
+
8
+<script>
9
+import { MESSAGE_STATUS } from '@/EaseIM/constant';
10
+
11
+export default {
12
+  props: {
13
+    msgQuoteContent: {
14
+      type: Object,
15
+      default: () => ({
16
+        msgID: '', //引用消息id
17
+        msgPreview: '', //引用消息预览
18
+        msgSender: '', //引用消息发送人
19
+        msgType: '', //引用消息类型
20
+      }),
21
+      required: true,
22
+    },
23
+  },
24
+  computed: {
25
+    messageStatusCollection() {
26
+      return this.$store.getters.messageStatusCollection;
27
+    },
28
+    msgQuotePreview() {
29
+      if (
30
+        this.messageStatusCollection[this.msgQuoteContent.msgID] ===
31
+        MESSAGE_STATUS.RECALL
32
+      ) {
33
+        return '消息被撤回';
34
+      } else {
35
+        return this.msgQuoteContent.msgPreview;
36
+      }
37
+    },
38
+  },
39
+};
40
+</script>
41
+
42
+<style scoped>
43
+.msg_quote_container {
44
+  width: 100%;
45
+  max-width: 70%;
46
+  min-width: 100px;
47
+  background-color: #f1f2f3;
48
+  border-radius: 4px;
49
+  color: #75828a;
50
+  padding: 8px 12px 8px 12px;
51
+  font-size: 14px;
52
+  word-break: break-all;
53
+}
54
+</style>

+ 273 - 0
emChat/emChatContainer/emMessagePopup/index.vue

@@ -0,0 +1,273 @@
1
+<template>
2
+  <view>
3
+    <u-popup round="16" :show="show" @close="close" @open="open">
4
+      <view class="message_more_func_container">
5
+        <!-- 复制 -->
6
+        <view
7
+          v-if="msgBody.type === MESSAGE_TYPE.TEXT"
8
+          class="message_more_func_item u-border-bottom"
9
+          @click="copyTextMessage"
10
+        >
11
+          <u-icon
12
+            class="message_more_func_item_content_icon"
13
+            size="24"
14
+            name="/static/images/new_ui/message/messagPopup/copy_msg_icon.png"
15
+          ></u-icon>
16
+          <text class="message_more_func_item_title">复制</text>
17
+        </view>
18
+        <!-- 回复 -->
19
+        <view
20
+          class="message_more_func_item u-border-bottom"
21
+          @click="replyMessage"
22
+        >
23
+          <u-icon
24
+            class="message_more_func_item_content_icon"
25
+            size="24"
26
+            name="/static/images/new_ui/message/messagPopup/reply_msg_icon.png"
27
+          ></u-icon>
28
+          <text class="message_more_func_item_title">回复</text>
29
+        </view>
30
+        <!-- 编辑 -->
31
+        <view
32
+          v-if="isSelf && msgBody.type === MESSAGE_TYPE.TEXT"
33
+          class="message_more_func_item u-border-bottom"
34
+          @click="editMessage"
35
+        >
36
+          <u-icon
37
+            class="message_more_func_item_content_icon"
38
+            size="24"
39
+            name="/static/images/new_ui/message/messagPopup/edit_msg_icon.png"
40
+          ></u-icon>
41
+          <text class="message_more_func_item_title">编辑</text>
42
+        </view>
43
+        <!-- 删除 -->
44
+        <view
45
+          class="message_more_func_item u-border-bottom"
46
+          @click="alertSencondConfirmModal"
47
+        >
48
+          <u-icon
49
+            class="message_more_func_item_content_icon"
50
+            size="24"
51
+            name="/static/images/new_ui/message/messagPopup/del_msg_icon.png"
52
+          ></u-icon>
53
+          <text class="message_more_func_item_title">删除</text>
54
+        </view>
55
+        <!-- 撤回 -->
56
+        <view
57
+          v-if="isSelf"
58
+          class="message_more_func_item u-border-bottom"
59
+          @click="recallMessage"
60
+        >
61
+          <u-icon
62
+            class="message_more_func_item_content_icon"
63
+            size="24"
64
+            name="/static/images/new_ui/message/messagPopup/recall_msg_icon.png"
65
+          ></u-icon>
66
+          <text class="message_more_func_item_title">撤回</text>
67
+        </view>
68
+      </view>
69
+    </u-popup>
70
+    <u-modal
71
+      :show="isShowSencondConfirmModal"
72
+      :zoom="true"
73
+      title="确认删除这条消息?"
74
+      content="删除后,对方依旧可以看到这条消息。"
75
+      confirm-text="确认"
76
+      cancel-text="取消"
77
+      show-cancel-button
78
+      @confirm="deleteLocalMessage"
79
+      @cancel="isShowSencondConfirmModal = false"
80
+    >
81
+    </u-modal>
82
+  </view>
83
+</template>
84
+
85
+<script>
86
+import { EMClient } from '@/EaseIM';
87
+import { getEMKey } from '@/EaseIM/utils';
88
+import { emAboutAck } from '@/EaseIM/emApis';
89
+import { MESSAGE_TYPE, MESSAGE_STATUS } from '@/EaseIM/constant';
90
+const { sendRecallAckMsg } = emAboutAck();
91
+export default {
92
+  data() {
93
+    return {
94
+      MESSAGE_TYPE,
95
+      show: false,
96
+      isShowSencondConfirmModal: false,
97
+      msgBody: {},
98
+    };
99
+  },
100
+  computed: {
101
+    isSelf() {
102
+      const { from } = this.msgBody;
103
+      return (
104
+        from === this.$store.state.LoginStore.loginUserBaseInfos.loginUserId
105
+      );
106
+    },
107
+  },
108
+  methods: {
109
+    open() {
110
+      // console.log('open');
111
+    },
112
+    close() {
113
+      this.show = false;
114
+    },
115
+    alertMessagePopup(msgBody) {
116
+      this.msgBody = Object.assign({}, msgBody);
117
+      this.show = true;
118
+    },
119
+    //复制文本消息至剪切板
120
+    copyTextMessage() {
121
+      uni.setClipboardData({
122
+        data: this.msgBody.msg,
123
+        success: (res) => {
124
+          uni.showToast({
125
+            title: '已复制',
126
+            icon: 'none',
127
+          });
128
+        },
129
+        fail: (e) => {
130
+          console.log('文本复制失败', e);
131
+          uni.showToast({
132
+            title: '复制失败',
133
+            icon: 'none',
134
+          });
135
+        },
136
+        complete: () => {
137
+          this.show = false;
138
+        },
139
+      });
140
+    },
141
+    //回复消息
142
+    replyMessage() {
143
+      this.$emit('callReplyMessage');
144
+      this.show = false;
145
+    },
146
+    //编辑消息
147
+    editMessage() {
148
+      this.$emit('callEditMessage');
149
+      this.show = false;
150
+    },
151
+    //弹出二次确认模态框【删除消息】
152
+    alertSencondConfirmModal() {
153
+      this.isShowSencondConfirmModal = true;
154
+      this.show = false;
155
+    },
156
+    //删除本地消息
157
+    deleteLocalMessage() {
158
+      const key = getEMKey(
159
+        EMClient.user,
160
+        this.msgBody.from,
161
+        this.msgBody.to,
162
+        this.msgBody.chatType
163
+      );
164
+      const params = {
165
+        key: key,
166
+        mid: this.msgBody.id,
167
+      };
168
+      this.$store.commit('DELETE_MESSAGE_FROM_COLLECTION', params);
169
+      uni.showToast({
170
+        icon: 'none',
171
+        title: '删除成功',
172
+      });
173
+      this.isShowSencondConfirmModal = false;
174
+    },
175
+    //撤回消息
176
+    async recallMessage() {
177
+      try {
178
+        const params = {
179
+          mid: this.msgBody.id,
180
+          to: this.msgBody.to,
181
+          chatType: this.msgBody.chatType,
182
+        };
183
+        await sendRecallAckMsg(params);
184
+        uni.showToast({
185
+          title: '撤回成功',
186
+          icon: 'none',
187
+        });
188
+        //向消息状态集合缓存中更新该条消息的状态
189
+        this.$store.commit('UPDATE_MESSAGE_COLLECTION_STATUS', {
190
+          key: params.mid,
191
+          status: MESSAGE_STATUS.RECALL,
192
+        });
193
+      } catch (error) {
194
+        console.log('撤回失败', error);
195
+        if (error?.type === 504) {
196
+          uni.showToast({
197
+            title: '已超过可撤回时间',
198
+            icon: 'none',
199
+          });
200
+          return false;
201
+        }
202
+        uni.showToast({
203
+          title: '撤回失败',
204
+          icon: 'none',
205
+        });
206
+      } finally {
207
+        this.show = false;
208
+      }
209
+    },
210
+  },
211
+};
212
+</script>
213
+
214
+<style scoped>
215
+.message_more_func_container {
216
+  width: 100%;
217
+  padding: 20px 15px 20px 15px;
218
+}
219
+.message_more_func_item {
220
+  display: flex;
221
+  flex-direction: row;
222
+  justify-content: flex-start;
223
+  align-items: center;
224
+  width: 100%;
225
+  height: 56px;
226
+}
227
+.message_more_func_item_title {
228
+  /* Enabled */
229
+
230
+  width: 32px;
231
+  height: 22px;
232
+
233
+  /* 简体中文/文本/大 */
234
+  font-family: 'PingFang SC';
235
+  font-style: normal;
236
+  font-weight: 400;
237
+  font-size: 16px;
238
+  line-height: 22px;
239
+  /* identical to box height, or 138% */
240
+  text-align: center;
241
+
242
+  /* Neutral/1 */
243
+  color: #171a1c;
244
+
245
+  /* Inside auto layout */
246
+  flex: none;
247
+  order: 1;
248
+  flex-grow: 0;
249
+}
250
+.modal_text_content {
251
+  /* A message should be a short, complete sentence. */
252
+
253
+  width: 308.28px;
254
+  height: 18px;
255
+
256
+  /* 简体中文/标签/中 */
257
+  font-family: 'PingFang SC';
258
+  font-style: normal;
259
+  font-weight: 400;
260
+  font-size: 14px;
261
+  line-height: 18px;
262
+  /* identical to box height, or 129% */
263
+  text-align: center;
264
+
265
+  /* Neutral/5 */
266
+  color: #75828a;
267
+
268
+  /* Inside auto layout */
269
+  flex: none;
270
+  order: 1;
271
+  flex-grow: 0;
272
+}
273
+</style>

+ 0 - 0
emChat/emChatContainer/emSelectUserCard/index.css


+ 270 - 0
emChat/emChatContainer/emSelectUserCard/index.vue

@@ -0,0 +1,270 @@
1
+<template>
2
+  <view>
3
+    <u-navbar
4
+      title="选择朋友"
5
+      :safeAreaInsetTop="true"
6
+      :placeholder="true"
7
+      :fixed="true"
8
+      leftIcon="close"
9
+      :autoBack="true"
10
+    >
11
+    </u-navbar>
12
+    <!-- 好友列表 -->
13
+    <view>
14
+      <u-list @scrolltolower="scrolltolower">
15
+        <u-list-item v-for="(friendItem, index) in friendList" :key="index">
16
+          <!-- 展示的cell不能为当前聊天中的好友 -->
17
+          <u-cell
18
+            v-if="chattingId !== friendItem.userId"
19
+            @click="openWaitSendModal(friendItem.userId)"
20
+          >
21
+            <u-avatar
22
+              slot="icon"
23
+              shape="square"
24
+              size="40"
25
+              :src="showFriendAvatar(friendItem)"
26
+              customStyle="margin: -3px 5px -3px 0"
27
+            ></u-avatar>
28
+            <view slot="title">
29
+              <u--text
30
+                :lines="1"
31
+                :text="showFriendNickname(friendItem)"
32
+                iconStyle="margin-left: 2px;"
33
+              ></u--text>
34
+            </view>
35
+          </u-cell>
36
+        </u-list-item>
37
+      </u-list>
38
+    </view>
39
+    <!-- 待发送modal -->
40
+    <u-modal
41
+      :show="isShowWaitSendModal"
42
+      :zoom="true"
43
+      title="发送名片"
44
+      async-close
45
+      show-cancel-button
46
+      confirm-text="发送"
47
+      cancel-text="取消"
48
+      @confirm="sendUserCardMessage"
49
+      @cancel="closeWaitSendModal"
50
+    >
51
+      <view class="content_box">
52
+        <text class="send_target_title">发送给:</text>
53
+        <view class="send_target_user_info">
54
+          <image
55
+            class="send_target_avatar"
56
+            :src="showFriendAvatar(chattingId)"
57
+          ></image>
58
+          <text class="send_target_nickname">{{
59
+            showFriendNickname({ userId: chattingId })
60
+          }}</text>
61
+        </view>
62
+        <text class="wait_send_user_nickname"
63
+          >[个人名片] {{ waitSendUserNickname || waitSendUserId || '' }}</text
64
+        >
65
+        <u-input
66
+          class="leave_message_input"
67
+          v-model="leaveMessageInput"
68
+          placeholder="给朋友留言"
69
+          type="text"
70
+          maxlength="100"
71
+        />
72
+      </view>
73
+    </u-modal>
74
+  </view>
75
+</template>
76
+
77
+<script>
78
+import { emMessages } from '@/EaseIM/emApis';
79
+import { MESSAGE_TYPE } from '@/EaseIM/constant';
80
+const { sendDisplayMessages } = emMessages();
81
+export default {
82
+  data() {
83
+    return {
84
+      sendTargetInfo: {
85
+        userId: '',
86
+        chatType: '',
87
+      },
88
+      isShowWaitSendModal: false,
89
+      waitSendUserId: '',
90
+      waitSendUserNickname: '',
91
+      leaveMessageInput: '',
92
+      defaultAvatar: '/static/images/new_ui/defaultAvatar.png',
93
+    };
94
+  },
95
+
96
+  computed: {
97
+    chattingId() {
98
+      return this.$store.getters.chattingId;
99
+    },
100
+    chattingChatType() {
101
+      return this.$store.getters.chattingChatType;
102
+    },
103
+    //好友列表
104
+    friendList() {
105
+      return this.$store.state.ContactsStore.friendList;
106
+    },
107
+    friendUserInfoCollection() {
108
+      return this.$store.getters.friendUserInfoCollection;
109
+    },
110
+    //好友头像展示
111
+    showFriendAvatar() {
112
+      return (hxId) => {
113
+        if (
114
+          this.friendUserInfoCollection[hxId] &&
115
+          this.friendUserInfoCollection[hxId]?.avatarurl
116
+        ) {
117
+          return this.friendUserInfoCollection[hxId].avatarurl;
118
+        } else {
119
+          return this.defaultAvatar;
120
+        }
121
+      };
122
+    },
123
+    //好友昵称展示
124
+    showFriendNickname() {
125
+      return (userItem) => {
126
+        const { userId, remark } = userItem;
127
+        if (remark) {
128
+          return remark;
129
+        }
130
+        if (
131
+          this.friendUserInfoCollection[userId] &&
132
+          this.friendUserInfoCollection[userId]?.nickname
133
+        ) {
134
+          return this.friendUserInfoCollection[userId].nickname;
135
+        } else {
136
+          return userId;
137
+        }
138
+      };
139
+    },
140
+  },
141
+  methods: {
142
+    scrolltolower() {},
143
+    loginUserAvactar() {
144
+      return (
145
+        this.$store.state.LoginStore.loginUserProfiles?.avatarurl ||
146
+        this.defaultAvatar
147
+      );
148
+    },
149
+    openWaitSendModal(userId) {
150
+      console.log('>>>>>>>111', userId);
151
+      this.isShowWaitSendModal = true;
152
+      this.$nextTick(() => {
153
+        this.waitSendUserId = userId;
154
+        this.getWaitSendUserInfo(userId);
155
+      });
156
+    },
157
+    getWaitSendUserInfo(userId) {
158
+      if (this.friendUserInfoCollection[userId]) {
159
+        this.waitSendUserNickname =
160
+          this.friendUserInfoCollection[userId].nickname;
161
+        return this.friendUserInfoCollection[userId];
162
+      }
163
+    },
164
+    closeWaitSendModal() {
165
+      this.isShowWaitSendModal = false;
166
+      this.waitSendUserId = '';
167
+      this.waitSendUserNickname = '';
168
+    },
169
+    async sendUserCardMessage() {
170
+      const customEvent = 'userCard';
171
+      if (!this.chattingId) return;
172
+      const friendInfo = this.getWaitSendUserInfo(this.waitSendUserId);
173
+      const customExtParams = {
174
+        uid: this.waitSendUserId,
175
+        ...friendInfo,
176
+      };
177
+      const params = {
178
+        type: MESSAGE_TYPE.CUSTOM,
179
+        // 消息接收方:单聊为对方用户 ID,群聊和聊天室分别为群组 ID 和聊天室 ID。
180
+        to: this.chattingId,
181
+        // 会话类型:单聊、群聊和聊天室分别为 `singleChat`、`groupChat` 和 `chatRoom`。
182
+        chatType: this.chattingChatType,
183
+        customEvent,
184
+        customExts: { ...customExtParams },
185
+      };
186
+      try {
187
+        await sendDisplayMessages({ ...params });
188
+        if (this.leaveMessageInput) {
189
+          this.sendLeaveTextMessage();
190
+        }
191
+      } catch (error) {
192
+        uni.showToast({
193
+          title: '消息发送失败',
194
+          icon: 'none',
195
+        });
196
+      } finally {
197
+        this.isShowWaitSendModal = false;
198
+        uni.navigateBack();
199
+      }
200
+    },
201
+    async sendLeaveTextMessage() {
202
+      const params = {
203
+        // 消息类型。
204
+        type: 'txt',
205
+        // 消息内容。
206
+        msg: this.leaveMessageInput,
207
+        // 消息接收方:单聊为对方用户 ID,群聊和聊天室分别为群组 ID 和聊天室 ID。
208
+        to: this.chattingId,
209
+        // 会话类型:单聊、群聊和聊天室分别为 `singleChat`、`groupChat` 和 `chatRoom`。
210
+        chatType: this.chattingChatType,
211
+      };
212
+      try {
213
+        const res = await sendDisplayMessages({ ...params });
214
+        console.log('>>>>>留言消息发送成功', res);
215
+      } catch (error) {
216
+        console.log('>>>>>留言消息发送失败', error);
217
+        uni.showToast({
218
+          title: '消息发送失败',
219
+          icon: 'none',
220
+        });
221
+      } finally {
222
+        this.leaveMessageInput = '';
223
+        uni.hideKeyboard && uni.hideKeyboard();
224
+      }
225
+    },
226
+  },
227
+};
228
+</script>
229
+
230
+<style scoped>
231
+.content_box {
232
+  width: 100%;
233
+  display: flex;
234
+  flex-direction: column;
235
+}
236
+.send_target_user_info {
237
+  display: flex;
238
+  justify-content: flex-start;
239
+  align-items: center;
240
+  border-bottom: 1rpx solid #eee;
241
+}
242
+.send_target_title {
243
+  font-size: 33rpx;
244
+  color: #333;
245
+  font-weight: 600;
246
+}
247
+.send_target_avatar {
248
+  width: 60rpx;
249
+  height: 60rpx;
250
+  border-radius: 50%;
251
+  margin-right: 20rpx;
252
+}
253
+.send_target_nickname {
254
+  font-size: 35rpx;
255
+  color: #333;
256
+  font-weight: 500;
257
+}
258
+.wait_send_user_nickname {
259
+  font-size: 22rpx;
260
+  color: rgba(51, 51, 51, 0.6);
261
+  font-weight: 500;
262
+  overflow: hidden;
263
+  margin-top: 20rpx;
264
+}
265
+.leave_message_input {
266
+  margin-top: 10rpx;
267
+  background-color: #f7f7f7;
268
+  border-radius: 5rpx;
269
+}
270
+</style>

+ 18 - 0
emChat/emChatContainer/index.css

@@ -0,0 +1,18 @@
1
+page {
2
+  background-color: #fafafa;
3
+  height: 100%;
4
+}
5
+.click_more_history_box {
6
+  /* Mth DD, HH:MM */
7
+  /* Alphabet/Body/Small */
8
+  font-family: 'SF Pro';
9
+  font-style: normal;
10
+  font-weight: 400;
11
+  font-size: 12px;
12
+  line-height: 16px;
13
+  /* identical to box height, or 133% */
14
+  text-align: center;
15
+
16
+  /* Neutral/7 */
17
+  color: #acb4b9;
18
+}

+ 421 - 0
emChat/emChatContainer/index.vue

@@ -0,0 +1,421 @@
1
+<template>
2
+  <view>
3
+    <!-- <em-chat /> -->
4
+    <z-paging
5
+      ref="paging"
6
+      v-model="dataList"
7
+      use-chat-record-mode
8
+      :default-page-size="20"
9
+      :safe-area-inset-bottom="true"
10
+      @query="queryList"
11
+      use-page-scroll
12
+    >
13
+      <template #top>
14
+        <em-chat-navbar :targetId="targetId" :chatType="chatType" />
15
+      </template>
16
+      <!-- 聊天item,:id="`z-paging-${index}`"必须加 -->
17
+      <view
18
+        class="click_more_history_box"
19
+        v-if="isLoadingLocalMsgList"
20
+        @click="onClickLoadMore"
21
+        >如无更多,试试点击加载更多</view
22
+      >
23
+      <view
24
+        v-for="(msgBody, index) in dataList"
25
+        :key="msgBody.id"
26
+        :id="'mid' + msgBody.id"
27
+      >
28
+        <em-message-list-container
29
+          ref="emMessageListComps"
30
+          v-show="
31
+            isShowMessageItem(msgBody) &&
32
+            msgBody.type !== MESSAGE_TYPE.GRAY_INFORM
33
+          "
34
+          :msgBody="msgBody"
35
+          :isNeedShowMessageTime="isNeedShowMessageTime(msgBody, index)"
36
+          :quoteMsgId="quoteMsgId"
37
+          @alertMessagePopup="alertMessagePopup"
38
+          @scrollToQuoteMessge="scrollToQuoteMessge"
39
+        />
40
+        <!-- 灰色系统通知类型消息 -->
41
+        <em-gray-message-container
42
+          v-show="
43
+            !isShowMessageItem(msgBody) ||
44
+            msgBody.type === MESSAGE_TYPE.GRAY_INFORM
45
+          "
46
+          :msgBody="msgBody"
47
+          @reEditTextMessage="reEditTextMessage"
48
+        />
49
+      </view>
50
+      <!-- 底部聊天输入框 -->
51
+      <template #bottom>
52
+        <em-input-bar-container
53
+          ref="emInputBarComps"
54
+          @resetScrollHeight="resetScrollHeight"
55
+          :checkedPopupMsgBody="checkedPopupMsgBody"
56
+        />
57
+        <em-message-popup
58
+          ref="emMessagePopupComps"
59
+          @callReplyMessage="callReplyMessage"
60
+          @callEditMessage="callEditMessage"
61
+        />
62
+      </template>
63
+    </z-paging>
64
+  </view>
65
+</template>
66
+
67
+<script>
68
+
69
+import EmChatNavbar from "./emChatNavbar";
70
+import EmMessageListContainer from "./emMessageListContainer";
71
+import EmInputBarContainer from "./emInputBarContainer";
72
+import EmGrayMessageContainer from "./emGrayMessageContainer";
73
+import EmMessagePopup from "./emMessagePopup";
74
+import { CHAT_TYPE, MESSAGE_STATUS } from "@/EaseIM/constant";
75
+import { EVENT_BUS_NAME } from "@/constant";
76
+import { MESSAGE_TYPE } from "../../EaseIM/constant";
77
+import { ZPaging } from "@/uni_modules/z-paging/components/z-paging/z-paging";
78
+export default {
79
+  components: {
80
+    EmChatNavbar,
81
+    EmMessageListContainer,
82
+    EmInputBarContainer,
83
+    EmGrayMessageContainer,
84
+    EmMessagePopup,
85
+	ZPaging
86
+  },
87
+  data() {
88
+    return {
89
+      MESSAGE_STATUS,
90
+      MESSAGE_TYPE,
91
+      targetId: "",
92
+      chatType: "",
93
+	 
94
+      //v-model绑定的这个变量不要在分页请求结束中自己赋值!!!
95
+      dataList: [],
96
+      isLoadingLocalMsgList: false,
97
+      checkedPopupMsgBody: {}, //当msg popup弹起时选中的消息体
98
+      quoteMsgId: "",
99
+    };
100
+  },
101
+
102
+  onLoad(option) {
103
+    console.log(option);
104
+    this.targetId = option.targetId;
105
+    this.chatType = option.chatType;
106
+	
107
+    this.$store.commit("SET_CHATING_USER_INFO", {
108
+      targetId: this.targetId,
109
+      chatType: this.chatType,
110
+	 
111
+    });
112
+  },
113
+  onPageScroll(e) {
114
+    //更新z-paging内部scrollTop
115
+    this.$refs.paging.updatePageScrollTop(e.scrollTop);
116
+    //如果滚动到顶部,触发加载更多聊天记录
117
+    if (e.scrollTop < 10) {
118
+      this.$refs.paging.doChatRecordLoadMore();
119
+    }
120
+  },
121
+  provide() {
122
+    return {
123
+      targetId: () => this.targetId,
124
+      chatType: () => this.chatType,
125
+    };
126
+  },
127
+  mounted() {
128
+    uni.$on(
129
+      EVENT_BUS_NAME.EASEIM_MESSAGE_COLLECTION_UPDATE,
130
+      this.appentNewMessage
131
+    );
132
+    uni.$on(
133
+      EVENT_BUS_NAME.EASEIM_MESSAGE_COLLECTION_DELETE,
134
+      this.onDeleteMessage
135
+    );
136
+    uni.$on(
137
+      EVENT_BUS_NAME.EASEIM_MESSAGE_COLLECTION_MODIFY,
138
+      this.onModifyMessage
139
+    );
140
+  },
141
+  computed: {
142
+    joinedGroupList() {
143
+      return this.$store.state.GroupStore.joinedGroupList;
144
+    },
145
+    friendUserInfoCollection() {
146
+      return this.$store.getters.friendUserInfoCollection;
147
+    },
148
+    messageList() {
149
+      return this.$store.state.MessageStore.messageCollection[this.targetId];
150
+    },
151
+    messageCollectionStatus() {
152
+      return this.$store.getters.messageStatusCollection;
153
+    },
154
+    //recall delete 两种消息状态不展示对应消息item
155
+    isShowMessageItem() {
156
+      return (msgBody) => {
157
+        if (!msgBody.id) return false;
158
+        if (
159
+          this.messageCollectionStatus &&
160
+          this.messageCollectionStatus[msgBody.id] === MESSAGE_STATUS.DELETE
161
+        ) {
162
+          return false;
163
+        } else if (
164
+          this.messageCollectionStatus &&
165
+          this.messageCollectionStatus[msgBody.id] === MESSAGE_STATUS.RECALL
166
+        ) {
167
+          return false;
168
+        } else {
169
+          return true;
170
+        }
171
+      };
172
+    },
173
+    //两条消息之差大于5min,方可展示消息时间。
174
+    isNeedShowMessageTime() {
175
+      return (msgBody, index) => {
176
+        const { time } = msgBody;
177
+
178
+        if (index !== 0) {
179
+          const lastTime = this.dataList[index - 1]?.time;
180
+
181
+          if (time - lastTime > 300000) {
182
+            return true;
183
+          } else {
184
+            return false;
185
+          }
186
+        } else {
187
+          return true;
188
+        }
189
+      };
190
+    },
191
+  },
192
+  watch: {
193
+    messageList() {
194
+      console.log(">>>>监听到消息列表变化");
195
+      this.$store.dispatch("updateConversationLastMsg", {
196
+        conversationId: this.targetId,
197
+      });
198
+    },
199
+  },
200
+  methods: {
201
+    getGroupName(groupid) {
202
+      let groupName = "";
203
+      if (this.joinedGroupList.length) {
204
+        this.joinedGroupList.forEach((item) => {
205
+          if (item.groupid === groupid) {
206
+            console.log(item.groupname);
207
+            return (groupName = item.groupname);
208
+          }
209
+        });
210
+        console.log("groupName", groupName);
211
+        return groupName;
212
+      } else {
213
+        return groupid;
214
+      }
215
+    },
216
+    getTheIdName(targetId, chatType) {
217
+      if (chatType === CHAT_TYPE.SINGLE_CHAT) {
218
+        const friendInfo = this.friendUserInfoCollection[targetId];
219
+		
220
+        return friendInfo?.nickname || targetId;
221
+      }
222
+      if (chatType === CHAT_TYPE.GROUP_CHAT) {
223
+        return this.getGroupName(targetId);
224
+      }
225
+      switch (chatType) {
226
+        case CHAT_TYPE.SINGLE_CHAT:
227
+          const friendInfo = this.friendUserInfoCollection[targetId];
228
+          friendInfo?.nickname || targetId;
229
+          break;
230
+        case CHAT_TYPE.GROUP_CHAT:
231
+          console.log(">>>>>>> Group");
232
+          this.getGroupName(targetId);
233
+          break;
234
+        default:
235
+          return null;
236
+      }
237
+    },
238
+    async queryList(pageNo, pageSize, from) {
239
+      /* from  0.用户主动下拉刷新 1.通过reload触发 2.通过refresh触发 3.通过滚动到底部加载更多或点击底部加载更多触发) */
240
+      console.log(pageNo, pageSize, from);
241
+      /* 初始化时获取数据 */
242
+      if (from === 1) {
243
+        if (!this.messageList?.length) {
244
+          try {
245
+            const messages = await this.getMoreHistoryMessages();
246
+            this.$refs.paging.complete([...messages]);
247
+            //补充滚动置底,防止图片消息撑开内容导致,未滚动置底
248
+            setTimeout(() => {
249
+              this.$refs.paging.scrollToBottom();
250
+            }, 500);
251
+          } catch (error) {
252
+            console.log("漫游加载失败", error);
253
+            this.$refs.paging.complete(false);
254
+          }
255
+        } else {
256
+          /* 设置本地分页,请求结束(成功或者失败)调用此方法,将请求的结果传递给z-paging作分页处理 */
257
+          this.isLoadingLocalMsgList = true;
258
+          this.$refs.paging.setLocalPaging([...this.messageList]);
259
+          //补充滚动置底,防止图片消息撑开内容导致,未滚动置底
260
+          setTimeout(() => {
261
+            this.$refs.paging.scrollToBottom();
262
+          }, 500);
263
+
264
+          console.log(">>>>加载本地已有历史记录。");
265
+        }
266
+      }
267
+      if (from === 2) {
268
+        return;
269
+      }
270
+      /* 触顶加载更多消息时获取数据 */
271
+      if (from === 3) {
272
+        console.log(">>>>触顶加载更多");
273
+        try {
274
+          const messages = await this.getMoreHistoryMessages();
275
+          this.$refs.paging.complete([...messages]);
276
+        } catch (error) {
277
+          console.log("漫游加载失败", error);
278
+          this.$refs.paging.complete(false);
279
+        }
280
+      }
281
+    },
282
+    async getMoreHistoryMessages() {
283
+      const params = {
284
+        targetId: this.targetId,
285
+        chatType: this.chatType,
286
+      };
287
+      return new Promise((resolve, reject) => {
288
+        this.$store
289
+          .dispatch("fetchHistroyMessageListFromServer", params)
290
+          .then((res) => {
291
+            resolve(res.messages);
292
+          })
293
+          .catch((err) => {
294
+            console.log(err);
295
+            reject(err);
296
+          });
297
+      });
298
+    },
299
+    //执行新增消息
300
+    appentNewMessage(data) {
301
+      console.log(">>>>>新消息添加", data);
302
+      const { msgBody } = data;
303
+      this.$refs.paging.addChatRecordData({
304
+        ...msgBody,
305
+      });
306
+    },
307
+    //监听删除消息更新当前list
308
+    async onDeleteMessage() {
309
+      this.isLoadingLocalMsgList = true;
310
+      const res = await this.$refs.paging.setLocalPaging([...this.messageList]);
311
+    },
312
+    //监听编辑消息更新item
313
+    onModifyMessage(data) {
314
+      /**
315
+       * @function updateChatRecordData
316
+       * @description 此方法为自己往插件库中新增的一个方法,主要为更新本地分页数据中已存在的消息体。
317
+       */
318
+      //    updateChatRecordData(data) {
319
+      //   if (!this.useChatRecordMode) return;
320
+      //   const _index = this.totalData.findIndex((o) => o.id === data.id);
321
+      //   _index >= 0 && (this.totalData[_index] = data);
322
+      // }
323
+      this.$refs.paging.updateChatRecordData(data);
324
+    },
325
+    async onClickLoadMore() {
326
+      try {
327
+        const messages = await this.getMoreHistoryMessages();
328
+        if (messages.length) {
329
+          this.$refs.paging.addDataFromTop([...messages]);
330
+          this.$refs.paging.doChatRecordLoadMore();
331
+        } else {
332
+          this.isLoadingLocalMsgList = false;
333
+          uni.showToast({
334
+            title: "真的没有更多了",
335
+            icon: "none",
336
+            duration: 2000,
337
+          });
338
+          return;
339
+        }
340
+      } catch (error) {
341
+        console.log("漫游加载失败", error);
342
+        this.$refs.paging.complete(false);
343
+      }
344
+    },
345
+    //重新编辑
346
+    reEditTextMessage(msgContent) {
347
+      this.$refs.emInputBarComps.appendReEditTextMessage(msgContent);
348
+    },
349
+    resetScrollHeight(height) {
350
+      this.$nextTick(() => {
351
+        this.$refs.paging.updatePageScrollTopHeight();
352
+        console.log(this.scrollHeight);
353
+      });
354
+    },
355
+    //弹出消息对应popup
356
+    alertMessagePopup(msgBody) {
357
+      this.$refs.emMessagePopupComps.alertMessagePopup(msgBody);
358
+      this.checkedPopupMsgBody = msgBody;
359
+    },
360
+    //调起消息回复模式
361
+    callReplyMessage() {
362
+      this.$refs.emInputBarComps.onShowReplyMessageContainer();
363
+    },
364
+    callEditMessage(msgBody) {
365
+      this.$refs.emInputBarComps.onShowEditMessageContainer(msgBody);
366
+    },
367
+    //滚动至引用消息所在位置
368
+    scrollToQuoteMessge(msgQuote) {
369
+      const { msgID } = msgQuote;
370
+      if (msgID) {
371
+        const dom = uni
372
+          .createSelectorQuery()
373
+          .in(this)
374
+          .select("#mid" + msgID);
375
+        dom
376
+          .boundingClientRect((data) => {
377
+            if (data) {
378
+              this.$refs.paging.scrollIntoViewByNodeTop(data.top, 50);
379
+              //闪烁该条引用消息
380
+              this.setQuoteMessageId(msgID);
381
+            } else {
382
+              uni.showToast({
383
+                icon: "none",
384
+                title: "没有回复的消息",
385
+              });
386
+            }
387
+          })
388
+          .exec();
389
+      }
390
+    },
391
+    //设置引用消息ID从而引起消息气泡闪烁
392
+    setQuoteMessageId(quoteMsgId) {
393
+      this.quoteMsgId = quoteMsgId;
394
+      //引起子组件增加闪烁样式后,延时半秒自定清空设置的引用消息id
395
+      setTimeout(() => {
396
+        this.quoteMsgId = "";
397
+      }, 500);
398
+    },
399
+  },
400
+  onUnload() {
401
+    //置空正在沟通中的用户信息
402
+    this.$store.commit("SET_CHATING_USER_INFO", {});
403
+    uni.$off(
404
+      EVENT_BUS_NAME.EASEIM_MESSAGE_COLLECTION_UPDATE,
405
+      this.appentNewMessage
406
+    );
407
+    uni.$off(
408
+      EVENT_BUS_NAME.EASEIM_MESSAGE_COLLECTION_DELETE,
409
+      this.onDeleteMessage
410
+    );
411
+    uni.$off(
412
+      EVENT_BUS_NAME.EASEIM_MESSAGE_COLLECTION_MODIFY,
413
+      this.onModifyMessage
414
+    );
415
+  },
416
+};
417
+</script>
418
+
419
+<style scoped>
420
+@import "./index.css";
421
+</style>

+ 26 - 0
encryption/index.js

@@ -0,0 +1,26 @@
1
+import CryptoJS from '../node_modules/crypto-js/crypto-js.js'
2
+// var keyvi = '12345678';
3
+// DES加密
4
+export const encryptDes = (message, key) => {
5
+	// var key = CryptoJS.MD5(keyvi).toString();
6
+	const keyHex = CryptoJS.enc.Utf8.parse(key);
7
+	const encrypted = CryptoJS.DES.encrypt(message, keyHex, {
8
+		mode: CryptoJS.mode.ECB,
9
+		padding: CryptoJS.pad.Pkcs7
10
+	});
11
+	return encrypted.toString();
12
+}
13
+
14
+// DES解密
15
+export const decryptDes = (ciphertext, key) => {
16
+	const keyHex = CryptoJS.enc.Utf8.parse(key);
17
+	// direct decrypt ciphertext
18
+	const decrypted = CryptoJS.DES.decrypt({
19
+		ciphertext: CryptoJS.enc.Base64.parse(ciphertext)
20
+	}, keyHex, {
21
+		mode: CryptoJS.mode.ECB,
22
+		padding: CryptoJS.pad.Pkcs7
23
+	});
24
+	return decrypted.toString(CryptoJS.enc.Utf8);
25
+}
26
+

+ 20 - 0
index.html

@@ -0,0 +1,20 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="UTF-8" />
5
+    <script>
6
+      var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
7
+        CSS.supports('top: constant(a)'))
8
+      document.write(
9
+        '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
10
+        (coverSupport ? ', viewport-fit=cover' : '') + '" />')
11
+    </script>
12
+    <title></title>
13
+    <!--preload-links-->
14
+    <!--app-context-->
15
+  </head>
16
+  <body>
17
+    <div id="app"><!--app-html--></div>
18
+    <script type="module" src="/main.js"></script>
19
+  </body>
20
+</html>

+ 29 - 0
main.js

@@ -0,0 +1,29 @@
1
+import App from './App'
2
+
3
+// #ifndef VUE3
4
+import Vue from 'vue'
5
+import time from '@/commit/item.js';
6
+import store from '@/store/index.js'
7
+import uView from '@/uni_modules/uview-ui';
8
+
9
+Vue.config.productionTip = false
10
+Vue.prototype.$time = time 
11
+Vue.prototype.$store = store 
12
+App.mpType = 'app'
13
+Vue.use(uView);
14
+const app = new Vue({
15
+    ...App,
16
+	   store
17
+})
18
+app.$mount()
19
+// #endif
20
+
21
+// #ifdef VUE3
22
+import { createSSRApp } from 'vue'
23
+export function createApp() {
24
+  const app = createSSRApp(App)
25
+  return {
26
+    app
27
+  }
28
+}
29
+// #endif

+ 116 - 0
manifest.json

@@ -0,0 +1,116 @@
1
+{
2
+    "name" : "yhc-merchantapplet",
3
+    "appid" : "__UNI__9DFEEAF",
4
+    "description" : "",
5
+    "versionName" : "1.0.0",
6
+    "versionCode" : 309,
7
+    "transformPx" : false,
8
+    /* 5+App特有相关 */
9
+    "app-plus" : {
10
+        "usingComponents" : true,
11
+        "nvueStyleCompiler" : "uni-app",
12
+        "compilerVersion" : 3,
13
+        "splashscreen" : {
14
+            "alwaysShowBeforeRender" : true,
15
+            "waiting" : true,
16
+            "autoclose" : true,
17
+            "delay" : 0
18
+        },
19
+        /* 模块配置 */
20
+        "modules" : {
21
+            "Payment" : {}
22
+        },
23
+        /* 应用发布信息 */
24
+        "distribute" : {
25
+            /* android打包配置 */
26
+            "android" : {
27
+                "permissions" : [
28
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
29
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
30
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
31
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
32
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
33
+                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
34
+                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
35
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
36
+                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
37
+                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
38
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
39
+                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
40
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
41
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
42
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
43
+                ]
44
+            },
45
+            /* ios打包配置 */
46
+            "ios" : {},
47
+            /* SDK配置 */
48
+            "sdkConfigs" : {
49
+                "payment" : {
50
+                    "weixin" : {
51
+                        "__platform__" : [ "ios", "android" ],
52
+                        "appid" : "wx9a3e4ab07f8a9ba2",
53
+                        "UniversalLinks" : ""
54
+                    }
55
+                }
56
+            }
57
+        }
58
+    },
59
+    /* 快应用特有相关 */
60
+    "quickapp" : {},
61
+    /* 小程序特有相关 */
62
+    "mp-weixin" : {
63
+        "appid" : "wxf0e56f6522030c66",
64
+        "__usePrivacyCheck__" : true,
65
+        "setting" : {
66
+            "urlCheck" : false
67
+        },
68
+        "usingComponents" : true,
69
+        "optimization" : {
70
+            "subPackages" : true
71
+        }
72
+    },
73
+    "mp-alipay" : {
74
+        "usingComponents" : true
75
+    },
76
+    "mp-baidu" : {
77
+        "usingComponents" : true
78
+    },
79
+    "mp-toutiao" : {
80
+        "usingComponents" : true
81
+    },
82
+    "uniStatistics" : {
83
+        "enable" : false
84
+    },
85
+    "vueVersion" : "2",
86
+    "h5" : {
87
+        "devServer" : {
88
+            "https" : false,
89
+            "proxy" : {
90
+                // 自行修改下方的 /web
91
+                "/gateway" : {
92
+                    // "secure": false,
93
+                    // "target": "https://api.gdjbp.com"
94
+                    "target" : "https://api.hebeiyhc.com"
95
+                },
96
+                // "target": "http://8.141.0.149:9000",
97
+                // "target": "https://app.bjtdba.com"
98
+                // "pathRewrite": {
99
+                // 	//路径重写
100
+                // 	"^/gateway": ""
101
+                // }
102
+                // 自行修改下方的 /api
103
+                "/api" : {
104
+                    "target" : "服务器地址",
105
+                    "pathRewirte" : {
106
+                        //路径重写
107
+                        "^/api" : "/"
108
+                    }
109
+                }
110
+            }
111
+        },
112
+        "router" : {
113
+            "base" : "./"
114
+        }
115
+    }
116
+}

+ 528 - 0
openmerchant/amountopening/index.vue

@@ -0,0 +1,528 @@
1
+<template>
2
+	<view class="amountopening">
3
+		<view class="amountopening-back">
4
+			<image src="https://cdn.bjtdba.com/vod/image/2022-08-10/20220810090332606.png" mode="widthFix"></image>
5
+			<view class="amountopening-header">
6
+				<view class="amountopening-header-icon" @click="returns">
7
+					<image src="https://cdn.bjtdba.com/vod/image/2022-08-10/20220810090600249.png" mode="widthFix">
8
+					</image>
9
+				</view>
10
+				<view class="amountopening-header-text">
11
+					开通商户
12
+				</view>
13
+			</view>
14
+			<view class="amountopening-icon">
15
+				<image src="https://cdn.bjtdba.com/vod/image/2022-08-10/20220810090719212.png" mode="widthFix"></image>
16
+				<view class="amountopening-jinggao">
17
+					<view class="amountopening-jinggao-top">
18
+						开通电商商户
19
+					</view>
20
+					<view class="amountopening-jinggao-bot">
21
+						¥19800/年
22
+					</view>
23
+				</view>
24
+				<view class="amountopening-kaiqi">
25
+					<view class="amountopening-kaiqi-text">
26
+						开通商户立享八项功能权益
27
+					</view>
28
+					<view class="amountopening-kaiqi-iocnr" @click="activiteCard = false">
29
+						我有激活码
30
+					</view>
31
+				</view>
32
+			</view>
33
+		</view>
34
+		<view class="amountopening-quanyi">
35
+			尊享权益
36
+		</view>
37
+		<view class="amountopening-list">
38
+			<view class="amountopening-list-is" v-for="(item,index) in mus" :key="index">
39
+				<view class="amountopening-list-is-top">
40
+					<image :src="item.url" mode="widthFix"></image>
41
+				</view>
42
+				<view class="amountopening-list-is-bto">
43
+					{{item.name}}
44
+				</view>
45
+			</view>
46
+		</view>
47
+		<!-- <view class="amountopening-kaitong" @click="payment">
48
+			<image src="https://cdn.bjtdba.com/vod/image/2022-08-10/20220810105617180.png" mode="widthFix">
49
+
50
+			</image>
51
+			<view class="kaitong-amount">
52
+				<span class="kaitong-money">¥3990</span>
53
+				<span>/年</span>
54
+			</view>
55
+		</view> -->
56
+		<view class="amountopening-anniu" @click="payment">
57
+			立即开通
58
+		</view>
59
+
60
+		<view :class="[activiteCard ? 'dis-activite' : '', 'activite-code' ]" @touchmove.stop.prevent="moveHandle">
61
+			<view class="activite-code-mask" @click="activiteCard = true"></view>
62
+			<view class="bottomss">
63
+				<view class="top">
64
+					兑换激活码
65
+				</view>
66
+				<view class="cv">
67
+					<view class="cv-title">输入激活码,兑换储蓄保一壶茶商户</view>
68
+					<input class="cv-input" type="text" placeholder="输入激活码" v-model="useCode">
69
+				</view>
70
+				<view class="ft" @click="immediateUse">
71
+					立即使用
72
+				</view>
73
+			</view>
74
+		</view>
75
+	</view>
76
+</template>
77
+
78
+<script>
79
+	import {
80
+		updateActivationCode,
81
+		insterMerchantOrder,
82
+		selectMerchant
83
+	} from '@/commit/api.js';
84
+	
85
+	export default {
86
+		data() {
87
+			return {
88
+				userinfo: [],
89
+				activiteCard: true,
90
+				useCode: '',
91
+				code: '',
92
+				mus: [{
93
+						url: 'https://cdn.bjtdba.com/vod/image/2022-08-10/20220810101724170.png',
94
+						name: '线上商城'
95
+					},
96
+					{
97
+						url: 'https://cdn.bjtdba.com/vod/image/2022-08-10/20220810101550963.png',
98
+						name: '店务管理'
99
+					},
100
+					{
101
+						url: 'https://cdn.bjtdba.com/vod/image/2022-08-10/20220810101703873.png',
102
+						name: '锁定客户'
103
+					},
104
+					{
105
+						url: 'https://cdn.bjtdba.com/vod/image/2022-08-10/20220810101751275.png',
106
+						name: '员工管理'
107
+					},
108
+					{
109
+						url: 'https://cdn.bjtdba.com/vod/image/2022-08-10/20220810101615531.png',
110
+						name: '经营报表'
111
+					},
112
+					{
113
+						url: 'https://cdn.bjtdba.com/vod/image/2022-08-10/20220810101653529.png',
114
+						name: '数据分析'
115
+					},
116
+					{
117
+						url: 'https://cdn.bjtdba.com/vod/image/2022-08-10/20220810101604267.png',
118
+						name: '会员管理'
119
+					},
120
+					{
121
+						url: 'https://cdn.bjtdba.com/vod/image/2022-08-10/20220810101713873.png',
122
+						name: '推广引流'
123
+					},
124
+				]
125
+			}
126
+		},
127
+		onLoad() {
128
+			this.userinfo = uni.getStorageSync('userinfo')
129
+		},
130
+		onShow() {
131
+			    
132
+		},
133
+		methods: {
134
+			moveHandle() {},
135
+			returns() {
136
+				uni.redirectTo({
137
+					url: "/openmerchant/guide/index"
138
+				})
139
+			},
140
+			immediateUse() {
141
+
142
+				if (this.useCode == "") return uni.showToast({
143
+					title: "请输入激活码",
144
+					icon: "none"
145
+				});
146
+				updateActivationCode({
147
+					code: this.useCode,
148
+					uid: this.userinfo.uid
149
+				}).then(res => {
150
+					console.log('激活码激活 -->',res)
151
+					if (res.data.status == 200) {
152
+						this.useCode = "";
153
+						this.activiteCard = true;
154
+						//获取merId进行存储
155
+						let UserSelectmerchant = uni.getStorageSync('selectmerchant')
156
+						let selectmerchant = {
157
+							status:UserSelectmerchant.status,
158
+							merId:res.data.data.mer_id,
159
+							pay_type:res.data.data.pay_type,
160
+							msg:UserSelectmerchant.msg
161
+						}
162
+						if(res.data.data.pay_type=="2"){
163
+							this.$store.commit('changeMerchantsStatus', 1);
164
+						}
165
+						uni.setStorageSync('selectmerchant', selectmerchant);
166
+						uni.redirectTo({
167
+							url: "/openmerchant/shopentry/process?mer_id=" + res.data.mer_id
168
+						})
169
+					}
170
+				}, fail => {
171
+					console.log('激活码激活 -->',fail)
172
+				})
173
+			},
174
+			payment() {
175
+				let userInfo = uni.getStorageSync('userinfo')
176
+				// 用户状态判断
177
+				selectMerchant({
178
+					uid: userInfo.uid
179
+				}).then(data => {
180
+					console.log('data = ',data)
181
+					if (data.data.status == 200) {
182
+						if (data.data.data.status == -1) {
183
+							this.pushToUserApplet()
184
+						} else {
185
+							uni.redirectTo({
186
+								url: '/openmerchant/shopentry/process?mer_id=' + data.data.data.merId //已开通商户未填写资料
187
+							});
188
+							return
189
+						}
190
+					}
191
+				}, fail => {
192
+					uni.showToast({
193
+						title: fail,
194
+						icon: "none"
195
+					})
196
+				}).catch(err => {
197
+					console.log(err)
198
+				})
199
+				
200
+				
201
+			},
202
+			
203
+			pushToUserApplet() {
204
+				uni.navigateToMiniProgram({
205
+					// appid  写你要跳转的小程序的 appid
206
+					appId:'wx9082e5ac2fdb513f',
207
+					// 路径写  src下的路径,假如你跳转的是pages下的页面,就可以写pages/index
208
+					// path: 'pagesA/oderPay/oder_nian',
209
+					path: 'pages/chuangke/index?type=100',
210
+					// 这个不写的话会显示开发环境,不能正常跳转,写上就能正常跳转了
211
+					envVersion: 'trial',  // develop(开发版),trial(体验版),release(正式版)
212
+					// envVersion: 'release',  // develop(开发版),trial(体验版),release(正式版)
213
+					success(res) {
214
+						// 打开成功
215
+						uni.showToast({
216
+							title: '跳转成功'
217
+						})
218
+					},
219
+					fail(err) {
220
+						console.log(err)
221
+						// 打开失败/取消
222
+						uni.showToast({
223
+							title: '跳转不成功'
224
+						})
225
+					}
226
+				})
227
+			},
228
+			
229
+			pay(appId, timeStamp, nonceStr, pack, signType, paySign) {
230
+				wx.requestPayment({
231
+					'appId': appId,
232
+					'timeStamp': timeStamp,
233
+					'nonceStr': nonceStr,
234
+					'package': pack,
235
+					'signType': signType,
236
+					'paySign': paySign,
237
+					success: function(res) {
238
+						uni.showToast({
239
+							title: "支付成功",
240
+							icon: 'none',
241
+						})
242
+						this.$store.commit('changeMerchantsStatus', 0);
243
+						uni.redirectTo({
244
+							url: "/openmerchant/shopentry/process?mer_id=539"
245
+						})
246
+					},
247
+					fail: function(res) {
248
+						uni.showToast({
249
+							title: res.data,
250
+							duration: 2000
251
+						})
252
+					},
253
+				})
254
+			}
255
+		}
256
+	}
257
+</script>
258
+
259
+<style lang="scss" scoped>
260
+	.amountopening {
261
+		width: 100%;
262
+		height: 100%;
263
+		display: flex;
264
+		flex-direction: column;
265
+		align-items: center;
266
+		justify-content: center;
267
+
268
+		.amountopening-back {
269
+			width: 100%;
270
+			height: 347rpx;
271
+			position: relative;
272
+			display: flex;
273
+			justify-content: center;
274
+
275
+			image {
276
+				width: 100%;
277
+				height: 100%;
278
+			}
279
+
280
+			.amountopening-header {
281
+				position: absolute;
282
+				width: 686rpx;
283
+				height: 100rpx;
284
+				// top: 37rpx;
285
+				display: flex;
286
+				justify-content: flex-start;
287
+				align-items: center;
288
+
289
+				.amountopening-header-icon {
290
+					width: 36rpx;
291
+					height: 36rpx;
292
+
293
+					image {
294
+						width: 100%;
295
+						height: 100%;
296
+					}
297
+				}
298
+
299
+				.amountopening-header-text {
300
+					font-size: 36rpx;
301
+					font-weight: 500;
302
+					color: #FFFFFF;
303
+					margin-left: 26rpx;
304
+				}
305
+			}
306
+
307
+			.amountopening-icon {
308
+				width: 686rpx;
309
+				height: 320rpx;
310
+				position: absolute;
311
+				top: 108rpx;
312
+
313
+				image {
314
+					width: 100%;
315
+					height: 100%;
316
+				}
317
+
318
+				.amountopening-jinggao {
319
+					position: absolute;
320
+					top: 36rpx;
321
+					left: 32rpx;
322
+					height: 99rpx;
323
+					display: flex;
324
+					flex-direction: column;
325
+					justify-content: space-between;
326
+					align-items: flex-start;
327
+
328
+					.amountopening-jinggao-top {
329
+						font-size: 42rpx;
330
+						font-weight: 500;
331
+						color: #333333;
332
+					}
333
+
334
+					.amountopening-jinggao-bot {
335
+						font-size: 38rpx;
336
+						font-weight: 400;
337
+						color: #333333;
338
+					}
339
+				}
340
+
341
+				.amountopening-kaiqi {
342
+					position: absolute;
343
+					width: 622rpx;
344
+					left: 32rpx;
345
+					bottom: 28rpx;
346
+					display: flex;
347
+					justify-content: space-between;
348
+					align-items: center;
349
+
350
+					.amountopening-kaiqi-text {
351
+						font-size: 28rpx;
352
+						font-weight: 400;
353
+						color: #333333;
354
+					}
355
+
356
+					.amountopening-kaiqi-iocnr {
357
+						width: 189rpx;
358
+						height: 64rpx;
359
+						background: linear-gradient(175deg, #FFF8E0 0%, #EAD6AE 100%);
360
+						border-radius: 31px;
361
+						line-height: 64rpx;
362
+						text-align: center;
363
+						font-size: 28rpx;
364
+						font-weight: 400;
365
+						color: #333333;
366
+					}
367
+				}
368
+			}
369
+		}
370
+
371
+		.amountopening-quanyi {
372
+			width: 686rpx;
373
+			font-size: 36rpx;
374
+			font-weight: 500;
375
+			color: #333333;
376
+			margin-top: 113rpx;
377
+			display: flex;
378
+			justify-content: flex-start;
379
+		}
380
+
381
+		.amountopening-list {
382
+			width: 686rpx;
383
+			// height: 555rpx;
384
+			border-radius: 16rpx;
385
+			border: 1rpx solid #FEB84A;
386
+			margin-top: 32rpx;
387
+			display: flex;
388
+			flex-wrap: wrap;
389
+
390
+			.amountopening-list-is {
391
+				width: 110rpx;
392
+				height: 131rpx;
393
+				display: flex;
394
+				margin: 12rpx 31rpx 12rpx 31rpx;
395
+				flex-direction: column;
396
+				justify-content: space-between;
397
+				align-items: center;
398
+
399
+				.amountopening-list-is-top {
400
+					width: 86rpx;
401
+					height: 86rpx;
402
+
403
+					image {
404
+						width: 100%;
405
+						height: 100%;
406
+					}
407
+				}
408
+
409
+				.amountopening-list-is-bto {
410
+					font-size: 26rpx;
411
+					font-weight: 400;
412
+					color: #333333;
413
+				}
414
+			}
415
+		}
416
+
417
+		.amountopening-kaitong {
418
+			width: 686rpx;
419
+			height: 88rpx;
420
+			margin-top: 280rpx;
421
+			position: relative;
422
+
423
+			image {
424
+				width: 100%;
425
+				height: 100%;
426
+			}
427
+
428
+			.kaitong-amount {
429
+				position: absolute;
430
+				top: 20rpx;
431
+				left: 175rpx;
432
+				color: #FFFFFF;
433
+				font-size: 32rpx;
434
+				line-height: 48rpx;
435
+				display: flex;
436
+
437
+				.kaitong-money {
438
+					color: #FBDD99;
439
+					font-size: 48rpx;
440
+					margin-right: 8rpx;
441
+				}
442
+			}
443
+		}
444
+		.amountopening-anniu{
445
+			width: 686rpx;
446
+			height: 88rpx;
447
+			background: #45495A;
448
+			border-radius: 44rpx;
449
+			text-align: center;
450
+			line-height: 88rpx;
451
+			font-size: 32rpx;
452
+			font-weight: 600;
453
+			color: #FFFFFF;
454
+			margin-top: 343rpx;
455
+		}
456
+
457
+		.dis-activite {
458
+			display: none !important;
459
+		}
460
+
461
+		.activite-code {
462
+			width: 100%;
463
+			height: 100%;
464
+			background: transparent;
465
+			position: fixed;
466
+			margin: auto;
467
+			left: 0;
468
+			right: 0;
469
+			top: 0;
470
+			bottom: 0;
471
+			z-index: 111;
472
+			display: flex;
473
+			justify-content: center;
474
+			align-items: center;
475
+
476
+			.activite-code-mask {
477
+				width: 100%;
478
+				height: 100%;
479
+				background: rgba(0, 0, 0, 0.5);
480
+				position: fixed;
481
+			}
482
+
483
+			.bottomss {
484
+				width: 560rpx;
485
+				// height: 408rpx;
486
+				background: #FFFFFF;
487
+				border-radius: 16rpx;
488
+				text-align: center;
489
+				padding-top: 50rpx;
490
+				z-index: 112;
491
+
492
+				.top {
493
+					font-size: 36rpx;
494
+				}
495
+
496
+				.cv {
497
+					width: 100%;
498
+					box-sizing: border-box;
499
+					padding: 35rpx 22rpx 40rpx 26rpx;
500
+					border-bottom: 1rpx solid #E5E5E5;
501
+					text-align: left;
502
+
503
+					.cv-title {
504
+						font-size: 30rpx;
505
+						margin-bottom: 32rpx;
506
+					}
507
+
508
+					.cv-input {
509
+						border-radius: 8rpx;
510
+						border: 2px solid #999999;
511
+						width: 508rpx;
512
+						height: 86rpx;
513
+						padding-left: 25rpx;
514
+						box-sizing: border-box;
515
+						font-size: 26rpx;
516
+					}
517
+				}
518
+
519
+				.ft {
520
+					width: 100%;
521
+					padding: 31rpx 0;
522
+					color: #1F7CFF;
523
+					font-size: 36rpx;
524
+				}
525
+			}
526
+		}
527
+	}
528
+</style>

+ 88 - 0
openmerchant/guide/index.vue

@@ -0,0 +1,88 @@
1
+<template>
2
+	<view class="guide">
3
+		<view class="guide_header">
4
+			<view class="">
5
+				请立即开通店铺!
6
+			</view>
7
+			<view class="">
8
+				开通后才可以正常使用!
9
+			</view>
10
+		</view>
11
+		<view class="guide_icon">
12
+			<image src="https://cdn.bjtdba.com/vod/image/2022-08-09/20220809174136233.png" mode="widthFix"></image>
13
+		</view>
14
+		<view class="guide_bottom" @click="activatenow">
15
+			立即开通
16
+		</view>
17
+	</view>
18
+</template>
19
+
20
+<script>
21
+	export default {
22
+		data() {
23
+			return {
24
+				
25
+			}
26
+		},
27
+		onLoad() {
28
+			
29
+		},
30
+		methods: {
31
+			activatenow(){
32
+				uni.navigateTo({
33
+					url:"/openmerchant/amountopening/index"
34
+				})
35
+			}
36
+		}
37
+	}
38
+</script>
39
+
40
+<style>
41
+	page {
42
+		background-color: #1F7CFF;
43
+	}
44
+</style>
45
+<style lang="scss" scoped>
46
+
47
+	.guide{
48
+		width: 100%;
49
+		height: 100%;
50
+		display: flex;
51
+		flex-direction: column;
52
+		align-items: center;
53
+		justify-content: center;
54
+		background-color: #1F7CFF;
55
+		.guide_header{
56
+			width: 462rpx;
57
+			height: 108rpx;
58
+			margin: 279rpx 0 125rpx 0;
59
+			display: flex;
60
+			flex-direction: column;
61
+			align-items: center;
62
+			justify-content: center;
63
+			font-size: 42rpx;
64
+			font-weight: 500;
65
+			color: #FFFFFF;
66
+		}
67
+		.guide_icon{
68
+			width: 750rpx;
69
+			height: 520rpx;
70
+			margin-bottom: 168rpx;
71
+			image{
72
+				width: 100%;
73
+				height: 100%;
74
+			}
75
+		}
76
+		.guide_bottom{
77
+			width: 686rpx;
78
+			height: 98rpx;
79
+			border-radius: 8rpx;
80
+			border: 2rpx solid #FFFFFF;
81
+			font-size: 36rpx;
82
+			font-weight: 500;
83
+			color: #FFFFFF;
84
+			text-align: center;
85
+			line-height: 98rpx;
86
+		}
87
+	}
88
+</style>

+ 884 - 0
openmerchant/shopentry/process.vue

@@ -0,0 +1,884 @@
1
+<template>
2
+	<view class="process">
3
+		<view class="process-header">
4
+			<view class="process-header-text">
5
+				<view class="process-header-text-neishi" @click="topgi">
6
+					<view class="process-header-text-icon">
7
+						<image src="https://cdn.bjtdba.com/vod/image/2022-08-11/20220811133828415.png" mode="widthFix">
8
+						</image>
9
+					</view>
10
+				</view>
11
+				<view class="process-header-text-title">
12
+					店铺入驻
13
+				</view>
14
+			</view>
15
+		</view>
16
+		<view class="process-zhuti">
17
+			<view class="process-zhuti-yi">
18
+				<view class="process-zhuti-yi-text">
19
+					商家类型
20
+				</view>
21
+				<view class="process-zhuti-yi-input">
22
+					<view class="business-type" @click="isShowType = true">
23
+						<view v-if="!businessData">请选择商家类型</view>
24
+						<view v-else class="business-type-value">{{businessData.text}}</view>
25
+					</view>
26
+					<view class="type-mask" v-if="isShowType" @click="isShowType = false"></view>
27
+					<view class="business-type-list" v-if="isShowType">
28
+						<view v-for="(item,index) in businessType"
29
+							:class="[businessData.value == item.value ? 'business-type-item-active' : '', 'business-type-item' ]"
30
+							@click="changeType(item)">
31
+							<image v-if="businessData.value == item.value"
32
+								src="https://cdn.bjtdba.com/vod/image/2022-08-22/20220822161754617.png" mode=""></image>
33
+							<image v-else src="https://cdn.bjtdba.com/vod/image/2022-08-22/20220822155008662.png"
34
+								mode=""></image>
35
+							{{item.text}}
36
+						</view>
37
+					</view>
38
+				</view>
39
+			</view>
40
+			<view class="process-zhuti-yi">
41
+				<view class="process-zhuti-yi-text">
42
+					商家名称
43
+				</view>
44
+				<view class="process-zhuti-yi-input">
45
+					<input placeholder="请填写商家名称" v-model="merchantsIn.mer_name">
46
+				</view>
47
+			</view>
48
+			<view class="process-zhuti-yi" v-if="enterpriseType">
49
+				<view class="process-zhuti-yi-text">
50
+					营业执照
51
+				</view>
52
+				<view class="process-zhuti-yi-upload" @click="businessLicense">
53
+					<image v-if="merchantsIn.business_license" :src="merchantsIn.business_license" mode=""></image>
54
+					<image v-else src="https://cdn.bjtdba.com/vod/image/2022-08-22/20220822142852637.png" mode="">
55
+					</image>
56
+				</view>
57
+			</view>
58
+			<view class="process-zhuti-yi" v-if="enterpriseType">
59
+				<view class="process-zhuti-yi-text">
60
+					社会信用代码
61
+				</view>
62
+				<view class="process-zhuti-yi-input">
63
+					<input placeholder="请填写社会信用代码" v-model="merchantsIn.credit_code">
64
+				</view>
65
+			</view>
66
+			<view class="process-zhuti-yi" v-if="enterpriseType">
67
+				<view class="process-zhuti-yi-text">
68
+					社会信用证有效期
69
+				</view>
70
+				<view class="process-zhuti-yi-input"  style="display: flex;">
71
+					<!-- <uni-datetime-picker v-model="range" type="daterange" @change="changeLog">
72
+						<input placeholder="请填写社会信用证有效期" v-model="range" disabled>
73
+					</uni-datetime-picker> -->
74
+					<uni-datetime-picker type="date" :clear-icon="false" v-model="merchantsIn.merc_start_time" @maskClick="maskClick">
75
+						<input placeholder="有效期限开始" v-model="merchantsIn.merc_start_time" disabled>
76
+					</uni-datetime-picker>
77
+					<view class="" style="width: 120rpx;height: 100%;background-color: rgba(31, 124, 255, 0.1); display: flex;justify-content: center;align-items: center; color: #B6B6B6;">
78
+							——
79
+					</view>
80
+					<uni-datetime-picker type="date" :clear-icon="false" v-model="merchantsIn.merc_end_time" @maskClick="maskClick" end="2099-12-31">
81
+						
82
+						<input placeholder="有效期限结束" v-model="merchantsIn.merc_end_time" disabled>
83
+					</uni-datetime-picker>
84
+				</view>
85
+			</view>
86
+			<view class="process-zhuti-yi" v-if="enterpriseType" @click="miiim">
87
+				<view class="process-zhuti-yi-text">
88
+					营业执照地址
89
+				</view>
90
+				<view class="process-zhuti-yi-input">
91
+					<input placeholder="请填写营业执照地址" v-model="merchantsIn.business_addr">
92
+				</view>
93
+			</view>
94
+			<view class="process-zhuti-yi" v-if="enterpriseType">
95
+				<view class="process-zhuti-yi-text">
96
+					结算类型
97
+				</view>
98
+				<view class="process-zhuti-yi-input">
99
+					<uni-data-checkbox v-model="merchantsIn.acc_type" :localdata="sex"></uni-data-checkbox>
100
+				</view>
101
+			</view>
102
+			<view class="process-zhuti-yi" v-if="enterpriseType">
103
+				<view class="process-zhuti-yi-text">
104
+					开户许可证
105
+				</view>
106
+				<view class="process-zhuti-yi-upload" @click="accountLicense">
107
+					<image v-if="merchantsIn.open_account" :src="merchantsIn.open_account" mode=""></image>
108
+					<image v-else src="https://cdn.bjtdba.com/vod/image/2022-08-22/20220822142837323.png" mode="">
109
+					</image>
110
+				</view>
111
+			</view>
112
+			<view class="process-zhuti-yi">
113
+				<view class="process-zhuti-yi-text" v-if="enterpriseType">开户账号</view>
114
+				<view class="process-zhuti-yi-text" v-else>银行卡号</view>
115
+				<view class="process-zhuti-yi-input">
116
+					<input placeholder="请填写银行卡号" v-model="merchantsIn.bank_account">
117
+				</view>
118
+			</view>
119
+			<view class="process-zhuti-yi">
120
+				<view class="process-zhuti-yi-text">
121
+					所属银行
122
+				</view>
123
+				<view class="process-zhuti-yi-input">
124
+					<view class="back-combox">
125
+						<view class="back-combox__input-box">
126
+							<input class="back-combox__input" placeholder="请选择开户行" v-model="city.bank_name"
127
+								@input="onInput" @focus="onFocus" cursor-spacing="350" />
128
+						</view>
129
+						<view class="back-combox__selector" v-if="showSelector">
130
+							<view class="activite-code-mask" @click="showSelector = false"></view>
131
+							<view class="back-popper__arrow"></view>
132
+							<scroll-view scroll-y="true" class="back-combox__selector-scroll">
133
+								<view class="back-combox__selector-empty" v-if="filterCandidatesLength === 0">
134
+									<text>无匹配内容</text>
135
+								</view>
136
+								<view class="back-combox__selector-item" v-for="(item,index) in filterCandidates"
137
+									:key="index" @click="onSelectorClick(item)">
138
+									<text>{{item.bank_name}}</text>
139
+								</view>
140
+							</scroll-view>
141
+						</view>
142
+					</view>
143
+				</view>
144
+			</view>
145
+			<view class="process-zhuti-yi">
146
+				<view class="process-zhuti-yi-text">
147
+					开户行所在地
148
+				</view>
149
+				<view class="process-zhuti-yi-input">
150
+					<input placeholder="请填写开户行地址" v-model="merchantsIn.bank_location">
151
+				</view>
152
+			</view>
153
+		</view>
154
+		<view :class="[btnBir ? 'btn-bir' : '', 'process-zhuti-btn' ]" @click=" btnBir ? nextStep() : '' ">
155
+			下一步
156
+		</view>
157
+	</view>
158
+</template>
159
+
160
+<script>
161
+	import {
162
+		uploadPicture,
163
+		settlementBank,
164
+		selectMerchaSettlen,
165
+		selectMerchant
166
+	} from '@/commit/api.js';
167
+	import {
168
+		mapMutations
169
+	} from 'vuex'
170
+	export default {
171
+		data() {
172
+			return {
173
+				merchantsIn: {
174
+					type: '', // 商家类型
175
+					mer_name: '', // 商户名称
176
+					business_license: '', // 营业执照url
177
+					credit_code: '', // 社会信誉代码
178
+					merc_start_time: '', // 营业执照开始时间yyyy-MM-dd
179
+					merc_end_time: '', // 营业执照结束时间yyyy-MM-dd
180
+					business_addr: '', // 营业执照地址
181
+					acc_type: '10A', // 结算类型
182
+					open_account: '', // 开户许可证
183
+					bank_account: '', // 开户账号
184
+					bank_deposit: '', // 开户行
185
+					bank_name: '', //银行编码
186
+					bank_location: '', // 开户行所在地
187
+				},
188
+				value: 0,
189
+				range: [],
190
+				sex: [{
191
+					text: '对公',
192
+					value: '10A'
193
+				}, {
194
+					text: '对私',
195
+					value: '10B'
196
+				}],
197
+				businessData: '',
198
+				isShowType: false,
199
+				businessType: [{
200
+						value: 1,
201
+						text: "企业入驻"
202
+					},
203
+					{
204
+						value: 3,
205
+						text: "个人入驻"
206
+					}
207
+				],
208
+				enterpriseType: true,
209
+				candidates: [],
210
+				city: {},
211
+				showSelector: false,
212
+				fxmerchantsInData: {},
213
+				btnBir: false,
214
+				merchantsPass: false,
215
+				is: ''
216
+			}
217
+		},
218
+		mounted() {
219
+
220
+		},
221
+		onLoad(opsition) {
222
+			this.is = opsition.is
223
+			if (opsition.mer_id > 0) {
224
+				console.log("-----------" + opsition.mer_id)
225
+				this.jiance(opsition.mer_id)
226
+				
227
+			} else {
228
+				// 获取本地
229
+				const fanxian = uni.getStorageSync('merchants_in');
230
+				if (fanxian) {
231
+					if (fanxian.type == 1) {
232
+						this.changeType({
233
+							value: 1,
234
+							text: "企业入驻"
235
+						})
236
+						this.merchantsIn.acc_type = '10A';
237
+					} else {
238
+						this.changeType({
239
+							value: 3,
240
+							text: "个人入驻"
241
+						})
242
+						this.merchantsIn.acc_type = '10B';
243
+					}
244
+					this.range = [fanxian.merc_start_time, fanxian.merc_end_time];
245
+					this.city = {
246
+						bank_name: fanxian.bank_deposit,
247
+						code: fanxian.bank_name
248
+					};
249
+					this.merchantsIn = fanxian;
250
+				}
251
+			}
252
+			// // 新加 8.29
253
+			// let selectMerchantInfo = uni.getStorageSync('selectmerchant')
254
+			// let merchantsDatas = selectMerchantInfo.merchantIntention;
255
+			// console.log(merchantsDatas)
256
+			// if (merchantsDatas.type == 1) {
257
+			// 	this.changeType({
258
+			// 		value: 1,
259
+			// 		text: "企业入驻"
260
+			// 	})
261
+			// } else {
262
+			// 	this.changeType({
263
+			// 		value: 3,
264
+			// 		text: "个人入驻"
265
+			// 	})
266
+			// }
267
+			// this.range = [merchantsDatas.merc_start_time, merchantsDatas.merc_end_time];
268
+			// this.city = {
269
+			// 	bank_name: merchantsDatas.bank_deposit,
270
+			// 	code: merchantsDatas.bank_name
271
+			// };
272
+			// this.merchantsIn.mer_name = merchantsDatas.mer_name; // 商户名称
273
+			// this.merchantsIn.business_license = merchantsDatas.business_license; // 营业执照url
274
+			// this.merchantsIn.credit_code = merchantsDatas.credit_code; // 社会信誉代码
275
+			// this.merchantsIn.merc_start_time = merchantsDatas.merc_start_time; // 营业执照开始时间
276
+			// this.merchantsIn.merc_end_time = merchantsDatas.merc_end_time; // 营业执照结束时间
277
+			// this.merchantsIn.business_addr = merchantsDatas.business_addr; // 营业执照地址
278
+			// this.merchantsIn.acc_type = merchantsDatas.acc_type; // 结算类型
279
+			// this.merchantsIn.open_account = merchantsDatas.open_account; // 开户许可证
280
+			// this.merchantsIn.bank_account = merchantsDatas.bank_account; // 开户账号
281
+			// this.merchantsIn.bank_deposit = merchantsDatas.bank_deposit; // 开户行
282
+			// this.merchantsIn.bank_name = merchantsDatas.bank_name; // 银行编码
283
+			// this.merchantsIn.bank_location = merchantsDatas.bank_location; // 开户行所在地
284
+			// this.merchantsIn.type = merchantsDatas.type;
285
+		},
286
+		computed: {
287
+			filterCandidates() {
288
+				let map = new Map();
289
+				for (let item of this.candidates) {
290
+					map.set(item.id, item);
291
+				}
292
+				this.candidates = [...map.values()];
293
+				return this.candidates
294
+			},
295
+			filterCandidatesLength() {
296
+				return this.filterCandidates.length
297
+			}
298
+		},
299
+		watch: {
300
+			merchantsIn: {
301
+				handler: function(val) {
302
+					this.isShow(val)
303
+				},
304
+				deep: true
305
+			}
306
+		},
307
+		methods: {
308
+			maskClick(e){
309
+				console.log('maskClick事件:', e);
310
+			},
311
+			jiance(e) {
312
+				selectMerchaSettlen({
313
+					mer_id: e
314
+				}).then(res => {
315
+					if (res.data.status == 200 && res.data.data.merchantIntention != "") {
316
+						this.$store.commit('changeMerchants', res.data.data.merchantIntention);
317
+						
318
+						let merchantsDatas = res.data.data.merchantIntention;
319
+						
320
+						if (merchantsDatas.type == 1) {
321
+							this.changeType({
322
+								value: 1,
323
+								text: "企业入驻"
324
+							})
325
+						} else {
326
+							this.changeType({
327
+								value: 3,
328
+								text: "个人入驻"
329
+							})
330
+						}
331
+						this.range = [merchantsDatas.merc_start_time, merchantsDatas.merc_end_time];
332
+						this.city = {
333
+							bank_name: merchantsDatas.bank_deposit,
334
+							code: merchantsDatas.bank_name
335
+						};
336
+						// this.merchantsIn = merchantsDatas;
337
+
338
+						this.merchantsIn.mer_name = merchantsDatas.mer_name; // 商户名称
339
+						this.merchantsIn.business_license = merchantsDatas.business_license; // 营业执照url
340
+						this.merchantsIn.credit_code = merchantsDatas.credit_code; // 社会信誉代码
341
+						this.merchantsIn.merc_start_time = merchantsDatas.merc_start_time; // 营业执照开始时间
342
+						this.merchantsIn.merc_end_time = merchantsDatas.merc_end_time; // 营业执照结束时间
343
+						this.merchantsIn.business_addr = merchantsDatas.business_addr; // 营业执照地址
344
+						this.merchantsIn.acc_type = merchantsDatas.acc_type; // 结算类型
345
+						this.merchantsIn.open_account = merchantsDatas.open_account; // 开户许可证
346
+						this.merchantsIn.bank_account = merchantsDatas.bank_account; // 开户账号
347
+						this.merchantsIn.bank_deposit = merchantsDatas.bank_deposit; // 开户行
348
+						this.merchantsIn.bank_name = merchantsDatas.bank_name; // 银行编码
349
+						this.merchantsIn.bank_location = merchantsDatas.bank_location; // 开户行所在地
350
+
351
+						this.merchantsPass = true;
352
+					}
353
+				}, fail => {
354
+					console.log(fail)
355
+				})
356
+			},
357
+
358
+			topgi() {
359
+				if (this.is) {
360
+					uni.navigateBack({
361
+						delta: 1
362
+					})
363
+				} else {
364
+					uni.showToast({
365
+						title: "已开通请完善信息...",
366
+						icon: "none"
367
+					});
368
+				}
369
+
370
+			},
371
+			isShow(list) {
372
+				let temp = true
373
+				if (list && this.merchantsIn.type == 1) {
374
+					// for (let i in list) {
375
+					// 	console.log(list[i])
376
+					// 	if ((i[10] == "" || i.bank_deposit == null) ||  (i.bank_name == "" || i.bank_name == null)  ) {
377
+					// 		break
378
+					// 	}
379
+					// 	if (list[i] == "" || list[i] == null) {
380
+					// 		temp = false
381
+					// 	}
382
+					// }
383
+					
384
+					if ((list.acc_type == "" || list.acc_type == null) 
385
+							|| (list.bank_account == "" || list.bank_account == null) 
386
+							|| (list.bank_location == "" || list.bank_location == null) 
387
+							|| (list.business_addr == "" || list.business_addr == null) 
388
+							|| (list.business_license == "" || list.business_license == null) 
389
+							|| (list.credit_code == "" || list.credit_code == null) 
390
+							|| (list.mer_name == "" || list.mer_name == null) 
391
+							|| (list.merc_end_time == "" || list.merc_end_time == null) 
392
+							|| (list.merc_start_time == "" || list.merc_start_time == null)
393
+							|| (list.open_account == "" || list.open_account == null)
394
+							|| (list.type == "" || list.type == null)) {
395
+						temp = false
396
+						console.log("设置了 false")
397
+					}
398
+					
399
+				} else if (list && this.merchantsIn.type == 3) {
400
+					console.log("进来了")
401
+					// if ((list.mer_name == "" || list.mer_name == null) || (list.bank_account == "" || list.bank_account ==
402
+					// 		null) || (list.bank_deposit == "" || list.bank_deposit == null) || (list.bank_name == "" ||
403
+					// 		list.bank_name == null) || (list.bank_location == "" || list.bank_location == null)) {
404
+					// 	temp = false
405
+					// 	console.log("设置了 false")
406
+					// }
407
+					
408
+					if ((list.mer_name == "" || list.mer_name == null) || (list.bank_account == "" || list.bank_account ==
409
+							null) || (list.bank_location == "" || list.bank_location == null)) {
410
+						temp = false
411
+						console.log("设置了 false")
412
+					}
413
+					
414
+				}
415
+				this.btnBir = temp
416
+			},
417
+			onFocus() {
418
+				this.showSelector = true
419
+			},
420
+			onBlur() {
421
+				this.showSelector = false
422
+			},
423
+			onSelectorClick(data) {
424
+				this.showSelector = false;
425
+				this.city = data;
426
+				this.merchantsIn.bank_deposit = data.bank_name;
427
+				this.merchantsIn.bank_name = data.code;
428
+			},
429
+			onInput(e) {
430
+				let name = e.detail.value
431
+				if (name) {
432
+					settlementBank({
433
+						bank_name: name
434
+					}).then(res => {
435
+						if (res.data.status == 200) {
436
+							this.candidates = res.data.data;
437
+						}
438
+					}, fail => {
439
+						console.log(fail)
440
+					})
441
+				}
442
+			},
443
+			// 商家类型
444
+			changeType(data) {
445
+				if (data.value != this.merchantsIn.type) {
446
+					this.merchantsIn = this.$options.data().merchantsIn;
447
+
448
+					this.range = [];
449
+					this.city = {};
450
+				}
451
+				this.businessData = data;
452
+				this.merchantsIn.type = data.value;
453
+				this.isShowType = false;
454
+				if (data.value == 3) {
455
+					this.enterpriseType = false;
456
+				} else {
457
+					this.enterpriseType = true;
458
+				}
459
+			},
460
+			miiim(){
461
+				console.log(this.merchantsIn)
462
+			},
463
+			// 营业执照
464
+			businessLicense() {
465
+				console.log('点击了upload营业执照')
466
+				let that = this;
467
+				that.$time.uploadPictures(res => {
468
+					console.log(res)
469
+					that.merchantsIn.business_license = res;
470
+				});
471
+			},
472
+			// 社会信用证有效期
473
+			changeLog(e) {
474
+				this.merchantsIn.merc_start_time = e[0];
475
+				this.merchantsIn.merc_end_time = e[1];
476
+			},
477
+			// 开户许可证
478
+			accountLicense() {
479
+				let that = this;
480
+				that.$time.uploadPictures(res => {
481
+					that.merchantsIn.open_account = res;
482
+				});
483
+			},
484
+			nextStep() {
485
+				
486
+				if (this.merchantsIn.bank_name == "" || this.merchantsIn.bank_name == null || this.merchantsIn.bank_deposit == "" || this.merchantsIn.bank_deposit == null) return uni.showToast({
487
+					title: "请选择所属银行",
488
+					icon: "none"
489
+				}); 
490
+				
491
+				if (this.merchantsIn.type == "") return uni.showToast({
492
+					title: "请选择商家类型",
493
+					icon: "none"
494
+				});
495
+				if (this.merchantsIn.type == 1) {
496
+					if (this.merchantsIn.mer_name == "") return uni.showToast({
497
+						title: "请填写商家名称",
498
+						icon: "none"
499
+					});
500
+					if (this.merchantsIn.business_license == "") return uni.showToast({
501
+						title: "请上传营业执照",
502
+						icon: "none"
503
+					});
504
+					if (this.merchantsIn.credit_code == "") return uni.showToast({
505
+						title: "请填写社会信用代码",
506
+						icon: "none"
507
+					});
508
+					if (this.merchantsIn.merc_end_time == "" && this.merchantsIn.merc_start_time == "") return uni
509
+						.showToast({
510
+							title: "请选取社会信用证有效期",
511
+							icon: "none"
512
+						});
513
+					if (this.merchantsIn.business_addr == "") return uni.showToast({
514
+						title: "请填写营业执照地址",
515
+						icon: "none"
516
+					});
517
+					if (this.merchantsIn.open_account == "") return uni.showToast({
518
+						title: "请上传开户许可证",
519
+						icon: "none"
520
+					});
521
+					if (this.merchantsIn.bank_account == "") return uni.showToast({
522
+						title: "请填写开户账号",
523
+						icon: "none"
524
+					});
525
+					if (this.merchantsIn.bank_deposit == "" && this.merchantsIn.bank_name == "") return uni.showToast({
526
+						title: "请选择开户行",
527
+						icon: "none"
528
+					});
529
+					if (this.merchantsIn.bank_location == "") return uni.showToast({
530
+						title: "请填写开户行所在地",
531
+						icon: "none"
532
+					});
533
+				} else if (this.merchantsIn.type == 3) {
534
+					if (this.merchantsIn.mer_name == "") return uni.showToast({
535
+						title: "请填写商家名称",
536
+						icon: "none"
537
+					});
538
+					if (this.merchantsIn.bank_account == "") return uni.showToast({
539
+						title: "请填写银行卡号",
540
+						icon: "none"
541
+					});
542
+					if (this.merchantsIn.bank_deposit == "" && this.merchantsIn.bank_name == "") return uni.showToast({
543
+						title: "请选择开户行",
544
+						icon: "none"
545
+					});
546
+					if (this.merchantsIn.bank_location == "") return uni.showToast({
547
+						title: "请填写开户行所在地",
548
+						icon: "none"
549
+					});
550
+				}
551
+				
552
+				
553
+				
554
+				uni.setStorage({
555
+					key: 'merchants_in',
556
+					data: this.merchantsIn
557
+				});
558
+
559
+				// if(this.merchantsPass){
560
+				// 	uni.navigateTo({
561
+				// 		url: `./processstore?positionResult=${JSON.stringify(this.merchantsIn)}`
562
+				// 	});
563
+				// }else{
564
+				uni.navigateTo({
565
+					url: `./processstore`
566
+				});
567
+				// }
568
+
569
+			}
570
+		}
571
+	}
572
+</script>
573
+
574
+<style>
575
+	page {
576
+		background-color: #F7F8FC;
577
+	}
578
+</style>
579
+<style lang="scss" scoped>
580
+	.process {
581
+		width: 100%;
582
+		height: 100%;
583
+		display: flex;
584
+		flex-direction: column;
585
+		align-items: center;
586
+		justify-content: center;
587
+
588
+		.process-header {
589
+			position: fixed;
590
+			top: 0;
591
+			left: 0;
592
+			z-index: 111;
593
+			width: 100%;
594
+			height: 100rpx;
595
+			background: #FFFFFF;
596
+			display: flex;
597
+			justify-content: center;
598
+
599
+			.process-header-text {
600
+				width: 686rpx;
601
+				font-size: 36rpx;
602
+				font-weight: 500;
603
+				color: #333333;
604
+				display: flex;
605
+				// margin-top: 107rpx;
606
+				align-items: center;
607
+
608
+				.process-header-text-neishi {
609
+					width: 45rpx;
610
+					height: 45rpx;
611
+					margin-right: 17rpx;
612
+
613
+					.process-header-text-icon {
614
+						width: 36rpx;
615
+						height: 36rpx;
616
+						margin-top: 2rpx;
617
+
618
+						image {
619
+							width: 100%;
620
+							height: 100%;
621
+						}
622
+					}
623
+				}
624
+
625
+			}
626
+		}
627
+
628
+		.process-zhuti {
629
+			width: 100%;
630
+			height: auto;
631
+			margin-top: 102rpx;
632
+			display: flex;
633
+			flex-direction: column;
634
+			align-items: center;
635
+			// padding: 32rpx 0 40rpx;
636
+			padding-bottom: 40rpx;
637
+			background: #FFFFFF;
638
+
639
+			.process-zhuti-yi {
640
+				width: 686rpx;
641
+				// height: 150rpx;
642
+				display: flex;
643
+				flex-direction: column;
644
+				justify-content: space-between;
645
+				align-items: flex-start;
646
+				margin-top: 32rpx;
647
+
648
+				.process-zhuti-yi-text {
649
+					font-size: 30rpx;
650
+					font-weight: 500;
651
+					color: #333333;
652
+					margin-bottom: 26rpx;
653
+				}
654
+
655
+				.process-zhuti-yi-input {
656
+					width: 100%;
657
+					height: 94rpx;
658
+					// background: #1F7CFF;
659
+					// 31 124 255 10
660
+					border-radius: 8rpx;
661
+					// opacity: 0.1;
662
+
663
+					.business-type {
664
+						height: 94rpx;
665
+						background: rgba(31, 124, 255, 0.1);
666
+						padding-left: 32rpx;
667
+						color: #B6B6B6;
668
+						border-radius: 8rpx;
669
+						line-height: 94rpx;
670
+
671
+						.business-type-value {
672
+							color: #333333;
673
+						}
674
+					}
675
+
676
+					.business-type-list {
677
+						// display: none;
678
+						background: #FFFFFF;
679
+						position: absolute;
680
+						z-index: 10;
681
+						box-shadow: 0 3rpx 11rpx 0 rgba(0, 0, 0, 0.15);
682
+						border-radius: 8px;
683
+
684
+						.business-type-item {
685
+							width: 686rpx;
686
+							height: 94rpx;
687
+							line-height: 94rpx;
688
+
689
+							image {
690
+								width: 28rpx;
691
+								height: 28rpx;
692
+								margin: 0 16rpx 0 32rpx;
693
+								vertical-align: middle;
694
+							}
695
+						}
696
+
697
+						.business-type-item-active {
698
+							background: #1F7CFF;
699
+						}
700
+
701
+						.business-type-item:first-child {
702
+							border-radius: 8rpx 8rpx 0 0;
703
+						}
704
+
705
+						.business-type-item:last-child {
706
+							border-radius: 0 0 8rpx 8rpx;
707
+						}
708
+					}
709
+
710
+					// /deep/.uni-select{
711
+					// 	height: 94rpx;
712
+					// 	background: rgba(31, 124, 255, 0.1);
713
+					// 	border: none;
714
+					// 	padding-left: 32rpx;
715
+					// }
716
+					input {
717
+						width: 100%;
718
+						height: 94rpx;
719
+						background: rgba(31, 124, 255, 0.1);
720
+						border-radius: 8rpx;
721
+						box-sizing: border-box;
722
+						padding-left: 32rpx;
723
+					}
724
+
725
+					/deep/.uni-data-checklist {
726
+						padding-left: 32rpx;
727
+						height: 94rpx;
728
+						background: rgba(31, 124, 255, 0.1);
729
+						border-radius: 8rpx;
730
+					}
731
+
732
+					/deep/.uni-data-checklist .checklist-group {
733
+						height: 94rpx;
734
+					}
735
+				}
736
+
737
+				.process-zhuti-yi-upload {
738
+					width: 100%;
739
+					height: 404rpx;
740
+					background: rgba(31, 124, 255, 0.1);
741
+					border-radius: 8rpx;
742
+					display: flex;
743
+					justify-content: center;
744
+					align-items: center;
745
+					image {
746
+						width: 500rpx;
747
+						height: 340rpx;
748
+					}
749
+				}
750
+			}
751
+		}
752
+
753
+		.activite-code-mask {
754
+			width: 100%;
755
+			height: 100%;
756
+			background: transparent;
757
+			position: fixed;
758
+			top: 0;
759
+			left: 0;
760
+		}
761
+
762
+		.process-zhuti-btn {
763
+			width: 686rpx;
764
+			height: 98rpx;
765
+			background: rgba(31, 124, 255, 0.4);
766
+			margin: 50rpx 0 94rpx;
767
+			color: #FFFFFF;
768
+			text-align: center;
769
+			line-height: 98rpx;
770
+			border-radius: 8rpx;
771
+		}
772
+
773
+		// 选择开户行
774
+		.back-combox {
775
+			position: relative;
776
+			display: flex;
777
+			flex-direction: row;
778
+			align-items: center;
779
+			width: 100%;
780
+			height: 94rpx;
781
+			// background: rgba(31, 124, 255, 0.1);
782
+			border-radius: 8rpx;
783
+			box-sizing: border-box;
784
+		}
785
+
786
+		.back-combox__input-box {
787
+			position: relative;
788
+			display: flex;
789
+			flex: 1;
790
+			flex-direction: row;
791
+			align-items: center;
792
+		}
793
+
794
+		.back-combox__input {
795
+			flex: 1;
796
+			font-size: 30rpx;
797
+			height: 94rpx;
798
+			line-height: 94rpx;
799
+		}
800
+
801
+		.back-combox__selector {
802
+			box-sizing: border-box;
803
+			position: absolute;
804
+			top: calc(100% + 24rpx);
805
+			left: 0;
806
+			width: 100%;
807
+			background-color: #FFFFFF;
808
+			border: 1px solid #EBEEF5;
809
+			border-radius: 12rpx;
810
+			box-shadow: 0 4rpx 24rpx 0 rgba(0, 0, 0, 0.1);
811
+			z-index: 1000;
812
+			padding: 8rpx 0;
813
+		}
814
+
815
+		.back-combox__selector-scroll {
816
+			max-height: 400rpx;
817
+			box-sizing: border-box;
818
+		}
819
+
820
+		.back-combox__selector-empty,
821
+		.back-combox__selector-item {
822
+			display: flex;
823
+			cursor: pointer;
824
+			line-height: 72rpx;
825
+			font-size: 28rpx;
826
+			text-align: center;
827
+			padding: 0px 20rpx;
828
+		}
829
+
830
+		.back-combox__selector-item:hover {
831
+			background-color: #f9f9f9;
832
+		}
833
+
834
+		.back-combox__selector-empty:last-child,
835
+		.back-combox__selector-item:last-child {
836
+			border-bottom: none;
837
+		}
838
+
839
+		// picker 弹出层通用的指示小三角
840
+		.back-popper__arrow,
841
+		.back-popper__arrow::after {
842
+			position: absolute;
843
+			display: block;
844
+			width: 0;
845
+			height: 0;
846
+			border-color: transparent;
847
+			border-style: solid;
848
+			border-width: 12rpx;
849
+		}
850
+
851
+		.back-popper__arrow {
852
+			filter: drop-shadow(0 4rpx 24rpx rgba(0, 0, 0, 0.03));
853
+			top: -12rpx;
854
+			left: 10%;
855
+			margin-right: 6rpx;
856
+			border-top-width: 0;
857
+			border-bottom-color: #EBEEF5;
858
+		}
859
+
860
+		.back-popper__arrow::after {
861
+			content: " ";
862
+			top: 2rpx;
863
+			margin-left: -12rpx;
864
+			border-top-width: 0;
865
+			border-bottom-color: #fff;
866
+		}
867
+
868
+		.back-combox__no-border {
869
+			border: none;
870
+		}
871
+
872
+		.type-mask {
873
+			width: 100%;
874
+			height: 100vh;
875
+			position: fixed;
876
+			top: 0;
877
+			left: 0;
878
+		}
879
+
880
+		.btn-bir {
881
+			background: #1F7CFF;
882
+		}
883
+	}
884
+</style>

+ 244 - 0
openmerchant/shopentry/processaudit.vue

@@ -0,0 +1,244 @@
1
+<template>
2
+	<view class="process">
3
+		<view class="process-header">
4
+			<view class="process-header-text">
5
+				<view class="process-header-text-icon" @click="topgi">
6
+					<image src="https://cdn.bjtdba.com/vod/image/2022-08-11/20220811133828415.png" mode="widthFix">
7
+					</image>
8
+				</view>
9
+				<view class="process-header-text-title">
10
+					店铺入驻
11
+				</view>
12
+			</view>
13
+		</view>
14
+		<view class="process-zhuti">
15
+			<!-- 提交资料 -->
16
+			<view class="process-audit" v-if="submitCode == 1">
17
+				<image class="process-auditimg" src="https://cdn.bjtdba.com/vod/image/2022-08-22/20220822183048362.png"
18
+					mode=""></image>
19
+				<view class="process-audittitle">恭喜,您的资料提交成功!</view>
20
+				<view class="process-auditintroduce">预计15个工作日内审核完毕,平台客服会及时与您联系!</view>
21
+			</view>
22
+			<!-- 审核中 -->
23
+			<view class="process-audit" v-else-if="submitCode == 3">
24
+				<image class="process-auditimg" src="https://cdn.bjtdba.com/vod/image/2022-08-22/20220822182939278.png"
25
+					mode=""></image>
26
+				<view class="process-audittitle">店铺审核中!</view>
27
+				<view class="process-auditintroduce">提交日期:{{selectmerchant.merchantIntention.create_time}},5个工作日内审核完毕!
28
+				</view>
29
+			</view>
30
+			<!-- 审核失败 -->
31
+			<view class="process-audit" v-else>
32
+				<image class="process-auditimg" src="https://cdn.bjtdba.com/vod/image/2022-08-22/20220822183146760.png"
33
+					mode=""></image>
34
+				<view class="process-audittitle">审核失败</view>
35
+				<view class="process-auditintroduce">原因:{{selectmerchant.merchantIntention.check_result}}</view>
36
+				<view class="process-audit-update" @click="amendMerchants">点击修改信息</view>
37
+			</view>
38
+			<view class="process-audit-service">
39
+				<view class="process-audit-serviceimg">
40
+					<image src="https://cdn.bjtdba.com/vod/image/2022-09-02/20220902132546705.png" mode="widthFix">
41
+					</image>
42
+				</view>
43
+				<view class="process-audit-servicetext">专属客服微信</view>
44
+			</view>
45
+		</view>
46
+
47
+	</view>
48
+</template>
49
+
50
+<script>
51
+	import {
52
+		selectMerchant
53
+	} from '@/commit/api.js'
54
+	export default {
55
+		data() {
56
+			return {
57
+				value: 0,
58
+				submitCode: 1,
59
+				selectmerchant: [],
60
+				authorization: ""
61
+			}
62
+		},
63
+		onLoad(opsition) {
64
+			uni.showLoading({
65
+				title: '加载中',
66
+				mask: true
67
+			});
68
+			this.submitCode = opsition.submitCode;
69
+			this.selectmerchant = uni.getStorageSync('selectmerchant')
70
+			setTimeout(function() {
71
+				uni.hideLoading();
72
+			}, 700);
73
+		},
74
+		onShow() {
75
+			let userinfo = uni.getStorageSync('userinfo')
76
+			this.authorization = uni.getStorageSync('authorization')
77
+			this.panduanshuhju(userinfo.uid)
78
+		},
79
+
80
+		methods: {
81
+			panduanshuhju(e) {
82
+				selectMerchant({
83
+					uid: e
84
+				}).then(data => {
85
+					if (data.data.status == 200) {
86
+						let selectmerchant = data.data.data
87
+						uni.setStorageSync('selectmerchant', selectmerchant)
88
+						if (this.authorization && e) {
89
+							if (selectmerchant.merId >= 0 && selectmerchant.status == -1) {
90
+								uni.redirectTo({
91
+									url: "/openmerchant/guide/index" //有或者没有商户 没有金额支付and激活码支付
92
+								});
93
+								return
94
+							} else if (selectmerchant.merId > 0 && (selectmerchant.status == 1 || selectmerchant.status == 5)) {
95
+								uni.switchTab({
96
+									url: '/pages/cashier/index' //已开通商户
97
+								});
98
+								return
99
+							} else if (selectmerchant.merId >= 0 && (selectmerchant.status == 3 || selectmerchant.status == 4)) {
100
+								uni.redirectTo({
101
+									url: '/openmerchant/shopentry/process?mer_id=' + selectmerchant
102
+										.merId //已开通商户未填写资料
103
+								});
104
+								return
105
+							}
106
+						} else {
107
+							uni.redirectTo({
108
+								url: "/pages/user/login/index"
109
+							});
110
+						}
111
+					}
112
+				}, fail => {
113
+					uni.showToast({
114
+						title: fail,
115
+						icon: "none"
116
+					})
117
+				}).catch(err => {
118
+					console.log(err)
119
+				})
120
+			},
121
+			topgi() {
122
+				uni.showToast({
123
+					title: "请耐心等待...",
124
+					icon: "none"
125
+				});
126
+			},
127
+			amendMerchants() {
128
+				this.$store.commit('changeMerchantsStatus', 1);
129
+				uni.navigateTo({
130
+					url: './process?mer_id=' + this.selectmerchant.merId + '&is=' + 1
131
+				});
132
+			}
133
+		}
134
+	}
135
+</script>
136
+
137
+<style>
138
+	page {
139
+		background-color: #F7F8FC;
140
+	}
141
+</style>
142
+<style lang="scss" scoped>
143
+	.process {
144
+		width: 100%;
145
+		height: 100%;
146
+		display: flex;
147
+		flex-direction: column;
148
+		align-items: center;
149
+		justify-content: center;
150
+
151
+		.process-header {
152
+			position: fixed;
153
+			top: 0;
154
+			left: 0;
155
+			z-index: 111;
156
+			width: 100%;
157
+			height: 176rpx;
158
+			background: #FFFFFF;
159
+			display: flex;
160
+			justify-content: center;
161
+
162
+			.process-header-text {
163
+				width: 686rpx;
164
+				font-size: 36rpx;
165
+				font-weight: 500;
166
+				color: #333333;
167
+				display: flex;
168
+				margin-top: 107rpx;
169
+				align-items: center;
170
+
171
+				.process-header-text-icon {
172
+					width: 36rpx;
173
+					height: 36rpx;
174
+					margin-right: 26rpx;
175
+					line-height: 36rpx;
176
+
177
+					image {
178
+						width: 100%;
179
+						height: 100%;
180
+					}
181
+				}
182
+			}
183
+		}
184
+
185
+		.process-zhuti {
186
+			width: 100%;
187
+			height: 100%;
188
+			position: fixed;
189
+			top: 0;
190
+			left: 0;
191
+			margin-top: 202rpx;
192
+			display: flex;
193
+			flex-direction: column;
194
+			align-items: center;
195
+			// padding: 32rpx 0 40rpx;
196
+			padding-bottom: 40rpx;
197
+			background: #FFFFFF;
198
+			text-align: center;
199
+
200
+			.process-audit {
201
+				padding: 0 97rpx 0 98rpx;
202
+
203
+				.process-auditimg {
204
+					margin: 101rpx 0 20rpx 0;
205
+					width: 199rpx;
206
+					height: 226rpx;
207
+				}
208
+
209
+				.process-audittitle {
210
+					font-size: 38rpx;
211
+				}
212
+
213
+				.process-auditintroduce {
214
+					font-size: 28rpx;
215
+					color: #B6B6B6;
216
+					margin-top: 70rpx;
217
+				}
218
+
219
+				.process-audit-update {
220
+					width: 330rpx;
221
+					height: 98rpx;
222
+					line-height: 98rpx;
223
+					color: #FFFFFF;
224
+					background: #1F7CFF;
225
+					margin: auto;
226
+					margin-top: 108rpx;
227
+				}
228
+			}
229
+
230
+			.process-audit-service {
231
+				.process-audit-serviceimg {
232
+					width: 210rpx;
233
+					height: 210rpx;
234
+					margin: 50rpx 0 20rpx 0;
235
+
236
+					image {
237
+						width: 100%;
238
+						height: 100%;
239
+					}
240
+				}
241
+			}
242
+		}
243
+	}
244
+</style>

+ 591 - 0
openmerchant/shopentry/processidentity.vue

@@ -0,0 +1,591 @@
1
+<template>
2
+	<view class="process">
3
+		<view class="process-header">
4
+			<view class="process-header-text">
5
+				<view class="process-header-text-neishi" @click="topgi">
6
+					<view class="process-header-text-icon">
7
+						<image src="https://cdn.bjtdba.com/vod/image/2022-08-11/20220811133828415.png" mode="widthFix">
8
+						</image>
9
+					</view>
10
+				</view>
11
+				<view class="process-header-text-title">
12
+					店铺入驻
13
+				</view>
14
+			</view>
15
+		</view>
16
+		<view class="process-zhuti">
17
+			<view class="process-zhuti-yi">
18
+				<view class="process-zhuti-yi-text">
19
+					请上传身份证人像面:
20
+				</view>
21
+				<view class="process-zhuti-yi-upload" @click="cardPositivePerson">
22
+					<image v-if="merchantspersonal.card_positive_person" :src="merchantspersonal.card_positive_person"
23
+						mode=""></image>
24
+					<image v-else src="https://cdn.bjtdba.com/vod/image/2022-08-22/20220822174457868.png" mode="">
25
+					</image>
26
+				</view>
27
+			</view>
28
+			<view class="process-zhuti-yi">
29
+				<view class="process-zhuti-yi-text">
30
+					请上传身份证国徽面:
31
+				</view>
32
+				<view class="process-zhuti-yi-upload" @click="cardBackPerson">
33
+					<image v-if="merchantspersonal.card_back_person" :src="merchantspersonal.card_back_person" mode="">
34
+					</image>
35
+					<image v-else src="https://cdn.bjtdba.com/vod/image/2022-08-22/20220822174524262.png" mode="">
36
+					</image>
37
+				</view>
38
+			</view>
39
+			<view class="process-zhuti-yi">
40
+				<view class="process-zhuti-yi-text">
41
+					身份证号
42
+				</view>
43
+				<view class="process-zhuti-yi-input">
44
+					<input placeholder="请填写身份证号" v-model="merchantspersonal.idcard_no">
45
+				</view>
46
+			</view>
47
+			<view class="process-zhuti-yi">
48
+				<view class="process-zhuti-yi-text">
49
+					身份证有效期限
50
+				</view>
51
+				<view class="process-zhuti-yi-input" style="display: flex;">
52
+					<uni-datetime-picker type="date" :clear-icon="false" v-model="merchantspersonal.identification_valid_date_start" @maskClick="maskClick">
53
+						<input placeholder="有效期限开始" v-model="merchantspersonal.identification_valid_date_start" disabled>
54
+					</uni-datetime-picker>
55
+					<view class="" style="width: 100rpx;height: 100%;background-color: rgba(31, 124, 255, 0.1); display: flex;justify-content: center;align-items: center; color: #B6B6B6;">
56
+							——
57
+					</view>
58
+					<!-- :disabled="merchantspersonal.identification_valid_date_end == '长期' ? true : false" -->
59
+					<uni-datetime-picker type="date" :clear-icon="false" v-model="merchantspersonal.identification_valid_date_end" @maskClick="maskClick">
60
+						<input placeholder="有效期限结束" v-model="merchantspersonal.identification_valid_date_end" disabled>
61
+					</uni-datetime-picker>
62
+					<checkbox-group style="line-height: 94rpx;background: rgba(31, 124, 255, 0.1);padding: 0 20rpx;" @change="checkboxChange">
63
+						<label>
64
+							<checkbox value="2099-12-31" />长期
65
+						</label>
66
+					</checkbox-group>
67
+					<!-- <uni-datetime-picker v-model="range" type="date"  @change="changeLog" style="display: flex;">
68
+						<input placeholder="请填写身份证有效期限" v-model="merchantspersonal.identification_valid_date_start" disabled>
69
+					</uni-datetime-picker>
70
+					<uni-datetime-picker v-model="range" type="date"  @change="changeLog" style="display: flex;">
71
+						<input placeholder="请填写身份证有效期限" v-model="merchantspersonal.identification_valid_date_end" disabled>
72
+					</uni-datetime-picker> -->
73
+				</view>
74
+			</view>
75
+			<view class="process-zhuti-yi">
76
+				<view class="process-zhuti-yi-text">
77
+					联系人姓名
78
+				</view>
79
+				<view class="process-zhuti-yi-input">
80
+					<input placeholder="请填写联系人姓名" v-model="merchantspersonal.name">
81
+				</view>
82
+			</view>
83
+			<view class="process-zhuti-yi">
84
+				<view class="process-zhuti-yi-text">
85
+					联系人手机号
86
+				</view>
87
+				<view class="process-zhuti-yi-input">
88
+					<input placeholder="请填写联系人手机号" maxlength="11" v-model="merchantspersonal.phone" @input="inputPhone">
89
+				</view>
90
+			</view>
91
+			<view class="process-zhuti-yi">
92
+				<view class="process-zhuti-yi-text">
93
+					联系人邮箱
94
+				</view>
95
+				<view class="process-zhuti-yi-input">
96
+					<input placeholder="请填写联系人邮箱" v-model="merchantspersonal.email">
97
+				</view>
98
+			</view>
99
+		</view>
100
+		<view class="process-zhuti-fot">
101
+			<view class="process-zhuti-fottext">
102
+				<view class="fottext-img" @click="agreement = !agreement">
103
+					<image v-if="agreement" src="https://cdn.bjtdba.com/vod/image/2022-08-23/20220823132347513.png"
104
+						mode=""></image>
105
+					<image v-else src="https://cdn.bjtdba.com/vod/image/2022-08-22/20220822155008662.png" mode="">
106
+					</image>
107
+				</view>
108
+				<view class="fottext-nav">
109
+					点击表示同意<span style="color: #1f7cff" @click="xieyi()">《商家入驻协议》</span>
110
+				</view>
111
+			</view>
112
+			<view class="process-zhuti-btnbox">
113
+				<view class="process-zhuti-btn backbtn" @click="backStep">
114
+					上一步
115
+				</view>
116
+				<view :class="[btnBir ? 'btn-bir' : '', 'process-zhuti-btn' ]" @click="btnBir ? goIdentity() : ''">
117
+					立即申请
118
+				</view>
119
+			</view>
120
+		</view>
121
+
122
+
123
+	</view>
124
+</template>
125
+
126
+<script>
127
+	import {
128
+		merchaSettlen,
129
+		updateMerchaSettlen
130
+	} from '@/commit/api.js';
131
+	import {
132
+		mapGetters
133
+	} from 'vuex';
134
+	export default {
135
+		data() {
136
+			return {
137
+				merchantspersonal: {
138
+					card_positive_person: '', // 身份证正面
139
+					card_back_person: '', // 身份证反面
140
+					idcard_no: '', // 身份证号
141
+					identification_valid_date_start: '', // 身份证开始时间
142
+					identification_valid_date_end: '', // 身份证结束时间
143
+					name: '', //姓名
144
+					phone: '', // 手机号
145
+					email: '', // 邮箱
146
+					uid: ''
147
+				},
148
+				longtime:'',
149
+				value: 0,
150
+				range: [],
151
+				agreement: false,
152
+				merchantData: {},
153
+				btnBir: false,
154
+				nextMerchantsData: {}
155
+			}
156
+		},
157
+		computed: {
158
+			...mapGetters(['merchantsDataAlls'])
159
+		},
160
+		onLoad(opsition) {
161
+			this.identification_valid_date_end
162
+			console.log(this.merchantspersonal.identification_valid_date_end,"989898")
163
+			let userinfo = uni.getStorageSync('userinfo')
164
+			this.merchantspersonal.uid = userinfo.uid
165
+			const merchantsDataAll = this.merchantsDataAlls.merchantsDataAll;
166
+			if (JSON.stringify(merchantsDataAll) != "{}") {
167
+				this.range = [merchantsDataAll.identification_valid_date_start, merchantsDataAll
168
+					.identification_valid_date_end
169
+				];
170
+				this.merchantspersonal.card_positive_person = merchantsDataAll.card_positive_person; // 身份证正面
171
+				this.merchantspersonal.card_back_person = merchantsDataAll.card_back_person; // 身份证反面
172
+				this.merchantspersonal.idcard_no = merchantsDataAll.idcard_no; // 身份证号
173
+				this.merchantspersonal.identification_valid_date_start = merchantsDataAll.identification_valid_date_start; // 身份证开始时间
174
+				this.merchantspersonal.identification_valid_date_end = merchantsDataAll.identification_valid_date_end; // 身份证结束时间
175
+				this.merchantspersonal.name = merchantsDataAll.name; // 姓名
176
+				this.merchantspersonal.phone = merchantsDataAll.phone; // 手机号
177
+				this.merchantspersonal.email = merchantsDataAll.email; // 邮箱
178
+			}
179
+		},
180
+		watch: {
181
+			merchantspersonal: {
182
+				handler: function(val) {
183
+					this.isShow(val)
184
+				},
185
+				deep: true
186
+			},
187
+			agreement: {
188
+				handler: function(val) {
189
+					this.isShow()
190
+				}
191
+			}
192
+		},
193
+		methods: {
194
+			maskClick(e){
195
+				console.log('maskClick事件:', e);
196
+			},
197
+			checkboxChange: function (e) {
198
+				if(e.detail.value){
199
+					this.longtime = e.detail.value[0];
200
+				}else{
201
+					this.longtime = "";
202
+				}
203
+			},
204
+			topgi() {
205
+				uni.navigateBack({
206
+					delta: 1
207
+				});
208
+			},
209
+			//商户协议
210
+			xieyi() {
211
+				uni.setStorageSync('agreementType','6')
212
+				uni.navigateTo({
213
+					url: "/pages/index/bottombat?type=6" 
214
+				})
215
+			},
216
+			isShow(list) {
217
+				let temp = true
218
+				if (list) {
219
+
220
+					for (let i in list) {
221
+						if (list[i] == "" || list[i] == null) {
222
+							temp = false
223
+						}
224
+					}
225
+				}
226
+
227
+				if (!this.agreement) {
228
+					temp = false
229
+				}
230
+				this.btnBir = temp
231
+			},
232
+			// 身份证正面
233
+			cardPositivePerson() {
234
+				let that = this;
235
+				that.$time.uploadPictures(res => {
236
+					that.merchantspersonal.card_positive_person = res;
237
+				});
238
+			},
239
+			// 身份证反面
240
+			cardBackPerson() {
241
+				let that = this;
242
+				that.$time.uploadPictures(res => {
243
+					that.merchantspersonal.card_back_person = res;
244
+				});
245
+			},
246
+			// 身份证有效期
247
+			changeLog(e) {
248
+				// this.merchantspersonal.identification_valid_date_start = e[0];
249
+				// this.merchantspersonal.identification_valid_date_end = e[1];
250
+			},
251
+			// 手机号
252
+			inputPhone(e) {
253
+				this.$nextTick(function() {
254
+					this.merchantspersonal.phone = e.target.value.replace(/[^\d]/g, '');
255
+				})
256
+			},
257
+			backStep() {
258
+				uni.navigateBack({
259
+					delta: 1
260
+				});
261
+			},
262
+			goIdentity() {
263
+				let that = this;
264
+				if (that.merchantspersonal.card_positive_person == "") return uni.showToast({
265
+					title: "请上传身份证人像面",
266
+					icon: "none"
267
+				});
268
+				if (that.merchantspersonal.card_back_person == "") return uni.showToast({
269
+					title: "请上传身份证国徽面",
270
+					icon: "none"
271
+				});
272
+				if (that.merchantspersonal.idcard_no == "") return uni.showToast({
273
+					title: "请填写身份证号",
274
+					icon: "none"
275
+				});
276
+				if (!/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/
277
+					.test(that.merchantspersonal.idcard_no)) {
278
+					uni.showToast({
279
+						title: "请填写有效身份证号",
280
+						icon: "none"
281
+					});
282
+					 return
283
+				}
284
+				if (that.merchantspersonal.identification_valid_date_start == "" && (that.merchantspersonal
285
+					.identification_valid_date_end == "" || this.longtime == "")) return uni.showToast({
286
+					title: "请选择身份证有效期限",
287
+					icon: "none"
288
+				});
289
+				if (that.merchantspersonal.name == "") return uni.showToast({
290
+					title: "请填写联系人姓名",
291
+					icon: "none"
292
+				});
293
+				if (that.merchantspersonal.phone == "")
294
+					return uni.showToast({
295
+						title: "请填写联系人手机号",
296
+						icon: "none"
297
+					});
298
+				if (!/^1[3456789]\d{9}$/.test(that.merchantspersonal.phone)) {
299
+					uni.showToast({
300
+						title: "请填写有效联系人手机号",
301
+						icon: "none"
302
+					});
303
+					return
304
+				}
305
+				if (that.merchantspersonal.email == "") {
306
+					uni.showToast({
307
+						title: "请填写联系人邮箱",
308
+						icon: "none"
309
+					});
310
+					return
311
+				}
312
+				if (!/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/.test(
313
+						that.merchantspersonal.email)) {
314
+					uni.showToast({
315
+						title: "请填写有效联系人邮箱",
316
+						icon: "none"
317
+					});
318
+					return
319
+				}
320
+				if (!that.agreement) return uni.showToast({
321
+					title: "请阅读并勾选同意《商家入驻协议》",
322
+					icon: "none"
323
+				});
324
+				if(that.longtime){
325
+					that.merchantspersonal.identification_valid_date_end = that.longtime;
326
+				}
327
+				uni.showLoading({
328
+					title: '加载中',
329
+					mask: true
330
+				});
331
+				uni.getStorage({
332
+					key: 'merchants_in',
333
+					success: function(res) {
334
+						that.merchantData = Object.assign(that.merchantData, res.data)
335
+
336
+						uni.getStorage({
337
+							key: 'merchants_in_store',
338
+							success: function(res) {
339
+								that.merchantData = Object.assign(that.merchantData, res.data, that
340
+									.merchantspersonal)
341
+								let selectmerchant = uni.getStorageSync('selectmerchant')
342
+								let merchantsStatus = that.merchantsDataAlls.merchantsStatus;
343
+								if (merchantsStatus == 1) {
344
+									//修改信息
345
+									that.merchantData = Object.assign(that.merchantData, {
346
+										mer_id: selectmerchant.merId
347
+									})
348
+									updateMerchaSettlen(that.merchantData).then(res => {
349
+										if (res.data.status == 200) {
350
+											console.log('成功', res);
351
+											uni.removeStorage({
352
+												key: 'merchants_in'
353
+											});
354
+											uni.removeStorage({
355
+												key: 'merchants_in_store'
356
+											});
357
+											uni.redirectTo({
358
+												url: './processaudit?submitCode=1'
359
+											});
360
+											uni.hideLoading();
361
+										}
362
+									}, fail => {
363
+										console.log('fail', fail)
364
+										uni.hideLoading();
365
+									})
366
+								} else {
367
+									if (selectmerchant.pay_type == 2) {
368
+										//修改信息
369
+										that.merchantData = Object.assign(that.merchantData, {
370
+											mer_id: selectmerchant.merId
371
+										})
372
+										updateMerchaSettlen(that.merchantData).then(res => {
373
+											if (res.data.status == 200) {
374
+												console.log('成功', res);
375
+												uni.removeStorage({
376
+													key: 'merchants_in'
377
+												});
378
+												uni.removeStorage({
379
+													key: 'merchants_in_store'
380
+												});
381
+												uni.redirectTo({
382
+													url: './processaudit?submitCode=1'
383
+												});
384
+												uni.hideLoading();
385
+											}
386
+										}, fail => {
387
+											console.log('fail', fail)
388
+											uni.hideLoading();
389
+										})
390
+									} else {
391
+										// 新增信息
392
+										merchaSettlen(that.merchantData).then(res => {
393
+											console.log('res', res)
394
+											if (res.data.status == 200) {
395
+												console.log('成功', res);
396
+												uni.removeStorage({
397
+													key: 'merchants_in'
398
+												});
399
+												uni.removeStorage({
400
+													key: 'merchants_in_store'
401
+												});
402
+												uni.redirectTo({
403
+													url: './processaudit?submitCode=1'
404
+												});
405
+												uni.hideLoading();
406
+											}
407
+										}, fail => {
408
+											console.log('fail', fail)
409
+											uni.hideLoading();
410
+										})
411
+									}
412
+								}
413
+							}
414
+						});
415
+
416
+					}
417
+				});
418
+			}
419
+		}
420
+	}
421
+</script>
422
+
423
+<style>
424
+	page {
425
+		background-color: #F7F8FC;
426
+	}
427
+</style>
428
+<style lang="scss" scoped>
429
+	.process {
430
+		width: 100%;
431
+		height: 100%;
432
+		display: flex;
433
+		flex-direction: column;
434
+		align-items: center;
435
+		justify-content: center;
436
+
437
+		.process-header {
438
+			position: fixed;
439
+			top: 0;
440
+			left: 0;
441
+			z-index: 111;
442
+			width: 100%;
443
+			height: 176rpx;
444
+			background: #FFFFFF;
445
+			display: flex;
446
+			justify-content: center;
447
+
448
+			.process-header-text {
449
+				width: 686rpx;
450
+				font-size: 36rpx;
451
+				font-weight: 500;
452
+				color: #333333;
453
+				display: flex;
454
+				margin-top: 107rpx;
455
+				align-items: center;
456
+
457
+				.process-header-text-neishi {
458
+					width: 45rpx;
459
+					height: 45rpx;
460
+					margin-right: 17rpx;
461
+
462
+					.process-header-text-icon {
463
+						width: 36rpx;
464
+						height: 36rpx;
465
+						margin-top: 2rpx;
466
+
467
+						image {
468
+							width: 100%;
469
+							height: 100%;
470
+						}
471
+					}
472
+				}
473
+			}
474
+		}
475
+
476
+		.process-zhuti {
477
+			width: 100%;
478
+			height: auto;
479
+			margin-top: 202rpx;
480
+			display: flex;
481
+			flex-direction: column;
482
+			align-items: center;
483
+			// padding: 32rpx 0 40rpx;
484
+			padding-bottom: 40rpx;
485
+			background: #FFFFFF;
486
+
487
+			.process-zhuti-yi {
488
+				width: 686rpx;
489
+				// height: 150rpx;
490
+				display: flex;
491
+				flex-direction: column;
492
+				justify-content: space-between;
493
+				align-items: flex-start;
494
+				margin-top: 32rpx;
495
+
496
+				.process-zhuti-yi-text {
497
+					font-size: 30rpx;
498
+					font-weight: 500;
499
+					color: #333333;
500
+					margin-bottom: 26rpx;
501
+				}
502
+
503
+				.process-zhuti-yi-input {
504
+					width: 100%;
505
+					height: 94rpx;
506
+					// background: #1F7CFF;
507
+					// 31 124 255 10
508
+					border-radius: 8rpx;
509
+					// opacity: 0.1;
510
+
511
+					input {
512
+						width: 100%;
513
+						height: 94rpx;
514
+						background: rgba(31, 124, 255, 0.1);
515
+						border-radius: 8rpx;
516
+						box-sizing: border-box;
517
+						padding-left: 32rpx;
518
+					}
519
+				}
520
+
521
+				.process-zhuti-yi-upload {
522
+					width: 100%;
523
+					// height: 404rpx;
524
+					// background: rgba(31, 124, 255, 0.1);
525
+					border-radius: 8rpx;
526
+					display: flex;
527
+					justify-content: center;
528
+					align-items: center;
529
+
530
+					image {
531
+						width: 520rpx;
532
+						height: 279rpx;
533
+						border: 1rpx dashed #aaa;
534
+					}
535
+				}
536
+			}
537
+		}
538
+
539
+		.process-zhuti-fot {
540
+			margin: 50rpx 0 94rpx;
541
+		}
542
+
543
+		.process-zhuti-fottext {
544
+			font-size: 24rpx;
545
+			margin-bottom: 20rpx;
546
+
547
+			.fottext-img {
548
+				display: inline-block;
549
+				vertical-align: middle;
550
+
551
+				image {
552
+					width: 28rpx;
553
+					height: 28rpx;
554
+					margin-right: 15rpx;
555
+				}
556
+			}
557
+
558
+			.fottext-nav {
559
+				display: inline-block;
560
+			}
561
+		}
562
+
563
+		.process-zhuti-btnbox {
564
+			color: #FFFFFF;
565
+			display: flex;
566
+			justify-content: space-between;
567
+		}
568
+
569
+		.process-zhuti-btn {
570
+			width: 330rpx;
571
+			height: 98rpx;
572
+			background: rgba(31, 124, 255, 0.4);
573
+			text-align: center;
574
+			line-height: 98rpx;
575
+			border-radius: 8rpx;
576
+		}
577
+
578
+		.backbtn {
579
+			margin-right: 26rpx;
580
+			background: #1F7CFF;
581
+		}
582
+
583
+		.btn-bir {
584
+			background: #1F7CFF;
585
+		}
586
+	}
587
+	/deep/.uni-date{
588
+		width: 50%;
589
+		display: inline-block;
590
+	}
591
+</style>

+ 733 - 0
openmerchant/shopentry/processstore.vue

@@ -0,0 +1,733 @@
1
+<template>
2
+	<view class="process">
3
+		<view class="process-header">
4
+			<view class="process-header-text">
5
+				<view class="process-header-text-neishi" @click="topgi">
6
+					<view class="process-header-text-icon">
7
+						<image src="https://cdn.bjtdba.com/vod/image/2022-08-11/20220811133828415.png" mode="widthFix">
8
+						</image>
9
+					</view>
10
+				</view>
11
+				<view class="process-header-text-title">
12
+					店铺入驻
13
+				</view>
14
+			</view>
15
+		</view>
16
+		<view class="process-zhuti">
17
+			<view class="process-zhuti-yi">
18
+				<view class="process-zhuti-yi-text">
19
+					店铺LOGO
20
+				</view>
21
+				<view class="process-zhuti-yi-upload" @click="storeLogo">
22
+					<image v-if="merchantsInStore.logo" :src="merchantsInStore.logo" mode=""></image>
23
+					<image v-else src="https://cdn.bjtdba.com/vod/image/2022-08-22/20220822172529458.png" mode=""></image>
24
+				</view>
25
+			</view>
26
+			<view class="process-zhuti-yi">
27
+				<view class="process-zhuti-yi-text">
28
+					门店简称
29
+				</view>
30
+				<view class="process-zhuti-yi-input">
31
+					<input placeholder="请填写门店简称" v-model="merchantsInStore.mer_short_name">
32
+				</view>
33
+			</view>
34
+			<view class="process-zhuti-yi">
35
+				<view class="process-zhuti-yi-text">
36
+					门店简介
37
+				</view>
38
+				<view class="process-zhuti-yi-input">
39
+					<input placeholder="请填写门店简介" v-model="merchantsInStore.mark">
40
+				</view>
41
+			</view>
42
+			<view class="process-zhuti-yi">
43
+				<view class="process-zhuti-yi-text">
44
+					门店分类
45
+				</view>
46
+				<view class="process-zhuti-yi-input">
47
+					<picker class="process-zhuti-yi-picker" @change="changeStoretype" :value="storeTypeindex" :range="storeTypeData" :range-key="'category_name'">
48
+						<view v-if="storeTypeindex === null" class="uni-input int-col">请选择门店分类</view>
49
+						<view v-else class="uni-input">{{storeTypeData[storeTypeindex].category_name}}</view>
50
+					</picker>
51
+					<!-- <view class="back-combox">
52
+						<view class="back-combox__input-box">
53
+							<input class="back-combox__input" placeholder="请选择门店分类" disabled v-model="storeType.category_name" @click="showSelector = true" />
54
+						</view>
55
+						<view class="back-combox__selector" v-if="showSelector">
56
+							<view class="back-popper__arrow"></view>
57
+							<scroll-view scroll-y="true" class="back-combox__selector-scroll">
58
+								<view class="back-combox__selector-item" v-for="(item,index) in storeTypeData" :key="index" @click="onSelectorClick(item)">
59
+									<text>{{item.category_name}}</text>
60
+								</view>
61
+							</scroll-view>
62
+						</view>
63
+					</view> -->
64
+				</view>
65
+			</view>
66
+			<view class="process-zhuti-yi">
67
+				<view class="process-zhuti-yi-text">
68
+					选择省份
69
+				</view>
70
+				<view class="process-zhuti-yi-input">
71
+					<picker class="process-zhuti-yi-picker" @change="changeProvince" :value="provinceListindex" :range="provinceList" :range-key="'name'">
72
+						<view v-if="provinceListindex === null" class="uni-input int-col">请选择省份</view>
73
+						<view v-else class="uni-input">{{provinceList[provinceListindex].name}}</view>
74
+					</picker>
75
+				</view>
76
+			</view>
77
+			<view class="process-zhuti-yi">
78
+				<view class="process-zhuti-yi-text">
79
+					选择城市
80
+				</view>
81
+				<view class="process-zhuti-yi-input">
82
+					<picker class="process-zhuti-yi-picker" @change="changeCity" :value="cityListindex" :range="cityList" :range-key="'name'">
83
+						<view v-if="cityListindex === null" class="uni-input int-col">请选择城市</view>
84
+						<view v-else class="uni-input">{{cityList[cityListindex].name}}</view>
85
+					</picker>
86
+				</view>
87
+			</view>
88
+			<view class="process-zhuti-yi">
89
+				<view class="process-zhuti-yi-text">
90
+					选择区
91
+				</view>
92
+				<view class="process-zhuti-yi-input">
93
+					<picker class="process-zhuti-yi-picker" @change="changeArea" :value="areaListindex" :range="areaList" :range-key="'name'">
94
+						<view v-if="areaListindex === null" class="uni-input int-col">请选择区</view>
95
+						<view v-else class="uni-input">{{areaList[areaListindex].name}}</view>
96
+					</picker>
97
+				</view>
98
+			</view>
99
+			<view class="process-zhuti-yi">
100
+				<view class="process-zhuti-yi-text">
101
+					选择街道
102
+				</view>
103
+				<view class="process-zhuti-yi-input">
104
+					<picker class="process-zhuti-yi-picker" @change="changeStreet" :value="streetListindex" :range="streetList" :range-key="'name'">
105
+						<view v-if="streetListindex === null" class="uni-input int-col">请选择街道</view>
106
+						<view v-else class="uni-input">{{streetList[streetListindex].name}}</view>
107
+					</picker>
108
+				</view>
109
+			</view>
110
+			<view class="process-zhuti-yi">
111
+				<view class="process-zhuti-yi-text">
112
+					详细地址
113
+				</view>
114
+				<view class="process-zhuti-yi-input">
115
+					<input placeholder="请填写详细地址" v-model="merchantsInStore.addr">
116
+				</view>
117
+			</view>
118
+		</view>
119
+		<view class="process-zhuti-btnbox">
120
+			<view class="process-zhuti-btn backbtn" @click="backStep()">
121
+				上一步
122
+			</view>
123
+			<view :class="[btnBir ? 'btn-bir' : '', 'process-zhuti-btn' ]" @click=" btnBir ? nextStep() : '' ">
124
+				下一步
125
+			</view>
126
+		</view>
127
+		
128
+	</view>
129
+</template>
130
+
131
+<script>
132
+	import { addressList, selectMerchantSort } from '@/commit/api.js';
133
+	import { mapGetters } from 'vuex'
134
+	export default {
135
+		data() {
136
+			return {
137
+				merchantsInStore: {
138
+					logo: '', // 店铺logoURL
139
+					mer_short_name: '', // 门店简称
140
+					mark: '', // 门店简介
141
+					cate_id: '', // 门店分类
142
+					province_id: 0, // 省ID
143
+					city_id: 0, // 市ID
144
+					area_id: 0, // 区ID
145
+					street_id: 0, // 街道ID
146
+					addr: '', // 详细地址
147
+				},
148
+				showSelector: false,
149
+				storeTypeData: [],
150
+				storeTypeindex: null,
151
+				storeType: {},
152
+				value: 0,
153
+				addressData: [], //城市区列表
154
+				provinceList:[{name:'暂无数据'}],
155
+				provinceListindex: null,
156
+				cityList:[{name:'暂无数据'}],
157
+				cityListindex: null,
158
+				areaList:[{name:'暂无数据'}],
159
+				areaListindex: null,
160
+				streetList:[{name:'暂无数据'}],
161
+				streetListindex: null,
162
+				btnBir: false,
163
+				nextMerchantsData: {},
164
+				merchantsPass: false
165
+			}
166
+		},
167
+		onLoad(opsition) {
168
+			const fanxian = uni.getStorageSync('merchants_in_store');
169
+			const merchantsDataAll = this.merchantsDataAlls.merchantsDataAll;
170
+			
171
+			if(JSON.stringify(merchantsDataAll)!="{}"){
172
+				// 获取门店分类反显
173
+				selectMerchantSort().then(res => {
174
+					if(res.data.status==200){
175
+						this.storeTypeData = res.data.data.merchantCategory;
176
+						this.storeTypeData.filter((item,index) => {
177
+							if(item.merchant_category_id == merchantsDataAll.cate_id){
178
+								return this.storeTypeindex = index
179
+							}
180
+						})
181
+					}
182
+				}, fail => {
183
+					console.log(fail)
184
+				})
185
+				
186
+				// 获取省市区街道反显
187
+				addressList({id:1}).then(res => {
188
+					if(res.data.status==200){
189
+						this.provinceList = res.data.data.addressList;
190
+						this.provinceListindex = Number(merchantsDataAll.provinceMap.index);
191
+						
192
+						addressList({id:2, code: merchantsDataAll.province_id}).then(res => {
193
+							if(res.data.status==200){
194
+								this.cityList = res.data.data.addressList;
195
+								this.cityListindex = Number(merchantsDataAll.cityMap.index);
196
+								
197
+								addressList({id:3, code: merchantsDataAll.city_id}).then(res => {
198
+									if(res.data.status==200){
199
+										this.areaList = res.data.data.addressList;
200
+										this.areaListindex = Number(merchantsDataAll.areaMap.index);
201
+										
202
+										addressList({id:4, code: merchantsDataAll.area_id}).then(res => {
203
+											if(res.data.status==200){
204
+												this.streetList = res.data.data.addressList;
205
+												this.streetListindex = Number(merchantsDataAll.streetMap.index);
206
+											}
207
+										}, fail => {
208
+											console.log(fail)
209
+										})
210
+									}
211
+								}, fail => {
212
+									console.log(fail)
213
+								})
214
+							}
215
+						}, fail => {
216
+							console.log(fail)
217
+						})
218
+					}
219
+				}, fail => {
220
+					console.log(fail)
221
+				})
222
+				// this.merchantsInStore = this.nextMerchantsData;
223
+				
224
+				this.merchantsInStore.logo = merchantsDataAll.logo; // 店铺logoURL
225
+				this.merchantsInStore.mer_short_name = merchantsDataAll.mer_short_name;// 门店简称
226
+				this.merchantsInStore.mark = merchantsDataAll.mark; // 门店简介
227
+				this.merchantsInStore.cate_id = merchantsDataAll.cate_id; // 门店分类
228
+				this.merchantsInStore.province_id = merchantsDataAll.province_id; // 省ID
229
+				this.merchantsInStore.city_id = merchantsDataAll.city_id; // 市ID
230
+				this.merchantsInStore.area_id = merchantsDataAll.area_id; // 区ID
231
+				this.merchantsInStore.street_id = merchantsDataAll.street_id; // 街道ID
232
+				this.merchantsInStore.addr = merchantsDataAll.addr; // 详细地址
233
+				// this.merchantsPass = true;
234
+				
235
+			}else if(fanxian){
236
+				// 获取门店分类反显
237
+				selectMerchantSort().then(res => {
238
+					if(res.data.status==200){
239
+						this.storeTypeData = res.data.data.merchantCategory;
240
+						this.storeTypeData.filter((item,index) => {
241
+							if(item.merchant_category_id == fanxian.cate_id){
242
+								return this.storeTypeindex = index
243
+							}
244
+						})
245
+					}
246
+				}, fail => {
247
+					console.log(fail)
248
+				})
249
+				
250
+				// 获取省市区街道反显
251
+				addressList({id:1}).then(res => {
252
+					if(res.data.status==200){
253
+						this.provinceList = res.data.data.addressList;
254
+						this.provinceList.filter((item,index) => {
255
+							if(item.code == fanxian.province_id){
256
+								return this.provinceListindex = index
257
+							}
258
+						})
259
+						
260
+						addressList({id:2, code: fanxian.province_id}).then(res => {
261
+							if(res.data.status==200){
262
+								this.cityList = res.data.data.addressList;
263
+								this.cityList.filter((item,index) => {
264
+									if(item.code == fanxian.city_id){
265
+										return this.cityListindex = index
266
+									}
267
+								})
268
+								
269
+								addressList({id:3, code: fanxian.city_id}).then(res => {
270
+									if(res.data.status==200){
271
+										this.areaList = res.data.data.addressList;
272
+										this.areaList.filter((item,index) => {
273
+											if(item.code == fanxian.area_id){
274
+												return this.areaListindex = index
275
+											}
276
+										})
277
+										
278
+										addressList({id:4, code: fanxian.area_id}).then(res => {
279
+											if(res.data.status==200){
280
+												this.streetList = res.data.data.addressList;
281
+												this.streetList.filter((item,index) => {
282
+													if(item.code == fanxian.street_id){
283
+														return this.streetListindex = index
284
+													}
285
+												})
286
+											}
287
+										}, fail => {
288
+											console.log(fail)
289
+										})
290
+									}
291
+								}, fail => {
292
+									console.log(fail)
293
+								})
294
+							}
295
+						}, fail => {
296
+							console.log(fail)
297
+						})
298
+					}
299
+				}, fail => {
300
+					console.log(fail)
301
+				})
302
+				
303
+				this.merchantsInStore = fanxian;
304
+			}else{
305
+				// 获取门店分类
306
+				selectMerchantSort().then(res => {
307
+					if(res.data.status==200){
308
+						this.storeTypeData = res.data.data.merchantCategory;
309
+					}
310
+				}, fail => {
311
+					console.log(fail)
312
+				})
313
+				
314
+				// 获取省
315
+				addressList({id:1}).then(res => {
316
+					if(res.data.status==200){
317
+						this.provinceList = res.data.data.addressList;
318
+					}
319
+				}, fail => {
320
+					console.log(fail)
321
+				})
322
+			}
323
+		},
324
+		onShow(){
325
+		},
326
+		computed:{
327
+			...mapGetters(['merchantsDataAlls'])
328
+		},
329
+		watch: {
330
+			merchantsInStore:{
331
+				handler: function(val) {
332
+					this.isShow(val)
333
+				},
334
+				deep: true
335
+			}
336
+		},
337
+		methods: {
338
+			topgi(){
339
+				uni.navigateBack({
340
+					delta:1
341
+				});
342
+			},
343
+			isShow(list) {
344
+				let temp = true
345
+				if(list){
346
+					for(let i in list){
347
+						if(list[i] == "" || list[i] == null){
348
+							temp = false
349
+						}
350
+					}
351
+				}
352
+				this.btnBir = temp
353
+			},
354
+			// 店铺logoURL
355
+			storeLogo(){
356
+				let that = this;
357
+				that.$time.uploadPictures(res => {
358
+					that.merchantsInStore.logo = res;
359
+				});
360
+			},
361
+			// 选择门店分类
362
+			// onSelectorClick(data) {
363
+			// 	this.showSelector = false;
364
+			// 	this.storeType = data;
365
+			// 	this.merchantsInStore.cate_id = data.merchant_category_id;
366
+			// },
367
+			changeStoretype(e){
368
+				this.storeTypeindex = e.detail.value;
369
+				this.merchantsInStore.cate_id = this.storeTypeData[this.storeTypeindex].merchant_category_id;
370
+			},
371
+			//选择省份
372
+			changeProvince(e) {
373
+				if(this.provinceList[0].name == '暂无数据'){
374
+					return false
375
+				}
376
+				this.provinceListindex = e.detail.value;
377
+				this.merchantsInStore.province_id = this.provinceList[this.provinceListindex].code;
378
+				addressList({id:2 , code:this.merchantsInStore.province_id}).then(res => {
379
+					if(res.data.status==200){
380
+						this.cityList = res.data.data.addressList;
381
+						
382
+						this.cityListindex = null;
383
+						this.areaList = [{name:'暂无数据'}];
384
+						this.areaListindex = null;
385
+						this.streetList = [{name:'暂无数据'}];
386
+						this.streetListindex = null;
387
+					}
388
+				}, fail => {
389
+					console.log(fail)
390
+				})
391
+				
392
+			},
393
+			// 选择城市
394
+			changeCity(e){
395
+				if(this.cityList[0].name == '暂无数据'){
396
+					return false
397
+				}
398
+				this.cityListindex = e.detail.value;
399
+				this.merchantsInStore.city_id = this.cityList[this.cityListindex].code;
400
+				addressList({id:3 , code:this.merchantsInStore.city_id}).then(res => {
401
+					if(res.data.status==200){
402
+						this.areaList = res.data.data.addressList;
403
+						
404
+						this.areaListindex = null;
405
+						this.streetList = [{name:'暂无数据'}];
406
+						this.streetListindex = null;
407
+					}
408
+				}, fail => {
409
+					console.log(fail)
410
+				})
411
+			},
412
+			// 选择区
413
+			changeArea(e){
414
+				if(this.areaList[0].name == '暂无数据'){
415
+					return false
416
+				}
417
+				this.areaListindex = Number(e.detail.value);
418
+				this.merchantsInStore.area_id = this.areaList[this.areaListindex].code;
419
+				addressList({id:4 , code:this.merchantsInStore.area_id}).then(res => {
420
+					if(res.data.status==200){
421
+						this.streetList = res.data.data.addressList;
422
+						
423
+						this.streetListindex = null;
424
+					}
425
+				}, fail => {
426
+					console.log(fail)
427
+				})
428
+			},
429
+			// 选择街道
430
+			changeStreet(e){
431
+				if(this.streetList[0].name == '暂无数据'){
432
+					return false
433
+				}
434
+				this.streetListindex = Number(e.detail.value);
435
+				this.merchantsInStore.street_id = this.streetList[this.streetListindex].code;
436
+			},
437
+			// 上一步
438
+			backStep(){
439
+				// uni.request({
440
+				// 	url: 'https://kfcs.bjtdba.com/sys/captcha',
441
+				// 	method: 'POST',
442
+				// 	header:{
443
+						
444
+				// 	},
445
+				// 	data: {
446
+						
447
+				// 	},
448
+				// 	success: (res) => {
449
+							
450
+				// 	}
451
+				// });
452
+				// return
453
+				uni.navigateBack({
454
+					delta:1
455
+				});
456
+			},
457
+			// 下一步
458
+			nextStep(){
459
+				if(this.merchantsInStore.logo == "" )return uni.showToast({ title: "请上传店铺LOGO", icon: "none" });
460
+				if(this.merchantsInStore.mer_short_name == "" ) return uni.showToast({ title: "请填写门店简称", icon: "none" });
461
+				if(this.merchantsInStore.mark == "" ) return uni.showToast({ title: "请填写门店简介", icon: "none" });
462
+				if(this.merchantsInStore.cate_id == "" ) return uni.showToast({ title: "请选择门店分类", icon: "none" });
463
+				if(this.merchantsInStore.province_id == 0 ) return uni.showToast({ title: "请选择省份", icon: "none" });
464
+				if(this.merchantsInStore.city_id == 0 ) return uni.showToast({ title: "请选择城市", icon: "none" });
465
+				if(this.merchantsInStore.area_id == 0 ) return uni.showToast({ title: "请选择街道", icon: "none" });
466
+				if(this.merchantsInStore.addr == "" ) return uni.showToast({ title: "请填写详细地址", icon: "none" });
467
+				
468
+				uni.setStorage({
469
+					key: 'merchants_in_store',
470
+					data: this.merchantsInStore
471
+				});
472
+				
473
+				// if(this.merchantsPass){
474
+				// 	this.merchantsInStore = Object.assign(this.merchantsInStore, this.nextMerchantsData)
475
+				// 	uni.navigateTo({
476
+				// 		url: `./processidentity?positionResult=${JSON.stringify(this.merchantsInStore)}`
477
+				// 	});
478
+				// }else{
479
+					uni.navigateTo({
480
+						url: './processidentity'
481
+					});
482
+				// }
483
+				
484
+			}
485
+		}
486
+	}
487
+</script>
488
+
489
+<style>
490
+	page {
491
+		background-color: #F7F8FC;
492
+	}
493
+</style>
494
+<style lang="scss" scoped>
495
+	.process {
496
+		width: 100%;
497
+		height: 100%;
498
+		display: flex;
499
+		flex-direction: column;
500
+		align-items: center;
501
+		justify-content: center;
502
+
503
+		.process-header {
504
+			position: fixed;
505
+			top: 0;
506
+			left: 0;
507
+			z-index: 111;
508
+			width: 100%;
509
+			height: 176rpx;
510
+			background: #FFFFFF;
511
+			display: flex;
512
+			justify-content: center;
513
+
514
+			.process-header-text {
515
+				width: 686rpx;
516
+				font-size: 36rpx;
517
+				font-weight: 500;
518
+				color: #333333;
519
+				display: flex;
520
+				margin-top: 107rpx;
521
+				align-items: center;
522
+
523
+				.process-header-text-neishi{
524
+					width: 45rpx;
525
+					height: 45rpx;
526
+					margin-right: 17rpx;
527
+					.process-header-text-icon {
528
+						width: 36rpx;
529
+						height: 36rpx;
530
+						margin-top: 2rpx;
531
+					
532
+						image {
533
+							width: 100%;
534
+							height: 100%;
535
+						}
536
+					}
537
+				}
538
+			}
539
+		}
540
+
541
+		.process-zhuti {
542
+			width: 100%;
543
+			height: auto;
544
+			margin-top: 202rpx;
545
+			display: flex;
546
+			flex-direction: column;
547
+			align-items: center;
548
+			// padding: 32rpx 0 40rpx;
549
+			padding-bottom: 40rpx;
550
+			background: #FFFFFF;
551
+
552
+			.process-zhuti-yi {
553
+				width: 686rpx;
554
+				// height: 150rpx;
555
+				display: flex;
556
+				flex-direction: column;
557
+				justify-content: space-between;
558
+				align-items: flex-start;
559
+				margin-top: 32rpx;
560
+
561
+				.process-zhuti-yi-text {
562
+					font-size: 30rpx;
563
+					font-weight: 500;
564
+					color: #333333;
565
+					margin-bottom: 26rpx;
566
+				}
567
+
568
+				.process-zhuti-yi-input {
569
+					width: 100%;
570
+					height: 94rpx;
571
+					// background: #1F7CFF;
572
+					// 31 124 255 10
573
+					border-radius: 8rpx;
574
+					// opacity: 0.1;
575
+					
576
+					input{
577
+						width: 100%;
578
+						height: 94rpx;
579
+						background: rgba(31, 124, 255, 0.1);
580
+						border-radius: 8rpx;
581
+						box-sizing: border-box;
582
+						padding-left: 32rpx;
583
+					}
584
+				}
585
+				
586
+				.process-zhuti-yi-upload{
587
+					width: 100%;
588
+					height: 404rpx;
589
+					background: rgba(31, 124, 255, 0.1);
590
+					border-radius: 8rpx;
591
+					display: flex;
592
+					justify-content: center;
593
+					align-items: center;
594
+					
595
+					image{
596
+						width: 500rpx;
597
+						height: 340rpx;
598
+					}
599
+				}
600
+				.process-zhuti-yi-picker{
601
+					height: 94rpx;
602
+					background: rgba(31, 124, 255, 0.1);
603
+					padding-left: 32rpx;
604
+					line-height: 94rpx;
605
+					border-radius: 8rpx;
606
+				}
607
+				.int-col{
608
+					color: #999999;
609
+				}
610
+			}
611
+		}
612
+		.process-zhuti-btnbox{
613
+			margin: 50rpx 0 94rpx;
614
+			color: #FFFFFF;
615
+			display: flex;
616
+			justify-content: space-between;
617
+		}
618
+		.process-zhuti-btn{
619
+			width: 330rpx;
620
+			height: 98rpx;
621
+			background: rgba(31, 124, 255, 0.4);
622
+			text-align: center;
623
+			line-height: 98rpx;
624
+			border-radius: 8rpx;
625
+		}
626
+		.backbtn{
627
+			margin-right: 26rpx;
628
+			background: #1F7CFF;
629
+		}
630
+		
631
+		.back-combox {
632
+			position: relative;
633
+			display: flex;
634
+			flex-direction: row;
635
+			align-items: center;
636
+			width: 100%;
637
+			height: 94rpx;
638
+			// background: rgba(31, 124, 255, 0.1);
639
+			border-radius: 8rpx;
640
+			box-sizing: border-box;
641
+		}
642
+		
643
+		.back-combox__input-box {
644
+			position: relative;
645
+			display: flex;
646
+			flex: 1;
647
+			flex-direction: row;
648
+			align-items: center;
649
+		}
650
+		
651
+		.back-combox__input {
652
+			flex: 1;
653
+			font-size: 30rpx;
654
+			height: 94rpx;
655
+			line-height: 94rpx;
656
+		}
657
+		
658
+		.back-combox__selector {
659
+			box-sizing: border-box;
660
+			position: absolute;
661
+			top: calc(100% + 24rpx);
662
+			left: 0;
663
+			width: 100%;
664
+			background-color: #FFFFFF;
665
+			border: 1px solid #EBEEF5;
666
+			border-radius: 12rpx;
667
+			box-shadow: 0 4rpx 24rpx 0 rgba(0, 0, 0, 0.1);
668
+			z-index: 1000;
669
+			padding: 8rpx 0;
670
+		}
671
+		
672
+		.back-combox__selector-scroll {
673
+			max-height: 400rpx;
674
+			box-sizing: border-box;
675
+		}
676
+		
677
+		.back-combox__selector-empty,
678
+		.back-combox__selector-item {
679
+			display: flex;
680
+			cursor: pointer;
681
+			line-height: 72rpx;
682
+			font-size: 28rpx;
683
+			text-align: center;
684
+			padding: 0px 20rpx;
685
+		}
686
+		
687
+		.back-combox__selector-item:hover {
688
+			background-color: #f9f9f9;
689
+		}
690
+		
691
+		.back-combox__selector-empty:last-child,
692
+		.back-combox__selector-item:last-child {
693
+			border-bottom: none;
694
+		}
695
+		
696
+		// picker 弹出层通用的指示小三角
697
+		.back-popper__arrow,
698
+		.back-popper__arrow::after {
699
+			position: absolute;
700
+			display: block;
701
+			width: 0;
702
+			height: 0;
703
+			border-color: transparent;
704
+			border-style: solid;
705
+			border-width: 12rpx;
706
+		}
707
+		
708
+		.back-popper__arrow {
709
+			filter: drop-shadow(0 4rpx 24rpx rgba(0, 0, 0, 0.03));
710
+			top: -12rpx;
711
+			left: 10%;
712
+			margin-right: 6rpx;
713
+			border-top-width: 0;
714
+			border-bottom-color: #EBEEF5;
715
+		}
716
+		
717
+		.back-popper__arrow::after {
718
+			content: " ";
719
+			top: 2rpx;
720
+			margin-left: -12rpx;
721
+			border-top-width: 0;
722
+			border-bottom-color: #fff;
723
+		}
724
+		
725
+		.back-combox__no-border {
726
+			border: none;
727
+		}
728
+		
729
+		.btn-bir{
730
+			background: #1F7CFF;
731
+		}
732
+	}
733
+</style>

File diff suppressed because it is too large
+ 13580 - 0
package-lock.json


+ 9 - 0
package.json

@@ -0,0 +1,9 @@
1
+{
2
+  "dependencies": {
3
+    "base-64": "^1.0.0",
4
+    "crypto-js": "^4.1.1",
5
+    "easemob-websdk": "^4.6.0",
6
+    "html2canvas": "^1.4.1",
7
+    "pinia": "^2.1.0"
8
+  }
9
+}

+ 274 - 0
pages.json

@@ -0,0 +1,274 @@
1
+{
2
+    "pages" : [
3
+        //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
4
+		{
5
+		    "path" : "pages/my/index",
6
+		    "style" : {
7
+		        // "navigationBarTitleText": "服务中心"
8
+		        "navigationStyle" : "custom"
9
+		    }
10
+		},
11
+        {
12
+            "path" : "pages/index/index",
13
+            "style" : {
14
+                "navigationBarTitleText" : "启动"
15
+            }
16
+        },
17
+        // "navigationBarBackgroundColor": "#FFFF"
18
+        {
19
+            "path" : "pages/index/bottombat",
20
+            "style" : {
21
+                "navigationBarTitleText" : ""
22
+            }
23
+        },
24
+        // "navigationBarBackgroundColor": "#FFFF"
25
+        {
26
+            "path" : "pages/cashier/index",
27
+            "style" : {
28
+                // "navigationBarTitleText": "收银台",
29
+                "navigationStyle" : "custom",
30
+                "enablePullDownRefresh" : true
31
+            }
32
+        },
33
+        {
34
+            "path" : "pages/storemanagement/index",
35
+            "style" : {
36
+                "navigationBarTitleText": ""
37
+            }
38
+        },
39
+        {
40
+            "path" : "pages/ordermanagement/index",
41
+            "style" : {
42
+                // "navigationBarTitleText": "订单管理"
43
+                "navigationStyle" : "custom"
44
+            }
45
+        }
46
+        
47
+    ],
48
+    "subPackages" : [
49
+        //用户登陆--分包
50
+        {
51
+            "root" : "pages/user",
52
+            "pages" : [
53
+                {
54
+                    "path" : "login/index",
55
+                    "style" : {
56
+                        "navigationBarTitleText" : "登录"
57
+                    }
58
+                }
59
+            ]
60
+        },
61
+        // "navigationBarBackgroundColor": "#FFFF"
62
+        //开通商户--分包
63
+        {
64
+            "root" : "openmerchant",
65
+            "pages" : [
66
+                {
67
+                    "path" : "guide/index", //指引开通
68
+                    "style" : {
69
+                        "navigationStyle" : "custom"
70
+                    }
71
+                },
72
+                {
73
+                    "path" : "amountopening/index", //电商支付
74
+                    "style" : {
75
+                        "navigationStyle" : "custom"
76
+                    }
77
+                },
78
+                {
79
+                    "path" : "shopentry/process", //店铺入驻流程
80
+                    "style" : {
81
+                        "navigationStyle" : "custom"
82
+                    }
83
+                },
84
+                {
85
+                    "path" : "shopentry/processstore", //店铺入驻流程-门店信息
86
+                    "style" : {
87
+                        "navigationStyle" : "custom"
88
+                    }
89
+                },
90
+                {
91
+                    "path" : "shopentry/processidentity", //店铺入驻流程-身份信息
92
+                    "style" : {
93
+                        "navigationStyle" : "custom"
94
+                    }
95
+                },
96
+                {
97
+                    "path" : "shopentry/processaudit", //店铺入驻流程-审核
98
+                    "style" : {
99
+                        "navigationStyle" : "custom"
100
+                    }
101
+                }
102
+            ]
103
+        },
104
+        //收银台--流程
105
+        {
106
+            "root" : "shop",
107
+            "pages" : [
108
+                {
109
+                    "path" : "perating/activitecode", //聚合码
110
+                    "style" : {
111
+                        "navigationStyle" : "custom"
112
+                    }
113
+                },
114
+                {
115
+                    "path" : "perating/statement", //经营报表
116
+                    "style" : {
117
+                        "navigationStyle" : "custom"
118
+                    }
119
+                },
120
+                {
121
+                    "path" : "perating/consumption", //开通消费分
122
+                    "style" : {
123
+                        "navigationStyle" : "custom"
124
+                    }
125
+                },
126
+                {
127
+                    "path" : "perating/consumptionbreakdown", //开通消费分
128
+                    "style" : {
129
+                        "navigationStyle" : "custom",
130
+                        "enablePullDownRefresh" : true
131
+                    }
132
+                },
133
+                {
134
+                    "path" : "department/management", //部门管理
135
+                    "style" : {
136
+                        "navigationStyle" : "custom"
137
+                    }
138
+                },
139
+                {
140
+                    "path" : "department/managementadd", //添加部门
141
+                    "style" : {
142
+                        "navigationStyle" : "custom"
143
+                    }
144
+                },
145
+                {
146
+                    "path" : "employee/list", //员工管理
147
+                    "style" : {
148
+                        "navigationStyle" : "custom"
149
+                    }
150
+                },
151
+                {
152
+                    "path" : "employee/listadd", //添加员工
153
+                    "style" : {
154
+                        "navigationStyle" : "custom"
155
+                    }
156
+                },
157
+                {
158
+                    "path" : "services/setting", //分润设置
159
+                    "style" : {
160
+                        "navigationStyle" : "custom"
161
+                    }
162
+                },
163
+                {
164
+                    "path" : "services/lockuser", //锁定用户
165
+                    "style" : {
166
+                        "navigationStyle" : "custom",
167
+                        "enablePullDownRefresh" : true
168
+                    }
169
+                },
170
+                {
171
+                    "path" : "services/mystereo", //得我音响
172
+                    "style" : {
173
+                        "navigationStyle" : "custom"
174
+                    }
175
+                },
176
+                {
177
+                    "path" : "commodity/order", //我的订单
178
+                    "style" : {
179
+                        "navigationStyle" : "custom",
180
+                        "enablePullDownRefresh" : true
181
+                    }
182
+                },
183
+                {
184
+                    "path" : "commodity/details", //订单详情
185
+                    "style" : {
186
+                        "navigationStyle" : "custom"
187
+                    }
188
+                }
189
+            ]
190
+        },
191
+		//会话
192
+		{
193
+		    "root" : "chat",
194
+		    "pages" : [
195
+		        {
196
+		            "path": "contacts/contacts",
197
+		            "style": {
198
+		              "navigationStyle": "custom",
199
+		              "navigationBarTextStyle": "white",
200
+		              "app-plus": {
201
+		                "bounce": "none"
202
+		              }
203
+		            }
204
+		        }
205
+		    ]
206
+		}
207
+		// {
208
+		//     "root" : "emChat",
209
+		//     "pages" : [
210
+		//        {
211
+		//          "path": "emChatContainer/index",
212
+		//          "style": {
213
+		//            "navigationStyle": "custom",
214
+		//            "navigationBarTextStyle": "white",
215
+		//            "app-plus": {
216
+		//              "bounce": "none"
217
+		//            }
218
+		//          }
219
+		//        }
220
+		//     ]
221
+		// },
222
+		// {
223
+		//     "root" : "chatIndex",
224
+		//     "pages" : [
225
+		//        {
226
+		// 		   "path" : "storemanagement/index",
227
+		// 		   "style" : {
228
+		// 			   "navigationStyle": "custom"
229
+		// 		   }
230
+		// 	   }
231
+		//     ]
232
+		// }
233
+		
234
+    ],
235
+    "globalStyle" : {
236
+        "navigationBarTextStyle" : "black",
237
+        "navigationBarTitleText" : "uni-app",
238
+        "navigationBarBackgroundColor" : "#F8F8F8",
239
+        "backgroundColor" : "#F8F8F8"
240
+    },
241
+    "navigateToMiniProgramAppIdList" : [ "wxfb755febdb800f23" ],
242
+    "tabBar" : {
243
+        "borderStyle" : "black",
244
+        "backgroundColor" : "#FFFFFF",
245
+        "color" : "#4D4D4D",
246
+        "selectedColor" : "#1F7CFF",
247
+        "list" : [
248
+            {
249
+                "pagePath" : "pages/cashier/index",
250
+                "iconPath" : "static/tab/tai1.png",
251
+                "selectedIconPath" : "static/tab/tai.png",
252
+                "text" : "收银台"
253
+            },
254
+            {
255
+                "pagePath" : "pages/storemanagement/index",
256
+                "iconPath" : "static/tab/dian.png",
257
+                "selectedIconPath" : "static/tab/dian1.png",
258
+                "text" : "消息"
259
+            },
260
+            {
261
+                "pagePath" : "pages/ordermanagement/index",
262
+                "iconPath" : "static/tab/daing.png",
263
+                "selectedIconPath" : "static/tab/ding1.png",
264
+                "text" : "订单管理"
265
+            },
266
+            {
267
+                "pagePath" : "pages/my/index",
268
+                "iconPath" : "static/tab/wo.png",
269
+                "selectedIconPath" : "static/tab/wo1.png",
270
+                "text" : "服务中心"
271
+            }
272
+        ]
273
+    }
274
+}

+ 742 - 0
pages/cashier/index.vue

@@ -0,0 +1,742 @@
1
+<template>
2
+	<view class="cashier">
3
+		<view class="cashier-topin" v-if="logintext">
4
+			<view class="tegyhsj">
5
+				收银台
6
+			</view>
7
+		</view>
8
+		<view class="cashier-header">
9
+			<view class="cashier-header-text" v-if="toptext">
10
+				收银台
11
+			</view>
12
+			<view class="cashier-tablin">
13
+				<view class="cashier-tablin-nie">
14
+					<view class="cashier-tablin-nie-left">
15
+						<view class="cashier-tablin-nie-left-icon">
16
+							<image :src="merchantCashierShow.logo" mode="widthFix">
17
+							</image>
18
+						</view>
19
+						<view class="cashier-tablin-nie-left-text">
20
+							<view class="cashier-tablin-nie-left-text-top">
21
+								{{merchantCashierShow.mer_name==undefined?'...':merchantCashierShow.mer_name}}
22
+							</view>
23
+							<view class="cashier-tablin-nie-left-text-bottom">
24
+								<view class="cashier-tablin-nie-left-text-bottom-in">
25
+									{{merchantCashierShow.category_name==undefined?'...':merchantCashierShow.category_name}}
26
+								</view>
27
+								<view class="cashier-tablin-nie-left-text-bottom-it">
28
+									加入日期:{{merchantCashierShow.create_time==undefined?'...':merchantCashierShow.create_time}}
29
+								</view>
30
+							</view>
31
+						</view>
32
+					</view>
33
+					<!-- <view class="cashier-tablin-nie-right" @click="activitecode(merchantCashierShow)" v-if="merchantCashierShow.merchant_level==1"> -->
34
+					<!-- <view class="cashier-tablin-nie-right" @click="activitecode(merchantCashierShow)">
35
+						<image :src="merchantCashierShow.qrcode_src" mode="widthFix">
36
+						</image>
37
+					</view> -->
38
+				</view>
39
+			</view>
40
+		</view>
41
+		<view class="cashier-list"  v-if="Number(zhuangi)!=7?false:true">
42
+			<view class="cashier-list-top">
43
+				<view class="cashier-list-top-left">
44
+					<view class="yi" v-for="(item,index) in items" @click="dianji(index)"
45
+						 :style="index==indexs?'font-weight: 600;':'font-weight: 300;'">
46
+						{{item.name}}
47
+						<view class="cashier-list-top-left-yisss" v-if="index==indexs?true:false">
48
+						</view>
49
+					</view>
50
+
51
+				</view>
52
+				<view class="cashier-list-top-right" @click="peratingt">
53
+					<view class="cashier-list-top-right-text">
54
+						经营报表
55
+					</view>
56
+					<view class="cashier-list-top-right-icon">
57
+						<image src="https://cdn.bjtdba.com/vod/image/2022-08-11/20220811110111315.png" mode="widthFix">
58
+						</image>
59
+					</view>
60
+				</view>
61
+			</view>
62
+			<view class="cashier-list-tbot">
63
+				<view class="yis">
64
+					<view class="sgjd">
65
+						¥{{dataList.orderLineOrderSun.orderLine==undefined?0:dataList.orderLineOrderSun.orderLine}}
66
+					</view>
67
+					<view class="sf">
68
+						线上营收
69
+					</view>
70
+				</view>
71
+				<view class="yis">
72
+					<view class="sgjd">
73
+						¥{{dataList.belowTheLineSum.belowTheLine==undefined?0:dataList.belowTheLineSum.belowTheLine}}
74
+					</view>
75
+					<view class="sf">
76
+						线下营收
77
+					</view>
78
+				</view>
79
+				<!-- <view class="yis" @click="xiaofeifen">
80
+					<view class="sgjd">
81
+						¥{{dataList.consumption==null?0:dataList.consumption}}
82
+					</view>
83
+					<view class="sf">
84
+						消费分
85
+					</view>
86
+				</view> -->
87
+				<view class="yis">
88
+					<view class="sgjd">
89
+						{{dataList.sun==undefined?0:dataList.sun}}
90
+					</view>
91
+					<view class="sf">
92
+						锁定会员数
93
+					</view>
94
+				</view>
95
+				<view class="yis">
96
+					<view class="sgjd">
97
+						{{dataList.visitorNumber==undefined?0:dataList.visitorNumber}}
98
+					</view>
99
+					<view class="sf">
100
+						访客数
101
+					</view>
102
+				</view>
103
+				<view class="yis">
104
+					<view class="sgjd">
105
+						{{dataList.number==undefined?0:dataList.number}}
106
+					</view>
107
+					<view class="sf">
108
+						支付人数
109
+					</view>
110
+				</view>
111
+				<!-- 默认 -->
112
+				<view class="yis">
113
+					<view class="sgjd">
114
+						
115
+					</view>
116
+					<view class="sf">
117
+						
118
+					</view>
119
+				</view>
120
+			</view>
121
+		</view>
122
+		<view class="cashier-jilu" :style="Number(zhuangi)!=7?'margin-top:170rpx':''">
123
+			<view class="cashier-jilu-top">
124
+				最新记录
125
+			</view>
126
+			<view class="cashier-jilu-nei">
127
+				<view class="cashier-jilu-nei-yis" v-for="(item,index) in List" :key="index">
128
+					<view class="cashier-jilu-nei-yis-left">
129
+						<view class="cashier-jilu-nei-yis-left-mei">
130
+							<image :src="item.avatar" mode="widthFix"></image>
131
+						</view>
132
+						<view class="cashier-jilu-nei-yis-left-yins">
133
+							<view class="tetxsad">
134
+								{{item.nickname}}
135
+							</view>
136
+							<view class="sdffget">
137
+								ID:{{item.account.substr(0, 3) + '****' + item.account.substr(7)}}
138
+							</view>
139
+						</view>
140
+					</view>
141
+					<view class="cashier-jilu-nei-yis-right">
142
+						{{item.type}}
143
+					</view>
144
+				</view>
145
+			</view>
146
+		</view>
147
+		<view class="" v-if="tihsi==0" style="margin: 60rpx 0 20rpx 0; color: #999999; font-size: 26rpx;">
148
+			—— 已经到最底部了哦 ——
149
+		</view>
150
+	</view>
151
+</template>
152
+
153
+<script>
154
+	import {
155
+		selectMerchant,
156
+		selectMerchantOrder,
157
+		payUserList
158
+	} from '@/commit/shop.js'
159
+	export default {
160
+		data() {
161
+			return {
162
+				is_panudn: true,
163
+				start_time: "",
164
+				end_time: "",
165
+				mer_id: "", //店铺ID
166
+				logintext: false,
167
+				toptext: true,
168
+				indexs: 0,
169
+				merchantCashierShow: [], // 店铺信息头
170
+				dataList: [], //今日昨日收益
171
+				page: 1,//默认1页
172
+				limit: 10,//默认10条数据
173
+				items: [{
174
+						name: "今日"
175
+					},
176
+					{
177
+						name: "昨日"
178
+					}
179
+				],
180
+				List: [],//列表数据
181
+				tihsi: "",
182
+				zhuangi:""
183
+			}
184
+		},
185
+		onLoad() {
186
+			let daySart = new Date
187
+			this.start_time = this.$time.dateFormat("yyyy-MM-dd", daySart)
188
+			this.end_time = this.$time.dateFormat("yyyy-MM-dd", daySart)
189
+			let selectmerchant = uni.getStorageSync('selectmerchant')
190
+			this.mer_id = selectmerchant.merId
191
+			let jurisdiction = uni.getStorageSync('jurisdiction')
192
+			
193
+			if(jurisdiction!=null){
194
+			jurisdiction.forEach((res,index)=>{
195
+				if(res==7){
196
+					this.zhuangi = res
197
+				}
198
+			})
199
+			}
200
+		},
201
+		onShow() {
202
+			let authorization = uni.getStorageSync('authorization')
203
+			let userinfo = uni.getStorageSync('userinfo')
204
+			let selectmerchant = uni.getStorageSync('selectmerchant')
205
+			let uid = userinfo.uid
206
+			if (authorization && uid) {
207
+				if (selectmerchant.merId >= 0 && selectmerchant.status == -1) {
208
+					uni.redirectTo({
209
+						url: "/openmerchant/guide/index" //有或者没有商户 没有金额支付and激活码支付
210
+					});
211
+					return
212
+				} else if (selectmerchant.merId > 0 && (selectmerchant.status == 1 || selectmerchant.status == 5)) {
213
+					uni.showLoading({
214
+						title: '加载中',
215
+						mask: true
216
+					});
217
+					this.selectMerchant()
218
+					this.selectMerchantOrder()
219
+					this.payUserList()
220
+					return
221
+				} else if (selectmerchant.merId >= 0 && (selectmerchant.status == 3 || selectmerchant.status == 4)) {
222
+					uni.redirectTo({
223
+						url: '/openmerchant/shopentry/process?mer_id=' + selectmerchant.merId //已开通商户未填写资料
224
+					});
225
+					return
226
+				} else if (selectmerchant.merId > 0 && selectmerchant.status == 0) {
227
+					uni.redirectTo({
228
+						url: '/openmerchant/shopentry/processaudit?submitCode=' + 3 //已开通商户待审核
229
+					});
230
+					return
231
+				} else if (selectmerchant.merId > 0 && selectmerchant.status == 2) {
232
+					uni.redirectTo({
233
+						url: '/openmerchant/shopentry/processaudit?submitCode=' + 2 //已开通商户审核拒绝
234
+					});
235
+					return
236
+				}
237
+
238
+			} else {
239
+				uni.redirectTo({
240
+					url: "/pages/user/login/index"
241
+				});
242
+			}
243
+		},
244
+		//监听tab 分类
245
+		onPageScroll(res) {
246
+			const query = uni.createSelectorQuery().in(this);
247
+			query.select('.cashier-header').boundingClientRect(data => {
248
+				if (data.top < 0) {
249
+					this.toptext = false
250
+					this.logintext = true
251
+				} else if (data.top <= 1) {
252
+					this.toptext = true
253
+					this.logintext = false
254
+				}
255
+			}).exec();
256
+		},
257
+		onPullDownRefresh() {
258
+			uni.showLoading({
259
+				title: '加载中',
260
+			});
261
+			this.page = 1
262
+			this.is_panudn = true
263
+			this.List = []
264
+			this.payUserList();
265
+			this.selectMerchant();
266
+			this.selectMerchantOrder()
267
+		},
268
+
269
+		onReachBottom() {
270
+			if (this.is_panudn == true) {
271
+				this.page++;
272
+				this.payUserList();
273
+			} else {
274
+				return
275
+			}
276
+		},
277
+		methods: {
278
+			// 店铺信息头
279
+			selectMerchant() {
280
+				selectMerchant({
281
+					mer_id: this.mer_id
282
+				}).then(res => {
283
+					console.log(res)
284
+					if (res.data.status == 200) {
285
+						this.merchantCashierShow = res.data.data.merchantCashierShow
286
+					}
287
+				}, fail => {
288
+					console.log(fail)
289
+				})
290
+			},
291
+			activitecode(e) {
292
+				uni.navigateTo({
293
+					url: "/shop/perating/activitecode?qrcode_src=" + e.qrcode_src + '&code_id=' + e.code_id
294
+				})
295
+			},
296
+			peratingt() {
297
+				uni.navigateTo({
298
+					url: "/shop/perating/statement?sna=" + "1"
299
+				})
300
+			},
301
+			xiaofeifen() {
302
+				uni.navigateTo({
303
+					url: "/shop/perating/consumption"
304
+				})
305
+			},
306
+			// 今日昨日收益
307
+			selectMerchantOrder() {
308
+				uni.showLoading({
309
+					title: '加载中',
310
+				});
311
+				selectMerchantOrder({
312
+					start_time: this.start_time,
313
+					end_time: this.start_time,
314
+					mer_id: this.mer_id
315
+				}).then(res => {
316
+					if (res.data.status == 200) {
317
+						this.dataList = res.data.data
318
+						uni.hideLoading();
319
+					}
320
+				}, fail => {
321
+					console.log(fail)
322
+					uni.hideLoading();
323
+				})
324
+			},
325
+			//点击今日昨日收益
326
+			dianji(e) {
327
+				this.indexs = e
328
+				let daySart = new Date
329
+				if (e == 0) {
330
+					this.start_time = this.$time.dateFormat("yyyy-MM-dd", daySart)
331
+					this.end_time = this.$time.dateFormat("yyyy-MM-dd", daySart)
332
+					this.selectMerchantOrder()
333
+				} else {
334
+					var date = new Date();
335
+					var y = date.getFullYear();
336
+					var m = date.getMonth() + 1;
337
+					var d = date.getDate() - 1;
338
+					if (d == "0") {
339
+						m = m - 1;
340
+						var temp = new Date(y, m, d);
341
+						d = temp.getDate();
342
+					}
343
+					var Yesterday = [y, m, d];
344
+					Yesterday = Yesterday.join("/");
345
+					this.start_time = this.$time.dateFormat("yyyy-MM-dd", Yesterday)
346
+					this.end_time = this.$time.dateFormat("yyyy-MM-dd", Yesterday)
347
+					this.selectMerchantOrder()
348
+				}
349
+			},
350
+			// 最新纪录列表
351
+			payUserList() {
352
+				payUserList({
353
+					mer_id: this.mer_id,
354
+					pageNum: this.page,
355
+					pageSize: this.limit,
356
+				}).then(res => {
357
+					uni.stopPullDownRefresh();
358
+					if (res.data.status == 200) {
359
+						this.tihsi = res.data.data.pageInfo.list.length
360
+						if (res.data.data.pageInfo.list.length > 0) { //分页处理
361
+							if (this.page == 1) {
362
+								this.List = res.data.data.pageInfo.list
363
+							} else {
364
+								this.List = this.List.concat(res.data.data.pageInfo.list)
365
+							}
366
+						} else {
367
+							this.is_panudn = false
368
+						}
369
+						uni.hideLoading();
370
+					}
371
+				}, fail => {
372
+					uni.hideLoading()
373
+					console.log(fail)
374
+				})
375
+			},
376
+		}
377
+	}
378
+</script>
379
+<style>
380
+	page {
381
+		background-color: #F7F8FC;
382
+	}
383
+</style>
384
+
385
+<style lang="scss" scoped>
386
+	.cashier-topin {
387
+		width: 100%;
388
+		height: 176rpx;
389
+		background-color: #FFFFFF;
390
+		position: fixed;
391
+		top: 0;
392
+		left: 0;
393
+		z-index: 9;
394
+		font-size: 36rpx;
395
+		font-family: PingFangSC-Medium, PingFang SC;
396
+		font-weight: 500;
397
+		color: #333333;
398
+		text-align: center;
399
+
400
+		.tegyhsj {
401
+			margin-top: 107rpx;
402
+		}
403
+	}
404
+
405
+	.cashier {
406
+		width: 100%;
407
+		height: 100%;
408
+		display: flex;
409
+		flex-direction: column;
410
+		align-items: center;
411
+
412
+		.cashier-header {
413
+			width: 100%;
414
+			height: 328rpx;
415
+			background: linear-gradient(180deg, rgba(31, 124, 255, 0.2200) 0%, rgba(255, 255, 255, 0.1500) 100%);
416
+			position: relative;
417
+			display: flex;
418
+			justify-content: center;
419
+
420
+			.cashier-header-text {
421
+				position: absolute;
422
+				font-size: 46rpx;
423
+				font-weight: 500;
424
+				color: #333333;
425
+				top: 102rpx;
426
+				left: 64rpx;
427
+			}
428
+
429
+			.cashier-tablin {
430
+				position: absolute;
431
+				top: 198rpx;
432
+				width: 686rpx;
433
+				height: 210rpx;
434
+				background: #FFFFFF;
435
+				border-radius: 16rpx;
436
+				display: flex;
437
+				justify-content: center;
438
+				align-items: center;
439
+
440
+				.cashier-tablin-nie {
441
+					width: 634rpx;
442
+					height: 146rpx;
443
+					display: flex;
444
+					justify-content: space-between;
445
+					align-items: center;
446
+
447
+					.cashier-tablin-nie-left {
448
+						width: 409rpx;
449
+						height: 100%;
450
+						display: flex;
451
+						justify-content: space-between;
452
+						align-items: center;
453
+
454
+						.cashier-tablin-nie-left-icon {
455
+							width: 146rpx;
456
+							height: 146rpx;
457
+							border-radius: 20rpx;
458
+							overflow: hidden;
459
+
460
+							image {
461
+								width: 100%;
462
+								height: 100%;
463
+								height: auto;
464
+								border-radius: 20rpx;
465
+							}
466
+						}
467
+
468
+						.cashier-tablin-nie-left-text {
469
+							width: 247rpx;
470
+							height: 100%;
471
+							display: flex;
472
+							flex-direction: column;
473
+							justify-content: space-between;
474
+							align-items: flex-start;
475
+
476
+							.cashier-tablin-nie-left-text-top {
477
+								width: 100%;
478
+								font-size: 36rpx;
479
+								font-weight: 500;
480
+								color: #333333;
481
+								display: inline-block;
482
+								overflow: hidden;
483
+								text-overflow: ellipsis;
484
+								white-space: nowrap;
485
+							}
486
+
487
+							.cashier-tablin-nie-left-text-bottom {
488
+								width: 100%;
489
+								height: 69rpx;
490
+								display: flex;
491
+								flex-direction: column;
492
+								align-items: flex-start;
493
+								justify-content: space-between;
494
+								color: #333333;
495
+								font-size: 24rpx;
496
+
497
+								.cashier-tablin-nie-left-text-bottom-in {
498
+									width: 100%;
499
+									display: inline-block;
500
+									overflow: hidden;
501
+									text-overflow: ellipsis;
502
+									white-space: nowrap;
503
+								}
504
+
505
+								.cashier-tablin-nie-left-text-bottom-it {
506
+									width: 100%;
507
+									display: inline-block;
508
+									overflow: hidden;
509
+									text-overflow: ellipsis;
510
+									white-space: nowrap;
511
+								}
512
+							}
513
+						}
514
+					}
515
+
516
+					.cashier-tablin-nie-right {
517
+						width: 146rpx;
518
+						height: 100%;
519
+
520
+						image {
521
+							width: 100%;
522
+							height: 100%;
523
+						}
524
+					}
525
+				}
526
+			}
527
+		}
528
+
529
+		.cashier-list {
530
+			width: 686rpx;
531
+			height: 365rpx;
532
+			background-color: #FFFFFF;
533
+			margin-top: 206rpx;
534
+			border-radius: 16rpx;
535
+			display: flex;
536
+			flex-direction: column;
537
+			justify-content: space-around;
538
+			align-items: center;
539
+
540
+			.cashier-list-top {
541
+				width: 634rpx;
542
+				height: 30rpx;
543
+				margin-top: 10rpx;
544
+				display: flex;
545
+				justify-content: space-between;
546
+
547
+				.cashier-list-top-left {
548
+					font-size: 30rpx;
549
+					width: 150rpx;
550
+					height: 100%;
551
+					display: flex;
552
+					align-items: center;
553
+					justify-content: space-between;
554
+
555
+					.yi {
556
+						position: relative;
557
+
558
+						.cashier-list-top-left-yisss {
559
+							position: absolute;
560
+							top: 39rpx;
561
+							width: 100%;
562
+							height: 6rpx;
563
+							background: #1F7CFF;
564
+							border-radius: 3rpx;
565
+						}
566
+					}
567
+
568
+				}
569
+
570
+				.cashier-list-top-right {
571
+					width: 124rpx;
572
+					height: 100%;
573
+					display: flex;
574
+					justify-content: space-between;
575
+					font-size: 24rpx;
576
+					font-weight: 400;
577
+					color: #999999;
578
+
579
+					.cashier-list-top-right-icon {
580
+						width: 16rpx;
581
+						height: 16rpx;
582
+
583
+						image {
584
+							width: 100%;
585
+							height: 100%;
586
+						}
587
+					}
588
+				}
589
+			}
590
+
591
+			.cashier-list-tbot {
592
+				width: 570rpx;
593
+				height: 250rpx;
594
+				display: flex;
595
+				align-content: space-between;
596
+				flex-wrap: wrap;
597
+				justify-content: space-between;
598
+				
599
+				.yis {
600
+					width: 33%;
601
+					height: 82rpx;
602
+					display: flex;
603
+					flex-direction: column;
604
+					justify-content: space-between;
605
+					align-items: center;
606
+					color: #333333;
607
+
608
+					.sgjd {
609
+						font-size: 36rpx;
610
+						font-weight: bold;
611
+					}
612
+
613
+					.sf {
614
+						font-size: 26rpx;
615
+						font-weight: 400;
616
+					}
617
+				}
618
+
619
+				// .cashier-list-tbot-sjd {
620
+				// 	width: 100%;
621
+				// 	height: 88rpx;
622
+				// 	display: flex;
623
+				// 	justify-content: space-between;
624
+				// 	align-items: center;
625
+					// .yis {
626
+					// 	height: 100%;
627
+					// 	display: flex;
628
+					// 	flex-direction: column;
629
+					// 	justify-content: space-between;
630
+					// 	align-items: center;
631
+					// 	color: #333333;
632
+
633
+					// 	.sgjd {
634
+					// 		font-size: 36rpx;
635
+					// 		font-weight: bold;
636
+					// 	}
637
+
638
+					// 	.sf {
639
+					// 		font-size: 26rpx;
640
+					// 		font-weight: 400;
641
+					// 	}
642
+					// }
643
+				// }
644
+			}
645
+		}
646
+
647
+		.cashier-jilu {
648
+			width: 686rpx;
649
+			height: 100%;
650
+			background: #FFFFFF;
651
+			border-radius: 16rpx;
652
+			margin: 26rpx 0 26rpx 0;
653
+			display: flex;
654
+			flex-direction: column;
655
+			align-items: center;
656
+
657
+			.cashier-jilu-top {
658
+				width: 634rpx;
659
+				margin-top: 49rpx;
660
+				display: flex;
661
+				justify-content: flex-start;
662
+				font-size: 30rpx;
663
+				font-weight: 600;
664
+				align-items: center;
665
+				color: #333333;
666
+			}
667
+
668
+			.cashier-jilu-nei {
669
+				width: 634rpx;
670
+				margin-top: 32rpx;
671
+				display: flex;
672
+				flex-direction: column;
673
+				align-items: center;
674
+
675
+				.cashier-jilu-nei-yis {
676
+					width: 100%;
677
+					height: 86rpx;
678
+					display: flex;
679
+					justify-content: space-between;
680
+					align-items: center;
681
+					margin-bottom: 65rpx;
682
+
683
+					.cashier-jilu-nei-yis-left {
684
+						width: 289rpx;
685
+						height: 100%;
686
+						display: flex;
687
+
688
+						.cashier-jilu-nei-yis-left-mei {
689
+							width: 86rpx;
690
+							height: 86rpx;
691
+							border-radius: 100%;
692
+							overflow: hidden;
693
+
694
+							image {
695
+								width: 100%;
696
+								height: 100%;
697
+								border-radius: 100%;
698
+								overflow: hidden;
699
+							}
700
+						}
701
+
702
+						.cashier-jilu-nei-yis-left-yins {
703
+							width: 187rpx;
704
+							height: 86rpx;
705
+							margin-left: 16rpx;
706
+							display: flex;
707
+							flex-direction: column;
708
+							justify-content: space-around;
709
+							align-items: flex-start;
710
+
711
+							.tetxsad {
712
+								display: inline-block;
713
+								width: 100%;
714
+								overflow: hidden;
715
+								text-overflow: ellipsis;
716
+								white-space: nowrap;
717
+								font-size: 30rpx;
718
+								font-weight: 500;
719
+								color: #333333;
720
+
721
+							}
722
+
723
+							.sdffget {
724
+								font-size: 26rpx;
725
+								font-weight: normal;
726
+								color: #999999;
727
+							}
728
+						}
729
+					}
730
+
731
+					.cashier-jilu-nei-yis-right {
732
+						height: 100%;
733
+						font-size: 30rpx;
734
+						font-weight: normal;
735
+						color: #333333;
736
+						line-height: 86rpx;
737
+					}
738
+				}
739
+			}
740
+		}
741
+	}
742
+</style>

+ 102 - 0
pages/index/bottombat.vue

@@ -0,0 +1,102 @@
1
+<template>
2
+	<view class="cashier">
3
+
4
+		<web-view :webview-styles="webviewStyles" :src="url"></web-view>
5
+
6
+	</view>
7
+</template>
8
+
9
+<script>
10
+	export default {
11
+		data() {
12
+			return {
13
+				url:""
14
+			}
15
+		},
16
+		onLoad(options) {
17
+			
18
+			let type = uni.getStorageSync('agreementType')
19
+			this.url= 'https://api.hebeiyhc.com/api/agreement?type=' + type
20
+			
21
+			console.log('url = ',this.url)
22
+		},
23
+		methods: {
24
+
25
+		}
26
+	}
27
+</script>
28
+<style>
29
+	page {
30
+		background-color: #F7F8FC;
31
+	}
32
+</style>
33
+
34
+<style lang="scss" scoped>
35
+	.activite {
36
+		color: #1F7CFF;
37
+	}
38
+
39
+	.content {
40
+		width: 686rpx;
41
+		background-color: #1F7CFF;
42
+		color: red;
43
+	}
44
+
45
+	.scroll-view_H {
46
+		white-space: nowrap;
47
+		width: 100%;
48
+		color: #333333;
49
+	}
50
+
51
+	.scroll-view-item_H {
52
+		display: inline-block;
53
+		width: 20%;
54
+		height: 30rpx;
55
+		line-height: 30rpx;
56
+		text-align: center;
57
+		padding: 28rpx 0 38rpx 0;
58
+		font-size: 32rpx;
59
+	}
60
+
61
+	.cashier {
62
+		width: 100%;
63
+		height: 100%;
64
+		display: flex;
65
+		flex-direction: column;
66
+		align-items: center;
67
+
68
+		.cashier-bottom {
69
+			width: 100%;
70
+			height: 171rpx;
71
+			position: fixed;
72
+			bottom: 0;
73
+			display: flex;
74
+			justify-content: space-around;
75
+			align-items: flex-start;
76
+			background-color: #FFFFFF;
77
+
78
+			.cashier-bottom-yi {
79
+				height: 70rpx;
80
+				display: flex;
81
+				flex-direction: column;
82
+				justify-content: space-between;
83
+				align-items: center;
84
+
85
+				.cashier-bottom-yi-top {
86
+					width: 40rpx;
87
+					height: 40rpx;
88
+
89
+					image {
90
+						width: 100%;
91
+						height: 100%;
92
+					}
93
+				}
94
+
95
+				.cashier-bottom-yi-bot {
96
+					font-size: 20rpx;
97
+					font-weight: 400;
98
+				}
99
+			}
100
+		}
101
+	}
102
+</style>

+ 142 - 0
pages/index/index.vue

@@ -0,0 +1,142 @@
1
+<template>
2
+	<view class="contentindex">
3
+		<view class="box-header">
4
+			<view class="images">
5
+				<image src="https://cdn.bjtdba.com/vod/image/2022-08-09/20220809134301741.gif" mode="widthFix"></image>
6
+			</view>
7
+			<view class="texts">
8
+				正在加载…
9
+			</view>
10
+		</view>
11
+	</view>
12
+</template>
13
+
14
+
15
+<script>
16
+	import {
17
+		selectMerchant
18
+	} from '@/commit/api.js'
19
+	import {
20
+		encryptDes,
21
+		decryptDes
22
+	} from '@/encryption/index.js' // 引用路径根据自己的文件结构而定
23
+	import
24
+	Base64
25
+	from 'base-64'
26
+	export default {
27
+		data() {
28
+			return {
29
+
30
+			}
31
+		},
32
+		onLoad() {
33
+			
34
+			console.log('进来了')
35
+			
36
+			let authorization = uni.getStorageSync('authorization')
37
+			let userinfo = uni.getStorageSync('userinfo')
38
+			let uid = userinfo.uid
39
+			// 用户状态判断
40
+			if (authorization) {
41
+				selectMerchant({
42
+					uid: uid
43
+				}).then(data => {
44
+					if (data.data.status == 200) {
45
+						let selectmerchant = data.data.data
46
+						uni.setStorageSync('selectmerchant', selectmerchant)
47
+						if (authorization && uid) {
48
+							if (selectmerchant.merId >= 0 && selectmerchant.status == -1) {
49
+								uni.redirectTo({
50
+									url: "/openmerchant/guide/index" //有或者没有商户 没有金额支付and激活码支付
51
+								});
52
+								return
53
+							} else if (selectmerchant.merId > 0 && (selectmerchant.status == 1 || selectmerchant.status == 5)) {
54
+								uni.switchTab({
55
+									url: '/pages/cashier/index' //已开通商户
56
+								});
57
+								return
58
+							} else if (selectmerchant.merId >= 0 && (selectmerchant.status == 3 || selectmerchant.status == 4)) {
59
+								uni.redirectTo({
60
+									url: '/openmerchant/shopentry/process?mer_id=' + selectmerchant.merId //已开通商户未填写资料
61
+								});
62
+								return
63
+							} else if (selectmerchant.merId > 0 && selectmerchant.status == 0) {
64
+								uni.redirectTo({
65
+									url: '/openmerchant/shopentry/processaudit?submitCode=' + 3 //已开通商户待审核
66
+								});
67
+								return
68
+							} else if (selectmerchant.merId > 0 && selectmerchant.status == 2) {
69
+								uni.redirectTo({
70
+									url: '/openmerchant/shopentry/processaudit?submitCode=' + 2 //已开通商户审核拒绝
71
+								});
72
+								return
73
+							}
74
+
75
+						} else {
76
+							uni.redirectTo({
77
+								url: "/pages/user/login/index"
78
+							});
79
+						}
80
+					}
81
+				}, fail => {
82
+					uni.showToast({
83
+						title: fail,
84
+						icon: "none"
85
+					})
86
+				}).catch(err => {
87
+					console.log(err)
88
+				})
89
+			} else {
90
+				uni.redirectTo({
91
+					url: "/pages/user/login/index"
92
+				});
93
+			}
94
+		},
95
+		methods: {}
96
+	}
97
+</script>
98
+
99
+<style lang="scss" scoped>
100
+	.contentindex {
101
+		width: 100%;
102
+		height: 100%;
103
+		background: transparent;
104
+		position: fixed;
105
+		margin: auto;
106
+		left: 0;
107
+		right: 0;
108
+		top: 0;
109
+		bottom: 0;
110
+		display: flex;
111
+		justify-content: center;
112
+		align-items: center;
113
+
114
+		.box-header {
115
+			text-align: center;
116
+			line-height: 100rpx;
117
+			display: flex;
118
+			flex-direction: column;
119
+			justify-content: space-between;
120
+			align-items: center;
121
+
122
+			.images {
123
+				width: 128rpx;
124
+				height: 128rpx;
125
+
126
+				image {
127
+					width: 100%;
128
+					height: 100%;
129
+				}
130
+			}
131
+
132
+			.texts {
133
+				width: 150rpx;
134
+				height: 42rpx;
135
+				font-size: 30rpx;
136
+				line-height: 42rpx;
137
+				color: #333333;
138
+				margin-top: 61rpx;
139
+			}
140
+		}
141
+	}
142
+</style>

+ 338 - 0
pages/my/index.vue

@@ -0,0 +1,338 @@
1
+<template>
2
+	<view class="storemanagement">
3
+		<view class="storemanagement-header">
4
+			<view class="storemanagement-header-text">
5
+				服务中心
6
+			</view>
7
+			<view class="storemanagement-list">
8
+				<view class="storemanagement-list-yi" v-for="(item,index) in mnu" :key="index" @click="jinru(item.pages,item.name)" v-if="item.show">
9
+					<view class="storemanagement-list-yi-text">
10
+						{{item.name}}
11
+					</view>
12
+					<view class="storemanagement-list-yi-image">
13
+						<image :src="item.url" mode="widthFix"></image>
14
+					</view>
15
+				</view>
16
+			</view>
17
+			<view class="listadd-annkiu" @click="logoutAction" v-if="uid">
18
+				退出登录
19
+			</view>
20
+		</view>
21
+	</view>
22
+</template>
23
+
24
+<script>
25
+	import { emConnect } from '@/EaseIM/emApis';
26
+	import readAppInfo from '@/utils/readAppInfo.js';
27
+	const { loginWithPassword,closeEaseIM } = emConnect();
28
+	export default {
29
+		data() {
30
+			return {
31
+				mnu: [{
32
+						name: "分润设置",
33
+						url: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812161807687.png",
34
+						pages:"/shop/services/setting",
35
+						show:true,
36
+						id: "3",
37
+					},
38
+					{
39
+						name: "我的音响",
40
+						url: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812161749139.png",
41
+						pages:"/shop/services/mystereo",
42
+						show:true,
43
+						id: "0",
44
+					},
45
+					{
46
+						name: "锁定用户",
47
+						url: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812161733260.png",
48
+						pages:"/shop/services/lockuser",
49
+						show:true,
50
+						id: "0",
51
+					}
52
+				],
53
+				uid: '',
54
+				authorization: ''
55
+			}
56
+		},
57
+		async onLoad() {
58
+			console.log('进了我的页面了')
59
+			// uni.showLoading({
60
+			// 	title: '加载中',
61
+			// 	mask: true
62
+			// });
63
+			
64
+			await readAppInfo();
65
+			
66
+			let jurisdiction = uni.getStorageSync('jurisdiction')
67
+			console.log('jurisdiction', jurisdiction)
68
+			let mnuList = this.mnu
69
+			if (jurisdiction!=null) {
70
+				jurisdiction.forEach((res, index) => {
71
+					mnuList.forEach((result, i) => {
72
+						if (res == result.id) {
73
+							result.show = true
74
+						}
75
+						return result
76
+					})
77
+					return res
78
+				})
79
+				this.mnu = mnuList
80
+			}
81
+			
82
+			console.log(this.mnu)
83
+			
84
+			setTimeout(function() {
85
+				uni.hideLoading();
86
+			}, 700);
87
+			
88
+			
89
+			console.log('我的show===>>>>>>')
90
+				
91
+			
92
+			this.authorization = uni.getStorageSync('authorization')
93
+			let userinfo = uni.getStorageSync('userinfo')
94
+			this.uid = userinfo.uid
95
+			console.log('onshow')
96
+			
97
+			let authorization = uni.getStorageSync('authorization')
98
+			// let userinfo = uni.getStorageSync('userinfo')
99
+			let selectmerchant = uni.getStorageSync('selectmerchant')
100
+			let uid = userinfo.uid
101
+			console.log(selectmerchant, authorization, userinfo)
102
+			if (authorization && uid) {
103
+				if (selectmerchant.merId >= 0 && selectmerchant.status == -1) {
104
+					uni.redirectTo({
105
+						url: "/openmerchant/guide/index" //有或者没有商户 没有金额支付and激活码支付
106
+					});
107
+					return
108
+				} else if (selectmerchant.merId > 0 && (selectmerchant.status == 1 || selectmerchant.status == 5)) {
109
+					
110
+					return
111
+				} else if (selectmerchant.merId >= 0 && (selectmerchant.status == 3 || selectmerchant.status == 4)) {
112
+					uni.redirectTo({
113
+						url: '/openmerchant/shopentry/process?mer_id=' + selectmerchant.merId //已开通商户未填写资料
114
+					});
115
+					return
116
+				} else if (selectmerchant.merId > 0 && selectmerchant.status == 0) {
117
+					uni.redirectTo({
118
+						url: '/openmerchant/shopentry/processaudit?submitCode=' + 3 //已开通商户待审核
119
+					});
120
+					return
121
+				} else if (selectmerchant.merId > 0 && selectmerchant.status == 2) {
122
+					uni.redirectTo({
123
+						url: '/openmerchant/shopentry/processaudit?submitCode=' + 2 //已开通商户审核拒绝
124
+					});
125
+					return
126
+				}
127
+			
128
+			} 
129
+		},
130
+		onShow() {
131
+			return;
132
+			
133
+			// 以下逻辑在onload处理
134
+			
135
+			this.authorization = uni.getStorageSync('authorization')
136
+			let userinfo = uni.getStorageSync('userinfo')
137
+			this.uid = userinfo.uid
138
+			
139
+			let authorization = uni.getStorageSync('authorization')
140
+			// let userinfo = uni.getStorageSync('userinfo')
141
+			let selectmerchant = uni.getStorageSync('selectmerchant')
142
+			let uid = userinfo.uid
143
+			console.log(selectmerchant, authorization, userinfo)
144
+			if (authorization && uid) {
145
+				if (selectmerchant.merId >= 0 && selectmerchant.status == -1) {
146
+					uni.redirectTo({
147
+						url: "/openmerchant/guide/index" //有或者没有商户 没有金额支付and激活码支付
148
+					});
149
+					return
150
+				} else if (selectmerchant.merId > 0 && (selectmerchant.status == 1 || selectmerchant.status == 5)) {
151
+					
152
+					return
153
+				} else if (selectmerchant.merId >= 0 && (selectmerchant.status == 3 || selectmerchant.status == 4)) {
154
+					uni.redirectTo({
155
+						url: '/openmerchant/shopentry/process?mer_id=' + selectmerchant.merId //已开通商户未填写资料
156
+					});
157
+					return
158
+				} else if (selectmerchant.merId > 0 && selectmerchant.status == 0) {
159
+					uni.redirectTo({
160
+						url: '/openmerchant/shopentry/processaudit?submitCode=' + 3 //已开通商户待审核
161
+					});
162
+					return
163
+				} else if (selectmerchant.merId > 0 && selectmerchant.status == 2) {
164
+					uni.redirectTo({
165
+						url: '/openmerchant/shopentry/processaudit?submitCode=' + 2 //已开通商户审核拒绝
166
+					});
167
+					return
168
+				}
169
+			
170
+			} 
171
+			
172
+			
173
+		},
174
+		methods: {
175
+			// 退出登录
176
+			logoutAction(){
177
+				uni.removeStorageSync('userinfo');//清除用户信息
178
+				uni.removeStorageSync('authorization');//清除authorization
179
+				uni.removeStorageSync('selectmerchant');//清除商户数据
180
+				uni.removeStorageSync('storeStaff');//部门id对应权限
181
+				uni.removeStorageSync('jurisdiction');//管理员状态
182
+				uni.removeStorageSync('mer_id');//环信和项目连接的id,登录环信需要
183
+				//断开连接
184
+				closeEaseIM();
185
+				// this.$store.commit('SET_PIN_CONVERSATION_LIST', []);
186
+				this.authorization = ''
187
+				this.uid = ''
188
+				
189
+				
190
+				
191
+				uni.showToast({
192
+					title: "退出成功",
193
+					icon: "none"
194
+				})
195
+				// setTimeout(function() {
196
+				// 	uni.redirectTo({
197
+				// 		url: "/pages/user/login/index"
198
+				// 	});
199
+				// }, 700);
200
+			},
201
+			jinru(n,p){
202
+				let name = p
203
+				let page = n
204
+				if(name=="分润设置") {
205
+					let authorization = uni.getStorageSync('authorization')
206
+					let userinfo = uni.getStorageSync('userinfo')
207
+					let selectmerchant = uni.getStorageSync('selectmerchant')
208
+					let uid = userinfo.uid
209
+					if (authorization && uid) {
210
+						if (selectmerchant.merId >= 0 && selectmerchant.status == -1) {
211
+							uni.redirectTo({
212
+								url: "/openmerchant/guide/index" //有或者没有商户 没有金额支付and激活码支付
213
+							});
214
+							return
215
+						} else if (selectmerchant.merId > 0 && (selectmerchant.status == 1 || selectmerchant.status == 5)) {
216
+							uni.redirectTo({
217
+								url:page
218
+							})
219
+							return
220
+						} else if (selectmerchant.merId >= 0 && (selectmerchant.status == 3 || selectmerchant.status == 4)) {
221
+							uni.redirectTo({
222
+								url: '/openmerchant/shopentry/process?mer_id=' + selectmerchant.merId //已开通商户未填写资料
223
+							});
224
+							return
225
+						} else if (selectmerchant.merId > 0 && selectmerchant.status == 0) {
226
+							uni.redirectTo({
227
+								url: '/openmerchant/shopentry/processaudit?submitCode=' + 3 //已开通商户待审核
228
+							});
229
+							return
230
+						} else if (selectmerchant.merId > 0 && selectmerchant.status == 2) {
231
+							uni.redirectTo({
232
+								url: '/openmerchant/shopentry/processaudit?submitCode=' + 2 //已开通商户审核拒绝
233
+							});
234
+							return
235
+						}
236
+					
237
+					} else {
238
+						uni.navigateTo({
239
+							url: "/pages/user/login/index?type=1"
240
+						});
241
+						return
242
+					}
243
+					
244
+				}else if(name=="锁定用户"){
245
+					uni.redirectTo({
246
+						url:page
247
+					})
248
+				}else{
249
+					uni.redirectTo({
250
+						url:page
251
+					})
252
+				}
253
+			}
254
+		}
255
+	}
256
+</script>
257
+<style>
258
+	page {
259
+		background-color: #F7F8FC;
260
+	}
261
+</style>
262
+<style lang="scss" scoped>
263
+	.storemanagement {
264
+		width: 100%;
265
+		height: 100%;
266
+		display: flex;
267
+		flex-direction: column;
268
+		align-items: center;
269
+
270
+		.storemanagement-header {
271
+			width: 100%;
272
+			height: 328rpx;
273
+			background: linear-gradient(180deg, rgba(31, 124, 255, 0.2200) 0%, rgba(255, 255, 255, 0.1500) 100%);
274
+			position: relative;
275
+			display: flex;
276
+			justify-content: center;
277
+
278
+			.storemanagement-header-text {
279
+				position: absolute;
280
+				font-size: 46rpx;
281
+				font-weight: 500;
282
+				color: #333333;
283
+				top: 202rpx;
284
+				left: 64rpx;
285
+			}
286
+
287
+			.storemanagement-list {
288
+				width: 690rpx;
289
+				height: 262rpx;
290
+				position: absolute;
291
+				top: 298rpx;
292
+				display: flex;
293
+				flex-flow: wrap;
294
+				justify-content: space-between;
295
+
296
+				.storemanagement-list-yi {
297
+					margin-bottom: 26rpx;
298
+					width: 330rpx;
299
+					height: 118rpx;
300
+					background: #FFFFFF;
301
+					border-radius: 8rpx;
302
+					display: flex;
303
+					justify-content: space-around;
304
+					align-items: center;
305
+
306
+					.storemanagement-list-yi-text {
307
+						font-size: 26rpx;
308
+						font-weight: 500;
309
+						color: #333333;
310
+					}
311
+
312
+					.storemanagement-list-yi-image {
313
+						width: 92rpx;
314
+						height: 92rpx;
315
+
316
+						image {
317
+							width: 100%;
318
+							height: 100%;
319
+						}
320
+					}
321
+				}
322
+			}
323
+		}
324
+		.listadd-annkiu {
325
+			width: 686rpx;
326
+			height: 98rpx;
327
+			background: #1F7CFF;
328
+			border-radius: 8rpx;
329
+			position: fixed;
330
+			bottom: 26rpx;
331
+			font-size: 36rpx;
332
+			font-weight: 400;
333
+			color: #FFFFFF;
334
+			text-align: center;
335
+			line-height: 98rpx;
336
+		}
337
+	}
338
+</style>

+ 403 - 0
pages/ordermanagement/index.vue

@@ -0,0 +1,403 @@
1
+<template>
2
+	<view class="ordermanagement">
3
+		<view class="ordermanagement-header">
4
+			<view class="ordermanagement-header-text">
5
+				订单管理
6
+			</view>
7
+			<view class="ordermanagement-list">
8
+				<view class="ordermanagement-list-yi">
9
+					<view class="ordermanagement-list-yi-top">
10
+						{{num.orderPayment==undefined?0:num.orderPayment}}
11
+					</view>
12
+					<view class="ordermanagement-list-yi-bottom">
13
+						已支付订单数
14
+					</view>
15
+				</view>
16
+				<view class="ordermanagement-list-yi">
17
+					<view class="ordermanagement-list-yi-top">
18
+						{{num.payPrice==undefined?0:num.payPrice}}
19
+					</view>
20
+					<view class="ordermanagement-list-yi-bottom">
21
+						实际支付金额
22
+					</view>
23
+				</view>
24
+				<view class="ordermanagement-list-yi">
25
+					<view class="ordermanagement-list-yi-top">
26
+						{{num.refundPrice==undefined?0:num.refundPrice}}
27
+					</view>
28
+					<view class="ordermanagement-list-yi-bottom">
29
+						已退款金额
30
+					</view>
31
+				</view>
32
+			</view>
33
+		</view>
34
+		<view class="ordermanagement-ding">
35
+			<view class="ordermanagement-ding-text">
36
+				我的订单
37
+			</view>
38
+			<view class="ordermanagement-ding-nei">
39
+				<view class="ordermanagement-yisdf" v-for="(item,index) in dingdan" :key="index" @click="jiru(item.status,index)">
40
+					<view class="ordermanagement-img">
41
+						<image :src="item.img" mode="widthFix"></image>
42
+						<view class="ordermanagement-img-biao" v-if="item.num==0?false:true">
43
+							{{item.num}}
44
+						</view>
45
+					</view>
46
+					<view class="">
47
+						{{item.name}}
48
+					</view>
49
+				</view>
50
+			</view>
51
+		</view>
52
+		<!-- 		<view class="ordermanagement-dingsss">
53
+			<view class="ordermanagement-ding-text">
54
+				售后管理
55
+			</view>
56
+			<view class="ordermanagement-ding-nei">
57
+				<view class="ordermanagement-yisdf" v-for="(item,index) in dingdansss" :key="dingdan">
58
+					<view class="ordermanagement-img">
59
+						<image :src="item.img" mode="widthFix"></image>
60
+					</view>
61
+					<view class="">
62
+						{{item.name}}
63
+					</view>
64
+				</view>
65
+			</view>
66
+		</view> -->
67
+	</view>
68
+</template>
69
+
70
+<script>
71
+	import {
72
+		getOrderStstusAmount
73
+	} from '@/commit/order.js'
74
+	export default {
75
+		data() {
76
+			return {
77
+				num: [], //正向订单状态数
78
+				mer_id: 264,
79
+				dingdan: [{
80
+						img: 'https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154736170.png',
81
+						name: '待付款',
82
+					},
83
+					{
84
+						img: 'https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154723185.png',
85
+						name: '待发货',
86
+					},
87
+					{
88
+						img: 'https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154804269.png',
89
+						name: '待收货',
90
+					},
91
+					{
92
+						img: 'https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154750259.png',
93
+						name: '待评价',
94
+					}
95
+					// ,
96
+					// {
97
+					// 	img: 'https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154847886.png',
98
+					// 	name: '已退款'
99
+					// }
100
+				],
101
+				dingdansss: [{
102
+						img: 'https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154904247.png',
103
+						name: '待审核'
104
+					},
105
+					{
106
+						img: 'https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154932244.png',
107
+						name: '未通过'
108
+					},
109
+					{
110
+						img: 'https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154949118.png',
111
+						name: '已通过'
112
+					},
113
+					{
114
+						img: 'https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154918922.png',
115
+						name: '待收货'
116
+					},
117
+					{
118
+						img: 'https://cdn.bjtdba.com/vod/image/2022-08-12/20220812155008586.png',
119
+						name: '已完成'
120
+					}
121
+				]
122
+			}
123
+		},
124
+		onLoad() {
125
+			
126
+		},
127
+		onShow() {
128
+			uni.showLoading({
129
+				title: '加载中',
130
+			});
131
+			let selectmerchant = uni.getStorageSync('selectmerchant')
132
+			this.mer_id = selectmerchant.merId
133
+			this.getOrderStstusAmount()
134
+			
135
+			
136
+			
137
+			
138
+		},
139
+		methods: {
140
+			// 正向订单状态数
141
+			getOrderStstusAmount() {
142
+				getOrderStstusAmount({
143
+					mer_id: this.mer_id
144
+				}).then(res => {
145
+					if (res.data.status == 200) {
146
+						this.num = res.data.data
147
+						this.dingdan = [{
148
+								img: 'https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154736170.png',
149
+								name: '待付款',
150
+								num: this.num.orderPrepPayment,
151
+								status:5
152
+							},
153
+							{
154
+								img: 'https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154723185.png',
155
+								name: '待发货',
156
+								num: this.num.orderForDelivery,
157
+								status:0
158
+							},
159
+							{
160
+								img: 'https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154804269.png',
161
+								name: '待收货',
162
+								num: this.num.orderForReceived,
163
+								status:1
164
+							},
165
+							{
166
+								img: 'https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154750259.png',
167
+								name: '待评价',
168
+								num: this.num.orderForSpeech,
169
+								status:2
170
+							}
171
+						]
172
+						uni.hideLoading();
173
+					}
174
+				}, fail => {
175
+					console.log(fail)
176
+				})
177
+			},
178
+			jiru(e,i) {
179
+				
180
+				
181
+				let authorization = uni.getStorageSync('authorization')
182
+				let userinfo = uni.getStorageSync('userinfo')
183
+				let selectmerchant = uni.getStorageSync('selectmerchant')
184
+				let uid = userinfo.uid
185
+				if (authorization && uid) {
186
+					if (selectmerchant.merId >= 0 && selectmerchant.status == -1) {
187
+						uni.redirectTo({
188
+							url: "/openmerchant/guide/index" //有或者没有商户 没有金额支付and激活码支付
189
+						});
190
+						return
191
+					} else if (selectmerchant.merId > 0 && (selectmerchant.status == 1 || selectmerchant.status == 5)) {
192
+						uni.redirectTo({
193
+							url: "../../shop/commodity/order?status="+e + "&index="+ i
194
+						})
195
+						return
196
+					} else if (selectmerchant.merId >= 0 && (selectmerchant.status == 3 || selectmerchant.status == 4)) {
197
+						uni.redirectTo({
198
+							url: '/openmerchant/shopentry/process?mer_id=' + selectmerchant.merId //已开通商户未填写资料
199
+						});
200
+						return
201
+					} else if (selectmerchant.merId > 0 && selectmerchant.status == 0) {
202
+						uni.redirectTo({
203
+							url: '/openmerchant/shopentry/processaudit?submitCode=' + 3 //已开通商户待审核
204
+						});
205
+						return
206
+					} else if (selectmerchant.merId > 0 && selectmerchant.status == 2) {
207
+						uni.redirectTo({
208
+							url: '/openmerchant/shopentry/processaudit?submitCode=' + 2 //已开通商户审核拒绝
209
+						});
210
+						return
211
+					}
212
+				
213
+				} else {
214
+					uni.navigateTo({
215
+						url: "/pages/user/login/index?type=1"
216
+					});
217
+					return
218
+				}
219
+				
220
+				
221
+			}
222
+		}
223
+	}
224
+</script>
225
+<style>
226
+	page {
227
+		background-color: #F7F8FC;
228
+	}
229
+</style>
230
+<style lang="scss" scoped>
231
+	.ordermanagement {
232
+		width: 100%;
233
+		height: 100%;
234
+		display: flex;
235
+		flex-direction: column;
236
+		align-items: center;
237
+
238
+		.ordermanagement-header {
239
+			width: 100%;
240
+			height: 100%;
241
+			display: flex;
242
+			flex-direction: column;
243
+			align-items: center;
244
+			width: 100%;
245
+			height: 328rpx;
246
+			background: linear-gradient(180deg, rgba(31, 124, 255, 0.2200) 0%, rgba(255, 255, 255, 0.1500) 100%);
247
+			position: relative;
248
+			display: flex;
249
+			justify-content: center;
250
+
251
+			.ordermanagement-header-text {
252
+				position: absolute;
253
+				font-size: 46rpx;
254
+				font-weight: 500;
255
+				color: #333333;
256
+				top: 202rpx;
257
+				left: 64rpx;
258
+			}
259
+
260
+			.ordermanagement-list {
261
+				position: absolute;
262
+				top: 298rpx;
263
+				width: 686rpx;
264
+				height: 150rpx;
265
+				background: #FFFFFF;
266
+				border-radius: 16rpx;
267
+				display: flex;
268
+				justify-content: space-around;
269
+				align-items: center;
270
+
271
+				.ordermanagement-list-yi {
272
+					height: 70rpx;
273
+					display: flex;
274
+					flex-direction: column;
275
+					justify-content: space-between;
276
+					align-items: center;
277
+
278
+					.ordermanagement-list-yi-top {
279
+						font-size: 36rpx;
280
+						font-weight: bold;
281
+						color: #333333;
282
+					}
283
+
284
+					.ordermanagement-list-yi-bottom {
285
+						font-size: 26rpx;
286
+						font-weight: 400;
287
+						color: #333333;
288
+					}
289
+				}
290
+			}
291
+		}
292
+
293
+		.ordermanagement-ding {
294
+			width: 686rpx;
295
+			height: 216rpx;
296
+			margin: 156rpx 0 32rpx 0;
297
+			display: flex;
298
+			flex-direction: column;
299
+			justify-content: space-between;
300
+			align-items: flex-start;
301
+
302
+			.ordermanagement-ding-text {
303
+				font-size: 30rpx;
304
+				font-weight: 600;
305
+				color: #333333;
306
+			}
307
+
308
+			.ordermanagement-ding-nei {
309
+				width: 100%;
310
+				height: 160rpx;
311
+				background: #FFFFFF;
312
+				border-radius: 16rpx;
313
+				display: flex;
314
+				justify-content: space-around;
315
+				align-items: center;
316
+
317
+				.ordermanagement-yisdf {
318
+					height: 96rpx;
319
+					display: flex;
320
+					flex-direction: column;
321
+					justify-content: space-between;
322
+					align-items: center;
323
+					font-size: 24rpx;
324
+					font-weight: 400;
325
+					color: #5F6060;
326
+
327
+					.ordermanagement-img {
328
+						width: 48rpx;
329
+						height: 48rpx;
330
+						position: relative;
331
+
332
+						image {
333
+							width: 100%;
334
+							height: 100%;
335
+						}
336
+
337
+						.ordermanagement-img-biao {
338
+							position: absolute;
339
+							left: 40rpx;
340
+							bottom: 31rpx;
341
+							width: 30rpx;
342
+							height: 30rpx;
343
+							border-radius: 50%;
344
+							background: #FE0032;
345
+							font-size: 20rpx;
346
+							font-weight: 400;
347
+							color: #FFFFFF;
348
+							display: flex;
349
+							justify-content: center;
350
+							align-items: center;
351
+						}
352
+					}
353
+				}
354
+			}
355
+		}
356
+
357
+		.ordermanagement-dingsss {
358
+			width: 686rpx;
359
+			height: 216rpx;
360
+			display: flex;
361
+			flex-direction: column;
362
+			justify-content: space-between;
363
+			align-items: flex-start;
364
+
365
+			.ordermanagement-ding-text {
366
+				font-size: 30rpx;
367
+				font-weight: 600;
368
+				color: #333333;
369
+			}
370
+
371
+			.ordermanagement-ding-nei {
372
+				width: 100%;
373
+				height: 160rpx;
374
+				background: #FFFFFF;
375
+				border-radius: 16rpx;
376
+				display: flex;
377
+				justify-content: space-around;
378
+				align-items: center;
379
+
380
+				.ordermanagement-yisdf {
381
+					height: 96rpx;
382
+					display: flex;
383
+					flex-direction: column;
384
+					justify-content: space-between;
385
+					align-items: center;
386
+					font-size: 24rpx;
387
+					font-weight: 400;
388
+					color: #5F6060;
389
+
390
+					.ordermanagement-img {
391
+						width: 48rpx;
392
+						height: 48rpx;
393
+
394
+						image {
395
+							width: 100%;
396
+							height: 100%;
397
+						}
398
+					}
399
+				}
400
+			}
401
+		}
402
+	}
403
+</style>

+ 50 - 0
pages/storemanagement/index.vue

@@ -0,0 +1,50 @@
1
+<template>
2
+  <view class="box">
3
+	<!-- <u-loading size="100" :show="true"></u-loading> -->
4
+	<!-- <view @click="gotoPage()">跳转</view> -->
5
+  </view>
6
+</template>
7
+
8
+<script>
9
+
10
+
11
+export default {
12
+  data() {
13
+    return {
14
+		
15
+    };
16
+  },
17
+  components: {
18
+   
19
+  },
20
+  onShow() {
21
+	uni.showLoading({
22
+		title: '加载中',
23
+	});
24
+  	this.gotoPage();
25
+  },
26
+  computed: {
27
+    
28
+  },
29
+  created() {
30
+   
31
+  },
32
+  methods: {
33
+	gotoPage(){
34
+		setTimeout(()=>{
35
+			uni.navigateTo({
36
+			  url: '../../chatIndex/storemanagement/index',
37
+			});
38
+		},1000)
39
+	}
40
+    
41
+   
42
+  },
43
+};
44
+</script>
45
+<style>
46
+	.box{
47
+		margin:0 auto;
48
+	}
49
+ 
50
+</style>

+ 502 - 0
pages/user/login/index - 副本.vue

@@ -0,0 +1,502 @@
1
+<template>
2
+	<view class="login">
3
+		<view class="login_header">
4
+			<view class="login_header_top">
5
+				<image src="https://cdn.bjtdba.com/vod/image/2024-04-12/20240412151953641.png" mode="widthFix"></image>
6
+			</view>
7
+			<!-- <view class="login_header_botom">
8
+				<image src="https://cdn.bjtdba.com/vod/image/2022-08-09/20220809135451815.png" mode="widthFix"></image>
9
+			</view> -->
10
+		</view>
11
+		<view class="input-home">
12
+			<view class="input">
13
+				<input placeholder="请输入手机号" type="number" maxlength="11" focus="true"
14
+					placeholder-style="color:#9E9E9E;font-size:30rpx" v-model="form.phone" @input="inputphone">
15
+				<view class="input_code">
16
+					<span v-show="show" @click="getCode"
17
+						 :style="form.phone.length==11?'color:#1F7CFF':'color:#9E9E9E'">获取验证码</span>
18
+					<span v-show="!show" class="count" style="color:#9E9E9E">重新发送({{count}}S)</span>
19
+				</view>
20
+			</view>
21
+			<view class="input">
22
+				<input type="number" placeholder="请输入验证码" maxlength="4"
23
+					placeholder-style="color:#9E9E9E;font-size:30rpx;" v-model="form.sms_code" @input="inputcode">
24
+			</view>
25
+		</view>
26
+		<view class="login-singn" @click="login" :style="form.sms_code.length == 4 ? 'background-color:#1F7CFF':'background-color:rgba(31, 124, 255, 0.3)'">
27
+			<view class="login-singn-text" :style="form.sms_code.length == 4 ? 'color:#FFF':'color: #333'">
28
+				登录
29
+			</view>
30
+		</view>
31
+		<view class="bottom-index">
32
+			<view class="bottom-index-in">
33
+				<image src="https://cdn.bjtdba.com/vod/image/2022-08-09/20220809155152572.png" v-if="is_wei"
34
+					@click="gou" mode="widthFix"></image>
35
+				<image src="https://cdn.bjtdba.com/vod/image/2022-08-09/20220809155125568.png" v-if="is_yes"
36
+					@click="gou" mode="widthFix"></image>
37
+			</view>
38
+			<view class="bottom-index-ri">
39
+				我已经阅读并同意<span style="color: #1f7cff" @click="xieyi()">《注册协议》</span >、<span style="color: #1f7cff" @click="yincang()">《隐私协议》</span>、<span style="color: #1f7cff" @click="ruzhuxieyi()">《商家入驻协议》</span>
40
+			</view>
41
+			
42
+
43
+		</view>
44
+		
45
+		<view class="unLogin-singn" @click="unLogin">
46
+			<view class="login-singn-text">
47
+				暂不登录
48
+			</view>
49
+		</view>
50
+		
51
+		
52
+		<!-- #ifdef MP-WEIXIN -->
53
+			<ws-wx-privacy id="privacy-popup"></ws-wx-privacy>
54
+		<!-- #endif -->
55
+
56
+
57
+	</view>
58
+
59
+</template>
60
+
61
+<script>
62
+	import {
63
+		userPhoneLogOnCode,
64
+		userPhoneLogOn,
65
+		selectMerchant,
66
+		queryStoreBranch,
67
+		getImUser
68
+	} from '@/commit/api.js'
69
+	import emHandleReconnect from '@/EaseIM/utils/emHandleReconnect';
70
+	import { emConnect } from '@/EaseIM/emApis';
71
+	import wxPrivacy from '@/uni_modules/ws-wx-privacy/components/ws-wx-privacy/ws-wx-privacy.vue'
72
+	export default {
73
+		data() {
74
+			return {
75
+				show: true,
76
+				count: '',
77
+				timer: null,
78
+				is_wei: true,
79
+				is_yes: false,
80
+				form: {
81
+					phone: uni.getStorageSync("user_phone").length == 0?'':uni.getStorageSync("user_phone"),
82
+					sms_code: '',
83
+					type: '1'
84
+				},
85
+				
86
+				type: ''
87
+			}
88
+		},
89
+		onLoad(options) {
90
+			//#ifdef MP-WEIXIN        
91
+			wx.requirePrivacyAuthorize({            
92
+			  success: () => {                
93
+			    console.log('点击同意');            
94
+			 },            
95
+			  fail: () => {                
96
+			    console.log('点击拒绝');                            
97
+			 },             
98
+			  complete: () => {                
99
+			    console.log('用户已点击');            
100
+			 }       
101
+			})
102
+			//#endif
103
+			
104
+			this.type = options.type
105
+			console.log(options.type)
106
+			console.log(this.type)
107
+		},
108
+		components: {
109
+			wxPrivacy
110
+		},
111
+		methods: {
112
+			handleDisagree() {
113
+			    // 处理用户不同意隐私协议的逻辑
114
+			},
115
+			handleAgree() {
116
+			    // 处理用户同意隐私协议的逻辑
117
+		    },
118
+			
119
+			
120
+			getCode() {
121
+				var mobileReg = /^1[3456789]\d{9}$/;
122
+				if (this.form.phone == "") {
123
+					uni.showToast({
124
+						title: "手机号不能为空",
125
+						icon: "none"
126
+					})
127
+				} else if (!mobileReg.test(this.form.phone)) {
128
+					uni.showToast({
129
+						title: "手机号格式有误",
130
+						icon: "none"
131
+					})
132
+				} else {
133
+					// 点击获取验证码后 保存手机号
134
+					uni.setStorageSync('user_phone',this.form.phone);
135
+					const TIME_COUNT = 60;
136
+					if (!this.timer) {
137
+						this.count = TIME_COUNT;
138
+						this.show = false;
139
+						if (this.show == false) {
140
+							// 获取验证码
141
+							userPhoneLogOnCode({
142
+								phone: this.form.phone
143
+							}).then(res => {
144
+								if (res.data.status == 200) {
145
+									uni.showToast({
146
+										title: res.data.data.message,
147
+										icon: "none"
148
+									})
149
+								}
150
+							}, fail => {
151
+								uni.showToast({
152
+									title: fail,
153
+									icon: "error"
154
+								})
155
+							}).catch(err => {
156
+								console.log(err)
157
+							})
158
+						}
159
+						this.timer = setInterval(() => {
160
+							if (this.count > 0 && this.count <= TIME_COUNT) {
161
+								this.count--;
162
+							} else {
163
+								this.show = true;
164
+								clearInterval(this.timer);
165
+								this.timer = null;
166
+							}
167
+						}, 1000)
168
+					}
169
+				}
170
+			},
171
+			inputphone(e) {
172
+				const o = e.target;
173
+				const inputRule = /[^\d]/g
174
+				this.$nextTick(function() {
175
+					this.form.phone = o.value.replace(inputRule, '');
176
+					if (this.form.phone.length < 11) {
177
+						if(this.show==false){
178
+							this.show = true;
179
+							clearInterval(this.timer);
180
+							this.timer = null;
181
+						}
182
+					}
183
+				})
184
+			},
185
+			inputcode(e) {
186
+				const o = e.target;
187
+				const inputRule = /[^\d]/g
188
+				this.$nextTick(function() {
189
+					this.form.sms_code = o.value.replace(inputRule, '');
190
+				})
191
+			},
192
+			xieyi() {
193
+				
194
+				uni.setStorageSync('agreementType','2')
195
+				
196
+				uni.navigateTo({
197
+					url: "/pages/index/bottombat?type=2" 
198
+				})
199
+			},
200
+			yincang() {
201
+				uni.setStorageSync('agreementType','1')
202
+				uni.navigateTo({
203
+					url: "/pages/index/bottombat?type=1"
204
+				})
205
+			},
206
+			ruzhuxieyi() {
207
+				uni.setStorageSync('agreementType','6')
208
+				uni.navigateTo({
209
+					url: "/pages/index/bottombat?type=6" 
210
+				})
211
+			},
212
+			gou() {
213
+				if (this.is_wei == true) {
214
+					this.is_wei = false;
215
+					this.is_yes = true;
216
+				} else {
217
+					this.is_wei = true;
218
+					this.is_yes = false;
219
+				}
220
+			},
221
+			// 暂不登录
222
+			unLogin() {
223
+				setTimeout(function() {
224
+					uni.switchTab({
225
+						url: '../../my/index'
226
+					});
227
+				}, 300);
228
+			},
229
+			loginWithUserId (){
230
+				try {
231
+				  uni.setStorage({
232
+				    key: 'myUsername',
233
+				    data: loginState.name.toLowerCase(),
234
+				  });
235
+				  console.log('22222');
236
+				  loginStore.setLoginUserBaseInfos({ loginUserId: loginState.name });
237
+				  setUserTokenToStorage(loginState.name.toLowerCase(), res.accessToken);
238
+				} catch (error) {
239
+				  console.log('>>>>>>', error);
240
+				  uni.showToast({
241
+				    title: '登录失败',
242
+				    icon: 'none',
243
+				  });
244
+				  console.log('33333');
245
+				} finally {
246
+				  loginState.name = '';
247
+				  loginState.psd = '';
248
+				}
249
+			},
250
+			login() {
251
+				 const { actionEMReconnect } = emHandleReconnect();
252
+				var mobileReg = /^1[3456789]\d{9}$/;
253
+				if (this.form.phone == "") {
254
+					uni.showToast({
255
+						title: "手机号不能为空",
256
+						icon: "none"
257
+					})
258
+				} else if (!mobileReg.test(this.form.phone)) {
259
+					uni.showToast({
260
+						title: "手机号格式有误",
261
+						icon: "none"
262
+					})
263
+				} else if (this.form.sms_code == "") {
264
+					uni.showToast({
265
+						title: "请输入验证码",
266
+						icon: "none"
267
+					})
268
+				} else if (this.is_wei == true) {
269
+					uni.showToast({
270
+						title: "请勾选协议",
271
+						icon: "none"
272
+					})
273
+					return;
274
+				} else {
275
+					// 登录注册
276
+					userPhoneLogOn(this.form).then(res => {
277
+						console.log(res)
278
+						if (res.data.status == 200 && JSON.stringify(res.data.data) != "{}") {
279
+							uni.setStorageSync('userinfo', res.data.data.user);
280
+							uni.setStorageSync('authorization', res.data.data.x_token);
281
+							uni.setStorageSync('storeStaff', res.data.data.storeStaff);
282
+							// 用户状态判断
283
+							selectMerchant({
284
+								uid: res.data.data.user.uid
285
+							}).then(data => {
286
+								uni.setStorage({
287
+								  key: 'myUsername',
288
+								  data: JSON.stringify(uni.getStorageSync('userinfo').uid),
289
+								});
290
+								getImUser({
291
+									mer_id:	data.data.data.merId
292
+								}).then(data=>{
293
+									console.log('getImUser======',data.data.data);
294
+									actionEMReconnect();
295
+									 // this.loginWithUserId()
296
+									const { loginWithPassword } = emConnect();
297
+									uni.setStorage({
298
+										key: 'im_userid',
299
+										data:data.data.data.im_userid
300
+									})
301
+									uni.setStorage({
302
+										key: 'im_pass',
303
+										data:data.data.data.im_pass
304
+									})
305
+									
306
+									// loginWithPassword( data.data.data.im_userid,data.data.data.im_pass);
307
+									// getApp().globalData.conn.open({
308
+									//   apiUrl: WebIM.config.apiURL,
309
+									//   appKey: "1154240320150538#cxb-yhc",
310
+									//   pwd: "123456",
311
+									//   user: JSON.stringify(uni.getStorageSync('userinfo').uid),
312
+									//   success: (res) => {
313
+									// 	  console.log('1111');
314
+									// 	  console.log('uni.WebIM.conn.open-----',res);
315
+									// 	  const {
316
+									// 		  access_token
317
+									// 	  } = res
318
+									// 	  uni.setStorageSync('imToken', access_token)
319
+									//   },
320
+									//   error:(err)=>{
321
+									// 	  console.log('2222');
322
+									// 	  console.log(err);
323
+									//   }
324
+									// });
325
+								})
326
+								if (data.data.status == 200) {
327
+									uni.setStorageSync('selectmerchant', data.data.data);
328
+									let storeStaff = uni.getStorageSync('storeStaff')
329
+									if (storeStaff != null) {
330
+										queryStoreBranch({
331
+											id: storeStaff.department
332
+										}).then(res => {
333
+											if (res.data.status == 200) {
334
+												uni.setStorageSync('jurisdiction', res.data.data.jurisdiction);
335
+											}
336
+										})
337
+									} else {
338
+										uni.setStorageSync('jurisdiction', [7, 9, 5, 3]);
339
+									}
340
+									uni.showToast({
341
+										title: res.data.message,
342
+										icon: "none"
343
+									})
344
+									
345
+									console.log(this.type)
346
+									
347
+									if (this.type == 1) {
348
+										
349
+										console.log('返回上一页')
350
+										uni.navigateBack({
351
+											delta: 1
352
+										})
353
+									} else {
354
+										setTimeout(function() {
355
+											uni.switchTab({
356
+												url: '../../cashier/index'
357
+											});
358
+										}, 700);
359
+									}
360
+								}
361
+							}, fail => {
362
+								uni.showToast({
363
+									title: fail,
364
+									icon: "none"
365
+								})
366
+							}).catch(err => {
367
+								console.log(err)
368
+							})
369
+						} else {
370
+							uni.showToast({
371
+								title: res.data.message,
372
+								icon: "none"
373
+							})
374
+						}
375
+					}, fail => {
376
+						uni.showToast({
377
+							title: fail,
378
+							icon: "none"
379
+						})
380
+					}).catch(data => {
381
+						console.log(data)
382
+					})
383
+				}
384
+			},
385
+		}
386
+	}
387
+</script>
388
+
389
+<style lang="scss" scoped>
390
+	.login {
391
+		width: 100%;
392
+		height: 100%;
393
+		display: flex;
394
+		flex-direction: column;
395
+		align-items: center;
396
+
397
+		.login_header {
398
+			height: 211rpx;
399
+			margin-top: 74rpx;
400
+			display: flex;
401
+			flex-direction: column;
402
+			justify-content: space-between;
403
+			align-items: center;
404
+
405
+			.login_header_top {
406
+				width: 216rpx;
407
+				height: 242rpx;
408
+
409
+				image {
410
+					width: 100%;
411
+					height: 100%;
412
+				}
413
+			}
414
+
415
+			.login_header_botom {
416
+				width: 156rpx;
417
+				height: 48rpx;
418
+
419
+				image {
420
+					width: 100%;
421
+					height: 100%;
422
+				}
423
+			}
424
+		}
425
+
426
+		.input-home {
427
+			width: 658rpx;
428
+			height: 238rpx;
429
+			margin-top: 67rpx;
430
+			display: flex;
431
+			flex-direction: column;
432
+			align-items: center;
433
+			justify-content: space-between;
434
+
435
+			.input {
436
+				width: 100%;
437
+				height: 118rpx;
438
+				border-bottom: 1rpx solid #E5E5E5;
439
+				position: relative;
440
+
441
+				input {
442
+					width: 485rpx;
443
+					height: 100rpx;
444
+					margin: 20rpx 0 0 10rpx;
445
+					color: #333333;
446
+				}
447
+
448
+				.input_code {
449
+					position: absolute;
450
+					top: 55rpx;
451
+					right: 15rpx;
452
+					font-size: 30rpx;
453
+					font-weight: 400;
454
+				}
455
+			}
456
+		}
457
+
458
+		.login-singn {
459
+			width: 658rpx;
460
+			height: 88rpx;
461
+			background-color: rgba(31, 124, 255, 0.3);
462
+			border-radius: 10rpx;
463
+			margin-top: 70rpx;
464
+			font-size: 30rpx;
465
+			font-weight: 400;
466
+			display: flex;
467
+			justify-content: center;
468
+			align-items: center;
469
+			color: #333333;
470
+		}
471
+
472
+		.unLogin-singn {
473
+			margin-top: 88rpx;
474
+		}
475
+		.bottom-index {
476
+			width: 658rpx;
477
+			height: 33rpx;
478
+			display: flex;
479
+			justify-content: space-between;
480
+			align-items: center;
481
+			margin-top: 60rpx;
482
+
483
+			.bottom-index-in {
484
+				width: 32rpx;
485
+				height: 32rpx;
486
+				line-height: 33rpx;
487
+				transform: sale(2);
488
+				image {
489
+					width: 100%;
490
+					height: 100%;
491
+				}
492
+				margin-right: 20rpx;
493
+				// position: relative;
494
+			}
495
+
496
+			.bottom-index-ri {
497
+				height: 100%;
498
+				font-size: 24rpx;
499
+			}
500
+		}
501
+	}
502
+</style>

+ 543 - 0
pages/user/login/index.vue

@@ -0,0 +1,543 @@
1
+<template>
2
+	<view class="login">
3
+		<view class="login_header">
4
+			<view class="login_header_top">
5
+				<image src="https://cdn.bjtdba.com/vod/image/2024-04-12/20240412151953641.png" mode="widthFix"></image>
6
+			</view>
7
+			<!-- <view class="login_header_botom">
8
+				<image src="https://cdn.bjtdba.com/vod/image/2022-08-09/20220809135451815.png" mode="widthFix"></image>
9
+			</view> -->
10
+		</view>
11
+		<view class="input-home">
12
+			<view class="input">
13
+				<input placeholder="请输入手机号" type="number" maxlength="11" focus="true"
14
+					placeholder-style="color:#9E9E9E;font-size:30rpx" v-model="form.phone" @input="inputphone">
15
+				<view class="input_code">
16
+					<span v-show="show" @click="getCode"
17
+						 :style="form.phone.length==11?'color:#1F7CFF':'color:#9E9E9E'">获取验证码</span>
18
+					<span v-show="!show" class="count" style="color:#9E9E9E">重新发送({{count}}S)</span>
19
+				</view>
20
+			</view>
21
+			<view class="input">
22
+				<input type="number" placeholder="请输入验证码" maxlength="4"
23
+					placeholder-style="color:#9E9E9E;font-size:30rpx;" v-model="form.sms_code" @input="inputcode">
24
+			</view>
25
+		</view>
26
+		<view class="login-singn" @click="login" :style="form.sms_code.length == 4 ? 'background-color:#1F7CFF':'background-color:rgba(31, 124, 255, 0.3)'">
27
+			<view class="login-singn-text" :style="form.sms_code.length == 4 ? 'color:#FFF':'color: #333'">
28
+				登录
29
+			</view>
30
+		</view>
31
+		<view class="bottom-index">
32
+			<view class="bottom-index-in">
33
+				<image src="https://cdn.bjtdba.com/vod/image/2022-08-09/20220809155152572.png" v-if="is_wei"
34
+					@click="gou" mode="widthFix"></image>
35
+				<image src="https://cdn.bjtdba.com/vod/image/2022-08-09/20220809155125568.png" v-if="is_yes"
36
+					@click="gou" mode="widthFix"></image>
37
+			</view>
38
+			<view class="bottom-index-ri">
39
+				我已经阅读并同意<span style="color: #1f7cff" @click="xieyi()">《注册协议》</span >、<span style="color: #1f7cff" @click="yincang()">《隐私协议》</span>、<span style="color: #1f7cff" @click="ruzhuxieyi()">《商家入驻协议》</span>
40
+			</view>
41
+		</view>
42
+		
43
+		<view class="unLogin-singn" @click="unLogin">
44
+			<view class="login-singn-text">
45
+				暂不登录
46
+			</view>
47
+		</view>
48
+		
49
+		
50
+		<!-- #ifdef MP-WEIXIN -->
51
+			<ws-wx-privacy id="privacy-popup"></ws-wx-privacy>
52
+		<!-- #endif -->
53
+
54
+
55
+	</view>
56
+
57
+</template>
58
+
59
+<script>
60
+	import {
61
+		userPhoneLogOnCode,
62
+		userPhoneLogOn,
63
+		selectMerchant,
64
+		queryStoreBranch,
65
+		getImUser
66
+	} from '@/commit/api.js'
67
+	import emHandleReconnect from '@/EaseIM/utils/emHandleReconnect'; 
68
+	import { emConnect,emUserInfos } from '@/EaseIM/emApis';
69
+	const { updateUserInfosFromServer } = emUserInfos();
70
+	const { loginWithPassword } = emConnect();
71
+	import wxPrivacy from '@/uni_modules/ws-wx-privacy/components/ws-wx-privacy/ws-wx-privacy.vue'
72
+	export default {
73
+		data() {
74
+			return {
75
+				show: true,
76
+				count: '',
77
+				timer: null,
78
+				is_wei: true,
79
+				is_yes: false,
80
+				form: {
81
+					phone: uni.getStorageSync("user_phone").length == 0?'':uni.getStorageSync("user_phone"),
82
+					sms_code: '',
83
+					type: '1'
84
+				},
85
+				
86
+				type: ''
87
+			}
88
+		},
89
+		onLoad(options) {
90
+			//#ifdef MP-WEIXIN        
91
+			wx.requirePrivacyAuthorize({            
92
+			  success: () => {                
93
+			    console.log('点击同意');            
94
+			 },            
95
+			  fail: () => {                
96
+			    console.log('点击拒绝');                            
97
+			 },             
98
+			  complete: () => {                
99
+			    console.log('用户已点击');            
100
+			 }       
101
+			})
102
+			//#endif
103
+			
104
+			this.type = options.type
105
+			console.log(options.type)
106
+			console.log(this.type)
107
+		},
108
+		components: {
109
+			wxPrivacy
110
+		},
111
+		methods: {
112
+			
113
+			handleDisagree() {
114
+			    // 处理用户不同意隐私协议的逻辑
115
+			},
116
+			handleAgree() {
117
+			    // 处理用户同意隐私协议的逻辑
118
+		    },
119
+			
120
+			
121
+			getCode() {
122
+				var mobileReg = /^1[3456789]\d{9}$/;
123
+				if (this.form.phone == "") {
124
+					uni.showToast({
125
+						title: "手机号不能为空",
126
+						icon: "none"
127
+					})
128
+				} else if (!mobileReg.test(this.form.phone)) {
129
+					uni.showToast({
130
+						title: "手机号格式有误",
131
+						icon: "none"
132
+					})
133
+				} else {
134
+					// 点击获取验证码后 保存手机号
135
+					uni.setStorageSync('user_phone',this.form.phone);
136
+					const TIME_COUNT = 60;
137
+					if (!this.timer) {
138
+						this.count = TIME_COUNT;
139
+						this.show = false;
140
+						if (this.show == false) {
141
+							// 获取验证码
142
+							userPhoneLogOnCode({
143
+								phone: this.form.phone
144
+							}).then(res => {
145
+								if (res.data.status == 200) {
146
+									uni.showToast({
147
+										title: res.data.data.message,
148
+										icon: "none"
149
+									})
150
+								}
151
+							}, fail => {
152
+								uni.showToast({
153
+									title: fail,
154
+									icon: "error"
155
+								})
156
+							}).catch(err => {
157
+								console.log(err)
158
+							})
159
+						}
160
+						this.timer = setInterval(() => {
161
+							if (this.count > 0 && this.count <= TIME_COUNT) {
162
+								this.count--;
163
+							} else {
164
+								this.show = true;
165
+								clearInterval(this.timer);
166
+								this.timer = null;
167
+							}
168
+						}, 1000)
169
+					}
170
+				}
171
+			},
172
+			inputphone(e) {
173
+				const o = e.target;
174
+				const inputRule = /[^\d]/g
175
+				this.$nextTick(function() {
176
+					this.form.phone = o.value.replace(inputRule, '');
177
+					if (this.form.phone.length < 11) {
178
+						if(this.show==false){
179
+							this.show = true;
180
+							clearInterval(this.timer);
181
+							this.timer = null;
182
+						}
183
+					}
184
+				})
185
+			},
186
+			inputcode(e) {
187
+				const o = e.target;
188
+				const inputRule = /[^\d]/g
189
+				this.$nextTick(function() {
190
+					this.form.sms_code = o.value.replace(inputRule, '');
191
+				})
192
+			},
193
+			xieyi() {
194
+				
195
+				uni.setStorageSync('agreementType','2')
196
+				
197
+				uni.navigateTo({
198
+					url: "/pages/index/bottombat?type=2" 
199
+				})
200
+			},
201
+			yincang() {
202
+				uni.setStorageSync('agreementType','1')
203
+				uni.navigateTo({
204
+					url: "/pages/index/bottombat?type=1"
205
+				})
206
+			},
207
+			ruzhuxieyi() {
208
+				uni.setStorageSync('agreementType','6')
209
+				uni.navigateTo({
210
+					url: "/pages/index/bottombat?type=6" 
211
+				})
212
+			},
213
+			gou() {
214
+				if (this.is_wei == true) {
215
+					this.is_wei = false;
216
+					this.is_yes = true;
217
+				} else {
218
+					this.is_wei = true;
219
+					this.is_yes = false;
220
+				}
221
+			},
222
+			// 暂不登录
223
+			unLogin() {
224
+				setTimeout(function() {
225
+					uni.switchTab({
226
+						url: '../../my/index'
227
+					});
228
+				}, 300);
229
+			},
230
+			//lww
231
+			// loginWithUserId (){
232
+			// 	try {
233
+			// 	  uni.setStorage({
234
+			// 	    key: 'myUsername',
235
+			// 	    data: loginState.name.toLowerCase(),
236
+			// 	  });
237
+			// 	  console.log('22222');
238
+			// 	  loginStore.setLoginUserBaseInfos({ loginUserId: loginState.name });
239
+			// 	  setUserTokenToStorage(loginState.name.toLowerCase(), res.accessToken);
240
+			// 	} catch (error) {
241
+			// 	  console.log('>>>>>>', error);
242
+			// 	  uni.showToast({
243
+			// 	    title: '登录失败',
244
+			// 	    icon: 'none',
245
+			// 	  });
246
+			// 	  console.log('33333');
247
+			// 	} finally {
248
+			// 	  loginState.name = '';
249
+			// 	  loginState.psd = '';
250
+			// 	}
251
+			// },
252
+			//lww
253
+			async loginWithUserId() {
254
+			 this.loginEaseIMId =uni.getStorageSync('im_userid')
255
+			  try {
256
+			    const res = await loginWithPassword(
257
+			      this.loginEaseIMId,
258
+			      uni.getStorageSync('im_pass')
259
+			    );
260
+			    this.$store.commit('SET_LOGIN_USER_BASE_INFOS', {
261
+			      loginUserId:  this.loginEaseIMId,
262
+			    });
263
+			    this.setEMUserLoginInfosToStorage(
264
+			      this.loginEaseIMId.toLowerCase(),
265
+			      res.accessToken
266
+				  //注意:res.accessToken
267
+			    );
268
+				// this.updateHXUser();
269
+			  } catch (error) {
270
+			    console.log('>>>>>>', error);
271
+			    uni.showToast({
272
+			      title: '登录失败',
273
+			      icon: 'none',
274
+			    });
275
+			  } finally {
276
+			    this.loginEaseIMId = '';
277
+			  }
278
+			},
279
+			setEMUserLoginInfosToStorage(userId, token) {
280
+			  const params = {
281
+			    key: `EM_LOGIN_INFOS`,
282
+			    data: { userId: userId, token: token },
283
+			  };
284
+			  uni.setStorage({ ...params });
285
+			},
286
+			updateHXUser(){
287
+				console.log('修改环信的昵称');
288
+				updateUserInfosFromServer({nickname: JSON.stringify(uni.getStorageSync('userinfo')).nickname,avatarurl:JSON.stringify(uni.getStorageSync('userinfo')).avatar});
289
+				// {nickname: JSON.stringify(uni.getStorageSync('userinfo')).nickname,avatar:JSON.stringify(uni.getStorageSync('userinfo')).avatar}
290
+			},
291
+			//lww结束
292
+			login() {
293
+				 const { actionEMReconnect } = emHandleReconnect();
294
+				var mobileReg = /^1[3456789]\d{9}$/;
295
+				if (this.form.phone == "") {
296
+					uni.showToast({
297
+						title: "手机号不能为空",
298
+						icon: "none"
299
+					})
300
+				} else if (!mobileReg.test(this.form.phone)) {
301
+					uni.showToast({
302
+						title: "手机号格式有误",
303
+						icon: "none"
304
+					})
305
+				} else if (this.form.sms_code == "") {
306
+					uni.showToast({
307
+						title: "请输入验证码",
308
+						icon: "none"
309
+					})
310
+				} else if (this.is_wei == true) {
311
+					uni.showToast({
312
+						title: "请勾选协议",
313
+						icon: "none"
314
+					})
315
+					return;
316
+				} else {
317
+					// 登录注册
318
+					userPhoneLogOn(this.form).then(res => {
319
+						console.log(res)
320
+						if (res.data.status == 200 && JSON.stringify(res.data.data) != "{}") {
321
+							uni.setStorageSync('userinfo', res.data.data.user);
322
+							uni.setStorageSync('authorization', res.data.data.x_token);
323
+							uni.setStorageSync('storeStaff', res.data.data.storeStaff);
324
+							// 用户状态判断
325
+							selectMerchant({
326
+								uid: res.data.data.user.uid
327
+							}).then(data => {
328
+								uni.setStorage({
329
+								  key: 'myUsername',
330
+								  data: JSON.stringify(uni.getStorageSync('userinfo').uid),
331
+								});
332
+								uni.setStorage({
333
+								  key: 'mer_id',
334
+								  data: data.data.data.merchantIntention.mer_id,
335
+								});
336
+								
337
+								if (data.data.status == 200) {
338
+									uni.setStorageSync('selectmerchant', data.data.data);
339
+									//lww
340
+									
341
+									getImUser({
342
+										mer_id:	uni.getStorageSync('mer_id'),
343
+									}).then(data=>{
344
+										console.log('getImUser======',data.data.data);
345
+										// actionEMReconnect();
346
+										 // this.loginWithUserId()
347
+										const { loginWithPassword } = emConnect();
348
+										uni.setStorage({
349
+											key: 'im_userid',
350
+											data:data.data.data.im_userid
351
+										})
352
+										uni.setStorage({
353
+											key: 'im_pass',
354
+											data:data.data.data.im_pass
355
+										})
356
+										uni.setStorage({
357
+											key: 'im_uuid',
358
+											data:data.data.data.im_uuid
359
+										})
360
+										//环信注册成功 登录
361
+										if(data.data.status==200){
362
+											console.log('>>>>>>>>环信注册成功 登录')
363
+											this.loginWithUserId()
364
+											//更新环信的用户信息 头像,昵称
365
+											
366
+										}
367
+									})
368
+									//lww
369
+									let storeStaff = uni.getStorageSync('storeStaff')
370
+									if (storeStaff != null) {
371
+										queryStoreBranch({
372
+											id: storeStaff.department
373
+										}).then(res => {
374
+											if (res.data.status == 200) {
375
+												uni.setStorageSync('jurisdiction', res.data.data.jurisdiction);
376
+											}
377
+										})
378
+									} else {
379
+										uni.setStorageSync('jurisdiction', [7, 9, 5, 3]);
380
+									}
381
+									uni.showToast({
382
+										title: res.data.message,
383
+										icon: "none"
384
+									})
385
+									
386
+									console.log(this.type, 'this.type')
387
+									
388
+									if (this.type == 1) {
389
+										
390
+										console.log('返回上一页')
391
+										uni.navigateBack({
392
+											delta: 1
393
+										})
394
+									} else {
395
+										setTimeout(function() {
396
+											uni.switchTab({
397
+												url: '../../cashier/index'
398
+											});
399
+										}, 700);
400
+									}
401
+								}
402
+							}, fail => {
403
+								uni.showToast({
404
+									title: fail,
405
+									icon: "none"
406
+								})
407
+							}).catch(err => {
408
+								console.log(err)
409
+							})
410
+						} else {
411
+							uni.showToast({
412
+								title: res.data.message,
413
+								icon: "none"
414
+							})
415
+						}
416
+					}, fail => {
417
+						uni.showToast({
418
+							title: fail,
419
+							icon: "none"
420
+						})
421
+					}).catch(data => {
422
+						console.log(data)
423
+					})
424
+				}
425
+			},
426
+		}
427
+	}
428
+</script>
429
+
430
+<style lang="scss" scoped>
431
+	.login {
432
+		width: 100%;
433
+		height: 100%;
434
+		display: flex;
435
+		flex-direction: column;
436
+		align-items: center;
437
+
438
+		.login_header {
439
+			height: 211rpx;
440
+			margin-top: 74rpx;
441
+			display: flex;
442
+			flex-direction: column;
443
+			justify-content: space-between;
444
+			align-items: center;
445
+
446
+			.login_header_top {
447
+				width: 216rpx;
448
+				height: 242rpx;
449
+
450
+				image {
451
+					width: 100%;
452
+					height: 100%;
453
+				}
454
+			}
455
+
456
+			.login_header_botom {
457
+				width: 156rpx;
458
+				height: 48rpx;
459
+
460
+				image {
461
+					width: 100%;
462
+					height: 100%;
463
+				}
464
+			}
465
+		}
466
+
467
+		.input-home {
468
+			width: 658rpx;
469
+			height: 238rpx;
470
+			margin-top: 67rpx;
471
+			display: flex;
472
+			flex-direction: column;
473
+			align-items: center;
474
+			justify-content: space-between;
475
+
476
+			.input {
477
+				width: 100%;
478
+				height: 118rpx;
479
+				border-bottom: 1rpx solid #E5E5E5;
480
+				position: relative;
481
+
482
+				input {
483
+					width: 485rpx;
484
+					height: 100rpx;
485
+					margin: 20rpx 0 0 10rpx;
486
+					color: #333333;
487
+				}
488
+
489
+				.input_code {
490
+					position: absolute;
491
+					top: 55rpx;
492
+					right: 15rpx;
493
+					font-size: 30rpx;
494
+					font-weight: 400;
495
+				}
496
+			}
497
+		}
498
+
499
+		.login-singn {
500
+			width: 658rpx;
501
+			height: 88rpx;
502
+			background-color: rgba(31, 124, 255, 0.3);
503
+			border-radius: 10rpx;
504
+			margin-top: 70rpx;
505
+			font-size: 30rpx;
506
+			font-weight: 400;
507
+			display: flex;
508
+			justify-content: center;
509
+			align-items: center;
510
+			color: #333333;
511
+		}
512
+
513
+		.unLogin-singn {
514
+			margin-top: 88rpx;
515
+		}
516
+		.bottom-index {
517
+			width: 658rpx;
518
+			height: 33rpx;
519
+			display: flex;
520
+			justify-content: space-between;
521
+			align-items: center;
522
+			margin-top: 60rpx;
523
+
524
+			.bottom-index-in {
525
+				width: 32rpx;
526
+				height: 32rpx;
527
+				line-height: 33rpx;
528
+				transform: sale(2);
529
+				image {
530
+					width: 100%;
531
+					height: 100%;
532
+				}
533
+				margin-right: 20rpx;
534
+				// position: relative;
535
+			}
536
+
537
+			.bottom-index-ri {
538
+				height: 100%;
539
+				font-size: 24rpx;
540
+			}
541
+		}
542
+	}
543
+</style>

+ 30 - 0
project.config.json

@@ -0,0 +1,30 @@
1
+{
2
+    "appid": "touristappid",
3
+    "compileType": "miniprogram",
4
+    "libVersion": "2.25.3",
5
+    "packOptions": {
6
+        "ignore": [],
7
+        "include": []
8
+    },
9
+    "setting": {
10
+        "coverView": true,
11
+        "es6": true,
12
+        "postcss": true,
13
+        "minified": true,
14
+        "enhance": true,
15
+        "showShadowRootInWxmlPanel": true,
16
+        "packNpmRelationList": [],
17
+		"ignoreDevUnusedFiles":false,
18
+		"ignoreUploadUnusedFiles":false,
19
+        "babelSetting": {
20
+            "ignore": [],
21
+            "disablePlugins": [],
22
+            "outputPath": ""
23
+        }
24
+    },
25
+    "condition": {},
26
+    "editorSetting": {
27
+        "tabIndent": "insertSpaces",
28
+        "tabSize": 4
29
+    }
30
+}

+ 7 - 0
project.private.config.json

@@ -0,0 +1,7 @@
1
+{
2
+    "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
3
+    "projectname": "merchantapplet",
4
+    "setting": {
5
+        "compileHotReLoad": true
6
+    }
7
+}

+ 685 - 0
shop/commodity/details.vue

@@ -0,0 +1,685 @@
1
+<template>
2
+	<view class="details">
3
+		<view class="details-header">
4
+			<view class="details-header-text">
5
+				<view class="details-header-text-neishi">
6
+					<view class="details-header-text-icon" @click="topgi">
7
+						<image src="https://cdn.bjtdba.com/vod/image/2022-08-11/20220811133828415.png" mode="widthFix">
8
+						</image>
9
+					</view>
10
+				</view>
11
+
12
+				<view class="details-header-text-title">
13
+					订单详情
14
+				</view>
15
+			</view>
16
+		</view>
17
+		<view class="details-back">
18
+			<image src="https://cdn.bjtdba.com/vod/image/2022-08-13/20220813171413571.png" mode="widthFix"></image>
19
+			<view class="details-back-biaohsi">
20
+				<view class="details-back-biaohsi-kuan">
21
+					<image src="https://cdn.bjtdba.com/vod/image/2022-08-15/20220815143421834.png" mode="widthFix">
22
+					</image>
23
+				</view>
24
+				<view class="details-back-biaohsi-zhuanbgtia">
25
+					<view class="details-back-biaohsi-zhuanbgtia-top">
26
+						{{orderList.status}}
27
+					</view>
28
+					<view class="details-back-biaohsi-zhuanbgtia-bot">
29
+						等待卖家付款
30
+					</view>
31
+				</view>
32
+			</view>
33
+			<view class="details-back-url">
34
+				<view class="order-list-yi-bot-xiangxi">
35
+					<view class="order-list-yi-bot-xiangxier">
36
+						<image src="https://cdn.bjtdba.com/vod/image/2022-08-13/20220813164638215.png" mode="widthFix">
37
+						</image>
38
+					</view>
39
+					<view class="order-list-yi-bot-xadasrfe">
40
+						<view class="order-list-yi-bot-xadasrfe-top">
41
+							{{orderList.user_address}}
42
+						</view>
43
+						<view class="order-list-yi-bot-xadasrfe-bot">
44
+							<view class="">
45
+								{{orderList.real_name}}
46
+							</view>
47
+							<view class="" style="margin-left: 32rpx;">
48
+								{{orderList.user_phone!=undefined?orderList.user_phone.substr(0, 3) + '****' + orderList.user_phone.substr(7):"..."}}
49
+							</view>
50
+						</view>
51
+					</view>
52
+				</view>
53
+			</view>
54
+		</view>
55
+		<!-- details-xiangqing -->
56
+		<view :class="orderList.status=='待发货'?downP:incrseP">
57
+			<view class="details-xiangqing-top">
58
+				<view class="details-xiangqing-top-let">
59
+					<image :src="orderList.mer_avatar" mode="widthFix"></image>
60
+				</view>
61
+				<view class="details-xiangqing-top-in">
62
+					{{orderList.mer_name}}
63
+				</view>
64
+				<view class="details-xiangqing-top-rigt">
65
+					<image src="https://cdn.bjtdba.com/vod/image/2022-08-15/20220815143434822.png" mode="widthFix">
66
+					</image>
67
+				</view>
68
+			</view>
69
+			<view class="details-xiangqing-niri">
70
+				<view class="order-list-yi-in-neibu"  v-for="(item,index) in orderList.procductList" :key="index">
71
+					<view class="order-list-yi-in-neibu-left">
72
+						<view class="order-list-yi-in-neibu-left-img">
73
+							<image :src="item.image" mode="widthFix"></image>
74
+						</view>
75
+						<view class="order-list-yi-in-neibu-left-url">
76
+							<view class="order-list-yi-in-neibu-left-url-top">
77
+								{{item.store_name}}
78
+							</view>
79
+						</view>
80
+					</view>
81
+					<view class="order-list-yi-in-neibu-right">
82
+						<view class="order-list-yi-in-neibu-right-im">
83
+							¥{{item.pay_price}}
84
+						</view>
85
+						<view class="order-list-yi-in-neibu-right-in">
86
+							共{{item.cart_num}}件
87
+						</view>
88
+					</view>
89
+				</view>
90
+				<view v-if="orderList.status=='待发货'?true:false"
91
+					style="margin-top: 26rpx; width: 142rpx;height: 58rpx;border-radius: 30rpx;border: 1rpx solid #999999;font-size: 24rpx;font-weight: 400;color: #333333;text-align: center;line-height: 58rpx;">
92
+					立即发货
93
+				</view>
94
+				<view class="details-xiangqing-shujussss">
95
+					<view class="details-xiangqing-shujussss-yis">
96
+						<view class="">
97
+							商品总额
98
+						</view>
99
+						<view class="">
100
+							+¥{{orderList.pay_price}}
101
+						</view>
102
+					</view>
103
+					<view class="details-xiangqing-shujussss-yis">
104
+						<view class="">
105
+							优惠金额
106
+						</view>
107
+						<view class="">
108
+							-¥0.00
109
+						</view>
110
+					</view>
111
+					<view class="details-xiangqing-shujussss-yis">
112
+						<view class="">
113
+							订单编号
114
+						</view>
115
+						<view class="" @click="copy(orderList.order_id)">
116
+							{{orderList.order_id}} | 复制
117
+						</view>
118
+					</view>
119
+					<view class="details-xiangqing-shujussss-yis">
120
+						<view class="">
121
+							下单时间
122
+						</view>
123
+						<view class="">
124
+							{{orderList.pay_time}}
125
+						</view>
126
+					</view>
127
+					<view class="details-xiangqing-shujussss-yis">
128
+						<view class="">
129
+							支付方式
130
+						</view>
131
+						<view class="">
132
+							{{orderList.pay_type}}
133
+						</view>
134
+					</view>
135
+				</view>
136
+			</view>
137
+		</view>
138
+	</view>
139
+</template>
140
+
141
+<script>
142
+	import {
143
+		getOrderDetails
144
+	} from '@/commit/order.js'
145
+	export default {
146
+		data() {
147
+			return {
148
+				order_id: '', //订单ID
149
+				is_limin: true,
150
+				incrseP: 'details-xiangqing',
151
+				downP: 'details-xiangqingsssss',
152
+				orderList: [],
153
+				indexs: '',
154
+				status: ''
155
+			}
156
+		},
157
+		onLoad(e) {
158
+			this.order_id = e.order_id
159
+			this.indexs = e.indexs
160
+			this.status = e.status
161
+			this.getOrderDetails()
162
+		},
163
+		methods: {
164
+			copy(value) {
165
+				uni.setClipboardData({
166
+					data: value,
167
+					success: function() {
168
+						console.log('success');
169
+					}
170
+				})
171
+			},
172
+			// 订单详情页面
173
+			getOrderDetails() {
174
+				getOrderDetails({
175
+					order_id: this.order_id
176
+				}).then(res => {
177
+					if (res.data.status == 200) {
178
+						this.orderList = res.data.data.order
179
+					}
180
+				}, fail => {
181
+					console.log(fail)
182
+				})
183
+			},
184
+			topgi() {
185
+				uni.redirectTo({
186
+					url: './order?status=' + this.status + '&index=' + this.indexs
187
+					// url: './order'
188
+				});
189
+			}
190
+		}
191
+	}
192
+</script>
193
+
194
+<style>
195
+	page {
196
+		background-color: #F7F8FC;
197
+	}
198
+</style>
199
+<style lang="scss" scoped>
200
+	.details {
201
+		width: 100%;
202
+		height: 100%;
203
+		display: flex;
204
+		flex-direction: column;
205
+		align-items: center;
206
+
207
+		.details-header {
208
+			position: fixed;
209
+			top: 0;
210
+			left: 0;
211
+			z-index: 111;
212
+			width: 100%;
213
+			height: 176rpx;
214
+			background: #FFFFFF;
215
+			display: flex;
216
+			justify-content: center;
217
+
218
+			.details-header-text {
219
+				width: 686rpx;
220
+				font-size: 36rpx;
221
+				font-weight: 500;
222
+				color: #333333;
223
+				display: flex;
224
+				margin-top: 107rpx;
225
+				align-items: center;
226
+
227
+				.details-header-text-neishi {
228
+					width: 45rpx;
229
+					height: 45rpx;
230
+					margin-right: 17rpx;
231
+
232
+					.details-header-text-icon {
233
+						width: 36rpx;
234
+						height: 36rpx;
235
+						margin-top: 2rpx;
236
+
237
+						image {
238
+							width: 100%;
239
+							height: 100%;
240
+						}
241
+					}
242
+				}
243
+			}
244
+		}
245
+
246
+		.details-back {
247
+			width: 100%;
248
+			height: 277rpx;
249
+			margin-top: 176rpx;
250
+			display: flex;
251
+			justify-content: center;
252
+			position: relative;
253
+
254
+			image {
255
+				width: 100%;
256
+				height: 100%;
257
+			}
258
+
259
+			.details-back-biaohsi {
260
+				position: absolute;
261
+				height: 80rpx;
262
+				top: 55rpx;
263
+				left: 43rpx;
264
+				display: flex;
265
+				align-items: flex-start;
266
+
267
+				.details-back-biaohsi-kuan {
268
+					width: 38rpx;
269
+					height: 38rpx;
270
+					margin-top: 6rpx;
271
+
272
+					image {
273
+						width: 100%;
274
+						height: 100%;
275
+					}
276
+				}
277
+
278
+				.details-back-biaohsi-zhuanbgtia {
279
+					display: flex;
280
+					flex-direction: column;
281
+					justify-content: space-between;
282
+					align-items: flex-start;
283
+					margin-left: 8rpx;
284
+
285
+					.details-back-biaohsi-zhuanbgtia-top {
286
+						font-size: 36rpx;
287
+						font-weight: 600;
288
+						color: #FFFFFF;
289
+					}
290
+
291
+					.details-back-biaohsi-zhuanbgtia-bot {
292
+						font-size: 26rpx;
293
+						font-weight: 400;
294
+						color: #FFFFFF;
295
+					}
296
+				}
297
+			}
298
+
299
+			.details-back-url {
300
+				width: 686rpx;
301
+				height: 176rpx;
302
+				background: #FFFFFF;
303
+				border-radius: 16rpx;
304
+				position: absolute;
305
+				top: 189rpx;
306
+				display: flex;
307
+				align-items: center;
308
+				justify-content: center;
309
+
310
+				.order-list-yi-bot-xiangxi {
311
+					width: 634rpx;
312
+					height: 112rpx;
313
+					display: flex;
314
+					align-items: flex-start;
315
+
316
+					.order-list-yi-bot-xiangxier {
317
+						width: 38rpx;
318
+						height: 38rpx;
319
+
320
+						image {
321
+							width: 100%;
322
+							height: 100%;
323
+						}
324
+					}
325
+
326
+					.order-list-yi-bot-xadasrfe {
327
+						width: 544rpx;
328
+						height: 100%;
329
+						margin-left: 16rpx;
330
+						display: flex;
331
+						flex-direction: column;
332
+						justify-content: space-between;
333
+						align-items: flex-start;
334
+
335
+						.order-list-yi-bot-xadasrfe-top {
336
+							width: 100%;
337
+							font-size: 26rpx;
338
+							font-weight: 400;
339
+							color: #333333;
340
+							display: -webkit-box;
341
+							-webkit-box-orient: vertical;
342
+							-webkit-line-clamp: 2;
343
+							overflow: hidden;
344
+						}
345
+
346
+						.order-list-yi-bot-xadasrfe-bot {
347
+							font-size: 28rpx;
348
+							font-weight: 400;
349
+							color: #999999;
350
+							display: flex;
351
+						}
352
+					}
353
+				}
354
+			}
355
+		}
356
+
357
+		.details-xiangqing {
358
+			width: 686rpx;
359
+			// height: 719rpx;
360
+			background: #FFFFFF;
361
+			border-radius: 16px;
362
+			margin-top: 114rpx;
363
+			display: flex;
364
+			flex-direction: column;
365
+			align-items: center;
366
+			margin-bottom: 50rpx;
367
+
368
+			.details-xiangqing-top {
369
+				width: 100%;
370
+				// height: 90rpx;
371
+				padding: 32rpx 0 32rpx 0;
372
+				border-bottom: 1rpx solid #E5E5E5;
373
+				display: flex;
374
+				align-items: center;
375
+				color: #333333;
376
+
377
+				.details-xiangqing-top-let {
378
+					width: 32rpx;
379
+					height: 32rpx;
380
+					font-size: 11rpx;
381
+					font-weight: 400;
382
+					margin-left: 28rpx;
383
+
384
+					image {
385
+						width: 100%;
386
+						height: 100%;
387
+					}
388
+				}
389
+
390
+				.details-xiangqing-top-in {
391
+					width: 364rpx;
392
+					font-size: 28rpx;
393
+					font-weight: 600;
394
+					overflow: hidden;
395
+					text-overflow: ellipsis;
396
+					white-space: nowrap;
397
+					margin-left: 6rpx;
398
+				}
399
+
400
+				.details-xiangqing-top-rigt {
401
+					width: 36rpx;
402
+					height: 36rpx;
403
+					margin-left: 8rpx;
404
+
405
+					image {
406
+						width: 100%;
407
+						height: 100%;
408
+					}
409
+				}
410
+			}
411
+
412
+			.details-xiangqing-niri {
413
+				width: 634rpx;
414
+				// height: 548rpx;
415
+				margin: 26rpx 0 50rpx 0;
416
+				display: flex;
417
+				flex-direction: column;
418
+
419
+				// background-color: orangered;
420
+				.order-list-yi-in-neibu {
421
+					width: 634rpx;
422
+					height: 158rpx;
423
+					display: flex;
424
+					justify-content: space-between;
425
+					align-items: flex-start;
426
+					// background-color: aqua;
427
+					margin: 10rpx 0 10rpx 0;
428
+
429
+					.order-list-yi-in-neibu-left {
430
+						width: 474rpx;
431
+						height: 100%;
432
+						display: flex;
433
+						align-items: flex-start;
434
+						justify-content: space-between;
435
+
436
+						.order-list-yi-in-neibu-left-img {
437
+							width: 158rpx;
438
+							height: 158rpx;
439
+							overflow: hidden;
440
+
441
+							image {
442
+								width: 100%;
443
+								height: 100%;
444
+							}
445
+						}
446
+
447
+						.order-list-yi-in-neibu-left-url {
448
+							width: 290rpx;
449
+							display: flex;
450
+
451
+							.order-list-yi-in-neibu-left-url-top {
452
+								width: 100%;
453
+								font-weight: 400;
454
+								color: #333333;
455
+								font-size: 28rpx;
456
+								display: -webkit-box;
457
+								-webkit-box-orient: vertical;
458
+								-webkit-line-clamp: 2;
459
+								overflow: hidden;
460
+								justify-content: space-between;
461
+							}
462
+
463
+							.order-list-yi-in-neibu-left-url-top-bot {
464
+								width: 100%;
465
+								font-size: 24rpx;
466
+								font-weight: 400;
467
+								color: #666666;
468
+								display: inline-block;
469
+								overflow: hidden;
470
+								text-overflow: ellipsis;
471
+								white-space: nowrap;
472
+							}
473
+						}
474
+					}
475
+
476
+					.order-list-yi-in-neibu-right {
477
+						height: 73rpx;
478
+						font-size: 28rpx;
479
+						font-weight: 500;
480
+						color: #333333;
481
+						display: flex;
482
+						flex-direction: column;
483
+						justify-content: space-between;
484
+						align-items: flex-end;
485
+
486
+						.order-list-yi-in-neibu-right-im {
487
+							font-size: 28rpx;
488
+							font-weight: 500;
489
+							color: #333333;
490
+						}
491
+
492
+						.order-list-yi-in-neibu-right-in {
493
+							font-size: 24rpx;
494
+							font-weight: 400;
495
+							color: #666666;
496
+						}
497
+					}
498
+				}
499
+
500
+				.details-xiangqing-shujussss {
501
+					width: 634rpx;
502
+					height: 340rpx;
503
+					margin-top: 50rpx;
504
+					display: flex;
505
+					flex-direction: column;
506
+					justify-content: space-between;
507
+
508
+					.details-xiangqing-shujussss-yis {
509
+						width: 100%;
510
+						display: flex;
511
+						align-items: center;
512
+						justify-content: space-between;
513
+						font-size: 28rpx;
514
+						font-weight: 400;
515
+						color: #333333;
516
+					}
517
+				}
518
+			}
519
+		}
520
+
521
+		.details-xiangqingsssss {
522
+			width: 686rpx;
523
+			// height: 779rpx;
524
+			background: #FFFFFF;
525
+			border-radius: 16px;
526
+			margin-top: 114rpx;
527
+			display: flex;
528
+			flex-direction: column;
529
+			align-items: center;
530
+			margin-bottom: 50rpx;
531
+
532
+			.details-xiangqing-top {
533
+				width: 100%;
534
+				// height: 90rpx;
535
+				padding: 32rpx 0 32rpx 0;
536
+				border-bottom: 1rpx solid #E5E5E5;
537
+				display: flex;
538
+				align-items: center;
539
+				color: #333333;
540
+
541
+				.details-xiangqing-top-let {
542
+					width: 32rpx;
543
+					height: 32rpx;
544
+					font-size: 11rpx;
545
+					font-weight: 400;
546
+					margin-left: 28rpx;
547
+
548
+					image {
549
+						width: 100%;
550
+						height: 100%;
551
+					}
552
+				}
553
+
554
+				.details-xiangqing-top-in {
555
+					width: 364rpx;
556
+					font-size: 28rpx;
557
+					font-weight: 600;
558
+					overflow: hidden;
559
+					text-overflow: ellipsis;
560
+					white-space: nowrap;
561
+					margin-left: 6rpx;
562
+				}
563
+
564
+				.details-xiangqing-top-rigt {
565
+					width: 36rpx;
566
+					height: 36rpx;
567
+					margin-left: 8rpx;
568
+
569
+					image {
570
+						width: 100%;
571
+						height: 100%;
572
+					}
573
+				}
574
+			}
575
+
576
+			.details-xiangqing-niri {
577
+				width: 634rpx;
578
+				// height: 548rpx;
579
+				margin-top: 26rpx;
580
+				display: flex;
581
+				flex-direction: column;
582
+				align-items: flex-end;
583
+				margin: 26rpx 0 50rpx 0;
584
+
585
+				.order-list-yi-in-neibu {
586
+					width: 634rpx;
587
+					height: 158rpx;
588
+					display: flex;
589
+					justify-content: space-between;
590
+					align-items: flex-start;
591
+					margin: 10rpx 0 10rpx 0;
592
+
593
+					.order-list-yi-in-neibu-left {
594
+						width: 474rpx;
595
+						height: 100%;
596
+						display: flex;
597
+						align-items: flex-start;
598
+						justify-content: space-between;
599
+
600
+						.order-list-yi-in-neibu-left-img {
601
+							width: 158rpx;
602
+							height: 158rpx;
603
+							overflow: hidden;
604
+
605
+							image {
606
+								width: 100%;
607
+								height: 100%;
608
+							}
609
+						}
610
+
611
+						.order-list-yi-in-neibu-left-url {
612
+							width: 290rpx;
613
+							display: flex;
614
+
615
+							.order-list-yi-in-neibu-left-url-top {
616
+								width: 100%;
617
+								font-weight: 400;
618
+								color: #333333;
619
+								font-size: 28rpx;
620
+								display: -webkit-box;
621
+								-webkit-box-orient: vertical;
622
+								-webkit-line-clamp: 2;
623
+								overflow: hidden;
624
+								justify-content: space-between;
625
+							}
626
+
627
+							.order-list-yi-in-neibu-left-url-top-bot {
628
+								width: 100%;
629
+								font-size: 24rpx;
630
+								font-weight: 400;
631
+								color: #666666;
632
+								display: inline-block;
633
+								overflow: hidden;
634
+								text-overflow: ellipsis;
635
+								white-space: nowrap;
636
+							}
637
+						}
638
+					}
639
+
640
+					.order-list-yi-in-neibu-right {
641
+						height: 73rpx;
642
+						font-size: 28rpx;
643
+						font-weight: 500;
644
+						color: #333333;
645
+						display: flex;
646
+						flex-direction: column;
647
+						justify-content: space-between;
648
+						align-items: flex-end;
649
+
650
+						.order-list-yi-in-neibu-right-im {
651
+							font-size: 28rpx;
652
+							font-weight: 500;
653
+							color: #333333;
654
+						}
655
+
656
+						.order-list-yi-in-neibu-right-in {
657
+							font-size: 24rpx;
658
+							font-weight: 400;
659
+							color: #666666;
660
+						}
661
+					}
662
+				}
663
+
664
+				.details-xiangqing-shujussss {
665
+					width: 634rpx;
666
+					height: 340rpx;
667
+					margin-top: 50rpx;
668
+					display: flex;
669
+					flex-direction: column;
670
+					justify-content: space-between;
671
+
672
+					.details-xiangqing-shujussss-yis {
673
+						width: 100%;
674
+						display: flex;
675
+						align-items: center;
676
+						justify-content: space-between;
677
+						font-size: 28rpx;
678
+						font-weight: 400;
679
+						color: #333333;
680
+					}
681
+				}
682
+			}
683
+		}
684
+	}
685
+</style>

+ 676 - 0
shop/commodity/order.vue

@@ -0,0 +1,676 @@
1
+<template>
2
+	<view class="order">
3
+		<view class="order-header">
4
+			<view class="order-header-text">
5
+				<view class="order-header-text-neishi" @click="topgi">
6
+					<view class="order-header-text-icon">
7
+						<image src="https://cdn.bjtdba.com/vod/image/2022-08-11/20220811133828415.png" mode="widthFix">
8
+						</image>
9
+					</view>
10
+				</view>
11
+				<view class="order-header-text-title">
12
+					我的订单
13
+				</view>
14
+			</view>
15
+		</view>
16
+		<view class="order-nbeirong">
17
+			<view class="order-nbeirong-yi" v-for="(item,index) in num" :key="index" @click="ysne(index,item.status)"
18
+				:style="index==indexs?'font-weight: 500;color: #1F7CFF;':'font-weight: 400;color: #333333;'">
19
+				{{item.name}}
20
+				<view class="order-nbeirong-yi-xiabiapo" v-if="index==indexs?true:false">
21
+
22
+				</view>
23
+			</view>
24
+		</view>
25
+		<view class="order-list">
26
+			<view :class="item.status=='待发货'?downP:incrseP" v-for="(item,index) in list" :key="index"
27
+				@click="details(item.order_id)">
28
+				<view class="order-list-yi-top">
29
+					<view class="order-list-yi-top-left">
30
+						订单编号:{{item.order_id}}
31
+					</view>
32
+					<view class="order-list-yi-top-right">
33
+						{{item.status}}
34
+					</view>
35
+				</view>
36
+				<view class="order-list-yi-in">
37
+					<view class="osjdhujfhueihfg">
38
+						<view class="order-list-yi-in-neibu" v-for="(items,indexs) in item.procductList" :key="indexs">
39
+							<view class="order-list-yi-in-neibu-left">
40
+								<view class="order-list-yi-in-neibu-left-img">
41
+									<image :src="items.image" mode="widthFix"></image>
42
+								</view>
43
+								<view class="order-list-yi-in-neibu-left-url">
44
+									<view class="order-list-yi-in-neibu-left-url-top">
45
+										{{items.store_name}}
46
+									</view>
47
+									<view class="order-list-yi-in-neibu-left-url-top-bot">
48
+										{{items.sku}}
49
+									</view>
50
+								</view>
51
+							</view>
52
+							<view class="order-list-yi-in-neibu-right">
53
+								<view class="order-list-yi-in-neibu-right-im">
54
+									¥{{items.pay_price}}
55
+								</view>
56
+								<view class="order-list-yi-in-neibu-right-in">
57
+									共{{items.cart_num}}件
58
+								</view>
59
+							</view>
60
+						</view>
61
+						
62
+						<view class="" v-if="item.status=='待发货'?true:false"
63
+							style="width: 142rpx;height: 58rpx;border-radius: 30rpx;border: 1rpx solid #999999;font-size: 24rpx;font-weight: 400;color: #333333;text-align: center;line-height: 58rpx;">
64
+							立即发货
65
+						</view>
66
+					</view>
67
+				</view>
68
+				<view class="order-list-yi-bot">
69
+					<view class="order-list-yi-bot-xiangxi">
70
+						<view class="order-list-yi-bot-xiangxier">
71
+							<image src="https://cdn.bjtdba.com/vod/image/2022-08-13/20220813164638215.png"
72
+								mode="widthFix"></image>
73
+						</view>
74
+						<view class="order-list-yi-bot-xadasrfe">
75
+							<view class="order-list-yi-bot-xadasrfe-top">
76
+								{{item.user_address}}
77
+							</view>
78
+							<view class="order-list-yi-bot-xadasrfe-bot">
79
+								<view class="">
80
+									{{item.real_name}}
81
+								</view>
82
+								<view class="" style="margin-left: 32rpx;">
83
+									{{item.user_phone.substr(0, 3) + '****' + item.user_phone.substr(7)}}
84
+								</view>
85
+							</view>
86
+						</view>
87
+					</view>
88
+				</view>
89
+			</view>
90
+			<view class="" v-if="tihsi==0" style="margin: 60rpx 0 30rpx 0; color: #999999; font-size: 26rpx;">
91
+				—— 已经到最底部了哦 ——
92
+			</view>
93
+		</view>
94
+	</view>
95
+</template>
96
+
97
+<script>
98
+	import {
99
+		orderList
100
+	} from '@/commit/order.js'
101
+	export default {
102
+		data() {
103
+			return {
104
+				page: 1,
105
+				limit: 10,
106
+				tihsi: '',
107
+				is_panudn: true,
108
+				//uid: 11, //	用户ID 查询用户订单列表需要传
109
+				mer_id: '', //商户ID    查询商户订单列表的时候需要传
110
+				status: '', //0:待发货;1:待收货;2:待评价;3:已完成;4已申请退款;-1:已退款)5未支付WADDW
111
+				indexs: 0,
112
+				// sty: true,
113
+				incrseP: 'order-list-yi',
114
+				downP: 'order-list-yissss',
115
+				list: [],
116
+				num: [{
117
+						name: "待付款",
118
+						status: 5
119
+					},
120
+					{
121
+						name: "待发货",
122
+						status: 0
123
+					},
124
+					{
125
+						name: "待收货",
126
+						status: 1
127
+					},
128
+					{
129
+						name: "待评价",
130
+						status: 2
131
+					},
132
+					// {
133
+					// 	name: "已完成"
134
+					// }
135
+				]
136
+			}
137
+		},
138
+		onLoad(e) {
139
+			let selectmerchant = uni.getStorageSync('selectmerchant')
140
+			this.mer_id = selectmerchant.merId
141
+			this.status = e.status //进入状态
142
+			this.indexs = e.index
143
+			this.orderList()
144
+		},
145
+		onPullDownRefresh() {
146
+			uni.showLoading({
147
+				title: '加载中',
148
+			});
149
+			this.page = 1
150
+			this.is_panudn = true
151
+			this.list = []
152
+			this.orderList();
153
+		},
154
+		onReachBottom() {
155
+			if (this.is_panudn == true) {
156
+				this.page++;
157
+				this.orderList();
158
+			} else {
159
+				return
160
+			}
161
+		},
162
+		methods: {
163
+			// 正向订单列表
164
+			orderList() {
165
+				uni.showLoading({
166
+					title: '加载中',
167
+				});
168
+				orderList({
169
+					pageNum: this.page,
170
+					pageSize: this.limit,
171
+					mer_id: this.mer_id,
172
+					status: this.status
173
+				}).then(res => {
174
+					uni.stopPullDownRefresh();
175
+					if (res.data.status == 200) {
176
+						this.tihsi = res.data.data.pageInfo.list.length
177
+						if (res.data.data.pageInfo.list.length > 0) {
178
+							if (this.page == 1) {
179
+								this.list = res.data.data.pageInfo.list
180
+							} else {
181
+								this.list = this.list.concat(res.data.data.pageInfo.list)
182
+							}
183
+						} else {
184
+							if (this.page == 1) {
185
+								this.list = []
186
+							}
187
+							this.is_panudn = false
188
+						}
189
+						uni.hideLoading();
190
+					}
191
+				}, fail => {
192
+					console.log(fail)
193
+					uni.hideLoading();
194
+				})
195
+			},
196
+			details(e) {
197
+				uni.redirectTo({
198
+					// + "&status=" + this.status + "&indexs=" + this.indexs
199
+					url: './details?order_id=' + e + "&status=" + this.status + "&indexs=" + this.indexs
200
+				});
201
+			},
202
+			ysne(e, i) {
203
+				this.status = i
204
+				this.indexs = e
205
+				this.page = 1
206
+				this.is_panudn = true
207
+				this.orderList()
208
+			},
209
+			topgi() {
210
+				uni.switchTab({
211
+					url: '../../pages/ordermanagement/index'
212
+				});
213
+			},
214
+		}
215
+	}
216
+</script>
217
+
218
+<style>
219
+	page {
220
+		background-color: #F7F8FC;
221
+	}
222
+</style>
223
+<style lang="scss" scoped>
224
+	.order {
225
+		width: 100%;
226
+		height: 100%;
227
+		display: flex;
228
+		flex-direction: column;
229
+		align-items: center;
230
+
231
+		.order-header {
232
+			position: fixed;
233
+			top: 0;
234
+			left: 0;
235
+			z-index: 111;
236
+			width: 100%;
237
+			height: 176rpx;
238
+			background: #FFFFFF;
239
+			display: flex;
240
+			justify-content: center;
241
+
242
+			.order-header-text {
243
+				width: 686rpx;
244
+				font-size: 36rpx;
245
+				font-weight: 500;
246
+				color: #333333;
247
+				display: flex;
248
+				margin-top: 107rpx;
249
+				align-items: center;
250
+
251
+				.order-header-text-neishi {
252
+					width: 45rpx;
253
+					height: 45rpx;
254
+					margin-right: 17rpx;
255
+
256
+					.order-header-text-icon {
257
+						width: 36rpx;
258
+						height: 36rpx;
259
+						margin-top: 2rpx;
260
+
261
+						image {
262
+							width: 100%;
263
+							height: 100%;
264
+						}
265
+					}
266
+				}
267
+			}
268
+		}
269
+
270
+		.order-nbeirong {
271
+			width: 686rpx;
272
+			height: 30rpx;
273
+			margin: 204rpx 0 38rpx 0;
274
+			display: flex;
275
+			justify-content: space-around;
276
+			align-items: center;
277
+
278
+			.order-nbeirong-yi {
279
+				font-size: 30rpx;
280
+				position: relative;
281
+				display: flex;
282
+				justify-content: center;
283
+
284
+				.order-nbeirong-yi-xiabiapo {
285
+					position: absolute;
286
+					top: 45rpx;
287
+					width: 50rpx;
288
+					height: 6rpx;
289
+					background: #1F7CFF;
290
+					border-radius: 3rpx;
291
+				}
292
+			}
293
+		}
294
+
295
+		.order-list {
296
+			width: 100%;
297
+			height: 100%;
298
+			display: flex;
299
+			flex-direction: column;
300
+			align-items: center;
301
+
302
+			.order-list-yi {
303
+				width: 686rpx;
304
+				// height: 472rpx;
305
+				background: #FFFFFF;
306
+				border-radius: 16rpx;
307
+				margin-bottom: 20rpx;
308
+				display: flex;
309
+				flex-direction: column;
310
+				justify-content: space-between;
311
+				align-items: center;
312
+
313
+				.order-list-yi-top {
314
+					width: 100%;
315
+					// height: 90rpx;
316
+					padding: 32rpx 0 32rpx 0;
317
+					border-bottom: 1rpx solid #E5E5E5;
318
+					display: flex;
319
+					justify-content: space-between;
320
+					align-items: center;
321
+					font-size: 26rpx;
322
+
323
+					.order-list-yi-top-left {
324
+						font-weight: 500;
325
+						color: #333333;
326
+						margin-left: 26rpx;
327
+					}
328
+
329
+					.order-list-yi-top-right {
330
+						font-weight: 400;
331
+						color: #1F7CFF;
332
+						margin-right: 26rpx;
333
+					}
334
+				}
335
+
336
+				.order-list-yi-in {
337
+					width: 100%;
338
+					// height: 210rpx;
339
+					padding: 26rpx 0 26rpx 0;
340
+					border-bottom: 1rpx solid #E5E5E5;
341
+					display: flex;
342
+					align-items: center;
343
+					justify-content: center;
344
+
345
+					.order-list-yi-in-neibu {
346
+						width: 634rpx;
347
+						height: 158rpx;
348
+						display: flex;
349
+						margin: 10rpx 0 10rpx 0;
350
+						justify-content: space-between;
351
+						align-items: flex-start;
352
+
353
+						.order-list-yi-in-neibu-left {
354
+							width: 474rpx;
355
+							height: 100%;
356
+							display: flex;
357
+							align-items: flex-start;
358
+							justify-content: space-between;
359
+
360
+							.order-list-yi-in-neibu-left-img {
361
+								width: 158rpx;
362
+								height: 158rpx;
363
+								overflow: hidden;
364
+
365
+								image {
366
+									width: 100%;
367
+									height: 100%;
368
+								}
369
+							}
370
+
371
+							.order-list-yi-in-neibu-left-url {
372
+								width: 290rpx;
373
+								height: 70rpx;
374
+								display: flex;
375
+								flex-direction: column;
376
+								justify-content: space-between;
377
+
378
+								.order-list-yi-in-neibu-left-url-top {
379
+									width: 100%;
380
+									font-weight: 400;
381
+									color: #333333;
382
+									font-size: 28rpx;
383
+									display: inline-block;
384
+									overflow: hidden;
385
+									text-overflow: ellipsis;
386
+									white-space: nowrap;
387
+								}
388
+
389
+								.order-list-yi-in-neibu-left-url-top-bot {
390
+									width: 100%;
391
+									font-size: 24rpx;
392
+									font-weight: 400;
393
+									color: #666666;
394
+									display: inline-block;
395
+									overflow: hidden;
396
+									text-overflow: ellipsis;
397
+									white-space: nowrap;
398
+								}
399
+							}
400
+						}
401
+
402
+						.order-list-yi-in-neibu-right {
403
+							height: 73rpx;
404
+							font-size: 28rpx;
405
+							font-weight: 500;
406
+							color: #333333;
407
+							display: flex;
408
+							flex-direction: column;
409
+							justify-content: space-between;
410
+							align-items: flex-end;
411
+
412
+							.order-list-yi-in-neibu-right-im {
413
+								font-size: 28rpx;
414
+								font-weight: 500;
415
+								color: #333333;
416
+							}
417
+
418
+							.order-list-yi-in-neibu-right-in {
419
+								font-size: 24rpx;
420
+								font-weight: 400;
421
+								color: #666666;
422
+							}
423
+						}
424
+					}
425
+				}
426
+
427
+				.order-list-yi-bot {
428
+					width: 100%;
429
+					// height: 170rpx;
430
+					padding: 26rpx 0 32rpx 0;
431
+					display: flex;
432
+					align-items: center;
433
+					justify-content: center;
434
+
435
+					.order-list-yi-bot-xiangxi {
436
+						width: 634rpx;
437
+						height: 112rpx;
438
+						display: flex;
439
+						align-items: flex-start;
440
+
441
+						.order-list-yi-bot-xiangxier {
442
+							width: 38rpx;
443
+							height: 38rpx;
444
+
445
+							image {
446
+								width: 100%;
447
+								height: 100%;
448
+							}
449
+						}
450
+
451
+						.order-list-yi-bot-xadasrfe {
452
+							width: 544rpx;
453
+							height: 100%;
454
+							margin-left: 16rpx;
455
+							display: flex;
456
+							flex-direction: column;
457
+							justify-content: space-between;
458
+							align-items: flex-start;
459
+
460
+							.order-list-yi-bot-xadasrfe-top {
461
+								width: 100%;
462
+								font-size: 26rpx;
463
+								font-weight: 400;
464
+								color: #333333;
465
+								display: -webkit-box;
466
+								-webkit-box-orient: vertical;
467
+								-webkit-line-clamp: 2;
468
+								overflow: hidden;
469
+							}
470
+
471
+							.order-list-yi-bot-xadasrfe-bot {
472
+								font-size: 28rpx;
473
+								font-weight: 400;
474
+								color: #999999;
475
+								display: flex;
476
+							}
477
+						}
478
+					}
479
+				}
480
+			}
481
+
482
+			.order-list-yissss {
483
+				width: 686rpx;
484
+				// height: 556rpx;
485
+				background: #FFFFFF;
486
+				border-radius: 16rpx;
487
+				margin-bottom: 20rpx;
488
+				display: flex;
489
+				flex-direction: column;
490
+				justify-content: space-between;
491
+				align-items: center;
492
+
493
+				.order-list-yi-top {
494
+					width: 100%;
495
+					// height: 90rpx;
496
+					padding: 32rpx 0 32rpx 0;
497
+					border-bottom: 1rpx solid #E5E5E5;
498
+					display: flex;
499
+					justify-content: space-between;
500
+					align-items: center;
501
+					font-size: 26rpx;
502
+
503
+					.order-list-yi-top-left {
504
+						font-weight: 500;
505
+						color: #333333;
506
+						margin-left: 26rpx;
507
+					}
508
+
509
+					.order-list-yi-top-right {
510
+						font-weight: 400;
511
+						color: #1F7CFF;
512
+						margin-right: 26rpx;
513
+					}
514
+				}
515
+
516
+				.order-list-yi-in {
517
+					width: 100%;
518
+					// height: 294rpx;
519
+					border-bottom: 1rpx solid #E5E5E5;
520
+					display: flex;
521
+					align-items: center;
522
+					justify-content: center;
523
+					padding: 26rpx 0 26rpx 0;
524
+
525
+					.osjdhujfhueihfg {
526
+						width: 634rpx;
527
+						// height: 272rpx;
528
+
529
+						display: flex;
530
+						flex-direction: column;
531
+						justify-content: space-between;
532
+						align-items: flex-end;
533
+
534
+
535
+						.order-list-yi-in-neibu {
536
+							width: 634rpx;
537
+							height: 158rpx;
538
+							// background-color: #1F7CFF;
539
+							display: flex;
540
+							justify-content: space-between;
541
+							align-items: flex-start;
542
+							padding: 10rpx 0 10rpx 0;
543
+
544
+							.order-list-yi-in-neibu-left {
545
+								width: 474rpx;
546
+								height: 100%;
547
+								display: flex;
548
+								align-items: flex-start;
549
+								justify-content: space-between;
550
+
551
+								.order-list-yi-in-neibu-left-img {
552
+									width: 158rpx;
553
+									height: 158rpx;
554
+									// background-color: #1F7CFF;
555
+									overflow: hidden;
556
+
557
+									image {
558
+										width: 100%;
559
+										height: auto;
560
+									}
561
+								}
562
+
563
+								.order-list-yi-in-neibu-left-url {
564
+									width: 290rpx;
565
+									height: 70rpx;
566
+									display: flex;
567
+									flex-direction: column;
568
+									justify-content: space-between;
569
+
570
+									.order-list-yi-in-neibu-left-url-top {
571
+										width: 100%;
572
+										font-weight: 400;
573
+										color: #333333;
574
+										font-size: 28rpx;
575
+										display: inline-block;
576
+										overflow: hidden;
577
+										text-overflow: ellipsis;
578
+										white-space: nowrap;
579
+									}
580
+
581
+									.order-list-yi-in-neibu-left-url-top-bot {
582
+										width: 100%;
583
+										font-size: 24rpx;
584
+										font-weight: 400;
585
+										color: #666666;
586
+										display: inline-block;
587
+										overflow: hidden;
588
+										text-overflow: ellipsis;
589
+										white-space: nowrap;
590
+									}
591
+								}
592
+							}
593
+
594
+							.order-list-yi-in-neibu-right {
595
+								height: 73rpx;
596
+								font-size: 28rpx;
597
+								font-weight: 500;
598
+								color: #333333;
599
+								display: flex;
600
+								flex-direction: column;
601
+								justify-content: space-between;
602
+								align-items: flex-end;
603
+
604
+								.order-list-yi-in-neibu-right-im {
605
+									font-size: 28rpx;
606
+									font-weight: 500;
607
+									color: #333333;
608
+								}
609
+
610
+								.order-list-yi-in-neibu-right-in {
611
+									font-size: 24rpx;
612
+									font-weight: 400;
613
+									color: #666666;
614
+								}
615
+							}
616
+						}
617
+					}
618
+
619
+				}
620
+
621
+				.order-list-yi-bot {
622
+					width: 100%;
623
+					height: 170rpx;
624
+					display: flex;
625
+					align-items: center;
626
+					justify-content: center;
627
+
628
+					.order-list-yi-bot-xiangxi {
629
+						width: 634rpx;
630
+						height: 112rpx;
631
+						display: flex;
632
+						align-items: flex-start;
633
+
634
+						.order-list-yi-bot-xiangxier {
635
+							width: 38rpx;
636
+							height: 38rpx;
637
+
638
+							image {
639
+								width: 100%;
640
+								height: 100%;
641
+							}
642
+						}
643
+
644
+						.order-list-yi-bot-xadasrfe {
645
+							width: 544rpx;
646
+							height: 100%;
647
+							margin-left: 16rpx;
648
+							display: flex;
649
+							flex-direction: column;
650
+							justify-content: space-between;
651
+							align-items: flex-start;
652
+
653
+							.order-list-yi-bot-xadasrfe-top {
654
+								width: 100%;
655
+								font-size: 26rpx;
656
+								font-weight: 400;
657
+								color: #333333;
658
+								display: -webkit-box;
659
+								-webkit-box-orient: vertical;
660
+								-webkit-line-clamp: 2;
661
+								overflow: hidden;
662
+							}
663
+
664
+							.order-list-yi-bot-xadasrfe-bot {
665
+								font-size: 28rpx;
666
+								font-weight: 400;
667
+								color: #999999;
668
+								display: flex;
669
+							}
670
+						}
671
+					}
672
+				}
673
+			}
674
+		}
675
+	}
676
+</style>

+ 188 - 0
shop/department/management.vue

@@ -0,0 +1,188 @@
1
+<template>
2
+	<view class="management">
3
+		<view class="management-header">
4
+			<view class="management-header-text">
5
+				<view class="management-header-text-neishi" @click="topgi">
6
+					<view class="management-header-text-icon">
7
+						<image src="https://cdn.bjtdba.com/vod/image/2022-08-11/20220811133828415.png" mode="widthFix">
8
+						</image>
9
+					</view>
10
+				</view>
11
+
12
+				<view class="management-header-text-title">
13
+					部门管理
14
+				</view>
15
+			</view>
16
+		</view>
17
+		<view class="management-bumen">
18
+			<view class="management-bumen-text">
19
+				添加部门
20
+			</view>
21
+			<view class="management-bumen-icon" @click="tinjia">
22
+				<image src="https://cdn.bjtdba.com/vod/image/2022-08-11/20220811165146454.png" mode="widthFix"></image>
23
+			</view>
24
+		</view>
25
+		<view class="management-list">
26
+			<view class="kuil" v-for="(item,index) in systemRoleList" :key="index">
27
+				<view class="kuil-left">
28
+					部门
29
+				</view>
30
+				<view class="kuil-right">
31
+					{{item.branch}}
32
+				</view>
33
+			</view>
34
+		</view>
35
+	</view>
36
+</template>
37
+
38
+<script>
39
+	import {
40
+		queryStoreBranchBymerid
41
+	} from '@/commit/api.js'
42
+	export default {
43
+		data() {
44
+			return {
45
+				merid: '',
46
+				systemRoleList: []
47
+			}
48
+		},
49
+		onLoad() {
50
+			let selectmerchant = uni.getStorageSync('selectmerchant')
51
+			this.merid = selectmerchant.merId
52
+			this.queryStoreBranchBymerid()
53
+		},
54
+		methods: {
55
+			//根据门店查询所有部门
56
+			queryStoreBranchBymerid() {
57
+				queryStoreBranchBymerid({
58
+					merId: this.merid
59
+				}).then(res => {
60
+					if (res.data.status == 200) {
61
+						this.systemRoleList = res.data.data.systemRoleList
62
+					}
63
+				}, fail => {
64
+					console.log(fail)
65
+				})
66
+			},
67
+			topgi() {
68
+				uni.switchTab({
69
+					url: '../../pages/storemanagement/index'
70
+				});
71
+			},
72
+			tinjia() {
73
+				uni.redirectTo({
74
+					url: '/shop/department/managementadd'
75
+				});
76
+			}
77
+		}
78
+	}
79
+</script>
80
+
81
+<style>
82
+	page {
83
+		background-color: #F7F8FC;
84
+	}
85
+</style>
86
+<style lang="scss" scoped>
87
+	.management {
88
+		width: 100%;
89
+		height: 100%;
90
+		display: flex;
91
+		flex-direction: column;
92
+		align-items: center;
93
+
94
+		.management-header {
95
+			position: fixed;
96
+			top: 0;
97
+			left: 0;
98
+			z-index: 111;
99
+			width: 100%;
100
+			height: 176rpx;
101
+			background: #FFFFFF;
102
+			display: flex;
103
+			justify-content: center;
104
+
105
+			.management-header-text {
106
+				width: 686rpx;
107
+				font-size: 36rpx;
108
+				font-weight: 500;
109
+				color: #333333;
110
+				display: flex;
111
+				margin-top: 107rpx;
112
+				align-items: center;
113
+
114
+				.management-header-text-neishi {
115
+					width: 45rpx;
116
+					height: 45rpx;
117
+					margin-right: 17rpx;
118
+
119
+					.management-header-text-icon {
120
+						width: 36rpx;
121
+						height: 36rpx;
122
+						margin-top: 2rpx;
123
+
124
+						image {
125
+							width: 100%;
126
+							height: 100%;
127
+						}
128
+					}
129
+
130
+				}
131
+
132
+			}
133
+		}
134
+
135
+		.management-bumen {
136
+			width: 686rpx;
137
+			font-size: 32rpx;
138
+			font-weight: 400;
139
+			color: #333333;
140
+			display: flex;
141
+			justify-content: flex-start;
142
+			align-items: center;
143
+			margin: 202rpx 0 32rpx 0;
144
+
145
+			.management-bumen-icon {
146
+				width: 28rpx;
147
+				height: 28rpx;
148
+				margin-left: 12rpx;
149
+				line-height: 28rpx;
150
+
151
+				image {
152
+					width: 100%;
153
+					height: 100%;
154
+				}
155
+			}
156
+		}
157
+
158
+		.management-list {
159
+			width: 100%;
160
+			height: 100%;
161
+			display: flex;
162
+			flex-direction: column;
163
+			align-items: center;
164
+
165
+			.kuil {
166
+				display: flex;
167
+				align-items: center;
168
+				justify-content: space-between;
169
+				width: 686rpx;
170
+				height: 118rpx;
171
+				background: #FFFFFF;
172
+				border-radius: 8rpx;
173
+				margin-bottom: 26rpx;
174
+				font-size: 30rpx;
175
+				font-weight: 400;
176
+				color: #333333;
177
+
178
+				.kuil-left {
179
+					margin-left: 32rpx;
180
+				}
181
+
182
+				.kuil-right {
183
+					margin-right: 32rpx;
184
+				}
185
+			}
186
+		}
187
+	}
188
+</style>

+ 262 - 0
shop/department/managementadd.vue

@@ -0,0 +1,262 @@
1
+<template>
2
+	<view class="managementadd">
3
+		<view class="managementadd-header">
4
+			<view class="managementadd-header-text">
5
+
6
+				<view class="managementadd-header-text-neishi">
7
+					<view class="managementadd-header-text-icon" @click="topgi">
8
+						<image src="https://cdn.bjtdba.com/vod/image/2022-08-11/20220811133828415.png" mode="widthFix">
9
+						</image>
10
+					</view>
11
+				</view>
12
+
13
+				<view class="managementadd-header-text-title">
14
+					添加部门
15
+				</view>
16
+			</view>
17
+		</view>
18
+		<view class="managementadd-list">
19
+			<view class="managementadd-list-let">
20
+				部门
21
+			</view>
22
+			<view class="managementadd-list-rig">
23
+				<input class="uni-input" focus="true" placeholder="请填写" v-model="from.branch" style="text-align:right"
24
+					placeholder-class="plaClss" placeholder-style="color:#333333;font-size:30rpx" />
25
+			</view>
26
+		</view>
27
+		<view class="managementadd-title">
28
+			部门权限
29
+		</view>
30
+		<view class="managementadd-neirong">
31
+			<!-- <radio-group @change="radioChange"> -->
32
+			<label style="" v-for="(item, index) in jurisdictionList" :key="index" @click="oncliki(item)"
33
+				style="display: flex;">
34
+				<view style="margin:32rpx 0 22rpx 32rpx">
35
+					<radio :value="item.name" color="#1F7CFF" :checked="item.checked" />
36
+				</view>
37
+				<view style="margin:32rpx 0 22rpx 32rpx">{{item.name}}</view>
38
+			</label>
39
+			<!-- </radio-group> -->
40
+		</view>
41
+
42
+
43
+		<view class="managementadd-annkiu" @click="addto">
44
+			确认添加
45
+		</view>
46
+	</view>
47
+</template>
48
+
49
+<script>
50
+	import {
51
+		addStoreBranch,
52
+		queryJurisdiction
53
+	} from '@/commit/api.js'
54
+	export default {
55
+		data() {
56
+			return {
57
+				jurisdictionList: [],
58
+				current: false,
59
+				from: {
60
+					merId: "330",
61
+					branch: "",
62
+					jurisdiction: ""
63
+				},
64
+				jurisdictionId: []
65
+
66
+			}
67
+		},
68
+		onLoad() {
69
+			let selectmerchant = uni.getStorageSync('selectmerchant')
70
+			this.from.merId = selectmerchant.merId
71
+			this.jurisdiction()
72
+		},
73
+		methods: {
74
+			//查询所有权限
75
+			jurisdiction() {
76
+				queryJurisdiction().then(res => {
77
+					if (res.data.status == 200) {
78
+						this.jurisdictionList = res.data.data.jurisdictionList
79
+					}
80
+				}, fail => {
81
+					console.log(fail)
82
+				})
83
+			},
84
+			//添加部门
85
+			addto() {
86
+				let jurisdictionId = this.jurisdictionId
87
+				this.from.jurisdiction = jurisdictionId.toString()
88
+				if (this.from.branch == "") {
89
+					uni.showToast({
90
+						title: "请选择部门",
91
+						icon: 'none'
92
+					})
93
+				} else if (this.from.jurisdiction == "") {
94
+					uni.showToast({
95
+						title: "请选择部门权限",
96
+						icon: 'none'
97
+					})
98
+				} else {
99
+					addStoreBranch(this.from).then(res => {
100
+						if (res.data.status == 200) {
101
+							uni.showToast({
102
+								title: res.data.message,
103
+								icon: 'success',
104
+							})
105
+							setTimeout(function() {
106
+								uni.redirectTo({
107
+									url: "/shop/department/management"
108
+								})
109
+							}, 600);
110
+						}
111
+					}, fail => {
112
+						console.log(fail)
113
+					})
114
+				}
115
+			},
116
+			oncliki(e) {
117
+				let tath = this
118
+				let id = e.id;
119
+				let a = this.jurisdictionList
120
+				let array = this.jurisdictionId
121
+				a.forEach((item,index) => {
122
+					if (id == item.id) {
123
+						if (item.checked == true) {
124
+							item.checked = false
125
+							array.forEach((itms,inds)=>{
126
+								if(id == itms){
127
+									array.splice(inds, 1);
128
+								}
129
+							})
130
+						} else {
131
+							item.checked = true
132
+							array.push(item.id)
133
+						}
134
+						return item
135
+					}
136
+				})
137
+				this.jurisdictionList = []
138
+				this.jurisdictionList = a
139
+				this.jurisdictionId = array
140
+			},
141
+			topgi() {
142
+				uni.redirectTo({
143
+					url: './management'
144
+				});
145
+			}
146
+		}
147
+	}
148
+</script>
149
+
150
+<style>
151
+	page {
152
+		background-color: #F7F8FC;
153
+	}
154
+
155
+	.plaClss {
156
+		text-align: right;
157
+	}
158
+</style>
159
+<style lang="scss" scoped>
160
+	.managementadd {
161
+		width: 100%;
162
+		height: 100%;
163
+		display: flex;
164
+		flex-direction: column;
165
+		align-items: center;
166
+
167
+		.managementadd-header {
168
+			position: fixed;
169
+			top: 0;
170
+			left: 0;
171
+			z-index: 111;
172
+			width: 100%;
173
+			height: 176rpx;
174
+			background: #FFFFFF;
175
+			display: flex;
176
+			justify-content: center;
177
+
178
+			.managementadd-header-text {
179
+				width: 686rpx;
180
+				font-size: 36rpx;
181
+				font-weight: 500;
182
+				color: #333333;
183
+				display: flex;
184
+				margin-top: 107rpx;
185
+				align-items: center;
186
+
187
+				.managementadd-header-text-neishi {
188
+					width: 45rpx;
189
+					height: 45rpx;
190
+					margin-right: 17rpx;
191
+
192
+					.managementadd-header-text-icon {
193
+						width: 36rpx;
194
+						height: 36rpx;
195
+						margin-top: 2rpx;
196
+
197
+						image {
198
+							width: 100%;
199
+							height: 100%;
200
+						}
201
+					}
202
+				}
203
+			}
204
+		}
205
+
206
+		.managementadd-list {
207
+			width: 686rpx;
208
+			height: 118rpx;
209
+			background: #FFFFFF;
210
+			border-radius: 8rpx;
211
+			margin: 202rpx 0 32rpx 0;
212
+			display: flex;
213
+			justify-content: space-between;
214
+			align-items: center;
215
+			font-size: 30rpx;
216
+			font-weight: 400;
217
+			color: #333333;
218
+
219
+			.managementadd-list-let {
220
+				margin-left: 32rpx;
221
+			}
222
+
223
+			.managementadd-list-rig {
224
+				margin-right: 32rpx;
225
+
226
+				input {
227
+					width: 200rpx;
228
+				}
229
+			}
230
+		}
231
+
232
+		.managementadd-title {
233
+			width: 686rpx;
234
+			margin: 32rpx 0 26rpx 0;
235
+			font-size: 32rpx;
236
+			font-weight: 500;
237
+			color: #333333;
238
+		}
239
+
240
+		.managementadd-neirong {
241
+			width: 686rpx;
242
+			height: 100%;
243
+			background: #FFFFFF;
244
+			border-radius: 8rpx;
245
+
246
+		}
247
+
248
+		.managementadd-annkiu {
249
+			width: 686rpx;
250
+			height: 98rpx;
251
+			background: #1F7CFF;
252
+			border-radius: 8rpx;
253
+			position: fixed;
254
+			bottom: 94rpx;
255
+			font-size: 36rpx;
256
+			font-weight: 400;
257
+			color: #FFFFFF;
258
+			text-align: center;
259
+			line-height: 98rpx;
260
+		}
261
+	}
262
+</style>

+ 280 - 0
shop/employee/list.vue

@@ -0,0 +1,280 @@
1
+<template>
2
+	<view class="list">
3
+		<view class="list-header">
4
+			<view class="list-header-text">
5
+				<view class="list-header-text-neishi" @click="topgi">
6
+					<view class="list-header-text-icon">
7
+						<image src="https://cdn.bjtdba.com/vod/image/2022-08-11/20220811133828415.png" mode="widthFix">
8
+						</image>
9
+					</view>
10
+				</view>
11
+
12
+				<view class="list-header-text-title">
13
+					员工管理
14
+				</view>
15
+			</view>
16
+		</view>
17
+		<view class="list-bumen">
18
+			<view class="list-bumen-text">
19
+				添加员工
20
+			</view>
21
+			<view class="list-bumen-icon" @click="tinjia">
22
+				<image src="https://cdn.bjtdba.com/vod/image/2022-08-11/20220811165146454.png" mode="widthFix"></image>
23
+			</view>
24
+		</view>
25
+		<view class="list-neilist">
26
+			<view class="list-neilist-nibu" v-for="(item,index) in list" :key="index">
27
+				<view class="nribyu">
28
+					<view class="nribyu-left">
29
+						<view class="nribyu-left-icon">
30
+							<image :src="item.avatar" mode="widthFix"></image>
31
+						</view>
32
+						<view class="nribyu-left-jias">
33
+							<view class="">
34
+								部 门: {{item.departmentName}}
35
+							</view>
36
+							<view class="">
37
+								姓 名: {{item.name}}
38
+							</view>
39
+							<view class="">
40
+								手机号: {{item.phone.substr(0, 3) + '****' + item.phone.substr(7)}}
41
+							</view>
42
+							<!-- 	<view class="">
43
+								密 码:
44
+							</view> -->
45
+						</view>
46
+					</view>
47
+					<view class="nribyu-right">
48
+						<view class="nribyu-right-img">
49
+							<image src="https://cdn.bjtdba.com/vod/image/2022-08-12/20220812110126708.png"
50
+								mode="widthFix"></image>
51
+						</view>
52
+						<view class="" @click="Update(item)">
53
+							编辑
54
+						</view>
55
+					</view>
56
+				</view>
57
+			</view>
58
+		</view>
59
+	</view>
60
+</template>
61
+
62
+<script>
63
+	import {
64
+		queryStoreStaff
65
+	} from '@/commit/api.js'
66
+	export default {
67
+		data() {
68
+			return {
69
+				merId: '',
70
+				list: []
71
+			}
72
+		},
73
+		onLoad() {
74
+			let selectmerchant = uni.getStorageSync('selectmerchant')
75
+			this.merId = selectmerchant.merId
76
+			this.queryStoreStaff()
77
+		},
78
+		methods: {
79
+			// 根据部门id查询所有员工
80
+			queryStoreStaff() {
81
+				queryStoreStaff({
82
+					merId: this.merId
83
+				}).then(res => {
84
+					console.log(res.data.data, 99)
85
+					if (res.data.status == 200) {
86
+						this.list = res.data.data.storeStaffList
87
+					}
88
+				}, fail => {
89
+					console.log(fail)
90
+				})
91
+			},
92
+			// 修改门店员工信息
93
+			Update(e) {
94
+				console.log(e)
95
+				let id = e.id
96
+				let merId = e.merId
97
+				let name = e.name
98
+				let phone = e.phone
99
+				let department = e.department
100
+				let departmentName = e.departmentName
101
+				uni.redirectTo({
102
+					url: './listadd?id=' + id + "&merId=" + merId + "&name=" + name + "&phone=" + phone +
103
+						"&department=" + department + "&departmentName=" + departmentName + "&can=" +
104
+						1
105
+				});
106
+			},
107
+			tinjia() {
108
+				uni.redirectTo({
109
+					url: './listadd'
110
+				});
111
+			},
112
+			topgi() {
113
+				uni.switchTab({
114
+					url: '../../pages/storemanagement/index'
115
+				});
116
+			}
117
+		}
118
+	}
119
+</script>
120
+
121
+<style>
122
+	page {
123
+		background-color: #F7F8FC;
124
+	}
125
+</style>
126
+<style lang="scss" scoped>
127
+	.list {
128
+		width: 100%;
129
+		height: 100%;
130
+		display: flex;
131
+		flex-direction: column;
132
+		align-items: center;
133
+
134
+		.list-header {
135
+
136
+			width: 100%;
137
+			height: 176rpx;
138
+			background: #FFFFFF;
139
+			position: fixed;
140
+			top: 0;
141
+			left: 0;
142
+			z-index: 111;
143
+			display: flex;
144
+			justify-content: center;
145
+
146
+			.list-header-text {
147
+				width: 686rpx;
148
+				font-size: 36rpx;
149
+				font-weight: 500;
150
+				color: #333333;
151
+				display: flex;
152
+				margin-top: 107rpx;
153
+				align-items: center;
154
+
155
+				.list-header-text-neishi {
156
+					width: 45rpx;
157
+					height: 45rpx;
158
+					margin-right: 17rpx;
159
+
160
+					.list-header-text-icon {
161
+						width: 36rpx;
162
+						height: 36rpx;
163
+						margin-top: 2rpx;
164
+
165
+						image {
166
+							width: 100%;
167
+							height: 100%;
168
+						}
169
+					}
170
+				}
171
+			}
172
+		}
173
+
174
+		.list-bumen {
175
+			width: 686rpx;
176
+			font-size: 32rpx;
177
+			font-weight: 400;
178
+			color: #333333;
179
+			display: flex;
180
+			justify-content: flex-start;
181
+			align-items: center;
182
+			margin: 202rpx 0 32rpx 0;
183
+
184
+			.list-bumen-icon {
185
+				width: 28rpx;
186
+				height: 28rpx;
187
+				margin-left: 12rpx;
188
+				line-height: 28rpx;
189
+
190
+				image {
191
+					width: 100%;
192
+					height: 100%;
193
+				}
194
+			}
195
+		}
196
+
197
+		.list-neilist {
198
+			width: 100%;
199
+			height: 100%;
200
+			display: flex;
201
+			flex-direction: column;
202
+			align-items: center;
203
+
204
+			.list-neilist-nibu {
205
+				display: flex;
206
+				align-items: center;
207
+				justify-content: center;
208
+				width: 686rpx;
209
+				height: 232rpx;
210
+				background: #FFFFFF;
211
+				border-radius: 8rpx;
212
+				margin-bottom: 26rpx;
213
+
214
+				.nribyu {
215
+					width: 640rpx;
216
+					height: 180rpx;
217
+					display: flex;
218
+					align-items: flex-start;
219
+					justify-content: space-between;
220
+
221
+					.nribyu-left {
222
+						width: 532rpx;
223
+						height: 100%;
224
+						display: flex;
225
+						justify-content: space-between;
226
+						align-items: center;
227
+
228
+						.nribyu-left-icon {
229
+							width: 180rpx;
230
+							height: 180rpx;
231
+							border-radius: 12rpx;
232
+
233
+							image {
234
+								width: 100%;
235
+								height: 100%;
236
+								height: 100%;
237
+								border-radius: 12rpx;
238
+								overflow: hidden;
239
+							}
240
+						}
241
+
242
+						.nribyu-left-jias {
243
+							width: 327rpx;
244
+							height: 100%;
245
+							display: flex;
246
+							flex-direction: column;
247
+							justify-content: space-between;
248
+							align-content: flex-start;
249
+							font-size: 30rpx;
250
+							font-weight: 400;
251
+							color: #333333;
252
+						}
253
+					}
254
+
255
+					.nribyu-right {
256
+						width: 86rpx;
257
+						height: 26rpx;
258
+						display: flex;
259
+						justify-content: space-between;
260
+						align-items: center;
261
+						font-size: 26rpx;
262
+						font-weight: 400;
263
+						color: #333333;
264
+
265
+						.nribyu-right-img {
266
+							width: 26rpx;
267
+							height: 26rpx;
268
+							line-height: 26rpx;
269
+
270
+							image {
271
+								width: 100%;
272
+								height: 100%;
273
+							}
274
+						}
275
+					}
276
+				}
277
+			}
278
+		}
279
+	}
280
+</style>

+ 328 - 0
shop/employee/listadd.vue

@@ -0,0 +1,328 @@
1
+<template>
2
+	<view class="listadd">
3
+		<view class="listadd-header">
4
+			<view class="listadd-header-text">
5
+				<view class="listadd-header-text-neishi">
6
+					<view class="listadd-header-text-icon" @click="topgi">
7
+						<image src="https://cdn.bjtdba.com/vod/image/2022-08-11/20220811133828415.png" mode="widthFix">
8
+						</image>
9
+					</view>
10
+				</view>
11
+				<view class="listadd-header-text-title">
12
+					{{can==""?'添加员工':'编辑员工'}}
13
+				</view>
14
+			</view>
15
+		</view>
16
+		<view class="listadd-list" style="margin-top: 206rpx;">
17
+			<view class="listadd-list-let">
18
+				姓名
19
+			</view>
20
+			<view class="listadd-list-rig">
21
+				<input class="uni-input" style="text-align:right" focus="true" v-model="from.name" placeholder="请填写"
22
+					maxlength="6" placeholder-style="color:#333333;font-size:30rpx;" />
23
+			</view>
24
+		</view>
25
+		<view class="listadd-list">
26
+			<view class="listadd-list-let">
27
+				部门
28
+			</view>
29
+			<view class="listadd-list-rig">
30
+				<picker class="#1F7CFF" @change="bindPickerChange" :value="index" :range="array">
31
+					<!-- &&array[index]=="请选择" -->
32
+					<view class="uni-input">{{departmentName}}</view>
33
+				</picker>
34
+			</view>
35
+		</view>
36
+		<view class="listadd-list">
37
+			<view class="listadd-list-let">
38
+				手机号
39
+			</view>
40
+			<view class="listadd-list-rig">
41
+				<input class="uni-input" placeholder="请填写" maxlength="11" style="text-align:right"
42
+					placeholder-style="color:#333333;font-size:30rpx;" v-model="from.phone" @input="inputphone" />
43
+			</view>
44
+		</view>
45
+		<view class="listadd-buxiugai">
46
+			手机号为员工登录账号,不可修改
47
+		</view>
48
+		<view class="listadd-annkiu" @click="addto">
49
+			{{can==""?'确认添加':'保存'}}
50
+		</view>
51
+	</view>
52
+</template>
53
+
54
+<script>
55
+	import {
56
+		storeStafAdd,
57
+		queryStoreBranchBymerid,
58
+		updateStoreStaff
59
+	} from '@/commit/api.js'
60
+	export default {
61
+		data() {
62
+			return {
63
+				can: "",
64
+				merId: '',
65
+				showPassword: true,
66
+				array: ["请选择"],
67
+				arrayid: ["1"],
68
+				index: 0,
69
+				from: {
70
+					name: "", //员工名称
71
+					department: "", //部门id
72
+					phone: "", //手机号
73
+					merId: "", //门店id
74
+					// pawss: "" //密码
75
+				},
76
+				departmentName: "请选择",
77
+				id: "",
78
+			}
79
+		},
80
+		onLoad(e) {
81
+			let selectmerchant = uni.getStorageSync('selectmerchant')
82
+			this.merId = selectmerchant.merId
83
+			this.from.merId = selectmerchant.merId
84
+			this.queryStoreBranchBymerid()
85
+			this.can = e.can
86
+			if (e.can == 1) {
87
+				console.log(e.department)
88
+				this.id = e.id
89
+				this.from.name = e.name
90
+				this.from.phone = e.phone
91
+				this.from.department = e.department
92
+				this.departmentName = e.departmentName
93
+				console.log(this.departmentName)
94
+			}
95
+		},
96
+		methods: {
97
+			inputphone(e) {
98
+				const o = e.target;
99
+				const inputRule = /[^\d]/g
100
+				this.$nextTick(function() {
101
+					this.from.phone = o.value.replace(inputRule, '');
102
+				})
103
+			},
104
+			inputpawss(e) {
105
+				const o = e.target;
106
+				const inputRule = /[^\w_]/g
107
+				this.$nextTick(function() {
108
+					this.from.pawss = o.value.replace(inputRule, '');
109
+				})
110
+			},
111
+			// 根据门店查询所有部门
112
+			queryStoreBranchBymerid() {
113
+				queryStoreBranchBymerid({
114
+					merId: this.merId
115
+				}).then(res => {
116
+					if (res.data.status == 200) {
117
+						let indexS = 0
118
+						res.data.data.systemRoleList.forEach((res => {
119
+							if (this.from.department == res.id) {
120
+								this.index = indexS + 1
121
+							}
122
+							this.array.push(res.branch)
123
+							this.arrayid.push(res.id)
124
+							indexS++
125
+						}))
126
+					}
127
+				}, fail => {
128
+					console.log(fail)
129
+				})
130
+			},
131
+
132
+			//添加员工
133
+			addto() {
134
+				var mobileReg = /^1[3456789]\d{9}$/;
135
+				if (this.from.name == "") {
136
+					uni.showToast({
137
+						title: "请填写姓名",
138
+						icon: 'none'
139
+					})
140
+					console.log(this.arrayid)
141
+				} else if (this.from.department == "" || this.from.department == 1) {
142
+					uni.showToast({
143
+						title: "请选择部门",
144
+						icon: 'none'
145
+					})
146
+				} else if (this.from.phone == "") {
147
+					uni.showToast({
148
+						title: "请填写手机号",
149
+						icon: 'none'
150
+					})
151
+				} else if (!mobileReg.test(this.from.phone)) {
152
+					uni.showToast({
153
+						title: "手机号格式有误",
154
+						icon: "none"
155
+					})
156
+				} else {
157
+					if (this.can == undefined) {
158
+						storeStafAdd(this.from).then(res => {
159
+							if (res.data.status == 200) {
160
+								uni.showToast({
161
+									title: res.data.message,
162
+									icon: 'success',
163
+								})
164
+								setTimeout(function() {
165
+									uni.redirectTo({
166
+										url: "/shop/employee/list"
167
+									})
168
+								}, 600);
169
+							}
170
+
171
+						}, fail => {
172
+							console.log(fail)
173
+						})
174
+					} else if (this.can == 1) {
175
+						// 修改门店员工信息
176
+						let department = this.from.department
177
+						let name = this.from.name
178
+						let phone = this.from.phone
179
+						let id = this.id
180
+						updateStoreStaff({
181
+							department: department,
182
+							name: name,
183
+							phone: phone,
184
+							id: id
185
+						}).then(res => {
186
+							if (res.data.status == 200) {
187
+								uni.showToast({
188
+									title: res.data.message,
189
+									icon: 'success',
190
+								})
191
+								setTimeout(function() {
192
+									uni.redirectTo({
193
+										url: "/shop/employee/list"
194
+									})
195
+								}, 600);
196
+							}
197
+						}, fail => {
198
+							console.log(fail)
199
+						})
200
+					}
201
+
202
+				}
203
+			},
204
+			bindPickerChange: function(e) {
205
+				this.from.department = this.arrayid[e.detail.value]
206
+
207
+				if (this.can == 1) {
208
+					if (this.from.department == 1) {
209
+						this.departmentName = "请选择"
210
+					}
211
+				}
212
+				this.departmentName = this.array[e.detail.value]
213
+				this.index = e.detail.value
214
+			},
215
+			showPwd: function() {
216
+				this.showPassword = !this.showPassword;
217
+			},
218
+			topgi() {
219
+				uni.redirectTo({
220
+					url: './list'
221
+				});
222
+			}
223
+		}
224
+	}
225
+</script>
226
+
227
+<style>
228
+	page {
229
+		background-color: #F7F8FC;
230
+	}
231
+</style>
232
+<style lang="scss" scoped>
233
+	.listadd {
234
+		width: 100%;
235
+		height: 100%;
236
+		display: flex;
237
+		flex-direction: column;
238
+		align-items: center;
239
+
240
+		.listadd-header {
241
+			position: fixed;
242
+			top: 0;
243
+			left: 0;
244
+			z-index: 111;
245
+			width: 100%;
246
+			height: 176rpx;
247
+			background: #FFFFFF;
248
+			display: flex;
249
+			justify-content: center;
250
+
251
+			.listadd-header-text {
252
+				width: 686rpx;
253
+				font-size: 36rpx;
254
+				font-weight: 500;
255
+				color: #333333;
256
+				display: flex;
257
+				margin-top: 107rpx;
258
+				align-items: center;
259
+
260
+				.listadd-header-text-neishi {
261
+					width: 45rpx;
262
+					height: 45rpx;
263
+					margin-right: 17rpx;
264
+
265
+					.listadd-header-text-icon {
266
+						width: 36rpx;
267
+						height: 36rpx;
268
+						margin-top: 2rpx;
269
+
270
+						image {
271
+							width: 100%;
272
+							height: 100%;
273
+						}
274
+					}
275
+				}
276
+			}
277
+		}
278
+
279
+		.listadd-list {
280
+			width: 686rpx;
281
+			height: 118rpx;
282
+			background: #FFFFFF;
283
+			border-radius: 8rpx;
284
+			margin: 26rpx 0 0 0;
285
+			display: flex;
286
+			justify-content: space-between;
287
+			align-items: center;
288
+			font-size: 30rpx;
289
+			font-weight: 400;
290
+			color: #333333;
291
+
292
+			.listadd-list-let {
293
+				margin-left: 32rpx;
294
+			}
295
+
296
+			.listadd-list-rig {
297
+				margin-right: 32rpx;
298
+
299
+				input {
300
+					width: 200rpx;
301
+					// color: #B6B6B6;
302
+				}
303
+			}
304
+		}
305
+
306
+		.listadd-buxiugai {
307
+			width: 686rpx;
308
+			font-size: 30rpx;
309
+			font-weight: 400;
310
+			color: #B6B6B6;
311
+			margin-top: 26rpx;
312
+		}
313
+
314
+		.listadd-annkiu {
315
+			width: 686rpx;
316
+			height: 98rpx;
317
+			background: #1F7CFF;
318
+			border-radius: 8rpx;
319
+			position: fixed;
320
+			bottom: 94rpx;
321
+			font-size: 36rpx;
322
+			font-weight: 400;
323
+			color: #FFFFFF;
324
+			text-align: center;
325
+			line-height: 98rpx;
326
+		}
327
+	}
328
+</style>

+ 537 - 0
shop/perating/activitecode.vue

@@ -0,0 +1,537 @@
1
+<template>
2
+	<view class="process" v-if="status==1">
3
+		<view class="process-header">
4
+			<view class="process-header-text">
5
+				<view class="process-header-text-neishi" @click="topgi">
6
+					<view class="process-header-text-icon">
7
+						<image src="https://cdn.bjtdba.com/vod/image/2022-08-11/20220811133828415.png" mode="widthFix">
8
+						</image>
9
+					</view>
10
+				</view>
11
+				<view class="process-header-text-title">
12
+					聚合码
13
+				</view>
14
+			</view>
15
+		</view>
16
+		<view class="activite-nav">
17
+			<view class="activite-card">
18
+				<image class="activite-card-logo"
19
+					src="https://cdn.bjtdba.com/vod/image/2024-04-18/20240418171035764.png" mode=""></image>
20
+				<view class="activite-cardImg">
21
+					<image :src="qrcode_src" mode="widthFix"></image>
22
+				</view>
23
+				<view class="activite-cardText">{{code_id}}</view>
24
+				<view class="activite-cardBtn">
25
+					扫码即得养老金
26
+				</view>
27
+				<view class="activite-cardPrompt">
28
+					<view class="activite-prompt">
29
+						<view class="activite-prompt-left"></view>
30
+						<view class="activite-prompt-title">支持以下付款</view>
31
+						<view class="activite-prompt-right"></view>
32
+					</view>
33
+					<view class="activite-prompt-img">
34
+						<image src="https://cdn.bjtdba.com/vod/image/2022-08-23/20220823141611538.png" mode=""></image>
35
+						<image src="https://cdn.bjtdba.com/vod/image/2022-08-23/20220823141556288.png" mode=""></image>
36
+					</view>
37
+				</view>
38
+
39
+			</view>
40
+
41
+			<view class="downLoadButton" @click="clickGeneratePicture">
42
+				<image class="downLoad-image" src="../../static/saveImage.png" mode=""></image>
43
+				<view class="downLoad-text">
44
+					保存图片
45
+				</view>
46
+			</view>
47
+
48
+		</view>
49
+
50
+
51
+		<!-- ************************* 海报画板 **********************-->
52
+		<view style="position: absolute; bottom:10%; left: 0%;" v-show="flag">
53
+			<l-painter :board="poster" css="width: 750rpx;" isCanvasToTempFilePath @success="handleSuccess($event)"
54
+				@fail="handleError($event)" @progress="handleProgress($event)" ref="poster">
55
+			</l-painter>
56
+		</view>
57
+		<!-- ************************* 海报画板 **********************-->
58
+	</view>
59
+</template>
60
+
61
+<script>
62
+	import {
63
+		queryByKey
64
+	} from '@/commit/shop.js'
65
+	import lPainter from "@/uni_modules/lime-painter/components/l-painter/l-painter.vue"
66
+	export default {
67
+		components: {
68
+			lPainter
69
+		},
70
+		data() {
71
+			return {
72
+				isShowType: false,
73
+				qrcode_src: '',
74
+				code_id: '',
75
+				status: '',
76
+				imageUrl: '',
77
+				picture: '',
78
+				isHide: true,
79
+				poster: {},
80
+				image: "",
81
+				flag:false,
82
+			}
83
+		},
84
+		onLoad(e) {
85
+			uni.showLoading({
86
+				title: '加载中',
87
+				mask: true
88
+			});
89
+			this.queryByKey()
90
+			this.qrcode_src = e.qrcode_src
91
+			this.code_id = e.code_id
92
+		},
93
+		methods: {
94
+			
95
+			queryByKey() {
96
+				queryByKey({
97
+					key: "merchant_xiaochengxu_shenhe"
98
+				}).then(res => {
99
+					if (res.data.status == 200) {
100
+						this.status = res.data.data.status
101
+						uni.hideLoading();
102
+
103
+						this.drawPoster();
104
+					}
105
+				}, fail => {
106
+					console.log(fail)
107
+					uni.hideLoading();
108
+				})
109
+			},
110
+
111
+			// 绘制图片
112
+			drawPoster() { //获取数据后,开始绘画
113
+				this.poster = {
114
+					width: '750rpx',
115
+					height: '1448rpx',
116
+					background: '#1F7CFF', //画布背景色
117
+					// radius: '20rpx',//画布的圆角
118
+
119
+					views: [{ //绘制图片,白色圆角背景
120
+						type: 'image', //绘画的类型,具体官网查看
121
+						src: 'https://cdn.bjtdba.com/vod/image/2022-08-23/20220823134038776.png', //图片路径
122
+						mode: 'scaleToFill',
123
+						css: { //css需要使用驼峰命名
124
+							marginLeft: '31rpx',
125
+							marginTop: '154rpx',
126
+							width: '688rpx',
127
+							height: '1053rpx'
128
+						},
129
+						views: [{ //绘制图片,logo
130
+								type: 'image', //绘画的类型,具体官网查看
131
+								src: 'https://cdn.bjtdba.com/vod/image/2022-08-23/20220823134835742.png', //图片路径
132
+								css: { //css需要使用驼峰命名
133
+									marginLeft: '271rpx',
134
+									marginTop: '-52rpx',
135
+									width: '144rpx',
136
+									height: '144rpx'
137
+								}
138
+							},
139
+							{ //绘制图片,二维码
140
+								type: 'image', //绘画的类型,具体官网查看
141
+								src: this.qrcode_src, //图片路径
142
+								css: { //css需要使用驼峰命名
143
+									marginLeft: '164rpx',
144
+									marginTop: '52rpx',
145
+									width: '360rpx',
146
+									height: '360rpx',
147
+								}
148
+							},
149
+							{ //绘制图片,扫码即得养老金 提示背景
150
+								type: 'image', //绘画的类型,具体官网查看
151
+								src: 'https://cdn.bjtdba.com/vod/image/2022-08-23/20220823140132620.png', //图片路径
152
+								css: { //css需要使用驼峰命名
153
+									marginLeft: '71rpx',
154
+									marginTop: '111rpx',
155
+									width: '546rpx',
156
+									height: '94rpx'
157
+								},
158
+								views: [{ //绘制图片,扫码即得养老金 提示
159
+									type: 'text', //绘画的类型,具体官网查看
160
+									text: '扫码即得养老金',
161
+									css: { //css需要使用驼峰命名
162
+										marginLeft: '10rpx',
163
+										marginTop: '18rpx',
164
+										width: '526rpx',
165
+										height: '50rpx',
166
+										fontSize: '36rpx',
167
+										color: '#ffffff',
168
+										textAlign: "center",
169
+									}
170
+								}, ]
171
+							},
172
+							{ //绘制图片,支付类型选择背景
173
+								type: 'view',
174
+								css: {
175
+									marginLeft: '82rpx',
176
+									marginTop: '24rpx',
177
+									width: '526rpx',
178
+									height: '206rpx',
179
+									background: '#DFEAFD',
180
+									radius: '30rpx 30rpx 30rpx 30rpx',
181
+								},
182
+								views: [{ //绘制图片,支持以下付款 提示
183
+										type: 'text', //绘画的类型,具体官网查看
184
+										text: '支持以下付款', //图片路径
185
+										css: { //css需要使用驼峰命名
186
+											marginLeft: '10rpx',
187
+											marginTop: '32rpx',
188
+											width: '506rpx',
189
+											height: '40rpx',
190
+											fontSize: '28rpx',
191
+											color: '#333333',
192
+											textAlign: "center",
193
+										}
194
+									},
195
+									{ //绘制图片,支付宝logo
196
+										type: 'image', //绘画的类型,具体官网查看
197
+										src: 'https://cdn.bjtdba.com/vod/image/2022-08-23/20220823141611538.png', //图片路径
198
+										css: { //css需要使用驼峰命名
199
+											marginLeft: '176rpx',
200
+											marginTop: '32rpx',
201
+											width: '70rpx',
202
+											height: '70rpx'
203
+										}
204
+									},
205
+									{ //绘制图片,微信logo
206
+										type: 'image', //绘画的类型,具体官网查看
207
+										src: 'https://cdn.bjtdba.com/vod/image/2022-08-23/20220823141556288.png', //图片路径
208
+										css: { //css需要使用驼峰命名
209
+											marginLeft: '32rpx',
210
+											marginTop: '32rpx',
211
+											width: '70rpx',
212
+											height: '70rpx'
213
+										}
214
+									},
215
+
216
+								]
217
+							},
218
+
219
+						]
220
+					}, ]
221
+				}
222
+			},
223
+
224
+			topgi() { // 返回按钮事件
225
+				uni.switchTab({
226
+					url: '/pages/cashier/index'
227
+				});
228
+			},
229
+			change(e) {
230
+				console.log("e:", e);
231
+			},
232
+
233
+			// 海报  l-painter回调函数
234
+			handleSuccess(path) {
235
+				uni.hideLoading();
236
+				console.log('完成图片绘制')
237
+			},
238
+			handleProgress(number) {
239
+				this.progressNum = number
240
+			},
241
+			handleError(error) {
242
+				uni.hideLoading();
243
+			},
244
+
245
+			// 点击保存图片 - 1.base64字符串转成url地址
246
+			clickGeneratePicture() {
247
+				this.$refs.poster.canvasToTempFilePathSync({
248
+					fileType: 'jpg',
249
+					quality: 1,
250
+					pathType: 'url',
251
+					success: (res) => {
252
+						console.log(res.tempFilePath)
253
+						this.picture = res.tempFilePath
254
+						// 2.保存
255
+						this.saveImage()
256
+					},
257
+					fail(e) {
258
+						console.log('???????????', e)
259
+					}
260
+				})
261
+			},
262
+
263
+			// 保存图片
264
+			saveImage() {
265
+				let that = this
266
+				if (that.picture !== "") {
267
+					uni.hideLoading();
268
+
269
+					uni.getSetting({
270
+						success(res) {
271
+							if (res.authSetting['scope.writePhotosAlbum']) {
272
+								that.saveImageToAlbum();
273
+							} else if (res.authSetting['scope.writePhotosAlbum'] === undefined) {
274
+								uni.authorize({
275
+									scope: 'scope.writePhotosAlbum',
276
+									success() {
277
+										uni.showModal({
278
+											title: "保存成功",
279
+											content: "图片已成功保存到相册,快去分享到您的圈子吧",
280
+											showCancel: false,
281
+										})
282
+									},
283
+									fail() {
284
+										that.authConfirm()
285
+									}
286
+								})
287
+							} else {
288
+								that.authConfirm()
289
+							}
290
+						}
291
+					})
292
+				} else {
293
+					uni.showModal({
294
+						title: '提示',
295
+						content: "生成海报失败,请重试",
296
+						showCancel: false,
297
+					})
298
+				}
299
+			},
300
+			
301
+			// 未授权相册功能 重新弹窗
302
+			authConfirm() {
303
+				let that = this
304
+				wx.showModal({
305
+					content: '检测到您没打开保存图片权限,是否去设置打开?',
306
+					confirmText: "确认",
307
+					cancelText: "取消",
308
+					success: function(res) {
309
+						if (res.confirm) {
310
+							wx.openSetting({
311
+								success(res) {
312
+									if (res.authSetting['scope.writePhotosAlbum']) {
313
+										that.saveImg();
314
+									} else {
315
+										uni.showModal({
316
+											title: '保存失败',
317
+											content: "您没有授权,无法保存到相册",
318
+											showCancel: false
319
+										})
320
+									}
321
+								}
322
+							})
323
+						} else {
324
+							uni.showModal({
325
+								title: '保存失败',
326
+								content: "您没有授权,无法保存到相册",
327
+								showCancel: false
328
+							})
329
+						}
330
+					}
331
+				});
332
+			},
333
+
334
+			// 保存到相册
335
+			saveImageToAlbum() {
336
+				uni.saveImageToPhotosAlbum({
337
+					filePath: this.picture,
338
+					success: () => {
339
+						uni.showModal({
340
+							title: "保存成功",
341
+							content: "图片已成功保存到相册,快去分享到您的圈子吧",
342
+							showCancel: false,
343
+						})
344
+					}
345
+				});
346
+			}
347
+		},
348
+
349
+	}
350
+</script>
351
+
352
+<style>
353
+	page {
354
+		background-color: #F7F8FC;
355
+	}
356
+</style>
357
+<style lang="scss" scoped>
358
+	.process {
359
+		width: 100%;
360
+		height: 100%;
361
+		display: flex;
362
+		flex-direction: column;
363
+		align-items: center;
364
+		justify-content: center;
365
+
366
+		.process-header {
367
+			position: fixed;
368
+			top: 0;
369
+			left: 0;
370
+			z-index: 111;
371
+			width: 100%;
372
+			height: 176rpx;
373
+			background: #FFFFFF;
374
+			display: flex;
375
+			justify-content: center;
376
+
377
+			.process-header-text {
378
+				width: 686rpx;
379
+				font-size: 36rpx;
380
+				font-weight: 500;
381
+				color: #333333;
382
+				display: flex;
383
+				margin-top: 107rpx;
384
+				align-items: center;
385
+
386
+				.process-header-text-neishi {
387
+					width: 45rpx;
388
+					height: 45rpx;
389
+					margin-right: 17rpx;
390
+
391
+					.process-header-text-icon {
392
+						width: 36rpx;
393
+						height: 36rpx;
394
+						margin-top: 2rpx;
395
+
396
+						image {
397
+							width: 100%;
398
+							height: 100%;
399
+						}
400
+					}
401
+				}
402
+			}
403
+		}
404
+
405
+		.activite-nav {
406
+			width: 100%;
407
+			height: 100%;
408
+			margin-top: 176rpx;
409
+			background-color: red;
410
+			display: flex;
411
+			flex-direction: column;
412
+			align-items: center;
413
+			background: url('https://cdn.bjtdba.com/vod/image/2022-08-23/20220823132549341.png') no-repeat;
414
+			background-size: 100%;
415
+			padding-bottom: 242rpx;
416
+
417
+			.activite-card {
418
+				width: 688rpx;
419
+				margin-top: 154rpx;
420
+				height: 1053rpx;
421
+				background: url('https://cdn.bjtdba.com/vod/image/2022-08-23/20220823134038776.png') no-repeat;
422
+				background-size: 100%;
423
+				display: flex;
424
+				flex-direction: column;
425
+				align-items: center;
426
+				position: relative;
427
+
428
+				.activite-card-logo {
429
+					width: 144rpx;
430
+					height: 144rpx;
431
+					position: absolute;
432
+					top: -52rpx;
433
+					left: 50%;
434
+					transform: translate(-50%, 0);
435
+				}
436
+
437
+				.activite-cardImg {
438
+					width: 360rpx;
439
+					height: 360rpx;
440
+					background: #D8D8D8;
441
+					margin: 144rpx auto 52rpx auto;
442
+
443
+					image {
444
+						width: 100%;
445
+						height: 100%;
446
+					}
447
+				}
448
+
449
+				.activite-cardText {
450
+					line-height: 45rpx;
451
+					font-size: 32rpx;
452
+				}
453
+
454
+				.activite-cardBtn {
455
+					width: 546rpx;
456
+					height: 94rpx;
457
+					background: url('https://cdn.bjtdba.com/vod/image/2022-08-23/20220823140132620.png') no-repeat;
458
+					background-size: 100%;
459
+					color: #FFFFFF;
460
+					font-size: 36rpx;
461
+					text-align: center;
462
+					padding: 20rpx 0 24rpx;
463
+				}
464
+
465
+				.activite-cardPrompt {
466
+					width: 526rpx;
467
+					// height: 206rpx;
468
+					background: #DFEAFD;
469
+					border-radius: 30rpx;
470
+					padding: 32rpx 0;
471
+
472
+					.activite-prompt {
473
+						display: flex;
474
+						align-items: center;
475
+						justify-content: center;
476
+
477
+						.activite-prompt-left {
478
+							width: 50rpx;
479
+							height: 2rpx;
480
+							background: linear-gradient(90deg, rgba(223, 234, 253, 0) 0%, #1F7CFF 100%);
481
+							border-radius: 1rpx;
482
+						}
483
+
484
+						.activite-prompt-title {
485
+							font-size: 28rpx;
486
+							margin: 0 16rpx;
487
+						}
488
+
489
+						.activite-prompt-right {
490
+							width: 50rpx;
491
+							height: 2rpx;
492
+							background: linear-gradient(270deg, rgba(223, 234, 253, 0) 0%, #1F7CFF 100%)
493
+						}
494
+					}
495
+
496
+					.activite-prompt-img {
497
+						margin-top: 32rpx;
498
+						text-align: center;
499
+
500
+						image {
501
+							width: 70rpx;
502
+							height: 70rpx;
503
+						}
504
+
505
+						:first-child {
506
+							margin-right: 32rpx;
507
+						}
508
+					}
509
+				}
510
+			}
511
+
512
+			.downLoadButton {
513
+				width: 128rpx;
514
+				height: 165rpx;
515
+				margin-top: 9rpx;
516
+				// background-color: red;
517
+				display: flex;
518
+				flex-direction: column;
519
+				align-items: center;
520
+
521
+				.downLoad-image {
522
+					width: 128rpx;
523
+					height: 128rpx;
524
+					position: absolute;
525
+				}
526
+
527
+				.downLoad-text {
528
+					margin-top: 128rpx;
529
+					color: #FFFFFF;
530
+					font-size: 26rpx;
531
+					text-align: center;
532
+				}
533
+			}
534
+
535
+		}
536
+	}
537
+</style>

+ 0 - 0
shop/perating/consumption.vue


Some files were not shown because too many files changed in this diff