mine.vue 6.3 KB

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