Commit e8253136 by gonglei

加入框架代码

1 parent 77e2a820
...@@ -140,7 +140,7 @@ public class LoginController extends LoginCommonController { ...@@ -140,7 +140,7 @@ public class LoginController extends LoginCommonController {
account.setEnabled(true); account.setEnabled(true);
account.setCertifiedState(Account.CertifiedState.UNCERTIFIED); account.setCertifiedState(Account.CertifiedState.UNCERTIFIED);
account.setAccountType(Account.AccountType.COMMON); account.setAccountType(Account.AccountType.COMMON);
account = accountService.addAccount(account); account = accountService.addAccount(account, maLoginRequest.getRecommendCode());
} else { } else {
if (!account.isEnabled()) { if (!account.isEnabled()) {
accountInfo.setStatus(403); accountInfo.setStatus(403);
......
...@@ -94,9 +94,16 @@ public class AccountService extends AbstractAuctionService { ...@@ -94,9 +94,16 @@ public class AccountService extends AbstractAuctionService {
* @return 个人账户实例对象 * @return 个人账户实例对象
*/ */
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public Account addAccount(Account account) { public Account addAccount(Account account, String recommendCode) {
account.setLastLoginTime(LocalDateTime.now()); account.setLastLoginTime(LocalDateTime.now());
return accountDao.save(account);
Account save = accountDao.save(account);
if (StringUtils.hasText(recommendCode)) {
accountTagDao.findTopByRecommendCode(recommendCode).ifPresent(accountTag -> {
save.getAccountTags().add(accountTag);
});
}
return save;
} }
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
......
...@@ -32,6 +32,11 @@ public class MaLoginRequest { ...@@ -32,6 +32,11 @@ public class MaLoginRequest {
private String openId; private String openId;
/**
* 推荐码
*/
private String recommendCode;
// /** // /**
// * 历史缓存自动token登录 // * 历史缓存自动token登录
// */ // */
......
...@@ -51,14 +51,14 @@ ...@@ -51,14 +51,14 @@
</view> </view>
</view> </view>
</view> </view>
<view class="form-section"> <!-- <view class="form-section">-->
<uni-forms-item label="" name="recommendCode"> <!-- <uni-forms-item label="" name="recommendCode">-->
<view class="form-item"> <!-- <view class="form-item">-->
<text class="label-text">推荐码</text> <!-- <text class="label-text">推荐码</text>-->
<uni-easyinput v-model="formData.recommendCode" placeholder="请输入推荐码" :inputBorder="false"/> <!-- <uni-easyinput v-model="formData.recommendCode" placeholder="请输入推荐码" :inputBorder="false"/>-->
</view> <!-- </view>-->
</uni-forms-item> <!-- </uni-forms-item>-->
</view> <!-- </view>-->
<!-- 提交按钮 --> <!-- 提交按钮 -->
<view class="submit-button-container"> <view class="submit-button-container">
<van-button type="primary" :disabled="!isFormValid" round @click="submitForm" block>提交</van-button> <van-button type="primary" :disabled="!isFormValid" round @click="submitForm" block>提交</van-button>
...@@ -96,7 +96,6 @@ export default class PersonCertificationPage extends Vue { ...@@ -96,7 +96,6 @@ export default class PersonCertificationPage extends Vue {
accountName: { accountName: {
rules: [{required: true, errorMessage: '请输入真实姓名'}] rules: [{required: true, errorMessage: '请输入真实姓名'}]
}, },
idCard: { idCard: {
rules: [ rules: [
{required: true, errorMessage: '请输入身份证号码'}, {required: true, errorMessage: '请输入身份证号码'},
......
...@@ -729,38 +729,6 @@ export default class AuctionVehiclePage extends Vue { ...@@ -729,38 +729,6 @@ export default class AuctionVehiclePage extends Vue {
this.isAgreed = !this.isAgreed; this.isAgreed = !this.isAgreed;
} }
/**
* 支付保证金
*/
confirmRecharge(): void {
const recharge = new Recharge();
uni.showLoading({title: '正在支付保证金...', mask: true});
const that = this;
DepositController.addDeposit(this.axios, this.aucvehId).then(res => {
const result = res.data;
uni.requestPayment({
provider: 'wxpay',
timeStamp: result.timeStamp,
nonceStr: result.nonceStr,
orderInfo: undefined,
package: result.packageValue,
signType: result.signType,
paySign: result.paySign,
complete(result: any): void {
}, fail(error: any): void {
//支付失败时出发,比如取消支付、余额不足等
setTimeout(() => {
uni.showToast({title: error, icon: 'none'});
}, 300);
}, success(result: any): void {
// //触发该success时已经是输入密码支付成功后触发,可做一些页面跳转和成功提示
setTimeout(() => {
that.commitBid();
}, 800);
},
});
}).finally(() => uni.hideLoading());
}
// 提交出价 // 提交出价
submitBid() { submitBid() {
...@@ -810,8 +778,7 @@ export default class AuctionVehiclePage extends Vue { ...@@ -810,8 +778,7 @@ export default class AuctionVehiclePage extends Vue {
confirmText: '立即缴纳', confirmText: '立即缴纳',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
this.confirmRecharge(); uni.navigateTo({url: '/module/deposit/RechargePage'});
// uni.navigateTo({url: '/module/deposit/RechargePage'});
} }
} }
}); });
......
...@@ -90,12 +90,14 @@ export default class LoginPage extends Vue { ...@@ -90,12 +90,14 @@ export default class LoginPage extends Vue {
} }
loginByPhone(appId: string, code: string, e: any) { loginByPhone(appId: string, code: string, e: any) {
const recommendCode = uni.getStorageSync('recommendCode');
const url = 'ma/' + appId + '/phoneLogin'; const url = 'ma/' + appId + '/phoneLogin';
uni.showLoading({title: '正在登录中...', mask: true}); uni.showLoading({title: '正在登录中...', mask: true});
this.axios.post(url, { this.axios.post(url, {
encryptedData: e.detail.encryptedData, encryptedData: e.detail.encryptedData,
iv: e.detail.iv, iv: e.detail.iv,
code: code, code: code,
recommendCode: recommendCode
}).then((response: any) => { }).then((response: any) => {
console.log(response); console.log(response);
const accountInfo: AccountInfo = response.data; const accountInfo: AccountInfo = response.data;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!