Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
transport-show-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
transport-show-h5
Commits
9f017995
提交
9f017995
authored
8月 05, 2020
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:提交增加loading
上级
d6d93a5e
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
50 行增加
和
18 行删除
+50
-18
account.js
src/api/account.js
+4
-0
update.vue
src/pages/my/alarm/components/update.vue
+29
-16
index.js
src/store/index.js
+17
-2
没有找到文件。
src/api/account.js
浏览文件 @
9f017995
...
@@ -39,3 +39,7 @@ export function bindVisitor(data) {
...
@@ -39,3 +39,7 @@ export function bindVisitor(data) {
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
})
}
}
// 获取是否VIP
export
function
getIsVip
()
{
return
httpRequest
.
get
(
'/zy/user/is-vip'
)
}
src/pages/my/alarm/components/update.vue
浏览文件 @
9f017995
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
</van-checkbox-group>
</van-checkbox-group>
</div>
</div>
</div>
</div>
<van-button
type=
"primary"
@
click=
"onSubmit"
>
确定
</van-button>
<van-button
type=
"primary"
:loading=
"submitLoading"
@
click=
"onSubmit"
>
确定
</van-button>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -50,7 +50,8 @@ export default {
...
@@ -50,7 +50,8 @@ export default {
status
:
1
status
:
1
},
},
weeks
:
[
'周一'
,
'周二'
,
'周三'
,
'周四'
,
'周五'
,
'周六'
,
'周日'
],
weeks
:
[
'周一'
,
'周二'
,
'周三'
,
'周四'
,
'周五'
,
'周六'
,
'周日'
],
defaultIndex
:
13
defaultIndex
:
13
,
submitLoading
:
false
}
}
},
},
watch
:
{
watch
:
{
...
@@ -116,26 +117,38 @@ export default {
...
@@ -116,26 +117,38 @@ export default {
const
params
=
Object
.
assign
({},
this
.
ruleForm
)
const
params
=
Object
.
assign
({},
this
.
ruleForm
)
params
.
type
=
this
.
selectedResultType
params
.
type
=
this
.
selectedResultType
params
.
week_json
=
JSON
.
stringify
(
this
.
ruleForm
.
week_json
.
sort
())
params
.
week_json
=
JSON
.
stringify
(
this
.
ruleForm
.
week_json
.
sort
())
api
.
addAlarm
(
params
).
then
(
response
=>
{
this
.
submitLoading
=
true
if
(
response
.
success
)
{
api
this
.
handleSuccess
(
response
)
.
addAlarm
(
params
)
}
else
{
.
then
(
response
=>
{
this
.
$toast
(
JSON
.
stringify
(
response
.
errors
))
if
(
response
.
success
)
{
}
this
.
handleSuccess
(
response
)
})
}
else
{
this
.
$toast
(
JSON
.
stringify
(
response
.
errors
))
}
})
.
finally
(()
=>
{
this
.
submitLoading
=
false
})
},
},
// 更新
// 更新
handleUpdate
()
{
handleUpdate
()
{
const
params
=
Object
.
assign
({},
this
.
ruleForm
)
const
params
=
Object
.
assign
({},
this
.
ruleForm
)
params
.
type
=
this
.
selectedResultType
params
.
type
=
this
.
selectedResultType
params
.
week_json
=
JSON
.
stringify
(
this
.
ruleForm
.
week_json
.
sort
())
params
.
week_json
=
JSON
.
stringify
(
this
.
ruleForm
.
week_json
.
sort
())
api
.
updateAlaram
(
params
).
then
(
response
=>
{
this
.
submitLoading
=
true
if
(
response
.
success
)
{
api
this
.
handleSuccess
(
response
)
.
updateAlaram
(
params
)
}
else
{
.
then
(
response
=>
{
this
.
$toast
(
JSON
.
stringify
(
response
.
errors
))
if
(
response
.
success
)
{
}
this
.
handleSuccess
(
response
)
})
}
else
{
this
.
$toast
(
JSON
.
stringify
(
response
.
errors
))
}
})
.
finally
(()
=>
{
this
.
submitLoading
=
false
})
},
},
handleSuccess
(
response
)
{
handleSuccess
(
response
)
{
this
.
$emit
(
'success'
,
response
)
this
.
$emit
(
'success'
,
response
)
...
...
src/store/index.js
浏览文件 @
9f017995
...
@@ -2,14 +2,15 @@ import Vue from 'vue'
...
@@ -2,14 +2,15 @@ import Vue from 'vue'
import
Vuex
from
'vuex'
import
Vuex
from
'vuex'
import
Cookies
from
'js-cookie'
import
Cookies
from
'js-cookie'
import
{
getUser
,
logout
}
from
'@/api/account'
import
{
getUser
,
logout
,
getIsVip
}
from
'@/api/account'
Vue
.
use
(
Vuex
)
Vue
.
use
(
Vuex
)
export
default
new
Vuex
.
Store
({
export
default
new
Vuex
.
Store
({
state
:
{
state
:
{
isWeapp
:
/miniProgram/
.
test
(
navigator
.
userAgent
),
isWeapp
:
/miniProgram/
.
test
(
navigator
.
userAgent
),
isLogin
:
false
,
isLogin
:
false
,
token
:
''
,
token
:
''
,
user
:
{}
user
:
{},
isVip
:
false
},
},
mutations
:
{
mutations
:
{
setToken
(
state
,
token
)
{
setToken
(
state
,
token
)
{
...
@@ -23,6 +24,9 @@ export default new Vuex.Store({
...
@@ -23,6 +24,9 @@ export default new Vuex.Store({
},
},
setIsLogin
(
state
,
isLogin
)
{
setIsLogin
(
state
,
isLogin
)
{
state
.
isLogin
=
isLogin
state
.
isLogin
=
isLogin
},
setIsVip
(
state
,
isVip
)
{
state
.
isVip
=
isVip
}
}
},
},
actions
:
{
actions
:
{
...
@@ -57,6 +61,17 @@ export default new Vuex.Store({
...
@@ -57,6 +61,17 @@ export default new Vuex.Store({
commit
(
'setIsLogin'
,
false
)
commit
(
'setIsLogin'
,
false
)
return
response
return
response
})
})
},
async
checkIsVip
({
commit
})
{
const
isVip
=
await
getIsVip
()
.
then
(
response
=>
{
return
response
.
is_vip
})
.
catch
(()
=>
{
return
false
})
commit
(
'setIsVip'
,
isVip
)
return
isVip
}
}
}
}
})
})
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论