mine.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <template>
  2. <view class="mine-container" :style="{ height: `${windowHeight}px` }">
  3. <view class="mine-top-bgc"></view>
  4. <view class="mine-box">
  5. <view class="mine-user">
  6. <view class="user-name-box">
  7. <view class="user-avatar">
  8. <up-avatar :src="avatarSrc" shape="square"></up-avatar>
  9. </view>
  10. <view class="user-name">战三</view>
  11. </view>
  12. <up-divider></up-divider>
  13. <view class="service-list">
  14. <up-grid :border="false" col="4">
  15. <up-grid-item v-for="(listItem, listIndex) in serviceList" :key="listIndex"
  16. @click="onClick(listItem)">
  17. <view class="grid-box">
  18. <!-- <up-badge :isDot="true" type="success" class="item-badge"></up-badge> -->
  19. <up-icon :customStyle="{ paddingTop: 20 + 'rpx' }" :name="listItem.iconName"
  20. :size="22"></up-icon>
  21. <text class="grid-text">{{ listItem.name }}</text>
  22. </view>
  23. </up-grid-item>
  24. </up-grid>
  25. </view>
  26. </view>
  27. <view class="mine-card price-box">
  28. <view class="price-item" v-for="item in priceList" :key="item.key">
  29. <view class="price-name flex-center"> {{ item.name }} </view>
  30. <view class="price-data flex-center">
  31. <up-count-to :startVal="0" :endVal="data[item.key]" :decimals="item.decimals"></up-count-to>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="mine-card">
  36. <up-grid :border="false" col="4">
  37. <up-grid-item v-for="(listItem, listIndex) in orderList" :key="listIndex">
  38. <view class="grid-box">
  39. <text class="grid-text">{{ listItem.name }}</text>
  40. <up-count-to :startVal="0" :endVal="data[listItem.key]"></up-count-to>
  41. </view>
  42. </up-grid-item>
  43. </up-grid>
  44. </view>
  45. <view class="mine-card rate-box">
  46. <view class="rate-left">
  47. <label>好评率:</label>
  48. <up-rate v-model="rateValue" active-color="rgba(255, 87, 4, 1)" inactive-color="#b2b2b2" gutter="20"
  49. readonly></up-rate>
  50. </view>
  51. <view class="rate-rigth">
  52. <label class="rate-count">{{ rateValue }}</label>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script setup>
  59. import { ref } from 'vue';
  60. const serviceList = ref([
  61. {
  62. name: '待服务',
  63. iconName: 'clock',
  64. page: '/pages/classify',
  65. value:1
  66. },
  67. {
  68. name: '进行中',
  69. iconName: 'car',
  70. page: '/pages/classify',
  71. value:2
  72. },
  73. {
  74. name: '已完成',
  75. iconName: 'car-fill',
  76. page: '/pages/classify',
  77. value:3
  78. },
  79. {
  80. name: '差评申述',
  81. iconName: 'edit-pen',
  82. page: '/pages/myCenter/bad'
  83. },
  84. {
  85. name: '钱包',
  86. iconName: 'rmb-circle',
  87. page: '/pages/myCenter/withdrawal'
  88. },
  89. {
  90. name: '帮助与客服',
  91. iconName: 'kefu-ermai',
  92. },
  93. ]);
  94. const priceList = [
  95. {
  96. name: '余额',
  97. key: 'balance',
  98. decimals: 2
  99. },
  100. {
  101. name: '订单总数',
  102. key: 'orderCount',
  103. decimals: 0
  104. }
  105. ]
  106. const orderList = ref([
  107. {
  108. name: '预约单',
  109. key: 'orderCount'
  110. },
  111. {
  112. name: '进行单',
  113. key: 'orderCount'
  114. },
  115. {
  116. name: '完成单',
  117. key: 'orderCount'
  118. },
  119. {
  120. name: '取消单',
  121. key: 'orderCount'
  122. }
  123. ]);
  124. const avatarSrc = ref('/static/my/客服.png');
  125. const data = ref({
  126. balance: 0.0,
  127. orderCount: 0,
  128. });
  129. const rateValue = ref(3);
  130. const onClick = (record) => {
  131. console.log('record', record, record.page);
  132. if (record.page && record.value) {
  133. const app = getApp();
  134. app.globalData.switchTabParams = { tabKey: record.value };
  135. // JS跳转
  136. uni.switchTab({
  137. url: record.page
  138. });
  139. return;
  140. }
  141. if(record.page){
  142. uni.navigateTo({
  143. url: record.page
  144. });
  145. }
  146. }
  147. </script>
  148. <style lang="scss" scoped>
  149. .mine-card {
  150. border-radius: 8px;
  151. background: rgba(255, 255, 255, 1);
  152. padding: 12px;
  153. margin-bottom: 12px;
  154. }
  155. .mine-container {
  156. position: fixed;
  157. top: 0px;
  158. left: 0px;
  159. right: 0px;
  160. bottom: 0px;
  161. background: rgba(245, 245, 245, 1);
  162. .mine-top-bgc {
  163. height: 120px;
  164. background: linear-gradient(180deg, rgba(255, 219, 171, 1) 0%, rgba(242, 151, 99, 1) 100%);
  165. }
  166. .mine-box {
  167. position: absolute;
  168. top: 40px;
  169. left: 12px;
  170. right: 12px;
  171. bottom: 0px;
  172. overflow-y: auto;
  173. .mine-user {
  174. border-radius: 8px;
  175. background: rgba(255, 255, 255, 1);
  176. margin-bottom: 12px;
  177. .user-name-box {
  178. display: flex;
  179. align-items: center;
  180. padding: 12px 12px 0;
  181. .user-avatar {}
  182. .user-name {
  183. font-size: 18px;
  184. font-weight: 700;
  185. line-height: 21.09px;
  186. color: rgba(51, 51, 51, 1);
  187. margin-left: 12px;
  188. }
  189. }
  190. }
  191. }
  192. .service-img {
  193. width: 60rpx;
  194. height: 60rpx;
  195. margin-bottom: 10rpx;
  196. }
  197. .service-list {
  198. padding-bottom: 12px;
  199. }
  200. .grid-text {
  201. font-size: 14px;
  202. color: #909399;
  203. padding: 10rpx 0 20rpx 0rpx;
  204. /* #ifndef APP-PLUS */
  205. box-sizing: border-box;
  206. /* #endif */
  207. }
  208. .grid-box {
  209. display: flex;
  210. align-items: center;
  211. justify-content: center;
  212. flex-direction: column;
  213. position: relative;
  214. .item-badge {
  215. position: absolute;
  216. }
  217. }
  218. .price-box {
  219. display: flex;
  220. align-content: center;
  221. justify-content: space-between;
  222. // padding: 12px;
  223. .price-item {
  224. width: 50%;
  225. padding: 12px;
  226. .price-name {
  227. font-size: 16px;
  228. font-weight: 700;
  229. line-height: 23.17px;
  230. color: rgba(51, 51, 51, 1);
  231. margin-bottom: 12px;
  232. }
  233. .price-data {
  234. font-size: 20px;
  235. font-weight: 700;
  236. line-height: 23.44px;
  237. color: rgba(51, 51, 51, 1);
  238. }
  239. }
  240. .price-item:first-child {
  241. border-right: 1px solid #dcdfe6;
  242. }
  243. }
  244. .rate-box {
  245. display: flex;
  246. align-items: center;
  247. justify-content: space-between;
  248. .rate-left {
  249. font-size: 14px;
  250. font-weight: 500;
  251. letter-spacing: 0px;
  252. line-height: 20.27px;
  253. color: rgba(0, 0, 0, 1);
  254. display: flex;
  255. align-items: center;
  256. justify-content: left;
  257. flex: 1;
  258. }
  259. .rate-rigth {
  260. font-size: 14px;
  261. font-weight: 500;
  262. letter-spacing: 0px;
  263. line-height: 20.27px;
  264. color: rgba(0, 0, 0, 1);
  265. .rate-count {
  266. color: rgba(237, 123, 47, 1);
  267. }
  268. }
  269. }
  270. }
  271. </style>