123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- <template>
- <div class="page">
- <div class="page-top flex flex-col justify-center items-center">
- <!-- <img class="logo" :src="supplierInfo.logo" /> -->
- <div class="name mt-2" v-text="supplierInfo.shopName + '意见反馈'"></div>
- </div>
- <div class="page-content p-4 md:my-4">
- <textarea
- class="control p-2"
- placeholder="请在此处输入您的宝贵意见(限200字)"
- v-model="content"
- ></textarea>
- <div class="submit mt-6" @click="onSubmit">提交</div>
- </div>
- <van-dialog v-model="showModal" class="dialog" @confirm="onConfirm">
- <div class="dialog-content">
- <div class="image-icon"></div>
- <div class="title">提价成功</div>
- <div class="tip">您的反馈信息已提交,感谢您的宝贵意见。</div>
- <div class="line" />
- </div>
- </van-dialog>
- </div>
- </template>
- <script>
- import { mapGetters } from 'vuex'
- export default {
- layout: 'app',
- data() {
- return {
- content: '',
- showModal: false,
- }
- },
- computed: {
- ...mapGetters(['supplierInfo', 'userInfo', 'routePrefix']),
- isEmpty() {
- return this.content.length === 0
- },
- },
- methods: {
- async onSubmit() {
- const { clubUserId } = this.userInfo
- if (this.isEmpty) {
- this.$toast('留言不能为空')
- return
- }
- try {
- await this.$http.api.feedback({ clubUserId, content: this.content })
- this.showModal = true
- this.content = ''
- } catch (error) {
- console.log(error)
- }
- },
- onConfirm() {
- this.showModal = false
- this.$router.push(this.routePrefix)
- },
- },
- }
- </script>
- <style scoped lang="scss">
- // pc 端
- @media screen and (min-width: 768px) {
- .page-top {
- height: 360px;
- @include themify($themes) {
- background: themed('pc-banner-feedback');
- }
- background-size: auto 360px;
- .logo {
- display: block;
- width: 120px;
- height: 120px;
- border-radius: 50%;
- background: #fff;
- }
- .name {
- font-size: 30px;
- color: #fff;
- }
- }
- .page-content {
- width: 1200px;
- margin-left: auto;
- margin-right: auto;
- box-sizing: border-box;
- background-color: #fff;
- .control {
- display: block;
- width: 100%;
- height: 280px;
- border: 1px solid #d8d8d8;
- outline: none;
- box-sizing: border-box;
- font-size: 16px;
- color: #101010;
- }
- .submit {
- text-align: center;
- line-height: 46px;
- width: 326px;
- height: 46px;
- margin-left: auto;
- margin-right: auto;
- border-radius: 4px;
- font-size: 16px;
- @include themify($themes) {
- background-color: themed('color');
- }
- color: #fff;
- transition: all 0.2s;
- cursor: pointer;
- &:hover {
- @include themify($themes) {
- background-color: themed('hover-color');
- }
- }
- &.disabled {
- background-color: #d8d8d8 !important;
- }
- }
- }
- .dialog {
- width: 380px;
- padding-top: 40px;
- border-radius: 0;
- .dialog-content {
- width: 100%;
- height: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- .title {
- font-size: 24px;
- color: #101010;
- margin: 28px 0 12px;
- }
- .tip {
- color: #404040;
- font-size: 16px;
- }
- .line {
- width: 340px;
- height: 1px;
- margin: 0 auto;
- margin-top: 28px;
- background: #d8d8d8;
- }
- .image-icon {
- width: 140px;
- height: 100px;
- @include themify($themes) {
- background: themed('pc-icon-feedback-submit') no-repeat center;
- background-size: 140px 100px;
- }
- }
- }
- }
- }
- // 移动 端
- @media screen and (max-width: 768px) {
- .page-top {
- height: 46vw;
- @include themify($themes) {
- background: themed('h5-banner-feedback');
- }
- background-size: auto 46vw;
- .logo {
- display: block;
- width: 14.8vw;
- height: 14.8vw;
- border-radius: 50%;
- background: #fff;
- }
- .name {
- font-size: 4vw;
- color: #fff;
- }
- }
- .page-content {
- .control {
- display: block;
- width: 100%;
- height: 56vw;
- border: 0.1vw solid #d8d8d8;
- outline: none;
- box-sizing: border-box;
- font-size: 3.2vw;
- color: #101010;
- }
- .submit {
- text-align: center;
- line-height: 11.6vw;
- width: 100%;
- height: 11.6vw;
- border-radius: 0.2vw;
- font-size: 4vw;
- @include themify($themes) {
- background-color: themed('color');
- }
- color: #fff;
- &.disabled {
- background-color: #d8d8d8;
- }
- }
- }
- .dialog {
- width: 76vw;
- border-radius: 0;
- .dialog-content {
- padding-top: 3.2vw;
- width: 100%;
- height: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- .title {
- font-size: 4.6vw;
- color: #101010;
- margin: 3.2vw 0;
- }
- .tip {
- color: #404040;
- font-size: 3.2vw;
- }
-
- .image-icon {
- width: 30vw;
- height: 20vw;
- @include themify($themes) {
- background: themed('pc-icon-feedback-submit') no-repeat center;
- background-size: 30vw 20vw;
- }
- }
- }
- }
- }
- </style>
|