123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <!-- 页面 -->
- <template>
- <su-popup
- :show="state.show"
- type="center"
- round="10"
- @close="state.show = false"
- :isMaskClick="false"
- maskBackgroundColor="rgba(0, 0, 0, 0.7)"
- >
- <view class="notice-box">
- <view class="img-wrap">
- <image
- class="notice-img"
- :src="sheep.$url.static(state.event.image)"
- mode="aspectFill"
- ></image>
- </view>
- <view class="notice-title">{{ state.event.title }}</view>
- <view class="notice-detail">{{ state.event.subtitle }}</view>
- <button
- class="ss-reset-button notice-btn ui-Shadow-Main ui-BG-Main-Gradient"
- @tap="onTap(state.event.action)"
- >
- {{ state.event.button }}
- </button>
- <button class="ss-reset-button back-btn" @tap="sheep.$router.back()"> {{$t('common.back')}}</button>
- </view>
- </su-popup>
- </template>
- <script setup>
- import sheep from '@/sheep';
- import { reactive, watch } from 'vue';
- const props = defineProps({
- error: {
- type: Number,
- default: 0,
- },
- });
- const emits = defineEmits(['getAgentInfo']);
- const state = reactive({
- event: {},
- show: false,
- });
- watch(
- () => props.error,
- (error) => {
- if (error !== 0 && error !== 100) {
- state.event = eventMap[error];
- state.show = true;
- }
- },
- );
- async function onTap(eventName) {
- switch (eventName) {
- case 'back': // 返回
- sheep.$router.back();
- break;
- case 'apply': // 需提交资料
- sheep.$router.go('/pages/commission/apply');
- break;
- case 'reApply': // 直接重新申请
- let { error } = await sheep.$api.commission.apply();
- if (code === 1) {
- emits('getAgentInfo');
- }
- break;
- }
- }
- const eventMap = {
- // 关闭
- 101: {
- image: '/assets/addons/shopro/uniapp/commission/close.png',
- title: $t('commission.auth.closed'),
- subtitle: $t('commission.auth.functionDisabled'),
- button: $t('commission.auth.ok'),
- action: 'back',
- },
- // 禁用
- 102: {
- image: '/assets/addons/shopro/uniapp/commission/forbidden.png',
- title: $t('commission.auth.accountDisabled'),
- subtitle: $t('commission.auth.functionDisabled'),
- button: $t('commission.auth.ok'),
- action: 'back',
- },
- // 补充信息
- 103: {
- image: '/assets/addons/shopro/uniapp/commission/apply.png',
- title: $t('commission.auth.perfectInfo'),
- subtitle: $t('commission.auth.perfectTips'),
- button: $t('commission.auth.perfect'),
- action: 'apply',
- },
- // 审核中
- 104: {
- image: '/assets/addons/shopro/uniapp/commission/pending.png',
- title: $t('commission.auth.underReview'),
- subtitle: $t('commission.auth.waitResult'),
- button: $t('commission.auth.ok'),
- action: 'back',
- },
- // 重新提交
- 105: {
- image: '/assets/addons/shopro/uniapp/commission/reject.png',
- title: $t('commission.auth.notPass'),
- subtitle: $t('commission.auth.resubmitTips'),
- button: $t('commission.auth.resubmit'),
- action: 'apply',
- },
- // 直接重新申请
- 106: {
- image: '/assets/addons/shopro/uniapp/commission/reject.png',
- title: $t('commission.auth.notPass'),
- subtitle: $t('commission.auth.resubmitTry'),
- button: $t('commission.auth.resubmit'),
- action: 'reApply',
- },
- // 冻结
- 107: {
- image: '/assets/addons/shopro/uniapp/commission/freeze.png',
- title: $t('commission.auth.accountFrozen'),
- subtitle: $t('commission.auth.serviceTips'),
- button: $t('commission.auth.contact'),
- action: 'chat',
- },
- };
- </script>
- <style lang="scss" scoped>
- .notice-box {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- background-color: #fff;
- width: 612rpx;
- min-height: 658rpx;
- background: #ffffff;
- padding: 30rpx;
- border-radius: 20rpx;
- .img-wrap {
- margin-bottom: 50rpx;
- .notice-img {
- width: 180rpx;
- height: 170rpx;
- }
- }
- .notice-title {
- font-size: 35rpx;
- font-weight: bold;
- color: #333;
- margin-bottom: 28rpx;
- }
- .notice-detail {
- font-size: 28rpx;
- font-weight: 400;
- color: #999999;
- line-height: 36rpx;
- margin-bottom: 50rpx;
- }
- .notice-btn {
- width: 492rpx;
- line-height: 70rpx;
- border-radius: 35rpx;
- font-size: 28rpx;
- font-weight: 500;
- color: #ffffff;
- margin-bottom: 10rpx;
- }
- .back-btn {
- width: 492rpx;
- line-height: 70rpx;
- font-size: 28rpx;
- font-weight: 500;
- color: var(--ui-BG-Main-gradient);
- background: none;
- }
- }
- </style>
|