Parcourir la source

[功能增加][老药师]:增加注册审核功能

yxp il y a 2 ans
Parent
commit
cb79ad10e6
9 fichiers modifiés avec 748 ajouts et 213 suppressions
  1. 33 1
      api/login.js
  2. 24 0
      api/user/user.js
  3. 15 1
      pages.json
  4. 424 210
      pages/login.vue
  5. 1 0
      pages/mine/index.vue
  6. 51 0
      pages/regist/index.vue
  7. 180 0
      pages/reviews/reviews.vue
  8. 15 0
      pages/work/index.vue
  9. 5 1
      utils/upload.js

+ 33 - 1
api/login.js

@@ -1,4 +1,5 @@
 import request from '@/utils/request'
+import upload from '@/utils/upload'
 
 // 登录方法
 export function login(username, password, code, uuid) {
@@ -44,4 +45,35 @@ export function getCodeImg() {
     method: 'get',
     timeout: 20000
   })
-}
+}
+
+
+// 用户注册
+export function uploadRegister(data) {
+  return upload({
+    'url': '/registerMobile',
+	headers: {
+	  isToken: false
+	},
+	method: 'post',
+    formData : data.formdata,
+	name: data.name,
+	filePath: data.file
+  })
+}
+
+//获取手机号
+export function getPhone(data) {
+    return request({
+        url: '/registerMobile/getPhone',
+        method: 'get',
+		data: data
+    })
+}
+//校验注册信息
+export function checkReg(phone) {
+    return request({
+        url: '/registerMobile/check/'+phone,
+        method: 'get',
+    })
+}

+ 24 - 0
api/user/user.js

@@ -72,3 +72,27 @@ export function getUserById(id){
         method: 'get'
     })
 }
+// 查询审核列表
+export function listReviews(query) {
+    console.log('query'+JSON.stringify(query))
+  return request({
+    url: '/system/registerMobile/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 审核结果
+export function reviewsAdopt(data) {
+  return request({
+    url: '/system/registerMobile/reviewsAdopt',
+    method: 'post',
+    data: data
+  })
+}
+ export function reviews(id) {
+    return request({
+      url: '/system/registerMobile/reviews/' + id,
+      method: 'get'
+    })
+  }

+ 15 - 1
pages.json

@@ -153,7 +153,21 @@
       "style": {
         "navigationBarTitleText": "排行榜"
       }
-    }
+    },
+	{
+		"path": "pages/regist/index",
+		"style": {
+			"navigationBarTitleText": "注册信息"
+		}
+	},
+	{
+		"path" : "pages/reviews/reviews",
+		"style" : 
+		{
+			"navigationBarTitleText" : "注册审核",
+			"enablePullDownRefresh" : false
+		}
+	}
   ],
   "tabBar": {
     "color": "#000000",

+ 424 - 210
pages/login.vue

@@ -1,217 +1,431 @@
 <template>
-  <view class="normal-login-container" style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/login/bg.png');background-size: 100% 100%;">
-    <view class="logo-content align-center justify-center flex">
-<!--      <image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">-->
-<!--      </image>-->
-      <text class="title">老药师云平台移动端登录</text>
-    </view>
-    <view style="position: fixed;top:1vw;left:1vh;font-size: 12px;color: white;">
-      版本号:{{version}}
-    </view>
-    <view class="login-form-content">
-      <view class="input-item flex align-center">
-        <view class="iconfont icon-user icon"></view>
-        <input   v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" />
-      </view>
-      <view class="input-item flex align-center">
-        <view class="iconfont icon-password icon"></view>
-        <input  v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" />
-      </view>
-      <view class="input-item flex align-center" style="width: 60%;margin: 0px;" v-if="captchaEnabled">
-        <view class="iconfont icon-code icon"></view>
-        <input   v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
-        <view class="login-code">
-          <image :src="codeUrl" @click="getCode" class="login-code-img"></image>
-        </view  >
-      </view>
-      <view class="action-btn">
-        <button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button>
-      </view>
-    </view>
-
-    <view class="xieyi text-center">
-<!--      <text class="text-grey1">登录即代表同意</text>-->
-<!--      <text @click="handleUserAgrement" class="text-blue">《用户协议》</text>-->
-<!--      <text @click="handlePrivacy" class="text-blue">《隐私协议》</text>-->
-    </view>
-  </view>
+	<view class="normal-login-container"
+		style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/login/bg.png');background-size: 100% 100%;">
+		<view class="logo-content align-center justify-center flex">
+			<!--      <image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">-->
+			<!--      </image>-->
+			<text class="title">老药师云平台移动端登录</text>
+		</view>
+		<view style="position: fixed;top:1vw;left:1vh;font-size: 12px;color: white;">
+			版本号:{{version}}
+		</view>
+		<view class="login-form-content">
+			<view class="input-item flex align-center">
+				<view class="iconfont icon-user icon"></view>
+				<input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" />
+			</view>
+			<view class="input-item flex align-center">
+				<view class="iconfont icon-password icon"></view>
+				<input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" />
+			</view>
+			<view class="input-item flex align-center" style="width: 60%;margin: 0px;" v-if="captchaEnabled">
+				<view class="iconfont icon-code icon"></view>
+				<input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
+				<view class="login-code">
+					<image :src="codeUrl" @click="getCode" class="login-code-img"></image>
+				</view>
+			</view>
+			<view class="action-btn">
+				<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button>
+			</view>
+			<view class="action-btn">
+				<button class="login-btn cu-btn block lg round" open-type="getPhoneNumber"
+					@getphonenumber="getPhoneNumber">客户注册</button>
+			</view>
+		</view>
+
+		<view class="xieyi text-center">
+			<!--      <text class="text-grey1">登录即代表同意</text>-->
+			<!--      <text @click="handleUserAgrement" class="text-blue">《用户协议》</text>-->
+			<!--      <text @click="handlePrivacy" class="text-blue">《隐私协议》</text>-->
+		</view>
+		<u-modal title="客户注册信息" @cancel="closeDlg" confirmText="提交审核" :showCancelButton="true" @confirm="submitReg"
+			:show="show">
+			<view class="slot-content">
+				<u--form labelPosition="left" :model="model1" ref="s">
+					<u-form-item label="客户名称:" prop="chooseUser.deptName" borderBottom ref="item1" labelWidth="auto">
+						<u--input v-model="chooseUser.deptName" border="none"></u--input>
+					</u-form-item>
+					<u-form-item label="联系人:" prop="chooseUser.leader" borderBottom ref="item1" labelWidth="auto">
+						<u--input v-model="chooseUser.leader" border="none"></u--input>
+					</u-form-item>
+
+					<u-form-item label="手机号:" prop="chooseUser.phone" borderBottom ref="item1" labelWidth="auto">
+						<u--input v-model="chooseUser.phone" border="none"></u--input>
+					</u-form-item>
+
+					<u-form-item label="密码:" prop="chooseUser.password" borderBottom ref="item1" labelWidth="auto">
+						<u--input v-if="show" v-model="chooseUser.password" border="none"></u--input>
+					</u-form-item>
+					<u-form-item label="登录账号:" borderBottom ref="item1" labelWidth="auto">
+						<u--input v-model="chooseUser.phone" border="none" disabled></u--input>
+					</u-form-item>
+					<u-form-item label="订单图片:" borderBottom ref="item1" labelWidth="auto">
+						<u-upload :fileList="fileList" name="1" multiple :maxCount="1" :previewFullImage="true"
+							:width="auto" :height="auto" @delete="deletePic" @afterRead="afterRead"></u-upload>
+					</u-form-item>
+				</u--form>
+			</view>
+		</u-modal>
+		<u-modal title="注册记录" @cancel="closereg" confirmText="重新注册" :showCancelButton="true" @confirm="submitRegTo"
+			:show="registersshow">
+			<view class="slot-content">
+				<u--form labelPosition="left" :model="model1" ref="s">
+					<u-form-item label="客户名称:" prop="registers.deptName" borderBottom ref="item1" labelWidth="auto">
+						<u--input v-model="registers.deptName" border="none" :disabled="true"></u--input>
+					</u-form-item>
+					<u-form-item label="联系人:" prop="registers.leader" borderBottom ref="item1" labelWidth="auto">
+						<u--input v-model="registers.leader" border="none" :disabled="true"></u--input>
+					</u-form-item>
+
+					<u-form-item label="手机号:" prop="registers.phone" borderBottom ref="item1" labelWidth="auto">
+						<u--input v-model="registers.phone" border="none" :disabled="true"></u--input>
+					</u-form-item>
+
+					<u-form-item label="密码:" prop="registers.password" borderBottom ref="item1" labelWidth="auto">
+						<u--input v-if="registersshow" v-model="registers.password" border="none"
+							:disabled="true"></u--input>
+					</u-form-item>
+					<u-form-item label="登录账号:" borderBottom ref="item1" labelWidth="auto">
+						<u--input v-model="registers.phone" border="none" disabled :disabled="true"></u--input>
+					</u-form-item>
+					<u-form-item label="注册状态:" borderBottom ref="item1" labelWidth="auto">
+						<!-- this.registers.status==1&&this.registers.delFlag==0 -->
+						<view v-if="registers.status==0" style="color:#1a62ff;">审核中</view>
+						<view v-if="registers.status==1&&registers.delFlag==0">审核完成,<text
+								style="color: crimson;">未通过原因:</text><text>{{registers.remark}}</text></view>
+					</u-form-item>
+				</u--form>
+			</view>
+		</u-modal>
+	</view>
 </template>
 
 <script>
-  import { getCodeImg } from '@/api/login'
-  import {getToken} from "@/utils/auth";
-
-  export default {
-    data() {
-      return {
-        version:"",
-        codeUrl: "",
-        captchaEnabled: true,
-        globalConfig: getApp().globalData.config,
-        loginForm: {
-          username: "",
-          password: "",
-          code: "",
-          uuid: ''
-        }
-      }
-    },
-    created() {
-      this.getVersion();
-      this.checkLogin();
-    },
-    methods: {
-      checkLogin(){
-        let token = getToken()
-        if(token){
-          this.loginSuccess()
-        }else{
-          this.getCode()
-        }
-      },
-      // 隐私协议
-      handlePrivacy() {
-        let site = this.globalConfig.appInfo.agreements[0]
-        this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
-      },
-      // 用户协议
-      handleUserAgrement() {
-        let site = this.globalConfig.appInfo.agreements[1]
-        this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
-      },
-      // 获取图形验证码
-      getCode() {
-        getCodeImg().then(res => {
-          this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
-          if (this.captchaEnabled) {
-            this.codeUrl = 'data:image/gif;base64,' + res.img
-            this.loginForm.uuid = res.uuid
-          }
-        })
-      },
-      getVersion(){
-        let appBaseInfo = uni.getAppBaseInfo();
-        let appVersionCode = appBaseInfo.appVersionCode;
-        this.version = appVersionCode;
-      },
-      // 登录方法
-      async handleLogin() {
-        if (this.loginForm.username === "") {
-          this.$modal.msgError("请输入您的账号")
-        } else if (this.loginForm.password === "") {
-          this.$modal.msgError("请输入您的密码")
-        } else if (this.loginForm.code === "" && this.captchaEnabled) {
-          this.$modal.msgError("请输入验证码")
-        } else {
-          this.$modal.loading("登录中,请耐心等待...")
-          this.pwdLogin()
-        }
-      },
-      // 密码登录
-      async pwdLogin() {
-        this.$store.dispatch('Login', this.loginForm).then(() => {
-          this.$modal.closeLoading()
-          this.loginSuccess()
-        }).catch(() => {
-          if (this.captchaEnabled) {
-            this.getCode()
-          }
-        })
-      },
-      // 登录成功后,处理函数
-      loginSuccess(result) {
-        // 设置用户信息
-        this.$store.dispatch('GetInfo').then(res => {
-          this.$tab.reLaunch('/pages/work/index')
-        })
-      }
-    }
-  }
+	import {
+		getCodeImg,
+		uploadRegister,
+		getPhone,
+		checkReg
+	} from '@/api/login'
+	import {
+		getToken
+	} from "@/utils/auth";
+	import {
+		checkStr
+	} from "@/utils/validate";
+	export default {
+		data() {
+			return {
+				version: "",
+				codeUrl: "",
+				captchaEnabled: true,
+				globalConfig: getApp().globalData.config,
+				loginForm: {
+					username: "",
+					password: "",
+					code: "",
+					uuid: '',
+				},
+				show: false,
+				chooseUser: {},
+				fileList: [],
+				registers: {},
+				registersshow: false
+			}
+		},
+		created() {
+			this.show = false,
+				this.getVersion();
+			this.checkLogin();
+		},
+		methods: {
+			getPhoneNumber(e) {
+				console.log(e.detail.code) // 动态令牌
+				// console.log(e.detail.code)  // 动态令牌
+				//     console.log(e.detail.errMsg) // 回调信息(成功失败都会返回)
+				//     console.log(e.detail.errno)  // 错误码(失败时返回)
+				this.newUser(e.detail.code);
+			},
+			toRegister() {
+
+			},
+			submitReg() {
+				//注册数据提交
+				
+				uploadRegister({
+					formdata: this.chooseUser,
+					name: 'register',
+					file: this.fileList[0].url
+				}).then(res => {
+					uni.showToast({
+						title: '注册信息已提交',
+						duration: 2000
+					});
+					this.show = false
+				})
+			},
+			deletePic(event) {
+				this.fileList = []
+			},
+			async afterRead(file, lists, name) {
+				//{"file":[{"size":542091,"type":"image","url":"http://tmp/MPgJgECRVMUFe49f23795545b0cd35400a9b70a9f918.jpg",
+				//"thumb":"http://tmp/MPgJgECRVMUFe49f23795545b0cd35400a9b70a9f918.jpg"}],"name":"1","index":0}
+				if (file.file[0].size > 2048 * 1000) {
+					this.$modal.errMsg("图片大于2M")
+				} else {
+					this.fileList = file.file
+				}
+			},
+			newUser(code) {
+				let self = this
+				uni.showLoading({
+					title: '获取手机号...'
+				});
+				wx.login({
+					success(res) {
+						if (res.code) {
+							let data = {
+								loginCode: res.code,
+								phoneCode: code
+							}
+							//获取到手机号
+							getPhone(data).then(res => {
+								//console.log("获取到手机号信息结果<>>" + JSON.stringify(res))
+								if (checkStr(res.data.phone, 'mobile')) {
+									//console.log("................" + res.data.phone)
+									self.chooseUser.phone = res.data.phone
+									self.chooseUser.openId = res.data.openId
+									//通过手机号校验注册信息
+									checkReg(res.data.phone).then(res => {
+										//console.log("校验注册信息结果<>>" + JSON.stringify(res))
+										if (res.data.code == 0) {
+											//已注册待审核
+											self.registers = res.data.res
+											self.registersshow = true
+										} else if (res.data.code == 1) {
+											//已注册且通过审核,但是用户可能已被删除
+											self.show = true;
+										} else if (res.data.code == 2) {
+											//未注册,进入注册页
+											self.show = true;
+										} else if(res.data.code==3){
+											uni.showToast({
+												title: '已存在客户信息',
+												duration: 2000,
+												icon:'none'
+											});
+										}else{
+											//已注册未通过审核
+											self.registers = res.data.res
+											self.registersshow = true
+										}
+										uni.hideLoading();
+									}).catch(res => {
+										uni.showToast({
+											title: '校验信息失败',
+											duration: 2000,
+											icon:'none'
+										});
+									})
+								} else {
+									uni.showToast({
+										title: '手机号获取异常',
+										duration: 2000,
+										icon:'none'
+									});
+								}
+								//self.show = true;
+							}).catch(res => {
+								uni.showToast({
+									title: '获取手机号异常',
+									duration: 2000,
+									icon:'none'
+								});
+							})
+						} else {
+							console.log('获取code失败!' + res.errMsg)
+						}
+					}
+				})
+			},
+			closereg() {
+				this.registersshow = false
+				this.registers = {}
+			},
+			submitRegTo() {
+				//审核中
+				if (this.registers.status == 0) {
+					uni.showToast({
+						title: '已在审核中...',
+						duration: 1500,
+						icon: 'loading'
+					});
+					this.registersshow = false
+					this.show = false
+					this.registers = {}
+				} else if (this.registers.status == 1 && this.registers.delFlag == 0) {
+					//审核完成且失败允许重新注册
+					this.registersshow = false
+					this.show = true
+				}
+			},
+			closeDlg() {
+				this.show = false;
+				this.chooseUser = {};
+			},
+			checkLogin() {
+				let token = getToken()
+				if (token) {
+					this.loginSuccess()
+				} else {
+					this.getCode()
+				}
+			},
+			// 隐私协议
+			handlePrivacy() {
+				let site = this.globalConfig.appInfo.agreements[0]
+				this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
+			},
+			// 用户协议
+			handleUserAgrement() {
+				let site = this.globalConfig.appInfo.agreements[1]
+				this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
+			},
+			// 获取图形验证码
+			getCode() {
+				getCodeImg().then(res => {
+					this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
+					if (this.captchaEnabled) {
+						this.codeUrl = 'data:image/gif;base64,' + res.img
+						this.loginForm.uuid = res.uuid
+					}
+				})
+			},
+			getVersion() {
+				let appBaseInfo = uni.getAppBaseInfo();
+				let appVersionCode = appBaseInfo.appVersionCode;
+				this.version = appVersionCode;
+			},
+			// 登录方法
+			async handleLogin() {
+				if (this.loginForm.username === "") {
+					this.$modal.msgError("请输入您的账号")
+				} else if (this.loginForm.password === "") {
+					this.$modal.msgError("请输入您的密码")
+				} else if (this.loginForm.code === "" && this.captchaEnabled) {
+					this.$modal.msgError("请输入验证码")
+				} else {
+					this.$modal.loading("登录中,请耐心等待...")
+					this.pwdLogin()
+				}
+			},
+			// 密码登录
+			async pwdLogin() {
+				this.$store.dispatch('Login', this.loginForm).then(() => {
+					this.$modal.closeLoading()
+					this.loginSuccess()
+				}).catch(() => {
+					if (this.captchaEnabled) {
+						this.getCode()
+					}
+				})
+			},
+			// 登录成功后,处理函数
+			loginSuccess(result) {
+				// 设置用户信息
+				this.$store.dispatch('GetInfo').then(res => {
+					this.$tab.reLaunch('/pages/work/index')
+				})
+			}
+		}
+	}
 </script>
 
 <style lang="scss">
-  page {
-    background-color: #ffffff;
-  }
-
-  .normal-login-container {
-    width: 100%;
-    position: absolute;
-    top: 0px;
-    bottom: 0;
-    left:0;
-    right: 0;
-    .logo-content {
-      width: 100%;
-      font-size: 21px;
-      text-align: center;
-      padding-top: 15%;
-
-      image {
-        border-radius: 4px;
-      }
-
-      .title {
-        margin-left: 10px;
-        color: #FFFFFF;
-        font-size: 56rpx;
-      }
-    }
-
-    .login-form-content {
-      text-align: center;
-      margin: 20px auto;
-      margin-top: 15%;
-      width: 90%;
-      background: white;
-      border-radius: 30rpx;
-      box-shadow: 0rpx 5rpx 27rpx 0rpx rgba(195,195,195,2.4);
-      padding:10%;
-      .input-item {
-        margin: 20px auto;
-        background-color: #f5f6f7;
-        height: 45px;
-        border-radius: 20px;
-
-        .icon {
-          font-size: 38rpx;
-          margin-left: 10px;
-          color: #999;
-        }
-
-        .input {
-          width: 100%;
-          font-size: 14px;
-          line-height: 20px;
-          text-align: left;
-          padding-left: 15px;
-          //background: rgb(224,236,255);
-        }
-
-      }
-
-      .login-btn {
-        margin-top: 40px;
-        height: 45px;
-      }
-
-      .xieyi {
-        color: #333;
-        margin-top: 20px;
-      }
-
-      .login-code {
-        height: 38px;
-        float: right;
-
-        .login-code-img {
-          height: 38px;
-          position: absolute;
-          margin-left: 10px;
-          width: 200rpx;
-        }
-      }
-    }
-  }
-
-</style>
+	page {
+		background-color: #ffffff;
+	}
+
+	.normal-login-container {
+		width: 100%;
+		position: absolute;
+		top: 0px;
+		bottom: 0;
+		left: 0;
+		right: 0;
+
+		.logo-content {
+			width: 100%;
+			font-size: 21px;
+			text-align: center;
+			padding-top: 15%;
+
+			image {
+				border-radius: 4px;
+			}
+
+			.title {
+				margin-left: 10px;
+				color: #FFFFFF;
+				font-size: 56rpx;
+			}
+		}
+
+		.login-form-content {
+			text-align: center;
+			margin: 20px auto;
+			margin-top: 15%;
+			width: 90%;
+			background: white;
+			border-radius: 30rpx;
+			box-shadow: 0rpx 5rpx 27rpx 0rpx rgba(195, 195, 195, 2.4);
+			padding: 10%;
+
+			.input-item {
+				margin: 20px auto;
+				background-color: #f5f6f7;
+				height: 45px;
+				border-radius: 20px;
+
+				.icon {
+					font-size: 38rpx;
+					margin-left: 10px;
+					color: #999;
+				}
+
+				.input {
+					width: 100%;
+					font-size: 14px;
+					line-height: 20px;
+					text-align: left;
+					padding-left: 15px;
+					//background: rgb(224,236,255);
+				}
+
+			}
+
+			.login-btn {
+				margin-top: 40px;
+				height: 45px;
+			}
+
+			.xieyi {
+				color: #333;
+				margin-top: 20px;
+			}
+
+			.login-code {
+				height: 38px;
+				float: right;
+
+				.login-code-img {
+					height: 38px;
+					position: absolute;
+					margin-left: 10px;
+					width: 200rpx;
+				}
+			}
+		}
+	}
+</style>

+ 1 - 0
pages/mine/index.vue

@@ -94,6 +94,7 @@
     },
     computed: {
       avatar() {
+		  console.log('avatar>>>'+JSON.stringify(this.$store.state.user))
         return this.$store.state.user.avatar
       },
       windowHeight() {

+ 51 - 0
pages/regist/index.vue

@@ -0,0 +1,51 @@
+<template>
+
+	<view class="login-form-content">
+		<view class="input-item flex align-center">
+			<view class="iconfont icon-user icon"></view>
+			<input v-model="loginForm.username" class="input" type="text" placeholder="客户名称" maxlength="30" />
+		</view>
+		<view class="input-item flex align-center">
+			<view class="iconfont icon-password icon"></view>
+			<input v-model="loginForm.password" type="password" class="input" placeholder="联系人" maxlength="20" />
+		</view>
+		<view class="input-item flex align-center">
+			<view class="iconfont icon-password icon"></view>
+			<input v-model="loginForm.password" type="password" class="input" placeholder="电话" maxlength="20" />
+		</view>
+		<view class="input-item flex align-center">
+			<view class="iconfont icon-password icon"></view>
+			<input v-model="loginForm.password" type="password" class="input" placeholder="联系人" maxlength="20" />
+		</view>
+	</view>
+
+</template>
+
+<script>
+	export default {
+	  onLoad: function() {
+	  }
+	}
+</script>
+
+<style  lang="scss">
+	.input-item {
+	  margin: 20px auto;
+	  background-color: #f5f6f7;
+	  height: 45px;
+	  border-radius: 20px;
+	  .icon {
+	    font-size: 38rpx;
+	    margin-left: 10px;
+	    color: #999;
+	  }
+	  .input {
+	    width: 100%;
+	    font-size: 14px;
+	    line-height: 20px;
+	    text-align: left;
+	    padding-left: 15px;
+	    //background: rgb(224,236,255);
+	  }
+	}
+</style>

+ 180 - 0
pages/reviews/reviews.vue

@@ -0,0 +1,180 @@
+<template>
+	<view>
+		<view v-for="item in list">
+			<uni-card :title=" '客户:'+(item.deptName==null?' ':item.deptName)"
+				:extra="'负责人:'+(item.leader==null?' ':item.leader)">
+				<view style="position: relative;line-height: 6vw;">
+					<u-row>
+						<u-col span="8">
+							<view>联系电话:{{item.phone}}</view>
+							<view>创建时间:{{item.createTime}}</view>
+							<view>审核时间:{{item.reviewTime==null?'':item.reviewTime}}</view>
+							<uni-tag title="?????"></uni-tag>
+							<view>审核状态:<uni-tag size="small" :text="item.status==0?'待审核':'审核完成'"
+									:type="item.status==0?'primary':'success'" /></view>
+							<view>是否通过:<uni-tag size="small" :text="item.status==0?'待审核':item.delFlag==1?'审核通过':'审核失败'"
+									:type="item.status==0?'primary':item.delFlag==1?'success':'error'" /></view>
+							<view v-if="item.delFlag==0&&item.delFlag!=''">
+								原因:{{item.remark}}
+							</view>
+						</u-col>
+						<u-col span="4">
+							<image @click="previewImg(orders(item))" aspectFit style="width: 120px;height: 80px;" :src="orders(item)"></image>
+							<u-button :disabled="item.status==1?true:false" icon="eye-fill" type="primary"
+								@click="openDetailDialog(item.id)" :plain="true" size="mini" text="审核"></u-button>
+						</u-col>
+
+					</u-row>
+
+				</view>
+			</uni-card>
+		</view>
+		<u-modal title="审核是否通过:" @cancel="closeDlg" confirmText="提交" :showCancelButton="true" @confirm="submitReg"
+			:show="show">
+			<view class="slot-content">
+				<view>
+					<radio-group @change="change">
+						通过:
+						<radio value="1"></radio>
+						不通过:
+						<radio value="0"></radio>
+					</radio-group>
+				</view>
+				<view v-if="chooseUser.delFlag==0&&chooseUser.delFlag!=''">
+					<u-input v-model="chooseUser.remark" placeholder="请输入不通过原因..."></u-input>
+				</view>
+			</view>
+		</u-modal>
+	</view>
+
+</template>
+
+<script>
+	import config from '@/config'
+	import {
+		listReviews,
+		reviewsAdopt,
+		reviews
+	} from '@/api/user/user';
+	export default {
+		data() {
+			return {
+				total:0, //数据总长
+				// 查询参数
+				queryParams: {
+					pageNum: 1,
+					pageSize: 10,
+					deptName: undefined,
+					leader: undefined,
+					phone: undefined,
+					status: undefined,
+					delFlag: undefined,
+				},
+				list: [],
+				show: false,
+				chooseUser: [],
+				switchdis: false, //已经审核完禁用
+			}
+		},
+		created() {
+			this.queryParams= {
+				pageNum: 1,
+				pageSize: 10,
+				deptName: undefined,
+				leader: undefined,
+				phone: undefined,
+				status: undefined,
+				delFlag: undefined,
+			},
+			this.listReviews()
+		},
+		onReachBottom() {
+			if(this.total>this.list.length){
+				this.queryParams.pageNum++
+				this.listReviews()
+			}
+		},
+		methods: {
+			previewImg(imgurl) {
+			    uni.previewImage({
+			      current: imgurl,
+			      urls: [imgurl]
+			    });
+			  },
+			submitReg() {
+				if((this.chooseUser.remark==null||this.chooseUser.remark=='')&&this.chooseUser.delFlag==0){
+					uni.showToast({
+						title: '请输入原因',
+						duration: 1500,
+						icon: 'none'
+					});
+					return;
+				}
+				
+				reviewsAdopt(this.chooseUser).then((response) => {
+					this.show = false;
+					this.queryParams= {
+						pageNum: 1,
+						pageSize: 10,
+						deptName: undefined,
+						leader: undefined,
+						phone: undefined,
+						status: undefined,
+						delFlag: undefined,
+					},
+					this.listReviews();
+				});
+			},
+			change(event) {
+				this.chooseUser.delFlag = event.detail.value
+				console.log('this.chooseUser>>>' + JSON.stringify(this.chooseUser))
+			},
+			closeDlg() {
+				console.log('closeDlg>>>>>>>')
+				this.show = false
+			},
+			listReviews() {
+				listReviews(this.queryParams).then(res => {
+					
+					let lists = res.rows
+					
+					this.total=res.total 
+					if(this.total>this.list.length){
+					for (let l in lists) {
+						this.list.push(lists[l])
+					}	
+					}
+					console.log('list>>' + JSON.stringify(this.list))
+				})
+			},
+			orders(item) {
+				let baseUrl = config.baseUrl
+				return baseUrl + item.orders
+			},
+			// 打开信息详情
+			openDetailDialog(id) {
+				this.show = true;
+				reviews(id).then((response) => {
+					this.chooseUser = response.data;
+					console.log("this.form>>>>>???>>>" + JSON.stringify(this.chooseUser));
+				});
+			},
+
+
+		}
+	}
+</script>
+
+<style>
+	.mb-10 {
+		margin-bottom: 10px;
+	}
+
+	.decoration {
+		width: 6px;
+		height: 6px;
+		margin-right: 4px;
+		border-radius: 50%;
+		background-color: #18bc37 !default;
+	}
+</style>

+ 15 - 0
pages/work/index.vue

@@ -32,6 +32,15 @@
           <view class="bottom">Customer List</view>
         </view>
       </view>
+	  <view class="grid-item-box" v-if="hasRole(['admin'])" @click="goPage('reviews')" style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
+	    <view class="grid-image">
+	      <u-image :showLoading="true" src="/static/images/icons/user.png" width="80rpx" height="80rpx" ></u-image>
+	    </view>
+	    <view class="grid-text">
+	      <view class="top">注册审核</view>
+	      <view class="bottom">Registration Review</view>
+	    </view>
+	  </view>
 
       <view class="grid-item-box" v-if="hasRole(['admin']) || hasRole(['companymgr'])" @click="goPage('deptuser')" style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
           <view class="grid-image">
@@ -308,6 +317,12 @@ export default {
             url: '/pages/device/rank'
           });
         }
+		if('reviews'==path){
+			uni.navigateTo({
+				url:'/pages/reviews/reviews'
+			})
+		}
+		
 
       }
     }

+ 5 - 1
utils/upload.js

@@ -14,13 +14,17 @@ const upload = config => {
   if (getToken() && !isToken) {
     config.header['Authorization'] = 'Bearer ' + getToken()
   }
+ if(config.formData!==null){
+	 config.header['Content-Type'] = 'multipart/form-data'
+ }
   // get请求映射params参数
   if (config.params) {
     let url = config.url + '?' + tansParams(config.params)
     url = url.slice(0, -1)
     config.url = url
-  }
+  } 
   return new Promise((resolve, reject) => {
+	  console.log('upload.js>>>>>'+JSON.stringify( config.filePath)+'|||'+JSON.stringify(config.formData)+'|||'+JSON.stringify(config.header))
       uni.uploadFile({
         timeout: config.timeout || timeout,
         url: baseUrl + config.url,