home.html 15 KB

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