Prechádzať zdrojové kódy

fix(merchant):解决代码冲突

liude 1 rok pred
rodič
commit
6aeda24a2c

+ 182 - 173
src/components/communityPop/index.vue

@@ -10,7 +10,7 @@
     </u-sticky>
 
     <view class="center-box">
-      <view class="center-item" v-for="(item,index) of init_list">
+      <view class="center-item" v-for="(item, index) of init_list" :key="index">
         <view class="item-top">
           <view class="top-left">
             <view class="top-img">
@@ -22,7 +22,11 @@
             </view>
           </view>
           <view class="top-right">
-            <u-icon :name="item.clickStatus == 0 ? 'heart' : 'heart-fill'" size='22' @click='handlerFocus(item)'></u-icon>
+            <u-icon
+              :name="item.clickStatus == 0 ? 'heart' : 'heart-fill'"
+              size="22"
+              @click="handlerFocus(item)"
+            ></u-icon>
           </view>
         </view>
 
@@ -35,8 +39,13 @@
     <view class="bottom-box">
       <view class="bottom-item">
         <view class="item-left">
-          <u--input placeholder="写回复" border="surround" v-model="content" shape='circle'
-            customStyle="background-color:#F2F2F2"></u--input>
+          <u--input
+            placeholder="写回复"
+            border="surround"
+            v-model="content"
+            shape="circle"
+            customStyle="background-color:#F2F2F2"
+          ></u--input>
         </view>
         <view class="item-right">
           <button @click="handlerPopPublishBtn" class="btn">发布</button>
@@ -47,208 +56,208 @@
 </template>
 
 <script>
-  import { addClientComment, clientCommentList } from "@/api/client/message.js"
-  import { addEvaulateRecords } from '@/api/client/community.js';
-  import empty from "@/components/empty/index.vue"
-  export default {
-    components:{empty},
-    data() {
-      return {
-        content: '',
-        init_list: [],
-        total:0
+import { addClientComment, clientCommentList } from '@/api/client/message.js';
+import { addEvaulateRecords } from '@/api/client/community.js';
+import empty from '@/components/empty/index.vue';
+export default {
+  components: { empty },
+  data() {
+    return {
+      content: '',
+      init_list: [],
+      total: 0,
+    };
+  },
+  props: ['dynamicId', 'dynamicUserId'],
+  watch: {
+    dynamicId(newValue) {
+      if (newValue != null) {
+        this.handlerInitList();
       }
     },
-    props: ['dynamicId', 'dynamicUserId'],
-    watch: {
-      dynamicId(newValue) {
-        if(newValue != null){
-          this.handlerInitList()
-        }
-      }
+  },
+  methods: {
+    // 初始化评论列表
+    handlerInitList() {
+      let params = {
+        dynamicId: this.dynamicId,
+        parentId: 0,
+        userId: this.dynamicUserId,
+      };
+      clientCommentList(params).then(res => {
+        this.init_list = res.data.records;
+        this.total = res.data.total;
+      });
     },
-    methods: {
-      // 初始化评论列表
-      handlerInitList() {
-        let params = {
-          dynamicId: this.dynamicId,
-          parentId: 0,
-          userId: this.dynamicUserId,
-        }
-        clientCommentList(params).then(res => {
-          this.init_list = res.data.records
-          this.total = res.data.total
-        })
-      },
-      // 发布评论
-      handlerPopPublishBtn() {
-        let params = {
-          dynamicId: this.dynamicId,
-          parentId: 0,
-          content: this.content,
-          status: 0
+    // 发布评论
+    handlerPopPublishBtn() {
+      let params = {
+        dynamicId: this.dynamicId,
+        parentId: 0,
+        content: this.content,
+        status: 0,
+      };
+      addClientComment(params).then(res => {
+        if (res.code == 200) {
+          uni.showToast({
+            title: '发布成功',
+            icon: 'none',
+          });
+          this.content = '';
+          this.handlerInitList();
+          this.$emit('uploadComment');
         }
-        addClientComment(params).then(res => {
-          if (res.code == 200) {
-            uni.showToast({
-              title: '发布成功',
-              icon: 'none'
-            })
-            this.content = ''
-            this.handlerInitList()
-            this.$emit('uploadComment')
-          }
-        })
-      },
-      // 关注按钮
-      handlerFocus(item){
-        let params = {
-          dynamicStatusType: 'GOOD', // 操作类型:1-点赞;2-踩 允许值: GOOD, BAD
-          recordType: 'COMMENT', // 内容类型:1-动态;2-评论/回复 允许值: DYNAMIC, COMMENT, USER
-          actionType: item.clickStatus == 0 ? 'ADD' : 'CANCEL', // 点击类型:1-点赞/踩;2-取消赞/取消踩   允许值: ADD, CANCEL
-          contentId: item.id,
-          targetUserId: item.userId
+      });
+    },
+    // 关注按钮
+    handlerFocus(item) {
+      let params = {
+        dynamicStatusType: 'GOOD', // 操作类型:1-点赞;2-踩 允许值: GOOD, BAD
+        recordType: 'COMMENT', // 内容类型:1-动态;2-评论/回复 允许值: DYNAMIC, COMMENT, USER
+        actionType: item.clickStatus == 0 ? 'ADD' : 'CANCEL', // 点击类型:1-点赞/踩;2-取消赞/取消踩   允许值: ADD, CANCEL
+        contentId: item.id,
+        targetUserId: item.userId,
+      };
+      addEvaulateRecords(params).then(res => {
+        if (res.code == 200) {
+          uni.showToast({
+            title: '关注成功',
+            icon: 'none',
+          });
+          this.handlerInitList();
+        } else {
+          uni.showToast({
+            title: res.msg,
+            icon: 'none',
+          });
+          return;
         }
-        addEvaulateRecords(params).then(res => {
-          if (res.code == 200) {
-            uni.showToast({
-              title: '关注成功',
-              icon: 'none'
-            })
-            this.handlerInitList()
-          } else {
-            uni.showToast({
-              title: res.msg,
-              icon: 'none'
-            })
-            return
-          }
-        })
-      }
-    }
-  }
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-  .container {
-    height: 70vh;
-    overflow-y: auto;
-    box-sizing: border-box;
-    padding-bottom: 120rpx;
-
-    .pop-top {
-      background-color: #fff;
-      border-radius: 40rpx;
-      padding: 20rpx 0;
-    }
+.container {
+  height: 70vh;
+  overflow-y: auto;
+  box-sizing: border-box;
+  padding-bottom: 120rpx;
 
-    .top-box {
-      display: flex;
-      justify-content: center;
+  .pop-top {
+    background-color: #fff;
+    border-radius: 40rpx;
+    padding: 20rpx 0;
+  }
 
-      .top-black-box {
-        width: 10%;
-        height: 10rpx;
-        background-color: #000;
-        border-radius: 10%;
-      }
-    }
+  .top-box {
+    display: flex;
+    justify-content: center;
 
-    .top-title {
-      font-size: 32rpx;
-      font-weight: bold;
-      color: #000;
-      text-align: center;
-      margin-top: 20rpx;
-      letter-spacing: 2rpx;
+    .top-black-box {
+      width: 10%;
+      height: 10rpx;
+      background-color: #000;
+      border-radius: 10%;
     }
+  }
+
+  .top-title {
+    font-size: 32rpx;
+    font-weight: bold;
+    color: #000;
+    text-align: center;
+    margin-top: 20rpx;
+    letter-spacing: 2rpx;
+  }
 
-    .center-box {
-      margin-bottom: 20rpx;
-      padding: 0 20rpx;
+  .center-box {
+    margin-bottom: 20rpx;
+    padding: 0 20rpx;
 
-      .center-item {
-        margin-bottom: 40rpx;
-        border-radius: 20rpx;
+    .center-item {
+      margin-bottom: 40rpx;
+      border-radius: 20rpx;
 
-        .item-top {
+      .item-top {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+
+        .top-left {
           display: flex;
-          justify-content: space-between;
           align-items: center;
 
-          .top-left {
+          .top-img {
+            .img {
+              width: 80rpx;
+              height: 80rpx;
+              border-radius: 50%;
+            }
+          }
+
+          .top-text {
             display: flex;
-            align-items: center;
-
-            .top-img {
-              .img {
-                width: 80rpx;
-                height: 80rpx;
-                border-radius: 50%;
-              }
+            flex-direction: column;
+            justify-content: space-around;
+            margin-left: 10rpx;
+
+            .text-title {
+              font-weight: bold;
+              font-size: 32rpx;
+              color: #000;
             }
 
-            .top-text {
-              display: flex;
-              flex-direction: column;
-              justify-content: space-around;
-              margin-left: 10rpx;
-
-              .text-title {
-                font-weight: bold;
-                font-size: 32rpx;
-                color: #000;
-              }
-
-              .text-address {
-                color: #8f8f8f;
-                font-size: 24rpx;
-              }
+            .text-address {
+              color: #8f8f8f;
+              font-size: 24rpx;
             }
           }
         }
+      }
 
-        .item-text {
-          margin-top: 20rpx;
-          padding: 0 40rpx;
-        }
+      .item-text {
+        margin-top: 20rpx;
+        padding: 0 40rpx;
       }
     }
+  }
 
-    .bottom-box {
-      position: absolute;
-      bottom: 0;
-      background-color: #fff;
-      width: 100%;
-      height: 150rpx;
+  .bottom-box {
+    position: absolute;
+    bottom: 0;
+    background-color: #fff;
+    width: 100%;
+    height: 150rpx;
 
-      .bottom-item {
-        display: flex;
-        justify-content: space-around;
-        padding: 10rpx 20rpx 0;
-        box-sizing: border-box;
-        align-items: center;
+    .bottom-item {
+      display: flex;
+      justify-content: space-around;
+      padding: 10rpx 20rpx 0;
+      box-sizing: border-box;
+      align-items: center;
 
-        .item-left {
-          width: 60%;
-          height: 70rpx;
-        }
+      .item-left {
+        width: 60%;
+        height: 70rpx;
+      }
 
-        .item-right {
-          width: 30%;
-          padding: 20rpx;
-
-          .btn {
-            border-radius: 20rpx;
-            text-align: center;
-            color: #fff;
-            background: linear-gradient(to right, #e8cbc0, #636fa4);
-            height: 70rpx;
-            font-size: 28rpx;
-            line-height: 70rpx;
-          }
+      .item-right {
+        width: 30%;
+        padding: 20rpx;
+
+        .btn {
+          border-radius: 20rpx;
+          text-align: center;
+          color: #fff;
+          background: linear-gradient(to right, #e8cbc0, #636fa4);
+          height: 70rpx;
+          font-size: 28rpx;
+          line-height: 70rpx;
         }
       }
     }
   }
+}
 </style>

+ 205 - 196
src/pages/client/clientPackage/communityPublish.vue

@@ -1,9 +1,20 @@
 <template>
   <view class="container">
     <view class="top-box">
-      <u--textarea border='none' v-model="textContent" count placeholder="写下自己的感受分享给更多人"></u--textarea>
+      <u--textarea
+        border="none"
+        v-model="textContent"
+        count
+        placeholder="写下自己的感受分享给更多人"
+      ></u--textarea>
       <view class="upload-box">
-        <image class="upd-img" v-for="item of fileList" :src="item" mode="aspectFill"></image>
+        <image
+          class="upd-img"
+          :key="index"
+          v-for="(item, index) of fileList"
+          :src="item"
+          mode="aspectFill"
+        ></image>
         <view class="upload-item" @click="handlerUploadImg" v-if="fileList.length < 9">
           <image class="img" src="@/static/QR57a.jpg" mode=""></image>
         </view>
@@ -11,7 +22,7 @@
     </view>
     <view class="item-box" @click="handlerGetLocation">
       <view class="item-left">
-        <u-icon name="map" size='22'></u-icon>
+        <u-icon name="map" size="22"></u-icon>
         <span class="fs-bold">你在哪里</span>
         <span class="left-text">(越详细越容易被推荐噢)</span>
       </view>
@@ -26,224 +37,222 @@
 </template>
 
 <script>
-  import {
-    addClientContent
-  } from '@/api/client/community.js';
-  export default {
-    data() {
-      return {
-        textContent: '',
-        fileList: [],
-        userId: null,
-        uploadCount: 0
-      }
-    },
-    mounted() {
-      this.userId = this.$store.state.user.userMessage.id
+import { addClientContent } from '@/api/client/community.js';
+export default {
+  data() {
+    return {
+      textContent: '',
+      fileList: [],
+      userId: null,
+      uploadCount: 0,
+    };
+  },
+  mounted() {
+    this.userId = this.$store.state.user.userMessage.id;
+  },
+  methods: {
+    // 获取当前定位
+    handlerGetLocation() {
+      wx.getLocation({
+        type: 'gcj02',
+        success(res) {
+          console.log('@@@@res', res);
+        },
+        fail(error) {
+          console.log('error', error);
+        },
+      });
     },
-    methods: {
-      // 获取当前定位
-      handlerGetLocation() {
-        wx.getLocation({
-          type: 'gcj02',
-          success(res) {
-            console.log("@@@@res", res);
-          },
-          fail(error) {
-            console.log("error", error);
-          }
-        })
-      },
-      // 点击发布按钮
-      handlerPublishBtn() {
-        let params = {
-          textContent: this.textContent,
-          status: 0, // 状态:0-正常;1-屏蔽
-          type: 'PURE_TEXT', // 动态类型:1-纯文字;2-图片;3-视频 允许值: PURE_TEXT, PHOTO, VIDEO
-          location: '山东潍坊', // 定位
-          userId: this.userId,
+    // 点击发布按钮
+    handlerPublishBtn() {
+      let params = {
+        textContent: this.textContent,
+        status: 0, // 状态:0-正常;1-屏蔽
+        type: 'PURE_TEXT', // 动态类型:1-纯文字;2-图片;3-视频 允许值: PURE_TEXT, PHOTO, VIDEO
+        location: '山东潍坊', // 定位
+        userId: this.userId,
+      };
+      if (this.fileList.length != 0) {
+        params.type = 'PHOTO';
+        params.list = [];
+        this.fileList.map((rs, idx) => {
+          params.list.push({
+            resourceKey: rs,
+            sort: idx,
+          });
+        });
+      }
+      addClientContent(params).then(res => {
+        if (res.code == 200) {
+          uni.showToast({
+            title: '发布成功',
+            icon: 'none',
+          });
+          this.textContent = '';
+          setTimeout(() => {
+            uni.navigateBack(-1);
+          }, 1500);
+        } else {
+          uni.showToast({
+            title: res.msg,
+            icon: 'none',
+          });
+          return;
         }
-        if (this.fileList.length != 0) {
-          params.type = 'PHOTO'
-          params.list = []
-          this.fileList.map((rs, idx) => {
-            params.list.push({
-              resourceKey: rs,
-              sort: idx
-            })
-          })
+      });
+    },
+    // 上传头像
+    async handlerUploadImg() {
+      try {
+        const res = await uni.showActionSheet({
+          itemList: ['拍照', '从相册选择'],
+        });
+
+        if (res.tapIndex === 0) {
+          // 用户选择拍照
+          this.takePhoto();
+        } else if (res.tapIndex === 1) {
+          // 用户选择从相册选择
+          this.chooseImage();
         }
-        addClientContent(params).then(res => {
-          if (res.code == 200) {
-            uni.showToast({
-              title: '发布成功',
-              icon: 'none'
-            })
-            this.textContent = ''
-            setTimeout(() => {
-              uni.navigateBack(-1)
-            }, 1500)
-          } else {
-            uni.showToast({
-              title: res.msg,
-              icon: 'none'
-            })
-            return
-          }
-        })
-      },
-      // 上传头像
-      async handlerUploadImg() {
-        try {
-          const res = await uni.showActionSheet({
-            itemList: ['拍照', '从相册选择'],
+      } catch (error) {
+        console.error(error);
+      }
+    },
+    // 拍照
+    takePhoto() {
+      uni.chooseImage({
+        sourceType: ['camera'],
+        count: 9 - this.uploadCount,
+        success: res => {
+          const tempFilePaths = res.tempFilePaths;
+          // 调用上传图片的方法
+          tempFilePaths.map(rs => {
+            this.uploadAvatar(rs);
           });
-
-          if (res.tapIndex === 0) {
-            // 用户选择拍照
-            this.takePhoto();
-          } else if (res.tapIndex === 1) {
-            // 用户选择从相册选择
-            this.chooseImage();
-          }
-        } catch (error) {
+        },
+        fail: error => {
           console.error(error);
-        }
-      },
-      // 拍照
-      takePhoto() {
-        uni.chooseImage({
-          sourceType: ['camera'],
-          count: 9 - this.uploadCount,
-          success: res => {
-            const tempFilePaths = res.tempFilePaths;
-            // 调用上传图片的方法
-            tempFilePaths.map(rs => {
-              this.uploadAvatar(rs);
-            })
-          },
-          fail: error => {
-            console.error(error);
-          },
-        });
-      },
-      //从相册中选择
-      chooseImage() {
-        uni.chooseImage({
-          sourceType: ['album'],
-          count: 9 - this.uploadCount,
-          success: res => {
-            const tempFilePaths = res.tempFilePaths;
-            tempFilePaths.map(rs => {
-              this.uploadAvatar(rs);
-            })
-            // 调用上传图片的方法
-          },
-          fail: error => {
-            console.error(error);
-          },
-        });
-      },
-      // 上传头像
-      uploadAvatar(filePath) {
-        // 在这里实现上传头像的逻辑,将filePath作为参数传入
-        this.fileList.push(filePath)
-        this.uploadCount = this.fileList.length
-        console.log('@@@filePath', this.fileList);
-        // this.queryParams.avatar = filePath;
-        this.$forceUpdate(); // 手动触发组件的重新渲染
-      },
-    }
-  }
+        },
+      });
+    },
+    //从相册中选择
+    chooseImage() {
+      uni.chooseImage({
+        sourceType: ['album'],
+        count: 9 - this.uploadCount,
+        success: res => {
+          const tempFilePaths = res.tempFilePaths;
+          tempFilePaths.map(rs => {
+            this.uploadAvatar(rs);
+          });
+          // 调用上传图片的方法
+        },
+        fail: error => {
+          console.error(error);
+        },
+      });
+    },
+    // 上传头像
+    uploadAvatar(filePath) {
+      // 在这里实现上传头像的逻辑,将filePath作为参数传入
+      this.fileList.push(filePath);
+      this.uploadCount = this.fileList.length;
+      console.log('@@@filePath', this.fileList);
+      // this.queryParams.avatar = filePath;
+      this.$forceUpdate(); // 手动触发组件的重新渲染
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-  .container {
-    position: relative;
-    background-color: #F5F7F9;
-    height: 100vh;
+.container {
+  position: relative;
+  background-color: #f5f7f9;
+  height: 100vh;
 
-    .top-box,
-    .item-box {
-      padding: 20rpx;
-      background-color: #fff;
-      border-radius: 20rpx;
+  .top-box,
+  .item-box {
+    padding: 20rpx;
+    background-color: #fff;
+    border-radius: 20rpx;
 
-      .upload-box {
-        margin-top: 20rpx;
-        display: flex;
-        flex-wrap: wrap;
+    .upload-box {
+      margin-top: 20rpx;
+      display: flex;
+      flex-wrap: wrap;
 
-        .upd-img {
-          width: 140rpx;
-          height: 140rpx;
-          border-radius: 20rpx;
-          margin: 10rpx;
-        }
+      .upd-img {
+        width: 140rpx;
+        height: 140rpx;
+        border-radius: 20rpx;
+        margin: 10rpx;
+      }
 
-        .upload-item {
-          width: 140rpx;
-          height: 140rpx;
-          border: 2rpx solid #000;
-          border-radius: 20rpx;
-          display: flex;
-          flex-direction: column;
-          justify-content: center;
-          margin: 10rpx;
+      .upload-item {
+        width: 140rpx;
+        height: 140rpx;
+        border: 2rpx solid #000;
+        border-radius: 20rpx;
+        display: flex;
+        flex-direction: column;
+        justify-content: center;
+        margin: 10rpx;
 
-          .img {
-            width: 80rpx;
-            height: 80rpx;
-            margin: 0 auto;
-          }
+        .img {
+          width: 80rpx;
+          height: 80rpx;
+          margin: 0 auto;
         }
       }
     }
+  }
+
+  .item-box {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-top: 20rpx;
 
-    .item-box {
+    .item-left {
       display: flex;
-      justify-content: space-between;
       align-items: center;
-      margin-top: 20rpx;
-
-      .item-left {
-        display: flex;
-        align-items: center;
-      }
     }
+  }
 
-    .btn-box {
-      position: absolute;
-      bottom: 0;
-      background-color: #fff;
-      height: 100rpx;
-      padding: 20rpx;
-      width: 95%;
-      display: flex;
-      justify-content: center;
-
-      .btn {
-        width: 80%;
-        border-radius: 20rpx;
-        font-size: 28rpx;
-        color: #000;
-        background-color: #FECF4C;
-        height: 80rpx;
-        line-height: 80rpx;
-      }
-    }
+  .btn-box {
+    position: absolute;
+    bottom: 0;
+    background-color: #fff;
+    height: 100rpx;
+    padding: 20rpx;
+    width: 95%;
+    display: flex;
+    justify-content: center;
 
-    .fs-bold {
-      font-weight: bold;
+    .btn {
+      width: 80%;
+      border-radius: 20rpx;
       font-size: 28rpx;
       color: #000;
-      margin-left: 10rpx;
+      background-color: #fecf4c;
+      height: 80rpx;
+      line-height: 80rpx;
     }
+  }
 
-    .left-text {
-      color: #a6a7a8;
-      font-size: 28rpx;
-      margin-left: 10rpx;
-    }
+  .fs-bold {
+    font-weight: bold;
+    font-size: 28rpx;
+    color: #000;
+    margin-left: 10rpx;
+  }
+
+  .left-text {
+    color: #a6a7a8;
+    font-size: 28rpx;
+    margin-left: 10rpx;
   }
+}
 </style>

+ 221 - 221
src/pages/client/clientPackage/orderAll.vue

@@ -7,11 +7,11 @@
     <!-- 订单 -->
     <view class="order">
       <view class="order-box">
-        <view class="order-item" v-for="(item,index) of init_list" :key="index" >
+        <view class="order-item" v-for="(item, index) of init_list" :key="index">
           <view class="" @click="handlerSkipDetail(item)">
             <view class="item-top">
               <view class="top-left gray-color">订单编号 : {{ item.orderSn }}</view>
-              <view class="top-right ">待付款</view>
+              <view class="top-right">待付款</view>
             </view>
             <view class="item-top">
               <view class="top-left gray-color">支付时间 : 2024-01-12</view>
@@ -19,9 +19,9 @@
             </view>
           </view>
 
-          <u-line margin='20rpx 0'></u-line>
+          <u-line margin="20rpx 0"></u-line>
 
-          <view class="item-center" v-for="(itm,idx) of item.goodsInfo">
+          <view class="item-center" :key="idx" v-for="(itm, idx) of item.goodsInfo">
             <view class="center-left">
               <image :src="itm.goodsPic" class="img"></image>
             </view>
@@ -35,7 +35,7 @@
                 </view>
               </view>
               <view class="r-r">
-                <view class="r-item" @click.stop="handlerSkipComment(item,itm)">
+                <view class="r-item" @click.stop="handlerSkipComment(item, itm)">
                   <u-icon name="chat" color="#000" size="28"></u-icon>
                   <span>评价</span>
                 </view>
@@ -43,20 +43,21 @@
             </view>
           </view>
 
-          <u-line margin='20rpx 0' dashed='true'></u-line>
+          <u-line margin="20rpx 0" dashed="true"></u-line>
 
           <view class="item-allnumb-box">
             <view class="allnumb-left"> {{ item.allNumb }}件商品 </view>
-            <view class="allnumb-right"> <span class="r-text">共计</span>¥{{ item.allPrice }}</view>
+            <view class="allnumb-right">
+              <span class="r-text">共计</span>¥{{ item.allPrice }}</view
+            >
           </view>
 
           <view class="item-bottom">
-            <button class='btn'>取消订单</button>
+            <button class="btn">取消订单</button>
           </view>
-
         </view>
       </view>
-      <view v-if='init_list.length == 0' style="margin-top: 40rpx">
+      <view v-if="init_list.length == 0" style="margin-top: 40rpx">
         <u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" />
       </view>
     </view>
@@ -64,251 +65,250 @@
 </template>
 
 <script>
-  import {
-    userOrdersApi,
-    getUserOrderList,
-    cancelOrder
-  } from '@/api/client/order';
-  export default {
-    data() {
-      return {
-        current: 0,
-        type: 0,
-        type_name: '',
-        size: 20,
-        // 订单状态:0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单
-        list: [{
-            name: '待付款',
-            type: 0,
-          },
-          {
-            name: '待发货',
-            type: 1,
-          },
-          {
-            name: '已发货',
-            type: 2,
-          },
-          {
-            name: '已完成',
-            type: 3,
-          },
-          {
-            name: '已关闭',
-            type: 4,
-          },
-          {
-            name: '无效订单',
-            type: 5,
-          },
-        ],
-        init_list: [],
-      };
-    },
-    mounted() {
-      // this.userOrdersPage();
+import { userOrdersApi, getUserOrderList, cancelOrder } from '@/api/client/order';
+export default {
+  data() {
+    return {
+      current: 0,
+      type: 0,
+      type_name: '',
+      size: 20,
+      // 订单状态:0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单
+      list: [
+        {
+          name: '待付款',
+          type: 0,
+        },
+        {
+          name: '待发货',
+          type: 1,
+        },
+        {
+          name: '已发货',
+          type: 2,
+        },
+        {
+          name: '已完成',
+          type: 3,
+        },
+        {
+          name: '已关闭',
+          type: 4,
+        },
+        {
+          name: '无效订单',
+          type: 5,
+        },
+      ],
+      init_list: [],
+    };
+  },
+  mounted() {
+    // this.userOrdersPage();
+  },
+  onShow() {
+    let cur = this.$store.state.order.skip_order_type.type;
+    switch (cur) {
+      case 0:
+        this.current = 0;
+        this.userOrdersPage(cur);
+        break;
+      case 1:
+        this.current = 2;
+        this.userOrdersPage(cur);
+        break;
+      case 2:
+        this.current = 3;
+        this.userOrdersPage(cur);
+        break;
+    }
+  },
+  computed: {
+    allNumber() {
+      this.init_list.map(rs => {
+        let sum = 0;
+        let price = 0;
+        rs.goodsInfo.map(rc => {
+          sum += rc.goodsQuantity;
+          price += rc.goodsPrice;
+        });
+        rs.allNumb = sum;
+        rs.allPrice = price;
+      });
+      return;
     },
-    onShow(){
-      let cur = this.$store.state.order.skip_order_type.type
-      switch(cur){
-        case 0 :
-          this.current = 0
-          this.userOrdersPage(cur);
-          break;
-        case 1 :
-          this.current = 2
-          this.userOrdersPage(cur);
-          break;
-        case 2 :
-          this.current = 3
-          this.userOrdersPage(cur);
-          break;
-      }
+  },
+  methods: {
+    handlerChangeItem(data) {
+      this.current = data.index;
+      this.type = data.type;
+      this.type_name = data.name;
+      this.userOrdersPage(this.type);
     },
-    computed:{
-      allNumber(){
-        this.init_list.map(rs=>{
-          let sum = 0
-          let price = 0
-          rs.goodsInfo.map(rc=>{
-            sum += rc.goodsQuantity
-            price += rc.goodsPrice
-          })
-          rs.allNumb = sum
-          rs.allPrice = price
-        })
-        return
+
+    async userOrdersPage(type) {
+      let orderStatus = type == undefined ? 0 : `${type}`;
+      let res = await getUserOrderList({
+        status: orderStatus,
+        paging: '1,20',
+      });
+      if ((res.code = 200 && res.data)) {
+        this.init_list = res.data.records;
       }
     },
-    methods: {
-      handlerChangeItem(data) {
-        this.current = data.index;
-        this.type = data.type;
-        this.type_name = data.name;
-        this.userOrdersPage(this.type);
-      },
 
-      async userOrdersPage(type) {
-        let orderStatus = type == undefined ? 0 : `${type}`;
-        let res = await getUserOrderList({
-          status: orderStatus,
-          paging: '1,20',
-        });
-        if ((res.code = 200 && res.data)) {
-          this.init_list = res.data.records;
-        }
-      },
-
-      // 跳转到订单详情
-      handlerSkipDetail(e) {
-        console.log('@@@@e', e);
-        uni.navigateTo({
-          url: `/pages/client/clientPackage/orderDetail?orderList=${JSON.stringify(e)}`
-        })
-      },
-      // 取消订单
-      handlerCancelOrder(e) {
-        cancelOrder(e.id).then(res => {
+    // 跳转到订单详情
+    handlerSkipDetail(e) {
+      console.log('@@@@e', e);
+      uni.navigateTo({
+        url: `/pages/client/clientPackage/orderDetail?orderList=${JSON.stringify(e)}`,
+      });
+    },
+    // 取消订单
+    handlerCancelOrder(e) {
+      cancelOrder(e.id).then(res => {
+        console.log('###res', res);
+        if (res.code == 200) {
+          uni.showToast({
+            title: '取消成功',
+            icon: 'none',
+          });
+          this.userOrdersPage(this.type);
+        } else {
           console.log('###res', res);
-          if (res.code == 200) {
-            uni.showToast({
-              title: '取消成功',
-              icon: 'none'
-            })
-            this.userOrdersPage(this.type)
-          } else {
-            console.log('###res', res);
-          }
-        })
-      },
-      // 点击跳转到商品评价
-      handlerSkipComment(item,itm){
-        uni.navigateTo({
-          url:`/pages/client/clientPackage/goodsEstimation?orderList=${JSON.stringify(item)}&goodsList=${JSON.stringify(itm)}`
-        })
-      }
+        }
+      });
+    },
+    // 点击跳转到商品评价
+    handlerSkipComment(item, itm) {
+      uni.navigateTo({
+        url: `/pages/client/clientPackage/goodsEstimation?orderList=${JSON.stringify(
+          item,
+        )}&goodsList=${JSON.stringify(itm)}`,
+      });
     },
-  };
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-  .order {
-    margin-top: 10px;
-    padding: 10rpx 20rpx 20rpx;
-    box-sizing: border-box;
+.order {
+  margin-top: 10px;
+  padding: 10rpx 20rpx 20rpx;
+  box-sizing: border-box;
 
-    .order-box {
-      .order-item {
-        margin-bottom: 20rpx;
-        background-color: #fff;
-        border-radius: 20rpx;
-        padding: 20rpx;
-        box-shadow: 0 8rpx 15rpx 0 rgba(0, 0, 0, 0.08);
+  .order-box {
+    .order-item {
+      margin-bottom: 20rpx;
+      background-color: #fff;
+      border-radius: 20rpx;
+      padding: 20rpx;
+      box-shadow: 0 8rpx 15rpx 0 rgba(0, 0, 0, 0.08);
 
-        .item-top {
-          display: flex;
-          justify-content: space-between;
-          margin-bottom: 10rpx;
-        }
+      .item-top {
+        display: flex;
+        justify-content: space-between;
+        margin-bottom: 10rpx;
+      }
 
-        .item-center {
-          display: flex;
-          align-items: center;
-          margin-bottom: 10rpx;
-          .center-left {
-            height: 160rpx;
+      .item-center {
+        display: flex;
+        align-items: center;
+        margin-bottom: 10rpx;
+        .center-left {
+          height: 160rpx;
 
-            .img {
-              width: 160rpx;
-              height: 160rpx;
-            }
+          .img {
+            width: 160rpx;
+            height: 160rpx;
           }
+        }
 
-          .center-right {
-            width: 100%;
-            height: 160rpx;
+        .center-right {
+          width: 100%;
+          height: 160rpx;
+          display: flex;
+          justify-content: space-between;
+          margin-left: 20rpx;
+          .r-l {
             display: flex;
-            justify-content: space-between;
-            margin-left: 20rpx;
-            .r-l{
+            flex-direction: column;
+            justify-content: space-around;
+            .right-name {
+              color: #4d5671;
+              font-size: 32rpx;
+              font-weight: bold;
+            }
+            .right-descript {
+              font-size: 28rpx;
+              color: #858797;
+            }
+            .l-box {
               display: flex;
-              flex-direction: column;
-              justify-content: space-around;
-              .right-name {
-                color: #4D5671;
-                font-size: 32rpx;
+              font-size: 24rpx;
+              align-items: center;
+              font-style: italic;
+              .right-price {
+                margin-right: 20rpx;
                 font-weight: bold;
+                font-size: 28rpx;
+                color: #f57f32;
               }
-              .right-descript{
-                font-size:28rpx;
-                color: #858797;
-              }
-              .l-box{
-                display: flex;
+              .right-numb {
                 font-size: 24rpx;
-                align-items: center;
-                font-style: italic;
-                .right-price{
-                  margin-right: 20rpx;
-                  font-weight: bold;
-                  font-size: 28rpx;
-                  color: #F57F32;
-                }
-                .right-numb{
-                  font-size: 24rpx;
-                  color: #858797;
-                }
+                color: #858797;
               }
             }
-            .r-r{
-              .r-item{
-                align-items: center;
-              }
+          }
+          .r-r {
+            .r-item {
+              align-items: center;
             }
           }
         }
+      }
 
-        .item-allnumb-box{
-          display: flex;
-          justify-content: space-between;
-          align-items: center;
-          font-weight: bold;
-          .allnumb-left{
-            font-size: 32rpx;
-          }
-          .allnumb-right{
-            font-size: 26rpx;
-            color: #F57F32;
-            .r-text{
-              color: #000;
-            }
+      .item-allnumb-box {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        font-weight: bold;
+        .allnumb-left {
+          font-size: 32rpx;
+        }
+        .allnumb-right {
+          font-size: 26rpx;
+          color: #f57f32;
+          .r-text {
+            color: #000;
           }
         }
+      }
 
-        .item-bottom{
-          display: flex;
-          width: 100%;
-          margin-top: 20rpx;
-          .btn{
-            width: 80%;
-            height: 70rpx;
-            background-color: rgba(248,213,53, 0.8);
-            color: #4e5059;
-            font-size:28rpx;
-            text-align: center;
-            line-height: 70rpx;
-            border-radius: 20rpx;
-          }
+      .item-bottom {
+        display: flex;
+        width: 100%;
+        margin-top: 20rpx;
+        .btn {
+          width: 80%;
+          height: 70rpx;
+          background-color: rgba(248, 213, 53, 0.8);
+          color: #4e5059;
+          font-size: 28rpx;
+          text-align: center;
+          line-height: 70rpx;
+          border-radius: 20rpx;
         }
       }
     }
   }
+}
 
-  .gray-color{
-    color: #858797;
-  }
+.gray-color {
+  color: #858797;
+}
 
-  ::deep .u-tabs__wrapper__nav__item__text {
-    font-size: 30px;
-  }
+::deep .u-tabs__wrapper__nav__item__text {
+  font-size: 30px;
+}
 </style>

+ 103 - 108
src/pages/client/clientPackage/orderDetail.vue

@@ -1,6 +1,5 @@
 <template>
   <view class="container">
-
     <view class="center-box">
       <view class="top-t">
         <view class="t-l">
@@ -9,9 +8,9 @@
         </view>
       </view>
 
-      <u-line margin='20rpx 0'></u-line>
+      <u-line margin="20rpx 0"></u-line>
 
-      <view class="item-center" v-for="(item,index) of init_list.goodsInfo">
+      <view class="item-center" :key="index" v-for="(item, index) of init_list.goodsInfo">
         <view class="center-left">
           <image src="@/static/QR57a.jpg" class="img"></image>
         </view>
@@ -36,7 +35,7 @@
         </view>
       </view>
 
-      <u-line margin='20rpx 0'></u-line>
+      <u-line margin="20rpx 0"></u-line>
 
       <view class="top-t2">
         <view class="t2-item">
@@ -60,148 +59,144 @@
           <p>-¥3.90</p>
         </view>
       </view>
-
     </view>
   </view>
 </template>
 
 <script>
-  export default {
-    data() {
-      return {
-        init_list: {
-          // goodsInfo: [{
-          //   goodsName: '测试名称111',
-          //   goodsQuantity: 12,
-          //   goodsPrice: 322
-          // }]
-        }
-      }
-    },
-    onLoad(option) {
-      this.init_list = option.orderList
-      console.log('@@@@init_list',this.init_list);
-    },
-    computed:{
-      allPrice(){
-        let price = 0
-        this.init_list.goodsInfo.map(rs=>{
-          price += rs.goodsPrice
-        })
-        return price.toFixed(2)
-      }
+export default {
+  data() {
+    return {
+      init_list: {
+        // goodsInfo: [{
+        //   goodsName: '测试名称111',
+        //   goodsQuantity: 12,
+        //   goodsPrice: 322
+        // }]
+      },
+    };
+  },
+  onLoad(option) {
+    this.init_list = option.orderList;
+    console.log('@@@@init_list', this.init_list);
+  },
+  computed: {
+    allPrice() {
+      let price = 0;
+      this.init_list.goodsInfo.map(rs => {
+        price += rs.goodsPrice;
+      });
+      return price.toFixed(2);
     },
-    methods: {
-
-    }
-  }
+  },
+  methods: {},
+};
 </script>
 
 <style lang="scss" scoped>
-  .container {
+.container {
+  padding: 20rpx;
+
+  .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-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 {
+      display: flex;
+      justify-content: space-between;
 
-      .top-t {
+      .t-l {
         display: flex;
-        justify-content: space-between;
-
-        .t-l {
-          display: flex;
 
-          .t-b {
-            width: 12rpx;
-            border-radius: 10rpx;
-            background-color: #f98e23;
-          }
+        .t-b {
+          width: 12rpx;
+          border-radius: 10rpx;
+          background-color: #f98e23;
+        }
 
-          .t-name {
-            margin-left: 10rpx;
-            font-weight: bold;
-            font-size: 28rpx;
-          }
+        .t-name {
+          margin-left: 10rpx;
+          font-weight: bold;
+          font-size: 28rpx;
         }
       }
+    }
 
-      .top-bottom-text {
-        margin: 10rpx 0;
-      }
+    .top-bottom-text {
+      margin: 10rpx 0;
+    }
 
-      .top-t2 {
-        .t2-item {
-          display: flex;
-          justify-content: space-between;
-          margin-bottom: 20rpx;
-        }
+    .top-t2 {
+      .t2-item {
+        display: flex;
+        justify-content: space-between;
+        margin-bottom: 20rpx;
       }
     }
-    .center-box{
-      margin-bottom: 20rpx;
+  }
+  .center-box {
+    margin-bottom: 20rpx;
+  }
+  .item-center {
+    display: flex;
+    align-items: center;
+    margin: 10rpx 0;
+
+    .center-left {
+      height: 160rpx;
+
+      .img {
+        width: 160rpx;
+        height: 160rpx;
+      }
     }
-    .item-center {
+
+    .center-right {
+      width: 100%;
+      height: 160rpx;
       display: flex;
-      align-items: center;
-      margin: 10rpx 0;
+      justify-content: space-between;
+      margin-left: 20rpx;
 
-      .center-left {
-        height: 160rpx;
+      .r-l {
+        display: flex;
+        flex-direction: column;
+        justify-content: space-around;
 
-        .img {
-          width: 160rpx;
-          height: 160rpx;
+        .right-name {
+          color: #4d5671;
+          font-size: 32rpx;
+          font-weight: bold;
         }
-      }
 
-      .center-right {
-        width: 100%;
-        height: 160rpx;
-        display: flex;
-        justify-content: space-between;
-        margin-left: 20rpx;
+        .right-descript {
+          font-size: 28rpx;
+          color: #858797;
+        }
 
-        .r-l {
+        .l-box {
           display: flex;
-          flex-direction: column;
-          justify-content: space-around;
+          font-size: 24rpx;
+          align-items: center;
+          font-style: italic;
 
-          .right-name {
-            color: #4D5671;
-            font-size: 32rpx;
+          .right-price {
+            margin-right: 20rpx;
             font-weight: bold;
-          }
-
-          .right-descript {
             font-size: 28rpx;
-            color: #858797;
+            color: #f57f32;
           }
 
-          .l-box {
-            display: flex;
+          .right-numb {
             font-size: 24rpx;
-            align-items: center;
-            font-style: italic;
-
-            .right-price {
-              margin-right: 20rpx;
-              font-weight: bold;
-              font-size: 28rpx;
-              color: #F57F32;
-            }
-
-            .right-numb {
-              font-size: 24rpx;
-              color: #858797;
-            }
+            color: #858797;
           }
         }
       }
     }
-
   }
+}
 </style>

+ 267 - 242
src/pages/merchant/mine/index.vue

@@ -12,14 +12,26 @@
       <view class="mine__person--info">
         <!-- 头像 -->
         <view>
-          <image :src="merchant.logo" style="width: 140rpx; height: 140rpx; border-radius: 50%" v-if="merchant.logo" />
-          <image src="@/static/QR57a.jpg" style="width: 140rpx; height: 140rpx; border-radius: 50%" v-else />
+          <image
+            :src="merchant.logo"
+            style="width: 140rpx; height: 140rpx; border-radius: 50%"
+            v-if="merchant.logo"
+          />
+          <image
+            src="@/static/QR57a.jpg"
+            style="width: 140rpx; height: 140rpx; border-radius: 50%"
+            v-else
+          />
         </view>
         <view class="userName">
-          <view> {{ merchant.name || '--' }}</view>
-          <text> +86 {{ merchant.mobile || '--' }}</text>
+          <view v-if="merchant && merchant.name"> {{ merchant.name || '--' }}</view>
+          <text v-if="merchant && merchant.mobile"> +86 {{ merchant.mobile || '--' }}</text>
         </view>
-        <view class="status" :style="{ 'background-color': getStatusColor(state) }" @click="changeStatus(state)">
+        <view
+          class="status"
+          :style="{ 'background-color': getStatusColor(state) }"
+          @click="changeStatus(state)"
+        >
           <view style="margin-right: 6rpx">{{ stateName }}</view>
           <u-icon name="play-right-fill" color="#fff" size="12" />
         </view>
@@ -74,292 +86,305 @@
     <tabbar currentTab="merchantMine" />
 
     <!-- 营业状态选择弹框 -->
-    <u-picker :show="show" :columns="columns" @cancel="cancel" @confirm="confirm" keyName="label"></u-picker>
+    <u-picker
+      :show="show"
+      :columns="columns"
+      @cancel="cancel"
+      @confirm="confirm"
+      keyName="label"
+    ></u-picker>
 
     <!-- 商家认证的弹框 -->
-    <u-modal :show="showAut" :title="title" :content="content" :showCancelButton="true" @confirm="confirmSwitch"
-      @cancel="handelCancel"></u-modal>
+    <u-modal
+      :show="showAut"
+      :title="title"
+      :content="content"
+      :confirmText="'开始认证'"
+      :cancelText="'返回用户端'"
+      :showCancelButton="true"
+      @confirm="confirmSwitch"
+      @cancel="handelCancel"
+    ></u-modal>
   </view>
 </template>
 
 <script>
-  import {
-    getMerchantAuthData
-  } from '@/api/merchant/merchantAuth';
-  export default {
-    data() {
-      return {
-        statusBarHeight: 0,
-        state: 1,
-        stateName: '营业中',
-        show: false,
-        showAut: false,
-        title: '商家认证',
-        content: '进入商家端前,我们需要一定的认证',
-        merchantInfo: {},
-        merchant: {},
-        columns: [
-          [{
-              label: '营业中',
-              id: 1,
-            },
-            {
-              label: '休息中',
-              id: 2,
-            },
-            {
-              label: '停业中',
-              id: 3,
-            },
-          ],
-        ],
-        list1: [{
-            id: '1',
-            name: '门店环境',
-            url: '',
-          },
-          // {
-          //   id: '2',
-          //   name: '我要开店',
-          //   url: '/pages/merchant/mine/openStore/index',
-          // },
+import { getMerchantAuthData } from '@/api/merchant/merchantAuth';
+export default {
+  data() {
+    return {
+      statusBarHeight: 0,
+      state: 1,
+      stateName: '营业中',
+      show: false,
+      showAut: false,
+      title: '商家认证',
+      content: '进入商家端前,我们需要一定的认证',
+      merchantInfo: {},
+      merchant: {},
+      columns: [
+        [
           {
-            id: '3',
-            name: '资质信息',
-            url: '/pages/merchant/mine/openStore/openStoreAppealDetail',
+            label: '营业中',
+            id: 1,
           },
-        ],
-
-        list2: [{
-            id: '1',
-            name: '帮助中心',
-            url: '',
+          {
+            label: '休息中',
+            id: 2,
           },
           {
-            id: '2',
-            name: '设置',
-            url: '/pages/merchant/mine/setting/index',
+            label: '停业中',
+            id: 3,
           },
         ],
-      };
+      ],
+      list1: [
+        {
+          id: '1',
+          name: '门店环境',
+          url: '',
+        },
+        // {
+        //   id: '2',
+        //   name: '我要开店',
+        //   url: '/pages/merchant/mine/openStore/index',
+        // },
+        {
+          id: '3',
+          name: '资质信息',
+          url: '/pages/merchant/mine/openStore/openStoreAppealDetail',
+        },
+      ],
+
+      list2: [
+        {
+          id: '1',
+          name: '帮助中心',
+          url: '',
+        },
+        {
+          id: '2',
+          name: '设置',
+          url: '/pages/merchant/mine/setting/index',
+        },
+      ],
+    };
+  },
+
+  onLoad() {
+    // this.getHeight();
+    // 获取商家信息
+    this.merchantInfo = this.$store.state.data.merchantInfo;
+    let { merchant } = this.merchantInfo;
+    this.merchant = merchant;
+
+    // 判断是否存在商家id,是否需要认证
+    if (merchant.id) {
+      this.showAut = false;
+    } else {
+      this.showAut = true;
+    }
+    // this.showAut = true;
+  },
+
+  onShow() {
+    this.getMerchantAuth();
+  },
+
+  methods: {
+    tap(item) {
+      console.log('item', item);
     },
 
-    onLoad() {
-      // this.getHeight();
-      // 获取商家信息
-      this.merchantInfo = this.$store.state.data.merchantInfo;
-      let {
-        merchant
-      } = this.merchantInfo;
-      this.merchant = merchant;
-
-      // 判断是否存在商家id,是否需要认证
-      // if (merchant.id) {
-      //   this.showAut = false;
-      // } else {
-      //   this.showAut = true;
-      // }
-      this.showAut = true;
+    changeStatus() {
+      this.show = true;
+    },
+    confirmSwitch() {
+      uni.navigateTo({
+        url: '/pages/merchant/mine/openStore/index',
+      });
+    },
+    handelCancel() {
+      uni.switchTab({
+        url: '/pages/client/tabBar/home/index',
+      });
     },
 
-    onShow() {
-      this.getMerchantAuth();
+    cancel() {
+      this.show = false;
     },
 
-    methods: {
-      tap(item) {
-        console.log('item', item);
-      },
-
-      changeStatus() {
-        this.show = true;
-      },
-      confirmSwitch() {
-        uni.navigateTo({
-          url: '/pages/merchant/mine/openStore/index',
-        });
-      },
-      handelCancel() {
-        uni.switchTab({
-          url: '/pages/client/tabBar/home/index',
-        });
-      },
-
-      cancel() {
-        this.show = false;
-      },
-
-      confirm(val) {
-        this.state = val.value[0].id;
-        this.stateName = val.value[0].label;
-        this.show = false;
-      },
-
-      getStatusColor(state) {
-        if (state === 1) {
-          return '#19be6b';
-        } else if (state === 2) {
-          return '#ff9900';
-        } else if (state === 3) {
-          return '#909399';
-        } else {
-          return '';
-        }
-      },
+    confirm(val) {
+      this.state = val.value[0].id;
+      this.stateName = val.value[0].label;
+      this.show = false;
+    },
 
-      // 点击跳转到设置
-      handlerSkipSetting() {
-        uni.navigateTo({
-          url: '/pages/merchant/mine/setting/index',
-        });
-      },
-
-      //计算导航栏总高度
-      getHeight() {
-        // 获取系统信息
-        const systemInfo = uni.getSystemInfoSync();
-        // 胶囊按钮位置信息
-        const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
-        // 导航栏高度 = 状态栏到胶囊的间距(胶囊距上距离-状态栏高度) * 2 + 胶囊高度 + 状态栏高度
-        this.statusBarHeight =
-          (menuButtonInfo.top - systemInfo.statusBarHeight) * 2 +
-          menuButtonInfo.height +
-          systemInfo.statusBarHeight;
-      },
-
-      // 获取商家信息
-      async getMerchantAuth() {
-        let res = await getMerchantAuthData();
-        if (res.code == 200) {
-          // 将数据存储到vuex中
-          this.$store.commit('SET_MERCHANTINFO', res.data);
-        }
-      },
+    getStatusColor(state) {
+      if (state === 1) {
+        return '#19be6b';
+      } else if (state === 2) {
+        return '#ff9900';
+      } else if (state === 3) {
+        return '#909399';
+      } else {
+        return '';
+      }
+    },
+
+    // 点击跳转到设置
+    handlerSkipSetting() {
+      uni.navigateTo({
+        url: '/pages/merchant/mine/setting/index',
+      });
     },
-  };
+
+    //计算导航栏总高度
+    getHeight() {
+      // 获取系统信息
+      const systemInfo = uni.getSystemInfoSync();
+      // 胶囊按钮位置信息
+      const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
+      // 导航栏高度 = 状态栏到胶囊的间距(胶囊距上距离-状态栏高度) * 2 + 胶囊高度 + 状态栏高度
+      this.statusBarHeight =
+        (menuButtonInfo.top - systemInfo.statusBarHeight) * 2 +
+        menuButtonInfo.height +
+        systemInfo.statusBarHeight;
+    },
+
+    // 获取商家信息
+    async getMerchantAuth() {
+      let res = await getMerchantAuthData();
+      if (res.code == 200) {
+        // 将数据存储到vuex中
+        this.$store.commit('SET_MERCHANTINFO', res.data);
+      }
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-  .mine {
-    min-height: calc(100vh - 80rpx);
-    box-sizing: border-box;
+.mine {
+  min-height: calc(100vh - 80rpx);
+  box-sizing: border-box;
 
-    &__nav {
-      background-color: $uni-bg-color-primary;
-    }
+  &__nav {
+    background-color: $uni-bg-color-primary;
+  }
 
-    &__person {
-      height: 200rpx;
-      padding: $uni-bg-padding-sm;
-      background-color: $uni-bg-color-primary;
-      position: relative;
+  &__person {
+    height: 200rpx;
+    padding: $uni-bg-padding-sm;
+    background-color: $uni-bg-color-primary;
+    position: relative;
 
-      &--icon {
-        display: flex;
-        justify-content: space-between;
-      }
+    &--icon {
+      display: flex;
+      justify-content: space-between;
+    }
 
-      &--info {
-        color: #fff;
-        display: flex;
-        margin-top: 20rpx;
+    &--info {
+      color: #fff;
+      display: flex;
+      margin-top: 20rpx;
 
-        .userName {
-          width: 400rpx;
-          font-size: 34rpx;
-          margin: 25rpx 0 0 16rpx;
+      .userName {
+        width: 400rpx;
+        font-size: 34rpx;
+        margin: 25rpx 0 0 16rpx;
 
-          >text {
-            font-size: 26rpx;
-          }
+        > text {
+          font-size: 26rpx;
         }
+      }
 
-        .status {
-          display: flex;
-          position: absolute;
-          bottom: 80rpx;
-          padding-left: 20rpx;
-          right: 0;
-          width: 150rpx;
-          height: 60rpx;
-          font-size: 25rpx;
-          align-items: center;
-          justify-content: center;
-          box-sizing: border-box;
-          border-radius: 30rpx 0 0 30rpx;
-          background-color: rgba(255, 255, 255, 0.3);
-        }
+      .status {
+        display: flex;
+        position: absolute;
+        bottom: 80rpx;
+        padding-left: 20rpx;
+        right: 0;
+        width: 150rpx;
+        height: 60rpx;
+        font-size: 25rpx;
+        align-items: center;
+        justify-content: center;
+        box-sizing: border-box;
+        border-radius: 30rpx 0 0 30rpx;
+        background-color: rgba(255, 255, 255, 0.3);
       }
     }
+  }
 
-    &__main {
+  &__main {
+    padding: $uni-bg-padding-sm;
+
+    &--purse {
+      background-color: $uni-bg-color;
       padding: $uni-bg-padding-sm;
+      border-radius: $uni-border-radius-base;
 
-      &--purse {
-        background-color: $uni-bg-color;
-        padding: $uni-bg-padding-sm;
-        border-radius: $uni-border-radius-base;
+      .wallet {
+        display: flex;
+        justify-content: space-between;
+        font-size: 28rpx;
 
-        .wallet {
-          display: flex;
-          justify-content: space-between;
-          font-size: 28rpx;
-
-          &--title {
-            color: #000;
-            font-size: 36rpx;
-            font-weight: 700;
-          }
-
-          &--more {
-            color: #333;
-            display: flex;
-            justify-content: center;
-            align-items: center;
-          }
+        &--title {
+          color: #000;
+          font-size: 36rpx;
+          font-weight: 700;
         }
 
-        .walletInfo {
-          margin: 40rpx 0;
+        &--more {
           color: #333;
           display: flex;
-          text-align: center;
-          justify-content: space-around;
-        }
-
-        .shortcut {
-          height: 70rpx;
-          padding: 0 20rpx;
-          color: #fff;
-          font-size: 28rpx;
-          display: flex;
+          justify-content: center;
           align-items: center;
-          justify-content: space-between;
-          background-color: $uni-bg-color-primary;
-          border-radius: $uni-border-radius-sm;
         }
       }
 
-      &--setting {
-        margin: 20rpx 0;
-        background-color: $uni-bg-color;
-        padding: $uni-bg-padding-sm;
-        border-radius: $uni-border-radius-base;
+      .walletInfo {
+        margin: 40rpx 0;
+        color: #333;
+        display: flex;
+        text-align: center;
+        justify-content: space-around;
+      }
+
+      .shortcut {
+        height: 70rpx;
+        padding: 0 20rpx;
+        color: #fff;
+        font-size: 28rpx;
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        background-color: $uni-bg-color-primary;
+        border-radius: $uni-border-radius-sm;
       }
     }
-  }
 
-  .text-title {
-    font-size: 34rpx;
+    &--setting {
+      margin: 20rpx 0;
+      background-color: $uni-bg-color;
+      padding: $uni-bg-padding-sm;
+      border-radius: $uni-border-radius-base;
+    }
   }
+}
 
-  .text-data {
-    font-size: 40rpx;
-    margin: 15rpx 0;
-    font-weight: 700;
-  }
+.text-title {
+  font-size: 34rpx;
+}
 
-  .text-info {
-    font-size: 24rpx;
-  }
+.text-data {
+  font-size: 40rpx;
+  margin: 15rpx 0;
+  font-weight: 700;
+}
+
+.text-info {
+  font-size: 24rpx;
+}
 </style>

+ 1 - 1
src/pages/merchant/mine/openStore/index.vue

@@ -6,7 +6,7 @@
       <span class="center-title">你需要准备以下材料:</span>
 
       <view class="content-item-box">
-        <view class="center-item" v-for="(item, index) of centerList">
+        <view class="center-item" :key="index" v-for="(item, index) of centerList">
           <img class="l-img" src="@/static/logo.png" alt="" />
           <view class="item-r">
             <p class="r-text1">{{ index + 1 }} 、{{ item.title }}</p>

+ 79 - 80
src/pages/merchant/store/components/evaluateItem.vue

@@ -1,9 +1,9 @@
 <template>
   <view class="">
-    <view class="item" v-for="item of 3">
+    <view class="item" :key="index" v-for="(item, index) of 3">
       <view class="item-top">
         <view class="top-l">
-          <img class="img" src="@/static/QR57a.jpg" alt="">
+          <img class="img" src="@/static/QR57a.jpg" alt="" />
           <view class="l-text">
             <p class="l-name">匿名用户</p>
             <p class="l-time">2023-11-05</p>
@@ -21,14 +21,14 @@
       </view>
 
       <view class="content-box">
-        <p class="content-text">服务非常好服务非常好服务非常好服务非常好服务非常好服务非常好服务非常好</p>
+        <p class="content-text">
+          服务非常好服务非常好服务非常好服务非常好服务非常好服务非常好服务非常好
+        </p>
         <view class="content-img-box">
-          <img class="content-img" src="@/static/QR57a.jpg" v-for="itm of 6">
-
+          <img class="content-img" src="@/static/QR57a.jpg" v-for="itm of 6" />
         </view>
       </view>
 
-
       <view class="btn-box">
         <view class="btn" @click="handlerSkipBack">回复</view>
       </view>
@@ -37,98 +37,97 @@
 </template>
 
 <script>
-  export default{
-    data(){
-      return{
-        count: 5,
-        value: 2,
-      }
+export default {
+  data() {
+    return {
+      count: 5,
+      value: 2,
+    };
+  },
+  methods: {
+    // 点击跳转到回复
+    handlerSkipBack() {
+      uni.navigateTo({
+        url: '/pages/tabbar/store/evaluateBack',
+      });
     },
-    methods:{
-      // 点击跳转到回复
-      handlerSkipBack(){
-        uni.navigateTo({
-          url:'/pages/tabbar/store/evaluateBack'
-        })
-      }
-    }
-  }
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-  .item{
-    background-color: #fff;
-    padding: 20rpx;
-    margin: 10rpx 0;
-    .item-top{
+.item {
+  background-color: #fff;
+  padding: 20rpx;
+  margin: 10rpx 0;
+  .item-top {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    .top-l {
       display: flex;
-      justify-content: space-between;
       align-items: center;
-      .top-l{
-        display: flex;
-        align-items: center;
-          .img{
-            width: 120rpx;
-            height: 120rpx;
-            border-radius: 50%;
-          }
-          .l-text{
-            .l-name{
-              font-size: 28rpx;
-              color: #777777;
-            }
-            .l-time{
-              font-size: 24rpx;
-              color: #777777;
-            }
-          }
+      .img {
+        width: 120rpx;
+        height: 120rpx;
+        border-radius: 50%;
       }
-      .top-r{
-        display: flex;
-        .r-text{
-          font-size: 26rpx;
+      .l-text {
+        .l-name {
+          font-size: 28rpx;
+          color: #777777;
+        }
+        .l-time {
+          font-size: 24rpx;
           color: #777777;
         }
       }
     }
-
-    .rate-box{
+    .top-r {
       display: flex;
-      font-size: 28rpx;
-      color: #777777;
-      margin: 20rpx;
-      .rate-text{
-        margin-right: 10rpx;
+      .r-text {
+        font-size: 26rpx;
+        color: #777777;
       }
     }
+  }
 
-    .content-box{
-      .content-text{
+  .rate-box {
+    display: flex;
+    font-size: 28rpx;
+    color: #777777;
+    margin: 20rpx;
+    .rate-text {
+      margin-right: 10rpx;
+    }
+  }
 
-      }
-      .content-img-box{
-        display: grid;
-        grid-template-columns: 22% 22% 22% 22%;
-        justify-content: space-around;
-        .content-img{
-          width: 180rpx;
-          height: 180rpx;
-        }
-      }
+  .content-box {
+    .content-text {
     }
-    .btn-box{
-      display: flex;
-      justify-content: flex-end;
-      .btn{
-        background-color: #fff;
-        border: 2rpx solid #F56C6C;
-        color: #F56C6C;
-        text-align: center;
-        width: 120rpx;
-        font-size: 26rpx;
-        padding: 10rpx 0;
-        border-radius: 20rpx;
+    .content-img-box {
+      display: grid;
+      grid-template-columns: 22% 22% 22% 22%;
+      justify-content: space-around;
+      .content-img {
+        width: 180rpx;
+        height: 180rpx;
       }
     }
   }
+  .btn-box {
+    display: flex;
+    justify-content: flex-end;
+    .btn {
+      background-color: #fff;
+      border: 2rpx solid #f56c6c;
+      color: #f56c6c;
+      text-align: center;
+      width: 120rpx;
+      font-size: 26rpx;
+      padding: 10rpx 0;
+      border-radius: 20rpx;
+    }
+  }
+}
 </style>