Commit 51f2c5a2 by 夏新然

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

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