single_details.html 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342
  1. <!-- +---------------------------------------------------------------------- -->
  2. <!-- | CRMEB [ CRMEB赋能开发者,助力企业发展 ] -->
  3. <!-- +---------------------------------------------------------------------- -->
  4. <!-- | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved. -->
  5. <!-- +---------------------------------------------------------------------- -->
  6. <!-- | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 -->
  7. <!-- +---------------------------------------------------------------------- -->
  8. <!-- | Author: CRMEB Team <admin@crmeb.com> -->
  9. <!-- +---------------------------------------------------------------------- -->
  10. {extend name="public/container"}
  11. {block name="title"}{$title}{/block}
  12. {block name="head_top"}
  13. <link rel="stylesheet" href="{__PLUG_PATH}vue-photo-preview/skin.css">
  14. <script src="{__PLUG_PATH}vue-photo-preview/vue-photo-preview.js"></script>
  15. <style>
  16. body {
  17. padding-bottom: 1rem;
  18. padding-bottom: calc(1rem + constant(safe-area-inset-bottom));
  19. padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  20. background-color: #f5f5f5;
  21. }
  22. .validity {
  23. padding-left: 0.3rem;
  24. background: url("{__WAP_PATH}zsff/images/validity.png") center/cover no-repeat;
  25. font-size: .26rem;
  26. line-height: .8rem;
  27. color: #FF6B00;
  28. }
  29. a[href^="tel"] {
  30. color: #191C6E;
  31. }
  32. </style>
  33. {/block}
  34. {block name="content"}
  35. <div v-cloak id="app">
  36. <div class="single-special">
  37. <!-- 播放器 -->
  38. <div class="header" :style="{ height: playerHeight + 'px' }">
  39. <img :src="special.image" alt="封面">
  40. </div>
  41. <div v-if="special_validity == -1" class="validity">
  42. <template v-if="special.validity">课程有效期为{{ special.validity }}天,过期后需重新购买哦!</template>
  43. <template v-else>课程永久有效哦!</template>
  44. </div>
  45. <div v-else-if="special_validity == 0" class="validity">课程永久有效哦!</div>
  46. <div v-else-if="special_validity > 0" class="validity">课程有效期剩余{{ special_validity | formatValidity }},过期后需重新购买哦!</div>
  47. <div class="special-attr">
  48. <div class="title">{{ special.title }}</div>
  49. <div class="label">
  50. <div v-for="(item, index) in special.label" :key="index">{{ item }}</div>
  51. </div>
  52. <div class="money-button">
  53. <div class="money">
  54. <template v-if="special.pay_type">
  55. <div><span>¥</span>{{ special.money }}</div>
  56. <div>¥{{ special.member_money }}</div>
  57. </template>
  58. <div v-else>免费</div>
  59. </div>
  60. <button type="button" @click="createSharePoster">
  61. <i class="iconfont iconfenxiang"></i>
  62. <div>分享</div>
  63. </button>
  64. <button type="button" @click="collect">
  65. <i :class="['iconfont', special.collect ? 'iconshoucang2' : 'iconshoucang11']"></i>
  66. <div>{{ special.collect ? '已收藏' : '收藏' }}</div>
  67. </button>
  68. </div>
  69. </div>
  70. <!-- 群聊 -->
  71. <template v-if="special.service_code">
  72. <div class="group-chat">
  73. <div>和小伙伴一起学习,有老师答疑哦~</div>
  74. <button type="button" @click="groupChartShow = true">加入群聊</button>
  75. </div>
  76. </template>
  77. <!-- 学习人数、讲师 -->
  78. <div class="learner-teacher">
  79. <div v-if="record.length" class="learner">
  80. <div>
  81. <img v-for="(item, index) in record" :key="index" :src="item.avatar" alt="">
  82. </div>
  83. 已有{{ recordCoujnt }}人学习
  84. </div>
  85. <a v-if="lecturer" class="teacher" :href="'{:url('merchant/teacher_detail')}?id=' + special.lecturer_id">
  86. <div>
  87. <img :src="lecturer.lecturer_head" :alt="lecturer.lecturer_name">
  88. </div>
  89. <div>
  90. <div>{{ lecturer.lecturer_name }}</div>
  91. <div v-if="lecturer.label.length" class="label">
  92. <div v-for="(item, index) in lecturer.label" :key="index">{{ item }}</div>
  93. </div>
  94. </div>
  95. <i class="iconfont iconxiangyou"></i>
  96. </a>
  97. </div>
  98. <!-- 关联资料 -->
  99. <div v-if="specialDownload.length" class="material">
  100. <a v-for="item in specialDownload" :key="item.id" :href="'{:url('special/data_details')}?id=' + item.id">
  101. <div>
  102. <img :src="item.image" alt="">
  103. </div>
  104. <div>
  105. <div>{{ item.title }}</div>
  106. <div v-if="item.pay_type" class="money">¥<span>{{ item.money }}</span></div>
  107. <div v-else>免费</div>
  108. <div>
  109. <div>{{ item.ficti + item.sales }}人已下载</div>
  110. <button type="button">去下载</button>
  111. </div>
  112. </div>
  113. </a>
  114. </div>
  115. <!-- 拼团人数 -->
  116. <div v-if="special.is_pink" class="group-buy">
  117. <div v-if="specialGroupLists.length" class="marquee">
  118. <i class="iconfont iconshengyinyinliang"></i>
  119. <div>已拼{{ specialGroupLists.length }}件</div>
  120. <div class="swiper-container">
  121. <div class="swiper-wrapper">
  122. <div v-for="(item, index) in specialGroupLists" :key="index" class="swiper-slide">{{ item.nickname }}拼团成功</div>
  123. </div>
  124. </div>
  125. </div>
  126. <ul v-if="specialPinkLists.length">
  127. <li v-for="(item, index) in specialPinkLists" :key="index">
  128. <div>
  129. <img :src="item.avatar" alt="">
  130. </div>
  131. <div>{{ item.nickname }}</div>
  132. <div>
  133. <div>还差<span>{{ item.num }}人</span>成团</div>
  134. <div>剩余 {{ item.duration | format }}</div>
  135. </div>
  136. <button type="button" @click="goPink(item.id, item.uid)">去拼单</button>
  137. </li>
  138. </ul>
  139. </div>
  140. <!-- 拼团玩法 -->
  141. <div v-if="special.is_pink" class="group-way">
  142. <div>拼团玩法</div>
  143. <ul>
  144. <li>开团/参团</li>
  145. <li>邀请好友</li>
  146. <li>满员发货</li>
  147. </ul>
  148. </div>
  149. <!-- 导航 -->
  150. <ul class="tabbar">
  151. <li :class="{ on: tabActive === 1}" @click="tabActive = 1">详情</li>
  152. <li v-if="specialTest1.length" :class="{ on: tabActive === 2}" @click="tabActive = 2">练习</li>
  153. <li v-if="specialTest2.length" :class="{ on: tabActive === 3}" @click="tabActive = 3">考试</li>
  154. <li v-if="comment_switch" :class="{ on: tabActive === 4}" @click="tabActive = 4">评价({{ whole }})</li>
  155. </ul>
  156. <!-- 详情 -->
  157. <div v-show="tabActive === 1" class="detail" v-html="special.abstract"></div>
  158. <!-- 练习 -->
  159. <ul v-if="specialTest1.length" v-show="tabActive === 2" class="exercise">
  160. <li v-for="item in specialTest1" :key="item.id">
  161. <div class="title"><i v-if="!isPay" class="iconfont iconsuozi"></i>{{ item.title }}</div>
  162. <div class="group">
  163. <div class="progress">
  164. <div :style="{ width: item.rate + '%' }"></div>
  165. </div>
  166. <div>{{ item.rate }}%</div>
  167. <div>{{ item.answer }}人已答题</div>
  168. <button type="button" @click="goQuestion(item)"><i class="iconfont icon-19-lianxi"></i>练习</button>
  169. </div>
  170. </li>
  171. </ul>
  172. <!-- 考试 -->
  173. <ul v-if="specialTest2.length" v-show="tabActive === 3" class="question">
  174. <li v-for="item in specialTest2" :key="item.id">
  175. <div class="head">
  176. <div>
  177. <img :src="item.image" alt="">
  178. </div>
  179. <div>
  180. <div class="title">{{ item.title }}</div>
  181. <div class="group">
  182. <div>共{{ item.item_number }}题</div>
  183. <button v-if="isPay" type="button" @click="goQuestion(item)"><i class="iconfont icon-19-lianxi"></i>答题
  184. </button>
  185. <div v-else>
  186. <i class="iconfont iconsuozi"></i>
  187. </div>
  188. </div>
  189. </div>
  190. </div>
  191. </li>
  192. </ul>
  193. <!-- 评价 -->
  194. <div v-show="tabActive === 4" class="evaluate">
  195. <div>
  196. <div class="score">
  197. <div><span>{{ score }}</span>分</div>
  198. <div>课程评分</div>
  199. </div>
  200. <button type="button" @click="userEvaluate">我要评价</button>
  201. </div>
  202. <evaluate-list :evaluate-list="replyList"></evaluate-list>
  203. <div v-if="evaluateLoading" class="loading">
  204. <i class="fa fa-spinner fa-spin"></i>
  205. </div>
  206. <div v-if="evaluateFinished && replyList.length" class="finished">已全部加载完</div>
  207. <div v-if="evaluateFinished && !replyList.length" class="empty">
  208. <img src="{__WAP_PATH}zsff/images/empty.png" alt="暂无评价">
  209. <div>暂无评价</div>
  210. </div>
  211. </div>
  212. <!-- 底部按钮 -->
  213. <div class="footer">
  214. <button type="button" @click="goHome">
  215. <img src="{__WAP_PATH}zsff/images/special01.png" alt="首页">
  216. <div>首页</div>
  217. </button>
  218. <button type="button" @click="customerService">
  219. <img src="{__WAP_PATH}zsff/images/special02.png" alt="客服">
  220. <div>客服</div>
  221. </button>
  222. <button type="button" @click="buy(1)">
  223. <img src="{__WAP_PATH}zsff/images/special03.png" alt="送朋友">
  224. <div>送朋友</div>
  225. </button>
  226. <div>
  227. <button v-if="gift" type="button" @click="buy(4)">领取课程</button>
  228. <template v-else>
  229. <button v-if="isPay || (!special.member_pay_type && is_member)" type="button" @click="buy(5)">{{
  230. special.pay_type || special.member_pay_type ? '去学习' : '免费学习' }}
  231. </button>
  232. <template v-else>
  233. <button v-if="special.profile.is_try" @click="handleTry">试{{ special.light_type === 2 ? '听' : '看' }}</button>
  234. <template v-if="special.is_pink">
  235. <button v-if="isPink" type="button">查看拼团</button>
  236. <template>
  237. <button type="button" @click="buy(3)">
  238. ¥{{ special.pink_money }}
  239. <div>{{ special.pink_number }}人团</div>
  240. </button>
  241. <button type="button" @click="buy(2)">
  242. ¥{{ is_member ? special.member_money : special.money }}
  243. <div>单独购</div>
  244. </button>
  245. </template>
  246. </template>
  247. <button v-else type="button" @click="buy(2)">立即购买</button>
  248. </template>
  249. </template>
  250. </div>
  251. </div>
  252. <!-- 遮罩层 -->
  253. <div :class="{ mask: payDialogOpen || shareShow || groupChartShow || dialogShow || certificateImage }" @touchmove.prevent @click="maskClick">
  254. </div>
  255. <!-- 支付弹窗 -->
  256. <pay-dialog :open.sync="payDialogOpen" :money="money" :now_money="now_money" :special_id="special.id" :link_pay_uid="link_pay_uid" :pay_type_num="pay_type_num"
  257. :pink-id="pinkId" :is-wechat="isWechat" :is-alipay="is_alipay" :is-balance="is_yue" :template-id="templateIds" :wxpay-h5="wxpayH5" :is-member="is_member"
  258. :member-money="special.member_money" :member-link="memberLink" @change="changeVal">
  259. </pay-dialog>
  260. <!-- 分享海报 -->
  261. <img v-show="shareImage && shareShow" class="share-dialog" :src="shareImage" alt="">
  262. <!-- 加入群聊 -->
  263. <div v-show="groupChartShow" class="group-chart-dialog">
  264. <img :src="special.service_code" alt="">
  265. <div>
  266. <div>长按扫码</div>
  267. <div>加客服好友进群</div>
  268. </div>
  269. </div>
  270. <!-- 登录弹窗 -->
  271. <base-login :login-show="loginShow" :site-name="site_name" @login-close="loginClose"></base-login>
  272. <!-- 评价弹窗 -->
  273. <evaluate-dialog :dialog-show="dialogShow" :rate-value="rateValue" :image-list="imageList" @rate-change="rateChange" @image-upload="imageUpload" @image-delete="imageDelete"
  274. @evaluate-submit="evaluateSubmit"></evaluate-dialog>
  275. <!-- 兑换码 -->
  276. <exchange-guide v-if="isBatch && !isPay" :href="'{:url('special/exchange')}?special_id=' + special.id"></exchange-guide>
  277. <!-- 完课证书 -->
  278. <img :src="certificateImage" class="certificate-image" alt="">
  279. <!-- 弹幕 -->
  280. <div v-if="barrageList.length" class="barrage">
  281. <div>
  282. <img :src="barrageList[barrage_index].avatar" alt="">
  283. </div>
  284. <div>{{ barrageList[barrage_index].nickname }} {{ barrageList[barrage_index].status_name }}</div>
  285. </div>
  286. </div>
  287. <!-- 分享返佣 -->
  288. <rebate-guide v-if="rebateMoney" :rebate-money="rebateMoney" @rebate-action="rebateAction"></rebate-guide>
  289. </div>
  290. {/block}
  291. {block name="foot"}
  292. <script>
  293. window.overallShare = false;
  294. require([
  295. 'vue',
  296. 'axios',
  297. 'helper',
  298. 'store',
  299. 'swiper',
  300. 'components/pay-dialog/index',
  301. 'moment',
  302. 'components/evaluate-list/index',
  303. 'components/evaluate-dialog/index',
  304. 'components/exchange-guide/index',
  305. 'components/base-login/index',
  306. 'components/rebate-guide/index',
  307. 'aliplayer',
  308. 'qrcode',
  309. 'layer'
  310. ], function (Vue, axios, $h, store, Swiper, PayDialog, moment, EvaluateList, EvaluateDialog, ExchangeGuide, BaseLogin, RebateGuide) {
  311. var special = {$special};
  312. var site_url = "{$site_url}";
  313. var site_name = "{$Auth_site_name}";
  314. var now_money = {$now_money};
  315. var link_pay_uid = {$link_pay_uid};
  316. var pinkId = {$pinkId};
  317. var isWechat = {$isWechat? 'true': 'false'};
  318. var is_alipay = {$is_alipay? 'true': 'false'};
  319. var is_yue = {$is_yue? 'true': 'false'};
  320. var wxpayH5 = {$is_h5_wechat_payment_switch? 'true': 'false'};
  321. var isPay = {$isPay? 'true': 'false'};
  322. var is_member = {$is_member};
  323. var orderId = '{$orderId ? $orderId : ""}';
  324. var gift = {$gift};
  325. var isBatch = {$isBatch? 'true': 'false'};
  326. var uid = {$userInfo['uid']? $userInfo['uid'] : 0};
  327. var isPink = {$isPink? 'true': 'false'};
  328. var BarrageShowTime = {$BarrageShowTime? $BarrageShowTime: 5};
  329. var barrage_index = {$barrage_index? $barrage_index: 0};
  330. var callback_url = '{$callback_url}';
  331. var options = {
  332. captionEl: false,
  333. fullscreenEl: false,
  334. zoomEl: false,
  335. arrowEl: false
  336. };
  337. var comment_switch = {$comment_switch};
  338. var memberLink = "{:url('special/member_recharge')}";
  339. Vue.use(vuePhotoPreview, options);
  340. new Vue({
  341. el: '#app',
  342. components: {
  343. 'pay-dialog': PayDialog,
  344. 'evaluate-list': EvaluateList,
  345. 'evaluate-dialog': EvaluateDialog,
  346. 'exchange-guide': ExchangeGuide,
  347. 'base-login': BaseLogin,
  348. 'rebate-guide': RebateGuide
  349. },
  350. filters: {
  351. format: function (time, sibling) {
  352. var duration = moment.duration(time * 1000);
  353. var hours = duration.hours();
  354. var siblingHours = sibling ? moment.duration(sibling * 1000).hours() : 0;
  355. return moment({
  356. h: hours,
  357. m: duration.minutes(),
  358. s: duration.seconds()
  359. }).format((hours || siblingHours ? 'HH:' : '') + 'mm:ss');
  360. },
  361. formatValidity: function (time) {
  362. var duration = moment.duration(Number(time), 'seconds');
  363. var days = Math.floor(duration.asDays());
  364. var hours = duration.hours();
  365. var minutes = duration.minutes();
  366. return (days ? days + '天' : '') + (hours ? hours + '小时' : '') + minutes + '分钟';
  367. }
  368. },
  369. data: {
  370. special: special,
  371. site_url: site_url,
  372. site_name: site_name,
  373. isPay: isPay,
  374. is_member: is_member,
  375. gift: gift,
  376. isBatch: isBatch,
  377. uid: uid,
  378. isPink: isPink,
  379. barrageShowTime: BarrageShowTime,
  380. barrage_index: barrage_index,
  381. barrageList: [],
  382. record: [], // 学习人员
  383. recordCoujnt: '', // 学习人数
  384. lecturer: null,
  385. specialGroupLists: [], // 拼团信息
  386. specialPinkLists: [], // 拼团人员
  387. tabActive: 1,
  388. specialTest1: [], // 关联练习
  389. specialTest2: [], // 关联考试
  390. evaluatePage: 1,
  391. evaluateLimit: 16,
  392. replyList: [], // 评价列表
  393. payDialogOpen: false, // 是否显示支付弹窗
  394. money: 0,
  395. now_money: now_money,
  396. link_pay_uid: 0,
  397. pay_type_num: -1,
  398. pinkId: pinkId,
  399. isWechat: isWechat,
  400. is_alipay: is_alipay,
  401. is_yue: is_yue,
  402. templateIds: '', // 订阅模板id
  403. wxpayH5: wxpayH5,
  404. shareImage: '',
  405. shareShow: false,
  406. groupChartShow: false,
  407. loginShow: false,
  408. url: isWechat ? $h.U({c: 'index', a: 'login'}) : $h.U({c: 'login', a: 'phone_check'}),
  409. score: 0,
  410. whole: 0,
  411. dialogShow: false,
  412. rateValue: 5,
  413. imageList: [],
  414. orderId: orderId,
  415. evaluateLoading: false,
  416. evaluateFinished: false,
  417. playerHeight: 0,
  418. currentTime: 0,
  419. duration: 0,
  420. paused: true,
  421. certificateImage: '',
  422. specialDownload: [], // 关联资料
  423. isLogin: false, // 是否登录
  424. comment_switch: comment_switch,
  425. special_validity: -1,
  426. tryShow: true,
  427. seeked: false,
  428. rebateMoney: 0,
  429. memberLink: memberLink
  430. },
  431. computed: {
  432. range: function () {
  433. return Math.ceil(this.currentTime / this.duration * 100);
  434. }
  435. },
  436. watch: {
  437. paused: function (paused) {
  438. paused ? this.player.pause() : this.player.play();
  439. }
  440. },
  441. created: function () {
  442. var vm = this;
  443. this.playerHeight = Math.floor(window.innerWidth * 9 / 16);
  444. this.learningRecords();
  445. this.lecturerDetails();
  446. this.addLearningRecords();
  447. this.specialDataDownload();
  448. this.specialTestPaper(1);
  449. this.specialTestPaper(2);
  450. this.inspect();
  451. this.rebateAmount();
  452. if (this.special.is_pink) {
  453. this.groupLists();
  454. this.pinkIngLists();
  455. this.getBarrageList();
  456. }
  457. if (comment_switch) {
  458. this.specialReplyData();
  459. this.specialReplyList();
  460. }
  461. if (this.isWechat) {
  462. this.getTemplateIds();
  463. mapleWx($jssdk(), function () {
  464. this.onMenuShareAll({
  465. title: vm.special.title,
  466. desc: vm.special.title,
  467. imgUrl: vm.special.image,
  468. link: location.href + (location.search ? '&' : '?') + 'spread_uid=' + uid,
  469. });
  470. });
  471. }
  472. store.baseGet($h.U({
  473. c: 'special',
  474. a: 'special_validity',
  475. q: {
  476. id: this.special.id
  477. }
  478. }), function (res) {
  479. vm.special_validity = res.data.data.validity;
  480. }, false, true);
  481. },
  482. mounted: function () {
  483. var vm = this;
  484. this.$nextTick(function () {
  485. $h.EventUtil.listenTouchDirection(document, function () {
  486. if (vm.tabActive === 4) {
  487. vm.specialReplyList();
  488. }
  489. });
  490. });
  491. },
  492. methods: {
  493. goTry: function () {
  494. window.location.assign("{:url('special/single_text_detail')}?try=1&id=" + this.special.id);
  495. },
  496. // 学习人数
  497. learningRecords: function () {
  498. var vm = this;
  499. $h.loadFFF();
  500. store.baseGet($h.U({
  501. c: 'special',
  502. a: 'learningRecords',
  503. q: {
  504. id: this.special.id
  505. }
  506. }), function (res) {
  507. var data = res.data.data;
  508. $h.loadClear();
  509. vm.record = data.record;
  510. vm.recordCoujnt = data.recordCoujnt;
  511. }, function () {
  512. $h.loadClear();
  513. });
  514. },
  515. // 讲师信息
  516. lecturerDetails: function () {
  517. var vm = this;
  518. $h.loadFFF();
  519. store.baseGet($h.U({
  520. c: 'auth_api',
  521. a: 'getLecturer',
  522. q: {
  523. mer_id: this.special.mer_id
  524. }
  525. }), function (res) {
  526. $h.loadClear();
  527. vm.lecturer = res.data.data;
  528. }, function () {
  529. $h.loadClear();
  530. });
  531. },
  532. // 拼团消息
  533. groupLists: function () {
  534. var vm = this;
  535. $h.loadFFF();
  536. store.baseGet($h.U({
  537. c: 'special',
  538. a: 'groupLists',
  539. q: {
  540. special_id: this.special.id
  541. }
  542. }), function (res) {
  543. $h.loadClear();
  544. vm.specialGroupLists = res.data.data;
  545. vm.$nextTick(function () {
  546. new Swiper('.swiper-container', {
  547. direction: 'vertical',
  548. autoplay: true,
  549. loop: true
  550. });
  551. });
  552. }, function () {
  553. $h.loadClear();
  554. });
  555. },
  556. // 拼团列表
  557. pinkIngLists: function () {
  558. var vm = this;
  559. $h.loadFFF();
  560. store.baseGet($h.U({
  561. c: 'special',
  562. a: 'pinkIngLists',
  563. q: {
  564. id: this.special.id,
  565. pinkId: 0
  566. }
  567. }), function (res) {
  568. var data = res.data.data;
  569. $h.loadClear();
  570. data.forEach(function (item) {
  571. item.duration = 0;
  572. item.stop_time = item.stop_time * 1000;
  573. });
  574. vm.specialPinkLists = data;
  575. }, function () {
  576. $h.loadClear();
  577. });
  578. },
  579. // 练习、考试
  580. specialTestPaper: function (type) {
  581. var vm = this;
  582. $h.loadFFF();
  583. store.basePost($h.U({
  584. c: 'topic',
  585. a: 'specialTestPaper'
  586. }), {
  587. special_id: this.special.id,
  588. type: type
  589. }, function (res) {
  590. var data = res.data.data;
  591. $h.loadClear();
  592. if (type === 1) {
  593. data.forEach(function (item) {
  594. item.rate = Math.floor(item.done / item.item_number * 100);
  595. });
  596. }
  597. vm['specialTest' + type] = data;
  598. }, function () {
  599. $h.loadClear();
  600. });
  601. },
  602. // 评价状态
  603. specialReplyData: function () {
  604. var vm = this;
  605. $h.loadFFF();
  606. store.baseGet($h.U({
  607. c: 'special',
  608. a: 'special_reply_data',
  609. q: {
  610. special_id: this.special.id
  611. }
  612. }), function (res) {
  613. var data = res.data.data;
  614. $h.loadClear();
  615. vm.score = data.score;
  616. vm.whole = data.whole;
  617. }, function () {
  618. $h.loadClear();
  619. });
  620. },
  621. // 评价列表
  622. specialReplyList: function () {
  623. var vm = this;
  624. if (this.evaluateLoading || this.evaluateFinished) {
  625. return;
  626. }
  627. this.evaluateLoading = true;
  628. $h.loadFFF();
  629. store.baseGet($h.U({
  630. c: 'special',
  631. a: 'special_reply_list',
  632. q: {
  633. special_id: this.special.id,
  634. page: this.evaluatePage++,
  635. limit: this.evaluateLimit
  636. }
  637. }), function (res) {
  638. var data = res.data.data;
  639. vm.evaluateLoading = false;
  640. $h.loadClear();
  641. vm.replyList = vm.replyList.concat(data);
  642. vm.evaluateFinished = vm.evaluateLimit > data.length;
  643. }, function () {
  644. vm.evaluateLoading = false;
  645. $h.loadClear();
  646. });
  647. },
  648. // 生成分享海报
  649. createSharePoster: function () {
  650. var vm = this;
  651. if (this.shareImage) {
  652. return this.shareShow = true;
  653. }
  654. Promise.all([
  655. new Promise(function (resolve, reject) {
  656. var image = new Image();
  657. image.crossOrigin = 'anonymous';
  658. image.src = vm.special.poster_image + '?' + new Date().getTime();
  659. image.onload = function () {
  660. resolve(image);
  661. };
  662. image.onerror = function () {
  663. reject('error-image');
  664. };
  665. }),
  666. new Promise(function (resolve, reject) {
  667. resolve(new QRCode(document.createElement('canvas'), vm.site_url));
  668. })
  669. ]).then(function (sources) {
  670. var canvas = document.createElement('canvas');
  671. var context = canvas.getContext('2d');
  672. canvas.width = 600;
  673. canvas.height = 960;
  674. context.fillStyle = '#FFFFFF';
  675. context.fillRect(0, 0, canvas.width, canvas.height);
  676. context.drawImage(sources[0], 0, 0, 600, 740);
  677. context.drawImage(sources[1]._el.firstElementChild, 108, 775, 150, 150);
  678. context.font = '22px sans-serif';
  679. context.fillStyle = '#999999';
  680. context.textBaseline = 'top';
  681. var text = '邀您加入' + site_name;
  682. var list = [];
  683. var start = 0;
  684. for (var i = 0; i <= text.length; i++) {
  685. if (context.measureText(text.slice(start, i)).width > 198) {
  686. list.push(text.slice(start, i - 1));
  687. start = i - 1;
  688. }
  689. }
  690. if (start !== text.length) {
  691. list.push(text.slice(start));
  692. }
  693. if (list.length > 3) {
  694. list.length = 3;
  695. for (var j = 0; j <= list[2].length; j++) {
  696. if (context.measureText(list[2].slice(0, j) + '……').width > 198) {
  697. list[2] = list[2].slice(0, j - 1) + '……';
  698. break;
  699. }
  700. }
  701. }
  702. list.push('长按识别或扫码进入');
  703. for (var k = 0; k < list.length; k++) {
  704. context.fillText(list[k], 294, 775 + (150 / list.length) * k);
  705. }
  706. vm.shareImage = canvas.toDataURL('image/jpeg');
  707. vm.shareShow = true;
  708. canvas = null;
  709. }).catch(function (error) {
  710. $h.pushMsg(error);
  711. });
  712. },
  713. // 收藏、取消收藏
  714. collect: function () {
  715. var vm = this;
  716. $h.loadFFF();
  717. store.baseGet($h.U({
  718. c: 'index',
  719. a: 'user_login'
  720. }), function (res) {
  721. $h.loadClear();
  722. store.baseGet($h.U({
  723. c: 'special',
  724. a: 'collect',
  725. q: {
  726. id: vm.special.id
  727. }
  728. }), function () {
  729. vm.special.collect = !vm.special.collect;
  730. $h.pushMsg(vm.special.collect ? '收藏成功' : '取消收藏成功');
  731. });
  732. }, function () {
  733. $h.loadClear();
  734. vm.loginShow = false;
  735. });
  736. },
  737. changeVal: function (opt) {
  738. if (typeof opt !== 'object') {
  739. opt = {};
  740. }
  741. var action = opt.action || '';
  742. var value = opt.value || '';
  743. this[action] && this[action](value);
  744. },
  745. // 点击遮罩层
  746. maskClick: function () {
  747. this.shareShow = false;
  748. this.groupChartShow = false;
  749. this.dialogShow = false;
  750. this.certificateImage = '';
  751. },
  752. // 关闭登录
  753. loginClose: function (value) {
  754. this.loginShow = false;
  755. value && this.logComplete();
  756. },
  757. // 登录完成回调事件
  758. logComplete: function () {
  759. var vm = this;
  760. this.isLogin = true;
  761. store.baseGet($h.U({
  762. c: 'special',
  763. a: 'isMember'
  764. }), function (res) {
  765. var data = res.data.data;
  766. vm.is_member = data.is_member;
  767. vm.now_money = data.now_money;
  768. });
  769. store.baseGet($h.U({
  770. c: 'special',
  771. a: 'special_validity',
  772. q: {
  773. id: special.id
  774. }
  775. }), function (res) {
  776. vm.special_validity = res.data.data.validity;
  777. }, false, true);
  778. },
  779. // 立即购买
  780. buy: function (type) {
  781. var vm = this;
  782. this.pay_type_num = type;
  783. store.baseGet($h.U({c: 'index', a: 'user_login'}), function (res) {
  784. switch (type) {
  785. case 1:
  786. if (!this.special.pay_type) {
  787. return $h.pushMsg('免费的不可以赠送哦');
  788. }
  789. if (this.is_member && !this.special.member_pay_type) {
  790. return $h.pushMsg('会员价免费的不可以赠送哦');
  791. }
  792. this.money = this.special.money;
  793. this.payDialogOpen = true;
  794. break;
  795. case 2:
  796. vm.money = vm.is_member ? vm.special.member_money : vm.special.money;
  797. vm.payDialogOpen = true;
  798. break;
  799. case 3:
  800. this.money = this.special.pink_money;
  801. this.payDialogOpen = true;
  802. break;
  803. case 4:
  804. $h.loadFFF();
  805. store.baseGet($h.U({
  806. c: 'special',
  807. a: 'receive_gift',
  808. q: {
  809. orderId: this.orderId
  810. }
  811. }), function (res) {
  812. $h.loadClear();
  813. $h.pushMsg(res.data.msg, function () {
  814. window.location.assign("{:url('special/grade_list')}");
  815. });
  816. }, function () {
  817. $h.loadClear();
  818. });
  819. break;
  820. case 5:
  821. if (vm.special.light_type === 1) {
  822. window.location.assign("{:url('special/single_text_detail')}?try=0&id=" + vm.special.id);
  823. } else {
  824. window.location.assign("{:url('special/single_con_detail')}?try=0&id=" + vm.special.id);
  825. }
  826. break;
  827. default:
  828. break;
  829. }
  830. }.bind(this), function () {
  831. vm.loginShow = true;
  832. });
  833. },
  834. // 支付方式回调
  835. pay_order: function (data) {
  836. this.orderId = data.data.result.orderId || '';
  837. switch (data.data.status) {
  838. case "PAY_ERROR":
  839. case 'ORDER_EXIST':
  840. case 'ORDER_ERROR':
  841. this.extendOrder(data.msg);
  842. break;
  843. case 'WECHAT_PAY':
  844. this.wechatPay(data.data.result.jsConfig);
  845. break;
  846. case 'WECHAT_H5_PAY':
  847. this.payDialogOpen = false;
  848. var callbackUrl = callback_url + '?type=7&id=' + this.special.id;
  849. var mwebUrl = data.data.result.jsConfig.mweb_url + '&redirect_url=' + encodeURIComponent(callbackUrl);
  850. window.location.assign(mwebUrl);
  851. break;
  852. case 'SUCCESS':
  853. this.successOrder(data.msg);
  854. break;
  855. case 'ZHIFUBAO_PAY':
  856. window.location.assign($h.U({
  857. c: 'alipay',
  858. a: 'index',
  859. q: {
  860. info: data.data.result,
  861. params: 'special'
  862. }
  863. }));
  864. break;
  865. }
  866. },
  867. // 微信支付
  868. wechatPay: function (config) {
  869. var vm = this;
  870. mapleWx($jssdk(), function () {
  871. this.chooseWXPay(config, function () {
  872. vm.successOrder();
  873. }, {
  874. fail: vm.extendOrder,
  875. cancel: vm.extendOrder
  876. });
  877. });
  878. },
  879. // 支付成功
  880. successOrder: function (msg) {
  881. var that = this;
  882. $h.showMsg({
  883. title: msg || '支付成功',
  884. icon: 'success',
  885. success: function () {
  886. switch (that.pay_type_num) {
  887. case 1:
  888. window.location.assign($h.U({
  889. c: 'special',
  890. a: 'gift_special',
  891. q: {
  892. orderId: that.orderId
  893. }
  894. }));
  895. break;
  896. case 2:
  897. that.isPay = true;
  898. that.payDialogOpen = false;
  899. break;
  900. case 3:
  901. window.location.assign($h.U({
  902. c: 'special',
  903. a: 'pink',
  904. q: {
  905. orderId: that.orderId
  906. }
  907. }));
  908. break;
  909. }
  910. }
  911. });
  912. store.baseGet($h.U({
  913. c: 'special',
  914. a: 'special_validity',
  915. q: {
  916. id: special.id
  917. }
  918. }), function (res) {
  919. that.special_validity = res.data.data.validity;
  920. }, function () {
  921. }, true);
  922. },
  923. updateMaterialStatus: function () {
  924. var that = this;
  925. that.otherLoading = false;
  926. that.otherLoaded = false;
  927. that.where.page = 1;
  928. that.$set(that, 'otherTaskList', []);
  929. that.getCourseList();
  930. },
  931. // 支付未完成
  932. extendOrder: function (msg) {
  933. var that = this;
  934. if (typeof msg === 'object') {
  935. if (msg.errMsg === 'chooseWXPay:cancel') {
  936. msg = '微信支付取消';
  937. } else {
  938. msg = '支付失败';
  939. }
  940. } else {
  941. msg = '支付失败';
  942. }
  943. $h.pushMsg(msg, function () {
  944. that.payDialogOpen = false;
  945. if (that.orderId) {
  946. store.baseGet($h.U({
  947. c: 'special',
  948. a: 'del_order',
  949. q: {
  950. orderId: that.orderId
  951. }
  952. }));
  953. }
  954. });
  955. },
  956. // 评分
  957. rateChange: function (value) {
  958. this.rateValue = value;
  959. },
  960. // 上传图片
  961. imageUpload: function (file) {
  962. var formData = new FormData();
  963. formData.append('file', file);
  964. axios.post("{:url('auth_api/upload')}", formData).then(function (res) {
  965. var resData = res.data;
  966. if (resData.code === 200) {
  967. this.imageList.push(resData.data.url);
  968. } else {
  969. layer.msg(resData.msg);
  970. }
  971. }.bind(this)).catch(function (err) {
  972. });
  973. },
  974. // 删除图片
  975. imageDelete: function (index) {
  976. this.imageList.splice(index, 1);
  977. },
  978. // 提交评价
  979. evaluateSubmit: function (text) {
  980. var vm = this;
  981. $h.loadFFF();
  982. store.basePost($h.U({
  983. c: 'special',
  984. a: 'user_comment_special',
  985. q: {
  986. special_id: this.special.id
  987. }
  988. }), {
  989. satisfied_score: this.rateValue,
  990. comment: text.trim(),
  991. pics: this.imageList
  992. }, function (res) {
  993. $h.loadClear();
  994. $h.pushMsg(res.data.msg, function () {
  995. vm.dialogShow = false;
  996. vm.specialReplyData();
  997. vm.evaluateFinished = false;
  998. vm.evaluatePage = 1;
  999. vm.replyList = [];
  1000. vm.specialReplyList();
  1001. });
  1002. }, function () {
  1003. $h.loadClear();
  1004. vm.dialogShow = false;
  1005. });
  1006. },
  1007. // 我要评价
  1008. userEvaluate: function () {
  1009. store.baseGet($h.U({c: 'index', a: 'user_login'}), function (res) {
  1010. if (!this.isPay) {
  1011. return $h.pushMsg('购买学习后既可进行评价');
  1012. }
  1013. this.dialogShow = true;
  1014. }.bind(this), function () {
  1015. $h.pushMsg('请先登录')
  1016. });
  1017. },
  1018. // 去练习、答题
  1019. goQuestion: function (question) {
  1020. var vm = this;
  1021. store.baseGet($h.U({
  1022. c: 'index',
  1023. a: 'user_login'
  1024. }), function () {
  1025. if (question.is_pay || vm.isPay) {
  1026. window.location.assign((question.type === 1 ? "{:url('topic/problem_index')}" : "{:url('special/question_index')}") + '?id=' + question.id);
  1027. } else {
  1028. vm.payDialogOpen = true;
  1029. }
  1030. }, function () {
  1031. vm.loginShow = true;
  1032. });
  1033. },
  1034. // 客服
  1035. customerService: function () {
  1036. store.baseGet($h.U({
  1037. c: 'public_api',
  1038. a: 'public_data'
  1039. }), function (res) {
  1040. var data = res.data.data;
  1041. if (data.customer_service === '3') {
  1042. if (data.site_service_phone) {
  1043. layer.confirm('是否拨打 <a href="tel:' + data.site_service_phone + '">' + data.site_service_phone + '</a> 进行咨询?', {
  1044. title: false,
  1045. closeBtn: false,
  1046. btn: ['拨打', '取消']
  1047. }, function (index) {
  1048. window.location.assign('tel:' + data.site_service_phone);
  1049. layer.close(index);
  1050. });
  1051. } else {
  1052. layer.msg('抱歉,无法联系客服');
  1053. }
  1054. } else {
  1055. window.location.assign($h.U({
  1056. c: 'service',
  1057. a: 'service_list'
  1058. }));
  1059. }
  1060. });
  1061. },
  1062. // 首页
  1063. goHome: function () {
  1064. window.location.assign("{:url('index/index')}");
  1065. },
  1066. // 订阅通知模板id
  1067. getTemplateIds: function () {
  1068. var vm = this;
  1069. $h.loadFFF();
  1070. store.baseGet($h.U({
  1071. c: 'special',
  1072. a: 'getTemplateIds',
  1073. q: {
  1074. pay_type_num: this.pay_type_num,
  1075. special_id: this.special.id
  1076. }
  1077. }), function (res) {
  1078. $h.loadClear();
  1079. vm.templateIds = res.data.msg;
  1080. }, function () {
  1081. $h.loadClear();
  1082. });
  1083. },
  1084. // 记录浏览人数
  1085. addLearningRecords: function () {
  1086. store.baseGet($h.U({
  1087. c: 'special',
  1088. a: 'addLearningRecords',
  1089. q: {
  1090. id: this.special.id
  1091. }
  1092. }));
  1093. },
  1094. // 去拼团
  1095. goPink: function (id, uid) {
  1096. if (uid === this.uid && this.isPink) {
  1097. window.location.href = "{:url('special/pink')}?is_help=0&special_id=" + this.special.id + '&pink_id=' + this.pinkId;
  1098. } else {
  1099. window.location.href = "{:url('special/pink')}?is_help=1&special_id=" + this.special.id + '&pink_id=' + (id ? id : this.pinkId);
  1100. }
  1101. },
  1102. // 播放记忆
  1103. viewing: function (currentTime) {
  1104. store.basePost($h.U({
  1105. c: 'special',
  1106. a: 'viewing'
  1107. }), {
  1108. special_id: this.special.id,
  1109. task_id: 0,
  1110. total: this.duration * 1e3,
  1111. viewing_time: currentTime * 1e3,
  1112. percentage: Math.floor(currentTime / this.duration * 100)
  1113. }, false, false, true);
  1114. },
  1115. // 发放证书
  1116. inspect: function () {
  1117. var vm = this;
  1118. $h.loadFFF();
  1119. store.baseGet($h.U({
  1120. c: 'special',
  1121. a: 'inspect',
  1122. q: {
  1123. special_id: this.special.id,
  1124. is_light: 1
  1125. }
  1126. }), function (res) {
  1127. $h.loadClear();
  1128. layer.confirm('恭喜您达到发放证书要求,是否领取?', {
  1129. title: false,
  1130. closeBtn: 0,
  1131. btn: ['领取', '取消']
  1132. }, function (index) {
  1133. vm.getTheCertificate();
  1134. layer.close(index);
  1135. });
  1136. }, function () {
  1137. $h.loadClear();
  1138. }, true);
  1139. },
  1140. // 领取证书
  1141. getTheCertificate: function () {
  1142. var vm = this;
  1143. $h.loadFFF();
  1144. store.baseGet($h.U({
  1145. c: 'special',
  1146. a: 'getTheCertificate',
  1147. q: {
  1148. special_id: this.special.id
  1149. }
  1150. }), function (res) {
  1151. $h.loadClear();
  1152. $h.pushMsg('领取成功<br>证书制作中……', function () {
  1153. vm.viewCertificate(res.data.msg);
  1154. });
  1155. }, function () {
  1156. $h.loadClear();
  1157. });
  1158. },
  1159. // 证书信息
  1160. viewCertificate: function (id) {
  1161. var vm = this;
  1162. $h.loadFFF();
  1163. store.baseGet($h.U({
  1164. c: 'topic',
  1165. a: 'viewCertificate',
  1166. q: {
  1167. id: id,
  1168. obtain: 1
  1169. }
  1170. }), function (res) {
  1171. $h.loadClear();
  1172. vm.createCertificate(res.data.data);
  1173. }, function () {
  1174. $h.loadClear();
  1175. });
  1176. },
  1177. // 加载图片
  1178. loadImage: function (path) {
  1179. return new Promise(function (resolve, reject) {
  1180. var image = new Image();
  1181. image.crossOrigin = 'anonymous';
  1182. image.src = path + '?' + new Date().getTime();
  1183. image.onload = function () {
  1184. resolve(image);
  1185. };
  1186. image.onerror = function () {
  1187. reject('error-image');
  1188. };
  1189. });
  1190. },
  1191. // 制作证书
  1192. createCertificate: function (certificate) {
  1193. var vm = this;
  1194. $h.loadFFF();
  1195. Promise.all([
  1196. this.loadImage(certificate.certificate.background),
  1197. this.loadImage(certificate.certificate.qr_code)
  1198. ]).then(function (images) {
  1199. var canvas = document.createElement('canvas');
  1200. var context = canvas.getContext('2d');
  1201. canvas.width = images[0].width;
  1202. canvas.height = images[0].height;
  1203. context.drawImage(images[0], 0, 0);
  1204. context.drawImage(images[1], 220, 557, 160, 160);
  1205. context.fillStyle = 'rgba(255, 255, 255, 1)';
  1206. context.fillRect(220, 724, 160, 36);
  1207. context.font = '20px sans-serif';
  1208. context.textAlign = 'center';
  1209. context.fillStyle = '#666666';
  1210. context.fillText('长按二维码查看', 300, 748);
  1211. context.font = 'bold 34px sans-serif';
  1212. context.fillStyle = '#29466D';
  1213. context.fillText(certificate.nickname, 300, 296);
  1214. context.font = '24px sans-serif';
  1215. context.fillText('颁发时间:' + moment(certificate.add_time * 1000).format('YYYY.MM.DD'), 300, 481);
  1216. context.font = '28px sans-serif';
  1217. context.textAlign = 'start';
  1218. context.fillStyle = '#333333';
  1219. for (var i = Math.ceil(certificate.certificate.explain.length % 16); i--;) {
  1220. context.fillText(certificate.certificate.explain.substr(i * 16, 16), 83, i * 40 + 370);
  1221. }
  1222. vm.certificateImage = canvas.toDataURL('image/jpeg');
  1223. canvas = null;
  1224. }).catch(function (err) {
  1225. });
  1226. },
  1227. // 弹幕
  1228. getBarrageList: function () {
  1229. var vm = this;
  1230. $h.loadFFF();
  1231. store.baseGet($h.U({
  1232. c: 'special',
  1233. a: 'get_barrage_list',
  1234. q: {
  1235. special_id: this.special.id
  1236. }
  1237. }), function (res) {
  1238. var barrageLen = 0;
  1239. $h.loadClear();
  1240. vm.barrageList = res.data.data;
  1241. barrageLen = vm.barrageList.length;
  1242. if (!barrageLen) {
  1243. return;
  1244. }
  1245. setInterval(function () {
  1246. vm.barrage_index++;
  1247. if (vm.barrage_index >= barrageLen) {
  1248. vm.barrage_index = 0
  1249. }
  1250. store.baseGet($h.U({
  1251. c: 'special',
  1252. a: 'set_barrage_index',
  1253. q: {
  1254. index: vm.barrage_index
  1255. }
  1256. }));
  1257. }, vm.barrageShowTime * 1000);
  1258. }, function () {
  1259. $h.loadClear();
  1260. });
  1261. },
  1262. // 关联资料
  1263. specialDataDownload: function () {
  1264. var vm = this;
  1265. $h.loadFFF();
  1266. store.baseGet($h.U({
  1267. c: 'special',
  1268. a: 'SpecialDataDownload',
  1269. q: {
  1270. special_id: this.special.id
  1271. }
  1272. }), function (res) {
  1273. $h.loadClear();
  1274. vm.specialDownload = res.data.data;
  1275. }, function () {
  1276. $h.loadClear();
  1277. });
  1278. },
  1279. // 获取返佣金额
  1280. rebateAmount: function () {
  1281. var vm = this;
  1282. store.baseGet($h.U({
  1283. c: 'auth_api',
  1284. a: 'rebateAmount',
  1285. p: {
  1286. id: this.special.id
  1287. }
  1288. }), function (res) {
  1289. vm.rebateMoney = parseFloat(res.data.data.brokeragePrice);
  1290. });
  1291. },
  1292. rebateAction: function (value) {
  1293. switch (value) {
  1294. case 'close':
  1295. this.rebateMoney = 0;
  1296. break;
  1297. case 'share':
  1298. this.createSharePoster();
  1299. break;
  1300. }
  1301. },
  1302. handleTry: function () {
  1303. var vm = this;
  1304. store.baseGet($h.U({
  1305. c: 'index',
  1306. a: 'user_login'
  1307. }), function () {
  1308. if (vm.special.light_type === 1) {
  1309. window.location.assign("{:url('special/single_text_detail')}?try=1&id=" + vm.special.id);
  1310. } else {
  1311. window.location.assign("{:url('special/single_con_detail')}?try=1&id=" + vm.special.id);
  1312. }
  1313. }, function () {
  1314. vm.loginShow = true;
  1315. });
  1316. }
  1317. }
  1318. });
  1319. });
  1320. </script>
  1321. {/block}