home.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  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/PCR/js/pcr_role_config.js" 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 @click="handleSee" v-if="!storeBrand.length"><img src="../../../../image/image/news.jpg">
  48. </van-swipe-item>
  49. <van-swipe-item @click="handleSee" 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.numTask }}条
  137. </p>
  138. <p style="flex : 1">
  139. 线上订货数量:{{ item.ocount }}条
  140. </p>
  141. </div>
  142. <div style="display:flex">
  143. <p style="flex : 1">
  144. 本月待完成:{{ item.leftNum }}条
  145. </p>
  146. <p style="flex : 1">
  147. 本月已完成:{{ item.scanNum }}条
  148. </p>
  149. </div>
  150. </div>
  151. <div class="fgx"></div>
  152. <div class="rankwrap flex col a-center j-center">
  153. <h2>{{ (index + 1)}}</h2>
  154. TOP
  155. </div>
  156. </li>
  157. </ul>
  158. </div>
  159. </div>
  160. </div>
  161. </body>
  162. </html>
  163. <link rel="stylesheet" href="../../../../script/mescroll/mescroll.min.css">
  164. <script type="text/javascript" src="../../../../script/mescroll/mescroll.min.js"></script>
  165. <script type="text/javascript" src="../../../../script/api.js"></script>
  166. <script type="text/javascript" src="../../../../script/httpRequest.js"></script>
  167. <script type="text/javascript" src="../../../../script/vue_plugins.js"></script>
  168. <script type="text/javascript">
  169. apiready = function() {
  170. var header = $api.byId('aui-header');
  171. $api.fixStatusBar(header);
  172. var headerPos = $api.offset(header);
  173. if (api.systemType == 'android') {
  174. $api.css($api.byId('app'), 'padding-top:20px');
  175. $api.css($api.byId('content'),'margin-top:' + (headerPos.h-20) + 'px');
  176. };
  177. var roleConfig = $role;
  178. new Vue({
  179. el : '#app',
  180. data : {
  181. footerHeight : 0,
  182. list : [],
  183. agentName : '',
  184. icon : [{
  185. label : '首页',
  186. path : '/',
  187. active : "../../../../image/img/images/tabar_home_active.png",
  188. inactive : "../../../../image/img/images/tabar_home_inactive.png"
  189. }, {
  190. label : '发现',
  191. path : '/discover',
  192. active : '../../../../image/img/images/faxian.png',
  193. inactive : '../../../../image/img/images/faxian.png'
  194. }, {
  195. label : '消息',
  196. path : '/information',
  197. active : '../../../../image/img/images/xiaoxi.png',
  198. inactive : '../../../../image/img/images/xiaoxi.png'
  199. }, {
  200. label : '我的',
  201. path : '/meber',
  202. active : '../../../../image/img/images/wode.png',
  203. inactive : '../../../../image/img/images/wode.png'
  204. }],
  205. scanCodeData : '',
  206. storeList : [],
  207. kunnr : '',
  208. messageList : [],
  209. storeBrand:[],
  210. subRoleName: "superAdmin",
  211. roleConfig: roleConfig
  212. },
  213. methods : {
  214. init : function(){
  215. var _this = this;
  216. this.kunnr = $api.getStorage('tel');
  217. // 判断是什么角色
  218. this.subRoleName = $api.getStorage('subRoleName');
  219. this.addEvent("refushUser",function(){
  220. _this.kunnr = $api.getStorage('tel');
  221. _this.subRoleName = $api.getStorage('subRoleName');
  222. _this.getMeberInfo();
  223. _this.getStoreList_jiage();
  224. })
  225. this.getMeberInfo();
  226. this.getStoreList_jiage();
  227. this.getAgentBanner();
  228. this.scanCodeData = api.require('codeScan');
  229. this.configDownAndPull("mescroll",function(mescroll){
  230. _this.getStoreList_jiage(mescroll);
  231. },function(){
  232. },false);
  233. this.getMessageList();
  234. this.initApush('p' + this.kunnr);
  235. },
  236. // 扫描二维码审核
  237. scanCode : function(){
  238. var _this = this,url = "checkConponU";
  239. // 判断有没有权限
  240. this.ifHasPrme('camera',function(ret){
  241. if(ret == true){
  242. _this.scanCodeData.scan(function(ret1, err) {
  243. _this.showModal("核销码审核", "审核"+ret1.code+"是否通过?", ["不通过","通过"], function(ret){
  244. // 2 通过 1 不通过
  245. if(ret != 0){
  246. var data = {
  247. couponCode : ret1.code,
  248. kunnr : _this.kunnr,
  249. status : ret,
  250. url : 'json',
  251. type : 'body'
  252. }
  253. _this.$post(url,data,function(res){
  254. if(res.code == 0){
  255. api.toast({
  256. msg: '已审核' + ['','不通过','通过'][ret],
  257. });
  258. }
  259. })
  260. }
  261. })
  262. });
  263. }
  264. })
  265. },
  266. // 获取经销商信息
  267. getMeberInfo : function(){
  268. var url = "getMeberInfoU", _this = this,data = {token : $api.getStorage('loginToken'),url : 'json',type : 'body'};
  269. this.$post(url,data,function(ret){
  270. if(ret.code == 0){
  271. if(ret.data == null){ // 个人不存在
  272. $api.clearStorage();
  273. _this.goWin("login", "login.html", "");
  274. }
  275. _this.agentName = ret.data.data == null ? '' : ret.data.data.name;
  276. }
  277. })
  278. },
  279. // 打开新页面
  280. openWin : function(src){
  281. console.log($role[this.subRoleName].pages[0].subEle[src].name)
  282. if($role[this.subRoleName].pages[0].subEle[src].isClick){
  283. this.goWin(src,src+"/"+src+'_win.html','');
  284. }else{
  285. api.toast({
  286. msg: $role[this.subRoleName].pages[0].subEle[src].msg
  287. });
  288. }
  289. },
  290. // 获取门店进货分析
  291. getStoreIntoList : function(mescroll){
  292. var _this = this,url = "getIntoStoreU";
  293. var data = {
  294. "kunnr": this.kunnr,
  295. "pageSize": 10,
  296. "size":1,
  297. "url" : "json",
  298. "type" : "body",
  299. }
  300. this.$post(url,data,function(ret){
  301. if(ret.code == 0 || ret.code == '0'){
  302. _this.storeList = ret.Data;
  303. if(mescroll){
  304. mescroll.endSuccess();
  305. }
  306. }
  307. })
  308. },
  309. //轮播图
  310. getAgentBanner : function(){
  311. var _this = this,url = "getAgentBanner";
  312. var data = {
  313. "KUNNR":"0001003532",
  314. "url" : "json",
  315. "type" : "body",
  316. }
  317. this.$post(url,data,function(ret){
  318. if(ret.code == 0 || ret.code == '0'){
  319. _this.storeBrand= ret.agentBanner;
  320. }
  321. })
  322. },
  323. // 查询门店进货分析 -- 贾哥
  324. getStoreList_jiage : function(mescroll){
  325. var data = "agentCode=" + this.kunnr + "&current=1&size=10",_this = this;
  326. setTimeout(function(){
  327. if(mescroll){
  328. mescroll.endSuccess();
  329. }
  330. },1000);
  331. this.$get("getInfoStoreU_jiage",data,function(ret){
  332. if (ret.code == 0 || ret.code == '0') {
  333. _this.storeList = ret.page.records;
  334. if(mescroll){
  335. mescroll.endSuccess(_this.size,true);
  336. }
  337. }
  338. })
  339. },
  340. // 获取跑马灯链接
  341. getMessageList: function() {
  342. var data = {
  343. "url": "json",
  344. "type": "body",
  345. "contentType": 2,
  346. },
  347. _this = this;
  348. this.$post('getMessageList', data, function(ret) {
  349. _this.messageList = ret.list;
  350. })
  351. },
  352. handleSee: function(){
  353. this.goWin("news_win","./news/news_win.html");
  354. }
  355. },
  356. mounted : function() {
  357. this.init();
  358. var _this = this;
  359. this.ifHasPrme('storage', function(ret) {
  360. if (ret == true) {
  361. _this.getNewVersionUrl(function() {
  362. });
  363. }
  364. })
  365. // this.footerHeight = this.$refs['footer'].$el.offsetHeight
  366. }
  367. })
  368. }
  369. </script>