signUp.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view>
  3. <view class="image-container" @click="selectShow = true">
  4. <view class="cuIcon-roundaddfill theme-color" style="font-size: 80upx;padding: 100upx 0 30upx 0;"></view>
  5. <view class="text-black text-bold text-sm">添加图片或视频</view>
  6. </view>
  7. <view class="image-container" v-if="data.urlsType==1">
  8. <view class="cuIcon-roundaddfill theme-color" style="font-size: 80upx;padding: 100upx 0 30upx 0;"></view>
  9. <view class="text-black text-bold text-sm">请上传作品封面</view>
  10. </view>
  11. <u-action-sheet :list="list" @click="upload" v-model="selectShow"></u-action-sheet>
  12. <view class="basic-container">
  13. <view class="padding-sm">
  14. <text class="cuIcon-titles theme-color" style="font-size: 36upx;"></text>
  15. <text class="text-black text-bold text-lg">基本信息</text>
  16. </view>
  17. <view class="padding-sm flex justify-around align-center">
  18. <block v-for="(item, index) in classification" :key="index">
  19. <view class="tags" :class="current == index ? 'theme-bg-color text-white' : ''" @click="current = index;data.personType=item">{{item}}</view>
  20. </block>
  21. </view>
  22. <view class="padding-sm">
  23. <text class="text-black text-bold text-lg padding-left-sm">{{detail.personTitle}}</text>
  24. <view style="padding: 30upx 20upx;">
  25. <u-input v-model="data.personName" :placeholder="'请输入'+detail.personTitle" />
  26. </view>
  27. <view style="padding: 0 20upx 40upx 20upx;">
  28. <u-line color="#e3e3e3" />
  29. </view>
  30. <text class="text-black text-bold text-lg padding-left-sm">{{detail.productionTitle}}</text>
  31. <view style="padding: 30upx 20upx;">
  32. <u-input v-model="data.title" :placeholder="'请输入'+detail.productionTitle" />
  33. </view>
  34. <view style="padding: 0 20upx 40upx 20upx;">
  35. <u-line color="#e3e3e3" />
  36. </view>
  37. <text class="text-black text-bold text-lg padding-left-sm">{{detail.introductionTitle}}</text>
  38. <view style="padding: 30upx 20upx 0 20upx;">
  39. <u-input v-model="data.introduce" type="textarea" :clearable="false" height="140" :autoHeight="false" maxlength="60" :placeholder="'请输入'+detail.productionTitle" />
  40. </view>
  41. <view class="flex justify-end padding-right-sm padding-bottom-sm text-gray">{{data.introduce.length}} / 60</view>
  42. <view style="padding: 0 20upx 40upx 20upx;">
  43. <u-line color="#e3e3e3" />
  44. </view>
  45. <view style="margin: 30upx 0 40upx 0;">
  46. <u-button class="custom-style" shape="circle" @click="navWithParam">确定提交</u-button>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. export default {
  54. data() {
  55. return {
  56. detail:{},
  57. selectShow: false,
  58. list: [{
  59. text: '上传图片'
  60. }, {
  61. text: '上传视频'
  62. }],
  63. current: 0,
  64. type:0,
  65. classification: [],
  66. name: '',
  67. introduction: '',
  68. data:{
  69. userId:'',
  70. urlsType:0,
  71. urls:'',
  72. person_name:'',
  73. introduce:''
  74. }
  75. }
  76. },
  77. onLoad(options) {
  78. this.getActivityDetail(options.activityId);
  79. },
  80. methods: {
  81. async upload(index) {
  82. console.log(index);
  83. let res;
  84. this.data.urlsType=index
  85. if (index==0) {
  86. //上传图片
  87. res=await this.$mpi.uploadFile()
  88. }else{
  89. //上传视频
  90. res=await this.$mpi.uploadVideo()
  91. }
  92. let obj = JSON.parse(res);
  93. this.data.urls=obj.data
  94. },
  95. getActivityDetail(id) {
  96. this.$u.api.activity.detail({id: id}).then(res => {
  97. this.detail = res
  98. this.classification = res.classification.split(',');
  99. })
  100. },
  101. navWithParam() {
  102. console.log(this.data);
  103. // uni.navigateTo({
  104. // url: '/pages/activityList/mine/introduction'
  105. // })
  106. }
  107. }
  108. }
  109. </script>
  110. <style lang="scss" scoped>
  111. .image-container {
  112. text-align: center;
  113. background-color: #FFFFFF;
  114. height: 400upx;
  115. margin: 30upx;
  116. border-radius: 30upx;
  117. }
  118. .basic-container {
  119. background-color: #FFFFFF;
  120. margin: 20upx;
  121. border-radius: 30upx;
  122. }
  123. .tags {
  124. display: flex;
  125. justify-content: center;
  126. align-items: center;
  127. width: 30%;
  128. height: 70upx;
  129. border: #4f4f4f 1px solid;
  130. border-radius: 28upx;
  131. }
  132. .custom-style {
  133. background-color: #5a3ee8;
  134. color: #FFFFFF;
  135. width: 400rpx;
  136. }
  137. </style>