123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416 |
- <template>
- <view class="content">
- <view class="order-item">
- <scroll-view v-if="listStyle == 1" class="goods-box" scroll-x>
- <view v-for="(goodsItem, goodsIndex) in item.cartInfo" :key="goodsIndex" class="goods-item">
- <image class="goods-img" :src="goodsItem.productInfo.image" mode="aspectFill"></image>
- </view>
- </scroll-view>
- <!-- <view v-if="listStyle == 2" class="goods-box-single" v-for="(goodsItem, goodsIndex) in item.cartInfo" :key="goodsIndex">
- <image class="goods-img" :src="goodsItem.productInfo.image" mode="aspectFill"></image>
- <view class="right">
- <text class="title clamp">{{ goodsItem.productInfo.store_name }}</text>
- <text class="attr-box">{{ goodsItem.attrInfo ? goodsItem.attrInfo.suk : '' }} x {{ goodsItem.cart_num }}</text>
- <text class="price">{{ goodsItem.productInfo.price }}</text>
- </view>
- </view> -->
- <view class="good" v-if="listStyle == 2" v-for="(goodsItem, goodsIndex) in item.cartInfo" :key="goodsIndex">
- <view class="img-wrapper"><image :src="goodsItem.productInfo.image" mode=""></image></view>
- <view class="good-infoo">
- <view class="good-name ellipsis">{{ goodsItem.productInfo.store_name }}</view>
- <view class="create-time">下单时间:{{item.add_time_y}}</view>
- </view>
- <view class="good-infot">
- <view class="good-price">¥{{ goodsItem.productInfo.price }}</view>
- <view class="good-num">X{{ goodsItem.cart_num }}</view>
- </view>
- </view>
- </view>
- <!-- <view class="orderDetial">
- <view class="row b-b flex">
- <text class="tit">订单总价</text>
- <view class="input">¥{{ item.total_price }}</view>
- </view>
- <view class="row b-b flex">
- <text class="tit">邮费</text>
- <view class="input">{{ item.pay_postage > 0 ? '¥' +item.pay_postage : '免邮费' }}</view>
- </view>
- <view class="row b-b flex" v-if="item.coupon_id > 0">
- <text class="tit">优惠券</text>
- <view class="input">-¥{{ item.coupon_price }}</view>
- </view>
- <view class="row b-b flex" v-if="item.use_integral > 0">
- <text class="tit">积分抵扣</text>
- <view class="input">-¥{{ item.use_integral }}</view>
- </view>
- <view class="row b-b flex">
- <text class="tit ">实付</text>
- <view class="input payColor">¥{{ item.pay_price }}</view>
- </view>
- </view> -->
- <view class="row b-b">
- <text class="tit">货物状态</text>
- <input class="input" type="text" v-model="reason" placeholder="请输入货物状态" placeholder-class="placeholder" />
- </view>
- <view class="row b-b">
- <text class="tit">退款原因</text>
- <picker mode="selector" :range="status" @change="bindChange">
- <view class="refund" v-if="refundStatus">{{ refundStatus || '请选择' }}</view>
- <view class="noRefund" v-else>请选择退款原因</view>
- </picker>
- </view>
- <view class="row b-b">
- <text class="tit">退款方式</text>
- <picker mode="selector" :range="methods" @change="bind2Change">
- <view class="refund" v-if="refundMethods">{{ refundMethods || '请选择' }}</view>
- <view class="noRefund" v-else>请选择</view>
- </picker>
- </view>
- <!-- <view class="refund-num">
- <view class="num-title">退款金额</view>
- <view class="num">¥{{refundNum}}</view>
- </view> -->
- <view class="pushpic">
- <view class="up-title">上传凭证:</view>
- <view class="up" @click="putImg()">
- <view class="up-bg" v-if="isUp">
- <image src="../../static/icon/uping.png" mode=""></image>
- <view class="up-tap">上传图片</view>
- </view>
- <view class="up-img" v-else>
- <image src="" mode=""></image>
- </view>
- </view>
- </view>
- <button class="add-btn" @click="confirm">提交申请</button>
- </view>
- </template>
- <script>
- import { refund, refundReason, orderDetail } from '@/api/order.js';
- export default {
- data() {
- return {
- refundStatus: '', //退款理由
- refundMethods: '', //退款方式
- reason: '', //退款理由
- status: ['代付款', '待发货', '待收货', '已完成'],
- orderId: '',
- item: {},
- listStyle: 2,
- refundNum: 0,
- methods: ['余额'],
- isUp: true,
- upImg: ''
- };
- },
- onLoad(option) {
- this.orderId = option.id;
- this.refundReason();
- this.loadOrder();
- },
- methods: {
- // 切换选中事件
- bindChange(e) {
- this.refundStatus = this.status[e.detail.value];
- console.log('this.refundStatus',this.refundStatus)
- },
- bind2Change(e) {
- this.refundMethods = this.methods[e.detail.value];
- },
- // 加载退款理由
- refundReason() {
- refundReason({}).then(e => {
- this.status = e.data;
- });
- },
- loadOrder() {
- orderDetail({}, this.orderId).then(e => {
- this.item = e.data;
- console.log(this.item)
- });
- },
- //提交
- confirm() {
- let obj = this;
- if (!obj.refundStatus) {
- uni.showModal({
- title: '错误',
- content: '请填写退货理由',
- showCancel: false
- });
- return false;
- }
- refund({
- text: obj.refundStatus,
- uni: obj.orderId,
- refund_reason_wap_explain: obj.reason
- }).then(function(e) {
- uni.showToast({
- title: '提交成功',
- duration: 1500
- });
- });
- },
- putImg() {
- console.log('dianji')
- this.isUp = !this.isUp
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- background: $page-color-base;
- padding-top: 16rpx;
- }
- .orderDetial {
- .row {
- .input {
- text-align: right;
- }
- }
- }
- .row {
- display: flex;
- align-items: center;
- position: relative;
- padding: 0 30rpx;
- height: 110rpx;
- background: #fff;
- .refund {
- font-size: 30rpx;
- color: $font-color-dark;
- padding-left: 128rpx;
- }
- .noRefund {
- font-size: 30rpx;
- color: $font-color-light;
- padding-left: 128rpx;
- }
- .tit {
- flex-shrink: 0;
- width: 120rpx;
- font-size: 30rpx;
- color: $font-color-dark;
- }
- .input {
- flex: 1;
- font-size: 30rpx;
- color: $font-color-dark;
- padding-left: 128rpx;
- &.payColor {
- color: $color-red;
- }
- }
- .iconlocation {
- font-size: 36rpx;
- color: $font-color-light;
- }
- }
- .add-btn {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 690rpx;
- height: 80rpx;
- margin: 60rpx auto;
- font-size: $font-lg;
- color: #fff;
- background-color: $base-color;
- border-radius: 10rpx;
- // box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
- }
- /* 多条商品 */
- .order-item {
- display: flex;
- flex-direction: column;
- // padding-left: 30rpx;
- background: #fff;
- margin-top: 16rpx;
- .goods-box {
- height: 160rpx;
- padding: 20rpx 0;
- white-space: nowrap;
- .goods-item {
- width: 120rpx;
- height: 120rpx;
- display: inline-block;
- margin-right: 24rpx;
- }
- .goods-img {
- display: block;
- width: 100%;
- height: 100%;
- }
- }
- /* 单条商品 */
- .goods-box-single {
- display: flex;
- padding: 20rpx 0;
- .goods-img {
- display: block;
- width: 120rpx;
- height: 120rpx;
- }
- .right {
- flex: 1;
- display: flex;
- flex-direction: column;
- padding: 0 30rpx 0 24rpx;
- overflow: hidden;
- .title {
- font-size: $font-base + 2rpx;
- color: $font-color-dark;
- line-height: 1;
- }
- .attr-box {
- font-size: $font-sm + 2rpx;
- color: $font-color-light;
- padding: 10rpx 12rpx;
- }
- .price {
- font-size: $font-base + 2rpx;
- color: $font-color-dark;
- &:before {
- content: '¥';
- font-size: $font-sm;
- margin: 0 2rpx 0 8rpx;
- }
- }
- }
- }
- }
- .refund-num {
- margin: 20rpx 0;
- width: 750rpx;
- height: 100rpx;
- background: #ffffff;
- line-height: 100rpx;
- view {
- display: inline-block;
- }
- .num-title {
- font-size: 30rpx;
- font-family: PingFangSC;
- font-weight: 500;
- color: #333333;
- padding-left: 30rpx;
- }
- .num {
- padding-left: 133rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #901b21;
- }
- }
- .good {
- // margin-top: 21rpx;
- margin-bottom: 18rpx;
- width: 750rpx;
- height: 220rpx;
- background: #ffffff;
- padding: 30rpx 29rpx;
- display: flex;
- position: relative;
- .img-wrapper {
- width: 160rpx;
- height: 160rpx;
- image {
- width: 100%;
- height: 100%;
- border-radius: 5rpx;
- }
- }
- .good-infoo {
- padding-left: 20rpx;
- .good-name {
- width: 282rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 400;
- color: #1d2023;
- line-height: 40rpx;
- margin-bottom: 40rpx;
- }
- .create-time {
- height: 21rpx;
- font-size: 22rpx;
- font-family: PingFang SC;
- font-weight: 400;
- color: #999999;
- }
- }
- .good-infot {
- position: absolute;
- right: 29rpx;
- text-align: right;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 400;
- color: #666666;
- .good-num {
- font-size: 22rpx;
- }
- }
- }
- .pushpic {
- margin-top: 20rpx;
- width: 750rpx;
- height: 284rpx;
- background: #FFFFFF;
- padding: 30rpx 0 0 30rpx;
- .up-title {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 400;
- color: #3F454B;
- line-height: 1;
- padding-bottom: 35rpx;
- }
- .up {
- .up-bg {
- width: 160rpx;
- height: 160rpx;
- background: #fff;
- border: 2rpx #999999 dashed;
- border-radius: 10rpx;
- position: relative;
- image {
- width: 36rpx;
- height: 36rpx;
- position: absolute;
- top: 44rpx;
- left:64rpx;
- }
- .up-tap {
- position: absolute;
- // width: 94rpx;
- height: 23rpx;
- font-size: 24rpx;
- font-family: PingFangSC;
- font-weight: 500;
- color: #888888;
- top: 93rpx;
- left:33rpx;
- }
- }
- .up-img {
- width: 160rpx;
- height: 160rpx;
- background: #fff;
- // border: 2rpx #999999 dashed;
- border-radius: 10rpx;
- image {
- width: 100%;
- height: 100%;
- border-radius: 10rpx;
- }
- }
- }
- }
- </style>
|