Files
medicine_app/pages/bookShop/orderList.vue
2024-12-11 09:50:07 +08:00

1461 lines
40 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view class="container commonPageBox commonDetailPage" style="background-color: #f6f7fb">
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar title="我的订单" bgColor="#258feb" fontColor="#fff" :backState="2000">
<!-- <template slot="left">
<u-icon
@click="goHome"
name="home"
color="#fff"
size="22"
style="display: inline-block; margin-left: 30rpx"
></u-icon>
</template> -->
</z-nav-bar>
<!-- 顶部导航栏 -->
<!-- <z-nav-bar backState="2000" title="我的订单"></z-nav-bar> -->
<view class="cateList flexbox">
<common-sticky itemStyle="width:20%; height: 68rpx;font-size:24rpx;" :list="ordersTabs" label="name"
:currentCateIndex="currentCateIndex" @handleselectCate="ordersTabCLi"></common-sticky>
</view>
<!-- 站位 -->
<!-- <view v-if="ordersListTab == 1"> -->
<view class="order_box" :style="`height: calc(100% - ${(80 + statusBarHeight) * 2}rpx);`"
style="background-color: #f2f2f2">
<common-list imgUrl="url" indexKey="orderSn" noDataIcon="data" :isScroll="true"
:isLoadingHide="isLoadingHide" :isNoIcon="true" :isCondition="true" :dataList="newList"
@hancleClick="toDetail" @lower="onReachBottom1" :pagination="pagination" label="title">
<view slot="labelSlot" slot-scope="slotProps">
<view class="orderInfo color_shandow">
<view class="mainContent">
<view class="btns" style="margin-top: 0rpx">
<view class="flexbox opbtns" style="letter-spacing: 1rpx">
<view style="
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
line-height: 30rpx;
color: #9b9b9b;
font-size: 26rpx;
font-weight: 400;
">{{ slotProps.row.orderSn }}
<u-tag @click="handleCopy(slotProps.row.orderSn, '订单编号')" borderColor="#258feb"
color="#258feb" text="复制" plain style="float: right" size="mini"
type="success"></u-tag>
</view>
</view>
</view>
<view class="item">
<view class="item_top" style="margin-top: 10rpx; margin-bottom: 0">
<view class="source_app"></view>
<view style="text-align: left">
<text class="orderstatus" v-show="slotProps.row.orderStatus == 0">未付款</text>
<text class="orderstatus" v-show="slotProps.row.orderStatus == 1">待发货</text>
<text class="orderstatus" v-show="slotProps.row.orderStatus == 2">已发货</text>
<text class="orderstatus" v-show="slotProps.row.orderStatus == 3">交易成功</text>
<text class="orderstatus" v-show="slotProps.row.orderStatus == 4">交易失败</text>
<text class="orderstatus" v-show="slotProps.row.orderStatus == 5">已过期</text>
</view>
</view>
<view v-if="slotProps.row.orderType == 'relearn'" class="bookinfolist">
<image class="feng fengPoint" src="/static/icon/fugou.png" mode="aspectFill">
</image>
<!-- <view class="description" >课程复读订单
</view> -->
<view class="btns flexbox">
<view class="booknameleft">
{{ slotProps.row.remark }}
</view>
<view style="
line-height: 58rpx;
color: #333;
font-size: 26rpx;
font-weight: 700;
">
<text style="font-size: 20rpx"></text>
</view>
</view>
<!-- <view
class="btns flexbox"
style="color: #9f9f9f; margin-top: 10rpx; font-size: 24rpx"
>
下单时间{{ slotProps.row.createTime }}
</view> -->
</view>
<view v-if="slotProps.row.orderType == 'vip'" class="bookinfolist">
<image class="feng fengPoint" src="/static/icon/vip.png" mode="aspectFill"></image>
<!-- <view class="description" v-html="item.content">
</view> -->
<view class="btns flexbox">
<view class="booknameleft">
{{ slotProps.row.vipBuyConfigEntity?slotProps.row.vipBuyConfigEntity.title:' ' }}
</view>
<view style="
line-height: 58rpx;
color: #333;
font-size: 26rpx;
font-weight: 700;
">
<text style="font-size: 20rpx"></text>
</view>
</view>
<view class="btns flexbox"
style="color: #9f9f9f; margin-top: 10rpx; font-size: 24rpx">
下单时间{{ slotProps.row.createTime }}
</view>
</view>
<view v-if="slotProps.row.orderType == 'point'" class="bookinfolist">
<image class="feng fengPoint" src="/static/icon/pay_3.png" mode="aspectFill">
</image>
<!-- <view class="description" v-html="item.content">
</view> -->
<view class="btns flexbox">
<view class="booknameleft">
充值
{{ slotProps.row.bookBuyConfigEntity.money }}天医币
</view>
<view style="
line-height: 58rpx;
color: #333;
font-size: 26rpx;
font-weight: 700;
">
</view>
</view>
<view class="btns flexbox"
style="color: #9f9f9f; margin-top: 10rpx; font-size: 24rpx">
下单时间{{ slotProps.row.createTime }}
</view>
</view>
<view v-if="slotProps.row.orderType == 'order'">
<view v-for="(item2, index2) in slotProps.row.productList"
:key="slotProps.row.orderId" class="bookinfolist">
<view v-if="item2.product">
<view class="feng" v-if="item2.product && item2.product.productImages">
<image :key="Date.now()" style="width: 100%; height: 100%"
mode="aspectFit" :src="item2.product.productImages"></image>
</view>
<view v-else class="feng" style="
color: #c0c4cc;
font-size: 22rpx;
line-height: 140rpx;
text-align: center;
">暂无封面图</view>
<!-- <view class="description" v-html="item.content">
</view> -->
<view class="btns flexbox">
<view class="booknameleft">{{
item2.product && item2.product.productName
? item2.product.productName
: ""
}}</view>
<view style="
line-height: 58rpx;
color: #333;
font-size: 26rpx;
font-weight: 700;
">
<text style="font-size: 20rpx"></text>
{{
item2.product.price ? item2.product.price : ""
}}
</view>
</view>
<view class="btns flexbox" style="margin-top: 10rpx">
<view class="left" style="color: #c0c4cc"></view>
<view class="right flexbox opbtns" style="color: #c0c4cc">
×{{ item2.quantity ? item2.quantity : "" }}
</view>
</view>
</view>
<view v-else>
<view class="feng"></view>
<view class="btns flexbox">
<view class="booknameleft" style="color: #181818">未知商品</view>
<view style="" class="right flexbox opbtns product_quantity">
×{{ item2.quantity ? item2.quantity : "" }}
</view>
</view>
</view>
</view>
</view>
<view style="margin-top: 10rpx; overflow: hidden">
<view class="btns flexbox" style="float: right; width: auto !important">
<view class="right flexbox opbtns" style="
width: auto;
line-height: 44rpx;
letter-spacing: 1rpx;
display: flex;
align-items: center;
">
<view style="
line-height: 46rpx;
color: #000;
font-size: 28rpx;
font-weight: 500;
margin-right: 10rpx;
">实付款</view>
<view style="
/* margin-top: 8rpx; */
line-height: 46rpx;
color: #333;
font-size: 30rpx;
font-weight: 700;
">
<text style="font-size: 20rpx"></text>
<text v-if="slotProps.row.orderType == 'point'">
{{ slotProps.row.bookBuyConfigEntity.realMoney }}
</text>
<text v-else>
{{
slotProps.row.realMoney ||
slotProps.row.realMoney == 0
? slotProps.row.realMoney
: ""
}}
</text>
</view>
</view>
</view>
<view class="btns flexbox" style="
margin-top: 0rpx;
float: right;
width: auto;
margin-left: 20rpx;
" v-if="
(slotProps.row.addressId == 0 ||
slotProps.row.addressId == null) &&
slotProps.row.orderType == 'order' &&
slotProps.row.jfDeduction > 0
">
<view class="right flexbox opbtns" style="
line-height: 44rpx;
letter-spacing: 1rpx;
display: flex;
align-items: center;
"><text style="color: #9b9b9b"> </text>
<view style="
line-height: 46rpx;
color: #9b9b9b;
font-size: 24rpx;
font-weight: 500;
margin-right: 10rpx;
">积分抵扣</view>
<view style="
/* margin-top: 8rpx; */
line-height: 46rpx;
color: #9b9b9b;
font-size: 26rpx;
font-weight: 700;
">
<text style="font-size: 20rpx">¥</text>
{{ slotProps.row.jfDeduction }}
</view>
</view><text style="color: #9b9b9b"></text>
</view>
</view>
<view class="operation_box boxShadow" v-if="slotProps.row.isShowMore == true">
<view v-if="slotProps.row.orderStatus == 0"
@click.native.stop="canceOrder(slotProps.row)">取消订单</view>
</view>
<view class="btns flexbox" style="margin-top: 10rpx">
<view class="left" style="color: #c0c4cc" @click.native.stop="
openMore(slotProps.row, slotProps.rowIndex)
">更多</view>
<view class="right flexbox opbtns">
<view class="orderstatusbtn orderstatusbtn_success"
v-if="slotProps.row.orderStatus == 0 && slotProps.row.paymentMethod != 3"
@click.stop="goPay(slotProps.row)">继续付款</view>
<view class="orderstatusbtn" v-if="slotProps.row.orderStatus == 1">催发货</view>
<view class="orderstatusbtn" v-if="slotProps.row.orderStatus == 2"
@click.native.stop="seeExpressDetail(slotProps.row)">查看物流</view>
<view class="orderstatusbtn" v-if="slotProps.row.orderStatus == 2"
@click.native.stop="OverOrder(slotProps.row)">确认收货</view>
<view class="orderstatusbtn" v-if="slotProps.row.orderStatus == 3">申请售后</view>
<!-- <view
class="orderstatusbtn"
v-if="item.orderStatus == 3 && userRecordid == null"
@click.native.stop="pingji(item.productId)"
>评价</view
> -->
<!-- <view class="orderstatusbtn" v-if="item.orderStatus == 3 && userRecordid != null" @click.stop="showZhuiping(item.productId)">追评</view> -->
</view>
</view>
<view style="border-bottom: 2rpx solid #e9e9e9; height: 50rpx"
v-if="slotProps.rowIndex < slotProps.row.length - 1"></view>
</view>
<!-- <view class="btns" style="margin-top: 10rpx">
<view class="flexbox opbtns" style="">
<view
style="
width: 100%;
line-height: 28rpx;
color: #9b9b9b;
font-size: 26rpx;
font-weight: 400;
display: flex;
align-items: center;
"
><u-icon
name="clock"
color="#9b9b9b"
style="margin-right: 10rpx"
size="20"
></u-icon
>{{ slotProps.row.createTime }}</view
>
</view>
</view> -->
</view>
</view>
<!-- <text v-if="slotProps.row.conditions!='03'">【试听】</text> -->
</view>
</common-list>
</view>
<!-- <view v-if="status == 0" style="text-align: center">
<u-loading-icon style="display: inline-block"></u-loading-icon>
<font
style="
vertical-align: super;
margin-left: 10px;
font-size: 26rpx;
color: #909399;
"
>努力加载中</font
>
</view>
<view v-if="status == 1" style="padding-bottom: 20rpx">
<u-divider v-if="newList.length > 0" text="全部加载完成"></u-divider>
<u-divider v-else text="暂无订单"></u-divider>
</view> -->
<!-- 对话框 -->
<u-popup :show="pingjiaShow" :round="10" @close="closePingjia">
<view class="tanchu">
<view class="dp_title" v-if="pjType != 'zhuiping'">添加评价</view>
<view class="dp_title" v-else>添加追评</view>
<view style="max-height: 1000rpx; overflow-y: scroll">
<uni-forms :modelValue="Pform">
<!-- 评价图片 -->
<!-- end -->
<!-- <uni-forms-item name="comment" label-width="0">
<uni-easyinput type="textarea" v-model="Pform.comment" placeholder="请输入您的商品评价" />
</uni-forms-item> -->
</uni-forms>
<!-- <u-button type="success" @click="submitPJ">提交评价</u-button> -->
<!-- 提交 -->
<view class="padding-bottom-sm flex padding-lr-sm" style="border-bottom: 1px solid #eeeeee">
<view class="mb30" v-if="pjType != 'zhuiping'">
<view :class="['star', Pform.star >= 1 ? 'starLight' : 'starGray']" @click="getStar(1)">
</view>
<view :class="['star', Pform.star >= 2 ? 'starLight' : 'starGray']" @click="getStar(2)">
</view>
<view :class="['star', Pform.star >= 3 ? 'starLight' : 'starGray']" @click="getStar(3)">
</view>
<view :class="['star', Pform.star >= 4 ? 'starLight' : 'starGray']" @click="getStar(4)">
</view>
<view :class="['star', Pform.star >= 5 ? 'starLight' : 'starGray']" @click="getStar(5)">
</view>
</view>
<view class="mb30" v-if="pjType != 'zhuiping'">
<!-- <uni-file-picker :auto-upload="false" ref="files" @delete="deleteImg" limit="5" @success="upSuccess" @select="select" v-model="Pform.img" fileMediatype="image" :image-styles="imageStyles"/> -->
<u-upload :fileList="Pform.img" @afterRead="afterRead" @delete="deletePic" multiple
:maxCount="4" width="80" height="80" :previewFullImage="true">
</u-upload>
</view>
<view class="flex-sub flexbox">
<i @click="showEmj()" :class="emojiIcon"></i>
<!-- <input type="text" @focus="InputFocus" @blur="InputBlur" v-model="message" @input="textareaBInput" placeholder-style="font-size:24rpx;color:#aaaaaa;" placeholder="请输入您要发送的内容"></input> -->
<textarea class="textarea" v-model="Pform.comment" @focus="InputFocus" @blur="InputBlur"
@input="textareaBInput" placeholder-style="font-size:24rpx;color:#aaaaaa;"
placeholder="请输入您要发送的内容"></textarea>
</view>
<view class="">
<!-- <button class="cu-btn bg-gradual-blue shadow-blur">发送</button> -->
<u-button type="success" @click="submitPJ" v-if="pjType != 'zhuiping'">提交评价</u-button>
<u-button type="success" @click="zhuiping" v-else>提交追评</u-button>
</view>
</view>
<view style="position: relative">
<emotion @emotion="handleEmj" :height="220" v-if="isShowEmj" :windowWidth="windowWidth">
</emotion>
</view>
</view>
</view>
</u-popup>
<z-navigation></z-navigation>
<u-action-sheet :closeOnClickAction="true" :closeOnClickOverlay="true" :actions="moreList" :show="isShowMore"
cancelText="关闭" @close="isShowMore = false" @select="selectClick"></u-action-sheet>
<!-- <music-play :playData="playData"></music-play> -->
</view>
</template>
<script>
import $http from "@/config/requestConfig.js";
import emotion from "@/bkhumor-emojiplus/components/bkhumor-emojiplus/bkhumor-emojiplus.vue";
// import musicPlay from "@/components/music.vue";
import {
setPay,
setPayAssign,
setWXPay
} from "@/config/utils";
// import { data } from 'jquery';
import {
mapState,
mapMutations
} from "vuex";
export default {
data() {
return {
isShowMore: false,
come: "2",
isShowTab: false,
isLoadingHide: false,
moreList: [{
name: "取消订单",
key: "false",
}, ],
currentCateIndex: 0,
pagination: {
// 请求参数
page: 1, //页码
limit: 20, //每页显示
total: 0, //总条数
},
// loadingNow : false,
playData: {},
options: {},
emojiIcon: "cuIcon-emoji",
windowWidth: 0,
bookid: null,
booklistpage: 1,
productList: [],
productInfo: {},
emoji: [],
Files: [],
page: 1,
pageSize: 10,
total: 0,
status: 3,
shupingList: [],
bfaid: null,
ordersTabs: [{
name: "全部",
value: -1,
badge: {},
},
{
name: "待付款",
value: 0,
badge: {},
},
{
name: "待发货",
value: 1,
badge: {},
},
{
name: "待收货",
value: 2,
badge: {},
},
{
name: "已完成",
value: 3,
badge: {},
},
],
selectOrderInfo: {},
ordersListTab: 1,
newestpage: 1,
// hotestpage: 1,
// booksetpage: 1,
newList: [],
// hotList:[],
// bookList:[],
map: {},
userRecordid: null, // 用户的评价状态
pingjiaShow: false, //添加评价
Pform: {
// 评价表单
star: 0,
comment: "",
img: [],
html: "",
},
isShowEmj: false,
pjType: "",
};
},
onPullDownRefresh() {
console.log("下拉刷新了");
uni.stopPullDownRefresh();
this.newestpage = 1;
// this.hotestpage = 1
// this.booksetpage = 1
this.newList = [];
// this.hotList = []
// this.bookList = []
this.getBookList(this.ordersListTab, false);
},
onReachBottom() {
this.newestpage++;
// this.hotestpage++
// this.booksetpage++
this.getBookList(this.ordersListTab, false);
},
onLoad(e) {
this.windowWidth = uni.getSystemInfoSync().windowWidth;
console.log(e, "onload111");
// this.bookid = e.bookid
this.options = e;
// this.newList = [];
// this.pagination = {
// page: 1, //页码
// limit: 20, //每页显示
// total: 0, //总条数
// };
// this.$nextTick(() => {
// this.ordersTabCLi(this.ordersTabs[0],0);
// // this.getBookList(null, false);
// });
},
async onShow() {
uni.hideTabBar();
this.newList = [];
this.pagination = {
page: 1, //页码
limit: 20, //每页显示
total: 0, //总条数
};
this.$nextTick(async () => {
await this.ordersTabCLi(this.ordersTabs[0], 0);
});
},
async onTabItemTap() {
this.newList = [];
this.pagination = {
page: 1, //页码
limit: 20, //每页显示
total: 0, //总条数
};
// this.$nextTick(async () => {
// await this.ordersTabCLi(this.ordersTabs[0], 0);
// });
},
onReady() {},
computed: {
...mapState(["userInfo"]),
},
methods: {
...mapMutations(["setLoadingShow"]),
getImageUrl(url) {
// 通过在URL后面添加时间戳来避免缓存
return `${url}?timestamp=${Date.now()}`;
},
selectClick(index) {
console.log("index at line 609:", index);
if (index.key == "false") {
this.isShowMore = false;
this.canceOrder(this.selectOrderInfo);
}
},
openMore(row, index) {
this.selectOrderInfo = row;
this.isShowMore = true;
},
handleCopy(value, title) {
this.$commonJS.handleCopy(value, title);
},
onReachBottom1() {
// 上拉加载
// 当列表数量不大于或等于总数量,则再次调用接口请求数据
if (this.newList.length >= this.pagination.total) return;
this.pagination.page++;
this.getBookList(this.ordersListTab, false);
},
goHome() {
if (this.options.type == "order") {
uni.switchTab({
url: "/pages/homePage/index/index",
});
} else {
uni.navigateBack({
delta: 1,
});
}
},
// 切换tab状态
ordersTabCLi(data, index) {
this.currentCateIndex = index;
this.pagination = {
page: 1, //页码
limit: 20, //每页显示
total: 0, //总条数
};
console.log("data at line 454:", data);
this.ordersListTab = data.value;
this.newestpage = 1;
// this.hotestpage = 1
// this.booksetpage = 1
this.newList = [];
// this.hotList = []
// this.bookList = []
this.getBookList(this.ordersListTab, false);
},
// 查看本书更多书评
toMore(val) {
console.log(val, "val");
uni.navigateTo({
url: "../comments/comments?bookid=" + val.id,
});
},
// 订单详情
toDetail(val) {
console.log(val, "val");
// uni.navigateTo({
// url:'../bookShop/commentsDetail?bookid='+val.bookid+'&bfa_id='+val.id
// })
uni.navigateTo({
url: "/pages/bookShop/orderLCont?orderId=" +
val.orderId +
"&orderType=" +
val.orderStatus +
"&orderSn=" +
val.orderSn,
});
},
getBookList(flag, refreshflag) {
this.isLoadingHide = false;
var that = this;
// 根据tab不同获取最新书评、最热书评、书集列表
// uni.showLoading({
// title: '加载中'
// });
// 顶部红点数量
$http
.request({
url: "common/buyOrder/getBuyOrderNumByStatus",
method: "POST",
data: {
userId: that.userInfo.id,
come: this.come,
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then((res) => {
// 订单状态
// * 0: 待付款
// * 1: 待发货
// * 2: 已发货
// * 3已完成
// * 4: 交易失败
// * 5: 已过期
console.log("res at line 757:", res);
that.map = res.data;
that.ordersTabs.map((e) => {
if (e.value == 0 || e.value == 1 || e.value == 2) {
var numList = that.map.filter((v) => v.order_status == e.value);
console.log("num at line 771:", numList);
if (numList.length > 0) {
e.badge = {
value: numList[0].num,
};
} else {
e.badge = {};
}
} else {
e.badge = {};
}
});
// this.$set('this.ordersTabs',)
that.$forceUpdate();
})
.catch((e) => {
console.log(e);
});
var params = {
userId: this.userInfo.id,
come: this.come,
orderStatus: flag == -1 ? "" : flag, //传null为全部订单状态 0-未付款 1-待发货 2-已发货 3-交易成功 4-交易失败 5-过期
...this.pagination,
// limit: 10,
// page: this.newestpage,
};
this.$http
.request({
url: "common/buyOrder/commonBuyOrderList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: params,
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then((res) => {
console.log("订单列表内容获取成功", res);
that.pagination.total = res.data.total;
if (res.data.total == 0) {
this.isLoadingHide = true;
}
if (res.code == 0 && res.data && res.data.records.length > 0) {
that.newList = that.newList.concat(res.data.records);
} else {
//
}
if (res.data.records.length != 10) {
that.status = 1;
} else {
that.status = 0;
}
})
.catch((e) => {
console.log(e);
});
},
// 支付
goPay(payItem) {
console.log(payItem, "订单数据");
if (payItem.paymentMethod == 2) {
console.log("阿里支付");
setPay({
typePay: "alipay",
subject: "order",
totalAmount: payItem.realMoney,
type: 2,
relevanceoid: payItem.orderSn,
customerId: this.userInfo.id,
},
(res) => {
if (res.success) {
uni.showToast({
title: "支付成功",
});
} else {
uni.showToast({
title: "支付失败",
icon: "none",
image: "../../static/icon/ic_close.png",
});
}
this.getOrderList();
}
);
} else if (payItem.paymentMethod == 1) {
console.log("微信支付");
let data1 = {
orderSn: payItem.orderSn,
buyOrderId: null,
totalAmount: payItem.realMoney,
};
console.log(data1, "data1");
setWXPay(data1, (res) => {
if (res.success) {
uni.showToast({
title: "支付成功",
});
} else {
console.log(res);
if (res.data.errMsg.indexOf("User canceled") != -1) {
uni.showToast({
title: "用户取消支付",
icon: "none",
image: "../../static/icon/ic_close.png",
});
} else {
uni.showToast({
title: "支付失败",
icon: "none",
image: "../../static/icon/ic_close.png",
});
}
}
});
} else if (payItem.paymentMethod == 3 && this.ordersListTab == 0) {
// 苹果充值
console.log("苹果二次支付");
uni.showModal({
content: 'apple内购订单不支持继续支付请重新发起支付申请并完成支付',
confirmText: '好的',
showCancel: false
})
// if (this.isAndorid) {
// uni.showModal({
// title: "提示",
// showCancel: false,
// content:
// "很抱歉,当前订单属于苹果系统内购订单,安卓系统无法完成支付操作,您可切换到苹果系统进行支付,也可以取消该订单,并重新下单",
// });
// } else {
// this.iphonepay(payItem);
// }
} else if (payItem.paymentMethod == 4) {
console.log('天医币二次支付')
}
},
// 取消订单
canceOrder(item) {
console.log('item.orderSn', item);
uni.showModal({
title: "提示",
content: "确定要取消订单吗?",
confirmText: "取消订单",
cancelText: "考虑一下",
confirmColor: "#c96713",
cancelColor: "#555",
success: (res) => {
if (res.confirm) {
this.$http
.post(
"book/buyOrder/appDelete?orderId=" + item.orderId
)
.then((res) => {
if (res.code == 0) {
uni.showToast({
icon: "none",
title: "取消订单成功",
});
// uni.switchTab({
// url: './orderList'
// });
this.newestpage = 1;
this.newList = [];
this.getBookList(this.ordersListTab, false);
}
});
}
},
});
},
// canceOrder(item) {
// uni.showModal({
// title: '提示',
// content: '确定要取消订单吗?',
// confirmText: "取消订单",
// cancelText: "考虑一下",
// confirmColor: '#c96713',
// cancelColor: '#555',
// success: res => {
// if (res.confirm) {
// uni.showLoading()
// $http.request({
// url: "book/buyOrder/cancelOrder",
// method: "GET", // POST、GET、PUT、DELETE具体说明查看官方文档
// data,
// header: { //默认 无 说明:请求头
// 'Content-Type': 'application/json'
// },
// }).then(res => {
// if (res.code == 0) {
// uni.hideLoading()
// uni.showToast({
// title: '订单已取消',
// icon: 'success',
// duration: 1000
// })
// this.getBookList(this.ordersListTab, false)
// }
// })
// } else if (res.cancel) {}
// }
// });
// },
// 查看物流
seeExpressDetail(item) {
// console.log(item, this.sheetList.length)
// if(this.sheetList.length > 1){
// this.sheetListShow = true
// }else if(this.sheetList.length == 1){
// 直接展示详情
uni.navigateTo({
url: "./deliverDetail?orderSn=" +
item.orderSn +
"&expressOrderSn=" +
item.expressList[0].expressOrderSn,
});
// }
},
// 确认收货
OverOrder(item) {
uni.showModal({
title: "提示",
content: "确认收货?",
success: (res) => {
let data = {
orderId: item.orderId,
orderStatus: "3",
};
if (res.confirm) {
uni.showLoading();
$http
.request({
url: "book/buyOrder/update",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then((res) => {
if (res.code == 0) {
uni.hideLoading();
uni.showToast({
title: "收货成功",
icon: "success",
duration: 1000,
});
this.newestpage = 1;
this.newList = [];
this.getBookList(this.ordersListTab, false);
}
});
} else if (res.cancel) {}
},
});
},
closePingjia() {
this.pingjiaShow = false;
this.Pform.comment = "";
this.Pform.html = "";
this.emoji = [];
},
// 提交评价
submitPJ() {
if (this.Pform.comment != "") {
let data = {
userid: this.userInfo.id,
orderSn: this.orderSn,
bookid: this.productID,
// 'content': this.Pform.html,
content: this.Pform.comment,
starLevel: this.Pform.star,
images: this.Pform.img,
// 'emoji':this.emoji // 表情数组
};
// console.log(data,'data')
$http
.request({
url: "buy/record/UserRecordcomment",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then((res) => {
if (res.code == 0) {
uni.showToast({
title: "评价成功!",
icon: "success",
});
this.pingjiaShow = false;
this.Pform.comment = "";
this.Pform.html = "";
this.emoji = [];
setTimeout(() => {
uni.navigateBack({
delta: 1,
});
}, 2000);
}
});
} else {
uni.showToast({
title: "请先输入您的评价内容 ",
icon: "none",
});
}
},
// 添加评价
pingji(id) {
console.log(id);
this.pjType = "";
this.productID = id;
this.pingjiaShow = true;
},
getStar(i) {
this.Pform.star = i;
},
InputBlur(e) {},
InputFocus(e) {
this.isShowEmj = false;
this.emojiIcon = "cuIcon-emoji";
this.$emit("foc");
},
textareaBInput(e) {
console.log(e, "e");
this.Pform.comment = e.detail.value;
/// this.Pform.html = e.detail.value
},
showEmj() {
let bool = !this.isShowEmj;
if (bool) {
this.emojiIcon = "cuIcon-keyboard";
} else {
this.emojiIcon = "cuIcon-emoji";
}
this.isShowEmj = bool;
this.$emit("show");
},
deletePic() {
let that = this;
that.Pform.img.splice(0, 1);
//console.log(that.Pform.img)
},
afterRead(e) {
//console.log(e)
let that = this;
for (var i = 0; i < e.file.length; i++) {
//console.log(i,e.file[i].url)
uni.uploadFile({
url: this.$baseUrl + "oss/fileoss",
filePath: e.file[i].url,
//files:e.file,
name: "file",
formData: {},
success: (res) => {
that.Pform.img.push({
url: JSON.parse(res.data).url,
});
},
});
}
},
// 获得输入的表情数组
handleEmj(i) {
console.log(i, "i---------");
this.inputValue = i;
// console.log(this.inputValue);
if (i.emotioni == "[em_98]") {
//匹配最后一个表情符号并删除11。
this.Pform.comment = this.Pform.comment.replace(
/(\[[^\]]+\]|[\s\S])$/,
""
);
if (this.emoji.length > 0) {
this.emoji = this.emoji.slice(0, -1);
}
} else {
this.emoji.push({
tag: i.emotion,
name: i.emotioni
});
// console.log(this.emoji,'this.emoji')
this.Pform.comment += i.emotioni;
/// this.Pform.html += i.emotion
}
},
},
components: {
// musicPlay,
emotion,
},
};
</script>
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.ordersTabs {
// margin: 70rpx 0 0 0;
width: 730rpx;
// padding: 0 3% 3% 3%;
position: fixed;
// top: 80rpx;
background-color: #f7faf9;
z-index: 100;
.ordersdefine {
display: inline-block;
padding: 20rpx 0 20rpx 0;
// margin: 40rpx 0 15rpx 0;
width: 140rpx;
text-align: center;
font-size: 30rpx;
position: relative;
.ordersnum {
position: absolute;
top: 8rpx;
right: 0rpx;
background-color: red;
// border:1rpx solid #a3a3a3;
border-radius: 40rpx;
width: 28rpx;
height: 28rpx;
font-size: 20rpx;
font-weight: 500;
color: rgb(255, 255, 255);
}
}
.ordStyle {
// border-bottom: 4rpx solid #54a966;
// color: #54a966;
font-weight: bold;
}
}
.orderstatusbtn {
width: 160rpx !important;
height: 60rpx;
line-height: 55rpx !important;
color: #1d1d1d;
border: 1px solid #a0a0a0;
border-radius: 30rpx;
// padding: 0 10rpx;
text-align: center;
margin-left: 20rpx;
font-size: 28rpx;
}
.orderstatusbtn_success {
color: #f5342b;
border-color: #f5342b;
}
.flexbox {
display: flex;
}
.container {
padding: 0 10px;
}
.star {
display: inline-block;
width: 20px;
height: 20px;
margin-right: 10rpx;
}
.starGray {
background: url(../../static/icon/star_greey.png) no-repeat;
background-size: contain;
}
.starLight {
background: url(../../static/icon/star_light.png) no-repeat;
background-size: contain;
}
.cuIcon-emoji {
background: url(../../static/biaoqing.png) no-repeat;
background-size: contain;
display: block;
margin-right: 20rpx;
width: 30px;
}
.cuIcon-keyboard {
background: url(../../static/biaoqing.png) no-repeat;
background-size: contain;
display: block;
width: 30px;
}
.tanchu {
padding: 40rpx 30rpx 40rpx 30rpx;
position: relative;
.dp_title {
font-size: 32rpx;
margin-bottom: 50rpx;
color: #555;
text-align: center;
font-weight: bold;
}
.dp_add {
position: absolute;
top: 40rpx;
right: 30rpx;
font-size: 22rpx;
background-color: #fd6004;
color: #fff;
border-radius: 10rpx;
padding: 5rpx 10rpx;
.u-icon {
display: inline-block;
margin-right: 5rpx;
}
}
}
.quesheng {
text-align: center;
margin-top: 100rpx;
color: #8b8a91;
padding-bottom: 20rpx;
padding-top: 20rpx;
}
.gengduoshuping {
text-align: right;
color: #0044ff;
padding-bottom: 20rpx;
padding-top: 20rpx;
}
.orderInfo {
position: relative;
justify-content: space-between;
// margin-bottom: 15px;
background-color: #fff;
padding: 20rpx 20rpx;
border: 1px splid #999;
box-sizing: border-box;
// padding-bottom: 20rpx;
border-radius: 20rpx;
margin-bottom: 20rpx;
.bookinfolist {
width: 100%;
margin-bottom: 20rpx;
overflow: hidden;
// height: 180rpx;
}
.bookinfolist:nth-last-child(1) {
margin-bottom: 0 !important;
}
.operation_box {
position: absolute;
bottom: 20rpx;
left: 40rpx;
}
}
.mainContent {
background-color: #fff;
.item {
// padding: 10px;
// margin-bottom: 30rpx;
// border: 1px solid #999;
box-sizing: border-box;
// padding-bottom: 20rpx;
border-radius: 20rpx;
// margin-bottom: 20rpx;
}
.feng {
background-color: #fafafa;
margin: 0rpx 22rpx 0 0;
height: 140rpx;
width: 140rpx;
float: left;
border-radius: 14rpx;
// border: 1rpx solid #e9e9e9;
}
.point_box {
.booknameleft {
line-height: 70rpx !important;
}
}
.fengPoint {
background-color: #fff;
height: 100rpx;
width: 100rpx;
}
.item_top {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 25rpx;
.source_app {
font-size: 26rpx;
font-weight: bold;
line-height: 26rpx;
}
}
.orderstatus {
line-height: 24rpx;
font-size: 24rpx;
color: #e55f18;
text-align: right;
letter-spacing: 2rpx;
}
/deep/.description {
overflow: hidden;
color: #666;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 5;
line-clamp: 5;
-webkit-box-orient: vertical;
font-size: 26rpx;
margin-bottom: 20rpx;
margin-top: 10rpx;
height: 172rpx;
img {
width: 100% !important;
}
}
.btns {
font-size: 28rpx;
justify-content: space-between;
align-items: center;
.booknameleft {
font-size: 32rpx;
width: calc(100% - 200rpx);
color: #070707;
letter-spacing: 0.5rpx;
font-weight: 600;
}
.left {
width: 300rpx;
color: #a1a1a1;
}
.right {
width: 350rpx;
display: flex;
justify-content: flex-end;
align-items: center;
}
.price {
width: 120rpx;
}
.gzicon {
margin: 0 0 0 20rpx;
height: 40rpx;
width: 40rpx;
// float:left;
// border-radius: 20rpx;
// border:1rpx solid #e9e9e9;
}
.opbtns {
.pingjia {
margin-left: 10px;
}
}
}
}
.mb30 {
margin-bottom: 30rpx;
overflow: hidden;
}
.mytabs {
// background: url('@/static/icon/bgtushu.png') no-repeat left top;
height: 80rpx;
// margin-bottom: 30rpx;
.item {
border-radius: 10rpx;
background-color: #c6ead0;
width: 48%;
// margin: 0 10rpx;
text-align: center;
color: #3c7f56;
font-size: 36rpx;
line-height: 80rpx;
}
.item.active {
background-color: #3c7f56;
color: #fff;
}
.item2 {
margin-right: 20rpx;
}
}
/deep/.u-tabs__wrapper__nav__item__text {
// font-size: 32rpx !important;
}
.cateList {
width: 100%;
}
/deep/.u-tabs__wrapper__nav__item {
padding: 0 !important;
}
.commonDetailPage {
background-color: $themeBgColor;
}
.order_box {
padding: 20rpx;
}
/deep/.order_box .list_item {
// border-bottom: none;
padding: 0 !important;
padding-right: 0 !important;
border: none !important;
}
.product_quantity {
width: auto;
color: #9b9b9b;
font-size: 26rpx;
}
/deep/.commonDetailPage {
.uni-app--showtabbar uni-page-wrapper::after {
height: 0 !important;
}
}
</style>