Commit 51f2c5a2 by 夏新然

Merge branch 'master' of http://192.168.9.26/xiaxr/appweb

2 parents 1bb65239 bd6b24cd
/node_modules
/unpackage
\ No newline at end of file
function getLocalStorage(keys) {
let value = '';
uni.getStorage({
key: keys,
success: (res) => {
value = res.data;
}
})
return value;
}
const atoken = getLocalStorage('atoken');
const mallList = [];
export default {
getMallList(cb) {}
getMallList() {
return new Promise((resolve, reject) => {
uni.request({
url: window.url + '/malls',
method: 'GET',
data: {
type: 'weatherType',
_t: Date.parse(new Date()) / 1000
},
header: {
'Authorization': atoken
},
success: (res) => {
resolve(res);
},
fail: (err) => {
reject(err);
}
})
})
},
getGateList() {
return new Promise((resolve, reject) => {
uni.request({
url: window.url + '/gates',
method: 'GET',
data: {
//
_t: Date.parse(new Date()) / 1000
},
header: {
'Authorization': atoken
},
success: (res) => {
resolve(res);
},
fail: (err) => {
reject(err);
}
})
})
}
}
\ No newline at end of file
const baseUrl = 'https://store.keliuyun.com/report'; // window.url;
export default {
LOAD_ACCOUNT_LIST: `${baseUrl}/accounts`,
LOAD_MALL_LIST: `${baseUrl}/malls`,
LOAD_FLOOR_LIST: `${baseUrl}/floors`,
LOAD_ZONE_LIST: `${baseUrl}/zones`,
LOAD_GATE_LIST: `${baseUrl}/gates`,
LOAD_DICT_LIST: `${baseUrl}/dataDics`,
LOAD_FACERECOGNITION_LIST: `${baseUrl}/faceRecognitions`,
}
\ No newline at end of file
import configApi from './configApi'
// 第一种写法
export function fetch(method = 'GET', url, params = null, headers = {}) {
method = method.toLocaleUpperCase();
return new Promise((resolve, reject) => {
uni.request({
url: url,
method: method,
data: params,
header: headers,
success: (res) => {
resolve(res)
},
fail: (err) => {
reject(err);
}
})
})
}
// 第二种写法
const http = (options) => {
const { method = 'get', data, url, headers = {} } = options;
method = method.toLocaleUpperCase();
return new Promise((resolve, reject) => {
uni.request({
url: url,
method: method,
data: data,
header: headers,
success: (res) => {
resolve(res)
},
fail: (err) => {
reject(err);
}
})
})
}
export default {
// 集团列表
loadAccountList(data, headers) {
return http({
url: configApi.LOAD_ACCOUNT_LIST,
method: 'get',
data: data,
headers: headers
})
},
// 商场列表
loadMallList(data, headers) {
return http({
url: configApi.LOAD_MALL_LIST,
method: 'get',
data: data,
headers: headers
})
},
// 楼层列表
loadFloorList(data, headers) {
return http({
url: configApi.LOAD_FLOOR_LIST,
method: 'get',
data: data,
headers: headers
})
},
// 店铺列表
loadZoneList(data, headers) {
return http({
url: configApi.LOAD_ZONE_LIST,
method: 'get',
data: data,
headers: headers
})
},
// 监控点列表
loadGateList(data, headers) {
return http({
url: configApi.LOAD_GATE_LIST,
method: 'get',
data: data,
headers: headers
})
},
// 字典列表
loadDictList(data, headers) {
return http({
url: configApi.LOAD_DICT_LIST,
method: 'get',
data: data,
headers: headers
})
},
// 抓拍记录列表
loadFacerecognitionList(data, headers) {
return http({
url: configApi.LOAD_FACERECOGNITION_LIST,
method: 'get',
data: data,
headers: headers
})
}
}
import Vue from 'vue'
/* 获取本地存储 */
Vue.prototype.getStorage = (key) => {
let storageVal = '';
uni.getStorage({
key: key,
success: (res) => {
storageVal = res.data;
}
})
return storageVal
}
......@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,viewport-fit=cover">
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
......
......@@ -16,6 +16,13 @@ import {VTable,VPagination} from 'vue-easytable'
//引入弹窗组件
import MobileMessage from 'mobile-message'
import 'mobile-message/dist/message.css'
// webview function
// import { webviewPub } from './common/webviewpub.js'
// vue prototype
import './common/vproto.js'
// 注册到全局
Vue.component(VTable.name, VTable)
Vue.component(VPagination.name, VPagination)
......@@ -26,7 +33,7 @@ Vue.config.productionTip = false
Vue.prototype.echarts=echarts;
App.mpType = 'app'
Vue.prototype.$store = store
console.log(window.url)
// Vue.prototype.$webviewPub = webviewPub;
window.getNavHeight=function(val){
uni.setStorage({
key:'statusBarH',
......@@ -50,7 +57,10 @@ const i18n = new VueI18n({
'zh-mall':mallzh
}
})
Vue.prototype._i18n=i18n;
Vue.prototype._i18n = i18n;
if(process.env.NODE_ENV === 'development') {
window.url = 'https://store.keliuyun.com/report'
}
const app = new Vue({
i18n,
store,
......
......@@ -165,7 +165,7 @@
"navigationBarTitleText": "抓拍记录"
}
},{
"path": "pages/passenger/condition",
"path": "pages/passenger/conditions/captureOption",
"style": {
"navigationBarTitleText": ""
}
......@@ -175,7 +175,7 @@
"navigationBarTitleText": "客群分时统计"
}
}, {
"path":"pages/passenger/groupTimeCondition",
"path":"pages/passenger/conditions/groupTimeOption",
"style": {
"navigationBarTitleText": ""
}
......@@ -240,11 +240,6 @@
"selectedIconPath": "static/index/flowSelect.png",
"text": "精准客流"
}, {
"pagePath": "pages/manage/index",
"iconPath": "static/index/manage.png",
"selectedIconPath": "static/index/manageSelect.png",
"text": "后台管理"
}, {
"pagePath": "pages/profile/profile",
"iconPath": "static/index/my.png",
"selectedIconPath": "static/index/mySelect.png",
......
......@@ -40,28 +40,61 @@
// console.log('multimalllist load options', options)
this.backUrl = options.backUrl;
this.analysisLevel = options.analysisLevel;
let lists = JSON.parse(JSON.stringify(this.gateList));
if(lists.length) {
this.cacheList = lists.map(item => {
// item._selected = item.id = this.checkedMallId['id'];
return item;
this.changeScope()
},
created() {
if(!this.checkedGateId) {
this.$store.dispatch('malls/getMallList', {
data: {
accountId: this.getStorage('accountId'),
_t:Date.parse(new Date()) / 1000
},
header: {
'Authorization': this.getStorage('atoken') //自定义请求头信息
},
isMultiple: true
})
}
this.cacheCheckedGateId = JSON.parse(JSON.stringify(this.checkedGateId));
},
computed: {
...mapState({
checkedMallId: state => state.malls.checkedMallId,
gateList: state => state.malls.gateList,
checkedGateId: state => state.malls.checkedGateId
checkedGateId: state => state.malls.checkedGateId,
}),
},
watch: {
checkedMallId(val) {
this.$store.dispatch('malls/getGateList', {
data: {
mallId: val.id,
status: 1,
isHasFace: 1,
_t:Date.parse(new Date()) / 1000
},
created() {
header: {
'Authorization': this.getStorage('atoken') //自定义请求头信息
},
isMultiple: true
})
},
checkedGateId(val) {
this.changeScope()
}
},
mounted() {
},
methods: {
changeScope() {
let lists = JSON.parse(JSON.stringify(this.gateList));
if(lists.length) {
this.cacheList = lists.map(item => {
// item._selected = item.id = this.checkedMallId['id'];
return item;
})
}
this.cacheCheckedGateId = JSON.parse(JSON.stringify(this.checkedGateId));
},
backClick() {
uni.navigateBack({
delta:1
......
......@@ -40,14 +40,7 @@
// console.log('multimalllist load options', options)
this.backUrl = options.backUrl;
this.analysisLevel = options.analysisLevel;
let lists = JSON.parse(JSON.stringify(this.mallList));
if(lists.length) {
this.cacheList = lists.map(item => {
// item._selected = item.id = this.checkedMallId['id'];
return item;
})
}
this.cacheCheckedMallId = JSON.parse(JSON.stringify(this.checkedMallId));
this.changeScope();
},
computed: {
...mapState({
......@@ -56,35 +49,47 @@
}),
},
watch: {
checkedMallId(val) {
this.changeScope();
}
},
created() {
if(!this.checkedMallId) { // 处理刷新获取参数失败
this.$store.dispatch('malls/getMallList', {
data: {
accountId: this.getStorage('accountId'),
_t:Date.parse(new Date()) / 1000
},
header: {
'Authorization': this.getStorage('atoken') //自定义请求头信息
},
isMultiple: true
})
}
},
mounted() {
},
methods: {
changeScope() { // 不能直接修改 vuex 的 state
let lists = JSON.parse(JSON.stringify(this.mallList));
if(lists.length) {
this.cacheList = lists.map(item => {
// item._selected = item.id = this.checkedMallId['id'];
return item;
})
}
this.cacheCheckedMallId = JSON.parse(JSON.stringify(this.checkedMallId));
},
backClick() {
uni.navigateBack({
delta:1
})
// uni.navigateTo({
// url: '../passenger/groupTimeReport/groupTime'
// })
},
searchFun(queryStr) {
let that = this;
this.isQuerying = queryStr.length > 0 ? true : false;
this.query(queryStr, function(res) {
// console.log('query res', res)
that.cacheList = res;
// .length
// ? res.map(item => {
// let isChecked = that.multiCheckedMallId.some(checkedItem => {
// return item.id === checkedItem.id;
// })
// item._selected = isChecked;
// return item;
// })
// : res;
})
},
query(queryString, cb) {
......
......@@ -50,9 +50,59 @@
}
},
onLoad(options) {
// console.log('multiGatelist load options', options)
this.backUrl = options.backUrl;
this.analysisLevel = options.analysisLevel;
this.changeScope()
},
computed: {
...mapState({
checkedMallId: state => state.malls.checkedMallId,
gateList: state => state.malls.gateList,
multiCheckedGateId: state => state.malls.multiCheckedGateId
}),
},
watch: {
checkedMallId(val) {
this.$store.dispatch('malls/getGateList', {
data: {
mallId: val.id,
status: 1,
isHasFace: 1,
_t:Date.parse(new Date()) / 1000
},
header: {
'Authorization': this.getStorage('atoken') //自定义请求头信息
},
isMultiple: true
})
},
multiCheckedGateId: {
handler: function(val) {
this.changeScope()
},
immediate: true,
deep: true
}
},
created() {
console.log('created', this.multiCheckedGateId)
if(!this.multiCheckedGateId.length) {
this.$store.dispatch('malls/getMallList', {
data: {
accountId: this.getStorage('accountId'),
_t:Date.parse(new Date()) / 1000
},
header: {
'Authorization': this.getStorage('atoken') //自定义请求头信息
},
isMultiple: true
})
}
},
mounted() {
},
methods: {
changeScope() {
let lists = JSON.parse(JSON.stringify(this.gateList));
if(lists.length) {
let count = 0;
......@@ -67,21 +117,7 @@
})
}
this.checkedGateIds = JSON.parse(JSON.stringify(this.multiCheckedGateId));
// console.log('onload:', this.multiCheckedMallId, this.checkedMallIds, this.mallList, this.cacheList)
},
computed: {
...mapState({
gateList: state => state.malls.gateList,
multiCheckedGateId: state => state.malls.multiCheckedGateId
}),
},
watch: {
},
created() {
},
mounted() {
},
methods: {
backClick() {
uni.navigateBack({
delta:1
......@@ -91,7 +127,7 @@
// })
},
confirmFun() {
if(this.checkedMallIds.length == 0){
if(this.checkedGateIds.length == 0){
uni.showToast({
icon:'none',
title:'请至少选择一项'
......
......@@ -53,36 +53,53 @@
// console.log('multimalllist load options', options)
this.backUrl = options.backUrl;
this.analysisLevel = options.analysisLevel;
let lists = JSON.parse(JSON.stringify(this.mallList));
if(lists.length) {
let count = 0;
this.cacheList = lists.map(item => {
let isChecked = this.multiCheckedMallId.some(checkedItem => {
return item.id === checkedItem.id;
})
if(isChecked) count++;
item._selected = isChecked;
this.isAll = count == lists.length;
return item;
})
}
this.checkedMallIds = JSON.parse(JSON.stringify(this.multiCheckedMallId));
this.changeScope()
// console.log('onload:', this.multiCheckedMallId, this.checkedMallIds, this.mallList, this.cacheList)
},
computed: {
...mapState({
mallList: state => state.malls.list,
checkedMallId: state => state.malls.checkedMallId,
multiCheckedMallId: state => state.malls.multiCheckedMallId
}),
},
watch: {
multiCheckedMallId(val) {
this.changeScope();
}
},
created() {
if(!this.multiCheckedMallId) {
this.$store.dispatch('malls/getMallList', {
data: {
accountId: this.getStorage('accountId'),
_t:Date.parse(new Date()) / 1000
},
header: {
'Authorization': this.getStorage('atoken') //自定义请求头信息
},
isMultiple: true
})
}
},
mounted() {
},
methods: {
changeScope() {
let lists = JSON.parse(JSON.stringify(this.mallList));
if(lists.length) {
let count = 0;
this.cacheList = lists.map(item => {
let isChecked = this.multiCheckedMallId.some(checkedItem => {
return item.id === checkedItem.id;
})
if(isChecked) count++;
item._selected = isChecked;
this.isAll = count == lists.length;
return item;
})
}
this.checkedMallIds = JSON.parse(JSON.stringify(this.multiCheckedMallId));
},
backClick() {
uni.navigateBack({
delta:1
......
......@@ -26,7 +26,7 @@
analysisLevel: '',
titleStr: '类型选择',
leftSrc:'../../static/header/backArrow.png',
personType: {},
capturePersonType: {},
typeList: [{
id: 1,
name: '全部类型',
......@@ -47,13 +47,13 @@
this.backUrl = options.backUrl;
this.analysisLevel = options.analysisLevel;
uni.getStorage({
key: 'personType',
key: 'capturePersonType',
success: (res) => {
this.personType = res.data;
this.capturePersonType = res.data;
}
})
if(!this.personType) {
this.personType = {
if(!this.capturePersonType) {
this.capturePersonType = {
id: 1,
name: '全部类型',
value: ''
......@@ -67,10 +67,10 @@
})
},
itemFun(item) {
this.personType = item
this.capturePersonType = item
uni.setStorage({
key: 'personType',
data: JSON.stringify(this.personType)
key: 'capturePersonType',
data: JSON.stringify(this.capturePersonType)
})
uni.reLaunch({
url: `${this.backUrl}?type=${this.analysisLevel}`
......
<template>
<view>
<div :style="{ height: navheight + 'px',background:'#0069FF'}" ></div>
<div :style="{ height: navheight + 'px',background:'#0069FF'}" class="empty-box"></div>
<view class="indexNav">
<!-- <toast :typeArr="dateTypeArr" :toastShow.sync="isShow" @handleChange="toastClick"></toast> -->
<span class="selectReport" @tap="dateShow">日期</span>
......@@ -302,7 +302,7 @@
uni.getStorage({
key:'statusBarH',
success:(res)=>{
console.log(res)
// console.log(res)
if(res.data){
this.navheight=res.data;
this.scrollTop=res.data+ uni.upx2px(77);
......@@ -730,6 +730,9 @@ console.log('bb')
</script>
<style>
.empty-box {
padding-top: constant(safe-area-inset-top);
}
.littleTit{
font-size:27.17upx;
color:rgba(102,102,102,1);
......@@ -836,6 +839,7 @@ console.log('bb')
.minirefresh-wrap{
top: 77.89upx;
top: constant(safe-area-inset-top);
}
.searchIcon{
width: 25.36upx;
......
......@@ -52,6 +52,14 @@
}
})
},
created() {
window.webviewPub = this.login;
try{
model.webAutoLogin()
}catch(e){
//TODO handle the exception
}
},
methods: {
getDate(){
var dayData=[];
......@@ -189,7 +197,7 @@
title: '加载中'
});
uni.request({
url:window.url+'/users/login',
url: window.url + '/users/login',
data:{
loginName:this.username,
password:this.password
......@@ -200,7 +208,7 @@
var data=res.data;
if(data.code==200){
Object.keys(window.localStorage).forEach(item => {
if(item!='user'&&item!='pwd'){
if(item!='user' && item!='pwd' && item != 'statusBarH'){
uni.removeStorage({
key: item,
success: function (res) {
......@@ -221,7 +229,7 @@
this.atoken=data.data.atoken;
this.id=data.data.user.accountId
uni.request({
url:window.url+'/malls',
url: window.url + '/malls',
data:{
accountId:this.id,
status:1,
......@@ -239,7 +247,7 @@
}
})
uni.request({
url:window.url+"/accounts",
url: window.url + "/accounts",
data:{
id:this.id,
_t:Date.parse(new Date())/1000
......
......@@ -8,30 +8,37 @@
@rightClick="conditionFun"></headerComp>
<view class="prefix-elem"></view>
<view class="capture-main">
<view class="capture-item" v-for="item in captureList" :key="item.pic">
<view class="capture-item" v-for="(item, index) in captureList" :key="item.pic">
<view class="capture-image">
<span class="capture-date">{{ item.counttime }}</span>
<image class="capture-img" ref="imageRef" :src="item.pic" @error="imageError" :lazy-load="true" mode="widthFix"></image>
<!-- <span class="capture-date">{{ item.counttime }}</span> -->
<!-- <image class="capture-img" ref="imageRef" :src="item.pic" @error="imageError" :lazy-load="true" mode="widthFix"></image> -->
<image class="capture-img" :class="{lazy:!item.show}" :data-index="index" @load="imageLoad" :src="item.show ? item.pic : ''" />
<image class="capture-img placeholder" :class="{loaded:item.loaded}" :src="placeholderSrc" />
</view>
<view class="capture-info">
<span class="capture-text__left">年龄: {{ item.age }}</span>
<span class="capture-text__right">性别: {{ item.genderText }}</span>
<text>时间: {{ item.counttime }}</text>
</view>
<view class="capture-info">
<span class="capture-text__left">类型: {{ item.personType }}</span>
<span class="capture-text__right">表情: {{ item.mood }}</span>
<span class="capture-text__left">{{ item.age }}</span>
<span class="capture-text__right">{{ genderFormatter(item.gender) }}</span>
</view>
<view class="capture-info">
<span class="capture-text__left">{{ personTypeFormatter(item.personType) }}</span>
<span class="capture-text__right">{{ moodFormatter(item.mood) }}</span>
</view>
</view>
</view>
<view class="pagination-wrapper" v-show="captureList.length > 0">
<uniPagination
class="pagination-wrapper"
v-show="captureList.length > 0"
:current="pagination.current"
:total="pagination.total"
:pageSize="pagination.pageSize"
@change="paginationChangeHandle">
</uniPagination>
</view>
<!-- <view class="uni-loadmore" v-if="showLoadMore">{{ loadMoreText }}</view> -->
</view>
</template>
<script>
......@@ -59,20 +66,62 @@
pagination: {
total: 0,
current: 1,
pageSize: 50
pageSize: 40
},
canLoadGateId: false,
personType: {}
capturePersonType: {},
showLoadMore: false, // 无限加载
itemMax: 0,
loadMoreText: '加载中...',
placeholderSrc: defaultImg,
windowHeight: 0
}
},
onUnload() {
// this.itemMax = 0,
// this.loadMoreText = "加载更多",
// this.showLoadMore = false;
},
onLoad(options) {
this.windowHeight = uni.getSystemInfoSync().windowHeight;
if(options.type) {
this.canLoadGateId = true;
}
this.personType = this.getStorage('personType');
this.capturePersonType = this.getStorage('capturePersonType');
this.apiDics('mood');
this.apiDics('gender');
this.apiDics('personType');
this.getCaptureList();
},
onPageScroll() {
this.load();
},
onReachBottom() {
// if(this.itemMax >= this.pagination.total) {
// this.loadMoreText = "没有更多数据了!"
// return;
// }
// this.showLoadMore = true;
// setTimeout(() => {
// this.getCaptureList()
// }, 300)
},
created() {
if(!this.checkedMallId) { // 处理刷新获取参数失败
this.$store.dispatch('malls/getMallList', {
data: {
accountId: this.getStorage('accountId'),
_t:Date.parse(new Date()) / 1000
},
header: {
'Authorization': this.getStorage('atoken') //自定义请求头信息
},
isMultiple: true
})
}
if(!this.selectedStartTime || !this.selectedEndTime) {
this.$store.dispatch('malls/getDateData', 15);
}
},
computed: {
...mapState({
......@@ -82,25 +131,32 @@
selectedEndTime: state => state.malls.endDayTime
})
},
watch: {
checkedMallId(val) {
this.$store.dispatch('malls/getGateList', {
data: {
mallId: val.id,
status: 1,
isHasFace: 1,
_t:Date.parse(new Date()) / 1000
},
header: {
'Authorization': this.getStorage('atoken') //自定义请求头信息
},
isMultiple: true
})
this.getCaptureList();
},
},
methods: {
backFun() {
uni.reLaunch({
url:"../passenger",
})
},
getStorage(key) {
let storageVal = '';
uni.getStorage({
key: key,
success: (res) => {
console.log('storage', res)
storageVal = res.data;
}
})
return storageVal
},
getCaptureList() {
console.log('getCaptureList:', this.selectedTime, this.checkedMallId, this.checkedGateId)
if(!this.checkedMallId && !this.selectedStartTime && !this.selectedEndTime) return;
// console.log('getCaptureList:', this.checkedMallId, this.checkedGateId)
let atoken = this.getStorage('atoken');
this.captureList = [];
uni.showLoading({
......@@ -113,8 +169,12 @@
counttime_lte: `${this.selectedEndTime} 23:59:59`,
accountId: this.getStorage('accountId'),
mallId: this.checkedMallId.id,
gateId: this.canLoadGateId ? (this.checkedGateId.id || '') : '',
personType: this.personType.value || '',
gateId: this.canLoadGateId
? this.checkedGateId
? this.checkedGateId.id
: ''
: '',
personType: this.capturePersonType.value || '',
age_gt: 0,
direction: 1,
page: this.pagination.current,
......@@ -129,27 +189,29 @@
success: (res) => {
uni.hideLoading()
let result = res.data;
console.log(result);
this.itemMax += this.pagination.pageSize;
this.pagination.total = result.data.total;
this.captureList = result.data.list.map((item, index) => {
// let dateStr = item.counttime.match(/^\d{4}\-\d{2}\-\d{2}/)[0].replace('-', '');
item.show = false;
item.loaded = false;
item.pic = 'https://vion-retail.oss-cn-beijing.aliyuncs.com/picture/' + (item.facePath && item.facePic
? item.facePath + item.facePic
: item.bodyPath + item.bodyPic);
item.orderIdx = ++index;
item.faceImagePath = item.pic || this.dealDefaultImg(item.gender);
item.age = item.age && item.age >= 0 ? item.age : 'unknown';
item.genderText = typeof(item.gender) === 'number' ? this.dealGender(item.gender) : 'unknown';
// item.genderText = typeof(item.gender) === 'number' ? this.dealGender(item.gender) : 'unknown';
item.mood = typeof(item.mood) === 'number' ? item.mood : 'unknown';
item.counttime = item.counttime || 'unknown';
item.personType = item.personType == 0 ? '顾客' : '店员'
item.counttime = item.counttime ? item.counttime.split(' ')[1] : 'unknown';
// item.personType = item.personType == 0 ? '顾客' : '店员'
return item;
})
setTimeout(() => {
this.load()
}, 100)
}
})
// setTimeout(() => {
// uni.hideLoading()
// }, 1000)
},
dealGender(genderCode) {
return genderCode == 1 ? '男' : (genderCode == 0 ? '女' : 'unknown');
......@@ -162,22 +224,60 @@
return imagePath;
},
imageError(e) {
console.log(e)
console.error('image发生error事件,携带值为' + e.detail.errMsg)
// this.$refs.imageRef.src = defaultImg;
},
genderFormatter(genderCode) {
return this.getStorage('gender-' + genderCode) || 'unknown';
},
personTypeFormatter(personTypeCode) {
return this.getStorage('personType-' + personTypeCode) || 'unknown';
},
moodFormatter(moodCode) {
return this.getStorage('mood-' + moodCode) || 'unknown';
},
paginationChangeHandle(backVal) {
console.log('paginationChangeHandle', backVal)
console.log(this.pagination)
let { current } = backVal;
this.pagination.current = current;
this.getCaptureList()
},
imageLoad(e) {
this.captureList[e.target.dataset.index].loaded = true;
},
load() {
uni.createSelectorQuery().selectAll('.lazy').boundingClientRect((images) => {
images.forEach((image, index) => {
if(image.top <= this.windowHeight) {
this.captureList[image.dataset.index].show = true;
}
})
}).exec();
},
conditionFun() {
// console.log(this.mallList)
console.log('condition function:', uni)
uni.navigateTo({
url: '../condition'
url: '../conditions/captureOption'
})
},
apiDics(dicType) {
uni.request({
url: window.url + '/dataDics',
header: {
'Authorization': this.getStorage('atoken')
},
method: 'GET',
data: {
type: dicType,
_t: Date.parse(new Date()) / 1000
},
success: (res) => {
let result = res.data;
result.data.forEach(item =>{
uni.setStorage({
key: `${item.type}-${item.key}`,
data: item.value // valueEn i18n
})
})
}
})
}
},
......@@ -201,19 +301,29 @@
}
.capture-main {
/* padding: 0 18.11upx; */
margin-bottom: 101.44upx;
box-sizing: border-box;
}
.capture-item {
float: left;
width: 48%;
width: 24%;
background-color: rgba(255, 255, 255, 1);
box-shadow: 0 0 7.24upx 0 rgba(200, 200, 200, .64);
border-radius: 3.62upx;
margin: 0 5.43upx 10.86upx;
margin: 0 0 10.86upx;
box-sizing: border-box;
}
.capture-item:nth-child(4n-1) {
margin-left: 1.3333333333%;
margin-right: 1.333333333%;
}
.capture-item:nth-child(4n-2) {
margin-left: 1.333333333%;
}
.capture-image {
position: relative;
width: 100%;
height: 181.15upx;
}
.capture-date {
position: absolute;
......@@ -224,10 +334,15 @@
color: #fff;
z-index: 1;
}
.capture-image uni-image {
width: 100%;
height: 100%;
}
.capture-img {
max-width: 100%;
position: absolute;
/* max-width: 100%;
max-height: 100%;
width: 100%;
width: 100%; */
}
.capture-info {
font-size: 21.73upx;
......@@ -235,8 +350,8 @@
text-align: left;
padding-left: 7.24upx;
padding-right: 7.24upx;
margin-top: 18.11upx;
margin-bottom: 18.11upx;
margin-top: 7.24upx;
margin-bottom: 7.24upx;
box-sizing: border-box;
}
.capture-text__left {
......@@ -248,5 +363,19 @@
width: 50%;
}
.pagination-wrapper {
width: 100%;
background-color: #fff;
padding-top: 18.11upx;
padding-bottom: 18.11upx;
position: fixed;
bottom: 0;
}
.placeholder {
opacity: 1;
transition: opacity .4s linear;
}
.placeholder.loaded {
opacity: 0;
}
</style>
......@@ -7,28 +7,28 @@
<view class="handle-content">
<view class="condition-item" @tap="goStoreList">
<span class="ctitle">{{ i18n.store }}</span>
<span class="select-item">{{ selectedMall.name }}</span>
<image class="rarrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image>
<span class="select-item">{{ selectedMall ? selectedMall.name : '' }}</span>
<image class="rarrow" :src="rArrowImg" mode="widthFix"></image>
</view>
<view class="condition-item" @tap="goGateList">
<span class="ctitle">监控点</span>
<span class="select-item">{{ selectedGate.name }}</span>
<image class="rarrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image>
<span class="select-item">{{ selectedGate ? selectedGate.name : '' }}</span>
<image class="rarrow" :src="rArrowImg" mode="widthFix"></image>
</view>
<view class="condition-item" @tap="goTypeList">
<span class="ctitle">类型</span>
<span class="select-item">{{ personType.name }}</span>
<image class="rarrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image>
<span class="select-item">{{ capturePersonType.name }}</span>
<image class="rarrow" :src="rArrowImg" mode="widthFix"></image>
</view>
<view class="condition-item" @tap="startDateHandle">
<span class="ctitle">开始日期</span>
<span class="select-item">{{ dateStartText }}</span>
<image class="rarrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image>
<span class="select-item">{{ dateStartText || '' }}</span>
<image class="rarrow" :src="rArrowImg" mode="widthFix"></image>
</view>
<view class="condition-item" @tap="endDateHandle">
<span class="ctitle">结束日期</span>
<span class="select-item">{{ dateEndText }}</span>
<image class="rarrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image>
<span class="select-item">{{ dateEndText || '' }}</span>
<image class="rarrow" :src="rArrowImg" mode="widthFix"></image>
</view>
</view>
<awesome-picker
......@@ -40,6 +40,9 @@
:colorCancel="picker.colorCancel"
:anchor="currentStartDate"
@confirm="dateConfirm">
<view class="picker-title-text">
<text>开始日期</text>
</view>
</awesome-picker>
<awesome-picker
ref="pickerEnd"
......@@ -50,13 +53,16 @@
:colorCancel="picker.colorCancel"
:anchor="currentEndDate"
@confirm="endDateConfirm">
<view class="picker-title-text">
<text>结束日期</text>
</view>
</awesome-picker>
</view>
</template>
<script>
import headerComp from '../../components/header.vue'
import leftImg from '../../static/header/backArrow.png'
import headerComp from '../../../components/header.vue'
import leftImg from '../../../static/header/backArrow.png'
import { mapState, mapActions } from 'vuex'
export default {
......@@ -65,12 +71,11 @@
},
onLoad(option) {
uni.getStorage({
key: 'personType',
key: 'capturePersonType',
success: (res) => {
this.personType = JSON.parse(res.data);
this.capturePersonType = JSON.parse(res.data);
}
})
console.log('this.personType', this.personType)
uni.getStorage({
key: 'statusBarH',
success: (res) => {
......@@ -84,14 +89,11 @@
return {
leftImg: leftImg,
rightText: '保存',
rArrowImg: '../../../static/analysis/rArrow.png',
navheight: 0,
activeType: 'mall',
// mallText: '',
// gateText: '',
typeText: '',
personType: {},
// dateText: '',
// dateData: [],
capturePersonType: {},
picker: {
textTitle:'选择',
textConfirm:'确定',
......@@ -107,6 +109,23 @@
endPickerIdx: []
}
},
created() {
if(!this.selectedMall) {
this.$store.dispatch('malls/getMallList', {
data: {
accountId: this.getStorage('accountId'),
_t:Date.parse(new Date()) / 1000
},
header: {
'Authorization': this.getStorage('atoken') //自定义请求头信息
},
isMultiple: true
})
}
if(!this.selectedStartTime || !this.selectedEndTime) {
this.$store.dispatch('malls/getDateData', 15);
}
},
computed: {
i18n() {
return this.$t("index")
......@@ -128,15 +147,55 @@
currentEndDate: state => state.malls.pickerEndDayDate
})
},
watch: {
selectedMall(val) {
this.$store.dispatch('malls/getGateList', {
data: {
mallId: val.id,
status: 1,
isHasFace: 1,
_t:Date.parse(new Date()) / 1000
},
header: {
'Authorization': this.getStorage('atoken') //自定义请求头信息
},
isMultiple: true
})
}
},
methods: {
backFun() {
uni.navigateTo({
url: `./captureReport/capture?type=${this.activeType}`
url: `../captureReport/capture?type=${this.activeType}`
})
},
save() {
if(!this.selectedMall) {
uni.showToast({
icon:'none',
title:'请选择门店'
});
}
if(!this.selectedGate) {
uni.showToast({
icon:'none',
title:'请选择监控点'
});
}
if(!this.dateStartText) {
uni.showToast({
icon:'none',
title:'请选择开始日期'
});
}
if(!this.dateEndText) {
uni.showToast({
icon:'none',
title:'请选择结束日期'
});
}
uni.navigateTo({
url: `./captureReport/capture?type=${this.activeType}`
url: `../captureReport/capture?type=${this.activeType}`
})
},
itemClick() {
......@@ -144,21 +203,21 @@
},
goStoreList() {
uni.navigateTo({
url:"../conditionList/mallList?backUrl=../passenger/condition&analysisLevel=" + this.activeType,
url:"../../conditionList/mallList?backUrl=../passenger/conditions/captureOption&analysisLevel=" + this.activeType,
animationType: 'slide-in-right',
animationDuration: 200
})
},
goGateList() {
uni.navigateTo({
url:"../conditionList/gateList?backUrl=../passenger/condition&analysisLevel=" + this.activeType,
url:"../../conditionList/gateList?backUrl=../passenger/conditions/captureOption&analysisLevel=" + this.activeType,
animationType: 'slide-in-right',
animationDuration: 200
})
},
goTypeList() {
uni.navigateTo({
url:"../conditionList/typeList?backUrl=../passenger/condition&analysisLevel=" + this.activeType,
url:"../../conditionList/typeList?backUrl=../passenger/conditions/captureOption&analysisLevel=" + this.activeType,
animationType: 'slide-in-right',
animationDuration: 200
})
......@@ -167,12 +226,12 @@
this.$refs.pickerStart.show();
},
endDateHandle() {
console.log('endDateHandle', this.currentEndDate)
// console.log('endDateHandle', this.currentEndDate)
this.$refs.pickerEnd.show();
},
dateConfirm(item) {
this.startCacheTimeStr = this.formatterTimeToStr(item);
console.log(this.startCacheTimeStr, item, !this.endCacheTimeStr, !this.endPickerIdx.length, this.comparsionSize(this.startPickerIdx, this.endPickerIdx))
// console.log(this.startCacheTimeStr, item, !this.endCacheTimeStr, !this.endPickerIdx.length, this.comparsionSize(this.startPickerIdx, this.endPickerIdx))
// if(!this.endCacheTimeStr && !this.endPickerIdx.length) {
// return;
// } else {
......@@ -308,4 +367,11 @@
top: 38.04upx;
right: 23.55upx;
}
.picker-title-text {
margin: 0 auto;
line-height: 44px;
color: #fff;
font-size: 28.98upx;
text-align: center;
}
</style>
......@@ -9,7 +9,7 @@
<view class="condition-item" @tap="goStoreList">
<span class="ctitle">{{ i18n.store }}</span>
<span class="select-item">{{ multiSelectedMall.length ? multiSelectedMall[multiSelectedMall.length - 1].name : '' }}</span>
<image class="rarrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image>
<image class="rarrow" :src="rArrowImg" mode="widthFix"></image>
</view>
<!-- <view class="condition-item" @tap="goGateList">
<span class="ctitle">监控点</span>
......@@ -18,25 +18,25 @@
</view> -->
<view class="condition-item" @tap="dateHandle">
<span class="ctitle">日期</span>
<span class="select-item">{{ dateText }}</span>
<image class="rarrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image>
<span class="select-item">{{ dateText || '' }}</span>
<image class="rarrow" :src="rArrowImg" mode="widthFix"></image>
</view>
</view>
<view class="handle-content" v-show="activeType === 'gate'">
<view class="condition-item" @tap="goSingleStoreList">
<span class="ctitle">{{ i18n.store }}</span>
<span class="select-item">{{ selectedMall.name }}</span>
<image class="rarrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image>
<span class="select-item">{{ selectedMall ? selectedMall.name : '' }}</span>
<image class="rarrow" :src="rArrowImg" mode="widthFix"></image>
</view>
<view class="condition-item" @tap="goGateList">
<span class="ctitle">监控点</span>
<span class="select-item">{{ selectedGate.name }}</span>
<image class="rarrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image>
<span class="select-item">{{ multiSelectedGate.length ? multiSelectedGate[multiSelectedGate.length - 1].name : '' }}</span>
<image class="rarrow" :src="rArrowImg" mode="widthFix"></image>
</view>
<view class="condition-item" @tap="dateHandle">
<span class="ctitle">日期</span>
<span class="select-item">{{ dateText }}</span>
<image class="rarrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image>
<span class="select-item">{{ dateText || '' }}</span>
<image class="rarrow" :src="rArrowImg" mode="widthFix"></image>
</view>
</view>
<awesome-picker
......@@ -53,8 +53,8 @@
</template>
<script>
import headerComp from '../../components/header.vue'
import leftImg from '../../static/header/backArrow.png'
import headerComp from '../../../components/header.vue'
import leftImg from '../../../static/header/backArrow.png'
import { mapState, mapActions } from 'vuex'
export default {
......@@ -76,6 +76,7 @@
return {
rightText: '保存',
leftImg: leftImg,
rArrowImg: '../../../static/analysis/rArrow.png',
activeType: '',
navheight: 0,
picker: {
......@@ -89,6 +90,23 @@
cachePickerIdx: []
}
},
created() {
if(!this.selectedMall) { // 处理刷新获取参数失败
this.$store.dispatch('malls/getMallList', {
data: {
accountId: this.getStorage('accountId'),
_t:Date.parse(new Date()) / 1000
},
header: {
'Authorization': this.getStorage('atoken') //自定义请求头信息
},
isMultiple: true
})
}
if(!this.dateText) {
this.$store.dispatch('malls/getDateData', 15);
}
},
computed: {
i18n() {
return this.$t("index")
......@@ -96,7 +114,7 @@
...mapState({
selectedMall: state => state.malls.checkedMallId,
multiSelectedMall: state => state.malls.multiCheckedMallId,
selectedGate: state => state.malls.checkedGateId,
multiSelectedGate: state => state.malls.multiCheckedGateId,
dateData: state => state.malls.dayDateData,
dateText: state => state.malls.selectedDayTime,
currentDate: state => state.malls.pickerDayDate
......@@ -104,18 +122,56 @@
},
watch: {
selectedMall(val) {
console.log('watch val', val)
this.$store.dispatch('malls/getGateList', {
data: {
mallId: val.id,
status: 1,
isHasFace: 1,
_t:Date.parse(new Date()) / 1000
},
header: {
'Authorization': this.getStorage('atoken') //自定义请求头信息
},
isMultiple: true
})
}
},
methods: {
backFun() {
uni.navigateTo({
url: './groupTimeReport/groupTime'
url: '../groupTimeReport/groupTime'
})
},
save() {
if(this.activeType === 'gate') {
if(!this.selectedMall) {
uni.showToast({
icon:'none',
title:'请选择门店'
});
}
if(!this.multiSelectedGate) {
uni.showToast({
icon:'none',
title:'请选择出入口'
});
}
} else {
if(!this.multiSelectedMall) {
uni.showToast({
icon:'none',
title:'请选择门店'
});
}
}
if(!this.dateText) {
uni.showToast({
icon:'none',
title:'请选择日期'
});
}
uni.navigateTo({
url: `./groupTimeReport/groupTime?analysisLevel=${this.activeType}`
url: `../groupTimeReport/groupTime?analysisLevel=${this.activeType}`
})
},
itemClick(val) {
......@@ -123,21 +179,21 @@
},
goStoreList() {
uni.navigateTo({
url:"../conditionList/multiMallList?backUrl=../passenger/groupTimeCondition&analysisLevel=" + this.activeType,
url:"../../conditionList/multiMallList?backUrl=../passenger/conditions/groupTimeOption&analysisLevel=" + this.activeType,
animationType: 'slide-in-right',
animationDuration: 200
})
},
goSingleStoreList() {
uni.navigateTo({
url:"../conditionList/mallList?backUrl=../passenger/groupTimeCondition&analysisLevel=" + this.activeType,
url:"../../conditionList/mallList?backUrl=../passenger/conditions/groupTimeOption&analysisLevel=" + this.activeType,
animationType: 'slide-in-right',
animationDuration: 200
})
},
goGateList() {
uni.navigateTo({
url:"../conditionList/multiGateList?backUrl=../passenger/groupTimeCondition&analysisLevel=" + this.activeType,
url:"../../conditionList/multiGateList?backUrl=../passenger/conditions/groupTimeOption&analysisLevel=" + this.activeType,
animationType: 'slide-in-right',
animationDuration: 200
})
......
......@@ -78,17 +78,19 @@
},
created() {
this.accountId = this.getStorage('accountId');
// this.$store.dispatch('malls/getMallList', {
// data: {
// accountId:this.accountId,
// _t:Date.parse(new Date()) / 1000
// },
// header: {
// 'Authorization': this.atoken //自定义请求头信息
// },
// isMultiple: true
// })
// this.$store.dispatch('malls/getDateData', 15)
if(!this.checkedMallId) {
this.$store.dispatch('malls/getMallList', {
data: {
accountId:this.accountId,
_t:Date.parse(new Date()) / 1000
},
header: {
'Authorization': this.atoken //自定义请求头信息
},
isMultiple: true
})
this.$store.dispatch('malls/getDateData', 15)
}
},
computed: {
i18n() {
......@@ -104,22 +106,22 @@
},
watch: {
checkedMallId(val) {
this.$store.dispatch('malls/getGateList', {
data: {
mallId: val.id,
status: 1,
isHasFace: 1,
_t:Date.parse(new Date()) / 1000
},
header: {
'Authorization': this.atoken //自定义请求头信息
},
isMultiple: true
})
if(this.reportLevel !== 'mall') {
this.params['orgId'] = val.id;
this.getReportKey(this.reportLevel)
}
// this.$store.dispatch('malls/getGateList', {
// data: {
// mallId: val.id,
// status: 1,
// isHasFace: 1,
// _t:Date.parse(new Date()) / 1000
// },
// header: {
// 'Authorization': this.atoken //自定义请求头信息
// },
// isMultiple: true
// })
},
multiCheckedMallId(val) {
console.log('watch multiCheckedMallId', val)
......@@ -130,7 +132,7 @@
}
},
mounted() {
console.log('store state', this.mallList, this.checkedMallId, this.multiCheckedMallId)
// console.log('store state', this.mallList, this.checkedMallId, this.multiCheckedMallId)
},
methods: {
backFun() {
......@@ -140,7 +142,7 @@
},
conditionFun() {
uni.navigateTo({
url: '../groupTimeCondition'
url: '../conditions/groupTimeOption'
})
},
getReportKey(analysisLevel) {
......@@ -193,6 +195,7 @@
success: (res) => {
uni.hideLoading();
let result = res.data;
//
let bodyData = result.data.body;
let genderResource = result.data.body['faceGenderDetail'];
let columnsKey = this.createKeyObject(genderResource.xaxis.data);
......@@ -217,14 +220,15 @@
})
},
createColumns(keyObject) { // 生成列数据
return keyObject.map(item => {
return keyObject.map((item, index) => {
return {
field: item.key,
title: item.value,
width: 40,
width: 80,
titleAlign: 'center',
columnAlign: 'center',
isResize: true
isResize: true,
isFrozen: index == 0 ? true : false
}
})
},
......@@ -241,17 +245,6 @@
})
return result;
},
getStorage(key) {
let storageVal = '';
uni.getStorage({
key: key,
success: (res) => {
// console.log('storage', res)
storageVal = res.data;
}
})
return storageVal
},
},
}
......
......@@ -2,7 +2,7 @@
<view>
<headerComp :title="titleStr"></headerComp>
<view class="listBox">
<view class="itemBox" v-for="item in listData" @tap="goReport(item.src)">
<view class="itemBox" v-for="item in listData" :key="item.src" @tap="goReport(item.src)">
<img class="icons" :src="item.iconSrc"/>
<span class="texts">{{item.text}}</span>
<img class="arrows" :src="item.rArrow" alt=""/>
......@@ -84,16 +84,6 @@
animationDuration: 200
})
},
getStorage(key) {
let storageVal = '';
uni.getStorage({
key: key,
success: (res) => {
storageVal = res.data;
}
})
return storageVal
},
},
}
</script>
......
......@@ -6,10 +6,10 @@
<span class="texts">切换服务器地址</span>
<img class="arrows" :src="rArrow" alt=""/>
</view>
<view class="profile-item">
<!-- <view class="profile-item">
<span class="texts">修改密码</span>
<img class="arrows" :src="rArrow" alt=""/>
</view>
</view> -->
<view class="logout">
<button type="primary" class="primary logout-btn" @tap="logoutHandle">退出登录</button>
</view>
......@@ -37,7 +37,8 @@
},
methods: {
switchConnect() {
this.$message.confirm('<div class="dialog-content" style="color: #333; font-size: 17px;text-align: center;">确认切换该服务器地址?</div>', function(res, body) {
let that = this;
that.$message.confirm('<div class="dialog-content" style="color: #333; font-size: 17px;text-align: center;">确认切换该服务器地址?</div>', function(res, body) {
}, [{
className: 'dialog-btn',
label: '取消',
......@@ -48,7 +49,7 @@
className: 'dialog-btn',
label: '确定',
callback: function(res, $body) {
this.clearCache();
that.clearCache(true);
model.switchConnectType() // 调用swift 无参
}
}], '提示');
......@@ -59,15 +60,24 @@
url: '../login/login',
});
},
clearCache() {
clearCache(isAllClear) {
Object.keys(window.localStorage).forEach(item => {
if(item!='user'&&item!='pwd'){
if(isAllClear) {
uni.removeStorage({
key: item,
success: function (res) {
}
});
} else {
if(item!='user'&&item!='pwd'&&item!='statusBarH'){
uni.removeStorage({
key: item,
success: function (res) {
}
});
}
}
})
}
},
......
// 生成年月日时分秒数据
let dic = {
'Y': '年',
'EnY': 'year',
'M': '月',
'EnM': 'month',
'D': '日',
'EnD': 'day',
'h': '时',
'Enh': 'hour',
'm': '分',
'Enm': 'minutes',
's': '秒',
'Ens': 'seconds',
}
function createDateData(formatString) {
// if(dic[formatString])
}
\ No newline at end of file
......@@ -25,22 +25,4 @@ const conditionList = {
}
}
/*
* 获取门店列表
*/
function getMallId() {
return new Promise((reslove, reject) => {
//
})
}
/*
* 获取出入口列表
*/
function getGateId() {
return new Promise((reslove, reject) => {
//
})
}
export default conditionList;
\ No newline at end of file
......@@ -159,7 +159,6 @@ const actions = {
startTime = formatterDayTime(startDate);
pickerSt = computedPickerIdx(startTime);
pickerEt = computedPickerIdx(endTime);
console.log('开始结束日期:', pickerSt, pickerEt)
st = `${startTime['Y']}-${startTime['M']}-${startTime['D']}`;
et = `${endTime['Y']}-${endTime['M']}-${endTime['D']}`;
commit(MALLS.SET_SELECTED_CUSTOM_START_TIME, st); // 自定义开始时间文本
......@@ -189,7 +188,7 @@ const actions = {
commit(MALLS.CHECKED_GATE_ID, gateId)
},
updateMultiCheckedGate({ commit }, multiGateId) {
commit(MALLS.CHECKED_MULTI_GATE_ID, multiMallId)
commit(MALLS.CHECKED_MULTI_GATE_ID, multiGateId)
},
updateStartEndDate({ commit }, { startDate, endDate, startPickerIdx, endPickerIdx }) {
startDate && commit(MALLS.SET_START_DATE, startDate)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!