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

248 lines
4.6 KiB

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