refactor: 更新多个页面的样式和结构

This commit is contained in:
pikachu1995@126.com
2026-07-01 16:05:08 +08:00
parent 6654c1de51
commit 5f293d929d
50 changed files with 3337 additions and 1837 deletions

View File

@@ -1,40 +1,79 @@
<template>
<view class="add-address">
<div class="uForm">
<u-form :border-bottom="false" :model="form" ref="uForm" error-type="toast" :rules="rules">
<!-- #ifndef H5 -->
<view class="selectAddress" @click="clickUniMap">
选择收货地址
<u-form :model="form" ref="uForm" error-type="toast" :rules="rules">
<u-form-item label="收货人" label-width="130" prop="name" :border-bottom="true">
<u-input
v-model="form.name"
border="none"
input-align="right"
clearable
placeholder="请输入收货人姓名"
/>
</u-form-item>
<u-form-item label="手机号码" label-width="130" prop="mobile" :border-bottom="true">
<u-input
v-model="form.mobile"
type="number"
maxlength="11"
border="none"
input-align="right"
placeholder="请输入收货人手机号码"
/>
</u-form-item>
<u-form-item label="所在区域" label-width="130" prop="___path" :border-bottom="true">
<view class="form-value" @click="showPicker">
{{ form.___path || '请选择所在地区' }}
</view>
<!-- #endif -->
<u-form-item class="border" label="收货人" label-width="130" prop="name">
<u-input v-model="form.name" clearable placeholder="请输入收货人姓名" />
</u-form-item>
<template #right>
<u-icon name="arrow-right" color="#ccc" size="16"></u-icon>
</template>
</u-form-item>
<u-form-item label="手机号码" label-width="130" prop="mobile">
<u-input v-model="form.mobile" type="number" maxlength="11" placeholder="请输入收货人手机号码" />
</u-form-item>
<u-form-item label="所在区域" label-width="130" prop="___path">
<div @click="showPicker" >
{{ form.___path || '请选择所在地区' }}
</div>
</u-form-item>
<u-form-item class="detailAddress" label="详细地址" label-width="130" prop="detail">
<u-input type="textarea" v-model="form.detail" maxlength="100" height="150" placeholder="街道楼牌号等" />
</u-form-item>
<u-form-item label="地址别名" label-width="130">
<u-input v-model="form.alias" placeholder="请输入地址别名" />
</u-form-item>
<u-checkbox usedAlone shape="circle" size="30" :active-color="lightColor" v-model:checked="form.isDefault" label="设为默认地址"></u-checkbox>
<u-form-item class="detailAddress" label="详细地址" label-width="130" prop="detail" :border-bottom="true">
<u-input
type="textarea"
v-model="form.detail"
maxlength="100"
height="150"
border="none"
placeholder="街道楼牌号等"
/>
</u-form-item>
<div class="saveBtn" @click="save">保存</div>
</u-form>
<u-form-item label="地址别名" label-width="130" :border-bottom="false">
<u-input
v-model="form.alias"
border="none"
input-align="right"
placeholder="请输入地址别名"
/>
</u-form-item>
<m-city :provinceData="list" headTitle="区域选择" ref="cityPicker" @funcValue="getpickerParentValue" pickerSize="4">
</m-city>
<view class="default-row">
<u-checkbox
usedAlone
shape="circle"
size="30"
:active-color="lightColor"
v-model:checked="form.isDefault"
label="设为默认地址"
></u-checkbox>
</view>
<uniMap v-if="mapFlag" @close="closeMap" @callback="callBackAddress" />
</div>
<view class="saveBtn" @click="save">保存</view>
</u-form>
<m-city
:provinceData="list"
headTitle="区域选择"
ref="cityPicker"
@funcValue="getpickerParentValue"
pickerSize="4"
></m-city>
<uniMap v-if="mapFlag" @close="closeMap" @callback="callBackAddress" />
</view>
</template>
<script>
@@ -299,66 +338,89 @@ export default {
};
</script>
<style scoped lang="scss">
page {
background: #f5f5f5;
}
.add-address {
min-height: 100vh;
background: #fff;
padding-bottom: 40rpx;
}
:deep(.u-form-item) {
padding: 0 30rpx;
min-height: 100rpx;
}
:deep(.u-form-item__body) {
min-height: 100rpx;
align-items: center;
}
:deep(.u-form-item__body__left__content__label) {
font-size: 30rpx;
color: #333;
}
:deep(.u-form-item__body__right__content__slot) {
flex: 1;
display: flex;
justify-content: flex-end;
align-items: center;
}
:deep(.u-input) {
padding: 0 !important;
}
:deep(.u-input__content__field-wrapper__field) {
font-size: 28rpx !important;
color: #666 !important;
}
.form-value {
width: 100%;
text-align: right;
font-size: 28rpx;
color: #666;
}
.detailAddress {
::v-deep .u-form-item--left {
display: flex;
:deep(.u-form-item__body) {
align-items: flex-start;
padding-top: 24rpx;
padding-bottom: 24rpx;
min-height: auto;
}
:deep(.u-form-item__body__left) {
padding-top: 8rpx;
}
:deep(.u-form-item__body__right__content__slot) {
justify-content: flex-start;
align-items: flex-start;
}
}
.saveBtn,
.selectAddress {
height: 70rpx;
line-height: 70rpx;
.default-row {
padding: 24rpx 30rpx;
}
:deep(.default-row .u-checkbox__label) {
font-size: 28rpx;
color: $font-color-light;
}
.saveBtn {
margin: 40rpx 30rpx 0;
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size: 30rpx;
background: $aider-light-color;
background: $light-color;
color: #fff;
width: 70%;
margin: 40rpx auto 0 auto;
border-radius: 20rpx;
border-radius: 40rpx;
}
.selectAddress {
margin-top: 40rpx;
background: #fff;
color: $aider-light-color;
border: 2rpx solid $aider-light-color;
}
.uForm {
width: 94%;
overflow: hidden;
left: 3%;
position: relative;
top: 2%;
background: #fff;
border-radius: 20rpx;
padding: 0 0 40rpx 0;
}
.add-address {
width: 100%;
padding-top: 3%;
::v-deep .u-form-item {
background-color: #fff;
padding: 24rpx 30rpx;
}
.u-btn {
margin: 30rpx 30rpx 0 30rpx;
background-color: $main-color;
}
::v-deep.u-checkbox {
margin: 30rpx 30rpx 0 30rpx;
.u-label-class.u-checkbox__label {
color: $font-color-light;
font-size: $font-sm;
}
}
}
::v-deep .u-checkbox__label {
font-size: 28rpx;
}
</style>
</style>

View File

@@ -1,69 +1,75 @@
<template>
<view class="wap">
<u-navbar title="预存款列表">
</u-navbar>
<u-navbar
title="预存款列表"
:fixed="true"
:placeholder="true"
:border="false"
:auto-back="true"
></u-navbar>
<view class="wrapper-show-money">
<view class="money-view">
<h3>预存款金额 </h3>
<view class="money">{{unitPrice(walletNum) }}</view>
<text class="money-label">预存款金额</text>
<text class="money">{{ unitPrice(walletNum) }}</text>
</view>
</view>
<view class="wrapper-tabs">
<swiper class="swiper-box" :current="swiperCurrent">
<view class="wrapper-tabs">
<swiper class="swiper-box" :current="swiperCurrent">
<swiper-item class="swiper-item" v-for="index in list.length" :key="index">
<scroll-view class="scroll-v view-wrapper" enableBackToTop="true" scroll-with-animation scroll-y @scrolltolower="loadMore">
<view v-if="depositData.length!=0" class="view-item" v-for="(logItem, logIndex) in depositData" :key="logIndex">
<view class="view-item-detail">
<view class="-title">{{logItem.detail}}</view>
<!-- <view class="-number">{{logItem.detail}}</view> -->
</view>
<view class="view-item-change">
<view class="-money green" v-if="logItem.serviceType == 'WALLET_PAY' || logItem.serviceType == 'WALLET_WITHDRAWAL'"> {{unitPrice(logItem.money)}} </view>
<view class="-money" v-if="logItem.serviceType == 'WALLET_REFUND' || logItem.serviceType == 'WALLET_RECHARGE' || logItem.serviceType == 'WALLET_COMMISSION' ">
+{{unitPrice(logItem.money)}} </view>
<view class="-time">{{logItem.createTime}}</view>
<scroll-view
class="scroll-v view-wrapper"
enable-back-to-top
scroll-with-animation
scroll-y
@scrolltolower="loadMore"
>
<view v-if="depositData.length != 0" class="list-card">
<view
class="view-item"
v-for="(logItem, logIndex) in depositData"
:key="logIndex"
>
<view class="view-item-detail">
<text class="item-title">{{ logItem.detail }}</text>
</view>
<view class="view-item-change">
<text
class="item-money"
:class="getMoneyClass(logItem.serviceType)"
>{{ formatLogMoney(logItem) }}</text>
<text class="item-time">{{ logItem.createTime }}</text>
</view>
</view>
</view>
<u-empty v-if="depositData.length==0" mode="history" text="暂无记录" />
<u-empty v-if="depositData.length == 0" mode="history" text="暂无记录" />
</scroll-view>
</swiper-item>
</swiper>
</view>
</view>
</template>
<script>
import { getUserRecharge, getWalletLog } from "@/api/members";
import { getUserWallet } from "@/api/members";
import { getUserRecharge, getWalletLog, getUserWallet } from "@/api/members";
export default {
data() {
return {
walletNum: 0,
current: 0,
swiperCurrent: 0,
userInfo: "", //用户详情信息
userInfo: "",
params: {
pageNumber: 1,
pageSize: 10,
order: "desc",
},
depositData: [], //遍历的数据集合
rechargeList: "", //充值明细列表
walletLogList: "", //钱包变动列表
list: [
// {
// name: "充值明细",
// },
{
name: "预存款变动明细",
},
],
depositData: [],
rechargeList: "",
walletLogList: "",
list: [{ name: "预存款变动明细" }],
};
},
watch: {
@@ -73,47 +79,51 @@ export default {
},
async mounted() {
this.getWallet();
let result = await getUserWallet(); //预存款
const result = await getUserWallet();
this.walletNum = result.data.result.memberWallet;
},
methods: {
/**分页获取预存款充值记录 */
isOutgoing(serviceType) {
return serviceType === "WALLET_PAY" || serviceType === "WALLET_WITHDRAWAL";
},
isIncoming(serviceType) {
return (
serviceType === "WALLET_REFUND" ||
serviceType === "WALLET_RECHARGE" ||
serviceType === "WALLET_COMMISSION"
);
},
getMoneyClass(serviceType) {
if (this.isOutgoing(serviceType)) return "out";
if (this.isIncoming(serviceType)) return "in";
return "";
},
formatLogMoney(logItem) {
const amount = this.unitPrice(logItem.money);
if (this.isOutgoing(logItem.serviceType)) return `-${amount}`;
if (this.isIncoming(logItem.serviceType)) return `+${amount}`;
return amount;
},
getRecharge() {
getUserRecharge(this.params).then((res) => {
if (res.data.success) {
if (res.data.result.records.length != 0) {
this.depositData.push(...res.data.result.records);
}
if (res.data.success && res.data.result.records.length) {
this.depositData.push(...res.data.result.records);
}
});
},
getWallet() {
getWalletLog(this.params).then((res) => {
if (res.data.success) {
if (res.data.result.records.length != 0) {
this.depositData.push(...res.data.result.records);
}
if (res.data.success && res.data.result.records.length) {
this.depositData.push(...res.data.result.records);
}
});
},
changed(index) {
this.depositData = [];
this.swiperCurrent = index;
this.params.pageNumber = 1;
if (index == 0) {
// this.getRecharge();
this.getWallet();
} else {
this.getWallet();
}
this.getWallet();
},
loadMore() {
this.params.pageNumber++;
this.getWallet();
@@ -123,97 +133,123 @@ export default {
</script>
<style lang="scss" scoped>
.green {
color: $aider-color-green !important;
.wap {
min-height: 100vh;
display: flex;
flex-direction: column;
background: #f5f5f5;
}
.wrapper-show-money {
flex-shrink: 0;
height: 200rpx;
}
.money-view {
height: 100%;
padding: 32rpx 40rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
color: #fff;
background-image: linear-gradient(
25deg,
$main-color,
$light-color,
$aider-light-color
);
}
.money-label {
font-size: 28rpx;
opacity: 0.95;
}
.money {
margin-top: 12rpx;
max-width: 100%;
font-size: 56rpx;
font-weight: 600;
line-height: 1.2;
word-break: break-all;
}
.wrapper-tabs {
flex: 1;
min-height: 0;
padding: 24rpx;
box-sizing: border-box;
}
.swiper-box,
.swiper-item,
.scroll-v {
height: 100%;
}
.list-card {
background: #fff;
border-radius: 16rpx;
overflow: hidden;
}
.view-item {
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
padding: 28rpx 32rpx;
border-bottom: 1px solid #f5f5f5;
&:last-child {
border-bottom: none;
}
.view-item {
padding: 32rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.view-item-detail {
flex: 1;
min-width: 0;
padding-right: 24rpx;
}
.item-title {
font-size: 28rpx;
color: #333;
line-height: 1.5;
word-break: break-all;
}
.view-item-change {
flex-shrink: 0;
display: flex;
flex-direction: column;
align-items: flex-end;
align-self: center;
text-align: right;
}
.item-money {
font-size: 34rpx;
font-weight: 600;
line-height: 1.3;
white-space: nowrap;
&.in {
color: $aider-color-green;
}
.view-item-change {
text-align: right;
> .-money {
font-size: 36rpx;
color: $main-color;
font-weight: bold;
}
> .-time {
font-size: 22rpx;
color: #999;
}
}
.view-item-detail {
line-height: 1.75;
> .-title {
font-size: 28rpx;
}
> .-number {
font-size: 22rpx;
color: #999;
}
}
.submit-btn {
line-height: 90rpx;
text-align: center;
color: #fff;
background: $main-color;
margin: 0 auto;
height: 90rpx;
}
.operation {
font-size: 32rpx;
margin-right: 24rpx;
color: rgb(96, 98, 102);
}
.money {
font-size: 40rpx;
font-weight: bold;
}
.money-view {
height: 100%;
width: 100%;
padding: 0 32rpx;
display: flex;
align-items: flex-end;
justify-content: center;
flex-direction: column;
color: #fff;
background-image: linear-gradient(
25deg,
$main-color,
$light-color,
$aider-light-color
);
}
.swiper-item,
.scroll-v {
height: 100%;
}
.swiper-box {
/* #ifndef H5 */
height: calc(100vh - 200rpx);
/* #endif */
/* #ifdef H5 */
height: calc(100vh - 288rpx);
/* #endif */
}
.wap {
width: 100%;
height: calc(100vh - 44px);
}
.wrapper-show-money {
height: 200rpx;
// background-image: url('/static/img/main-bg.jpg');
&.out {
color: #ff5a5f;
}
}
.item-time {
margin-top: 8rpx;
font-size: 22rpx;
color: #999;
line-height: 1.3;
white-space: nowrap;
}
</style>

View File

@@ -1,27 +1,41 @@
<template>
<div class="wrapper">
<u-navbar :auto-back="false" @leftClick="back" title="余额"></u-navbar>
<div class="box">
<div class="deposit">预存款金额</div>
<div class="money">{{unitPrice(walletNum) }}</div>
<div class="operation-btns">
<div class="operation-btn light" @click="navigateTo('/pages/mine/deposit/withdrawal')">提现</div>
<div class="operation-btn" @click="navigateTo('/pages/mine/deposit/recharge')">充值</div>
</div>
</div>
<div class="box list" @click="navigateTo('/pages/mine/deposit/index')">
<div class="list-left">预存款明细</div>
<div class="list-right">
<u-icon name="arrow-right"></u-icon>
</div>
</div>
<div class="box list" @click="navigateTo('/pages/mine/deposit/withdrawApply')">
<div class="list-left">提现记录</div>
<div class="list-right">
<u-icon name="arrow-right"></u-icon>
</div>
</div>
</div>
<view class="page">
<u-navbar
title="余额"
:auto-back="false"
:placeholder="true"
:border="false"
@leftClick="back"
></u-navbar>
<view class="page-body">
<view class="balance-card">
<view class="deposit">预存款金额</view>
<view class="money">{{ unitPrice(walletNum) }}</view>
<view class="operation-btns">
<view
class="operation-btn light"
@click="navigateTo('/pages/mine/deposit/withdrawal')"
>提现</view>
<view
class="operation-btn primary"
@click="navigateTo('/pages/mine/deposit/recharge')"
>充值</view>
</view>
</view>
<view class="menu-list">
<view class="list-item" @click="navigateTo('/pages/mine/deposit/index')">
<text class="list-label">预存款明细</text>
<u-icon name="arrow-right" color="#ccc" size="16"></u-icon>
</view>
<view class="list-item" @click="navigateTo('/pages/mine/deposit/withdrawApply')">
<text class="list-label">提现记录</text>
<u-icon name="arrow-right" color="#ccc" size="16"></u-icon>
</view>
</view>
</view>
</view>
</template>
<script>
@@ -34,7 +48,7 @@ export default {
},
async onShow() {
if (this.isLogin("auth")) {
let result = await getUserWallet(); //预存款
let result = await getUserWallet();
this.walletNum = result.data.result.memberWallet;
} else {
this.navigateToLogin("redirectTo");
@@ -46,75 +60,92 @@ export default {
url: "/pages/tabbar/user/my",
});
},
/**
* 跳转
*/
navigateTo(url) {
uni.navigateTo({
url,
});
uni.navigateTo({ url });
},
},
};
</script>
<style lang="scss" scoped>
.list {
display: flex;
justify-content: center;
align-items: center;
.page {
min-height: 100vh;
background: #f5f5f5;
}
.list-left {
flex: 8;
}
.list-right {
flex: 2;
text-align: right;
}
.wrapper {
width: 94%;
margin: 0 3%;
}
.box {
margin: 20rpx 0;
background: #fff;
border-radius: 20rpx;
padding: 40rpx;
.page-body {
padding: 24rpx;
}
.balance-card {
background: #fff;
border-radius: 16rpx;
padding: 48rpx 32rpx 40rpx;
text-align: center;
}
.deposit {
font-size: 28rpx;
color: #999;
}
.money {
margin: 24rpx 0 40rpx;
font-size: 64rpx;
font-weight: 600;
color: #333;
letter-spacing: 2rpx;
}
.operation-btns {
display: flex;
justify-content: center;
flex-direction: row;
align-items: center;
gap: 24rpx;
}
.money {
text-align: center;
color: #333;
font-size: 50rpx;
margin: 20rpx 0 40rpx 0;
letter-spacing: 2rpx;
}
.deposit {
margin-top: 50rpx;
text-align: center;
color: #999;
font-size: 28rpx;
letter-spacing: 2rpx;
}
.operation-btn {
background: #ee6d41;
color: #fff;
height: 90rpx;
width: 240rpx;
margin: 0 20rpx;
border-radius: 10rpx;
flex: 1;
height: 88rpx;
line-height: 88rpx;
border-radius: 12rpx;
font-size: 30rpx;
text-align: center;
line-height: 90rpx;
font-size: 32rpx;
}
.light {
background: #fdf2ee;
color: #ee6d41;
color: $light-color;
border: 1px solid rgba(238, 109, 65, 0.25);
}
.primary {
background: $light-color;
color: #fff;
}
.menu-list {
margin-top: 24rpx;
background: #fff;
border-radius: 16rpx;
overflow: hidden;
}
.list-item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 32rpx;
border-bottom: 1px solid #f5f5f5;
&:last-child {
border-bottom: none;
}
}
.list-label {
font-size: 30rpx;
color: #333;
}
</style>

View File

@@ -1,52 +1,136 @@
<template>
<view>
<view class="-list">
<view class="page">
<view class="form-card">
<view class="title">充值金额</view>
<view class="content">
<view class="price">
<span> </span>
<u-input v-model="price" placeholder='金额' type="number" />
</view>
<view class="amount-row">
<text class="currency"></text>
<u-input
v-model="price"
type="digit"
border="none"
placeholder="请输入充值金额"
input-align="left"
class="amount-input"
/>
</view>
</view>
<view class="submit" :class="{'light':flag}" @click="handlerRecharge">充值</view>
<view class="submit" :class="{ disabled: flag }" @click="handlerRecharge">充值</view>
</view>
</template>
<script>
import { recharge } from "@/api/members";
export default {
data() {
return {
price: 0,
price: "",
flag: true,
};
},
watch: {
price(val) {
val <= 0 ? (this.flag = true) : (this.flag = false);
this.flag = !(Number(val) > 0);
},
},
mounted() {},
methods: {
// 充值
async handlerRecharge() {
if (this.price > 0) {
let res = await recharge({ price: this.price });
if (res.data.success) {
uni.navigateTo({
url: `/pages/cart/payment/payOrder?orderType=RECHARGE&recharge_sn=${res.data.result.rechargeSn}`,
});
}
const amount = Number(this.price);
if (!(amount > 0)) {
uni.showToast({
title: "请输入充值金额",
icon: "none",
});
return;
}
const res = await recharge({ price: amount });
if (res.data.success) {
uni.navigateTo({
url: `/pages/cart/payment/payOrder?orderType=RECHARGE&recharge_sn=${res.data.result.rechargeSn}`,
});
}
},
},
};
</script>
<style lang="scss" scoped>
@import './style.scss';
</style>
.page {
min-height: 100vh;
background: #f5f5f5;
padding: 24rpx;
box-sizing: border-box;
}
.form-card {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
}
.title {
font-size: 30rpx;
color: #333;
margin-bottom: 24rpx;
}
.amount-row {
display: flex;
flex-direction: row;
align-items: center;
padding: 16rpx 0 8rpx;
border-bottom: 1px solid #f0f0f0;
}
.currency {
flex-shrink: 0;
margin-right: 16rpx;
font-size: 56rpx;
font-weight: 600;
line-height: 1;
color: #333;
}
.amount-input {
flex: 1;
min-width: 0;
}
:deep(.amount-input .u-input) {
padding: 0 !important;
}
:deep(.amount-input .u-input__content) {
background: transparent !important;
}
:deep(.amount-input .u-input__content__field-wrapper__field) {
height: 72rpx !important;
min-height: 72rpx !important;
font-size: 56rpx !important;
font-weight: 600 !important;
color: #333 !important;
}
:deep(.amount-input .u-input__content__field-wrapper__field--placeholder) {
font-size: 32rpx !important;
font-weight: 400 !important;
color: #c0c4cc !important;
}
.submit {
margin-top: 80rpx;
height: 88rpx;
line-height: 88rpx;
background: $light-color;
color: #fff;
border-radius: 44rpx;
text-align: center;
font-size: 32rpx;
&.disabled {
opacity: 0.5;
}
}
</style>

View File

@@ -1,6 +1,12 @@
<template>
<view class="wap">
<u-navbar title="提现记录"></u-navbar>
<u-navbar
title="提现记录"
:fixed="true"
:placeholder="true"
:border="false"
:auto-back="true"
></u-navbar>
<scroll-view class="scroll-v view-wrapper" enableBackToTop="true" scroll-with-animation scroll-y @scrolltolower="loadMore">
<view v-if="records.length != 0" class="view-item" v-for="(item, index) in records" :key="index">
<view class="view-item-detail">

View File

@@ -1,122 +1,273 @@
<template>
<view>
<view class="-list">
<view class="title">提现类型</view>
<view class="content">
<view class="price">
<u-input disabled :value="type === 'ALI' ? '支付宝' : '微信'" placeholder="" />
</view>
</view>
<view class="page">
<view class="form-card">
<view class="field-label">提现类型</view>
<view class="readonly-value">{{ typeLabel }}</view>
</view>
<view class="-list">
<view class="title">提现金额</view>
<view class="content">
<view class="price">
<span> </span>
<u-input v-model="price" placeholder="" type="number" />
</view>
<view class="all">
<view @click="handleAll" :style="{ color: $mainColor }">全部</view>
<view style="font-size: 24rpx; color: #999">可提现金额<span>{{unitPrice(walletNum) }}</span></view>
</view>
</view>
<view class="tips">
最低提现金额为 {{ minPrice }}
</view>
</view>
<view class="-list" v-if="type === 'ALI'">
<view class="title">真实姓名</view>
<view class="content">
<view class="price">
<u-input v-model="realName" placeholder="" />
</view>
</view>
</view>
<view class="-list" v-if="type === 'ALI'">
<view class="title">第三方登录账号</view>
<view class="content">
<view class="price">
<u-input v-model="connectNumber" placeholder="" />
</view>
</view>
</view>
<view class="form-card">
<view class="field-label">提现金额</view>
<view class="amount-main">
<view class="amount-left">
<text class="currency"></text>
<u-input
v-model="price"
type="digit"
border="none"
placeholder="请输入提现金额"
input-align="left"
class="amount-input"
/>
</view>
<view class="amount-extra">
<text class="all-btn" @click="handleAll">全部</text>
<text class="balance-tip">可提现金额 {{ unitPrice(walletNum) }} </text>
</view>
</view>
<view class="tips">最低提现金额为 {{ minPrice }} </view>
</view>
<template v-if="type === 'ALI'">
<view class="form-card">
<view class="field-row">
<text class="field-label">真实姓名</text>
<u-input
v-model="realName"
border="none"
input-align="right"
placeholder="请输入真实姓名"
class="field-input"
/>
</view>
</view>
<view class="form-card">
<view class="field-row">
<text class="field-label">第三方登录账号</text>
<u-input
v-model="connectNumber"
border="none"
input-align="right"
placeholder="请输入支付宝账号"
class="field-input"
/>
</view>
</view>
</template>
<view class="submit" @click="cashd">提现</view>
</view>
</template>
<script>
import { getUserWallet, withdrawalApply, withdrawalSettingVO } from "@/api/members";
export default {
data() {
return {
price: 0,
price: "",
walletNum: 0,
minPrice: 0,
type: '',
connectNumber: '',
realName: ''
minPrice: 0,
type: "",
connectNumber: "",
realName: "",
};
},
async mounted() {
let result = await getUserWallet(); //预存款
let res = await withdrawalSettingVO();
this.walletNum = result.data.result.memberWallet;
this.minPrice = res.data.result.minPrice;
this.type = res.data.result.type;
computed: {
typeLabel() {
if (this.type === "ALI") return "支付宝";
if (this.type) return "微信";
return "--";
},
},
async mounted() {
const result = await getUserWallet();
const res = await withdrawalSettingVO();
this.walletNum = result.data.result.memberWallet;
this.minPrice = res.data.result.minPrice;
this.type = res.data.result.type;
},
methods: {
cashd() {
this.price = this.price + "";
if (this.$u.test.amount(parseInt(this.price))) {
let params = { price: this.price };
if (this.type === 'ALI') {
if (!this.connectNumber || !this.realName) {
uni.showToast({
title: "请输入真实姓名和第三方登录账号",
duration: 2000,
icon: "none",
});
return;
}
params.connectNumber = this.connectNumber;
params.realName = this.realName;
}
withdrawalApply(params).then((res) => {
if (res.data.success) {
uni.showToast({
title: "提现成功!",
duration: 2000,
icon: "none",
});
setTimeout(() => {
uni.navigateBack({
delta: 1,
});
}, 1000);
}
});
} else {
const amount = Number(this.price);
if (!this.$u.test.amount(parseInt(amount))) {
uni.showToast({
title: "请输入正确金额",
duration: 2000,
icon: "none",
});
return;
}
const params = { price: amount };
if (this.type === "ALI") {
if (!this.connectNumber || !this.realName) {
uni.showToast({
title: "请输入真实姓名和第三方登录账号",
duration: 2000,
icon: "none",
});
return;
}
params.connectNumber = this.connectNumber;
params.realName = this.realName;
}
withdrawalApply(params).then((res) => {
if (res.data.success) {
uni.showToast({
title: "提现成功!",
duration: 2000,
icon: "none",
});
setTimeout(() => {
uni.navigateBack({ delta: 1 });
}, 1000);
}
});
},
handleAll() {
this.price = this.walletNum;
this.price = String(this.walletNum || "");
},
},
};
</script>
<style lang="scss" scoped>
@import "./style.scss";
.page {
min-height: 100vh;
background: #f5f5f5;
padding: 24rpx;
box-sizing: border-box;
}
.form-card {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
}
.field-label {
font-size: 30rpx;
color: #333;
}
.readonly-value {
margin-top: 20rpx;
font-size: 32rpx;
color: #666;
}
.amount-main {
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
margin-top: 20rpx;
padding-bottom: 16rpx;
border-bottom: 1px solid #f0f0f0;
}
.amount-left {
flex: 1;
min-width: 0;
display: flex;
flex-direction: row;
align-items: center;
}
.currency {
flex-shrink: 0;
margin-right: 12rpx;
font-size: 56rpx;
font-weight: 600;
line-height: 1;
color: #333;
}
.amount-input {
flex: 1;
min-width: 0;
}
.amount-extra {
flex-shrink: 0;
display: flex;
flex-direction: column;
align-items: flex-end;
margin-left: 24rpx;
padding-top: 8rpx;
}
.all-btn {
font-size: 28rpx;
color: $main-color;
line-height: 1.4;
}
.balance-tip {
margin-top: 12rpx;
font-size: 24rpx;
color: #999;
line-height: 1.4;
white-space: nowrap;
}
.tips {
margin-top: 20rpx;
font-size: 24rpx;
color: #999;
}
</style>
.field-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.field-input {
flex: 1;
min-width: 0;
margin-left: 24rpx;
}
:deep(.amount-input .u-input),
:deep(.field-input .u-input) {
padding: 0 !important;
}
:deep(.amount-input .u-input__content),
:deep(.field-input .u-input__content) {
background: transparent !important;
}
:deep(.amount-input .u-input__content__field-wrapper__field) {
height: 72rpx !important;
min-height: 72rpx !important;
font-size: 56rpx !important;
font-weight: 600 !important;
color: #333 !important;
}
:deep(.amount-input .u-input__content__field-wrapper__field--placeholder) {
font-size: 32rpx !important;
font-weight: 400 !important;
color: #c0c4cc !important;
}
:deep(.field-input .u-input__content__field-wrapper__field) {
font-size: 28rpx !important;
color: #666 !important;
}
.submit {
margin-top: 56rpx;
height: 88rpx;
line-height: 88rpx;
background: $light-color;
color: #fff;
border-radius: 44rpx;
text-align: center;
font-size: 32rpx;
}
</style>

View File

@@ -67,44 +67,67 @@
<view class="goods-list">
<scroll-view class="body-view" scroll-y @scrolltolower="renderDate">
<u-swipe-action v-for="(item, index) in goodsList" ref="swiperAction" :key="item.id">
<u-swipe-action-item :disabled="!params.checked" :show="item.___selected" @open="openAction(item)" :name="index" :options="options"
@click="changeActionTab(item)">
<block v-for="(item, index) in goodsList" :key="item.id">
<u-swipe-action v-if="params.checked" class="distribution-swipe">
<u-swipe-action-item
:show="item.___selected"
@open="openAction(item)"
:name="index"
:options="options"
@click="changeActionTab(item)"
>
<view class="goods-item">
<view class="goods-item-img" @click="handleNavgationGoods(item)">
<u-image width="176rpx" height="176rpx" :src="item.thumbnail"></u-image>
</view>
<view class="goods-item-desc">
<view class="-item-title" @click="handleNavgationGoods(item)">
{{ item.goodsName }}
</view>
<view class="-item-price" @click="handleNavgationGoods(item)">
佣金:
<span> {{ unitPrice(item.commission) }}</span>
</view>
<view class="-item-bottom">
<view class="-item-bootom-money" @click="handleNavgationGoods(item)">
<view class="-item-yj">
<span>{{ unitPrice(item.price) }}</span>
</view>
</view>
<view>
<view class="click" @click="handleLink(item)">分销商品</view>
</view>
</view>
</view>
</view>
</u-swipe-action-item>
</u-swipe-action>
<div class="goods-item">
<view v-else class="goods-item">
<view class="goods-item-img" @click="handleNavgationGoods(item)">
<u-image width="176rpx" height="176rpx" :src="item.thumbnail"></u-image>
</view>
<view class="goods-item-desc">
<!-- 商品描述 -->
<view class="-item-title" @click="handleNavgationGoods(item)">
{{ item.goodsName }}
</view>
<!-- 商品金额 -->
<view class="-item-price" @click="handleNavgationGoods(item)">
佣金:
<span> {{unitPrice(item.commission) }}</span>
<span> {{ unitPrice(item.commission) }}</span>
</view>
<!-- 比率佣金 -->
<view class="-item-bottom">
<view class="-item-bootom-money" @click="handleNavgationGoods(item)">
<!-- <view class="-item-bl">
比率:
<span>{{ "5.00%" }}</span>
</view> -->
<view class="-item-yj">
<span>{{unitPrice(item.price) }}</span>
<span>{{ unitPrice(item.price) }}</span>
</view>
</view>
<view>
<view class="click" v-if="!params.checked" @click="handleClickGoods(item)">立即选取</view>
<view class="click" v-if="params.checked" @click="handleLink(item)">分销商品</view>
<view class="click" @click="handleClickGoods(item)">立即选取</view>
</view>
</view>
</view>
</div>
</u-swipe-action-item>
</u-swipe-action>
</view>
</block>
</scroll-view>
@@ -419,7 +442,39 @@ export default {
height: 88rpx;
flex: 1;
text-align: center;
position: relative;
color: #666;
}
> .nav-item.checked {
color: $main-color;
font-weight: bold;
&::after {
content: "";
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
width: 80rpx;
height: 4rpx;
background: $main-color;
border-radius: 2rpx;
}
}
}
.distribution-swipe,
:deep(.u-swipe-action),
:deep(.u-swipe-action-item),
:deep(.u-swipe-action-item__content) {
width: 100%;
}
:deep(.u-swipe-action-item) {
overflow: hidden;
}
:deep(.u-swipe-action-item__content) {
overflow: hidden;
}
.click {
background: $main-color;

View File

@@ -1,6 +1,14 @@
<template>
<view class="wrapper">
<u-navbar class="my-title" title-size="32" :title="toUser.name"></u-navbar>
<u-navbar
class="my-title"
title-size="32"
:title="toUser.name"
:fixed="true"
:placeholder="true"
:border="false"
:auto-back="true"
></u-navbar>
<!-- 空盒子用来防止消息过少时 拉起键盘会遮盖消息 -->
<view :animation="anData" style="height:0;">
</view>

View File

@@ -1,6 +1,14 @@
<template>
<view class="content">
<u-navbar class="my-title" title-size="32" :title="'消息(' + talkList.length + ')'"></u-navbar>
<u-navbar
class="my-title"
title-size="32"
:title="'消息(' + talkList.length + ')'"
:fixed="true"
:placeholder="true"
:border="false"
:auto-back="true"
></u-navbar>
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData(tabIndex)">
<!-- 消息列表 -->

View File

@@ -4,7 +4,7 @@
:fixed="true"
:placeholder="true"
:border="false"
left-icon=""
:auto-back="true"
title=""
>
<template #center>
@@ -311,9 +311,11 @@
}
.slot-wrap {
width: 100%;
flex: 1;
display: flex;
justify-content: center;
padding: 0 20rpx;
box-sizing: border-box;
}
.collect-tabs {

View File

@@ -1,6 +1,11 @@
<template>
<view class="myTracks">
<u-navbar title="我的足迹">
<u-navbar
title="我的足迹"
:fixed="true"
:placeholder="true"
:auto-back="true"
>
<template #right>
<div class="light-color edit" @click="isEdit = !isEdit">{{ !isEdit ? '编辑' : '完成'}}</div>
</template>
@@ -12,7 +17,11 @@
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
<view v-else class="tracks-list">
<block v-for="(item, index) in trackList" :key="index">
<view class="myTracks-title" @click="navigateToStore(item)">{{ item.storeName }}</view>
<view
class="myTracks-title"
v-if="getStoreName(item)"
@click="navigateToStore(item)"
>{{ getStoreName(item) }}</view>
<u-swipe-action class="myTracks-swipe">
<u-swipe-action-item
:show="item.show"
@@ -60,6 +69,7 @@
myTrackList,
deleteHistoryListId
} from "@/api/members.js";
import { getStoreBaseInfo } from "@/api/store.js";
export default {
data() {
@@ -80,6 +90,7 @@
}
}],
trackList: [], //足迹列表
storeNameMap: {},
};
},
@@ -100,6 +111,32 @@
this.getList();
},
methods: {
getStoreName(item) {
return item.storeName || this.storeNameMap[item.storeId] || "";
},
async enrichStoreNames(records) {
const storeIds = [
...new Set(
records
.filter((item) => !item.storeName && item.storeId)
.map((item) => item.storeId)
),
].filter((storeId) => !this.storeNameMap[storeId]);
await Promise.all(
storeIds.map(async (storeId) => {
try {
const res = await getStoreBaseInfo(storeId);
const name = res.data?.result?.storeName;
if (name) {
this.storeNameMap[storeId] = name;
}
} catch (e) {
// ignore
}
})
);
},
checkboxChangeDP(val){
console.log(val)
},
@@ -147,21 +184,23 @@
uni.showLoading({
title: "加载中",
});
myTrackList(this.params).then((res) => {
myTrackList(this.params).then(async (res) => {
uni.stopPullDownRefresh();
uni.hideLoading();
if (res.statusCode == 200) {
res.data.result.records.length &&
res.data.result.records.forEach((item) => {
item.show = false;
item.checked = false
});
const records = res.data.result.records || [];
records.forEach((item) => {
item.show = false;
item.checked = false;
});
let data = res.data.result.records;
if (data.total == 0) {
this.whetherEmpty = true;
if (!records.length) {
if (this.trackList.length === 0) {
this.whetherEmpty = true;
}
} else {
this.trackList.push(...data);
await this.enrichStoreNames(records);
this.trackList.push(...records);
}
}
});

View File

@@ -1,40 +1,41 @@
<template>
<view class="edition-intro">
<image :src="config.logo" class="logo" />
<h1> {{config.name}}</h1>
<view class='version'>
<!-- #ifdef APP-PLUS -->
Version {{localVersion.version}}
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
小程序版本: {{localVersion.version}} {{ localVersion.envVersion}}
<!-- #endif -->
<view class="header-block">
<image :src="config.logo" class="logo" mode="aspectFit" />
<text class="app-name">{{ config.name }}</text>
<view class="version">
<!-- #ifdef APP-PLUS -->
Version {{ localVersion.version }}
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
小程序版本: {{ localVersion.version }} {{ localVersion.envVersion }}
<!-- #endif -->
</view>
</view>
<!-- {{localVersion}} -->
<u-cell-group class="cell" :border="false">
<!-- #ifdef APP-PLUS -->
<u-cell v-if="IosWhether" @click="checkStar" title="去评分"></u-cell>
<u-cell title="功能介绍" @click="navigateTo('/pages/mine/set/versionFunctionList')"></u-cell>
<u-cell title="检查更新" @click="checkUpdate"></u-cell>
<!-- #endif -->
<u-cell title="证照信息" @click="navigateTo('/pages/mine/help/tips?type=LICENSE_INFORMATION')"></u-cell>
<u-cell title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=USER_AGREEMENT')"></u-cell>
<u-cell title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=PRIVACY_POLICY')"></u-cell>
<u-cell title="关于我们" :border="false" @click="navigateTo('/pages/mine/help/tips?type=ABOUT')"></u-cell>
<u-cell-group class="cell-group">
<!-- #ifdef APP-PLUS -->
<u-cell v-if="IosWhether" isLink title="去评分" @click="checkStar"></u-cell>
<u-cell isLink title="功能介绍" @click="navigateTo('/pages/mine/set/versionFunctionList')"></u-cell>
<u-cell isLink title="检查更新" @click="checkUpdate"></u-cell>
<!-- #endif -->
<u-cell isLink title="证照信息" @click="navigateTo('/pages/mine/help/tips?type=LICENSE_INFORMATION')"></u-cell>
<u-cell isLink title="服务协议" @click="navigateTo('/pages/mine/help/tips?type=USER_AGREEMENT')"></u-cell>
<u-cell isLink title="隐私协议" @click="navigateTo('/pages/mine/help/tips?type=PRIVACY_POLICY')"></u-cell>
<u-cell isLink title="关于我们" @click="navigateTo('/pages/mine/help/tips?type=ABOUT')"></u-cell>
</u-cell-group>
<view class="intro">
<view>{{config.customerServiceMobile ? `客服热线:${config.customerServiceMobile}` : ``}}</view>
<view style="margin:20rpx 0 0 0;">{{config.customerServiceEmail ? `客服邮箱:${config.customerServiceEmail}` : ``}}</view>
<view>
<view style="margin:20rpx 0; color:#003a8c;" @click="navigateTo('/pages/mine/help/tips?type=USER_AGREEMENT')">{{config.name}}用户协议</view>
<view>CopyRight ©{{config.name}} </view>
<view v-if="config.customerServiceMobile">客服热线{{ config.customerServiceMobile }}</view>
<view v-if="config.customerServiceEmail" class="intro-line">客服邮箱{{ config.customerServiceEmail }}</view>
<view class="intro-line">
<text class="intro-link" @click="navigateTo('/pages/mine/help/tips?type=USER_AGREEMENT')">
{{ config.name }}用户协议
</text>
</view>
<view class="intro-line">CopyRight ©{{ config.name }}</view>
</view>
</view>
</template>
@@ -47,10 +48,10 @@ export default {
data() {
return {
config,
IosWhether: false, //是否是ios
editionHistory: [], //版本历史
versionData: {}, //版本信息
localVersion: "", //当前版本信息
IosWhether: false,
editionHistory: [],
versionData: {},
localVersion: "",
params: {
pageNumber: 1,
pageSize: 5,
@@ -60,9 +61,6 @@ export default {
onLoad() {
// #ifdef APP-PLUS
const platform = uni.getSystemInfoSync().platform;
/**
* 获取是否是安卓
*/
if (platform === "android") {
this.params.type = 0;
} else {
@@ -78,19 +76,16 @@ export default {
};
});
// #endif
// #ifdef MP-WEIXIN
const accountInfo = wx.getAccountInfoSync();
console.log("===========accountInfo==============");
console.log(accountInfo);
this.version_number = accountInfo.miniProgram.version // 小程序 版本号
this.localVersion = {
versionCode: accountInfo.miniProgram.version.replace(/\./g, ""),
version: accountInfo.miniProgram.version ,// 小程序 版本号,
envVersion:accountInfo.miniProgram.envVersion, //判断小程序是开发版本还是release版本
};
// #endif
// #ifdef MP-WEIXIN
const accountInfo = wx.getAccountInfoSync();
this.version_number = accountInfo.miniProgram.version;
this.localVersion = {
versionCode: accountInfo.miniProgram.version.replace(/\./g, ""),
version: accountInfo.miniProgram.version,
envVersion: accountInfo.miniProgram.envVersion,
};
// #endif
},
methods: {
@@ -110,18 +105,12 @@ export default {
});
},
/**
* ios点击评分
*/
checkStar() {
plus.runtime.launchApplication({
action: `itms-apps://itunes.apple.com/app/${config.iosAppId}?action=write-review`,
});
},
/**
* 检查更新
*/
checkUpdate() {
if (
this.versionData.version.replace(/\./g, "") <
@@ -144,34 +133,74 @@ export default {
page {
background: #fff !important;
}
.cell {
width: 90%;
margin: 0 auto;
}
.edition-intro {
min-height: 100vh;
background: #fff;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
> h1 {
margin: 20rpx 0 20rpx 0;
letter-spacing: 2rpx;
}
> .version {
font-size: 30rpx;
margin-bottom: 100rpx;
}
}
.intro {
margin-top: 100rpx;
font-size: 24rpx;
letter-spacing: 2rpx;
.header-block {
display: flex;
flex-direction: column;
align-items: center;
padding: 80rpx 0 48rpx;
}
.logo {
width: 200rpx;
height: 200rpx;
}
.app-name {
margin-top: 20rpx;
font-size: 36rpx;
font-weight: 500;
letter-spacing: 2rpx;
color: #333;
}
.version {
margin-top: 16rpx;
font-size: 28rpx;
color: #666;
}
.cell-group {
width: 100%;
}
:deep(.u-cell) {
padding: 0 30rpx;
}
:deep(.u-cell__title-text) {
font-size: 30rpx;
color: #333;
}
:deep(.u-cell__right-icon-wrap) {
color: #ccc !important;
}
.intro {
margin-top: auto;
width: 100%;
padding: 48rpx 40rpx 60rpx;
text-align: center;
font-size: 24rpx;
line-height: 1.6;
color: #666;
letter-spacing: 1rpx;
box-sizing: border-box;
}
.intro-line {
margin-top: 16rpx;
}
.intro-link {
color: #003a8c;
}
</style>

View File

@@ -1,93 +1,133 @@
<template>
<view class="person-msg">
<view class="head c-content" @click="changeFace">
<image :src="form.face || '/static/missing-face.png'" mode=""></image>
<view class="head" @click="changeFace">
<image :src="form.face || '/static/missing-face.png'" mode="aspectFill"></image>
<view>点击修改头像</view>
</view>
<u-form :model="form" ref="uForm" class="form">
<u-form-item label="昵称" label-width="150">
<u-input v-model="form.nickName" placeholder="请输入昵称" />
</u-form-item>
<u-form-item label="性别" label-width="150">
<u-radio-group v-model="form.sex" :active-color="lightColor">
<u-radio name="1"></u-radio>
<u-radio name="0"></u-radio>
</u-radio-group>
<u-form-item label="昵称" label-width="150" :border-bottom="true">
<u-input
v-model="form.nickName"
border="none"
input-align="right"
placeholder="请输入昵称"
/>
</u-form-item>
<u-form-item label="生日" label-width="150" right-icon="arrow-right">
<div style="width: 100%;" @click="showBirthday = true">{{ birthday || '请选择出生日期' }}</div>
<u-picker v-model:show="showBirthday" mode="time" :confirm-color="lightColor" @confirm="selectTime"></u-picker>
<u-form-item label="性别" label-width="150" :border-bottom="true">
<view class="sex-row">
<u-radio-group v-model="form.sex" :active-color="lightColor" :gap="40">
<u-radio name="1" label="男" shape="circle"></u-radio>
<u-radio name="0" label="女" shape="circle"></u-radio>
</u-radio-group>
</view>
</u-form-item>
<u-form-item label="城市" label-width="150" placeholder="请选择城市" right-icon="arrow-right">
<div style="width: 100%;" @click="clickRegion">{{ form.___path || '请选择城市' }}</div>
<u-form-item label="生日" label-width="150" :border-bottom="true">
<view class="form-value" @click="showBirthday = true">
{{ birthday || '请选择出生日期' }}
</view>
<template #right>
<u-icon name="arrow-right" color="#ccc" size="16"></u-icon>
</template>
</u-form-item>
<u-form-item label="城市" label-width="150" :border-bottom="true">
<view class="form-value" @click="clickRegion">
{{ form.___path || '请选择城市' }}
</view>
<template #right>
<u-icon name="arrow-right" color="#ccc" size="16"></u-icon>
</template>
</u-form-item>
<u-form-item label="手机号" label-width="150" :border-bottom="false">
<view v-if="form.mobile" class="form-value">{{ form.mobile }}</view>
<view v-else class="bind-mobile" @click="navigateTo(form.username)">绑定手机号码</view>
</u-form-item>
<u-form-item label="手机号" label-width="150">
<view v-if="form.mobile">
{{form.mobile}}
</view>
<view v-else>
<view class="submit" style="text-align: left;" @click="navigateTo(form.username)">绑定手机号码</view>
</view>
</u-form-item>
</u-form>
<div class="bottom">
<view class="bottom">
<view class="submit" @click="submit">保存</view>
<view class="submit light" @click="quiteLoginOut">退出登录</view>
</div>
<m-city :provinceData="region" headTitle="区域选择" ref="cityPicker" @funcValue="getPickerParentValue" pickerSize="4"></m-city>
<view class="submit light" @click="quiteLoginOut">退出登录</view>
</view>
<u-datetime-picker
v-model:show="showBirthday"
v-model="birthdayValue"
mode="date"
:min-date="minBirthdayDate"
:max-date="maxBirthdayDate"
:confirm-color="lightColor"
@confirm="selectTime"
@cancel="closeBirthdayPicker"
></u-datetime-picker>
<m-city
:provinceData="region"
headTitle="区域选择"
ref="cityPicker"
@funcValue="getPickerParentValue"
pickerSize="4"
></m-city>
</view>
</template>
<script>
import { saveUserInfo, getUserInfo } from "@/api/members.js";
import { saveUserInfo } from "@/api/members.js";
import { upload } from "@/api/common.js";
import storage from "@/utils/storage.js";
import city from "@/components/m-city/m-city.vue";
function parseBirthdayTimestamp(str) {
if (!str) {
return Date.now();
}
const timestamp = Date.parse(String(str).replace(/-/g, "/"));
return Number.isFinite(timestamp) ? timestamp : Date.now();
}
function formatBirthday(timestamp) {
const date = new Date(timestamp);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0");
return `${year}-${month}-${day}`;
}
export default {
components: { "m-city": city },
data() {
const userInfo = storage.getUserInfo() || {};
return {
lightColor: this.$lightColor, //高亮颜色
lightColor: this.$lightColor,
form: {
nickName: storage.getUserInfo().nickName || "",
birthday: storage.getUserInfo().birthday || "",
face: storage.getUserInfo().face || "/static/missing-face.png", //默认头像
regionId: [], //地址Id
region: storage.getUserInfo().region || [], //地址
sex: storage.getUserInfo().sex, //性别
___path: storage.getUserInfo().region,
mobile: storage.getUserInfo().mobile,
username: storage.getUserInfo().username,
nickName: userInfo.nickName || "",
birthday: userInfo.birthday || "",
face: userInfo.face || "/static/missing-face.png",
regionId: [],
region: userInfo.region || [],
sex: userInfo.sex != null ? String(userInfo.sex) : "1",
___path: userInfo.region,
mobile: userInfo.mobile,
username: userInfo.username,
},
birthday: storage.getUserInfo().birthday || "", //生日
photo: [
{ text: "立即拍照", color: this.$mainColor },
{ text: "从相册选择", color: this.$mainColor },
],
birthday: userInfo.birthday || "",
birthdayValue: parseBirthdayTimestamp(userInfo.birthday),
minBirthdayDate: new Date("1950-01-01").getTime(),
maxBirthdayDate: Date.now(),
region: [
//请求城市默认地址
{
id: "",
localName: "请选择",
children: [],
},
],
showBirthday: false, //显示生日日期
showBirthday: false,
};
},
methods: {
/**
* 退出登录
*/
quiteLoginOut() {
this.quiteLoginOut();
},
/**
* 选择地址回调
*/
getPickerParentValue(e) {
this.form.region = [];
this.form.regionId = [];
@@ -107,19 +147,13 @@ export default {
});
},
/**
* 点击选择地址
*/
clickRegion() {
this.$refs.cityPicker.show();
},
/**
* 提交保存
*/
submit() {
delete this.form.___path;
let params = JSON.parse(JSON.stringify(this.form));
const params = JSON.parse(JSON.stringify(this.form));
saveUserInfo(params).then((res) => {
if (res.statusCode == 200) {
storage.setUserInfo(res.data.result);
@@ -128,10 +162,7 @@ export default {
});
},
/**
* 修改头像
*/
changeFace(index) {
changeFace() {
uni.chooseImage({
success: (chooseImageRes) => {
const tempFilePaths = chooseImageRes.tempFilePaths;
@@ -143,8 +174,7 @@ export default {
accessToken: storage.getAccessToken(),
},
success: (uploadFileRes) => {
let data = JSON.parse(uploadFileRes.data);
const data = JSON.parse(uploadFileRes.data);
this.form.face = data.result;
},
});
@@ -152,74 +182,59 @@ export default {
});
},
/**
* 选择地址
*/
selectRegion(region) {
this.form["address"] = `${region.province.label} ${region.city.label} ${region.area.label}`
;
selectTime(e) {
const timestamp = typeof e?.value === "number" ? e.value : this.birthdayValue;
const formatted = formatBirthday(timestamp);
this.birthdayValue = timestamp;
this.form.birthday = formatted;
this.birthday = formatted;
this.showBirthday = false;
},
/**
* 选择时间
*/
selectTime(time) {
this.form.birthday = `${time.year}-${time.month}-${time.day}`;
this.birthday = `${time.year} - ${time.month} - ${time.day}`;
closeBirthdayPicker() {
this.showBirthday = false;
},
navigateTo(username) {
uni.navigateTo({
url: "/pages/mine/set/securityCenter/bindMobile?username=" + username,
});
},
syncUserInfo() {
const userInfo = storage.getUserInfo() || {};
this.form.nickName = userInfo.nickName || "";
this.form.birthday = userInfo.birthday || "";
this.form.face = userInfo.face || "/static/missing-face.png";
this.form.region = userInfo.region || [];
this.form.sex = userInfo.sex != null ? String(userInfo.sex) : "1";
this.form.___path = userInfo.region;
this.form.mobile = userInfo.mobile;
this.form.username = userInfo.username;
this.birthday = userInfo.birthday || "";
this.birthdayValue = parseBirthdayTimestamp(userInfo.birthday);
},
navigateTo(username) {
uni.navigateTo({
url: '/pages/mine/set/securityCenter/bindMobile' + '?username=' + username,
});
},
},
/**
* 加载数据
*/
onLoad() {},
/**
* 页面显示时执行
*/
onShow() {
// 从缓存中重新获取用户信息
const userInfo = storage.getUserInfo();
// 更新表单数据
this.form.nickName = userInfo.nickName || "";
this.form.birthday = userInfo.birthday || "";
this.form.face = userInfo.face || "/static/missing-face.png";
this.form.region = userInfo.region || [];
this.form.sex = userInfo.sex;
this.form.___path = userInfo.region;
this.form.mobile = userInfo.mobile;
this.form.username = userInfo.username;
this.birthday = userInfo.birthday || "";
this.syncUserInfo();
},
};
</script>
<style>
page{
<style lang="scss" scoped>
page {
background: #fff;
}
</style>
<style lang="scss" scoped>
.submit {
height: 90rpx;
line-height: 90rpx;
text-align: center;
margin-top: 90rpx;
width: 100%;
margin: 0 auto;
color: $main-color;
border-radius: 100px;
.person-msg {
min-height: 100vh;
background: #fff;
padding-bottom: 180rpx;
}
.head {
height: 260rpx;
padding: 40rpx 0 20rpx;
color: $font-color-light;
font-size: $font-sm;
display: flex;
@@ -227,39 +242,104 @@ page{
justify-content: center;
align-items: center;
line-height: 2em;
image {
width: 144rpx;
height: 144rpx;
border-radius: 50%;
}
}
::v-deep .u-form {
background-color: #ffffff;
padding: 0;
margin-top: 30rpx;
.u-form-item {
padding: 0 20rpx;
height: 110rpx;
line-height: 110rpx;
}
}
.form {
background-color: #ffffff;
background: #fff;
}
.bottom{
:deep(.u-form-item) {
padding: 0 30rpx;
min-height: 100rpx;
}
:deep(.u-form-item__body) {
min-height: 100rpx;
align-items: center;
}
:deep(.u-form-item__body__left__content__label) {
font-size: 30rpx;
color: #333;
}
:deep(.u-form-item__body__right__content__slot) {
flex: 1;
display: flex;
justify-content: flex-end;
align-items: center;
}
:deep(.u-input) {
padding: 0 !important;
}
:deep(.u-input__content__field-wrapper__field) {
font-size: 28rpx !important;
color: #666 !important;
}
.sex-row {
width: 100%;
display: flex;
justify-content: flex-end;
align-items: center;
}
:deep(.sex-row .u-radio-group) {
flex: 1;
justify-content: flex-end;
}
.form-value {
width: 100%;
text-align: right;
font-size: 28rpx;
color: #666;
}
.bind-mobile {
width: 100%;
text-align: right;
font-size: 28rpx;
color: $main-color;
}
.bottom {
position: fixed;
bottom: 40px;
left: 0;
right: 0;
bottom: 0;
display: flex;
align-items: center;
width: 100%;
>.submit{
background: $light-color;
color: #fff;
width: 40%;
}
justify-content: space-between;
padding: 24rpx 30rpx calc(24rpx + env(safe-area-inset-bottom));
background: #fff;
box-sizing: border-box;
}
.light{
.submit {
flex: 1;
height: 80rpx;
line-height: 80rpx;
text-align: center;
border-radius: 100px;
font-size: 30rpx;
background: $light-color;
color: #fff;
}
.submit + .submit {
margin-left: 24rpx;
}
.light {
background: rgba($color: $light-color, $alpha: 0.2) !important;
color: $light-color !important;
}

View File

@@ -1,29 +1,39 @@
<template>
<view class="container">
<view class="set-up">
<view class="person" @click="checkUserInfo()">
<u-image width=140 height="140" shape="circle" :src="userInfo.face || userImage" mode="">
</u-image>
<u-image
width="140rpx"
height="140rpx"
shape="circle"
:src="userInfo.face || userImage"
mode="aspectFill"
></u-image>
<view class="user-name">
{{ userInfo.id ? userInfo.nickName || '' : '暂未登录' }}
{{ userInfo.id ? userInfo.nickName || '' : '暂未登录' }}
</view>
<u-icon color="#ccc" name="arrow-right"></u-icon>
<u-icon color="#ccc" name="arrow-right" size="16"></u-icon>
</view>
<!-- #ifdef MP-WEIXIN -->
<view style="height: 20rpx; width: 100%"></view>
<!-- #endif -->
<u-cell-group :border="false">
<u-cell-group class="cell-group">
<!-- #ifdef APP-PLUS -->
<u-cell title="清除缓存" :value="fileSizeString" @click="clearCache"></u-cell>
<u-cell :isLink="false" title="清除缓存" :value="fileSizeString" @click="clearCache"></u-cell>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<u-cell title="安全中心" @click="navigateTo('/pages/mine/set/securityCenter/securityCenter')"></u-cell>
<u-cell
:isLink="false"
title="安全中心"
@click="navigateTo('/pages/mine/set/securityCenter/securityCenter')"
></u-cell>
<!-- #endif -->
<u-cell title="用户注销" v-if="userInfo.id" @click="logoff"></u-cell>
<u-cell title="意见反馈" @click="navigateTo('/pages/mine/set/feedBack')"></u-cell>
<!-- #ifndef H5 -->
<!-- #endif -->
<u-cell :title="`关于${config.name}`" @click="navigateTo('/pages/mine/set/editionIntro')"></u-cell>
<u-cell :isLink="false" title="用户注销" v-if="userInfo.id" @click="logoff"></u-cell>
<u-cell :isLink="false" title="意见反馈" @click="navigateTo('/pages/mine/set/feedBack')"></u-cell>
<u-cell
:isLink="false"
:title="`关于${config.name}`"
@click="navigateTo('/pages/mine/set/editionIntro')"
></u-cell>
</u-cell-group>
<view class="submit" v-if="userInfo.id" @click="quiteLoginOut">退出登录</view>
</view>
</template>
@@ -34,7 +44,7 @@ export default {
data() {
return {
config,
userImage:config.defaultUserPhoto,
userImage: config.defaultUserPhoto,
isCertificate: false,
userInfo: {},
fileSizeString: "0B",
@@ -50,25 +60,8 @@ export default {
url: url,
});
},
/**
* 退出登录
*/
quiteLoginOut() {
this.quiteLoginOut();
},
/**
* 用户注销
*/
logoff(){
this.logoff();
},
/**
* 读取当前缓存
*/
getCacheSize() {
//获取缓存数据
let that = this;
plus.cache.calculate(function (size) {
let sizeCache = parseInt(size);
@@ -86,10 +79,6 @@ export default {
});
},
/**
* 点击用户详情
* 判断当前是否进入用户中心
*/
checkUserInfo() {
if (this.isLogin("auth")) {
this.navigateTo("/pages/mine/set/personMsg");
@@ -98,11 +87,7 @@ export default {
}
},
/**
* 清除当前设备缓存
*/
clearCache() {
//清理缓存
let that = this;
let os = plus.os.name;
if (os == "Android") {
@@ -111,28 +96,27 @@ export default {
let files = plus.android.invoke(sdRoot, "listFiles");
let len = files.length;
for (let i = 0; i < len; i++) {
let filePath = "" + files[i]; // 没有找到合适的方法获取路径,这样写可以转成文件路径
let filePath = "" + files[i];
plus.io.resolveLocalFileSystemURL(
filePath,
function (entry) {
if (entry.isDirectory) {
entry.removeRecursively(
function (entry) {
//递归删除其下的所有文件及子目录
function () {
uni.showToast({
title: "缓存清理完成",
duration: 2000,
icon: "none",
});
that.getCacheSize(); // 重新计算缓存
that.getCacheSize();
},
function (e) {}
function () {}
);
} else {
entry.remove();
}
},
function (e) {
function () {
uni.showToast({
title: "文件路径读取失败",
duration: 2000,
@@ -142,7 +126,6 @@ export default {
);
}
} else {
// ios
plus.cache.clear(function () {
uni.showToast({
title: "缓存清理完成",
@@ -163,50 +146,58 @@ export default {
};
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
page {
background: #fff !important;
}
.set-up {
min-height: 100vh;
background: #fff;
}
.person {
display: flex;
align-items: center;
padding: 36rpx 30rpx;
background: #fff;
}
.user-name {
flex: 1;
min-width: 0;
margin-left: 30rpx;
font-size: 34rpx;
color: #333;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.cell-group {
width: 100%;
}
:deep(.u-cell) {
padding: 0 30rpx;
}
:deep(.u-cell__title-text) {
font-size: 30rpx;
color: #333;
}
:deep(.u-cell__value) {
color: #ccc !important;
}
.submit {
height: 90rpx;
line-height: 90rpx;
margin-top: 20rpx;
text-align: center;
margin-top: 90rpx;
background: #fff;
width: 100%;
margin: 0 auto;
color: $main-color;
}
.person {
height: 208rpx;
display: flex;
padding: 0 20rpx;
font-size: $font-base;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
.user-name {
width: 500rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-left: 30rpx;
line-height: 2em;
font-size: 34rpx;
}
}
.u-cell {
height: 110rpx;
/* line-height: 110rpx; */
padding: 0 20rpx;
align-items: center;
color: #333333;
}
::v-deep .u-cell__value {
color: #cccccc !important;
}
::v-deep .u-cell__right-icon-wrap {
color: #cccccc !important;
font-size: 30rpx;
}
</style>

View File

@@ -28,7 +28,7 @@
<view class="just" :class="signArr.indexOf(item) != -1 ? 'active' : ''">
<view class="top">{{ item }} </view>
<view class="bottom">
<u-icon name="error" v-if="item <= currentDay" color="#999"></u-icon>
<u-icon name="error" v-if="item <= currentDay" size="24" color="#999"></u-icon>
</view>
</view>
<view class="back" :class="signArr.indexOf(item) != -1 ? 'active' : ''" :style="
@@ -40,7 +40,7 @@
">
<view class="top">{{ item }}</view>
<view class="bottom">
<u-icon name="checkmark" :color="aiderLightColor"></u-icon>
<u-icon name="checkmark" size="24" :color="aiderLightColor"></u-icon>
</view>
</view>
</view>
@@ -382,7 +382,7 @@ page {
.item {
width: 66rpx;
height: 80rpx;
height: 96rpx;
border-radius: 5px;
overflow: hidden;
@@ -403,8 +403,11 @@ page {
.top {
position: relative;
flex: 1;
text-align: center;
line-height: 40rpx;
display: flex;
align-items: center;
justify-content: center;
line-height: 1.2;
min-height: 0;
&:before {
content: "";
@@ -413,7 +416,8 @@ page {
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 15rpx;
top: 50%;
margin-top: -28rpx;
}
}
}
@@ -437,9 +441,12 @@ page {
.bottom {
color: #999;
font-size: 20rpx;
height: 20rpx;
line-height: 20rpx;
text-align: center;
height: 36rpx;
min-height: 36rpx;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
}
}