init
This commit is contained in:
commit
bbcdaec746
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# uview-ui/
|
||||||
|
# node_modules/
|
||||||
|
|
||||||
|
|
23
.hbuilderx/launch.json
Normal file
23
.hbuilderx/launch.json
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
// launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||||
|
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||||
|
"version" : "0.0",
|
||||||
|
"configurations" : [
|
||||||
|
{
|
||||||
|
"app-plus" : {
|
||||||
|
"launchtype" : "local"
|
||||||
|
},
|
||||||
|
"default" : {
|
||||||
|
"launchtype" : "local"
|
||||||
|
},
|
||||||
|
"mp-weixin" : {
|
||||||
|
"launchtype" : "local"
|
||||||
|
},
|
||||||
|
"type" : "uniCloud"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"playground" : "custom",
|
||||||
|
"type" : "uni-app:app-android"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
26
App.vue
Normal file
26
App.vue
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
onLaunch: function() {
|
||||||
|
uni.onTabBarMidButtonTap(()=>{
|
||||||
|
uni.switchTab({
|
||||||
|
url:"/pages/wallet/index"
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onShow: function() {
|
||||||
|
console.log('App Show')
|
||||||
|
},
|
||||||
|
onHide: function() {
|
||||||
|
console.log('App Hide')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
@import "uview-ui/index.scss";
|
||||||
|
.uni-tabbar__item:nth-child(4) .uni-tabbar__icon {
|
||||||
|
width: 40px !important;
|
||||||
|
height: 40px !important;
|
||||||
|
// margin-top: -10px !important;
|
||||||
|
}
|
||||||
|
</style>
|
250
common/demo.js
Normal file
250
common/demo.js
Normal file
@ -0,0 +1,250 @@
|
|||||||
|
const express = require('express');
|
||||||
|
const {Web3} = require('web3');
|
||||||
|
const axios = require('axios');
|
||||||
|
const cors = require('cors');
|
||||||
|
const bip39 = require('bip39');
|
||||||
|
const util = require('ethereumjs-util');
|
||||||
|
const {hdkey} = require('ethereumjs-wallet');
|
||||||
|
const BSCSCAN_API_KEY = '1UQ3PHID4UJUDTVD4EJK35PZB8XDKS7K9T';
|
||||||
|
|
||||||
|
const app = express();
|
||||||
|
const web3 = new Web3('https://bsc-dataseed1.binance.org:443');
|
||||||
|
//便用cor5中间件
|
||||||
|
app.use(cors());
|
||||||
|
|
||||||
|
// 你的 BNB 钱包地址
|
||||||
|
// const BNB_WALLET_ADDRESS = '0x2335070d3FA557aAcD5F762903b050d0A358b421';
|
||||||
|
// BNB 合约地址
|
||||||
|
const BNB_CONTRACT_ADDRESS = '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c';
|
||||||
|
// USDT 合约地址
|
||||||
|
const USDT_CONTRACT_ADDRESS = '0x55d398326f99059fF775485246999027B3197955';
|
||||||
|
|
||||||
|
// USDT 合约 ABI
|
||||||
|
const USDT_ABI = [
|
||||||
|
{
|
||||||
|
"constant": true,
|
||||||
|
"inputs": [{"name": "_owner", "type": "address"}],
|
||||||
|
"name": "balanceOf",
|
||||||
|
"outputs": [{"name": "", "type": "uint256"}],
|
||||||
|
"payable": false,
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
// 获取钱包地址
|
||||||
|
app.get('/generateWords', async (req, res) => {
|
||||||
|
try {
|
||||||
|
const mnemonic = await generateWordsOptions();
|
||||||
|
res.json(mnemonic);
|
||||||
|
} catch (error) {
|
||||||
|
res.status(500).json({ error: error.message });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//获取已有钱包地址
|
||||||
|
app.get('/getMoneyList', async (req, res) => {
|
||||||
|
try {
|
||||||
|
const mnemonic = req.query.mnemonic;
|
||||||
|
const moneyInfo = await getMoneyInfos(mnemonic);
|
||||||
|
res.json(moneyInfo);
|
||||||
|
} catch (error) {
|
||||||
|
res.status(500).json({ error: error.message });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//根据助记词获取已有钱包地址
|
||||||
|
function getMoneyInfos(mnemonic){
|
||||||
|
const seed = bip39.mnemonicToSeedSync(mnemonic);
|
||||||
|
const hdwallet = hdkey.fromMasterSeed(seed);
|
||||||
|
const wallet = hdwallet.derivePath(`m/44'/60'/0'/0/0`).getWallet();
|
||||||
|
const address = `0x${wallet.getAddress().toString('hex')}`;
|
||||||
|
const privateKey = wallet.getPrivateKey().toString('hex');
|
||||||
|
const userMoneyInfo = {
|
||||||
|
address,
|
||||||
|
privateKey
|
||||||
|
};
|
||||||
|
return userMoneyInfo
|
||||||
|
}
|
||||||
|
//生成钱包地址
|
||||||
|
function generateWordsOptions(){
|
||||||
|
const mnemonic = bip39.generateMnemonic();
|
||||||
|
let name=mnemonic.split(" ");
|
||||||
|
let max=100;
|
||||||
|
let min=0;
|
||||||
|
let rand = Math.floor(Math.random() * (max - min + 1) ) + min;
|
||||||
|
let seedBuffer = bip39.mnemonicToSeedSync(mnemonic,"");
|
||||||
|
let hdWallet = hdkey.fromMasterSeed(seedBuffer);
|
||||||
|
let key = hdWallet.derivePath("m/44'/60'/0'/0/0");
|
||||||
|
let privateKey = util.bufferToHex(key._hdkey._privateKey);
|
||||||
|
let publicKey = util.bufferToHex(key._hdkey._publicKey);
|
||||||
|
let address = util.pubToAddress(key._hdkey._publicKey, true);
|
||||||
|
address = util.toChecksumAddress("0x"+address.toString('hex'));
|
||||||
|
let wallet={
|
||||||
|
mnemonic,
|
||||||
|
publicKey,
|
||||||
|
privateKey,
|
||||||
|
address,
|
||||||
|
type:"Ethereum"
|
||||||
|
}
|
||||||
|
return wallet
|
||||||
|
}
|
||||||
|
// BNB的交易转账
|
||||||
|
app.get('/transfer', async (req, res) => {
|
||||||
|
// const { from_addr, siyao, to_addr, coin } = req.body;
|
||||||
|
const from_addr = req.query.from_addr;
|
||||||
|
const to_addr = req.query.to_addr;
|
||||||
|
const coin = req.query.coin;
|
||||||
|
const siyao = req.query.siyao;
|
||||||
|
try {
|
||||||
|
// 转账金额(以 wei 为单位)
|
||||||
|
const amount = web3.utils.toWei(coin + '', 'ether'); // 这里以 Gwei 为单位
|
||||||
|
// 获取当前 gasPrice
|
||||||
|
const gasPrice = await web3.eth.getGasPrice();
|
||||||
|
|
||||||
|
// 创建转账交易对象
|
||||||
|
const transactionObject = {
|
||||||
|
from: from_addr,
|
||||||
|
to: to_addr,
|
||||||
|
value: amount,
|
||||||
|
gas: 21000, // 假设固定 gas 为 21000
|
||||||
|
gasPrice: gasPrice // 使用当前 gasPrice
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 签名交易
|
||||||
|
const signedTx = await web3.eth.accounts.signTransaction(transactionObject, siyao);
|
||||||
|
|
||||||
|
// 发送已签名的交易
|
||||||
|
const receipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction);
|
||||||
|
|
||||||
|
res.status(200).json({ success: true });
|
||||||
|
} catch (error) {
|
||||||
|
res.status(500).json({ success: false, error: error.message });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// USDT的交易转账
|
||||||
|
async function qukuailian(from_addr, to_addr, coin, siyao) {
|
||||||
|
try {
|
||||||
|
const web3 = new Web3('https://bsc-dataseed1.binance.org:443');
|
||||||
|
const USDT_CONTRACT_ADDRESS = '0x55d398326f99059fF775485246999027B3197955';
|
||||||
|
|
||||||
|
const usdtContractABI = [{
|
||||||
|
"constant": false,
|
||||||
|
"inputs": [{
|
||||||
|
"name": "_to",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "_value",
|
||||||
|
"type": "uint256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "transfer",
|
||||||
|
"outputs": [{
|
||||||
|
"name": "",
|
||||||
|
"type": "bool"
|
||||||
|
}],
|
||||||
|
"type": "function"
|
||||||
|
}];
|
||||||
|
|
||||||
|
const usdtContract = new web3.eth.Contract(usdtContractABI, USDT_CONTRACT_ADDRESS);
|
||||||
|
|
||||||
|
const recipientAddress = to_addr;
|
||||||
|
const amountToSend = Number(coin) * 10 ** 18;
|
||||||
|
|
||||||
|
const txCount = await web3.eth.getTransactionCount(from_addr);
|
||||||
|
const txObject = {
|
||||||
|
from: from_addr,
|
||||||
|
to: USDT_CONTRACT_ADDRESS,
|
||||||
|
gasPrice: web3.utils.toHex(await web3.eth.getGasPrice()), // 使用区块链当前的 gas 价格
|
||||||
|
gasLimit: web3.utils.toHex(210000), // 设置一个适当的 gasLimit
|
||||||
|
value: '0', // 设置交易的价值为 0(因为我们使用 BNB 作为 gas 费)
|
||||||
|
data: usdtContract.methods.transfer(recipientAddress, amountToSend).encodeABI(),
|
||||||
|
nonce: web3.utils.toHex(txCount)
|
||||||
|
};
|
||||||
|
console.log(web3.utils.toHex(await web3.eth.getGasPrice()),'gas费')
|
||||||
|
const signedTx = await web3.eth.accounts.signTransaction(txObject, siyao);
|
||||||
|
const receipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction); //交易成功
|
||||||
|
return receipt;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;//交易失败
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 处理区块链打款请求
|
||||||
|
app.get('/qukuailian', async (req, res) => {
|
||||||
|
const from_addr = req.query.from_addr;
|
||||||
|
const to_addr = req.query.to_addr;
|
||||||
|
const coin = req.query.coin;
|
||||||
|
const siyao = req.query.siyao;
|
||||||
|
try {
|
||||||
|
const receipt = await qukuailian(from_addr, to_addr, coin, siyao);
|
||||||
|
res.json({ success: true });
|
||||||
|
} catch (error) {
|
||||||
|
res.status(500).json({ success: false, error: error.message });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取指定地址的交易历史记录
|
||||||
|
async function getTransactions(address) {
|
||||||
|
try {
|
||||||
|
// 使用 BSCScan API 获取交易记录
|
||||||
|
const response = await axios.get('https://api.bscscan.com/api', {
|
||||||
|
params: {
|
||||||
|
module: 'account',
|
||||||
|
action: 'tokentx',
|
||||||
|
contractaddress: USDT_CONTRACT_ADDRESS,
|
||||||
|
address: address,
|
||||||
|
apikey: BSCSCAN_API_KEY,
|
||||||
|
sort: 'desc' // 按时间降序排序
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 处理 API 响应
|
||||||
|
if (response.data.status === '1') {
|
||||||
|
const transactions = response.data.result;
|
||||||
|
return transactions;
|
||||||
|
} else {
|
||||||
|
throw new Error(response.data.message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 获取历史记录的接口
|
||||||
|
app.get('/transactions', async (req, res) => {
|
||||||
|
const address = req.query.address;
|
||||||
|
try {
|
||||||
|
const transactions = await getTransactions(address);
|
||||||
|
res.json(transactions);
|
||||||
|
} catch (error) {
|
||||||
|
res.status(500).json({ error: error.message });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 获取余额的路由
|
||||||
|
app.get('/balances', async (req, res) => {
|
||||||
|
const address = req.query.address;// 钱包地址
|
||||||
|
try {
|
||||||
|
// 获取 BNB 钱包余额
|
||||||
|
const bnbBalanceWei = await web3.eth.getBalance(address);
|
||||||
|
const bnbBalance = web3.utils.fromWei(bnbBalanceWei.toString(), 'ether');
|
||||||
|
|
||||||
|
// 获取 USDT 代币余额
|
||||||
|
const usdtContract = new web3.eth.Contract(USDT_ABI, USDT_CONTRACT_ADDRESS);
|
||||||
|
const usdtBalance = await usdtContract.methods.balanceOf(address).call();
|
||||||
|
|
||||||
|
res.json({
|
||||||
|
bnbBalance: bnbBalance,
|
||||||
|
usdtBalance: usdtBalance.toString()
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
res.status(500).json({ error: 'An error occurred' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 启动服务器
|
||||||
|
const PORT = process.env.PORT || 3000;
|
||||||
|
app.listen(PORT, () => {
|
||||||
|
console.log(`Server running on port ${PORT}`);
|
||||||
|
});
|
79
common/jieliu/leejs_debounced_throttle.js
Normal file
79
common/jieliu/leejs_debounced_throttle.js
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
// 使用方法debounced,throttle
|
||||||
|
// leeBtnClick: throttle(function () {
|
||||||
|
// console.log(this)
|
||||||
|
// console.log("执行需要触发事件得函数方法")
|
||||||
|
// }, 3000),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 防抖函数
|
||||||
|
* 1、N秒内的多次触发仅执行最后一次
|
||||||
|
* 2、在不断的触发事件时以最后一次触发为*标准*准进行调用执行
|
||||||
|
* 3、判断连续触发事件的标准为(N秒内触发则重新计算时间直至取最后一次)
|
||||||
|
* @param fn 需要防抖处理的回调函数
|
||||||
|
* @param delay 防抖处理的延迟标准时间
|
||||||
|
* @param immediate 是否默认 立即执行(去除延迟时间影响)
|
||||||
|
*/
|
||||||
|
function debounced(fn, delay = 1000, immediate = false) {
|
||||||
|
let timer = null
|
||||||
|
return function () {
|
||||||
|
if (immediate) {
|
||||||
|
console.log("立即执行参数 执行一次方法")
|
||||||
|
fn.apply(this, arguments)
|
||||||
|
immediate = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (timer) {
|
||||||
|
console.log("当前正在重复点击,准备重置时间,重新计算后等待N秒触发最后一次事件执行")
|
||||||
|
clearTimeout(timer)
|
||||||
|
}
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
console.log("进入类启用定时器防抖执行了一次方法咯!!!")
|
||||||
|
clearTimeout(timer)
|
||||||
|
fn.apply(this, arguments)
|
||||||
|
}, delay)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节流函数
|
||||||
|
* N秒内仅执行第一次
|
||||||
|
* @param fn 需要节流处理的回调函数
|
||||||
|
* @param delay 节流处理的延迟标准时间
|
||||||
|
* @param immediate 是否默认 立即执行(去除延迟时间影响)
|
||||||
|
*/
|
||||||
|
function throttle(fn, delay = 1000, immediate = false) {
|
||||||
|
console.log("进入节流对象")
|
||||||
|
let timer
|
||||||
|
let status = false // 是否为重复点击状态
|
||||||
|
return function () {
|
||||||
|
let _this = this
|
||||||
|
let args = arguments
|
||||||
|
|
||||||
|
if (immediate) {
|
||||||
|
console.log("立即执行参数 执行一次方法")
|
||||||
|
fn.apply(_this, args)
|
||||||
|
immediate = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (status) {
|
||||||
|
console.log("当前点击状态为正在重复点击,请稍等片刻后在点击执行")
|
||||||
|
uni.showToast({
|
||||||
|
title:'稍后在试。',
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log("执行节流:当前执行了一次点击方法")
|
||||||
|
fn.apply(_this, args)
|
||||||
|
status = true // 修改状态
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
console.log("规定时间到,重置状态,可以重新调用")
|
||||||
|
status = false
|
||||||
|
}, delay)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
debounced,
|
||||||
|
throttle
|
||||||
|
}
|
86
common/jieliu/leets_debounced_throttle.ts
Normal file
86
common/jieliu/leets_debounced_throttle.ts
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
// 使用方法:
|
||||||
|
// import { Throttle, Debounced } from "./lee_debounced_throttle"
|
||||||
|
// let a: Function = new Debounced().useFn(handleLogin, 3000) // New一个防抖对象
|
||||||
|
// let b: Function = new Throttle().useFn(handleLogin, 3000) // New一个节流对象
|
||||||
|
// function leeBouce() {
|
||||||
|
// a()
|
||||||
|
// b()
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 防抖类
|
||||||
|
*/
|
||||||
|
class Debounced {
|
||||||
|
/**
|
||||||
|
* 防抖函数
|
||||||
|
* 1、N秒内的多次触发仅执行最后一次
|
||||||
|
* 2、在不断的触发事件时以最后一次触发为*标准*准进行调用执行
|
||||||
|
* 3、判断连续触发事件的标准为(N秒内触发则重新计算时间直至取最后一次)
|
||||||
|
* @param fn 需要防抖处理的回调函数
|
||||||
|
* @param delay 防抖处理的延迟标准时间
|
||||||
|
* @param immediate 是否默认 立即执行(去除延迟时间影响)
|
||||||
|
*/
|
||||||
|
public useFn(fn: Function, delay: number = 1000, immediate: boolean = false): Function {
|
||||||
|
let timer: NodeJS.Timeout | undefined
|
||||||
|
return (...args: any) => {
|
||||||
|
if (immediate) {
|
||||||
|
console.log("立即执行参数 执行一次方法")
|
||||||
|
fn.apply(this, args)
|
||||||
|
immediate = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (timer) {
|
||||||
|
console.log("当前正在重复点击,准备重置时间,重新计算后等待N秒触发最后一次事件执行")
|
||||||
|
clearTimeout(timer)
|
||||||
|
}
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
console.log("进入类启用定时器防抖执行了一次方法咯!!!")
|
||||||
|
clearTimeout(timer)
|
||||||
|
fn.apply(this, args)
|
||||||
|
}, delay)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 节流类
|
||||||
|
*/
|
||||||
|
class Throttle {
|
||||||
|
/**
|
||||||
|
* 节流函数
|
||||||
|
* N秒内仅执行第一次
|
||||||
|
* @param fn 需要节流处理的回调函数
|
||||||
|
* @param delay 节流处理的延迟标准时间
|
||||||
|
* @param immediate 是否默认 立即执行(去除延迟时间影响)
|
||||||
|
*/
|
||||||
|
public useFn(fn: Function, delay: number = 1000, immediate: boolean = false): Function {
|
||||||
|
console.log("进入节流对象")
|
||||||
|
let timer: NodeJS.Timeout | undefined
|
||||||
|
let status: boolean = false // 是否为重复点击状态
|
||||||
|
return (...args: any) => {
|
||||||
|
if (immediate) {
|
||||||
|
console.log("立即执行参数 执行一次方法")
|
||||||
|
fn.apply(this, args)
|
||||||
|
immediate = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (status) {
|
||||||
|
console.log("当前点击状态为正在重复点击,请稍等片刻后在点击执行")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log("执行节流:当前执行了一次点击方法")
|
||||||
|
fn.apply(this, args)
|
||||||
|
status = true // 修改状态
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
console.log("规定时间到,重置状态,可以重新调用")
|
||||||
|
status = false
|
||||||
|
}, delay)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
Debounced,
|
||||||
|
Throttle
|
||||||
|
}
|
51
common/jieliu/readme.md
Normal file
51
common/jieliu/readme.md
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
# 防抖节流 重复点击 频繁触发
|
||||||
|
|
||||||
|
本文档仅做简单的功能介绍和使用,有特殊需求或需要参考情况请自行下载查看
|
||||||
|
此处介绍不多,更多内容写到封装的文件代码注释中(方便项目使用时快速查阅)
|
||||||
|
|
||||||
|
## 传参与this对象全都提前预置了,看需要是否保留
|
||||||
|
## 对于需求不满足可自行在此基础上改造扩展,也可把更好的代码留在评论区供大家学习参考
|
||||||
|
## 个人理解(函数适用场景)
|
||||||
|
|
||||||
|
防抖:N秒内的多次触发仅执行最后一次
|
||||||
|
节流:N秒内仅执行第一次
|
||||||
|
|
||||||
|
防抖场景:频繁触发事件如:change,缩减事件的触发频率
|
||||||
|
节流场景:按钮多次点击如:click,避免重复点击造成的接口的重复调用
|
||||||
|
|
||||||
|
## js方式的使用方法
|
||||||
|
```js
|
||||||
|
// 方法引入
|
||||||
|
import {
|
||||||
|
debounced,
|
||||||
|
throttle
|
||||||
|
} from "../../common/防抖节流/leejs_debounced_throttle.js"
|
||||||
|
// 方法调用
|
||||||
|
methods: {
|
||||||
|
// 使用方法debounced,throttle
|
||||||
|
leeBtnClick: throttle(function(pageParam) {
|
||||||
|
console.log(this.title, pageParam)
|
||||||
|
console.log("执行需要触发事件得函数方法")
|
||||||
|
}, 3000),
|
||||||
|
leeBtnClickD: debounced(function(pageParam) {
|
||||||
|
console.log(this.title, pageParam)
|
||||||
|
console.log("执行需要触发事件得函数方法")
|
||||||
|
}, 3000),
|
||||||
|
}
|
||||||
|
```
|
||||||
|
## ts方式的使用方法
|
||||||
|
```ts
|
||||||
|
// 方法引入
|
||||||
|
import { Throttle, Debounced } from "../../common/防抖节流/leets_debounced_throttle"
|
||||||
|
|
||||||
|
let deb : Function = new Debounced().useFn(testFun, 3000) // New一个防抖对象
|
||||||
|
let thr : Function = new Throttle().useFn(testFun, 3000) // New一个节流对象
|
||||||
|
|
||||||
|
function leeBtnClick(val) {
|
||||||
|
console.log(val)
|
||||||
|
val === 11 ? deb() : thr()
|
||||||
|
}
|
||||||
|
function testFun() {
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
71
common/jiemi.js
Normal file
71
common/jiemi.js
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
const crypto = require('crypto');
|
||||||
|
const NodeRSA = require('node-rsa');
|
||||||
|
import DB from "@/common/sqlite";
|
||||||
|
|
||||||
|
// 解密助记词(AES + RSA 解密)
|
||||||
|
function decryptMnemonicWithAES(encryptedData, password) {
|
||||||
|
try {
|
||||||
|
// 使用 node-rsa 解密 RSA 加密的数据
|
||||||
|
const rsaKey = new NodeRSA(encryptedData.privateKey);
|
||||||
|
|
||||||
|
// 将十六进制字符串转换为Buffer再解密
|
||||||
|
const buffer = Buffer.from(encryptedData.rsaEncryptedMnemonic, 'hex');
|
||||||
|
const decryptedWithRSA = rsaKey.decrypt(buffer, 'utf8');
|
||||||
|
|
||||||
|
// AES解密
|
||||||
|
const aesKey = crypto.createHash('sha256').update(password).digest();
|
||||||
|
const iv = Buffer.from(encryptedData.iv, 'hex');
|
||||||
|
|
||||||
|
const decipher = crypto.createDecipheriv('aes-256-cbc', aesKey, iv);
|
||||||
|
let decrypted = decipher.update(decryptedWithRSA, 'hex', 'utf8');
|
||||||
|
decrypted += decipher.final('utf8');
|
||||||
|
|
||||||
|
return decrypted;
|
||||||
|
} catch (error) {
|
||||||
|
console.error("解密过程中出错:", error);
|
||||||
|
throw new Error("解密失败: " + error.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const publicjiemi = async(type, password, moneyAdress) => {
|
||||||
|
try {
|
||||||
|
DB.openSqlite();
|
||||||
|
const searchCondition = `WHERE moneyAdress = '${moneyAdress}'`;
|
||||||
|
const searchResulets = await DB.selectTableData(DB.regTable, searchCondition);
|
||||||
|
if (!searchResulets || searchResulets.length === 0) {
|
||||||
|
throw new Error("未找到匹配的记录");
|
||||||
|
}
|
||||||
|
let encryptedData = {
|
||||||
|
rsaEncryptedMnemonic: "",
|
||||||
|
privateKey: "",
|
||||||
|
iv: ""
|
||||||
|
};
|
||||||
|
|
||||||
|
if(type == 1) {
|
||||||
|
encryptedData = {
|
||||||
|
rsaEncryptedMnemonic: searchResulets[0].mnemonic,
|
||||||
|
privateKey: searchResulets[0].privateKeyMne,
|
||||||
|
iv: searchResulets[0].mnemonicIV
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(type == 2) {
|
||||||
|
encryptedData = {
|
||||||
|
rsaEncryptedMnemonic: searchResulets[0].privateKeyMoney,
|
||||||
|
privateKey: searchResulets[0].privateKeyPre,
|
||||||
|
iv: searchResulets[0].privateIV
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查数据完整性
|
||||||
|
if (!encryptedData.rsaEncryptedMnemonic || !encryptedData.privateKey || !encryptedData.iv) {
|
||||||
|
throw new Error("加密数据不完整");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解密
|
||||||
|
const decryptedMnemonic = decryptMnemonicWithAES(encryptedData, password);
|
||||||
|
return decryptedMnemonic;
|
||||||
|
} catch (error) {
|
||||||
|
console.error("解密过程出错:", error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
2
common/moment.min.js
vendored
Normal file
2
common/moment.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
19
common/preventReClick.js
Normal file
19
common/preventReClick.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
//在preventReClick.js中封装防抖方法
|
||||||
|
export const Debounce = (fn, wait) => {
|
||||||
|
let delay = wait|| 500
|
||||||
|
let timer
|
||||||
|
return function () {
|
||||||
|
let args = arguments;
|
||||||
|
if (timer) {
|
||||||
|
clearTimeout(timer)
|
||||||
|
}
|
||||||
|
|
||||||
|
let callNow = !timer
|
||||||
|
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
timer = null
|
||||||
|
}, delay)
|
||||||
|
|
||||||
|
if (callNow) fn.apply(this, args)
|
||||||
|
}
|
||||||
|
}
|
35
common/proAdress.js
Normal file
35
common/proAdress.js
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
const bip39 = require('bip39');
|
||||||
|
const hdkey = require('hdkey');
|
||||||
|
const ethers = require('ethers');
|
||||||
|
const {
|
||||||
|
sha3_256
|
||||||
|
} = require('js-sha3');
|
||||||
|
const EC = require('elliptic').ec;
|
||||||
|
const ec = new EC('secp256k1');
|
||||||
|
import {
|
||||||
|
bufferToHex,
|
||||||
|
toBuffer
|
||||||
|
} from 'ethereumjs-util'; // 用于 Ethereum 数据转换
|
||||||
|
|
||||||
|
export function getAddressAndPrivateKey(mnemonic) {
|
||||||
|
const path = "m/44'/60'/0'/0/0";
|
||||||
|
// 从助记词生成种子
|
||||||
|
const seed = bip39.mnemonicToSeedSync(mnemonic);
|
||||||
|
|
||||||
|
// 创建HD钱包
|
||||||
|
const hdwallet = hdkey.fromMasterSeed(seed);
|
||||||
|
|
||||||
|
// 派生私钥
|
||||||
|
const childKey = hdwallet.derive(path);
|
||||||
|
const privateKey = childKey.privateKey;
|
||||||
|
|
||||||
|
// 3. **获取公钥**
|
||||||
|
const publicKey = ethers.utils.computePublicKey(privateKey);
|
||||||
|
|
||||||
|
const address = ethers.utils.getAddress(ethers.utils.computeAddress(publicKey));
|
||||||
|
|
||||||
|
return {
|
||||||
|
address: address,
|
||||||
|
privateKey: privateKey.toString('hex')
|
||||||
|
};
|
||||||
|
}
|
38
common/provider.js
Normal file
38
common/provider.js
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import { ethers } from 'ethers';
|
||||||
|
|
||||||
|
// 自定义Provider,使用uni.request替代原生fetch
|
||||||
|
class UniAppProvider extends ethers.providers.JsonRpcProvider {
|
||||||
|
async send(method, params) {
|
||||||
|
const payload = {
|
||||||
|
method: method,
|
||||||
|
params: params,
|
||||||
|
id: Math.floor(Math.random() * 1000000),
|
||||||
|
jsonrpc: "2.0"
|
||||||
|
};
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
uni.request({
|
||||||
|
url: this.connection.url,
|
||||||
|
data: JSON.stringify(payload),
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
'content-type': 'application/json'
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
if (res.statusCode !== 200) {
|
||||||
|
reject(new Error(`HTTP Error: ${res.statusCode}`));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (res.data.error) {
|
||||||
|
reject(new Error(res.data.error.message || JSON.stringify(res.data.error)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
resolve(res.data.result);
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
reject(new Error(err.errMsg || 'Request failed'));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
132
common/publicFunction.js
Normal file
132
common/publicFunction.js
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
// 公共的方法
|
||||||
|
|
||||||
|
import axios from "axios"
|
||||||
|
const baseUrl = 'https://nfta.ikiry.com'
|
||||||
|
export default {
|
||||||
|
// 获取区块链钱包余额和交易记录 url=transactions 获取交易记录 url=balances 获取钱包余额
|
||||||
|
async getWeb3(url,address){
|
||||||
|
try {
|
||||||
|
const headers = {
|
||||||
|
'Content-Type': 'application/json' // 设置请求内容类型为 JSON
|
||||||
|
|
||||||
|
};
|
||||||
|
// const response = await axios.post(`https://nodejs.oxfma.com:3000/${url}`,{address:address},{ headers: headers });
|
||||||
|
// const response = await axios.get(`https://nfta.ikiry.com/${url}?address=${address}`);
|
||||||
|
const response = await axios.get(`${baseUrl}/${url}?address=${address}`);
|
||||||
|
console.log('response:',response)
|
||||||
|
// 处理 API 响应
|
||||||
|
if (response.status === 200) {
|
||||||
|
const res = response.data;
|
||||||
|
return res;
|
||||||
|
} else {
|
||||||
|
throw new Error(response.data.message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching transactions:', error);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 使用BNB打款
|
||||||
|
async BNBdakuan(from_addr,to_addr,coin,siyao){
|
||||||
|
try {
|
||||||
|
const response = await axios.get(`${baseUrl}/transfer?from_addr=${from_addr}&to_addr=${to_addr}&siyao=${siyao}&coin=${coin}`);
|
||||||
|
console.log('使用BNB打款:',response)
|
||||||
|
// 处理 API 响应
|
||||||
|
if (response.status === 200) {
|
||||||
|
const res = response.data;
|
||||||
|
return response;
|
||||||
|
} else {
|
||||||
|
throw new Error(response.data.message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching transactions:', error);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 使用UDST转账
|
||||||
|
async qukuailian(from_addr,to_addr,coin,siyao){
|
||||||
|
try {
|
||||||
|
// const response = await axios.get(`https://nfta.ikiry.com/qukuailian?from_addr=${from_addr}&to_addr=${to_addr}&coin=${coin}&siyao=${siyao}`);
|
||||||
|
const response = await axios.get(`${baseUrl}/qukuailian?from_addr=${from_addr}&to_addr=${to_addr}&coin=${coin}&siyao=${siyao}`);
|
||||||
|
console.log('qukuailian:',response)
|
||||||
|
// 处理 API 响应
|
||||||
|
if (response.status === 200) {
|
||||||
|
const res = response;
|
||||||
|
return res;
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title:'交易失败', icon:'none' })
|
||||||
|
throw new Error(response.data.message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// uni.showToast({ title:'交易失败', icon:'none' })
|
||||||
|
uni.showToast({ title:error.response.data.error, icon:'none' })
|
||||||
|
console.error('Error fetching transactions:', error);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 数组根据id去重
|
||||||
|
newArrId (arr) {
|
||||||
|
let newArr = []
|
||||||
|
for(let i = 0;i<arr.length;i++){
|
||||||
|
const Index = newArr.findIndex((item) => {return item.id === arr[i].id})
|
||||||
|
// console.log("数组去重",Index)
|
||||||
|
if(Index==-1){
|
||||||
|
newArr.push(arr[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return newArr
|
||||||
|
},
|
||||||
|
// 金额千分位和保留两位小数点
|
||||||
|
formatPrice(price) {
|
||||||
|
console.log(price)
|
||||||
|
return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
||||||
|
},
|
||||||
|
// 时间戳转换时间 传毫秒值
|
||||||
|
getYMDHMS(timestamp){
|
||||||
|
let time = new Date(Number(timestamp) )
|
||||||
|
let year = time.getFullYear()
|
||||||
|
let month = time.getMonth() + 1
|
||||||
|
let date = time.getDate()
|
||||||
|
let hours = time.getHours()
|
||||||
|
let minute = time.getMinutes()
|
||||||
|
let second = time.getSeconds()
|
||||||
|
if (month < 10) { month = '0' + month }
|
||||||
|
if (date < 10) { date = '0' + date }
|
||||||
|
if (hours < 10) { hours = '0' + hours }
|
||||||
|
if (minute < 10) { minute = '0' + minute }
|
||||||
|
if (second < 10) { second = '0' + second }
|
||||||
|
return year + '-' + month + '-' + date + ' ' + hours + ':' + minute + ':' + second
|
||||||
|
},
|
||||||
|
// 检测手机号是否正确
|
||||||
|
checkModbile(mobile) {
|
||||||
|
var re = /^1[3,4,5,6,7,8,9][0-9]{9}$/;
|
||||||
|
var result = re.test(mobile);
|
||||||
|
if(!result) {
|
||||||
|
return false;//若手机号码格式不正确则返回false
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
// 电话号码做隐私处理
|
||||||
|
hiddenString(str){
|
||||||
|
return str.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
|
||||||
|
},
|
||||||
|
// 封装数组对象排序方法
|
||||||
|
compare(prop) {
|
||||||
|
return function(a, b) {
|
||||||
|
return b[prop] - a[prop] // 降序
|
||||||
|
// return a[prop] - b[prop] // 升序
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 长按复制
|
||||||
|
onLongPress(text) {
|
||||||
|
uni.setClipboardData({
|
||||||
|
data: this.text,
|
||||||
|
success: function () {
|
||||||
|
uni.showToast({
|
||||||
|
title: '复制成功'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
152
common/publicWeb3.js
Normal file
152
common/publicWeb3.js
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
import { ethers } from 'ethers';
|
||||||
|
|
||||||
|
async function testConnection() {
|
||||||
|
try {
|
||||||
|
// 尝试不同的BSC RPC端点
|
||||||
|
const rpcUrls = [
|
||||||
|
'https://bsc-dataseed1.binance.org:443',
|
||||||
|
'https://bsc-dataseed.binance.org/',
|
||||||
|
'https://bsc-dataseed1.binance.org/',
|
||||||
|
'https://bsc-dataseed2.binance.org/',
|
||||||
|
'https://bsc-dataseed3.binance.org/',
|
||||||
|
'https://bsc-dataseed4.binance.org/',
|
||||||
|
'https://bsc.nodereal.io/',
|
||||||
|
'https://binance.nodereal.io/'
|
||||||
|
];
|
||||||
|
|
||||||
|
for (const url of rpcUrls) {
|
||||||
|
try {
|
||||||
|
this.networkStatus = `正在尝试连接: ${url}`;
|
||||||
|
const provider = new ethers.providers.JsonRpcProvider(url);
|
||||||
|
// 尝试获取区块号来验证连接
|
||||||
|
const blockNumber = await provider.getBlockNumber();
|
||||||
|
this.networkStatus = `已连接到BSC网络: ${url}, 当前区块: ${blockNumber}`;
|
||||||
|
return provider; // 返回成功连接的provider
|
||||||
|
} catch (e) {
|
||||||
|
console.log(`连接到 ${url} 失败:`, e.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error("无法连接到任何BSC节点");
|
||||||
|
} catch (error) {
|
||||||
|
console.error('网络连接测试失败:', error);
|
||||||
|
this.networkStatus = `连接失败: ${error.message}`;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// USDT转账函数
|
||||||
|
export const usdtTransfer = async (to_addr, coin, privateKey) => {
|
||||||
|
console.log('开始USDT转账流程...');
|
||||||
|
|
||||||
|
try {
|
||||||
|
console.log('获取eth实例...');
|
||||||
|
const eth = await getEth();
|
||||||
|
const utils = new Utils();
|
||||||
|
const accounts = new Accounts(eth.currentProvider);
|
||||||
|
|
||||||
|
const USDT_CONTRACT_ADDRESS = '0x55d398326f99059fF775485246999027B3197955';
|
||||||
|
const usdtContractABI = [{
|
||||||
|
"constant": false,
|
||||||
|
"inputs": [{
|
||||||
|
"name": "to",
|
||||||
|
"type": "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "value",
|
||||||
|
"type": "uint256"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "transfer",
|
||||||
|
"outputs": [{
|
||||||
|
"name": "",
|
||||||
|
"type": "bool"
|
||||||
|
}],
|
||||||
|
"payable": false,
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
}];
|
||||||
|
|
||||||
|
console.log('创建账户实例...');
|
||||||
|
const account = accounts.privateKeyToAccount(privateKey);
|
||||||
|
|
||||||
|
console.log('创建合约实例...');
|
||||||
|
const contract = new Contract(usdtContractABI, USDT_CONTRACT_ADDRESS);
|
||||||
|
contract.setProvider(eth.currentProvider);
|
||||||
|
|
||||||
|
console.log('转换转账金额...');
|
||||||
|
const amount = utils.toWei(coin.toString(), 'ether');
|
||||||
|
|
||||||
|
console.log('获取gas价格...');
|
||||||
|
const gasPrice = await eth.getGasPrice();
|
||||||
|
const gasPriceWithBuffer = utils.toBN(gasPrice).mul(utils.toBN(12)).div(utils.toBN(10)).toString();
|
||||||
|
|
||||||
|
console.log('准备发送交易...');
|
||||||
|
const data = contract.methods.transfer(to_addr, amount).encodeABI();
|
||||||
|
|
||||||
|
const txParams = {
|
||||||
|
from: account.address,
|
||||||
|
to: USDT_CONTRACT_ADDRESS,
|
||||||
|
data: data,
|
||||||
|
gas: 210000,
|
||||||
|
gasPrice: gasPriceWithBuffer
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log('签名交易...');
|
||||||
|
const signedTx = await account.signTransaction(txParams);
|
||||||
|
|
||||||
|
console.log('发送交易...');
|
||||||
|
const sendPromise = eth.sendSignedTransaction(signedTx.rawTransaction);
|
||||||
|
|
||||||
|
// 设置60秒超时
|
||||||
|
const receipt = await Promise.race([
|
||||||
|
sendPromise,
|
||||||
|
timeoutPromise(60000)
|
||||||
|
]);
|
||||||
|
|
||||||
|
console.log('交易已确认');
|
||||||
|
return receipt;
|
||||||
|
} catch (error) {
|
||||||
|
console.error("USDT转账错误:", error);
|
||||||
|
throw new Error(error.message || '转账失败');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// BNB转账函数
|
||||||
|
export const BNBTransfer = async (to_addr, coin, userSiyao) => {
|
||||||
|
try {
|
||||||
|
const provider = await testConnection();
|
||||||
|
if (!provider) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '网络连接失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const wallet = new ethers.Wallet(userSiyao, provider);
|
||||||
|
const gasPrice = await provider.getGasPrice();
|
||||||
|
const amountWei = ethers.utils.parseEther(coin);
|
||||||
|
const tx = {
|
||||||
|
to: to_addr,
|
||||||
|
value: amountWei,
|
||||||
|
gasLimit: 21000, // 基本转账的gas限制
|
||||||
|
gasPrice: gasPrice,
|
||||||
|
nonce: await provider.getTransactionCount(wallet.address, 'latest')
|
||||||
|
};
|
||||||
|
const transaction = await wallet.sendTransaction(tx);
|
||||||
|
this.txHash = transaction.hash;
|
||||||
|
|
||||||
|
// 等待交易确认
|
||||||
|
const receipt = await transaction.wait();
|
||||||
|
// let zhifuResult = await BNBTransfer(_that.userMoneyAdress,_that.initAdress,_that.outMoney,userSiyao);
|
||||||
|
console.log(receipt, 'sasdasdasdasd');
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title:"BNB打款成功",
|
||||||
|
icon:"success",
|
||||||
|
duration:1000
|
||||||
|
})
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err, '转账失败');
|
||||||
|
}
|
||||||
|
};
|
285
common/sqlite.js
Normal file
285
common/sqlite.js
Normal file
@ -0,0 +1,285 @@
|
|||||||
|
module.exports = {
|
||||||
|
// 数据库名称
|
||||||
|
dbName: 'salary',
|
||||||
|
// 数据库地址
|
||||||
|
dbPath: '_downloads/salary.db',
|
||||||
|
// 注册表
|
||||||
|
regTable: 'regUser',
|
||||||
|
// 判断数据库是否打开
|
||||||
|
isOpen() {
|
||||||
|
var open = plus.sqlite.isOpenDatabase({
|
||||||
|
name: this.dbName,
|
||||||
|
path: this.dbPath
|
||||||
|
})
|
||||||
|
return open;
|
||||||
|
},
|
||||||
|
// 打开数据库,没有则创建
|
||||||
|
openSqlite() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
plus.sqlite.openDatabase({
|
||||||
|
name: this.dbName,
|
||||||
|
path: this.dbPath,
|
||||||
|
success(e) {
|
||||||
|
resolve(e);
|
||||||
|
},
|
||||||
|
fail(e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 关闭数据库
|
||||||
|
closeSqlite() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
plus.sqlite.closeDatabase({
|
||||||
|
name: this.dbName,
|
||||||
|
success(e) {
|
||||||
|
resolve(e);
|
||||||
|
},
|
||||||
|
fail(e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* F sql:'CREATE TABLE IF NOT EXISTS dbTable("id" varchar(50),"name" TEXT)
|
||||||
|
* 创建 CREATE TABLE IF NOT EXISTS 、 dbTable 是表名,不能用数字开头、括号里是表格的表头
|
||||||
|
* @param {Object} dbTable 表名
|
||||||
|
* @param {Object} data 表列
|
||||||
|
* @example 创建表 DB.createTable(表名, 表的列)
|
||||||
|
* let sql = '"date" DATE PRIMARY KEY,"money" INTEGER,"notes" text,"info" text';
|
||||||
|
* await DB.createTable('records', sql);
|
||||||
|
*/
|
||||||
|
createTable(dbTable, data) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
// executeSql: 执行增删改等操作的SQL语句
|
||||||
|
plus.sqlite.executeSql({
|
||||||
|
name: this.dbName,
|
||||||
|
sql: `CREATE TABLE IF NOT EXISTS ${dbTable}(${data})`,
|
||||||
|
success(e) {
|
||||||
|
resolve(e);
|
||||||
|
},
|
||||||
|
fail(e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据库删表
|
||||||
|
* @param {Object} dbTable 表名
|
||||||
|
* @description 数据库删表 sql:'DROP TABLE dbTable'
|
||||||
|
*/
|
||||||
|
dropTable(dbTable) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
plus.sqlite.executeSql({
|
||||||
|
name: this.dbName,
|
||||||
|
sql: `DROP TABLE ${dbTable}`,
|
||||||
|
success(e) {
|
||||||
|
resolve(e);
|
||||||
|
},
|
||||||
|
fail(e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 向表格里添加数据 sql:'INSERT INTO dbTable VALUES('x','x','x')' 对应新增
|
||||||
|
// 或者 sql:'INSERT INTO dbTable ('x','x','x') VALUES('x','x','x')' 具体新增
|
||||||
|
/**
|
||||||
|
* 向表格里添加数据
|
||||||
|
* @param {String} dbTable 表名
|
||||||
|
* @param {String} data 列值
|
||||||
|
* @param {String} condition 表头列名
|
||||||
|
* @example
|
||||||
|
* let sql = `'${item.money}','${item.notes}','${item.time}'`;
|
||||||
|
* let condition = "'money','notes','time'";
|
||||||
|
* await DB.insertTableData("records", sql, condition);
|
||||||
|
*/
|
||||||
|
insertTableData(dbTable, data, condition) {
|
||||||
|
// 判断有没有传参
|
||||||
|
if (dbTable !== undefined && data !== undefined) {
|
||||||
|
// 判断传的参是否有值
|
||||||
|
var bol = (JSON.stringify(data) == "{}");
|
||||||
|
if (!bol) {
|
||||||
|
if (condition == undefined) {
|
||||||
|
var sql = `INSERT INTO ${dbTable} VALUES('${data}')`;
|
||||||
|
} else {
|
||||||
|
var sql = `INSERT INTO ${dbTable} (${condition}) VALUES(${data})`;
|
||||||
|
}
|
||||||
|
// console.log(sql);
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
// 表格添加数据
|
||||||
|
plus.sqlite.executeSql({
|
||||||
|
name: this.dbName,
|
||||||
|
sql: sql,
|
||||||
|
success(e) {
|
||||||
|
resolve(e);
|
||||||
|
},
|
||||||
|
fail(e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
reject("错误添加")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
reject("错误添加")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件向表格里添加数据 有数据更新、无数据插入
|
||||||
|
* (建表时需要设置主键) 例如 --- "roomid" varchar(50) PRIMARY KEY
|
||||||
|
* @param {String} dbTable 表名
|
||||||
|
* @param {String} data 列值
|
||||||
|
* @param {String} condition 表头列名
|
||||||
|
* @example
|
||||||
|
* let sql = `'${item.money}','${item.notes}','${item.time}'`;
|
||||||
|
* let condition = "'money','notes','time'";
|
||||||
|
* await DB.insertTableData("records", sql, condition);
|
||||||
|
*/
|
||||||
|
insertOrReplaceData(dbTable, data, condition) {
|
||||||
|
// 判断有没有传参
|
||||||
|
if (dbTable !== undefined && data !== undefined) {
|
||||||
|
if (condition == undefined) {
|
||||||
|
var sql = `INSERT OR REPLACE INTO ${dbTable} VALUES('${data}')`;
|
||||||
|
} else {
|
||||||
|
var sql = `INSERT OR REPLACE INTO ${dbTable} (${condition}) VALUES(${data})`;
|
||||||
|
}
|
||||||
|
// console.log(sql);
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
// 表格添加数据
|
||||||
|
plus.sqlite.executeSql({
|
||||||
|
name: this.dbName,
|
||||||
|
sql: sql,
|
||||||
|
success(e) {
|
||||||
|
resolve(e);
|
||||||
|
},
|
||||||
|
fail(e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
reject("错误添加")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询获取数据库里的数据 sql:'SELECT * FROM dbTable WHERE lname = 'lvalue''
|
||||||
|
* @param {String} dbTable 表名
|
||||||
|
* @param {String} [condition = ''] 查找条件
|
||||||
|
* @example
|
||||||
|
* const searchCondition = `WHERE date = '${day}'`
|
||||||
|
* await DB.selectTableData('表名', searchCondition);
|
||||||
|
*/
|
||||||
|
selectTableData(dbTable, condition = '') {
|
||||||
|
if (dbTable !== undefined) {
|
||||||
|
var sql = `SELECT * FROM ${dbTable} ${condition}`;
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
// 表格查询数据 执行查询的SQL语句
|
||||||
|
plus.sqlite.selectSql({
|
||||||
|
name: this.dbName,
|
||||||
|
sql: sql,
|
||||||
|
success(e) {
|
||||||
|
resolve(e);
|
||||||
|
},
|
||||||
|
fail(e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
reject("错误查询")
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除表里的数据 sql:'DELETE FROM dbTable WHERE lname = 'lvalue''
|
||||||
|
* @param {String} dbTable 表名
|
||||||
|
* @param {String} [condition = ''] 查找条件
|
||||||
|
* @example
|
||||||
|
* const searchCondition = `WHERE date = '${day}'`
|
||||||
|
* await DB.deleteTableData('表名', searchCondition);
|
||||||
|
*/
|
||||||
|
deleteTableData(dbTable, condition = '') {
|
||||||
|
if (dbTable !== undefined) {
|
||||||
|
var sql = `DELETE FROM ${dbTable} ${condition}`;
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
// 删除表数据
|
||||||
|
plus.sqlite.executeSql({
|
||||||
|
name: this.dbName,
|
||||||
|
sql: sql,
|
||||||
|
success(e) {
|
||||||
|
resolve(e);
|
||||||
|
},
|
||||||
|
fail(e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
reject("错误删除")
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改数据表里的数据 sql:"UPDATE dbTable SET 列名 = '列值',列名 = '列值' WHERE lname = 'lvalue'"
|
||||||
|
// 修改 UPDATE 、 dbTable 是表名, data: 要修改的列名=修改后列值, lname,lvalue 是查询条件的列名和列值
|
||||||
|
updateTableData(dbTable, data, lname, lvalue) {
|
||||||
|
if (lname == undefined) {
|
||||||
|
var sql = `UPDATE ${dbTable} SET ${data}`;
|
||||||
|
} else {
|
||||||
|
var sql = `UPDATE ${dbTable} SET ${data} WHERE ${lname} = '${lvalue}'`;
|
||||||
|
}
|
||||||
|
// WHERE 前面是要修改的列名、列值,后面是条件的列名、列值
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
// 修改表数据
|
||||||
|
plus.sqlite.executeSql({
|
||||||
|
name: this.dbName,
|
||||||
|
sql: sql,
|
||||||
|
success(e) {
|
||||||
|
resolve(e);
|
||||||
|
},
|
||||||
|
fail(e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 获取指定数据条数 sql:"SELECT * FROM dbTable ORDER BY 'id' DESC LIMIT 15 OFFSET 'num'"
|
||||||
|
// dbTable 表名, ORDER BY 代表排序默认正序, id 是排序的条件 DESC 代表倒序,从最后一条数据开始拿
|
||||||
|
// LIMIT 15 OFFSET '${num}',这句的意思是跳过 num 条拿 15 条数据, num 为跳过多少条数据是动态值
|
||||||
|
// 例 初始num设为0,就从最后的数据开始拿15条,下次不拿刚获取的数据,所以可以让num为15,这样就能一步一步的拿完所有的数据
|
||||||
|
pullSQL(dbTable, id, num) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
plus.sqlite.selectSql({
|
||||||
|
name: this.dbName,
|
||||||
|
sql: `SELECT * FROM ${dbTable} ORDER BY '${id}' DESC LIMIT 15 OFFSET '${num}'`,
|
||||||
|
success(e) {
|
||||||
|
resolve(e);
|
||||||
|
},
|
||||||
|
fail(e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
1380
common/uqrcode.js
Normal file
1380
common/uqrcode.js
Normal file
File diff suppressed because it is too large
Load Diff
BIN
components/.DS_Store
vendored
Normal file
BIN
components/.DS_Store
vendored
Normal file
Binary file not shown.
41
components/am-upVersion/README.md
Normal file
41
components/am-upVersion/README.md
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
## 使用说明
|
||||||
|
* template
|
||||||
|
```
|
||||||
|
<template>
|
||||||
|
<view class="content">
|
||||||
|
<view style="width:100px;height:100px;border:1px solid #000000" @click="checkVersion">检测更新</view>
|
||||||
|
|
||||||
|
<upVersion :upLoadUrl="upLoadUrl" :newVision="newVision"></upVersion>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
```
|
||||||
|
|
||||||
|
* js
|
||||||
|
```
|
||||||
|
<script>
|
||||||
|
import upVersion from "@/components/am-upVersion/am-upVersion.vue"
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
upVersion
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
upLoadUrl: "",
|
||||||
|
newVision: "",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkVersion() {
|
||||||
|
//此处调用后端接口返回当前版本号和下载地址
|
||||||
|
//回调赋值
|
||||||
|
this.newVision = "13.6.5"
|
||||||
|
this.upLoadUrl = "http://xxxx/xxxxx/xxxxx/xxxx.apk"
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
```
|
290
components/am-upVersion/am-upVersion.vue
Normal file
290
components/am-upVersion/am-upVersion.vue
Normal file
@ -0,0 +1,290 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<umask :show="uploadPopShow" @click="" :duration="0">
|
||||||
|
<view class="page-height">
|
||||||
|
<view class="page-content">
|
||||||
|
<view class="wrap">
|
||||||
|
<view class="popup-bg">
|
||||||
|
<view class="popup-content popup-content-show">
|
||||||
|
<view class="update-wrap">
|
||||||
|
<!-- <image src="" class="top-img" mode="widthFix"></image> -->
|
||||||
|
<view class="content_update">
|
||||||
|
<text class="title">發現新版本V{{ newVision }}</text>
|
||||||
|
<view class="title-sub">app新版本升級</view>
|
||||||
|
<button class="btn" v-if="!pressShow" @click.stop="toUpLoad()">立即升級</button>
|
||||||
|
<view class="sche-wrap" v-else>
|
||||||
|
<view class="sche-bg">
|
||||||
|
<view class="sche-bg-jindu" :style="{ 'width': pressValue + '%' }">
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="down-text">
|
||||||
|
下載進度: {{ (downSize / 1024 / 1024).toFixed(2) }}M /
|
||||||
|
{{ (fileSize / 1024 / 1024).toFixed(2) }}M
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<image src="./static/img/close.png" class="close-ioc" @click.stop="closeUpdate()">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</umask>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import umask from "./u-mask/u-mask.vue";
|
||||||
|
import { getvision } from "@/request/api.js"
|
||||||
|
export default {
|
||||||
|
name: "am-upVersion",
|
||||||
|
components: {
|
||||||
|
umask
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
newVision:"1.0.0",
|
||||||
|
pressShow: false,
|
||||||
|
downSize: 0,
|
||||||
|
pressValue: 0,
|
||||||
|
fileSize: 0,
|
||||||
|
uploadPopShow: false,
|
||||||
|
downloadTask:null
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
newVision(newValue) {
|
||||||
|
if (this.compareVersions(newValue, plus.runtime.version) > 0 && uni.getStorageSync("nowVersion") != this.newVision) {
|
||||||
|
this.uploadPopShow = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getVersion();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getVersion(){
|
||||||
|
let res = await getvision();
|
||||||
|
if (res.code === 1) {
|
||||||
|
this.newVision = res.data.newversion;
|
||||||
|
this.upLoadUrl = res.data.downloadurl;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
compareVersions(version1, version2) {
|
||||||
|
const v1 = version1.split('.').map(num => parseInt(num, 10));
|
||||||
|
const v2 = version2.split('.').map(num => parseInt(num, 10));
|
||||||
|
|
||||||
|
for (let i = 0; i < Math.max(v1.length, v2.length); i++) {
|
||||||
|
if ((v1[i] || 0) > (v2[i] || 0)) return 1;
|
||||||
|
if ((v1[i] || 0) < (v2[i] || 0)) return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
},
|
||||||
|
toUpLoad() {
|
||||||
|
if (!this.upLoadUrl) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "未檢測到下載地址",
|
||||||
|
icon: "none"
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.pressShow = true;
|
||||||
|
this.downloadTask = uni.downloadFile({
|
||||||
|
url: this.upLoadUrl,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
this.pressShow = false;
|
||||||
|
this.uploadPopShow = false;
|
||||||
|
plus.runtime.install(res.tempFilePath, {
|
||||||
|
force: true
|
||||||
|
}, (suc) => {
|
||||||
|
uni.setStorageSync("nowVersion",this.newVision)
|
||||||
|
plus.runtime.restart();
|
||||||
|
}, (error) => {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: "安裝包下載失敗!請聯繫管理員。",
|
||||||
|
icon: "none"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
uni.showToast({
|
||||||
|
title: "下載失敗,請檢查網絡",
|
||||||
|
icon: "none"
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
this.downloadTask.onProgressUpdate((res) => {
|
||||||
|
this.downSize = res.totalBytesWritten;
|
||||||
|
this.fileSize = res.totalBytesExpectedToWrite;
|
||||||
|
this.pressValue = res.progress;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
closeUpdate() {
|
||||||
|
this.pressShow = false;
|
||||||
|
this.uploadPopShow = false;
|
||||||
|
if (this.downloadTask) {
|
||||||
|
this.downloadTask.abort();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.page-height {
|
||||||
|
// height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
background-color: rgba($color: #000000, $alpha: .7);
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-bg {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 750rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
height: 30vh;
|
||||||
|
width: 65vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-content-show {
|
||||||
|
animation: mymove 300ms;
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes mymove {
|
||||||
|
0% {
|
||||||
|
transform: scale(0);
|
||||||
|
/*開始為原始大小*/
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.update-wrap {
|
||||||
|
width: 100%;
|
||||||
|
height: calc(100% - 100rpx);
|
||||||
|
border-radius: 18rpx;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background-color: #ffffff;
|
||||||
|
|
||||||
|
.top-img {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 256rpx;
|
||||||
|
// height: 100rpx;
|
||||||
|
top: -180rpx;
|
||||||
|
z-index: 999999999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content_update {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: rgb(252, 122, 110);
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-sub {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #666666;
|
||||||
|
padding: 30rpx 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
width: 80%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 30rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
border-radius: 100px;
|
||||||
|
background-color: rgb(252, 122, 110);
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-ioc {
|
||||||
|
width: 70rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sche-wrap {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 10rpx 50rpx 0;
|
||||||
|
|
||||||
|
.sche-wrap-text {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #666;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sche-bg {
|
||||||
|
position: relative;
|
||||||
|
background-color: #cccccc;
|
||||||
|
height: 30rpx;
|
||||||
|
border-radius: 100px;
|
||||||
|
width: 480rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.sche-bg-jindu {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
height: 30rpx;
|
||||||
|
min-width: 40rpx;
|
||||||
|
border-radius: 100px;
|
||||||
|
background: url(./static/img/round.png) rgb(252, 122, 110) center right 4rpx no-repeat;
|
||||||
|
background-size: 26rpx 26rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.down-text {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: rgb(252, 122, 110);
|
||||||
|
margin-top: 16rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
BIN
components/am-upVersion/static/img/bg_top4.png
Normal file
BIN
components/am-upVersion/static/img/bg_top4.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 314 KiB |
BIN
components/am-upVersion/static/img/close.png
Normal file
BIN
components/am-upVersion/static/img/close.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
BIN
components/am-upVersion/static/img/img.png
Normal file
BIN
components/am-upVersion/static/img/img.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
BIN
components/am-upVersion/static/img/round.png
Normal file
BIN
components/am-upVersion/static/img/round.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
BIN
components/am-upVersion/static/img/update-img.png
Normal file
BIN
components/am-upVersion/static/img/update-img.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 155 KiB |
124
components/am-upVersion/u-mask/u-mask.vue
Normal file
124
components/am-upVersion/u-mask/u-mask.vue
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
<template>
|
||||||
|
<view class="u-mask" hover-stop-propagation :style="[maskStyle, zoomStyle]" @tap="click"
|
||||||
|
@touchmove.stop.prevent="() => {}" :class="{
|
||||||
|
'u-mask-zoom': zoom,
|
||||||
|
'u-mask-show': show
|
||||||
|
}">
|
||||||
|
<slot />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* mask 遮罩
|
||||||
|
* @description 创建一个遮罩层,用于强调特定的页面元素,并阻止用户对遮罩下层的内容进行操作,一般用于弹窗场景
|
||||||
|
* @tutorial https://www.uviewui.com/components/mask.html
|
||||||
|
* @property {Boolean} show 是否显示遮罩(默认false)
|
||||||
|
* @property {String Number} z-index z-index 层级(默认1070)
|
||||||
|
* @property {Object} custom-style 自定义样式对象,见上方说明
|
||||||
|
* @property {String Number} duration 动画时长,单位毫秒(默认300)
|
||||||
|
* @property {Boolean} zoom 是否使用scale对遮罩进行缩放(默认true)
|
||||||
|
* @property {Boolean} mask-click-able 遮罩是否可点击,为false时点击不会发送click事件(默认true)
|
||||||
|
* @event {Function} click mask-click-able为true时,点击遮罩发送此事件
|
||||||
|
* @example <u-mask :show="show" @click="show = false"></u-mask>
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
name: "u-mask",
|
||||||
|
props: {
|
||||||
|
// 是否显示遮罩
|
||||||
|
show: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
// 层级z-index
|
||||||
|
zIndex: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: '10070'
|
||||||
|
},
|
||||||
|
// 用户自定义样式
|
||||||
|
customStyle: {
|
||||||
|
type: Object,
|
||||||
|
default () {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 遮罩的动画样式, 是否使用使用zoom进行scale进行缩放
|
||||||
|
zoom: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
// 遮罩的过渡时间,单位为ms
|
||||||
|
duration: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 300
|
||||||
|
},
|
||||||
|
// 是否可以通过点击遮罩进行关闭
|
||||||
|
maskClickAble: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
zoomStyle: {
|
||||||
|
transform: ''
|
||||||
|
},
|
||||||
|
scale: 'scale(1.2, 1.2)'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
show(n) {
|
||||||
|
if (n && this.zoom) {
|
||||||
|
// 当展示遮罩的时候,设置scale为1,达到缩小(原来为1.2)的效果
|
||||||
|
this.zoomStyle.transform = 'scale(1, 1)';
|
||||||
|
} else if (!n && this.zoom) {
|
||||||
|
// 当隐藏遮罩的时候,设置scale为1.2,达到放大(因为显示遮罩时已重置为1)的效果
|
||||||
|
this.zoomStyle.transform = this.scale;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
maskStyle() {
|
||||||
|
let style = {};
|
||||||
|
style.backgroundColor = "rgba(0, 0, 0, 0.6)";
|
||||||
|
if (this.show) style.zIndex = this.zIndex ? this.zIndex : this.$u.zIndex.mask;
|
||||||
|
else style.zIndex = -1;
|
||||||
|
style.transition = `all ${this.duration / 1000}s ease-in-out`;
|
||||||
|
// 判断用户传递的对象是否为空,不为空就进行合并
|
||||||
|
if (Object.keys(this.customStyle).length) style = {
|
||||||
|
...style,
|
||||||
|
...this.customStyle
|
||||||
|
};
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
click() {
|
||||||
|
if (!this.maskClickAble) return;
|
||||||
|
this.$emit('click');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
// @import "../../libs/css/style.components.scss";
|
||||||
|
|
||||||
|
.u-mask {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
opacity: 0;
|
||||||
|
transition: transform 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-mask-show {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-mask-zoom {
|
||||||
|
transform: scale(1.2, 1.2);
|
||||||
|
}
|
||||||
|
</style>
|
12542
components/mpvue-citypicker/city-data/area.js
Normal file
12542
components/mpvue-citypicker/city-data/area.js
Normal file
File diff suppressed because it is too large
Load Diff
1503
components/mpvue-citypicker/city-data/city.js
Normal file
1503
components/mpvue-citypicker/city-data/city.js
Normal file
File diff suppressed because it is too large
Load Diff
139
components/mpvue-citypicker/city-data/province.js
Normal file
139
components/mpvue-citypicker/city-data/province.js
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
var provinceData = [{
|
||||||
|
"label": "北京市",
|
||||||
|
"value": "11"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "天津市",
|
||||||
|
"value": "12"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "河北省",
|
||||||
|
"value": "13"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "山西省",
|
||||||
|
"value": "14"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "內蒙古自治區",
|
||||||
|
"value": "15"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "遼寧省",
|
||||||
|
"value": "21"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "吉林省",
|
||||||
|
"value": "22"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "黑龍江省",
|
||||||
|
"value": "23"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "上海市",
|
||||||
|
"value": "31"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "江蘇省",
|
||||||
|
"value": "32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "浙江省",
|
||||||
|
"value": "33"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "安徽省",
|
||||||
|
"value": "34"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "福建省",
|
||||||
|
"value": "35"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "江西省",
|
||||||
|
"value": "36"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "山東省",
|
||||||
|
"value": "37"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "河南省",
|
||||||
|
"value": "41"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "湖北省",
|
||||||
|
"value": "42"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "湖南省",
|
||||||
|
"value": "43"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "廣東省",
|
||||||
|
"value": "44"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "廣西壯族自治區",
|
||||||
|
"value": "45"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "海南省",
|
||||||
|
"value": "46"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "重慶市",
|
||||||
|
"value": "50"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "四川省",
|
||||||
|
"value": "51"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "貴州省",
|
||||||
|
"value": "52"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "雲南省",
|
||||||
|
"value": "53"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "西藏自治區",
|
||||||
|
"value": "54"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "陝西省",
|
||||||
|
"value": "61"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "甘肅省",
|
||||||
|
"value": "62"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "青海省",
|
||||||
|
"value": "63"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "寧夏回族自治區",
|
||||||
|
"value": "64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "新疆維吾爾自治區",
|
||||||
|
"value": "65"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "臺灣",
|
||||||
|
"value": "66"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "香港",
|
||||||
|
"value": "67"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "澳門",
|
||||||
|
"value": "68"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
export default provinceData;
|
216
components/mpvue-citypicker/mpvueCityPicker.vue
Normal file
216
components/mpvue-citypicker/mpvueCityPicker.vue
Normal file
@ -0,0 +1,216 @@
|
|||||||
|
<template>
|
||||||
|
<div class="mpvue-picker">
|
||||||
|
<div :class="{'pickerMask':showPicker}" @click="maskClick" catchtouchmove="true"></div>
|
||||||
|
<div class="mpvue-picker-content " :class="{'mpvue-picker-view-show':showPicker}">
|
||||||
|
<div class="mpvue-picker__hd" catchtouchmove="true">
|
||||||
|
<div class="mpvue-picker__action" @click="pickerCancel">取消</div>
|
||||||
|
<div class="mpvue-picker__action" style="color:#000;" @click="pickerConfirm">確定</div>
|
||||||
|
</div>
|
||||||
|
<picker-view indicator-style="height: 40px;" class="mpvue-picker-view" :value="pickerValue" @change="pickerChange">
|
||||||
|
<picker-view-column>
|
||||||
|
<div class="picker-item" v-for="(item,index) in provinceDataList" :key="index">{{item.label}}</div>
|
||||||
|
</picker-view-column>
|
||||||
|
<picker-view-column>
|
||||||
|
<div class="picker-item" v-for="(item,index) in cityDataList" :key="index">{{item.label}}</div>
|
||||||
|
</picker-view-column>
|
||||||
|
<picker-view-column>
|
||||||
|
<div class="picker-item" v-for="(item,index) in areaDataList" :key="index">{{item.label}}</div>
|
||||||
|
</picker-view-column>
|
||||||
|
</picker-view>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import provinceData from './city-data/province.js';
|
||||||
|
import cityData from './city-data/city.js';
|
||||||
|
import areaData from './city-data/area.js';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pickerValue: [0, 0, 0],
|
||||||
|
provinceDataList: [],
|
||||||
|
cityDataList: [],
|
||||||
|
areaDataList: [],
|
||||||
|
showPicker: false,
|
||||||
|
newAreaData:[],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
/* 默認值 */
|
||||||
|
pickerValueDefault: {
|
||||||
|
type: Array,
|
||||||
|
default(){
|
||||||
|
return [0, 0, 0]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
selectedArea:{
|
||||||
|
type: Array,
|
||||||
|
default(){
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/* 主題色 */
|
||||||
|
themeColor: String
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
pickerValueDefault(){
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
this.handPickValueDefault(); // 對 pickerValueDefault 做兼容處理
|
||||||
|
let aaaa = this.selectedArea;
|
||||||
|
this.newAreaData = areaData.map(subArr => subArr.map(innerArr => innerArr.filter(item => !aaaa.includes(item.value))));
|
||||||
|
this.provinceDataList = provinceData;
|
||||||
|
this.cityDataList = cityData[this.pickerValueDefault[0]];
|
||||||
|
this.areaDataList = this.newAreaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]];
|
||||||
|
this.pickerValue = this.pickerValueDefault;
|
||||||
|
},
|
||||||
|
show() {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.showPicker = true;
|
||||||
|
}, 0);
|
||||||
|
},
|
||||||
|
maskClick() {
|
||||||
|
this.pickerCancel();
|
||||||
|
},
|
||||||
|
pickerCancel() {
|
||||||
|
this.showPicker = false;
|
||||||
|
this._$emit('onCancel');
|
||||||
|
},
|
||||||
|
pickerConfirm(e) {
|
||||||
|
this.showPicker = false;
|
||||||
|
this._$emit('onConfirm');
|
||||||
|
},
|
||||||
|
showPickerView() {
|
||||||
|
this.showPicker = true;
|
||||||
|
},
|
||||||
|
handPickValueDefault() {
|
||||||
|
if (this.pickerValueDefault !== [0, 0, 0]) {
|
||||||
|
if (this.pickerValueDefault[0] > provinceData.length - 1) {
|
||||||
|
this.pickerValueDefault[0] = provinceData.length - 1;
|
||||||
|
}
|
||||||
|
if (this.pickerValueDefault[1] > cityData[this.pickerValueDefault[0]].length - 1) {
|
||||||
|
this.pickerValueDefault[1] = cityData[this.pickerValueDefault[0]].length - 1;
|
||||||
|
}
|
||||||
|
if (this.pickerValueDefault[2] > areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]].length - 1) {
|
||||||
|
this.pickerValueDefault[2] = areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]].length - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
pickerChange(e) {
|
||||||
|
let changePickerValue = e.detail.value;
|
||||||
|
if (this.pickerValue[0] !== changePickerValue[0]) {
|
||||||
|
// 第一級發生滾動
|
||||||
|
this.cityDataList = cityData[changePickerValue[0]];
|
||||||
|
this.areaDataList = this.newAreaData[changePickerValue[0]][0];
|
||||||
|
changePickerValue[1] = 0;
|
||||||
|
changePickerValue[2] = 0;
|
||||||
|
} else if (this.pickerValue[1] !== changePickerValue[1]) {
|
||||||
|
// 第二級滾動
|
||||||
|
this.areaDataList =
|
||||||
|
this.newAreaData[changePickerValue[0]][changePickerValue[1]];
|
||||||
|
changePickerValue[2] = 0;
|
||||||
|
}
|
||||||
|
this.pickerValue = changePickerValue;
|
||||||
|
this._$emit('onChange');
|
||||||
|
},
|
||||||
|
_$emit(emitName) {
|
||||||
|
let pickObj = {
|
||||||
|
label: this._getLabel(),
|
||||||
|
value: this.pickerValue,
|
||||||
|
cityCode: this._getCityCode()
|
||||||
|
};
|
||||||
|
this.$emit(emitName, pickObj);
|
||||||
|
},
|
||||||
|
_getLabel() {
|
||||||
|
let pcikerLabel =
|
||||||
|
this.provinceDataList[this.pickerValue[0]].label +
|
||||||
|
'-' +
|
||||||
|
this.cityDataList[this.pickerValue[1]].label +
|
||||||
|
'-' +
|
||||||
|
this.areaDataList[this.pickerValue[2]].label;
|
||||||
|
return pcikerLabel;
|
||||||
|
},
|
||||||
|
_getCityCode() {
|
||||||
|
return this.areaDataList[this.pickerValue[2]].value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.pickerMask {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 1000;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.6);
|
||||||
|
}
|
||||||
|
.mpvue-picker-content {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
transform: translateY(100%);
|
||||||
|
z-index: 3000;
|
||||||
|
}
|
||||||
|
.mpvue-picker-view-show {
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
.mpvue-picker__hd {
|
||||||
|
display: flex;
|
||||||
|
padding: 9px 15px;
|
||||||
|
background-color: #fff;
|
||||||
|
position: relative;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 17px;
|
||||||
|
}
|
||||||
|
.mpvue-picker__hd:after {
|
||||||
|
content: ' ';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 1px;
|
||||||
|
border-bottom: 1px solid #e5e5e5;
|
||||||
|
color: #e5e5e5;
|
||||||
|
transform-origin: 0 100%;
|
||||||
|
transform: scaleY(0.5);
|
||||||
|
}
|
||||||
|
.mpvue-picker__action {
|
||||||
|
display: block;
|
||||||
|
flex: 1;
|
||||||
|
color: #1aad19;
|
||||||
|
}
|
||||||
|
.mpvue-picker__action:first-child {
|
||||||
|
text-align: left;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
.mpvue-picker__action:last-child {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.picker-item {
|
||||||
|
text-align: center;
|
||||||
|
line-height: 40px;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
.mpvue-picker-view {
|
||||||
|
position: relative;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 238px;
|
||||||
|
background-color: rgba(255, 255, 255, 1);
|
||||||
|
}
|
||||||
|
</style>
|
183
components/mpvue-citypicker/provincePicker.vue
Normal file
183
components/mpvue-citypicker/provincePicker.vue
Normal file
@ -0,0 +1,183 @@
|
|||||||
|
<template>
|
||||||
|
<view class="mpvue-picker">
|
||||||
|
<view :class="{'pickerMask':showPicker}" @click="maskClick" catchtouchmove="true"></view>
|
||||||
|
<view class="mpvue-picker-content" :class="{'mpvue-picker-view-show':showPicker}">
|
||||||
|
<view class="mpvue-picker__hd" catchtouchmove="true">
|
||||||
|
<view class="mpvue-picker__action" @click="pickerCancel">取消</view>
|
||||||
|
<view class="mpvue-picker__action" style="color:#000;" @click="pickerConfirm">確定</view>
|
||||||
|
</view>
|
||||||
|
<picker-view indicator-style="height: 40px;" class="mpvue-picker-view" :value="pickerValue" @change="pickerChange">
|
||||||
|
<picker-view-column>
|
||||||
|
<view class="picker-item" v-for="(item,index) in provinceDataList" :key="index">{{item.label}}</view>
|
||||||
|
</picker-view-column>
|
||||||
|
</picker-view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import provinceData from './city-data/province.js';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pickerValue: [0,0,0],
|
||||||
|
provinceDataList: [],
|
||||||
|
showPicker: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
/* 默認值 */
|
||||||
|
pickerValueDefault: {
|
||||||
|
type: Array,
|
||||||
|
default(){
|
||||||
|
return [0, 0, 0]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
selectedArea: {
|
||||||
|
type: Array,
|
||||||
|
default(){
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/* 主題色 */
|
||||||
|
themeColor: String
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
this.handPickValueDefault();
|
||||||
|
let arrayP = [];
|
||||||
|
let provinceArray = [];
|
||||||
|
this.selectedArea.map((item)=>{
|
||||||
|
let aa = item.slice(0,2);
|
||||||
|
arrayP.push(aa)
|
||||||
|
})
|
||||||
|
provinceArray = provinceData.filter(item=>{
|
||||||
|
return !arrayP.includes(item.value)
|
||||||
|
});
|
||||||
|
this.provinceDataList = provinceArray;
|
||||||
|
this.pickerValue = this.pickerValueDefault;
|
||||||
|
},
|
||||||
|
show() {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.showPicker = true;
|
||||||
|
}, 0);
|
||||||
|
},
|
||||||
|
maskClick() {
|
||||||
|
this.pickerCancel();
|
||||||
|
},
|
||||||
|
pickerCancel() {
|
||||||
|
this.showPicker = false;
|
||||||
|
this._$emit('onCancel1');
|
||||||
|
},
|
||||||
|
pickerConfirm(e) {
|
||||||
|
this.showPicker = false;
|
||||||
|
this._$emit('onConfirm1');
|
||||||
|
},
|
||||||
|
showPickerView() {
|
||||||
|
this.showPicker = true;
|
||||||
|
},
|
||||||
|
pickerChange(e) {
|
||||||
|
this.pickerValue = e.detail.value;
|
||||||
|
this._$emit('onChange');
|
||||||
|
},
|
||||||
|
_$emit(emitName) {
|
||||||
|
let pickObj = {
|
||||||
|
label: this.provinceDataList[this.pickerValue[0]].label,
|
||||||
|
value: this.pickerValue,
|
||||||
|
code: this.provinceDataList[this.pickerValue[0]].value
|
||||||
|
};
|
||||||
|
this.$emit(emitName, pickObj);
|
||||||
|
},
|
||||||
|
handPickValueDefault() {
|
||||||
|
if (this.pickerValueDefault !== [0, 0, 0]) {
|
||||||
|
if (this.pickerValueDefault[0] > provinceData.length - 1) {
|
||||||
|
this.pickerValueDefault[0] = provinceData.length - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.pickerMask {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 1000;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mpvue-picker-content {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
transform: translateY(100%);
|
||||||
|
z-index: 3000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mpvue-picker-view-show {
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mpvue-picker__hd {
|
||||||
|
display: flex;
|
||||||
|
padding: 9px 15px;
|
||||||
|
background-color: #fff;
|
||||||
|
position: relative;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 17px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mpvue-picker__hd:after {
|
||||||
|
content: ' ';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 1px;
|
||||||
|
border-bottom: 1px solid #e5e5e5;
|
||||||
|
color: #e5e5e5;
|
||||||
|
transform-origin: 0 100%;
|
||||||
|
transform: scaleY(0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mpvue-picker__action {
|
||||||
|
display: block;
|
||||||
|
flex: 1;
|
||||||
|
color: #1aad19;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mpvue-picker__action:first-child {
|
||||||
|
text-align: left;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mpvue-picker__action:last-child {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-item {
|
||||||
|
text-align: center;
|
||||||
|
line-height: 40px;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mpvue-picker-view {
|
||||||
|
position: relative;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 238px;
|
||||||
|
background-color: rgba(255, 255, 255, 1);
|
||||||
|
}
|
||||||
|
</style>
|
95
components/record.vue
Normal file
95
components/record.vue
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
<template>
|
||||||
|
<view class="personal_record">
|
||||||
|
<view class="p_e_top">
|
||||||
|
<view class="p_top_item">
|
||||||
|
<view class="">投入金额</view>
|
||||||
|
<view class="color-green">{{ item.money + " " + item.investCoin }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="p_top_item">
|
||||||
|
<view class="">个人收益</view>
|
||||||
|
<view class="color-green">{{ recordMoney() + " " + item.settleAsset }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="p_e_end">
|
||||||
|
<view class="p_end_item">
|
||||||
|
<view class="">时间</view>
|
||||||
|
<view class="color-black">{{ timeOptin(item.settletime * 1000) }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="p_end_item">
|
||||||
|
<view class="">总收益</view>
|
||||||
|
<view class="color-black">{{ item.settlefee + " " + item.settleAsset }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="p_end_item">
|
||||||
|
<view class="">手续费</view>
|
||||||
|
<view class="color-black">{{ item.serivcefee + " " + item.settleAsset }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default{
|
||||||
|
props:{
|
||||||
|
item:{
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
recordMoney(){
|
||||||
|
let num = 0;
|
||||||
|
let a = Number(this.item.settlefee);
|
||||||
|
let b = Number(this.item.serivcefee);
|
||||||
|
num = (a - b).toFixed(8);
|
||||||
|
return num
|
||||||
|
},
|
||||||
|
timeOptin(timestamp){
|
||||||
|
const date = new Date(timestamp);
|
||||||
|
const year = date.getFullYear();
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份從0開始,所以要加1
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0');
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||||
|
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||||
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.personal_record{
|
||||||
|
color: #A4A4A4;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.p_e_top{
|
||||||
|
.color-green{
|
||||||
|
color: #1ABA84;
|
||||||
|
font-weight: 700;
|
||||||
|
margin: 10rpx 0;
|
||||||
|
}
|
||||||
|
.p_top_item{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.p_e_end{
|
||||||
|
margin-top: 20rpx;
|
||||||
|
background-color: #F4F6F8;
|
||||||
|
padding: 10rpx 20rpx 20rpx 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
.p_end_item{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
.color-black{
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
207
components/smarttrading/coinCard/card.vue
Normal file
207
components/smarttrading/coinCard/card.vue
Normal file
@ -0,0 +1,207 @@
|
|||||||
|
<template>
|
||||||
|
<view :animation="animation">
|
||||||
|
<view class="card" @touchstart="handleTouchStart" @touchmove="handleTouchMove" @touchend="handleTouchEnd">
|
||||||
|
<view class="uni-flex uni-column">
|
||||||
|
<view class="uni-flex-item">
|
||||||
|
<view class="uni-flex uni-row">
|
||||||
|
<view class="uni-flex-item title" style="line-height: 34px;">我的 <label style=" font-weight: 800;padding: 0 6px; " :class="[coinType[index]]">{{coinType[index]}}</label>賬戶</view>
|
||||||
|
<view class="uni-flex-item" style="text-align: end;">
|
||||||
|
<button class="recharge" @click="$emit('recharge')" type="primary" size="mini" >充 值</button>
|
||||||
|
<button class="recharge" @click="$emit('changeMoney')" type="primary" style="margin-left: 10px;" size="mini" >轉 換</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="uni-flex-item" style="line-height: 32px; font-weight: 800;" :class="[coinType[index]]">
|
||||||
|
<label class="coinName">{{coinType[index]}}</label> :
|
||||||
|
<label style="padding-left: 12px; font-size: 16px;">{{balabces[coinType[index]]}}</label>
|
||||||
|
</view>
|
||||||
|
<view class="uni-flex-item" style="line-height: 32px; font-weight: 800;">
|
||||||
|
<label class="coinName">USDT</label> :
|
||||||
|
<label class="usdt">{{balabces.USDT}}</label></view>
|
||||||
|
<view class="uni-flex-item uni-flex uni-row">
|
||||||
|
<!-- <view class="uni-flex uni-column uni-flex-item">
|
||||||
|
<view class="uni-flex-item title" style="margin-top: 8px;">今日收益(USDT)</view>
|
||||||
|
<view class="uni-flex-item val" style="margin-top: 8px;">{{incomes.todaysettlefee}}</view>
|
||||||
|
<view class="uni-flex-item" style="text-align: end;"></view>
|
||||||
|
</view> -->
|
||||||
|
<view class="uni-flex uni-column uni-flex-item">
|
||||||
|
<view class="uni-flex-item title" style="margin-top: 8px;">總收益(<text :class="[coinType[index]]">{{coinType[index]}}</text>)</view>
|
||||||
|
<view class="uni-flex-item val" style="margin-top: 8px;">{{incomes.allsettlefee}}</view>
|
||||||
|
<view class="uni-flex-item" style="text-align: end;"></view>
|
||||||
|
</view>
|
||||||
|
<view class="uni-flex uni-column uni-flex-item">
|
||||||
|
<view class="uni-flex-item title" style="margin-top: 8px;">總花費(<text :class="[coinType[index]]">{{coinType[index]}}</text>)</view>
|
||||||
|
<view class="uni-flex-item val" style="margin-top: 8px;">{{incomes.allpayedfee}}</view>
|
||||||
|
<view class="uni-flex-item" style="text-align: end;"></view>
|
||||||
|
</view>
|
||||||
|
<view class="uni-flex-item uni-flex" style="align-items: center;">
|
||||||
|
<button class="recharge" @click="$emit('blanceInfos')" type="primary" size="mini" style="line-height: 34px;padding: 0 10px;">賬戶詳細</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="A1"></view>
|
||||||
|
<view class="A2"></view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
balabces:{
|
||||||
|
type:Object,
|
||||||
|
default:()=>{
|
||||||
|
return {
|
||||||
|
BNB:'0.00',
|
||||||
|
ETH:'0.00',
|
||||||
|
BTC:'0.00',
|
||||||
|
USDT:'0.00'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
incomes:{
|
||||||
|
type:Object,
|
||||||
|
default:()=>{
|
||||||
|
return {
|
||||||
|
todaysettlefee:0,
|
||||||
|
allsettlefee:0,
|
||||||
|
allpayedfee:0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data:()=>{
|
||||||
|
return {
|
||||||
|
startX: 0, // 觸摸開始時的Y座標
|
||||||
|
moveX:0,
|
||||||
|
animation:null,
|
||||||
|
moveing:false,
|
||||||
|
index:0,
|
||||||
|
coinType:['BNB','ETH','BTC'],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
handleTouchStart(e) {
|
||||||
|
this.startX = 0
|
||||||
|
this.startX = e.touches[0].clientX; // 獲取觸摸開始時的Y座標
|
||||||
|
},
|
||||||
|
handleTouchMove(e) {
|
||||||
|
this.moveX = e.touches[0].clientX - this.startX; // 計算移動的Y距離
|
||||||
|
},
|
||||||
|
handleTouchEnd(){
|
||||||
|
if(Math.abs(this.moveX) > 60 && !this.animation){
|
||||||
|
this.moveX = 0
|
||||||
|
this.animation = uni.createAnimation() .rotateY(90).step({duration: 330,timingFunction:"ease-in"}).export()
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.animation = null
|
||||||
|
this.animation = uni.createAnimation() .rotateY(0).step({duration: 330,timingFunction:"ease-in"}).export()
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.index++
|
||||||
|
if(this.index > 2){
|
||||||
|
this.index = 0
|
||||||
|
}
|
||||||
|
this.$emit('nowCoinType',this.index)
|
||||||
|
this.animation = null
|
||||||
|
},330)
|
||||||
|
},330)
|
||||||
|
|
||||||
|
// .translate((this.moveX > 0?'100%':'-100%'), 0).step({ duration: 30, timingFunction: "step-end"})
|
||||||
|
// .translate((this.moveX > 0?'-100%':'100%'), 0).step({ duration: 10,timingFunction: "step-end"})
|
||||||
|
// .translate(0, 0).step({duration: 300,timingFunction:"ease-in"}).export()
|
||||||
|
// this.moveX = 0
|
||||||
|
// this.moveing = true
|
||||||
|
// setTimeout(()=>{
|
||||||
|
// this.index++
|
||||||
|
// if(this.index > 2){
|
||||||
|
// this.index = 0
|
||||||
|
// }
|
||||||
|
// this.moveing = false
|
||||||
|
// this.animation = null
|
||||||
|
// },300)
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.card {
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px;
|
||||||
|
background-color: #fff;
|
||||||
|
margin-top: 10px;
|
||||||
|
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
|
z-index: 99;
|
||||||
|
|
||||||
|
.title{
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #A4A4A4;
|
||||||
|
}
|
||||||
|
.tag{
|
||||||
|
background-color: #4F5AD7;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0px 12px;
|
||||||
|
border-radius: 24px;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.usdt{
|
||||||
|
color:#1ABA84;
|
||||||
|
font-size: 18px;
|
||||||
|
padding-left: 12px;
|
||||||
|
}
|
||||||
|
.val{
|
||||||
|
color: #222;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
text-indent: 4px;
|
||||||
|
}
|
||||||
|
.tag-1{
|
||||||
|
background-color: #D8F9EE;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 2px 12px;
|
||||||
|
border-radius: 12px;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #1ABA84;
|
||||||
|
}
|
||||||
|
.recharge{
|
||||||
|
background-color: #4F5AD7; border-radius: 32px; font-weight: 800;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.A1,
|
||||||
|
.A2 {
|
||||||
|
height: 24px;
|
||||||
|
background: #AAAAB1;
|
||||||
|
position: relative;
|
||||||
|
border-radius: 0 0 24px 24px;
|
||||||
|
width: 94%;
|
||||||
|
margin: -16px auto;
|
||||||
|
z-index: 10;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.A2 {
|
||||||
|
z-index: 9;
|
||||||
|
width: 86%;
|
||||||
|
margin-top: -16px;
|
||||||
|
background-color: #7C7D8B;
|
||||||
|
}
|
||||||
|
.BNB{
|
||||||
|
color: #EEB80B !important;
|
||||||
|
}
|
||||||
|
.ETH{
|
||||||
|
color: #5E81F3 !important;
|
||||||
|
}
|
||||||
|
.BTC{
|
||||||
|
color: #F5921A !important;
|
||||||
|
}
|
||||||
|
.coinName{
|
||||||
|
display: inline-block;width: 52px; text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
168
components/smarttrading/item.vue
Normal file
168
components/smarttrading/item.vue
Normal file
@ -0,0 +1,168 @@
|
|||||||
|
<template>
|
||||||
|
<view class="AI-Invest-item" >
|
||||||
|
<view class="uni-flex uni-column box" @click="toDetail">
|
||||||
|
<view class="uni-flex uni-column">
|
||||||
|
<view class="uni-flex uni-row" style="padding: 12px 0;">
|
||||||
|
<view>
|
||||||
|
<image :src="imgs[detail[detail.optionType==='PUT'?'exercisedCoin':'investCoin']]"
|
||||||
|
class="icon-img"></image>
|
||||||
|
</view>
|
||||||
|
<view class="uni-flex-item" style="padding-left: 8px;">
|
||||||
|
<view class="uni-flex uni-row">
|
||||||
|
<view class="uni-flex-item">
|
||||||
|
{{detail[detail.optionType==='PUT'?'exercisedCoin':'investCoin']}}</view>
|
||||||
|
<view class="uni-flex-item" style="color: red; text-align: end;">
|
||||||
|
{{detail.strikePrice||'0.000'}} {{detail[detail.optionType==='PUT'?'exercisedCoin':'investCoin']}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="uni-flex uni-row">
|
||||||
|
<view class="uni-flex-item" style="line-height: 18px;">
|
||||||
|
<view v-if="detail.hasOwnProperty('money')">
|
||||||
|
<label class="label" style="font-size: 12px;">購買數量 : </label>
|
||||||
|
<label style="color: red;">{{detail.money}} USDT</label>
|
||||||
|
</view>
|
||||||
|
<view v-else>
|
||||||
|
<view class="uni-flex uni-column" style="font-size: 12px;">
|
||||||
|
<view class="uni-flex-item">
|
||||||
|
<label class="label">最大限購 : </label>
|
||||||
|
<label>{{Number(detail.maxAmount).toFixed(3)}} {{detail[detail.optionType==='PUT'?'exercisedCoin':'investCoin']}}</label>
|
||||||
|
</view>
|
||||||
|
<view class="uni-flex-item">
|
||||||
|
<label class="label">最小限購 : </label>
|
||||||
|
<label>{{Number(min[coin])}} {{coin}}</label>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view v-if="detail.hasOwnProperty('money')">
|
||||||
|
<label class="label" style="font-size: 12px;">購買時間 : </label>
|
||||||
|
<label>{{$moment(Number(detail.createTimes||detail.createTimestamp)).format('YYYY-MM-DD HH:mm:ss')}}</label>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<label class="label"
|
||||||
|
style="font-size: 12px;">{{detail.hasOwnProperty('money')?'結算':'購買截止'}}時間 : </label>
|
||||||
|
<label>{{toDate()}}</label>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view class="uni-flex uni-row AI-text">
|
||||||
|
<view>
|
||||||
|
<label style="color:#A4A4A4">投資週期 : </label><label
|
||||||
|
style="color: #1ABA84; padding: 0 4px;">{{detail.duration}} 天</label>
|
||||||
|
</view>
|
||||||
|
<view class="uni-flex-item" style="text-align: end">
|
||||||
|
<label style="color:#A4A4A4">AI預測年化收益 : </label>
|
||||||
|
<label style="color: #1ABA84; padding-left: 4px;">{{(detail.apr*100).toFixed(3)}}%</label>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
detail: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
name: "item",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
min:{'BNB':'0.2','ETH':'0.01','BTC':'0.001','USDT':100},
|
||||||
|
imgs: {
|
||||||
|
BNB: '/static/bnb.png',
|
||||||
|
ETH: '/static/eth.png',
|
||||||
|
BTC: '/static/btc.png'
|
||||||
|
},
|
||||||
|
coin:'USDT',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.coin = this.detail.optionType === 'PUT' ? 'USDT' : this.detail.investCoin
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
toDate() {
|
||||||
|
const date = this.detail.hasOwnProperty('money') ? this.detail.settleDate : this.detail.purchaseEndTime
|
||||||
|
return this.$moment(Number(date)).format('YYYY-MM-DD')
|
||||||
|
},
|
||||||
|
toDetail() {
|
||||||
|
if(this.detail.hasOwnProperty('money'))return
|
||||||
|
uni.setStorageSync(this.detail.id, JSON.stringify(this.detail))
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/smarttrading/buy?id=' + this.detail.id
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AI-Invest-item {
|
||||||
|
border-bottom: 1rpx solid #999;
|
||||||
|
|
||||||
|
.fb40 {
|
||||||
|
flex-basis: 40%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p12 {
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lh24 {
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
color: #A4A4A4;
|
||||||
|
padding-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
font-size: 14px;
|
||||||
|
|
||||||
|
.icon-img {
|
||||||
|
height: 48px;
|
||||||
|
width: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.AI-text {
|
||||||
|
background-color: #E9EAFA;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 4px 8px;
|
||||||
|
background-color: #CACDF3;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.up {
|
||||||
|
color: #1ABA84;
|
||||||
|
}
|
||||||
|
|
||||||
|
.down {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep {
|
||||||
|
.u-text {
|
||||||
|
justify-content: flex-end !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
60
components/smarttrading/pages.vue
Normal file
60
components/smarttrading/pages.vue
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<template>
|
||||||
|
<view class="pages" v-if="pages.totalPage > 1">
|
||||||
|
<view class="uni-flex uni-row" style="justify-content: space-around;">
|
||||||
|
<view :class="{'prohibit' : pages.page === 1} " class="btn">首页</view>
|
||||||
|
<view class="page-arrow" @click="pageCheck(1)">
|
||||||
|
<u-icon v-if="pages.page !== 1" name="arrow-left" size="20"></u-icon>
|
||||||
|
</view>
|
||||||
|
<view style="text-align: center;">
|
||||||
|
<label style="color: #2C405A; padding-right: 4px;">{{pages.page}}</label> / {{pages.totalPage}}
|
||||||
|
</view>
|
||||||
|
<view class="page-arrow" @click="pageCheck(2)">
|
||||||
|
<u-icon v-if="pages.page !== pages.totalPage" name="arrow-right" size="20"></u-icon>
|
||||||
|
</view>
|
||||||
|
<view :class="{'prohibit' : pages.page === pages.totalPage} " class="btn">尾页</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props:{
|
||||||
|
pages:{
|
||||||
|
type:Object,
|
||||||
|
default :()=>{return{page:1,totalPage:0}}
|
||||||
|
},
|
||||||
|
type:'invest'
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
pageCheck(pageType){
|
||||||
|
let page = this.pages.page
|
||||||
|
if(pageType === 1 && this.pages.page > 1){
|
||||||
|
page--
|
||||||
|
}else if(pageType === 2 && this.pages.page < this.pages.totalPage){
|
||||||
|
page++
|
||||||
|
}
|
||||||
|
this.$emit('pageFun',page)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.pages{
|
||||||
|
padding: 12px 0;
|
||||||
|
height: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
.page-arrow{
|
||||||
|
justify-items: center;
|
||||||
|
padding-top: 6px;
|
||||||
|
}
|
||||||
|
.prohibit{
|
||||||
|
color: #A4A4A4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
20
index.html
Normal file
20
index.html
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<script>
|
||||||
|
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
||||||
|
CSS.supports('top: constant(a)'))
|
||||||
|
document.write(
|
||||||
|
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
||||||
|
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||||
|
</script>
|
||||||
|
<title></title>
|
||||||
|
<!--preload-links-->
|
||||||
|
<!--app-context-->
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"><!--app-html--></div>
|
||||||
|
<script type="module" src="/main.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
17
main.js
Normal file
17
main.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import Vue from 'vue';
|
||||||
|
import App from './App'
|
||||||
|
import uView from './uview-ui'
|
||||||
|
import { TextEncoder, TextDecoder } from 'text-decoding'
|
||||||
|
import moment from './common/moment.min.js'
|
||||||
|
moment.locale('zh-cn')
|
||||||
|
Vue.prototype.$moment = moment;
|
||||||
|
global.TextEncoder = TextEncoder
|
||||||
|
global.TextDecoder = TextDecoder
|
||||||
|
Vue.use(uView)
|
||||||
|
Vue.config.productionTip = false
|
||||||
|
App.mpType = 'app'
|
||||||
|
|
||||||
|
const app = new Vue({
|
||||||
|
...App
|
||||||
|
})
|
||||||
|
app.$mount()
|
143
manifest.json
Normal file
143
manifest.json
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
{
|
||||||
|
"name" : "Onlife",
|
||||||
|
"appid" : "__UNI__F3B5917",
|
||||||
|
"description" : "",
|
||||||
|
"versionName" : "3.0.6",
|
||||||
|
"versionCode" : "100",
|
||||||
|
"transformPx" : false,
|
||||||
|
/* 5+App特有相关 */
|
||||||
|
"app-plus" : {
|
||||||
|
"secureNetwork" : {
|
||||||
|
"domains" : {
|
||||||
|
"request" : [ "https://www.samsaradao.com" ]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"usingComponents" : true,
|
||||||
|
"nvueStyleCompiler" : "uni-app",
|
||||||
|
"compilerVersion" : 3,
|
||||||
|
"splashscreen" : {
|
||||||
|
"alwaysShowBeforeRender" : true,
|
||||||
|
"waiting" : true,
|
||||||
|
"autoclose" : true,
|
||||||
|
"delay" : 0
|
||||||
|
},
|
||||||
|
"safelist" : [ "https://bsc-dataseed1.binance.org:443" ],
|
||||||
|
/* 模块配置 */
|
||||||
|
"modules" : {
|
||||||
|
"SQLite" : {},
|
||||||
|
"Webview" : {}
|
||||||
|
},
|
||||||
|
/* 应用发布信息 */
|
||||||
|
"distribute" : {
|
||||||
|
/* android打包配置 */
|
||||||
|
"android" : {
|
||||||
|
"permissions" : [
|
||||||
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.INTERNET\"/>"
|
||||||
|
],
|
||||||
|
"network" : {
|
||||||
|
"timeout" : 20000
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/* ios打包配置 */
|
||||||
|
"ios" : {
|
||||||
|
"dSYMs" : false
|
||||||
|
},
|
||||||
|
/* SDK配置 */
|
||||||
|
"sdkConfigs" : {},
|
||||||
|
"icons" : {
|
||||||
|
"android" : {
|
||||||
|
"hdpi" : "unpackage/res/icons/72x72.png",
|
||||||
|
"xhdpi" : "unpackage/res/icons/96x96.png",
|
||||||
|
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
||||||
|
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
||||||
|
},
|
||||||
|
"ios" : {
|
||||||
|
"appstore" : "unpackage/res/icons/1024x1024.png",
|
||||||
|
"ipad" : {
|
||||||
|
"app" : "unpackage/res/icons/76x76.png",
|
||||||
|
"app@2x" : "unpackage/res/icons/152x152.png",
|
||||||
|
"notification" : "unpackage/res/icons/20x20.png",
|
||||||
|
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||||
|
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
||||||
|
"settings" : "unpackage/res/icons/29x29.png",
|
||||||
|
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||||
|
"spotlight" : "unpackage/res/icons/40x40.png",
|
||||||
|
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
||||||
|
},
|
||||||
|
"iphone" : {
|
||||||
|
"app@2x" : "unpackage/res/icons/120x120.png",
|
||||||
|
"app@3x" : "unpackage/res/icons/180x180.png",
|
||||||
|
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||||
|
"notification@3x" : "unpackage/res/icons/60x60.png",
|
||||||
|
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||||
|
"settings@3x" : "unpackage/res/icons/87x87.png",
|
||||||
|
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
||||||
|
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/* 快应用特有相关 */
|
||||||
|
"quickapp" : {},
|
||||||
|
/* 小程序特有相关 */
|
||||||
|
"mp-weixin" : {
|
||||||
|
"appid" : "",
|
||||||
|
"setting" : {
|
||||||
|
"urlCheck" : false
|
||||||
|
},
|
||||||
|
"usingComponents" : true
|
||||||
|
},
|
||||||
|
"mp-alipay" : {
|
||||||
|
"usingComponents" : true
|
||||||
|
},
|
||||||
|
"mp-baidu" : {
|
||||||
|
"usingComponents" : true
|
||||||
|
},
|
||||||
|
"mp-toutiao" : {
|
||||||
|
"usingComponents" : true
|
||||||
|
},
|
||||||
|
"uniStatistics" : {
|
||||||
|
"enable" : false
|
||||||
|
},
|
||||||
|
"vueVersion" : "2",
|
||||||
|
"h5" : {
|
||||||
|
"devServer" : {
|
||||||
|
"https" : false,
|
||||||
|
"proxy" : {
|
||||||
|
"/api" : {
|
||||||
|
"target" : "https://onlif.klinygm.com", //'http://your-backend-server.com', // 目标后端服务器地址
|
||||||
|
"changeOrigin" : true, // 是否改变源地址
|
||||||
|
"pathRewrite" : {
|
||||||
|
"^/api" : "" // 重写路径
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/invset" : {
|
||||||
|
"target" : "http://47.245.29.15", //'http://your-backend-server.com', // 目标后端服务器地址
|
||||||
|
"changeOrigin" : true, // 是否改变源地址
|
||||||
|
"pathRewrite" : {
|
||||||
|
"^/invset" : "" // 重写路径
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"router" : {
|
||||||
|
"base" : "/h5/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
15
node_modules/.bin/color-support
generated
vendored
Normal file
15
node_modules/.bin/color-support
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../color-support/bin.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../color-support/bin.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/color-support.cmd
generated
vendored
Normal file
17
node_modules/.bin/color-support.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\color-support\bin.js" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/color-support.ps1
generated
vendored
Normal file
18
node_modules/.bin/color-support.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../color-support/bin.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../color-support/bin.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/json5
generated
vendored
Normal file
15
node_modules/.bin/json5
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../json5/lib/cli.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../json5/lib/cli.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/json5.cmd
generated
vendored
Normal file
17
node_modules/.bin/json5.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\json5\lib\cli.js" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/json5.ps1
generated
vendored
Normal file
18
node_modules/.bin/json5.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../json5/lib/cli.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/miller-rabin
generated
vendored
Normal file
15
node_modules/.bin/miller-rabin
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../miller-rabin/bin/miller-rabin" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../miller-rabin/bin/miller-rabin" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/miller-rabin.cmd
generated
vendored
Normal file
17
node_modules/.bin/miller-rabin.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\miller-rabin\bin\miller-rabin" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/miller-rabin.ps1
generated
vendored
Normal file
18
node_modules/.bin/miller-rabin.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../miller-rabin/bin/miller-rabin" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../miller-rabin/bin/miller-rabin" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/mime
generated
vendored
Normal file
15
node_modules/.bin/mime
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../mime/cli.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../mime/cli.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/mime.cmd
generated
vendored
Normal file
17
node_modules/.bin/mime.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\mime\cli.js" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/mime.ps1
generated
vendored
Normal file
18
node_modules/.bin/mime.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../mime/cli.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../mime/cli.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/mkdirp
generated
vendored
Normal file
15
node_modules/.bin/mkdirp
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../mkdirp/bin/cmd.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/mkdirp.cmd
generated
vendored
Normal file
17
node_modules/.bin/mkdirp.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\mkdirp\bin\cmd.js" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/mkdirp.ps1
generated
vendored
Normal file
18
node_modules/.bin/mkdirp.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/node-gyp-build
generated
vendored
Normal file
15
node_modules/.bin/node-gyp-build
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../node-gyp-build/bin.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../node-gyp-build/bin.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
15
node_modules/.bin/node-gyp-build-optional
generated
vendored
Normal file
15
node_modules/.bin/node-gyp-build-optional
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../node-gyp-build/optional.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../node-gyp-build/optional.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/node-gyp-build-optional.cmd
generated
vendored
Normal file
17
node_modules/.bin/node-gyp-build-optional.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\node-gyp-build\optional.js" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/node-gyp-build-optional.ps1
generated
vendored
Normal file
18
node_modules/.bin/node-gyp-build-optional.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../node-gyp-build/optional.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../node-gyp-build/optional.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/node-gyp-build-test
generated
vendored
Normal file
15
node_modules/.bin/node-gyp-build-test
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../node-gyp-build/build-test.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../node-gyp-build/build-test.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/node-gyp-build-test.cmd
generated
vendored
Normal file
17
node_modules/.bin/node-gyp-build-test.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\node-gyp-build\build-test.js" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/node-gyp-build-test.ps1
generated
vendored
Normal file
18
node_modules/.bin/node-gyp-build-test.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../node-gyp-build/build-test.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../node-gyp-build/build-test.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
17
node_modules/.bin/node-gyp-build.cmd
generated
vendored
Normal file
17
node_modules/.bin/node-gyp-build.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\node-gyp-build\bin.js" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/node-gyp-build.ps1
generated
vendored
Normal file
18
node_modules/.bin/node-gyp-build.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../node-gyp-build/bin.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../node-gyp-build/bin.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/node-pre-gyp
generated
vendored
Normal file
15
node_modules/.bin/node-pre-gyp
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../@mapbox/node-pre-gyp/bin/node-pre-gyp" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../@mapbox/node-pre-gyp/bin/node-pre-gyp" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/node-pre-gyp.cmd
generated
vendored
Normal file
17
node_modules/.bin/node-pre-gyp.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\@mapbox\node-pre-gyp\bin\node-pre-gyp" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/node-pre-gyp.ps1
generated
vendored
Normal file
18
node_modules/.bin/node-pre-gyp.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../@mapbox/node-pre-gyp/bin/node-pre-gyp" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../@mapbox/node-pre-gyp/bin/node-pre-gyp" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/nopt
generated
vendored
Normal file
15
node_modules/.bin/nopt
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../nopt/bin/nopt.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../nopt/bin/nopt.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/nopt.cmd
generated
vendored
Normal file
17
node_modules/.bin/nopt.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\nopt\bin\nopt.js" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/nopt.ps1
generated
vendored
Normal file
18
node_modules/.bin/nopt.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../nopt/bin/nopt.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../nopt/bin/nopt.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/qrcode
generated
vendored
Normal file
15
node_modules/.bin/qrcode
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../qrcode/bin/qrcode" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../qrcode/bin/qrcode" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/qrcode.cmd
generated
vendored
Normal file
17
node_modules/.bin/qrcode.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\qrcode\bin\qrcode" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/qrcode.ps1
generated
vendored
Normal file
18
node_modules/.bin/qrcode.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../qrcode/bin/qrcode" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../qrcode/bin/qrcode" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/resolve
generated
vendored
Normal file
15
node_modules/.bin/resolve
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../resolve/bin/resolve" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../resolve/bin/resolve" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/resolve.cmd
generated
vendored
Normal file
17
node_modules/.bin/resolve.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\resolve\bin\resolve" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/resolve.ps1
generated
vendored
Normal file
18
node_modules/.bin/resolve.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../resolve/bin/resolve" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/rimraf
generated
vendored
Normal file
15
node_modules/.bin/rimraf
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../rimraf/bin.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../rimraf/bin.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/rimraf.cmd
generated
vendored
Normal file
17
node_modules/.bin/rimraf.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\rimraf\bin.js" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/rimraf.ps1
generated
vendored
Normal file
18
node_modules/.bin/rimraf.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../rimraf/bin.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../rimraf/bin.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/rlp
generated
vendored
Normal file
15
node_modules/.bin/rlp
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../@ethereumjs/rlp/bin/rlp.cjs" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../@ethereumjs/rlp/bin/rlp.cjs" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/rlp.cmd
generated
vendored
Normal file
17
node_modules/.bin/rlp.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\@ethereumjs\rlp\bin\rlp.cjs" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/rlp.ps1
generated
vendored
Normal file
18
node_modules/.bin/rlp.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../@ethereumjs/rlp/bin/rlp.cjs" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../@ethereumjs/rlp/bin/rlp.cjs" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/semver
generated
vendored
Normal file
15
node_modules/.bin/semver
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../semver/bin/semver.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../semver/bin/semver.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/semver.cmd
generated
vendored
Normal file
17
node_modules/.bin/semver.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\semver\bin\semver.js" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/semver.ps1
generated
vendored
Normal file
18
node_modules/.bin/semver.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../semver/bin/semver.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/sha.js
generated
vendored
Normal file
15
node_modules/.bin/sha.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../sha.js/bin.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../sha.js/bin.js" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/sha.js.cmd
generated
vendored
Normal file
17
node_modules/.bin/sha.js.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\sha.js\bin.js" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/sha.js.ps1
generated
vendored
Normal file
18
node_modules/.bin/sha.js.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../sha.js/bin.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../sha.js/bin.js" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/sshpk-conv
generated
vendored
Normal file
15
node_modules/.bin/sshpk-conv
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../sshpk/bin/sshpk-conv" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../sshpk/bin/sshpk-conv" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/sshpk-conv.cmd
generated
vendored
Normal file
17
node_modules/.bin/sshpk-conv.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\sshpk\bin\sshpk-conv" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/sshpk-conv.ps1
generated
vendored
Normal file
18
node_modules/.bin/sshpk-conv.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../sshpk/bin/sshpk-conv" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../sshpk/bin/sshpk-conv" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/sshpk-sign
generated
vendored
Normal file
15
node_modules/.bin/sshpk-sign
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../sshpk/bin/sshpk-sign" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../sshpk/bin/sshpk-sign" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/sshpk-sign.cmd
generated
vendored
Normal file
17
node_modules/.bin/sshpk-sign.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\sshpk\bin\sshpk-sign" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/sshpk-sign.ps1
generated
vendored
Normal file
18
node_modules/.bin/sshpk-sign.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../sshpk/bin/sshpk-sign" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../sshpk/bin/sshpk-sign" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/sshpk-verify
generated
vendored
Normal file
15
node_modules/.bin/sshpk-verify
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../sshpk/bin/sshpk-verify" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../sshpk/bin/sshpk-verify" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/sshpk-verify.cmd
generated
vendored
Normal file
17
node_modules/.bin/sshpk-verify.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\sshpk\bin\sshpk-verify" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/sshpk-verify.ps1
generated
vendored
Normal file
18
node_modules/.bin/sshpk-verify.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../sshpk/bin/sshpk-verify" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../sshpk/bin/sshpk-verify" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
15
node_modules/.bin/uuid
generated
vendored
Normal file
15
node_modules/.bin/uuid
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
"$basedir/node" "$basedir/../uuid/dist/bin/uuid" "$@"
|
||||||
|
ret=$?
|
||||||
|
else
|
||||||
|
node "$basedir/../uuid/dist/bin/uuid" "$@"
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
exit $ret
|
17
node_modules/.bin/uuid.cmd
generated
vendored
Normal file
17
node_modules/.bin/uuid.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@ECHO off
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
"%_prog%" "%dp0%\..\uuid\dist\bin\uuid" %*
|
||||||
|
ENDLOCAL
|
||||||
|
EXIT /b %errorlevel%
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
18
node_modules/.bin/uuid.ps1
generated
vendored
Normal file
18
node_modules/.bin/uuid.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
& "$basedir/node$exe" "$basedir/../uuid/dist/bin/uuid" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../uuid/dist/bin/uuid" $args
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
4382
node_modules/.package-lock.json
generated
vendored
Normal file
4382
node_modules/.package-lock.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
22
node_modules/@ethereumjs/common/LICENSE
generated
vendored
Normal file
22
node_modules/@ethereumjs/common/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2015
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user