confirmOrderInfo_body.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  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/vant-ui.css" />
  12. <link rel="stylesheet" type="text/css" href="css/iconfont.css">
  13. <link rel="stylesheet" type="text/css" href="css/main.css" />
  14. <script src="js/vue.js"></script>
  15. <script src="js/vant-ui.js"></script>
  16. <script src="js/main.js"></script>
  17. <title></title>
  18. </head>
  19. <style>
  20. .zmq-flex {
  21. display: flex;
  22. position: fixed;
  23. width: 100%;
  24. height: 1rem;
  25. background-color: #fff;
  26. left: 0;
  27. bottom: 0;
  28. z-index: 2222;
  29. justify-content: space-between;
  30. padding-left: .2rem;
  31. }
  32. .total {
  33. font-size: .3rem;
  34. line-height: 1rem;
  35. }
  36. .zmq-downOrder {
  37. width: 2rem;
  38. height: 1rem;
  39. background-color: #005AA9;
  40. color: #fff;
  41. float: right;
  42. line-height: 1rem;
  43. text-align: center;
  44. font-size: .3rem;
  45. }
  46. .card {
  47. display: flex;
  48. justify-content: center;
  49. margin-bottom: .2rem;
  50. }
  51. .card-list {
  52. width: 7rem;
  53. background-color: #fff;
  54. border-radius: .3rem;
  55. display: flex;
  56. flex-direction: column;
  57. }
  58. .card-box {
  59. display: flex;
  60. flex-direction: row;
  61. justify-content: space-between;
  62. /* border-bottom: 1px solid #F1F1F1; */
  63. margin: 0 .2rem;
  64. padding: .2rem 0;
  65. }
  66. .card-group {
  67. display: flex;
  68. flex-direction: row;
  69. justify-content: space-between;
  70. border-bottom: 1px solid #F1F1F1;
  71. margin: 0 .2rem;
  72. padding: .2rem 0;
  73. }
  74. .card-box {
  75. display: flex;
  76. flex-direction: row;
  77. justify-content: space-between;
  78. /* border-bottom: 1px solid #F1F1F1; */
  79. margin: 0 .2rem;
  80. padding: .2rem 0;
  81. }
  82. .card-box:last-child {
  83. border-bottom: 0px solid #F1F1F1;
  84. }
  85. .card-list-left {
  86. display: flex;
  87. flex-direction: row;
  88. }
  89. .card-img {
  90. margin: .2rem .2rem .2rem 0rem;
  91. }
  92. .card-text {
  93. display: flex;
  94. flex-direction: column;
  95. justify-content: space-between;
  96. margin: .2rem 0;
  97. }
  98. .card-title {
  99. width: 3.5rem;
  100. }
  101. .card-title-p {
  102. font-size: .3rem;
  103. display: -webkit-box;
  104. -webkit-box-orient: vertical;
  105. -webkit-line-clamp: 2;
  106. overflow: hidden;
  107. }
  108. .shop-add-left {
  109. display: flex;
  110. font-size: .28rem;
  111. flex-direction: row;
  112. align-items: center;
  113. }
  114. .address {
  115. width: 100%;
  116. display: flex;
  117. flex-direction: row;
  118. justify-content: space-between;
  119. font-size: .3rem;
  120. align-items: center;
  121. }
  122. .shop-add-left input {
  123. width: .6rem;
  124. border: 1px solid rgba(229, 229, 229, 1);
  125. text-align: center;
  126. }
  127. .shop-add-left .qty{
  128. display: flex;
  129. align-items:center;
  130. color: #333333;
  131. padding-left: .2rem;
  132. }
  133. .price{
  134. color: #fb5609;
  135. font-size:.4rem;
  136. }
  137. .price .icon{
  138. font-size: .25rem;
  139. }
  140. .card-logo {
  141. margin-right :.2rem;
  142. display: flex;
  143. align-items:center;
  144. }
  145. </style>
  146. <body>
  147. <div id="app" v-cloak>
  148. <div class="pageView gouwuche" >
  149. <div class="card" style="margin-top: .2rem">
  150. <div class="card-list">
  151. <div class="card-box">
  152. <div class="address" >
  153. <div style="display: flex; flex-direction: row;" >
  154. <div><van-icon name="location" /> </div>
  155. <div style="font-size:.25rem;margin-left: .15rem;margin-right: .15rem" id="addressInfo"></div>
  156. </div>
  157. <div v-on:click="goaddress">
  158. <img src="image/024.png" style="width: .19rem;height: .35rem;">
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. <div class="card">
  165. <div class="card-list">
  166. <div class="card-group">
  167. <div class="card-list-left">
  168. <div class="card-logo " >
  169. <img src="image/factory_logo.png" style="height:.28rem;width:.36rem"/>
  170. </div>
  171. <div class="card-title" style="width: 2rem !important">
  172. <p class="card-title-p"> 工厂直营</p>
  173. </div>
  174. </div>
  175. </div>
  176. <div class="card-box" v-for="(item,index) in list" :key="index">
  177. <div class="card-list-left">
  178. <div class="card-img">
  179. <img src="image/cart_goods.png"
  180. style="width:2rem;height:2rem">
  181. </div>
  182. <div class="card-text">
  183. <div class="card-title">
  184. <p class="card-title-p">{{ item.maktx }}</p>
  185. </div>
  186. <div class="shop-add-left">
  187. <div class="price">
  188. <span class="icon">¥</span>240.88
  189. </div>
  190. <div>
  191. <div class="qty">x{{ item.purchaseNumber }} </div>
  192. </div>
  193. </div>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. <!-- 购物车 价格全选 -->
  201. <div class="zmq-flex">
  202. <div class="total">
  203. 合计
  204. </div>
  205. <div style="display: flex;line-height: 1rem;padding-left: .1rem">
  206. <div class="zmq-downOrder" v-on:click="downOrder">
  207. 立即下单
  208. </div>
  209. </div>
  210. </div>
  211. </div>
  212. </body>
  213. <script type="text/javascript" src="../script/api.js"></script>
  214. <script type="text/javascript" src="../script/httpRequest.js"></script>
  215. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  216. <script type="text/javascript">
  217. apiready = function () {
  218. var data = api.pageParam.data;
  219. api.addEventListener({
  220. name:'refresh_order_address'
  221. },function(ret){
  222. this.address=ret.value;
  223. //$forceUpdate();
  224. var title=this.address.contactsName+" " +this.address.contactsTel+" " +this.address.province+" "+this.address.city+" "+this.address.county+" "+this.address.address;
  225. $api.text($api.byId("addressInfo"), title);
  226. });
  227. new Vue({
  228. el: '#app',
  229. data: {
  230. list:data,
  231. address:{
  232. "province":11
  233. }
  234. },
  235. methods: {
  236. init: function () {
  237. this.userId = $api.getStorage('userid');
  238. this.status = $api.getStorage('status');
  239. //this.getCarList();
  240. //获取默认地址
  241. if(this.address.mainId){
  242. var title=this.address.contactsName+" " +this.address.contactsTel+" " +this.address.province+" "+this.address.city+" "+this.address.county+" "+this.address.address;
  243. $api.text($api.byId("addressInfo"), title);
  244. }
  245. else {
  246. $api.text($api.byId("addressInfo"), "请选择收货地址");
  247. }
  248. },
  249. goaddress: function () {
  250. this.goWin('address_new', 'address_new_win.html');
  251. },
  252. // 下单
  253. downOrder: function () {
  254. var count = 0, price = 0, hasChoose = new Array();
  255. this.list.map(function (cart, index) {
  256. price = price + (parseInt(cart.purchaseNumber) ? parseInt(cart.purchaseNumber) : 0) * 1;
  257. count = count + (parseInt(cart.purchaseNumber) ? parseInt(cart.purchaseNumber) : 0);
  258. hasChoose.push({
  259. "id": cart.id,
  260. "storeId": cart.storeId,
  261. "purchaseNumber": cart.purchaseNumber,
  262. "cartType": cart.cartType,
  263. "kunnr": cart.kunnr,
  264. "matnr": cart.matnr,
  265. "maktx": cart.maktx,
  266. "brand": cart.brand,
  267. "spec": cart.spec,
  268. "pattern": cart.pattern
  269. });
  270. })
  271. if (hasChoose.length == 0) {
  272. api.toast({ msg: '至少选择一件商品' });
  273. return;
  274. }
  275. // if (this.status == 3) {
  276. // api.alert({
  277. // title: '系统提示',
  278. // msg: '门店已冻结,请找相关业务经理解冻!',
  279. // }, function (ret, err) {
  280. // });
  281. // return;
  282. // }
  283. var data = {
  284. "retailerId": this.userId,
  285. "amount": count,
  286. "orderType": "0",
  287. "bizCartDtoList": hasChoose,
  288. "type": "body",
  289. "url": "json"
  290. }, _this = this, url = "downOrderU";
  291. this.$post(url, data, function (ret) {
  292. if (ret.code == 0 || ret.code == '0') {
  293. if (!ret.message) {
  294. api.toast({
  295. msg: '下单成功'
  296. });
  297. api.sendEvent({
  298. name: 'refreshshopcart',
  299. });
  300. //api.closeWin({});
  301. var msg = {
  302. id: ret.msg,
  303. type:'1'
  304. }
  305. //_this.getCarList();
  306. setTimeout(function () {
  307. _this.goWin("orderInfo", "orderInfo_win.html", msg);
  308. }, 200);
  309. } else {
  310. api.toast({
  311. msg: ret.message
  312. });
  313. }
  314. }
  315. })
  316. },
  317. /**
  318. * 控制算出购物车的总金额
  319. */
  320. getTotalMoney: function () {
  321. var totalCount = 0;
  322. var isok = true;
  323. this.list.map(function (cart, index) {
  324. if (cart.checked == true) {
  325. totalCount = totalCount + (parseInt(cart.purchaseNumber) ? parseInt(cart.purchaseNumber) : 0) * 1;
  326. } else {
  327. isok = false;
  328. }
  329. })
  330. if (isok == true) {
  331. this.allCheck = true;
  332. } else {
  333. this.allCheck = false;
  334. }
  335. this.totalCount = totalCount;
  336. },
  337. },
  338. filters: {
  339. },
  340. mounted: function () {
  341. this.init();
  342. }
  343. })
  344. }
  345. </script>
  346. </html>