Showing
4 changed files
with
81 additions
and
57 deletions
src/api/B/audit.js
0 → 100644
| 1 | +/* | ||
| 2 | + * @Date: 2022-06-20 16:33:35 | ||
| 3 | + * @LastEditors: hookehuyr hookehuyr@gmail.com | ||
| 4 | + * @LastEditTime: 2022-06-20 16:35:56 | ||
| 5 | + * @FilePath: /tswj/src/api/B/audit.js | ||
| 6 | + * @Description: 文件描述 | ||
| 7 | + */ | ||
| 8 | +import { fn, fetch } from '@/api/fn'; | ||
| 9 | + | ||
| 10 | +const Api = { | ||
| 11 | + CHECK_PROD: '/srv/?a=check_prod', | ||
| 12 | +} | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * @description 审核作品 | ||
| 16 | + * @param {*} prod_id | ||
| 17 | + * @param {*} status | ||
| 18 | + * @param {*} check_note | ||
| 19 | + * @returns {*} data | ||
| 20 | + */ | ||
| 21 | + export const checkProdAPI = (params) => fn(fetch.post(Api.CHECK_PROD, params)); |
| ... | @@ -18,7 +18,10 @@ | ... | @@ -18,7 +18,10 @@ |
| 18 | <span style="font-size: 1.05rem; vertical-align: middle;">{{ item.name }}</span> | 18 | <span style="font-size: 1.05rem; vertical-align: middle;">{{ item.name }}</span> |
| 19 | </van-col> | 19 | </van-col> |
| 20 | <van-col span="16"> | 20 | <van-col span="16"> |
| 21 | - <div style="color: #999999; text-align: right;">{{ item.book_name }} | {{ item.localism_type }}</div> | 21 | + <div style="color: #999999; text-align: right;"> |
| 22 | + {{ item.book_name }} | | ||
| 23 | + <span style="color: #11D2B1;" @click="setLocalism">{{ item.localism_type }}</span> | ||
| 24 | + </div> | ||
| 22 | </van-col> | 25 | </van-col> |
| 23 | </van-row> | 26 | </van-row> |
| 24 | </div> | 27 | </div> |
| ... | @@ -37,8 +40,7 @@ | ... | @@ -37,8 +40,7 @@ |
| 37 | </div> | 40 | </div> |
| 38 | </div> | 41 | </div> |
| 39 | <div v-if="status === 'PROCESS'"> | 42 | <div v-if="status === 'PROCESS'"> |
| 40 | - <div v-if="item.status === 'DISABLE'" class="van-hairline--top" | 43 | + <div v-if="item.status === 'DISABLE'" class="van-hairline--top" style="padding: 1rem; font-size: 0.85rem;"> |
| 41 | - style="padding: 1rem; font-size: 0.85rem;"> | ||
| 42 | <p style="color: #999999; margin-bottom: 0.25rem;">老师留言:</p> | 44 | <p style="color: #999999; margin-bottom: 0.25rem;">老师留言:</p> |
| 43 | <p>{{ item.check_note }}</p> | 45 | <p>{{ item.check_note }}</p> |
| 44 | </div> | 46 | </div> |
| ... | @@ -50,7 +52,7 @@ | ... | @@ -50,7 +52,7 @@ |
| 50 | <van-icon name="close" /> 不通过 | 52 | <van-icon name="close" /> 不通过 |
| 51 | </div> | 53 | </div> |
| 52 | </van-col> | 54 | </van-col> |
| 53 | - <van-col style="padding: 1rem;" @click="onPass()"> | 55 | + <van-col style="padding: 1rem;" @click="onPass('pass')"> |
| 54 | <div class="agree-btn" style=""> | 56 | <div class="agree-btn" style=""> |
| 55 | <van-icon name="passed" /> 通过 | 57 | <van-icon name="passed" /> 通过 |
| 56 | </div> | 58 | </div> |
| ... | @@ -72,8 +74,7 @@ | ... | @@ -72,8 +74,7 @@ |
| 72 | </div> | 74 | </div> |
| 73 | <div> | 75 | <div> |
| 74 | <van-field v-model="message" rows="2" autosize label="" type="textarea" maxlength="200" | 76 | <van-field v-model="message" rows="2" autosize label="" type="textarea" maxlength="200" |
| 75 | - placeholder="请填写您对小朋友的温馨鼓励" show-word-limit @focus="focusInput" | 77 | + placeholder="请填写您对小朋友的温馨鼓励" show-word-limit @focus="focusInput" @blur="blurInput" /> |
| 76 | - @blur="blurInput" /> | ||
| 77 | </div> | 78 | </div> |
| 78 | <div style="margin-top: 3rem;"> | 79 | <div style="margin-top: 3rem;"> |
| 79 | <my-button type="primary" @on-click="handleAudit('disable')">确定</my-button> | 80 | <my-button type="primary" @on-click="handleAudit('disable')">确定</my-button> |
| ... | @@ -86,29 +87,26 @@ | ... | @@ -86,29 +87,26 @@ |
| 86 | @confirm="handleAudit('enable')" @cancel="onCancel"> | 87 | @confirm="handleAudit('enable')" @cancel="onCancel"> |
| 87 | <div style="padding: 1rem; text-align: center;">是否确认审核通过该视频 ?</div> | 88 | <div style="padding: 1rem; text-align: center;">是否确认审核通过该视频 ?</div> |
| 88 | </van-dialog> | 89 | </van-dialog> |
| 90 | + | ||
| 91 | + <localism-box :id="item.id" :title="localism_title" :type="trigger_type" :show-localism="showLocalism" | ||
| 92 | + :localism="item.localism_type" @on-close="closeLocalism" @on-submit="submitLocalism" /> | ||
| 89 | </template> | 93 | </template> |
| 90 | 94 | ||
| 91 | <script setup> | 95 | <script setup> |
| 92 | -import icon_up from '@images/icon-guanbi@2x.png' | 96 | +import { icon_up, icon_down, icon_refuse, icon_apply, icon_enable } from '@/utils/generateIcons' |
| 93 | -import icon_down from '@images/icon-zhankai@2x.png' | ||
| 94 | - | ||
| 95 | -import icon_refuse from '@images/icon-jujue@2x.png' | ||
| 96 | -import icon_apply from '@images/icon-shenhe@2x.png' | ||
| 97 | -import icon_enable from '@images/icon-tongguo@2x.png' | ||
| 98 | 97 | ||
| 99 | import MyButton from '@/components/MyButton/index.vue' | 98 | import MyButton from '@/components/MyButton/index.vue' |
| 100 | -import { ref, reactive, onMounted, nextTick, watch, onUpdated } from 'vue' | 99 | +import LocalismBox from '@/components/LocalismBox/index.vue' |
| 100 | +import { checkProdAPI } from '@/api/B/audit' | ||
| 101 | + | ||
| 102 | +import { ref, onMounted } from 'vue' | ||
| 101 | import 'mui-player/dist/mui-player.min.css' | 103 | import 'mui-player/dist/mui-player.min.css' |
| 102 | import MuiPlayer from 'mui-player' | 104 | import MuiPlayer from 'mui-player' |
| 103 | -import axios from '@/utils/axios'; | ||
| 104 | import _ from 'lodash'; | 105 | import _ from 'lodash'; |
| 105 | import tools from '@/common/tool' | 106 | import tools from '@/common/tool' |
| 106 | import { styleColor } from '@/constant.js'; | 107 | import { styleColor } from '@/constant.js'; |
| 107 | 108 | ||
| 108 | -import { useRoute, useRouter } from 'vue-router' | ||
| 109 | import { Toast } from 'vant'; | 109 | import { Toast } from 'vant'; |
| 110 | -const $route = useRoute(); | ||
| 111 | -const $router = useRouter(); | ||
| 112 | 110 | ||
| 113 | const props = defineProps({ | 111 | const props = defineProps({ |
| 114 | item: Object, | 112 | item: Object, |
| ... | @@ -131,12 +129,16 @@ onMounted(() => { | ... | @@ -131,12 +129,16 @@ onMounted(() => { |
| 131 | }, 500); | 129 | }, 500); |
| 132 | }) | 130 | }) |
| 133 | 131 | ||
| 132 | +const localism_title = ref('') | ||
| 134 | // 审核视频通过/不通过弹框 | 133 | // 审核视频通过/不通过弹框 |
| 135 | const showNotice = ref(false); | 134 | const showNotice = ref(false); |
| 136 | const show = ref(false); | 135 | const show = ref(false); |
| 137 | const message = ref(''); | 136 | const message = ref(''); |
| 138 | -const onPass = () => { // 通过审核 | 137 | +const trigger_type = ref(''); // 点击入口判断,pass为点击通过按钮进入,空值为直接点击语言栏 |
| 139 | - show.value = true; | 138 | +const onPass = (type) => { // 通过审核 |
| 139 | + showLocalism.value = true; | ||
| 140 | + localism_title.value = '请确认您的方言类别是否正确' | ||
| 141 | + trigger_type.value = type; | ||
| 140 | } | 142 | } |
| 141 | const onCancel = () => { | 143 | const onCancel = () => { |
| 142 | show.value = false; | 144 | show.value = false; |
| ... | @@ -148,53 +150,40 @@ const closeNotice = () => { | ... | @@ -148,53 +150,40 @@ const closeNotice = () => { |
| 148 | const onRefuse = () => { // 不通过审核 | 150 | const onRefuse = () => { // 不通过审核 |
| 149 | showNotice.value = true; | 151 | showNotice.value = true; |
| 150 | } | 152 | } |
| 151 | -const handleAudit = (status) => { | 153 | +const handleAudit = async (status) => { |
| 152 | - axios.post('/srv/?a=check_prod', { | 154 | + const { code } = await checkProdAPI({ prod_id: props.item.id, status, check_note: message.value, }) |
| 153 | - prod_id: props.item.id, | 155 | + if (code === 1) { |
| 154 | - status, | ||
| 155 | - check_note: message.value, | ||
| 156 | - }) | ||
| 157 | - .then(res => { | ||
| 158 | - if (res.data.code === 1) { | ||
| 159 | Toast.success('操作成功'); | 156 | Toast.success('操作成功'); |
| 160 | message.value = ''; | 157 | message.value = ''; |
| 161 | showNotice.value = false; | 158 | showNotice.value = false; |
| 162 | show.value = false; | 159 | show.value = false; |
| 163 | emit('on-click', props.item.id); | 160 | emit('on-click', props.item.id); |
| 164 | - } else { | ||
| 165 | - console.warn(res); | ||
| 166 | - if (!res.data.show) return false; | ||
| 167 | - Toast({ | ||
| 168 | - icon: 'close', | ||
| 169 | - message: res.data.msg | ||
| 170 | - }); | ||
| 171 | } | 161 | } |
| 172 | - }) | ||
| 173 | - .catch(err => { | ||
| 174 | - console.error(err); | ||
| 175 | - }) | ||
| 176 | } | 162 | } |
| 177 | 163 | ||
| 178 | -// 优化处理输入框弹出遮挡问题 | ||
| 179 | -let interval = '' | ||
| 180 | const focusInput = () => { | 164 | const focusInput = () => { |
| 181 | - window.addEventListener("resize", function () { | ||
| 182 | - if ( | ||
| 183 | - document.activeElement.tagName === "INPUT" || | ||
| 184 | - document.activeElement.tagName === "TEXTAREA" | ||
| 185 | - ) { | ||
| 186 | - interval = window.setTimeout(function () { | ||
| 187 | - if ("scrollIntoView" in document.activeElement) { | ||
| 188 | - document.activeElement.scrollIntoView(); | ||
| 189 | - } else { | ||
| 190 | - document.activeElement.scrollIntoViewIfNeeded(); | ||
| 191 | - } | ||
| 192 | - }, 0); | ||
| 193 | - } | ||
| 194 | - }); | ||
| 195 | } | 165 | } |
| 196 | const blurInput = () => { | 166 | const blurInput = () => { |
| 197 | - clearInterval(interval); | 167 | +} |
| 168 | + | ||
| 169 | +// 修改语言种类 | ||
| 170 | +const showLocalism = ref(false); | ||
| 171 | +const setLocalism = () => { | ||
| 172 | + trigger_type.value = '' | ||
| 173 | + localism_title.value = '设置方言类别' | ||
| 174 | + showLocalism.value = true; | ||
| 175 | +} | ||
| 176 | +const closeLocalism = () => { | ||
| 177 | + showLocalism.value = false; | ||
| 178 | +} | ||
| 179 | +const submitLocalism = (localism) => { | ||
| 180 | + // 接口保存成功后,静态修改语言类型 | ||
| 181 | + props.item.localism_type = localism; | ||
| 182 | + showLocalism.value = false; | ||
| 183 | + // 通过按钮点击进入,需要走通过审核流程。 | ||
| 184 | + if (trigger_type.value) { | ||
| 185 | + show.value = true; | ||
| 186 | + } | ||
| 198 | } | 187 | } |
| 199 | </script> | 188 | </script> |
| 200 | 189 | ... | ... |
| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | * @Author: hookehuyr hookehuyr@gmail.com | 2 | * @Author: hookehuyr hookehuyr@gmail.com |
| 3 | * @Date: 2022-05-17 11:34:35 | 3 | * @Date: 2022-05-17 11:34:35 |
| 4 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 4 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 5 | - * @LastEditTime: 2022-06-01 13:49:40 | 5 | + * @LastEditTime: 2022-06-20 16:31:28 |
| 6 | * @FilePath: /tswj/src/utils/generateIcons.js | 6 | * @FilePath: /tswj/src/utils/generateIcons.js |
| 7 | * @Description: 图标集合 | 7 | * @Description: 图标集合 |
| 8 | */ | 8 | */ |
| ... | @@ -27,6 +27,9 @@ import icon_ranking1 from '@images/1@2x.png' | ... | @@ -27,6 +27,9 @@ import icon_ranking1 from '@images/1@2x.png' |
| 27 | import icon_ranking2 from '@images/2@2x.png' | 27 | import icon_ranking2 from '@images/2@2x.png' |
| 28 | import icon_ranking3 from '@images/3@2x.png' | 28 | import icon_ranking3 from '@images/3@2x.png' |
| 29 | import icon_flower from '@images/xiaohua@2x.png' | 29 | import icon_flower from '@images/xiaohua@2x.png' |
| 30 | +import icon_refuse from '@images/icon-jujue@2x.png' | ||
| 31 | +import icon_apply from '@images/icon-shenhe@2x.png' | ||
| 32 | +import icon_enable from '@images/icon-tongguo@2x.png' | ||
| 30 | 33 | ||
| 31 | export { | 34 | export { |
| 32 | icon_video, | 35 | icon_video, |
| ... | @@ -50,4 +53,7 @@ export { | ... | @@ -50,4 +53,7 @@ export { |
| 50 | icon_ranking2, | 53 | icon_ranking2, |
| 51 | icon_ranking3, | 54 | icon_ranking3, |
| 52 | icon_flower, | 55 | icon_flower, |
| 56 | + icon_refuse, | ||
| 57 | + icon_apply, | ||
| 58 | + icon_enable, | ||
| 53 | } | 59 | } | ... | ... |
| 1 | +/* | ||
| 2 | + * @Date: 2022-05-17 11:26:03 | ||
| 3 | + * @LastEditors: hookehuyr hookehuyr@gmail.com | ||
| 4 | + * @LastEditTime: 2022-06-20 14:00:13 | ||
| 5 | + * @FilePath: /tswj/src/utils/generatePackage.js | ||
| 6 | + * @Description: 文件描述 | ||
| 7 | + */ | ||
| 1 | import Cookies from 'js-cookie' | 8 | import Cookies from 'js-cookie' |
| 2 | import $ from 'jquery' | 9 | import $ from 'jquery' |
| 3 | import _ from 'lodash' | 10 | import _ from 'lodash' |
| 4 | import axios from '@/utils/axios'; | 11 | import axios from '@/utils/axios'; |
| 5 | import { storeToRefs } from 'pinia' | 12 | import { storeToRefs } from 'pinia' |
| 6 | import { mainStore } from '@/store' | 13 | import { mainStore } from '@/store' |
| 7 | -import { Toast } from 'vant'; | 14 | +import { Toast, Dialog } from 'vant'; |
| 8 | import { wxInfo, hasEllipsis } from '@/utils/tools'; | 15 | import { wxInfo, hasEllipsis } from '@/utils/tools'; |
| 9 | import { useTitle } from '@vueuse/core' | 16 | import { useTitle } from '@vueuse/core' |
| 10 | 17 | ||
| ... | @@ -16,6 +23,7 @@ export { | ... | @@ -16,6 +23,7 @@ export { |
| 16 | storeToRefs, | 23 | storeToRefs, |
| 17 | mainStore, | 24 | mainStore, |
| 18 | Toast, | 25 | Toast, |
| 26 | + Dialog, | ||
| 19 | wxInfo, | 27 | wxInfo, |
| 20 | hasEllipsis, | 28 | hasEllipsis, |
| 21 | useTitle | 29 | useTitle | ... | ... |
-
Please register or login to post a comment