浏览代码

feat(merchant):处理图片上传,商家信息

liude 1 年之前
父节点
当前提交
c14ce6d60c

+ 21 - 25
src/api/merchant/order.js

@@ -1,37 +1,33 @@
 import { request } from '@/utils/request';
 
-
 /**
  * @description 获取商家订单列表
- * @param {*} params 
- * @returns 
+ * @param {*} data
+ * @returns
  */
 
-export function getOrderListApi(params){
-    return request({
-        url: "/maintain/order/merchantPaging",
-        data:params,
-        method: "GET",
-        header: {
-            'Content-Type': 'application/x-www-form-urlencoded',
-          },
-    })
+export function getOrderListApi(data) {
+  return request({
+    url: '/maintain/order/merchantPaging',
+    data: data,
+    method: 'GET',
+    header: {
+      'Content-Type': 'application/x-www-form-urlencoded',
+    },
+  });
 }
 
-
 /**
  * @description 订单接口 - 商家端查询订单量以及今日收入
- * @param {*} params 
- * @returns 
+ * @returns
  */
 
-export function getOrderQuantityApi(params) {
-    return request({
-      url: '/maintain/order/getOrderQuantity',
-      data: params,
-      method: 'GET',
-      header: {
-        'Content-Type': 'application/x-www-form-urlencoded',
-      },
-    });
-  }
+export function getOrderQuantityApi(id) {
+  return request({
+    url: `/maintain/order/getOrderQuantity/${id}`,
+    method: 'GET',
+    header: {
+      'Content-Type': 'application/x-www-form-urlencoded',
+    },
+  });
+}

+ 147 - 140
src/pages.json

@@ -294,149 +294,148 @@
         }
       ]
     },
-	{
-		"root": "pages/merchant",
-		"pages": [
-			{
-			  "path": "extend/index",
-			  "style": {
-			    "navigationBarTitleText": "推广",
-			    "navigationStyle": "custom"
-			  }
-			},
-			{
-			  "path": "mine/index",
-			  "style": {
-			    "navigationBarTitleText": "我的",
-			    "navigationStyle": "custom"
-			  }
-			},
-			{
-			  "path": "mine/setting/index",
-			  "style": {
-			    "navigationBarTitleText": "设置",
-			    "navigationStyle": "default"
-			  }
-			},
-			{
-			  "path": "mine/setting/accountSafety",
-			  "style": {
-			    "navigationBarTitleText": "账号与安全"
-			  }
-			},
-			{
-			  "path": "mine/setting/bindPhoneAndEmail",
-			  "style": {
-			    "navigationBarTitleText": ""
-			  }
-			},
-			{
-			  "path": "mine/setting/phoneAndEmail",
-			  "style": {
-			    "navigationBarTitleText": ""
-			  }
-			},
+    {
+      "root": "pages/merchant",
+      "pages": [{
+          "path": "extend/index",
+          "style": {
+            "navigationBarTitleText": "推广",
+            "navigationStyle": "custom"
+          }
+        },
+        {
+          "path": "mine/index",
+          "style": {
+            "navigationBarTitleText": "我的",
+            "navigationStyle": "custom"
+          }
+        },
+        {
+          "path": "mine/setting/index",
+          "style": {
+            "navigationBarTitleText": "设置",
+            "navigationStyle": "default"
+          }
+        },
+        {
+          "path": "mine/setting/accountSafety",
+          "style": {
+            "navigationBarTitleText": "账号与安全"
+          }
+        },
+        {
+          "path": "mine/setting/bindPhoneAndEmail",
+          "style": {
+            "navigationBarTitleText": ""
+          }
+        },
+        {
+          "path": "mine/setting/phoneAndEmail",
+          "style": {
+            "navigationBarTitleText": ""
+          }
+        },
 
-			{
-			  "path": "mine/setting/privacyPolicy",
-			  "style": {
-			    "navigationBarTitleText": ""
-			  }
-			},
+        {
+          "path": "mine/setting/privacyPolicy",
+          "style": {
+            "navigationBarTitleText": ""
+          }
+        },
 
-			{
-			  "path": "mine/openStore/index",
-			  "style": {
-			    "navigationBarTitleText": "我要开店",
-			    "navigationStyle": "default"
-			  }
-			},
+        {
+          "path": "mine/openStore/index",
+          "style": {
+            "navigationBarTitleText": "我要开店",
+            "navigationStyle": "default"
+          }
+        },
 
-			{
-			  "path": "mine/openStore/storeInformation",
-			  "style": {
-			    "navigationBarTitleText": "1/3门店信息",
-			    "navigationStyle": "default"
-			  }
-			},
-			{
-			  "path": "mine/openStore/corporateInformation",
-			  "style": {
-			    "navigationBarTitleText": "2/3法人信息"
-			  }
-			},
-			{
-			  "path": "mine/openStore/messageSubmit",
-			  "style": {
-			    "navigationBarTitleText": "审核信息"
-			  }
-			},
-			{
-			  "path": "mine/openStore/openStoreAppealDetail",
-			  "style": {
-			    "navigationBarTitleText": "资质信息"
-			  }
-			},
-			{
-			  "path": "mine/openStore/qualificationInformation",
-			  "style": {
-			    "navigationBarTitleText": "2/3资质信息"
-			  }
-			},
-			{
-			  "path": "message/index",
-			  "style": {
-			    "navigationBarTitleText": "消息",
-			    "navigationStyle": "custom"
-			  }
-			},
-			{
-			  "path": "message/systemNotice",
-			  "style": {
-			    "navigationBarTitleText": "订单",
-			    "navigationStyle": "custom"
-			  }
-			},
-			{
-			  "path": "store/index",
-			  "style": {
-			    "navigationBarTitleText": "店铺",
-			    "navigationStyle": "custom"
-			  }
-			},
-			{
-			  "path": "store/evaluateBack",
-			  "style": {
-			    "navigationBarTitleText": "回复评价"
-			  }
-			},
-			{
-			  "path": "store/evaluateManagement",
-			  "style": {
-			    "navigationBarTitleText": "评价管理"
-			  }
-			},
-			{
-			  "path": "store/myTeam",
-			  "style": {
-			    "navigationBarTitleText": "我的团队"
-			  }
-			},
-			{
-			  "path": "store/shopManage",
-			  "style": {
-			    "navigationBarTitleText": "店铺管理"
-			  }
-			},
-			{
-			  "path": "order/index",
-			  "style": {
-			    "navigationBarTitleText": "订单",
-			    "navigationStyle": "custom"
-			  }
-			}
-		]
-	}
+        {
+          "path": "mine/openStore/storeInformation",
+          "style": {
+            "navigationBarTitleText": "1/3门店信息",
+            "navigationStyle": "default"
+          }
+        },
+        {
+          "path": "mine/openStore/corporateInformation",
+          "style": {
+            "navigationBarTitleText": "2/3法人信息"
+          }
+        },
+        {
+          "path": "mine/openStore/messageSubmit",
+          "style": {
+            "navigationBarTitleText": "审核信息"
+          }
+        },
+        {
+          "path": "mine/openStore/openStoreAppealDetail",
+          "style": {
+            "navigationBarTitleText": "资质信息"
+          }
+        },
+        {
+          "path": "mine/openStore/qualificationInformation",
+          "style": {
+            "navigationBarTitleText": "2/3资质信息"
+          }
+        },
+        {
+          "path": "message/index",
+          "style": {
+            "navigationBarTitleText": "消息",
+            "navigationStyle": "custom"
+          }
+        },
+        {
+          "path": "message/systemNotice",
+          "style": {
+            "navigationBarTitleText": "订单",
+            "navigationStyle": "custom"
+          }
+        },
+        {
+          "path": "store/index",
+          "style": {
+            "navigationBarTitleText": "店铺",
+            "navigationStyle": "custom"
+          }
+        },
+        {
+          "path": "store/evaluateBack",
+          "style": {
+            "navigationBarTitleText": "回复评价"
+          }
+        },
+        {
+          "path": "store/evaluateManagement",
+          "style": {
+            "navigationBarTitleText": "评价管理"
+          }
+        },
+        {
+          "path": "store/myTeam",
+          "style": {
+            "navigationBarTitleText": "我的团队"
+          }
+        },
+        {
+          "path": "store/shopManage",
+          "style": {
+            "navigationBarTitleText": "店铺管理"
+          }
+        },
+        {
+          "path": "order/index",
+          "style": {
+            "navigationBarTitleText": "订单",
+            "navigationStyle": "custom"
+          }
+        }
+      ]
+    }
   ],
   "tabBar": {
     "color": "#999999",
@@ -465,5 +464,13 @@
     "navigationBarTitleText": "uni-app",
     "navigationBarBackgroundColor": "#F8F8F8",
     "backgroundColor": "#F8F8F8"
+  },
+  "condition": { //模式配置,仅开发期间生效
+    "current": 0, //当前激活的模式(list 的索引项)
+    "list": [{
+      "name": "", //模式名称
+      "path": "", //启动页面,必选
+      "query": "" //启动参数,在页面的onLoad函数里面得到
+    }]
   }
 }

+ 270 - 214
src/pages/merchant/mine/index.vue

@@ -10,13 +10,28 @@
         <u-icon name="chat" color="#fffb" size="22" />
       </view> -->
       <view class="mine__person--info">
-        <image src="@/static/QR57a.jpg" style="width: 140rpx; height: 140rpx; border-radius: 50%" />
-
+        <!-- 头像 -->
+        <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
+          />
+        </view>
         <view class="userName">
-          <view> yizhiyang的鲜花店(云岩区店)</view>
-          <text> +8618285564342</text>
+          <view> {{ merchant.name || '--' }}</view>
+          <text> +86 {{ merchant.mobile || '--' }}</text>
         </view>
-        <view class="status" :style="{ 'background-color': getStatusColor(state) }" @click="changeStatust(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>
@@ -71,262 +86,303 @@
     <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"
+      :showCancelButton="true"
+      @confirm="confirmSwitch"
+      @cancel="handelCancel"
+    ></u-modal>
   </view>
 </template>
 
 <script>
-  export default {
-    data() {
-      return {
-        statusBarHeight: 0,
-        state: 1,
-        stateName: '营业中',
-        show: false,
-        showAut: false,
-        title: "商家认证",
-        content: "进入商家端前,我们需要一定的认证",
-        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.showAut = true;
+    changeStatus() {
+      this.show = true;
+    },
+    confirmSwitch() {
+      uni.navigateTo({
+        url: '/pages/merchant/mine/openStore/index',
+      });
+    },
+    handelCancel() {
+      uni.switchTab({
+        url: '/pages/client/tabBar/home/index',
+      });
     },
 
-    methods: {
-      tap(item) {
-        console.log('item', item);
-      },
-
-      changeStatust() {
-        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 '';
-        }
-      },
+    cancel() {
+      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;
-      },
+    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 '';
+      }
+    },
+
+    // 点击跳转到设置
+    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: 10rpx 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>

+ 0 - 97
src/pages/merchant/mine/openStore/components/ImgsUpload - copy.vue

@@ -1,97 +0,0 @@
-<template>
-	<view class="imgs-upload-container">
-    <u-upload :fileList="fileList" @afterRead="afterRead" @delete="deletePic" multiple :maxCount="1"
-      width="275" height="150">
-      <image src="https://cdn.uviewui.com/uview/demo/upload/positive.png" mode="widthFix"
-        style="width: 670rpx;height: 150px;"></image>
-    </u-upload>
-    
-	</view>
-</template>
-
-<script>
-export default {
-		props:{
-			filelist:{
-				type:Array
-			},
-			value:{
-				type:Number
-			}
-		},
-		data() {
-			return {
-				fileList: [],
-				img_upload_list: [],
-			}
-		},
-		onLoad(option) {
-		},
-		mounted() {
-		},
-		methods: {
-			// 删除图片
-			deletePic(event) {
-				this[`fileList${event.name}`].splice(event.index, 1)
-				this.img_upload_list.splice(event.index, 1)
-			},
-			// 新增图片
-			async afterRead(event) {
-				// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
-				const { index, file} = event
-				let lists = [].concat(event.file)
-				let fileListLen = this[`fileList${event.name}`].length
-				lists.map((item) => {
-					this[`fileList${event.name}`].push({
-						...item,
-						status: 'uploading',
-						message: '上传中'
-					})
-				})
-				for (let i = 0; i < lists.length; i++) {
-					const result = await this.uploadFilePromise(lists[i].url)
-					let item = this[`fileList${event.name}`][fileListLen]
-					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
-						status: 'success',
-						message: '',
-						url: result
-					}))
-					fileListLen++
-				}
-			},
-			uploadFilePromise(url) {
-				return new Promise((resolve, reject) => {
-					let a = uni.uploadFile({
-						url: `/maintain/file`, // 仅为示例,非真实的接口地址
-						filePath: url,
-						name: 'file',
-						header: {
-							Authorization: localStorage.getItem('App-Token')
-						},
-						formData: {},
-						success: (res) => {
-							setTimeout(() => {
-								resolve(res.data.data)
-								this.img_upload_list.push(JSON.parse(res.data).data.relativePath)
-								this.$emit('update:filelist', this.img_upload_list)
-							}, 1000)
-						}
-					});
-				})
-			},
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	.upload-textbox {
-		margin-top: 10rpx;
-
-		.upload-img {
-			width: 80rpx;
-			height: 80rpx;
-		}
-
-		.span-box {}
-	}
-</style>

+ 97 - 90
src/pages/merchant/mine/openStore/components/ImgsUpload.vue

@@ -1,106 +1,113 @@
 <template>
-  <view class="imgs-upload-container">
-    <u-upload :fileList="fileList" @afterRead="afterRead" @delete="deletePic" multiple :maxCount="1" width="275"
-      height="150">
-      <image src="https://cdn.uviewui.com/uview/demo/upload/positive.png" mode="widthFix"
-        style="width: 670rpx; height: 150px"></image>
-    </u-upload>
+  <view class="imageUpload">
+    <view class="images-box" @click="handlerUploadImg" v-if="fileList.length">
+      <image
+        class="upd-img"
+        v-for="(item, index) of fileList"
+        :key="index"
+        :src="item"
+        mode="aspectFill"
+      ></image>
+    </view>
+
+    <view class="images-box" @click="handlerUploadImg" v-else>
+      <image src="/static/icon/QR57a.jpg" mode="aspectFill"></image>
+    </view>
   </view>
 </template>
 
 <script>
-  import {
-    BASE_URL,
-    uploadFile
-  } from '@/utils/request';
-  export default {
-    props: {
-      filelist: {
-        type: Array,
-      },
-      value: {
-        type: Number,
-      },
-    },
-    data() {
-      return {
-        fileList: [],
-        img_upload_list: [],
-      };
+export default {
+  props: {
+    value: {
+      type: String,
+      default: '',
     },
-    onLoad(option) {},
-    mounted() {},
-    methods: {
-      deletePic(event) {
-        this[`fileList${event.name}`].splice(event.index, 1);
-        this.img_upload_list.splice(event.index, 1);
-      },
-      async afterRead(event) {
-        let lists = [].concat(event.file);
-        let fileListLen = this[`fileList${event.name}`].length;
-
-        lists.map(item => {
-          this[`fileList${event.name}`].push({
-            ...item,
-            status: 'uploading',
-            message: '上传中',
-          });
+  },
+  data() {
+    return {
+      uploadCount: 0,
+      fileList: [],
+    };
+  },
+  onLoad(option) {},
+  onShow() {},
+  created() {},
+  methods: {
+    // 上传头像
+    async handlerUploadImg() {
+      try {
+        const res = await uni.showActionSheet({
+          itemList: ['拍照', '从相册选择'],
         });
-
-        for (let i = 0; i < lists.length; i++) {
-          const result = await this.uploadFilePromise(lists[i].url);
-          let item = this[`fileList${event.name}`][fileListLen];
-          this[`fileList${event.name}`].splice(
-            fileListLen,
-            1,
-            Object.assign(item, {
-              status: 'success',
-              message: '',
-              url: result,
-            }),
-          );
-          fileListLen++;
+        if (res.tapIndex === 0) {
+          // 用户选择拍照
+          this.takePhoto();
+        } else if (res.tapIndex === 1) {
+          // 用户选择从相册选择
+          this.chooseImage();
         }
-      },
-      uploadFilePromise(url) {
-        uploadFile(url).then(res => {
-          console.log(res, "6666666666666");
-        })
-        return
-        return new Promise((resolve, reject) => {
-          const access_token = this.$store.getters.access_token;
-          let a = uni.uploadFile({
-            url: `${BASE_URL}/maintain/file`,
-            filePath: url,
-            name: 'File',
-            header: {
-              Authorization: `Bearer ${access_token}`,
-              'Content-Type': 'application/json; charset=utf-8',
-            },
-            formData: {},
-            success: res => {
-              setTimeout(() => {
-                resolve(res.data.data);
-                // this.img_upload_list.push(JSON.parse(res.data).data.relativePath)
-                this.$emit('update:filelist', this.img_upload_list);
-              }, 1000);
-            },
+      } catch (error) {
+        console.error(error);
+      }
+    },
+    // 拍照
+    takePhoto() {
+      uni.chooseImage({
+        sourceType: ['camera'],
+        count: 1 - 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;
+      // 手动触发组件的重新渲染
+      this.$forceUpdate();
+      this.$emit('update', this.fileList,this.value);
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-  .upload-textbox {
-    margin-top: 10rpx;
-
-    .upload-img {
-      width: 80rpx;
-      height: 80rpx;
+.imageUpload {
+  .images-box {
+    width: 100%;
+    height: 400rpx;
+    background-color: pink;
+    image {
+      height: 100%;
+      width: 100%;
     }
-
-    .span-box {}
   }
+}
 </style>

+ 13 - 7
src/pages/merchant/mine/openStore/corporateInformation.vue

@@ -25,7 +25,6 @@
           </view>
         </view>
 
-
         <view class="content-item">
           <u-form-item prop="documentType" required label="证件类型" right>
             <view class="item-r">
@@ -67,14 +66,14 @@
 
       <view class="content-box">
         <u-form-item prop="frontImage">
-          <imgs-upload :filelist.sync="filelist"></imgs-upload>
+          <imgs-upload @update="fileList" :value="1"></imgs-upload>
           <p class="upload-text">证件正面图(国徽图)</p>
         </u-form-item>
       </view>
 
       <view class="content-box">
         <u-form-item prop="reverseImage">
-          <imgs-upload :filelist.sync="filelist"></imgs-upload>
+          <imgs-upload @update="fileList" :value="2"></imgs-upload>
           <p class="upload-text">证件反面图(人像图)</p>
         </u-form-item>
       </view>
@@ -105,7 +104,7 @@
 </template>
 
 <script>
-import ImgsUpload from '@/pages/merchant/mine/openStore/components/ImgsUpload.vue';
+import ImgsUpload from './components/ImgsUpload.vue';
 import { formatTime } from '@/utils/date';
 
 export default {
@@ -114,7 +113,6 @@ export default {
   },
   data() {
     return {
-      filelist: [],
       showSex: false,
       showPicker: false,
       valueDate: Number(new Date()),
@@ -193,13 +191,21 @@ export default {
       });
     },
     sexSelect(e) {
-      this.legalInfo.sexName = e.name
-      this.$refs.uForm.validateField('userInfo.sex')
+      this.legalInfo.sexName = e.name;
+      this.$refs.uForm.validateField('userInfo.sex');
     },
     handleConfirm(data) {
       this.legalInfo.validity = formatTime(data.value, 'YYYY-MM-DD');
       this.showPicker = false;
     },
+    // 处理图片
+    fileList(val, data) {
+      if (data == 1) {
+        this.legalInfo.frontImage = val[0];
+      } else if (data == 2) {
+        this.legalInfo.reverseImage = val[0];
+      }
+    },
   },
 };
 </script>

+ 19 - 33
src/pages/merchant/mine/openStore/openStoreAppealDetail.vue

@@ -7,19 +7,19 @@
 
     <view class="content-item">
       <view class="item-l">
-        <p>负责人 : {{ merchantAuthList.legalRepresentativeName || '--' }}</p>
-        <p>手机号 : {{ merchantAuthList.mobileNumber || '--' }}</p>
+        <p>负责人 : {{ list.legalRepresentativeName || '--' }}</p>
+        <p>手机号 : {{ list.mobileNumber || '--' }}</p>
       </view>
       <img class="img" src="@/static/mine/icon_mine_underReview.png" alt="" />
     </view>
 
     <view class="content-item">
       <view class="item-l">
-        <p>店名 : {{ merchant.name || '--' }}</p>
-        <p>店铺类型 : {{ merchantAuthList.mobileNumber || '--' }}</p>
-        <p>手机号 : {{ merchantAuthList.mobileNumber || '--' }}</p>
-        <p>所在地 : {{ merchantAuthList.storeAddress || '--' }}</p>
-        <p>详细地址 : {{ merchant.address || '--' }}</p>
+        <p>店名 : {{ list.merchant.name || '--' }}</p>
+        <p>店铺类型 : {{ list.mobileNumber || '--' }}</p>
+        <p>手机号 : {{ list.mobileNumber || '--' }}</p>
+        <p>所在地 : {{ list.storeAddress || '--' }}</p>
+        <p>详细地址 : {{ list.merchant.address || '--' }}</p>
       </view>
     </view>
 
@@ -36,10 +36,10 @@
 
     <view class="content-item2">
       <view class="item-l">
-        <p>法人姓名 : {{ merchantAuthList.legalRepresentativeName || '--' }}</p>
-        <p>性别 : {{ merchantAuthList.legalRepresentativeGender || '--' }}</p>
-        <p>证件号码 : {{ merchantAuthList.idCardNumber || '--' }}</p>
-        <p>有效期 : {{ merchantAuthList.idCardExpirationDate || '--' }}</p>
+        <p>法人姓名 : {{ list.legalRepresentativeName || '--' }}</p>
+        <p>性别 : {{ list.legalRepresentativeGender || '--' }}</p>
+        <p>证件号码 : {{ list.idCardNumber || '--' }}</p>
+        <p>有效期 : {{ list.idCardExpirationDate || '--' }}</p>
       </view>
       <view class="item2-box">
         <img class="img2" src="@/static/logo.png" alt="" />
@@ -54,8 +54,8 @@
     <view class="content-item2">
       <view class="item-l">
         <p>证件名称 : 营业执照</p>
-        <p>证件编号 : {{ merchantAuthList.mobileNumber || '--' }}</p>
-        <p>有效期 : {{ merchantAuthList.mobileNumber || '--' }}</p>
+        <p>证件编号 : {{ list.mobileNumber || '--' }}</p>
+        <p>有效期 : {{ list.mobileNumber || '--' }}</p>
       </view>
       <view class="item2-box">
         <img class="img2" src="@/static/logo.png" alt="" />
@@ -66,8 +66,8 @@
     <view class="content-item2">
       <view class="item-l">
         <p>证件名称 : 经营许可证</p>
-        <p>证件编号 : {{ merchantAuthList.mobileNumber || '--' }}</p>
-        <p>有效期 : {{ merchantAuthList.mobileNumber || '--' }}</p>
+        <p>证件编号 : {{ list.mobileNumber || '--' }}</p>
+        <p>有效期 : {{ list.mobileNumber || '--' }}</p>
       </view>
       <view class="item2-box">
         <img class="img2" src="@/static/logo.png" alt="" />
@@ -78,30 +78,16 @@
 </template>
 
 <script>
-import { getMerchantAuthData } from '@/api/merchant/merchantAuth';
 export default {
   data() {
     return {
-      merchantAuthList: {},
-      merchant: {},
+      list: {},
     };
   },
-  methods: {
-    async getMerchantAuth() {
-      let res = await getMerchantAuthData();
-      console.log('@@@res', res);
 
-      if (res.code == 200) {
-        this.merchantAuthList = res.data;
-        this.merchant = res.data = res.data.merchant;
-
-        // 将数据存储到vuex中
-        this.$store.commit('SET_MERCHANTINFO', res.data);
-      }
-    },
-  },
-  created() {
-    this.getMerchantAuth();
+  methods: {},
+  onShow() {
+    this.list = this.$store.state.data.merchantInfo;
   },
 };
 </script>

+ 32 - 8
src/pages/merchant/mine/openStore/qualificationInformation.vue

@@ -45,7 +45,7 @@
 
         <view class="content-item">
           <u-form-item prop="frontImage">
-            <imgs-upload :filelist.sync="businessLicenseImg"></imgs-upload>
+            <imgs-upload @update="fileList" :value="2"></imgs-upload>
             <p class="upload-text">证件正面图</p>
           </u-form-item>
         </view>
@@ -93,8 +93,9 @@
 
         <view class="content-item">
           <u-form-item prop="businessLicensePhoto">
-            <imgs-upload :filelist.sync="filelist"></imgs-upload>
-            <p class="upload-text"></p>
+            <imgs-upload @update="fileList" :value="2"></imgs-upload>
+
+            <p class="upload-text">证件正面图</p>
           </u-form-item>
         </view>
       </view>
@@ -114,14 +115,16 @@
 </template>
 
 <script>
-import ImgsUpload from '@/pages/merchant/mine/openStore/components/ImgsUpload.vue';
+import ImgsUpload from './components/ImgsUpload.vue';
 import { addMerchantAuth } from '@/api/merchant/merchantAuth';
 import { formatTime } from '@/utils/date';
 
 export default {
+  components: {
+    ImgsUpload,
+  },
   data() {
     return {
-      filelist: [],
       type: 1, // 1表示营业执照  2表示经营许可
       aptitudeInfo: {
         businessLicenseId: '',
@@ -159,22 +162,45 @@ export default {
           trigger: ['change'],
         },
       },
+      merchantInfo: {},
+      storeInfo: {},
     };
   },
-  components: { ImgsUpload },
   onReady() {
     //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
     this.$refs.uForm.setRules(this.rules);
   },
+  onShow() {
+    this.merchantInfo = this.$store.state.data.merchantInfo;
+    this.storeInfo = this.$store.state.data.storeInfo;
+    console.log(this.merchantInfo, '1111111');
+    console.log(this.storeInfo, '22222222');
+  },
   methods: {
+    // 图片
+    fileList(val, data) {
+      if (data == 1) {
+        this.aptitudeInfo.frontImage = val[0];
+      } else if (data == 2) {
+        this.aptitudeInfo.businessLicensePhoto = val[0];
+      }
+    },
     handelShowPicker(data) {
       this.type = data;
       this.showPicker = true;
     },
+
     // 跳转到提交成功页面
     handlerSkipNext() {
       this.$refs.uForm.validate().then(res => {
         /* 发起认证 */
+        let params = Object.assign({
+          ...this.merchantInfo,
+          ...this.storeInfo,
+          ...this.aptitudeInfo,
+        });
+        console.log(params, '@@params');
+
         addMerchantAuth().then(res => {
           console.log(res);
 
@@ -189,8 +215,6 @@ export default {
           }, 2000);
         });
       });
-
-      console.log(this.aptitudeInfo);
     },
 
     handleConfirm(data) {

+ 241 - 199
src/pages/merchant/mine/openStore/storeInformation.vue

@@ -9,14 +9,22 @@
         <view class="content-item">
           <u-form-item prop="name" required label="姓名" right>
             <view class="item-r">
-              <u--input placeholder="请输入负责人名称" border="surround" v-model="storeInfo.name"></u--input>
+              <u--input
+                placeholder="请输入负责人名称"
+                border="surround"
+                v-model="storeInfo.name"
+              ></u--input>
             </view>
           </u-form-item>
         </view>
         <view class="content-item">
           <u-form-item prop="mobileNumber" required label="手机号码" right>
             <view class="item-r">
-              <u--input placeholder="请输入手机号码" border="surround" v-model="storeInfo.mobileNumber"></u--input>
+              <u--input
+                placeholder="请输入手机号码"
+                border="surround"
+                v-model="storeInfo.mobileNumber"
+              ></u--input>
             </view>
           </u-form-item>
         </view>
@@ -24,7 +32,11 @@
         <view class="content-item">
           <u-form-item prop="email" required label="电子邮箱" right>
             <view class="item-r">
-              <u--input placeholder="请输入您的邮箱" border="surround" v-model="storeInfo.email"></u--input>
+              <u--input
+                placeholder="请输入您的邮箱"
+                border="surround"
+                v-model="storeInfo.email"
+              ></u--input>
             </view>
           </u-form-item>
         </view>
@@ -33,15 +45,23 @@
         <view class="content-item">
           <u-form-item prop="storeName" required label="店铺名称" right>
             <view class="item-r">
-              <u--input placeholder="请输入店铺名称" border="surround" v-model="storeInfo.storeName"></u--input>
+              <u--input
+                placeholder="请输入店铺名称"
+                border="surround"
+                v-model="storeInfo.storeName"
+              ></u--input>
             </view>
           </u-form-item>
         </view>
         <view class="content-item">
           <u-form-item prop="area" required label="所在地区" right>
             <view class="item-r">
-              <u--input placeholder="请选择所在地区" border="surround" v-model="storeInfo.area"
-                @focus="handlerChange"></u--input>
+              <u--input
+                placeholder="请选择所在地区"
+                border="surround"
+                v-model="storeInfo.area"
+                @focus="handlerChange"
+              ></u--input>
             </view>
             <view class="icon-right-box">
               <u-icon name="arrow-right" color="#c5c5c5" size="20"></u-icon>
@@ -51,7 +71,11 @@
         <view class="content-item">
           <u-form-item prop="storeAddress" required label="详细地址" right>
             <view class="item-r">
-              <u--input placeholder="请输入门店详细地址" border="surround" v-model="storeInfo.storeAddress"></u--input>
+              <u--input
+                placeholder="请输入门店详细地址"
+                border="surround"
+                v-model="storeInfo.storeAddress"
+              ></u--input>
             </view>
           </u-form-item>
         </view>
@@ -59,14 +83,14 @@
 
       <view class="content-box">
         <u-form-item prop="shopFacade">
-          <imgs-upload :filelist.sync="filelist"></imgs-upload>
+          <imgs-upload @update="fileList" :value="1"></imgs-upload>
           <p class="upload-text">店铺门面图(需要包含完整牌匾)</p>
         </u-form-item>
       </view>
 
       <view class="content-box">
         <u-form-item prop="realFacade">
-          <imgs-upload :filelist.sync="filelist"></imgs-upload>
+          <imgs-upload @update="fileList" :value="2"></imgs-upload>
           <p class="upload-text">店内真实环境图</p>
         </u-form-item>
       </view>
@@ -74,237 +98,255 @@
     <button class="btn" @click="handlerSkipNext">下一步</button>
 
     <!-- 地区 -->
-    <u-picker :show="show" ref="uPicker" :columns="cityList" @confirm="confirm" @change="changeHandler"
-      @cancel="show = false"></u-picker>
+    <u-picker
+      :show="show"
+      ref="uPicker"
+      :columns="cityList"
+      @confirm="confirm"
+      @change="changeHandler"
+      @cancel="show = false"
+    ></u-picker>
   </view>
 </template>
 
 <script>
-  import ImgsUpload from '@/pages/merchant/mine/openStore/components/ImgsUpload.vue';
-  // 导入城市js文件
-  import cityData from '@/utils/city';
-  export default {
-    components: {
-      ImgsUpload,
-    },
-    data() {
-      return {
-        fileList: [],
-        storeInfo: {
-          area: '',
-          storeAddress: '',
-          name: '',
-          mobileNumber: '',
-          storeName: '',
-          shopFacade: '',
-          realFacade: '',
+import ImgsUpload from './components/ImgsUpload.vue';
+// 导入城市js文件
+import cityData from '@/utils/city';
+
+export default {
+  components: {
+    ImgsUpload,
+  },
+  data() {
+    return {
+      storeInfo: {
+        area: '',
+        storeAddress: '',
+        name: '',
+        mobileNumber: '',
+        storeName: '',
+        shopFacade: '',
+        realFacade: '',
+      },
+      rules: {
+        name: {
+          type: 'string',
+          required: true,
+          message: '请输入负责人名称',
+          trigger: ['blur', 'change'],
         },
-        rules: {
-          name: {
-            type: 'string',
+        storeName: {
+          type: 'string',
+          required: true,
+          message: '请输入店铺名',
+          trigger: ['blur', 'change'],
+        },
+        storeAddress: {
+          type: 'string',
+          required: true,
+          message: '请输入详细地址',
+          trigger: ['blur', 'change'],
+        },
+        mobileNumber: [
+          {
             required: true,
-            message: '请输入负责人名称',
+            message: '请输入手机号码',
             trigger: ['blur', 'change'],
           },
-          storeName: {
-            type: 'string',
-            required: true,
-            message: '请输入店铺名',
-            trigger: ['blur', 'change'],
+          {
+            validator: (rule, value, callback) => {
+              return uni.$u.test.mobile(value);
+            },
+            message: '手机号码不正确',
+            trigger: ['change', 'blur'],
           },
-          storeAddress: {
-            type: 'string',
+        ],
+        email: [
+          {
             required: true,
-            message: '请输入详细地址',
+            message: '请输入您的邮箱',
             trigger: ['blur', 'change'],
           },
-          mobileNumber: [{
-              required: true,
-              message: '请输入手机号码',
-              trigger: ['blur', 'change'],
-            },
-            {
-              validator: (rule, value, callback) => {
-                return uni.$u.test.mobile(value);
-              },
-              message: '手机号码不正确',
-              trigger: ['change', 'blur'],
-            },
-          ],
-          email: [{
-              required: true,
-              message: '请输入您的邮箱',
-              trigger: ['blur', 'change'],
-            },
-            {
-              validator: (rule, value, callback) => {
-                return uni.$u.test.email(value);
-              },
-              message: '您输入的邮箱不正确',
-              trigger: ['change', 'blur'],
+          {
+            validator: (rule, value, callback) => {
+              return uni.$u.test.email(value);
             },
-          ],
-          area: [{
+            message: '您输入的邮箱不正确',
+            trigger: ['change', 'blur'],
+          },
+        ],
+        area: [
+          {
             required: true,
             message: '请选择所在地区',
             trigger: ['change'],
-          }, ],
-        },
-        show: false, //显示选择器
-        // 打开选择器显示默认城市
-        cityList: [],
-        cityLevel1: [],
-        cityLevel2: [],
-        cityLevel3: [],
-      };
+          },
+        ],
+      },
+      show: false, //显示选择器
+      // 打开选择器显示默认城市
+      cityList: [],
+      cityLevel1: [],
+      cityLevel2: [],
+      cityLevel3: [],
+    };
+  },
+  onReady() {
+    //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
+    this.$refs.uForm.setRules(this.rules);
+  },
+  onShow() {
+    this.initCityData();
+  },
+  methods: {
+    initCityData() {
+      // 遍历城市js
+      cityData.forEach((item1, index1) => {
+        let temp2 = [];
+        this.cityLevel1.push(item1.provinceName);
+
+        let temp4 = [];
+        let temp3 = [];
+        // 遍历市
+        item1.cities.forEach((item2, index2) => {
+          temp2.push(item2.cityName);
+          // 遍历区
+          item2.counties.forEach((item3, index3) => {
+            temp3.push(item3.countyName);
+          });
+          temp4[index2] = temp3;
+          temp3 = [];
+        });
+        this.cityLevel3[index1] = temp4;
+        this.cityLevel2[index1] = temp2;
+      });
+      // 选择器默认城市
+      this.cityList.push(this.cityLevel1, this.cityLevel2[0], this.cityLevel3[0][0]);
     },
-    onReady() {
-      //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
-      this.$refs.uForm.setRules(this.rules);
+    // 选中时执行
+    changeHandler(e) {
+      const {
+        columnIndex,
+        index,
+        indexs,
+        value,
+        values,
+        // 微信小程序无法将picker实例传出来,只能通过ref操作
+        picker = this.$refs.uPicker,
+      } = e;
+      if (columnIndex === 0) {
+        // 选择第一列数据时 设置第二列关联数据
+        picker.setColumnValues(1, this.cityLevel2[index]);
+        // 设置第三列关联数据
+        picker.setColumnValues(2, this.cityLevel3[index][columnIndex]);
+      } else if (columnIndex === 1) {
+        // 选择第二列数据时 设置第三列关联数据
+        picker.setColumnValues(2, this.cityLevel3[indexs[0]][index]);
+      }
     },
-    onShow() {
-      this.initCityData();
+    // 单击确认按钮时执行
+    confirm(e) {
+      this.storeInfo.area = e.value.join('');
+      // 隐藏城市选择器
+      this.show = false;
     },
-    methods: {
-      initCityData() {
-        // 遍历城市js
-        cityData.forEach((item1, index1) => {
-          let temp2 = [];
-          this.cityLevel1.push(item1.provinceName);
-
-          let temp4 = [];
-          let temp3 = [];
-          // 遍历市
-          item1.cities.forEach((item2, index2) => {
-            temp2.push(item2.cityName);
-            // 遍历区
-            item2.counties.forEach((item3, index3) => {
-              temp3.push(item3.countyName);
-            });
-            temp4[index2] = temp3;
-            temp3 = [];
+    handlerChange() {
+      this.show = true;
+    },
+    handlerSkipNext() {
+      this.$refs.uForm.validate().then(res => {
+        this.$store.commit('SET_STOREINFO', this.storeInfo);
+        setTimeout(() => {
+          uni.navigateTo({
+            url: '/pages/merchant/mine/openStore/corporateInformation',
           });
-          this.cityLevel3[index1] = temp4;
-          this.cityLevel2[index1] = temp2;
-        });
-        // 选择器默认城市
-        this.cityList.push(this.cityLevel1, this.cityLevel2[0], this.cityLevel3[0][0]);
-      },
-      // 选中时执行
-      changeHandler(e) {
-        const {
-          columnIndex,
-          index,
-          indexs,
-          value,
-          values,
-          // 微信小程序无法将picker实例传出来,只能通过ref操作
-          picker = this.$refs.uPicker,
-        } = e;
-        if (columnIndex === 0) {
-          // 选择第一列数据时 设置第二列关联数据
-          picker.setColumnValues(1, this.cityLevel2[index]);
-          // 设置第三列关联数据
-          picker.setColumnValues(2, this.cityLevel3[index][columnIndex]);
-        } else if (columnIndex === 1) {
-          // 选择第二列数据时 设置第三列关联数据
-          picker.setColumnValues(2, this.cityLevel3[indexs[0]][index]);
-        }
-      },
-      // 单击确认按钮时执行
-      confirm(e) {
-        this.storeInfo.area = e.value.join('');
-        // 隐藏城市选择器
-        this.show = false;
-      },
-      handlerChange() {
-        this.show = true;
-      },
-      handlerSkipNext() {
-        this.$refs.uForm.validate().then(res => {
-          this.$store.commit('SET_STOREINFO', this.storeInfo);
-          setTimeout(() => {
-            uni.navigateTo({
-              url: '/pages/merchant/mine/openStore/corporateInformation',
-            });
-          }, 1500);
-        });
-      },
+        }, 1500);
+      });
+    },
+    // 图片
+    fileList(val, data) {
+      if (data == 1) {
+        this.storeInfo.shopFacade = val[0];
+      } else if (data == 2) {
+        this.storeInfo.realFacade = val[0];
+      }
     },
-  };
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-  .container {
-    background-color: #f7f7f7 !important;
-    padding-bottom: 40rpx;
+.container {
+  background-color: #f7f7f7 !important;
+  padding-bottom: 40rpx;
 
-    .top-box {
-      color: #666666;
-      font-size: 26rpx;
-      text-align: center;
-      padding: 20rpx 40rpx;
-      background-color: #fff;
-    }
-
-    .content-box {
-      padding: 20rpx 40rpx;
-      background-color: #fff;
-      margin: 10rpx 0;
+  .top-box {
+    color: #666666;
+    font-size: 26rpx;
+    text-align: center;
+    padding: 20rpx 40rpx;
+    background-color: #fff;
+  }
 
-      .content-item {
-        position: relative;
+  .content-box {
+    padding: 20rpx 40rpx;
+    background-color: #fff;
+    margin: 10rpx 0;
 
-        .item-r {
-          background-color: #f7f7f7;
-          border-radius: 20rpx;
-          display: flex;
+    .content-item {
+      position: relative;
 
-          .data_select {
-            width: 90%;
-          }
+      .item-r {
+        background-color: #f7f7f7;
+        border-radius: 20rpx;
+        display: flex;
 
-          ::v-deep .u-form-item {
-            width: 100%;
-          }
+        .data_select {
+          width: 90%;
+        }
 
-          ::v-deep .u-form-item__body {
-            padding: 0;
-          }
+        ::v-deep .u-form-item {
+          width: 100%;
         }
 
-        .icon-right-box {
-          position: absolute;
-          right: 15rpx;
-          top: 40rpx;
+        ::v-deep .u-form-item__body {
+          padding: 0;
         }
       }
 
-      .upload-text {
-        text-align: center;
-        color: #666666;
-        font-size: 28rpx;
-        margin-top: 20rpx;
+      .icon-right-box {
+        position: absolute;
+        right: 15rpx;
+        top: 40rpx;
       }
     }
 
-    .btn {
-      background-color: #5992bb !important;
-      color: #fff;
-      font-size: 32rpx;
-      border-radius: 40rpx;
-      margin-top: 100rpx;
-      margin-bottom: 100rpx;
-      width: 95%;
+    .upload-text {
+      text-align: center;
+      color: #666666;
+      font-size: 28rpx;
+      margin-top: 20rpx;
     }
   }
 
-  ::v-deep .uni-select {
-    border: none !important;
+  .btn {
+    background-color: #5992bb !important;
+    color: #fff;
+    font-size: 32rpx;
+    border-radius: 40rpx;
+    margin-top: 100rpx;
+    margin-bottom: 100rpx;
+    width: 95%;
   }
+}
 
-  ::v-deep .uni-select__input-placeholder {
-    font-size: 28rpx !important;
-    color: #cbced4 !important;
-  }
+::v-deep .uni-select {
+  border: none !important;
+}
+
+::v-deep .uni-select__input-placeholder {
+  font-size: 28rpx !important;
+  color: #cbced4 !important;
+}
 </style>

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

@@ -1,178 +0,0 @@
-<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>

+ 23 - 9
src/pages/merchant/store/index.vue

@@ -15,7 +15,7 @@
         <view>
           <view class="text-title">今日订单(单)</view>
           <!-- <view class="text-num">{{ orderCount }}</view> -->
-          <view class="text-num">{{ orderCount }}</view>
+          <view class="text-num">{{ store.score }}</view>
         </view>
       </view>
     </view>
@@ -122,9 +122,26 @@ export default {
           title: '预约列表',
         },
       ],
-      orderCount: 0
+      store: {
+        amount: 0,
+        orderCount: 0,
+        score: 0,
+      },
+
+      merchantId: '',
     };
   },
+  onShow() {
+    // 获取商家id
+    let merchantInfo = this.$store.state.data.merchantInfo;
+    this.merchantId = merchantInfo.merchant.id;
+
+    // 查商家端查询订单量以及今日收入
+    this.getOrderQuantity(this.merchantId);
+
+    console.log(this.merchantId, 'ooooooooooo');
+  },
+
   methods: {
     // 点击跳转
     handlerSkip(item, index) {
@@ -147,17 +164,14 @@ export default {
           break;
       }
     },
-    async getOrderQuantity() {
-      let res = await getOrderQuantityApi();
-
+    async getOrderQuantity(id) {
+      let res = await getOrderQuantityApi(id);
       if (res.code === 200) {
-        this.orderCount = res.data.orderCount;
+        // this.orderCount = res.data.orderCount;
+        this.store = Object.assign({}, { ...this.store }, { ...res.data });
       }
     },
   },
-  mounted() {
-    this.getOrderQuantity();
-  },
 };
 </script>
 

+ 0 - 47
src/store/modules/data copy.js

@@ -1,47 +0,0 @@
-import { setCache, getCache } from '@/utils/cache';
-
-export default {
-  state: () => ({
-    location: getCache('location') || {
-      longitude: 0,
-      latitude: 0,
-    },
-    categories: getCache('categories') || [],
-    merchantAuth: getCache('merchantAuth') || {
-      storeInfo: {}, //店铺信息
-      legalInfo: {}, //法人信息
-      aptitudeInfo: {}, //资质信息
-    },
-    // 商家个人信息
-    merchantInfo: getCache('merchantInfo') || {},
-  }),
-
-  mutations: {
-    SET_LOCATION(state, data) {
-      state.location = data;
-      setCache('location', state.location);
-    },
-    SET_CATEGORIES(state, data) {
-      state.categories = data;
-      setCache('categories', state.categories);
-    },
-    SET_STOREINFO(state, data) {
-      state.merchantAuth.storeInfo = data;
-      console.log(state.merchantAuth.storeInfo);
-      setCache('storeInfo', state.merchantAuth.storeInfo);
-    },
-    SET_LEGALINFO(state, data) {
-      state.merchantAuth.legalInfo = data;
-      setCache('legalInfo', state.merchantAuth.legalInfo);
-    },
-    SET_APTITUDEINFO(state, data) {
-      state.merchantAuth.aptitudeInfo = data;
-      setCache('aptitudeInfo', state.merchantAuth.aptitudeInfo);
-    },
-    SET_MERCHANTINFO(state, data) {
-      state.merchantInfo = data;
-      setCache('merchantInfo', state.merchantInfo);
-    },
-  },
-  actions: {},
-};

+ 2 - 2
src/utils/request.js

@@ -3,8 +3,8 @@ import {
 } from '@/utils/system';
 import store from '@/store';
 
-const BASE_URL = 'http://192.168.43.175:11000';
-// const BASE_URL = 'http://192.168.68.77:11000';
+// const BASE_URL = 'http://192.168.43.175:11000';
+const BASE_URL = 'http://192.168.68.77:11000';
 // const BASE_URL = 'https://test.api.chelvc.com';