Commit 97b33ee0 authored by 李智书's avatar 李智书

Merge branch 'v_c_application_feature_1031' into 'develop'

V c application feature 1031

See merge request !13
parents 73c8a7cf 6bebf5dd
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -573,6 +573,22 @@
"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,7 +72,7 @@
</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>
......@@ -233,12 +233,6 @@
}
uni.setStorageSync('token', data.data['token'])
await this.HomePageData()
// 20231031
if (this['path']) {
uni.redirectTo({
url: this['path']
})
}
},
// 查询消费会员权益项
async QueryProductContractItem(serviceItemCode = '1008') {
......@@ -287,7 +281,17 @@
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) {
......
<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" :isperiod="isperiod" :StoreInfo_="StoreInfo_" :flowsList="flowsList"
:storeInfo="storeInfo" @selectTime="selectTime" @selectStore="selectStore"
:starttime="starttime" :endtime="endtime" :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" :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="">
{{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,
}
},
onLoad: function(options) {
},
methods: {
//门店设备
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 || []
const totalCnt = jsonData.data.totalCnt || 0
this.flowsList = backData.map((v, index) => {
v['amount'] = parseFloat(v.amount / 100).toFixed(2)
return v
})
},
// 设备查看明细
async transactionDetails(item, index) {
const loading = Toast.loading('数据加载中...');
console.warn(item, index)
uni.setStorageSync("details", item)
uni.navigateTo({
url: "../transactionDetails/transactionDetails",
success: () => {
loading.clear();
}
})
},
onConfirmStore(value, index) {
this.selectStore()
const StoreInfo_ = this.stores[index]
this.StoreInfo_ = StoreInfo_
// 查询门店交易数据
if (this.active === 0) {
this.StoreFlows(StoreInfo_['id'])
} else {
this.DeviceList(StoreInfo_['id'])
}
},
onChangeStore(picker, value, index) {
},
onCancelStore() {
this.selectStore()
},
// 选择门店
selectStore() {
this.showPicker = !this.showPicker
},
// 组件提交时间
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'])
} else {
this.DeviceList(this.StoreInfo_['id'])
}
},
// 选择时间
selectTime(status) {
this.calendar = status
},
// tab切换
async changeTabs(e) {
// 清空选择的门店信息
this.StoreInfo_ = {}
if (e === 0) {
this.StoreFlows()
} else {
this.DeviceList()
}
}
}
}
</script>
<style>
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', {})
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']) === 0) {
v['perc'] = 0
} else {
v['perc'] = parseFloat(v.dealAmount / jsonData['totalAmount'])
}
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
......@@ -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>
......
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