Commit 0c8e71df by 张立顺

门店添加搜索功能

1 parent 9402946e
...@@ -41,6 +41,7 @@ Component({ ...@@ -41,6 +41,7 @@ Component({
} }
}, },
attached() { attached() {
// console.log(wx.$util.isFullSucreen(), 'wx.$util.isFullSucreen()')
this.setData({ this.setData({
isFullSucreen: wx.$util.isFullSucreen() isFullSucreen: wx.$util.isFullSucreen()
}) })
......
<view class="popup" hidden="{{!showPopup}}" catchtouchmove="noScroll"> <view class="popup" hidden="{{ !showPopup }}" catchtouchmove="noScroll">
<view class="popup-bg" bindtap="hidePopup"></view> <view class="popup-bg" bindtap="hidePopup"></view>
<view class="popup-content" style="height:{{height}}"> <view class="popup-content" style="height:{{ height }}">
<block wx:if="{{title}}"> <block wx:if="{{ title }}">
<view class="popup-title text-center">{{title}}</view> <view class="popup-title text-center">{{title}}</view>
</block> </block>
<view class="popup-slot {{isFullSucreen?title?'isFullSucreen':'isFullSucreen-notitle':''}}"> <view class="popup-slot {{ isFullSucreen?title?'isFullSucreen':'isFullSucreen-notitle':'' }}">
<slot></slot> <slot></slot>
</view> </view>
<view class="popup-footer {{isFullSucreen?'isFullSucreen':''}}"> <view class="popup-footer {{ isFullSucreen?'isFullSucreen':'' }}">
<view class="cancel btn text-center" bindtap="hidePopup">取消</view> <view class="cancel btn text-center" bindtap="hidePopup">取消</view>
<view class="confirm btn text-center" bindtap="confirm">确认</view> <view class="confirm btn text-center" bindtap="confirm">确认</view>
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -42,23 +42,28 @@ ...@@ -42,23 +42,28 @@
} }
.popup-slot { .popup-slot {
height: calc(100% - 200rpx); height: calc(100% - 100rpx);
} }
.popup-slot.isFullSucreen{
.popup-slot.isFullSucreen {
height: calc(100% - 268rpx); height: calc(100% - 268rpx);
} }
.popup-slot.isFullSucreen-notitle{
.popup-slot.isFullSucreen-notitle {
height: calc(100% - 170rpx); height: calc(100% - 170rpx);
} }
.popup-footer { .popup-footer {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding:10rpx 0 ; padding: 10rpx 0;
} }
.popup-footer.isFullSucreen{
.popup-footer.isFullSucreen {
padding-bottom: 68rpx !important; padding-bottom: 68rpx !important;
} }
.popup-footer .btn { .popup-footer .btn {
width: 330rpx; width: 330rpx;
height: 80rpx; height: 80rpx;
...@@ -71,10 +76,12 @@ ...@@ -71,10 +76,12 @@
color: #323233; color: #323233;
border: 2rpx solid #DCDEE0; border: 2rpx solid #DCDEE0;
} }
.popup-footer .confirm{
.popup-footer .confirm {
background: #3582EE; background: #3582EE;
color: #fff; color: #fff;
} }
@keyframes show-popup { @keyframes show-popup {
0% { 0% {
bottom: -100%; bottom: -100%;
......
...@@ -8,92 +8,95 @@ Component({ ...@@ -8,92 +8,95 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
items: { subIndex: {
type: Array, type: Number,
value: [], // value: [],
observer: function (n) { observer: function (n) {
if (n) { this.setData({
let userInfo = wx.$util.getUserInfo() selectStoreIndex: [n]
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})
}
} }
}, },
pickList: {
type: Array,
value: []
},
show: { show: {
type: Boolean, type: Boolean
} }
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
searchValue:'', searchValue: '',
selectStoreIndex:'', selectStoreIndex: '',
edit: false, edit: false
defaultSelectStoreIndex: []
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
open() { open() {
if (this.data.disabled) return if (this.data.disabled) return
this.setData({ this.setData({
edit: true, edit: true,
inputFocus: true inputFocus: true
}) })
}, },
setValue(value) { setValue(value) {
if (this.properties.filterEmoji) { if (this.properties.filterEmoji) {
if (wx.$util.haveEmoji(value)) value = wx.$util.replaceEmoji(value) if (wx.$util.haveEmoji(value)) value = wx.$util.replaceEmoji(value)
} }
this.setData({ this.setData({
searchValue: value searchValue: value
}) })
}, },
input(e) { input(e) {
let { let { value } = e.detail
value this.setValue(value)
} = e.detail this.triggerEvent('input', {
this.setValue(value)
this.triggerEvent('input', {
value
})
},
inputBlur(e) {
this.emit(e)
},
inputConfifm(e) {
this.emit(e)
},
emit(e) {
let {
detail:{
value value
}, })
type },
} = e inputBlur(e) {
this.setData({ this.emit(e)
edit: false },
}) inputConfifm(e) {
this.setValue(value) this.emit(e)
console.log('123') },
this.triggerEvent(type == 'confirm' ? 'search' : 'blur', {value}) emit(e) {
}, let {
confirm() { detail: { value },
let {selectStoreIndex, items } = this.data type
if (!items.length) { } = e
return wx.$util.showToast('请选择门店') this.setData({
edit: false
})
this.setValue(value)
console.log('123')
this.triggerEvent(type == 'confirm' ? 'search' : 'blur', { value })
},
confirm() {
let { selectStoreIndex, pickList } = this.data
let value = selectStoreIndex[0]
console.log(value)
console.log(pickList)
if (!pickList[value]?.merchantName) {
return wx.$util.showToast('请选择门店')
}
// console.log(value)
this.triggerEvent('confirm', { value })
this.triggerEvent('search', { value })
this.setData({
show: false
})
},
changeStore(e) {
// console.log(e.detail.value[0])
this.setData({
selectStoreIndex: [e.detail.value[0]]
})
} }
this.triggerEvent('confirm', selectStoreIndex)
this.setData({
show: false
})
},
changeStore(e) {
this.setData({
selectStoreIndex: e.detail.value[0]
})
} }
}
}) })
<!--packageEquity/components/storePicker/storePicker.wxml--> <!--packageEquity/components/storePicker/storePicker.wxml-->
<popup class="date-background" show="{{show}}" bindconfirm="confirm" height="800rpx"> <popup class="date-background" show="{{ show }}" bindconfirm="confirm" height="800rpx">
<view class='date-container'> <view class="date-container">
<view class='date-confirm'> <view class="date-confirm">
<view class="search-box"> <view class="search-box">
<view class="search-input"> <view class="search-input">
<block wx:if="{{!edit}}"> <block wx:if="{{ !edit }}">
<view class="input {{searchValue?'':'placeholder'}}" bindtap="open"> <view class="input {{ searchValue?'':'placeholder' }}" bindtap="open">
<block wx:if="{{searchValue}}"> <block wx:if="{{ searchValue }}">{{searchValue}}</block>
{{searchValue}} <block wx:else>
</block> <image src="/images/search.png" class="icon"></image>
<block wx:else> {{'请输入门店'}}
<image src="../../../images/search.png" class="icon"></image> </block>
{{'请输入门店'}} </view>
</block> </block>
</view> <block wx:else>
</block> <input
<block wx:else> type="text"
<input type="text" class="input" value='{{searchValue}}' focus='{{inputFocus}}' confirm-type="search" bindinput='input' bindblur="inputBlur" bindconfirm="inputConfifm"/> class="input"
</block> value="{{ searchValue }}"
</view> focus="{{ inputFocus }}"
</view> confirm-type="search"
</view> bindinput="input"
<view class="picker-box"> bindblur="inputBlur"
<picker-view class="picker" value="{{defaultSelectStoreIndex}}" immediate-change="true" indicator-class="indicator" bindchange="changeStore"> bindconfirm="inputConfifm"
<picker-view-column> />
<block wx:for="{{items}}" wx:key="merchantId"> </block>
<view class="view pickViewColumn">{{item.merchantName}}</view> </view>
</block> </view>
</picker-view-column> </view>
</picker-view> <view class="picker-box">
</view> <picker-view
</view> class="picker"
</popup> value="{{ selectStoreIndex }}"
immediate-change="true"
indicator-class="indicator"
bindchange="changeStore"
>
<picker-view-column>
<block wx:for="{{ pickList }}" wx:key="merchantId">
<view class="view pickViewColumn">{{item.merchantName}}</view>
</block>
</picker-view-column>
</picker-view>
</view>
</view>
</popup>
\ No newline at end of file \ No newline at end of file
...@@ -61,7 +61,7 @@ page { ...@@ -61,7 +61,7 @@ page {
} }
.login-btn { .login-btn {
margin: 140rpx 0 28rpx; margin: 130rpx 0 28rpx;
background-image: linear-gradient(125deg, #65B8F8 0%, #3582EE 100%); background-image: linear-gradient(125deg, #65B8F8 0%, #3582EE 100%);
border-radius: 12rpx; border-radius: 12rpx;
text-align: center; text-align: center;
......
...@@ -34,17 +34,19 @@ export const getYQInfo = userInfo => { ...@@ -34,17 +34,19 @@ export const getYQInfo = userInfo => {
// getUserInfo // getUserInfo
// 判断是否是多账号用户 // 判断是否是多账号用户
let subIndex = 0 let subIndex = 0
console.log(!userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2); // console.log(!userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2);
console.log(userInfo.merchantId,'userInfo.merchantId'); // console.log(userInfo.merchantId,'userInfo.merchantId');
if (!userInfo.loginRole || userInfo.loginRole ==4 ) { if (!userInfo.loginRole || userInfo.loginRole == 4) {
// console.log(userInfo.merchantId,'userInfo.merchantId'); // console.log(userInfo.merchantId,'userInfo.merchantId');
app.globalData.yqdInfo = { app.globalData.yqdInfo = {
subIndex, subIndex,
merchantRange: [{ merchantRange: [
merchantName: userInfo.merchantName, {
merchantId: userInfo.merchantId merchantName: userInfo.merchantName,
}] merchantId: userInfo.merchantId
}
]
} }
// this.setData({ // this.setData({
// merchantRange: [{ merchantName: userInfo.merchantName }] // merchantRange: [{ merchantName: userInfo.merchantName }]
...@@ -59,10 +61,7 @@ export const getYQInfo = userInfo => { ...@@ -59,10 +61,7 @@ export const getYQInfo = userInfo => {
.getYQList() .getYQList()
.then(res => { .then(res => {
// console.log(res) // console.log(res)
let { let { code, data } = res
code,
data
} = res
if (code == 0) { if (code == 0) {
let arr = [] let arr = []
if (data.length > 1) { if (data.length > 1) {
...@@ -73,10 +72,12 @@ export const getYQInfo = userInfo => { ...@@ -73,10 +72,12 @@ export const getYQInfo = userInfo => {
} }
arr = [all, ...data] arr = [all, ...data]
} else { } else {
arr = [{ arr = [
merchantName: userInfo.merchantName, {
merchantId: userInfo.merchantId merchantName: userInfo.merchantName,
}] merchantId: userInfo.merchantId
}
]
} }
app.globalData.yqdInfo = { app.globalData.yqdInfo = {
merchantRange: arr, merchantRange: arr,
...@@ -102,10 +103,7 @@ export const getYQorderInfo = () => { ...@@ -102,10 +103,7 @@ export const getYQorderInfo = () => {
} else { } else {
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
if (!userInfo) this.login(true) if (!userInfo) this.login(true)
let { let { merchantId, merchantName } = userInfo.subLoginUser
merchantId,
merchantName
} = userInfo.subLoginUser
api api
.getMerchantRecordingSettings({ .getMerchantRecordingSettings({
...@@ -114,10 +112,7 @@ export const getYQorderInfo = () => { ...@@ -114,10 +112,7 @@ export const getYQorderInfo = () => {
}) })
.then(res => { .then(res => {
// console.log(res) // console.log(res)
let { let { code, data } = res
code,
data
} = res
if (code == 0) { if (code == 0) {
// debugger // debugger
// console.log(typeof data.yqPhoneConfig, 'data.yqPhoneConfig') // console.log(typeof data.yqPhoneConfig, 'data.yqPhoneConfig')
...@@ -144,9 +139,7 @@ export const setConfigInfo = globalData => { ...@@ -144,9 +139,7 @@ export const setConfigInfo = globalData => {
// 如果有 直接返回 // 如果有 直接返回
// console.log(app.globalData.YQorderSetting, 'app.globalData.YQorderSetting') // console.log(app.globalData.YQorderSetting, 'app.globalData.YQorderSetting')
// console.log('app.globalData.YQorderSetting', app.globalData.YQorderSetting) // console.log('app.globalData.YQorderSetting', app.globalData.YQorderSetting)
let { let { configInfo } = globalData
configInfo
} = globalData
if (configInfo) { if (configInfo) {
return resolve(configInfo) return resolve(configInfo)
} else { } else {
...@@ -175,9 +168,7 @@ export const setConfigInfo = globalData => { ...@@ -175,9 +168,7 @@ export const setConfigInfo = globalData => {
export const checkScene = options => { export const checkScene = options => {
// let query = options.query // let query = options.query
let { let { query } = options
query
} = options
if (query) { if (query) {
// 解码 // 解码
for (const key in query) { for (const key in query) {
...@@ -259,17 +250,14 @@ export const setWebSocket = () => { ...@@ -259,17 +250,14 @@ export const setWebSocket = () => {
/** 获取园区店下的4S店 */ /** 获取园区店下的4S店 */
export const get4SStoreList = options => { export const get4SStoreList = options => {
console.log(options,'options'); console.log(options, 'options')
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const app = getApp() const app = getApp()
api api
.getSceneMerchantRefStoreList(options) .getSceneMerchantRefStoreList(options)
.then(res => { .then(res => {
let { let { code, data } = res
code,
data
} = res
if (code == 0) { if (code == 0) {
app.globalData.storeListRange = data app.globalData.storeListRange = data
let default4SStoreInfo = wx.$util.getUserInfo()?.default4SStoreInfo ? wx.$util.getUserInfo()?.default4SStoreInfo : data && data[0] let default4SStoreInfo = wx.$util.getUserInfo()?.default4SStoreInfo ? wx.$util.getUserInfo()?.default4SStoreInfo : data && data[0]
...@@ -282,7 +270,8 @@ export const get4SStoreList = options => { ...@@ -282,7 +270,8 @@ export const get4SStoreList = options => {
default4SStoreInfo: default4SStoreInfo default4SStoreInfo: default4SStoreInfo
}) })
if (options.scene == 3 || options.scene == 2) if (options.scene == 3 || options.scene == 2)
if (options.isSubcehicle) { // 是否是次新车转化业务场景(商户关联关系与众筹一样) if (options.isSubcehicle) {
// 是否是次新车转化业务场景(商户关联关系与众筹一样)
wx.$util.setUserInfo({ wx.$util.setUserInfo({
...wx.$util.getUserInfo(), ...wx.$util.getUserInfo(),
default4SStoreInfo_newCarConversion: default4SStoreInfo_newCarConversion default4SStoreInfo_newCarConversion: default4SStoreInfo_newCarConversion
...@@ -308,10 +297,7 @@ export const getStaffListByMerchant = options => { ...@@ -308,10 +297,7 @@ export const getStaffListByMerchant = options => {
api api
.getStaffListByMerchantAPI(options) .getStaffListByMerchantAPI(options)
.then(res => { .then(res => {
let { let { code, data } = res
code,
data
} = res
if (code == 0) { if (code == 0) {
app.globalData.staffListRange = data app.globalData.staffListRange = data
resolve(app.globalData.staffListRange) resolve(app.globalData.staffListRange)
...@@ -321,4 +307,4 @@ export const getStaffListByMerchant = options => { ...@@ -321,4 +307,4 @@ export const getStaffListByMerchant = options => {
console.log(error) console.log(error)
}) })
}) })
}
\ No newline at end of file \ No newline at end of file
}
...@@ -25,12 +25,16 @@ Page({ ...@@ -25,12 +25,16 @@ Page({
flag: true, flag: true,
dateObj: { dateObj: {
beginDateStr: '' beginDateStr: ''
} },
showPicker: false
// showPicker: true
}, },
showStorePicker() { showStorePicker() {
this.setData({ let { merchantRange } = this.data
showPicker: true merchantRange.length > 1 &&
}) this.setData({
showPicker: true
})
}, },
tipsEvent() { tipsEvent() {
...@@ -124,7 +128,24 @@ Page({ ...@@ -124,7 +128,24 @@ Page({
moveArrow: !this.data.moveArrow moveArrow: !this.data.moveArrow
}) })
}, },
getStoreList(e) {
console.log(e)
let { value } = e.detail
getYQInfo(this.data.userInfo)
.then(result => {
// console.log(result)
let { merchantRange } = result
if (value) {
merchantRange = merchantRange.filter(item => item.merchantName.includes(value))
}
this.setData({
merchantRange
})
})
.catch(err => {})
},
changePicker(e) { changePicker(e) {
console.log(e)
let { value } = e.detail let { value } = e.detail
let { merchantId } = this.data.merchantRange[value] let { merchantId } = this.data.merchantRange[value]
// 修改对应下标显示 // 修改对应下标显示
...@@ -147,7 +168,7 @@ Page({ ...@@ -147,7 +168,7 @@ Page({
this.tapPicker() this.tapPicker()
}, },
jump(e) { jump(e) {
let { item, type, } = e.currentTarget.dataset let { item, type } = e.currentTarget.dataset
let { userInfo } = this.data let { userInfo } = this.data
// 判断是不是门店员工 // 判断是不是门店员工
if (userInfo.merchantType && !userInfo.isSuper && type == 2) { if (userInfo.merchantType && !userInfo.isSuper && type == 2) {
...@@ -399,7 +420,7 @@ Page({ ...@@ -399,7 +420,7 @@ Page({
}, },
getOutputValue(yqdInfo) { getOutputValue(yqdInfo) {
let { dateObj, userInfo } = this.data let { dateObj, userInfo } = this.data
console.log(yqdInfo, 'yqdInfo') // console.log(yqdInfo, 'yqdInfo')
let { subIndex, merchantRange } = yqdInfo let { subIndex, merchantRange } = yqdInfo
// yqMerchantId 不是全部就必要要带过去 // yqMerchantId 不是全部就必要要带过去
// 1-超管 2-商户管理员 3-区域督导 4-驻店人员 // 1-超管 2-商户管理员 3-区域督导 4-驻店人员
......
...@@ -5,6 +5,6 @@ ...@@ -5,6 +5,6 @@
"side-select-popup": "/components/SideSelectPopup/SideSelectPopup", "side-select-popup": "/components/SideSelectPopup/SideSelectPopup",
"CalendarMonthSingle": "/components/CalendarMonthSingle/CalendarMonth", "CalendarMonthSingle": "/components/CalendarMonthSingle/CalendarMonth",
"van-progress": "@vant/weapp/progress/index", "van-progress": "@vant/weapp/progress/index",
"store-picker": "../../components/storePicker/storePicker" "store-picker": "/components/storePicker/storePicker"
} }
} }
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
</view> </view>
</view> </view>
</view> </view>
<block wx:if="{{!userInfo.isSuper && userInfo.merchantType}}"> <!-- wx:if="{{!userInfo.isSuper && userInfo.merchantType}}" -->
<block >
<view class="set-box " bindtap="showWork"> <view class="set-box " bindtap="showWork">
<view class="label"> <view class="label">
<image src="../../images/set.png" /> <image src="../../images/set.png" />
......
...@@ -17,19 +17,19 @@ Page({ ...@@ -17,19 +17,19 @@ Page({
name: '营业概况', name: '营业概况',
active: true, active: true,
componentsName: 'businessCell', componentsName: 'businessCell',
recordId:12 recordId: 12
}, },
{ {
name: '员工业绩', name: '员工业绩',
active: false, active: false,
componentsName: 'staffCell', componentsName: 'staffCell',
recordId:13 recordId: 13
}, },
{ {
name: '今日战果', name: '今日战果',
active: false, active: false,
componentsName: 'conquestCell', componentsName: 'conquestCell',
recordId:14 recordId: 14
} }
], ],
dateObj: { dateObj: {
...@@ -43,10 +43,34 @@ Page({ ...@@ -43,10 +43,34 @@ Page({
totalOrderMoney: 0, totalOrderMoney: 0,
totalAdd: 0 totalAdd: 0
}, },
refresh: false refresh: false,
showPicker: false
}, },
// 混入跳转方法 // 混入跳转方法
...mixins.methods, ...mixins.methods,
showStorePicker() {
let { merchantRange } = this.data
merchantRange.length > 1 &&
this.setData({
showPicker: true
})
},
getStoreList(e) {
console.log(e)
let { value } = e.detail
getYQInfo(this.data.userInfo)
.then(result => {
// console.log(result)
let { merchantRange } = result
if (value) {
merchantRange = merchantRange.filter(item => item.merchantName.includes(value))
}
this.setData({
merchantRange
})
})
.catch(err => {})
},
changePicker(e) { changePicker(e) {
console.log('changePicker') console.log('changePicker')
let { value } = e.detail let { value } = e.detail
...@@ -192,7 +216,7 @@ Page({ ...@@ -192,7 +216,7 @@ Page({
} else { } else {
this.setTimeList(dateObj.nextDay) this.setTimeList(dateObj.nextDay)
} }
wx.$util.pointRecord(type == 'before'?16:17) wx.$util.pointRecord(type == 'before' ? 16 : 17)
this.calendar.resetData(type == 'before' ? dateObj.beforeDay : dateObj.nextDay) this.calendar.resetData(type == 'before' ? dateObj.beforeDay : dateObj.nextDay)
}, },
// 获取选中天数 // 获取选中天数
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
"businessCell": "./components/businessCell/businessCell", "businessCell": "./components/businessCell/businessCell",
"staffCell": "./components/staffCell/staffCell", "staffCell": "./components/staffCell/staffCell",
"conquestCell": "./components/conquestCell/conquestCell", "conquestCell": "./components/conquestCell/conquestCell",
"tipsPopup": "/components/tipsPopup/Popup" "tipsPopup": "/components/tipsPopup/Popup",
"store-picker": "/components/storePicker/storePicker"
} }
} }
...@@ -44,9 +44,32 @@ Page({ ...@@ -44,9 +44,32 @@ Page({
pages: 1, pages: 1,
dateObj: { dateObj: {
beginDateStr: '' beginDateStr: ''
} },
showPicker: false
},
showStorePicker() {
let { merchantRange } = this.data
merchantRange.length > 1 &&
this.setData({
showPicker: true
})
},
getStoreList(e) {
console.log(e)
let { value } = e.detail
getYQInfo(this.data.userInfo)
.then(result => {
// console.log(result)
let { merchantRange } = result
if (value) {
merchantRange = merchantRange.filter(item => item.merchantName.includes(value))
}
this.setData({
merchantRange
})
})
.catch(err => {})
}, },
navbarReady(e) { navbarReady(e) {
let navBarHeight = e.detail.height let navBarHeight = e.detail.height
this.setData({ this.setData({
......
{ {
"navigationStyle": "custom", "navigationStyle": "custom",
"usingComponents": { "usingComponents": {
"CalendarMonth": "/components/CalendarMonth/CalendarMonth" "CalendarMonth": "/components/CalendarMonth/CalendarMonth",
"store-picker": "/components/storePicker/storePicker"
} }
} }
<!-- tabOperating/pages/operatingShow/operatingShow.wxml --> <!-- tabOperating/pages/operatingShow/operatingShow.wxml -->
<!-- src引入filter.wxs, module给模块起名 --> <!-- src引入filter.wxs, module给模块起名 -->
<wxs src="../index.wxs" module="filter" /> <wxs src="../index.wxs" module="filter" />
<view class="layout {{flag?'opacity':''}}"> <view class="layout {{ flag?'opacity':'' }}">
<navigation-bar bindback="jump" bindnavbarReady="navbarReady" showBack="{{true}}"> <navigation-bar bindback="jump" bindnavbarReady="navbarReady" showBack="{{ true }}">
<picker <!-- <picker
range="{{merchantRange}}" range="{{merchantRange}}"
value="{{subIndex}}" value="{{subIndex}}"
range-key="merchantName" range-key="merchantName"
bindchange="changePicker" bindchange="changePicker"
bindtap="tapPicker" bindtap="tapPicker"
bindcancel="tapPicker" bindcancel="tapPicker"
disabled="{{merchantRange.length < 2}}"> disabled="{{merchantRange.length < 2}}"> -->
<view class="navigation-title"> <view class="navigation-title" bindtap="showStorePicker">
<view class="navigation-title-text text-hide"> <view class="navigation-title-text text-hide">{{merchantRange[subIndex].merchantName}}</view>
{{merchantRange[subIndex].merchantName}} <view class="arrow {{ moveArrow?'move':'' }}" wx:if="{{ merchantRange.length > 1 }}">
</view> <image src="/images/arrow-bottom.png" />
<view class="arrow {{moveArrow?'move':''}}" wx:if="{{merchantRange.length > 1}}">
<image src="/images/arrow-bottom.png" />
</view>
</view> </view>
</picker> </view>
<!-- </picker> -->
</navigation-bar> </navigation-bar>
<view class="header" style="margin-top:{{statusBarHeight}}px"> <view class="header" style="margin-top:{{ statusBarHeight }}px">
<view class="date"> <view class="date">
<!-- {{dateObj.maxDate}} --> <!-- {{dateObj.maxDate}} -->
<CalendarMonth <CalendarMonth
allowSameDay allowSameDay
shortcut shortcut
bindselect='rangeSelect' bindselect="rangeSelect"
bindtapCalendar='tapCalendar' bindtapCalendar="tapCalendar"
rangeAll rangeAll
dateType='range' dateType="range"
calenderColor='#3582EE' calenderColor="#3582EE"
vertical vertical
minDate="2020-10-01" minDate="2020-10-01"
maxDate="{{dateObj.today}}" maxDate="{{ dateObj.today }}"
forceFullSucreen="{{bottomLift>0?true:false}}" forceFullSucreen="{{ bottomLift>0?true:false }}"
isComponents> isComponents
>
<view class="item dateNum"> <view class="item dateNum">
<block wx:if="{{dateObj.type=='year'}}">{{dateObj.label}}年</block> <block wx:if="{{ dateObj.type=='year' }}">{{dateObj.label}}年</block>
<block wx:else> <block wx:else>
<!-- {{filter.dateFormatSlash(dateObj.beginDateStr)}}-{{filter.dateFormatSlash(dateObj.endDateStr)}} --> <!-- {{filter.dateFormatSlash(dateObj.beginDateStr)}}-{{filter.dateFormatSlash(dateObj.endDateStr)}} -->
五月份 五月份
...@@ -50,7 +49,7 @@ ...@@ -50,7 +49,7 @@
</block> --> </block> -->
<!-- wx:if="{{merchantRange.length > 1}}" --> <!-- wx:if="{{merchantRange.length > 1}}" -->
<!-- 2021年 2-8月 --> <!-- 2021年 2-8月 -->
<view class="arrow {{whiteArrow?'move':''}}"> <view class="arrow {{ whiteArrow?'move':'' }}">
<image src="/images/whiteArrowIcon.png" /> <image src="/images/whiteArrowIcon.png" />
</view> </view>
</view> </view>
...@@ -73,60 +72,47 @@ ...@@ -73,60 +72,47 @@
</view> </view>
</view> </view>
<!-- --> <!-- -->
<view class="table {{isFullSucreen?'isFullSucreen':''}}"> <view class="table {{ isFullSucreen?'isFullSucreen':'' }}">
<view class="tableContainer"> <view class="tableContainer">
<view class="table-header"> <view class="table-header">
<block wx:for="{{tableHeaderList}}" wx:key="index"> <block wx:for="{{ tableHeaderList }}" wx:key="index">
<view class="tableHeader-td">{{item.name}}</view> <view class="tableHeader-td">{{item.name}}</view>
</block> </block>
</view> </view>
<block wx:if="{{tableList.length}}"> <block wx:if="{{ tableList.length }}">
<view class="table-body"> <view class="table-body">
<!-- show-scrollbar="{{false}}" scroll-x bindscrolltoupper="getAccumulateList" --> <!-- show-scrollbar="{{false}}" scroll-x bindscrolltoupper="getAccumulateList" -->
<!-- bindrefresherrefresh="search" --> <!-- bindrefresherrefresh="search" -->
<!-- bindscrolltolower="scrollonReachBottom" --> <!-- bindscrolltolower="scrollonReachBottom" -->
<scroll-view <scroll-view
scroll-y scroll-y
enable-back-to-top enable-back-to-top
refresher-enabled="{{true}}" refresher-enabled="{{ true }}"
bindrefresherrefresh="restPageNum" bindrefresherrefresh="restPageNum"
bindscrolltolower="scrollonReachBottom" bindscrolltolower="scrollonReachBottom"
refresher-threshold="104" refresher-threshold="104"
style="height:100%;" style="height:100%;"
class="list" class="list"
refresher-triggered="{{triggered}}"> refresher-triggered="{{ triggered }}"
<block wx:for="{{tableList}}" wx:for-item="tableItem" wx:key="index"> >
<block wx:for="{{ tableList }}" wx:for-item="tableItem" wx:key="index">
<view class="table-th"> <view class="table-th">
<block <block wx:for="{{ tableHeaderList }}" wx:for-item="item" wx:for-index="tdIndex" wx:key="tdIndex">
wx:for="{{tableHeaderList}}"
wx:for-item="item"
wx:for-index="tdIndex"
wx:key="tdIndex">
<!-- <view class="table-td">{{tableHeaderList[tdIndex]}}</view> --> <!-- <view class="table-td">{{tableHeaderList[tdIndex]}}</view> -->
<view class="table-td" wx:if="{{tableHeaderList[tdIndex]['propName']=='dataDateStr'&&dateObj.type =='day'}}"> <view class="table-td" wx:if="{{ tableHeaderList[tdIndex]['propName']=='dataDateStr'&&dateObj.type =='day' }}">{{filter.dateFormatSlash(tableItem[tableHeaderList[tdIndex]['propName']])}}</view>
{{filter.dateFormatSlash(tableItem[tableHeaderList[tdIndex]['propName']])}} <view class="table-td" wx:elif="{{ tableHeaderList[tdIndex]['propName']=='dataDateStr'&&dateObj.type=='year' }}">{{filter.dateFormatYear(tableItem[tableHeaderList[tdIndex]['propName']])}}</view>
</view> <view class="table-td" wx:elif="{{ tableHeaderList[tdIndex]['propName']=='dataDateStr'&&dateObj.type=='month' }}">{{filter.dateFormatMonth(tableItem[tableHeaderList[tdIndex]['propName']])}}</view>
<view class="table-td" wx:elif="{{tableHeaderList[tdIndex]['propName']=='dataDateStr'&&dateObj.type=='year'}}"> <view class="table-td" wx:elif="{{ tableHeaderList[tdIndex]['propName']=='upgradeRate' }}">{{filter.rateFormat(tableItem[tableHeaderList[tdIndex]['propName']])}}</view>
{{filter.dateFormatYear(tableItem[tableHeaderList[tdIndex]['propName']])}} <view class="table-td" wx:else>{{tableItem[tableHeaderList[tdIndex]['propName']]}}</view>
</view>
<view class="table-td" wx:elif="{{tableHeaderList[tdIndex]['propName']=='dataDateStr'&&dateObj.type=='month'}}">
{{filter.dateFormatMonth(tableItem[tableHeaderList[tdIndex]['propName']])}}
</view>
<view class="table-td" wx:elif="{{tableHeaderList[tdIndex]['propName']=='upgradeRate'}}">
{{filter.rateFormat(tableItem[tableHeaderList[tdIndex]['propName']])}}
</view>
<view class="table-td" wx:else>
{{tableItem[tableHeaderList[tdIndex]['propName']]}}
</view>
<!-- <view class="table-td">{{tableItem[]}}</view> --> <!-- <view class="table-td">{{tableItem[]}}</view> -->
</block> </block>
</view> </view>
</block> </block>
<view class="tips" wx:if="{{currentPage == pages&&tableList.length>13}}">到底了~</view> <view class="tips" wx:if="{{ currentPage == pages&&tableList.length>13 }}">到底了~</view>
</scroll-view> </scroll-view>
</view> </view>
</block> </block>
<block wx:if="{{!tableList.length}}"> <block wx:if="{{ !tableList.length }}">
<!-- <view class="tips-nothing">暂无数据</view> --> <!-- <view class="tips-nothing">暂无数据</view> -->
<!-- <view class=" noListText"> <!-- <view class=" noListText">
<image <image
...@@ -141,4 +127,10 @@ ...@@ -141,4 +127,10 @@
</view> </view>
</view> </view>
</view> </view>
<store-picker
subIndex="{{ subIndex }}"
pickList="{{ merchantRange }}"
show="{{ showPicker }}"
bindsearch="getStoreList"
bindconfirm="changePicker"
/>
\ No newline at end of file \ No newline at end of file
...@@ -21,8 +21,8 @@ class Request { ...@@ -21,8 +21,8 @@ class Request {
} }
: {} : {}
data = _this.getData(data, method, noSignAttr) data = _this.getData(data, method, noSignAttr)
console.log('reqData',data?.sessionId); // console.log('reqData',data?.sessionId);
// delete // delete
// if (data?.sessionId) { // if (data?.sessionId) {
// delete data?.sessionId // delete data?.sessionId
// } // }
......
...@@ -191,15 +191,23 @@ const isFullSucreen = isComponents => { ...@@ -191,15 +191,23 @@ const isFullSucreen = isComponents => {
success(res) { success(res) {
// console.log(res) // console.log(res)
let { statusBarHeight, screenHeight, windowHeight, safeArea } = res let { statusBarHeight, screenHeight, windowHeight, safeArea } = res
// console.log(statusBarHeight, screenHeight, windowHeight, safeArea)
// const { screenHeight, safeArea } = res // const { screenHeight, safeArea } = res
const { bottom } = safeArea const { bottom } = safeArea
// console.log(bottom) // console.log(bottom)
// console.log(router.isTab, 'router.isTab')
// windowHeight 属性会在自定义导航栏时跟screenHeight 一样导致无法区分是否是iphoneX的机型 // windowHeight 属性会在自定义导航栏时跟screenHeight 一样导致无法区分是否是iphoneX的机型
// 用safeArea可以处理 // 用safeArea可以处理
val = router.isTab ? screenHeight - windowHeight - statusBarHeight - 32 > 72 : screenHeight - bottom > 0 val = router.isTab ? screenHeight - windowHeight - statusBarHeight - 32 > 72 : screenHeight - bottom > 0
// val = router.isTab ? screenHeight - windowHeight - statusBarHeight - 32 > 72 : screenHeight - windowHeight > 72 // val = router.isTab ? screenHeight - windowHeight - statusBarHeight - 32 > 72 : screenHeight - windowHeight > 72
// if (isComponents) val = screenHeight - windowHeight > 72 // if (isComponents) val = screenHeight - windowHeight > 72
if (isComponents) val = screenHeight - bottom > 0 if (isComponents) val = screenHeight - bottom > 0
// console.log(router, 'route')
// if (router.url.includes('tabIndex/pages/index/index')) {
// // console.log('当前页面为 TabBar 页面');
// val = true
// }
}, },
fail(err) { fail(err) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!