新增抖音团购券核销

This commit is contained in:
gyq
2024-07-17 18:02:01 +08:00
parent aa25c6be3b
commit c155e8a805
13 changed files with 257 additions and 48 deletions

View File

@@ -22,7 +22,16 @@
<el-input v-model="form.loginName" placeholder="请输入11位手机号码"></el-input>
</el-form-item>
<el-form-item label="登录密码" prop="password">
<el-input v-model="form.password" type="password" placeholder="请输入登录密码"></el-input>
<el-input v-model="form.password" :type="passwordType" placeholder="请输入登录密码">
<template #suffix>
<el-icon class="el-input__icon" v-if="passwordType == 'password'" @click="passwordType = 'text'">
<Hide />
</el-icon>
<el-icon class="el-input__icon" v-else @click="passwordType = 'password'">
<View />
</el-icon>
</template>
</el-input>
</el-form-item>
<!-- <el-form-item>
<div style="width: 100%; display: flex; justify-content: flex-end">
@@ -54,7 +63,8 @@
import packageData from "../../package.json";
import logo from "@/assets/logo.png";
import { ElMessage, ElMessageBox } from "element-plus";
import { reactive, ref } from "vue";
import { Hide, View } from '@element-plus/icons-vue'
import { onMounted, reactive, ref } from "vue";
import { useRouter } from "vue-router";
import { ipcRenderer } from "electron";
import { RandomNumBoth } from "@/utils";
@@ -69,6 +79,7 @@ const socket = useSocket();
const router = useRouter();
const formRef = ref(null);
const loading = ref(false);
const passwordType = ref('password')
const form = reactive({
serialNumber: RandomNumBoth(1000, 9999),
@@ -110,12 +121,6 @@ const submitHandle = () => {
store
.userlogin(form)
.then(async (res) => {
// const douyin = await douyincheckIn({
// token: res.token,
// loginName: res.loginName,
// clientType: 'pc'
// })
// useStorage.set('douyin', douyin.userInfo)
ElMessage.success("登录成功");
socket.init();
setTimeout(() => {
@@ -123,6 +128,12 @@ const submitHandle = () => {
name: "home",
});
}, 1000);
const douyin = await douyincheckIn({
token: res.token,
loginName: res.loginName,
clientType: 'pc'
})
useStorage.set('douyin', douyin.userInfo)
})
.catch((err) => {
loading.value = false;
@@ -138,6 +149,10 @@ const logout = () => {
})
.catch(() => { });
};
onMounted(() => {
passwordType.icon = Hide
})
</script>
<style scoped lang="scss">