123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326 |
- <template>
- <!-- #ifdef H5 -->
- <view>
- <Loading
- :type="3"
- :loadStatus="loadStatus"
- :showText="errorText"
- />
- <zj-page-layout
- v-if="detail"
- :hasFooter="true"
- :isScroll="true"
- :refresherTriggered="refresherTriggered"
- @refresherrefresh="refresherrefresh">
- <view class="address-container">
- <view class="icon"><text class="iconfont icon-dingwei1"></text></view>
- <view class="hasdata">
- <view class="name">{{detail.userName}}<text>{{detail.phone}}</text></view>
- <view class="address ellipsis-2">{{detail.province}}{{detail.city}}{{detail.area}}{{detail.street}}{{detail.address}}</view>
- </view>
- </view>
- <view class="goods-container">
- <view class="title">商品信息</view>
- <view class="goods">
- <image :src="imageUrl + detail.goodsPicUrl" mode="aspectFill"></image>
- <view class="main">
- <view class="name">{{detail.goodsTitle}}</view>
- <view class="des">{{detail.content}}</view>
- <view class="price"><text>{{detail.goodsAmount | priceFilter2}}</text>数量:{{detail.num}}</view>
- </view>
- </view>
- <view class="total">订单总金额<text>{{detail.price | priceFilter2}}</text></view>
- </view>
- <view class="order-container">
- <view class="title">订单信息</view>
- <view class="row">订单编号:{{detail.orderId}}</view>
- <view class="row">创建时间:{{detail.createTime}}</view>
- <view class="row">付款时间:{{detail.payTime}}</view>
- <view class="row">支付方式:{{detail.payType | payTypeFilter}}</view>
- <view class="row">支付单号:{{detail.transactionId}}</view>
- <view class="row">发货时间:{{detail.logisticsTime}}</view>
- <view class="row">收货时间:{{detail.completeTime}}</view>
- </view>
- <template slot="footer">
- <view class="bottom-container">
- <block v-if="detail.status == 'WAIT'">
- <u-button text="取消订单" shape="circle" @click="cancelOrder(detail.orderId)"></u-button>
- <u-button text="去支付" shape="circle" type="primary" plain @tap="toPay(detail.goodsId, detail.orderId)"></u-button>
- </block>
- <block v-if="detail.status == 'WAIT_SEND'">
- <u-button text="联系卖家" shape="circle" @tap="toContact(detail.goodsId)"></u-button>
- </block>
- <block v-if="~['SEND', 'COMPLETE'].indexOf(detail.status)">
- <u-button text="查看物流" shape="circle" @tap="toLogistics(detail.logisticsNum)"></u-button>
- </block>
- <block v-if="detail.status == 'SEND'">
- <u-button text="确认收货" shape="circle" type="primary" plain @tap="confirmReceipt(detail.orderId)"></u-button>
- </block>
- <block v-if="detail.status == 'COMPLETE'">
- <u-button text="申请售后" shape="circle" @tap="toReturn(detail.orderId)"></u-button>
- </block>
- </view>
- </template>
- </zj-page-layout>
- </view>
- <!-- #endif -->
- <!-- #ifndef H5 -->
- <web-view :src="webViewHref('/pages/mine/myBuy/detail', pam)" @message="crossPage.$listener"></web-view>
- <!-- #endif -->
- </template>
- <script>
- // #ifdef H5
- export default {
- filters: {
- payTypeFilter(val) {
- const MAP = {
- WECHAT: '微信支付'
- }
- return MAP[val];
- }
- },
- data() {
- return {
- orderId: null,
- detail: null,
- imageUrl: this.$imageUrl,
- loadStatus: 0,
- errorText: '',
- refresherTriggered: false,
- }
- },
- onLoad({orderId}) {
- this.orderId = orderId;
- this.getDetail();
- },
- methods: {
- getDetail() {
- this.$api.postJson('/orderPay/detail', {
- orderId: this.orderId
- }).then(res => {
- this.detail = res.data;
- this.loadStatus = 0;
- }).catch(res => {
- this.errorText = res.message;
- this.loadStatus = 2;
- }).finally(res => {
- this.refresherTriggered = false;
- })
- },
- refresherrefresh() {
- this.refresherTriggered = true;
- this.getDetail();
- },
- // 取消支付
- cancelOrder(orderId) {
- this.$modal({
- content: '确认取消支付吗?'
- }).then(() => {
- this.$api.postJson('/orderPay/wait/notPay', {
- userId: this.$store.state.user.userId,
- orderId: orderId,
- }).then(res => {
- this.$successToast();
- this.getDetail();
- })
- }).catch(() => {})
- },
-
- // 确认收货
- confirmReceipt(orderId) {
- this.$modal({
- content: '确定要确认收货吗?'
- }).then(() => {
- this.$api.postJson('/orderPay/confirm', {
- userId: this.$store.state.user.userId,
- orderId: orderId,
- }).then(res => {
- this.$successToast();
- this.refreshLish();
- })
- }).catch(() => {})
- },
- // 查看物流
- toLogistics(logisticsNum) {
- this.$navToPage({
- url: `/pages/mine/myBuy/logistics?logisticsNum=${logisticsNum}`
- })
- },
- // 去支付
- toPay(goodsId, orderId) {
- this.$navToPage({
- url: `/pages/goods/order?goodsId=${goodsId}&orderId=${orderId}`
- })
- },
- // 去申请售后
- toReturn(orderId) {
- this.$navToPage({
- url: `/pages/mine/myBuy/return?orderId=${orderId}`
- })
- },
- // 去联系
- toContact(goodsId) {
- this.$navToPage({
- url: `/pages/message/msgView?goodsId=${goodsId}`
- })
- },
- }
- }
- // #endif
- // #ifndef H5
- export default {
- data() {
- return {
- pam: {},
- }
- },
- onLoad(pam) {
- this.pam = pam;
- },
- }
- // #endif
- </script>
- <style lang="scss" scoped>
- .address-container {
- background: #FFFFFF;
- display: flex;
- align-items: center;
- height: 150rpx;
- padding: 0 20rpx;
- margin-top: 30rpx;
- .icon {
- width: 52rpx;
- height: 52rpx;
- border-radius: 50%;
- background: $theme-color;
- display: flex;
- flex-shrink: 0;
- justify-content: center;
- align-items: center;
- margin-right: 20rpx;
- .iconfont {
- font-size: 36rpx;
- color: #ffffff;
- }
- }
- .hasdata {
- .name {
- font-size: 32rpx;
- color: #333333;
- text {
- color: #999999;
- font-size: 28rpx;
- margin-left: 16rpx;
- }
- }
- .address {
- font-size: 28rpx;
- color: #666666;
- line-height: 34rpx;
- margin-top: 10rpx;
- }
- }
- }
- .goods-container {
- background: #ffffff;
- margin-top: 30rpx;
- padding: 30rpx 30rpx 0;
- .title {
- font-weight: 500;
- }
- .goods {
- display: flex;
- padding: 30rpx 0;
- image {
- width: 120rpx;
- height: 120rpx;
- }
- .main {
- flex: 1;
- margin-left: 20rpx;
- .name {
- font-size: 32rpx;
- }
- .des {
- margin-top: 12rpx;
- font-size: 28rpx;
- color: $reg-font;
- }
- .price {
- margin-top: 12rpx;
- text {
- color: $assist-color;
- font-weight: 500;
- font-size: 32rpx;
- margin-right: 12rpx;
- }
- }
- }
- }
- .total {
- border-top: 1px solid #eaeaea;
- height: 80rpx;
- display: flex;
- align-items: center;
- justify-content: end;
- font-size: 28rpx;
- text {
- margin-left: 12rpx;
- color: $assist-color;
- }
- }
- }
- .order-container {
- background: #ffffff;
- margin-top: 30rpx;
- padding: 30rpx;
- .title {
- font-weight: 500;
- margin-bottom: 20rpx;
- }
- .row {
- margin-top: 12rpx;
- font-size: 28rpx;
- text {
- color: $assist-color;
- }
- }
- }
- .bottom-container {
- padding: 20rpx 30rpx;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- .u-button {
- width: auto;
- height: 60rpx;
- margin: 0;
- margin-left: 20rpx;
- }
- }
- </style>
|