求c#小程序上拉加载更多源码

kingsjava 2020-03-01 02:50:06
求c#小程序上拉加载更多。。。 源码 , (不要SQL存储过程的),谢谢。
...全文
517 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
大NY 2020-03-20
  • 打赏
  • 举报
回复
上拉刷新更多。类似分页操作。你从小程序传入分页参数到接口,让接口来处理就ok,我给你贴一段代码。[public static List<near_business_couponModel> Get_Near_Business_Coupon(string sh_name, double longitude, double latitude, int pageindex, int pagesize)
{
//附近优惠商家
var sql = @"select a.wid,
b.busiName as business_name,
b.Address as business_adr,
isnull(b.headerpic,'') as headerpic,
isnull(b.latitude,0) as latitude,
isnull(b.longitude,0) as longitude,
dbo.fnGetDistance(" + latitude + "," + longitude + @",b.latitude,b.longitude) as range_line
from wx_yyhz_yh_relation a
left join wx_userweixin b on a.wid=b.id
left join wx_yyhz_yh_coupon c on a.coupon_guid=c.guid
where a.isclose=0 and c.isdelete=0 and b.isdelete=0
and c.coupon_close=0 --0正常发放 1优惠券暂停发放
and (CONVERT(varchar(10),c.coupon_starttime,120)<= CONVERT(varchar(10),GETDATE(),120)
and CONVERT(varchar(10),c.coupon_endtime,120)>= CONVERT(varchar(10),GETDATE(),120))
group by a.wid,
b.busiName,
b.Address,
b.headerpic,
b.latitude,b.longitude";
using (MAction action = new MAction(sql))
{
List<near_business_couponModel> listmode = new List<near_business_couponModel>();

if (!string.IsNullOrEmpty(sh_name))
{
listmode = action.Select(pageindex, pagesize, "charindex('" + sh_name + "',business_name)>0 order by range_line asc,business_name asc ").ToList<near_business_couponModel>();
}
else
{
listmode = action.Select(pageindex, pagesize, " order by range_line asc,business_name asc ").ToList<near_business_couponModel>();
}

foreach (var nearBusinessCouponModel in listmode)
{
// 显示距离
nearBusinessCouponModel.range_line = MapHelper.GetDistance(nearBusinessCouponModel.latitude, nearBusinessCouponModel.longitude, latitude, longitude);
//获取该店最新优惠券
var top1sql = @"select top 1 coupon_name from wx_yyhz_yh_coupon
where coupon_wid='" + nearBusinessCouponModel.wid + @"'
and isdelete = 0
and (CONVERT(varchar(10),coupon_starttime,120)<= CONVERT(varchar(10),GETDATE(),120)
and CONVERT(varchar(10),coupon_endtime,120)>= CONVERT(varchar(10),GETDATE(),120))
order by coupon_sendtime desc";
action.ResetTable(top1sql);
var dt = action.Select().ToDataTable();
if (dt.Rows.Count > 0)
{
//最新优惠券名称
nearBusinessCouponModel.coupon_name = dt.Rows[0]["coupon_name"].ToString();
}
else
{
nearBusinessCouponModel.coupon_name = "";
}

}
return listmode;
}
}
][/code]
极客诗人 2020-03-11
  • 打赏
  • 举报
回复
你自己写mock数据不就行了呗。。
ft1507999 2020-03-11
  • 打赏
  • 举报
回复
后台端加载更多不就和分页一样吗,每次加载就取下一页的数据返回给前端遍历就好了
kingsjava 2020-03-01
  • 打赏
  • 举报
回复
前端我已经写好,c#后端代码不会写。
X-i-n 2020-03-01
  • 打赏
  • 举报
回复
小程序只是前端,你的需求和C#没有半毛钱关系。 小程序实现上拉加载更多 https://www.jianshu.com/p/cc3a516224ee
kingsjava 2020-03-01
  • 打赏
  • 举报
回复
兄弟们,跪求

62,244

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧