This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'whatwg-fetch'; | |
| import {openSnackbar} from '../../public/action/globalAction'; | |
| export function setAttractions(attractions){ | |
| return { | |
| type:'SET_ATTRACTIONS', | |
| attractions:attractions | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //获取当前路由 | |
| let path = hashHistory.getCurrentLocation().pathname; | |
| //路由跳转 | |
| hashHistory.push('/'); | |
| //路由示例 | |
| <Router history={hashHistory}> | |
| <Route path='/' component={Tabbar}> //每次都会加载 Tabbar | |
| <IndexRoute component={Index} /> // '/'加载的路由 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import axios from 'axios' | |
| import { MessagePlugin, DialogPlugin } from '@tencent/tdesign-vue' // 换成需要的提示工具库 | |
| const instance = axios.create({ | |
| timeout: 1000, | |
| }) | |
| instance.interceptors.request.use(config => config) | |
| instance.interceptors.response.use(response => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var path = require('path'); | |
| var HtmlwebpackPlugin = require('html-webpack-plugin'); | |
| //定义了一些文件夹的路径 | |
| var ROOT_PATH = path.resolve(__dirname); | |
| var APP_PATH = path.resolve(ROOT_PATH, 'src'); | |
| var BUILD_PATH = path.resolve(ROOT_PATH, 'build'); | |
| var TEM_PATH = path.resolve(APP_PATH, 'index.html'); | |
| module.exports = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| url = Object.keys(data).map(function(k) { | |
| return encodeURIComponent(k) + '=' + encodeURIComponent(data[k]) | |
| }).join('&') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // <script src="./resources/js/qrcode.min.js"></script> | |
| // https://davidshimjs.github.io/qrcodejs/ | |
| Vue.component('qrcode', { | |
| props: ['value', 'id'], | |
| template: '<div id="id"></div>', | |
| mounted: function () { | |
| this.initQR() | |
| }, | |
| methods: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="loading"> | |
| <div class="sk-fading-circle"> | |
| <div class="sk-circle1 sk-circle"></div> | |
| <div class="sk-circle2 sk-circle"></div> | |
| <div class="sk-circle3 sk-circle"></div> | |
| <div class="sk-circle4 sk-circle"></div> | |
| <div class="sk-circle5 sk-circle"></div> | |
| <div class="sk-circle6 sk-circle"></div> | |
| <div class="sk-circle7 sk-circle"></div> | |
| <div class="sk-circle8 sk-circle"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var path = require('path'); | |
| var HtmlwebpackPlugin = require('html-webpack-plugin'); | |
| //定义了一些文件夹的路径 | |
| var ROOT_PATH = path.resolve(__dirname); | |
| var APP_PATH = path.resolve(ROOT_PATH, 'src'); | |
| var BUILD_PATH = path.resolve(ROOT_PATH, 'build'); | |
| var TEM_PATH = path.resolve(APP_PATH, 'index.html'); | |
| module.exports = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 格式化价格 | |
| * 2000099 => 20,000.99 元 | |
| * @param num 单位分 | |
| * @param currencyType | |
| * @returns {string} | |
| */ | |
| module.exports = (num, currencyType = null) => { | |
| let value = Number(num).toFixed(2) | |
| let parts = value.toString().split(".") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let rows = [{}] | |
| let wb = XLSX.utils.book_new() | |
| let ws = XLSX.utils.aoa_to_sheet(rows) | |
| // 设置每一列宽度 | |
| ws['!cols'] = [{wpx: 120}, {wpx: 100}, {wpx: 200}, {wpx: 100}] | |
| let name = 'excel 文件' | |
| XLSX.utils.book_append_sheet(wb, ws, name) |
OlderNewer