123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320 |
- <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>
- <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>
- <picker mode="selector" :range="value" @change="bindChange">
- <view class="refund" v-if="refund">{{ refund || '请选择退款理由' }}</view>
- <view class="noRefund" v-else>请选择退款理由</view>
- </picker>
- </view>
- <view class="row b-b" v-if="is_public ==1">
- <text class="tit">快递单号</text>
- <input class="input" type="text" v-model="refund_delivery_id" placeholder="请填写快递单号"
- placeholder-class="placeholder" />
- <image class="icon" @click="smsh" src="../../static/icon/sao.png" mode=""></image>
- </view>
- <view class="row b-b" v-if="is_public ==1">
- <view class="tip">
- 退货地址:浙江省湖州市织里镇仁舍新街665号科洋园区3 栋4楼 小程序组收 13216517112
- </view>
- </view>
- <view class="row b-b">
- <text class="tit">备注说明</text>
- <input class="input" type="text" v-model="reason" placeholder="请填写备注" placeholder-class="placeholder" />
- </view>
- <button class="add-btn" @click="confirm">提交</button>
- </view>
- </template>
- <script>
- import {
- refund,
- refundReason,
- orderDetail
- } from '@/api/order.js';
- export default {
- data() {
- return {
- refund: '', //退款理由
- reason: '', //备注
- value: ['1', '2', '3', '4', '5', '6', '7', '8', 9, 10, 11, 12, 13],
- orderId: '',
- item: {},
- listStyle: 2,
- is_public: 1,
- refund_delivery_id: '',
- };
- },
- onLoad(option) {
- this.orderId = option.id;
- this.refundReason();
- this.loadOrder();
- },
- methods: {
- // 切换选中事件
- bindChange(e) {
- this.refund = this.value[e.detail.value];
- },
- // 加载退款理由
- refundReason() {
- refundReason({}).then(e => {
- this.value = e.data;
- });
- },
- loadOrder() {
- const obj = this
- orderDetail({}, this.orderId).then(e => {
- this.item = e.data;
- console.log(e.data._status._title);
- if (e.data._status._title == "未发货") {
- obj.is_public = 0
- }
- console.log(obj.is_public);
- });
- },
- smsh() {
- // #ifdef H5
- // let wx = require('jweixin-module');
- // wx.scanQRCode({
- // needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
- // scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
- // success: function(res) {
- // this.refund_delivery_id = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
- // }
- // });
- // #endif
- // #ifndef H5
- uni.scanCode({
- success: res => {
- this.refund_delivery_id = res.result;
- }
- });
- // #endif
- },
- //提交
- confirm() {
- let obj = this;
- if (!obj.refund) {
- uni.showModal({
- title: '错误',
- content: '请填写退货理由',
- showCancel: false
- });
- return false;
- }
- if (obj.is_public == 1) {
- if (!obj.refund_delivery_id) {
- return obj.$api.msg('请填写订单号');
- }
- }
- refund({
- refund_delivery_id: obj.refund_delivery_id,
- text: obj.refund,
- uni: obj.orderId,
- refund_reason_wap_explain: obj.reason
- }).then(function(e) {
- uni.showToast({
- title: '提交成功',
- duration: 1500
- });
- uni.switchTab({
- url: '/pages/user/user'
- })
- });
- }
- }
- };
- </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;
- .icon {
- width: 40rpx;
- height: 40rpx;
- margin-left: 20rpx;
- }
- .refund {
- font-size: 30rpx;
- color: $font-color-dark;
- }
- .noRefund {
- font-size: 30rpx;
- color: $font-color-light;
- padding-left: 20rpx;
- }
- .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: 20rpx;
- &.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);
- }
- .tip {
- font-size: 24rpx;
- color: rgba(#fd3b39, 0.5);
- }
- /* 多条商品 */
- .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;
- }
- }
- }
- }
- }
- </style>
|