裂变星小程序-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.8 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. <!-- todo: 选择头像 -->
  32. <view class="form-item">
  33. <uv-form-item label="选择头像" prop="imageUrl">
  34. <view class="form-item-content">
  35. <formUpload v-model="form.avatarUrl">
  36. <template v-slot="{ value }">
  37. <view class="flex" style="min-width: 116rpx; height: 45rpx;">
  38. <image
  39. :src="value"
  40. mode="aspectFill"
  41. style="width: 68rpx; height: 68rpx;"
  42. radius="14rpx"
  43. />
  44. <uv-icon style="margin-left: 20rpx" name="arrow-right" color="#000000" size="28rpx"></uv-icon>
  45. </view>
  46. </template>
  47. </formUpload>
  48. </view>
  49. </uv-form-item>
  50. </view>
  51. <view class="form-item">
  52. <uv-form-item label="昵称" labelWidth="105rpx" prop="nickName">
  53. <view class="form-item-content">
  54. <formInput v-model="form.nickName" placeholder="请输入你的群名称" width="540rpx"></formInput>
  55. </view>
  56. </uv-form-item>
  57. </view>
  58. <view class="form-item">
  59. <uv-form-item label="选择封面图" prop="imageUrl">
  60. <view class="form-item-content">
  61. <formUpload v-model="form.imageUrl">
  62. <template v-slot="{ value }">
  63. <view class="flex" style="min-width: 116rpx; height: 45rpx;">
  64. <image
  65. :src="value"
  66. mode="aspectFill"
  67. style="width: 68rpx; height: 68rpx;"
  68. radius="14rpx"
  69. />
  70. <uv-icon style="margin-left: 20rpx" name="arrow-right" color="#000000" size="28rpx"></uv-icon>
  71. </view>
  72. </template>
  73. </formUpload>
  74. </view>
  75. </uv-form-item>
  76. </view>
  77. <view class="form-item">
  78. <uv-form-item label="设置转发次数(次)" prop="times">
  79. <view class="form-item-content">
  80. <formNumberBox v-model="form.times" ></formNumberBox>
  81. </view>
  82. </uv-form-item>
  83. </view>
  84. <view class="form-item">
  85. <uv-form-item label="选择二维码" prop="qrCode">
  86. <view class="form-item-content">
  87. <formUpload v-model="form.qrCode">
  88. <template v-slot="{ value }">
  89. <view class="flex" style="min-width: 93rpx; height: 45rpx;">
  90. <image
  91. :src="value"
  92. mode="aspectFill"
  93. style="width: 45rpx; height: 45rpx;"
  94. radius="14rpx"
  95. />
  96. <uv-icon style="margin-left: 20rpx" name="arrow-right" color="#000000" size="28rpx"></uv-icon>
  97. </view>
  98. </template>
  99. </formUpload>
  100. </view>
  101. </uv-form-item>
  102. </view>
  103. <view class="form-item">
  104. <uv-form-item label="文案描述" prop="description" labelPosition="top">
  105. <view style="margin-top: 32rpx;">
  106. <formTextarea
  107. v-model="form.description"
  108. placeholder="请输入你的文案"
  109. ></formTextarea>
  110. </view>
  111. </uv-form-item>
  112. </view>
  113. </uv-form>
  114. </view>
  115. <!-- 审核通过 -->
  116. <button v-if="auditStatus === 1" class="button-submit" @click="onPublish">
  117. 发布
  118. </button>
  119. <!-- 不是 审核中 已发布 -> 创建分享 审核不通过 -->
  120. <button v-else-if="![0,2].includes(auditStatus)" class="button-submit" @click="onSubmit">
  121. 提交审核
  122. </button>
  123. </view>
  124. </template>
  125. <script>
  126. import formNumberBox from '../components/formNumberBox.vue'
  127. import formUpload from '../components/formUpload.vue'
  128. import formTextarea from '../components/formTextarea.vue'
  129. export default {
  130. components: {
  131. formNumberBox,
  132. formUpload,
  133. formTextarea,
  134. },
  135. data() {
  136. return {
  137. id: null,
  138. auditStatus: null,
  139. form: {
  140. id: null,
  141. avatarUrl: null,
  142. nickName: null,
  143. imageUrl: null,
  144. times: 10,
  145. qrCode: null,
  146. description: null,
  147. },
  148. rules: {
  149. // todo
  150. },
  151. }
  152. },
  153. onLoad(option) {
  154. const { id } = option
  155. this.id = id
  156. // todo: init data by id
  157. },
  158. methods: {
  159. onSubmit() {
  160. // todo
  161. const params = { ...this.form }
  162. this.$api('submitPersonalSharing', params)
  163. },
  164. onPublish() {
  165. // todo
  166. },
  167. }
  168. }
  169. </script>
  170. <style scoped lang="scss">
  171. @import '../styles/pageForm.scss';
  172. .button-submit {
  173. margin: 0;
  174. position: fixed;
  175. bottom: 138rpx;
  176. left: 20rpx;
  177. width: calc(100% - 40rpx);
  178. height: 90rpx;
  179. }
  180. </style>