Compare commits
1 Commits
main
...
fix/pay-06
Author | SHA1 | Date |
---|---|---|
ch | 110ecd547b | 3 years ago |
Before Width: | Height: | Size: 756 B After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 762 B After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 850 B After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 613 B After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 445 B |
Before Width: | Height: | Size: 445 B |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 375 B |
Before Width: | Height: | Size: 386 B |
Before Width: | Height: | Size: 386 B |
Before Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 9.4 KiB |
@ -1,58 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-23 10:40:04
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-30 22:11:19
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<div class="follow">
|
||||
<b class="follow--title">{{day}}追评:</b>
|
||||
<p class="follow--ctx">{{followComment.commentContent}}</p>
|
||||
<UiImgs v-if="imgs.length" :list="imgs" class="follow--imgs" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import UiImgs from './UiImgs.vue';
|
||||
export default {
|
||||
components: { UiImgs },
|
||||
props : {
|
||||
followComment : {
|
||||
type : Object,
|
||||
default : () => ({})
|
||||
},
|
||||
commentTime : {
|
||||
type : String,
|
||||
default : ''
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
day(){
|
||||
const followTime = (new Date(this.followComment.createTime)).getTime();
|
||||
const commentTime = (new Date(this.commentTime)).getTime();
|
||||
const day = Math.floor((followTime - commentTime) / (24 * 60 * 60 * 1000));
|
||||
return day > 0 ? `${day}天后` : `当天`;
|
||||
},
|
||||
imgs (){
|
||||
let urls = this.followComment.pictureUrl || '';
|
||||
return urls ? urls.split(',') : [];
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.follow{
|
||||
margin-top: 30px;
|
||||
&--title{
|
||||
color: #FF6A19;
|
||||
font-weight: normal;
|
||||
}
|
||||
&--ctx{
|
||||
line-height: 24px;
|
||||
word-break: break-all;
|
||||
}
|
||||
&--imgs{
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,205 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-25 15:29:43
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-30 22:53:16
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
|
||||
<div class="submit">
|
||||
<p class="rate-box" v-if="type === COMMENT.TYPE.COMMENT">
|
||||
<b>满意度评分</b>
|
||||
<el-rate v-model="rate"></el-rate>
|
||||
<span>{{reteDesc}}</span>
|
||||
</p>
|
||||
<el-input type="textarea" class="textarea" placeholder="从多个维度评价,可以帮助更多想买的人哦~"
|
||||
v-model="commentContent" show-word-limit :maxlength="500" :rows="6"/>
|
||||
<div class="operation">
|
||||
<el-upload list-type="picture-card"
|
||||
:on-remove="handleRemove" :limit="6"
|
||||
:action="uploadAction" :data="uploadData"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:on-exceed="handleUploadExceed"
|
||||
:on-error="handleUploadError">
|
||||
<i class="el-icon-plus"></i>
|
||||
<p class="upload-txt">我要晒图</p>
|
||||
</el-upload>
|
||||
<UiButton class="upload-btn" :disabled="isDisabled" @click="handleSubmit">发表评论</UiButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {ApiPostComment} from '@/plugins/api/comment';
|
||||
import {ApiPostGetOssConfig} from '@/plugins/api/oss';
|
||||
import {COMMENT} from '@/constants';
|
||||
|
||||
export default {
|
||||
props : {
|
||||
type : {
|
||||
type : String | Number,
|
||||
default : COMMENT.TYPE.COMMENT
|
||||
},
|
||||
commentDetail : {
|
||||
type : Object,
|
||||
default : () => ({})
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
COMMENT,
|
||||
rate: 5,
|
||||
commentContent : '',
|
||||
uploadData : {},
|
||||
uploadAction : '',
|
||||
fileList : []
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
isEdit(){
|
||||
return (this.commentContent || this.fileList.length > 0) ? true : false
|
||||
},
|
||||
reteDesc(){
|
||||
return COMMENT.RATE_LEVEL[this.rate];
|
||||
},
|
||||
isDisabled(){
|
||||
let status = false
|
||||
if(this.type === COMMENT.TYPE.COMMENT){
|
||||
status = !this.rate || !this.commentContent.trim();
|
||||
}
|
||||
if(this.type === COMMENT.TYPE.FOLLOW_COMMENT){
|
||||
status = !this.commentContent.trim();
|
||||
}
|
||||
return status;
|
||||
}
|
||||
},
|
||||
watch : {
|
||||
isEdit(val){
|
||||
this.$emit('editStatusChange', val)
|
||||
}
|
||||
},
|
||||
methods : {
|
||||
async handleSubmit(){
|
||||
let data = {
|
||||
commentContent : this.commentContent,
|
||||
commentType : this.type,
|
||||
orderProductId : this.commentDetail.orderProductId,
|
||||
pictureUrl : this.fileList.map(i => i.url).join(',')
|
||||
}
|
||||
if(this.type === COMMENT.TYPE.COMMENT){
|
||||
data.productId = this.commentDetail.productId;
|
||||
data.commentScore = this.rate;
|
||||
}else if(this.type === COMMENT.TYPE.FOLLOW_COMMENT){
|
||||
data.originId = data.parentId = this.commentDetail.id;
|
||||
}
|
||||
const {error, result} = await ApiPostComment(data);
|
||||
if(error){
|
||||
this.$message.error(error.message);
|
||||
return false;
|
||||
}
|
||||
this.commentContent = '';
|
||||
this.fileList = [];
|
||||
this.$nextTick(()=>{
|
||||
this.$emit('submit',result);
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取OSS鉴权信息
|
||||
* configId 自定义文件夹 图片存储的文件夹名称
|
||||
* serviceName 服务名
|
||||
*/
|
||||
async getOssCon(){
|
||||
const {error, result} = await ApiPostGetOssConfig({
|
||||
configId : 'account-comment/',
|
||||
serviceName : 'comment'
|
||||
});
|
||||
if(error){
|
||||
this.$message.error(error.message);
|
||||
return false
|
||||
}
|
||||
return result
|
||||
|
||||
},
|
||||
|
||||
async handleBeforeUpload(file) {
|
||||
let result = await this.getOssCon();
|
||||
if(result){
|
||||
this.uploadAction = result.host;
|
||||
this.uploadData = {
|
||||
...this.uploadData,
|
||||
policy : result.policy,
|
||||
OSSAccessKeyId: result.accessId,
|
||||
success_action_status: 200,
|
||||
signature: result.signature,
|
||||
}
|
||||
}
|
||||
Object.assign(this.uploadData, {
|
||||
key: `${result.dir}${"${filename}"}`,
|
||||
name: file.name,
|
||||
});
|
||||
this.fileList.push({
|
||||
url : `${result.host}/${result.dir}${file.name}`,
|
||||
uid : file.uid
|
||||
})
|
||||
},
|
||||
|
||||
handleUploadError(error, file) {
|
||||
this.handleRemove(file)
|
||||
},
|
||||
handleRemove(file) {
|
||||
this.fileList = this.fileList.filter(i => i.uid != file.uid );
|
||||
},
|
||||
handleUploadExceed(){
|
||||
this.$message.warning('最多只能上传6张照片哦~')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.rate-box{
|
||||
display: flex;
|
||||
b{
|
||||
font-weight: normal;
|
||||
margin-right: 10px;
|
||||
color: #666;
|
||||
}
|
||||
span{
|
||||
color: #FF6A19;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
.textarea{
|
||||
height: 138px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
.operation{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 15px;
|
||||
.upload-txt{
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
.upload-btn{
|
||||
height: 40px;
|
||||
width: 100px;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
/deep/{
|
||||
.el-upload--picture-card,.el-upload-list__item{
|
||||
height: 70px !important;
|
||||
width: 70px !important;
|
||||
line-height: 20px;
|
||||
}
|
||||
.el-upload--picture-card{
|
||||
padding-top: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,137 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-24 19:07:45
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-30 19:40:36
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<div class="preview-imgs">
|
||||
<ul>
|
||||
<li v-for="(i, idx) in list" :key="idx" :class="{'active' : curIndex == idx}" >
|
||||
<img :src="i" @click="curIndex = idx"/>
|
||||
</li>
|
||||
</ul>
|
||||
<p v-if="curIndex > -1">
|
||||
<img :src="list[curIndex]" @click="curIndex = -1"/>
|
||||
<span class="prev" @click="prev" v-if="curIndex > 0"></span>
|
||||
<span class="next" @click="next" v-if="curIndex < list.length-1"></span>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props : {
|
||||
list : {
|
||||
type : Array,
|
||||
default : () => ([])
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
curIndex : -1,
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
next(){
|
||||
this.curIndex++;
|
||||
},
|
||||
prev(){
|
||||
this.curIndex--;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.preview-imgs{
|
||||
ul{
|
||||
display: flex;
|
||||
}
|
||||
li{
|
||||
width: 46px;
|
||||
height : 46px;
|
||||
border: 1px solid #eee;
|
||||
margin-right: 10px;
|
||||
padding: 1px;
|
||||
cursor: pointer;
|
||||
img{
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
object-fit: contain;
|
||||
}
|
||||
&.active{
|
||||
border-color: #FF512B;
|
||||
position: relative;
|
||||
&::after{
|
||||
content: '';
|
||||
height: 3px;
|
||||
width: 3px;
|
||||
bottom: -7px;
|
||||
left: 17px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
// transform: rotate(45deg);
|
||||
border: 3px solid #FF512B;
|
||||
border-left-color: transparent;
|
||||
border-right-color: transparent;
|
||||
border-bottom-color: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
p{
|
||||
width: 300px;
|
||||
margin-top: 20px;
|
||||
position: relative;
|
||||
border: 1px solid #eee;
|
||||
img{
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
object-fit: contain;
|
||||
cursor: zoom-out;
|
||||
}
|
||||
&:hover span{
|
||||
display: block;
|
||||
}
|
||||
span{
|
||||
display: none;
|
||||
position: absolute;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: rgba(0,0,0, .5);
|
||||
top : 130px;
|
||||
cursor: pointer;
|
||||
&::after,&::before{
|
||||
position: absolute;
|
||||
display: block;
|
||||
content: '';
|
||||
background: #fff;
|
||||
height: 20px;
|
||||
width: 4px;
|
||||
border-radius: 4px;
|
||||
left: 16px;
|
||||
top: 4px;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
&::after{
|
||||
transform: rotate(-45deg);
|
||||
top: 16px;
|
||||
}
|
||||
&.prev{
|
||||
left: 10px;
|
||||
|
||||
}
|
||||
&.next{
|
||||
right: 10px;
|
||||
&::after{
|
||||
left: 20px;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
&::before{
|
||||
left: 20px;
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,114 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-05-08 01:11:33
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-28 10:39:35
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<div class="main">
|
||||
<img class="icon" src="@/assets/img/order/pay_success.png" />
|
||||
<p>评价成功</p>
|
||||
<div>
|
||||
<UiButton type="grey" @click="$router.back()" :radius="true">返回</UiButton>
|
||||
</div>
|
||||
<div v-if="goodsList.length">
|
||||
<b class="product-title">这些宝贝还在等你得评价哦~</b>
|
||||
<ul class="product">
|
||||
<li v-for="(item, idx) in goodsList" :key="idx">
|
||||
<img :src="item.productPicture"/>
|
||||
<p>{{item.productName}}</p>
|
||||
<UiButton type="grey" @click="$router.replace(`/account/comment?orderId=${item.orderId}`)" >
|
||||
{{item.commentStatus == 1 ? '立即评价' : '立即追评'}}
|
||||
</UiButton>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<BsChosen class="chosen"/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import UiButton from '@/components/UiButton.vue';
|
||||
import {ApiGetCommentOrderDetailList} from '@/plugins/api/order';
|
||||
export default {
|
||||
components: { UiButton },
|
||||
data(){
|
||||
return {
|
||||
goodsList : []
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.getAwaitGoodsList();
|
||||
},
|
||||
methods:{
|
||||
|
||||
async getAwaitGoodsList (){
|
||||
const {error, result} = await ApiGetCommentOrderDetailList({
|
||||
length:6,
|
||||
pageIndex : 1
|
||||
});
|
||||
if(error){
|
||||
this.$message.warning(error.message)
|
||||
}
|
||||
this.goodsList = result.records.map(item => {
|
||||
return {
|
||||
productPicture : item.productImageUrl,
|
||||
productName : item.productName,
|
||||
commentStatus : item.commentStatus,
|
||||
orderId : item.orderId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.main{
|
||||
@include layout-box;
|
||||
text-align: center;
|
||||
padding: 100px 0 40px;
|
||||
}
|
||||
.icon{
|
||||
width: 239px;
|
||||
}
|
||||
b{
|
||||
display: block;
|
||||
}
|
||||
p{
|
||||
margin: 10px 0 25px 0;
|
||||
color: #999;
|
||||
}
|
||||
button{
|
||||
margin: 0 10px 30px;
|
||||
}
|
||||
.product-title{
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
background: #F7F7F7;
|
||||
font-weight: normal;
|
||||
color: #666;
|
||||
padding: 0 16px;
|
||||
}
|
||||
.product{
|
||||
display: flex;
|
||||
// justify-content: flex-start;
|
||||
li{
|
||||
margin:40px 0 0 48px;
|
||||
width: 140px;
|
||||
img{
|
||||
width: 140px;
|
||||
height: 140px;
|
||||
object-fit: contain;
|
||||
|
||||
}
|
||||
p{
|
||||
@include ellipses(2);
|
||||
height: 40px;
|
||||
margin: 10px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,59 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-05-08 01:11:33
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-27 15:37:53
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<div class="main">
|
||||
<img class="icon" src="@/assets/img/order/pay_success.png" />
|
||||
<!-- <b>交易成功</b> -->
|
||||
<p>交易成功</p>
|
||||
<div>
|
||||
<UiButton type="grey" @click="$router.replace(`/`)" :radius="true">返回首页</UiButton>
|
||||
<UiButton type="yellow_gradual" @click="$router.replace(`./comment?orderId=${orderId}`)" :radius="true">去评价</UiButton>
|
||||
</div>
|
||||
</div>
|
||||
<BsChosen class="chosen"/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import UiButton from '@/components/UiButton.vue';
|
||||
import {ApiGetOrderPaySatus} from '@/plugins/api/order';
|
||||
export default {
|
||||
components: { UiButton },
|
||||
data(){
|
||||
return {
|
||||
orderId : this.$route.query.orderId
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
|
||||
|
||||
},
|
||||
methods:{
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.main{
|
||||
@include layout-box;
|
||||
text-align: center;
|
||||
padding: 100px 0 40px;
|
||||
}
|
||||
.icon{
|
||||
width: 239px;
|
||||
}
|
||||
b{
|
||||
display: block;
|
||||
}
|
||||
p{
|
||||
margin: 10px 0 25px 0;
|
||||
color: #999;
|
||||
}
|
||||
button{
|
||||
margin: 0 10px 30px;
|
||||
}
|
||||
</style>
|
@ -1,84 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-25 07:24:32
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-29 14:19:36
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<div class="header">
|
||||
<div class="header--layout">
|
||||
<ul>
|
||||
<li @click="handleJump('detail')" :class="{'active': tabKey =='detail'}">商品详情</li>
|
||||
<li @click="handleJump('comment')" :class="{'active': tabKey =='comment'}">商品评价</li>
|
||||
</ul>
|
||||
<UiButton @click="handleAddCart">加入购物车</UiButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import UiButton from '@/components/UiButton.vue'
|
||||
export default {
|
||||
components: { UiButton },
|
||||
props:{
|
||||
tabKey : {
|
||||
type : String,
|
||||
default : 'detail'
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {}
|
||||
},
|
||||
methods:{
|
||||
handleJump(val){
|
||||
this.$emit('jump', val)
|
||||
},
|
||||
handleAddCart(){
|
||||
this.$emit('addCart')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.header{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 70px;
|
||||
background: #fff;
|
||||
z-index: 11;
|
||||
&--layout{
|
||||
@include layout-box;
|
||||
padding-left: 256px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
ul{
|
||||
display: flex;
|
||||
font-size: 16px;
|
||||
li{
|
||||
margin-right: 50px;
|
||||
height: 70px;
|
||||
line-height: 70px;
|
||||
&.active{
|
||||
color: #FF6A19;
|
||||
position: relative;
|
||||
&::after{
|
||||
display: block;
|
||||
content: '';
|
||||
position: absolute;
|
||||
height: 2px;
|
||||
width: 40px;
|
||||
background: #FF6A19;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,86 +0,0 @@
|
||||
/*
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-20 11:38:48
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-30 11:48:53
|
||||
* @Description: file content
|
||||
*/
|
||||
|
||||
import {axiosTk} from "../axiosTk";
|
||||
import {axios} from "../axios";
|
||||
import { ToAsyncAwait } from "../utils";
|
||||
import ENV from '../config/env';
|
||||
|
||||
const BASE_URL = `${ENV.base_url}/mall/comment`;
|
||||
|
||||
/**
|
||||
* 根据商品获取评论列表未
|
||||
* @param {*} param0
|
||||
*/
|
||||
export const ApiGetCommentList = (params) =>
|
||||
ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/comment`, {
|
||||
params,
|
||||
headers: {
|
||||
notVerifyToken : true
|
||||
}
|
||||
}));
|
||||
|
||||
/**
|
||||
* 根据商品获取评论总数
|
||||
* @param {*} param0
|
||||
*/
|
||||
export const ApiGetCommentCount = ({productId}) =>
|
||||
ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/comment/getAllCommentCountByProductId/${productId}`,{
|
||||
headers: {
|
||||
notVerifyToken : true
|
||||
}
|
||||
}));
|
||||
/**
|
||||
* 根据商品获取标签评论总数
|
||||
* @param {*} param0
|
||||
*/
|
||||
export const ApiGetCommentTabCount = ({productId}) =>
|
||||
ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/comment/listCommentLabel/${productId}`,{
|
||||
headers: {
|
||||
notVerifyToken : true
|
||||
}
|
||||
}));
|
||||
/**
|
||||
* 获取订单评论详情
|
||||
* @param {*} param0
|
||||
*/
|
||||
export const ApiGetOrderCommentDetail = ({orderId}) =>
|
||||
ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/comment/listOrderCommentByOrderId/${orderId}`));
|
||||
/**
|
||||
* 获取商品满意度
|
||||
* @param {*} param0
|
||||
*/
|
||||
export const ApiGetProductSatisfaction = ({productId}) =>
|
||||
ToAsyncAwait(axios.get(`${BASE_URL}/app/comment/getProductSatisfaction/${productId}`));
|
||||
/**
|
||||
* 获取评论详情
|
||||
* @param {*} param0
|
||||
*/
|
||||
export const ApiGetCommentDetail = ({commentId}) =>
|
||||
ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/comment/getCommentDetail/${commentId}`, {
|
||||
headers: {
|
||||
notVerifyToken : true
|
||||
}
|
||||
}));
|
||||
/**
|
||||
* 新增评论
|
||||
* @param {*} param0
|
||||
*/
|
||||
export const ApiPostComment = (data) =>
|
||||
ToAsyncAwait(axiosTk.post(`${BASE_URL}/app/comment`, data));
|
||||
|
||||
|
||||
/**
|
||||
* 更新评论有用数
|
||||
* @param {*} param0
|
||||
*/
|
||||
export const ApiPutCommentUseful = (data) =>
|
||||
ToAsyncAwait(axiosTk.put(`${BASE_URL}/app/comment/updateUsefulCount`, data));
|
||||
|
||||
|
||||
|
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-12 14:06:01
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-14 21:14:54
|
||||
* @Description: file content
|
||||
*/
|
||||
|
||||
import {axiosTk} from "../axiosTk";
|
||||
import { ToAsyncAwait } from "../utils";
|
||||
import ENV from '../config/env';
|
||||
const BASE_URL = `${ENV.base_url}/mall/im`;
|
||||
|
||||
/**
|
||||
* 获取soket登录秘钥
|
||||
*/
|
||||
export const ApiGetSoketTicket = () => ToAsyncAwait(axiosTk.get(`${BASE_URL}/ticket`, {
|
||||
params: {
|
||||
ticketType: 'CONNECT_TICKET'
|
||||
}
|
||||
}));
|
@ -1,26 +0,0 @@
|
||||
/*
|
||||
* @Author: ch
|
||||
* @Date: 2022-05-08 00:44:22
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-29 14:51:00
|
||||
* @Description: file content
|
||||
*/
|
||||
|
||||
|
||||
import {axiosTk} from "../axiosTk";
|
||||
import {ToAsyncAwait} from "@/plugins/utils";
|
||||
import ENV from '../config/env';
|
||||
|
||||
const BASE_URL = `${ENV.base_url}/mall/trade`;
|
||||
/**
|
||||
* 获取微信支付二维码
|
||||
* @param {*} data
|
||||
*/
|
||||
export const ApiPostWxPayCdoeImg = (data) =>
|
||||
ToAsyncAwait(axiosTk.post(`${BASE_URL}/payCenter/wxPay/nativeData`, data));
|
||||
/**
|
||||
* 获取支付宝支付二维码
|
||||
* @param {*} data
|
||||
*/
|
||||
export const ApiPostAliPayCdoeImg = (data) =>
|
||||
ToAsyncAwait(axiosTk.post(`${BASE_URL}/payCenter/aliPay/qr`, data));
|
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* @Author: ch
|
||||
* @Date: 2022-05-08 00:44:22
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-05-08 00:47:55
|
||||
* @Description: file content
|
||||
*/
|
||||
|
||||
|
||||
import {axiosTk} from "../axiosTk";
|
||||
import {ToAsyncAwait} from "@/plugins/utils";
|
||||
import ENV from '../config/env';
|
||||
|
||||
const BASE_URL = `${ENV.base_url}/mall/trade`;
|
||||
|
||||
export const ApiPostPayCdoeImg = (data) =>
|
||||
ToAsyncAwait(axiosTk.post(`${BASE_URL}/pay/wxPay/nativeImage`, data));
|
@ -1,58 +0,0 @@
|
||||
/*
|
||||
* @Author: ch
|
||||
* @Date: 2022-06-12 14:04:56
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-06-13 20:27:34
|
||||
* @Description: file content
|
||||
*/
|
||||
|
||||
import MsbIm from '@/plugins/msbIm' ;
|
||||
import { ToAsyncAwait, FormatJsonSearch } from './utils';
|
||||
import { ApiGetSoketTicket } from '@/plugins/api/im';
|
||||
import ENV from '@/plugins/config/env';
|
||||
const Im = new MsbIm({
|
||||
reconnect: true,
|
||||
});
|
||||
let ImInit = null;
|
||||
export default ({store }) => {
|
||||
ImInit = async () => {
|
||||
const { error, result } = await ApiGetSoketTicket();
|
||||
if (error) {
|
||||
return false;
|
||||
}
|
||||
const par = FormatJsonSearch({
|
||||
client: result.client,
|
||||
ticket: result.ticket,
|
||||
// 1普通用户 2客服链接
|
||||
connect: 1,
|
||||
user: store.state.userInfo.id,
|
||||
nickname: store.state.userInfo.nickname,
|
||||
avatar : store.state.userInfo.avatar
|
||||
})
|
||||
return await ToAsyncAwait(Im.init({
|
||||
url: `${ENV.imUrl}/ws${par}`
|
||||
}))
|
||||
|
||||
};
|
||||
|
||||
Im.interceptors.dataChangeAfter = () => {
|
||||
let data = Im.sessionData.find(i => {
|
||||
return (i.type === 4 && (typeof i.payload === 'string' ? JSON.parse(i.payload).type === 'system' : false));
|
||||
}) || {}
|
||||
let msgCount = data.unreadCount || 0;
|
||||
store.commit('setSocketMsgData', JSON.parse(JSON.stringify(data)));
|
||||
store.commit('setUnreadCount', msgCount);
|
||||
}
|
||||
|
||||
Im.interceptors.onClose = () => {
|
||||
Im.setSessionData([]);
|
||||
Im.setCurSessionId(null);
|
||||
store.commit('setSocketMsgData', {});
|
||||
store.commit('setUnreadCount', 0);
|
||||
}
|
||||
|
||||
}
|
||||
export {
|
||||
Im,
|
||||
ImInit
|
||||
}
|