Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lumastoreapp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xieyishang
lumastoreapp
Commits
b61a74f0
Commit
b61a74f0
authored
Aug 04, 2020
by
haitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asd
parent
6f07bab5
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
1568 additions
and
159 deletions
+1568
-159
App.vue
App.vue
+24
-21
components/Welcome/Welcome.vue
components/Welcome/Welcome.vue
+50
-34
components/jinedit/jinedit.vue
components/jinedit/jinedit.vue
+1
-0
components/lb-picker/README.md
components/lb-picker/README.md
+436
-0
components/lb-picker/index.vue
components/lb-picker/index.vue
+317
-0
components/lb-picker/mixins/index.js
components/lb-picker/mixins/index.js
+45
-0
components/lb-picker/pickers/multi-selector-picker.vue
components/lb-picker/pickers/multi-selector-picker.vue
+93
-0
components/lb-picker/pickers/selector-picker.vue
components/lb-picker/pickers/selector-picker.vue
+68
-0
components/lb-picker/pickers/unlinked-selector-picker.vue
components/lb-picker/pickers/unlinked-selector-picker.vue
+76
-0
components/lb-picker/style/picker-item.scss
components/lb-picker/style/picker-item.scss
+23
-0
components/lb-picker/style/picker.scss
components/lb-picker/style/picker.scss
+168
-0
components/lb-picker/utils.js
components/lb-picker/utils.js
+110
-0
components/plan-image-upload/up_img.vue
components/plan-image-upload/up_img.vue
+4
-2
components/showxieyi/showxieyi.vue
components/showxieyi/showxieyi.vue
+0
-1
components/yomol-upgrade/yomol-upgrade.vue
components/yomol-upgrade/yomol-upgrade.vue
+0
-4
main.js
main.js
+2
-0
manifest.json
manifest.json
+2
-2
pages/addEditEleProduct/addEditEleProduct.vue
pages/addEditEleProduct/addEditEleProduct.vue
+27
-6
pages/addhotel/addProjuct.scss
pages/addhotel/addProjuct.scss
+1
-1
pages/addhotel/addhotel.vue
pages/addhotel/addhotel.vue
+41
-33
pages/edit/pro_manage/pro_manage.scss
pages/edit/pro_manage/pro_manage.scss
+9
-1
pages/edit/pro_manage/pro_manage.vue
pages/edit/pro_manage/pro_manage.vue
+5
-3
pages/edit/product/addProjuct.scss
pages/edit/product/addProjuct.scss
+1
-1
pages/edit/product/addshop.vue
pages/edit/product/addshop.vue
+54
-25
pages/edit/shop/shop.vue
pages/edit/shop/shop.vue
+1
-1
pages/eleProduct/eleProduct.vue
pages/eleProduct/eleProduct.vue
+0
-1
pages/login/login.vue
pages/login/login.vue
+3
-5
pages/setup/setup.vue
pages/setup/setup.vue
+4
-15
static/news/helloword.png
static/news/helloword.png
+0
-0
static/news/yanhua.png
static/news/yanhua.png
+0
-0
utils/debug.js
utils/debug.js
+3
-3
No files found.
App.vue
View file @
b61a74f0
...
...
@@ -2,8 +2,6 @@
import
{
newsRemind
}
from
"
@/utils/api/api.js
"
;
//获取商家消息
export
default
{
onLaunch
:
function
()
{
console
.
log
(
'
App Launch
'
);
// #ifdef APP-PLUS
//app关闭默认的启动 方法关闭启动图。但是这个时间不能太晚,6s 超时后依旧会主动关闭。
setTimeout
(()
=>
{
...
...
@@ -13,18 +11,35 @@
//获取设备id ios
plus
.
device
.
getInfo
({
success
:(
e
)
=>
{
console
.
log
(
'
getDeviceInfo success:
'
+
JSON
.
stringify
(
e
));
//
console.log('getDeviceInfo success: '+JSON.stringify(e));
},
fail
:(
e
)
=>
{
console
.
log
(
'
getDeviceInfo failed:
'
+
JSON
.
stringify
(
e
));
//
console.log('getDeviceInfo failed: '+JSON.stringify(e));
}
});
uni
.
getNetworkType
({
//查看是否有网络
success
:
function
(
res
)
{
if
(
res
.
networkType
==
'
none
'
){
uni
.
showModal
({
title
:
'
温馨提示
'
,
content
:
'
检测到当前未打开网络,请打开网络
'
,
showCancel
:
false
})
}
else
if
(
res
.
networkType
==
'
2g
'
||
res
.
networkType
==
'
3g
'
){
uni
.
showModal
({
title
:
'
温馨提示
'
,
content
:
'
检测当前为
'
+
res
.
networkType
+
'
网络,网速较慢可能造成卡顿
'
,
showCancel
:
false
})
}
}
});
// #endif
//安卓的
// #ifdef APP-PLUS
const
clientInfo
=
plus
.
push
.
getClientInfo
()
console
.
log
(
clientInfo
,
"
clientInfo
"
)
const
clientInfo
=
plus
.
push
.
getClientInfo
();
// #endif
setTimeout
(()
=>
{
...
...
@@ -32,19 +47,17 @@
},
15000
)
},
onShow
:
function
()
{
console
.
log
(
'
App Show
'
)
//
console.log('App Show')
},
onHide
:
function
()
{
console
.
log
(
'
App Hide
'
)
//
console.log('App Hide')
},
methods
:{
//获取 语音消息
async
getnewsRemind
(){
console
.
info
(
"
66344554
"
);
var
date
=
new
Date
();
let
hours
=
date
.
getHours
();
//当前 时间 小时
let
datestime
=
5000
;
//默认15秒
console
.
info
(
hours
);
// if(hours==11 || hours==12 || hours==13 ){//1级别 高峰时间
// datestime = 5000;//高峰时期 5s一次
// }else if(hours==10 || hours==14){//1级别
...
...
@@ -57,27 +70,17 @@
if
(
this
.
$store
.
state
.
token
!=
""
){
//判断是否 已登录
let
res
=
await
newsRemind
({
})
console
.
info
(
"
.99999
"
,
res
);
let
res
=
await
newsRemind
({})
if
(
res
.
code
==
0
){
console
.
info
(
"
0000000000
"
);
if
(
res
.
data
.
length
!=
0
){
//进来了就是有消息
let
msglist
=
res
.
data
;
console
.
info
(
"
循环消息列表
"
);
if
(
msglist
.
length
==
1
){
//一条就播放 如果多条 直接告诉商家多少条
// isvoice 开关
if
(
this
.
$store
.
state
.
isvoice
){
this
.
$store
.
dispatch
(
'
AudioVoice
'
,
msglist
[
0
].
message
).
then
((
e
)
=>
{
console
.
log
(
e
);
console
.
info
(
"
循环消息列表2
"
);
//震动 调用//400ms//长震动
uni
.
vibrateLong
({
success
:(
re
)
=>
{
...
...
components/Welcome/Welcome.vue
View file @
b61a74f0
...
...
@@ -7,13 +7,17 @@
<view
class=
"tipboxs"
@
tap=
"cancel"
>
<view
class=
"heads"
>
<!--
<image
class=
"headimg"
src=
"/static/news/ishellobg.png "
mode=
""
></image>
-->
<image
class=
"headimg"
src=
"/static/news/helloword.png "
mode=
""
></image>
<!-- helloword.png -->
<!-- 顶部背景图 -->
<image
class=
"headimg"
src=
"/static/news/helloword.png "
mode=
"widthFix"
></image>
<image
class=
"isusertx"
:src=
"staticurl+userInfo.logo"
mode=
""
></image>
<view
class=
"shopnames"
>
{{
userInfo
.
shop_name
}}
</view>
<view
class=
"centerBox"
>
<image
class=
"isusertx"
:src=
"staticurl+userInfo.logo"
mode=
""
></image>
<view
class=
"shopnames"
>
{{
userInfo
.
shop_name
}}
</view>
<view
class=
"shopnames2"
>
恭喜发财 财源广进
</view>
<image
src=
"../../static/news/yanhua.png"
mode=
"widthFix"
style=
"width: 113upx;position: absolute;bottom: 0;left: -60upx;height: 100upx;"
></image>
<image
src=
"../../static/news/yanhua.png"
style=
"width: 94upx;position: absolute;right:-60upx;top:110upx;height:84upx;"
></image>
</view>
</view>
<image
class=
"Closeicon"
src=
"/static/news/Closeico21.png"
mode=
""
></image>
</view>
...
...
@@ -57,7 +61,6 @@
},
//提示弹窗
change
(
e
)
{
console
.
log
(
'
是否打开:
'
+
e
.
show
)
if
(
!
e
.
show
)
{
this
.
showtip
=
false
}
...
...
@@ -75,8 +78,8 @@
</
script
>
<
style
lang=
"scss"
>
$wid
:
75
0upx
;
$hei
:
863
upx
;
$wid
:
60
0upx
;
$hei
:
584
upx
;
.prizemodel
{
// width: $wid;
// height: $hei;
...
...
@@ -84,6 +87,8 @@
.tipboxs
{
width
:
$wid
;
height
:
$hei
;
background
:
#fff
;
border-radius
:
10upx
;
position
:
relative
;
.Closeicon
{
width
:
80upx
;
...
...
@@ -91,38 +96,49 @@
position
:
absolute
;
left
:
50%
;
margin-left
:
-40upx
;
bottom
:
-1
0
0upx
;
bottom
:
-1
3
0upx
;
}
.heads
{
position
:
relative
;
height
:
100%
;
.centerBox
{
width
:
480upx
;
height
:
334upx
;
background
:
#fff
;
position
:absolute
;
bottom
:
0
;
left
:
50%
;
margin-left
:
-240upx
;
border-radius
:
10upx
;
.isusertx
{
position
:
absolute
;
width
:
240upx
;
height
:
240upx
;
top
:
-120upx
;
left
:
50%
;
margin-left
:
-120upx
;
z-index
:
99
;
border-radius
:
50%
;
}
.shopnames
{
width
:
100%
;
font-size
:
42upx
;
font-weight
:
bold
;
color
:
#FB642F
;
position
:
absolute
;
top
:
148upx
;
text-align
:
center
;
z-index
:
99
;
}
.shopnames2
{
width
:
100%
;
font-size
:
32upx
;
color
:
#FB642F
;
position
:
absolute
;
top
:
214upx
;
text-align
:
center
;
z-index
:
99
;
}
}
.headimg
{
width
:
$wid
;
height
:
$hei
;
}
.isusertx
{
position
:
absolute
;
width
:
382upx
;
height
:
382upx
;
top
:
312upx
;
left
:
50%
;
margin-left
:
-191upx
;
z-index
:
99
;
border-radius
:
50%
;
}
.shopnames
{
width
:
100%
;
font-size
:
40upx
;
font-weight
:
bold
;
color
:
#000
;
position
:
absolute
;
top
:
740upx
;
text-align
:
center
;
z-index
:
99
;
border-radius
:
50%
;
}
}
.tipboxs_body
{
border-top-left-radius
:
0
;
...
...
components/jinedit/jinedit.vue
View file @
b61a74f0
...
...
@@ -278,6 +278,7 @@ export default {
},
//保存数据到父组件方法
release
(
isPublic
)
{
console
.
log
(
isPublic
)
this
.
showSettingLayer
=
false
;
this
.
editorCtx
.
getContents
({
success
:
res
=>
{
...
...
components/lb-picker/README.md
0 → 100644
View file @
b61a74f0
<p
align=
"center"
>
<a
href=
"https://github.com/liub1934/uni-lb-picker"
>
<img
src=
"https://img.shields.io/github/stars/liub1934/uni-lb-picker"
>
</a>
<a
href=
"https://github.com/liub1934/uni-lb-picker/fork"
>
<img
src=
"https://img.shields.io/github/forks/liub1934/uni-lb-picker"
>
</a>
<a
href=
"https://github.com/liub1934/uni-lb-picker/issues"
>
<img
src=
"https://img.shields.io/github/issues/liub1934/uni-lb-picker"
>
</a>
<a
href=
"https://www.npmjs.com/package/uni-lb-picker"
>
<img
src=
"https://img.shields.io/npm/v/uni-lb-picker"
>
</a>
<a
href=
"https://npmcharts.com/compare/uni-lb-picker?minimal=true"
>
<img
src=
"https://img.shields.io/npm/dm/uni-lb-picker"
>
</a>
<a
href=
"https://github.com/liub1934/uni-lb-picker/blob/master/LICENSE"
>
<img
src=
"https://img.shields.io/github/license/liub1934/uni-lb-picker"
>
</a>
</p>
插件市场里面的 picker 选择器不满足自己的需求,所以自己写了一个简单的 picker 选择器,可扩展、可自定义,一般满足日常需要。
Github:
[
uni-lb-picker
](
https://github.com/liub1934/uni-lb-picker
)
插件市场:
[
uni-lb-picker
](
https://ext.dcloud.net.cn/plugin?id=1111
)
H5 预览:
[
uni-lb-picker
](
https://github.liubing.me/uni-lb-picker
)
> 如果问题最好去 github 反馈,插件市场评论区留下五星好评即可,[点我去反馈](https://github.com/liub1934/uni-lb-picker/issues/new)
> **由于之前`cancel`拼写失误,写成了`cancle`,`v1.08`现已修正,如果之前版本有使用`cancel`事件的,更新后请及时修正。**
## 兼容性
App + H5 + 各平台小程序(快应用及 360 未测试,nvue 待支持)
## 功能
1、单选
2、多级联动,非多级联动,理论支持任意级数
3、省市区选择,基于多级联动
4、自定义选择器头部确定取消按钮颜色及插槽支持
5、选择器可视区自定义滚动个数
6、自定义数据字段,满足不同人的需求
7、自定义选择器样式
8、单选及非联动选择支持扁平化的简单数据,如下形式:
```
javascript
// 单选列表
list1
:
[
'
选项1
'
,
'
选项2
'
,
'
选项2
'
],
// 非联动选择列表
list2
:
[
[
'
选项1
'
,
'
选项2
'
,
'
选项3
'
],
[
'
选项11
'
,
'
选项22
'
,
'
选项33
'
],
[
'
选项111
'
,
'
选项222
'
,
'
选项333
'
]
]
```
## 引入插件
单独引入,在需要使用的页面上 import 引入即可
```
html
<template>
<view>
<lb-picker></lb-picker>
</view>
</template>
<script>
import
LbPicker
from
'
@/components/lb-picker
'
export
default
{
components
:
{
LbPicker
}
}
</script>
```
全局引入,
`main.js`
中 import 引入并注册即可全局使用
```
jsvascript
import LbPicker from '@/components/lb-picker'
Vue.component("lb-picker", LbPicker)
```
easycom 引入
`pages.json`
加上如下配置:
```
json
"easycom"
:
{
"autoscan"
:
true
,
"custom"
:
{
"lb-picker"
:
"@/components/lb-picker/index.vue"
}
}
```
npm 安装引入:
```
shell
npm
install
uni-lb-picker
```
```
jsvascript
import LbPicker from 'uni-lb-picker'
```
## 选择器数据格式
### 单选
常规数据
```
javascript
list
:
[
{
label
:
'
选项1
'
,
value
:
'
1
'
},
{
label
:
'
选项2
'
,
value
:
'
2
'
}
]
```
扁平化简单数据
```
javascript
list
:
[
'
选项1
'
,
'
选项2
'
]
```
### 多级联动
```
javascript
list
:
[
{
label
:
'
选项1
'
,
value
:
'
1
'
,
children
:
[
{
label
:
'
选项1-1
'
,
value
:
'
1-1
'
,
children
:
[
{
label
:
'
选项1-1-1
'
,
value
:
'
1-1-1
'
}
]
}
]
}
]
```
### 非联动选择
常规数据
```
javascript
list
:
[
[
{
label
:
'
选项1
'
,
value
:
'
1
'
},
{
label
:
'
选项2
'
,
value
:
'
2
'
},
{
label
:
'
选项3
'
,
value
:
'
3
'
}
],
[
{
label
:
'
选项11
'
,
value
:
'
11
'
},
{
label
:
'
选项22
'
,
value
:
'
22
'
},
{
label
:
'
选项33
'
,
value
:
'
33
'
}
],
[
{
label
:
'
选项111
'
,
value
:
'
111
'
},
{
label
:
'
选项222
'
,
value
:
'
222
'
},
{
label
:
'
选项333
'
,
value
:
'
333
'
}
]
]
```
扁平化简单数据
```
javascript
list
:
[
[
'
选项1
'
,
'
选项2
'
,
'
选项3
'
],
[
'
选项11
'
,
'
选项22
'
,
'
选项33
'
],
[
'
选项111
'
,
'
选项222
'
,
'
选项333
'
]
]
```
## 调用显示选择器
通过
`ref`
形式手动调用
`show`
方法显示,隐藏同理调用
`hide`
```
text
<lb-picker ref="picker"></lb-picker>
this.$refs.picker.show() // 显示
this.$refs.picker.hide() // 隐藏
```
## 绑定值及设置默认值
支持 vue 中
`v-model`
写法绑定值,无需自己维护选中值的索引。
```
javascript
<
lb
-
picker
v
-
model
=
"
value1
"
><
/lb-picker
>
<
lb
-
picker
v
-
model
=
"
value2
"
><
/lb-picker
>
data
()
{
return
{
value1
:
''
// 单选
value2
:
[]
// 多列联动选择
}
}
```
## 多个选择器
通过设置不同的
`ref`
,然后调用即可
```
javascript
<
lb
-
picker
ref
=
"
picker1
"
><
/lb-picker
>
<
lb
-
picker
ref
=
"
picker2
"
><
/lb-picker
>
this
.
$refs
.
picker1
.
show
()
// picker1显示
this
.
$refs
.
picker2
.
show
()
// picker2显示
```
## 省市区选择
省市区选择是基于多列联动选择,数据来源:
[
https://github.com/modood/Administrative-divisions-of-China
](
https://github.com/modood/Administrative-divisions-of-China
)
,
省市区文件位于
`/pages/demos/area-data-min.js`
,自行引入即可,可参考
`demo3省市区选择`
,
也可使用自己已有的省市区数据,如果数据字段不一样,也可以自定义,参考下方自定义数据字段。
## 自定义数据字段
为了满足不同人的需求,插件支持自定义数据字段名称, 插件默认的数据字段如下形式:
```
javascript
list
:
[
{
label
:
'
选择1
'
,
value
:
1
,
children
:
[]
},
{
label
:
'
选择1
'
,
value
:
1
,
children
:
[]
}
]
```
如果你的数据字段和上面不一样,如下形式:
```
javascript
list
:
[
{
text
:
'
选择1
'
,
id
:
1
,
child
:
[]
},
{
text
:
'
选择1
'
,
id
:
1
,
child
:
[]
}
]
```
通过设置参数中的
`props`
即可,如下所示:
```
javascript
<
lb
-
picker
:
props
=
"
myProps
"
><
/lb-picker
>
data
()
{
return
{
myProps
:
{
label
:
'
text
'
,
value
:
'
id
'
,
children
:
'
child
'
}
}
}
```
## 插槽使用
选择器支持一些可自定义化的插槽,如选择器的取消和确定文字按钮,如果需要对其自定义处理的话,比如加个 icon 图标之类的,可使用插槽,使用方法如下:
```
html
<lb-picker>
<view
slot=
"cancel-text"
>
我是自定义取消
</view>
<view
slot=
"confirm-text"
>
我是自定义确定
</view>
</lb-picker>
```
其他插槽见下。
## 参数及事件
### Props
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
| :---------------------- | :--------------------------------------------------------------------------------------------------------------------------------- | :------------------ | :--------------------------------------------------------------- | :------------------------------------------------ |
| value/v-model | 绑定值,联动选择为 Array 类型 | String/Number/Array | - | - |
| mode | 选择器类型,支持单列,多列联动 | String | selector 单选/multiSelector 多级联动/unlinkedSelector 多级非联动 | selector |
| list | 选择器数据(v1.0.7 单选及非联动多选支持扁平数据:['选项 1', '选项 2']) | Array | - | - |
| level | 多列联动层级,仅 mode 为 multiSelector 有效 | Number | - | 2 |
| props | 自定义数据字段 | Object | - | {label:'label',value:'value',children:'children'} |
| cancel-text | 取消文字 | String | - | 取消 |
| cancel-color | 取消文字颜色 | String | - | #999 |
| confirm-text | 确定文字 | String | - | 确定 |
| confirm-color | 确定文字颜色 | String | - | #007aff |
| empty-text | (v1.0.7 新增)选择器列表为空的时候显示的文字 | String | - | 暂无数据 |
| empty-color | (v1.0.7 新增)暂无数据文字颜色 | String | - | #999 |
| column-num | 可视滚动区域内滚动个数,最好设置奇数值 | Number | - | 5 |
| radius | 选择器顶部圆角,支持 rpx,如 radius="10rpx" | String | - | - |
| ~~column-style~~ | ~~选择器默认样式(已弃用,见下方自定义样式说明)~~ | Object | - | - |
| ~~active-column-style~~ | ~~选择器选中样式(已弃用,见下方自定义样式说明)~~ | Object | - | - |
| loading | 选择器是否显示加载中,可使用 loading 插槽自定义加载效果 | Boolean | - | - |
| mask-color | 遮罩层颜色 | String | - | rgba(0, 0, 0, 0.4) |
| show-mask | (v1.1.0 新增)是否显示遮罩层 | Boolean | true/false | true |
| close-on-click-mask | 点击遮罩层是否关闭选择器 | Boolean | true/false | true |
| ~~change-on-init~~ | ~~(v1.0.7 已弃用)初始化时是否触发 change 事件~~ | Boolean | true/false | - |
| dataset | (v1.0.7 新增)可以向组件中传递任意的自定义的数据(对象形式数据),如
`:dataset="{name:'test'}"`
,在
`confirm`
或
`change`
事件中可以取到 | Object | - | - |
| show-header | (v1.0.8 新增)是否显示选择器头部 | Boolean | - | true |
| inline | (v1.0.8 新增)inline 模式,开启后默认显示选择器,无需点击弹出,可以配合
`show-header`
一起使用 | Boolean | - | - |
| z-index | (v1.0.9 新增)选择器层级,遮罩层默认-1 | Number | - | 999 |
### 方法
| 方法名 | 说明 | 参数 | 返回值 |
| :------------- | :------------------------------------- | :-------------- | :----------------------------------------------------------------------------------------------------------- |
| show | 打开选择器 | - | |
| hide | 关闭选择器 | - | |
| getColumnsInfo | (v1.1.0 新增)根据 value 获取选择器信息 | 绑定值的
`value`
| 同
`change`
`confirm`
回调参数,如果传入的
`value`
获取不到信息则只返回一个含有
`dataset`
的对象,具体自行打印查看 |
### Events
| 事件名称 | 说明 | 回调参数 |
| :------- | :--------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| show | 选择器打开时触发 | - |
| hide | 选择器隐藏时触发 | - |
| change | 选择器滚动时触发,此时不会改变绑定的值 |
`{ index, item, value, change }`
`index`
触发滚动后新的索引,单选时是具体的索引值,多列联动选择时为数组。
`item`
触发滚动后新的的完整内容,包括
`label`
、
`value`
等,单选时为对象,多列选择时为数组对象。
`value`
触发滚动后新的 value 值,单列选择时为具体值,多列联动选择时为数组。
`change`
触发事件的类型,详情参考下面的 change 事件备注 |
| confirm | 点击选择器确定时触发,此时会改变绑定的值 | 同上
`change`
事件说明 |
| cancel | 点击选择器取消时触发 | 同上
`change`
事件说明 |
### `change` 事件备注
如果绑定的值是空的,
`change`
触发后里面的内容都是列表的第一项。
`change`
事件会在以下情况触发:
-
初始化
-
绑定值 value 变化
-
选择器 list 列表变化
-
滚动选择器
以上情况会在回调函数中都可以取到
`change`
变化的类型,对应上面的情况包括以下:
-
`init`
-
`value`
-
`list`
-
`scroll`
根据这些类型大家可以在
`change`
的时候按需处理自己的业务逻辑,
`init`
现在指挥在调用选择器弹出的时候触发。
下面的说明情况已失效,如需要在页面显示的时候根据
`value`
的值显示相应的中文,调用
`v1.10`
新增的方法
`getColumnsInfo`
,传入绑定的值即可获取到你想要的所有信息。
~~比如一种常见的情况,有默认值的时候需要显示默认值的文字,此时可以
`change`
事件中判断
`change`
的类型是否是
`init`
,如果是的话可以取事件回调中的
`item`
进行显示绑定值对应的文字信息。~~
```
javascript
handleChange
(
e
)
{
if
(
e
.
change
===
'
init
'
)
{
console
.
log
(
e
.
item
.
label
)
// 单选 选项1
console
.
log
(
e
.
item
.
map
(
item
=>
item
.
label
).
join
(
'
-
'
))
// 多选 选项1-选项11
}
}
```
### 插槽
| 插槽名 | 说明 |
| :------------ | :------------------ |
| cancel-text | 选择器取消文字插槽 |
| action-center | 选择器顶部中间插槽 |
| confirm-text | 选择器确定文字插槽 |
| loading | 选择器 loading 插槽 |
| empty | 选择器 空数据 插槽 |
### 选择器自定义样式
原先的
`column-style`
和
`active-column-style`
已弃用,如需修改默认样式及选中样式参考
`demo9`
```
css
<
style
lang
=
"scss"
scoped
>
/
deep
/
.lb-picker
{
.lb-picker-column-label
{
color
:
#f0ad4e
;
}
.lb-picker-column-active
{
.lb-picker-column-label
{
color
:
#007aff
;
font-weight
:
700
;
}
}
}
</
style
>
```
### 获取选中值的文字
`@confirm`
事件中可以拿到:
单选:
```
javascript
handleConfirm
(
e
)
{
console
.
log
(
e
.
item
.
label
)
// 选项1
}
```
联动选择:
```
javascript
handleConfirm
(
e
)
{
console
.
log
(
e
.
item
.
map
(
item
=>
item
.
label
).
join
(
'
-
'
))
// 选项1-选项11
}
```
## Tips
微信小程序端,滚动时在 iOS 自带振动反馈,可在系统设置 -> 声音与触感 -> 系统触感反馈中关闭
## 其他
其他功能参考示例 Demo 代码。
components/lb-picker/index.vue
0 → 100644
View file @
b61a74f0
<
template
>
<view
v-if=
"visible || inline"
:class=
"['lb-picker', inline ? 'lb-picker-inline' : '']"
>
<view
v-if=
"showMask && !inline"
:class=
"['lb-picker-mask', animation ? 'lb-picker-mask-animation' : '']"
:style=
"
{
backgroundColor: maskBgColor,
zIndex: zIndex - 1
}"
@tap.stop="handleMaskTap"
@touchmove.stop.prevent="moveHandle">
</view>
<view
:class=
"[
'lb-picker-container',
!inline ? 'lb-picker-container-fixed' : '',
animation ? 'lb-picker-container-animation' : '',
containerVisible ? 'lb-picker-container-show' : ''
]"
:style=
"
{
borderRadius: `${radius} ${radius} 0 0`,
zIndex: zIndex
}">
<view
v-if=
"showHeader"
class=
"lb-picker-header"
>
<view
class=
"lb-picker-action lb-picker-left"
>
<view
class=
"lb-picker-action-item lb-picker-action-cancel"
@
tap.stop=
"handleCancel"
>
<slot
v-if=
"$slots['cancel-text']"
name=
"cancel-text"
>
</slot>
<text
v-else
class=
"lb-picker-action-cancel-text"
:style=
"
{ color: cancelColor }">
{{
cancelText
}}
</text>
</view>
</view>
<view
class=
"lb-picker-action lb-picker-center"
v-if=
"$slots['action-center']"
>
<slot
name=
"action-center"
></slot>
</view>
<view
class=
"lb-picker-action lb-picker-right"
>
<view
class=
"lb-picker-action-item lb-picker-action-confirm"
@
tap.stop=
"handleConfirm"
>
<slot
v-if=
"$slots['confirm-text']"
name=
"confirm-text"
>
</slot>
<text
v-else
class=
"lb-picker-action-confirm-text"
:style=
"
{ color: confirmColor }">
{{
confirmText
}}
</text>
</view>
</view>
</view>
<view
class=
"lb-picker-content"
:style=
"
{ height: pickerContentHeight }">
<!-- loading -->
<view
v-if=
"loading"
class=
"lb-picker-loading"
>
<slot
name=
"loading"
>
<image
class=
"lb-picker-loading-img"
src=
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAPFklEQVR4Xu2dTXbUOBeGpToHF7OGFTSsAFhBJyto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aOHKZYi3DM2QkoZxkZVnSGYmj/tgA0kDS5W16VHDkCMiQkST0dy/rKGQFSAMJJTSgF4e/bLh1nBljXoX4Ptvl7SunKdaKkYROx7VKTscpsQM7QJo7LSWL3pFS0lHEt5sX67qmTWynxpiT2MDIcQ1y98bSbEalG9/abC51XX+cTCb7nLa8swTE5V2bU1u5jiDLMWhA2Vk+atoYcyGEOOV44wMgAQkCIAHFdmQKgDgS0qYZAGKjEq8yACRgPABIQLEdmQIgjoS0aQaA2KjEqwwACRgPABJQbEemAIgjIW2aASA2KvEqA0ACxgOABBTbkSkA4khIm2YAiI1KvMoAkIDxACABxXZkCoA4EtKmGQBioxKvMgAkYDwASECxHZkCII6EtGkGgNioxKsMAAkYDwASUGxHpgCIIyFtmgEgNirxKgNAAsYDgAQU25EpAOJISJtmAIiNSrzKAJCA8QAgAcV2ZAqAOBLSppnma7p/bMquK8MhofMQ/2OrC0ACR6yqqnMp5ZM+Zrmkwunje6x1AEjgyC0Wi95ZJDll+wgs22jmAMgI0vfMZn+mlKJkB/gFVACABBS7NUVrkevr61PbqRZNrabT6c7Yh8mMINXoJgHIiCHQWm9LknclhDhQSlE5/EZQAICMIPqyyTt5oihhHv0oT9R5URSnGDXGDRAAGVd/WGeuAABhHiC4N64CAGRc/WGduQIAhHmA4N64CgCQcfWHdeYKABDmAYJ74yoAQMbVH9aZKwBAmAcI7o2rwL9NuZ5QQgPItwAAAABJRU5ErkJggg=="
>
</image>
</slot>
</view>
<!-- 暂无数据 -->
<view
v-if=
"isEmpty && !loading"
class=
"lb-picker-empty"
>
<slot
name=
"empty"
>
<text
class=
"lb-picker-empty-text"
:style=
"
{ color: emptyColor }">
{{
emptyText
}}
</text>
</slot>
</view>
<!-- 单选 -->
<selector-picker
v-if=
"mode === 'selector' && !loading && !isEmpty"
:value=
"value"
:list=
"list"
:mode=
"mode"
:props=
"pickerProps"
:height=
"pickerContentHeight"
:inline=
"inline"
:is-confirm-change=
"isConfirmChange"
@
change=
"handleChange"
>
</selector-picker>
<!-- 多列联动 -->
<multi-selector-picker
v-if=
"mode === 'multiSelector' && !loading && !isEmpty"
:value=
"value"
:list=
"list"
:mode=
"mode"
:level=
"level"
:visible=
"visible"
:props=
"pickerProps"
:height=
"pickerContentHeight"
:inline=
"inline"
:is-confirm-change=
"isConfirmChange"
@
change=
"handleChange"
>
</multi-selector-picker>
<!-- 非联动选择 -->
<unlinked-selector-picker
v-if=
"mode === 'unlinkedSelector' && !loading && !isEmpty"
:value=
"value"
:list=
"list"
:mode=
"mode"
:visible=
"visible"
:props=
"pickerProps"
:height=
"pickerContentHeight"
:inline=
"inline"
:is-confirm-change=
"isConfirmChange"
@
change=
"handleChange"
>
</unlinked-selector-picker>
</view>
</view>
</view>
</
template
>
<
script
>
const
defaultProps
=
{
label
:
'
label
'
,
value
:
'
value
'
,
children
:
'
children
'
}
import
{
getColumns
}
from
'
./utils
'
import
SelectorPicker
from
'
./pickers/selector-picker
'
import
MultiSelectorPicker
from
'
./pickers/multi-selector-picker
'
import
UnlinkedSelectorPicker
from
'
./pickers/unlinked-selector-picker
'
export
default
{
components
:
{
SelectorPicker
,
MultiSelectorPicker
,
UnlinkedSelectorPicker
},
props
:
{
value
:
[
String
,
Number
,
Array
],
list
:
Array
,
mode
:
{
type
:
String
,
default
:
'
selector
'
},
level
:
{
type
:
Number
,
default
:
1
},
props
:
{
type
:
Object
},
cancelText
:
{
type
:
String
,
default
:
'
取消
'
},
cancelColor
:
String
,
confirmText
:
{
type
:
String
,
default
:
'
确定
'
},
confirmColor
:
String
,
canHide
:
{
type
:
Boolean
,
default
:
true
},
emptyColor
:
String
,
emptyText
:
{
type
:
String
,
default
:
'
暂无数据
'
},
radius
:
String
,
columnNum
:
{
type
:
Number
,
default
:
5
},
loading
:
Boolean
,
closeOnClickMask
:
{
type
:
Boolean
,
default
:
true
},
showMask
:
{
type
:
Boolean
,
default
:
true
},
maskColor
:
{
type
:
String
,
default
:
'
rgba(0, 0, 0, 0.4)
'
},
dataset
:
Object
,
inline
:
Boolean
,
showHeader
:
{
type
:
Boolean
,
default
:
true
},
animation
:
{
type
:
Boolean
,
default
:
true
},
zIndex
:
{
type
:
Number
,
default
:
999
}
},
data
()
{
return
{
visible
:
false
,
containerVisible
:
false
,
maskBgColor
:
''
,
isConfirmChange
:
false
,
myValue
:
this
.
value
,
picker
:
{},
pickerProps
:
Object
.
assign
({},
defaultProps
,
this
.
props
),
pickerContentHeight
:
34
*
this
.
columnNum
+
'
px
'
}
},
computed
:
{
isEmpty
()
{
if
(
!
this
.
list
)
return
true
if
(
this
.
list
&&
!
this
.
list
.
length
)
return
true
return
false
}
},
methods
:
{
show
()
{
if
(
this
.
inline
)
return
this
.
visible
=
true
setTimeout
(()
=>
{
this
.
maskBgColor
=
this
.
maskColor
this
.
containerVisible
=
true
},
20
)
},
hide
()
{
if
(
this
.
inline
)
return
this
.
maskBgColor
=
''
this
.
containerVisible
=
false
setTimeout
(()
=>
{
this
.
visible
=
false
},
200
)
},
handleCancel
()
{
this
.
$emit
(
'
cancel
'
,
this
.
picker
)
if
(
this
.
canHide
&&
!
this
.
inline
)
{
this
.
hide
()
}
},
handleConfirm
()
{
if
(
this
.
isEmpty
)
{
this
.
$emit
(
'
confirm
'
,
null
)
this
.
hide
()
}
else
{
const
picker
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
picker
))
this
.
myValue
=
picker
.
value
this
.
isConfirmChange
=
true
this
.
$emit
(
'
confirm
'
,
this
.
picker
)
if
(
this
.
canHide
)
this
.
hide
()
}
},
handleChange
({
value
,
item
,
index
,
change
})
{
this
.
picker
.
value
=
value
this
.
picker
.
item
=
item
this
.
picker
.
index
=
index
this
.
picker
.
change
=
change
this
.
picker
.
dataset
=
this
.
dataset
||
{}
this
.
isConfirmChange
=
false
this
.
$emit
(
'
change
'
,
this
.
picker
)
},
handleMaskTap
()
{
if
(
this
.
closeOnClickMask
)
{
this
.
hide
()
}
},
moveHandle
()
{},
getColumnsInfo
(
value
,
type
=
1
)
{
let
columnsInfo
=
getColumns
({
value
,
list
:
this
.
list
,
mode
:
this
.
mode
,
props
:
this
.
pickerProps
,
level
:
this
.
level
},
type
)
if
(
columnsInfo
)
{
if
(
this
.
mode
===
'
selector
'
)
{
columnsInfo
.
index
=
columnsInfo
.
index
[
0
]
}
}
else
{
columnsInfo
=
{}
}
columnsInfo
.
dataset
=
this
.
dataset
||
{}
return
columnsInfo
}
},
watch
:
{
value
(
newVal
)
{
this
.
myValue
=
newVal
},
myValue
(
newVal
)
{
this
.
$emit
(
'
input
'
,
newVal
)
},
visible
(
newVisible
)
{
if
(
newVisible
)
{
this
.
$emit
(
'
show
'
)
}
else
{
this
.
$emit
(
'
hide
'
)
}
},
props
(
newProps
)
{
this
.
pickerProps
=
Object
.
assign
({},
defaultProps
,
newProps
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
@import
"./style/picker.scss"
;
</
style
>
components/lb-picker/mixins/index.js
0 → 100644
View file @
b61a74f0
import
{
getColumns
}
from
'
../utils
'
export
const
commonMixin
=
{
data
()
{
return
{
indicatorStyle
:
`height: 34px`
}
},
created
()
{
this
.
init
(
'
init
'
)
},
methods
:
{
init
(
changeType
)
{
if
(
this
.
list
&&
this
.
list
.
length
)
{
const
column
=
getColumns
({
value
:
this
.
value
,
list
:
this
.
list
,
mode
:
this
.
mode
,
props
:
this
.
props
,
level
:
this
.
level
})
const
{
columns
,
value
,
item
,
index
}
=
column
this
.
selectValue
=
value
this
.
selectItem
=
item
this
.
pickerColumns
=
columns
this
.
pickerValue
=
index
this
.
$emit
(
'
change
'
,
{
value
:
this
.
selectValue
,
item
:
this
.
selectItem
,
index
:
this
.
pickerValue
,
change
:
changeType
})
}
}
},
watch
:
{
value
()
{
if
(
!
this
.
isConfirmChange
)
{
this
.
init
(
'
value
'
)
}
},
list
()
{
this
.
init
(
'
list
'
)
}
}
}
components/lb-picker/pickers/multi-selector-picker.vue
0 → 100644
View file @
b61a74f0
<
template
>
<view
class=
"lb-multi-selector lb-picker-item"
:style=
"
{ height: height }">
<picker-view
:value=
"pickerValue"
:indicator-style=
"indicatorStyle"
:style=
"
{ height: height }"
@change="handleChange">
<picker-view-column
v-for=
"(column, index) in pickerColumns"
:key=
"index"
>
<view
v-for=
"(item, i) in column || []"
:class=
"[
'lb-picker-column',
item[props.value] === selectValue[index]
? 'lb-picker-column-active'
: ''
]"
:key=
"i"
>
<text
class=
"lb-picker-column-label"
>
{{
item
[
props
.
label
]
||
item
}}
</text>
</view>
</picker-view-column>
</picker-view>
</view>
</
template
>
<
script
>
import
{
commonMixin
}
from
'
../mixins
'
export
default
{
props
:
{
value
:
Array
,
list
:
Array
,
mode
:
String
,
props
:
Object
,
level
:
Number
,
visible
:
Boolean
,
height
:
String
,
isConfirmChange
:
Boolean
},
mixins
:
[
commonMixin
],
data
()
{
return
{
pickerValue
:
[],
pickerColumns
:
[],
selectValue
:
[],
selectItem
:
[]
}
},
methods
:
{
handleChange
(
item
)
{
const
pickerValue
=
item
.
detail
.
value
const
columnIndex
=
pickerValue
.
findIndex
((
item
,
i
)
=>
item
!==
this
.
pickerValue
[
i
])
const
valueIndex
=
pickerValue
[
columnIndex
]
this
.
setPickerChange
(
pickerValue
,
valueIndex
,
columnIndex
)
},
setPickerChange
(
pickerValue
,
valueIndex
,
columnIndex
)
{
for
(
let
i
=
0
;
i
<
this
.
level
;
i
++
)
{
if
(
i
>
columnIndex
)
{
pickerValue
[
i
]
=
0
const
column
=
this
.
pickerColumns
[
i
-
1
][
valueIndex
]
||
this
.
pickerColumns
[
i
-
1
][
0
]
this
.
$set
(
this
.
pickerColumns
,
i
,
column
[
this
.
props
.
children
]
||
[])
valueIndex
=
0
}
this
.
$set
(
this
.
pickerValue
,
i
,
pickerValue
[
i
])
const
selectItem
=
this
.
pickerColumns
[
i
][
pickerValue
[
i
]]
if
(
selectItem
)
{
this
.
selectItem
[
i
]
=
selectItem
this
.
selectValue
[
i
]
=
selectItem
[
this
.
props
.
value
]
}
else
{
const
spliceNum
=
this
.
level
-
i
this
.
pickerValue
.
splice
(
i
,
spliceNum
)
this
.
selectValue
.
splice
(
i
,
spliceNum
)
this
.
selectItem
.
splice
(
i
,
spliceNum
)
this
.
pickerColumns
.
splice
(
i
,
spliceNum
)
break
}
}
this
.
$emit
(
'
change
'
,
{
value
:
this
.
selectValue
,
item
:
this
.
selectItem
,
index
:
this
.
pickerValue
,
change
:
'
scroll
'
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
@import
"../style/picker-item.scss"
;
</
style
>
components/lb-picker/pickers/selector-picker.vue
0 → 100644
View file @
b61a74f0
<
template
>
<view
class=
"lb-selector-picker lb-picker-item"
:style=
"
{ height: height }">
<picker-view
:value=
"pickerValue"
:style=
"
{ height: height }"
:indicator-style="indicatorStyle"
@change="handleChange">
<picker-view-column>
<view
v-for=
"(item, i) in list"
:class=
"[
'lb-picker-column',
(item[props.value] || item) === selectValue
? 'lb-picker-column-active'
: ''
]"
:key=
"i"
>
<text
class=
"lb-picker-column-label"
>
{{
item
[
props
.
label
]
||
item
}}
</text>
</view>
</picker-view-column>
</picker-view>
</view>
</
template
>
<
script
>
import
{
isObject
}
from
'
../utils
'
import
{
commonMixin
}
from
'
../mixins
'
export
default
{
props
:
{
value
:
[
String
,
Number
],
list
:
Array
,
mode
:
String
,
props
:
Object
,
visible
:
Boolean
,
height
:
String
,
isConfirmChange
:
Boolean
},
mixins
:
[
commonMixin
],
data
()
{
return
{
pickerValue
:
[],
selectValue
:
''
,
selectItem
:
null
}
},
methods
:
{
handleChange
(
item
)
{
const
index
=
item
.
detail
.
value
[
0
]
||
0
this
.
selectItem
=
this
.
list
[
index
]
this
.
selectValue
=
isObject
(
this
.
selectItem
)
?
this
.
selectItem
[
this
.
props
.
value
]
:
this
.
selectItem
this
.
pickerValue
=
item
.
detail
.
value
this
.
$emit
(
'
change
'
,
{
value
:
this
.
selectValue
,
item
:
this
.
selectItem
,
index
:
index
,
change
:
'
scroll
'
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
@import
"../style/picker-item.scss"
;
</
style
>
components/lb-picker/pickers/unlinked-selector-picker.vue
0 → 100644
View file @
b61a74f0
<
template
>
<view
class=
"lb-selector-picker lb-picker-item"
:style=
"
{ height: height }">
<picker-view
:value=
"pickerValue"
:indicator-style=
"indicatorStyle"
:style=
"
{ height: height }"
@change="handleChange">
<picker-view-column
v-for=
"(column, index) in pickerColumns"
:key=
"index"
>
<view
v-for=
"(item, i) in column || []"
:class=
"[
'lb-picker-column',
(item[props.value] || item) === selectValue[index]
? 'lb-picker-column-active'
: ''
]"
:key=
"i"
>
<text
class=
"lb-picker-column-label"
>
{{
item
[
props
.
label
]
||
item
}}
</text>
</view>
</picker-view-column>
</picker-view>
</view>
</
template
>
<
script
>
import
{
isObject
}
from
'
../utils
'
import
{
commonMixin
}
from
'
../mixins
'
export
default
{
props
:
{
value
:
Array
,
list
:
Array
,
mode
:
String
,
props
:
Object
,
visible
:
Boolean
,
height
:
String
,
isConfirmChange
:
Boolean
},
mixins
:
[
commonMixin
],
data
()
{
return
{
pickerValue
:
[],
pickerColumns
:
[],
selectValue
:
[],
selectItem
:
[]
}
},
methods
:
{
handleChange
(
item
)
{
const
pickerValue
=
item
.
detail
.
value
const
columnIndex
=
pickerValue
.
findIndex
((
item
,
i
)
=>
item
!==
this
.
pickerValue
[
i
])
if
(
columnIndex
>
-
1
)
{
const
valueIndex
=
pickerValue
[
columnIndex
]
const
columnItem
=
this
.
list
[
columnIndex
][
valueIndex
]
const
valueItem
=
isObject
(
columnItem
)
?
columnItem
[
this
.
props
.
value
]
:
columnItem
this
.
pickerValue
=
pickerValue
this
.
$set
(
this
.
selectValue
,
columnIndex
,
valueItem
)
this
.
$set
(
this
.
selectItem
,
columnIndex
,
columnItem
)
this
.
$emit
(
'
change
'
,
{
value
:
this
.
selectValue
,
item
:
this
.
selectItem
,
index
:
this
.
pickerValue
,
change
:
'
scroll
'
})
}
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
@import
"../style/picker-item.scss"
;
</
style
>
components/lb-picker/style/picker-item.scss
0 → 100644
View file @
b61a74f0
.lb-picker-column
{
height
:
34px
;
/* #ifndef APP-NVUE */
display
:
flex
;
box-sizing
:
border-box
;
white-space
:
nowrap
;
overflow
:
hidden
;
/* #endif */
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
center
;
}
.lb-picker-column-label
{
font-size
:
16px
;
text-align
:
center
;
text-overflow
:
ellipsis
;
transition-property
:
color
;
transition-duration
:
0
.3s
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
\ No newline at end of file
components/lb-picker/style/picker.scss
0 → 100644
View file @
b61a74f0
.lb-picker
{
position
:
relative
;
}
.lb-picker-mask
{
background-color
:
rgba
(
0
,
0
,
0
,
0
.0
);
position
:
fixed
;
top
:
0
;
right
:
0
;
left
:
0
;
bottom
:
0
;
}
.lb-picker-mask-animation
{
transition-property
:
background-color
;
transition-duration
:
0
.3s
;
}
.lb-picker-container
{
position
:
relative
;
}
.lb-picker-container-fixed
{
position
:
fixed
;
left
:
0
;
right
:
0
;
bottom
:
0
;
transform
:
translateY
(
100%
);
/* #ifndef APP-PLUS */
overflow
:
hidden
;
/* #endif */
}
.lb-picker-container-animation
{
transition-property
:
transform
;
transition-duration
:
0
.3s
;
}
.lb-picker-container-show
{
transform
:
translateY
(
0
);
}
.lb-picker-header
{
position
:
relative
;
height
:
45px
;
background-color
:
#fff
;
/* #ifdef APP-NVUE */
border-bottom-width
:
1px
;
border-bottom-style
:
solid
;
border-bottom-color
:
#e5e5e5
;
border-top-width
:
1px
;
border-top-style
:
solid
;
border-top-color
:
#e5e5e5
;
/* #endif */
/* #ifndef APP-NVUE */
box-sizing
:
border-box
;
display
:
flex
;
/* #endif */
flex-direction
:
row
;
justify-content
:
space-between
;
flex-wrap
:
nowrap
;
}
/* #ifndef APP-PLUS */
.
lb-picker-header
:
:
before
{
content
:
""
;
position
:
absolute
;
left
:
0
;
top
:
0
;
right
:
0
;
height
:
1px
;
clear
:
both
;
border-bottom
:
1px
solid
#e5e5e5
;
color
:
#e5e5e5
;
transform-origin
:
0
100%
;
transform
:
scaleY
(
0
.5
);
}
.
lb-picker-header
:
:
after
{
content
:
""
;
position
:
absolute
;
left
:
0
;
bottom
:
0
;
right
:
0
;
height
:
1px
;
clear
:
both
;
border-bottom
:
1px
solid
#e5e5e5
;
color
:
#e5e5e5
;
transform-origin
:
0
100%
;
transform
:
scaleY
(
0
.5
);
}
/* #endif */
.lb-picker-action
{
padding-left
:
14px
;
padding-right
:
14px
;
/* #ifndef APP-NVUE */
display
:
flex
;
/* #endif */
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
center
;
}
.lb-picker-action-item
{
text-align
:
center
;
height
:
45px
;
/* #ifndef APP-NVUE */
display
:
flex
;
/* #endif */
align-items
:
center
;
}
.lb-picker-action-cancel-text
{
font-size
:
16px
;
color
:
#999
;
}
.lb-picker-action-confirm-text
{
font-size
:
16px
;
color
:
#007aff
;
}
.lb-picker-content
{
position
:
relative
;
background-color
:
#fff
;
/* #ifndef APP-NVUE */
display
:
flex
;
/* #endif */
justify-content
:
center
;
flex-direction
:
column
;
}
.lb-picker-loading
,
.lb-picker-empty
{
/* #ifndef APP-NVUE */
display
:
flex
;
/* #endif */
justify-content
:
center
;
align-items
:
center
;
}
.lb-picker-empty-text
{
color
:
#999
;
font-size
:
16px
;
}
.lb-picker-loading-img
{
width
:
25px
;
height
:
25px
;
/* #ifndef APP-NVUE */
animation
:
rotating
2s
linear
infinite
;
/* #endif */
}
/* #ifndef APP-NVUE */
@keyframes
rotating
{
0
%
{
transform
:
rotate
(
0deg
)
}
to
{
transform
:
rotate
(
1turn
)
}
}
/* #endif */
\ No newline at end of file
components/lb-picker/utils.js
0 → 100644
View file @
b61a74f0
/**
* 判断是否是对象
*
* @export
* @param {*} val
* @returns true/false
*/
export
function
isObject
(
val
)
{
return
Object
.
prototype
.
toString
.
call
(
val
)
===
'
[object Object]
'
}
/**
* 根据value获取columns信息
*
* @export
* @param {*} { value, list, mode, props, level }
* @param {number} [type=2] 查询不到value数据返回数据类型 1空值null 2默认第一个选项
* @returns
*/
export
function
getColumns
({
value
,
list
,
mode
,
props
,
level
},
type
=
2
)
{
let
pickerValue
=
[]
let
pickerColumns
=
[]
let
selectValue
=
[]
let
selectItem
=
[]
let
columnsInfo
=
null
switch
(
mode
)
{
case
'
selector
'
:
let
index
=
list
.
findIndex
(
item
=>
{
return
isObject
(
item
)
?
item
[
props
.
value
]
===
value
:
item
===
value
})
if
(
index
===
-
1
&&
type
===
1
)
{
columnsInfo
=
null
}
else
{
index
=
index
>
-
1
?
index
:
0
selectItem
=
list
[
index
]
selectValue
=
isObject
(
selectItem
)
?
selectItem
[
props
.
value
]
:
selectItem
pickerColumns
=
list
pickerValue
=
[
index
]
columnsInfo
=
{
index
:
pickerValue
,
value
:
selectValue
,
item
:
selectItem
,
columns
:
pickerColumns
}
}
break
case
'
multiSelector
'
:
const
setPickerItems
=
(
data
=
[],
index
=
0
)
=>
{
if
(
!
data
.
length
)
return
const
defaultValue
=
value
||
[]
if
(
index
<
level
)
{
const
value
=
defaultValue
[
index
]
||
''
let
i
=
data
.
findIndex
(
item
=>
item
[
props
.
value
]
===
value
)
if
(
i
===
-
1
&&
type
===
1
)
return
i
=
i
>
-
1
?
i
:
0
pickerValue
[
index
]
=
i
pickerColumns
[
index
]
=
data
if
(
data
[
i
])
{
selectValue
[
index
]
=
data
[
i
][
props
.
value
]
selectItem
[
index
]
=
data
[
i
]
setPickerItems
(
data
[
i
][
props
.
children
]
||
[],
index
+
1
)
}
}
}
setPickerItems
(
list
)
if
(
!
selectValue
.
length
&&
type
===
1
)
{
columnsInfo
=
null
}
else
{
columnsInfo
=
{
index
:
pickerValue
,
value
:
selectValue
,
item
:
selectItem
,
columns
:
pickerColumns
}
}
break
case
'
unlinkedSelector
'
:
list
.
forEach
((
item
,
i
)
=>
{
let
index
=
item
.
findIndex
(
item
=>
{
return
isObject
(
item
)
?
item
[
props
.
value
]
===
value
[
i
]
:
item
===
value
[
i
]
})
if
(
index
===
-
1
&&
type
===
1
)
return
index
=
index
>
-
1
?
index
:
0
const
columnItem
=
list
[
i
][
index
]
const
valueItem
=
isObject
(
columnItem
)
?
columnItem
[
props
.
value
]
:
columnItem
pickerValue
[
i
]
=
index
selectValue
[
i
]
=
valueItem
selectItem
[
i
]
=
columnItem
})
pickerColumns
=
list
if
(
!
selectValue
.
length
&&
type
===
1
)
{
columnsInfo
=
null
}
else
{
columnsInfo
=
{
index
:
pickerValue
,
value
:
selectValue
,
item
:
selectItem
,
columns
:
pickerColumns
}
}
break
}
return
columnsInfo
}
components/plan-image-upload/up_img.vue
View file @
b61a74f0
...
...
@@ -355,9 +355,11 @@
.imageItem
,
.imageUpload
{
width
:
200
upx
;
height
:
200
upx
;
margin
:
30
upx
15
upx
30
upx
;
margin
:
0
20
upx
30
upx
0
;
}
.imageItem
:nth-child
(
3n
)
{
margin-right
:
0
!important
;
}
.imageDel
{
position
:
relative
;
left
:
180
upx
;
...
...
components/showxieyi/showxieyi.vue
View file @
b61a74f0
...
...
@@ -42,7 +42,6 @@
},
//提示弹窗
change
(
e
)
{
console
.
log
(
'
是否打开:
'
+
e
.
show
)
if
(
!
e
.
show
)
{
this
.
showtip
=
false
}
...
...
components/yomol-upgrade/yomol-upgrade.vue
View file @
b61a74f0
...
...
@@ -159,8 +159,6 @@
},
//监测更新 夫组件调用的方法
checkVersionClick
()
{
console
.
info
(
"
更新检测
"
);
//直接不直接 苹果不做更新
if
(
uni
.
getSystemInfoSync
().
platform
==
'
ios
'
){
return
false
;
...
...
@@ -215,9 +213,7 @@
let
appVersion
=
parseFloat
(
str1
);
//当前版本
let
nesVersion
=
parseFloat
(
result
.
data
.
data
.
version
);
//最新版本
console
.
log
(
appVersion
,
nesVersion
)
if
(
nesVersion
>
appVersion
)
{
if
(
result
.
data
.
data
.
pkgurl
!=
''
&&
result
.
data
.
data
.
downloadurl
==
''
)
{
this
.
type
=
"
pkg
"
;
...
...
main.js
View file @
b61a74f0
...
...
@@ -5,6 +5,8 @@ import http from './common/axios.js'
import
store
from
'
./store
'
//状态管理
import
LbPicker
from
'
@/components/lb-picker
'
Vue
.
component
(
"
lb-picker
"
,
LbPicker
)
import
{
getTimeOut
,
timestampToTime
,
//10位时间戳 转年月日时分秒
...
...
manifest.json
View file @
b61a74f0
...
...
@@ -3,8 +3,8 @@
//
"appid"
:
"__UNI__FC9419E"
,
"appid"
:
"__UNI__1EA80F1"
,
//这个是
web
的
"description"
:
""
,
"versionName"
:
"1.0.7
3
"
,
"versionCode"
:
17
3
,
"versionName"
:
"1.0.7
6
"
,
"versionCode"
:
17
6
,
"transformPx"
:
false
,
/*
5
+App特有相关
*/
"app-plus"
:
{
...
...
pages/addEditEleProduct/addEditEleProduct.vue
View file @
b61a74f0
...
...
@@ -44,12 +44,18 @@
</view>
<view
class=
"sort flex ali-c "
>
<view
class=
"name"
>
分类
</view>
<picker
@
change=
"bindPickerChange"
name=
"parent_id"
:value=
"index"
:range=
"chindformList"
range-key=
"cate_name"
>
<view
class=
"inputs"
>
<input
type=
"text"
disabled=
"disabled"
value=
""
v-model=
"cate_name"
class=
"inpus"
/>
<image
class=
"imgs"
src=
"/static/news/xiamassfd.png"
mode=
""
></image>
<!--
<picker
@
change=
"bindPickerChange"
name=
"parent_id"
:value=
"index"
:range=
"chindformList"
range-key=
"cate_name"
>
<view
class=
"inputs"
>
<view
class=
""
style=
"padding-left: 15upx;"
>
{{
cate_name
}}
</view>
</view>
</picker>
-->
<view
class=
"inputs"
@
tap=
'pickerone'
>
<view
class=
""
style=
"padding-left: 15upx;"
>
{{
cate_name
}}
</view>
</view>
</picker>
<lb-picker
ref=
"picker"
:list=
"chindformList"
:value=
'index'
range-key=
"label"
:props=
"myProps"
@
confirm=
'confirm'
></lb-picker>
</view>
</view>
...
...
@@ -93,6 +99,10 @@
},
data
()
{
return
{
myProps
:
{
label
:
'
cate_name
'
,
value
:
'
cate_id
'
,
},
name
:
'
product
'
,
form
:
{
picker_custom2
:
{},
...
...
@@ -155,6 +165,17 @@
this
.
typeManagerfun
();
},
methods
:
{
confirm
(
e
){
console
.
log
(
e
)
// this.parent_name=e.item.value;
// this.canform.cate_id=;
this
.
cate_name
=
e
.
item
.
cate_name
;
this
.
form
.
cate_id
=
e
.
item
.
cate_id
;
this
.
index
=
e
.
index
;
},
pickerone
(){
this
.
$refs
.
picker
.
show
()
// 显示
},
//分类选中
bindPickerChange
(
e
){
// cate_name
...
...
@@ -247,7 +268,7 @@
can
.
is_hot
=
0
;
}
//can.cate_id = this.chindformList[res.data.custom.value].cate_id;//分类id
if
(
this
.
c_pics
.
length
!=
0
){
can
.
photo
=
this
.
c_pics
[
0
].
data
;
//上传的图片
...
...
pages/addhotel/addProjuct.scss
View file @
b61a74f0
...
...
@@ -253,7 +253,6 @@
.sort
{
padding
:
0
20upx
;
height
:
104upx
;
line-height
:
104upx
;
.name
{
font-size
:
30upx
;
color
:rgba
(
0
,
0
,
0
,
1
)
;
...
...
@@ -265,6 +264,7 @@
margin-left
:
20upx
;
width
:
296upx
;
height
:
60upx
;
line-height
:
60upx
;
.inpus
{
width
:
296upx
;
height
:
60upx
;
...
...
pages/addhotel/addhotel.vue
View file @
b61a74f0
...
...
@@ -56,23 +56,26 @@
</view>
<view
class=
"sort flex ali-c "
>
<view
class=
"name"
>
剩余房间
</view>
<view
class=
"inputs "
>
<input
type=
"number"
value=
""
v-model=
"parameter.sku"
placeholder=
"请输入数字"
class=
"inpus"
/>
<!--
<image
class=
"imgs"
src=
"/static/news/xiamassfd.png"
mode=
""
></image>
-->
</view>
</view>
<view
class=
"sort flex ali-c "
>
<view
class=
"name"
>
房间类型
</view>
<picker
@
change=
"bindPickerChange1"
name=
"type"
:value=
"isclassval"
:range=
"typeList"
range-key=
"name"
>
<view
class=
"inputs"
>
<input
type=
"text"
disabled=
"disabled"
value=
""
v-model=
"cate_name"
class=
"inpus"
/>
<image
class=
"imgs"
src=
"/static/news/xiamassfd.png"
mode=
""
></image>
<!--
<picker
@
change=
"bindPickerChange1"
name=
"type"
:value=
"index"
:range=
"typeList"
range-key=
"name"
>
<view
class=
"inputs"
>
<view
class=
""
style=
"padding-left: 15upx;"
>
{{
cate_name
}}
</view>
</view>
</picker>
-->
<view
class=
"inputs"
@
tap=
'pickerone'
>
<view
class=
""
style=
"padding-left: 15upx;"
>
{{
cate_name
}}
</view>
</view>
</picker>
<lb-picker
ref=
"picker"
:list=
"typeList"
:value=
'index'
range-key=
"name"
:props=
"myProps"
@
confirm=
'bindPickerChange1'
></lb-picker>
</view>
...
...
@@ -99,9 +102,12 @@
},
data
()
{
return
{
isclassval
:
0
,
//分类的vlaue
myProps
:
{
label
:
'
name
'
,
value
:
'
cate_id
'
,
},
index
:
0
,
//分类的vlaue
title
:
""
,
//产品标题
index
:
0
,
imageData
:
[],
is_data
:[],
//三个多选的值
specslist
:[
1
],
...
...
@@ -164,13 +170,22 @@
this
.
roomType
();
},
methods
:{
pickerone
(){
this
.
$refs
.
picker
.
show
()
// 显示
},
bindPickerChange1
(
e
){
//选择分类
console
.
log
(
e
)
this
.
cate_name
=
e
.
item
.
name
;
this
.
parameter
.
type
=
e
.
item
.
id
;
this
.
index
=
e
.
index
;
},
//查询修改的信息原有的信息
async
getroomInfo
(){
let
res
=
await
roomInfo
({
room_id
:
this
.
room_id
,
});
if
(
res
.
code
==
0
){
console
.
log
(
res
)
this
.
parameter
=
{
action
:
"
edit
"
,
// add添加,edit修改
//酒店的信息
...
...
@@ -187,13 +202,9 @@
this
.
c_pics
=
[{
code
:
0
,
data
:
res
.
data
.
photo
,
msg
:
"
success
"
,
time
:
"
1587802940
"
,}];
//模拟上传图片的数据
this
.
c_photos
=
[
res
.
data
.
photo
];
// listchind:[
// {name:"是否有早餐",value:"1"},
// {name:"是否有款第",value:"2"},
// {name:"是否可取消",value:"3"},
// // {name:"是否推荐",value:"4"},
// ],
if
(
this
.
room_id
!=
''
){
//发布新酒店
this
.
cate_name
=
res
.
data
.
roomType
;
}
let
isarr
=
[];
//早餐
...
...
@@ -226,19 +237,22 @@
},
// 获取商城商品分类
async
roomType
(){
let
res
=
await
hotelroomType
({
})
let
res
=
await
hotelroomType
({});
let
arr
=
[];
for
(
let
i
in
res
.
data
){
arr
.
push
({
name
:
res
.
data
[
i
],
id
:
i
});
}
this
.
typeList
=
arr
;
//分类列表
this
.
cate_name
=
this
.
typeList
[
0
].
name
;
this
.
parameter
.
type
=
this
.
typeList
[
0
].
id
;
if
(
this
.
room_id
==
''
){
//发布新酒店
this
.
parameter
.
type
=
this
.
typeList
[
0
].
id
;
this
.
cate_name
=
this
.
typeList
[
0
].
name
;
}
else
{
//修改信息
console
.
log
(
this
.
room_id
)
}
},
initdata
(){
this
.
parameter
=
{
...
...
@@ -302,13 +316,7 @@
this
.
is_data
=
e
.
detail
.
value
;
},
//分类监听
bindPickerChange1
(
e
){
this
.
parameter
.
type
=
this
.
typeList
[
e
.
detail
.
value
].
id
;
this
.
isclassval
=
e
.
detail
.
value
;
this
.
cate_name
=
this
.
typeList
[
e
.
detail
.
value
].
name
;
},
//图片上传
c_delImage
(
e
)
{
...
...
pages/edit/pro_manage/pro_manage.scss
View file @
b61a74f0
...
...
@@ -29,11 +29,19 @@
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
width
:
2
5%
;
width
:
2
10upx
;
// height: 100%;
height
:
256upx
;
vertical-align
:
middle
;
}
.pic2
{
position
:
absolute
;
width
:
100%
;
height
:
100%
;
background
:rgba
(
0
,
0
,
0
,
0
.5
)
;
color
:
#fff
;
font-size
:
32upx
;
}
.pic
.img
{
width
:
100%
;
...
...
pages/edit/pro_manage/pro_manage.vue
View file @
b61a74f0
...
...
@@ -8,9 +8,11 @@
<view>
<view
class=
"one"
>
<block
v-for=
"(item,index) in goodsListdata"
:key=
"index"
>
<!-- v-if="item.state!=current" -->
<view
class=
"container"
>
<view
class=
"pic"
><image
mode=
"aspectFit"
class=
"img"
:src=
"staticUrl+item.photo"
></image></view>
<view
class=
"pic"
style=
"position: relative;border-radius: 10upx;overflow: hidden;"
>
<image
mode=
"aspectFit"
class=
"img"
:src=
"staticUrl+item.photo"
></image>
<view
class=
"flex-wrap ali-c jus-c pic2"
v-if=
'item.audit==0'
>
审核中
</view>
</view>
<view
class=
"desc"
>
<view
class=
"title"
>
<view
class=
'title_l'
>
{{
item
.
title
}}
</view>
...
...
@@ -26,7 +28,7 @@
<view
class=
"btn_01"
@
tap=
"pushfun(item,index)"
v-if=
"current==1"
>
上架
</view>
<view
class=
"btn_01"
@
tap=
"delfun(item,index)"
>
删除
</view>
<view
class=
"btn_01"
@
click=
"setSpecs(item.goods_id)"
>
规格
</view>
<view
class=
"btn_01
"
@
tap=
"Selectiondata(item)"
v-if=
"current==0 && isselect==1"
>
加入活动
</view>
<view
class=
"btn_01
"
@
tap=
"Selectiondata(item)"
v-if=
"current==0 && isselect==1"
>
加入活动
</view>
</view>
</view>
</view>
...
...
pages/edit/product/addProjuct.scss
View file @
b61a74f0
...
...
@@ -257,7 +257,6 @@
.sort
{
padding
:
0
20upx
;
height
:
104upx
;
line-height
:
104upx
;
.name
{
font-size
:
30upx
;
color
:rgba
(
0
,
0
,
0
,
1
)
;
...
...
@@ -269,6 +268,7 @@
margin-left
:
20upx
;
width
:
296upx
;
height
:
60upx
;
line-height
:
60upx
;
.inpus
{
width
:
296upx
;
height
:
60upx
;
...
...
pages/edit/product/addshop.vue
View file @
b61a74f0
...
...
@@ -29,19 +29,25 @@
</view>
</view>
<view
class=
"sort flex ali-c "
>
<view
class=
"name"
>
分类
</view>
<picker
@
change=
"bindPickerChange"
name=
"parent_id"
:value=
"index"
:range=
"goodsCate"
range-key=
"value"
>
<view
class=
"inputs"
>
<input
type=
"text"
disabled=
"disabled"
value=
""
v-model=
"cate_name"
class=
"inpus"
/>
<image
class=
"imgs"
src=
"/static/news/xiamassfd.png"
mode=
""
></image>
</view>
<view
class=
"name"
>
分类
</view>
<!--
<picker
@
change=
"bindPickerChange"
name=
"parent_id"
:value=
"index"
:range=
"goodsCate"
range-key=
"value"
>
<view
class=
"inputs"
>
<input
type=
"text"
disabled=
"disabled"
value=
""
v-model=
"cate_name"
class=
"inpus"
/>
</view>
</picker>
<picker
@
change=
"bindPickerss"
name=
"cate_id"
:value=
"index"
:range=
"datachind"
range-key=
"value"
>
<view
class=
"inputs inputs1"
>
<view
class=
"inputs inputs1"
>
<input
type=
"text"
disabled=
"disabled"
value=
""
v-model=
"parent_name"
class=
"inpus"
/>
</view>
</picker>
-->
<view
class=
"inputs"
@
tap=
'pickerone'
>
<input
type=
"text"
disabled=
"disabled"
v-model=
"cate_name"
class=
"inpus"
/>
</view>
<view
class=
"inputs inputs1"
@
tap=
'pickertow'
>
<input
type=
"text"
disabled=
"disabled"
value=
""
v-model=
"parent_name"
class=
"inpus"
/>
<image
class=
"imgs"
src=
"/static/news/xiamassfd.png"
mode=
""
></image>
</view>
</picker>
<lb-picker
ref=
"picker"
:list=
"goodsCate"
:value=
'cate_name'
range-key=
"label"
:props=
"myProps"
@
confirm=
'confirm'
></lb-picker>
<lb-picker
ref=
"picker1"
:list=
"datachind"
:value=
'parent_name'
range-key=
"label"
:props=
"myProps1"
@
confirm=
'confirm1'
></lb-picker>
</view>
</view>
<!-- end -->
...
...
@@ -115,7 +121,7 @@
<textarea
class=
"textarea"
v-model=
"canform.details"
placeholder=
"请输入商品详情"
/>
</view>
-->
<!--
<jinedit
ref=
"jinedit"
placeholder=
"请输入内容"
@
editOk=
"editOk"
uploadFileUrl=
"/#"
></jinedit>
-->
<view
class=
"addmigs pt0s"
>
<jinedit
ref=
"jinedit"
placeholder=
"请输入商品详情内容"
@
editOk=
"editOk"
fileKeyName=
"img"
:uploadFileUrl=
"uploadurl1+'/merchant.php/FileUpload/uploadify'"
></jinedit>
...
...
@@ -173,6 +179,14 @@
},
data
()
{
return
{
myProps
:
{
label
:
'
value
'
,
value
:
'
cate_id
'
,
},
myProps1
:
{
label
:
'
value
'
,
value
:
'
cate_id
'
,
},
title
:
""
,
//产品标题
imageData
:
[],
//主图
imageData1
:[],
//详情图
...
...
@@ -244,8 +258,7 @@
return
obj
;
}
},
onLoad
(
opdata
)
{
onLoad
(
opdata
)
{
if
(
opdata
.
id
!=
""
&&
opdata
.
id
!=
undefined
){
this
.
canform
.
goods_id
=
opdata
.
id
;
//修改的商品id
this
.
canform
.
action
=
"
edit
"
;
...
...
@@ -260,6 +273,22 @@
this
.
goods_type
();
},
methods
:{
confirm
(
e
){
console
.
log
(
e
)
this
.
cate_name
=
e
.
item
.
value
;
this
.
datachind
=
e
.
item
.
children
;
//二级分类
},
confirm1
(
e
){
console
.
log
(
e
)
this
.
parent_name
=
e
.
item
.
value
;
this
.
canform
.
cate_id
=
e
.
item
.
cate_id
;
},
pickerone
(){
this
.
$refs
.
picker
.
show
()
// 显示
},
pickertow
(){
this
.
$refs
.
picker1
.
show
()
// 显示
},
//获取原来的商品详情信息
async
goodsDetailsfun
(){
let
res
=
await
goodsDetails
({
...
...
@@ -462,20 +491,20 @@
this
.
selchildList
=
e
.
detail
.
value
;
},
// 改变下拉选项 一级的
bindPickerChange
(
event
)
{
//
console.info(event.detail.value);
this
.
parent_name
=
""
;
this
.
canform
.
cate_id
=
""
;
this
.
cate_name
=
this
.
goodsCate
[
event
.
detail
.
value
].
value
;
this
.
datachind
=
this
.
goodsCate
[
event
.
detail
.
value
].
children
;
//二级的数据据
//
bindPickerChange (event) {
//
console.info(event.detail.value);
//
this.parent_name = "";
//
this.canform.cate_id = "";
//
this.cate_name = this.goodsCate[event.detail.value].value;
//
this.datachind = this.goodsCate[event.detail.value].children;//二级的数据据
},
//二级分类选中后处理
bindPickerss
(
event
)
{
// console.log(event.detail.value);
this
.
parent_name
=
this
.
datachind
[
event
.
detail
.
value
].
value
;
this
.
canform
.
cate_id
=
this
.
datachind
[
event
.
detail
.
value
].
cate_id
;
//分类id
},
//
},
//
//
二级分类选中后处理
//
bindPickerss (event) {
//
// console.log(event.detail.value);
//
this.parent_name = this.datachind[event.detail.value].value;
//
this.canform.cate_id = this.datachind[event.detail.value].cate_id;//分类id
//
},
//图片上传
c_delImage
(
e
)
{
let
arr
=
[]
...
...
pages/edit/shop/shop.vue
View file @
b61a74f0
...
...
@@ -10,7 +10,7 @@
<view
class=
"biao"
>
<view
class=
"cu-form-group "
>
<view
class=
"title"
>
联系人:
</view>
<view
class=
"title"
style=
"letter-spacing:10upx;"
>
联系人:
</view>
<input
class=
"title"
style=
"flex-grow: 1;"
placeholder=
"请输入联系人"
disabled=
"disabled"
v-model=
"fromdata.contact"
></input>
</view>
<view
class=
"cu-form-group "
>
...
...
pages/eleProduct/eleProduct.vue
View file @
b61a74f0
...
...
@@ -40,7 +40,6 @@
<view
class=
"btns btnboxdel"
@
tap=
"tochanges(item,index)"
>
修 改
</view>
</view>
</view>
<!--
<video
src=
""
controls
></video>
-->
</checkbox-group>
</view>
...
...
pages/login/login.vue
View file @
b61a74f0
...
...
@@ -122,8 +122,6 @@
};
},
onShow
()
{
//获取之前记录的密码
let
username
=
uni
.
getStorageSync
(
"
username
"
);
let
password
=
uni
.
getStorageSync
(
"
password
"
);
...
...
@@ -142,9 +140,11 @@
}
},
onLoad
()
{
//处理 协议 按钮
let
istongyi
=
uni
.
getStorageSync
(
'
istongyi
'
);
console
.
info
(
istongyi
);
if
(
istongyi
){
if
(
istongyi
==
true
||
istongyi
==
"
true
"
){
this
.
isAgree
=
true
;
//获取之前同意过的状态
...
...
@@ -234,8 +234,6 @@
this
.
$api
.
msg
(
res
);
if
(
res
.
code
==
0
){
console
.
info
(
res
.
data
.
store
.
length
);
//记住密码
if
(
this
.
ischecked
==
true
){
...
...
pages/setup/setup.vue
View file @
b61a74f0
...
...
@@ -88,14 +88,14 @@
<!-- 升级组件 -->
<moduPopup
ref=
"moduPopup"
title=
"
确认要关闭店铺吗?
"
infotext=
"你确认要关闭店铺吗?关闭后余额将会自动转到佣金"
@
confirm=
"todeleteStore"
@
cancel=
"gdcancel"
></moduPopup>
<moduPopup
ref=
"moduPopup"
title=
"
关闭店铺
"
infotext=
"你确认要关闭店铺吗?关闭后余额将会自动转到佣金"
@
confirm=
"todeleteStore"
@
cancel=
"gdcancel"
></moduPopup>
<!-- 提示信息组件 关店的-->
<moduPopup
ref=
"moduPopupTwo"
title=
"
确认要退出登录吗?
"
infotext=
"确认要退出登录吗~"
@
confirm=
"toLogout"
@
cancel=
"gdcancel"
></moduPopup>
<moduPopup
ref=
"moduPopupTwo"
title=
"
退出登录
"
infotext=
"确认要退出登录吗~"
@
confirm=
"toLogout"
@
cancel=
"gdcancel"
></moduPopup>
<!-- 提示信息组件 退出登录-->
<moduPopup
ref=
"cleanstoreone"
title=
"
确认要清除缓存吗?
"
infotext=
"清除缓存后你的账号将会退出~"
@
confirm=
"cleanstore"
@
cancel=
"gdcancel"
></moduPopup>
<moduPopup
ref=
"cleanstoreone"
title=
"
清除缓存
"
infotext=
"清除缓存后你的账号将会退出~"
@
confirm=
"cleanstore"
@
cancel=
"gdcancel"
></moduPopup>
<!-- 提示信息组件 清除缓存-->
</view>
...
...
@@ -121,8 +121,6 @@
},
onLoad
()
{
this
.
getv
();
console
.
info
(
this
.
version
);
this
.
storeEleInfofun
();
//查询外卖店铺详情信息
},
computed
:{
...
...
@@ -157,9 +155,7 @@
//查询外卖店铺详情信息
async
storeEleInfofun
(){
let
res
=
await
storeEleInfo
({
});
let
res
=
await
storeEleInfo
({});
if
(
res
.
data
==
null
){
this
.
isshowdy
=
false
;
return
false
;
...
...
@@ -252,8 +248,6 @@
this
.
$store
.
dispatch
(
'
AudioVoice
'
,
`已
${
statusTip
}
语音提示`
).
then
((
e
)
=>
{
console
.
log
(
e
);
console
.
info
(
"
循环消息列表2
"
);
//震动 调用//400ms//长震动
uni
.
vibrateLong
({
success
:(
re
)
=>
{
...
...
@@ -263,17 +257,12 @@
})
})
//console.info(e.detail.value,"e.detail.value ");
this
.
$store
.
commit
(
"
changeisvoice
"
,
e
.
detail
.
value
);
//直接修改 双向绑定的
},
//店铺打烊
switchChangetwo
(
e
){
console
.
info
(
e
.
detail
.
value
,
"
打烊修改
"
);
//is_open 是否打烊(0默认打烊,1营业)
let
is_open
=
e
.
detail
.
value
?
0
:
1
;
storeOpenEle
({
is_open
:
is_open
,
}).
then
((
res
)
=>
{
...
...
static/news/helloword.png
View replaced file @
6f07bab5
View file @
b61a74f0
144 KB
|
W:
|
H:
511 KB
|
W:
|
H:
2-up
Swipe
Onion skin
static/news/yanhua.png
0 → 100644
View file @
b61a74f0
34.1 KB
utils/debug.js
View file @
b61a74f0
...
...
@@ -2,11 +2,11 @@
//环境变量 这个是 鹿马商家助手的 商家助手的~~~~
module
.
exports
=
{
//是否为开发调试环境 true为本地环境 false 为正式环境
//isdebug:true,//测试
//
isdebug:true,//测试
isdebug
:
false
,
//正式
xqdebug
:
false
,
//正式权限
//
xqdebug:true,//发布审核权限 也是测试环境的 主要用于ios
xqdebug
:
false
,
//正式权限
//xqdebug:true,//发布审核权限 也是测试环境的 主要用于ios
// #ifdef APP-PLUS
// isdebug:false,//正式 APP里面绝对是正式
...
...
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