浏览代码

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

linwenxin 1 年之前
父节点
当前提交
3282c4b4c3

+ 94 - 22
src/pages/goods/detail.vue

@@ -23,14 +23,14 @@
         <view class="btns">
           <u-button type="warning" text="分享好友" class="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"></u-button>
+          <u-button type="primary" text="立即购买" class="buy" @click="toBuy" v-if="!isMine && detail.amount" :disabled="detail.status === 4"></u-button>
         </view>
       </view>
 
       <view class="info-container">
         <view class="title">
-          <view class="tit">{{detail.goodsTitle}}</view>
-          <view class="price">{{detail.goodsAmount | priceFilter2}}</view>
+          <view class="tit">{{detail.title}}</view>
+          <view class="price">{{detail.amount | priceFilter2}}</view>
         </view>
         <view class="des">{{detail.content}}</view>
         <view class="tags">
@@ -42,19 +42,19 @@
           <text>{{detail.goodsCreateTime}}</text>
         </view>
         <view class="bottom">
-          <view class="left-location">{{detail.address}}</view>
+          <view class="left-location"><text class="iconfont icon-dingwei"></text>{{detail.city}} {{detail.area}}</view>
           <view class="right-stats">
             <view class="it">
               <text class="iconfont icon-liulan"></text>
-              <text class="text">{{detail.visit || 0}}浏览</text>
+              <text class="text">{{detail.visit || 0}}</text>
             </view>
             <view class="it" :class="detail.isLike ? 'active':''" @tap="handelLickCollect(1)">
               <text class="iconfont icon-dianzan"></text>
-              <text class="text">点赞</text>
+              <text class="text">{{detail.up || 0}}</text>
             </view>
             <view class="it" :class="detail.isCollect ? 'active':''" @tap="handelLickCollect(2)">
               <text class="iconfont icon-shoucang"></text>
-              <text class="text">收藏</text>
+              <text class="text">{{detail.collectNum || 0}}</text>
             </view>
           </view>
         </view>
@@ -67,7 +67,7 @@
       <view class="remark-container">
         <view class="title">
           <view class="tit">全部留言</view>
-          <view class="right" v-if="!isMine">内容违规,我要举报</view>
+          <view class="right" v-if="!isMine" @tap="isShowReportDialog = true;">内容违规,我要举报</view>
         </view>
         <view class="item" v-for="(item, index) in remarkList" :key="index">
           <view class="top">
@@ -109,6 +109,25 @@
       @close="isShowActionDialog = false"
       @select="selectAction">
     </u-action-sheet>
+
+    <zj-dialog-box
+    	:title="'违规举报'"
+    	:minHeight="'50vh'"
+    	:isShow="isShowReportDialog"
+    	@cancel="cancelReportDialog"
+    	@confirm="confirmReportDialog">
+      <view class="report-container">
+        <view class="title"><text>*</text>举报原因</view>
+        <u--textarea
+        	fixed
+        	v-model="reportForm.reason"
+        	placeholder="请输入"
+        	height="100">
+        </u--textarea>
+        <view class="title">上传凭证</view>
+        <zj-upload key="cp" @getFiles="getFiles" :fileList="reportForm.fileList" :count="9" />
+      </view>
+    </zj-dialog-box>
   </view>
   <!-- #endif -->
   <!-- #ifndef H5 -->
@@ -117,12 +136,16 @@
 </template>
 
 <script>
-  // #ifdef H5
+  // #ifdef H5
+	import zjDialogBox from "@/components/zj-dialog/zj-dialog-box.vue";
 	import zjDialogRemark from '@/components/zj-dialog/zj-dialog-remark.vue';
+  import zjUpload from '@/components/zj-upload/index.vue'
 
   export default {
     components: {
-      zjDialogRemark
+      zjDialogBox,
+      zjDialogRemark,
+      zjUpload
     },
 
     data() {
@@ -143,6 +166,12 @@
         ],
         isShowActionDialog: false,
         replyId: '',
+
+        isShowReportDialog: false,
+        reportForm: {
+          reason: '',
+          fileList: [],
+        }
       }
     },
 
@@ -191,7 +220,7 @@
           userId: this.$store.state.user.userId,
           goodsId: this.id,
           type,
-          operate: !status
+          operate: status ? 'NO' : 'YES'
         }).then(res => {
           this.getDetail();
         })
@@ -248,19 +277,44 @@
         this.openRemark(item);
       },
 
-      selectAction() {
+      getFiles(value) {
+        this.reportForm.fileList = value[0]
+      },
+
+      cancelReportDialog() {
+        this.reportForm.reason = '';
+        this.reportForm.fileList = [];
+        this.isShowReportDialog = false;
+      },
+
+      confirmReportDialog() {
+        this.$api.postJson('/reportGoods/report', {
+          goodsId: this.id,
+          reportNote: this.reportForm.reason,
+          url: this.reportForm.fileList,
+        }).then(res => {
+          this.cancelReportDialog();
+          this.isShowRemarkDialog = false;
+        })
+      },
 
+      selectAction() {
+        if(!this.reportForm.reason) return this.$toast('请输入举报原因');
       }
     }
 
   }
   // #endif
   // #ifndef H5
+  import zjDialogBox from "@/components/zj-dialog/zj-dialog-box.vue";
   import zjDialogRemark from '@/components/zj-dialog/zj-dialog-remark.vue';
+  import zjUpload from '@/components/zj-upload/index.vue'
 
   export default {
     components: {
-      zjDialogRemark
+      zjDialogBox,
+      zjDialogRemark,
+      zjUpload
     },
 
     data() {
@@ -302,18 +356,18 @@
   }
   .btns {
     display: flex;
-    justify-content: space-between;
     margin-top: 30rpx;
     ::v-deep .u-button {
-      width: 188rpx;
+      width: calc((100% - 60rpx) / 3);
       height: 68rpx;
       line-height: 68rpx;
       font-size: 28rpx;
       color: #ffffff;
       margin: 0;
-    }
-    .share {
-
+      margin-right: 30rpx;
+      &:last-child {
+        margin-right: 0;
+      }
     }
   }
 }
@@ -365,22 +419,29 @@
     align-items: center;
     justify-content: space-between;
     .left-location {
-      font-size: 24rpx;
+      font-size: 28rpx;
       color: $sec-font;
+      display: flex;
+      align-items: center;
+      .iconfont {
+        margin-right: 4rpx;
+      }
     }
     .right-stats {
+      flex-shrink: 0;
       display: flex;
       align-items: center;
       .it {
+        flex-shrink: 0;
         display: flex;
         align-items: center;
-        margin-left: 16rpx;
+        margin-left: 20rpx;
         .iconfont {
-          font-size: 28rpx;
+          font-size: 30rpx;
           color: $sec-font;
         }
         .text {
-          font-size: 24rpx;
+          font-size: 26rpx;
           margin-left: 4rpx;
           color: $sec-font;
         }
@@ -488,6 +549,17 @@
   }
 }
 
+.report-container {
+  padding: 0 30rpx 30rpx;
+  .title {
+    margin-top: 30rpx;
+    margin-bottom: 20rpx;
+    text {
+      color: $assist-color;
+    }
+  }
+}
+
 .bottom-container {
   padding: 20rpx 30rpx;
   display: flex;

+ 2 - 2
src/pages/goods/list.vue

@@ -47,10 +47,10 @@
         <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-stats">
             <view class="it">
               <text class="iconfont icon-dianzan"></text>

+ 6 - 6
src/pages/index/index.vue

@@ -43,12 +43,16 @@
             <view class="title">{{item.title}}</view>
             <view class="des">{{item.content}}</view>
             <view class="imgs">
-              <image :src="imageUrl + it.imgUrl" v-for="(it, idx) in item.goodsFiles" :key="idx"></image>
+              <image :src="imageUrl + 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-stats">
                 <view class="it">
+                  <text class="iconfont icon-liulan"></text>
+                  <text class="text">{{item.visit || 0}}</text>
+                </view>
+                <view class="it">
                   <text class="iconfont icon-dianzan"></text>
                   <text class="text">{{item.up || 0}}</text>
                 </view>
@@ -56,10 +60,6 @@
                   <text class="iconfont icon-shoucang"></text>
                   <text class="text">{{item.collectNum || 0}}</text>
                 </view>
-                <view class="it">
-                  <text class="iconfont icon-liulan"></text>
-                  <text class="text">{{item.visit || 0}}</text>
-                </view>
               </view>
             </view>
           </view>

+ 102 - 27
src/pages/mine/myEarnings/detail.vue

@@ -1,39 +1,114 @@
 <template>
-  <zj-page-layout
-  	:hasFooter="false"
-  	:isScroll="true"
-  	:refresherTriggered="refresherTriggered"
-  	@refresherrefresh="refresherrefresh">
-    <view class="goods-container">
-      <view class="title">商品信息</view>
-      <view class="goods">
-        <image src="@/static/user/other_book.png"></image>
-        <view class="main">
-          <view class="name">商品名称</view>
-          <view class="des">商品描述</view>
-          <view class="price"><text>¥18.00</text>x2</view>
+  <!-- #ifdef H5 -->
+  <view>
+    <Loading
+    	:type="3"
+    	:loadStatus="loadStatus"
+    	:showText="errorText"
+    />
+    <zj-page-layout
+      v-if="detail"
+      :hasFooter="false"
+      :isScroll="true"
+      :refresherTriggered="refresherTriggered"
+      @refresherrefresh="refresherrefresh">
+
+      <view class="goods-container">
+        <view class="title">商品信息</view>
+        <view class="goods">
+          <image :src="imageUrl + detail.goodsPicUrl"></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="total">订单总金额<text>¥1200.00</text></view>
-    </view>
 
-    <view class="order-container">
-      <view class="title">订单信息</view>
-      <view class="row">订单编号:1234321232</view>
-      <view class="row">创建时间:1234321232</view>
-      <view class="row">付款时间:1234321232</view>
-      <view class="row">支付方式:1234321232</view>
-      <view class="row">支付单号:1234321232</view>
-      <view class="row">发货时间:1234321232</view>
-      <view class="row">收货时间:1234321232</view>
-      <view class="row">结算金额:<text>¥1200.00</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 class="row">结算金额:<text>¥{{detail.sharePrice | priceFilter}}</text></view>
+      </view>
 
-  </zj-page-layout>
+    </zj-page-layout>
+  </view>
+  <!-- #endif -->
+  <!-- #ifndef H5 -->
+  <web-view :src="webViewHref('/pages/mine/myEarnings/detail', pam)"></web-view>
+  <!-- #endif -->
 </template>
 
 <script>
+  // #ifdef H5
+  export default {
+    filters: {
+      payTypeFilter(val) {
+        const MAP = {
+          WECHAT: '微信支付'
+        }
+        return MAP[val];
+      }
+    },
+
+    data() {
+      return {
+        id: null,
+        detail: null,
+        imageUrl: this.$imageUrl,
+        loadStatus: 0,
+  			errorText: '',
+        refresherTriggered: false,
+      }
+    },
+
+    onLoad({id}) {
+      this.id = id;
+      this.getDetail();
+    },
 
+    methods: {
+      getDetail() {
+        this.$api.postJson('/orderPay/detail', {
+          orderId: this.id
+        }).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();
+      },
+    }
+  }
+  // #endif
+  // #ifndef H5
+  export default {
+    data() {
+      return {
+        pam: {},
+      }
+    },
+
+    onLoad(pam) {
+      this.pam = pam;
+    },
+  }
+  // #endif
 </script>
 
 <style lang="scss" scoped>

+ 5 - 0
src/pages/mine/myEarnings/list.vue

@@ -95,6 +95,11 @@
         this.$api.post('/order/share/list', {
           pageNum: this.pageNum,
           pageSize: 10,
+          params: [{
+            param: 'a.user_id',
+            compare: '=',
+            value: this.$store.state.user.userId
+          }]
         }).then(res => {
           this.loadStatus = 0;
           let list = res.data.records;

+ 1 - 0
src/pages/mine/parse.vue

@@ -72,6 +72,7 @@
 
 <style lang="scss" scoped>
 	.content {
+    padding: 0 30rpx 30rpx;
 		image {
 			width: 100%;
 		}

+ 10 - 5
src/styles/common.scss

@@ -82,8 +82,13 @@
       align-items: center;
       justify-content: space-between;
       .left-location {
-        font-size: 24rpx;
+        font-size: 28rpx;
         color: $sec-font;
+        display: flex;
+        align-items: center;
+        .iconfont {
+          margin-right: 4rpx;
+        }
       }
       .right-btn {
         .u-button {
@@ -96,9 +101,9 @@
         .it {
           display: flex;
           align-items: center;
-          margin-left: 16rpx;
+          margin-left: 20rpx;
           .iconfont {
-            font-size: 24rpx;
+            font-size: 30rpx;
             color: $sec-font;
             display: flex;
             align-items: center;
@@ -107,7 +112,7 @@
             }
           }
           .text {
-            font-size: 24rpx;
+            font-size: 26rpx;
             margin-left: 4rpx;
             color: $sec-font;
           }
@@ -197,7 +202,7 @@
       align-items: center;
       justify-content: space-between;
       .left-location {
-        font-size: 24rpx;
+        font-size: 28rpx;
         color: $sec-font;
         display: flex;
         align-items: center;