<template> | <template> | ||||
<view style="width: 100%;height: 100vh;position: fixed;left: 0;top:0;z-index: 111111;"> | <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" | <view v-if="phoneType == 1" | ||||
style="display: flex;align-items: center;justify-content: flex-end;width: 100%;height: 100%;"> | 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" | <image src="/static/image/etc_bd_ocr_id_card_locator_front.png" | ||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<!-- camera --> | <!-- camera --> | ||||
<camera v-if="showStartPhoto" id="camera" style="height: 70vh;width: 100vh;background-color: black;width: 100%;" | <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" /> | mode="normal" :device-position="cameraPosition" :flash="flash" @stop="cameraStop" @error="cameraError" /> | ||||
<view v-if="!showStartPhoto" style="height: 70vh;background-color: black;"> | <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" | @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> | ||||
<view style="background-color: #A5A5A5;top: 60%;width: 100%;height: 40%;position: absolute;"> | <view style="background-color: #A5A5A5;top: 60%;width: 100%;height: 40%;position: absolute;"> | ||||
}; | }; | ||||
function updateScale() { | 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 | scale.value = Math.max(0.5, Math.min(scale.value + scales, 1)); // 设置缩放的范围,这里设置最小为1,最大为3 | ||||
} | } | ||||
console.log('拍照成功:', res.tempImagePath); | console.log('拍照成功:', res.tempImagePath); | ||||
srcImg.value = res.tempImagePath | srcImg.value = res.tempImagePath | ||||
// showStartPhoto.value = false | // showStartPhoto.value = false | ||||
// // #ifdef MP-ALIPAY | |||||
cameraContext.stopRecord(); | cameraContext.stopRecord(); | ||||
emit('confirmReturn', res) | emit('confirmReturn', res) | ||||
// // #endif | |||||
console.log("1111") | |||||
}, | }, | ||||
fail: (error) => { | fail: (error) => { | ||||
console.error('拍照失败:', error); | console.error('拍照失败:', error); |
state.transWay = evt.detail.value; //“blu”为蓝牙充值方式、“nfc”为NFC充值方式 | state.transWay = evt.detail.value; //“blu”为蓝牙充值方式、“nfc”为NFC充值方式 | ||||
} | } | ||||
function go() { | |||||
function go(money) { | |||||
let content = "" | |||||
if (money) { | |||||
content = '待消费订单' + money + '元' | |||||
} else { | |||||
content = '待消费订单' | |||||
} | |||||
uni.showModal({ | uni.showModal({ | ||||
title: '提示', | title: '提示', | ||||
content: '待消费订单', | |||||
content: content, | |||||
showCancel: false, | showCancel: false, | ||||
success: (res) => { | success: (res) => { | ||||
if (res.confirm) { | if (res.confirm) { | ||||
state.orderNum = checkResult.orders[0].orderNum; | state.orderNum = checkResult.orders[0].orderNum; | ||||
setItem("orderNum", state.orderNum); | setItem("orderNum", state.orderNum); | ||||
//链接蓝牙 | //链接蓝牙 | ||||
go() | |||||
go(state.money) | |||||
} else { | } else { | ||||
cardCzApplyAction().then((applyResult : any) => { | cardCzApplyAction().then((applyResult : any) => { | ||||
//拿到订单 存起来 | //拿到订单 存起来 |
const getCode = () => { | const getCode = () => { | ||||
console.log(123); | console.log(123); | ||||
} | } | ||||
const submit=()=>{ | |||||
const submit = () => { | |||||
console.log(11); | console.log(11); | ||||
uni.redirectTo({ | uni.redirectTo({ | ||||
// url: '/pages/service/service' | |||||
}); | }); | ||||
} | } | ||||
</script> | </script> | ||||
left: 50%; | left: 50%; | ||||
transform: translate(-50%); | transform: translate(-50%); | ||||
} | } | ||||
</style> | |||||
</style> |
const cancel = () => { | const cancel = () => { | ||||
state.showPopup = false; | state.showPopup = false; | ||||
// navTo("/pages/service/service") | |||||
uni.navigateBack({ | uni.navigateBack({ | ||||
delta: 2 | delta: 2 | ||||
}) | }) |
//返回列表 | //返回列表 | ||||
const toBack = () => { | const toBack = () => { | ||||
navTo("/pages/service/service") | |||||
uni.redirectTo({ | |||||
url: "/pages/service/service" | |||||
}) | |||||
// navTo("/pages/service/service") | |||||
} | } | ||||
//关闭弹窗 | //关闭弹窗 |
const getCode = () => { | const getCode = () => { | ||||
console.log(123); | console.log(123); | ||||
} | } | ||||
const submit=()=>{ | |||||
const submit = () => { | |||||
console.log(11); | console.log(11); | ||||
uni.redirectTo({ | uni.redirectTo({ | ||||
// url: '/pages/service/service' | |||||
}); | }); | ||||
} | } | ||||
</script> | </script> | ||||
left: 50%; | left: 50%; | ||||
transform: translate(-50%); | transform: translate(-50%); | ||||
} | } | ||||
</style> | |||||
</style> |
}) | }) | ||||
//接受通过该id查询订单详情 | //接受通过该id查询订单详情 | ||||
const oldId=ref('') | |||||
const oldId = ref('') | |||||
const applyType = ref('') | const applyType = ref('') | ||||
//选择器数据 | //选择器数据 | ||||
const columns = [{ | 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' | |||||
// }, | |||||
] | ] | ||||
// 验证规则 | // 验证规则 | ||||
// 单选数据列表 | // 单选数据列表 | ||||
const radiolist1 = reactive([{ | const radiolist1 = reactive([{ | ||||
name: 1, | |||||
disabled: '有卡注销' | |||||
}, | |||||
{ | |||||
name: 2, | |||||
disabled: '无卡注销' | |||||
}, | |||||
], ) | |||||
name: 1, | |||||
disabled: '有卡注销' | |||||
}, | |||||
{ | |||||
name: 2, | |||||
disabled: '无卡注销' | |||||
}, | |||||
]) | |||||
let show = ref(false) | let show = ref(false) | ||||
// 打开地区先择器 | // 打开地区先择器 | ||||
const showPicker = function() { | |||||
const showPicker = function () { | |||||
show.value = true | show.value = true | ||||
} | } | ||||
// 确定地区 | // 确定地区 | ||||
// const data = stringToJson(res.bizContent); | // const data = stringToJson(res.bizContent); | ||||
// console.log(data); | // console.log(data); | ||||
// // navTo(`/orders/apply-ex-goods?orderId=${oldId.value}&id=${data.id}`) | // // navTo(`/orders/apply-ex-goods?orderId=${oldId.value}&id=${data.id}`) | ||||
// }); | // }); | ||||
} else if (!form.applyType) { | } else if (!form.applyType) { | ||||
uni.showToast({ | uni.showToast({ | ||||
onLoad((option) => { | onLoad((option) => { | ||||
form.orderId = option.orderId | form.orderId = option.orderId | ||||
oldId.value=option.id | |||||
oldId.value = option.id | |||||
console.log(form); | console.log(form); | ||||
}); | }); | ||||
</script> | </script> | ||||
::v-deep .input { | ::v-deep .input { | ||||
text-align: right; | text-align: right; | ||||
flex: 1; | flex: 1; | ||||
background: transparent; | |||||
background: transparent; | |||||
input { | input { | ||||
text-align: right; | text-align: right; | ||||
} | } | ||||
margin: 26px auto; | margin: 26px auto; | ||||
font-size: 32rpx; | font-size: 32rpx; | ||||
} | } | ||||
</style> | |||||
</style> |
console.log("option选择产品列表", option) | console.log("option选择产品列表", option) | ||||
}); | }); | ||||
onShow(() => { | onShow(() => { | ||||
productList(); | |||||
// productList(); | |||||
}) | }) | ||||
// 产品列表 | // 产品列表 | ||||
const productList = () => { | const productList = () => { |
state.phoneType = val; | state.phoneType = val; | ||||
} | } | ||||
const confirmReturn = (val) => { | const confirmReturn = (val) => { | ||||
console.log("图片地址val", val) | |||||
state.phoneType = 0 | state.phoneType = 0 | ||||
state.isTakePhotoModeShow = false | state.isTakePhotoModeShow = false | ||||
var imageType = state.choiceIndex; | var imageType = state.choiceIndex; | ||||
console.log("图片地址val", val.tempImagePath) | |||||
// uploadFile(val.tempImagePath, imageType, ocrAllQuery).then((data) => { | // uploadFile(val.tempImagePath, imageType, ocrAllQuery).then((data) => { | ||||
uploadFile(val.tempImagePath, imageType, etcOcrCard).then((data) => { | uploadFile(val.tempImagePath, imageType, etcOcrCard).then((data) => { | ||||
console.log("身份证上传", data) | console.log("身份证上传", data) |
if (state.typeScanCode == 2) { | if (state.typeScanCode == 2) { | ||||
console.log("state.typeScanCode", state.typeScanCode) | console.log("state.typeScanCode", state.typeScanCode) | ||||
// 扫码进来 | // 扫码进来 | ||||
agreementConfirm(); | |||||
if (state.checked) { | |||||
agreementConfirm(); | |||||
} else { | |||||
msg("请勾选协议"); | |||||
} | |||||
} else { | } else { | ||||
console.log("state.checked", state.checked) | console.log("state.checked", state.checked) | ||||
if (state.checked) { | if (state.checked) { |
<!-- 评价列表筛选 item --> | <!-- 评价列表筛选 item --> | ||||
<template> | <template> | ||||
<view class="tabs"> | <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}} | {{tab}} | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<script setup lang="ts"> | <script setup lang="ts"> | ||||
import { ref } from "vue"; | import { ref } from "vue"; | ||||
defineProps({ | defineProps({ | ||||
tabs:{ | |||||
type:Array, | |||||
default:() => { | |||||
tabs: { | |||||
type: Array, | |||||
default: () => { | |||||
return []; | return []; | ||||
} | } | ||||
} | } | ||||
}) | }) | ||||
const curIndex = ref(0); | const curIndex = ref(0); | ||||
const emit = defineEmits(['tabClick']) | const emit = defineEmits(['tabClick']) | ||||
const tabClickHandle = (item,index) =>{ | |||||
const tabClickHandle = (item, index) => { | |||||
curIndex.value = index; | curIndex.value = index; | ||||
emit('tabClick',item); | |||||
emit('tabClick', item); | |||||
} | } | ||||
</script> | </script> | ||||
<style lang="scss" scoped> | <style lang="scss" scoped> | ||||
.tabs{ | |||||
.tabs { | |||||
display: flex; | display: flex; | ||||
flex-direction: row; | flex-direction: row; | ||||
flex-wrap: wrap; | flex-wrap: wrap; | ||||
justify-content: space-between; | 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; | font-size: 24rpx; | ||||
min-width: 135rpx; | min-width: 135rpx; | ||||
height: 52rpx; | height: 52rpx; | ||||
margin-right: 30rpx; | margin-right: 30rpx; | ||||
margin-top: 16rpx; | margin-top: 16rpx; | ||||
} | } | ||||
.normal{ | |||||
.normal { | |||||
color: #333333; | color: #333333; | ||||
background-color: white; | background-color: white; | ||||
border: 1px solid #999999; | border: 1px solid #999999; | ||||
} | } | ||||
.active{ | |||||
.active { | |||||
color: white; | color: white; | ||||
background: #00B38B; | background: #00B38B; | ||||
} | } |
<!-- 评价列表 --> | <!-- 评价列表 --> | ||||
<template> | <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> | </template> | ||||
<script setup lang="ts"> | <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> | </script> | ||||
<style> | <style> | ||||
page { | |||||
background-color: #eef7f7; | |||||
box-sizing: border-box; | |||||
} | |||||
page { | |||||
background-color: #eef7f7; | |||||
box-sizing: border-box; | |||||
} | |||||
</style> | </style> | ||||
<style lang="scss" scoped> | <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> |
<!-- 评价列表 --> | <!-- 评价列表 --> | ||||
<template> | <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> | </template> | ||||
<script setup lang="ts"> | <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> | </script> | ||||
<style> | <style> | ||||
page { | |||||
background-color: #eef7f7; | |||||
box-sizing: border-box; | |||||
} | |||||
page { | |||||
background-color: #eef7f7; | |||||
box-sizing: border-box; | |||||
} | |||||
</style> | </style> | ||||
<style lang="scss" scoped> | <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> |