Browse Source

feat:首页页面

zhanghui 2 years ago
parent
commit
0cb44f087d

+ 2 - 1
common/js/env.js

@@ -1,8 +1,9 @@
 "use strict";
 
 // let baseUrl = `https://jje.admin.xinyuekj.com.cn`
-let baseUrl = `https://jje.admin.xinyuekj.com.cn/test-api`
+// let baseUrl = `https://jje.admin.xinyuekj.com.cn/test-api`
 // let baseUrl = `http://65i1sxopd9qp.ngrok.xiaomiqiu123.top`
+let baseUrl = `http://47.108.114.127:10888`
 // let baseUrl = `https://jje.xinyuekj.com.cn/prod-api`
 
 

+ 1 - 1
common/js/login.js

@@ -14,7 +14,7 @@ export default {
 	//退出登录
 	logout() {
 		return request({
-			url: '/auth/logout',
+			url: '/auth/expandLogout',
 			method: 'DELETE'
 		})
 	},

+ 9 - 159
common/js/service.js

@@ -2,182 +2,32 @@ import request from '../js/request.js';
 
 
 export default {
-    //当前服务对象
-    currServiceInfo(param) {
+    //获取规则列表,拓客经理调用
+    getRuleList() {
         return request({
-            url: '/business/tech/currServiceInfo',
-            method: 'GET',
-            data:param
-        })
-    },
-    //下一位
-    next(param) {
-        return request({
-            url: '/business/tech/next',
-            method: 'POST',
-            data:param
-        })
-    },
-
-    //开始服务
-    start(param) {
-        return request({
-            url: '/business/tech/start',
-            method: 'POST',
-            data:param
-        })
-    },
-    //开始服务
-    end(param) {
-        return request({
-            url: '/business/tech/end',
-            method: 'POST',
-            data:param
-        })
-    },
-    //就位
-    takePlace(param) {
-        return request({
-            url: '/business/tech/takePlace',
-            method: 'POST',
-            data:param
-        })
-    },
-    //结算
-    settle(param) {
-        return request({
-            url: '/business/tech/settle',
-            method: 'POST',
-            data:param
-        })
-    },
-    //待服务的订单
-    list(param) {
-        return request({
-            url: '/business/tech/wait/list',
-            method: 'GET',
-            data:param
-        })
-    },
-
-    //服务统计
-    statics(param) {
-        return request({
-            url: '/business/tech/statics',
-            method: 'GET',
-            data:param
-        })
-    },
-
-    //服务项目列表
-    serviceProjectList(param) {
-        return request({
-            url: '/business/tech/serviceProject/list',
-            method: 'GET',
-            data:param
-        })
-    },
-    //添加服务项目
-    addServiceProject(param) {
-        return request({
-            url: '/business/tech/addServiceProject',
-            method: 'POST',
-            data:param
-        })
-    },
-
-    // get请求 根据门店、排班日期查询技师
-    getServicePerson(param) {
-        return request({
-            url: '/store/uniapp/work-person-ist/'+param.storeId,
+            url: '/member/wechat/getRuleList',
             method: 'GET'
         })
     },
 
-    // 移交
-    handover(param) {
+    //获取角色列表,拓客经理调用
+    getRoleList() {
         return request({
-            url: '/business/tech/handover',
-            method: 'POST'
-        })
-    },
-    // 报道打卡
-    clockIn(param) {
-        return request({
-            url: '/business/tech/clockIn?storeId='+param.storeId + '&timestamp=' + param.timestamp,
-            method: 'POST'
-        })
-    },
-    // 切换服务对象
-    switchServiceObject(param) {
-        return request({
-            url: '/business/tech/switchServiceObject?orderServiceId='+param.orderServiceId+'&serviceObjectId='+param.serviceObjectId,
-            method: 'POST'
-        })
-    },
-    // 获取服务对象列表
-    getServiceObjectList(param) {
-        return request({
-            url: '/business/tech/getServiceObjectList',
-            method: 'GET',
-            data:param
-        })
-    },
-    // 叫号
-    call(param) {
-        return request({
-            url: '/business/tech/call',
-            method: 'GET',
-            data:param
-        })
-    },
-
-    //查询服务人员
-    serviceUserList(param) {
-        return request({
-            url: '/business/tech/serviceUser/list',
-            method: 'GET',
-            data:param
-        })
-    },
-
-    //获取图片
-    getImgUrlByOssId(param) {
-        return request({
-            url: '/resource/oss/listByIds/' + param.ossId,
+            url: '/member/wechat/getRoleList',
             method: 'GET'
-
         })
     },
 
 
-    //保存用户偏好
-    preference(param) {
+    //角色绑定规则,拓客经理调用
+    roleBindRule(param) {
         return request({
-            url: '/business/tech/save/preference',
+            url: '/member/wechat/roleBindRule',
             method: 'POST',
             data:param
-
-        })
-    },
-
-    // get请求,查询技师业绩
-    performanceList(data) {
-        return request({
-            url: '/business/tech/performanceList',
-            method: 'GET',
-            data: data
         })
     },
 
-    // get请求,获取手机验证码
-    getSmsCode(data) {
-        return request({
-            url: '/resource/sms/code',
-            method: 'GET',
-            data: data
-        })
-    },
 
 
 }

+ 1 - 1
common/js/user.js

@@ -5,7 +5,7 @@ export default {
     //账号密码登录
     getUserInfo() {
         return request({
-            url: '/business/tech/info',
+            url: '/member/wechat/getUser',
             method: 'GET'
         })
     }

+ 8 - 7
pages.json

@@ -5,13 +5,7 @@
 	},
 
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
-		{
-			"path": "pages/login/login",
-			"style": {
-				"navigationStyle": "custom",
-				"enablePullDownRefresh": false
-			}
-		},
+
 		{
 			"path": "pages/index/index",
 			"style": {
@@ -50,6 +44,13 @@
 				"enablePullDownRefresh" : false
 			}
 		},
+		{
+			"path": "pages/login/login",
+			"style": {
+				"navigationStyle": "custom",
+				"enablePullDownRefresh": false
+			}
+		},
 		{
 			"path" : "pages/register/register",
 			"style" :

+ 144 - 0
pages/index/attach/attach.vue

@@ -0,0 +1,144 @@
+<template>
+	<view class="page" :style="{height:height}">
+
+		<view :style="{marginTop:'24rpx'}">
+			<scroll-view scroll-y class="scroll-Y">
+				<view class="flex-col outView select">
+					<view class="flex-row justify-between">
+						<text class="title">规则标题</text>
+						<u-icon name="checkbox-mark" color="#666" size="24"></u-icon>
+					</view>
+					<view class="flex-row justify-between  awardView">
+						<text>注册:</text>
+						<view class="flex-row  award ">
+							<text class="awardItem">现金:12元</text>
+							<text class="awardItem">比例:10%</text>
+						</view>
+					</view>
+				</view>
+
+				<view class="flex-col outView">
+					<view class="flex-row justify-between">
+						<text class="title">规则标题</text>
+						<u-icon name="checkbox-mark" color="#666" size="24"></u-icon>
+					</view>
+					<view class="flex-row justify-between  awardView">
+						<text>注册:</text>
+						<view class="flex-row  award ">
+							<text class="awardItem">现金:12元</text>
+						</view>
+					</view>
+				</view>
+
+				<view class="flex-col outView">
+					<view class="flex-row justify-between">
+						<text class="title">规则标题</text>
+						<u-icon name="checkbox-mark" color="#666" size="24"></u-icon>
+					</view>
+					<view class="flex-row justify-between  awardView">
+						<text>优惠券:</text>
+						<view class="flex-col  award ">
+							<text>数量:100张</text>
+							<text>有效期:2024-01-01 至 2024-01-30</text>
+						</view>
+					</view>
+				</view>
+				<view class="flex-col outView select">
+					<view class="flex-row justify-between">
+						<text class="title">规则标题</text>
+						<u-icon name="checkbox-mark" color="#666" size="24"></u-icon>
+					</view>
+					<view class="flex-row justify-between  awardView">
+						<text>优惠券:</text>
+						<view class="flex-col  award ">
+							<text>数量:100张</text>
+							<text>有效期:2024-01-01 至 2024-01-30</text>
+						</view>
+					</view>
+				</view>
+				<view class="flex-col outView">
+					<view class="flex-row justify-between">
+						<text class="title">规则标题</text>
+						<u-icon name="checkbox-mark" color="#666" size="24"></u-icon>
+					</view>
+					<view class="flex-row justify-between  awardView">
+						<text>优惠券:</text>
+						<view class="flex-col  award ">
+							<text>数量:100张</text>
+							<text>有效期:2024-01-01 至 2024-01-30</text>
+						</view>
+					</view>
+				</view>
+				<view class="flex-col outView select">
+					<view class="flex-row justify-between">
+						<text class="title">规则标题</text>
+						<u-icon name="checkbox-mark" color="#666" size="24"></u-icon>
+					</view>
+					<view class="flex-row justify-between  awardView">
+						<text>优惠券:</text>
+						<view class="flex-col  award ">
+							<text>数量:100张</text>
+							<text>有效期:2024-01-01 至 2024-01-30</text>
+						</view>
+					</view>
+				</view>
+			</scroll-view>
+		</view>
+		<view class="confirmButton" @click="createQrCode">
+			<text>生成二维码</text>
+		</view>
+
+		<uni-popup ref="createQrCodePopup" type="center">
+			<view class="createQrCodePopup">
+				<view class="flex-row justify-center">
+					<text class="popupTitle">拓客二维码</text>
+				</view>
+				<view class="xoIcon" @click="closePopup">
+					<u-icon name="close-circle" color="#666" size="24"></u-icon>
+				</view>
+				<view class="flex-row justify-center">
+					<uv-qrcode ref="qrcode" size="540rpx" :value="qrcodeUrl" :options="options"></uv-qrcode>
+				</view>
+			</view>
+		</uni-popup>
+	</view>
+</template>
+
+<script>
+	export default {
+		props:{
+			height: {
+				type: String,
+				default () {
+					return ''
+				}
+			},
+		},
+		data() {
+			return {
+				qrcodeUrl:'https://jje.admin.xinyuekj.com.cn/recharge/recharge?storeId={promotionStoreId}&techNo={techNo}',
+				options: {
+					// 指定二维码前景,一般可在中间放logo
+					foregroundImagePadding:2,
+					foregroundImageBorderRadius:5,
+					foregroundImageSrc: '/static/logo.png'
+				},
+			}
+		},
+		onLoad() {
+
+		},
+		methods: {
+			createQrCode(){
+				this.$refs.createQrCodePopup.open()
+			},
+			closePopup(){
+				this.$refs.createQrCodePopup.close()
+			},
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	@import './index.rpx.css';
+</style>

+ 70 - 0
pages/index/attach/index.rpx.css

@@ -0,0 +1,70 @@
+.page{
+    background: #F7F7F7;
+    padding: 1rpx 32rpx;
+}
+.scroll-Y{
+    height: 900rpx;
+}
+.outView{
+    background: #FFFFFF;
+    border-radius: 20rpx;
+    padding: 28rpx 24rpx;
+    margin-bottom: 24rpx;
+}
+.title{
+    font-size: 32rpx;
+    font-weight: 500;
+    color: #333333;
+    line-height: 44rpx;
+    font-weight: bold;
+}
+.awardView{
+    font-size: 28rpx;
+    font-weight: 400;
+    color: #666666;
+    line-height: 40rpx;
+    padding: 20rpx 0;
+}
+.award{
+    width: 500rpx;
+}
+
+.awardItem{
+    margin-right: 100rpx;
+}
+
+.confirmButton{
+    width: 686rpx;
+    height: 108rpx;
+    background: #FFE05C;
+    border-radius: 60rpx;
+    text-align: center;
+    font-size: 32rpx;
+    font-weight: 500;
+    color: #111111;
+    line-height: 108rpx;
+    margin-top: 24rpx;
+}
+.createQrCodePopup{
+    width: 638rpx;
+    height: 714rpx;
+    background: #FFFFFF;
+    border-radius: 24rpx;
+    position: relative;
+}
+.popupTitle{
+    line-height: 100rpx;
+    font-size: 32rpx;
+    font-weight: bold;
+    color: #111111;
+}
+.xoIcon{
+    position: absolute;
+    top: 20rpx;
+    right: 32rpx;
+}
+.select{
+    background: rgba(255, 224, 92, 0.1);
+    border: 4rpx solid #FFE05C;
+    box-sizing:border-box
+}

+ 37 - 2
pages/index/index.vue

@@ -1,21 +1,56 @@
 <template>
 	<view class="page">
 		<uni-nav-bar  :fixed="true" background-color="#FFE05C" :border="false" :statusBar="true"   title="首页"  />
+		<manager :height="height" v-if="isManager"></manager>
+		<attach :height="height" v-else></attach>
 	</view>
 </template>
 
 <script>
+	import manager from "./manager/manager";
+	import attach from "./attach/attach"
 	export default {
+		components:{
+			manager,attach
+		},
 		data() {
 			return {
-				title: 'Hello'
+				isManager:false,
+				height:'',
+				ruleList:[],
+				roleList:[],
+				roleBindRuleParam:{}
 			}
 		},
 		onLoad() {
-
+			let sysInfo = uni.getSystemInfoSync()
+			this.height = sysInfo.windowHeight - 70 + 'px'
+			// this.getRuleList()
+			// this.getRoleList()
 		},
 		methods: {
 
+			//查询规则
+			getRuleList(){
+				this.$api.service.getRuleList().then(res=>{
+					console.log(res)
+					this.ruleList = res.data.data
+				})
+			},
+			//查询角色
+			getRoleList(){
+				this.$api.service.getRoleList().then(res=>{
+					console.log(res)
+					this.roleList = res.data.data
+				})
+			},
+			//角色绑定规则
+			roleBindRule(){
+				this.$api.service.roleBindRule(this.roleBindRuleParam).then(res=>{
+					this.getRuleList()
+					this.getRoleList()
+				})
+			},
 		}
 	}
 </script>

+ 126 - 0
pages/index/manager/index.rpx.css

@@ -0,0 +1,126 @@
+.page{
+    background: #F7F7F7;
+    padding: 1rpx 32rpx;
+}
+.outView{
+    background: #FFFFFF;
+    border-radius: 20rpx;
+    padding: 28rpx 24rpx;
+    margin-bottom: 24rpx;
+}
+.roleName{
+    margin-right: 20rpx;
+    font-size: 28rpx;
+    font-weight: 400;
+    color: #333333;
+    line-height: 44rpx;
+}
+.title{
+    font-size: 32rpx;
+    font-weight: 500;
+    color: #333333;
+    line-height: 44rpx;
+    font-weight: bold;
+}
+.awardView{
+    font-size: 28rpx;
+    font-weight: 400;
+    color: #666666;
+    line-height: 40rpx;
+    padding: 20rpx 0;
+}
+.award{
+    width: 500rpx;
+}
+.awardItem{
+    margin-right: 100rpx;
+}
+.addButton{
+    width: 686rpx;
+    height: 84rpx;
+    background: #FFFFFF;
+    border-radius: 54rpx;
+    border: 4rpx dashed #FFE05C;
+    text-align: center;
+    line-height: 84rpx;
+    font-size: 28rpx;
+    font-weight: 400;
+    color: #333333;
+    margin-top: 24rpx;
+}
+.scroll-Y{
+    height: 600rpx;
+}
+.rulePopup{
+    height: 900rpx;
+    border-top-right-radius: 10rpx;
+    border-top-left-radius: 10rpx;
+    background: white;
+    padding: 0 32rpx;
+}
+.popupTitle{
+    line-height: 100rpx;
+    font-size: 32rpx;
+    font-weight: bold;
+    color: #111111;
+}
+.scroll-Y1{
+    height: 600rpx;
+}
+.label{
+    padding: 24rpx 32rpx;
+    background: #F7F7F7;
+    margin-top: 24rpx;
+    border-radius: 15rpx;
+}
+.confirmButton{
+    width: 686rpx;
+    height: 108rpx;
+    background: #FFE05C;
+    border-radius: 60rpx;
+    text-align: center;
+    font-size: 32rpx;
+    font-weight: 500;
+    color: #111111;
+    line-height: 108rpx;
+    margin-top: 24rpx;
+}
+.createQrCodePopup{
+    width: 638rpx;
+    height: 714rpx;
+    background: #FFFFFF;
+    border-radius: 24rpx;
+    position: relative;
+}
+.xoIcon{
+    position: absolute;
+    top: 20rpx;
+    right: 32rpx;
+}
+.rolePopup{
+    height: 700rpx;
+    border-top-right-radius: 10rpx;
+    border-top-left-radius: 10rpx;
+    padding: 0 32rpx;
+    background: white;
+}
+.scroll-Y2{
+    height: 450rpx;
+}
+.roleName1{
+    padding: 20rpx;
+    font-size: 30rpx;
+    font-weight: bold;
+    border-radius: 10rpx;
+    background: #f7f7f7;
+    margin-top: 24rpx;
+}
+.roleName1:first-child{
+    margin-top: 0;
+}
+
+.selectRoleName1{
+    background: rgba(255, 224, 92, 0.1);
+    border: 4rpx solid #FFE05C;
+    box-sizing:border-box
+}

+ 243 - 0
pages/index/manager/manager.vue

@@ -0,0 +1,243 @@
+<template>
+	<view class="page" :style="{height:height}">
+		<view class="flex-row justify-between outView" :style="{marginTop:'24rpx'}">
+			<view class="roleName">
+				<text>角色</text>
+			</view>
+			<view class="flex-row" @click="selectRole">
+				<text class="roleName">简德兴</text>
+				<u-icon name="arrow-right" color="#666" size="18"></u-icon>
+			</view>
+		</view>
+
+		<view>
+			<scroll-view scroll-y class="scroll-Y">
+				<view class="flex-col outView">
+					<view class="flex-row justify-between">
+						<text class="title">规则标题</text>
+						<u-icon name="trash" color="#666" size="24"></u-icon>
+					</view>
+					<view class="flex-row justify-between  awardView">
+						<text>注册:</text>
+						<view class="flex-row  award ">
+							<text class="awardItem">现金:12元</text>
+							<text class="awardItem">比例:10%</text>
+						</view>
+					</view>
+				</view>
+
+				<view class="flex-col outView">
+					<view class="flex-row justify-between">
+						<text class="title">规则标题</text>
+						<u-icon name="trash" color="#666" size="24"></u-icon>
+					</view>
+					<view class="flex-row justify-between  awardView">
+						<text>注册:</text>
+						<view class="flex-row  award ">
+							<text class="awardItem">现金:12元</text>
+						</view>
+					</view>
+				</view>
+
+				<view class="flex-col outView">
+					<view class="flex-row justify-between">
+						<text class="title">规则标题</text>
+						<u-icon name="trash" color="#666" size="24"></u-icon>
+					</view>
+					<view class="flex-row justify-between  awardView">
+						<text>优惠券:</text>
+						<view class="flex-col  award ">
+							<text>数量:100张</text>
+							<text>有效期:2024-01-01 至 2024-01-30</text>
+						</view>
+					</view>
+				</view>
+				<view class="flex-col outView">
+					<view class="flex-row justify-between">
+						<text class="title">规则标题</text>
+						<u-icon name="trash" color="#666" size="24"></u-icon>
+					</view>
+					<view class="flex-row justify-between  awardView">
+						<text>优惠券:</text>
+						<view class="flex-col  award ">
+							<text>数量:100张</text>
+							<text>有效期:2024-01-01 至 2024-01-30</text>
+						</view>
+					</view>
+				</view>
+				<view class="flex-col outView">
+					<view class="flex-row justify-between">
+						<text class="title">规则标题</text>
+						<u-icon name="trash" color="#666" size="24"></u-icon>
+					</view>
+					<view class="flex-row justify-between  awardView">
+						<text>优惠券:</text>
+						<view class="flex-col  award ">
+							<text>数量:100张</text>
+							<text>有效期:2024-01-01 至 2024-01-30</text>
+						</view>
+					</view>
+				</view>
+				<view class="flex-col outView">
+					<view class="flex-row justify-between">
+						<text class="title">规则标题</text>
+						<u-icon name="trash" color="#666" size="24"></u-icon>
+					</view>
+					<view class="flex-row justify-between  awardView">
+						<text>优惠券:</text>
+						<view class="flex-col  award ">
+							<text>数量:100张</text>
+							<text>有效期:2024-01-01 至 2024-01-30</text>
+						</view>
+					</view>
+				</view>
+			</scroll-view>
+		</view>
+
+
+
+		<view class="addButton" @click="addRule">
+			<text>+添加规则</text>
+		</view>
+
+		<view class="confirmButton" @click="createQrCode">
+			<text>生成二维码</text>
+		</view>
+
+
+		<uni-popup ref="createQrCodePopup" type="center">
+			<view class="createQrCodePopup">
+				<view class="flex-row justify-center">
+					<text class="popupTitle">邀请专员二维码</text>
+				</view>
+				<view class="xoIcon" @click="closePopup">
+					<u-icon name="close-circle" color="#666" size="24"></u-icon>
+				</view>
+				<view class="flex-row justify-center">
+					<uv-qrcode ref="qrcode" size="540rpx" :value="qrcodeUrl" :options="options"></uv-qrcode>
+				</view>
+			</view>
+		</uni-popup>
+
+		<uni-popup ref="rulePopup" type="bottom">
+			<view class="rulePopup">
+				<view class="flex-row justify-between">
+					<text class="popupTitle">选择规则</text>
+					<u-icon name="close-circle" color="#666" size="24" @click="closePopup"></u-icon>
+				</view>
+				<scroll-view scroll-y class="scroll-Y1">
+						<checkbox-group @change="checkboxChange">
+								<view class="flex-row justify-between label" v-for="item in 10" :key="item.value">
+									<view>规则名称规则名称</view>
+									<view>
+										<checkbox :value="item.value" :checked="item.checked" />
+									</view>
+								</view>
+						</checkbox-group>
+				</scroll-view>
+				<view class="confirmButton" @click="addRule">
+					<text>确定</text>
+				</view>
+			</view>
+		</uni-popup>
+
+		<uni-popup ref="rolePopup" type="bottom">
+			<view class="rolePopup">
+				<view class="flex-row justify-between">
+					<text class="popupTitle">选择角色</text>
+					<u-icon name="close-circle" color="#666" size="24" @click="closePopup"></u-icon>
+				</view>
+				<scroll-view scroll-y class="scroll-Y2">
+					<view class="roleName1" :class="{selectRoleName1:i===5}" v-for="i in 10">
+						<text>拓客专员</text>
+					</view>
+				</scroll-view>
+				<view class="confirmButton">
+					<text>确定</text>
+				</view>
+			</view>
+		</uni-popup>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		props:{
+			height: {
+				type: String,
+				default () {
+					return ''
+				}
+			},
+		},
+		data() {
+			return {
+				ruleList:[],
+				roleList:[],
+				roleBindRuleParam:{},
+				value: 1,
+				qrcodeUrl:'https://jje.admin.xinyuekj.com.cn/recharge/recharge?storeId={promotionStoreId}&techNo={techNo}',
+				options: {
+					// 指定二维码前景,一般可在中间放logo
+					foregroundImagePadding:2,
+					foregroundImageBorderRadius:5,
+					foregroundImageSrc: '/static/logo.png'
+				},
+				range: [
+					{ value: 0, text: "篮球篮球篮球篮球篮球篮" },
+					{ value: 1, text: "足球" },
+					{ value: 2, text: "游泳" },
+				],
+			}
+		},
+		onLoad() {
+			// this.getRuleList()
+			// this.getRoleList()
+		},
+		methods: {
+			closePopup(){
+				this.$refs.rolePopup.close()
+				this.$refs.createQrCodePopup.close()
+				this.$refs.rulePopup.close()
+			},
+			selectRole(){
+				this.$refs.rolePopup.open()
+			},
+			createQrCode(){
+				this.$refs.createQrCodePopup.open()
+			},
+			addRule(){
+				this.$refs.rulePopup.open()
+			},
+			change(e) {
+				console.log("e:", e);
+			},
+			//查询规则
+			getRuleList(){
+				this.$api.service.getRuleList().then(res=>{
+					console.log(res)
+					this.ruleList = res.data.data
+				})
+			},
+			//查询角色
+			getRoleList(){
+				this.$api.service.getRoleList().then(res=>{
+					console.log(res)
+					this.roleList = res.data.data
+				})
+			},
+			//角色绑定规则
+			roleBindRule(){
+				this.$api.service.roleBindRule(this.roleBindRuleParam).then(res=>{
+					this.getRuleList()
+					this.getRoleList()
+				})
+			},
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	@import './index.rpx.css';
+</style>

+ 5 - 0
pages/login/login.vue

@@ -122,6 +122,11 @@
 
 					this.$api.login.expandLogin(this.form).then(res => {
 						uni.setStorageSync('accessToken', res.data.data.access_token)
+						this.$api.user.getUserInfo().then(res=>{
+							this.userInfo = res.data.data
+							uni.setStorageSync('spreadUserInfo', this.userInfo)
+							console.log(res)
+						})
 						uni.switchTab({
 							url: "/pages/index/index"
 						})

+ 1 - 1
pages/my/index.rpx.css

@@ -26,7 +26,7 @@
 }
 .tag{
 	font-size: 20rpx;
-	background: #4cd964;
+	background: #FFE50C;
 	margin-left: 24rpx;
 	padding: 2rpx 10rpx;
 	border-radius: 10rpx;

+ 30 - 13
pages/my/my.vue

@@ -4,15 +4,15 @@
 
 		<view class="flex-row use">
 			<view class="avatar" @click="goUserInfo">
-				<image :src="'/static/ud4.png'"></image>
+				<image :src="userInfo.img || '/static/ud4.png'"></image>
 			</view>
 			<view class="flex-col justify-around useMsg">
 				<view class="flex-row">
-					<text class="name">张辉</text>
-					<view class="tag">拓客经理</view>
+					<text class="name">{{userInfo.name}}</text>
+					<view class="tag">{{userInfo.isManager === 1? '拓客经理':'拓客专员'}}</view>
 				</view>
 				<view>
-					<text class="phone">电话:17365000111</text>
+					<text class="phone">电话:{{userInfo.phone}}</text>
 				</view>
 			</view>
 		</view>
@@ -21,8 +21,8 @@
 			<view class="statisticsTitle">
 				<text >拓客统计</text>
 			</view>
-			<view class="flex-row justify-center ">
-				<view class="statisticsItem flex-col " @click="goSpecialists">
+			<view class="flex-row justify-start ">
+				<view class="statisticsItem flex-col " v-if="userInfo.isManager === 1" @click="goSpecialists">
 					<view class="flex-row justify-center">
 						<u-icon name="/static/my/fuwuNmber.png" size="28"></u-icon>
 					</view>
@@ -33,7 +33,18 @@
 						<text>0</text>
 					</view>
 				</view>
-				<view class="statisticsItem statisticsItemBorder flex-col " >
+				<view class="statisticsItem flex-col " v-if="userInfo.isManager !== 1" @click="">
+					<view class="flex-row justify-center">
+						<u-icon name="/static/my/fuwuNmber.png" size="28"></u-icon>
+					</view>
+					<view class="flex-row justify-center statisticsKey">
+						<text>推广收益(元)</text>
+					</view>
+					<view class="flex-row justify-center statisticsValue">
+						<text>85.22</text>
+					</view>
+				</view>
+				<view class="statisticsItem statisticsItemBorder flex-col " v-if="userInfo.isManager !== 1">
 					<view class="flex-row justify-center">
 						<u-icon name="/static/my/jinriyeji.png" size="28"></u-icon>
 					</view>
@@ -44,7 +55,7 @@
 						<text>0</text>
 					</view>
 				</view>
-				<view class="statisticsItem statisticsItemBorder flex-col ">
+				<view class="statisticsItem statisticsItemBorder flex-col " v-if="userInfo.isManager !== 1">
 					<view class="flex-row justify-center">
 						<u-icon name="/static/my/benyueyeji.png" size="28"></u-icon>
 					</view>
@@ -58,9 +69,9 @@
 			</view>
 		</view>
 
-		<view class="tuoke ">
+		<view class="tuoke " v-if="userInfo.isManager !== 1">
 			<view class="statisticsTitle ">
-				<text >任务统计</text>
+				<text >今日统计</text>
 			</view>
 			<view class="flex-row justify-center ">
 				<view class="statisticsItem flex-col" :style="{'width':'50%'}">
@@ -68,7 +79,7 @@
 						<u-icon name="/static/my/jinrirenwu.png" size="28"></u-icon>
 					</view>
 					<view class="flex-row justify-center statisticsKey">
-						<text>今日任务</text>
+						<text>今日推广</text>
 					</view>
 					<view class="flex-row justify-center statisticsValue">
 						<text>{{staticsData.todayTask || 0}}</text>
@@ -80,7 +91,7 @@
 						<u-icon name="/static/my/benyuerenwu.png" size="28"></u-icon>
 					</view>
 					<view class="flex-row justify-center statisticsKey">
-						<text>完成任务</text>
+						<text>今日收益</text>
 					</view>
 					<view class="flex-row justify-center statisticsValue">
 						<text>{{staticsData.finishTask || 0}}</text>
@@ -97,9 +108,15 @@
 	export default {
 		data() {
 			return {
-				staticsData:{}
+				staticsData:{},
+				userInfo:{}
 			}
 		},
+
+		onShow(){
+			this.userInfo = uni.getStorageSync('spreadUserInfo')
+		},
+
 		methods: {
 			goSpecialists(){
 				uni.navigateTo({

+ 16 - 0
pages/register/index.rpx.css

@@ -28,3 +28,19 @@
 	font-size: 30rpx;
 	color: #AAAAAA;
 }
+.photoView{
+	width: 100rpx;
+	height: 100rpx;
+	border-radius: 50rpx;
+	padding: 0;
+	margin: 30rpx 0;
+	overflow: hidden;
+	margin-left: 100rpx;
+}
+.photoImage{
+	width: 100rpx;
+	height: 100rpx;
+}
+.bordBot{
+	border-bottom: 1px solid #F7F7F7;
+}

+ 50 - 16
pages/register/register.vue

@@ -3,24 +3,32 @@
 		<uni-nav-bar  :fixed="true" background-color="#FFE05C" :border="false" :statusBar="true"  title="注册"  />
 		<view :style="{'marginTop':'10rpx'}">
 			<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm">
+
+				<view class="flex-row  bordBot" >
+					<view class="key flex-col justify-center ">
+						<text>头像</text>
+					</view>
+					<view class="photoView" @click="updateAvatar">
+						<image class="photoImage" :src="userInfo.img || '/static/ud4.png'"></image>
+					</view>
+				</view>
 				<u-form-item :labelWidth="80" label="姓名:" borderBottom prop="name" ref="item1">
 					<u--input v-model="form.username"  placeholder="请输入姓名" border="none"></u--input>
 				</u-form-item>
-
-				<u-form-item :labelWidth="80" label="性别:" borderBottom prop="sex" ref="item1" @click="showSex = true">
-					<u--input v-model="form.sex" disabled disabledColor="#ffffff" placeholder="请选择性别" border="none"></u--input>
-					<u-icon slot="right" name="arrow-right"></u-icon>
+				<u-form-item :labelWidth="80" label="身份证号:" borderBottom prop="name" ref="item1">
+					<u--input v-model="form.username"  placeholder="请输入姓名" border="none"></u--input>
+				</u-form-item>
+				<u-form-item :labelWidth="80" label="密码:" borderBottom prop="newPassword" ref="item1">
+					<u--input v-model="form.newPassword" placeholder="请输入密码" type="password" border="none"></u--input>
 				</u-form-item>
 
-				<u-form-item :labelWidth="80" label="生日:" borderBottom prop="sex" ref="item1" @click="showBirthday = true">
-					<u--input v-model="form.sex" disabled disabledColor="#ffffff" placeholder="请选择生日" border="none"></u--input>
-					<u-icon slot="right" name="arrow-right"></u-icon>
+				<u-form-item :labelWidth="80" label="确认密码:" borderBottom prop="againPassword" ref="item1">
+					<u--input v-model="form.againPassword" placeholder="再次确认密码" type="password" border="none"></u--input>
 				</u-form-item>
 
 				<u-form-item :labelWidth="80" label="手机号:" borderBottom prop="username" ref="item1">
 					<u--input v-model="form.username"  placeholder="请输入手机号" border="none"></u--input>
 				</u-form-item>
-
 				<u-form-item :labelWidth="80" label="验证码:" borderBottom prop="code" ref="item1">
 					<view class="inputCode">
 						<u--input v-model="form.code"  placeholder="请输入验证码" border="none"></u--input>
@@ -28,14 +36,6 @@
 					<u-button slot="right" @tap="getCode" :text="tips" type="success" size="small" :disabled="disabled1"></u-button>
 				</u-form-item>
 
-				<u-form-item :labelWidth="80" label="密码:" borderBottom prop="newPassword" ref="item1">
-					<u--input v-model="form.newPassword" placeholder="请输入密码" type="password" border="none"></u--input>
-				</u-form-item>
-
-				<u-form-item :labelWidth="80" label="确认密码:" borderBottom prop="againPassword" ref="item1">
-					<u--input v-model="form.againPassword" placeholder="再次确认密码" type="password" border="none"></u--input>
-				</u-form-item>
-
 			</u--form>
 
 			<view :style="{'marginTop':'100rpx'}">
@@ -137,6 +137,40 @@
 				})
 			},
 
+			updateAvatar(){
+				let that = this
+				uni.chooseImage({
+					count: 1, //默认9
+					sizeType: ['original'], //可以指定是原图还是压缩图,默认二者都有
+					sourceType: ['album'], //从相册选择
+					success: function (res) {
+						let tempUrl = res.tempFiles[0].path
+						uni.uploadFile({
+							url: that.$baseUrl + '/resource/oss/upload', //仅为示例,非真实的接口地址
+							filePath:tempUrl,
+							name: 'file',
+							header: {
+								// "Content-Type": "multipart/form-data",
+								// 'X-Access-Token': uni.getStorageSync('token'),
+								'Authorization': 'Bearer ' + uni.getStorageSync('accessToken'),
+							},
+							success: (uploadFileRes) => {
+								let res = JSON.parse(uploadFileRes.data)
+								console.log('+++++++++++++++++chooseavatar+++++++++++++++++++++++',uploadFileRes.data)
+								that.userInfo.img = res.data.url.replace(/^http:/, "https:")
+
+								//todo  更新头像的接口
+
+								uni.setStorageSync('spreadUserInfo', that.userInfo)
+
+							}
+						});
+
+					}
+				})
+
+			},
+
 			birthdayClose() {
 				this.showBirthday = false
 				// this.$refs.form1.validateField('userInfo.birthday')

+ 0 - 3
pages/userInfo/index.rpx.css

@@ -57,9 +57,6 @@
 .updateButton:after{
     border: none;
 }
-.picker{
-    width: 300rpx;
-}
 .logoutButton{
     margin-top: 100rpx;
 }

+ 94 - 31
pages/userInfo/userInfo.vue

@@ -3,15 +3,13 @@
 		<uni-nav-bar  :fixed="true" background-color="#FFE05C" :border="false" :statusBar="true"  left-icon="left" title="个人信息" @clickLeft="back" />
 
 		<view class="outView">
-
-			<form>
-
+			<form @submit="inputValue">
 				<view class="flex-row justify-between bordBot" >
 					<view class="key flex-col justify-center ">
 						<text>头像</text>
 					</view>
-					<view class="photoView">
-						<image class="photoImage" :src="userInfo.avatarUrl || '/static/ud4.png'"></image>
+					<view class="photoView" @click="updateAvatar">
+						<image class="photoImage" :src="userInfo.img || '/static/ud4.png'"></image>
 					</view>
 				</view>
 
@@ -20,46 +18,57 @@
 						<text>姓名</text>
 					</view>
 					<view class="nikeName flex-col justify-center">
-						<input disabled type="nickname" name="nickname" v-model="userInfo.name"   placeholder="请输入昵称"/>
+						<input  disabled name="name" v-model="userInfo.name"   placeholder="请输入昵称"/>
 					</view>
 				</view>
 
-				<view class="flex-row justify-between bordBot" >
-					<view class="key flex-col justify-center ">
-						<text>性别</text>
-					</view>
-						<view class="flex-row justify-end groupItemContent">
-							<text v-if="userInfo.sex == 0">男</text>
-							<text v-else-if="userInfo.sex == 1">女</text>
-							<text v-else>未知</text>
-<!--							<u-icon name="arrow-right" color="#666" size="18"></u-icon>-->
-						</view>
-				</view>
+<!--				<view class="flex-row justify-between bordBot" >-->
+<!--					<view class="key flex-col justify-center ">-->
+<!--						<text>性别</text>-->
+<!--					</view>-->
+<!--					<view class="nikeName flex-row justify-center" @click="showSex = true">-->
+<!--						<input  name="sex" disabled v-model="userInfo.sex"   placeholder="请选择性别"/>-->
+<!--						<u-icon name="arrow-right" color="#666" size="18"></u-icon>-->
+<!--					</view>-->
+<!--				</view>-->
 
 				<view class="flex-row justify-between bordBot" >
 					<view class="key flex-col justify-center ">
 						<text>手机号</text>
 					</view>
-					<view class="flex-row justify-end groupItemContent" @click="settingTelphone">
-						<text>{{userInfo.phonenumber? userInfo.phonenumber : '' }}</text>
-<!--						<u-icon name="arrow-right" color="#666" size="18"></u-icon>-->
+					<view class="nikeName flex-row justify-center">
+						<input   name="phone" disabled v-model="userInfo.phone"/>
 					</view>
 				</view>
 				<view class="flex-row justify-between bordBot" >
 					<view class="key flex-col justify-center ">
-						<text>修改密码</text>
+						<text>找回密码</text>
 					</view>
-					<view class="flex-row justify-end groupItemContent " @click="updatePassword">
+					<view class="flex-row justify-end nikeName " @click="updatePassword">
 						<text>点击修改</text>
 						<u-icon name="arrow-right" color="#666" size="18"></u-icon>
 					</view>
 				</view>
+
+<!--				<button class="updateButton"  formType="submit">-->
+<!--					<text>保存</text>-->
+<!--				</button>-->
+
 			</form>
 		</view>
 
 		<view  class="logoutButton">
 			<u-button type="error" text="退出登录" @click="logout"></u-button>
 		</view>
+
+		<u-action-sheet
+				:show="showSex"
+				:actions="actions"
+				title="请选择性别"
+				@close="showSex = false"
+				@select="sexSelect">
+		</u-action-sheet>
+
 	</view>
 </template>
 
@@ -67,27 +76,80 @@
 	export default {
 		data() {
 			return {
+				showSex:false,
 				photoUrl:'',
 				userInfo: {},
 				genderIndex:0,
-				genderList: [{gender:'男',id:'0'},
-					{gender:'女',id:'1'},
-					{gender:'未知',id:'2'}],
+				actions: [{
+					name: '男',
+					value:'1'
+				},
+					{
+						name: '女',
+						value:'0'
+					},{
+						name: '保密',
+						value:'2'
+					}
+				],
 			};
 		},
 		mounted() {
 		},
 		onShow() {
+			// 用户信息
+			this.userInfo = uni.getStorageSync('spreadUserInfo')
+			console.log(this.userInfo)
+		},
+		methods: {
 
+			inputValue(e){
+				console.log('+++++++++++++inputValue+++++++++++',e)
+				this.userInfo.name = e.detail.value.name
 
-			// 用户信息
-			this.userInfo = uni.getStorageSync('userInfo')
 
-			console.log(this.userInfo)
 
 
-		},
-		methods: {
+			},
+
+			updateAvatar(){
+				let that = this
+				uni.chooseImage({
+					count: 1, //默认9
+					sizeType: ['original'], //可以指定是原图还是压缩图,默认二者都有
+					sourceType: ['album'], //从相册选择
+					success: function (res) {
+						let tempUrl = res.tempFiles[0].path
+						uni.uploadFile({
+							url: that.$baseUrl + '/resource/oss/upload', //仅为示例,非真实的接口地址
+							filePath:tempUrl,
+							name: 'file',
+							header: {
+								// "Content-Type": "multipart/form-data",
+								// 'X-Access-Token': uni.getStorageSync('token'),
+								'Authorization': 'Bearer ' + uni.getStorageSync('accessToken'),
+							},
+							success: (uploadFileRes) => {
+								let res = JSON.parse(uploadFileRes.data)
+								console.log('+++++++++++++++++chooseavatar+++++++++++++++++++++++',uploadFileRes.data)
+								that.userInfo.img = res.data.url.replace(/^http:/, "https:")
+
+								//todo  更新头像的接口
+
+								uni.setStorageSync('spreadUserInfo', that.userInfo)
+
+							}
+						});
+
+					}
+				})
+
+			},
+
+			sexSelect(e) {
+				this.userInfo.sex = e.name
+				console.log(e)
+			},
 			back() {
 				uni.navigateBack({
 					delta: 1
@@ -97,7 +159,7 @@
 			updatePassword(){
 
 				uni.navigateTo({
-					url:'/pages/updatePassword/updatePassword'
+					url:'/pages/forgetPassword/forgetPassword'
 				})
 
 			},
@@ -107,6 +169,7 @@
 				})
 			},
 			logout(){
+
 				this.$api.login.logout().then(res=>{
 					uni.removeStorageSync('accessToken');
 					uni.removeStorageSync('userInfo');