From c5277a58c6b0c902c9e7bd9a03bc714cc86aad82 Mon Sep 17 00:00:00 2001 From: "1960116313@qq.com" <1960116313@qq.com> Date: Sun, 21 Jan 2024 00:04:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=A1=AB=E8=A1=A5=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pnpm-lock.yaml | 7 ++ src/api/recharge/index.ts | 7 ++ src/components/AppRecharge/index.vue | 61 +++++++++----- src/components/AppUserInfo/index.vue | 6 +- src/store/moules/rechareStore/index.ts | 2 +- src/views/login/index.vue | 29 +++---- .../task/components/InviteForm/index.vue | 82 ++++++++++++++++++- 8 files changed, 157 insertions(+), 38 deletions(-) create mode 100644 src/api/recharge/index.ts diff --git a/package.json b/package.json index 3aede0f..692cfc6 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@vueuse/core": "^10.7.2", "ant-design-vue": "^4.1.0", "axios": "^1.6.5", + "clipboard-copy": "^4.0.1", "crypto-js": "^4.2.0", "lodash-es": "^4.17.21", "md-editor-v3": "^4.11.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ade4a40..f86dee7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ dependencies: axios: specifier: ^1.6.5 version: 1.6.5 + clipboard-copy: + specifier: ^4.0.1 + version: 4.0.1 crypto-js: specifier: ^4.2.0 version: 4.2.0 @@ -2535,6 +2538,10 @@ packages: escape-string-regexp: 1.0.5 dev: true + /clipboard-copy@4.0.1: + resolution: {integrity: sha512-wOlqdqziE/NNTUJsfSgXmBMIrYmfd5V0HCGsR8uAKHcg+h9NENWINcfRjtWGU77wDHC8B8ijV4hMTGYbrKovng==} + dev: false + /cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} diff --git a/src/api/recharge/index.ts b/src/api/recharge/index.ts new file mode 100644 index 0000000..0f714da --- /dev/null +++ b/src/api/recharge/index.ts @@ -0,0 +1,7 @@ +import { defHttp } from '@/utils/axios/index' + +export async function goodsType() { + return defHttp.get({ + url: `/hulk-system/dict/dictionary?code=goods_type`, + }) +} diff --git a/src/components/AppRecharge/index.vue b/src/components/AppRecharge/index.vue index 9189a22..23e091b 100644 --- a/src/components/AppRecharge/index.vue +++ b/src/components/AppRecharge/index.vue @@ -2,13 +2,20 @@ import { CloseOutlined, LeftOutlined, RightOutlined } from '@ant-design/icons-vue' import { Button, Carousel } from 'ant-design-vue' import { ref } from 'vue' +import { goodsType } from '@/api/recharge/index' import trumpet from '@/assets/images/recharge/lb.png' +import vip from '@/assets/images/recharge/vip.png' import { useRechargeStore } from '@/store/moules/rechareStore' const rechargeStore = useRechargeStore() const carouselRef = ref() - +function getType() { + goodsType().then((res) => { + console.log(res) + }) +} +getType() // 关闭充值弹窗 function handleClose() { rechargeStore.rechargeClose() @@ -85,6 +92,7 @@ function onNextClick() { :class="tabClass(index)" @click="selectTab(index)" > + {{ tab.title }} @@ -237,7 +245,7 @@ function onNextClick() { diff --git a/src/components/AppUserInfo/index.vue b/src/components/AppUserInfo/index.vue index 0204c89..8938589 100644 --- a/src/components/AppUserInfo/index.vue +++ b/src/components/AppUserInfo/index.vue @@ -25,7 +25,7 @@ function handleRecharge() {
- + {{ info.questionCount > 0 ? info?.questionCount : 0 }}
充值 @@ -34,7 +34,7 @@ function handleRecharge() {
- + {{ info?.messageCount }}
累计提问 @@ -43,7 +43,7 @@ function handleRecharge() {
- + {{ info?.createdDay }}天
来到同聪 diff --git a/src/store/moules/rechareStore/index.ts b/src/store/moules/rechareStore/index.ts index 0c6dc5f..8d77d0f 100644 --- a/src/store/moules/rechareStore/index.ts +++ b/src/store/moules/rechareStore/index.ts @@ -3,7 +3,7 @@ import { defineStore } from 'pinia' export const useRechargeStore = defineStore('useRechargeStore', { state: () => { return { - show: false, + show: true, } }, getters: { diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 8290183..664991e 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -27,7 +27,7 @@ const ruleForm = reactive({ phone: '', code: '', }) - +const loading = ref(false) async function validatePhone(_rule: Rule, value: string) { if (!value || !(/^1\d{10}$/.test(value))) // eslint-disable-next-line prefer-promise-reject-errors @@ -46,6 +46,7 @@ function handleLogin() { formRef.value .validate() .then(() => { + loading.value = true userStore.login({ user_type: UserTypeEnum.C, grant_type: GrantTypeEnum.SMS, @@ -55,9 +56,11 @@ function handleLogin() { type: TypeEnum.PHONE, }).then(() => { createMessage.success('登录成功') + loading.value = false router.push('/') }).catch(() => { createMessage.error('登录失败') + loading.value = false }) }) } @@ -176,13 +179,14 @@ function timer() { - +
v1.0.0
@@ -282,22 +286,21 @@ function timer() { font-size: 12px; color: #48a1fe; } + :deep(.ant-form-item-explain-error) { + font-size: 12px; + padding-left: 27px; + } + .custom-input { border: none; border-radius: 0; background-color: transparent; color: #333; border-bottom: 1px solid #c8cbd6; - &::placeholder { - font-size: 10px; - color: #6e7382; - letter-spacing: 3px; - } - &:focus { - box-shadow: none; + .ant-form-item-explain-error { + color: blue; } } - .login-title { margin-top: 50px; margin-bottom: 30px; @@ -313,12 +316,10 @@ function timer() { margin-top: 10px; width: 100%; height: 40px; - cursor: pointer; + background: #0075eb; border-radius: 4px; color: white; - text-align: center; - line-height: 40px; } .versions { width: 100%; diff --git a/src/views/task/components/InviteForm/index.vue b/src/views/task/components/InviteForm/index.vue index fe5b434..675710b 100644 --- a/src/views/task/components/InviteForm/index.vue +++ b/src/views/task/components/InviteForm/index.vue @@ -2,8 +2,9 @@ import { CloseOutlined, } from '@ant-design/icons-vue' -import { Button, QRCode } from 'ant-design-vue' +import { Button, Divider, QRCode, message } from 'ant-design-vue' import { ref } from 'vue' +import copy from 'clipboard-copy' defineProps({ show: { @@ -12,6 +13,7 @@ defineProps({ }, }) const emits = defineEmits(['update:show']) + // 关闭弹窗 function handleClose() { emits('update:show', false) @@ -27,6 +29,23 @@ async function dowloadChange() { a.click() document.body.removeChild(a) } + +const code = ref('你好啊') + +function copyText() { + copy(code.value) + .then(() => { + message.success({ + content: () => '复制成功', + class: 'message-class', + }) + // 复制成功后的操作 + }) + // .catch(() => { + // console.log('Failed to copy!') + // // 复制失败后的操作 + // }) +}