123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828 |
- <template>
- <view>
- <!-- 头部背景 -->
- <image src="https://jzmall.lifejingzhi.com/file/jzmall/weixin/revisit-top.png" mode="aspectFill" class="top-img"></image>
- <view class="top-block">
- <view class="title">尊敬的客户,您的反馈是我们提供更好的服务的基石:</view>
- <view class="slogan">您的满意是我们服务第一优先级</view>
- </view>
- <!-- 服务信息 -->
- <view class="service-block">
- <view class="title">
- <view>服务信息</view>
- </view>
- <view class="content">
- <view class="service-times">
- {{ tradeOrder.serviceNumber }}
- </view>
- <view class="item">
- <text>服务内容:</text>
- {{ tradeOrder.itemName }}
- </view>
- <view class="item">
- <text>服务时间:</text>
- {{ tradeOrder.beginDate }} {{ tradeOrder.serviceTime }}
- </view>
- <view class="item">
- <text>服务人员:</text>
- {{ tradeOrder.workerName }}
- </view>
- </view>
- </view>
- <!-- 是否满意 -->
- <view class="service-satisfy">
- <view class="satisfy-title">
- <view class="dot"></view>
- <view class="text">您对本次的服务是否满意?</view>
- </view>
- <view class="satisfy-select">
- <view data-satisfy="1" :class="satisfy == '1' ? 'yes' : ''" @tap="selectSatisfy">满意</view>
- <view data-satisfy="2" :class="satisfy == '2' ? 'no' : ''" @tap="selectSatisfy">不满意</view>
- <view data-satisfy="3" :class="satisfy == '3' ? 'common' : ''" @tap="selectSatisfy">一般</view>
- </view>
- <!-- 满意 -->
- <view class="satisfy-result" v-if="satisfy == 1">
- <view>感谢您的认可,您的认可是我们前行的动力! 如果有需求,您可以长期购买周期单,可以指定阿姨,价格更优惠!</view>
- </view>
- <!-- 一般 -->
- <view class="satisfy-common" v-if="satisfy == 3">诚邀您对我们提出宝贵意见,我们会积极改进,为您提供更好的服务。</view>
- <!-- 不满意 -->
- <view class="satisfy-common" v-if="satisfy == 2">抱歉给您带来不好的服务体验,我们的工作人员会在第一时间联系您提供后续服务!</view>
- </view>
- <!-- 一般备注 -->
- <view class="remark-wrapper" v-if="satisfy == 3">
- <view class="tips">1. 请输入您想和我们说的话:</view>
- <textarea @input="remarkInput" placeholder="感谢您的耐心与支持" class="textarea" :value="remark" placeholder-style="color: #E8E8E8;font-size:30rpx;" />
- </view>
- <!-- 题目 -->
- <view class="topic-block" v-if="satisfy == 2">
- <!-- 题目选择 -->
- <view class="topic-item">
- <view class="issue">1. 请选择您发现的问题?</view>
- <view class="answer">
- <view
- :class="(item.checked ? 'selected-answer' : 'common-answer') + ' answer-item'"
- :data-checked="item.checked"
- :data-index="index"
- @tap="questionClick"
- v-for="(item, index) in consultList"
- :key="index"
- >
- {{ item.name }}
- </view>
- </view>
- </view>
- <view class="topic-item" v-for="(item1, index1) in questionList" :key="index1">
- <view class="issue">
- <view class="dot"></view>
- <view>
- <text>{{ item1.name }}</text>
- <text class="refer">具体问题</text>
- </view>
- </view>
- <view class="answer">
- <view
- :class="(item1.consultId == item2.id ? 'selected-answer' : 'common-answer') + ' answer-item'"
- :data-id="item2.id"
- :data-answer="item2.name"
- :data-index1="index1"
- @tap="answerClick"
- v-for="(item2, index2) in item1.children"
- :key="index2"
- >
- {{ item2.name }}
- </view>
- </view>
- </view>
- </view>
- <view class="remark-wrapper" v-if="satisfy == 2">
- <view class="tips">2. 请输入具体问题描述:</view>
- <textarea @input="detailInput" placeholder="感谢您的耐心与支持" class="textarea" :value="detail" placeholder-style="color: #E8E8E8;font-size:30rpx;" />
- <!-- 图片上传 -->
- <view class="upload-wrapper">
- <view class="img-item" v-for="(item, index) in imgList" :key="index">
- <image mode="aspectFill" :src="item" class="user-upload" @tap="previewImg" :data-img="item"></image>
- <image class="close-img" mode="aspectFill" src="/static/images/icon-close.png" @tap="delImg" :data-index="index"></image>
- </view>
- <view class="upload" @tap="uploadImg">
- <image mode="aspectFill" src="/static/images/icon-add.png"></image>
- <view>上传照片</view>
- </view>
- </view>
- </view>
- <view class="submit-btn" @tap="sumitRevisit" v-if="!isFinished">提交</view>
- <view class="submit-btn disable-btn" v-else>提交</view>
- <!-- 底部背景 -->
- <image src="https://jzmall.lifejingzhi.com/file/jzmall/weixin/revisit-bottom.png" mode="widthFix" class="bottom-img"></image>
- <view v-if="loginShow" @tap="onOverlayHide">
- <view class="wrapper">
- <view class="block">
- <button class="submit-btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">手机号一键登录</button>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- const util = require('../../../utils/util.js');
- const api = require('../../../config/api.js');
- //获取应用实例
- const app = getApp();
- export default {
- data() {
- return {
- consultList: [],
- questionList: [],
- imgList: [],
- remark: '',
- detail: '',
- satisfy: '',
- bookTradeNo: '',
- type: '',
- isFinished: false,
- tradeOrder: {
- itemName: '',
- serviceNumber: '',
- beginDate: '',
- serviceTime: '',
- workerName: ''
- },
- code: '',
- loginShow: false,
- obj1: '',
- obj2: '',
- isUnMask: ''
- };
- },
- onLoad: function (options) {
- console.log('options', options);
- if (options) {
- this.setData({
- bookTradeNo: options.id
- // type:options.type
- });
- this.getOrderDetail();
- }
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function (options) {
- },
- methods: {
- getOrderDetail() {
- util.request(
- api.getTradeOrderList,
- {
- bookDetailId: this.bookTradeNo
- },
- 'GET'
- )
- .then((res) => {
- if (res.errno === 0) {
- console.log(res);
- this.setData({
- tradeOrder: res.data
- });
- // 获取题目
- this.getConsoultType();
- } else {
- uni.showToast({
- title: res.errmsg,
- icon: 'none',
- duration: 2000
- });
- }
- })
- .catch((err) => {
- console.log(err);
- });
- },
- getConsoultType() {
- util.request(
- api.getConsoultType,
- {
- type: this.tradeOrder.goodsType
- },
- 'GET'
- )
- .then((res) => {
- if (res.errno === 0) {
- console.log(res);
- let list = res.data[0].children;
- list.forEach((item) => {
- item.checked = false;
- });
- this.setData({
- consultList: list
- });
- } else {
- uni.showToast({
- title: res.errmsg,
- icon: 'none',
- duration: 2000
- });
- }
- })
- .catch((err) => {
- console.log(err);
- });
- },
- questionClick(e) {
- let checked = e.currentTarget.dataset.checked;
- let index = e.currentTarget.dataset.index;
- let item = `consultList[${index}].checked`;
- this.setData({
- [item]: !checked
- });
- let current = this.consultList.filter((item) => {
- return item.checked;
- });
- this.setData({
- questionList: current
- });
- },
- selectSatisfy(e) {
- let result = e.currentTarget.dataset.satisfy;
- this.setData({
- satisfy: result
- });
- },
- remarkInput(e) {
- this.setData({
- remark: e.detail.value
- });
- },
- detailInput(e) {
- this.setData({
- detail: e.detail.value
- });
- },
- previewImg(e) {
- let img = e.currentTarget.dataset.img;
- let imgs = this.imgList;
- uni.previewImage({
- current: img,
- // 当前显示图片的http链接
- urls: imgs // 需要预览的图片http链接列表
- });
- },
- delImg(e) {
- let imgs = this.imgList;
- let index = e.currentTarget.dataset.index;
- imgs.splice(index, 1);
- this.setData({
- imgList: imgs
- });
- },
- uploadImg() {
- if (this.imgList.length >= 9) {
- uni.showToast({
- title: '最多上传9张图片',
- icon: 'none',
- duration: 2000
- });
- return false;
- }
- let that = this;
- let count = 9 - that.imgList.length;
- uni.chooseImage({
- count: count,
- sizeType: ['original', 'compressed'],
- sourceType: ['album', 'camera'],
- success: function (res) {
- console.log(res);
- let tempFilePaths = res.tempFilePaths;
- uni.showLoading({
- title: '上传中...'
- });
- for (let i = 0; i < tempFilePaths.length; i++) {
- let imgs = that.imgList;
- if (imgs.length >= 9) {
- that.setData({
- imgList: imgs
- });
- return false;
- } else {
- uni.uploadFile({
- url: api.StorageUpload,
- filePath: tempFilePaths[i],
- name: 'file',
- success(res) {
- console.log(res);
- let data = JSON.parse(res.data);
- if (data.errno == 0) {
- imgs.push(data.data.url);
- that.setData({
- imgList: imgs
- });
- } else {
- console.log('上传失败');
- }
- }
- });
- }
- }
- uni.hideLoading();
- }
- });
- },
- answerClick(e) {
- let index1 = e.currentTarget.dataset.index1;
- let answer = e.currentTarget.dataset.answer;
- let id = e.currentTarget.dataset.id;
- let obj1 = `questionList[${index1}].consultId`;
- let obj2 = `questionList[${index1}].consultName`;
- this.setData({
- [obj1]: id,
- [obj2]: answer
- });
- console.log(this.questionList);
- },
- maskClick(e) {
- let answer = e.currentTarget.dataset.answer;
- this.setData({
- isUnMask: answer
- });
- },
- getPhoneNumber(e) {
- console.log(e.detail);
- let params = {
- // type:'保洁',
- code: this.code,
- encryptedData: e.detail.encryptedData,
- iv: e.detail.iv,
- bookTradeNo: this.bookTradeNo
- };
- util.request(api.loginCusTel, params, 'POST').then((res) => {
- if (res.errno === 0) {
- console.log(res);
- this.setData({
- loginShow: false
- });
- if (res.data.tradeOrder == null || res.data.tradeOrder == '') {
- uni.showToast({
- title: '您还没有购买过任何商品,如有疑问,欢迎咨询4009218787',
- icon: 'none',
- duration: 2000
- });
- } else {
- this.setData({
- tradeOrder: res.data.tradeOrder
- });
- this.getConsoultType();
- }
- } else {
- this.setData({
- loginShow: true
- });
- uni.showToast({
- title: res.errmsg,
- icon: 'none',
- duration: 2000
- });
- let that = this;
- uni.login({
- success(res) {
- console.log(res);
- if (res.code) {
- that.setData({
- code: res.code
- });
- }
- }
- });
- }
- });
- },
- sumitRevisit() {
- let params = {
- bookTime: this.tradeOrder.beginDate + ' ' + this.tradeOrder.serviceTime,
- bookTradeNo: this.tradeOrder.bookTradeNo,
- cusTel: this.tradeOrder.cusPhone,
- degree: this.satisfy,
- type: this.tradeOrder.goodsType,
- worderNo: this.tradeOrder.workerNo,
- workerName: this.tradeOrder.workerName
- };
- if (this.satisfy == 2) {
- let isEmpty = this.questionList.some((item) => {
- return item.consultId == undefined || item.consultId == '';
- });
- if (isEmpty) {
- uni.showToast({
- title: '请填写完整',
- icon: 'none',
- duration: 2000
- });
- return false;
- } else if (this.detail == '') {
- uni.showToast({
- title: '请输入具体问题描述',
- icon: 'none',
- duration: 2000
- });
- return false;
- } else {
- let title = [];
- let titleId = [];
- let consultId = [];
- let consultName = [];
- this.questionList.forEach((item) => {
- title.push(item.name);
- titleId.push(item.id);
- consultId.push(item.consultId);
- consultName.push(item.consultName);
- });
- params.title = title.join(',');
- params.titleId = titleId.join(',');
- params.consultId = consultId.join(',');
- params.consultName = consultName.join(',');
- params.question = this.detail;
- params.imgSrc = this.imgList.join(',');
- }
- } else if (this.satisfy == 3) {
- if (this.remark == '') {
- uni.showToast({
- title: '请填写建议',
- icon: 'none',
- duration: 2000
- });
- return false;
- } else {
- params.question = this.remark;
- }
- }
- uni.showLoading({
- title: '加载中...'
- });
- util.request(api.saveVisit, params, 'POST')
- .then((res) => {
- uni.hideLoading();
- if (res.errno === 0) {
- console.log(res);
- uni.showToast({
- title: '提交成功',
- icon: 'success',
- duration: 2000
- });
- this.setData({
- isFinished: true
- });
- } else {
- uni.showToast({
- title: res.errmsg,
- icon: 'none',
- duration: 2000
- });
- }
- })
- .catch((err) => {
- uni.hideLoading();
- });
- },
- goDetail() {
- uni.navigateTo({
- url: '/pages/qwOrderDetail/qwOrderDetail?payId=' + this.tradeOrder.payId
- });
- },
- onOverlayHide() {}
- }
- };
- </script>
- <style>
- page {
- background: #f3f3f3;
- padding-bottom: 180rpx;
- color: #333;
- }
- view,
- text {
- font-size: 30rpx;
- }
- .top-img {
- width: 750rpx;
- height: 178rpx;
- display: block;
- }
- .top-block {
- margin: 12rpx 0 12rpx;
- background: #ffffff;
- padding: 24rpx 24rpx 14rpx;
- }
- .top-block .title {
- line-height: 42rpx;
- height: 42rpx;
- white-space: nowrap;
- }
- .top-block .slogan {
- height: 42rpx;
- line-height: 42rpx;
- color: #999;
- margin-top: 12rpx;
- }
- .bottom-img {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- width: 750rpx;
- }
- .service-satisfy {
- padding: 24rpx 24rpx 34rpx;
- background: #fff;
- margin: 0 0 24rpx;
- }
- .satisfy-title {
- height: 48rpx;
- display: flex;
- align-items: center;
- }
- .satisfy-title .dot {
- width: 12rpx;
- height: 12rpx;
- background: #09afff;
- border-radius: 12rpx;
- margin-right: 16rpx;
- }
- .satisfy-title .text {
- font-size: 34rpx;
- line-height: 48rpx;
- }
- .satisfy-select {
- margin: 24rpx 0;
- display: flex;
- height: 72rpx;
- justify-content: space-between;
- }
- .satisfy-select view {
- width: 218rpx;
- height: 72rpx;
- line-height: 72rpx;
- background: #f5f5f5;
- border-radius: 8rpx;
- text-align: center;
- }
- .satisfy-select view.yes {
- background: url('https://jzmall.lifejingzhi.com/file/jzmall/weixin/revisit-check.png') no-repeat right bottom;
- background-size: 40rpx 32rpx;
- background-color: #e7f1ff;
- color: #1677ff;
- }
- .satisfy-select view.no {
- background: url('https://jzmall.lifejingzhi.com/file/jzmall/weixin/qw/icon-no.png') no-repeat right bottom;
- background-size: 40rpx 32rpx;
- background-color: #fff1f0;
- color: #f5222d;
- }
- .satisfy-select view.common {
- background: url('https://jzmall.lifejingzhi.com/file/jzmall/weixin/qw/icon-common.png') no-repeat right bottom;
- background-size: 40rpx 32rpx;
- background-color: #f0f5ff;
- color: rgba(0, 0, 0, 0.45);
- }
- .satisfy-result view {
- line-height: 46rpx;
- color: #999;
- }
- .satisfy-result image {
- margin: 6rpx 0 -34rpx;
- width: 702rpx;
- height: 142rpx;
- }
- .satisfy-common {
- color: #6aacc2;
- line-height: 46rpx;
- }
- .remark-wrapper {
- padding: 24rpx;
- background: #fff;
- margin-bottom: 24rpx;
- }
- .remark-wrapper .tips {
- font-size: 34rpx;
- line-height: 48tpx;
- margin-bottom: 18rpx;
- }
- .remark-wrapper .textarea {
- width: 702rpx;
- height: 174rpx;
- border-radius: 12rpx;
- border: 1rpx solid #dadada;
- padding: 12rpx 12rpx 12rpx 24rpx;
- line-height: 42rpx;
- box-sizing: border-box;
- color: #666;
- }
- .upload-wrapper {
- margin: 18rpx -20rpx 56rpx 0;
- display: flex;
- flex-wrap: wrap;
- }
- .upload {
- width: 160rpx;
- height: 160rpx;
- background: #fafafa;
- border-radius: 2rpx;
- border: 1rpx solid #d9d9d9;
- display: flex;
- align-items: center;
- flex-direction: column;
- justify-content: center;
- margin-right: 16rpx;
- box-sizing: border-box;
- }
- .upload image {
- width: 38rpx;
- height: 38rpx;
- margin-bottom: 22rpx;
- }
- .upload view {
- font-weight: 400;
- color: #c5c3c3;
- line-height: 48rpx;
- font-size: 26rpx;
- }
- .img-item {
- width: 160rpx;
- height: 160rpx;
- background: #fff;
- border-radius: 2rpx;
- border: 1rpx solid #d9d9d9;
- margin: 0 20rpx 24rpx 0;
- padding: 8rpx;
- position: relative;
- box-sizing: border-box;
- }
- .img-item .user-upload {
- width: 144rpx;
- height: 144rpx;
- }
- .img-item .close-img {
- width: 28rpx;
- height: 28rpx;
- position: absolute;
- top: 0;
- right: 0;
- }
- .service-block {
- margin-bottom: 10rpx;
- background: #fff;
- font-size: 30rpx;
- }
- .service-block .title {
- height: 90rpx;
- line-height: 90rpx;
- padding: 0 24rpx;
- border-bottom: 1rpx solid #eeeeee;
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- view.view-detail {
- color: #09afff;
- font-size: 28rpx;
- }
- .service-block .content {
- padding: 20rpx 24rpx;
- position: relative;
- }
- .service-block .item {
- line-height: 56rpx;
- color: #666;
- }
- .service-block .item text {
- color: #999;
- }
- .service-times {
- position: absolute;
- top: 22rpx;
- right: 48rpx;
- color: #666;
- }
- .topic-item {
- padding: 24rpx 24rpx 32rpx;
- background: #fff;
- margin-bottom: 12rpx;
- font-size: 34rpx;
- }
- .topic-item .issue {
- line-height: 48rpx;
- margin-bottom: 22rpx;
- display: flex;
- }
- .issue .dot {
- width: 12rpx;
- height: 12rpx;
- background: #09afff;
- border-radius: 12rpx;
- margin-right: 12rpx;
- margin-top: 18rpx;
- }
- .issue text {
- font-size: 34rpx;
- }
- .issue .refer {
- color: #c5c5c5;
- margin-left: 12rpx;
- font-size: 30rpx;
- font-weight: 400;
- }
- .topic-item .answer {
- flex-wrap: wrap;
- display: flex;
- }
- .answer .answer-item {
- /* width: 218rpx; */
- min-width: 160rpx;
- padding: 0 20rpx;
- height: 72rpx;
- line-height: 72rpx;
- border-radius: 8rpx;
- text-align: center;
- color: #333;
- font-size: 28rpx;
- margin: 0 20rpx 24rpx 0;
- box-sizing: border-box;
- }
- .answer .common-answer {
- background: #f5f5f5;
- color: #333;
- }
- .topic-item .answer .selected-answer {
- background: url('https://jzmall.lifejingzhi.com/file/jzmall/weixin/revisit-check.png') no-repeat right bottom;
- background-size: 40rpx 32rpx;
- background-color: #e7f1ff;
- color: #1677ff;
- }
- .submit-btn {
- width: 702rpx;
- height: 88rpx;
- background: #3d7fff linear-gradient(270deg, rgba(0, 202, 255, 0.5) 0%, rgba(9, 175, 255, 0.5) 100%);
- border-radius: 88rpx;
- margin: 0 24rpx 60rpx;
- line-height: 88rpx;
- font-size: 32rpx;
- color: #fff;
- text-align: center;
- margin-top: 100rpx;
- }
- .submit-btn.disable-btn {
- background: #ccc;
- box-shadow: 4rpx 4rpx 10rpx 0rpx rgba(201, 205, 207, 0.25);
- }
- .topic-item .answer.unmask {
- justify-content: flex-start;
- }
- .topic-item .answer.unmask view {
- margin-right: 24rpx;
- }
- .wrapper {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 100%;
- }
- .block {
- width: 700rpx;
- height: 300rpx;
- padding-top: 200rpx;
- background-color: #fff;
- border-radius: 20rpx;
- }
- .block .submit-btn {
- width: 600rpx;
- margin: 0 50rpx 0;
- }
- </style>
|