123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <template>
- <view style="position: relative;">
- <!-- 胶囊 -->
- <mvBar :mysNavConfig="mysNavConfig"></mvBar>
- <view :style="{marginTop:navH}"></view>
- <view @click="toRecord()">
- <view style="display: flex;justify-content: center;">
- <image style="height: 60rpx;width: 60rpx;" src="../../static/img/icon-clock.png"></image>
- </view>
- <view style="display: flex;justify-content: center;">
- <p style="font-size: 30rpx;">查看修改/反馈记录</p>
- </view>
- </view>
- <view v-if="!loading && !onlyShow">
- <!-- 多行输入框 -->
- <uni-easyinput type="text" :inputBorder="false" v-model="title" placeholder="在此填写让人眼前一亮的标题吧"
- :placeholderStyle="placeholderStyle">
- </uni-easyinput>
- <view style="padding: 40rpx 30rpx 150rpx;font-size: 12px">
- <textarea v-model="text" maxlength="5000" auto-height="true" placeholder="在此编辑发布脚本/粘贴文字" />
- </view>
- <view class="signup">
- <button type="default" class="but1" :loading="loading" @click="submit()">
- 提交脚本</button>
- </view>
- </view>
-
- <view v-if="onlyShow">
- <p style="font-size: 16px">{{title}}</p>
- <view style="padding: 40rpx 30rpx 150rpx;font-size: 12px">
- <text> {{text}}</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- import mvBar from "@/components/mys_navBar/mysNavBar";
- export default {
- components: {
- mvBar,
- },
- data() {
- return {
- onlyShow: false,
- loading: true,
- placeholderStyle: "font-size:16px",
- navH: getApp().globalData.navHeight,
- taskId: "",
- title: "",
- text: "",
- scriptStatus: "",
- mysNavConfig: {
- /* 开启单页显示首页图标 */
- isHome: true,
- /* 固定导航 */
- navFixed: true,
- /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
- navTitle: {
- text: "上传脚本",
- color: "",
- fontSize: "32rpx", // px upx rpx
- fontWeight: "normal", // 100 - 700
- },
- btnType: "type2",
- onLeftClick: '',
- /* type2 按钮 */
- type2Config: {
- // 左图标
- leftPath: "/static/img/png2.png",
- // 右图标
- rightPath: "/static/img/png4.png",
- // 圆角
- radius: "40rpx",
- },
- },
- }
- },
- onLoad(options) {
- let data = options.textObj.replace(/""/g, "");
- data = JSON.parse(decodeURIComponent(data))
- this.taskId = data.taskId
- this.scriptStatus = data.scriptStatus
- this.getScript()
- },
- methods: {
- async getScript() {
- this.loading = true
- uni.showLoading({
- title: '加载中'
- });
- await this.$https.get('/youngee/c/t/g/get-unsubmit-task-script' +
- "?" +
- "task_id" +
- "=" +
- this.taskId)
- .then(res => {
- console.log(res)
- if (res.data.data != null) {
- this.onlyShow = true
- this.text = res.data.data.content
- this.title = res.data.data.title
- }
- })
- uni.hideLoading();
- this.loading = false
- },
- toRecord() {
- var data = {
- taskId: this.taskId,
- };
- data = JSON.stringify(data)
- uni.navigateTo({
- url: '/pages/workspace/scriptrecord?textObj=' + encodeURIComponent(data)
- });
- },
- async submit() {
- // 检验标题和内容是否为空
- if (this.title == '') {
- uni.showToast({
- title: "请填写脚本标题",
- icon: 'none'
- })
- return
- }
- if (this.text == '') {
- uni.showToast({
- title: "请填写脚本内容",
- icon: 'none'
- })
- return
- }
- let that = this
- uni.showModal({
- title: '提示',
- content: '提交后无法修改并进行审核,确认提交?',
- success: async function(res) {
- if (res.confirm) {
- await that.$https.post('/youngee/c/t/p/add-task-script', {
- task_id: that.taskId,
- title: that.title,
- content: that.text,
- })
- .then(res => {
- console.log(res)
- })
- await that.$https.get('/youngee/c/t/g/submit-task-script' +
- "?" +
- "task_id" +
- "=" +
- that.taskId)
- .then(res => {
- console.log(res)
- })
- uni.navigateBack()
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .signup {
- box-shadow: 0rpx 5rpx 40rpx #ccc;
- width: 100%;
- position: fixed;
- bottom: 0rpx;
- display: flex;
- height: 90rpx;
- padding-top: 2%;
- background-color: #FFFFFF;
- z-index: 100;
- }
- .but1 {
- width: 60%;
- background-color: #f2d22d;
- border-radius: 20rpx;
- font-size: 36rpx;
- line-height: 200%;
- letter-spacing: 10rpx;
- font-weight: 500;
- height: 80%;
- &.on {
- background-color: #C0C0C0;
- }
- }
- </style>
|