Parcourir la source

Merge branch 'master' of ssh://gogs.zfire.top:2222/zfire-front/recycle-mobile

linwenxin il y a 1 an
Parent
commit
22c0302b5d

+ 14 - 7
src/pages/mine/myBuy/detail.vue

@@ -17,7 +17,7 @@
         <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.address}}</view>
+          <view class="address ellipsis-2">{{detail.province}}{{detail.city}}{{detail.area}}{{detail.street}}{{detail.address}}</view>
         </view>
       </view>
 
@@ -48,6 +48,7 @@
       <template slot="footer">
         <view class="bottom-container">
           <u-button text="取消订单" shape="circle"></u-button>
+          <u-button text="申请售后" shape="circle" @tap="toReturn()"></u-button>
         </view>
       </template>
 
@@ -73,7 +74,7 @@
 
     data() {
       return {
-        id: null,
+        orderId: null,
         detail: null,
         imageUrl: this.$imageUrl,
         loadStatus: 0,
@@ -82,15 +83,15 @@
       }
     },
 
-    onLoad({id}) {
-      this.id = id;
+    onLoad({orderId}) {
+      this.orderId = orderId;
       this.getDetail();
     },
 
     methods: {
       getDetail() {
-        this.$api.post('/orderPay/detail', {
-          orderId: this.id
+        this.$api.postJson('/orderPay/detail', {
+          orderId: this.orderId
         }).then(res => {
 					this.detail = res.data;
 					this.loadStatus = 0;
@@ -101,11 +102,17 @@
 					this.refresherTriggered = false;
 				})
       },
-      
+
       refresherrefresh() {
         this.refresherTriggered = true;
         this.getDetail();
       },
+
+      toReturn() {
+        this.$navToPage({
+          url: `/pages/mine/myBuy/return?orderId=${this.orderId}`
+        })
+      }
     }
   }
   // #endif

+ 22 - 5
src/pages/mine/myBuy/list.vue

@@ -47,13 +47,18 @@
         <view class="bottom">
           <view class="left-location"><text class="iconfont icon-dingwei"></text>{{item.city}} {{item.area}}</view>
           <view class="right-btn" @tap.stop>
-            
+
             <block v-if="item.status == 'WAIT'">
               <u-button text="取消订单" shape="circle"></u-button>
               <u-button text="去支付" shape="circle" type="primary" plain @tap="toPay(item.goodsId, item.orderId)"></u-button>
             </block>
-            
-            <u-button text="查看物流" shape="circle" @tap="toLogistics(item.logisticsNum)"></u-button>
+
+            <block v-if="~['SEND', 'COMPLETE'].indexOf(item.status)">
+              <u-button text="查看物流" shape="circle" @tap="toLogistics(item.logisticsNum)"></u-button>
+            </block>
+
+            <u-button text="申请售后" shape="circle" @tap="toReturn(item.orderId)"></u-button>
+
           </view>
         </view>
       </view>
@@ -75,9 +80,15 @@
       statusFilter(val) {
         const MAP = {
           WAIT: '待支付',
+          CANCEL: '取消支付',
+          TIMEOUT: '超时取消',
+          PAID: '已支付',
           WAIT_SEND: '待发货',
           SEND: '已发货',
           COMPLETE: '已完成',
+          AFTER_WAIT: '售后中',
+          REFUND: '退款成功',
+          NO_REFUND: '不退款',
         }
         return MAP[val];
       }
@@ -169,9 +180,9 @@
         this.refreshLish();
       },
 
-      toDetail(id) {
+      toDetail(orderId) {
         this.$navToPage({
-          url: `/pages/mine/myBuy/detail?id=${id}`
+          url: `/pages/mine/myBuy/detail?orderId=${orderId}`
         })
       },
 
@@ -185,6 +196,12 @@
         this.$navToPage({
           url: `/pages/goods/order?goodsId=${goodsId}&orderId=${orderId}`
         })
+      },
+
+      toReturn(orderId) {
+        this.$navToPage({
+          url: `/pages/mine/myBuy/return?orderId=${orderId}`
+        })
       }
 
     }

+ 16 - 11
src/pages/mine/myBuy/logistics.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="app-container">
-		<view class="all-container" v-if="!isNoData">
+		<view class="all-container" v-if="logisticsData && logisticsData.length > 0">
 			<view class="top-container">
 				<view class="left">{{logisticsData[0].comName}}<text>{{logisticsData[0].logisticsNum}}</text></view>
 				<view class="right">
@@ -12,7 +12,11 @@
 			</view>
 		</view>
 
-		<no-data v-if="isNoData" :showText="noDataText"></no-data>
+		<Loading
+			:type="3"
+			:loadStatus="loadStatus"
+			:showText="errorText"
+		/>
 	</view>
 </template>
 
@@ -31,8 +35,8 @@
 				logisticsNum: null,
 				logisticsData: [],
 				testStrList: [0,1,2,3,4,5,6],
-				isNoData: false,
-				noDataText: '',
+        loadStatus: 0,
+        errorText: '',
 			}
 		},
 
@@ -49,19 +53,20 @@
           num: this.logisticsNum,
 				}).then(res => {
 					if(res.code == 200 && res.data.length >= 1) {
+            this.loadStatus = 0;
 						let logisticsData = res.data;
 						this.logisticsData = changeAttribute(this.testStrList, setAttribute(logisticsData));
 					}else if(res.code == 1100) {
-						this.isNoData = true;
-						this.noDataText = res.message;
+						this.loadStatus = 2;
+						this.errorText = res.message;
 					}else if(res.data.length < 1) {
-						this.isNoData = true;
-						this.noDataText = '暂无物流信息';
+						this.loadStatus = 2;
+						this.errorText = '暂无物流信息';
 					}
 				}).catch(res => {
-					this.isNoData = true;
-					this.noDataText = res.message;
-				})
+      		this.errorText = res.message;
+      		this.loadStatus = 2;
+      	})
 			},
 
 			// 复制

+ 4 - 4
src/pages/mine/myCollection.vue

@@ -12,17 +12,17 @@
           <image src="@/static/common/logo.png"></image>
           <view class="user">
             <view class="name">{{item.userName}}</view>
-            <view class="time">{{item.createTime}}</view>
+            <view class="time">{{item.createTime | timeFilter}}</view>
           </view>
           <view class="price">{{item.amount | priceFilter}}</view>
         </view>
         <view class="title">{{item.title}}</view>
         <view class="des">{{item.content}}</view>
         <view class="imgs">
-          <image :src="imgUrl + it.imgUrl" v-for="(it, idx) in item.goodsFiles" :key="idx"></image>
+          <image :src="imgUrl + it.imgUrl" v-for="(it, idx) in item.goodsFiles" :key="idx" mode="aspectFill"></image>
         </view>
         <view class="bottom">
-          <view class="left-location"><text class="iconfont icon-dingwei"></text>{{item.address}}</view>
+          <view class="left-location"><text class="iconfont icon-dingwei"></text>{{item.city}} {{item.area}}</view>
           <view class="right-btn" @tap.stop>
             <u-button text="取消收藏" shape="circle" @click="handelCancel(item.id)"></u-button>
           </view>
@@ -107,7 +107,7 @@
         this.$modal({
           content: '确定要取消收藏吗?'
         }).then(() => {
-          this.$api.post('/likeOrCollect/likeOrCollect', {
+          this.$api.postJson('/likeOrCollect/likeOrCollect', {
             userId: this.$store.state.user.userId,
             goodsId: id,
             type: 2,

+ 4 - 4
src/pages/mine/myLike.vue

@@ -12,17 +12,17 @@
           <image src="@/static/common/logo.png"></image>
           <view class="user">
             <view class="name">{{item.userName}}</view>
-            <view class="time">{{item.createTime}}</view>
+            <view class="time">{{item.createTime | timeFilter}}</view>
           </view>
           <view class="price">{{item.amount | priceFilter2}}</view>
         </view>
         <view class="title">{{item.title}}</view>
         <view class="des">{{item.content}}</view>
         <view class="imgs">
-          <image :src="imgUrl + it.imgUrl" v-for="(it, idx) in item.goodsFiles" :key="idx"></image>
+          <image :src="imgUrl + it.imgUrl" v-for="(it, idx) in item.goodsFiles" :key="idx" mode="aspectFill"></image>
         </view>
         <view class="bottom">
-          <view class="left-location"><text class="iconfont icon-dingwei"></text>{{item.address}}</view>
+          <view class="left-location"><text class="iconfont icon-dingwei"></text>{{item.city}} {{item.area}}</view>
           <view class="right-btn" @tap.stop>
             <u-button text="取消点赞" shape="circle" @click="handelCancel(item.id)"></u-button>
           </view>
@@ -107,7 +107,7 @@
         this.$modal({
           content: '确定要取消点赞吗?'
         }).then(() => {
-          this.$api.post('/likeOrCollect/likeOrCollect', {
+          this.$api.postJson('/likeOrCollect/likeOrCollect', {
             userId: this.$store.state.user.userId,
             goodsId: id,
             type: 1,