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

275 lines
5.3 KiB

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