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

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