Эх сурвалжийг харах

用户端首页 修改经纬度获取 获取当前位置 选择地图位置 我的模块 注销为对接功能 修改manifest.json 微信地图获取 修改 首页列表

743180155@qq.com 1 жил өмнө
parent
commit
f5fba3fad0

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 2 - 19522
package-lock.json


+ 1 - 1
src/api/login.js

@@ -40,7 +40,7 @@ export function getSmsCodeByPhone(data) {
   return request({
     url: '/maintain/sms/captcha',
     method: 'post',
-    data
+    data:data
   });
 }
 

+ 188 - 182
src/components/service/goodsItem.vue

@@ -1,189 +1,195 @@
 <template>
-  <view class="sort">
-    <u-swipe-action>
-      <u-swipe-action-item :options="options1" :key="index" v-for="(itm, index) of item"
-        @click="handlerClearItem(itm,index)">
-        <view class="list" @click='handlerRouterSkip(itm)'>
-          <view class="list-img">
-            <image class="img" :src=" itm.logo"
-              mode="scaleToFill"></image>
-          </view>
-
-          <view class="list-main">
-            <view class="item-text">{{ itm.name }}</view>
-            <view class="item-flex">
-              <view class="star">
-                <u-rate count="5" v-model="itm.score" :size="14" />
-                <text class="line">|</text>
-                <text class="points">{{ itm.specialPrice }}分</text>
-              </view>
-              <view>{{ itm.specialPrice }}单</view>
-            </view>
-            <view class="list-item">
-              <view class="item-l">{{ itm.description }}</view>
-              <view class="item-r"></view>
-            </view>
-          </view>
-        </view>
-      </u-swipe-action-item>
-    </u-swipe-action>
-  </view>
+	<view class="sort">
+		<u-swipe-action>
+			<u-swipe-action-item :options="options1" :key="index" v-for="(itm, index) of item"
+				@click="handlerClearItem(itm,index)">
+				<view class="list" @click='handlerRouterSkip(itm)'>
+					<view class="list-img">
+						<image class="img" :src=" itm.logo" mode="scaleToFill"></image>
+					</view>
+
+					<view class="list-main">
+						<view class="item-text">{{ itm.name }}</view>
+						<view class="item-flex">
+							<view class="star">
+								<u-rate :count="itm.score" disabled v-model="itm.score" :size="14" />
+								<text class="line">|</text>
+								<text class="points">{{ itm.score }}分</text>
+							</view>
+							<!-- <view>{{ itm.specialPrice }}单</view> -->
+							<view></view>
+						</view>
+						<view class="list-item">
+							<view class="item-l">{{ itm.description }}</view>
+							<view class="item-r"></view>
+						</view>
+					</view>
+				</view>
+			</u-swipe-action-item>
+		</u-swipe-action>
+	</view>
 </template>
 
 <script>
-  import {
-    cancelFavorite
-  } from '@/api/client/business.js';
-  export default {
-    data() {
-      return {
-        show: false,
-        showDate: false,
-        value1: Number(new Date()),
-        count: 2,
-        value: 10,
-        options1: [{
-          text: '删除'
-        }]
-      };
-    },
-    props: ['item'],
-    mounted() {
-      console.log('@@@@item', this.item);
-    },
-    methods: {
-      click(item) {},
-      open() {},
-      close() {
-        this.show = false;
-      },
-      // 点击跳转1
-      handlerRouterSkip(item) {
-        uni.navigateTo({
-          url: `/pages/client/clientPackage/serviceDetail/index?id=${item.id}`,
-        });
-      },
-      // 点击取消
-      handlerClearItem(item, index) {
-        cancelFavorite(item.id).then(res => {
-          if (res.code == 'OK') {
-            uni.showToast({
-              title: '取消成功',
-              icon: 'none'
-            })
-            this.$emit('uploadIniList', 1)
-          } else {
-            uni.showToast({
-              title: res.message,
-              icon: 'none'
-            })
-            return
-          }
-        })
-      }
-    },
-  };
+	import {
+		cancelFavorite
+	} from '@/api/client/business.js';
+	export default {
+		data() {
+			return {
+				show: false,
+				showDate: false,
+				value1: Number(new Date()),
+				count: 2,
+				value: 10,
+				options1: [{
+					text: '删除'
+				}]
+			};
+		},
+		props: ['item'],
+		mounted() {
+			console.log('@@@@item', this.item);
+		},
+		methods: {
+			click(item) {},
+			open() {},
+			close() {
+				this.show = false;
+			},
+			// 点击跳转1
+			handlerRouterSkip(item) {
+				uni.navigateTo({
+					url: `/pages/client/clientPackage/serviceDetail/index?id=${item.id}`,
+				});
+			},
+			// 点击取消
+			handlerClearItem(item, index) {
+				cancelFavorite(item.id).then(res => {
+					if (res.code == 'OK') {
+						uni.showToast({
+							title: '取消成功',
+							icon: 'none'
+						})
+						this.$emit('uploadIniList', 1)
+					} else {
+						uni.showToast({
+							title: res.message,
+							icon: 'none'
+						})
+						return
+					}
+				})
+			}
+		},
+	};
 </script>
 
 <style lang="scss" scoped>
-  /*商家服务分类的是实现 */
-
-  .sort {
-    min-height: 100vh;
-
-    .list {
-      height: 250rpx;
-      background-color: #fff;
-      padding: 20rpx;
-      margin-bottom: 20rpx;
-      display: flex;
-
-      .list-img {
-        width: 260rpx;
-        height: 100%;
-        background-color: #ec5729;
-        margin-right: 20rpx;
-
-        image {
-          width: 100%;
-          height: 100%;
-        }
-      }
-
-      .list-main {
-        width: calc(100% - 280rpx);
-      }
-
-      .item-text {
-        font-weight: bold;
-        margin: 10rpx 0 10rpx;
-        color: #333;
-      }
-
-      .item-flex {
-        display: flex;
-        justify-content: space-between;
-        font-size: 28rpx;
-        margin: 0 20rpx 10rpx 0;
-        color: #0d0d0d66;
-
-        .star {
-          display: flex;
-
-          .line {
-            margin-left: 16rpx;
-            margin-top: 5rpx;
-            font-size: 22rpx;
-          }
-
-          .points {
-            color: #ff4b04;
-            font-size: 22rpx;
-            margin-top: 6rpx;
-            margin-left: 10rpx;
-          }
-        }
-      }
-
-      .list-item {
-        display: flex;
-        justify-content: space-between;
-        margin-top: 40rpx;
-
-        .item-l {
-          color: #cfcfcf;
-        }
-
-        .item-r {
-          color: #252525;
-
-          .Buy {
-            width: 40px;
-            height: 32px;
-            color: #fff;
-            line-height: 32px;
-            text-align: center;
-            display: inline-block;
-            border-radius: 0 16px 16px 0;
-            background-color: #ec5729;
-            padding-bottom: 20rpx;
-          }
-        }
-      }
-    }
-  }
-
-
-  .swipe-action {
-    background-color: #EFEFEF;
-    box-sizing: border-box;
-
-    &__content {
-
-      &__text {
-        font-size: 15px;
-        color: $u-main-color;
-      }
-    }
-  }
-</style>
+	/*商家服务分类的是实现 */
+
+	.sort {
+		min-height: 100vh;
+
+		.list {
+			height: 250rpx;
+			background-color: #fff;
+			padding: 20rpx;
+			margin-bottom: 20rpx;
+			display: flex;
+
+			.list-img {
+				width: 260rpx;
+				height: 100%;
+				background-color: #ec5729;
+				margin-right: 20rpx;
+
+				image {
+					width: 100%;
+					height: 100%;
+				}
+			}
+
+			.list-main {
+				width: calc(100% - 280rpx);
+			}
+
+			.item-text {
+				font-weight: bold;
+				margin: 10rpx 0 10rpx;
+				color: #333;
+			}
+
+			.item-flex {
+				display: flex;
+				justify-content: space-between;
+				font-size: 28rpx;
+				margin: 0 20rpx 10rpx 0;
+				color: #0d0d0d66;
+
+				.star {
+					display: flex;
+
+					.line {
+						margin-left: 16rpx;
+						margin-top: 5rpx;
+						font-size: 22rpx;
+					}
+
+					.points {
+						color: #ff4b04;
+						font-size: 22rpx;
+						margin-top: 6rpx;
+						margin-left: 10rpx;
+					}
+				}
+			}
+
+			.list-item {
+				display: flex;
+				justify-content: space-between;
+				margin-top: 40rpx;
+
+				.item-l {
+					width: 80%;
+					color: #cfcfcf;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					display: -webkit-box; //将对象作为弹性伸缩盒子模型显示。
+					-webkit-box-orient: vertical; // 从上到下垂直排列子元素
+					-webkit-line-clamp: 2; //显示的行数
+				}
+
+				.item-r {
+					color: #252525;
+
+					.Buy {
+						width: 40px;
+						height: 32px;
+						color: #fff;
+						line-height: 32px;
+						text-align: center;
+						display: inline-block;
+						border-radius: 0 16px 16px 0;
+						background-color: #ec5729;
+						padding-bottom: 20rpx;
+					}
+				}
+			}
+		}
+	}
+
+
+	.swipe-action {
+		background-color: #EFEFEF;
+		box-sizing: border-box;
+
+		&__content {
+
+			&__text {
+				font-size: 15px;
+				color: $u-main-color;
+			}
+		}
+	}
+</style>

+ 4 - 4
src/components/service/index.vue

@@ -15,15 +15,16 @@
               <view class="item-text">{{ itm.address }}</view>
               <view class="item-flex">
                 <view class="star">
-                  <u-rate :count="itm.score" :size="14" />
+                  <u-rate :count="itm.score" disabled :size="14" />
                   <text class="line">|</text>
                   <text class="points">{{ itm.score }}分</text>
                 </view>
-                <view>{{ itm.sale }}单</view>
+                <!-- <view>{{ itm.sale }}单</view> -->
+                <view></view>
               </view>
               <view class="list-item">
                 <view class="item-l">{{ itm.name }}</view>
-                <view class="item-r">{{ itm.distance }}KM</view>
+                <view class="item-r">{{ (itm.distance / 1000).toFixed(2) }}KM</view>
               </view>
             </view>
           </view>
@@ -52,7 +53,6 @@
       };
     },
     props: ['item', 'skipType'],
-
     methods: {
       click(item) {},
       open() {},

+ 8 - 2
src/manifest.json

@@ -56,14 +56,20 @@
   },
   "quickapp": {},
   "mp-weixin": {
+	// "usingComponents":false,
     "appid": "wx593877b3c990b15c",
     "setting": {
-      "urlCheck": false
+      "urlCheck": false,
+	  "es6": true,
+	  "postcss": true,
+	  "minified": true
     },
     "optimization": {
       "subPackages": true
     },
-    "usingComponents": true,
+    "usingComponents":{
+		"enable":true
+	},
     "permission": {
       "scope.userLocation": {
         "desc": "使用定位功能"

+ 233 - 250
src/pages/client/clientPackage/search.vue

@@ -1,257 +1,240 @@
 <template>
-  <view class="search">
-    <view class="search-item">
-      <u-search v-model="search_text" :clearabled="true" @custom="handlerSearchBtn" />
-      <!-- <button class="search-btn" @click="handlerSearchBtn">搜索</button> -->
-    </view>
-    <!-- 搜索历史 -->
-    <view class="history">
-      <view class="history-top">
-        <hotCom>搜索历史</hotCom>
-        <view class="history-right" @click="handlerAllSearchRecord">
-          <u-icon name="trash" />
-          <text>删除记录</text>
-        </view>
-      </view>
-      <view class="label">
-        <u-tag
-          v-for="(item, index) of search_list"
-          :key="index"
-          :text="item.name"
-          plain
-          closable
-          :show="close2"
-          @close="handlerCloseSearchItem(item, index)"
-        />
-      </view>
-    </view>
-
-    <!-- 热门搜索 -->
-    <view class="history">
-      <view class="history-top">
-        <text class="hotCom">热门搜索</text>
-      </view>
-      <view class="label">
-        <u-tag
-          v-for="(item, index) in favourite_list"
-          :text="item.name"
-          :key="index"
-          class="label-item"
-          @click="$Router.push(`/pages/client/clientPackage/storeDetail?id=${item.id}`)"
-        />
-      </view>
-    </view>
-
-    <u-divider text="猜你喜欢"></u-divider>
-
-    <!-- 列表 -->
-    <view class="popular-box">
-      <view
-        class="hot"
-        v-for="(item, index) of popular_search_list"
-        :key="index"
-        @click="$Router.push(`/pages/client/clientPackage/storeDetail?id=${item.id}`)"
-      >
-        <Image src="https://cdn.uviewui.com/uview/album/1.jpg"></Image>
-        <view>
-          <view class="item-text">{{ item.name }}</view>
-          <view class="item-flex">
-            <view class="star">
-              <u-rate :count="count" :value="item.score" readonly />
-              <text class="line">|</text>
-            </view>
-            <view>{{ item.goodReview }}单</view>
-          </view>
-          <view class="address-flex">
-            <view>{{ item.address }}</view>
-            <view>2.7km</view>
-          </view>
-        </view>
-      </view>
-    </view>
-  </view>
+	<view class="search">
+		<view class="search-item">
+			<u-search v-model="search_text" :clearabled="true" @custom="handlerSearchBtn" />
+			<!-- <button class="search-btn" @click="handlerSearchBtn">搜索</button> -->
+		</view>
+		<!-- 搜索历史 -->
+		<view class="history">
+			<view class="history-top">
+				<hotCom>搜索历史</hotCom>
+				<view class="history-right" @click="handlerAllSearchRecord">
+					<u-icon name="trash" />
+					<text>删除记录</text>
+				</view>
+			</view>
+			<view class="label">
+				<u-tag v-for="(item, index) of search_list" :key="index" :text="item.name" plain closable :show="close2"
+					@close="handlerCloseSearchItem(item, index)" />
+			</view>
+		</view>
+
+		<!-- 热门搜索 -->
+		<view class="history">
+			<view class="history-top">
+				<text class="hotCom">热门搜索</text>
+			</view>
+			<view class="label">
+				<u-tag v-for="(item, index) in favourite_list" :text="item.name" :key="index" class="label-item"
+					@click="$Router.push(`/pages/client/clientPackage/storeDetail?id=${item.id}`)" />
+			</view>
+		</view>
+
+		<u-divider text="猜你喜欢"></u-divider>
+
+		<!-- 列表 -->
+		<view class="popular-box">
+			<view class="hot" v-for="(item, index) of popular_search_list" :key="index"
+				@click="$Router.push(`/pages/client/clientPackage/storeDetail?id=${item.id}`)">
+				<Image src="https://cdn.uviewui.com/uview/album/1.jpg"></Image>
+				<view>
+					<view class="item-text">{{ item.name }}</view>
+					<view class="item-flex">
+						<view class="star">
+							<u-rate :count="count" :value="item.score" readonly />
+							<text class="line">|</text>
+						</view>
+						<view>{{ item.goodReview }}单</view>
+					</view>
+					<view class="address-flex">
+						<view>{{ item.address }}</view>
+						<view>2.7km</view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
 </template>
 
 <script>
-import { listHotMerchant, likeMerchant } from '@/api/client/home.js';
-export default {
-  data() {
-    return {
-      count: 5,
-      value: 4,
-      close2: true,
-      radios: [
-        {
-          checked: true,
-        },
-      ],
-      checkboxs: [
-        {
-          checked: true,
-        },
-      ],
-      search_text: '', // 搜索text
-      search_list: [], // 搜索列表
-
-      popular_search_list: [], //热门搜索列表
-      favourite_list: [], // 猜你喜欢列表
-    };
-  },
-  onShow() {
-    if (uni.getStorageSync('searchItem')) {
-      this.search_list = uni.getStorageSync('searchItem');
-    }
-  },
-  mounted() {
-    this.handlerInitList();
-  },
-  methods: {
-    // 初始化热门搜索 猜你喜欢列表
-    handlerInitList() {
-      listHotMerchant().then(res => {
-        this.popular_search_list = res.data;
-      });
-
-      // 猜你喜欢列表
-      likeMerchant().then(res => {
-        this.favourite_list = res.data;
-      });
-    },
-    // 点击搜索按钮
-    handlerSearchBtn() {
-      if (!this.search_text) {
-        uni.showToast({
-          title: '请输入您要搜索的关键字',
-          icon: 'none',
-        });
-        return;
-      } else {
-        let params = {
-          name: this.search_text,
-        };
-        this.search_list.push(params);
-        uni.setStorageSync('searchItem', this.search_list);
-        this.search_text = '';
-      }
-    },
-    // 删除搜索记录按钮
-    handlerCloseSearchItem(item, index) {
-      this.search_list.splice(index, 1);
-      uni.setStorageSync('searchItem', this.search_list);
-    },
-    // 删除所有搜索记录按钮
-    handlerAllSearchRecord() {
-      uni.removeStorageSync('searchItem');
-      this.search_list = [];
-    },
-  },
-};
+	import {
+		listHotMerchant,
+		likeMerchant
+	} from '@/api/client/home.js';
+	export default {
+		data() {
+			return {
+				count: 5,
+				value: 4,
+				close2: true,
+				radios: [{
+					checked: true,
+				}, ],
+				checkboxs: [{
+					checked: true,
+				}, ],
+				search_text: '', // 搜索text
+				search_list: [], // 搜索列表
+
+				popular_search_list: [], //热门搜索列表
+				favourite_list: [], // 猜你喜欢列表
+			};
+		},
+		onShow() {
+			if (uni.getStorageSync('searchItem')) {
+				this.search_list = uni.getStorageSync('searchItem');
+			}
+		},
+		mounted() {
+			this.handlerInitList();
+		},
+		methods: {
+			// 初始化热门搜索 猜你喜欢列表
+			handlerInitList() {
+				listHotMerchant().then(res => {
+					this.popular_search_list = res.data;
+				});
+
+				// 猜你喜欢列表
+				likeMerchant().then(res => {
+					this.favourite_list = res.data;
+				});
+			},
+			// 点击搜索按钮
+			handlerSearchBtn() {
+				if (!this.search_text) {
+					uni.showToast({
+						title: '请输入您要搜索的关键字',
+						icon: 'none',
+					});
+					return;
+				} else {
+					let params = {
+						name: this.search_text,
+					};
+					this.search_list.push(params);
+					uni.setStorageSync('searchItem', this.search_list);
+					this.search_text = '';
+				}
+			},
+			// 删除搜索记录按钮
+			handlerCloseSearchItem(item, index) {
+				this.search_list.splice(index, 1);
+				uni.setStorageSync('searchItem', this.search_list);
+			},
+			// 删除所有搜索记录按钮
+			handlerAllSearchRecord() {
+				uni.removeStorageSync('searchItem');
+				this.search_list = [];
+			},
+		},
+	};
 </script>
 
 <style lang="scss" scoped>
-.search {
-  min-height: 100vh;
-  background-color: #fff;
-}
-
-/* 搜索样式 */
-.search-item {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  padding: 0 20rpx;
-  height: 80rpx;
-  line-height: 80rpx;
-  background-color: #fff;
-  margin-bottom: 10rpx;
-
-  .search-btn {
-    width: 160rpx;
-    height: 70rpx;
-    font-size: 28rpx;
-    line-height: 70rpx;
-  }
-}
-
-/* 搜索历史样式 */
-.history {
-  padding: 30rpx;
-  margin-bottom: 10rpx;
-
-  .history-top {
-    display: flex;
-    justify-content: space-between;
-    margin-bottom: 20rpx;
-
-    .history-right {
-      margin-top: 15rpx;
-      display: flex;
-      font-size: 12px;
-    }
-
-    hotCom {
-      font-size: 15px;
-      font-weight: bold;
-      color: #404045;
-    }
-  }
-}
-
-.label {
-  display: flex;
-  flex-wrap: wrap;
-}
-
-// 列表
-.hot {
-  height: 220rpx;
-  background-color: #fff;
-  padding: 0 20rpx;
-  margin-bottom: 20rpx;
-  display: flex;
-
-  Image {
-    width: 120px;
-    height: calc(100% - 20rpx);
-    margin: 10rpx 20rpx 10rpx 0;
-  }
-
-  .item-text {
-    font-weight: bold;
-    margin: 10rpx 0 10rpx;
-    color: #333;
-  }
-
-  .item-flex {
-    display: flex;
-    justify-content: space-between;
-    font-size: 14px;
-    margin: 0 20rpx 30rpx 0;
-    color: #0d0d0d66;
-
-    .star {
-      display: flex;
-
-      .line {
-        margin-left: 18rpx;
-        margin-top: 5rpx;
-        font-size: 24rpx;
-      }
-    }
-  }
-
-  .address-flex {
-    display: flex;
-    justify-content: space-between;
-    font-size: 12px;
-    color: #999;
-    margin-right: 20rpx;
-  }
-}
-
-::v-deep view.data-v-1481d46d,
-scroll-view.data-v-1481d46d,
-swiper-item.data-v-1481d46d {
-  margin: 0 4rpx;
-}
-</style>
+	.search {
+		min-height: 100vh;
+		background-color: #fff;
+	}
+
+	/* 搜索样式 */
+	.search-item {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 0 20rpx;
+		height: 80rpx;
+		line-height: 80rpx;
+		background-color: #fff;
+		margin-bottom: 10rpx;
+
+		.search-btn {
+			width: 160rpx;
+			height: 70rpx;
+			font-size: 28rpx;
+			line-height: 70rpx;
+		}
+	}
+
+	/* 搜索历史样式 */
+	.history {
+		padding: 30rpx;
+		margin-bottom: 10rpx;
+
+		.history-top {
+			display: flex;
+			justify-content: space-between;
+			margin-bottom: 20rpx;
+
+			.history-right {
+				margin-top: 15rpx;
+				display: flex;
+				font-size: 12px;
+			}
+
+			hotCom {
+				font-size: 15px;
+				font-weight: bold;
+				color: #404045;
+			}
+		}
+	}
+
+	.label {
+		display: flex;
+		flex-wrap: wrap;
+	}
+
+	// 列表
+	.hot {
+		height: 220rpx;
+		background-color: #fff;
+		padding: 0 20rpx;
+		margin-bottom: 20rpx;
+		display: flex;
+
+		Image {
+			width: 120px;
+			height: calc(100% - 20rpx);
+			margin: 10rpx 20rpx 10rpx 0;
+		}
+
+		.item-text {
+			font-weight: bold;
+			margin: 10rpx 0 10rpx;
+			color: #333;
+		}
+
+		.item-flex {
+			display: flex;
+			justify-content: space-between;
+			font-size: 14px;
+			margin: 0 20rpx 30rpx 0;
+			color: #0d0d0d66;
+
+			.star {
+				display: flex;
+
+				.line {
+					margin-left: 18rpx;
+					margin-top: 5rpx;
+					font-size: 24rpx;
+				}
+			}
+		}
+
+		.address-flex {
+			display: flex;
+			justify-content: space-between;
+			font-size: 12px;
+			color: #999;
+			margin-right: 20rpx;
+		}
+	}
+
+	::v-deep view.data-v-1481d46d,
+	scroll-view.data-v-1481d46d,
+	swiper-item.data-v-1481d46d {
+		margin: 0 4rpx;
+	}
+</style>

+ 6 - 5
src/pages/client/clientPackage/serviceDetail/index.vue

@@ -132,11 +132,12 @@
         userOperate: [{
             name: '店铺',
             icon: 'file-text',
-          },
-          {
-            name: '立即咨询',
-            icon: 'chat',
-          },
+          }
+		  // ,
+    //       {
+    //         name: '立即咨询',
+    //         icon: 'chat',
+    //       },
         ],
         favorite_list: {
           name: '收藏',

+ 152 - 0
src/pages/client/clientUser/mine/setting/personInfo - 副本.vue

@@ -0,0 +1,152 @@
+<template>
+  <view class="root">
+    <view class="content-box">
+      <u-cell-group>
+        <u-cell title="头像" @click="handlerUploadImg" isLink>
+          <template slot="value">
+            <u-avatar shape="square" size="60" :src="userInfo.avatar" @click.stop="viewAvatar(userInfo.avatar)"></u-avatar>
+          </template>
+        </u-cell>
+        <u-cell title="昵称" isLink>
+          <template slot="value" >
+            <u-input inputAlign="right" :border="false" v-model="userInfo.nickname" />
+          </template>
+        </u-cell>
+        <u-cell title="性别" isLink>
+          <template slot="value">
+            <u-radio-group v-model="userInfo.gender">
+              <u-radio v-for="item in sexList" :key="item.type" :label="item.text" :name="item.type" />
+            </u-radio-group>
+          </template>
+        </u-cell>
+      </u-cell-group>
+    </view>
+    <view class="btn-box">
+      <u-button type="primary" shape="circle" @click="handlerSubmitBtn">确认</u-button>
+    </view>
+  </view>
+</template>
+
+<script>
+import { uploadFile } from "@/utils/upload"
+  export default {
+    data() {
+      return {
+        userInfo:{
+          userId:'',
+          avatar:'',
+          gender:'',
+          nickname:''
+        },
+        time_value: '',
+        timeShow: false,
+        sexList: [{
+            id: 0,
+            text: '男',
+            type:'MALE'
+          },
+          {
+            id: 1,
+            text: '女',
+            type:'FEMALE'
+          }
+        ],
+        current: 0,
+      }
+    },
+    mounted(){
+      this.userInfo.userId = this.$store.getters.userId
+      this.userInfo.avatar = this.$store.getters.avatar
+      this.userInfo.gender = this.$store.getters.gender
+      this.userInfo.nickname = this.$store.getters.nickname
+    },
+    methods: {
+      viewAvatar(url){
+        uni.previewImage({
+          urls:[url]
+        })
+      },
+      // 选择性别
+      handlerSelectGender(item) {
+        this.current = item.id
+      },
+      // 上传头像
+      async handlerUploadImg() {
+        const res = await uni.showActionSheet({
+          itemList: ['拍照', '从相册选择'],
+        });
+        if (res.tapIndex === 0) {
+          // 用户选择拍照
+          this.takePhoto();
+        } else if (res.tapIndex === 1) {
+          // 用户选择从相册选择
+          this.chooseImage();
+        }
+      },
+      // 拍照
+      takePhoto() {
+        uni.chooseImage({
+          sourceType: ['camera'],
+          count: 1,
+          success: res => {
+            const tempFilePaths = res.tempFilePaths;
+            this.uploadAvatar(tempFilePaths[0]);
+          },
+          fail: error => {
+            console.error(error);
+          },
+        });
+      },
+      //从相册中选择
+      chooseImage() {
+        uni.chooseImage({
+          sourceType: ['album'],
+          count: 1,
+          success: res => {
+            const tempFilePaths = res.tempFilePaths;
+            this.uploadAvatar(tempFilePaths[0]);
+          },
+          fail: error => {
+            console.error(error);
+          },
+        });
+      },
+      // 上传头像
+      async uploadAvatar(filePath) {
+        // 在这里实现上传头像的逻辑,将filePath作为参数传入
+        const res = await uploadFile(filePath)
+        if(res.statusCode === 200 && res.data){
+          const resp = JSON.parse(res.data)
+          this.userInfo.avatar = resp.data.url
+        }
+      },
+
+      // 点击提交按钮
+      handlerSubmitBtn() {
+        this.$store.dispatch('UpdateUserInfo',this.userInfo).then(res=>{
+          setTimeout(()=>{
+            uni.navigateBack(-1)
+          },1500)
+        })
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+.root{
+  background-color: #f3f3f3;
+  height: calc(100vh -  env(safe-area-inset-top));
+  position: relative;
+  .content-box{
+    background-color: #fff;
+  }
+  .btn-box{
+    position: absolute;
+    bottom: 0;
+    padding: 32rpx 16rpx;
+    box-sizing: border-box;
+    width: 100%;
+  }
+}
+</style>

+ 237 - 145
src/pages/client/clientUser/mine/setting/personInfo.vue

@@ -1,152 +1,244 @@
 <template>
-  <view class="root">
-    <view class="content-box">
-      <u-cell-group>
-        <u-cell title="头像" @click="handlerUploadImg" isLink>
-          <template slot="value">
-            <u-avatar shape="square" size="60" :src="userInfo.avatar" @click.stop="viewAvatar(userInfo.avatar)"></u-avatar>
-          </template>
-        </u-cell>
-        <u-cell title="昵称" isLink>
-          <template slot="value" >
-            <u-input inputAlign="right" :border="false" v-model="userInfo.nickname" />
-          </template>
-        </u-cell>
-        <u-cell title="性别" isLink>
-          <template slot="value">
-            <u-radio-group v-model="userInfo.gender">
-              <u-radio v-for="item in sexList" :key="item.type" :label="item.text" :name="item.type" />
-            </u-radio-group>
-          </template>
-        </u-cell>
-      </u-cell-group>
-    </view>
-    <view class="btn-box">
-      <u-button type="primary" shape="circle" @click="handlerSubmitBtn">确认</u-button>
-    </view>
-  </view>
+	<view class="ccontainer">
+		<view class="item-box">
+			<view class="item-left"> 头像 : </view>
+			<view class="item-right flex-end">
+				<image @click="handlerUploadImg" class="img" :src="queryParams.avatar"></image>
+			</view>
+		</view>
+		<view class="item-box">
+			<view class="item-left"> 昵称 : </view>
+			<view class="item-right">
+				<u--input placeholder="请输入内容" border="none" v-model="queryParams.nickname"></u--input>
+			</view>
+		</view>
+		<view class="item-box">
+			<view class="item-left"> 性别 : </view>
+			<view class="item-right">
+				<view class="sex-item">
+					<view class="item" v-for=" (item,index) of sexList" :class="current == index ? 'act-sex' : ''"
+						:key="index" @click="handlerSelectGender(item)"> {{ item.name }} </view>
+				</view>
+			</view>
+		</view>
+		<view class="item-box">
+			<view class="item-left"> 生日 : </view>
+			<view class="item-right right-time-box" @click="timeShow = true">
+				<view class="time-left" :class="queryParams.birthday ? '' : 'gray-color'">
+					{{ queryParams.birthday ? queryParams.birthday : '请选择您的生日' }}
+				</view>
+				<view class="time-right">
+					<u-icon name="arrow-right"></u-icon>
+				</view>
+			</view>
+		</view>
+
+		<u-datetime-picker :show="timeShow" v-model="time_value" mode="date" @cancel='timeShow = false'
+			@confirm='confirmTime'></u-datetime-picker>
+
+		<view class="btn-box">
+			<button class="btn" @click="handlerSubmitBtn">提交</button>
+		</view>
+	</view>
 </template>
 
 <script>
-import { uploadFile } from "@/utils/upload"
-  export default {
-    data() {
-      return {
-        userInfo:{
-          userId:'',
-          avatar:'',
-          gender:'',
-          nickname:''
-        },
-        time_value: '',
-        timeShow: false,
-        sexList: [{
-            id: 0,
-            text: '男',
-            type:'MALE'
-          },
-          {
-            id: 1,
-            text: '女',
-            type:'FEMALE'
-          }
-        ],
-        current: 0,
-      }
-    },
-    mounted(){
-      this.userInfo.userId = this.$store.getters.userId
-      this.userInfo.avatar = this.$store.getters.avatar
-      this.userInfo.gender = this.$store.getters.gender
-      this.userInfo.nickname = this.$store.getters.nickname
-    },
-    methods: {
-      viewAvatar(url){
-        uni.previewImage({
-          urls:[url]
-        })
-      },
-      // 选择性别
-      handlerSelectGender(item) {
-        this.current = item.id
-      },
-      // 上传头像
-      async handlerUploadImg() {
-        const res = await uni.showActionSheet({
-          itemList: ['拍照', '从相册选择'],
-        });
-        if (res.tapIndex === 0) {
-          // 用户选择拍照
-          this.takePhoto();
-        } else if (res.tapIndex === 1) {
-          // 用户选择从相册选择
-          this.chooseImage();
-        }
-      },
-      // 拍照
-      takePhoto() {
-        uni.chooseImage({
-          sourceType: ['camera'],
-          count: 1,
-          success: res => {
-            const tempFilePaths = res.tempFilePaths;
-            this.uploadAvatar(tempFilePaths[0]);
-          },
-          fail: error => {
-            console.error(error);
-          },
-        });
-      },
-      //从相册中选择
-      chooseImage() {
-        uni.chooseImage({
-          sourceType: ['album'],
-          count: 1,
-          success: res => {
-            const tempFilePaths = res.tempFilePaths;
-            this.uploadAvatar(tempFilePaths[0]);
-          },
-          fail: error => {
-            console.error(error);
-          },
-        });
-      },
-      // 上传头像
-      async uploadAvatar(filePath) {
-        // 在这里实现上传头像的逻辑,将filePath作为参数传入
-        const res = await uploadFile(filePath)
-        if(res.statusCode === 200 && res.data){
-          const resp = JSON.parse(res.data)
-          this.userInfo.avatar = resp.data.url
-        }
-      },
-
-      // 点击提交按钮
-      handlerSubmitBtn() {
-        this.$store.dispatch('UpdateUserInfo',this.userInfo).then(res=>{
-          setTimeout(()=>{
-            uni.navigateBack(-1)
-          },1500)
-        })
-      }
-    }
-  }
+	import { getUserInfo } from '@/api/user';
+	export default {
+		data() {
+			return {
+				queryParams: {
+					avatar: '', // 头像
+					gender: '', //性别
+					birthday: '', //生日
+					nickname: '', //昵称
+				},
+				time_value: '',
+				timeShow: false,
+				sexList: [{
+						id: 0,
+						name: '男'
+					},
+					{
+						id: 1,
+						name: '女'
+					},
+					{
+						id: 2,
+						name: '沃尔玛塑料袋'
+					}
+				],
+				current: 0
+			}
+		},
+		mounted(){
+			getUserInfo().then(res=>{
+				console.log("@@@res",res)
+				this.queryParams.avatar = res.data.avatar
+				this.queryParams.nickname = res.data.nickname
+				// this.queryParams.gender = res.data.gender
+			})
+		},
+		methods: {
+			// 选择性别
+			handlerSelectGender(item) {
+				this.current = item.id
+			},
+			// 选择时间
+			confirmTime(e) {
+				this.timeShow = false
+				let time = new Date(e.value)
+				let year = time.getFullYear()
+				let month = time.getMonth() + 1
+				let date = time.getDate()
+				if (month < 10) {
+					month = '0' + month
+				}
+				if (date < 10) {
+					date = '0' + date
+				}
+				this.queryParams.birthday = year + '-' + month + '-' + date
+
+			},
+			// 上传头像
+			async handlerUploadImg() {
+				try {
+					const res = await uni.showActionSheet({
+						itemList: ['拍照', '从相册选择'],
+					});
+
+					if (res.tapIndex === 0) {
+						// 用户选择拍照
+						this.takePhoto();
+					} else if (res.tapIndex === 1) {
+						// 用户选择从相册选择
+						this.chooseImage();
+					}
+				} catch (error) {
+					console.error(error);
+				}
+			},
+			// 拍照
+			takePhoto() {
+			  uni.chooseImage({
+			    sourceType: ['camera'],
+			    count: 9,
+			    success: res => {
+			      const tempFilePaths = res.tempFilePaths;
+				  console.log('@@@@tempFilePaths',tempFilePaths);
+			      // 调用上传图片的方法
+			      this.uploadAvatar(tempFilePaths[0]);
+			    },
+			    fail: error => {
+			      console.error(error);
+			    },
+			  });
+			},
+			//从相册中选择
+			chooseImage() {
+			  uni.chooseImage({
+			    sourceType: ['album'],
+			    count: 9,
+			    success: res => {
+			      const tempFilePaths = res.tempFilePaths;
+				  console.log('@@@@tempFilePaths',tempFilePaths);
+			      // 调用上传图片的方法
+			      this.uploadAvatar(tempFilePaths[0]);
+			    },
+			    fail: error => {
+			      console.error(error);
+			    },
+			  });
+			},
+			// 上传头像
+			uploadAvatar(filePath) {
+			  // 在这里实现上传头像的逻辑,将filePath作为参数传入
+			  this.queryParams.avatar = filePath;
+			  this.$forceUpdate(); // 手动触发组件的重新渲染
+			},
+			
+			// 点击提交按钮
+			handlerSubmitBtn() {
+				this.queryParams.gender = this.sexList[this.current].name
+				console.log('@@@@queryParams', this.queryParams);
+			}
+		}
+	}
 </script>
 
 <style lang="scss" scoped>
-.root{
-  background-color: #f3f3f3;
-  height: calc(100vh -  env(safe-area-inset-top));
-  position: relative;
-  .content-box{
-    background-color: #fff;
-  }
-  .btn-box{
-    position: absolute;
-    bottom: 0;
-    padding: 32rpx 16rpx;
-    box-sizing: border-box;
-    width: 100%;
-  }
-}
-</style>
+	.ccontainer {
+		padding: 20rpx;
+		box-sizing: border-box;
+		font-size: 28rpx;
+
+		.item-box {
+			display: flex;
+			padding: 20rpx;
+			box-shadow: 0 5rpx 15rpx 0rpx rgba(0, 0, 0, 0.1);
+			border-radius: 20rpx;
+			margin-bottom: 20rpx;
+			align-items: center;
+
+			.item-left {
+				margin-right: 20rpx;
+				width: 13%;
+			}
+
+			.item-right {
+				width: 87%;
+
+				.img {
+					width: 80rpx;
+					height: 80rpx;
+					border-radius: 50%;
+				}
+
+				.sex-item {
+					display: flex;
+
+					.item {
+						padding: 20rpx 30rpx;
+						background-color: #F7F7F7;
+						border-radius: 10rpx;
+						text-align: center;
+						font-size: 28rpx;
+					}
+
+					.act-sex {
+						border: 2rpx solid #5992BB;
+						background-color: #5992BB;
+						color: #fff !important;
+					}
+				}
+			}
+
+			.right-time-box {
+				display: flex;
+				justify-content: space-between;
+			}
+
+			.flex-end {
+				display: flex;
+				justify-content: flex-end;
+			}
+		}
+
+		.btn-box {
+			margin-top: 100rpx;
+
+			.btn {
+				border-radius: 20rpx;
+				padding: 10rpx;
+				font-size: 28rpx;
+				color: #fff;
+				background: linear-gradient(to right, #e8cbc0, #636fa4);
+				box-shadow: 0 5rpx 15rpx 0 rgba(99, 111, 164, 0.2);
+			}
+		}
+	}
+
+	.gray-color {
+		color: #D2D5DB;
+	}
+</style>

+ 251 - 244
src/pages/client/tabBar/home/index.vue

@@ -1,261 +1,268 @@
 <template>
-  <view class="home">
-    <view>
-      <!-- 顶部导航 -->
-      <view class="nav-bar">
-        <u-navbar :bgColor="'#ffffff'" :placeholder="true">
-          <view slot="left" @click="manualGetLocation">
-            <text>地址</text>
-            <text class="iconfont icon-chevron-down" />
-          </view>
-          <view slot="center">
-            <u-search placeholder="请输入搜索内容" :showAction="false" v-model="keyword"
-              @click="$Router.push('/pages/client/clientPackage/search')" :disabled="true" />
-          </view>
-        </u-navbar>
-      </view>
+	<view class="home">
+		<view>
+			<!-- 顶部导航 -->
+			<view class="nav-bar">
+				<u-navbar :bgColor="'#ffffff'" :placeholder="true">
+					<view slot="left" @click="manualGetLocation">
+						<text>{{ nowAddress }}</text>
+						<text class="iconfont icon-chevron-down" />
+					</view>
+					<view slot="center">
+						<u-search placeholder="请输入搜索内容" :showAction="false" v-model="keyword"
+							@click="$Router.push('/pages/client/clientPackage/search')" :disabled="true" />
+					</view>
+				</u-navbar>
+			</view>
 
-      <!-- 轮播图 -->
-      <view class="home-swiper">
-        <u-swiper :list="swiperUrlList" @click="handlerSwiperSkip" indicator />
-      </view>
+			<!-- 轮播图 -->
+			<view class="home-swiper">
+				<u-swiper :list="swiperUrlList" @click="handlerSwiperSkip" indicator />
+			</view>
 
-      <!-- 商品分类 -->
-      <view class="home-list">
-        <u-grid :border="false" col="5">
-          <u-grid-item v-for="item in categories" :key="item.id" @tap="handleMenuClick(item)">
-            <u-icon :customStyle="{ paddingTop: 20 + 'rpx' }" :name="item.icon" :size="25"></u-icon>
-            <text class="grid-text">{{ item.name }}</text>
-          </u-grid-item>
-        </u-grid>
-        <u-toast ref="uToast" />
-      </view>
+			<!-- 商品分类 -->
+			<view class="home-list">
+				<u-grid :border="false" col="5">
+					<u-grid-item v-for="item in categories" :key="item.id" @tap="handleMenuClick(item)">
+						<u-icon :customStyle="{ paddingTop: 20 + 'rpx' }" :name="item.icon" :size="25"></u-icon>
+						<text class="grid-text">{{ item.name }}</text>
+					</u-grid-item>
+				</u-grid>
+				<u-toast ref="uToast" />
+			</view>
 
-      <!-- 热门推荐 -->
-      <view class="hot">
-        <u-cell :border="false" value="查看更多" isLink @click="$Router.push('/pages/client/clientPackage/storeHot')">
-          <view slot="title" class="hot-title"> 热门推荐 </view>
-        </u-cell>
-        <block v-if="homeData.recommends && homeData.recommends.length > 0">
-          <view>
-            <u-grid :border="false" col="2">
-              <u-grid-item @click="$Router.push(`/pages/client/clientPackage/storeDetail?id=${item.id}`)"
-                v-for="item in homeData.recommends" :key="item.id">
-                <recommend-item :item="item"></recommend-item>
-              </u-grid-item>
-            </u-grid>
-          </view>
-        </block>
-        <block v-else>
-          <u-empty icon="/static/default-graph/no-business.png" text="暂无推荐商家"></u-empty>
-        </block>
-      </view>
+			<!-- 热门推荐 -->
+			<view class="hot">
+				<u-cell :border="false" value="查看更多" isLink
+					@click="$Router.push('/pages/client/clientPackage/storeHot')">
+					<view slot="title" class="hot-title"> 热门推荐 </view>
+				</u-cell>
+				<block v-if="homeData.recommends && homeData.recommends.length > 0">
+					<view>
+						<u-grid :border="false" col="2">
+							<u-grid-item @click="$Router.push(`/pages/client/clientPackage/storeDetail?id=${item.id}`)"
+								v-for="item in homeData.recommends" :key="item.id">
+								<recommend-item :item="item"></recommend-item>
+							</u-grid-item>
+						</u-grid>
+					</view>
+				</block>
+				<block v-else>
+					<u-empty icon="/static/default-graph/no-business.png" text="暂无推荐商家"></u-empty>
+				</block>
+			</view>
 
-      <!-- 附近商家 -->
-      <view class="near">
-        <u-cell :border="false" value="查看更多" isLink @click="$Router.push('/pages/client/clientPackage/storeNearby')">
-          <view slot="title" class="near-title"> 附近商家 </view>
-        </u-cell>
-        <block v-if="homeData.nears && homeData.nears.length > 0">
-          <view>
-            <u-grid :border="false" col="2">
-              <u-grid-item @click="$Router.push(`/pages/client/clientPackage/storeDetail?id=${item.id}`)"
-                v-for="item in homeData.nears" :key="item.id">
-                <hot-item :item="item"></hot-item>
-              </u-grid-item>
-            </u-grid>
-          </view>
-        </block>
-        <block v-else>
-          <u-empty icon="/static/default-graph/no-business.png" text="暂无附近商家"></u-empty>
-        </block>
-      </view>
+			<!-- 附近商家 -->
+			<view class="near">
+				<u-cell :border="false" value="查看更多" isLink
+					@click="$Router.push('/pages/client/clientPackage/storeNearby')">
+					<view slot="title" class="near-title"> 附近商家 </view>
+				</u-cell>
+				<block v-if="homeData.nears && homeData.nears.length > 0">
+					<view>
+						<u-grid :border="false" col="2">
+							<u-grid-item @click="$Router.push(`/pages/client/clientPackage/storeDetail?id=${item.id}`)"
+								v-for="item in homeData.nears" :key="item.id">
+								<hot-item :item="item"></hot-item>
+							</u-grid-item>
+						</u-grid>
+					</view>
+				</block>
+				<block v-else>
+					<u-empty icon="/static/default-graph/no-business.png" text="暂无附近商家"></u-empty>
+				</block>
+			</view>
 
-      <!-- 询价 -->
-      <drag-button :isDock="true" :existTabBar="true" @btnClick="btnClick" />
-    </view>
+			<!-- 询价 -->
+			<!-- <drag-button :isDock="true" :existTabBar="true" @btnClick="btnClick" /> -->
+		</view>
 
-    <tabbar currentTab="clientHome" />
-  </view>
+		<tabbar currentTab="clientHome" />
+	</view>
 </template>
 
 <script>
-  import {
-    getCurrentLocation,
-    getHomePageApi,
-    getSwiperListApi
-  } from '@/api/client/home';
-  import {
-    mapGetters
-  } from 'vuex';
-  import RecommendItem from '@/components/merchant/RecommendItem.vue';
-  import HotItem from '@/components/merchant/HotItem.vue';
-  import dragButton from '@/components/drag/drag-button.vue';
+	import {
+		getCurrentLocation,
+		getHomePageApi,
+		getSwiperListApi
+	} from '@/api/client/home';
+	import {
+		mapGetters
+	} from 'vuex';
+	import RecommendItem from '@/components/merchant/RecommendItem.vue';
+	import HotItem from '@/components/merchant/HotItem.vue';
+	import dragButton from '@/components/drag/drag-button.vue';
+	import { getMapLocation } from "@/utils/mapUtil.js"
+	export default {
+		components: {
+			RecommendItem,
+			HotItem,
+			dragButton,
+		},
+		data() {
+			return {
+				list: [],
+				keyword: '',
+				swiperUrlList: [], // 轮播图url列表
+				swiperList: [],
+				homeData: {
+					categories: [],
+					nears: [],
+					recommends: [],
+				},
+				queryParams: {
+					longitude: '',
+					latitude: '',
+					region: ''
+				},
+				nowAddress: '', //当前地址
+			};
+		},
 
-  export default {
-    components: {
-      RecommendItem,
-      HotItem,
-      dragButton,
-    },
-    data() {
-      return {
-        list: [],
-        keyword: '',
-        swiperUrlList: [], // 轮播图url列表
-        swiperList:[],
-        homeData: {
-          categories: [],
-          nears: [],
-          recommends: [],
-        },
-        queryParams:{
-          longitude:'',
-          latitude:'',
-          region:''
-        }
-      };
-    },
+		computed: {
+			...mapGetters(['location']),
+			categories() {
+				let initData = this.homeData.categories.map(item => {
+					if (!item.icon) {
+						item.icon = 'level';
+					}
+					return item;
+				});
+				let result =
+					initData.length > 14 ?
+					initData.splice(0, 14).concat([{
+						id: 'all',
+						icon: 'grid-fill',
+						name: '全部',
+						type: {
+							code: 'ALL',
+							description: '全部',
+						},
+					}, ]) :
+					initData.push({
+						id: 'all',
+						icon: 'grid-fill',
+						name: '全部',
+					});
+				return result;
+			},
+		},
+		mounted() {
+			this.getSwiperList();
+			// 页面显示时  获取当前零维度
+			uni.getLocation({
+				type: 'gcj02',
+				success: res => {
+					let { longitude, latitude } = res
+					this.queryParams.longitude = longitude;
+					this.queryParams.latitude = latitude;
+					// getCurrentLocation 获取当前编码region
+					this.handlerGetRegion(longitude, latitude)
+				},
+				fail: () => {
+					this.manualGetLocation();
+				},
+			});
+		},
+		methods: {
+			// 获取当前编码region
+			handlerGetRegion(longitude, latitude) {
+				getCurrentLocation({ latitude, longitude }).then(res => {
+					console.log("getCurrentLocation",res)
+					let { district, id } = res.data
+					this.queryParams.region = id;
+					this.nowAddress = district.name
+					this.getHomeData(this.queryParams)
+					this.$store.commit('SET_LOCATION', {
+						longitude: longitude,
+						latitude: latitude,
+						region: res.data.id,
+					});
+				})
+			},
+			/* 轮播图 */
+			getSwiperList() {
+				getSwiperListApi().then(res => {
+					this.swiperList = res.data
+					res.data.map(rs => {
+						this.swiperUrlList.push(rs.viewUrl)
+					})
+				});
+			},
+			// 获取首页数据
+			getHomeData(location) {
+				getHomePageApi(location)
+					.then(res => {
+						this.homeData = res.data;
+						// 将分类数据做缓存处理
+						this.$store.commit('SET_CATEGORIES', this.homeData.categories);
+					})
+			},
+			// 手动选择城市
+			manualGetLocation() {
+				// getMapLocation()
+				uni.chooseLocation({
+					success: res => {
+						console.log("chooseLocation",res)
+						let { longitude , latitude } = res
+						this.queryParams.longitude = longitude.toFixed(5);
+						this.queryParams.latitude = latitude.toFixed(5);
+						this.handlerGetRegion(longitude.toFixed(5) , latitude.toFixed(5))
+					},
+					fail: err => {
+						
+					}
+				});
+			},
+			// 点击swiper跳转
+			handlerSwiperSkip(e) {
+				console.log("@@@swiperList", this.swiperList[e])
+			},
+			// 点击菜单
+			handleMenuClick(item) {
+				if (item.id === 'all') {
+					this.$Router.push('/pages/client/clientPackage/category');
+				} else {
+					uni.navigateTo({
+						url: `/pages/client/clientPackage/storeList?id=${item.id}`,
+					});
+				}
+			},
 
-    computed: {
-      ...mapGetters(['location']),
-      categories() {
-        let initData = this.homeData.categories.map(item => {
-          if (!item.icon) {
-            item.icon = 'level';
-          }
-          return item;
-        });
-        let result =
-          initData.length > 14 ?
-          initData.splice(0, 14).concat([{
-            id: 'all',
-            icon: 'grid-fill',
-            name: '全部',
-            type: {
-              code: 'ALL',
-              description: '全部',
-            },
-          }, ]) :
-          initData.push({
-            id: 'all',
-            icon: 'grid-fill',
-            name: '全部',
-          });
-        return result;
-      },
-    },
+			/* 询价 */
+			btnClick() {
+				// uni.chooseImage({
+				//   count: 9,
+				//   sizeType: ['original', 'compressed'],
+				//   sourceType: ['camera', 'album'],
+				//   success: res => {
+				//     const tempFilePaths = res.tempFilePaths;
+				//     this.uploadFileAlbum();
+				//   },
+				// });
 
-    onShow() {
-      // 页面显示时  获取当前零维度
-        uni.getLocation({
-          type: 'gcj02',
-          success: res => {
-            this.queryParams.longitude = res.longitude;
-            this.queryParams.latitude = res.latitude;
-            // getCurrentLocation 获取当前编码region
-            getCurrentLocation({latitude: res.latitude,longitude: res.longitude}).then(rs=>{
-              this.queryParams.region = rs.data.id;
-              this.getHomeData(this.queryParams)
-              this.$store.commit('SET_LOCATION', {
-                longitude: res.longitude,
-                latitude: res.latitude,
-                region: rs.data.id,
-              });
-            })
-          },
-          fail: () => {
-            this.manualGetLocation();
-          },
-        });
-    },
-    mounted() {
-      this.getSwiperList();
-    },
-    methods: {
-      /* 轮播图 */
-      getSwiperList() {
-        getSwiperListApi().then(res => {
-          this.swiperList = res.data
-          res.data.map(rs => {
-            this.swiperUrlList.push(rs.viewUrl)
-          })
-        });
-      },
-      // 获取首页数据
-      getHomeData(location) {
-        getHomePageApi(location)
-          .then(res => {
-            this.homeData = res.data;
-            // 将分类数据做缓存处理
-            this.$store.commit('SET_CATEGORIES', this.homeData.categories);
-          })
-          .catch(err => {
-            console.log(err);
-          });
-      },
-      // 手动选择城市
-      manualGetLocation() {
-        console.log("@@@@")
-        // uni.chooseLocation({
-        //   success: res => {
-        //     this.$store.commit('SET_LOCATION', {
-        //       longitude: res.longitude,
-        //       latitude: res.latitude,
-        //     });
-        //   },fail:err=>{
+				uni.navigateTo({
+					url: `/pages/client/clientUser/inquiry`,
+				});
+			},
 
-        //   }
-        // });
-      },
-      // 点击swiper跳转
-      handlerSwiperSkip(e){
-        console.log("@@@swiperList", this.swiperList[e])
-      },
-      // 点击菜单
-      handleMenuClick(item) {
-        if (item.id === 'all') {
-          this.$Router.push('/pages/client/clientPackage/category');
-        } else {
-          uni.navigateTo({
-            url: `/pages/client/clientPackage/storeList?id=${item.id}`,
-          });
-        }
-      },
-
-      /* 询价 */
-      btnClick() {
-        // uni.chooseImage({
-        //   count: 9,
-        //   sizeType: ['original', 'compressed'],
-        //   sourceType: ['camera', 'album'],
-        //   success: res => {
-        //     const tempFilePaths = res.tempFilePaths;
-        //     this.uploadFileAlbum();
-        //   },
-        // });
-
-        uni.navigateTo({
-          url: `/pages/client/clientUser/inquiry`,
-        });
-      },
-
-      // uploadFileAlbum() {
-      //   uni.uploadFile({
-      //     url: '', //服务器地址
-      //     fileType: 'image', //ZFB必填,不然报错
-      //     filePath: tempFilePaths[0], //这个就是我们上面拍照返回或者先中照片返回的数组
-      //     name: 'imgFile',
-      //     success: uploadFileRes => {
-      //       let imgData = JSON.parse(uploadFileRes.data);
-      //       this.imgDataUrl = imgData.data.imgUrl;
-      //     },
-      //   });
-      // },
-    },
-  };
+			// uploadFileAlbum() {
+			//   uni.uploadFile({
+			//     url: '', //服务器地址
+			//     fileType: 'image', //ZFB必填,不然报错
+			//     filePath: tempFilePaths[0], //这个就是我们上面拍照返回或者先中照片返回的数组
+			//     name: 'imgFile',
+			//     success: uploadFileRes => {
+			//       let imgData = JSON.parse(uploadFileRes.data);
+			//       this.imgDataUrl = imgData.data.imgUrl;
+			//     },
+			//   });
+			// },
+		},
+	};
 </script>
 
 <style lang="scss" scoped>
-  @import './index.scss';
-</style>
+	@import './index.scss';
+</style>

+ 3 - 2
src/pages/client/tabBar/mine/index.scss

@@ -63,8 +63,9 @@
   .income {
     padding: 20rpx;
     border-radius: 10rpx;
-    margin: 100rpx 20rpx 20rpx 20rpx;
-    background-color: $uni-bg-color;
+    // margin: 100rpx 20rpx 20rpx 20rpx;
+    margin: 40rpx 20rpx 20rpx 20rpx;
+    // background-color: $uni-bg-color;
 
     .income-head {
       display: flex;

+ 132 - 117
src/pages/client/tabBar/mine/index.vue

@@ -1,125 +1,140 @@
 <template>
-  <view class="container">
-    <view :style="{ height: systemBar + 'px', backgroundColor: '#337bad' }" />
-    <view>
-      <view class="head-info">
-        <view class="head-flex">
-          <view style="margin-right: 20rpx">
-            <u-avatar
-              :src="avatar"
-              size="80"
-              @tap="$Router.push('/pages/client/clientUser/personal')"
-            />
-          </view>
-          <view>
-            <view class="nickname">{{ nickname }}</view>
-            <view class="flex">
-              <text class="setAuth" @tap="$Router.push('/pages/client/clientUser/mine/setting')">
-                设置
-              </text>
-              <!-- <text class="setAuth">认证</text> -->
-            </view>
-          </view>
-          <view @tap="$Router.push('/pages/client/clientUser/mine/setting')">
-            <u-icon name="setting" color="#ffffff" size="26"></u-icon>
-          </view>
-        </view>
-        <!-- 列表 -->
-        <view class="Collect">
-          <u-grid :border="false" col="4">
-            <u-grid-item v-for="(listItem, listIndex) in collectList" :key="listIndex"
-              @tap="$Router.push(listItem.url)">
-              <u-icon :customStyle="{ paddingTop: 20 + 'rpx' }" :name="listItem.name" :size="28" color="#fff" />
-              <text class="grid-text">{{ listItem.title }}</text>
-            </u-grid-item>
-          </u-grid>
-        </view>
-        <!-- 订单 -->
-        <view class="order-out-box">
-          <view class="order-inner-box">
-            <u-grid :border="false" col="4" style="background-color: #fff">
-              <u-grid-item v-for="(listItem, listIndex) in oderList" :key="listIndex" @tap="gotoOrder(listItem)">
-                <u-icon :name="listItem.name" :size="34" />
-                <text class="grid-text">{{ listItem.title }}</text>
-              </u-grid-item>
-            </u-grid>
-          </view>
-        </view>
-      </view>
+	<view class="container">
+		<view :style="{ height: systemBar + 'px', backgroundColor: '#337bad' }" />
+		<view>
+			<view class="head-info">
+				<view class="head-flex">
+					<view class="flex">
+						<view style="margin-right: 20rpx">
+							<u-avatar :src="avatar" size="80"
+								@tap="$Router.push('/pages/client/clientUser/personal')" />
+						</view>
+						<view>
+							<view class="nickname">{{ nickname }}</view>
+							<view class="flex">
+								<text class="setAuth" @tap="$Router.push('/pages/client/clientUser/mine/setting')">
+									设置
+								</text>
+								<!-- <text class="setAuth">认证</text> -->
+							</view>
+						</view>
+					</view>
 
-      <!-- 我的收益 -->
-      <view class="income" @click="handlerSkipMyProfit">
-        <view class="income-head">
-          <text class="my-income">我的钱包</text>
-          <u-icon name="arrow-right" />
-        </view>
-        <view class="income-content">
-          <u-grid :border="false" col="4" bgColor="#fff">
-            <u-grid-item v-for="(listItem, listIndex) in incomeList" :key="listIndex">
-              <view class="num-box">{{ listItem.num }}元</view>
-              <view class="num-title">{{ listItem.title }}</view>
-            </u-grid-item>
-          </u-grid>
-        </view>
-      </view>
-      <!-- 列表 -->
-      <TapList></TapList>
-    </view>
-    <tabbar currentTab="clientMine" />
-  </view>
+					<view @tap="$Router.push('/pages/client/clientUser/mine/setting')">
+						<u-icon name="setting" color="#ffffff" size="26"></u-icon>
+					</view>
+				</view>
+				<!-- 列表 -->
+				<view class="Collect">
+					<u-grid :border="false" col="4">
+						<u-grid-item v-for="(listItem, listIndex) in collectList" :key="listIndex"
+							@tap="$Router.push(listItem.url)">
+							<u-icon :customStyle="{ paddingTop: 20 + 'rpx' }" :name="listItem.name" :size="28"
+								color="#fff" />
+							<text class="grid-text">{{ listItem.title }}</text>
+						</u-grid-item>
+					</u-grid>
+				</view>
+				<!-- 订单 -->
+				<view class="order-out-box">
+					<view class="order-inner-box">
+						<u-grid :border="false" col="4" style="background-color: #fff">
+							<u-grid-item v-for="(listItem, listIndex) in oderList" :key="listIndex"
+								@tap="gotoOrder(listItem)">
+								<u-icon :name="listItem.name" :size="34" />
+								<text class="grid-text">{{ listItem.title }}</text>
+							</u-grid-item>
+						</u-grid>
+					</view>
+				</view>
+			</view>
+
+			<!-- 我的收益 -->
+			<!-- <view class="income" @click="handlerSkipMyProfit"> -->
+			<view class="income" >
+				<!-- <view class="income-head">
+					<text class="my-income">我的钱包</text>
+					<u-icon name="arrow-right" />
+				</view>
+				<view class="income-content">
+					<u-grid :border="false" col="4" bgColor="#fff">
+						<u-grid-item v-for="(listItem, listIndex) in incomeList" :key="listIndex">
+							<view class="num-box">{{ listItem.num }}元</view>
+							<view class="num-title">{{ listItem.title }}</view>
+						</u-grid-item>
+					</u-grid>
+				</view> -->
+				
+			</view>
+			<!-- 列表 -->
+			<TapList></TapList>
+			
+		</view>
+		<tabbar currentTab="clientMine" />
+	</view>
 </template>
 
 <script>
-import { collectList, oderList, incomeList, listData } from './mine';
-import { mapGetters } from 'vuex';
-import TapList from './TapList.vue';
-export default {
-  components: {
-    TapList,
-  },
-  data() {
-    return {
-      system: {},
-      systemBar: 0,
-      collectList,
-      oderList,
-      incomeList,
-      listData,
-    };
-  },
-  computed:{
-    ...mapGetters(['userId','gender','avatar','nickname'])
-  },
-  methods: {
-    getHeight() {
-      wx.getSystemInfo({
-        success: res => {
-          this.system = res;
-        },
-      });
-      this.systemBar = this.system.statusBarHeight;
-      console.log(this.systemBar);
-    },
-    // 点击跳转到全部订单
-    gotoOrder(item) {
-      this.$store.commit('order/GET_ORDER_TYPE',item)
-      uni.navigateTo({
-        url: `/pages/client/clientPackage/orderAll`,
-      });
-    },
-    // 点击跳转到我的收益
-    handlerSkipMyProfit() {
-      uni.navigateTo({
-        url: '/pages/client/clientUser/myProfit',
-      });
-    },
-  },
-  onLoad() {
-    this.getHeight();
-  },
-};
+	import {
+		collectList,
+		oderList,
+		incomeList,
+		listData
+	} from './mine';
+	import {
+		mapGetters
+	} from 'vuex';
+	import TapList from './TapList.vue';
+	export default {
+		components: {
+			TapList,
+		},
+		data() {
+			return {
+				system: {},
+				systemBar: 0,
+				collectList,
+				oderList,
+				incomeList,
+				listData,
+			};
+		},
+		computed: {
+			...mapGetters(['userId', 'gender', 'avatar', 'nickname'])
+		},
+		methods: {
+			getHeight() {
+				wx.getSystemInfo({
+					success: res => {
+						this.system = res;
+					},
+				});
+				this.systemBar = this.system.statusBarHeight;
+			},
+			// 点击跳转到全部订单
+			gotoOrder(item) {
+				this.$store.commit('order/GET_ORDER_TYPE', item)
+				uni.navigateTo({
+					url: `/pages/client/clientPackage/orderAll`,
+				});
+			},
+			// 点击跳转到我的收益
+			handlerSkipMyProfit() {
+				uni.navigateTo({
+					url: '/pages/client/clientUser/myProfit',
+				});
+			},
+		},
+		onLoad() {
+			this.getHeight();
+		},
+	};
 </script>
 
 <style lang="scss" scoped>
-  @import './index.scss';
-</style>
+	@import './index.scss';
+
+	.flex {
+		display: flex;
+	}
+</style>

+ 5 - 5
src/pages/client/tabBar/mine/mine.js

@@ -4,11 +4,11 @@ export const collectList = [
     title: '收藏',
     url: '/pages/client/clientUser/collectList',
   },
-  {
-    name: 'lock',
-    title: '积分',
-    url: '/pages/client/clientUser/myScore/index',
-  },
+  // {
+  //   name: 'lock',
+  //   title: '积分',
+  //   url: '/pages/client/clientUser/myScore/index',
+  // },
   {
     name: 'star',
     title: '购物车',

+ 6 - 6
src/pages/login/phoneLogin.vue

@@ -90,25 +90,25 @@ export default {
       if(!MOBILE_REG.test(this.mobile)){
         return uni.$u.toast('请输入合法手机号')
       }
-      if(!SMS_REG.test(this.captcha)){
-        return uni.$u.toast('请输入6位数字验证码')
-      }
+      // if(!SMS_REG.test(this.captcha)){
+      //   return uni.$u.toast('请输入6位数字验证码')
+      // }
       const data = {
         mobile:this.mobile,
         captcha:this.captcha,
         code:this.code,
       }
-      this.loading = true
+      // this.loading = true
       this.$store.dispatch('LoginBySmsCode', data)
         .then(() => {
           this.$store.dispatch('SwitchIdentity','CUSTOMER')
           this.$Router.pushTab('/pages/client/tabBar/home/index');
-          this.loading = false;
+          // this.loading = false;
           this.$store.dispatch('GetUserInfo')
           uni.$u.toast('登录成功');
         })
         .catch(() => {
-          this.loading = false;
+          // this.loading = false;
           uni.$u.toast('登录失败');
         });
     },

+ 5 - 1
src/store/modules/auth.js

@@ -92,7 +92,11 @@ export default {
               commit('SET_SCOPE', res.data.scope);
               resolve();
             } else {
-              reject()
+              uni.showToast({
+              	title:res.message,
+				icon:'none'
+              })
+			  return 
             }
           })
           .catch(err => {

+ 61 - 0
src/utils/mapUtil.js

@@ -0,0 +1,61 @@
+ export function getMapLocation(){
+	 	uni.chooseLocation({
+	 		success:(res)=> {
+	 			console.log(res);
+	 			// this.getRegionFn(res);
+	 		},
+	 		fail:()=>{
+	 			// 如果用uni.chooseLocation没有获取到地理位置,则需要获取当前的授权信息,判断是否有地理授权信息
+	 			uni.getSetting({
+	 				success: (res) => {
+	 					console.log(res);
+	 					var status = res.authSetting;
+	 					if(!status['scope.userLocation']){
+	 					// 如果授权信息中没有地理位置的授权,则需要弹窗提示用户需要授权地理信息
+	 						uni.showModal({
+	 							title:"是否授权当前位置",
+	 							content:"需要获取您的地理位置,请确认授权,否则地图功能将无法使用",
+	 							success:(tip)=>{
+	 								if(tip.confirm){
+	 								// 如果用户同意授权地理信息,则打开授权设置页面,判断用户的操作
+	 									uni.openSetting({
+	 										success:(data)=>{
+	 										// 如果用户授权了地理信息在,则提示授权成功
+	 											if(data.authSetting['scope.userLocation']===true){
+	 												uni.showToast({
+	 													title:"授权成功",
+	 													icon:"success",
+	 													duration:1000
+	 												})
+	 												// 授权成功后,然后再次chooseLocation获取信息
+	 												uni.chooseLocation({
+	 													success: (res) => {
+	 														console.log("详细地址",res);
+	 														// this.getRegionFn(res);
+	 													}
+	 												})
+	 											}else{
+	 												uni.showToast({
+	 													title:"授权失败",
+	 													icon:"none",
+	 													duration:1000
+	 												})
+	 											}
+	 										}
+	 									})
+	 								}
+	 							}
+	 						})
+	 					}
+	 				},
+	 				fail: (res) => {
+	 					uni.showToast({
+	 						title:"调用授权窗口失败",
+	 						icon:"none",
+	 						duration:1000
+	 					})
+	 				}
+	 			})
+	 		}
+	 	});
+ }

+ 1 - 0
src/utils/request.js

@@ -6,6 +6,7 @@ import { getAccessToken, setAccessToken, setRefreshToken, refreshToken, isRefres
 // 每次请求都创建一个新的实例
 const instance = axios.create({
   baseURL: "https://test.api.chelvc.com",
+  // baseURL: "https://358175z5l5.yicp.fun",
   timeout: 10000,
   adapter: UniAdapter
 });

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно