3
0

index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <view class="content">
  3. <custom-layout ref="layout" :showBottom="true" :back="{show:false}" title="我的" :show-page-bottom="false"
  4. v-model="dataList" :showLoadingNomore="false" @layoutquery="onQueryList">
  5. <template #content>
  6. <view class="mine_top mt10">
  7. <view class="mine_top_left">
  8. <up-avatar :src="userImage" size="120rpx"></up-avatar>
  9. <view class="mine_t_l_text">清风灼月lqy</view>
  10. </view>
  11. <view class="mine_top_right">
  12. <view class="mine_t_r_t">积分</view>
  13. <view class="mine_t_r_c mt6 mb8">119</view>
  14. <view class="mine_t_r_b" @click="onRecharge">充值</view>
  15. </view>
  16. </view>
  17. <view class="mine_order">
  18. <view class="mine_order_box pb16">
  19. <view class="flx-justify-between p10 pt20 pb20">
  20. <view class=" flx-align-center">
  21. <view class="section_icon mr10"></view>
  22. <text class="section_text">我的订单</text>
  23. </view>
  24. <uni-icons type="right" size="20"></uni-icons>
  25. </view>
  26. <view class="mine_order_list" :width="nvueWidth">
  27. <view class="mine_order_list_item" v-for="(item,index) in orderList" :key="index">
  28. <view class="order_item_icon" :style="`background-image:url(${item.icon})`"></view>
  29. <text class="order_item_text mt10">{{item.name}}</text>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="mine_nav mt10">
  35. <view class="mine_nav_box">
  36. <view class="flx-justify-between pt10 pl10 pr10">
  37. <view class="flx-align-center">
  38. <view class="section_icon mr10"></view>
  39. <text class="section_text">小印工具箱</text>
  40. </view>
  41. </view>
  42. <view class="mine_nav_box_item pb10 pl20 pr20">
  43. <view class="flx-justify-between pt14 pb14"
  44. :class="index < toolList.length - 1 ?'border_bottom':''"
  45. v-for="(item,index) in toolList" :key="index">
  46. <text class="nav_box_title">{{item.name}}</text>
  47. <uni-icons type="right" size="20"></uni-icons>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. </custom-layout>
  54. </view>
  55. </template>
  56. <script setup>
  57. import {
  58. ref,
  59. reactive,
  60. onMounted
  61. } from 'vue';
  62. import {
  63. onShow
  64. } from "@dcloudio/uni-app";
  65. // 引入组件
  66. import order1 from '~@/static/images/order1.png'
  67. import order2 from '@/static/images/order2.png'
  68. import order3 from '@/static/images/order3.png'
  69. import order4 from '@/static/images/order4.png'
  70. const userImage = 'https://img.js.design/assets/img/65b211c3cdb6ea326421fd30.png'
  71. // 定义变量内容
  72. const orderList = reactive([{
  73. id: '1',
  74. name: '待支付',
  75. icon: order1
  76. },
  77. {
  78. id: '2',
  79. name: '待打印',
  80. icon: order2
  81. },
  82. {
  83. id: '3',
  84. name: '待配送',
  85. icon: order3
  86. },
  87. {
  88. id: '4',
  89. name: '已完成',
  90. icon: order4
  91. },
  92. ])
  93. const toolList = reactive([{
  94. id: '1',
  95. name: '我的设计',
  96. icon: order1
  97. },
  98. {
  99. id: '2',
  100. name: '我的贴纸',
  101. icon: order2
  102. },
  103. {
  104. id: '3',
  105. name: '我的分享',
  106. icon: order3
  107. },
  108. {
  109. id: '4',
  110. name: '邀请好友',
  111. icon: order4
  112. },
  113. ])
  114. // 跳转充值页面
  115. const onRecharge = () => {
  116. uni.navigateTo({
  117. url: '/pages/mine/recharge',
  118. })
  119. }
  120. // 业务列表
  121. const dataList = ref([{}])
  122. const num = ref(1)
  123. const layout = ref()
  124. const onQueryList = (event) => {
  125. const {
  126. pageNo,
  127. pageSize
  128. } = event
  129. if (pageNo > 1) {
  130. if (num.value < 2) {
  131. num.value++
  132. layout.value.complete(dataList.value);
  133. } else {
  134. layout.value.complete([]);
  135. }
  136. } else {
  137. num.value = 2
  138. layout.value.complete(dataList.value);
  139. }
  140. }
  141. // 生命中期
  142. onMounted(() => {
  143. console.log('onMounted生命周期')
  144. })
  145. </script>
  146. <style lang="scss" scoped>
  147. .mine_top {
  148. display: flex;
  149. justify-content: space-between;
  150. padding: 30rpx;
  151. box-sizing: border-box;
  152. .mine_top_left {
  153. display: flex;
  154. align-items: center;
  155. .mine_t_l {
  156. width: 120rpx;
  157. height: 120rpx;
  158. }
  159. .mine_t_l_text {
  160. font-size: 36rpx;
  161. font-weight: 600;
  162. letter-spacing: 0rpx;
  163. line-height: 47.74rpx;
  164. color: rgba(59, 59, 59, 1);
  165. text-align: left;
  166. vertical-align: top;
  167. margin-left: 30rpx;
  168. }
  169. }
  170. .mine_top_right {
  171. display: flex;
  172. flex-direction: column;
  173. align-items: center;
  174. .mine_t_r_t {
  175. font-size: 24rpx;
  176. font-weight: 400;
  177. letter-spacing: 0rpx;
  178. line-height: 31.82rpx;
  179. color: rgba(59, 59, 59, 1);
  180. }
  181. .mine_t_r_c {
  182. font-size: 36rpx;
  183. font-weight: 600;
  184. color: rgba(59, 59, 59, 1);
  185. }
  186. .mine_t_r_b {
  187. width: 80rpx;
  188. height: 46rpx;
  189. opacity: 1;
  190. border-radius: 348rpx;
  191. background: rgba(120, 245, 199, 1);
  192. text-align: center;
  193. font-size: 24rpx;
  194. font-weight: 500;
  195. letter-spacing: 0rpx;
  196. line-height: 46rpx;
  197. color: rgba(6, 97, 91, 1);
  198. }
  199. }
  200. }
  201. .section_text {
  202. font-size: 32rpx;
  203. font-weight: 600;
  204. letter-spacing: 0rpx;
  205. line-height: 42.44rpx;
  206. color: rgba(59, 59, 59, 1);
  207. }
  208. .mine_order {
  209. padding: 0 30rpx;
  210. box-sizing: border-box;
  211. .mine_order_box {
  212. background-color: #fff;
  213. border-radius: 10rpx;
  214. .mine_order_list {
  215. display: flex;
  216. width: 100%;
  217. .mine_order_list_item {
  218. width: calc(100% / 4);
  219. display: flex;
  220. flex-direction: column;
  221. justify-content: center;
  222. align-items: center;
  223. .order_item_icon {
  224. width: 56rpx;
  225. height: 56rpx;
  226. background-size: 100% 100%;
  227. }
  228. .order_item_text {
  229. font-size: 26rpx;
  230. font-weight: 400;
  231. letter-spacing: 0rpx;
  232. line-height: 30.48rpx;
  233. color: rgba(59, 59, 59, 1);
  234. text-align: center;
  235. }
  236. }
  237. }
  238. }
  239. }
  240. .mine_nav {
  241. padding: 0 30rpx;
  242. box-sizing: border-box;
  243. .mine_nav_box {
  244. background-color: #fff;
  245. border-radius: 10rpx;
  246. overflow: hidden;
  247. .mine_nav_box_item {
  248. .nav_box_title {
  249. font-size: 28rpx;
  250. font-weight: 400;
  251. color: rgba(59, 59, 59, 1);
  252. padding-left: 20rpx;
  253. box-sizing: border-box;
  254. }
  255. }
  256. }
  257. }
  258. </style>