mall-laonong/unpackage/dist/dev/.sourcemap/mp-weixin/pages/cart/settlement.js.map

1 line
29 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{"version":3,"sources":["uni-app:///main.js","webpack:///D:/老农商城/mall-laonong/pages/cart/settlement.vue?65d0","webpack:///D:/老农商城/mall-laonong/pages/cart/settlement.vue?3023","webpack:///D:/老农商城/mall-laonong/pages/cart/settlement.vue?07d0","webpack:///D:/老农商城/mall-laonong/pages/cart/settlement.vue?5cc6","uni-app:///pages/cart/settlement.vue"],"names":["wx","__webpack_require_UNI_MP_PLUGIN__","__webpack_require__","createPage","Page"],"mappings":";;;;;;;;;;kDAAA;;;AAGA;AACA,qG,8FAHA;AACAA,EAAE,CAACC,iCAAH,GAAuCC,mBAAvC,CAGAC,UAAU,CAACC,mBAAD,CAAV,C;;;;;;;;;;;;;ACLA;AAAA;AAAA;AAAA;AAAA;AAAuH;AACvH;AAC8D;AACL;;;AAGzD;AACoL;AACpL,gBAAgB,2LAAU;AAC1B,EAAE,gFAAM;AACR,EAAE,qFAAM;AACR,EAAE,8FAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,yFAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACtBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA,aAAa,oMAEN;AACP;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACvEA;AAAA;AAAA;AAAA;AAA4rB,CAAgB,0rBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC0IhtB;AACA,MADA,kBACA;AACA;AACA,mBADA,EACA;AACA,yBAFA,EAEA;AACA,uBAHA,EAGA;AACA,oBAJA,EAIA;AACA,oBALA,EAKA;AACA,qBANA,EAMA;AACA,wBAPA,EAOA;AACA,uBARA,EAQA;AACA,uBATA,EASA;AACA,uBAVA,EAUA;AACA,qBAXA,EAWA;AACA,gBAZA;AAaA,oCAbA,EAaA;AACA,oBAdA,EAcA;AACA,uBAfA,EAeA;AACA,oBAhBA,EAgBA;AACA,sBAjBA;AAkBA,mBAlBA,EAkBA;AACA,sBAnBA;;AAqBA,GAvBA;AAwBA,QAxBA,oBAwBA;AACA;AACA;AACA,GA3BA;AA4BA;AACA;AACA,aAFA,uBAEA;AACA;AACA,kDADA;;AAGA,KANA;;AAQA;AACA,gBATA,0BASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAHA,MAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAHA,MAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAHA,MAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KA1EA;;AA4EA;AACA,gBA7EA,0BA6EA;AACA;AACA,oBADA;;AAGA;AACA,+CADA;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAFA;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAHA,MAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OApDA;AAqDA,KAzIA;;AA2IA;AACA,iBA5IA,yBA4IA,EA5IA,EA4IA;AACA;AACA;AACA;AACA;AACA;AACA,OALA;AAMA,KAnJA;;AAqJA;AACA,YAtJA,sBAsJA;AACA;AACA;AACA,OAFA,MAEA;AACA;AACA;AACA,KA5JA;;AA8JA;AACA,gBA/JA,wBA+JA,KA/JA,EA+JA;AACA;AACA;AACA;AACA,KAnKA;;AAqKA;AACA,aAtKA,uBAsKA;AACA;AACA;AACA;AACA;AACA;AACA,KA5KA;;AA8KA;AACA,eA/KA,yBA+KA;AACA;AACA;AACA,KAlLA;;AAoLA;AACA,YArLA,oBAqLA,IArLA,EAqLA;AACA;AACA;AACA;AACA,SAFA,MAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAFA,MAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAFA,MAEA;AACA;AACA;AACA;AACA,SAPA,MAOA;AACA;AACA;AACA;AACA,KApNA;;AAsNA;AACA,YAvNA,sBAuNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAFA,MAEA;AACA;AACA;AACA,mDADA;AAEA,2DAFA;AAGA,mFAHA;AAIA,qDAJA;AAKA,+CALA;AAMA,+CANA;AAOA,+CAPA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA,eAHA,MAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEADA;;AAGA;AACA,aAfA,MAeA;AACA;AACA;AACA;AACA;AACA,WArBA;AAsBA,SAhCA,MAgCA;AACA;AACA;AACA;AACA,KAzQA;;AA2QA;AACA,eA5QA,uBA4QA,IA5QA,EA4QA,EA5QA,EA4QA,MA5QA,EA4QA;AACA;AACA;AACA,mCADA;AAEA,iCAFA;AAGA,+BAHA;AAIA,iCAJA;AAKA,4BALA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDADA;;AAGA,SAhBA;AAiBA;AACA;AACA;AACA;AACA;AACA,+DADA;;AAGA,WALA,EAKA,IALA;AAMA,SAzBA;;AA2BA,KAzSA;;AA2SA;AACA,aA5SA,qBA4SA,MA5SA,EA4SA;AACA;AACA;AACA;AACA,SAFA,MAEA;AACA;AACA;AACA,OANA;AAOA,KApTA,EA5BA,E","file":"pages/cart/settlement.js","sourcesContent":["import 'uni-pages';\n// @ts-ignore\nwx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;\nimport Vue from 'vue'\nimport Page from './pages/cart/settlement.vue'\ncreatePage(Page)","import { render, staticRenderFns, recyclableRender, components } from \"./settlement.vue?vue&type=template&id=5371580f&\"\nvar renderjs\nimport script from \"./settlement.vue?vue&type=script&lang=js&\"\nexport * from \"./settlement.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"pages/cart/settlement.vue\"\nexport default component.exports","export * from \"-!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./settlement.vue?vue&type=template&id=5371580f&\"","var components\ntry {\n components = {\n statusNav: function() {\n return import(\n /* webpackChunkName: \"components/status-nav/status-nav\" */ \"@/components/status-nav/status-nav.vue\"\n )\n }\n }\n} catch (e) {\n if (\n e.message.indexOf(\"Cannot find module\") !== -1 &&\n e.message.indexOf(\".vue\") !== -1\n ) {\n console.error(e.message)\n console.error(\"1. 排查组件名称拼写是否正确\")\n console.error(\n \"2. 排查组件是否符合 easycom 规范文档https://uniapp.dcloud.net.cn/collocation/pages?id=easycom\"\n )\n console.error(\n \"3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件\"\n )\n } else {\n throw e\n }\n}\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n var m0 = _vm.isLoading ? parseFloat(_vm.orderInfo.available_balance) : null\n var l0 = _vm.isLoading\n ? _vm.__map(_vm.couponList, function(item, index) {\n var $orig = _vm.__get_orig(item)\n\n var g0 = item.amount.split(\".\")\n var g1 = item.amount.split(\".\")\n var m1 = parseInt(item.condition)\n var m2 = parseInt(item.amount)\n return {\n $orig: $orig,\n g0: g0,\n g1: g1,\n m1: m1,\n m2: m2\n }\n })\n : null\n\n if (!_vm._isMounted) {\n _vm.e0 = function($event) {\n _vm.wechatCheck = !_vm.wechatCheck\n }\n\n _vm.e1 = function($event) {\n _vm.priceCheck = !_vm.priceCheck\n }\n }\n\n _vm.$mp.data = Object.assign(\n {},\n {\n $root: {\n m0: m0,\n l0: l0\n }\n }\n )\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./settlement.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./settlement.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view class=\"pad-x150\" v-if=\"isLoading\">\r\n\t\t<status-nav :ifReturn=\"true\" navBarTitle=\"确认订单\" :marginBottom=\"0\"></status-nav>\r\n\t\t<!-- 收件人信息 -->\r\n\t\t<view class=\"settlement-content pad-zy20 border-box\">\r\n\t\t\t<view class=\"section background-white radius30 mar-x40 pad-all25 border-box font30\">\r\n\t\t\t\t<view class=\"title\">收件人信息</view>\r\n\t\t\t\t<view class=\"addressee-info mar-s20 flex\" @tap=\"toAddress\">\r\n\t\t\t\t\t<view class=\"txt\" v-if=\"default_address\">\r\n\t\t\t\t\t\t<view class=\"font30 mar-x10\">{{default_address.name}}<text>{{default_address.phone}}</text></view>\r\n\t\t\t\t\t\t<text class=\"font24 color-8c\">{{default_address.province_str}}{{default_address.city_str}}{{default_address.county_str}}{{default_address.address}}</text>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t\t<view class=\"txt\" v-else>\r\n\t\t\t\t\t\t<view class=\"font30 color-8c\" style=\"line-height: 2;\">请选择地址</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t\t<image src=\"/static/icon/icon-more.png\" mode=\"widthFix\"></image>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t<!-- 订单信息 -->\r\n\t\t\t<view class=\"section background-white radius30 mar-x40 pad-all25 border-box font30\">\r\n\t\t\t\t<view class=\"title\">订单信息</view>\r\n\t\t\t\t<view class=\"shop-slide-list\">\r\n\t\t\t\t\t<view class=\"shop-slide-item\">\r\n\t\t\t\t\t\t<view class=\"item border-box background-white flex\" v-for=\"(item,index) in orderShopList\" :key=\"index\">\r\n\t\t\t\t\t\t\t<view class=\"shop-img radius30\">\r\n\t\t\t\t\t\t\t\t<image :src=\"item.spu_cover\" mode=\"widthFix\"></image> \r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t<view class=\"shop-txt\">\r\n\t\t\t\t\t\t\t\t<view class=\"shop-txt-top\">\r\n\t\t\t\t\t\t\t\t\t<view class=\"title font30 clips1\">{{item.goods_name}}</view>\r\n\t\t\t\t\t\t\t\t\t<view class=\"specs font24 color-66 mar-sx10 clips2\">规格:{{item.sku_name}}</view>\r\n\t\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t\t<view class=\"shop-txt-bottom flex\">\r\n\t\t\t\t\t\t\t\t\t<!-- 商品价格 -->\r\n\t\t\t\t\t\t\t\t\t<view class=\"price font30 color-red\">¥{{item.price}}<text class=\"font24 color-66\">x{{item.num}}</text></view>\r\n\t\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t<!-- 优惠选择 -->\r\n\t\t\t<view class=\"section background-white radius30 mar-x40 pad-all25 border-box font30\">\r\n\t\t\t\t<view class=\"title\">优惠选择</view>\r\n\t\t\t\t<view class=\"section-list font30\">\r\n\t\t\t\t\t<view class=\"item flex\" v-if=\"orderInfo.vip_level>0\">\r\n\t\t\t\t\t\t<label class=\"radio\" @tap=\"chooseEv('vip')\"><radio :checked=\"vipCheck\" color=\"#febf00\"/><text>会员折扣</text></label>\r\n\t\t\t\t\t\t<view class=\"txt flex\">\r\n\t\t\t\t\t\t\t<view>{{orderInfo.membership_discount}}折</view>\r\n\t\t\t\t\t\t\t<view class=\"btn\"></view>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t\t<view class=\"item flex\" @tap.stop=\"toCoupon\">\r\n\t\t\t\t\t\t<label class=\"radio\" @tap.stop=\"chooseEv('coupon')\">\r\n\t\t\t\t\t\t\t<radio :checked=\"couponCheck\" color=\"#febf00\" :disabled=\"couponList.length?false:true\"/>\r\n\t\t\t\t\t\t\t<text>优惠券</text>\r\n\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t<view class=\"txt flex\">\r\n\t\t\t\t\t\t\t<view class=\"color-red\" v-if=\"couponList.length\">{{'-'+ couponList[couponIndex].amount}}</view>\r\n\t\t\t\t\t\t\t<view class=\"btn\">\r\n\t\t\t\t\t\t\t\t<image src=\"/static/icon/icon-join.png\" mode=\"widthFix\"></image>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t<!-- 积分抵扣 -->\r\n\t\t\t<view class=\"section background-white radius30 mar-x40 pad-all25 border-box font30\">\r\n\t\t\t\t<view class=\"title\">积分抵扣</view>\r\n\t\t\t\t<view class=\"section-list font30\">\r\n\t\t\t\t\t<view class=\"item flex\">\r\n\t\t\t\t\t\t<label class=\"radio\" @tap=\"chooseEv('score')\">\r\n\t\t\t\t\t\t\t<radio :checked=\"scoreCheck\" color=\"#febf00\" :disabled=\"!checkedYes\"/>\r\n\t\t\t\t\t\t\t<text>可用积分</text>\r\n\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t<view class=\"txt flex\">\r\n\t\t\t\t\t\t\t<view class=\"color-66\">{{orderInfo.available_score}}</view>\r\n\t\t\t\t\t\t\t<view class=\"btn\"></view>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t<!-- 支付方式 -->\r\n\t\t\t<view class=\"section background-white radius30 mar-x40 pad-all25 border-box font30\">\r\n\t\t\t\t<view class=\"title\">支付方式</view>\r\n\t\t\t\t<view class=\"section-list font30\">\r\n\t\t\t\t\t<view class=\"item flex\">\r\n\t\t\t\t\t\t<label class=\"radio\"><radio :checked=\"wechatCheck\" @tap=\"wechatCheck=!wechatCheck\" color=\"#febf00\"/>微信支付</label>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t\t<view class=\"item flex\">\r\n\t\t\t\t\t\t<label class=\"radio\" @tap=\"priceCheck=!priceCheck\">\r\n\t\t\t\t\t\t\t<radio :checked=\"priceCheck\" color=\"#febf00\" :disabled=\"orderInfo.available_balance>0?false:true\"/>\r\n\t\t\t\t\t\t\t<text>余额支付</text>\r\n\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t<view class=\"txt flex\">\r\n\t\t\t\t\t\t\t<view class=\"color-66\">{{parseFloat(orderInfo.available_balance)>0?orderInfo.available_balance:0}}</view>\r\n\t\t\t\t\t\t\t<view class=\"btn\"></view>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<!-- 尾部 -->\r\n\t\t<view class=\"pull-footer-bg background-white pad-all20 radius30 border-box\">\r\n\t\t\t<view class=\"pull-footer background-grey radius30 pad-all20 border-box flex\">\r\n\t\t\t\t<view class=\"price color-ff\" style=\"margin-left: 24rpx;\">\r\n\t\t\t\t\t<view class=\"font36 flex\">合计:<text v-if=\"totalPrice>0\">¥</text>{{totalPrice}}</view>\r\n\t\t\t\t\t<text class=\"font26\" v-if=\"discountPrice>0\">总优惠:¥{{discountPrice}}</text>\r\n\t\t\t\t</view>\r\n\t\t\t\t<view class=\"btn font36 color-48 background-orange radius30 flex\" @tap=\"submitEv\">立即支付</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<!-- 优惠券弹窗 -->\r\n\t\t<view class=\"pull-bg\" style=\"background-color: rgba(0,0,0,.3);\" v-show=\"isCoupon\"></view>\r\n\t\t<view class=\"coupon-box border-box background-white\" v-show=\"isCoupon\">\r\n\t\t\t<view class=\"title font36 background-white pad-sx25\">优惠券选择</view>\r\n\t\t\t<scroll-view scroll-y=\"true\" class=\"coupon-scoll\">\r\n\t\t\t\t<view class=\"coupon-list pad-zy20 border-box\">\r\n\t\t\t\t\t<view class=\"coupon-item radius30 mar-s40 flex\" v-for=\"(item,index) in couponList\" :key=\"index\" @tap=\"changeCoupon(index)\">\r\n\t\t\t\t\t\t<view class=\"price color-ff border-box\"><text class=\"font30\">¥</text>{{item.amount.split(\".\")[0]}}<text class=\"font30\">{{'.'+item.amount.split(\".\")[1]}}</text></view>\r\n\t\t\t\t\t\t<view class=\"txt\">\r\n\t\t\t\t\t\t\t<view class=\"font36\">{{item.name}}</view>\r\n\t\t\t\t\t\t\t<view class=\"font24 color-8c mar-s10\">满{{parseInt(item.condition)}}减{{parseInt(item.amount)}}</view>\r\n\t\t\t\t\t\t\t<view class=\"font24 color-8c mar-s10\">{{item.begin_at}}至{{item.end_at}}</view>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t<view class=\"btn mar-zy20 color-ff font24\" v-if=\"index == couponIndex\">已选择</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t</scroll-view>\r\n\t\t\t<view class=\"coupon-btns border-box pad-zy20 color-48 mar-sx30 flex\">\r\n\t\t\t\t<view class=\"btn font36 radius30 background-orange\" @tap=\"useCoupon\">确认使用</view>\r\n\t\t\t\t<view class=\"btn font36 radius30\" style=\"background-color: #e9e9e9;\" @tap=\"closeCoupon\">取消选择</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t</view>\r\n</template>\r\n\r\n<script>\r\n\texport default {\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\torderInfo:{}, //订单信息\r\n\t\t\t\tdefault_address:{}, //地址信息\r\n\t\t\t\torderShopList:[], // 商品信息\r\n\t\t\t\tcouponList:[], //优惠券列表\r\n\t\t\t\tcouponIndex:0, //优惠券选择\r\n\t\t\t\tvipCheck: false, //会员折扣\r\n\t\t\t\tcouponCheck:false, // 优惠选择\r\n\t\t\t\tscoreCheck:false, //积分抵扣\r\n\t\t\t\twechatCheck:true, //微信支付\r\n\t\t\t\tpriceCheck:false, //余额支付\r\n\t\t\t\tisCoupon:false, //优惠券弹窗\r\n\t\t\t\tflag:true,\r\n\t\t\t\tpreferential_options:'coupon',//优惠选择\r\n\t\t\t\ttotalPrice:'',//总价\r\n\t\t\t\tdiscountPrice:'', //优惠价格\r\n\t\t\t\tdiscountNum:0, //优惠价格数字\r\n\t\t\t\tisLoading:false,\r\n\t\t\t\tscore_rule: 1, //多少积分抵扣\r\n\t\t\t\tcheckedYes:true,\r\n\t\t\t}\r\n\t\t},\r\n\t\tonShow() {\r\n\t\t\t// 获取信息\r\n\t\t\tthis.getOrderInfo();\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\t// 选择地址\r\n\t\t\ttoAddress(){\r\n\t\t\t\tuni.navigateTo({\r\n\t\t\t\t\turl:`/pagesA/address/address?type=change`\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 计算价格\r\n\t\t\tcomputePrice(){\r\n\t\t\t\t// 原需支付\r\n\t\t\t\tlet totalNum = this.orderInfo.total_price;\r\n\t\t\t\ttotalNum = parseFloat(this.$toolAll.tools.addXiaoShu(totalNum));\r\n\t\t\t\tlet totalPrice = this.$toolAll.tools.addXiaoShu(totalNum);\r\n\t\t\t\t// 会员折扣\r\n\t\t\t\tlet vipNum = this.orderInfo.vip_level>0?this.orderInfo.total_price*(1 - this.$toolAll.tools.addXiaoShu(this.orderInfo.membership_discount)/10):0;\r\n\t\t\t\tvipNum = parseFloat(this.$toolAll.tools.addXiaoShu(vipNum));\r\n\t\t\t\tlet vipPrice = this.$toolAll.tools.addXiaoShu(vipNum);\r\n\t\t\t\t// 优惠券折扣\r\n\t\t\t\tlet couponNum = this.couponList.length>0?this.couponList[this.couponIndex].amount:0;\r\n\t\t\t\tcouponNum = parseFloat(this.$toolAll.tools.addXiaoShu(couponNum));\r\n\t\t\t\tlet couponPrice = this.$toolAll.tools.addXiaoShu(couponNum);\r\n\t\t\t\t// 积分可抵扣额度\r\n\t\t\t\tlet scoreNum = this.orderInfo.available_score*this.score_rule;\r\n\t\t\t\tscoreNum = parseInt(this.$toolAll.tools.addXiaoShu(scoreNum));\r\n\t\t\t\tlet scorePrice = this.$toolAll.tools.addXiaoShu(scoreNum);\r\n\t\t\t\t\r\n\t\t\t\t// 只有会员则扣\r\n\t\t\t\tif(this.vipCheck && !this.scoreCheck){\r\n\t\t\t\t\tthis.discountNum = vipNum;\r\n\t\t\t\t\tthis.discountPrice = vipPrice;\r\n\t\t\t\t}\r\n\t\t\t\t// 只有优惠券\r\n\t\t\t\tif(this.couponCheck && !this.scoreCheck){\r\n\t\t\t\t\tthis.discountNum = couponNum;\r\n\t\t\t\t\tthis.discountPrice = couponPrice;\r\n\t\t\t\t}\r\n\t\t\t\t// 只有积分\r\n\t\t\t\tif(!this.vipCheck && !this.couponCheck && this.scoreCheck){\r\n\t\t\t\t\tif(scoreNum >= totalNum){\r\n\t\t\t\t\t\tthis.discountNum = totalNum;\r\n\t\t\t\t\t\tthis.discountPrice = totalPrice;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.discountNum = scoreNum;\r\n\t\t\t\t\t\tthis.discountPrice = scorePrice;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// 会员折扣+积分\r\n\t\t\t\tif(this.vipCheck && this.scoreCheck){\r\n\t\t\t\t\tif(scoreNum + vipNum >= totalNum){\r\n\t\t\t\t\t\tthis.discountNum = totalNum;\r\n\t\t\t\t\t\tthis.discountPrice = totalPrice;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.discountNum = scoreNum + vipNum;\r\n\t\t\t\t\t\tthis.discountPrice = this.$toolAll.tools.addXiaoShu(scoreNum + vipNum);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// 优惠券+积分\r\n\t\t\t\tif(this.couponCheck && this.scoreCheck){\r\n\t\t\t\t\tif(scoreNum + couponNum >= totalNum){\r\n\t\t\t\t\t\tthis.discountNum = totalNum;\r\n\t\t\t\t\t\tthis.discountPrice = totalPrice;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.discountNum = scoreNum + couponNum;\r\n\t\t\t\t\t\tthis.discountPrice = this.$toolAll.tools.addXiaoShu(scoreNum + couponNum);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// 都不选择\r\n\t\t\t\tif(!this.vipCheck && !this.couponCheck && !this.scoreCheck){\r\n\t\t\t\t\tthis.discountNum = 0;\r\n\t\t\t\t\tthis.discountPrice = 0;\r\n\t\t\t\t}\r\n\t\t\t\t// 计算支付价格\r\n\t\t\t\tthis.totalPrice = this.$toolAll.tools.addXiaoShu(totalNum - this.discountNum);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 获取订单准备信息\r\n\t\t\tgetOrderInfo(){\r\n\t\t\t\tuni.showLoading({\r\n\t\t\t\t\ttitle:'加载中'\r\n\t\t\t\t})\r\n\t\t\t\tlet params = {\r\n\t\t\t\t\tsku_list: uni.getStorageSync('buyList'),\r\n\t\t\t\t}\r\n\t\t\t\tthis.$requst.post('/api/order/prepare-info',params).then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tconsole.log(res,'订单准备信息');\r\n\t\t\t\t\t\t// 其他信息\r\n\t\t\t\t\t\tthis.orderInfo = res.data;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// 优惠券信息\r\n\t\t\t\t\t\tlet baseArr = res.data.available_coupon_list;\r\n\t\t\t\t\t\tlet couponArr = baseArr.sort(function (a, b) {\r\n\t\t\t\t\t\t return b.amount - a.amount;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.couponList = couponArr;\r\n\t\t\t\t\t\tif(this.couponList.length==0){\r\n\t\t\t\t\t\t\tthis.couponCheck = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// 商品信息\r\n\t\t\t\t\t\tthis.orderShopList = res.data.list;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// 积分抵扣规则\r\n\t\t\t\t\t\tlet score_num = res.data.integral_rule.deduction_points_score;\r\n\t\t\t\t\t\tlet score_value = res.data.integral_rule.deduction_points_score_value;\r\n\t\t\t\t\t\tthis.score_rule = parseFloat(score_value)/parseFloat(score_num);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// 积分是否可选\r\n\t\t\t\t\t\tlet scoreA = this.orderInfo.available_score*this.score_rule;\r\n\t\t\t\t\t\tlet scoreB = parseFloat(this.$toolAll.tools.addXiaoShu(scoreA));\r\n\t\t\t\t\t\tif(scoreB<1){\r\n\t\t\t\t\t\t\tthis.checkedYes = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// 地址信息\r\n\t\t\t\t\t\tlet addr_id = uni.getStorageSync('addr_id');\r\n\t\t\t\t\t\tif(addr_id){\r\n\t\t\t\t\t\t\t// 获取地址\r\n\t\t\t\t\t\t\tthis.getAddrDetail(addr_id);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.default_address = res.data.default_address;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// 价格\r\n\t\t\t\t\t\tthis.discountPrice = 0;\r\n\t\t\t\t\t\tthis.totalPrice = this.$toolAll.tools.addXiaoShu(this.orderInfo.total_price);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// 计算价格\r\n\t\t\t\t\t\tif(this.vipCheck||this.couponCheck||this.scoreCheck){\r\n\t\t\t\t\t\t\t// 计算价格\r\n\t\t\t\t\t\t\tthis.computePrice();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tuni.hideLoading();\r\n\t\t\t\t\tthis.isLoading = true;\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 获取地址\r\n\t\t\tgetAddrDetail(id){\r\n\t\t\t\tthis.$requst.post('/api/user/address-info',{id:id}).then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tconsole.log(res,'地址详情');\r\n\t\t\t\t\t\tthis.default_address = res.data;\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 打开优惠券弹窗\r\n\t\t\ttoCoupon(){\r\n\t\t\t\tif(this.couponList.length){\r\n\t\t\t\t\tthis.isCoupon =true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.$toolAll.tools.showToast('暂无可用的优惠券');\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 选择优惠券\r\n\t\t\tchangeCoupon(index){\r\n\t\t\t\tif(index!==this.couponIndex){\r\n\t\t\t\t\tthis.couponIndex = index;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t//确认选择\r\n\t\t\tuseCoupon(){\r\n\t\t\t\tthis.isCoupon = false;\r\n\t\t\t\tthis.vipCheck = false;\r\n\t\t\t\tthis.couponCheck = true;\r\n\t\t\t\t// 计算价格\r\n\t\t\t\tthis.computePrice();\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t//取消选择\r\n\t\t\tcloseCoupon(){\r\n\t\t\t\tthis.isCoupon = false;\r\n\t\t\t\tthis.couponIndex = 0;\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 选择按钮\r\n\t\t\tchooseEv(type){\r\n\t\t\t\tif(type == 'vip' && this.orderInfo.vip_level>0){\r\n\t\t\t\t\tif(this.vipCheck){\r\n\t\t\t\t\t\tthis.vipCheck = false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vipCheck = true;\r\n\t\t\t\t\t\tthis.couponCheck = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.computePrice();\r\n\t\t\t\t}\r\n\t\t\t\tif(type == 'coupon' && this.couponList.length){\r\n\t\t\t\t\tif(this.couponCheck){\r\n\t\t\t\t\t\tthis.couponCheck = false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.couponCheck = true;\r\n\t\t\t\t\t\tthis.vipCheck = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.computePrice();\r\n\t\t\t\t}\r\n\t\t\t\tif(type == 'score' && this.orderInfo.available_score>0){\r\n\t\t\t\t\tif(this.checkedYes){\r\n\t\t\t\t\t\tif(this.scoreCheck){\r\n\t\t\t\t\t\t\tthis.scoreCheck = false;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.scoreCheck = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.computePrice();\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.$toolAll.tools.showToast('当前积分无法抵扣');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 提交\r\n\t\t\tsubmitEv(){\r\n\t\t\t\tthis.flag = false;\r\n\t\t\t\tif(this.vipCheck){\r\n\t\t\t\t\tthis.preferential_options = 'membership_discount';\r\n\t\t\t\t}\r\n\t\t\t\tif(this.couponCheck){\r\n\t\t\t\t\tthis.preferential_options = 'coupon';\r\n\t\t\t\t}\r\n\t\t\t\tif(!this.couponCheck && !this.vipCheck){\r\n\t\t\t\t\tthis.preferential_options = '';\r\n\t\t\t\t}\r\n\t\t\t\tif(this.default_address == null) {\r\n\t\t\t\t\tthis.$toolAll.tools.showToast('请填写地址信息');\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(this.wechatCheck || this.priceCheck){\r\n\t\t\t\t\t\tlet params = {\r\n\t\t\t\t\t\t\tsku_list: uni.getStorageSync('buyList'),\r\n\t\t\t\t\t\t\tpreferential_options:this.preferential_options,\r\n\t\t\t\t\t\t\tcoupon_id: this.couponCheck?this.couponList[this.couponIndex].id:'',\r\n\t\t\t\t\t\t\tdeduction_points:this.scoreCheck?1:0,\r\n\t\t\t\t\t\t\tis_balance:this.priceCheck?1:0,\r\n\t\t\t\t\t\t\tis_wechat:this.wechatCheck?1:0,\r\n\t\t\t\t\t\t\taddress_id:this.default_address.id\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.$requst.post('/api/order/create',params).then(res=>{\r\n\t\t\t\t\t\t\tif(res.code==0) {\r\n\t\t\t\t\t\t\t\tconsole.log(res,'支付返回')\r\n\t\t\t\t\t\t\t\tif(res.data.need_wechat_pay == 1){\r\n\t\t\t\t\t\t\t\t\t// 调用微信支付\r\n\t\t\t\t\t\t\t\t\tthis.callPayMent(res.data.payment_params,res.data.id,res.data.coding);\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t// 成功状态\r\n\t\t\t\t\t\t\t\t\tthis.successEv(res.data.coding);\r\n\t\t\t\t\t\t\t\t\t// 清除缓存\r\n\t\t\t\t\t\t\t\t\tuni.removeStorageSync('addr_id');\r\n\t\t\t\t\t\t\t\t\t// 页面跳转\r\n\t\t\t\t\t\t\t\t\tuni.navigateTo({\r\n\t\t\t\t\t\t\t\t\t\turl:`/pages/cart/finish?id=${res.data.id}`\r\n\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.log(res.msg,'提示信息')\r\n\t\t\t\t\t\t\t\tthis.$toolAll.tools.showToast(res.msg);\r\n\t\t\t\t\t\t\t\tthis.flag = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.$toolAll.tools.showToast('请选择支付方式');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 调用微信支付\r\n\t\t\tcallPayMent(data,id,coding){\r\n\t\t\t\t//调起支付\r\n\t\t\t\twx.requestPayment({ \r\n\t\t\t\t\t'timeStamp': data.timeStamp,\r\n\t\t\t\t\t'nonceStr': data.nonceStr,\r\n\t\t\t\t\t'package': data.package,\r\n\t\t\t\t\t\"signType\": data.signType,\r\n\t\t\t\t\t'paySign': data.sign,\r\n\t\t\t\t\t'success': (res)=> { // 接口调用成功的回调函数\r\n\t\t\t\t\t\tconsole.log('支付成功:',res);\r\n\t\t\t\t\t\t// 成功状态\r\n\t\t\t\t\t\tthis.successEv(coding);\r\n\t\t\t\t\t\t// 清除缓存\r\n\t\t\t\t\t\tuni.removeStorageSync('addr_id');\r\n\t\t\t\t\t\t// 页面跳转\r\n\t\t\t\t\t\tuni.navigateTo({\r\n\t\t\t\t\t\t\turl:`/pages/cart/finish?id=${id}`\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t},\r\n\t\t\t\t\t'fail': (res)=> { // 接口调用失败的回调函数\r\n\t\t\t\t\t\tthis.$toolAll.tools.showToast('您已取消支付');\r\n\t\t\t\t\t\tsetTimeout(()=>{\r\n\t\t\t\t\t\t\t// 页面跳转\r\n\t\t\t\t\t\t\tuni.navigateTo({\r\n\t\t\t\t\t\t\t\turl:`/pagesA/order/order?index=1&backTag=backmy`\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t},1000)\r\n\t\t\t\t\t}\r\n\t\t\t\t })\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 成功状态\r\n\t\t\tsuccessEv(coding){\r\n\t\t\t\tthis.$requst.post('/api/order/paid',{order_coding:coding}).then(res=>{\r\n\t\t\t\t\tif(res.code==0) {\r\n\t\t\t\t\t\tconsole.log(res,'成功状态')\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.$toolAll.tools.showToast(res.msg);\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style>\r\n\t\r\n</style>\r\n"],"sourceRoot":""}