feat(commission): 支持计奖商品参与设置、独立分成与多规格规则,完善团队中心与微信快捷登录

这个提交包含在:
chen
2026-09-17 19:27:17 +08:00
父节点 3c7df9688b
当前提交 829e88cfa9
共有 54 个文件被更改,包括 3536 次插入 和 666 次删除

查看文件

@@ -0,0 +1,138 @@
<!-- 微信小程序手机号一键快捷登录 - mpMobileLogin -->
<template>
<view class="mp-mobile-login-wrap">
<!-- 标题栏 -->
<view class="head-box ss-m-b-50">
<view class="ss-flex ss-m-b-16">
<view class="head-title head-title-animation">手机号快捷登录</view>
</view>
<view class="head-subtitle">授权微信手机号,享有一键快捷登录体验</view>
</view>
<!-- 微信手机号一键登录主按钮 -->
<view class="btn-box ss-m-b-40">
<button
class="ss-reset-button wechat-quick-btn ss-flex ss-row-center ss-col-center"
open-type="getPhoneNumber"
@getphonenumber="onGetPhoneNumber"
>
<text class="cicon-wechat ss-m-r-16 wechat-icon"></text>
<text class="btn-text">手机号一键快捷登录</text>
</button>
</view>
<!-- 备选切换登录方式 -->
<view class="switch-box ss-flex ss-row-center ss-col-center">
<view class="switch-item" @tap="showAuthModal('smsLogin')">验证码登录</view>
<view class="divider"></view>
<view class="switch-item" @tap="showAuthModal('accountLogin')">账号密码登录</view>
</view>
</view>
</template>
<script setup>
import sheep from '@/sheep';
import { showAuthModal, closeAuthModal } from '@/sheep/hooks/useModal';
const props = defineProps({
agreeStatus: {
type: Boolean,
default: false,
},
});
const emits = defineEmits(['onConfirm']);
async function onGetPhoneNumber(e) {
if (!props.agreeStatus) {
emits('onConfirm', true);
sheep.$helper.toast('请阅读并勾选协议');
return;
}
if (e.detail?.errMsg !== 'getPhoneNumber:ok') {
return;
}
uni.showLoading({
title: '登录中...',
mask: true,
});
try {
const result = await sheep.$platform.useProvider('wechat').mobileLogin(e.detail);
if (result) {
closeAuthModal();
await sheep.$store('user').loginAfter();
sheep.$helper.toast('登录成功');
} else {
sheep.$helper.toast('登录失败,请重试');
}
} catch (err) {
console.error('mobileLogin error', err);
sheep.$helper.toast('登录异常,请稍后重试');
} finally {
uni.hideLoading();
}
}
</script>
<style lang="scss" scoped>
@import '../index.scss';
.mp-mobile-login-wrap {
padding-top: 10rpx;
}
.btn-box {
width: 100%;
margin-top: 50rpx;
}
.wechat-quick-btn {
width: 100%;
height: 88rpx;
background: #07c160;
border-radius: 44rpx;
color: #ffffff;
box-shadow: 0 8rpx 16rpx rgba(7, 193, 96, 0.25);
transition: all 0.2s;
&:active {
opacity: 0.9;
transform: scale(0.98);
}
.wechat-icon {
font-size: 40rpx;
line-height: 1;
}
.btn-text {
font-size: 32rpx;
font-weight: 500;
letter-spacing: 1rpx;
}
}
.switch-box {
margin-top: 36rpx;
font-size: 26rpx;
color: #888888;
.switch-item {
padding: 10rpx 20rpx;
font-size: 26rpx;
color: #666666;
&:active {
color: var(--ui-BG-Main);
}
}
.divider {
width: 2rpx;
height: 24rpx;
background-color: #dddddd;
}
}
</style>

查看文件

@@ -8,6 +8,13 @@
@click="closeAuthModal"
/> -->
<view class="login-wrap">
<!-- 0. 微信小程序手机号一键快捷登录 mpMobileLogin -->
<mp-mobile-login
v-if="authType === 'mpMobileLogin'"
:agreeStatus="state.protocol"
@onConfirm="onConfirm"
/>
<!-- 1. 账号密码登录 accountLogin -->
<account-login
v-if="authType === 'accountLogin'"
@@ -56,7 +63,7 @@
>立即注册</button
>
<view class="or-title">或</view>
<button class="ss-reset-button login-btn" @tap="thirdLogin('wechat')">快捷登录</button>
<button class="ss-reset-button login-btn" @tap="showAuthModal('mpMobileLogin')">快捷登录</button>
<view class="circle"></view>
</view>
@@ -99,7 +106,7 @@
</view>
<view
v-if="['accountLogin', 'smsLogin', 'smsRegister'].includes(authType)"
v-if="['accountLogin', 'smsLogin', 'smsRegister', 'mpMobileLogin'].includes(authType)"
class="agreement-box ss-flex ss-row-center"
:class="{ shake: currentProtocol }"
>
@@ -136,6 +143,7 @@
<script setup>
import { computed, reactive, ref } from 'vue';
import sheep from '@/sheep';
import mpMobileLogin from './components/mp-mobile-login.vue';
import accountLogin from './components/account-login.vue';
import smsLogin from './components/sms-login.vue';
import smsRegister from './components/sms-register.vue';