Commit 682f096f by 李伟康

提交代码

1 parent 207a581a
......@@ -16,17 +16,14 @@
"core-js": "^3.6.4",
"dayjs": "^1.10.5",
"echarts": "^5.3.3",
"glsx-common": "^1.4.9",
"lib-flexible": "^0.3.2",
"postcss-loader": "^6.2.0",
"sha1": "^1.1.1",
"storejs": "^1.1.0",
"vant": "^2.12.21",
"vconsole": "^3.7.0",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0",
"webpack-spritesmith": "^1.1.0"
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
......
......@@ -7,8 +7,6 @@
* @LastEditTime: 2021-06-17 18:23:27
*/
import wwbenchApi from './wwbenchApi'
import wxConfig from './wxConfig'
export {
wwbenchApi,
wxConfig,
}
\ No newline at end of file
import util from '@/utils/util'
import { Notify } from 'vant'
// import { Notify } from 'vant'
const url = '/rop-scrm-wechat/router'
const WxConfig = {
init (jsApiList) {
......@@ -44,7 +44,7 @@ const WxConfig = {
})
}, 500)
} else {
Notify('网络异常')
// Notify('网络异常')
}
})
})
......@@ -205,7 +205,7 @@ const WxConfig = {
},
fail (res) {
if (res.errMsg.indexOf('function not exist') > -1) {
Notify('版本过低请升级')
// Notify('版本过低请升级')
}
reject()
}
......
......@@ -7,7 +7,7 @@
</div>
<div class="bottom">
<view-sub-title title="销售数据总览" />
<view-line-group height="14.9vh" />
<view-pie-group />
</div>
</div>
......
<template>
<div class="right">
<view-sub-title title="售后数据总览" />
<view-line-group />
<view-line-group />
<view-line-group />
<view-line-group height="25.6vh" hideMargin />
</div>
</template>
......@@ -20,6 +24,5 @@ export default {
<style scoped lang='scss'>
.right {
background: #fff;
}
}
</style>
\ No newline at end of file
<template>
<div class="line-group">
<template v-for="(i,index) in items">
<div
class="box"
:key="index"
:style="[{'height':height},{'margin-bottom':hideMargin?0:'1vh'}]"
></div>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'ViewLineGroup',
props: {
height: {
type: String,
default: '19.8vh'
},
hideMargin: Boolean
},
data () {
return {
items: [1, 2]
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.line-group {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 0 8px;
}
</style>
\ No newline at end of file
......@@ -20,8 +20,6 @@ import { fetchConfig, cfg } from '@/config'
import '@/assets/css/index.scss'
import './utils/util'
import 'components'
import { components } from '@/plugins/vant'
components.forEach(component => Vue.use(component))
Vue.prototype.api = api
Vue.prototype.to = function (name, params) {
if (name === -1) {
......
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-23 11:44:59
*/
// 按需全局引入 vant组件
import {
Button,
List,
Cell,
Tabbar,
TabbarItem,
NavBar,
Lazyload,
Toast,
Search,
ActionSheet,
CellGroup,
Image as VanImage,
Tag,
Field,
Stepper,
Divider,
Step,
Steps,
NoticeBar,
RadioGroup,
Radio,
Uploader,
Tab,
Tabs,
DropdownMenu,
DropdownItem,
Grid,
GridItem,
Popup,
Calendar,
Cascader,
Checkbox,
CheckboxGroup,
Notify,
Icon,
Empty,
PullRefresh,
Picker,
Dialog
} from 'vant'
export const components = [
Button,
List,
Cell,
Tabbar,
TabbarItem,
NavBar,
Search,
ActionSheet,
CellGroup,
VanImage,
Tag,
Field,
Stepper,
Divider,
Step,
Steps,
NoticeBar,
RadioGroup,
Radio,
Uploader,
Tab,
Tabs,
DropdownMenu,
DropdownItem,
Grid,
GridItem,
Popup,
Calendar,
Cascader,
Checkbox,
CheckboxGroup,
Notify,
Icon,
Empty,
PullRefresh,
Picker,
Dialog
]
......@@ -8,7 +8,7 @@ import {
* 日期格式化
* let time = new Date().format('yyyy-MM-dd hh:mm:ss')
*/
Date.prototype.format = function(fmt) {
Date.prototype.format = function (fmt) {
let o = {
'M+': this.getMonth() + 1, //月份
'd+': this.getDate(), //日
......@@ -34,49 +34,49 @@ const throttle = (fn, gapTime) => {
gapTime = 1500
}
let _lastTime = null
return function() {
return function () {
let _nowTime = +new Date()
if (_nowTime - _lastTime > gapTime || !_lastTime) {
fn.apply(this, arguments)
_lastTime = _nowTime
}
}
}
/**防止重复点击 */
}
/**防止重复点击 */
const showLoading = (title = '加载中...', callBack, custom) => {
Toast({
type: 'loading',
message: title,
forbidClick: true,
duration: 0
})
if (callBack && typeof callBack == 'function') {
if (!custom) Toast.clear()
callBack()
}
// Toast({
// type: 'loading',
// message: title,
// forbidClick: true,
// duration: 0
// })
// if (callBack && typeof callBack == 'function') {
// if (!custom) Toast.clear()
// callBack()
// }
}
const hideLoading = () => {
Toast.clear()
}
/**num:要转换的数值,fixed:精确几位小数 */
// Toast.clear()
}
/**num:要转换的数值,fixed:精确几位小数 */
const decimal = (num, fixed) => {
let pow = Math.pow(10, fixed)
return Math.round(num * pow) / pow
}
const showToast = (message = '', callBack) => {
let params = {
message,
forbidClick: true,
duration: 1500
}
Toast(params)
if (callBack && typeof callBack == 'function') {
setTimeout(() => {
callBack()
}, 1500)
}
}
/**触摸样式 */
// let params = {
// message,
// forbidClick: true,
// duration: 1500
// }
// Toast(params)
// if (callBack && typeof callBack == 'function') {
// setTimeout(() => {
// callBack()
// }, 1500)
// }
}
/**触摸样式 */
const touchstart = e => {
e.target.classList.add('btn-on-leave')
}
......@@ -106,10 +106,10 @@ const removeLocalStorage = key => {
// sessionStorage.removeItem(key)
}
const dialog = (params = {}) => {
if (!params.confirmButtonColor) params.confirmButtonColor = '#FF7336'
return Dialog.confirm(params)
}
/**拨打电话 */
// if (!params.confirmButtonColor) params.confirmButtonColor = '#FF7336'
// return Dialog.confirm(params)
}
/**拨打电话 */
const makePhoneCall = phoneNumber => {
window.location.href = `tel://${phoneNumber}`
}
......@@ -137,18 +137,18 @@ const setClipboardData = data => {
transfer.select()
if (document.execCommand('copy')) document.execCommand('copy')
transfer.blur()
Toast('内容已复制')
// Toast('内容已复制')
document.body.removeChild(transfer)
}
/**接口请求时失败让用户刷新 */
const refreshPage = (message = '系统异常') => {
return Dialog.alert({
message,
theme: 'round-button',
confirmButtonText: '点击重试',
confirmButtonColor: '#FF7336'
})
// return Dialog.alert({
// message,
// theme: 'round-button',
// confirmButtonText: '点击重试',
// confirmButtonColor: '#FF7336'
// })
}
const toTop = () => {
let bodySrcollTop = document.body.scrollTop
......
......@@ -9,19 +9,6 @@ const name = defaultSettings.title || 'vue mobile template'
// 生产环境,测试和正式
const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)
/**
* 雪碧图插件
*/
const SpritesmithPlugin = require('webpack-spritesmith')
const spritesmithFunction = data => {
let { spritesheet, sprites } = data
let shared = `.sprite-icon { background-image: url(${data.sprites[0].image});background-size: ${spritesheet.width / 2}px ${spritesheet.height / 2}px;}`
let perSprite = sprites.map(sprite => {
let { name, width, height, offset_x, offset_y } = sprite
return `.icon-${name} { width: ${width / 2}px; height: ${height / 2}px; background-position: ${offset_x / 2}px ${offset_y / 2}px;}`
}).join('\n')
return `${shared}\n${perSprite}`
}
module.exports = {
publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-lwk/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router history模式使用 微信开发环境需打开
......@@ -68,34 +55,6 @@ module.exports = {
config.name = name
config.resolve.modules = ['node_modules', './src/assets/spritesmith']
const Plugins = [
new SpritesmithPlugin({
// 引入图片文件夹
src: {
cwd: path.resolve(__dirname, './src/assets/spritesmith'),
glob: ['*.png', '*.jpg']
},
// 生成图片的路径
target: {
image: path.resolve(__dirname, './src/assets/images/sprite.png'),
// 生成SCSS
css: [
[path.resolve(__dirname, './src/assets/css/sprite.scss'), {
format: 'function_based_template'
}]
]
},
customTemplates: {
'function_based_template': spritesmithFunction,
},
//background引用路径
apiOptions: {
cssImageRef: '../images/sprite.png'
},
// 每个图片间距
spritesmithOptions: {
padding: 20
}
})
]
config.plugins = [...config.plugins, ...Plugins]
// 为生产环境修改配置...
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!