購物車訂單實現

2021-08-14 18:46:46 字數 4635 閱讀 2193

apiservice類

public inte***ce apiservice

myinterceptor類

public class myinterceptor implements interceptor

}okhttputils類

retrofitutils類

public class retrofitutils

}return service;}}

view層介面

public inte***ce iorderview

model介面

public inte***ce iordermodel

}model類

public class ordermodel implements iordermodel

@override

public void onerror(throwable e)

@override

public void onnext(orderbean orderbean)

});}

}ipresenter介面

public inte***ce ipreesenter

orderpresenter類

public class orderpresenter implements ipreesenter

public void dateorder()

});}

@override

public void attach(iorderview view)

@override

public void deach()

}myadapter介面卡

public class myadapter extends recyclerview.adapter

@override

public recyclerview.viewholder oncreateviewholder(viewgroup parent, int viewtype)

@override

public void onbindviewholder(recyclerview.viewholder holder, final int position)

@override

public void onfailure(retrofit2.callcall, throwable t)

});}

});builder.setnegativebutton("取消", new dialoginte***ce.onclicklistener()

});builder.show();

}});

}else if (list.get(position).getstatus()==1)else if (list.get(position).getstatus()==2)

@override

public void onfailure(retrofit2.callcall, throwable t)

});}

});builder.setnegativebutton("取消", new dialoginte***ce.onclicklistener()

});builder.show();

}});}}

@override

public int getitemcount()

return 0;

}class myviewholder extends recyclerview.viewholder }}

myfrag介面卡

public class myfrag extends recyclerview.adapter

@override

public recyclerview.viewholder oncreateviewholder(viewgroup parent, int viewtype)

@override

public void onbindviewholder(recyclerview.viewholder holder, final int position)

@override

public void onfailure(retrofit2.callcall, throwable t)

});}

});builder.setnegativebutton("取消", new dialoginte***ce.onclicklistener()

});builder.show();

}});}}

@override

public int getitemcount()

return 0;

}class myviewholder extends recyclerview.viewholder }}

myqx介面卡

public class myqx extends recyclerview.adapter

@override

public recyclerview.viewholder oncreateviewholder(viewgroup parent, int viewtype)

@override

public void onbindviewholder(recyclerview.viewholder holder, final int position)

@override

public void onfailure(retrofit2.callcall, throwable t)

});}

});builder.setnegativebutton("取消", new dialoginte***ce.onclicklistener()

});builder.show();

}});}}

@override

public int getitemcount()

return 0;

}class myviewholder extends recyclerview.viewholder }}

myzf介面卡

public class myzf extends recyclerview.adapter

@override

public recyclerview.viewholder oncreateviewholder(viewgroup parent, int viewtype)

@override

public void onbindviewholder(recyclerview.viewholder holder, final int position)

}@override

public int getitemcount()

return 0;

}class myviewholder extends recyclerview.viewholder }}

public abstract class basefragmentextends fragment

protected abstract void createpresenter();

@override

public void ondestroy() }}

fragment1類

public class fragment_1 extends basefragmentimplements iorderview

@override

public void showorder(listlist)

@override

protected void createpresenter()

}fragment2類

public class fragment_2 extends basefragmentimplements iorderview

@override

protected void createpresenter()

@override

public void showorder(listlist)

}fragment3類

public class fragment_3 extends basefragmentimplements iorderview

@override

public void showorder(listlist)

@override

protected void createpresenter()

}fragment4類

public class fragment_4 extends basefragmentimplements iorderview

@override

protected void createpresenter()

@override

public void showorder(listlist)

}mainativity主方法類

主頁面布局

待支付布局(daizhifu.xml)

item_popup.xml布局

qb_item布局

qx_item布局

yizhifu.xml布局

購物車實現步驟

1 登陸介面login.php 註冊 insert into tbl user 登入 select from tbl user 2 商品展示頁面carlist.php insert into tbl product mysql connect sql mysql query mysql fetch ...

php cookie 實現購物車

php cookie實現購物車思路 首先把獲取到的資料進行序列化,之後新增到cookie中,之後再取出 取出之前去除反斜槓 用stripslashes函式解決 注釋 預設情況下,php 指令 magic quotes gpc 為 on,對所有的 get post 和 cookie 資料自動執行 ad...

Cookie實現 購物車

購物流程圖 採用cookie實現購物車,由於cookie的儲存空降最大只有4kb,所盡量不要存太多的資料,存一下商品編號 數量就可以啦!listinfo.aspx向購物車的新增商品的方法 csharp view plain copy private void gouwu string name,do...