home.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  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/vue-i18n.js"></script>
  17. <script src="../../../../script/js/vant-ui.js"></script>
  18. <script src="../../../../script/js/main.js"></script>
  19. <title></title>
  20. </head>
  21. <style>
  22. .menu .item p {
  23. font-size: 0.26rem;
  24. text-align: center;
  25. }
  26. .line1 {
  27. width:300px;
  28. overflow: hidden;
  29. text-overflow:ellipsis;
  30. }
  31. .mt-10 {
  32. margin-top: 10px;
  33. }
  34. </style>
  35. <body>
  36. <div id="app" v-cloak>
  37. <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">
  38. <p class="line1">{{ agentName }}</p>
  39. </div>
  40. <div class="view flex col">
  41. <div class="page router fx1 mescroll" style="padding-top: 0.86rem;" :style="{'padding-bottom':footerHeight+'px'}" id="mescroll">
  42. <!-- <div class="header flex a-center j-center" id="aui-header">
  43. 赛轮轮胎经销商
  44. <div class="toobla">
  45. <div class="icon4"></div>
  46. </div>
  47. </div>-->
  48. <div style="background-color:#00a0ea;height:.5rem;width:100%">
  49. </div>
  50. <div class="banner mt-10">
  51. <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
  52. <van-swipe-item @click="handleSee" v-if="!storeBrand.length"><img src="../../../../image/image/news.jpg">
  53. </van-swipe-item>
  54. <van-swipe-item @click="handleSee" v-else v-for="(item,index) in storeBrand" :key="index"><img :src="item.imgPath"></van-swipe-item>
  55. </van-swipe>
  56. </div>
  57. <div class="homeTipbox flex a-center">
  58. <div class="laba"></div>
  59. <div class="labaInfos">
  60. <van-swipe style="height: .35rem;" :autoplay="3000" :show-indicators="false" vertical >
  61. <van-swipe-item v-for="(item,index) in messageList" :key="index">{{item.msgContent}}</van-swipe-item>
  62. </van-swipe>
  63. </div>
  64. </div>
  65. <div class="menu flex wrap">
  66. <div v-if="roleConfig[subRoleName].pages[0].subEle.orderList.isShow" class="item flex col a-center" v-on:click="openWin('orderList')">
  67. <b class="icon c2"></b>
  68. <p>{{ $t('home.index.storeOrder') }}</p>
  69. </div>
  70. <div v-if="roleConfig[subRoleName].pages[0].subEle.fac_storage.isShow" class="item flex col a-center" v-on:click="openWin('fac_storage')">
  71. <b class="icon c3"></b>
  72. <p>{{ $t('home.index.factoryInventory') }}</p>
  73. </div>
  74. <!-- <div class="item flex col a-center" v-on:click="openWin('propaganda')">
  75. <b class="icon c4"></b>
  76. <p>
  77. 厂家宣传
  78. </p>
  79. </div> -->
  80. <!-- <div class="item flex col a-center" v-on:click="openWin('agentList')">
  81. <b class="icon c5"></b>
  82. <p>
  83. 签约审核
  84. </p>
  85. </div> -->
  86. <div v-if="roleConfig[subRoleName].pages[0].subEle.intoStore.isShow" class="item flex col a-center" v-on:click="openWin('intoStore')">
  87. <b class="icon c6"></b>
  88. <p>{{ $t('home.index.storePurchaseAnalysis') }}</p>
  89. </div>
  90. <div v-if="roleConfig[subRoleName].pages[0].subEle.b2b_order_list.isShow" class="item flex col a-center" v-on:click="openWin('b2b_order_list')">
  91. <b class="icon c7"></b>
  92. <p>{{ $t('home.index.orderTrack') }}</p>
  93. </div>
  94. <!-- <div class="item flex col a-center" v-on:click="scanCode">
  95. <b class="icon c8"></b>
  96. <p>
  97. 核销审核
  98. </p>
  99. </div> -->
  100. </div>
  101. <div class="workField flex a-center">
  102. <div class="sup"></div>
  103. <h4>{{ $t('home.index.QuickWork') }}</h4>
  104. </div>
  105. <div class="workFieldContainer flex jlr wrap">
  106. <div v-if="roleConfig[subRoleName].pages[0].subEle.agentList.isShow" class="item"><img :src="imgs[0][langFlag]" v-on:click="openWin('agentList')"></div>
  107. <div v-if="roleConfig[subRoleName].pages[0].subEle.backList.isShow" class="item"><img :src="imgs[1][langFlag]" v-on:click="openWin('backList')"></div>
  108. <div v-if="roleConfig[subRoleName].pages[0].subEle.propaganda.isShow" class="item"><img :src="imgs[2][langFlag]" v-on:click="openWin('propaganda')"></div>
  109. <div v-if="roleConfig[subRoleName].pages[0].subEle.agent_storage.isShow" class="item"><img :src="imgs[3][langFlag]" v-on:click="openWin('agent_storage')"></div>
  110. <img :src="imgs[4][langFlag]" style="height : 3rem">
  111. </div>
  112. <div class="workField flex a-center">
  113. <div class="case"><img src="../../../../image/img/images/work.png">
  114. </div>
  115. <h4>{{ $t('home.index.monthlyPurchase') }} TOP 10</h4>
  116. </div>
  117. <ul class="jinhuoRank">
  118. <li class="flex a-center" v-for="(item,index) in storeList" style="height:2.5rem">
  119. <!-- <div class="image"><img :src="item.storeImageUrl">
  120. </div> -->
  121. <div class="info">
  122. <p>
  123. {{ item.storeName }}
  124. </p>
  125. <p>
  126. {{ $t('home.index.mobile') }}:{{ item.storePhone }}
  127. </p>
  128. <p>
  129. {{ $t('home.index.sellBrand') }}:{{ item.brandName }}
  130. </p>
  131. <div style="display:flex">
  132. <p style="flex : 1">
  133. {{ $t('home.index.signContract') }}:{{ item.numTask }}{{ $t('common.one') }}
  134. </p>
  135. <p style="flex : 1">
  136. {{ $t('home.index.onlineOrderQty') }}:{{ item.ocount }}{{ $t('common.one') }}
  137. </p>
  138. </div>
  139. <div style="display:flex">
  140. <p style="flex : 1">
  141. {{ $t('home.index.monthlyWaitFinish') }}:{{ item.leftNum }}{{ $t('common.one') }}
  142. </p>
  143. <p style="flex : 1">
  144. {{ $t('home.index.monthlyFinished') }}:{{ item.scanNum }}{{ $t('common.one') }}
  145. </p>
  146. </div>
  147. </div>
  148. <div class="fgx"></div>
  149. <div class="rankwrap flex col a-center j-center">
  150. <h2>{{ (index + 1)}}</h2>
  151. TOP
  152. </div>
  153. </li>
  154. </ul>
  155. </div>
  156. </div>
  157. </div>
  158. </body>
  159. </html>
  160. <link rel="stylesheet" href="../../../../script/mescroll/mescroll.min.css">
  161. <script type="text/javascript" src="../../../../script/mescroll/mescroll.min.js"></script>
  162. <script type="text/javascript" src="../../../../script/api.js"></script>
  163. <script type="text/javascript" src="../../../../script/httpRequest.js"></script>
  164. <script type="text/javascript" src="../../../../script/vue_plugins.js"></script>
  165. <script type="text/javascript" src="../../../../script/js/moment.js"></script>
  166. <script type="text/javascript" src="../../js/zh.js"></script>
  167. <script type="text/javascript" src="../../js/en.js"></script>
  168. <script type="text/javascript">
  169. apiready = function() {
  170. var langType = $api.getStorage('lang') || 'cn'
  171. var i18n = new VueI18n({
  172. locale: langType,//设置语言
  173. messages: {
  174. en: getEn(),
  175. cn: getCn()
  176. }
  177. })
  178. api.addEventListener({
  179. name:'updateLang'
  180. }, function(ret, err){
  181. i18n.locale = $api.getStorage('lang') || 'cn'
  182. });
  183. var header = $api.byId('aui-header');
  184. $api.fixStatusBar(header);
  185. var headerPos = $api.offset(header);
  186. if (api.systemType == 'android') {
  187. $api.css($api.byId('app'), 'padding-top:20px');
  188. $api.css($api.byId('content'),'margin-top:' + (headerPos.h-20) + 'px');
  189. };
  190. var roleConfig = $role;
  191. new Vue({
  192. el : '#app',
  193. i18n,
  194. data: {
  195. footerHeight : 0,
  196. list : [],
  197. agentName : '',
  198. icon : [{
  199. label : '首页',
  200. path : '/',
  201. active : "../../../../image/img/images/tabar_home_active.png",
  202. inactive : "../../../../image/img/images/tabar_home_inactive.png"
  203. }, {
  204. label : '发现',
  205. path : '/discover',
  206. active : '../../../../image/img/images/faxian.png',
  207. inactive : '../../../../image/img/images/faxian.png'
  208. }, {
  209. label : '消息',
  210. path : '/information',
  211. active : '../../../../image/img/images/xiaoxi.png',
  212. inactive : '../../../../image/img/images/xiaoxi.png'
  213. }, {
  214. label : '我的',
  215. path : '/meber',
  216. active : '../../../../image/img/images/wode.png',
  217. inactive : '../../../../image/img/images/wode.png'
  218. }],
  219. scanCodeData : '',
  220. storeList : [],
  221. kunnr : '',
  222. messageList : [],
  223. storeBrand:[],
  224. subRoleName: "superAdmin",
  225. roleConfig: roleConfig,
  226. langFlag: 'cn',
  227. imgs: [
  228. {
  229. cn: '../../../../image/image/mendian1.png',
  230. en: '../../../../image/image/shop_approval.png',
  231. },
  232. {
  233. cn: '../../../../image/image/hexiao1.png',
  234. en: '../../../../image/image/my_vari.png',
  235. },
  236. {
  237. cn: '../../../../image/image/111.png',
  238. en: '../../../../image/image/pormation.png',
  239. },
  240. {
  241. cn: '../../../../image/image/myku.png',
  242. en: '../../../../image/image/my_stock.png',
  243. },
  244. {
  245. cn: '../../../../image/image/banner_bottom.png',
  246. en: '../../../../image/image/ad.png',
  247. }
  248. ]
  249. },
  250. methods : {
  251. init : function(){
  252. var _this = this;
  253. this.kunnr = $api.getStorage('kunnr');
  254. // 判断是什么角色
  255. this.subRoleName = $api.getStorage('subRoleName');
  256. this.addEvent("refushUser",function(){
  257. _this.kunnr = $api.getStorage('kunnr');
  258. _this.subRoleName = $api.getStorage('subRoleName');
  259. _this.getMeberInfo();
  260. _this.getStoreList_jiage();
  261. })
  262. this.getMeberInfo();
  263. this.getStoreList_jiage();
  264. this.getAgentBanner();
  265. this.scanCodeData = api.require('codeScan');
  266. this.configDownAndPull("mescroll",function(mescroll){
  267. _this.getStoreList_jiage(mescroll);
  268. },function(){
  269. }, false);
  270. this.getMessageList();
  271. this.initApush('p' + this.kunnr);
  272. },
  273. // 扫描二维码审核
  274. scanCode : function(){
  275. var _this = this,url = "checkConponU";
  276. // 判断有没有权限
  277. this.ifHasPrme('camera',function(ret){
  278. if(ret == true){
  279. _this.scanCodeData.scan(function(ret1, err) {
  280. _this.showModal(_this.$t('home.index.examineTitle'), _this.$t('home.index.examine') + ret1.code + _this.$t('home.index.isPass'), [_this.$t('home.index.noPass'), _this.$t('home.index.pass')], function(ret){
  281. // 2 通过 1 不通过
  282. if(ret != 0){
  283. var data = {
  284. couponCode : ret1.code,
  285. kunnr : _this.kunnr,
  286. status : ret,
  287. url : 'json',
  288. type : 'body'
  289. }
  290. _this.$post(url,data,function(res){
  291. if(res.code == 0){
  292. api.toast({
  293. msg: _this.$t('home.index.reviewed') + ['', _this.$t('home.index.noPass'), _this.$t('home.index.pass')][ret],
  294. });
  295. }
  296. })
  297. }
  298. })
  299. });
  300. }
  301. })
  302. },
  303. // 获取经销商信息
  304. getMeberInfo : function(){
  305. var url = "getMeberInfoU", _this = this,data = {token : $api.getStorage('token'),url : 'json',type : 'body'};
  306. this.$post(url,data,function(ret){
  307. if(ret.code == 0){
  308. if(ret.data == null){ // 个人不存在
  309. $api.clearStorage();
  310. _this.goWin("login", "login.html", "");
  311. }
  312. _this.agentName = ret.data.data == null ? '' : ret.data.data.name;
  313. }
  314. })
  315. },
  316. // 打开新页面
  317. openWin : function(src){
  318. if($role[this.subRoleName].pages[0].subEle[src].isClick){
  319. this.goWin(src,src+"/"+src+'_win.html','');
  320. }else{
  321. api.toast({
  322. msg: $role[this.subRoleName].pages[0].subEle[src].msg
  323. });
  324. }
  325. },
  326. // 获取门店进货分析
  327. getStoreIntoList : function(mescroll){
  328. var _this = this,url = "getIntoStoreU";
  329. var data = {
  330. "kunnr": this.kunnr,
  331. "pageSize": 10,
  332. "size":1,
  333. "url" : "json",
  334. "type" : "body",
  335. }
  336. this.$post(url,data,function(ret){
  337. if(ret.code == 0 || ret.code == '0'){
  338. _this.storeList = ret.Data;
  339. if (ret.Data.length) {
  340. if(mescroll){
  341. mescroll.endSuccess();
  342. }
  343. }
  344. }
  345. })
  346. },
  347. //轮播图
  348. getAgentBanner : function(){
  349. var _this = this,url = "getAgentBanner";
  350. var data = {
  351. "KUNNR": this.kunnr,
  352. "url" : "json",
  353. "type" : "body",
  354. }
  355. this.$post(url,data,function(ret){
  356. if(ret.code == 0 || ret.code == '0'){
  357. _this.storeBrand= ret.agentBanner;
  358. }
  359. })
  360. },
  361. // 查询门店进货分析 -- 贾哥
  362. getStoreList_jiage : function(mescroll){
  363. var data = "agentCode=" + this.kunnr + "&current=1&size=10",_this = this;
  364. setTimeout(function(){
  365. if(mescroll){
  366. mescroll.endSuccess();
  367. }
  368. },1000);
  369. this.$get("getInfoStoreU_jiage",data,function(ret){
  370. if (ret.code == 0 || ret.code == '0') {
  371. _this.storeList = ret.page.records;
  372. // if(mescroll){
  373. // mescroll.endSuccess(_this.size, true);
  374. // }
  375. }
  376. })
  377. },
  378. // 获取跑马灯链接
  379. getMessageList: function() {
  380. var data = {
  381. "url": "json",
  382. "type": "body",
  383. "contentType": 2,
  384. },
  385. _this = this;
  386. this.$post('getMessageList', data, function(ret) {
  387. _this.messageList = ret.list;
  388. })
  389. },
  390. handleSee: function(){
  391. var _this = this;
  392. var dateTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss');
  393. api.ajax({
  394. url: 'http://b2bcnapi.sailuntire.com/allstell/app/sailun/appNewsCount/save',//'https://b2bcnapi.sailuntire.com/allstell/sailun/appNewsCount/save',
  395. method: 'post',
  396. headers : {
  397. "Content-type" : "application/json"
  398. },
  399. data: {
  400. "body":{
  401. "account": _this.kunnr,
  402. "appType": "3",
  403. "id": 0,
  404. "showTime": dateTime,
  405. "tapTime": dateTime
  406. }
  407. }
  408. },function(ret, err){
  409. var obj = {
  410. dateTime: dateTime
  411. };
  412. _this.goWin("news_win","./news/news_win.html",obj);
  413. // 不做提示
  414. });
  415. },
  416. },
  417. mounted : function() {
  418. console.log("半钢")
  419. this.langFlag = i18n.locale == 'en' ? 'en' : 'cn'
  420. this.init();
  421. var _this = this;
  422. this.ifHasPrme('storage', function(ret) {
  423. if (ret == true) {
  424. _this.getNewVersionUrl(function() {
  425. });
  426. }
  427. })
  428. // this.footerHeight = this.$refs['footer'].$el.offsetHeight
  429. }
  430. })
  431. }
  432. </script>