123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>代理商中心</title>
- <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <link rel="stylesheet" type="text/css" href="//css.iamberry.com/tooth/css/mui.min.css?v=2017101701" />
- <link rel="stylesheet" type="text/css" href="//css.iamberry.com/tooth/css/iconfont.css?v=2017101701" />
- <link rel="stylesheet" type="text/css" href="//css.iamberry.com/tooth/css/style.css?v=2017101701" />
- <style>
- .vip-tt {position: relative;height: 130px;background-color: #4bb1d1;}
- .tx{background-color: #86d6f1;}
- .mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body {font-size: 15px;line-height: 15px;display: inline-block;width: auto;height: 34px;margin-top:2px;text-overflow: ellipsis;color: #333;text-align: left;}
- .my-chart-bar {background: #fff;border: 0;height: 50px;margin-bottom: 1px;border-top:1px solid rgba(0,0,0,.1);border-bottom: 1px solid rgba(0,0,0,.1);}
- .my-chart-bar .mui-control-item {color: #444;font-weight: 500;border-left: 0;line-height: 50px;font-size: 15px;position: relative;}
- .my-chart-bar .mui-control-item.mui-active {color: #55c0dc;background-color: #fff;}
- .my-chart-bar .mui-control-item.mui-active:after{content: '';position: absolute;bottom: 0;left: 50%;width: 3.5em;height: 2px;background-color: #55c0dc;-webkit-transform: translateX(-50%);}
- .mui-control-content {background: #fff;padding: 10px 0;}
- .my-tab-view3:after {height: 0;}
- .my-tab-view3 li {padding: 10px 10px 0 10px;}
- .mui-table-view.mui-grid-view .fenxiao_wm2,.mui-table-view.mui-grid-view .fenxiao_share,#iwant_dinghuo,#dinghuo_log{display:none;}
- .mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body{position: relative;}
- .my-cell {float: left;margin-top: 10px;}
- .my-btn{background-color: transparent;border: 1px solid #fff;color: #fff;box-shadow: 0 0 0 #fff;padding: 6px 18px;}
- .my-btn:active{background-color: transparent !important;}
- s{margin-left: 15px;}
- .mui-table-view .mui-media-object { line-height: 52px; max-width: 52px; height: 52px; }
- .mui-media-body{line-height: 28px;}
- .mui-table-view:after,.mui-table-view:before,.mui-table-view .mui-table-view-cell:after{display: none;}
- .mui-table-view .my-tab-view-cell{position: relative;}
- .mui-table-view .my-tab-view-cell:before{content: '';position: absolute;left: 15px;top: 0;right: 15px;width: auto;height: 1px;background-color: rgba(0,0,0,.1);}
- .mui-table-view .my-tab-view-cell:after{content: '';position: absolute;left: 15px;bottom: 0;right: 15px;width: auto;height: 1px;background-color: rgba(0,0,0,.2);display: block;}
- .icon-dingwei{color:#ff4d4d !important;}
- .btn-pay,.btn-odt,.btn-wuliu{background-color: #54c0dc !important;border-radius: 0 !important;color: #fff !important;border: 0;padding: 6px 20px;}
- .my-tab-view-pull>li{margin-bottom: 10px;}
- </style>
- <script>
- // 屏蔽分享
- window.hiddenAllWechatMenu = true;
- </script>
- </head>
- <body>
- <div id="pullrefresh" class="mui-content mui-scroll-wrapper">
- <div class="mui-scroll">
- <div class="vip-tt">
- <div class="tx bg-orange fenxiao_info" id="headDiv">
- <!--<img class="wechat_tx" src="images/image-12.jpg">-->
- </div>
- <div class="nikname">
- <div class="wechat_name" style="position: relative;"></div>
- <div id="userNickname">姓名</div>
- <div id="agentTel">13800138000</span>
- </div>
- </div>
- <span style="position: absolute;top: 50%;right:10px;-webkit-transform: translateY(-50%);"><button type="button" class="my-btn go-purchasing">去采购</button></span>
- </div>
-
- <div style="padding:15px 10px;background-color: #fff;">
- 采购记录
- </div>
- <div id="tabbar-chart-bar" class="mui-segmented-control my-chart-bar">
- <a class="mui-control-item item1 mui-active">
- 待支付
- </a>
- <a class="mui-control-item item2">
- 待发货
- </a>
- <a class="mui-control-item item5">
- 已发货
- </a>
- </div>
- <ul class="my-tab-view-pull">
- <!--<li>
- <ul class="mui-table-view">
- <li class="mui-table-view-cell mui-media">
- <a href="javascript:;">
- <img class="mui-media-object mui-pull-left" src="images/cp-1.jpg">
- <div class="mui-media-body">
- 水时代上朵电动牙刷<span class="mui-pull-right">黑色 X10</span>
- <p>¥100<s>原价:¥198</s><span class="mui-pull-right cl-red">小计:¥1000</span></p>
- </div>
- </a>
- </li>
- <li class="mui-table-view-cell mui-media">
- <a href="javascript:;">
- <img class="mui-media-object mui-pull-left" src="images/cp-1.jpg">
- <div class="mui-media-body">
- 水时代上朵电动牙刷<span class="mui-pull-right">黑色 X10</span>
- <p>¥100<s>原价:¥198</s><span class="mui-pull-right cl-red">小计:¥1000</span></p>
- </div>
- </a>
- </li>
- <li class="mui-table-view-cell my-tab-view-cell">
- <a class="mui-navigate-right"><span class="iconfont icon-dingwei" style="color:#ff4d4d;font-size: 20px;margin-right: 5px;"></span>收货信息:罗文文 159****9999</a>
- </li>
- <li class="mui-table-view-cell">
- <input type="text" class="mui-text-center" value="请尽快发货,着急使用" style="font-size: 14px;margin-bottom: 0;"/>
- </li>
- <li class="mui-table-view-cell">
- 共计12件产品<span class="mui-pull-right cl-red">总计:¥1200</span>
- </li>
- <li class="mui-table-view-cell mui-text-center">
- <button type="button" class="btn-pay">立即支付</button>
- </li>
- </ul>
- </li>
- <li>
- <ul class="mui-table-view">
- <li class="mui-table-view-cell mui-media">
- <a href="javascript:;">
- <img class="mui-media-object mui-pull-left" src="images/cp-1.jpg">
- <div class="mui-media-body">
- 水时代上朵电动牙刷<span class="mui-pull-right">黑色 X10</span>
- <p>¥100<s>原价:¥198</s><span class="mui-pull-right cl-red">小计:¥1000</span></p>
- </div>
- </a>
- </li>
- <li class="mui-table-view-cell mui-media">
- <a href="javascript:;">
- <img class="mui-media-object mui-pull-left" src="images/cp-1.jpg">
- <div class="mui-media-body">
- 水时代上朵电动牙刷<span class="mui-pull-right">黑色 X10</span>
- <p>¥100<s>原价:¥198</s><span class="mui-pull-right cl-red">小计:¥1000</span></p>
- </div>
- </a>
- </li>
- <li class="mui-table-view-cell my-tab-view-cell">
- <a class="mui-navigate-right"><span class="iconfont icon-dingwei" style="color:#ff4d4d;font-size: 20px;margin-right: 5px;"></span>收货信息:罗文文 159****9999</a>
- </li>
- <li class="mui-table-view-cell">
- <input type="text" class="mui-text-center" value="请尽快发货,着急使用" style="font-size: 14px;margin-bottom: 0;"/>
- </li>
- <li class="mui-table-view-cell">
- 共计12件产品<span class="mui-pull-right cl-red">总计:¥1200</span>
- </li>
- <li class="mui-table-view-cell mui-text-center">
- <button type="button" class="btn-wuliu">查看物流</button> <button type="button" class="btn-odt">再次购买</button>
- </li>
- </ul>
- </li>-->
- </ul>
- </div>
- </div>
- <script src="//s.iamberry.com/tooth/js/mui.min.js?v=2017101701"></script>
- <script src="//s.iamberry.com/tooth/js/jquery-2.1.1.min.js"></script>
- <script src="//s.iamberry.com/tooth/js/shop/main.js?v=2017101701"></script>
- <script src="//s.iamberry.com/tooth/js/shop/wechat-utils-1.0.js"></script>
- <script>
- var pageNumber = 0,pagesize = 10,tabindex='1',onece=0;
- mui.init({
- pullRefresh: {
- container: '#pullrefresh',
- down: {
- // callback: pulldownRefresh
- },
- up: {
- contentrefresh: '正在加载...',
- callback: pullupRefresh
- }
- }
- });
- /**
- * 上拉加载具体业务实现
- */
- function pullupRefresh() {
- ++pageNumber;
- $.ajax(base_path + '/agentOrder/select_agent_order_list?dates=' + new Date().getTime(), {
- data: {
- "pageNO": pageNumber,
- "pageSize": pagesize,
- "status":tabindex
- },
- dataType: 'json',
- xhrFields: {
- withCredentials: true
- },
- crossDomain: true,
- type: 'post',
- timeout: 15000,
- success: function(dt) {
- console.log(dt);
- if(dt.isRedirect) {
- location.href = dt.redirectURL;
- }else{
- if(dt.resultCode=="200"){
- if(onece==0){
- $("#headDiv").html('<img class="wechat_tx" src="'+dt.data.agent.agentHead+'">');
- $("#userNickname").text(decodeURI(dt.data.agent.agentName));
- $("#agentTel").text(dt.data.agent.agentTel);
- onece=1;
- }
- var table = document.body.querySelector('.my-tab-view-pull');
- //参数为true代表没有更多数据了。
- var data=dt.data.agentOrderList;
- mui('#pullrefresh').pullRefresh().endPullupToRefresh(data.length < pagesize);
- mui(data).each(function(index){
- var th=this;
- var li = document.createElement('li');
- var str='',liuyan='',allcount=0;
- mui(th.itemList).each(function(e){
- str+='<li class="mui-table-view-cell mui-media"><a><img class="mui-media-object mui-pull-left" src="'+this.itemProductPic+'"><div class="mui-media-body">'+this.itemProductName+'<span class="mui-pull-right">'+this.itemColorName+' X '+this.itemNum+'</span><p>¥'+accDiv(this.itemProductDiscount,100)+'<s>原价:¥'+accDiv(this.itemProductPrice,100)+'</s><span class="mui-pull-right cl-red">小计:¥'+accDiv(this.itemTotal,100)+'</span></p></div></a></li>';
- allcount+=this.itemNum;
- });
- var zhidu='',btn_list='';
- zhidu='readonly="readonly"';
- if(tabindex==1){
- btn_list='<li class="mui-table-view-cell mui-text-center"> <button type="button" class="btn-pay" name="'+this.agentOrderid+'">立即支付</button> </li>';
- }else if(tabindex==2){
- btn_list='<li class="mui-table-view-cell mui-text-center"><button type="button" class="btn-odt">再次购买</button></li>';
- }else if(tabindex==5){
- btn_list='<li class="mui-table-view-cell mui-text-center"><button type="button" class="btn-wuliu">查看物流</button> <button type="button" class="btn-odt">再次购买</button> </li>';
- }
- liuyan='<li class="mui-table-view-cell"><input type="text" class="mui-text-center mui-input-clear" placeholder="填写订单备注" value="'+th.agentAdminRemark+'" style="font-size: 14px;margin-bottom: 0;" '+zhidu+'></li>';
- li.innerHTML='<ul class="mui-table-view">'+str+'<li class="mui-table-view-cell my-tab-view-cell"><a class="mui-navigate-right"><span class="iconfont icon-dingwei" style="color:#ff4d4d;font-size: 20px;margin-right: 5px;"></span>收货信息:'+th.agentAddressName+th.agentAddressTel+'</a></li>'+liuyan+'<li class="mui-table-view-cell">共计'+allcount+'件产品<span class="mui-pull-right cl-red">总计:¥'+accDiv(th.agentYetAmount,100)+'</span></li>'+btn_list+'</ul>';
- table.appendChild(li);
- });
- }else{
- mui.alert("获取数据失败!");
- }
- }
- },
- error: function(xhr, type, errorThrown) {
- console.log(xhr);
- mui.alert("获取数据失败,请检查网络或稍后重试!");
- }
- });
- }
- mui.ready(function() {
- tabindex = getParam("tabindex");
- tabindex == null ? tabindex = 1 : tabindex;
- $("#tabbar-chart-bar .mui-control-item").removeClass('mui-active');
- $("#tabbar-chart-bar .item"+tabindex).addClass("mui-active");
- mui('#pullrefresh').pullRefresh().pullupLoading();
- });
- mui.each(document.querySelectorAll('#tabbar-chart-bar .mui-control-item'), function(index, el) {
- el.addEventListener('tap', function() {
- pageNumber = 0;
- switch(index) {
- case 0:
- tabindex = 1;
- break;
- case 1:
- tabindex = 2;
- break;
- case 2:
- tabindex = 5;
- break;
- default:
- tabindex = 1;
- break;
- }
- $('.my-tab-view-pull').empty();
- mui('#pullrefresh').pullRefresh().refresh(true);
- mui('#pullrefresh').pullRefresh().pullupLoading();
- mui('#pullrefresh').scroll().scrollTo(0,0,10);//10毫秒滚动到顶
- }, false);
- });
- mui('body').on('tap','.go-purchasing,.btn-odt',function() {
- location.href='/tooth/view/agent_tooth/purchasing_products.html';
- });
- var isPay=true;
- mui('body').on('tap','.btn-pay',function() {
- if (isPay) {
- isPay = false;
- mui.ajax('/tooth/pay/orderToPay',
- {
- data : {
- "orderId":this.getAttribute("name")
- },
- dataType : 'json',
- type : 'POST',
- timeout : 15000,
- success : function(dt) {
- if (dt.status) {
- var str = dt.data.info;
- var obj = JSON.parse("{" + str + "}");
- WeixinJSBridge.invoke('getBrandWCPayRequest',obj, function(res) {
- if (res.err_msg == 'get_brand_wcpay_request:ok') {
- var orderIds = {
- "orderId" : dt.data.orderId
- };
- mui.ajax(base_path + '/order/checkOrderPaySuccess',
- {
- data : orderIds,
- dataType : 'json',
- type : 'post',
- timeout : 15000,
- success : function(
- dt) {
- if (dt.status) {
- window.location.href = base_path
- + "/order/paySuccess?orderId="
- + orderIds.orderId
- + "&dates="
- + new Date().getTime()
- } else {
- isPay = false;
- setTimeout(
- checkOrderStatus(orderIds),
- 1000)
- }
- },
- error : function(
- xhr,
- type,
- errorThrown) {
- isPay = true;
- layer
- .closeAll();
- mui
- .alert("您的网络异常,请刷新重试!");
- return
- }
- })
- } else {
- isPay = true;
- mui
- .alert("对不起,支付失败!请稍后重试!"
- + dt.data.orderId
- + "支付失败!");
- mui.openWindow({
- url: '/tooth/view/agent_tooth/agent_center.html'
- })
- ;
- }
- })
- } else {
- isPay = true;
- mui.alert(dt.message)
- }
- },
- error : function(xhr, type, errorThrown) {
- isPay = true;
- mui.alert("您的网络异常,请刷新重试!");
- return
- }
- })
- } else {
- mui.alert("正在请求支付中~~请稍后!");
- return
- }
- });
- // 校验订单状态
- function checkOrderStatus(orderId) {
- var url = base_path + "/order/checkOrderPaySuccess";
- var order = {
- "s": new Date().getTime(),
- "orderId": orderId
- };
- $.getJSON(url, order, function(data) {
- if(data.status == true) { // 支付成功
- window.location.href = base_path + "/order/paySuccess?orderId=" + orderId + "&dates=" + new Date().getTime();
- } else {
- window.location.href = '/tooth/view/agent_tooth/agent_center.html';
- }
- });
- }
- </script>
- </body>
- </html>
|