Browse Source

用户端 评价接口对接

liude 1 năm trước cách đây
mục cha
commit
6a1ce10087

+ 31 - 0
src/api/client/business.js

@@ -233,3 +233,34 @@ export function generateOrder(data) {
 }
 
 
+/**
+ * 商品评价接口 - 获取商品评价列表
+ * @param {*} data
+ * @returns
+ */
+export function getGoodsConcentList(goodsId) {
+  return request({
+    url: `/maintain/goods/${goodsId}/comments`,
+    method: 'get',
+    header: {
+      'Content-Type': 'application/x-www-form-urlencoded',
+    },
+  });
+}
+
+/**
+ * 商品评价接口 - 新增商品评价
+ * @param {*} data
+ * @returns
+ */
+export function goodsCommentsAdd(data) {
+  return request({
+    url: `/maintain/goods/comments/add`,
+    method: 'post',
+    data: data,
+    header: {
+      'Content-Type': 'application/json',
+    },
+  });
+}
+

+ 6 - 0
src/pages.json

@@ -133,6 +133,12 @@
             "navigationBarTitleText": "订单详情"
           }
         },
+        {
+          "path": "goodsEstimation",
+          "style": {
+            "navigationBarTitleText": "商品评价"
+          }
+        },
         {
           "path": "chatRoom/chat",
           "style": {

+ 53 - 0
src/pages/client/clientPackage/goodsEstimation.vue

@@ -0,0 +1,53 @@
+<template>
+  <view class="container">
+    <view class="top-box">
+      <view class="top-rate">
+        <u-rate count="5" v-model="value"></u-rate>
+      </view>
+    </view>
+    <button @click="handlerContextSumbit">提交</button>
+    <button @click="handlerGetGoodsCommitList">获取列表</button>
+  </view>
+</template>
+
+<script>
+  import { goodsCommentsAdd , getGoodsConcentList } from "@/api/client/business.js"
+  export default {
+    data(){
+      return{
+        queryParams:{
+          score:2,//评价打分
+          content:'测试打分111',//评价内容
+          goodsId: "1748379280745975820", // 商品id
+          orderId: "1763028797466587137", // 订单id
+          merchantId: "9", // 商家id
+        }
+      }
+    },
+    methods:{
+      // 测试提交
+      handlerContextSumbit(){
+        goodsCommentsAdd(this.queryParams).then(res=>{
+          console.log('@@@@res',res);
+        })
+      },
+      // 获取列表
+      handlerGetGoodsCommitList(){
+        getGoodsConcentList(this.queryParams.goodsId).then(res=>{
+          console.log('@@@@res',res);
+        })
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scope>
+  .container{
+    padding: 20rpx;
+    .top-box{
+      padding: 20rpx;
+      border-radius: 20rpx;
+      box-shadow: 0 5rpx 12rpx 0 rgba(0,0,0,0.2);
+    }
+  }
+</style>

+ 72 - 12
src/pages/client/clientPackage/orderDetail.vue

@@ -16,45 +16,105 @@
       <view class="top-bottom-text">订单号: {{ init_list.orderSn }}</view>
       <view class="top-bottom-text">下单时间:2024-2-25</view>
     </view>
+
+    <view class="center-box">
+      <view class="top-t">
+        <view class="t-l">
+          <view class="t-b"> </view>
+          <view class="t-name">商品详情</view>
+        </view>
+        <view class="t-r">
+
+        </view>
+      </view>
+
+      <view class="center-item" v-for="(item,index) of init_list.goodsInfo">
+        <view class="item-left">
+          <image class="img" src='@/static/QR57a.jpg'></image>
+        </view>
+        <view class="item-right">
+          <view class="right-name"> {{ item.goodsName }} </view>
+          <view class="right-name"> {{ item.goodsQuantity }} </view>
+          <view class="right-name"> ${{ item.goodsPrice }} </view>
+        </view>
+        <view class="">
+          <button @click="handlerSkipContext(item)">评价商品</button>
+        </view>
+      </view>
+    </view>
   </view>
 </template>
 
 <script>
-  export default{
-    data(){
-      return{
-        init_list:null
+  export default {
+    data() {
+      return {
+        init_list: null
       }
     },
-    onLoad(e){
+    onLoad(e) {
       this.init_list = e.orderList
+    },
+    methods:{
+      handlerSkipContext(item){
+        uni.navigateTo({
+          url:"/pages/client/clientPackage/goodsEstimation"
+        })
+        console.log('@@@@item',item);
+      }
     }
   }
 </script>
 
 <style lang="scss" scoped>
-  .container{
+  .container {
     padding: 20rpx;
-    .top-box{
+
+    .top-box,
+    .center-box {
       padding: 20rpx;
       background-color: #fff;
       border-radius: 20rpx;
-      box-shadow: 5rpx 5rpx 5rpx 5rpx rgba(0,0,0,0.2);
-      .top-t{
+      box-shadow: 5rpx 5rpx 5rpx 5rpx rgba(0, 0, 0, 0.2);
+
+      .top-t {
         display: flex;
         justify-content: space-between;
-        .t-l{
+
+        .t-l {
           display: flex;
-          .t-b{
+
+          .t-b {
             width: 12rpx;
             border-radius: 10rpx;
             background-color: #C3711C;
           }
-          .t-name{
+
+          .t-name {
             margin-left: 10rpx;
           }
         }
       }
     }
+
+    .center-box {
+      margin-top: 20rpx;
+      .center-item{
+        display: flex;
+        margin-bottom: 20rpx;
+        .item-left{
+          .img{
+            width: 200rpx;
+            height: 200rpx;
+          }
+        }
+        .item-right{
+          display: flex;
+          flex-direction: column;
+          justify-content: space-around;
+          margin-left: 20rpx;
+        }
+      }
+    }
   }
 </style>

+ 8 - 2
src/pages/client/clientPackage/serviceDetail/index.vue

@@ -109,7 +109,7 @@
 </template>
 
 <script>
-  import { getGoodsDetailApi, addFavorite ,addShoppingCart , addGoodsFavorite , cancelFavorite } from '@/api/client/business.js';
+  import { getGoodsDetailApi, addFavorite ,addShoppingCart , addGoodsFavorite , cancelFavorite , getGoodsConcentList } from '@/api/client/business.js';
   import GainCoupon from './GainCoupon.vue';
   import EvaluateContent from './EvaluateContent.vue';
   export default {
@@ -164,6 +164,7 @@
       this.shoopId = option.shopId
       this.id = option.id;
       this.handlerInitList(option.id);
+      this.handlerGetGoodsConcentList()
     },
     methods: {
       openPopup() {
@@ -179,7 +180,12 @@
           this.comments = res.data.comments;
         });
       },
-
+      // 获取商品评价列表
+      handlerGetGoodsConcentList(){
+        getGoodsConcentList(this.id).then(res=>{
+          console.log('@@@@res',res)
+        })
+      },
       // 点击分享
       handlerShare() {
         uni.share({

+ 178 - 0
src/pages/merchant/tabBar/order/components/orderItem copy.vue

@@ -0,0 +1,178 @@
+<template>
+  <view class="">
+    <view class="order__info" v-for="index in list" :key="index">
+      <view class="order__info--phone">
+        <view>
+          <view style="font-size: 35rpx; margin-bottom: 20rpx">
+            182***4342
+            <text class="tipInfo" style="margin-left: 10rpx">(预留手机)</text>
+          </view>
+          <view class="tipInfo">近90天第16次下单</view>
+        </view>
+        <u-icon name="phone" color="#2979ff" size="28" @click="handlerMakePhone"></u-icon>
+      </view>
+
+      <view class="order__info--pay">
+        <text>顾客待付款</text>
+        <view class="service">
+          <image
+            slot="icon"
+            src="@/static/QR57a.jpg"
+            style="width: 200rpx; height: 200rpx"
+          />
+          <view class="description">
+            <view class="description--title">汽车维修与保养</view>
+            <view class="tipInfo">专业维修保界</view>
+            <view class="description--text">服务描述……</view>
+          </view>
+        </view>
+      </view>
+
+      <view class="order__info--compute">
+        <view class="computeFlex">
+          <view>发票信息</view>
+          <view class="tipInfo">不需要</view>
+        </view>
+        <view class="computeFlex">
+          <view>技术服务费</view>
+          <view class="tipInfo">¥15</view>
+        </view>
+        <view class="computeFlex">
+          <view>本单预计收入</view>
+          <view class="tipInfo" style="color: #DF5F5F;">¥723.7</view>
+        </view>
+      </view>
+
+      <view class="order__info--tip">
+        <view class="tip-l">
+          <view class="tipInfo"> 订单编号:12232964103521日</view>
+          <view class="tipInfo"> 交易快照:发生争议时,可作为判断依据</view>
+          <view class="tipInfo"> 下单时间:12-0318:03</view>
+        </view>
+        <view class="tip-r">
+          <view class="r-btn" v-if="typeStyle == 1" @click="handlerCloseOrder">
+            关闭交易
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+  export default{
+    data(){
+      return{
+
+      }
+    },
+    props:{
+      "typeStyle":{
+        type:Number,
+        default:0
+      },
+      list: {
+        type:Array,
+        default: []
+      }
+    },
+    watch: {
+      typeStyle(newValue,oldValue){
+        console.log('newValue',newValue);
+      }
+    },
+    methods:{
+      // 点击拨打电话
+      handlerMakePhone(){
+        uni.makePhoneCall({
+        	phoneNumber: '114' //仅为示例
+        });
+      },
+      // 删除订单
+      handlerCloseOrder(){
+        uni.showToast({
+        	title: '么的',
+          icon:'none'
+        });
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+.order {
+  &__info {
+    margin: 20rpx 0;
+    background-color: $uni-bg-color;
+    padding: $uni-bg-padding-sm;
+    &--phone {
+      display: flex;
+      justify-content: space-between;
+      padding-bottom: 20rpx;
+      border-bottom: 2rpx solid #ececec;
+    }
+
+    &--pay {
+      margin: 20rpx 0;
+      > text {
+        font-size: 36rpx;
+        color: #333;
+      }
+
+      .service {
+        display: flex;
+        margin-top: 20rpx;
+        .description {
+          margin-left: 20rpx;
+          &--title {
+            font-size: 34rpx;
+            font-weight: 700;
+            margin-bottom: 10rpx;
+          }
+
+          &--text {
+            font-size: 30rpx;
+            color: #333;
+          }
+        }
+      }
+    }
+
+    &--compute {
+      margin-top: 40rpx;
+      padding-bottom: 20rpx;
+      border-bottom: 2rpx solid #ececec;
+      .computeFlex {
+        margin-bottom: 20rpx;
+        display: flex;
+        justify-content: space-between;
+      }
+    }
+
+    &--tip {
+      margin-top: 30rpx;
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      .tip-l{
+
+      }
+      .tip-r{
+        .r-btn{
+          padding: 10rpx 20rpx;
+          border-radius: 20rpx;
+          border: 2rpx solid #FF9480;
+          color: #FF9480;
+          font-size:26rpx;
+          background-color: #fff;
+        }
+      }
+    }
+  }
+}
+
+.tipInfo {
+  font-size: 24rpx;
+  color: #666;
+}
+</style>

+ 84 - 69
src/pages/merchant/tabBar/order/components/orderItem.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="">
-    <view class="order__info" v-for="index in list" :key="index">
+    <view class="order__info" v-for="item in list" :key="item.id">
       <view class="order__info--phone">
         <view>
           <view style="font-size: 35rpx; margin-bottom: 20rpx">
@@ -13,19 +13,19 @@
       </view>
 
       <view class="order__info--pay">
-        <text>顾客待付款</text>
+        <text class="text-22">顾客待付款</text>
         <view class="service">
-          <image
-            slot="icon"
-            src="@/static/QR57a.jpg"
-            style="width: 200rpx; height: 200rpx"
-          />
-          <view class="description">
-            <view class="description--title">汽车维修与保养</view>
-            <view class="tipInfo">专业维修保界</view>
-            <view class="description--text">服务描述……</view>
+          <view class="orderInfo" v-for="ele in item.goodsInfo" :key="ele.id">
+            <image slot="icon" :src="ele.goodsPic" style="width: 150rpx; height: 150rpx" />
+            <view>{{ ele.goodsName }}</view>
           </view>
         </view>
+
+        <view class="description">
+          <view class="description--title">汽车维修与保养</view>
+          <view class="tipInfo">专业维修保界</view>
+          <view class="description--text">服务描述……</view>
+        </view>
       </view>
 
       <view class="order__info--compute">
@@ -39,7 +39,7 @@
         </view>
         <view class="computeFlex">
           <view>本单预计收入</view>
-          <view class="tipInfo" style="color: #DF5F5F;">¥723.7</view>
+          <view class="tipInfo" style="color: #df5f5f">¥723.7</view>
         </view>
       </view>
 
@@ -50,9 +50,7 @@
           <view class="tipInfo"> 下单时间:12-0318:03</view>
         </view>
         <view class="tip-r">
-          <view class="r-btn" v-if="typeStyle == 1" @click="handlerCloseOrder">
-            关闭交易
-          </view>
+          <view class="r-btn" v-if="typeStyle == 1" @click="handlerCloseOrder"> 关闭交易 </view>
         </view>
       </view>
     </view>
@@ -60,43 +58,41 @@
 </template>
 
 <script>
-  export default{
-    data(){
-      return{
-
-      }
+export default {
+  data() {
+    return {};
+  },
+  props: {
+    typeStyle: {
+      type: Number,
+      default: 0,
     },
-    props:{
-      "typeStyle":{
-        type:Number,
-        default:0
-      },
-      list: {
-        type:Array,
-        default: []
-      }
+    list: {
+      type: Array,
+      default: [],
     },
-    watch: {
-      typeStyle(newValue,oldValue){
-        console.log('newValue',newValue);
-      }
+  },
+  watch: {
+    typeStyle(newValue, oldValue) {
+      console.log('newValue', newValue);
     },
-    methods:{
-      // 点击拨打电话
-      handlerMakePhone(){
-        uni.makePhoneCall({
-        	phoneNumber: '114' //仅为示例
-        });
-      },
-      // 删除订单
-      handlerCloseOrder(){
-        uni.showToast({
-        	title: '么的',
-          icon:'none'
-        });
-      }
-    }
-  }
+  },
+  methods: {
+    // 点击拨打电话
+    handlerMakePhone() {
+      uni.makePhoneCall({
+        phoneNumber: '114', //仅为示例
+      });
+    },
+    // 删除订单
+    handlerCloseOrder() {
+      uni.showToast({
+        title: '么的',
+        icon: 'none',
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
@@ -114,6 +110,8 @@
 
     &--pay {
       margin: 20rpx 0;
+      position: relative;
+
       > text {
         font-size: 36rpx;
         color: #333;
@@ -121,19 +119,38 @@
 
       .service {
         display: flex;
-        margin-top: 20rpx;
-        .description {
-          margin-left: 20rpx;
-          &--title {
-            font-size: 34rpx;
-            font-weight: 700;
-            margin-bottom: 10rpx;
-          }
-
-          &--text {
-            font-size: 30rpx;
-            color: #333;
-          }
+        width: 100%;
+        overflow-x: auto; 
+        white-space: nowrap; 
+
+        .orderInfo {
+          height: 200rpx;
+          widows: 150rpx;
+          padding: 10rpx;
+          text-align: center;
+          white-space: nowrap; 
+          overflow: hidden;
+          text-overflow: ellipsis; 
+          font-size: 26rpx;
+        }
+      }
+
+      .description {
+        height: 200rpx;
+        position: absolute;
+        right: 0;
+        top: 0;
+        padding: 40rpx 20rpx 30rpx 20rpx;
+        background-color: rgba($color: #fff, $alpha: 0.9);
+        &--title {
+          font-size: 34rpx;
+          font-weight: 700;
+          margin-bottom: 10rpx;
+        }
+
+        &--text {
+          font-size: 30rpx;
+          color: #333;
         }
       }
     }
@@ -154,16 +171,14 @@
       display: flex;
       justify-content: space-between;
       align-items: center;
-      .tip-l{
 
-      }
-      .tip-r{
-        .r-btn{
+      .tip-r {
+        .r-btn {
           padding: 10rpx 20rpx;
           border-radius: 20rpx;
-          border: 2rpx solid #FF9480;
-          color: #FF9480;
-          font-size:26rpx;
+          border: 2rpx solid #ff9480;
+          color: #ff9480;
+          font-size: 26rpx;
           background-color: #fff;
         }
       }