From 4a7f2945f84dc6b31a045e07ce744bc9d9ba7d08 Mon Sep 17 00:00:00 2001
From: weipengfei <2187978347@qq.com>
Date: Mon, 18 Sep 2023 13:43:58 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5API?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/index/index.vue | 140 +++++++-----
unpackage/dist/dev/app-plus/app-service.js | 245 ++++++++++++---------
unpackage/dist/dev/app-plus/app-view.js | 157 ++++++++-----
3 files changed, 317 insertions(+), 225 deletions(-)
diff --git a/pages/index/index.vue b/pages/index/index.vue
index d0dbfdb..f0e00a2 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -5,12 +5,15 @@
+
-
+
+ |
@@ -18,9 +21,9 @@
+
-
@@ -30,6 +33,7 @@
+
@@ -61,13 +65,11 @@
c_content: '',
n_content: '',
timer: '',
- TEXT: '你好,我的名字叫大',
- APPID: '2eda6c2e', // 控制台获取填写
- APIKey: '12ec1f9d113932575fc4b114a2f60ffd',
- APISecret: 'MDEyMzE5YTc5YmQ5NjMwOTU1MWY4N2Y2',
- sparkResult: '',
+ socketTask: {},
+ TEXT: '',
historyTextList: [], // 历史会话信息,由于最大token12000,可以结合实际使用,进行移出
tempRes: '', // 临时答复保存
+ scrollTop: 0
}
},
mounted() {
@@ -80,9 +82,14 @@
if(e.height==0)h *= -1;
else h = e.height;
uni.createSelectorQuery().selectViewport().scrollOffset(function(res) {
- const scrollTop = res.scrollTop; // 页面滚动距离
+ let scrollTop = res.scrollTop; // 页面滚动距离
+ // let os = uni.getSystemInfoSync();
+ // // 可视窗口高度 = 设备可使用高度 - 状态栏高度 - 导航栏高度
+ // const viewportHeight = os.windowHeight - os.statusBarHeight - (os.platform == "android" ? 50 : 45)-10;
+ // if(scrollTop {
- // const height = rect?.height;
- // console.log(height, rect);
- // })
- // .exec();
})
} else {
clearInterval(this.timer);
@@ -151,7 +149,6 @@
return; //
}
- // 此处用到 ES7 的 async/await 知识,为使代码更加优美。不懂的请自行学习。
let get = async () => {
this.hideLoadTips();
this.ajax.flag = false;
@@ -197,7 +194,7 @@
}
get();
},
- // 拼接历史记录消息,正式项目可替换为请求历史记录接口
+ // 拼接历史记录消息
joinHistoryMsg() {
let join = () => {
let arr = [];
@@ -269,6 +266,23 @@
})
return;
}
+ try{
+ clearInterval(this.timer);
+ this.talkList[this.talkList.length-1].content = this.c_content+'';
+ this.c_content = '';
+ this.n_content = '';
+ this.socketTask.close({
+ success:(res)=> {
+ console.log('关闭成功', res);
+ this.wsLiveFlag = false;
+ },
+ fail(err) {
+ console.log('关闭失败', err)
+ }
+ })
+ }catch(e){
+ //TODO handle the exception
+ }
// 将当前发送信息 添加到消息列表。
let data = {
"id": new Date().getTime(),
@@ -286,6 +300,7 @@
"type": 2,
"pic": "/static/avatar.png"
});
+ // return ;
this.$nextTick(() => {
// 清空内容框中的内容
this.content = '';
@@ -298,16 +313,15 @@
},
async sendToSpark() {
- let myUrl = await this.getWebSocketUrl();
+ // let myUrl = await this.getWebSocketUrl();
this.tempRes = "";
- // this.sparkResult = "";
let realThis = this;
this.socketTask = uni.connectSocket({
//url: encodeURI(encodeURI(myUrl).replace(/\+/g, '%2B')),
- url: myUrl,
+ url: 'wss://chat.lihaink.cn/chat',
method: 'GET',
success: res => {
- console.log(res, "ws成功连接...", myUrl)
+ console.log(res, "ws成功连接...")
realThis.wsLiveFlag = true;
}
})
@@ -319,31 +333,27 @@
"role": "user",
"content": this.TEXT
})
- console.info("wss的onOpen成功执行...", res)
// 第一帧..........................................
- console.log('open成功...')
- let params = {
- "header": {
- "app_id": this.APPID,
- "uid": "aef9f963-7"
- },
- "parameter": {
- "chat": {
- "domain": "generalv2",
- "temperature": 0.5,
- "max_tokens": 1024
- }
- },
- "payload": {
- "message": {
- "text": this.historyTextList
- }
- }
- };
- console.log("请求的params:" + JSON.stringify(params))
- this.sparkResult = this.sparkResult + "\r\n我:" + this.TEXT + "\r\n"
- this.sparkResult = this.sparkResult + "大模型:"
- console.log("发送第一帧...", params)
+ console.log('连接成功...')
+ // let params = {
+ // "header": {
+ // "app_id": this.APPID,
+ // "uid": "aef9f963-7"
+ // },
+ // "parameter": {
+ // "chat": {
+ // "domain": "generalv2",
+ // "temperature": 0.5,
+ // "max_tokens": 1024
+ // }
+ // },
+ // "payload": {
+ // "message": {
+ // "text": this.historyTextList
+ // }
+ // }
+ // };
+ let params = this.TEXT
realThis.socketTask.send({ // 发送消息,,都用uni的官方版本
data: JSON.stringify(params),
success() {
@@ -359,12 +369,10 @@
// console.log("我打印的"+obj.payload);
let dataArray = obj.payload.choices.text;
for (let i = 0; i < dataArray.length; i++) {
- realThis.sparkResult = realThis.sparkResult + dataArray[i].content;
this.talkList[this.talkList.length - 1].content += dataArray[i].content;
this.n_content = this.talkList[this.talkList.length - 1].content;
realThis.tempRes = realThis.tempRes + dataArray[i].content
}
- // realThis.sparkResult =realThis.sparkResult+
let temp = JSON.parse(res.data)
// console.log("0726",temp.header.code)
if (temp.header.code !== 0) {
@@ -381,16 +389,10 @@
}
if (temp.header.code === 0) {
if (res.data && temp.header.status === 2) {
- realThis.sparkResult = realThis.sparkResult +
- "\r\n**********************************************"
this.historyTextList.push({
"role": "assistant",
"content": this.tempRes
})
- /* let dataArray= obj.payload.choices.text;
- for(let i=0;i {
realThis.socketTask.close({
success(res) {
@@ -428,6 +430,18 @@
resolve(url);
});
},
+ // 滚动到头部
+ bindScroll() {
+ if (this.userId == 0) {
+ this.getHistory();
+ this.getproductInfo();
+ this.getOrderInfo();
+ this.getRefundDetail();
+ this.getStoreDetail();
+ } else {
+ this.getMerHistory();
+ }
+ },
}
}
@@ -439,6 +453,20 @@
background-color: #f5f5f5;
font-size: 28rpx;
}
+
+ @keyframes blink {
+ 0% { opacity: 1; }
+ 50% { opacity: 0; }
+ 100% { opacity: 1; }
+ }
+
+ .blinking-box {
+ background-color: #333;
+ color: #333;
+ animation: blink 1s infinite;
+ width: 2px;
+ overflow: hidden;
+ }
.wrapper {
height: auto !important;
diff --git a/unpackage/dist/dev/app-plus/app-service.js b/unpackage/dist/dev/app-plus/app-service.js
index 464f838..ed78d79 100644
--- a/unpackage/dist/dev/app-plus/app-service.js
+++ b/unpackage/dist/dev/app-plus/app-service.js
@@ -253,126 +253,155 @@ var render = function () {
_c(
"view",
{ staticClass: _vm._$s(4, "sc", "talk-list"), attrs: { _i: 4 } },
- _vm._l(
- _vm._$s(5, "f", { forItems: _vm.talkList }),
- function (item, index, $20, $30) {
- return _c(
- "view",
- {
- key: _vm._$s(5, "f", { forIndex: $20, key: index }),
- attrs: {
- id: _vm._$s("5-" + $30, "a-id", "msg-" + item.id),
- _i: "5-" + $30,
- },
+ [
+ _c(
+ "scroll-view",
+ {
+ attrs: {
+ "scroll-top": _vm._$s(5, "a-scroll-top", _vm.scrollTop),
+ _i: 5,
},
- [
- _c(
+ on: { scrolltoupper: _vm.bindScroll },
+ },
+ _vm._l(
+ _vm._$s(6, "f", { forItems: _vm.talkList }),
+ function (item, index, $20, $30) {
+ return _c(
"view",
{
- staticClass: _vm._$s("6-" + $30, "sc", "item flex_col"),
- class: _vm._$s(
- "6-" + $30,
- "c",
- item.type == 1 ? "push" : "pull"
- ),
- attrs: { _i: "6-" + $30 },
+ key: _vm._$s(6, "f", { forIndex: $20, key: index }),
+ attrs: {
+ id: _vm._$s("6-" + $30, "a-id", "msg-" + item.id),
+ _i: "6-" + $30,
+ },
},
[
- _c("image", {
- staticClass: _vm._$s("7-" + $30, "sc", "pic"),
- attrs: {
- src: _vm._$s("7-" + $30, "a-src", item.pic),
- _i: "7-" + $30,
- },
- }),
- _vm._$s(
- "8-" + $30,
- "i",
- _vm.talkList.length - 1 == index
- )
- ? _c(
- "view",
- {
- staticClass: _vm._$s(
- "8-" + $30,
- "sc",
- "content multiline-text"
- ),
- attrs: { _i: "8-" + $30 },
- },
- [
- _c("bing-math", {
- key: _vm._$s(
- "9-" + $30,
- "a-key",
- "math-" + item.id
- ),
- staticClass: _vm._$s(
- "9-" + $30,
- "sc",
- "bing-math"
- ),
- attrs: {
- latex: _vm.c_content,
- _i: "9-" + $30,
- },
- }),
- ],
- 1
- )
- : _c(
- "view",
- {
- staticClass: _vm._$s(
- "10-" + $30,
- "sc",
- "content multiline-text"
- ),
- attrs: { _i: "10-" + $30 },
- },
- [
- _c("bing-math", {
- key: _vm._$s(
- "11-" + $30,
- "a-key",
- "math-" + item.id
- ),
- staticClass: _vm._$s(
- "11-" + $30,
- "sc",
- "bing-math"
- ),
- attrs: {
- latex: item.content,
- _i: "11-" + $30,
- },
- }),
- ],
- 1
+ _c(
+ "view",
+ {
+ staticClass: _vm._$s(
+ "7-" + $30,
+ "sc",
+ "item flex_col"
),
+ class: _vm._$s(
+ "7-" + $30,
+ "c",
+ item.type == 1 ? "push" : "pull"
+ ),
+ attrs: { _i: "7-" + $30 },
+ },
+ [
+ _c("image", {
+ staticClass: _vm._$s("8-" + $30, "sc", "pic"),
+ attrs: {
+ src: _vm._$s("8-" + $30, "a-src", item.pic),
+ _i: "8-" + $30,
+ },
+ }),
+ _vm._$s(
+ "9-" + $30,
+ "i",
+ _vm.talkList.length - 1 == index
+ )
+ ? _c(
+ "view",
+ {
+ staticClass: _vm._$s(
+ "9-" + $30,
+ "sc",
+ "content multiline-text"
+ ),
+ attrs: { _i: "9-" + $30 },
+ },
+ [
+ _vm._$s(
+ "10-" + $30,
+ "i",
+ _vm.c_content != ""
+ )
+ ? _c("bing-math", {
+ key: _vm._$s(
+ "10-" + $30,
+ "a-key",
+ "math-" + item.id
+ ),
+ staticClass: _vm._$s(
+ "10-" + $30,
+ "sc",
+ "bing-math"
+ ),
+ attrs: {
+ latex: _vm.c_content,
+ _i: "10-" + $30,
+ },
+ })
+ : _c("view", {
+ staticClass: _vm._$s(
+ "11-" + $30,
+ "sc",
+ "blinking-box"
+ ),
+ attrs: { _i: "11-" + $30 },
+ }),
+ ],
+ 1
+ )
+ : _c(
+ "view",
+ {
+ staticClass: _vm._$s(
+ "12-" + $30,
+ "sc",
+ "content multiline-text"
+ ),
+ attrs: { _i: "12-" + $30 },
+ },
+ [
+ _c("bing-math", {
+ key: _vm._$s(
+ "13-" + $30,
+ "a-key",
+ "math-" + item.id
+ ),
+ staticClass: _vm._$s(
+ "13-" + $30,
+ "sc",
+ "bing-math"
+ ),
+ attrs: {
+ latex: item.content,
+ _i: "13-" + $30,
+ },
+ }),
+ ],
+ 1
+ ),
+ ]
+ ),
]
- ),
- ]
- )
- }
- ),
- 0
+ )
+ }
+ ),
+ 0
+ ),
+ ]
),
]
),
_c(
"view",
- { staticClass: _vm._$s(12, "sc", "box-2"), attrs: { _i: 12 } },
+ { staticClass: _vm._$s(14, "sc", "box-2"), attrs: { _i: 14 } },
[
_c(
"view",
- { staticClass: _vm._$s(13, "sc", "flex_col"), attrs: { _i: 13 } },
+ { staticClass: _vm._$s(15, "sc", "flex_col"), attrs: { _i: 15 } },
[
_c(
"view",
{
- staticClass: _vm._$s(14, "sc", "flex_grow"),
- attrs: { _i: 14 },
+ staticClass: _vm._$s(16, "sc", "flex_grow"),
+ attrs: { _i: 16 },
},
[
_c("input", {
@@ -384,9 +413,9 @@ var render = function () {
expression: "content",
},
],
- staticClass: _vm._$s(15, "sc", "content"),
- attrs: { _i: 15 },
- domProps: { value: _vm._$s(15, "v-model", _vm.content) },
+ staticClass: _vm._$s(17, "sc", "content"),
+ attrs: { _i: 17 },
+ domProps: { value: _vm._$s(17, "v-model", _vm.content) },
on: {
focus: _vm.focus,
confirm: _vm.send,
@@ -401,8 +430,8 @@ var render = function () {
]
),
_c("button", {
- staticClass: _vm._$s(16, "sc", "send"),
- attrs: { _i: 16 },
+ staticClass: _vm._$s(18, "sc", "send"),
+ attrs: { _i: 18 },
on: { click: _vm.send },
}),
]
@@ -661,7 +690,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _HBu
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("/* WEBPACK VAR INJECTION */(function(__f__) {\n\nvar _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 1);\nvar _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 4);\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 19));\nvar _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 21));\nvar _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 27));\nvar base64 = _interopRequireWildcard(__webpack_require__(/*! base-64 */ 28));\nvar _cryptoJs = _interopRequireDefault(__webpack_require__(/*! ../../static/crypto-js/crypto-js.js */ 32));\nvar _parser = _interopRequireDefault(__webpack_require__(/*! ../../static/fast-xml-parser/src/parser */ 190));\nvar utf8 = _interopRequireWildcard(__webpack_require__(/*! utf8 */ 199));\nvar _miniprogramFetch = _interopRequireDefault(__webpack_require__(/*! miniprogram-fetch */ 200));\nvar _axios = _interopRequireDefault(__webpack_require__(/*! axios */ 210));\nvar _bingMath = _interopRequireDefault(__webpack_require__(/*! @/components/bing-math/bing-math.vue */ 10));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nvar _default = {\n components: {\n 'bing-math': _bingMath.default\n },\n data: function data() {\n return {\n talkList: [],\n ajax: {\n rows: 20,\n //每页数量\n page: 1,\n //页码\n flag: false,\n // 请求开关\n loading: false,\n // 加载中\n loadText: '正在获取消息'\n },\n keyboardHeight: 0,\n showplc: true,\n content: '',\n c_content: '',\n n_content: '',\n timer: '',\n TEXT: '你好,我的名字叫大',\n APPID: '2eda6c2e',\n // 控制台获取填写\n APIKey: '12ec1f9d113932575fc4b114a2f60ffd',\n APISecret: 'MDEyMzE5YTc5YmQ5NjMwOTU1MWY4N2Y2',\n sparkResult: '',\n historyTextList: [],\n // 历史会话信息,由于最大token12000,可以结合实际使用,进行移出\n tempRes: '' // 临时答复保存\n };\n },\n mounted: function mounted() {\n var _this = this;\n this.$nextTick(function () {\n _this.getHistoryMsg();\n });\n uni.onKeyboardHeightChange(function (e) {\n var h = _this.keyboardHeight;\n _this.keyboardHeight = e.height;\n if (e.height == 0) h *= -1;else h = e.height;\n uni.createSelectorQuery().selectViewport().scrollOffset(function (res) {\n var scrollTop = res.scrollTop; // 页面滚动距离\n uni.pageScrollTo({\n scrollTop: scrollTop + h,\n // 当前位置向下滚动\n duration: 0 // 滚动过渡时间为300ms,默认值为300ms\n });\n }).exec();\n });\n },\n beforeDestroy: function beforeDestroy() {\n uni.offKeyboardHeightChange();\n },\n onPageScroll: function onPageScroll(e) {\n if (e.scrollTop < 5) {\n this.getHistoryMsg();\n }\n },\n watch: {\n n_content: function n_content(n, o) {\n var _this2 = this;\n // this.c_content = n;\n if (this.timer) clearInterval(this.timer);\n var cl = this.c_content.length;\n var nc = this.n_content.split('');\n this.timer = setInterval(function () {\n if (cl < nc.length) {\n _this2.c_content += nc[cl];\n cl++;\n if (cl % 6 == 0) _this2.$nextTick(function () {\n uni.pageScrollTo({\n scrollTop: 999999\n });\n\n // uni.createSelectorQuery()\n // .in(this)\n // .select('.box-1')\n // .boundingClientRect((rect) => {\n // const height = rect?.height;\n // console.log(height, rect);\n // })\n // .exec();\n });\n } else {\n clearInterval(_this2.timer);\n _this2.$nextTick(function () {\n uni.pageScrollTo({\n scrollTop: 9999999\n });\n });\n }\n }, 60);\n }\n },\n methods: {\n copyText: function copyText(str) {\n uni.setClipboardData({\n data: str,\n success: function success() {\n uni.showToast({\n icon: 'none',\n title: '复制成功'\n });\n }\n });\n },\n // 获取历史消息\n getHistoryMsg: function getHistoryMsg() {\n var _this3 = this;\n if (!this.ajax.flag) {\n return; //\n }\n\n // 此处用到 ES7 的 async/await 知识,为使代码更加优美。不懂的请自行学习。\n var get = /*#__PURE__*/function () {\n var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {\n var data, selector;\n return _regenerator.default.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _this3.hideLoadTips();\n _this3.ajax.flag = false;\n _context.next = 4;\n return _this3.joinHistoryMsg();\n case 4:\n data = _context.sent;\n __f__(\"log\", '----- 模拟数据格式,供参考 -----', \" at pages/index/index.vue:160\");\n __f__(\"log\", data, \" at pages/index/index.vue:161\"); // 查看请求返回的数据结构 \n\n // 获取待滚动元素选择器,解决插入数据后,滚动条定位时使用\n selector = '';\n if (_this3.ajax.page > 1) {\n // 非第一页,则取历史消息数据的第一条信息元素\n selector = \"#msg-\".concat(_this3.talkList[0].id);\n } else {\n // 第一页,则取当前消息数据的最后一条信息元素\n selector = \"#msg-\".concat(data[data.length - 1].id);\n }\n\n // 将获取到的消息数据合并到消息数组中\n _this3.talkList = [].concat((0, _toConsumableArray2.default)(data), (0, _toConsumableArray2.default)(_this3.talkList));\n\n // 数据挂载后执行,不懂的请自行阅读 Vue.js 文档对 Vue.nextTick 函数说明。\n _this3.$nextTick(function () {\n // 设置当前滚动的位置\n _this3.setPageScrollTo(selector);\n _this3.hideLoadTips(true);\n if (data.length < _this3.ajax.rows) {\n // 当前消息数据条数小于请求要求条数时,则无更多消息,不再允许请求。\n // 可在此处编写无更多消息数据时的逻辑\n } else {\n _this3.ajax.page++;\n\n // 延迟 200ms ,以保证设置窗口滚动已完成\n setTimeout(function () {\n _this3.ajax.flag = true;\n }, 200);\n }\n });\n case 11:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return function get() {\n return _ref.apply(this, arguments);\n };\n }();\n get();\n },\n // 拼接历史记录消息,正式项目可替换为请求历史记录接口\n joinHistoryMsg: function joinHistoryMsg() {\n var _this4 = this;\n var join = function join() {\n var arr = [];\n\n //通过当前页码及页数,模拟数据内容\n var startIndex = (_this4.ajax.page - 1) * _this4.ajax.rows;\n var endIndex = startIndex + _this4.ajax.rows;\n for (var i = startIndex; i < endIndex; i++) {\n arr.push({\n \"id\": i,\n // 消息的ID\n \"content\": \"\\u8FD9\\u662F\\u5386\\u53F2\\u8BB0\\u5F55\\u7684\\u7B2C\".concat(i + 1, \"\\u6761\\u6D88\\u606F\"),\n // 消息内容\n \"type\": Math.random() > 0.5 ? 1 : 0,\n // 此为消息类别,设 1 为发出去的消息,0 为收到对方的消息,\n \"pic\": \"/static/avatar.png\" // 头像\n });\n }\n\n /*\n \t颠倒数组中元素的顺序。将最新的数据排在本次接口返回数据的最后面。\n \t后端接口按 消息的时间降序查找出当前页的数据后,再将本页数据按消息时间降序排序返回。\n \t这是数据的重点,因为页面滚动条和上拉加载历史的问题。\n */\n arr.reverse();\n return arr;\n };\n\n // 此处用到 ES6 的 Promise 知识,不懂的请自行学习。\n return new Promise(function (done, fail) {\n // 无数据请求接口,由 setTimeout 模拟,正式项目替换为 ajax 即可。\n setTimeout(function () {\n var data = join();\n done(data);\n }, 1500);\n });\n },\n focus: function focus() {\n uni.pageScrollTo({\n top: this.keyboardHeight\n });\n },\n // 设置页面滚动位置\n setPageScrollTo: function setPageScrollTo(selector) {\n var view = uni.createSelectorQuery().in(this).select(selector);\n view.boundingClientRect(function (res) {\n uni.pageScrollTo({\n scrollTop: res.top - 30,\n // -30 为多显示出大半个消息的高度,示意上面还有信息。\n duration: 0\n });\n }).exec();\n },\n // 隐藏加载提示\n hideLoadTips: function hideLoadTips(flag) {\n var _this5 = this;\n if (flag) {\n this.ajax.loadText = '消息获取成功';\n setTimeout(function () {\n _this5.ajax.loading = false;\n }, 300);\n } else {\n this.ajax.loading = true;\n this.ajax.loadText = '正在获取消息';\n }\n },\n // 发送信息\n send: function send() {\n var _this6 = this;\n if (!this.content) {\n uni.showToast({\n title: '请输入有效的内容',\n icon: 'none'\n });\n return;\n }\n // 将当前发送信息 添加到消息列表。\n var data = {\n \"id\": new Date().getTime(),\n \"content\": this.content,\n \"type\": 1,\n \"pic\": \"/static/avatar.png\"\n };\n this.TEXT = this.content;\n this.n_content = '';\n this.c_content = '';\n this.talkList.push(data);\n this.talkList.push({\n \"id\": new Date().getTime(),\n \"content\": '',\n \"type\": 2,\n \"pic\": \"/static/avatar.png\"\n });\n this.$nextTick(function () {\n // 清空内容框中的内容\n _this6.content = '';\n uni.pageScrollTo({\n scrollTop: 999999,\n // 设置一个超大值,以保证滚动条滚动到底部\n duration: 0\n });\n });\n this.sendToSpark();\n },\n sendToSpark: function sendToSpark() {\n var _this7 = this;\n return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {\n var myUrl, realThis;\n return _regenerator.default.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return _this7.getWebSocketUrl();\n case 2:\n myUrl = _context2.sent;\n _this7.tempRes = \"\";\n // this.sparkResult = \"\";\n realThis = _this7;\n _this7.socketTask = uni.connectSocket({\n //url: encodeURI(encodeURI(myUrl).replace(/\\+/g, '%2B')),\n url: myUrl,\n method: 'GET',\n success: function success(res) {\n __f__(\"log\", res, \"ws成功连接...\", myUrl, \" at pages/index/index.vue:310\");\n realThis.wsLiveFlag = true;\n }\n });\n realThis.socketTask.onError(function (res) {\n __f__(\"log\", \"连接发生错误,请检查appid是否填写\", res, \" at pages/index/index.vue:315\");\n });\n realThis.socketTask.onOpen(function (res) {\n _this7.historyTextList.push({\n \"role\": \"user\",\n \"content\": _this7.TEXT\n });\n __f__(\"info\", \"wss的onOpen成功执行...\", res, \" at pages/index/index.vue:322\");\n // 第一帧..........................................\n __f__(\"log\", 'open成功...', \" at pages/index/index.vue:324\");\n var params = {\n \"header\": {\n \"app_id\": _this7.APPID,\n \"uid\": \"aef9f963-7\"\n },\n \"parameter\": {\n \"chat\": {\n \"domain\": \"generalv2\",\n \"temperature\": 0.5,\n \"max_tokens\": 1024\n }\n },\n \"payload\": {\n \"message\": {\n \"text\": _this7.historyTextList\n }\n }\n };\n __f__(\"log\", \"请求的params:\" + JSON.stringify(params), \" at pages/index/index.vue:343\");\n _this7.sparkResult = _this7.sparkResult + \"\\r\\n我:\" + _this7.TEXT + \"\\r\\n\";\n _this7.sparkResult = _this7.sparkResult + \"大模型:\";\n __f__(\"log\", \"发送第一帧...\", params, \" at pages/index/index.vue:346\");\n realThis.socketTask.send({\n // 发送消息,,都用uni的官方版本\n data: JSON.stringify(params),\n success: function success() {\n __f__(\"log\", '第一帧发送成功', \" at pages/index/index.vue:350\");\n }\n });\n });\n\n // 接受到消息时\n realThis.socketTask.onMessage(function (res) {\n __f__(\"log\", '收到API返回的内容:', res.data, \" at pages/index/index.vue:357\");\n var obj = JSON.parse(res.data);\n // console.log(\"我打印的\"+obj.payload);\n var dataArray = obj.payload.choices.text;\n for (var i = 0; i < dataArray.length; i++) {\n realThis.sparkResult = realThis.sparkResult + dataArray[i].content;\n _this7.talkList[_this7.talkList.length - 1].content += dataArray[i].content;\n _this7.n_content = _this7.talkList[_this7.talkList.length - 1].content;\n realThis.tempRes = realThis.tempRes + dataArray[i].content;\n }\n // realThis.sparkResult =realThis.sparkResult+ \n var temp = JSON.parse(res.data);\n // console.log(\"0726\",temp.header.code)\n if (temp.header.code !== 0) {\n __f__(\"log\", \"\".concat(temp.header.code, \":\").concat(temp.message), \" at pages/index/index.vue:371\");\n realThis.socketTask.close({\n success: function success(res) {\n __f__(\"log\", '关闭成功', res, \" at pages/index/index.vue:374\");\n realThis.wsLiveFlag = false;\n },\n fail: function fail(err) {\n __f__(\"log\", '关闭失败', err, \" at pages/index/index.vue:378\");\n }\n });\n }\n if (temp.header.code === 0) {\n if (res.data && temp.header.status === 2) {\n realThis.sparkResult = realThis.sparkResult + \"\\r\\n**********************************************\";\n _this7.historyTextList.push({\n \"role\": \"assistant\",\n \"content\": _this7.tempRes\n });\n /* let dataArray= obj.payload.choices.text;\n for(let i=0;i 1) {\n // 非第一页,则取历史消息数据的第一条信息元素\n selector = \"#msg-\".concat(_this3.talkList[0].id);\n } else {\n // 第一页,则取当前消息数据的最后一条信息元素\n selector = \"#msg-\".concat(data[data.length - 1].id);\n }\n\n // 将获取到的消息数据合并到消息数组中\n _this3.talkList = [].concat((0, _toConsumableArray2.default)(data), (0, _toConsumableArray2.default)(_this3.talkList));\n\n // 数据挂载后执行,不懂的请自行阅读 Vue.js 文档对 Vue.nextTick 函数说明。\n _this3.$nextTick(function () {\n // 设置当前滚动的位置\n _this3.setPageScrollTo(selector);\n _this3.hideLoadTips(true);\n if (data.length < _this3.ajax.rows) {\n // 当前消息数据条数小于请求要求条数时,则无更多消息,不再允许请求。\n // 可在此处编写无更多消息数据时的逻辑\n } else {\n _this3.ajax.page++;\n\n // 延迟 200ms ,以保证设置窗口滚动已完成\n setTimeout(function () {\n _this3.ajax.flag = true;\n }, 200);\n }\n });\n case 11:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return function get() {\n return _ref.apply(this, arguments);\n };\n }();\n get();\n },\n // 拼接历史记录消息\n joinHistoryMsg: function joinHistoryMsg() {\n var _this4 = this;\n var join = function join() {\n var arr = [];\n\n //通过当前页码及页数,模拟数据内容\n var startIndex = (_this4.ajax.page - 1) * _this4.ajax.rows;\n var endIndex = startIndex + _this4.ajax.rows;\n for (var i = startIndex; i < endIndex; i++) {\n arr.push({\n \"id\": i,\n // 消息的ID\n \"content\": \"\\u8FD9\\u662F\\u5386\\u53F2\\u8BB0\\u5F55\\u7684\\u7B2C\".concat(i + 1, \"\\u6761\\u6D88\\u606F\"),\n // 消息内容\n \"type\": Math.random() > 0.5 ? 1 : 0,\n // 此为消息类别,设 1 为发出去的消息,0 为收到对方的消息,\n \"pic\": \"/static/avatar.png\" // 头像\n });\n }\n\n /*\n \t颠倒数组中元素的顺序。将最新的数据排在本次接口返回数据的最后面。\n \t后端接口按 消息的时间降序查找出当前页的数据后,再将本页数据按消息时间降序排序返回。\n \t这是数据的重点,因为页面滚动条和上拉加载历史的问题。\n */\n arr.reverse();\n return arr;\n };\n\n // 此处用到 ES6 的 Promise 知识,不懂的请自行学习。\n return new Promise(function (done, fail) {\n // 无数据请求接口,由 setTimeout 模拟,正式项目替换为 ajax 即可。\n setTimeout(function () {\n var data = join();\n done(data);\n }, 1500);\n });\n },\n focus: function focus() {\n uni.pageScrollTo({\n top: this.keyboardHeight\n });\n },\n // 设置页面滚动位置\n setPageScrollTo: function setPageScrollTo(selector) {\n var view = uni.createSelectorQuery().in(this).select(selector);\n view.boundingClientRect(function (res) {\n uni.pageScrollTo({\n scrollTop: res.top - 30,\n // -30 为多显示出大半个消息的高度,示意上面还有信息。\n duration: 0\n });\n }).exec();\n },\n // 隐藏加载提示\n hideLoadTips: function hideLoadTips(flag) {\n var _this5 = this;\n if (flag) {\n this.ajax.loadText = '消息获取成功';\n setTimeout(function () {\n _this5.ajax.loading = false;\n }, 300);\n } else {\n this.ajax.loading = true;\n this.ajax.loadText = '正在获取消息';\n }\n },\n // 发送信息\n send: function send() {\n var _this6 = this;\n if (!this.content) {\n uni.showToast({\n title: '请输入有效的内容',\n icon: 'none'\n });\n return;\n }\n try {\n clearInterval(this.timer);\n this.talkList[this.talkList.length - 1].content = this.c_content + '';\n this.c_content = '';\n this.n_content = '';\n this.socketTask.close({\n success: function success(res) {\n __f__(\"log\", '关闭成功', res, \" at pages/index/index.vue:276\");\n _this6.wsLiveFlag = false;\n },\n fail: function fail(err) {\n __f__(\"log\", '关闭失败', err, \" at pages/index/index.vue:280\");\n }\n });\n } catch (e) {\n //TODO handle the exception\n }\n // 将当前发送信息 添加到消息列表。\n var data = {\n \"id\": new Date().getTime(),\n \"content\": this.content,\n \"type\": 1,\n \"pic\": \"/static/avatar.png\"\n };\n this.TEXT = this.content;\n this.n_content = '';\n this.c_content = '';\n this.talkList.push(data);\n this.talkList.push({\n \"id\": new Date().getTime(),\n \"content\": '',\n \"type\": 2,\n \"pic\": \"/static/avatar.png\"\n });\n // return ;\n this.$nextTick(function () {\n // 清空内容框中的内容\n _this6.content = '';\n uni.pageScrollTo({\n scrollTop: 999999,\n // 设置一个超大值,以保证滚动条滚动到底部\n duration: 0\n });\n });\n this.sendToSpark();\n },\n sendToSpark: function sendToSpark() {\n var _this7 = this;\n return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {\n var realThis;\n return _regenerator.default.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n // let myUrl = await this.getWebSocketUrl();\n _this7.tempRes = \"\";\n realThis = _this7;\n _this7.socketTask = uni.connectSocket({\n //url: encodeURI(encodeURI(myUrl).replace(/\\+/g, '%2B')),\n url: 'wss://chat.lihaink.cn/chat',\n method: 'GET',\n success: function success(res) {\n __f__(\"log\", res, \"ws成功连接...\", \" at pages/index/index.vue:324\");\n realThis.wsLiveFlag = true;\n }\n });\n realThis.socketTask.onError(function (res) {\n __f__(\"log\", \"连接发生错误,请检查appid是否填写\", res, \" at pages/index/index.vue:329\");\n });\n realThis.socketTask.onOpen(function (res) {\n _this7.historyTextList.push({\n \"role\": \"user\",\n \"content\": _this7.TEXT\n });\n // 第一帧..........................................\n __f__(\"log\", '连接成功...', \" at pages/index/index.vue:337\");\n // let params = {\n // \"header\": {\n // \"app_id\": this.APPID,\n // \"uid\": \"aef9f963-7\"\n // },\n // \"parameter\": {\n // \"chat\": {\n // \"domain\": \"generalv2\",\n // \"temperature\": 0.5,\n // \"max_tokens\": 1024\n // }\n // },\n // \"payload\": {\n // \"message\": {\n // \"text\": this.historyTextList\n // }\n // }\n // };\n var params = _this7.TEXT;\n realThis.socketTask.send({\n // 发送消息,,都用uni的官方版本\n data: JSON.stringify(params),\n success: function success() {\n __f__(\"log\", '第一帧发送成功', \" at pages/index/index.vue:360\");\n }\n });\n });\n\n // 接受到消息时\n realThis.socketTask.onMessage(function (res) {\n __f__(\"log\", '收到API返回的内容:', res.data, \" at pages/index/index.vue:367\");\n var obj = JSON.parse(res.data);\n // console.log(\"我打印的\"+obj.payload);\n var dataArray = obj.payload.choices.text;\n for (var i = 0; i < dataArray.length; i++) {\n _this7.talkList[_this7.talkList.length - 1].content += dataArray[i].content;\n _this7.n_content = _this7.talkList[_this7.talkList.length - 1].content;\n realThis.tempRes = realThis.tempRes + dataArray[i].content;\n }\n var temp = JSON.parse(res.data);\n // console.log(\"0726\",temp.header.code)\n if (temp.header.code !== 0) {\n __f__(\"log\", \"\".concat(temp.header.code, \":\").concat(temp.message), \" at pages/index/index.vue:379\");\n realThis.socketTask.close({\n success: function success(res) {\n __f__(\"log\", '关闭成功', res, \" at pages/index/index.vue:382\");\n realThis.wsLiveFlag = false;\n },\n fail: function fail(err) {\n __f__(\"log\", '关闭失败', err, \" at pages/index/index.vue:386\");\n }\n });\n }\n if (temp.header.code === 0) {\n if (res.data && temp.header.status === 2) {\n _this7.historyTextList.push({\n \"role\": \"assistant\",\n \"content\": _this7.tempRes\n });\n setTimeout(function () {\n realThis.socketTask.close({\n success: function success(res) {\n __f__(\"log\", '关闭成功', res, \" at pages/index/index.vue:399\");\n },\n fail: function fail(err) {\n // console.log('关闭失败', err)\n }\n });\n }, 1000);\n }\n }\n });\n case 6:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }))();\n },\n // 鉴权\n getWebSocketUrl: function getWebSocketUrl() {\n var _this8 = this;\n return new Promise(function (resolve, reject) {\n // https://spark-api.xf-yun.com/v1.1/chat V1.5 domain general\n // https://spark-api.xf-yun.com/v2.1/chat V2.0 domain generalv2\n var url = \"wss://spark-api.xf-yun.com/v2.1/chat\";\n var host = \"spark-api.xf-yun.com\";\n var apiKeyName = \"api_key\";\n var date = new Date().toGMTString();\n var algorithm = \"hmac-sha256\";\n var headers = \"host date request-line\";\n var signatureOrigin = \"host: \".concat(host, \"\\ndate: \").concat(date, \"\\nGET /v2.1/chat HTTP/1.1\");\n var signatureSha = _cryptoJs.default.HmacSHA256(signatureOrigin, _this8.APISecret);\n var signature = _cryptoJs.default.enc.Base64.stringify(signatureSha);\n var authorizationOrigin = \"\".concat(apiKeyName, \"=\\\"\").concat(_this8.APIKey, \"\\\", algorithm=\\\"\").concat(algorithm, \"\\\", headers=\\\"\").concat(headers, \"\\\", signature=\\\"\").concat(signature, \"\\\"\");\n var authorization = base64.encode(authorizationOrigin);\n url = \"\".concat(url, \"?authorization=\").concat(authorization, \"&date=\").concat(encodeURI(date), \"&host=\").concat(host);\n\n // console.log(url)\n resolve(url);\n });\n },\n // 滚动到头部\n bindScroll: function bindScroll() {\n if (this.userId == 0) {\n this.getHistory();\n this.getproductInfo();\n this.getOrderInfo();\n this.getRefundDetail();\n this.getStoreDetail();\n } else {\n this.getMerHistory();\n }\n }\n }\n};\nexports.default = _default;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/lib/format-log.js */ 18)[\"default\"]))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLC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oO1xyXG4gICAgICAgIGxldCBuYyA9IHRoaXMubl9jb250ZW50LnNwbGl0KCcnKVxyXG4gICAgICAgIHRoaXMudGltZXIgPSBzZXRJbnRlcnZhbCgoKSA9PiB7XHJcbiAgICAgICAgICBpZiAoY2wgPCBuYy5sZW5ndGgpIHtcclxuICAgICAgICAgICAgdGhpcy5jX2NvbnRlbnQgKz0gbmNbY2xdO1xyXG4gICAgICAgICAgICBjbCsrO1xyXG4gICAgICAgICAgICBpZiAoY2wgJSA2ID09IDApIHRoaXMuJG5leHRUaWNrKCgpPT57XHJcbiAgICAgICAgICAgICAgdW5pLnBhZ2VTY3JvbGxUbyh7XHJcbiAgICAgICAgICAgICAgICBzY3JvbGxUb3A6IDk5OTk5OSxcclxuICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aGlzLnRpbWVyKTtcclxuICAgICAgICAgICAgdGhpcy4kbmV4dFRpY2soKCkgPT4ge1xyXG4gICAgICAgICAgICAgIHVuaS5wYWdlU2Nyb2xsVG8oe1xyXG4gICAgICAgICAgICAgICAgc2Nyb2xsVG9wOiA5OTk5OTk5LFxyXG4gICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgfSwgNjApXHJcbiAgICAgIH1cclxuICAgIH0sXHJcbiAgICBtZXRob2RzOiB7XHJcbiAgICAgIGNvcHlUZXh0KHN0cikge1xyXG4gICAgICAgIHVuaS5zZXRDbGlwYm9hcmREYXRhKHtcclxuICAgICAgICAgIGRhdGE6IHN0cixcclxuICAgICAgICAgIHN1Y2Nlc3M6IGZ1bmN0aW9uKCkge1xyXG4gICAgICAgICAgICB1bmkuc2hvd1RvYXN0KHtcclxuICAgICAgICAgICAgICBpY29uOiAnbm9uZScsXHJcbiAgICAgICAgICAgICAgdGl0bGU6ICflpI3liLbmiJDlip8nXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgICB9LFxyXG4gICAgICAvLyDojrflj5bljoblj7Lmtojmga9cclxuICAgICAgZ2V0SGlzdG9yeU1zZygpIHtcclxuICAgICAgICBpZiAoIXRoaXMuYWpheC5mbGFnKSB7XHJcbiAgICAgICAgICByZXR1cm47IC8vXHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBsZXQgZ2V0ID0gYXN5bmMgKCkgPT4ge1xyXG4gICAgICAgICAgdGhpcy5oaWRlTG9hZFRpcHMoKTtcclxuICAgICAgICAgIHRoaXMuYWpheC5mbGFnID0gZmFsc2U7XHJcbiAgICAgICAgICBsZXQgZGF0YSA9IGF3YWl0IHRoaXMuam9pbkhpc3RvcnlNc2coKTtcclxuXHJcbiAgICAgICAgICBjb25zb2xlLmxvZygnLS0tLS0g5qih5ouf5pWw5o2u5qC85byP77yM5L6b5Y+C6ICDIC0tLS0tJyk7XHJcbiAgICAgICAgICBjb25zb2xlLmxvZyhkYXRhKTsgLy8g5p+l55yL6K+35rGC6L+U5Zue55qE5pWw5o2u57uT5p6EIFxyXG5cclxuICAgICAgICAgIC8vIOiOt+WPluW+hea7muWKqOWFg+e0oOmAieaLqeWZqO+8jOino+WGs+aPkuWFpeaVsOaNruWQju+8jOa7muWKqOadoeWumuS9jeaXtuS9v+eUqFxyXG4gICAgICAgICAgbGV0IHNlbGVjdG9yID0gJyc7XHJcblxyXG4gICAgICAgICAgaWYgKHRoaXMuYWpheC5wYWdlID4gMSkge1xyXG4gICAgICAgICAgICAvLyDpnZ7nrKzkuIDpobXvvIzliJnlj5bljoblj7Lmtojmga/mlbDmja7nmoTnrKzkuIDmnaHkv6Hmga/lhYPntKBcclxuICAgICAgICAgICAgc2VsZWN0b3IgPSBgI21zZy0ke3RoaXMudGFsa0xpc3RbMF0uaWR9YDtcclxuICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIC8vIOesrOS4gOmhte+8jOWImeWPluW9k+WJjea2iOaBr+aVsOaNrueahOacgOWQjuS4gOadoeS/oeaBr+WFg+e0oFxyXG4gICAgICAgICAgICBzZWxlY3RvciA9IGAjbXNnLSR7ZGF0YVtkYXRhLmxlbmd0aC0xXS5pZH1gO1xyXG4gICAgICAgICAgfVxyXG5cclxuICAgICAgICAgIC8vIOWwhuiOt+WPluWIsOeahOa2iOaBr+aVsOaNruWQiOW5tuWIsOa2iOaBr+aVsOe7hOS4rVxyXG4gICAgICAgICAgdGhpcy50YWxrTGlzdCA9IFsuLi5kYXRhLCAuLi50aGlzLnRhbGtMaXN0XTtcclxuXHJcbiAgICAgICAgICAvLyDmlbDmja7mjILovb3lkI7miafooYzvvIzkuI3mh4LnmoTor7foh6rooYzpmIXor7sgVnVlLmpzIOaWh+aho+WvuSBWdWUubmV4dFRpY2sg5Ye95pWw6K+05piO44CCXHJcbiAgICAgICAgICB0aGlzLiRuZXh0VGljaygoKSA9PiB7XHJcbiAgICAgICAgICAgIC8vIOiuvue9ruW9k+WJjea7muWKqOeahOS9jee9rlxyXG4gICAgICAgICAgICB0aGlzLnNldFBhZ2VTY3JvbGxUbyhzZWxlY3Rvcik7XHJcblxyXG4gICAgICAgICAgICB0aGlzLmhpZGVMb2FkVGlwcyh0cnVlKTtcclxuXHJcbiAgICAgICAgICAgIGlmIChkYXRhLmxlbmd0aCA8IHRoaXMuYWpheC5yb3dzKSB7XHJcbiAgICAgICAgICAgICAgLy8g5b2T5YmN5raI5oGv5pWw5o2u5p2h5pWw5bCP5LqO6K+35rGC6KaB5rGC5p2h5pWw5pe277yM5YiZ5peg5pu05aSa5raI5oGv77yM5LiN5YaN5YWB6K646K+35rGC44CCXHJcbiAgICAgICAgICAgICAgLy8g5Y+v5Zyo5q2k5aSE57yW5YaZ5peg5pu05aSa5raI5oGv5pWw5o2u5pe255qE6YC76L6RXHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgdGhpcy5hamF4LnBhZ2UrKztcclxuXHJcbiAgICAgICAgICAgICAgLy8g5bu26L+fIDIwMG1zIO+8jOS7peS/neivgeiuvue9rueql+WPo+a7muWKqOW3suWujOaIkFxyXG4gICAgICAgICAgICAgIHNldFRpbWVvdXQoKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5hamF4LmZsYWcgPSB0cnVlO1xyXG4gICAgICAgICAgICAgIH0sIDIwMClcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgIH0pXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGdldCgpO1xyXG4gICAgICB9LFxyXG4gICAgICAvLyDmi7zmjqXljoblj7LorrDlvZXmtojmga9cclxuICAgICAgam9pbkhpc3RvcnlNc2coKSB7XHJcbiAgICAgICAgbGV0IGpvaW4gPSAoKSA9PiB7XHJcbiAgICAgICAgICBsZXQgYXJyID0gW107XHJcblxyXG4gICAgICAgICAgLy/pgJrov4flvZPliY3pobXnoIHlj4rpobXmlbDvvIzmqKHmi5/mlbDmja7lhoXlrrlcclxuICAgICAgICAgIGxldCBzdGFydEluZGV4ID0gKHRoaXMuYWpheC5wYWdlIC0gMSkgKiB0aGlzLmFqYXgucm93cztcclxuICAgICAgICAgIGxldCBlbmRJbmRleCA9IHN0YXJ0SW5kZXggKyB0aGlzLmFqYXgucm93cztcclxuICAgICAgICAgIGZvciAobGV0IGkgPSBzdGFydEluZGV4OyBpIDwgZW5kSW5kZXg7IGkrKykge1xyXG4gICAgICAgICAgICBhcnIucHVzaCh7XHJcbiAgICAgICAgICAgICAgXCJpZFwiOiBpLCAvLyDmtojmga/nmoRJRFxyXG4gICAgICAgICAgICAgIFwiY29udGVudFwiOiBg6L+Z5piv5Y6G5Y+y6K6w5b2V55qE56ysJHtpKzF95p2h5raI5oGvYCwgLy8g5raI5oGv5YaF5a65XHJcbiAgICAgICAgICAgICAgXCJ0eXBlXCI6IE1hdGgucmFuZG9tKCkgPiAwLjUgPyAxIDogMCwgLy8g5q2k5Li65raI5oGv57G75Yir77yM6K6+IDEg5Li65Y+R5Ye65Y6755qE5raI5oGv77yMMCDkuLrmlLbliLDlr7nmlrnnmoTmtojmga8sXHJcbiAgICAgICAgICAgICAgXCJwaWNcIjogXCIvc3RhdGljL2F2YXRhci5wbmdcIiAvLyDlpLTlg49cclxuICAgICAgICAgICAgfSlcclxuICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAvKlxyXG4gICAgICAgICAgXHTpoqDlgJLmlbDnu4TkuK3lhYPntKDnmoTpobrluo/jgILlsIbmnIDmlrDnmoTmlbDmja7mjpLlnKjmnKzmrKHmjqXlj6Pov5Tlm57mlbDmja7nmoTmnIDlkI7pnaLjgIJcclxuICAgICAgICAgIFx05ZCO56uv5o6l5Y+j5oyJIOa2iOaBr+eahOaXtumXtOmZjeW6j+afpeaJvuWHuuW9k+WJjemhteeahOaVsOaNruWQju+8jOWGjeWwhuacrOmhteaVsOaNruaMiea2iOaBr+aXtumXtOmZjeW6j+aOkuW6j+i/lOWbnuOAglxyXG4gICAgICAgICAgXHTov5nmmK/mlbDmja7nmoTph43ngrnvvIzlm6DkuLrpobXpnaLmu5rliqjmnaHlkozkuIrmi4nliqDovb3ljoblj7LnmoTpl67popjjgIJcclxuICAgICAgICAgICAqL1xyXG4gICAgICAgICAgYXJyLnJldmVyc2UoKTtcclxuXHJcbiAgICAgICAgICByZXR1cm4gYXJyO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8g5q2k5aSE55So5YiwIEVTNiDnmoQgUHJvbWlzZSDnn6Xor4bvvIzkuI3mh4LnmoTor7foh6rooYzlrabkuaDjgIJcclxuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKGRvbmUsIGZhaWwpID0+IHtcclxuICAgICAgICAgIC8vIOaXoOaVsOaNruivt+axguaOpeWPo++8jOeUsSBzZXRUaW1lb3V0IOaooeaLn++8jOato+W8j+mhueebruabv+aNouS4uiBhamF4IOWNs+WPr+OAglxyXG4gICAgICAgICAgc2V0VGltZW91dCgoKSA9PiB7XHJcbiAgICAgICAgICAgIGxldCBkYXRhID0gam9pbigpO1xyXG4gICAgICAgICAgICBkb25lKGRhdGEpO1xyXG4gICAgICAgICAgfSwgMTUwMCk7XHJcbiAgICAgICAgfSlcclxuICAgICAgfSxcclxuICAgICAgZm9jdXMoKXtcclxuICAgICAgICB1bmkucGFnZVNjcm9sbFRvKHtcclxuICAgICAgICAgIHRvcDogdGhpcy5rZXlib2FyZEhlaWdodFxyXG4gICAgICAgIH0pXHJcbiAgICAgIH0sXHJcbiAgICAgIC8vIOiuvue9rumhtemdoua7muWKqOS9jee9rlxyXG4gICAgICBzZXRQYWdlU2Nyb2xsVG8oc2VsZWN0b3IpIHtcclxuICAgICAgICBsZXQgdmlldyA9IHVuaS5jcmVhdGVTZWxlY3RvclF1ZXJ5KCkuaW4odGhpcykuc2VsZWN0KHNlbGVjdG9yKTtcclxuICAgICAgICB2aWV3LmJvdW5kaW5nQ2xpZW50UmVjdCgocmVzKSA9PiB7XHJcbiAgICAgICAgICB1bmkucGFnZVNjcm9sbFRvKHtcclxuICAgICAgICAgICAgc2Nyb2xsVG9wOiByZXMudG9wIC0gMzAsIC8vIC0zMCDkuLrlpJrmmL7npLrlh7rlpKfljYrkuKrmtojmga/nmoTpq5jluqbvvIznpLrmhI/kuIrpnaLov5jmnInkv6Hmga/jgIJcclxuICAgICAgICAgICAgZHVyYXRpb246IDBcclxuICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0pLmV4ZWMoKTtcclxuICAgICAgfSxcclxuICAgICAgLy8g6ZqQ6JeP5Yqg6L295o+Q56S6XHJcbiAgICAgIGhpZGVMb2FkVGlwcyhmbGFnKSB7XHJcbiAgICAgICAgaWYgKGZsYWcpIHtcclxuICAgICAgICAgIHRoaXMuYWpheC5sb2FkVGV4dCA9ICfmtojmga/ojrflj5bmiJDlip8nO1xyXG4gICAgICAgICAgc2V0VGltZW91dCgoKSA9PiB7XHJcbiAgICAgICAgICAgIHRoaXMuYWpheC5sb2FkaW5nID0gZmFsc2U7XHJcbiAgICAgICAgICB9LCAzMDApO1xyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICB0aGlzLmFqYXgubG9hZGluZyA9IHRydWU7XHJcbiAgICAgICAgICB0aGlzLmFqYXgubG9hZFRleHQgPSAn5q2j5Zyo6I635Y+W5raI5oGvJztcclxuICAgICAgICB9XHJcbiAgICAgIH0sXHJcbiAgICAgIC8vIOWPkemAgeS/oeaBr1xyXG4gICAgICBzZW5kKCkge1xyXG4gICAgICAgIGlmICghdGhpcy5jb250ZW50KSB7XHJcbiAgICAgICAgICB1bmkuc2hvd1RvYXN0KHtcclxuICAgICAgICAgICAgdGl0bGU6ICfor7fovpPlhaXmnInmlYjnmoTlhoXlrrknLFxyXG4gICAgICAgICAgICBpY29uOiAnbm9uZSdcclxuICAgICAgICAgIH0pXHJcbiAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRyeXtcclxuICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGhpcy50aW1lcik7XHJcbiAgICAgICAgICB0aGlzLnRhbGtMaXN0W3RoaXMudGFsa0xpc3QubGVuZ3RoLTFdLmNvbnRlbnQgPSB0aGlzLmNfY29udGVudCsnJztcclxuICAgICAgICAgIHRoaXMuY19jb250ZW50ID0gJyc7XHJcbiAgICAgICAgICB0aGlzLm5fY29udGVudCA9ICcnO1xyXG4gICAgICAgICAgdGhpcy5zb2NrZXRUYXNrLmNsb3NlKHtcclxuICAgICAgICAgICAgc3VjY2VzczoocmVzKT0+IHtcclxuICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5YWz6Zet5oiQ5YqfJywgcmVzKTtcclxuICAgICAgICAgICAgICB0aGlzLndzTGl2ZUZsYWcgPSBmYWxzZTtcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgZmFpbChlcnIpIHtcclxuICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5YWz6Zet5aSx6LSlJywgZXJyKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICB9KVxyXG4gICAgICAgIH1jYXRjaChlKXtcclxuICAgICAgICAgIC8vVE9ETyBoYW5kbGUgdGhlIGV4Y2VwdGlvblxyXG4gICAgICAgIH1cclxuICAgICAgICAvLyDlsIblvZPliY3lj5HpgIHkv6Hmga8g5re75Yqg5Yiw5raI5oGv5YiX6KGo44CCXHJcbiAgICAgICAgbGV0IGRhdGEgPSB7XHJcbiAgICAgICAgICBcImlkXCI6IG5ldyBEYXRlKCkuZ2V0VGltZSgpLFxyXG4gICAgICAgICAgXCJjb250ZW50XCI6IHRoaXMuY29udGVudCxcclxuICAgICAgICAgIFwidHlwZVwiOiAxLFxyXG4gICAgICAgICAgXCJwaWNcIjogXCIvc3RhdGljL2F2YXRhci5wbmdcIlxyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLlRFWFQgPSB0aGlzLmNvbnRlbnQ7XHJcbiAgICAgICAgdGhpcy5uX2NvbnRlbnQgPSAnJztcclxuICAgICAgICB0aGlzLmNfY29udGVudCA9ICcnO1xyXG4gICAgICAgIHRoaXMudGFsa0xpc3QucHVzaChkYXRhKTtcclxuICAgICAgICB0aGlzLnRhbGtMaXN0LnB1c2goe1xyXG4gICAgICAgICAgXCJpZFwiOiBuZXcgRGF0ZSgpLmdldFRpbWUoKSxcclxuICAgICAgICAgIFwiY29udGVudFwiOiAnJyxcclxuICAgICAgICAgIFwidHlwZVwiOiAyLFxyXG4gICAgICAgICAgXCJwaWNcIjogXCIvc3RhdGljL2F2YXRhci5wbmdcIlxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIC8vIHJldHVybiA7XHJcbiAgICAgICAgdGhpcy4kbmV4dFRpY2soKCkgPT4ge1xyXG4gICAgICAgICAgLy8g5riF56m65YaF5a655qGG5Lit55qE5YaF5a65XHJcbiAgICAgICAgICB0aGlzLmNvbnRlbnQgPSAnJztcclxuICAgICAgICAgIHVuaS5wYWdlU2Nyb2x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aGr5YaZXCIsIHJlcylcclxuICAgICAgICB9KVxyXG4gICAgICAgIHJlYWxUaGlzLnNvY2tldFRhc2sub25PcGVuKChyZXMpID0+IHtcclxuICAgICAgICAgIHRoaXMuaGlzdG9yeVRleHRMaXN0LnB1c2goe1xyXG4gICAgICAgICAgICBcInJvbGVcIjogXCJ1c2VyXCIsXHJcbiAgICAgICAgICAgIFwiY29udGVudFwiOiB0aGlzLlRFWFRcclxuICAgICAgICAgIH0pXHJcbiAgICAgICAgICAvLyDnrKzkuIDluKcuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi5cclxuICAgICAgICAgIGNvbnNvbGUubG9nKCfov57mjqXmiJDlip8uLi4nKVxyXG4gICAgICAgICAgLy8gbGV0IHBhcmFtcyA9IHtcclxuICAgICAgICAgIC8vICAgXCJoZWFkZXJcIjoge1xyXG4gICAgICAgICAgLy8gICAgIFwiYXBwX2lkXCI6IHRoaXMuQVBQSUQsXHJcbiAgICAgICAgICAvLyAgICAgXCJ1aWRcIjogXCJhZWY5Zjk2My03XCJcclxuICAgICAgICAgIC8vICAgfSxcclxuICAgICAgICAgIC8vICAgXCJwYXJhbWV0ZXJcIjoge1xyXG4gICAgICAgICAgLy8gICAgIFwiY2hhdFwiOiB7XHJcbiAgICAgICAgICAvLyAgICAgICBcImRvbWFpblwiOiBcImdlbmVyYWx2MlwiLFxyXG4gICAgICAgICAgLy8gICAgICAgXCJ0ZW1wZXJhdHVyZVwiOiAwLjUsXHJcbiAgICAgICAgICAvLyAgICAgICBcIm1heF90b2tlbnNcIjogMTAyNFxyXG4gICAgICAgICAgLy8gICAgIH1cclxuICAgICAgICAgIC8vICAgfSxcclxuICAgICAgICAgIC8vICAgXCJwYXlsb2FkXCI6IHtcclxuICAgICAgICAgIC8vICAgICBcIm1lc3NhZ2VcIjoge1xyXG4gICAgICAgICAgLy8gICAgICAgXCJ0ZXh0XCI6IHRoaXMuaGlzdG9yeVRleHRMaXN0XHJcbiAgICAgICAgICAvLyAgICAgfVxyXG4gICAgICAgICAgLy8gICB9XHJcbiAgICAgICAgICAvLyB9O1xyXG4gICAgICAgICAgbGV0IHBhcmFtcyA9IHRoaXMuVEVYVFxyXG4gICAgICAgICAgcmVhbFRoaXMuc29ja2V0VGFzay5zZW5kKHsgLy8g5Y+R6YCB5raI5oGv77yM77yM6YO955SodW5p55qE5a6Y5pa554mI5pysXHJcbiAgICAgICAgICAgIGRhdGE6IEpTT04uc3RyaW5naWZ5KHBhcmFtcyksXHJcbiAgICAgICAgICAgIHN1Y2Nlc3MoKSB7XHJcbiAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+esrOS4gOW4p+WPkemAgeaIkOWKnycpXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0pO1xyXG5cclxuICAgICAgICAvLyDmjqXlj5fliLDmtojmga/ml7ZcclxuICAgICAgICByZWFsVGhpcy5zb2NrZXRUYXNrLm9uTWVzc2FnZSgocmVzKSA9PiB7XHJcbiAgICAgICAgICBjb25zb2xlLmxvZygn5pS25YiwQVBJ6L+U5Zue55qE5YaF5a6577yaJywgcmVzLmRhdGEpO1xyXG4gICAgICAgICAgbGV0IG9iaiA9IEpTT04ucGFyc2UocmVzLmRhdGEpXHJcbiAgICAgICAgICAvLyBjb25zb2xlLmxvZyhcIuaIkeaJk+WNsOeahFwiK29iai5wYXlsb2FkKTtcclxuICAgICAgICAgIGxldCBkYXRhQXJyYXkgPSBvYmoucGF5bG9hZC5jaG9pY2VzLnRleHQ7XHJcbiAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGRhdGFBcnJheS5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICB0aGlzLnRhbGtMaXN0W3RoaXMudGFsa0xpc3QubGVuZ3RoIC0gMV0uY29udGVudCArPSBkYXRhQXJyYXlbaV0uY29udGVudDtcclxuICAgICAgICAgICAgdGhpcy5uX2NvbnRlbnQgPSB0aGlzLnRhbGtMaXN0W3RoaXMudGFsa0xpc3QubGVuZ3RoIC0gMV0uY29udGVudDtcclxuICAgICAgICAgICAgcmVhbFRoaXMudGVtcFJlcyA9IHJlYWxUaGlzLnRlbXBSZXMgKyBkYXRhQXJyYXlbaV0uY29udGVudFxyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKHJlcy5kYXRhKVxyXG4gICAgICAgICAgLy8gY29uc29sZS5sb2coXCIwNzI2XCIsdGVtcC5oZWFkZXIuY29kZSlcclxuICAgICAgICAgIGlmICh0ZW1wLmhlYWRlci5jb2RlICE9PSAwKSB7XHJcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKGAke3RlbXAuaGVhZGVyLmNvZGV9OiR7dGVtcC5tZXNzYWdlfWApO1xyXG4gICAgICAgICAgICByZWFsVGhpcy5zb2NrZXRUYXNrLmNsb3NlKHtcclxuICAgICAgICAgICAgICBzdWNjZXNzKHJlcykge1xyXG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+WFs+mXreaIkOWKnycsIHJlcylcclxuICAgICAgICAgICAgICAgIHJlYWxUaGlzLndzTGl2ZUZsYWcgPSBmYWxzZTtcclxuICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgIGZhaWwoZXJyKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5YWz6Zet5aSx6LSlJywgZXJyKVxyXG4gICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSlcclxuICAgICAgICAgIH1cclxuICAgICAgICAgIGlmICh0ZW1wLmhlYWRlci5jb2RlID09PSAwKSB7XHJcbiAgICAgICAgICAgIGlmIChyZXMuZGF0YSAmJiB0ZW1wLmhlYWRlci5zdGF0dXMgPT09IDIpIHtcclxuICAgICAgICAgICAgICB0aGlzLmhpc3RvcnlUZXh0TGlzdC5wdXNoKHtcclxuICAgICAgICAgICAgICAgIFwicm9sZVwiOiBcImFzc2lzdGFudFwiLFxyXG4gICAgICAgICAgICAgICAgXCJjb250ZW50XCI6IHRoaXMudGVtcFJlc1xyXG4gICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgc2V0VGltZW91dCgoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICByZWFsVGhpcy5zb2NrZXRUYXNrLmNsb3NlKHtcclxuICAgICAgICAgICAgICAgICAgc3VjY2VzcyhyZXMpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5YWz6Zet5oiQ5YqfJywgcmVzKVxyXG4gICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICBmYWlsKGVycikge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKCflhbPpl63lpLHotKUnLCBlcnIpXHJcbiAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgfSwgMTAwMClcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfVxyXG4gICAgICAgIH0pXHJcbiAgICAgIH0sXHJcbiAgICAgIC8vIOmJtOadg1xyXG4gICAgICBnZXRXZWJTb2NrZXRVcmwoKSB7XHJcbiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcclxuICAgICAgICAgIC8vIGh0dHBzOi8vc3BhcmstYXBpLnhmLXl1bi5jb20vdjEuMS9jaGF0ICBWMS41IGRvbWFpbiBnZW5lcmFsXHJcbiAgICAgICAgICAvLyBodHRwczovL3NwYXJrLWFwaS54Zi15dW4uY29tL3YyLjEvY2hhdCAgVjIuMCBkb21haW4gZ2VuZXJhbHYyXHJcbiAgICAgICAgICB2YXIgdXJsID0gXCJ3c3M6Ly9zcGFyay1hcGkueGYteXVuLmNvbS92Mi4xL2NoYXRcIjtcclxuICAgICAgICAgIHZhciBob3N0ID0gXCJzcGFyay1hcGkueGYteXVuLmNvbVwiO1xyXG4gICAgICAgICAgdmF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cclxuICAgIC5zZW5kIHtcclxuICAgICAgYmFja2dyb3VuZC1jb2xvcjogIzI1NzNmYjtcclxuICAgICAgY29sb3I6ICNmZmY7XHJcbiAgICAgIGhlaWdodDogNjRycHg7XHJcbiAgICAgIG1hcmdpbi1sZWZ0OiAyMHJweDtcclxuICAgICAgYm9yZGVyLXJhZGl1czogNnJweDtcclxuICAgICAgcGFkZGluZzogMDtcclxuICAgICAgd2lkdGg6IDEyMHJweDtcclxuICAgICAgbGluZS1oZWlnaHQ6IDYycnB4O1xyXG5cclxuICAgICAgJjphY3RpdmUge1xyXG4gICAgICAgIGJhY2tncm91bmQtY29sb3I6ICMxNTczZmI7XHJcbiAgICAgIH1cclxuICAgIH1cclxuICB9XHJcblxyXG4gIC50YWxrLWxpc3Qge1xyXG4gICAgcGFkZGluZy1ib3R0b206IDIwcnB4O1xyXG5cclxuICAgIC8qIOa2iOaBr+mhue+8jOWfuuehgOexuyAqL1xyXG4gICAgLml0ZW0ge1xyXG4gICAgICBwYWRkaW5nOiAyMHJweCAyMHJweCAwIDIwcnB4O1xyXG4gICAgICBhbGlnbi1pdGVtczogZmxleC1zdGFydDtcclxuICAgICAgYWxpZ24tY29udGVudDogZmxleC1zdGFydDtcclxuICAgICAgY29sb3I6ICMzMzM7XHJcblxyXG4gICAgICAucGljIHtcclxuICAgICAgICB3aWR0aDogOTJycHg7XHJcbiAgICAgICAgaGVpZ2h0OiA5MnJweDtcclxuICAgICAgICBib3JkZXItcmFkaXVzOiA1MCU7XHJcbiAgICAgICAgYm9yZGVyOiAjZmZmIHNvbGlkIDFweDtcclxuICAgICAgfVxyXG5cclxuICAgICAgLmNvbnRlbnQge1xyXG4gICAgICAgIHBhZGRpbmc6IDIwcnB4O1xyXG4gICAgICAgIGJvcmRlci1yYWRpdXM6IDRweDtcclxuICAgICAgICBtYXgtd2lkdGg6IDUwMHJweDtcclxuICAgICAgICB3b3JkLWJyZWFrOiBicmVhay1hbGw7XHJcbiAgICAgICAgbGluZS1oZWlnaHQ6IDUycnB4O1xyXG4gICAgICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcclxuICAgICAgfVxyXG5cclxuICAgICAgLyog5pS25Yiw55qE5raI5oGvICovXHJcbiAgICAgICYucHVsbCB7XHJcbiAgICAgICAgLmNvbnRlbnQge1xyXG4gICAgICAgICAgbWluLXdpZHRoOiAyMHJweDtcclxuICAgICAgICAgIG1pbi1oZWlnaHQ6IDUycnB4O1xyXG4gICAgICAgICAgbWFyZ2luLWxlZnQ6IDMycnB4O1xyXG4gICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjtcclxuXHJcbiAgICAgICAgICAmOjphZnRlciB7XHJcbiAgICAgICAgICAgIGNvbnRlbnQ6ICcnO1xyXG4gICAgICAgICAgICBkaXNwbGF5OiBibG9jaztcclxuICAgICAgICAgICAgd2lkdGg6IDA7XHJcbiAgICAgICAgICAgIGhlaWdodDogMDtcclxuICAgICAgICAgICAgYm9yZGVyLXRvcDogMTZycHggc29saWQgdHJhbnNwYXJlbnQ7XHJcbiAgICAgICAgICAgIGJvcmRlci1ib3R0b206IDE2cnB4IHNvbGlkIHRyYW5zcGFyZW50O1xyXG4gICAgICAgICAgICBib3JkZXItcmlnaHQ6IDIwcnB4IHNvbGlkICNmZmY7XHJcbiAgICAgICAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTtcclxuICAgICAgICAgICAgdG9wOiAzMHJweDtcclxuICAgICAgICAgICAgbGVmdDogLTE4cnB4O1xyXG4gICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgfVxyXG5cclxuICAgICAgLyog5Y+R5Ye655qE5raI5oGvICovXHJcbiAgICAgICYucHVzaCB7XHJcbiAgICAgICAgLyog5Li76L205Li65rC05bmz5pa55ZCR77yM6LW354K55Zyo5Y+z56uv44CC5L2/5LiN5L+u5pS5RE9N57uT5p6E77yM5Lmf6IO95pS55Y+Y5YWD57Sg5o6S5YiX6aG65bqPICovXHJcbiAgICAgICAgZmxleC1kaXJlY3Rpb246IHJvdy1yZXZlcnNlO1xyXG5cclxuICAgICAgICAuY29udGVudCB7XHJcbiAgICAgICAgICBtaW4td2lkdGg6IDIwcnB4O1xyXG4gICAgICAgICAgbWluLWhlaWdodDogNTJycHg7XHJcbiAgICAgICAgICBtYXJnaW4tcmlnaHQ6IDMycnB4O1xyXG4gICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogIzI1NzNmYjtcclxuICAgICAgICAgIGNvbG9yOiAjZmZmO1xyXG5cclxuICAgICAgICAgICY6OmFmdGVyIHtcclxuICAgICAgICAgICAgY29udGVudDogJyc7XHJcbiAgICAgICAgICAgIGRpc3BsYXk6IGJsb2NrO1xyXG4gICAgICAgICAgICB3aWR0aDogMDtcclxuICAgICAgICAgICAgaGVpZ2h0OiAwO1xyXG4gICAgICAgICAgICBib3JkZXItdG9wOiAxNnJweCBzb2xpZCB0cmFuc3BhcmVudDtcclxuICAgICAgICAgICAgYm9yZGVyLWJvdHRvbTogMTZycHggc29saWQgdHJhbnNwYXJlbnQ7XHJcbiAgICAgICAgICAgIGJvcmRlci1sZWZ0OiAyMHJweCBzb2xpZCAjMjU3M2ZiO1xyXG4gICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7XHJcbiAgICAgICAgICAgIHRvcDogMzBycHg7XHJcbiAgICAgICAgICAgIHJpZ2h0OiAtMThycHg7XHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICB9XHJcbiAgICB9XHJcbiAgfVxyXG5cclxuICAuYmluZy1tYXRoIHtcclxuICAgIG1hcmdpbjogMCAhaW1wb3J0YW50O1xyXG4gICAgcGFkZGluZzogMCAhaW1wb3J0YW50O1xyXG4gIH1cclxuICAucGxhY2Vob2xkZXIge1xyXG4gICAgd2lkdGg6IDEwMHZ3O1xyXG4gICAgYmFja2dyb3VuZC1jb2xvcjogIzE1NzNmYjtcclxuICAgIC8vIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50O1xyXG4gICAgLy8gdHJhbnNmb3JtOiB0cmFuc2xhdGVZKDApOyAvKiDliJ3lp4vljJYgdHJhbnNmb3JtIOWxnuaApyAqL1xyXG4gICAgLy8gdHJhbnNpdGlvbjogdHJhbnNmb3JtIDAuM3MgZWFzZTsgLyog5re75Yqg6L+H5rih5pWI5p6cICovXHJcbiAgfVxyXG48L3N0eWxlPiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///17\n");
/***/ }),
/* 18 */
@@ -30310,7 +30339,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _HBu
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-eval("/* WEBPACK VAR INJECTION */(function(__f__) {\n\nvar _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 1);\nvar _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 4);\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 19));\nvar _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 27));\nvar base64 = _interopRequireWildcard(__webpack_require__(/*! base-64 */ 28));\nvar _cryptoJs = _interopRequireDefault(__webpack_require__(/*! ../../static/crypto-js/crypto-js.js */ 32));\nvar _parser = _interopRequireDefault(__webpack_require__(/*! ../../static/fast-xml-parser/src/parser */ 190));\nvar utf8 = _interopRequireWildcard(__webpack_require__(/*! utf8 */ 199));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n//\n//\n//\n//\n//\n//\n//\n//\nvar _default = {\n // https://spark-api.xf-yun.com/v1.1/chat V1.5 domain general\n // https://spark-api.xf-yun.com/v2.1/chat V2.0 domain generalv2\n data: function data() {\n return {\n TEXT: '你好,我的名字叫大王',\n APPID: '2eda6c2e',\n // 控制台获取填写\n APISecret: 'MDEyMzE5YTc5YmQ5NjMwOTU1MWY4N2Y2',\n APIKey: '12ec1f9d113932575fc4b114a2f60ffd',\n sparkResult: '',\n historyTextList: [],\n // 历史会话信息,由于最大token12000,可以结合实际使用,进行移出\n tempRes: '' // 临时答复保存\n };\n },\n\n methods: {\n sendToSpark: function sendToSpark() {\n var _this = this;\n return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {\n var myUrl, realThis;\n return _regenerator.default.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return _this.getWebSocketUrl();\n case 2:\n myUrl = _context.sent;\n _this.tempRes = \"\";\n // this.sparkResult = \"\";\n realThis = _this;\n _this.socketTask = uni.connectSocket({\n //url: encodeURI(encodeURI(myUrl).replace(/\\+/g, '%2B')),\n url: myUrl,\n method: 'GET',\n success: function success(res) {\n __f__(\"log\", res, \"ws成功连接...\", myUrl, \" at pages/index/chat.vue:39\");\n realThis.wsLiveFlag = true;\n }\n });\n realThis.socketTask.onError(function (res) {\n __f__(\"log\", \"连接发生错误,请检查appid是否填写\", res, \" at pages/index/chat.vue:44\");\n });\n realThis.socketTask.onOpen(function (res) {\n _this.historyTextList.push({\n \"role\": \"user\",\n \"content\": _this.TEXT\n });\n __f__(\"info\", \"wss的onOpen成功执行...\", res, \" at pages/index/chat.vue:51\");\n // 第一帧..........................................\n __f__(\"log\", 'open成功...', \" at pages/index/chat.vue:53\");\n var params = {\n \"header\": {\n \"app_id\": _this.APPID,\n \"uid\": \"aef9f963-7\"\n },\n \"parameter\": {\n \"chat\": {\n \"domain\": \"generalv2\",\n \"temperature\": 0.5,\n \"max_tokens\": 1024\n }\n },\n \"payload\": {\n \"message\": {\n \"text\": _this.historyTextList\n }\n }\n };\n __f__(\"log\", \"请求的params:\" + JSON.stringify(params), \" at pages/index/chat.vue:72\");\n _this.sparkResult = _this.sparkResult + \"\\r\\n我:\" + _this.TEXT + \"\\r\\n\";\n _this.sparkResult = _this.sparkResult + \"大模型:\";\n __f__(\"log\", \"发送第一帧...\", params, \" at pages/index/chat.vue:75\");\n realThis.socketTask.send({\n // 发送消息,,都用uni的官方版本\n data: JSON.stringify(params),\n success: function success() {\n __f__(\"log\", '第一帧发送成功', \" at pages/index/chat.vue:79\");\n }\n });\n });\n\n // 接受到消息时\n realThis.socketTask.onMessage(function (res) {\n __f__(\"log\", '收到API返回的内容:', res.data, \" at pages/index/chat.vue:86\");\n var obj = JSON.parse(res.data);\n // console.log(\"我打印的\"+obj.payload);\n var dataArray = obj.payload.choices.text;\n for (var i = 0; i < dataArray.length; i++) {\n realThis.sparkResult = realThis.sparkResult + dataArray[i].content;\n realThis.tempRes = realThis.tempRes + dataArray[i].content;\n }\n // realThis.sparkResult =realThis.sparkResult+ \n var temp = JSON.parse(res.data);\n // console.log(\"0726\",temp.header.code)\n if (temp.header.code !== 0) {\n __f__(\"log\", \"\".concat(temp.header.code, \":\").concat(temp.message), \" at pages/index/chat.vue:98\");\n realThis.socketTask.close({\n success: function success(res) {\n __f__(\"log\", '关闭成功', res, \" at pages/index/chat.vue:101\");\n realThis.wsLiveFlag = false;\n },\n fail: function fail(err) {\n __f__(\"log\", '关闭失败', err, \" at pages/index/chat.vue:105\");\n }\n });\n }\n if (temp.header.code === 0) {\n if (res.data && temp.header.status === 2) {\n realThis.sparkResult = realThis.sparkResult + \"\\r\\n**********************************************\";\n _this.historyTextList.push({\n \"role\": \"assistant\",\n \"content\": _this.tempRes\n });\n /* let dataArray= obj.payload.choices.text;\n for(let i=0;i uni-view {\r\n width: 50%;\n}\n.flex_col.flex_col_3 > uni-view {\r\n width: 33.33333%;\n}\n.flex_col.flex_col_4 > uni-view {\r\n width: 25%;\n}\n.flex_col.flex_col_5 > uni-view {\r\n width: 20%;\n}\n.flex_col.flex_col_6 > uni-view {\r\n width: 16.66666%;\n}\r\n/* 字体颜色 */\n.color_333 {\r\n color: #333;\n}\n.color_666 {\r\n color: #666;\n}\n.color_999 {\r\n color: #999;\n}\n.color_ccc {\r\n color: #ccc;\n}\n.color_fff {\r\n color: #fff;\n}\n.color_6dc {\r\n color: #6dca6d;\n}\n.color_d51 {\r\n color: #d51917;\n}\n.color_09f {\r\n color: #0099ff;\n}\r\n/* 背景色*/\n.bg_fff {\r\n background-color: #ffffff;\n}\r\n/* 字体大小 */\n.size_10 {\r\n font-size: 20rpx;\n}\n.size_12 {\r\n font-size: 24rpx;\n}\n.size_14 {\r\n font-size: 28rpx;\n}\n.size_16 {\r\n font-size: 32rpx;\n}\n.size_18 {\r\n font-size: 36rpx;\n}\n.size_20 {\r\n font-size: 40rpx;\n}\r\n/* 字体加粗 */\n.font_b {\r\n font-weight: bold;\n}\r\n/* 对齐方式 */\n.align_c {\r\n text-align: center;\n}\n.align_l {\r\n text-align: left;\n}\n.align_r {\r\n text-align: right;\n}\r\n/* 遮罩 */\n.shade {\r\n position: fixed;\r\n top: 0;\r\n right: 0;\r\n bottom: 0;\r\n left: 0;\r\n background-color: rgba(0, 0, 0, 0.8);\r\n z-index: 100;\n}\r\n/* 弹窗 */\n.shade_box {\r\n position: fixed;\r\n top: 0;\r\n right: 0;\r\n bottom: 0;\r\n left: 0;\r\n margin: auto;\r\n z-index: 101;\r\n min-width: 200rpx;\r\n min-height: 200rpx;\n}\nbody {\r\n background-color: #f5f5f5;\r\n font-size: 28rpx;\n}\n.wrapper {\r\n height: auto !important;\n}\r\n/* 加载数据提示 */\n.tips {\r\n position: fixed;\r\n left: 0;\r\n top: var(--window-top);\r\n width: 100%;\r\n z-index: 9;\r\n background-color: rgba(0, 0, 0, 0.15);\r\n height: 72rpx;\r\n line-height: 72rpx;\r\n -webkit-transform: translateY(-80rpx);\r\n transform: translateY(-80rpx);\r\n transition: -webkit-transform 0.3s ease-in-out 0s;\r\n transition: transform 0.3s ease-in-out 0s;\r\n transition: transform 0.3s ease-in-out 0s, -webkit-transform 0.3s ease-in-out 0s;\n}\n.tips.show {\r\n -webkit-transform: translateY(0);\r\n transform: translateY(0);\n}\n.box-1 {\r\n width: 100%;\r\n height: auto;\r\n padding-bottom: 100rpx;\r\n box-sizing: content-box;\r\n /* 兼容iPhoneX */\r\n margin-bottom: 0;\r\n margin-bottom: constant(safe-area-inset-bottom);\r\n margin-bottom: env(safe-area-inset-bottom);\n}\n.multiline-text {\r\n white-space: pre-line;\r\n /* 或 white-space: pre-wrap; */\n}\n.box-2 {\r\n position: fixed;\r\n left: 0;\r\n width: 100%;\r\n bottom: 0;\r\n height: auto;\r\n z-index: 2;\r\n border-top: #e5e5e5 solid 1px;\r\n box-sizing: content-box;\r\n background-color: #f5f5f5;\r\n -webkit-transform: translateY(0);\r\n transform: translateY(0);\r\n /* 初始化 transform 属性 */\r\n transition: -webkit-transform 0.3s ease;\r\n transition: transform 0.3s ease;\r\n transition: transform 0.3s ease, -webkit-transform 0.3s ease;\r\n /* 添加过渡效果 */\r\n /* 兼容iPhoneX */\r\n padding-bottom: 0;\r\n padding-bottom: constant(safe-area-inset-bottom);\r\n padding-bottom: env(safe-area-inset-bottom);\n}\n.box-2 > uni-view {\r\n padding: 0 20rpx;\r\n height: 100rpx;\n}\n.box-2 .content {\r\n background-color: #fff;\r\n height: 64rpx;\r\n padding: 0 20rpx;\r\n border-radius: 6rpx;\r\n font-size: 28rpx;\n}\n.box-2 .send {\r\n background-color: #2573fb;\r\n color: #fff;\r\n height: 64rpx;\r\n margin-left: 20rpx;\r\n border-radius: 6rpx;\r\n padding: 0;\r\n width: 120rpx;\r\n line-height: 62rpx;\n}\n.box-2 .send:active {\r\n background-color: #1573fb;\n}\n.talk-list {\r\n padding-bottom: 20rpx;\r\n /* 消息项,基础类 */\n}\n.talk-list .item {\r\n padding: 20rpx 20rpx 0 20rpx;\r\n align-items: flex-start;\r\n align-content: flex-start;\r\n color: #333;\r\n /* 收到的消息 */\r\n /* 发出的消息 */\n}\n.talk-list .item .pic {\r\n width: 92rpx;\r\n height: 92rpx;\r\n border-radius: 50%;\r\n border: #fff solid 1px;\n}\n.talk-list .item .content {\r\n padding: 20rpx;\r\n border-radius: 4px;\r\n max-width: 500rpx;\r\n word-break: break-all;\r\n line-height: 52rpx;\r\n position: relative;\n}\n.talk-list .item.pull .content {\r\n min-width: 20rpx;\r\n min-height: 52rpx;\r\n margin-left: 32rpx;\r\n background-color: #fff;\n}\n.talk-list .item.pull .content::after {\r\n content: '';\r\n display: block;\r\n width: 0;\r\n height: 0;\r\n border-top: 16rpx solid transparent;\r\n border-bottom: 16rpx solid transparent;\r\n border-right: 20rpx solid #fff;\r\n position: absolute;\r\n top: 30rpx;\r\n left: -18rpx;\n}\n.talk-list .item.push {\r\n /* 主轴为水平方向,起点在右端。使不修改DOM结构,也能改变元素排列顺序 */\r\n flex-direction: row-reverse;\n}\n.talk-list .item.push .content {\r\n min-width: 20rpx;\r\n min-height: 52rpx;\r\n margin-right: 32rpx;\r\n background-color: #2573fb;\r\n color: #fff;\n}\n.talk-list .item.push .content::after {\r\n content: '';\r\n display: block;\r\n width: 0;\r\n height: 0;\r\n border-top: 16rpx solid transparent;\r\n border-bottom: 16rpx solid transparent;\r\n border-left: 20rpx solid #2573fb;\r\n position: absolute;\r\n top: 30rpx;\r\n right: -18rpx;\n}\n.bing-math {\r\n margin: 0 !important;\r\n padding: 0 !important;\n}\n.placeholder {\r\n width: 100vw;\r\n background-color: #1573fb;\n}\r\n", ""]);
+exports.push([module.i, "@charset \"UTF-8\";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */\r\n/* 根元素样式 设置页面背景、字体大小、字体颜色,字符间距、长单词换行 */\nbody {\r\n background-color: #f3f3f3;\r\n font-size: 28rpx;\r\n box-sizing: border-box;\r\n color: #333;\r\n letter-spacing: 0;\r\n word-wrap: break-word;\n}\r\n/* 设置常用元素尺寸规则 */\nuni-view, uni-textarea, uni-input, uni-label, uni-form, uni-button, uni-image {\r\n box-sizing: border-box;\n}\r\n/* 按钮样式处理 */\nuni-button {\r\n font-size: 28rpx;\n}\r\n/* 取消按钮默认的边框线效果 */\nuni-button:after {\r\n border: none;\n}\r\n/* 设置图片默认样式,取消默认尺寸 */\nuni-image {\r\n display: block;\r\n height: auto;\r\n width: auto;\n}\r\n/* 输入框默认字体大小 */\nuni-textarea, uni-input {\r\n font-size: 28rpx;\n}\r\n/* 列式弹性盒子 */\n.flex_col {\r\n display: flex;\r\n flex-direction: row;\r\n flex-wrap: nowrap;\r\n justify-content: flex-start;\r\n align-items: center;\r\n align-content: center;\n}\r\n/* 行式弹性盒子 */\n.flex_row {\r\n display: flex;\r\n flex-direction: column;\r\n flex-wrap: nowrap;\r\n justify-content: flex-start;\r\n align-items: flex-start;\r\n align-content: flex-start;\n}\r\n/* 弹性盒子弹性容器 */\n.flex_col .flex_grow {\r\n width: 0;\r\n flex-grow: 1;\n}\n.flex_row .flex_grow {\r\n flex-grow: 1;\n}\r\n/* 弹性盒子允许换行 */\n.flex_col.flex_wrap {\r\n flex-wrap: wrap;\n}\r\n/* 弹性盒子居中对齐 */\n.flex_col.flex_center, .flex_row.flex_center {\r\n justify-content: center;\n}\r\n/* 列式弹性盒子两端对齐 */\n.flex_col.flex_space {\r\n justify-content: space-between;\n}\r\n/* 弹性盒子快速分栏 ,这里非常郁闷 uniapp 居然不支持 * 选择器 */\n.flex_col.flex_col_2 > uni-view {\r\n width: 50%;\n}\n.flex_col.flex_col_3 > uni-view {\r\n width: 33.33333%;\n}\n.flex_col.flex_col_4 > uni-view {\r\n width: 25%;\n}\n.flex_col.flex_col_5 > uni-view {\r\n width: 20%;\n}\n.flex_col.flex_col_6 > uni-view {\r\n width: 16.66666%;\n}\r\n/* 字体颜色 */\n.color_333 {\r\n color: #333;\n}\n.color_666 {\r\n color: #666;\n}\n.color_999 {\r\n color: #999;\n}\n.color_ccc {\r\n color: #ccc;\n}\n.color_fff {\r\n color: #fff;\n}\n.color_6dc {\r\n color: #6dca6d;\n}\n.color_d51 {\r\n color: #d51917;\n}\n.color_09f {\r\n color: #0099ff;\n}\r\n/* 背景色*/\n.bg_fff {\r\n background-color: #ffffff;\n}\r\n/* 字体大小 */\n.size_10 {\r\n font-size: 20rpx;\n}\n.size_12 {\r\n font-size: 24rpx;\n}\n.size_14 {\r\n font-size: 28rpx;\n}\n.size_16 {\r\n font-size: 32rpx;\n}\n.size_18 {\r\n font-size: 36rpx;\n}\n.size_20 {\r\n font-size: 40rpx;\n}\r\n/* 字体加粗 */\n.font_b {\r\n font-weight: bold;\n}\r\n/* 对齐方式 */\n.align_c {\r\n text-align: center;\n}\n.align_l {\r\n text-align: left;\n}\n.align_r {\r\n text-align: right;\n}\r\n/* 遮罩 */\n.shade {\r\n position: fixed;\r\n top: 0;\r\n right: 0;\r\n bottom: 0;\r\n left: 0;\r\n background-color: rgba(0, 0, 0, 0.8);\r\n z-index: 100;\n}\r\n/* 弹窗 */\n.shade_box {\r\n position: fixed;\r\n top: 0;\r\n right: 0;\r\n bottom: 0;\r\n left: 0;\r\n margin: auto;\r\n z-index: 101;\r\n min-width: 200rpx;\r\n min-height: 200rpx;\n}\nbody {\r\n background-color: #f5f5f5;\r\n font-size: 28rpx;\n}\n@-webkit-keyframes blink {\n0% {\r\n opacity: 1;\n}\n50% {\r\n opacity: 0;\n}\n100% {\r\n opacity: 1;\n}\n}\n@keyframes blink {\n0% {\r\n opacity: 1;\n}\n50% {\r\n opacity: 0;\n}\n100% {\r\n opacity: 1;\n}\n}\n.blinking-box {\r\n background-color: #333;\r\n color: #333;\r\n -webkit-animation: blink 1s infinite;\r\n animation: blink 1s infinite;\r\n width: 2px;\r\n overflow: hidden;\n}\n.wrapper {\r\n height: auto !important;\n}\r\n/* 加载数据提示 */\n.tips {\r\n position: fixed;\r\n left: 0;\r\n top: var(--window-top);\r\n width: 100%;\r\n z-index: 9;\r\n background-color: rgba(0, 0, 0, 0.15);\r\n height: 72rpx;\r\n line-height: 72rpx;\r\n -webkit-transform: translateY(-80rpx);\r\n transform: translateY(-80rpx);\r\n transition: -webkit-transform 0.3s ease-in-out 0s;\r\n transition: transform 0.3s ease-in-out 0s;\r\n transition: transform 0.3s ease-in-out 0s, -webkit-transform 0.3s ease-in-out 0s;\n}\n.tips.show {\r\n -webkit-transform: translateY(0);\r\n transform: translateY(0);\n}\n.box-1 {\r\n width: 100%;\r\n height: auto;\r\n padding-bottom: 100rpx;\r\n box-sizing: content-box;\r\n /* 兼容iPhoneX */\r\n margin-bottom: 0;\r\n margin-bottom: constant(safe-area-inset-bottom);\r\n margin-bottom: env(safe-area-inset-bottom);\n}\n.multiline-text {\r\n white-space: pre-line;\r\n /* 或 white-space: pre-wrap; */\n}\n.box-2 {\r\n position: fixed;\r\n left: 0;\r\n width: 100%;\r\n bottom: 0;\r\n height: auto;\r\n z-index: 2;\r\n border-top: #e5e5e5 solid 1px;\r\n box-sizing: content-box;\r\n background-color: #f5f5f5;\r\n -webkit-transform: translateY(0);\r\n transform: translateY(0);\r\n /* 初始化 transform 属性 */\r\n transition: -webkit-transform 0.3s ease;\r\n transition: transform 0.3s ease;\r\n transition: transform 0.3s ease, -webkit-transform 0.3s ease;\r\n /* 添加过渡效果 */\r\n /* 兼容iPhoneX */\r\n padding-bottom: 0;\r\n padding-bottom: constant(safe-area-inset-bottom);\r\n padding-bottom: env(safe-area-inset-bottom);\n}\n.box-2 > uni-view {\r\n padding: 0 20rpx;\r\n height: 100rpx;\n}\n.box-2 .content {\r\n background-color: #fff;\r\n height: 64rpx;\r\n padding: 0 20rpx;\r\n border-radius: 6rpx;\r\n font-size: 28rpx;\n}\n.box-2 .send {\r\n background-color: #2573fb;\r\n color: #fff;\r\n height: 64rpx;\r\n margin-left: 20rpx;\r\n border-radius: 6rpx;\r\n padding: 0;\r\n width: 120rpx;\r\n line-height: 62rpx;\n}\n.box-2 .send:active {\r\n background-color: #1573fb;\n}\n.talk-list {\r\n padding-bottom: 20rpx;\r\n /* 消息项,基础类 */\n}\n.talk-list .item {\r\n padding: 20rpx 20rpx 0 20rpx;\r\n align-items: flex-start;\r\n align-content: flex-start;\r\n color: #333;\r\n /* 收到的消息 */\r\n /* 发出的消息 */\n}\n.talk-list .item .pic {\r\n width: 92rpx;\r\n height: 92rpx;\r\n border-radius: 50%;\r\n border: #fff solid 1px;\n}\n.talk-list .item .content {\r\n padding: 20rpx;\r\n border-radius: 4px;\r\n max-width: 500rpx;\r\n word-break: break-all;\r\n line-height: 52rpx;\r\n position: relative;\n}\n.talk-list .item.pull .content {\r\n min-width: 20rpx;\r\n min-height: 52rpx;\r\n margin-left: 32rpx;\r\n background-color: #fff;\n}\n.talk-list .item.pull .content::after {\r\n content: '';\r\n display: block;\r\n width: 0;\r\n height: 0;\r\n border-top: 16rpx solid transparent;\r\n border-bottom: 16rpx solid transparent;\r\n border-right: 20rpx solid #fff;\r\n position: absolute;\r\n top: 30rpx;\r\n left: -18rpx;\n}\n.talk-list .item.push {\r\n /* 主轴为水平方向,起点在右端。使不修改DOM结构,也能改变元素排列顺序 */\r\n flex-direction: row-reverse;\n}\n.talk-list .item.push .content {\r\n min-width: 20rpx;\r\n min-height: 52rpx;\r\n margin-right: 32rpx;\r\n background-color: #2573fb;\r\n color: #fff;\n}\n.talk-list .item.push .content::after {\r\n content: '';\r\n display: block;\r\n width: 0;\r\n height: 0;\r\n border-top: 16rpx solid transparent;\r\n border-bottom: 16rpx solid transparent;\r\n border-left: 20rpx solid #2573fb;\r\n position: absolute;\r\n top: 30rpx;\r\n right: -18rpx;\n}\n.bing-math {\r\n margin: 0 !important;\r\n padding: 0 !important;\n}\n.placeholder {\r\n width: 100vw;\r\n background-color: #1573fb;\n}\r\n", ""]);
// Exports
module.exports = exports;