From 70e7c53c8811c37cbbeabf9bf44d306448517d7c Mon Sep 17 00:00:00 2001 From: gerson <1405270578@qq.com> Date: 星期日, 11 八月 2024 14:10:13 +0800 Subject: [PATCH] weixin post message --- src/components/chat/Chat.vue | 3 + customer_list/ch/static/amis_html/index.html | 125 +++++++++++++++++++++-------------------- src/utils/toolsValidate.ts | 4 + 3 files changed, 70 insertions(+), 62 deletions(-) diff --git a/customer_list/ch/static/amis_html/index.html b/customer_list/ch/static/amis_html/index.html index b262633..dc8e0bf 100644 --- a/customer_list/ch/static/amis_html/index.html +++ b/customer_list/ch/static/amis_html/index.html @@ -1,63 +1,66 @@ <!DOCTYPE html> <html lang="zh"> - <head> - <meta charset="UTF-8" /> - <title>amis demo</title> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <meta - name="viewport" - content="width=device-width, initial-scale=1, maximum-scale=1" - /> - <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> - <link rel="stylesheet" href="../amis/sdk/sdk.css" /> - <link rel="stylesheet" href="../amis/sdk/helper.css" /> - <link rel="stylesheet" href="../amis/sdk/iconfont.css" /> - <!-- 杩欐槸榛樿涓婚鎵�闇�鐨勶紝濡傛灉鏄叾浠栦富棰樺垯涓嶉渶瑕� --> - <!-- 浠� 1.1.0 寮�濮� sdk.css 灏嗕笉鏀寔 IE 11锛屽鏋滆鏀寔 IE11 璇峰紩鐢ㄨ繖涓� css锛屽苟鎶婂墠闈㈤偅涓垹浜� --> - <!-- <link rel="stylesheet" href="sdk-ie11.css" /> --> - <!-- 涓嶈繃 amis 寮�鍙戝洟闃熷嚑涔庢病娴嬭瘯杩� IE 11 涓嬬殑鏁堟灉锛屾墍浠ュ彲鑳芥湁缁嗚妭鍔熻兘鐢ㄤ笉浜嗭紝濡傛灉鍙戠幇璇锋姤 issue --> - <style> - html, - body, - .app-wrapper { - position: relative; - width: 100%; - height: 100%; - margin: 0; - padding: 0; - } - </style> - </head> - <body> - <div id="root" class="app-wrapper"></div> - <script src="../amis/sdk/sdk.js"></script> - <script type="text/javascript"> - (function () { - let amis = amisRequire('amis/embed'); - // 閫氳繃鏇挎崲涓嬮潰杩欎釜閰嶇疆鏉ョ敓鎴愪笉鍚岄〉闈� - let amisJSON = { - type: 'page', - title: '琛ㄥ崟椤甸潰', - body: { - type: 'form', - mode: 'horizontal', - api: '/saveForm', - body: [ - { - label: 'Name', - type: 'input-text', - name: 'name' - }, - { - label: 'Email', - type: 'input-email', - name: 'email' - } - ] - } - }; - let amisScoped = amis.embed('#root', amisJSON); - })(); - </script> - </body> -</html> \ No newline at end of file + <head> + <meta charset="UTF-8" /> + <title>amis demo</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> + <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> + <link rel="stylesheet" href="../amis/sdk/sdk.css" /> + <link rel="stylesheet" href="../amis/sdk/helper.css" /> + <link rel="stylesheet" href="../amis/sdk/iconfont.css" /> + <!-- 杩欐槸榛樿涓婚鎵�闇�鐨勶紝濡傛灉鏄叾浠栦富棰樺垯涓嶉渶瑕� --> + <!-- 浠� 1.1.0 寮�濮� sdk.css 灏嗕笉鏀寔 IE 11锛屽鏋滆鏀寔 IE11 璇峰紩鐢ㄨ繖涓� css锛屽苟鎶婂墠闈㈤偅涓垹浜� --> + <!-- <link rel="stylesheet" href="sdk-ie11.css" /> --> + <!-- 涓嶈繃 amis 寮�鍙戝洟闃熷嚑涔庢病娴嬭瘯杩� IE 11 涓嬬殑鏁堟灉锛屾墍浠ュ彲鑳芥湁缁嗚妭鍔熻兘鐢ㄤ笉浜嗭紝濡傛灉鍙戠幇璇锋姤 issue --> + <style> + html, + body, + .app-wrapper { + position: relative; + width: 100%; + height: 100%; + margin: 0; + padding: 0; + } + </style> + </head> + <body> + <div id="root" class="app-wrapper"></div> + <script src="../amis/sdk/sdk.js"></script> + <script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script> + + <script type="text/javascript"> + (function () { + let amis = amisRequire('amis/embed'); + // 閫氳繃鏇挎崲涓嬮潰杩欎釜閰嶇疆鏉ョ敓鎴愪笉鍚岄〉闈� + let amisJSON = { + type: 'page', + title: '琛ㄥ崟椤甸潰', + body: { + type: 'form', + mode: 'horizontal', + api: '/saveForm', + body: [ + { + label: 'Name', + type: 'input-text', + name: 'name', + }, + { + label: 'Email', + type: 'input-email', + name: 'email', + }, + ], + }, + }; + setTimeout(() => { + console.log('馃殌 ~ post'); + wx.miniProgram.postMessage({ data: { foo: amisJSON } }); + }, 5000); + let amisScoped = amis.embed('#root', amisJSON); + })(); + </script> + </body> +</html> diff --git a/src/components/chat/Chat.vue b/src/components/chat/Chat.vue index d9328d5..190693c 100644 --- a/src/components/chat/Chat.vue +++ b/src/components/chat/Chat.vue @@ -375,7 +375,10 @@ const res = await QueryHistoryDetail({ history_group_id: currentRouteId, }); + + + messageList.value = (res.details ?? []).map((item) => { return { historyId: item.history_id, diff --git a/src/utils/toolsValidate.ts b/src/utils/toolsValidate.ts index 419b504..0af2657 100644 --- a/src/utils/toolsValidate.ts +++ b/src/utils/toolsValidate.ts @@ -209,7 +209,9 @@ */ export function verifyPhone(val: string) { // false: 鎵嬫満鍙风爜涓嶆纭� - if (!/^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0|1,5-9]))\d{8}$/.test(val)) return false; + // if (!/^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0|1,5-9]))\d{8}$/.test(val)) return false; + if (!/^1[3456789]\d{9}$/.test(val)) return false; + // true: 鎵嬫満鍙风爜姝g‘ else return true; } -- Gitblit v1.9.3