no message
This commit is contained in:
96
pages/mine/card.vue
Normal file
96
pages/mine/card.vue
Normal file
@@ -0,0 +1,96 @@
|
||||
<template>
|
||||
<view class="earnings p30">
|
||||
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
|
||||
<view style="margin-bottom: 30rpx" @click="toCrud(item)" class="mt30 wallet_list" v-for="(item, index) in dataList" :key="index">
|
||||
<view style="color: #fff">
|
||||
<view style="font-weight: bold; font-size: 32rpx; margin-bottom: 18rpx">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view style="margin-bottom: 12rpx; font-size: 28rpx; color: #eee">
|
||||
卡号:{{ item.cardNo }}
|
||||
</view>
|
||||
<view style="margin-bottom: 12rpx; font-size: 28rpx; color: #eee">
|
||||
电站:{{ item.stationName }}
|
||||
</view>
|
||||
<view style="font-size: 28rpx; color: #eee">
|
||||
商户:{{ item.merchantName }}
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex; flex-direction: column; align-items: center; color: #fff; font-weight: bold; font-size: 26rpx">
|
||||
<view style="font-size: 55rpx; margin-bottom: 30rpx">{{ item.balance }}</view>
|
||||
<view style="font-weight: 500">余额</view>
|
||||
</view>
|
||||
</view>
|
||||
</z-paging>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, computed } from 'vue';
|
||||
import { onPullDownRefresh, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
|
||||
import { timeFormat } from '@/uni_modules/uview-plus';
|
||||
import { userCardList } from '@/api/api.js';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { useNav } from '@/hooks/useNav.js';
|
||||
|
||||
const changeSele = (e) => {
|
||||
paging.value.reload();
|
||||
};
|
||||
|
||||
const { nav, navTo } = useNav();
|
||||
let getInfo = ref({});
|
||||
const paging = ref(null);
|
||||
let dataList = ref([]);
|
||||
|
||||
let isPagingRefNotFound = () => {
|
||||
return !paging.value;
|
||||
};
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.reload().catch(() => {});
|
||||
});
|
||||
|
||||
onPageScroll((e) => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.updatePageScrollTop(e.scrollTop);
|
||||
e.scrollTop < 10 && paging.value.doChatRecordLoadMore();
|
||||
});
|
||||
|
||||
onReachBottom(() => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.pageReachBottom();
|
||||
});
|
||||
|
||||
const queryList = (pageNo, pageSize) => {
|
||||
const params = {
|
||||
current: pageNo,
|
||||
pageSize: pageSize
|
||||
};
|
||||
|
||||
userCardList(params)
|
||||
.then((res) => {
|
||||
paging.value.complete(res);
|
||||
})
|
||||
.catch((res) => {
|
||||
paging.value.complete(false);
|
||||
});
|
||||
};
|
||||
|
||||
let toCrud = ()=>{
|
||||
uni.navigateTo({
|
||||
url:'./cardList?id=' + e.id
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.wallet_list {
|
||||
border-radius: 15rpx;
|
||||
background-color: #4879e6;
|
||||
padding: 35rpx 50rpx 35rpx 30rpx;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
||||
151
pages/mine/cardList.vue
Normal file
151
pages/mine/cardList.vue
Normal file
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<view class="earnings p30">
|
||||
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
|
||||
<view style="margin-bottom: 30rpx" class="mt30 wallet_list" v-for="(item, index) in dataList" :key="index">
|
||||
<view class="wallet_list_left">
|
||||
<view>{{ item.recordName || '-' }}</view>
|
||||
<view>{{ item.createTime }}</view>
|
||||
</view>
|
||||
<view class="wallet_list_right" style="display: flex; flex-direction: column; align-items: flex-end">
|
||||
<!-- <view style="margin-bottom: 10rpx; width: 75rpx">
|
||||
<view></view>
|
||||
<up-tag v-if="item.pointType == 2" size="mini" text="余额" type="warning" plain plainFill></up-tag>
|
||||
<up-tag v-if="item.pointType == 1" size="mini" text="收益" plain plainFill></up-tag>
|
||||
</view> -->
|
||||
<view>{{ item.amount }}元</view>
|
||||
</view>
|
||||
</view>
|
||||
</z-paging>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, computed } from 'vue';
|
||||
import { onPullDownRefresh, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
|
||||
import { timeFormat } from '@/uni_modules/uview-plus';
|
||||
import { userCardRecord } from '@/api/api.js';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { useNav } from '@/hooks/useNav.js';
|
||||
|
||||
let id = ref('');
|
||||
|
||||
const changeSele = (e) => {
|
||||
paging.value.reload();
|
||||
};
|
||||
|
||||
const { nav, navTo } = useNav();
|
||||
let getInfo = ref({});
|
||||
const paging = ref(null);
|
||||
let dataList = ref([]);
|
||||
|
||||
let isPagingRefNotFound = () => {
|
||||
return !paging.value;
|
||||
};
|
||||
|
||||
onLoad((options) => {
|
||||
id.value = options.id;
|
||||
});
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.reload().catch(() => {});
|
||||
});
|
||||
|
||||
onPageScroll((e) => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.updatePageScrollTop(e.scrollTop);
|
||||
e.scrollTop < 10 && paging.value.doChatRecordLoadMore();
|
||||
});
|
||||
|
||||
onReachBottom(() => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.pageReachBottom();
|
||||
});
|
||||
|
||||
const queryList = (pageNo, pageSize) => {
|
||||
const params = {
|
||||
current: pageNo,
|
||||
pageSize: pageSize,
|
||||
id: id.value
|
||||
};
|
||||
|
||||
userCardRecord(params)
|
||||
.then((res) => {
|
||||
paging.value.complete(res);
|
||||
})
|
||||
.catch((res) => {
|
||||
paging.value.complete(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.wallet_pall {
|
||||
width: 690rpx;
|
||||
height: 272rpx;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
padding: 40rpx;
|
||||
background: #ffffff;
|
||||
&_header {
|
||||
font-weight: bold;
|
||||
font-size: 26rpx;
|
||||
color: #002ea4;
|
||||
}
|
||||
&_ye {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 70%;
|
||||
view:nth-child(1) {
|
||||
font-weight: bold;
|
||||
font-size: 68rpx;
|
||||
color: #002ea4;
|
||||
}
|
||||
view:nth-child(2) {
|
||||
width: 128rpx;
|
||||
height: 58rpx;
|
||||
background: rgba(0, 46, 164, 0.07);
|
||||
border-radius: 32rpx 32rpx 32rpx 32rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 26rpx;
|
||||
color: #002ea4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wallet_list {
|
||||
width: 690rpx;
|
||||
// height: 120rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
padding: 15rpx 30rpx;
|
||||
@include flex($space: space-between);
|
||||
&_left {
|
||||
view:nth-child(1) {
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #232323;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
view:nth-child(2) {
|
||||
font-size: 24rpx;
|
||||
color: #232323;
|
||||
}
|
||||
view:nth-child(3) {
|
||||
font-size: 24rpx;
|
||||
color: #232323;
|
||||
}
|
||||
view:nth-child(4) {
|
||||
font-size: 24rpx;
|
||||
color: #232323;
|
||||
}
|
||||
}
|
||||
&_right {
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #ff2727;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
18
pages/mine/earnings.vue
Normal file
18
pages/mine/earnings.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<view class="earnings">
|
||||
<up-cell-group>
|
||||
<up-cell icon="integral-fill" title="会员等级" value="新版本"></up-cell>
|
||||
</up-cell-group>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
146
pages/mine/incomeList.vue
Normal file
146
pages/mine/incomeList.vue
Normal file
@@ -0,0 +1,146 @@
|
||||
<template>
|
||||
<view class="earnings p30">
|
||||
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
|
||||
<view style="margin-bottom: 30rpx;" class="mt30 wallet_list" v-for="(item, index) in dataList" :key="index">
|
||||
<view class="wallet_list_left">
|
||||
<view>{{ item.recordName || '-' }}</view>
|
||||
<view>{{ item.createTime }}</view>
|
||||
</view>
|
||||
<view class="wallet_list_right" style="display: flex; flex-direction: column; align-items: flex-end">
|
||||
<!-- <view style="margin-bottom: 10rpx; width: 75rpx">
|
||||
<view></view>
|
||||
<up-tag v-if="item.pointType == 2" size="mini" text="余额" type="warning" plain plainFill></up-tag>
|
||||
<up-tag v-if="item.pointType == 1" size="mini" text="收益" plain plainFill></up-tag>
|
||||
</view> -->
|
||||
<view>{{ item.amount }}元</view>
|
||||
</view>
|
||||
</view>
|
||||
</z-paging>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, computed } from 'vue';
|
||||
import { onPullDownRefresh, onPageScroll, onReachBottom } from '@dcloudio/uni-app';
|
||||
import { timeFormat } from '@/uni_modules/uview-plus';
|
||||
import { walletRecord } from '@/api/api.js';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { useNav } from '@/hooks/useNav.js';
|
||||
|
||||
|
||||
const changeSele = (e) => {
|
||||
paging.value.reload();
|
||||
};
|
||||
|
||||
const { nav, navTo } = useNav();
|
||||
let getInfo = ref({});
|
||||
const paging = ref(null);
|
||||
let dataList = ref([]);
|
||||
|
||||
let isPagingRefNotFound = () => {
|
||||
return !paging.value;
|
||||
};
|
||||
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.reload().catch(() => {});
|
||||
});
|
||||
|
||||
onPageScroll((e) => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.updatePageScrollTop(e.scrollTop);
|
||||
e.scrollTop < 10 && paging.value.doChatRecordLoadMore();
|
||||
});
|
||||
|
||||
onReachBottom(() => {
|
||||
if (isPagingRefNotFound()) return;
|
||||
paging.value.pageReachBottom();
|
||||
});
|
||||
|
||||
const queryList = (pageNo, pageSize) => {
|
||||
const params = {
|
||||
current: pageNo,
|
||||
pageSize: pageSize,
|
||||
};
|
||||
|
||||
walletRecord(params)
|
||||
.then((res) => {
|
||||
paging.value.complete(res);
|
||||
})
|
||||
.catch((res) => {
|
||||
paging.value.complete(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.wallet_pall {
|
||||
width: 690rpx;
|
||||
height: 272rpx;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
padding: 40rpx;
|
||||
background: #ffffff;
|
||||
&_header {
|
||||
font-weight: bold;
|
||||
font-size: 26rpx;
|
||||
color: #002ea4;
|
||||
}
|
||||
&_ye {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 70%;
|
||||
view:nth-child(1) {
|
||||
font-weight: bold;
|
||||
font-size: 68rpx;
|
||||
color: #002ea4;
|
||||
}
|
||||
view:nth-child(2) {
|
||||
width: 128rpx;
|
||||
height: 58rpx;
|
||||
background: rgba(0, 46, 164, 0.07);
|
||||
border-radius: 32rpx 32rpx 32rpx 32rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 26rpx;
|
||||
color: #002ea4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wallet_list {
|
||||
width: 690rpx;
|
||||
// height: 120rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
padding: 15rpx 30rpx;
|
||||
@include flex($space: space-between);
|
||||
&_left {
|
||||
view:nth-child(1) {
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #232323;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
view:nth-child(2) {
|
||||
font-size: 24rpx;
|
||||
color: #232323;
|
||||
}
|
||||
view:nth-child(3) {
|
||||
font-size: 24rpx;
|
||||
color: #232323;
|
||||
}
|
||||
view:nth-child(4) {
|
||||
font-size: 24rpx;
|
||||
color: #232323;
|
||||
}
|
||||
}
|
||||
&_right {
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #ff2727;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
257
pages/mine/mine.vue
Normal file
257
pages/mine/mine.vue
Normal file
@@ -0,0 +1,257 @@
|
||||
<template>
|
||||
<view class="mine">
|
||||
<statusBar />
|
||||
<view class="p30">
|
||||
<view class="mine_header">
|
||||
<view class="mine_header_img">
|
||||
<up-avatar size="150rpx" :src="info.avatar"></up-avatar>
|
||||
</view>
|
||||
<!-- <image :src="info.avatar" class="mine_header_img" mode="aspectFill"></image> -->
|
||||
<view class="mine_header_user">
|
||||
<view>{{ info.nickName }}</view>
|
||||
<view>{{ info.phone || '' }}</view>
|
||||
</view>
|
||||
<image class="mine_header_sett" @click="toEarnings" src="/static/icon/sett.png"></image>
|
||||
</view>
|
||||
<view class="mine_money">
|
||||
<view class="flex-acsb flex1 mine_money_top" style="width: 100%">
|
||||
<view class="mine_money_left" @click="navTo('/pages/mine/incomeList')">
|
||||
<view>{{ info.balance || 0 }}</view>
|
||||
<view>钱包余额</view>
|
||||
</view>
|
||||
<view class="mine_money_left" @click="navTo('/pages/mine/incomeList')">
|
||||
<view>0</view>
|
||||
<view>赠送余额</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex1 mine_money_bottom" style="display: flex; align-items: center">
|
||||
<!-- class="mine_money_right" -->
|
||||
<!-- class="mine_money_right" -->
|
||||
<view @click="navTo(`/pageMake/refund/refund?balance=${info.refundableAmount}`)">退款</view>
|
||||
<view @click="navTo('/pages/money/recharge')">充值</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mine_grid">
|
||||
<view class="mine_grid_tit">常用功能</view>
|
||||
<view class="mine_grid_views">
|
||||
<view class="mine_grid_views_block" v-for="(item, index) in gridList" :key="index" @click="nav(item)">
|
||||
<image :src="item.img" mode="widthFix"></image>
|
||||
<view>{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="mine_fun">
|
||||
<view class="mine_fun_view" @click="navTo('/pages/mine/card')">
|
||||
<image class="mine_fun_view_left" src="/static/icon/ka.png"></image>
|
||||
<view class="mine_fun_view_name">充电卡</view>
|
||||
<image class="mine_fun_view_right" src="/static/icon/9you.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<view style="width: 100%; height: 100vh; background: #f7f7f7; position: absolute; top: 0; left: 0; z-index: -1"></view>
|
||||
|
||||
<cc-myTabbar :tabBarShow="4"></cc-myTabbar>
|
||||
<!-- <tabbar path="/pages/mine/mine"></tabbar> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { userInfo } from '@/api/api.js';
|
||||
import { ref } from 'vue';
|
||||
import { useNav } from '@/hooks/useNav.js';
|
||||
const { nav, navTo } = useNav();
|
||||
let info = ref({});
|
||||
|
||||
let gridList = ref([
|
||||
{
|
||||
name: '我的电卡',
|
||||
img: '/static/icon/dk_mine.png',
|
||||
path: '/pages/mine/card',
|
||||
type: 'nav'
|
||||
},
|
||||
{
|
||||
name: '充电订单',
|
||||
img: '/static/icon/cd_mine.png',
|
||||
path: '/pages/order/order',
|
||||
type: 'switchTab'
|
||||
},
|
||||
{
|
||||
name: '余额明细',
|
||||
img: '/static/icon/ye_mine.png',
|
||||
path: '/pages/mine/incomeList',
|
||||
type: 'nav'
|
||||
},
|
||||
{
|
||||
name: '客服中心',
|
||||
img: '/static/icon/kf_mine.png',
|
||||
call: true
|
||||
}
|
||||
]);
|
||||
|
||||
onShow(async () => {
|
||||
uni.hideTabBar();
|
||||
let _res = await userInfo();
|
||||
info.value = _res;
|
||||
});
|
||||
|
||||
const toEarnings = () => {
|
||||
uni.navigateTo({
|
||||
url: './sett'
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.mine {
|
||||
&_header {
|
||||
@include flex($space: space-between);
|
||||
&_img {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
// border-radius: 50%;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
&_user {
|
||||
flex: 1;
|
||||
view:nth-child(1) {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #232323;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
view:nth-child(2) {
|
||||
font-weight: bold;
|
||||
font-size: 44rpx;
|
||||
color: #232323;
|
||||
}
|
||||
}
|
||||
&_sett {
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
}
|
||||
&_money {
|
||||
margin-top: 35rpx;
|
||||
@include flex($direction: column);
|
||||
width: 100%;
|
||||
// height: 152rpx;
|
||||
background: linear-gradient(178deg, #9ab6ff 0%, #4879e6 100%);
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
padding: 20rpx 0rpx 0;
|
||||
|
||||
&_top {
|
||||
padding: 0 150rpx;
|
||||
}
|
||||
|
||||
&_bottom {
|
||||
width: 100%;
|
||||
@include flex($space: center);
|
||||
border-top: 1rpx solid rgba(255, 255, 255, 0.3);
|
||||
margin-top: 20rpx;
|
||||
padding: 15rpx 0;
|
||||
view {
|
||||
width: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 30rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
&_left {
|
||||
@include flex($direction: column, $space: center);
|
||||
view:nth-child(1) {
|
||||
font-weight: bold;
|
||||
font-size: 48rpx;
|
||||
color: #ffffff;
|
||||
margin-bottom: 5rpx;
|
||||
}
|
||||
view:nth-child(2) {
|
||||
font-weight: bold;
|
||||
font-size: 20rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
&_right {
|
||||
@include flex($space: center);
|
||||
width: 124rpx;
|
||||
height: 54rpx;
|
||||
background: rgba(255, 255, 255, 0.24);
|
||||
border-radius: 140rpx 140rpx 140rpx 140rpx;
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
&_grid {
|
||||
width: 100%;
|
||||
padding: 20rpx 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 15rpx;
|
||||
margin-top: 30rpx;
|
||||
&_tit {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
opacity: 0.8;
|
||||
}
|
||||
&_views {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
&_block {
|
||||
height: 95rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
image {
|
||||
width: 45rpx;
|
||||
height: 45rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&_fun {
|
||||
margin-top: 35rpx;
|
||||
width: 100%;
|
||||
// background: linear-gradient(180deg, #ffffff 0%, #f7f7f7 100%);
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
padding: 35rpx;
|
||||
|
||||
&_view {
|
||||
@include flex($space: space-between);
|
||||
margin-bottom: 35rpx;
|
||||
&_left {
|
||||
width: 58rpx;
|
||||
height: 58rpx;
|
||||
margin-right: 20rpx;
|
||||
// background: #eeeeee;
|
||||
}
|
||||
&_name {
|
||||
flex: 1;
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #232323;
|
||||
}
|
||||
&_right {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
95
pages/mine/sett.vue
Normal file
95
pages/mine/sett.vue
Normal file
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<view class="p30">
|
||||
<view style="background-color: #fff; border-radius: 15rpx">
|
||||
<up-cell-group :border="false">
|
||||
<button style="all: unset" open-type="chooseAvatar" @chooseavatar="chooseAvatar">
|
||||
<up-cell title="头像" :isLink="true" size="min">
|
||||
<template #value>
|
||||
<up-avatar :src="info.avatar"></up-avatar>
|
||||
</template>
|
||||
</up-cell>
|
||||
</button>
|
||||
<up-cell title="昵称" :isLink="true" size="min" @click="upNickName">
|
||||
<template #value>
|
||||
<text class="u-slot-value">{{ info.nickName }}</text>
|
||||
</template>
|
||||
</up-cell>
|
||||
<up-cell title="手机号" size="min" :border="false">
|
||||
<template #value>
|
||||
<text class="u-slot-value">{{ info.phone || '-' }}</text>
|
||||
</template>
|
||||
</up-cell>
|
||||
</up-cell-group>
|
||||
</view>
|
||||
<view style="height: 100rpx"></view>
|
||||
<up-button type="error" text="退出登录" @click="outLogin"></up-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { userInfo, updateNickName, updateAvatar } from '@/api/api.js';
|
||||
import { ref } from 'vue';
|
||||
import { uploadFiles } from '@/utils/fun.js';
|
||||
|
||||
let info = ref({});
|
||||
|
||||
onShow(async () => {
|
||||
getInfo();
|
||||
});
|
||||
|
||||
const getInfo = async () => {
|
||||
let _res = await userInfo();
|
||||
info.value = _res;
|
||||
};
|
||||
|
||||
const chooseAvatar = async (e) => {
|
||||
let img = await uploadFiles(e.detail.avatarUrl);
|
||||
updateAvatar({ avatar: img }).then((res) => {
|
||||
getInfo();
|
||||
});
|
||||
console.log(img);
|
||||
};
|
||||
|
||||
const upNickName = () => {
|
||||
uni.showModal({
|
||||
title: '修改昵称',
|
||||
content: info.value.nickName,
|
||||
editable: true,
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
updateNickName({ nickName: res.content }).then((res) => {
|
||||
getInfo();
|
||||
});
|
||||
console.log(res);
|
||||
console.log('用户点击确定');
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const outLogin = () => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否确认退出登录?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.clearStorageSync();
|
||||
uni.reLaunch({
|
||||
url: '/pages/home/home'
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
button::after {
|
||||
all: unset;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user