diff --git a/App.vue b/App.vue index 14cb274..dcb3298 100644 --- a/App.vue +++ b/App.vue @@ -6,72 +6,76 @@ APIgeocodelocation } from "@/common/api/api.js" import { - onLaunch + onLaunch, + onShow } from '@dcloudio/uni-app'; import { - getCurrentInstance - } from 'vue' + getCurrentInstance, + nextTick + } from 'vue'; + import { + Storelogin + } from '@/stores/user.js'; const { proxy } = getCurrentInstance() // 小程序启动时执行 onLaunch(async () => { // 标记应用启动完成 + // clear + await nextTick() const store = useNavbarStore(); - store.initNavbarHeight(); - try { - uni.getLocation({ - type: 'wgs84', - success: async (res) => { - let successres = await APIgeocodelocation({ - lng: res.longitude, - lat: res.latitude, - }) - if (successres.code == 0) { - let datastorage = { - country: successres.data.addressComponent.country, // "中国" - province: successres.data.addressComponent - .province, //province: "陕西省" - address: successres.data.addressComponent.city, //district: "西安市" - district: successres.data.addressComponent - .district, //district: "未央区" - lng: res.longitude, - lat: res.latitude, - } - uni.cache.set('getLocationstorage', datastorage); - proxy.$isResolve() - } - }, + await store.initNavbarHeight(); - }); - } catch (error) { - let successres = await APIgeocodelocation({ - lng: '', - lat: '', - }) - if (successres.code == 0) { - let datastorage = { - country: successres.data.addressComponent.country, // "中国" - province: successres.data.addressComponent - .province, //province: "陕西省" - address: successres.data.addressComponent.city, //district: "西安市" - district: successres.data.addressComponent - .district, //district: "未央区" - lng: res.longitude, - lat: res.latitude, - } - uni.cache.set('getLocationstorage', datastorage); - proxy.$isResolve() - } - } }); - - // export default { - // onLaunch: async function() { - - - // }, - // onShow: function() {}, + onShow(async () => { + try { + // #ifdef MP-WEIXIN + // 当向小程序后台请求完新版本信息,会进行回调。res: {hasUpdate: true, version: 1.0.0} + const updateManager = uni.getUpdateManager(); + updateManager.onCheckForUpdate((res) => { + if (res.hasUpdate) { // 有更新 + uni.showLoading({ + title: '更新中...' + }); // 开始下载前,显示Loading + } + }); + // 当新版本下载完成,会进行回调 + updateManager.onUpdateReady(() => { + uni.hideLoading(); // 关闭 Loading + uni.showModal({ // 弹确认框(强制更新) + title: '更新提示', + content: '更新完毕,是否重启?', + success: function(res) { + if (res.confirm) { + updateManager.applyUpdate(); // 强制小程序重启并使用新版本。 + } + } + }) + }); + // 当新版本下载失败,会进行回调 + updateManager.onUpdateFailed(() => { + uni.hideLoading(); // 关闭 Loading + uni.showToast({ + title: '更新失败,稍后再试...', + icon: "error" + }); + }); + // #endif + } catch (error) { + //TODO handle the exception + } + // #ifndef H5 + // try { + const storelogin = Storelogin(); + await storelogin.actionslogin() + proxy.$isResolve() + // } catch (error) { + // proxy.$isResolve() + // console.log(error) + // } + // #endif + }) // onHide: function() {} // } diff --git a/common/api/api.js b/common/api/api.js index 696728d..25abaa5 100644 --- a/common/api/api.js +++ b/common/api/api.js @@ -1,20 +1,68 @@ // 引入 request 文件 import request from '@/common/api/request.js' - +const url = '/account' //根据经纬度获取信息 export const APIgeocodelocation = (data) => { return request({ - url: '/location/geocode', + url: url + '/user/geo/geocode', method: 'get', data: data, toast: false }) } -//根据经纬度获取信息 -export const APIcustomlogin = (data) => { + +//登录 +export const APIuserlogin = (data) => { return request({ - url: '/login/auth/custom/login', + url: url + '/user/login', + method: 'post', + data: data, + toast: false + }) +} + +//用户信息获取 +export const APIuser = (data) => { + return request({ + url: url + '/user', + method: 'get', + data: data, + toast: false + }) +} + +//获取手机号 +export const APIuserphone = (data) => { + return request({ + url: url + '/user/phone', method: 'post', data: data }) +} + +//文件上传 +export const APIuserupload = (data) => { + return request({ + url: url + '/user/common/upload', + method: 'post', + data: data + }) +} + +//用户密码修改 +export const APIuserpwd = (data) => { + return request({ + url: url + '/user/pwd', + method: 'put', + data: data + }) +} + +//验证码获取 +export const APIusercode = (data) => { + return request({ + url: url + '/user/code', + method: 'get', + data: data + }) } \ No newline at end of file diff --git a/common/api/index/coupons.js b/common/api/index/coupons.js index 284107c..22e1111 100644 --- a/common/api/index/coupons.js +++ b/common/api/index/coupons.js @@ -1,9 +1,10 @@ // 引入 request 文件 import request from '@/common/api/request.js' //获取优惠券参数列表 +const url = '/account' export const APIordergetYhqPara = (data) => { return request({ - url: '/order/getYhqPara', + url: url + '/order/getYhqPara', method: 'get', data: data }) @@ -11,7 +12,7 @@ export const APIordergetYhqPara = (data) => { //系统优惠券 export const APIorderfindCoupons = (data) => { return request({ - url: '/order/findCoupons', + url: url + '/order/findCoupons', method: 'get', data: data }) @@ -19,7 +20,7 @@ export const APIorderfindCoupons = (data) => { // 我的优惠券 export const APIordermineCoupons = (data) => { return request({ - url: '/order/mineCoupons', + url: url + '/order/mineCoupons', method: 'post', data: data, toast: false diff --git a/common/api/index/index.js b/common/api/index/index.js index 908bfbe..a89a35f 100644 --- a/common/api/index/index.js +++ b/common/api/index/index.js @@ -1,46 +1,30 @@ // 引入 request 文件 +const url = '/product' +// const url = '/account' import request from '@/common/api/request.js' //首页上半部分 export const APIhomehomePageUp = (data) => { return request({ - url: '/home/homePageUp', - method: 'post', + url: url + '/user/home/homePageUp', + method: 'GET', data: data }) } -//首页上半部分 +//首页xia半部分 export const APIhome = (data) => { return request({ - url: '/home', - method: 'post', + url: url + '/user/home/product', + method: 'GET', data: data, toast: false }) } -//首页上半部分 -export const APIshopUserInfo = (data) => { +// 获取咖啡 +export const userdict = (data) => { return request({ - url: '/user/shopUserInfo', - method: 'get', + url: '/account/user/dict', + method: 'GET', data: data, toast: false }) } -//首页上半部分 -export const APIgeocodelocation = (data) => { - return request({ - url: '/location/geocode', - method: 'get', - data: data, - toast: false - }) -} -///商户登录后 shopId和autokey -export const APIshopExtend = (data) => { - return request({ - url: '/common/shopExtend', - method: 'post', - data: data, - toast: false - }) -} \ No newline at end of file diff --git a/common/api/index/tothestore.js b/common/api/index/tothestore.js index 5b2c188..7b540b4 100644 --- a/common/api/index/tothestore.js +++ b/common/api/index/tothestore.js @@ -1,9 +1,10 @@ // 引入 request 文件 import request from '@/common/api/request.js' +const url = '/account' //获取top部分(店铺列表) export const APIdistiricttopCommon = (data) => { return request({ - url: '/distirict/topCommon', + url: url + '/distirict/topCommon', method: 'get', data: data }) @@ -11,7 +12,7 @@ export const APIdistiricttopCommon = (data) => { //预约到店(店铺列表) export const APIdistirictsubShopList = (data) => { return request({ - url: '/distirict/subShopList', + url: url + '/user/shopInfo/subList', method: 'get', data: data }) diff --git a/common/api/member.js b/common/api/member.js new file mode 100644 index 0000000..72ffe14 --- /dev/null +++ b/common/api/member.js @@ -0,0 +1,114 @@ +// 引入 request 文件 +import request from '@/common/api/request.js' +const urlAccount = '/account' +const urlProduct = '/product' +const urlOrder = '/order' + +//桌码换取详细店铺信息 +export const APIproductqueryShop = (data) => { + return request({ + url: urlAccount + '/user/shopInfo', + method: 'get', + data: data + }) +} + +// 获取登录用户店铺会员信息 +export const APIshopUserInfo = (data) => { + return request({ + url: urlAccount + '/user/shopUser', + method: 'get', + data: data, + toast: false + }) +} + +// 加入会员 +export const APIshopUser = (data) => { + return request({ + url: urlAccount + '/user/shopUser', + method: 'post', + data: data + }) +} + +// 获取动态会员码 3分钟内可用 +export const APIusershopUsercode = (data) => { + return request({ + url: urlAccount + '/user/shopUser/code', + method: 'get', + data: data + }) +} + +// 获取当前用户所有店铺会员信息 列表 +export const APIusershopUservipCard = (data) => { + return request({ + url: urlAccount + '/user/shopUser/vipCard', + method: 'get', + data: data + }) +} + + +// 获取店铺详细信息 +export const APIusershopInfodetail = (data) => { + return request({ + url: urlAccount + '/user/shopInfo/detail', + method: 'get', + data: data + }) +} + +//通过用户Id 查找优惠券 +export const APIcouponfindByUserId = (data) => { + return request({ + url: urlAccount + '/user/coupon/findByUserId', + method: 'get', + data: data + }) +} +//生成订单后使用 +export const APIfindCoupon = (data) => { + return request({ + url: urlAccount + '/user/coupon/findCoupon', + method: 'get', + data: data + }) +} + +//桌码换取详细店铺信息 +export const APIuseractivate = (data) => { + return request({ + url: urlAccount + '/user/activate', + method: 'get', + data: data + }) +} + +//获取余额余额明细 +export const APIshopUsermoneyRecord = (data) => { + return request({ + url: urlAccount + '/user/shopUser/moneyRecord', + method: 'get', + data: data + }) +} + +//获取积分明细 +export const APIshopUserpointsRecord = (data) => { + return request({ + url: urlAccount + '/user/shopUser/pointsRecord', + method: 'get', + data: data + }) +} + +//获取动态会员码 +export const APIshopUsercode = (data) => { + return request({ + url: urlAccount + '/user/shopUser/code', + method: 'get', + data: data + }) +} \ No newline at end of file diff --git a/common/api/order/index.js b/common/api/order/index.js new file mode 100644 index 0000000..52b5aac --- /dev/null +++ b/common/api/order/index.js @@ -0,0 +1,65 @@ +// 引入 request 文件 +import request from '@/common/api/request.js' +const url = '/order' +//订单列表 +export const APIuserorder = (data) => { + return request({ + url: url + '/user/order', + method: 'get', + data: data + }) +} + +//生成订单 +export const APIcreateOrder = (data) => { + return request({ + url: url + '/user/order/createOrder', + method: 'post', + data: data + }) +} + +//删除订单 +export const APIputuserorder = (data) => { + return request({ + url: url + '/user/order/' + data, + method: 'put' + }) +} + +//历史订单(多次下单使用) +export const APIhistoryOrder = (data) => { + return request({ + url: url + '/user/order/historyOrder', + method: 'get', + data: data, + toast: false + }) +} + +//订单详情 +export const APIgetOrderById = (data) => { + return request({ + url: url + '/user/order/getOrderById', + method: 'get', + data: data + }) +} + +//删除所有待支付订单 +export const APIcancelOrder = (data) => { + return request({ + url: url + '/user/order/cancelOrder', + method: 'post', + data: data + }) +} + +//删除某一个待支付订单 +export const APIrmPlaceOrder = (data) => { + return request({ + url: url + '/user/order/rmPlaceOrder', + method: 'post', + data: data + }) +} \ No newline at end of file diff --git a/common/api/pay.js b/common/api/pay.js new file mode 100644 index 0000000..27096fe --- /dev/null +++ b/common/api/pay.js @@ -0,0 +1,32 @@ +// 引入 request 文件 +import request from '@/common/api/request.js' +const urlAccount = '/account' +const urlProduct = '/product' +const urlOrder = '/order' + +// 小程序会员充值支付 +export const APIpayltPayVip = (data) => { + return request({ + url: urlOrder + '/pay/ltPayVip', + method: 'post', + data: data + }) +} + +// 小程序支付 +export const APIpayltPayOrder = (data) => { + return request({ + url: urlOrder + '/pay/ltPayOrder', + method: 'post', + data: data + }) +} + +// 会员退款 +export const APIrefundVip = (data) => { + return request({ + url: urlOrder + '/pay/vipPay', + method: 'post', + data: data + }) +} \ No newline at end of file diff --git a/common/api/product/product.js b/common/api/product/product.js index ef683c1..e06706c 100644 --- a/common/api/product/product.js +++ b/common/api/product/product.js @@ -1,10 +1,48 @@ // 引入 request 文件 import request from '@/common/api/request.js' +const urlAccount = '/account' +const urlProduct = '/product' +const urlOrder = '/order' -//通过桌码获取店铺信息 -export const APIproductqueryShop = (data) => { +//获取商品列表数据 +export const APIproductqueryProduct = (data) => { return request({ - url: '/product/queryShop', + url: urlProduct + '/user/product/miniApp/home/queryProduct', + method: 'get', + data: data + }) +} + +//小程序点餐-热销商品查询 +export const productminiApphotsquery = (data) => { + return request({ + url: urlProduct + '/user/product/miniApp/hots/query', + method: 'get', + data: data + }) +} + +//小程序点餐-分组商品列表 +export const APIgroupquery = (data) => { + return request({ + url: urlProduct + '/user/product/miniApp/group/query', + method: 'get', + data: data + }) +} + +//小程序点餐-分组商品列表 +export const APIminiAppinfo = (data) => { + return request({ + url: urlProduct + '/user/product/miniApp/info/' + data, + method: 'get' + }) +} + +//小程序点餐-分组商品列表 +export const APIminiAppskuinfo = (data) => { + return request({ + url: urlProduct + '/user/product/miniApp/sku/info', method: 'get', data: data }) diff --git a/common/api/request.js b/common/api/request.js index 8c90c9f..003fdeb 100644 --- a/common/api/request.js +++ b/common/api/request.js @@ -8,22 +8,21 @@ export default (params) => { version: uni.conf.version, type: uni.getSystemInfoSync().platform, // #ifdef APP-PLUS - environment: 'app', + platformType: 'APP', // #endif // #ifdef H5 - environment: 'H5', + platformType: 'H5', // #endif // #ifdef MP-WEIXIN - environment: 'wx', + platformType: 'WX', // #endif // #ifdef MP-ALIPAY - environment: 'alipay', + platformType: 'ALI', // #endif - token: uni.cache.get('token'), - openId: uni.cache.get('miniAppOpenId'), - id: uni.cache.get('userInfo').id, - shopId: uni.cache.get('shopId'), - userId: uni.cache.get('userInfo').id, + token: uni.cache.get('token') || '', + id: uni.cache.get('userInfo').id || '', + shopId: uni.cache.get('shopId') || '', + userId: uni.cache.get('userInfo').id || '', } if (toast) { uni.showLoading({ @@ -32,34 +31,37 @@ export default (params) => { }) } return new Promise((resolve, reject) => { + const timeoutDuration = params.timeout || 10000; // 可以通过 params 传入超时时间,默认 10 秒 uni.request({ url: uni.conf.baseUrl + url, method: method, header: header, data: data, + timeout: timeoutDuration, success(response) { const res = response.data // 根据返回的状态码做出对应的操作 //获取成功 - if (res.code == 0) { + if (res.code == 200) { uni.hideLoading(); uni.hideToast(); - resolve(res); + resolve(res.data ? res.data : true); } else { switch (res.code) { - case '-4': - resolve(res) + case '501': + uni.cache.remove('shopId') // uni.showToast({ - // title: res.message || res.msg || res.error, + // title: '', // icon: "none", // success: () => { - // setTimeout(() => { - // uni.reLaunch({ - // url: "/pages/login/index", - // }) - // }, 1000); + // } // }) + setTimeout(() => { + uni.reLaunch({ + url: "/pages/index/index", + }) + }, 1000); break; case 404: uni.showToast({ @@ -69,15 +71,14 @@ export default (params) => { break; default: // 是否提示 - console.log(res) if (toast) { uni.showToast({ title: res.message || res.msg || res.error, icon: "none", success: () => { setTimeout(res => { - - }, 2000) + reject(false); + }, 1000) } }) } @@ -86,21 +87,18 @@ export default (params) => { } }, fail(err) { - console.log(err) if (err.errMsg.indexOf('request:fail') !== -1) { - uni.showToast({ - title: '网络异常', - icon: "error", - duration: 2000 - }) - } else { - uni.showToast({ - title: '未知异常', - duration: 2000 - }) + if (err.errMsg.indexOf('timeout') !== -1) { + if (toast) { + uni.showToast({ + title: `请求超时,请稍后重试`, + icon: "error", + duration: 2000 + }); + } + } } reject(err); - }, complete() { // 不管成功还是失败都会执行 @@ -111,5 +109,6 @@ export default (params) => { } }); - }).catch((e) => {}); + }).catch((e) => { + }); }; \ No newline at end of file diff --git a/common/api/shop/index.js b/common/api/shop/index.js new file mode 100644 index 0000000..61f3575 --- /dev/null +++ b/common/api/shop/index.js @@ -0,0 +1,41 @@ +// 引入 request 文件 +import request from '@/common/api/request.js' +const urlAccount = '/account' +const urlProduct = '/product' +const urlOrder = '/order' + +//商品列表 +export const APIgeocodelocation = (data) => { + return request({ + url: urlAccount + '/user/points/mall/goods/page', + method: 'get', + data: data + }) +} + +//001-会员积分账户信息 +export const APImemberPointsmyPoints = (data) => { + return request({ + url: urlAccount + '/user/points/memberPoints/myPoints', + method: 'get', + data: data + }) +} + +//002-获取订单可用积分及抵扣金额(支付页面使用) +export const APImemberPointscalcUsablePoints = (data) => { + return request({ + url: urlAccount + '/user/points/memberPoints/calcUsablePoints', + method: 'get', + data: data + }) +} + +//003-根据积分计算可抵扣金额 +export const APImemberPointscalcDeductionAmount = (data) => { + return request({ + url: urlAccount + '/user/points/memberPoints/calcDeductionAmount', + method: 'get', + data: data + }) +} \ No newline at end of file diff --git a/common/api/subscribeto.js b/common/api/subscribeto.js new file mode 100644 index 0000000..c6a9e2d --- /dev/null +++ b/common/api/subscribeto.js @@ -0,0 +1,58 @@ +// 引入 request 文件 +import request from '@/common/api/request.js' +const urlAccount = '/account' +const urlProduct = '/product' +const urlOrder = '/order' + +// 获取叫号号码 +export const APIcallTabletakeNumber = (data) => { + return request({ + url: urlAccount + '/user/callTable/takeNumber', + method: 'post', + data: data + }) +} + +// 叫号桌型获取 +export const APIusercallTable = (data) => { + return request({ + url: urlAccount + '/user/callTable', + method: 'get', + data: data + }) +} + +// 获取叫号队列 +export const APIqueuecallTable = (data) => { + return request({ + url: urlAccount + '/user/callTable/queue', + method: 'get', + data: data + }) +} + +// 叫号队列详情 +export const APIqueuedetail = (data) => { + return request({ + url: urlAccount + '/user/callTable/queue/detail', + method: 'get', + data: data + }) +} + +// 消息订阅 +export const APIcallTablesubMsg = (data) => { + return request({ + url: urlAccount + '/user/callTable/subMsg', + method: 'post', + data: data + }) +} + +// 取消排队 +export const APIqueuecancel = (data) => { + return request({ + url: urlAccount + '/user/callTable/cancel?queueId=' + data.queueId + '&shopId=' + data.shopId, + method: 'DELETE' + }) +} \ No newline at end of file diff --git a/common/js/uqrCode.js b/common/js/uqrCode.js deleted file mode 100644 index 62a4ad4..0000000 --- a/common/js/uqrCode.js +++ /dev/null @@ -1,1437 +0,0 @@ -// uqrcode.js -//--------------------------------------------------------------------- -// github https://github.com/Sansnn/uQRCode -//--------------------------------------------------------------------- - -let uQRCode = {}; - -(function() { - //--------------------------------------------------------------------- - // QRCode for JavaScript - // - // Copyright (c) 2009 Kazuhiko Arase - // - // URL: http://www.d-project.com/ - // - // Licensed under the MIT license: - // http://www.opensource.org/licenses/mit-license.php - // - // The word "QR Code" is registered trademark of - // DENSO WAVE INCORPORATED - // http://www.denso-wave.com/qrcode/faqpatent-e.html - // - //--------------------------------------------------------------------- - - //--------------------------------------------------------------------- - // QR8bitByte - //--------------------------------------------------------------------- - - function QR8bitByte(data) { - this.mode = QRMode.MODE_8BIT_BYTE; - this.data = data; - } - - QR8bitByte.prototype = { - - getLength: function(buffer) { - return this.data.length; - }, - - write: function(buffer) { - for (var i = 0; i < this.data.length; i++) { - // not JIS ... - buffer.put(this.data.charCodeAt(i), 8); - } - } - }; - - //--------------------------------------------------------------------- - // QRCode - //--------------------------------------------------------------------- - - function QRCode(typeNumber, errorCorrectLevel) { - this.typeNumber = typeNumber; - this.errorCorrectLevel = errorCorrectLevel; - this.modules = null; - this.moduleCount = 0; - this.dataCache = null; - this.dataList = new Array(); - } - - QRCode.prototype = { - - addData: function(data) { - var newData = new QR8bitByte(data); - this.dataList.push(newData); - this.dataCache = null; - }, - - isDark: function(row, col) { - if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) { - throw new Error(row + "," + col); - } - return this.modules[row][col]; - }, - - getModuleCount: function() { - return this.moduleCount; - }, - - make: function() { - // Calculate automatically typeNumber if provided is < 1 - if (this.typeNumber < 1) { - var typeNumber = 1; - for (typeNumber = 1; typeNumber < 40; typeNumber++) { - var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, this.errorCorrectLevel); - - var buffer = new QRBitBuffer(); - var totalDataCount = 0; - for (var i = 0; i < rsBlocks.length; i++) { - totalDataCount += rsBlocks[i].dataCount; - } - - for (var i = 0; i < this.dataList.length; i++) { - var data = this.dataList[i]; - buffer.put(data.mode, 4); - buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber)); - data.write(buffer); - } - if (buffer.getLengthInBits() <= totalDataCount * 8) - break; - } - this.typeNumber = typeNumber; - } - this.makeImpl(false, this.getBestMaskPattern()); - }, - - makeImpl: function(test, maskPattern) { - - this.moduleCount = this.typeNumber * 4 + 17; - this.modules = new Array(this.moduleCount); - - for (var row = 0; row < this.moduleCount; row++) { - - this.modules[row] = new Array(this.moduleCount); - - for (var col = 0; col < this.moduleCount; col++) { - this.modules[row][col] = null; //(col + row) % 3; - } - } - - this.setupPositionProbePattern(0, 0); - this.setupPositionProbePattern(this.moduleCount - 7, 0); - this.setupPositionProbePattern(0, this.moduleCount - 7); - this.setupPositionAdjustPattern(); - this.setupTimingPattern(); - this.setupTypeInfo(test, maskPattern); - - if (this.typeNumber >= 7) { - this.setupTypeNumber(test); - } - - if (this.dataCache == null) { - this.dataCache = QRCode.createData(this.typeNumber, this.errorCorrectLevel, this.dataList); - } - - this.mapData(this.dataCache, maskPattern); - }, - - setupPositionProbePattern: function(row, col) { - - for (var r = -1; r <= 7; r++) { - - if (row + r <= -1 || this.moduleCount <= row + r) continue; - - for (var c = -1; c <= 7; c++) { - - if (col + c <= -1 || this.moduleCount <= col + c) continue; - - if ((0 <= r && r <= 6 && (c == 0 || c == 6)) || - (0 <= c && c <= 6 && (r == 0 || r == 6)) || - (2 <= r && r <= 4 && 2 <= c && c <= 4)) { - this.modules[row + r][col + c] = true; - } else { - this.modules[row + r][col + c] = false; - } - } - } - }, - - getBestMaskPattern: function() { - - var minLostPoint = 0; - var pattern = 0; - - for (var i = 0; i < 8; i++) { - - this.makeImpl(true, i); - - var lostPoint = QRUtil.getLostPoint(this); - - if (i == 0 || minLostPoint > lostPoint) { - minLostPoint = lostPoint; - pattern = i; - } - } - - return pattern; - }, - - createMovieClip: function(target_mc, instance_name, depth) { - - var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth); - var cs = 1; - - this.make(); - - for (var row = 0; row < this.modules.length; row++) { - - var y = row * cs; - - for (var col = 0; col < this.modules[row].length; col++) { - - var x = col * cs; - var dark = this.modules[row][col]; - - if (dark) { - qr_mc.beginFill(0, 100); - qr_mc.moveTo(x, y); - qr_mc.lineTo(x + cs, y); - qr_mc.lineTo(x + cs, y + cs); - qr_mc.lineTo(x, y + cs); - qr_mc.endFill(); - } - } - } - - return qr_mc; - }, - - setupTimingPattern: function() { - - for (var r = 8; r < this.moduleCount - 8; r++) { - if (this.modules[r][6] != null) { - continue; - } - this.modules[r][6] = (r % 2 == 0); - } - - for (var c = 8; c < this.moduleCount - 8; c++) { - if (this.modules[6][c] != null) { - continue; - } - this.modules[6][c] = (c % 2 == 0); - } - }, - - setupPositionAdjustPattern: function() { - - var pos = QRUtil.getPatternPosition(this.typeNumber); - - for (var i = 0; i < pos.length; i++) { - - for (var j = 0; j < pos.length; j++) { - - var row = pos[i]; - var col = pos[j]; - - if (this.modules[row][col] != null) { - continue; - } - - for (var r = -2; r <= 2; r++) { - - for (var c = -2; c <= 2; c++) { - - if (r == -2 || r == 2 || c == -2 || c == 2 || - (r == 0 && c == 0)) { - this.modules[row + r][col + c] = true; - } else { - this.modules[row + r][col + c] = false; - } - } - } - } - } - }, - - setupTypeNumber: function(test) { - - var bits = QRUtil.getBCHTypeNumber(this.typeNumber); - - for (var i = 0; i < 18; i++) { - var mod = (!test && ((bits >> i) & 1) == 1); - this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod; - } - - for (var i = 0; i < 18; i++) { - var mod = (!test && ((bits >> i) & 1) == 1); - this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod; - } - }, - - setupTypeInfo: function(test, maskPattern) { - - var data = (this.errorCorrectLevel << 3) | maskPattern; - var bits = QRUtil.getBCHTypeInfo(data); - - // vertical - for (var i = 0; i < 15; i++) { - - var mod = (!test && ((bits >> i) & 1) == 1); - if (i < 6) { - this.modules[i][8] = mod; - } else if (i < 8) { - this.modules[i + 1][8] = mod; - } else { - this.modules[this.moduleCount - 15 + i][8] = mod; - } - } - - // horizontal - for (var i = 0; i < 15; i++) { - - var mod = (!test && ((bits >> i) & 1) == 1); - if (i < 8) { - this.modules[8][this.moduleCount - i - 1] = mod; - } else if (i < 9) { - this.modules[8][15 - i - 1 + 1] = mod; - } else { - this.modules[8][15 - i - 1] = mod; - } - } - - // fixed module - this.modules[this.moduleCount - 8][8] = (!test); - - }, - - mapData: function(data, maskPattern) { - - var inc = -1; - var row = this.moduleCount - 1; - var bitIndex = 7; - var byteIndex = 0; - - for (var col = this.moduleCount - 1; col > 0; col -= 2) { - - if (col == 6) col--; - - while (true) { - - for (var c = 0; c < 2; c++) { - - if (this.modules[row][col - c] == null) { - - var dark = false; - - if (byteIndex < data.length) { - dark = (((data[byteIndex] >>> bitIndex) & 1) == 1); - } - - var mask = QRUtil.getMask(maskPattern, row, col - c); - - if (mask) { - dark = !dark; - } - - this.modules[row][col - c] = dark; - bitIndex--; - - if (bitIndex == -1) { - byteIndex++; - bitIndex = 7; - } - } - } - - row += inc; - - if (row < 0 || this.moduleCount <= row) { - row -= inc; - inc = -inc; - break; - } - } - } - - } - - }; - - QRCode.PAD0 = 0xEC; - QRCode.PAD1 = 0x11; - - QRCode.createData = function(typeNumber, errorCorrectLevel, dataList) { - - var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel); - - var buffer = new QRBitBuffer(); - - for (var i = 0; i < dataList.length; i++) { - var data = dataList[i]; - buffer.put(data.mode, 4); - buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber)); - data.write(buffer); - } - - // calc num max data. - var totalDataCount = 0; - for (var i = 0; i < rsBlocks.length; i++) { - totalDataCount += rsBlocks[i].dataCount; - } - - if (buffer.getLengthInBits() > totalDataCount * 8) { - throw new Error("code length overflow. (" + - buffer.getLengthInBits() + - ">" + - totalDataCount * 8 + - ")"); - } - - // end code - if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) { - buffer.put(0, 4); - } - - // padding - while (buffer.getLengthInBits() % 8 != 0) { - buffer.putBit(false); - } - - // padding - while (true) { - - if (buffer.getLengthInBits() >= totalDataCount * 8) { - break; - } - buffer.put(QRCode.PAD0, 8); - - if (buffer.getLengthInBits() >= totalDataCount * 8) { - break; - } - buffer.put(QRCode.PAD1, 8); - } - - return QRCode.createBytes(buffer, rsBlocks); - } - - QRCode.createBytes = function(buffer, rsBlocks) { - - var offset = 0; - - var maxDcCount = 0; - var maxEcCount = 0; - - var dcdata = new Array(rsBlocks.length); - var ecdata = new Array(rsBlocks.length); - - for (var r = 0; r < rsBlocks.length; r++) { - - var dcCount = rsBlocks[r].dataCount; - var ecCount = rsBlocks[r].totalCount - dcCount; - - maxDcCount = Math.max(maxDcCount, dcCount); - maxEcCount = Math.max(maxEcCount, ecCount); - - dcdata[r] = new Array(dcCount); - - for (var i = 0; i < dcdata[r].length; i++) { - dcdata[r][i] = 0xff & buffer.buffer[i + offset]; - } - offset += dcCount; - - var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount); - var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1); - - var modPoly = rawPoly.mod(rsPoly); - ecdata[r] = new Array(rsPoly.getLength() - 1); - for (var i = 0; i < ecdata[r].length; i++) { - var modIndex = i + modPoly.getLength() - ecdata[r].length; - ecdata[r][i] = (modIndex >= 0) ? modPoly.get(modIndex) : 0; - } - - } - - var totalCodeCount = 0; - for (var i = 0; i < rsBlocks.length; i++) { - totalCodeCount += rsBlocks[i].totalCount; - } - - var data = new Array(totalCodeCount); - var index = 0; - - for (var i = 0; i < maxDcCount; i++) { - for (var r = 0; r < rsBlocks.length; r++) { - if (i < dcdata[r].length) { - data[index++] = dcdata[r][i]; - } - } - } - - for (var i = 0; i < maxEcCount; i++) { - for (var r = 0; r < rsBlocks.length; r++) { - if (i < ecdata[r].length) { - data[index++] = ecdata[r][i]; - } - } - } - - return data; - - } - - //--------------------------------------------------------------------- - // QRMode - //--------------------------------------------------------------------- - - var QRMode = { - MODE_NUMBER: 1 << 0, - MODE_ALPHA_NUM: 1 << 1, - MODE_8BIT_BYTE: 1 << 2, - MODE_KANJI: 1 << 3 - }; - - //--------------------------------------------------------------------- - // QRErrorCorrectLevel - //--------------------------------------------------------------------- - - var QRErrorCorrectLevel = { - L: 1, - M: 0, - Q: 3, - H: 2 - }; - - //--------------------------------------------------------------------- - // QRMaskPattern - //--------------------------------------------------------------------- - - var QRMaskPattern = { - PATTERN000: 0, - PATTERN001: 1, - PATTERN010: 2, - PATTERN011: 3, - PATTERN100: 4, - PATTERN101: 5, - PATTERN110: 6, - PATTERN111: 7 - }; - - //--------------------------------------------------------------------- - // QRUtil - //--------------------------------------------------------------------- - - var QRUtil = { - - PATTERN_POSITION_TABLE: [ - [], - [6, 18], - [6, 22], - [6, 26], - [6, 30], - [6, 34], - [6, 22, 38], - [6, 24, 42], - [6, 26, 46], - [6, 28, 50], - [6, 30, 54], - [6, 32, 58], - [6, 34, 62], - [6, 26, 46, 66], - [6, 26, 48, 70], - [6, 26, 50, 74], - [6, 30, 54, 78], - [6, 30, 56, 82], - [6, 30, 58, 86], - [6, 34, 62, 90], - [6, 28, 50, 72, 94], - [6, 26, 50, 74, 98], - [6, 30, 54, 78, 102], - [6, 28, 54, 80, 106], - [6, 32, 58, 84, 110], - [6, 30, 58, 86, 114], - [6, 34, 62, 90, 118], - [6, 26, 50, 74, 98, 122], - [6, 30, 54, 78, 102, 126], - [6, 26, 52, 78, 104, 130], - [6, 30, 56, 82, 108, 134], - [6, 34, 60, 86, 112, 138], - [6, 30, 58, 86, 114, 142], - [6, 34, 62, 90, 118, 146], - [6, 30, 54, 78, 102, 126, 150], - [6, 24, 50, 76, 102, 128, 154], - [6, 28, 54, 80, 106, 132, 158], - [6, 32, 58, 84, 110, 136, 162], - [6, 26, 54, 82, 110, 138, 166], - [6, 30, 58, 86, 114, 142, 170] - ], - - G15: (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0), - G18: (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0), - G15_MASK: (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1), - - getBCHTypeInfo: function(data) { - var d = data << 10; - while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) { - d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15))); - } - return ((data << 10) | d) ^ QRUtil.G15_MASK; - }, - - getBCHTypeNumber: function(data) { - var d = data << 12; - while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) { - d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18))); - } - return (data << 12) | d; - }, - - getBCHDigit: function(data) { - - var digit = 0; - - while (data != 0) { - digit++; - data >>>= 1; - } - - return digit; - }, - - getPatternPosition: function(typeNumber) { - return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1]; - }, - - getMask: function(maskPattern, i, j) { - - switch (maskPattern) { - - case QRMaskPattern.PATTERN000: - return (i + j) % 2 == 0; - case QRMaskPattern.PATTERN001: - return i % 2 == 0; - case QRMaskPattern.PATTERN010: - return j % 3 == 0; - case QRMaskPattern.PATTERN011: - return (i + j) % 3 == 0; - case QRMaskPattern.PATTERN100: - return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0; - case QRMaskPattern.PATTERN101: - return (i * j) % 2 + (i * j) % 3 == 0; - case QRMaskPattern.PATTERN110: - return ((i * j) % 2 + (i * j) % 3) % 2 == 0; - case QRMaskPattern.PATTERN111: - return ((i * j) % 3 + (i + j) % 2) % 2 == 0; - - default: - throw new Error("bad maskPattern:" + maskPattern); - } - }, - - getErrorCorrectPolynomial: function(errorCorrectLength) { - - var a = new QRPolynomial([1], 0); - - for (var i = 0; i < errorCorrectLength; i++) { - a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0)); - } - - return a; - }, - - getLengthInBits: function(mode, type) { - - if (1 <= type && type < 10) { - - // 1 - 9 - - switch (mode) { - case QRMode.MODE_NUMBER: - return 10; - case QRMode.MODE_ALPHA_NUM: - return 9; - case QRMode.MODE_8BIT_BYTE: - return 8; - case QRMode.MODE_KANJI: - return 8; - default: - throw new Error("mode:" + mode); - } - - } else if (type < 27) { - - // 10 - 26 - - switch (mode) { - case QRMode.MODE_NUMBER: - return 12; - case QRMode.MODE_ALPHA_NUM: - return 11; - case QRMode.MODE_8BIT_BYTE: - return 16; - case QRMode.MODE_KANJI: - return 10; - default: - throw new Error("mode:" + mode); - } - - } else if (type < 41) { - - // 27 - 40 - - switch (mode) { - case QRMode.MODE_NUMBER: - return 14; - case QRMode.MODE_ALPHA_NUM: - return 13; - case QRMode.MODE_8BIT_BYTE: - return 16; - case QRMode.MODE_KANJI: - return 12; - default: - throw new Error("mode:" + mode); - } - - } else { - throw new Error("type:" + type); - } - }, - - getLostPoint: function(qrCode) { - - var moduleCount = qrCode.getModuleCount(); - - var lostPoint = 0; - - // LEVEL1 - - for (var row = 0; row < moduleCount; row++) { - - for (var col = 0; col < moduleCount; col++) { - - var sameCount = 0; - var dark = qrCode.isDark(row, col); - - for (var r = -1; r <= 1; r++) { - - if (row + r < 0 || moduleCount <= row + r) { - continue; - } - - for (var c = -1; c <= 1; c++) { - - if (col + c < 0 || moduleCount <= col + c) { - continue; - } - - if (r == 0 && c == 0) { - continue; - } - - if (dark == qrCode.isDark(row + r, col + c)) { - sameCount++; - } - } - } - - if (sameCount > 5) { - lostPoint += (3 + sameCount - 5); - } - } - } - - // LEVEL2 - - for (var row = 0; row < moduleCount - 1; row++) { - for (var col = 0; col < moduleCount - 1; col++) { - var count = 0; - if (qrCode.isDark(row, col)) count++; - if (qrCode.isDark(row + 1, col)) count++; - if (qrCode.isDark(row, col + 1)) count++; - if (qrCode.isDark(row + 1, col + 1)) count++; - if (count == 0 || count == 4) { - lostPoint += 3; - } - } - } - - // LEVEL3 - - for (var row = 0; row < moduleCount; row++) { - for (var col = 0; col < moduleCount - 6; col++) { - if (qrCode.isDark(row, col) && - !qrCode.isDark(row, col + 1) && - qrCode.isDark(row, col + 2) && - qrCode.isDark(row, col + 3) && - qrCode.isDark(row, col + 4) && - !qrCode.isDark(row, col + 5) && - qrCode.isDark(row, col + 6)) { - lostPoint += 40; - } - } - } - - for (var col = 0; col < moduleCount; col++) { - for (var row = 0; row < moduleCount - 6; row++) { - if (qrCode.isDark(row, col) && - !qrCode.isDark(row + 1, col) && - qrCode.isDark(row + 2, col) && - qrCode.isDark(row + 3, col) && - qrCode.isDark(row + 4, col) && - !qrCode.isDark(row + 5, col) && - qrCode.isDark(row + 6, col)) { - lostPoint += 40; - } - } - } - - // LEVEL4 - - var darkCount = 0; - - for (var col = 0; col < moduleCount; col++) { - for (var row = 0; row < moduleCount; row++) { - if (qrCode.isDark(row, col)) { - darkCount++; - } - } - } - - var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5; - lostPoint += ratio * 10; - - return lostPoint; - } - - }; - - - //--------------------------------------------------------------------- - // QRMath - //--------------------------------------------------------------------- - - var QRMath = { - - glog: function(n) { - - if (n < 1) { - throw new Error("glog(" + n + ")"); - } - - return QRMath.LOG_TABLE[n]; - }, - - gexp: function(n) { - - while (n < 0) { - n += 255; - } - - while (n >= 256) { - n -= 255; - } - - return QRMath.EXP_TABLE[n]; - }, - - EXP_TABLE: new Array(256), - - LOG_TABLE: new Array(256) - - }; - - for (var i = 0; i < 8; i++) { - QRMath.EXP_TABLE[i] = 1 << i; - } - for (var i = 8; i < 256; i++) { - QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ - QRMath.EXP_TABLE[i - 5] ^ - QRMath.EXP_TABLE[i - 6] ^ - QRMath.EXP_TABLE[i - 8]; - } - for (var i = 0; i < 255; i++) { - QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i; - } - - //--------------------------------------------------------------------- - // QRPolynomial - //--------------------------------------------------------------------- - - function QRPolynomial(num, shift) { - - if (num.length == undefined) { - throw new Error(num.length + "/" + shift); - } - - var offset = 0; - - while (offset < num.length && num[offset] == 0) { - offset++; - } - - this.num = new Array(num.length - offset + shift); - for (var i = 0; i < num.length - offset; i++) { - this.num[i] = num[i + offset]; - } - } - - QRPolynomial.prototype = { - - get: function(index) { - return this.num[index]; - }, - - getLength: function() { - return this.num.length; - }, - - multiply: function(e) { - - var num = new Array(this.getLength() + e.getLength() - 1); - - for (var i = 0; i < this.getLength(); i++) { - for (var j = 0; j < e.getLength(); j++) { - num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j))); - } - } - - return new QRPolynomial(num, 0); - }, - - mod: function(e) { - - if (this.getLength() - e.getLength() < 0) { - return this; - } - - var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0)); - - var num = new Array(this.getLength()); - - for (var i = 0; i < this.getLength(); i++) { - num[i] = this.get(i); - } - - for (var i = 0; i < e.getLength(); i++) { - num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio); - } - - // recursive call - return new QRPolynomial(num, 0).mod(e); - } - }; - - //--------------------------------------------------------------------- - // QRRSBlock - //--------------------------------------------------------------------- - - function QRRSBlock(totalCount, dataCount) { - this.totalCount = totalCount; - this.dataCount = dataCount; - } - - QRRSBlock.RS_BLOCK_TABLE = [ - - // L - // M - // Q - // H - - // 1 - [1, 26, 19], - [1, 26, 16], - [1, 26, 13], - [1, 26, 9], - - // 2 - [1, 44, 34], - [1, 44, 28], - [1, 44, 22], - [1, 44, 16], - - // 3 - [1, 70, 55], - [1, 70, 44], - [2, 35, 17], - [2, 35, 13], - - // 4 - [1, 100, 80], - [2, 50, 32], - [2, 50, 24], - [4, 25, 9], - - // 5 - [1, 134, 108], - [2, 67, 43], - [2, 33, 15, 2, 34, 16], - [2, 33, 11, 2, 34, 12], - - // 6 - [2, 86, 68], - [4, 43, 27], - [4, 43, 19], - [4, 43, 15], - - // 7 - [2, 98, 78], - [4, 49, 31], - [2, 32, 14, 4, 33, 15], - [4, 39, 13, 1, 40, 14], - - // 8 - [2, 121, 97], - [2, 60, 38, 2, 61, 39], - [4, 40, 18, 2, 41, 19], - [4, 40, 14, 2, 41, 15], - - // 9 - [2, 146, 116], - [3, 58, 36, 2, 59, 37], - [4, 36, 16, 4, 37, 17], - [4, 36, 12, 4, 37, 13], - - // 10 - [2, 86, 68, 2, 87, 69], - [4, 69, 43, 1, 70, 44], - [6, 43, 19, 2, 44, 20], - [6, 43, 15, 2, 44, 16], - - // 11 - [4, 101, 81], - [1, 80, 50, 4, 81, 51], - [4, 50, 22, 4, 51, 23], - [3, 36, 12, 8, 37, 13], - - // 12 - [2, 116, 92, 2, 117, 93], - [6, 58, 36, 2, 59, 37], - [4, 46, 20, 6, 47, 21], - [7, 42, 14, 4, 43, 15], - - // 13 - [4, 133, 107], - [8, 59, 37, 1, 60, 38], - [8, 44, 20, 4, 45, 21], - [12, 33, 11, 4, 34, 12], - - // 14 - [3, 145, 115, 1, 146, 116], - [4, 64, 40, 5, 65, 41], - [11, 36, 16, 5, 37, 17], - [11, 36, 12, 5, 37, 13], - - // 15 - [5, 109, 87, 1, 110, 88], - [5, 65, 41, 5, 66, 42], - [5, 54, 24, 7, 55, 25], - [11, 36, 12], - - // 16 - [5, 122, 98, 1, 123, 99], - [7, 73, 45, 3, 74, 46], - [15, 43, 19, 2, 44, 20], - [3, 45, 15, 13, 46, 16], - - // 17 - [1, 135, 107, 5, 136, 108], - [10, 74, 46, 1, 75, 47], - [1, 50, 22, 15, 51, 23], - [2, 42, 14, 17, 43, 15], - - // 18 - [5, 150, 120, 1, 151, 121], - [9, 69, 43, 4, 70, 44], - [17, 50, 22, 1, 51, 23], - [2, 42, 14, 19, 43, 15], - - // 19 - [3, 141, 113, 4, 142, 114], - [3, 70, 44, 11, 71, 45], - [17, 47, 21, 4, 48, 22], - [9, 39, 13, 16, 40, 14], - - // 20 - [3, 135, 107, 5, 136, 108], - [3, 67, 41, 13, 68, 42], - [15, 54, 24, 5, 55, 25], - [15, 43, 15, 10, 44, 16], - - // 21 - [4, 144, 116, 4, 145, 117], - [17, 68, 42], - [17, 50, 22, 6, 51, 23], - [19, 46, 16, 6, 47, 17], - - // 22 - [2, 139, 111, 7, 140, 112], - [17, 74, 46], - [7, 54, 24, 16, 55, 25], - [34, 37, 13], - - // 23 - [4, 151, 121, 5, 152, 122], - [4, 75, 47, 14, 76, 48], - [11, 54, 24, 14, 55, 25], - [16, 45, 15, 14, 46, 16], - - // 24 - [6, 147, 117, 4, 148, 118], - [6, 73, 45, 14, 74, 46], - [11, 54, 24, 16, 55, 25], - [30, 46, 16, 2, 47, 17], - - // 25 - [8, 132, 106, 4, 133, 107], - [8, 75, 47, 13, 76, 48], - [7, 54, 24, 22, 55, 25], - [22, 45, 15, 13, 46, 16], - - // 26 - [10, 142, 114, 2, 143, 115], - [19, 74, 46, 4, 75, 47], - [28, 50, 22, 6, 51, 23], - [33, 46, 16, 4, 47, 17], - - // 27 - [8, 152, 122, 4, 153, 123], - [22, 73, 45, 3, 74, 46], - [8, 53, 23, 26, 54, 24], - [12, 45, 15, 28, 46, 16], - - // 28 - [3, 147, 117, 10, 148, 118], - [3, 73, 45, 23, 74, 46], - [4, 54, 24, 31, 55, 25], - [11, 45, 15, 31, 46, 16], - - // 29 - [7, 146, 116, 7, 147, 117], - [21, 73, 45, 7, 74, 46], - [1, 53, 23, 37, 54, 24], - [19, 45, 15, 26, 46, 16], - - // 30 - [5, 145, 115, 10, 146, 116], - [19, 75, 47, 10, 76, 48], - [15, 54, 24, 25, 55, 25], - [23, 45, 15, 25, 46, 16], - - // 31 - [13, 145, 115, 3, 146, 116], - [2, 74, 46, 29, 75, 47], - [42, 54, 24, 1, 55, 25], - [23, 45, 15, 28, 46, 16], - - // 32 - [17, 145, 115], - [10, 74, 46, 23, 75, 47], - [10, 54, 24, 35, 55, 25], - [19, 45, 15, 35, 46, 16], - - // 33 - [17, 145, 115, 1, 146, 116], - [14, 74, 46, 21, 75, 47], - [29, 54, 24, 19, 55, 25], - [11, 45, 15, 46, 46, 16], - - // 34 - [13, 145, 115, 6, 146, 116], - [14, 74, 46, 23, 75, 47], - [44, 54, 24, 7, 55, 25], - [59, 46, 16, 1, 47, 17], - - // 35 - [12, 151, 121, 7, 152, 122], - [12, 75, 47, 26, 76, 48], - [39, 54, 24, 14, 55, 25], - [22, 45, 15, 41, 46, 16], - - // 36 - [6, 151, 121, 14, 152, 122], - [6, 75, 47, 34, 76, 48], - [46, 54, 24, 10, 55, 25], - [2, 45, 15, 64, 46, 16], - - // 37 - [17, 152, 122, 4, 153, 123], - [29, 74, 46, 14, 75, 47], - [49, 54, 24, 10, 55, 25], - [24, 45, 15, 46, 46, 16], - - // 38 - [4, 152, 122, 18, 153, 123], - [13, 74, 46, 32, 75, 47], - [48, 54, 24, 14, 55, 25], - [42, 45, 15, 32, 46, 16], - - // 39 - [20, 147, 117, 4, 148, 118], - [40, 75, 47, 7, 76, 48], - [43, 54, 24, 22, 55, 25], - [10, 45, 15, 67, 46, 16], - - // 40 - [19, 148, 118, 6, 149, 119], - [18, 75, 47, 31, 76, 48], - [34, 54, 24, 34, 55, 25], - [20, 45, 15, 61, 46, 16] - ]; - - QRRSBlock.getRSBlocks = function(typeNumber, errorCorrectLevel) { - - var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel); - - if (rsBlock == undefined) { - throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel); - } - - var length = rsBlock.length / 3; - - var list = new Array(); - - for (var i = 0; i < length; i++) { - - var count = rsBlock[i * 3 + 0]; - var totalCount = rsBlock[i * 3 + 1]; - var dataCount = rsBlock[i * 3 + 2]; - - for (var j = 0; j < count; j++) { - list.push(new QRRSBlock(totalCount, dataCount)); - } - } - - return list; - } - - QRRSBlock.getRsBlockTable = function(typeNumber, errorCorrectLevel) { - - switch (errorCorrectLevel) { - case QRErrorCorrectLevel.L: - return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0]; - case QRErrorCorrectLevel.M: - return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1]; - case QRErrorCorrectLevel.Q: - return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2]; - case QRErrorCorrectLevel.H: - return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3]; - default: - return undefined; - } - } - - //--------------------------------------------------------------------- - // QRBitBuffer - //--------------------------------------------------------------------- - - function QRBitBuffer() { - this.buffer = new Array(); - this.length = 0; - } - - QRBitBuffer.prototype = { - - get: function(index) { - var bufIndex = Math.floor(index / 8); - return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) == 1; - }, - - put: function(num, length) { - for (var i = 0; i < length; i++) { - this.putBit(((num >>> (length - i - 1)) & 1) == 1); - } - }, - - getLengthInBits: function() { - return this.length; - }, - - putBit: function(bit) { - - var bufIndex = Math.floor(this.length / 8); - if (this.buffer.length <= bufIndex) { - this.buffer.push(0); - } - - if (bit) { - this.buffer[bufIndex] |= (0x80 >>> (this.length % 8)); - } - - this.length++; - } - }; - - //--------------------------------------------------------------------- - // Support Chinese - //--------------------------------------------------------------------- - function utf16To8(text) { - var result = ''; - var c; - for (var i = 0; i < text.length; i++) { - c = text.charCodeAt(i); - if (c >= 0x0001 && c <= 0x007F) { - result += text.charAt(i); - } else if (c > 0x07FF) { - result += String.fromCharCode(0xE0 | c >> 12 & 0x0F); - result += String.fromCharCode(0x80 | c >> 6 & 0x3F); - result += String.fromCharCode(0x80 | c >> 0 & 0x3F); - } else { - result += String.fromCharCode(0xC0 | c >> 6 & 0x1F); - result += String.fromCharCode(0x80 | c >> 0 & 0x3F); - } - } - return result; - } - - uQRCode = { - - errorCorrectLevel: QRErrorCorrectLevel, - - defaults: { - size: 354, - margin: 0, - backgroundColor: '#ffffff', - foregroundColor: '#000000', - fileType: 'png', // 'jpg', 'png' - errorCorrectLevel: QRErrorCorrectLevel.H, - typeNumber: -1 - }, - - make: function(options) { - return new Promise((reslove, reject) => { - var defaultOptions = { - canvasId: options.canvasId, - componentInstance: options.componentInstance, - text: options.text, - size: this.defaults.size, - margin: this.defaults.margin, - backgroundColor: this.defaults.backgroundColor, - foregroundColor: this.defaults.foregroundColor, - fileType: this.defaults.fileType, - errorCorrectLevel: this.defaults.errorCorrectLevel, - typeNumber: this.defaults.typeNumber - }; - if (options) { - for (var i in options) { - defaultOptions[i] = options[i]; - } - } - options = defaultOptions; - if (!options.canvasId) { - console.error('uQRCode: Please set canvasId!'); - return; - } - - function createCanvas() { - var qrcode = new QRCode(options.typeNumber, options.errorCorrectLevel); - qrcode.addData(utf16To8(options.text)); - qrcode.make(); - - var ctx = uni.createCanvasContext(options.canvasId, options.componentInstance); - ctx.setFillStyle(options.backgroundColor); - ctx.fillRect(0, 0, options.size, options.size); - - var tileW = (options.size - options.margin * 2) / qrcode.getModuleCount(); - var tileH = tileW; - - for (var row = 0; row < qrcode.getModuleCount(); row++) { - for (var col = 0; col < qrcode.getModuleCount(); col++) { - var style = qrcode.isDark(row, col) ? options.foregroundColor : options.backgroundColor; - ctx.setFillStyle(style); - var x = Math.round(col * tileW) + options.margin; - var y = Math.round(row * tileH) + options.margin; - var w = Math.ceil((col + 1) * tileW) - Math.floor(col * tileW); - var h = Math.ceil((row + 1) * tileW) - Math.floor(row * tileW); - ctx.fillRect(x, y, w, h); - } - } - - setTimeout(function() { - ctx.draw(false, (function() { - setTimeout(function() { - uni.canvasToTempFilePath({ - canvasId: options.canvasId, - fileType: options.fileType, - width: options.size, - height: options.size, - destWidth: options.size, - destHeight: options.size, - success: function(res) { - let resData; // 将统一为base64格式 - let tempFilePath = res.tempFilePath; // H5为base64,其他为相对路径 - - // #ifdef H5 - resData = tempFilePath; - options.success && options.success(resData); - reslove(resData); - // #endif - - // #ifdef APP-PLUS - const path = plus.io.convertLocalFileSystemURL(tempFilePath) // 绝对路径 - let fileReader = new plus.io.FileReader(); - fileReader.readAsDataURL(path); - fileReader.onloadend = res => { - resData = res.target.result; - options.success && options.success(resData); - reslove(resData); - }; - // #endif - - // #ifdef MP-WEIXIN || MP-QQ || MP-TOUTIAO - uni.getFileSystemManager().readFile({ - filePath: tempFilePath, - encoding: 'base64', - success: res => { - resData = 'data:image/png;base64,' + res.data; - options.success && options.success(resData); - reslove(resData); - } - }) - // #endif - - // #ifndef H5 || APP-PLUS || MP-WEIXIN || MP-QQ || MP-TOUTIAO - if (plus) { - const path = plus.io.convertLocalFileSystemURL(tempFilePath) // 绝对路径 - let fileReader = new plus.io.FileReader(); - fileReader.readAsDataURL(path); - fileReader.onloadend = res => { - resData = res.target.result; - options.success && options.success(resData); - reslove(resData); - }; - } else { - uni.request({ - url: tempFilePath, - method: 'GET', - responseType: 'arraybuffer', - success: res => { - resData = `data:image/png;base64,${uni.arrayBufferToBase64(res.data)}`; // 把arraybuffer转成base64 - options.success && options.success(resData); - reslove(resData); - } - }) - } - // #endif - }, - fail: function(error) { - options.fail && options.fail(error); - reject(error); - }, - complete: function(res) { - options.complete && options.complete(res); - } - }, options.componentInstance); - }, options.text.length + 100); - })()); - }, 150); - } - - createCanvas(); - }); - } - } - -})() - -export default uQRCode diff --git a/common/js/websocket.js b/common/js/websocket.js index de6ffd8..a4138e0 100644 --- a/common/js/websocket.js +++ b/common/js/websocket.js @@ -1,231 +1,350 @@ -class webSocketUtils { - constructor(url, time, params) { - this.socketTask = null; - this.is_open_socket = false; //避免重复连接 - this.url = url; - this.params = params ? params : null; ////是否初始化请求 - this.connectNum = 1; // 重连次数 - //这个参数是防止重连失败之后onClose方法会重复执行reconnect方法,导致重连定时器出问题 - //连接并打开之后可重连,且只执行重连方法一次 - this.canReconnect = false; // 是否可以重连 - //心跳检测 - this.timeout = time ? time : 5000; //多少秒执行检测 - this.heartbeatInterval = null; //检测服务器端是否还活着 - this.reconnectTimeOut = null; //重连之后多久再次重连 - try { - - return this.connectSocketInit({ - data: this.params, - type: 'connectSocketInit', - }); - } catch (e) { - // console.log('catch'); - this.reconnect(); - } - } - // 进入这个页面的时候创建websocket连接【整个页面随时使用】 - connectSocketInit(data) { - let _this = this; - this.data = data; - // #ifdef MP-WEIXIN - this.socketTask = uni.connectSocket({ - // #endif - // #ifdef MP-ALIPAY - my.connectSocket({ - // #endif - url: this.url, - success: (res) => { - console.log('创建websocketc成功...'); - // uni.hideLoading(); - // 返回实例 - return this.socketTask; - }, - fail: (res) => { - } - }); - - // #ifdef MP-WEIXIN - this.socketTask.onOpen((res) => { - // #endif - // #ifdef MP-ALIPAY - my.onSocketOpen((res) => { - // #endif - uni.hideLoading() - this.connectNum = 1; - console.log('WebSocket连接正常!==',res); - if (this.params) { //是否初始化请求 - this.send(this.params); - } - clearInterval(this.reconnectTimeOut); - clearInterval(this.heartbeatInterval); - this.is_open_socket = true; - this.canReconnect = true; - this.start(); - // 注:只有连接正常打开中 ,才能正常收到消息 - // #ifdef MP-WEIXIN - this.socketTask.onMessage((e) => { - // #endif - // #ifdef MP-ALIPAY - my.onSocketMessage((e)=>{ - // #endif - // 字符串转json - let res = JSON.parse(e.data); - uni.$emit('message', res) - // 普通socket信息处理 TODO - }); - }); - - // 监听连接失败,这里代码我注释掉的原因是因为如果服务器关闭后,和下面的onclose方法一起发起重连操作,这样会导致重复连接 - // #ifdef MP-WEIXIN - uni.onSocketError((res) => { - // #endif - // #ifdef MP-ALIPAY - my.onSocketError((res) => { - // #endif - console.log('网络断开,请检查!'); - this.socketTask = null; - this.is_open_socket = false; - // this.Close() - this.canReconnect = true; - clearInterval(this.heartbeatInterval); - clearInterval(this.reconnectTimeOut); - try { - if (this.connectNum <= 10) { - // uni.showLoading({ - // title: `网络连接失败,正尝试第${this.connectNum}次连接`, - // mask: true - // }) - uni.$emit('message', 1) //进行重连 - uni.showToast({ - title: `网络连接失败,正尝试第${this.connectNum}次连接`, - icon: 'none', - }); - this.reconnect(); - this.connectNum += 1; - } else { - // uni.$emit('connectError'); - uni.showToast({ - title: `网络连接失败,请检查网络!`, - icon: 'none', - }); - this.connectNum = 1; - this.canReconnect = false; - this.Close() - setTimeout(res => { - uni.switchTab({ - url: '/pages/index/index' - }) - uni.hideLoading() - }, 1000) +import { + ref, + onMounted, + onBeforeUnmount +} from 'vue'; + +const useWebSocket = (options = {}) => { + const { + heartbeatInterval = 10000, //心跳是10秒一次 + reconnectInterval = 3000, //重新连接间隔时间的一个参数 + maxReconnectAttempts = 3, //最大重连接次数 + initialReconnectInterval = 3000, // 初始重连间隔 + initMessage, + initMessageRetryCount = 3, // 新增:初始化消息发送重试次数 + initMessageRetryInterval = 2000, // 新增:初始化消息重试间隔 + maxReconnectDuration = Infinity + } = options; + + const autoReconnect = ref(true); //是否自动重新连接 + const socketTask = ref(null); + const isConnected = ref(false); //表示是否已连接上。 + const heartbeatTimer = ref(null); //心跳定时器 + const reconnectTimer = ref(null); //重连定时器 + const reconnectAttempts = ref(0); //重连的尝试次数 + const isNetworkConnected = ref(true); //监听当前网络连接状态 + const isManuallyClosed = ref(false); //是否是被手动关闭的 + const receivedMessages = ref(); //储从 WebSocket 服务器接收到的消息 + const initMessageSendAttempts = ref(0); //初始化连接多少次 + const reconnectStartTime = ref(0); //新增:记录重连开始时间 + const isPongReceived = ref(false) + const allowReconnect = ref(true); // 新增:控制是否允许重连 + // 关闭现有连接并清理资源 + const closeExistingConnection = () => { + if (socketTask.value) { + // 关闭 WebSocket 连接 + socketTask.value.close({ + success: () => { + console.log('WebSocket 连接已关闭'); + }, + fail: (err) => { + console.error('关闭 WebSocket 连接失败:', err); } - } catch (e) { - //TODO handle the exception - } - }); - // 这里仅是事件监听【如果socket关闭了会执行】 - // #ifdef MP-WEIXIN - this.socketTask.onClose(() => { - // #endif - // #ifdef MP-ALIPAY - my.onSocketClose((res) => { - // #endif - console.log("socket关闭了") - this.socketTask = null; - clearInterval(this.heartbeatInterval); - clearInterval(this.reconnectTimeOut); - // #ifdef MP-ALIPAY - // 支付宝小程序的ws连接问题,关闭连接时需关闭对于接受,防止关闭失败 - my.offSocketMessage(); - my.offSocketError(); - my.offSocketOpen(); - my.offSocketClose(); - // #endif - this.is_open_socket = false; - if (this.canReconnect) { - this.reconnect(); - this.canReconnect = false; - } - }); - } - // 主动关闭socket连接 - Close() { - this.is_open_socket = true; - this.canReconnect = false; - - // #ifdef MP-WEIXIN - if (this.socketTask) { - this.socketTask.close({ - success(res) { - console.log('手动关闭成功'); - }, }); + + // 清除心跳定时器 + clearInterval(heartbeatTimer.value); + heartbeatTimer.value = null; + + // 清除重连定时器 + clearTimeout(reconnectTimer.value); + reconnectTimer.value = null; + + // 标记连接已断开 + isConnected.value = false; } - // #endif - // #ifdef MP-ALIPAY - my.closeSocket({ - success(res) { - console.log('手动关闭成功'); - // #ifdef MP-ALIPAY - // 支付宝小程序的ws连接问题,关闭连接时需关闭对于接受,防止关闭失败 - my.offSocketMessage(); - my.offSocketError(); - my.offSocketOpen(); - my.offSocketClose(); - // #endif - + }; + + // 连接 WebSocket + const connect = () => { + if (!isNetworkConnected.value) { + uni.showToast({ + title: '网络未连接...', + icon: 'none' + }) + setTimeout(() => { + uni.pro.switchTab('index/index') + }, 1000) + console.log('网络未连接,暂不尝试连接 WebSocket'); + return; + } + + // 关闭现有连接并清理资源 + closeExistingConnection(); + + socketTask.value = uni.connectSocket({ + url: uni.conf.baseUrlwws, + success: (res) => { + isConnected.value = true; + // 监听初始化成功在开启心跳 + startHeartbeat(); }, - fail: (res) => { - console.log('手动关闭失败==',res); + fail: () => { + console.error('WebSocket 连接失败,尝试重连'); + if (autoReconnect.value && allowReconnect.value) { + handleReconnect(); + } } }); - // #endif - } - //发送消息 - send(data) { - // console.log("发送消息---------->", data); - // 注:只有连接正常打开中 ,才能正常成功发送消息 - - // #ifdef MP-WEIXIN - if (this.socketTask) { - this.socketTask.send({ + + if (socketTask.value) { + socketTask.value.onOpen(() => { + // 初始化 初始购物车 + sendMessage(initMessage) + }); + socketTask.value.onMessage((res) => { + receivedMessages.value = JSON.parse(res.data) + // receivedMessages.value.push(list); + if (receivedMessages.value == 'ok' || receivedMessages.value.operate_type == 'init') { + console.log('初始化正常,心跳响应正常'); + // 清除重连定时器 + clearTimeout(reconnectTimer.value); + allowReconnect.value = false + reconnectTimer.value = null; + } + + }); + + socketTask.value.onClose((res) => { + console.log(res, 'WebSocket 连接已关闭,尝试重连'); + isConnected.value = false; + clearInterval(heartbeatTimer.value); // 停止心跳定时器 + clearTimeout(reconnectTimer.value); // 清除重连定时器 + if (res.code == '1006' && !allowReconnect.value) { + uni.showToast({ + title: '网络异常,请重新扫码', + icon: 'none' + }); + autoReconnect.value = false; + setTimeout(() => { + uni.pro.switchTab('index/index'); + }, 1000) + return false; + } + if (autoReconnect.value && !isManuallyClosed.value) { + handleReconnect(); + } + }); + + socketTask.value.onError((err) => { + console.error('WebSocket 连接发生错误:', err); + isConnected.value = false; + clearInterval(heartbeatTimer.value); + if (autoReconnect.value && !isManuallyClosed.value) { + handleReconnect(); + } + }); + } else { + console.error('socketTask 未正确初始化'); + } + }; + + // 启动心跳机制 + const startHeartbeat = () => { + if (!isNetworkConnected.value) { + console.log('网络未连接,暂停心跳'); + uni.showToast({ + title: '网络未连接...', + icon: 'none' + }); + setTimeout(() => { + uni.pro.switchTab('index/index'); + }, 1000); + return; + } + heartbeatTimer.value = setInterval(() => { + if (isConnected.value) { + console.log('发送心跳消息'); + isPongReceived.value = false; // 每次发送心跳消息前重置标记 + socketTask.value.send({ + data: JSON.stringify({ + type: 'ping_interval', + set: 'shopping' + }), + success: () => { + console.log('心跳消息发送成功'); + const pongTimer = setTimeout(() => { + if (!isPongReceived.value) { + console.error('心跳超时,未收到响应,尝试重连'); + clearInterval(heartbeatTimer.value); + if (autoReconnect.value && reconnectAttempts.value < + maxReconnectAttempts && allowReconnect.value) { + handleReconnect(); + } else { + console.error('重连次数达到上限,停止重连和心跳'); + clearInterval(heartbeatTimer.value); + autoReconnect.value = false; + uni.pro.switchTab('index/index'); + } + } + }, heartbeatInterval * 1.2); + + const handlePong = (res) => { + try { + let data = JSON.parse(res.data); + if (data.operate_type == "init" || (data.msg === 'ok' && + data.msg_id == + 'ping_interval')) { + isPongReceived.value = true; + console.log('收到心跳响应,清除超时定时器'); + clearTimeout(pongTimer); + } + } catch (error) { + console.error('解析心跳响应数据时出错:', error); + } + }; + socketTask.value.onMessage(handlePong); + }, + fail: () => { + console.error('心跳消息发送失败,尝试重连'); + clearInterval(heartbeatTimer.value); + if (autoReconnect.value && reconnectAttempts.value < + maxReconnectAttempts && allowReconnect.value) { + handleReconnect(); + } else { + console.error('重连次数达到上限,停止重连和心跳'); + clearInterval(heartbeatTimer.value); + autoReconnect.value = false; + uni.pro.switchTab('index/index'); + } + } + }); + } + }, heartbeatInterval); + }; + + + // 手动关闭连接 + const closeSocket = () => { + isManuallyClosed.value = true; + closeExistingConnection(); + }; + + // 发送消息 + const sendMessage = async (data) => { + if (isConnected.value) { + await socketTask.value.send({ data: JSON.stringify(data), - async success() { - // console.log("消息发送成功"); + success: () => { + // console.log('消息发送成功'); }, + fail: () => { + // console.error('消息发送失败'); + } }); + } else { + console.error('WebSocket 未连接,无法发送消息'); } - // #endif - // #ifdef MP-ALIPAY - my.sendSocketMessage({ - data: JSON.stringify(data), - success(res) { - // console.log("消息发送成功"); + }; + + // 处理重连逻辑 + const handleReconnect = () => { + if (!isNetworkConnected.value) { + console.log('网络未连接,暂停重连'); + return; + } + if (isManuallyClosed.value) { + console.log('手动关闭连接,不进行重连'); + return; + } + + if (!allowReconnect.value) { + console.log('重连功能已关闭,不进行重连'); + return; + } + + if (reconnectAttempts.value < maxReconnectAttempts) { + reconnectAttempts.value++; + const reconnectInterval = initialReconnectInterval * Math.pow(2, reconnectAttempts.value - 1); + const randomizedInterval = reconnectInterval + Math.floor(Math.random() * 1000); + uni.showLoading({ + title: `正在努力连接..`, + mask: true + }) + console.log(`尝试第 ${reconnectAttempts.value} 次重连,重连间隔: ${randomizedInterval}ms...`); + + reconnectTimer.value = setTimeout(() => { + connect(); + }, randomizedInterval); + } else { + console.error('重连次数达到上限,停止重连'); + uni.showToast({ + title: '重连次数达到上限,停止重连', + icon: 'none' + }); + clearInterval(heartbeatTimer.value); + autoReconnect.value = false; + setTimeout(() => { + uni.hideLoading(); + uni.pro.switchTab('index/index'); + }, 1000) + } + }; + + + // / 网络状态监听 + const initNetworkListener = () => { + uni.getSystemInfo({ + success: (res) => { + if (res.platform !== 'devtools') { + uni.onNetworkStatusChange((statusRes) => { + isNetworkConnected.value = statusRes.isConnected; + if (statusRes.isConnected && !isManuallyClosed.value) { + console.log('网络已连接,尝试重新连接 WebSocket'); + if (!isConnected.value && autoReconnect.value) { + connect(); + } + } else if (!statusRes.isConnected) { + console.log('网络已断开,暂停 WebSocket 操作'); + clearInterval(heartbeatTimer.value); + clearTimeout(reconnectTimer.value); + if (socketTask.value) { + socketTask.value.close(); + isConnected.value = false; + } + } + }); + } }, + fail: (err) => { + console.error('获取系统信息失败:', err); + } }); - // #endif - } - //开启心跳检测 - start(data) { - // console.log('开启心跳检测', data) - this.heartbeatInterval = setInterval(() => { - this.send({ - data: '心跳检测', - type: 'heartbeat', - }); - }, this.timeout); - } - //重新连接 - reconnect() { - //停止发送心跳 - clearInterval(this.heartbeatInterval); - //如果不是人为关闭的话,进行重连 - if (!this.is_open_socket) { - console.log('进行重连'); - this.canReconnect = true; - this.reconnectTimeOut = setInterval(() => { - this.connectSocketInit(this.data); - }, this.timeout); + + uni.getNetworkType({ + success: (res) => { + isNetworkConnected.value = res.networkType !== 'none'; + if (!isNetworkConnected.value) { + console.log('初始网络未连接,暂不尝试连接 WebSocket'); + } + } + }); + }; + + // 页面显示,尝试连接 WebSocket + const onShowconnect = () => { + if (autoReconnect.value) { + uni.showLoading({ + title: `尝试再次连接`, + mask: true + }) + connect(); } } -} -module.exports = webSocketUtils; \ No newline at end of file + + onBeforeUnmount(() => { + closeSocket(); + }); + + return { + isConnected, + sendMessage, + closeSocket, + receivedMessages, + closeExistingConnection, + onShowconnect, + initNetworkListener + }; +}; + +export default useWebSocket; \ No newline at end of file diff --git a/components/CustomNavbar.vue b/components/CustomNavbar.vue index ac43e8f..11e04ad 100644 --- a/components/CustomNavbar.vue +++ b/components/CustomNavbar.vue @@ -33,25 +33,32 @@ reactive, watch, onMounted, - computed + computed, + toRefs, + watchEffect } from 'vue'; const store = useNavbarStore(); const { showBack, rightText, + showSearch, + title, isTransparent, height, - hasPlaceholder - } = store; - const showSearch = computed(() => store.showSearch); - const title = computed(() => store.title); + hasPlaceholder, + scrollTop + } = toRefs(store); + const keyword = ref() const goBack = () => { - uni.navigateBack({ - delta: 1 - }); + try { + uni.pro.switchTab('index/index') + } catch (error) { + uni.pro.switchTab('index/index') + //TODO handle the exception + } }; const onRightTextClick = () => { @@ -60,7 +67,7 @@ const navbarStyle = computed(() => { return { - height: `${height}px`, + // height: `${height}px`,store.showSearch=fa backgroundColor: store.scrollTop >= 44 ? '#fff' : 'transparent' }; }); @@ -69,22 +76,28 @@ oneStyle: {}, towStyle: {} }); + + watchEffect(() => { + if (store.showSearch > 44) { + + } + }) onMounted(() => { - // #ifdef MP-WEIXIN + // #ifdef MP-WEIXIN || MP-ALIPAY const menuButtonInfo = uni.getMenuButtonBoundingClientRect(); const systemInfo = uni.getSystemInfoSync(); const statusBarHeight = systemInfo.statusBarHeight; - console.log(menuButtonInfo) // 计算标题的垂直偏移量 + const verticalOffset = menuButtonInfo.top; // const verticalOffset = menuButtonInfo.top - statusBarHeight; - const verticalOffset = menuButtonInfo.top > menuButtonInfo.height ? menuButtonInfo.height : Math.abs( - menuButtonInfo.top - menuButtonInfo.height) + // const verticalOffset = menuButtonInfo.top > menuButtonInfo.height ? menuButtonInfo.height : Math.abs( + // menuButtonInfo.top - menuButtonInfo.height) const titleHeight = menuButtonInfo.height; centerContentStyle.oneStyle = { paddingTop: `${verticalOffset}px`, paddingRight: `${menuButtonInfo.width +20}px`, // paddingTeft: `${menuButtonInfo.width +20}px`, - height: `${height}px`, + // height: `${height}px`, boxSizing: 'border-box', }; centerContentStyle.towStyle = { diff --git a/components/Loading.vue b/components/Loading.vue new file mode 100644 index 0000000..c788fe2 --- /dev/null +++ b/components/Loading.vue @@ -0,0 +1,83 @@ + + + + + \ No newline at end of file diff --git a/components/indexnav.vue b/components/indexnav.vue index 9b5fe3a..b997475 100644 --- a/components/indexnav.vue +++ b/components/indexnav.vue @@ -29,16 +29,16 @@ + + \ No newline at end of file diff --git a/components/paymentMethod.vue b/components/paymentMethod.vue new file mode 100644 index 0000000..b766881 --- /dev/null +++ b/components/paymentMethod.vue @@ -0,0 +1,228 @@ + + + + + \ No newline at end of file diff --git a/framework/0-conf.js b/framework/0-conf.js index 195733c..2c4a371 100644 --- a/framework/0-conf.js +++ b/framework/0-conf.js @@ -1,31 +1,28 @@ -const debug = process.env.NODE_ENV == 'development' ? true : false; +// const debug = process.env.NODE_ENV == 'development' ? true : false; +const debug = false // #ifdef H5 const proxyApi = "/api" // #endif + // #ifdef MP-WEIXIN || APP || MP-ALIPAY -// const proxyApi = 'http://192.168.1.15:9888/cashierService' // 王伟 -// const proxyApi = 'http://192.168.1.27:9888/cashierService' // 帆哥 -// const proxyApiwws = 'ws://192.168.1.15:9888/netty' // 测试 -// const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试 -// const proxyApiwws = 'wss://wxcashiertest.sxczgkj.cn/netty' // 测试 -// const proxyApi = 'https://pre-cashier.sxczgkj.cn/cashierService' // 预发布 -// const proxyApiwws = 'wss://pre-cashier.sxczgkj.cn/netty' // 预发布 -const proxyApi = 'https://cashier.sxczgkj.cn/cashierService' // 线上 -const proxyApiwws = 'wss://cashier.sxczgkj.cn/netty' // 线上 +const proxyApi = 'http://192.168.1.31' // 调试地址 +const proxyApiwws = 'ws://192.168.1.31:2348' // 调试地址 +// 测试 +// const proxyApi = "https://fv901fw8033.vicp.fun" +// const proxyApiwws = 'wss://sockets.sxczgkj.com/wss' // #endif + // #ifdef H5 -const baseUrl = debug ? proxyApi + '/cashierService' : "https://cashier.sxczgkj.cn/cashierService" -const baseUrlwws = 'ws://cashier.sxczgkj.cn/cashierService' +const baseUrl = debug ? proxyApi : "https://tapi.cashier.sxczgkj.cn" +const baseUrlwws = 'wss://sockets.sxczgkj.com/wss' // #endif // #ifdef APP || MP-WEIXIN || MP-ALIPAY -const baseUrl = debug ? proxyApi : 'https://cashier.sxczgkj.cn/cashierService' // 线上 -const baseUrlwws = debug ? proxyApiwws : 'wss://cashier.sxczgkj.cn/netty' // 线上 - -// const baseUrl = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试 -// const baseUrlwws = 'wss://wxcashiertest.sxczgkj.cn/netty' // 测试 +const baseUrl = debug ? proxyApi : 'https://cashier.sxczgkj.com' // 线上 +const baseUrlwws = debug ? proxyApiwws : 'wss://czgeatws.sxczgkj.com/wss' // 线上 // #endif + // import VConsole from "./vConsole.js" // if (debug) { // new VConsole() diff --git a/framework/8-cache.js b/framework/8-cache.js index 591f927..ffb7c77 100644 --- a/framework/8-cache.js +++ b/framework/8-cache.js @@ -7,33 +7,32 @@ function get(key) { try { let res = uni.getStorageSync(key) - if (!res) { return '' } - // res = JSON.parse(res) - if (res.__expiretime && res.__expiretime < uni.utils.timestamp()) { + + + if (res.expiretime && res.expiretime < Date.now()) { remove(key) return '' } else { - try { - const parsed = JSON.parse(res); - C - } catch (e) { - return res - } - // // #ifdef H5 - // try { - // const parsed = JSON.parse(res); - // return typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed) ? parsed : '' - // } catch (e) { - // return res - // } - // // #endif - // // #ifndef H5 - // return res - // // #endif + // #ifdef APP-PLUS + return res.value + // #endif + // #ifdef H5 + res = JSON.parse(res) + return res.value + // #endif + // #ifdef MP-WEIXIN + return res.value + // #endif + // #ifdef MP-ALIPAY + return res.value + // #endif + + + } } catch (e) { return '' @@ -73,19 +72,13 @@ function getStorageData(key) { */ function set(key, value, expire = uni.conf.default_expire) { let cacheItem = {} - cacheItem = value + cacheItem.value = value // console.log(cacheItem) - // if (expire > 0) { - // cacheItem.__expiretime = uni.utils.timestamp() + expire - // } - // // #ifdef H5 - // uni.setStorageSync(key, JSON.stringify(cacheItem)) - // // #endif - // // #ifndef H5 - // uni.setStorageSync(key, cacheItem) - // // #endif - uni.setStorageSync(key, JSON.stringify(cacheItem)) - // uni.setStorageSync(key, cacheItem) + if (expire > 0) { + cacheItem.expiretime = Date.now() + expire * 60 * 1000; + } + // uni.setStorageSync(key,JSON.stringify(cacheItem)) + uni.setStorageSync(key, cacheItem) } /** @@ -156,7 +149,7 @@ function _removeExpired(key) { } res = JSON.parse(res) - if (res.__expiretime && res.__expiretime < uni.utils.timestamp()) { + if (res.expiretime && res.expiretime < uni.utils.timestamp()) { remove(key) } } diff --git a/package-lock.json b/package-lock.json index f8de150..7f4d7cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,1810 @@ { - "name": "wepp", + "name": "cashier_wx", "lockfileVersion": 3, "requires": true, "packages": { "": { "dependencies": { - "dayjs": "^1.11.13" + "dayjs": "^1.11.13", + "pinia": "^2.3.1", + "pinia-plugin-persistedstate": "^4.2.0" } }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.26.2", + "resolved": "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/code-frame/node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/@babel/compat-data": { + "version": "7.26.8", + "resolved": "https://registry.npmmirror.com/@babel/compat-data/-/compat-data-7.26.8.tgz", + "integrity": "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.26.9", + "resolved": "https://registry.npmmirror.com/@babel/core/-/core-7.26.9.tgz", + "integrity": "sha512-lWBYIrF7qK5+GjY5Uy+/hEgp8OJWOD/rpy74GplYRhEauvbHDeFB8t5hPOZxCZ0Oxf4Cc36tK51/l3ymJysrKw==", + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.9", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.9", + "@babel/parser": "^7.26.9", + "@babel/template": "^7.26.9", + "@babel/traverse": "^7.26.9", + "@babel/types": "^7.26.9", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.26.9", + "resolved": "https://registry.npmmirror.com/@babel/generator/-/generator-7.26.9.tgz", + "integrity": "sha512-kEWdzjOAUMW4hAyrzJ0ZaTOu9OmpyDIQicIh0zg0EEcEkYXZb2TjtBhnHi2ViX7PKwZqF4xwqfAm299/QMP3lg==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.26.9", + "@babel/types": "^7.26.9", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.26.5", + "resolved": "https://registry.npmmirror.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", + "integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.26.5", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.25.9", + "resolved": "https://registry.npmmirror.com/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.26.0", + "resolved": "https://registry.npmmirror.com/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.25.9", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.26.9", + "resolved": "https://registry.npmmirror.com/@babel/helpers/-/helpers-7.26.9.tgz", + "integrity": "sha512-Mz/4+y8udxBKdmzt/UjPACs4G3j5SshJJEFFKxlCGPydG4JAHXxjWjAwjd09tf6oINvl1VfMJo+nB7H2YKQ0dA==", + "license": "MIT", + "dependencies": { + "@babel/template": "^7.26.9", + "@babel/types": "^7.26.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.26.9", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.26.9.tgz", + "integrity": "sha512-81NWa1njQblgZbQHxWHpxxCzNsa3ZwvFqpUg7P+NNUU6f3UU2jBEg4OlF/J6rl8+PQGh1q6/zWScd001YwcA5A==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.26.9" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/standalone": { + "version": "7.26.9", + "resolved": "https://registry.npmmirror.com/@babel/standalone/-/standalone-7.26.9.tgz", + "integrity": "sha512-UTeQKy0kzJwWRe55kT1uK4G9H6D0lS6G4207hCU/bDaOhA5t2aC0qHN6GmID0Axv3OFLNXm27NdqcWp+BXcGtA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.26.9", + "resolved": "https://registry.npmmirror.com/@babel/template/-/template-7.26.9.tgz", + "integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/parser": "^7.26.9", + "@babel/types": "^7.26.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.26.9", + "resolved": "https://registry.npmmirror.com/@babel/traverse/-/traverse-7.26.9.tgz", + "integrity": "sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.9", + "@babel/parser": "^7.26.9", + "@babel/template": "^7.26.9", + "@babel/types": "^7.26.9", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.26.9", + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.26.9.tgz", + "integrity": "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmmirror.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmmirror.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmmirror.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nuxt/kit": { + "version": "3.15.4", + "resolved": "https://registry.npmmirror.com/@nuxt/kit/-/kit-3.15.4.tgz", + "integrity": "sha512-dr7I7eZOoRLl4uxdxeL2dQsH0OrbEiVPIyBHnBpA4co24CBnoJoF+JINuP9l3PAM3IhUzc5JIVq3/YY3lEc3Hw==", + "license": "MIT", + "dependencies": { + "c12": "^2.0.1", + "consola": "^3.4.0", + "defu": "^6.1.4", + "destr": "^2.0.3", + "globby": "^14.0.2", + "ignore": "^7.0.3", + "jiti": "^2.4.2", + "klona": "^2.0.6", + "knitwork": "^1.2.0", + "mlly": "^1.7.4", + "ohash": "^1.1.4", + "pathe": "^2.0.2", + "pkg-types": "^1.3.1", + "scule": "^1.3.0", + "semver": "^7.6.3", + "std-env": "^3.8.0", + "ufo": "^1.5.4", + "unctx": "^2.4.1", + "unimport": "^4.0.0", + "untyped": "^1.5.2" + }, + "engines": { + "node": ">=18.12.0" + } + }, + "node_modules/@sindresorhus/merge-streams": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", + "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "license": "MIT" + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.5.13.tgz", + "integrity": "sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/parser": "^7.25.3", + "@vue/shared": "3.5.13", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-core/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT", + "peer": true + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.5.13.tgz", + "integrity": "sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@vue/compiler-core": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.5.13.tgz", + "integrity": "sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/parser": "^7.25.3", + "@vue/compiler-core": "3.5.13", + "@vue/compiler-dom": "3.5.13", + "@vue/compiler-ssr": "3.5.13", + "@vue/shared": "3.5.13", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.11", + "postcss": "^8.4.48", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-sfc/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT", + "peer": true + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.5.13.tgz", + "integrity": "sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@vue/compiler-dom": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/devtools-api": { + "version": "6.6.4", + "resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz", + "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==", + "license": "MIT" + }, + "node_modules/@vue/reactivity": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.5.13.tgz", + "integrity": "sha512-NaCwtw8o48B9I6L1zl2p41OHo/2Z4wqYGGIK1Khu5T7yxrn+ATOixn/Udn2m+6kZKB/J7cuT9DbWWhRxqixACg==", + "license": "MIT", + "peer": true, + "dependencies": { + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.5.13.tgz", + "integrity": "sha512-Fj4YRQ3Az0WTZw1sFe+QDb0aXCerigEpw418pw1HBUKFtnQHWzwojaukAs2X/c9DQz4MQ4bsXTGlcpGxU/RCIw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@vue/reactivity": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.5.13.tgz", + "integrity": "sha512-dLaj94s93NYLqjLiyFzVs9X6dWhTdAlEAciC3Moq7gzAc13VJUdCnjjRurNM6uTLFATRHexHCTu/Xp3eW6yoog==", + "license": "MIT", + "peer": true, + "dependencies": { + "@vue/reactivity": "3.5.13", + "@vue/runtime-core": "3.5.13", + "@vue/shared": "3.5.13", + "csstype": "^3.1.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.5.13.tgz", + "integrity": "sha512-wAi4IRJV/2SAW3htkTlB+dHeRmpTiVIK1OGLWV1yeStVSebSQQOwGwIq0D3ZIoBj2C2qpgz5+vX9iEBkTdk5YA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@vue/compiler-ssr": "3.5.13", + "@vue/shared": "3.5.13" + }, + "peerDependencies": { + "vue": "3.5.13" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.5.13.tgz", + "integrity": "sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==", + "license": "MIT", + "peer": true + }, + "node_modules/acorn": { + "version": "8.14.1", + "resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.24.4", + "resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/c12": { + "version": "2.0.4", + "resolved": "https://registry.npmmirror.com/c12/-/c12-2.0.4.tgz", + "integrity": "sha512-3DbbhnFt0fKJHxU4tEUPmD1ahWE4PWPMomqfYsTJdrhpmEnRKJi3qSC4rO5U6E6zN1+pjBY7+z8fUmNRMaVKLw==", + "license": "MIT", + "dependencies": { + "chokidar": "^4.0.3", + "confbox": "^0.1.8", + "defu": "^6.1.4", + "dotenv": "^16.4.7", + "giget": "^1.2.4", + "jiti": "^2.4.2", + "mlly": "^1.7.4", + "ohash": "^2.0.4", + "pathe": "^2.0.3", + "perfect-debounce": "^1.0.0", + "pkg-types": "^1.3.1", + "rc9": "^2.1.2" + }, + "peerDependencies": { + "magicast": "^0.3.5" + }, + "peerDependenciesMeta": { + "magicast": { + "optional": true + } + } + }, + "node_modules/c12/node_modules/ohash": { + "version": "2.0.11", + "resolved": "https://registry.npmmirror.com/ohash/-/ohash-2.0.11.tgz", + "integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==", + "license": "MIT" + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001702", + "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001702.tgz", + "integrity": "sha512-LoPe/D7zioC0REI5W73PeR1e1MLCipRGq/VkovJnd6Df+QVqT+vT33OXCp8QUd7kA7RZrHWxb1B36OQKI/0gOA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/citty": { + "version": "0.1.6", + "resolved": "https://registry.npmmirror.com/citty/-/citty-0.1.6.tgz", + "integrity": "sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==", + "license": "MIT", + "dependencies": { + "consola": "^3.2.3" + } + }, + "node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmmirror.com/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "license": "MIT" + }, + "node_modules/consola": { + "version": "3.4.0", + "resolved": "https://registry.npmmirror.com/consola/-/consola-3.4.0.tgz", + "integrity": "sha512-EiPU8G6dQG0GFHNR8ljnZFki/8a+cQwEQ+7wpxdChl02Q8HXlwEZWD5lqAF8vC2sEC3Tehr8hy7vErz88LHyUA==", + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "license": "MIT" + }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "license": "MIT", + "peer": true + }, "node_modules/dayjs": { "version": "1.11.13", "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==", "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-pick-omit": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/deep-pick-omit/-/deep-pick-omit-1.2.1.tgz", + "integrity": "sha512-2J6Kc/m3irCeqVG42T+SaUMesaK7oGWaedGnQQK/+O0gYc+2SP5bKh/KKTE7d7SJ+GCA9UUE1GRzh6oDe0EnGw==", + "license": "MIT" + }, + "node_modules/defu": { + "version": "6.1.4", + "resolved": "https://registry.npmmirror.com/defu/-/defu-6.1.4.tgz", + "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==", + "license": "MIT" + }, + "node_modules/destr": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/destr/-/destr-2.0.3.tgz", + "integrity": "sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==", + "license": "MIT" + }, + "node_modules/dotenv": { + "version": "16.4.7", + "resolved": "https://registry.npmmirror.com/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.112", + "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.112.tgz", + "integrity": "sha512-oen93kVyqSb3l+ziUgzIOlWt/oOuy4zRmpwestMn4rhFWAoFJeFuCVte9F2fASjeZZo7l/Cif9TiyrdW4CwEMA==", + "license": "ISC" + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", + "peer": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/exsolve": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/exsolve/-/exsolve-1.0.2.tgz", + "integrity": "sha512-ZEcIMbthn2zeX4/wD/DLxDUjuCltHXT8Htvm/JFlTkdYgWh2+HGppgwwNUnIVxzxP7yJOPtuBAec0dLx6lVY8w==", + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmmirror.com/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.19.1", + "resolved": "https://registry.npmmirror.com/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmmirror.com/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmmirror.com/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/giget": { + "version": "1.2.5", + "resolved": "https://registry.npmmirror.com/giget/-/giget-1.2.5.tgz", + "integrity": "sha512-r1ekGw/Bgpi3HLV3h1MRBIlSAdHoIMklpaQ3OQLFcRw9PwAj2rqigvIbg+dBUI51OxVI2jsEtDywDBjSiuf7Ug==", + "license": "MIT", + "dependencies": { + "citty": "^0.1.6", + "consola": "^3.4.0", + "defu": "^6.1.4", + "node-fetch-native": "^1.6.6", + "nypm": "^0.5.4", + "pathe": "^2.0.3", + "tar": "^6.2.1" + }, + "bin": { + "giget": "dist/cli.mjs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmmirror.com/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/globby": { + "version": "14.1.0", + "resolved": "https://registry.npmmirror.com/globby/-/globby-14.1.0.tgz", + "integrity": "sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==", + "license": "MIT", + "dependencies": { + "@sindresorhus/merge-streams": "^2.1.0", + "fast-glob": "^3.3.3", + "ignore": "^7.0.3", + "path-type": "^6.0.0", + "slash": "^5.1.0", + "unicorn-magic": "^0.3.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ignore": { + "version": "7.0.3", + "resolved": "https://registry.npmmirror.com/ignore/-/ignore-7.0.3.tgz", + "integrity": "sha512-bAH5jbK/F3T3Jls4I0SO1hmPR0dKU0a7+SY6n1yzRtG54FLO8d6w/nxLFX2Nb7dBu6cCWXPaAME6cYqFUMmuCA==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmmirror.com/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/jiti": { + "version": "2.4.2", + "resolved": "https://registry.npmmirror.com/jiti/-/jiti-2.4.2.tgz", + "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==", + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/js-tokens": { + "version": "9.0.1", + "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/klona": { + "version": "2.0.6", + "resolved": "https://registry.npmmirror.com/klona/-/klona-2.0.6.tgz", + "integrity": "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/knitwork": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/knitwork/-/knitwork-1.2.0.tgz", + "integrity": "sha512-xYSH7AvuQ6nXkq42x0v5S8/Iry+cfulBz/DJQzhIyESdLD7425jXsPy4vn5cCXU+HhRN2kVw51Vd1K6/By4BQg==", + "license": "MIT" + }, + "node_modules/local-pkg": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/local-pkg/-/local-pkg-1.1.1.tgz", + "integrity": "sha512-WunYko2W1NcdfAFpuLUoucsgULmgDBRkdxHxWQ7mK0cQqwPiy8E1enjuRBrhLtZkB5iScJ1XIPdhVEFK8aOLSg==", + "license": "MIT", + "dependencies": { + "mlly": "^1.7.4", + "pkg-types": "^2.0.1", + "quansync": "^0.2.8" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/local-pkg/node_modules/confbox": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/confbox/-/confbox-0.2.1.tgz", + "integrity": "sha512-hkT3yDPFbs95mNCy1+7qNKC6Pro+/ibzYxtM2iqEigpf0sVw+bg4Zh9/snjsBcf990vfIsg5+1U7VyiyBb3etg==", + "license": "MIT" + }, + "node_modules/local-pkg/node_modules/pkg-types": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/pkg-types/-/pkg-types-2.1.0.tgz", + "integrity": "sha512-wmJwA+8ihJixSoHKxZJRBQG1oY8Yr9pGLzRmSsNms0iNWyHHAlZCa7mmKiFR10YPZuz/2k169JiS/inOjBCZ2A==", + "license": "MIT", + "dependencies": { + "confbox": "^0.2.1", + "exsolve": "^1.0.1", + "pathe": "^2.0.3" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/lru-cache/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "license": "ISC" + }, + "node_modules/magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmmirror.com/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmmirror.com/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmmirror.com/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mlly": { + "version": "1.7.4", + "resolved": "https://registry.npmmirror.com/mlly/-/mlly-1.7.4.tgz", + "integrity": "sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==", + "license": "MIT", + "dependencies": { + "acorn": "^8.14.0", + "pathe": "^2.0.1", + "pkg-types": "^1.3.0", + "ufo": "^1.5.4" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-fetch-native": { + "version": "1.6.6", + "resolved": "https://registry.npmmirror.com/node-fetch-native/-/node-fetch-native-1.6.6.tgz", + "integrity": "sha512-8Mc2HhqPdlIfedsuZoc3yioPuzp6b+L5jRCRY1QzuWZh2EGJVQrGppC6V6cF0bLdbW0+O2YpqCA25aF/1lvipQ==", + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmmirror.com/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "license": "MIT" + }, + "node_modules/nypm": { + "version": "0.5.4", + "resolved": "https://registry.npmmirror.com/nypm/-/nypm-0.5.4.tgz", + "integrity": "sha512-X0SNNrZiGU8/e/zAB7sCTtdxWTMSIO73q+xuKgglm2Yvzwlo8UoC5FNySQFCvl84uPaeADkqHUZUkWy4aH4xOA==", + "license": "MIT", + "dependencies": { + "citty": "^0.1.6", + "consola": "^3.4.0", + "pathe": "^2.0.3", + "pkg-types": "^1.3.1", + "tinyexec": "^0.3.2", + "ufo": "^1.5.4" + }, + "bin": { + "nypm": "dist/cli.mjs" + }, + "engines": { + "node": "^14.16.0 || >=16.10.0" + } + }, + "node_modules/ohash": { + "version": "1.1.6", + "resolved": "https://registry.npmmirror.com/ohash/-/ohash-1.1.6.tgz", + "integrity": "sha512-TBu7PtV8YkAZn0tSxobKY2n2aAQva936lhRrj6957aDaCf9IEtqsKbgMzXE/F/sjqYOwmrukeORHNLe5glk7Cg==", + "license": "MIT" + }, + "node_modules/path-type": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/path-type/-/path-type-6.0.0.tgz", + "integrity": "sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "license": "MIT" + }, + "node_modules/perfect-debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/perfect-debounce/-/perfect-debounce-1.0.0.tgz", + "integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmmirror.com/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pinia": { + "version": "2.3.1", + "resolved": "https://registry.npmmirror.com/pinia/-/pinia-2.3.1.tgz", + "integrity": "sha512-khUlZSwt9xXCaTbbxFYBKDc/bWAGWJjOgvxETwkTN7KRm66EeT1ZdZj6i2ceh9sP2Pzqsbc704r2yngBrxBVug==", + "license": "MIT", + "dependencies": { + "@vue/devtools-api": "^6.6.3", + "vue-demi": "^0.14.10" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "typescript": ">=4.4.4", + "vue": "^2.7.0 || ^3.5.11" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/pinia-plugin-persistedstate": { + "version": "4.2.0", + "resolved": "https://registry.npmmirror.com/pinia-plugin-persistedstate/-/pinia-plugin-persistedstate-4.2.0.tgz", + "integrity": "sha512-3buhA7ac+ssbOIx3VRCC8oHkoFwhDM9oHRCjo7nj+O8WUqnW+jRqh7eYT5eS/DNa3H28zp3dYf/nd/Vc8zj8eQ==", + "license": "MIT", + "dependencies": { + "@nuxt/kit": "^3.14.1592", + "deep-pick-omit": "^1.2.1", + "defu": "^6.1.4", + "destr": "^2.0.3" + }, + "peerDependencies": { + "@pinia/nuxt": ">=0.9.0", + "pinia": ">=2.3.0" + }, + "peerDependenciesMeta": { + "@pinia/nuxt": { + "optional": true + }, + "pinia": { + "optional": true + } + } + }, + "node_modules/pkg-types": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/pkg-types/-/pkg-types-1.3.1.tgz", + "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", + "license": "MIT", + "dependencies": { + "confbox": "^0.1.8", + "mlly": "^1.7.4", + "pathe": "^2.0.1" + } + }, + "node_modules/postcss": { + "version": "8.5.3", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.3.tgz", + "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "nanoid": "^3.3.8", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/quansync": { + "version": "0.2.8", + "resolved": "https://registry.npmmirror.com/quansync/-/quansync-0.2.8.tgz", + "integrity": "sha512-4+saucphJMazjt7iOM27mbFCk+D9dd/zmgMDCzRZ8MEoBfYp7lAvoN38et/phRQF6wOPMy/OROBGgoWeSKyluA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/antfu" + }, + { + "type": "individual", + "url": "https://github.com/sponsors/sxzz" + } + ], + "license": "MIT" + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmmirror.com/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/rc9": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/rc9/-/rc9-2.1.2.tgz", + "integrity": "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==", + "license": "MIT", + "dependencies": { + "defu": "^6.1.4", + "destr": "^2.0.3" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmmirror.com/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/scule": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/scule/-/scule-1.3.0.tgz", + "integrity": "sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmmirror.com/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/std-env": { + "version": "3.8.1", + "resolved": "https://registry.npmmirror.com/std-env/-/std-env-3.8.1.tgz", + "integrity": "sha512-vj5lIj3Mwf9D79hBkltk5qmkFI+biIKWS2IBxEyEU3AX1tUf7AoL8nSazCOiiqQsGKIq01SClsKEzweu34uwvA==", + "license": "MIT" + }, + "node_modules/strip-literal": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/strip-literal/-/strip-literal-3.0.0.tgz", + "integrity": "sha512-TcccoMhJOM3OebGhSBEmp3UZ2SfDMZUEBdRA/9ynfLi8yYajyWX3JiXArcJt4Umh4vISpspkQIY8ZZoCqjbviA==", + "license": "MIT", + "dependencies": { + "js-tokens": "^9.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmmirror.com/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmmirror.com/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.12", + "resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.12.tgz", + "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", + "license": "MIT", + "dependencies": { + "fdir": "^6.4.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.3", + "resolved": "https://registry.npmmirror.com/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ufo": { + "version": "1.5.4", + "resolved": "https://registry.npmmirror.com/ufo/-/ufo-1.5.4.tgz", + "integrity": "sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==", + "license": "MIT" + }, + "node_modules/unctx": { + "version": "2.4.1", + "resolved": "https://registry.npmmirror.com/unctx/-/unctx-2.4.1.tgz", + "integrity": "sha512-AbaYw0Nm4mK4qjhns67C+kgxR2YWiwlDBPzxrN8h8C6VtAdCgditAY5Dezu3IJy4XVqAnbrXt9oQJvsn3fyozg==", + "license": "MIT", + "dependencies": { + "acorn": "^8.14.0", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.17", + "unplugin": "^2.1.0" + } + }, + "node_modules/unicorn-magic": { + "version": "0.3.0", + "resolved": "https://registry.npmmirror.com/unicorn-magic/-/unicorn-magic-0.3.0.tgz", + "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/unimport": { + "version": "4.1.2", + "resolved": "https://registry.npmmirror.com/unimport/-/unimport-4.1.2.tgz", + "integrity": "sha512-oVUL7PSlyVV3QRhsdcyYEMaDX8HJyS/CnUonEJTYA3//bWO+o/4gG8F7auGWWWkrrxBQBYOO8DKe+C53ktpRXw==", + "license": "MIT", + "dependencies": { + "acorn": "^8.14.0", + "escape-string-regexp": "^5.0.0", + "estree-walker": "^3.0.3", + "local-pkg": "^1.0.0", + "magic-string": "^0.30.17", + "mlly": "^1.7.4", + "pathe": "^2.0.3", + "picomatch": "^4.0.2", + "pkg-types": "^1.3.1", + "scule": "^1.3.0", + "strip-literal": "^3.0.0", + "tinyglobby": "^0.2.11", + "unplugin": "^2.2.0", + "unplugin-utils": "^0.2.4" + }, + "engines": { + "node": ">=18.12.0" + } + }, + "node_modules/unimport/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/unplugin": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-2.2.0.tgz", + "integrity": "sha512-m1ekpSwuOT5hxkJeZGRxO7gXbXT3gF26NjQ7GdVHoLoF8/nopLcd/QfPigpCy7i51oFHiRJg/CyHhj4vs2+KGw==", + "license": "MIT", + "dependencies": { + "acorn": "^8.14.0", + "webpack-virtual-modules": "^0.6.2" + }, + "engines": { + "node": ">=18.12.0" + } + }, + "node_modules/unplugin-utils": { + "version": "0.2.4", + "resolved": "https://registry.npmmirror.com/unplugin-utils/-/unplugin-utils-0.2.4.tgz", + "integrity": "sha512-8U/MtpkPkkk3Atewj1+RcKIjb5WBimZ/WSLhhR3w6SsIj8XJuKTacSP8g+2JhfSGw0Cb125Y+2zA/IzJZDVbhA==", + "license": "MIT", + "dependencies": { + "pathe": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=18.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" + } + }, + "node_modules/unplugin-utils/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/untyped": { + "version": "1.5.2", + "resolved": "https://registry.npmmirror.com/untyped/-/untyped-1.5.2.tgz", + "integrity": "sha512-eL/8PlhLcMmlMDtNPKhyyz9kEBDS3Uk4yMu/ewlkT2WFbtzScjHWPJLdQLmaGPUKjXzwe9MumOtOgc4Fro96Kg==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.26.0", + "@babel/standalone": "^7.26.4", + "@babel/types": "^7.26.3", + "citty": "^0.1.6", + "defu": "^6.1.4", + "jiti": "^2.4.1", + "knitwork": "^1.2.0", + "scule": "^1.3.0" + }, + "bin": { + "untyped": "dist/cli.mjs" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/vue": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.13.tgz", + "integrity": "sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@vue/compiler-dom": "3.5.13", + "@vue/compiler-sfc": "3.5.13", + "@vue/runtime-dom": "3.5.13", + "@vue/server-renderer": "3.5.13", + "@vue/shared": "3.5.13" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vue-demi": { + "version": "0.14.10", + "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.10.tgz", + "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, + "node_modules/webpack-virtual-modules": { + "version": "0.6.2", + "resolved": "https://registry.npmmirror.com/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz", + "integrity": "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==", + "license": "MIT" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" } } } diff --git a/package.json b/package.json index 59eca92..52b8f6c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,8 @@ { "dependencies": { + "@dcloudio/uni-app": "^2.0.2-4040520250103001", "dayjs": "^1.11.13", + "jsbarcode": "^3.11.6", "pinia": "^2.3.1", "pinia-plugin-persistedstate": "^4.2.0" } diff --git a/pages.json b/pages.json index 158022d..bf4d013 100644 --- a/pages.json +++ b/pages.json @@ -12,14 +12,25 @@ "path": "pages/index/index", "style": { "navigationBarTitleText": "", - "navigationStyle": "custom" + "navigationStyle": "custom", + "mp-alipay": { + "transparentTitle": "always", + "titlePenetrate": "YES", + "autoBackButton": false, + "allowsBounceVertical": "NO" + } } }, { - "path": "pages/index/indexs", + "path": "pages/index/drinks", "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" + "navigationBarTitleText": "咖啡饮品" + } + }, + { + "path": "pages/index/freedaily", + "style": { + "navigationBarTitleText": "每日免单" } }, { @@ -35,6 +46,7 @@ "navigationBarTitleText": "红包中心" } }, + { "path": "pages/product/index", "style": { @@ -42,6 +54,30 @@ "navigationStyle": "custom" } }, + { + "path": "pages/product/choosetable", + "style": { + "navigationBarTitleText": "选择人数" + } + }, + { + "path": "pages/order/index", + "style": { + "navigationBarTitleText": "订单列表" + } + }, + { + "path": "pages/order/detail", + "style": { + "navigationBarTitleText": "订单详情" + } + }, + { + "path": "pages/order/coupon", + "style": { + "navigationBarTitleText": "优惠劵" + } + }, { "path": "pages/user/user", "style": { @@ -54,6 +90,77 @@ "allowsBounceVertical": "NO" } } + }, + { + "path": "pages/user/member/index", + "style": { + "navigationBarTitleText": "会员充值" + } + }, + { + "path": "pages/user/member/list", + "style": { + "navigationBarTitleText": "会员列表" + } + }, + { + "path": "pages/user/member/memberdetails", + "style": { + "navigationBarTitleText": "会员卡" + } + }, + { + "path": "pages/user/member/paycode", + "style": { + "navigationBarTitleText": "会员支付码" + } + }, + { + "path": "pages/user/member/billDetails", + "style": { + "navigationBarTitleText": "账单明细" + } + }, + { + "path": "pages/user/member/qrcode", + "style": { + "navigationBarTitleText": "会员支付码" + } + }, { + "path": "pages/user/member/setPassword", + "style": { + "navigationBarTitleText": "密码设置" + } + }, + { + "path": "pages/user/member/storedManage", + "style": { + "navigationBarTitleText": "会员管理" + } + }, + { + "path": "pages/user/member/instructions", + "style": { + "navigationBarTitleText": "使用须知" + } + }, + { + "path": "pages/user/myself", + "style": { + "navigationBarTitleText": "个人资料" + } + }, + { + "path": "pages/user/coupon", + "style": { + "navigationBarTitleText": "优惠劵" + } + }, + { + "path": "pages/subscribeto/index", + "style": { + "navigationBarTitleText": "叫号" + } } ], "uniIdRouter": {}, @@ -73,6 +180,11 @@ "selectedIconPath": "static/tabbar/1-1.png", "pagePath": "pages/index/index", "text": "首页" + }, { + "iconPath": "static/tabbar/2.png", + "selectedIconPath": "static/tabbar/2-1.png", + "pagePath": "pages/order/index", + "text": "订单列表" }, { "iconPath": "static/tabbar/4.png", diff --git a/pages/index/components/advertisement.vue b/pages/index/components/advertisement.vue index 0a7269a..31c7886 100644 --- a/pages/index/components/advertisement.vue +++ b/pages/index/components/advertisement.vue @@ -3,11 +3,12 @@ 现有 {{bannervo.coupons==null?116:bannervo.coupons}}人 + 已免单 - + + + + + + - + {{item.name}}已省{{item.money}}元钱 - + @@ -35,7 +43,9 @@ defineProps, onBeforeUnmount, reactive, - defineExpose + defineExpose, + ref, + watch } from 'vue'; const props = defineProps({ bannervo: { @@ -51,6 +61,13 @@ }] // } }); + + const listData = ref() + const listdataNumber = ref(4) + watch(() => props.bannervo, (n, o) => { + listData.value = [...props.bannervo,...props.bannervo] + }) + const slideNote = reactive({ x: 0, y: 0 @@ -137,6 +154,11 @@ align-items: center; justify-content: center; + .swiperstyle { + position: relative; + animation: animationName 5s linear infinite; + } + .onecontentrightimage { width: 65rpx; position: relative; @@ -207,7 +229,7 @@ .onecontentrighttext { width: 232rpx; - +margin-left: 20rpx; .swiper { height: 28rpx; // width: 232rpx; @@ -239,4 +261,16 @@ z-index: 9999; } } + + @keyframes animationName { + 0% { + /* 动画开始时的样式 */ + left: 0; + } + + 100% { + /* 动画结束时的样式 */ + left: -290rpx; + } + } \ No newline at end of file diff --git a/pages/index/components/diamond.vue b/pages/index/components/diamond.vue index 170e7ef..14242b3 100644 --- a/pages/index/components/diamond.vue +++ b/pages/index/components/diamond.vue @@ -1,10 +1,12 @@ @@ -14,15 +16,12 @@ defineProps } from 'vue'; import { - APIproductqueryShop - } from "@/common/api/product/product.js"; - import { - Storelogin - } from '@/stores/share.js'; + productStore + } from '@/stores/user.js'; const props = defineProps({ district: Array }); - const clickdistrict = (item) => { + const clickdistrict = async (item) => { switch (item.jumpType) { case 'absolute': uni.pro.navigateTo('webview/webview', { @@ -36,47 +35,13 @@ uni.pro.navigateTo(item.absUrl); break; case 'scan': + // #ifndef H5 if (!uni.utils.pluschooseImage()) { return false } - // #ifdef APP || MP-WEIXIN || MP-ALIPAY - uni.scanCode({ - success: async (res) => { - let tableCode = getQueryString(decodeURIComponent(res.result), 'code') - uni.cache.set('tableCode', tableCode) - if (tableCode) { - let data = await APIproductqueryShop({ - code: uni.cache.get('tableCode'), - }) - // -4请求登录 - const store = Storelogin(); - if (data.code == '-4') { - if (await store.actionslogin()) { - // 成功 - } else { - // 失败接着请求 - await store.actionslogin() - } - } - if (data.data.shopTableInfo && !data.data.shopTableInfo.choseCount) { - uni.pro.navigateTo('/pagesOrder/orderAMeal/index', { - tableCode: tableCode, - shopId: data.data.storeInfo.id, - }) - } else { - uni.pro.navigateTo('order_food/order_food', { - tableCode: tableCode, - }) - } - - } - }, - fail: (res) => { - console.log(res) - } - }); // #endif - + const store = productStore(); + await store.scanCodeactions() break; } } @@ -121,8 +86,8 @@ } } - .towcontent_item:nth-child(1) { - margin-left: 0rpx; - } + // .towcontent_item:nth-child(1) { + // margin-left: 0rpx; + // } } \ No newline at end of file diff --git a/pages/index/components/todaylist.vue b/pages/index/components/todaylist.vue index cf26cf2..3970cce 100644 --- a/pages/index/components/todaylist.vue +++ b/pages/index/components/todaylist.vue @@ -1,9 +1,9 @@ @@ -148,7 +138,8 @@ reactive, onBeforeUnmount, watch, - getCurrentInstance + getCurrentInstance, + nextTick } from "vue"; import { onLoad, @@ -171,14 +162,19 @@ import Nav from '@/components/indexnav.vue'; //导航栏 import { APIhomehomePageUp, - APIhome, - APIshopUserInfo + APIhome } from "@/common/api/index/index.js" + import { + APIgeocodelocation + } from "@/common/api/api.js" import { useNavbarStore } from '@/stores/navbarStore'; + import { + productStore + } from '@/stores/user.js'; const store = useNavbarStore(); - // 动态更新导航栏配置 + const storeuser = productStore(); store.updateNavbarConfig({ showBack: true, //左边返回键 rightText: '', //右边文字 @@ -191,8 +187,8 @@ const showindex = ref('index') //计算广告图片的重合尺寸是位移 const getStyle = (e) => { - if (e > hometoplist.bannervo.counponsInfo.length / 2) { - var right = hometoplist.bannervo.counponsInfo.length - e + if (e > hometoplist.freeBannerList.length / 2) { + var right = hometoplist.freeBannerList.length - e return { transform: 'scale(' + (1) + ') translate(-' + (right * 20) + '%,0px)', zIndex: 9999 - right, @@ -210,32 +206,36 @@ const refbannervo = ref(null); //数据 const hometoplist = reactive({ - bannervo: { - counponsInfo: [], - coupons: '' - } + }) // 首页上面数据 const hometop = async () => { try { let res = await APIhomehomePageUp() - Object.assign(hometoplist, res.data) - if (hometoplist.bannervo.counponsInfo) { - hometoplist.bannervo.counponsInfo.forEach((item, index) => { - advertisementStyle.value.push(getStyle(index)) - }) - } + Object.assign(hometoplist, res) + hometoplist.freeBannerList.forEach((item, index) => { + advertisementStyle.value.push(getStyle(index)) + }) + // 数据加载完后获取dom 高度 + setTimeout(() => { + const query = uni.createSelectorQuery().select('#fourcontent'); + query.boundingClientRect((rect) => { + elementTop.value = rect.top - store.height + }).exec(); + }, 500) } catch (e) {} } // 下面初始数据 const formhomelist = reactive({ //筛选 address: '', //地址 - type: '', //品类 - orderBy: '', //1.理我最近 2.销量优先 3.价格优先 - other: '', //附近1KM 1选中 0不选中 + categoryId: '1', //品类 + orderType: '1', //1.理我最近 2.销量优先 3.价格优先 + distanceType: '1000', //附近1KM 1选中 0不选中 page: 1, //页数 size: 10, //页容量 - status: 'loadmore' + status: 'loadmore', + name: '1', + list: [] }) // 使用 reactive 创建响应式对象 const timeData = ref({}); @@ -244,12 +244,11 @@ const onChange = (e) => { timeData.value = e; }; - const homelist = ref([]) //接收数据 const onLoadhome = async () => { try { let res = await APIhome(formhomelist) var dates = new Date().getTime(); - res.data.list.forEach((item, index) => { + res.records.forEach((item, index) => { var leftTime = item.endTime - dates; //计算两日期之间相差的毫秒数 if (leftTime >= 0) { let d = Math.floor(leftTime / 1000 / 60 / 60 / 24); @@ -266,36 +265,40 @@ item.end_times = 0 } }) - if (res.data.pages < formhomelist.page) { + if ((res.totalPage == 0 || res.totalPage == 1) && res.totalRow <= 10) { + console.log(res) formhomelist.status = 'nomore' - if (form.page == 1 && res.data.list.length == 0) { - + formhomelist.list = res.records + if (formhomelist.page == 1 && res.records.length == 0) { + formhomelist.list = [] } return false; } else { formhomelist.status = 'loading'; + if (formhomelist.page == 1) { + formhomelist.list = res.records + } else { + formhomelist.list = [...formhomelist.list, ...res.records]; + } formhomelist.page = ++formhomelist.page; - setTimeout(() => { - homelist.value = [...homelist.value, ...res.data.list]; + if (formhomelist.page > res.totalPage) { + formhomelist.status = 'nomore'; + } else { formhomelist.status = 'loading'; - if (res.data.pageNum == res.data.pages) { - formhomelist.status = 'nomore'; - } else { - formhomelist.status = 'loading'; - } - }, 500) + } } + } catch (e) {} } // /筛选数据处理 const init_fn = async () => { - homelist.value = [] + formhomelist.list = [] Object.assign(formhomelist, { address: uni.cache.get('getLocationstorage').address, //地址 lng: uni.cache.get('getLocationstorage').lng, lat: uni.cache.get('getLocationstorage').lat, type: '', //品类 - orderBy: 0, //1.理我最近 2.销量优先 3.价格优先 + // orderBy: 0, //1.理我最近 2.销量优先 3.价格优先 other: '', //附近1KM 1选中 0不选中 page: 1, //页数 size: 10, //页容量 @@ -304,11 +307,15 @@ onLoadhome() } + const orderVIP = ref({ + shopExtendList:'' + }) + // 弹出层处理 const showproductlist = ref(false); // 定义方法 const openproductlist = (e) => { - hometoplist.menu[viewHistoryindex.value].name = e //下标更改name + hometoplist.menuList[viewHistoryindex.value].name = e //下标更改name showproductlist.value = !showproductlist.value } @@ -328,7 +335,7 @@ } // 是否有弹出层 if (item.isChild) { - showproductlist.value = showproductlist.value ? viewHistoryindex.value == index ? false : true : ! + showproductlist.value = showproductlist.value ? (viewHistoryindex.value == index ? false : true) : ! showproductlist.value } viewHistoryindex.value = index @@ -338,32 +345,70 @@ isSticky.value = res.scrollTop > elementTop.value ? true : false uni.$u.debounce(store.scrollTop = res.scrollTop, 500) }); - onShow(() => {}) - onMounted(async () => { - await proxy.$onLaunched; - console.log(uni.cache.get('shopId')) - if (uni.cache.get('shopId') && uni.cache.get('token')) { - showindex.value = 'shopIndex' - let res = await APIshopUserInfo({ - "shopId": uni.cache.get('shopId'), - "userId": uni.getStorageSync('userInfo').id, - }) - if (res.code == 0) { - //商家信息 - uni.cache.set('shopUserInfo', res.data) + onShow(async () => { + try { + uni.getLocation({ + type: 'wgs84', + success: async (res) => { + let successres = await APIgeocodelocation({ + lng: res.longitude, + lat: res.latitude, + }) + if (successres) { + let datastorage = { + country: successres.addressComponent.country, // "中国" + province: successres.addressComponent + .province, //province: "陕西省" + address: successres.addressComponent.city, //district: "西安市" + district: successres.addressComponent.district, //district: "未央区" + lng: res.longitude, + lat: res.latitude, + } + uni.cache.set('getLocationstorage', datastorage); + // 登录 + proxy.$isResolve() + } + }, + + }); + } catch (error) { + try { + let successres = await APIgeocodelocation({ + lng: '', + lat: '', + }) + if (successres) { + let datastorage = { + country: successres.addressComponent.country, // "中国" + province: successres.addressComponent + .province, //province: "陕西省" + address: successres.addressComponent.city, //district: "西安市" + district: successres.addressComponent.district, //district: "未央区" + lng: res.longitude, + lat: res.latitude, + } + uni.cache.set('getLocationstorage', datastorage); + proxy.$isResolve() + } + } catch (error) { + } + } + await proxy.$onLaunched; + if (uni.cache.get('shopId')) { + showindex.value = 'shopIndex' + await storeuser.actionsproductqueryProduct() + await nextTick() + orderVIP.value = uni.cache.get('orderVIP') } else { + showindex.value = 'index' hometop() init_fn() - showindex.value = 'index' // 获取初始定位高度 - setTimeout(() => { - const query = uni.createSelectorQuery().select('#fourcontent'); - query.boundingClientRect((rect) => { - elementTop.value = rect.top - store.height - }).exec(); - }, 500) } + }) + onMounted(async () => { + }); onReachBottom(() => { @@ -383,16 +428,22 @@ background: #F9F9F9; .fourcontent { + position: sticky; padding: 32rpx 0; overflow-x: auto; flex-wrap: nowrap; background: #f9f9f9; - margin: 0 32rpx; + z-index: 99; + left: 0; + + .flex-between { + margin: 0 32rpx; + } .componentsclass { margin-top: 32rpx; left: 0; - position: absolute; + position: relative; width: 100%; height: 100vh; transition-duration: 350ms; @@ -417,9 +468,9 @@ background: #fee06a; } - .fourcontent_item:nth-child(1) { - margin-left: 0; - } + // .fourcontent_item:nth-child(1) { + // margin-left: 0; + // } } diff --git a/pages/index/indexs.vue b/pages/index/indexs.vue index c42a535..00cb5c6 100644 --- a/pages/index/indexs.vue +++ b/pages/index/indexs.vue @@ -1,7 +1,7 @@ - \ No newline at end of file diff --git a/pages/user/member/billDetails.vue b/pages/user/member/billDetails.vue new file mode 100644 index 0000000..5971016 --- /dev/null +++ b/pages/user/member/billDetails.vue @@ -0,0 +1,301 @@ + + + + + \ No newline at end of file diff --git a/pages/user/member/components/registermember.vue b/pages/user/member/components/registermember.vue new file mode 100644 index 0000000..0eb2ed6 --- /dev/null +++ b/pages/user/member/components/registermember.vue @@ -0,0 +1,489 @@ + + + + + \ No newline at end of file diff --git a/pages/user/member/index.vue b/pages/user/member/index.vue new file mode 100644 index 0000000..2601dba --- /dev/null +++ b/pages/user/member/index.vue @@ -0,0 +1,708 @@ + + + + + \ No newline at end of file diff --git a/pages/user/member/instructions.vue b/pages/user/member/instructions.vue new file mode 100644 index 0000000..2e488eb --- /dev/null +++ b/pages/user/member/instructions.vue @@ -0,0 +1,135 @@ + + + + + \ No newline at end of file diff --git a/pages/user/member/list.vue b/pages/user/member/list.vue new file mode 100644 index 0000000..e2cf873 --- /dev/null +++ b/pages/user/member/list.vue @@ -0,0 +1,207 @@ + + + + + \ No newline at end of file diff --git a/pages/user/member/memberdetails.vue b/pages/user/member/memberdetails.vue new file mode 100644 index 0000000..2979de1 --- /dev/null +++ b/pages/user/member/memberdetails.vue @@ -0,0 +1,651 @@ + + + + + \ No newline at end of file diff --git a/pages/user/member/memberinfo.vue b/pages/user/member/memberinfo.vue new file mode 100644 index 0000000..4db73bb --- /dev/null +++ b/pages/user/member/memberinfo.vue @@ -0,0 +1,399 @@ + + + + + \ No newline at end of file diff --git a/pages/user/member/memberinfos.vue b/pages/user/member/memberinfos.vue new file mode 100644 index 0000000..5f333a4 --- /dev/null +++ b/pages/user/member/memberinfos.vue @@ -0,0 +1,600 @@ + + + + + \ No newline at end of file diff --git a/pages/user/member/memberone.vue b/pages/user/member/memberone.vue new file mode 100644 index 0000000..db9f9fa --- /dev/null +++ b/pages/user/member/memberone.vue @@ -0,0 +1,339 @@ + + + + + \ No newline at end of file diff --git a/pages/user/member/paycode.vue b/pages/user/member/paycode.vue new file mode 100644 index 0000000..cd18d4e --- /dev/null +++ b/pages/user/member/paycode.vue @@ -0,0 +1,184 @@ + + + + + + \ No newline at end of file diff --git a/pages/user/member/qrcode.vue b/pages/user/member/qrcode.vue new file mode 100644 index 0000000..5979865 --- /dev/null +++ b/pages/user/member/qrcode.vue @@ -0,0 +1,38 @@ + + + + + \ No newline at end of file diff --git a/pages/user/member/setPassword.vue b/pages/user/member/setPassword.vue new file mode 100644 index 0000000..68f34f8 --- /dev/null +++ b/pages/user/member/setPassword.vue @@ -0,0 +1,324 @@ + + + + \ No newline at end of file diff --git a/pages/user/member/storedManage.vue b/pages/user/member/storedManage.vue new file mode 100644 index 0000000..8a8a11e --- /dev/null +++ b/pages/user/member/storedManage.vue @@ -0,0 +1,93 @@ + + + + + \ No newline at end of file diff --git a/pages/user/my_info.vue b/pages/user/my_info.vue deleted file mode 100644 index 112123e..0000000 --- a/pages/user/my_info.vue +++ /dev/null @@ -1,453 +0,0 @@ - - - - - diff --git a/pages/user/myself.vue b/pages/user/myself.vue new file mode 100644 index 0000000..1613931 --- /dev/null +++ b/pages/user/myself.vue @@ -0,0 +1,427 @@ + + + + + \ No newline at end of file diff --git a/pages/user/repairpasswordtwo.vue b/pages/user/repairpasswordtwo.vue deleted file mode 100644 index aa857be..0000000 --- a/pages/user/repairpasswordtwo.vue +++ /dev/null @@ -1,223 +0,0 @@ - - - - \ No newline at end of file diff --git a/pages/user/user.vue b/pages/user/user.vue index 4a66e6d..9a09f01 100644 --- a/pages/user/user.vue +++ b/pages/user/user.vue @@ -1,31 +1,45 @@