subject-preview.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957
  1. <template>
  2. <div style="background: #F3F4F8;">
  3. <div class="noticeInfo">
  4. <h2>缴费说明</h2>
  5. 1、为确保声部平衡,请家长确认 注册声部为孩子的最终录取声部。<br />
  6. 2、为保障每个声部人数达标,我们都进行了超员20%的录取,系统将按照提交注册的先后顺序安排名额。超员后 有可能出现无法注册的情况,请您理解。如果其他声部仍有名额,我们将优先调配您的孩子;
  7. </div>
  8. <div class="section">
  9. <h2 class="title">器乐练习系统</h2>
  10. <p style="font-size: 14px; padding: 2px 0; color: #a1a1a1" v-if="serviceValidDate">服务有效期:{{ serviceValidDate }}</p>
  11. <el-row class="title-row">
  12. <el-col :span="12">服务项目</el-col>
  13. <el-col :span="5" :offset="1" style="text-align: right;">原价</el-col>
  14. <el-col :span="5" :offset="1" style="text-align: right;">现价</el-col>
  15. </el-row>
  16. <!-- 所有不可选的课程合集 -->
  17. <template v-if="courseShowStatus">
  18. <el-row class="option-row" v-for="(item, index) in courseShowInfo" :class="[!item.isStudentOptional ? 'disabled' : '']" :key="index" @click.native="onCourseChange(item)">
  19. <el-col :span="12">
  20. <i class="check_default" :class="[item.isStatus ? 'check_active' : '']"></i>
  21. <span style="display: flex; align-items: center;">
  22. <template v-if="item.courseType == 'PROJECT'">{{ chargeTypeName }} </template><template v-else>{{ item.courseType | coursesType }}</template>
  23. </span>
  24. <el-icon v-if="item.courseType == 'PROJECT'" class="el-icon-question" @click.native="onQuestions" />
  25. </el-col>
  26. <el-col :span="6">
  27. <!-- <del style="color: #AAA; font-size: 12px;">¥{{ item.courseOriginalPrice | moneyFormat }}</del> -->
  28. </el-col>
  29. <el-col :span="6">
  30. <span style="color: #1A1A1A">¥{{ item.courseCurrentPrice | moneyFormat }}</span>
  31. </el-col>
  32. </el-row>
  33. </template>
  34. <!-- 可选课程信息集合 -->
  35. <template v-for="(item, index) in courseInfo">
  36. <el-row class="option-row" :class="[!item.isStudentOptional ? 'disabled' : '']" :key="index" @click.native="onCourseChange(item)" v-if="item.isStudentOptional">
  37. <el-col :span="12">
  38. <i class="check_default" :class="[item.isStatus ? 'check_active' : '']"></i><template v-if="item.courseType == 'PROJECT'">{{ item.name }}</template><template v-else>{{ item.courseType | coursesType }}</template>
  39. </el-col>
  40. <el-col :span="6">
  41. <del style="color: #AAA; font-size: 12px;">¥{{ item.courseOriginalPrice | moneyFormat }}</del>
  42. </el-col>
  43. <el-col :span="6">
  44. <span style="color: #1A1A1A">¥{{ item.courseCurrentPrice | moneyFormat }}</span>
  45. </el-col>
  46. </el-row>
  47. </template>
  48. <!-- <el-row class="option-row lines">
  49. <el-col :span="12" class="fontBold">
  50. 仅需支付
  51. </el-col>
  52. <el-col :span="6">
  53. <del style="color: #f85043; font-size: 12px;">¥{{ orderInfo.musicMarketClassFee | moneyFormat }}</del>
  54. </el-col>
  55. <el-col :span="6">
  56. <span class="fontBold" style="color: #f85043;">¥{{ orderInfo.musicClassFee | moneyFormat }}</span>
  57. </el-col>
  58. </el-row> -->
  59. </div>
  60. <div class="section" v-if="instrumentResult.length > 0">
  61. <h2 class="title">乐器</h2>
  62. <div v-for="(i, index) in instrumentResultList" :key="index">
  63. <el-row class="title-row">
  64. <el-col :span="12">
  65. <template v-if="i[0]['kitType'] == 'GROUP'">团购乐器</template>
  66. <template v-if="i[0]['kitType'] == 'LEASE'">乐器租赁</template>
  67. <template v-if="i[0]['kitType'] == 'FREE'">免费使用</template>
  68. <template v-if="i[0]['kitType'] == 'owned'">自备乐器</template>
  69. </el-col>
  70. <el-col :span="5" :offset="1" style="text-align: right;">
  71. <template v-if="['GROUP', 'LEASE', 'FREE'].includes(i[0]['kitType'])">原价</template>
  72. </el-col>
  73. <el-col :span="5" :offset="1" style="text-align: right;">
  74. <template v-if="['GROUP', 'FREE'].includes(i[0]['kitType'])">现价</template>
  75. <template v-if="i[0]['kitType'] == 'LEASE'">租赁押金</template>
  76. </el-col>
  77. </el-row>
  78. <el-row class="option-row" v-for="(con, index) in i" :key="index" @click.native="instrumentF(con)">
  79. <el-col :span="12">
  80. <i class="check_default" :class="[ con.checked ? 'check_active' : '' ]"></i>
  81. <div>
  82. {{ con.name }}
  83. <div v-if="con.goodsList" style="font-size: .12rem; color: #aaa">
  84. {{ con.goodsList[0].specification }}
  85. </div>
  86. </div>
  87. </el-col>
  88. <el-col :span="6">
  89. <del style="color: #AAA; font-size: 12px;" v-if="con.kitType != 'owned'">¥{{ con.marketPrice | moneyFormat }}</del>
  90. </el-col>
  91. <el-col :span="6">
  92. <span style="color: #1A1A1A" v-if="(con.kitType == 'LEASE')">¥{{ Number((con.depositFee - con.coupon).toFixed(2)) | moneyFormat }}</span>
  93. <span style="color: #1A1A1A" v-if="con.price && con.kitType == 'FREE'">¥{{ 0 | moneyFormat }}</span>
  94. <span style="color: #1A1A1A" v-if="con.price && con.kitType == 'GROUP'">¥{{ Number((con.price - con.coupon).toFixed(2)) | moneyFormat }}</span>
  95. </el-col>
  96. </el-row>
  97. </div>
  98. <!-- <el-row class="option-row lines">
  99. <el-col :span="12" class="fontBold">
  100. 仅需支付
  101. </el-col>
  102. <el-col :span="6">
  103. <del style="color: #f85043; font-size: 12px;">¥{{ orderInfo.goodsMarketPrice | moneyFormat }}</del>
  104. </el-col>
  105. <el-col :span="6">
  106. <span class="fontBold" style="color: #f85043;">¥{{ orderInfo.goodsPrice | moneyFormat }}</span>
  107. </el-col>
  108. </el-row> -->
  109. </div>
  110. <div class="section" v-if="accessOries.length > 0" key="accessOries">
  111. <h2 class="title">辅件</h2>
  112. <el-row class="title-row">
  113. <el-col :span="12">服务项目</el-col>
  114. <el-col :span="5" :offset="1" style="text-align: right;">原价</el-col>
  115. <el-col :span="5" :offset="1" style="text-align: right;">现价</el-col>
  116. </el-row>
  117. <el-row class="option-row" v-for="(instr, index) in accessOries" :key="index" @click.native="onAuxiliarie(instr)">
  118. <el-col :span="12">
  119. <i class="check_default" :class="[ instr.checked ? 'check_active' : '' ]"></i>{{ instr.name }}
  120. </el-col>
  121. <el-col :span="6">
  122. <del style="color: #AAA; font-size: 12px;">¥{{ instr.goodsList[0] ? instr.goodsList[0].marketPrice : 0 | moneyFormat }}</del>
  123. </el-col>
  124. <el-col :span="6">
  125. <span style="color: #1A1A1A" v-if="instr.price == 0">免费</span>
  126. <span style="color: #1A1A1A" v-else>¥{{ instr.price | moneyFormat }}</span>
  127. </el-col>
  128. </el-row>
  129. <!-- <el-row class="option-row lines">
  130. <el-col :span="12" class="fontBold">
  131. 仅需支付
  132. </el-col>
  133. <el-col :span="6">
  134. <del style="color: #f85043; font-size: 12px;">¥{{ orderInfo.accessMarketPrice | moneyFormat }}</del>
  135. </el-col>
  136. <el-col :span="6">
  137. <span class="fontBold" style="color: #f85043;">¥{{ orderInfo.accessPrice | moneyFormat }}</span>
  138. </el-col>
  139. </el-row> -->
  140. </div>
  141. <!-- 原价现价 -->
  142. <!-- <div class="section">
  143. <div class="needprice markerprice">
  144. <del>原价</del>
  145. <del>¥{{ orderInfo.marketPrice | moneyFormat }}</del>
  146. </div>
  147. <div class="needprice grouopprice">
  148. <span>仅需支付</span>
  149. <span>¥{{ orderInfo.amount | moneyFormat }}</span>
  150. </div>
  151. </div> -->
  152. <div class="buy">
  153. <div class="price">
  154. <!-- <p class="use_price">
  155. <img class="logo" src="@/assets/images/mycard.png" alt="">
  156. <span>¥{{ needPrice | moneyFormat }}</span>
  157. </p> -->
  158. <p class="oldprice">
  159. <del class="text">原价</del>
  160. <del style=" font-size: 13px;">¥{{ orderInfo.marketPrice | moneyFormat }}</del>
  161. </p>
  162. <p class="now_price">
  163. <span class="text">仅需支付</span>
  164. <span style="font-weight: bold">¥{{ needPrice | moneyFormat }}</span>
  165. </p>
  166. </div>
  167. <a class="btn-submit">购买</a>
  168. </div>
  169. </div>
  170. </template>
  171. <script>
  172. import { permission } from '@/utils/directivePage'
  173. import { getSubjectGoodsAndInfoPreview, getType } from '@/api/buildTeam'
  174. import dayjs from 'dayjs'
  175. const paymentPatternType = {
  176. 0: '按月',
  177. 1: '按学期',
  178. 2: '一次性'
  179. }
  180. export default {
  181. props: ["subjectId", "calenderId"],
  182. data() {
  183. const query = this.$route.query
  184. return {
  185. musicGroupId: query.id,
  186. result: {}, // 返回结果
  187. instrument: {}, // 乐器类型
  188. baseInfo: {}, // 其它类
  189. money: 580,
  190. balance: 0, // 余额
  191. needPrice: 0, // 还需支付
  192. payType: false, // 是否余额支付
  193. orderInfo: {
  194. marketPrice: 0,
  195. amount: 0, // 现价总金额
  196. groupPurchasePrice: 0, // 现价
  197. goodsGroupIds: null,
  198. goodsIds: null,
  199. contractGoodsIds: null, // 选中所有商品ID
  200. couponPrice: 0, //
  201. musicClassFee: 0, // 课程现价
  202. musicMarketClassFee: 0, // 课程原价
  203. accessPrice: 0, // 辅件现价
  204. accessMarketPrice: 0, // 辅件原价
  205. goodsPrice: 0, // 乐器现价
  206. goodsMarketPrice: 0, // 乐器原价
  207. }, // 金额列表,金额计算
  208. courseInfo: null, // 课程信息
  209. musicGroupSubject: null, // 基本信息
  210. instrumentResult: [], //乐器
  211. accessOries: [], // 辅件(打包)
  212. agreeStatus: true,
  213. authStatus: false,
  214. buyList: [], // 信息列表
  215. ids: [],
  216. chargeTypeId: null,
  217. paymentStatus: null,
  218. paymentPattern: null,
  219. serviceValidDate: null, // 服务时间
  220. courseShowStatus: false,
  221. chargeTypeList: [],
  222. chargeTypeName: null,
  223. };
  224. },
  225. mounted() {
  226. this.__init()
  227. },
  228. methods: {
  229. async __init() {
  230. // 获取数据
  231. let params = {
  232. musicGroupId: this.musicGroupId,
  233. subjectId: this.subjectId,
  234. calenderId: this.calenderId
  235. }
  236. await getType().then(res => {
  237. let result = res.data
  238. if(res.code == 200) {
  239. this.chargeTypeList = result.rows || []
  240. }
  241. })
  242. await getSubjectGoodsAndInfoPreview(params).then(res => {
  243. let result = res
  244. if (result.code == 200) {
  245. let tempResult = result.data
  246. this.paymentPattern = 2
  247. if(tempResult.musicGroupPaymentCalender) {
  248. this.paymentPattern = tempResult.musicGroupPaymentCalender.paymentPattern
  249. this.serviceValidDate = dayjs(tempResult.musicGroupPaymentCalender.paymentValidStartDate).format('YYYY/MM/DD') + '~' + dayjs(tempResult.musicGroupPaymentCalender.paymentValidEndDate).format('YYYY/MM/DD')
  250. }
  251. let tempInfo = tempResult.musicGroupPaymentCalender? tempResult.musicGroupPaymentCalender.musicGroupPaymentCalenderCourseSettingsList : null
  252. // 判断是否有课程
  253. if (tempInfo && tempInfo.length > 0) {
  254. let tempCourse = {
  255. courseCurrentPrice: 0,
  256. courseOriginalPrice: 0,
  257. courseType: null,
  258. name: '器乐练习系统'
  259. }
  260. tempInfo.forEach(info => {
  261. if(!info.isStudentOptional) {
  262. this.courseShowStatus = true
  263. tempCourse = {
  264. courseCurrentPrice: (info.courseCurrentPrice + tempCourse.courseCurrentPrice),
  265. courseOriginalPrice: (info.courseCurrentPrice + tempCourse.courseCurrentPrice),
  266. courseType: 'PROJECT',
  267. isStatus: true,
  268. name: '器乐练习系统'
  269. }
  270. }
  271. })
  272. this.courseShowInfo = [tempCourse]
  273. // 默认课程都选中
  274. this.courseInfo = tempInfo
  275. } else {
  276. // 判断是否有课程,如果没有课程则默认显示0
  277. this.courseInfo = [{
  278. id: -1,
  279. courseCurrentPrice: 0,
  280. courseOriginalPrice: 0,
  281. isStudentOptional: false,
  282. courseType: 'MUSIC'
  283. }]
  284. }
  285. this.courseInfo.forEach(item => {
  286. item.isStatus = true
  287. })
  288. this.musicGroupSubject = tempResult.musicGroupSubjectPlan
  289. let instrumentInfo = {}
  290. let tempInstrument = []
  291. tempResult.musicGroupSubjectGoodsGroupList.forEach((item) => {
  292. if (item.type == "INSTRUMENT") {
  293. // 获取乐器所有提供方式
  294. let KGPTJ = item.kitGroupPurchaseTypeJson ? JSON.parse(item.kitGroupPurchaseTypeJson) : {}
  295. for (let single in KGPTJ) {
  296. let tempItem = Object.assign({}, item) // 深拷贝
  297. tempItem.marketPrice = tempItem.goodsList[0].marketPrice
  298. tempItem.kitType = single // 优惠模式
  299. tempItem.coupon = KGPTJ[single] // 优惠金额
  300. if (instrumentInfo.id) {
  301. tempItem.checked = false
  302. if (single == 'GROUP') { // 团购
  303. if ((instrumentInfo.kitType == 'GROUP' && instrumentInfo.price < tempItem.price) || instrumentInfo.kitType ==
  304. 'LEASE' || instrumentInfo.kitType == 'FREE') {
  305. this.instrumentResult.forEach(instrRes => {
  306. instrRes.checked = false
  307. })
  308. tempItem.checked = true
  309. instrumentInfo = {
  310. id: tempItem.id,
  311. price: tempItem.price,
  312. kitType: single
  313. }
  314. }
  315. } else if (single == 'LEASE') { // 租赁
  316. if (instrumentInfo.kitType == 'LEASE' && instrumentInfo.price < tempItem.price) {
  317. this.instrumentResult.forEach(instrRes => {
  318. instrRes.checked = false
  319. })
  320. tempItem.checked = true
  321. instrumentInfo = {
  322. id: tempItem.id,
  323. price: tempItem.price,
  324. kitType: single
  325. }
  326. }
  327. } else if (single == 'FREE') { // 免费
  328. if (instrumentInfo.kitType == 'FREE' && instrumentInfo.price < tempItem.price) {
  329. this.instrumentResult.forEach(instrRes => {
  330. instrRes.checked = false
  331. })
  332. tempItem.checked = true
  333. instrumentInfo = {
  334. id: tempItem.id,
  335. price: tempItem.price,
  336. kitType: single
  337. }
  338. }
  339. }
  340. } else {
  341. tempItem.checked = true
  342. instrumentInfo = {
  343. id: tempItem.id,
  344. price: tempItem.price,
  345. kitType: single
  346. }
  347. }
  348. this.instrumentResult.push(tempItem)
  349. tempInstrument.push(tempItem)
  350. }
  351. } else if (item.type == "ACCESSORIES") {
  352. item.checked = true
  353. this.accessOries.push(item)
  354. }
  355. })
  356. // 添加自备选项
  357. if (this.instrumentResult.length > 0) {
  358. // this.instrumentResult.push({
  359. // id: -1,
  360. // kitType: 'owned',
  361. // name: '自备',
  362. // price: 0,
  363. // marketPrice: 0,
  364. // checked: false
  365. // })
  366. let owned = {
  367. id: -1,
  368. kitType: 'owned',
  369. name: '自备乐器',
  370. price: 0,
  371. marketPrice: 0,
  372. checked: false
  373. }
  374. tempInstrument.push(owned)
  375. this.instrumentResult.push(owned)
  376. let sorted = this.groupBy(tempInstrument, (item) => {
  377. return [item.kitType];
  378. });
  379. this.instrumentResultList = sorted
  380. this.chargeTypeList.forEach(item => {
  381. if(item.id == tempResult.musicGroup.chargeTypeId) {
  382. this.chargeTypeName = item.description
  383. }
  384. })
  385. }
  386. }
  387. // 初始化计算金额
  388. this.calcPrice()
  389. })
  390. },
  391. groupBy(array, f) {
  392. var groups = {};
  393. array.forEach(function (o) {
  394. var group = JSON.stringify(f(o));
  395. groups[group] = groups[group] || [];
  396. groups[group].push(o);
  397. });
  398. return Object.keys(groups).map(function (group) {
  399. return groups[group];
  400. });
  401. },
  402. onQuestions() {
  403. this.$alert(`<b>革命性的“AMR器乐练习系统 ”</b><br />世界上有没有一种能够轻松掌握器乐演奏技能的方法?答案就是“AMR器乐练习系统”,它的诞生是基于世界上最优秀的华人管乐指导专家-唐嘉宏先生的教育理念,创新开发的一种新型“音乐感官植入程序”,这个程序抛弃了传统的“数线式识谱、机械式节奏、死记式乐理”,它营造出沉浸式可变速演奏过程,采用画面与音乐刺激序列组合而成的特定场景,在趣味性挑战的反复刺激中逐步促进器乐演奏的三核心:“音质→音准→音型”,从而达成演奏各环节水准的均匀提高,产生永久性条件反射式大脑记忆,将多板块知识融会贯通,让抽象的音乐知识刻入脑海里!<br /><b>本练习系统的特点:</b><br /> 1.轻松快速掌握要点,让练习者沉浸其中,远离枯燥!<br /> 2.不假思索就能瞬间唤起反射式记忆,演奏识谱不再慢吞吞!<br /> 3.真正的实践记忆,摆脱纸上谈兵,与实际演奏紧密结合!<br />4.思维+肌肉的双重强化!无缝整合复习系统!<br /> 5.每条练习都经过严谨的编曲,你以为你只是在练习旋律线?其实是整个乐团在为你伴奏!`, 'AMR器乐练习系统', {
  404. confirmButtonText: '确定',
  405. dangerouslyUseHTMLString: true,
  406. callback: action => {
  407. }
  408. });
  409. },
  410. onCourseChange(item) {
  411. // 判断用户是否可以选择
  412. if (item.isStudentOptional) {
  413. item.isStatus = !item.isStatus
  414. this.calcPrice()
  415. }
  416. },
  417. onClickCheckbox() { //是否使用余额支付
  418. if (!this.payType) {
  419. if (this.orderInfo.amount >= this.balance) {
  420. this.needPrice = Number((this.orderInfo.amount - this.balance).toFixed(2))
  421. } else {
  422. this.needPrice = 0
  423. }
  424. } else {
  425. this.needPrice = this.orderInfo.amount
  426. }
  427. this.payType = !this.payType
  428. },
  429. onAuxiliarie(item) {
  430. // 辅件切换状态
  431. item.checked = !item.checked
  432. // 重新计算金额
  433. this.calcPrice()
  434. },
  435. instrumentF(item) {
  436. // 乐器切换状态
  437. this.instrumentResult.forEach(item => {
  438. item.checked = false
  439. })
  440. item.checked = true
  441. // 重新计算金额
  442. this.calcPrice()
  443. },
  444. calcPrice() {
  445. let buyList = [],
  446. ids = []
  447. let amount = 0,
  448. marketPrice = 0,
  449. goodsPrice = 0, // 乐器两现价
  450. goodsMarketPrice = 0, // 乐器原价
  451. goodsGroupIds = {},
  452. courseKeys = [],
  453. couponPrice = 0, // 优惠金额
  454. goodsIds = [],
  455. tempCourseFee = 0,
  456. musicClassFee = 0,
  457. musicMarketClassFee = 0,
  458. tempAccessPrice = 0,
  459. tempAccessMarketPrice = 0,
  460. tempGroupRemissionCourseFee = 0, // 乐团减免费用
  461. contractGoodsIds = '' // 合同所需要的商品Id (只需要乐器编号)
  462. // 课程
  463. let mgs = this.musicGroupSubject
  464. let csi = this.courseInfo
  465. // 加上判断是否有课程信息
  466. if (mgs) {
  467. let tempCourse = this.courseShowInfo
  468. if(tempCourse.length > 0) {
  469. let tempPrice = 0
  470. tempCourse.forEach(item => {
  471. // tempPrice += parseFloat(item.courseCurrentPrice)
  472. marketPrice += parseFloat(item.courseOriginalPrice)
  473. musicMarketClassFee += parseFloat(item.courseOriginalPrice)
  474. });
  475. }
  476. csi.forEach(item => {
  477. if (item.isStatus) {
  478. musicClassFee += parseFloat(item.courseCurrentPrice)
  479. // musicMarketClassFee += parseFloat(item.courseOriginalPrice)
  480. // marketPrice += parseFloat(item.courseOriginalPrice)
  481. if (item.id > 0) {
  482. courseKeys.push(item.id)
  483. }
  484. // 不可选的课程才会减免课程费用
  485. if(!item.isStudentOptional) {
  486. tempGroupRemissionCourseFee += parseFloat(item.courseCurrentPrice)
  487. } else {
  488. marketPrice += parseFloat(item.courseOriginalPrice)
  489. musicMarketClassFee += parseFloat(item.courseOriginalPrice)
  490. }
  491. }
  492. })
  493. }
  494. // 乐器
  495. let ir = this.instrumentResult
  496. if (ir.length > 0) {
  497. ir.forEach(item => {
  498. if (item.checked) {
  499. if (item.name != '自备') {
  500. contractGoodsIds += item.goodsIdList
  501. }
  502. if (item.kitType == 'FREE') {
  503. amount += 0
  504. couponPrice = 0 // 优惠金额
  505. } else if (item.kitType == 'LEASE') {
  506. couponPrice = item.coupon // 优惠金额
  507. if (item.name != '自备') {
  508. amount += item.depositFee
  509. goodsPrice += item.depositFee
  510. } else {
  511. amount += 0
  512. }
  513. } else {
  514. amount += parseFloat(item.price)
  515. goodsPrice += parseFloat(item.price)
  516. couponPrice = item.coupon ? item.coupon : 0
  517. }
  518. if (item.kitType == 'LEASE') {
  519. if (item.name != '自备') {
  520. marketPrice += item.depositFee
  521. goodsMarketPrice += item.depositFee
  522. }
  523. } else {
  524. marketPrice += parseFloat(item.marketPrice)
  525. goodsMarketPrice += parseFloat(item.marketPrice)
  526. }
  527. // item.id ? goodsGroupIds[item.id] : null
  528. if (item.id) {
  529. goodsGroupIds[item.id] = item.kitType
  530. }
  531. if (item.kitType == 'LEASE') {
  532. buyList.push({
  533. name: item.name,
  534. type: '租赁',
  535. price: item.depositFee
  536. })
  537. } else if (item.kitType == 'GROUP') {
  538. // && parseFloat(item.price - couponPrice) > 0
  539. buyList.push({
  540. name: item.name,
  541. type: '团购',
  542. price: parseFloat(item.price - couponPrice)
  543. })
  544. } else if(item.kitType == 'FREE') {
  545. buyList.push({
  546. name: item.name,
  547. type: '免费',
  548. price: 0
  549. })
  550. }
  551. // 是否减免课程费用,必须团购,并且开启了减免课程费用
  552. if(item.kitType == 'GROUP' && item.groupRemissionCourseFee == 1) {
  553. musicClassFee = parseFloat(musicClassFee - tempGroupRemissionCourseFee)
  554. }
  555. }
  556. })
  557. }
  558. amount += parseFloat(tempCourseFee + musicClassFee)
  559. // if (parseFloat(tempCourseFee + musicClassFee) > 0) {
  560. buyList.unshift({
  561. name: '乐团课',
  562. type: paymentPatternType[this.paymentPattern],
  563. price: Number((tempCourseFee + musicClassFee).toFixed(2))
  564. })
  565. // }
  566. // 辅件
  567. if (this.accessOries.length > 0) {
  568. this.accessOries.forEach(item => {
  569. if (item.checked) {
  570. tempAccessPrice += parseFloat(item.price)
  571. amount += parseFloat(item.price)
  572. if (item.goodsList && item.goodsList.length > 0) {
  573. item.goodsList.forEach(childGoods => {
  574. tempAccessMarketPrice += parseFloat(childGoods.marketPrice)
  575. marketPrice += parseFloat(childGoods.marketPrice)
  576. })
  577. }
  578. goodsGroupIds[item.id] = 'ACCESSORIES'
  579. buyList.push({
  580. name: item.name,
  581. type: '团购',
  582. price: item.price
  583. })
  584. }
  585. })
  586. // if (tempAccessPrice > 0) {
  587. // buyList.push({
  588. // name: '辅件',
  589. // type: '团购',
  590. // price: tempAccessPrice
  591. // })
  592. // }
  593. }
  594. let tempGroupPurchasePrice = amount
  595. // 判断减去优惠金额,是否大于0(这里有可能出现负数)
  596. if (amount - couponPrice >= 0) {
  597. amount = Number((amount - couponPrice).toFixed(2))
  598. this.errorPrice = false
  599. } else {
  600. amount = 0
  601. this.errorPrice = true // 订单金额是否异常
  602. }
  603. if (amount - tempCourseFee - musicClassFee > 0) {
  604. ids.push(1, 2)
  605. }
  606. if (parseFloat(tempCourseFee + musicClassFee) > 0) {
  607. ids.push(3, 4, 5)
  608. }
  609. this.ids = ids
  610. // 计算是否使用过余额
  611. if (this.payType) {
  612. let tempPrice = Number((amount - this.balance).toFixed(2))
  613. if (tempPrice > 0) {
  614. this.needPrice = tempPrice
  615. } else {
  616. this.needPrice = 0
  617. }
  618. } else {
  619. this.needPrice = Number(amount.toFixed(2))
  620. }
  621. this.buyList = buyList
  622. this.orderInfo = {
  623. amount: Number(amount.toFixed(2)),
  624. marketPrice: Number(marketPrice.toFixed(2)),
  625. groupPurchasePrice: tempGroupPurchasePrice,
  626. couponPrice: couponPrice,
  627. goodsGroupIds: goodsGroupIds,
  628. goodsIds: goodsIds.join(','),
  629. contractGoodsIds: contractGoodsIds,
  630. courseKeys: courseKeys,
  631. musicClassFee: musicClassFee,
  632. musicMarketClassFee: musicMarketClassFee,
  633. accessMarketPrice: tempAccessMarketPrice,
  634. accessPrice: tempAccessPrice,
  635. goodsPrice: goodsPrice,
  636. goodsMarketPrice: goodsMarketPrice
  637. }
  638. },
  639. permission(str){
  640. return permission(str)
  641. }
  642. },
  643. };
  644. </script>
  645. <style lang="less" scoped>
  646. .noticeInfo {
  647. line-height: 1.8;
  648. h2 {
  649. font-size: 18px;
  650. color: #1a1a1a;
  651. line-height: 28px;
  652. height: 26px !important;
  653. font-weight: bold;
  654. }
  655. position: relative;
  656. background: #fff;
  657. padding: 0 16px 10px;
  658. font-size: 14px;
  659. color: #808080;
  660. margin-bottom: 10px;
  661. }
  662. .section {
  663. padding: 16px 16px 10px;
  664. background: #fff;
  665. margin-bottom: 10px;
  666. >.title {
  667. font-size: 20px;
  668. line-height: 28px;
  669. height: 26px !important;
  670. font-weight: bold;
  671. &::before {
  672. content: " ";
  673. width: 4px;
  674. height: 15px;
  675. background: #14928a;
  676. display: inline-block;
  677. margin-right: 7px;
  678. border-radius: 8px;
  679. }
  680. }
  681. .indate {
  682. font-size: 14px;
  683. padding: 6px 0;
  684. display: flex;
  685. // justify-content: space-between;
  686. justify-content: flex-end;
  687. span {
  688. color: #fa101d;
  689. }
  690. }
  691. }
  692. .disabled {
  693. opacity: 0.7;
  694. .check_active {
  695. opacity: .5;
  696. }
  697. }
  698. .buy {
  699. height: 60px;
  700. display: flex;
  701. align-items: center;
  702. padding: 0 20px;
  703. border-top: 1px solid #ffe9e9e9;
  704. color: #000000;
  705. font-size: 12px;
  706. background: #fff;
  707. .price {
  708. flex: 1;
  709. font-size: 16px;
  710. }
  711. font-size: 16px;
  712. span {
  713. color: #fa101d;
  714. }
  715. .text {
  716. font-size: 12px;
  717. width: 60px;
  718. display: inline-block;
  719. color: #000;
  720. }
  721. del {
  722. color: #b5b5b5;
  723. &.text {
  724. color: #b5b5b5;
  725. }
  726. }
  727. .btn-submit {
  728. display: inline-block;
  729. font-size: 18px;
  730. color: #fff;
  731. background: #f85043;
  732. border-radius: 100px;
  733. box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.19);
  734. padding: 8px 46px;
  735. }
  736. }
  737. .iframe {
  738. width: 100%;
  739. height: 100%;
  740. -webkit-overflow-scrolling: touch;
  741. overflow-y: scroll;
  742. border-top: none !important;
  743. min-height: calc(100vh - 41px);
  744. }
  745. .countDownContent {
  746. line-height: 40px;
  747. text-align: center;
  748. font-size: 14px;
  749. border-bottom: 1px solid #ccc;
  750. .van-count-down {
  751. display: inline;
  752. color: #f00;
  753. }
  754. }
  755. .loadingOrder {
  756. width: 90%;
  757. height: 180px;
  758. display: flex;
  759. align-items: center;
  760. justify-content: center;
  761. .van-loading__text {
  762. color: #444;
  763. }
  764. }
  765. .pay-section {
  766. margin-bottom: 10px;
  767. padding: 10px 8px;
  768. }
  769. .pay-name {
  770. padding-left: 10px;
  771. flex: 1 auto;
  772. font-weight: bold;
  773. }
  774. .logo {
  775. width: 24px;
  776. height: 24px;
  777. }
  778. .van-checkbox {
  779. float: right;
  780. /deep/.van-checkbox__icon .van-icon {
  781. border-color: #e9eaef;
  782. background-color: #e9eaef;
  783. }
  784. /deep/.van-checkbox__icon--checked .van-icon {
  785. background-color: #2dc7aa;
  786. border-color: #2dc7aa;
  787. }
  788. }
  789. .needprice {
  790. display: flex;
  791. justify-content: space-between;
  792. padding: 2px 0;
  793. del {
  794. font-size: 14px;
  795. color: #aaa;
  796. font-weight: bold;
  797. }
  798. span {
  799. font-size: 18px;
  800. color: #f85043;
  801. font-weight: bold;
  802. }
  803. }
  804. .couponprice {
  805. display: flex;
  806. justify-content: space-between;
  807. }
  808. .use_price {
  809. display: flex;
  810. align-items: center;
  811. font-size: 14px;
  812. font-weight: bold;
  813. img {
  814. padding-right: 8px;
  815. }
  816. span {
  817. font-size: 16px;
  818. }
  819. }
  820. .check_default {
  821. margin-right: 8px;
  822. display: flex;
  823. align-items: center;
  824. height: 26px;
  825. &::before {
  826. display: block;
  827. content: ' ';
  828. width: 18px;
  829. height: 18px;
  830. background-color: #e9eaef;
  831. border-radius: 50%;
  832. }
  833. &.check_active {
  834. &::before {
  835. display: block;
  836. content: ' ';
  837. background: url("../../../assets/images/icon_checkbox.png") no-repeat center;
  838. background-size: contain;
  839. }
  840. }
  841. &.radio_active {
  842. &::before {
  843. display: block;
  844. content: ' ';
  845. background: url("../../../assets/images/icon_radio.png") no-repeat center;
  846. background-size: contain;
  847. }
  848. }
  849. }
  850. // .check_default {
  851. // margin-right: 8px;
  852. // display: block;
  853. // width: 18px;
  854. // height: 18px;
  855. // background-color: #e9eaef;
  856. // border-radius: 50%;
  857. // &.check_active {
  858. // background: url("../../../assets/images/icon_checkbox.png") no-repeat center;
  859. // background-size: contain;
  860. // }
  861. // }
  862. .title-row {
  863. background: #F3F4F8;
  864. color: #1a1a1a;
  865. padding:5px 5px 3px;
  866. border-radius:5px;
  867. font-size: 14px;
  868. }
  869. .option-row {
  870. line-height: 26px;
  871. font-size: 14px;
  872. display: flex;
  873. // align-items: center;
  874. position: relative;
  875. padding: 10px 0 5px;
  876. box-sizing: border-box;
  877. cursor: pointer;
  878. .el-col {
  879. display: flex;
  880. // align-items: center;
  881. }
  882. .el-col-6 {
  883. display: flex;
  884. justify-content: flex-end;
  885. }
  886. &.lines {
  887. margin-top: 5px;
  888. border-top: 1px solid #ededed;
  889. }
  890. }
  891. .el-icon-question {
  892. font-size: 16px;
  893. color: #4d4d4d;
  894. padding-left: 5px;
  895. padding-top: 5px;
  896. }
  897. .fontBold {
  898. font-weight: bold;
  899. }
  900. </style>