my.uvue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. import _easycom_u_icon from '@/components/u-icon/u-icon.vue';
  2. import { ref, reactive } from 'vue';
  3. // --- 用户信息 ---
  4. type UserInfo = {
  5. __$originalPosition?: UTSSourceMapPosition<"UserInfo", "pages/index/my.uvue", 179, 7>;
  6. name: string;
  7. avatar: string;
  8. level: number;
  9. growthValue: number;
  10. nextLevel: number;
  11. nextLevelGap: number;
  12. progressPercent: number;
  13. };
  14. type ToolItem = {
  15. __$originalPosition?: UTSSourceMapPosition<"ToolItem", "pages/index/my.uvue", 204, 7>;
  16. name: string;
  17. icon: string;
  18. color: string;
  19. };
  20. // avoid generic parameter on ref which earlier triggered an "interface does not
  21. // have constructors" error; cast the initial value instead.
  22. const __sfc__ = defineComponent({
  23. __name: 'my',
  24. setup(__props) {
  25. const __ins = getCurrentInstance()!;
  26. const _ctx = __ins.proxy as InstanceType<typeof __sfc__>;
  27. const _cache = __ins.renderCache;
  28. const userInfo = reactive<UserInfo>({
  29. name: '刘大锤',
  30. avatar: 'https://via.placeholder.com/100x100/4a90e2/ffffff?text=LD',
  31. level: 30,
  32. growthValue: 50,
  33. nextLevel: 2,
  34. nextLevelGap: 15,
  35. progressPercent: 75 // (50 / (50+15)) * 100 ≈ 75%
  36. } as UserInfo);
  37. // computed helpers to satisfy UTS inference rules
  38. // convert percent to a fixed rpx width (assuming 750rpx full width)
  39. const progressWidth = computed((): string => `${userInfo.progressPercent * 7.5}rpx`);
  40. // --- 工具列表 ---
  41. const tools = ref([
  42. { name: '学习园地', icon: 'book', color: '#ff9900' } as ToolItem,
  43. { name: '问题反馈', icon: 'chat', color: '#52c41a' } as ToolItem,
  44. { name: '定制优惠', icon: 'wallet', color: '#1890ff' } as ToolItem,
  45. { name: 'VIP俱乐部', icon: 'vip', color: '#faad14' } as ToolItem
  46. ] as ToolItem[]);
  47. // --- 方法 ---
  48. const contactService = () => {
  49. uni.showToast({ title: '联系客服', icon: 'none' });
  50. };
  51. const openSettings = () => {
  52. uni.showToast({ title: '打开设置', icon: 'none' });
  53. };
  54. const viewLevelDetail = () => {
  55. uni.showToast({ title: '查看等级详情', icon: 'none' });
  56. };
  57. const handleToolClick = (tool: ToolItem) => {
  58. uni.showToast({ title: `点击${tool.name}`, icon: 'none' });
  59. };
  60. const inviteFriends = () => {
  61. uni.showModal({
  62. title: '邀请好友',
  63. content: '分享链接邀请好友加入,单次最高可获奖励200元!',
  64. success: (res) => {
  65. if (res.confirm) {
  66. uni.showToast({ title: '已生成邀请链接', icon: 'success' });
  67. }
  68. }
  69. });
  70. };
  71. const viewTeam = () => {
  72. uni.showToast({ title: '查看团队成员', icon: 'none' });
  73. };
  74. const joinPartner = () => {
  75. uni.showModal({
  76. title: '城市合伙人',
  77. content: '全新盈利模式助你创业,立即申请成为城市合伙人!',
  78. success: (res) => {
  79. if (res.confirm) {
  80. uni.showToast({ title: '申请已提交', icon: 'success' });
  81. }
  82. }
  83. });
  84. };
  85. return (): any | null => {
  86. const _component_u_icon = resolveEasyComponent("u-icon", _easycom_u_icon);
  87. return _cE("view", _uM({ class: "page-container" }), [
  88. _cE("view", _uM({ class: "user-header" }), [
  89. _cE("image", _uM({
  90. src: userInfo['avatar'],
  91. class: "avatar",
  92. mode: "aspectFill"
  93. }), null, 8 /* PROPS */, ["src"]),
  94. _cE("view", _uM({ class: "user-info" }), [
  95. _cE("text", _uM({ class: "username" }), _tD(userInfo['name']), 1 /* TEXT */),
  96. _cE("view", _uM({ class: "badge-row" }), [
  97. _cE("text", _uM({ class: "badge vip" }), " 王牌 ")
  98. ])
  99. ]),
  100. _cE("view", _uM({ class: "header-actions" }), [
  101. _cE("view", _uM({
  102. class: "action-item",
  103. onClick: contactService
  104. }), [
  105. _cV(_component_u_icon, _uM({
  106. type: "customer-service",
  107. size: "24",
  108. color: "#666"
  109. })),
  110. _cE("text", null, " 客服 ")
  111. ]),
  112. _cE("view", _uM({
  113. class: "action-item",
  114. onClick: openSettings
  115. }), [
  116. _cV(_component_u_icon, _uM({
  117. type: "gear",
  118. size: "24",
  119. color: "#666"
  120. })),
  121. _cE("text", null, " 设置 ")
  122. ])
  123. ])
  124. ]),
  125. _cE("view", _uM({ class: "level-card" }), [
  126. _cE("view", _uM({ class: "level-main" }), [
  127. _cE("text", _uM({ class: "level-title" }), " V" + _tD(userInfo['level']), 1 /* TEXT */),
  128. _cE("text", _uM({ class: "level-sub" }), " 成长值 " + _tD(userInfo['growthValue']), 1 /* TEXT */)
  129. ]),
  130. _cE("view", _uM({ class: "level-progress" }), [
  131. _cE("text", _uM({ class: "progress-text" }), " 还差" + _tD(userInfo['nextLevelGap']) + "成长值可升至V" + _tD(userInfo['nextLevel']), 1 /* TEXT */),
  132. _cE("view", _uM({ class: "progress-bar" }), [
  133. _cE("view", _uM({
  134. class: "progress-fill",
  135. style: _nS(_uM({ width: unref(progressWidth) }))
  136. }), null, 4 /* STYLE */)
  137. ]),
  138. _cE("view", _uM({ class: "progress-labels" }), [
  139. _cE("text", null, " V1 "),
  140. _cE("text", null, " V2 ")
  141. ])
  142. ]),
  143. _cE("view", _uM({
  144. class: "level-badge",
  145. onClick: viewLevelDetail
  146. }), [
  147. _cV(_component_u_icon, _uM({
  148. type: "vip",
  149. size: "40",
  150. color: "#ffffff"
  151. })),
  152. _cE("text", null, " 我的等级 ")
  153. ])
  154. ]),
  155. _cE("view", _uM({ class: "section-title" }), " 我的档案 "),
  156. _cE("view", _uM({ class: "profile-stats" }), [
  157. _cE("view", _uM({ class: "stat-item" }), [
  158. _cE("text", _uM({ class: "stat-value" }), " 60 "),
  159. _cE("text", _uM({ class: "stat-label" }), " 签约 ")
  160. ]),
  161. _cE("view", _uM({ class: "stat-item" }), [
  162. _cE("text", _uM({ class: "stat-value" }), " 21 "),
  163. _cE("text", _uM({ class: "stat-label" }), " 解约 ")
  164. ]),
  165. _cE("view", _uM({ class: "stat-item" }), [
  166. _cV(_component_u_icon, _uM({
  167. type: "location",
  168. size: "24",
  169. color: "#666"
  170. })),
  171. _cE("text", _uM({ class: "stat-label" }), " 异地签到 ")
  172. ]),
  173. _cE("view", _uM({ class: "stat-item" }), [
  174. _cV(_component_u_icon, _uM({
  175. type: "cart",
  176. size: "24",
  177. color: "#666"
  178. })),
  179. _cE("text", _uM({ class: "stat-label" }), " 购买物料 ")
  180. ])
  181. ]),
  182. _cE("view", _uM({ class: "section-title" }), " 我的工具 "),
  183. _cE("view", _uM({ class: "tools-grid" }), [
  184. _cE(Fragment, null, RenderHelpers.renderList(tools.value, (tool, idx, __index, _cached): any => {
  185. return _cE("view", _uM({
  186. class: "tool-item",
  187. key: idx,
  188. onClick: () => { handleToolClick(tool); }
  189. }), [
  190. _cV(_component_u_icon, _uM({
  191. type: tool.icon,
  192. size: "32",
  193. color: tool.color
  194. }), null, 8 /* PROPS */, ["type", "color"]),
  195. _cE("text", _uM({ class: "tool-name" }), _tD(tool.name), 1 /* TEXT */)
  196. ], 8 /* PROPS */, ["onClick"]);
  197. }), 128 /* KEYED_FRAGMENT */)
  198. ]),
  199. _cE("view", _uM({ class: "promo-cards" }), [
  200. _cE("view", _uM({
  201. class: "promo-card invite",
  202. onClick: inviteFriends
  203. }), [
  204. _cE("view", _uM({ class: "promo-content" }), [
  205. _cE("text", _uM({ class: "promo-title" }), " 邀请好友赚钱 "),
  206. _cE("text", _uM({ class: "promo-subtitle" }), " 单次最高可奖200元 ")
  207. ]),
  208. _cV(_component_u_icon, _uM({
  209. type: "gift",
  210. size: "40",
  211. color: "#ffd700"
  212. }))
  213. ]),
  214. _cE("view", _uM({
  215. class: "promo-card team",
  216. onClick: viewTeam
  217. }), [
  218. _cE("view", _uM({ class: "promo-content" }), [
  219. _cE("text", _uM({ class: "promo-title" }), " 我的团队 "),
  220. _cE("text", _uM({ class: "promo-subtitle" }), " 团队成员100人 ")
  221. ]),
  222. _cV(_component_u_icon, _uM({
  223. type: "person",
  224. size: "40",
  225. color: "#4a90e2"
  226. }))
  227. ])
  228. ]),
  229. _cE("view", _uM({
  230. class: "partner-banner",
  231. onClick: joinPartner
  232. }), [
  233. _cE("view", _uM({ class: "partner-content" }), [
  234. _cE("text", _uM({ class: "partner-title" }), " 寻找城市合伙人 "),
  235. _cE("text", _uM({ class: "partner-subtitle" }), " 全新盈利模式助你创业 ")
  236. ]),
  237. _cE("view", _uM({ class: "partner-icon" }), [
  238. _cV(_component_u_icon, _uM({
  239. type: "person",
  240. size: "50",
  241. color: "#ffffff"
  242. })),
  243. _cV(_component_u_icon, _uM({
  244. type: "person",
  245. size: "30",
  246. color: "#ffffff",
  247. style: _nS(_uM({ "margin-left": "-20rpx" }))
  248. }), null, 8 /* PROPS */, ["style"])
  249. ])
  250. ])
  251. ]);
  252. };
  253. }
  254. });
  255. export default __sfc__;
  256. 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"]])]])]])];
  257. //# sourceMappingURL=my.uvue.map