瀏覽代碼

feat: 修改

Moss 1 年之前
父節點
當前提交
a44c05ba1a

+ 26 - 7
src/pages/goods/detail.vue

@@ -28,18 +28,21 @@
       </view>
 
       <view class="info-container">
+        <view class="soldout" v-if="detail.status === 4">
+          <image src="@/static/common/soldout.png" mode="widthFix"></image>
+        </view>
         <view class="title">
           <view class="tit">{{detail.title}}</view>
           <view class="price">{{detail.amount | priceFilter2}}</view>
         </view>
         <view class="des">{{detail.content}}</view>
         <view class="tags">
-          <view class="it">{{detail.brand}}</view>
-          <view class="it">{{detail.power}}</view>
-          <view class="it">{{detail.energy}}</view>
+          <view class="it" v-if="detail.brand">{{detail.brand}}</view>
+          <view class="it" v-if="detail.power">{{detail.power}}</view>
+          <view class="it" v-if="detail.energy">{{detail.energy}}</view>
         </view>
         <view class="info">
-          <text>{{detail.goodsCreateTime | timeFilter}}发布</text>
+          <text>{{detail.createTime | timeFilter}}发布</text>
         </view>
         <view class="bottom">
           <view class="left-location"><text class="iconfont icon-dingwei"></text>{{detail.city}} {{detail.area}}</view>
@@ -61,7 +64,7 @@
       </view>
 
       <view class="imgs-container">
-        <image :src="imageUrl + item.imgUrl" v-for="(item, index) in detail.goodsFiles" :key="index"></image>
+        <image :src="imageUrl + item.imgUrl" v-for="(item, index) in detail.goodsFiles" :key="index" mode="widthFix"></image>
       </view>
 
       <view class="remark-container">
@@ -376,6 +379,15 @@
   background: #ffffff;
   padding: 30rpx;
   margin-top: 30rpx;
+  position: relative;
+  .soldout {
+    position: absolute;
+    right: 150rpx;
+    top: 20rpx;
+    image {
+      width: 120rpx;
+    }
+  }
   .title {
     display: flex;
     justify-content: space-between;
@@ -383,8 +395,9 @@
       font-size: 32rpx;
     }
     .price {
-      font-size: 28rpx;
+      font-size: 32rpx;
       color: $assist-color;
+      font-weight: 500;
     }
   }
   .des {
@@ -462,6 +475,7 @@
   margin-top: 30rpx;
   image {
     width: 100%;
+    display: block;
   }
 }
 
@@ -479,6 +493,11 @@
     .right {
       font-size: 24rpx;
       color: $sec-font;
+      border-radius: 40rpx;
+      border: 1px solid #eaeaea;
+      padding: 0 16rpx;
+      height: 40rpx;
+      line-height: 40rpx;
     }
   }
   .item {
@@ -550,7 +569,7 @@
 }
 
 .report-container {
-  padding: 0 30rpx 30rpx;
+  padding: 0 30rpx 60rpx;
   .title {
     margin-top: 30rpx;
     margin-bottom: 20rpx;

+ 3 - 0
src/pages/goods/list.vue

@@ -36,6 +36,9 @@
 
     <view class="common-goods-list">
       <view class="item" v-for="(item, index) in dataList" :key="index" @tap="toGoodsDetail(item.id)">
+        <view class="soldout" v-if="item.status === 4">
+          <image src="@/static/common/soldout.png" mode="widthFix"></image>
+        </view>
         <view class="top">
           <image src="@/static/common/logo.png"></image>
           <view class="user">

+ 4 - 1
src/pages/index/index.vue

@@ -33,6 +33,9 @@
 
         <view class="common-goods-list">
           <view class="item card" v-for="(item, index) in dataList" :key="index" @tap="toGoodsDetail(item.id)">
+            <view class="soldout" v-if="item.status === 4">
+              <image src="@/static/common/soldout.png" mode="widthFix"></image>
+            </view>
             <view class="top">
               <image src="@/static/common/logo.png"></image>
               <view class="user">
@@ -302,4 +305,4 @@
       }
     }
   }
-</style>
+</style>

+ 76 - 6
src/pages/mine/myBuy/detail.vue

@@ -24,7 +24,7 @@
       <view class="goods-container">
         <view class="title">商品信息</view>
         <view class="goods">
-          <image :src="imageUrl + detail.goodsPicUrl"></image>
+          <image :src="imageUrl + detail.goodsPicUrl" mode="aspectFill"></image>
           <view class="main">
             <view class="name">{{detail.goodsTitle}}</view>
             <view class="des">{{detail.content}}</view>
@@ -47,8 +47,26 @@
 
       <template slot="footer">
         <view class="bottom-container">
-          <u-button text="取消订单" shape="circle"></u-button>
-          <u-button text="申请售后" shape="circle" @tap="toReturn()"></u-button>
+          <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>
 
@@ -108,11 +126,63 @@
         this.getDetail();
       },
 
-      toReturn() {
+      // 取消支付
+      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/return?orderId=${this.orderId}`
+          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

+ 57 - 6
src/pages/mine/myBuy/list.vue

@@ -36,11 +36,11 @@
           <view class="status">{{item.status | statusFilter}}</view>
         </view>
         <view class="goods">
-          <image :src="imageUrl + item.goodsPicUrl"></image>
+          <image :src="imageUrl + item.goodsPicUrl" mode="aspectFill"></image>
           <view class="main">
-            <view class="name">{{item.goodsTitle}}</view>
+            <view class="name">{{item.goodsTitle}}<text>×{{item.num}}</text></view>
             <view class="des">{{item.content}}</view>
-            <view class="price"><text>{{item.goodsAmount | priceFilter2}}</text>数量:{{item.num}}</view>
+            <view class="price">{{item.goodsAmount | priceFilter2}}</view>
           </view>
         </view>
         <view class="total">订单总金额<text>{{item.price | priceFilter2}}</text></view>
@@ -49,15 +49,25 @@
           <view class="right-btn" @tap.stop>
 
             <block v-if="item.status == 'WAIT'">
-              <u-button text="取消订单" shape="circle"></u-button>
+              <u-button text="取消订单" shape="circle" @click="cancelOrder(item.orderId)"></u-button>
               <u-button text="去支付" shape="circle" type="primary" plain @tap="toPay(item.goodsId, item.orderId)"></u-button>
             </block>
 
+            <block v-if="item.status == 'WAIT_SEND'">
+              <u-button text="联系卖家" shape="circle" @tap="toContact(item.goodsId)"></u-button>
+            </block>
+
             <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>
+            <block v-if="item.status == 'SEND'">
+              <u-button text="确认收货" shape="circle" type="primary" plain @tap="confirmReceipt(item.orderId)"></u-button>
+            </block>
+
+            <block v-if="item.status == 'COMPLETE'">
+              <u-button text="申请售后" shape="circle" @tap="toReturn(item.orderId)"></u-button>
+            </block>
 
           </view>
         </view>
@@ -180,29 +190,70 @@
         this.refreshLish();
       },
 
+      // 取消支付
+      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.refreshLish();
+          })
+        }).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(() => {})
+      },
+
+      // 去订单详情
       toDetail(orderId) {
         this.$navToPage({
           url: `/pages/mine/myBuy/detail?orderId=${orderId}`
         })
       },
 
+      // 查看物流
       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}`
+        })
+      },
 
     }
   }

+ 3 - 3
src/pages/mine/myIssue/list.vue

@@ -39,9 +39,9 @@
           <view class="goods">
             <image :src="imageUrl + item.goodsPicUrl"></image>
             <view class="main">
-              <view class="name">{{item.title}}</view>
+              <view class="name">{{item.title}}<text>×{{item.num}}</text></view>
               <view class="des">{{item.content}}</view>
-              <view class="price"><text>{{item.amount | priceFilter2}}</text></view>
+              <view class="price">{{item.amount | priceFilter2}}</view>
             </view>
           </view>
           <view class="bottom">
@@ -200,7 +200,7 @@
         pam: {},
       }
     },
-    
+
     onLoad(pam) {
       this.pam = pam;
     },

二進制
src/static/common/soldout.png


二進制
src/static/user/icon_1.png


二進制
src/static/user/icon_2.png


二進制
src/static/user/icon_3.png


二進制
src/static/user/other_book.png


二進制
src/static/user/other_fault.png


二進制
src/static/user/other_speech.png


+ 18 - 6
src/styles/common.scss

@@ -31,6 +31,15 @@
     margin-top: 30rpx;
     background: #ffffff;
     padding: 20rpx 30rpx;
+    position: relative;
+    .soldout {
+      position: absolute;
+      right: 120rpx;
+      top: 50rpx;
+      image {
+        width: 120rpx;
+      }
+    }
     .top {
       display: flex;
       align-items: center;
@@ -166,6 +175,11 @@
         margin-left: 20rpx;
         .name {
           font-size: 32rpx;
+          text {
+            font-size: 28rpx;
+            color: $sec-font;
+            margin-left: 12rpx;
+          }
         }
         .des {
           margin-top: 12rpx;
@@ -174,12 +188,9 @@
         }
         .price {
           margin-top: 12rpx;
-        	text {
-        		color: $assist-color;
-        		font-weight: 500;
-        		font-size: 32rpx;
-            margin-right: 12rpx;
-        	}
+        	color: $assist-color;
+        	font-weight: 500;
+        	font-size: 32rpx;
         }
       }
     }
@@ -193,6 +204,7 @@
       text {
         margin-left: 12rpx;
         color: $assist-color;
+        font-weight: 500;
       }
     }
     .bottom {