store_body.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. <!DOCTYPE html>
  2. <html>
  3. <head lang="en">
  4. <meta charset="UTF-8">
  5. <title>screening</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
  7. <meta name="apple-touch-fullscreen" content="yes">
  8. <meta name="apple-mobile-web-app-capable" content="yes">
  9. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  10. <meta name="format-detection" content="telephone=no">
  11. <meta http-equiv="x-rim-auto-match" content="none"/>
  12. <meta name="HandheldFriendly" content="true"/>
  13. <link type="text/css" rel="stylesheet" href="../../css/aui.css">
  14. <link type="text/css" rel="stylesheet" href="../../css/html.css">
  15. <link type="text/css" rel="stylesheet" href="../../css/shaixuan.css">
  16. <link type="text/css" rel="stylesheet" href="../../css/base.css">
  17. <link type="text/css" rel="stylesheet" href="../../css/html.css">
  18. <script src="../../script/jquery.min.js"></script>
  19. <script src="../../script/shaixuan.js"></script>
  20. <style>
  21. .aui-list-item-right {
  22. color: #067974 !important;
  23. border: 1px solid #067974;
  24. padding: 1px 3px;
  25. border-radius: 5px;
  26. }
  27. .aui-list .aui-list-item-text {
  28. font-size: 0.6rem;
  29. }
  30. .aui-content {
  31. z-index: -1;
  32. /*margin-top: 2.05rem;*/
  33. }
  34. .aui-media-list .aui-list-item-inner {
  35. padding-top: 0.5rem;
  36. padding-bottom: 0.3rem;
  37. }
  38. .aui-list-item-arrow:before {
  39. z-index: 0;
  40. }
  41. .aui-line {
  42. display: flex;
  43. display: -webkit-flex;
  44. float: right;
  45. font-size: 0.6rem;
  46. color: #757575;
  47. margin-top: -1.1rem;
  48. width: 2.6rem;
  49. }
  50. .aui-btn-buy {
  51. border: 1px solid #08acee;
  52. color: #08acee;
  53. padding: 2px 7px;
  54. border-radius: 5px;
  55. }
  56. .aui-btn-addCar {
  57. padding: 2px 7px;
  58. border-radius: 5px;
  59. margin-left: 10px;
  60. }
  61. [v-cloak] {
  62. display: none;
  63. }
  64. .aui-background {
  65. background-color: #000;
  66. opacity: 0.2;
  67. z-index: 3;
  68. position: fixed;
  69. top: 0;
  70. left: 0;
  71. width: 100%;
  72. height: 100%;
  73. }
  74. .Sort-height {
  75. top: 0;
  76. }
  77. .aui-sort-bg {
  78. position: fixed;
  79. width: 100%;
  80. height: 100%;
  81. overflow: hidden;
  82. top: 0;
  83. left: 0;
  84. background-color: #000;
  85. opacity: 0.2;
  86. }
  87. .zmq-card-nomal {
  88. margin-top: 0;
  89. }
  90. .aui-list {
  91. background-color: #fff;
  92. border-radius: 5px
  93. }
  94. .aui-content, .aui-card-list, .aui-card-list-content {
  95. background-color: transparent !important;
  96. }
  97. .aui-list {
  98. border-top: 0px !important;
  99. }
  100. @media screen and (-webkit-min-device-pixel-ratio: 1.5) {
  101. .aui-list .aui-list-item {
  102. background-image: none;
  103. }
  104. }
  105. @media screen and (-webkit-min-device-pixel-ratio: 1.5) {
  106. .aui-list {
  107. background-image: none;
  108. }
  109. }
  110. .slide {
  111. max-height: 200px;
  112. height : 'auto';
  113. }
  114. .slide li a{
  115. font-size: 0.6rem;
  116. }
  117. .aui-content {
  118. padding-bottom: 3rem;
  119. padding-top: 50px;
  120. }
  121. #screen {
  122. position: fixed;
  123. z-index: 105;
  124. top: 0;
  125. left: 0;
  126. width: 100%
  127. }
  128. </style>
  129. </head>
  130. <body>
  131. <div id="app" >
  132. <div class="zmq-model-bg" v-show="showModal"></div>
  133. <section class="job-module" id="screen">
  134. <dl class="retrie">
  135. <dt>
  136. <a class="zmq-text-done zmq-text-font-07" href="javascript:;">经销商<i class="aui-iconfont aui-icon-down" style="margin-left: 0.2rem"></i></a>
  137. <div class="zmq-text-font-06 zmq-text-msg" style="height: 50px;line-height: 50px;background-color: #fff">{{chooseSupplierName}}</div>
  138. <!--<a class="zmq-text-done zmq-text-font-07" href="javascript:;">花纹</a>
  139. <a class="zmq-text-done zmq-text-font-07" href="javascript:;">尺寸</a>-->
  140. </dt>
  141. <dd class="area">
  142. <ul class="slide downlist">
  143. <li v-for="(i,index) in supplierList" v-on:click="doneThisSupplier(i.agentId,i.agentDto.agentName)">
  144. <a href="#">{{i.agentDto.agentName}}</a>
  145. </li>
  146. </ul>
  147. </dd>
  148. </dl>
  149. </section>
  150. <!-- 轮胎列表 -->
  151. <section class="aui-content">
  152. <div class="aui-card-list zmq-card-nomal">
  153. <div class="aui-card-list-content ">
  154. <ul class="aui-list aui-media-list zmq-margin-top-10" v-for="(item,index) in stockList">
  155. <li class="aui-list-item aui-list-item-middle" v-on:click="lookInfo(item.id)">
  156. <div class="aui-media-list-item-inner">
  157. <div class="aui-list-item-media" style="width: 4rem;">
  158. <img src="../../image/drawable-xhdpi/store01.png" class="aui-img-round" >
  159. </div>
  160. <div class="aui-list-item-inner aui-list-item-arrow">
  161. <div class="aui-list-item-text">
  162. <div class="aui-list-item-title aui-font-size-14">
  163. {{item.materialDto.specs}}
  164. </div>
  165. <div class="aui-list-item-right">
  166. {{item.materialDto.pattern}}
  167. </div>
  168. </div>
  169. <div class="aui-list-item-text zmq-text-msg zmq-margin-top-5">
  170. {{item.materialDto.brand}}
  171. </div>
  172. <div class="aui-list-item-text zmq-width-80 zmq-margin-top-5">
  173. {{item.materialDto.materialName}}
  174. </div>
  175. </div>
  176. </div>
  177. </li>
  178. </ul>
  179. </div>
  180. </div>
  181. <!-- 没有数据显示 -->
  182. <img v-show="hasData == false" src="../../image/nodata.png" />
  183. <div v-show="upLock == false" class="zmq-text-explain zmq-margin-top-10 zmq-textAlign-center zmq-margin-bottom-10 zmq-block-text">
  184. 已无更多数据
  185. </div>
  186. </section>
  187. </div>
  188. </body>
  189. <script src="../../script/api.js" type="text/javascript"></script>
  190. <script type="text/javascript" src="../../script/aui-scroll.js"></script>
  191. <script type="text/javascript" src="../../script/vue.js"></script>
  192. <script type="text/javascript" src="../../script/httpRequest.js"></script>
  193. <script type="text/javascript" src="../../script/vue_plugins.js"></script>
  194. <script type="text/javascript">
  195. apiready = function() {
  196. new Vue({
  197. el : '#app',
  198. data : {
  199. retariler_id : '',
  200. // 获取经销商列表
  201. getSupplierUrl : 'getSupplierListUrl',
  202. supplierList : [],
  203. chooseSupplierName : '请先选择一个经销商',
  204. // 根据经销商获取库存
  205. getStockListUrl : 'checkStoreUrl',
  206. stockList : [],
  207. // 商品列表
  208. // stockList : [{
  209. // specs : '7.50R16LT',
  210. // pattern : 'JT456',
  211. // brand : '金宇',
  212. // materialName : '外胎:2001933202191'
  213. // },{
  214. // specs : '7.50R16LT',
  215. // pattern : 'JT456',
  216. // brand : '金宇',
  217. // materialName : '外胎:2001933202191'
  218. // },{
  219. // specs : '7.50R16LT',
  220. // pattern : 'JT456',
  221. // brand : '金宇',
  222. // materialName : '外胎:2001933202191'
  223. // },{
  224. // specs : '7.50R16LT',
  225. // pattern : 'JT456',
  226. // brand : '金宇',
  227. // materialName : '外胎:2001933202191'
  228. // },{
  229. // specs : '7.50R16LT',
  230. // pattern : 'JT456',
  231. // brand : '金宇',
  232. // materialName : '外胎:2001933202191'
  233. // },{
  234. // specs : '7.50R16LT',
  235. // pattern : 'JT456',
  236. // brand : '金宇',
  237. // materialName : '外胎:2001933202191'
  238. // },{
  239. // specs : '7.50R16LT',
  240. // pattern : 'JT456',
  241. // brand : '金宇',
  242. // materialName : '外胎:2001933202191'
  243. // },{
  244. // specs : '7.50R16LT',
  245. // pattern : 'JT456',
  246. // brand : '金宇',
  247. // materialName : '外胎:2001933202191'
  248. // },{
  249. // specs : '7.50R16LT',
  250. // pattern : 'JT456',
  251. // brand : '金宇',
  252. // materialName : '外胎:2001933202191'
  253. // }],
  254. // 是否有数据
  255. hasData : true,
  256. // 购物车数量
  257. badge : 0,
  258. // 是否显示背景
  259. chooseInfo : false,
  260. // 是否显示模板
  261. showModal : false,
  262. // ss : [{},{},{},{},{},{},{},{}]
  263. // 分页
  264. total : 1,
  265. agentId : '',
  266. },
  267. methods : {
  268. init : function() {
  269. // 配置筛选
  270. var _this = this;
  271. this.retariler_id = $api.getStorage("retailerid");
  272. // _this.getStock();
  273. this.getSupplierList();
  274. this.getCarNum(this.retariler_id,function(num) {
  275. _this.badge = num.length;
  276. })
  277. // 刷新购物车数量
  278. this.addEvent("refushCar", function() {
  279. _this.getCarNum(_this.retariler_id,function(num) {
  280. _this.$set(_this, "badge", num.length)
  281. })
  282. })
  283. this.configHeaderRefush(function() {
  284. _this.downData = 'down';
  285. _this.upLock = true;
  286. _this.current = 1;
  287. _this.getSupplierStore(this.agentId);
  288. })
  289. this.configBottomRefush(function(status) {
  290. // 开启上拉加载
  291. if (_this.hasData == true) {
  292. // 开启上拉加载
  293. if (_this.total > _this.current) {
  294. _this.downData = 'up';
  295. _this.current = _this.current + 1;
  296. _this.getSupplierStore(_this.agentId);
  297. } else {
  298. // 上啦没有数据了
  299. _this.upLock = false;
  300. }
  301. }
  302. })
  303. },
  304. // 选择了这个经销商
  305. doneThisSupplier : function(id,name){
  306. this.chooseSupplierName = name;
  307. this.agentId = id;
  308. this.hideList();
  309. this.upLock = true;
  310. this.getSupplierStore(id);
  311. },
  312. // 隐藏列表i
  313. hideList : function(){
  314. $(".retrie dt a").removeClass('up');
  315. $('.downlist').hide();
  316. $('.mask').hide();
  317. this.showModal = false;
  318. api.setFrameAttr({
  319. name: api.frameName,
  320. bounces: true
  321. });
  322. },
  323. // 获取经销商下的库存
  324. getSupplierStore : function(id){
  325. var data = {
  326. agentId : id,
  327. url : 'json',
  328. type : 'body'
  329. }, _this = this;
  330. this.$post(this.getStockListUrl, data, function(ret) {
  331. if (ret.code == 0) {
  332. _this.total = ret.page.total;
  333. _this.stockList = ret.page.records;
  334. if (ret.page.records.length > 0) {
  335. _this.hasData = true;
  336. }
  337. }
  338. })
  339. },
  340. // 配置筛选
  341. config : function() {
  342. var _this = this;
  343. $('.retrie dt a').click(function() {
  344. var $t = $(this);
  345. if ($t.hasClass('up')) {
  346. $(".retrie dt a").removeClass('up');
  347. $('.downlist').hide();
  348. $('.mask').hide();
  349. _this.showModal = false;
  350. api.setFrameAttr({
  351. name: api.frameName,
  352. bounces: true
  353. });
  354. } else {
  355. _this.showModal = true;
  356. api.setFrameAttr({
  357. name: api.frameName,
  358. bounces: false
  359. });
  360. $(".retrie dt a").removeClass('up');
  361. $('.downlist').hide();
  362. $t.addClass('up');
  363. $('.downlist').eq($(".retrie dt a").index($(this)[0])).show();
  364. $('.mask').show();
  365. }
  366. });
  367. $(".area ul li a:contains('" + $('#area').text() + "')").addClass('selected');
  368. $(".wage ul li a:contains('" + $('#wage').text() + "')").addClass('selected');
  369. },
  370. // 获取经销商列表
  371. getSupplierList : function(){
  372. var data = {
  373. retailer_id : this.retariler_id,
  374. url : 'json',
  375. type : 'body'
  376. }, _this = this;
  377. this.$post(this.getSupplierUrl, data, function(ret) {
  378. if (ret.code == 0 || ret.code == '0') {
  379. _this.supplierList = ret.list;
  380. _this.config();
  381. }
  382. })
  383. },
  384. // 获取库存
  385. getStock : function() {
  386. var data = {
  387. retailerId : this.retariler_id
  388. }, _this = this;
  389. this.$post(this.getStockUrl, data, function(ret) {
  390. if (ret.code == 0 || ret.code == '0') {
  391. _this.stockList = ret.page.records;
  392. if(_this.stockList.length == 0){
  393. _this.hasData = false;
  394. }
  395. }
  396. })
  397. },
  398. // 查看详情
  399. lookInfo : function(id) {
  400. var param = {
  401. id : id,
  402. }
  403. this.goWin('storeInfo_win', '../store/storeInfo_win.html', param);
  404. },
  405. // 添加商品到购物车 materialId materialCode retailerId amount -- 选择产品规格
  406. addCar : function(index, type) {
  407. var param = {
  408. shopInfo : this.stockList[index],
  409. type : type,
  410. agentId : this.agentId
  411. }
  412. this.sendEvent("showInfo", param);
  413. },
  414. demo : function(e){
  415. e.preventDefault()
  416. }
  417. },
  418. mounted : function() {
  419. this.init();
  420. }
  421. })
  422. }
  423. </script>
  424. </html>