Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
kaisa
/
SopWeb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0bbd1caa
authored
Nov 17, 2025
by
kaisa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:更新
parent
7de5ee2e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
104 additions
and
177 deletions
src/api/activity/recruitmentApi.ts
src/utils/request.ts
src/utils/requestAct.ts
src/utils/requestGame.ts
src/views/activity/recruitment/components/review/index.vue
src/views/activity/recruitment/components/sign/index.vue
src/views/activity/recruitment/index.vue
src/api/activity/recruitmentApi.ts
View file @
0bbd1caa
import
request
from
"@/utils/request"
;
import
request
from
"@/utils/request
Act
"
;
import
type
{
ReturnReq
}
from
"../types"
;
import
{
handleQueryParams
}
from
'@/utils/common'
const
queryParams
=
handleQueryParams
()
...
...
@@ -10,14 +10,32 @@ if (queryParams.lang == '0' || queryParams.lang == '2') {
lang
=
1
}
// 获取
用户信息
export
const
get
User
=
(
data
:
{
target
:
number
}
):
Promise
<
ReturnReq
>
=>
{
// 获取
主播签约页面
export
const
get
SignView
=
(
):
Promise
<
ReturnReq
>
=>
{
return
request
({
method
:
"
pos
t"
,
url
:
"/
data/getUser
"
,
data
:
{
method
:
"
ge
t"
,
url
:
"/
webSopAnchor/getSignView
"
,
params
:
{
lang
,
target
:
data
.
target
}
});
}
//主播进行签约
export
const
anchorSign
=
(
params
:
{
platform
:
string
,
micName
:
string
,
idCard
:
string
}):
Promise
<
ReturnReq
>
=>
{
return
request
({
method
:
"get"
,
url
:
"/webSopAnchor/sign"
,
params
:
{
lang
,
platform
:
params
.
platform
,
micName
:
params
.
micName
,
idCard
:
params
.
idCard
}
});
}
src/utils/request.ts
deleted
100644 → 0
View file @
7de5ee2e
// src/utils/request.ts
import
axios
,
{
InternalAxiosRequestConfig
,
AxiosResponse
}
from
"axios"
;
import
{
showToast
}
from
'vant'
;
import
{
getQueryParams
}
from
"./common"
;
// 创建 axios 实例
const
service
=
axios
.
create
({
// baseURL: import.meta.env.VITE_APP_BASE_API,
baseURL
:
import
.
meta
.
env
.
VITE_APP_API_URL
,
timeout
:
30000
,
/* "application/json;charset=utf-8" */
headers
:
{
"Content-Type"
:
"application/x-www-form-urlencoded; charset=UTF-8"
},
});
// 请求拦截器
service
.
interceptors
.
request
.
use
(
(
config
:
InternalAxiosRequestConfig
)
=>
{
// console.log("配置", config)
// get请求映射params参数
const
queryParams
=
getQueryParams
();
const
requestParams
=
{
token
:
queryParams
.
token
,
uid
:
queryParams
.
uid
,
lang
:
queryParams
?.
lang
||
2
,
cid
:
queryParams
?.
cid
||
"web_gw"
,
os
:
"WEB"
,
};
console
.
log
(
config
);
if
(
config
.
params
)
{
let
url
=
config
.
url
+
"?"
;
for
(
const
propName
of
Object
.
keys
(
config
.
params
))
{
const
value
=
config
.
params
[
propName
];
var
part
=
encodeURIComponent
(
propName
)
+
"="
;
if
(
value
!==
null
&&
typeof
value
!==
"undefined"
)
{
if
(
typeof
value
===
"object"
)
{
for
(
const
key
of
Object
.
keys
(
value
))
{
let
params
=
propName
+
"["
+
key
+
"]"
;
var
subPart
=
encodeURIComponent
(
params
)
+
"="
;
url
+=
subPart
+
encodeURIComponent
(
value
[
key
])
+
"&"
;
}
}
else
{
url
+=
part
+
encodeURIComponent
(
value
)
+
"&"
;
}
}
}
url
=
url
.
slice
(
0
,
-
1
);
config
.
params
=
{
...
config
.
params
,
...
requestParams
};
config
.
url
=
url
;
}
else
if
(
config
.
data
)
{
config
.
data
=
{
...
config
.
data
,
...
requestParams
};
}
else
{
config
.
params
=
requestParams
;
}
// console.log("config.url==========", config.url)
return
config
;
},
(
error
:
any
)
=>
{
return
Promise
.
reject
(
error
);
}
);
// 响应拦截器
service
.
interceptors
.
response
.
use
(
(
response
:
AxiosResponse
)
=>
{
// console.log("response", response)
// 检查配置的响应类型是否为二进制类型('blob' 或 'arraybuffer'), 如果是,直接返回响应对象
if
(
response
.
config
.
responseType
===
"blob"
||
response
.
config
.
responseType
===
"arraybuffer"
)
{
return
response
;
}
// console.log("response", response.data.code);
const
{
code
,
msg
}
=
response
.
data
;
return
response
.
data
;
// if (code === 1) {
// return response.data;
// }
// showToast (msg || "請求失敗,請稍後重試");
// return Promise.reject(new Error(response.data));
},
(
error
:
any
)
=>
{
console
.
log
(
"error"
,
error
);
if
(
error
.
response
&&
error
.
response
.
data
)
{
const
{
code
,
msg
}
=
error
.
response
.
data
;
showToast
(
msg
||
"請求失敗,請稍後重試"
);
}
return
Promise
.
reject
(
error
.
message
);
}
);
// 导出 axios 实例
export
default
service
;
src/utils/requestAct.ts
View file @
0bbd1caa
...
...
@@ -4,13 +4,11 @@ import { handleQueryParams } from "./common";
// 创建 axios 实例
const
service
=
axios
.
create
({
baseURL
:
import
.
meta
.
env
.
VITE_APP_A
CTIVE
_URL
,
baseURL
:
import
.
meta
.
env
.
VITE_APP_A
PI
_URL
,
timeout
:
30000
,
headers
:
{
"Content-Type"
:
"application/x-www-form-urlencoded; charset=UTF-8"
},
});
console
.
log
(
import
.
meta
.
env
.
VITE_APP_ACTIVE_URL
,
'import.meta.env.VITE_APP_ACTIVE_URL+'
);
// 请求拦截器
service
.
interceptors
.
request
.
use
(
(
config
:
InternalAxiosRequestConfig
)
=>
{
...
...
@@ -19,7 +17,7 @@ service.interceptors.request.use(
const
queryParams
=
handleQueryParams
();
const
newParams
=
{
token
:
queryParams
?.
token
||
"debug"
,
ui
d
:
queryParams
?.
uid
||
123456
,
micI
d
:
queryParams
?.
uid
||
123456
,
lang
:
queryParams
?.
lang
||
2
,
cid
:
queryParams
?.
cid
||
"web_gw"
,
vest
:
queryParams
?.
vest
||
0
,
...
...
src/utils/requestGame.ts
deleted
100644 → 0
View file @
7de5ee2e
import
axios
,
{
InternalAxiosRequestConfig
,
AxiosResponse
}
from
"axios"
;
import
{
showToast
}
from
'vant'
;
import
{
handleQueryParams
}
from
"./common"
;
// 创建 axios 实例\
const
service
=
axios
.
create
({
baseURL
:
import
.
meta
.
env
.
VITE_APP_GAME_API_URL
,
timeout
:
30000
,
headers
:
{
"Content-Type"
:
"application/json;charset=utf-8"
},
});
// 请求拦截器
service
.
interceptors
.
request
.
use
(
(
config
:
InternalAxiosRequestConfig
)
=>
{
// 配置统一请求必传参数
const
queryParams
=
handleQueryParams
();
const
newParams
=
{
token
:
queryParams
?.
token
||
"debug"
,
uid
:
queryParams
?.
uid
||
123456
,
roomId
:
queryParams
?.
roomId
||
""
,
lang
:
queryParams
?.
lang
||
2
,
cid
:
queryParams
?.
cid
||
"web_gw"
,
vest
:
queryParams
?.
vest
||
0
,
os
:
"WEB"
,
pkg
:
queryParams
?.
pkg
||
""
,
appname
:
queryParams
?.
appname
||
""
,
version
:
queryParams
?.
appversion
||
""
,
};
if
(
config
.
method
==
'post'
)
{
config
.
headers
[
"Content-Type"
]
=
"application/x-www-form-urlencoded; charset=UTF-8"
;
config
.
data
=
{
...
newParams
,
...
config
.
data
};
}
else
{
config
.
params
=
{
...
newParams
,
...
config
.
params
};
}
return
config
;
},
(
error
:
any
)
=>
{
return
Promise
.
reject
(
error
);
}
);
// 响应拦截器
service
.
interceptors
.
response
.
use
(
(
response
:
AxiosResponse
)
=>
{
const
{
code
,
msg
}
=
response
.
data
if
(
code
===
1
)
{
return
response
.
data
;
}
else
{
showToast
(
msg
||
"請求失敗,請稍後重試"
);
return
response
.
data
;
}
},
(
error
:
any
)
=>
{
console
.
log
(
"error"
,
error
);
if
(
error
.
response
&&
error
.
response
.
data
)
{
const
{
code
,
msg
}
=
error
.
response
.
data
;
showToast
(
msg
||
"請求失敗,請稍後重試"
);
}
return
Promise
.
reject
(
error
.
message
);
}
);
// 导出 axios 实例
export
default
service
;
src/views/activity/recruitment/components/review/index.vue
View file @
0bbd1caa
...
...
@@ -2,6 +2,26 @@
const
isSuccess
=
ref
(
false
)
const
isFail
=
ref
(
false
)
const
isJudge
=
ref
(
false
)
interface
Props
{
resultLevel
:
number
;
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
resultLevel
:
0
});
// 监听签约状态
watch
(()
=>
props
.
resultLevel
,
(
newVal
)
=>
{
// 签约状态 -1 签约驳回 0 审核中 1 签约成功
if
(
newVal
===
-
1
)
{
isFail
.
value
=
true
}
else
if
(
newVal
===
0
)
{
isJudge
.
value
=
true
}
else
if
(
newVal
===
1
)
{
isSuccess
.
value
=
true
}
},
{
deep
:
true
});
</
script
>
<
template
>
<div
class=
"review-wrap"
>
...
...
src/views/activity/recruitment/components/sign/index.vue
View file @
0bbd1caa
<
script
setup
lang=
"ts"
>
import
{
anchorSign
}
from
"@/api/activity/recruitmentApi"
;
interface
Props
{
signLevel
:
number
;
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
signLevel
:
0
});
/* 主播信息表單 */
const
formData
=
ref
({
platform
:
''
,
...
...
@@ -23,6 +34,11 @@ const stages = [
];
const
stageIndex
=
ref
(
0
)
// 监听合作状态 0 试合作 1 中期合作 2 长期合作
watch
(()
=>
props
.
signLevel
,
(
newVal
)
=>
{
stageIndex
.
value
=
newVal
;
},
{
deep
:
true
});
const
onConfirm
=
({
selectedValues
}:
any
)
=>
{
formData
.
value
.
platform
=
selectedValues
;
showPlatformPicker
.
value
=
false
;
...
...
@@ -33,6 +49,15 @@ const onSubmit = async () => {
try
{
await
formRef
.
value
.
validate
();
console
.
log
(
'表单验证通过'
,
formData
.
value
);
const
{
code
,
msg
,
data
}
=
await
anchorSign
({
platform
:
formData
.
value
.
platform
,
micName
:
formData
.
value
.
userName
,
idCard
:
formData
.
value
.
idNum
});
console
.
log
(
data
,
'data~'
);
}
catch
(
error
)
{
}
};
...
...
@@ -442,11 +467,11 @@ const onSubmit = async () => {
}
}
.marker
:nth-child
(
1
)
{
.marker
:nth-child
(
1
)
{
padding-left
:
53px
;
}
.marker
:nth-child
(
3
)
{
.marker
:nth-child
(
3
)
{
padding-left
:
30px
;
}
}
...
...
src/views/activity/recruitment/index.vue
View file @
0bbd1caa
<
script
setup
lang=
"ts"
>
import
review
from
'./components/review/index.vue'
import
sign
from
'./components/sign/index.vue'
import
{
getSignView
,
}
from
"@/api/activity/recruitmentApi"
;
const
isShowReview
=
ref
(
false
)
const
signLevel
=
ref
(
0
)
const
resultLevel
=
ref
(
0
)
// 获取页面信息
const
getAnchorSignView
=
async
()
=>
{
const
{
code
,
msg
,
data
}
=
await
getSignView
();
// 签约状态 0 需要签约页面 1 签约结果页面
if
(
data
.
signInfo
==
1
)
{
isShowReview
.
value
=
true
}
else
{
isShowReview
.
value
=
false
}
// 合作状态
signLevel
.
value
=
data
.
levelInfo
;
// 签约状态
resultLevel
.
value
=
data
.
signInfo
;
};
onMounted
(()
=>
{
getAnchorSignView
()
})
</
script
>
<
template
>
<sign
v-if=
"!isShowReview"
/>
<review
v-else
/>
<sign
v-if=
"!isShowReview"
:signLevel=
"signLevel"
/>
<review
v-else
:resultLevel=
"resultLevel"
/>
</
template
>
<
style
scoped
lang=
"scss"
></
style
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment