integral_details.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  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
  120. class="aui-iconfont aui-icon-left"></span> </a>
  121. <div class="aui-title" id="aui-title">
  122. <div class="tabbb">
  123. <div class="aui-tab-item tapmode " v-for="(item,index) in activeList"
  124. v-bind:class="index==activeId?'intab-active':''" v-on:click="getId(index)">{{item.name}}
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. </header>
  130. <div style="height:86%;overflow-y:scroll;">
  131. <div v-show="activeId==0">
  132. <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
  133. <van-swipe-item v-if="images.length==0"
  134. style="display:flex;justify-content:center;align-items:center"><img src="img/nothing.png"
  135. style="width:4rem;height:4rem;margin:1rem 0"></van-swipe-item>
  136. <van-swipe-item v-else v-for="(item,index) in images" :key="index"><img :src="item.productImage">
  137. </van-swipe-item>
  138. </van-swipe>
  139. <div class="ShopCard">
  140. <div style="margin:.05rem 0">
  141. {{list.productName}}
  142. </div>
  143. <div style="margin:.05rem 0;color:#999999">
  144. 库存:{{list.productQtyStock}}
  145. </div>
  146. <div class="shop-add">
  147. <div style="margin:.05rem 0;color:#E01212">
  148. {{list.productPrice}}个积分
  149. </div>
  150. <div class="shop-add-left">
  151. 采购数量:
  152. <van-stepper v-model="defaultCount" input-width=".6rem" button-size=".4rem" integer min="1"
  153. max="999" v-on:change="inputNum()" />
  154. <!-- <div class="but-sub" v-on:click="subQuantity()">-</div>
  155. <input type="number" v-model="defaultCount" v-on:input="inputNum()" v-on:Blur="outBlur()">
  156. <div class="but-add" v-on:click="addQuantity()">+</div> -->
  157. </div>
  158. </div>
  159. </div>
  160. <div class="guige">
  161. <div style="display:flex">
  162. 规格:
  163. <div style="width:1.5rem">
  164. {{list.productSpecs}}
  165. </div>
  166. </div>
  167. <div style="display:flex">
  168. 花纹:
  169. <div v-if="list.productRemarks==''" style="width:1.5rem">
  170. {{list.productRemarks}}
  171. </div>
  172. <div v-else style="width:1.5rem">
  173. ——
  174. </div>
  175. </div>
  176. <div style="width:2rem">
  177. 层级:——
  178. </div>
  179. </div>
  180. </div>
  181. <div style="background-color:#ffffff;display: flex;justify-content:center;margin: 0 0 .5rem 0;">
  182. <div class="ShopDetails-title">
  183. 商品详情
  184. </div>
  185. </div>
  186. <div class="ShopDetails" v-if="list.productItem" v-html="list.productItem">
  187. </div>
  188. <div class="ShopDetails" v-else>
  189. <div style="text-align:center;color:#ccc">
  190. 暂无数据
  191. </div>
  192. </div>
  193. </div>
  194. <div class="ShopButton">
  195. <div class="ShopButtonAdd" v-on:click="addShopCart">
  196. 加入购物车
  197. </div>
  198. <div class="ShopButtonBuy" v-on:click="showPopup">
  199. 立即下单
  200. </div>
  201. </div>
  202. <van-popup v-model="show" closeable position="bottom" :style="{ height: '40%' }">
  203. <div v-if="addresslist.length!=0" style="margin-top:.8rem;height:65%" class="mescroll-touch-y mescroll">
  204. <van-radio-group v-model="radio" v-for="(ab,index) in addresslist" :key="index"
  205. style="padding:.25rem .5rem">
  206. <van-radio :name="ab.mainId">
  207. <div>
  208. <div>
  209. {{ab.contactsName}}
  210. </div>
  211. <div style="font-size:.25rem">
  212. {{ab.province}}{{ab.city}}{{ab.county}}{{ab.address}}
  213. </div>
  214. </div>
  215. </van-radio>
  216. </van-radio-group>
  217. </div>
  218. <div v-else>
  219. <div style="display:flex;justify-content:center;margin-top:.8rem;color:#ccc">
  220. 暂无收货地址
  221. </div>
  222. <div style="display:flex;justify-content:center;margin-top:.8rem;color:#00a0ea" v-on:click="goaddress">
  223. 点击去添加
  224. </div>
  225. </div>
  226. <div style="position: fixed;bottom: .5rem;width:100%;display:flex;justify-content:center">
  227. <div class="buttom-buy" v-on:click="addOrder">
  228. 立即下单
  229. </div>
  230. </div>
  231. </van-popup>
  232. </div>
  233. </body>
  234. <link rel="stylesheet" href="./mescroll/mescroll.min.css">
  235. <script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
  236. <script type="text/javascript" src="../script/api.js"></script>
  237. <script type="text/javascript" src="../script/httpRequest.js"></script>
  238. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  239. <script type="text/javascript">
  240. function closeWin() {
  241. api.closeWin({});
  242. }
  243. apiready = function () {
  244. var productId = api.pageParam.productId;
  245. api.parseTapmode();
  246. var header = $api.byId('aui-header');
  247. $api.fixStatusBar(header);
  248. new Vue({
  249. el: '#app',
  250. data: {
  251. activeList: [{
  252. name: "商品"
  253. }, {
  254. name: "详情"
  255. }],
  256. activeId: 0,
  257. productId: productId,
  258. list: "",
  259. images: [],
  260. defaultCount: 1,
  261. show: false,
  262. addresslist: [],
  263. radio: ''
  264. },
  265. methods: {
  266. init: function () {
  267. this.getProductImage();
  268. this.storeId = $api.getStorage('userid');
  269. this.status = $api.getStorage('status');
  270. },
  271. getId: function (index) {
  272. this.activeId = index;
  273. },
  274. inputNum: function () {
  275. if (this.defaultCount > 999) {
  276. this.showToast("最多购买999件")
  277. this.defaultCount = "999";
  278. } else if (this.defaultCount < 0) {
  279. this.showToast("最少购买1件")
  280. this.defaultCount = "1";
  281. }
  282. },
  283. getProductImage: function () {
  284. var _this = this,
  285. url = "getProductImage",
  286. data = {
  287. "productId": this.productId,
  288. "type": 'body',
  289. "url": 'json'
  290. }
  291. this.$post(url, data, function (ret) {
  292. if (ret.code == 0) {
  293. _this.list = ret.productItem;
  294. _this.images = ret.image;
  295. }
  296. });
  297. },
  298. addShopCart: function () {
  299. if (this.status == 3) {
  300. api.alert({
  301. title: '系统提示',
  302. msg: '门店已冻结,请找相关业务经理解冻!',
  303. }, function (ret, err) {
  304. });
  305. return;
  306. }
  307. if (this.list.productQtyStock == 0) {
  308. api.toast({
  309. msg: '很抱歉,当前商品暂时缺货'
  310. });
  311. return
  312. }
  313. var data = {
  314. "url": "json",
  315. "type": "body",
  316. "productId": this.list.mainId,
  317. "storeId": this.storeId,
  318. "cartQty": this.defaultCount,
  319. "cartType": "0",
  320. "productIntroduction": this.list.productName,
  321. "spec": this.list.productSpecs,
  322. "productPrice": this.list.productPrice,
  323. "productImage": this.list.productImage
  324. },
  325. _this = this,
  326. url = "addShopCart";
  327. this.$post(url, data, function (ret) {
  328. if (ret.code == 0 || ret.code == '0') {
  329. if (!ret.message) {
  330. api.toast({
  331. msg: '成功加入购物车'
  332. });
  333. _this.defaultCount = 1;
  334. } else {
  335. api.toast({
  336. msg: ret.message
  337. });
  338. }
  339. }
  340. })
  341. },
  342. showPopup: function () {
  343. if (this.status == 3) {
  344. api.alert({
  345. title: '系统提示',
  346. msg: '门店已冻结,请找相关业务经理解冻!',
  347. }, function (ret, err) {
  348. });
  349. return;
  350. }
  351. if (this.list.productQtyStock == 0) {
  352. api.toast({
  353. msg: '很抱歉,当前商品暂时缺货'
  354. });
  355. return
  356. }
  357. this.show = true;
  358. var data = {
  359. "url": "json",
  360. "type": "body",
  361. "storeId": this.storeId,
  362. "addressType": "1",
  363. "isDel": 0
  364. },
  365. _this = this,
  366. url = "getReceiptAddress";
  367. this.$post(url, data, function (ret) {
  368. if (ret.code == 0 || ret.code == '0') {
  369. _this.addresslist = ret.list;
  370. for (var i = 0; i < _this.addresslist.length; i++) {
  371. if (_this.addresslist[i].beDefault == 1) {
  372. _this.radio = _this.addresslist[i].mainId
  373. } else {
  374. _this.radio = _this.addresslist[0].mainId
  375. }
  376. }
  377. }
  378. })
  379. },
  380. addOrder: function () {
  381. if (this.radio == "") {
  382. api.toast({
  383. msg: '请选择收货地址'
  384. });
  385. return
  386. }
  387. var data = {
  388. "url": "json",
  389. "type": "body",
  390. "productId": this.list.mainId,
  391. "storeId": this.storeId,
  392. "cartQty": this.defaultCount,
  393. "productImage": this.list.productImage,
  394. "mainId": this.radio,
  395. },
  396. _this = this,
  397. url = "immediatelyOrder";
  398. _this.showModal('温馨提示', '是否确认下单?', ["取消", "确认"], function (res) {
  399. if (res == 2) {
  400. _this.$post(url, data, function (ret) {
  401. if (ret.code == 0 || ret.code == '0') {
  402. if (!ret.message) {
  403. _this.showToast("成功下单");
  404. _this.show = false;
  405. setTimeout(function () {
  406. _this.goWin('annal', 'annal_win.html');
  407. }, 1000);
  408. } else {
  409. api.toast({
  410. msg: ret.message
  411. });
  412. _this.show = false;
  413. }
  414. } else {
  415. _this.showToast("下单失败")
  416. }
  417. })
  418. }
  419. })
  420. },
  421. goaddress: function () {
  422. this.goWin('address', 'address_win.html');
  423. this.show = false
  424. }
  425. },
  426. mounted: function () {
  427. this.init();
  428. },
  429. })
  430. }
  431. </script>
  432. </html>