create.vue 7.4 KB

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