地图页面 及页面加语言编译
This commit is contained in:
+184
-120
@@ -1,80 +1,88 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<z-paging ref="paging" v-model="datalist" @query="queryList" style="background: #F3F3F3;" empty-view-text='暂无数据!'>
|
||||
<view class="contop">
|
||||
<view class="changeyy" @click="showlang = true" >
|
||||
<image src="/static/image/change.png" mode=""></image>{{$t('home.langbtn')}}
|
||||
</view>
|
||||
<view class="title">
|
||||
{{$t('home.title')}} HESU CRM
|
||||
</view>
|
||||
<view class="num">
|
||||
66 <text>{{$t('home.day')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="data-briefing">
|
||||
<view class="top">
|
||||
<text>{{$t('home.databf')}}</text>
|
||||
<view class="time" @click="show = true">
|
||||
<image src="/static/image/time.png" mode=""></image>
|
||||
<u--input v-model="time" border="none" disabled disabledColor="#ffffff" style="width: 65px;margin-left: 5px;"></u--input>
|
||||
<u-icon name="arrow-down" color="#666666" size="16"></u-icon>
|
||||
<z-paging ref="paging" v-model="datalist" @query="queryList" style="background: #F3F3F3;"
|
||||
empty-view-text='暂无数据!'>
|
||||
<template #top>
|
||||
<view class="contop">
|
||||
<view class="changeyy" @click="showlang = true">
|
||||
<image src="/static/image/change.png" mode=""></image>{{$t('home.langbtn')}}
|
||||
</view>
|
||||
<view class="title">
|
||||
{{$t('home.title')}} HESU CRM
|
||||
</view>
|
||||
<view class="num">
|
||||
66 <text>{{$t('home.day')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="data-briefing">
|
||||
<view class="top">
|
||||
<text>{{$t('home.databf')}}</text>
|
||||
<view class="time" @click="show = true">
|
||||
<image src="/static/image/time.png" mode=""></image>
|
||||
<u--input v-model="time" border="none" disabled disabledColor="#ffffff"
|
||||
style="width: 65px;margin-left: 5px;"></u--input>
|
||||
<u-icon name="arrow-down" color="#666666" size="16"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont">
|
||||
<u-grid :border="false">
|
||||
<u-grid-item>
|
||||
<text class="grid-num">{{statisticsdata.customer}}</text>
|
||||
<text class="grid-text">{{$t('home.addkh')}}</text>
|
||||
</u-grid-item>
|
||||
<u-grid-item>
|
||||
<text class="grid-num">{{statisticsdata.visit}}</text>
|
||||
<text class="grid-text">{{$t('home.addbf')}}</text>
|
||||
</u-grid-item>
|
||||
<u-grid-item>
|
||||
<text class="grid-num">{{statisticsdata.follow}}</text>
|
||||
<text class="grid-text">{{$t('home.addgj')}}</text>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont">
|
||||
<u-grid :border="false">
|
||||
<u-grid-item>
|
||||
<text class="grid-num">20</text>
|
||||
<text class="grid-text">{{$t('home.addkh')}}</text>
|
||||
</u-grid-item>
|
||||
<u-grid-item>
|
||||
<text class="grid-num">20</text>
|
||||
<text class="grid-text">{{$t('home.addbf')}}</text>
|
||||
</u-grid-item>
|
||||
<u-grid-item>
|
||||
<text class="grid-num">20</text>
|
||||
<text class="grid-text">{{$t('home.addgj')}}</text>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="userlist">
|
||||
<u-sticky offset-top="-44" >
|
||||
<view class="tabsbg">
|
||||
<u-tabs :list="list1" :scrollable="false"></u-tabs>
|
||||
<u-tabs :list="list1" :scrollable="false" @click="tabclick"></u-tabs>
|
||||
</view>
|
||||
</u-sticky>
|
||||
</template>
|
||||
<view class="userlist">
|
||||
<view class="list">
|
||||
<userlist :list="datalist" @click="godetile">
|
||||
</userlist>
|
||||
<userlist :list="datalist" @click="godetile">
|
||||
</userlist>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</z-paging>
|
||||
<u-datetime-picker :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="show" v-model="value1" @confirm="confirm" @cancel="cancel" mode="year-month"></u-datetime-picker>
|
||||
<u-picker :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="showlang" :columns="columns" @cancel="cancellang" @confirm="confirmlang" :title="$t('home.langbtn')" keyName="label"></u-picker>
|
||||
<u-datetime-picker :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="show" v-model="value1"
|
||||
@confirm="confirm" @cancel="cancel" mode="year-month"></u-datetime-picker>
|
||||
<u-picker :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="showlang" :columns="columns"
|
||||
@cancel="cancellang" @confirm="confirmlang" :title="$t('home.langbtn')" keyName="label"></u-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { request,showToast } from '@/api/apiT.js'
|
||||
import {
|
||||
request,
|
||||
showToast
|
||||
} from '@/api/apiT.js'
|
||||
import userlist from '@/components/userlist/index.vue';
|
||||
export default {
|
||||
components: {
|
||||
userlist
|
||||
userlist
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statisticsdata:{},
|
||||
headerBgColor: 'transparent', // 初始背景色为透明
|
||||
home: this.$t('tabbar.home'),
|
||||
value0: 0,
|
||||
show: false,
|
||||
showlang: false,
|
||||
value1: Number(new Date()),
|
||||
timevalue:this.result(Number(new Date())),
|
||||
time:this.result(Number(new Date())),
|
||||
datalist:[],
|
||||
columns:[
|
||||
timevalue: this.result(Number(new Date())),
|
||||
time: this.result(Number(new Date())),
|
||||
datalist: [],
|
||||
follow:'',
|
||||
columns: [
|
||||
[{
|
||||
label: '中文',
|
||||
id: 'zh'
|
||||
@@ -86,50 +94,77 @@
|
||||
id: 'ru'
|
||||
}]
|
||||
],
|
||||
list1: [
|
||||
{
|
||||
name: this.$t('all'),
|
||||
}, {
|
||||
name: this.$t('followup'),
|
||||
}, {
|
||||
name: this.$t('deal')
|
||||
}, {
|
||||
name: this.$t('lost')
|
||||
}
|
||||
]
|
||||
list1: [{
|
||||
name: this.$t('all'),
|
||||
id:'all'
|
||||
}, {
|
||||
name: this.$t('followup'),
|
||||
id:'followup'
|
||||
}, {
|
||||
name: this.$t('deal'),
|
||||
id:'deal'
|
||||
}, {
|
||||
name: this.$t('lost'),
|
||||
id:'lost'
|
||||
}]
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
uni.removeStorageSync('location')
|
||||
// this.getcustomerlist()
|
||||
uni.setTabBarItem({
|
||||
index: 0,
|
||||
text: this.$t('tabbar.home')
|
||||
})
|
||||
uni.setTabBarItem({
|
||||
index: 1,
|
||||
text: this.$t('tabbar.customer')
|
||||
})
|
||||
uni.setTabBarItem({
|
||||
index: 2,
|
||||
text: this.$t('tabbar.mine')
|
||||
})
|
||||
this.getstatistics()
|
||||
},
|
||||
methods: {
|
||||
// 处理滚动事件
|
||||
onPageScroll(event) {
|
||||
const scrollTop = event.scrollTop || 0;
|
||||
if (scrollTop > 310) { // 吸顶条件
|
||||
this.headerBgColor = '#E6EDFF'; // 吸顶时设置背景色
|
||||
} else {
|
||||
this.headerBgColor = 'transparent'; // 取消吸顶时恢复背景色
|
||||
}
|
||||
const scrollTop = event.scrollTop || 0;
|
||||
if (scrollTop > 310) { // 吸顶条件
|
||||
this.headerBgColor = '#E6EDFF'; // 吸顶时设置背景色
|
||||
} else {
|
||||
this.headerBgColor = 'transparent'; // 取消吸顶时恢复背景色
|
||||
}
|
||||
},
|
||||
//统计数据
|
||||
getstatistics(){
|
||||
request({
|
||||
url:'customer/statistics',
|
||||
method:'get',
|
||||
data:{
|
||||
created:this.timevalue
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res.data.data)
|
||||
this.statisticsdata = res.data.data
|
||||
})
|
||||
},
|
||||
cancellang() {
|
||||
this.showlang = false
|
||||
this.showlang = false
|
||||
},
|
||||
//语言切换事件
|
||||
confirmlang(e) {
|
||||
this.$i18n.locale = e.value[0].id
|
||||
this.showlang = false
|
||||
this.list1 = [
|
||||
{
|
||||
name: this.$t('all'),
|
||||
}, {
|
||||
name: this.$t('followup'),
|
||||
}, {
|
||||
name: this.$t('deal')
|
||||
}, {
|
||||
name: this.$t('lost')
|
||||
}
|
||||
];
|
||||
this.list1 = [{
|
||||
name: this.$t('all'),
|
||||
}, {
|
||||
name: this.$t('followup'),
|
||||
}, {
|
||||
name: this.$t('deal')
|
||||
}, {
|
||||
name: this.$t('lost')
|
||||
}];
|
||||
uni.setTabBarItem({
|
||||
index: 0,
|
||||
text: this.$t('tabbar.home')
|
||||
@@ -143,6 +178,16 @@
|
||||
text: this.$t('tabbar.mine')
|
||||
})
|
||||
},
|
||||
//tab标签切换
|
||||
tabclick(e){
|
||||
console.log(e)
|
||||
if(e.id=='all'){
|
||||
this.follow=''
|
||||
}else{
|
||||
this.follow=e.index - 1
|
||||
}
|
||||
this.queryList(1, 10)
|
||||
},
|
||||
//日期选择组件
|
||||
confirm(e) {
|
||||
this.show = false
|
||||
@@ -152,40 +197,43 @@
|
||||
},
|
||||
confirm(e) {
|
||||
this.show = false
|
||||
const timeFormat = uni.$u.timeFormat
|
||||
this.timevalue = timeFormat(e.value, 'yyyy-mm')
|
||||
this.result(e.value, e.mode)
|
||||
this.getstatistics()
|
||||
},
|
||||
result(time, mode) {
|
||||
const timeFormat = uni.$u.timeFormat
|
||||
this.timevalue=timeFormat(time, 'yyyy-mm')
|
||||
this.time=timeFormat(time, 'yyyy-mm')
|
||||
this.time = timeFormat(time, 'yyyy-mm')
|
||||
return timeFormat(time, 'yyyy-mm')
|
||||
},
|
||||
//客户列表数据
|
||||
queryList(pageNo, pageSize) {
|
||||
var that = this;
|
||||
request({
|
||||
url:'customer/list',
|
||||
method:'get',
|
||||
url: 'customer/list',
|
||||
method: 'get',
|
||||
data: {
|
||||
page:pageNo,
|
||||
per_page:10
|
||||
page: pageNo,
|
||||
per_page: 10,
|
||||
follow:this.follow
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res.data)
|
||||
if(res.data.code ==0){
|
||||
if (res.data.code == 0) {
|
||||
var datas = res.data.data.list;
|
||||
this.$refs.paging.complete(datas);
|
||||
}else{
|
||||
} else {
|
||||
// this.$refs.paging.complete(null);
|
||||
// that.listlength=0
|
||||
}
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
})
|
||||
},
|
||||
godetile(item){
|
||||
godetile(item) {
|
||||
console.log(item)
|
||||
uni.navigateTo({
|
||||
url: '/pages/customer/detile'
|
||||
url: '/pages/customer/detile?id='+item.id
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -193,101 +241,117 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.u-pageicon{
|
||||
.u-pageicon {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
.tabsbg{
|
||||
|
||||
.tabsbg {
|
||||
border-radius: 16px 16px 0px 0px;
|
||||
background:linear-gradient(to bottom, #E6EDFF, #eaeffa);
|
||||
background: #E6EDFF
|
||||
}
|
||||
.changeyy{
|
||||
|
||||
.changeyy {
|
||||
padding: 10px 15px;
|
||||
border-radius: 50px;
|
||||
background-color: rgba(255, 255,255, 0.2);
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
margin-bottom: 50rpx;
|
||||
display: inline-block;
|
||||
image{
|
||||
|
||||
image {
|
||||
width: 14px;
|
||||
height: 12px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
.content{
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
font-size: 28rpx;
|
||||
position: relative;
|
||||
background: #F6F6F6;
|
||||
|
||||
.contop{
|
||||
|
||||
.contop {
|
||||
background-image: url("/static/image/topbg.png");
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
padding: 88rpx 30rpx 240rpx;
|
||||
color: #FFFFFF;
|
||||
|
||||
.title{
|
||||
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
margin-bottom: 20px;
|
||||
width: 58%;
|
||||
}
|
||||
.num{
|
||||
|
||||
.num {
|
||||
font-size: 60rpx;
|
||||
font-weight: bold;
|
||||
font-family: PingFang SC-Regular;
|
||||
text{
|
||||
|
||||
text {
|
||||
font-size: 36rpx;
|
||||
font-weight: 300;
|
||||
margin-left: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.data-briefing{
|
||||
|
||||
.data-briefing {
|
||||
background-color: #FFFFFF;
|
||||
margin: 15px;
|
||||
padding: 15px;
|
||||
border-radius: 10px;
|
||||
margin-top: -21%;
|
||||
.top{
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
text{
|
||||
|
||||
text {
|
||||
font-size: 32rpx;
|
||||
color: #222222;
|
||||
font-weight: bold;
|
||||
}
|
||||
.time{
|
||||
|
||||
.time {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #666666;
|
||||
image{
|
||||
|
||||
image {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
.cont{
|
||||
|
||||
.cont {
|
||||
margin-top: 20px;
|
||||
.grid-num{
|
||||
|
||||
.grid-num {
|
||||
font-size: 36rpx;
|
||||
color: #000000;
|
||||
font-weight: bold;
|
||||
}
|
||||
.grid-text{
|
||||
|
||||
.grid-text {
|
||||
color: #222222;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
.userlist{
|
||||
background-image: url(/static/image/cbg.png);
|
||||
|
||||
.userlist {
|
||||
background: linear-gradient(to bottom, #E6EDFF, #ffffff);
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
.list{
|
||||
|
||||
.list {
|
||||
padding: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user