| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695 |
- <template>
- <view class="page">
- <!-- <view class="feedback-title"> -->
- <!-- <text>评价</text> -->
- <!-- <text @tap="chooseMsg">快速键入</text> -->
- <!-- </view> -->
- <!-- <view class="feedback-body">
- <textarea placeholder="请输入你的评价..." v-model="sendDate.content" class="feedback-textare" />
- </view> -->
- <!-- <view class="feedback-title"><text>QQ/邮箱</text></view> -->
- <!-- <view class="feedback-body"><input class="feedback-input" v-model="sendDate.mail" placeholder="方便我们联系你 " /></view> -->
- <!-- <view class="text-white padding bg radius margin-tb">
- <view>
- <view class="text-lg margin-top-sm text-black">商品评价图(可多张)</view>
- <view class="flex" style="overflow: hidden; flex-wrap: wrap">
- <view>
- <view class="margin-top flex margin-right-sm flex-wrap">
- <view
- class="flex"
- style="width: 200rpx; height: 200rpx; margin-right: 2rpx; position: relative"
- v-for="(image, index) in shopBanner"
- :key="index"
- @click="viewImg(index, shopBanner)"
- >
-
- <image :src="image" mode="aspectFill" style="width: 100%; height: 100%"></image>
- <view style="z-index: 9; position: absolute; top: -15rpx; right: -15rpx" @click.stop="removeImg(index)">
- <u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
- </view>
- </view>
- <view class="flex" style="width: 200rpx; height: 200rpx; margin-right: 2rpx; position: relative" @click="addImages(2)" v-if="shopBanner.length < 9">
-
- <view style="width: 200rpx; height: 200rpx; background: #f4f5f6" class="flex justify-center align-center">
- <view>
- <view class="text-center">
- <image src="https://mxys.chuanghai-tech.com/wmfile/20250814/5d7863a9adcd45df89497a870f764f15.png" style="width: 65rpx; height: 55rpx"></image>
- </view>
- <view class="text-center text-black">添加图片</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view> -->
- <!-- <view class="feedback-title feedback-star-view">
- <text>订单评分</text>
- <view class="feedback-star-view">
-
- </view>
- <u-rate :count="5" min-count="1" active-color="#FCD202" v-model="value"></u-rate>
- </view>
- <button type="primary" style="background: #fcd202; margin-top: 32upx" class="feedback-submit" @tap="send_throttle">提交</button> -->
- <!-- 店铺评价区域 -->
- <view class="store">
- <view class="store_box">
- <image class="store_box_img" :src="info.shopCover" mode="aspectFill"></image>
- {{ info.shopName }}
- </view>
- <view class="store_rate">
- <u-rate :count="5" min-count="1" active-color="#FF5733" size="50" gutter="50" v-model="value"></u-rate>
- <view v-if="value == 1" class="store_rate_text">非常差</view>
- <view v-if="value == 2" class="store_rate_text">差</view>
- <view v-if="value == 3" class="store_rate_text">一般</view>
- <view v-if="value == 4" class="store_rate_text">好</view>
- <view v-if="value == 5" class="store_rate_text">非常好</view>
- </view>
- <view class="store_pop" v-if="value">
- <textarea placeholder="请输入你的评价..." v-model="sendDate.content" class="feedback-textare" />
- <view>
- <view class="text-lg margin-top-sm text-black">商品评价图(可多张)</view>
- <view class="flex" style="overflow: hidden; flex-wrap: wrap">
- <view>
- <view class="margin-top flex margin-right-sm flex-wrap">
- <view
- class="flex"
- style="width: 200rpx; height: 200rpx; margin-right: 2rpx; position: relative"
- v-for="(image, index) in shopBanner"
- :key="index"
- @click="viewImg(index, shopBanner)"
- >
- <image :src="image" mode="aspectFill" style="width: 100%; height: 100%"></image>
- <view style="z-index: 9; position: absolute; top: -15rpx; right: -15rpx" @click.stop="removeImg(index)">
- <u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
- </view>
- </view>
- <view class="flex" style="width: 200rpx; height: 200rpx; margin-right: 2rpx; position: relative" @click="addImages(2)" v-if="shopBanner.length < 9">
- <view style="width: 200rpx; height: 200rpx; background: #f4f5f6" class="flex justify-center align-center">
- <view>
- <view class="text-center">
- <image
- src="https://mxys.chuanghai-tech.com/wmfile/20250814/5d7863a9adcd45df89497a870f764f15.png"
- style="width: 65rpx; height: 55rpx"
- ></image>
- </view>
- <view class="text-center text-black">添加图片</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 骑手评价区域 -->
- <view class="store" style="margin-top: 20rpx" v-if="orderTypeExtra == 2">
- <view class="store_box">
- <image class="store_box_img" src="https://mxys.chuanghai-tech.com/wmfile/20250814/fff4dc5d02ea4af881db9685f2e1e61d.png" mode="aspectFill"></image>
- <view class="store_box_msg">
- 骑手配送
- <view class="store_box_name">{{ info.riderNickName }}</view>
- </view>
- </view>
- <view class="store_rate">
- <u-rate :count="5" min-count="1" active-color="#FF5733" size="50" gutter="50" v-model="valueRider" @change="changeRate"></u-rate>
- <view v-if="valueRider == 1" class="store_rate_text">非常差</view>
- <view v-if="valueRider == 2" class="store_rate_text">差</view>
- <view v-if="valueRider == 3" class="store_rate_text">一般</view>
- <view v-if="valueRider == 4" class="store_rate_text">好</view>
- <view v-if="valueRider == 5" class="store_rate_text">非常好</view>
- </view>
- <view class="store_pop" v-if="valueRider">
- <view class="tag_list">
- <view class="tag" :class="{ active: index == activeIndex }" v-for="(item, index) in tagList" :key="index" @click="activeIndex = index">{{ item }}</view>
- </view>
- </view>
- </view>
- <!-- 提交按钮区域 -->
- <view class="btnBox">
- <view class="btn" :class="{ active_btn: value || valueRider }" @tap="send_throttle">提交评价</view>
- </view>
- <!-- 用于图片压缩的canvas画布 -->
- <canvas
- :style="{
- width: cw + 'px',
- height: cw + 'px',
- position: 'absolute',
- zIndex: -1,
- left: '-10000rpx',
- top: '-10000rpx'
- }"
- canvas-id="zipCanvas"
- ></canvas>
- <!--画布结束-->
- </view>
- </template>
- <script>
- import configUrl from '../../common/config.js'
- import getLessLimitSizeImage from '@/utils/imageCompress.js'
- import { throttle } from '@/utils/throttle.js'
- export default {
- data() {
- return {
- shopBanner: [],
- msgContents: ['界面显示错乱', '启动缓慢,卡出翔了', 'UI无法直视,丑哭了', '偶发性崩溃'],
- tagList: [],
- stars: [1, 2, 3, 4, 5],
- imageList: [],
- sendDate: {
- score: 5,
- content: '',
- contact: '',
- goodsId: '',
- ordersId: '',
- orderNumber: '',
- shopId: '',
- riderUserId: ''
- },
- activeIndex: 0,
- value: 0,
- valueRider: 0,
- goodsId: '',
- ordersId: '',
- orderTypeExtra: '',
- info: {},
- //画板边长默认是屏幕宽度,正方形画布
- cw: uni.getSystemInfoSync().windowWidth
- }
- },
- onLoad(e) {
- // console.log(e)
- this.sendDate.goodsId = e.goodsId
- this.sendDate.ordersId = e.ordersId
- this.sendDate.orderNumber = e.orderNumber
- this.sendDate.shopId = e.shopId
- this.sendDate.riderUserId = e.riderUserId
- this.orderTypeExtra = e.orderTypeExtra
- this.info = JSON.parse(decodeURIComponent(e.info))
- // let deviceInfo = {
- // appid: plus.runtime.appid,
- // imei: plus.device.imei, //设备标识
- // p: plus.os.name === 'Android' ? 'a' : 'i', //平台类型,i表示iOS平台,a表示Android平台。
- // md: plus.device.model, //设备型号
- // app_version: plus.runtime.version,
- // plus_version: plus.runtime.innerVersion, //基座版本号
- // os: plus.os.version,
- // net: '' + plus.networkinfo.getCurrentType()
- // };
- // this.sendDate = Object.assign(deviceInfo, this.sendDate);
- },
- methods: {
- // 图片上传
- addImages(e) {
- uni.chooseImage({
- count: 9,
- sourceType: ['album', 'camera'],
- success: (res) => {
- for (let i = 0; i < res.tempFiles.length; i++) {
- //这里的id和页面中写的html代码的canvas的id要一致
- let canvasId = 'zipCanvas'
- //原图的路径
- let imagePath = res.tempFiles[i].path
- //大小限制
- let limitSize = 1024 * 2
- //初始绘画区域是画布自身的宽度也就是屏幕宽度
- let drawWidth = uni.getSystemInfoSync().windowWidth
- let that = this
- getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
- uni.showLoading({
- title: '上传中'
- })
- uni.uploadFile({
- url: configUrl.APIHOST + '/alioss/upload',
- filePath: resPath,
- name: 'file',
- success: (uploadFileRes) => {
- if (this.shopBanner.length < 9) {
- if (JSON.parse(uploadFileRes.data).data) {
- this.shopBanner.push(JSON.parse(uploadFileRes.data).data)
- } else {
- uni.showToast({
- title: '图片上传失败,请重试',
- icon: 'none'
- })
- }
- }
- console.log(this.shopBanner)
- uni.hideLoading()
- },
- fail: () => {
- uni.showToast({
- title: '上传失败',
- icon: 'error'
- })
- }
- })
- })
- }
- }
- })
- },
- // 评价图删除
- removeImg(index) {
- this.shopBanner.splice(index, 1)
- },
- chooseMsg() {
- //快速输入
- uni.showActionSheet({
- itemList: this.msgContents,
- success: (res) => {
- this.sendDate.content = this.msgContents[res.tapIndex]
- }
- })
- },
- send_throttle: throttle(function () {
- this.send()
- }, 2000),
- send() {
- // console.log(this.orderTypeExtra)
- if (this.orderTypeExtra == 1 || this.orderTypeExtra == 3) {
- // 到店取餐
- if (!this.value) {
- uni.showToast({
- icon: 'none',
- title: '请选择评价星级'
- })
- return
- }
- if (!this.sendDate.content) {
- uni.showToast({
- icon: 'none',
- title: '请输入评价内容'
- })
- return
- }
- if (!this.shopBanner.length) {
- uni.showToast({
- icon: 'none',
- title: '请上传商品评价图'
- })
- return
- }
- this.sendReq()
- } else if (this.orderTypeExtra == 2) {
- // 外卖配送
- if (!this.value && !this.valueRider) {
- uni.showToast({
- icon: 'none',
- title: '请选择评价星级'
- })
- return
- }
- if (this.value && !this.sendDate.content) {
- uni.showToast({
- icon: 'none',
- title: '请输入评价内容'
- })
- return
- }
- if (this.value && !this.shopBanner.length) {
- uni.showToast({
- icon: 'none',
- title: '请上传商品评价图'
- })
- return
- }
- this.sendReq()
- }
- },
- sendReq() {
- this.$queue.showLoading('加载中...')
- this.$Request
- .postJson('/app/order/insertEvaluate', {
- goodsId: this.sendDate.goodsId,
- ordersId: this.sendDate.ordersId,
- orderNumber: this.sendDate.orderNumber,
- evaluateMessage: this.sendDate.content,
- score: this.value,
- shopId: this.sendDate.shopId,
- pictures: this.shopBanner.length > 0 ? this.shopBanner.join(',') : '',
- riderUserId: this.sendDate.riderUserId,
- evaluateRiderMessage: this.tagList[this.activeIndex],
- riderScore: this.valueRider
- })
- .then((res) => {
- if (res.code === 0) {
- uni.showToast({
- title: '评价成功'
- })
- setTimeout(function () {
- uni.navigateBack()
- }, 1000)
- } else {
- uni.hideLoading()
- uni.showModal({
- showCancel: false,
- title: '评价失败',
- content: res.msg
- })
- }
- })
- },
- viewImg(i, list) {
- uni.previewImage({
- urls: list,
- current: i
- })
- },
- changeRate(value) {
- this.valueRider = value
- this.activeIndex = 0
- if (this.valueRider == 1 || this.valueRider == 2) {
- this.tagList = ['态度恶劣', '餐品洒了', '货物丢失', '配送超时']
- } else if (this.valueRider == 3) {
- this.tagList = ['一般']
- } else if (this.valueRider == 4 || this.valueRider == 5) {
- this.tagList = ['服务热情', '快速准时', '东西很好', '价格实惠', '文明礼貌', '餐品完好']
- }
- }
- }
- }
- </script>
- <style>
- @font-face {
- font-family: uniicons;
- font-weight: normal;
- font-style: normal;
- src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
- }
- page {
- background-color: #e6e6e6;
- }
- .store {
- box-sizing: border-box;
- padding: 20rpx;
- background-color: #fff;
- }
- .store_box {
- display: flex;
- align-items: center;
- font-size: 32rpx;
- }
- .store_box_img {
- margin-right: 22rpx;
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- }
- .store_box_msg {
- font-size: 32rpx;
- }
- .store_box_name {
- font-size: 28rpx;
- color: #808080;
- }
- .store_rate {
- display: flex;
- align-items: center;
- height: 130rpx;
- }
- .store_rate_text {
- margin-left: 30rpx;
- }
- .tag_list {
- display: flex;
- flex-wrap: wrap;
- }
- .tag {
- margin-right: 30rpx;
- margin-bottom: 30rpx;
- padding: 0 20rpx;
- height: 68rpx;
- line-height: 68rpx;
- text-align: center;
- font-size: 24rpx;
- border-radius: 8rpx;
- background-color: #f2f2f2;
- }
- .active {
- border: 2rpx solid #ff5733;
- color: #ff5733;
- background-color: #fff;
- }
- .btnBox {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 250rpx;
- background-color: #fff;
- }
- .btn {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 626rpx;
- height: 90rpx;
- font-size: 32rpx;
- color: #000;
- border-radius: 110rpx;
- border: 2rpx solid rgba(95, 152, 139, 1);
- background-color: rgba(178, 213, 198, 1);
- }
- .active_btn {
- background-color: #f18731;
- }
- view {
- font-size: 28upx;
- }
- .input-view {
- font-size: 28upx;
- }
- .close-view {
- text-align: center;
- line-height: 14px;
- height: 16px;
- width: 16px;
- border-radius: 50%;
- background: #ff5053;
- color: #ffffff;
- position: absolute;
- top: -6px;
- right: -4px;
- font-size: 12px;
- }
- /* 上传 */
- .uni-uploader {
- flex: 1;
- flex-direction: column;
- }
- .uni-uploader-head {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- }
- .uni-uploader-info {
- color: #b2b2b2;
- }
- .uni-uploader-body {
- margin-top: 16upx;
- }
- .uni-uploader__files {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- }
- .uni-uploader__file {
- margin: 10upx;
- width: 210upx;
- height: 210upx;
- }
- .uni-uploader__img {
- display: block;
- width: 210upx;
- height: 210upx;
- }
- .uni-uploader__input-box {
- position: relative;
- margin: 10upx;
- width: 208upx;
- height: 208upx;
- border: 2upx solid #d9d9d9;
- }
- .uni-uploader__input-box:before,
- .uni-uploader__input-box:after {
- content: ' ';
- position: absolute;
- top: 50%;
- left: 50%;
- -webkit-transform: translate(-50%, -50%);
- transform: translate(-50%, -50%);
- background-color: #d9d9d9;
- }
- .uni-uploader__input-box:before {
- width: 4upx;
- height: 79upx;
- }
- .uni-uploader__input-box:after {
- width: 79upx;
- height: 4upx;
- }
- .uni-uploader__input-box:active {
- border-color: #999999;
- }
- .uni-uploader__input-box:active:before,
- .uni-uploader__input-box:active:after {
- background-color: #999999;
- }
- .uni-uploader__input {
- position: absolute;
- z-index: 1;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- opacity: 0;
- }
- /*问题反馈*/
- .feedback-title {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- padding: 20upx;
- color: #8f8f94;
- font-size: 28upx;
- }
- .feedback-star-view.feedback-title {
- justify-content: flex-start;
- margin: 0;
- }
- .feedback-quick {
- position: relative;
- padding-right: 40upx;
- }
- .feedback-quick:after {
- font-family: uniicons;
- font-size: 40upx;
- content: '\e581';
- position: absolute;
- right: 0;
- top: 50%;
- color: #bbb;
- -webkit-transform: translateY(-50%);
- transform: translateY(-50%);
- }
- .feedback-body {
- font-size: 32upx;
- padding: 16upx;
- margin: 16upx;
- border-radius: 16upx;
- background: #f2f2f2;
- color: #fff;
- }
- .feedback-textare {
- height: 200upx;
- font-size: 30upx;
- line-height: 50upx;
- width: 100%;
- box-sizing: border-box;
- padding: 20upx 30upx;
- color: #8f8f94;
- border-radius: 12rpx;
- background-color: #f5f5f5;
- }
- .feedback-input {
- font-size: 32upx;
- height: 60upx;
- padding: 15upx 20upx;
- line-height: 60upx;
- }
- .feedback-uploader {
- padding: 22upx 20upx;
- }
- .feedback-star {
- font-family: uniicons;
- font-size: 40upx;
- margin-left: 6upx;
- }
- .feedback-star-view {
- margin-left: 20upx;
- }
- .feedback-star:after {
- content: '\e408';
- }
- .feedback-star.active {
- color: #ffb400;
- }
- .feedback-star.active:after {
- content: '\e438';
- }
- .feedback-submit {
- background: #007aff;
- color: #ffffff;
- margin: 20upx;
- }
- </style>
|