Moss преди 1 година
родител
ревизия
99ce1b380a
променени са 3 файла, в които са добавени 28 реда и са изтрити 14 реда
  1. 1 1
      src/components/zj-dialog/zj-dialog-deliver.vue
  2. 26 12
      src/pages/goods/detail.vue
  3. 1 1
      src/pages/mine/myCollection.vue

+ 1 - 1
src/components/zj-dialog/zj-dialog-deliver.vue

@@ -108,7 +108,7 @@
         if(this.type === 2) {
           params.logisticsName = this.company.name;
           params.logisticsCode = this.company.code;
-          params.logisticsNum = this.orderNoe;
+          params.logisticsNum = this.orderNo;
         }
 
 				this.$api.postJson('/orderPay/logisticsAdd', {

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

@@ -22,7 +22,7 @@
         <view class="btns">
           <u-button type="warning" text="分享好友" class="share" open-type="share"></u-button>
           <u-button type="error" text="立即联系" class="contact" @click="toContact" v-if="!isMine"></u-button>
-          <u-button type="primary" text="立即购买" class="buy" @click="toBuy" v-if="!isMine && detail.amount" :disabled="detail.status === 4"></u-button>
+          <u-button type="primary" text="立即购买" class="buy" @click="toBuy" v-if="!isMine || detail.amount || detail.status === 4"></u-button>
         </view>
       </view>
 
@@ -96,7 +96,7 @@
       <template slot="footer">
         <view class="bottom-container">
           <u-button text="留言" type="primary" shape="circle" @click="openRemark()"></u-button>
-          <u-button text="操作" type="primary" shape="circle" @click="isShowActionDialog = true" v-if="isMine"></u-button>
+          <u-button text="操作" type="primary" shape="circle" @click="isShowActionDialog = true" v-if="isMine && detail.status !== 4"></u-button>
         </view>
       </template>
     </zj-page-layout>
@@ -160,12 +160,7 @@
 				errorText: '',
         refresherTriggered: false,
         isShowRemarkDialog: false,
-        actionList: [
-          {name: '已卖出', value: 1},
-          {name: '下架', value: 2},
-          {name: '重新上架', value: 3},
-          {name: '编辑', value: 4},
-        ],
+        actionList: [],
         isShowActionDialog: false,
         replyId: '',
 
@@ -222,6 +217,20 @@
         }).then(res => {
       		this.detail = res.data;
       		this.loadStatus = 0;
+
+          let actionList = [
+            {name: '已卖出', value: 1},
+            {name: '上架', value: 2},
+            {name: '下架', value: 3},
+            {name: '重新上架', value: 4},
+            {name: '编辑', value: 5},
+          ]
+          if(this.detail.status === 1) {
+            actionList.splice(1, 1);
+          }else if(this.detail.status === 0) {
+            actionList.splice(2, 1);
+          }
+          this.actionList = actionList;
       	}).catch(res => {
       		this.errorText = res.message;
       		this.loadStatus = 2;
@@ -333,13 +342,18 @@
 
       selectAction(e) {
         // 已卖出/下架
-        if(e.value === 1 || e.value === 2) {
+        if(~[1,2,3].indexOf(e.value)) {
+          const statusMap = {
+            1: 4, // 已卖出
+            2: 1, // 上架
+            3: 0, // 下架
+          }
           this.$modal({
             content: `确定要${e.name}吗?`
           }).then(() => {
             this.$api.post('/goods/upOrDel', {
               id: this.id,
-              status: e.value === 1 ? 4 : 0,
+              status: statusMap[e.value],
             }).then(res => {
               this.$successToast();
               this.getDetail();
@@ -347,7 +361,7 @@
           }).catch(() => {})
         }
         // 重新上架
-        else if(e.value === 3) {
+        else if(e.value === 4) {
           uni.setStorageSync('issuePageParam', {
             goodsId: this.id,
             type: 1
@@ -357,7 +371,7 @@
           }, 'switchTab')
         }
         // 编辑
-        else if(e.value === 4) {
+        else if(e.value === 5) {
           uni.setStorageSync('issuePageParam', {
             goodsId: this.id,
             type: 2

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

@@ -14,7 +14,7 @@
             <view class="name">{{item.userName}}</view>
             <view class="time">{{item.createTime | timeFilter}}</view>
           </view>
-          <view class="price">{{item.amount | priceFilter}}</view>
+          <view class="price">{{item.amount | priceFilter2}}</view>
         </view>
         <view class="title">{{item.title}}</view>
         <view class="des">{{item.content}}</view>