create.vue 7.4 KB

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