裂变星小程序-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.

158 lines
4.5 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="300rpx"
  11. :labelStyle="{
  12. color: '#1B1B1B',
  13. fontSize: '32rpx',
  14. fontWeight: 'bold',
  15. }"
  16. >
  17. <view class="form-item">
  18. <uv-form-item label="用户ID" prop="id">
  19. <view class="form-item-content">
  20. <template v-if="form.id">
  21. <text>{{ form.id }}</text>
  22. <view style="margin-left: 20rpx;">
  23. <button class="btn-simple" plain @click="$utils.copyText(form.id)">
  24. <uv-icon name="file-text" color="#05D9A2" size="28rpx"></uv-icon>
  25. </button>
  26. </view>
  27. </template>
  28. </view>
  29. </uv-form-item>
  30. </view>
  31. <view class="form-item">
  32. <uv-form-item label="选择封面图" prop="imageUrl">
  33. <view class="form-item-content">
  34. <formUpload v-model="form.imageUrl">
  35. <template v-slot="{ value }">
  36. <view class="flex" style="min-width: 116rpx; height: 45rpx;">
  37. <image
  38. :src="value"
  39. mode="aspectFill"
  40. style="width: 68rpx; height: 68rpx;"
  41. radius="14rpx"
  42. />
  43. <uv-icon style="margin-left: 20rpx" name="arrow-right" color="#000000" size="28rpx"></uv-icon>
  44. </view>
  45. </template>
  46. </formUpload>
  47. </view>
  48. </uv-form-item>
  49. </view>
  50. <view class="form-item">
  51. <uv-form-item label="设置转发次数(次)" prop="times">
  52. <view class="form-item-content">
  53. <formNumberBox v-model="form.times" ></formNumberBox>
  54. </view>
  55. </uv-form-item>
  56. </view>
  57. <view class="form-item">
  58. <uv-form-item label="选择二维码" prop="qrCode">
  59. <view class="form-item-content">
  60. <formUpload v-model="form.qrCode">
  61. <template v-slot="{ value }">
  62. <view class="flex" style="min-width: 93rpx; height: 45rpx;">
  63. <image
  64. :src="value"
  65. mode="aspectFill"
  66. style="width: 45rpx; height: 45rpx;"
  67. radius="14rpx"
  68. />
  69. <uv-icon style="margin-left: 20rpx" name="arrow-right" color="#000000" size="28rpx"></uv-icon>
  70. </view>
  71. </template>
  72. </formUpload>
  73. </view>
  74. </uv-form-item>
  75. </view>
  76. <view class="form-item">
  77. <uv-form-item label="文案描述" prop="description" labelPosition="top">
  78. <view style="margin-top: 32rpx;">
  79. <formTextarea
  80. v-model="form.description"
  81. placeholder="请输入你的文案"
  82. ></formTextarea>
  83. </view>
  84. </uv-form-item>
  85. </view>
  86. </uv-form>
  87. </view>
  88. <button v-if="auditStatus === 1" class="button-submit" @click="onPublish">
  89. 发布
  90. </button>
  91. <button v-else-if="auditStatus !== 0" class="button-submit" @click="onSubmit">
  92. 提交审核
  93. </button>
  94. </view>
  95. </template>
  96. <script>
  97. import formNumberBox from '../components/formNumberBox.vue'
  98. import formUpload from '../components/formUpload.vue'
  99. import formTextarea from '../components/formTextarea.vue'
  100. export default {
  101. components: {
  102. formNumberBox,
  103. formUpload,
  104. formTextarea,
  105. },
  106. data() {
  107. return {
  108. id: null,
  109. auditStatus: null,
  110. form: {
  111. id: null,
  112. imageUrl: null,
  113. times: 10,
  114. qrCode: null,
  115. description: null,
  116. },
  117. rules: {
  118. // todo
  119. },
  120. }
  121. },
  122. onLoad(option) {
  123. const { id } = option
  124. this.id = id
  125. // todo: init data by id
  126. },
  127. methods: {
  128. onSubmit() {
  129. // todo
  130. const params = { ...this.form }
  131. this.$api('submitPersonalSharing', params)
  132. },
  133. onPublish() {
  134. // todo
  135. },
  136. }
  137. }
  138. </script>
  139. <style scoped lang="scss">
  140. @import '../styles/pageForm.scss';
  141. .button-submit {
  142. margin: 0;
  143. position: fixed;
  144. bottom: 138rpx;
  145. left: 20rpx;
  146. width: calc(100% - 40rpx);
  147. height: 90rpx;
  148. }
  149. </style>