Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-boutique-work-wechat
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 074fb524
authored
Mar 14, 2023
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
选择门店 添加搜索 超管登录拿所有4s店
1 parent
aed5b7e6
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
234 additions
and
27 deletions
packageEquity/components/storePicker/storePicker.js
packageEquity/components/storePicker/storePicker.json
packageEquity/components/storePicker/storePicker.wxml
packageEquity/components/storePicker/storePicker.wxss
packageEquity/pages/TabBar/equityPage.js
packageEquity/pages/TabBar/equityPage.json
packageEquity/pages/TabBar/equityPage.wxml
pages/accountItems/accountItems.js
store/index.js
packageEquity/components/storePicker/storePicker.js
0 → 100644
View file @
074fb52
// packageEquity/components/storePicker/storePicker.js
Component
({
options
:
{
// 在组件定义时的选项中启用多slot支持
multipleSlots
:
true
},
/**
* 组件的属性列表
*/
properties
:
{
items
:
{
type
:
Array
,
value
:
[],
observer
:
function
(
n
)
{
if
(
n
)
{
let
userInfo
=
wx
.
$util
.
getUserInfo
()
let
defaultSelectStoreIndex
=
n
?.
findIndex
(
v
=>
{
return
v
.
merchantId
==
userInfo
?.
default4SStoreInfo
?.
merchantId
})
>
-
1
?
n
?.
findIndex
(
v
=>
{
return
v
.
merchantId
==
userInfo
?.
default4SStoreInfo
?.
merchantId
})
:
0
this
.
setData
({
defaultSelectStoreIndex
:
[
defaultSelectStoreIndex
],
selectStoreIndex
:
defaultSelectStoreIndex
})
}
}
},
show
:
{
type
:
Boolean
,
}
},
/**
* 组件的初始数据
*/
data
:
{
searchValue
:
''
,
selectStoreIndex
:
''
,
edit
:
false
,
defaultSelectStoreIndex
:
[]
},
/**
* 组件的方法列表
*/
methods
:
{
open
()
{
if
(
this
.
data
.
disabled
)
return
this
.
setData
({
edit
:
true
,
inputFocus
:
true
})
},
setValue
(
value
)
{
if
(
this
.
properties
.
filterEmoji
)
{
if
(
wx
.
$util
.
haveEmoji
(
value
))
value
=
wx
.
$util
.
replaceEmoji
(
value
)
}
this
.
setData
({
searchValue
:
value
})
},
input
(
e
)
{
let
{
value
}
=
e
.
detail
this
.
setValue
(
value
)
this
.
triggerEvent
(
'input'
,
{
value
})
},
inputBlur
(
e
)
{
this
.
emit
(
e
)
},
inputConfifm
(
e
)
{
this
.
emit
(
e
)
},
emit
(
e
)
{
let
{
detail
:{
value
},
type
}
=
e
this
.
setData
({
edit
:
false
})
this
.
setValue
(
value
)
this
.
triggerEvent
(
type
==
'confirm'
?
'search'
:
'blur'
,
{
value
})
},
confirm
()
{
let
{
selectStoreIndex
,
items
}
=
this
.
data
if
(
!
items
.
length
)
{
return
wx
.
$util
.
showToast
(
'请选择门店'
)
}
this
.
triggerEvent
(
'confirm'
,
selectStoreIndex
)
this
.
setData
({
show
:
false
})
},
changeStore
(
e
)
{
console
.
log
(
e
)
this
.
setData
({
selectStoreIndex
:
e
.
detail
.
value
})
}
}
})
packageEquity/components/storePicker/storePicker.json
0 → 100644
View file @
074fb52
{
"component"
:
true
,
"usingComponents"
:
{}
}
\ No newline at end of file
\ No newline at end of file
packageEquity/components/storePicker/storePicker.wxml
0 → 100644
View file @
074fb52
<!--packageEquity/components/storePicker/storePicker.wxml-->
<popup class="date-background" show="{{show}}" bindconfirm="confirm" height="45%">
<view class='date-container'>
<view class='date-confirm'>
<view class="search-box">
<view class="search-input">
<block wx:if="{{!edit}}">
<view class="input {{searchValue?'':'placeholder'}}" bindtap="open">
<block wx:if="{{searchValue}}">
{{searchValue}}
</block>
<block wx:else>
<image src="../../../images/search.png" class="icon"></image>
{{'请输入门店'}}
</block>
</view>
</block>
<block wx:else>
<input type="text" class="input" value='{{searchValue}}' focus='{{inputFocus}}' confirm-type="search" bindinput='input' bindblur="inputBlur" bindconfirm="inputConfifm"/>
</block>
</view>
</view>
</view>
<view class="picker-box">
<picker-view class="picker" value="{{defaultSelectStoreIndex}}" indicator-class="indicator" bindchange="changeStore" bindpickend="dateDone">
<picker-view-column>
<block wx:for="{{items}}" wx:key="merchantId">
<view class="view pickViewColumn">{{item.merchantName}}</view>
</block>
</picker-view-column>
</picker-view>
</view>
</view>
</popup>
packageEquity/components/storePicker/storePicker.wxss
0 → 100644
View file @
074fb52
/* packageEquity/components/storePicker/storePicker.wxss */
.search-box {
height: 104rpx;
display: flex;
align-items: center;
justify-content: center;
margin: 0 32rpx;
font-size: 28rpx;
}
.search-box .search-input {
width: 686rpx;
height: 72rpx;
background: #F7F8FA;
border-radius: 38rpx;
color: #333;
}
.search-input .input{
display: flex;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
text-align: center;
}
.search-input .icon{
width: 28rpx;
height: 28rpx;
margin-right: 10rpx;
}
.search-input .placeholder{
color: #C8C9CC;
}
.date-confirm {
display: flex;
justify-content: center;
align-items: center;
padding:0 20rpx;
font-size:34rpx;
line-height: 70rpx;
}
.picker-box{
height: 450rpx;
display: flex;
}
.picker-box .picker{
width: 100%;
}
.tbn_class{
font-size: 26rpx;
color: #333;
}
.pickViewColumn{
text-align: center;
line-height: 34px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
\ No newline at end of file
\ No newline at end of file
packageEquity/pages/TabBar/equityPage.js
View file @
074fb52
...
@@ -18,21 +18,36 @@ Page({
...
@@ -18,21 +18,36 @@ Page({
tabIndex
:
0
,
tabIndex
:
0
,
pageShow
:
[
true
,
false
],
pageShow
:
[
true
,
false
],
navBarHeight
:
0
,
navBarHeight
:
0
,
subIndex
:
0
showPicker
:
false
,
userInfo
:
{},
selectStroeIndex
:
0
},
},
init
(
userInfo
)
{
init
(
userInfo
)
{
// 获取园区店下的4s店数据
this
.
setData
({
userInfo
})
get4SStoreList
({
yqMerchantId
:
userInfo
?.
merchantId
}).
then
(
result
=>
{
this
.
getStoreList
()
let
{
subIndex
}
=
this
.
data
},
subIndex
=
userInfo
?.
default4SStoreInfo
?.
merchantId
?
result
?.
findIndex
(
v
=>
{
return
v
.
merchantId
==
userInfo
?.
default4SStoreInfo
?.
merchantId
})
:
0
getStoreList
(
e
)
{
// 获取园区店下的4s店数据 超管拉全部数据
let
{
userInfo
}
=
this
.
data
get4SStoreList
({
yqMerchantId
:
userInfo
?.
isSuper
?
''
:
userInfo
?.
merchantId
,
merchantName
:
e
?.
detail
.
value
}).
then
(
result
=>
{
userInfo
=
wx
.
$util
.
getUserInfo
()
let
selectStroeIndex
=
result
?.
findIndex
(
v
=>
{
return
v
.
merchantId
==
userInfo
?.
default4SStoreInfo
?.
merchantId
})
>
-
1
?
result
?.
findIndex
(
v
=>
{
return
v
.
merchantId
==
userInfo
?.
default4SStoreInfo
?.
merchantId
})
:
0
this
.
setData
({
this
.
setData
({
storeListRange
:
result
,
storeListRange
:
result
,
subIndex
userInfo
,
selectStroeIndex
})
})
}).
catch
(
err
=>
{})
}).
catch
(
err
=>
{})
},
},
showStorePicker
()
{
this
.
setData
({
showPicker
:
true
,
})
},
changeTabBar
(
e
)
{
changeTabBar
(
e
)
{
let
{
let
{
pageShow
pageShow
...
@@ -60,21 +75,14 @@ Page({
...
@@ -60,21 +75,14 @@ Page({
},
},
changePicker
(
e
)
{
changePicker
(
e
)
{
let
{
value
}
=
e
.
detail
let
{
storeListRange
,
selectStroeIndex
}
=
this
.
data
let
{
storeListRange
,
subIndex
}
=
this
.
data
let
value
=
e
.
detail
||
selectStroeIndex
let
default4SStoreInfo
=
storeListRange
[
value
]
let
default4SStoreInfo
=
storeListRange
[
value
]
subIndex
=
value
this
.
setData
({
subIndex
})
wx
.
$util
.
setUserInfo
({...
wx
.
$util
.
getUserInfo
(),
default4SStoreInfo
})
wx
.
$util
.
setUserInfo
({...
wx
.
$util
.
getUserInfo
(),
default4SStoreInfo
})
this
.
selectComponent
(
'#page-0'
).
onLoad
&&
this
.
selectComponent
(
'#page-0'
).
onLoad
()
this
.
selectComponent
(
'#page-0'
).
onLoad
&&
this
.
selectComponent
(
'#page-0'
).
onLoad
()
this
.
selectComponent
(
'#page-1'
).
onLoad
&&
this
.
selectComponent
(
'#page-1'
).
onLoad
()
this
.
selectComponent
(
'#page-1'
).
onLoad
&&
this
.
selectComponent
(
'#page-1'
).
onLoad
()
this
.
tapPicker
()
},
tapPicker
()
{
this
.
setData
({
this
.
setData
({
moveArrow
:
!
this
.
data
.
moveArrow
userInfo
:
{...
wx
.
$util
.
getUserInfo
(),
default4SStoreInfo
}
})
})
},
},
back
()
{
back
()
{
...
...
packageEquity/pages/TabBar/equityPage.json
View file @
074fb52
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
"usingComponents"
:
{
"usingComponents"
:
{
"custom-tabBar"
:
"/components/CustomTabBar/CustomTabBar"
,
"custom-tabBar"
:
"/components/CustomTabBar/CustomTabBar"
,
"quotation-list"
:
"../carQuotation/index/index"
,
"quotation-list"
:
"../carQuotation/index/index"
,
"equity-list"
:
"../carEquity/components/EquityList/EquityList"
"equity-list"
:
"../carEquity/components/EquityList/EquityList"
,
"store-picker"
:
"../../components/storePicker/storePicker"
},
},
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
}
}
packageEquity/pages/TabBar/equityPage.wxml
View file @
074fb52
<!-- pages/equity/index.wxml -->
<!-- pages/equity/index.wxml -->
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showMenu="{{true}}" bindback="back">
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showMenu="{{true}}" bindback="back">
<picker range="{{storeListRange}}" value="{{subIndex}}" range-key="merchantName" bindchange="changePicker" bindtap="tapPicker" bindcancel="tapPicker" disabled="{{storeListRange.length < 2}}">
<view class="navigation-title" bindtap="showStorePicker">
<view class="navigation-title">
<view class="navigation-title-text text-hide">{{userInfo && userInfo.default4SStoreInfo && userInfo.default4SStoreInfo.merchantName}}</view>
<view class="navigation-title-text text-hide">{{storeListRange[subIndex].merchantName}}</view>
<view class="arrow">
<view class="arrow {{moveArrow?'move':''}}" wx:if="{{storeListRange.length > 1}}">
<image src="/images/back.png" />
<image src="/images/back.png" />
</view>
</view>
</view>
</
picker
>
</
view
>
</navigation-bar>
</navigation-bar>
<!-- style="margin-top:{{navBarHeight}}px" -->
<!-- style="margin-top:{{navBarHeight}}px" -->
<view class="layout" style="padding-top:{{navBarHeight}}px; height: calc(100vh - {{navBarHeight}}px);">
<view class="layout" style="padding-top:{{navBarHeight}}px; height: calc(100vh - {{navBarHeight}}px);">
...
@@ -16,4 +14,5 @@
...
@@ -16,4 +14,5 @@
<equity-list id="page-1" navBarHeight="{{navBarHeight}}" class="{{tabIndex == 1?'':'hide'}}" />
<equity-list id="page-1" navBarHeight="{{navBarHeight}}" class="{{tabIndex == 1?'':'hide'}}" />
</block>
</block>
</view>
</view>
<custom-tabBar list="{{tabBarList}}" color="#6C6C70" selectedColor="#3582EE" tabIndex="{{tabIndex}}" bindchange="changeTabBar" />
\ No newline at end of file
\ No newline at end of file
<custom-tabBar list="{{tabBarList}}" color="#6C6C70" selectedColor="#3582EE" tabIndex="{{tabIndex}}" bindchange="changeTabBar" />
<store-picker items="{{storeListRange}}" show="{{showPicker}}" bindsearch="getStoreList" bindconfirm="changePicker"></store-picker>
\ No newline at end of file
\ No newline at end of file
pages/accountItems/accountItems.js
View file @
074fb52
...
@@ -180,7 +180,7 @@ Page({
...
@@ -180,7 +180,7 @@ Page({
if
(
code
==
0
)
{
if
(
code
==
0
)
{
let
openSceneArr
=
[]
let
openSceneArr
=
[]
data
?.
forEach
(
v
=>
{
data
?.
forEach
(
v
=>
{
if
(
v
.
sceneOpenFlag
===
1
)
openSceneArr
.
push
(
v
.
scene
)
if
(
v
.
sceneOpenFlag
===
0
)
openSceneArr
.
push
(
v
.
scene
)
})
})
if
(
!
openSceneArr
.
length
)
{
if
(
!
openSceneArr
.
length
)
{
wx
.
$util
.
showToast
(
'暂无开通场景'
)
wx
.
$util
.
showToast
(
'暂无开通场景'
)
...
...
store/index.js
View file @
074fb52
...
@@ -212,7 +212,8 @@ export const get4SStoreList = options => {
...
@@ -212,7 +212,8 @@ export const get4SStoreList = options => {
api
api
.
getSceneMerchantRefStoreList
({
.
getSceneMerchantRefStoreList
({
merchantId
:
options
.
yqMerchantId
,
merchantId
:
options
.
yqMerchantId
,
scene
:
0
scene
:
0
,
merchantName
:
options
.
merchantName
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
let
{
code
,
data
}
=
res
let
{
code
,
data
}
=
res
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment