uploadscript.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <view style="position: relative;">
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view style="margin-top: 160rpx;"></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. taskId: "",
  35. title: "",
  36. text: "",
  37. scriptStatus: "",
  38. mysNavConfig: {
  39. /* 开启单页显示首页图标 */
  40. isHome: true,
  41. /* 固定导航 */
  42. navFixed: true,
  43. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  44. navTitle: {
  45. text: "上传脚本",
  46. color: "",
  47. fontSize: "32rpx", // px upx rpx
  48. fontWeight: "normal", // 100 - 700
  49. },
  50. btnType: "type2",
  51. onLeftClick: '',
  52. /* type2 按钮 */
  53. type2Config: {
  54. // 左图标
  55. leftPath: "/static/img/png2.png",
  56. // 右图标
  57. rightPath: "/static/img/png4.png",
  58. // 圆角
  59. radius: "40rpx",
  60. },
  61. },
  62. }
  63. },
  64. onLoad(options) {
  65. let data = options.textObj.replace(/""/g, "");
  66. data = JSON.parse(decodeURIComponent(data))
  67. this.taskId = data.taskId
  68. this.scriptStatus = data.scriptStatus
  69. this.getScript()
  70. },
  71. methods: {
  72. getScript() {
  73. this.$https.get('/youngee/c/t/g/get-unsubmit-task-script' +
  74. "?" +
  75. "task_id" +
  76. "=" +
  77. this.taskId)
  78. .then(res => {
  79. console.log(res)
  80. if (res.data.data != null) {
  81. this.text = res.data.data.content
  82. this.title = res.data.data.title
  83. }
  84. })
  85. },
  86. toRecord() {
  87. var data = {
  88. taskId: this.taskId,
  89. };
  90. data = JSON.stringify(data)
  91. uni.navigateTo({
  92. url: '/pages/workspace/scriptrecord?textObj=' + encodeURIComponent(data)
  93. });
  94. },
  95. submit() {
  96. // 检验标题和内容是否为空
  97. if (this.title == '') {
  98. uni.showToast({
  99. title: "请填写脚本标题",
  100. icon: 'none'
  101. })
  102. return
  103. }
  104. if (this.text == '') {
  105. uni.showToast({
  106. title: "请填写脚本内容",
  107. icon: 'none'
  108. })
  109. return
  110. }
  111. this.$https.post('/youngee/c/t/p/add-task-script', {
  112. task_id: this.taskId,
  113. title: this.title,
  114. content: this.text,
  115. })
  116. .then(res => {
  117. console.log(res)
  118. uni.navigateBack()
  119. })
  120. },
  121. }
  122. }
  123. </script>
  124. <style lang="scss" scoped>
  125. .signup {
  126. box-shadow: 0rpx 5rpx 40rpx #ccc;
  127. width: 100%;
  128. position: fixed;
  129. bottom: 0rpx;
  130. display: flex;
  131. height: 90rpx;
  132. padding-top: 2%;
  133. background-color: #FFFFFF;
  134. z-index: 100;
  135. }
  136. .but1 {
  137. width: 60%;
  138. background-color: #f2d22d;
  139. border-radius: 20rpx;
  140. font-size: 36rpx;
  141. line-height: 200%;
  142. letter-spacing: 10rpx;
  143. font-weight: 500;
  144. height: 80%;
  145. &.on {
  146. background-color: #C0C0C0;
  147. }
  148. }
  149. </style>