home.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  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. <script src="https://b2bcnfile.sailuntire.com/upload/outerstyle/agentCommon/TBR/js/tbr_role_config.js?v=2" charset="utf-8"></script>
  15. <script src="../../../../script/js/vue.js"></script>
  16. <script src="../../../../script/js/vant-ui.js"></script>
  17. <script src="../../../../script/js/main.js"></script>
  18. <title></title>
  19. </head>
  20. <style>
  21. .menu .item p {
  22. font-size: 0.26rem;
  23. }
  24. .line1 {
  25. width:300px;
  26. overflow: hidden;
  27. text-overflow:ellipsis;
  28. }
  29. </style>
  30. <body>
  31. <div id="app">
  32. <div class="header flex a-center j-center line1" id="aui-header" style="height: 1.5rem;font-size: 0.4rem;width : 100%;text-align:center">
  33. <p class="line1">{{ agentName }}</p>
  34. </div>
  35. <div class="view flex col">
  36. <div class="page router fx1" style="padding-top: 0.86rem;" :style="{'padding-bottom':footerHeight+'px'}" id="mescroll">
  37. <!-- <div class="header flex a-center j-center" id="aui-header">
  38. 赛轮轮胎经销商
  39. <div class="toobla">
  40. <div class="icon4"></div>
  41. </div>
  42. </div>-->
  43. <div style="background-color:#00a0ea;height:.5rem;width:100%">
  44. </div>
  45. <div class="banner">
  46. <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
  47. <van-swipe-item v-if="!storeBrand.length"><img src="../../../../image/image/banner1.png">
  48. </van-swipe-item>
  49. <van-swipe-item v-else v-for="(item,index) in storeBrand" :key="index"><img :src="item.imgPath"></van-swipe-item>
  50. </van-swipe>
  51. </div>
  52. <div class="homeTipbox flex a-center">
  53. <div class="laba"></div>
  54. <div class="labaInfos">
  55. <van-swipe style="height: .35rem;" :autoplay="3000" :show-indicators="false" vertical >
  56. <van-swipe-item v-for="(item,index) in messageList" :key="index">{{item.msgContent}}</van-swipe-item>
  57. </van-swipe>
  58. </div>
  59. </div>
  60. <div class="menu flex wrap">
  61. <div v-if="roleConfig[subRoleName].pages[0].subEle.orderList.isShow" class="item flex col a-center j-center" v-on:click="openWin('orderList')">
  62. <b class="icon c2"></b>
  63. <p>
  64. 门店订单
  65. </p>
  66. </div>
  67. <div v-if="roleConfig[subRoleName].pages[0].subEle.fac_storage.isShow" class="item flex col a-center j-center" v-on:click="openWin('fac_storage')">
  68. <b class="icon c3"></b>
  69. <p>
  70. 工厂库存
  71. </p>
  72. </div>
  73. <!-- <div class="item flex col a-center j-center" v-on:click="openWin('propaganda')">
  74. <b class="icon c4"></b>
  75. <p>
  76. 厂家宣传
  77. </p>
  78. </div> -->
  79. <!-- <div class="item flex col a-center j-center" v-on:click="openWin('agentList')">
  80. <b class="icon c5"></b>
  81. <p>
  82. 签约审核
  83. </p>
  84. </div> -->
  85. <div v-if="roleConfig[subRoleName].pages[0].subEle.intoStore.isShow" class="item flex col a-center j-center" v-on:click="openWin('intoStore')">
  86. <b class="icon c6"></b>
  87. <p>
  88. 门店进货分析
  89. </p>
  90. </div>
  91. <div v-if="roleConfig[subRoleName].pages[0].subEle.b2b_order_list.isShow" class="item flex col a-center j-center" v-on:click="openWin('b2b_order_list')">
  92. <b class="icon c7"></b>
  93. <p>
  94. 订单跟踪
  95. </p>
  96. </div>
  97. <!-- <div class="item flex col a-center j-center" v-on:click="scanCode">
  98. <b class="icon c8"></b>
  99. <p>
  100. 核销审核
  101. </p>
  102. </div> -->
  103. </div>
  104. <div class="workField flex a-center">
  105. <div class="sup"></div>
  106. <h4>快速工作栏</h4>
  107. </div>
  108. <div class="workFieldContainer flex jlr wrap">
  109. <div v-if="roleConfig[subRoleName].pages[0].subEle.agentList.isShow" class="item"><img src="../../../../image/image/mendian1.png" v-on:click="openWin('agentList')"></div>
  110. <div v-if="roleConfig[subRoleName].pages[0].subEle.backList.isShow" class="item"><img src="../../../../image/image/hexiao1.png" v-on:click="openWin('backList')"></div>
  111. <div v-if="roleConfig[subRoleName].pages[0].subEle.propaganda.isShow" class="item"><img src="../../../../image/image/111.png" v-on:click="openWin('propaganda')"></div>
  112. <div v-if="roleConfig[subRoleName].pages[0].subEle.agent_storage.isShow" class="item"><img src="../../../../image/image/myku.png" v-on:click="openWin('agent_storage')"></div>
  113. <img src="../../../../image/image/banner_bottom.png" style="height : 3rem">
  114. </div>
  115. <div class="workField flex a-center">
  116. <div class="case"><img src="../../../../image/img/images/work.png">
  117. </div>
  118. <h4>本月进货 TOP 10</h4>
  119. </div>
  120. <ul class="jinhuoRank">
  121. <li class="flex a-center" v-for="(item,index) in storeList" style="height:2.5rem">
  122. <!-- <div class="image"><img :src="item.storeImageUrl">
  123. </div> -->
  124. <div class="info">
  125. <p>
  126. 门店名称:{{ item.storeName }}
  127. </p>
  128. <p>
  129. 联系电话:{{ item.storePhone }}
  130. </p>
  131. <p>
  132. 经销品牌:{{ item.brandName }}
  133. </p>
  134. <div style="display:flex">
  135. <p style="flex : 1">
  136. 签约任务:{{ item.signCount }}条
  137. </p>
  138. <p style="flex : 1">
  139. 扫码入库数:{{ item.count }}条
  140. </p>
  141. </div>
  142. </div>
  143. <div class="fgx"></div>
  144. <div class="rankwrap flex col a-center j-center">
  145. <h2>{{ (index + 1)}}</h2>
  146. TOP
  147. </div>
  148. </li>
  149. </ul>
  150. </div>
  151. </div>
  152. </div>
  153. </body>
  154. </html>
  155. <link rel="stylesheet" href="../../../../script/mescroll/mescroll.min.css">
  156. <script type="text/javascript" src="../../../../script/mescroll/mescroll.min.js"></script>
  157. <script type="text/javascript" src="../../../../script/api.js"></script>
  158. <script type="text/javascript" src="../../js/httpRequest_tbr.js"></script>
  159. <script type="text/javascript" src="../../../../script/vue_plugins.js"></script>
  160. <script type="text/javascript">
  161. apiready = function() {
  162. var header = $api.byId('aui-header');
  163. $api.fixStatusBar(header);
  164. var headerPos = $api.offset(header);
  165. if (api.systemType == 'android') {
  166. $api.css($api.byId('app'), 'padding-top:20px');
  167. $api.css($api.byId('content'),'margin-top:' + (headerPos.h-20) + 'px');
  168. };
  169. var roleConfig = $role;
  170. new Vue({
  171. el : '#app',
  172. data : {
  173. footerHeight : 0,
  174. list : [],
  175. agentName : '',
  176. icon : [{
  177. label : '首页',
  178. path : '/',
  179. active : "../../../../image/img/images/tabar_home_active.png",
  180. inactive : "../../../../image/img/images/tabar_home_inactive.png"
  181. }, {
  182. label : '发现',
  183. path : '/discover',
  184. active : '../../../../image/img/images/faxian.png',
  185. inactive : '../../../../image/img/images/faxian.png'
  186. }, {
  187. label : '消息',
  188. path : '/information',
  189. active : '../../../../image/img/images/xiaoxi.png',
  190. inactive : '../../../../image/img/images/xiaoxi.png'
  191. }, {
  192. label : '我的',
  193. path : '/meber',
  194. active : '../../../../image/img/images/wode.png',
  195. inactive : '../../../../image/img/images/wode.png'
  196. }],
  197. scanCodeData : '',
  198. storeList : [],
  199. kunnr : '',
  200. messageList : [],
  201. storeBrand:[],
  202. subRoleName: "superAdmin",
  203. roleConfig: roleConfig
  204. },
  205. methods : {
  206. init : function(){
  207. var _this = this;
  208. this.kunnr = $api.getStorage('kunnr');
  209. this.subRoleName = $api.getStorage('subRoleName');
  210. // 判断是什么角色
  211. this.subRoleName = $api.getStorage('subRoleName');
  212. this.addEvent("refushUser",function(){
  213. _this.kunnr = $api.getStorage('kunnr');
  214. _this.subRoleName = $api.getStorage('subRoleName');
  215. _this.getMeberInfo();
  216. _this.getStoreList_jiage();
  217. _this.getAgentBanner();
  218. })
  219. this.getMeberInfo();
  220. this.getStoreList_jiage();
  221. this.getAgentBanner();
  222. this.scanCodeData = api.require('codeScan');
  223. this.configDownAndPull("mescroll",function(mescroll){
  224. _this.getStoreList_jiage(mescroll);
  225. },function(){
  226. },false);
  227. this.getMessageList();
  228. this.initApush('p' + this.kunnr);
  229. },
  230. // 扫描二维码审核
  231. scanCode : function(){
  232. var _this = this,url = "checkConponU";
  233. // 判断有没有权限
  234. this.ifHasPrme('camera',function(ret){
  235. if(ret == true){
  236. _this.scanCodeData.scan(function(ret1, err) {
  237. _this.showModal("核销码审核", "审核"+ret1.code+"是否通过?", ["不通过","通过"], function(ret){
  238. // 2 通过 1 不通过
  239. if(ret != 0){
  240. var data = {
  241. couponCode : ret1.code,
  242. kunnr : _this.kunnr,
  243. status : ret,
  244. url : 'json',
  245. type : 'body'
  246. }
  247. _this.$post(url,data,function(res){
  248. if(res.code == 0){
  249. api.toast({
  250. msg: '已审核' + ['','不通过','通过'][ret],
  251. });
  252. }
  253. })
  254. }
  255. })
  256. });
  257. }
  258. })
  259. },
  260. // 获取经销商信息
  261. getMeberInfo : function(){
  262. var url = "getMeberInfoU", _this = this,data = {token : $api.getStorage('token'),url : 'json',type : 'body'};
  263. this.$post(url,data,function(ret){
  264. if(ret.code == 0){
  265. if(ret.data == null){ // 个人不存在
  266. $api.clearStorage();
  267. _this.goWin("login", "login.html", "");
  268. }
  269. _this.agentName = ret.data.data == null ? '' : ret.data.data.name;
  270. }
  271. })
  272. },
  273. // 打开新页面
  274. openWin : function(src){
  275. if($role[this.subRoleName].pages[0].subEle[src].isClick){
  276. this.goWin(src,src+"/"+src+'_win.html','');
  277. }else{
  278. api.toast({
  279. msg: $role[this.subRoleName].pages[0].subEle[src].msg
  280. });
  281. }
  282. },
  283. // 获取门店进货分析
  284. getStoreIntoList : function(mescroll){
  285. var _this = this,url = "getIntoStoreU";
  286. var data = {
  287. "kunnr": this.kunnr,
  288. "pageSize": 10,
  289. "size":1,
  290. "url" : "json",
  291. "type" : "body",
  292. }
  293. this.$post(url,data,function(ret){
  294. if(ret.code == 0 || ret.code == '0'){
  295. _this.storeList = ret.Data;
  296. if(mescroll){
  297. mescroll.endSuccess();
  298. }
  299. }
  300. })
  301. },
  302. //轮播图
  303. getAgentBanner : function(){
  304. var _this = this,url = "getAgentBanner";
  305. var data = {
  306. "showPosition": 2,
  307. "url" : "json",
  308. "type" : "body",
  309. };
  310. this.$post(url,data,function(ret){
  311. if(ret.code == 0 || ret.code == '0'){
  312. _this.storeBrand= ret.data;
  313. }
  314. })
  315. },
  316. // 查询门店进货分析 -- 贾哥
  317. getStoreList_jiage : function(mescroll){
  318. var _this = this,url = "getInfoStoreU_jiage";
  319. var data = {
  320. "kunnr":this.kunnr,
  321. "url" : "json",
  322. "type" : "body",
  323. };
  324. setTimeout(function(){
  325. if(mescroll){
  326. mescroll.endSuccess();
  327. }
  328. },1000);
  329. this.$post("getInfoStoreU_jiage",data,function(ret){
  330. if (ret.code == 0 || ret.code == '0') {
  331. _this.storeList = ret.Data;
  332. if(mescroll){
  333. mescroll.endSuccess(_this.size,true);
  334. }
  335. }
  336. })
  337. },
  338. // 获取跑马灯链接
  339. getMessageList: function() {
  340. var data = {
  341. "url": "json",
  342. "type": "body",
  343. "contentType": 2,
  344. },
  345. _this = this;
  346. this.$post('getMessageList', data, function(ret) {
  347. _this.messageList = ret.data;
  348. })
  349. },
  350. },
  351. mounted : function() {
  352. this.init();
  353. var _this = this;
  354. this.ifHasPrme('storage', function(ret) {
  355. if (ret == true) {
  356. _this.getNewVersionUrlTbr(function() {
  357. });
  358. }
  359. })
  360. // this.footerHeight = this.$refs['footer'].$el.offsetHeight
  361. }
  362. })
  363. }
  364. </script>