storeBelieveInLight 1 год назад
Родитель
Сommit
d3c7c39435

+ 60 - 1
commit/product.js

@@ -83,7 +83,7 @@ export function postchangeshow(data) {
83 83
 
84 84
 
85 85
 
86
-/**商品列表    */
86
+/**商品模块    */
87 87
 
88 88
 // 商品列表tab
89 89
 
@@ -96,6 +96,20 @@ export function getGoodsTab(data) {
96 96
     })
97 97
 }
98 98
 
99
+
100
+/**商品列表  
101
+ * 
102
+ * page = 1 & limit = 20 & mer_cate_id = & cate_id = & keyword = & type = 1 & is_gift_bag = & p_type =
103
+  */
104
+
105
+export function getProductList(data) {
106
+    return myRequestPhp({
107
+        url: `${pre}mer/store/product/lst`,
108
+        method: 'GET',
109
+        data,
110
+        apiType
111
+    })
112
+}
99 113
 // 平台商品分类
100 114
 export function getGoodsClassCategory(data) {
101 115
     return myRequestPhp({
@@ -106,3 +120,48 @@ export function getGoodsClassCategory(data) {
106 120
     })
107 121
 }
108 122
 
123
+
124
+
125
+
126
+
127
+
128
+// 商品评价
129
+
130
+/**
131
+ * is_reply:
132
+     nickname:
133
+     keyword:
134
+     order_sn:
135
+     status:
136
+     date:
137
+     page: 1
138
+ limit: 20
139
+ *  */
140
+export function getGoodsEvaluate(data) {
141
+    return myRequestPhp({
142
+        url: `${pre}mer/store/reply/lst`,
143
+        method: 'GET',
144
+        data,
145
+        apiType
146
+    })
147
+}
148
+
149
+
150
+// 商品评价回复获取规则
151
+export function reviewGoodsEvaluateReply(id) {
152
+    return myRequestPhp({
153
+        url: `${pre}mer/store/reply/form/${id}`,
154
+        method: 'GET',
155
+        apiType
156
+    })
157
+}
158
+
159
+//商品评价回复
160
+export function reviewGoodsReplyApi(id,data) {
161
+    return myRequestPhp({
162
+        url: `${pre}mer/store/reply/reply/${id}.html`,
163
+        method: 'POST',
164
+        data,
165
+        apiType
166
+    })
167
+}

+ 1 - 1
commit/requestPhp.js

@@ -3,7 +3,7 @@
3 3
 import {getPhpToken} from "../utils/readAppInfo"
4 4
 let baseURL = 'http://testshop.hxxfb.com/'
5 5
 // 请求超出时间
6
-const timeout = 5000
6
+const timeout = 50000
7 7
 
8 8
 // 需要修改token,和根据实际修改请求头
9 9
 export function myRequestPhp(options) {

+ 25 - 0
commit/user.js

@@ -0,0 +1,25 @@
1
+
2
+import {
3
+    myRequestPhp
4
+} from './requestPhp.js'
5
+
6
+
7
+
8
+
9
+
10
+
11
+const pre = ""
12
+const apiType = "php"
13
+
14
+/**
15
+ * 
16
+ * @returns 获取用户信息
17
+ */
18
+export function getBaseInfo() {
19
+  return myRequestPhp({
20
+         url: `${pre}mer/info`,
21
+          method: 'GET',
22
+              data,
23
+              apiType
24
+     })
25
+}

+ 1 - 0
pages/supplychainon/price-edit-modal.vue

@@ -47,6 +47,7 @@
47 47
 </template>
48 48
 
49 49
 <script>
50
+import {getBaseInfo} from "@/commit/user.js"
50 51
 export default {
51 52
   props: {
52 53
     minPrice: { type: Number, default: 8.75 },

+ 70 - 44
shop/productManagementModule/components/productEvaluation/ProductEvaluationItem.vue

@@ -2,49 +2,60 @@
2 2
   <view class="comment-card">
3 3
     <!-- 差评标签和评分 -->
4 4
     <view class="top-info">
5
-      <text class="bad-comment">差评</text>
6
-      <text class="score">商品评分{{ score }}★</text>
5
+      <!-- <text class="bad-comment">差评</text> -->
6
+      <view class="score">产品评分 {{ item.product_score }} ★</view>
7
+      <view class="score">服务评分 {{ item.service_score }} ★</view>
8
+      <view class="score">物流评分 {{ item.postage_score }} ★</view>
7 9
     </view>
8 10
     <!-- 遍历展示每条差评内容 -->
9
-    <view
10
-      class="comment-content"
11
-      v-for="(subComment, index) in commentList"
12
-      :key="index"
13
-    >
14
-      <text>{{ subComment }}</text>
11
+    <view class="comment-content">
12
+      <text>{{ item.comment || "" }}</text>
15 13
     </view>
16 14
     <!-- 图片展示,这里假设图片数组为imgList -->
17
-    <view class="img-list">
15
+    <view class="img-list" v-if="item.pics.length > 0">
18 16
       <image
19
-        v-for="(img, index) in imgList"
17
+        v-for="(img, index) in item.pics"
20 18
         :key="index"
21 19
         :src="img"
22
-        mode="aspectFill"
20
+        mode="scaleToFill"
23 21
       ></image>
24 22
     </view>
25 23
     <!-- 遍历展示产品信息数组 -->
26 24
     <view class="product-info-content">
27
-      <view
28
-        class="product-info-list"
29
-        v-for="(product, index) in productList"
30
-        :key="index"
31
-      >
32
-        <image class="product-img" :src="product.img" mode="aspectFill"></image>
25
+      <view class="product-info-list">
26
+        <image
27
+          class="product-img"
28
+          :src="item.image"
29
+          mode="aspectFill"
30
+          @error="handleError"
31
+          v-if="item.image && !isError"
32
+        ></image>
33
+        <image
34
+          class="product-img"
35
+          v-else
36
+          src="/static/images/new_ui/kongtu.png"
37
+          mode="scaleToFill"
38
+        />
33 39
         <view class="product-detail">
34
-          <text>{{ product.detail }}</text>
40
+          <text>{{ item.store_name }}</text>
35 41
         </view>
36 42
       </view>
37 43
     </view>
44
+    <view class="comment-content" v-if="item.merchant_reply_content">
45
+      <text style="padding-right: 10rpx">回复内容:</text>
46
+      <text>{{ item.merchant_reply_content || "" }}</text>
47
+    </view>
38 48
     <!-- 操作按钮 -->
39 49
     <view class="action-buttons">
40 50
       <!-- <button class="order-btn">查看订单</button> -->
41
-      <button class="reply-btn" @click="replyHandler">回复评论</button>
51
+      <button class="reply-btn" @click="replyHandler(false)">回复评论</button>
42 52
     </view>
43
-    <ReplyModal ref="ReplyRefs"></ReplyModal>
53
+    <ReplyModal ref="ReplyRefs" @close="close" @submit="submit"></ReplyModal>
44 54
   </view>
45 55
 </template>
46 56
 <script>
47 57
 import ReplyModal from "./ReplyModal.vue";
58
+import { reviewGoodsEvaluateReply } from "@/commit/product.js";
48 59
 export default {
49 60
   components: { ReplyModal },
50 61
   props: {
@@ -59,32 +70,45 @@ export default {
59 70
   },
60 71
   data() {
61 72
     return {
62
-      score: 1, // 假设差评情况下的评分,可根据实际逻辑调整
63
-      commentList: ["包装破损", "物流速度极慢", "与描述不符"], // 差评信息数组,可从后端获取
64
-      imgList: [
65
-        "/static/images/new_ui/delivery_man_dialog.png",
66
-        "/static/images/new_ui/delivery_man_dialog.png",
67
-      ], // 图片地址数组,需替换为实际地址
68
-      productList: [
69
-        {
70
-          img: "/static/images/new_ui/qcode.png",
71
-          detail:
72
-            "【直播现装】DIY配件多种夜光款DIY配件多种夜光款DIY配件多种夜光款DIY配件多种夜光款DIY配件多种夜光款",
73
-        },
74
-        {
75
-          img: "/static/logo.png",
76
-          detail:
77
-            "小瓶子混装DIY 女孩玩具夜光大白DIY配件多种夜光款DIY配件多种夜光款DIY配件多种夜光款DIY配件多种夜光款",
78
-        },
79
-      ], // 产品信息数组,包含图片和详细信息
73
+      isError: false,
80 74
     };
81 75
   },
82 76
   methods: {
83
-    replyHandler() {
84
-        this.$emit('handleReply',{
85
-
86
-        })
87
-        this.$refs.ReplyRefs.open();
77
+    handleError(e) {
78
+      this.isError = true;
79
+    },
80
+    close() {
81
+      this.$refs.ReplyRefs.close();
82
+      this.$emit("handleReply", {
83
+        isClose: true,
84
+        type: "close",
85
+      });
86
+    },
87
+    submit() {
88
+       this.$refs.ReplyRefs.close();
89
+      this.$emit("handleReply", {
90
+        isClose: true,
91
+        type: "submit",
92
+      });
93
+    },
94
+    async replyHandler() {
95
+      this.$emit("handleReply", {
96
+        isClose: false,
97
+        type: "open",
98
+      });
99
+      uni.showLoading({
100
+        title: "正在打开中...",
101
+        mask: true,
102
+      });
103
+      try {
104
+        const res = await reviewGoodsEvaluateReply(this.item.reply_id);
105
+        if (res.data.status == 200) {
106
+          this.$refs.ReplyRefs.open(this.item, res.data.data);
107
+        }
108
+      } catch (error) {
109
+      } finally {
110
+        uni.hideLoading();
111
+      }
88 112
     },
89 113
   },
90 114
 };
@@ -102,7 +126,8 @@ export default {
102 126
 
103 127
 .top-info {
104 128
   display: flex;
105
-  align-items: center;
129
+  flex-direction: column;
130
+  gap: 20rpx;
106 131
   margin-bottom: 10rpx;
107 132
 }
108 133
 
@@ -121,6 +146,7 @@ export default {
121 146
   margin-bottom: 10rpx;
122 147
   font-size: 28rpx;
123 148
   word-break: break-all;
149
+  padding: 15rpx 0;
124 150
 }
125 151
 
126 152
 .img-list {

+ 96 - 49
shop/productManagementModule/components/productEvaluation/ReplyModal.vue

@@ -1,66 +1,115 @@
1 1
 <!-- components/ReplyModal.vue -->
2 2
 <template>
3
-  <uni-popup ref="popup" :animation="true" :is-mask-click="false">
4
-   <view class="content">
5
-     <view class="popup_data__headers">
6
-      <view class="popup_data__headers--title">回复评论</view>
7
-      <uni-icons
8
-        type="closeempty"
9
-        class="custom_icons"
10
-        size="30"
11
-      
12
-
13
-        @click="handleClose"
14
-      ></uni-icons>
15
-    </view>
16
-    <view class="reply-modal">
17
-      <textarea v-model="replyContent" placeholder="输入回复内容"   :maxlength="-1" :focus="true" cursor-color="#007aff"/>
18
-      <button @click="submit">提交</button>
3
+  <uni-popup
4
+    ref="popup"
5
+    :animation="true"
6
+    adjust-position="false"
7
+    :is-mask-click="false"
8
+  >
9
+    <view class="content">
10
+      <view class="popup_data__headers">
11
+        <view class="popup_data__headers--title">回复评论</view>
12
+        <uni-icons
13
+          type="closeempty"
14
+          class="custom_icons"
15
+          size="30"
16
+          @click="handleClose"
17
+        ></uni-icons>
18
+      </view>
19
+      <view class="reply-modal">
20
+        <textarea
21
+          adjust-position="false"
22
+          v-model="replyContent"
23
+          placeholder="输入回复内容"
24
+          :maxlength="-1"
25
+          :focus="true"
26
+          cursor-color="#007aff"
27
+        />
28
+        <button @click="submit">提交</button>
29
+      </view>
19 30
     </view>
20
-   </view>
21 31
   </uni-popup>
22 32
 </template>
23 33
 
24 34
 <script>
35
+import { reviewGoodsReplyApi } from "@/commit/product.js";
25 36
 export default {
26 37
   data() {
27 38
     return {
28 39
       replyContent: "",
40
+      keyboardHeight: "",
41
+      popupStyle: "",
42
+      isPopupShow: false,
43
+      paramsData: {},
44
+      resData: {},
29 45
     };
30 46
   },
47
+  mounted() {
48
+    // 监听键盘高度变化
49
+    uni.onKeyboardHeightChange((res) => {
50
+      this.keyboardHeight = res.height;
51
+      // 动态调整弹窗底部内边距
52
+      this.popupStyle = `padding-bottom: ${res.height}px`;
53
+    });
54
+  },
31 55
   methods: {
32 56
     handleClose() {
33
-      this. close()
57
+      this.$emit("close");
58
+      this.close();
34 59
     },
35
-    open() {
36
-       uni.stopPullDownRefresh();
60
+    open(data, item) {
61
+      this.paramsData = data;
62
+      this.resData = item;
37 63
       this.$refs.popup.open();
38 64
     },
39 65
     close() {
40 66
       this.replyContent = "";
41 67
       this.$refs.popup.close();
42 68
     },
43
-    submit() {
44
-      if(!this.replyContent) {
69
+    //TODO: 提交回复
70
+
71
+    async submit() {
72
+      console.log(this.paramsData, "this.paramsData");
73
+      console.log(this.resData, "this.resData");
74
+      if (!this.replyContent) {
45 75
         uni.showToast({
46
-          title: '请输入回复内容',
47
-          icon: 'none'
48
-        })
49
-        return
76
+          title: "请输入回复内容",
77
+          icon: "none",
78
+        });
79
+        return;
80
+      }
81
+      uni.showLoading({
82
+        title: "回复中...",
83
+        mask: true,
84
+      });
85
+      try {
86
+        const res = await reviewGoodsReplyApi(this.paramsData.reply_id, {
87
+          content: this.replyContent,
88
+        });
89
+        if (res.data.status == 200) {
90
+          uni.showToast({
91
+            title: "回复成功",
92
+            icon: "none",
93
+          });
94
+          this.$emit("submit");
95
+        }
96
+      } catch (error) {
97
+      } finally {
98
+        uni.hideLoading();
99
+        uni.hideToast();
50 100
       }
51 101
       // this.$emit('submit', {
52 102
       //   content: this.replyContent,
53 103
       //   index: this.index,
54 104
       //   item: this.item
55 105
       // })
56
-      // this.$refs.popup.close();
57 106
     },
58 107
   },
59 108
 };
60 109
 </script>
61 110
 
62 111
 <style lang="scss" scoped>
63
-.content{
112
+.content {
64 113
   // width: 680rpx;
65 114
   width: 600rpx;
66 115
   background: #fff;
@@ -68,8 +117,6 @@ export default {
68 117
   padding: 30rpx 40rpx 40rpx;
69 118
 }
70 119
 .reply-modal {
71
-
72
-
73 120
   textarea {
74 121
     width: calc(100% - 48rpx);
75 122
     min-height: 240rpx;
@@ -99,25 +146,25 @@ export default {
99 146
   justify-content: center;
100 147
 }
101 148
 .popup_data__headers {
102
-    // height: 40rpx;
103
-    display: flex;
149
+  // height: 40rpx;
150
+  display: flex;
151
+  justify-content: space-between;
152
+  align-items: center;
153
+  // border-bottom: 2rpx solid #e5e5e5;
154
+  padding-bottom: 20rpx;
155
+  &--title {
156
+    flex: 1;
157
+    display: -webkit-box;
158
+    -webkit-box-orient: vertical;
159
+    -webkit-line-clamp: 1;
160
+    overflow: hidden;
104 161
     justify-content: space-between;
105
-    align-items: center;
106
-    // border-bottom: 2rpx solid #e5e5e5;
107
-    padding-bottom: 20rpx;
108
-    &--title {
109
-      flex: 1;
110
-      display: -webkit-box;
111
-      -webkit-box-orient: vertical;
112
-      -webkit-line-clamp: 1;
113
-      overflow: hidden;
114
-      justify-content: space-between;
115
-      padding-right: 60rpx;
116
-      font-size: 32rpx;
117
-      font-weight: 600;
118
-    }
119
-    .custom_icons {
120
-      flex-shrink: 0;
121
-    }
162
+    padding-right: 60rpx;
163
+    font-size: 32rpx;
164
+    font-weight: 600;
165
+  }
166
+  .custom_icons {
167
+    flex-shrink: 0;
122 168
   }
169
+}
123 170
 </style>

+ 129 - 50
shop/productManagementModule/productManagement.vue

@@ -13,20 +13,24 @@
13 13
         </view>
14 14
       </view>
15 15
       <view class="product-manger-content--tab">
16
-        <tabsVue :category="dataList" :currentActive="currentActive"/>
16
+        <tabsVue :category="dataList" :currentActive="currentActive" @tabs="tabsHandleClick"/>
17 17
       </view>
18 18
     </view>
19 19
     <view class="product-manger-content--list">
20
-      <view class="list-card" v-for="(item, index) in dataList" :key="index">
20
+       <template v-if="list.length > 0">
21
+      <view class="list-card" v-for="(item, index) in list" :key="index">
21 22
         <view class="list-card-top">
22 23
           <view class="list-card-top--left">
23
-             <image
24
-                src="/static/images/new_ui/tianjiachanpin.png"
25
-                mode="scaleToFill"
26
-              />
24
+            <image
25
+              src="/static/images/new_ui/tianjiachanpin.png"
26
+              mode="scaleToFill"
27
+              @error="imgError"
28
+            />
27 29
           </view>
28 30
           <view class="list-card-top--right">
29
-            <view class="list-card-top--right-title">此处显示商品名称最多一行,显示不下此处显示商品名称最多一行,显示不下</view>
31
+            <view class="list-card-top--right-title"
32
+              >此处显示商品名称最多一行,显示不下此处显示商品名称最多一行,显示不下</view
33
+            >
30 34
             <view class="list-card-top--right-description">
31 35
               <view class="list-card-top--right-description--left">
32 36
                 <text class="title">销量</text>
@@ -53,78 +57,63 @@
53 57
             <view class="list-card-bottom-btn-list--item">下架</view>
54 58
             <view class="list-card-bottom-btn-list--item">删除草稿</view>
55 59
           </view>
56
-
57
-          </view>
58
-
59 60
         </view>
60
-              <view
61
+      </view>
62
+       </template>
63
+       <template v-else>
64
+        <emptyDataVue style="top:0"/>
65
+      </template>
66
+      <view
61 67
         class=""
62
-        v-if="tihsi == 0"
68
+        v-if="tihsi == 0 && list.length > 0"
63 69
         style="margin: 60rpx 0 30rpx 0; color: #999999; font-size: 26rpx"
64 70
       >
65 71
         —— 已经到最底部了哦 ——
66 72
       </view>
67
-      </view>
68 73
     </view>
74
+  </view>
69 75
 </template>
70 76
 
71 77
 <script>
72 78
 import headersVue from "../components/headers/headers.vue";
73 79
 import searchVue from "./components/search/search.vue";
74 80
 import tabsVue from "./components/tablist.vue";
81
+import emptyDataVue from "../components/emptyData/emptyData.vue";
82
+import { getProductList, getGoodsTab } from "@/commit/product.js";
75 83
 //商品列表
76 84
 export default {
77 85
   components: {
78 86
     headersVue,
79 87
     searchVue,
80 88
     tabsVue,
89
+    emptyDataVue
81 90
   },
82
-  	onPullDownRefresh() {
83
-			uni.showLoading({
84
-				title: '加载中',
85
-			});
86
-			this.page = 1
87
-			this.is_panudn = true
88
-			this.list = []
89
-			// this.orderList();
90
-		},
91
-		onReachBottom() {
92
-      console.log('onReachBottom')
93
-			// if (this.is_panudn == true) {
94
-			// 	this.page++;
95
-			// 	this.orderList();
96
-			// } else {
97
-			// 	return
98
-			// }
99
-		},
100
-  methods: {
101
-    	
102
-    headerJump() {
103
-      uni.switchTab({ url: "/shop/productManagementModule/index" });
104
-    },
105
-    onHandleAddProduct() {
106
-      uni.redirectTo({
107
-        url: `./addProduct`,
108
-      });
109
-    },
110
-  },
111
-  onLoad(options) {
112
-    this.currentActive = options.tabIndex || "0";
113
-  },
91
+
114 92
   data() {
115 93
     return {
116
-      currentActive:'0',
117
-      tihsi: 0,
94
+      currentActive: "0",
95
+      list: [],
96
+      tihsi: "",
97
+      is_panudn: true,
98
+      page: 1,
99
+      limit: 10,
100
+      mer_cate_id: "",
101
+      cate_id: "",
102
+      keyword: "",
103
+      type: 1,
104
+      is_gift_bag: "",
105
+      p_type: "",
106
+      isError:false,
118 107
       dataList: [
119 108
         {
120 109
           type: 1,
121 110
           name: "出售中商品",
122
-          count: 10,
111
+          count: 0,
123 112
         },
124 113
         {
125 114
           type: 2,
126 115
           name: "仓库中商品",
127
-          count: 31,
116
+          count: 0,
128 117
         },
129 118
         {
130 119
           type: 3,
@@ -154,6 +143,97 @@ export default {
154 143
       ],
155 144
     };
156 145
   },
146
+  async onLoad(options) {
147
+    this.currentActive = options.tabIndex || "0";
148
+    this.type = options.type || 1;
149
+
150
+    await this.getGoodsTabData();
151
+    await this.getProductListData();
152
+  },
153
+  async onPullDownRefresh() {
154
+    uni.showLoading({
155
+      title: "加载中",
156
+    });
157
+    this.page = 1;
158
+    this.is_panudn = true;
159
+    this.list = [];
160
+    await this.getProductListData();
161
+  },
162
+  onReachBottom() {
163
+    console.log("onReachBottom");
164
+    if (this.is_panudn == true) {
165
+      this.page++;
166
+      this.getProductListData();
167
+    } else {
168
+      return;
169
+    }
170
+  },
171
+  methods: {
172
+    imgError(){
173
+      this.isError = true
174
+    },
175
+    headerJump() {
176
+      uni.switchTab({ url: "/shop/productManagementModule/index" });
177
+    },
178
+    onHandleAddProduct() {
179
+      uni.redirectTo({
180
+        url: `./addProduct`,
181
+      });
182
+    },
183
+    async getGoodsTabData() {
184
+      try {
185
+        const res = await getGoodsTab();
186
+        if (res.data.status == 200) {
187
+          this.dataList = res.data.data;
188
+        }
189
+      } catch (error) {
190
+      } finally {
191
+      }
192
+    },
193
+    async getProductListData() {
194
+      const params = {
195
+        page: this.page,
196
+        limit: this.limit,
197
+        mer_cate_id: this.mer_cate_id,
198
+        cate_id: this.cate_id,
199
+        keyword: this.keyword,
200
+        type: this.type,
201
+        is_gift_bag: this.is_gift_bag,
202
+        p_type: this.p_type,
203
+      };
204
+
205
+      try {
206
+        uni.showLoading({
207
+          title: "加载中",
208
+        });
209
+        const res = await getProductList(params);
210
+        if (res.data.status == 200) {
211
+          this.tihsi = res.data.data.list.length;
212
+          if (res.data.data.count > 0) {
213
+            if (this.page == 1) {
214
+              this.list = res.data.data.list;
215
+            } else {
216
+              this.list = this.list.concat(res.data.data.list);
217
+            }
218
+          } else {
219
+            if (this.page == 1) {
220
+              this.list = [];
221
+            }
222
+            this.is_panudn = false;
223
+          }
224
+        }
225
+      } catch (error) {
226
+      } finally {
227
+        uni.hideLoading();
228
+      }
229
+    },
230
+      async tabsHandleClick(obj) {
231
+      this.currentActive = obj.index;
232
+      this.type = obj.item?.type || 1;
233
+
234
+      await this.getProductListData();
235
+    },
236
+  },
157 237
 };
158 238
 </script>
159 239
 <style>
@@ -164,7 +244,6 @@ page {
164 244
 <style lang="scss" scoped>
165 245
 .product-manger-wrapper {
166 246
   // margin-top: 96rpx;
167
- 
168 247
 
169 248
   .product-manger-content {
170 249
     background: #fff;

+ 97 - 22
shop/productManagementModule/productevaluation.vue

@@ -12,7 +12,8 @@
12 12
     </view>
13 13
 
14 14
     <view class="product-pingjia-content--list">
15
-      <ProductEvaluationItem
15
+    <template v-if="listReplyData.length > 0">
16
+        <ProductEvaluationItem
16 17
         @handleReply="ReplyHandler"
17 18
         v-for="(item, index) in listReplyData"
18 19
         :index="index"
@@ -20,15 +21,18 @@
20 21
         :key="index + '_index_'"
21 22
         class="mb-26"
22 23
       />
24
+    </template>
25
+      <template v-else>
26
+        <emptyDataVue style="top: initial"/>
27
+      </template>
23 28
       <view
24 29
         class=""
25
-        v-if="tihsi == 0"
30
+        v-if="tihsi == 0 && listReplyData.length > 0"
26 31
         style="margin: 60rpx 0 30rpx 0; color: #999999; font-size: 26rpx"
27 32
       >
28 33
         —— 已经到最底部了哦 ——
29 34
       </view>
30 35
     </view>
31
-   
32 36
   </view>
33 37
 </template>
34 38
 
@@ -36,43 +40,113 @@
36 40
 //评价
37 41
 import headersVue from "../components/headers/headers.vue";
38 42
 import searchVue from "./components/search/search.vue";
39
-
43
+import emptyDataVue from "../../shop/components/emptyData/emptyData.vue";
40 44
 import ProductEvaluationItem from "./components/productEvaluation/ProductEvaluationItem.vue";
45
+
46
+import { getGoodsEvaluate } from "@/commit/product.js";
41 47
 export default {
42 48
   components: {
43 49
     headersVue,
44 50
     searchVue,
45 51
     ProductEvaluationItem,
52
+    emptyDataVue
46 53
   },
47 54
   data() {
48 55
     return {
49 56
       tihsi: "",
50
-      listReplyData: [{}, {}, {}, {}],
51
-      isFullResh:true
57
+      listReplyData: [],
58
+      isPopupShow:false,
59
+      keyword: "",
60
+      page: 1,
61
+      limit: 10,
62
+      is_panudn: true,
52 63
     };
53 64
   },
65
+  async onLoad(options) {
66
+    await this.getGoodsEvaluateData();
67
+  },
54 68
   onPullDownRefresh() {
55
- console.log(this.isFullResh,"this.isFullResh")
56
-   
69
+    if(this.isPopupShow) return ;
70
+    uni.showLoading({
71
+      title: "加载中",
72
+    });
73
+    this.page = 1;
74
+    this.is_panudn = true;
75
+    this.listReplyData = [];
76
+    this.getGoodsEvaluateData();
57 77
   },
58 78
   onReachBottom() {
59
-    console.log("onReachBottom");
60
-    // if (this.is_panudn == true) {
61
-    // 	this.page++;
62
-    // 	this.orderList();
63
-    // } else {
64
-    // 	return
65
-    // }
79
+    if (this.is_panudn == true) {
80
+      this.page++;
81
+      this.getGoodsEvaluateData();
82
+    } else {
83
+      return;
84
+    }
66 85
   },
67 86
   methods: {
68
-    search(val) {},
69
-
87
+        // 打开弹窗时
88
+disableRefresh() {
89
+  uni.startPullDownRefresh(); // 强制启动刷新
90
+  uni.stopPullDownRefresh();  // 立即停止(制造禁用效果)
91
+  this.isPopupShow = true;
92
+},
93
+// 关闭弹窗时恢复
94
+enableRefresh() {
95
+  this.isPopupShow = false;
96
+  uni.startPullDownRefresh({ success: () => {} }); // 重启原生支持
97
+},
98
+    async search(val) {
99
+      this.keyword = val;
100
+      await this.getGoodsEvaluateData();
101
+    },
102
+    async getGoodsEvaluateData() {
103
+      uni.showLoading({
104
+        title: "加载中",
105
+      });
106
+      try {
107
+        const res = await getGoodsEvaluate({
108
+          page: this.page,
109
+          limit: this.limit,
110
+          keyword: this.keyword,
111
+          is_reply: "",
112
+          nickname: "",
113
+          order_sn: "",
114
+          status: "",
115
+          date: "",
116
+        });
117
+        uni.stopPullDownRefresh();
118
+        if (res.data.status === 200) {
119
+          this.tihsi = res.data.data.list.length || 0;
120
+          console.log(this.tihsi, "this.tihsi");
121
+          if (res.data.data.count > 0) {
122
+            if (this.page == 1) {
123
+              this.listReplyData = res.data.data.list;
124
+            } else {
125
+              this.listReplyData = this.listReplyData.concat(
126
+                res.data.data.list
127
+              );
128
+            }
129
+          } else {
130
+            if (this.page == 1) {
131
+              this.listReplyData = [];
132
+            }
133
+            this.is_panudn = false;
134
+          }
135
+          uni.hideLoading();
136
+        }
137
+      } catch (error) {
138
+      } finally {
139
+        uni.hideLoading();
140
+      }
141
+    },
70 142
     ReplyHandler(item) {
71
-        console.log(item);
72
-     uni.stopPullDownRefresh()
143
+      if(item.type=='submit'){
144
+        this.getGoodsEvaluateData();
145
+      
146
+      }
73 147
     },
74
-    headerJump(){
75
-        uni.switchTab({ url: './index' })
148
+    headerJump() {
149
+      uni.switchTab({ url: "./index" });
76 150
     },
77 151
   },
78 152
 };
@@ -122,7 +196,8 @@ page {
122 196
     width: calc(100% - 52rpx);
123 197
     // border: 2rpx solid #f00;
124 198
     margin: 225rpx 26rpx 26rpx;
125
-    overflow: auto;
199
+    // height: calc(100% - 256rpx);
200
+    // overflow: auto;
126 201
   }
127 202
 }
128 203
 .mb-26 {

BIN
static/images/new_ui/wutu.png.crdownload