uploadscript.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. <view style="margin: 40rpx;">
  16. <textarea v-model="text" placeholder="在此编辑发布脚本/粘贴文字" />
  17. </view>
  18. <view class="signup">
  19. <button type="default" :disabled="isSubmit" class="but1" :loading="loading"
  20. :class="{'on':item.title == '1',}" @click="submit()">
  21. 提交脚本</button>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import mvBar from "@/components/mys_navBar/mysNavBar";
  27. export default {
  28. components: {
  29. mvBar,
  30. },
  31. data() {
  32. return {
  33. taskId: "",
  34. text: "",
  35. scriptStatus: "",
  36. isSubmit: false,
  37. mysNavConfig: {
  38. /* 开启单页显示首页图标 */
  39. isHome: true,
  40. /* 固定导航 */
  41. navFixed: true,
  42. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  43. navTitle: {
  44. text: "上传脚本",
  45. color: "",
  46. fontSize: "32rpx", // px upx rpx
  47. fontWeight: "normal", // 100 - 700
  48. },
  49. btnType: "type2",
  50. onLeftClick: '',
  51. /* type2 按钮 */
  52. type2Config: {
  53. // 左图标
  54. leftPath: "/static/img/png2.png",
  55. // 右图标
  56. rightPath: "/static/img/png4.png",
  57. // 圆角
  58. radius: "40rpx",
  59. },
  60. },
  61. }
  62. },
  63. onLoad(options) {
  64. let data = options.textObj.replace(/""/g, "");
  65. data = JSON.parse(decodeURIComponent(data))
  66. this.taskId = data.taskId
  67. this.scriptStatus = data.scriptStatus
  68. if (this.scriptStatus != 1 && this.scriptStatus != 3) {
  69. this.isSubmit = true
  70. }
  71. },
  72. methods: {
  73. toRecord() {
  74. var data = {
  75. taskId: this.taskId,
  76. };
  77. data = JSON.stringify(data)
  78. uni.navigateTo({
  79. url: '/pages/workspace/scriptrecord?textObj=' + encodeURIComponent(data)
  80. });
  81. },
  82. submit() {
  83. let that = this
  84. uni.showModal({
  85. title: '提示',
  86. content: '提交后无法修改并进行审核,确认提交?',
  87. success: function(res) {
  88. if (res.confirm) {
  89. that.$https.post('/youngee/c/t/p/add-task-script', {
  90. task_id: that.taskId,
  91. content: that.text,
  92. })
  93. .then(res => {
  94. console.log(res)
  95. uni.navigateBack()
  96. })
  97. } else if (res.cancel) {
  98. console.log('用户点击取消');
  99. }
  100. }
  101. });
  102. },
  103. }
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. .signup {
  108. box-shadow: 0rpx 5rpx 40rpx #ccc;
  109. width: 100%;
  110. position: fixed;
  111. bottom: 0rpx;
  112. display: flex;
  113. height: 90rpx;
  114. padding-top: 2%;
  115. background-color: #FFFFFF;
  116. }
  117. .but1 {
  118. width: 60%;
  119. background-color: #f2d22d;
  120. border-radius: 20rpx;
  121. font-size: 36rpx;
  122. line-height: 200%;
  123. letter-spacing: 10rpx;
  124. font-weight: 500;
  125. height: 80%;
  126. &.on {
  127. background-color: #C0C0C0;
  128. }
  129. }
  130. </style>