Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b7c2d515
authored
Dec 14, 2022
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
表单bug
1 parent
f36ba6a3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
41 deletions
linkwe-pc/src/utils/index.js
linkwe-pc/src/views/drainageCode/smartForms/add.vue
linkwe-pc/src/views/drainageCode/smartForms/build/formsDetail.vue
linkwe-pc/src/views/drainageCode/smartForms/index.vue
linkwe-pc/src/utils/index.js
View file @
b7c2d51
...
...
@@ -27,10 +27,7 @@ export function dateFormat(dateString, fmt = 'yyyy-MM-dd hh:mm:ss') {
for
(
var
k
in
o
)
{
if
(
new
RegExp
(
'('
+
k
+
')'
).
test
(
fmt
))
{
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
RegExp
.
$1
.
length
==
1
||
String
(
o
[
k
]).
length
>
1
?
o
[
k
]
:
'0'
+
o
[
k
]
)
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
RegExp
.
$1
.
length
==
1
||
String
(
o
[
k
]).
length
>
1
?
o
[
k
]
:
'0'
+
o
[
k
])
}
}
...
...
@@ -66,9 +63,7 @@ export function formatTime(time, option) {
if
(
option
)
{
return
parseTime
(
time
,
option
)
}
else
{
return
(
d
.
getMonth
()
+
1
+
'月'
+
d
.
getDate
()
+
'日'
+
d
.
getHours
()
+
'时'
+
d
.
getMinutes
()
+
'分'
)
return
d
.
getMonth
()
+
1
+
'月'
+
d
.
getDate
()
+
'日'
+
d
.
getHours
()
+
'时'
+
d
.
getMinutes
()
+
'分'
}
}
...
...
@@ -172,7 +167,7 @@ export function param(json) {
Object
.
keys
(
json
).
map
((
key
)
=>
{
if
(
json
[
key
]
===
undefined
)
return
''
return
encodeURIComponent
(
key
)
+
'='
+
encodeURIComponent
(
json
[
key
])
})
})
,
).
join
(
'&'
)
}
...
...
@@ -245,8 +240,7 @@ export function toggleClass(element, className) {
if
(
nameIndex
===
-
1
)
{
classString
+=
''
+
className
}
else
{
classString
=
classString
.
substr
(
0
,
nameIndex
)
+
classString
.
substr
(
nameIndex
+
className
.
length
)
classString
=
classString
.
substr
(
0
,
nameIndex
)
+
classString
.
substr
(
nameIndex
+
className
.
length
)
}
element
.
className
=
classString
}
...
...
@@ -640,15 +634,13 @@ export async function getWechatAuthUserInfo(appId) {
let
code
=
getQueryValue
(
'code'
)
//是否存在code
// let query = param2Obj() //
// let { code, appId, secret } = query
let
local
=
window
.
location
.
origin
.
includes
(
'localhost'
)
?
'http://h5.linkwechat.cn/test.html'
:
window
.
location
.
href
let
local
=
window
.
location
.
origin
.
includes
(
'localhost'
)
?
'http://h5.linkwechat.cn/test.html'
:
window
.
location
.
href
if
(
!
code
)
{
//不存在就打开上面的地址进行授权
let
url
=
''
if
(
appId
)
{
url
=
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=
${
appId
}
&redirect_uri=
${
encodeURIComponent
(
local
local
,
)}
&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
}
else
{
url
=
(
await
getWxRedirect
()).
data
...
...
@@ -704,21 +696,24 @@ function tranDate(time) {
// 获取本机公网ip
export
function
getIP
()
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
let
script
=
document
.
createElement
(
'script'
)
script
.
setAttribute
(
'charset'
,
'utf-8'
)
script
.
setAttribute
(
'type'
,
'text/javascript'
)
script
.
setAttribute
(
'src'
,
'https://pv.sohu.com/cityjson?ie=utf-8'
)
document
.
getElementsByTagName
(
'head'
)[
0
].
appendChild
(
script
)
script
.
onload
=
function
()
{
document
.
getElementsByTagName
(
'head'
)[
0
].
removeChild
(
script
)
resolve
(
returnCitySN
[
'cip'
])
}
script
.
onerror
=
function
()
{
document
.
getElementsByTagName
(
'head'
)[
0
].
removeChild
(
script
)
reject
(
''
)
}
})
// return new Promise(function (resolve, reject) {
// let script = document.createElement('script')
// script.setAttribute('charset', 'utf-8')
// script.setAttribute('type', 'text/javascript')
// script.setAttribute('src', 'https://pv.sohu.com/cityjson?ie=utf-8')
// document.getElementsByTagName('head')[0].appendChild(script)
// script.onload = function () {
// document.getElementsByTagName('head')[0].removeChild(script)
// resolve(returnCitySN['cip'])
// }
// script.onerror = function () {
// document.getElementsByTagName('head')[0].removeChild(script)
// reject('')
// }
// })
return
axios
({
url
:
'https://api.ipify.org/?format=json'
,
}).
then
(({
data
})
=>
data
.
ip
||
Promise
.
reject
())
}
import
{
getProCityList
}
from
'@/api/common'
...
...
linkwe-pc/src/views/drainageCode/smartForms/add.vue
View file @
b7c2d51
...
...
@@ -31,7 +31,7 @@
<el-input
ref=
"msgTextarea"
type=
"textarea"
v-model=
"baseForm.
F
ormDescription"
v-model=
"baseForm.
f
ormDescription"
maxlength=
"200"
show-word-limit
placeholder=
"请填写表单说明"
...
...
@@ -43,7 +43,7 @@
<el-switch
v-model=
"ifFormLogo"
:active-value=
"1"
:inactive-value=
"0"
></el-switch>
<div
v-if=
"ifFormLogo == 1"
>
<div
class=
"sub-des"
>
开启后,表单首页或表单顶部会有logo图
</div>
<upload
:fileUrl
.
sync=
"baseForm.
F
ormLogo"
class=
"image-uploader"
@
update:file=
"handleUploadedHeadImage"
>
<upload
:fileUrl
.
sync=
"baseForm.
f
ormLogo"
class=
"image-uploader"
@
update:file=
"handleUploadedHeadImage"
>
<div
slot=
"tip"
>
建议大小2M以内,仅支持png/jpg等图片类型
</div>
</upload>
</div>
...
...
@@ -60,9 +60,9 @@
:index=
"1"
:surveyName=
"baseForm.surveyName"
:ifFormDescription=
"ifFormDescription"
:
FormDescription=
"baseForm.F
ormDescription"
:
formDescription=
"baseForm.f
ormDescription"
:ifFormLogo=
"ifFormLogo"
:logoUrl=
"baseForm.
F
ormLogo"
:logoUrl=
"baseForm.
f
ormLogo"
:FormIdY=
"formIdN"
:id=
"'y'"
></FormsDetail>
<div
style=
"display: flex; justify-content: center"
>
...
...
@@ -76,9 +76,9 @@
unionDomId=
"FormsDetail3"
:surveyName=
"baseForm.surveyName"
:ifFormDescription=
"ifFormDescription"
:
FormDescription=
"baseForm.F
ormDescription"
:
formDescription=
"baseForm.f
ormDescription"
:ifFormLogo=
"ifFormLogo"
:logoUrl=
"baseForm.
F
ormLogo"
:logoUrl=
"baseForm.
f
ormLogo"
:FormIdY=
"formIdN"
:id=
"'y'"
></FormsDetail>
<div
style=
"display: flex; justify-content: center"
>
...
...
@@ -346,8 +346,8 @@ export default {
styles
:
''
,
//表单数据
fillingRules
:
0
,
//填写规则
surveyState
:
0
,
//表单状态
F
ormDescription
:
''
,
//表单说明
F
ormLogo
:
''
,
//logo图片路径
f
ormDescription
:
''
,
//表单说明
f
ormLogo
:
''
,
//logo图片路径
tinyint
:
0
,
//是否定时收集
anAuth
:
0
,
//是否微信授权
//多渠道地址,
...
...
@@ -635,11 +635,11 @@ export default {
this
.
baseForm
.
surveyName
=
data
.
surveyName
if
(
data
.
formDescription
)
{
this
.
ifFormDescription
=
1
this
.
baseForm
.
F
ormDescription
=
data
.
formDescription
this
.
baseForm
.
f
ormDescription
=
data
.
formDescription
}
if
(
data
.
formLogo
)
{
this
.
ifFormLogo
=
1
this
.
baseForm
.
F
ormLogo
=
data
.
formLogo
this
.
baseForm
.
f
ormLogo
=
data
.
formLogo
this
.
baseForm
.
logoUrl
=
data
.
formLogo
}
this
.
pageDataAll
=
JSON
.
parse
(
data
.
styles
)
...
...
@@ -998,14 +998,14 @@ export default {
return
}
if
(
this
.
ifFormDescription
)
{
if
(
!
this
.
baseForm
.
F
ormDescription
)
{
if
(
!
this
.
baseForm
.
f
ormDescription
)
{
this
.
msgError
(
'表单说明不能为空!'
)
return
}
}
if
(
this
.
ifFormLogo
)
{
if
(
!
this
.
baseForm
.
logoUrl
)
{
this
.
baseForm
.
logoUrl
=
this
.
baseForm
.
F
ormLogo
this
.
baseForm
.
logoUrl
=
this
.
baseForm
.
f
ormLogo
}
if
(
!
this
.
baseForm
.
logoUrl
)
{
console
.
log
(
'this.baseForm'
,
this
.
baseForm
)
...
...
linkwe-pc/src/views/drainageCode/smartForms/build/formsDetail.vue
View file @
b7c2d51
This diff is collapsed.
Click to expand it.
linkwe-pc/src/views/drainageCode/smartForms/index.vue
View file @
b7c2d51
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
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 post a comment