Compare commits
7 Commits
6d93d5ca16
...
d82c357910
Author | SHA1 | Date |
---|---|---|
tangqian | d82c357910 | |
tangqian | d357ce42ea | |
TianYu | bc1ff1422e | |
TianYu | 793e2a4a5e | |
TianYu | 20eea0fb02 | |
TianYu | ba7e34e82a | |
Jruome | 7c79be72d2 |
|
@ -0,0 +1,45 @@
|
||||||
|
package cn.iocoder.yudao.module.member.controller.admin.promoter.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
|
import cn.iocoder.yudao.framework.common.validation.Mobile;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Title:AppPromoterCreateReqVO
|
||||||
|
* @Description: app扫码创建推广员
|
||||||
|
* @author: tangqian
|
||||||
|
* @date: 2023/6/5 14:21
|
||||||
|
* @version: V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AppPromoterCreateReqVO implements Serializable {
|
||||||
|
@Schema(description = "推广员名称", required = true, example = "5841")
|
||||||
|
@NotEmpty(message = "推广员名称不能为空")
|
||||||
|
@Size(max = 10,message = "推广员名称最长不能超过{max}")
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "推广员手机号", example = "15601691300")
|
||||||
|
@Mobile
|
||||||
|
@NotEmpty(message = "推广员手机号不能为空")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 帐号状态
|
||||||
|
* <p>
|
||||||
|
* 枚举 {@link CommonStatusEnum}
|
||||||
|
*/
|
||||||
|
@Schema(description = "帐号状态")
|
||||||
|
@NotNull
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "注册来源,通过字典获取:source_type")
|
||||||
|
@NotEmpty(message = "注册来源不能为空")
|
||||||
|
private String sourceType;
|
||||||
|
}
|
|
@ -37,5 +37,8 @@ public class PromoterBaseVO {
|
||||||
@Schema(description = "帐号状态")
|
@Schema(description = "帐号状态")
|
||||||
@NotNull
|
@NotNull
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
@Schema(description = "注册来源,通过字典获取:source_type")
|
||||||
|
@NotEmpty(message = "注册来源不能为空")
|
||||||
|
private String sourceType;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,4 +18,6 @@ public class PromoterRespVO extends PromoterBaseVO {
|
||||||
|
|
||||||
@Schema(description = "组织简称", required = true, example = "18443")
|
@Schema(description = "组织简称", required = true, example = "18443")
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
@Schema(description = "注册来源", required = true, example = "1")
|
||||||
|
private String sourceType;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@ import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
|
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
|
||||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||||
|
import cn.iocoder.yudao.module.member.controller.admin.promoter.vo.AppPromoterCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.member.controller.admin.promoter.vo.PromoterCreateReqVO;
|
||||||
import cn.iocoder.yudao.module.member.controller.admin.promoter.vo.PromoterRespVO;
|
import cn.iocoder.yudao.module.member.controller.admin.promoter.vo.PromoterRespVO;
|
||||||
import cn.iocoder.yudao.module.member.controller.admin.user.vo.AppUserInfoReqVO;
|
import cn.iocoder.yudao.module.member.controller.admin.user.vo.AppUserInfoReqVO;
|
||||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserInfoRespVO;
|
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserInfoRespVO;
|
||||||
|
@ -13,8 +15,8 @@ import cn.iocoder.yudao.module.member.convert.user.UserConvert;
|
||||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||||
import cn.iocoder.yudao.module.member.service.promoter.PromoterService;
|
import cn.iocoder.yudao.module.member.service.promoter.PromoterService;
|
||||||
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -22,7 +24,6 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -82,6 +83,7 @@ public class AppUserController {
|
||||||
appUserInfoRespVO.setUserType(UserTypeEnum.MEMBER);
|
appUserInfoRespVO.setUserType(UserTypeEnum.MEMBER);
|
||||||
}
|
}
|
||||||
appUserInfoRespVO.setUserId(user.getId());
|
appUserInfoRespVO.setUserId(user.getId());
|
||||||
|
appUserInfoRespVO.setIsPromoter(promoterService.checkIsPromoterByUserId(user.getId()));
|
||||||
return success(appUserInfoRespVO);
|
return success(appUserInfoRespVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,5 +122,11 @@ public class AppUserController {
|
||||||
list.add(userSpreadBannerVO);
|
list.add(userSpreadBannerVO);
|
||||||
return CommonResult.success(list);
|
return CommonResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "扫码创建推广员")
|
||||||
|
public CommonResult<Long> appCreatePromoter(@Valid @RequestBody AppPromoterCreateReqVO createReqVO) {
|
||||||
|
return success(promoterService.appCreatePromoter(createReqVO));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,4 +31,9 @@ public class AppUserInfoRespVO {
|
||||||
|
|
||||||
@Schema(description = "组织全称", required = true, example = "15601691300")
|
@Schema(description = "组织全称", required = true, example = "15601691300")
|
||||||
private String parentDeptName;
|
private String parentDeptName;
|
||||||
|
|
||||||
|
@Schema(description = "是否是推广员", required = true, example = "15601691300")
|
||||||
|
private Boolean isPromoter;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,4 +42,8 @@ public class PromoterDO implements Serializable {
|
||||||
|
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册来源
|
||||||
|
*/
|
||||||
|
private String sourceType;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,4 +89,5 @@ public interface PromoterService {
|
||||||
PromoterImportRespVO importUserList(List<PromoterImportExcelVO> importUsers, boolean isUpdateSupport);
|
PromoterImportRespVO importUserList(List<PromoterImportExcelVO> importUsers, boolean isUpdateSupport);
|
||||||
PromoterDO getPromoterDOByUserId(Long userId);
|
PromoterDO getPromoterDOByUserId(Long userId);
|
||||||
|
|
||||||
|
Long appCreatePromoter(AppPromoterCreateReqVO createReqVO);
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,6 +93,41 @@ public class PromoterServiceImpl implements PromoterService {
|
||||||
return promoter.getId();
|
return promoter.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long appCreatePromoter(AppPromoterCreateReqVO createReqVO) {
|
||||||
|
//判断手机号是否注册
|
||||||
|
MemberUserDO memberUserDO = memberUserService.getUserByMobile(createReqVO.getMobile());
|
||||||
|
if (memberUserDO == null) {
|
||||||
|
//创建用户
|
||||||
|
memberUserDO = new MemberUserDO();
|
||||||
|
memberUserDO.setNickname(createReqVO.getNickname());
|
||||||
|
memberUserDO.setMobile(createReqVO.getMobile());
|
||||||
|
memberUserDO.setStatus(createReqVO.getStatus());
|
||||||
|
memberUserDO.setPassword(createReqVO.getMobile().substring(createReqVO.getMobile().length() - 6));
|
||||||
|
memberUserDO = memberUserService.createUserIfAbsent(createReqVO.getMobile(), createReqVO.getNickname(), getClientIP());
|
||||||
|
}
|
||||||
|
if(!TenantContextHolder.getTenantId().equals(memberUserDO.getTenantId())){
|
||||||
|
throw new ServiceException(PROMOTER_EXISTS_OTHER);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (checkIsPromoterByUserId(memberUserDO.getId())) {
|
||||||
|
throw new ServiceException(PROMOTER_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 插入
|
||||||
|
Long tenantId = TenantContextHolder.getTenantId();
|
||||||
|
DeptRespDTO deptRespDTO = deptApi.findParentDept(tenantId);
|
||||||
|
PromoterDO promoter = new PromoterDO();
|
||||||
|
promoter.setDeptId(deptRespDTO.getId());
|
||||||
|
promoter.setUserId(memberUserDO.getId());
|
||||||
|
promoter.setTenantId(tenantId);
|
||||||
|
promoter.setCreateTime(LocalDateTime.now());
|
||||||
|
promoter.setSourceType(createReqVO.getSourceType());
|
||||||
|
promoterMapper.insert(promoter);
|
||||||
|
// 返回
|
||||||
|
return promoter.getId();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updatePromoter(PromoterUpdateReqVO updateReqVO) {
|
public void updatePromoter(PromoterUpdateReqVO updateReqVO) {
|
||||||
|
@ -226,6 +261,7 @@ public class PromoterServiceImpl implements PromoterService {
|
||||||
promoter.setTenantId(SecurityFrameworkUtils.getLoginUser().getTenantId());
|
promoter.setTenantId(SecurityFrameworkUtils.getLoginUser().getTenantId());
|
||||||
promoter.setUserId(userIfAbsent.getId());
|
promoter.setUserId(userIfAbsent.getId());
|
||||||
promoter.setCreateTime(LocalDateTime.now());
|
promoter.setCreateTime(LocalDateTime.now());
|
||||||
|
promoter.setSourceType("1");
|
||||||
Long count = promoterMapper.selectCount(Wrappers.lambdaQuery(PromoterDO.class).eq(PromoterDO::getUserId, memberUserDO.getId()));
|
Long count = promoterMapper.selectCount(Wrappers.lambdaQuery(PromoterDO.class).eq(PromoterDO::getUserId, memberUserDO.getId()));
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
respVO.getFailureUsernames().put(importUser.getNickName(), "已经是推广员");
|
respVO.getFailureUsernames().put(importUser.getNickName(), "已经是推广员");
|
||||||
|
|
|
@ -99,8 +99,6 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private MemberUserDO createUser(String mobile, String realName, String registerIp,Long promoterId) {
|
private MemberUserDO createUser(String mobile, String realName, String registerIp,Long promoterId) {
|
||||||
// 生成密码
|
|
||||||
String password = IdUtil.fastSimpleUUID();
|
|
||||||
// 插入用户
|
// 插入用户
|
||||||
MemberUserDO user = new MemberUserDO();
|
MemberUserDO user = new MemberUserDO();
|
||||||
user.setMobile(mobile);
|
user.setMobile(mobile);
|
||||||
|
|
|
@ -26,6 +26,9 @@
|
||||||
<if test="data.mobile!=null and data.mobile!=''">
|
<if test="data.mobile!=null and data.mobile!=''">
|
||||||
and b.mobile like CONCAT('%',#{data.mobile},'%')
|
and b.mobile like CONCAT('%',#{data.mobile},'%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="data.sourceType!=null">
|
||||||
|
and b.source_type =#{data.sourceType}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
@ -342,7 +342,7 @@ export default {
|
||||||
this.resetForm('form');
|
this.resetForm('form');
|
||||||
},
|
},
|
||||||
handleQRCode(row) {
|
handleQRCode(row) {
|
||||||
const url =`${config.spreadDomain}${config.spreadLink}?redirectUrl=${config.spreadDomain}&tenantId=${row.id}`
|
const url =`${config.spreadDomain}${config.spreadLink}?redirectUrl=${config.spreadDomain}&tenantId=${row.id}&isProperty=1`
|
||||||
QRCode.toCanvas(document.getElementById(`id-${row.id}`), url, {
|
QRCode.toCanvas(document.getElementById(`id-${row.id}`), url, {
|
||||||
scale: 2
|
scale: 2
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
|
|
|
@ -186,6 +186,7 @@
|
||||||
methods: {
|
methods: {
|
||||||
async initLoad() {
|
async initLoad() {
|
||||||
this.isQRCode()
|
this.isQRCode()
|
||||||
|
// this.isProperty()
|
||||||
this.setSpreadId()
|
this.setSpreadId()
|
||||||
if (this.$store.getters.isLogin && !this.$Cache.get('USER_INFO')) {
|
if (this.$store.getters.isLogin && !this.$Cache.get('USER_INFO')) {
|
||||||
await this.$store.dispatch('USERINFO');
|
await this.$store.dispatch('USERINFO');
|
||||||
|
@ -215,6 +216,13 @@
|
||||||
`${wechatUrl}&redirect_uri=${redirectUrl}/pages/member_application/index?tenantId=${tenantId}&spreadId=${spreadId}&response_type=code&scope=snsapi_base#wechat_redirect`
|
`${wechatUrl}&redirect_uri=${redirectUrl}/pages/member_application/index?tenantId=${tenantId}&spreadId=${spreadId}&response_type=code&scope=snsapi_base#wechat_redirect`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 是否扫物业二维码
|
||||||
|
isProperty() {
|
||||||
|
const is_property = this.$route.query.isProperty || false
|
||||||
|
if(parseInt(is_property) === 1){
|
||||||
|
this.$store.commit("SET_IS_PROPERTY", !!is_property)
|
||||||
|
}
|
||||||
|
},
|
||||||
// 获取租户信息
|
// 获取租户信息
|
||||||
getTenantInfo() {
|
getTenantInfo() {
|
||||||
fetchTenantInfo(this.tenantId).then(res => {
|
fetchTenantInfo(this.tenantId).then(res => {
|
||||||
|
|
|
@ -59,6 +59,11 @@ export function register(data) {
|
||||||
return request.post("member/auth/register", data, { noAuth : true });
|
return request.post("member/auth/register", data, { noAuth : true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 注册推广员
|
||||||
|
export function registerPromoter(data) {
|
||||||
|
return request.post("member/user/create", data, { noAuth : true });
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户手机号修改密码
|
* 用户手机号修改密码
|
||||||
* @param data object 用户手机号 验证码 密码
|
* @param data object 用户手机号 验证码 密码
|
||||||
|
|
|
@ -10,6 +10,8 @@ module.exports = {
|
||||||
OPEN_ID: 'OPEN_ID',
|
OPEN_ID: 'OPEN_ID',
|
||||||
// 推广员ID
|
// 推广员ID
|
||||||
SPREAD_ID: 'SPREAD_ID',
|
SPREAD_ID: 'SPREAD_ID',
|
||||||
|
// 是否扫物业推广码
|
||||||
|
IS_PROPERTY: 'IS_PROPERTY',
|
||||||
//用户信息
|
//用户信息
|
||||||
USER_INFO: 'USER_INFO',
|
USER_INFO: 'USER_INFO',
|
||||||
//租户信息
|
//租户信息
|
||||||
|
|
|
@ -75,7 +75,6 @@ export function _toLogin(push, pathLogin) {
|
||||||
|
|
||||||
export function isWhiteList(){
|
export function isWhiteList(){
|
||||||
let path = prePage();
|
let path = prePage();
|
||||||
console.log('path111', path)
|
|
||||||
return whiteListPage.indexOf(path) > -1
|
return whiteListPage.indexOf(path) > -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -452,6 +452,12 @@
|
||||||
"navigationBarTitleText": "登录"
|
"navigationBarTitleText": "登录"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "promoter/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "推广员申请"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "goods_comment_list/index",
|
"path": "goods_comment_list/index",
|
||||||
"style": {
|
"style": {
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="money-box money-time">
|
<view class="money-box money-time">
|
||||||
<text>返费结束时间</text>
|
<text>返费结束时间</text>
|
||||||
<text class="money-text">{{dateConvert(item.startTime)}}</text>
|
<text class="money-text">{{item.startTime}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -35,8 +35,10 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<u-button class="logon" @click="loginMobile" v-if="current !== 0" :loading="loading" loading-text="登录中" :disabled="loading">登录</u-button>
|
<u-button class="logon" @click="loginMobile" v-if="current !== 0" :loading="loading" loading-text="登录中"
|
||||||
<u-button class="logon" @click="submit" v-if="current === 0" :loading="loading" loading-text="登录中" :disabled="loading">登录</u-button>
|
:disabled="loading">登录</u-button>
|
||||||
|
<u-button class="logon" @click="submit" v-if="current === 0" :loading="loading" loading-text="登录中"
|
||||||
|
:disabled="loading">登录</u-button>
|
||||||
<div class="tips">
|
<div class="tips">
|
||||||
<!-- <div @click="jumpRegister">注册账号</div> -->
|
<!-- <div @click="jumpRegister">注册账号</div> -->
|
||||||
<div @click="current = current === 1 ? 0 : 1">{{ current === 1 ? '账号密码登录' : '短信验证码登录' }}</div>
|
<div @click="current = current === 1 ? 0 : 1">{{ current === 1 ? '账号密码登录' : '短信验证码登录' }}</div>
|
||||||
|
@ -79,7 +81,9 @@
|
||||||
import {
|
import {
|
||||||
VUE_APP_API_URL
|
VUE_APP_API_URL
|
||||||
} from "@/utils";
|
} from "@/utils";
|
||||||
|
import {
|
||||||
|
mapGetters
|
||||||
|
} from 'vuex'
|
||||||
const BACK_URL = "login_back_url";
|
const BACK_URL = "login_back_url";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -97,6 +101,9 @@
|
||||||
loading: false
|
loading: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['isProperty'])
|
||||||
|
},
|
||||||
mounted: function() {
|
mounted: function() {
|
||||||
// this.getLogoImage();
|
// this.getLogoImage();
|
||||||
},
|
},
|
||||||
|
@ -104,7 +111,7 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onLinkUserPrivacy(){
|
onLinkUserPrivacy() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/users/privacy/index'
|
url: '/pages/users/privacy/index'
|
||||||
})
|
})
|
||||||
|
@ -120,7 +127,8 @@
|
||||||
if (!that.mobile) return that.$util.Tips({
|
if (!that.mobile) return that.$util.Tips({
|
||||||
title: '请填写手机号码'
|
title: '请填写手机号码'
|
||||||
});
|
});
|
||||||
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile)) return that.$util.Tips({
|
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile))
|
||||||
|
return that.$util.Tips({
|
||||||
title: '请输入正确的手机号码'
|
title: '请输入正确的手机号码'
|
||||||
});
|
});
|
||||||
if (!that.captcha) return that.$util.Tips({
|
if (!that.captcha) return that.$util.Tips({
|
||||||
|
@ -129,7 +137,7 @@
|
||||||
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
|
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
|
||||||
title: '请输入正确的验证码'
|
title: '请输入正确的验证码'
|
||||||
});
|
});
|
||||||
if(that.checked.length === 0) return that.$util.Tips({
|
if (that.checked.length === 0) return that.$util.Tips({
|
||||||
title: '请勾选同意用户协议'
|
title: '请勾选同意用户协议'
|
||||||
});
|
});
|
||||||
that.loading = true
|
that.loading = true
|
||||||
|
@ -151,7 +159,7 @@
|
||||||
that.$util.Tips({
|
that.$util.Tips({
|
||||||
title: res
|
title: res
|
||||||
});
|
});
|
||||||
}).finally(()=>{
|
}).finally(() => {
|
||||||
that.loading = false
|
that.loading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -161,7 +169,8 @@
|
||||||
if (!that.mobile) return that.$util.Tips({
|
if (!that.mobile) return that.$util.Tips({
|
||||||
title: '请填写手机号码'
|
title: '请填写手机号码'
|
||||||
});
|
});
|
||||||
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile)) return that.$util.Tips({
|
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile))
|
||||||
|
return that.$util.Tips({
|
||||||
title: '请输入正确的手机号码'
|
title: '请输入正确的手机号码'
|
||||||
});
|
});
|
||||||
if (!that.captcha) return that.$util.Tips({
|
if (!that.captcha) return that.$util.Tips({
|
||||||
|
@ -209,7 +218,8 @@
|
||||||
if (!that.mobile) return that.$util.Tips({
|
if (!that.mobile) return that.$util.Tips({
|
||||||
title: '请填写手机号码'
|
title: '请填写手机号码'
|
||||||
});
|
});
|
||||||
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile)) return that.$util.Tips({
|
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile))
|
||||||
|
return that.$util.Tips({
|
||||||
title: '请输入正确的手机号码'
|
title: '请输入正确的手机号码'
|
||||||
});
|
});
|
||||||
await registerVerify(that.mobile, 1)
|
await registerVerify(that.mobile, 1)
|
||||||
|
@ -239,7 +249,7 @@
|
||||||
if (!that.password) return that.$util.Tips({
|
if (!that.password) return that.$util.Tips({
|
||||||
title: '请填写密码'
|
title: '请填写密码'
|
||||||
});
|
});
|
||||||
if(that.checked.length === 0) return that.$util.Tips({
|
if (that.checked.length === 0) return that.$util.Tips({
|
||||||
title: '请勾选同意用户协议'
|
title: '请勾选同意用户协议'
|
||||||
});
|
});
|
||||||
that.loading = true
|
that.loading = true
|
||||||
|
@ -261,7 +271,7 @@
|
||||||
that.$util.Tips({
|
that.$util.Tips({
|
||||||
title: e
|
title: e
|
||||||
});
|
});
|
||||||
}).finally(()=>{
|
}).finally(() => {
|
||||||
that.loading = false
|
that.loading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -274,15 +284,20 @@
|
||||||
getUserInfo().then(res => {
|
getUserInfo().then(res => {
|
||||||
this.$store.commit("UPDATE_USERINFO", res.data);
|
this.$store.commit("UPDATE_USERINFO", res.data);
|
||||||
// let backUrl = this.$Cache.get(BACK_URL) || "/pages/index/index";
|
// let backUrl = this.$Cache.get(BACK_URL) || "/pages/index/index";
|
||||||
let backUrl = "/pages/member_application/index";
|
|
||||||
// let backUrl = "/pages/index/index";
|
// let backUrl = "/pages/index/index";
|
||||||
// if (backUrl.indexOf('/pages/users/login/index') !== -1) {
|
// if (backUrl.indexOf('/pages/users/login/index') !== -1) {
|
||||||
// backUrl = '/pages/index/index';
|
// backUrl = '/pages/index/index';
|
||||||
// }
|
// }
|
||||||
|
let backUrl = ''
|
||||||
|
if (this.isProperty && !res.data.isPromoter) {
|
||||||
|
backUrl = "/pages/users/promoter/index"
|
||||||
|
} else {
|
||||||
|
backUrl = "/pages/member_application/index"
|
||||||
|
}
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: backUrl
|
url: backUrl
|
||||||
});
|
});
|
||||||
}).finally(()=>{
|
}).finally(() => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -381,13 +396,14 @@
|
||||||
.login-wrapper {
|
.login-wrapper {
|
||||||
padding: 30rpx 52rpx;
|
padding: 30rpx 52rpx;
|
||||||
background: url('@/static/images/bg-linear.png') center 0 no-repeat;
|
background: url('@/static/images/bg-linear.png') center 0 no-repeat;
|
||||||
background-size:100% 672rpx;
|
background-size: 100% 672rpx;
|
||||||
|
|
||||||
.logo-wrap {
|
.logo-wrap {
|
||||||
margin: 185rpx 0 85rpx 0;
|
margin: 185rpx 0 85rpx 0;
|
||||||
display:flex;
|
display: flex;
|
||||||
align-items:center;
|
align-items: center;
|
||||||
img{
|
|
||||||
|
img {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -430,6 +446,7 @@
|
||||||
margin-bottom: 38rpx;
|
margin-bottom: 38rpx;
|
||||||
height: 98rpx;
|
height: 98rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
@ -498,14 +515,16 @@
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.protocol-wrap{
|
.protocol-wrap {
|
||||||
margin: 131rpx 0 80rpx 0;
|
margin: 131rpx 0 80rpx 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
.text{
|
|
||||||
|
.text {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #000;
|
color: #000;
|
||||||
.link{
|
|
||||||
|
.link {
|
||||||
color: #F35981;
|
color: #F35981;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,319 @@
|
||||||
|
<template>
|
||||||
|
<div class="login-wrapper">
|
||||||
|
<div class="logo-wrap">
|
||||||
|
<img src="/static/images/mallLogo.png" style="width:105rpx;height:105rpx;"></image>
|
||||||
|
<img src="/static/images/mall.png" style="width:233rpx;height:43rpx;"></image>
|
||||||
|
</div>
|
||||||
|
<view class="title">注册推广员</view>
|
||||||
|
<div class="whiteBg">
|
||||||
|
<div class="list">
|
||||||
|
<form @submit.prevent="submit">
|
||||||
|
<div class="item">
|
||||||
|
<div class="acea-row row-middle">
|
||||||
|
<text class="label">所属公司</text>
|
||||||
|
<input type="text" disabled class="texts" :value="tenantInfo.name || '--'"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<div class="acea-row row-middle">
|
||||||
|
<text class="label">手机号</text>
|
||||||
|
<input type="text" class="texts" :value="userInfo.mobile || '--'" disabled />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<div class="acea-row row-middle">
|
||||||
|
<text class="label">姓名</text>
|
||||||
|
<input type="text" v-model="nickname" maxlength="10" class="texts" placeholder="请输入" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<button class="logon" @click="onRegister" :disabled="loading" :loading="loading">注册推广员</button>
|
||||||
|
</div>
|
||||||
|
<div class="bottom"></div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
mapGetters
|
||||||
|
} from 'vuex'
|
||||||
|
import {
|
||||||
|
registerPromoter
|
||||||
|
} from "@/api/user"
|
||||||
|
export default {
|
||||||
|
name: 'Register',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
nickname: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['tenantInfo', 'userInfo'])
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async onRegister() {
|
||||||
|
this.loading = true
|
||||||
|
try {
|
||||||
|
const res = await registerPromoter({
|
||||||
|
nickname: this.nickname,
|
||||||
|
mobile: this.userInfo.mobile,
|
||||||
|
status: 1,
|
||||||
|
sourceType: 2
|
||||||
|
})
|
||||||
|
this.$util.Tips({
|
||||||
|
title: res.code === 0 ? '注册成功' : res.msg
|
||||||
|
}, {
|
||||||
|
tab: 1,
|
||||||
|
url: '/pages/member_application/index'
|
||||||
|
})
|
||||||
|
} catch (err) {
|
||||||
|
//TODO handle the exception
|
||||||
|
this.$util.Tips({
|
||||||
|
title: err
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
page {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.appLogin {
|
||||||
|
margin-top: 60rpx;
|
||||||
|
|
||||||
|
.hds {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #B4B4B4;
|
||||||
|
|
||||||
|
.line {
|
||||||
|
width: 68rpx;
|
||||||
|
height: 1rpx;
|
||||||
|
background: #CCCCCC;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 68rpx;
|
||||||
|
height: 68rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.apple-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-left: 30rpx;
|
||||||
|
background: #000;
|
||||||
|
border-radius: 34rpx;
|
||||||
|
font-size: 40rpx;
|
||||||
|
|
||||||
|
.icon-s-pingguo {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 40rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wx {
|
||||||
|
margin-right: 30rpx;
|
||||||
|
background-color: #61C64F;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mima {
|
||||||
|
background-color: #28B3E9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.yanzheng {
|
||||||
|
background-color: #F89C23;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.code img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.acea-row.row-middle {
|
||||||
|
input {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-wrapper {
|
||||||
|
padding: 30rpx 52rpx;
|
||||||
|
background: url('@/static/images/bg-linear.png') center 0 no-repeat;
|
||||||
|
background-size:100% 672rpx;
|
||||||
|
|
||||||
|
.logo-wrap {
|
||||||
|
margin: 185rpx 0 85rpx 0;
|
||||||
|
display:flex;
|
||||||
|
align-items:center;
|
||||||
|
img{
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shading {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
/* #ifdef APP-VUE */
|
||||||
|
margin-top: 50rpx;
|
||||||
|
/* #endif */
|
||||||
|
/* #ifndef APP-VUE */
|
||||||
|
|
||||||
|
margin-top: 200rpx;
|
||||||
|
/* #endif */
|
||||||
|
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 180rpx;
|
||||||
|
height: 180rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.whiteBg {
|
||||||
|
margin-top: 46rpx;
|
||||||
|
|
||||||
|
.list {
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
margin-bottom: 38rpx;
|
||||||
|
height: 98rpx;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code {
|
||||||
|
width: 197rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 96rpx;
|
||||||
|
background: #FFF3F6;
|
||||||
|
border: 1px solid #F54275;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #F03A76;
|
||||||
|
margin-left: 19rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-middle {
|
||||||
|
position: relative;
|
||||||
|
padding: 28rpx;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #BFBFBF;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
flex: 1;
|
||||||
|
&.clear{
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label{
|
||||||
|
width: 120rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.texts {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 28rpx;
|
||||||
|
height: 42rpx;
|
||||||
|
line-height: 42rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 28rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.logon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
height: 87rpx;
|
||||||
|
margin-top: 99rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 32rpx;
|
||||||
|
background: linear-gradient(0deg, #E63163 0%, #FF819F 100%);
|
||||||
|
border-radius: 44rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
margin: 125rpx 20rpx 0 20rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #000;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.protocol-wrap {
|
||||||
|
margin: 131rpx 0 80rpx 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.text {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #000;
|
||||||
|
|
||||||
|
.link {
|
||||||
|
color: #F35981;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="register-success-wrap">
|
<view class="register-success-wrap">
|
||||||
<image src="@/static/images/logo.png" class="icon"></image>
|
<image src="@/static/images/mallLogo.png" class="icon"></image>
|
||||||
<view class="text">恭喜您,注册成功</view>
|
<view class="text">恭喜您,注册成功</view>
|
||||||
<u-button class="logon" @click="onBackLogin">返回登录</u-button>
|
<u-button class="logon" @click="onBackLogin">进入首页</u-button>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
methods: {
|
methods: {
|
||||||
onBackLogin() {
|
onBackLogin() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/users/login/index'
|
url: '/pages/member_application/index'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ export default {
|
||||||
tenantId: state => state.app.tenantId,
|
tenantId: state => state.app.tenantId,
|
||||||
openId: state => state.app.openId,
|
openId: state => state.app.openId,
|
||||||
spreadId: state => state.app.spreadId,
|
spreadId: state => state.app.spreadId,
|
||||||
|
isProperty: state => state.app.isProperty,
|
||||||
homeActive: state => state.app.homeActive,
|
homeActive: state => state.app.homeActive,
|
||||||
home: state => state.app.home,
|
home: state => state.app.home,
|
||||||
chatUrl: state => state.app.chatUrl,
|
chatUrl: state => state.app.chatUrl,
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {
|
||||||
REFRESH_TOKEN,
|
REFRESH_TOKEN,
|
||||||
UID,
|
UID,
|
||||||
TENANT_ID,
|
TENANT_ID,
|
||||||
|
IS_PROPERTY,
|
||||||
OPEN_ID,
|
OPEN_ID,
|
||||||
SPREAD_ID,
|
SPREAD_ID,
|
||||||
PLATFORM
|
PLATFORM
|
||||||
|
@ -26,6 +27,7 @@ const state = {
|
||||||
tenantId: Cache.get(TENANT_ID) || '',
|
tenantId: Cache.get(TENANT_ID) || '',
|
||||||
spreadId: Cache.get(SPREAD_ID) || '',
|
spreadId: Cache.get(SPREAD_ID) || '',
|
||||||
openId: Cache.get(OPEN_ID) || '',
|
openId: Cache.get(OPEN_ID) || '',
|
||||||
|
isProperty: false,
|
||||||
homeActive: false,
|
homeActive: false,
|
||||||
chatUrl: Cache.get('chatUrl') || '',
|
chatUrl: Cache.get('chatUrl') || '',
|
||||||
systemPlatform: Cache.get(PLATFORM)?Cache.get(PLATFORM):'',
|
systemPlatform: Cache.get(PLATFORM)?Cache.get(PLATFORM):'',
|
||||||
|
@ -62,6 +64,9 @@ const mutations = {
|
||||||
UPDATE_LOGIN(state, token) {
|
UPDATE_LOGIN(state, token) {
|
||||||
state.token = token;
|
state.token = token;
|
||||||
},
|
},
|
||||||
|
SET_IS_PROPERTY(state, value){
|
||||||
|
state.isProperty = value
|
||||||
|
},
|
||||||
LOGOUT(state) {
|
LOGOUT(state) {
|
||||||
state.token = undefined;
|
state.token = undefined;
|
||||||
state.uid = undefined
|
state.uid = undefined
|
||||||
|
|
Loading…
Reference in New Issue