From 51edf3ba7b1e5aa58220f90ee895835bbdfd922e Mon Sep 17 00:00:00 2001 From: xuxueyang <xuxy@fengyuntec.com> Date: 星期三, 17 七月 2024 14:33:01 +0800 Subject: [PATCH] update 合伙人信息维护 --- pages/login/supplier-login.vue | 4 manifest.json | 2 pages/home/supplier-home.vue | 12 pages.json | 67 +- pages/login/supplier-reg.vue | 890 ++++++++++++++++++------------------ pages/user/supplier-user.vue | 13 store/index.js | 27 sub_pages/partner/partner-info/partner-info.vue | 416 +++++++++++++++++ 8 files changed, 939 insertions(+), 492 deletions(-) diff --git a/manifest.json b/manifest.json index 8466839..444f1a4 100644 --- a/manifest.json +++ b/manifest.json @@ -49,7 +49,7 @@ "quickapp" : {}, /* 快应用特有相关 */ "mp-weixin" : { - "appid" : "wx3203fd935a6ffe09", + "appid" : "wx6d0ecc4e18710458", "setting" : { "urlCheck" : false, "es6" : true, diff --git a/pages.json b/pages.json index 8d339b4..cef1a94 100644 --- a/pages.json +++ b/pages.json @@ -3,8 +3,7 @@ "easycom": { "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" }, - "pages": [ - { + "pages": [{ "path": "pages/login/supplier-login", "style": { "navigationBarTitleText": "登录", @@ -19,17 +18,27 @@ "navigationStyle": "custom" } - }, - // #ifdef PUB_CUSTOMER - { - "path": "pages/home/home", - "style": { - "navigationBarTitleText": "首页", - "enablePullDownRefresh": true, - "navigationStyle": "custom" - } - - }, + }, + // #ifdef PUB_CUSTOMER + { + "path": "pages/home/home", + "style": { + "navigationBarTitleText": "首页", + "enablePullDownRefresh": true, + "navigationStyle": "custom" + } + + }, + // #endif + + // #ifndef PUB_CUSTOMER + { + "path": "pages/login/supplier-reg", + "style": { + "navigationBarTitleText": "申请入驻", + "navigationStyle": "custom" + } + }, // #endif { "path": "pages/user/supplier-user", @@ -122,13 +131,6 @@ } }, { - "path": "supplier-reg/supplier-reg", - "style": { - "navigationBarTitleText": "申请入驻", - "navigationStyle": "custom" - } - }, - { "path": "protocol", "style": { "navigationBarTitleText": "协议", @@ -141,6 +143,12 @@ }, { "root": "sub_pages/partner", "pages": [{ + "path": "partner-info/partner-info", + "style": { + "navigationBarTitleText": "信息维护", + "enablePullDownRefresh": false + } + }, { "path": "order-manage/order-manage", "style": { "navigationBarTitleText": "订单管理", @@ -182,17 +190,16 @@ { "path": "trade/detail", "style": { - "navigationBarTitleText": "商品详情", - "enablePullDownRefresh": false - + "navigationBarTitleText": "商品详情", + "enablePullDownRefresh": false + } - }, - { - "path" : "shop/shop", - "style" : - { - "navigationBarTitleText" : "商家主页" - } + }, + { + "path": "shop/shop", + "style": { + "navigationBarTitleText": "商家主页" + } } ] diff --git a/pages/home/supplier-home.vue b/pages/home/supplier-home.vue index 7d7528c..c920aee 100644 --- a/pages/home/supplier-home.vue +++ b/pages/home/supplier-home.vue @@ -19,9 +19,13 @@ <image class="user-icon" v-if="currentInfo.picture" :src="currentInfo.picture" mode="aspectFit"></image> <view class="name"> - <view class="t1">{{ (!!currentInfo.supplierDTO?(currentInfo.supplierDTO.name):"") || currentInfo.nickName || currentInfo.loginName || '-'}}<span + <view class="t1"> + {{ (!!currentInfo.supplierDTO?(currentInfo.supplierDTO.name):"") || currentInfo.nickName || currentInfo.loginName || '-'}}<span v-if="currentInfo.supplierDTO&¤tInfo.supplierDTO.status!=='P'"> ({{currentInfo.supplierDTO?currentInfo.supplierDTO.statusStr:''}})</span> + <span v-if="currentInfo.partnerDTO&¤tInfo.partnerDTO.status!=='P'"> + ({{currentInfo.partnerDTO?currentInfo.partnerDTO.statusStr:''}})</span> + <span v-if="!currentInfo.partnerDTO&¤tInfo.type==='partner'">(信息待完善)</span> </view> <view class="t2">{{currentInfo.tel || '暂无电话'}}</view> </view> @@ -44,7 +48,7 @@ </view> </view> <view class="line"></view> - + <view class="flex tj-container" v-if="selftype==='supplier'"> <view class="tj-each"> <view class="num"> @@ -251,7 +255,7 @@ methods: { async toFlowManage() { - + if (!this.currentInfo.supplierDTO) { await this.$message.confirm('尚未入驻店铺信息,是否前往入驻?') this.goto('/sub_pages/supplier/supplier-info/supplier-info', true) @@ -262,7 +266,7 @@ this.$message.showLoading() await this.$store.dispatch('getCurrentInfo') this.$message.hideLoading() - + if (this.currentInfo.supplierDTO.status == 'P') { } else { diff --git a/pages/login/supplier-login.vue b/pages/login/supplier-login.vue index f7cd70e..52303aa 100644 --- a/pages/login/supplier-login.vue +++ b/pages/login/supplier-login.vue @@ -51,7 +51,7 @@ <view class="topic-font" v-if="loginType=='pwd'" @click="loginType='code'">手机验证码登录</view> <view class="topic-font" v-if="loginType=='code'" @click="loginType='pwd'">账号密码登录</view> - <!-- #ifdef PUB_SUPPLIER --> + <!-- #ifndef PUB_CUSTOMER --> <view class="topic-font m-l-a m-r-0" @click="toReg">前往注册</view> <!-- #endif --> @@ -173,7 +173,7 @@ // url: '/pages/index/index' // }) uni.redirectTo({ - url: '/sub_pages/supplier/supplier-reg/supplier-reg' + url: '/pages/login/supplier-reg' }) }, diff --git a/sub_pages/supplier/supplier-reg/supplier-reg.vue b/pages/login/supplier-reg.vue similarity index 93% rename from sub_pages/supplier/supplier-reg/supplier-reg.vue rename to pages/login/supplier-reg.vue index d327bb7..5068173 100644 --- a/sub_pages/supplier/supplier-reg/supplier-reg.vue +++ b/pages/login/supplier-reg.vue @@ -1,445 +1,455 @@ -<template> - <view class="main-container login-container img100 relative" style="margin-top: 0rpx;"> - <image class="component-bg" - src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/a5/a54508de179a4942918ecb2c5a4aa9f5bg.png" - mode="scaleToFill" /> - - - <view class="t-login top-bg"> - <view class="nav-title">注册</view> - <view class="login"> - <form class="cl"> - <view class="t-a titles-top"> - <view class="title-1">HELLO</view> - <view class="title-2">欢迎入驻<span class="title-3">花满芜</span></view> - </view> - - - <view class="t-a form-input" v-if="loginType=='code'"> - <u-input placeholder="请输入手机号" :border="false" v-model="phoneNumber"> - <template slot="suffix"> - <view class="get-code" :style="{'color':getCodeBtnColor}" @click.stop="getCode()"> - {{getCodeText}} - </view> - </template> - </u-input> - - <!-- <u-input type="text" name="userName" placeholder="请输入手机号" v-model="phoneNumber" - style="position: relative;z-index: 1;" /> --> - - - </view> - - - <view class="t-a form-input" v-if="loginType=='code'"> - <!-- <input type="text" name="userName" placeholder="请输入手机验证码" v-model="smsCode" - style="position: relative;z-index: 1;" /> --> - <u-input placeholder="请输入手机验证码" :border="false" v-model="smsCode"></u-input> - - </view> - <view class="t-a form-input" v-if="loginType=='code'"> - <!-- <input type="text" :password="true" name="password" placeholder="请输入密码" v-model="password" /> --> - - <u-input :password="true" :border="false" placeholder="请输入密码" v-model="password"></u-input> - </view> - - <button @tap="login()" class="bottom-button">注 册</button> - - <view class="flex"> - <view class="topic-font m-l-a m-r-0" @click="toLogin">前往登录</view> - </view> - <view class="flex flex-wrap-normal" style="position: fixed;bottom: 40rpx;left: 40rpx;right: 40rpx;" - v-if="false"> - <view :style="{'margin-top': '8rpx','margin-right': '12rpx','font-size':'24rpx'}" - @click="protocal=!protocal" class="component-radio" :class="[protocal?'cur':'']"> - - </view> - <view class="topic-gray" @click="toProtocol">请仔细阅读《花满芜合伙人供应商入口小程序隐私保护指引》如您同意该指引,请勾选开始使用本小程序 - </view> - </view> - </form> - </view> - </view> - </view> -</template> -<script> - // import util from '@/utils/util.js' - // import gzmzApi from '@/api/gzmzApi.js' - // import myCache from '@/utils/myCache.js' - export default { - data() { - return { - openId: '-1', - - userName: '', - password: '', - - phoneNumber: '', - smsCode: '', - - checked: false, - loginType: 'code', //pwd和code,密码和验证码登录 - pcfvalue: undefined, - getCodeText: '获取验证码', - getCodeBtnColor: "#20613D", - getCodeisWaiting: false, - Timer: undefined, - protocal: false - }; - }, - methods: { - toProtocol() { - uni.navigateTo({ - url: '/sub_pages/supplier/protocol' - }) - }, - async getCode() { - // await this.$message.confirm('是否同意入驻协议') - // this.protocal = true - console.log('getCode') - setTimeout(() => { - uni.hideKeyboard() //隐藏已经显示的软键盘,如果软键盘没有显示则不做任何操作。 - }, 200) - - if (this.getCodeisWaiting) { - return; - } - if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))) { //校验手机号码是否有误 - uni.showToast({ - title: '请填写正确手机号码', - icon: "none" - }); - return false; - } - this.getCodeText = "发送中..." //发送验证码 - this.getCodeisWaiting = true; - this.getCodeBtnColor = "#000" //追加样式,修改颜色 - //示例用定时器模拟请求效果 - //setTimeout(()用于在指定的毫秒数后调用函数或计算表达式 - const { - code - } = await this.$http.request('post', '/api/sms/send/code', { - data: { - tel: this.phoneNumber, - userType: 'supplier' - } - }) - if (code == 0) { - uni.showToast({ - title: '验证码已发送', - icon: "none" - }); - this.setTimer(); //调用定时器方法 - }else{ - this.getCodeText = "获取验证码" //发送验证码 - this.getCodeisWaiting = false; - this.getCodeBtnColor = "#20613D"; - } - // setTimeout(() => { - // //弹出提示框 - // //示例默认1234,生产中请删除这一句。 - // // this.code = '1234'; //发送验证码,进行填入 - - // }, 1000) - }, - //setTimer: 需要每隔一段时间执行一件事的的时候就需要使用SetTimer函数 - setTimer() { - let holdTime = 60; //定义变量并赋值 - this.getCodeText = "重新获取(60)" - //setInterval()是一个实现定时调用的函数,可按照指定的周期(以毫秒计)来调用函数或计算表达式。 - //setInterval方法会不停地调用函数,直到 clearInterval被调用或窗口被关闭。 - this.Timer = setInterval(() => { - if (holdTime <= 0) { - this.getCodeisWaiting = false; - this.getCodeBtnColor = "#20613D"; - this.getCodeText = "获取验证码" - clearInterval(this.Timer); //清除该函数 - return; //返回前面 - } - this.getCodeText = "重新获取(" + holdTime + ")" - holdTime--; - }, 1000) - }, - toLogin() { - uni.redirectTo({ - url: '/pages/login/supplier-login' - }) - - }, - changeAll(e) { - this.pcfvalue = e.detail.value[0] - }, - async login() { - uni.showLoading({ - title: '登陆中' - }); - var that = this; - if (!that.phoneNumber) { - uni.showToast({ - title: '请输入手机号', - icon: 'none' - }); - return; - } - if (!that.smsCode) { - uni.showToast({ - title: '请输入手机验证码', - icon: 'none' - }); - return; - } - if (!that.password) { - uni.showToast({ - title: '请输入密码', - icon: 'none' - }); - return; - } - // if (this.pcfvalue == undefined) { - // util.showMyToast('必须勾选《用户服务协议》及《隐私政策》'); - // return; - // } - let post = { - tel: this.phoneNumber, - smsCode: this.smsCode, - password: this.password, - // openId: '123456789' - } - // const { - // code - // } = await this.$http.request('get', '/api/login/admin') - const resp = await this.$store.dispatch('regSupplier', post); - // uni.hideLoading() - - if (resp.code == 0) { - - // myCache.cache("userToken", res.data.accessToken) - // let userRes = await gzmzApi.getMemberInfo(); - // if (userRes.status) { - // myCache.cache("userInfo", JSON.stringify(userRes.data)) - // } - uni.showToast({ - title: '注册成功!', - icon: 'none' - }); - setTimeout(() => { - this.toLogin() - }, 1000); - - } else { - // uni.showToast({ - // title: '登录失败!', - // icon: 'none' - // }); - return; - } - - }, - tc1(id) { - uni.navigateTo({ - url: '/pages/users/xieyi?id=' + id, - }); - } - } - }; -</script> -<style lang="scss" scoped> - .form-input { - background-color: #f8f7fc; - border-radius: 50rpx; +<template> + <view class="main-container login-container img100 relative" style="margin-top: 0rpx;"> + <image class="component-bg" + src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/a5/a54508de179a4942918ecb2c5a4aa9f5bg.png" + mode="scaleToFill" /> + + + <view class="t-login top-bg"> + <view class="nav-title">注册</view> + <view class="login"> + <form class="cl"> + <view class="t-a titles-top"> + <view class="title-1">HELLO</view> + <view class="title-2">欢迎入驻<span class="title-3">花满芜</span></view> + </view> + + + <view class="t-a form-input" v-if="loginType=='code'"> + <u-input placeholder="请输入手机号" :border="false" v-model="phoneNumber"> + <template slot="suffix"> + <view class="get-code" :style="{'color':getCodeBtnColor}" @click.stop="getCode()"> + {{getCodeText}} + </view> + </template> + </u-input> + + <!-- <u-input type="text" name="userName" placeholder="请输入手机号" v-model="phoneNumber" + style="position: relative;z-index: 1;" /> --> + + + </view> + + + <view class="t-a form-input" v-if="loginType=='code'"> + <!-- <input type="text" name="userName" placeholder="请输入手机验证码" v-model="smsCode" + style="position: relative;z-index: 1;" /> --> + <u-input placeholder="请输入手机验证码" :border="false" v-model="smsCode"></u-input> + + </view> + <view class="t-a form-input" v-if="loginType=='code'"> + <!-- <input type="text" :password="true" name="password" placeholder="请输入密码" v-model="password" /> --> + + <u-input :password="true" :border="false" placeholder="请输入密码" v-model="password"></u-input> + </view> + + <button @tap="login()" class="bottom-button">注 册</button> + + <view class="flex"> + <view class="topic-font m-l-a m-r-0" @click="toLogin">前往登录</view> + </view> + <view class="flex flex-wrap-normal" style="position: fixed;bottom: 40rpx;left: 40rpx;right: 40rpx;" + v-if="false"> + <view :style="{'margin-top': '8rpx','margin-right': '12rpx','font-size':'24rpx'}" + @click="protocal=!protocal" class="component-radio" :class="[protocal?'cur':'']"> + + </view> + <view class="topic-gray" @click="toProtocol">请仔细阅读《花满芜合伙人供应商入口小程序隐私保护指引》如您同意该指引,请勾选开始使用本小程序 + </view> + </view> + </form> + </view> + </view> + </view> +</template> +<script> + // import util from '@/utils/util.js' + // import gzmzApi from '@/api/gzmzApi.js' + // import myCache from '@/utils/myCache.js' + export default { + data() { + return { + openId: '-1', + + userName: '', + password: '', + + phoneNumber: '', + smsCode: '', + + checked: false, + loginType: 'code', //pwd和code,密码和验证码登录 + pcfvalue: undefined, + getCodeText: '获取验证码', + getCodeBtnColor: "#20613D", + getCodeisWaiting: false, + Timer: undefined, + protocal: false, + // #ifdef PUB_SUPPLIER + apitype: 'supplier', + // #endif + // #ifdef PUB_PARTNER + apitype: 'partner', + // #endif + + }; + }, + methods: { + toProtocol() { + uni.navigateTo({ + url: '/sub_pages/supplier/protocol' + }) + }, + async getCode() { + // await this.$message.confirm('是否同意入驻协议') + // this.protocal = true + console.log('getCode') + setTimeout(() => { + uni.hideKeyboard() //隐藏已经显示的软键盘,如果软键盘没有显示则不做任何操作。 + }, 200) + + if (this.getCodeisWaiting) { + return; + } + if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))) { //校验手机号码是否有误 + uni.showToast({ + title: '请填写正确手机号码', + icon: "none" + }); + return false; + } + this.getCodeText = "发送中..." //发送验证码 + this.getCodeisWaiting = true; + this.getCodeBtnColor = "#000" //追加样式,修改颜色 + //示例用定时器模拟请求效果 + //setTimeout(()用于在指定的毫秒数后调用函数或计算表达式 + const { + code + } = await this.$http.request('post', '/api/sms/send/code', { + data: { + tel: this.phoneNumber, + userType: this.apitype + } + }) + if (code == 0) { + uni.showToast({ + title: '验证码已发送', + icon: "none" + }); + this.setTimer(); //调用定时器方法 + } else { + this.getCodeText = "获取验证码" //发送验证码 + this.getCodeisWaiting = false; + this.getCodeBtnColor = "#20613D"; + } + // setTimeout(() => { + // //弹出提示框 + // //示例默认1234,生产中请删除这一句。 + // // this.code = '1234'; //发送验证码,进行填入 + + // }, 1000) + }, + //setTimer: 需要每隔一段时间执行一件事的的时候就需要使用SetTimer函数 + setTimer() { + let holdTime = 60; //定义变量并赋值 + this.getCodeText = "重新获取(60)" + //setInterval()是一个实现定时调用的函数,可按照指定的周期(以毫秒计)来调用函数或计算表达式。 + //setInterval方法会不停地调用函数,直到 clearInterval被调用或窗口被关闭。 + this.Timer = setInterval(() => { + if (holdTime <= 0) { + this.getCodeisWaiting = false; + this.getCodeBtnColor = "#20613D"; + this.getCodeText = "获取验证码" + clearInterval(this.Timer); //清除该函数 + return; //返回前面 + } + this.getCodeText = "重新获取(" + holdTime + ")" + holdTime--; + }, 1000) + }, + toLogin() { + uni.redirectTo({ + url: '/pages/login/supplier-login' + }) + + }, + changeAll(e) { + this.pcfvalue = e.detail.value[0] + }, + async login() { + uni.showLoading({ + title: '登陆中' + }); + var that = this; + if (!that.phoneNumber) { + uni.showToast({ + title: '请输入手机号', + icon: 'none' + }); + return; + } + if (!that.smsCode) { + uni.showToast({ + title: '请输入手机验证码', + icon: 'none' + }); + return; + } + if (!that.password) { + uni.showToast({ + title: '请输入密码', + icon: 'none' + }); + return; + } + // if (this.pcfvalue == undefined) { + // util.showMyToast('必须勾选《用户服务协议》及《隐私政策》'); + // return; + // } + let post = { + tel: this.phoneNumber, + smsCode: this.smsCode, + password: this.password, + type: this.apitype + // openId: '123456789' + } + // const { + // code + // } = await this.$http.request('get', '/api/login/admin') + const resp = await this.$store.dispatch('regUser', post); + // uni.hideLoading() + + if (resp.code == 0) { + + // myCache.cache("userToken", res.data.accessToken) + // let userRes = await gzmzApi.getMemberInfo(); + // if (userRes.status) { + // myCache.cache("userInfo", JSON.stringify(userRes.data)) + // } + uni.showToast({ + title: '注册成功!', + icon: 'none' + }); + setTimeout(() => { + this.toLogin() + }, 1000); + + } else { + // uni.showToast({ + // title: '登录失败!', + // icon: 'none' + // }); + return; + } + + }, + tc1(id) { + uni.navigateTo({ + url: '/pages/users/xieyi?id=' + id, + }); + } + } + }; +</script> +<style lang="scss" scoped> + .form-input { + background-color: #f8f7fc; + border-radius: 50rpx; margin-bottom: 50rpx; - border: 1px solid #e9e9e9; - /deep/ .u-input{ + border: 1px solid #e9e9e9; + + /deep/ .u-input { padding-left: 60rpx !important; padding-right: 40rpx !important; - } - /deep/ input { - height: 70rpx; - line-height: 70rpx; - } - - } -</style> -<style lang="scss" scoped> - @import '@/pages/login/login.scss'; - - .main-container { - margin: 20px 0; - } - - .img-a { - position: absolute; - width: 100%; - top: -150rpx; - right: 0; - } - - .img-b { - position: absolute; - width: 50%; - bottom: 0; - left: -120rpx; - } - - .to-home { - margin-top: 30rpx; - font-size: 30rpx; - color: #5af; - display: flex; - flex-direction: row-reverse; - } - - .t-login { - width: 100%; - margin: 0 auto; - font-size: 28rpx; - color: #000; - } - - .t-login .bg { - width: 100%; - position: relative; - } - - .t-login .login { - width: 650rpx; - margin: 60rpx auto; - margin-top: 0rpx; - font-size: 28rpx; - color: #000; - } - - .t-login button { - font-size: 28rpx; - background: #5677fc; - color: #fff; - height: 90rpx; - line-height: 90rpx; - border-radius: 50rpx; - box-shadow: 0 5px 7px 0 rgba(86, 119, 252, 0.2); - } - - .t-login input { - padding: 0 20rpx 0 60rpx; - height: 90rpx; - line-height: 90rpx; - margin-bottom: 50rpx; - background: #f8f7fc; - border: 1px solid #e9e9e9; - font-size: 28rpx; - border-radius: 50rpx; - } - - .t-login .t-a { - position: relative; - - .get-code { - // position: absolute; - // right: 0rpx; - // top: 0rpx; - // z-index: 99; - // padding-top: 25rpx; - // bottom: 0; - // padding-right: 40rpx; - // padding-left: 20rpx; - } - } - - .t-login .t-a .icon { - width: 40rpx; - height: 40rpx; - position: absolute; - left: 24rpx; - top: 14rpx; - margin-right: 20rpx; - } - - .t-login .t-a .line { - width: 2rpx; - height: 40rpx; - background-color: #dedede; - position: absolute; - top: 28rpx; - left: 98rpx; - } - - .t-login .t-b { - text-align: left; - font-size: 46rpx; - color: #000; - padding: 300rpx 0 30rpx 0; - font-weight: bold; - } - - .t-login .t-b2 { - text-align: left; - font-size: 32rpx; - color: #aaaaaa; - padding: 0rpx 0 120rpx 0; - } - - .t-login .t-c { - position: absolute; - right: 22rpx; - top: 22rpx; - background: #5677fc; - color: #fff; - font-size: 24rpx; - border-radius: 50rpx; - height: 50rpx; - line-height: 50rpx; - padding: 0 25rpx; - z-index: 999; - } - - .t-login .t-d { - text-align: center; - color: #999; - margin: 80rpx 0; - } - - .t-login .t-e { - text-align: center; - width: 250rpx; - margin: 80rpx auto 0; - } - - .t-login .t-g { - float: left; - width: 50%; - } - - .t-login .t-e image { - width: 50rpx; - height: 50rpx; - } - - .t-login .t-f { - text-align: center; - margin: 200rpx 0 0 0; - color: #666; - } - - .t-login .t-f text { - margin-left: 20rpx; - color: #aaaaaa; - font-size: 27rpx; - } - - .t-login .uni-input-placeholder { - color: #000; - } - - .cl { - zoom: 1; - } - - .cl:after { - clear: both; - display: block; - visibility: hidden; - height: 0; - content: '\20'; - } + + /deep/ input { + height: 70rpx; + line-height: 70rpx; + + } + + } +</style> +<style lang="scss" scoped> + @import '@/pages/login/login.scss'; + + .main-container { + margin: 20px 0; + } + + .img-a { + position: absolute; + width: 100%; + top: -150rpx; + right: 0; + } + + .img-b { + position: absolute; + width: 50%; + bottom: 0; + left: -120rpx; + } + + .to-home { + margin-top: 30rpx; + font-size: 30rpx; + color: #5af; + display: flex; + flex-direction: row-reverse; + } + + .t-login { + width: 100%; + margin: 0 auto; + font-size: 28rpx; + color: #000; + } + + .t-login .bg { + width: 100%; + position: relative; + } + + .t-login .login { + width: 650rpx; + margin: 60rpx auto; + margin-top: 0rpx; + font-size: 28rpx; + color: #000; + } + + .t-login button { + font-size: 28rpx; + background: #5677fc; + color: #fff; + height: 90rpx; + line-height: 90rpx; + border-radius: 50rpx; + box-shadow: 0 5px 7px 0 rgba(86, 119, 252, 0.2); + } + + .t-login input { + padding: 0 20rpx 0 60rpx; + height: 90rpx; + line-height: 90rpx; + margin-bottom: 50rpx; + background: #f8f7fc; + border: 1px solid #e9e9e9; + font-size: 28rpx; + border-radius: 50rpx; + } + + .t-login .t-a { + position: relative; + + .get-code { + // position: absolute; + // right: 0rpx; + // top: 0rpx; + // z-index: 99; + // padding-top: 25rpx; + // bottom: 0; + // padding-right: 40rpx; + // padding-left: 20rpx; + } + } + + .t-login .t-a .icon { + width: 40rpx; + height: 40rpx; + position: absolute; + left: 24rpx; + top: 14rpx; + margin-right: 20rpx; + } + + .t-login .t-a .line { + width: 2rpx; + height: 40rpx; + background-color: #dedede; + position: absolute; + top: 28rpx; + left: 98rpx; + } + + .t-login .t-b { + text-align: left; + font-size: 46rpx; + color: #000; + padding: 300rpx 0 30rpx 0; + font-weight: bold; + } + + .t-login .t-b2 { + text-align: left; + font-size: 32rpx; + color: #aaaaaa; + padding: 0rpx 0 120rpx 0; + } + + .t-login .t-c { + position: absolute; + right: 22rpx; + top: 22rpx; + background: #5677fc; + color: #fff; + font-size: 24rpx; + border-radius: 50rpx; + height: 50rpx; + line-height: 50rpx; + padding: 0 25rpx; + z-index: 999; + } + + .t-login .t-d { + text-align: center; + color: #999; + margin: 80rpx 0; + } + + .t-login .t-e { + text-align: center; + width: 250rpx; + margin: 80rpx auto 0; + } + + .t-login .t-g { + float: left; + width: 50%; + } + + .t-login .t-e image { + width: 50rpx; + height: 50rpx; + } + + .t-login .t-f { + text-align: center; + margin: 200rpx 0 0 0; + color: #666; + } + + .t-login .t-f text { + margin-left: 20rpx; + color: #aaaaaa; + font-size: 27rpx; + } + + .t-login .uni-input-placeholder { + color: #000; + } + + .cl { + zoom: 1; + } + + .cl:after { + clear: both; + display: block; + visibility: hidden; + height: 0; + content: '\20'; + } </style> \ No newline at end of file diff --git a/pages/user/supplier-user.vue b/pages/user/supplier-user.vue index 87a4645..6ca41bc 100644 --- a/pages/user/supplier-user.vue +++ b/pages/user/supplier-user.vue @@ -133,11 +133,18 @@ </view> <!-- #endif --> <view class="user-utils m-20"> - <view class="user-util m-t-12 flex" @click="goto('/pages/user/user-info/user-info',true)"> + <view class="user-util m-t-12 flex" @click="goto('/pages/user/user-info/user-info',true)"> <view class="title">个人信息</view> - <view class="right-icon"> - <uni-icons type="right"></uni-icons> + <view class="right-icon"> + <uni-icons type="right"></uni-icons> </view> + </view> + <view class="user-util m-t-12 flex" v-if="selftype==='partner'" + @click="goto('/sub_pages/partner/partner-info/partner-info',true)"> + <view class="title">合伙人信息</view> + <view class="right-icon"> + <uni-icons type="right"></uni-icons> + </view> </view> <view class="user-util m-t-12 flex" v-if="selftype==='supplier'" @click="goto('/sub_pages/supplier/supplier-info/supplier-info',true)"> diff --git a/store/index.js b/store/index.js index 9ccd032..2f2a20c 100644 --- a/store/index.js +++ b/store/index.js @@ -35,8 +35,8 @@ // remoteip:'',//服务器ip sign: { 'enterprise': 0, - 'info':0, - 'flower':0, + 'info': 0, + 'flower': 0, }, defaultaddress: {} }, @@ -247,13 +247,13 @@ } return resp }, - regSupplier: async function({ + regUser: async function({ commit, dispatch, state }, data) { { - const resp = await http.request('post', '/api/register/supplier', { + const resp = await http.request('post', '/api/register/' + data.type, { data: { username: data.username, password: data.password, @@ -282,9 +282,10 @@ }, data) { { const resp = await http.request('post', '/api/login/partner' + ((data - .phoneNumber||data.tel) ? '/phone' : ''), { + .phoneNumber || data.tel) ? '/phone' : ''), { data: { - username: (data.phoneNumber ||data.tel)?(data.phoneNumber || data.tel): data.username, + username: (data.phoneNumber || data.tel) ? (data.phoneNumber || + data.tel) : data.username, password: data.password, tel: data.phoneNumber || data.tel, smsCode: data.smsCode || '' @@ -342,9 +343,10 @@ }, data) { { const resp = await http.request('post', '/api/login/supplier' + ((data - .phoneNumber ||data.tel) ? '/phone' : ''), { + .phoneNumber || data.tel) ? '/phone' : ''), { data: { - username: (data.phoneNumber ||data.tel)?(data.phoneNumber || data.tel): data.username, + username: (data.phoneNumber || data.tel) ? (data.phoneNumber || + data.tel) : data.username, password: data.password, tel: data.phoneNumber || data.tel, smsCode: data.smsCode || '' @@ -395,8 +397,8 @@ } }, - - loginCustomer:async function({ + + loginCustomer: async function({ commit, dispatch, state @@ -405,7 +407,8 @@ const resp = await http.request('post', '/api/login/customer' + (data .phoneNumber ? '/phone' : ''), { data: { - username: (data.phoneNumber ||data.tel)?(data.phoneNumber || data.tel): data.username, + username: (data.phoneNumber || data.tel) ? (data.phoneNumber || + data.tel) : data.username, password: data.password, tel: data.phoneNumber || data.tel, smsCode: data.smsCode || '' @@ -430,7 +433,7 @@ } }, - + } }) diff --git a/sub_pages/partner/partner-info/partner-info.vue b/sub_pages/partner/partner-info/partner-info.vue new file mode 100644 index 0000000..efa38ec --- /dev/null +++ b/sub_pages/partner/partner-info/partner-info.vue @@ -0,0 +1,416 @@ +<template> + <view class="container-page"> + <view> + <view class="form-item before-line"> + <view class="label required">联系人姓名</view> + <view class="m-l-a m-r-0 flex"> + <input v-model="dto.name" placeholder="请输入联系人姓名" + style="margin-top: 16px;text-align: right;"></input> + + </view> + </view> + <view class="form-item before-line"> + <view class="label required">联系方式</view> + <view class="m-l-a m-r-0 flex"> + <input v-model="dto.contactTel" placeholder="请输入联系方式" + style="margin-top: 16px;text-align: right;"></input> + + </view> + </view> + + <view class="form-item before-line"> + <view class="label required">地区</view> + + <view class="m-l-a m-r-0 flex " :class="[!dto['province']?'desc-gray':'']"> + <uni-data-picker :area="true" @change="(e)=>{PickArea(dto,e)}" placeholder="" + :localdata="regionDataPlus"> + {{ dto['province'] || '请选择' }}{{ dto['city'] && ('/' + dto['city']) || '' }}{{ + dto['region'] && ('/' + dto['region']) || '' + }} + </uni-data-picker> + <u-icon class="m-l-a" name="arrow-right"></u-icon> + </view> + + </view> + <view class="form-item before-line"> + <view class="label required">地址</view> + <view class="m-l-a m-r-0 flex"> + <input v-model="dto.address" placeholder="请输入地址" + style="margin-top: 16px;text-align: right;"></input> + + </view> + </view> + + + <view class="form-item before-line m-t-20" @click="uploadIcon('idCards')"> + <view class="label required">上传身份证正反面</view> + <view class="m-l-a m-r-0 flex"> + <view class="component-button-upload" @click="uploadIcon('idCards')"> + + </view> + + </view> + </view> + + <view class="flex p20" style="padding-top: 0rpx;padding-bottom: 10rpx" + v-if="dto.idCards&&dto.idCards.length>0"> + <view class="m-t-12 m-r-10 " v-for="(tBanner,index) of dto.idCards" :key="index"> + <image class="banner-img" :src="tBanner.url" @click.stop="previewImg(tBanner.url)"> + + </image> + <view class="t-red text-center" @click.stop="deleteImg('idCards',index)">删除</view> + </view> + </view> + + + + <view class="button-green-1 m-t-20 button-fixed-bottom before-line " @click="submit"> + 提交审核 + </view> + + </view> + + <view style="min-height: 200rpx;"> + + </view> + + + </view> +</template> + +<script> + import environments from '@/environments' + + import { + mapState + } from 'vuex' + + export default { + + data() { + return { + id: '', + refresh: false, + api: '', + dto: { + idCards: [], + address: '', + id: '', + userId: '', + name: '', + contactTel: '', + province: '', + city: '', + region: '', + }, + requireFields: [ + + { + name: '联系人姓名', + key: 'name' + }, + { + name: '联系方式', + key: 'contactTel' + }, + { + name: '地区', + key: 'province' + }, + { + name: '地址', + key: 'address' + }, + ], + regionDataPlus: [], + } + }, + onLoad(options) { + if (options.id) { + this.id = options.id + this.getDetail() + } else { + this.getCurrentInfo() + + this.init_area() + } + + }, + + methods: { + PickArea(item, e) { + console.log('PickArea', item, e) + if (e.detail.value) { + this.dto.province = '' + this.dto.city = '' + this.dto.region = '' + if (e.detail.value.length <= 3) { + if (!!e.detail.value[0]) + this.dto.province = e.detail.value[0].value + if (!!e.detail.value[1]) + this.dto.city = e.detail.value[1].value + if (!!e.detail.value[2]) + this.dto.region = e.detail.value[2].value + } else { + //说明有重复的 + var plusnum = e.detail.value.length - 3 + if (!!e.detail.value[plusnum + 0]) + this.dto.province = e.detail.value[plusnum + 0].value + if (!!e.detail.value[plusnum + 1]) + this.dto.city = e.detail.value[plusnum + 1].value + if (!!e.detail.value[plusnum + 2]) + this.dto.region = e.detail.value[plusnum + 2].value + } + + this.$forceUpdate() + + } + }, + PickData(valueKey, nameKey, e) { + // console.log('PickArea', item, e) + if (e.detail.value) { + if (!!e.detail.value[0]) + this.dto[valueKey] = e.detail.value[0].value || e.detail.value[0].id + if (nameKey) { + this.dto[nameKey] = e.detail.value[0].label || e.detail.value[0].name || e.detail.value[0].value + } + this.$forceUpdate() + + } + }, + async init_area() { + const res = await this.$http.request('get', '/api/pub/china/area/json') + // console.log('area', JSON.parse(res.data)) + this.regionDataPlus = res.data && JSON.parse(res.data.replaceAll('code', 'value').replaceAll('name', + 'text')) || [] + + + + }, + + + async getCurrentInfo() { + this.$message.showLoading() + const { + code, + data + } = await this.$http.request('get', "/api/current/partner", {}) + if (code == 0) { + this.dto = { + ...data, + + } + if (!this.dto.idCards) { + this.dto.idCards = [] + } else if (typeof this.dto.idCards == 'string') { + this.dto.idCards = JSON.parse(this.dto.idCards) + } + + this.dto.userId = this.currentInfo.id + + } + + this.$message.hideLoading() + }, + async getDetail() { + this.$message.showLoading() + const { + code, + data + } = await this.$http.request('get', "/api/partner/detail/" + this.id, {}) + if (code == 0) { + this.dto = { + ...data, + + } + + if (!this.dto.idCards) { + this.dto.idCards = [] + } else if (typeof this.dto.idCards == 'string') { + this.dto.idCards = JSON.parse(this.dto.idCards) + } + + } + + this.$message.hideLoading() + + }, + async submit() { + for (var field of this.requireFields) { + if (!this.dto[field.key]) { + this.$message.showToast(`${field.name}信息未填写`) + return + } + } + if (this.dto.idCards.length == 0) { + this.$message.showToast(`身份证信息未填写`) + return + } + await this.$message.confirm(`是否确定提交/修改信息`) + + + var dto = { + ...this.dto, + } + this.$message.showLoading() + const re = await this.$http.request('post', '/api/partner/addOrUpdate', { + data: dto + }) + this.$message.hideLoading() + if (re.code == 2000 || re.code == 0) { + this.$message.showToast('操作成功') + //需要标记加一下 + this.$store.dispatch('sign_add', 'info'); + this.$store.dispatch('getCurrentInfo') + + this.backpage() + } else { + console.log('error re', re) + if (re.code === 30000 && Array.isArray(re.msg)) { + this.$message.showToast('字段未填写完整') + + } + } + }, + + async deleteImg(key, index) { + await this.$message.confirm('是否确认删除此图片') + if (Array.isArray(this.dto[key])) { + this.dto[key].splice(index, 1) + + } else { + this.dto[key] = '' + } + this.$forceUpdate() + }, + uploadIcon(key) { + const that = this + uni.chooseImage({ + count: 1, // 最多可以选择的图片张数,默认9 + sizeType: ['original', 'compressed'], //original 原图,compressed 压缩图,默认二者都有 + sourceType: ['camera', 'album'], //album 从相册选图,camera 使用相机,默认二者都有。如需直接开相机或直接选相册,请只使用一个选项 + success: function({ + errMsg, + tempFiles + }) { + if (errMsg === 'chooseImage:ok') { + // console.log(tempFiles[0]) + if (tempFiles[0].size > 1024 * 1024 * 5) { + that.$message.confirm('图片最多支持5M大小,超出大小限制') + return + } + that.$message.showLoading() + that.$http.upload(tempFiles[0].path).then(async res => { + var pic = res.data && res.data.length > 0 && res.data[ + 0] || {} + that.$message.hideLoading() + if (Array.isArray(that.dto[key])) { + that.dto[key].push(pic || '') + + } else { + that.dto[key] = (pic || {}).url || '' + + } + that.$forceUpdate() + }).catch(res => { + that.$message.hideLoading() + + }) + } + } + }) + }, + + }, + computed: { + ...mapState(['currentInfo']) + }, + components: {} + } +</script> + +<style lang="scss" scoped> + .banner-img { + width: 96rpx; + height: 96rpx; + border-radius: 4rpx; + border: 2rpx dashed #CECECE; + } + + .form-item { + // padding: 40rpx; + border-bottom: 2rpx solid #F3F3F3; + display: flex; + // height: 100px; + + .label { + width: 300rpx; + line-height: 60px; + + } + + .flex { + line-height: 60px; + + .flex1 { + flex: 1; + text-align: center; + color: var(--selfblue) + } + + + } + } + + .form-item.bottom-border-no { + border-bottom: none; + } + + .container-page { + padding: 40rpx; + background-color: #FFFFFF; + // min-height: calc(100vh - 80rpx); + min-height: 100vh; + } + + .style { + width: fit-content; + margin: 0 auto; + line-height: 64rpx; + border-radius: 8rpx; + padding-left: 20rpx; + padding-right: 20rpx; + // padding-top: 5rpx; + // padding-bottom: 5rpx; + border: 2rpx solid var(--selfblue); + background-color: var(--selfbluebg); + min-width: 100rpx; + } + + + .style-1 { + border: 1px solid rgb(122, 187, 255); + border: 1px solid #409EFF; + color: #409EFF; + background-color: rgb(240, 247, 255); + } + + .style-2 { + border: 1px solid rgb(255, 184, 78); + border: 1px solid #FE9044; + color: #FE9044; + background-color: rgb(255, 247, 235); + } + + .style-3 { + border: 1px solid #19be6b; + color: #19be6b; + background-color: rgb(231, 244, 238); + } + + .style-4 { + border: 1px solid #F56c6c; + color: #F56c6c; + background-color: rgb(254, 243, 243); + } +</style> \ No newline at end of file -- Gitblit v1.9.3