create.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  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. }
  102. });
  103. }
  104. });
  105. },
  106. clear() {
  107. this.model = {
  108. createUserID: undefined,
  109. projectName: "",
  110. describe: "",
  111. type: "科幻",
  112. }
  113. },
  114. bindPickerChange_proType: function(e) {
  115. this.index_proType = e.target.value;
  116. this.model.type = this.proType[this.index_proType];
  117. console.log(this.model)
  118. },
  119. }
  120. }
  121. </script>
  122. <style scoped>
  123. @import '../../../assets/icon/iconfont.css';
  124. .form-input {
  125. width: 100%;
  126. border: 1px solid #ece8e8;
  127. line-height: 50rpx;
  128. font-size: 30rpx;
  129. border-radius: 6rpx;
  130. padding: 10rpx 40rpx;
  131. }
  132. .s_content {
  133. margin-top: 100rpx;
  134. }
  135. .title {
  136. width: 200rpx;
  137. line-height: 60rpx;
  138. }
  139. .uni-form-item {
  140. display: flex;
  141. justify-content: space-between;
  142. height: 100rpx;
  143. }
  144. .m_container {
  145. display: flex;
  146. justify-content: space-between;
  147. width: 100%;
  148. height: 100%;
  149. .m_left {
  150. width: 500rpx;
  151. background-color: #fff;
  152. border-right: 10rpx solid #ECECEC;
  153. border-top: 5rpx solid #ECECEC;
  154. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  155. .m_hander {
  156. text-align: center;
  157. background-color: #fff;
  158. height: 600rpx;
  159. position: relative;
  160. // margin: 5rpx 10rpx 10rpx 0;
  161. border-bottom: 8rpx solid #ECECEC;
  162. .m_teacher {
  163. position: absolute;
  164. top: 50%;
  165. left: 50%;
  166. transform: translate(-50%, -50%);
  167. }
  168. .m_teacher_name {
  169. font-size: 1.1rem;
  170. font-weight: 600;
  171. padding: 30rpx 0;
  172. font-family: MicrosoftYaHei;
  173. }
  174. .m_head_portrait {
  175. width: 250rpx;
  176. height: 250rpx;
  177. color: #555555;
  178. }
  179. }
  180. }
  181. .m_right {
  182. width: 100%;
  183. margin-top: 5rpx;
  184. // padding: 0 150rpx;
  185. background-color: #fff;
  186. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  187. .m_right_hander {
  188. text-align: right;
  189. height: 250rpx;
  190. position: relative;
  191. .m_btn_red {
  192. position: absolute;
  193. height: 80rpx;
  194. line-height: 80rpx;
  195. padding: 0 40rpx;
  196. right: 0;
  197. top: 50%;
  198. transform: translateY(-50%);
  199. background: #EA252C;
  200. color: #fff;
  201. }
  202. }
  203. }
  204. .m_menu-icon {
  205. width: 24rpx;
  206. height: 24rpx;
  207. }
  208. .m_menu {
  209. background-color: #fff;
  210. .m_menu-item {
  211. position: relative;
  212. display: flex;
  213. padding: 20rpx 0;
  214. line-height: 90rpx;
  215. font-weight: 500;
  216. border-bottom: 1px solid #DDDDDD;
  217. .m_menu_item_icon {
  218. width: 100rpx;
  219. text-align: right;
  220. margin-right: 15rpx;
  221. }
  222. .m_menu_item_name {
  223. margin-left: 10rpx;
  224. font-weight: 600;
  225. }
  226. .m_act {
  227. background: #FF0019;
  228. width: 8rpx;
  229. border-radius: 0px 200rpx 200rpx 0px;
  230. position: absolute;
  231. height: 90rpx;
  232. top: 20rpx;
  233. left: 0;
  234. }
  235. }
  236. }
  237. .m_act_font .m_menu_item_name {
  238. color: #FF0019;
  239. }
  240. }
  241. .m_edit {
  242. position: absolute;
  243. top: 50%;
  244. left: 50%;
  245. transform: translate(-50%, -50%);
  246. background: rgb(67, 127, 250);
  247. color: rgb(255, 255, 255);
  248. min-width: 130rpx;
  249. }
  250. .m_delete {
  251. position: absolute;
  252. top: 50%;
  253. left: 50%;
  254. min-width: 130rpx;
  255. transform: translate(-50%, -50%);
  256. background: rgb(234, 37, 44);
  257. color: rgb(255, 255, 255);
  258. }
  259. .m_right_footer {
  260. margin-top: 80rpx;
  261. }
  262. .m_paging {
  263. text-align: right;
  264. .m_paging_item {
  265. padding: 10rpx 18rpx;
  266. border: 1rpx solid #DDDDDD;
  267. border-radius: 8rpx;
  268. margin-right: 10rpx;
  269. }
  270. .p_act {
  271. background: #EA252C;
  272. color: #fff;
  273. border: inherit;
  274. }
  275. }
  276. .m_paging_item:hover {
  277. background: #EA252C;
  278. color: #fff;
  279. border: inherit;
  280. }
  281. .m_act1 {
  282. color: #FF0019;
  283. }
  284. .s_logo {
  285. width: 100%;
  286. height: 800rpx;
  287. }
  288. .s_content_container {
  289. padding: 0 600rpx;
  290. .s_title {
  291. font-weight: bold;
  292. text-align: center;
  293. line-height: 200rpx;
  294. font-size: 45rpx;
  295. }
  296. .s_content {
  297. font-weight: 500;
  298. font-size: 40rpx;
  299. line-height: 70rpx;
  300. }
  301. }
  302. .m_btn_download {
  303. height: 80rpx;
  304. line-height: 80rpx;
  305. padding: 0 70rpx;
  306. background: #EA252C;
  307. color: #fff;
  308. font-family: MicrosoftYaHei;
  309. margin-bottom: 80rpx;
  310. }
  311. .s_footer {
  312. margin-top: 80rpx;
  313. }
  314. </style>