Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
JT-WXXCX-SF
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
郑帆
JT-WXXCX-SF
Commits
a0042f5b
提交
a0042f5b
authored
1月 17, 2022
作者:
正反
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
公众号关注
上级
e5a1e965
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
108 行增加
和
5 行删除
+108
-5
launch.json
.hbuilderx/launch.json
+4
-0
index.vue
pages/index/index.vue
+102
-4
store.js
store/store.js
+2
-1
没有找到文件。
.hbuilderx/launch.json
浏览文件 @
a0042f5b
...
@@ -6,6 +6,10 @@
...
@@ -6,6 +6,10 @@
{
{
"launchtype"
:
"local"
"launchtype"
:
"local"
},
},
"h5"
:
{
"launchtype"
:
"local"
},
"mp-weixin"
:
"mp-weixin"
:
{
{
"launchtype"
:
"local"
"launchtype"
:
"local"
...
...
pages/index/index.vue
浏览文件 @
a0042f5b
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
<view
class=
"modal"
>
<view
class=
"modal"
>
<u-modal
v-model=
"loginModal"
:show-cancel-button=
"true"
:title-style=
"loginModalTitleStyle"
title=
"授权登录"
<u-modal
v-model=
"loginModal"
:show-cancel-button=
"true"
:title-style=
"loginModalTitleStyle"
title=
"授权登录"
confirm-text=
"立即登录"
cancel-text=
"暂不登录"
confirm-color=
"#7c59fc"
@
confirm=
"handleLogin"
>
confirm-text=
"立即登录"
cancel-text=
"暂不登录"
confirm-color=
"#7c59fc"
@
confirm=
"handleLogin
()
"
>
<view
class=
"slot-content"
>
<view
class=
"slot-content"
>
<view
class=
"modal-title"
>
京台服务师傅端
</view>
<view
class=
"modal-title"
>
京台服务师傅端
</view>
<view
class=
"modal-sub-title"
>
靖靖智能科技(上海)有限公司
</view>
<view
class=
"modal-sub-title"
>
靖靖智能科技(上海)有限公司
</view>
...
@@ -69,6 +69,14 @@
...
@@ -69,6 +69,14 @@
@
confirm=
"auth"
></u-modal>
@
confirm=
"auth"
></u-modal>
</view>
</view>
<view>
<u-modal
v-model=
"showModal"
:content=
"content"
confirm-text=
"了解详情"
title=
"温馨提示"
show-cancel-button=
"ture"
:title-style=
"titleStyle"
:cancel-style=
"cancelStyle"
:confirm-style=
"confirmStyle"
@
confirm=
"toHelp()"
>
<text
class=
"Modaltext"
>
您尚未关注“京台服务”公众号,无法接收订单推送通知,操作可参考帮助中心
</text>
</u-modal>
</view>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -87,6 +95,7 @@
...
@@ -87,6 +95,7 @@
onLoad
()
{
onLoad
()
{
this
.
init
()
this
.
init
()
uni
.
$u
.
mpShare
.
title
=
'页面分享'
;
uni
.
$u
.
mpShare
.
title
=
'页面分享'
;
this
.
cheackUnionID
()
},
},
onShow
()
{
onShow
()
{
let
that
=
this
let
that
=
this
...
@@ -97,18 +106,45 @@
...
@@ -97,18 +106,45 @@
// }else{
// }else{
// console.log("实名认证了,继续操作吧")
// console.log("实名认证了,继续操作吧")
// }
// }
this
.
init
()
//
this.init()
// if(this.state.initComplete == true){
// if(this.state.initComplete == true){
// this.$store.state.loading = true
// this.$store.state.loading = true
// //查询订单信息
// //查询订单信息
// this.sfview()
// this.sfview()
// }
// }
},
},
// onHide() {
// if(this.timer) {
// clearTimeout(this.timer);
// this.timer = null;
// }
// },
// onUnload() {
// if(this.timer) {
// clearTimeout(this.timer);
// this.timer = null;
// }
// },
data
()
{
data
()
{
return
{
return
{
unionid
:
''
,
timer
:
''
,
showModal
:
false
,
offset
:
[
5
,
0
],
offset
:
[
5
,
0
],
subIndex
:
''
,
subIndex
:
''
,
changeColor
:
false
,
changeColor
:
false
,
titleStyle
:
{
fontWeight
:
"bold"
},
cancelStyle
:
{
fontWeight
:
"bold"
,
color
:
"#000000"
},
confirmStyle
:
{
fontWeight
:
"bold"
,
color
:
"#000000"
},
btnStyle
:
{
btnStyle
:
{
background
:
"#7D5AFC"
,
background
:
"#7D5AFC"
,
color
:
'#FFFFFF'
color
:
'#FFFFFF'
...
@@ -190,7 +226,7 @@
...
@@ -190,7 +226,7 @@
success
(
res
)
{
success
(
res
)
{
that
.
$store
.
state
.
login
=
true
that
.
$store
.
state
.
login
=
true
that
.
$store
.
state
.
code
=
res
.
code
that
.
$store
.
state
.
code
=
res
.
code
console
.
log
(
res
)
console
.
log
(
"信息:"
,
res
)
loading
()
loading
()
Validation
(
res
.
code
).
then
((
res
)
=>
{
Validation
(
res
.
code
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
0
)
{
if
(
res
.
data
.
code
==
0
)
{
...
@@ -281,7 +317,57 @@
...
@@ -281,7 +317,57 @@
}
}
})
})
},
},
//跳转至帮助中心
toHelp
()
{
uni
.
navigateTo
({
url
:
'../help/help'
})
},
//获取unionid,判断用户是否关注公众号
cheackUnionID
()
{
let
that
=
this
wx
.
login
({
success
(
res
)
{
if
(
res
.
code
)
{
//发起网络请求
wx
.
request
({
url
:
'https://api.weixin.qq.com/sns/jscode2session'
,
data
:
{
appid
:
'wx6e2d664687c88632'
,
secret
:
'fd9f861950556225abbdcca3876576ed'
,
js_code
:
res
.
code
,
grant_type
:
'authorization_code'
},
header
:
{
'content-type'
:
'application/json'
// 默认值
},
success
(
res
)
{
console
.
log
(
"dengluxiaoxi:"
,
res
.
data
.
unionid
)
if
(
res
.
data
.
unionid
)
{
that
.
$store
.
state
.
unionid
=
res
.
data
.
unionid
that
.
unionid
=
res
.
data
.
unionid
console
.
log
(
that
.
unionid
)
}
that
.
SetTime
()
}
})
}
else
{
console
.
log
(
'登录失败!'
+
res
.
errMsg
)
}
}
})
console
.
log
(
that
.
$store
.
state
.
code
)
},
//设置定时器每30秒提醒未关注用户关注公众号
SetTime
()
{
let
that
=
this
if
(
this
.
$store
.
state
.
unionid
.
length
<
1
)
{
that
.
showModal
=
true
this
.
timer
=
setInterval
(()
=>
{
that
.
showModal
=
true
},
30000
)
}
},
//跳转至认证
//跳转至认证
auth
()
{
auth
()
{
uni
.
navigateTo
({
uni
.
navigateTo
({
...
@@ -553,4 +639,16 @@
...
@@ -553,4 +639,16 @@
background-color
:
#7D5AFC
;
background-color
:
#7D5AFC
;
color
:
#ffffff
;
color
:
#ffffff
;
}
}
.Modaltext
{
padding-left
:
25
rpx
;
padding-right
:
25
rpx
;
margin-top
:
20
rpx
;
text-align
:
center
;
vertical-align
:
middle
;
margin-bottom
:
30
rpx
;
display
:
block
;
font-size
:
33
rpx
;
color
:
#aeb2b9
;
}
</
style
>
</
style
>
store/store.js
浏览文件 @
a0042f5b
...
@@ -21,7 +21,8 @@ const store = new Vuex.Store({
...
@@ -21,7 +21,8 @@ const store = new Vuex.Store({
encryptedData
:
''
,
encryptedData
:
''
,
iv
:
''
,
iv
:
''
,
//设备信息
//设备信息
sysInfo
:
''
sysInfo
:
''
,
unionid
:
''
},
},
mutations
:
{
mutations
:
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论