添加违规信息,

对接订单详情,订单发布,下架,收货信息。
This commit is contained in:
wuhui_zzw 2023-03-03 17:48:47 +08:00
parent 543f7714a2
commit 6f14e821c7
2 changed files with 476 additions and 32 deletions

View File

@ -12,6 +12,21 @@
</view> </view>
</view> </view>
</view> </view>
<!--惩罚信息-->
<view class="punish">
<view class="punish-block">
<view class="punish-title">违规次数</view>
<view class="punish-num">{{ user.violation_num }}</view>
</view>
<view class="punish-block">
<view class="punish-title">违规总次数</view>
<view class="punish-num">{{ user.total_violation_num }}</view>
</view>
<view class="punish-block" v-if="user.punish_time > 0">
<view class="punish-title">惩罚结束时间</view>
<view class="punish-num">{{ $util.timeStampTurnTime(user.punish_time) }}</view>
</view>
</view>
<!--菜单列表--> <!--菜单列表-->
<view class="menu-list"> <view class="menu-list">
<view class="title">小店订单</view> <view class="title">小店订单</view>
@ -64,7 +79,8 @@ export default {
} }
], ],
// //
info: {} info: {},
user: {},
}; };
}, },
components: {}, components: {},
@ -75,6 +91,7 @@ export default {
// //
if (!uni.getStorageSync('token')) this.$refs.login.open('/pages_promotion/futures/seckill'); if (!uni.getStorageSync('token')) this.$refs.login.open('/pages_promotion/futures/seckill');
this.getMemberInfo(); this.getMemberInfo();
this.getPunish();
}, },
methods: { methods: {
// //
@ -94,6 +111,23 @@ export default {
} }
}); });
}, },
//
getPunish() {
this.$api.sendRequest({
url: '/futures/api/user/info',
success: res => {
if(parseInt(res.code) === 0){
this.user = res.data;
}
},
fail: res => {}
});
},
}, },
onBackPress(options) { onBackPress(options) {
if (options.from === 'navigateBack') return false; if (options.from === 'navigateBack') return false;
@ -253,5 +287,19 @@ export default {
} }
} }
} }
.punish{
display: inline-flex;
width: 100%;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: space-evenly;
margin: 20rpx 0;
background-color: #FFFFFF;
.punish-title{}
.punish-num{
text-align: center;
}
}
} }
</style> </style>

View File

@ -1,19 +1,85 @@
<template> <template>
<page-meta :page-style="themeColor"></page-meta> <page-meta :page-style="themeColor"></page-meta>
<view class="apply"> <view class="order-details">
<!--商品信息-->
<view class="top">
<view class="left">
<image class="top-image" :src="$util.img(info.goods_image)" mode="widthFix"></image>
</view>
<view class="right">
<view class="goods-name">{{ info.goods_name }}</view>
<view class="goods-status">订单状态{{ status_text[info.status] }}</view>
<view class="goods-type">
订单类型<text class="goods-type-text">采购订单</text>
</view>
</view>
</view>
<!--信息列表-->
<view class="info-list">
<view class="info-list-block">
<view class="left">用户昵称</view>
<view class="right">{{ info.seller_nickname }}</view>
</view>
<view class="info-list-block">
<view class="left">订单金额</view>
<view class="right right-price">{{ info.unit_price }}</view>
</view>
<view class="info-list-block">
<view class="left">订单编号<text class="copy-buttons" @click="$util.copy(info.order_no)">复制</text></view>
<view class="right">{{ info.order_no }}</view>
</view>
<view class="info-list-block">
<view class="left">购买时间</view>
<view class="right">{{ $util.timeStampTurnTime(info.created_time) }}</view>
</view>
<view class="info-list-block">
<view class="left">订单状态</view>
<view class="right">{{ status_text[info.status] }}</view>
</view>
<view class="info-list-block" v-if="info.buyer_message">
<view class="left">备注</view>
<view class="right">{{ info.buyer_message }}</view>
</view>
</view>
<!--操作按钮-->
<view class="buttons">
<view class="buttons-item buttons-item-pickup" @click="$refs.pickupConfirm.open()" v-if="parseInt(info.status) === 1">自提产品</view>
<view class="buttons-item buttons-item-sale" @click="$refs.saleGoods.open()" v-if="parseInt(info.status) === 1">出售商品</view>
<view class="buttons-item buttons-item-undercarriage" @click="$refs.undercarriageConfirm.open()" v-if="parseInt(info.status) === 2">下架商品</view>
</view>
<!-- 提货确认弹框 -->
<uni-popup ref="pickupConfirm" type="dialog" class="order-remarks-content">
<uni-popup-dialog mode="base" content="确认提货当前订单中的所有商品吗!" @close="$refs.pickupConfirm.close()" @confirm="pickup"></uni-popup-dialog>
</uni-popup>
<!-- 发布弹框 -->
<uni-popup ref="saleGoods" type="center">
<view class="transfer-price-content">
<view class="transfer-price-top">
<view class="top-left">详情</view>
<view class="top-right">
<i class="icondiy icon-system-guanbi"></i>
</view>
</view>
<view class="transfer-price">
<view>请输入转售价格</view>
<view>
<input type="number" class="input" v-model="transfer_price"/>
</view>
</view>
<view class="transfer-price-tips">转让价格必须大于{{ price_range.min_price }}并且小于等于{{ price_range.max_price }}</view>
<view class="transfer-price-button">
<view class="transfer-buttons" @click="sale">确定出售</view>
</view>
</view>
</uni-popup>
<!-- 拆单确认弹框 -->
<uni-popup ref="splitConfirm" type="dialog" class="order-remarks-content">
<uni-popup-dialog mode="base" :content="split_message" @close="$refs.splitConfirm.close()" @confirm="splitConfirm()"></uni-popup-dialog>
</uni-popup>
<!-- 下架确认弹框 -->
<uni-popup ref="undercarriageConfirm" type="dialog" class="order-remarks-content">
<uni-popup-dialog mode="base" content="确认下架售卖中的商品吗!" @close="$refs.undercarriageConfirm.close()" @confirm="undercarriage"></uni-popup-dialog>
</uni-popup>
@ -25,33 +91,184 @@
</template> </template>
<script> <script>
import uniPopup from '@/components/uni-popup-new/uni-popup.vue';
import uniPopupDialog from '@/components/uni-popup-dialog/uni-popup-dialog.vue';
export default { export default {
components: {
uniPopup,
uniPopupDialog
},
data() { data() {
return { return {
futures_id: 0,
info: {},
status_text: {
1 : '库存',
2 : '正在销售',
3 : '已售出',
4 : '提货中',
5 : '提货完成',
6 : '待支付',
7 : '捡漏',
},
price_range: {},
transfer_price: 0.00,
split_message: '',
}; };
}, },
components: {},
mixins: [], mixins: [],
onLoad(option) {}, onLoad(option) {
this.futures_id = option.futures_id || 0;
this.getDetail();
},
onShow() {}, onShow() {},
onReady(){ onReady(){
// //
if (!uni.getStorageSync('token')) this.$refs.login.open('/pages_promotion/futures/list'); if (!uni.getStorageSync('token')) this.$refs.login.open('/pages_promotion/futures/list');
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}, },
methods: { methods: {
//
getDetail() {
this.$api.sendRequest({
url: '/futures/api/futures/myDetail',
data: {
id: this.futures_id
},
success: res => {
if (parseInt(res.code) === 0) {
this.info = res.data;
this.getSet();
}
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail: res => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
//
getSet(){
this.$api.sendRequest({
url: '/futures/api/futures/getBasicsConfig',
success: res => {
if (parseInt(res.code) === 0) {
this.price_range = res.data.price_range;
//
let unitPrice = this.info.unit_price;
let minPrice = unitPrice * (parseFloat(this.price_range.min) / 100);
let maxPrice = unitPrice * (parseFloat(this.price_range.max) / 100);
this.price_range.min_price = (parseFloat(unitPrice) + parseFloat(minPrice)).toFixed(2);
this.price_range.max_price = (parseFloat(unitPrice) + parseFloat(maxPrice)).toFixed(2);
this.transfer_price = this.price_range.max_price;
}
}
});
},
//
pickup(){
this.$refs.pickupConfirm.close();
let _this = this;
_this.$api.sendRequest({
url: '/futures/api/futures/pickUp',
data: {
id: _this.futures_id
},
success: res => {
_this.$util.showToast({
title: res.message,
mask: true,
duration: 2000,
success: function(){
_this.getDetail();
// setTimeout(() => {
// this.$util.redirectTo('/pages/index/index');
// }, 1500);
}
});
}
});
},
//
sale(agree_split_order = 0){
let _this = this;
//
if(_this.transfer_price <= _this.price_range.min_price){
_this.$util.showToast({
title: '转售价格必须大于'+ _this.price_range.min_price,
mask: true,
duration: 1500,
});
return false;
}
if(_this.transfer_price > _this.price_range.max_price){
_this.$util.showToast({
title: '转售价格必须小于等于'+ _this.price_range.max_price,
mask: true,
duration: 1500,
});
return false;
}
//
_this.$api.sendRequest({
url: '/futures/api/futures/release',
data: {
id: _this.futures_id,
price: _this.transfer_price,
agree_split_order: agree_split_order,
},
success: res => {
//
if(_this.$refs.saleGoods) _this.$refs.saleGoods.close();
//
if(parseInt(res.code) === -800){
this.split_message = res.message;
_this.$refs.splitConfirm.open();
}
else{
_this.$util.showToast({
title: res.message,
mask: true,
duration: 2000,
success: function () {
_this.getDetail();
}
});
}
}
});
},
// -
splitConfirm(){
this.$refs.splitConfirm.close();
this.sale(1);
},
//
undercarriage(){
this.$refs.undercarriageConfirm.close();
let _this = this;
_this.$api.sendRequest({
url: '/futures/api/futures/stock',
data: {
id: _this.futures_id
},
success: res => {
_this.$util.showToast({
title: res.message,
mask: true,
duration: 2000,
success: function(){
_this.getDetail();
// setTimeout(() => {
// this.$util.redirectTo('/pages/index/index');
// }, 1500);
}
});
}
});
}
}, },
onBackPress(options) { onBackPress(options) {
if (options.from === 'navigateBack') return false; if (options.from === 'navigateBack') return false;
@ -62,12 +279,191 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.order-details{
background: #fafcff;//fafcff
min-height: calc(100vh - (30rpx * 2));
padding: 30rpx;
.top{
--top-height--: 150rpx;
width: calc(100% - (20rpx * 2));
height: var(--top-height--);
padding: 20rpx;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: flex-start;
background-color: #FFFFFF;
.left{
width: var(--top-height--);
height: var(--top-height--);
border-radius: 20rpx;
.top-image{
width: 100% !important;
height: 100% !important;
}
}
.right{
padding-left: 20rpx;
width: calc(100% - var(--top-height--) - 20rpx);
.goods-name{
height: calc(var(--top-height--) / 2);
line-height: calc(var(--top-height--) / 4);
font-size: 30rpx;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical; /*设置对齐模式*/
-webkit-line-clamp: 2; /*设置多行的行数*/
color: #404040;
}
.goods-status{
height: calc(var(--top-height--) / 4);
line-height: calc(var(--top-height--) / 4);
font-size: 26rpx;
color: #7e7e7e;
}
.goods-type{
height: calc(var(--top-height--) / 4);
line-height: calc(var(--top-height--) / 4);
font-size: 26rpx;
color: #7e7e7e;
.goods-type-text{
color: #fc6b64;
}
}
}
}
.info-list{
.info-list-block{
background: #ffffff;
margin-top: 20rpx;
border-radius: 10rpx;
padding: 20rpx;
width: calc(100% - (20rpx * 2));
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
align-content: center;
.left{
font-size: 26rpx;
font-weight: bold;
color: #2d2d2d;
.copy-buttons{
font-size: 22rpx;
text-decoration: underline;
margin-left: 5px;
color: #868686;
}
}
.right{
font-size: 26rpx;
color: #898989;
max-width: calc(100% - 160rpx);
}
.right-price{
color: #fb5e56;
}
}
}
.buttons{
position: absolute;
bottom: 70rpx;
left: 0;
width: 100%;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-evenly;
align-items: center;
.buttons-item{
background: red;
height: 60rpx;
line-height: 60rpx;
font-size: 30rpx;
padding: 0 50rpx;
border-radius: 100rpx;
}
.buttons-item-pickup{
color: #fef9eb;
background: #f8ce2e;
}
.buttons-item-sale{
color: #fee6e6;
background: #ff4445;
}
.buttons-item-undercarriage{
color: #fee6e6;
background: #ff4445;
}
}
.transfer-price-content{
width: calc(90vw - (30rpx * 2));
padding: 30rpx;
background-color: #FFFFFF;
border-radius: 30rpx;
.transfer-price-top{
display: inline-flex;
width: 100%;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: space-between;
align-content: center;
height: 50rpx;
.top-right{
i{
font-size: 40rpx!important;
}
}
}
.transfer-price{
display: inline-flex;
width: 100%;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: flex-start;
margin-top: 20rpx;
font-size: 30rpx;
.input{
font-size: 30rpx;
border-bottom: 2rpx solid #e1dfe0;
height: 60rpx;
}
}
.transfer-price-tips{
font-size: 24rpx;
height: 40rpx;
line-height: 30rpx;
color: #b5b2b3;
}
.transfer-price-button{
width: 100%;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
margin: 60rpx 0 20rpx 0;
.transfer-buttons{
width: 60%;
text-align: center;
height: 70rpx;
line-height: 70rpx;
font-size: 30rpx;
background: #0282ff;
color: #99d9e9;
border-radius: 100rpx;
}
}
}
}
</style> </style>