Commit 7aab796c authored by 李智书's avatar 李智书

Merge branch 'v_c_application_feature_240102' into develop

parents 837f132f 0ed6e242
This source diff could not be displayed because it is too large. You can view the blob instead.
<template>
<div class="calendar-wrapper">
<div class="calendar-week">
<div class="week-item" v-for="item of weekList" :key="item">{{ item }}</div>
</div>
<div class="calendar-inner">
<div class="calendar-item" v-for="(item, index) of calendarList" :key="index"
:class="[item.disable ? 'disabled' : '',item.signdate ? 'signdate':'',item.value===currentDay?'today':'']"
@click="changeToday_(item)">
<!-- <div v-if="item.value=='2023-08-23'||item.value=='2023-08-18'||item.value=='2023-08-28'" class="icons">
<span v-if="item.value=='2023-08-23'">早中</span>
<span v-else-if="item.value=='2023-08-18'">早中晚</span>
<span v-else></span>
</div> -->
<div class="show">{{ item.date }}</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
currentDate: {
type: Object,
default: function() {
return {
year: '',
month: ''
};
}
},
shareDate_: {
type: String,
default: ""
},
cateringAbnormalTypeGroupList: {
type: Array,
default: function() {
return [];
}
},
changeToday: {
type: Function,
default: function() {
}
}
},
data() {
return {
current: {}, // 当前时间
weekList: ['', '', '', '', '', '', ''],
calendarList: [], // 用于遍历显示
shareDate: new Date(),
groupList: [],
}
},
computed: {
// 显示当前时间
currentDateStr() {
let {
year,
month
} = this.current;
return `${year}${this.pad(month)}月`;
}
},
mounted() {
this.init();
},
computed: {
currentDay() {
let month = (this.current.month + 1) < 10 ? '0' + (this.current.month + 1) : (this.current.month + 1);
return this.current.year + '-' + month + '-' + this.current.date;
}
},
methods: {
init() {
console.log(this.shareDate_, )
this.shareDate = new Date(this.shareDate_);
this.current = this.currentDate;
this.groupList = this.cateringAbnormalTypeGroupList
// this.shareDate = new Date('2023-05-01')
console.log(this.shareDate, 'shareDate11111')
// 初始化当前时间
// this.setCurrent();
this.calendarCreator();
},
changeToday_(item) {
this.$emit('changeToday', item)
},
// 判断当前月有多少天
getDaysByMonth(year, month) {
return new Date(year, month + 1, 0).getDate();
},
getFirstDayByMonths(year, month) {
return new Date(year, month, 1).getDay();
},
getLastDayByMonth(year, month) {
return new Date(year, month + 1, 0).getDay();
},
// 对小于 10 的数字,前面补 0
pad(str) {
return str < 10 ? `0${str}` : str;
},
// 点击上一月
prevMonth() {
this.current.month--;
// 因为 month的变化 会超出 0-11 的范围, 所以需要重新计算
this.correctCurrent();
// 生成新日期
this.calendarCreator();
},
// 点击下一月
nextMonth() {
this.current.month++;
this.correctCurrent();
this.calendarCreator();
},
// 格式化时间,与主逻辑无关
stringify(year, month, date) {
let str = [year, this.pad(month + 1), this.pad(date)].join('-');
return str;
},
// 设置或初始化 current
setCurrent(d = new Date()) {
let t = new Date(this.current.year)
console.log(d, 'setCurrent')
let year = d.getFullYear();
let month = d.getMonth();
let date = d.getDate();
this.current = {
year,
month,
date
}
},
// 修正 current
correctCurrent() {
let {
year,
month,
date
} = this.current;
let maxDate = this.getDaysByMonth(year, month);
// 预防其他月跳转到2月,2月最多只有29天,没有30-31
date = Math.min(maxDate, date);
let instance = new Date(year, month, date);
this.setCurrent(instance);
},
// 生成日期
calendarCreator() {
// 一天有多少毫秒
const oneDayMS = 24 * 60 * 60 * 1000;
console.log(this.groupList, 'groupList')
let list = [];
let {
year,
month
} = this.current;
// 当前月份第一天是星期几, 0-6
let firstDay = this.getFirstDayByMonths(year, month);
// 填充多少天
let prefixDaysLen = firstDay === 0 ? 6 : firstDay - 1;
// 毫秒数
let begin = new Date(year, month, 1).getTime() - oneDayMS * prefixDaysLen;
// 当前月份最后一天是星期几, 0-6
let lastDay = this.getLastDayByMonth(year, month);
// 填充多少天, 和星期的排放顺序有关
let suffixDaysLen = lastDay === 0 ? 0 : 7 - lastDay;
// 毫秒数
let end = new Date(year, month + 1, 0).getTime() + oneDayMS * suffixDaysLen;
// 默认每月第一天
let currentToday = {
month: this.current.month,
unrecordedZao: false,
unrecordedWu: false,
unrecordedWan: false
}
while (begin <= end) {
this.shareDate.setTime(begin);
let year = this.shareDate.getFullYear();
let curMonth = this.shareDate.getMonth();
let date = this.shareDate.getDate();
let obj = {
year: year,
month: curMonth,
date: date,
disable: curMonth !== month,
value: this.stringify(year, curMonth, date),
signdate: false,
unrecordedZao: false,
unrecordedWu: false,
unrecordedWan: false
}
if (curMonth == currentToday.month) {
let f = this.groupList.filter(y => y.date == date)
if (f.length) {
obj.signdate = true
if(f[0].date == 1){
currentToday = Object.assign(currentToday, f[0])
}
obj = Object.assign(obj, f[0])
}
}
list.push(obj);
begin += oneDayMS;
}
this.changeToday_(currentToday)
this.calendarList = list;
}
},
watch: {
currentDate(val, oldVal) {
if (val !== oldVal) {
this.current = val;
this.calendarCreator();
}
},
shareDate_(val, oldVal) {
if (val !== oldVal) {
this.shareDate = new Date(val)
this.calendarCreator();
}
},
cateringAbnormalTypeGroupList(val, oldVal) {
if (val !== oldVal) {
this.groupList = val
this.calendarCreator();
}
}
},
}
</script>
<style>
.calendar-wrapper {
width: 100%;
height: auto;
overflow: hidden;
}
.calendar-week {
display: flex;
align-items: center;
text-align: center;
width: 690rpx;
height: 74rpx;
background: #F7FAF8;
font-size: 26rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
line-height: 37rpx
}
.calendar-week .week-item {
flex: 1;
}
.calendar-week .week-item:first-child,
.week-item:last-child {
color: rgba(0, 0, 0, 0.25);
}
.calendar-inner {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}
.calendar-item {
display: flex;
width: 88rpx;
height: 88rpx;
box-sizing: border-box;
/* padding-top: 28rpx; */
border-radius: 22rpx;
margin: 5rpx;
justify-content: center;
align-items: center;
font-size: 32rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: rgba(0, 0, 0, 0.75);
line-height: 88rpx;
flex-direction: column;
}
.calendar-item.disabled {
color: rgba(0, 0, 0, 0.1);
}
.signdate {
border-radius: 22rpx;
background-color: rgba(249, 121, 63, 0.1);
color: #F9793F;
line-height: 28rpx;
height: 87rpx;
padding-top: 0rpx;
}
.icons {
font-size: 20rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #F9793F;
line-height: 28rpx;
margin-bottom: 4rpx;
}
.today {
background: rgba(0, 0, 0, 0.1);
}
.calendar-item.checked {
color: red;
}
</style>
\ No newline at end of file
......@@ -440,8 +440,7 @@
"enablePullDownRefresh": false
}
}
, {
}, {
"path": "pages/commonProblem/commonProblem",
"style": {
"navigationBarTitleText": "常见问题",
......@@ -449,154 +448,147 @@
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/problemDetail/problemDetail",
"style" :
{
}, {
"path": "pages/problemDetail/problemDetail",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/socialmailbox/socialmailbox",
"style" :
{
}, {
"path": "pages/socialmailbox/socialmailbox",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "匿名投递故事"
}
}
,{
"path" : "pages/h520221116/h520221116",
"style" :
{
}, {
"path": "pages/h520221116/h520221116",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "亲子沟通,由你定义",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ConsumptionSystem/AbnormalConsumption/AbnormalConsumption",
"style" :
{
}, {
"path": "pages/ConsumptionSystem/AbnormalConsumption/AbnormalConsumption",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "消费异常",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/Home/Home",
"style" :
{
}, {
"path": "pages/ApplyConsumption/Home/Home",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "校园消费",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/CommonProblem/CommonProblem",
"style" :
{
}, {
"path": "pages/ApplyConsumption/CommonProblem/CommonProblem",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "常见问题",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/ConsumptIoninfo/ConsumptIoninfo",
"style" :
{
}, {
"path": "pages/ApplyConsumption/ConsumptIoninfo/ConsumptIoninfo",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "消费记录",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/ConsumptionQuota/ConsumptionQuota",
"style" :
{
}, {
"path": "pages/ApplyConsumption/ConsumptionQuota/ConsumptionQuota",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "消费限额",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/OrderClearSuspicions/OrderClearSuspicions",
"style" :
{
}, {
"path": "pages/ApplyConsumption/OrderClearSuspicions/OrderClearSuspicions",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "待还款订单",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/pendingOrder/pendingOrder",
"style" :
{
}, {
"path": "pages/ApplyConsumption/pendingOrder/pendingOrder",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "待还款订单",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/consumptionDetail/consumptionDetail",
"style" :
{
}, {
"path": "pages/ApplyConsumption/consumptionDetail/consumptionDetail",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "消费详情",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/rechargeDetail/rechargeDetail",
"style" :
{
}, {
"path": "pages/ApplyConsumption/rechargeDetail/rechargeDetail",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "充值详情",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/topupDetail/topupDetail",
"style" :
{
}, {
"path": "pages/ApplyConsumption/topupDetail/topupDetail",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "充值明细",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/consumptionRecord/consumptionRecord",
"style" :
{
}, {
"path": "pages/ApplyConsumption/consumptionRecord/consumptionRecord",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "消费记录",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/pendingOrderDetail/pendingOrderDetail",
"style" :
{
}, {
"path": "pages/ApplyConsumption/pendingOrderDetail/pendingOrderDetail",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "消费详情",
"enablePullDownRefresh": false
}
}, {
"path": "pages/ApplyConsumption/campusReport/campusReport",
"style": {
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},
{
"path": "pages/ApplyConsumption/businessRecord/consumeRecord/consumeRecord",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "校园消费数据",
"enablePullDownRefresh": false
}
},
{
"path": "pages/ApplyConsumption/businessRecord/transactionDetails/transactionDetails",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "设备交易明细",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
......
......@@ -3,7 +3,7 @@
<!-- 头部卡片 -->
<view class="cardInfo"
:style="'background-image: url('+this.$ImgUrl + (HomeDataInfo['vipStatus']==1? 'applyCons/bgm.png':'applyCons/bgm1.png')+')'">
<view class="userInfo">
<view class="userInfo" v-if="!path">
<view class="left">
<view class="useravatar" :style="'background-image: url('+this.$ImgUrl + 'applyCons/icon.png'+')'">
</view>
......@@ -24,7 +24,7 @@
</view>
</view>
<!-- 消费数据 -->
<view class="cdatabox">
<view class="cdatabox" v-if="!path">
<view class="cdatal">
<span class="integer">{{HomeDataInfo['schoolConsumption']['dailySpend_integer']}}</span>
<span class="decimal">.{{HomeDataInfo['schoolConsumption']['dailySpend_decimal']}}</span>
......@@ -41,7 +41,7 @@
</view>
</view>
<!-- -->
<view class="cdatabox2">
<view class="cdatabox2" v-if="!path">
<view class="cdatal"
:style="HomeDataInfo['schoolConsumption']['pendingcharge_decimal']>0?'color: red;':''"
@click="goToPage(1)">
......@@ -72,14 +72,16 @@
</view>
</view>
<!-- 功能菜单 -->
<view class="menuList">
<view class="menuList" v-if="!path">
<view class="menuitem" v-for="(item,index) in menuList" :key="index" @click="menuClick(item,index+1)">
<view class="">
<view class="title">{{item.title||''}}</view>
<view class="sketch">{{item.sketch||''}}</view>
</view>
<view class="icon">
<image :src="item.icon" mode="aspectFit"></image>
<image
:src="index+1 != 5 ? item.icon : 'https://xiaopay2020.oss-cn-shenzhen.aliyuncs.com/static/weapp/applyCons/menu3.png'"
mode="aspectFit"></image>
</view>
</view>
</view>
......@@ -116,26 +118,29 @@
requestGet,
requestPost
} from '../common/request.js'
// 判断是否支付宝小程序
const AliAppMini = navigator.userAgent.indexOf('AliApp') > -1
export default {
name: "CampusConsumption",
data() {
return {
ImgUrl: this.$ImgUrl,
ImgUrl2: this.$ImgUrl + 'xzfalipay/',
menuList: Array(4).fill(1).map((v, index) => {
menuList: Array(5).fill(1).map((v, index) => {
return {
path: ['../ConsumptIoninfo/ConsumptIoninfo', '../ConsumptionQuota/ConsumptionQuota',
'/pages/ConsumptionSystem/AbnormalConsumption/AbnormalConsumption',
'../CommonProblem/CommonProblem'
'../CommonProblem/CommonProblem', '../campusReport/campusReport'
][index],
title: ['消费记录', '消费限额', '消费异常', '常见问题'][index],
sketch: ['消费记录 笔笔可查', '设置额度 管控消费', '消费异常 每日提醒', '使用疑问 一一解答'][index],
title: ['消费记录', '消费限额', '消费异常', '常见问题', '校园报告'][index],
sketch: ['消费记录 笔笔可查', '设置额度 管控消费', '消费异常 每日提醒', '使用疑问 一一解答', '校园报告'][index],
icon: this.$ImgUrl + `applyCons/menu${index+1}.png`,
// 是否需要鉴权
auth: [true, true, true, false][index],
auth: [true, true, true, false, true][index],
// 鉴权服务项code
serviceItemCode: [config['ServiceEnum']['Auth10'], config['ServiceEnum']['Auth8'], config[
'ServiceEnum']['Auth11'], '']
'ServiceEnum']['Auth11'], '', config[
'ServiceEnum']['Auth2']]
[index]
}
}),
......@@ -170,10 +175,15 @@
// 学校 学生id
userInfo: {
schoolId: '',
userId: ''
userId: '',
userType: '',
},
// 消费会员弹框
contractMenber: false,
// 跳转内部页面path
path: '',
// 支付宝小程序
aliMini: AliAppMini
};
},
onLoad(options) {
......@@ -188,6 +198,9 @@
return;
}
this.UserLogin(options['token'])
if (options['path']) {
this.path = options['path'] || ""
}
},
methods: {
// 弹框点击事情
......@@ -199,7 +212,7 @@
}
if (type == 2) {
jWeixin.miniProgram.navigateTo({
url: '/pages/nationalCenterForLesbianRights/index'
url: '/pages/nationalCenterForLesbianRights/index?productId=3'
})
}
this.contractMenber = false
......@@ -219,7 +232,7 @@
return
}
uni.setStorageSync('token', data.data['token'])
this.HomePageData()
await this.HomePageData()
},
// 查询消费会员权益项
async QueryProductContractItem(serviceItemCode = '1008') {
......@@ -236,8 +249,9 @@
return
}
this.userInfo = {
schoolId: data.data['schoolId'],
userId: data.data['userId']
schoolId: data.data['schoolId'] || '',
userId: data.data['userId'],
userType: data.data['userType'] || ''
}
return data.data['result']
},
......@@ -264,9 +278,20 @@
}
data.data['schoolConsumption'] = schoolConsumption
this.HomeDataInfo = data.data
sessionStorage.setItem('HomeDataInfo', JSON.stringify(this.HomeDataInfo))
sessionStorage.setItem('accountId', this.HomeDataInfo['accountId'])
// 查询消费会员权益项
this.QueryProductContractItem()
await this.QueryProductContractItem()
// 20231031
if (this['path']) {
if ('/pages/ApplyConsumption/campusReport/campusReport' == this['path']) {
this.menuClick(this.menuList[4], 5)
return
}
uni.redirectTo({
url: this['path']
})
}
},
// 跳转页面
async goToPage(value) {
......@@ -291,7 +316,7 @@
// 跳转云平台权益中心
async openAzMenber() {
jWeixin.miniProgram.navigateTo({
url: '/pages/nationalCenterForLesbianRights/index'
url: '/pages/nationalCenterForLesbianRights/index?productId=3'
})
},
// 菜单跳转
......@@ -310,7 +335,8 @@
}
}
const query =
`?name=${this.HomeDataInfo['userName']}&userId=${this.userInfo['userId']}&schoolId=${this.userInfo['schoolId']}&membershipStatus=${this.HomeDataInfo['membershipStatus']}`
`?name=${this.HomeDataInfo['userName']}&accountId=${this.HomeDataInfo['accountId']}&userId=${this.userInfo['userId']}&schoolId=${this.userInfo['schoolId']}&userType=${this.userInfo['userType']}`
console.log(item.path + query)
uni.switchTab({
url: item.path + query,
fail: () => {
......@@ -328,6 +354,7 @@
page {
width: 100%;
background: #F1F1F3;
line-height: 1.6;
}
.CampusConsumption {
......
<template>
<view class="consumeRecord">
<van-tabs v-model="active" animated sticky color="#01CB88" title-active-color="#1B1B1B"
title-inactive-color="rgba(0,0,0,0.5)" @change="changeTabs">
<van-tab title="门店">
<!-- 标题 -->
<template #title>
<view :class="active!=1?'custstyle':'default'">门店</view>
</template>
<!-- 内容 -->
<template #default>
<Store v-if="active!=1" :totalCnt="totalCnt" :isperiod="isperiod" :StoreInfo_="StoreInfo_"
:flowsList="flowsList" :storeInfo="storeInfo" @transactionDetails="transactionDetails"
@selectTime="selectTime" @selectStore="selectStore" @Loadmore="Loadmore" :starttime="starttime"
:endtime="endtime" :showPicker="showPicker" :calendar="calendar" :ImgUrl="ImgUrl"
:ImgUrl2="ImgUrl2"></Store>
</template>
</van-tab>
<van-tab title="设备">
<!-- 标题 -->
<template #title>
<view :class="active==1?'custstyle':'default'">设备</view>
</template>
<!-- 内容 -->
<template #default>
<Device v-if="active==1" :isperiod="isperiod" :StoreInfo_="StoreInfo_" :deviceList_="deviceList_"
:storeInfo="storeInfo" @transactionDetails="transactionDetails" @selectStore="selectStore"
@selectTime="selectTime" :showPicker="showPicker" :calendar="calendar" :ImgUrl="ImgUrl"
:ImgUrl2="ImgUrl2"></Device>
</template>
</van-tab>
</van-tabs>
<!-- 选择日期组件 -->
<van-calendar v-model="calendar" :allow-same-day="true" :min-date="minDate" :max-range="93" :show-confirm="true" position="bottom"
color="#01CB88" type="range" @confirm="onConfirm" />
<!-- 门店选择 -->
<van-popup v-model="showPicker" round position="bottom">
<view class="" style="height: 600rpx;">
<van-picker title="门店选择" show-toolbar :columns="stores" @confirm="onConfirmStore"
@cancel="onCancelStore" @change="onChangeStore">
<template #option="option">
<view class="" style="white-space: nowrap; text-overflow: ellipsis; width: 100%;text-align: center;">
{{option.storeName}}
</view>
</template>
</van-picker>
</view>
</van-popup>
</view>
</template>
<script>
import Store from "../components/store/store.vue"
import Device from "../components/device/device.vue"
import dayjs from "dayjs"
import isBetween from "dayjs/plugin/isBetween"
dayjs.extend(isBetween)
// const starttime = dayjs().subtract(1, 'day').format('YYYY/MM/DD')
const starttime = dayjs().format('YYYY/MM/DD')
const endtime = dayjs().format('YYYY/MM/DD')
import login from "../mixin/login.js"
// 高峰期限制
// "上午" 06:00:00-08:30:00
// "中午" 11:00:00-13:00:00
// "晚上" 17:00:00-19:00:00
const s1 = dayjs().format('YYYY-MM-DD 06:00:00')
const s2 = dayjs().format('YYYY-MM-DD 08:30:00')
const z1 = dayjs().format('YYYY-MM-DD 11:00:00')
const z2 = dayjs().format('YYYY-MM-DD 13:00:00')
const x1 = dayjs().format('YYYY-MM-DD 17:00:00')
const x2 = dayjs().format('YYYY-MM-DD 19:00:00')
const isperiod = dayjs().isBetween(s1, s2) || dayjs().isBetween(z1, z2) || dayjs().isBetween(x1,
x2)
console.warn("高峰期====>>>", isperiod)
import {
Dialog,
Toast
} from 'vant';
import config from '../../common/config.js'
import {
requestGet,
requestPost
} from '../../common/request.js'
export default {
name: "consumeRecord",
mixins: [login],
components: {
Store,
Device
},
data() {
return {
// 是否高峰期
isperiod,
// 默认时间
starttime,
endtime,
ImgUrl: this.$ImgUrl,
ImgUrl2: this.$ImgUrl + 'xzfalipay/',
active: 0,
// 日历选择弹框
calendar: false,
// 门店选择弹框
showPicker: false,
minDate: new Date(2021, 0, 1),
// 门店列表
stores: [],
// 选择的门店
StoreInfo_: {},
// 门店流水列表数据
flowsList: [],
// 门店流水列表数据
deviceList_: [],
pageIndex: 1,
pageSize: 20,
// 数据总条数
totalCnt: 0
}
},
onLoad: function(options) {
},
methods: {
// 加载更多
Loadmore() {
this.pageIndex += 1
this.StoreFlows(this.StoreInfo_['id'])
},
//门店设备
async DeviceList(storeId) {
// 高峰期禁止请求接口
if (this.isperiod) {
return
}
const loading = Toast.loading('数据加载中...');
let data = await requestPost('/cgi-xpay/app/busi/DeviceList', {
"businessId": 0,
"storeId": storeId || 0
})
loading.clear();
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: "门店设备查询失败",
confirmButtonText: "知道了"
})
return
}
let jsonData = JSON.parse(JSON.stringify(data || {}))
const backData = jsonData.data.backData || []
this.deviceList_ = backData
},
//门店流水
async StoreFlows(storeId) {
// 高峰期禁止请求接口
if (this.isperiod) {
return
}
const loading = Toast.loading('数据加载中...');
let data = await requestPost('/cgi-xpay/app/busi/StoreFlows', {
"businessId": 0,
"startDate": this.starttime.replaceAll("/", "-"),
"endDate": this.endtime.replaceAll("/", "-"),
"pageIndex": this.pageIndex,
"pageSize": this.pageSize,
"storeId": storeId || 0
})
loading.clear();
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: "门店流水查询失败",
confirmButtonText: "知道了"
})
return
}
let jsonData = JSON.parse(JSON.stringify(data || {}))
const backData = jsonData.data.backData || []
this.totalCnt = jsonData.data.totalCnt || 0
if (this.pageIndex == 1) {
this.flowsList = backData.map((v, index) => {
v['amount'] = parseFloat(v.amount / 100).toFixed(2)
return v
})
} else {
const arr = backData.map((v, index) => {
v['amount'] = parseFloat(v.amount / 100).toFixed(2)
return v
})
this.flowsList.push(...arr)
}
},
// 设备查看明细
async transactionDetails(item, index) {
const loading = Toast.loading('数据加载中...');
console.warn(item, index)
uni.setStorageSync("details", item)
uni.navigateTo({
url: `../transactionDetails/transactionDetails?starttime=${this.starttime}&endtime=${this.endtime}`,
success: () => {
loading.clear();
}
})
},
onConfirmStore(value, index) {
this.selectStore()
const StoreInfo_ = this.stores[index]
this.StoreInfo_ = StoreInfo_
// 查询门店交易数据
if (this.active === 0) {
this.StoreFlows(StoreInfo_['id'])
this.StoreData()
} else {
this.DeviceList(StoreInfo_['id'])
this.StoreData()
}
this.showPicker = false
},
onChangeStore(picker, value, index) {
},
onCancelStore() {
this.showPicker = false
},
// 选择门店
selectStore() {
this.showPicker = true
},
// 组件提交时间
onConfirm(date) {
const [start, end] = date;
// this.calendar = false;
this.starttime = dayjs(start).format('YYYY/MM/DD')
this.endtime = dayjs(end).format('YYYY/MM/DD')
this.calendar = false
// 查询门店交易数据
if (this.active === 0) {
this.StoreFlows(this.StoreInfo_['id'])
this.StoreData()
} else {
this.DeviceList(this.StoreInfo_['id'])
this.StoreData()
}
},
// 选择时间
selectTime(status) {
this.calendar = status
},
// tab切换
async changeTabs(e) {
// 清空选择的门店信息
this.StoreInfo_ = {}
this.pageIndex = 1;
this.pageSize = 20;
if (e === 0) {
this.StoreFlows()
this.StoreData()
} else {
this.DeviceList()
this.StoreData()
}
}
}
}
</script>
<style lang="scss">
page {
height: 100vh;
background: #F3F3F3;
}
.consumeRecord {
.default {
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
}
.van-tabs__line {
background: #01CB88 !important;
border-radius: 8rpx !important;
width: 68rpx;
height: 6rpx;
}
.custstyle {
font-size: 34rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #1B1B1B;
}
}
</style>
\ No newline at end of file
/**
* 支付宝商家端查询门店/设备交易数据
*/
import {
Dialog
} from 'vant';
import config from '../../common/config.js'
import {
requestGet,
requestPost
} from '../../common/request.js'
export default {
data() {
return {
path: "",
// 门店初始化数据
storeInfo: {}
};
},
onLoad: function(options) {
if (!options['token']) {
Dialog({
title: '系统提示',
message: 'token为空!',
confirmButtonText: "知道了"
}).then(res => {
window.close()
})
return;
}
this.UserLogin(options['token'])
if (options['path']) {
this.path = options['path'] || ""
}
},
onShow: function() {
},
onunload: function() {
},
methods: {
//登录获取用户信息
async UserLogin(token) {
let data = await requestPost('/cgi-xpay/app/Login', {
grantType: 'GT_azCloud_business',
code: token,
})
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
return
}
uni.setStorageSync('token', data.data['token'])
// 门店初始化数据
this.StoreData()
// 门店商家列表
this.StoreList()
},
//门店初始化数据
async StoreData(token) {
let data = await requestPost('/cgi-xpay/app/busi/StoreData', {
"businessId": 0,
"startDate": this.starttime.replaceAll("/", "-"),
"endDate": this.endtime.replaceAll("/", "-"),
"storeId": this.StoreInfo_['id'] || 0
})
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: "门店初始化数据",
confirmButtonText: "知道了"
})
return
}
let jsonData = JSON.parse(JSON.stringify(data.data))
jsonData['offlineDeviceCnt'] = jsonData['offlineDeviceCnt'] || 0
jsonData['onlineDeviceCnt'] = jsonData['onlineDeviceCnt'] || 0
jsonData['totalAmount'] = ((jsonData['totalAmount'] || 0) / 100).toFixed(2)
jsonData['totalCnt'] = jsonData['totalCnt'] || 0
jsonData["cateringData"] = jsonData["cateringData"].map((v, index) => {
if (v['mealType'] == "早餐") {
v['mealTypePng'] = "xzf/h5/zao.png"
}
if (v['mealType'] == "中餐") {
v['mealTypePng'] = "xzf/h5/wu.png"
}
if (v['mealType'] == "晚餐") {
v['mealTypePng'] = "xzf/h5/wan.png"
}
if (v['mealType'] == "夜宵") {
v['mealTypePng'] = "xzf/h5/ye.png"
}
if (v['mealType'] == "夜夜宵") {
v['mealTypePng'] = "xzf/h5/yeye.png"
}
if (parseInt(jsonData['totalAmount'] * 100) === 0) {
v['perc'] = 0
} else {
v['perc'] = parseFloat(v.dealAmount / parseInt(jsonData['totalAmount'] * 100)) * 100
}
v['dealAmount'] = (v['dealAmount'] / 100).toFixed(2)
return v
})
this.storeInfo = jsonData
},
//门商家列表
async StoreList(token) {
let data = await requestPost('/cgi-xpay/app/busi/StoreList', {})
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: "门商家列表查询失败",
confirmButtonText: "知道了"
})
return
}
let jsonData = JSON.parse(JSON.stringify(data.data || []))
this.stores = [{
id: 0,
storeName: "全部门店"
}, ...jsonData]
// 查询门店交易数据
if (this.active === 0) {
this.StoreFlows()
}
}
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -486,6 +486,7 @@
})
}
this.dataRangeArr = tmpArr
},
methods: {
consumerChange(e) {
......
......@@ -278,7 +278,7 @@
:key="index" class="consumer-details-body"
:style="{background:Number.isInteger(index/2)?'#FFFFFF':'#F8F8F7'}">
<view class="consumer-details-body-item" v-for="(e,i) in item.consumerDetailsArr"
:class="i?'':'consumer-details-body-data'">
:class="i?'':'consumer-details-body-data'" :key="i">
<text>{{e}}</text>
</view>
</view>
......@@ -1169,7 +1169,7 @@
</template>
<script>
import html2cancas from "html2canvas"
// import html2cancas from "html2canvas"
var gHost = "https://" + window.location.host;
if (window.location.protocol != "https:") {
gHost = "https://fpdev.xiaopay.net";
......@@ -1618,7 +1618,7 @@
},
toImage: function() {
this.$nextTick(() => {
html2cancas(document.getElementsByClassName("tainer")[0], {
html2canvas(document.getElementsByClassName("tainer")[0], {
useCORS: true,
// 解决截图不完整问题
scale: 1,
......
......@@ -11,6 +11,7 @@
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
<script src="https://xiaopay2020.oss-cn-shenzhen.aliyuncs.com/static/weapp/src/js/html2canvas.js"></script>
<script src="//xiaopay2020.oss-cn-shenzhen.aliyuncs.com/static/weapp/src/js/jquery-1.8.0.min.js" async="async"></script>
<script src="//xiaopay2020.oss-cn-shenzhen.aliyuncs.com/static/weapp/src/js/weui.min.js" async="async"></script>
<script src="//xiaopay2020.oss-cn-shenzhen.aliyuncs.com/static/weapp/src/js/jweixin-1.6.0.js"></script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment