Closed 12mmmjkl closed 3 years ago
可以贴出具体的代码信息看看?
像这样,在查询页面,对于找到的账单数据点击是没有弹出编辑选项的。 原来的search的wxml里没有引入dialog <dialog visible="{{showMenuDialog}}" bind:closeDialog="closeDialog"> <view slot="content"> <view class="pop-indicator"></view> <view class="d-header"> {{editItem.category.categoryName}} <view class="dialog-tip">金额:{{editItem.flow === 0 ? '-' : '+'}}{{editItem.money}},记账日期:{{editItem.noteDate}}</view> <view class="dialog-tip" wx:if="{{editItem.description}}">备注:{{editItem.description}}</view> </view> <view class='list-item-btn' style="color: #4fd69c;" bindtap="editBill">编辑</view> <view class='list-item-btn' style="color: #f75676;" bindtap="deleteBill"> {{showConfirmDelete ? '再次点击确认删除' : '删除'}} </view> <view class='list-item-btn' bindtap="closeDialog" style="border-bottom: none;">取消</view> </view> </dialog>
我cv这个发现不行
这是使用的代码 <nav class="nav-instance" showIcons="{{['back']}}" ></nav> <view class="search"> <view class="banner"> <view class="banner-show"> <image src="https://images.vrm.cn/2019/08/29/pig.png" style="width: 120rpx;height: 120rpx;" bindtap="resetSearch" ></image> <view class='pig-talk' wx:if="{{word}}" bindtap="resetSearch"> <view class='word-tang-left'></view> <view class='word-detail'>{{word}}</view> </view> </view> </view> <input type="text" class="search-input" value="{{keyword}}" bindinput="onInputChange" auto-focus focus="{{isFocus}}" confirm-type="search" bindconfirm='confirmTap' /> </view> <view class="search-result"> <view class="place"></view> <scroll-view scroll-y="{{true}}" style="height: {{$.sysInfo.screenHeight - (($.sysInfo.screenHeight + 442.49) / 4.67)}}px;" class="bill-list"> <view class="empty-search" wx:if="{{isSearching}}">查询中...</view> <view class="empty-search" wx:if="{{billList.length === 0 && !isSearching}}">没有找到账单( ´・・)ノ(._.`)</view> <view class="bill-item" wx:for="{{billList}}" wx:key="{{item._id}}" > <view class="type-date"> <view class="type">{{item.category.categoryName}}</view> <view class="description" wx:if="{{item.description}}">{{item.description}}</view> </view> <view class="money-date"> <view> <view class="money" style="color: {{ item.flow === 1 ? '#4fd69c;' : '#f75676;'}}"> {{item.flow === 0 ? '-' : '+'}}{{item.money}} </view> <view class="date">{{item.noteDate}}</view> </view> </view> </view> </scroll-view> </view> <dialog visible="{{showMenuDialog}}" bind:closeDialog="closeDialog"> <view slot="content"> <view class="pop-indicator"></view> <view class="d-header"> {{editItem.category.categoryName}} <view class="dialog-tip">金额:{{editItem.flow === 0 ? '-' : '+'}}{{editItem.money}},记账日期:{{editItem.noteDate}}</view> <view class="dialog-tip" wx:if="{{editItem.description}}">备注:{{editItem.description}}</view> </view> <view class='list-item-btn' style="color: #4fd69c;" bindtap="editBill">编辑</view> <view class='list-item-btn' style="color: #f75676;" bindtap="deleteBill"> {{showConfirmDelete ? '再次点击确认删除' : '删除'}} </view> <view class='list-item-btn' bindtap="closeDialog" style="border-bottom: none;">取消</view> </view> </dialog>
import { strip } from '../../util'
const { importStore } = getApp() const { create, store } = importStore let isNotifyReset = false create.Page(store, { use: ['sysInfo.screenHeight', 'sysInfo.statusBarHeight'], data: { billList: null, isSearching: false, word: '', isFocus: true, keyword: '', isSearched: false, showMenuDialog: false, editItem: {}, }, confirmTap() { const { keyword } = this.data const self = this if (!keyword || !keyword.trim()) return
// 查询操作
self.setData({
isSearching: true,
billList: [],
})
wx.cloud.callFunction({
name: 'search',
data: {
keyWord: keyword,
},
success(res) {
if (res.result.code === 1) {
const billList = res.result.data
let income = 0
let pay = 0
billList.forEach((bill) => {
if (Number(bill.flow) === 0) pay += bill.money
if (Number(bill.flow) === 1) income += bill.money
})
self.setData({
billList,
isSearched: true,
word: 关键字 ${keyword} 搜索结果:收入共:${strip(income)},支出共:${strip(pay)}
,
})
}
},
fail() {
getApp().showError('查询出错,要不稍后再试😢')
},
complete() {
self.setData({
isSearching: false,
})
},
})
},
onInputChange(event) {
const { value } = event.detail
const { word } = this.data
// 做判断,如果输入文字并且还没搜索出结果就提示重置
if (value && word !== '点猪重置输入哦~' && !isNotifyReset) {
this.setData({
word: '点猪重置输入哦~',
isSearched: false,
})
isNotifyReset = true
}
this.setData({
keyword: value,
})
},
resetSearch() {
this.setData({
keyword: '',
word: '',
isFocus: true,
})
},
})
json: { "component": true, "usingComponents": { "dialog": "../dialog/dialog" } }
css: page { background-color: #e1dbff; } .banner { width: 100%; display: flex; justify-content: center; align-items: center; }
.banner-show { display: flex; align-items: center; margin-bottom: 20rpx; }
.pig-talk { display: flex; align-items: center; padding: 14rpx 0; justify-content: center; margin-left: 27rpx; }
.word-tang-left { width: 0; height: 0; border-bottom: 10px solid rgba(255, 142, 142, 0.8); border-left: 10px solid transparent; }
.word-detail { max-width: 500rpx; font-size: 25rpx; background-color: rgba(255, 142, 142, 0.8); padding: 9px; border-radius: 24rpx; word-break: break-all; word-wrap: break-word; overflow: hidden; text-align: left; } .search { text-align: center; position: fixed; width: 100%; } .search-input { background-color: #6147ff; height: 80rpx; border-radius: 26rpx; width: 72%; margin: 0 auto; color: #fff; padding: 0 30rpx; font-weight: bold; box-shadow: 0px 10px 13px 4px #b0a5ff; } .bill-item { display: flex; justify-content: space-between; align-items: center; margin: 20rpx 30rpx; padding: 20rpx 30rpx; background-color: #fff; border-radius: 14rpx; } .date { color: #ccc; font-size: 25rpx; text-align: right; min-width: 140rpx; } .type { background: #5e72e4; color: #fff; border-radius: 7rpx; font-size: 22rpx; padding: 5rpx 10rpx; width: fit-content; margin-top: 3rpx; } .money { font-size: 42rpx; text-align: right; } .description { font-size: 27rpx; margin: 13rpx 0 0; } .place { width: 100%; height: 281rpx; } .empty-search { font-size: 28rpx; color: grey; text-align: center; margin-top: 70px; }
你好,还想请教一个问题 饼图统计可以设置成统计一整年的吗?
----------------- 原始邮件 ------------------ 发件人: "GzhiYi/dandan-account" @.>; 发送时间: 2021年3月17日(星期三) 中午1:38 @.>; @.**@.>; 主题: Re: [GzhiYi/dandan-account] 在search页面可以对找到的账单信息进行编辑吗? (#87)
可以贴出具体的代码信息看看?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
我在搜索结果的项目上未加入编辑功能,急用的话可以通过时间筛选找到对应的账单进行编辑。后续考虑增加这个功能。如果你可以写的话,也可以新增这个功能。和历史账单的操作一致,通过id去修改账单的信息就好了。
饼图统计暂时不能统计一年的。
好的,谢谢你
------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年3月22日(星期一) 上午10:34 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [GzhiYi/dandan-account] 在search页面可以对找到的账单信息进行编辑吗? (#87)
我在搜索结果的项目上未加入编辑功能,急用的话可以通过时间筛选找到对应的账单进行编辑。后续考虑增加这个功能。如果你可以写的话,也可以新增这个功能。和历史账单的操作一致,通过id去修改账单的信息就好了。
饼图统计暂时不能统计一年的。
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
在search的json那里引入dialog发现不能使用。这是什么问题呢?