hejianhao
2025-04-16 dab2d210ca06c1faa514c6388fbd5de1ab355360
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<template>
  <div class='wish_examine'>
    <div class="w_row clearfix">
      <p class="w_col_12">发起人名称:{{detail.sponsorName}}</p>
      <p class="w_col_12">发起人手机号:{{detail.sponsorPhone}}</p>
      <!-- <p class="w_col_24">心愿名称:{{detail.wishName}}</p> -->
      <p class="w_col_24">心愿详情:{{detail.detail}}</p>
      <section class="w_col_24 image">
        <span class="img-list" v-for="(i,j) in (detail.photoPathList || '').split(',').filter(k=>{return k!==''})" :key="j+'-image'">
          <img
            :src="i"
            alt=""
            @click="onScaleImage(j,'photoPathList')"
          >
        </span>
        </section>
    </div>
    <section>
      <p class="label">审核状态:</p>
      <article>
        <el-radio
          v-model="a1"
          label="1"
        >审核通过</el-radio>
        <el-radio
          v-model="a1"
          label="2"
        >驳回</el-radio>
      </article>
    </section>
    <section v-if="a1==='1'">
      <p class="label">目标集心数量:</p>
      <el-input-number v-model="aimNum" @change="handleChangeNum" :min="1" :max="10000"  label="描述文字"></el-input-number>
    </section>
    <section v-if="a1==='2'">
      <p class="label"></p>
      <article>
        <el-input
          type="textarea"
          class="kui-height m_inp"
          placeholder="请输入反馈内容,不超过200字"
          v-model="text"
          cols="5"
          rows="3"
          maxlength="200"
          show-word-limit
        ></el-input>
      </article>
    </section>
    <div v-if ="num !== detailId.length" class="next" @click="nextDetails">点击下一条</div>
  </div>
</template>
 
<script>
export default {
  props: {
    item: {
      type: Object,
      default: () => {
        return {};
      },
    },
    door: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  components: {},
  data() {
    return { 
      detail: {}, 
      text: "",
      a1: "1" ,
      aimNum:"", 
      detailId:[],
      num:0,
      };
  },
  watch: {
    item: {
      handler() {
        this.setItem();
      },
      deep: true,
    },
    door: {
      handler(n) {
        if (n.r) {
          this.sub(n.t);
        }
      },
      deep: true,
    },
  },
  methods: {
    // 查看大图
    onScaleImage(j) {
      let list = (this.detail.photoPathList || "").split(",").filter((k) => {
        return k !== "";
      });
      this.$store.dispatch("setImage", {
        time: Date.now(),
        pic: list[j],
        list,
        tool: true,
      });
    },
    sub(type) {
      /** 处理完所以下一条点确定,就隐藏 */
      if(this.detailId.length < 0) {
        console.log("sssss")
        this.onClose(type);
        return void 0;
      }
      let o = {
        id: this.detail.id,
        type: this.a1,
        examineAt: demo.timeout("", "alls", "-"),
        wishName: this.detail.wishName,
        aimNum:this.aimNum,
      };
      if (+this.a1 === 2) {
        if (!this.text) {
          demo.toast("请输入驳回原因");
          return 0;
        }
        o.rejectReason = this.text;
      }
      this.$api.put("communityactivity/putmicrowish", o, () => {
        if(o.type == '1') {
          demo.toast("审核成功");
          this.text = "";
          this.aimNum = '1';
        } else {
          demo.toast("驳回成功");
        }
  
        this.nextDetails();
        this.$store.dispatch("setPageReset", "/act_wish");
        // this.$nextTick(() => {
        //   this.$store.dispatch("setFixed", {
        //     event: "del",
        //     type: type,  
        //     time: Date.now(),
        //   });
        //   this.$store.dispatch("setPageReset", "/act_wish");
        // });
      });
    },
 
    setItem() {
      if (this.item.id) {
        this.$api.get(
          "communityactivity/detailmicrowish",
          { id: this.item.id },
          (e) => {
            this.detail = e;
            this.detailId = e.idList; //查询下一条的所有Id
            this.removeByValue(this.detailId, this.item.id);
             console.log('=====',this.detailId.length)
          }
        );
      } else {
        demo.toast("错误活动");
      }
    },
 
    // 删除数组指定的元素
    removeByValue(arr, val) {
      for(var i = 0; i < arr.length; i++) {
        if(arr[i] == val) {
        arr.splice(i, 1);
        break;
        }
      }
    },
 
 
    handleChangeNum(value) {
      console.log(value);
    },
 
    //下一条
    nextDetails() {
      // if(this.num == this.detailId.length) {
      //   this.onClose();
      //   return void 0;
      // }
      if(this.num < this.detailId.length) {
        this.num = this.num +1;
        this.getDetail();
      } else {
        this.onClose();       
      }
    },
 
    //获取详情
    getDetail() {
      this.text = "";
      this.aimNum = '1';
      this.$api.get(
        "communityactivity/detailmicrowish",
        { id: this.detailId[this.num-1]  },
        (e) => {
           this.detail = e;
        }
      );
    },
 
    onClose () {
      let type = "wish-examine"
      this.$nextTick(() => {
        this.$store.dispatch("setFixed", {
          event: "del",
          type: type,
          time: Date.now(),
        });
        this.$store.dispatch("setPageReset", "/act_wish");
      });
    },
 
  },
  mounted() {
    this.setItem();
  },
};
</script>
<style lang='less' scoped>
.wish_examine {
  .next {
    font-size: 16px;
    color: #409EFF;
    font-weight: 500;
    text-align: right;
    cursor: pointer;
    position: absolute;
    right: 20px;
    bottom: 20px;
  }
  p {
    font-size: 14px;
    line-height: 22px;
    color: #222;
    margin-bottom: 10px;
    padding-left: 10px;
  }
  .el-radio {
    width: 100px;
  }
  .m_inp {
    margin-bottom: 5px;
    width: 370px;
    height: 100%;
  }
  section {
    display: flex;
    margin-bottom: 5px;
    .label {
      width: 100px;
    }
    article {
      width: calc(~"100% - 100px");
    }
  }
  .image {
    flex-wrap: wrap;
    box-sizing: border-box;
    padding: 0 15px;
    .img-list {
      display: block;
      width: 55px;
      height: 45px;
      margin: 5px 5px 0 0;
      overflow: hidden;
        img {
        width: 100%;
        object-fit: cover;
      }
    }
  }
}
</style>