|
|
@@ -38,13 +38,46 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
+ onShow() {
|
|
|
+ this.fetchApplyStatus();
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ // 进入页面时拉取最新审核状态,避免本地缓存停留在「审核中」
|
|
|
+ fetchApplyStatus() {
|
|
|
+ this.$http.post('/groupmeal/gmMerchantApplicationRecord/isApply', {}).then((res) => {
|
|
|
+ if (res.data.code !== 200 || !res.data.result) return;
|
|
|
+ const apiStatus = res.data.result.status;
|
|
|
+ let localStatus = 0;
|
|
|
+ if (apiStatus == 0) localStatus = 3;
|
|
|
+ else if (apiStatus == 1) localStatus = 1;
|
|
|
+ else if (apiStatus == 2) localStatus = 2;
|
|
|
+ this.status = localStatus;
|
|
|
+ uni.setStorageSync('merchantDish_applyStatus', localStatus);
|
|
|
+ });
|
|
|
+ },
|
|
|
onSubmit() {
|
|
|
- // 假数据:模拟报名成功进入审核
|
|
|
- this.status = 3;
|
|
|
- uni.setStorageSync('merchantDish_applyStatus', 3);
|
|
|
- this.modalText.content = '报名成功,请等待平台审核';
|
|
|
- this.$refs.myModal.onOpen();
|
|
|
+ this.$http.post('/groupmeal/gmMerchantApplicationRecord/apply', {}).then((res) => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ const apiStatus = res.data.result.status;
|
|
|
+ let content = '';
|
|
|
+ // 本地约定:0未报名 1已通过 2驳回 3审核中(接口:0审核中 1通过 2驳回)
|
|
|
+ let localStatus = 0;
|
|
|
+ if (apiStatus == 0) {
|
|
|
+ content = '报名成功,请等待平台审核';
|
|
|
+ localStatus = 3;
|
|
|
+ } else if (apiStatus == 1) {
|
|
|
+ content = '审核通过,快去上传套餐商品开展活动吧';
|
|
|
+ localStatus = 1;
|
|
|
+ } else if (apiStatus == 2) {
|
|
|
+ content = '很抱歉,您没有通过平台审核,如有疑问请联系平台客服。';
|
|
|
+ localStatus = 2;
|
|
|
+ }
|
|
|
+ this.status = localStatus;
|
|
|
+ uni.setStorageSync('merchantDish_applyStatus', localStatus);
|
|
|
+ this.modalText.content = content;
|
|
|
+ this.$refs.myModal.onOpen();
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
onConfirm() {
|
|
|
if (this.status == 1) {
|