123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524 |
- <template>
- <van-skeleton :loading="loading">
- <view class="cart-list">
- <view style="padding: 0 36upx;line-height: 70upx; border-bottom: 14upx solid #F5F5F5; border-top: 1px solid #F5F5F5;">
- <span>{{ detail.status }}</span>
- </view>
- <view class="adress">
- <view class="adressDetail">{{ detail.reciver_info.mob_phone }}</view>
- <view>{{ detail.reciver_info.address }}</view>
- </view>
- <view @click="goStore" style="padding: 30upx 36upx 15upx 36upx;border-bottom: 1px solid #F5F5F5;">
- <image
- :src="pictureUrl + '/uploads/home/store/' + detail.store_id + '/' + detail.store_avatar"
- style="border-radius: 50%; width: 50upx;height: 50upx;vertical-align: middle;"
- ></image>
- <span style="padding-left: 16upx;">{{ detail.store_name }}</span>
- </view>
- <view class="shoplist" v-for="(items, index) in detail.goods" :key="index">
- <view @click="goDetail(items)">
- <van-card
- title-class="changewidth"
- price-class="priceClass"
- :price="items.goods_price"
- :desc="items.descire"
- :title="items.desarray"
- :thumb="pictureUrl + '/uploads/home/store/goods/' + items.goods_image.substr(0, items.goods_image.indexOf('\_')) + '/' + items.goods_image"
- ></van-card>
- </view>
- <view style="clear:both;width: 100%;overflow: hidden;padding: 20rpx 0;">
- <view class="retungood" v-if="detail.status == '已收货' && items.status == 2" @click="goreturngood(items)">退货退款</view>
- <view class="retungood" v-if="detail.status == '已收货' && items.status == 4" @click="goreturndetail(items.or_id)">退款成功</view>
- <view class="retungood" v-if="detail.status == '已收货' && items.status == 3" @click="goreturndetail(items.or_id)">退款申请中</view>
- </view>
- </view>
- <view class="topTip">
- <view style="padding-right: 20upx;">运费: {{ detail.shipping_fee }}</view>
- <view style="font-size: 28upx;">合计:{{ detail.order_amount }}</view>
- </view>
- <view style="padding: 18upx 36upx;">
- 订单编号:
- <text class="orderCode">{{ detail.order_sn }}</text>
- </view>
- <view
- v-if="detail.shipping_code != ''"
- style="margin: 20upx 0;
- padding: 10upx 0 0upx 32upx;
- border-top: 16upx solid #F5F5F5;
- border-top: 16upx solid #F5F5F5;"
- >
- <view>
- 快递单号:
- <text style="font-weight: 500;padding-left:16upx;" class="time">{{ detail.shipping_code }} ({{ detail.express_name }})</text>
- </view>
- </view>
- <view class="adressbottom">
- <view>
- 下单时间:
- <text style="font-weight: 500;" class="time">{{ detail.add_time }}</text>
- </view>
- <view>
- 支付订单:
- <text class="time" v-if="detail.order_state == 10 || detail.order_state == 0">未支付</text>
- <text class="time" v-else>{{ detail.payment_time }}</text>
- </view>
- <view>
- 商家发货:
- <text class="time" v-if="detail.order_state == 10 || detail.order_state == 0 || detail.order_state == 20 || detail.order_state == 60">未发货</text>
- <text class="time" v-else>{{ happenTimeFun(detail.shipping_time) }}</text>
- </view>
- <view>
- 确认收货:
- <text
- class="time"
- v-if="detail.order_state == 10 || detail.order_state == 0 || detail.order_state == 20 || detail.order_state == 30 || detail.order_state == 60"
- >
- 未确认
- </text>
- <text class="time" v-else>{{ detail.finnshed_time }}</text>
- </view>
- </view>
- <view style="height: 300upx;background-color: #fff;"></view>
- <view class="adressbutton">
- <view class="buttonStatus">
- <view @click="returnmoney()" v-if="detail.order_state == 20" class="deleteOrder">退款</view>
- <view @click="reminder(1)" v-if="detail.order_state == 20 && detail.shipping_type == 0" class="deleteOrder">催单</view>
- <view @click="reminder(2)" v-if="detail.order_state == 20 && detail.shipping_type == 1" class="deleteOrder">联系酒店</view>
- <view @click="cancelOrder(1)" v-if="detail.order_state == 10" class="deleteOrder">取消订单</view>
- <view class="payOrder" v-if="detail.order_state == 10" @click="goPay(detail)">去付款</view>
- <view v-if="detail.status == '已发货'" @click="cancelOrder(3)" class="deleteOrder">确认收货</view>
- <view
- v-if="(detail.status == '已收货' && detail.evaluation_state == 0) || (detail.status == '已完成' && detail.evaluation_state == 0)"
- @click="estimate"
- class="deleteOrder"
- >
- 去评价
- </view>
- <view
- v-if="(detail.order_state == 40 && detail.evaluation_state == 1) || detail.status == '已取消' || detail.status == '退款关闭'"
- @click="cancelOrder(2)"
- class="deleteOrder"
- >
- 删除订单
- </view>
- </view>
- </view>
- <Dialog :orderCancel="orderCancel" :titles="titles" @colseDialog="cancelDialog" @confirmPay="confirmOrder" />
- <view class="openSelect" v-if="radioShow">
- <view class="openSelectTitle">请选择退款的理由</view>
- <van-radio-group :value="radio" @change="onChange">
- <van-cell-group>
- <van-cell :title="item.name" clickable :data-name="item.value" @click="onClick" v-for="(item, index) in radioItems" :key="index">
- <van-radio checked-color="#E72028" slot="right-icon" :name="item.value" />
- </van-cell>
- </van-cell-group>
- </van-radio-group>
- <van-field :value="textarea" @change="changatextarea" type="textarea" placeholder="请输入退款理由" v-if="radio == 5" />
- <view class="flex-box btns">
- <view class="flex-1" @click="cancelDialog2()">取消</view>
- <view class="flex-1" @click="confirmOrder2()">确定</view>
- </view>
- </view>
- </view>
- <view class="weui-mask" v-if="radioShow"></view>
- </van-skeleton>
- </template>
- <script>
- import Dialog from '@/component/Dialog.vue';
- export default {
- components: {
- Dialog
- },
- data() {
- return {
- firstloading: 0,
- loading: true,
- isreturn: false,
- isCancel: false,
- isDelete: false,
- isGet: false,
- titles: '',
- pictureUrl: this.pictureUrl,
- orderCancel: false,
- detail: {},
- id: '', // 订单id
- radioShow: false,
- radio: 1,
- radioItems: [
- { name: '拍错/多拍/不想要', value: 1 },
- { name: '协商一致退货', value: 2 },
- { name: '缺货', value: 3 },
- { name: '未按约定时间发货', value: 4 },
- { name: '其他', value: 5 }
- ],
- textarea: ''
- };
- },
- onLoad(e) {
- this.id = e.id;
- this.getDetail();
- // 刷新订单详情
- uni.$on('refshlist', e => {
- this.getDetail();
- });
- },
- methods: {
- changatextarea(e) {
- this.textarea = e.detail;
- },
- onChange(event) {
- this.radio = event.detail;
- },
- onClick(event) {
- const { name } = event.currentTarget.dataset;
- this.radio = name;
- },
- goStore() {
- let id = this.detail.store_id;
- uni.navigateTo({
- url: `/pages/index/hotel?id=${id}`
- });
- },
- happenTimeFun(num) {
- //时间戳数据处理
- let date = new Date(num * 1000);
- //时间戳为10位需*1000,时间戳为13位的话不需乘1000
- let y = date.getFullYear();
- let MM = date.getMonth() + 1;
- MM = MM < 10 ? '0' + MM : MM; //月补0
- let d = date.getDate();
- d = d < 10 ? '0' + d : d; //天补0
- let h = date.getHours();
- h = h < 10 ? '0' + h : h; //小时补0
- let m = date.getMinutes();
- m = m < 10 ? '0' + m : m; //分钟补0
- let s = date.getSeconds();
- s = s < 10 ? '0' + s : s; //秒补0
- return y + '-' + MM + '-' + d + ' ' + h + ':' + m; //年月日
- //return y + '-' + MM + '-' + d + ' ' + h + ':' + m+ ':' + s; //年月日时分秒
- },
- goDetail(e) {
- let id = e.goods_commonid;
- let store_id = e.store_id;
- uni.navigateTo({
- url: `/pages/index/shop?id=${id}&store_id=${store_id}`
- });
- },
- // 退货退款
- goreturngood(item) {
- item.statusremak = this.detail.status;
- item.order_id = this.id;
- item.store_avatar = this.detail.store_avatar;
- item.store_name = this.detail.store_name;
- item.order_sn = this.detail.order_sn;
- let id = JSON.stringify(item);
- uni.navigateTo({
- url: `/pages/myOrder/returngood?id=${id}` // 退货页面
- });
- },
- // 退款详情
- goreturndetail(e) {
- let id = e;
- uni.navigateTo({
- url: `/pages/myOrder/returndetail?id=${id}` // 退货详情页面
- });
- },
- getDetail() {
- uni.showLoading({
- title: '加载中',
- mask: true
- });
- this.request({
- url: '/v2/order/info',
- method: 'post',
- data: {
- order_id: this.id
- },
- success: res => {
- let { data } = res.data;
- data.goods.forEach((items, index) => {
- let arr = items.goods_name.split(' ');
- items.desarray = arr[0];
- items.descire = items.goods_name.replace(arr[0], '');
- });
- this.detail = data;
- uni.hideLoading();
- if (this.firstloading == 0) {
- this.loading = false;
- }
- this.firstloading = 1;
- }
- });
- },
- // 退款
- returnmoney() {
- this.isreturn = true;
- this.radioShow = true;
- },
- // 取消订单
- cancelOrder(e) {
- if (e == 1) {
- this.titles = '确认取消订单?';
- this.isCancel = true;
- } else if (e == 3) {
- this.titles = '确认收货?';
- this.isGet = true;
- } else if (e == 4) {
- this.titles = '确定退款?';
- this.isreturn = true;
- } else {
- this.titles = '确认删除订单?';
- this.isDelete = true;
- }
- this.orderCancel = true;
- },
- cancelDialog() {
- this.orderCancel = false;
- this.isreturn = false;
- this.isCancel = false;
- this.isDelete = false;
- this.isGet = false;
- },
- cancelDialog2() {
- this.radioShow = false;
- this.isreturn = false;
- this.textarea = '';
- this.radio = 1;
- },
- confirmOrder2() {
- var str = this.radioItems[this.radio - 1].name;
- var data = { order_id: this.id };
- data.remark = str;
- if (this.radio == 5) {
- console.log(this.textarea);
- if (!this.textarea) {
- this.$msg('请输入退款理由');
- return false;
- } else {
- data.remark = this.textarea;
- }
- }
- this.request({
- url: '/v3/Order/refund_direct',
- method: 'post',
- data: data,
- success: res => {
- if (res.data.code == 1000) {
- uni.$emit('refehlist');
- if (this.isreturn) {
- this.cancelDialog2();
- this.getDetail();
- }
- } else {
- this.$msg(res.data.msg);
- this.cancelDialog2();
- }
- }
- });
- },
- confirmOrder() {
- let url = '';
- var data = { order_id: this.id };
- this.orderCancel = false;
- // 取消
- if (this.isCancel) {
- url = '/v2/order/cancel';
- } else if (this.isDelete) {
- // 删除
- url = '/v2/order/drop';
- } else if (this.isGet) {
- // 收货
- url = '/v2/order/confirm';
- }
- this.request({
- url: url,
- method: 'post',
- data: data,
- success: res => {
- if (res.data.code == 1000) {
- if (this.isDelete) {
- this.$msg('删除成功');
- } else if (this.isGet) {
- this.$msg('收货成功');
- } else if (this.isCancel) {
- this.$msg('取消成功');
- }
- uni.$emit('refehlist');
- setTimeout(() => {
- uni.navigateBack();
- }, 1000);
- } else {
- this.$msg(res.data.msg);
- }
- }
- });
- },
- goPay(e) {
- let prices = this.detail.order_amount;
- let order_id = this.id;
- let store_id = e.store_id;
- let isform = 1;
- uni.navigateTo({
- url: `/pages/myOrder/paymoment?order_id=${order_id}
- &prices=${prices}&isform=${isform}&store_id=${store_id}`
- });
- },
- // 催单
- reminder(e) {
- let a = e;
- let order_id = this.id;
- uni.navigateTo({
- url: `/pages/myOrder/reminder?order_id=${order_id}&a=${a}`
- });
- },
- // 评价晒单
- estimate() {
- let order_id = this.id;
- uni.navigateTo({
- url: `/pages/myOrder/estimate?order_id=${order_id}`
- });
- }
- }
- };
- </script>
- <style lang="scss">
- .openSelectTitle {
- padding: 30upx;
- color: #999;
- }
- .weui-mask {
- position: fixed;
- z-index: 998;
- top: 0;
- right: 0;
- left: 0;
- bottom: 0;
- background: rgba(0, 0, 0, 0.6);
- // display: none;
- }
- .openSelect {
- position: absolute;
- position: fixed;
- left: 10%;
- right: 10%;
- background-color: #fff;
- border-radius: 10px;
- z-index: 999;
- top: 20%;
- // display: none;
- }
- .btns view {
- text-align: center;
- padding: 30upx;
- color: #222;
- }
- .btns view:nth-child(2) {
- border-left: 1px solid #f1f1f1;
- color: #d60e15;
- }
- .tkText {
- padding: 0 20upx 20upx 20upx;
- color: #ccc;
- }
- page {
- background-color: #f5f5f5;
- }
- .cart-list {
- background-color: #fff;
- }
- .topTip {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- padding: 20upx 36upx;
- }
- .changewidth {
- color: #303133;
- font-size: 32upx;
- font-weight: 100 !important;
- }
- .priceClass {
- color: #303133 !important;
- font-weight: normal !important;
- font-size: 36upx;
- }
- .van-card {
- background-color: #fff !important;
- }
- .shoplist {
- padding: 10upx 32upx;
- border-bottom: 1px solid #f5f5f5;
- // display: flex;
- // justify-content: space-between;
- // align-items: center;
- }
- .retungood {
- text-align: right;
- padding: 0upx 32upx;
- float: right;
- border: 1px solid #666;
- //margin-right: 32upx;
- }
- .adress {
- padding: 35upx 36upx;
- border-bottom: 14upx solid #f5f5f5;
- }
- .adressDetail {
- padding: 15upx 0;
- }
- .orderCode {
- padding-left: 15upx;
- font-weight: 500;
- }
- .adressbottom {
- padding: 0 36upx;
- color: #606266;
- border-top: 16upx solid #f5f5f5;
- padding-bottom: 32upx;
- margin-bottom: 100upx;
- view {
- padding: 32upx 0 0 0;
- }
- .time {
- padding-left: 16upx;
- }
- }
- .adressbutton {
- position: fixed;
- bottom: 0;
- width: 100%;
- .buttonStatus {
- display: flex;
- text-align: center;
- .deleteOrder {
- flex: 1;
- color: #303133;
- font-size: 32upx;
- background-color: #fff;
- padding: 25upx 0;
- }
- .payOrder {
- flex: 1;
- font-size: 32upx;
- color: #fff;
- background-color: #d9332e;
- padding: 10px 0;
- }
- }
- }
- </style>
|