From e0b7985e2b2cbbccc941598a45b0d17b877fda34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=99=BE=E5=A3=B3?= <121141103+disk5@users.noreply.github.com> Date: Sat, 22 Jun 2024 22:19:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B0=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/user.js | 1 + components/CaseBox/CaseBox.vue | 4 +- components/CaseList/CaseList.vue | 4 +- pages/user/user.vue | 10 + unpackage/dist/dev/mp-weixin/common/vendor.js | 177 ++++-------------- .../mp-weixin/components/CaseBox/CaseBox.js | 4 +- .../mp-weixin/components/CaseList/CaseList.js | 18 +- .../components/CaseList/CaseList.json | 3 +- .../components/CaseList/CaseList.wxml | 2 +- .../uview-plus/components/u-line/u-line.js | 2 +- .../components/u-overlay/u-overlay.js | 2 +- .../components/u-safe-bottom/u-safe-bottom.js | 2 +- .../components/u-status-bar/u-status-bar.js | 2 +- .../components/u-transition/u-transition.js | 2 +- .../dist/dev/mp-weixin/pages/user/user.js | 19 +- .../dist/dev/mp-weixin/pages/user/user.wxml | 2 +- .../dist/dev/mp-weixin/project.config.json | 2 +- .../dev/mp-weixin/project.private.config.json | 2 +- .../dist/dev/mp-weixin/utils/userUtils.js | 1 + utils/http.js | 1 + utils/userUtils.js | 2 +- 21 files changed, 91 insertions(+), 171 deletions(-) diff --git a/apis/user.js b/apis/user.js index 1de60cb..c464261 100644 --- a/apis/user.js +++ b/apis/user.js @@ -7,6 +7,7 @@ export const mark= (code) => { return http({ url:"/api/wxLogin", data:{ + code, }, method:"POST" diff --git a/components/CaseBox/CaseBox.vue b/components/CaseBox/CaseBox.vue index 2f59043..bc85828 100644 --- a/components/CaseBox/CaseBox.vue +++ b/components/CaseBox/CaseBox.vue @@ -2,7 +2,7 @@ - 加载 + 加载 @@ -28,7 +28,7 @@ import { onMounted, reactive, ref, defineProps, defineEmits,watch } from "vue"; const emit = defineEmits(["ClickCollection", "ClickLike"]); const ab = "/static/image/imgerr.png"; const errorImg = () => { - info.cover = "/static/image/imgerr.png"; + info.cover; }; const aaa = ref("name"); const props = defineProps({ diff --git a/components/CaseList/CaseList.vue b/components/CaseList/CaseList.vue index 29e39f3..3318869 100644 --- a/components/CaseList/CaseList.vue +++ b/components/CaseList/CaseList.vue @@ -8,9 +8,9 @@ - + diff --git a/pages/user/user.vue b/pages/user/user.vue index 24d240a..3c7dec0 100644 --- a/pages/user/user.vue +++ b/pages/user/user.vue @@ -3,12 +3,14 @@ + 我的 + @@ -20,6 +22,7 @@ + @@ -73,6 +76,7 @@ // }, ]) const show=ref(false); + const islogin=ref(false); const user = ref({ avatar: "/static/icon/tx.png", nickName: "点击登录" @@ -83,12 +87,17 @@ const open=()=>{ show.value=true; } + const clickLogin=()=>{ + gologin(); + } async function gologin(){ if(isLogin()){ + islogin.value=true; return } let res=await userUtils.value.login(); if(res.code==200){ + islogin.value=true; getUserInfo(); }else{ uni.showToast({ @@ -100,6 +109,7 @@ async function getUserInfo(){ const resp = await userInfo() user.value = resp.data + islogin.value=true; } const updata=()=>{ getUserInfo(); diff --git a/unpackage/dist/dev/mp-weixin/common/vendor.js b/unpackage/dist/dev/mp-weixin/common/vendor.js index 7487d56..3c56f5d 100644 --- a/unpackage/dist/dev/mp-weixin/common/vendor.js +++ b/unpackage/dist/dev/mp-weixin/common/vendor.js @@ -10158,7 +10158,7 @@ const createHook = (lifecycle) => (hook, target = getCurrentInstance()) => { }; const onShow = /* @__PURE__ */ createHook(ON_SHOW); const onLoad = /* @__PURE__ */ createHook(ON_LOAD); -const props$n = { +const props$m = { props: { // 列表数组,元素可为字符串,如为对象可通过keyName指定目标属性名 list: { @@ -10283,7 +10283,7 @@ const props$n = { } } }; -const props$m = { +const props$l = { props: { // 宫格的name name: { @@ -10297,7 +10297,7 @@ const props$m = { } } }; -const props$l = { +const props$k = { props: { // 分成几列 col: { @@ -10316,7 +10316,7 @@ const props$l = { } } }; -const props$k = { +const props$j = { props: { // 主题颜色 type: { @@ -10538,7 +10538,7 @@ const openType = { } } }; -const props$j = { +const props$i = { props: { // 是否展示弹窗 show: { @@ -10617,7 +10617,7 @@ const props$j = { } } }; -const props$i = { +const props$h = { props: { // 头像图片路径(不能为相对路径) src: { @@ -10695,7 +10695,7 @@ const props$i = { } } }; -const props$h = { +const props$g = { props: { // 标题 title: { @@ -10805,7 +10805,7 @@ const props$h = { } } }; -const props$g = { +const props$f = { props: { // 用于滚动到指定item anchor: { @@ -10814,7 +10814,7 @@ const props$g = { } } }; -const props$f = { +const props$e = { props: { // 控制是否出现滚动条,仅nvue有效 showScrollbar: { @@ -10913,7 +10913,7 @@ const props$f = { } } }; -const props$e = { +const props$d = { props: { // 绑定的值 modelValue: { @@ -11099,7 +11099,7 @@ const props$e = { } } }; -const props$d = { +const props$c = { props: { // 是否细边框 hairline: { @@ -11369,7 +11369,7 @@ const mixinUp = { } } }; -const props$c = { +const props$b = { props: { // 接受的文件类型, 可选值为all media image file video accept: { @@ -11493,7 +11493,7 @@ const props$c = { } } }; -const props$b = { +const props$a = { props: { // 到顶部的距离 top: { @@ -11542,7 +11542,7 @@ const props$b = { } } }; -const props$a = { +const props$9 = { props: { // tab的数据 list: { @@ -11805,7 +11805,7 @@ const icons = { "uicon-zh": "", "uicon-en": "" }; -const props$9 = { +const props$8 = { props: { // 图标类名 name: { @@ -11894,7 +11894,7 @@ const props$9 = { } } }; -const props$8 = { +const props$7 = { props: { // 是否显示组件 show: { @@ -11953,7 +11953,7 @@ const props$8 = { } } }; -const props$7 = { +const props$6 = { props: { // 轮播的长度 length: { @@ -11982,7 +11982,7 @@ const props$7 = { } } }; -const props$6 = { +const props$5 = { props: { // 文字颜色 color: { @@ -12021,100 +12021,6 @@ const props$6 = { } } }; -const props$5 = { - props: { - // 组件状态,loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态 - status: { - type: String, - default: () => defProps.loadmore.status - }, - // 组件背景色 - bgColor: { - type: String, - default: () => defProps.loadmore.bgColor - }, - // 是否显示加载中的图标 - icon: { - type: Boolean, - default: () => defProps.loadmore.icon - }, - // 字体大小 - fontSize: { - type: [String, Number], - default: () => defProps.loadmore.fontSize - }, - // 图标大小 - iconSize: { - type: [String, Number], - default: () => defProps.loadmore.iconSize - }, - // 字体颜色 - color: { - type: String, - default: () => defProps.loadmore.color - }, - // 加载中状态的图标,spinner-花朵状图标,circle-圆圈状,semicircle-半圆 - loadingIcon: { - type: String, - default: () => defProps.loadmore.loadingIcon - }, - // 加载前的提示语 - loadmoreText: { - type: String, - default: () => defProps.loadmore.loadmoreText - }, - // 加载中提示语 - loadingText: { - type: String, - default: () => defProps.loadmore.loadingText - }, - // 没有更多的提示语 - nomoreText: { - type: String, - default: () => defProps.loadmore.nomoreText - }, - // 在“没有更多”状态下,是否显示粗点 - isDot: { - type: Boolean, - default: () => defProps.loadmore.isDot - }, - // 加载中图标的颜色 - iconColor: { - type: String, - default: () => defProps.loadmore.iconColor - }, - // 上边距 - marginTop: { - type: [String, Number], - default: () => defProps.loadmore.marginTop - }, - // 下边距 - marginBottom: { - type: [String, Number], - default: () => defProps.loadmore.marginBottom - }, - // 高度,单位px - height: { - type: [String, Number], - default: () => defProps.loadmore.height - }, - // 是否显示左边分割线 - line: { - type: Boolean, - default: () => defProps.loadmore.line - }, - // 线条颜色 - lineColor: { - type: String, - default: () => defProps.loadmore.lineColor - }, - // 是否虚线,true-虚线,false-实线 - dashed: { - type: Boolean, - default: () => defProps.loadmore.dashed - } - } -}; const props$4 = { props: { // 是否显示遮罩 @@ -12294,30 +12200,29 @@ exports.onMounted = onMounted; exports.onShow = onShow; exports.openType = openType; exports.p = p; -exports.props = props$n; -exports.props$1 = props$m; -exports.props$10 = props$d; -exports.props$11 = props$c; -exports.props$12 = props$b; -exports.props$13 = props$a; -exports.props$14 = props$9; -exports.props$15 = props$8; -exports.props$16 = props$7; -exports.props$17 = props$6; -exports.props$18 = props$5; -exports.props$19 = props$4; -exports.props$2 = props$l; -exports.props$20 = props$3; -exports.props$21 = props$2; -exports.props$22 = props$1; -exports.props$23 = props; -exports.props$3 = props$k; -exports.props$4 = props$j; -exports.props$5 = props$i; -exports.props$6 = props$h; -exports.props$7 = props$g; -exports.props$8 = props$f; -exports.props$9 = props$e; +exports.props = props$m; +exports.props$1 = props$l; +exports.props$10 = props$c; +exports.props$11 = props$b; +exports.props$12 = props$a; +exports.props$13 = props$9; +exports.props$14 = props$8; +exports.props$15 = props$7; +exports.props$16 = props$6; +exports.props$17 = props$5; +exports.props$18 = props$4; +exports.props$19 = props$3; +exports.props$2 = props$k; +exports.props$20 = props$2; +exports.props$21 = props$1; +exports.props$22 = props; +exports.props$3 = props$j; +exports.props$4 = props$i; +exports.props$5 = props$h; +exports.props$6 = props$g; +exports.props$7 = props$f; +exports.props$8 = props$e; +exports.props$9 = props$d; exports.random = random; exports.reactive = reactive; exports.ref = ref; diff --git a/unpackage/dist/dev/mp-weixin/components/CaseBox/CaseBox.js b/unpackage/dist/dev/mp-weixin/components/CaseBox/CaseBox.js index 29cdc20..99a21a4 100644 --- a/unpackage/dist/dev/mp-weixin/components/CaseBox/CaseBox.js +++ b/unpackage/dist/dev/mp-weixin/components/CaseBox/CaseBox.js @@ -74,7 +74,7 @@ const _sfc_main = { setup(__props, { emit: __emit }) { const emit = __emit; const errorImg = () => { - info.cover = "/static/image/imgerr.png"; + info.cover; }; common_vendor.ref("name"); const props = __props; @@ -150,7 +150,7 @@ const _sfc_main = { }); return (_ctx, _cache) => { return common_vendor.e({ - a: info.cover, + a: props.cover, b: common_vendor.o(errorImg), c: common_vendor.p({ lines: 1, diff --git a/unpackage/dist/dev/mp-weixin/components/CaseList/CaseList.js b/unpackage/dist/dev/mp-weixin/components/CaseList/CaseList.js index efd3f4b..b07530b 100644 --- a/unpackage/dist/dev/mp-weixin/components/CaseList/CaseList.js +++ b/unpackage/dist/dev/mp-weixin/components/CaseList/CaseList.js @@ -8,13 +8,11 @@ require("../../utils/http.js"); require("../../utils/Auth.js"); if (!Array) { const _easycom_CaseBox2 = common_vendor.resolveComponent("CaseBox"); - const _easycom_up_loadmore2 = common_vendor.resolveComponent("up-loadmore"); - (_easycom_CaseBox2 + _easycom_up_loadmore2)(); + _easycom_CaseBox2(); } const _easycom_CaseBox = () => "../CaseBox/CaseBox.js"; -const _easycom_up_loadmore = () => "../../node-modules/uview-plus/components/u-loadmore/u-loadmore.js"; if (!Math) { - (_easycom_CaseBox + _easycom_up_loadmore)(); + _easycom_CaseBox(); } const _sfc_main = { __name: "CaseList", @@ -127,7 +125,7 @@ const _sfc_main = { getCaseLists(); }); return (_ctx, _cache) => { - return common_vendor.e({ + return { a: common_vendor.f(caseList.value, (item, index, i0) => { return { a: common_vendor.o(ClickLike, index), @@ -139,14 +137,8 @@ const _sfc_main = { e: index }; }), - b: isLoading.value - }, isLoading.value ? { - c: common_vendor.p({ - status: status.value - }) - } : {}, { - d: common_vendor.o(loadMore) - }); + b: common_vendor.o(loadMore) + }; }; } }; diff --git a/unpackage/dist/dev/mp-weixin/components/CaseList/CaseList.json b/unpackage/dist/dev/mp-weixin/components/CaseList/CaseList.json index af85a97..00f667a 100644 --- a/unpackage/dist/dev/mp-weixin/components/CaseList/CaseList.json +++ b/unpackage/dist/dev/mp-weixin/components/CaseList/CaseList.json @@ -1,7 +1,6 @@ { "component": true, "usingComponents": { - "case-box": "../CaseBox/CaseBox", - "up-loadmore": "../../node-modules/uview-plus/components/u-loadmore/u-loadmore" + "case-box": "../CaseBox/CaseBox" } } \ No newline at end of file diff --git a/unpackage/dist/dev/mp-weixin/components/CaseList/CaseList.wxml b/unpackage/dist/dev/mp-weixin/components/CaseList/CaseList.wxml index a431624..f49f05c 100644 --- a/unpackage/dist/dev/mp-weixin/components/CaseList/CaseList.wxml +++ b/unpackage/dist/dev/mp-weixin/components/CaseList/CaseList.wxml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-line/u-line.js b/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-line/u-line.js index a54994b..d5732a0 100644 --- a/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-line/u-line.js +++ b/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-line/u-line.js @@ -2,7 +2,7 @@ const common_vendor = require("../../../../common/vendor.js"); const _sfc_main = { name: "u-line", - mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$23], + mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$22], computed: { lineStyle() { const style = {}; diff --git a/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-overlay/u-overlay.js b/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-overlay/u-overlay.js index 933ea43..7e7b013 100644 --- a/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-overlay/u-overlay.js +++ b/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-overlay/u-overlay.js @@ -2,7 +2,7 @@ const common_vendor = require("../../../../common/vendor.js"); const _sfc_main = { name: "u-overlay", - mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$19], + mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$18], computed: { overlayStyle() { const style = { diff --git a/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-safe-bottom/u-safe-bottom.js b/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-safe-bottom/u-safe-bottom.js index 9e51967..b3815ae 100644 --- a/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-safe-bottom/u-safe-bottom.js +++ b/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-safe-bottom/u-safe-bottom.js @@ -2,7 +2,7 @@ const common_vendor = require("../../../../common/vendor.js"); const _sfc_main = { name: "u-safe-bottom", - mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$21], + mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$20], data() { return { safeAreaBottomHeight: 0, diff --git a/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-status-bar/u-status-bar.js b/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-status-bar/u-status-bar.js index f74a242..00579be 100644 --- a/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-status-bar/u-status-bar.js +++ b/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-status-bar/u-status-bar.js @@ -2,7 +2,7 @@ const common_vendor = require("../../../../common/vendor.js"); const _sfc_main = { name: "u-status-bar", - mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$20], + mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$19], data() { return {}; }, diff --git a/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-transition/u-transition.js b/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-transition/u-transition.js index e056b71..0210e90 100644 --- a/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-transition/u-transition.js +++ b/unpackage/dist/dev/mp-weixin/node-modules/uview-plus/components/u-transition/u-transition.js @@ -33,7 +33,7 @@ const _sfc_main = { } }, // 将mixin挂在到组件中,实际上为一个vue格式对象。 - mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.transition, common_vendor.props$22], + mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.transition, common_vendor.props$21], watch: { show: { handler(newVal) { diff --git a/unpackage/dist/dev/mp-weixin/pages/user/user.js b/unpackage/dist/dev/mp-weixin/pages/user/user.js index ec12477..7e89b0a 100644 --- a/unpackage/dist/dev/mp-weixin/pages/user/user.js +++ b/unpackage/dist/dev/mp-weixin/pages/user/user.js @@ -49,6 +49,7 @@ const _sfc_main = { // }, ]); const show = common_vendor.ref(false); + const islogin = common_vendor.ref(false); const user = common_vendor.ref({ avatar: "/static/icon/tx.png", nickName: "点击登录" @@ -59,12 +60,17 @@ const _sfc_main = { const open = () => { show.value = true; }; + const clickLogin = () => { + gologin(); + }; async function gologin() { if (utils_Auth.isLogin()) { + islogin.value = true; return; } let res = await userUtils.value.login(); if (res.code == 200) { + islogin.value = true; getUserInfo(); } else { common_vendor.index.showToast({ @@ -76,6 +82,7 @@ const _sfc_main = { async function getUserInfo() { const resp = await comm_api.userInfo(); user.value = resp.data; + islogin.value = true; } const updata = () => { getUserInfo(); @@ -104,7 +111,7 @@ const _sfc_main = { common_vendor.onLoad(() => { }); return (_ctx, _cache) => { - return { + return common_vendor.e({ a: common_vendor.o(updata), b: common_vendor.o(close), c: common_vendor.o(open), @@ -118,7 +125,11 @@ const _sfc_main = { f: common_vendor.t(user.value.username), g: common_vendor.t(user.value.phoneNumber), h: common_vendor.o(gologin), - i: common_vendor.f(serviceList, (item, index, i0) => { + i: !islogin.value + }, !islogin.value ? { + j: common_vendor.o(clickLogin) + } : {}, { + k: common_vendor.f(serviceList, (item, index, i0) => { return { a: "0f7520f0-5-" + i0 + "," + ("0f7520f0-4-" + i0), b: common_vendor.p({ @@ -136,10 +147,10 @@ const _sfc_main = { g: "0f7520f0-3-" + i0 + ",0f7520f0-2" }; }), - j: common_vendor.p({ + l: common_vendor.p({ scrollable: false }) - }; + }); }; } }; diff --git a/unpackage/dist/dev/mp-weixin/pages/user/user.wxml b/unpackage/dist/dev/mp-weixin/pages/user/user.wxml index b3d67fc..be0243f 100644 --- a/unpackage/dist/dev/mp-weixin/pages/user/user.wxml +++ b/unpackage/dist/dev/mp-weixin/pages/user/user.wxml @@ -1 +1 @@ -我的{{f}}{{g}} \ No newline at end of file +我的{{f}}{{g}} \ No newline at end of file diff --git a/unpackage/dist/dev/mp-weixin/project.config.json b/unpackage/dist/dev/mp-weixin/project.config.json index 900fec4..2b9351c 100644 --- a/unpackage/dist/dev/mp-weixin/project.config.json +++ b/unpackage/dist/dev/mp-weixin/project.config.json @@ -20,7 +20,7 @@ "outputPath": "" }, "condition": false, - "ignoreUploadUnusedFiles": true + "ignoreUploadUnusedFiles": false }, "condition": {}, "editorSetting": { diff --git a/unpackage/dist/dev/mp-weixin/project.private.config.json b/unpackage/dist/dev/mp-weixin/project.private.config.json index 15ede59..700c93f 100644 --- a/unpackage/dist/dev/mp-weixin/project.private.config.json +++ b/unpackage/dist/dev/mp-weixin/project.private.config.json @@ -3,6 +3,6 @@ "projectname": "gree_leran", "setting": { "compileHotReLoad": true, - "urlCheck": false + "urlCheck": true } } \ No newline at end of file diff --git a/unpackage/dist/dev/mp-weixin/utils/userUtils.js b/unpackage/dist/dev/mp-weixin/utils/userUtils.js index f8dca66..1a6b3a7 100644 --- a/unpackage/dist/dev/mp-weixin/utils/userUtils.js +++ b/unpackage/dist/dev/mp-weixin/utils/userUtils.js @@ -3,6 +3,7 @@ const common_vendor = require("../common/vendor.js"); const apis_user = require("../apis/user.js"); class userUtils { constructor() { + this.login(); } //获取用户code的同步封装 getCode() { diff --git a/utils/http.js b/utils/http.js index 4ec59c6..ff44d39 100644 --- a/utils/http.js +++ b/utils/http.js @@ -5,6 +5,7 @@ import { export const baseUrl = "https://9miao.fun/prod-api" // export const baseUrl="http://127.0.0.1:8080" + export const http = (option) => { if (!option instanceof Object) { throw "参数非法" diff --git a/utils/userUtils.js b/utils/userUtils.js index 75fd284..2cb6f3f 100644 --- a/utils/userUtils.js +++ b/utils/userUtils.js @@ -1,7 +1,7 @@ import{mark,bind,unbind,updatePassword} from'@/apis/user.js' class userUtils{ constructor(){ - // this.login(); + this.login(); // this.getImage(); }