mine.vue 6.6 KB

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