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

280 lines
5.6 KiB

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