点赞点踩接口对接

main
guanxiaohan 11 months ago
parent f61223c889
commit cfaf1cce4f
  1. 4
      common/globalJs/globalJs.js
  2. 3
      pages/index/index.vue
  3. 41
      pages/knowledge/index.vue

@ -2,8 +2,8 @@
// #ifdef APP-PLUS || MP // #ifdef APP-PLUS || MP
// const baseUrl = "http://116.62.210.143:9002"; // const baseUrl = "http://116.62.210.143:9002";
// const baseUrl = "http://118.89.79.160:8800/HiatmpPro"; // const baseUrl = "http://118.89.79.160:8800/HiatmpPro";
// const baseUrl = "http://49.235.207.167:8800/HiatmpPro"; const baseUrl = "http://49.235.207.167:8800/HiatmpPro";
const baseUrl = "http://219.147.31.25:30001/tht-app-api/HiatmpPro"; // const baseUrl = "http://219.147.31.25:30001/tht-app-api/HiatmpPro";
const chatUrl = "http://219.147.31.25:30001/hitap"; const chatUrl = "http://219.147.31.25:30001/hitap";
// #endif // #endif
// #ifdef H5 // #ifdef H5

@ -155,10 +155,11 @@
let datas = { let datas = {
nuserid: this.$.getData('token'), nuserid: this.$.getData('token'),
status: '10', status: '10',
// approve: '1'
} }
this.loadmorestatus = 'loading' this.loadmorestatus = 'loading'
this.$request.globalRequest( this.$request.globalRequest(
`/hiddenDanger/highDanger/getHigDangerDealt?pageNum=${this.page}&pageSize=${10}`, datas, 'POST') `/hiddenDanger/highDanger/getHigDangerDealt?pageNum=${this.page}&pageSize=${10}&approve=${'1'}`, datas, 'POST')
.then(res => { .then(res => {
this.loadmorestatus = 'loadmore' this.loadmorestatus = 'loadmore'
if (res.code === 200) { if (res.code === 200) {

@ -37,8 +37,17 @@
<zeroMarkdownView :markdown="item.data" /> <zeroMarkdownView :markdown="item.data" />
<!-- <ua-markdown :source="mdvalue" /> --> <!-- <ua-markdown :source="mdvalue" /> -->
<view class="icon" v-show="item.answerId != '0' && item.isOver && item.isSuccess"> <view class="icon" v-show="item.answerId != '0' && item.isOver && item.isSuccess">
<uni-icons :type="iconsType == '' ? 'hand-up' : (iconsType == 'handUp' ? 'hand-up-filled' : 'hand-up')" :color="iconsType == 'handUp' ? '#FFD131' : ''" size="22" @click="clickIcon('handUp')"></uni-icons> <uni-icons
<uni-icons :type="iconsType == '' ? 'hand-down' : (iconsType == 'handDown' ? 'hand-down-filled' : 'hand-down')" size="22" @click="clickIcon('handDown')"></uni-icons> :type="iconsType == '' ? 'hand-up' : (iconsType == 'handUp' ? 'hand-up-filled' : 'hand-up')"
:color="iconsType == 'handUp' ? '#FFD131' : ''"
size="22"
@click="clickIcon('handUp', item.qaId)">
</uni-icons>
<uni-icons
:type="iconsType == '' ? 'hand-down' : (iconsType == 'handDown' ? 'hand-down-filled' : 'hand-down')"
size="22"
@click="clickIcon('handDown', item.qaId)">
</uni-icons>
</view> </view>
</view> </view>
</view> </view>
@ -157,7 +166,7 @@
} }
}, },
methods: { methods: {
clickIcon(type) { async clickIcon(type, qaId) {
if(this.iconsType == '') { if(this.iconsType == '') {
this.iconsType = type this.iconsType = type
} else { } else {
@ -176,11 +185,28 @@
} }
} }
const params = { const params = {
qaId: '', qaId,
feedbackStatus : this.iconsType == '' ? 0 : (this.iconsType == 'handUp' ? 1 : 2), feedbackStatus : this.iconsType == '' ? 0 : (this.iconsType == 'handUp' ? 1 : 2),
feedbackInfo: '' feedbackInfo: ''
} }
// this.$request.globalRequest('/hitapChat/hitap/feadBack', params, 'POST').then(res => {}) // this.$request.globalRequest('/hitap/feadBack', params, 'POST').then(res => {
// })
const [err, res] = await uni.request({
url: this.$.chatUrl + "/feadBack",
dataType: "json",
method: "POST",
headers: {
"content-type": "application/json",
},
data: params
})
uni.showToast({
title: res.data.result,
// icon: 'success',
duration: 2000
});
}, },
handleTouchStart(e) { handleTouchStart(e) {
// //
@ -280,7 +306,7 @@
// this.active = data.tabkey - 1 > 0 ? data.tabkey - 1 : 0; // this.active = data.tabkey - 1 > 0 ? data.tabkey - 1 : 0;
// } // }
if (res.data.result) { if (res.data.result) {
this.changeMsgList("1", res.data.result); this.changeMsgList("1", res.data.result, res.data.qaId);
} }
this.loading = false; this.loading = false;
} else { } else {
@ -320,7 +346,7 @@
this.inputValue = ""; this.inputValue = "";
}, },
// //
changeMsgList(answerId, data) { changeMsgList(answerId, data, qaId) {
data = data.replace("undefined", '') data = data.replace("undefined", '')
data = data.replace("null", '') data = data.replace("null", '')
let id = 1; let id = 1;
@ -339,6 +365,7 @@
{ {
id, id,
answerId, answerId,
qaId,
data: newdata, data: newdata,
isSuccess: true, isSuccess: true,
}, },

Loading…
Cancel
Save