Commit 6503a60d authored by xishifeng's avatar xishifeng

设置

parent 789b85ad
...@@ -4,7 +4,17 @@ ...@@ -4,7 +4,17 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>同联商业</title> <title>同联商业</title>
<script type=text/javascript>!function(n,e){var t=n.documentElement,i="orientationchange" in window?"orientationchange":"resize",d=function(){var n=t.clientWidth;n&&(t.style.fontSize=n/750*100+"px")};n.addEventListener&&(e.addEventListener(i,d,!1),n.addEventListener("DOMContentLoaded",d,!1))}(document,window);</script> <!--<script type=text/javascript>
! function(n, e) {
var t = n.documentElement,
i = "orientationchange" in window ? "orientationchange" : "resize",
d = function() {
var n = t.clientWidth;
n && (t.style.fontSize = n / 750 * 100 + "px")
};
n.addEventListener && (e.addEventListener(i, d, !1), n.addEventListener("DOMContentLoaded", d, !1))
}(document, window);
</script>-->
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
......
@charset "utf-8"; @charset "utf-8";
html {
font-size: calc(100vw/7.5 + 0px);
font-family: 'PingFangSC-Regular';
}
body { body {
font-size: .3rem; font-size: .3rem;
background-color: #f0f0f0; background-color: #F8F9FB;
} }
.oh { .oh {
...@@ -16,6 +21,13 @@ body { ...@@ -16,6 +21,13 @@ body {
float: right!important; float: right!important;
} }
.por {
position: relative;
}
.poa {
position: absolute;
}
.tc { .tc {
text-align: center!important; text-align: center!important;
...@@ -43,3 +55,63 @@ body { ...@@ -43,3 +55,63 @@ body {
.flex{ .flex{
display: flex; display: flex;
} }
.flex-center{
display: flex;
align-items: center;
text-align: center;
justify-content: center;
}
.bsb{
box-sizing: border-box;
}
/*禁止点击元素*/
.no-click{
pointer-events: none;
/*微信浏览器里的图片自带点击放大效果,需要禁止掉。但这样也会禁止掉微信里的长按识别图中二维码功能*/
}
/*可点击的区域兼容*/
.pointer-click-item {
/*点击元素的样式*/
cursor: pointer;
-webkit-tap-highlight-color: transparent;
/***加上cursor:pointer时touch的时候会出现蓝色区域,加上这条可以避免蓝色区域出现***/
}
/*加载中动画*/
.loading-gif-block{
width: 100%;
position: fixed;
top: 7rem;
background: url(../images/loading.gif) no-repeat center 0rem/1.2rem 1.2rem;
/*background: url(../images/loading.gif) no-repeat center 0rem/1.1rem .68rem;*/
/*padding-top: 1.2rem;*/
padding-top: .68rem;
font-size: .2rem;
text-align: center;
color: rgb(51, 51, 51);
}
/*暂无数据*/
.no-data-block{
/*background: white url(../images/nodata.png) no-repeat center 0.3rem/2.31rem 1.75rem;*/
background: white url(../images/nodata.png) no-repeat center 3.12rem/4rem 4rem;
/*padding-top: 2.35rem;*/
padding-top: 7.12rem;
font-size: .28rem;
line-height: .5rem;
text-align: center;
color: #999;
}
/*没有更多了*/
.no-more-block{
text-align: center;
font-size: .24rem;
color: #666;
line-height: .5rem;
padding-bottom: .5rem;
}
...@@ -8,24 +8,35 @@ import '@/assets/js/layer041002.js'; ...@@ -8,24 +8,35 @@ import '@/assets/js/layer041002.js';
export default { export default {
ServerHost, ServerHost,
isAndroid() { isAndroid() {
//判断是不是安卓设备
let u = navigator.userAgent; let u = navigator.userAgent;
return(~u.indexOf('Android') || ~u.indexOf('Linux')) ? true : false; return(~u.indexOf('Android') || ~u.indexOf('Linux')) ? true : false;
}, },
isIos() { isIos() {
//判断是不是ios设备
return ~navigator.userAgent.indexOf('iPhone') ? true : false; return ~navigator.userAgent.indexOf('iPhone') ? true : false;
}, },
isWeixinBrowser() {
//判断是不是微信浏览器
return ~navigator.userAgent.indexOf('MicroMessenger') ? true : false;
},
isMobile(text) { isMobile(text) {
//验证手机号码格式是否正确
return /^1\d{10}$/.test(text) ? true : false; return /^1\d{10}$/.test(text) ? true : false;
}, },
backNowDate() { backNowDate(s) {
let a = new Date(); //返回当前日期,以2018-05-11的格式, a.toLocaleDateString();返回的是2018/5/11这样的格式
let f = v => (v < 10 ? ('0' + v) : ('' + v)); let g = arguments.length === 0 ? '-' : s,
return a.getFullYear() + '-' + f(a.getMonth() + 1) + '-' + f(a.getDate()); a = new Date(),
f = v => (v < 10 ? ('0' + v) : ('' + v));
return a.getFullYear() + g + f(a.getMonth() + 1) + g + f(a.getDate());
}, },
urlDeal(urlStr, httpStr) { urlDeal(urlStr, httpStr) {
//处理
return urlStr.replace(/(http|https):\/\//g, (httpStr ? (httpStr + ':') : location.protocol) + '//'); return urlStr.replace(/(http|https):\/\//g, (httpStr ? (httpStr + ':') : location.protocol) + '//');
}, },
hideTel(str) { hideTel(str) {
//隐藏手机号码中间四位,展示为*号
if(str) { if(str) {
let _arr = String(str).split(''); let _arr = String(str).split('');
_arr.splice(3, 4, '****'); _arr.splice(3, 4, '****');
...@@ -34,32 +45,42 @@ export default { ...@@ -34,32 +45,42 @@ export default {
return str; return str;
} }
}, },
transCn(num) {
    let e = String(num).split(''),
a = [];
e.forEach((v,i)=>{
a[i] = ['零','一','二','三','四','五','六','七','八','九'][e[i]];
});
    return a.join('');
},
jineComma(s, n) { jineComma(s, n) {
if(s){ //金额以32, 348, 000的形式显示
if(n === 0){ if(s) {
if(n === 0) {
let a = String(parseInt(s)), let a = String(parseInt(s)),
l = a.split('.')[0].split('').reverse(), l = a.split('.')[0].split('').reverse(),
t = ''; t = '';
for (let i = 0; i < l.length; i++) { for(let i = 0; i < l.length; i++) {
t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? ',' : ''); t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? ',' : '');
}; };
return t.split('').reverse().join('').replace(/\,/g, ', '); return t.split('').reverse().join('').replace(/\,/g, ', ');
}else{ } else {
let n = n > 0 && n <= 20 ? n : 2, let n = n > 0 && n <= 20 ? n : 2,
a = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(n) + '', a = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(n) + '',
l = a.split('.')[0].split('').reverse(), l = a.split('.')[0].split('').reverse(),
r = a.split('.')[1], r = a.split('.')[1],
t = ''; t = '';
for (let i = 0; i < l.length; i++) { for(let i = 0; i < l.length; i++) {
t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? ',' : ''); t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? ',' : '');
}; };
return (t.split('').reverse().join('') + '.' + r).replace(/\,/g, ', '); return(t.split('').reverse().join('') + '.' + r).replace(/\,/g, ', ');
}; };
}else{ } else {
return s; return s;
} }
}, },
dealJineNum(num) { dealJineNum(num) {
//处理金额类的数字
if(isFinite(num)) { if(isFinite(num)) {
if(parseInt(num) == num || num.toString().split('.')[1].length < 4) { if(parseInt(num) == num || num.toString().split('.')[1].length < 4) {
return num; return num;
...@@ -70,6 +91,33 @@ export default { ...@@ -70,6 +91,33 @@ export default {
return 0; return 0;
}; };
}, },
duringRequest(){
//请求发送状态判断
let arr = [...arguments];//arguments本身不是数组,是一个特殊的对象,后面的调用会使arguments发生变化,所以需要缓存起来
axios.interceptors.request.use((config) => {
arr.forEach((a, i) => {
if(~config.url.indexOf(a.urlStr)){
a.startAction();//执行请求开始的操作
};
});
return config;
}, (error) => {
return Promise.reject(error);
});
//请求返回状态判断
axios.interceptors.response.use((res) => {
arr.forEach((a, i) => {
if(~res.config.url.indexOf(a.urlStr)){
a.endAction();//执行请求结束的操作
};
});
return res;
}, (error) => {
return Promise.reject(error);
});
},
h5PageC(token, fn){ h5PageC(token, fn){
let _this = this; let _this = this;
axios({ axios({
......
<template>
<div>
</div>
</template>
<script>
import '@/assets/js/layer041002.js';
export default {
name: '',
props: {
data: {
type: Object,
default: () => ({
message: 'hello'
})
},
dataindex: {
type: [Number, String],
default: 0
}
},
components: {
},
data: () => ({
}),
created() {
let _this = this;
},
mounted() {
let _this = this;
},
methods: {
},
computed: {
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
...@@ -21,12 +21,19 @@ ...@@ -21,12 +21,19 @@
<footer class="oh achieve-footer"> <footer class="oh achieve-footer">
<p class="time-title tc">统计时间:{{statisticsStartTime+'-'+statisticsEndTime}}</p> <p class="time-title tc">统计时间:{{statisticsStartTime+'-'+statisticsEndTime}}</p>
<div class="btn-area" v-show="index<2"> <div class="btn-area" v-show="index<2">
<div class="oh"> <!--<div class="oh">
<a class="fl" :href="linkAchieveYwy">个人业绩</a> <a class="fl" :href="linkAchieveYwy">个人业绩</a>
</div> </div>
<div class="oh" v-if="userLevel!=10"> <div class="oh" v-if="userLevel!=10">
<a v-if="userLevel==20" :href="linkAchieveQy">门店业绩</a> <a v-if="userLevel==20" :href="linkAchieveQy">门店业绩</a>
<a v-else :href="linkAchieveQy">区域业绩</a> <a v-else :href="linkAchieveQy">区域业绩</a>
</div>-->
<div class="oh">
<a class="fl" href="javascript:;" @click="goPageAgent">个人业绩</a>
</div>
<div class="oh" v-if="userLevel!=10">
<a v-if="userLevel==20" href="javascript:;" @click="goPageRegion">门店业绩</a>
<a v-else href="javascript:;" @click="goPageRegion">区域业绩</a>
</div> </div>
</div> </div>
</footer> </footer>
...@@ -103,8 +110,6 @@ ...@@ -103,8 +110,6 @@
_this.token = localStorage.getItem('token'); _this.token = localStorage.getItem('token');
_this.userid = localStorage.getItem('userid'); _this.userid = localStorage.getItem('userid');
_this.userLevel = localStorage.getItem('userlevel'); _this.userLevel = localStorage.getItem('userlevel');
_this.linkAchieveYwy = '/app_broker/achieve_ywy?ywyId=' + _this.userid;
_this.linkAchieveQy = '/app_broker/achieve_region?ywyId=' + _this.userid;
_this.ajaxUl(); _this.ajaxUl();
}, },
tabMain(index) { tabMain(index) {
...@@ -129,21 +134,27 @@ ...@@ -129,21 +134,27 @@
}) })
.then(function(response) { .then(function(response) {
if(response.data.code == 200) { if(response.data.code == 200) {
_this.mainData[_index].isLoad = true; if(response.data.data){
_this.statisticsStartTime = response.data.data.start_time.replace(/-/g, '.'); if(Array.isArray(response.data.data)){
_this.statisticsEndTime = response.data.data.end_time.replace(/-/g, '.');
_this.mainData[_index].listData = response.data.data.list.slice(0, _this.mainData[_index].topLineNum); }else{
if(_index < 2){ _this.mainData[_index].isLoad = true;
//部门业绩(即区域业绩)时不需要这个 _this.statisticsStartTime = response.data.data.start_time.replace(/-/g, '.');
_this.mainData[_index].selfData = response.data.data.list.filter(function(item, index, array) { _this.statisticsEndTime = response.data.data.end_time.replace(/-/g, '.');
if(_index === 0){ _this.mainData[_index].listData = response.data.data.list.slice(0, _this.mainData[_index].topLineNum);
//人员排行 if(_index < 2){
return(item.agent_id === item.is_my); //部门业绩(即区域业绩)时不需要这个
}else if(_index === 1){ _this.mainData[_index].selfData = response.data.data.list.filter(function(item, index, array) {
//门店排行 if(_index === 0){
return(item.store_id === item.is_my); //人员排行
}else{}; return(item.agent_id === item.is_my);
})[0]; }else if(_index === 1){
//门店排行
return(item.store_id === item.is_my);
}else{};
})[0];
};
};
}; };
} else { } else {
layer.tipsX(response.data.msg); layer.tipsX(response.data.msg);
...@@ -152,6 +163,24 @@ ...@@ -152,6 +163,24 @@
.catch(function(error) { .catch(function(error) {
layer.tipsX(error); layer.tipsX(error);
}); });
},
goPageAgent() {
let _this = this;
_this.$router.push({
path: '/achieveAgent',
query: {
'ywyId': _this.userid
}
});
},
goPageRegion() {
let _this = this;
_this.$router.push({
path: '/achieveRegion',
query: {
'ywyId': _this.userid
}
});
} }
} }
} }
......
<template>
<div>
</div>
</template>
<script>
import '@/assets/js/layer041002.js';
export default {
name: '',
props: {
data: {
type: Object,
default: () => ({
message: 'hello'
})
},
dataindex: {
type: [Number, String],
default: 0
}
},
components: {
},
data: () => ({
}),
created() {
let _this = this;
},
mounted() {
let _this = this;
},
methods: {
},
computed: {
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</template> </template>
<script> <script>
let _token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImlkIjozLCJuYW1lIjoiXHU0ZThlXHU3NmZjXHU3NmZjIiwicGhvbmUiOiIxMzkxODkzNzc0MSIsImxldmVsIjoyMH0sInRpbWVTdGFtcF8iOjE1MjUzOTk0Nzl9.q3Eviv399NeN8PUEeLlPVCV4bxOtkqjDhVoejmBfHNc'; let _token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImlkIjo1NzQyLCJuYW1lIjoiXHU0ZThlXHU3NmZjXHU3NmZjIiwicGhvbmUiOiIxMzkxODkzNzc0MSIsImxldmVsIjoyMH0sInRpbWVTdGFtcF8iOjE1Mjg5NDIzNTh9.-HlJUkvPCCrfhacC9WKcWEiNzUHhL0PujDGONcwPtA0';
export default { export default {
name: '', name: '',
data() { data() {
......
<template> <template>
<img v-if="imgtype" :src="datasrc" :onerror="onErrorImg" /> <div v-if="imgtype==='div'" class="img-error-div">占位图</div>
<div v-else class="img-error-div">占位图</div> <img v-else :src="src" :onerror="onErrorImg" />
</template> </template>
<script> <script>
import onErrorImg from '@/assets/images/ic_default_headpic.png'; import onErrorImgAvatar from '@/assets/images/ic_default_headpic.png';
import onErrorImgHouse from '@/assets/images/ic_default_headpic.png';
export default { export default {
props: { props: {
datasrc: { datasrc: {
...@@ -17,18 +18,26 @@ ...@@ -17,18 +18,26 @@
} }
}, },
data() { data() {
let _obj = {}; let _this = this;
if(this.imgtype === 'avatar'){ let _bitmap = onErrorImgAvatar;
_obj['onErrorImg'] = 'this.src="' + onErrorImg + '"'; if(_this.imgtype === 'house'){
}else{ _bitmap = onErrorImgHouse;
_obj['onErrorImg'] = 'this.src="' + onErrorImg + '"';
}; };
return _obj; return {
'bitmap': _bitmap,
'src': _this.datasrc?_this.datasrc:_bitmap,
'onErrorImg': 'this.src="' + _bitmap + '"'
};
},
watch: {
datasrc(newValue, oldVal) {
this.src = newValue?newValue:this.bitmap;//当父组件传入的datasrc更新时,把src改为新值
}
} }
} }
</script> </script>
<style scoped> <style>
.img-error-div{ .img-error-div{
font-size: 0; font-size: 0;
background-color: #e0e0e0; background-color: #e0e0e0;
......
<template>
<div class="loadmore" ref="loadmore">
<div class="loadmore__body">
<slot></slot>
</div>
<div class="loadmore__footer">
<!--<span v-if="stop"><i class="tc-loading"></i><span>正在加载...</span></span>-->
<!--<span v-else-if="loading">正在加载...</span>-->
<!--<span v-else>没有更多了</span>-->
</div>
</div>
</template>
<script>
export default {
props: {
/**
* 是否加载
*/
canload: {
type: Boolean,
default: true,
},
/**
* 滚动外部容器, 选择器字符串
*/
container: {
default: () => (global),
},
/**
* 距离底部多远加载
*/
distance: {
type: Number,
default: 100,
},
},
data() {
return {
dom: null, // 外部容器dom
}
},
mounted() {
if(this.container !== global) {
this.dom = document.querySelector(this.container)
} else {
this.dom = this.container
}
if(!this.dom) {
return
}
this.dom.addEventListener('scroll', this.scroll, false)
},
methods: {
/**
* 滚动钩子
*/
scroll() {
if(!this.canload) {
return
}
const viewHeight = global.innerHeight
let parentNode
if(this.container !== global) {
parentNode = this.$el
} else {
parentNode = this.$el.parentNode
}
if(parentNode) {
const rect = parentNode.getBoundingClientRect()
if((rect.bottom <= viewHeight + this.distance)) {
//DOM 更新循环结束之后执行
this.$nextTick(() => {
this.load()
})
}
}
},
/**
* 加载一组数据的方法
*/
load() {
this.$emit('load')
},
},
beforeDestroy() {
if(this.dom) {
this.dom.removeEventListener('scroll', this.scroll, false)
}
},
}
</script>
<style>
</style>
\ No newline at end of file
...@@ -12,7 +12,9 @@ import axios from 'axios' ...@@ -12,7 +12,9 @@ import axios from 'axios'
import qs from 'qs' import qs from 'qs'
import VueAxios from 'vue-axios' import VueAxios from 'vue-axios'
//import VueAwesomeSwiper from 'vue-awesome-swiper'; //import VueAwesomeSwiper from 'vue-awesome-swiper';
//Vue.use(VueAwesomeSwiper);
import common from '@/assets/js/public.js'; import common from '@/assets/js/public.js';
Vue.prototype.common = common;
axios.defaults.timeout = 20000;//设置请求最大时长,超时将取消 axios.defaults.timeout = 20000;//设置请求最大时长,超时将取消
axios.defaults.baseURL = common.ServerHost; axios.defaults.baseURL = common.ServerHost;
...@@ -46,8 +48,6 @@ axios.interceptors.response.use((res) => { ...@@ -46,8 +48,6 @@ axios.interceptors.response.use((res) => {
//vue-axios是为了注册axios更加规范而引入的 //vue-axios是为了注册axios更加规范而引入的
//下面的use顺序不能写反 //下面的use顺序不能写反
Vue.use(VueAxios, axios); Vue.use(VueAxios, axios);
//Vue.use(VueAwesomeSwiper);
Vue.prototype.common = common;
//把common注册到Vue全局 //把common注册到Vue全局
Vue.config.productionTip = true; Vue.config.productionTip = true;
......
...@@ -2,6 +2,8 @@ import Vue from 'vue' ...@@ -2,6 +2,8 @@ import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import entrance from '@/components/publicEg/entrance' import entrance from '@/components/publicEg/entrance'
import achieveFork from '@/components/achieveMain/achieveFork' import achieveFork from '@/components/achieveMain/achieveFork'
import achieveAgent from '@/components/achieveMain/achieveAgent'
import achieveRegion from '@/components/achieveMain/achieveRegion'
import feeds from '@/components/feed/feeds' import feeds from '@/components/feed/feeds'
import reportDetails from '@/components/reportDetails/reportDetails' import reportDetails from '@/components/reportDetails/reportDetails'
import announcementDetails from '@/components/announcementDetails/announcementDetails' import announcementDetails from '@/components/announcementDetails/announcementDetails'
...@@ -24,6 +26,16 @@ export default new Router({ ...@@ -24,6 +26,16 @@ export default new Router({
name: 'v-achieve-fork', name: 'v-achieve-fork',
component: achieveFork component: achieveFork
}, },
{
path: '/achieveAgent',
name: 'v-achieve-agent',
component: achieveAgent
},
{
path: '/achieveRegion',
name: 'v-achieve-region',
component: achieveRegion
},
{ {
path: '/feeds', path: '/feeds',
name: 'v-feeds', name: 'v-feeds',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment