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

319 lines
6.6 KiB

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