main.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>生活服务</title>
  6. <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
  7. <meta content="yes" name="apple-mobile-web-app-capable"/>
  8. <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
  9. <meta content="telephone=no" name="format-detection"/>
  10. <link href="../css/style.css" rel="stylesheet" type="text/css"/>
  11. <link href="../css/html.css" rel="stylesheet" type="text/css"/>
  12. <link rel="stylesheet" type="text/css" href="../css/aui-slide.css" />
  13. <link href="../css/vueBox.css" rel="stylesheet" type="text/css"/>
  14. <!--<script type="text/javascript" src="../script/jquery.min.js"></script>-->
  15. <!--<script type="text/javascript" src="../script/slider.js"></script>-->
  16. <style>
  17. .aui-voice {
  18. width: 40px;
  19. height: 40px;
  20. margin-top: -10px;
  21. }
  22. .marquee_box {
  23. width: 75%;
  24. }
  25. [v-cloak] {
  26. display: none
  27. }
  28. .aui-slide-page-line {
  29. height: 2px !important;
  30. }
  31. .aui-slide-node img {
  32. height: 180px !important;
  33. }
  34. </style>
  35. </head>
  36. <body>
  37. <section class="aui-flexView" id="app">
  38. <div class="zmq-header" style="display: none">
  39. <div class="zmq-flex">
  40. <img class="zmq-logo-img" src="../image/drawable-xhdpi/logo12.png" />
  41. <div class="zmq-header-search">
  42. <img src="../image/drawable-xhdpi/search.png" class="zmq-search-img"/>找订单,查库存
  43. </div>
  44. </div>
  45. </div>
  46. <section class="aui-scrollView">
  47. <div class="zmq-card">
  48. <!--<div class="m-slider" data-ydui-slider>
  49. <div class="slider-wrapper">
  50. <div class="slider-item">
  51. <a href="javascript:;"> <img src="../image/drawable-xhdpi/banner.png"> </a>
  52. </div>
  53. <div class="slider-item">
  54. <a href="javascript:;"> <img src="../image/drawable-xhdpi/banner.png"> </a>
  55. </div>
  56. <div class="slider-item">
  57. <a href="javascript:;"> <img src="../image/drawable-xhdpi/banner.png"> </a>
  58. </div>
  59. </div>
  60. <div class="slider-pagination"></div>
  61. </div>-->
  62. <div id="aui-slide3">
  63. <div class="aui-slide-wrap" >
  64. <div class="aui-slide-node bg-dark" v-for="(b,i) in bannerList" v-on:click="lookBanner(b.linkId)">
  65. <img class="" v-bind:src ="b.imgPath"/>
  66. <!--{{b.imgPath}}-->
  67. </div>
  68. <!--<div class="aui-slide-node bg-dark">
  69. <img class="" src="../image/banner2.png" />
  70. </div>
  71. <div class="aui-slide-node bg-dark">
  72. <img class="" src="../image/banner3.png" />
  73. </div>-->
  74. </div>
  75. <div class="aui-slide-page-wrap">
  76. <!--分页容器-->
  77. </div>
  78. </div>
  79. <!-- 公告啦 -->
  80. <div class="vueBox" style="margin-top: -2px;">
  81. <div class="marquee">
  82. <div class="marquee_title">
  83. <span><img class="aui-voice" src="../image/news.png"></span>
  84. </div>
  85. <div class="marquee_box" v-cloak>
  86. <ul class="marquee_list" :class="{marquee_top:animate}">
  87. <li style="font-size: 12px;" class="zmq-line-1" v-for="(item, index) in marqueeList" v-on:click="goInfo(item)">
  88. {{item.title}}
  89. </li>
  90. </ul>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="aui-grids">
  95. <a href="javascript:;" class="aui-grids-item" onclick="goWin('storeList1_win')">
  96. <div class="aui-grids-item-icon">
  97. <img src="../image/drawable-xhdpi/icon01.png" alt="">
  98. </div>
  99. <div class="aui-grids-item-text">
  100. 采购下单
  101. </div> </a>
  102. <a href="javascript:;" class="aui-grids-item" onclick="goWin('kucunjjs_win')">
  103. <div class="aui-grids-item-icon">
  104. <img src="../image/drawable-xhdpi/icon02.png" alt="">
  105. </div>
  106. <div class="aui-grids-item-text">
  107. 云端查货
  108. </div> </a>
  109. <a href="javascript:;" class="aui-grids-item" onclick="goWin('orderList_win')">
  110. <div class="aui-grids-item-icon">
  111. <img src="../image/drawable-xhdpi/icon03.png" alt="">
  112. </div>
  113. <div class="aui-grids-item-text">
  114. 订单管理
  115. </div> </a>
  116. <a href="javascript:;" class="aui-grids-item" onclick="goWin('orderCar_win')">
  117. <div class="aui-grids-item-icon">
  118. <div class="aui-badge">
  119. {{carNum}}
  120. </div>
  121. <img src="../image/drawable-xhdpi/icon04.png" alt="">
  122. </div>
  123. <div class="aui-grids-item-text">
  124. 订单维护
  125. </div> </a>
  126. </div>
  127. </div>
  128. <div class="zmq-card zmq-margin-top-10 zmq-padding-top-10">
  129. <div class="aui-list-cell">
  130. <a href="javascript:;" class="aui-list-cell-item">
  131. <div class="aui-list-cell-item-info aui-list-cell-item-img" v-on:click="scan1(0)">
  132. <h2 class="zmq-btn-title"><img class="zmq-btn-img" src="../image/drawable-xhdpi/scanIcon.png" />扫码入库</h2>
  133. <span class="zmq-btn-msg"> <em>扫码入库,赚取积分,兑换商品</em></span>
  134. </div> </a>
  135. <a href="javascript:;" class="aui-list-cell-item">
  136. <div class="aui-list-cell-item-info aui-list-cell-item-info-one" v-on:click="scan1(1)">
  137. <h2 class="zmq-btn-title"><img class="zmq-btn-img" src="../image/drawable-xhdpi/scanList.png" />扫码销售</h2>
  138. <!--<h2 class="zmq-btn-title"><img class="zmq-btn-img" src="../image/drawable-xhdpi/scanin.png" />进销存</h2>-->
  139. <!--<span class="zmq-btn-msg-1"><em>进销存</em></span>-->
  140. </div>
  141. <div class="aui-list-cell-item-info aui-list-cell-item-info-two" onclick="goWin('handKucun_win')">
  142. <!--<h2>扫码明细</h2>-->
  143. <h2 class="zmq-btn-title"><img class="zmq-btn-img" src="../image/drawable-xhdpi/scanin.png" />店面库存</h2>
  144. <!--<span class="zmq-btn-msg-1"></span>-->
  145. </div> </a>
  146. </div>
  147. </div>
  148. <!-- 车友俱乐部 -->
  149. <div class="zmq-card zmq-margin-top-10 zmq-padding-top-10" v-on:click="lookJF">
  150. <img class="zmq-width-90" src="../image/banner4.png">
  151. <span class="zmq-btn-msg zmq-btn-bottom"> <em>零售商俱乐部</em></span>
  152. </div>
  153. </section>
  154. </section>
  155. </body>
  156. <script type="text/javascript" src="../script/api.js"></script>
  157. <script type="text/javascript" src="../script/aui-slide.js"></script>
  158. <script type="text/javascript" src="../script/vue.js"></script>
  159. <script type="text/javascript" src="../script/vue-lazyload.js"></script>
  160. <script type="text/javascript" src="../script/httpRequest.js"></script>
  161. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  162. <script type="text/javascript">
  163. apiready = function() {
  164. new Vue({
  165. el : '#app',
  166. data : {
  167. // 用户id
  168. retailerId : '',
  169. // 购物车数量
  170. carNum : '',
  171. reid : '',
  172. // 扫码
  173. FNScanner : '',
  174. xwScanner : '',
  175. // 入库扫码
  176. getStoreUrl0705 : 'addOrgoScanUrl',
  177. // 出库扫码
  178. outStoreUrl : 'outScanUrl',
  179. // 获取新闻
  180. getNewsUrl : 'getNews',
  181. // 新闻
  182. animate : false,
  183. marqueeList : [],
  184. // 获取banner
  185. bannerUrl : 'getBannerUrl',
  186. bannerList : [],
  187. },
  188. methods : {
  189. init : function() {
  190. var _this = this;
  191. this.FNScanner = api.require('FNScanner');
  192. this.xwScanner = api.require('xwScanner');
  193. this.retailerId = $api.getStorage("retailerid");
  194. this.getNews();
  195. this.getBanner();
  196. this.getUserInfo(function(ret) {
  197. if ( typeof ret.retailerDto == 'undefined' || ret.retailerDto == null) {
  198. _this.showAlert("系统检测您账户信息出现异常,请重新完善。", function() {
  199. // TODO 完善信息
  200. })
  201. } else {
  202. _this.reid = ret.retailerDto.id;
  203. _this.getCarNum(ret.retailerDto.id, function(num) {
  204. _this.carNum = num.length;
  205. })
  206. }
  207. });
  208. this.addEvent("openFrameGroup", function() {
  209. _this.getCarNum(_this.reid, function(num) {
  210. _this.carNum = num.length;
  211. })
  212. })
  213. // 刷新购物车数量
  214. this.addEvent("refushCar", function() {
  215. _this.getCarNum(_this.reid, function(num) {
  216. _this.carNum = num.length;
  217. })
  218. })
  219. // 配置下拉刷新
  220. this.configHeaderRefush(function() {
  221. _this.getUserInfo(function(ret) {
  222. _this.getCarNum(ret.retailerDto.id, function(num) {
  223. _this.carNum = num.length;
  224. })
  225. });
  226. _this.getNews();
  227. // _this.getBanner();
  228. })
  229. },
  230. // 获取banner列表
  231. getBanner : function() {
  232. var _this = this;
  233. var data = {
  234. retailer_id : _this.retailerId,
  235. url : 'json',
  236. type : 'body'
  237. };
  238. this.$post(this.bannerUrl,data, function(ret) {
  239. if (ret.code == 0) {
  240. _this.bannerList = ret.list;
  241. _this.$nextTick(function() {
  242. var slide3 = new auiSlide({
  243. container : document.getElementById("aui-slide3"),
  244. // "width":300,
  245. "height" : 190,
  246. "speed" : 500,
  247. "autoPlay" : 3000, //自动播放
  248. "loop" : true,
  249. "pageShow" : true,
  250. "pageStyle" : 'line',
  251. 'dotPosition' : 'center'
  252. })
  253. })
  254. }
  255. })
  256. },
  257. // 点击banner查看详情
  258. lookBanner : function(id){
  259. var page = {
  260. id : id
  261. }
  262. this.goWin("banner_win","./order/banner_win.html",page);
  263. },
  264. // 展示公告 -- 获取公告
  265. showMarquee : function() {
  266. var _this = this;
  267. this.animate = true;
  268. setTimeout(function() {
  269. _this.marqueeList.push(_this.marqueeList[0]);
  270. _this.marqueeList.shift();
  271. _this.animate = false;
  272. }, 500)
  273. },
  274. // 跳转新闻列表
  275. goInfo : function(news) {
  276. var page = {
  277. n : JSON.stringify(news)
  278. }
  279. this.goWin("news_win", "./order/news_win.html", page);
  280. },
  281. // 获取新闻
  282. getNews : function() {
  283. var data = {
  284. }, _this = this;
  285. this.$post(this.getNewsUrl, "", function(ret) {
  286. if (ret.code == 0) {
  287. _this.marqueeList = ret.page.records;
  288. if (_this.marqueeList.length > 2) {
  289. setInterval(_this.showMarquee, 2000);
  290. }
  291. }
  292. })
  293. },
  294. // 扫码
  295. scan1 : function(type) {
  296. var _this = this;
  297. var url = type == 0 ?this.getStoreUrl0705 : this.outStoreUrl;
  298. this.scant(this.xwScanner, function(ret) {
  299. var data = {
  300. serialNumber : ret,
  301. retailerId : _this.retailerId,
  302. url : 'json',
  303. type : 'body'
  304. }
  305. _this.$post(url, data, function(retMsg) {
  306. if (retMsg.code == 0) {
  307. var page = {
  308. content : ret,
  309. type : type,
  310. i : 'scan'
  311. }
  312. goWin("orderPlace_win", page);
  313. } else {
  314. if (type == 0) {
  315. // 入库
  316. _this.showModal("未完善该商品", "系统检测到该码对应的商品不存在系统中,是否要完善该物料商品?", ["确认", "取消"], function(index) {
  317. if (index == 1) {
  318. var option = {
  319. msg : ret,
  320. }
  321. goWin("orderScan_win.html", option);
  322. }
  323. })
  324. }
  325. }
  326. });
  327. })
  328. },
  329. lookJF : function() {
  330. this.goWin('jifen_win', './order/jifen_win.html', '');
  331. },
  332. },
  333. mounted : function() {
  334. this.init();
  335. Vue.use(VueLazyload,{
  336. preLoad: 1.3,
  337. error: '../image/noimg.png',
  338. loading: '../image/load.gif',
  339. attempt: 1,
  340. });
  341. }
  342. })
  343. }
  344. function goWin(winName, page) {
  345. api.openWin({
  346. name : winName,
  347. url : './order/' + winName + '.html',
  348. pageParam : page
  349. });
  350. }
  351. function gg() {
  352. api.openWin({
  353. name : 'jjs',
  354. url : '../jjs/index.html'
  355. });
  356. }
  357. </script>
  358. </html>