feat: 修改入驻为认证门店相关文案
This commit is contained in:
parent
eb39ad89cb
commit
f635a06acb
@ -3,6 +3,23 @@ import {
|
|||||||
} from './config.js'
|
} from './config.js'
|
||||||
const timeout = 5000;
|
const timeout = 5000;
|
||||||
let showModal = false
|
let showModal = false
|
||||||
|
|
||||||
|
// 定义公开API白名单
|
||||||
|
const publicApis = [
|
||||||
|
'/beer/list', // 啤酒列表
|
||||||
|
'/beer/detail', // 啤酒详情
|
||||||
|
'/activity/list', // 活动列表
|
||||||
|
'/activity/detail', // 活动详情
|
||||||
|
'/bar/detail', // 酒吧详情
|
||||||
|
'/bar/list', // 酒吧列表
|
||||||
|
'/common/', // 公共接口
|
||||||
|
]
|
||||||
|
|
||||||
|
// 检查是否是公开API
|
||||||
|
const isPublicApi = (url) => {
|
||||||
|
return publicApis.some(api => url.includes(api))
|
||||||
|
}
|
||||||
|
|
||||||
export default (params) => {
|
export default (params) => {
|
||||||
let url = params.url;
|
let url = params.url;
|
||||||
let method = params.method || "get";
|
let method = params.method || "get";
|
||||||
@ -33,7 +50,7 @@ export default (params) => {
|
|||||||
console.log(res.data, '接口返回值')
|
console.log(res.data, '接口返回值')
|
||||||
if (res.data.code == 200) {
|
if (res.data.code == 200) {
|
||||||
resolve(res.data);
|
resolve(res.data);
|
||||||
} else if (res.data.code == 401) {
|
} else if (res.data.code == 401 && !isPublicApi(url)) {
|
||||||
uni.clearStorageSync()
|
uni.clearStorageSync()
|
||||||
if (showModal) return
|
if (showModal) return
|
||||||
showModal = true
|
showModal = true
|
||||||
@ -50,33 +67,30 @@ export default (params) => {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.data.msg,
|
title: res.data.msg || '请求失败',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 3000,
|
duration: 3000,
|
||||||
})
|
})
|
||||||
reject(res.data)
|
reject(res.data)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '服务器异常',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
reject(response)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '网络异常',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
reject(err)
|
||||||
},
|
},
|
||||||
// fail(err) {
|
|
||||||
// console.log(err)
|
|
||||||
// if (err.errMsg.indexOf('request:fail') !== -1) {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '网络异常',
|
|
||||||
// icon: "error",
|
|
||||||
// duration: 2000
|
|
||||||
// })
|
|
||||||
// } else {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '未知异常',
|
|
||||||
// duration: 2000
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// reject(err);
|
|
||||||
|
|
||||||
// },
|
|
||||||
// complete() {
|
// complete() {
|
||||||
// }
|
// }
|
||||||
});
|
});
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<checkbox-group @change="checkboxChange" class="checkbox-group">
|
<checkbox-group @change="checkboxChange" class="checkbox-group">
|
||||||
<checkbox value="1" :checked="isAgree" color="#19367A" class="checkbox" />
|
<checkbox value="1" :checked="isAgree" color="#19367A" class="checkbox" />
|
||||||
<text class="agreement-text">我已阅读并同意</text>
|
<text class="agreement-text">我已阅读并同意</text>
|
||||||
<text class="link" @click="toAgreement">《商家入驻协议》</text>
|
<text class="link" @click="toAgreement">《软件使用协议》</text>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -106,6 +106,8 @@
|
|||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
this.getUserInfoFun()
|
this.getUserInfoFun()
|
||||||
this.getBarInfoFun()
|
this.getBarInfoFun()
|
||||||
|
// 登录成功后立即关闭弹窗
|
||||||
|
this.close()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -140,8 +142,9 @@
|
|||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
this.getUserInfoFun()
|
this.getUserInfoFun()
|
||||||
this.getBarInfoFun()
|
this.getBarInfoFun()
|
||||||
|
// 登录成功后立即关闭弹窗
|
||||||
|
this.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
@ -150,13 +153,12 @@
|
|||||||
if (res.user && res.user.barId) {
|
if (res.user && res.user.barId) {
|
||||||
this.userInfo = res.user
|
this.userInfo = res.user
|
||||||
uni.setStorageSync('userInfo', res.user)
|
uni.setStorageSync('userInfo', res.user)
|
||||||
this.close()
|
|
||||||
|
|
||||||
this.$emit('loginSuccess')
|
this.$emit('loginSuccess')
|
||||||
} else {
|
} else {
|
||||||
|
// 移除自动关闭弹窗的逻辑
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '您还未入驻,请选入驻',
|
content: '您还未认证门店,请先认证',
|
||||||
showCancel: true,
|
showCancel: true,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
|
15
et --hard 6d203c0
Normal file
15
et --hard 6d203c0
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
[33ma58ff14[m[33m ([m[1;36mHEAD[m[33m -> [m[1;32mdevs[m[33m)[m HEAD@{0}: reset: moving to a58ff14
|
||||||
|
[33m6d203c0[m HEAD@{1}: reset: moving to HEAD
|
||||||
|
[33m6d203c0[m HEAD@{2}: commit: 更新啤酒评分写酒评页面UI交互方式
|
||||||
|
[33meb39ad8[m[33m ([m[1;31morigin/devs[m[33m)[m HEAD@{3}: commit: feat: 1. 优化啤酒币页面登录验证 2. 添加商家入驻协议页面 3. 添加联系二维码
|
||||||
|
[33m94415fb[m HEAD@{4}: commit: feat: 登陆弹窗优化,添加商家入驻协议页面,登录页面优化,添加添加企业微信二维码,啤酒币页面逻辑判定。
|
||||||
|
[33m30c802c[m HEAD@{5}: commit: 更新:1. 优化注册页面逻辑 2. 更新API请求配置
|
||||||
|
[33m9c4f90a[m HEAD@{6}: commit: feat: 优化新酒页面布局,配置啤啤猩球对接
|
||||||
|
[33me5441ad[m HEAD@{7}: reset: moving to origin/devs
|
||||||
|
[33me5441ad[m HEAD@{8}: commit: feat: optimize pages style and functionality
|
||||||
|
[33ma58ff14[m[33m ([m[1;36mHEAD[m[33m -> [m[1;32mdevs[m[33m)[m HEAD@{9}: commit: feat: optimize activity list page
|
||||||
|
[33md53c847[m HEAD@{10}: commit: fix: 优化搜索栏和筛选栏的布局,修复ui样式问题
|
||||||
|
[33m3081fcd[m HEAD@{11}: commit: feat: 优化首页搜索功能交互,添加默认头像
|
||||||
|
[33m05d27af[m HEAD@{12}: reset: moving to origin/devs
|
||||||
|
[33m5a3853f[m[33m ([m[1;32mmaster[m[33m)[m HEAD@{13}: checkout: moving from master to devs
|
||||||
|
[33m5a3853f[m[33m ([m[1;32mmaster[m[33m)[m HEAD@{14}: commit (initial): 初始化提交:完成活动列表页面功能
|
@ -171,7 +171,7 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/index/userAgreement",
|
"path": "pages/index/userAgreement",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "商家入驻协议",
|
"navigationBarTitleText": "软件使用协议",
|
||||||
"navigationBarBackgroundColor": "#19367A",
|
"navigationBarBackgroundColor": "#19367A",
|
||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "white"
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@
|
|||||||
res.data.forEach(it => {
|
res.data.forEach(it => {
|
||||||
if (it.bannerType == 'homeAD') { // 开屏广告
|
if (it.bannerType == 'homeAD') { // 开屏广告
|
||||||
this.ADList.push(it)
|
this.ADList.push(it)
|
||||||
} else if (it.bannerType == 'homeJoin') { // 入驻
|
} else if (it.bannerType == 'homeJoin') { // 认证门店
|
||||||
this.bannerJoin = it
|
this.bannerJoin = it
|
||||||
} else if (it.bannerType == 'homeBanner') { // 首页banner
|
} else if (it.bannerType == 'homeBanner') { // 首页banner
|
||||||
this.homeBanner.push(it)
|
this.homeBanner.push(it)
|
||||||
@ -170,7 +170,7 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 立即入驻
|
// 立即认证门店
|
||||||
toJoin() {
|
toJoin() {
|
||||||
if (!this.bannerJoin) return
|
if (!this.bannerJoin) return
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
@ -11,12 +11,12 @@
|
|||||||
<!-- <button class="cu-btn btn margin-bottom" style="background: #F2F2F2;" open-type="getPhoneNumber" @click="toPhoneLogin">
|
<!-- <button class="cu-btn btn margin-bottom" style="background: #F2F2F2;" open-type="getPhoneNumber" @click="toPhoneLogin">
|
||||||
|
|
||||||
其他手机号登录</button> -->
|
其他手机号登录</button> -->
|
||||||
<!-- <button class="cu-btn btn" style="margin-bottom: 100rpx;" @click="toReg">立即入驻</button> -->
|
<!-- <button class="cu-btn btn" style="margin-bottom: 100rpx;" @click="toReg">立即认证门店</button> -->
|
||||||
<view class="agreement-box">
|
<view class="agreement-box">
|
||||||
<checkbox-group @change="checkboxChange" class="checkbox-group">
|
<checkbox-group @change="checkboxChange" class="checkbox-group">
|
||||||
<checkbox value="1" :checked="isAgree" color="#19367A" class="checkbox" />
|
<checkbox value="1" :checked="isAgree" color="#19367A" class="checkbox" />
|
||||||
<text class="agreement-text">我已阅读并同意</text>
|
<text class="agreement-text">我已阅读并同意</text>
|
||||||
<text class="link" @click="toAgreement">《商家入驻协议》</text>
|
<text class="link" @click="toAgreement">《软件使用协议》</text>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -44,7 +44,7 @@
|
|||||||
toLogin() {
|
toLogin() {
|
||||||
if (!this.isAgree) {
|
if (!this.isAgree) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请先同意商家入驻协议',
|
title: '请先同意软件使用协议',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
@ -71,7 +71,7 @@
|
|||||||
decryptPhoneNumber(e) {
|
decryptPhoneNumber(e) {
|
||||||
if (!this.isAgree) {
|
if (!this.isAgree) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请先同意商家入驻协议',
|
title: '请先同意软件使用协议',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
@ -100,7 +100,7 @@
|
|||||||
} else {
|
} else {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '您还未入驻,请选入驻',
|
content: '您还未认证门店,请先认证',
|
||||||
showCancel: true,
|
showCancel: true,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
@ -114,7 +114,7 @@
|
|||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 入驻 注册
|
// 认证门店 注册
|
||||||
toReg() {
|
toReg() {
|
||||||
if (this.openId) {
|
if (this.openId) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
@ -163,8 +163,8 @@
|
|||||||
statusBaeHeight: 0,
|
statusBaeHeight: 0,
|
||||||
curTag: 0,
|
curTag: 0,
|
||||||
ADList: [], // 广告弹窗
|
ADList: [], // 广告弹窗
|
||||||
bannerJoin: null, // 入驻banner
|
bannerJoin: null, // 认证门店banner
|
||||||
showJoinImg: false, // 是否显示入驻图片
|
showJoinImg: false, // 是否显示认证门店图片
|
||||||
userInfo: null,
|
userInfo: null,
|
||||||
featurePageList: [], // 专辑页列表
|
featurePageList: [], // 专辑页列表
|
||||||
homeBanner: [], //首页banner
|
homeBanner: [], //首页banner
|
||||||
@ -191,7 +191,7 @@
|
|||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.userInfo = uni.getStorageSync('userInfo')
|
this.userInfo = uni.getStorageSync('userInfo')
|
||||||
if (this.userInfo == null || this.userInfo.userType == '09') { // 没登录或者没入驻
|
if (this.userInfo == null || this.userInfo.userType == '09') { // 没登录或者没认证门店
|
||||||
this.showJoinImg = true
|
this.showJoinImg = true
|
||||||
}else {
|
}else {
|
||||||
this.showJoinImg = false
|
this.showJoinImg = false
|
||||||
@ -206,7 +206,7 @@
|
|||||||
loginSuccess() {
|
loginSuccess() {
|
||||||
this.userInfo = uni.getStorageSync('userInfo')
|
this.userInfo = uni.getStorageSync('userInfo')
|
||||||
|
|
||||||
if (this.userInfo == null || this.userInfo.userType == '09') { // 没登录或者没入驻
|
if (this.userInfo == null || this.userInfo.userType == '09') { // 没登录或者没认证门店
|
||||||
console.log('登录')
|
console.log('登录')
|
||||||
this.showJoinImg = true
|
this.showJoinImg = true
|
||||||
}else {
|
}else {
|
||||||
@ -240,7 +240,7 @@
|
|||||||
res.data.forEach(it => {
|
res.data.forEach(it => {
|
||||||
if (it.bannerType == 'homeAD') { // 开屏广告
|
if (it.bannerType == 'homeAD') { // 开屏广告
|
||||||
this.ADList.push(it)
|
this.ADList.push(it)
|
||||||
} else if (it.bannerType == 'homeJoin') { // 入驻
|
} else if (it.bannerType == 'homeJoin') { // 认证门店
|
||||||
this.bannerJoin = it
|
this.bannerJoin = it
|
||||||
} else if (it.bannerType == 'homeBanner') { // 首页banner
|
} else if (it.bannerType == 'homeBanner') { // 首页banner
|
||||||
this.homeBanner.push(it)
|
this.homeBanner.push(it)
|
||||||
@ -270,7 +270,7 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 立即入驻
|
// 立即认证门店
|
||||||
toJoin() {
|
toJoin() {
|
||||||
if (!this.bannerJoin) return
|
if (!this.bannerJoin) return
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@ -296,6 +296,10 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
toGo(key) {
|
toGo(key) {
|
||||||
|
// 检查登录状态
|
||||||
|
const token = uni.getStorageSync('token')
|
||||||
|
const userInfo = uni.getStorageSync('userInfo')
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 1: // 新酒上市
|
case 1: // 新酒上市
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@ -303,29 +307,73 @@
|
|||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
case 2: // 生成酒单
|
case 2: // 生成酒单
|
||||||
if (!uni.getStorageSync('token')) {
|
if (!token || !userInfo) {
|
||||||
this.$refs.loginRef.open()
|
this.$refs.loginRef.open()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (!userInfo.barId) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '您还未认证门店,请先完成认证',
|
||||||
|
showCancel: true,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/index/registration'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pagesActivity/winelist"
|
url: "/pagesActivity/winelist"
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
case 3: //酒币换购
|
case 3: //酒币换购
|
||||||
|
if (!token || !userInfo) {
|
||||||
if (!uni.getStorageSync('token')) {
|
|
||||||
this.$refs.loginRef.open()
|
this.$refs.loginRef.open()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (!userInfo.barId) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '您还未认证门店,请先完成认证',
|
||||||
|
showCancel: true,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/index/registration'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pagesCoin/beerCoin"
|
url: "/pagesCoin/beerCoin"
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
case 4: // 关注酒厂
|
case 4: // 关注酒厂
|
||||||
if (!uni.getStorageSync('token')) {
|
if (!token || !userInfo) {
|
||||||
this.$refs.loginRef.open()
|
this.$refs.loginRef.open()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (!userInfo.barId) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '您还未认证门店,请先完成认证',
|
||||||
|
showCancel: true,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/index/registration'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesMy/myAttention'
|
url: '/pagesMy/myAttention'
|
||||||
})
|
})
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
<view class="margin-top">
|
<view class="margin-top">
|
||||||
<view class="flex justify-between align-end margin-bottom-xs">
|
<view class="flex justify-between align-end margin-bottom-xs">
|
||||||
<text class="text-xxl text-bold">{{myScanData.scanCount}}</text>
|
<text class="text-xxl text-bold">{{myScanData.scanCount}}</text>
|
||||||
<text class="text-xs">击败全国{{myScanData.percent}}%入驻门店</text>
|
<text class="text-xs">击败全国{{myScanData.percent}}%认证门店</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="cu-progress round striped active">
|
<view class="cu-progress round striped active">
|
||||||
|
@ -97,7 +97,7 @@
|
|||||||
} else {
|
} else {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '您还未入驻,请选入驻',
|
content: '您还未认证门店,请先认证',
|
||||||
showCancel: true,
|
showCancel: true,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
<!-- 咨询入口 -->
|
<!-- 咨询入口 -->
|
||||||
<view class="consult-box flex align-center justify-between">
|
<view class="consult-box flex align-center justify-between">
|
||||||
<text class="consult-text">入驻助手,帮你解决入驻问题,快速上手赢取品牌返利。</text>
|
<text class="consult-text">认证门店助手,帮你解决认证问题,快速上手赢取品牌返利。</text>
|
||||||
<button class="consult-btn" @click="handleConsult">咨询</button>
|
<button class="consult-btn" @click="handleConsult">咨询</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -166,7 +166,7 @@
|
|||||||
:disabled="!isFormValid"
|
:disabled="!isFormValid"
|
||||||
@click="submitForm"
|
@click="submitForm"
|
||||||
>
|
>
|
||||||
提交入驻
|
提交认证门店
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -7,16 +7,16 @@
|
|||||||
<view class="agreement-section">
|
<view class="agreement-section">
|
||||||
<view class="section-subtitle">一、总则</view>
|
<view class="section-subtitle">一、总则</view>
|
||||||
<view class="section-text">
|
<view class="section-text">
|
||||||
<text>1.1 本协议是您与啤啤猩球平台之间就商家入驻等相关事宜所订立的契约。</text>
|
<text>1.1 本协议是您与啤啤猩球平台之间就商家认证门店等相关事宜所订立的契约。</text>
|
||||||
<text>1.2 您应当在使用本服务之前认真阅读全部协议内容。如您对协议有任何疑问,可向平台咨询。</text>
|
<text>1.2 您应当在使用本服务之前认真阅读全部协议内容。如您对协议有任何疑问,可向平台咨询。</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="agreement-section">
|
<view class="agreement-section">
|
||||||
<view class="section-subtitle">二、入驻条件</view>
|
<view class="section-subtitle">二、认证门店条件</view>
|
||||||
<view class="section-text">
|
<view class="section-text">
|
||||||
<text>2.1 商家必须具有合法的经营资质。</text>
|
<text>2.1 商家必须具有合法的经营资质。</text>
|
||||||
<text>2.2 商家必须提供真实、准确、完整的入驻信息。</text>
|
<text>2.2 商家必须提供真实、准确、完整的认证门店信息。</text>
|
||||||
<text>2.3 商家必须遵守平台规则和相关法律法规。</text>
|
<text>2.3 商家必须遵守平台规则和相关法律法规。</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
35
tatus
Normal file
35
tatus
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
|
||||||
|
SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS
|
||||||
|
|
||||||
|
Commands marked with * may be preceded by a number, _N.
|
||||||
|
Notes in parentheses indicate the behavior if _N is given.
|
||||||
|
A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K.
|
||||||
|
|
||||||
|
h H Display this help.
|
||||||
|
q :q Q :Q ZZ Exit.
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
MMOOVVIINNGG
|
||||||
|
|
||||||
|
e ^E j ^N CR * Forward one line (or _N lines).
|
||||||
|
y ^Y k ^K ^P * Backward one line (or _N lines).
|
||||||
|
f ^F ^V SPACE * Forward one window (or _N lines).
|
||||||
|
b ^B ESC-v * Backward one window (or _N lines).
|
||||||
|
z * Forward one window (and set window to _N).
|
||||||
|
w * Backward one window (and set window to _N).
|
||||||
|
ESC-SPACE * Forward one window, but don't stop at end-of-file.
|
||||||
|
d ^D * Forward one half-window (and set half-window to _N).
|
||||||
|
u ^U * Backward one half-window (and set half-window to _N).
|
||||||
|
ESC-) RightArrow * Right one half screen width (or _N positions).
|
||||||
|
ESC-( LeftArrow * Left one half screen width (or _N positions).
|
||||||
|
ESC-} ^RightArrow Right to last column displayed.
|
||||||
|
ESC-{ ^LeftArrow Left to first column.
|
||||||
|
F Forward forever; like "tail -f".
|
||||||
|
ESC-F Like F but stop when search pattern is found.
|
||||||
|
r ^R ^L Repaint screen.
|
||||||
|
R Repaint screen, discarding buffered input.
|
||||||
|
---------------------------------------------------
|
||||||
|
Default "window" is the screen height.
|
||||||
|
Default "half-window" is half of the screen height.
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
219
utils/auth.js
Normal file
219
utils/auth.js
Normal file
@ -0,0 +1,219 @@
|
|||||||
|
// 页面权限配置
|
||||||
|
const pageConfig = {
|
||||||
|
// 公开页面(不需要登录)
|
||||||
|
publicPages: [
|
||||||
|
'/pages/index/index', // 首页
|
||||||
|
'/pages/beer/beerList', // 选酒页面
|
||||||
|
'/pages/activityList/activityList', // 活动列表
|
||||||
|
'/pagesActivity/activityDetail', // 活动详情
|
||||||
|
'/pages/index/chooseLogin', // 登录页面
|
||||||
|
'/pages/index/registration', // 注册页面
|
||||||
|
'/pages/index/userAgreement', // 用户协议
|
||||||
|
],
|
||||||
|
|
||||||
|
// 需要登录的页面(不需要认证门店)
|
||||||
|
needLoginPages: [
|
||||||
|
'/pages/index/scan', // 扫码
|
||||||
|
'/pages/index/my', // 个人中心
|
||||||
|
'/pages/index/myJoin', // 我参与的活动
|
||||||
|
'/pages/index/bar' // 酒吧页面
|
||||||
|
],
|
||||||
|
|
||||||
|
// 需要认证门店的页面(必须先登录)
|
||||||
|
needAuthPages: [
|
||||||
|
'/pages/index/scan', // 扫码
|
||||||
|
'/pages/index/myJoin', // 我参与的活动
|
||||||
|
'/pages/index/bar' // 酒吧页面
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
// API权限配置
|
||||||
|
const apiConfig = {
|
||||||
|
// 公开API(不需要登录)
|
||||||
|
publicApis: [
|
||||||
|
'/beer/list', // 啤酒列表
|
||||||
|
'/beer/detail', // 啤酒详情
|
||||||
|
'/activity/list', // 活动列表
|
||||||
|
'/activity/detail', // 活动详情
|
||||||
|
'/bar/detail', // 酒吧详情
|
||||||
|
'/bar/list', // 酒吧列表
|
||||||
|
'/common/', // 公共接口
|
||||||
|
],
|
||||||
|
|
||||||
|
// 需要登录的API(不需要认证门店)
|
||||||
|
needLoginApis: [
|
||||||
|
'/user/info', // 用户信息
|
||||||
|
'/user/activity/list', // 用户活动列表
|
||||||
|
'/user/activity/detail', // 用户活动详情
|
||||||
|
'/user/scan', // 用户扫码
|
||||||
|
'/user/scan/result', // 扫码结果
|
||||||
|
'/user/scan/history', // 扫码历史
|
||||||
|
'/user/scan/statistics', // 扫码统计
|
||||||
|
'/user/scan/rank', // 扫码排名
|
||||||
|
'/user/scan/reward', // 扫码奖励
|
||||||
|
'/user/scan/reward/list', // 扫码奖励列表
|
||||||
|
'/user/scan/reward/detail', // 扫码奖励详情
|
||||||
|
'/user/scan/reward/record', // 扫码奖励记录
|
||||||
|
'/user/scan/reward/statistics', // 扫码奖励统计
|
||||||
|
'/user/scan/reward/rank', // 扫码奖励排名
|
||||||
|
'/user/scan/reward/exchange', // 扫码奖励兑换
|
||||||
|
'/user/scan/reward/exchange/list', // 扫码奖励兑换列表
|
||||||
|
'/user/scan/reward/exchange/detail', // 扫码奖励兑换详情
|
||||||
|
'/user/scan/reward/exchange/record', // 扫码奖励兑换记录
|
||||||
|
'/user/scan/reward/exchange/statistics', // 扫码奖励兑换统计
|
||||||
|
'/user/scan/reward/exchange/rank', // 扫码奖励兑换排名
|
||||||
|
'/user/scan/reward/exchange/exchange', // 扫码奖励兑换
|
||||||
|
'/user/scan/reward/exchange/exchange/list', // 扫码奖励兑换列表
|
||||||
|
'/user/scan/reward/exchange/exchange/detail', // 扫码奖励兑换详情
|
||||||
|
'/user/scan/reward/exchange/exchange/record', // 扫码奖励兑换记录
|
||||||
|
'/user/scan/reward/exchange/exchange/statistics', // 扫码奖励兑换统计
|
||||||
|
'/user/scan/reward/exchange/exchange/rank' // 扫码奖励兑换排名
|
||||||
|
],
|
||||||
|
|
||||||
|
// 需要认证门店的API(必须先登录)
|
||||||
|
needAuthApis: [
|
||||||
|
'/bar/info', // 酒吧信息
|
||||||
|
'/bar/update', // 更新酒吧信息
|
||||||
|
'/bar/activity/create', // 创建活动
|
||||||
|
'/bar/activity/update', // 更新活动
|
||||||
|
'/bar/activity/delete', // 删除活动
|
||||||
|
'/bar/activity/list', // 活动列表
|
||||||
|
'/bar/activity/detail', // 活动详情
|
||||||
|
'/bar/activity/statistics', // 活动统计
|
||||||
|
'/bar/activity/rank', // 活动排名
|
||||||
|
'/bar/activity/reward', // 活动奖励
|
||||||
|
'/bar/activity/reward/list', // 活动奖励列表
|
||||||
|
'/bar/activity/reward/detail', // 活动奖励详情
|
||||||
|
'/bar/activity/reward/record', // 活动奖励记录
|
||||||
|
'/bar/activity/reward/statistics', // 活动奖励统计
|
||||||
|
'/bar/activity/reward/rank', // 活动奖励排名
|
||||||
|
'/bar/activity/reward/exchange', // 活动奖励兑换
|
||||||
|
'/bar/activity/reward/exchange/list', // 活动奖励兑换列表
|
||||||
|
'/bar/activity/reward/exchange/detail', // 活动奖励兑换详情
|
||||||
|
'/bar/activity/reward/exchange/record', // 活动奖励兑换记录
|
||||||
|
'/bar/activity/reward/exchange/statistics', // 活动奖励兑换统计
|
||||||
|
'/bar/activity/reward/exchange/rank' // 活动奖励兑换排名
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查登录状态
|
||||||
|
export const checkLogin = () => {
|
||||||
|
const token = uni.getStorageSync('token')
|
||||||
|
const userInfo = uni.getStorageSync('userInfo')
|
||||||
|
return !!(token && userInfo)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查认证门店状态
|
||||||
|
export const checkAuth = () => {
|
||||||
|
const userInfo = uni.getStorageSync('userInfo')
|
||||||
|
return userInfo && userInfo.barId
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取用户信息
|
||||||
|
export const getUserInfo = () => {
|
||||||
|
return uni.getStorageSync('userInfo')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 页面权限检查
|
||||||
|
export const checkPagePermission = (url) => {
|
||||||
|
const path = url.split('?')[0]
|
||||||
|
|
||||||
|
// 检查是否是公开页面
|
||||||
|
if (pageConfig.publicPages.includes(path)) {
|
||||||
|
return { needLogin: false, needAuth: false }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否需要登录
|
||||||
|
if (pageConfig.needLoginPages.includes(path)) {
|
||||||
|
return { needLogin: true, needAuth: false }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否需要认证门店
|
||||||
|
if (pageConfig.needAuthPages.includes(path)) {
|
||||||
|
return { needLogin: true, needAuth: true }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 默认需要登录
|
||||||
|
return { needLogin: true, needAuth: false }
|
||||||
|
}
|
||||||
|
|
||||||
|
// API权限检查
|
||||||
|
export const checkApiPermission = (url) => {
|
||||||
|
// 检查是否是公开API
|
||||||
|
if (apiConfig.publicApis.some(api => url.includes(api))) {
|
||||||
|
return { needLogin: false, needAuth: false }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否需要登录
|
||||||
|
if (apiConfig.needLoginApis.some(api => url.includes(api))) {
|
||||||
|
return { needLogin: true, needAuth: false }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否需要认证门店
|
||||||
|
if (apiConfig.needAuthApis.some(api => url.includes(api))) {
|
||||||
|
return { needLogin: true, needAuth: true }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 默认需要登录
|
||||||
|
return { needLogin: true, needAuth: false }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 页面访问控制
|
||||||
|
export const requirePagePermission = (url) => {
|
||||||
|
const { needLogin, needAuth } = checkPagePermission(url)
|
||||||
|
|
||||||
|
if (needLogin && !checkLogin()) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/index/chooseLogin'
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (needAuth && !checkAuth()) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/index/registration'
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清除登录状态
|
||||||
|
export const clearLoginStatus = () => {
|
||||||
|
uni.removeStorageSync('token')
|
||||||
|
uni.removeStorageSync('userInfo')
|
||||||
|
uni.removeStorageSync('barInfo')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新用户信息
|
||||||
|
export const updateUserInfo = (userInfo) => {
|
||||||
|
uni.setStorageSync('userInfo', userInfo)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否需要重新登录
|
||||||
|
export const checkNeedRelogin = () => {
|
||||||
|
const token = uni.getStorageSync('token')
|
||||||
|
if (!token) {
|
||||||
|
clearLoginStatus()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否需要重新认证门店
|
||||||
|
export const checkNeedReAuth = () => {
|
||||||
|
const token = uni.getStorageSync('token')
|
||||||
|
const userInfo = uni.getStorageSync('userInfo')
|
||||||
|
return token && (!userInfo || !userInfo.barId)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否需要认证门店
|
||||||
|
export function checkPageNeedAuth(url) {
|
||||||
|
return pageConfig.needAuthPages.some(page => url.startsWith(page))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否需要认证门店
|
||||||
|
export function checkApiNeedAuth(url) {
|
||||||
|
return apiConfig.needAuthApis.some(api => url.includes(api))
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user