|
@@ -5,7 +5,7 @@
|
|
|
<img :src="userInfo.avatar" alt="" style="width: 136rpx;height: 136rpx;">
|
|
|
<view class="header-info">
|
|
|
<text class="info-name">{{ userInfo.nickName }}</text>
|
|
|
- <text class="info-id">ID: 88888888</text>
|
|
|
+ <text class="info-id">ID: {{ data.volunteerId }}</text>
|
|
|
<text class="info-edit" @click="handLsetTing">设置> </text>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -13,13 +13,13 @@
|
|
|
<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' }">
|
|
|
+ :style="{ alignItems: index === 0 ? 'flex-start' : 'flex-end' }" @click="onClick(item)">
|
|
|
<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>
|
|
|
+ <text class="grid-min-price" v-if="item.key === 'balance'">待入账 ¥{{ data[item.balance] }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
@@ -78,6 +78,8 @@ import {
|
|
|
onShow
|
|
|
} from '@dcloudio/uni-app';
|
|
|
import store from "@/store"
|
|
|
+import { getVolunteerAccountInfo,volunteerOrderStatistics } from "@/api/mine";
|
|
|
+
|
|
|
const userInfo = ref({
|
|
|
avatar: '/static/serverImg/mine/user.png'
|
|
|
})
|
|
@@ -86,7 +88,9 @@ const rateValue = ref(3)
|
|
|
const priceList = [{
|
|
|
name: '账户余额',
|
|
|
key: 'balance',
|
|
|
- decimals: 2
|
|
|
+ decimals: 2,
|
|
|
+ balance:'orderFrozenBalance',
|
|
|
+ page: '/pages_mine/pages/wallet/index'
|
|
|
},
|
|
|
{
|
|
|
name: '订单总数',
|
|
@@ -96,61 +100,66 @@ const priceList = [{
|
|
|
]
|
|
|
const orderList = ref([{
|
|
|
name: '预约单',
|
|
|
- key: 'orderCount'
|
|
|
+ key: 'reservationCount'
|
|
|
},
|
|
|
|
|
|
{
|
|
|
name: '进行单',
|
|
|
- key: 'orderCount'
|
|
|
+ key: 'doingCount'
|
|
|
|
|
|
},
|
|
|
{
|
|
|
name: '完成单',
|
|
|
- key: 'orderCount'
|
|
|
+ key: 'finishedCount'
|
|
|
|
|
|
},
|
|
|
{
|
|
|
name: '取消单',
|
|
|
- key: 'orderCount'
|
|
|
+ key: 'cancelCount'
|
|
|
|
|
|
}
|
|
|
]);
|
|
|
const data = ref({
|
|
|
balance: 0.0,
|
|
|
- orderCount: 0,
|
|
|
+ reservationCount: 0,
|
|
|
+ doingCount:0,
|
|
|
+ finishedCount:0,
|
|
|
+ cancelCount:0,
|
|
|
+ orderCount:0,
|
|
|
});
|
|
|
|
|
|
const userType = uni.getStorageSync('userType') //读取本地存储
|
|
|
|
|
|
const adminList = ref(
|
|
|
- [{
|
|
|
- name: '待服务',
|
|
|
- iconName: '/static/serverImg/mine/icon1.png',
|
|
|
- page: '/pages/classify',
|
|
|
- value: 1
|
|
|
- },
|
|
|
- {
|
|
|
- name: '进行中',
|
|
|
- iconName: '/static/serverImg/mine/icon2.png',
|
|
|
- page: '/pages/classify',
|
|
|
- value: 2
|
|
|
- },
|
|
|
- {
|
|
|
- name: '已完成',
|
|
|
- iconName: '/static/serverImg/mine/icon3.png',
|
|
|
- page: '/pages/classify',
|
|
|
- value: 3
|
|
|
- },
|
|
|
+ [
|
|
|
+ // {
|
|
|
+ // name: '待服务',
|
|
|
+ // iconName: '/static/serverImg/mine/icon1.png',
|
|
|
+ // page: '/pages/classify',
|
|
|
+ // value: 1
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // name: '进行中',
|
|
|
+ // iconName: '/static/serverImg/mine/icon2.png',
|
|
|
+ // page: '/pages/classify',
|
|
|
+ // value: 2
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // name: '已完成',
|
|
|
+ // iconName: '/static/serverImg/mine/icon3.png',
|
|
|
+ // page: '/pages/classify',
|
|
|
+ // value: 3
|
|
|
+ // },
|
|
|
{
|
|
|
name: '差评申述',
|
|
|
iconName: '/static/serverImg/mine/icon4.png',
|
|
|
page: '/pages_mine/pages/bad/index'
|
|
|
},
|
|
|
- {
|
|
|
- name: '钱包',
|
|
|
- iconName: '/static/serverImg/mine/icon5.png',
|
|
|
- page: '/pages_mine/pages/wallet/index'
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // name: '钱包',
|
|
|
+ // iconName: '/static/serverImg/mine/icon5.png',
|
|
|
+ // page: '/pages_mine/pages/wallet/index'
|
|
|
+ // },
|
|
|
{
|
|
|
name: '帮助与客服',
|
|
|
iconName: '/static/serverImg/mine/icon6.png',
|
|
@@ -213,19 +222,26 @@ const userList = ref(
|
|
|
|
|
|
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({
|
|
|
+ if(record.page){
|
|
|
+ uni.navigateTo({
|
|
|
url: record.page
|
|
|
- });
|
|
|
- return;
|
|
|
+ })
|
|
|
}
|
|
|
+ // if (record.page && record.value) {
|
|
|
+ // const app = getApp();
|
|
|
+ // app.globalData.switchTabParams = {
|
|
|
+ // tabKey: record.value
|
|
|
+ // };
|
|
|
+ // // JS跳转
|
|
|
+ // uni.switchTab({
|
|
|
+ // url: record.page
|
|
|
+ // });
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
const getDetails = async () => {
|
|
|
try {
|
|
|
// const res = await getVolunteerAccount();
|
|
@@ -248,14 +264,49 @@ const handLsetTing = () => {
|
|
|
|
|
|
const geUserInfo = () => {
|
|
|
console.log(store.state, '>>>>99');
|
|
|
- userInfo.value = store.state.user
|
|
|
+ // userInfo.value = store.state.user
|
|
|
+ store.dispatch('GetInfo').then((res) => {
|
|
|
+ userInfo.value = store.state.user
|
|
|
+ console.log(store.state.user, '>>>>99');
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
onShow(() => {
|
|
|
geUserInfo();
|
|
|
-
|
|
|
+ init();
|
|
|
})
|
|
|
|
|
|
+const init = async() => {
|
|
|
+ try {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '数据加载中...'
|
|
|
+ });
|
|
|
+
|
|
|
+ if(userType === 2){
|
|
|
+ const res1 = await getVolunteerAccountInfo();
|
|
|
+ const res2 = await volunteerOrderStatistics();
|
|
|
+ data.value = {
|
|
|
+ ...res1.data,
|
|
|
+ ...res2.data
|
|
|
+ }
|
|
|
+ console.log(11,res1,res2,data.value);
|
|
|
+
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log('error', error);
|
|
|
+ uni.showToast({
|
|
|
+ title: error.msg,
|
|
|
+ icon: 'error',
|
|
|
+ });
|
|
|
+ } finally {
|
|
|
+ uni.hideLoading();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -298,7 +349,7 @@ onShow(() => {
|
|
|
font-weight: 400;
|
|
|
letter-spacing: 0rpx;
|
|
|
line-height: 36rpx;
|
|
|
- color: rgba(102, 102, 102, 1);
|
|
|
+ color: #3366ff;
|
|
|
}
|
|
|
}
|
|
|
|