Browse Source

style(client)我的界面样式优化

yizhiyang 10 months ago
parent
commit
ce9c63daa1

+ 46 - 0
src/components/base-card/base-card.vue

@@ -0,0 +1,46 @@
+<template>
+  <view class="base-card" :style="[cardStyle]">
+    <slot></slot>
+  </view>
+</template>
+
+<script>
+export default {
+  name: 'base-card',
+  props: {
+    padding: {
+      type: String,
+      default: '32rpx',
+    },
+    radius: {
+      type: String,
+      default: '16rpx',
+    },
+    shadow: {
+      type: String,
+      default: '',
+    },
+    marginBottom: {
+      type: String,
+      default: '',
+    },
+  },
+  computed: {
+    cardStyle() {
+      const { padding, radius, shadow, marginBottom } = this;
+      return {
+        padding,
+        borderRadius: radius,
+        boxShadow: shadow,
+        marginBottom,
+      };
+    },
+  },
+};
+</script>
+
+<style lang="scss">
+.base-card {
+  background-color: #fff;
+}
+</style>

+ 162 - 0
src/components/page-navbar/page-navbar.vue

@@ -0,0 +1,162 @@
+<template>
+  <view class="page-navbar">
+    <u-navbar
+      :safeAreaInsetTop="true"
+      :bgColor="backgroundColor"
+      :placeholder="true"
+      :title="title"
+      :titleStyle="titleStyle"
+      :titleWidth="titleWidth"
+    >
+      <view slot="left" class="u-nav-slot">
+        <template v-if="hasBack">
+          <template v-if="onlyHasBackHome">
+            <u-icon :color="iconColor" name="home" size="22" @click="handleGoHome()"></u-icon>
+          </template>
+          <template v-else>
+            <view
+              v-if="hasBackHome"
+              class="has-home u-nav-slot"
+              :style="{ borderColor: borderColor }"
+            >
+              <u-icon
+                :color="iconColor"
+                name="arrow-left"
+                size="22"
+                @click="handleGoBack(backUrl)"
+              ></u-icon>
+              <u-line
+                color="rgb(214, 215, 217)"
+                direction="column"
+                :hairline="false"
+                length="15"
+                margin="0 16rpx"
+              ></u-line>
+              <u-icon :color="iconColor" name="home" size="22" @click="handleGoHome()"></u-icon>
+            </view>
+            <u-icon
+              v-if="hasGoBack"
+              :color="iconColor"
+              name="arrow-left"
+              size="22"
+              @click="handleGoBack(backUrl)"
+            ></u-icon>
+          </template>
+        </template>
+      </view>
+    </u-navbar>
+  </view>
+</template>
+
+<script>
+export default {
+  props: {
+    title: {
+      type: String,
+      default: '',
+    },
+    titleSize: {
+      type: String,
+      default: '34rpx',
+    },
+    bgColor: {
+      type: String,
+      default: '#ffffff',
+    },
+    borderColor: {
+      type: String,
+      default: '#fff',
+    },
+    titleColor: {
+      type: String,
+      default: '#0C1223',
+    },
+    iconColor: {
+      type: String,
+      default: '#0C1223',
+    },
+    hasBack: {
+      // 是否有返回
+      type: Boolean,
+      default: true,
+    },
+    hasBackHome: {
+      // 是否有返回首页
+      type: Boolean,
+      default: false,
+    },
+    onlyHasBackHome: {
+      // 只有返回首页
+      type: Boolean,
+      default: false,
+    },
+    routeType: {
+      type: String,
+      default: 'switchTab', // navigateTo,redirectTo,switchTab,reLaunch
+    },
+    backUrl: {
+      type: String,
+      default: '',
+    },
+    titleWidth: {
+      type: String,
+      default: '350rpx', // 官方默认400rpx
+    },
+  },
+  data() {
+    return {};
+  },
+  computed: {
+    hasGoBack() {
+      // 是否有返回上一级
+      return !this.hasBackHome;
+    },
+    titleStyle() {
+      return {
+        fontSize: this.titleSize,
+        fontWeight: '600',
+        color: this.titleColor || '#333333',
+      };
+    },
+    backgroundColor() {
+      const color = this.hasBack ? '#fff' : 'transparent';
+      return this.bgColor || color;
+    },
+  },
+  methods: {
+    handleGoBack(backUrl = '') {
+      if (backUrl) {
+        uni.$u.route({
+          type: this.routeType,
+          url: backUrl,
+        });
+      } else {
+        uni.navigateBack();
+      }
+    },
+    handleGoHome() {
+      uni.$u.route({
+        type: 'switchTab',
+        url: '/pages/home/index',
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.page-navbar {
+  .u-nav-slot {
+    @include flex;
+    align-items: center;
+    justify-content: space-between;
+  }
+
+  .has-home {
+    border: 1rpx solid #fff;
+    border-radius: 200rpx;
+    padding: 6rpx 12rpx;
+    opacity: 0.8;
+  }
+}
+</style>

+ 5 - 0
src/design/common.css

@@ -1,6 +1,7 @@
 /* ======================================
                flex弹性布局
  ====================================== */
+
 .fl-flex {
   display: flex;
 }
@@ -105,4 +106,8 @@
 
 .text-white {
   color: #ffffff;
+}
+
+.text-primary {
+  color: #0C1223
 }

+ 13 - 0
src/design/index.scss

@@ -114,3 +114,16 @@
     }
   }
 }
+
+/*==================================================================
+                  字体粗细程度
+  =================================================================*/
+@each $i in 200, 300, 400, 500, 600, 700, 800, 900 {
+  .u-font-#{$i} {
+    font-weight: $i;
+
+    .u-count-num {
+      font-weight: $i !important;
+    }
+  }
+}

+ 97 - 0
src/mixin/list.js

@@ -0,0 +1,97 @@
+//别动我代码: list mixin
+module.exports = {
+  onShow() {
+    // console.log('list mixin show');
+  },
+  onReady() {},
+  onReachBottom() {
+    this.loadData();
+  },
+  data() {
+    return {
+      total: 0,
+      listData: [],
+      loadmoreStatus: 'loadmore', // loadmore loading nomore
+      page: {
+        page: 1,
+        size: 10,
+      },
+      queryData: {},
+    };
+  },
+  methods: {
+    // 分页初始化数据isUp是否为上拉加载,默认false
+    initDataList(searchData = {}, isUp = false) {
+      this.isListLoading = true;
+      uni.showLoading({
+        title: '加载中',
+        mask: true,
+      });
+      this.queryData = searchData;
+      if (!isUp) this.page.page = 1;
+      this.listApiName({
+        search: searchData,
+        page: this.page,
+      })
+        .then(res => {
+          if (isUp) {
+            this.listData = this.listData.concat(res.data);
+          } else {
+            this.listData = res.data;
+            // this.loadmoreStatus = 'nomore'
+          }
+          this.total = res.page.total;
+
+          if (this.listData.length < this.total) {
+            this.loadmoreStatus = 'loadmore';
+          } else {
+            this.loadmoreStatus = 'nomore';
+          }
+        })
+        .catch(err => {
+          throw err;
+        })
+        .finally(() => {
+          this.isListLoading = false;
+          setTimeout(() => {
+            uni.hideLoading();
+          }, 1000);
+        });
+    },
+    //加载列表,上滑加载
+    loadData() {
+      this.loadmoreStatus = 'loading';
+      if (this.listData.length < this.total) {
+        this.page.page++;
+        this.initDataList(this.queryData, true);
+      } else {
+        this.page.page = 1;
+        this.loadmoreStatus = 'nomore';
+      }
+    },
+    getListData(apiName, reqData, isLoadmore = false, isSearch = false) {
+      uni.y.showLoading('加载中');
+      this.loadmoreStatus = 'loading'; // 加载中
+      this[apiName](reqData)
+        .then(res => {
+          const listData = res.data || {};
+          const listTotal = res.page.total || 0;
+          if (isLoadmore) {
+            this.listData = this.listData.concat(listData);
+          } else {
+            this.listData = listData;
+          }
+          this.listTotal = listTotal;
+          if (this.listData.length === listTotal) {
+            this.loadmoreStatus = 'nomore';
+          } else {
+            this.loadmoreStatus = 'loadmore';
+          }
+          uni.hideLoading(1000);
+        })
+        .catch(() => {
+          uni.hideLoading(2000);
+        });
+    },
+  },
+};

+ 437 - 445
src/pageMerchant/mineModule/certification/storeInformation.vue

@@ -79,7 +79,7 @@
 					</u-form-item>
 				</view>
 				<view class="content-item">
-					<u-form-item prop="ancillaryBusiness" required label="辅营业务" right>
+					<u-form-item prop="ancillaryBusiness"  label="辅营业务" right>
 						<view class="item-r">
 
 							<!-- #ifndef APP-NVUE -->
@@ -136,451 +136,443 @@
 </template>
 
 <script>
-	import ImgsUpload from './components/ImgsUpload.vue';
-	// 导入城市js文件
-	import cityData from '@/utils/city';
-	import {
-		getParentCategoriesData,
-		getRootCategoriesData
-	} from '@/api/merchant/merchantAuth';
-
-	export default {
-		components: {
-			ImgsUpload,
-		},
-		data() {
-			return {
-				storeAddress: "",
-				mainBusinessName: "", // 主营业务,
-				ancillaryBusinessName: [], // 辅营业务
-
-				mainBusinessList: [], // 主营业务下拉数组
-				ancillaryBusinessList: [], // 辅营业务数组
-				storeInfo: {
-					region: '',
-					storeAddressDetail: '',
-					legalRepresentativeName: '',
-					mobileNumber: '',
-					storeName: '',
-					storeImage: '',
-					storeInnerImage: [],
-					email: "",
-					longitude: '',
-					latitude: '',
-					opening: '',
-					city: "",
-					province: "",
-					district: "",
-					mainBusiness: "", // 主营业务,
-					ancillaryBusiness: [], // 辅营业务
-				},
-				rules: {
-					opening: {
-						type: 'string',
-						required: true,
-						message: '请输入营业时间',
-						trigger: ['blur', 'change'],
-					},
-					legalRepresentativeName: {
-						type: 'string',
-						required: true,
-						message: '请输入负责人名称',
-						trigger: ['blur', 'change'],
-					},
-					storeName: {
-						type: 'string',
-						required: true,
-						message: '请输入店铺名',
-						trigger: ['blur', 'change'],
-					},
-					storeAddressDetail: {
-						type: 'string',
-						required: true,
-						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'],
-						},
-					],
-					region: [{
-						required: true,
-						message: '请选择所在地区',
-						trigger: ['change'],
-					}, ],
-					mainBusiness: [{
-						required: true,
-						message: '请选择主营业务',
-						trigger: ['change'],
-					}, ],
-					// ancillaryBusiness: [{
-					// 	type: 'string',
-					// 	required: true,
-					// 	message: '请输入详细地址',
-					// 	trigger: ['blur', 'change'],
-					// }, ],
-				},
-				show: false, //显示选择器
-				// 打开选择器显示默认城市
-				cityList: [], // 选择地区数组
-				cityLevel1: [],
-				cityLevel2: [],
-				cityLevel3: [],
-
-				list: [], // 数组控制器
-
-
-			};
-		},
-		onReady() {
-			//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
-			this.$refs.uForm.setRules(this.rules);
-		},
-		created() {
-			this.request()
-		},
-		onLoad() {
-			if (this.$store.state.data.merchantInfo) {
-				console.log(this.$store.state.data.merchantInfo, "this.$store.state.data.merchantInfo")
-				this.storeInfo = {
-					region: this.$store.state.data.merchantInfo.merchant.region,
-					storeAddressDetail: this.$store.state.data.merchantInfo.storeAddressDetail,
-					legalRepresentativeName: this.$store.state.data.merchantInfo.legalRepresentativeName,
-					mobileNumber: this.$store.state.data.merchantInfo.mobileNumber,
-					storeName: this.$store.state.data.merchantInfo.storeName,
-					storeImage: this.$store.state.data.merchantInfo.storeImage,
-					storeInnerImage: this.$store.state.data.merchantInfo.storeInnerImage,
-					email: this.$store.state.data.merchantInfo.email,
-					longitude: this.$store.state.data.merchantInfo.merchant.longitude,
-					latitude: this.$store.state.data.merchantInfo.merchant.latitude,
-					opening: this.$store.state.data.merchantInfo.merchant.opening,
-
-					city: this.$store.state.data.merchantInfo.merchant.region.toString().slice(0, -2) + "00",
-					province: this.$store.state.data.merchantInfo.merchant.region.toString().slice(0, -4) + "0000",
-					district: this.$store.state.data.merchantInfo.merchant.region,
-					mainBusiness: this.$store.state.data.merchantInfo.merchant.mainBusiness, // 主营业务,
-					ancillaryBusiness: this.$store.state.data.merchantInfo.merchant.ancillaryBusiness, // 辅营业务
-				}
-				this.storeAddress = this.findAreaByCode(this.$store.state.data.merchantInfo.merchant.region)
-			}
-		},
-		onShow() {
-			this.initCityData();
-		},
-
-		methods: {
-
-			async request() {
-				const res = await getParentCategoriesData({
-					type: "0"
-				})
-				this.mainBusinessList = res.data.map((item) => {
-					return {
-						name: item.name,
-						id: item.id
-					}
-				})
-				const res1 = await getRootCategoriesData({
-					type: "0"
-				})
-				this.ancillaryBusinessList = res1.data.map((item) => {
-					return {
-						name: item.name,
-						id: item.id,
-						status: 1
-					}
-				})
-				if (this.$store.state.data.merchantInfo) {
-
-					this.mainBusinessName = this.nameFunction([this.$store.state.data.merchantInfo.merchant
-							.mainBusiness
-						],
-						this
-						.mainBusinessList)
-					this.ancillaryBusinessName = this.nameFunction(this.$store.state.data.merchantInfo.merchant
-						.ancillaryBusiness, this.ancillaryBusinessList)
-				}
-
-				console.log(this.ancillaryBusinessList, "这是请i去的")
-			},
-			// 手动选择城市
-			manualGetLocation() {
-				uni.chooseLocation({
-					success: res => {
-						console.log(res, "点击获取的")
-						let {
-							longitude,
-							latitude
-						} = res;
-						console.log(this.stereInfo, "this")
-						this.storeInfo.longitude = parseFloat(longitude.toFixed(5))
-						this.storeInfo.latitude = parseFloat(latitude.toFixed(5));
-						this.storeInfo.storeAddressDetail = res.address
-
-
-					},
-					fail: err => {},
-				});
-			},
-			initCityData() {
-				// 遍历城市js
-				cityData.forEach((item1, index1) => {
-					let temp2 = [];
-					this.cityLevel1.push({
-						name: item1.provinceName,
-						id: item1.provinceCode
-					});
-
-					let temp4 = [];
-					let temp3 = [];
-					// 遍历市
-					item1.cities.forEach((item2, index2) => {
-						temp2.push({
-							name: item2.cityName,
-							id: item2.cityCode
-						});
-						// 遍历区
-						item2.counties.forEach((item3, index3) => {
-							temp3.push({
-								name: item3.countyName,
-								id: item3.countyCode
-							});
-						});
-						temp4[index2] = temp3;
-						temp3 = [];
-					});
-					this.cityLevel3[index1] = temp4;
-					this.cityLevel2[index1] = temp2;
-				});
-				// 选择器默认城市
-				this.cityList.push(this.cityLevel1, this.cityLevel2[0], this.cityLevel3[0][0]);
-				console.log(this.cityList, "this.cityList")
-			},
-			// 选中时执行
-			changeHandler(e) {
-				if (this.list.length > 1) {
-					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) {
-				if (e.value.length > 1) {
-					this.storeInfo.province = parseInt(e.value[0].id, 10)
-					this.storeInfo.city = parseInt(e.value[1].id, 10)
-					this.storeInfo.district = parseInt(e.value[2].id, 10)
-					this.storeInfo.region = parseInt(e.value[2].id, 10)
-					this.storeAddress = e.value.map(item => item.name).join('')
-					// 隐藏城市选择器
-				} else {
-					if (e.value[0].status && e.value[0].status == 1) {
-						this.ancillaryBusinessName.push(e.value[0].name)
-						this.storeInfo.ancillaryBusiness.push(e.value[0].id)
-					} else {
-						this.mainBusinessName = e.value[0].name
-						this.storeInfo.mainBusiness = e.value[0].id
-					}
-				}
-				this.show = false;
-			},
-			// 点击选择地区
-			handlerChange() {
-				this.list = this.cityList
-				this.show = true;
-			},
-			//点击选择主营业务
-			handlerChangeMainBusiness() {
-				this.list = [this.mainBusinessList]
-				this.show = true;
-			},
-			//点击选择辅营业务
-			handlerChangeAncillaryBusiness() {
-				console.log("asdsd")
-				this.list = [this.ancillaryBusinessList]
-				console.log(this.list)
-				this.show = true;
-			},
-			//点击清空按钮
-			ancillaryBusinessClear() {
-				this.ancillaryBusinessName = []
-				this.storeInfo.ancillaryBusiness = []
-			},
-			handlerSkipNext() {
-				this.$refs.uForm.validate().then(res => {
-					this.$store.commit('SET_STOREINFO', this.storeInfo);
-					setTimeout(() => {
-						uni.navigateTo({
-							url: '/pageMerchant/mineModule/certification/corporateInformation',
-						});
-					}, 1500);
-				});
-			},
-			// 图片
-			fileList(val, data) {
-				console.log(data, "data")
-				if (data == 1) {
-					this.storeInfo.storeImage = val[0];
-				} else if (data == 2) {
-					this.storeInfo.storeInnerImage = val.map((item) => {
-						return {
-							url: item,
-							media: "IMAGE"
-						}
-					})
-				}
-			},
-
-			//回显时展示的
-			nameFunction(idArray, services) {
-				let nameString = ''
-				if (idArray.length > 1) {
-					nameString = idArray
-						.map(id => services.find(service => service.id == id))
-						.filter(service => service)
-						.map(service => service.name);
-				} else {
-
-					nameString = idArray
-						.map(id => services.find(service => service.id == id))
-						.filter(service => service)
-						.map(service => service.name)
-						.join(',');
-
-				}
-				return nameString;
-			},
-			findAreaByCode(areaCode) {
-				for (const province of cityData) {
-					if (province.provinceCode == areaCode) {
-						return `${province.provinceName}`;
-					}
-					for (const city of province.cities) {
-						if (city.cityCode == areaCode) {
-							return `${province.provinceName} - ${city.cityName}`;
-						}
-						const county = city.counties.find(item => item.countyCode == areaCode);
-						if (county) {
-							return `${province.provinceName}  ${city.cityName}  ${county.countyName}`;
-						}
-					}
-				}
-				return '未找到对应地区';
-			}
-
-		},
-	};
+import ImgsUpload from './components/ImgsUpload.vue';
+// 导入城市js文件
+import cityData from '@/utils/city';
+import { getParentCategoriesData, getRootCategoriesData } from '@/api/merchant/merchantAuth';
+
+export default {
+  components: {
+    ImgsUpload,
+  },
+  data() {
+    return {
+      storeAddress: '',
+      mainBusinessName: '', // 主营业务,
+      ancillaryBusinessName: [], // 辅营业务
+
+      mainBusinessList: [], // 主营业务下拉数组
+      ancillaryBusinessList: [], // 辅营业务数组
+      storeInfo: {
+        region: '',
+        storeAddressDetail: '',
+        legalRepresentativeName: '',
+        mobileNumber: '',
+        storeName: '',
+        storeImage: '',
+        storeInnerImage: [],
+        email: '',
+        longitude: '',
+        latitude: '',
+        opening: '',
+        city: '',
+        province: '',
+        district: '',
+        mainBusiness: '', // 主营业务,
+        ancillaryBusiness: [], // 辅营业务
+      },
+      rules: {
+        opening: {
+          type: 'string',
+          required: true,
+          message: '请输入营业时间',
+          trigger: ['blur', 'change'],
+        },
+        legalRepresentativeName: {
+          type: 'string',
+          required: true,
+          message: '请输入负责人名称',
+          trigger: ['blur', 'change'],
+        },
+        storeName: {
+          type: 'string',
+          required: true,
+          message: '请输入店铺名',
+          trigger: ['blur', 'change'],
+        },
+        storeAddressDetail: {
+          type: 'string',
+          required: true,
+          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'],
+          },
+        ],
+        region: [
+          {
+            required: true,
+            message: '请选择所在地区',
+            trigger: ['change'],
+          },
+        ],
+        mainBusiness: [
+          {
+            required: true,
+            message: '请选择主营业务',
+            trigger: ['change'],
+          },
+        ],
+        // ancillaryBusiness: [{
+        // 	type: 'string',
+        // 	required: true,
+        // 	message: '请输入详细地址',
+        // 	trigger: ['blur', 'change'],
+        // }, ],
+      },
+      show: false, //显示选择器
+      // 打开选择器显示默认城市
+      cityList: [], // 选择地区数组
+      cityLevel1: [],
+      cityLevel2: [],
+      cityLevel3: [],
+
+      list: [], // 数组控制器
+    };
+  },
+  onReady() {
+    //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
+    this.$refs.uForm.setRules(this.rules);
+  },
+  created() {
+    this.request();
+  },
+  onLoad() {
+    if (this.$store.state.data.merchantInfo) {
+      console.log(this.$store.state.data.merchantInfo, 'this.$store.state.data.merchantInfo');
+      this.storeInfo = {
+        region: this.$store.state.data.merchantInfo.merchant.region,
+        storeAddressDetail: this.$store.state.data.merchantInfo.storeAddressDetail,
+        legalRepresentativeName: this.$store.state.data.merchantInfo.legalRepresentativeName,
+        mobileNumber: this.$store.state.data.merchantInfo.mobileNumber,
+        storeName: this.$store.state.data.merchantInfo.storeName,
+        storeImage: this.$store.state.data.merchantInfo.storeImage,
+        storeInnerImage: this.$store.state.data.merchantInfo.storeInnerImage,
+        email: this.$store.state.data.merchantInfo.email,
+        longitude: this.$store.state.data.merchantInfo.merchant.longitude,
+        latitude: this.$store.state.data.merchantInfo.merchant.latitude,
+        opening: this.$store.state.data.merchantInfo.merchant.opening,
+
+        city: this.$store.state.data.merchantInfo.merchant.region.toString().slice(0, -2) + '00',
+        province:
+          this.$store.state.data.merchantInfo.merchant.region.toString().slice(0, -4) + '0000',
+        district: this.$store.state.data.merchantInfo.merchant.region,
+        mainBusiness: this.$store.state.data.merchantInfo.merchant.mainBusiness, // 主营业务,
+        ancillaryBusiness: this.$store.state.data.merchantInfo.merchant.ancillaryBusiness, // 辅营业务
+      };
+      this.storeAddress = this.findAreaByCode(this.$store.state.data.merchantInfo.merchant.region);
+    }
+  },
+  onShow() {
+    this.initCityData();
+  },
+
+  methods: {
+    async request() {
+      const res = await getParentCategoriesData({
+        type: '0',
+      });
+      this.mainBusinessList = res.data.map(item => {
+        return {
+          name: item.name,
+          id: item.id,
+        };
+      });
+      const res1 = await getRootCategoriesData({
+        type: '0',
+      });
+      this.ancillaryBusinessList = res1.data.map(item => {
+        return {
+          name: item.name,
+          id: item.id,
+          status: 1,
+        };
+      });
+      if (this.$store.state.data.merchantInfo) {
+        this.mainBusinessName = this.nameFunction(
+          [this.$store.state.data.merchantInfo.merchant.mainBusiness],
+          this.mainBusinessList,
+        );
+        this.ancillaryBusinessName = this.nameFunction(
+          this.$store.state.data.merchantInfo.merchant.ancillaryBusiness,
+          this.ancillaryBusinessList,
+        );
+      }
+
+      console.log(this.ancillaryBusinessList, '这是请i去的');
+    },
+    // 手动选择城市
+    manualGetLocation() {
+      uni.chooseLocation({
+        success: res => {
+          console.log(res, '点击获取的');
+          let { longitude, latitude } = res;
+          console.log(this.stereInfo, 'this');
+          this.storeInfo.longitude = parseFloat(longitude.toFixed(5));
+          this.storeInfo.latitude = parseFloat(latitude.toFixed(5));
+          this.storeInfo.storeAddressDetail = res.address;
+        },
+        fail: err => {},
+      });
+    },
+    initCityData() {
+      // 遍历城市js
+      cityData.forEach((item1, index1) => {
+        let temp2 = [];
+        this.cityLevel1.push({
+          name: item1.provinceName,
+          id: item1.provinceCode,
+        });
+
+        let temp4 = [];
+        let temp3 = [];
+        // 遍历市
+        item1.cities.forEach((item2, index2) => {
+          temp2.push({
+            name: item2.cityName,
+            id: item2.cityCode,
+          });
+          // 遍历区
+          item2.counties.forEach((item3, index3) => {
+            temp3.push({
+              name: item3.countyName,
+              id: item3.countyCode,
+            });
+          });
+          temp4[index2] = temp3;
+          temp3 = [];
+        });
+        this.cityLevel3[index1] = temp4;
+        this.cityLevel2[index1] = temp2;
+      });
+      // 选择器默认城市
+      this.cityList.push(this.cityLevel1, this.cityLevel2[0], this.cityLevel3[0][0]);
+      console.log(this.cityList, 'this.cityList');
+    },
+    // 选中时执行
+    changeHandler(e) {
+      if (this.list.length > 1) {
+        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) {
+      if (e.value.length > 1) {
+        this.storeInfo.province = parseInt(e.value[0].id, 10);
+        this.storeInfo.city = parseInt(e.value[1].id, 10);
+        this.storeInfo.district = parseInt(e.value[2].id, 10);
+        this.storeInfo.region = parseInt(e.value[2].id, 10);
+        this.storeAddress = e.value.map(item => item.name).join('');
+        // 隐藏城市选择器
+      } else {
+        if (e.value[0].status && e.value[0].status == 1) {
+          this.ancillaryBusinessName.push(e.value[0].name);
+          this.storeInfo.ancillaryBusiness.push(e.value[0].id);
+        } else {
+          this.mainBusinessName = e.value[0].name;
+          this.storeInfo.mainBusiness = e.value[0].id;
+        }
+      }
+      this.show = false;
+    },
+    // 点击选择地区
+    handlerChange() {
+      this.list = this.cityList;
+      this.show = true;
+    },
+    //点击选择主营业务
+    handlerChangeMainBusiness() {
+      this.list = [this.mainBusinessList];
+      this.show = true;
+    },
+    //点击选择辅营业务
+    handlerChangeAncillaryBusiness() {
+      console.log('asdsd');
+      this.list = [this.ancillaryBusinessList];
+      console.log(this.list);
+      this.show = true;
+    },
+    //点击清空按钮
+    ancillaryBusinessClear() {
+      this.ancillaryBusinessName = [];
+      this.storeInfo.ancillaryBusiness = [];
+    },
+    handlerSkipNext() {
+      this.$refs.uForm.validate().then(res => {
+        this.$store.commit('SET_STOREINFO', this.storeInfo);
+        setTimeout(() => {
+          uni.navigateTo({
+            url: '/pageMerchant/mineModule/certification/corporateInformation',
+          });
+        }, 1500);
+      });
+    },
+    // 图片
+    fileList(val, data) {
+      console.log(data, 'data');
+      if (data == 1) {
+        this.storeInfo.storeImage = val[0];
+      } else if (data == 2) {
+        this.storeInfo.storeInnerImage = val.map(item => {
+          return {
+            url: item,
+            media: 'IMAGE',
+          };
+        });
+      }
+    },
+
+    //回显时展示的
+    nameFunction(idArray, services) {
+      let nameString = '';
+      if (idArray.length > 1) {
+        nameString = idArray
+          .map(id => services.find(service => service.id == id))
+          .filter(service => service)
+          .map(service => service.name);
+      } else {
+        nameString = idArray
+          .map(id => services.find(service => service.id == id))
+          .filter(service => service)
+          .map(service => service.name)
+          .join(',');
+      }
+      return nameString;
+    },
+    findAreaByCode(areaCode) {
+      for (const province of cityData) {
+        if (province.provinceCode == areaCode) {
+          return `${province.provinceName}`;
+        }
+        for (const city of province.cities) {
+          if (city.cityCode == areaCode) {
+            return `${province.provinceName} - ${city.cityName}`;
+          }
+          const county = city.counties.find(item => item.countyCode == areaCode);
+          if (county) {
+            return `${province.provinceName}  ${city.cityName}  ${county.countyName}`;
+          }
+        }
+      }
+      return '未找到对应地区';
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.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;
-
-			.content-item {
-				position: relative;
-
-				.item-r {
-					background-color: #f7f7f7;
-					border-radius: 20rpx;
-					display: flex;
-
-					.data_select {
-						width: 90%;
-					}
-
-					::v-deep .u-form-item {
-						width: 100%;
-					}
-
-					::v-deep .u-form-item__body {
-						padding: 0;
-					}
-				}
-
-				.icon-right-box {
-					position: absolute;
-					right: 15rpx;
-					top: 40rpx;
-				}
-			}
-
-			.upload-text {
-				text-align: center;
-				color: #666666;
-				font-size: 28rpx;
-				margin-top: 20rpx;
-			}
-		}
-
-		.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 {
-		border: none !important;
-	}
-
-	::v-deep .uni-select__input-placeholder {
-		font-size: 28rpx !important;
-		color: #cbced4 !important;
-	}
+.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;
+
+    .content-item {
+      position: relative;
+
+      .item-r {
+        background-color: #f7f7f7;
+        border-radius: 20rpx;
+        display: flex;
+
+        .data_select {
+          width: 90%;
+        }
+
+        ::v-deep .u-form-item {
+          width: 100%;
+        }
+
+        ::v-deep .u-form-item__body {
+          padding: 0;
+        }
+      }
+
+      .icon-right-box {
+        position: absolute;
+        right: 15rpx;
+        top: 40rpx;
+      }
+    }
+
+    .upload-text {
+      text-align: center;
+      color: #666666;
+      font-size: 28rpx;
+      margin-top: 20rpx;
+    }
+  }
+
+  .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 {
+  border: none !important;
+}
+
+::v-deep .uni-select__input-placeholder {
+  font-size: 28rpx !important;
+  color: #cbced4 !important;
+}
 </style>

+ 500 - 490
src/pages.json

@@ -1,491 +1,501 @@
 {
-	"easycom": {
-		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
-	},
-	"pages": [{
-			"path": "pages/tabbar/home",
-			"style": {
-				"navigationBarTitleText": "",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path": "pages/login/login",
-			"style": {
-				"navigationBarTitleText": "登录",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path": "pages/login/phoneLogin",
-			"style": {
-				"navigationBarTitleText": "账号登录"
-			}
-		},
-		{
-			"path": "pages/webview/index",
-			"style": {
-				"navigationBarTitleText": ""
-			}
-		},
-		{
-			"path": "pages/tabbar/community",
-			"style": {
-				"navigationBarTitleText": "",
-				"navigationStyle": "custom",
-				"enablePullDownRefresh": true,
-				"onReachBottomDistance": 50
-			}
-		},
-		{
-			"path": "pages/tabbar/message",
-			"style": {
-				"navigationBarTitleText": "",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path": "pages/tabbar/mine",
-			"style": {
-				"navigationBarTitleText": "",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path": "pages/tabbar/promotionCode",
-			"style": {
-				"navigationBarTitleText": "",
-				"navigationStyle": "custom"
-			}
-		}
-	],
-	"subPackages": [{
-			"root": "pagesHome",
-			"pages": [{
-					"path": "homeSearch",
-					"style": {
-						"navigationBarTitleText": "商品搜索"
-					}
-				},
-				{
-					"path": "home/popularRecommend",
-					"style": {
-						"navigationBarTitleText": "热门推荐",
-						"onReachBottomDistance": 0
-					}
-				},
-				{
-					"path": "home/nearbyBusiness",
-					"style": {
-						"navigationBarTitleText": "附近商家",
-						"onReachBottomDistance": 0
-					}
-				},
-				{
-					"path": "marketer/index",
-					"style": {
-						"navigationBarTitleText": "商家详情"
-					}
-				},
-				{
-					"path": "marketer/productDetail",
-					"style": {
-						"navigationBarTitleText": "商品详情"
-					}
-				},
-				{
-					"path": "marketer/settleOrder",
-					"style": {
-						"navigationBarTitleText": "结算订单"
-					}
-				},
-				{
-					"path": "marketer/submitOrder",
-					"style": {
-						"navigationBarTitleText": "提交订单"
-					}
-				},
-				{
-					"path": "marketer/settleStatus",
-					"style": {
-						"navigationBarTitleText": "结算状态"
-					}
-				},
-				{
-					"path": "category/index",
-					"style": {
-						"navigationBarTitleText": "商品类型"
-					}
-				},
-				{
-					"path": "category/categoryStoreList",
-					"style": {
-						"navigationBarTitleText": "商品列表"
-					}
-				}
-			]
-		},
-		{
-			"root": "pagesCustomer",
-			"pages": [{
-				"path": "communityPostReview",
-				"style": {
-					"navigationBarTitleText": "发布评论"
-				}
-			}]
-		},
-		{
-			"root": "pagesMessage",
-			"pages": [{
-					"path": "orderNotify",
-					"style": {
-						"navigationBarTitleText": "订单通知"
-					}
-				},
-				{
-					"path": "commentNotify",
-					"style": {
-						"navigationBarTitleText": "评论通知"
-					}
-				},
-				{
-					"path": "kudosNotify",
-					"style": {
-						"navigationBarTitleText": "点赞通知"
-					}
-				},
-				{
-					"path": "benefitsNotify",
-					"style": {
-						"navigationBarTitleText": "优惠福利"
-					}
-				}
-			]
-		},
-		{
-			"root": "PageMine",
-			"pages": [{
-					"path": "orderModules/index",
-					"style": {
-						"navigationBarTitleText": "我的订单"
-					}
-				},
-				{
-					"path": "orderModules/orderDetail",
-					"style": {
-						"navigationBarTitleText": "订单详情"
-					}
-				},
-        {
-        	"path": "orderModules/orderReserve",
-        	"style": {
-        		"navigationBarTitleText": "订单预约"
-        	}
-        },
-        {
-        	"path": "orderModules/orderReserveSuccess",
-        	"style": {
-        		"navigationBarTitleText": "预约成功",
-            "navigationStyle": "custom"
-        	}
-        },
-				{
-					"path": "orderModules/orderComment",
-					"style": {
-						"navigationBarTitleText": "订单评价"
-					}
-				},
-				{
-					"path": "favourite",
-					"style": {
-						"navigationBarTitleText": "收藏列表"
-					}
-				},
-				{
-					"path": "shopCar",
-					"style": {
-						"navigationBarTitleText": "购物车"
-					}
-				},
-				{
-					"path": "coupon",
-					"style": {
-						"navigationBarTitleText": "优惠券列表"
-					}
-				},
-				{
-					"path": "goodsReserve",
-					"style": {
-						"navigationBarTitleText": "商品预约"
-					}
-				},
-				{
-					"path": "myTeam",
-					"style": {
-						"navigationBarTitleText": "我的团队"
-					}
-				},
-				{
-					"path": "serviceCenter/index",
-					"style": {
-						"navigationBarTitleText": "客服中心"
-					}
-				},
-				{
-					"path": "serviceCenter/serviceDetail",
-					"style": {
-						"navigationBarTitleText": "问题详情"
-					}
-				},
-				{
-					"path": "feedback",
-					"style": {
-						"navigationBarTitleText": "意见反馈"
-					}
-				},
-				{
-					"path": "aboutUs",
-					"style": {
-						"navigationBarTitleText": "关于我们"
-					}
-				},
-				{
-					"path": "setting/index",
-					"style": {
-						"navigationBarTitleText": "设置"
-					}
-				},
-				{
-					"path": "setting/personInformation",
-					"style": {
-						"navigationBarTitleText": "个人信息"
-					}
-				},
-				{
-					"path": "setting/aboutUs",
-					"style": {
-						"navigationBarTitleText": "关于我们"
-					}
-				},
-				{
-					"path": "profit/index",
-					"style": {
-						"navigationBarTitleText": "提现"
-					}
-				},
-				{
-					"path": "profit/withdraw",
-					"style": {
-						"navigationBarTitleText": "提现"
-					}
-				}
-			]
-		},
-		{
-			"root": "pageMerchant",
-			"pages": [{
-					"path": "index",
-					"style": {
-						"navigationBarTitleText": "",
-						"navigationStyle": "custom"
-					}
-				},
-				{
-					"path": "mineModule/personalInfo",
-					"style": {
-						"navigationBarTitleText": "店铺信息"
-					}
-				},
-				{
-					"path": "mineModule/storeEnviron",
-					"style": {
-						"navigationBarTitleText": "门店环境"
-					}
-				},
-				{
-					"path": "mineModule/openStoreAppealDetail",
-					"style": {
-						"navigationBarTitleText": "资质信息"
-					}
-				},
-				{
-					"path": "mineModule/certification/index",
-					"style": {
-						"navigationBarTitleText": "我要开店"
-					}
-				},
-				{
-					"path": "mineModule/certification/storeInformation",
-					"style": {
-						"navigationBarTitleText": "1/3门店信息"
-					}
-				},
-				{
-					"path": "mineModule/certification/corporateInformation",
-					"style": {
-						"navigationBarTitleText": "2/3法人信息"
-					}
-				},
-				{
-					"path": "mineModule/certification/qualificationInformation",
-					"style": {
-						"navigationBarTitleText": "2/3资质信息"
-					}
-				},
-				{
-					"path": "mineModule/certification/messageSubmit",
-					"style": {
-						"navigationBarTitleText": "审核信息",
-						"navigationStyle": "default",
-						"disableBack": true
-					}
-				},
-				{
-					"path": "mineModule/certification/openStoreAppealDetail",
-					"style": {
-						"navigationBarTitleText": "资质信息"
-					}
-				},
-				{
-					"path": "mineModule/setting/index",
-					"style": {
-						"navigationBarTitleText": "设置"
-					}
-				},
-				{
-					"path": "storeModule/appointList",
-					"style": {
-						"navigationBarTitleText": "预约列表"
-					}
-				},
-				{
-					"path": "storeModule/couponManage",
-					"style": {
-						"navigationBarTitleText": "商品优惠"
-					}
-				},
-				{
-					"path": "storeModule/evaluateBack",
-					"style": {
-						"navigationBarTitleText": "回复评价"
-					}
-				},
-				{
-					"path": "storeModule/evaluateManagement",
-					"style": {
-						"navigationBarTitleText": "评价管理"
-					}
-				},
-				{
-					"path": "storeModule/myTeam",
-					"style": {
-						"navigationBarTitleText": "我的团队"
-					}
-				},
-				{
-					"path": "storeModule/shopManage",
-					"style": {
-						"navigationBarTitleText": "店铺管理"
-					}
-				},
-				{
-					"path": "storeModule/commodityWriteOff",
-					"style": {
-						"navigationBarTitleText": "商品核销"
-					}
-				},
-				{
-					"path": "storeModule/components/queryWriteOff",
-					"style": {
-						"navigationBarTitleText": "查询核销"
-					}
-				},
-				{
-					"path": "storeModule/components/verificationList",
-					"style": {
-						"navigationBarTitleText": "核销记录"
-					}
-				},
-				{
-					"path" : "components/orderDetail",
-					"style" : 
-					{
-						"navigationBarTitleText" : "订单详情"
-					}
-				},
-				{
-					"path" : "components/toBeVerified",
-					"style" : 
-					{
-						"navigationBarTitleText" : "待核销"
-					}
-				},
-				{
-					"path" : "storeModule/components/verificationStatus",
-					"style" : 
-					{
-						"navigationBarTitleText" : "核销状态",
-						  "navigationStyle": "custom"
-					}
-				},
-				{
-					"path" : "mineModule/myPurse/purse",
-					"style" : 
-					{
-						"navigationBarTitleText" : "我的钱包"
-					}
-				}
-			]
-		}
-	],
-	"tabBar": {
-		"color": "#000000",
-		"selectedColor": "#215EBE",
-		"borderStyle": "black",
-		"list": [{
-				"pagePath": "pages/tabbar/home",
-				"iconPath": "static/tabbar/client/home.png",
-				"selectedIconPath": "static/tabbar/client/home-select.png",
-				"text": "首页"
-			},
-			{
-				"pagePath": "pages/tabbar/community",
-				"iconPath": "static/tabbar/client/community.png",
-				"selectedIconPath": "static/tabbar/client/community-select.png",
-				"text": "社区"
-			},
-			{
-				"pagePath": "pages/tabbar/promotionCode",
-				"iconPath": "static/tabbar/client/rqcode.png",
-				"selectedIconPath": "static/tabbar/client/rqcode-select.png",
-				"text": "推广"
-			},
-			{
-				"pagePath": "pages/tabbar/message",
-				"iconPath": "static/tabbar/client/message.png",
-				"selectedIconPath": "static/tabbar/client/message-select.png",
-				"text": "消息"
-			},
-			{
-				"pagePath": "pages/tabbar/mine",
-				"iconPath": "static/tabbar/client/mine.png",
-				"selectedIconPath": "static/tabbar/client/mine-select.png",
-				"text": "我的"
-			}
-		]
-	},
-	"globalStyle": {
-		"navigationBarTextStyle": "black",
-		"navigationBarTitleText": "uni-app",
-		"navigationBarBackgroundColor": "#F8F8F8",
-		"backgroundColor": "#F8F8F8"
-	},
-	"condition": {
-		"current": 0,
-		"list": [{
-			"name": "",
-			"path": "",
-			"query": ""
-		}]
-	}
-}
+  "easycom": {
+    "autoscan": true,
+    "custom": {
+      "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
+    }
+  },
+  "pages": [
+    {
+      "path": "pages/tabbar/home",
+      "style": {
+        "navigationBarTitleText": "",
+        "navigationStyle": "custom"
+      }
+    },
+    {
+      "path": "pages/login/login",
+      "style": {
+        "navigationBarTitleText": "登录",
+        "navigationStyle": "custom"
+      }
+    },
+    {
+      "path": "pages/login/phoneLogin",
+      "style": {
+        "navigationBarTitleText": "账号登录"
+      }
+    },
+    {
+      "path": "pages/webview/index",
+      "style": {
+        "navigationBarTitleText": ""
+      }
+    },
+    {
+      "path": "pages/tabbar/community",
+      "style": {
+        "navigationBarTitleText": "",
+        "navigationStyle": "custom",
+        "enablePullDownRefresh": true,
+        "onReachBottomDistance": 50
+      }
+    },
+    {
+      "path": "pages/tabbar/message",
+      "style": {
+        "navigationBarTitleText": "",
+        "navigationStyle": "custom"
+      }
+    },
+    {
+      "path": "pages/tabbar/mine/index",
+      "style": {
+        "navigationBarTitleText": "",
+        "navigationStyle": "custom"
+      }
+    },
+    {
+      "path": "pages/tabbar/promotionCode",
+      "style": {
+        "navigationBarTitleText": "",
+        "navigationStyle": "custom"
+      }
+    }
+  ],
+  "subPackages": [
+    {
+      "root": "pagesHome",
+      "pages": [
+        {
+          "path": "homeSearch",
+          "style": {
+            "navigationBarTitleText": "商品搜索"
+          }
+        },
+        {
+          "path": "home/popularRecommend",
+          "style": {
+            "navigationBarTitleText": "热门推荐",
+            "onReachBottomDistance": 0
+          }
+        },
+        {
+          "path": "home/nearbyBusiness",
+          "style": {
+            "navigationBarTitleText": "附近商家",
+            "onReachBottomDistance": 0
+          }
+        },
+        {
+          "path": "marketer/index",
+          "style": {
+            "navigationBarTitleText": "商家详情"
+          }
+        },
+        {
+          "path": "marketer/productDetail",
+          "style": {
+            "navigationBarTitleText": "商品详情"
+          }
+        },
+        {
+          "path": "marketer/settleOrder",
+          "style": {
+            "navigationBarTitleText": "结算订单"
+          }
+        },
+        {
+          "path": "marketer/submitOrder",
+          "style": {
+            "navigationBarTitleText": "提交订单"
+          }
+        },
+        {
+          "path": "marketer/settleStatus",
+          "style": {
+            "navigationBarTitleText": "结算状态"
+          }
+        },
+        {
+          "path": "category/index",
+          "style": {
+            "navigationBarTitleText": "商品类型"
+          }
+        },
+        {
+          "path": "category/categoryStoreList",
+          "style": {
+            "navigationBarTitleText": "商品列表"
+          }
+        }
+      ]
+    },
+    {
+      "root": "pagesCustomer",
+      "pages": [
+        {
+          "path": "communityPostReview",
+          "style": {
+            "navigationBarTitleText": "发布评论"
+          }
+        }
+      ]
+    },
+    {
+      "root": "pagesMessage",
+      "pages": [
+        {
+          "path": "orderNotify",
+          "style": {
+            "navigationBarTitleText": "订单通知"
+          }
+        },
+        {
+          "path": "commentNotify",
+          "style": {
+            "navigationBarTitleText": "评论通知"
+          }
+        },
+        {
+          "path": "kudosNotify",
+          "style": {
+            "navigationBarTitleText": "点赞通知"
+          }
+        },
+        {
+          "path": "benefitsNotify",
+          "style": {
+            "navigationBarTitleText": "优惠福利"
+          }
+        }
+      ]
+    },
+    {
+      "root": "PageMine",
+      "pages": [
+        {
+          "path": "orderModules/index",
+          "style": {
+            "navigationBarTitleText": "我的订单"
+          }
+        },
+        {
+          "path": "orderModules/orderDetail",
+          "style": {
+            "navigationBarTitleText": "订单详情"
+          }
+        },
+        {
+          "path": "orderModules/orderReserve",
+          "style": {
+            "navigationBarTitleText": "订单预约"
+          }
+        },
+        {
+          "path": "orderModules/orderReserveSuccess",
+          "style": {
+            "navigationBarTitleText": "预约成功",
+            "navigationStyle": "custom"
+          }
+        },
+        {
+          "path": "orderModules/orderComment",
+          "style": {
+            "navigationBarTitleText": "订单评价"
+          }
+        },
+        {
+          "path": "favourite",
+          "style": {
+            "navigationBarTitleText": "收藏列表"
+          }
+        },
+        {
+          "path": "shopCar",
+          "style": {
+            "navigationBarTitleText": "购物车"
+          }
+        },
+        {
+          "path": "coupon",
+          "style": {
+            "navigationBarTitleText": "优惠券列表"
+          }
+        },
+        {
+          "path": "goodsReserve",
+          "style": {
+            "navigationBarTitleText": "商品预约"
+          }
+        },
+        {
+          "path": "myTeam",
+          "style": {
+            "navigationBarTitleText": "我的团队"
+          }
+        },
+        {
+          "path": "serviceCenter/index",
+          "style": {
+            "navigationBarTitleText": "客服中心"
+          }
+        },
+        {
+          "path": "serviceCenter/serviceDetail",
+          "style": {
+            "navigationBarTitleText": "问题详情"
+          }
+        },
+        {
+          "path": "feedback",
+          "style": {
+            "navigationBarTitleText": "意见反馈"
+          }
+        },
+        {
+          "path": "aboutUs",
+          "style": {
+            "navigationBarTitleText": "关于我们"
+          }
+        },
+        {
+          "path": "setting/index",
+          "style": {
+            "navigationBarTitleText": "设置"
+          }
+        },
+        {
+          "path": "setting/personInformation",
+          "style": {
+            "navigationBarTitleText": "个人信息"
+          }
+        },
+        {
+          "path": "setting/aboutUs",
+          "style": {
+            "navigationBarTitleText": "关于我们"
+          }
+        },
+        {
+          "path": "profit/index",
+          "style": {
+            "navigationBarTitleText": "提现"
+          }
+        },
+        {
+          "path": "profit/withdraw",
+          "style": {
+            "navigationBarTitleText": "提现"
+          }
+        }
+      ]
+    },
+    {
+      "root": "pageMerchant",
+      "pages": [
+        {
+          "path": "index",
+          "style": {
+            "navigationBarTitleText": "",
+            "navigationStyle": "custom"
+          }
+        },
+        {
+          "path": "mineModule/personalInfo",
+          "style": {
+            "navigationBarTitleText": "店铺信息"
+          }
+        },
+        {
+          "path": "mineModule/storeEnviron",
+          "style": {
+            "navigationBarTitleText": "门店环境"
+          }
+        },
+        {
+          "path": "mineModule/openStoreAppealDetail",
+          "style": {
+            "navigationBarTitleText": "资质信息"
+          }
+        },
+        {
+          "path": "mineModule/certification/index",
+          "style": {
+            "navigationBarTitleText": "我要开店"
+          }
+        },
+        {
+          "path": "mineModule/certification/storeInformation",
+          "style": {
+            "navigationBarTitleText": "1/3门店信息"
+          }
+        },
+        {
+          "path": "mineModule/certification/corporateInformation",
+          "style": {
+            "navigationBarTitleText": "2/3法人信息"
+          }
+        },
+        {
+          "path": "mineModule/certification/qualificationInformation",
+          "style": {
+            "navigationBarTitleText": "2/3资质信息"
+          }
+        },
+        {
+          "path": "mineModule/certification/messageSubmit",
+          "style": {
+            "navigationBarTitleText": "审核信息",
+            "navigationStyle": "default",
+            "disableBack": true
+          }
+        },
+        {
+          "path": "mineModule/certification/openStoreAppealDetail",
+          "style": {
+            "navigationBarTitleText": "资质信息"
+          }
+        },
+        {
+          "path": "mineModule/setting/index",
+          "style": {
+            "navigationBarTitleText": "设置"
+          }
+        },
+        {
+          "path": "storeModule/appointList",
+          "style": {
+            "navigationBarTitleText": "预约列表"
+          }
+        },
+        {
+          "path": "storeModule/couponManage",
+          "style": {
+            "navigationBarTitleText": "商品优惠"
+          }
+        },
+        {
+          "path": "storeModule/evaluateBack",
+          "style": {
+            "navigationBarTitleText": "回复评价"
+          }
+        },
+        {
+          "path": "storeModule/evaluateManagement",
+          "style": {
+            "navigationBarTitleText": "评价管理"
+          }
+        },
+        {
+          "path": "storeModule/myTeam",
+          "style": {
+            "navigationBarTitleText": "我的团队"
+          }
+        },
+        {
+          "path": "storeModule/shopManage",
+          "style": {
+            "navigationBarTitleText": "店铺管理"
+          }
+        },
+        {
+          "path": "storeModule/commodityWriteOff",
+          "style": {
+            "navigationBarTitleText": "商品核销"
+          }
+        },
+        {
+          "path": "storeModule/components/queryWriteOff",
+          "style": {
+            "navigationBarTitleText": "查询核销"
+          }
+        },
+        {
+          "path": "storeModule/components/verificationList",
+          "style": {
+            "navigationBarTitleText": "核销记录"
+          }
+        },
+        {
+          "path": "components/orderDetail",
+          "style": {
+            "navigationBarTitleText": "订单详情"
+          }
+        },
+        {
+          "path": "components/toBeVerified",
+          "style": {
+            "navigationBarTitleText": "待核销"
+          }
+        },
+        {
+          "path": "storeModule/components/verificationStatus",
+          "style": {
+            "navigationBarTitleText": "核销状态",
+            "navigationStyle": "custom"
+          }
+        },
+        {
+          "path": "mineModule/myPurse/purse",
+          "style": {
+            "navigationBarTitleText": "我的钱包"
+          }
+        }
+      ]
+    }
+  ],
+  "tabBar": {
+    "color": "#000000",
+    "selectedColor": "#215EBE",
+    "borderStyle": "black",
+    "list": [
+      {
+        "pagePath": "pages/tabbar/home",
+        "iconPath": "static/tabbar/client/home.png",
+        "selectedIconPath": "static/tabbar/client/home-select.png",
+        "text": "首页"
+      },
+      {
+        "pagePath": "pages/tabbar/community",
+        "iconPath": "static/tabbar/client/community.png",
+        "selectedIconPath": "static/tabbar/client/community-select.png",
+        "text": "社区"
+      },
+      {
+        "pagePath": "pages/tabbar/promotionCode",
+        "iconPath": "static/tabbar/client/rqcode.png",
+        "selectedIconPath": "static/tabbar/client/rqcode-select.png",
+        "text": "推广"
+      },
+      {
+        "pagePath": "pages/tabbar/message",
+        "iconPath": "static/tabbar/client/message.png",
+        "selectedIconPath": "static/tabbar/client/message-select.png",
+        "text": "消息"
+      },
+      {
+        "pagePath": "pages/tabbar/mine/index",
+        "iconPath": "static/tabbar/client/mine.png",
+        "selectedIconPath": "static/tabbar/client/mine-select.png",
+        "text": "我的"
+      }
+    ]
+  },
+  "globalStyle": {
+    "navigationBarTextStyle": "black",
+    "navigationBarTitleText": "uni-app",
+    "navigationBarBackgroundColor": "#F8F8F8",
+    "backgroundColor": "#F8F8F8"
+  },
+  "condition": {
+    "current": 0,
+    "list": [
+      {
+        "name": "",
+        "path": "",
+        "query": ""
+      }
+    ]
+  }
+}

+ 83 - 0
src/pages/tabbar/mine/data.js

@@ -0,0 +1,83 @@
+export const collectList = [
+  {
+    name: 'collect',
+    title: '收藏',
+    url: '/PageMine/favourite',
+  },
+  {
+    name: 'points',
+    title: '积分',
+    url: '',
+  },
+  {
+    name: 'cart',
+    title: '购物车',
+    url: '/PageMine/shopCar',
+  },
+  {
+    name: 'coupon',
+    title: '优惠券',
+    url: '/PageMine/coupon',
+  },
+];
+
+export const LinkList = [
+  {
+    icon: 'shop',
+    title: '我的店铺',
+    url: '',
+    isLink: true,
+  },
+  {
+    icon: 'appoin',
+    title: '预约列表',
+    url: '/PageMine/goodsReserve',
+  },
+  {
+    icon: 'team',
+    title: '我的团队',
+    url: '/PageMine/myTeam',
+    isLink: true,
+  },
+  {
+    icon: 'help',
+    title: '帮助中心',
+    url: '/PageMine/serviceCenter/index',
+    isLink: true,
+  },
+  {
+    icon: 'feedback',
+    title: '意见反馈',
+    url: '/PageMine/feedback?channelType=0',
+    isLink: true,
+  },
+  {
+    icon: 'about',
+    title: '关于车旅程',
+    url: '/PageMine/aboutUs',
+    isLink: true,
+  },
+];
+
+export const oderList = [
+  {
+    name: 'order',
+    title: '全部订单',
+    type: 0,
+  },
+  {
+    name: 'bag-fill',
+    title: '待付款',
+    type: 1,
+  },
+  {
+    name: 'car-fill',
+    title: '待使用',
+    type: 2,
+  },
+  {
+    name: 'heart',
+    title: '退款/取消',
+    type: 3,
+  },
+];

+ 253 - 0
src/pages/tabbar/mine/index.vue

@@ -0,0 +1,253 @@
+<template>
+  <view class="client-mine">
+    <view class="mine-bg">
+      <u--image src="/static/pages/mine/mine-bg.png" width="100%" height="550rpx"></u--image>
+    </view>
+
+    <view class="mine-main">
+      <page-navbar :hasBack="false" bgColor="transparent" title="我的"></page-navbar>
+
+      <view class="fl-flex fl-align-center fl-justify-between">
+        <view class="fl-flex fl-align-center">
+          <u-avatar :src="avatar" size="50" @click="handlerReviewImg" />
+          <view class="f-s-36 u-font-600 u-m-l-30"> {{ nickname }} </view>
+        </view>
+        <u--image
+          src="/static/user/mine/icon_user_mine_setting.png"
+          width="48rpx"
+          height="48rpx"
+          @tap="$Router.push('/PageMine/setting/index')"
+        ></u--image>
+      </view>
+
+      <view class="mine-collect">
+        <view v-for="(item, index) in collectList" :key="index" class="fl-flex">
+          <view class="collect-list" @click="handleRouter(item)">
+            <u--image
+              :src="`/static/pages/mine/${item.name}.png`"
+              width="32rpx"
+              height="32rpx"
+            ></u--image>
+            <view class="u-m-t-16 f-s-24 text-primary">{{ item.title }}</view>
+          </view>
+          <text class="collect-line" v-show="index === 3 ? false : true"></text>
+        </view>
+      </view>
+
+      <!-- 订单 -->
+      <base-card padding="30rpx 10rpx" marginBottom="24rpx">
+        <view class="fl-flex fl-justify-around">
+          <view
+            v-for="(item, index) in oderList"
+            :key="index"
+            class="fl-flex fl-flex-direction fl-align-center"
+            @tap="handleOrder(listItem)"
+          >
+            <u--image
+              src="/static/pages/mine/all-order.png"
+              width="48rpx"
+              height="48rpx"
+            ></u--image>
+            <view class="u-m-t-20 f-s-34 text-primary">{{ item.title }}</view>
+          </view>
+        </view>
+      </base-card>
+
+      <!-- 钱包 -->
+      <base-card padding="0rpx" marginBottom="24rpx">
+        <view class="fl-flex fl-justify-between mine-wallet fl-align-center">
+          <view class="f-s-32 u-font-600 text-primary u-m-b-16">我的钱包</view>
+          <u-icon name="arrow-right" color="#616570" size="16" @click="handlerWallet"></u-icon>
+        </view>
+        <view class="wallet-data fl-flex fl-justify-between fl-align-center">
+          <view class="fl-flex" v-for="(item, index) in incomeList" :key="index">
+            <view>
+              <view class="fl-flex f-s-28" style="color: #ea0000">
+                <view v-show="index === 3 ? false : true">¥</view>
+                <view>{{ item.num }}</view>
+              </view>
+              <view class="f-s-28 u-m-t-12 text-primary">{{ item.title }}</view>
+            </view>
+            <text class="wallet-line" v-show="index === 3 ? false : true"></text>
+          </view>
+        </view>
+      </base-card>
+
+      <base-card padding="0rpx" marginBottom="24rpx">
+        <u-cell-group v-for="(item, index) in LinkList" :key="index" :border="false">
+          <u-cell :title="item.title" @click="handleCell(item)" isLink>
+            <view slot="icon" class="u-m-r-10">
+              <u--image
+                :src="`/static/pages/mine/${item.icon}.png`"
+                width="38rpx"
+                height="38rpx"
+              ></u--image>
+            </view>
+          </u-cell>
+        </u-cell-group>
+      </base-card>
+    </view>
+  </view>
+</template>
+
+<script>
+import { mapGetters } from 'vuex';
+import { collectList, LinkList, oderList } from './data';
+import { getMerchantAuthData } from '@/api/merchant/merchantAuth';
+export default {
+  data() {
+    return {
+      collectList,
+      LinkList,
+      oderList,
+      incomeList: [
+        {
+          num: '12.00',
+          title: '总收益',
+        },
+        {
+          num: '10.00',
+          title: '本月收益',
+        },
+        {
+          num: '9.00',
+          title: '本周收益',
+        },
+        {
+          num: '0.00',
+          title: '可提现',
+        },
+      ],
+    };
+  },
+  computed: {
+    ...mapGetters(['userId', 'gender', 'avatar', 'nickname']),
+  },
+  methods: {
+    handleRouter(item) {
+      if (item.title === '积分') {
+        this.$u.toast('该功能暂未开发,尽情期待!');
+      } else {
+        uni.navigateTo({
+          url: item.url,
+        });
+      }
+    },
+    /* 订单 */
+    handleOrder(item) {
+      this.$store.commit('order/GET_ORDER_TYPE', item);
+      uni.navigateTo({
+        url: `/PageMine/orderModules/index`,
+      });
+    },
+    /* 钱包 */
+    handlerWallet() {
+      uni.navigateTo({
+        url: '/PageMine/profit/index',
+      });
+    },
+    handleCell(item) {
+      console.log(item);
+      if (item.title === '我的店铺') {
+        this.getMerchantAuthInfo();
+      } else {
+        uni.navigateTo({
+          url: item.url,
+        });
+      }
+    },
+    // 点击预览图片
+    handlerReviewImg() {
+      uni.previewImage({
+        urls: [this.avatar],
+      });
+    },
+    async getMerchantAuthInfo() {
+      let res = await getMerchantAuthData();
+      if (res.code === 'OK' && res.data) {
+        this.$store.dispatch('SwitchIdentity', 'MERCHANT');
+        this.merchantInfo = Object.assign(
+          {},
+          {
+            ...res.data,
+            mobileNumber: res.data.mobileNumber,
+          },
+        );
+        this.$store.commit('SET_MERCHANTINFO', res.data);
+
+        if (res.data.reviewStatus == 2) {
+          uni.navigateTo({
+            url: 'pageMerchant/mineModule/openStoreAppealDetail',
+          });
+        } else if (res.data.reviewStatus == 1) {
+          uni.navigateTo({
+            url: '/pageMerchant/index',
+          });
+        }
+      } else {
+        uni.navigateTo({
+          url: '/pageMerchant/mineModule/certification/storeInformation',
+        });
+      }
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.client-mine {
+  height: 100%;
+  position: relative;
+
+  .mine-bg {
+    position: absolute;
+    left: 0;
+    bottom: 0;
+    right: 0;
+    top: 0;
+    z-index: -99;
+  }
+  .mine-main {
+    padding: 0 32rpx;
+    .mine-collect {
+      height: 146rpx;
+      margin: 12rpx 0;
+      padding: 0 32rpx;
+      display: flex;
+      align-items: center;
+      justify-content: space-around;
+      box-sizing: border-box;
+
+      .collect-list {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+      }
+
+      .collect-line {
+        height: 40rpx;
+        width: 1rpx;
+        background-color: #d8d8d8;
+        margin-left: 60rpx;
+        margin-top: 20rpx;
+      }
+    }
+    .mine-wallet {
+      padding: 16rpx 16rpx 10rpx 16rpx;
+      box-sizing: border-box;
+      border-bottom: 2rpx solid #d8d8d8;
+    }
+
+    .wallet-data {
+      padding: 32rpx 42rpx;
+    }
+    .wallet-line {
+      height: 60rpx;
+      width: 1rpx;
+      background-color: #d8d8d8;
+      margin-left: 40rpx;
+      margin-top: 16rpx;
+    }
+  }
+}
+</style>

+ 0 - 0
src/pages/tabbar/mine.vue → src/pages/tabbar/mine/mine-copy.vue


BIN
src/static/pages/mine/about.png


BIN
src/static/pages/mine/all-order.png


BIN
src/static/pages/mine/appoin.png


BIN
src/static/pages/mine/cart.png


BIN
src/static/pages/mine/collect.png


BIN
src/static/pages/mine/coupon.png


BIN
src/static/pages/mine/feedback.png


BIN
src/static/pages/mine/help.png


BIN
src/static/pages/mine/mine-bg.png


BIN
src/static/pages/mine/points.png


BIN
src/static/pages/mine/shop.png


BIN
src/static/pages/mine/team.png


BIN
src/static/tabbar/client/mine-select.png


BIN
src/static/tabbar/merchant/mine-select.png


BIN
src/static/tabbar/merchant/mine.png


BIN
src/static/tabbar/merchant/order-select.png


BIN
src/static/tabbar/merchant/order.png


BIN
src/static/tabbar/merchant/shop-selecr.png


BIN
src/static/tabbar/merchant/shop.png


+ 48 - 0
src/utils/index.js

@@ -0,0 +1,48 @@
+/**
+ * 图片转为base64
+ * @param {*} url
+ * @param {*} callback
+ */
+export const getBase64Image = (url, callback) => {
+  // #ifdef MP-WEIXIN
+  uni.getFileSystemManager().readFile({
+    filePath: url, //选择图片返回的相对路径
+    encoding: 'base64', //编码格式
+    success: res => {
+      //成功的回调
+      console.log(res, '返回结果');
+      let base64 = 'data:image/jpeg;base64,' + res.data; //不加上这串字符,在页面无法显示的哦
+      callback && callback(base64);
+    },
+    fail: e => {
+      console.log('图片转换失败');
+    },
+  });
+  // #endif
+  // #ifdef H5
+  uni.request({
+    url: url,
+    method: 'GET',
+    responseType: 'arraybuffer',
+    success: res => {
+      let base64 = uni.arrayBufferToBase64(res.data); //把arraybuffer转成base64
+      base64 = 'data:image/jpeg;base64,' + base64;
+      callback && callback(base64);
+    },
+    fail: e => {
+      console.log('图片转换失败');
+    },
+  });
+  // #endif
+  // #ifdef APP-PLUS
+  plus.io.resolveLocalFileSystemURL(url, entry => {
+    entry.file(file => {
+      let fileReader = new plus.io.FileReader();
+      fileReader.onloadend = e => {
+        callback && callback(e.target.result);
+      };
+      fileReader.readAsDataURL(file);
+    });
+  });
+  // #endif
+};

+ 3 - 3
src/utils/request.js

@@ -11,10 +11,10 @@ import {
 
 // 每次请求都创建一个新的实例
 const instance = axios.create({
-  // baseURL: 'https://test.api.chelvc.com',
+  baseURL: 'https://test.api.chelvc.com',
   // baseURL: "http://192.168.68.77:11000",
-  // baseURL: "https://358175z5l5.yicp.fun",
-  baseURL: "http://localhost:11000",
+  // baseURL: "https://358175z5l5.yicp.fun",
+  // baseURL: "http://localhost:11000",
   timeout: 10000,
   adapter: UniAdapter,
 });