Commit 15edf6f8 by chenwq

feat(组件): 新增TopToolbarPopup和FilterBar组件并集成到referralCountList页面

添加TopToolbarPopup通用弹窗组件和FilterBar筛选栏组件
在referralCountList页面中集成FilterBar组件实现筛选功能
完善referralCountList页面的列表展示和交互逻辑
1 parent 43252df2
// components/FilterBar/FilterBar.js
const IMG_URL =
"https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/";
const date = new Date();
const years = [];
const months = [];
for (let i = 2020; i <= date.getFullYear() + 5; i++) {
years.push(i);
}
for (let i = 1; i <= 12; i++) {
months.push(i);
}
Component({
properties: {
height: {
type: String,
value: "40%",
},
searchPlaceholder: {
type: String,
value: "门店名称",
},
searchObj: {
type: Object,
value: {},
},
searchKey: {
type: String,
value: "keyword",
},
// Array of filter objects: { type: 'month'|'select', label: 'Label', key: 'key', optionList: [], value: '' }
filters: {
type: Array,
value: [],
},
},
data: {
IMG_URL,
years: years,
months: months,
searchValue: "",
formData: {},
// Popup State
showPopup: false,
activeFilterIndex: -1, // Index of the filter currently being edited
// Temp Values for Popups
tempDateIndex: [years.indexOf(date.getFullYear()), date.getMonth()],
tempDateValue: new Date().getTime(),
pickerViewValue: new Date().getTime(),
minDate: new Date(2020, 0, 1).getTime(),
maxDate: new Date(new Date().getFullYear() + 5, 11, 31).getTime(),
tempSelectIndex: 0,
},
methods: {
// Search Handlers
onSearch(e) {
if (e.detail && e.detail.value !== undefined) {
this.setData({ searchValue: e.detail.value });
}
this.triggerEvent("filterChange", this.getFilterData());
},
onSearchInput(e) {
this.setData({ searchValue: e.detail.value });
},
clearSearch() {
this.setData({ searchValue: "" });
this.triggerEvent("filterChange", this.getFilterData());
},
// Filter Tag Click Handler
onFilterTagTap(e) {
const index = e.currentTarget.dataset.index;
const filter = this.properties.filters[index];
const currentValue = this.data.formData[filter.key];
this.setData({
activeFilterIndex: index,
showPopup: true,
formData: this.data.searchObj,
});
if (filter.type === "month") {
this.initDatePicker(currentValue, filter.pickerType);
} else if (filter.type === "select") {
this.initSelectPicker(currentValue);
}
},
// Popup Logic
closePopup() {
this.setData({ showPopup: false, activeFilterIndex: -1 });
},
confirmPopup() {
const index = this.data.activeFilterIndex;
if (index === -1) return;
const filter = this.properties.filters[index];
let newValue = "";
if (filter.type === "month") {
newValue = this.getDateFromPicker(filter.pickerType);
} else if (filter.type === "select") {
newValue = this.data.formData[filter.key];
}
// Update the specific filter's value
const key = `formData.${filter.key}`;
this.setData({
[key]: newValue,
showPopup: false,
activeFilterIndex: -1,
});
this.triggerEvent("filterChange", this.getFilterData());
},
// Date Logic
initDatePicker(currentValue, pickerType = "year-month") {
let val = new Date().getTime();
if (pickerType === "time") {
val = currentValue || "00:00";
} else {
if (currentValue) {
let str = currentValue;
// Handle YYYY-MM for year-month type
if (pickerType === "year-month" && /^\d{4}-\d{2}$/.test(str)) {
str += "-01";
}
val = new Date(str.replace(/-/g, "/")).getTime();
if (isNaN(val)) val = new Date().getTime();
}
}
this.setData({ tempDateValue: val });
},
onDatePickChange(e) {
this.setData({ tempDateValue: e.detail });
},
getDateFromPicker(pickerType = "year-month") {
const val = this.data.tempDateValue;
if (pickerType === "time") return val;
const date = new Date(val);
const y = date.getFullYear();
const m = (date.getMonth() + 1).toString().padStart(2, "0");
const d = date.getDate().toString().padStart(2, "0");
if (pickerType === "date") return `${y}-${m}-${d}`;
if (pickerType === "year-month") return `${y}-${m}`;
return `${y}-${m}-${d}`; // default fallback
},
// Select Logic
getSelectOptions(filter) {
let optionList = filter.optionList || [];
if (!filter.hideAllOption) {
optionList = [{ confId: '', confLabel: '全部' }, ...optionList];
}
return optionList;
},
initSelectPicker(currentValue) {
const filter = this.properties.filters[this.data.activeFilterIndex];
const optionList = this.getSelectOptions(filter);
let index = 0;
if (currentValue) {
index = optionList.findIndex(item => item.confId == currentValue);
if (index == -1) index = 0;
} else {
// If currentValue is empty, it might mean "All" is selected (if available) or no selection.
// If "All" option exists (confId: ''), index should be 0.
// If no "All" option, but optionList exist, default to first.
index = 0;
}
// Default to first option if empty and not "All" (which is also empty string but valid)
// Actually, if we have "All" option, confId is '', so formData is empty string, which is fine.
// If we don't have "All" option, and currentValue is empty, we might want to default to first option.
if (!currentValue && optionList.length > 0) {
// If it's effectively "All" or unselected, we sync it.
const firstOption = optionList[0];
const updateData = {};
this.updateForm(filter, firstOption.confId, firstOption.confLabel, updateData);
this.setData(updateData);
}
console.log(index, 'index---')
this.setData({
tempSelectIndex: index,
currentSelectOptions: optionList // Store current optionList to use in wxml or change handler
});
},
onSelectPickerChange(e) {
const { index } = e.detail;
// We need to use the same optionList list as displayed
const filter = this.properties.filters[this.data.activeFilterIndex];
const optionList = this.data.currentSelectOptions || this.getSelectOptions(filter);
const value = optionList[index];
const updateData = {
tempSelectIndex: index
};
// Update showKey if present
this.updateForm(filter, value ? value.confId : '', value ? value.confLabel : '', updateData);
this.setData(updateData);
},
/**
* Updates form data with value and optional display label
* @param {Object} filter - Filter configuration object
* @param {String|Number} keyVal - The value to set for the filter key
* @param {String} showKeyVal - The label to set for the showKey (if configured)
* @param {Object} targetObj - The object to mutate with updates
*/
updateForm(filter, keyVal, showKeyVal, targetObj) {
Object.assign(targetObj, {
[`formData.${filter.key}`]: keyVal,
...(filter.showKey && { [`formData.${filter.showKey}`]: showKeyVal }),
});
},
// Reset
resetFilters() {
// Reset search
this.setData({ searchValue: "" });
// Reset all filters
const updates = {};
this.properties.filters.forEach((f) => {
this.updateForm(f, "", "", updates);
});
this.setData(updates);
this.triggerEvent("filterChange", this.getFilterData());
},
// Helper
getFilterData() {
const result = {
[this.properties.searchKey]: this.data.searchValue,
};
this.properties.filters.forEach((f) => {
let keyVal = this.data.formData[f.key] || "";
let showKeyVal = f.showKey ? (this.data.formData[f.showKey] || "") : "";
// 如果当前选中的confId为空并且confLabel为全部,则传‘’
// If the value is empty and the label is "全部", treat label as empty string for output
if (keyVal == "" && showKeyVal == "全部") {
showKeyVal = "";
}
result[f.key] = keyVal;
if (f.showKey) {
result[f.showKey] = showKeyVal;
}
});
return result;
},
},
});
{
"component": true,
"usingComponents": {
"TopToolbarPopup": "../TopToolbarPopup/TopToolbarPopup",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-picker": "@vant/weapp/picker/index"
}
}
<view class="filter-bar">
<!-- Search Area -->
<view class="search-box">
<view class="search-input">
<image src="/images/search.png" class="search-icon" />
<input type="text" placeholder="{{searchPlaceholder}}" class="input" value="{{ searchValue }}" placeholder-class="input-placeholder" bindinput="onSearchInput" bindconfirm="onSearch" />
<block wx:if="{{ searchValue }}">
<image src="/images/clear.png" class="search-clear" catchtap="clearSearch" />
</block>
</view>
</view>
<!-- Filter Area -->
<view class="filter-box" wx:if="{{filters.length > 0}}">
<view class="filter-list">
<block wx:for="{{filters}}" wx:key="key">
<view class="filter-item {{searchObj[item.key] ? 'active' : ''}}" bindtap="onFilterTagTap" data-index="{{index}}">
<text class="filter-text">{{searchObj[item.showKey || item.key] || item.label}}</text>
<!-- Using local images based on assumption, adjust filenames if needed -->
<image class="filter-icon" src="{{IMG_URL}}{{searchObj[item.key] ? 'expand_icon_blue' : 'expand_icon'}}.png" mode="" />
</view>
</block>
</view>
<!-- Reset Button -->
<view class="reset-btn" bindtap="resetFilters">
重置
</view>
</view>
</view>
<!-- Dynamic Popup -->
<TopToolbarPopup show="{{showPopup}}" title="" bind:cancel="closePopup" bind:confirm="confirmPopup" height="{{height}}">
<!-- Content depends on active filter type -->
<block wx:if="{{activeFilterIndex > -1}}">
<!-- Type: Month -->
<block wx:if="{{filters[activeFilterIndex].type === 'month'}}">
<van-datetime-picker
type="{{filters[activeFilterIndex].pickerType || 'year-month'}}"
value="{{pickerViewValue}}"
bind:input="onDatePickChange"
show-toolbar="{{false}}"
min-date="{{minDate}}"
max-date="{{maxDate}}"
/>
</block>
<!-- Type: Select -->
<block wx:elif="{{filters[activeFilterIndex].type === 'select'}}">
<van-picker
columns="{{ currentSelectOptions }}"
value-key="confLabel"
default-index="{{ tempSelectIndex }}"
bind:change="onSelectPickerChange"
show-toolbar="{{false}}"
/>
</block>
</block>
</TopToolbarPopup>
\ No newline at end of file \ No newline at end of file
/* components/FilterBar/FilterBar.wxss */
.filter-bar {
background: #FFFFFF;
padding: 16rpx 24rpx;
}
/* Search Box */
.search-box {
margin-bottom: 16rpx;
}
.search-input {
background: #F7F8FA;
border-radius: 72rpx;
width: 100%;
height: 72rpx;
display: flex;
align-items: center;
}
.search-icon {
width: 28rpx;
height: 28rpx;
margin: 0 10rpx 0 26rpx;
flex-shrink: 0;
}
.search-clear {
width: 36rpx;
height: 36rpx;
margin: 0 26rpx 0 10rpx;
flex-shrink: 0;
z-index: 10;
}
.input {
font-size: 28rpx;
height: 38rpx;
line-height: 38rpx;
flex: 1;
color: #333;
}
.input-placeholder {
color: #BBBBBB;
}
/* Filter Box */
.filter-box {
display: flex;
justify-content: space-between;
align-items: center;
}
.filter-list {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.filter-item {
height: 56rpx;
border-radius: 56rpx;
background: #F7F8FA;
padding: 0 16rpx 0 24rpx;
font-size: 26rpx;
color: #666666;
margin-right: 16rpx;
display: flex;
align-items: center;
margin-bottom: 10rpx;
/* Handle wrap if many filters */
}
.filter-item.active {
color: #2C66F7;
/* background: #F7F8FA; */
/* Background stays same in reference */
}
.filter-text {
line-height: 40rpx;
max-width: 170rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.filter-icon {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
margin-left: 4rpx;
}
.reset-btn {
color: #222222;
font-size: 26rpx;
padding: 10rpx;
flex-shrink: 0;
}
\ No newline at end of file \ No newline at end of file
// components/TopToolbarPopup/TopToolbarPopup.js
Component({
externalClasses: ['popup-slot-class'],
properties: {
show: {
type: Boolean,
value: false,
observer: function (n, o) {
n && wx.hideKeyboard()
this.setData({
showPopup: n
})
}
},
title: String,
height: {
type: String,
value: '85%'
},
slotStyle: String
},
data: {
isFullSucreen: false
},
methods: {
noScroll() { },
hidePopup() {
this.setData({
show: false
})
this.triggerEvent('cancel')
},
confirm() {
this.triggerEvent('confirm')
}
},
attached() {
this.setData({
isFullSucreen: wx.$util && wx.$util.isFullSucreen ? wx.$util.isFullSucreen(true) : false
})
}
})
{
"component": true,
"usingComponents": {}
}
<view class="popup" hidden="{{ !showPopup }}" catchtouchmove="noScroll">
<view class="popup-bg" bindtap="hidePopup"></view>
<view class="popup-content" style="height:{{ height }}">
<view class="popup-header">
<view class="action-btn cancel" bind:tap="hidePopup">取消</view>
<view class="title" wx:if="{{ title }}">{{title}}</view>
<view class="action-btn confirm" bind:tap="confirm">确定</view>
</view>
<view class="popup-slot popup-slot-class {{ isFullSucreen?'isFullSucreen':'' }}" style="{{slotStyle}}">
<slot></slot>
</view>
</view>
</view>
/* components/TopToolbarPopup/TopToolbarPopup.wxss */
.popup {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 998;
transform: translateZ(2px);
}
.popup-bg {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, .6);
}
.popup-content {
position: absolute;
left: 0;
width: 100%;
background: #FFFFFF;
border-radius: var(--fontSize20) var(--fontSize20) 0 0;
animation: show-popup .5s forwards;
box-sizing: border-box;
padding: 0 var(--fontSize40);
display: flex;
flex-direction: column;
}
.popup-header {
height: var(--fontSize112);
display: flex;
align-items: center;
justify-content: space-between;
/* border-bottom: var(--fontSize2) solid #EBEDF0; */
flex-shrink: 0;
}
.popup-header .title {
font-size: var(--fontSize34);
color: #333333;
font-weight: bold;
}
.popup-header .action-btn {
font-size: var(--fontSize32);
padding: 0 var(--fontSize10);
}
.popup-header .cancel {
color: #666666;
}
.popup-header .confirm {
color: #2C66F7;
}
.popup-slot {
flex: 1;
overflow-y: auto;
/* height: calc(100% - var(--fontSize98)); */
}
.popup-slot.isFullSucreen {
padding-bottom: var(--fontSize68);
}
@keyframes show-popup {
0% {
bottom: -100%;
}
100% {
bottom: 0;
}
}
// packageWorkspace/pages/validReferralCount/referralCountList/referralCountList.js // packageWorkspace/pages/validReferralCount/referralCountList/referralCountList.js
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
searchObj: {
merchantName: "",
reviewMonth: "",
submitStatus: "",
},
list: [],
filterConfig: [
{
type: "month",
label: "月份",
key: "reviewMonth",
},
{
type: "select",
label: "状态",
key: "submitStatus",
showKey: "submitStatusTxt",
optionId: "confId",
optionLabel: "confLabel",
optionsName: "submitStatusLit",
optionList: [],
},
],
orderStatusMap: {
// "": { name: "订单状态" },
0: { name: "未提交", color: "#FF9D0A", background: "#ff9d0a1a" },
1: { name: "已提交", color: "#35C376", background: "#35C3761a" },
},
orderItem: [
{
label: "单延保",
key: "singleExtendedWarrantySubmitStatus",
},
{
label: "广联权益",
key: "interestSubmitStatus",
},
{
label: "轻改",
key: "lightModificationSubmitStatus",
},
],
singleSubmitStatusMap: {
0: "未提交",
1: "草稿",
2: "已提交",
},
baseData: {
submitStatusLit: [
{
confLabel: "未提交",
confId: "0",
},
{
confLabel: "已提交",
confId: "1",
},
],
},
},
/**
* Filter Change Handler
*/
onFilterChange(e) {
console.log("Filter Changed:", e.detail);
this.setData({
searchObj: e.detail,
});
this.search();
// TODO: Call API to fetch data with new filters
},
// clear() {
// this.setData({ keyword: '' })
// this.search()
// },
search() {
this.setData({
list: [],
pageNum: 1,
flag: false,
nothing: false,
});
this.getList();
},
getList() {
this.setData({
list: [
[
{
merchantName: "D+广州深圳麦田园区店",
// 提交状态:0-未提交 1-已提交
submitStatus: 0,
// 单延保提交状态:0-未提交,1-草稿,2-已提交
singleExtendedWarrantySubmitStatus: 0,
// 广联权益提交状态:0-未提交,1-草稿,2-已提交
interestSubmitStatus: 0,
// 轻改状态:0-未提交,1-草稿,2-已提交
lightModificationSubmitStatus: 0,
},
{
merchantName:
"fjdkjfjsdkfjsdkfjskdfjskldfjkdsjfkdsjfksdjfksldfjksdjfskldfjksldfjksdklfsjdkfsjdkfsjkldfdfsfsfsfs",
submitStatus: 0,
// 单延保提交状态:0-未提交,1-草稿,2-已提交
singleExtendedWarrantySubmitStatus: 1,
// 广联权益提交状态:0-未提交,1-草稿,2-已提交
interestSubmitStatus: 0,
// 轻改状态:0-未提交,1-草稿,2-已提交
lightModificationSubmitStatus: 0,
},
{
merchantName:
"32392932893283298392382989283293829328938232988293892938232938293823",
submitStatus: 0,
// 单延保提交状态:0-未提交,1-草稿,2-已提交
singleExtendedWarrantySubmitStatus: 0,
// 广联权益提交状态:0-未提交,1-草稿,2-已提交
interestSubmitStatus: 0,
// 轻改状态:0-未提交,1-草稿,2-已提交
lightModificationSubmitStatus: 0,
},
{
merchantName:
"嘀加深圳门店店名称门店店名称门店店名称门店店名称门店店名称很长嘀加深圳门店店名称门店店名称门店店名称门店店名称门店店名称很长嘀加深圳门店店名称门店店名称门店店名称门店店名称门店店名称很长",
submitStatus: 1,
// 单延保提交状态:0-未提交,1-草稿,2-已提交
singleExtendedWarrantySubmitStatus: 0,
// 广联权益提交状态:0-未提交,1-草稿,2-已提交
interestSubmitStatus: 0,
// 轻改状态:0-未提交,1-草稿,2-已提交
lightModificationSubmitStatus: 0,
},
],
],
});
return;
let { pageNum, nothing, filterObj, keyword } = this.data;
let userInfo = wx.$util.getUserInfo();
if (nothing) return;
const auditStatus = tabIndex == 1 ? 0 : tabIndex == 2 ? 3 : "";
wx.$util.showLoading();
api
.getRefundReviewListAPI({
sceneType: userInfo.sceneType,
auditStatus,
pageNum,
pageSize: 4,
})
.then((res) => {
wx.$util.hideLoading();
let total = 0;
let list = [];
let { code, data, message } = res;
if (code == 0) {
list = data.list;
total = data.total;
} else {
wx.$util.showToast(message);
}
if (total != 0) {
this.setData({
[`list[${pageNum - 1}]`]: list,
});
}
this.setData({
total,
flag: true,
triggered: false,
pageNum: pageNum + 1,
nothing: pageNum == data.pages,
});
});
},
scrollonReachBottom() {
this.getList();
},
getOptionsList(formName, refreshSigle) {
const formList = this.data[formName];
const { baseData } = this.data;
if (refreshSigle) {
var item = formList.find((k) => k.key == refreshSigle);
var index = formList.findIndex((k) => k.key == refreshSigle);
this.setData({
[`${formName}[${index}].optionList`]: wx.$util.deepClone(
baseData[item.optionsName],
),
});
} else {
formList.forEach((item, index) => {
if (
["select", "radio"].includes(item.type) &&
baseData[item.optionsName].length
) {
this.setData({
[`${formName}[${index}].optionList`]: wx.$util.deepClone(
baseData[item.optionsName],
),
});
}
});
}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.getOptionsList("filterConfig");
this.search();
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() {},
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {},
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide() {},
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {},
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { onPullDownRefresh() {},
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { onReachBottom() {},
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
onShareAppMessage() {},
});
{ {
"usingComponents": {} "usingComponents": {
"FilterBar": "/components/FilterBar/FilterBar"
}
} }
\ No newline at end of file \ No newline at end of file
/* packageWorkspace/pages/validReferralCount/referralCountList/referralCountList.wxss */ /* packageWorkspace/pages/validReferralCount/referralCountList/referralCountList.wxss */
page {
background: #F2F3F7;
}
.list-page {
.flex {
display: flex;
align-items: center;
}
.top-box {
background: #FFFFFF;
}
.list {
.empty-box {
width: 100%;
height: 24rpx;
}
.item {
margin: 0 24rpx 24rpx;
border-radius: 32rpx;
background: #FFFFFF;
padding: 24rpx 32rpx;
.item-top {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin: 0 -24rpx;
padding: 0 24rpx 24rpx;
font-size: 32rpx;
font-weight: 500;
color: #666666;
.code-text {
color: #222222;
margin-right: 28rpx;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
word-break: break-all;
}
.status {
font-size: 24rpx;
flex-shrink: 0;
height: 48rpx;
line-height: 48rpx;
border-radius: 8rpx;
padding: 0 12rpx;
}
}
.order-list {
padding: 24rpx 0;
.order {
font-size: 26rpx;
color: #222222;
// &:last-child {
// margin-bottom: 0;
// }
.order-label {
width: 184rpx;
margin-right: 32rpx;
color: #999999;
}
.order-value {
font-size: 28rpx;
margin-top: 4rpx;
}
}
}
.btn-box {
flex-direction: row-reverse;
justify-content: space-between;
font-weight: 500;
.label {
font-size: 26rpx;
color: #666666;
margin-right: 16rpx;
}
.unit {
margin-right: 8rpx;
}
.btn {
font-weight: 400;
width: 168rpx;
height: 64rpx;
line-height: 64rpx;
text-align: center;
border-radius: 16rpx;
font-size: 26rpx;
color: #2C66F7;
background: #2c66f71a;
&.primary {
color: #FFFFFF;
background: #2c66f7;
}
}
}
}
}
}
\ No newline at end of file \ No newline at end of file
<!--packageWorkspace/pages/validReferralCount/referralCountList/referralCountList.wxml--> <!--packageWorkspace/pages/validReferralCount/referralCountList/referralCountList.wxml-->
<text>packageWorkspace/pages/validReferralCount/referralCountList/referralCountList.wxml</text>
\ No newline at end of file \ No newline at end of file
<!-- <view class="container">
<view class="result-area" style="padding: 20rpx; margin-top: 20rpx;">
<view>筛选结果:</view>
<view>搜索内容:{{searchObj.merchantName || '无'}}</view>
<view>选中月份:{{searchObj.reviewMonth || '无'}}</view>
<view>选中状态:{{searchObj.status || '无'}}</view>
</view>
</view> -->
<view class="list-page">
<view class="top-box">
<FilterBar searchPlaceholder="门店名称" searchKey="merchantName" filters="{{filterConfig}}" searchObj="{{searchObj}}" bind:filterChange="onFilterChange"></FilterBar>
</view>
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{ true }}" bindrefresherrefresh="search" bindscrolltolower="scrollonReachBottom" class="list" style="height:calc(100vh - var(--fontSize184));" refresher-threshold="104" refresher-triggered="{{ triggered }}">
<block wx:if="{{ list.length > 0 }}">
<view class="empty-box"></view>
<block wx:for="{{ list }}" wx:key="index">
<block wx:for="{{ item }}" wx:for-item="li" wx:for-index="ind" wx:key="ind">
<view data-ind="{{ ind }}" data-index="{{ index }}">
<view class="item content" data-ind="{{ ind }}" data-index="{{ index }}" data-item="{{ li }}">
<view class="item-top">
<view class="code">
<text class="code-text">{{li.merchantName}}</text>
</view>
<view class="status text-center" style="color:{{ orderStatusMap[li.submitStatus].color }};background-color:{{orderStatusMap[li.submitStatus].background }};">
{{orderStatusMap[li.submitStatus].name }}
</view>
</view>
<view class="order-list flex">
<view wx:for="{{ orderItem }}" wx:key="sindex" wx:for-index="sindex" wx:for-item="i">
<view class="order">
<view class="order-label">{{i.label}}</view>
<view class="order-value">{{singleSubmitStatusMap[li[i.key]]}}</view>
</view>
</view>
</view>
<view class="btn-box flex">
<view bindtap="handleDetail" data-target="{{li}}" class="btn {{li.submitStatus == 0 ? 'primary' : ''}}">{{li.submitStatus == 0 ? '编辑' : '查看'}}</view>
</view>
</view>
</view>
</block>
</block>
<block wx:if="{{ nothing }}">
<view class="list-nothing">到底了~</view>
</block>
</block>
<block wx:else>
<empty-data />
</block>
</scroll-view>
</view>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!