agentList_body.html 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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. position: static;
  19. transform: translateX(0);
  20. margin: 0 auto;
  21. }
  22. .dingdangenzong {
  23. padding-top: 0;
  24. }
  25. .totalCount {
  26. background-color: #00a0ea !important;
  27. color: #fff;
  28. text-align: center;
  29. padding: 0.3rem 0;
  30. font-size: 0.3rem;
  31. width: 90%;
  32. margin: 0 5%;
  33. border-radius: 5px;
  34. }
  35. .search_input{
  36. color: #B5B5B5;
  37. font-size: .25rem;
  38. width: 100%;
  39. padding-left: .8rem;
  40. }
  41. .mescroll{
  42. position: relative;
  43. height: auto; /*如设置bottom:50px,则需height:auto才能生效*/
  44. }
  45. </style>
  46. <body>
  47. <div id="app" v-cloak>
  48. <div class="pageView dingdangenzong">
  49. <div class="dingdanSearch flex a-center j-center">
  50. <div class="search_box flex a-center">
  51. <input type="text" :placeholder="$t('home.agentList.placeholder')" v-model="agentKeyword" @input="handleSearch">
  52. <!-- <div class="search_input" v-on:click="inSearch">
  53. 请输入门店名称
  54. </div> -->
  55. <div class="fgx"></div>
  56. <div class="search_btn flex a-center" v-on:click="chooseStatus">{{ agentStatus.name }} <i class="iconfont icon-xia"></i> </div>
  57. <van-icon name="search" size="0.32rem" />
  58. </div>
  59. </div>
  60. <div class="totalCount">{{ $t('home.agentList.total') }}:{{ totaltotals }} {{ $t('home.agentList.home') }}</div>
  61. <div class="mendianliebiao mescroll" style="height:calc(100% - 2.0rem)" v-if="list.length&&list.length > 0" id="mescroll">
  62. <div class="item flex a-center" v-for="(item,index) in list" v-on:click="lookStoreInfo(item.mainId)">
  63. <div class="img"><img :src="item.storeImageUrl" onerror="javascript:this.src='../../../../../image/image/noimg.png';"></div>
  64. <div class="infos">
  65. <h2>{{item.storeName}}</h2>
  66. <p><a style="font-weight: 600;">{{ $t('home.agentList.sellBrand') }}:</a>{{item.brands}}</p>
  67. <p><a style="font-weight: 600;">{{ $t('home.agentList.mobile') }}:</a>{{item.storePhone}}</p>
  68. <span>{{ $t('home.agentList.status') }}:{{item.status | statusFilter}}</span>
  69. </div>
  70. <i class="iconfont icon-right"></i>
  71. </div>
  72. <div v-show="hasOther && list.length > 0" style="width: 100%;height: 1rem;margin-top: .5rem;text-align : center;font-size:0.3rem">{{ $t('common.noData') }}</div>
  73. </div>
  74. <div class="view flex col" v-else>
  75. <div style="text-align:center">
  76. <img src="../../../../../image/image/nodata.png" style="margin:2rem auto;width:100%;height:100%" />
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </body>
  82. <!-- <script src="js/vue.js"></script> -->
  83. <script type="text/javascript" src="../../../../../script/aui-scroll.js"></script>
  84. <link rel="stylesheet" href="../../../../../script/mescroll/mescroll.min.css">
  85. <script type="text/javascript" src="../../../../../script/mescroll/mescroll.min.js"></script>
  86. <script type="text/javascript" src="../../../../../script/js/vue.js"></script>
  87. <script type="text/javascript" src="../../../../../script/js/vue-i18n.js"></script>
  88. <script type="text/javascript" src="../../../js/zh.js"></script>
  89. <script type="text/javascript" src="../../../js/en.js"></script>
  90. <script src="../../../../../script/js/vant-ui.js"></script>
  91. <script src="../../../../../script/js/main.js"></script>
  92. <script type="text/javascript" src="../../../../../script/api.js"></script>
  93. <script type="text/javascript" src="../../../js/httpRequest_tbr.js"></script>
  94. <script type="text/javascript" src="../../../../../script/vue_plugins.js"></script>
  95. <script>
  96. apiready = function() {
  97. let langType = $api.getStorage('lang') || 'cn'
  98. const i18n = new VueI18n({
  99. locale: langType,//设置语言
  100. messages: {
  101. en: getEn(),
  102. cn: getCn()
  103. }
  104. })
  105. new Vue({
  106. el: '#app',
  107. i18n,
  108. data: {
  109. list : [],
  110. // 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}],
  111. kunnr: '',
  112. current: 1,
  113. size: 10,
  114. totalPages: 1,
  115. frist : 1,
  116. statuses : [{
  117. code : '',
  118. name : '全部'
  119. },{
  120. code : '0',
  121. name : '审核中'
  122. },{
  123. code : '1',
  124. name : '审核通过'
  125. }],
  126. agentKeyword : '', // 门店名称
  127. agentStatus : {code : '',name : '全部'},
  128. UIActionSelector : '',
  129. mescroll : '',
  130. hasOther : false,
  131. totaltotals : 0,
  132. },
  133. // watch : {
  134. // agentKeyword : function(nw,ow){
  135. // this.current = 1;
  136. // this.getStoreList();
  137. // }
  138. // },
  139. mounted: function() {
  140. this.statuses = [
  141. {
  142. code : '',
  143. name : this.$t('home.agentList.all')
  144. },{
  145. code : '0',
  146. name : this.$t('home.agentList.inReview')
  147. },{
  148. code : '1',
  149. name : this.$t('home.agentList.pass')
  150. }
  151. ]
  152. this.agentStatus = {code : '',name : this.$t('home.agentList.all')};
  153. this.init();
  154. },
  155. methods: {
  156. init: function() {
  157. this.UIActionSelector = api.require("UIActionSelector");
  158. this.kunnr = $api.getStorage('kunnr');
  159. this.getStoreList();
  160. var _this = this;
  161. this.addEvent('refushAgentList',function(){
  162. _this.current = 1;
  163. _this.getStoreList();
  164. })
  165. },
  166. configs : function(){
  167. var _this = this;
  168. this.frist = 2;
  169. this.configDownAndPull("mescroll", function(mescroll) {
  170. _this.list = [];
  171. _this.current = 1;
  172. _this.mescroll = mescroll;
  173. _this.getStoreList(mescroll);
  174. }, function(mescroll) {
  175. if (_this.current < _this.totalPages) {
  176. _this.current = _this.current + 1;
  177. _this.getStoreList(mescroll, 1);
  178. } else {
  179. mescroll.endSuccess(_this.size, false);
  180. }
  181. }, false);
  182. this.configBottomRefush(function(){
  183. if (_this.current < _this.totalPages) {
  184. _this.current = _this.current + 1;
  185. _this.getStoreList(_this.mescroll, 1);
  186. } else {
  187. _this.hasOther = true;
  188. // _this.mescroll.endSuccess(_this.size, false);
  189. }
  190. })
  191. },
  192. getStoreList: function(mescroll) {
  193. var params = {
  194. "agentid": this.kunnr,//"10"
  195. "storestatus": this.agentStatus.code,
  196. "storename":this.agentKeyword,
  197. "current" : this.current,
  198. "size" : this.size,
  199. url: 'json',
  200. type: 'body'
  201. },
  202. _this = this;
  203. this.$post('getRetailerUrl', params, function(ret) {
  204. if (ret.code == 0 || ret.code == '0') {
  205. _this.list = _this.current == 1 ? ret.result.records : _this.list.concat(ret.result.records);
  206. _this.totalPages = ret.result.pages;
  207. _this.totaltotals = ret.result.total;
  208. // _this.list = _this.current == 1 ? _this.demoList : _this.list.concat(_this.demoList);
  209. if(_this.frist == 1){
  210. _this.$nextTick(function(){
  211. _this.configs();
  212. })
  213. }
  214. if(mescroll){
  215. mescroll.endSuccess(_this.size,true);
  216. }
  217. }
  218. });
  219. },
  220. // 点击查看门店详情进行审核
  221. lookStoreInfo: function(id) {
  222. var params = {
  223. storeId: id
  224. }
  225. this.goWin('agentInfo', '../agentInfo/agentInfo_win.html', params);
  226. },
  227. // 筛选状态
  228. chooseStatus : function(){
  229. var _this = this;
  230. this.chooseRegion(this.UIActionSelector,1,this.statuses,function(ret){
  231. if(ret.eventType == 'ok'){
  232. _this.agentStatus = ret.selectedInfo[0];
  233. _this.current = 1;
  234. if(_this.mescroll != ''){
  235. _this.mescroll.resetUpScroll();
  236. _this.mescroll.endSuccess(_this.size,true);
  237. }
  238. _this.getStoreList();
  239. }
  240. })
  241. },
  242. handleSearch: function(){
  243. this.current = 1;
  244. if(this.mescroll != ''){
  245. this.mescroll.resetUpScroll();
  246. this.mescroll.endSuccess(this.size,true);
  247. }
  248. this.getStoreList();
  249. }
  250. },
  251. filters: {
  252. statusFilter: function(v){
  253. //当状态是0时,可能时经销商审核或者是b2b审核中
  254. var statusArr = [{
  255. name: "审核中",
  256. status: 0
  257. },{
  258. name: "审核通过",
  259. status: 1
  260. },{
  261. name: "审核拒绝",
  262. status: 2
  263. }];
  264. var idx;
  265. for(var index=0; index<statusArr.length; index++){
  266. if(v==statusArr[index].status){
  267. idx = index;
  268. }
  269. };
  270. return statusArr[idx].name;
  271. }
  272. }
  273. })
  274. }
  275. </script>
  276. </html>