integral_details.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  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/api.css" />
  12. <link rel="stylesheet" type="text/css" href="../css/aui-win.css" />
  13. <!-- <link rel="stylesheet" type="text/css" href="../css/aui.css" /> -->
  14. <link rel="stylesheet" type="text/css" href="css/vant-ui.css" />
  15. <link rel="stylesheet" type="text/css" href="css/iconfont.css">
  16. <link rel="stylesheet" type="text/css" href="css/main.css" />
  17. <script type="text/javascript" src="../script/aui-tab.js"></script>
  18. <script src="js/vue.js"></script>
  19. <script src="js/vant-ui.js"></script>
  20. <script src="js/main.js"></script>
  21. <title></title>
  22. </head>
  23. <style>
  24. [v-cloak] {
  25. display: none;
  26. }
  27. .tabbb {
  28. background-color: #00a0ea;
  29. display: flex;
  30. justify-content: center;
  31. position: relative;
  32. top: -2px
  33. }
  34. .aui-tab-item {
  35. color: #fff;
  36. margin: 0 .25rem;
  37. }
  38. .intab-active {
  39. color: #ffffff;
  40. border-bottom: 2px solid #ffffff;
  41. }
  42. .ShopCard {
  43. background-color: #ffffff;
  44. margin: 0 0 .25rem 0;
  45. padding: .1rem;
  46. }
  47. .ShopButton {
  48. position: fixed;
  49. bottom: 0;
  50. display: flex;
  51. width: 100%;
  52. height: 1rem;
  53. }
  54. .ShopButtonAdd {
  55. background:linear-gradient(90deg,rgba(255,208,30,1) 0%,rgba(255,137,23,1) 100%);
  56. color: #ffffff;
  57. display: flex;
  58. justify-content: center;
  59. flex-grow: 1;
  60. align-items: center;
  61. }
  62. .ShopButtonBuy {
  63. background:linear-gradient(90deg,rgba(255,96,52,1) 0%,rgba(238,10,36,1) 100%);
  64. color: #ffffff;
  65. display: flex;
  66. justify-content: center;
  67. flex-grow: 1;
  68. align-items: center;
  69. }
  70. .ShopDetails-title {
  71. color: #E01212;
  72. border-bottom: 2px solid #E01212;
  73. width: 2.5rem;
  74. height: 1rem;
  75. display: flex;
  76. justify-content: center;
  77. align-items: center;
  78. }
  79. .ShopDetails {
  80. background-color: #ffffff;
  81. padding: .1rem 0;
  82. margin: 0 0 .5rem 0;
  83. }
  84. .shop-add {
  85. display: flex;
  86. justify-content: space-between;
  87. ;
  88. align-items: center;
  89. color: #999999
  90. }
  91. .shop-add-left {
  92. display: flex;
  93. }
  94. .guige {
  95. background-color: #ffffff;
  96. margin: 0 0 .5rem 0;
  97. padding: .25rem;
  98. display: flex;
  99. justify-content: space-between;
  100. }
  101. .buttom-buy {
  102. background-color: #E01212;
  103. color: #ffffff;
  104. display: flex;
  105. justify-content: center;
  106. align-items: center;
  107. border-radius: .5rem;
  108. width: 70%;
  109. height: .75rem;
  110. }
  111. .mescroll{
  112. position: relative;
  113. }
  114. </style>
  115. <body>
  116. <div id="app" style="background-color: #F5F5F5;">
  117. <header class="aui-bar aui-bar-nav aui-bar-info" id="aui-header">
  118. <div>
  119. <a class="aui-btn aui-btn-info aui-pull-left" tapmode onclick="closeWin()"> <span class="aui-iconfont aui-icon-left"></span> </a>
  120. <div class="aui-title" id="aui-title">
  121. <div class="tabbb">
  122. <div class="aui-tab-item tapmode " v-for="(item,index) in activeList" v-bind:class="index==activeId?'intab-active':''" v-on:click="getId(index)">{{item.name}}</div>
  123. </div>
  124. </div>
  125. </div>
  126. </header>
  127. <div style="height:86%;overflow-y:scroll;">
  128. <div v-show="activeId==0">
  129. <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
  130. <van-swipe-item v-if="images.length==0" style="display:flex;justify-content:center;align-items:center"><img src="img/nothing.png" style="width:4rem;height:4rem;margin:1rem 0"></van-swipe-item>
  131. <van-swipe-item v-else v-for="(item,index) in images" :key="index"><img :src="item.productImage"></van-swipe-item>
  132. </van-swipe>
  133. <div class="ShopCard">
  134. <div style="margin:.05rem 0">
  135. {{list.productName}}
  136. </div>
  137. <div style="margin:.05rem 0;color:#999999">
  138. 库存:{{list.productQtyStock}}
  139. </div>
  140. <div class="shop-add">
  141. <div style="margin:.05rem 0;color:#E01212">
  142. {{list.productPrice}}个积分
  143. </div>
  144. <div class="shop-add-left">
  145. 采购数量:
  146. <van-stepper v-model="defaultCount" input-width=".6rem" button-size=".4rem" integer min="1" max="999" v-on:change="inputNum()" />
  147. <!-- <div class="but-sub" v-on:click="subQuantity()">-</div>
  148. <input type="number" v-model="defaultCount" v-on:input="inputNum()" v-on:Blur="outBlur()">
  149. <div class="but-add" v-on:click="addQuantity()">+</div> -->
  150. </div>
  151. </div>
  152. </div>
  153. <div class="guige">
  154. <div style="display:flex">
  155. 规格:
  156. <div style="width:1.5rem">
  157. {{list.productSpecs}}
  158. </div>
  159. </div>
  160. <div style="display:flex">
  161. 花纹:
  162. <div v-if="list.productRemarks==''" style="width:1.5rem">
  163. {{list.productRemarks}}
  164. </div>
  165. <div v-else style="width:1.5rem">
  166. ——
  167. </div>
  168. </div>
  169. <div style="width:2rem">
  170. 层级:——
  171. </div>
  172. </div>
  173. </div>
  174. <div style="background-color:#ffffff;display: flex;justify-content:center;margin: 0 0 .5rem 0;">
  175. <div class="ShopDetails-title">
  176. 商品详情
  177. </div>
  178. </div>
  179. <div class="ShopDetails" v-if="list.productItem" v-html="list.productItem">
  180. </div>
  181. <div class="ShopDetails" v-else>
  182. <div style="text-align:center;color:#ccc">
  183. 暂无数据
  184. </div>
  185. </div>
  186. </div>
  187. <div class="ShopButton">
  188. <div class="ShopButtonAdd" v-on:click="addShopCart">
  189. 加入购物车
  190. </div>
  191. <div class="ShopButtonBuy" v-on:click="showPopup">
  192. 立即下单
  193. </div>
  194. </div>
  195. <van-popup v-model="show" closeable position="bottom" :style="{ height: '40%' }">
  196. <div v-if="addresslist.length!=0" style="margin-top:.8rem;height:65%" class="mescroll-touch-y mescroll">
  197. <van-radio-group v-model="radio" v-for="(ab,index) in addresslist" :key="index" style="padding:.25rem .5rem">
  198. <van-radio :name="ab.mainId">
  199. <div>
  200. <div>
  201. {{ab.contactsName}}
  202. </div>
  203. <div style="font-size:.25rem">
  204. {{ab.province}}{{ab.city}}{{ab.county}}{{ab.address}}
  205. </div>
  206. </div>
  207. </van-radio>
  208. </van-radio-group>
  209. </div>
  210. <div v-else>
  211. <div style="display:flex;justify-content:center;margin-top:.8rem;color:#ccc">
  212. 暂无收货地址
  213. </div>
  214. <div style="display:flex;justify-content:center;margin-top:.8rem;color:#00a0ea" v-on:click="goaddress">
  215. 点击去添加
  216. </div>
  217. </div>
  218. <div style="position: fixed;bottom: .5rem;width:100%;display:flex;justify-content:center">
  219. <div class="buttom-buy" v-on:click="addOrder">
  220. 立即下单
  221. </div>
  222. </div>
  223. </van-popup>
  224. </div>
  225. </body>
  226. <link rel="stylesheet" href="./mescroll/mescroll.min.css">
  227. <script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
  228. <script type="text/javascript" src="../script/api.js"></script>
  229. <script type="text/javascript" src="../script/httpRequest.js"></script>
  230. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  231. <script type="text/javascript">
  232. function closeWin() {
  233. api.closeWin({});
  234. }
  235. apiready = function() {
  236. var productId = api.pageParam.productId;
  237. api.parseTapmode();
  238. var header = $api.byId('aui-header');
  239. $api.fixStatusBar(header);
  240. new Vue({
  241. el: '#app',
  242. data: {
  243. activeList: [{
  244. name: "商品"
  245. }, {
  246. name: "详情"
  247. }],
  248. activeId: 0,
  249. productId: productId,
  250. list: "",
  251. images: [],
  252. defaultCount: 1,
  253. show: false,
  254. addresslist: [],
  255. radio: ''
  256. },
  257. methods: {
  258. init: function() {
  259. this.getProductImage();
  260. this.storeId = $api.getStorage('userid');
  261. this.status = $api.getStorage('status');
  262. },
  263. getId: function(index) {
  264. this.activeId = index;
  265. },
  266. inputNum: function() {
  267. if (this.defaultCount > 999) {
  268. this.showToast("最多购买999件")
  269. this.defaultCount = "999";
  270. } else if (this.defaultCount < 0) {
  271. this.showToast("最少购买1件")
  272. this.defaultCount = "1";
  273. }
  274. },
  275. getProductImage: function() {
  276. var _this = this,
  277. url = "getProductImage",
  278. data = {
  279. "productId": this.productId,
  280. "type": 'body',
  281. "url": 'json'
  282. }
  283. this.$post(url, data, function(ret) {
  284. if (ret.code == 0) {
  285. _this.list = ret.productItem;
  286. _this.images = ret.image;
  287. }
  288. });
  289. },
  290. addShopCart: function() {
  291. if(this.status==3){
  292. api.alert({
  293. title: '系统提示',
  294. msg: '门店已冻结,请找相关业务经理解冻!',
  295. }, function (ret, err) {
  296. });
  297. return;
  298. }
  299. if (this.list.productQtyStock == 0) {
  300. api.toast({
  301. msg: '很抱歉,当前商品暂时缺货'
  302. });
  303. return
  304. }
  305. var data = {
  306. "url": "json",
  307. "type": "body",
  308. "productId": this.list.mainId,
  309. "storeId": this.storeId,
  310. "cartQty": this.defaultCount,
  311. "cartType": "0",
  312. "productIntroduction": this.list.productName,
  313. "spec": this.list.productSpecs,
  314. "productPrice": this.list.productPrice,
  315. "productImage": this.list.productImage
  316. },
  317. _this = this,
  318. url = "addShopCart";
  319. this.$post(url, data, function(ret) {
  320. if (ret.code == 0 || ret.code == '0') {
  321. api.toast({
  322. msg: '成功加入购物车'
  323. });
  324. _this.defaultCount = 1;
  325. }
  326. })
  327. },
  328. showPopup: function() {
  329. if(this.status==3){
  330. api.alert({
  331. title: '系统提示',
  332. msg: '门店已冻结,请找相关业务经理解冻!',
  333. }, function (ret, err) {
  334. });
  335. return;
  336. }
  337. if (this.list.productQtyStock == 0) {
  338. api.toast({
  339. msg: '很抱歉,当前商品暂时缺货'
  340. });
  341. return
  342. }
  343. this.show = true;
  344. var data = {
  345. "url": "json",
  346. "type": "body",
  347. "storeId": this.storeId,
  348. "addressType": "1",
  349. "isDel": 0
  350. },
  351. _this = this,
  352. url = "getReceiptAddress";
  353. this.$post(url, data, function(ret) {
  354. if (ret.code == 0 || ret.code == '0') {
  355. _this.addresslist = ret.list;
  356. for (var i = 0; i < _this.addresslist.length; i++) {
  357. if (_this.addresslist[i].beDefault==1) {
  358. _this.radio = _this.addresslist[i].mainId
  359. }else{
  360. _this.radio = _this.addresslist[0].mainId
  361. }
  362. }
  363. }
  364. })
  365. },
  366. addOrder: function() {
  367. if (this.radio == "") {
  368. api.toast({
  369. msg: '请选择收货地址'
  370. });
  371. return
  372. }
  373. var data = {
  374. "url": "json",
  375. "type": "body",
  376. "productId": this.list.mainId,
  377. "storeId": this.storeId,
  378. "cartQty": this.defaultCount,
  379. "productImage": this.list.productImage,
  380. "mainId": this.radio,
  381. },
  382. _this = this,
  383. url = "immediatelyOrder";
  384. _this.showModal('温馨提示', '是否确认下单?', ["取消", "确认"], function(res) {
  385. if (res == 2) {
  386. _this.$post(url, data, function(ret) {
  387. if (ret.code == 0 || ret.code == '0') {
  388. _this.showToast("成功下单");
  389. _this.show = false;
  390. setTimeout(function() {
  391. _this.goWin('annal', 'annal_win.html');
  392. }, 1000);
  393. } else {
  394. _this.showToast("下单失败")
  395. }
  396. })
  397. }
  398. })
  399. },
  400. goaddress: function() {
  401. this.goWin('address', 'address_win.html');
  402. this.show = false
  403. }
  404. },
  405. mounted: function() {
  406. this.init();
  407. },
  408. })
  409. }
  410. </script>
  411. </html>