From d4cae0e13c2362d4d6160ea122c405b729bc616a Mon Sep 17 00:00:00 2001
From: "1054425342@qq.com" <1054425342@qq.com>
Date: Mon, 11 Aug 2025 16:09:58 +0800
Subject: [PATCH] =?UTF-8?q?=E9=9D=99=E6=80=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/index.js | 52 +
components/DynamicIsland.vue | 161 ++-
components/header.vue | 4 +-
libs/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.js | 1122 +++++++++++++++
libs/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.min.js | 1 +
main.js | 3 +-
manifest.json | 9 +-
pages.json | 32 +
pages/index/iSoul.vue | 280 +++-
pages/index/index.vue | 14 +-
pages/index/timeShopBank.vue | 91 +-
pages/notes/detail.vue | 631 +++++++++
pages/notes/publish.vue | 445 ++++++
subPackages/equityGoods/detail.vue | 1290 +++++++++---------
subPackages/equityGoods/list.vue | 986 ++++++++-----
subPackages/memorialAlbum/detail.vue | 339 +++++
subPackages/memorialAlbum/index.vue | 219 +++
subPackages/orderQy/confrim.vue | 772 +++++++++++
subPackages/orderQy/detail.vue | 746 +++++-----
subPackages/orderQy/list.vue | 325 +++--
subPackages/user/travelerList.vue | 687 +++++-----
21 files changed, 6352 insertions(+), 1857 deletions(-)
create mode 100644 common/index.js
create mode 100644 libs/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.js
create mode 100644 libs/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.min.js
create mode 100644 pages/notes/detail.vue
create mode 100644 pages/notes/publish.vue
create mode 100644 subPackages/memorialAlbum/detail.vue
create mode 100644 subPackages/memorialAlbum/index.vue
diff --git a/common/index.js b/common/index.js
new file mode 100644
index 0000000..3e90280
--- /dev/null
+++ b/common/index.js
@@ -0,0 +1,52 @@
+import QQMapWX from '@/libs/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.js';
+//获取位置信息
+async function getLocationInfo() {
+ return new Promise((resolve) => {
+ //位置信息默认数据
+ let location = {
+ longitude: 0,
+ latitude: 0,
+ province: '',
+ city: '',
+ area: '',
+ street: '',
+ address: '',
+ };
+ uni.getLocation({
+ type: 'gcj02',
+ success(res) {
+ location.longitude = res.longitude;
+ location.latitude = res.latitude;
+ // 腾讯地图Api
+ const qqmapsdk = new QQMapWX({
+ key: 'X5YBZ-ES6K3-Q6E3P-RUVXH-2R5ZQ-ERBFG', //这里填写自己申请的key
+ });
+ qqmapsdk.reverseGeocoder({
+ location,
+ success(response) {
+ console.log(response)
+ let info = response.result;
+ location.province = info.address_component.province;
+ location.cityCode = info.ad_info.city_code.slice(3);
+ location.city = info.address_component.city;
+ location.area = info.address_component.district;
+ location.street = info.address_component.street;
+ location.address = info.address;
+ resolve(location);
+ },
+ fail(e){
+ console.log(e,'地址信息报错')
+ }
+ });
+ },
+ fail(err) {
+ console.log(err);
+ resolve(location);
+ },
+ });
+ });
+}
+//导出
+module.exports = {
+ getLocationInfo,
+};
diff --git a/components/DynamicIsland.vue b/components/DynamicIsland.vue
index d383106..e1fc7a5 100644
--- a/components/DynamicIsland.vue
+++ b/components/DynamicIsland.vue
@@ -16,75 +16,82 @@
>
-
-
- {{ title }}
-
-
-
-
-
-
-
- {{ getStatNumber("权益") }}
- 权益
-
-
- {{ getStatNumber("时间银行") }}
- 时间银行
-
-
-
-
- {{ actionText }}
-
-
-
-
-
-
-
-
- {{ getStatNumber("时间银行") }}
- 时间银行
-
-
-
-
-
-
- 在努力一点点,为更好的未来蓄力吧!
-
-
-
- 今日点赞和留言100条
-
-
-
-
-
-
+
+
+
+
+ {{ title }}
+ hi 快去登录 >
+
+
+
+
+
+
+
+ {{ getStatNumber("权益") }}
+ 权益
+
+
+ {{ getStatNumber("时间银行") }}
+ 时间银行
+
+
+
+
+ {{ actionText }}
+
+
+
+
+
+
+
+
+ {{ getStatNumber("时间银行") }}
+ 时间银行
+
+
+
+
+
+
+ 在努力一点点,为更好的未来蓄力吧!
+
+
+
+ 今日点赞和留言100条
+
+
+
+
+
+
+
@@ -143,7 +150,7 @@ export default {
isExpanded: false,
statusBarHeight: 0,
isScrolled: false,
- scrollThreshold: 160, // 灵动岛大卡片高度(160rpx)
+ scrollThreshold: 140, // 灵动岛大卡片高度(160rpx)
// 内部数据,减少对外部props的依赖
currentTitle: "Hi!用户,欢迎回来~",
currentSubtitle: "2个权益 | 120时间银行",
@@ -205,6 +212,11 @@ export default {
this.removeScrollListener();
},
methods: {
+ toLogin(){
+ uni.navigateTo({
+ url: "/pages/login/login",
+ });
+ },
handleToggle() {
if (this.isScrolled) {
// 固定模式下切换内部状态
@@ -294,6 +306,7 @@ export default {
JSON.parse(uni.getStorageSync("userInfo"))) ||
this.$store.state.user.userInfo ||
{};
+ console.log(this.userInfo,'this.userInfo')
// 更新标题显示用户昵称
if (this.userInfo && this.userInfo.nickname) {
this.currentTitle = `Hi!${this.userInfo.nickname},欢迎回来~`;
@@ -303,6 +316,11 @@ export default {
this.userInfo = {};
}
},
+ toWebView(){
+ uni.navigateTo({
+ url:'/subPackages/webPage/webPage?url='+'https://www.dayunyuanjian.cn/dist/#/chat-demo'
+ })
+ }
},
};
@@ -410,10 +428,7 @@ export default {
.qr-code {
width: 32rpx;
height: 32rpx;
-<<<<<<< HEAD
-=======
->>>>>>> 402de12 (feat:首页静态)
}
.qr-icon {
diff --git a/components/header.vue b/components/header.vue
index c7d4539..1f9dd1a 100644
--- a/components/header.vue
+++ b/components/header.vue
@@ -10,7 +10,7 @@
>
-
+
{{ selectedLocation }}
> 16) + (y >> 16) + (lsw >> 16);
+ return (msw << 16) | (lsw & 0xffff);
+ },
+ bitRotateLeft(num, cnt) {
+ return (num << cnt) | (num >>> (32 - cnt));
+ },
+ md5cmn(q, a, b, x, s, t) {
+ return this.safeAdd(this.bitRotateLeft(this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), s), b);
+ },
+ md5ff(a, b, c, d, x, s, t) {
+ return this.md5cmn((b & c) | (~b & d), a, b, x, s, t);
+ },
+ md5gg(a, b, c, d, x, s, t) {
+ return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t);
+ },
+ md5hh(a, b, c, d, x, s, t) {
+ return this.md5cmn(b ^ c ^ d, a, b, x, s, t);
+ },
+ md5ii(a, b, c, d, x, s, t) {
+ return this.md5cmn(c ^ (b | ~d), a, b, x, s, t);
+ },
+ binlMD5(x, len) {
+ /* append padding */
+ x[len >> 5] |= 0x80 << (len % 32);
+ x[((len + 64) >>> 9 << 4) + 14] = len;
+
+ var i;
+ var olda;
+ var oldb;
+ var oldc;
+ var oldd;
+ var a = 1732584193;
+ var b = -271733879;
+ var c = -1732584194;
+ var d = 271733878;
+
+ for (i = 0; i < x.length; i += 16) {
+ olda = a;
+ oldb = b;
+ oldc = c;
+ oldd = d;
+
+ a = this.md5ff(a, b, c, d, x[i], 7, -680876936);
+ d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586);
+ c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819);
+ b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
+ a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897);
+ d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
+ c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
+ b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983);
+ a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
+ d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
+ c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063);
+ b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
+ a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
+ d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101);
+ c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
+ b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
+
+ a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510);
+ d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
+ c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713);
+ b = this.md5gg(b, c, d, a, x[i], 20, -373897302);
+ a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691);
+ d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083);
+ c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335);
+ b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848);
+ a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438);
+ d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
+ c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961);
+ b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
+ a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
+ d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784);
+ c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
+ b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
+
+ a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558);
+ d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
+ c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
+ b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556);
+ a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
+ d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
+ c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632);
+ b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
+ a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174);
+ d = this.md5hh(d, a, b, c, x[i], 11, -358537222);
+ c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979);
+ b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189);
+ a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487);
+ d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835);
+ c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520);
+ b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651);
+
+ a = this.md5ii(a, b, c, d, x[i], 6, -198630844);
+ d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
+ c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
+ b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055);
+ a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
+ d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
+ c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523);
+ b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
+ a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
+ d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744);
+ c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
+ b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
+ a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070);
+ d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
+ c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259);
+ b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551);
+
+ a = this.safeAdd(a, olda);
+ b = this.safeAdd(b, oldb);
+ c = this.safeAdd(c, oldc);
+ d = this.safeAdd(d, oldd);
+ }
+ return [a, b, c, d];
+ },
+ binl2rstr(input) {
+ var i;
+ var output = '';
+ var length32 = input.length * 32;
+ for (i = 0; i < length32; i += 8) {
+ output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff);
+ }
+ return output;
+ },
+ rstr2binl(input) {
+ var i;
+ var output = [];
+ output[(input.length >> 2) - 1] = undefined;
+ for (i = 0; i < output.length; i += 1) {
+ output[i] = 0;
+ }
+ var length8 = input.length * 8;
+ for (i = 0; i < length8; i += 8) {
+ output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32);
+ }
+ return output;
+ },
+ rstrMD5(s) {
+ return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8));
+ },
+ rstrHMACMD5(key, data) {
+ var i;
+ var bkey = this.rstr2binl(key);
+ var ipad = [];
+ var opad = [];
+ var hash;
+ ipad[15] = opad[15] = undefined;
+ if (bkey.length > 16) {
+ bkey = this.binlMD5(bkey, key.length * 8);
+ }
+ for (i = 0; i < 16; i += 1) {
+ ipad[i] = bkey[i] ^ 0x36363636;
+ opad[i] = bkey[i] ^ 0x5c5c5c5c;
+ }
+ hash = this.binlMD5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8);
+ return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128));
+ },
+ rstr2hex(input) {
+ var hexTab = '0123456789abcdef';
+ var output = '';
+ var x;
+ var i;
+ for (i = 0; i < input.length; i += 1) {
+ x = input.charCodeAt(i);
+ output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f);
+ }
+ return output;
+ },
+ str2rstrUTF8(input) {
+ return unescape(encodeURIComponent(input));
+ },
+ rawMD5(s) {
+ return this.rstrMD5(this.str2rstrUTF8(s));
+ },
+ hexMD5(s) {
+ return this.rstr2hex(this.rawMD5(s));
+ },
+ rawHMACMD5(k, d) {
+ return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d));
+ },
+ hexHMACMD5(k, d) {
+ return this.rstr2hex(this.rawHMACMD5(k, d));
+ },
+
+ md5(string, key, raw) {
+ if (!key) {
+ if (!raw) {
+ return this.hexMD5(string);
+ }
+ return this.rawMD5(string);
+ }
+ if (!raw) {
+ return this.hexHMACMD5(key, string);
+ }
+ return this.rawHMACMD5(key, string);
+ },
+ /**
+ * 得到md5加密后的sig参数
+ * @param {Object} requestParam 接口参数
+ * @param {String} sk签名字符串
+ * @param {String} featrue 方法名
+ * @return 返回加密后的sig参数
+ */
+ getSig(requestParam, sk, feature, mode) {
+ var sig = null;
+ var requestArr = [];
+ Object.keys(requestParam).sort().forEach(function(key){
+ requestArr.push(key + '=' + requestParam[key]);
+ });
+ if (feature == 'search') {
+ sig = '/ws/place/v1/search?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'suggest') {
+ sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'reverseGeocoder') {
+ sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'geocoder') {
+ sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'getCityList') {
+ sig = '/ws/district/v1/list?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'getDistrictByCityId') {
+ sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'calculateDistance') {
+ sig = '/ws/distance/v1/?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'direction') {
+ sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk;
+ }
+ sig = this.md5(sig);
+ return sig;
+ },
+ /**
+ * 得到终点query字符串
+ * @param {Array|String} 检索数据
+ */
+ location2query(data) {
+ if (typeof data == 'string') {
+ return data;
+ }
+ var query = '';
+ for (var i = 0; i < data.length; i++) {
+ var d = data[i];
+ if (!!query) {
+ query += ';';
+ }
+ if (d.location) {
+ query = query + d.location.lat + ',' + d.location.lng;
+ }
+ if (d.latitude && d.longitude) {
+ query = query + d.latitude + ',' + d.longitude;
+ }
+ }
+ return query;
+ },
+
+ /**
+ * 计算角度
+ */
+ rad(d) {
+ return d * Math.PI / 180.0;
+ },
+ /**
+ * 处理终点location数组
+ * @return 返回终点数组
+ */
+ getEndLocation(location){
+ var to = location.split(';');
+ var endLocation = [];
+ for (var i = 0; i < to.length; i++) {
+ endLocation.push({
+ lat: parseFloat(to[i].split(',')[0]),
+ lng: parseFloat(to[i].split(',')[1])
+ })
+ }
+ return endLocation;
+ },
+
+ /**
+ * 计算两点间直线距离
+ * @param a 表示纬度差
+ * @param b 表示经度差
+ * @return 返回的是距离,单位m
+ */
+ getDistance(latFrom, lngFrom, latTo, lngTo) {
+ var radLatFrom = this.rad(latFrom);
+ var radLatTo = this.rad(latTo);
+ var a = radLatFrom - radLatTo;
+ var b = this.rad(lngFrom) - this.rad(lngTo);
+ var distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2)));
+ distance = distance * EARTH_RADIUS;
+ distance = Math.round(distance * 10000) / 10000;
+ return parseFloat(distance.toFixed(0));
+ },
+ /**
+ * 使用微信接口进行定位
+ */
+ getWXLocation(success, fail, complete) {
+ wx.getLocation({
+ type: 'gcj02',
+ success: success,
+ fail: fail,
+ complete: complete
+ });
+ },
+
+ /**
+ * 获取location参数
+ */
+ getLocationParam(location) {
+ if (typeof location == 'string') {
+ var locationArr = location.split(',');
+ if (locationArr.length === 2) {
+ location = {
+ latitude: location.split(',')[0],
+ longitude: location.split(',')[1]
+ };
+ } else {
+ location = {};
+ }
+ }
+ return location;
+ },
+
+ /**
+ * 回调函数默认处理
+ */
+ polyfillParam(param) {
+ param.success = param.success || function () { };
+ param.fail = param.fail || function () { };
+ param.complete = param.complete || function () { };
+ },
+
+ /**
+ * 验证param对应的key值是否为空
+ *
+ * @param {Object} param 接口参数
+ * @param {String} key 对应参数的key
+ */
+ checkParamKeyEmpty(param, key) {
+ if (!param[key]) {
+ var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key +'参数格式有误');
+ param.fail(errconf);
+ param.complete(errconf);
+ return true;
+ }
+ return false;
+ },
+
+ /**
+ * 验证参数中是否存在检索词keyword
+ *
+ * @param {Object} param 接口参数
+ */
+ checkKeyword(param){
+ return !this.checkParamKeyEmpty(param, 'keyword');
+ },
+
+ /**
+ * 验证location值
+ *
+ * @param {Object} param 接口参数
+ */
+ checkLocation(param) {
+ var location = this.getLocationParam(param.location);
+ if (!location || !location.latitude || !location.longitude) {
+ var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误');
+ param.fail(errconf);
+ param.complete(errconf);
+ return false;
+ }
+ return true;
+ },
+
+ /**
+ * 构造错误数据结构
+ * @param {Number} errCode 错误码
+ * @param {Number} errMsg 错误描述
+ */
+ buildErrorConfig(errCode, errMsg) {
+ return {
+ status: errCode,
+ message: errMsg
+ };
+ },
+
+ /**
+ *
+ * 数据处理函数
+ * 根据传入参数不同处理不同数据
+ * @param {String} feature 功能名称
+ * search 地点搜索
+ * suggest关键词提示
+ * reverseGeocoder逆地址解析
+ * geocoder地址解析
+ * getCityList获取城市列表:父集
+ * getDistrictByCityId获取区县列表:子集
+ * calculateDistance距离计算
+ * @param {Object} param 接口参数
+ * @param {Object} data 数据
+ */
+ handleData(param,data,feature){
+ if (feature == 'search') {
+ var searchResult = data.data;
+ var searchSimplify = [];
+ for (var i = 0; i < searchResult.length; i++) {
+ searchSimplify.push({
+ id: searchResult[i].id || null,
+ title: searchResult[i].title || null,
+ latitude: searchResult[i].location && searchResult[i].location.lat || null,
+ longitude: searchResult[i].location && searchResult[i].location.lng || null,
+ address: searchResult[i].address || null,
+ category: searchResult[i].category || null,
+ tel: searchResult[i].tel || null,
+ adcode: searchResult[i].ad_info && searchResult[i].ad_info.adcode || null,
+ city: searchResult[i].ad_info && searchResult[i].ad_info.city || null,
+ district: searchResult[i].ad_info && searchResult[i].ad_info.district || null,
+ province: searchResult[i].ad_info && searchResult[i].ad_info.province || null
+ })
+ }
+ param.success(data, {
+ searchResult: searchResult,
+ searchSimplify: searchSimplify
+ })
+ } else if (feature == 'suggest') {
+ var suggestResult = data.data;
+ var suggestSimplify = [];
+ for (var i = 0; i < suggestResult.length; i++) {
+ suggestSimplify.push({
+ adcode: suggestResult[i].adcode || null,
+ address: suggestResult[i].address || null,
+ category: suggestResult[i].category || null,
+ city: suggestResult[i].city || null,
+ district: suggestResult[i].district || null,
+ id: suggestResult[i].id || null,
+ latitude: suggestResult[i].location && suggestResult[i].location.lat || null,
+ longitude: suggestResult[i].location && suggestResult[i].location.lng || null,
+ province: suggestResult[i].province || null,
+ title: suggestResult[i].title || null,
+ type: suggestResult[i].type || null
+ })
+ }
+ param.success(data, {
+ suggestResult: suggestResult,
+ suggestSimplify: suggestSimplify
+ })
+ } else if (feature == 'reverseGeocoder') {
+ var reverseGeocoderResult = data.result;
+ var reverseGeocoderSimplify = {
+ address: reverseGeocoderResult.address || null,
+ latitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lat || null,
+ longitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lng || null,
+ adcode: reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode || null,
+ city: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city || null,
+ district: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district || null,
+ nation: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation || null,
+ province: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province || null,
+ street: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street || null,
+ street_number: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number || null,
+ recommend: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend || null,
+ rough: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough || null
+ };
+ if (reverseGeocoderResult.pois) {//判断是否返回周边poi
+ var pois = reverseGeocoderResult.pois;
+ var poisSimplify = [];
+ for (var i = 0;i < pois.length;i++) {
+ poisSimplify.push({
+ id: pois[i].id || null,
+ title: pois[i].title || null,
+ latitude: pois[i].location && pois[i].location.lat || null,
+ longitude: pois[i].location && pois[i].location.lng || null,
+ address: pois[i].address || null,
+ category: pois[i].category || null,
+ adcode: pois[i].ad_info && pois[i].ad_info.adcode || null,
+ city: pois[i].ad_info && pois[i].ad_info.city || null,
+ district: pois[i].ad_info && pois[i].ad_info.district || null,
+ province: pois[i].ad_info && pois[i].ad_info.province || null
+ })
+ }
+ param.success(data,{
+ reverseGeocoderResult: reverseGeocoderResult,
+ reverseGeocoderSimplify: reverseGeocoderSimplify,
+ pois: pois,
+ poisSimplify: poisSimplify
+ })
+ } else {
+ param.success(data, {
+ reverseGeocoderResult: reverseGeocoderResult,
+ reverseGeocoderSimplify: reverseGeocoderSimplify
+ })
+ }
+ } else if (feature == 'geocoder') {
+ var geocoderResult = data.result;
+ var geocoderSimplify = {
+ title: geocoderResult.title || null,
+ latitude: geocoderResult.location && geocoderResult.location.lat || null,
+ longitude: geocoderResult.location && geocoderResult.location.lng || null,
+ adcode: geocoderResult.ad_info && geocoderResult.ad_info.adcode || null,
+ province: geocoderResult.address_components && geocoderResult.address_components.province || null,
+ city: geocoderResult.address_components && geocoderResult.address_components.city || null,
+ district: geocoderResult.address_components && geocoderResult.address_components.district || null,
+ street: geocoderResult.address_components && geocoderResult.address_components.street || null,
+ street_number: geocoderResult.address_components && geocoderResult.address_components.street_number || null,
+ level: geocoderResult.level || null
+ };
+ param.success(data,{
+ geocoderResult: geocoderResult,
+ geocoderSimplify: geocoderSimplify
+ });
+ } else if (feature == 'getCityList') {
+ var provinceResult = data.result[0];
+ var cityResult = data.result[1];
+ var districtResult = data.result[2];
+ param.success(data,{
+ provinceResult: provinceResult,
+ cityResult: cityResult,
+ districtResult: districtResult
+ });
+ } else if (feature == 'getDistrictByCityId') {
+ var districtByCity = data.result[0];
+ param.success(data, districtByCity);
+ } else if (feature == 'calculateDistance') {
+ var calculateDistanceResult = data.result.elements;
+ var distance = [];
+ for (var i = 0; i < calculateDistanceResult.length; i++){
+ distance.push(calculateDistanceResult[i].distance);
+ }
+ param.success(data, {
+ calculateDistanceResult: calculateDistanceResult,
+ distance: distance
+ });
+ } else if (feature == 'direction') {
+ var direction = data.result.routes;
+ param.success(data,direction);
+ } else {
+ param.success(data);
+ }
+ },
+
+ /**
+ * 构造微信请求参数,公共属性处理
+ *
+ * @param {Object} param 接口参数
+ * @param {Object} param 配置项
+ * @param {String} feature 方法名
+ */
+ buildWxRequestConfig(param, options, feature) {
+ var that = this;
+ options.header = { "content-type": "application/json" };
+ options.method = 'GET';
+ options.success = function (res) {
+ var data = res.data;
+ if (data.status === 0) {
+ that.handleData(param, data, feature);
+ } else {
+ param.fail(data);
+ }
+ };
+ options.fail = function (res) {
+ res.statusCode = ERROR_CONF.WX_ERR_CODE;
+ param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+ };
+ options.complete = function (res) {
+ var statusCode = +res.statusCode;
+ switch(statusCode) {
+ case ERROR_CONF.WX_ERR_CODE: {
+ param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+ break;
+ }
+ case ERROR_CONF.WX_OK_CODE: {
+ var data = res.data;
+ if (data.status === 0) {
+ param.complete(data);
+ } else {
+ param.complete(that.buildErrorConfig(data.status, data.message));
+ }
+ break;
+ }
+ default:{
+ param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG));
+ }
+
+ }
+ };
+ return options;
+ },
+
+ /**
+ * 处理用户参数是否传入坐标进行不同的处理
+ */
+ locationProcess(param, locationsuccess, locationfail, locationcomplete) {
+ var that = this;
+ locationfail = locationfail || function (res) {
+ res.statusCode = ERROR_CONF.WX_ERR_CODE;
+ param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+ };
+ locationcomplete = locationcomplete || function (res) {
+ if (res.statusCode == ERROR_CONF.WX_ERR_CODE) {
+ param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+ }
+ };
+ if (!param.location) {
+ that.getWXLocation(locationsuccess, locationfail, locationcomplete);
+ } else if (that.checkLocation(param)) {
+ var location = Utils.getLocationParam(param.location);
+ locationsuccess(location);
+ }
+ }
+};
+
+
+class QQMapWX {
+
+ /**
+ * 构造函数
+ *
+ * @param {Object} options 接口参数,key 为必选参数
+ */
+ constructor(options) {
+ if (!options.key) {
+ throw Error('key值不能为空');
+ }
+ this.key = options.key;
+ };
+
+ /**
+ * POI周边检索
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 参数对象结构可以参考
+ * @see http://lbs.qq.com/webservice_v1/guide-search.html
+ */
+ search(options) {
+ var that = this;
+ options = options || {};
+
+ Utils.polyfillParam(options);
+
+ if (!Utils.checkKeyword(options)) {
+ return;
+ }
+
+ var requestParam = {
+ keyword: options.keyword,
+ orderby: options.orderby || '_distance',
+ page_size: options.page_size || 10,
+ page_index: options.page_index || 1,
+ output: 'json',
+ key: that.key
+ };
+
+ if (options.address_format) {
+ requestParam.address_format = options.address_format;
+ }
+
+ if (options.filter) {
+ requestParam.filter = options.filter;
+ }
+
+ var distance = options.distance || "1000";
+ var auto_extend = options.auto_extend || 1;
+ var region = null;
+ var rectangle = null;
+
+ //判断城市限定参数
+ if (options.region) {
+ region = options.region;
+ }
+
+ //矩形限定坐标(暂时只支持字符串格式)
+ if (options.rectangle) {
+ rectangle = options.rectangle;
+ }
+
+ var locationsuccess = function (result) {
+ if (region && !rectangle) {
+ //城市限定参数拼接
+ requestParam.boundary = "region(" + region + "," + auto_extend + "," + result.latitude + "," + result.longitude + ")";
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'search');
+ }
+ } else if (rectangle && !region) {
+ //矩形搜索
+ requestParam.boundary = "rectangle(" + rectangle + ")";
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'search');
+ }
+ } else {
+ requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")";
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'search');
+ }
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_SEARCH,
+ data: requestParam
+ }, 'search'));
+ };
+ Utils.locationProcess(options, locationsuccess);
+ };
+
+ /**
+ * sug模糊检索
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 参数对象结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-suggestion.html
+ */
+ getSuggestion(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+
+ if (!Utils.checkKeyword(options)) {
+ return;
+ }
+
+ var requestParam = {
+ keyword: options.keyword,
+ region: options.region || '全国',
+ region_fix: options.region_fix || 0,
+ policy: options.policy || 0,
+ page_size: options.page_size || 10,//控制显示条数
+ page_index: options.page_index || 1,//控制页数
+ get_subpois : options.get_subpois || 0,//返回子地点
+ output: 'json',
+ key: that.key
+ };
+ //长地址
+ if (options.address_format) {
+ requestParam.address_format = options.address_format;
+ }
+ //过滤
+ if (options.filter) {
+ requestParam.filter = options.filter;
+ }
+ //排序
+ if (options.location) {
+ var locationsuccess = function (result) {
+ requestParam.location = result.latitude + ',' + result.longitude;
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest');
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_SUGGESTION,
+ data: requestParam
+ }, "suggest"));
+ };
+ Utils.locationProcess(options, locationsuccess);
+ } else {
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest');
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_SUGGESTION,
+ data: requestParam
+ }, "suggest"));
+ }
+ };
+
+ /**
+ * 逆地址解析
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-gcoder.html
+ */
+ reverseGeocoder(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+ var requestParam = {
+ coord_type: options.coord_type || 5,
+ get_poi: options.get_poi || 0,
+ output: 'json',
+ key: that.key
+ };
+ if (options.poi_options) {
+ requestParam.poi_options = options.poi_options
+ }
+
+ var locationsuccess = function (result) {
+ requestParam.location = result.latitude + ',' + result.longitude;
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder');
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_GET_GEOCODER,
+ data: requestParam
+ }, 'reverseGeocoder'));
+ };
+ Utils.locationProcess(options, locationsuccess);
+ };
+
+ /**
+ * 地址解析
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-geocoder.html
+ */
+ geocoder(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+
+ if (Utils.checkParamKeyEmpty(options, 'address')) {
+ return;
+ }
+
+ var requestParam = {
+ address: options.address,
+ output: 'json',
+ key: that.key
+ };
+
+ //城市限定
+ if (options.region) {
+ requestParam.region = options.region;
+ }
+
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder');
+ }
+
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_GET_GEOCODER,
+ data: requestParam
+ },'geocoder'));
+ };
+
+
+ /**
+ * 获取城市列表
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-region.html
+ */
+ getCityList(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+ var requestParam = {
+ output: 'json',
+ key: that.key
+ };
+
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList');
+ }
+
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_CITY_LIST,
+ data: requestParam
+ },'getCityList'));
+ };
+
+ /**
+ * 获取对应城市ID的区县列表
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-region.html
+ */
+ getDistrictByCityId(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+
+ if (Utils.checkParamKeyEmpty(options, 'id')) {
+ return;
+ }
+
+ var requestParam = {
+ id: options.id || '',
+ output: 'json',
+ key: that.key
+ };
+
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId');
+ }
+
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_AREA_LIST,
+ data: requestParam
+ },'getDistrictByCityId'));
+ };
+
+ /**
+ * 用于单起点到多终点的路线距离(非直线距离)计算:
+ * 支持两种距离计算方式:步行和驾车。
+ * 起点到终点最大限制直线距离10公里。
+ *
+ * 新增直线距离计算。
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-distance.html
+ */
+ calculateDistance(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+
+ if (Utils.checkParamKeyEmpty(options, 'to')) {
+ return;
+ }
+
+ var requestParam = {
+ mode: options.mode || 'walking',
+ to: Utils.location2query(options.to),
+ output: 'json',
+ key: that.key
+ };
+
+ if (options.from) {
+ options.location = options.from;
+ }
+
+ //计算直线距离
+ if(requestParam.mode == 'straight'){
+ var locationsuccess = function (result) {
+ var locationTo = Utils.getEndLocation(requestParam.to);//处理终点坐标
+ var data = {
+ message:"query ok",
+ result:{
+ elements:[]
+ },
+ status:0
+ };
+ for (var i = 0; i < locationTo.length; i++) {
+ data.result.elements.push({//将坐标存入
+ distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng),
+ duration:0,
+ from:{
+ lat: result.latitude,
+ lng:result.longitude
+ },
+ to:{
+ lat: locationTo[i].lat,
+ lng: locationTo[i].lng
+ }
+ });
+ }
+ var calculateResult = data.result.elements;
+ var distanceResult = [];
+ for (var i = 0; i < calculateResult.length; i++) {
+ distanceResult.push(calculateResult[i].distance);
+ }
+ return options.success(data,{
+ calculateResult: calculateResult,
+ distanceResult: distanceResult
+ });
+ };
+
+ Utils.locationProcess(options, locationsuccess);
+ } else {
+ var locationsuccess = function (result) {
+ requestParam.from = result.latitude + ',' + result.longitude;
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance');
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_DISTANCE,
+ data: requestParam
+ },'calculateDistance'));
+ };
+
+ Utils.locationProcess(options, locationsuccess);
+ }
+ };
+
+ /**
+ * 路线规划:
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * https://lbs.qq.com/webservice_v1/guide-road.html
+ */
+ direction(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+
+ if (Utils.checkParamKeyEmpty(options, 'to')) {
+ return;
+ }
+
+ var requestParam = {
+ output: 'json',
+ key: that.key
+ };
+
+ //to格式处理
+ if (typeof options.to == 'string') {
+ requestParam.to = options.to;
+ } else {
+ requestParam.to = options.to.latitude + ',' + options.to.longitude;
+ }
+ //初始化局部请求域名
+ var SET_URL_DIRECTION = null;
+ //设置默认mode属性
+ options.mode = options.mode || MODE.driving;
+
+ //设置请求域名
+ SET_URL_DIRECTION = URL_DIRECTION + options.mode;
+
+ if (options.from) {
+ options.location = options.from;
+ }
+
+ if (options.mode == MODE.driving) {
+ if (options.from_poi) {
+ requestParam.from_poi = options.from_poi;
+ }
+ if (options.heading) {
+ requestParam.heading = options.heading;
+ }
+ if (options.speed) {
+ requestParam.speed = options.speed;
+ }
+ if (options.accuracy) {
+ requestParam.accuracy = options.accuracy;
+ }
+ if (options.road_type) {
+ requestParam.road_type = options.road_type;
+ }
+ if (options.to_poi) {
+ requestParam.to_poi = options.to_poi;
+ }
+ if (options.from_track) {
+ requestParam.from_track = options.from_track;
+ }
+ if (options.waypoints) {
+ requestParam.waypoints = options.waypoints;
+ }
+ if (options.policy) {
+ requestParam.policy = options.policy;
+ }
+ if (options.plate_number) {
+ requestParam.plate_number = options.plate_number;
+ }
+ }
+
+ if (options.mode == MODE.transit) {
+ if (options.departure_time) {
+ requestParam.departure_time = options.departure_time;
+ }
+ if (options.policy) {
+ requestParam.policy = options.policy;
+ }
+ }
+
+ var locationsuccess = function (result) {
+ requestParam.from = result.latitude + ',' + result.longitude;
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction',options.mode);
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: SET_URL_DIRECTION,
+ data: requestParam
+ }, 'direction'));
+ };
+
+ Utils.locationProcess(options, locationsuccess);
+ }
+};
+
+module.exports = QQMapWX;
\ No newline at end of file
diff --git a/libs/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.min.js b/libs/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.min.js
new file mode 100644
index 0000000..8fa1477
--- /dev/null
+++ b/libs/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.min.js
@@ -0,0 +1 @@
+var ERROR_CONF = { KEY_ERR: 311, KEY_ERR_MSG: 'key格式错误', PARAM_ERR: 310, PARAM_ERR_MSG: '请求参数信息有误', SYSTEM_ERR: 600, SYSTEM_ERR_MSG: '系统错误', WX_ERR_CODE: 1000, WX_OK_CODE: 200 }; var BASE_URL = 'https://apis.map.qq.com/ws/'; var URL_SEARCH = BASE_URL + 'place/v1/search'; var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion'; var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/'; var URL_CITY_LIST = BASE_URL + 'district/v1/list'; var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren'; var URL_DISTANCE = BASE_URL + 'distance/v1/'; var URL_DIRECTION = BASE_URL + 'direction/v1/'; var MODE = { driving: 'driving', transit: 'transit' }; var EARTH_RADIUS = 6378136.49; var Utils = { safeAdd(x, y) { var lsw = (x & 0xffff) + (y & 0xffff); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xffff) }, bitRotateLeft(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)) }, md5cmn(q, a, b, x, s, t) { return this.safeAdd(this.bitRotateLeft(this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), s), b) }, md5ff(a, b, c, d, x, s, t) { return this.md5cmn((b & c) | (~b & d), a, b, x, s, t) }, md5gg(a, b, c, d, x, s, t) { return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t) }, md5hh(a, b, c, d, x, s, t) { return this.md5cmn(b ^ c ^ d, a, b, x, s, t) }, md5ii(a, b, c, d, x, s, t) { return this.md5cmn(c ^ (b | ~d), a, b, x, s, t) }, binlMD5(x, len) { x[len >> 5] |= 0x80 << (len % 32); x[((len + 64) >>> 9 << 4) + 14] = len; var i; var olda; var oldb; var oldc; var oldd; var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; for (i = 0; i < x.length; i += 16) { olda = a; oldb = b; oldc = c; oldd = d; a = this.md5ff(a, b, c, d, x[i], 7, -680876936); d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586); c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819); b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330); a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897); d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426); c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341); b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983); a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416); d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417); c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063); b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162); a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682); d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101); c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290); b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329); a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510); d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632); c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713); b = this.md5gg(b, c, d, a, x[i], 20, -373897302); a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691); d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083); c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335); b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848); a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438); d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690); c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961); b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501); a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467); d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784); c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473); b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734); a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558); d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463); c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562); b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556); a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060); d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353); c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632); b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640); a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174); d = this.md5hh(d, a, b, c, x[i], 11, -358537222); c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979); b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189); a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487); d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835); c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520); b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651); a = this.md5ii(a, b, c, d, x[i], 6, -198630844); d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415); c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905); b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055); a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571); d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606); c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523); b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799); a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359); d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744); c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380); b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649); a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070); d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379); c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259); b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551); a = this.safeAdd(a, olda); b = this.safeAdd(b, oldb); c = this.safeAdd(c, oldc); d = this.safeAdd(d, oldd) } return [a, b, c, d] }, binl2rstr(input) { var i; var output = ''; var length32 = input.length * 32; for (i = 0; i < length32; i += 8) { output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff) } return output }, rstr2binl(input) { var i; var output = []; output[(input.length >> 2) - 1] = undefined; for (i = 0; i < output.length; i += 1) { output[i] = 0 } var length8 = input.length * 8; for (i = 0; i < length8; i += 8) { output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32) } return output }, rstrMD5(s) { return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8)) }, rstrHMACMD5(key, data) { var i; var bkey = this.rstr2binl(key); var ipad = []; var opad = []; var hash; ipad[15] = opad[15] = undefined; if (bkey.length > 16) { bkey = this.binlMD5(bkey, key.length * 8) } for (i = 0; i < 16; i += 1) { ipad[i] = bkey[i] ^ 0x36363636; opad[i] = bkey[i] ^ 0x5c5c5c5c } hash = this.binlMD5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8); return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128)) }, rstr2hex(input) { var hexTab = '0123456789abcdef'; var output = ''; var x; var i; for (i = 0; i < input.length; i += 1) { x = input.charCodeAt(i); output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f) } return output }, str2rstrUTF8(input) { return unescape(encodeURIComponent(input)) }, rawMD5(s) { return this.rstrMD5(this.str2rstrUTF8(s)) }, hexMD5(s) { return this.rstr2hex(this.rawMD5(s)) }, rawHMACMD5(k, d) { return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d)) }, hexHMACMD5(k, d) { return this.rstr2hex(this.rawHMACMD5(k, d)) }, md5(string, key, raw) { if (!key) { if (!raw) { return this.hexMD5(string) } return this.rawMD5(string) } if (!raw) { return this.hexHMACMD5(key, string) } return this.rawHMACMD5(key, string) }, getSig(requestParam, sk, feature, mode) { var sig = null; var requestArr = []; Object.keys(requestParam).sort().forEach(function (key) { requestArr.push(key + '=' + requestParam[key]) }); if (feature == 'search') { sig = '/ws/place/v1/search?' + requestArr.join('&') + sk } if (feature == 'suggest') { sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk } if (feature == 'reverseGeocoder') { sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk } if (feature == 'geocoder') { sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk } if (feature == 'getCityList') { sig = '/ws/district/v1/list?' + requestArr.join('&') + sk } if (feature == 'getDistrictByCityId') { sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk } if (feature == 'calculateDistance') { sig = '/ws/distance/v1/?' + requestArr.join('&') + sk } if (feature == 'direction') { sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk } sig = this.md5(sig); return sig }, location2query(data) { if (typeof data == 'string') { return data } var query = ''; for (var i = 0; i < data.length; i++) { var d = data[i]; if (!!query) { query += ';' } if (d.location) { query = query + d.location.lat + ',' + d.location.lng } if (d.latitude && d.longitude) { query = query + d.latitude + ',' + d.longitude } } return query }, rad(d) { return d * Math.PI / 180.0 }, getEndLocation(location) { var to = location.split(';'); var endLocation = []; for (var i = 0; i < to.length; i++) { endLocation.push({ lat: parseFloat(to[i].split(',')[0]), lng: parseFloat(to[i].split(',')[1]) }) } return endLocation }, getDistance(latFrom, lngFrom, latTo, lngTo) { var radLatFrom = this.rad(latFrom); var radLatTo = this.rad(latTo); var a = radLatFrom - radLatTo; var b = this.rad(lngFrom) - this.rad(lngTo); var distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2))); distance = distance * EARTH_RADIUS; distance = Math.round(distance * 10000) / 10000; return parseFloat(distance.toFixed(0)) }, getWXLocation(success, fail, complete) { wx.getLocation({ type: 'gcj02', success: success, fail: fail, complete: complete }) }, getLocationParam(location) { if (typeof location == 'string') { var locationArr = location.split(','); if (locationArr.length === 2) { location = { latitude: location.split(',')[0], longitude: location.split(',')[1] } } else { location = {} } } return location }, polyfillParam(param) { param.success = param.success || function () { }; param.fail = param.fail || function () { }; param.complete = param.complete || function () { } }, checkParamKeyEmpty(param, key) { if (!param[key]) { var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key + '参数格式有误'); param.fail(errconf); param.complete(errconf); return true } return false }, checkKeyword(param) { return !this.checkParamKeyEmpty(param, 'keyword') }, checkLocation(param) { var location = this.getLocationParam(param.location); if (!location || !location.latitude || !location.longitude) { var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误'); param.fail(errconf); param.complete(errconf); return false } return true }, buildErrorConfig(errCode, errMsg) { return { status: errCode, message: errMsg } }, handleData(param, data, feature) { if (feature == 'search') { var searchResult = data.data; var searchSimplify = []; for (var i = 0; i < searchResult.length; i++) { searchSimplify.push({ id: searchResult[i].id || null, title: searchResult[i].title || null, latitude: searchResult[i].location && searchResult[i].location.lat || null, longitude: searchResult[i].location && searchResult[i].location.lng || null, address: searchResult[i].address || null, category: searchResult[i].category || null, tel: searchResult[i].tel || null, adcode: searchResult[i].ad_info && searchResult[i].ad_info.adcode || null, city: searchResult[i].ad_info && searchResult[i].ad_info.city || null, district: searchResult[i].ad_info && searchResult[i].ad_info.district || null, province: searchResult[i].ad_info && searchResult[i].ad_info.province || null }) } param.success(data, { searchResult: searchResult, searchSimplify: searchSimplify }) } else if (feature == 'suggest') { var suggestResult = data.data; var suggestSimplify = []; for (var i = 0; i < suggestResult.length; i++) { suggestSimplify.push({ adcode: suggestResult[i].adcode || null, address: suggestResult[i].address || null, category: suggestResult[i].category || null, city: suggestResult[i].city || null, district: suggestResult[i].district || null, id: suggestResult[i].id || null, latitude: suggestResult[i].location && suggestResult[i].location.lat || null, longitude: suggestResult[i].location && suggestResult[i].location.lng || null, province: suggestResult[i].province || null, title: suggestResult[i].title || null, type: suggestResult[i].type || null }) } param.success(data, { suggestResult: suggestResult, suggestSimplify: suggestSimplify }) } else if (feature == 'reverseGeocoder') { var reverseGeocoderResult = data.result; var reverseGeocoderSimplify = { address: reverseGeocoderResult.address || null, latitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lat || null, longitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lng || null, adcode: reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode || null, city: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city || null, district: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district || null, nation: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation || null, province: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province || null, street: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street || null, street_number: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number || null, recommend: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend || null, rough: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough || null }; if (reverseGeocoderResult.pois) { var pois = reverseGeocoderResult.pois; var poisSimplify = []; for (var i = 0; i < pois.length; i++) { poisSimplify.push({ id: pois[i].id || null, title: pois[i].title || null, latitude: pois[i].location && pois[i].location.lat || null, longitude: pois[i].location && pois[i].location.lng || null, address: pois[i].address || null, category: pois[i].category || null, adcode: pois[i].ad_info && pois[i].ad_info.adcode || null, city: pois[i].ad_info && pois[i].ad_info.city || null, district: pois[i].ad_info && pois[i].ad_info.district || null, province: pois[i].ad_info && pois[i].ad_info.province || null }) } param.success(data, { reverseGeocoderResult: reverseGeocoderResult, reverseGeocoderSimplify: reverseGeocoderSimplify, pois: pois, poisSimplify: poisSimplify }) } else { param.success(data, { reverseGeocoderResult: reverseGeocoderResult, reverseGeocoderSimplify: reverseGeocoderSimplify }) } } else if (feature == 'geocoder') { var geocoderResult = data.result; var geocoderSimplify = { title: geocoderResult.title || null, latitude: geocoderResult.location && geocoderResult.location.lat || null, longitude: geocoderResult.location && geocoderResult.location.lng || null, adcode: geocoderResult.ad_info && geocoderResult.ad_info.adcode || null, province: geocoderResult.address_components && geocoderResult.address_components.province || null, city: geocoderResult.address_components && geocoderResult.address_components.city || null, district: geocoderResult.address_components && geocoderResult.address_components.district || null, street: geocoderResult.address_components && geocoderResult.address_components.street || null, street_number: geocoderResult.address_components && geocoderResult.address_components.street_number || null, level: geocoderResult.level || null }; param.success(data, { geocoderResult: geocoderResult, geocoderSimplify: geocoderSimplify }) } else if (feature == 'getCityList') { var provinceResult = data.result[0]; var cityResult = data.result[1]; var districtResult = data.result[2]; param.success(data, { provinceResult: provinceResult, cityResult: cityResult, districtResult: districtResult }) } else if (feature == 'getDistrictByCityId') { var districtByCity = data.result[0]; param.success(data, districtByCity) } else if (feature == 'calculateDistance') { var calculateDistanceResult = data.result.elements; var distance = []; for (var i = 0; i < calculateDistanceResult.length; i++) { distance.push(calculateDistanceResult[i].distance) } param.success(data, { calculateDistanceResult: calculateDistanceResult, distance: distance }) } else if (feature == 'direction') { var direction = data.result.routes; param.success(data, direction) } else { param.success(data) } }, buildWxRequestConfig(param, options, feature) { var that = this; options.header = { "content-type": "application/json" }; options.method = 'GET'; options.success = function (res) { var data = res.data; if (data.status === 0) { that.handleData(param, data, feature) } else { param.fail(data) } }; options.fail = function (res) { res.statusCode = ERROR_CONF.WX_ERR_CODE; param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) }; options.complete = function (res) { var statusCode = +res.statusCode; switch (statusCode) { case ERROR_CONF.WX_ERR_CODE: { param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); break } case ERROR_CONF.WX_OK_CODE: { var data = res.data; if (data.status === 0) { param.complete(data) } else { param.complete(that.buildErrorConfig(data.status, data.message)) } break } default: { param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG)) } } }; return options }, locationProcess(param, locationsuccess, locationfail, locationcomplete) { var that = this; locationfail = locationfail || function (res) { res.statusCode = ERROR_CONF.WX_ERR_CODE; param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) }; locationcomplete = locationcomplete || function (res) { if (res.statusCode == ERROR_CONF.WX_ERR_CODE) { param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) } }; if (!param.location) { that.getWXLocation(locationsuccess, locationfail, locationcomplete) } else if (that.checkLocation(param)) { var location = Utils.getLocationParam(param.location); locationsuccess(location) } } }; class QQMapWX { constructor(options) { if (!options.key) { throw Error('key值不能为空') } this.key = options.key }; search(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (!Utils.checkKeyword(options)) { return } var requestParam = { keyword: options.keyword, orderby: options.orderby || '_distance', page_size: options.page_size || 10, page_index: options.page_index || 1, output: 'json', key: that.key }; if (options.address_format) { requestParam.address_format = options.address_format } if (options.filter) { requestParam.filter = options.filter } var distance = options.distance || "1000"; var auto_extend = options.auto_extend || 1; var region = null; var rectangle = null; if (options.region) { region = options.region } if (options.rectangle) { rectangle = options.rectangle } var locationsuccess = function (result) { if (region && !rectangle) { requestParam.boundary = "region(" + region + "," + auto_extend + "," + result.latitude + "," + result.longitude + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } else if (rectangle && !region) { requestParam.boundary = "rectangle(" + rectangle + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } else { requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SEARCH, data: requestParam }, 'search')) }; Utils.locationProcess(options, locationsuccess) }; getSuggestion(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (!Utils.checkKeyword(options)) { return } var requestParam = { keyword: options.keyword, region: options.region || '全国', region_fix: options.region_fix || 0, policy: options.policy || 0, page_size: options.page_size || 10, page_index: options.page_index || 1, get_subpois: options.get_subpois || 0, output: 'json', key: that.key }; if (options.address_format) { requestParam.address_format = options.address_format } if (options.filter) { requestParam.filter = options.filter } if (options.location) { var locationsuccess = function (result) { requestParam.location = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, "suggest")) }; Utils.locationProcess(options, locationsuccess) } else { if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, "suggest")) } }; reverseGeocoder(options) { var that = this; options = options || {}; Utils.polyfillParam(options); var requestParam = { coord_type: options.coord_type || 5, get_poi: options.get_poi || 0, output: 'json', key: that.key }; if (options.poi_options) { requestParam.poi_options = options.poi_options } var locationsuccess = function (result) { requestParam.location = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_GET_GEOCODER, data: requestParam }, 'reverseGeocoder')) }; Utils.locationProcess(options, locationsuccess) }; geocoder(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'address')) { return } var requestParam = { address: options.address, output: 'json', key: that.key }; if (options.region) { requestParam.region = options.region } if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_GET_GEOCODER, data: requestParam }, 'geocoder')) }; getCityList(options) { var that = this; options = options || {}; Utils.polyfillParam(options); var requestParam = { output: 'json', key: that.key }; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_CITY_LIST, data: requestParam }, 'getCityList')) }; getDistrictByCityId(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'id')) { return } var requestParam = { id: options.id || '', output: 'json', key: that.key }; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_AREA_LIST, data: requestParam }, 'getDistrictByCityId')) }; calculateDistance(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'to')) { return } var requestParam = { mode: options.mode || 'walking', to: Utils.location2query(options.to), output: 'json', key: that.key }; if (options.from) { options.location = options.from } if (requestParam.mode == 'straight') { var locationsuccess = function (result) { var locationTo = Utils.getEndLocation(requestParam.to); var data = { message: "query ok", result: { elements: [] }, status: 0 }; for (var i = 0; i < locationTo.length; i++) { data.result.elements.push({ distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng), duration: 0, from: { lat: result.latitude, lng: result.longitude }, to: { lat: locationTo[i].lat, lng: locationTo[i].lng } }) } var calculateResult = data.result.elements; var distanceResult = []; for (var i = 0; i < calculateResult.length; i++) { distanceResult.push(calculateResult[i].distance) } return options.success(data, { calculateResult: calculateResult, distanceResult: distanceResult }) }; Utils.locationProcess(options, locationsuccess) } else { var locationsuccess = function (result) { requestParam.from = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_DISTANCE, data: requestParam }, 'calculateDistance')) }; Utils.locationProcess(options, locationsuccess) } }; direction(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'to')) { return } var requestParam = { output: 'json', key: that.key }; if (typeof options.to == 'string') { requestParam.to = options.to } else { requestParam.to = options.to.latitude + ',' + options.to.longitude } var SET_URL_DIRECTION = null; options.mode = options.mode || MODE.driving; SET_URL_DIRECTION = URL_DIRECTION + options.mode; if (options.from) { options.location = options.from } if (options.mode == MODE.driving) { if (options.from_poi) { requestParam.from_poi = options.from_poi } if (options.heading) { requestParam.heading = options.heading } if (options.speed) { requestParam.speed = options.speed } if (options.accuracy) { requestParam.accuracy = options.accuracy } if (options.road_type) { requestParam.road_type = options.road_type } if (options.to_poi) { requestParam.to_poi = options.to_poi } if (options.from_track) { requestParam.from_track = options.from_track } if (options.waypoints) { requestParam.waypoints = options.waypoints } if (options.policy) { requestParam.policy = options.policy } if (options.plate_number) { requestParam.plate_number = options.plate_number } } if (options.mode == MODE.transit) { if (options.departure_time) { requestParam.departure_time = options.departure_time } if (options.policy) { requestParam.policy = options.policy } } var locationsuccess = function (result) { requestParam.from = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction', options.mode) } wx.request(Utils.buildWxRequestConfig(options, { url: SET_URL_DIRECTION, data: requestParam }, 'direction')) }; Utils.locationProcess(options, locationsuccess) } }; module.exports = QQMapWX;
\ No newline at end of file
diff --git a/main.js b/main.js
index 96732c3..a92fe40 100644
--- a/main.js
+++ b/main.js
@@ -5,7 +5,8 @@ import store from './store'
import '@/static/js/request.js'
import '@/static/js/CommonFunction.js'
import {myMixins} from '@/mixins/myMixins.js'
-
+import main from "@/common/index.js"
+Vue.prototype.$main = main
Vue.mixin(myMixins)
Vue.config.productionTip = false
diff --git a/manifest.json b/manifest.json
index fd77f6a..61f440a 100644
--- a/manifest.json
+++ b/manifest.json
@@ -57,7 +57,14 @@
"postcss" : true,
"minified" : true
},
- "usingComponents" : true
+ "usingComponents" : true,
+ "permission" : {
+ "scope.userLocation" : {
+ "desc" : "为了提供更好更快速的体验,需要获取您的当前位置"
+ }
+ },
+ "lazyCodeLoading" : "requiredComponents",
+ "requiredPrivateInfos" : [ "getLocation", "chooseLocation" ]
},
"mp-alipay" : {
"usingComponents" : true
diff --git a/pages.json b/pages.json
index fd3b88b..7e24a4c 100644
--- a/pages.json
+++ b/pages.json
@@ -49,6 +49,22 @@
"navigationBarTitleText": "时间银行",
"navigationStyle": "custom"
}
+ },
+ {
+ "path": "pages/notes/detail",
+ "style": {
+ "navigationBarTitleText": "笔记详情",
+ "navigationBarBackgroundColor": "#ffffff",
+ "navigationBarTextStyle": "black"
+ }
+ },
+ {
+ "path": "pages/notes/publish",
+ "style": {
+ "navigationBarTitleText": "发布笔记",
+ "navigationBarBackgroundColor": "#ffffff",
+ "navigationBarTextStyle": "black"
+ }
}
],
"subPackages": [
@@ -214,6 +230,22 @@
"style": {
"navigationBarTitleText": "确认订单"
}
+ },
+ {
+ "path": "memorialAlbum/index",
+ "style": {
+ "navigationBarTitleText": "数字资产纪念册",
+ "navigationBarBackgroundColor": "#ffffff",
+ "navigationBarTextStyle": "black"
+ }
+ },
+ {
+ "path": "memorialAlbum/detail",
+ "style": {
+ "navigationBarTitleText": "藏品详情",
+ "navigationBarBackgroundColor": "#ffffff",
+ "navigationBarTextStyle": "black"
+ }
}
]
},
diff --git a/pages/index/iSoul.vue b/pages/index/iSoul.vue
index fc84f67..50c3a76 100644
--- a/pages/index/iSoul.vue
+++ b/pages/index/iSoul.vue
@@ -29,8 +29,8 @@
>
- {{ userInfo.nickname || "用户" }}
- ID:{{ userInfo.redBookId || "123456" }}
+ {{ userInfo.nickname || "去登录" }}
+ ID:{{ userInfo.redBookId || "123456" }}
-
- {{ userStats.following || "140" }}
- 关注
-
-
- {{ userStats.followers || "2462" }}
- 粉丝
+
+
+ {{ userStats.following || "140" }}
+ 关注
+
+
+ {{ userStats.followers || "2462" }}
+ 粉丝
+
+
+ {{ userStats.likes || "5.4万" }}
+ 获赞与收藏
+
-
- {{ userStats.likes || "5.4万" }}
- 获赞与收藏
+
+
+ 🎁
+ 权益兑换
@@ -222,6 +229,33 @@
+
+
+
+
+
@@ -284,6 +318,7 @@ export default {
icon: "💬",
},
],
+ exchangeCode: "", // 兑换码
};
},
onLoad() {
@@ -427,16 +462,90 @@ export default {
},
// 纪念册卡片点击
handleMemorialClick(index) {
- if (index === 0) {
- uni.navigateTo({
- url: "/subPackages/readingBody/index",
+ // 点击任何纪念册卡片都跳转到数字资产纪念册页面
+ uni.navigateTo({
+ url: "/subPackages/memorialAlbum/index",
+ });
+ },
+
+ // 显示权益兑换弹窗
+ showExchangePopup() {
+ this.exchangeCode = ""; // 清空输入框
+ this.$refs.exchangePopup.open();
+ },
+
+ // 关闭权益兑换弹窗
+ closeExchangePopup() {
+ this.$refs.exchangePopup.close();
+ },
+
+ // 确认兑换
+ async confirmExchange() {
+ if (!this.exchangeCode.trim()) {
+ uni.showToast({
+ title: "请输入兑换码",
+ icon: "none",
});
- } else {
- uni.navigateTo({
- url: "/subPackages/video/video",
+ return;
+ }
+
+ // 显示加载
+ uni.showLoading({
+ title: "兑换中...",
+ });
+
+ try {
+ // 调用兑换API
+ const result = await this.exchangeEquity(this.exchangeCode);
+
+ uni.hideLoading();
+
+ if (result.success) {
+ uni.showToast({
+ title: "兑换成功!",
+ icon: "success",
+ });
+ this.closeExchangePopup();
+ } else {
+ uni.showToast({
+ title: result.message || "兑换失败",
+ icon: "none",
+ });
+ }
+ } catch (error) {
+ uni.hideLoading();
+ uni.showToast({
+ title: "兑换失败,请稍后重试",
+ icon: "none",
});
}
},
+
+ // API - 兑换权益
+ async exchangeEquity(code) {
+ // 模拟API调用
+ return new Promise((resolve) => {
+ setTimeout(() => {
+ // 模拟不同的兑换结果
+ if (code === "EPIC2024") {
+ resolve({
+ success: true,
+ message: "兑换成功!获得数字藏品一枚",
+ });
+ } else if (code === "TEST123") {
+ resolve({
+ success: true,
+ message: "兑换成功!获得优惠券一张",
+ });
+ } else {
+ resolve({
+ success: false,
+ message: "兑换码无效或已使用",
+ });
+ }
+ }, 1500);
+ });
+ },
},
};
@@ -571,13 +680,21 @@ view {
/* 统计数据 */
.stats-section {
display: flex;
- justify-content: space-around;
+ justify-content: space-between;
+ align-items: center;
margin-top: 80rpx;
padding-bottom: 50rpx;
+ padding: 0 40rpx;
+}
+
+.stats-left {
+ display: flex;
+ gap: 60rpx;
}
.stat-item {
text-align: center;
+ min-width: 80rpx;
}
.stat-number {
@@ -592,6 +709,34 @@ view {
color: rgba(255, 255, 255, 0.8);
}
+/* 权益兑换入口 */
+.exchange-entry {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ padding: 16rpx;
+ background: rgba(255, 255, 255, 0.1);
+ border-radius: 20rpx;
+ min-width: 120rpx;
+ transition: all 0.3s ease;
+
+ &:active {
+ transform: scale(0.95);
+ background: rgba(255, 255, 255, 0.2);
+ }
+}
+
+.exchange-icon {
+ font-size: 32rpx;
+ margin-bottom: 8rpx;
+}
+
+.exchange-text {
+ font-size: 22rpx;
+ color: rgba(255, 255, 255, 0.9);
+ font-weight: 500;
+}
+
/* 操作按钮 */
.action-buttons {
display: flex;
@@ -893,7 +1038,12 @@ view {
border-bottom: none;
}
+// 用户顶部背景区域
.user-top {
+ background-size: cover;
+ background-position: center;
+ background-repeat: no-repeat;
+ padding-bottom: 20rpx;
}
.digital-img {
@@ -901,4 +1051,96 @@ view {
width: 100%;
border-radius: 20rpx;
}
+
+/* 权益兑换弹窗 */
+.exchange-popup {
+ width: 600rpx;
+ background-color: #ffffff;
+ border-radius: 16rpx;
+ overflow: hidden;
+}
+
+.popup-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 30rpx;
+ border-bottom: 1px solid #f0f0f0;
+}
+
+.popup-title {
+ font-size: 32rpx;
+ font-weight: 600;
+ color: #333;
+}
+
+.popup-close {
+ font-size: 40rpx;
+ color: #999;
+ padding: 0 10rpx;
+}
+
+.popup-content {
+ padding: 40rpx 30rpx 30rpx;
+}
+
+.input-section {
+ margin-bottom: 40rpx;
+}
+
+.input-label {
+ display: block;
+ font-size: 28rpx;
+ color: #333;
+ margin-bottom: 20rpx;
+ font-weight: 500;
+}
+
+.exchange-input {
+ width: 100%;
+ height: 88rpx;
+ border: 2rpx solid #e0e0e0;
+ border-radius: 12rpx;
+ padding: 0 20rpx;
+ font-size: 28rpx;
+ color: #333;
+ box-sizing: border-box;
+
+ &:focus {
+ border-color: #667eea;
+ }
+}
+
+.popup-actions {
+ display: flex;
+ gap: 20rpx;
+}
+
+.cancel-btn,
+.confirm-btn {
+ flex: 1;
+ height: 80rpx;
+ border-radius: 12rpx;
+ font-size: 28rpx;
+ font-weight: 600;
+ border: none;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ transition: all 0.3s ease;
+
+ &:active {
+ transform: scale(0.98);
+ }
+}
+
+.cancel-btn {
+ background: #f5f5f5;
+ color: #666;
+}
+
+.confirm-btn {
+ background: #667eea;
+ color: #ffffff;
+}
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 59b4995..7fc3b79 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -1,6 +1,6 @@
-
+
@@ -86,11 +86,11 @@ export default {
],
productListFeeling: [
{
- id: 32,
+ id: 34,
image:
"https://epic.js-dyyj.com/uploads/20250728/22e319f3feb1b63fbb539d425c51fe70.png",
title: "OUT OF SPACE 东方线香",
- price: "588.00",
+ price: "138.00",
isLiked: true,
isShop:true
},
@@ -103,11 +103,17 @@ export default {
isLiked: false,
},
],
+ selectedLocation:''
};
},
onLoad() {},
- onReady() {
+ async onReady() {
+ let res =await this.$main.getLocationInfo()
+ console.log(res)
+ this.selectedLocation = res&&res.city
+ uni.setStorageSync('SYS_ADDRESS_INFO',JSON.stringify(res))
this.getList();
+
},
onShow() {
this.browse_record({ type: "page", title: "首页" });
diff --git a/pages/index/timeShopBank.vue b/pages/index/timeShopBank.vue
index 6f217aa..9127a06 100644
--- a/pages/index/timeShopBank.vue
+++ b/pages/index/timeShopBank.vue
@@ -5,12 +5,12 @@
-
+
-
-
+
+
+
+
+
+
diff --git a/pages/notes/detail.vue b/pages/notes/detail.vue
new file mode 100644
index 0000000..abc42c3
--- /dev/null
+++ b/pages/notes/detail.vue
@@ -0,0 +1,631 @@
+
+
+
+
+
+
+
+
+ {{ noteDetail.user.name }}
+ {{
+ formatTime(noteDetail.createTime)
+ }}
+
+
+
+
+
+
+ {{ noteDetail.title }}
+
+
+
+
+
+
+
+
+
+ {{ noteDetail.content }}
+
+
+
+
+
+ #{{ tag }}
+
+
+
+
+
+
+ ♥
+ {{ noteDetail.likes }}
+
+
+ ★
+ {{ noteDetail.collects }}
+
+
+ ↗
+ 分享
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/notes/publish.vue b/pages/notes/publish.vue
new file mode 100644
index 0000000..24c0223
--- /dev/null
+++ b/pages/notes/publish.vue
@@ -0,0 +1,445 @@
+
+
+
+
+
+
+
+
+
+
+
+ ×
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #{{ tag }}
+
+
+
+
+
+
+
+
+ #{{ tag }}
+ ×
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/subPackages/equityGoods/detail.vue b/subPackages/equityGoods/detail.vue
index 339d418..1ca1150 100644
--- a/subPackages/equityGoods/detail.vue
+++ b/subPackages/equityGoods/detail.vue
@@ -1,53 +1,71 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ swiperIndex + 1 }}/{{ topBanner.length }}
-
-
-
-
-
-
-
- 食在苏州|世界美食之都巡礼
-
- 限量
- 1000份
- 剩余 900份
-
-
-
-
-
-
- ¥
- 699.00
-
-
-
- 1700收藏
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ swiperIndex + 1 }}/{{ topBanner.length }}
+
+
+
+
+
+
+
+ 食在苏州|世界美食之都巡礼
+
+ 限量
+ 1000份
+ 剩余 900份
+
+
+
+
+
+
+ ¥
+ 699.00
+
+
+
+ 1700收藏
+
+
+
+
+
-
-
+
+
-
-
-
-
- {{ item.label }}
- {{ item.content }}
-
-
-
+ -->
+
+
+
+
+
+
+ {{ item.label }}
+ {{ item.content }}
+
+
+
-
-
- {{ tab.name }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ {{ tab.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
- 立即购买
-
-
-
+ "
+ style="width: 100%"
+ mode="widthFix"
+ >
+
+
+
+
+
+
+
+
+
+
+
+ 立即购买
+
+
+
\ No newline at end of file
+.detail-container {
+ background: #f5f5f5;
+ min-height: 100vh;
+}
+
+.banner-content {
+ width: 100%;
+ height: 700rpx;
+ position: relative;
+
+ .top-banner {
+ width: 100%;
+ height: 100%;
+ }
+
+ .dot-container {
+ position: absolute;
+ bottom: 43rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 100%;
+ left: 0;
+
+ .dot-line {
+ width: 52rpx;
+ height: 4rpx;
+ margin: 0 8rpx;
+ background: RGBA(189, 170, 173, 0.8);
+
+ &.active {
+ background: #94fafa;
+ }
+ }
+ }
+
+ .page-indicator {
+ position: absolute;
+ bottom: 20rpx;
+ right: 20rpx;
+ // background: rgba(0, 0, 0, 0.5);
+ border-radius: 10rpx;
+ padding: 10rpx 20rpx;
+
+ .page-text {
+ font-size: 24rpx;
+ color: #fff;
+ font-weight: 500;
+ }
+ }
+}
+
+.product-info {
+ background: white;
+ padding: 40rpx 30rpx;
+ margin: 20rpx;
+ border-radius: 20rpx 20rpx 0 0;
+ padding-bottom: 20rpx;
+
+ .title-section {
+ margin-bottom: 30rpx;
+
+ .product-title {
+ font-size: 31rpx;
+ font-weight: bold;
+ color: #000000;
+ line-height: 1.4;
+ margin-bottom: 20rpx;
+ }
+
+ .tags-container {
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+
+ .limit-tag {
+ background: #94fafa;
+ color: #333333;
+ padding: 8rpx 16rpx;
+ font-size: 20rpx;
+ border-radius: 6rpx 0 0 6rpx;
+ }
+
+ .limit-count {
+ background: #f0f0f0;
+ color: #000000;
+ padding: 8rpx 16rpx;
+ font-size: 20rpx;
+ border-radius: 0rpx 6rpx 6rpx 0;
+ }
+
+ .remaining {
+ color: #808080;
+ font-size: 22rpx;
+ margin-left: auto;
+ }
+ }
+ }
+
+ .price-section {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 20rpx;
+
+ .price-container {
+ display: flex;
+ align-items: baseline;
+
+ .currency {
+ font-size: 28rpx;
+ color: #333;
+ font-weight: bold;
+ }
+
+ .price {
+ font-size: 40rpx;
+ color: #333;
+ font-weight: bold;
+ font-family: "Futura";
+ }
+ }
+
+ .collect-container {
+ display: flex;
+ align-items: center;
+ gap: 10rpx;
+
+ .heart-icon {
+ width: 35rpx;
+ height: 29rpx;
+ transition: all 0.3s ease;
+ flex-shrink: 0;
+
+ &.liked {
+ opacity: 1;
+ filter: hue-rotate(320deg) saturate(2);
+ }
+
+ &:active {
+ transform: scale(1.2);
+ }
+ }
+
+ .collect-count {
+ color: #231815;
+ font-size: 28rpx;
+ font-weight: 500;
+ }
+ }
+ }
+
+ .equity-section {
+ margin-bottom: 40rpx;
+ border-top: 0.5rpx solid #e5e5e5;
+ border-bottom: 0.5rpx solid #e5e5e5;
+ padding: 40rpx 0;
+
+ .equity-row {
+ display: flex;
+ justify-content: space-between;
+ gap: 20rpx;
+
+ .equity-item {
+ text-align: left;
+
+ .equity-label {
+ font-size: 23rpx;
+ color: #231815;
+ font-weight: bold;
+ margin-bottom: 10rpx;
+ line-height: 1.3;
+ }
+
+ .equity-value {
+ font-size: 20rpx;
+ color: #595757;
+ font-weight: 500;
+ line-height: 1.3;
+ }
+ }
+ }
+ }
+
+ .equity-title {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin: 40rpx 0 30rpx;
+
+ .title-line {
+ width: 30rpx;
+ height: 2rpx;
+ background: #94fafa;
+ }
+
+ .title-text {
+ padding: 0 30rpx;
+ font-size: 25rpx;
+ color: #94fafa;
+ font-weight: bold;
+ }
+ }
+
+ .equity-details {
+ border-top: 1rpx solid #e5e5e5;
+ padding-top: 60rpx;
+ padding-bottom: 20rpx;
+ .equity-detail-item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 10rpx;
+ line-height: 1.5;
+
+ .detail-content-wrapper {
+ display: flex;
+ flex: 1;
+
+ .detail-label {
+ font-size: 26rpx;
+ color: #808080;
+ font-weight: 500;
+ }
+
+ .detail-content {
+ font-size: 26rpx;
+ color: #808080;
+ flex: 1;
+ font-weight: 500;
+ }
+ }
+
+ .toggle-icon {
+ display: flex;
+ align-items: center;
+ gap: 8rpx;
+ cursor: pointer;
+ padding: 0rpx;
+ margin-left: 20rpx;
+
+ .icon-text {
+ font-size: 22rpx;
+ color: #666;
+ }
+
+ .icon-arrow {
+ font-size: 20rpx;
+ color: #666;
+ transition: transform 0.3s ease;
+ transform: rotate(0deg);
+
+ &.expanded {
+ transform: rotate(180deg);
+ }
+ }
+
+ &:active {
+ opacity: 0.7;
+ }
+ }
+ }
+ }
+}
+
+// Tab导航
+.tab-nav {
+ margin: 0 40rpx;
+ margin-top: 40rpx;
+ display: flex;
+ justify-content: space-between;
+
+ .tab-item {
+ padding: 10rpx 20rpx;
+ text-align: center;
+ color: #3e3a39;
+ cursor: pointer;
+ transition: all 0.3s ease;
+ background-color: #94fafa66;
+ display: flex;
+ align-items: center;
+ &.active {
+ background-color: #94fafa;
+ color: #525454;
+ font-size: 24rpx;
+ border-radius: 10rpx 10rpx 0 0;
+ font-weight: bold;
+ }
+
+ .tab-text {
+ font-size: 24rpx;
+ }
+ }
+}
+
+// Tab切换区域
+.tab-section {
+ margin: 0 20rpx;
+ background-color: #fff;
+ border-radius: 20rpx;
+ overflow: hidden;
+ margin-bottom: calc(20px + constant(safe-area-inset-bottom));
+ margin-bottom: calc(20px + env(safe-area-inset-bottom));
+
+ // Tab内容
+ .tab-content {
+ padding: 30rpx;
+
+ .tab-panel {
+ min-height: 400rpx;
+
+ // 证书容器
+ .certificate-container {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+ .certificate-image {
+ width: 100%;
+ max-width: 600rpx;
+ height: auto;
+ border-radius: 12rpx;
+ }
+ }
+
+ // 信息内容
+ .info-content {
+ padding: 20rpx 0;
+
+ .info-item {
+ display: flex;
+ margin-bottom: 20rpx;
+ align-items: flex-start;
+
+ .info-label {
+ font-size: 28rpx;
+ color: #666;
+ min-width: 160rpx;
+ flex-shrink: 0;
+ }
+
+ .info-value {
+ font-size: 28rpx;
+ color: #333;
+ flex: 1;
+ line-height: 1.5;
+ }
+ }
+ }
+
+ // 权益信息内容
+ .equity-info-content {
+ padding: 20rpx 0;
+
+ .equity-info-item {
+ display: flex;
+ margin-bottom: 20rpx;
+ align-items: flex-start;
+
+ .equity-info-label {
+ font-size: 28rpx;
+ color: #666;
+ min-width: 160rpx;
+ flex-shrink: 0;
+ }
+
+ .equity-info-value {
+ font-size: 28rpx;
+ color: #333;
+ flex: 1;
+ line-height: 1.5;
+ }
+ }
+
+ .equity-description {
+ margin-top: 30rpx;
+ padding: 20rpx;
+ background-color: #f8f9fa;
+ border-radius: 12rpx;
+
+ .description-text {
+ font-size: 26rpx;
+ color: #666;
+ line-height: 1.6;
+ }
+ }
+ }
+ }
+ }
+}
+
+// 立即购买按钮
+.purchase-section {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ background: white;
+ padding: 20rpx 30rpx 40rpx;
+ border-top: 1rpx solid #e5e5e5;
+ z-index: 100;
+ padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx);
+ padding-bottom: calc(constant(safe-area-inset-bottom) + 20rpx);
+
+ .purchase-button {
+ width: 100%;
+ height: 88rpx;
+ background: #94fafa;
+ border-radius: 44rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-shadow: 0 8rpx 20rpx #94fafa;
+ transition: all 0.3s ease;
+
+ &:active {
+ transform: scale(0.98);
+ box-shadow: 0 4rpx 10rpx rgba(255, 30, 85, 0.2);
+ }
+
+ .purchase-text {
+ font-size: 32rpx;
+ font-weight: bold;
+ color: #525454;
+ }
+ }
+}
+
+// 为底部按钮预留空间
+.detail-container {
+ padding-bottom: 140rpx;
+}
+
diff --git a/subPackages/equityGoods/list.vue b/subPackages/equityGoods/list.vue
index 3ae87d5..2f7d07b 100644
--- a/subPackages/equityGoods/list.vue
+++ b/subPackages/equityGoods/list.vue
@@ -1,372 +1,650 @@
-
-
-
- 扬州
-
-
-
-
-
-
-
-
-
-
- {{ item.title }}
-
- {{ item.price }}
-
-
-
-
+
+
+
+
+
+
+
+ {{ item.title }}
+
+ {{ item.price }}
+
+
+
+
-
-
-
-
-
-
- {{ item.limitInfo }}
- {{ item.paymentInfo }}
- {{ item.viewInfo }}
-
-
-
-
-
-
-
- 业务办理 | 预约参观
-
-
-
-
-
-
- 国家文化大数据华东区域交易平台扬州运营中心
-
-
-
-
+
+
+
+ {{ item.limitInfo }}
+ {{ item.paymentInfo }}
+ {{ item.viewInfo }}
+
+
+
+
+
+
+
+ 业务办理 | 预约参观
+
+
+
+
+
+
+ 国家文化大数据华东区域交易平台扬州运营中心
+
+
+
+
+
+
+
+
+
\ No newline at end of file
+.equity-goods-page {
+ min-height: 100vh;
+ background: #f5f5f5;
+ padding-bottom: 40rpx;
+}
+
+.header-section {
+ padding: 60rpx 30rpx 30rpx;
+
+ .title {
+ font-size: 36rpx;
+ color: #000000;
+ text-align: center;
+ margin-bottom: 30rpx;
+ padding-bottom: 30rpx;
+ font-weight: 500;
+ border-bottom: 0.5rpx solid #999999;
+ }
+
+ .filter-buttons {
+ display: flex;
+ justify-content: space-between;
+ gap: 40rpx;
+
+ .filter-btn {
+ font-size: 28rpx;
+ color: #000000;
+ border-radius: 20rpx;
+ transition: all 0.3s;
+
+ &.active {
+ background: #007aff;
+ color: white;
+ }
+ }
+ }
+}
+
+.products-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 20rpx;
+ padding: 30rpx;
+
+ .product-item {
+ overflow: hidden;
+ border-bottom: 0.5rpx solid #999999;
+ margin-bottom: 15rpx;
+ padding-bottom: 20rpx;
+ &:active {
+ transform: scale(0.98);
+ }
+
+ .product-image {
+ width: 100%;
+ height: 429rpx;
+ object-fit: cover;
+ border-radius: 20rpx;
+ }
+
+ .product-info {
+ padding: 20rpx 0;
+
+ .product-title {
+ font-size: 22rpx;
+ color: #000000;
+ margin-bottom: 16rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-weight: 500;
+ }
+
+ .product-price {
+ font-size: 36rpx;
+ font-weight: 500;
+ color: #000000;
+ }
+
+ .product-details {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+
+ .detail-item {
+ font-size: 16rpx;
+ color: #808080;
+ }
+ }
+ }
+ }
+}
+
+.map-section {
+ border-top: 0.5rpx solid #999999;
+ margin: 30rpx 30rpx 0;
+ overflow: hidden;
+
+ .map-title {
+ padding: 30rpx;
+ font-size: 22rpx;
+ font-weight: 500;
+ color: #000000;
+ text-align: center;
+ }
+
+ .map-container {
+ position: relative;
+ height: 330rpx;
+ border: 6rpx solid white;
+ border-radius: 20rpx;
+ transform: translateY(0);
+ overflow: hidden;
+ .map-component {
+ width: 100%;
+ height: 100%;
+ border-radius: 20rpx;
+ }
+ }
+
+ .map-description {
+ padding: 30rpx;
+
+ .location-info {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 16rpx;
+
+ .location-icon {
+ width: 40rpx;
+ }
+
+ .location-name {
+ font-size: 22rpx;
+ color: #808080;
+ }
+ }
+ }
+}
+
+.heart-icon {
+ width: 35rpx;
+ height: 30rpx;
+ transition: all 0.3s ease;
+ flex-shrink: 0;
+ top: -2rpx;
+ position: relative;
+ margin-right: 6rpx;
+
+ &.liked {
+ opacity: 1;
+ filter: hue-rotate(320deg) saturate(2);
+ }
+
+ &:active {
+ transform: scale(1.2);
+ }
+}
+
+.shop-icon {
+ width: 39rpx;
+ height: 36rpx;
+ transition: all 0.3s ease;
+ flex-shrink: 0;
+ margin-left: 10rpx;
+
+ &.liked {
+ opacity: 1;
+ filter: hue-rotate(320deg) saturate(2);
+ }
+
+ &:active {
+ transform: scale(1.2);
+ }
+}
+
+.product-price-box {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 10rpx;
+}
+.location-selector {
+ position: absolute;
+ top: 20rpx;
+ left: 20rpx;
+ display: flex;
+ align-items: center;
+ padding: 8rpx 16rpx;
+ // border: 2rpx solid #e0e0e0;
+ border-radius: 20rpx;
+ min-width: 100rpx;
+ margin-right: 20rpx;
+
+ .location-text {
+ font-size: 30rpx;
+ color: white;
+ margin-right: 8rpx;
+ }
+
+ .dropdown-icon {
+ width: 24rpx;
+ height: 16rpx;
+ }
+}
+
+// 预约弹窗样式
+.reservation-popup {
+ width: 600rpx;
+ background: white;
+ border-radius: 24rpx;
+ overflow: hidden;
+
+ .popup-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 32rpx 32rpx 24rpx;
+ border-bottom: 1rpx solid #f0f0f0;
+
+ .popup-title {
+ font-size: 32rpx;
+ font-weight: 600;
+ color: #333;
+ }
+
+ .popup-close {
+ font-size: 40rpx;
+ color: #999;
+ line-height: 1;
+ padding: 8rpx;
+ cursor: pointer;
+ transition: color 0.3s;
+
+ &:active {
+ color: #666;
+ }
+ }
+ }
+
+ .popup-content {
+ padding: 32rpx;
+
+ .input-section {
+ margin-bottom: 32rpx;
+
+ .input-label {
+ display: block;
+ font-size: 28rpx;
+ color: #333;
+ margin-bottom: 16rpx;
+ font-weight: 500;
+ }
+
+ .reservation-input {
+ width: 100%;
+ height: 88rpx;
+ border: 2rpx solid #e0e0e0;
+ border-radius: 12rpx;
+ padding: 0 24rpx;
+ font-size: 28rpx;
+ color: #333;
+ background: #fafafa;
+ transition: all 0.3s;
+ box-sizing: border-box;
+
+ &:focus {
+ border-color: #007aff;
+ background: white;
+ }
+
+ &::placeholder {
+ color: #999;
+ }
+ }
+ }
+
+ .popup-actions {
+ display: flex;
+ gap: 24rpx;
+ margin-top: 40rpx;
+
+ .cancel-btn,
+ .confirm-btn {
+ flex: 1;
+ height: 74rpx;
+ border-radius: 12rpx;
+ font-size: 28rpx;
+ font-weight: 600;
+ border: none;
+ transition: all 0.3s;
+
+ &:active {
+ transform: scale(0.98);
+ }
+ }
+
+ .cancel-btn {
+ background: #f5f5f5;
+ color: #666;
+
+ &:active {
+ background: #e8e8e8;
+ }
+ }
+
+ .confirm-btn {
+ background: #007aff;
+ color: white;
+
+ &:active {
+ background: #0056cc;
+ }
+ }
+ }
+ }
+}
+
+// 地图标题点击样式
+.map-title {
+ cursor: pointer;
+ transition: all 0.3s;
+}
+
diff --git a/subPackages/memorialAlbum/detail.vue b/subPackages/memorialAlbum/detail.vue
new file mode 100644
index 0000000..e04d196
--- /dev/null
+++ b/subPackages/memorialAlbum/detail.vue
@@ -0,0 +1,339 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 发行数量:
+ {{ detailInfo.totalSupply }}份
+
+
+
+
+
+ 数字资产所有方:
+ {{ detailInfo.owner }}
+
+
+
+ 数字资产权利方:
+ {{ detailInfo.rightHolder }}
+
+
+
+ 数字资产所有方:
+ {{ detailInfo.assetOwner }}
+
+
+
+
+
+
+ 收藏者
+ {{ detailInfo.collector }}
+ 编号
+ {{ detailInfo.collectionCode }}
+ 收藏时间
+ {{ detailInfo.collectionTime }}
+
+
+
+
+
+
+
+
+
+ 权证码
+ {{ detailInfo.certificateCode }}
+
+
+
+ 合约地址
+ {{ detailInfo.contractAddress }}
+
+
+
+ 交易HASH
+ {{ detailInfo.transactionHash }}
+
+
+
+ 钱包地址
+ {{ detailInfo.walletAddress }}
+
+
+
+
+
+
+
+
+ {{ detailInfo.description }}
+
+
+
+
+
+
+
+
diff --git a/subPackages/memorialAlbum/index.vue b/subPackages/memorialAlbum/index.vue
new file mode 100644
index 0000000..af4cb92
--- /dev/null
+++ b/subPackages/memorialAlbum/index.vue
@@ -0,0 +1,219 @@
+
+
+
+
+
+
+
+
+ {{ item.title }}
+ {{ item.code }}
+ {{ item.status }}
+
+
+
+
+
+
+
+
+
+
diff --git a/subPackages/orderQy/confrim.vue b/subPackages/orderQy/confrim.vue
index e69de29..a56336c 100644
--- a/subPackages/orderQy/confrim.vue
+++ b/subPackages/orderQy/confrim.vue
@@ -0,0 +1,772 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 请选择收货地址
+ 点击添加收货地址信息
+
+
+
+
+
+
+
+
+
+ 预约日期
+ *
+
+
+
+
+
+ {{ selectedDate || "请选择预约日期" }}
+
+
+
+
+
+
+
+
+
+
+ IP资产供应商:{{ supplier || "苏州XXX博物馆" }}
+
+
+
+
+ {{
+ goodsInfo.name || "食在苏州 | 世界美食之都巡礼+实物探真"
+ }}
+ {{
+ goodsInfo.desc || "商品规格信息描述"
+ }}
+ ¥{{ goodsInfo.price || "699.00" }}
+
+
+
+
+
+
+
+
+
+
+ 备注
+
+
+
+
+
+
+
+
+
+ 商品金额
+ ¥{{ goodsInfo.price || "699.00" }}
+
+
+ 运费
+ {{ shipping || "预约发货时计算" }}
+
+
+ 优惠券
+ {{ coupon || "无可用 >" }}
+
+
+
+
+
+
+
+
+
+ ¥{{ totalAmount || "699.00" }}
+
+
+
+
+
+
+
+
+
+
diff --git a/subPackages/orderQy/detail.vue b/subPackages/orderQy/detail.vue
index 1453ec4..0c92641 100644
--- a/subPackages/orderQy/detail.vue
+++ b/subPackages/orderQy/detail.vue
@@ -1,143 +1,151 @@
-
-
-
-
-
-
- {{ getStatusText(orderDetail.status) }}
- {{ getStatusDesc(orderDetail.status) }}
+
+
-
-
- 订单信息
-
- 订单号:
- {{ orderDetail.orderNo }}
- 复制
+
+
+ 收货地址:
+
+
+ {{
+ orderDetail.address.fullAddress
+ }}
+
+ {{ orderDetail.address.name }}
+ {{ orderDetail.address.phone }}
+
+
-
- 下单时间:
- {{ formatTime(orderDetail.createTime) }}
+
+ 该订单无需收货地址
-
- 付款时间:
- {{ formatTime(orderDetail.payTime) }}
+
+
+
+
+
+ 预约发货时间
+ {{ orderDetail.deliveryDate || "--" }}
-
- 支付方式:
- {{ orderDetail.payMethod || "微信支付" }}
+
+ 快递单号
+ {{ orderDetail.trackingNo || "--" }}
-
-
- 权益商品包
- {{ orderDetail.packageName }}
+
+
+ {{ orderDetail.packageName }}
- 商品清单
-
-
- {{ goods.name }}
- {{ getGoodsTypeName(goods.type) }}
- {{ goods.spec }}
+
+
+
+
-
- ¥{{ goods.price }}
- ×{{ goods.quantity || 1 }}
+
+
+ {{ goods.name }}
+ {{
+ goods.description || goods.spec
+ }}
+
+
+
+
-
-
- 权益码信息
-
-
- 权益码
- {{ orderDetail.equityCode }}
-
-
- 查看二维码
-
+
+
+ 订单信息
+
+ 订单编号:
+ {{ orderDetail.orderNo }}
-
-
-
-
- 费用明细
-
- 商品总价
- ¥{{ orderDetail.goodsAmount }}
+
+ 商品合计
+ {{ orderDetail.goodsAmount }}
-
- 优惠金额
- -¥{{ orderDetail.discountAmount }}
+
+ 物流运费
+ {{ orderDetail.shippingFee || "5.00" }}
-
- 实付金额
- ¥{{ orderDetail.totalAmount }}
+
+ 优惠券
+ {{
+ orderDetail.discountAmount > 0 ? "无" : "无"
+ }}
-
-
-
-
- 收货信息
-
-
- {{ orderDetail.address.name }}
- {{ orderDetail.address.phone }}
-
- {{
- orderDetail.address.fullAddress
+
+ 合计实付
+ {{
+ orderDetail.totalAmount
}}
-
- 该订单无需收货地址
+
+ 积分
+ {{ orderDetail.points || "已获得1分" }}
+
+
+ 支付方式
+ {{
+ orderDetail.payMethod || "线上支付"
+ }}
+
+
+ 支付时间
+ {{
+ formatTime(orderDetail.payTime) || formatTime(orderDetail.createTime)
+ }}
+
+
+ 预约发货时间
+ {{
+ orderDetail.deliveryDate || formatTime(orderDetail.createTime)
+ }}
+
+
+ 实际发货时间
+ {{
+ formatTime(orderDetail.shippingTime) ||
+ formatTime(orderDetail.createTime)
+ }}
+
+
+ 备注
+ {{ orderDetail.remark || "XXXX" }}
+
+
+
-
-