-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
83 changed files
with
3,587 additions
and
1,899 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,3 +77,5 @@ sync_hook.script | |
project.private.config.json | ||
private.key | ||
private.*.key | ||
|
||
backup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// <reference path="./lib.wx.component.d.ts" /> | ||
|
||
declare namespace WechatMiniprogram { | ||
interface FormEvent<Detail extends IAnyObject = IAnyObject> extends CustomEvent { | ||
detail: { | ||
value: Detail | ||
formId: string | ||
} | ||
} | ||
|
||
namespace Component { | ||
interface A { | ||
a: string | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
interface CloudFunctionBaseEvent { | ||
userInfo: { appId: string; openId: string }; | ||
} | ||
|
||
type CloudFunctionEvent<T extends Record<string, any> = {}> = CloudFunctionBaseEvent & T; | ||
interface CloudFunctionContext { | ||
callbackWaitsForEmptyEventLoop: boolean; | ||
memory_limit_in_mb: number; | ||
time_limit_in_ms: number; | ||
request_id: string; | ||
environment: string; | ||
environ: string; | ||
function_version: string; | ||
function_name: string; | ||
namespace: string; | ||
tencentcloud_region: string; | ||
tencentcloud_appid: string; | ||
tencentcloud_uin: string; | ||
} | ||
|
||
interface CloudFunction<Event extends Record<string, any> = {}, Result = void> { | ||
(event: CloudFunctionEvent<Event>, context: CloudFunctionContext): Result; | ||
} | ||
|
||
interface CallCloudOptions { | ||
/** 是否显示加载提示框 */ | ||
loading?: boolean; | ||
/** 是否显示错误提示框 */ | ||
showError?: boolean; | ||
} | ||
|
||
interface CallCloud { | ||
(name: 'login', data: Record<string, any>, options: CallCloudOptions): Promise<any>; | ||
|
||
(name: 'doouban', data: Record<string, any>, options: CallCloudOptions): Promise<any>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const db = wx.cloud.database(); | ||
|
||
export const getBanners = () => { | ||
return db.collection('banners') | ||
.orderBy('id', 'desc') | ||
.limit(4) | ||
.get() | ||
.then(({ data }) => data); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as AV from '../../libs/av-live-query-core-min'; | ||
|
||
/** | ||
* @returns {Promise<any[]>} | ||
*/ | ||
export const getBanners = async () => { | ||
const query = new AV.Query('Banner'); | ||
const data = await query.find(); | ||
return data.map((item) => { | ||
const { attributes, ...cols } = item; | ||
return { ...cols, ... attributes }; | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { request } from '../../utils/request' | ||
|
||
/** | ||
* @param {RequestOption} config | ||
*/ | ||
const fetch = async (config) => { | ||
config.baseURL = 'https://sanphantom.com/go' | ||
const resp = await request(config) | ||
if (resp.ok) { | ||
return resp | ||
} | ||
return Promise.reject(resp.data) | ||
} | ||
|
||
export const apiGetBanners = () => { | ||
return fetch({ url: '/banners' }) | ||
} | ||
|
||
export const apiGetHotMovies = (data) => { | ||
return fetch({ url: '/douban/hot/items', data }) | ||
} | ||
|
||
export const apiGetShowingMovies = (data) => { | ||
return fetch({ url: '/douban/showing/items', data }) | ||
} | ||
|
||
export const apiGetSoonMovies = (data) => { | ||
return fetch({ url: '/douban/soon/items', data }) | ||
} | ||
|
||
export const apiGetDetail = (params) => { | ||
const { id, type = 'movie' } = params | ||
return fetch({ url: `/douban/${type}/${id}` }) | ||
} | ||
|
||
export const apiGetCelebrities = (params) => { | ||
const { id, type = 'movie' } = params | ||
return fetch({ url: `/douban/${type}/${id}/celebrities` }) | ||
} | ||
|
||
export const apiSearch = (data) => { | ||
return fetch({ url: '/douban/search', data }) | ||
} | ||
|
||
export const apiGetPhotos = (params) => { | ||
const { id, type = 'movie', ...data } = params | ||
return fetch({ url: `/douban/${type}/${id}/photos`, data }) | ||
} | ||
|
||
export const apiGetInterests = (params) => { | ||
const { id, type = 'movie', ...data } = params | ||
return fetch({ url: `/douban/${type}/${id}/interests`, data }) | ||
} | ||
|
||
export const apiGetUserInterests = (userID, data) => { | ||
return fetch({ url: `/douban/user/${userID}/interests`, data }) | ||
} | ||
|
||
export const apiGetCaptcha = (data) => { | ||
return fetch({ | ||
url: '/douban/login/request_phone_code', | ||
method: 'POST', | ||
data | ||
}) | ||
} | ||
|
||
export const apiVerifyCaptcha = (data) => { | ||
return fetch({ | ||
url: '/douban/login/verify_phone_code', | ||
method: 'POST', | ||
data | ||
}) | ||
} |
Oops, something went wrong.