绿满眶商城微信小程序-uniapp
peng
1 天以前 89efee9a2e20fc04b4537d859917b47cf68a814c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<template>
  <div class="wrapper">
       <u-navbar :border-bottom="false"></u-navbar>
    <div>
      <div class="title">供应商入驻</div>
      <div class="step-list">
        <div
          class="step-item"
          :class="{ active: current == index }"
          v-for="(item, index) in entrySteps"
          :key="index"
        >
          {{ item.title }}
        </div>
      </div>
      <div :class="isAgreed ? 'submit' : 'noSubmit'" @click="keepOn()" :disabled="!isAgreed">开始填写</div>
      <div class="agreement-container"  >
        <label class="agreement-label">
          <checkbox :checked="isAgreed" class="agreement-checkbox" :disabled="isDisabled" />
          <text class="agreement-text" @click="getEntryNotice">
            查看供应商<text class="agreement-link">《入驻协议》</text>
          </text>
        </label>
      </div>
          
    </div>
  </div>
</template>
 
<script>
import '@/components/uview-components/uview-ui';
 
import { getCompanyDetail } from "@/api/entry";
export default {
 
  data() {
    return {
        isDisabled:true,
        isAgreed:false,
      current: 999,
      entrySteps: [
        {
          title: "填写资质信息",
          value: "APPLY",
        },
        {
          title: "提交审核",
          value: "APPLYING",
        },
      ],
 
      storeStatusWay: [
        {
          title: "申请已通过,请联系管理员",
          value: "OPEN",
        },
        {
          title: "店铺已关闭,重申请联系管理员",
          value: "CLOSED",
        },
        {
          title: "审核未通过,请修改资质信息",
          value: "REFUSED",
        },
      ],
 
      companyData: "", // 公司信息
    };
  },
  onShow() {
    if(this.$options.filters.tipsToLogin()){
        this.init();
    }
    if (uni.getStorageSync('agreed')) {
      this.isAgreed = true; // 自动勾选
      uni.removeStorageSync('agreed'); // 清除标记
    }
  },
 
  mounted() {},
 
  onLoad(options) {},
  methods: {
    getEntryNotice() {
      uni.navigateTo({
        url: "/pages/mine/help/tips?type=STORE_REGISTER",
      });
    },
    keepOn() {
      if (this.companyData && this.companyData.storeDisable == "OPEN") {
        uni.showToast({
          title:"审核已通过",
          icon:"none"
        })
      } else {
        uni.navigateTo({
          url: "/pages/passport/entry/seller/control",
        });
      }
    },
    async init() {
      this.entrySteps = [
        {
          title: "填写资质信息",
          value: "APPLY",
        },
        {
          title: "提交审核",
          value: "APPLYING",
        },
      ];
      const res = await getCompanyDetail();
      console.log(res)
      if (res.data.success) {
          
        this.companyData = res.data.result;
 
        if (this.companyData) {
          this.storeStatusWay.forEach((item) => {
            if (item.value == this.companyData.storeDisable) {
              this.entrySteps.push(item);
            }
          });
 
          this.current =
            this.entrySteps.findIndex(
              (item) => item.value == this.companyData.storeDisable
            ) || 0;
        } else {
          this.current = 0;
        }
      }
    },
  },
};
</script>
<style>
page {
  background: #fff;
}
</style>
<style lang="scss" scoped>
    .agreement-container {
      display: flex;
      justify-content: center;
      margin-top: 20rpx;
    }
    /* 勾选框和文字对齐 */
    .agreement-label {
      display: flex;
      align-items: center;
    }
@import url("./entry.scss");
.wrapper {
  padding: 0 80rpx;
}
 
.title {
  padding-top: calc(104rpx);
  font-style: normal;
  line-height: 1;
  font-weight: 500;
  font-size: 56rpx;
  color: #333;
  padding-left: 20rpx;
}
.step-item {
  padding: 30rpx 20rpx;
  font-size: 40rpx;
  font-weight: bold;
  color: #666;
}
.step-list {
  margin: 80rpx 0;
  overflow: hidden;
}
.active {
  color: $light-color;
  background: rgba($color: $light-color, $alpha: 0.1);
  border-radius: 20rpx;
}
.noSubmit{
    color: #fff;
    margin-top: 120rpx;
    background: rgba(204, 204, 204, 0.8);;
}
.submit {
  color: #fff;
  margin-top: 120rpx;
  background: rgba($light-color, 0.8);
}
.notice {
  margin-top: 40rpx;
  color: #333;
  background: $bg-color;
}
</style>