裂变星小程序-25.03.04
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

189 lines
5.4 KiB

  1. <template>
  2. <view class="page">
  3. <navbar title="视频分享" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="content">
  5. <uv-form
  6. ref="form"
  7. :model="form"
  8. :rules="rules"
  9. labelPosition="left"
  10. labelWidth="340rpx"
  11. :labelStyle="{
  12. color: '#1B1B1B',
  13. fontSize: '32rpx',
  14. fontWeight: 'bold',
  15. }"
  16. >
  17. <view class="flex upload__view">
  18. <view class="upload upload-cover">
  19. <uv-form-item labelWidth="0" prop="coverImageUrl">
  20. <formUpload v-model="form.coverImageUrl">
  21. <template v-slot="{ value }">
  22. <!-- todo: 默认 -->
  23. <image
  24. :src="value"
  25. mode="aspectFill"
  26. style="width: 344rpx; height: 344rpx;"
  27. radius="14rpx"
  28. />
  29. </template>
  30. </formUpload>
  31. <view class="upload-cover-text flex">设置封面</view>
  32. </uv-form-item>
  33. </view>
  34. <view class="upload upload-video">
  35. <uv-form-item labelWidth="0" prop="videoUrl">
  36. <formUpload v-model="form.videoUrl">
  37. <template v-slot="{ value }">
  38. <image v-if="value"
  39. :src="form.videoUrl"
  40. mode="aspectFill"
  41. style="width: 344rpx; height: 344rpx;"
  42. radius="14rpx"
  43. />
  44. <view v-else class="flex flex-column" style="width: 344rpx; height: 344rpx;">
  45. <uv-icon name="camera" color="#000000" size="129rpx"></uv-icon>
  46. <text class="upload-video-text">上传视频</text>
  47. </view>
  48. </template>
  49. </formUpload>
  50. </uv-form-item>
  51. </view>
  52. </view>
  53. <view class="form-item">
  54. <uv-form-item label="标题" labelWidth="84rpx" prop="title">
  55. <view class="form-item-content">
  56. <formInput v-model="form.title" placeholder="请输入你的视频名称" width="584rpx"></formInput>
  57. </view>
  58. </uv-form-item>
  59. </view>
  60. <view class="form-item">
  61. <uv-form-item label="设置广告弹出时间(s)" prop="mins">
  62. <view class="form-item-content">
  63. <formNumberBox v-model="form.mins" ></formNumberBox>
  64. </view>
  65. </uv-form-item>
  66. </view>
  67. <view class="form-item">
  68. <uv-form-item label="设置转发次数(次)" prop="times">
  69. <view class="form-item-content">
  70. <formNumberBox v-model="form.times" ></formNumberBox>
  71. </view>
  72. </uv-form-item>
  73. </view>
  74. <view class="form-item">
  75. <uv-form-item label="选择二维码" prop="qrCode">
  76. <view class="form-item-content">
  77. <formUpload v-model="form.qrCode">
  78. <template v-slot="{ value }">
  79. <view class="flex" style="min-width: 93rpx; height: 45rpx;">
  80. <image
  81. :src="value"
  82. mode="aspectFill"
  83. style="width: 45rpx; height: 45rpx;"
  84. radius="14rpx"
  85. />
  86. <uv-icon style="margin-left: 20rpx" name="arrow-right" color="#000000" size="28rpx"></uv-icon>
  87. </view>
  88. </template>
  89. </formUpload>
  90. </view>
  91. </uv-form-item>
  92. </view>
  93. <view class="form-item">
  94. <uv-form-item label="视频描述" prop="description" labelPosition="top">
  95. <view style="margin-top: 32rpx;">
  96. <formTextarea
  97. v-model="form.description"
  98. placeholder="请描述你的视频"
  99. ></formTextarea>
  100. </view>
  101. </uv-form-item>
  102. </view>
  103. </uv-form>
  104. </view>
  105. <button class="button-submit" @click="onSubmit">
  106. 提交审核
  107. </button>
  108. </view>
  109. </template>
  110. <script>
  111. import formUpload from '../components/formUpload.vue'
  112. import formInput from '../components/formInput.vue'
  113. import formNumberBox from '../components/formNumberBox.vue'
  114. import formTextarea from '../components/formTextarea.vue'
  115. export default {
  116. components: {
  117. formUpload,
  118. formInput,
  119. formNumberBox,
  120. formTextarea,
  121. },
  122. data() {
  123. return {
  124. form: {
  125. title: null,
  126. coverImageUrl: null,
  127. videoUrl: null,
  128. mins: 2,
  129. times: 10,
  130. qrCode: null,
  131. description: null,
  132. },
  133. rules: {
  134. // todo
  135. },
  136. }
  137. },
  138. methods: {
  139. onSubmit() {
  140. // todo
  141. const params = { ...this.form }
  142. this.$api('submitPersonalSharing', params)
  143. },
  144. }
  145. }
  146. </script>
  147. <style scoped lang="scss">
  148. @import '../styles/pageForm.scss';
  149. .upload__view {
  150. justify-content: space-between;
  151. margin-bottom: 20rpx;
  152. }
  153. .upload {
  154. background-color: $uni-fg-color;
  155. border-radius: 12rpx;
  156. overflow: hidden;
  157. }
  158. .upload-video {
  159. &-text {
  160. color: #1B1B1B;
  161. font-size: 32rpx;
  162. }
  163. }
  164. .upload-cover {
  165. position: relative;
  166. &-text {
  167. position: absolute;
  168. bottom: 0;
  169. width: 100%;
  170. background-color: rgba($color: #000000, $alpha: 0.6);
  171. color: #FFFFFF;
  172. padding: 21rpx 0;
  173. }
  174. }
  175. </style>