diff --git a/manifest.config.ts b/manifest.config.ts index be3df88..621b950 100644 --- a/manifest.config.ts +++ b/manifest.config.ts @@ -24,6 +24,7 @@ export default defineManifestConfig({ locale: VITE_FALLBACK_LOCALE, // 'zh-Hans' h5: { router: { + mode: 'history', base: VITE_APP_PUBLIC_BASE, }, sdkConfigs: { diff --git a/src/api/login.ts b/src/api/login.ts index 3092627..54fc6c6 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -96,3 +96,7 @@ export function wxLogin(data: { code: string }) { export function phoneLogin(data) { return http.post('/api/auth/phoneLogin', data) } + +export function mpLoginApi(data: { code: string }) { + return http.post('/api/auth/mpLogin', data) +} diff --git a/src/manifest.json b/src/manifest.json index 5ba25d3..78d0558 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -115,7 +115,8 @@ "vueVersion": "3", "h5": { "router": { - "base": "/" + "mode": "history", + "base": "" }, "sdkConfigs": { "maps": { diff --git a/src/pages.json b/src/pages.json index c34ec97..5a04a23 100644 --- a/src/pages.json +++ b/src/pages.json @@ -102,6 +102,14 @@ "navigationBarTitleText": "登录" } }, + { + "path": "pages/login/mpLogin", + "type": "page", + "layout": "tabbar", + "style": { + "navigationBarTitleText": "登录" + } + }, { "path": "pages/my/index", "type": "page", @@ -110,6 +118,13 @@ "navigationBarTitleText": "我的" } }, + { + "path": "pages/my/phone", + "type": "page", + "style": { + "navigationBarTitleText": "修改手机号" + } + }, { "path": "pages/my/setting", "type": "page", diff --git a/src/pages/login/mpLogin.vue b/src/pages/login/mpLogin.vue new file mode 100644 index 0000000..4ae4bec --- /dev/null +++ b/src/pages/login/mpLogin.vue @@ -0,0 +1,136 @@ + +{ + layout: 'tabbar', + style: { + navigationBarTitleText: '登录', + }, +} + + + + + + + diff --git a/src/pages/my/components/wx-login.vue b/src/pages/my/components/wx-login.vue index 938a766..0bbe70f 100644 --- a/src/pages/my/components/wx-login.vue +++ b/src/pages/my/components/wx-login.vue @@ -4,6 +4,53 @@ } + + - - diff --git a/src/pages/my/index.vue b/src/pages/my/index.vue index 1e5a08e..0de285f 100644 --- a/src/pages/my/index.vue +++ b/src/pages/my/index.vue @@ -3,16 +3,12 @@ style: { navigationStyle: 'custom', navigationBarTitleText: '我的' }, } - + + diff --git a/src/pages/my/phone.vue b/src/pages/my/phone.vue new file mode 100644 index 0000000..53f45de --- /dev/null +++ b/src/pages/my/phone.vue @@ -0,0 +1,116 @@ + +{ + style: { navigationBarTitleText: '修改手机号' }, +} + + + + + diff --git a/src/pages/my/setting.vue b/src/pages/my/setting.vue index 4a8acdf..5772a0c 100644 --- a/src/pages/my/setting.vue +++ b/src/pages/my/setting.vue @@ -3,211 +3,29 @@ style: { navigationBarTitleText: '设置' }, } - + + diff --git a/src/service/crmeb/product.ts b/src/service/crmeb/product.ts index faa4539..dd9f148 100644 --- a/src/service/crmeb/product.ts +++ b/src/service/crmeb/product.ts @@ -1,5 +1,6 @@ -import { http } from '@/utils/http' import { getEnvBaseUrl, getUrlCrmeb, getUrlCrmebProxy } from '@/utils' +import { http } from '@/utils/http' + export interface IFooItem { cate_pid: string // name: string @@ -26,8 +27,8 @@ export interface IFooItem { /** GET 请求 */ export function getProductAPI(labels: string) { // return http.get(getUrlCrmebProxy() + '/api/product/spu/lst', { cate_pid }) - //根据标签获取产品 - return http.get(getUrlCrmebProxy() + '/api/product/spu/labels', { labels: labels }) + // 根据标签获取产品 + return http.get(`${getUrlCrmebProxy()}/api/product/spu/labels`, { labels }) } // 用户中心 export function getInfoAPI() { @@ -39,14 +40,14 @@ export function setInfoPI(data: any) { } export function setPhoneAPI(phone: any) { - return http.post('/api/user/setPhone', { phone: phone }) + return http.post('/api/user/setPhone', { phone }) } export function setGroupAPI(data: any) { return http.post('/api/user/setGroup', data) } -//基础修改 +// 基础修改 export function setBaseAPI(data: any) { return http.post('/api/user/setBase', data) } @@ -60,11 +61,11 @@ export function getDistrictAPI() { } export function getStreetAPI(code: string) { - return http.get('/api/location/getStreet', { code: code }) + return http.get('/api/location/getStreet', { code }) } export function getVillageAPI(code: string) { - return http.get('/api/location/getVillage', { code: code }) + return http.get('/api/location/getVillage', { code }) } // 首页 @@ -83,14 +84,14 @@ export function getArticleDetailAPI(data: any) { return http.get('/api/article/detail', data) } -//图片上传 +// 图片上传 export function getUplaodImageAPI(data: any) { return http.post('/api/upload/image', data) } /** GET 请求 */ export function getMerchantAPI(data: any) { - return http.get(getUrlCrmebProxy() + '/api/store/merchant/lst', data) + return http.get(`${getUrlCrmebProxy()}/api/store/merchant/lst`, data) } /** @@ -117,3 +118,11 @@ export function openLocation( }) }) } + +export function getCodeAPI(data: any) { + return http.post('/api/auth/getCode', data) +} + +export function bindPhoneApi(data: any) { + return http.post('/api/user/checkPhone', data) +} diff --git a/src/utils/http.ts b/src/utils/http.ts index 02d3f52..3bcb03c 100644 --- a/src/utils/http.ts +++ b/src/utils/http.ts @@ -1,5 +1,6 @@ import type { CustomRequestOptions } from '@/interceptors/request' import { useUserStore } from '@/store' + export function http(options: CustomRequestOptions) { // 1. 返回 Promise 对象 return new Promise>((resolve, reject) => { @@ -24,7 +25,12 @@ export function http(options: CustomRequestOptions) { title: (res.data as IResData).msg || '请登录', }) setTimeout(() => { + // #ifdef H5 + uni.navigateTo({ url: '/pages/login/mpLogin' }) + // #endif + // #ifdef MP-WEIXIN uni.navigateTo({ url: '/pages/login/login' }) + // #endif }, 1500) // reject(res) } else {