whx před 10 měsíci
rodič
revize
93cced64b0
28 změnil soubory, kde provedl 1512 přidání a 736 odebrání
  1. 101 0
      virgo.wzfrontend/yui_wx/js_sdk/js-md5/CHANGELOG.md
  2. 20 0
      virgo.wzfrontend/yui_wx/js_sdk/js-md5/LICENSE.txt
  3. 76 0
      virgo.wzfrontend/yui_wx/js_sdk/js-md5/README.md
  4. 10 0
      virgo.wzfrontend/yui_wx/js_sdk/js-md5/build/md5.min.js
  5. 74 0
      virgo.wzfrontend/yui_wx/js_sdk/js-md5/package.json
  6. 683 0
      virgo.wzfrontend/yui_wx/js_sdk/js-md5/src/md5.js
  7. 21 0
      virgo.wzfrontend/yui_wx/main.js
  8. 5 6
      virgo.wzfrontend/yui_wx/pages.json
  9. 347 448
      virgo.wzfrontend/yui_wx/pages/chat/chat.vue
  10. 1 0
      virgo.wzfrontend/yui_wx/pages/house/house.vue
  11. 51 0
      virgo.wzfrontend/yui_wx/request/api/chat.js
  12. 2 2
      virgo.wzfrontend/yui_wx/static/scss/common.scss
  13. 1 1
      virgo.wzfrontend/yui_wx/unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map
  14. 1 1
      virgo.wzfrontend/yui_wx/unpackage/dist/dev/.sourcemap/mp-weixin/common/runtime.js.map
  15. 1 1
      virgo.wzfrontend/yui_wx/unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map
  16. 1 1
      virgo.wzfrontend/yui_wx/unpackage/dist/dev/.sourcemap/mp-weixin/pages/chat/chat.js.map
  17. 1 1
      virgo.wzfrontend/yui_wx/unpackage/dist/dev/.sourcemap/mp-weixin/pages/house/house.js.map
  18. 2 2
      virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/app.json
  19. 1 1
      virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/common/main.js
  20. 1 1
      virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/common/main.wxss
  21. 1 1
      virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/common/runtime.js
  22. 6 4
      virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/common/vendor.js
  23. 1 1
      virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/pages/chat/chat.js
  24. 3 1
      virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/pages/chat/chat.json
  25. 1 1
      virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/pages/chat/chat.wxml
  26. 97 260
      virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/pages/chat/chat.wxss
  27. 1 1
      virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/pages/house/house.wxml
  28. 2 2
      virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/static/scss/common.scss

+ 101 - 0
virgo.wzfrontend/yui_wx/js_sdk/js-md5/CHANGELOG.md

@@ -0,0 +1,101 @@
+# Change Log
+
+## v0.7.3 / 2017-12-18
+### Fixed
+- incorrect result when first bit is 1 of bytes. #18
+
+## v0.7.2 / 2017-10-31
+### Improved
+- performance of hBytes increment.
+
+## v0.7.1 / 2017-10-29
+### Fixed
+- incorrect result when file size >= 4G.
+
+## v0.7.0 / 2017-10-29
+### Fixed
+- incorrect result when file size >= 512M.
+
+## v0.6.1 / 2017-10-07
+### Fixed
+- ArrayBuffer.isView issue in IE10.
+
+### Improved
+- performance of input check.
+
+## v0.6.0 / 2017-07-28
+### Added
+- support base64 string output.
+
+## v0.5.0 / 2017-07-14
+### Added
+- support for web worker. #11
+
+### Changed
+- throw error if input type is incorrect.
+- prevent webpack to require dependencies.
+
+## v0.4.2 / 2017-01-18
+### Fixed
+- `root` is undefined in some special environment. #7
+
+## v0.4.1 / 2016-03-31
+### Removed
+- length detection in node.js.
+### Deprecated
+- `buffer` and replace by `arrayBuffer`.
+
+## v0.4.0 / 2015-12-28
+### Added
+- support for update hash.
+- support for bytes array output.
+- support for ArrayBuffer output.
+- support for AMD.
+
+## v0.3.0 / 2015-03-07
+### Added
+- support byte Array, Uint8Array and ArrayBuffer input.
+
+## v0.2.2 / 2015-02-01
+### Fixed
+- bug when special length.
+### Improve
+- performance for node.js.
+
+## v0.2.1 / 2015-01-13
+### Improve
+- performance.
+
+## v0.2.0 / 2015-01-12
+### Removed
+- ascii parameter.
+### Improve
+- performance.
+
+## v0.1.4 / 2015-01-11
+### Improve
+- performance.
+### Added
+- test cases.
+
+## v0.1.3 / 2015-01-05
+### Added
+- bower package.
+- travis.
+- coveralls.
+### Improved
+- performance.
+### Fixed
+- JSHint warnings.
+
+## v0.1.2 / 2014-07-27
+### Fixed
+- accents bug
+
+## v0.1.1 / 2014-01-05
+### Changed
+- license
+
+## v0.1.0 / 2014-01-04
+### Added
+- initial release

+ 20 - 0
virgo.wzfrontend/yui_wx/js_sdk/js-md5/LICENSE.txt

@@ -0,0 +1,20 @@
+Copyright 2014-2017 Chen, Yi-Cyuan
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 76 - 0
virgo.wzfrontend/yui_wx/js_sdk/js-md5/README.md

@@ -0,0 +1,76 @@
+# js-md5
+[![Build Status](https://travis-ci.org/emn178/js-md5.svg?branch=master)](https://travis-ci.org/emn178/js-md5)
+[![Coverage Status](https://coveralls.io/repos/emn178/js-md5/badge.svg?branch=master)](https://coveralls.io/r/emn178/js-md5?branch=master)  
+[![NPM](https://nodei.co/npm/js-md5.png?stars&downloads)](https://nodei.co/npm/js-md5/)
+
+A simple MD5 hash function for JavaScript supports UTF-8 encoding.
+
+## Demo
+[MD5 Online](http://emn178.github.io/online-tools/md5.html)  
+[MD5 File Checksum Online](http://emn178.github.io/online-tools/md5_checksum.html)
+
+## Download
+[Compress](https://raw.github.com/emn178/js-md5/master/build/md5.min.js)  
+[Uncompress](https://raw.github.com/emn178/js-md5/master/src/md5.js)
+
+## Installation
+You can also install js-md5 by using Bower.
+
+    bower install md5
+
+For node.js, you can use this command to install:
+
+    npm install js-md5
+
+## Notice
+`buffer` method is deprecated. This maybe confuse with Buffer in node.js. Please use `arrayBuffer` instead.
+
+## Usage
+You could use like this:
+```JavaScript
+md5('Message to hash');
+var hash = md5.create();
+hash.update('Message to hash');
+hash.hex();
+```
+If you use node.js, you should require the module first:
+```JavaScript
+md5 = require('js-md5');
+```
+It supports AMD:
+```JavaScript
+require(['your/path/md5.js'], function(md5) {
+// ...
+});
+```
+[See document](https://emn178.github.com/js-md5/doc/)
+
+## Example
+```JavaScript
+md5(''); // d41d8cd98f00b204e9800998ecf8427e
+md5('The quick brown fox jumps over the lazy dog'); // 9e107d9d372bb6826bd81d3542a419d6
+md5('The quick brown fox jumps over the lazy dog.'); // e4d909c290d0fb1ca068ffaddf22cbd0
+
+// It also supports UTF-8 encoding
+md5('中文'); // a7bac2239fcdcb3a067903d8077c4a07
+
+// It also supports byte `Array`, `Uint8Array`, `ArrayBuffer`
+md5([]); // d41d8cd98f00b204e9800998ecf8427e
+md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e
+
+// Different output
+md5(''); // d41d8cd98f00b204e9800998ecf8427e
+md5.hex(''); // d41d8cd98f00b204e9800998ecf8427e
+md5.array(''); // [212, 29, 140, 217, 143, 0, 178, 4, 233, 128, 9, 152, 236, 248, 66, 126]
+md5.digest(''); // [212, 29, 140, 217, 143, 0, 178, 4, 233, 128, 9, 152, 236, 248, 66, 126]
+md5.arrayBuffer(''); // ArrayBuffer
+md5.buffer(''); // ArrayBuffer, deprecated, This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
+md5.base64(''); // 1B2M2Y8AsgTpgAmY7PhCfg==
+```
+
+## License
+The project is released under the [MIT license](http://www.opensource.org/licenses/MIT).
+
+## Contact
+The project's website is located at https://github.com/emn178/js-md5  
+Author: Chen, Yi-Cyuan (emn178@gmail.com)

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 10 - 0
virgo.wzfrontend/yui_wx/js_sdk/js-md5/build/md5.min.js


+ 74 - 0
virgo.wzfrontend/yui_wx/js_sdk/js-md5/package.json

@@ -0,0 +1,74 @@
+{
+  "_from": "js-md5",
+  "_id": "js-md5@0.7.3",
+  "_inBundle": false,
+  "_integrity": "sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==",
+  "_location": "/js-md5",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "tag",
+    "registry": true,
+    "raw": "js-md5",
+    "name": "js-md5",
+    "escapedName": "js-md5",
+    "rawSpec": "",
+    "saveSpec": null,
+    "fetchSpec": "latest"
+  },
+  "_requiredBy": [
+    "#DEV:/",
+    "#USER"
+  ],
+  "_resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz",
+  "_shasum": "b4f2fbb0b327455f598d6727e38ec272cd09c3f2",
+  "_spec": "js-md5",
+  "_where": "C:\\Users\\dcloud\\Documents\\HBuilderProjects\\test-npm",
+  "author": {
+    "name": "Chen, Yi-Cyuan",
+    "email": "emn178@gmail.com"
+  },
+  "bugs": {
+    "url": "https://github.com/emn178/js-md5/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "A simple MD5 hash function for JavaScript supports UTF-8 encoding.",
+  "devDependencies": {
+    "expect.js": "~0.3.1",
+    "jsdoc": "^3.4.0",
+    "mocha": "~2.3.4",
+    "nyc": "^11.3.0",
+    "requirejs": "^2.1.22",
+    "uglify-js": "^3.1.9",
+    "webworker-threads": "^0.7.11"
+  },
+  "homepage": "https://github.com/emn178/js-md5",
+  "keywords": [
+    "md5",
+    "hash",
+    "encryption",
+    "cryptography",
+    "HMAC"
+  ],
+  "license": "MIT",
+  "main": "src/md5.js",
+  "name": "js-md5",
+  "nyc": {
+    "exclude": [
+      "tests"
+    ]
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/emn178/js-md5.git"
+  },
+  "scripts": {
+    "build": "npm run-script compress;npm run-script doc",
+    "compress": "uglifyjs src/md5.js -c -m eval --comments --output build/md5.min.js",
+    "coveralls": "nyc report --reporter=text-lcov | coveralls",
+    "doc": "rm -rf doc;jsdoc src README.md -d doc",
+    "report": "nyc --reporter=html --reporter=text mocha tests/node-test.js",
+    "test": "nyc mocha tests/node-test.js"
+  },
+  "version": "0.7.3"
+}

+ 683 - 0
virgo.wzfrontend/yui_wx/js_sdk/js-md5/src/md5.js

@@ -0,0 +1,683 @@
+/**
+ * [js-md5]{@link https://github.com/emn178/js-md5}
+ *
+ * @namespace md5
+ * @version 0.7.3
+ * @author Chen, Yi-Cyuan [emn178@gmail.com]
+ * @copyright Chen, Yi-Cyuan 2014-2017
+ * @license MIT
+ */
+(function () {
+  'use strict';
+
+  var ERROR = 'input is invalid type';
+  var WINDOW = typeof window === 'object';
+  var root = WINDOW ? window : {};
+  if (root.JS_MD5_NO_WINDOW) {
+    WINDOW = false;
+  }
+  var WEB_WORKER = !WINDOW && typeof self === 'object';
+  var NODE_JS = !root.JS_MD5_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;
+  if (NODE_JS) {
+    root = global;
+  } else if (WEB_WORKER) {
+    root = self;
+  }
+  var COMMON_JS = !root.JS_MD5_NO_COMMON_JS && typeof module === 'object' && module.exports;
+  var AMD = typeof define === 'function' && define.amd;
+  var ARRAY_BUFFER = !root.JS_MD5_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';
+  var HEX_CHARS = '0123456789abcdef'.split('');
+  var EXTRA = [128, 32768, 8388608, -2147483648];
+  var SHIFT = [0, 8, 16, 24];
+  var OUTPUT_TYPES = ['hex', 'array', 'digest', 'buffer', 'arrayBuffer', 'base64'];
+  var BASE64_ENCODE_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
+
+  var blocks = [], buffer8;
+  if (ARRAY_BUFFER) {
+    var buffer = new ArrayBuffer(68);
+    buffer8 = new Uint8Array(buffer);
+    blocks = new Uint32Array(buffer);
+  }
+
+  if (root.JS_MD5_NO_NODE_JS || !Array.isArray) {
+    Array.isArray = function (obj) {
+      return Object.prototype.toString.call(obj) === '[object Array]';
+    };
+  }
+
+  if (ARRAY_BUFFER && (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {
+    ArrayBuffer.isView = function (obj) {
+      return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;
+    };
+  }
+
+  /**
+   * @method hex
+   * @memberof md5
+   * @description Output hash as hex string
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {String} Hex string
+   * @example
+   * md5.hex('The quick brown fox jumps over the lazy dog');
+   * // equal to
+   * md5('The quick brown fox jumps over the lazy dog');
+   */
+  /**
+   * @method digest
+   * @memberof md5
+   * @description Output hash as bytes array
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {Array} Bytes array
+   * @example
+   * md5.digest('The quick brown fox jumps over the lazy dog');
+   */
+  /**
+   * @method array
+   * @memberof md5
+   * @description Output hash as bytes array
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {Array} Bytes array
+   * @example
+   * md5.array('The quick brown fox jumps over the lazy dog');
+   */
+  /**
+   * @method arrayBuffer
+   * @memberof md5
+   * @description Output hash as ArrayBuffer
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {ArrayBuffer} ArrayBuffer
+   * @example
+   * md5.arrayBuffer('The quick brown fox jumps over the lazy dog');
+   */
+  /**
+   * @method buffer
+   * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
+   * @memberof md5
+   * @description Output hash as ArrayBuffer
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {ArrayBuffer} ArrayBuffer
+   * @example
+   * md5.buffer('The quick brown fox jumps over the lazy dog');
+   */
+  /**
+   * @method base64
+   * @memberof md5
+   * @description Output hash as base64 string
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {String} base64 string
+   * @example
+   * md5.base64('The quick brown fox jumps over the lazy dog');
+   */
+  var createOutputMethod = function (outputType) {
+    return function (message) {
+      return new Md5(true).update(message)[outputType]();
+    };
+  };
+
+  /**
+   * @method create
+   * @memberof md5
+   * @description Create Md5 object
+   * @returns {Md5} Md5 object.
+   * @example
+   * var hash = md5.create();
+   */
+  /**
+   * @method update
+   * @memberof md5
+   * @description Create and update Md5 object
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {Md5} Md5 object.
+   * @example
+   * var hash = md5.update('The quick brown fox jumps over the lazy dog');
+   * // equal to
+   * var hash = md5.create();
+   * hash.update('The quick brown fox jumps over the lazy dog');
+   */
+  var createMethod = function () {
+    var method = createOutputMethod('hex');
+    if (NODE_JS) {
+      method = nodeWrap(method);
+    }
+    method.create = function () {
+      return new Md5();
+    };
+    method.update = function (message) {
+      return method.create().update(message);
+    };
+    for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
+      var type = OUTPUT_TYPES[i];
+      method[type] = createOutputMethod(type);
+    }
+    return method;
+  };
+
+  var nodeWrap = function (method) {
+    var crypto = eval("require('crypto')");
+    var Buffer = eval("require('buffer').Buffer");
+    var nodeMethod = function (message) {
+      if (typeof message === 'string') {
+        return crypto.createHash('md5').update(message, 'utf8').digest('hex');
+      } else {
+        if (message === null || message === undefined) {
+          throw ERROR;
+        } else if (message.constructor === ArrayBuffer) {
+          message = new Uint8Array(message);
+        }
+      }
+      if (Array.isArray(message) || ArrayBuffer.isView(message) ||
+        message.constructor === Buffer) {
+        return crypto.createHash('md5').update(new Buffer(message)).digest('hex');
+      } else {
+        return method(message);
+      }
+    };
+    return nodeMethod;
+  };
+
+  /**
+   * Md5 class
+   * @class Md5
+   * @description This is internal class.
+   * @see {@link md5.create}
+   */
+  function Md5(sharedMemory) {
+    if (sharedMemory) {
+      blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] =
+      blocks[4] = blocks[5] = blocks[6] = blocks[7] =
+      blocks[8] = blocks[9] = blocks[10] = blocks[11] =
+      blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
+      this.blocks = blocks;
+      this.buffer8 = buffer8;
+    } else {
+      if (ARRAY_BUFFER) {
+        var buffer = new ArrayBuffer(68);
+        this.buffer8 = new Uint8Array(buffer);
+        this.blocks = new Uint32Array(buffer);
+      } else {
+        this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+      }
+    }
+    this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0;
+    this.finalized = this.hashed = false;
+    this.first = true;
+  }
+
+  /**
+   * @method update
+   * @memberof Md5
+   * @instance
+   * @description Update hash
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {Md5} Md5 object.
+   * @see {@link md5.update}
+   */
+  Md5.prototype.update = function (message) {
+    if (this.finalized) {
+      return;
+    }
+
+    var notString, type = typeof message;
+    if (type !== 'string') {
+      if (type === 'object') {
+        if (message === null) {
+          throw ERROR;
+        } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
+          message = new Uint8Array(message);
+        } else if (!Array.isArray(message)) {
+          if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {
+            throw ERROR;
+          }
+        }
+      } else {
+        throw ERROR;
+      }
+      notString = true;
+    }
+    var code, index = 0, i, length = message.length, blocks = this.blocks;
+    var buffer8 = this.buffer8;
+
+    while (index < length) {
+      if (this.hashed) {
+        this.hashed = false;
+        blocks[0] = blocks[16];
+        blocks[16] = blocks[1] = blocks[2] = blocks[3] =
+        blocks[4] = blocks[5] = blocks[6] = blocks[7] =
+        blocks[8] = blocks[9] = blocks[10] = blocks[11] =
+        blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
+      }
+
+      if (notString) {
+        if (ARRAY_BUFFER) {
+          for (i = this.start; index < length && i < 64; ++index) {
+            buffer8[i++] = message[index];
+          }
+        } else {
+          for (i = this.start; index < length && i < 64; ++index) {
+            blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
+          }
+        }
+      } else {
+        if (ARRAY_BUFFER) {
+          for (i = this.start; index < length && i < 64; ++index) {
+            code = message.charCodeAt(index);
+            if (code < 0x80) {
+              buffer8[i++] = code;
+            } else if (code < 0x800) {
+              buffer8[i++] = 0xc0 | (code >> 6);
+              buffer8[i++] = 0x80 | (code & 0x3f);
+            } else if (code < 0xd800 || code >= 0xe000) {
+              buffer8[i++] = 0xe0 | (code >> 12);
+              buffer8[i++] = 0x80 | ((code >> 6) & 0x3f);
+              buffer8[i++] = 0x80 | (code & 0x3f);
+            } else {
+              code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
+              buffer8[i++] = 0xf0 | (code >> 18);
+              buffer8[i++] = 0x80 | ((code >> 12) & 0x3f);
+              buffer8[i++] = 0x80 | ((code >> 6) & 0x3f);
+              buffer8[i++] = 0x80 | (code & 0x3f);
+            }
+          }
+        } else {
+          for (i = this.start; index < length && i < 64; ++index) {
+            code = message.charCodeAt(index);
+            if (code < 0x80) {
+              blocks[i >> 2] |= code << SHIFT[i++ & 3];
+            } else if (code < 0x800) {
+              blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
+            } else if (code < 0xd800 || code >= 0xe000) {
+              blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
+            } else {
+              code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
+              blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
+            }
+          }
+        }
+      }
+      this.lastByteIndex = i;
+      this.bytes += i - this.start;
+      if (i >= 64) {
+        this.start = i - 64;
+        this.hash();
+        this.hashed = true;
+      } else {
+        this.start = i;
+      }
+    }
+    if (this.bytes > 4294967295) {
+      this.hBytes += this.bytes / 4294967296 << 0;
+      this.bytes = this.bytes % 4294967296;
+    }
+    return this;
+  };
+
+  Md5.prototype.finalize = function () {
+    if (this.finalized) {
+      return;
+    }
+    this.finalized = true;
+    var blocks = this.blocks, i = this.lastByteIndex;
+    blocks[i >> 2] |= EXTRA[i & 3];
+    if (i >= 56) {
+      if (!this.hashed) {
+        this.hash();
+      }
+      blocks[0] = blocks[16];
+      blocks[16] = blocks[1] = blocks[2] = blocks[3] =
+      blocks[4] = blocks[5] = blocks[6] = blocks[7] =
+      blocks[8] = blocks[9] = blocks[10] = blocks[11] =
+      blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
+    }
+    blocks[14] = this.bytes << 3;
+    blocks[15] = this.hBytes << 3 | this.bytes >>> 29;
+    this.hash();
+  };
+
+  Md5.prototype.hash = function () {
+    var a, b, c, d, bc, da, blocks = this.blocks;
+
+    if (this.first) {
+      a = blocks[0] - 680876937;
+      a = (a << 7 | a >>> 25) - 271733879 << 0;
+      d = (-1732584194 ^ a & 2004318071) + blocks[1] - 117830708;
+      d = (d << 12 | d >>> 20) + a << 0;
+      c = (-271733879 ^ (d & (a ^ -271733879))) + blocks[2] - 1126478375;
+      c = (c << 17 | c >>> 15) + d << 0;
+      b = (a ^ (c & (d ^ a))) + blocks[3] - 1316259209;
+      b = (b << 22 | b >>> 10) + c << 0;
+    } else {
+      a = this.h0;
+      b = this.h1;
+      c = this.h2;
+      d = this.h3;
+      a += (d ^ (b & (c ^ d))) + blocks[0] - 680876936;
+      a = (a << 7 | a >>> 25) + b << 0;
+      d += (c ^ (a & (b ^ c))) + blocks[1] - 389564586;
+      d = (d << 12 | d >>> 20) + a << 0;
+      c += (b ^ (d & (a ^ b))) + blocks[2] + 606105819;
+      c = (c << 17 | c >>> 15) + d << 0;
+      b += (a ^ (c & (d ^ a))) + blocks[3] - 1044525330;
+      b = (b << 22 | b >>> 10) + c << 0;
+    }
+
+    a += (d ^ (b & (c ^ d))) + blocks[4] - 176418897;
+    a = (a << 7 | a >>> 25) + b << 0;
+    d += (c ^ (a & (b ^ c))) + blocks[5] + 1200080426;
+    d = (d << 12 | d >>> 20) + a << 0;
+    c += (b ^ (d & (a ^ b))) + blocks[6] - 1473231341;
+    c = (c << 17 | c >>> 15) + d << 0;
+    b += (a ^ (c & (d ^ a))) + blocks[7] - 45705983;
+    b = (b << 22 | b >>> 10) + c << 0;
+    a += (d ^ (b & (c ^ d))) + blocks[8] + 1770035416;
+    a = (a << 7 | a >>> 25) + b << 0;
+    d += (c ^ (a & (b ^ c))) + blocks[9] - 1958414417;
+    d = (d << 12 | d >>> 20) + a << 0;
+    c += (b ^ (d & (a ^ b))) + blocks[10] - 42063;
+    c = (c << 17 | c >>> 15) + d << 0;
+    b += (a ^ (c & (d ^ a))) + blocks[11] - 1990404162;
+    b = (b << 22 | b >>> 10) + c << 0;
+    a += (d ^ (b & (c ^ d))) + blocks[12] + 1804603682;
+    a = (a << 7 | a >>> 25) + b << 0;
+    d += (c ^ (a & (b ^ c))) + blocks[13] - 40341101;
+    d = (d << 12 | d >>> 20) + a << 0;
+    c += (b ^ (d & (a ^ b))) + blocks[14] - 1502002290;
+    c = (c << 17 | c >>> 15) + d << 0;
+    b += (a ^ (c & (d ^ a))) + blocks[15] + 1236535329;
+    b = (b << 22 | b >>> 10) + c << 0;
+    a += (c ^ (d & (b ^ c))) + blocks[1] - 165796510;
+    a = (a << 5 | a >>> 27) + b << 0;
+    d += (b ^ (c & (a ^ b))) + blocks[6] - 1069501632;
+    d = (d << 9 | d >>> 23) + a << 0;
+    c += (a ^ (b & (d ^ a))) + blocks[11] + 643717713;
+    c = (c << 14 | c >>> 18) + d << 0;
+    b += (d ^ (a & (c ^ d))) + blocks[0] - 373897302;
+    b = (b << 20 | b >>> 12) + c << 0;
+    a += (c ^ (d & (b ^ c))) + blocks[5] - 701558691;
+    a = (a << 5 | a >>> 27) + b << 0;
+    d += (b ^ (c & (a ^ b))) + blocks[10] + 38016083;
+    d = (d << 9 | d >>> 23) + a << 0;
+    c += (a ^ (b & (d ^ a))) + blocks[15] - 660478335;
+    c = (c << 14 | c >>> 18) + d << 0;
+    b += (d ^ (a & (c ^ d))) + blocks[4] - 405537848;
+    b = (b << 20 | b >>> 12) + c << 0;
+    a += (c ^ (d & (b ^ c))) + blocks[9] + 568446438;
+    a = (a << 5 | a >>> 27) + b << 0;
+    d += (b ^ (c & (a ^ b))) + blocks[14] - 1019803690;
+    d = (d << 9 | d >>> 23) + a << 0;
+    c += (a ^ (b & (d ^ a))) + blocks[3] - 187363961;
+    c = (c << 14 | c >>> 18) + d << 0;
+    b += (d ^ (a & (c ^ d))) + blocks[8] + 1163531501;
+    b = (b << 20 | b >>> 12) + c << 0;
+    a += (c ^ (d & (b ^ c))) + blocks[13] - 1444681467;
+    a = (a << 5 | a >>> 27) + b << 0;
+    d += (b ^ (c & (a ^ b))) + blocks[2] - 51403784;
+    d = (d << 9 | d >>> 23) + a << 0;
+    c += (a ^ (b & (d ^ a))) + blocks[7] + 1735328473;
+    c = (c << 14 | c >>> 18) + d << 0;
+    b += (d ^ (a & (c ^ d))) + blocks[12] - 1926607734;
+    b = (b << 20 | b >>> 12) + c << 0;
+    bc = b ^ c;
+    a += (bc ^ d) + blocks[5] - 378558;
+    a = (a << 4 | a >>> 28) + b << 0;
+    d += (bc ^ a) + blocks[8] - 2022574463;
+    d = (d << 11 | d >>> 21) + a << 0;
+    da = d ^ a;
+    c += (da ^ b) + blocks[11] + 1839030562;
+    c = (c << 16 | c >>> 16) + d << 0;
+    b += (da ^ c) + blocks[14] - 35309556;
+    b = (b << 23 | b >>> 9) + c << 0;
+    bc = b ^ c;
+    a += (bc ^ d) + blocks[1] - 1530992060;
+    a = (a << 4 | a >>> 28) + b << 0;
+    d += (bc ^ a) + blocks[4] + 1272893353;
+    d = (d << 11 | d >>> 21) + a << 0;
+    da = d ^ a;
+    c += (da ^ b) + blocks[7] - 155497632;
+    c = (c << 16 | c >>> 16) + d << 0;
+    b += (da ^ c) + blocks[10] - 1094730640;
+    b = (b << 23 | b >>> 9) + c << 0;
+    bc = b ^ c;
+    a += (bc ^ d) + blocks[13] + 681279174;
+    a = (a << 4 | a >>> 28) + b << 0;
+    d += (bc ^ a) + blocks[0] - 358537222;
+    d = (d << 11 | d >>> 21) + a << 0;
+    da = d ^ a;
+    c += (da ^ b) + blocks[3] - 722521979;
+    c = (c << 16 | c >>> 16) + d << 0;
+    b += (da ^ c) + blocks[6] + 76029189;
+    b = (b << 23 | b >>> 9) + c << 0;
+    bc = b ^ c;
+    a += (bc ^ d) + blocks[9] - 640364487;
+    a = (a << 4 | a >>> 28) + b << 0;
+    d += (bc ^ a) + blocks[12] - 421815835;
+    d = (d << 11 | d >>> 21) + a << 0;
+    da = d ^ a;
+    c += (da ^ b) + blocks[15] + 530742520;
+    c = (c << 16 | c >>> 16) + d << 0;
+    b += (da ^ c) + blocks[2] - 995338651;
+    b = (b << 23 | b >>> 9) + c << 0;
+    a += (c ^ (b | ~d)) + blocks[0] - 198630844;
+    a = (a << 6 | a >>> 26) + b << 0;
+    d += (b ^ (a | ~c)) + blocks[7] + 1126891415;
+    d = (d << 10 | d >>> 22) + a << 0;
+    c += (a ^ (d | ~b)) + blocks[14] - 1416354905;
+    c = (c << 15 | c >>> 17) + d << 0;
+    b += (d ^ (c | ~a)) + blocks[5] - 57434055;
+    b = (b << 21 | b >>> 11) + c << 0;
+    a += (c ^ (b | ~d)) + blocks[12] + 1700485571;
+    a = (a << 6 | a >>> 26) + b << 0;
+    d += (b ^ (a | ~c)) + blocks[3] - 1894986606;
+    d = (d << 10 | d >>> 22) + a << 0;
+    c += (a ^ (d | ~b)) + blocks[10] - 1051523;
+    c = (c << 15 | c >>> 17) + d << 0;
+    b += (d ^ (c | ~a)) + blocks[1] - 2054922799;
+    b = (b << 21 | b >>> 11) + c << 0;
+    a += (c ^ (b | ~d)) + blocks[8] + 1873313359;
+    a = (a << 6 | a >>> 26) + b << 0;
+    d += (b ^ (a | ~c)) + blocks[15] - 30611744;
+    d = (d << 10 | d >>> 22) + a << 0;
+    c += (a ^ (d | ~b)) + blocks[6] - 1560198380;
+    c = (c << 15 | c >>> 17) + d << 0;
+    b += (d ^ (c | ~a)) + blocks[13] + 1309151649;
+    b = (b << 21 | b >>> 11) + c << 0;
+    a += (c ^ (b | ~d)) + blocks[4] - 145523070;
+    a = (a << 6 | a >>> 26) + b << 0;
+    d += (b ^ (a | ~c)) + blocks[11] - 1120210379;
+    d = (d << 10 | d >>> 22) + a << 0;
+    c += (a ^ (d | ~b)) + blocks[2] + 718787259;
+    c = (c << 15 | c >>> 17) + d << 0;
+    b += (d ^ (c | ~a)) + blocks[9] - 343485551;
+    b = (b << 21 | b >>> 11) + c << 0;
+
+    if (this.first) {
+      this.h0 = a + 1732584193 << 0;
+      this.h1 = b - 271733879 << 0;
+      this.h2 = c - 1732584194 << 0;
+      this.h3 = d + 271733878 << 0;
+      this.first = false;
+    } else {
+      this.h0 = this.h0 + a << 0;
+      this.h1 = this.h1 + b << 0;
+      this.h2 = this.h2 + c << 0;
+      this.h3 = this.h3 + d << 0;
+    }
+  };
+
+  /**
+   * @method hex
+   * @memberof Md5
+   * @instance
+   * @description Output hash as hex string
+   * @returns {String} Hex string
+   * @see {@link md5.hex}
+   * @example
+   * hash.hex();
+   */
+  Md5.prototype.hex = function () {
+    this.finalize();
+
+    var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3;
+
+    return HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] +
+      HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] +
+      HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] +
+      HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] +
+      HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] +
+      HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] +
+      HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] +
+      HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] +
+      HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] +
+      HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] +
+      HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] +
+      HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] +
+      HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] +
+      HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] +
+      HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] +
+      HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F];
+  };
+
+  /**
+   * @method toString
+   * @memberof Md5
+   * @instance
+   * @description Output hash as hex string
+   * @returns {String} Hex string
+   * @see {@link md5.hex}
+   * @example
+   * hash.toString();
+   */
+  Md5.prototype.toString = Md5.prototype.hex;
+
+  /**
+   * @method digest
+   * @memberof Md5
+   * @instance
+   * @description Output hash as bytes array
+   * @returns {Array} Bytes array
+   * @see {@link md5.digest}
+   * @example
+   * hash.digest();
+   */
+  Md5.prototype.digest = function () {
+    this.finalize();
+
+    var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3;
+    return [
+      h0 & 0xFF, (h0 >> 8) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 24) & 0xFF,
+      h1 & 0xFF, (h1 >> 8) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 24) & 0xFF,
+      h2 & 0xFF, (h2 >> 8) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 24) & 0xFF,
+      h3 & 0xFF, (h3 >> 8) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 24) & 0xFF
+    ];
+  };
+
+  /**
+   * @method array
+   * @memberof Md5
+   * @instance
+   * @description Output hash as bytes array
+   * @returns {Array} Bytes array
+   * @see {@link md5.array}
+   * @example
+   * hash.array();
+   */
+  Md5.prototype.array = Md5.prototype.digest;
+
+  /**
+   * @method arrayBuffer
+   * @memberof Md5
+   * @instance
+   * @description Output hash as ArrayBuffer
+   * @returns {ArrayBuffer} ArrayBuffer
+   * @see {@link md5.arrayBuffer}
+   * @example
+   * hash.arrayBuffer();
+   */
+  Md5.prototype.arrayBuffer = function () {
+    this.finalize();
+
+    var buffer = new ArrayBuffer(16);
+    var blocks = new Uint32Array(buffer);
+    blocks[0] = this.h0;
+    blocks[1] = this.h1;
+    blocks[2] = this.h2;
+    blocks[3] = this.h3;
+    return buffer;
+  };
+
+  /**
+   * @method buffer
+   * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
+   * @memberof Md5
+   * @instance
+   * @description Output hash as ArrayBuffer
+   * @returns {ArrayBuffer} ArrayBuffer
+   * @see {@link md5.buffer}
+   * @example
+   * hash.buffer();
+   */
+  Md5.prototype.buffer = Md5.prototype.arrayBuffer;
+
+  /**
+   * @method base64
+   * @memberof Md5
+   * @instance
+   * @description Output hash as base64 string
+   * @returns {String} base64 string
+   * @see {@link md5.base64}
+   * @example
+   * hash.base64();
+   */
+  Md5.prototype.base64 = function () {
+    var v1, v2, v3, base64Str = '', bytes = this.array();
+    for (var i = 0; i < 15;) {
+      v1 = bytes[i++];
+      v2 = bytes[i++];
+      v3 = bytes[i++];
+      base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
+        BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] +
+        BASE64_ENCODE_CHAR[(v2 << 2 | v3 >>> 6) & 63] +
+        BASE64_ENCODE_CHAR[v3 & 63];
+    }
+    v1 = bytes[i];
+    base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
+      BASE64_ENCODE_CHAR[(v1 << 4) & 63] +
+      '==';
+    return base64Str;
+  };
+
+  var exports = createMethod();
+
+  if (COMMON_JS) {
+    module.exports = exports;
+  } else {
+    /**
+     * @method md5
+     * @description Md5 hash function, export to global in browsers.
+     * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+     * @returns {String} md5 hashes
+     * @example
+     * md5(''); // d41d8cd98f00b204e9800998ecf8427e
+     * md5('The quick brown fox jumps over the lazy dog'); // 9e107d9d372bb6826bd81d3542a419d6
+     * md5('The quick brown fox jumps over the lazy dog.'); // e4d909c290d0fb1ca068ffaddf22cbd0
+     *
+     * // It also supports UTF-8 encoding
+     * md5('中文'); // a7bac2239fcdcb3a067903d8077c4a07
+     *
+     * // It also supports byte `Array`, `Uint8Array`, `ArrayBuffer`
+     * md5([]); // d41d8cd98f00b204e9800998ecf8427e
+     * md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e
+     */
+    root.md5 = exports;
+    if (AMD) {
+      define(function () {
+        return exports;
+      });
+    }
+  }
+})();

+ 21 - 0
virgo.wzfrontend/yui_wx/main.js

@@ -29,6 +29,27 @@ Vue.prototype.$navigateBack = uni.navigateBack;
 import field from './config/field.js'
 Vue.prototype.$field = field;
 
+import {
+	YeIMUniSDK,
+	YeIMUniSDKDefines
+} from '@/uni_modules/wzJun1-YeIM-Uni-SDK/js_sdk/yeim-uni-sdk.min.js'
+
+//初始化YeIMUniSDK
+uni.$YeIMUniSDKDefines = YeIMUniSDKDefines;
+uni.$YeIM = YeIMUniSDK.init({
+	baseURL: 'https://www.waywish.com/im', // YeIMServer http url (如无特殊需求,服务端启动后仅需修改ip或者域名即可)
+	socketURL: 'wss://www.waywish.com/im/im', // YeIMServer socket url(如无特殊需求,服务端启动后仅需修改ip或者域名即可)
+	/**
+	 * 	日志等级
+	 *  0 普通日志,日志量较多,接入时建议使用
+	 *	1 关键性日志,日志量较少,生产环境时建议使用 
+	 *	2 无日志级别,SDK 将不打印任何日志
+	 */
+	logLevel: 0, // 日志等级, 
+	reConnectInterval: 3000, // 重连时间间隔
+	reConnectTotal: 99, // 最大重连次数,0不限制一直重连 
+	heartInterval: 35000, //心跳时间间隔(默认30s) 
+});
 
 Vue.config.productionTip = false;
 

+ 5 - 6
virgo.wzfrontend/yui_wx/pages.json

@@ -1,5 +1,10 @@
 {
 	"pages": [{
+			"path": "pages/chat/chat",
+			"style": {
+				"navigationBarTitleText": "会话"
+			}
+		}, {
 			"path": "pages/highseas/highseas",
 			"style": {
 				"navigationStyle": "custom",
@@ -77,12 +82,6 @@
 			"style": {
 				"navigationBarTitleText": "预约看房"
 			}
-		},
-		{
-			"path": "pages/chat/chat",
-			"style": {
-				"navigationBarTitleText": "会话"
-			}
 		}
 	],
 	"tabBar": {

+ 347 - 448
virgo.wzfrontend/yui_wx/pages/chat/chat.vue

@@ -1,49 +1,91 @@
 <template>
-	<view>
-		<view class="tips color_fff size_12 align_c" :class="{ 'show':ajax.loading }" @tap="getHistoryMsg">
-			{{ajax.loadText}}
+	<view class="chat-box">
+		<view class="chat-tips" v-if="postData.loading">
+			{{postData.loadText}}
 		</view>
-		<view class="box-1" id="list-box">
-			<view class="talk-list">
-				<view v-for="(item,index) in talkList" :key="index" :id="`msg-${item.id}`">
-					<view class="item flex_col" :class=" item.type == 1 ? 'push':'pull' ">
-						<image :src="item.pic" mode="aspectFill" class="pic"></image>
-						<view class="content">{{item.content}}</view>
+		<view class="chat-list">
+			<view :id="`msg-${item.time}`" v-for="(item,index) in chatList" :key="index">
+				<view class="chat-item" :class=" item.from == 'whx' ? 'push':'pull' ">
+					<image :src="item.fromUserInfo.avatarUrl" mode="aspectFill" class="avatar"></image>
+					<view class="content-box">
+						<view class="content" v-if="item.type === 'text'">{{item.body.text}}</view>
+						<image :src="item.body.thumbnailUrl" mode="aspectFill"
+							@tap="previewImage(item.body.originalUrl)" :class="[returnImageClass(item.body)]" v-else>
+						</image>
 					</view>
 				</view>
 			</view>
 		</view>
-		<view class="box-2">
-			<view class="flex_col">
-				<view class="flex_grow">
-					<input type="text" class="content" v-model="content" placeholder="请输入聊天内容"
-						placeholder-style="color:#DDD;" :cursor-spacing="6">
-				</view>
-				<button class="send" @tap="send">发送</button>
+		<view class="chat-submit">
+			<input type="text" class="message-content" v-model="message" placeholder="请输入聊天内容"
+				placeholder-class="message-placeholder" :cursor-spacing="6" />
+			<view class="send-image send-button" @tap="sendImage">
+				<uni-icons type="images-filled" color="#8c8c8c" size="24"></uni-icons>
+			</view>
+			<view class="send-submit send-button" @tap="send">
+				<uni-icons type="paperplane-filled" color="#fff" size="24"></uni-icons>
 			</view>
 		</view>
 	</view>
 </template>
 
 <script>
+	import {
+		YeIMUniSDK,
+		YeIMUniSDKDefines
+	} from '@/uni_modules/wzJun1-YeIM-Uni-SDK/js_sdk/yeim-uni-sdk.min.js'
+	import {
+		login
+	} from '@/request/api/chat.js'
+	import md5 from '@/js_sdk/js-md5/build/md5.min.js';
 	export default {
 		data() {
 			return {
-				talkList: [],
-				ajax: {
-					rows: 20, //每页数量
+				message: '',
+				chatList: [],
+				postData: {
+					rows: 10, //每页数量
 					page: 1, //页码
 					flag: true, // 请求开关
 					loading: true, // 加载中
-					loadText: '正在获取消息'
+					loadText: '正在获取消息...'
 				},
-				content: ''
+				nextMessageId: ''
 			}
 		},
-		mounted() {
-			this.$nextTick(() => {
-				this.getHistoryMsg();
-			});
+		onShow() {
+			//监听新消息
+			YeIMUniSDK.getInstance().addEventListener(YeIMUniSDKDefines.EVENT.MESSAGE_RECEIVED, this.onMessage);
+		},
+		onHide() {
+			YeIMUniSDK.getInstance().removeEventListener(YeIMUniSDKDefines.EVENT.MESSAGE_RECEIVED, this.onMessage);
+		},
+		onLoad() {
+			let userId = 'whx';
+			//模拟计算sign,换取登陆Token,此处建议在各个系统的服务端进行。
+			let timestamp = (new Date()).getTime() + 86400 * 1000 * 1000; //1天后过期
+			let sign = md5(userId + timestamp + "50abd47112ebe8c5a73f4694c96a49ce");
+			login({
+				userId: userId,
+				timestamp: timestamp,
+				sign: sign
+			}).then(res => {
+				if (res.code === 200) {
+					let token = res.data.token;
+					YeIMUniSDK.getInstance().connect({
+						userId: userId,
+						token: token,
+						success: (response) => {
+							if (response.code === 200) {
+								this.getHistoryMsg();
+							}
+						},
+						fail: (err) => {
+							console.log(err);
+						}
+					});
+				}
+			})
 		},
 		onPageScroll(e) {
 			if (e.scrollTop < 5) {
@@ -51,51 +93,66 @@
 			}
 		},
 		methods: {
-			// 获取历史消息
+			returnImageClass(item) {
+				let w = item.thumbnailWidth,
+					h = item.thumbnailHeight;
+				let str = ''
+				if (w > h) str = 'image-width';
+				if (w == h) str = 'image-width-height';
+				if (w < h) str = 'image-height';
+				return str + ' image-box';
+			},
+			onMessage(e) {
+				let message = e;
+				this.insertMessage(message);
+			},
+			insertMessage(message) {
+				try {
+					this.chatList.push(message);
+					this.message = '';
+					setTimeout(() => {
+						uni.pageScrollTo({
+							scrollTop: 99999999, // -30 为多显示出大半个消息的高度,示意上面还有信息。
+							duration: 0
+						});
+					}, 200)
+				} catch (e) {
+					console.log(e)
+				}
+			},
 			getHistoryMsg() {
-				if (!this.ajax.flag) {
+				if (!this.postData.flag) {
 					return; //
 				}
-
 				// 此处用到 ES7 的 async/await 知识,为使代码更加优美。不懂的请自行学习。
 				let get = async () => {
-					this.hideLoadTips();
-					this.ajax.flag = false;
+					this.toggleTips();
+					this.postData.flag = false;
 					let data = await this.joinHistoryMsg();
-
-					console.log('----- 模拟数据格式,供参考 -----');
-					console.log(data); // 查看请求返回的数据结构 
-
 					// 获取待滚动元素选择器,解决插入数据后,滚动条定位时使用
 					let selector = '';
-
-					if (this.ajax.page > 1) {
+					if (this.postData.page > 1) {
 						// 非第一页,则取历史消息数据的第一条信息元素
-						selector = `#msg-${this.talkList[0].id}`;
+						selector = `#msg-${this.chatList[0].time}`;
 					} else {
 						// 第一页,则取当前消息数据的最后一条信息元素
-						selector = `#msg-${data[data.length-1].id}`;
+						selector = `#msg-${data[data.length-1].time}`;
 					}
-
 					// 将获取到的消息数据合并到消息数组中
-					this.talkList = [...data, ...this.talkList];
-
+					this.chatList = [...data, ...this.chatList];
 					// 数据挂载后执行,不懂的请自行阅读 Vue.js 文档对 Vue.nextTick 函数说明。
 					this.$nextTick(() => {
 						// 设置当前滚动的位置
 						this.setPageScrollTo(selector);
-
-						this.hideLoadTips(true);
-
-						if (data.length < this.ajax.rows) {
+						this.toggleTips(true);
+						if (data.length < this.postData.rows) {
 							// 当前消息数据条数小于请求要求条数时,则无更多消息,不再允许请求。
 							// 可在此处编写无更多消息数据时的逻辑
 						} else {
-							this.ajax.page++;
-
+							this.postData.page++;
 							// 延迟 200ms ,以保证设置窗口滚动已完成
 							setTimeout(() => {
-								this.ajax.flag = true;
+								this.postData.flag = true;
 							}, 200)
 						}
 
@@ -103,42 +160,6 @@
 				}
 				get();
 			},
-			// 拼接历史记录消息,正式项目可替换为请求历史记录接口
-			joinHistoryMsg() {
-				let join = () => {
-					let arr = [];
-
-					//通过当前页码及页数,模拟数据内容
-					let startIndex = (this.ajax.page - 1) * this.ajax.rows;
-					let endIndex = startIndex + this.ajax.rows;
-					for (let i = startIndex; i < endIndex; i++) {
-						arr.push({
-							"id": i, // 消息的ID
-							"content": `这是历史记录的第${i+1}条消息`, // 消息内容
-							"type": Math.random() > 0.5 ? 1 : 0, // 此为消息类别,设 1 为发出去的消息,0 为收到对方的消息,
-							"pic": "https://assets.api.uizard.io/api/cdn/stream/db1ab9f9-00bf-4b03-b2b2-1fc8ece9ba19.png" // 头像
-						})
-					}
-
-					/*
-						颠倒数组中元素的顺序。将最新的数据排在本次接口返回数据的最后面。
-						后端接口按 消息的时间降序查找出当前页的数据后,再将本页数据按消息时间降序排序返回。
-						这是数据的重点,因为页面滚动条和上拉加载历史的问题。
-					 */
-					arr.reverse();
-
-					return arr;
-				}
-
-				// 此处用到 ES6 的 Promise 知识,不懂的请自行学习。
-				return new Promise((done, fail) => {
-					// 无数据请求接口,由 setTimeout 模拟,正式项目替换为 ajax 即可。
-					setTimeout(() => {
-						let data = join();
-						done(data);
-					}, 1500);
-				})
-			},
 			// 设置页面滚动位置
 			setPageScrollTo(selector) {
 				let view = uni.createSelectorQuery().in(this).select(selector);
@@ -149,409 +170,287 @@
 					});
 				}).exec();
 			},
-			// 隐藏加载提示
-			hideLoadTips(flag) {
+			toggleTips(flag) {
 				if (flag) {
-					this.ajax.loadText = '消息获取成功';
+					this.postData.loadText = '消息获取成功';
 					setTimeout(() => {
-						this.ajax.loading = false;
+						this.postData.loading = false;
 					}, 300);
 				} else {
-					this.ajax.loading = true;
-					this.ajax.loadText = '正在获取消息';
+					this.postData.loading = true;
+					this.postData.loadText = '正在获取消息...';
 				}
 			},
+			joinHistoryMsg() {
+				// 此处用到 ES6 的 Promise 知识,不懂的请自行学习。
+				return new Promise((done, fail) => {
+					YeIMUniSDK.getInstance().getHistoryMessageList({
+						nextMessageId: this.nextMessageId,
+						conversationId: "dcs",
+						success: (res) => {
+							this.nextMessageId = res.data.nextMessageId
+							done(res.data.list);
+							console.log(res.data);
+						},
+						fail: (err) => {
+							console.log(err)
+						}
+					});
+				})
+			},
+			previewImage(url) {
+				// 预览图片
+				uni.previewImage({
+					urls: [url]
+				});
+			},
+			sendImage() {
+				uni.chooseImage({
+					count: 1, //默认9
+					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+					sourceType: ['album'], //从相册选择
+					success: res => {
+						uni.getImageInfo({
+							src: res.tempFilePaths[0],
+							success: image => {
+								//创建图片消息
+								let message = YeIMUniSDK.getInstance().createImageMessage({
+									toId: 'dcs', //接收者用户ID字符串
+									conversationType: YeIMUniSDKDefines.CONVERSATION_TYPE
+										.PRIVATE, //会话类型:私聊
+									body: {
+										file: {
+											tempFilePath: res.tempFilePaths[0], //本地图片临时路径
+											width: image.width, //图片宽度
+											height: image.height //图片高度
+										}
+									},
+									extra: "这是拓展的自定义的内容",
+									onProgress: (progress) => {
+										console.log('上传进度' + progress.progress);
+										console.log('已经上传的数据长度' + progress
+											.totalBytesSent);
+										console.log('预期需要上传的数据总长度' + progress
+											.totalBytesExpectedToSend);
+									}
+								});
+								//发送消息
+								YeIMUniSDK.getInstance().sendMessage({
+									message: message,
+									success: (res) => {
+										this.chatList.push(res.data);
+										this.message = '';
+										setTimeout(() => {
+											uni.pageScrollTo({
+												scrollTop: 99999999, // -30 为多显示出大半个消息的高度,示意上面还有信息。
+												duration: 0
+											});
+											console.log(9999);
+										}, 200)
+									},
+									fail: (err) => {
+										console.log(err)
+									}
+								});
+							}
+						});
+					}
+				});
+			},
 			// 发送信息
 			send() {
-				if (!this.content) {
-					uni.showToast({
-						title: '请输入有效的内容',
-						icon: 'none'
-					})
-					return;
-				}
-
-				uni.showLoading({
-					title: '正在发送'
-				})
-				setTimeout(() => {
-					uni.hideLoading();
-
-					// 将当前发送信息 添加到消息列表。
-					let data = {
-						"id": new Date().getTime(),
-						"content": this.content,
-						"type": 1,
-						"pic": "https://assets.api.uizard.io/api/cdn/stream/db1ab9f9-00bf-4b03-b2b2-1fc8ece9ba19.png"
+				if (!this.message) return this.$toast('内容不能为空');
+				//创建文字消息
+				let message = YeIMUniSDK.getInstance().createTextMessage({
+					toId: 'dcs', //接收者用户ID字符串
+					conversationType: YeIMUniSDKDefines.CONVERSATION_TYPE.PRIVATE, //会话类型:私聊
+					body: {
+						text: this.message //文本消息内容字符串
+					},
+					extra: ""
+				});
+				//发送消息
+				YeIMUniSDK.getInstance().sendMessage({
+					message: message,
+					success: (res) => {
+						this.chatList.push(res.data);
+						this.message = '';
+						setTimeout(() => {
+							uni.pageScrollTo({
+								scrollTop: 99999999, // -30 为多显示出大半个消息的高度,示意上面还有信息。
+								duration: 0
+							});
+							console.log(9999);
+						}, 200)
+					},
+					fail: (err) => {
+						console.log(err)
 					}
-					this.talkList.push(data);
-
-					this.$nextTick(() => {
-						// 清空内容框中的内容
-						this.content = '';
-						uni.pageScrollTo({
-							scrollTop: 999999, // 设置一个超大值,以保证滚动条滚动到底部
-							duration: 0
-						});
-					})
-				}, 1500);
+				});
 			}
-		}
+		},
 	}
 </script>
 
 <style lang="scss">
-	/* 设置常用元素尺寸规则 */
-	view,
-	textarea,
-	input,
-	label,
-	form,
-	button,
-	image {
-		box-sizing: border-box;
-	}
-
-	/* 按钮样式处理 */
-	button {
-		font-size: 28rpx;
-	}
-
-	/* 取消按钮默认的边框线效果 */
-	button:after {
-		border: none;
-	}
-
-	/* 设置图片默认样式,取消默认尺寸 */
-	image {
-		display: block;
-		height: auto;
-		width: auto;
-	}
-
-	/* 输入框默认字体大小 */
-	textarea,
-	input {
-		font-size: 28rpx;
-	}
-
-	;
-
-	/* 列式弹性盒子 */
-	.flex_col {
-		display: flex;
-		flex-direction: row;
-		flex-wrap: nowrap;
-		justify-content: flex-start;
-		align-items: center;
-		align-content: center;
-	}
-
-	/* 行式弹性盒子 */
-	.flex_row {
-		display: flex;
-		flex-direction: column;
-		flex-wrap: nowrap;
-		justify-content: flex-start;
-		align-items: flex-start;
-		align-content: flex-start;
-	}
-
-	/* 弹性盒子弹性容器 */
-	.flex_col .flex_grow {
-		width: 0;
-		flex-grow: 1;
-	}
-
-	.flex_row .flex_grow {
-		flex-grow: 1;
-	}
-
-	/* 弹性盒子允许换行 */
-	.flex_col.flex_wrap {
-		flex-wrap: wrap;
-	}
-
-	/* 弹性盒子居中对齐 */
-	.flex_col.flex_center,
-	.flex_row.flex_center {
-		justify-content: center;
-	}
-
-	/* 列式弹性盒子两端对齐 */
-	.flex_col.flex_space {
-		justify-content: space-between;
-	}
-
-	/* 弹性盒子快速分栏 ,这里非常郁闷 uniapp 居然不支持 * 选择器 */
-	.flex_col.flex_col_2>view {
-		width: 50%;
-	}
-
-	.flex_col.flex_col_3>view {
-		width: 33.33333%;
-	}
-
-	.flex_col.flex_col_4>view {
-		width: 25%;
-	}
-
-	.flex_col.flex_col_5>view {
-		width: 20%;
-	}
-
-	.flex_col.flex_col_6>view {
-		width: 16.66666%;
-	}
-
-	/* 字体颜色 */
-	.color_333 {
-		color: #333;
-	}
-
-	.color_666 {
-		color: #666;
-	}
-
-	.color_999 {
-		color: #999;
-	}
-
-	.color_ccc {
-		color: #ccc;
-	}
-
-	.color_fff {
-		color: #fff;
-	}
-
-	.color_6dc {
-		color: #6dca6d;
-	}
-
-	.color_d51 {
-		color: #d51917;
-	}
-
-	.color_09f {
-		color: #0099ff;
-	}
-
-	/* 背景色*/
-	.bg_fff {
-		background-color: #ffffff;
-	}
+	.chat-box {
+		.chat-tips {
+			position: fixed;
+			left: 0;
+			top: 0;
+			width: 100%;
+			z-index: 9;
+			background-color: $uni-primary;
+			height: 72rpx;
+			line-height: 72rpx;
+			color: #fff;
+			text-align: center;
+			opacity: 0.9;
+		}
 
-	/* 字体大小 */
-	.size_10 {
-		font-size: 20rpx;
-	}
+		.chat-list {
+			width: 100%;
+			height: auto;
+			padding-bottom: 120rpx;
+			box-sizing: content-box;
+			/* 兼容iPhoneX */
+			margin-bottom: 0;
+			margin-bottom: constant(safe-area-inset-bottom);
+			margin-bottom: env(safe-area-inset-bottom);
+
+			.chat-item {
+				display: flex;
+				padding: 20rpx 20rpx 0 20rpx;
+				align-items: flex-start;
+				align-content: flex-start;
+
+				.avatar {
+					width: 80rpx;
+					height: 80rpx;
+					border-radius: 50%;
+					border: #fff solid 1px;
+				}
 
-	.size_12 {
-		font-size: 24rpx;
-	}
+				.content-box {
+					flex: 1;
+					width: 0;
+					display: flex;
+				}
 
-	.size_14 {
-		font-size: 28rpx;
-	}
+				.image-box {
+					border-radius: 16rpx;
+				}
 
-	.size_16 {
-		font-size: 32rpx;
-	}
+				.image-width {
+					width: 280rpx;
+					height: 200rpx;
+				}
 
-	.size_18 {
-		font-size: 36rpx;
-	}
+				.image-height {
+					width: 200rpx;
+					height: 280rpx;
+				}
 
-	.size_20 {
-		font-size: 40rpx;
-	}
+				.image-width-height {
+					width: 200rpx;
+					height: 200rpx;
+				}
 
-	/* 字体加粗 */
-	.font_b {
-		font-weight: bold;
-	}
+				.content {
+					padding: 20rpx 30rpx;
+					border-radius: 16rpx;
+					word-break: break-all;
+					line-height: 42rpx;
+					position: relative;
+					font-weight: 300;
+				}
 
-	/* 对齐方式 */
-	.align_c {
-		text-align: center;
-	}
+				/* 收到的消息 */
+				&.pull {
+					.content-box {
+						margin-right: 100rpx;
+					}
 
-	.align_l {
-		text-align: left;
-	}
+					.image-box {
+						margin-left: 20rpx;
+					}
 
-	.align_r {
-		text-align: right;
-	}
+					.content {
+						margin-left: 20rpx;
+						background-color: #fff;
+					}
+				}
 
-	/* 遮罩 */
-	.shade {
-		position: fixed;
-		top: 0;
-		right: 0;
-		bottom: 0;
-		left: 0;
-		background-color: rgba(0, 0, 0, 0.8);
-		z-index: 100;
-	}
+				/* 发出的消息 */
+				&.push {
+					/* 主轴为水平方向,起点在右端。使不修改DOM结构,也能改变元素排列顺序 */
+					flex-direction: row-reverse;
 
-	/* 弹窗 */
-	.shade_box {
-		position: fixed;
-		top: 0;
-		right: 0;
-		bottom: 0;
-		left: 0;
-		margin: auto;
-		z-index: 101;
-		min-width: 200rpx;
-		min-height: 200rpx;
-	}
+					.content-box {
+						flex-direction: row-reverse;
+						margin-left: 100rpx;
+					}
 
-	/* 加载数据提示 */
-	.tips {
-		position: fixed;
-		left: 0;
-		top: var(--window-top);
-		width: 100%;
-		z-index: 9;
-		background-color: rgba(0, 0, 0, 0.15);
-		height: 72rpx;
-		line-height: 72rpx;
-		transform: translateY(-80rpx);
-		transition: transform 0.3s ease-in-out 0s;
+					.image-box {
+						margin-right: 20rpx;
+					}
 
-		&.show {
-			transform: translateY(0);
+					.content {
+						margin-right: 20rpx;
+						background-color: $uni-primary;
+						color: #fff;
+						box-shadow: 0px 1px 12px rgba(3, 3, 3, 0.08);
+					}
+				}
+			}
 		}
-	}
-
-	.box-1 {
-		width: 100%;
-		height: auto;
-		padding-bottom: 100rpx;
-		box-sizing: content-box;
-
-		/* 兼容iPhoneX */
-		margin-bottom: 0;
-		margin-bottom: constant(safe-area-inset-bottom);
-		margin-bottom: env(safe-area-inset-bottom);
-	}
-
-	.box-2 {
-		position: fixed;
-		left: 0;
-		width: 100%;
-		bottom: 0;
-		height: auto;
-		z-index: 2;
-		border-top: #e5e5e5 solid 1px;
-		box-sizing: content-box;
-		background-color: #F3F3F3;
-
-		/* 兼容iPhoneX */
-		padding-bottom: 0;
-		padding-bottom: constant(safe-area-inset-bottom);
-		padding-bottom: env(safe-area-inset-bottom);
 
-		>view {
-			padding: 0 20rpx;
+		.chat-submit {
+			position: fixed;
+			left: 0;
+			width: 100%;
+			bottom: 0;
 			height: 100rpx;
-		}
-
-		.content {
+			z-index: 2;
 			background-color: #fff;
-			height: 64rpx;
-			padding: 0 20rpx;
-			border-radius: 32rpx;
-			font-size: 28rpx;
-		}
-
-		.send {
-			background-color: #42b983;
-			color: #fff;
-			height: 64rpx;
-			margin-left: 20rpx;
-			border-radius: 32rpx;
-			padding: 0;
-			width: 120rpx;
-			line-height: 62rpx;
-
-			&:active {
-				background-color: #5fc496;
+			box-shadow: 0px 2px 10px rgba(3, 3, 3, 0.1);
+			/* 兼容iPhoneX */
+			padding-bottom: 0;
+			padding-bottom: constant(safe-area-inset-bottom);
+			padding-bottom: env(safe-area-inset-bottom);
+			display: flex;
+			align-items: center;
+
+			.message-content {
+				flex: 1;
+				margin: 0 30rpx;
+				border: 1px solid $uni-border-1;
+				border-radius: 68rpx;
+				height: 68rpx;
+				padding: 0 20rpx;
 			}
-		}
-	}
-
-	.talk-list {
-		padding-bottom: 20rpx;
 
-		/* 消息项,基础类 */
-		.item {
-			padding: 20rpx 20rpx 0 20rpx;
-			align-items: flex-start;
-			align-content: flex-start;
-			color: #333;
-
-			.pic {
-				width: 92rpx;
-				height: 92rpx;
-				border-radius: 50%;
-				border: #fff solid 1px;
+			.message-placeholder {
+				color: #8c8c8c;
+				font-weight: 300;
 			}
 
-			.content {
-				padding: 20rpx;
-				border-radius: 4px;
-				max-width: 500rpx;
-				word-break: break-all;
-				line-height: 52rpx;
-				position: relative;
-			}
-
-			/* 收到的消息 */
-			&.pull {
-				.content {
-					margin-left: 32rpx;
-					background-color: #fff;
+			.send-button {
+				width: 68rpx;
+				height: 68rpx;
+				border-radius: 50%;
+				display: flex;
+				align-items: center;
+				justify-content: center;
 
-					&::after {
-						content: '';
-						display: block;
-						width: 0;
-						height: 0;
-						border-top: 16rpx solid transparent;
-						border-bottom: 16rpx solid transparent;
-						border-right: 20rpx solid #fff;
-						position: absolute;
-						top: 30rpx;
-						left: -18rpx;
-					}
+				&.send-image {
+					border: 1px solid $uni-border-1;
+					margin-right: 20rpx;
 				}
-			}
-
-			/* 发出的消息 */
-			&.push {
-				/* 主轴为水平方向,起点在右端。使不修改DOM结构,也能改变元素排列顺序 */
-				flex-direction: row-reverse;
 
-				.content {
-					margin-right: 32rpx;
-					background-color: #a0e959;
-
-					&::after {
-						content: '';
-						display: block;
-						width: 0;
-						height: 0;
-						border-top: 16rpx solid transparent;
-						border-bottom: 16rpx solid transparent;
-						border-left: 20rpx solid #a0e959;
-						position: absolute;
-						top: 30rpx;
-						right: -18rpx;
-					}
+				&.send-submit {
+					background: $uni-primary;
+					margin-right: 30rpx;
 				}
 			}
 		}

+ 1 - 0
virgo.wzfrontend/yui_wx/pages/house/house.vue

@@ -114,6 +114,7 @@
 		<view class="hui-button-box">
 			<view class="hui-button" @click="$navigateTo('/pages/reservation/reservation?houseId=' + houseId)">预约看房
 			</view>
+			<view class="hui-button" @click="$navigateTo('/pages/chat/chat')">在线联系</view>
 		</view>
 	</view>
 </template>

+ 51 - 0
virgo.wzfrontend/yui_wx/request/api/chat.js

@@ -0,0 +1,51 @@
+const BASE_URL = 'http://git.waywish.com:9120';
+
+function request(options) {
+	return new Promise((resolve, reject) => {
+		let header = options.header || {
+			'Content-Type': 'application/json'
+		}
+		if (uni.getStorageSync('token')) header['token'] = uni.getStorageSync('token');
+		uni.request({
+			url: BASE_URL + options.url, // 服务器url
+			method: options.method || 'GET', // 请求方法,默认为GET
+			data: options.data || {}, // 请求参数
+			header: header, // 设置请求的 header
+			success: (res) => {
+				// 请求成功
+				if (res.statusCode === 200) {
+					resolve(res.data);
+					if (res.data.code != 200) uni.showToast({
+						title: res.data.message,
+						icon: 'none'
+					})
+				} else {
+					// 可以根据项目要求修改错误处理
+					reject(res.data);
+					uni.hideLoading();
+				}
+			},
+			fail: (err) => {
+				// 请求失败处理
+				uni.showToast({
+					title: '出错了,请联系管理员~',
+					icon: 'none'
+				})
+				reject(err);
+				uni.hideLoading();
+			},
+		});
+	});
+}
+/* 
+ * 获取公海
+ * 
+ * 
+ */
+export function login(data) {
+	return request({
+		url: `/user/token/get`,
+		method: 'post',
+		data: data
+	})
+}

+ 2 - 2
virgo.wzfrontend/yui_wx/static/scss/common.scss

@@ -61,7 +61,6 @@
 	bottom: 0;
 	left: 0;
 	right: 0;
-	padding: 0 30rpx;
 	display: flex;
 	align-items: center;
 
@@ -72,7 +71,8 @@
 		background: $uni-primary;
 		flex: 1;
 		text-align: center;
-		line-height: 68rpx;
+		line-height: 68rpx;
+		margin: 0 30rpx;
 	}
 }
 button[type=primary]{

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
virgo.wzfrontend/yui_wx/unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
virgo.wzfrontend/yui_wx/unpackage/dist/dev/.sourcemap/mp-weixin/common/runtime.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
virgo.wzfrontend/yui_wx/unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
virgo.wzfrontend/yui_wx/unpackage/dist/dev/.sourcemap/mp-weixin/pages/chat/chat.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
virgo.wzfrontend/yui_wx/unpackage/dist/dev/.sourcemap/mp-weixin/pages/house/house.js.map


+ 2 - 2
virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/app.json

@@ -1,5 +1,6 @@
 {
   "pages": [
+    "pages/chat/chat",
     "pages/highseas/highseas",
     "pages/index/index",
     "pages/login/login",
@@ -12,8 +13,7 @@
     "pages/project/project",
     "pages/house/house",
     "pages/visitor/visitor",
-    "pages/reservation/reservation",
-    "pages/chat/chat"
+    "pages/reservation/reservation"
   ],
   "subPackages": [],
   "window": {

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/common/main.js


+ 1 - 1
virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/common/main.wxss

@@ -96,7 +96,6 @@
   bottom: 0;
   left: 0;
   right: 0;
-  padding: 0 30rpx;
   display: flex;
   align-items: center;
 }
@@ -108,6 +107,7 @@
   flex: 1;
   text-align: center;
   line-height: 68rpx;
+  margin: 0 30rpx;
 }
 button[type=primary] {
   background: #08979c;

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/common/runtime.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 6 - 4
virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/common/vendor.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/pages/chat/chat.js


+ 3 - 1
virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/pages/chat/chat.json

@@ -1,4 +1,6 @@
 {
   "navigationBarTitleText": "会话",
-  "usingComponents": {}
+  "usingComponents": {
+    "uni-icons": "/uni_modules/uni-icons/components/uni-icons/uni-icons"
+  }
 }

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/pages/chat/chat.wxml


+ 97 - 260
virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/pages/chat/chat.wxss

@@ -6,303 +6,140 @@
  以下变量是默认值,如不需要修改可以不用给下面的变量重新赋值
  */
 /* 水平间距 */
-/* 设置常用元素尺寸规则 */
-view,
-textarea,
-input,
-label,
-form,
-button,
-image {
-  box-sizing: border-box;
-}
-/* 按钮样式处理 */
-button {
-  font-size: 28rpx;
-}
-/* 取消按钮默认的边框线效果 */
-button:after {
-  border: none;
+.chat-box .chat-tips {
+  position: fixed;
+  left: 0;
+  top: 0;
+  width: 100%;
+  z-index: 9;
+  background-color: #08979c;
+  height: 72rpx;
+  line-height: 72rpx;
+  color: #fff;
+  text-align: center;
+  opacity: 0.9;
 }
-/* 设置图片默认样式,取消默认尺寸 */
-image {
-  display: block;
+.chat-box .chat-list {
+  width: 100%;
   height: auto;
-  width: auto;
-}
-/* 输入框默认字体大小 */
-textarea,
-input {
-  font-size: 28rpx;
-}
-/* 列式弹性盒子 */
-.flex_col {
-  display: flex;
-  flex-direction: row;
-  flex-wrap: nowrap;
-  justify-content: flex-start;
-  align-items: center;
-  align-content: center;
+  padding-bottom: 120rpx;
+  box-sizing: content-box;
+  /* 兼容iPhoneX */
+  margin-bottom: 0;
+  margin-bottom: constant(safe-area-inset-bottom);
+  margin-bottom: env(safe-area-inset-bottom);
 }
-/* 行式弹性盒子 */
-.flex_row {
+.chat-box .chat-list .chat-item {
   display: flex;
-  flex-direction: column;
-  flex-wrap: nowrap;
-  justify-content: flex-start;
+  padding: 20rpx 20rpx 0 20rpx;
   align-items: flex-start;
   align-content: flex-start;
+  /* 收到的消息 */
+  /* 发出的消息 */
 }
-/* 弹性盒子弹性容器 */
-.flex_col .flex_grow {
-  width: 0;
-  flex-grow: 1;
-}
-.flex_row .flex_grow {
-  flex-grow: 1;
+.chat-box .chat-list .chat-item .avatar {
+  width: 80rpx;
+  height: 80rpx;
+  border-radius: 50%;
+  border: #fff solid 1px;
 }
-/* 弹性盒子允许换行 */
-.flex_col.flex_wrap {
-  flex-wrap: wrap;
+.chat-box .chat-list .chat-item .content-box {
+  flex: 1;
+  width: 0;
+  display: flex;
 }
-/* 弹性盒子居中对齐 */
-.flex_col.flex_center,
-.flex_row.flex_center {
-  justify-content: center;
+.chat-box .chat-list .chat-item .image-box {
+  border-radius: 16rpx;
 }
-/* 列式弹性盒子两端对齐 */
-.flex_col.flex_space {
-  justify-content: space-between;
+.chat-box .chat-list .chat-item .image-width {
+  width: 280rpx;
+  height: 200rpx;
 }
-/* 弹性盒子快速分栏 ,这里非常郁闷 uniapp 居然不支持 * 选择器 */
-.flex_col.flex_col_2 > view {
-  width: 50%;
+.chat-box .chat-list .chat-item .image-height {
+  width: 200rpx;
+  height: 280rpx;
 }
-.flex_col.flex_col_3 > view {
-  width: 33.33333%;
+.chat-box .chat-list .chat-item .image-width-height {
+  width: 200rpx;
+  height: 200rpx;
 }
-.flex_col.flex_col_4 > view {
-  width: 25%;
+.chat-box .chat-list .chat-item .content {
+  padding: 20rpx 30rpx;
+  border-radius: 16rpx;
+  word-break: break-all;
+  line-height: 42rpx;
+  position: relative;
+  font-weight: 300;
 }
-.flex_col.flex_col_5 > view {
-  width: 20%;
+.chat-box .chat-list .chat-item.pull .content-box {
+  margin-right: 100rpx;
 }
-.flex_col.flex_col_6 > view {
-  width: 16.66666%;
+.chat-box .chat-list .chat-item.pull .image-box {
+  margin-left: 20rpx;
 }
-/* 字体颜色 */
-.color_333 {
-  color: #333;
+.chat-box .chat-list .chat-item.pull .content {
+  margin-left: 20rpx;
+  background-color: #fff;
 }
-.color_666 {
-  color: #666;
+.chat-box .chat-list .chat-item.push {
+  /* 主轴为水平方向,起点在右端。使不修改DOM结构,也能改变元素排列顺序 */
+  flex-direction: row-reverse;
 }
-.color_999 {
-  color: #999;
+.chat-box .chat-list .chat-item.push .content-box {
+  flex-direction: row-reverse;
+  margin-left: 100rpx;
 }
-.color_ccc {
-  color: #ccc;
+.chat-box .chat-list .chat-item.push .image-box {
+  margin-right: 20rpx;
 }
-.color_fff {
+.chat-box .chat-list .chat-item.push .content {
+  margin-right: 20rpx;
+  background-color: #08979c;
   color: #fff;
+  box-shadow: 0px 1px 12px rgba(3, 3, 3, 0.08);
 }
-.color_6dc {
-  color: #6dca6d;
-}
-.color_d51 {
-  color: #d51917;
-}
-.color_09f {
-  color: #0099ff;
-}
-/* 背景色*/
-.bg_fff {
-  background-color: #ffffff;
-}
-/* 字体大小 */
-.size_10 {
-  font-size: 20rpx;
-}
-.size_12 {
-  font-size: 24rpx;
-}
-.size_14 {
-  font-size: 28rpx;
-}
-.size_16 {
-  font-size: 32rpx;
-}
-.size_18 {
-  font-size: 36rpx;
-}
-.size_20 {
-  font-size: 40rpx;
-}
-/* 字体加粗 */
-.font_b {
-  font-weight: bold;
-}
-/* 对齐方式 */
-.align_c {
-  text-align: center;
-}
-.align_l {
-  text-align: left;
-}
-.align_r {
-  text-align: right;
-}
-/* 遮罩 */
-.shade {
-  position: fixed;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  background-color: rgba(0, 0, 0, 0.8);
-  z-index: 100;
-}
-/* 弹窗 */
-.shade_box {
-  position: fixed;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  margin: auto;
-  z-index: 101;
-  min-width: 200rpx;
-  min-height: 200rpx;
-}
-/* 加载数据提示 */
-.tips {
-  position: fixed;
-  left: 0;
-  top: 0px;
-  width: 100%;
-  z-index: 9;
-  background-color: rgba(0, 0, 0, 0.15);
-  height: 72rpx;
-  line-height: 72rpx;
-  -webkit-transform: translateY(-80rpx);
-          transform: translateY(-80rpx);
-  transition: -webkit-transform 0.3s ease-in-out 0s;
-  transition: transform 0.3s ease-in-out 0s;
-  transition: transform 0.3s ease-in-out 0s, -webkit-transform 0.3s ease-in-out 0s;
-}
-.tips.show {
-  -webkit-transform: translateY(0);
-          transform: translateY(0);
-}
-.box-1 {
-  width: 100%;
-  height: auto;
-  padding-bottom: 100rpx;
-  box-sizing: content-box;
-  /* 兼容iPhoneX */
-  margin-bottom: 0;
-  margin-bottom: constant(safe-area-inset-bottom);
-  margin-bottom: env(safe-area-inset-bottom);
-}
-.box-2 {
+.chat-box .chat-submit {
   position: fixed;
   left: 0;
   width: 100%;
   bottom: 0;
-  height: auto;
+  height: 100rpx;
   z-index: 2;
-  border-top: #e5e5e5 solid 1px;
-  box-sizing: content-box;
-  background-color: #F3F3F3;
+  background-color: #fff;
+  box-shadow: 0px 2px 10px rgba(3, 3, 3, 0.1);
   /* 兼容iPhoneX */
   padding-bottom: 0;
   padding-bottom: constant(safe-area-inset-bottom);
   padding-bottom: env(safe-area-inset-bottom);
+  display: flex;
+  align-items: center;
 }
-.box-2 > view {
-  padding: 0 20rpx;
-  height: 100rpx;
-}
-.box-2 .content {
-  background-color: #fff;
-  height: 64rpx;
+.chat-box .chat-submit .message-content {
+  flex: 1;
+  margin: 0 30rpx;
+  border: 1px solid #d9d9d9;
+  border-radius: 68rpx;
+  height: 68rpx;
   padding: 0 20rpx;
-  border-radius: 32rpx;
-  font-size: 28rpx;
-}
-.box-2 .send {
-  background-color: #42b983;
-  color: #fff;
-  height: 64rpx;
-  margin-left: 20rpx;
-  border-radius: 32rpx;
-  padding: 0;
-  width: 120rpx;
-  line-height: 62rpx;
-}
-.box-2 .send:active {
-  background-color: #5fc496;
 }
-.talk-list {
-  padding-bottom: 20rpx;
-  /* 消息项,基础类 */
+.chat-box .chat-submit .message-placeholder {
+  color: #8c8c8c;
+  font-weight: 300;
 }
-.talk-list .item {
-  padding: 20rpx 20rpx 0 20rpx;
-  align-items: flex-start;
-  align-content: flex-start;
-  color: #333;
-  /* 收到的消息 */
-  /* 发出的消息 */
-}
-.talk-list .item .pic {
-  width: 92rpx;
-  height: 92rpx;
+.chat-box .chat-submit .send-button {
+  width: 68rpx;
+  height: 68rpx;
   border-radius: 50%;
-  border: #fff solid 1px;
-}
-.talk-list .item .content {
-  padding: 20rpx;
-  border-radius: 4px;
-  max-width: 500rpx;
-  word-break: break-all;
-  line-height: 52rpx;
-  position: relative;
-}
-.talk-list .item.pull .content {
-  margin-left: 32rpx;
-  background-color: #fff;
-}
-.talk-list .item.pull .content::after {
-  content: '';
-  display: block;
-  width: 0;
-  height: 0;
-  border-top: 16rpx solid transparent;
-  border-bottom: 16rpx solid transparent;
-  border-right: 20rpx solid #fff;
-  position: absolute;
-  top: 30rpx;
-  left: -18rpx;
-}
-.talk-list .item.push {
-  /* 主轴为水平方向,起点在右端。使不修改DOM结构,也能改变元素排列顺序 */
-  flex-direction: row-reverse;
+  display: flex;
+  align-items: center;
+  justify-content: center;
 }
-.talk-list .item.push .content {
-  margin-right: 32rpx;
-  background-color: #a0e959;
+.chat-box .chat-submit .send-button.send-image {
+  border: 1px solid #d9d9d9;
+  margin-right: 20rpx;
 }
-.talk-list .item.push .content::after {
-  content: '';
-  display: block;
-  width: 0;
-  height: 0;
-  border-top: 16rpx solid transparent;
-  border-bottom: 16rpx solid transparent;
-  border-left: 20rpx solid #a0e959;
-  position: absolute;
-  top: 30rpx;
-  right: -18rpx;
+.chat-box .chat-submit .send-button.send-submit {
+  background: #08979c;
+  margin-right: 30rpx;
 }
 

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/pages/house/house.wxml


+ 2 - 2
virgo.wzfrontend/yui_wx/unpackage/dist/dev/mp-weixin/static/scss/common.scss

@@ -61,7 +61,6 @@
 	bottom: 0;
 	left: 0;
 	right: 0;
-	padding: 0 30rpx;
 	display: flex;
 	align-items: center;
 
@@ -72,7 +71,8 @@
 		background: $uni-primary;
 		flex: 1;
 		text-align: center;
-		line-height: 68rpx;
+		line-height: 68rpx;
+		margin: 0 30rpx;
 	}
 }
 button[type=primary]{