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

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