mine.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view class="base-container">
  3. <view class="user-info">
  4. <view class="user-left">
  5. <image class="avatar" :src="userInfo.icon"></image>
  6. <view class="info">
  7. <text class="name">{{userInfo.nickname || userInfo.name}}</text>
  8. <view class="text">这是您使用飞鸟有味的第15天</view>
  9. </view>
  10. </view>
  11. <view class="user-right">收货地址</view>
  12. </view>
  13. <view class="grid-wrap">
  14. <view class="grid-item" @click="handlePage('0')">
  15. <view class="grid-name">守护兑换</view>
  16. <text class="grid-text">积累能量获大礼</text>
  17. <image class="image" :src="`${config.BASIC_IMG}img/gift.png`"></image>
  18. </view>
  19. <view class="grid-item coupon" @click="handlePage('1')">
  20. <view class="grid-name">优惠券</view>
  21. <text class="grid-text">满100减50</text>
  22. <image class="icon" :src="`${config.BASIC_IMG}img/coupon.png`"></image>
  23. </view>
  24. </view>
  25. <view class="list-wrap">
  26. <view class="list-card">
  27. <view class="card-head flex-center">
  28. <text class="name">我的订单</text>
  29. <view class="all flex-center">
  30. <text>全部</text>
  31. <up-icon name="arrow-right"></up-icon>
  32. </view>
  33. </view>
  34. <view class="card-cont flex-center">
  35. <view class="cont-item" v-for="(item,index) in orderList" :key="index" @click="handleItem(index)">
  36. <image class="icon" :src="`${config.BASIC_IMG}img/order-icon-${index+1}.png`"></image>
  37. <view>{{item}}</view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="list-card">
  42. <view class="card-head flex-center">
  43. <text class="name">我的守护</text>
  44. <view class="all flex-center">
  45. <text>全部</text>
  46. <up-icon name="arrow-right"></up-icon>
  47. </view>
  48. </view>
  49. <view class="card-cont flex-center">
  50. <view class="cont-item image-item" v-for="(item,index) in 3" :key="index">
  51. <image class="img" :src="`https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png`"></image>
  52. <view class="name">从化荔博园</view>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="list-item flex-center">
  57. <text class="name">联系客服</text>
  58. <up-icon name="arrow-right"></up-icon>
  59. </view>
  60. <view class="list-item flex-center">
  61. <text class="name">意见反馈</text>
  62. <up-icon name="arrow-right"></up-icon>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script setup>
  68. import config from "@/api/config.js"
  69. import { onLoad } from '@dcloudio/uni-app'
  70. const orderList = ["待付款","待发货","待收货","待评价","退款/售后"]
  71. const imageList = []
  72. const handlePage = (type) =>{
  73. uni.navigateTo({
  74. url: `/pages/tabBar/mine/subPages/exchange?type=${type}`
  75. });
  76. }
  77. const handleItem = (status) =>{
  78. uni.navigateTo({
  79. url: `/pages/tabBar/mine/subPages/order?status=${status + 1}`
  80. });
  81. }
  82. const userInfo = uni.getStorageSync('userInfo')
  83. onLoad(()=>{
  84. console.log(userInfo)
  85. })
  86. </script>
  87. <style lang="scss" scoped>
  88. .base-container {
  89. .user-info {
  90. background: #fff;
  91. border-radius: 16rpx;
  92. padding: 24rpx;
  93. display: flex;
  94. align-items: center;
  95. justify-content: space-between;
  96. .user-left{
  97. display: flex;
  98. align-items: center;
  99. .avatar{
  100. width: 92rpx;
  101. height: 92rpx;
  102. margin-right: 28rpx;
  103. border-radius: 50%;
  104. }
  105. .info{
  106. .name{
  107. font-family: 'PangMenZhengDao';
  108. }
  109. .text{
  110. font-size: 24rpx;
  111. }
  112. }
  113. }
  114. .user-right{
  115. font-size: 24rpx;
  116. padding: 12rpx 32rpx;
  117. border-radius: 50rpx;
  118. color: #000;
  119. background: #FFD95E;
  120. font-weight: 500;
  121. }
  122. }
  123. .grid-wrap{
  124. display: flex;
  125. margin-top: 20rpx;
  126. .grid-item{
  127. padding: 20rpx 28rpx;
  128. flex: 1;
  129. border-radius: 16rpx;
  130. border: 2rpx solid #FFFFFF;
  131. background-image: linear-gradient(180deg,#FFECAE,#FFFFFF);
  132. line-height: 42rpx;
  133. position: relative;
  134. &.coupon{
  135. margin-left: 18rpx;
  136. background-image: linear-gradient(180deg,#FFDFC5,#FFFFFF);
  137. }
  138. .grid-name{
  139. font-family: 'PangMenZhengDao';
  140. }
  141. .grid-text{
  142. font-size: 24rpx;
  143. }
  144. .image{
  145. position: absolute;
  146. bottom: 0;
  147. right: 0;
  148. width: 110rpx;
  149. height: 120rpx;
  150. }
  151. .icon{
  152. position: absolute;
  153. bottom: 0;
  154. right: 0;
  155. width: 110rpx;
  156. height: 110rpx
  157. }
  158. }
  159. }
  160. .list-wrap{
  161. .list-item,.list-card{
  162. background: #fff;
  163. border-radius: 10rpx;
  164. margin-top: 20rpx;
  165. padding: 26rpx 20rpx;
  166. .name{
  167. font-weight: 500;
  168. }
  169. .all{
  170. color: rgba(0, 0, 0, 0.6);
  171. font-size: 26rpx;
  172. }
  173. .card-cont{
  174. margin-top: 20rpx;
  175. .cont-item{
  176. flex: 1;
  177. text-align: center;
  178. font-size: 24rpx;
  179. .icon{
  180. width: 36rpx;
  181. height: 32rpx;
  182. margin-bottom: 4rpx;
  183. }
  184. }
  185. .image-item{
  186. border-radius: 16rpx;
  187. border: 1px solid #E3E3E3;
  188. padding: 10rpx;
  189. position: relative;
  190. .img{
  191. width: 100%;
  192. height: 180rpx;
  193. border-radius: 8rpx;
  194. }
  195. .name{
  196. position: absolute;
  197. bottom: 0;
  198. left: 0;
  199. color: #fff;
  200. padding: 6rpx;
  201. width: 100%;
  202. box-sizing: border-box;
  203. border-radius: 0 0 16rpx 16rpx;
  204. text-align: center;
  205. background: rgba(0, 0, 0, 0.3);
  206. backdrop-filter: blur(6rpx);
  207. }
  208. }
  209. .image-item + .image-item{
  210. margin-left: 20rpx;
  211. }
  212. }
  213. }
  214. .flex-center{
  215. display: flex;
  216. align-items: center;
  217. justify-content: space-between;
  218. }
  219. }
  220. }
  221. </style>