加油站付款小程序,打印小票
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

320 lines
6.6 KiB

<template>
<view class="">
<uni-nav-bar dark :fixed="true" background-color="#00aaff" :border="false" status-bar title="个人中心" />
<view class="content">
<!-- <view class="topBox">
<view class="users">
<view class="u-top" v-if="userInfo.appletOpenid">
<image class="img" :src="userInfo.headImage" mode="widthFix"></image>
<view class="tit">
{{ userInfo.nickName }}
</view>
</view>
<view class="u-top" v-else
@click="">
<image class="img"
src="https://img2.baidu.com/it/u=2953585264,744730101&fm=253&fmt=auto&app=138&f=JPEG?w=360&h=360"
mode="widthFix"></image>
<view class="tit">
登录 / 注册
</view>
</view>
</view>
</view> -->
<view class="topBox">
<view class="users">
<view class="u-top" @click="$utils.navigateTo('/login/wxUserInfo')" v-if="userInfo.appletOpenid">
<image class="img" :src="userInfo.headImage" mode="widthFix"></image>
<view class="tit">
{{ userInfo.nickName }}
</view>
</view>
<view class="u-top" v-else @click="$utils.navigateTo('/login/login')">
<image class="img"
src="https://img2.baidu.com/it/u=2953585264,744730101&fm=253&fmt=auto&app=138&f=JPEG?w=360&h=360"
mode="widthFix"></image>
<view class="tit">
登录 / 注册
</view>
</view>
<view style="margin-left: auto;
color: #00aaff;"
@click="toPromotion">
推广
</view>
</view>
</view>
<view class="listBox">
<view class="lists">
<!-- <uni-section v-if="isAdminResult" @click="toPromotion" title="推广" type="line" titleFontSize="34rpx"
style="border-radius: 10rpx;"></uni-section> -->
<!-- <view class="">
<uv-cell icon="setting-fill"
iconStyle="font-size: 36rpx;"
isLink
title="个人设置"></uv-cell>
</view> -->
<!-- <view class="order-item">
<div class="order-item-main">
<div class="title">推广二维码</div>
</div>
</view> -->
<uni-section title="我的订单" type="line" titleFontSize="34rpx"
style="border-radius: 10rpx;"></uni-section>
<view class="order-list">
<view v-for="(item,index) in orderList" :key="item.id" class="order-item">
<view class="order-item-top">
<view class="time">{{ item.createTime }}</view>
<view class="time">{{ item.state_dictText }}</view>
</view>
<div class="order-item-main">
<div class="title">付款金额</div>
<view class="money-detail">
<view class="unie">¥</view>
<view class="number">{{ item.price }}</view>
<view class="oldPrice">{{ item.oldPrice }}</view>
</view>
</div>
<view class="order-item-top">
<view class="order-id">订单号:{{ item.id }}</view>
</view>
<view class="order-item-top">
<view class="order-id">站点:{{ item.shopId }}</view>
</view>
<view class="order-item-top">
<view class="order-id">油号:{{ item.name }}</view>
</view>
</view>
</view>
<view v-if="false" class="no-data">
<image src="@/static/empty/noData.png" mode=""></image>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
mapState
} from 'vuex'
export default {
name: 'Center',
computed: {
...mapState(['userInfo']),
},
data() {
return {
queryParams: {
pageNo: 1,
pageSize: 10
},
orderList: [],
total: 0,
isAdminResult : false,
}
},
onShow() {
if (uni.getStorageSync('token')) {
this.$store.commit('getUserInfo')
this.getOrderList()
this.isAdmin()
}
},
//滚动到屏幕底部
onReachBottom() {
if (this.queryParams.pageSize < this.total) {
this.queryParams.pageSize += 10
this.getOrderList()
}
},
methods: {
//获取订单列表
getOrderList() {
this.$api('twogetOrderWaterPage', this.queryParams, res => {
this.orderList = res.result.records
this.total = res.result.total
})
},
//检查是否为管理员
isAdmin() {
this.$api('isAdmin', res => {
if(res.code == 200){
this.isAdminResult = !!res.result
}
})
},
//跳转推广页面
toPromotion(){
uni.navigateTo({
url: '/pages/promotion/promotion'
})
}
}
}
</script>
<style scoped>
.content {
background: #F1F5F8;
min-height: 100vh;
}
/* 弧形背景 */
.topBox {
width: 100%;
position: relative;
z-index: 1;
overflow: hidden;
padding: 60rpx 20rpx 20rpx;
box-sizing: border-box;
}
.topBox::after {
content: "";
width: 140%;
height: 100px;
position: absolute;
left: -20%;
top: 0;
z-index: -1;
border-radius: 0 0 30% 50%;
background: #00aaff;
}
.txt {
color: #fff;
font-size: 30rpx;
}
.set-right .uni-icons {
margin-right: 10rpx;
}
.users {
display: flex;
align-items: center;
margin-top: 0rpx;
padding: 0rpx 30rpx;
box-sizing: border-box;
height: 200rpx;
background-color: #fff;
box-shadow: 1px 10rpx 20rpx #ececec;
border-radius: 12rpx;
}
.u-top {
display: flex;
justify-content: flex-start;
align-items: center;
}
.users .u-top .img {
width: 130rpx;
height: 130rpx;
border-radius: 50%;
margin-right: 20rpx;
}
.u-top .tit {
font-size: 30rpx;
font-weight: 700;
color: #333;
}
.u-item {
text-align: center;
}
.u-item .u-tit {
color: #757575;
font-size: 26rpx;
margin-top: 10rpx;
}
.u-item .num {
color: #000000;
font-size: 33rpx;
font-weight: 700;
}
.bottomBox {
padding: 20rpx;
box-sizing: border-box;
}
.order-list {
padding-top: 20rpx;
}
.order-item {
background: white;
border-radius: 20rpx;
margin-bottom: 20rpx;
padding: 20rpx;
}
.order-item .order-item-top {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 24rpx;
box-sizing: border-box;
padding: 10rpx 20rpx;
}
.order-item .order-item-main {
padding: 60rpx 0rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.order-item-main .title {
color: #5a5a5a;
}
.order-item-main .money-detail {
display: flex;
align-items: center;
margin-top: 20rpx;
}
.oldPrice {
margin-left: 10rpx;
color: #757575;
text-decoration: line-through;
}
.money-detail .unit {
font-size: 34rpx;
}
.money-detail .number {
font-size: 60rpx;
}
.no-data {
padding: 30rpx;
box-sizing: border-box;
background-color: #fff;
display: flex;
justify-content: space-around;
align-items: center;
}
.listBox {
margin: -10rpx auto 0;
padding: 20rpx;
box-sizing: border-box;
border-radius: 20rpx;
}
</style>