1
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,5 @@
|
||||
# 忽略提交文件
|
||||
/unpackage
|
||||
node_modules/
|
||||
.vscode/
|
||||
.hbuilderx/
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="navbarcontent">
|
||||
<!-- 导航栏 -->
|
||||
<view class="navbar" :class="{active:opacity}">
|
||||
<view class="navbar" :class="{active:opacity}" :style="{'backgroundColor':backColor}">
|
||||
<!-- #ifndef APP-PLUS || MP-WEIXIN -->
|
||||
<view class="status-bar"></view>
|
||||
<view class="navbar_tow flex-between"
|
||||
@@ -73,6 +73,10 @@
|
||||
iconcolor:{//返回键颜色
|
||||
type: String,
|
||||
default: '#000'
|
||||
},
|
||||
backColor:{//背景颜色
|
||||
type: String,
|
||||
default: '#f9f9f9'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -104,8 +104,8 @@ async function request(options) {
|
||||
if (res.code != 0) {
|
||||
if (res.code == -4) {
|
||||
uni.showToast({
|
||||
title: '',
|
||||
// title: res.message || res.msg,
|
||||
// title: '',
|
||||
title: res.message || res.msg,
|
||||
icon: "none",
|
||||
success: () => {
|
||||
setTimeout(res => {
|
||||
|
||||
15
node_modules/.bin/sass
generated
vendored
15
node_modules/.bin/sass
generated
vendored
@@ -2,16 +2,15 @@
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$NODE_PATH" ]; then
|
||||
export NODE_PATH="$basedir/C:/Users/Administrator/Documents/HBuilderProjects/cashier_weapp/node_modules/.store/sass@1.69.5/node_modules"
|
||||
else
|
||||
export NODE_PATH="$NODE_PATH:$basedir/C:/Users/Administrator/Documents/HBuilderProjects/cashier_weapp/node_modules/.store/sass@1.69.5/node_modules"
|
||||
fi
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../.store/sass@1.69.5/node_modules/sass/sass.js" "$@"
|
||||
exec "$basedir/node" "$basedir/../sass/sass.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../.store/sass@1.69.5/node_modules/sass/sass.js" "$@"
|
||||
exec node "$basedir/../sass/sass.js" "$@"
|
||||
fi
|
||||
|
||||
25
node_modules/.bin/sass.CMD
generated
vendored
25
node_modules/.bin/sass.CMD
generated
vendored
@@ -1,12 +1,17 @@
|
||||
@SETLOCAL
|
||||
@IF NOT DEFINED NODE_PATH (
|
||||
@SET "NODE_PATH=%~dp0\C:\Users\Administrator\Documents\HBuilderProjects\cashier_weapp\node_modules\.store\sass@1.69.5\node_modules"
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
@SET "NODE_PATH=%NODE_PATH%;%~dp0\C:\Users\Administrator\Documents\HBuilderProjects\cashier_weapp\node_modules\.store\sass@1.69.5\node_modules"
|
||||
)
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\.store\sass@1.69.5\node_modules\sass\sass.js" %*
|
||||
) ELSE (
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\.store\sass@1.69.5\node_modules\sass\sass.js" %*
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\sass\sass.js" %*
|
||||
|
||||
21
node_modules/.bin/sass.ps1
generated
vendored
21
node_modules/.bin/sass.ps1
generated
vendored
@@ -2,40 +2,27 @@
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
$pathsep=":"
|
||||
$env_node_path=$env:NODE_PATH
|
||||
$new_node_path="$basedir\C:\Users\Administrator\Documents\HBuilderProjects\cashier_weapp\node_modules\.store\sass@1.69.5\node_modules"
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
$pathsep=";"
|
||||
} else {
|
||||
$new_node_path="$basedir/C:/Users/Administrator/Documents/HBuilderProjects/cashier_weapp/node_modules/.store/sass@1.69.5/node_modules"
|
||||
}
|
||||
if ([string]::IsNullOrEmpty($env_node_path)) {
|
||||
$env:NODE_PATH=$new_node_path
|
||||
} else {
|
||||
$env:NODE_PATH="$env_node_path$pathsep$new_node_path"
|
||||
}
|
||||
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../.store/sass@1.69.5/node_modules/sass/sass.js" $args
|
||||
$input | & "$basedir/node$exe" "$basedir/../sass/sass.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../.store/sass@1.69.5/node_modules/sass/sass.js" $args
|
||||
& "$basedir/node$exe" "$basedir/../sass/sass.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../.store/sass@1.69.5/node_modules/sass/sass.js" $args
|
||||
$input | & "node$exe" "$basedir/../sass/sass.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../.store/sass@1.69.5/node_modules/sass/sass.js" $args
|
||||
& "node$exe" "$basedir/../sass/sass.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
$env:NODE_PATH=$env_node_path
|
||||
exit $ret
|
||||
|
||||
7
node_modules/lodash/package.json
generated
vendored
7
node_modules/lodash/package.json
generated
vendored
@@ -13,10 +13,5 @@
|
||||
"John-David Dalton <john.david.dalton@gmail.com>",
|
||||
"Mathias Bynens <mathias@qiwi.be>"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "echo \"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\""
|
||||
},
|
||||
"__npminstall_done": true,
|
||||
"_from": "lodash@4.17.21",
|
||||
"_resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz"
|
||||
"scripts": { "test": "echo \"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\"" }
|
||||
}
|
||||
|
||||
8
node_modules/sass-loader/README.md
generated
vendored
8
node_modules/sass-loader/README.md
generated
vendored
@@ -418,7 +418,7 @@ module.exports = {
|
||||
{
|
||||
loader: "sass-loader",
|
||||
options: {
|
||||
sassOptions: (loaderContext) => {
|
||||
sassOptions: (content, loaderContext) => {
|
||||
// More information about available properties https://webpack.js.org/api/loaders/
|
||||
const { resourcePath, rootContext } = loaderContext;
|
||||
const relativePath = path.relative(rootContext, resourcePath);
|
||||
@@ -677,14 +677,10 @@ Type:
|
||||
type warnRuleAsWarning = boolean;
|
||||
```
|
||||
|
||||
Default: `false`
|
||||
Default: `true`
|
||||
|
||||
Treats the `@warn` rule as a webpack warning.
|
||||
|
||||
> **Note**
|
||||
>
|
||||
> It will be `true` by default in the next major release.
|
||||
|
||||
**style.scss**
|
||||
|
||||
```scss
|
||||
|
||||
3
node_modules/sass-loader/dist/index.js
generated
vendored
3
node_modules/sass-loader/dist/index.js
generated
vendored
@@ -96,5 +96,4 @@ async function loader(content) {
|
||||
}
|
||||
callback(null, result.css.toString(), map);
|
||||
}
|
||||
var _default = loader;
|
||||
exports.default = _default;
|
||||
var _default = exports.default = loader;
|
||||
16
node_modules/sass-loader/dist/utils.js
generated
vendored
16
node_modules/sass-loader/dist/utils.js
generated
vendored
@@ -113,7 +113,7 @@ async function getSassOptions(loaderContext, loaderOptions, content, implementat
|
||||
if (!sassOptions.logger) {
|
||||
const needEmitWarning = loaderOptions.warnRuleAsWarning !== false;
|
||||
const logger = loaderContext.getLogger("sass-loader");
|
||||
const formatSpan = span => `${span.url || "-"}:${span.start.line}:${span.start.column}: `;
|
||||
const formatSpan = span => `Warning on line ${span.start.line}, column ${span.start.column} of ${span.url || "-"}:${span.start.line}:${span.start.column}:\n`;
|
||||
const formatDebugSpan = span => `[debug:${span.start.line}:${span.start.column}] `;
|
||||
sassOptions.logger = {
|
||||
debug(message, loggerOptions) {
|
||||
@@ -129,11 +129,14 @@ async function getSassOptions(loaderContext, loaderOptions, content, implementat
|
||||
if (loggerOptions.deprecation) {
|
||||
builtMessage += "Deprecation ";
|
||||
}
|
||||
if (loggerOptions.span && !loggerOptions.stack) {
|
||||
builtMessage = formatSpan(loggerOptions.span);
|
||||
if (loggerOptions.span) {
|
||||
builtMessage += formatSpan(loggerOptions.span);
|
||||
}
|
||||
builtMessage += message;
|
||||
if (loggerOptions.stack) {
|
||||
if (loggerOptions.span && loggerOptions.span.context) {
|
||||
builtMessage += `\n\n${loggerOptions.span.start.line} | ${loggerOptions.span.context}`;
|
||||
}
|
||||
if (loggerOptions.stack && loggerOptions.stack !== "null") {
|
||||
builtMessage += `\n\n${loggerOptions.stack}`;
|
||||
}
|
||||
if (needEmitWarning) {
|
||||
@@ -227,6 +230,11 @@ async function getSassOptions(loaderContext, loaderOptions, content, implementat
|
||||
|
||||
// Allow passing custom importers to `sass`/`node-sass`. Accepts `Function` or an array of `Function`s.
|
||||
sassOptions.importer = sassOptions.importer ? proxyCustomImporters(Array.isArray(sassOptions.importer) ? sassOptions.importer.slice() : [sassOptions.importer], loaderContext) : [];
|
||||
|
||||
// Regression on the `sass-embedded` side
|
||||
if (loaderOptions.webpackImporter === false && sassOptions.importer.length === 0) {
|
||||
sassOptions.importer = undefined;
|
||||
}
|
||||
sassOptions.includePaths = [].concat(process.cwd()).concat(
|
||||
// We use `includePaths` in context for resolver, so it should be always absolute
|
||||
(sassOptions.includePaths ? sassOptions.includePaths.slice() : []).map(includePath => _path.default.isAbsolute(includePath) ? includePath : _path.default.join(process.cwd(), includePath))).concat(process.env.SASS_PATH ? process.env.SASS_PATH.split(process.platform === "win32" ? ";" : ":") : []);
|
||||
|
||||
17
node_modules/sass-loader/node_modules/.bin/sass
generated
vendored
17
node_modules/sass-loader/node_modules/.bin/sass
generated
vendored
@@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -z "$NODE_PATH" ]; then
|
||||
export NODE_PATH="$basedir/C:/Users/Administrator/Documents/HBuilderProjects/cashier_weapp/node_modules/.store/sass@1.69.5/node_modules"
|
||||
else
|
||||
export NODE_PATH="$NODE_PATH:$basedir/C:/Users/Administrator/Documents/HBuilderProjects/cashier_weapp/node_modules/.store/sass@1.69.5/node_modules"
|
||||
fi
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../../../../../sass@1.69.5/node_modules/sass/sass.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../../../../../sass@1.69.5/node_modules/sass/sass.js" "$@"
|
||||
fi
|
||||
12
node_modules/sass-loader/node_modules/.bin/sass.CMD
generated
vendored
12
node_modules/sass-loader/node_modules/.bin/sass.CMD
generated
vendored
@@ -1,12 +0,0 @@
|
||||
@SETLOCAL
|
||||
@IF NOT DEFINED NODE_PATH (
|
||||
@SET "NODE_PATH=%~dp0\C:\Users\Administrator\Documents\HBuilderProjects\cashier_weapp\node_modules\.store\sass@1.69.5\node_modules"
|
||||
) ELSE (
|
||||
@SET "NODE_PATH=%NODE_PATH%;%~dp0\C:\Users\Administrator\Documents\HBuilderProjects\cashier_weapp\node_modules\.store\sass@1.69.5\node_modules"
|
||||
)
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\..\..\..\..\sass@1.69.5\node_modules\sass\sass.js" %*
|
||||
) ELSE (
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\..\..\..\..\sass@1.69.5\node_modules\sass\sass.js" %*
|
||||
)
|
||||
41
node_modules/sass-loader/node_modules/.bin/sass.ps1
generated
vendored
41
node_modules/sass-loader/node_modules/.bin/sass.ps1
generated
vendored
@@ -1,41 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
$pathsep=":"
|
||||
$env_node_path=$env:NODE_PATH
|
||||
$new_node_path="$basedir\C:\Users\Administrator\Documents\HBuilderProjects\cashier_weapp\node_modules\.store\sass@1.69.5\node_modules"
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
$pathsep=";"
|
||||
} else {
|
||||
$new_node_path="$basedir/C:/Users/Administrator/Documents/HBuilderProjects/cashier_weapp/node_modules/.store/sass@1.69.5/node_modules"
|
||||
}
|
||||
if ([string]::IsNullOrEmpty($env_node_path)) {
|
||||
$env:NODE_PATH=$new_node_path
|
||||
} else {
|
||||
$env:NODE_PATH="$env_node_path$pathsep$new_node_path"
|
||||
}
|
||||
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../../../../../sass@1.69.5/node_modules/sass/sass.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../../../../../sass@1.69.5/node_modules/sass/sass.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../../../../../sass@1.69.5/node_modules/sass/sass.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../../../../../sass@1.69.5/node_modules/sass/sass.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
$env:NODE_PATH=$env_node_path
|
||||
exit $ret
|
||||
48
node_modules/sass-loader/package.json
generated
vendored
48
node_modules/sass-loader/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sass-loader",
|
||||
"version": "13.3.2",
|
||||
"version": "13.3.3",
|
||||
"description": "Sass loader for webpack",
|
||||
"license": "MIT",
|
||||
"repository": "webpack-contrib/sass-loader",
|
||||
@@ -66,52 +66,48 @@
|
||||
"neo-async": "^2.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.21.5",
|
||||
"@babel/core": "^7.21.5",
|
||||
"@babel/preset-env": "^7.21.5",
|
||||
"@commitlint/cli": "^17.6.1",
|
||||
"@commitlint/config-conventional": "^17.6.1",
|
||||
"@babel/cli": "^7.22.9",
|
||||
"@babel/core": "^7.22.9",
|
||||
"@babel/preset-env": "^7.22.9",
|
||||
"@commitlint/cli": "^17.6.7",
|
||||
"@commitlint/config-conventional": "^17.6.7",
|
||||
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
|
||||
"babel-jest": "^29.5.0",
|
||||
"babel-jest": "^29.6.2",
|
||||
"bootstrap-sass": "^3.4.1",
|
||||
"bootstrap-v4": "npm:bootstrap@^4.5.3",
|
||||
"bootstrap-v5": "npm:bootstrap@^5.0.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"cspell": "^6.31.1",
|
||||
"css-loader": "^6.7.3",
|
||||
"cspell": "^6.31.2",
|
||||
"css-loader": "^6.8.1",
|
||||
"del": "^6.1.1",
|
||||
"del-cli": "^4.0.1",
|
||||
"enhanced-resolve": "^5.13.0",
|
||||
"eslint": "^8.39.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"fibers": "^5.0.3",
|
||||
"enhanced-resolve": "^5.15.0",
|
||||
"eslint": "^8.46.0",
|
||||
"eslint-config-prettier": "^8.9.0",
|
||||
"eslint-plugin-import": "^2.28.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"foundation-sites": "^6.7.5",
|
||||
"husky": "^8.0.3",
|
||||
"jest": "^29.5.0",
|
||||
"jest-environment-node-single-context": "^29.0.0",
|
||||
"lint-staged": "^13.2.2",
|
||||
"jest": "^29.6.2",
|
||||
"jest-environment-node-single-context": "^29.1.0",
|
||||
"lint-staged": "^13.2.3",
|
||||
"material-components-web": "^9.0.0",
|
||||
"memfs": "^3.5.1",
|
||||
"node-sass": "^8.0.0",
|
||||
"node-sass-glob-importer": "^5.3.2",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.8.8",
|
||||
"sass": "^1.62.1",
|
||||
"sass-embedded": "^1.62.0",
|
||||
"semver": "^7.5.0",
|
||||
"sass": "^1.64.2",
|
||||
"sass-embedded": "^1.64.2",
|
||||
"semver": "^7.5.4",
|
||||
"standard-version": "^9.3.1",
|
||||
"style-loader": "^3.3.2",
|
||||
"webpack": "^5.81.0"
|
||||
"style-loader": "^3.3.3",
|
||||
"webpack": "^5.88.2"
|
||||
},
|
||||
"keywords": [
|
||||
"sass",
|
||||
"libsass",
|
||||
"webpack",
|
||||
"loader"
|
||||
],
|
||||
"__npminstall_done": true,
|
||||
"_from": "sass-loader@13.3.2",
|
||||
"_resolved": "https://registry.npmmirror.com/sass-loader/-/sass-loader-13.3.2.tgz"
|
||||
]
|
||||
}
|
||||
|
||||
183
node_modules/sass/LICENSE
generated
vendored
183
node_modules/sass/LICENSE
generated
vendored
@@ -87,6 +87,39 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
_macros and macros license:
|
||||
|
||||
Copyright 2024, the Dart project authors.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of Google LLC nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
analyzer, protobuf and protoc_plugin license:
|
||||
@@ -615,6 +648,32 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
dart_mappable and type_plus license:
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Kilian Schulte
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
ffi and package_config license:
|
||||
@@ -973,6 +1032,39 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
native_stack_traces license:
|
||||
|
||||
Copyright 2020, the Dart project authors.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of Google LLC nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
native_synchronization license:
|
||||
@@ -1118,32 +1210,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
pointycastle license:
|
||||
|
||||
|
||||
Copyright (c) 2000 - 2019 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
pub_api_client license:
|
||||
@@ -1570,6 +1636,71 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
web license:
|
||||
|
||||
Copyright 2023, the Dart project authors.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of Google LLC nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
web_socket license:
|
||||
|
||||
Copyright 2024, the Dart project authors.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of Google LLC nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
yaml license:
|
||||
|
||||
52
node_modules/sass/package.json
generated
vendored
52
node_modules/sass/package.json
generated
vendored
@@ -1,51 +1 @@
|
||||
{
|
||||
"name": "sass",
|
||||
"description": "A pure JavaScript implementation of Sass.",
|
||||
"license": "MIT",
|
||||
"bugs": "https://github.com/sass/dart-sass/issues",
|
||||
"homepage": "https://github.com/sass/dart-sass",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sass/dart-sass"
|
||||
},
|
||||
"author": {
|
||||
"name": "Natalie Weizenbaum",
|
||||
"email": "nweiz@google.com",
|
||||
"url": "https://github.com/nex3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"chokidar": ">=3.0.0 <4.0.0",
|
||||
"immutable": "^4.0.0",
|
||||
"source-map-js": ">=0.6.2 <2.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"style",
|
||||
"scss",
|
||||
"sass",
|
||||
"preprocessor",
|
||||
"css"
|
||||
],
|
||||
"types": "types/index.d.ts",
|
||||
"exports": {
|
||||
"types": "./types/index.d.ts",
|
||||
"node": {
|
||||
"require": "./sass.node.js",
|
||||
"default": "./sass.node.mjs"
|
||||
},
|
||||
"default": {
|
||||
"require": "./sass.default.cjs",
|
||||
"default": "./sass.default.js"
|
||||
}
|
||||
},
|
||||
"version": "1.69.5",
|
||||
"bin": {
|
||||
"sass": "sass.js"
|
||||
},
|
||||
"main": "sass.node.js",
|
||||
"__npminstall_done": true,
|
||||
"_from": "sass@1.69.5",
|
||||
"_resolved": "https://registry.npmmirror.com/sass/-/sass-1.69.5.tgz"
|
||||
}
|
||||
{"name":"sass","description":"A pure JavaScript implementation of Sass.","license":"MIT","bugs":"https://github.com/sass/dart-sass/issues","homepage":"https://github.com/sass/dart-sass","repository":{"type":"git","url":"https://github.com/sass/dart-sass"},"author":{"name":"Natalie Weizenbaum","email":"nweiz@google.com","url":"https://github.com/nex3"},"engines":{"node":">=14.0.0"},"dependencies":{"chokidar":">=3.0.0 <4.0.0","immutable":"^4.0.0","source-map-js":">=0.6.2 <2.0.0"},"keywords":["style","scss","sass","preprocessor","css"],"types":"types/index.d.ts","exports":{"types":"./types/index.d.ts","node":{"require":"./sass.node.js","default":"./sass.node.mjs"},"default":{"require":"./sass.default.cjs","default":"./sass.default.js"}},"version":"1.77.8","bin":{"sass":"sass.js"},"main":"sass.node.js"}
|
||||
35410
node_modules/sass/sass.dart.js
generated
vendored
35410
node_modules/sass/sass.dart.js
generated
vendored
File diff suppressed because one or more lines are too long
7
node_modules/sass/sass.default.js
generated
vendored
7
node_modules/sass/sass.default.js
generated
vendored
@@ -10,6 +10,10 @@ export const compile = _cliPkgExports.compile;
|
||||
export const compileAsync = _cliPkgExports.compileAsync;
|
||||
export const compileString = _cliPkgExports.compileString;
|
||||
export const compileStringAsync = _cliPkgExports.compileStringAsync;
|
||||
export const initCompiler = _cliPkgExports.initCompiler;
|
||||
export const initAsyncCompiler = _cliPkgExports.initAsyncCompiler;
|
||||
export const Compiler = _cliPkgExports.Compiler;
|
||||
export const AsyncCompiler = _cliPkgExports.AsyncCompiler;
|
||||
export const Logger = _cliPkgExports.Logger;
|
||||
export const SassArgumentList = _cliPkgExports.SassArgumentList;
|
||||
export const SassBoolean = _cliPkgExports.SassBoolean;
|
||||
@@ -38,3 +42,6 @@ export const TRUE = _cliPkgExports.TRUE;
|
||||
export const FALSE = _cliPkgExports.FALSE;
|
||||
export const NULL = _cliPkgExports.NULL;
|
||||
export const types = _cliPkgExports.types;
|
||||
export const NodePackageImporter = _cliPkgExports.NodePackageImporter;
|
||||
export const deprecations = _cliPkgExports.deprecations;
|
||||
export const Version = _cliPkgExports.Version;
|
||||
|
||||
1
node_modules/sass/sass.js
generated
vendored
1
node_modules/sass/sass.js
generated
vendored
@@ -9,6 +9,7 @@ library.load({
|
||||
chokidar: require("chokidar"),
|
||||
util: require("util"),
|
||||
stream: require("stream"),
|
||||
nodeModule: require("module"),
|
||||
fs: require("fs"),
|
||||
immutable: require("immutable"),
|
||||
});
|
||||
|
||||
1
node_modules/sass/sass.node.js
generated
vendored
1
node_modules/sass/sass.node.js
generated
vendored
@@ -4,6 +4,7 @@ if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports;
|
||||
library.load({
|
||||
util: require("util"),
|
||||
stream: require("stream"),
|
||||
nodeModule: require("module"),
|
||||
fs: require("fs"),
|
||||
immutable: require("immutable"),
|
||||
});
|
||||
|
||||
35
node_modules/sass/sass.node.mjs
generated
vendored
35
node_modules/sass/sass.node.mjs
generated
vendored
@@ -4,6 +4,10 @@ export const compile = cjs.compile;
|
||||
export const compileAsync = cjs.compileAsync;
|
||||
export const compileString = cjs.compileString;
|
||||
export const compileStringAsync = cjs.compileStringAsync;
|
||||
export const initCompiler = cjs.initCompiler;
|
||||
export const initAsyncCompiler = cjs.initAsyncCompiler;
|
||||
export const Compiler = cjs.Compiler;
|
||||
export const AsyncCompiler = cjs.AsyncCompiler;
|
||||
export const Logger = cjs.Logger;
|
||||
export const SassArgumentList = cjs.SassArgumentList;
|
||||
export const SassBoolean = cjs.SassBoolean;
|
||||
@@ -32,6 +36,9 @@ export const TRUE = cjs.TRUE;
|
||||
export const FALSE = cjs.FALSE;
|
||||
export const NULL = cjs.NULL;
|
||||
export const types = cjs.types;
|
||||
export const NodePackageImporter = cjs.NodePackageImporter;
|
||||
export const deprecations = cjs.deprecations;
|
||||
export const Version = cjs.Version;
|
||||
|
||||
let printedDefaultExportDeprecation = false;
|
||||
function defaultExportDeprecation() {
|
||||
@@ -59,6 +66,22 @@ export default {
|
||||
defaultExportDeprecation();
|
||||
return cjs.compileStringAsync;
|
||||
},
|
||||
get initCompiler() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.initCompiler;
|
||||
},
|
||||
get initAsyncCompiler() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.initAsyncCompiler;
|
||||
},
|
||||
get Compiler() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.Compiler;
|
||||
},
|
||||
get AsyncCompiler() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.AsyncCompiler;
|
||||
},
|
||||
get Logger() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.Logger;
|
||||
@@ -171,4 +194,16 @@ export default {
|
||||
defaultExportDeprecation();
|
||||
return cjs.types;
|
||||
},
|
||||
get NodePackageImporter() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.NodePackageImporter;
|
||||
},
|
||||
get deprecations() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.deprecations;
|
||||
},
|
||||
get Version() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.Version;
|
||||
},
|
||||
};
|
||||
|
||||
190
node_modules/sass/types/compile.d.ts
generated
vendored
190
node_modules/sass/types/compile.d.ts
generated
vendored
@@ -37,6 +37,104 @@ export interface CompileResult {
|
||||
sourceMap?: RawSourceMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* The result of creating a synchronous compiler. Returned by
|
||||
* {@link initCompiler}.
|
||||
*
|
||||
* @category Compile
|
||||
*/
|
||||
export class Compiler {
|
||||
/**
|
||||
* Throws an error if constructed directly, instead of via
|
||||
* {@link initCompiler}.
|
||||
*/
|
||||
private constructor();
|
||||
|
||||
/**
|
||||
* The {@link compile} method exposed through a Compiler instance while it is
|
||||
* active. If this is called after {@link dispose} on the Compiler
|
||||
* instance, an error will be thrown.
|
||||
*
|
||||
* During the Compiler instance's lifespan, given the same input, this will
|
||||
* return an identical result to the {@link compile} method exposed at the
|
||||
* module root.
|
||||
*/
|
||||
compile(path: string, options?: Options<'sync'>): CompileResult;
|
||||
|
||||
/**
|
||||
* The {@link compileString} method exposed through a Compiler instance while
|
||||
* it is active. If this is called after {@link dispose} on the Compiler
|
||||
* instance, an error will be thrown.
|
||||
*
|
||||
* During the Compiler instance's lifespan, given the same input, this will
|
||||
* return an identical result to the {@link compileString} method exposed at
|
||||
* the module root.
|
||||
*/
|
||||
compileString(source: string, options?: StringOptions<'sync'>): CompileResult;
|
||||
|
||||
/**
|
||||
* Ends the lifespan of this Compiler instance. After this is invoked, all
|
||||
* calls to the Compiler instance's {@link compile} or {@link compileString}
|
||||
* methods will result in an error.
|
||||
*/
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* The result of creating an asynchronous compiler. Returned by
|
||||
* {@link initAsyncCompiler}.
|
||||
*
|
||||
* @category Compile
|
||||
*/
|
||||
export class AsyncCompiler {
|
||||
/**
|
||||
* Throws an error if constructed directly, instead of via
|
||||
* {@link initAsyncCompiler}.
|
||||
*/
|
||||
private constructor();
|
||||
|
||||
/**
|
||||
* The {@link compileAsync} method exposed through an Async Compiler instance
|
||||
* while it is active. If this is called after {@link dispose} on the Async
|
||||
* Compiler instance, an error will be thrown.
|
||||
*
|
||||
* During the Async Compiler instance's lifespan, given the same input, this
|
||||
* will return an identical result to the {@link compileAsync} method exposed
|
||||
* at the module root.
|
||||
*/
|
||||
compileAsync(
|
||||
path: string,
|
||||
options?: Options<'async'>
|
||||
): Promise<CompileResult>;
|
||||
|
||||
/**
|
||||
* The {@link compileStringAsync} method exposed through an Async Compiler
|
||||
* instance while it is active. If this is called after {@link dispose} on the
|
||||
* Async Compiler instance, an error will be thrown.
|
||||
*
|
||||
* During the Async Compiler instance's lifespan, given the same input, this
|
||||
* will return an identical result to the {@link compileStringAsync} method
|
||||
* exposed at the module root.
|
||||
*/
|
||||
compileStringAsync(
|
||||
source: string,
|
||||
options?: StringOptions<'async'>
|
||||
): Promise<CompileResult>;
|
||||
|
||||
/**
|
||||
* Ends the lifespan of this Async Compiler instance. After this is invoked,
|
||||
* all subsequent calls to the Compiler instance's `compileAsync` or
|
||||
* `compileStringAsync` methods will result in an error.
|
||||
*
|
||||
* Any compilations that are submitted before `dispose` will not be cancelled,
|
||||
* and will be allowed to settle.
|
||||
*
|
||||
* After all compilations have been settled and Sass completes any internal
|
||||
* task cleanup, `dispose` will resolve its promise.
|
||||
*/
|
||||
dispose(): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronously compiles the Sass file at `path` to CSS. If it succeeds it
|
||||
* returns a {@link CompileResult}, and if it fails it throws an {@link
|
||||
@@ -44,10 +142,16 @@ export interface CompileResult {
|
||||
*
|
||||
* This only allows synchronous {@link Importer}s and {@link CustomFunction}s.
|
||||
*
|
||||
* **Heads up!** When using the `sass-embedded` npm package,
|
||||
* **{@link compileAsync} is almost always faster than {@link compile}**, due to
|
||||
* the overhead of emulating synchronous messaging with worker threads and
|
||||
* concurrent compilations being blocked on main thread.
|
||||
* **Heads up!** When using the [sass-embedded] npm package for single
|
||||
* compilations, **{@link compileAsync} is almost always faster than
|
||||
* {@link compile}**, due to the overhead of emulating synchronous messaging
|
||||
* with worker threads and concurrent compilations being blocked on main thread.
|
||||
*
|
||||
* If you are running multiple compilations with the [sass-embedded] npm
|
||||
* package, using a {@link Compiler} will provide some speed improvements over
|
||||
* the module-level methods, and an {@link AsyncCompiler} will be much faster.
|
||||
*
|
||||
* [sass-embedded]: https://www.npmjs.com/package/sass-embedded
|
||||
*
|
||||
* @example
|
||||
*
|
||||
@@ -99,12 +203,18 @@ export function compileAsync(
|
||||
*
|
||||
* This only allows synchronous {@link Importer}s and {@link CustomFunction}s.
|
||||
*
|
||||
* **Heads up!** When using the `sass-embedded` npm package,
|
||||
* **{@link compileStringAsync} is almost always faster than
|
||||
* **Heads up!** When using the [sass-embedded] npm package for single
|
||||
* compilations, **{@link compileStringAsync} is almost always faster than
|
||||
* {@link compileString}**, due to the overhead of emulating synchronous
|
||||
* messaging with worker threads and concurrent compilations being blocked on
|
||||
* main thread.
|
||||
*
|
||||
* If you are running multiple compilations with the [sass-embedded] npm
|
||||
* package, using a {@link Compiler} will provide some speed improvements over
|
||||
* the module-level methods, and an {@link AsyncCompiler} will be much faster.
|
||||
*
|
||||
* [sass-embedded]: https://www.npmjs.com/package/sass-embedded
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
@@ -162,3 +272,71 @@ export function compileStringAsync(
|
||||
source: string,
|
||||
options?: StringOptions<'async'>
|
||||
): Promise<CompileResult>;
|
||||
|
||||
/**
|
||||
* Creates a synchronous {@link Compiler}. Each compiler instance exposes the
|
||||
* {@link compile} and {@link compileString} methods within the lifespan of the
|
||||
* Compiler. Given identical input, these methods will return results identical
|
||||
* to their counterparts exposed at the module root. To use asynchronous
|
||||
* compilation, use {@link initAsyncCompiler}.
|
||||
*
|
||||
* When calling the compile functions multiple times, using a compiler instance
|
||||
* with the [sass-embedded] npm package is much faster than using the top-level
|
||||
* compilation methods or the [sass] npm package.
|
||||
*
|
||||
* [sass-embedded]: https://www.npmjs.com/package/sass-embedded
|
||||
*
|
||||
* [sass]: https://www.npmjs.com/package/sass
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const sass = require('sass');
|
||||
* function setup() {
|
||||
* const compiler = sass.initCompiler();
|
||||
* const result1 = compiler.compileString('a {b: c}').css;
|
||||
* const result2 = compiler.compileString('a {b: c}').css;
|
||||
* compiler.dispose();
|
||||
*
|
||||
* // throws error
|
||||
* const result3 = sass.compileString('a {b: c}').css;
|
||||
* }
|
||||
* ```
|
||||
* @category Compile
|
||||
* @compatibility dart: "1.70.0", node: false
|
||||
*/
|
||||
export function initCompiler(): Compiler;
|
||||
|
||||
/**
|
||||
* Creates an asynchronous {@link AsyncCompiler}. Each compiler
|
||||
* instance exposes the {@link compileAsync} and {@link compileStringAsync}
|
||||
* methods within the lifespan of the Compiler. Given identical input, these
|
||||
* methods will return results identical to their counterparts exposed at the
|
||||
* module root. To use synchronous compilation, use {@link initCompiler};
|
||||
*
|
||||
* When calling the compile functions multiple times, using a compiler instance
|
||||
* with the [sass-embedded] npm package is much faster than using the top-level
|
||||
* compilation methods or the [sass] npm package.
|
||||
*
|
||||
* [sass-embedded]: https://www.npmjs.com/package/sass-embedded
|
||||
*
|
||||
* [sass]: https://www.npmjs.com/package/sass
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const sass = require('sass');
|
||||
* async function setup() {
|
||||
* const compiler = await sass.initAsyncCompiler();
|
||||
* const result1 = await compiler.compileStringAsync('a {b: c}').css;
|
||||
* const result2 = await compiler.compileStringAsync('a {b: c}').css;
|
||||
* await compiler.dispose();
|
||||
*
|
||||
* // throws error
|
||||
* const result3 = await sass.compileStringAsync('a {b: c}').css;
|
||||
* }
|
||||
* ```
|
||||
* @category Compile
|
||||
* @compatibility dart: "1.70.0", node: false
|
||||
*/
|
||||
export function initAsyncCompiler(): Promise<AsyncCompiler>;
|
||||
|
||||
137
node_modules/sass/types/importer.d.ts
generated
vendored
137
node_modules/sass/types/importer.d.ts
generated
vendored
@@ -42,7 +42,7 @@ export interface CanonicalizeContext {
|
||||
* Like all importers, this implements custom Sass loading logic for [`@use`
|
||||
* rules](https://sass-lang.com/documentation/at-rules/use) and [`@import`
|
||||
* rules](https://sass-lang.com/documentation/at-rules/import). It can be passed
|
||||
* to {@link Options.importers} or {@link StringOptionsWithImporter.importer}.
|
||||
* to {@link Options.importers} or {@link StringOptions.importer}.
|
||||
*
|
||||
* @typeParam sync - A `FileImporter<'sync'>`'s {@link findFileUrl} must return
|
||||
* synchronously, but in return it can be passed to {@link compile} and {@link
|
||||
@@ -122,7 +122,7 @@ export interface FileImporter<
|
||||
* An object that implements custom Sass loading logic for [`@use`
|
||||
* rules](https://sass-lang.com/documentation/at-rules/use) and [`@import`
|
||||
* rules](https://sass-lang.com/documentation/at-rules/import). It can be passed
|
||||
* to {@link Options.importers} or {@link StringOptionsWithImporter.importer}.
|
||||
* to {@link Options.importers} or {@link StringOptions.importer}.
|
||||
*
|
||||
* Importers that simply redirect to files on disk are encouraged to use the
|
||||
* {@link FileImporter} interface instead.
|
||||
@@ -308,6 +308,139 @@ export interface Importer<sync extends 'sync' | 'async' = 'sync' | 'async'> {
|
||||
nonCanonicalScheme?: string | string[];
|
||||
}
|
||||
|
||||
declare const nodePackageImporterKey: unique symbol;
|
||||
|
||||
/**
|
||||
* The built-in Node.js package importer. This loads pkg: URLs from node_modules
|
||||
* according to the standard Node.js resolution algorithm.
|
||||
*
|
||||
* A Node.js package importer is exposed as a class that can be added to the
|
||||
* `importers` option.
|
||||
*
|
||||
*```js
|
||||
* const sass = require('sass');
|
||||
* sass.compileString('@use "pkg:vuetify', {
|
||||
* importers: [new sass.NodePackageImporter()]
|
||||
* });
|
||||
*```
|
||||
*
|
||||
* ## Writing Sass packages
|
||||
*
|
||||
* Package authors can control what is exposed to their users through their
|
||||
* `package.json` manifest. The recommended method is to add a `sass`
|
||||
* conditional export to `package.json`.
|
||||
*
|
||||
* ```json
|
||||
* // node_modules/uicomponents/package.json
|
||||
* {
|
||||
* "exports": {
|
||||
* ".": {
|
||||
* "sass": "./src/scss/index.scss",
|
||||
* "import": "./dist/js/index.mjs",
|
||||
* "default": "./dist/js/index.js"
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* This allows a package user to write `@use "pkg:uicomponents"` to load the
|
||||
* file at `node_modules/uicomponents/src/scss/index.scss`.
|
||||
*
|
||||
* The Node.js package importer supports the variety of formats supported by
|
||||
* Node.js [package entry points], allowing authors to expose multiple subpaths.
|
||||
*
|
||||
* [package entry points]:
|
||||
* https://nodejs.org/api/packages.html#package-entry-points
|
||||
*
|
||||
* ```json
|
||||
* // node_modules/uicomponents/package.json
|
||||
* {
|
||||
* "exports": {
|
||||
* ".": {
|
||||
* "sass": "./src/scss/index.scss",
|
||||
* },
|
||||
* "./colors.scss": {
|
||||
* "sass": "./src/scss/_colors.scss",
|
||||
* },
|
||||
* "./theme/*.scss": {
|
||||
* "sass": "./src/scss/theme/*.scss",
|
||||
* },
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* This allows a package user to write:
|
||||
*
|
||||
* - `@use "pkg:uicomponents";` to import the root export.
|
||||
* - `@use "pkg:uicomponents/colors";` to import the colors partial.
|
||||
* - `@use "pkg:uicomponents/theme/purple";` to import a purple theme.
|
||||
*
|
||||
* Note that while library users can rely on the importer to resolve
|
||||
* [partials](https://sass-lang.com/documentation/at-rules/use#partials), [index
|
||||
* files](https://sass-lang.com/documentation/at-rules/use#index-files), and
|
||||
* extensions, library authors must specify the entire file path in `exports`.
|
||||
*
|
||||
* In addition to the `sass` condition, the `style` condition is also
|
||||
* acceptable. Sass will match the `default` condition if it's a relevant file
|
||||
* type, but authors are discouraged from relying on this. Notably, the key
|
||||
* order matters, and the importer will resolve to the first value with a key
|
||||
* that is `sass`, `style`, or `default`, so you should always put `default`
|
||||
* last.
|
||||
*
|
||||
* To help package authors who haven't transitioned to package entry points
|
||||
* using the `exports` field, the Node.js package importer provides several
|
||||
* fallback options. If the `pkg:` URL does not have a subpath, the Node.js
|
||||
* package importer will look for a `sass` or `style` key at the root of
|
||||
* `package.json`.
|
||||
*
|
||||
* ```json
|
||||
* // node_modules/uicomponents/package.json
|
||||
* {
|
||||
* "sass": "./src/scss/index.scss",
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* This allows a user to write `@use "pkg:uicomponents";` to import the
|
||||
* `index.scss` file.
|
||||
*
|
||||
* Finally, the Node.js package importer will look for an `index` file at the
|
||||
* package root, resolving partials and extensions. For example, if the file
|
||||
* `_index.scss` exists in the package root of `uicomponents`, a user can import
|
||||
* that with `@use "pkg:uicomponents";`.
|
||||
*
|
||||
* If a `pkg:` URL includes a subpath that doesn't have a match in package entry
|
||||
* points, the Node.js importer will attempt to find that file relative to the
|
||||
* package root, resolving for file extensions, partials and index files. For
|
||||
* example, if the file `src/sass/_colors.scss` exists in the `uicomponents`
|
||||
* package, a user can import that file using `@use
|
||||
* "pkg:uicomponents/src/sass/colors";`.
|
||||
*
|
||||
* @compatibility dart: "1.71.0", node: false
|
||||
* @category Importer
|
||||
*/
|
||||
export class NodePackageImporter {
|
||||
/** Used to distinguish this type from any arbitrary object. */
|
||||
private readonly [nodePackageImporterKey]: true;
|
||||
|
||||
/**
|
||||
* The NodePackageImporter has an optional `entryPointDirectory` option, which
|
||||
* is the directory where the Node Package Importer should start when
|
||||
* resolving `pkg:` URLs in sources other than files on disk. This will be
|
||||
* used as the `parentURL` in the [Node Module
|
||||
* Resolution](https://nodejs.org/api/esm.html#resolution-algorithm-specification)
|
||||
* algorithm.
|
||||
*
|
||||
* In order to be found by the Node Package Importer, a package will need to
|
||||
* be inside a node_modules folder located in the `entryPointDirectory`, or
|
||||
* one of its parent directories, up to the filesystem root.
|
||||
*
|
||||
* Relative paths will be resolved relative to the current working directory.
|
||||
* If a path is not provided, this defaults to the parent directory of the
|
||||
* Node.js entrypoint. If that's not available, this will throw an error.
|
||||
*/
|
||||
constructor(entryPointDirectory?: string);
|
||||
}
|
||||
|
||||
/**
|
||||
* The result of successfully loading a stylesheet with an {@link Importer}.
|
||||
*
|
||||
|
||||
13
node_modules/sass/types/index.d.ts
generated
vendored
13
node_modules/sass/types/index.d.ts
generated
vendored
@@ -3,18 +3,31 @@
|
||||
// implementations.
|
||||
|
||||
export {
|
||||
AsyncCompiler,
|
||||
CompileResult,
|
||||
Compiler,
|
||||
compile,
|
||||
compileAsync,
|
||||
compileString,
|
||||
compileStringAsync,
|
||||
initCompiler,
|
||||
initAsyncCompiler,
|
||||
} from './compile';
|
||||
export {
|
||||
deprecations,
|
||||
Deprecation,
|
||||
Deprecations,
|
||||
DeprecationOrId,
|
||||
DeprecationStatus,
|
||||
Version,
|
||||
} from './deprecations';
|
||||
export {Exception} from './exception';
|
||||
export {
|
||||
CanonicalizeContext,
|
||||
FileImporter,
|
||||
Importer,
|
||||
ImporterResult,
|
||||
NodePackageImporter,
|
||||
} from './importer';
|
||||
export {Logger, SourceSpan, SourceLocation} from './logger';
|
||||
export {
|
||||
|
||||
19
node_modules/sass/types/legacy/options.d.ts
generated
vendored
19
node_modules/sass/types/legacy/options.d.ts
generated
vendored
@@ -1,6 +1,7 @@
|
||||
import {Logger} from '../logger';
|
||||
import {LegacyImporter} from './importer';
|
||||
import {LegacyFunction} from './function';
|
||||
import {NodePackageImporter} from '../importer';
|
||||
|
||||
/**
|
||||
* Options for {@link render} and {@link renderSync} that are shared between
|
||||
@@ -508,6 +509,24 @@ export interface LegacySharedOptions<sync extends 'sync' | 'async'> {
|
||||
* @compatibility dart: "1.43.0", node: false
|
||||
*/
|
||||
logger?: Logger;
|
||||
|
||||
/**
|
||||
* If this option is set to an instance of `NodePackageImporter`, Sass will
|
||||
* use the built-in Node.js package importer to resolve Sass files with a
|
||||
* `pkg:` URL scheme. Details for library authors and users can be found in
|
||||
* the {@link NodePackageImporter} documentation.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* sass.renderSync({
|
||||
* data: '@use "pkg:vuetify";',
|
||||
* pkgImporter: new sass.NodePackageImporter()
|
||||
* });
|
||||
* ```
|
||||
* @category Plugins
|
||||
* @compatibility dart: "2.0", node: false
|
||||
*/
|
||||
pkgImporter?: NodePackageImporter;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
15
node_modules/sass/types/logger/index.d.ts
generated
vendored
15
node_modules/sass/types/logger/index.d.ts
generated
vendored
@@ -1,3 +1,4 @@
|
||||
import {Deprecation} from '../deprecations';
|
||||
import {SourceSpan} from './source_span';
|
||||
|
||||
export {SourceLocation} from './source_location';
|
||||
@@ -43,17 +44,21 @@ export interface Logger {
|
||||
*
|
||||
* @param message - The warning message.
|
||||
* @param options.deprecation - Whether this is a deprecation warning.
|
||||
* @param options.deprecationType - The type of deprecation this warning is
|
||||
* for, if any.
|
||||
* @param options.span - The location in the Sass source code that generated this
|
||||
* warning.
|
||||
* @param options.stack - The Sass stack trace at the point the warning was issued.
|
||||
*/
|
||||
warn?(
|
||||
message: string,
|
||||
options: {
|
||||
deprecation: boolean;
|
||||
span?: SourceSpan;
|
||||
stack?: string;
|
||||
}
|
||||
options: (
|
||||
| {
|
||||
deprecation: true;
|
||||
deprecationType: Deprecation;
|
||||
}
|
||||
| {deprecation: false}
|
||||
) & {span?: SourceSpan; stack?: string}
|
||||
): void;
|
||||
|
||||
/**
|
||||
|
||||
136
node_modules/sass/types/options.d.ts
generated
vendored
136
node_modules/sass/types/options.d.ts
generated
vendored
@@ -1,4 +1,5 @@
|
||||
import {FileImporter, Importer} from './importer';
|
||||
import {DeprecationOrId, Version} from './deprecations';
|
||||
import {FileImporter, Importer, NodePackageImporter} from './importer';
|
||||
import {Logger} from './logger';
|
||||
import {Value} from './value';
|
||||
import {PromiseOr} from './util/promise_or';
|
||||
@@ -122,6 +123,20 @@ export interface Options<sync extends 'sync' | 'async'> {
|
||||
*/
|
||||
charset?: boolean;
|
||||
|
||||
/**
|
||||
* A set of deprecations to treat as fatal.
|
||||
*
|
||||
* If a deprecation warning of any provided type is encountered during
|
||||
* compilation, the compiler will error instead.
|
||||
*
|
||||
* If a `Version` is provided, then all deprecations that were active in that
|
||||
* compiler version will be treated as fatal.
|
||||
*
|
||||
* @category Messages
|
||||
* @compatiblity dart: "1.74.0", node: false
|
||||
*/
|
||||
fatalDeprecations?: (DeprecationOrId | Version)[];
|
||||
|
||||
/**
|
||||
* Additional built-in Sass functions that are available in all stylesheets.
|
||||
* This option takes an object whose keys are Sass function signatures like
|
||||
@@ -198,6 +213,17 @@ export interface Options<sync extends 'sync' | 'async'> {
|
||||
*/
|
||||
functions?: Record<string, CustomFunction<sync>>;
|
||||
|
||||
/**
|
||||
* A set of future deprecations to opt into early.
|
||||
*
|
||||
* Future deprecations passed here will be treated as active by the compiler,
|
||||
* emitting warnings as necessary.
|
||||
*
|
||||
* @category Messages
|
||||
* @compatiblity dart: "1.74.0", node: false
|
||||
*/
|
||||
futureDeprecations?: DeprecationOrId[];
|
||||
|
||||
/**
|
||||
* Custom importers that control how Sass resolves loads from rules like
|
||||
* [`@use`](https://sass-lang.com/documentation/at-rules/use) and
|
||||
@@ -208,8 +234,8 @@ export interface Options<sync extends 'sync' | 'async'> {
|
||||
* - The importer that was used to load the current stylesheet, with the
|
||||
* loaded URL resolved relative to the current stylesheet's canonical URL.
|
||||
*
|
||||
* - Each {@link Importer} or {@link FileImporter} in {@link importers}, in
|
||||
* order.
|
||||
* - Each {@link Importer}, {@link FileImporter}, or
|
||||
* {@link NodePackageImporter} in {@link importers}, in order.
|
||||
*
|
||||
* - Each load path in {@link loadPaths}, in order.
|
||||
*
|
||||
@@ -218,7 +244,7 @@ export interface Options<sync extends 'sync' | 'async'> {
|
||||
*
|
||||
* @category Plugins
|
||||
*/
|
||||
importers?: (Importer<sync> | FileImporter<sync>)[];
|
||||
importers?: (Importer<sync> | FileImporter<sync> | NodePackageImporter)[];
|
||||
|
||||
/**
|
||||
* Paths in which to look for stylesheets loaded by rules like
|
||||
@@ -266,16 +292,30 @@ export interface Options<sync extends 'sync' | 'async'> {
|
||||
* so that they can get fixed as soon as possible!
|
||||
*
|
||||
* **Heads up!** If {@link compileString} or {@link compileStringAsync} is
|
||||
* called without {@link StringOptionsWithoutImporter.url}, <em>all</em>
|
||||
* stylesheets it loads will be considered dependencies. Since it doesn’t have
|
||||
* a path of its own, everything it loads is coming from a load path rather
|
||||
* than a relative import.
|
||||
* called without {@link StringOptions.url}, <em>all</em> stylesheets it loads
|
||||
* will be considered dependencies. Since it doesn’t have a path of its own,
|
||||
* everything it loads is coming from a load path rather than a relative
|
||||
* import.
|
||||
*
|
||||
* @defaultValue `false`
|
||||
* @category Messages
|
||||
*/
|
||||
quietDeps?: boolean;
|
||||
|
||||
/**
|
||||
* A set of active deprecations to ignore.
|
||||
*
|
||||
* If a deprecation warning of any provided type is encountered during
|
||||
* compilation, the compiler will ignore it instead.
|
||||
*
|
||||
* **Heads up!** The deprecated functionality you're depending on will
|
||||
* eventually break.
|
||||
*
|
||||
* @category Messages
|
||||
* @compatiblity dart: "1.74.0", node: false
|
||||
*/
|
||||
silenceDeprecations?: DeprecationOrId[];
|
||||
|
||||
/**
|
||||
* Whether or not Sass should generate a source map. If it does, the source
|
||||
* map will be available as {@link CompileResult.sourceMap}.
|
||||
@@ -348,9 +388,10 @@ export interface Options<sync extends 'sync' | 'async'> {
|
||||
* Options that can be passed to {@link compileString} or {@link
|
||||
* compileStringAsync}.
|
||||
*
|
||||
* If the {@link StringOptionsWithImporter.importer} field isn't passed, the
|
||||
* entrypoint file can load files relative to itself if a `file://` URL is
|
||||
* passed to the {@link url} field.
|
||||
* If the {@link StringOptions.importer} field isn't passed, the entrypoint file
|
||||
* can load files relative to itself if a `file://` URL is passed to the {@link
|
||||
* url} field. If it is passed, the entrypoint file uses it to load files
|
||||
* relative to itself.
|
||||
*
|
||||
* @typeParam sync - This lets the TypeScript checker verify that asynchronous
|
||||
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
|
||||
@@ -358,7 +399,7 @@ export interface Options<sync extends 'sync' | 'async'> {
|
||||
*
|
||||
* @category Options
|
||||
*/
|
||||
export interface StringOptionsWithoutImporter<sync extends 'sync' | 'async'>
|
||||
export interface StringOptions<sync extends 'sync' | 'async'>
|
||||
extends Options<sync> {
|
||||
/**
|
||||
* The {@link Syntax} to use to parse the entrypoint stylesheet.
|
||||
@@ -369,6 +410,19 @@ export interface StringOptionsWithoutImporter<sync extends 'sync' | 'async'>
|
||||
*/
|
||||
syntax?: Syntax;
|
||||
|
||||
/**
|
||||
* The importer to use to handle loads that are relative to the entrypoint
|
||||
* stylesheet.
|
||||
*
|
||||
* A relative load's URL is first resolved relative to {@link url}, then
|
||||
* passed to {@link importer}. (It's passed as-is if {@link url} isn't
|
||||
* passed.) If the importer doesn't recognize it, it's then passed to {@link
|
||||
* importers} and {@link loadPaths}.
|
||||
*
|
||||
* @category Input
|
||||
*/
|
||||
importer?: Importer<sync> | FileImporter<sync>;
|
||||
|
||||
/**
|
||||
* The canonical URL of the entrypoint stylesheet.
|
||||
*
|
||||
@@ -378,62 +432,24 @@ export interface StringOptionsWithoutImporter<sync extends 'sync' | 'async'>
|
||||
* loadPaths}.
|
||||
*
|
||||
* @category Input
|
||||
* @compatibility feature: "Undefined URL with importer", dart: "1.75.0", node: false
|
||||
*
|
||||
* Earlier versions of Dart Sass required {@link url} to be defined when
|
||||
* passing {@link StringOptions.importer}.
|
||||
*/
|
||||
url?: URL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options that can be passed to {@link compileString} or {@link
|
||||
* compileStringAsync}.
|
||||
*
|
||||
* If the {@link StringOptionsWithImporter.importer} field is passed, the
|
||||
* entrypoint file uses it to load files relative to itself and the {@link url}
|
||||
* field is mandatory.
|
||||
*
|
||||
* @typeParam sync - This lets the TypeScript checker verify that asynchronous
|
||||
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
|
||||
* passed to {@link compile} or {@link compileString}.
|
||||
*
|
||||
* @category Options
|
||||
* @deprecated Use {@link StringOptions} instead.
|
||||
*/
|
||||
export interface StringOptionsWithImporter<sync extends 'sync' | 'async'>
|
||||
extends StringOptionsWithoutImporter<sync> {
|
||||
/**
|
||||
* The importer to use to handle loads that are relative to the entrypoint
|
||||
* stylesheet.
|
||||
*
|
||||
* A relative load's URL is first resolved relative to {@link url}, then
|
||||
* passed to {@link importer}. If the importer doesn't recognize it, it's then
|
||||
* passed to {@link importers} and {@link loadPaths}.
|
||||
*
|
||||
* @category Input
|
||||
*/
|
||||
importer: Importer<sync> | FileImporter<sync>;
|
||||
|
||||
/**
|
||||
* The canonical URL of the entrypoint stylesheet. If this is passed along
|
||||
* with {@link importer}, it's used to resolve relative loads in the
|
||||
* entrypoint stylesheet.
|
||||
*
|
||||
* @category Input
|
||||
*/
|
||||
url: URL;
|
||||
}
|
||||
type StringOptionsWithoutImporter<sync extends 'sync' | 'async'> =
|
||||
StringOptions<sync>;
|
||||
|
||||
/**
|
||||
* Options that can be passed to {@link compileString} or {@link
|
||||
* compileStringAsync}.
|
||||
*
|
||||
* This is a {@link StringOptionsWithImporter} if it has a {@link
|
||||
* StringOptionsWithImporter.importer} field, and a {@link
|
||||
* StringOptionsWithoutImporter} otherwise.
|
||||
*
|
||||
* @typeParam sync - This lets the TypeScript checker verify that asynchronous
|
||||
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
|
||||
* passed to {@link compile} or {@link compileString}.
|
||||
*
|
||||
* @category Options
|
||||
* @deprecated Use {@link StringOptions} instead.
|
||||
*/
|
||||
export type StringOptions<sync extends 'sync' | 'async'> =
|
||||
| StringOptionsWithImporter<sync>
|
||||
| StringOptionsWithoutImporter<sync>;
|
||||
type StringOptionsWithImporter<sync extends 'sync' | 'async'> =
|
||||
StringOptions<sync>;
|
||||
|
||||
1300
package-lock.json
generated
Normal file
1300
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
9
package.json
Normal file
9
package.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"sass": "^1.69.5",
|
||||
"sass-loader": "^13.3.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.21"
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,14 @@
|
||||
"path": "pages/order/order",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单列表",
|
||||
"navigationBarBackgroundColor": "#FFD158",
|
||||
"navigationBarBackgroundColor": "#FFD158"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order/confirm_order",
|
||||
"style": {
|
||||
"navigationBarTitleText": "确认订单",
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -56,17 +56,17 @@
|
||||
methods: {
|
||||
scanCodehandle(i) {
|
||||
if (i == 0) {
|
||||
uni.pro.navigateTo('order_food/goodsList_scroll')
|
||||
// uni.scanCode({
|
||||
// success: (res) => {
|
||||
// let tableCode = this.getQueryString(decodeURIComponent(res.result), 'code')
|
||||
// uni.cache.set('tableCode', tableCode)
|
||||
// if (tableCode) {
|
||||
// uni.pro.navigateTo('order_food/order_food')
|
||||
// }
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
let tableCode = this.getQueryString(decodeURIComponent(res.result), 'code')
|
||||
uni.cache.set('tableCode', tableCode)
|
||||
if (tableCode) {
|
||||
uni.pro.navigateTo('order_food/goodsList_scroll')
|
||||
// uni.pro.navigateTo('order_food/order_food')
|
||||
}
|
||||
|
||||
// }
|
||||
// })
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if (this.usershopUserinfo.isVip == 0) {
|
||||
// 跳转到开通页面
|
||||
|
||||
957
pages/order/confirm_order.vue
Normal file
957
pages/order/confirm_order.vue
Normal file
@@ -0,0 +1,957 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 占位符导航栏 -->
|
||||
<navseat class="navbar" :opacity='opacitys' :backColor="'#E8AD7B'" :title='toplist.name' :titleshow='true'></navseat>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view :style="{'height':HeighT.customBar+HeighT.heightBar+'px;background-color: #E8AD7B;position: fixed;top: 0;width: 100%;z-index: 9'}"></view>
|
||||
<view :style="{'height':HeighT.customBar+HeighT.heightBar+'px;background-color: #E8AD7B;'}"></view>
|
||||
<!-- #endif -->
|
||||
<!-- 头部内容 -->
|
||||
<view class="head">
|
||||
<view class="head_bg"></view>
|
||||
<view class="tips">
|
||||
<image class="informIcon" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/informIcon.png" mode="widthFix"/>
|
||||
<text class="informText">温馨提示:请适量点餐,避免浪费</text>
|
||||
</view>
|
||||
<!-- <view class="tabBox"> -->
|
||||
<!-- <view class="tab">
|
||||
<view :class="is_type==(index+1)?'tab_item'+is_type+' tab_item active ':'tab_item'" v-for="(item,index) in is_typeList" :key="index" @click="tabClick(index+1)">
|
||||
<view></view>
|
||||
<image class="icon" :src="is_type==(index+1)?item.url_active:item.url" mode="aspectFill"/>
|
||||
<text class="title" :class="{active:is_type==(index+1)}">{{item.title}}</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 送餐到桌 -->
|
||||
<!-- <view class="table" v-if="is_type==1">
|
||||
<view>
|
||||
<text class="title">桌台</text>
|
||||
</view>
|
||||
<view class="value"> {{ tableValue }} </view>
|
||||
</view> -->
|
||||
<!-- 打包外带 -->
|
||||
<!-- <view class="pack" v-else>
|
||||
<view class="top">
|
||||
<text class="title">后海&双屿</text>
|
||||
<text class="address">浐灞生态区灞河东路东三环至欧亚大道段商业用房09号</text>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item">
|
||||
<view class="lable">取餐时间</view><view class="text">立即取餐</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
|
||||
<view class="lable">预留电话</view><view class="getPhone text"><u-input class="inputVal" v-model="order.phone" input-align="right" placeholder="请输入预留电话以便联系您" ></u-input><text class="getBtn">获取手机号</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- </view> -->
|
||||
</view>
|
||||
<!-- 订单内容区域 -->
|
||||
<view class="content_box">
|
||||
<view class="content">
|
||||
<view class="title"> {{ listinfo.name }} </view>
|
||||
<view class="list_item" v-for="(item,index) in listinfo.details" :key="item.id">
|
||||
<view class="left">
|
||||
<image class="img" :src="item.coverImg" mode="aspectFill"/>
|
||||
<view class="center">
|
||||
<text class="center_title"> {{item.name}} </text>
|
||||
<text class="type"> {{ item.skuName}} </text>
|
||||
<text class="num"> X{{ item.totalNumber}} </text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="price"> ¥{{ item.totalAmount}} </view>
|
||||
</view>
|
||||
<!-- <view class="favorable" v-for="(item,index) in favorable" :key="index">
|
||||
<view class="favorable_left">
|
||||
<image class="icon" :src="item.url" mode="aspectFill"/>
|
||||
<text class="name"> {{ item.name }} </text>
|
||||
</view>
|
||||
<view class="favorable_right"><text class="favorable_right_text">暂无可用优惠券</text> <u-icon name="arrow-right" color="#575B66" size="28"></u-icon></view>
|
||||
</view> -->
|
||||
<view class="totalPrice">
|
||||
<text style="margin-bottom: 5rpx;">小计¥</text>
|
||||
<text class="totalPriceNum"> {{listinfo.payAmount}} </text>
|
||||
</view>
|
||||
<!-- <u-divider color="#fa3534" half-width="200" border-color="#6d6d6d">姑苏城外寒山寺</u-divider> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 订单备注 -->
|
||||
<view class="remark">
|
||||
<view class="remark_bg">
|
||||
<view class="remark_title">订单备注</view>
|
||||
<u-textarea class="remark_value" placeholder="请填写口味、偏好等要求" :type="'textarea'" v-model="remark" :border="false" :clearable="true"/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 支付方式 -->
|
||||
<view class="paymentMethod">
|
||||
<view class="paymentMethod_content">
|
||||
<view class="paymentMethod_title">支付方式</view>
|
||||
<u-radio-group v-model="radiovalue" iconPlacement="right" @change="groupChange" :size="28"
|
||||
placement="column">
|
||||
<block v-for="(item,index) in paymentMethodList" :key="index">
|
||||
<view class="method_list" @click="groupChange(index+1)">
|
||||
<view class="method_list_top">
|
||||
<view class="method_list_top_left">
|
||||
<image class="icon" :src="item.url" mode="widthFix"/>
|
||||
<text class="name"> {{ item.name }} </text>
|
||||
</view>
|
||||
<u-radio activeColor="#E8AD7B" icon-size="36" size="36" :name="index+1">
|
||||
</u-radio>
|
||||
</view>
|
||||
<view class="method_list_bom" v-if="item.type == 1">
|
||||
<text class="balance">会员卡余额 ¥{{amountVIP?amountVIP.amount:0}}</text>
|
||||
<text class="topUpNow" @click="goRecharge">去充值</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</block>
|
||||
|
||||
</u-radio-group>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="bottom">
|
||||
<view class="bottom_left">
|
||||
<text style="margin-bottom: 5rpx;">实付金额</text>
|
||||
<text class="totalAmount">¥{{ listinfo.payAmount }} </text>
|
||||
</view>
|
||||
<view class="paymentBtnText" @tap="$u.debounce(showpopupclickdd, 500)" v-if="listinfoid && listinfo"> {{ paymentBtnText }} </view>
|
||||
<view class="paymentBtnText" @tap="$u.debounce(orderdetail, 500)" v-else> {{ paymentBtnText }} </view>
|
||||
</view>
|
||||
|
||||
<!-- 支付密码 -->
|
||||
<payPassword ref="payPwd" @accountPayevent="accountPayevent" v-if="ispws"></payPassword>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import navseat from '@/components/navseat.vue'
|
||||
import webSocketUtils from '@/common/js/websocket.js'
|
||||
import payPassword from '@/components/payPassword.vue'
|
||||
export default {
|
||||
components: {
|
||||
payPassword,
|
||||
navseat
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
opacitys: false,
|
||||
toplist: {
|
||||
name: '确认订单'
|
||||
},
|
||||
is_type: 1,
|
||||
is_typeList: [
|
||||
{ title: "送餐到桌", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab1.png" , url_active: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab1_active.png"},
|
||||
{ title: "打包外带", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab2.png" , url_active: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab2_active.png"},
|
||||
],
|
||||
orderList: [
|
||||
{ name: "美式咖啡", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/img.png", type: "热+浓郁型+2份浓郁型浓缩", num: 1, Price: 33,},
|
||||
{ name: "美式咖啡", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/img.png", type: "热+浓郁型+2份浓郁型浓缩", num: 1, Price: 33,},
|
||||
{ name: "美式咖啡", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/img.png", type: "热+浓郁型+2份浓郁型浓缩", num: 1, Price: 33,},
|
||||
{ name: "美式咖啡", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/img.png", type: "热+浓郁型+2份浓郁型浓缩", num: 1, Price: 33,},
|
||||
{ name: "美式咖啡", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/img.png", type: "热+浓郁型+2份浓郁型浓缩", num: 1, Price: 33,},
|
||||
],
|
||||
favorable: [
|
||||
{ name: "优惠券", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/coupon.png"},
|
||||
{ name: "团购优惠", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/groupOffer.png"},
|
||||
],
|
||||
paymentMethodList:[
|
||||
{ name: "会员卡支付", type: "1", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"},
|
||||
{ name: "微信支付", type: "2", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png"},
|
||||
],
|
||||
order: {
|
||||
phone: "",
|
||||
},
|
||||
cartLists: [],
|
||||
listinfo: {
|
||||
details: [],
|
||||
payAmount: 0,
|
||||
name: "",
|
||||
},
|
||||
tableValue: "A203", // 桌台号
|
||||
totalPrice: 0, // 小计金额
|
||||
totalAmount: 20, // 支付金额
|
||||
remark: "", // 备注
|
||||
radiovalue: 1, // 支付方式
|
||||
ispws: false, // 输入支付密码
|
||||
amountVIP: null, // 会员信息
|
||||
listinfoid: null,
|
||||
paymentBtnText: "会员卡支付",
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
HeighT() { //手机类型的尺寸
|
||||
return this.$store.getters.is_BarHeight
|
||||
},
|
||||
},
|
||||
onUnload() {
|
||||
console.log(this)
|
||||
this.socketTicket.Close()
|
||||
uni.$off('getMessage')
|
||||
this.ispws = false
|
||||
},
|
||||
onHide() {
|
||||
this.socketTicket.Close()
|
||||
uni.$off('message')
|
||||
},
|
||||
onLoad(e) {
|
||||
this.listinfo.name = JSON.parse(e.storeInfo).shopName;
|
||||
},
|
||||
onShow() {
|
||||
uni.$on('message', this.getMessage)
|
||||
if (this.listinfoid) {
|
||||
this.orderorderInfo()
|
||||
} else {
|
||||
this.handlemessage()
|
||||
}
|
||||
this.getAount()
|
||||
},
|
||||
methods: {
|
||||
|
||||
/**
|
||||
* 消息监听
|
||||
* @param {Object} msg
|
||||
*/
|
||||
getMessage(msg) {
|
||||
if (msg == 1) { // 网络在连接
|
||||
return false
|
||||
}
|
||||
if (msg.type == 'heartbeat') { //后台心跳 处理返回 不然控制台一直报错
|
||||
return false
|
||||
}
|
||||
if (msg.status != 'success') {
|
||||
uni.showToast({
|
||||
title: msg.msg,
|
||||
icon: "none",
|
||||
})
|
||||
return false;
|
||||
|
||||
} else {
|
||||
switch (msg.type) {
|
||||
case 'createOrder':
|
||||
this.listinfoid = msg.data.id
|
||||
uni.$off('getMessage')
|
||||
this.orderorderInfo(1)
|
||||
break;
|
||||
case 'addCart':
|
||||
console.log("商品列表===",msg)
|
||||
this.listinfo.details = msg.data;
|
||||
this.listinfo.payAmount = msg.amount;
|
||||
|
||||
break;
|
||||
case 'order':
|
||||
uni.navigateBack()
|
||||
setTimeout(() => {
|
||||
uni.showToast({
|
||||
title: '您的小伙伴已下单了哦~~'
|
||||
})
|
||||
}, 1000)
|
||||
break;
|
||||
case 'addcart':
|
||||
/*插入一条弹幕*/
|
||||
this.$refs.lBarrage.add(
|
||||
`${msg.reqData.nickName?msg.reqData.nickName:'微信用户'}${msg.reqData.num==-1?'取消了':'添加了'}${msg.reqData.name}(${msg.reqData.num})`
|
||||
);
|
||||
break;
|
||||
}
|
||||
this.$set(this, 'cartLists', msg)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 监听送餐/打包切换
|
||||
* @param {Object} val
|
||||
*/
|
||||
tabClick ( val ) {
|
||||
this.is_type = val;
|
||||
console.log(this.is_type)
|
||||
},
|
||||
|
||||
/**
|
||||
* 监听支付方式切换
|
||||
* @param {Object} n
|
||||
*/
|
||||
groupChange(n) {
|
||||
this.radiovalue = n;
|
||||
this.paymentBtnText = n==1?'会员卡支付':'微信支付'
|
||||
},
|
||||
|
||||
/**
|
||||
* 初始化socket
|
||||
*/
|
||||
handlemessage() {
|
||||
//调用前先判断是否有socket正在进行 先关闭后链接
|
||||
this.socketTicket ? this.socketTicket.Close() : null
|
||||
this.socketTicket = new webSocketUtils(`${uni.conf.baseUrlwws}`, 5000, {
|
||||
tableId: uni.cache.get('tableCode'),
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
"type": "connect",
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 数据处理
|
||||
* @param {Object} data
|
||||
*/
|
||||
socketSendMsg(data) {
|
||||
if (this.socketTicket) {
|
||||
this.socketTicket.send(data);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取会员信息
|
||||
*/
|
||||
async getAount() {
|
||||
let res = await this.api.shopUserInfo({
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
})
|
||||
if (res.code == 0) {
|
||||
console.log("会员信息===",res)
|
||||
this.amountVIP = res.data
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询订单信息
|
||||
* @param {Object} i
|
||||
*/
|
||||
async orderorderInfo(i) {
|
||||
console.log(this.listinfo)
|
||||
let res = await this.api.orderorderInfo({
|
||||
orderId: this.listinfoid
|
||||
})
|
||||
if (res.code == 0) {
|
||||
console.log(res)
|
||||
// this.listinfo = res.data
|
||||
if (i == 1) { //请求完了详情在去调支付
|
||||
this.showpopupclickdd()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 去充值
|
||||
*/
|
||||
goRecharge() {
|
||||
// 判断是否绑定手机,只有下单时候有,会员列表肯定有
|
||||
// console.log(this.amountVIP.isVip, '调试1')
|
||||
if (this.amountVIP.isVip == 0) {
|
||||
// 跳转到开通页面
|
||||
uni.navigateTo({
|
||||
url: '/pages/member/activatedmemberone?shopId=' + uni.cache.get('shopUser')
|
||||
})
|
||||
} else {
|
||||
uni.pro.navigateTo('/pages/member/index', {
|
||||
shopId: uni.cache.get('shopUser')
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生成订单
|
||||
*/
|
||||
orderdetail() {
|
||||
console.log(this.radiovalue)
|
||||
let data = {
|
||||
"skuId": '',
|
||||
"num": '', //数量
|
||||
"type": "createOrder", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”,
|
||||
"remark": this.remark,
|
||||
"couponsId": '', //优惠券ID,
|
||||
"isYhq": 0, // 是否使用优惠券( 1: 使用, 0: 不使用),
|
||||
"isBuyYhq": 0, // 是否购买优惠券( 1: 购买, 0: 不够买)
|
||||
"productId": '', //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
}
|
||||
uni.$u.debounce(this.socketSendMsg(data), 500)
|
||||
},
|
||||
|
||||
/**
|
||||
* 去支付
|
||||
*/
|
||||
showpopupclickdd() {
|
||||
console.log(this.radiovalue)
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
// radiovalue为2是微信支付
|
||||
if (this.radiovalue == 2) {
|
||||
this.showpopupclickdds() //微信支付
|
||||
} else {
|
||||
// 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码
|
||||
// console.log(isPwd,'是否设置了支付密码')
|
||||
if (uni.cache.get('userInfo').isPwd == 0) {
|
||||
uni.pro.navigateTo('/pages/user/repairpassword', {
|
||||
shopId_id: uni.cache.get('shopUser')
|
||||
})
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
this.ispws = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.payPwd.onPayUp();
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 微信支付
|
||||
*/
|
||||
async showpopupclickdds() {
|
||||
console.log(this.listinfoid)
|
||||
let res = await this.api.payorderPay({
|
||||
orderId: this.listinfoid
|
||||
}) //判断是否支付成功
|
||||
if (res.code == 0) {
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
// 微信支付还是余额支付
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay', //支付类型-固定值
|
||||
partnerid: res.data.appId, // 微信支付商户号
|
||||
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
|
||||
nonceStr: res.data.nonceStr, // 随机字符串
|
||||
package: res.data.package, // 固定值
|
||||
signType: res.data.signType, //固定值
|
||||
paySign: res.data.paySign, //签名
|
||||
success: (res) => {
|
||||
let _this = this
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
|
||||
complete() {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
})
|
||||
// uni.cache.set('shopUser', '') //删除shopUser
|
||||
_this.paymodfiyOrderInfo()
|
||||
uni.redirectTo({
|
||||
url: '/pages/order/order_detail?orderId=' + _this
|
||||
.listinfoid
|
||||
});
|
||||
},
|
||||
})
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
uni.hideLoading()
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 支付完成后请求
|
||||
*/
|
||||
async paymodfiyOrderInfo() {
|
||||
let res = await this.api.paymodfiyOrderInfo({
|
||||
orderId: this.listinfoid,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 余额支付
|
||||
* @param {Object} pwd
|
||||
*/
|
||||
async accountPayevent(pwd) {
|
||||
this.ispws = false
|
||||
let res = await this.api.accountPay({
|
||||
orderId: this.listinfoid,
|
||||
memberId: this.amountVIP.id,
|
||||
pwd: pwd
|
||||
})
|
||||
if (res.code == 0) {
|
||||
// data ->1 支付成功
|
||||
// ->2 余额不足
|
||||
// ->3 未设置支付密码,
|
||||
// ->4 不是会员,
|
||||
if (res.data == 1) {
|
||||
this.showToastUppop('支付成功')
|
||||
let _this = this
|
||||
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
|
||||
complete() {
|
||||
uni.redirectTo({
|
||||
url: '/pages/order/order_detail?orderId=' + _this
|
||||
.listinfoid
|
||||
});
|
||||
},
|
||||
})
|
||||
|
||||
} else if (res.data == 2) {
|
||||
this.showToastUppop('余额不足')
|
||||
setTimeout(() => {
|
||||
// 去充值
|
||||
this.goRecharge()
|
||||
}, 1500)
|
||||
} else if (res.data == 3) {
|
||||
this.showToastUppop('未设置支付密码')
|
||||
setTimeout(() => {
|
||||
uni.pro.navigateTo('/pages/user/repairpassword', {
|
||||
shopId_id: uni.cache.get('shopUser')
|
||||
})
|
||||
}, 1500)
|
||||
|
||||
} else if (res.data == 4) {
|
||||
this.showToastUppop('非会员请充值')
|
||||
setTimeout(() => {
|
||||
// 去充值
|
||||
this.goRecharge()
|
||||
}, 1500)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
showToastUppop(title) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title,
|
||||
success: () => {
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.head{
|
||||
width: 100%;
|
||||
padding: $uni-spacing-row-base;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
.head_bg{
|
||||
height: 456rpx;
|
||||
background: linear-gradient( 180deg, #E8AD7B 0%, #F5F5F5 100%);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
margin: auto;
|
||||
}
|
||||
.tips{
|
||||
width: 100%;
|
||||
height: 64rpx;
|
||||
line-height: 64rpx;
|
||||
background: #FFF8E8;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
padding: 0 16rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.informIcon{
|
||||
width: 26.7rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
.informText{
|
||||
font-size: $uni-font-size-base;
|
||||
color: #FF803D;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
.tabBox{
|
||||
width: 100%;
|
||||
margin-top: 52rpx;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
.tab{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-radius: 22rpx;
|
||||
background-color: $uni-bg-color;
|
||||
.tab_item{
|
||||
width: 50%;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 30rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #FEFBF8;
|
||||
border-radius: 22rpx 22rpx 0 0;
|
||||
position: relative;
|
||||
.title{
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
position:relative;
|
||||
z-index: 1;
|
||||
}
|
||||
.title.active{
|
||||
color: #E8AD7B;
|
||||
}
|
||||
.icon{
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
margin-right: 16rpx;
|
||||
position:relative;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
.tab_item.active{
|
||||
background-color: #fff;
|
||||
}
|
||||
// .tab_item.active:after {
|
||||
// content: "";
|
||||
// position: absolute;
|
||||
// top: 0;
|
||||
// left: -4px;
|
||||
// width: 40px;
|
||||
// height: 26px;
|
||||
// background: orange;
|
||||
// }
|
||||
.tab_item.active:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: -20rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
border-radius: 2px;
|
||||
background: #fff;
|
||||
transform: skewX(0deg);
|
||||
}
|
||||
.tab_item1.active:before{
|
||||
border-radius: 22rpx 40rpx 0 0;
|
||||
}
|
||||
.tab_item2.active:before{
|
||||
border-radius: 40rpx 22rpx 0 0;
|
||||
}
|
||||
}
|
||||
.table{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
height: 90rpx;
|
||||
background-color: $uni-bg-color;
|
||||
border-radius: 0 0 22rpx 22rpx;
|
||||
.title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #E8AD7B;
|
||||
}
|
||||
.value{
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.pack{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: $uni-bg-color;
|
||||
border-radius: 0 0 22rpx 22rpx;
|
||||
.top{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 8rpx;
|
||||
.title{
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.address{
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.list{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.item{
|
||||
height: 70rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
.lable{
|
||||
color: #666;
|
||||
font-weight: 500;
|
||||
}
|
||||
.getPhone{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.u-input{
|
||||
width: 340rpx;
|
||||
border: none;
|
||||
input{
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
|
||||
}
|
||||
.input-placeholder{
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.text,.getBtn{
|
||||
color: #E8AD7B;
|
||||
}
|
||||
.getBtn{
|
||||
border-radius: 12rpx;
|
||||
border: 2rpx solid #E8AD7B;
|
||||
padding: 8rpx 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content_box{
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
margin-top: 10rpx;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
.content{
|
||||
background-color: $uni-bg-color;
|
||||
border-radius: 22rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 30rpx 0;
|
||||
box-sizing: border-box;
|
||||
.title{
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
margin-bottom: 32rpx;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.list_item{
|
||||
display: flex;
|
||||
margin-bottom: 32rpx;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
.left{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
.img{
|
||||
width: 142rpx;
|
||||
height: 142rpx;
|
||||
margin-right: 34rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.center{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.center_title{
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
.type{
|
||||
margin: 12rpx 0 10rpx 0;
|
||||
}
|
||||
.type,.num{
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.price{
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
.favorable{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 32rpx;
|
||||
.favorable_left{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.icon{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
.name{
|
||||
font-size: 28rpx;
|
||||
font-weight: 400rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
.favorable_right{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.favorable_right_text{
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
font-weight: 400rpx;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.totalPrice{
|
||||
padding: 32rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
border-top: 2rpx solid #E5E5E5;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: flex-end;
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
.totalPriceNum{
|
||||
font-size: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.remark{
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
margin-top: 30rpx;
|
||||
.remark_bg{
|
||||
background-color: $uni-bg-color;
|
||||
border-radius: 22rpx;
|
||||
padding: 32rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
.remark_title{
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.u-textarea{
|
||||
height: 148rpx;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 10rpx;
|
||||
padding: 32rpx 22rpx!important;
|
||||
box-sizing: border-box;
|
||||
textarea{
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.paymentMethod{
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
margin-top: 30rpx;
|
||||
padding-bottom: 246rpx;
|
||||
.paymentMethod_content{
|
||||
background-color: $uni-bg-color;
|
||||
border-radius: 22rpx;
|
||||
padding:30rpx 0;
|
||||
box-sizing: border-box;
|
||||
.paymentMethod_title{
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 30rpx;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.method_list{
|
||||
padding: 20rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
.method_list_top{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.method_list_top_left{
|
||||
display: flex;
|
||||
.icon{
|
||||
width: 54rpx!important;
|
||||
margin-right: 22rpx;
|
||||
}
|
||||
.name{
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
.method_list_bom{
|
||||
display: flex;
|
||||
.balance{
|
||||
margin-right: 20rpx;
|
||||
margin-left: 70rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.topUpNow{
|
||||
color: #FF803D;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.method_list:nth-child(odd){
|
||||
border-bottom: 2rpx solid #ccc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottom{
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx -6rpx 14rpx 2rpx rgba(0,0,0,0.1);
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 32rpx 50rpx 82rpx 50rpx;
|
||||
box-sizing: border-box;
|
||||
z-index: 9;
|
||||
.bottom_left{
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
align-items: flex-end;
|
||||
.totalAmount{
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
}
|
||||
.paymentBtnText{
|
||||
width: 216rpx;
|
||||
height: 76rpx;
|
||||
line-height: 76rpx;
|
||||
background: #E8AD7B;
|
||||
border-radius: 36rpx 36rpx 36rpx 36rpx;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -67,14 +67,20 @@
|
||||
<view class="shop-item" v-for="(item1,index1) in item.products" :key="item1.id">
|
||||
<view class="cover langcover" style="width:180rpx; height: 180rpx;"
|
||||
@click.stop="clickspecifications(item1,index,index1)">
|
||||
<c-image style="position: absolute;z-index:2;"
|
||||
<!-- <c-image style="position: absolute;z-index:2;"
|
||||
:src="`${item1.coverImg}?x-oss-process=image/resize,m_lfit,w_90,h_90`" width="180"
|
||||
height="180"></c-image>
|
||||
height="180"></c-image> -->
|
||||
<image style="position: absolute;z-index:2;width: 180rpx; height: 180rpx;"
|
||||
:src="`${item1.coverImg}?x-oss-process=image/resize,m_lfit,w_90,h_90`"
|
||||
:lazy-load='true'></image>
|
||||
</view>
|
||||
<view class="info" style="display: flex;flex-direction: column;justify-content: center;">
|
||||
<view class="name">
|
||||
{{ item1.name }}
|
||||
</view>
|
||||
<view class="namess" v-if="item1.suit>1">
|
||||
起售:{{ item1.suit }}
|
||||
</view>
|
||||
<view class="price-wrap">
|
||||
<view class="price">
|
||||
<text class="i">¥</text>
|
||||
@@ -104,7 +110,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cart-wrap">
|
||||
<view class="cart-wrap" v-if="cartListsdatashow">
|
||||
<view class="cart-content">
|
||||
<view class="left">
|
||||
<image class="icon" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/icon_cart.png"
|
||||
@@ -276,7 +282,8 @@
|
||||
datasocket: {}, //储存传参数据
|
||||
radiovalue: '1', //选择支付方式
|
||||
amountVIP: null, //余额
|
||||
barrageavatar: '' //弹幕头像
|
||||
barrageavatar: '', //弹幕头像
|
||||
cartListsdatashow: false //是否显示购物车
|
||||
};
|
||||
},
|
||||
onPageScroll(e) {
|
||||
@@ -315,8 +322,37 @@
|
||||
this.fixedtrue = true
|
||||
},
|
||||
onShow() {
|
||||
uni.$on('message', this.getMessage)
|
||||
this.productqueryShopIdByTableCode() //获取shop User id
|
||||
if (!uni.cache.get('token')) {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
try {
|
||||
uni.getUserInfo({
|
||||
provider: 'weixin',
|
||||
success: async (infoRes) => {
|
||||
uni.cache.set('weixincode', data.code);
|
||||
let res = await this.api.userwxlogin({
|
||||
code: uni.cache.get('weixincode'), //临时登录凭证
|
||||
rawData: infoRes.rawData
|
||||
})
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('token', res.data.token);
|
||||
uni.cache.set('miniAppOpenId', res.data.userInfo
|
||||
.miniAppOpenId)
|
||||
uni.cache.set('userInfo', res.data.userInfo);
|
||||
uni.$on('message', this.getMessage)
|
||||
this.productqueryShopIdByTableCode() //获取shop User id
|
||||
}
|
||||
},
|
||||
fail: (err) => {}
|
||||
});
|
||||
} catch (e) {}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.$on('message', this.getMessage)
|
||||
this.productqueryShopIdByTableCode() //获取shop User id
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onEnd() { //回调弹幕
|
||||
@@ -330,7 +366,7 @@
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('shopUser', res.data)
|
||||
this.handlemessage() //监听websocket返回
|
||||
this.productqueryProduct() //list 数据
|
||||
// this.productqueryProduct() //list 数据
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
uni.pro.switchTab('index/index')
|
||||
@@ -416,6 +452,8 @@
|
||||
}
|
||||
break;
|
||||
}
|
||||
console.log(this.cartLists.data, 1111111)
|
||||
this.cartListsdatashow = this.cartLists.data.length == 0 ? false : true
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
@@ -567,6 +605,10 @@
|
||||
})
|
||||
return false
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/confirm_order?storeInfo=' + JSON.stringify(this.shopList.storeInfo)
|
||||
});
|
||||
return;
|
||||
uni.navigateTo({
|
||||
url: '/pages/order_detail/indexs?tableId=' + JSON.stringify(this.cartLists)
|
||||
});
|
||||
@@ -885,6 +927,13 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.namess {
|
||||
margin-top: 16rpx;
|
||||
font-size: 24upx;
|
||||
font-weight: 300;
|
||||
color: #a5a5a5;
|
||||
}
|
||||
|
||||
.select-sku-wrap {
|
||||
.t {
|
||||
color: #999;
|
||||
@@ -893,7 +942,7 @@
|
||||
}
|
||||
|
||||
.price-wrap {
|
||||
padding-top: $paddingSize;
|
||||
margin-top: 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
@@ -48,7 +48,7 @@
|
||||
<view class="left"
|
||||
:style="{ top: `${menuInfo.top + menuInfo.height + paddingBtmSize + tabHeadHeight}px` }">
|
||||
<view class="item" v-for="(item, index) in shopList.productInfo" :key="item.id"
|
||||
:class="{ active: titleTopNumIndex == index }" @click="titleClickHandle(item.id,index)">
|
||||
:class="{ active: titleTopNumIndex == index }" @click="titleClickHandle(item.id)">
|
||||
<text>{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -267,8 +267,6 @@
|
||||
showShopInfo: false,
|
||||
showShopsku: false,
|
||||
titleTopNumIndex: 0,
|
||||
titleTopNumIndexFalg: true,
|
||||
timer: null,
|
||||
titleTopNums: [],
|
||||
showCart: false,
|
||||
tableCode: '', //code,
|
||||
@@ -302,7 +300,6 @@
|
||||
backgroundColor: '#000000'
|
||||
});
|
||||
}
|
||||
|
||||
this.countScrollTitle(e.scrollTop);
|
||||
},
|
||||
onLoad(e) {
|
||||
@@ -564,7 +561,6 @@
|
||||
}
|
||||
return res
|
||||
})
|
||||
console.log(this.specifications.tagSnap)
|
||||
this.specifications.tagSnap.forEach((val, index, arr) => { //初始化skuidname的数据 选择第一个
|
||||
this.skuidname.push(val.children[0])
|
||||
})
|
||||
@@ -633,6 +629,10 @@
|
||||
})
|
||||
return false
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/confirm_order?storeInfo=' + JSON.stringify(this.shopList.storeInfo)
|
||||
});
|
||||
return;
|
||||
uni.navigateTo({
|
||||
url: '/pages/order_detail/indexs?tableId=' + JSON.stringify(this.cartLists)
|
||||
});
|
||||
@@ -691,9 +691,7 @@
|
||||
});
|
||||
},
|
||||
// 点击菜单商品滚动到指定为止
|
||||
titleClickHandle(id, index) {
|
||||
this.titleTopNumIndexFalg = false;
|
||||
this.titleTopNumIndex = index;
|
||||
titleClickHandle(id) {
|
||||
uni.createSelectorQuery()
|
||||
.select('#wrapper')
|
||||
.boundingClientRect((data) => {
|
||||
@@ -716,8 +714,7 @@
|
||||
},
|
||||
// 计算滚动到那个标题
|
||||
countScrollTitle: _.throttle(function(top) {
|
||||
|
||||
if (this.titleTopNums.length > 1 && this.titleTopNumIndexFalg) {
|
||||
if (this.titleTopNums.length > 1) {
|
||||
for (let i = 0; i <= this.titleTopNums.length - 1; i++) {
|
||||
if (top >= this.titleTopNums[i] && top < this.titleTopNums[i + 1]) {
|
||||
this.titleTopNumIndex = i;
|
||||
@@ -727,13 +724,6 @@
|
||||
this.titleTopNumIndex = this.titleTopNums.length - 1;
|
||||
}
|
||||
}
|
||||
//这里必须要每次滚动前 清除一次
|
||||
clearTimeout(this.timer)
|
||||
// 如果停留则表示滚动结束 一旦空了1s就判定为滚动结束
|
||||
this.timer = setTimeout(() => {
|
||||
this.titleTopNumIndexFalg = true;
|
||||
// console.log('结束滚动')
|
||||
}, 1000)
|
||||
}, 100),
|
||||
// 统计每个标题到顶部的距离
|
||||
countTitleTopNum() {
|
||||
@@ -742,9 +732,9 @@
|
||||
uni.createSelectorQuery()
|
||||
.select(`#title${i.id}`)
|
||||
.boundingClientRect((res) => {
|
||||
topNums.push(res.top - this.menuInfo.top - this.menuInfo.height - this
|
||||
.paddingBtmSize * 8 -
|
||||
this.tabHeadHeight + 40);
|
||||
topNums.push(res.top + this.menuInfo.top + this.menuInfo.height + this
|
||||
.paddingBtmSize -
|
||||
this.tabHeadHeight - this.tabHeadHeight / 2);
|
||||
})
|
||||
.exec();
|
||||
}
|
||||
|
||||
765
pages/order_food/order_goods.vue
Normal file
765
pages/order_food/order_goods.vue
Normal file
@@ -0,0 +1,765 @@
|
||||
<template>
|
||||
<view id="wrapper">
|
||||
<view v-if="fixedtrue"
|
||||
style="height: 100vh; width: 100%; position: fixed; z-index: 999; top: 0; left: 0; background-color: #fff; display: flex; justify-content: center; align-items: center;">
|
||||
<image style="width: 140rpx; height: 140rpx;" src="@/static/1.gif" mode="aspectFill"></image>
|
||||
<text style="margin-left10rpx;font-size: 40rpx;color: #7d7d76;">加载中</text>
|
||||
<!-- <u-loadmore status="loading" fontSize="50" iconSize="30"/> -->
|
||||
</view>
|
||||
<!-- 占位符导航栏 -->
|
||||
<navseat class="navbar" :opacity='opacitys' :title='toplist.name' :titleshow='true'></navseat>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view :style="{'height':HeighT.customBar+HeighT.heightBar+'px;background-color: #FFFFFF;position: fixed;top: 0;width: 100%;z-index: 9'}"></view>
|
||||
<view :style="{'height':HeighT.customBar+HeighT.heightBar+'px;background-color: #FFFFFF;'}"></view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- <view class="shop-cover" :style="{ height: `${menuInfo.top + menuInfo.height + paddingBtmSize * 8}px` }">
|
||||
<image class="img" :src="shopList.storeInfo.coverImg" mode="aspectFill"></image>
|
||||
</view> -->
|
||||
|
||||
<view class="list-container">
|
||||
|
||||
<view class="shopInfo">
|
||||
<image class="shopTitle" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/shopDetails/title.png" mode="widthFix"/>
|
||||
<view class="shopName">{{ shopList.storeInfo.shopName }}</view>
|
||||
<view class="shopDistance">{{ shopList.storeInfo.shopName }}</view>
|
||||
<view class="shopDetail flex-between">
|
||||
<text class="shopTime">营业时间:{{ shopList.storeInfo.shopName }}</text>
|
||||
<view class="flex-end">查看 <u-icon style="margin-left: 15rpx;" name="arrow-down" color="#575B66" size="28"></u-icon></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<div class="signatureDish dishes">
|
||||
<view class="signatureDish_title"></view>
|
||||
<scroll-view scroll-x class="scroll-view">
|
||||
<view class="signatureDish_list">
|
||||
<view class="signatureDish_item" v-for="(item,index) in signatureDish_list" :key="index">
|
||||
<image class="signatureDish_img" :src="`${item.coverImg}?x-oss-process=image/resize,m_lfit,w_90,h_90`" mode="aspectFill"/>
|
||||
<view class="signatureDish_name"> {{ item.name}}</view>
|
||||
<view class="signatureDish_sort"> {{ item.name}}</view>
|
||||
<view class="signatureDish_introduce"> {{ item.name}}</view>
|
||||
<view class="signatureDish_sell"> {{ item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
</div>
|
||||
|
||||
<view class="tab-content">
|
||||
<view class="left-wrap">
|
||||
<view class="left"
|
||||
:style="{ top: `${menuInfo.top + menuInfo.height + paddingBtmSize + tabHeadHeight}px` }">
|
||||
<view class="item" v-for="(item, index) in shopList.productInfo" :key="item.id"
|
||||
:class="{ active: titleTopNumIndex == index }" @click="titleClickHandle(item.id)">
|
||||
<text>{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-wrap">
|
||||
<view class="item-wrap" v-for="(item,index) in shopList.productInfo" :key="item.id">
|
||||
<view class="title-wrap" :id="`title${item.id}`"></view>
|
||||
<view class="title"
|
||||
:style="{ top: `${menuInfo.top + menuInfo.height + paddingBtmSize + tabHeadHeight}px` }">
|
||||
<!-- -->
|
||||
<text>{{ item.name }}</text>
|
||||
</view>
|
||||
<view class="" v-if="item.products.length == 0">
|
||||
空
|
||||
</view>
|
||||
<view class="shop-item" v-for="(item1,index1) in item.products" :key="item1.id">
|
||||
<view class="cover langcover" style="width:180rpx; height: 180rpx;"
|
||||
@click.stop="clickspecifications(item1,index,index1)">
|
||||
<c-image style="position: absolute;z-index:2;"
|
||||
:src="`${item1.coverImg}?x-oss-process=image/resize,m_lfit,w_90,h_90`" width="180"
|
||||
height="180"></c-image>
|
||||
</view>
|
||||
<view class="info" style="display: flex;flex-direction: column;justify-content: center;">
|
||||
<view class="name">
|
||||
{{ item1.name }}
|
||||
</view>
|
||||
<view class="price-wrap">
|
||||
<view class="price">
|
||||
<text class="i">¥</text>
|
||||
<text class="num">{{ item1.lowPrice }}</text>
|
||||
<text class="i">起</text>
|
||||
</view>
|
||||
<view class="sku-wrap" v-if="item1.productSkuResult != null"
|
||||
@click.stop="clickspecifications(item1,index,index1)">
|
||||
<text class="t">选规格</text>
|
||||
<text class="dot num" v-if="item1.cartNumber != '0'">{{item1.cartNumber}}</text>
|
||||
</view>
|
||||
<view class="operation-wrap" v-else>
|
||||
<view class="btn" v-if="item1.cartNumber != '0'"
|
||||
@click.stop="cartadd(item1,index,index1,'-',item1.productSkuResult == null ? '单规格':'')">
|
||||
<u-icon :name="require('@/static/icon_sub.png')" size="36"></u-icon>
|
||||
</view>
|
||||
<text class="num">{{ item1.cartNumber }}</text>
|
||||
<view class="btn"
|
||||
@click.stop="cartadd(item1,index,index1,'+',item1.productSkuResult == null ? '单规格':'')">
|
||||
<u-icon :name="require('@/static/icon_add.png')" size="36"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cart-wrap">
|
||||
<view class="cart-content">
|
||||
<view class="left">
|
||||
<image class="icon" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/icon_cart.png"
|
||||
mode="aspectFit" @click="showCart = !showCart">
|
||||
</image>
|
||||
<text class="i">¥</text>
|
||||
<text class="num">{{cartLists.amount||'0.00'}}</text>
|
||||
</view>
|
||||
<view class="btn" @tap="$u.debounce(orderdetail, 500)">
|
||||
<text class="t">提交订单</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 购物车 -->
|
||||
<u-popup :show="showCart" :round="20" :zIndex="98" :overlayStyle="{ zIndex: 98 }" @close="showCart = false">
|
||||
<view class="cart-list-wrap">
|
||||
<view class="cart-header">
|
||||
<view class="clear" @click="cartclear">
|
||||
<u-icon name="trash" color="#999"></u-icon>
|
||||
<text class="t">清空购物车</text>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y class="scroll-view">
|
||||
<view class="list-wrap">
|
||||
<view class="shop-item" v-for="(item,index) in cartLists.data" :key="item.id">
|
||||
<view class="cover">
|
||||
<c-image :src="item.coverImg" width="120" height="120"></c-image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="name">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view class="select-sku-wrap">
|
||||
<text class="t">{{ item.skuName }}</text>
|
||||
</view>
|
||||
<view class="price-wrap" style="padding-top: 0;">
|
||||
<view class="price">
|
||||
<text class="i">¥</text>
|
||||
<text class="num">{{ item.salePrice }}</text>
|
||||
<text class="i">起</text>
|
||||
</view>
|
||||
<view class="operation-wrap">
|
||||
<view class="btn" v-if="item.number" @click="cartListadd(item,index,'-')">
|
||||
<u-icon :name="require('@/static/icon_sub.png')" size="34"></u-icon>
|
||||
</view>
|
||||
<text class="num" v-if="item.number">{{ item.number }}</text>
|
||||
<view class="btn" @click="cartListadd(item,index,'+')">
|
||||
<u-icon :name="require('@/static/icon_add.png')" size="34"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
<!-- 门店详情 -->
|
||||
<u-popup :show="showShopInfo" :round="20" @close="showShopInfo = false">
|
||||
<view class="shop-info-wrap">
|
||||
<view class="info-wrap">
|
||||
<image :src="shopList.storeInfo.coverImg" mode="aspectFill" class="img"></image>
|
||||
<text class="t">{{ shopList.storeInfo.shopName }}</text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="col">
|
||||
<text class="t">{{ shopList.storeInfo.businessTime }}</text>
|
||||
</view>
|
||||
<view class="col" @click="makePhoneCall(shopList.storeInfo.phone)">
|
||||
<text class="t">{{ shopList.storeInfo.phone }}</text>
|
||||
</view>
|
||||
<view class="col">
|
||||
<text class="t">{{ shopList.storeInfo.address }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="close" @click="showShopInfo = false">
|
||||
<text class="t">关闭</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
<!-- 规格 -->
|
||||
<u-popup :show="showShopsku" :round="20" mode="bottom" @close="showShopsku = false"
|
||||
:safeAreaInsetBottom='false'>
|
||||
<view class="shop_sku">
|
||||
<view class="positionabsolute">
|
||||
<u-icon name="close-circle-fill" @click="showShopsku = false" color="#a3aaa3" size="60"></u-icon>
|
||||
</view>
|
||||
<image class="shop_skucimage" :src="specifications.coverImg" mode="widthFix"></image>
|
||||
<view class="shop_sku_name">
|
||||
{{specifications.name}}
|
||||
</view>
|
||||
<view class="shop_sku_box" v-for="(item,index) in specifications.tagSnap" :key="index"
|
||||
v-if="specifications.tagSnap">
|
||||
<view class="shop_sku_box_name">
|
||||
{{item.name}}
|
||||
</view>
|
||||
<view class="flex-start">
|
||||
<view class="shop_sku_box_item" v-for="(item1,index1) in item.children" :key="index1"
|
||||
@click="morloe(item1,index,index1,item)"
|
||||
:class=" item.start === index1 ?'shop_sku_box_item_selected':'' ">
|
||||
{{item1}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="shop_skuselect flex-start" v-if="specifications.tagSnap">
|
||||
已选规格:<view class="shop_skuselectname">{{skuidname.toString()}}</view>
|
||||
</view>
|
||||
<view class="shop_bottom flex-between">
|
||||
<view class="price">
|
||||
<text class="i">¥</text>
|
||||
<text class="num">{{salePrice}}</text>
|
||||
<text class="i">起</text>
|
||||
</view>
|
||||
<view class="operation-wrap">
|
||||
<view class="btn"
|
||||
@click="cartadd(specifications,specifications.indexa,specifications.indexb,'-',specifications.tagSnap == null ? '单规格':'')">
|
||||
<u-icon :name="require('@/static/icon_sub.png')" size="34"></u-icon>
|
||||
</view>
|
||||
<text class="num">{{amountcartNumber}}</text>
|
||||
<view class="btn"
|
||||
@click="cartadd(specifications,specifications.indexa,specifications.indexb,'+',specifications.tagSnap == null ? '单规格':'')">
|
||||
<u-icon :name="require('@/static/icon_add.png')" size="34"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<l-barrage ref="lBarrage" @end="onEnd" :minTop='8' :maxTop='20' :avatar='barrageavatar'></l-barrage>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import _ from 'lodash';
|
||||
import webSocketUtils from '@/common/js/websocket.js';
|
||||
import orderdetail from '@/pages/order_detail/index';
|
||||
import lBarrage from '@/components/l-barrage/l-barrage.vue'
|
||||
import navseat from '@/components/navseat.vue'
|
||||
export default {
|
||||
components: {
|
||||
orderdetail,
|
||||
lBarrage,
|
||||
navseat
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
opacitys: false,
|
||||
toplist: {
|
||||
name: ''
|
||||
},
|
||||
userInfo: uni.cache.get('userInfo'), //个人信息
|
||||
// #ifndef MP-WEIXIN
|
||||
menuInfo: uni.getSystemInfo(),
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
menuInfo: uni.getMenuButtonBoundingClientRect(),
|
||||
// #endif
|
||||
signatureDish_list: [],
|
||||
|
||||
|
||||
paddingBtmSize: 6,
|
||||
tabHeadHeight: 50,
|
||||
isFixed: false,
|
||||
shopList: {}, //数据类型
|
||||
active: 0,
|
||||
showShopInfo: false,
|
||||
showShopsku: false,
|
||||
titleTopNumIndex: 0,
|
||||
titleTopNums: [],
|
||||
showCart: false,
|
||||
tableCode: '', //code,
|
||||
specifications: {},
|
||||
skuidname: [],
|
||||
cartLists: {}, //购物车
|
||||
orderdetailcartLists: {}, //提交订单
|
||||
socketTicket: null,
|
||||
amountcartNumber: 0,
|
||||
skuidsearch: '', //
|
||||
salePrice: '', //钱数
|
||||
fixedtrue: true,
|
||||
datasocket: {}, //储存传参数据
|
||||
radiovalue: '1', //选择支付方式
|
||||
amountVIP: null, //余额
|
||||
barrageavatar: '' //弹幕头像
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
HeighT() { //手机类型的尺寸
|
||||
return this.$store.getters.is_BarHeight
|
||||
},
|
||||
},
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop >= (this.menuInfo.top + this.menuInfo.height + this.paddingBtmSize) / 2) {
|
||||
this.isFixed = true;
|
||||
uni.setNavigationBarColor({
|
||||
frontColor: '#000000',
|
||||
backgroundColor: '#ffffff'
|
||||
});
|
||||
} else {
|
||||
this.isFixed = false;
|
||||
uni.setNavigationBarColor({
|
||||
frontColor: '#ffffff',
|
||||
backgroundColor: '#000000'
|
||||
});
|
||||
}
|
||||
this.countScrollTitle(e.scrollTop);
|
||||
},
|
||||
onLoad(e) {
|
||||
if (e.q) {
|
||||
this.tableCode = this.getQueryString(decodeURIComponent(e.q), 'code')
|
||||
uni.cache.set('tableCode', this.tableCode)
|
||||
}
|
||||
uni.cache.set('types', 'types');
|
||||
this.$nextTick(() => {
|
||||
this.countTitleTopNum(); //导航栏
|
||||
});
|
||||
},
|
||||
onUnload() {
|
||||
this.socketTicket.Close()
|
||||
uni.$off('message')
|
||||
},
|
||||
onHide() {
|
||||
this.socketTicket.Close()
|
||||
uni.$off('message')
|
||||
this.fixedtrue = true
|
||||
},
|
||||
onShow() {
|
||||
uni.$on('message', this.getMessage)
|
||||
this.productqueryShopIdByTableCode() //获取shop User id
|
||||
},
|
||||
methods: {
|
||||
onEnd() { //回调弹幕
|
||||
console.log('一波结束')
|
||||
},
|
||||
// 单独获取他的shopUserid
|
||||
async productqueryShopIdByTableCode() {
|
||||
let res = await this.api.productqueryShopIdByTableCode({
|
||||
code: uni.cache.get('tableCode')
|
||||
})
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('shopUser', res.data)
|
||||
this.handlemessage() //监听websocket返回
|
||||
this.productqueryProduct() //list 数据
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
uni.pro.switchTab('index/index')
|
||||
}, 1000)
|
||||
}
|
||||
},
|
||||
getMessage(msg) { //wss 回显数据
|
||||
if (msg == 1) { // 网络在连接
|
||||
this.fixedtrue = true
|
||||
return false
|
||||
}
|
||||
this.fixedtrue = false
|
||||
if (msg.type == 'heartbeat') { //后台心跳 处理返回 不然控制台一直报错
|
||||
return false
|
||||
}
|
||||
try {
|
||||
if (msg.status != 'success') {
|
||||
uni.showToast({
|
||||
title: msg.msg,
|
||||
icon: "none",
|
||||
})
|
||||
if (msg.msg == '桌码不存在') { //卓码不存在直接退出
|
||||
this.socketTicket.Close()
|
||||
uni.$off('message')
|
||||
uni.navigateBack()
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
switch (msg.type) {
|
||||
case 'sku': // sku 数量 查询这个商品的价格和数量
|
||||
this.$set(this, 'amountcartNumber', msg.amount)
|
||||
this.productqueryProduct() //list 数据
|
||||
break;
|
||||
case 'clearCart':
|
||||
this.cartLists = msg
|
||||
this.productqueryProduct() //list 数据
|
||||
this.skuidname = []
|
||||
this.showCart = false
|
||||
setTimeout(() => {
|
||||
uni.showToast({
|
||||
title: msg.msg,
|
||||
icon: "none",
|
||||
})
|
||||
}, 500)
|
||||
break;
|
||||
case 'order':
|
||||
this.skuidname = []
|
||||
this.showCart = false
|
||||
this.cartLists = msg
|
||||
this.productqueryProduct() //list 数据
|
||||
break;
|
||||
case 'addCart': //初始化add
|
||||
this.cartLists = msg
|
||||
this.productqueryProduct() //list 数据
|
||||
break;
|
||||
case 'addcart':
|
||||
this.cartLists = msg
|
||||
console.log(msg, 1111)
|
||||
this.productqueryProduct() //list 数据
|
||||
try {
|
||||
if (msg.data.length != 0) {
|
||||
let nums = 0
|
||||
msg.data.forEach((item, index, arr) => { //初始化skuidname的数据 选择第一个
|
||||
if (item.skuId == this.skuidsearch) {
|
||||
nums = item.number
|
||||
}
|
||||
})
|
||||
this.$set(this, 'amountcartNumber', nums)
|
||||
} else {
|
||||
this.$set(this, 'amountcartNumber', 0)
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
try {
|
||||
this.barrageavatar = msg.reqData.headImg
|
||||
/*插入一条弹幕*/
|
||||
this.$refs.lBarrage.add(
|
||||
`${msg.reqData.nickName?msg.reqData.nickName:'微信用户'}${msg.reqData.num==-1?'取消了':'添加了'}${msg.reqData.name}(${msg.reqData.num})`
|
||||
);
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
},
|
||||
handlemessage() {
|
||||
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
||||
this.socketTicket = new webSocketUtils(`${uni.conf.baseUrlwws}`, 5000, {
|
||||
tableId: uni.cache.get('tableCode'),
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
"type": "connect",
|
||||
})
|
||||
},
|
||||
// 数据处理
|
||||
socketSendMsg(data) {
|
||||
if (this.socketTicket) {
|
||||
this.socketTicket.send(data);
|
||||
}
|
||||
},
|
||||
getQueryString(url, name) { //解码
|
||||
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
|
||||
var r = url.substr(1).match(reg)
|
||||
if (r != null) {
|
||||
return r[2]
|
||||
}
|
||||
return null;
|
||||
},
|
||||
async cartadd(item, index, index1, a, b) { //列表添加 a传参加减号 b是判断单规格多规格
|
||||
if (b == '单规格') { //没有规格为空
|
||||
this.skuidname = []
|
||||
}
|
||||
this.hodgepodge(item, 1, a) //获取skuid /1添加购物车
|
||||
},
|
||||
async cartListadd(item, index, a) { //购物车加减
|
||||
try {
|
||||
const data = { //定义socket数据传参
|
||||
"name": item.name,
|
||||
"skuId": item.skuId,
|
||||
"num": a == '-' ? -1 : 1, //skuId
|
||||
"type": "addcart", //“addcart:添加购物车,create0rder:生成订单,clearCart:清空购物车”,
|
||||
"productId": item.productId, //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"userId": uni.cache.get('userInfo').id
|
||||
};
|
||||
this.datasocket = data
|
||||
uni.$u.debounce(this.socketSendMsg(data), 500)
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
},
|
||||
async productqueryProduct() { //list 数据
|
||||
let res = await this.api.productqueryProduct({
|
||||
code: uni.cache.get('tableCode'),
|
||||
productGroupId: ''
|
||||
})
|
||||
if (res.code == 0) {
|
||||
this.shopList = res.data
|
||||
this.signatureDish_list = res.data.productInfo[0].products
|
||||
this.$nextTick(() => {
|
||||
this.countTitleTopNum();
|
||||
});
|
||||
}
|
||||
},
|
||||
clickspecifications(item1, index, index1) {
|
||||
this.skuidname = []
|
||||
this.specifications = item1
|
||||
this.specifications.indexa = index
|
||||
this.specifications.indexb = index1
|
||||
try {
|
||||
if (item1.productSkuResult == null) {
|
||||
// 但但单个规格弹框的处理
|
||||
this.hodgepodge(this.specifications, 2) //获取skuid /2查找价格和数量
|
||||
} else {
|
||||
// 多规格数据处理
|
||||
this.specifications.tagSnap = JSON.parse(item1.productSkuResult.tagSnap).map((item) => {
|
||||
let res = {
|
||||
id: item1.id, //商品id
|
||||
name: item.name,
|
||||
start: 0,
|
||||
children: item.value.split(",")
|
||||
}
|
||||
return res
|
||||
})
|
||||
this.specifications.tagSnap.forEach((val, index, arr) => { //初始化skuidname的数据 选择第一个
|
||||
this.skuidname.push(val.children[0])
|
||||
})
|
||||
this.hodgepodge(this.specifications.tagSnap[0], 2) //获取skuid /2查找价格和数量
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
},
|
||||
async morloe(e, index, index1, item) {
|
||||
this.specifications.tagSnap[index]['start'] = index1
|
||||
this.skuidname.splice(index, 1, e) //替换skuidname的数据
|
||||
this.hodgepodge(item, 2)
|
||||
},
|
||||
async hodgepodge(item, a, c) { //此接口去获取商品id !!!赋值库存 数量 价格等
|
||||
try {
|
||||
let res = await this.api.productqueryProductSku({
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
productId: item.id, //商品id
|
||||
spec_tag: this.skuidname.join(",")
|
||||
})
|
||||
if (res.stockNumber == 0) {
|
||||
uni.showToast({
|
||||
title: '暂无库存',
|
||||
icon: "none",
|
||||
})
|
||||
} else {
|
||||
this.skuidsearch = res.data.id // 储存skuid 用于筛选数量
|
||||
this.salePrice = res.data.salePrice // 价格
|
||||
let data = null
|
||||
if (a == 1) { //1添加购物车 2是websocket返回这个商品的价格(应为不同的多规格商品返回不同的价格)
|
||||
data = { //定义socket数据传参
|
||||
"nickName": this.userInfo.nickName,
|
||||
"barrageavatar": this.userInfo.headImg,
|
||||
'name': item.name,
|
||||
"skuId": res.data.id,
|
||||
"num": c == '-' ? -1 : 1, //数量
|
||||
"type": "addcart", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”,
|
||||
"productId": item.id, //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"userId": uni.cache.get('userInfo').id
|
||||
};
|
||||
} else {
|
||||
data = { //查询这个商品的价格
|
||||
"name": item.name,
|
||||
"skuId": res.data.id,
|
||||
"num": '', //数量
|
||||
"type": "sku", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”,
|
||||
"productId": item.id, //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"userId": uni.cache.get('userInfo').id
|
||||
};
|
||||
this.showShopsku = true //打开弹框
|
||||
}
|
||||
this.datasocket = data
|
||||
uni.$u.debounce(this.socketSendMsg(data), 500)
|
||||
}
|
||||
} catch (e) {}
|
||||
},
|
||||
orderdetail() { // 直接生成订单
|
||||
if (this.cartLists.data.length == 0) {
|
||||
uni.showToast({
|
||||
title: '请先添加商品',
|
||||
icon: 'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/confirm_order?storeInfo=' + JSON.stringify(this.shopList.storeInfo)
|
||||
});
|
||||
return;
|
||||
uni.navigateTo({
|
||||
url: '/pages/order_detail/indexs?tableId=' + JSON.stringify(this.cartLists)
|
||||
});
|
||||
// let data = {
|
||||
// "skuId": '',
|
||||
// "num": '', //数量
|
||||
// "type": "createOrder", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”,
|
||||
// "couponsId": '', //优惠券ID,
|
||||
// "isYhq": 0, // 是否使用优惠券( 1: 使用, 0: 不使用),
|
||||
// "isBuyYhq": 0, // 是否购买优惠券( 1: 购买, 0: 不够买)
|
||||
// "productId": '', //商品id
|
||||
// "shopId": uni.cache.get('shopUser'),
|
||||
// "userId": uni.cache.get('userInfo').id,
|
||||
// }
|
||||
// this.datasocket = data
|
||||
// uni.$u.debounce(this.socketSendMsg(data), 500)
|
||||
},
|
||||
async cartclear() { //清空购物车
|
||||
try {
|
||||
const data = { //定义socket数据传参
|
||||
"skuId": '',
|
||||
"num": '', //skuId
|
||||
"type": "clearCart", //“addcart:添加购物车,create0rder:生成订单,clearCart:清空购物车”,
|
||||
"productId": '', //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"userId": uni.cache.get('userInfo').id
|
||||
};
|
||||
this.datasocket = data
|
||||
uni.$u.debounce(this.socketSendMsg(data), 500)
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
},
|
||||
// 导航栏点击
|
||||
navClickHandle(t) {
|
||||
switch (t) {
|
||||
case 1:
|
||||
// 返回
|
||||
this.socketTicket.Close()
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
break;
|
||||
case 2:
|
||||
// 显示商家信息
|
||||
this.showShopInfo = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
//打电话
|
||||
makePhoneCall(phone) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: phone //仅为示例
|
||||
});
|
||||
},
|
||||
// 点击菜单商品滚动到指定为止
|
||||
titleClickHandle(id) {
|
||||
uni.createSelectorQuery()
|
||||
.select('#wrapper')
|
||||
.boundingClientRect((data) => {
|
||||
//目标节点
|
||||
uni.createSelectorQuery()
|
||||
.select(`#title${id}`)
|
||||
.boundingClientRect((res) => {
|
||||
const scrollTop = res.top - data.top;
|
||||
const offsetNum = this.menuInfo.top + this.menuInfo.height + this
|
||||
.paddingBtmSize +
|
||||
this.tabHeadHeight - 1;
|
||||
//最外层盒子节点
|
||||
uni.pageScrollTo({
|
||||
scrollTop: scrollTop - offsetNum
|
||||
});
|
||||
})
|
||||
.exec();
|
||||
})
|
||||
.exec();
|
||||
},
|
||||
// 计算滚动到那个标题
|
||||
countScrollTitle: _.throttle(function(top) {
|
||||
if (this.titleTopNums.length > 1) {
|
||||
for (let i = 0; i <= this.titleTopNums.length - 1; i++) {
|
||||
if (top >= this.titleTopNums[i] && top < this.titleTopNums[i + 1]) {
|
||||
this.titleTopNumIndex = i;
|
||||
}
|
||||
}
|
||||
if (top >= this.titleTopNums[this.titleTopNums.length - 1]) {
|
||||
this.titleTopNumIndex = this.titleTopNums.length - 1;
|
||||
}
|
||||
}
|
||||
}, 100),
|
||||
// 统计每个标题到顶部的距离
|
||||
countTitleTopNum() {
|
||||
let topNums = [];
|
||||
for (let i of this.shopList.productInfo) {
|
||||
uni.createSelectorQuery()
|
||||
.select(`#title${i.id}`)
|
||||
.boundingClientRect((res) => {
|
||||
topNums.push(res.top + this.menuInfo.top + this.menuInfo.height + this
|
||||
.paddingBtmSize -
|
||||
this.tabHeadHeight - this.tabHeadHeight / 2);
|
||||
})
|
||||
.exec();
|
||||
}
|
||||
this.titleTopNums = topNums;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
#wrapper{
|
||||
background-color: #fff;
|
||||
}
|
||||
.shopInfo{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
.shopTitle{
|
||||
width: 382rpx;
|
||||
margin: 0 auto 30rpx auto;
|
||||
}
|
||||
.shopName{
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.shopDistance{
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
.shopDetail{
|
||||
margin-top: 32rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
.shopTime{
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.signatureDish{
|
||||
width: 100%;
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
.signatureDish_list{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
.signatureDish_item{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-right: 30rpx;
|
||||
.signatureDish_img{
|
||||
width: 340rpx;
|
||||
height: 204rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user