create.vue 7.0 KB

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