create.vue 6.7 KB

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