pull/7/head
xiaozhiyong 2 years ago
parent 3bd60fe2bd
commit d2878369d4
  1. 18
      api/packageBill/push.js
  2. 425
      packageBill/push/index.vue
  3. 10
      pages.json
  4. 70
      pages/home/home.vue
  5. 80
      pages/index/index.vue
  6. 6
      pages/station-info/scan-camera/scan-camera.vue

@ -0,0 +1,18 @@
import request from '@/utils/request'
export default{
getByPageRecord(data) {
return request({
url: `/oil-finance/xoilSiteChannelAccountAck/getByPage`,
method: 'post',
data
})
},
ackBill(data) {
return request({
url: `/oil-finance/xoilSiteChannelAccountAck/ackBill`,
method: 'post',
data
})
},
}

@ -0,0 +1,425 @@
<template>
<view class="content my-bg" style="height: 100vh; display: flex; flex-direction: column;">
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
<block slot="backText">返回</block>
<block slot="content">账单推送</block>
</cu-custom>
<view class="fixed-t">
<scroll-view scroll-x class="bg-white nav">
<view class="flex text-center">
<view class="cu-item flex-sub" :class="index==currentIndex?'text-orange cur':''"
v-for="(item,index) in statusEnum" :key="index" @tap="tabSelect(index,item)">{{item.label}}
</view>
</view>
</scroll-view>
</view>
<view style="flex: 1; overflow: hidden;">
<scroll-view style="height: 100%;" scroll-y="true" @scrolltolower="scrolltolower">
<view v-if="listData.length" style="padding-bottom: 50rpx;">
<view class="item" v-for="(item,index) in listData" :key="index">
<view class="no">{{item.id}}</view>
<view class="top-region">
<view><text>确认金额</text><text>{{item.amount}}</text></view>
<view><text>油站实际金额</text><text>{{item.actualAmount || '--'}}</text></view>
<view><text>创建时间</text><text>{{item.createTime}}</text></view>
<view><text>推送时间</text><text>{{item.deadlineTime}}</text></view>
</view>
<view class="round" :class="statusEnum.find(i => i.value == item.ackStatus).color">
<view>
{{statusEnum.find(i => i.value == item.ackStatus).label}}
</view>
</view>
<view class="bottom-region" v-if="item.ackStatus == 1">
<button class="mini-btn" type="primary" size="mini" @click="examine(item)">审核</button>
</view>
</view>
</view>
<Empty v-else />
</scroll-view>
</view>
<uni-popup ref="popup" @change="change">
<view class="popup-frame">
<view class="title">余额审核</view>
<radio-group @change="radioChange">
<label class="radio" style="font-size: 25rpx;">
<radio style="transform:scale(0.7)" value="2" :checked="submitParams.ackStatus == 2" />余额无误
</label>
<label class="radio" style="font-size: 25rpx;margin-left: 20rpx;">
<radio style="transform:scale(0.7)" value="3" />余额有误
</label>
</radio-group>
<input v-if="submitParams.ackStatus == 3" class="uni-input input" v-model="submitParams.actualAmount"
placeholder-style="placeholder-style" placeholder="请输入正确余额" />
<button class="mini-btn position" type="primary" size="mini" @click="submit">提交</button>
<button class="mini-btn position" size="mini" @click="$refs.popup.close()">取消</button>
</view>
</uni-popup>
</view>
</template>
<script>
import serve from '@/api/packageBill/push.js'
export default {
data() {
return {
parameter: {
pageSize: 15,
currentPage: 1,
params: {
ackStatus: '',
},
sorted: {}
},
submitParams: {
batchNumber: '',
actualAmount: '',
ackStatus: '2'
},
listData: [],
currentIndex: 0,
statusEnum: [{
value: '',
label: '全部',
color: ''
},
{
value: '1',
label: '待确认',
color: 'orange'
}, {
value: '2',
label: '确认无误',
color: 'green'
}, {
value: '3',
label: '金额有误',
color: 'red'
}
],
siteId: uni.getStorageSync('oilSitePriceId')
}
},
onLoad() {
// console.log('this.siteId', this.siteId)
this.search()
},
// onReachBottom() { //
// // console.log('')
// this.loadMoreOrder('onReachBottom')
// },
methods: {
tabSelect(index, item) {
this.currentIndex = index
this.parameter.params.ackStatus = item.value
this.parameter.currentPage = 1
this.search()
},
examine(item) {
this.submitParams.batchNumber = item.batchNumber
this.submitParams.actualAmount = ''
this.$refs.popup.open('center')
},
radioChange(val) {
this.submitParams.ackStatus = val.detail.value
if (val.detail.value == 2) {
this.submitParams.actualAmount = ''
}
},
submit() {
if (this.submitParams.ackStatus == 3 && !this.submitParams.actualAmount) {
uni.showToast({
title: "请输入正确价格",
icon: 'none'
})
return
}
serve.ackBill(this.submitParams).then(res => {
uni.showToast({
title: res.msg,
icon: 'none'
})
if (res.code !== 20000) return
this.$refs.popup.close()
this.parameter.currentPage = 1
this.search()
})
},
search() {
this.parameter.params.siteId = this.siteId
serve.getByPageRecord(this.parameter).then(res => {
if (res.code !== 20000) return
if (this.parameter.currentPage == 1) {
this.listData = res.data.list
return
}
if (!res.data.list.length) {
uni.showToast({
title: '没有更多数据了~',
icon: 'none'
})
return
}
this.listData = this.listData.concat(res.data.list);
})
},
scrolltolower() {
this.parameter.currentPage += 1
this.search()
},
}
}
</script>
<style lang="scss" scoped>
.popup-frame {
position: relative;
padding: 20rpx 50rpx;
width: 600rpx;
height: 335rpx;
background: #fff;
border-radius: 20rpx;
.title {
font-size: 30rpx;
margin-bottom: 20rpx;
text-align: center;
}
.input {
margin-top: 20rpx;
margin-left: 8rpx;
padding-left: 15rpx;
border: 1rpx solid #ddd;
width: 67%;
height: 57rpx;
line-height: 57rpx;
}
.position {
position: absolute;
bottom: 20rpx;
&:nth-of-type(1) {
right: 30rpx;
}
&:nth-of-type(2) {
right: 180rpx;
}
}
}
.placeholder-style {
line-height: 57rpx;
}
.item {
position: relative;
overflow: hidden;
margin: 40rpx auto 0;
padding: 0 20rpx 15rpx 20rpx;
width: 700rpx;
min-height: 260rpx;
font-size: 28rpx;
background: #fff;
border-radius: 12rpx;
box-shadow: 0px 3px 9px 0px rgba(88, 88, 88, 0.2);
.no {
position: relative;
// padding-right: 50rpx;
width: 100%;
height: 55rpx;
line-height: 55rpx;
text-align: right;
&::after {
content: '';
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 0;
width: 100%;
height: 1rpx;
background: #ddd;
}
}
.round {
position: absolute;
right: 35rpx;
top: 74rpx;
width: 160rpx;
height: 160rpx;
border-radius: 50%;
border: 1px solid;
transform: rotate(-30deg);
>view {
margin: 15rpx auto;
width: 130rpx;
height: 130rpx;
text-align: center;
font-size: 25rpx;
line-height: 130rpx;
border: 1px dashed;
border-radius: 50%;
}
&.green {
border-color: #67c23a;
>view {
border-color: #67c23a;
color: #67c23a;
}
}
&.orange {
border-color: #e6a23c;
>view {
border-color: #e6a23c;
color: #e6a23c;
}
}
&.red {
border-color: #f56c6c;
>view {
border-color: #f56c6c;
color: #f56c6c;
}
}
}
.top-region {
position: relative;
margin-top: 20rpx;
padding-left: 18rpx;
>view {
width: 65%;
text {
font-size: 22rpx;
&:nth-of-type(2) {
float: right;
}
}
}
}
.bottom-region {
margin-top: 50rpx;
text-align: right;
}
}
.content {
min-height: 100%;
}
.order-list .order-item:last-of-type {
margin-bottom: 0;
}
.placeholder-hidden {
opacity: 0;
}
.fixed-t {
// position: fixed;
width: 750upx;
// z-index: 3;
}
.uni-input {
height: 25rpx;
}
.uni-picker {
height: 25rpx;
}
.uni-list-cell-db {
width: 100%;
height: 30rpx;
}
.popup_card_bottom {
display: flex;
justify-content: center;
margin-top: 68rpx;
}
.popup_card_bottom_submit {
background: #FE0505;
color: #ffffff;
font-size: 25rpx;
width: 240rpx;
}
.popup_card_bottom_close {
background: #FFFFFF;
font-size: 25rpx;
width: 240rpx;
}
.popup_card_from_item_right_text {
font-size: 24rpx;
color: #000000;
max-width: 50%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 25rpx;
}
.popup_card_from_item_left_text {
width: 150rpx;
font-size: 24rpx;
color: #666666;
}
.popup_card_from_item {
display: flex;
align-items: center;
margin-bottom: 40rpx;
}
.popup_card_title {
text-align: center;
font-weight: 500;
color: #000000;
font-size: 36rpx;
margin-bottom: 80rpx;
}
.popup_card {
width: 681rpx;
height: 528rpx;
background: #FFFFFF;
border-radius: 15px;
padding: 64rpx;
}
</style>

@ -219,6 +219,16 @@
} }
}] }]
},
{
"root": "packageBill",
"pages": [{
"path": "push/index",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}]
} }
], ],

@ -90,7 +90,7 @@
</view> </view>
<text>{{ item.name }}</text> <text>{{ item.name }}</text>
</view> </view>
<view class="cu-item" @tap="routerTo('/pages/station-price/station-price')"> <!-- <view class="cu-item" @tap="routerTo('/pages/station-price/station-price')">
<view :class="['cuIcon-' + cuIconList[1].cuIcon, 'text-' + cuIconList[1].color]" class="text-sl"> <view :class="['cuIcon-' + cuIconList[1].cuIcon, 'text-' + cuIconList[1].color]" class="text-sl">
<view class="cu-tag badge" v-if="cuIconList[1].badge != 0"> <view class="cu-tag badge" v-if="cuIconList[1].badge != 0">
<block v-if="cuIconList[1].badge != 1"> <block v-if="cuIconList[1].badge != 1">
@ -99,15 +99,10 @@
</view> </view>
</view> </view>
<text>{{ cuIconList[1].name }}</text> <text>{{ cuIconList[1].name }}</text>
</view> </view> -->
<view style="height: 180rpx;display: flex;justify-content: flex-end;" class="cu-item" <view style="height: 180rpx;display: flex;justify-content: flex-end;" class="cu-item"
@tap="routerTo('/pages/escalation/escalation')"> @tap="routerTo('/pages/escalation/escalation')">
<!-- <view :class="['cuIcon-' + cuIconList[2].cuIcon, 'text-' + cuIconList[2].color]" class="text-sl">
<view class="cu-tag badge" v-if="cuIconList[2].badge != 0">
<block v-if="cuIconList[2].badge != 1">
{{ cuIconList[2].badge > 99 ? '99+' : cuIconList[2].badge }}</block>
</view>
</view> -->
<view> <view>
<image style="width: 50rpx;height: 50rpx;" src="/static/img/dzsb.png"></image> <image style="width: 50rpx;height: 50rpx;" src="/static/img/dzsb.png"></image>
</view> </view>
@ -279,7 +274,6 @@
path: '/packageQr/pages/qrsite/QrCode_xy', path: '/packageQr/pages/qrsite/QrCode_xy',
name: '油站二维码' name: '油站二维码'
}, },
{ {
cuIcon: 'punch', cuIcon: 'punch',
path: '/packageQr/pages/partnership/partnership', path: '/packageQr/pages/partnership/partnership',
@ -301,15 +295,17 @@
badge: 0, badge: 0,
name: '交易统计' name: '交易统计'
}, },
] ]
}; };
}, },
onLoad() { // created() {
//console.log('home') // let a = uni.getStorageSync('menusChangeList')
const Menus = uni.getStorageSync('userMenu') // console.log('aaaaaaaaa',a)
this.fistCheck() // },
created() {
let a = uni.getStorageSync('menusChangeList')
console.log('aaaaaaaaa',a)
this.checkInfo()
}, },
filters: { filters: {
@ -346,6 +342,7 @@
changeMenuList(data) { // menus changeMenuList(data) { // menus
const Menus = data const Menus = data
let menusList = [] let menusList = []
// console.log('data',data)
Menus.forEach((item, index, Menus) => { Menus.forEach((item, index, Menus) => {
if (item.roleName != 'ROOT') { if (item.roleName != 'ROOT') {
menusList.push(this.Splicing(item)) //menus menusList.push(this.Splicing(item)) //menus
@ -353,6 +350,7 @@
}) })
uni.setStorageSync('menusChangeList', menusList) uni.setStorageSync('menusChangeList', menusList)
this.menusList = uni.getStorageSync('menusChangeList') this.menusList = uni.getStorageSync('menusChangeList')
this.$emit('changMenus', this.menusList)
}, },
Splicing(list) { Splicing(list) {
let obj = { let obj = {
@ -374,6 +372,13 @@
obj.color = 'orange', obj.color = 'orange',
obj.badge = 0, obj.badge = 0,
obj.name = list.roleName obj.name = list.roleName
} else if (list.roleName == '促销优惠') {
obj.cuIcon = 'moneybag',
obj.path = '',
// /pages/station-price/station-price
obj.color = 'orange',
obj.badge = 0,
obj.name = list.roleName
} else if (list.roleName == '加油订单') { } else if (list.roleName == '加油订单') {
obj.cuIcon = 'form', obj.cuIcon = 'form',
obj.path = '/packageOrders/pages/orderList/orderList', obj.path = '/packageOrders/pages/orderList/orderList',
@ -410,6 +415,12 @@
obj.color = 'blue', obj.color = 'blue',
obj.badge = 0, obj.badge = 0,
obj.name = list.roleName obj.name = list.roleName
} else if (list.roleName == '账单推送') {
obj.cuIcon = 'punch',
obj.path = '/packageBill/push/index',
obj.color = 'blue',
obj.badge = 0
obj.name = list.roleName
} }
return obj return obj
}, },
@ -426,7 +437,7 @@
oliSiteApi.getSiteDetail(channelId).then(res => { oliSiteApi.getSiteDetail(channelId).then(res => {
// //console.log(res) // //console.log(res)
if (res.code === 20000) { if (res.code === 20000) {
console.log(res.data.oil) // console.log(res.data.oil)
this.sitInfo = res.data.site this.sitInfo = res.data.site
this.SiteOliInfo = res.data.oil this.SiteOliInfo = res.data.oil
if (res.data.oil.length < 3) { if (res.data.oil.length < 3) {
@ -467,6 +478,9 @@
this.getSiteInfo(res.data.authTokenDTO.loginUser.channelId) this.getSiteInfo(res.data.authTokenDTO.loginUser.channelId)
this.getUserInfo(id) this.getUserInfo(id)
this.changeMenuList(res.data.authTokenDTO.loginUser.roleMenus) this.changeMenuList(res.data.authTokenDTO.loginUser.roleMenus)
} else if (res.code == 40000) { } else if (res.code == 40000) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/login/boforeLogin/boforeLogin' url: '/pages/login/boforeLogin/boforeLogin'
@ -513,8 +527,7 @@
}) })
}, },
scanQr() { scanQr() {
var scanUrl let scanUrl = '/pages/station-info/scan-camera/scan-camera'
scanUrl = '/pages/station-info/scan-camera/scan-camera'
uni.navigateTo({ uni.navigateTo({
url: scanUrl, url: scanUrl,
fail: (err) => { fail: (err) => {
@ -525,19 +538,7 @@
}, },
}) })
}, },
// 便
// scanQr() {
// uni.setStorageSync('qrCode', 'XM&1299257961238990848')
// uni.navigateTo({
// url: '/pages/stationDetail/stationDetail',
// fail: (err) => {
// //console.log(err)
// },
// success: (res) => {
// //console.log('chengg', res)
// }
// })
// },
checkLogin() { checkLogin() {
const token = uni.getStorageSync('Authorization') const token = uni.getStorageSync('Authorization')
if (!token) { if (!token) {
@ -592,13 +593,6 @@
} }
} }
},
created() {
// onshow,created
//console.log('created')
//console.log(this.menusList)
this.checkInfo()
} }
}; };

@ -1,7 +1,8 @@
<template> <template>
<view class="page-content " :class="(PageCur=='home'||PageCur=='scan')?'my-bg':''"> <view class="page-content " :class="(PageCur=='home'||PageCur=='scan')?'my-bg':''">
<!-- <uni-nav-bar left-icon="back" left-text="返回" right-text="菜单" title="导航栏组件"></uni-nav-bar> --> <!-- <uni-nav-bar left-icon="back" left-text="返回" right-text="菜单" title="导航栏组件"></uni-nav-bar> -->
<home ref='homecheck' v-if="PageCur=='home'||PageCur=='scan'" :user-account="userAccount" @changMenus='changMenus' :site="userAccount" :menusList = 'menusList' :checkUser = 'checkUser'></home> <home ref='homecheck' v-if="PageCur=='home'||PageCur=='scan'" :user-account="userAccount"
@changMenus='changMenus' :site="userAccount" :checkUser='checkUser'></home>
<setup v-if="PageCur=='setup'"></setup> <setup v-if="PageCur=='setup'"></setup>
<view class="bottom-view"> <view class="bottom-view">
<view class="padding-top radius shadow bottom-bar-fixed"> <view class="padding-top radius shadow bottom-bar-fixed">
@ -14,7 +15,8 @@
</view> </view>
<view class="action text-gray add-action" @tap="NavChange" data-cur="scan"> <view class="action text-gray add-action" @tap="NavChange" data-cur="scan">
<button class="cu-btn cuIcon-scan sl shadow" :class="PageCur=='scan'?'bg-main-oil':'bg-gradual-orange'"></button> <button class="cu-btn cuIcon-scan sl shadow"
:class="PageCur=='scan'?'bg-main-oil':'bg-gradual-orange'"></button>
<text :class="PageCur=='scan'?'text-red':'text-gray'"> <text :class="PageCur=='scan'?'text-red':'text-gray'">
一键扫码 一键扫码
</text> </text>
@ -93,20 +95,29 @@
onLoad() { onLoad() {
const token = uni.getStorageSync('Authorization') const token = uni.getStorageSync('Authorization')
if (!token) return if (!token) return
let _that =this
const Menus = uni.getStorageSync('userMenu')
let menusList = []
Menus.forEach((item,index,Menus)=>{
if(item.roleName != 'ROOT' ){
menusList.push(this.Splicing(item))
}
})
let check = uni.getStorageSync('checkFirst') let check = uni.getStorageSync('checkFirst')
if (check) { if (check) {
_that.checkUser = true this.checkUser = true
} }
uni.setStorageSync('menusChangeList',menusList)
this.menusList = menusList this.menusList = uni.getStorageSync('menusChangeList') || []
// const Menus = uni.getStorageSync('userMenu')
// let menusList = []
// Menus.forEach((item, index, Menus) => {
// if (item.roleName != 'ROOT') {
// menusList.push(this.Splicing(item))
// }
// })
// let check = uni.getStorageSync('checkFirst')
// if (check) {
// _that.checkUser = true
// }
// uni.setStorageSync('menusChangeList', menusList)
// this.menusList = menusList
this.longiCheck() this.longiCheck()
this.getPosition() this.getPosition()
}, },
@ -130,7 +141,7 @@
return true return true
}, },
getPosition() { getPosition() {
console.log('getPositiongetPositiongetPositiongetPosition') // console.log('getPositiongetPositiongetPositiongetPosition')
let that = this let that = this
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'gcj02',
@ -146,14 +157,13 @@
this.menusList = data this.menusList = data
}, },
longiCheck() { longiCheck() {
let userInfo = uni.getStorageSync('loginUser'), let userInfo = uni.getStorageSync('loginUser')
_that =this
oliUserApi.getByPhone(userInfo.userPhone).then((res) => { oliUserApi.getByPhone(userInfo.userPhone).then((res) => {
if (res.code == 20000) { if (res.code == 20000) {
_that.checkList = 'show' this.checkList = 'show'
_that.oliList = res.data this.oliList = res.data
_that.changeChannel.username = _that.loginUser.userPhone this.changeChannel.username = this.loginUser.userPhone
_that.changeChannel.unionId = uni.getStorageSync('unionId') this.changeChannel.unionId = uni.getStorageSync('unionId')
} else { } else {
uni.showToast({ uni.showToast({
title: '请求失败,请稍后再试', title: '请求失败,请稍后再试',
@ -224,26 +234,11 @@
}, },
// getSiteInfo() { // getSiteInfo() {
// // // //
// oliSiteApi.getSiteDetail(this.channelId).then(res => { // oliSiteApi.getSiteDetail(this.channelId)
// //console.log('', res)
// uni.stopPullDownRefresh();
// if (res.code === 20000) {
// // this.userAccount = res.data.oil
// this.site = res.data.site
// }
// })
// }, // },
// getUserInfo() { // getUserInfo() {
// // // //
// oliSiteApi.getSiteBasicData(this.channelId).then(res => { // oliSiteApi.getSiteBasicData(this.channelId)
// //console.log('', res)
// uni.stopPullDownRefresh();
// if (res.code === 20000) {
// uni.setStorageSync('ueserList',res.data)
// this.userAccount = res.data
// }
// })
// }, // },
NavChange: function(e) { NavChange: function(e) {
if (!this.checkLogin()) return if (!this.checkLogin()) return
@ -254,19 +249,12 @@
}, },
scanQr() { scanQr() {
var scanUrl let scanUrl = ""
let _that = this
this.menusList.forEach((item, index) => { this.menusList.forEach((item, index) => {
if (item.name === '扫码加油') { if (item.name === '扫码加油') {
scanUrl = '/pages/station-info/scan-camera/scan-camera' scanUrl = '/pages/station-info/scan-camera/scan-camera'
uni.navigateTo({ uni.navigateTo({
url: scanUrl, url: scanUrl
fail: (err) => {
},
success: (res) => {
}
}) })
} }
if ((index == this.userMenu.length - 1) && !scanUrl) { if ((index == this.userMenu.length - 1) && !scanUrl) {

@ -143,12 +143,12 @@
icon: 'none' icon: 'none'
}) })
setTimeout(() => { setTimeout(() => {
uni.navigateBack({ uni.navigateBack({})
})
}, 800) }, 800)
return false; return false;
} }
console.log(tag) // url = '/pages/stationDetail/openStationDetail'
// console.log(tag)
uni.redirectTo({ uni.redirectTo({
// url: `/pages/stationDetail/stationDetail`, // url: `/pages/stationDetail/stationDetail`,
url: url, url: url,

Loading…
Cancel
Save