Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_54239399
hello-uniapp
提交
771f294b
H
hello-uniapp
项目概览
weixin_54239399
/
hello-uniapp
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello-uniapp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
771f294b
编写于
12月 18, 2020
作者:
inkwalk
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' for snyc for hx3.0
上级
00b5c1cc
ee159961
变更
23
展开全部
隐藏空白更改
内联
并排
Showing
23 changed file
with
975 addition
and
880 deletion
+975
-880
App.vue
App.vue
+21
-2
components/uni-badge/uni-badge.vue
components/uni-badge/uni-badge.vue
+1
-1
components/uni-card/uni-card.vue
components/uni-card/uni-card.vue
+3
-3
components/uni-combox/uni-combox.vue
components/uni-combox/uni-combox.vue
+1
-1
components/uni-data-checkbox/clientdb.js
components/uni-data-checkbox/clientdb.js
+0
-52
components/uni-data-checkbox/uni-data-checkbox.vue
components/uni-data-checkbox/uni-data-checkbox.vue
+72
-12
components/uni-datetime-picker/uni-datetime-picker.vue
components/uni-datetime-picker/uni-datetime-picker.vue
+3
-3
components/uni-easyinput/uni-easyinput.vue
components/uni-easyinput/uni-easyinput.vue
+46
-30
components/uni-field/uni-field.vue
components/uni-field/uni-field.vue
+602
-616
components/uni-forms-item/uni-forms-item.vue
components/uni-forms-item/uni-forms-item.vue
+0
-1
components/uni-indexed-list/uni-indexed-list.vue
components/uni-indexed-list/uni-indexed-list.vue
+3
-3
components/uni-list-ad/uni-list-ad.vue
components/uni-list-ad/uni-list-ad.vue
+1
-1
components/uni-list-chat/uni-list-chat.vue
components/uni-list-chat/uni-list-chat.vue
+1
-1
components/uni-list-item/uni-list-item.vue
components/uni-list-item/uni-list-item.vue
+1
-1
components/uni-swipe-action-item/uni-swipe-action-item.vue
components/uni-swipe-action-item/uni-swipe-action-item.vue
+2
-2
components/uni-title/uni-title.vue
components/uni-title/uni-title.vue
+1
-1
components/uni-tr/uni-tr.vue
components/uni-tr/uni-tr.vue
+1
-1
pages/API/get-user-info/get-user-info.vue
pages/API/get-user-info/get-user-info.vue
+41
-19
pages/API/login/login.vue
pages/API/login/login.vue
+78
-63
pages/extUI/easyinput/easyinput.vue
pages/extUI/easyinput/easyinput.vue
+19
-4
pages/extUI/forms/forms.vue
pages/extUI/forms/forms.vue
+3
-6
store/index.js
store/index.js
+67
-40
windows/top-window.vue
windows/top-window.vue
+8
-17
未找到文件。
App.vue
浏览文件 @
771f294b
<
script
>
import
{
map
State
}
from
'
vuex
'
import
{
map
Mutations
}
from
'
vuex
'
export
default
{
onLaunch
:
function
()
{
console
.
log
(
'
App Launch
'
);
...
...
@@ -28,7 +28,23 @@
}
}
})
}
}
// 一键登录预登陆,可以显著提高登录速度
uni
.
preLogin
({
provider
:
'
univerify
'
,
success
:
(
res
)
=>
{
// 成功
this
.
setUniverifyErrorMsg
();
console
.
log
(
"
preLogin success:
"
,
res
);
},
fail
:
(
res
)
=>
{
this
.
setUniverifyLogin
(
false
);
this
.
setUniverifyErrorMsg
(
res
.
errMsg
);
// 失败
console
.
log
(
"
preLogin fail res:
"
,
res
);
}
})
// #endif
},
onShow
:
function
()
{
...
...
@@ -39,6 +55,9 @@
},
globalData
:
{
test
:
''
},
methods
:{
...
mapMutations
([
'
setUniverifyErrorMsg
'
,
'
setUniverifyLogin
'
])
}
}
</
script
>
...
...
components/uni-badge/uni-badge.vue
浏览文件 @
771f294b
...
...
@@ -81,7 +81,7 @@
background-color
:
#f1f1f1
;
background-color
:
transparent
;
text-align
:
center
;
font-family
:
"Helvetica Neue"
,
Helvetica
,
sans-serif
;
font-family
:
'Helvetica Neue'
,
Helvetica
,
sans-serif
;
font-size
:
12px
;
padding
:
0px
6px
;
}
...
...
components/uni-card/uni-card.vue
浏览文件 @
771f294b
...
...
@@ -136,7 +136,7 @@
/* #ifndef APP-NVUE */
.uni-border
:after
{
content
:
""
;
content
:
''
;
position
:
absolute
;
bottom
:
0
;
left
:
0
;
...
...
@@ -165,7 +165,7 @@
/* #ifndef APP-NVUE */
.uni-border-bottom
:after
{
content
:
""
;
content
:
''
;
position
:
absolute
;
bottom
:
0
;
left
:
0
;
...
...
@@ -193,7 +193,7 @@
/* #ifndef APP-NVUE */
.uni-border-top
:after
{
content
:
""
;
content
:
''
;
position
:
absolute
;
bottom
:
0
;
left
:
0
;
...
...
components/uni-combox/uni-combox.vue
浏览文件 @
771f294b
...
...
@@ -180,7 +180,7 @@
}
.uni-combox__selector
::before
{
content
:
""
;
content
:
''
;
position
:
absolute
;
width
:
0
;
height
:
0
;
...
...
components/uni-data-checkbox/clientdb.js
浏览文件 @
771f294b
...
...
@@ -20,58 +20,6 @@ const attrs = [
]
export
default
{
props
:
{
options
:
{
type
:
[
Object
,
Array
],
default
()
{
return
{}
}
},
collection
:
{
type
:
String
,
default
:
''
},
action
:
{
type
:
String
,
default
:
''
},
field
:
{
type
:
String
,
default
:
''
},
pageData
:
{
type
:
String
,
default
:
'
add
'
},
pageCurrent
:
{
type
:
Number
,
default
:
1
},
pageSize
:
{
type
:
Number
,
default
:
20
},
getcount
:
{
type
:
[
Boolean
,
String
],
default
:
false
},
orderby
:
{
type
:
String
,
default
:
''
},
where
:
{
type
:
[
String
,
Object
],
default
:
''
},
getone
:
{
type
:
[
Boolean
,
String
],
default
:
false
},
manual
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
return
{
loading
:
false
,
...
...
components/uni-data-checkbox/uni-data-checkbox.vue
浏览文件 @
771f294b
...
...
@@ -8,7 +8,7 @@
<
template
v-else
>
<checkbox-group
v-if=
"multiple"
class=
"checklist-group"
:class=
"
{'is-list':mode==='list','is-wrap':wrap}" @change="chagne">
<label
class=
"checklist-box"
:class=
"item.labelClass"
:style=
"[item.styleBackgroud]"
v-for=
"(item,index) in dataList"
:key=
"index"
>
<checkbox
hidden
:disabled=
"!!item.disable
"
:value=
"item.value+''"
:checked=
"item.selected"
/>
<checkbox
class=
"hidden"
hidden
:disabled=
"!!item.disabled
"
:value=
"item.value+''"
:checked=
"item.selected"
/>
<view
v-if=
"(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')"
class=
"checkbox__inner"
:class=
"item.checkboxBgClass"
:style=
"[item.styleIcon]"
>
<view
class=
"checkbox__inner-icon"
:class=
"item.checkboxClass"
></view>
</view>
...
...
@@ -20,7 +20,7 @@
</checkbox-group>
<radio-group
v-else
class=
"checklist-group"
:class=
"
{'is-list':mode==='list','is-wrap':wrap}" @change="chagne">
<label
class=
"checklist-box"
:class=
"item.labelClass"
:style=
"[item.styleBackgroud]"
v-for=
"(item,index) in dataList"
:key=
"index"
>
<radio
hidden
:disabled=
"item.disable"
:value=
"item.value+''"
:checked=
"item.selected"
/>
<radio
hidden
:disabled=
"item.disable
d
"
:value=
"item.value+''"
:checked=
"item.selected"
/>
<view
v-if=
"(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')"
class=
"radio__inner"
:class=
"item.checkboxBgClass"
:style=
"[item.styleBackgroud]"
>
<view
class=
"radio__inner-icon"
:class=
"item.checkboxClass"
:style=
"[item.styleIcon]"
></view>
</view>
...
...
@@ -106,11 +106,63 @@
selectedTextColor
:
{
type
:
String
,
default
:
''
},
// clientDB 相关
options
:
{
type
:
[
Object
,
Array
],
default
()
{
return
{}
}
},
collection
:
{
type
:
String
,
default
:
''
},
action
:
{
type
:
String
,
default
:
''
},
field
:
{
type
:
String
,
default
:
''
},
pageData
:
{
type
:
String
,
default
:
'
add
'
},
pageCurrent
:
{
type
:
Number
,
default
:
1
},
pageSize
:
{
type
:
Number
,
default
:
20
},
getcount
:
{
type
:
[
Boolean
,
String
],
default
:
false
},
orderby
:
{
type
:
String
,
default
:
''
},
where
:
{
type
:
[
String
,
Object
],
default
:
''
},
getone
:
{
type
:
[
Boolean
,
String
],
default
:
false
},
manual
:
{
type
:
Boolean
,
default
:
false
}
},
watch
:
{
localdata
:
{
handler
(
newVal
)
{
this
.
range
=
newVal
this
.
dataList
=
this
.
getDataList
(
this
.
getSelectedValue
(
newVal
))
},
deep
:
true
...
...
@@ -119,7 +171,6 @@
listData
(
newVal
)
{
this
.
range
=
newVal
this
.
dataList
=
this
.
getDataList
(
this
.
getSelectedValue
(
newVal
))
// console.log('----listData', this.dataList);
},
value
(
newVal
)
{
this
.
dataList
=
this
.
getDataList
(
newVal
)
...
...
@@ -223,7 +274,7 @@
let
classes
=
[]
switch
(
this
.
mode
)
{
case
'
default
'
:
item
.
disable
&&
classes
.
push
(
'
disabled-cursor
'
)
item
.
disable
d
&&
classes
.
push
(
'
disabled-cursor
'
)
break
case
'
button
'
:
classes
.
push
(...[
'
is-button
'
,
...
this
.
getClasses
(
item
,
'
button
'
)])
...
...
@@ -234,7 +285,7 @@
}
else
{
classes
.
push
(
'
is-list-box
'
)
}
item
.
disable
&&
classes
.
push
(
'
is-list-disabled
'
)
item
.
disable
d
&&
classes
.
push
(
'
is-list-disabled
'
)
index
!==
0
&&
classes
.
push
(
'
is-list-border
'
)
break
case
'
tag
'
:
...
...
@@ -289,6 +340,7 @@
}
}
dataList
.
forEach
((
item
,
index
)
=>
{
item
.
disabled
=
item
.
disable
||
item
.
disabled
||
false
if
(
this
.
multiple
)
{
if
(
value
.
length
>
0
)
{
let
have
=
value
.
find
(
val
=>
val
===
item
.
value
)
...
...
@@ -317,14 +369,14 @@
if
(
selectList
.
length
<=
min
)
{
let
have
=
selectList
.
find
(
val
=>
val
.
value
===
item
.
value
)
if
(
have
!==
undefined
)
{
item
.
disable
=
true
item
.
disable
d
=
true
}
}
if
(
selectList
.
length
>=
max
&&
max
!==
''
)
{
let
have
=
selectList
.
find
(
val
=>
val
.
value
===
item
.
value
)
if
(
have
===
undefined
)
{
item
.
disable
=
true
item
.
disable
d
=
true
}
}
}
...
...
@@ -361,11 +413,11 @@
*/
getClasses
(
item
,
name
,
type
=
''
)
{
let
classes
=
[]
item
.
disable
&&
classes
.
push
(
'
is-
'
+
name
+
'
-disabled
'
+
type
)
item
.
disable
d
&&
classes
.
push
(
'
is-
'
+
name
+
'
-disabled
'
+
type
)
item
.
selected
&&
classes
.
push
(
'
is-
'
+
name
+
'
-checked
'
+
type
)
if
(
this
.
mode
!==
'
button
'
||
name
===
'
button
'
)
{
item
.
selected
&&
item
.
disable
&&
classes
.
push
(
'
is-
'
+
name
+
'
-disabled-checked
'
+
type
)
item
.
selected
&&
item
.
disable
d
&&
classes
.
push
(
'
is-
'
+
name
+
'
-disabled-checked
'
+
type
)
}
return
classes
...
...
@@ -443,6 +495,8 @@
@charset
"UTF-8"
;
.uni-data-checklist
{
position
:
relative
;
z-index
:
0
;
/* min-height: 36px; */
}
...
...
@@ -564,7 +618,7 @@
top
:
1px
;
width
:
3px
;
opacity
:
0
;
transition
:
transform
0
.2s
;
transition
:
transform
.2s
;
transform-origin
:
center
;
transform
:
rotate
(
40deg
)
scaleY
(
0.4
);
}
...
...
@@ -585,7 +639,7 @@
border-radius
:
16px
;
background-color
:
#fff
;
z-index
:
1
;
transition
:
border-color
0
.3s
;
transition
:
border-color
.3s
;
}
.radio__inner-icon
{
...
...
@@ -593,7 +647,7 @@
height
:
8px
;
border-radius
:
10px
;
opacity
:
0
;
transition
:
transform
0
.3s
;
transition
:
transform
.3s
;
}
.checkobx__list
{
...
...
@@ -758,4 +812,10 @@
.is-wrap
{
flex-direction
:
column
;
}
.hidden
{
/* #ifdef MP-ALIPAY */
display
:
none
;
/* #endif */
}
</
style
>
\ No newline at end of file
components/uni-datetime-picker/uni-datetime-picker.vue
浏览文件 @
771f294b
...
...
@@ -304,14 +304,14 @@
}
.uni-datetime-picker-colon
::after
{
content
:
":"
;
content
:
':'
;
position
:
absolute
;
top
:
53px
;
right
:
0
;
}
.uni-datetime-picker-hyphen
::after
{
content
:
"-"
;
content
:
'-'
;
position
:
absolute
;
top
:
53px
;
right
:
-2px
;
...
...
@@ -342,7 +342,7 @@
border-style
:
solid
;
transform
:
matrix
(
0.71
,
0.71
,
-0.71
,
0.71
,
0
,
0
);
transform-origin
:
center
;
transition
:
transform
0
.3s
;
transition
:
transform
.3s
;
position
:
absolute
;
top
:
50%
;
right
:
5px
;
...
...
components/uni-easyinput/uni-easyinput.vue
浏览文件 @
771f294b
<
template
>
<view
class=
"uni-easyinput"
:class=
"
{'uni-easyinput-error':msg}">
<view
class=
"uni-easyinput__content"
:class=
"
{'is-input-border':inputBorder ,'is-input-error-border':inputBorder
&&
msg,'is-textarea':type==='textarea','is-disabled':disabled}">
<uni-icons
v-if=
"prefixIcon"
class=
"content-clear-icon"
:type=
"prefixIcon"
color=
"#c0c4cc"
></uni-icons>
<view
class=
"uni-easyinput"
:class=
"
{'uni-easyinput-error':msg}"
:style="{color:inputBorder
&&
msg?'#dd524d':styles.color}"
>
<view
class=
"uni-easyinput__content"
:class=
"
{'is-input-border':inputBorder ,'is-input-error-border':inputBorder
&&
msg,'is-textarea':type==='textarea','is-disabled':disabled}"
:style="{'border-color':inputBorder
&&
msg?'#dd524d':styles.borderColor,'background-color':disabled?styles.disableColor:'#fff'}"
>
<uni-icons
v-if=
"prefixIcon"
class=
"content-clear-icon"
:type=
"prefixIcon"
color=
"#c0c4cc"
@
click=
"onClickIcon('prefix')"
></uni-icons>
<textarea
v-if=
"type === 'textarea'"
class=
"uni-easyinput__content-textarea"
:class=
"
{'input-padding':inputBorder}" :name="name" :value="val" :placeholder="placeholder" :placeholderStyle="placeholderStyle" :disabled="disabled" :maxlength="inputMaxlength" :focus="focused" :autoHeight="autoHeight" @input="onInput" @blur="onBlur" @focus="onFocus" @confirm="onConfirm">
</textarea>
<input
v-else
:type=
"type === 'password'?'text':type"
class=
"uni-easyinput__content-input"
:style=
"
{
'padding-right':type === 'password' ||clearable || prefixIcon?'':'10px',
'padding-left':prefixIcon?'':'10px',
'color':msg?'#dd524d':''
'padding-left':prefixIcon?'':'10px'
}" :name="name" :value="val" :password="!showPassword
&&
type === 'password'" :placeholder="placeholder" :placeholderStyle="placeholderStyle" :disabled="disabled" :maxlength="inputMaxlength" :focus="focused" @focus="onFocus" @blur="onBlur" @input="onInput" @confirm="onConfirm" />
<template
v-if=
"type === 'password'"
>
<uni-icons
v-if=
"val != '' "
class=
"content-clear-icon"
:class=
"
{'is-textarea-icon':type==='textarea'}" :type="showPassword?'eye-slash-filled':'eye-filled'" :size="18" color="#c0c4cc" @click="onEyes">
</uni-icons>
</
template
>
<
template
v-else-if=
"suffixIcon"
>
<uni-icons
v-if=
"suffixIcon"
class=
"content-clear-icon"
:type=
"suffixIcon"
color=
"#c0c4cc"
></uni-icons>
<uni-icons
v-if=
"suffixIcon"
class=
"content-clear-icon"
:type=
"suffixIcon"
color=
"#c0c4cc"
@
click=
"onClickIcon('suffix')"
></uni-icons>
</
template
>
<
template
v-else
>
<uni-icons
class=
"content-clear-icon"
:class=
"
{'is-textarea-icon':type==='textarea'}" type="clear" :size="clearSize" v-if="clearable
&&
focused
&&
val " color="#c0c4cc" @click="onClear">
</uni-icons>
...
...
@@ -26,31 +25,33 @@
* Field 输入框
* @description 此组件可以实现表单的输入与校验,包括 "text" 和 "textarea" 类型。
* @tutorial https://ext.dcloud.net.cn/plugin?id=21001
* @property {String| Number} value
输入内容
* @property {String } type 输入框的类型(默认text) password/text/textarea/..
*
@value text
文本输入键盘
* @value textarea 多行文本输入键盘
* @value password 密码输入键盘
*
@value number
数字输入键盘,注意iOS上app-vue弹出的数字键盘并非9宫格方式
*
@value idcard
身份证输入键盘,信、支付宝、百度、QQ小程序
*
@value digit
带小数点的数字键盘 ,App的nvue页面、微信、支付宝、百度、头条、QQ小程序支持
* @property {Boolean} clearable 是否显示右侧清空内容的图标控件(输入框有内容,且获得焦点时才显示),点击可清空输入框内容(默认true)
* @property {Boolean} autoHeight 是否自动增高输入区域,type为textarea时有效(默认true)
* @property {String } placeholder 输入框的提示文字
* @property {String| Number} value 输入内容
* @property {String } type
输入框的类型(默认text) password/text/textarea/..
*
@value text
文本输入键盘
*
@value textarea 多行文本输入键盘
*
@value password 密码输入键盘
*
@value number
数字输入键盘,注意iOS上app-vue弹出的数字键盘并非9宫格方式
*
@value idcard
身份证输入键盘,信、支付宝、百度、QQ小程序
*
@value digit
带小数点的数字键盘 ,App的nvue页面、微信、支付宝、百度、头条、QQ小程序支持
* @property {Boolean} clearable
是否显示右侧清空内容的图标控件(输入框有内容,且获得焦点时才显示),点击可清空输入框内容(默认true)
* @property {Boolean} autoHeight
是否自动增高输入区域,type为textarea时有效(默认true)
* @property {String } placeholder
输入框的提示文字
* @property {String } placeholderStyle placeholder的样式(内联样式,字符串),如"color: #ddd"
* @property {Boolean} focus 是否自动获得焦点(默认false)
* @property {Boolean} disabled 是否不可输入(默认false)
* @property {Number } maxlength 最大输入长度,设置为 -1 的时候不限制最大长度(默认140)
* @property {String } confirmType 设置键盘右下角按钮的文字,仅在type="text"时生效(默认done)
* @property {Number } clearSize 清除图标的大小,单位px(默认15)
* @property {String} prefixIcon 输入框头部图标
* @property {String} suffixIcon 输入框尾部图标
* @property {Boolean} trim 是否自动去除两端的空格
* @property {Boolean} inputBorder 是否显示input输入框的边框(默认false)
* @event {Function} input 输入框内容发生变化时触发
* @event {Function} focus 输入框获得焦点时触发
* @event {Function} blur 输入框失去焦点时触发
* @event {Function} confirm 点击完成按钮时触发
* @property {Boolean} focus 是否自动获得焦点(默认false)
* @property {Boolean} disabled 是否不可输入(默认false)
* @property {Number } maxlength 最大输入长度,设置为 -1 的时候不限制最大长度(默认140)
* @property {String } confirmType 设置键盘右下角按钮的文字,仅在type="text"时生效(默认done)
* @property {Number } clearSize 清除图标的大小,单位px(默认15)
* @property {String} prefixIcon 输入框头部图标
* @property {String} suffixIcon 输入框尾部图标
* @property {Boolean} trim 是否自动去除两端的空格
* @property {Boolean} inputBorder 是否显示input输入框的边框(默认false)
* @property {Object} styles 自定义颜色
* @event {Function} input 输入框内容发生变化时触发
* @event {Function} focus 输入框获得焦点时触发
* @event {Function} blur 输入框失去焦点时触发
* @event {Function} confirm 点击完成按钮时触发
* @event {Function} iconClick 点击图标时触发
* @example <uni-easyinput v-model="mobile"></uni-easyinput>
*/
...
...
@@ -116,6 +117,17 @@
trim
:
{
type
:
Boolean
,
default
:
true
},
// 自定义样式
styles
:
{
type
:
Object
,
default
()
{
return
{
color
:
'
#333
'
,
disableColor
:
'
#eee
'
,
borderColor
:
'
#e5e5e5
'
}
}
}
},
data
()
{
...
...
@@ -141,6 +153,7 @@
},
watch
:
{
value
(
newVal
)
{
if
(
this
.
errMsg
)
this
.
errMsg
=
''
this
.
val
=
newVal
if
(
this
.
formItem
)
{
this
.
formItem
.
setValue
(
newVal
)
...
...
@@ -176,6 +189,9 @@
*/
init
()
{
},
onClickIcon
(
type
)
{
this
.
$emit
(
'
iconClick
'
,
type
)
},
/**
* 获取父元素实例
...
...
components/uni-field/uni-field.vue
浏览文件 @
771f294b
此差异已折叠。
点击以展开。
components/uni-forms-item/uni-forms-item.vue
浏览文件 @
771f294b
...
...
@@ -179,7 +179,6 @@
this
.
labelPos
=
this
.
labelPosition
?
this
.
labelPosition
:
labelPosition
this
.
labelWid
=
this
.
label
?
(
this
.
labelWidth
?
this
.
labelWidth
:
labelWidth
)
:
0
this
.
labelAli
=
this
.
labelAlign
?
this
.
labelAlign
:
labelAlign
console
.
log
(
this
.
labelWid
);
// 判断第一个 item
if
(
!
this
.
form
.
isFirstBorder
)
{
this
.
form
.
isFirstBorder
=
true
...
...
components/uni-indexed-list/uni-indexed-list.vue
浏览文件 @
771f294b
...
...
@@ -8,7 +8,7 @@
<scroll-view
:scroll-into-view=
"scrollViewId"
class=
"uni-indexed-list__scroll"
scroll-y
>
<view
v-for=
"(list, idx) in lists"
:key=
"idx"
:id=
"'uni-indexed-list-' + idx"
>
<!-- #endif -->
<
uni-indexed-list-item
:list=
"list"
:loaded=
"loaded"
:idx=
"idx"
:showSelect=
"showSelect"
@
itemClick=
"onClick"
></uni-
indexed-list-item>
<
indexed-list-item
:list=
"list"
:loaded=
"loaded"
:idx=
"idx"
:showSelect=
"showSelect"
@
itemClick=
"onClick"
></
indexed-list-item>
<!-- #ifndef APP-NVUE -->
</view>
</scroll-view>
...
...
@@ -29,7 +29,7 @@
</
template
>
<
script
>
import
uniIcons
from
'
../uni-icons/uni-icons.vue
'
import
uniI
ndexedListItem
from
'
./uni-indexed-list-item.vue
'
import
i
ndexedListItem
from
'
./uni-indexed-list-item.vue
'
// #ifdef APP-NVUE
const
dom
=
weex
.
requireModule
(
'
dom
'
);
// #endif
...
...
@@ -85,7 +85,7 @@
name
:
'
UniIndexedList
'
,
components
:
{
uniIcons
,
uniI
ndexedListItem
i
ndexedListItem
},
props
:
{
options
:
{
...
...
components/uni-list-ad/uni-list-ad.vue
浏览文件 @
771f294b
...
...
@@ -92,7 +92,7 @@
right
:
0
;
left
:
0
;
height
:
1px
;
content
:
""
;
content
:
''
;
-webkit-transform
:
scaleY
(
0.5
);
transform
:
scaleY
(
0.5
);
background-color
:
#e5e5e5
;
...
...
components/uni-list-chat/uni-list-chat.vue
浏览文件 @
771f294b
...
...
@@ -244,7 +244,7 @@
right
:
0
;
left
:
0
;
height
:
1px
;
content
:
""
;
content
:
''
;
-webkit-transform
:
scaleY
(
0.5
);
transform
:
scaleY
(
0.5
);
background-color
:
#e5e5e5
;
...
...
components/uni-list-item/uni-list-item.vue
浏览文件 @
771f294b
...
...
@@ -294,7 +294,7 @@
right
:
0
;
left
:
0
;
height
:
1px
;
content
:
""
;
content
:
''
;
-webkit-transform
:
scaleY
(
0.5
);
transform
:
scaleY
(
0.5
);
background-color
:
#e5e5e5
;
...
...
components/uni-swipe-action-item/uni-swipe-action-item.vue
浏览文件 @
771f294b
...
...
@@ -247,8 +247,8 @@
}
/* .transition {
transition: all 0.3s;
} */
transition: all 0.3s;
} */
.movable-view-box
{
flex-shrink
:
0
;
height
:
100%
;
...
...
components/uni-title/uni-title.vue
浏览文件 @
771f294b
...
...
@@ -117,7 +117,7 @@
<
style
scoped
>
/* .uni-title {
} */
} */
.uni-title__box
{
/* #ifndef APP-NVUE */
display
:
flex
;
...
...
components/uni-tr/uni-tr.vue
浏览文件 @
771f294b
...
...
@@ -77,7 +77,7 @@
<
style
scoped
>
.uni-table-tr
{
display
:
table-row
;
transition
:
all
0
.3s
;
transition
:
all
.3s
;
box-sizing
:
border-box
;
}
...
...
pages/API/get-user-info/get-user-info.vue
浏览文件 @
771f294b
...
...
@@ -5,19 +5,19 @@
<view
style=
"background:#FFF; padding:40rpx;"
>
<block
v-if=
"hasUserInfo === false"
>
<view
class=
"uni-hello-text uni-center"
>
<text>
请点击下方按钮获取用户头像及昵称
</text>
<text>
请点击下方按钮获取用户头像及昵称
或手机号
</text>
</view>
</block>
<block
v-if=
"hasUserInfo === true"
>
<view
class=
"uni-h4 uni-center uni-common-mt"
>
{{
userInfo
.
nickName
||
userInfo
.
email
}}
</view>
<view
style=
"padding:30rpx 0; text-align:center;"
>
<view
class=
"uni-h4 uni-center uni-common-mt"
>
{{
userInfo
.
nickName
||
userInfo
.
email
||
userInfo
.
phoneNumber
}}
</view>
<view
v-if=
"userInfo.avatarUrl"
style=
"padding:30rpx 0; text-align:center;"
>
<image
class=
"userinfo-avatar"
:src=
"userInfo.avatarUrl"
></image>
</view>
</block>
</view>
<view
class=
"uni-btn-v"
>
<!-- #ifdef APP-PLUS || MP-ALIPAY || MP-TOUTIAO -->
<button
type=
"primary"
@
click=
"getUserInfo"
>
获取用户信息
</button>
<button
type=
"primary"
:loading=
"btnLoading"
@
click=
"getUserInfo"
>
获取用户信息
</button>
<!-- #endif -->
<!-- #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ -->
<button
type=
"primary"
open-type=
"getUserInfo"
@
getuserinfo=
"mpGetUserInfo"
>
获取用户信息
</button>
...
...
@@ -30,7 +30,8 @@
<
script
>
import
{
mapState
,
mapMutations
mapMutations
,
mapActions
}
from
'
vuex
'
export
default
{
...
...
@@ -38,21 +39,39 @@
return
{
title
:
'
getUserInfo
'
,
hasUserInfo
:
false
,
userInfo
:
{}
userInfo
:
{},
btnLoading
:
false
}
},
computed
:
{
...
mapState
({
loginProvider
:
state
=>
state
.
loginProvider
})
...
mapState
([
'
loginProvider
'
,
'
isUniverifyLogin
'
])
},
methods
:
{
...
mapActions
([
'
getPhoneNumber
'
]),
// 获取用户信息 API 在小程序可直接使用,在 5+App 里面需要先登录才能调用
getUserInfo
()
{
this
.
btnLoading
=
true
;
if
(
this
.
isUniverifyLogin
)
{
// 一键登录
this
.
getPhoneNumber
(
uni
.
getStorageSync
(
'
univerifyInfo
'
)).
then
(
phoneNumber
=>
{
this
.
hasUserInfo
=
true
;
this
.
userInfo
=
{
phoneNumber
};
}).
catch
(
err
=>
{
console
.
error
(
'
getUserInfo fail:
'
,
err
);
this
.
hasUserInfo
=
false
;
}).
finally
(()
=>
{
this
.
btnLoading
=
false
;
})
return
;
}
uni
.
getUserInfo
({
provider
:
this
.
loginProvider
,
success
:
(
result
)
=>
{
console
.
log
(
'
getUserInfo success
'
,
result
);
this
.
hasUserInfo
=
true
;
this
.
userInfo
=
result
.
userInfo
;
},
...
...
@@ -62,7 +81,7 @@
if
(
~
content
.
indexOf
(
'
uni.login
'
))
{
content
=
'
请在登录页面完成登录操作
'
;
}
// #ifndef APP-PLUS
// #ifndef APP-PLUS
uni
.
getSetting
({
success
:
(
res
)
=>
{
let
authStatus
=
res
.
authSetting
[
'
scope.userInfo
'
];
...
...
@@ -85,14 +104,17 @@
}
}
})
// #endif
// #ifdef APP-PLUS
uni
.
showModal
({
title
:
'
获取用户信息失败
'
,
content
:
'
错误原因
'
+
content
,
showCancel
:
false
});
// #endif
// #endif
// #ifdef APP-PLUS
uni
.
showModal
({
title
:
'
获取用户信息失败
'
,
content
:
'
错误原因
'
+
content
,
showCancel
:
false
});
// #endif
},
complete
:
()
=>
{
this
.
btnLoading
=
false
;
}
});
},
...
...
pages/API/login/login.vue
浏览文件 @
771f294b
...
...
@@ -28,8 +28,8 @@
</button>
<!-- #endif -->
<!-- #ifndef MP-TOUTIAO -->
<button
type=
"primary"
class=
"page-body-button"
v-for=
"(value,key) in providerList"
:disabled=
"value.id === 'univerify' ? univerifyBtnDisabled : false
"
@
click=
"tologin(value)
"
:key=
"key"
>
{{
value
.
name
}}
</button>
<button
type=
"primary"
class=
"page-body-button"
v-for=
"(value,key) in providerList"
@
click=
"tologin(value)
"
:loading=
"value.id === 'univerify' ? univerifyBtnLoading : false
"
:key=
"key"
>
{{
value
.
name
}}
</button>
<!-- #endif -->
</view>
</view>
...
...
@@ -38,7 +38,8 @@
<
script
>
import
{
mapState
,
mapMutations
mapMutations
,
mapActions
}
from
'
vuex
'
const
univerifyInfoKey
=
'
univerifyInfo
'
;
...
...
@@ -48,11 +49,11 @@
title
:
'
login
'
,
providerList
:
[],
phoneNumber
:
''
,
univerifyBtn
Disabled
:
tru
e
univerifyBtn
Loading
:
fals
e
}
},
computed
:
{
...
mapState
([
'
hasLogin
'
,
'
isUniverifyLogin
'
])
...
mapState
([
'
hasLogin
'
,
'
isUniverifyLogin
'
,
'
univerifyErrorMsg
'
])
},
onLoad
()
{
uni
.
getProvider
({
...
...
@@ -86,22 +87,6 @@
providerName
=
'
苹果登录
'
break
;
case
'
univerify
'
:
uni
.
preLogin
({
provider
:
value
,
success
:
(
res
)
=>
{
// 成功
console
.
log
(
"
preLogin success:
"
,
res
);
this
.
univerifyBtnDisabled
=
false
;
},
fail
:
(
res
)
=>
{
// 失败
console
.
log
(
"
preLogin fail:
"
,
res
);
// 失败
console
.
log
(
"
preLogin fail:
"
,
res
.
errCode
)
console
.
log
(
"
preLogin fail:
"
,
res
.
errMsg
)
this
.
setUniverifyLogin
(
false
);
}
})
providerName
=
'
一键登录
'
break
;
}
...
...
@@ -117,25 +102,26 @@
}
});
uni
.
onAuthViewOtherLoginButtonClick
(()
=>
{
uni
.
closeAuthView
();
this
.
Toast
({
title
:
'
其他登录方式
'
})
})
if
(
this
.
hasLogin
&&
this
.
isUniverifyLogin
)
{
this
.
getPhoneNumber
(
uni
.
getStorageSync
(
univerifyInfoKey
))
this
.
getPhoneNumber
(
uni
.
getStorageSync
(
univerifyInfoKey
)).
then
((
phoneNumber
)
=>
{
this
.
phoneNumber
=
phoneNumber
})
}
},
methods
:
{
...
mapMutations
([
'
login
'
,
'
setUniverifyLogin
'
]),
...
mapActions
([
'
getPhoneNumber
'
]),
Toast
(
data
,
duration
=
1000
)
{
uni
.
showToast
(
Object
.
assign
({},
data
,
{
duration
}))
},
tologin
(
provider
)
{
if
(
provider
.
id
===
'
univerify
'
)
{
this
.
univerifyBtnLoading
=
true
;
}
// 一键登录已在APP onLaunch的时候进行了预登陆,可以显著提高登录速度。登录成功后,预登陆状态会重置
uni
.
login
({
provider
:
provider
.
id
,
// #ifdef MP-ALIPAY
...
...
@@ -143,29 +129,38 @@
// #endif
success
:
(
res
)
=>
{
console
.
log
(
'
login success:
'
,
res
);
this
.
Toast
({
title
:
'
登录成功
'
})
// 更新保存在 store 中的登录状态
this
.
login
(
provider
.
id
);
// #ifdef APP-PLUS
if
(
provider
.
id
===
'
univerify
'
)
{
this
.
setUniverifyLogin
(
true
);
uni
.
closeAuthView
();
const
{
access_token
,
openid
}
=
res
.
authResult
// 注意大小写
const
univerifyInfo
=
{
provider
:
provider
.
id
,
accessToken
:
access_token
,
openid
...
res
.
authResult
,
}
this
.
getPhoneNumber
(
univerifyInfo
);
this
.
getPhoneNumber
(
univerifyInfo
).
then
((
phoneNumber
)
=>
{
this
.
phoneNumber
=
phoneNumber
;
uni
.
setStorageSync
(
univerifyInfoKey
,
univerifyInfo
)
}).
catch
(
err
=>
{
uni
.
showModal
({
showCancel
:
false
,
title
:
'
手机号获取失败
'
,
content
:
`
${
err
.
errMsg
}
\n,错误码:
${
err
.
code
}
`
})
console
.
error
(
res
);
})
}
else
{
this
.
setUniverifyLogin
(
false
);
}
// #endif
// #ifdef MP-WEIXIN
console
.
warn
(
'
如需获取openid请参考uni-id: https://uniapp.dcloud.net.cn/uniCloud/uni-id
'
)
uni
.
request
({
...
...
@@ -194,37 +189,57 @@
},
fail
:
(
err
)
=>
{
console
.
log
(
'
login fail:
'
,
err
);
}
});
},
getPhoneNumber
(
univerifyInfo
)
{
uni
.
request
({
url
:
'
https://97fca9f2-41f6-449f-a35e-3f135d4c3875.bspapp.com/http/univerify-login
'
,
method
:
'
POST
'
,
data
:
univerifyInfo
,
success
:
(
res
)
=>
{
console
.
log
(
res
);
const
{
data
}
=
res
;
if
(
data
.
success
)
{
this
.
phoneNumber
=
data
.
phoneNumber
;
uni
.
setStorageSync
(
univerifyInfoKey
,
univerifyInfo
)
}
else
{
// 一键登录点击其他登录方式
if
(
err
.
code
==
'
30002
'
)
{
uni
.
closeAuthView
();
this
.
Toast
({
icon
:
'
none
'
,
title
:
`手机号获取失败`
title
:
'
其他登录方式
'
})
console
.
error
(
res
);
return
;
}
// 未开通
if
(
err
.
code
==
1000
)
{
uni
.
showModal
({
title
:
'
登录失败
'
,
content
:
`
${
err
.
errMsg
}
\n,错误码:
${
err
.
code
}
`
,
confirmText
:
'
开通指南
'
,
cancelText
:
'
确定
'
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
setTimeout
(()
=>
{
plus
.
runtime
.
openWeb
(
'
https://ask.dcloud.net.cn/article/37965
'
)
},
500
)
}
}
});
return
;
}
// 一键登录预登陆失败
if
(
err
.
code
==
'
30005
'
)
{
uni
.
showModal
({
showCancel
:
false
,
title
:
'
预登录失败
'
,
content
:
this
.
univerifyErrorMsg
||
err
.
errMsg
});
return
;
}
// 一键登录用户关闭验证界面
if
(
err
.
code
!=
'
30003
'
)
{
uni
.
showModal
({
showCancel
:
false
,
title
:
'
登录失败
'
,
content
:
JSON
.
stringify
(
err
)
});
}
},
fail
:
(
err
)
=>
{
this
.
Toast
({
title
:
'
一键登录失败
'
})
complete
:
()
=>
{
this
.
univerifyBtnLoading
=
false
;
}
})
})
;
}
}
}
...
...
pages/extUI/easyinput/easyinput.vue
浏览文件 @
771f294b
...
...
@@ -5,17 +5,21 @@
<view
class=
"example"
>
<uni-easyinput
v-model=
"value"
focus
placeholder=
"请输入内容"
@
input=
"input"
></uni-easyinput>
</view>
<uni-section
title=
"自定义样式"
type=
"line"
></uni-section>
<view
class=
"example"
>
<uni-easyinput
v-model=
"value"
:styles=
"styles"
:placeholderStyle=
"placeholderStyle"
focus
placeholder=
"请输入内容"
@
input=
"input"
></uni-easyinput>
</view>
<uni-section
title=
"左图标"
type=
"line"
></uni-section>
<view
class=
"example"
>
<uni-easyinput
prefixIcon=
"search"
v-model=
"value"
placeholder=
"请输入内容"
></uni-easyinput>
<uni-easyinput
prefixIcon=
"search"
v-model=
"value"
placeholder=
"请输入内容"
@
iconClick=
"iconClick"
></uni-easyinput>
</view>
<uni-section
title=
"右图标"
type=
"line"
></uni-section>
<view
class=
"example"
>
<uni-easyinput
suffixIcon=
"search"
v-model=
"value"
placeholder=
"请输入内容"
></uni-easyinput>
<uni-easyinput
suffixIcon=
"search"
v-model=
"value"
placeholder=
"请输入内容"
@
iconClick=
"iconClick"
></uni-easyinput>
</view>
<uni-section
title=
"禁用"
type=
"line"
></uni-section>
<view
class=
"example"
>
<uni-easyinput
disabled
v
-model=
"value
"
placeholder=
"请输入内容"
></uni-easyinput>
<uni-easyinput
disabled
v
alue=
"已禁用
"
placeholder=
"请输入内容"
></uni-easyinput>
</view>
<uni-section
title=
"密码框"
type=
"line"
></uni-section>
<view
class=
"example"
>
...
...
@@ -39,7 +43,12 @@
data
()
{
return
{
value
:
''
,
password
:
''
password
:
''
,
placeholderStyle
:
"
color:#499721;font-size:16px
"
,
styles
:
{
color
:
'
blue
'
,
borderColor
:
'
#499721
'
}
}
},
...
...
@@ -48,6 +57,12 @@
methods
:
{
input
(
e
)
{
console
.
log
(
'
输入内容:
'
,
e
);
},
iconClick
(
type
)
{
uni
.
showToast
({
title
:
`点击了
${
type
===
'
prefix
'
?
'
左侧
'
:
'
右侧
'
}
的图标`
,
icon
:
'
none
'
})
}
}
}
...
...
pages/extUI/forms/forms.vue
浏览文件 @
771f294b
<
template
>
<view>
<text
class=
"example-info"
>
uni-forms 组件一般由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据。
</text>
<uni-forms
:value=
"formData"
ref=
"form"
validate-trigger=
"bind"
err-show-type=
"
undertex
t"
>
<uni-forms
:value=
"formData"
ref=
"form"
validate-trigger=
"bind"
err-show-type=
"
toas
t"
>
<uni-group
title=
"基本信息"
top=
"0"
>
<uni-forms-item
name=
"name"
required
label=
"用户名"
>
<uni-easyinput
type=
"text"
:inputBorder=
"true"
v-model=
"formData.name"
placeholder=
"请输入用户名"
></uni-easyinput>
...
...
@@ -16,9 +16,9 @@
<uni-forms-item
name=
"email"
label=
"邮箱"
>
<uni-easyinput
type=
"text"
v-model=
"formData.email"
placeholder=
"请输入邮箱"
></uni-easyinput>
</uni-forms-item>
<
!--
<
uni-forms-item
name=
"time"
label=
"创建时间"
>
<uni-forms-item
name=
"time"
label=
"创建时间"
>
<uni-datetime-picker
v-model=
"formData.time"
:min-year=
"2000"
:max-year=
"2030"
:timestamp=
"true"
@
change=
"datetimeChange"
></uni-datetime-picker>
</uni-forms-item>
-->
</uni-forms-item>
<uni-forms-item
name=
"checked"
label=
"详细信息"
>
<switch
:checked=
"formData.checked"
@
change=
"change('checked',$event.detail.value)"
/>
</uni-forms-item>
...
...
@@ -185,9 +185,6 @@
this
.
$refs
.
form
.
setRules
(
this
.
rules
)
},
methods
:
{
test
(
e
)
{
console
.
log
(
'
---
'
,
e
.
detail
.
value
);
},
change
(
name
,
value
)
{
this
.
formData
.
checked
=
value
this
.
$refs
.
form
.
setValue
(
name
,
value
)
...
...
store/index.js
浏览文件 @
771f294b
...
...
@@ -5,18 +5,19 @@ Vue.use(Vuex)
const
store
=
new
Vuex
.
Store
({
state
:
{
hasLogin
:
false
,
hasLogin
:
false
,
isUniverifyLogin
:
false
,
loginProvider
:
""
,
openid
:
null
,
testvuex
:
false
,
colorIndex
:
0
,
colorList
:
[
'
#FF0000
'
,
'
#00FF00
'
,
'
#0000FF
'
],
noMatchLeftWindow
:
true
,
active
:
'
componentPage
'
,
leftWinActive
:
'
/pages/component/view/view
'
,
activeOpen
:
''
,
menu
:
[]
testvuex
:
false
,
colorIndex
:
0
,
colorList
:
[
'
#FF0000
'
,
'
#00FF00
'
,
'
#0000FF
'
],
noMatchLeftWindow
:
true
,
active
:
'
componentPage
'
,
leftWinActive
:
'
/pages/component/view/view
'
,
activeOpen
:
''
,
menu
:
[],
univerifyErrorMsg
:
''
},
mutations
:
{
login
(
state
,
provider
)
{
...
...
@@ -30,43 +31,46 @@ const store = new Vuex.Store({
setOpenid
(
state
,
openid
)
{
state
.
openid
=
openid
},
setTestTrue
(
state
){
setTestTrue
(
state
)
{
state
.
testvuex
=
true
},
setTestFalse
(
state
){
setTestFalse
(
state
)
{
state
.
testvuex
=
false
},
setColorIndex
(
state
,
index
)
{
state
.
colorIndex
=
index
},
setMatchLeftWindow
(
state
,
matchLeftWindow
)
{
state
.
noMatchLeftWindow
=
!
matchLeftWindow
},
setActive
(
state
,
tabPage
)
{
state
.
active
=
tabPage
},
setLeftWinActive
(
state
,
leftWinActive
)
{
state
.
leftWinActive
=
leftWinActive
},
setActiveOpen
(
state
,
activeOpen
)
{
state
.
activeOpen
=
activeOpen
},
setMenu
(
state
,
menu
)
{
state
.
menu
=
menu
},
setUniverifyLogin
(
state
,
payload
)
{
typeof
payload
!==
'
boolean
'
?
payload
=
!!
payload
:
''
;
state
.
isUniverifyLogin
=
payload
;
},
setColorIndex
(
state
,
index
){
state
.
colorIndex
=
index
},
setMatchLeftWindow
(
state
,
matchLeftWindow
){
state
.
noMatchLeftWindow
=
!
matchLeftWindow
},
setActive
(
state
,
tabPage
){
state
.
active
=
tabPage
},
setLeftWinActive
(
state
,
leftWinActive
){
state
.
leftWinActive
=
leftWinActive
},
setActiveOpen
(
state
,
activeOpen
){
state
.
activeOpen
=
activeOpen
},
setMenu
(
state
,
menu
){
state
.
menu
=
menu
},
setUniverifyLogin
(
state
,
payload
){
typeof
payload
!==
'
boolean
'
?
payload
=
!!
payload
:
''
;
state
.
isUniverifyLogin
=
payload
;
setUniverifyErrorMsg
(
state
,
payload
=
''
){
state
.
univerifyErrorMsg
=
payload
}
},
getters
:{
currentColor
(
state
){
return
state
.
colorList
[
state
.
colorIndex
]
}
},
},
getters
:
{
currentColor
(
state
)
{
return
state
.
colorList
[
state
.
colorIndex
]
}
},
actions
:
{
// lazy loading openid
getUserOpenId
:
async
function
({
getUserOpenId
:
async
function
({
commit
,
state
})
{
...
...
@@ -77,7 +81,7 @@ const store = new Vuex.Store({
uni
.
login
({
success
:
(
data
)
=>
{
commit
(
'
login
'
)
setTimeout
(
function
()
{
//模拟异步请求服务器获取 openid
setTimeout
(
function
()
{
//模拟异步请求服务器获取 openid
const
openid
=
'
123456789
'
console
.
log
(
'
uni.request mock openid[
'
+
openid
+
'
]
'
);
commit
(
'
setOpenid
'
,
openid
)
...
...
@@ -91,6 +95,29 @@ const store = new Vuex.Store({
})
}
})
},
getPhoneNumber
:
function
({
commit
},
univerifyInfo
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
uni
.
request
({
url
:
'
https://97fca9f2-41f6-449f-a35e-3f135d4c3875.bspapp.com/http/univerify-login
'
,
method
:
'
POST
'
,
data
:
univerifyInfo
,
success
:
(
res
)
=>
{
const
data
=
res
.
data
if
(
data
.
success
)
{
resolve
(
data
.
phoneNumber
)
}
else
{
reject
(
res
)
}
},
fail
:
(
err
)
=>
{
reject
(
res
)
}
})
})
}
}
})
...
...
windows/top-window.vue
浏览文件 @
771f294b
...
...
@@ -12,7 +12,6 @@
</
template
>
<
script
>
import
{
mapMutations
,
mapState
}
from
'
vuex
'
export
default
{
data
()
{
return
{
...
...
@@ -38,20 +37,21 @@
}]
}
},
computed
:
{
...
mapState
({
active
:
state
=>
state
.
active
,
hasLeftWin
:
state
=>
!
state
.
noMatchLeftWindow
})
props
:
{
matchLeftWindow
:
{
type
:
Boolean
},
showLeftWindow
:
{
type
:
Boolean
}
},
watch
:
{
$route
:
{
immediate
:
true
,
handler
(
newRoute
)
{
if
(
this
.
hasLeftWin
)
{
if
(
this
.
showLeftWindow
)
{
let
comp
=
newRoute
.
path
.
split
(
'
/
'
)[
2
]
this
.
current
=
this
.
selected
[
comp
]
for
(
const
item
of
this
.
indexPage
)
{
if
(
newRoute
.
path
===
item
.
tabBar
)
{
uni
.
redirectTo
({
...
...
@@ -66,16 +66,7 @@
mounted
()
{
},
methods
:
{
...
mapMutations
([
'
setActive
'
]),
toSecondMenu
(
e
)
{
let
component
=
e
.
pagePath
.
split
(
'
/
'
)[
3
]
if
(
component
===
'
component
'
)
{
component
=
'
componentPage
'
}
if
(
component
===
'
template
'
)
{
component
=
'
templatePage
'
}
this
.
setActive
(
component
)
const
activeTabBar
=
'
/
'
+
e
.
pagePath
for
(
const
item
of
this
.
indexPage
)
{
if
(
activeTabBar
===
item
.
tabBar
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录