uploadscript.vue 3.7 KB

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