敢为人鲜小程序前端代码仓库
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.

334 lines
10 KiB

  1. <template>
  2. <view class="center-page">
  3. <!-- 顶部背景和个人信息 -->
  4. <view class="header" :style="{ 'background-image': 'url(/static/image/红烧肉.png)' }">
  5. <view class="user-info">
  6. <image class="avatar" :src="userInfo.avatarUrl" mode="aspectFill"></image>
  7. <view class="user-name-id">
  8. <text class="user-name">{{ userInfo.nickName }}</text>
  9. <text class="user-id">ID:{{ userInfo.userId }}</text>
  10. </view>
  11. </view>
  12. <view class="role-switch-btn">
  13. <uv-icon name="reload" size="30rpx" color="#fff" style="margin-right: 6rpx;" />
  14. <text>切换为{{ userInfo.role }}</text>
  15. </view>
  16. </view>
  17. <!-- 我的订单区域 -->
  18. <view class="orders-section">
  19. <view class="section-header">
  20. <text class="section-title">我的订单</text>
  21. <view class="view-all" @tap="navigateTo('/pages/index/order?status=all')">
  22. <text>全部</text>
  23. <uv-icon name="arrow-right" size="30rpx" color="#999" />
  24. </view>
  25. </view>
  26. <view class="order-types">
  27. <view class="order-type-item" @tap="navigateTo('/pages/index/order?status=pending')">
  28. <view class="order-icon-wrapper">
  29. <view class="green-circle">
  30. <uv-icon name="red-packet" size="44rpx" color="#fff" />
  31. </view>
  32. <uv-badge max="9" absolute :offset="[-10, -12]" bgColor="#FF2A2A"
  33. :value="userInfo.waitingPayCount" style="padding: 10rpx 15rpx;" />
  34. </view>
  35. <text class="order-type-text">待支付</text>
  36. </view>
  37. <view class="order-type-item" @tap="navigateTo('/pages/index/order?status=processing')">
  38. <view class="order-icon-wrapper">
  39. <view class="green-circle">
  40. <uv-icon name="chat" size="44rpx" color="#fff" />
  41. </view>
  42. <uv-badge max="9" absolute :offset="[-10, -12]" bgColor="#FF2A2A"
  43. :value="userInfo.waitingDiningCount" style="padding: 10rpx 15rpx;" />
  44. </view>
  45. <text class="order-type-text">待出餐</text>
  46. </view>
  47. <view class="order-type-item" @tap="navigateTo('/pages/index/order?status=shipping')">
  48. <view class="order-icon-wrapper">
  49. <view class="green-circle">
  50. <uv-icon name="chat" size="44rpx" color="#fff" />
  51. </view>
  52. <uv-badge max="9" absolute :offset="[-10, -12]" bgColor="#FF2A2A"
  53. :value="userInfo.deliveringCount" style="padding: 10rpx 15rpx;" />
  54. </view>
  55. <text class="order-type-text">送餐中</text>
  56. </view>
  57. <view class="order-type-item" @tap="navigateTo('/pages/index/order?status=delivered')">
  58. <view class="order-icon-wrapper">
  59. <view class="green-circle">
  60. <uv-icon name="chat" size="44rpx" color="#fff" />
  61. </view>
  62. <uv-badge max="9" absolute :offset="[-10, -12]" bgColor="#FF2A2A" :value="userInfo.pickupCount"
  63. style="padding: 10rpx 15rpx;" />
  64. </view>
  65. <text class="order-type-text">待取餐</text>
  66. </view>
  67. <view class="order-type-item" @tap="navigateTo('/pages/index/order?status=completed')">
  68. <view class="order-icon-wrapper">
  69. <view class="green-circle">
  70. <uv-icon name="chat" size="44rpx" color="#fff" />
  71. </view>
  72. <uv-badge max="9" absolute :offset="[-10, -12]" bgColor="#FF2A2A"
  73. :value="userInfo.completedCount" style="padding: 10rpx 15rpx;" />
  74. </view>
  75. <text class="order-type-text">已完成</text>
  76. </view>
  77. </view>
  78. </view>
  79. <!-- 团员功能区域 -->
  80. <view class="member-functions">
  81. <view class="section-header">
  82. <text class="section-title">团员功能</text>
  83. </view>
  84. <view class="function-grid">
  85. <view class="function-item" @tap="navigateTo('/pages_order/mine/updateUser')">
  86. <view class="function-icon">
  87. <uv-icon name="chat" size="94rpx" color="#019245" />
  88. </view>
  89. <text class="function-text">资料修改</text>
  90. </view>
  91. <view class="function-item" @tap="navigateTo('/pages_order/mine/team')">
  92. <view class="function-icon">
  93. <uv-icon name="chat" size="94rpx" color="#019245" />
  94. </view>
  95. <text class="function-text">团长申请</text>
  96. </view>
  97. <view class="function-item" @tap="navigateTo('/pages_order/mine/leader')">
  98. <view class="function-icon">
  99. <uv-icon name="chat" size="94rpx" color="#019245" />
  100. </view>
  101. <text class="function-text">解绑团长</text>
  102. </view>
  103. <view class="function-item" @tap="navigateTo('/pages_order/mine/share')">
  104. <view class="function-icon">
  105. <uv-icon name="chat" size="94rpx" color="#019245" />
  106. </view>
  107. <text class="function-text">推广链接</text>
  108. </view>
  109. <view class="function-item" @tap="navigateTo('/pages_order/mine/coupon')">
  110. <view class="function-icon">
  111. <uv-icon name="chat" size="94rpx" color="#019245" />
  112. </view>
  113. <text class="function-text">优惠券</text>
  114. </view>
  115. <view class="function-item" @tap="navigateTo('/pages_order/mine/wallet')">
  116. <view class="function-icon">
  117. <uv-icon name="chat" size="94rpx" color="#019245" />
  118. </view>
  119. <text class="function-text">钱包</text>
  120. </view>
  121. </view>
  122. </view>
  123. <tabber select="center" />
  124. </view>
  125. </template>
  126. <script>
  127. import tabber from '@/components/base/tabbar.vue'
  128. import { mockUserInfo } from '@/static/js/mockUserInfo.js'
  129. export default {
  130. components: {
  131. tabber
  132. },
  133. data() {
  134. return {
  135. userInfo: mockUserInfo
  136. }
  137. },
  138. methods: {
  139. navigateTo(url) {
  140. console.log(111222);
  141. this.$utils.navigateTo({
  142. url
  143. })
  144. }
  145. }
  146. }
  147. </script>
  148. <style lang="scss" scoped>
  149. .center-page {
  150. min-height: 100vh;
  151. background-color: #f5f5f5;
  152. padding-bottom: 120rpx;
  153. }
  154. .header {
  155. position: relative;
  156. height: 340rpx;
  157. background-size: cover;
  158. background-position: center;
  159. color: #fff;
  160. padding: 60rpx 30rpx 0;
  161. display: flex;
  162. flex-direction: column;
  163. align-items: start;
  164. position: relative;
  165. .user-info {
  166. position: absolute;
  167. display: flex;
  168. align-items: center;
  169. margin-top: 30rpx;
  170. z-index: 2;
  171. left: 30rpx;
  172. top: 120rpx;
  173. .avatar {
  174. width: 110rpx;
  175. height: 110rpx;
  176. border-radius: 50%;
  177. }
  178. .user-name-id {
  179. margin-left: 30rpx;
  180. display: flex;
  181. flex-direction: column;
  182. .user-name {
  183. font-size: 32rpx;
  184. font-weight: bold;
  185. margin-bottom: 6rpx;
  186. }
  187. .user-id {
  188. font-size: 24rpx;
  189. opacity: 0.9;
  190. }
  191. }
  192. }
  193. .role-switch-btn {
  194. position: absolute;
  195. right: 0;
  196. top: 180rpx;
  197. background-color: rgba(255, 255, 255, 0.2);
  198. border-radius: 30rpx 0 0 30rpx;
  199. padding: 10rpx 20rpx;
  200. font-size: 24rpx;
  201. z-index: 2;
  202. display: flex;
  203. align-items: center;
  204. }
  205. }
  206. .orders-section {
  207. background-color: #fff;
  208. border-radius: 20rpx 20rpx 0 0;
  209. margin: -70rpx auto 0;
  210. padding: 15rpx;
  211. position: relative;
  212. z-index: 3;
  213. width: 90%;
  214. // margin: 0 auto;
  215. }
  216. .member-functions {
  217. background-color: #fff;
  218. padding: 30rpx;
  219. margin-top: 20rpx;
  220. width: 88%;
  221. border-radius: 20rpx;
  222. margin: 30rpx auto 0;
  223. }
  224. .section-header {
  225. display: flex;
  226. justify-content: space-between;
  227. align-items: center;
  228. margin-bottom: 40rpx;
  229. .section-title {
  230. font-size: 32rpx;
  231. font-weight: 500;
  232. position: relative;
  233. padding-left: 15rpx;
  234. }
  235. .view-all {
  236. display: flex;
  237. align-items: center;
  238. font-size: 26rpx;
  239. color: $uni-color-third;
  240. }
  241. }
  242. .order-types {
  243. // background-color: red;
  244. display: flex;
  245. // justify-content: space-around;
  246. .order-type-item {
  247. display: flex;
  248. flex-direction: column;
  249. align-items: center;
  250. width: 20%;
  251. .order-icon-wrapper {
  252. position: relative;
  253. margin-bottom: 4rpx;
  254. .green-circle {
  255. width: 70rpx;
  256. height: 70rpx;
  257. background-color: $uni-color;
  258. border-radius: 50%;
  259. display: flex;
  260. justify-content: center;
  261. align-items: center;
  262. }
  263. }
  264. .order-type-text {
  265. font-size: 26rpx;
  266. color: #666;
  267. margin-top: 8rpx;
  268. }
  269. }
  270. }
  271. .function-grid {
  272. display: flex;
  273. flex-wrap: wrap;
  274. .function-item {
  275. width: 25%;
  276. display: flex;
  277. flex-direction: column;
  278. align-items: center;
  279. margin-bottom: 40rpx;
  280. .function-icon {
  281. width: 80rpx;
  282. height: 80rpx;
  283. display: flex;
  284. justify-content: center;
  285. align-items: center;
  286. margin-bottom: 16rpx;
  287. }
  288. .function-text {
  289. font-size: 26rpx;
  290. color: #333;
  291. }
  292. }
  293. }
  294. </style>