diff --git a/app/src/api/shop.ts b/app/src/api/shop.ts new file mode 100644 index 00000000..0cfaf8ac --- /dev/null +++ b/app/src/api/shop.ts @@ -0,0 +1,6 @@ +import request from '@/utils/request' + +//首页数据 +export function getIndex() { + return request.get({ url: '/index' }) +} diff --git a/app/src/components/decoration/decoration.vue b/app/src/components/decoration/decoration.vue new file mode 100644 index 00000000..d1628b94 --- /dev/null +++ b/app/src/components/decoration/decoration.vue @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + diff --git a/app/src/components/decoration/widgets/banner/attr.vue b/app/src/components/decoration/widgets/banner/attr.vue deleted file mode 100644 index f731aa65..00000000 --- a/app/src/components/decoration/widgets/banner/attr.vue +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 开启 - 停用 - - - - - 最多添加5张,建议图片尺寸:750px*400px - - - - - - - - - - - - - - - - - 添加图片 - - - - - - - diff --git a/app/src/components/decoration/widgets/banner/content.vue b/app/src/components/decoration/widgets/banner/content.vue deleted file mode 100644 index 9dd347a4..00000000 --- a/app/src/components/decoration/widgets/banner/content.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - diff --git a/app/src/components/decoration/widgets/banner/index.ts b/app/src/components/decoration/widgets/banner/index.ts deleted file mode 100644 index c776bce3..00000000 --- a/app/src/components/decoration/widgets/banner/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import attr from './attr.vue' -import content from './content.vue' -import options from './options' -export default { - attr, - content, - options -} diff --git a/app/src/components/decoration/widgets/banner/options.ts b/app/src/components/decoration/widgets/banner/options.ts deleted file mode 100644 index e33d9211..00000000 --- a/app/src/components/decoration/widgets/banner/options.ts +++ /dev/null @@ -1,15 +0,0 @@ -export default () => ({ - title: '首页轮播图', - name: 'banner', - content: { - enabled: 1, - data: [ - { - image: '', - name: '', - link: {} - } - ] - }, - styles: {} -}) diff --git a/app/src/components/decoration/widgets/customer-service/attr.vue b/app/src/components/decoration/widgets/customer-service/attr.vue deleted file mode 100644 index 6f7dc7eb..00000000 --- a/app/src/components/decoration/widgets/customer-service/attr.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - 建议图片尺寸:200*200像素;图片格式:jpg、png、jpeg - - - - - - - - diff --git a/app/src/components/decoration/widgets/customer-service/content.vue b/app/src/components/decoration/widgets/customer-service/content.vue deleted file mode 100644 index 854deab4..00000000 --- a/app/src/components/decoration/widgets/customer-service/content.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - {{ content.title }} - 服务时间:{{ content.time }} - 客服电话:{{ content.mobile }} - - 保存二维码图片 - - - - - - diff --git a/app/src/components/decoration/widgets/customer-service/index.ts b/app/src/components/decoration/widgets/customer-service/index.ts deleted file mode 100644 index c776bce3..00000000 --- a/app/src/components/decoration/widgets/customer-service/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import attr from './attr.vue' -import content from './content.vue' -import options from './options' -export default { - attr, - content, - options -} diff --git a/app/src/components/decoration/widgets/customer-service/options.ts b/app/src/components/decoration/widgets/customer-service/options.ts deleted file mode 100644 index 3a5efda8..00000000 --- a/app/src/components/decoration/widgets/customer-service/options.ts +++ /dev/null @@ -1,11 +0,0 @@ -export default () => ({ - title: '客服设置', - name: 'customer-service', - content: { - title: '添加客服二维码', - time: '', - mobile: '', - qrcode: '' - }, - styles: {} -}) diff --git a/app/src/components/decoration/widgets/index.ts b/app/src/components/decoration/widgets/index.ts deleted file mode 100644 index 20bf4bff..00000000 --- a/app/src/components/decoration/widgets/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -const widgets: Record = import.meta.glob('./**/index.ts', { eager: true }) -interface Widget { - attr: any - content: any - options: any -} -console.log(widgets) -const exportWidgets: Record = {} -Object.keys(widgets).forEach((key) => { - const widgetName = key.replace(/^\.\/([\w-]+).*/gi, '$1') - exportWidgets[widgetName] = widgets[key]?.default -}) - -export default exportWidgets diff --git a/app/src/components/decoration/widgets/my-service/attr.vue b/app/src/components/decoration/widgets/my-service/attr.vue deleted file mode 100644 index a29d8943..00000000 --- a/app/src/components/decoration/widgets/my-service/attr.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 横排 - 竖排 - - - - - - - - - - - - - - - - diff --git a/app/src/components/decoration/widgets/my-service/content.vue b/app/src/components/decoration/widgets/my-service/content.vue deleted file mode 100644 index 6317bb52..00000000 --- a/app/src/components/decoration/widgets/my-service/content.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - - {{ content.title }} - - - - - {{ item.name }} - - - - - - {{ item.name }} - - - - - - - - - - diff --git a/app/src/components/decoration/widgets/my-service/index.ts b/app/src/components/decoration/widgets/my-service/index.ts deleted file mode 100644 index c776bce3..00000000 --- a/app/src/components/decoration/widgets/my-service/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import attr from './attr.vue' -import content from './content.vue' -import options from './options' -export default { - attr, - content, - options -} diff --git a/app/src/components/decoration/widgets/my-service/options.ts b/app/src/components/decoration/widgets/my-service/options.ts deleted file mode 100644 index a69f3558..00000000 --- a/app/src/components/decoration/widgets/my-service/options.ts +++ /dev/null @@ -1,16 +0,0 @@ -export default () => ({ - title: '我的服务', - name: 'my-service', - content: { - style: 1, - title: '我的服务', - data: [ - { - image: '', - name: '', - link: {} - } - ] - }, - styles: {} -}) diff --git a/app/src/components/decoration/widgets/nav/attr.vue b/app/src/components/decoration/widgets/nav/attr.vue deleted file mode 100644 index 3128196d..00000000 --- a/app/src/components/decoration/widgets/nav/attr.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - 开启 - 停用 - - - - - 最多可添加10个,建议图片尺寸:100px*100px - - - - - - - - - diff --git a/app/src/components/decoration/widgets/nav/content.vue b/app/src/components/decoration/widgets/nav/content.vue deleted file mode 100644 index a9abc8ac..00000000 --- a/app/src/components/decoration/widgets/nav/content.vue +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - {{ item.name }} - - - - - - - diff --git a/app/src/components/decoration/widgets/nav/index.ts b/app/src/components/decoration/widgets/nav/index.ts deleted file mode 100644 index c776bce3..00000000 --- a/app/src/components/decoration/widgets/nav/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import attr from './attr.vue' -import content from './content.vue' -import options from './options' -export default { - attr, - content, - options -} diff --git a/app/src/components/decoration/widgets/nav/options.ts b/app/src/components/decoration/widgets/nav/options.ts deleted file mode 100644 index 3e626feb..00000000 --- a/app/src/components/decoration/widgets/nav/options.ts +++ /dev/null @@ -1,15 +0,0 @@ -export default () => ({ - title: '导航菜单', - name: 'nav', - content: { - enabled: 1, - data: [ - { - image: '', - name: '导航', - link: {} - } - ] - }, - styles: {} -}) diff --git a/app/src/components/decoration/widgets/search/attr.vue b/app/src/components/decoration/widgets/search/attr.vue deleted file mode 100644 index 93f92786..00000000 --- a/app/src/components/decoration/widgets/search/attr.vue +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/app/src/components/decoration/widgets/search/content.vue b/app/src/components/decoration/widgets/search/content.vue deleted file mode 100644 index db2a07a5..00000000 --- a/app/src/components/decoration/widgets/search/content.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - - - 请输入关键词搜索 - - - - - - diff --git a/app/src/components/decoration/widgets/search/index.ts b/app/src/components/decoration/widgets/search/index.ts deleted file mode 100644 index c776bce3..00000000 --- a/app/src/components/decoration/widgets/search/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import attr from './attr.vue' -import content from './content.vue' -import options from './options' -export default { - attr, - content, - options -} diff --git a/app/src/components/decoration/widgets/search/options.ts b/app/src/components/decoration/widgets/search/options.ts deleted file mode 100644 index e02e2983..00000000 --- a/app/src/components/decoration/widgets/search/options.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default () => ({ - title: '搜索', - name: 'search', - disabled: 1, - content: {}, - styles: {} -}) diff --git a/app/src/components/decoration/widgets/user-banner/attr.vue b/app/src/components/decoration/widgets/user-banner/attr.vue deleted file mode 100644 index 98b4d2ed..00000000 --- a/app/src/components/decoration/widgets/user-banner/attr.vue +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 开启 - 停用 - - - - - 最多添加5张,建议图片尺寸:750px*200px - - - - - - - - - - - - - - - - - 添加图片 - - - - - - - diff --git a/app/src/components/decoration/widgets/user-banner/content.vue b/app/src/components/decoration/widgets/user-banner/content.vue deleted file mode 100644 index 9c3ec86d..00000000 --- a/app/src/components/decoration/widgets/user-banner/content.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - diff --git a/app/src/components/decoration/widgets/user-banner/index.ts b/app/src/components/decoration/widgets/user-banner/index.ts deleted file mode 100644 index c776bce3..00000000 --- a/app/src/components/decoration/widgets/user-banner/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import attr from './attr.vue' -import content from './content.vue' -import options from './options' -export default { - attr, - content, - options -} diff --git a/app/src/components/decoration/widgets/user-banner/options.ts b/app/src/components/decoration/widgets/user-banner/options.ts deleted file mode 100644 index 4adc70e7..00000000 --- a/app/src/components/decoration/widgets/user-banner/options.ts +++ /dev/null @@ -1,15 +0,0 @@ -export default () => ({ - title: '个人中心广告图', - name: 'user-banner', - content: { - enabled: 1, - data: [ - { - image: '', - name: '', - link: {} - } - ] - }, - styles: {} -}) diff --git a/app/src/components/decoration/widgets/user-info/attr.vue b/app/src/components/decoration/widgets/user-info/attr.vue deleted file mode 100644 index 93f92786..00000000 --- a/app/src/components/decoration/widgets/user-info/attr.vue +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/app/src/components/decoration/widgets/user-info/content.vue b/app/src/components/decoration/widgets/user-info/content.vue deleted file mode 100644 index dca207d9..00000000 --- a/app/src/components/decoration/widgets/user-info/content.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - - 未登录 - - - - - diff --git a/app/src/components/decoration/widgets/user-info/images/default_avatar.png b/app/src/components/decoration/widgets/user-info/images/default_avatar.png deleted file mode 100644 index de31d02a..00000000 Binary files a/app/src/components/decoration/widgets/user-info/images/default_avatar.png and /dev/null differ diff --git a/app/src/components/decoration/widgets/user-info/images/my_topbg.png b/app/src/components/decoration/widgets/user-info/images/my_topbg.png deleted file mode 100644 index 89844383..00000000 Binary files a/app/src/components/decoration/widgets/user-info/images/my_topbg.png and /dev/null differ diff --git a/app/src/components/decoration/widgets/user-info/index.ts b/app/src/components/decoration/widgets/user-info/index.ts deleted file mode 100644 index c776bce3..00000000 --- a/app/src/components/decoration/widgets/user-info/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import attr from './attr.vue' -import content from './content.vue' -import options from './options' -export default { - attr, - content, - options -} diff --git a/app/src/components/decoration/widgets/user-info/options.ts b/app/src/components/decoration/widgets/user-info/options.ts deleted file mode 100644 index b3468292..00000000 --- a/app/src/components/decoration/widgets/user-info/options.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default () => ({ - title: '用户信息', - name: 'user-info', - disabled: 1, - content: {}, - styles: {} -}) diff --git a/app/src/components/widgets/banner/banner.vue b/app/src/components/widgets/banner/banner.vue new file mode 100644 index 00000000..bc13aaf0 --- /dev/null +++ b/app/src/components/widgets/banner/banner.vue @@ -0,0 +1,29 @@ + + + + + + + + + + + + + diff --git a/app/src/components/widgets/nav/nav.vue b/app/src/components/widgets/nav/nav.vue new file mode 100644 index 00000000..8a752e15 --- /dev/null +++ b/app/src/components/widgets/nav/nav.vue @@ -0,0 +1,29 @@ + + + + + + {{ item.name }} + + + + + + + + diff --git a/app/src/components/widgets/search/search.vue b/app/src/components/widgets/search/search.vue new file mode 100644 index 00000000..7c43a669 --- /dev/null +++ b/app/src/components/widgets/search/search.vue @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/app/src/pages.json b/app/src/pages.json index 5526df9f..8f5f43de 100644 --- a/app/src/pages.json +++ b/app/src/pages.json @@ -59,7 +59,8 @@ }, "easycom": { "custom": { - "^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)": "z-paging/components/z-paging$1/z-paging$1.vue" + "^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)": "z-paging/components/z-paging$1/z-paging$1.vue", + "^w-(.*)": "@/components/widgets/$1/$1.vue" } } } diff --git a/app/src/pages/index/index.vue b/app/src/pages/index/index.vue index ea40a7aa..a3235d5a 100644 --- a/app/src/pages/index/index.vue +++ b/app/src/pages/index/index.vue @@ -1,11 +1,22 @@ - - - 跳转到新页面 - + + + - + diff --git a/app/src/pages/login/login.vue b/app/src/pages/login/login.vue index 7a136291..59b6df72 100644 --- a/app/src/pages/login/login.vue +++ b/app/src/pages/login/login.vue @@ -1,5 +1,7 @@ - + @@ -138,7 +140,7 @@ const sendSms = async () => { uCodeRef.value?.start() } } -const accountLogin = async (scene: LoginTypeEnum) => { +const accountLogin = async (scene: LoginTypeEnum, code?: string) => { if (!isCheckAgreement.value) return uni.$u.toast('请勾选已阅读并同意《服务协议》和《隐私协议》') if (scene == LoginTypeEnum.ACCOUNT) { if (!formData.username) return uni.$u.toast('请输入账号/手机号码') @@ -148,8 +150,12 @@ const accountLogin = async (scene: LoginTypeEnum) => { if (!formData.mobile) return uni.$u.toast('请输入手机号码') if (!formData.code) return uni.$u.toast('请输入验证码') } - - await login({ ...formData, scene }) + const params = { + ...formData, + scene + } + if (code) params.code = code + await login(params) uni.$u.toast('登录成功') uni.navigateBack() } @@ -158,7 +164,8 @@ const wxLogin = async () => { const data: any = await uni.login({ provider: 'weixin' }) - accountLogin(LoginTypeEnum.MNP) + console.log(data) + accountLogin(LoginTypeEnum.MNP, data.code) } diff --git a/app/src/styles/public.scss b/app/src/styles/public.scss index f5fc4f49..e4799b22 100644 --- a/app/src/styles/public.scss +++ b/app/src/styles/public.scss @@ -1,3 +1,3 @@ -// .input-placeholder { -// color: $u-info !important; -// } +page { + background-color: $u-bg-color; +}