知识付费微信小程序
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.

242 lines
4.5 KiB

  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. }
  67. },
  68. onShow() {
  69. // if (uni.getStorageSync('token')) {
  70. // this.$store.commit('getUserInfo')
  71. // }
  72. // this.getOrderList()
  73. },
  74. //滚动到屏幕底部
  75. onReachBottom() {
  76. this.queryParams.pageSize += 10
  77. this.getOrderList()
  78. },
  79. methods: {
  80. //获取订单列表
  81. getOrderList() {
  82. this.$api('getOrderWaterPage', this.queryParams, res => {
  83. this.orderList = res.result.records
  84. })
  85. },
  86. }
  87. }
  88. </script>
  89. <style scoped>
  90. .content {
  91. background: #F1F5F8;
  92. min-height: 100vh;
  93. }
  94. /* 弧形背景 */
  95. .topBox {
  96. width: 100%;
  97. position: relative;
  98. z-index: 1;
  99. overflow: hidden;
  100. padding: 60rpx 20rpx 20rpx;
  101. box-sizing: border-box;
  102. }
  103. .topBox::after {
  104. content: "";
  105. width: 140%;
  106. height: 100px;
  107. position: absolute;
  108. left: -20%;
  109. top: 0;
  110. z-index: -1;
  111. border-radius: 0 0 30% 50%;
  112. /* background: #00aaff; */
  113. background: #000;
  114. }
  115. .txt {
  116. color: #fff;
  117. font-size: 30rpx;
  118. }
  119. .set-right .uni-icons {
  120. margin-right: 10rpx;
  121. }
  122. .users {
  123. display: flex;
  124. align-items: center;
  125. margin-top: 0rpx;
  126. padding: 0rpx 30rpx;
  127. box-sizing: border-box;
  128. height: 200rpx;
  129. background-color: #fff;
  130. box-shadow: 1px 10rpx 20rpx #ececec;
  131. border-radius: 12rpx;
  132. }
  133. .u-top {
  134. display: flex;
  135. justify-content: flex-start;
  136. align-items: center;
  137. }
  138. .users .u-top .img {
  139. width: 130rpx;
  140. height: 130rpx;
  141. border-radius: 50%;
  142. margin-right: 20rpx;
  143. }
  144. .u-top .tit {
  145. font-size: 30rpx;
  146. font-weight: 700;
  147. color: #333;
  148. }
  149. .u-item {
  150. text-align: center;
  151. }
  152. .u-item .u-tit {
  153. color: #757575;
  154. font-size: 26rpx;
  155. margin-top: 10rpx;
  156. }
  157. .u-item .num {
  158. color: #000000;
  159. font-size: 33rpx;
  160. font-weight: 700;
  161. }
  162. .bottomBox {
  163. padding: 20rpx;
  164. box-sizing: border-box;
  165. }
  166. .order-list {
  167. padding-top: 20rpx;
  168. }
  169. .order-item {
  170. width: 100%;
  171. background: white;
  172. border-radius: 20rpx;
  173. margin-bottom: 20rpx;
  174. }
  175. .order-item .order-item-top {
  176. display: flex;
  177. align-items: center;
  178. justify-content: space-between;
  179. height: 80rpx;
  180. font-size: 24rpx;
  181. box-sizing: border-box;
  182. padding: 0rpx 20rpx;
  183. }
  184. .order-item .order-item-main {
  185. padding: 60rpx 0rpx;
  186. display: flex;
  187. flex-direction: column;
  188. align-items: center;
  189. }
  190. .order-item-main .title {
  191. color: #5a5a5a;
  192. }
  193. .order-item-main .money-detail {
  194. display: flex;
  195. align-items: center;
  196. margin-top: 20rpx;
  197. }
  198. .money-detail .unit {
  199. font-size: 34rpx;
  200. }
  201. .money-detail .number {
  202. font-size: 60rpx;
  203. }
  204. .no-data {
  205. padding: 30rpx;
  206. box-sizing: border-box;
  207. background-color: #fff;
  208. display: flex;
  209. justify-content: space-around;
  210. align-items: center;
  211. }
  212. .listBox {
  213. margin: -10rpx auto 0;
  214. padding: 20rpx;
  215. box-sizing: border-box;
  216. border-radius: 20rpx;
  217. }
  218. </style>