Prechádzať zdrojové kódy

用户体系优化V1.0.0

zhengjinyi 5 rokov pred
rodič
commit
42b0e7f5fa
40 zmenil súbory, kde vykonal 3404 pridanie a 37 odobranie
  1. 9 1
      common/css/iconfont.scss
  2. 3 3
      components/module/listTemplate/commodityList.vue
  3. 3 3
      components/module/noLogin/nologin.vue
  4. 1 1
      home.vue
  5. 55 0
      json.js
  6. 86 13
      pages.json
  7. 3 3
      pages/goods/product.vue
  8. 1 1
      pages/search/search.vue
  9. 186 0
      pages/tabBar/category/category.vue
  10. 4 6
      pages/tabBar/home/home.vue
  11. 1 1
      pages/tabBar/user/user.vue
  12. 0 0
      pages/user-module/apply.vue
  13. 267 0
      pages/user-module/bindemail.vue
  14. 292 0
      pages/user-module/bindwechat.vue
  15. 292 0
      pages/user-module/information.vue
  16. 362 0
      pages/user-module/login-accont.vue
  17. 292 0
      pages/user-module/login.vue
  18. 292 0
      pages/user-module/password.vue
  19. 292 0
      pages/user-module/register.vue
  20. 8 0
      pages/user/operator/addoperator.vue
  21. 8 0
      pages/user/operator/list.vue
  22. 2 2
      pages/user/regularPurchase/regularPurchase.vue
  23. 314 0
      pages/user/setting/password.vue
  24. 314 0
      pages/user/setting/phone.vue
  25. 314 0
      pages/user/setting/setting.vue
  26. BIN
      static/cart-current@3x.png
  27. BIN
      static/cart@3x.png
  28. BIN
      static/home-current@3x.png
  29. BIN
      static/home@3x.png
  30. BIN
      static/icon-cart-active@3x.png
  31. BIN
      static/icon-cart@3x.png
  32. BIN
      static/icon-home-active@3x.png
  33. BIN
      static/icon-home@3x.png
  34. BIN
      static/icon-sort-active@3x.png
  35. BIN
      static/icon-sort@3x.png
  36. BIN
      static/icon-user-active@3x.png
  37. BIN
      static/icon-user@3x.png
  38. BIN
      static/user-current@3x.png
  39. BIN
      static/user@3x.png
  40. 3 3
      store/index.js

+ 9 - 1
common/css/iconfont.scss

@@ -4,7 +4,7 @@
 	font-family: iconfont;
 	font-weight: normal;
 	font-style: normal;
-	src: url('https://at.alicdn.com/t/font_1519039_86tu11fouc7.ttf') format('truetype');
+	src: url('https://at.alicdn.com/t/font_1519039_l1haqxf94re.ttf') format('truetype');
 }
 .iconfont {
 	font-family: "iconfont" !important;
@@ -13,6 +13,14 @@
 	-webkit-font-smoothing: antialiased;
 	-moz-osx-font-smoothing: grayscale;
 }
+.icon-yanjing_xianshi_o:before {
+  content: "\ebcc";
+}
+
+.icon-yanjing_yincang_o:before {
+  content: "\ebcd";
+}
+
 .icon-shanchu1:before {
   content: "\e64b";
 }

+ 3 - 3
components/module/listTemplate/commodityList.vue

@@ -29,7 +29,7 @@
 			<text v-if="cartNum > 0" class="uni-badge uni-badge-error uni-small uni-badge--small icon-num">
 				{{cartNum}}
 			</text>
-			<image src='../../../static/cart-current@3x.png' mode="widthFix"></image>
+			<image src='../../../static/icon-cart-active@3x.png' mode="widthFix"></image>
 		</view>
 		<view class="empty-container" v-if="showEmpty && !fromRegularPurchasePage">
 			<image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AY2ZjAABpmnBICH4247.png"></image>
@@ -97,7 +97,7 @@
 			toLoginPage() {
 				const {lastPageType, lastPageVal} = this.$parent;
 				uni.navigateTo({
-					url:`/pages/login/login?listType=${lastPageType}&listVal=${lastPageVal}`
+					url:`/pages/user-module/login?listType=${lastPageType}&listVal=${lastPageVal}`
 				})
 			},
 			toLower() {
@@ -122,7 +122,7 @@
 				if(loadMore) {
 					self.pageNum += 1;
 				}
-				if(self.$parent.lastPageType === '常采购商品') {
+				if(self.$parent.lastPageType === '再次购买') {
 					self.fromRegularPurchasePage = true;
 				}
 				self.$api.get(thisServerurl,{index:self.pageNum,pageSize:self.pageSize,

+ 3 - 3
components/module/noLogin/nologin.vue

@@ -64,11 +64,11 @@
 				let self = this
 				let url;
 				if(self.alertType =='3'){
-					url =`/pages/login/login?type=1`
+					url =`/pages/user-module/login-accont?type=1`
 				}else if(self.alertType =='4'){
-					url =`/pages/login/login?type=2`
+					url =`/pages/user-module/login-accont?type=2`
 				}else{
-					url=`/pages/login/login?type=detilType&id=${self.productids}`
+					url=`/pages/user-module/login-accont?type=detilType&id=${self.productids}`
 				}
 				this.$parent.isShowNoLogin=false;
 				uni.navigateTo ({

+ 1 - 1
home.vue

@@ -77,7 +77,7 @@
 									<text class="p big">{{item.retailPrice.toFixed(2)}}</text>
 								</view>
 								<view v-else class="no-price">							
-									<text vi-else class="p-no tui-skeleton-rect" @click.stop="navto('/pages/login/login?type=3')">登录查看价格<text class="iconfont icon-xiayibu" style="font-size: 22rpx;margin: 0 6rpx;"></text></text>
+									<text vi-else class="p-no tui-skeleton-rect" @click.stop="navto('/pages/user-module/login?type=3')">登录查看价格<text class="iconfont icon-xiayibu" style="font-size: 22rpx;margin: 0 6rpx;"></text></text>
 								</view>		
 							</view>
 						</view>

+ 55 - 0
json.js

@@ -6,6 +6,61 @@ const footTavList =[
 	{src:"/static/temp/server3@2x.png",text:"购物须知"},
 	{src:"/static/temp/server4@2x.png",text:"联系我们"}
 ]
+
+const cateList = [
+		{id: 1,name: '数码/手机'},
+		{id: 2,name: '礼品拿/鲜花'},
+		{id: 3,name: '服装'},
+		{id: 4,name: '婴幼儿'},
+		{id: 5,name: '生鲜'},
+		{id: 6,pid: 1,name: '手机通讯'},
+		{id: 7,pid: 1,name: '商务手机'},
+		{id: 8,pid: 6,name: '全面屏手机',picture: 'http://img4.imgtn.bdimg.com/it/u=156249486,618039268&fm=26&gp=0.jpg'},
+		{id: 9,pid: 6,name: '游戏手机',picture: 'http://img4.imgtn.bdimg.com/it/u=156249486,618039268&fm=26&gp=0.jpg'},
+		{id: 10,pid: 6,name: '老人机',picture: 'http://img4.imgtn.bdimg.com/it/u=156249486,618039268&fm=26&gp=0.jpg'},
+		{id: 11,pid: 6,name: '拍照手机',picture: 'http://img4.imgtn.bdimg.com/it/u=156249486,618039268&fm=26&gp=0.jpg'},
+		{id: 12,pid: 7,name: '女性手机',picture: 'http://img4.imgtn.bdimg.com/it/u=156249486,618039268&fm=26&gp=0.jpg'},
+		{id: 14,pid: 7,name: '合约机',picture: 'http://img4.imgtn.bdimg.com/it/u=156249486,618039268&fm=26&gp=0.jpg'},
+		{id: 15,pid: 7,name: '选好卡',picture: 'http://img4.imgtn.bdimg.com/it/u=156249486,618039268&fm=26&gp=0.jpg'},
+		{id: 16,pid: 7,name: '办套餐',picture: 'http://img4.imgtn.bdimg.com/it/u=156249486,618039268&fm=26&gp=0.jpg'},
+		{id: 17,pid: 2,name: '礼品',},
+		{id: 18,pid: 2,name: '鲜花',},
+		{id: 19,pid: 17,name: '公益摆件',picture: 'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3905271747,782039201&fm=26&gp=0.jpg'},
+		{id: 20,pid: 17,name: '创意礼品',picture: 'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3905271747,782039201&fm=26&gp=0.jpg'},
+		{id: 21,pid: 18,name: '鲜花',picture: 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2225739817,2167164974&fm=11&gp=0.jpg'},
+		{id: 22,pid: 18,name: '每周一花',picture: 'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=181128911,3496603553&fm=26&gp=0.jpg'},
+		{id: 23,pid: 18,name: '卡通花束',picture: 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2434760217,4114675020&fm=26&gp=0.jpg'},
+		{id: 24,pid: 18,name: '永生花',picture: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1987635208,698824670&fm=26&gp=0.jpg'},
+		{id: 25,pid: 3,name: '男装'},
+		{id: 26,pid: 3,name: '女装'},
+		{id: 27,pid: 25,name: '男士T恤',picture: 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2048096982,2616217980&fm=26&gp=0.jpg'},
+		{id: 28,pid: 25,name: '男士外套',picture: 'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3726494558,3650840727&fm=26&gp=0.jpg'},
+		{id: 29,pid: 25,name: '裙装',picture: 'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3425405217,1433679344&fm=26&gp=0.jpg'},
+		{id: 30,pid: 26,name: 'T恤',picture: 'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1343452775,57135293&fm=26&gp=0.jpg'},
+		{id: 31,pid: 26,name: '上装',picture: 'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1343452775,57135293&fm=26&gp=0.jpg'},
+		{id: 32,pid: 26,name: '下装',picture: 'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1343452775,57135293&fm=26&gp=0.jpg'},
+		{id: 33,pid: 4,name: '奶粉',},
+		{id: 34,pid: 4,name: '营养辅食',},
+		{id: 35,pid: 4,name: '童装',},
+		{id: 36,pid: 4,name: '喂养用品',},
+		{id: 37,pid: 33,name: '有机奶粉',picture: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1413727550,4078612979&fm=26&gp=0.jpg'},
+		{id: 38,pid: 33,name: '果泥/果汁',picture: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2339253510,3704143522&fm=26&gp=0.jpg'},
+		{id: 39,pid: 34,name: '面条/粥',picture: 'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2239876224,566971426&fm=26&gp=0.jpg'},
+		{id: 40,pid: 34,name: '婴童衣橱',picture: 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3226296874,2486695382&fm=11&gp=0.jpg'},
+		{id: 41,pid: 35,name: '吸奶器',picture: 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3226296874,2486695382&fm=11&gp=0.jpg'},
+		{id: 42,pid: 35,name: '儿童餐具',picture: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1894888785,2968170247&fm=26&gp=0.jpg'},
+		{id: 43,pid: 36,name: '牙胶安抚',picture: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1894888785,2968170247&fm=26&gp=0.jpg'},
+		{id: 44,pid: 36,name: '围兜',picture: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1894888785,2968170247&fm=26&gp=0.jpg'},
+		{id: 45,pid: 5,name: '海鲜'},
+		{id: 46,pid: 5,name: '生鲜'},
+		{id: 47,pid: 45,name: '男士T恤',picture: 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2048096982,2616217980&fm=26&gp=0.jpg'},
+		{id: 48,pid: 45,name: '男士外套',picture: 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2048096982,2616217980&fm=26&gp=0.jpg'},
+		{id: 49,pid: 45,name: '裙装',picture: 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2048096982,2616217980&fm=26&gp=0.jpg'},
+		{id: 50,pid: 46,name: 'T恤',picture: 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2048096982,2616217980&fm=26&gp=0.jpg'},
+		{id: 51,pid: 46,name: '上装',picture: 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2048096982,2616217980&fm=26&gp=0.jpg'},
+		{id: 52,pid: 46,name: '下装',picture: 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2048096982,2616217980&fm=26&gp=0.jpg'},
+]
 export default{
 	footTavList,
+	cateList
 }

+ 86 - 13
pages.json

@@ -7,6 +7,15 @@
 				"enablePullDownRefresh":true
 			}
 		},
+		{
+		    "path" : "pages/tabBar/category/category",
+		    "style" : {
+				"navigationBarTitleText": "分类",
+				"app-plus": {
+					"bounce": "none"
+				}
+			}
+		},
 		{
 			"path": "pages/search/search",
 			"style": {
@@ -27,12 +36,6 @@
 				"enablePullDownRefresh" : true
 			}
 		},
-		{
-			"path": "pages/login/login",
-			"style": {
-				"navigationBarTitleText": "登录"
-			}
-		},
 		{
 			"path": "pages/user/account/account",
 			"style": {
@@ -105,7 +108,7 @@
         ,{
             "path" : "pages/user/regularPurchase/regularPurchase",
             "style" : {
-				"navigationBarTitleText": "常采购商品"
+				"navigationBarTitleText": "再次购买"
 			}
         },
 		{
@@ -162,6 +165,71 @@
 			"style": {
 				"navigationBarTitleText": "搜索"
 			}
+		},{
+			"path": "pages/user-module/login",
+			"style": {
+				"navigationBarTitleText": "授权登录"
+			}
+		},{
+			"path": "pages/user-module/login-accont",
+			"style": {
+				"navigationBarTitleText": "登录"
+			}
+		},{
+			"path": "pages/user-module/register",
+			"style": {
+				"navigationBarTitleText": "注册"
+			}
+		},{
+			"path": "pages/user-module/password",
+			"style": {
+				"navigationBarTitleText": "修改密码"
+			}
+		},{
+			"path": "pages/user-module/apply",
+			"style": {
+				"navigationBarTitleText": "修改资料"
+			}
+		},{
+			"path": "pages/user-module/bindemail",
+			"style": {
+				"navigationBarTitleText": "绑定邮箱"
+			}
+		},{
+			"path": "pages/user-module/bindwechat",
+			"style": {
+				"navigationBarTitleText": "绑定微信"
+			}
+		},{
+			"path": "pages/user-module/information",
+			"style": {
+				"navigationBarTitleText": "修改资料"
+			}
+		},{
+			"path": "pages/user/operator/addoperator",
+			"style": {
+				"navigationBarTitleText": "添加运营人员"
+			}
+		},{
+			"path": "pages/user/operator/list",
+			"style": {
+				"navigationBarTitleText": "运营人员管理"
+			}
+		},{
+			"path": "pages/user/setting/setting",
+			"style": {
+				"navigationBarTitleText": "账户设置"
+			}
+		},{
+			"path": "pages/user/setting/phone",
+			"style": {
+				"navigationBarTitleText": "更换手机号"
+			}
+		},{
+			"path": "pages/user/setting/password",
+			"style": {
+				"navigationBarTitleText": "修改密码"
+			}
 		}
     ],
 	"tabBar": {
@@ -172,20 +240,25 @@
 			"backgroundColor": "#ffffff",
 			"list": [{
 					"pagePath": "pages/tabBar/home/home",
-					"iconPath": "static/home@3x.png",
-					"selectedIconPath": "static/home-current@3x.png",
+					"iconPath": "static/icon-home@3x.png",
+					"selectedIconPath": "static/icon-home-active@3x.png",
 					"text": "商城"
+				},{
+					"pagePath": "pages/tabBar/category/category",
+					"iconPath": "static/icon-sort@3x.png",
+					"selectedIconPath": "static/icon-sort-active@3x.png",
+					"text": "分类"
 				},
 				{
 					"pagePath": "pages/tabBar/cart/cart",
-					"iconPath": "static/cart@3x.png",
-					"selectedIconPath": "static/cart-current@3x.png",
+					"iconPath": "static/icon-cart@3x.png",
+					"selectedIconPath": "static/icon-cart-active@3x.png",
 					"text": "购物车"
 				},
 				{
 					"pagePath": "pages/tabBar/user/user",
-					"iconPath": "static/user@3x.png",
-					"selectedIconPath": "static/user-current@3x.png",
+					"iconPath": "static/icon-user@3x.png",
+					"selectedIconPath": "static/icon-user-active@3x.png",
 					"text": "我的"
 				}
 			]

+ 3 - 3
pages/goods/product.vue

@@ -111,7 +111,7 @@
 				<view class="bottom-btn" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
 					<view class="bottom-le">
 						<view class="item-bt" @click="this.$api.switchTabTo('/pages/tabBar/home/home')">
-							<image src="../../static/home-current@3x.png"></image>
+							<image src="../../static/icon-home-active@3x.png"></image>
 							<text>首页</text>
 						</view>
 						<view class="item-bt">
@@ -123,7 +123,7 @@
 							<!-- #endif -->
 						</view>
 						<view class="item-bt" @click="buyProductCart()">
-							<image src="../../static/cart-current@3x.png"></image>
+							<image src="../../static/icon-cart-active@3x.png"></image>
 							<text>购物车</text>
 							<text  	v-if="goodsData.cartCount > 0"
 									class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
@@ -446,7 +446,7 @@
 				)	
 			},
 			navToLogin(){
-				this.$api.navigateTo(`/pages/login/login?type=detilType&id=${this.productID}`)
+				this.$api.navigateTo(`/pages/user-module/login?type=detilType&id=${this.productID}`)
 			},
 			setHeaderBtnPosi(){
 				// 获得胶囊按钮位置信息

+ 1 - 1
pages/search/search.vue

@@ -240,7 +240,7 @@
 			toLoginPage() {
 				let searchLoginType = 'search'
 				uni.navigateTo({
-					url:`/pages/login/login?type=${searchLoginType}`
+					url:`/pages/user-module/login?type=${searchLoginType}`
 				})
 			}
 		},

+ 186 - 0
pages/tabBar/category/category.vue

@@ -0,0 +1,186 @@
+<template>
+	<view class="content">
+		<scroll-view scroll-y class="left-aside">
+			<view v-for="item in flist" :key="item.id" class="f-item b-b" :class="{active: item.id === currentId}" @click="tabtap(item)">
+				{{item.name}}
+			</view>
+		</scroll-view>
+		<scroll-view scroll-with-animation scroll-y class="right-aside" @scroll="asideScroll" :scroll-top="tabScrollTop">
+			<view v-for="item in slist" :key="item.id" class="s-list" :id="'main-'+item.id">
+				<text class="s-item">{{item.name}}</text>
+				<view class="t-list">
+					<view @click="navToList(item.id, titem.id)" v-if="titem.pid === item.id" class="t-item" v-for="titem in tlist" :key="titem.id">
+						<image :src="titem.picture"></image>
+						<text>{{titem.name}}</text>
+					</view>
+				</view>
+			</view>
+		</scroll-view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				sizeCalcState: false,
+				tabScrollTop: 0,
+				currentId: 1,
+				flist: [],
+				slist: [],
+				tlist: [],
+			}
+		},
+		onLoad(){
+			this.loadData();
+		},
+		methods: {
+			async loadData(){
+				let list = await this.$util.json('cateList');
+				list.forEach(item=>{
+					// console.log('item---->',item)
+					if(!item.pid){
+						this.flist.push(item); //pid为父级id, 没有pid或者pid=0是一级分类
+						// console.log('flist---->',this.flist)
+					}else if(!item.picture){
+						this.slist.push(item); //没有图的是2级分类
+						// console.log('slist---->',this.slist)
+					}else{
+						this.tlist.push(item); //3级分类
+						// console.log('tlist---->',this.tlist)
+					}
+				}) 
+			},
+			//一级分类点击
+			tabtap(item){
+				if(!this.sizeCalcState){
+					this.calcSize();
+				}
+				this.currentId = item.id;
+				// console.log('this.currentId',this.currentId)
+				// console.log('this.id',item.id)
+				// console.log('this.slist',this.slist)
+				
+				let index = this.slist.findIndex(sitem=>sitem.pid === item.id);
+				this.tabScrollTop = this.slist[index].top;
+			},
+			//右侧栏滚动
+			asideScroll(e){
+				if(!this.sizeCalcState){
+					this.calcSize();
+				}
+				let scrollTop = e.detail.scrollTop;
+				let tabs = this.slist.filter(item=>item.top <= scrollTop).reverse();
+				if(tabs.length > 0){
+					this.currentId = tabs[0].pid;
+				}
+			},
+			//计算右侧栏每个tab的高度等信息
+			calcSize(){
+				let h = 0;
+				this.slist.forEach(item=>{
+					let view = uni.createSelectorQuery().select("#main-" + item.id);
+					view.fields({
+						size: true
+					}, data => {
+						item.top = h;
+						h += data.height;
+						item.bottom = h;
+					}).exec();
+				})
+				this.sizeCalcState = true;
+			},
+			navToList(sid, tid){
+				uni.navigateTo({
+					url: `/pages/product/list?fid=${this.currentId}&sid=${sid}&tid=${tid}`
+				})
+			}
+		}
+	}
+</script>
+
+<style lang='scss'>
+	page,
+	.content {
+		height: 100%;
+		background-color: #f8f8f8;
+	}
+
+	.content {
+		display: flex;
+	}
+	.left-aside {
+		flex-shrink: 0;
+		width: 200rpx;
+		height: 100%;
+		background-color: #fff;
+	}
+	.f-item {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		width: 100%;
+		height: 100rpx;
+		font-size: 28rpx;
+		color: #333333;
+		position: relative;
+		&.active{
+			color:$color-system;
+			background: #f8f8f8;
+			&:before{
+				content: '';
+				position: absolute;
+				left: 0;
+				top: 50%;
+				transform: translateY(-50%);
+				height: 60rpx;
+				width: 8rpx;
+				background-color: $color-system;
+				border-radius: 0 4px 4px 0;
+				opacity: .8;
+			}
+		}
+	}
+
+	.right-aside{
+		flex: 1;
+		overflow: hidden;
+		padding-left: 20rpx;
+	}
+	.s-item{
+		display: flex;
+		align-items: center;
+		height: 70rpx;
+		padding-top: 8rpx;
+		font-size: 28rpx;
+		color: $text-color;
+	}
+	.t-list{
+		display: flex;
+		flex-wrap: wrap;
+		width: 100%;
+		background: #fff;
+		padding-top: 12rpx;
+		&:after{
+			content: '';
+			flex: 99;
+			height: 0;
+		}
+	}
+	.t-item{
+		flex-shrink: 0;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		flex-direction: column;
+		width: 176rpx;
+		font-size: 26rpx;
+		color: #666;
+		padding-bottom: 20rpx;
+		
+		image{
+			width: 140rpx;
+			height: 140rpx;
+		}
+	}
+</style>

+ 4 - 6
pages/tabBar/home/home.vue

@@ -23,12 +23,12 @@
 			</view>
 			<view class="cate-section clearfix">
 				<!-- 自定义分类导航栏 -->
-				<view class="tabbar clearfix">
+<!-- 				<view class="tabbar clearfix">
 					<view class="cate-item" v-for="(nav,idx) in productsClassify" :key="idx" @click.stop="navToListPage(nav)">
 						<image class="tui-skeleton-fillet" :src="nav.classifyImage"></image>
 						<text class="tui-skeleton-rect">{{nav.classifyName}}</text>
 					</view>
-				</view>
+				</view> -->
 				<!-- 优选分类 -->
 				<view class="tabbar clearfix">
 					<view class="cate-item-info" @click.stop="this.$api.navToListPage({type:'1',value:mallPageModules.firstModulesName})">
@@ -77,7 +77,7 @@
 									<text class="p big">{{item.retailPrice.toFixed(2)}}</text>
 								</view>
 								<view v-else class="no-price">							
-									<text vi-else class="p-no tui-skeleton-rect" @click.stop="navto('/pages/login/login?type=3')">登录查看价格<text class="iconfont icon-xiayibu" style="font-size: 22rpx;margin: 0 6rpx;"></text></text>
+									<text vi-else class="p-no tui-skeleton-rect" @click.stop="navto('/pages/user-module/login?type=3')">登录查看价格<text class="iconfont icon-xiayibu" style="font-size: 22rpx;margin: 0 6rpx;"></text></text>
 								</view>		
 							</view>
 						</view>
@@ -153,7 +153,6 @@
 				hotGoodsList:[],
 				skeletonShow: true,
 				organizeProducts:[],//常用商品
-				productsClassify:[], //导航分类
 				mallPageModules:'', //优惠模块分类
 				navInforList:[
 					{text:'会员中心',icon:'https://img.caimei365.com/group1/M00/03/8C/Cmis215XHXSAAZU0AACaPrfbB8I435.png'},
@@ -208,7 +207,6 @@
 						if(response.code =='1'){
 							let data = response.data;
 							this.organizeProducts = data.organizeProducts
-							this.productsClassify = data.productsClassify
 							this.bannerImageList = data.bannerImageList
 							this.mallPageModules = data.mallPageModules
 							this.$store.commit('updateAllNum',response.data.count)
@@ -366,7 +364,7 @@
 	.cate-section {
 		width: 702rpx;
 		height: auto;
-		padding: 48rpx 24rpx; 
+		padding:34rpx 24rpx 14rpx 24rpx; 
 		background: #fff;
 		.tabbar{
 			margin-bottom: 26rpx;

+ 1 - 1
pages/tabBar/user/user.vue

@@ -85,7 +85,7 @@
 						<text class="cell-more iconfont icon-xiayibu"></text>
 					</view>
 					<view class="list-cell" @click="navigator('/pages/user/regularPurchase/regularPurchase')" hover-class="cell-hover" :hover-stay-time="50">
-						<text class="cell-tit">常采购商品</text>
+						<text class="cell-tit">再次购买</text>
 						<text class="cell-more iconfont icon-xiayibu"></text>
 					</view>
 					<view class="list-cell" @click="navigator('/pages/user/address/address')" hover-class="cell-hover" :hover-stay-time="50">

+ 0 - 0
pages/login/login.vue → pages/user-module/apply.vue


+ 267 - 0
pages/user-module/bindemail.vue

@@ -0,0 +1,267 @@
+<template>
+	<view class="container login">
+		<view class="login-main">
+			<text class="logo-text">您的账号尚未绑定机构邮箱,请填写机构邮箱地址进行绑定。邮箱可用于登录和修改密码。</text>
+		</view>
+		<view class="login-form clearfix">
+			<view class="login-input">
+				<input type="number" 
+					   v-model="bindEmail"  
+					   maxlength="30" 
+					   class="input" 
+					   @blur="onBlurInput"
+					   placeholder="请输入邮箱地址"
+				/>
+			</view>
+		</view>
+		<view class="login-form clearfix">
+			<view class="login-input code">
+				<input type="number" 
+					   v-model="bindEmailCode"  
+					   maxlength="6" 
+					   class="input" 
+					   placeholder="请输入邮箱验证码"
+				/>
+			</view>
+			<view class="login-input btn" :class="[isDisabled === true ? 'disabled' : 'none']">
+				<button type="button"
+						@click.stop="getEmailCode" :disabled="isDisabled"
+					    class="input" 
+				>获取验证码</button>
+			</view>
+		</view>
+		<view class="login-form clearfix">
+			<view class="login-btn"  @click="goLogin">登录</view>
+		</view>
+		<view v-if="isToast" class="model-warp" >
+			<view class="model-alert clearfix">
+				<view class="alert-content">
+					<view class="t-h1">{{toestText}}</view>
+					<view class="t-p">请联系客服获取{{alertText}}后再登录,联系电话{{telPhone}}</view>
+				</view>
+				<view class="alert-btn">
+					<view class="btn btn-confirm" @click="hideToast">确定</view>
+				</view>
+			</view>
+		</view>
+		<!-- 授权按钮 -->
+		<view class="model-warp" :class="[isUserInfo===false ? 'none':'show']">
+			<view class="model-alert">
+				<view class="alert-content">
+					<view class="t-p">采美采购商城需要获取您的微信授权才能正常提供服务</view>
+				</view>
+				<view class="alert-btn">
+					<view class="btn btn-cancel" @click="hideModel">取消</view>
+					<button type="primary" size="small" open-type="getUserInfo" lang="zh_CN" @getuserinfo="getuserinfo" class="btn btn-confirm">授权</button>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { mapMutations } from 'vuex';
+	import authorize from '@/common/config/authorize.js' 
+	var self;
+	export default{
+		data() {
+			return{
+				bindEmail:'',  		//用户绑定邮箱
+				bindEmailCode:'',  	//用户绑定邮箱验证码
+				isDisabled:true,	//获取验证码按钮
+				isToast:false,		//控制显示未输入邀请码提示	
+				isUserInfo:false,	//控制显示授权弹窗
+				nickName:'',		//存储用户名
+				userInfo:'',		//存储微信用户授权信息
+				isSuccess:false,
+				toestText:'',
+				telPhone:'',
+				loginType:'',		//跳转类型
+				alertText:'',
+				listType: '',
+				listVal: '',
+				detilType:'',
+				id:''//商品ID
+			}
+		},
+		onLoad(option) {
+			console.log(option)
+		},
+		methods:{
+			...mapMutations(['login']),
+			goLogin() {
+				self.$api.get('/login/isEnabled',{userOrganizeID:self.userOrganizeID,invitationCode:self.invitationCode}, res => {
+					if (res.code == "1") {
+						//查看此微信用户是否已经授权过
+						authorize.getSetting().then(res =>{
+							// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
+							if(res == 2){
+								self.isUserInfo = true
+							}else{
+								self.isUserInfo = false
+								self.wxGetUserInfo()
+							}
+						})
+					}else if(res.code =='0'){
+						self.toestText ='请输入邀请码';
+						self.alertText ='邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else if(res.code =='-2'){
+						self.toestText ='邀请码已失效';
+						self.alertText ='新邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else if(res.code =='-3'){
+						self.toestText ='邀请码已被使用';
+						self.alertText ='新邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else{
+						uni.showToast({icon:'none', title: res.msg, duration: 3000});
+						self.isUserInfo = false
+					}
+				})
+			},
+			onBlurInput(e){//邮箱输入框失去焦点设置按钮
+				if(e.detail.value ===''){
+					this.isDisabled = true
+				}else{
+					this.isDisabled = false
+				}
+			},
+			getEmailCode(){
+				this.isDisabled = true
+			},
+			//关闭未填邀请码弹窗
+			hideToast(){
+				self.isToast = false;
+			},
+			//关闭未授权用户授权提示弹窗
+			hideModel(){
+				self.isUserInfo = false;
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.login{
+		width: 100%;
+		height: auto;
+		border-top: 1px solid #F7F7F7;
+		.model-warp.none{
+			display: none;			
+		}
+		.model-warp.show{
+			display: block;
+		}
+		.login-main{
+			width: 702rpx;
+			background: rgba(225, 86, 22, 0.1);
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			height: 68rpx;
+			padding: 20rpx 24rpx;
+			margin: 24rpx 0 118rpx 0;
+			.logo-text{
+				font-size: 24rpx;
+				line-height: 34rpx;
+				color: $color-system;
+			}
+		}
+		.login-form{
+			width: 702rpx;
+			height: auto;
+			padding: 0 24rpx;
+			.login-input{
+				width: 654rpx;
+				height: 40rpx;
+				padding: 24rpx;
+				margin-bottom: 20rpx;
+				background: #F7F7F7;
+				border-radius: 14rpx;
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+				&.code{
+					width: 380rpx;
+					float: left;
+					margin-right: 20rpx;
+				}
+				&.btn{
+					width: 210rpx;
+					float: left;
+					&.none{
+						background: $color-system;
+						.input{
+							color: #FFFFFF;
+							background: $color-system;
+						}
+					}
+					&.disabled{
+						.input{
+							color: #999999;
+						}
+					}
+				}
+				.input{
+					width: 100%;
+					height: 100%;
+					background: #F7F7F7;
+					font-size: $font-size-base;
+					line-height: 40rpx;
+					color: #333333;
+					border-radius: 14rpx;
+				}
+			}
+		}
+		.login-btn{
+			width: 702rpx;
+			height: 88rpx;
+			border-radius: 14rpx;
+			font-size: $font-size-base;
+			line-height: 88rpx;
+			color: #FFFFFF;
+			margin: 0 auto;
+			text-align: center;
+			background: $btn-confirm;
+			margin-top: 100rpx;
+		}
+		.model-authorization{
+			width: 100%;
+			height: 100%;
+			position: fixed;
+			top: 0;
+			left: 0;
+			z-index: 999;
+			.authorization{
+				width: 518rpx;
+				height: 320rpx;
+				position: absolute;
+				background: rgba(255,255,255,.7);
+				left: 0;
+				right: 0;
+				bottom: 0;
+				top: 0;
+				margin: auto;
+				.to-btn{
+					position: absolute;
+					top: 0;
+					left: 0;
+					right: 0;
+					bottom: 0;
+					margin: auto;
+					width: 70%;
+					height: 88rpx;
+					font-size: $font-size-base;
+					line-height: 88rpx;
+					color: #FFFFFF;
+					text-align: center;
+					border-radius: 44rpx;
+				}
+			}
+		}
+	}
+</style>

+ 292 - 0
pages/user-module/bindwechat.vue

@@ -0,0 +1,292 @@
+<template>
+	<view class="container login">
+		<view class="login-main">
+			<image class="logo" src="../../static/login-logo@3x.png" mode=""></image>
+			<text class="logo-text">生美/医美采购服务平台</text>
+		</view>
+		<view class="login-input">
+			<input type="number" 
+				   v-model="invitationCode"  
+				   maxlength="6" 
+				   class="input" 
+				   placeholder="请输入邀请码"
+			/>
+		</view>
+		<view class="login-btn"  @click="goLogin">登录</view>
+		<view v-if="isToast" class="model-warp" >
+			<view class="model-alert clearfix">
+				<view class="alert-content">
+					<view class="t-h1">{{toestText}}</view>
+					<view class="t-p">请联系客服获取{{alertText}}后再登录,联系电话{{telPhone}}</view>
+				</view>
+				<view class="alert-btn">
+					<view class="btn btn-confirm" @click="hideToast">确定</view>
+				</view>
+			</view>
+		</view>
+		<!-- 授权按钮 -->
+		<view class="model-warp" :class="[isUserInfo===false ? 'none':'show']">
+			<view class="model-alert">
+				<view class="alert-content">
+					<view class="t-p">采美采购商城需要获取您的微信授权才能正常提供服务</view>
+				</view>
+				<view class="alert-btn">
+					<view class="btn btn-cancel" @click="hideModel">取消</view>
+					<button type="primary" size="small" open-type="getUserInfo" lang="zh_CN" @getuserinfo="getuserinfo" class="btn btn-confirm">授权</button>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { mapMutations } from 'vuex';
+	import authorize from '@/common/config/authorize.js' 
+	var self;
+	export default{
+		data() {
+			return{
+				invitationCode:'',  //获取用户登录的邀请码
+				isToast:false,		//控制显示未输入邀请码提示	
+				isUserInfo:false,	//控制显示授权弹窗
+				nickName:'',		//存储用户名
+				userInfo:'',		//存储微信用户授权信息
+				isSuccess:false,
+				toestText:'',
+				telPhone:'',
+				loginType:'',		//跳转类型
+				alertText:'',
+				listType: '',
+				listVal: '',
+				detilType:'',
+				id:''//商品ID
+			}
+		},
+		onLoad(option) {
+			console.log(option)
+			self = this;
+			self.loginType = option.type;
+			self.id = option.id
+			if(option.listType) {
+				self.listType = option.listType;
+				self.listVal = option.listVal;
+			}
+		},
+		methods:{
+			...mapMutations(['login']),
+			goLogin() {
+				self.$api.get('/login/isEnabled',{userOrganizeID:self.userOrganizeID,invitationCode:self.invitationCode}, res => {
+					if (res.code == "1") {
+						//查看此微信用户是否已经授权过
+						authorize.getSetting().then(res =>{
+							// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
+							if(res == 2){
+								self.isUserInfo = true
+							}else{
+								self.isUserInfo = false
+								self.wxGetUserInfo()
+							}
+						})
+					}else if(res.code =='0'){
+						self.toestText ='请输入邀请码';
+						self.alertText ='邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else if(res.code =='-2'){
+						self.toestText ='邀请码已失效';
+						self.alertText ='新邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else if(res.code =='-3'){
+						self.toestText ='邀请码已被使用';
+						self.alertText ='新邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else{
+						uni.showToast({icon:'none', title: res.msg, duration: 3000});
+						self.isUserInfo = false
+					}
+				})
+			},
+			//授权登录 
+			getuserinfo: function (e) {
+			    if (e.detail.userInfo) {
+					self.wxGetUserInfo()
+			    }else{
+					//用户按了拒绝按钮
+					uni.showModal({
+						content: '获取用户信息失败,请允许授权后才能继续使用小程序哦~',
+						showCancel: false,
+						confirmText: '授权',
+						success: function (res) {
+							 if (res.confirm) {
+								uni.openSetting({
+									 success: res => {
+										// console.log(res.authSetting)
+									 },
+									 fail: res => {
+										// console.log(res)
+									 }
+								})
+							 }
+						}
+					})
+			    }
+			 },
+			wxGetUserInfo(){
+				authorize.getCode('weixin').then(wechatcode =>{
+					wx.getUserInfo({
+						success: res => {
+							// console.log('useInfo:',res.userInfo)
+							self.userInfo = res.userInfo;
+							let params ={
+									code:wechatcode,
+									nickName:res.userInfo.nickName,
+									invitationCode:self.invitationCode,
+									userOrganizeID:self.userOrganizeID,
+								}
+							self.goUserLogininit(params);
+						}
+					});	
+				})
+			},
+			goUserLogininit(params){
+				self.$api.lodingGet('/login/register',params, response => {
+					// console.log(response)
+					if (response.code == "1") {
+						self.isUserInfo = false;
+						self.login(self.userInfo);
+						let user_key = {code:response.code,openid:response.data.openid,userID:response.data.userID}
+						uni.setStorageSync('cookieKey','JSESSIONID='+response.data.sessionId);
+						this.$store.commit('updateStatus',user_key)
+						let url;
+						if(self.loginType) {
+							if(self.loginType=='detilType'){
+								self.$api.redirectTo(`/pages/goods/product?id=${self.id}&page=2`);
+							}else if(self.loginType=='search'){
+								self.$api.redirectTo('/pages/search/search');
+							}else if(self.loginType == 1){
+								url ='/pages/tabBar/cart/cart'
+							}else if(self.loginType == 2){
+								url ='/pages/tabBar/user/user'
+							}else {
+								url ='/pages/tabBar/home/home'
+							}
+							uni.switchTab({
+								url
+							})
+						} else if(self.listType) {
+							self.$api.navToListPage({type:self.listType,value:self.listVal,lType:'4'});
+						}
+					} else {
+						this.$util.msg(response.msg,3000);
+					}
+				})
+			},
+			//关闭未填邀请码弹窗
+			hideToast(){
+				self.isToast = false;
+			},
+			//关闭未授权用户授权提示弹窗
+			hideModel(){
+				self.isUserInfo = false;
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.login{
+		width: 100%;
+		height: auto;
+		.model-warp.none{
+			display: none;			
+		}
+		.model-warp.show{
+			display: block;
+		}
+		.login-main{
+			width: 100%;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			height: 198rpx;
+			padding: 170rpx 0 60rpx 0;
+			.logo{
+				width: 138rpx;
+				height: 118rpx;
+				display: block;
+			}
+			.logo-text{
+				font-size: 30rpx;
+				line-height: 44rpx;
+				color: $color-system;
+				font-weight: 600;
+				margin-top: 20rpx;
+			}
+		}
+		.login-input{
+			width: 654rpx;
+			height: 40rpx;
+			padding: 24rpx;
+			margin: 0 auto;
+			margin-bottom: 60rpx;
+			background: #F7F7F7;
+			border-radius: 14rpx;
+			.input{
+				width: 100%;
+				height: 100%;
+				background: #F7F7F7;
+				font-size: $font-size-base;
+				line-height: 40rpx;
+				color: #333333;
+				border-radius: 14rpx;
+			}
+		}
+		.login-btn{
+			width: 702rpx;
+			height: 88rpx;
+			border-radius: 14rpx;
+			font-size: $font-size-base;
+			line-height: 88rpx;
+			color: #FFFFFF;
+			margin: 0 auto;
+			text-align: center;
+			background: $btn-confirm;
+		}
+		.model-authorization{
+			width: 100%;
+			height: 100%;
+			position: fixed;
+			top: 0;
+			left: 0;
+			z-index: 999;
+			.authorization{
+				width: 518rpx;
+				height: 320rpx;
+				position: absolute;
+				background: rgba(255,255,255,.7);
+				left: 0;
+				right: 0;
+				bottom: 0;
+				top: 0;
+				margin: auto;
+				.to-btn{
+					position: absolute;
+					top: 0;
+					left: 0;
+					right: 0;
+					bottom: 0;
+					margin: auto;
+					width: 70%;
+					height: 88rpx;
+					font-size: $font-size-base;
+					line-height: 88rpx;
+					color: #FFFFFF;
+					text-align: center;
+					border-radius: 44rpx;
+				}
+			}
+		}
+	}
+</style>

+ 292 - 0
pages/user-module/information.vue

@@ -0,0 +1,292 @@
+<template>
+	<view class="container login">
+		<view class="login-main">
+			<image class="logo" src="../../static/login-logo@3x.png" mode=""></image>
+			<text class="logo-text">生美/医美采购服务平台</text>
+		</view>
+		<view class="login-input">
+			<input type="number" 
+				   v-model="invitationCode"  
+				   maxlength="6" 
+				   class="input" 
+				   placeholder="请输入邀请码"
+			/>
+		</view>
+		<view class="login-btn"  @click="goLogin">登录</view>
+		<view v-if="isToast" class="model-warp" >
+			<view class="model-alert clearfix">
+				<view class="alert-content">
+					<view class="t-h1">{{toestText}}</view>
+					<view class="t-p">请联系客服获取{{alertText}}后再登录,联系电话{{telPhone}}</view>
+				</view>
+				<view class="alert-btn">
+					<view class="btn btn-confirm" @click="hideToast">确定</view>
+				</view>
+			</view>
+		</view>
+		<!-- 授权按钮 -->
+		<view class="model-warp" :class="[isUserInfo===false ? 'none':'show']">
+			<view class="model-alert">
+				<view class="alert-content">
+					<view class="t-p">采美采购商城需要获取您的微信授权才能正常提供服务</view>
+				</view>
+				<view class="alert-btn">
+					<view class="btn btn-cancel" @click="hideModel">取消</view>
+					<button type="primary" size="small" open-type="getUserInfo" lang="zh_CN" @getuserinfo="getuserinfo" class="btn btn-confirm">授权</button>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { mapMutations } from 'vuex';
+	import authorize from '@/common/config/authorize.js' 
+	var self;
+	export default{
+		data() {
+			return{
+				invitationCode:'',  //获取用户登录的邀请码
+				isToast:false,		//控制显示未输入邀请码提示	
+				isUserInfo:false,	//控制显示授权弹窗
+				nickName:'',		//存储用户名
+				userInfo:'',		//存储微信用户授权信息
+				isSuccess:false,
+				toestText:'',
+				telPhone:'',
+				loginType:'',		//跳转类型
+				alertText:'',
+				listType: '',
+				listVal: '',
+				detilType:'',
+				id:''//商品ID
+			}
+		},
+		onLoad(option) {
+			console.log(option)
+			self = this;
+			self.loginType = option.type;
+			self.id = option.id
+			if(option.listType) {
+				self.listType = option.listType;
+				self.listVal = option.listVal;
+			}
+		},
+		methods:{
+			...mapMutations(['login']),
+			goLogin() {
+				self.$api.get('/login/isEnabled',{userOrganizeID:self.userOrganizeID,invitationCode:self.invitationCode}, res => {
+					if (res.code == "1") {
+						//查看此微信用户是否已经授权过
+						authorize.getSetting().then(res =>{
+							// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
+							if(res == 2){
+								self.isUserInfo = true
+							}else{
+								self.isUserInfo = false
+								self.wxGetUserInfo()
+							}
+						})
+					}else if(res.code =='0'){
+						self.toestText ='请输入邀请码';
+						self.alertText ='邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else if(res.code =='-2'){
+						self.toestText ='邀请码已失效';
+						self.alertText ='新邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else if(res.code =='-3'){
+						self.toestText ='邀请码已被使用';
+						self.alertText ='新邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else{
+						uni.showToast({icon:'none', title: res.msg, duration: 3000});
+						self.isUserInfo = false
+					}
+				})
+			},
+			//授权登录 
+			getuserinfo: function (e) {
+			    if (e.detail.userInfo) {
+					self.wxGetUserInfo()
+			    }else{
+					//用户按了拒绝按钮
+					uni.showModal({
+						content: '获取用户信息失败,请允许授权后才能继续使用小程序哦~',
+						showCancel: false,
+						confirmText: '授权',
+						success: function (res) {
+							 if (res.confirm) {
+								uni.openSetting({
+									 success: res => {
+										// console.log(res.authSetting)
+									 },
+									 fail: res => {
+										// console.log(res)
+									 }
+								})
+							 }
+						}
+					})
+			    }
+			 },
+			wxGetUserInfo(){
+				authorize.getCode('weixin').then(wechatcode =>{
+					wx.getUserInfo({
+						success: res => {
+							// console.log('useInfo:',res.userInfo)
+							self.userInfo = res.userInfo;
+							let params ={
+									code:wechatcode,
+									nickName:res.userInfo.nickName,
+									invitationCode:self.invitationCode,
+									userOrganizeID:self.userOrganizeID,
+								}
+							self.goUserLogininit(params);
+						}
+					});	
+				})
+			},
+			goUserLogininit(params){
+				self.$api.lodingGet('/login/register',params, response => {
+					// console.log(response)
+					if (response.code == "1") {
+						self.isUserInfo = false;
+						self.login(self.userInfo);
+						let user_key = {code:response.code,openid:response.data.openid,userID:response.data.userID}
+						uni.setStorageSync('cookieKey','JSESSIONID='+response.data.sessionId);
+						this.$store.commit('updateStatus',user_key)
+						let url;
+						if(self.loginType) {
+							if(self.loginType=='detilType'){
+								self.$api.redirectTo(`/pages/goods/product?id=${self.id}&page=2`);
+							}else if(self.loginType=='search'){
+								self.$api.redirectTo('/pages/search/search');
+							}else if(self.loginType == 1){
+								url ='/pages/tabBar/cart/cart'
+							}else if(self.loginType == 2){
+								url ='/pages/tabBar/user/user'
+							}else {
+								url ='/pages/tabBar/home/home'
+							}
+							uni.switchTab({
+								url
+							})
+						} else if(self.listType) {
+							self.$api.navToListPage({type:self.listType,value:self.listVal,lType:'4'});
+						}
+					} else {
+						this.$util.msg(response.msg,3000);
+					}
+				})
+			},
+			//关闭未填邀请码弹窗
+			hideToast(){
+				self.isToast = false;
+			},
+			//关闭未授权用户授权提示弹窗
+			hideModel(){
+				self.isUserInfo = false;
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.login{
+		width: 100%;
+		height: auto;
+		.model-warp.none{
+			display: none;			
+		}
+		.model-warp.show{
+			display: block;
+		}
+		.login-main{
+			width: 100%;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			height: 198rpx;
+			padding: 170rpx 0 60rpx 0;
+			.logo{
+				width: 138rpx;
+				height: 118rpx;
+				display: block;
+			}
+			.logo-text{
+				font-size: 30rpx;
+				line-height: 44rpx;
+				color: $color-system;
+				font-weight: 600;
+				margin-top: 20rpx;
+			}
+		}
+		.login-input{
+			width: 654rpx;
+			height: 40rpx;
+			padding: 24rpx;
+			margin: 0 auto;
+			margin-bottom: 60rpx;
+			background: #F7F7F7;
+			border-radius: 14rpx;
+			.input{
+				width: 100%;
+				height: 100%;
+				background: #F7F7F7;
+				font-size: $font-size-base;
+				line-height: 40rpx;
+				color: #333333;
+				border-radius: 14rpx;
+			}
+		}
+		.login-btn{
+			width: 702rpx;
+			height: 88rpx;
+			border-radius: 14rpx;
+			font-size: $font-size-base;
+			line-height: 88rpx;
+			color: #FFFFFF;
+			margin: 0 auto;
+			text-align: center;
+			background: $btn-confirm;
+		}
+		.model-authorization{
+			width: 100%;
+			height: 100%;
+			position: fixed;
+			top: 0;
+			left: 0;
+			z-index: 999;
+			.authorization{
+				width: 518rpx;
+				height: 320rpx;
+				position: absolute;
+				background: rgba(255,255,255,.7);
+				left: 0;
+				right: 0;
+				bottom: 0;
+				top: 0;
+				margin: auto;
+				.to-btn{
+					position: absolute;
+					top: 0;
+					left: 0;
+					right: 0;
+					bottom: 0;
+					margin: auto;
+					width: 70%;
+					height: 88rpx;
+					font-size: $font-size-base;
+					line-height: 88rpx;
+					color: #FFFFFF;
+					text-align: center;
+					border-radius: 44rpx;
+				}
+			}
+		}
+	}
+</style>

+ 362 - 0
pages/user-module/login-accont.vue

@@ -0,0 +1,362 @@
+<template>
+	<view class="container login">
+		<view class="login-main">
+			<image class="logo" src="../../static/login-logo@3x.png" mode=""></image>
+			<text class="logo-text">生美/医美采购服务平台</text>
+		</view>
+		<view class="login-form">
+			<view class="login-input">
+				<input type="number" 
+					   v-model="accountCode"  
+					   maxlength="30" 
+					   class="input" 
+					   placeholder="请输入邮箱/手机号"
+				/>
+			</view>
+			<view class="login-input">
+				<input :type="inputType"
+					   v-model="password"  
+					   maxlength="18" 
+					   class="input" 
+					   placeholder="请输入密码"
+				/>
+				<view class="iconfont" :class="passIconType"  @click.stop="changePasswordType($event)"></view>
+			</view>
+			<view class="login-input link">
+				<view class="login-reg" @click.stop="this.$api.navigateTo('/pages/user-module/register')">免费注册</view>
+				<view class="login-pwd" @click.stop="this.$api.navigateTo('/pages/user-module/password')">忘记密码?</view>
+			</view>
+		</view>
+		<view class="login-btn"  @click="goLogin">登录</view>
+		<view class="login-btn-last" @click.stop="this.$api.navigateTo('/pages/user-module/login')">授权登录</view>
+		<view v-if="isToast" class="model-warp" >
+			<view class="model-alert clearfix">
+				<view class="alert-content">
+					<view class="t-h1">{{toestText}}</view>
+					<view class="t-p">请联系客服获取{{alertText}}后再登录,联系电话{{telPhone}}</view>
+				</view>
+				<view class="alert-btn">
+					<view class="btn btn-confirm" @click="hideToast">确定</view>
+				</view>
+			</view>
+		</view>
+		<!-- 授权按钮 -->
+		<view class="model-warp" :class="[isUserInfo===false ? 'none':'show']">
+			<view class="model-alert">
+				<view class="alert-content">
+					<view class="t-p">采美采购商城需要获取您的微信授权才能正常提供服务</view>
+				</view>
+				<view class="alert-btn">
+					<view class="btn btn-cancel" @click="hideModel">取消</view>
+					<button type="primary" size="small" open-type="getUserInfo" lang="zh_CN" @getuserinfo="getuserinfo" class="btn btn-confirm">授权</button>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { mapMutations } from 'vuex';
+	import authorize from '@/common/config/authorize.js' 
+	var self;
+	export default{
+		data() {
+			return{
+				inputType:'password',
+				passIconType:'icon-yanjing_yincang_o',
+				accountCode:'',  //用户登录账号
+				password:'',	 //用户登录密码	
+				isToast:false,	 //控制显示未输入邀请码提示	
+				isUserInfo:false,//控制显示授权弹窗
+				nickName:'',	 //存储用户名
+				userInfo:'',	 //存储微信用户授权信息
+				isSuccess:false,
+				toestText:'',
+				telPhone:'',
+				loginType:'',		//跳转类型
+				alertText:'',
+				listType: '',
+				listVal: '',
+				detilType:'',
+				id:''//商品ID
+			}
+		},
+		onLoad(option) {
+			console.log(option)
+			self = this;
+			self.loginType = option.type;
+			self.id = option.id
+			if(option.listType) {
+				self.listType = option.listType;
+				self.listVal = option.listVal;
+			}
+		},
+		methods:{
+			...mapMutations(['login']),
+			goLogin() {
+				if(this.accountCode === ""){
+					this.$util.msg('请输入账户名',3000);
+					return
+				}
+				if(this.password === ""){
+					this.$util.msg('请输入密码',3000);
+					return
+				}
+				self.$api.get('/login/isEnabled',{userOrganizeID:self.userOrganizeID,invitationCode:self.invitationCode}, res => {
+					if (res.code == "1") {
+						//查看此微信用户是否已经授权过
+						authorize.getSetting().then(res =>{
+							// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
+							if(res == 2){
+								self.isUserInfo = true
+							}else{
+								self.isUserInfo = false
+								self.wxGetUserInfo()
+							}
+						})
+					}else if(res.code =='0'){
+						self.toestText ='请输入邀请码';
+						self.alertText ='邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else if(res.code =='-2'){
+						self.toestText ='邀请码已失效';
+						self.alertText ='新邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else if(res.code =='-3'){
+						self.toestText ='邀请码已被使用';
+						self.alertText ='新邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else{
+						uni.showToast({icon:'none', title: res.msg, duration: 3000});
+						self.isUserInfo = false
+					}
+				})
+			},
+			//授权登录 
+			getuserinfo: function (e) {
+			    if (e.detail.userInfo) {
+					self.wxGetUserInfo()
+			    }else{
+					//用户按了拒绝按钮
+					uni.showModal({
+						content: '获取用户信息失败,请允许授权后才能继续使用小程序哦~',
+						showCancel: false,
+						confirmText: '授权',
+						success: function (res) {
+							 if (res.confirm) {
+								uni.openSetting({
+									 success: res => {
+										// console.log(res.authSetting)
+									 },
+									 fail: res => {
+										// console.log(res)
+									 }
+								})
+							 }
+						}
+					})
+			    }
+			 },
+			wxGetUserInfo(){
+				authorize.getCode('weixin').then(wechatcode =>{
+					wx.getUserInfo({
+						success: res => {
+							// console.log('useInfo:',res.userInfo)
+							self.userInfo = res.userInfo;
+							let params ={
+									code:wechatcode,
+									nickName:res.userInfo.nickName,
+									invitationCode:self.invitationCode,
+									userOrganizeID:self.userOrganizeID,
+								}
+							self.goUserLogininit(params);
+						}
+					});	
+				})
+			},
+			goUserLogininit(params){
+				self.$api.lodingGet('/login/register',params, response => {
+					// console.log(response)
+					if (response.code == "1") {
+						self.isUserInfo = false;
+						self.login(self.userInfo);
+						let user_key = {code:response.code,openid:response.data.openid,userID:response.data.userID}
+						uni.setStorageSync('cookieKey','JSESSIONID='+response.data.sessionId);
+						this.$store.commit('updateStatus',user_key)
+						let url;
+						if(self.loginType) {
+							if(self.loginType=='detilType'){
+								self.$api.redirectTo(`/pages/goods/product?id=${self.id}&page=2`);
+							}else if(self.loginType=='search'){
+								self.$api.redirectTo('/pages/search/search');
+							}else if(self.loginType == 1){
+								url ='/pages/tabBar/cart/cart'
+							}else if(self.loginType == 2){
+								url ='/pages/tabBar/user/user'
+							}else {
+								url ='/pages/tabBar/home/home'
+							}
+							uni.switchTab({
+								url
+							})
+						} else if(self.listType) {
+							self.$api.navToListPage({type:self.listType,value:self.listVal,lType:'4'});
+						}
+					} else {
+						this.$util.msg(response.msg,3000);
+					}
+				})
+			},
+			//关闭未填邀请码弹窗
+			hideToast(){
+				self.isToast = false;
+			},
+			//关闭未授权用户授权提示弹窗
+			hideModel(){
+				self.isUserInfo = false;
+			},
+			changePasswordType(e){
+				if(this.inputType ==='password'){
+					this.inputType = 'text'
+					this.passIconType = 'icon-yanjing_xianshi_o'
+				}else{
+					this.inputType = 'password'
+					this.passIconType = 'icon-yanjing_yincang_o'
+					
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.login{
+		width: 100%;
+		height: auto;
+		.model-warp.none{
+			display: none;			
+		}
+		.model-warp.show{
+			display: block;
+		}
+		.login-main{
+			width: 100%;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			height: 198rpx;
+			padding: 170rpx 0 60rpx 0;
+			.logo{
+				width: 138rpx;
+				height: 118rpx;
+				display: block;
+			}
+			.logo-text{
+				font-size: 30rpx;
+				line-height: 44rpx;
+				color: $color-system;
+				font-weight: 600;
+				margin-top: 20rpx;
+			}
+		}
+		.login-input{
+			width: 654rpx;
+			height: 40rpx;
+			padding: 24rpx;
+			margin: 0 auto;
+			margin-bottom: 20rpx;
+			background: #F7F7F7;
+			border-radius: 14rpx;
+			position: relative;
+			.input{
+				width: 100%;
+				height: 100%;
+				background: #F7F7F7;
+				font-size: $font-size-base;
+				line-height: 40rpx;
+				color: #333333;
+				border-radius: 14rpx;
+			}
+			.iconfont{
+				position: absolute;
+				right: 24rpx;
+				top: 20rpx;
+				font-size: 46rpx;
+				color: $color-system;;
+				font-weight: bold;
+				z-index: 99;
+			}
+			&.link{
+				background: #FFFFFF;
+				margin-bottom: 40rpx;
+				padding: 0 24rpx;
+				line-height: 40rpx;
+				font-size: $font-size-base;
+				.login-reg{
+					float: left;
+					color: $color-system;
+				}
+				.login-pwd{
+					float: right;
+					color: $text-color;
+				}
+			}
+		}
+		.login-btn{
+			width: 702rpx;
+			height: 88rpx;
+			border-radius: 14rpx;
+			font-size: $font-size-base;
+			line-height: 88rpx;
+			color: #FFFFFF;
+			margin: 0 auto;
+			text-align: center;
+			background: $btn-confirm;
+		}
+		.login-btn-last{
+			width: 702rpx;
+			font-size: $font-size-base;
+			line-height: 160rpx;
+			margin: 0 auto;
+			color: $text-color;
+			text-align: center;
+		}
+		.model-authorization{
+			width: 100%;
+			height: 100%;
+			position: fixed;
+			top: 0;
+			left: 0;
+			z-index: 999;
+			.authorization{
+				width: 518rpx;
+				height: 320rpx;
+				position: absolute;
+				background: rgba(255,255,255,.7);
+				left: 0;
+				right: 0;
+				bottom: 0;
+				top: 0;
+				margin: auto;
+				.to-btn{
+					position: absolute;
+					top: 0;
+					left: 0;
+					right: 0;
+					bottom: 0;
+					margin: auto;
+					width: 70%;
+					height: 88rpx;
+					font-size: $font-size-base;
+					line-height: 88rpx;
+					color: #FFFFFF;
+					text-align: center;
+					border-radius: 44rpx;
+				}
+			}
+		}
+	}
+</style>

+ 292 - 0
pages/user-module/login.vue

@@ -0,0 +1,292 @@
+<template>
+	<view class="container login">
+		<view class="login-main">
+			<image class="logo" src="../../static/login-logo@3x.png" mode=""></image>
+			<text class="logo-text">生美/医美采购服务平台</text>
+		</view>
+		<view class="login-input">
+			<input type="number" 
+				   v-model="invitationCode"  
+				   maxlength="6" 
+				   class="input" 
+				   placeholder="请输入邀请码"
+			/>
+		</view>
+		<view class="login-btn"  @click="goLogin">授权登录</view>
+		<view v-if="isToast" class="model-warp" >
+			<view class="model-alert clearfix">
+				<view class="alert-content">
+					<view class="t-h1">{{toestText}}</view>
+					<view class="t-p">请联系客服获取{{alertText}}后再登录,联系电话{{telPhone}}</view>
+				</view>
+				<view class="alert-btn">
+					<view class="btn btn-confirm" @click="hideToast">确定</view>
+				</view>
+			</view>
+		</view>
+		<!-- 授权按钮 -->
+		<view class="model-warp" :class="[isUserInfo===false ? 'none':'show']">
+			<view class="model-alert">
+				<view class="alert-content">
+					<view class="t-p">采美采购商城需要获取您的微信授权才能正常提供服务</view>
+				</view>
+				<view class="alert-btn">
+					<view class="btn btn-cancel" @click="hideModel">取消</view>
+					<button type="primary" size="small" open-type="getUserInfo" lang="zh_CN" @getuserinfo="getuserinfo" class="btn btn-confirm">授权</button>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { mapMutations } from 'vuex';
+	import authorize from '@/common/config/authorize.js' 
+	var self;
+	export default{
+		data() {
+			return{
+				invitationCode:'',  //获取用户登录的邀请码
+				isToast:false,		//控制显示未输入邀请码提示	
+				isUserInfo:false,	//控制显示授权弹窗
+				nickName:'',		//存储用户名
+				userInfo:'',		//存储微信用户授权信息
+				isSuccess:false,
+				toestText:'',
+				telPhone:'',
+				loginType:'',		//跳转类型
+				alertText:'',
+				listType: '',
+				listVal: '',
+				detilType:'',
+				id:''//商品ID
+			}
+		},
+		onLoad(option) {
+			console.log(option)
+			self = this;
+			self.loginType = option.type;
+			self.id = option.id
+			if(option.listType) {
+				self.listType = option.listType;
+				self.listVal = option.listVal;
+			}
+		},
+		methods:{
+			...mapMutations(['login']),
+			goLogin() {
+				self.$api.get('/login/isEnabled',{userOrganizeID:self.userOrganizeID,invitationCode:self.invitationCode}, res => {
+					if (res.code == "1") {
+						//查看此微信用户是否已经授权过
+						authorize.getSetting().then(res =>{
+							// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
+							if(res == 2){
+								self.isUserInfo = true
+							}else{
+								self.isUserInfo = false
+								self.wxGetUserInfo()
+							}
+						})
+					}else if(res.code =='0'){
+						self.toestText ='请输入邀请码';
+						self.alertText ='邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else if(res.code =='-2'){
+						self.toestText ='邀请码已失效';
+						self.alertText ='新邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else if(res.code =='-3'){
+						self.toestText ='邀请码已被使用';
+						self.alertText ='新邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else{
+						uni.showToast({icon:'none', title: res.msg, duration: 3000});
+						self.isUserInfo = false
+					}
+				})
+			},
+			//授权登录 
+			getuserinfo: function (e) {
+			    if (e.detail.userInfo) {
+					self.wxGetUserInfo()
+			    }else{
+					//用户按了拒绝按钮
+					uni.showModal({
+						content: '获取用户信息失败,请允许授权后才能继续使用小程序哦~',
+						showCancel: false,
+						confirmText: '授权',
+						success: function (res) {
+							 if (res.confirm) {
+								uni.openSetting({
+									 success: res => {
+										// console.log(res.authSetting)
+									 },
+									 fail: res => {
+										// console.log(res)
+									 }
+								})
+							 }
+						}
+					})
+			    }
+			 },
+			wxGetUserInfo(){
+				authorize.getCode('weixin').then(wechatcode =>{
+					wx.getUserInfo({
+						success: res => {
+							// console.log('useInfo:',res.userInfo)
+							self.userInfo = res.userInfo;
+							let params ={
+									code:wechatcode,
+									nickName:res.userInfo.nickName,
+									invitationCode:self.invitationCode,
+									userOrganizeID:self.userOrganizeID,
+								}
+							self.goUserLogininit(params);
+						}
+					});	
+				})
+			},
+			goUserLogininit(params){
+				self.$api.lodingGet('/login/register',params, response => {
+					// console.log(response)
+					if (response.code == "1") {
+						self.isUserInfo = false;
+						self.login(self.userInfo);
+						let user_key = {code:response.code,openid:response.data.openid,userID:response.data.userID}
+						uni.setStorageSync('cookieKey','JSESSIONID='+response.data.sessionId);
+						this.$store.commit('updateStatus',user_key)
+						let url;
+						if(self.loginType) {
+							if(self.loginType=='detilType'){
+								self.$api.redirectTo(`/pages/goods/product?id=${self.id}&page=2`);
+							}else if(self.loginType=='search'){
+								self.$api.redirectTo('/pages/search/search');
+							}else if(self.loginType == 1){
+								url ='/pages/tabBar/cart/cart'
+							}else if(self.loginType == 2){
+								url ='/pages/tabBar/user/user'
+							}else {
+								url ='/pages/tabBar/home/home'
+							}
+							uni.switchTab({
+								url
+							})
+						} else if(self.listType) {
+							self.$api.navToListPage({type:self.listType,value:self.listVal,lType:'4'});
+						}
+					} else {
+						this.$util.msg(response.msg,3000);
+					}
+				})
+			},
+			//关闭未填邀请码弹窗
+			hideToast(){
+				self.isToast = false;
+			},
+			//关闭未授权用户授权提示弹窗
+			hideModel(){
+				self.isUserInfo = false;
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.login{
+		width: 100%;
+		height: auto;
+		.model-warp.none{
+			display: none;			
+		}
+		.model-warp.show{
+			display: block;
+		}
+		.login-main{
+			width: 100%;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			height: 198rpx;
+			padding: 170rpx 0 60rpx 0;
+			.logo{
+				width: 138rpx;
+				height: 118rpx;
+				display: block;
+			}
+			.logo-text{
+				font-size: 30rpx;
+				line-height: 44rpx;
+				color: $color-system;
+				font-weight: 600;
+				margin-top: 20rpx;
+			}
+		}
+		.login-input{
+			width: 654rpx;
+			height: 40rpx;
+			padding: 24rpx;
+			margin: 0 auto;
+			margin-bottom: 60rpx;
+			background: #F7F7F7;
+			border-radius: 14rpx;
+			.input{
+				width: 100%;
+				height: 100%;
+				background: #F7F7F7;
+				font-size: $font-size-base;
+				line-height: 40rpx;
+				color: #333333;
+				border-radius: 14rpx;
+			}
+		}
+		.login-btn{
+			width: 702rpx;
+			height: 88rpx;
+			border-radius: 14rpx;
+			font-size: $font-size-base;
+			line-height: 88rpx;
+			color: #FFFFFF;
+			margin: 0 auto;
+			text-align: center;
+			background: $btn-confirm;
+		}
+		.model-authorization{
+			width: 100%;
+			height: 100%;
+			position: fixed;
+			top: 0;
+			left: 0;
+			z-index: 999;
+			.authorization{
+				width: 518rpx;
+				height: 320rpx;
+				position: absolute;
+				background: rgba(255,255,255,.7);
+				left: 0;
+				right: 0;
+				bottom: 0;
+				top: 0;
+				margin: auto;
+				.to-btn{
+					position: absolute;
+					top: 0;
+					left: 0;
+					right: 0;
+					bottom: 0;
+					margin: auto;
+					width: 70%;
+					height: 88rpx;
+					font-size: $font-size-base;
+					line-height: 88rpx;
+					color: #FFFFFF;
+					text-align: center;
+					border-radius: 44rpx;
+				}
+			}
+		}
+	}
+</style>

+ 292 - 0
pages/user-module/password.vue

@@ -0,0 +1,292 @@
+<template>
+	<view class="container login">
+		<view class="login-main">
+			<image class="logo" src="../../static/login-logo@3x.png" mode=""></image>
+			<text class="logo-text">生美/医美采购服务平台</text>
+		</view>
+		<view class="login-input">
+			<input type="number" 
+				   v-model="invitationCode"  
+				   maxlength="6" 
+				   class="input" 
+				   placeholder="请输入邀请码"
+			/>
+		</view>
+		<view class="login-btn"  @click="goLogin">登录</view>
+		<view v-if="isToast" class="model-warp" >
+			<view class="model-alert clearfix">
+				<view class="alert-content">
+					<view class="t-h1">{{toestText}}</view>
+					<view class="t-p">请联系客服获取{{alertText}}后再登录,联系电话{{telPhone}}</view>
+				</view>
+				<view class="alert-btn">
+					<view class="btn btn-confirm" @click="hideToast">确定</view>
+				</view>
+			</view>
+		</view>
+		<!-- 授权按钮 -->
+		<view class="model-warp" :class="[isUserInfo===false ? 'none':'show']">
+			<view class="model-alert">
+				<view class="alert-content">
+					<view class="t-p">采美采购商城需要获取您的微信授权才能正常提供服务</view>
+				</view>
+				<view class="alert-btn">
+					<view class="btn btn-cancel" @click="hideModel">取消</view>
+					<button type="primary" size="small" open-type="getUserInfo" lang="zh_CN" @getuserinfo="getuserinfo" class="btn btn-confirm">授权</button>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { mapMutations } from 'vuex';
+	import authorize from '@/common/config/authorize.js' 
+	var self;
+	export default{
+		data() {
+			return{
+				invitationCode:'',  //获取用户登录的邀请码
+				isToast:false,		//控制显示未输入邀请码提示	
+				isUserInfo:false,	//控制显示授权弹窗
+				nickName:'',		//存储用户名
+				userInfo:'',		//存储微信用户授权信息
+				isSuccess:false,
+				toestText:'',
+				telPhone:'',
+				loginType:'',		//跳转类型
+				alertText:'',
+				listType: '',
+				listVal: '',
+				detilType:'',
+				id:''//商品ID
+			}
+		},
+		onLoad(option) {
+			console.log(option)
+			self = this;
+			self.loginType = option.type;
+			self.id = option.id
+			if(option.listType) {
+				self.listType = option.listType;
+				self.listVal = option.listVal;
+			}
+		},
+		methods:{
+			...mapMutations(['login']),
+			goLogin() {
+				self.$api.get('/login/isEnabled',{userOrganizeID:self.userOrganizeID,invitationCode:self.invitationCode}, res => {
+					if (res.code == "1") {
+						//查看此微信用户是否已经授权过
+						authorize.getSetting().then(res =>{
+							// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
+							if(res == 2){
+								self.isUserInfo = true
+							}else{
+								self.isUserInfo = false
+								self.wxGetUserInfo()
+							}
+						})
+					}else if(res.code =='0'){
+						self.toestText ='请输入邀请码';
+						self.alertText ='邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else if(res.code =='-2'){
+						self.toestText ='邀请码已失效';
+						self.alertText ='新邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else if(res.code =='-3'){
+						self.toestText ='邀请码已被使用';
+						self.alertText ='新邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else{
+						uni.showToast({icon:'none', title: res.msg, duration: 3000});
+						self.isUserInfo = false
+					}
+				})
+			},
+			//授权登录 
+			getuserinfo: function (e) {
+			    if (e.detail.userInfo) {
+					self.wxGetUserInfo()
+			    }else{
+					//用户按了拒绝按钮
+					uni.showModal({
+						content: '获取用户信息失败,请允许授权后才能继续使用小程序哦~',
+						showCancel: false,
+						confirmText: '授权',
+						success: function (res) {
+							 if (res.confirm) {
+								uni.openSetting({
+									 success: res => {
+										// console.log(res.authSetting)
+									 },
+									 fail: res => {
+										// console.log(res)
+									 }
+								})
+							 }
+						}
+					})
+			    }
+			 },
+			wxGetUserInfo(){
+				authorize.getCode('weixin').then(wechatcode =>{
+					wx.getUserInfo({
+						success: res => {
+							// console.log('useInfo:',res.userInfo)
+							self.userInfo = res.userInfo;
+							let params ={
+									code:wechatcode,
+									nickName:res.userInfo.nickName,
+									invitationCode:self.invitationCode,
+									userOrganizeID:self.userOrganizeID,
+								}
+							self.goUserLogininit(params);
+						}
+					});	
+				})
+			},
+			goUserLogininit(params){
+				self.$api.lodingGet('/login/register',params, response => {
+					// console.log(response)
+					if (response.code == "1") {
+						self.isUserInfo = false;
+						self.login(self.userInfo);
+						let user_key = {code:response.code,openid:response.data.openid,userID:response.data.userID}
+						uni.setStorageSync('cookieKey','JSESSIONID='+response.data.sessionId);
+						this.$store.commit('updateStatus',user_key)
+						let url;
+						if(self.loginType) {
+							if(self.loginType=='detilType'){
+								self.$api.redirectTo(`/pages/goods/product?id=${self.id}&page=2`);
+							}else if(self.loginType=='search'){
+								self.$api.redirectTo('/pages/search/search');
+							}else if(self.loginType == 1){
+								url ='/pages/tabBar/cart/cart'
+							}else if(self.loginType == 2){
+								url ='/pages/tabBar/user/user'
+							}else {
+								url ='/pages/tabBar/home/home'
+							}
+							uni.switchTab({
+								url
+							})
+						} else if(self.listType) {
+							self.$api.navToListPage({type:self.listType,value:self.listVal,lType:'4'});
+						}
+					} else {
+						this.$util.msg(response.msg,3000);
+					}
+				})
+			},
+			//关闭未填邀请码弹窗
+			hideToast(){
+				self.isToast = false;
+			},
+			//关闭未授权用户授权提示弹窗
+			hideModel(){
+				self.isUserInfo = false;
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.login{
+		width: 100%;
+		height: auto;
+		.model-warp.none{
+			display: none;			
+		}
+		.model-warp.show{
+			display: block;
+		}
+		.login-main{
+			width: 100%;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			height: 198rpx;
+			padding: 170rpx 0 60rpx 0;
+			.logo{
+				width: 138rpx;
+				height: 118rpx;
+				display: block;
+			}
+			.logo-text{
+				font-size: 30rpx;
+				line-height: 44rpx;
+				color: $color-system;
+				font-weight: 600;
+				margin-top: 20rpx;
+			}
+		}
+		.login-input{
+			width: 654rpx;
+			height: 40rpx;
+			padding: 24rpx;
+			margin: 0 auto;
+			margin-bottom: 60rpx;
+			background: #F7F7F7;
+			border-radius: 14rpx;
+			.input{
+				width: 100%;
+				height: 100%;
+				background: #F7F7F7;
+				font-size: $font-size-base;
+				line-height: 40rpx;
+				color: #333333;
+				border-radius: 14rpx;
+			}
+		}
+		.login-btn{
+			width: 702rpx;
+			height: 88rpx;
+			border-radius: 14rpx;
+			font-size: $font-size-base;
+			line-height: 88rpx;
+			color: #FFFFFF;
+			margin: 0 auto;
+			text-align: center;
+			background: $btn-confirm;
+		}
+		.model-authorization{
+			width: 100%;
+			height: 100%;
+			position: fixed;
+			top: 0;
+			left: 0;
+			z-index: 999;
+			.authorization{
+				width: 518rpx;
+				height: 320rpx;
+				position: absolute;
+				background: rgba(255,255,255,.7);
+				left: 0;
+				right: 0;
+				bottom: 0;
+				top: 0;
+				margin: auto;
+				.to-btn{
+					position: absolute;
+					top: 0;
+					left: 0;
+					right: 0;
+					bottom: 0;
+					margin: auto;
+					width: 70%;
+					height: 88rpx;
+					font-size: $font-size-base;
+					line-height: 88rpx;
+					color: #FFFFFF;
+					text-align: center;
+					border-radius: 44rpx;
+				}
+			}
+		}
+	}
+</style>

+ 292 - 0
pages/user-module/register.vue

@@ -0,0 +1,292 @@
+<template>
+	<view class="container login">
+		<view class="login-main">
+			<image class="logo" src="../../static/login-logo@3x.png" mode=""></image>
+			<text class="logo-text">生美/医美采购服务平台</text>
+		</view>
+		<view class="login-input">
+			<input type="number" 
+				   v-model="invitationCode"  
+				   maxlength="6" 
+				   class="input" 
+				   placeholder="请输入邀请码"
+			/>
+		</view>
+		<view class="login-btn"  @click="goLogin">登录</view>
+		<view v-if="isToast" class="model-warp" >
+			<view class="model-alert clearfix">
+				<view class="alert-content">
+					<view class="t-h1">{{toestText}}</view>
+					<view class="t-p">请联系客服获取{{alertText}}后再登录,联系电话{{telPhone}}</view>
+				</view>
+				<view class="alert-btn">
+					<view class="btn btn-confirm" @click="hideToast">确定</view>
+				</view>
+			</view>
+		</view>
+		<!-- 授权按钮 -->
+		<view class="model-warp" :class="[isUserInfo===false ? 'none':'show']">
+			<view class="model-alert">
+				<view class="alert-content">
+					<view class="t-p">采美采购商城需要获取您的微信授权才能正常提供服务</view>
+				</view>
+				<view class="alert-btn">
+					<view class="btn btn-cancel" @click="hideModel">取消</view>
+					<button type="primary" size="small" open-type="getUserInfo" lang="zh_CN" @getuserinfo="getuserinfo" class="btn btn-confirm">授权</button>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { mapMutations } from 'vuex';
+	import authorize from '@/common/config/authorize.js' 
+	var self;
+	export default{
+		data() {
+			return{
+				invitationCode:'',  //获取用户登录的邀请码
+				isToast:false,		//控制显示未输入邀请码提示	
+				isUserInfo:false,	//控制显示授权弹窗
+				nickName:'',		//存储用户名
+				userInfo:'',		//存储微信用户授权信息
+				isSuccess:false,
+				toestText:'',
+				telPhone:'',
+				loginType:'',		//跳转类型
+				alertText:'',
+				listType: '',
+				listVal: '',
+				detilType:'',
+				id:''//商品ID
+			}
+		},
+		onLoad(option) {
+			console.log(option)
+			self = this;
+			self.loginType = option.type;
+			self.id = option.id
+			if(option.listType) {
+				self.listType = option.listType;
+				self.listVal = option.listVal;
+			}
+		},
+		methods:{
+			...mapMutations(['login']),
+			goLogin() {
+				self.$api.get('/login/isEnabled',{userOrganizeID:self.userOrganizeID,invitationCode:self.invitationCode}, res => {
+					if (res.code == "1") {
+						//查看此微信用户是否已经授权过
+						authorize.getSetting().then(res =>{
+							// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
+							if(res == 2){
+								self.isUserInfo = true
+							}else{
+								self.isUserInfo = false
+								self.wxGetUserInfo()
+							}
+						})
+					}else if(res.code =='0'){
+						self.toestText ='请输入邀请码';
+						self.alertText ='邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else if(res.code =='-2'){
+						self.toestText ='邀请码已失效';
+						self.alertText ='新邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else if(res.code =='-3'){
+						self.toestText ='邀请码已被使用';
+						self.alertText ='新邀请码';
+						self.telPhone = res.msg;
+						self.isToast = true;
+					}else{
+						uni.showToast({icon:'none', title: res.msg, duration: 3000});
+						self.isUserInfo = false
+					}
+				})
+			},
+			//授权登录 
+			getuserinfo: function (e) {
+			    if (e.detail.userInfo) {
+					self.wxGetUserInfo()
+			    }else{
+					//用户按了拒绝按钮
+					uni.showModal({
+						content: '获取用户信息失败,请允许授权后才能继续使用小程序哦~',
+						showCancel: false,
+						confirmText: '授权',
+						success: function (res) {
+							 if (res.confirm) {
+								uni.openSetting({
+									 success: res => {
+										// console.log(res.authSetting)
+									 },
+									 fail: res => {
+										// console.log(res)
+									 }
+								})
+							 }
+						}
+					})
+			    }
+			 },
+			wxGetUserInfo(){
+				authorize.getCode('weixin').then(wechatcode =>{
+					wx.getUserInfo({
+						success: res => {
+							// console.log('useInfo:',res.userInfo)
+							self.userInfo = res.userInfo;
+							let params ={
+									code:wechatcode,
+									nickName:res.userInfo.nickName,
+									invitationCode:self.invitationCode,
+									userOrganizeID:self.userOrganizeID,
+								}
+							self.goUserLogininit(params);
+						}
+					});	
+				})
+			},
+			goUserLogininit(params){
+				self.$api.lodingGet('/login/register',params, response => {
+					// console.log(response)
+					if (response.code == "1") {
+						self.isUserInfo = false;
+						self.login(self.userInfo);
+						let user_key = {code:response.code,openid:response.data.openid,userID:response.data.userID}
+						uni.setStorageSync('cookieKey','JSESSIONID='+response.data.sessionId);
+						this.$store.commit('updateStatus',user_key)
+						let url;
+						if(self.loginType) {
+							if(self.loginType=='detilType'){
+								self.$api.redirectTo(`/pages/goods/product?id=${self.id}&page=2`);
+							}else if(self.loginType=='search'){
+								self.$api.redirectTo('/pages/search/search');
+							}else if(self.loginType == 1){
+								url ='/pages/tabBar/cart/cart'
+							}else if(self.loginType == 2){
+								url ='/pages/tabBar/user/user'
+							}else {
+								url ='/pages/tabBar/home/home'
+							}
+							uni.switchTab({
+								url
+							})
+						} else if(self.listType) {
+							self.$api.navToListPage({type:self.listType,value:self.listVal,lType:'4'});
+						}
+					} else {
+						this.$util.msg(response.msg,3000);
+					}
+				})
+			},
+			//关闭未填邀请码弹窗
+			hideToast(){
+				self.isToast = false;
+			},
+			//关闭未授权用户授权提示弹窗
+			hideModel(){
+				self.isUserInfo = false;
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.login{
+		width: 100%;
+		height: auto;
+		.model-warp.none{
+			display: none;			
+		}
+		.model-warp.show{
+			display: block;
+		}
+		.login-main{
+			width: 100%;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			height: 198rpx;
+			padding: 170rpx 0 60rpx 0;
+			.logo{
+				width: 138rpx;
+				height: 118rpx;
+				display: block;
+			}
+			.logo-text{
+				font-size: 30rpx;
+				line-height: 44rpx;
+				color: $color-system;
+				font-weight: 600;
+				margin-top: 20rpx;
+			}
+		}
+		.login-input{
+			width: 654rpx;
+			height: 40rpx;
+			padding: 24rpx;
+			margin: 0 auto;
+			margin-bottom: 60rpx;
+			background: #F7F7F7;
+			border-radius: 14rpx;
+			.input{
+				width: 100%;
+				height: 100%;
+				background: #F7F7F7;
+				font-size: $font-size-base;
+				line-height: 40rpx;
+				color: #333333;
+				border-radius: 14rpx;
+			}
+		}
+		.login-btn{
+			width: 702rpx;
+			height: 88rpx;
+			border-radius: 14rpx;
+			font-size: $font-size-base;
+			line-height: 88rpx;
+			color: #FFFFFF;
+			margin: 0 auto;
+			text-align: center;
+			background: $btn-confirm;
+		}
+		.model-authorization{
+			width: 100%;
+			height: 100%;
+			position: fixed;
+			top: 0;
+			left: 0;
+			z-index: 999;
+			.authorization{
+				width: 518rpx;
+				height: 320rpx;
+				position: absolute;
+				background: rgba(255,255,255,.7);
+				left: 0;
+				right: 0;
+				bottom: 0;
+				top: 0;
+				margin: auto;
+				.to-btn{
+					position: absolute;
+					top: 0;
+					left: 0;
+					right: 0;
+					bottom: 0;
+					margin: auto;
+					width: 70%;
+					height: 88rpx;
+					font-size: $font-size-base;
+					line-height: 88rpx;
+					color: #FFFFFF;
+					text-align: center;
+					border-radius: 44rpx;
+				}
+			}
+		}
+	}
+</style>

+ 8 - 0
pages/user/operator/addoperator.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 8 - 0
pages/user/operator/list.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 2 - 2
pages/user/regularPurchase/regularPurchase.vue

@@ -38,8 +38,8 @@
 		},
 		methods:{
 			setServerUrl() {
-				this.lastPageType = '常采购商品';
-				this.lastPageVal = '常采购商品';
+				this.lastPageType = '再次购买';
+				this.lastPageVal = '再次购买';
 				// 空内容文案
 				const emptyTxt = '您还没有购买过任何商品哟~';
 				this.serverUrl = `/order/purchase?userID=${this.userID}`;

+ 314 - 0
pages/user/setting/password.vue

@@ -0,0 +1,314 @@
+<template>
+	<view class="container clearfix">
+		<view v-if="isEmpty" class="empty-container">
+			<image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AFmO1AAGxLZjSeDg040.png" mode="aspectFit"></image>
+			<view class="txt">您还没有收货地址</view>
+			<view class="txt">点击底部按钮添加收货地址吧~~</view>
+			<view class="login-btn" @click="addAddress('add')">添加新地址</view>
+		</view>
+		<view v-else class="address-list" :style="{'height': scrollHeight + 'px'}">
+			<scroll-view scroll-y="true" :style="{'height': scrollHeight + 'px'}">
+				<view class="list" v-for="(item, index) in addressList" :key="index" @click="checkAddress(item)">
+					<view class="wrapper">
+						<view class="u-box">
+							<text class="name">{{item.shouHuoRen}}</text>
+							<text class="mobile">{{item.mobile}}</text>
+						</view>
+						<view class="u-box b-b">
+							<text class="address">收货地址:{{item.province}}{{item.city}}{{item.town}}{{item.addressDetail}}</text>
+						</view>
+						<view class="u-box b-t">
+							<view v-if="item.defaultFlag == 1" class="tag-left">
+								<view class="tag">默认地址</view>
+							</view>
+							<view v-else class="tag-left"></view>
+							<view class="tag-right">
+								<view class="t-b"  @click.stop="deleteAddress(item.addressID)">
+									<text class="iconfont icon-shanchu"></text>
+									<text class="txt">删除</text>
+								</view>
+								<view class="t-b"  @click.stop="addAddress('edit',item)">
+									<text class="iconfont icon-bianji"></text>
+									<text class="txt">编辑</text>
+								</view>
+								
+							</view>
+						</view>
+					</view>
+				</view>
+			</scroll-view>
+			<view class="add-btn" @click="addAddress('add')">添加新地址</view>
+		</view>
+		<!-- 删除弹窗 -->
+		<model-alert v-if="isShowDelModal"
+					 :alertText='alertText' 
+					 @btnConfirm ='confirmDetele'>
+		</model-alert>
+	</view>
+</template>
+
+<script>
+	import authorize from '@/common/config/authorize.js'	
+	import modelAlert from '@/components/module/modelAlert/modelAlert.vue'
+	export default {
+		components:{
+			modelAlert
+		},
+		data() {
+			return {
+				isSelect:false,
+				isEmpty:false,
+				isLoadMore:false,
+				alertText:'确定要删除该地址?',
+				userID:'',
+				pageNum:1,
+				pageSize:10,
+				addressList: [],
+				hasNextPage:false,
+				allowDataStatus:true,
+				isShowDelModal:false,
+				wrapperHeight:'100%',
+				scrollHeight:'',
+				deleteAddressId:'',
+				currPage:'',//当前页面
+				prevPage:''//上一个页面
+			}
+		},
+		onLoad(option){	
+			if(option.type=='select'){this.isSelect = true;}
+			this.setScrollHeight();
+		},
+		onReachBottom() {
+			// console.log('滑动到页面底部')
+			if(this.isLoadMore) {
+				this.initAddressList();
+			}
+		},
+		methods: {
+			setScrollHeight() {
+				// 窗口高度 - 底部距离
+				setTimeout(()=> {
+					const query = wx.createSelectorQuery().in(this);
+					query.selectAll('.add-btn').boundingClientRect();
+					query.exec(res => {
+						if(res[0][0]){
+							let winHeight = this.$api.getWindowHeight(),
+								eleTop = res[0][0].top - 1;
+								this.scrollHeight =  eleTop;
+						}
+					})
+				}, 500)
+			},
+			initAddressList(){	
+				this.$api.getStorage().then((resolve) =>{
+					this.userID = resolve.userID
+					this.$api.get('/personal/findAddress',{index:this.pageNum,pageSize:this.pageSize,userID:this.userID},
+						response => {
+							if(response.results == ''){
+								this.isEmpty = true
+							}else{
+								this.isEmpty = false
+								let results =[];
+								results = response.results;
+								this.addressList = this.addressList.concat(results);
+								this.pageNum = response.index +1;
+								if(this.pageNum === response.totalPage + 1 ){
+									this.isLoadMore = false;
+								} else {
+									this.isLoadMore = true;
+								}
+							}
+						}
+					)
+				})
+			},
+			//选择地址
+			checkAddress(item){
+				//是否需要返回地址(从订单确认页跳过来选收货地址)
+				if(!this.isSelect){return ;}
+				uni.setStorageSync('selectAddress',item)
+				var pages = getCurrentPages();
+				var prevPage = pages[pages.length - 2];  //上一个页面	
+					prevPage.setData({select:'select'})
+				uni.navigateBack();
+			},
+			addAddress(type,item){
+				uni.navigateTo({
+					url: `/pages/user/address/addressManage?type=${type}&data=${JSON.stringify(item)}`
+				})
+			},
+			//删除收货地址
+			deleteAddress(id){
+				console.log('删除地址的ID',id)
+				this.isShowDelModal = true;
+				this.deleteAddressId =id;
+			},
+			confirmDetele(){
+				authorize.getCode('weixin').then(wechatcode =>{
+					this.$api.get('/personal/delete?code='+`${wechatcode}`,{addressID:this.deleteAddressId,userOrganizeID:this.userOrganizeID},
+						response => {
+							if(response.code==1){
+								uni.showToast({
+									icon: 'none',
+									title: response.msg,
+									duration: 2000
+								})
+								this.isShowDelModal = false;
+								this.pageNum = 1;
+								this.addressList = [];
+								this.initAddressList();
+							}else{
+								this.$util.msg(response.msg,3000);
+								this.isShowDelModal = false;
+								setTimeout(function(){
+									uni.switchTab({
+										url:'/pages/tabBar/home/home'
+									})
+								},1000)
+							}
+						}
+					)
+				})	
+			},
+		},
+		onShow() {
+			this.pageNum = 1;
+			this.addressList = [];
+			this.initAddressList();
+			var pages = getCurrentPages();
+			var prevPage = pages[pages.length - 2];  //上一个页面	
+				// prevPage.setData({select:''})
+		}
+	}
+</script>
+
+<style lang='scss'>
+	page {
+		height: auto;
+	}
+	page,.container{
+		/* padding-bottom: 120upx; */
+		background: #F7F7F7;
+		border-top: 1px solid #EBEBEB;
+	}
+	.container{
+		position: relative;
+	}
+	.list{
+		display: flex;
+		align-items: center;
+		width: 702rpx;
+		height: auto;
+		padding: 24rpx;
+		background: #FFFFFF;
+		position: relative;
+		border-bottom: 1px solid #EBEBEB;
+	}
+	.wrapper{
+		display: flex;
+		flex-direction: column;
+		flex: 1;
+	}
+	.u-box.b-b{
+		
+	}
+	.u-box.b-b{
+		margin-bottom:24rpx;
+	}
+	.u-box.b-t{
+		margin-bottom:0;
+	}
+	.u-box{
+		display: flex;
+		align-items: center;
+		font-size: $font-size-base;
+		color: $text-color;
+		line-height: 40rpx;
+		margin-bottom: 12rpx;
+		.name{
+			margin-right: 40rpx;
+			font-weight: bold;
+		}
+		.mobile{
+			font-weight: bold;
+		}
+		.tag-left{
+			flex: 6;
+			.tag{
+				width: 120rpx;
+				height: 40rpx;
+				background: $color-system;
+				border-radius: 20rpx;
+				font-size: $font-size-sm;
+				color: #FFFFFF;
+				line-height: 40rpx;
+				text-align: center;
+				padding: 0 6rpx;
+			}
+		}
+		.tag-right{
+			flex: 4;
+			display: flex;
+			text-align: right;
+			.t-b{
+				flex: 1;
+				line-height: 40rpx;
+				.txt{
+					font-size: $font-size-sm;
+					color: $text-color;
+					line-height: 40rpx;
+				}
+			}
+			.icon-shanchu{
+				color:#FF2A2A ;
+				margin-right: 8rpx;
+			}
+			.icon-bianji{
+				color: #2A7AFF;
+				margin-right: 8rpx;
+			}
+		}
+		.address{
+			font-size: $font-size-base;
+			color: $text-color;
+			line-height: 40rpx;
+			-o-text-overflow: ellipsis;
+			text-overflow: ellipsis;
+			display: -webkit-box;
+			word-break: break-all;
+			-webkit-box-orient: vertical;
+			-webkit-line-clamp: 2;
+			overflow: hidden;
+		}
+	}
+	.add-btn{
+		position: fixed;
+		left: 24rpx;
+		right: 24rpx;
+		bottom: 34rpx;
+		z-index: 95;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		width: 702rpx;
+		height: 88rpx;
+		font-size: $font-size-base;
+		line-height: 88rpx;
+		color: #FFFFFF;
+		text-align: center;
+		background: $btn-confirm;
+		border-radius: 14rpx;
+	}
+	.adds-btn{
+		width: 702rpx;
+		height: 88rpx;
+		font-size: 28rpx;
+		line-height: 88rpx;
+		color: #FFFFFF;
+		margin: 0 auto;
+		text-align: center;
+		background: #000000;
+		border-radius: 14rpx;
+	}
+</style>
+

+ 314 - 0
pages/user/setting/phone.vue

@@ -0,0 +1,314 @@
+<template>
+	<view class="container clearfix">
+		<view v-if="isEmpty" class="empty-container">
+			<image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AFmO1AAGxLZjSeDg040.png" mode="aspectFit"></image>
+			<view class="txt">您还没有收货地址</view>
+			<view class="txt">点击底部按钮添加收货地址吧~~</view>
+			<view class="login-btn" @click="addAddress('add')">添加新地址</view>
+		</view>
+		<view v-else class="address-list" :style="{'height': scrollHeight + 'px'}">
+			<scroll-view scroll-y="true" :style="{'height': scrollHeight + 'px'}">
+				<view class="list" v-for="(item, index) in addressList" :key="index" @click="checkAddress(item)">
+					<view class="wrapper">
+						<view class="u-box">
+							<text class="name">{{item.shouHuoRen}}</text>
+							<text class="mobile">{{item.mobile}}</text>
+						</view>
+						<view class="u-box b-b">
+							<text class="address">收货地址:{{item.province}}{{item.city}}{{item.town}}{{item.addressDetail}}</text>
+						</view>
+						<view class="u-box b-t">
+							<view v-if="item.defaultFlag == 1" class="tag-left">
+								<view class="tag">默认地址</view>
+							</view>
+							<view v-else class="tag-left"></view>
+							<view class="tag-right">
+								<view class="t-b"  @click.stop="deleteAddress(item.addressID)">
+									<text class="iconfont icon-shanchu"></text>
+									<text class="txt">删除</text>
+								</view>
+								<view class="t-b"  @click.stop="addAddress('edit',item)">
+									<text class="iconfont icon-bianji"></text>
+									<text class="txt">编辑</text>
+								</view>
+								
+							</view>
+						</view>
+					</view>
+				</view>
+			</scroll-view>
+			<view class="add-btn" @click="addAddress('add')">添加新地址</view>
+		</view>
+		<!-- 删除弹窗 -->
+		<model-alert v-if="isShowDelModal"
+					 :alertText='alertText' 
+					 @btnConfirm ='confirmDetele'>
+		</model-alert>
+	</view>
+</template>
+
+<script>
+	import authorize from '@/common/config/authorize.js'	
+	import modelAlert from '@/components/module/modelAlert/modelAlert.vue'
+	export default {
+		components:{
+			modelAlert
+		},
+		data() {
+			return {
+				isSelect:false,
+				isEmpty:false,
+				isLoadMore:false,
+				alertText:'确定要删除该地址?',
+				userID:'',
+				pageNum:1,
+				pageSize:10,
+				addressList: [],
+				hasNextPage:false,
+				allowDataStatus:true,
+				isShowDelModal:false,
+				wrapperHeight:'100%',
+				scrollHeight:'',
+				deleteAddressId:'',
+				currPage:'',//当前页面
+				prevPage:''//上一个页面
+			}
+		},
+		onLoad(option){	
+			if(option.type=='select'){this.isSelect = true;}
+			this.setScrollHeight();
+		},
+		onReachBottom() {
+			// console.log('滑动到页面底部')
+			if(this.isLoadMore) {
+				this.initAddressList();
+			}
+		},
+		methods: {
+			setScrollHeight() {
+				// 窗口高度 - 底部距离
+				setTimeout(()=> {
+					const query = wx.createSelectorQuery().in(this);
+					query.selectAll('.add-btn').boundingClientRect();
+					query.exec(res => {
+						if(res[0][0]){
+							let winHeight = this.$api.getWindowHeight(),
+								eleTop = res[0][0].top - 1;
+								this.scrollHeight =  eleTop;
+						}
+					})
+				}, 500)
+			},
+			initAddressList(){	
+				this.$api.getStorage().then((resolve) =>{
+					this.userID = resolve.userID
+					this.$api.get('/personal/findAddress',{index:this.pageNum,pageSize:this.pageSize,userID:this.userID},
+						response => {
+							if(response.results == ''){
+								this.isEmpty = true
+							}else{
+								this.isEmpty = false
+								let results =[];
+								results = response.results;
+								this.addressList = this.addressList.concat(results);
+								this.pageNum = response.index +1;
+								if(this.pageNum === response.totalPage + 1 ){
+									this.isLoadMore = false;
+								} else {
+									this.isLoadMore = true;
+								}
+							}
+						}
+					)
+				})
+			},
+			//选择地址
+			checkAddress(item){
+				//是否需要返回地址(从订单确认页跳过来选收货地址)
+				if(!this.isSelect){return ;}
+				uni.setStorageSync('selectAddress',item)
+				var pages = getCurrentPages();
+				var prevPage = pages[pages.length - 2];  //上一个页面	
+					prevPage.setData({select:'select'})
+				uni.navigateBack();
+			},
+			addAddress(type,item){
+				uni.navigateTo({
+					url: `/pages/user/address/addressManage?type=${type}&data=${JSON.stringify(item)}`
+				})
+			},
+			//删除收货地址
+			deleteAddress(id){
+				console.log('删除地址的ID',id)
+				this.isShowDelModal = true;
+				this.deleteAddressId =id;
+			},
+			confirmDetele(){
+				authorize.getCode('weixin').then(wechatcode =>{
+					this.$api.get('/personal/delete?code='+`${wechatcode}`,{addressID:this.deleteAddressId,userOrganizeID:this.userOrganizeID},
+						response => {
+							if(response.code==1){
+								uni.showToast({
+									icon: 'none',
+									title: response.msg,
+									duration: 2000
+								})
+								this.isShowDelModal = false;
+								this.pageNum = 1;
+								this.addressList = [];
+								this.initAddressList();
+							}else{
+								this.$util.msg(response.msg,3000);
+								this.isShowDelModal = false;
+								setTimeout(function(){
+									uni.switchTab({
+										url:'/pages/tabBar/home/home'
+									})
+								},1000)
+							}
+						}
+					)
+				})	
+			},
+		},
+		onShow() {
+			this.pageNum = 1;
+			this.addressList = [];
+			this.initAddressList();
+			var pages = getCurrentPages();
+			var prevPage = pages[pages.length - 2];  //上一个页面	
+				// prevPage.setData({select:''})
+		}
+	}
+</script>
+
+<style lang='scss'>
+	page {
+		height: auto;
+	}
+	page,.container{
+		/* padding-bottom: 120upx; */
+		background: #F7F7F7;
+		border-top: 1px solid #EBEBEB;
+	}
+	.container{
+		position: relative;
+	}
+	.list{
+		display: flex;
+		align-items: center;
+		width: 702rpx;
+		height: auto;
+		padding: 24rpx;
+		background: #FFFFFF;
+		position: relative;
+		border-bottom: 1px solid #EBEBEB;
+	}
+	.wrapper{
+		display: flex;
+		flex-direction: column;
+		flex: 1;
+	}
+	.u-box.b-b{
+		
+	}
+	.u-box.b-b{
+		margin-bottom:24rpx;
+	}
+	.u-box.b-t{
+		margin-bottom:0;
+	}
+	.u-box{
+		display: flex;
+		align-items: center;
+		font-size: $font-size-base;
+		color: $text-color;
+		line-height: 40rpx;
+		margin-bottom: 12rpx;
+		.name{
+			margin-right: 40rpx;
+			font-weight: bold;
+		}
+		.mobile{
+			font-weight: bold;
+		}
+		.tag-left{
+			flex: 6;
+			.tag{
+				width: 120rpx;
+				height: 40rpx;
+				background: $color-system;
+				border-radius: 20rpx;
+				font-size: $font-size-sm;
+				color: #FFFFFF;
+				line-height: 40rpx;
+				text-align: center;
+				padding: 0 6rpx;
+			}
+		}
+		.tag-right{
+			flex: 4;
+			display: flex;
+			text-align: right;
+			.t-b{
+				flex: 1;
+				line-height: 40rpx;
+				.txt{
+					font-size: $font-size-sm;
+					color: $text-color;
+					line-height: 40rpx;
+				}
+			}
+			.icon-shanchu{
+				color:#FF2A2A ;
+				margin-right: 8rpx;
+			}
+			.icon-bianji{
+				color: #2A7AFF;
+				margin-right: 8rpx;
+			}
+		}
+		.address{
+			font-size: $font-size-base;
+			color: $text-color;
+			line-height: 40rpx;
+			-o-text-overflow: ellipsis;
+			text-overflow: ellipsis;
+			display: -webkit-box;
+			word-break: break-all;
+			-webkit-box-orient: vertical;
+			-webkit-line-clamp: 2;
+			overflow: hidden;
+		}
+	}
+	.add-btn{
+		position: fixed;
+		left: 24rpx;
+		right: 24rpx;
+		bottom: 34rpx;
+		z-index: 95;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		width: 702rpx;
+		height: 88rpx;
+		font-size: $font-size-base;
+		line-height: 88rpx;
+		color: #FFFFFF;
+		text-align: center;
+		background: $btn-confirm;
+		border-radius: 14rpx;
+	}
+	.adds-btn{
+		width: 702rpx;
+		height: 88rpx;
+		font-size: 28rpx;
+		line-height: 88rpx;
+		color: #FFFFFF;
+		margin: 0 auto;
+		text-align: center;
+		background: #000000;
+		border-radius: 14rpx;
+	}
+</style>
+

+ 314 - 0
pages/user/setting/setting.vue

@@ -0,0 +1,314 @@
+<template>
+	<view class="container clearfix">
+		<view v-if="isEmpty" class="empty-container">
+			<image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AFmO1AAGxLZjSeDg040.png" mode="aspectFit"></image>
+			<view class="txt">您还没有收货地址</view>
+			<view class="txt">点击底部按钮添加收货地址吧~~</view>
+			<view class="login-btn" @click="addAddress('add')">添加新地址</view>
+		</view>
+		<view v-else class="address-list" :style="{'height': scrollHeight + 'px'}">
+			<scroll-view scroll-y="true" :style="{'height': scrollHeight + 'px'}">
+				<view class="list" v-for="(item, index) in addressList" :key="index" @click="checkAddress(item)">
+					<view class="wrapper">
+						<view class="u-box">
+							<text class="name">{{item.shouHuoRen}}</text>
+							<text class="mobile">{{item.mobile}}</text>
+						</view>
+						<view class="u-box b-b">
+							<text class="address">收货地址:{{item.province}}{{item.city}}{{item.town}}{{item.addressDetail}}</text>
+						</view>
+						<view class="u-box b-t">
+							<view v-if="item.defaultFlag == 1" class="tag-left">
+								<view class="tag">默认地址</view>
+							</view>
+							<view v-else class="tag-left"></view>
+							<view class="tag-right">
+								<view class="t-b"  @click.stop="deleteAddress(item.addressID)">
+									<text class="iconfont icon-shanchu"></text>
+									<text class="txt">删除</text>
+								</view>
+								<view class="t-b"  @click.stop="addAddress('edit',item)">
+									<text class="iconfont icon-bianji"></text>
+									<text class="txt">编辑</text>
+								</view>
+								
+							</view>
+						</view>
+					</view>
+				</view>
+			</scroll-view>
+			<view class="add-btn" @click="addAddress('add')">添加新地址</view>
+		</view>
+		<!-- 删除弹窗 -->
+		<model-alert v-if="isShowDelModal"
+					 :alertText='alertText' 
+					 @btnConfirm ='confirmDetele'>
+		</model-alert>
+	</view>
+</template>
+
+<script>
+	import authorize from '@/common/config/authorize.js'	
+	import modelAlert from '@/components/module/modelAlert/modelAlert.vue'
+	export default {
+		components:{
+			modelAlert
+		},
+		data() {
+			return {
+				isSelect:false,
+				isEmpty:false,
+				isLoadMore:false,
+				alertText:'确定要删除该地址?',
+				userID:'',
+				pageNum:1,
+				pageSize:10,
+				addressList: [],
+				hasNextPage:false,
+				allowDataStatus:true,
+				isShowDelModal:false,
+				wrapperHeight:'100%',
+				scrollHeight:'',
+				deleteAddressId:'',
+				currPage:'',//当前页面
+				prevPage:''//上一个页面
+			}
+		},
+		onLoad(option){	
+			if(option.type=='select'){this.isSelect = true;}
+			this.setScrollHeight();
+		},
+		onReachBottom() {
+			// console.log('滑动到页面底部')
+			if(this.isLoadMore) {
+				this.initAddressList();
+			}
+		},
+		methods: {
+			setScrollHeight() {
+				// 窗口高度 - 底部距离
+				setTimeout(()=> {
+					const query = wx.createSelectorQuery().in(this);
+					query.selectAll('.add-btn').boundingClientRect();
+					query.exec(res => {
+						if(res[0][0]){
+							let winHeight = this.$api.getWindowHeight(),
+								eleTop = res[0][0].top - 1;
+								this.scrollHeight =  eleTop;
+						}
+					})
+				}, 500)
+			},
+			initAddressList(){	
+				this.$api.getStorage().then((resolve) =>{
+					this.userID = resolve.userID
+					this.$api.get('/personal/findAddress',{index:this.pageNum,pageSize:this.pageSize,userID:this.userID},
+						response => {
+							if(response.results == ''){
+								this.isEmpty = true
+							}else{
+								this.isEmpty = false
+								let results =[];
+								results = response.results;
+								this.addressList = this.addressList.concat(results);
+								this.pageNum = response.index +1;
+								if(this.pageNum === response.totalPage + 1 ){
+									this.isLoadMore = false;
+								} else {
+									this.isLoadMore = true;
+								}
+							}
+						}
+					)
+				})
+			},
+			//选择地址
+			checkAddress(item){
+				//是否需要返回地址(从订单确认页跳过来选收货地址)
+				if(!this.isSelect){return ;}
+				uni.setStorageSync('selectAddress',item)
+				var pages = getCurrentPages();
+				var prevPage = pages[pages.length - 2];  //上一个页面	
+					prevPage.setData({select:'select'})
+				uni.navigateBack();
+			},
+			addAddress(type,item){
+				uni.navigateTo({
+					url: `/pages/user/address/addressManage?type=${type}&data=${JSON.stringify(item)}`
+				})
+			},
+			//删除收货地址
+			deleteAddress(id){
+				console.log('删除地址的ID',id)
+				this.isShowDelModal = true;
+				this.deleteAddressId =id;
+			},
+			confirmDetele(){
+				authorize.getCode('weixin').then(wechatcode =>{
+					this.$api.get('/personal/delete?code='+`${wechatcode}`,{addressID:this.deleteAddressId,userOrganizeID:this.userOrganizeID},
+						response => {
+							if(response.code==1){
+								uni.showToast({
+									icon: 'none',
+									title: response.msg,
+									duration: 2000
+								})
+								this.isShowDelModal = false;
+								this.pageNum = 1;
+								this.addressList = [];
+								this.initAddressList();
+							}else{
+								this.$util.msg(response.msg,3000);
+								this.isShowDelModal = false;
+								setTimeout(function(){
+									uni.switchTab({
+										url:'/pages/tabBar/home/home'
+									})
+								},1000)
+							}
+						}
+					)
+				})	
+			},
+		},
+		onShow() {
+			this.pageNum = 1;
+			this.addressList = [];
+			this.initAddressList();
+			var pages = getCurrentPages();
+			var prevPage = pages[pages.length - 2];  //上一个页面	
+				// prevPage.setData({select:''})
+		}
+	}
+</script>
+
+<style lang='scss'>
+	page {
+		height: auto;
+	}
+	page,.container{
+		/* padding-bottom: 120upx; */
+		background: #F7F7F7;
+		border-top: 1px solid #EBEBEB;
+	}
+	.container{
+		position: relative;
+	}
+	.list{
+		display: flex;
+		align-items: center;
+		width: 702rpx;
+		height: auto;
+		padding: 24rpx;
+		background: #FFFFFF;
+		position: relative;
+		border-bottom: 1px solid #EBEBEB;
+	}
+	.wrapper{
+		display: flex;
+		flex-direction: column;
+		flex: 1;
+	}
+	.u-box.b-b{
+		
+	}
+	.u-box.b-b{
+		margin-bottom:24rpx;
+	}
+	.u-box.b-t{
+		margin-bottom:0;
+	}
+	.u-box{
+		display: flex;
+		align-items: center;
+		font-size: $font-size-base;
+		color: $text-color;
+		line-height: 40rpx;
+		margin-bottom: 12rpx;
+		.name{
+			margin-right: 40rpx;
+			font-weight: bold;
+		}
+		.mobile{
+			font-weight: bold;
+		}
+		.tag-left{
+			flex: 6;
+			.tag{
+				width: 120rpx;
+				height: 40rpx;
+				background: $color-system;
+				border-radius: 20rpx;
+				font-size: $font-size-sm;
+				color: #FFFFFF;
+				line-height: 40rpx;
+				text-align: center;
+				padding: 0 6rpx;
+			}
+		}
+		.tag-right{
+			flex: 4;
+			display: flex;
+			text-align: right;
+			.t-b{
+				flex: 1;
+				line-height: 40rpx;
+				.txt{
+					font-size: $font-size-sm;
+					color: $text-color;
+					line-height: 40rpx;
+				}
+			}
+			.icon-shanchu{
+				color:#FF2A2A ;
+				margin-right: 8rpx;
+			}
+			.icon-bianji{
+				color: #2A7AFF;
+				margin-right: 8rpx;
+			}
+		}
+		.address{
+			font-size: $font-size-base;
+			color: $text-color;
+			line-height: 40rpx;
+			-o-text-overflow: ellipsis;
+			text-overflow: ellipsis;
+			display: -webkit-box;
+			word-break: break-all;
+			-webkit-box-orient: vertical;
+			-webkit-line-clamp: 2;
+			overflow: hidden;
+		}
+	}
+	.add-btn{
+		position: fixed;
+		left: 24rpx;
+		right: 24rpx;
+		bottom: 34rpx;
+		z-index: 95;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		width: 702rpx;
+		height: 88rpx;
+		font-size: $font-size-base;
+		line-height: 88rpx;
+		color: #FFFFFF;
+		text-align: center;
+		background: $btn-confirm;
+		border-radius: 14rpx;
+	}
+	.adds-btn{
+		width: 702rpx;
+		height: 88rpx;
+		font-size: 28rpx;
+		line-height: 88rpx;
+		color: #FFFFFF;
+		margin: 0 auto;
+		text-align: center;
+		background: #000000;
+		border-radius: 14rpx;
+	}
+</style>
+

BIN
static/cart-current@3x.png


BIN
static/cart@3x.png


BIN
static/home-current@3x.png


BIN
static/home@3x.png


BIN
static/icon-cart-active@3x.png


BIN
static/icon-cart@3x.png


BIN
static/icon-home-active@3x.png


BIN
static/icon-home@3x.png


BIN
static/icon-sort-active@3x.png


BIN
static/icon-sort@3x.png


BIN
static/icon-user-active@3x.png


BIN
static/icon-user@3x.png


BIN
static/user-current@3x.png


BIN
static/user@3x.png


+ 3 - 3
store/index.js

@@ -34,17 +34,17 @@ const store = new Vuex.Store({
 		updateAllNum(state,num){
 			if(num>=100){
 				uni.setTabBarBadge({
-				  index: 1,
+				  index: 2,
 				  text:'99+'
 				})
 			}else if(num>0){
 				uni.setTabBarBadge({
-				  index: 1,
+				  index: 2,
 				  text:String(num)
 				})
 			}else{
 				uni.removeTabBarBadge({
-					index: 1,
+					index: 2,
 				})
 			}
 		},