123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697 |
- <template>
- <view class="mine-container" :style="{ height: `${windowHeight}px` }">
- <view class="mine-top-bgc"></view>
- <view class="mine-box">
- <view class="mine-user">
- <view class="user-name-box">
- <view class="user-avatar">
- <up-avatar :src="userInfo.avatar" shape="square"></up-avatar>
- </view>
- <view class="user-name">{{ userInfo.nickName }}</view>
- <view class="grid-box" v-for="(listItem, listIndex) in setTing" :key="listIndex">
- <!-- <up-badge :isDot="true" type="success" class="item-badge"></up-badge> -->
- <up-icon :customStyle="{ paddingTop: 20 + 'rpx' }" :name="listItem.iconName" :size="22"
- @click="handLsetTing"></up-icon>
- <text class="grid-text">{{ listItem.name }}</text>
- </view>
- </view>
- <up-divider></up-divider>
- <view class="service-list">
- <up-grid :border="false" col="4">
- <up-grid-item v-for="(listItem, listIndex) in serviceList" :key="listIndex"
- @click="onClick(listItem)">
- <view class="grid-box">
- <!-- <up-badge :isDot="true" type="success" class="item-badge"></up-badge> -->
- <up-icon :customStyle="{ paddingTop: 20 + 'rpx' }" :name="listItem.iconName"
- :size="22"></up-icon>
- <text class="grid-text">{{ listItem.name }}</text>
- </view>
- </up-grid-item>
- </up-grid>
- </view>
- </view>
- </view>
- <view class="list-box">
- <view class="mine-card price-card" v-if="userType == 2">
- <view v-for="(item, index) in priceList" :key="item.key" class="price-item"
- :style="{ alignItems: index === 0 ? 'flex-start' : 'flex-end' }">
- <view class="price-name flex-center"> {{ item.name }} </view>
- <view class="price-data flex-center">
- {{ index === 0 ? '¥' : '' }}<up-count-to :startVal="0" :endVal="data[item.key]"
- :decimals="item.decimals"></up-count-to>
- </view>
- <text class="grid-min-price" v-if="item.key === 'balance'">待入账 ¥{{ data[item.key] }}</text>
- </view>
- </view>
- <!-- 志愿者 -->
- <view class="mine-card status-card" v-if="userType == 2">
- <view class="status-card-item" v-for="(listItem, listIndex) in adminList" :key="listIndex"
- @click="onClick(listItem)">
- <view class="grid-img-box">
- <img :src="listItem.iconName" alt="" style="width: 52rpx;height: 52rpx;">
- </view>
- <text class="grid-text">{{ listItem.name }}</text>
- </view>
- </view>
- <!-- 用户端 -->
- <view class="mine-card status-card" v-if="userType == 1">
- <view class="status-card-item" v-for="(listItem, listIndex) in userList" :key="listIndex"
- @click="onClick(listItem)">
- <view class="grid-img-box">
- <!-- <img :src="listItem.iconName" alt="" style="width: 52rpx;height: 52rpx;"> -->
- <up-icon :name="listItem.iconName" :size="22"></up-icon>
- </view>
- <text class="grid-text">{{ listItem.name }}</text>
- </view>
- </view>
- <view class="mine-card count-card" v-if="userType == 2">
- <view class="count-title">订单统计</view>
- <view class="count-list">
- <view class="count-item" v-for="(item, index) in orderList" :key="index">
- <up-count-to :startVal="0" :endVal="data[item.key]"></up-count-to>
- <text class="count-item-text">{{ item.name }}</text>
- </view>
- </view>
- </view>
- <view class="mine-card rate-card" v-if="userType == 2">
- <view class="count-title">好评率</view>
- <view class="rate-list">
- <view class="rate-box">
- <label class="rate-count">{{ rateValue }}</label>
- <text class="rate-text">优秀</text>
- </view>
- <up-rate v-model="rateValue" active-color="rgba(255, 87, 4, 1)" inactive-color="#b2b2b2" gutter="20"
- readonly></up-rate>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script setup>
- import {
- onMounted,
- ref
- } from 'vue';
- import {
- getVolunteerAccount
- } from '@/api/volunteer.js'
- import {
- onLoad,
- onShow
- } from '@dcloudio/uni-app';
- import store from "@/store"
- const userType = uni.getStorageSync('userType') //读取本地存储
- // 用户/志愿者 识别标识
- const userOrWorker = uni.getStorageSync('storage_data').vuex_userOrWorker //读取本地存储
- const userInfo = ref({});
- const setTing = ref(
- [{
- iconName: 'setting-fill',
- value: 1,
- }, ]);
- const serviceList = ref(
- [{
- name: '待服务',
- iconName: 'clock',
- page: '/pages/classify',
- value: 1
- },
- {
- name: '进行中',
- iconName: 'car',
- page: '/pages/classify',
- value: 2
- },
- {
- name: '已完成',
- iconName: 'car-fill',
- page: '/pages/classify',
- value: 3
- },
- {
- name: '差评申述',
- iconName: 'edit-pen',
- page: '/pages_mine/pages/bad/index'
- },
- {
- name: '钱包',
- iconName: 'rmb-circle',
- page: '/pages_mine/pages/wallet/index'
- },
- {
- name: '帮助与客服',
- iconName: 'kefu-ermai',
- },
- {
- name: '服务地址',
- iconName: 'map',
- page: '/pages_mine/pages/serviceInforMation/index'
- },
- ]);
- const serviceList2 = ref([{
- name: '待服务',
- iconName: 'clock',
- page: '/pages/classify',
- value: 1
- },
- {
- name: '进行中',
- iconName: 'car',
- page: '/pages/classify',
- value: 2
- },
- {
- name: '已完成',
- iconName: 'car-fill',
- page: '/pages/classify',
- value: 3
- },
- {
- name: '评论',
- iconName: 'edit-pen',
- // page: '/pages/myCenter/bad'
- },
- {
- name: '钱包',
- iconName: 'rmb-circle',
- page: '/pages_mine/pages/wallet/index'
- },
- {
- name: '帮助与客服',
- iconName: 'kefu-ermai',
- },
- {
- name: '浏览记录',
- iconName: 'eye',
- page: '/pages_mine/pages/wallet/index'
- },
- {
- name: '收藏',
- iconName: 'star',
- },
- ]);
- const priceList = [{
- name: '余额',
- key: 'balance',
- decimals: 2
- },
- {
- name: '订单总数',
- key: 'orderCount',
- decimals: 0
- }
- ]
- const orderList = ref([{
- name: '预约单',
- key: 'orderCount'
- },
- {
- name: '进行单',
- key: 'orderCount'
- },
- {
- name: '完成单',
- key: 'orderCount'
- },
- {
- name: '取消单',
- key: 'orderCount'
- }
- ]);
- const avatarSrc = ref('/static/my/客服.png');
- const data = ref({
- balance: 0.0,
- orderCount: 0,
- });
- const rateValue = ref(3);
- const onClick = (record) => {
- console.log('record', record, record.page);
- if (record.page && record.value) {
- const app = getApp();
- app.globalData.switchTabParams = {
- tabKey: record.value
- };
- // JS跳转
- uni.switchTab({
- url: record.page
- });
- return;
- }
- if (record.page) {
- uni.navigateTo({
- url: record.page
- });
- }
- onMounted(getDetails)
- }
- const getDetails = async () => {
- try {
- // const res = await getVolunteerAccount();
- // console.log('res',res);
- } catch (error) {
- console.log('error', error);
- }
- }
- const geUserInfo = () => {
- console.log(store.state, '>>>>99');
- userInfo.value = store.state.user
- }
- // 设置
- const handLsetTing = () => {
- console.log('123')
- uni.navigateTo({
- url: '/pages_mine/pages/setupUser/index'
- })
- }
- onShow(() => {
- geUserInfo();
- })
- </script>
- <style lang="scss" scoped>
- .mine-card {
- border-radius: 8px;
- background: rgba(255, 255, 255, 1);
- padding: 12px;
- margin-bottom: 12px;
- }
- .mine-container {
- position: fixed;
- top: 0px;
- left: 0px;
- right: 0px;
- bottom: 0px;
- background: rgba(245, 245, 245, 1);
- .mine-top-bgc {
- height: 120px;
- background: linear-gradient(180deg, rgba(255, 219, 171, 1) 0%, rgba(242, 151, 99, 1) 100%);
- }
- .mine-box {
- position: absolute;
- top: 40px;
- left: 12px;
- right: 12px;
- bottom: 0px;
- overflow-y: auto;
- .mine-user {
- border-radius: 8px;
- background: rgba(255, 255, 255, 1);
- margin-bottom: 12px;
- .user-name-box {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 12px 12px 0;
- .user-avatar {}
- .user-name {
- font-size: 18px;
- font-weight: 700;
- line-height: 21.09px;
- color: rgba(51, 51, 51, 1);
- margin-left: 12px;
- }
- }
- }
- }
- .service-img {
- width: 60rpx;
- height: 60rpx;
- margin-bottom: 10rpx;
- }
- }
- .list-box {
- padding: 16rpx 40rpx;
- .grid-box {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .price-item {
- display: flex;
- align-items: center;
- flex-direction: column;
- .user-name-box {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 12px 12px 0;
- .user-avatar {}
- .user-name {
- font-size: 18px;
- font-weight: 700;
- line-height: 21.09px;
- color: rgba(51, 51, 51, 1);
- margin-left: 12px;
- }
- }
- }
- }
- .service-img {
- width: 60rpx;
- height: 60rpx;
- margin-bottom: 10rpx;
- }
- .service-list {
- padding-bottom: 12px;
- }
- .grid-text {
- font-size: 14px;
- color: #909399;
- padding: 10rpx 0 20rpx 0rpx;
- /* #ifndef APP-PLUS */
- box-sizing: border-box;
- /* #endif */
- }
- .grid-box {
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- position: relative;
- .item-badge {
- position: absolute;
- }
- }
- .price-box {
- display: flex;
- align-content: center;
- justify-content: space-between;
- // padding: 12px;
- .price-item {
- width: 50%;
- padding: 12px;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- .user-name-box {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 12px 12px 0;
- .user-avatar {}
- .user-name {
- font-size: 18px;
- font-weight: 700;
- line-height: 21.09px;
- color: rgba(51, 51, 51, 1);
- margin-left: 12px;
- }
- }
- }
- }
- .service-img {
- width: 60rpx;
- height: 60rpx;
- margin-bottom: 10rpx;
- }
- .service-list {
- padding-bottom: 12px;
- }
- .grid-text {
- font-size: 14px;
- color: #909399;
- padding: 10rpx 0 20rpx 0rpx;
- /* #ifndef APP-PLUS */
- box-sizing: border-box;
- /* #endif */
- }
- .grid-box {
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- position: relative;
- .item-badge {
- position: absolute;
- }
- }
- .price-box {
- display: flex;
- align-content: center;
- justify-content: space-between;
- // padding: 12px;
- .price-item {
- width: 50%;
- padding: 12px;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- .price-name {
- font-size: 28rpx;
- font-weight: 400;
- line-height: 42rpx;
- color: rgba(102, 102, 102, 1);
- }
- .price-data {
- font-size: 48rpx;
- font-weight: 400;
- line-height: 72rpx;
- color: rgba(51, 51, 51, 1);
- }
- .grid-min-price {
- font-size: 24rpx;
- font-weight: 400;
- line-height: 36rpx;
- color: rgba(153, 153, 153, 1);
- }
- }
- .service-list {
- padding-bottom: 12px;
- }
- .grid-text {
- font-size: 14px;
- color: #909399;
- padding: 10rpx 0 20rpx 0rpx;
- /* #ifndef APP-PLUS */
- box-sizing: border-box;
- /* #endif */
- }
- .grid-box {
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- position: relative;
- .item-badge {
- position: absolute;
- }
- }
- .price-box {
- display: flex;
- align-content: center;
- justify-content: space-between;
- // padding: 12px;
- .price-item {
- width: 50%;
- padding: 12px;
- .price-name {
- font-size: 16px;
- font-weight: 700;
- line-height: 23.17px;
- color: rgba(51, 51, 51, 1);
- margin-bottom: 12px;
- }
- .price-data {
- font-size: 20px;
- font-weight: 700;
- line-height: 23.44px;
- color: rgba(51, 51, 51, 1);
- }
- .grid-min-price {
- font-size: 12px;
- font-weight: 500;
- line-height: 17.38px;
- color: rgba(153, 153, 153, 1);
- margin-top: 4px;
- }
- }
- .price-item:first-child {
- border-right: 1px solid #dcdfe6;
- }
- }
- }
- .rate-box {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .rate-left {
- font-size: 14px;
- font-weight: 500;
- letter-spacing: 0px;
- line-height: 20.27px;
- color: rgba(0, 0, 0, 1);
- display: flex;
- align-items: center;
- justify-content: left;
- flex: 1;
- }
- .rate-rigth {
- font-size: 14px;
- font-weight: 500;
- letter-spacing: 0px;
- line-height: 20.27px;
- color: rgba(0, 0, 0, 1);
- .rate-count {
- color: rgba(237, 123, 47, 1);
- }
- }
- }
- .count-card {
- .count-list {
- display: grid;
- grid-template-columns: repeat(4, 1fr);
- /* 3 列,每列等宽 */
- gap: 32rpx;
- /* 网格项之间的间距 */
- .count-item {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- .count-item-text {
- font-size: 28rpx;
- font-weight: 400;
- line-height: 42rpx;
- color: rgba(102, 102, 102, 1);
- }
- }
- }
- }
- .rate-card {
- .rate-list {
- display: flex;
- align-items: center;
- .rate-box {
- display: flex;
- flex-direction: column;
- align-items: center;
- .rate-count {
- font-size: 64rpx;
- font-weight: 400;
- line-height: 96rpx;
- color: rgba(51, 51, 51, 1);
- }
- .rate-text {
- font-size: 28rpx;
- font-weight: 400;
- line-height: 42rpx;
- color: rgba(102, 102, 102, 1);
- }
- }
- }
- }
- }
- </style>
|