agentList_body.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <!DOCTYPE html>
  2. <html class="">
  3. <!--STATUS OK-->
  4. <head>
  5. <meta name="referrer" content="always" />
  6. <meta charset='utf-8' />
  7. <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta http-equiv="x-dns-prefetch-control" content="on">
  9. <meta name="description" content="">
  10. <meta name="format-detection" content="telephone=no" />
  11. <link rel="stylesheet" type="text/css" href="../../../../../css/css/vant-ui.css" />
  12. <link rel="stylesheet" type="text/css" href="../../../../../css/css/iconfont.css">
  13. <link rel="stylesheet" type="text/css" href="../../../../../css/css/main.css" />
  14. <title></title>
  15. </head>
  16. <style>
  17. .dingdangenzong .dingdanSearch {
  18. top: .1rem
  19. }
  20. .dingdangenzong {
  21. padding-top: 1.2rem;
  22. }
  23. .totalCount {
  24. background-color: #00a0ea !important;
  25. color: #fff;
  26. text-align: center;
  27. padding: 0.3rem 0;
  28. font-size: 0.3rem;
  29. width: 90%;
  30. margin: 0 5%;
  31. border-radius: 5px;
  32. }
  33. .search_input{
  34. color: #B5B5B5;
  35. font-size: .25rem;
  36. width: 100%;
  37. padding-left: .8rem;
  38. }
  39. </style>
  40. <body>
  41. <div id="app" v-cloak>
  42. <div class="pageView dingdangenzong">
  43. <div class="totalCount">总共:{{ totaltotals }} 家</div>
  44. <div class="dingdanSearch flex a-center j-center">
  45. <div class="search_box flex a-center">
  46. <input type="text" placeholder="请输入门店名称" v-model="agentKeyword" @input="handleSearch">
  47. <!-- <div class="search_input" v-on:click="inSearch">
  48. 请输入门店名称
  49. </div> -->
  50. <div class="fgx"></div>
  51. <div class="search_btn flex a-center" style="width:1.8rem" v-on:click="chooseStatus">{{ agentStatus.name }} <i class="iconfont icon-xia"></i> </div>
  52. <van-icon name="search" size="0.32rem" />
  53. </div>
  54. </div>
  55. <div class="mendianliebiao" v-show="list.length > 0" id="mescroll">
  56. <div class="item flex a-center" v-for="(item,index) in list" v-on:click="lookStoreInfo(item.mainId)">
  57. <div class="img"><img :src="item.storeImageUrl" onerror="javascript:this.src='../../../../../image/image/noimg.png';"></div>
  58. <div class="infos">
  59. <h2>{{item.storeName}}</h2>
  60. <p><a style="font-weight: 600;">经销品牌:</a>{{item.brands}}</p>
  61. <p><a style="font-weight: 600;">电话:</a>{{item.storePhone}}</p>
  62. <span>状态:{{item.status | statusFilter}}</span>
  63. </div>
  64. <i class="iconfont icon-right"></i>
  65. </div>
  66. <div v-show="hasOther && list.length > 0" style="width: 100%;height: 1rem;;text-align : center;margin-top : 1rem;font-size:0.3rem">暂无更多数据</div>
  67. </div>
  68. <div v-show="list.length == 0" style="text-align:center">
  69. <img src="../../../../../image/image/nodata.png" style="margin:2rem auto;width:100%;height:100%" />
  70. </div>
  71. </div>
  72. </div>
  73. </body>
  74. <!-- <script src="js/vue.js"></script> -->
  75. <script type="text/javascript" src="../../../../../script/aui-scroll.js"></script>
  76. <link rel="stylesheet" href="../../../../../script/mescroll/mescroll.min.css">
  77. <script type="text/javascript" src="../../../../../script/mescroll/mescroll.min.js"></script>
  78. <script type="text/javascript" src="../../../../../script/js/vue.js"></script>
  79. <script src="../../../../../script/js/vant-ui.js"></script>
  80. <script src="../../../../../script/js/main.js"></script>
  81. <script type="text/javascript" src="../../../../../script/api.js"></script>
  82. <script type="text/javascript" src="../../../js/httpRequest_tbr.js"></script>
  83. <script type="text/javascript" src="../../../../../script/vue_plugins.js"></script>
  84. <script>
  85. apiready = function() {
  86. new Vue({
  87. el: '#app',
  88. data: {
  89. list : [],
  90. // list: [{statusName : 1},{statusName : 1},{statusName : 1},{statusName : 1},{statusName : 1},{statusName : 1},{statusName : 1},{statusName : 1},{statusName : 1},{statusName : 1},{statusName : 1},{statusName : 1},{statusName : 1},{statusName : 1},{statusName : 1},{statusName : 1},{statusName : 1}],
  91. kunnr: '',
  92. current: 1,
  93. size: 10,
  94. totalPages: 1,
  95. frist : 1,
  96. statuses : [{
  97. code : '',
  98. name : '全部'
  99. },{
  100. code : '0',
  101. name : '审核中'
  102. },{
  103. code : '1',
  104. name : '审核通过'
  105. }],
  106. agentKeyword : '', // 门店名称
  107. agentStatus : {code : '',name : '全部'},
  108. UIActionSelector : '',
  109. mescroll : '',
  110. hasOther : false,
  111. totaltotals : 0,
  112. },
  113. // watch : {
  114. // agentKeyword : function(nw,ow){
  115. // this.current = 1;
  116. // this.getStoreList();
  117. // }
  118. // },
  119. mounted: function() {
  120. this.init();
  121. },
  122. methods: {
  123. init: function() {
  124. this.UIActionSelector = api.require("UIActionSelector");
  125. this.kunnr = $api.getStorage('kunnr');
  126. this.getStoreList();
  127. var _this = this;
  128. this.addEvent('refushAgentList',function(){
  129. _this.current = 1;
  130. _this.getStoreList();
  131. })
  132. },
  133. configs : function(){
  134. var _this = this;
  135. this.frist = 2;
  136. this.configDownAndPull("mescroll", function(mescroll) {
  137. _this.list = [];
  138. _this.current = 1;
  139. _this.mescroll = mescroll;
  140. _this.getStoreList(mescroll);
  141. }, function(mescroll) {
  142. if (_this.current < _this.totalPages) {
  143. _this.current = _this.current + 1;
  144. _this.getStoreList(mescroll, 1);
  145. } else {
  146. mescroll.endSuccess(_this.size, false);
  147. }
  148. },false);
  149. this.configBottomRefush(function(){
  150. if (_this.current < _this.totalPages) {
  151. _this.current = _this.current + 1;
  152. _this.getStoreList(_this.mescroll, 1);
  153. } else {
  154. _this.hasOther = true;
  155. // _this.mescroll.endSuccess(_this.size, false);
  156. }
  157. })
  158. },
  159. getStoreList: function(mescroll) {
  160. var params = {
  161. "agentid": this.kunnr,//"10"
  162. "storestatus": this.agentStatus.code,
  163. "storename":this.agentKeyword,
  164. "current" : this.current,
  165. "size" : this.size,
  166. url: 'json',
  167. type: 'body'
  168. },
  169. _this = this;
  170. this.$post('getRetailerUrl', params, function(ret) {
  171. if (ret.code == 0 || ret.code == '0') {
  172. _this.list = _this.current == 1 ? ret.result.records : _this.list.concat(ret.result.records);
  173. _this.totalPages = ret.result.pages;
  174. _this.totaltotals = ret.result.total;
  175. // _this.list = _this.current == 1 ? _this.demoList : _this.list.concat(_this.demoList);
  176. if(_this.frist == 1){
  177. _this.$nextTick(function(){
  178. _this.configs();
  179. })
  180. }
  181. if(mescroll){
  182. mescroll.endSuccess(_this.size,true);
  183. }
  184. }
  185. });
  186. },
  187. // 点击查看门店详情进行审核
  188. lookStoreInfo: function(id) {
  189. var params = {
  190. storeId: id
  191. }
  192. this.goWin('agentInfo', '../agentInfo/agentInfo_win.html', params);
  193. },
  194. // 筛选状态
  195. chooseStatus : function(){
  196. var _this = this;
  197. this.chooseRegion(this.UIActionSelector,1,this.statuses,function(ret){
  198. if(ret.eventType == 'ok'){
  199. _this.agentStatus = ret.selectedInfo[0];
  200. _this.current = 1;
  201. if(_this.mescroll != ''){
  202. _this.mescroll.resetUpScroll();
  203. _this.mescroll.endSuccess(_this.size,true);
  204. }
  205. _this.getStoreList();
  206. }
  207. })
  208. },
  209. handleSearch: function(){
  210. this.current = 1;
  211. if(this.mescroll != ''){
  212. this.mescroll.resetUpScroll();
  213. this.mescroll.endSuccess(this.size,true);
  214. }
  215. this.getStoreList();
  216. }
  217. },
  218. filters: {
  219. statusFilter: function(v){
  220. //当状态是0时,可能时经销商审核或者是b2b审核中
  221. var statusArr = [{
  222. name: "审核中",
  223. status: 0
  224. },{
  225. name: "审核通过",
  226. status: 1
  227. },{
  228. name: "审核拒绝",
  229. status: 2
  230. }];
  231. var idx;
  232. for(var index=0; index<statusArr.length; index++){
  233. if(v==statusArr[index].status){
  234. idx = index;
  235. }
  236. };
  237. return statusArr[idx].name;
  238. }
  239. }
  240. })
  241. }
  242. </script>
  243. </html>