create.vue 7.3 KB

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