在搞加密解密
This commit is contained in:
@@ -3,13 +3,13 @@
|
||||
<cu-custom class="main-topbar bg-main-oil" bgColor="bg-main-oil">
|
||||
<block slot="content">星油加油站</block>
|
||||
</cu-custom>
|
||||
<view class="main-money">
|
||||
<view class="main-money bg-main-oil">
|
||||
<view class="padding-xs flex align-center">
|
||||
<view class="flex-sub text-center padding-top-lg">
|
||||
<view class="txet-xxs">
|
||||
<text class="text-white">今日收款(元)</text>
|
||||
</view>
|
||||
<view class=" text-sl padding padding-top-xs"><text class="text-white">{{userAccount.totalMoney?userAccount.totalMoney:'0.00'}}</text></view>
|
||||
<view class=" text-sl padding padding-top-xs"><text class="text-white">¥{{userAccount.totalMoney|numberFilter}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -19,23 +19,25 @@
|
||||
</view>
|
||||
<view class="bg-white radius margin-left margin-right to-top">
|
||||
<view class=" flex ">
|
||||
<view class="padding text-center flex-sub">
|
||||
<text>今日消费笔数</text>
|
||||
<view class="padding text-center flex-sub" @tap="routerTo('/pages/orderList/orderList')">
|
||||
<text>今日收款笔数</text>
|
||||
<view class="padding-sm">
|
||||
{{userAccount.totalCount}}
|
||||
<text class="oil-main-color">{{userAccount.totalCount}}</text>
|
||||
</view>
|
||||
<button class="cu-btn bg-main-oil text-white text-sm ">
|
||||
<!-- <button class="cu-btn bg-main-oil text-white text-sm ">
|
||||
查看明细
|
||||
</button>
|
||||
</button> -->
|
||||
</view>
|
||||
<view class="padding text-center flex-sub">
|
||||
<text>账户余额(元)</text>
|
||||
<view class="padding-sm">
|
||||
x.xx
|
||||
|
||||
<text class="oil-main-color">¥{{userAccount.totalMoney|numberFilter}}</text>
|
||||
|
||||
</view>
|
||||
<button class="cu-btn bg-main-oil text-white text-sm ">
|
||||
<!-- <button class="cu-btn bg-main-oil text-white text-sm ">
|
||||
查看明细
|
||||
</button>
|
||||
</button> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -49,7 +51,15 @@
|
||||
</view>
|
||||
<text>{{ cuIconList[0].name }}</text>
|
||||
</view>
|
||||
<view class="cu-item" @tap="routerTo('/pages/orderList/orderList')">
|
||||
<view class="cu-item" v-show=" item.name !=='经营分析'" v-for="(item,index) in userMenu" :key="item.menuId" @tap="routerTo(item.path,item.name)">
|
||||
<view :class="['cuIcon-' + item.cuIcon, 'text-' + cuIconList[index+1].color]" class="text-sl">
|
||||
<view class="cu-tag badge" v-if="item.badge != 0">
|
||||
<block v-if="item.badge != 1">{{ item.badge > 99 ? '99+' : item.badge }}</block>
|
||||
</view>
|
||||
</view>
|
||||
<text>{{ item.name }}</text>
|
||||
</view>
|
||||
<!-- <view class="cu-item" @tap="routerTo('/pages/orderList/orderList')">
|
||||
<view :class="['cuIcon-' + cuIconList[1].cuIcon, 'text-' + cuIconList[1].color]" class="text-sl">
|
||||
<view class="cu-tag badge" v-if="cuIconList[1].badge != 0">
|
||||
<block v-if="cuIconList[1].badge != 1">{{ cuIconList[1].badge > 99 ? '99+' : cuIconList[1].badge }}</block>
|
||||
@@ -80,15 +90,8 @@
|
||||
</view>
|
||||
</view>
|
||||
<text>{{ cuIconList[4].name }}</text>
|
||||
</view>
|
||||
<view class="cu-item">
|
||||
<view :class="['cuIcon-' + cuIconList[5].cuIcon, 'text-' + cuIconList[5].color]" class="text-sl">
|
||||
<view class="cu-tag badge" v-if="cuIconList[5].badge != 0">
|
||||
<block v-if="cuIconList[5].badge != 1">{{ cuIconList[5].badge > 99 ? '99+' : cuIconList[5].badge }}</block>
|
||||
</view>
|
||||
</view>
|
||||
<text>{{ cuIconList[5].name }}</text>
|
||||
</view>
|
||||
</view>-->
|
||||
|
||||
<view class="padding-bottom-xl">
|
||||
|
||||
</view>
|
||||
@@ -97,6 +100,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import staffApi from '@/api/staff.js'
|
||||
import cloudSiteApi from '@/api/cloud-site.js'
|
||||
export default {
|
||||
data() {
|
||||
@@ -105,6 +109,9 @@
|
||||
totalCount: 0,
|
||||
totalMoney: 0.00
|
||||
},
|
||||
scanUrl: '',
|
||||
userMenu: uni.getStorageSync('userMenu'),
|
||||
loginUser: uni.getStorageSync('loginUser'),
|
||||
title: 'Hello',
|
||||
cuIconList: [{
|
||||
cuIcon: 'location',
|
||||
@@ -153,38 +160,88 @@
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
uni.showShareMenu()
|
||||
this.getUserInfo()
|
||||
this.getSiteInfo()
|
||||
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.getUserInfo()
|
||||
},
|
||||
filters: {
|
||||
numberFilter(value) {
|
||||
value = value - 1 + 1
|
||||
return value.toFixed(2)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getSiteInfo() {
|
||||
cloudSiteApi.getSiteDetail().then(res => {
|
||||
if (res.code === 20000) {
|
||||
this.site = res.data.site
|
||||
this.oilList = res.data.oil
|
||||
uni.setStorage({
|
||||
key: 'oilSite',
|
||||
data: res.data.site
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserInfo() {
|
||||
cloudSiteApi.getSiteBasicData().then(res => {
|
||||
console.log('用户资料', res)
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.code === 20000) {
|
||||
this.userAccount = res.data
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
scanQr() {
|
||||
var that = this
|
||||
uni.scanCode({
|
||||
onlyFromCamera: true,
|
||||
success: function(res) {
|
||||
console.log('条码类型:' + res.scanType);
|
||||
console.log('条码内容:' + res.result);
|
||||
uni.setStorageSync('qrCode', res.result)
|
||||
uni.navigateTo({
|
||||
url: '/pages/stationDetail/stationDetail'
|
||||
url: that.scanUrl,
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
},
|
||||
success: (res) => {
|
||||
console.log('chengg', res)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
routerTo(url) {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
})
|
||||
// 方便开发
|
||||
// scanQr() {
|
||||
// uni.setStorageSync('qrCode', 'XM&1299257961238990848')
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/stationDetail/stationDetail',
|
||||
// fail: (err) => {
|
||||
// console.log(err)
|
||||
// },
|
||||
// success: (res) => {
|
||||
// console.log('chengg', res)
|
||||
// }
|
||||
// })
|
||||
|
||||
// },
|
||||
routerTo(url, name) {
|
||||
if (name === '扫码加油') {
|
||||
this.scanUrl = url
|
||||
this.scanQr()
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user