Parcourir la source

修改满意度评价

yxb
DESKTOP-2IO5MST\huting il y a 1 an
Parent
révision
cc3ccd39a9

+ 8
- 9
components/viewfinder.vue Voir le fichier

@@ -1,6 +1,6 @@
<template>
<view style="width: 100%;height: 100vh;position: fixed;left: 0;top:0;z-index: 111111;">
<view class="viewfinder" >
<view class="viewfinder">
<view v-if="phoneType == 1"
style="display: flex;align-items: center;justify-content: flex-end;width: 100%;height: 100%;">
<image src="/static/image/etc_bd_ocr_id_card_locator_front.png"
@@ -22,17 +22,17 @@

</view>
</view>
</view>
<!-- camera -->
<camera v-if="showStartPhoto" id="camera" style="height: 70vh;width: 100vh;background-color: black;width: 100%;"
mode="normal" :device-position="cameraPosition" :flash="flash" @stop="cameraStop" @error="cameraError" />

<view v-if="!showStartPhoto" style="height: 70vh;background-color: black;">
<image
style="position: absolute;top: 20%;left: 10%;touch-action: none;" :src="srcImg"
<image style="position: absolute;top: 20%;left: 10%;touch-action: none;" :src="srcImg"
@touchstart="handleTouchStart" @touchmove="handleTouchMove" @touchend="handleTouchEnd"
:style="{ transform: `translate(${offsetX}px, ${offsetY}px) rotate(${rotateDegree}deg) scale(${scale})`, transition: 'transform ' + transitionDuration + 's' }"></image>
:style="{ transform: `translate(${offsetX}px, ${offsetY}px) rotate(${rotateDegree}deg) scale(${scale})`, transition: 'transform ' + transitionDuration + 's' }">
</image>
</view>

<view style="background-color: #A5A5A5;top: 60%;width: 100%;height: 40%;position: absolute;">
@@ -140,8 +140,8 @@
};

function updateScale() {
// 计算缩放的增量
const scales = (touchMoveDistance.value - touchStartDistance.value) * scaleStep;
// 计算缩放的增量
const scales = (touchMoveDistance.value - touchStartDistance.value) * scaleStep;
scale.value = Math.max(0.5, Math.min(scale.value + scales, 1)); // 设置缩放的范围,这里设置最小为1,最大为3
}

@@ -163,10 +163,9 @@
console.log('拍照成功:', res.tempImagePath);
srcImg.value = res.tempImagePath
// showStartPhoto.value = false
// // #ifdef MP-ALIPAY
cameraContext.stopRecord();
emit('confirmReturn', res)
// // #endif
console.log("1111")
},
fail: (error) => {
console.error('拍照失败:', error);

+ 9
- 3
pages/recharge/recharge.vue Voir le fichier

@@ -231,10 +231,16 @@
state.transWay = evt.detail.value; //“blu”为蓝牙充值方式、“nfc”为NFC充值方式
}
function go() {
function go(money) {
let content = ""
if (money) {
content = '待消费订单' + money + '元'
} else {
content = '待消费订单'
}
uni.showModal({
title: '提示',
content: '待消费订单',
content: content,
showCancel: false,
success: (res) => {
if (res.confirm) {
@@ -292,7 +298,7 @@
state.orderNum = checkResult.orders[0].orderNum;
setItem("orderNum", state.orderNum);
//链接蓝牙
go()
go(state.money)
} else {
cardCzApplyAction().then((applyResult : any) => {
//拿到订单 存起来

+ 3
- 4
subpackage/after-sale/account-change/result.vue Voir le fichier

@@ -31,11 +31,10 @@
const getCode = () => {
console.log(123);
}
const submit=()=>{
const submit = () => {
console.log(11);
uni.redirectTo({
// url: '/pages/service/service'
});
}
</script>
@@ -98,4 +97,4 @@
left: 50%;
transform: translate(-50%);
}
</style>
</style>

+ 0
- 1
subpackage/after-sale/activation-once-again/activation-once-again.vue Voir le fichier

@@ -189,7 +189,6 @@

const cancel = () => {
state.showPopup = false;
// navTo("/pages/service/service")
uni.navigateBack({
delta: 2
})

+ 4
- 1
subpackage/after-sale/card-Renewal/renewal-confirm.vue Voir le fichier

@@ -277,7 +277,10 @@

//返回列表
const toBack = () => {
navTo("/pages/service/service")
uni.redirectTo({
url: "/pages/service/service"
})
// navTo("/pages/service/service")
}

//关闭弹窗

+ 3
- 4
subpackage/after-sale/card-release-pending/result.vue Voir le fichier

@@ -31,11 +31,10 @@
const getCode = () => {
console.log(123);
}
const submit=()=>{
const submit = () => {
console.log(11);
uni.redirectTo({
// url: '/pages/service/service'
});
}
</script>
@@ -98,4 +97,4 @@
left: 50%;
transform: translate(-50%);
}
</style>
</style>

+ 44
- 43
subpackage/orders/apply-ex-goods-step1.vue Voir le fichier

@@ -73,40 +73,40 @@

})
//接受通过该id查询订单详情
const oldId=ref('')
const oldId = ref('')

const applyType = ref('')
//选择器数据
const columns = [{
label: '换货-换卡',
// 其他属性值
id: 'CARD '
},
{
label: '换货-换签',
// 其他属性值
id: 'OBU'
},
{
label: '换货-换卡签',
// 其他属性值
id: 'ALL'
},
{
label: '换卡签-换卡',
// 其他属性值
id: 'EXCHANGE_CARD'
},
{
label: '换卡签-换签',
// 其他属性值
id: 'EXCHANGE_OBU'
},
{
label: '换卡签-换卡签',
// 其他属性值
id: 'EXCHANGE_ALL'
},
label: '换货-换卡',
// 其他属性值
id: 'CARD '
},
{
label: '换货-换签',
// 其他属性值
id: 'OBU'
},
{
label: '换货-换卡签',
// 其他属性值
id: 'ALL'
},
// {
// label: '换卡签-换卡',
// // 其他属性值
// id: 'EXCHANGE_CARD'
// },
// {
// label: '换卡签-换签',
// // 其他属性值
// id: 'EXCHANGE_OBU'
// },
// {
// label: '换卡签-换卡签',
// // 其他属性值
// id: 'EXCHANGE_ALL'
// },
]

// 验证规则
@@ -133,14 +133,14 @@

// 单选数据列表
const radiolist1 = reactive([{
name: 1,
disabled: '有卡注销'
},
{
name: 2,
disabled: '无卡注销'
},
], )
name: 1,
disabled: '有卡注销'
},
{
name: 2,
disabled: '无卡注销'
},
])



@@ -148,7 +148,7 @@
let show = ref(false)

// 打开地区先择器
const showPicker = function() {
const showPicker = function () {
show.value = true
}
// 确定地区
@@ -181,7 +181,7 @@
// const data = stringToJson(res.bizContent);
// console.log(data);
// // navTo(`/orders/apply-ex-goods?orderId=${oldId.value}&id=${data.id}`)
// });
} else if (!form.applyType) {
uni.showToast({
@@ -211,7 +211,7 @@

onLoad((option) => {
form.orderId = option.orderId
oldId.value=option.id
oldId.value = option.id
console.log(form);
});
</script>
@@ -256,7 +256,8 @@
::v-deep .input {
text-align: right;
flex: 1;
background: transparent;
background: transparent;

input {
text-align: right;
}
@@ -298,4 +299,4 @@
margin: 26px auto;
font-size: 32rpx;
}
</style>
</style>

+ 1
- 1
subpackage/orders/choice-product.vue Voir le fichier

@@ -137,7 +137,7 @@
console.log("option选择产品列表", option)
});
onShow(() => {
productList();
// productList();
})
// 产品列表
const productList = () => {

+ 1
- 1
subpackage/orders/opening-account-people.vue Voir le fichier

@@ -598,10 +598,10 @@
state.phoneType = val;
}
const confirmReturn = (val) => {
console.log("图片地址val", val)
state.phoneType = 0
state.isTakePhotoModeShow = false
var imageType = state.choiceIndex;
console.log("图片地址val", val.tempImagePath)
// uploadFile(val.tempImagePath, imageType, ocrAllQuery).then((data) => {
uploadFile(val.tempImagePath, imageType, etcOcrCard).then((data) => {
console.log("身份证上传", data)

+ 6
- 1
subpackage/orders/product-detail.vue Voir le fichier

@@ -166,7 +166,12 @@
if (state.typeScanCode == 2) {
console.log("state.typeScanCode", state.typeScanCode)
// 扫码进来
agreementConfirm();
if (state.checked) {
agreementConfirm();
} else {
msg("请勾选协议");
}

} else {
console.log("state.checked", state.checked)
if (state.checked) {

+ 25
- 17
subpackage/personal-center/remind/components/evaluate-tab-item.vue Voir le fichier

@@ -1,8 +1,8 @@
<!-- 评价列表筛选 item -->
<template>
<view class="tabs">
<view class="tab as-gravity-center" v-for="(tab,index) in tabs" :key="index"
:class="curIndex === index ? 'active' : 'normal'" @click="tabClickHandle(tab,index)">
<view class="tab as-gravity-center" v-for="(tab,index) in tabs" :key="index"
:class="curIndex === index ? 'active' : 'normal'" @click="tabClickHandle(tab,index)">
{{tab}}
</view>
</view>
@@ -11,34 +11,40 @@
<script setup lang="ts">
import { ref } from "vue";
defineProps({
tabs:{
type:Array,
default:() => {
tabs: {
type: Array,
default: () => {
return [];
}
}
})
const curIndex = ref(0);
const emit = defineEmits(['tabClick'])
const tabClickHandle = (item,index) =>{
const tabClickHandle = (item, index) => {
curIndex.value = index;
emit('tabClick',item);
emit('tabClick', item);
}
</script>

<style lang="scss" scoped>
.tabs{
.tabs {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
margin-right: -30rpx;
margin-top: -16rpx;
.tab{
// margin-right: -30rpx;
// margin-top: -16rpx;
padding: 30rpx;
background-color: white;
position: fixed;
left: 0;
top: 0;
box-sizing: border-box;
width: 100%;

.tab {
font-size: 24rpx;
min-width: 135rpx;
height: 52rpx;
@@ -46,12 +52,14 @@
margin-right: 30rpx;
margin-top: 16rpx;
}
.normal{

.normal {
color: #333333;
background-color: white;
border: 1px solid #999999;
}
.active{

.active {
color: white;
background: #00B38B;
}

+ 174
- 186
subpackage/personal-center/remind/evaluate-list.vue Voir le fichier

@@ -1,204 +1,192 @@
<!-- 评价列表 -->
<template>
<view style="padding: 30rpx">
<evaluate-tab-item :tabs="state.tabs" @tabClick="tabClick" />
<evaluate-tab-item :tabs="state.tabs" @tabClick="tabClick" />
<view style="padding: 30rpx;margin-top: 90rpx;">

<view class="list" :class="state.type === '2' ? 'btn-divider' : ''">
<evaluate-issue-item
:dataList="state.dataList"
v-if="state.type === '1'"
/>
<evaluate-business-item
:dataList="state.dataList"
v-if="state.type === '2'"
/>
<evaluate-equity-item
:dataList="state.dataList"
v-if="state.type === '3'"
/>
<evaluate-salesman-item
:dataList="state.dataList"
v-if="state.type === '4'"
/>
</view>
</view>

<view class="evaluate-btn" v-if="state.type === '2'">
<submit-button
title="去评价"
@submit="goOrder()"
></submit-button>
</view>
<view class="list" :class="state.type === '2' ? 'btn-divider' : ''">
<evaluate-issue-item :dataList="state.dataList" v-if="state.type === '1'" />
<evaluate-business-item :dataList="state.dataList" v-if="state.type === '2'" />
<evaluate-equity-item :dataList="state.dataList" v-if="state.type === '3'" />
<evaluate-salesman-item :dataList="state.dataList" v-if="state.type === '4'" />
</view>
<view class="bottom-line" v-if="state.flags">我是有底线的~~~</view>
</view>

<view class="evaluate-btn" v-if="state.type === '2'">
<submit-button title="去评价" @submit="goOrder()"></submit-button>
</view>
</template>

<script setup lang="ts">
import evaluateTabItem from "./components/evaluate-tab-item";
import evaluateIssueItem from "./components/evaluate-issue-item";
import evaluateEquityItem from "./components/evaluate-equity-item";
import evaluateBusinessItem from "./components/evaluate-business-item";
import evaluateSalesmanItem from "./components/evaluate-salesman-item";
import { onLoad } from "@dcloudio/uni-app";
import { reactive } from "vue";
import { request } from "@/utils/network/request";
import { stringToJson } from "@/utils/network/encryption";
import { satisfactionEvaluation } from "@/utils/network/api";
const state = reactive({
type: "", //评价列表类型 1-发行产品评价 2-业务办理满意度评价 3-权益产品评价 4-业务员满意度评价(暂无UI)
tabs: ["全部", "好评", "中评", "差评"],
curCheckTab: "全部", //当前选择的tab
dataList: [], //评价列表
scoreLevel:0, //0 全部 1 好评 2 中评 3 差评
serviceType:'',
});
import evaluateTabItem from "./components/evaluate-tab-item";
import evaluateIssueItem from "./components/evaluate-issue-item";
import evaluateEquityItem from "./components/evaluate-equity-item";
import evaluateBusinessItem from "./components/evaluate-business-item";
import evaluateSalesmanItem from "./components/evaluate-salesman-item";
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
import { reactive } from "vue";
import { request } from "@/utils/network/request";
import { stringToJson } from "@/utils/network/encryption";
import { satisfactionEvaluation } from "@/utils/network/api";
import { getItem, StorageKeys } from "@/utils/storage";
const state = reactive({
type: "", //评价列表类型 1-发行产品评价 2-业务办理满意度评价 3-权益产品评价 4-业务员满意度评价(暂无UI)
tabs: ["全部", "好评", "中评", "差评"],
curCheckTab: "全部", //当前选择的tab
dataList: [], //评价列表
scoreLevel: 0, //0 全部 1 好评 2 中评 3 差评
serviceType: '',
pageNo: 1,
pageSize: 10,
flags: false,
});

onLoad((options) => {
console.log("options",options)
state.type = options.type;
uni.setNavigationBarTitle({
title: options.title,
});
// if (state.type === "2") {
// state.tabs = [...state.tabs, "业务类型"];
// }
onLoad((options) => {
console.log("options", options)
state.type = options.type;
uni.setNavigationBarTitle({
title: options.title,
});
// if (state.type === "2") {
// state.tabs = [...state.tabs, "业务类型"];
// }

fetchList();
});
const goOrder=()=>{
uni.switchTab({
url:"/pages/order/order"
})
}
/* tab点击 */
const tabClick = (tab) => {
console.log("tab",tab)
state.curCheckTab = tab;
if(tab=='全部'){
state.scoreLevel=0
}else if(tab=='好评'){
state.scoreLevel=1
}else if(tab=='中评'){
state.scoreLevel=2
}else{
state.scoreLevel=3
fetchList(1);
});
const goOrder = () => {
uni.switchTab({
url: "/pages/order/order"
})
}
requestData("11", { type: state.curCheckTab });
};
/* tab点击 */
const tabClick = (tab) => {
state.flags = false;
console.log("tab", tab)
state.curCheckTab = tab;
if (tab == '全部') {
state.scoreLevel = 0
} else if (tab == '好评') {
state.scoreLevel = 1
} else if (tab == '中评') {
state.scoreLevel = 2
} else {
state.scoreLevel = 3
}
requestData("11", { type: state.curCheckTab }, 1);
};

/* 根据不同条件获取数据 */
const fetchList = () => {
switch (state.type) {
case "1": //发行产品评价
state.serviceType='product';
requestData("11", { type: state.curCheckTab });
break;
case "2": //业务办理满意度评价
state.serviceType='service';
requestData("22", { type: state.curCheckTab });
break;
case "3": //权益产品评价
state.serviceType='equity';
requestData("33", { type: state.curCheckTab });
break;
case "4": //业务员满意度评价
state.serviceType='staff';
requestData("44", { type: state.curCheckTab });
break;
default:
break;
}
};
/* 根据不同条件获取数据 */
const fetchList = (params) => {
switch (state.type) {
case "1": //发行产品评价
state.serviceType = 'product';
requestData("11", { type: state.curCheckTab }, params);
break;
case "2": //业务办理满意度评价
state.serviceType = 'service';
requestData("22", { type: state.curCheckTab }, params);
break;
case "3": //权益产品评价
state.serviceType = 'equity';
requestData("33", { type: state.curCheckTab }, params);
break;
case "4": //业务员满意度评价
state.serviceType = 'staff';
requestData("44", { type: state.curCheckTab }, params);
break;
default:
break;
}
};

/*请求评价列表*/
const requestData = (code, data) => {
const options = {
type: 2,
data: {
"serviceType":state.serviceType,
"scoreLevel":state.scoreLevel,
},
method: "POST",
showLoading: true,
};
request(satisfactionEvaluation,options).then((res)=>{
//若不填评价内容,根据打分规则自动填充评价内容
//差评展示:默认差评 2.5分及以下
//中评展示:默认中评 2.5以上4.0以下
//好评展示:默认好评 4.0及4.0以上
const data=stringToJson(res.bizContent).data;
if(data){
for(var i=0;i<data.length;i++){
if(data[i].score<=2.5){
data[i].evaluate='差评';
}else if(data[i].score>2.5 && data[i].score<4){
data[i].evaluate='中评';
}else{
data[i].evaluate='好评';
}
data[i].insertTime = data[i].insertTime.split('T').join(' ');
data[i].pictureUrlArr=data[i].pictureUrl.split(',')
}
state.dataList = data;
}else{
state.dataList=[]
}
console.log("stringToJson(res.bizContent)",data)
})
/*请求评价列表*/
const requestData = (code, data, params) => {
if (params == 1) {
state.pageNo = 1
}
if (state.pageNo == 1 && state.dataList.length > 0) {
state.dataList = []
}
const options = {
type: 2,
data: {
"serviceType": state.serviceType,
"scoreLevel": state.scoreLevel,
"opId": getItem(StorageKeys.OpenId),
"pageNo": state.pageNo,
"pageSize": state.pageSize,
},
method: "POST",
showLoading: true,
};
request(satisfactionEvaluation, options).then((res) => {
//若不填评价内容,根据打分规则自动填充评价内容
//差评展示:默认差评 2.5分及以下
//中评展示:默认中评 2.5以上4.0以下
//好评展示:默认好评 4.0及4.0以上
const data = stringToJson(res.bizContent).data;
console.log("stringToJson(res.bizContent)1", data)
if (data) {
for (var i = 0; i < data.length; i++) {
if (data[i].score <= 2.5) {
data[i].evaluate = '差评';
} else if (data[i].score > 2.5 && data[i].score < 4) {
data[i].evaluate = '中评';
} else {
data[i].evaluate = '好评';
}
data[i].insertTime = data[i].insertTime.split('T').join(' ');
if (data[i].pictureUrl) {
data[i].pictureUrlArr = data[i].pictureUrl.split(',')
}
}
// state.dataList = data;
state.dataList = [...data, ...state.dataList]

//TODO 构造假数据
// state.dataList = [
// {
// name: "张三",
// time: "2021-10-01 10:10",
// score: "4.5",
// evaluate: "好评",
// title: "产品A",
// content:
// "这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价",
// },
// {
// name: "李四",
// time: "2022-10-01 10:10",
// score: "3.0",
// evaluate: "中评",
// title: "产品B",
// content:
// "这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价",
// },
// {
// name: "河西笑傲",
// time: "2023-10-01 10:10",
// score: "2.8",
// evaluate: "差评",
// title: "产品C",
// content:
// "这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价",
// },
// ];
};
} else {
state.dataList = []
}
console.log("stringToJson(res.bizContent)2", state.dataList)

})
};
// 触底加载
onReachBottom(() => {
if (state.dataList.length < state.pageNo * 10) return state.flags = true
console.log("触底了")
state.pageNo++
fetchList(2)
})
</script>

<style>
page {
background-color: #eef7f7;
box-sizing: border-box;
}
page {
background-color: #eef7f7;
box-sizing: border-box;
}
</style>
<style lang="scss" scoped>
.list {
margin-top: 30rpx;
}
.btn-divider {
margin-bottom: 180rpx;
}
.evaluate-btn {
width: 100%;
position: fixed;
bottom: 0rpx;
padding: 30rpx 40rpx;
background-color: #eef7f7;
text-align: center;
box-sizing: border-box;
}
</style>
.list {
margin-top: 30rpx;
}

.btn-divider {
margin-bottom: 180rpx;
}

.evaluate-btn {
width: 100%;
position: fixed;
bottom: 0rpx;
padding: 30rpx 40rpx;
background-color: #eef7f7;
text-align: center;
box-sizing: border-box;
}

.bottom-line {
text-align: center;
margin: 30rpx 0;
}
</style>

+ 174
- 186
subpackage/service/remind/evaluate-list.vue Voir le fichier

@@ -1,204 +1,192 @@
<!-- 评价列表 -->
<template>
<view style="padding: 30rpx">
<evaluate-tab-item :tabs="state.tabs" @tabClick="tabClick" />
<evaluate-tab-item :tabs="state.tabs" @tabClick="tabClick" />
<view style="padding: 30rpx;margin-top: 90rpx;">

<view class="list" :class="state.type === '2' ? 'btn-divider' : ''">
<evaluate-issue-item
:dataList="state.dataList"
v-if="state.type === '1'"
/>
<evaluate-business-item
:dataList="state.dataList"
v-if="state.type === '2'"
/>
<evaluate-equity-item
:dataList="state.dataList"
v-if="state.type === '3'"
/>
<evaluate-salesman-item
:dataList="state.dataList"
v-if="state.type === '4'"
/>
</view>
</view>

<view class="evaluate-btn" v-if="state.type === '2'">
<submit-button
title="去评价"
@submit="goOrder()"
></submit-button>
</view>
<view class="list" :class="state.type === '2' ? 'btn-divider' : ''">
<evaluate-issue-item :dataList="state.dataList" v-if="state.type === '1'" />
<evaluate-business-item :dataList="state.dataList" v-if="state.type === '2'" />
<evaluate-equity-item :dataList="state.dataList" v-if="state.type === '3'" />
<evaluate-salesman-item :dataList="state.dataList" v-if="state.type === '4'" />
</view>
<view class="bottom-line" v-if="state.flags">我是有底线的~~~</view>
</view>

<view class="evaluate-btn" v-if="state.type === '2'">
<submit-button title="去评价" @submit="goOrder()"></submit-button>
</view>
</template>

<script setup lang="ts">
import evaluateTabItem from "./components/evaluate-tab-item";
import evaluateIssueItem from "./components/evaluate-issue-item";
import evaluateEquityItem from "./components/evaluate-equity-item";
import evaluateBusinessItem from "./components/evaluate-business-item";
import evaluateSalesmanItem from "./components/evaluate-salesman-item";
import { onLoad } from "@dcloudio/uni-app";
import { reactive } from "vue";
import { request } from "@/utils/network/request";
import { stringToJson } from "@/utils/network/encryption";
import { satisfactionEvaluation } from "@/utils/network/api";
const state = reactive({
type: "", //评价列表类型 1-发行产品评价 2-业务办理满意度评价 3-权益产品评价 4-业务员满意度评价(暂无UI)
tabs: ["全部", "好评", "中评", "差评"],
curCheckTab: "全部", //当前选择的tab
dataList: [], //评价列表
scoreLevel:0, //0 全部 1 好评 2 中评 3 差评
serviceType:'',
});
import evaluateTabItem from "./components/evaluate-tab-item";
import evaluateIssueItem from "./components/evaluate-issue-item";
import evaluateEquityItem from "./components/evaluate-equity-item";
import evaluateBusinessItem from "./components/evaluate-business-item";
import evaluateSalesmanItem from "./components/evaluate-salesman-item";
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
import { reactive } from "vue";
import { request } from "@/utils/network/request";
import { stringToJson } from "@/utils/network/encryption";
import { satisfactionEvaluation } from "@/utils/network/api";
import { getItem, StorageKeys } from "@/utils/storage";
const state = reactive({
type: "", //评价列表类型 1-发行产品评价 2-业务办理满意度评价 3-权益产品评价 4-业务员满意度评价(暂无UI)
tabs: ["全部", "好评", "中评", "差评"],
curCheckTab: "全部", //当前选择的tab
dataList: [], //评价列表
scoreLevel: 0, //0 全部 1 好评 2 中评 3 差评
serviceType: '',
pageNo: 1,
pageSize: 10,
flags: false,
});

onLoad((options) => {
console.log("options",options)
state.type = options.type;
uni.setNavigationBarTitle({
title: options.title,
});
// if (state.type === "2") {
// state.tabs = [...state.tabs, "业务类型"];
// }
onLoad((options) => {
console.log("options", options)
state.type = options.type;
uni.setNavigationBarTitle({
title: options.title,
});
// if (state.type === "2") {
// state.tabs = [...state.tabs, "业务类型"];
// }

fetchList();
});
const goOrder=()=>{
uni.switchTab({
url:"/pages/order/order"
})
}
/* tab点击 */
const tabClick = (tab) => {
console.log("tab",tab)
state.curCheckTab = tab;
if(tab=='全部'){
state.scoreLevel=0
}else if(tab=='好评'){
state.scoreLevel=1
}else if(tab=='中评'){
state.scoreLevel=2
}else{
state.scoreLevel=3
fetchList(1);
});
const goOrder = () => {
uni.switchTab({
url: "/pages/order/order"
})
}
requestData("11", { type: state.curCheckTab });
};
/* tab点击 */
const tabClick = (tab) => {
state.flags = false;
console.log("tab", tab)
state.curCheckTab = tab;
if (tab == '全部') {
state.scoreLevel = 0
} else if (tab == '好评') {
state.scoreLevel = 1
} else if (tab == '中评') {
state.scoreLevel = 2
} else {
state.scoreLevel = 3
}
requestData("11", { type: state.curCheckTab }, 1);
};

/* 根据不同条件获取数据 */
const fetchList = () => {
switch (state.type) {
case "1": //发行产品评价
state.serviceType='product';
requestData("11", { type: state.curCheckTab });
break;
case "2": //业务办理满意度评价
state.serviceType='service';
requestData("22", { type: state.curCheckTab });
break;
case "3": //权益产品评价
state.serviceType='equity';
requestData("33", { type: state.curCheckTab });
break;
case "4": //业务员满意度评价
state.serviceType='staff';
requestData("44", { type: state.curCheckTab });
break;
default:
break;
}
};
/* 根据不同条件获取数据 */
const fetchList = (params) => {
switch (state.type) {
case "1": //发行产品评价
state.serviceType = 'product';
requestData("11", { type: state.curCheckTab }, params);
break;
case "2": //业务办理满意度评价
state.serviceType = 'service';
requestData("22", { type: state.curCheckTab }, params);
break;
case "3": //权益产品评价
state.serviceType = 'equity';
requestData("33", { type: state.curCheckTab }, params);
break;
case "4": //业务员满意度评价
state.serviceType = 'staff';
requestData("44", { type: state.curCheckTab }, params);
break;
default:
break;
}
};

/*请求评价列表*/
const requestData = (code, data) => {
const options = {
type: 2,
data: {
"serviceType":state.serviceType,
"scoreLevel":state.scoreLevel,
},
method: "POST",
showLoading: true,
};
request(satisfactionEvaluation,options).then((res)=>{
//若不填评价内容,根据打分规则自动填充评价内容
//差评展示:默认差评 2.5分及以下
//中评展示:默认中评 2.5以上4.0以下
//好评展示:默认好评 4.0及4.0以上
console.log("stringToJson(res.bizContent)",stringToJson(res.bizContent).data)
const data=stringToJson(res.bizContent).data;
if(data){
for(var i=0;i<data.length;i++){
if(data[i].score<=2.5){
data[i].evaluate='差评';
}else if(data[i].score>2.5 && data[i].score<4){
data[i].evaluate='中评';
}else{
data[i].evaluate='好评';
}
data[i].insertTime = data[i].insertTime.split('T').join(' ');
// data[i].pictureUrl=data[i].pictureUrl.split(',')
}
state.dataList = data;
}else{
state.dataList=[]
}
})
/*请求评价列表*/
const requestData = (code, data, params) => {
if (params == 1) {
state.pageNo = 1
}
if (state.pageNo == 1 && state.dataList.length > 0) {
state.dataList = []
}
const options = {
type: 2,
data: {
"serviceType": state.serviceType,
"scoreLevel": state.scoreLevel,
"opId": getItem(StorageKeys.OpenId),
"pageNo": state.pageNo,
"pageSize": state.pageSize,
},
method: "POST",
showLoading: true,
};
request(satisfactionEvaluation, options).then((res) => {
//若不填评价内容,根据打分规则自动填充评价内容
//差评展示:默认差评 2.5分及以下
//中评展示:默认中评 2.5以上4.0以下
//好评展示:默认好评 4.0及4.0以上
const data = stringToJson(res.bizContent).data;
console.log("stringToJson(res.bizContent)1", data)
if (data) {
for (var i = 0; i < data.length; i++) {
if (data[i].score <= 2.5) {
data[i].evaluate = '差评';
} else if (data[i].score > 2.5 && data[i].score < 4) {
data[i].evaluate = '中评';
} else {
data[i].evaluate = '好评';
}
data[i].insertTime = data[i].insertTime.split('T').join(' ');
if (data[i].pictureUrl) {
data[i].pictureUrlArr = data[i].pictureUrl.split(',')
}
}
// state.dataList = data;
state.dataList = [...data, ...state.dataList]

//TODO 构造假数据
// state.dataList = [
// {
// name: "张三",
// time: "2021-10-01 10:10",
// score: "4.5",
// evaluate: "好评",
// title: "产品A",
// content:
// "这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价",
// },
// {
// name: "李四",
// time: "2022-10-01 10:10",
// score: "3.0",
// evaluate: "中评",
// title: "产品B",
// content:
// "这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价",
// },
// {
// name: "河西笑傲",
// time: "2023-10-01 10:10",
// score: "2.8",
// evaluate: "差评",
// title: "产品C",
// content:
// "这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价这里是评价",
// },
// ];
};
} else {
state.dataList = []
}
console.log("stringToJson(res.bizContent)2", state.dataList)

})
};
// 触底加载
onReachBottom(() => {
if (state.dataList.length < state.pageNo * 10) return state.flags = true
console.log("触底了")
state.pageNo++
fetchList(2)
})
</script>

<style>
page {
background-color: #eef7f7;
box-sizing: border-box;
}
page {
background-color: #eef7f7;
box-sizing: border-box;
}
</style>
<style lang="scss" scoped>
.list {
margin-top: 30rpx;
}
.btn-divider {
margin-bottom: 180rpx;
}
.evaluate-btn {
width: 100%;
position: fixed;
bottom: 0rpx;
padding: 30rpx 40rpx;
background-color: #eef7f7;
text-align: center;
box-sizing: border-box;
}
</style>
.list {
margin-top: 30rpx;
}

.btn-divider {
margin-bottom: 180rpx;
}

.evaluate-btn {
width: 100%;
position: fixed;
bottom: 0rpx;
padding: 30rpx 40rpx;
background-color: #eef7f7;
text-align: center;
box-sizing: border-box;
}

.bottom-line {
text-align: center;
margin: 30rpx 0;
}
</style>

Chargement…
Annuler
Enregistrer