更新
This commit is contained in:
@@ -0,0 +1,122 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const DevTrainingEntry = () => "../../components/dev-training-entry/index.js";
|
||||
const TabBarDock = () => "../../components/app-tab-bar/tab-bar-dock.js";
|
||||
const _sfc_main = {
|
||||
name: "profileB",
|
||||
components: { DevTrainingEntry, TabBarDock },
|
||||
data() {
|
||||
return {
|
||||
userInfo: {
|
||||
avatar: "",
|
||||
nickname: "",
|
||||
userId: "",
|
||||
balance: "0",
|
||||
points: "0",
|
||||
coupons: "5"
|
||||
},
|
||||
orderTypes: [
|
||||
{
|
||||
name: "待付款",
|
||||
image: "/static/images/my/payment.png",
|
||||
path: "/pages/order/list?type=1",
|
||||
count: 2
|
||||
},
|
||||
{
|
||||
name: "待发货",
|
||||
image: "/static/images/my/delivery.png",
|
||||
path: "/pages/order/list?type=2",
|
||||
count: 1
|
||||
},
|
||||
{
|
||||
name: "待收货",
|
||||
image: "/static/images/my/shipping.png",
|
||||
path: "/pages/order/list?type=3",
|
||||
count: 0
|
||||
},
|
||||
{
|
||||
name: "待评价",
|
||||
image: "/static/images/my/review.png",
|
||||
path: "/pages/order/list?type=4",
|
||||
count: 3
|
||||
},
|
||||
{
|
||||
name: "退换/售后",
|
||||
image: "/static/images/my/after-sale.png",
|
||||
path: "/pages/order/list?type=5",
|
||||
count: 0
|
||||
}
|
||||
],
|
||||
allServices: [
|
||||
{ name: "就诊卡", icon: "folder-add", path: "/pages/Card/Card", class: "bg-cyan" },
|
||||
{ name: "设置", icon: "gear", path: "/pages/user/userinfo", class: "bg-gray" }
|
||||
// ,
|
||||
// { name: '客服中心', icon: 'headphones', path: '/pages/service/index', class: 'bg-orange', desc: '在线客服' }
|
||||
]
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.userInfo = common_vendor.index.getStorageSync("userData");
|
||||
},
|
||||
methods: {
|
||||
navigateTo(path) {
|
||||
common_vendor.index.navigateTo({ url: path });
|
||||
},
|
||||
showQRCode() {
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
const _component_dev_training_entry = common_vendor.resolveComponent("dev-training-entry");
|
||||
const _component_TabBarDock = common_vendor.resolveComponent("TabBarDock");
|
||||
(_easycom_uni_icons2 + _component_dev_training_entry + _component_TabBarDock)();
|
||||
}
|
||||
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_icons();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: $data.userInfo.avatar,
|
||||
b: common_vendor.t($data.userInfo.nickname || "未登录"),
|
||||
c: common_vendor.t($data.userInfo.balance || 0),
|
||||
d: common_vendor.t($data.userInfo.points || 0),
|
||||
e: common_vendor.t($data.userInfo.coupons || 0),
|
||||
f: common_vendor.o(($event) => $options.navigateTo("/pages/user/userinfo"), "39"),
|
||||
g: common_vendor.f($data.allServices, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: "0f7520f0-0-" + i0,
|
||||
b: common_vendor.p({
|
||||
type: item.icon,
|
||||
size: "28",
|
||||
color: "#fff"
|
||||
}),
|
||||
c: common_vendor.n(item.class),
|
||||
d: common_vendor.t(item.name),
|
||||
e: item.desc
|
||||
}, item.desc ? {
|
||||
f: common_vendor.t(item.desc)
|
||||
} : {}, {
|
||||
g: "0f7520f0-1-" + i0,
|
||||
h: index,
|
||||
i: common_vendor.o(($event) => $options.navigateTo(item.path), index)
|
||||
});
|
||||
}),
|
||||
h: common_vendor.p({
|
||||
type: "right",
|
||||
size: "20",
|
||||
color: "#666"
|
||||
}),
|
||||
i: common_vendor.p({
|
||||
bottom: 360
|
||||
}),
|
||||
j: common_vendor.p({
|
||||
active: 1
|
||||
})
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-0f7520f0"]]);
|
||||
_sfc_main.__runtimeHooks = 2;
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/user/user.js.map
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"navigationBarTitleText": "我的",
|
||||
"backgroundColor": "#e8eaed",
|
||||
"backgroundColorTop": "#e8eaed",
|
||||
"usingComponents": {
|
||||
"dev-training-entry": "../../components/dev-training-entry/index",
|
||||
"tab-bar-dock": "../../components/app-tab-bar/tab-bar-dock",
|
||||
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="mine-page data-v-0f7520f0"><view class="user-card data-v-0f7520f0" bindtap="{{f}}"><view class="user-header data-v-0f7520f0"><image class="avatar data-v-0f7520f0" src="{{a}}" mode="aspectFill"/><view class="user-info data-v-0f7520f0"><text class="nickname data-v-0f7520f0">{{b}}</text></view></view><view class="stat-row data-v-0f7520f0"><view class="stat-item data-v-0f7520f0"><text class="value data-v-0f7520f0">{{c}}</text><text class="label data-v-0f7520f0">钱包(元)</text></view><view class="stat-item data-v-0f7520f0"><text class="value data-v-0f7520f0">{{d}}</text><text class="label data-v-0f7520f0">积分</text></view><view class="stat-item data-v-0f7520f0"><text class="value data-v-0f7520f0">{{e}}</text><text class="label data-v-0f7520f0">优惠券</text></view></view></view><view class="service-list data-v-0f7520f0"><view wx:for="{{g}}" wx:for-item="item" wx:key="h" class="service-item data-v-0f7520f0" bindtap="{{item.i}}"><view class="left data-v-0f7520f0"><view class="{{['service-icon', 'data-v-0f7520f0', item.c]}}"><uni-icons wx:if="{{item.b}}" class="data-v-0f7520f0" u-i="{{item.a}}" bind:__l="__l" u-p="{{item.b}}"></uni-icons></view><text class="service-name data-v-0f7520f0">{{item.d}}</text></view><view class="right data-v-0f7520f0"><text wx:if="{{item.e}}" class="desc data-v-0f7520f0">{{item.f}}</text><uni-icons wx:if="{{h}}" class="data-v-0f7520f0" u-i="{{item.g}}" bind:__l="__l" u-p="{{h}}"></uni-icons></view></view></view><dev-training-entry wx:if="{{i}}" class="data-v-0f7520f0" u-i="0f7520f0-2" bind:__l="__l" u-p="{{i}}"/><tab-bar-dock wx:if="{{j}}" class="data-v-0f7520f0" u-i="0f7520f0-3" bind:__l="__l" u-p="{{j}}"/></view>
|
||||
@@ -0,0 +1,261 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
/* 适老化设计:50-80岁老人 - 大字号、高对比、大触控区 */
|
||||
.mine-page.data-v-0f7520f0 {
|
||||
min-height: 100vh;
|
||||
background: #e8eaed;
|
||||
padding: 40rpx;
|
||||
padding-bottom: calc(240rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
.user-card.data-v-0f7520f0 {
|
||||
background: #fff;
|
||||
border-radius: 28rpx;
|
||||
padding: 48rpx;
|
||||
margin-bottom: 40rpx;
|
||||
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
.user-card .user-header.data-v-0f7520f0 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 48rpx;
|
||||
}
|
||||
.user-card .user-header .avatar.data-v-0f7520f0 {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 80rpx;
|
||||
margin-right: 36rpx;
|
||||
border: 4rpx solid #e0e0e0;
|
||||
}
|
||||
.user-card .user-header .user-info.data-v-0f7520f0 {
|
||||
flex: 1;
|
||||
}
|
||||
.user-card .user-header .user-info .nickname.data-v-0f7520f0 {
|
||||
font-size: 48rpx;
|
||||
font-weight: 600;
|
||||
color: #1a1a1a;
|
||||
margin-bottom: 16rpx;
|
||||
display: block;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
.user-card .user-header .user-info .vip-tag.data-v-0f7520f0 {
|
||||
background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 24rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
.user-card .user-header .qr-code.data-v-0f7520f0 {
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 44rpx;
|
||||
background: #f5f6fa;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.user-card .stat-row.data-v-0f7520f0 {
|
||||
display: flex;
|
||||
padding-top: 40rpx;
|
||||
border-top: 4rpx solid #e8eaed;
|
||||
}
|
||||
.user-card .stat-row .stat-item.data-v-0f7520f0 {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
min-height: 120rpx;
|
||||
}
|
||||
.user-card .stat-row .stat-item .value.data-v-0f7520f0 {
|
||||
font-size: 52rpx;
|
||||
font-weight: 600;
|
||||
color: #1a1a1a;
|
||||
margin-bottom: 12rpx;
|
||||
display: block;
|
||||
}
|
||||
.user-card .stat-row .stat-item .label.data-v-0f7520f0 {
|
||||
font-size: 32rpx;
|
||||
color: #555;
|
||||
font-weight: 500;
|
||||
}
|
||||
.order-card.data-v-0f7520f0 {
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 40rpx;
|
||||
margin-bottom: 30rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
.order-card .card-header.data-v-0f7520f0 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
.order-card .card-header .title.data-v-0f7520f0 {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
.order-card .card-header .more.data-v-0f7520f0 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.order-card .card-header .more text.data-v-0f7520f0 {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
.order-card .order-list.data-v-0f7520f0 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.order-card .order-list .order-item.data-v-0f7520f0 {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.order-card .order-list .order-item .icon-wrapper.data-v-0f7520f0 {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
margin: 0 auto 0;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.order-card .order-list .order-item .icon-wrapper .count-badge.data-v-0f7520f0 {
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
right: -10rpx;
|
||||
background: #ff4d4f;
|
||||
color: #fff;
|
||||
font-size: 20rpx;
|
||||
min-width: 32rpx;
|
||||
height: 32rpx;
|
||||
line-height: 32rpx;
|
||||
text-align: center;
|
||||
border-radius: 16rpx;
|
||||
padding: 0 8rpx;
|
||||
}
|
||||
.order-card .order-list .order-item .icon-wrapper .order-icon.data-v-0f7520f0 {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
}
|
||||
.order-card .order-list .order-item .order-name.data-v-0f7520f0 {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
}
|
||||
.quick-actions.data-v-0f7520f0 {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.quick-actions .action-item.data-v-0f7520f0 {
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 30rpx 20rpx;
|
||||
text-align: center;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
.quick-actions .action-item .action-icon.data-v-0f7520f0 {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
margin: 0 auto 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.quick-actions .action-item .action-name.data-v-0f7520f0 {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
}
|
||||
.service-list.data-v-0f7520f0 {
|
||||
background: #fff;
|
||||
border-radius: 28rpx;
|
||||
padding: 20rpx 40rpx;
|
||||
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
.service-list .service-item.data-v-0f7520f0 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 44rpx 0;
|
||||
border-bottom: 4rpx solid #e8eaed;
|
||||
min-height: 120rpx;
|
||||
}
|
||||
.service-list .service-item.data-v-0f7520f0:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.service-list .service-item .left.data-v-0f7520f0 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.service-list .service-item .left .service-icon.data-v-0f7520f0 {
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 44rpx;
|
||||
margin-right: 32rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.service-list .service-item .left .service-name.data-v-0f7520f0 {
|
||||
font-size: 38rpx;
|
||||
color: #1a1a1a;
|
||||
font-weight: 500;
|
||||
}
|
||||
.service-list .service-item .right.data-v-0f7520f0 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.service-list .service-item .right .desc.data-v-0f7520f0 {
|
||||
font-size: 30rpx;
|
||||
color: #555;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.bg-red.data-v-0f7520f0 {
|
||||
background: #ff4d4f;
|
||||
}
|
||||
.bg-blue.data-v-0f7520f0 {
|
||||
background: #1890ff;
|
||||
}
|
||||
.bg-green.data-v-0f7520f0 {
|
||||
background: #52c41a;
|
||||
}
|
||||
.bg-purple.data-v-0f7520f0 {
|
||||
background: #722ed1;
|
||||
}
|
||||
.bg-orange.data-v-0f7520f0 {
|
||||
background: #fa8c16;
|
||||
}
|
||||
.bg-cyan.data-v-0f7520f0 {
|
||||
background: #13c2c2;
|
||||
}
|
||||
.bg-pink.data-v-0f7520f0 {
|
||||
background: #eb2f96;
|
||||
}
|
||||
.bg-gray.data-v-0f7520f0 {
|
||||
background: #666666;
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
if (!Array) {
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
_easycom_uni_icons2();
|
||||
}
|
||||
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_icons();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "userinfo",
|
||||
setup(__props) {
|
||||
const { proxy } = common_vendor.getCurrentInstance();
|
||||
const instance = common_vendor.getCurrentInstance();
|
||||
const $url = instance.appContext.config.globalProperties.$url;
|
||||
const loading = common_vendor.ref(false);
|
||||
const submitting = common_vendor.ref(false);
|
||||
const formData = common_vendor.ref({
|
||||
avatar: "",
|
||||
patient_name: "",
|
||||
phone: "",
|
||||
nickname: "",
|
||||
sex: 1,
|
||||
age: ""
|
||||
});
|
||||
common_vendor.onMounted(() => {
|
||||
loadUserInfo();
|
||||
});
|
||||
const loadUserInfo = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await proxy.apiUrl({
|
||||
url: "/api/user/info",
|
||||
method: "GET",
|
||||
data: {}
|
||||
});
|
||||
if (res.code === 1) {
|
||||
const userInfo = res.data;
|
||||
formData.value = {
|
||||
avatar: userInfo.avatar || "",
|
||||
patient_name: userInfo.patient_name || userInfo.nickname || "",
|
||||
phone: userInfo.phone || "",
|
||||
nickname: userInfo.nickname || "",
|
||||
sex: userInfo.sex == "男" ? 1 : 2,
|
||||
age: userInfo.age || ""
|
||||
};
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "加载失败", icon: "none" });
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/user/userinfo.vue:142", "加载用户信息失败:", err);
|
||||
common_vendor.index.showToast({ title: "加载失败", icon: "none" });
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
const uploadAvatar = () => {
|
||||
common_vendor.index.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ["compressed"],
|
||||
sourceType: ["album", "camera"],
|
||||
success: async (res) => {
|
||||
const tempFilePath = res.tempFilePaths[0];
|
||||
try {
|
||||
common_vendor.index.showLoading({ title: "上传中..." });
|
||||
const token = common_vendor.index.getStorageSync("token");
|
||||
const uploadRes = await new Promise((resolve, reject) => {
|
||||
common_vendor.index.uploadFile({
|
||||
url: $url + "/api/upload/image",
|
||||
filePath: tempFilePath,
|
||||
name: "file",
|
||||
header: {
|
||||
token,
|
||||
"content-type": "multipart/form-data"
|
||||
},
|
||||
success: (res2) => {
|
||||
const data = JSON.parse(res2.data);
|
||||
resolve(data);
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
common_vendor.index.hideLoading();
|
||||
if (uploadRes.code === 1) {
|
||||
formData.value.avatar = uploadRes.data.uri || uploadRes.data;
|
||||
common_vendor.index.showToast({ title: "头像上传成功", icon: "success" });
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: uploadRes.msg || "上传失败", icon: "none" });
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/user/userinfo.vue:195", "上传头像失败:", err);
|
||||
common_vendor.index.showToast({ title: "上传失败", icon: "none" });
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/user/userinfo.vue:200", "选择图片失败:", err);
|
||||
common_vendor.index.showToast({ title: "选择图片失败", icon: "none" });
|
||||
}
|
||||
});
|
||||
};
|
||||
const validatePhone = (phone) => {
|
||||
if (!phone)
|
||||
return true;
|
||||
return /^1[3-9]\d{9}$/.test(phone);
|
||||
};
|
||||
const submitForm = async () => {
|
||||
if (!formData.value.patient_name) {
|
||||
common_vendor.index.showToast({ title: "姓名不能为空", icon: "none" });
|
||||
return;
|
||||
}
|
||||
if (formData.value.phone && !validatePhone(formData.value.phone)) {
|
||||
common_vendor.index.showToast({ title: "手机号格式不正确", icon: "none" });
|
||||
return;
|
||||
}
|
||||
submitting.value = true;
|
||||
try {
|
||||
const res = await proxy.apiUrl({
|
||||
url: "/api/user/setInfo",
|
||||
method: "POST",
|
||||
data: {
|
||||
avatar: formData.value.avatar,
|
||||
phone: formData.value.phone,
|
||||
nickname: formData.value.nickname,
|
||||
sex: formData.value.sex,
|
||||
age: formData.value.age,
|
||||
patient_name: formData.value.patient_name
|
||||
}
|
||||
});
|
||||
if (res.code === 1) {
|
||||
const userData = common_vendor.index.getStorageSync("userData");
|
||||
const updatedData = {
|
||||
...userData,
|
||||
avatar: formData.value.avatar,
|
||||
phone: formData.value.phone,
|
||||
nickname: formData.value.nickname,
|
||||
sex: formData.value.sex,
|
||||
age: formData.value.age,
|
||||
patient_name: formData.value.patient_name,
|
||||
diagnosis: {
|
||||
...userData.diagnosis,
|
||||
patient_name: formData.value.patient_name
|
||||
}
|
||||
};
|
||||
common_vendor.index.setStorageSync("userData", updatedData);
|
||||
common_vendor.index.showToast({ title: "保存成功", icon: "success" });
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateBack();
|
||||
}, 1500);
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "保存失败", icon: "none" });
|
||||
}
|
||||
} catch (err) {
|
||||
common_vendor.index.__f__("error", "at pages/user/userinfo.vue:269", "保存失败:", err);
|
||||
common_vendor.index.showToast({ title: "保存失败", icon: "none" });
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: loading.value
|
||||
}, loading.value ? {} : {
|
||||
b: formData.value.avatar,
|
||||
c: common_vendor.p({
|
||||
type: "upload-filled",
|
||||
size: "24",
|
||||
color: "#FFA500"
|
||||
}),
|
||||
d: common_vendor.o(uploadAvatar, "bf"),
|
||||
e: formData.value.nickname,
|
||||
f: common_vendor.o(($event) => formData.value.nickname = $event.detail.value, "6d"),
|
||||
g: formData.value.sex === 1 ? 1 : "",
|
||||
h: common_vendor.o(($event) => formData.value.sex = 1, "e9"),
|
||||
i: formData.value.sex === 2 ? 1 : "",
|
||||
j: common_vendor.o(($event) => formData.value.sex = 2, "53"),
|
||||
k: formData.value.age,
|
||||
l: common_vendor.o(common_vendor.m(($event) => formData.value.age = $event.detail.value, {
|
||||
number: true
|
||||
}), "cf"),
|
||||
m: common_vendor.t(submitting.value ? "保存中..." : "保存修改"),
|
||||
n: common_vendor.o(submitForm, "84"),
|
||||
o: submitting.value
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-103261b1"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/user/userinfo.js.map
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "个人资料",
|
||||
"usingComponents": {
|
||||
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="userinfo-container data-v-103261b1"><view wx:if="{{a}}" class="loading-state data-v-103261b1"><text class="data-v-103261b1">加载中...</text></view><view wx:else class="form-wrapper data-v-103261b1"><view class="form-section data-v-103261b1"><view class="form-group data-v-103261b1"><text class="form-label data-v-103261b1">头像</text><view class="avatar-container data-v-103261b1"><image src="{{b}}" class="avatar-image data-v-103261b1" mode="aspectFill"/><view class="avatar-upload data-v-103261b1" bindtap="{{d}}"><uni-icons wx:if="{{c}}" class="upload-icon data-v-103261b1" u-i="103261b1-0" bind:__l="__l" u-p="{{c}}"></uni-icons><text class="upload-text data-v-103261b1">更换头像</text></view></view></view></view><view class="form-section data-v-103261b1"><text class="section-title data-v-103261b1">基本信息</text><view class="form-group data-v-103261b1"><text class="form-label data-v-103261b1">昵称</text><input class="form-input data-v-103261b1" placeholder="请输入昵称" maxlength="50" value="{{e}}" bindinput="{{f}}"/></view><view class="form-group data-v-103261b1"><text class="form-label data-v-103261b1">性别</text><view class="sex-group data-v-103261b1"><view class="{{['sex-btn', 'data-v-103261b1', g && 'active']}}" bindtap="{{h}}"> 男 </view><view class="{{['sex-btn', 'data-v-103261b1', i && 'active']}}" bindtap="{{j}}"> 女 </view></view></view><view class="form-group data-v-103261b1"><text class="form-label data-v-103261b1">年龄</text><input class="form-input data-v-103261b1" type="number" placeholder="请输入年龄" min="0" max="150" value="{{k}}" bindinput="{{l}}"/></view></view><view class="button-group data-v-103261b1"><button class="btn btn-submit data-v-103261b1" bindtap="{{n}}" disabled="{{o}}">{{m}}</button></view></view></view>
|
||||
@@ -0,0 +1,188 @@
|
||||
/* 适老化设计:50-80岁 - 大字号、高对比、大触控区 */
|
||||
.userinfo-container.data-v-103261b1 {
|
||||
min-height: 100vh;
|
||||
background: #e8eaed;
|
||||
}
|
||||
.header.data-v-103261b1 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #ffffff;
|
||||
padding: 24rpx 40rpx;
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
.header-back.data-v-103261b1 {
|
||||
font-size: 48rpx;
|
||||
color: #FFA500;
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.header-title.data-v-103261b1 {
|
||||
font-size: 44rpx;
|
||||
font-weight: bold;
|
||||
color: #1a1a1a;
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.header-placeholder.data-v-103261b1 {
|
||||
width: 88rpx;
|
||||
}
|
||||
.loading-state.data-v-103261b1 {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
font-size: 36rpx;
|
||||
color: #555;
|
||||
}
|
||||
.form-wrapper.data-v-103261b1 {
|
||||
padding: 40rpx;
|
||||
}
|
||||
.form-section.data-v-103261b1 {
|
||||
background: #ffffff;
|
||||
border-radius: 24rpx;
|
||||
padding: 40rpx;
|
||||
margin-bottom: 36rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
.section-title.data-v-103261b1 {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
color: #FFA500;
|
||||
margin-bottom: 32rpx;
|
||||
display: block;
|
||||
padding-bottom: 24rpx;
|
||||
border-bottom: 4rpx solid #f0f0f0;
|
||||
}
|
||||
.form-group.data-v-103261b1 {
|
||||
margin-bottom: 36rpx;
|
||||
}
|
||||
.form-group.data-v-103261b1:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.form-label.data-v-103261b1 {
|
||||
display: block;
|
||||
font-size: 36rpx;
|
||||
color: #1a1a1a;
|
||||
font-weight: 500;
|
||||
margin-bottom: 20rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.form-input.data-v-103261b1 {
|
||||
width: 100%;
|
||||
padding: 28rpx;
|
||||
border: 4rpx solid #e0e0e0;
|
||||
border-radius: 16rpx;
|
||||
font-size: 36rpx;
|
||||
line-height: 1.6;
|
||||
color: #1a1a1a;
|
||||
background: #ffffff;
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
height: auto;
|
||||
min-height: 96rpx;
|
||||
}
|
||||
.form-input.data-v-103261b1::-webkit-input-placeholder {
|
||||
color: #999;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
.form-input.data-v-103261b1::placeholder {
|
||||
color: #999;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
.avatar-container.data-v-103261b1 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 32rpx;
|
||||
}
|
||||
.avatar-image.data-v-103261b1 {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 80rpx;
|
||||
background: #f0f0f0;
|
||||
border: 4rpx solid #e0e0e0;
|
||||
}
|
||||
.avatar-upload.data-v-103261b1 {
|
||||
flex: 1;
|
||||
padding: 36rpx;
|
||||
border: 4rpx dashed #FFA500;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 16rpx;
|
||||
min-height: 120rpx;
|
||||
}
|
||||
.upload-icon.data-v-103261b1 {
|
||||
font-size: 56rpx;
|
||||
}
|
||||
.upload-text.data-v-103261b1 {
|
||||
font-size: 34rpx;
|
||||
color: #FFA500;
|
||||
font-weight: 500;
|
||||
}
|
||||
.sex-group.data-v-103261b1 {
|
||||
display: flex;
|
||||
gap: 28rpx;
|
||||
}
|
||||
.sex-btn.data-v-103261b1 {
|
||||
flex: 1;
|
||||
padding: 32rpx;
|
||||
border: 4rpx solid #e0e0e0;
|
||||
border-radius: 16rpx;
|
||||
text-align: center;
|
||||
font-size: 38rpx;
|
||||
line-height: 1.5;
|
||||
color: #555;
|
||||
background: #ffffff;
|
||||
transition: all 0.3s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 96rpx;
|
||||
}
|
||||
.sex-btn.active.data-v-103261b1 {
|
||||
border-color: #FFA500;
|
||||
background: #fff7e6;
|
||||
color: #FFA500;
|
||||
font-weight: bold;
|
||||
}
|
||||
.button-group.data-v-103261b1 {
|
||||
display: flex;
|
||||
gap: 28rpx;
|
||||
margin-top: 56rpx;
|
||||
margin-bottom: 56rpx;
|
||||
}
|
||||
.btn.data-v-103261b1 {
|
||||
flex: 1;
|
||||
padding: 36rpx;
|
||||
border-radius: 20rpx;
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
min-height: 100rpx;
|
||||
}
|
||||
.btn.data-v-103261b1:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
.btn.data-v-103261b1:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.btn-cancel.data-v-103261b1 {
|
||||
background: #f0f0f0;
|
||||
color: #555;
|
||||
}
|
||||
.btn-submit.data-v-103261b1 {
|
||||
background: #FFA500;
|
||||
color: #ffffff;
|
||||
}
|
||||
.btn-submit.data-v-103261b1:active:not(:disabled) {
|
||||
background: #e69500;
|
||||
}
|
||||
Reference in New Issue
Block a user