123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <template>
- <van-overlay z-index="10" :show="show">
- <div class="skills-box">
- <div class="skills">
- <div class="title">官方解释</div>
- <div class="text">{{ explainJs }}</div>
- <div class="btn">
- <span
- @click="
- () => {
- $emit('close');
- }
- "
- >
- 关闭
- </span>
- <span
- @click="
- () => {
- playExplainjsmp3();
- }
- "
- >
- 语音重播
- </span>
- </div>
- </div>
- </div>
- </van-overlay>
- </template>
- <script>
- import utils from "@/utils/index";
- export default {
- data() {
- return {};
- },
- methods: {
- playExplainjsmp3() {
- let audio = utils.wxUtils.getGlobAudio();
- audio.stop();
- audio.src = this.explainjsmp3;
- audio.onCanplay(() => {
- console.log("onCanplay");
- });
- audio.onPlay(() => {
- console.log("onPlay");
- });
- audio.onError((res) => {
- console.log(res);
- });
- //体验比较好
- setTimeout(() => {
- audio.play();
- }, 1000);
- },
- },
- watch: {
- show(newValue, oldValue) {
- let audio = utils.wxUtils.getGlobAudio();
- if (newValue) {
- audio.src = this.explainjsmp3;
- audio.play();
- } else {
- audio.stop();
- }
- },
- },
- props: {
- show: {
- type: Boolean,
- default: false,
- },
- explainJs: {
- type: String,
- default: "",
- },
- explainjsmp3: {
- type: String,
- default: "",
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .skills-box {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 100%;
- .skills {
- width: 290px;
- background: #ffffff;
- box-shadow: 0px 0px 8px rgba(124, 129, 136, 0.16);
- border-radius: 10px;
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 20px 16px;
- box-sizing: border-box;
- .title {
- font-size: 15px;
- font-family: PingFang SC;
- font-weight: bold;
- line-height: 21px;
- color: #0a1a33;
- }
- .img {
- width: 258px;
- height: 129px;
- border: 1px solid #e8e8e8;
- margin-top: 16px;
- }
- .divider {
- margin-top: 20px;
- color: #0a1a33;
- background: #ffffff;
- }
- .text {
- font-size: 13px;
- font-family: PingFang SC;
- font-weight: 400;
- line-height: 19px;
- color: #5c6066;
- margin-top: 10px;
- }
- .btn {
- width: 100%;
- display: flex;
- justify-content: space-between;
- padding: 0 40px;
- box-sizing: border-box;
- margin-top: 20px;
- span {
- width: 76px;
- height: 30px;
- border-radius: 15px;
- font-size: 13px;
- display: flex;
- justify-content: center;
- align-items: center;
- &:active {
- background-color: #afaaaa;
- filter: brightness(50%);
- }
- &:nth-of-type(1) {
- border: 1px solid #707070;
- color: #5c6066;
- }
- &:nth-of-type(2) {
- background: #498ef5;
- border: 1px solid #498ef5;
- color: #ffffff;
- }
- }
- }
- }
- }
- </style>
|