| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- import _easycom_u_icon from '@/components/u-icon/u-icon.vue'
- import { ref, reactive } from 'vue';
- // --- 用户信息 ---
- type UserInfo = { __$originalPosition?: UTSSourceMapPosition<"UserInfo", "pages/index/my.uvue", 179, 7>;
- name : string;
- avatar : string;
- level : number;
- growthValue : number;
- nextLevel : number;
- nextLevelGap : number;
- progressPercent : number;
- }
- type ToolItem = { __$originalPosition?: UTSSourceMapPosition<"ToolItem", "pages/index/my.uvue", 204, 7>;
- name : string;
- icon : string;
- color : string;
- };
- // avoid generic parameter on ref which earlier triggered an "interface does not
- // have constructors" error; cast the initial value instead.
-
- const __sfc__ = defineComponent({
- __name: 'my',
- setup(__props) {
- const __ins = getCurrentInstance()!;
- const _ctx = __ins.proxy as InstanceType<typeof __sfc__>;
- const _cache = __ins.renderCache;
- const userInfo = reactive<UserInfo>({
- name: '刘大锤',
- avatar: 'https://via.placeholder.com/100x100/4a90e2/ffffff?text=LD', // 替换为实际头像
- level: 30,
- growthValue: 50,
- nextLevel: 2,
- nextLevelGap: 15,
- progressPercent: 75 // (50 / (50+15)) * 100 ≈ 75%
- });
- // computed helpers to satisfy UTS inference rules
- // convert percent to a fixed rpx width (assuming 750rpx full width)
- const progressWidth = computed(() => `${userInfo.progressPercent * 7.5}rpx`);
- // --- 工具列表 ---
- const tools = ref([
- { name: '学习园地', icon: 'book', color: '#ff9900' },
- { name: '问题反馈', icon: 'chat', color: '#52c41a' },
- { name: '定制优惠', icon: 'wallet', color: '#1890ff' },
- { name: 'VIP俱乐部', icon: 'vip', color: '#faad14' }
- ] as ToolItem[]);
- // --- 方法 ---
- const contactService = () => {
- uni.showToast({ title: '联系客服', icon: 'none' });
- };
- const openSettings = () => {
- uni.showToast({ title: '打开设置', icon: 'none' });
- };
- const viewLevelDetail = () => {
- uni.showToast({ title: '查看等级详情', icon: 'none' });
- };
- const handleToolClick = (tool : ToolItem) => {
- uni.showToast({ title: `点击${tool.name}`, icon: 'none' });
- };
- const inviteFriends = () => {
- uni.showModal({
- title: '邀请好友',
- content: '分享链接邀请好友加入,单次最高可获奖励200元!',
- success: (res) => {
- if (res.confirm) {
- uni.showToast({ title: '已生成邀请链接', icon: 'success' });
- }
- }
- });
- };
- const viewTeam = () => {
- uni.showToast({ title: '查看团队成员', icon: 'none' });
- };
- const joinPartner = () => {
- uni.showModal({
- title: '城市合伙人',
- content: '全新盈利模式助你创业,立即申请成为城市合伙人!',
- success: (res) => {
- if (res.confirm) {
- uni.showToast({ title: '申请已提交', icon: 'success' });
- }
- }
- });
- };
- return (): any | null => {
- const _component_u_icon = resolveEasyComponent("u-icon",_easycom_u_icon)
- return _cE("view", _uM({ class: "page-container" }), [
- _cE("view", _uM({ class: "user-header" }), [
- _cE("image", _uM({
- src: userInfo['avatar'],
- class: "avatar",
- mode: "aspectFill"
- }), null, 8 /* PROPS */, ["src"]),
- _cE("view", _uM({ class: "user-info" }), [
- _cE("text", _uM({ class: "username" }), _tD(userInfo['name']), 1 /* TEXT */),
- _cE("view", _uM({ class: "badge-row" }), [
- _cE("text", _uM({ class: "badge vip" }), " 王牌 ")
- ])
- ]),
- _cE("view", _uM({ class: "header-actions" }), [
- _cE("view", _uM({
- class: "action-item",
- onClick: contactService
- }), [
- _cV(_component_u_icon, _uM({
- type: "customer-service",
- size: "24",
- color: "#666"
- })),
- _cE("text", null, " 客服 ")
- ]),
- _cE("view", _uM({
- class: "action-item",
- onClick: openSettings
- }), [
- _cV(_component_u_icon, _uM({
- type: "gear",
- size: "24",
- color: "#666"
- })),
- _cE("text", null, " 设置 ")
- ])
- ])
- ]),
- _cE("view", _uM({ class: "level-card" }), [
- _cE("view", _uM({ class: "level-main" }), [
- _cE("text", _uM({ class: "level-title" }), " V" + _tD(userInfo['level']), 1 /* TEXT */),
- _cE("text", _uM({ class: "level-sub" }), " 成长值 " + _tD(userInfo['growthValue']), 1 /* TEXT */)
- ]),
- _cE("view", _uM({ class: "level-progress" }), [
- _cE("text", _uM({ class: "progress-text" }), " 还差" + _tD(userInfo['nextLevelGap']) + "成长值可升至V" + _tD(userInfo['nextLevel']), 1 /* TEXT */),
- _cE("view", _uM({ class: "progress-bar" }), [
- _cE("view", _uM({
- class: "progress-fill",
- style: _nS(_uM({ width: unref(progressWidth) }))
- }), null, 4 /* STYLE */)
- ]),
- _cE("view", _uM({ class: "progress-labels" }), [
- _cE("text", null, " V1 "),
- _cE("text", null, " V2 ")
- ])
- ]),
- _cE("view", _uM({
- class: "level-badge",
- onClick: viewLevelDetail
- }), [
- _cV(_component_u_icon, _uM({
- type: "vip",
- size: "40",
- color: "#ffffff"
- })),
- _cE("text", null, " 我的等级 ")
- ])
- ]),
- _cE("view", _uM({ class: "section-title" }), " 我的档案 "),
- _cE("view", _uM({ class: "profile-stats" }), [
- _cE("view", _uM({ class: "stat-item" }), [
- _cE("text", _uM({ class: "stat-value" }), " 60 "),
- _cE("text", _uM({ class: "stat-label" }), " 签约 ")
- ]),
- _cE("view", _uM({ class: "stat-item" }), [
- _cE("text", _uM({ class: "stat-value" }), " 21 "),
- _cE("text", _uM({ class: "stat-label" }), " 解约 ")
- ]),
- _cE("view", _uM({ class: "stat-item" }), [
- _cV(_component_u_icon, _uM({
- type: "location",
- size: "24",
- color: "#666"
- })),
- _cE("text", _uM({ class: "stat-label" }), " 异地签到 ")
- ]),
- _cE("view", _uM({ class: "stat-item" }), [
- _cV(_component_u_icon, _uM({
- type: "cart",
- size: "24",
- color: "#666"
- })),
- _cE("text", _uM({ class: "stat-label" }), " 购买物料 ")
- ])
- ]),
- _cE("view", _uM({ class: "section-title" }), " 我的工具 "),
- _cE("view", _uM({ class: "tools-grid" }), [
- _cE(Fragment, null, RenderHelpers.renderList(tools.value, (tool, idx, __index, _cached): any => {
- return _cE("view", _uM({
- class: "tool-item",
- key: idx,
- onClick: () => {handleToolClick(tool)}
- }), [
- _cV(_component_u_icon, _uM({
- type: tool.icon,
- size: "32",
- color: tool.color
- }), null, 8 /* PROPS */, ["type", "color"]),
- _cE("text", _uM({ class: "tool-name" }), _tD(tool.name), 1 /* TEXT */)
- ], 8 /* PROPS */, ["onClick"])
- }), 128 /* KEYED_FRAGMENT */)
- ]),
- _cE("view", _uM({ class: "promo-cards" }), [
- _cE("view", _uM({
- class: "promo-card invite",
- onClick: inviteFriends
- }), [
- _cE("view", _uM({ class: "promo-content" }), [
- _cE("text", _uM({ class: "promo-title" }), " 邀请好友赚钱 "),
- _cE("text", _uM({ class: "promo-subtitle" }), " 单次最高可奖200元 ")
- ]),
- _cV(_component_u_icon, _uM({
- type: "gift",
- size: "40",
- color: "#ffd700"
- }))
- ]),
- _cE("view", _uM({
- class: "promo-card team",
- onClick: viewTeam
- }), [
- _cE("view", _uM({ class: "promo-content" }), [
- _cE("text", _uM({ class: "promo-title" }), " 我的团队 "),
- _cE("text", _uM({ class: "promo-subtitle" }), " 团队成员100人 ")
- ]),
- _cV(_component_u_icon, _uM({
- type: "person",
- size: "40",
- color: "#4a90e2"
- }))
- ])
- ]),
- _cE("view", _uM({
- class: "partner-banner",
- onClick: joinPartner
- }), [
- _cE("view", _uM({ class: "partner-content" }), [
- _cE("text", _uM({ class: "partner-title" }), " 寻找城市合伙人 "),
- _cE("text", _uM({ class: "partner-subtitle" }), " 全新盈利模式助你创业 ")
- ]),
- _cE("view", _uM({ class: "partner-icon" }), [
- _cV(_component_u_icon, _uM({
- type: "person",
- size: "50",
- color: "#ffffff"
- })),
- _cV(_component_u_icon, _uM({
- type: "person",
- size: "30",
- color: "#ffffff",
- style: _nS(_uM({"margin-left":"-20rpx"}))
- }), null, 8 /* PROPS */, ["style"])
- ])
- ])
- ])
- }
- }
- })
- export default __sfc__
- const GenPagesIndexMyStyles = [_uM([["page-container", _pS(_uM([["backgroundColor", "#f5f6f8"], ["minHeight", "1000rpx"], ["boxSizing", "border-box"], ["paddingTop", "20rpx"], ["paddingRight", "20rpx"], ["paddingBottom", "20rpx"], ["paddingLeft", "20rpx"]]))], ["user-header", _pS(_uM([["display", "flex"], ["flexDirection", "row"], ["alignItems", "center"], ["paddingTop", "20rpx"], ["paddingRight", "20rpx"], ["paddingBottom", "20rpx"], ["paddingLeft", "20rpx"], ["backgroundImage", "none"], ["backgroundColor", "#ffffff"], ["borderTopLeftRadius", "16rpx"], ["borderTopRightRadius", "16rpx"], ["borderBottomRightRadius", "16rpx"], ["borderBottomLeftRadius", "16rpx"], ["boxShadow", "0 2rpx 8rpx rgba(0, 0, 0, 0.04)"]]))], ["avatar", _pS(_uM([["width", "100rpx"], ["height", "100rpx"], ["borderTopLeftRadius", "50rpx"], ["borderTopRightRadius", "50rpx"], ["borderBottomRightRadius", "50rpx"], ["borderBottomLeftRadius", "50rpx"], ["borderTopWidth", "2rpx"], ["borderRightWidth", "2rpx"], ["borderBottomWidth", "2rpx"], ["borderLeftWidth", "2rpx"], ["borderTopStyle", "solid"], ["borderRightStyle", "solid"], ["borderBottomStyle", "solid"], ["borderLeftStyle", "solid"], ["borderTopColor", "#eeeeee"], ["borderRightColor", "#eeeeee"], ["borderBottomColor", "#eeeeee"], ["borderLeftColor", "#eeeeee"]]))], ["user-info", _pS(_uM([["flexGrow", 1], ["flexShrink", 1], ["flexBasis", "0%"], ["display", "flex"], ["flexDirection", "column"]]))], ["username", _pS(_uM([["fontSize", "32rpx"], ["fontWeight", "bold"], ["color", "#333333"]]))], ["badge-row", _pS(_uM([["display", "flex"], ["flexDirection", "row"]]))], ["badge", _uM([["", _uM([["fontSize", "22rpx"], ["paddingTop", "4rpx"], ["paddingRight", "12rpx"], ["paddingBottom", "4rpx"], ["paddingLeft", "12rpx"], ["borderTopLeftRadius", "20rpx"], ["borderTopRightRadius", "20rpx"], ["borderBottomRightRadius", "20rpx"], ["borderBottomLeftRadius", "20rpx"], ["fontWeight", "bold"]])], [".vip", _uM([["backgroundImage", "linear-gradient(90deg, #4a90e2, #67b26f)"], ["backgroundColor", "rgba(0,0,0,0)"], ["color", "#ffffff"]])]])], ["header-actions", _pS(_uM([["display", "flex"], ["flexDirection", "row"]]))], ["action-item", _pS(_uM([["display", "flex"], ["flexDirection", "column"], ["alignItems", "center"], ["fontSize", "22rpx"], ["color", "#666666"]]))], ["level-card", _pS(_uM([["backgroundImage", "linear-gradient(135deg, #667eea 0%, #764ba2 100%)"], ["backgroundColor", "rgba(0,0,0,0)"], ["borderTopLeftRadius", "16rpx"], ["borderTopRightRadius", "16rpx"], ["borderBottomRightRadius", "16rpx"], ["borderBottomLeftRadius", "16rpx"], ["paddingTop", "30rpx"], ["paddingRight", "30rpx"], ["paddingBottom", "30rpx"], ["paddingLeft", "30rpx"], ["color", "#ffffff"], ["position", "relative"], ["overflow", "hidden"]]))], ["level-main", _pS(_uM([["display", "flex"], ["flexDirection", "row"], ["alignItems", "flex-start"], ["marginBottom", "20rpx"]]))], ["level-title", _pS(_uM([["fontSize", "48rpx"], ["fontWeight", "bold"]]))], ["level-sub", _pS(_uM([["fontSize", "28rpx"], ["opacity", 0.9]]))], ["level-progress", _pS(_uM([["marginBottom", "20rpx"]]))], ["progress-text", _pS(_uM([["fontSize", "24rpx"], ["opacity", 0.8], ["marginBottom", "10rpx"]]))], ["progress-bar", _pS(_uM([["height", "12rpx"], ["backgroundImage", "none"], ["backgroundColor", "rgba(255,255,255,0.3)"], ["borderTopLeftRadius", "6rpx"], ["borderTopRightRadius", "6rpx"], ["borderBottomRightRadius", "6rpx"], ["borderBottomLeftRadius", "6rpx"], ["overflow", "hidden"], ["marginBottom", "8rpx"]]))], ["progress-fill", _pS(_uM([["height", "12rpx"], ["backgroundImage", "none"], ["backgroundColor", "#ffffff"], ["borderTopLeftRadius", "6rpx"], ["borderTopRightRadius", "6rpx"], ["borderBottomRightRadius", "6rpx"], ["borderBottomLeftRadius", "6rpx"], ["transitionProperty", "width"], ["transitionDuration", "0.3s"], ["transitionTimingFunction", "ease"]]))], ["progress-labels", _pS(_uM([["display", "flex"], ["flexDirection", "row"], ["justifyContent", "space-between"], ["fontSize", "22rpx"], ["opacity", 0.7]]))], ["level-badge", _pS(_uM([["position", "absolute"], ["top", "20rpx"], ["right", "20rpx"], ["display", "flex"], ["flexDirection", "column"], ["alignItems", "center"], ["fontSize", "24rpx"], ["opacity", 0.9]]))], ["section-title", _pS(_uM([["fontSize", "30rpx"], ["fontWeight", "bold"], ["color", "#333333"], ["marginTop", "10rpx"], ["marginBottom", "15rpx"], ["paddingLeft", "10rpx"], ["borderLeftWidth", "4rpx"], ["borderLeftStyle", "solid"], ["borderLeftColor", "#4a90e2"]]))], ["profile-stats", _pS(_uM([["display", "flex"], ["flexDirection", "row"], ["justifyContent", "space-around"], ["backgroundImage", "none"], ["backgroundColor", "#ffffff"], ["borderTopLeftRadius", "16rpx"], ["borderTopRightRadius", "16rpx"], ["borderBottomRightRadius", "16rpx"], ["borderBottomLeftRadius", "16rpx"], ["paddingTop", "30rpx"], ["paddingRight", "20rpx"], ["paddingBottom", "30rpx"], ["paddingLeft", "20rpx"], ["boxShadow", "0 2rpx 8rpx rgba(0, 0, 0, 0.04)"]]))], ["stat-item", _pS(_uM([["display", "flex"], ["flexDirection", "column"], ["alignItems", "center"]]))], ["stat-value", _pS(_uM([["fontSize", "32rpx"], ["fontWeight", "bold"], ["color", "#333333"]]))], ["stat-label", _pS(_uM([["fontSize", "24rpx"], ["color", "#666666"]]))], ["tools-grid", _pS(_uM([["display", "flex"], ["flexDirection", "row"], ["flexWrap", "wrap"], ["backgroundImage", "none"], ["backgroundColor", "#ffffff"], ["borderTopLeftRadius", "16rpx"], ["borderTopRightRadius", "16rpx"], ["borderBottomRightRadius", "16rpx"], ["borderBottomLeftRadius", "16rpx"], ["paddingTop", "30rpx"], ["paddingRight", "30rpx"], ["paddingBottom", "30rpx"], ["paddingLeft", "30rpx"], ["boxShadow", "0 2rpx 8rpx rgba(0, 0, 0, 0.04)"]]))], ["tool-item", _pS(_uM([["width", "168rpx"], ["display", "flex"], ["flexDirection", "column"], ["alignItems", "center"], ["paddingTop", "20rpx"], ["paddingRight", 0], ["paddingBottom", "20rpx"], ["paddingLeft", 0]]))], ["tool-name", _pS(_uM([["fontSize", "24rpx"], ["color", "#666666"], ["textAlign", "center"]]))], ["promo-cards", _pS(_uM([["display", "flex"], ["flexDirection", "row"]]))], ["promo-card", _uM([["", _uM([["flexGrow", 1], ["flexShrink", 1], ["flexBasis", "0%"], ["borderTopLeftRadius", "16rpx"], ["borderTopRightRadius", "16rpx"], ["borderBottomRightRadius", "16rpx"], ["borderBottomLeftRadius", "16rpx"], ["paddingTop", "25rpx"], ["paddingRight", "25rpx"], ["paddingBottom", "25rpx"], ["paddingLeft", "25rpx"], ["display", "flex"], ["flexDirection", "row"], ["justifyContent", "space-between"], ["alignItems", "center"], ["boxShadow", "0 2rpx 8rpx rgba(0, 0, 0, 0.04)"]])], [".invite", _uM([["backgroundImage", "linear-gradient(135deg, #fff9e6 0%, #ffeaa7 100%)"], ["backgroundColor", "rgba(0,0,0,0)"]])], [".team", _uM([["backgroundImage", "linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%)"], ["backgroundColor", "rgba(0,0,0,0)"]])]])], ["promo-content", _pS(_uM([["display", "flex"], ["flexDirection", "column"]]))], ["promo-title", _pS(_uM([["fontSize", "28rpx"], ["fontWeight", "bold"], ["color", "#333333"]]))], ["promo-subtitle", _pS(_uM([["fontSize", "24rpx"], ["color", "#666666"]]))], ["partner-banner", _pS(_uM([["backgroundImage", "linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%)"], ["backgroundColor", "rgba(0,0,0,0)"], ["borderTopLeftRadius", "16rpx"], ["borderTopRightRadius", "16rpx"], ["borderBottomRightRadius", "16rpx"], ["borderBottomLeftRadius", "16rpx"], ["paddingTop", "30rpx"], ["paddingRight", "30rpx"], ["paddingBottom", "30rpx"], ["paddingLeft", "30rpx"], ["display", "flex"], ["flexDirection", "row"], ["justifyContent", "space-between"], ["alignItems", "center"], ["color", "#ffffff"], ["boxShadow", "0 4rpx 12rpx rgba(0, 0, 0, 0.08)"]]))], ["partner-content", _pS(_uM([["display", "flex"], ["flexDirection", "column"]]))], ["partner-title", _pS(_uM([["fontSize", "32rpx"], ["fontWeight", "bold"]]))], ["partner-subtitle", _pS(_uM([["fontSize", "26rpx"], ["opacity", 0.9]]))], ["partner-icon", _pS(_uM([["display", "flex"], ["flexDirection", "row"], ["alignItems", "center"]]))], ["@TRANSITION", _uM([["progress-fill", _uM([["property", "width"], ["duration", "0.3s"], ["timingFunction", "ease"]])]])]])]
|