MRefund.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. <template>
  2. <div class="mRefund">
  3. <m-header :backUrl="backUrlProtocol" name="退费规则" />
  4. <div class="importTip" v-if="idss.length > 0 && tenantId == 1">
  5. <h3 class="title">重要须知</h3>
  6. <p
  7. v-for="(id, index) in idss"
  8. :key="id"
  9. v-html="++index + '、' + importText[id]"
  10. ></p>
  11. </div>
  12. <div class="course">
  13. <h3 class="title">您本次购买的产品及服务信息如下:</h3>
  14. <div class="service">
  15. <van-row class="title">
  16. <van-col span="9" offset="1">名称</van-col>
  17. <van-col span="6" offset="1">类型</van-col>
  18. <van-col span="6" offset="1">价格</van-col>
  19. </van-row>
  20. <van-row class="value" v-for="(item, index) in buyList" :key="index">
  21. <van-col span="9" offset="1">{{ item.name }}</van-col>
  22. <van-col span="6" offset="1">{{ item.type }}</van-col>
  23. <van-col span="6" offset="1" style="color: #f85043"
  24. >¥{{ moneyFormat(item.price) }}</van-col
  25. >
  26. </van-row>
  27. <!-- <van-row class="title allMoney">
  28. <van-col span="9" offset="1">订单总金额</van-col>
  29. <van-col span="6" offset="1"></van-col>
  30. <van-col span="6" offset="1" style="color: #f85043"
  31. >¥{{ moneyFormat(allPrice) }}</van-col
  32. >
  33. </van-row> -->
  34. </div>
  35. <div class="money">
  36. <div class="service">
  37. <van-row class="allMoney value">
  38. <van-col span="9" offset="1">订单总金额</van-col>
  39. <van-col span="6" offset="1"></van-col>
  40. <van-col span="6" offset="1" style="color: #f85043"
  41. >¥{{ moneyFormat(allPrice) }}</van-col
  42. >
  43. </van-row>
  44. <van-row class="allMoney value" v-if="balancePrice > 0">
  45. <van-col span="9" offset="1">余额支付</van-col>
  46. <van-col span="6" offset="1"></van-col>
  47. <van-col span="6" offset="1" style="color: #f85043"
  48. >¥{{ -moneyFormat(balancePrice) }}</van-col
  49. >
  50. </van-row>
  51. </div>
  52. </div>
  53. </div>
  54. <Mcoupon
  55. class="Mcoupon"
  56. ref="Mcoupon"
  57. :showCoupon="true"
  58. :showBalance="balance > 0"
  59. :balance="balance"
  60. @onClickCheckbox="onClickCheckbox"
  61. :payType="payType"
  62. :buyList="buyList"
  63. @setCoupon="setCoupon"
  64. />
  65. <div class="buyWall"></div>
  66. <div class="buy">
  67. <div class="price">
  68. <!-- <p class="oldprice">
  69. <del class="text">原价</del>
  70. <del style="font-size: 0.14rem"
  71. >¥{{ marketPrice | moneyFormat }}</del
  72. >
  73. </p> -->
  74. <p class="now_price">
  75. <span class="text">仅需支付</span>
  76. <span style="font-weight: bold">¥{{ showPrice | moneyFormat }}</span>
  77. </p>
  78. </div>
  79. <a class="btn-submit" @click="onPopupSure" v-if="!btnName">{{
  80. orderNo ? "支付" : "购买"
  81. }}</a>
  82. <a v-else class="btn-submit" @click="onPopupSure">{{ btnName }}</a>
  83. </div>
  84. <!-- <div class="course" v-if="disCountList.length > 0">
  85. <h3 class="title">优惠信息</h3>
  86. <div class="service">
  87. <van-row class="title">
  88. <van-col span="9" offset="1">名称</van-col>
  89. <van-col span="6" offset="1">类型</van-col>
  90. <van-col span="6" offset="1">价格</van-col>
  91. </van-row>
  92. <div class="value" v-for="(item, index) in disCountList" :key="index">
  93. <van-row>
  94. <van-col span="9" offset="1" v-html="item.name"></van-col>
  95. <van-col span="6" offset="1">{{ item.type }}</van-col>
  96. <van-col span="6" offset="1" style="color: #f85043"
  97. >¥{{ moneyFormat(item.price) }}</van-col
  98. >
  99. </van-row>
  100. <van-row v-if="item.time">
  101. <van-col
  102. offset="1"
  103. style="padding-top: 0.05rem; font-size: 0.12rem; color: #808080"
  104. >
  105. {{ item.time }}
  106. </van-col>
  107. </van-row>
  108. <van-row v-if="item.childGoodsName">
  109. <van-col offset="1" style="padding-top: 0.05rem">
  110. <span
  111. v-for="(child, index) in item.childGoodsName"
  112. :key="child.id"
  113. style="font-size: 0.12rem; color: #808080"
  114. >{{ child }}
  115. {{ item.childGoodsName.length - 1 == index ? "" : "、" }}</span
  116. >
  117. </van-col>
  118. </van-row>
  119. </div>
  120. <van-row class="title allMoney">
  121. <van-col span="9" offset="1">优惠总金额</van-col>
  122. <van-col span="6" offset="1"></van-col>
  123. <van-col span="6" offset="1" style="color: #f85043"
  124. >¥{{ moneyFormat(disCountPrice) }}</van-col
  125. >
  126. </van-row>
  127. </div>
  128. </div> -->
  129. <!-- <div class="course" v-if="moneyList.length > 0">
  130. <h3 class="title">支付信息</h3>
  131. <div class="service">
  132. <van-row class="title">
  133. <van-col span="15" offset="1">支付方式</van-col>
  134. <van-col span="6" offset="1">价格</van-col>
  135. </van-row>
  136. <div class="value" v-for="(item, index) in moneyList" :key="index">
  137. <van-row>
  138. <van-col span="15" offset="1" v-html="item.name"></van-col>
  139. <van-col span="6" offset="1" style="color: #f85043"
  140. >¥{{ moneyFormat(item.price) }}</van-col
  141. >
  142. </van-row>
  143. <van-row v-if="item.time">
  144. <van-col
  145. offset="1"
  146. style="padding-top: 0.05rem; font-size: 0.12rem; color: #808080"
  147. >
  148. {{ item.time }}
  149. </van-col>
  150. </van-row>
  151. <van-row v-if="item.childGoodsName">
  152. <van-col offset="1" style="padding-top: 0.05rem">
  153. <span
  154. v-for="(child, index) in item.childGoodsName"
  155. :key="child.id"
  156. style="font-size: 0.12rem; color: #808080"
  157. >{{ child }}
  158. {{ item.childGoodsName.length - 1 == index ? "" : "、" }}</span
  159. >
  160. </van-col>
  161. </van-row>
  162. </div>
  163. </div>
  164. </div> -->
  165. <!-- <div style="padding: 0 0.15rem">
  166. <van-button class="protocol-btn" @click="onPopupSure" type="info"
  167. >确认</van-button
  168. >
  169. </div> -->
  170. </div>
  171. </template>
  172. <script>
  173. import Mcoupon from "@/components/Mcoupon.vue";
  174. import MHeader from "@/components/header";
  175. import { browser } from "@/common/util";
  176. import numeral from "numeral";
  177. export default {
  178. name: "mRefund",
  179. components: { MHeader, Mcoupon },
  180. props: {
  181. ids: {
  182. type: Array,
  183. default() {
  184. return [1, 2, 3, 4, 5, 6];
  185. },
  186. },
  187. buyList: {
  188. type: Array,
  189. },
  190. disCountList: {
  191. type: Array,
  192. },
  193. moneyList: {
  194. type: Array,
  195. default() {
  196. return [];
  197. },
  198. },
  199. orderNo: {
  200. type: Number || String,
  201. default() {
  202. return 0;
  203. },
  204. },
  205. balance: [Number, String],
  206. btnName: {
  207. type: Boolean || String,
  208. default() {
  209. return false;
  210. },
  211. },
  212. },
  213. data() {
  214. let that = this;
  215. return {
  216. headerStatus: false,
  217. importText: {
  218. 1: "乐器、教辅、配件等,未经签收,自购买缴款之日起15日内可申请退款,超过上述期限则不予受理退费申请;非因商品本身存在质量问题,一经签收,无论使用与否,均不予退费;",
  219. 2: "乐保服务,在维修老师下校检查前可申请退款,下校检查日过后则不予退费;",
  220. 3: "AMR器乐练习系统服务,自购买缴款之日起15日内可申请退款,超过上述期限或实际已提供相应服务则一律不予受理退费;",
  221. 4: "正价购买的个别课程,包括但不限于VIP课程项下一对一、网管课等,课程有效期内可申请退费,可退款金额为:购买金额-课时原价*已消耗课时数量;",
  222. 5: "活动期间以优惠价格购买的个别课程,自购买缴款之日起15日内可申请退款,超过上述期限或实际已发生课时消耗的则一律不予受理退费;",
  223. 6: "所有退款均按照退款金额的千分之五收取手续费;",
  224. },
  225. // protocolHTML: null,
  226. backUrlProtocol: {
  227. callBack() {
  228. that.callBack();
  229. },
  230. },
  231. payType: false,
  232. payCountMoney: 0,
  233. valuePirce: 0,
  234. couponIdList: [],
  235. tenantId: null,
  236. };
  237. },
  238. mounted() {
  239. if (!browser().android && !browser().iPhone) {
  240. this.headerStatus = true;
  241. }
  242. if (this.ids.indexOf(6) == -1) {
  243. this.ids.push(6);
  244. }
  245. this.tenantId = sessionStorage.getItem("tenantId");
  246. },
  247. methods: {
  248. onPopupSure() {
  249. // 协议确定
  250. let obj = {
  251. pageShowPrice: this.pageShowPrice,
  252. amount: this.needPrice,
  253. payType: this.payType,
  254. couponIdList: this.couponIdList,
  255. };
  256. this.$emit("onPopupSure", obj);
  257. },
  258. callBack() {
  259. this.$emit("onClose");
  260. },
  261. moneyFormat(value) {
  262. return numeral(value).format("0.00");
  263. },
  264. setCoupon(obj) {
  265. this.$emit("setCoupon", obj);
  266. // console.log(obj, "setCoupon");
  267. this.valuePirce = obj.valuePirce;
  268. this.couponIdList = obj.couponList;
  269. },
  270. onClickCheckbox() {
  271. this.payType = !this.payType;
  272. },
  273. },
  274. computed: {
  275. allPrice() {
  276. let allMoney = 0;
  277. this.buyList.forEach((item) => {
  278. allMoney += Number(item.price);
  279. });
  280. return allMoney;
  281. },
  282. disCountPrice() {
  283. let disCountMoney = 0;
  284. this.disCountList.forEach((item) => {
  285. disCountMoney += Number(item.price);
  286. });
  287. return disCountMoney;
  288. },
  289. idss() {
  290. if (this.ids.indexOf(6) == -1) {
  291. // eslint-disable-next-line vue/no-side-effects-in-computed-properties
  292. this.ids.push(6);
  293. }
  294. return this.ids;
  295. },
  296. needPrice() {
  297. // allPrice - 余额 -优惠券
  298. // let amount = 0;
  299. // if (this.payType) {
  300. // if (this.allPrice - this.valuePirce >= this.balance) {
  301. // amount = Number(
  302. // (this.allPrice - this.valuePirce).toFixed(2)
  303. // );
  304. // } else {
  305. // amount = 0;
  306. // }
  307. // // 使用余额
  308. // } else {
  309. // // 不使用余额
  310. // amount = this.allPrice - this.valuePirce;
  311. // }
  312. return Number((this.allPrice - this.valuePirce).toFixed(2));
  313. },
  314. balancePrice() {
  315. let balance = 0;
  316. if (this.payType) {
  317. if (this.allPrice - this.valuePirce >= this.balance) {
  318. balance = this.balance;
  319. } else {
  320. balance = Number(this.allPrice - this.valuePirce);
  321. }
  322. }
  323. return Number(balance);
  324. },
  325. pageShowPrice() {
  326. // allPrice - 余额 -优惠券
  327. let amount = 0;
  328. if (this.payType) {
  329. if (this.allPrice - this.valuePirce >= this.balance) {
  330. amount = Number(
  331. (this.allPrice - this.valuePirce - this.balance).toFixed(2)
  332. );
  333. } else {
  334. amount = 0;
  335. }
  336. // 使用余额
  337. } else {
  338. // 不使用余额
  339. amount = this.allPrice - this.valuePirce;
  340. }
  341. return Number(amount);
  342. },
  343. showPrice() {
  344. // allPrice - 余额 -优惠券
  345. let amount = 0;
  346. if (this.payType) {
  347. if (this.allPrice - this.valuePirce >= this.balance) {
  348. amount = Number(
  349. (this.allPrice - this.valuePirce - this.balance).toFixed(2)
  350. );
  351. } else {
  352. amount = 0;
  353. }
  354. // 使用余额
  355. } else {
  356. // 不使用余额
  357. amount = this.allPrice - this.valuePirce;
  358. }
  359. return Number(amount).toFixed(2);
  360. },
  361. },
  362. };
  363. </script>
  364. <style lang="less" scoped>
  365. .mRefund {
  366. background-color: #f3f4f8;
  367. min-height: 100vh;
  368. overflow: hidden;
  369. }
  370. .refund-btn {
  371. margin: 0.15rem 0 0.35rem;
  372. background: #01c1b5;
  373. color: #fff;
  374. font-size: 0.18rem;
  375. text-align: center;
  376. width: 100%;
  377. }
  378. .importTip,
  379. .course {
  380. background: #ffffff;
  381. border-radius: 0.08rem;
  382. margin: 0.15rem;
  383. padding: 0.15rem;
  384. overflow: hidden;
  385. h3 {
  386. font-size: 0.14rem;
  387. font-weight: 400;
  388. padding-bottom: 0.05rem;
  389. &.title {
  390. font-size: 0.16rem;
  391. line-height: 0.28rem;
  392. font-weight: bold;
  393. padding-bottom: 0.05rem;
  394. &::before {
  395. content: " ";
  396. width: 0.04rem;
  397. height: 0.15rem;
  398. background: #01c1b5;
  399. display: inline-block;
  400. margin-right: 0.07rem;
  401. border-radius: 8px;
  402. position: relative;
  403. top: 0.01rem;
  404. }
  405. }
  406. }
  407. p {
  408. font-size: 0.13rem;
  409. line-height: 1.8;
  410. color: #808080;
  411. }
  412. }
  413. .service {
  414. font-size: 0.13rem;
  415. .title {
  416. padding: 0.05rem 0;
  417. background: #f1f1f1;
  418. color: #959595;
  419. }
  420. .value {
  421. padding: 0.1rem 0;
  422. border-bottom: 1px solid #f1f1f1;
  423. }
  424. }
  425. .allMoney.title {
  426. // margin-top: .1rem;
  427. font-weight: bold;
  428. color: #000;
  429. }
  430. .buyWall {
  431. height: 0.55rem;
  432. }
  433. .buy {
  434. position: fixed;
  435. bottom: 0;
  436. left: 0;
  437. right: 0;
  438. height: 0.55rem;
  439. display: flex;
  440. align-items: center;
  441. padding: 0 0.2rem;
  442. border-top: 1px solid #f0f0f0;
  443. color: #000000;
  444. font-size: 0.12rem;
  445. background: #fff;
  446. .price {
  447. flex: 1;
  448. font-size: 0.16rem;
  449. }
  450. font-size: 0.16rem;
  451. span {
  452. color: #f5222d;
  453. }
  454. .text {
  455. font-size: 0.14rem;
  456. width: 0.6rem;
  457. display: inline-block;
  458. color: #000;
  459. }
  460. del {
  461. color: #b5b5b5;
  462. &.text {
  463. color: #b5b5b5;
  464. }
  465. }
  466. .btn-submit {
  467. display: inline-block;
  468. font-size: 0.18rem;
  469. color: #fff;
  470. background: #01c1b5;
  471. border-radius: 1rem;
  472. // box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.19);
  473. padding: 0.08rem 0.36rem;
  474. }
  475. }
  476. .pay-section {
  477. margin: 0 0.15rem 0.1rem;
  478. }
  479. /deep/.pay-name {
  480. padding-left: 0.1rem;
  481. width: 70% !important;
  482. font-weight: bold;
  483. font-size: 0.14rem !important;
  484. }
  485. </style>