CodePudding user response:
Brothers, beg on his kneesCodePudding user response:
Small program is the front-end, your needs and c # didn't have anything to do,Small program to achieve pull loads more on https://www.jianshu.com/p/cc3a516224ee
CodePudding user response:
Front I have written, back-end code c # can't write,CodePudding user response:
After you load aren't more like paging, each load will take on the next page of data is returned to the front end traversalCodePudding user response:
You don't have to do is to write a mock data bai,,CodePudding user response:
Pull to refresh more, similar to the paging, you small program to paging parameters to the interface, interface to handle is ok, I give you a piece of code, [public static List//near preferential merchant
SQL=var @ "select aleem walji id,
B.b usiName as business_name,
B.A ddress as business_adr,
Isnull (b.h eaderpic, ' ') as headerpic,
Isnull (b.l atitude, 0) as latitude,
Isnull (b.l ongitude, 0) as the longitude,
Dbo. FnGetDistance (" + latitude + ", "+ + @" longitude, b.l atitude, b.l ongitude) as range_line
The from wx_yyhz_yh_relation a
Left the join wx_userweixin b on aleem walji id=b.i d
Be sad uid chtistina georgina rossetti.british poetess left join wx_yyhz_yh_coupon c on a.c oupon_guid=
Where Anderson sclose=0 and c.i sdelete=0 and b.i sdelete=0
And Arthur c. oupon_close=0-0 normal 1 coupons in suspension
And (the CONVERT (varchar (10), Arthur c. oupon_starttime, 120) & lt;=the CONVERT (varchar (10), GETDATE (), 120)
And the CONVERT (varchar (10), Arthur c. oupon_endtime, 120) & gt;=the CONVERT (varchar (10), GETDATE (), 120))
Group by aleem walji id,
B.b usiName,
B.A ddress.
B.h eaderpic,
B.l atitude, b.l ongitude ";
Using (MAction action=new MAction (SQL)
{
List
if (! String. IsNullOrEmpty (sh_name))
{
Listmode=action. Select (pageindex pagesize, "charindex ('" + sh_name + "', business_name) & gt; Zero order by range_line asc, business_name asc). ToList<" Near_business_couponModel & gt; (a);
}
The else
{
Listmode=action. Select (pageindex pagesize, "order by range_line asc, business_name asc"). The ToList
The foreach (var nearBusinessCouponModel listmode) in
{
//display distance
NearBusinessCouponModel. Range_line=MapHelper. GetDistance (nearBusinessCouponModel latitude, nearBusinessCouponModel. The longitude, latitude and longitude).
//the store's latest coupons
Var top1sql=@ "select top 1 coupon_name from wx_yyhz_yh_coupon
Where coupon_wid='" + nearBusinessCouponModel wid + @ "'
And isdelete=0
And (the CONVERT (varchar (10), coupon_starttime, 120) & lt;=the CONVERT (varchar (10), GETDATE (), 120)
And the CONVERT (varchar (10), coupon_endtime, 120) & gt;=the CONVERT (varchar (10), GETDATE (), 120))
The order by coupon_sendtime desc ";
Action. ResetTable (top1sql);
Var dt=action. The Select (). ToDataTable ();
If (dt. Rows. Count & gt; 0)
{
//the latest coupons name
NearBusinessCouponModel. Coupon_name=dt. Rows [0] [r]. "coupon_name" ToString ();
}
The else
{
NearBusinessCouponModel. Coupon_name="";
}
}
Return listmode;
}
}
] [/code]