diff --git a/pages.json b/pages.json index e3bb3d2..48724ef 100644 --- a/pages.json +++ b/pages.json @@ -20,6 +20,17 @@ "group": "商城" } }, + { + "path": "pages/index/fabu", + "style": { + "navigationBarTitleText": "发布" + }, + "meta": { + "sync": true, + "title": "发布", + "group": "商城" + } + }, { "path": "pages/index/user", "style": { @@ -46,18 +57,7 @@ { "path": "pages/index/cart", "style": { - "navigationBarTitleText": "发布" - }, - "meta": { - "sync": true, - "title": "购物车", - "group": "商城" - } - }, - { - "path": "pages/index/fabu", - "style": { - "navigationBarTitleText": "发布" + "navigationBarTitleText": "购物车" }, "meta": { "sync": true, @@ -759,7 +759,7 @@ ], "globalStyle": { "navigationBarTextStyle": "black", - "navigationBarTitleText": "星品购", + "navigationBarTitleText": "酱小仙", "navigationBarBackgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF", "navigationStyle": "custom" @@ -769,7 +769,7 @@ "pagePath": "pages/index/index" }, { - "pagePath": "pages/index/cart" + "pagePath": "pages/index/fabu" }, { "pagePath": "pages/index/user" diff --git a/pages/index/cart.vue b/pages/index/cart.vue index 530f60c..c844437 100644 --- a/pages/index/cart.vue +++ b/pages/index/cart.vue @@ -1,5 +1,6 @@ \ No newline at end of file diff --git a/pages/user/info.vue b/pages/user/info.vue index 5a931b2..bb8e08a 100644 --- a/pages/user/info.vue +++ b/pages/user/info.vue @@ -104,7 +104,7 @@ - + @@ -153,7 +153,7 @@ - + - + + @@ -339,6 +340,23 @@ const getUserInfo = async () => { } }; +//退出登录 +function onLogout() { + uni.showModal({ + title: '提示', + content: '确认退出账号?', + success: async function (res) { + if (res.confirm) { + const result = await sheep.$store('user').logout(); + if (result) { + sheep.$router.go('/pages/index/user'); + } + } + }, + }); + } + + onBeforeMount(async () => { getUserInfo(); }); @@ -394,13 +412,25 @@ onBeforeMount(async () => { .logout-btn { width: 710rpx; height: 80rpx; - background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient)); + background: linear-gradient(90deg,#FCCA58, #FFBD25); border-radius: 40rpx; font-size: 30rpx; font-weight: 500; color: $white; } +.exit-btn { + width: 710rpx; + height: 80rpx; + background: #ffffff; + border-radius: 40rpx; + border: 2rpx solid #999999; + font-size: 30rpx; + font-weight: 800; + color: #999999; + margin-top: 30rpx; +} + .radio-dark { filter: grayscale(100%); filter: gray; diff --git a/sheep/api/login.js b/sheep/api/login.js new file mode 100644 index 0000000..c66366b --- /dev/null +++ b/sheep/api/login.js @@ -0,0 +1,13 @@ +import request from '@/sheep/request'; +import $platform from '@/sheep/platform'; + +export default { + + wxLogin: (path) => + `${baseUrl}${apiPath}third.wechat/loginByMobile?platform=miniProgram&payload=${encodeURIComponent( + JSON.stringify({ + path, + }), + )}`, + +}; diff --git a/sheep/api/third.js b/sheep/api/third.js index cbced2d..d6a5d95 100644 --- a/sheep/api/third.js +++ b/sheep/api/third.js @@ -1,129 +1,149 @@ import request from '@/sheep/request'; -import { baseUrl, apiPath } from '@/sheep/config'; +import { + baseUrl, + apiPath +} from '@/sheep/config'; export default { - // 微信相关 - wechat: { - // 第三方登录 - login: (params, data) => - request({ - url: 'third.wechat/login', - method: 'POST', - params, - data, - custom: { - showSuccess: true, - loadingMsg: '登陆中', - }, - }), + // 微信相关 + wechat: { + // 第三方登录 + login: (params, data) => + request({ + url: 'third.wechat/login', + method: 'POST', + params, + data, + custom: { + showSuccess: true, + loadingMsg: '登陆中', + }, + }), - // 绑定微信 - bind: (params, data) => - request({ - url: 'third.wechat/bind', - method: 'POST', - params, - data, - custom: { - showSuccess: true, - loadingMsg: '绑定中', - }, - }), + // 绑定微信 + bind: (params, data) => + request({ + url: 'third.wechat/bind', + method: 'POST', + params, + data, + custom: { + showSuccess: true, + loadingMsg: '绑定中', + }, + }), - // 解除绑定微信 - unbind: (data) => - request({ - url: 'third.wechat/unbind', - method: 'POST', - data, - custom: { - showSuccess: true, - loadingMsg: '解除绑定', - }, - }), + // 解除绑定微信 + unbind: (data) => + request({ + url: 'third.wechat/unbind', + method: 'POST', + data, + custom: { + showSuccess: true, + loadingMsg: '解除绑定', + }, + }), - // 公众号授权 - oauthLogin: (data) => - request({ - url: 'third.wechat/oauthLogin', - method: 'GET', - data, - custom: { - showSuccess: true, - loadingMsg: '登陆中', - }, - }), + // 公众号授权 + oauthLogin: (data) => + request({ + url: 'third.wechat/oauthLogin', + method: 'GET', + data, + custom: { + showSuccess: true, + loadingMsg: '登陆中', + }, + }), - // 获取小程序sessionKey(后端不会给前端返回真实的sessionKey) - getSessionId: (data) => - request({ - url: 'third.wechat/getSessionId', - method: 'POST', - data, - custom: { - showLoading: false, - }, - }), + // 获取小程序sessionKey(后端不会给前端返回真实的sessionKey) + getSessionId: (data) => + request({ + url: 'third.wechat/getSessionId', + method: 'POST', + data, + custom: { + showLoading: false, + }, + }), - // 微信小程序 绑定一键获取的手机号 - bindUserPhoneNumber: (data) => - request({ - url: 'third.wechat/bindUserPhoneNumber', - method: 'POST', - data, - custom: { - showSuccess: true, - loadingMsg: '获取中', - }, - }), + // 微信小程序 绑定一键获取的手机号 + bindUserPhoneNumber: (data) => + request({ + url: 'third.wechat/bindUserPhoneNumber', + method: 'POST', + data, + custom: { + showSuccess: true, + loadingMsg: '获取中', + }, + }), - // 网页jssdk - jssdk: (data) => - request({ - url: 'third.wechat/jssdk', - method: 'GET', - data, - custom: { - showError: false, - showLoading: false, - }, - }), + // 网页jssdk + jssdk: (data) => + request({ + url: 'third.wechat/jssdk', + method: 'GET', + data, + custom: { + showError: false, + showLoading: false, + }, + }), - // 小程序订阅消息 - subscribeTemplate: (params) => - request({ - url: 'third.wechat/subscribeTemplate', - method: 'GET', - params: { - platform: 'miniProgram', - }, - custom: { - showError: false, - showLoading: false, - }, - }), + // 小程序订阅消息 + subscribeTemplate: (params) => + request({ + url: 'third.wechat/subscribeTemplate', + method: 'GET', + params: { + platform: 'miniProgram', + }, + custom: { + showError: false, + showLoading: false, + }, + }), - // 获取微信小程序码 - getWxacode: (path) => - `${baseUrl}${apiPath}third.wechat/wxacode?platform=miniProgram&payload=${encodeURIComponent( + // 获取微信小程序码 + getWxacode: (path) => + `${baseUrl}${apiPath}third.wechat/wxacode?platform=miniProgram&payload=${encodeURIComponent( JSON.stringify({ path, }), )}`, - }, - // 苹果相关 - apple: { - // 第三方登录 - login: (data) => - request({ - url: 'third.apple/login', - method: 'POST', - data, - custom: { - showSuccess: true, - loadingMsg: '登陆中', - }, - }), - }, -}; + + //自定义的登录接口 + wxLogin: (data) => + request({ + url: 'third.wechat/loginByMobile', + method: 'POST', + data, + custom: { + showSuccess: true, + loadingMsg: '登录中', + }, + }), + }, + + // 苹果相关 + apple: { + // 第三方登录 + login: (data) => + request({ + url: 'third.apple/login', + method: 'POST', + data, + custom: { + showSuccess: true, + loadingMsg: '登陆中', + }, + }), + }, + + + + +}; \ No newline at end of file diff --git a/sheep/api/user.js b/sheep/api/user.js index a0f38ed..2c35150 100644 --- a/sheep/api/user.js +++ b/sheep/api/user.js @@ -11,6 +11,15 @@ export default { auth: true, }, }), + authen: () => + request({ + url: 'meal.auth/info', + method: 'GET', + custom: { + showLoading: false, + auth: true, + }, + }), update: (data) => request({ url: 'user.user/update', @@ -337,4 +346,6 @@ export default { auth: true, }, }), + + }; diff --git a/sheep/components/s-auth-modal/components/change-mobile.vue b/sheep/components/s-auth-modal/components/change-mobile.vue index a8cea38..bc9cdcd 100644 --- a/sheep/components/s-auth-modal/components/change-mobile.vue +++ b/sheep/components/s-auth-modal/components/change-mobile.vue @@ -1,15 +1,15 @@ diff --git a/sheep/components/s-auth-modal/components/reset-password.vue b/sheep/components/s-auth-modal/components/reset-password.vue index e19989b..af1b7a0 100644 --- a/sheep/components/s-auth-modal/components/reset-password.vue +++ b/sheep/components/s-auth-modal/components/reset-password.vue @@ -2,12 +2,12 @@ diff --git a/sheep/components/s-auth-modal/s-auth-modal.vue b/sheep/components/s-auth-modal/s-auth-modal.vue index 3f4c8ec..a0a7aed 100644 --- a/sheep/components/s-auth-modal/s-auth-modal.vue +++ b/sheep/components/s-auth-modal/s-auth-modal.vue @@ -1,49 +1,58 @@