加油站付款小程序,打印小票
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.

245 lines
4.5 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="">
  3. <uni-nav-bar dark :fixed="true" background-color="#00aaff" :border="false" status-bar title="个人中心" />
  4. <view class="content">
  5. <view class="topBox">
  6. <view class="users">
  7. <view class="u-top" v-if="userInfo.appletOpenid">
  8. <image class="img" :src="userInfo.headImage" mode="widthFix"></image>
  9. <view class="tit">
  10. {{ userInfo.nickName }}
  11. </view>
  12. </view>
  13. <view class="u-top" v-else>
  14. <image class="img"
  15. src="https://img2.baidu.com/it/u=2953585264,744730101&fm=253&fmt=auto&app=138&f=JPEG?w=360&h=360"
  16. mode="widthFix"></image>
  17. <view class="tit">
  18. 登录 / 注册
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="listBox">
  24. <view class="lists">
  25. <uni-section title="我的订单" type="line" titleFontSize="34rpx"
  26. style="border-radius: 10rpx;"></uni-section>
  27. <view class="order-list">
  28. <view v-for="(item,index) in orderList" :key="item.id" class="order-item">
  29. <view class="order-item-top">
  30. <view class="order-id">{{ item.id }}</view>
  31. <view class="time">{{ item.createTime }}</view>
  32. </view>
  33. <div class="order-item-main">
  34. <div class="title">付款金额</div>
  35. <view class="money-detail">
  36. <view class="unie"></view>
  37. <view class="number">{{ item.price }}</view>
  38. </view>
  39. </div>
  40. </view>
  41. </view>
  42. <view v-if="false" class="no-data">
  43. <image src="@/static/empty/noData.png" mode=""></image>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. import {
  52. mapState
  53. } from 'vuex'
  54. export default {
  55. name: 'Center',
  56. computed: {
  57. ...mapState(['userInfo']),
  58. },
  59. data() {
  60. return {
  61. queryParams: {
  62. pageNo: 1,
  63. pageSize: 10
  64. },
  65. orderList: [],
  66. total : 0
  67. }
  68. },
  69. onShow() {
  70. if (uni.getStorageSync('token')) {
  71. this.$store.commit('getUserInfo')
  72. }
  73. this.getOrderList()
  74. },
  75. //滚动到屏幕底部
  76. onReachBottom() {
  77. if(this.queryParams.pageSize < this.total){
  78. this.queryParams.pageSize += 10
  79. this.getOrderList()
  80. }
  81. },
  82. methods: {
  83. //获取订单列表
  84. getOrderList() {
  85. this.$api('getOrderWaterPage', this.queryParams, res => {
  86. this.orderList = res.result.records
  87. this.total = res.result.total
  88. })
  89. },
  90. }
  91. }
  92. </script>
  93. <style scoped>
  94. .content {
  95. background: #F1F5F8;
  96. min-height: 100vh;
  97. }
  98. /* 弧形背景 */
  99. .topBox {
  100. width: 100%;
  101. position: relative;
  102. z-index: 1;
  103. overflow: hidden;
  104. padding: 60rpx 20rpx 20rpx;
  105. box-sizing: border-box;
  106. }
  107. .topBox::after {
  108. content: "";
  109. width: 140%;
  110. height: 100px;
  111. position: absolute;
  112. left: -20%;
  113. top: 0;
  114. z-index: -1;
  115. border-radius: 0 0 30% 50%;
  116. background: #00aaff;
  117. }
  118. .txt {
  119. color: #fff;
  120. font-size: 30rpx;
  121. }
  122. .set-right .uni-icons {
  123. margin-right: 10rpx;
  124. }
  125. .users {
  126. display: flex;
  127. align-items: center;
  128. margin-top: 0rpx;
  129. padding: 0rpx 30rpx;
  130. box-sizing: border-box;
  131. height: 200rpx;
  132. background-color: #fff;
  133. box-shadow: 1px 10rpx 20rpx #ececec;
  134. border-radius: 12rpx;
  135. }
  136. .u-top {
  137. display: flex;
  138. justify-content: flex-start;
  139. align-items: center;
  140. }
  141. .users .u-top .img {
  142. width: 130rpx;
  143. height: 130rpx;
  144. border-radius: 50%;
  145. margin-right: 20rpx;
  146. }
  147. .u-top .tit {
  148. font-size: 30rpx;
  149. font-weight: 700;
  150. color: #333;
  151. }
  152. .u-item {
  153. text-align: center;
  154. }
  155. .u-item .u-tit {
  156. color: #757575;
  157. font-size: 26rpx;
  158. margin-top: 10rpx;
  159. }
  160. .u-item .num {
  161. color: #000000;
  162. font-size: 33rpx;
  163. font-weight: 700;
  164. }
  165. .bottomBox {
  166. padding: 20rpx;
  167. box-sizing: border-box;
  168. }
  169. .order-list {
  170. padding-top: 20rpx;
  171. }
  172. .order-item {
  173. width: 100%;
  174. background: white;
  175. border-radius: 20rpx;
  176. margin-bottom: 20rpx;
  177. }
  178. .order-item .order-item-top {
  179. display: flex;
  180. align-items: center;
  181. justify-content: space-between;
  182. height: 80rpx;
  183. font-size: 24rpx;
  184. box-sizing: border-box;
  185. padding: 0rpx 20rpx;
  186. }
  187. .order-item .order-item-main {
  188. padding: 60rpx 0rpx;
  189. display: flex;
  190. flex-direction: column;
  191. align-items: center;
  192. }
  193. .order-item-main .title {
  194. color: #5a5a5a;
  195. }
  196. .order-item-main .money-detail {
  197. display: flex;
  198. align-items: center;
  199. margin-top: 20rpx;
  200. }
  201. .money-detail .unit {
  202. font-size: 34rpx;
  203. }
  204. .money-detail .number {
  205. font-size: 60rpx;
  206. }
  207. .no-data {
  208. padding: 30rpx;
  209. box-sizing: border-box;
  210. background-color: #fff;
  211. display: flex;
  212. justify-content: space-around;
  213. align-items: center;
  214. }
  215. .listBox {
  216. margin: -10rpx auto 0;
  217. padding: 20rpx;
  218. box-sizing: border-box;
  219. border-radius: 20rpx;
  220. }
  221. </style>