Upload.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <script setup lang="ts">
  2. import { ref, watch } from "vue";
  3. import { useMainStore } from "@/stores/main";
  4. import { required } from "@/utils";
  5. import { useI18n } from "vue-i18n";
  6. import router from "@/router";
  7. const { t } = useI18n();
  8. const valid = ref(true);
  9. const dialog = ref(false);
  10. const title = ref("");
  11. const zipFiles = ref();
  12. const Form = ref();
  13. const mainStore = useMainStore();
  14. watch(dialog, (newVal, oldVal) => {
  15. if (!newVal) {
  16. router.push("/main/progress");
  17. }
  18. });
  19. async function Submit() {
  20. setTimeout(() => {
  21. dialog.value = true;
  22. }, 2000);
  23. await (Form as any).value.validate();
  24. if (valid.value) {
  25. valid.value = false;
  26. await mainStore.uploadPlot(title.value, zipFiles.value[0]);
  27. // (Form as any).value.reset();
  28. }
  29. }
  30. </script>
  31. <template>
  32. <v-container fluid>
  33. <v-card class="ma-3 pa-3">
  34. <v-card-title primary-title>
  35. <h3 class="card-title mb-3">{{ t("makeVideo") }}</h3>
  36. </v-card-title>
  37. <v-card-text>
  38. <v-form v-model="valid" ref="Form">
  39. <v-text-field
  40. :label="$t('title')"
  41. v-model="title"
  42. :rules="required"
  43. prepend-icon="title"
  44. >
  45. </v-text-field>
  46. <v-file-input
  47. v-model="zipFiles"
  48. :rules="[(v) => v.length || 'select zip file.']"
  49. accept=".zip"
  50. :label="$t('fileInput')"
  51. prepend-icon="folder_zip"
  52. ></v-file-input>
  53. </v-form>
  54. </v-card-text>
  55. <v-card-actions>
  56. <v-spacer></v-spacer>
  57. <v-btn @click="Submit" :disabled="!valid">
  58. {{ t("send") }}
  59. </v-btn>
  60. </v-card-actions>
  61. </v-card>
  62. <v-card class="ma-3 pa-3 mt-8">
  63. <v-card-title primary-title>
  64. <h3 class="text-center">使用教學</h3>
  65. </v-card-title>
  66. <v-card-text>
  67. <ul class="mt-5 step-list">
  68. <li>
  69. <h4>1. 取得快速製作模板</h4>
  70. <p class="excerpt">請點擊按鈕下載 excel 檔範例</p>
  71. <div class="mb-5">
  72. <a
  73. href="https://video.choozmo.com/register.html"
  74. class="link-btn"
  75. target="_blank"
  76. >點我下載</a
  77. >
  78. </div>
  79. </li>
  80. <li>
  81. <h4>2. 準備影片內容</h4>
  82. <p class="excerpt">
  83. 準備一個資料夾,裡面有一個 "素材資料夾" 跟 "EXCEL 檔"
  84. </p>
  85. <img src="@/assets/img/step/step-01.png" alt="" class="mb-4" />
  86. <p class="excerpt">素材資料夾裡面放照片或影片</p>
  87. <img src="@/assets/img/step/step-02.png" alt="" />
  88. <small class="d-block ms-4"
  89. >包含內容:圖片/影片(.jpg/.mp4)</small
  90. >
  91. <p class="mt-5 excerpt">
  92. EXCEL 檔整理成這個格式-大標題、字幕、素材、音檔
  93. </p>
  94. <img src="@/assets/img/step/step-03.png" alt="" />
  95. <ul class="point-list">
  96. <li>1. 字幕之間的斷句 使用符號【¥】</li>
  97. <li>2. 字幕每一句段落勿超過中文 25 字、英文 50 字</li>
  98. <li>3. 大標題字數勿超過中文 15 字、英文 30 字</li>
  99. <li>4. 音檔留空白</li>
  100. </ul>
  101. <p class="mt-5 excerpt">以下為顯示效果:</p>
  102. <img src="@/assets/img/step/step-04.png" alt="" />
  103. <p class="mt-5 excerpt">
  104. 接下來同時選素材資料夾跟 EXCEL 檔,壓縮成 ZIP 檔
  105. </p>
  106. <img src="@/assets/img/step/step-05.png" alt="" class="my-5" />
  107. </li>
  108. <li>
  109. <h4>3. 上傳 ZIP 資料夾至 AI Spokesgirl 平台</h4>
  110. <p class="excerpt">影片檔名請寫上影片名稱</p>
  111. <img src="@/assets/img/step/step-06.png" alt="" />
  112. <h4 class="my-5 caption">
  113. 點選“送出”之後需等待一段影片製作的時間 <br />
  114. 請您耐心等候,待製作完畢可於影片清單查看
  115. </h4>
  116. </li>
  117. </ul>
  118. </v-card-text>
  119. </v-card>
  120. <template>
  121. <div class="text-center">
  122. <v-dialog v-model="dialog" width="auto">
  123. <v-card>
  124. <v-card-text>
  125. <section class="d-flex flex-column align-center">
  126. <v-icon
  127. style="font-size: 70px"
  128. icon="info"
  129. color="orange-darken-3"
  130. />
  131. <p class="mt-3">影片處理需要約 5-10 分鐘,敬請耐心等候</p>
  132. </section>
  133. </v-card-text>
  134. <v-card-actions>
  135. <v-btn color="primary" block @click="dialog = false">{{
  136. t("close")
  137. }}</v-btn>
  138. </v-card-actions>
  139. </v-card>
  140. </v-dialog>
  141. </div>
  142. </template>
  143. </v-container>
  144. </template>
  145. <style lang="scss">
  146. .step-list {
  147. list-style: none;
  148. img {
  149. width: 100%;
  150. max-width: 800px;
  151. }
  152. li {
  153. display: flex;
  154. flex-direction: column;
  155. align-items: center;
  156. font-size: 16px;
  157. h4 {
  158. margin: 20px auto;
  159. color: #ea5413;
  160. font-weight: bold;
  161. text-align: center;
  162. line-height: 34px;
  163. font-size: 20px;
  164. }
  165. }
  166. .link-btn {
  167. display: inline-block;
  168. padding: 12px 20px;
  169. margin-top: 25px;
  170. border-radius: 100px;
  171. text-decoration: none;
  172. color: #fff;
  173. background: #ea5413;
  174. transition: all 0.3s;
  175. &:hover {
  176. opacity: 0.8;
  177. }
  178. }
  179. .point-list {
  180. display: flex;
  181. flex-direction: column;
  182. align-items: baseline;
  183. margin-left: 40px;
  184. }
  185. .excerpt::before {
  186. content: "";
  187. font-weight: bold;
  188. display: inline-block;
  189. border: 5px solid #ea5413;
  190. border-radius: 20px;
  191. margin-right: 10px;
  192. margin-bottom: 2px;
  193. }
  194. }
  195. </style>