123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328 |
- <template>
- <view class="order-row" @click="goToOrderDetail()">
- <view class="shop-info" v-if="orderData">
- <text class="iconfont iconwode"></text>
- <text class="shop-name">{{orderData.nickname}}</text>
- <text class="order-type">{{getOrderType(orderData.orderStatus)}}</text>
- </view>
- <view class="goods-list" v-if="orderData">
- <view class="goods-row" v-for="(site, index) in orderData.products" :key="index">
- <image class="goods-img" :src="site.imgUrl" mode="aspectFill"></image>
- <view class="goods-info">
- <view class="goods-name">{{site.productName}}</view>
- <view class="goods-type">
- 类型:{{site.productType == 1 ? '普通商品' : (site.productType == 2 ? '拍卖' : (site.productType == 3 ? '自助采摘' : '共享种植'))}}
- </view>
- <view class="goods-price-number">
- <text class="goods-unit">¥</text>
- <text class="goods-price">{{site.bizPrice}}</text>
- <text class="goods-number">x{{site.buyNum}}</text>
- </view>
- </view>
- </view>
- </view>
- <view class="pay-info" v-if="!isPick">总价¥{{getAllPrice()}},实付¥{{orderData.paySum}}</view>
- <view class="handle-box" v-if="(tabIndex > 1 && tabIndex < 5) || (tabIndex == 5 && orderData.evaluateStatus == 2 && orderData.evaluateReplyStatus == 1)">
- <u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"
- v-if="tabIndex == 2 && orderData.auctionStatus != 1 && orderData.auctionStatus != 3" @click.stop="handleOrder(1)">发货</u-button>
- <u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"
- v-if="tabIndex == 3 || tabIndex == 4" @click.stop="handleOrder(2)">追踪物流</u-button>
- <u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"
- v-if="tabIndex == 5 && orderData.evaluateStatus == 2 && orderData.evaluateReplyStatus == 1" @click.stop="handleOrder(3)">回复</u-button>
- <u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"
- v-if="!orderData.noPick && orderData.orderStatus == 2" @click.stop="handleOrder(6)">自助采摘</u-button>
- </view>
- <u-top-tips ref="uTips"></u-top-tips>
- </view>
- </template>
- <script>
- const NET = require('@/utils/request')
- const API = require('@/config/api')
- export default {
- props: {
- tabIndex: {
- default: 1
- },
- isPick: {
- default: false
- },
- orderData: {
- default: {
- auctionStatus: 0,
- orderId: 0,
- orderStatus: 0,
- evaluateReplyStatus: 0,
- nickname: '',
- logisticsNum: '',
- payStatus: 0,
- paySum: 0,
- products: [{
- bizPrice: 0,
- buyNum: 0,
- imgUrl: '',
- originalPrice: 0,
- productId: 0,
- productName: '',
- productType: 0,
- shoppingcartId: 0,
- tenantCode: ''
- }],
- supplierName: '',
- noPick: true
-
- }
- },
- },
- data() {
- return {}
- },
- onLoad() {},
- methods: {
- // 获取订单总价
- getAllPrice() {
- let price = this.orderData.products.reduce((total, site) => {
- return total + site.bizPrice * site.buyNum
- }, 0)
- return price.toFixed(2)
- },
- // 获取订单类型
- getOrderType(type) {
- switch (type) {
- case 1:
- return '待付款'
- break;
- case 2:
- return '待发货'
- break;
- case 3:
- return '已发货'
- break;
- case 4:
- return '已收货'
- break;
- case 5:
- return '已完成'
- break;
- default:
- return '已取消'
- }
- },
- // 获取拍卖状态
- getAuctionType(type) {
- switch (type) {
- case 1:
- return '竞拍中'
- break;
- case 2:
- return '竞拍成功'
- break;
- case 3:
- return '竞拍失败'
- break;
- }
- },
- // 操作区分
- handleOrder(type) {
- if (type == 1) {
- // 发货
- uni.navigateTo({
- url: '/pagesMain/bindOrder?orderId=' + this.orderData.orderId
- });
- } else if (type == 2) {
- // 追踪物流
- uni.navigateTo({
- url: '/pagesMain/logisticsDeatil?logisticCode=' + this.orderData.logisticsNum
- });
- } else if (type == 3) {
- // 回复
- uni.navigateTo({
- url: '/pagesMain/evaluateForm?orderId=' + this.orderData.orderId + '&mid='+this.orderData.mid
- });
- } else if (type == 6) {
- // 自助采摘
- uni.navigateTo({
- url: '/pagesMedia/pickVideo?tenantCode=' + this.orderData.tenantCode + '&orderId=' + this.orderData.orderId
- });
- }
- },
- // 跳转订单详情
- goToOrderDetail() {
- if (!this.isPick) {
- uni.navigateTo({
- url: '/pagesMain/orderDetail?orderId=' + this.orderData.orderId + '&orderStatus=' + this.orderData.orderStatus
- });
- } else {
- // 自助采摘
- uni.navigateTo({
- url: '/pagesMedia/pickVideo?tenantCode=' + this.orderData.tenantCode + '&orderId=' + this.orderData.orderId
- });
- }
- },
- }
- }
- </script>
- <style lang="less" scoped>
- .order-row {
- width: 100%;
- float: left;
- margin: 0 0 15px 0;
- background: #FFFFFF;
- border-radius: 10px;
- .shop-info {
- width: 100%;
- height: 48px;
- float: left;
- box-sizing: border-box;
- padding: 13px 15px 12px 15px;
- border-bottom: 1px solid #EEEEEE;
- line-height: 22px;
- .iconwode {
- font-size: 22px;
- color: #333333;
- }
- .shop-name {
- font-size: 15px;
- font-family: PingFang SC;
- color: #333333;
- margin: 0 8px 0 10px;
- }
- .iconshangjia {
- font-size: 12px;
- color: #999999;
- }
- .order-type {
- float: right;
- font-size: 15px;
- font-family: PingFang SC;
- color: #52A63A;
- }
- }
- .goods-list {
- width: 100%;
- float: left;
- box-sizing: border-box;
- padding: 10px 15px 0 15px;
- .goods-row {
- width: 100%;
- height: 90px;
- float: left;
- display: flex;
- margin-bottom: 10px;
- .goods-img {
- width: 90px;
- height: 90px;
- border-radius: 5px;
- object-fit: cover;
- }
- .goods-info {
- width: calc(100% - 106px);
- height: 90px;
- margin-left: 16px;
- .goods-name {
- width: 100%;
- height: 36px;
- float: left;
- font-size: 14px;
- font-family: PingFang SC;
- color: #333333;
- line-height: 18px;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- word-wrap: break-word;
- }
- .goods-type {
- height: 20px;
- float: left;
- background: #F0F0F0;
- border-radius: 4px;
- padding: 0 8px;
- margin: 6px 0;
- font-size: 10px;
- font-family: PingFang SC;
- color: #666666;
- line-height: 20px;
- }
- .goods-price-number {
- width: 100%;
- height: 20px;
- float: left;
- line-height: 20px;
- font-family: PingFang SC;
- color: #333333;
- .goods-unit {
- font-size: 12px;
- }
- .goods-price {
- font-size: 15px;
- margin-right: 6px;
- }
- .goods-number {
- font-size: 12px;
- }
- }
- }
- }
- }
- .pay-info {
- width: 100%;
- float: left;
- box-sizing: border-box;
- padding: 20px 15px 16px 15px;
- font-size: 12px;
- font-family: PingFang SC;
- color: #333333;
- line-height: 16px;
- text-align: right;
- }
- .handle-box {
- width: calc(100% - 30px);
- height: 51px;
- float: left;
- margin: 0 15px;
- box-sizing: border-box;
- padding: 10px 0;
- border-top: 1px solid #EEEEEE;
- text-align: right;
- .handle-button {
- height: 30px;
- margin-left: 8px;
- margin-bottom: 10px;
- line-height: 28px;
- text-align: center;
- box-sizing: border-box;
- display: inline-block;
- border-radius: 15px;
- /deep/button {
- padding: 0 12px;
- border: 1px solid #BFBFBF !important;
- background-color: #FFFFFF!important;
- color: #333333 !important;
- }
- }
- }
- }
- </style>
|