uploadscript.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view style="position: relative;">
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view :style="{marginTop:navH}"></view>
  6. <view @click="toRecord()">
  7. <view style="display: flex;justify-content: center;">
  8. <image style="height: 60rpx;width: 60rpx;" src="../../static/img/icon-clock.png"></image>
  9. </view>
  10. <view style="display: flex;justify-content: center;">
  11. <p style="font-size: 30rpx;">查看修改/反馈记录</p>
  12. </view>
  13. </view>
  14. <!-- 多行输入框 -->
  15. <uni-easyinput type="text" :inputBorder="false" v-model="title" placeholder="在此填写让人眼前一亮的标题吧">
  16. </uni-easyinput>
  17. <view style="padding: 40rpx 30rpx 150rpx;font-size: 32rpx">
  18. <textarea v-model="text" maxlength="5000" auto-height="true" placeholder="在此编辑发布脚本/粘贴文字" />
  19. </view>
  20. <view class="signup">
  21. <button type="default" class="but1" :loading="loading" @click="submit()">
  22. 提交脚本</button>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import mvBar from "@/components/mys_navBar/mysNavBar";
  28. export default {
  29. components: {
  30. mvBar,
  31. },
  32. data() {
  33. return {
  34. navH: getApp().globalData.navHeight,
  35. taskId: "",
  36. title: "",
  37. text: "",
  38. scriptStatus: "",
  39. mysNavConfig: {
  40. /* 开启单页显示首页图标 */
  41. isHome: true,
  42. /* 固定导航 */
  43. navFixed: true,
  44. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  45. navTitle: {
  46. text: "上传脚本",
  47. color: "",
  48. fontSize: "32rpx", // px upx rpx
  49. fontWeight: "normal", // 100 - 700
  50. },
  51. btnType: "type2",
  52. onLeftClick: '',
  53. /* type2 按钮 */
  54. type2Config: {
  55. // 左图标
  56. leftPath: "/static/img/png2.png",
  57. // 右图标
  58. rightPath: "/static/img/png4.png",
  59. // 圆角
  60. radius: "40rpx",
  61. },
  62. },
  63. }
  64. },
  65. onLoad(options) {
  66. let data = options.textObj.replace(/""/g, "");
  67. data = JSON.parse(decodeURIComponent(data))
  68. this.taskId = data.taskId
  69. this.scriptStatus = data.scriptStatus
  70. this.getScript()
  71. },
  72. methods: {
  73. getScript() {
  74. this.$https.get('/youngee/c/t/g/get-unsubmit-task-script' +
  75. "?" +
  76. "task_id" +
  77. "=" +
  78. this.taskId)
  79. .then(res => {
  80. console.log(res)
  81. if (res.data.data != null) {
  82. this.text = res.data.data.content
  83. this.title = res.data.data.title
  84. }
  85. })
  86. },
  87. toRecord() {
  88. var data = {
  89. taskId: this.taskId,
  90. };
  91. data = JSON.stringify(data)
  92. uni.navigateTo({
  93. url: '/pages/workspace/scriptrecord?textObj=' + encodeURIComponent(data)
  94. });
  95. },
  96. submit() {
  97. // 检验标题和内容是否为空
  98. if (this.title == '') {
  99. uni.showToast({
  100. title: "请填写脚本标题",
  101. icon: 'none'
  102. })
  103. return
  104. }
  105. if (this.text == '') {
  106. uni.showToast({
  107. title: "请填写脚本内容",
  108. icon: 'none'
  109. })
  110. return
  111. }
  112. this.$https.post('/youngee/c/t/p/add-task-script', {
  113. task_id: this.taskId,
  114. title: this.title,
  115. content: this.text,
  116. })
  117. .then(res => {
  118. console.log(res)
  119. uni.navigateBack()
  120. })
  121. },
  122. }
  123. }
  124. </script>
  125. <style lang="scss" scoped>
  126. .signup {
  127. box-shadow: 0rpx 5rpx 40rpx #ccc;
  128. width: 100%;
  129. position: fixed;
  130. bottom: 0rpx;
  131. display: flex;
  132. height: 90rpx;
  133. padding-top: 2%;
  134. background-color: #FFFFFF;
  135. z-index: 100;
  136. }
  137. .but1 {
  138. width: 60%;
  139. background-color: #f2d22d;
  140. border-radius: 20rpx;
  141. font-size: 36rpx;
  142. line-height: 200%;
  143. letter-spacing: 10rpx;
  144. font-weight: 500;
  145. height: 80%;
  146. &.on {
  147. background-color: #C0C0C0;
  148. }
  149. }
  150. </style>