create.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <template>
  2. <view class="m_right">
  3. <image src="../../../assets/home/homeBG.jpg" class="s_logo" mode=""></image>
  4. <view class="s_content_container">
  5. <view class="s_content">
  6. <view class="uni-form-item df fdr aic">
  7. <view class="title">项目名称</view>
  8. <input class="form-input" style="width: 70%;margin-left: -6%;" v-model="model.projectName" name="input" placeholder="请输入项目名称" />
  9. <checkbox-group>
  10. <label>
  11. <checkbox @click="onClickCheck" :checked="bPublic" />是否为公共项目
  12. </label>
  13. </checkbox-group>
  14. </view>
  15. <view class="uni-form-item df fdr aic">
  16. <view class="title">项目类型</view>
  17. <picker class="form-input" @change="bindPickerChange_proType" :value="index_proType" :range="proType">
  18. <view class=" df fdr aic jcsb">
  19. <view>{{proType[index_proType]}}</view>
  20. <view>
  21. <img src="../../../assets/user/pic_user_03.png" />
  22. </view>
  23. </view>
  24. </picker>
  25. </view>
  26. <view class="uni-form-item ">
  27. <view class="title">项目介绍</view>
  28. <textarea name="" class="form-input" style="height: 100rpx;" maxlength="1400" v-model="model.describe" rows="2" placeholder="请输入项目介绍"></textarea>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="s_footer" style="text-align: center">
  33. <button size="mini" class="m_btn_download" style="" @click="save">创建完成</button>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. name: "create",
  40. data() {
  41. return {
  42. model: {
  43. createUserID: undefined,
  44. projectName: "",
  45. describe: "",
  46. type: "科幻",
  47. },
  48. index_proType: 0,
  49. // proType: ['科幻', '现实', '剧情', '历史', '爱情', '惊悚', '公路', '动画'],
  50. proType: ['科幻', '现实', 'XR', '主旋律', 'VR'],
  51. bPublic:false,
  52. }
  53. },
  54. components: {},
  55. created() {
  56. this.clear();
  57. },
  58. methods: {
  59. save() {
  60. this.model.createUserID = mydata_userInfo.UserID;
  61. console.log(this.model);
  62. if (this.model.projectName == "") {
  63. alert("请输入项目名称~");
  64. return false;
  65. }
  66. if (this.model.describe == "") {
  67. alert("请输入项目介绍~");
  68. return false;
  69. }
  70. if (this.model.type == "") {
  71. alert("请输入项目类型~");
  72. return false;
  73. }
  74. uni.chooseImage({
  75. success: (chooseImageRes) => {
  76. const tempFilePaths = chooseImageRes.tempFilePaths;
  77. let isPublic = Number(this.bPublic);
  78. console.log('1111=',isPublic)
  79. uni.uploadFile({
  80. url: mydata_api + '/project/createprojectnew', //仅为示例,非真实的接口地址
  81. filePath: tempFilePaths[0],
  82. name: 'file',
  83. formData: {
  84. "CreateUserID": mydata_userInfo.UserID,
  85. "ProjectName": this.model.projectName,
  86. "Describe": this.model.describe,
  87. "Type": this.model.type,
  88. "IsPublic":isPublic
  89. },
  90. success: (uploadFileRes) => {
  91. console.log('upload ok=', uploadFileRes.data);
  92. alert("创建成功");
  93. this.model.projectName='';
  94. this.model.describe='';
  95. this.model.type='科幻';
  96. this.$emit('onBackCreateInfo');
  97. }
  98. });
  99. }
  100. });
  101. },
  102. clear() {
  103. this.model = {
  104. createUserID: undefined,
  105. projectName: "",
  106. describe: "",
  107. type: "科幻",
  108. }
  109. },
  110. bindPickerChange_proType: function(e) {
  111. this.index_proType = e.target.value;
  112. this.model.type = this.proType[this.index_proType];
  113. console.log(this.model)
  114. },
  115. onClickCheck(e){
  116. if(this.bPublic==true){
  117. this.bPublic = false;
  118. } else {
  119. this.bPublic = true;
  120. }
  121. }
  122. }
  123. }
  124. </script>
  125. <style scoped>
  126. @import '../../../assets/icon/iconfont.css';
  127. .form-input {
  128. width: 100%;
  129. border: 1px solid #ece8e8;
  130. line-height: 50rpx;
  131. font-size: 30rpx;
  132. border-radius: 6rpx;
  133. padding: 10rpx 40rpx;
  134. }
  135. .s_content {
  136. margin-top: 100rpx;
  137. }
  138. .title {
  139. width: 200rpx;
  140. line-height: 60rpx;
  141. }
  142. .uni-form-item {
  143. display: flex;
  144. justify-content: space-between;
  145. height: 100rpx;
  146. }
  147. .m_container {
  148. display: flex;
  149. justify-content: space-between;
  150. width: 100%;
  151. height: 100%;
  152. .m_left {
  153. width: 500rpx;
  154. background-color: #fff;
  155. border-right: 10rpx solid #ECECEC;
  156. border-top: 5rpx solid #ECECEC;
  157. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  158. .m_hander {
  159. text-align: center;
  160. background-color: #fff;
  161. height: 600rpx;
  162. position: relative;
  163. // margin: 5rpx 10rpx 10rpx 0;
  164. border-bottom: 8rpx solid #ECECEC;
  165. .m_teacher {
  166. position: absolute;
  167. top: 50%;
  168. left: 50%;
  169. transform: translate(-50%, -50%);
  170. }
  171. .m_teacher_name {
  172. font-size: 1.1rem;
  173. font-weight: 600;
  174. padding: 30rpx 0;
  175. font-family: MicrosoftYaHei;
  176. }
  177. .m_head_portrait {
  178. width: 250rpx;
  179. height: 250rpx;
  180. color: #555555;
  181. }
  182. }
  183. }
  184. .m_right {
  185. width: 100%;
  186. margin-top: 5rpx;
  187. // padding: 0 150rpx;
  188. background-color: #fff;
  189. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  190. .m_right_hander {
  191. text-align: right;
  192. height: 250rpx;
  193. position: relative;
  194. .m_btn_red {
  195. position: absolute;
  196. height: 80rpx;
  197. line-height: 80rpx;
  198. padding: 0 40rpx;
  199. right: 0;
  200. top: 50%;
  201. transform: translateY(-50%);
  202. background: #EA252C;
  203. color: #fff;
  204. }
  205. }
  206. }
  207. .m_menu-icon {
  208. width: 24rpx;
  209. height: 24rpx;
  210. }
  211. .m_menu {
  212. background-color: #fff;
  213. .m_menu-item {
  214. position: relative;
  215. display: flex;
  216. padding: 20rpx 0;
  217. line-height: 90rpx;
  218. font-weight: 500;
  219. border-bottom: 1px solid #DDDDDD;
  220. .m_menu_item_icon {
  221. width: 100rpx;
  222. text-align: right;
  223. margin-right: 15rpx;
  224. }
  225. .m_menu_item_name {
  226. margin-left: 10rpx;
  227. font-weight: 600;
  228. }
  229. .m_act {
  230. background: #FF0019;
  231. width: 8rpx;
  232. border-radius: 0px 200rpx 200rpx 0px;
  233. position: absolute;
  234. height: 90rpx;
  235. top: 20rpx;
  236. left: 0;
  237. }
  238. }
  239. }
  240. .m_act_font .m_menu_item_name {
  241. color: #FF0019;
  242. }
  243. }
  244. .m_edit {
  245. position: absolute;
  246. top: 50%;
  247. left: 50%;
  248. transform: translate(-50%, -50%);
  249. background: rgb(67, 127, 250);
  250. color: rgb(255, 255, 255);
  251. min-width: 130rpx;
  252. }
  253. .m_delete {
  254. position: absolute;
  255. top: 50%;
  256. left: 50%;
  257. min-width: 130rpx;
  258. transform: translate(-50%, -50%);
  259. background: rgb(234, 37, 44);
  260. color: rgb(255, 255, 255);
  261. }
  262. .m_right_footer {
  263. margin-top: 80rpx;
  264. }
  265. .m_paging {
  266. text-align: right;
  267. .m_paging_item {
  268. padding: 10rpx 18rpx;
  269. border: 1rpx solid #DDDDDD;
  270. border-radius: 8rpx;
  271. margin-right: 10rpx;
  272. }
  273. .p_act {
  274. background: #EA252C;
  275. color: #fff;
  276. border: inherit;
  277. }
  278. }
  279. .m_paging_item:hover {
  280. background: #EA252C;
  281. color: #fff;
  282. border: inherit;
  283. }
  284. .m_act1 {
  285. color: #FF0019;
  286. }
  287. .s_logo {
  288. width: 100%;
  289. height: 800rpx;
  290. }
  291. .s_content_container {
  292. padding: 0 600rpx;
  293. .s_title {
  294. font-weight: bold;
  295. text-align: center;
  296. line-height: 200rpx;
  297. font-size: 45rpx;
  298. }
  299. .s_content {
  300. font-weight: 500;
  301. font-size: 40rpx;
  302. line-height: 70rpx;
  303. }
  304. }
  305. .m_btn_download {
  306. height: 80rpx;
  307. line-height: 80rpx;
  308. padding: 0 70rpx;
  309. background: #EA252C;
  310. color: #fff;
  311. font-family: MicrosoftYaHei;
  312. margin-bottom: 80rpx;
  313. }
  314. .s_footer {
  315. margin-top: 80rpx;
  316. }
  317. </style>