feat: move pc project
This commit is contained in:
parent
4a940f28ba
commit
f61c744a30
209 changed files with 37132 additions and 5032 deletions
16
.editorconfig
Normal file
16
.editorconfig
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# http://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
8
.eslintignore
Normal file
8
.eslintignore
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/lambda/
|
||||
/scripts
|
||||
/config
|
||||
.history
|
||||
public
|
||||
dist
|
||||
.umi
|
||||
mock
|
||||
7
.eslintrc.js
Normal file
7
.eslintrc.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
module.exports = {
|
||||
extends: [require.resolve('@umijs/lint/dist/config/eslint')],
|
||||
globals: {
|
||||
page: true,
|
||||
REACT_APP_ENV: true,
|
||||
},
|
||||
};
|
||||
52
.gitignore
vendored
52
.gitignore
vendored
|
|
@ -1,15 +1,41 @@
|
|||
node_modules/
|
||||
yarn-error.log
|
||||
miniprogram/
|
||||
miniprogram_npm/
|
||||
miniprogram_dist/
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
**/node_modules
|
||||
# roadhog-api-doc ignore
|
||||
/src/utils/request-temp.js
|
||||
_roadhog-api-doc
|
||||
|
||||
# production
|
||||
/dist
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
$node_modules/
|
||||
.history/
|
||||
**/dist
|
||||
components/**/*.lock
|
||||
components/**/package-lock.json
|
||||
package-lock.json
|
||||
npm-debug.log*
|
||||
yarn-error.log
|
||||
|
||||
/coverage
|
||||
.idea
|
||||
yarn.lock
|
||||
project.private.config.json
|
||||
.eslintcache
|
||||
package-lock.json
|
||||
*bak
|
||||
.vscode
|
||||
|
||||
|
||||
# visual studio code
|
||||
.history
|
||||
*.log
|
||||
functions/*
|
||||
.temp/**
|
||||
|
||||
# umi
|
||||
.umi
|
||||
.umi-production
|
||||
.umi-test
|
||||
|
||||
# screenshot
|
||||
screenshot
|
||||
.firebase
|
||||
.eslintcache
|
||||
|
||||
build
|
||||
|
|
|
|||
22
.prettierignore
Normal file
22
.prettierignore
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
**/*.svg
|
||||
.umi
|
||||
.umi-production
|
||||
/dist
|
||||
.dockerignore
|
||||
.DS_Store
|
||||
.eslintignore
|
||||
*.png
|
||||
*.toml
|
||||
docker
|
||||
.editorconfig
|
||||
Dockerfile*
|
||||
.gitignore
|
||||
.prettierignore
|
||||
LICENSE
|
||||
.eslintcache
|
||||
*.lock
|
||||
yarn-error.log
|
||||
.history
|
||||
CNAME
|
||||
/build
|
||||
/public
|
||||
26
.prettierrc.js
Normal file
26
.prettierrc.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
module.exports = {
|
||||
singleQuote: true,
|
||||
trailingComma: 'all',
|
||||
printWidth: 100,
|
||||
proseWrap: 'never',
|
||||
endOfLine: 'lf',
|
||||
overrides: [
|
||||
{
|
||||
files: '.prettierrc',
|
||||
options: {
|
||||
parser: 'json',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: 'document.ejs',
|
||||
options: {
|
||||
parser: 'html',
|
||||
},
|
||||
},
|
||||
],
|
||||
plugins: [
|
||||
'prettier-plugin-organize-imports',
|
||||
'prettier-plugin-packagejson',
|
||||
'prettier-plugin-two-style-order',
|
||||
],
|
||||
};
|
||||
34
README.md
Normal file
34
README.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
https://www.figma.com/file/ZHTlv6VKz6As6gVlG2KnmG/Merchant-Management-System?type=design&node-id=19-2&mode=design&t=cZ9I7U9SAJVxQlqk-0
|
||||
|
||||
|
||||
https://procomponents.ant.design/components/field-set#proformmoney
|
||||
|
||||
|
||||
|
||||
node: >=18
|
||||
|
||||
|
||||
|
||||
-- 非体验课课程订单
|
||||
SELECT ol.order_no,ROUND(ol.money/100,2) as money,ROUND(ol.inner_money/100,2) as inner_money,ol.pay_status,u.nick_name2,u.phone,ol.refund_mark, ol.create_time,ol.refund_time,g.title
|
||||
FROM `order_list` ol join order_classes oc on oc.order_id = ol.id join `user` u on u.id = ol.user_id join ground g on g.id = oc.ground_id
|
||||
WHERE ol.`pay_time` IS NOT NULL and ol.type = 'classes'
|
||||
|
||||
-- 体验课课程订单
|
||||
SELECT ol.order_no,ROUND(ol.money/100,2) as money,ROUND(ol.inner_money/100,2) as inner_money,ol.pay_status,u.nick_name2,u.phone,ol.refund_mark, ol.create_time,ol.refund_time
|
||||
FROM `order_list` ol join order_classes oc on oc.order_id = ol.id join `user` u on u.id = ol.user_id WHERE ol.`pay_time` IS NOT NULL and ol.type = 'classes'
|
||||
|
||||
-- 场地预定订单
|
||||
SELECT ol.order_no,ROUND(ol.money/100,2) as money,ROUND(ol.inner_money/100,2) as inner_money,ol.pay_status,u.nick_name2,u.phone,ol.refund_mark,g.title, ol.create_time,ol.refund_time
|
||||
FROM `order_list` ol join order_ground og on og.order_id = ol.id join `user` u on u.id = ol.user_id join ground g on g.id = og.ground_id WHERE `pay_time` IS NOT NULL and type = 'ground'
|
||||
|
||||
-- 充值卡订单
|
||||
SELECT ol.order_no,ROUND(ol.money/100,2) as money,ROUND(ol.inner_money/100,2) as inner_money,ol.pay_status,u.nick_name2,u.phone,ol.refund_mark, ol.create_time,ol.refund_time
|
||||
FROM `order_list` ol join order_vip ov on ov.order_id = ol.id join `user` u on u.id = ol.user_id WHERE `pay_time` IS NOT NULL and type = 'vip'
|
||||
|
||||
|
||||
-- 查询已支付和已退款的畅打订单
|
||||
SELECT ol.order_no,ROUND(ol.money/100,2) as money,ROUND(ol.inner_money/100,2) as inner_money,ol.pay_status,u.nick_name2,u.phone,ol.refund_mark,g.title, ol.create_time,ol.refund_time
|
||||
FROM `order_list` ol
|
||||
join order_teacher_groupact_book oo on oo.order_id = ol.id join `user` u on u.id = ol.user_id
|
||||
join teacher_groupact_book tg on tg.id = oo.teacher_groupact_book_id join ground g on g.id = tg.ground_id WHERE ol.`pay_time` IS NOT NULL and ol.type = 'groupact'
|
||||
9
app.js
9
app.js
|
|
@ -1,9 +0,0 @@
|
|||
import updateManager from './common/updateManager';
|
||||
|
||||
App({
|
||||
onLaunch: function () {
|
||||
},
|
||||
onShow: function () {
|
||||
updateManager();
|
||||
},
|
||||
});
|
||||
53
app.json
53
app.json
|
|
@ -1,53 +0,0 @@
|
|||
{
|
||||
"pages": [
|
||||
"pages/home/home",
|
||||
"pages/paylist/paylist",
|
||||
"pages/news_list/home",
|
||||
"pages/news_admin_list/home",
|
||||
"pages/usercenter/index",
|
||||
"pages/detail/detail",
|
||||
"pages/detail_admin/detail",
|
||||
"pages/takephoto/takephoto",
|
||||
"pages/faxianlist/faxianlist",
|
||||
"pages/test/test",
|
||||
"pages/shop/shop",
|
||||
"pages/pay/pay",
|
||||
"pages/createpay/createpay",
|
||||
"pages/sharebuy/sharebuy",
|
||||
"pages/usercenter/info",
|
||||
"pages/sharelist/sharelist",
|
||||
"pages/webview/webview"
|
||||
],
|
||||
"tabBar": {
|
||||
"custom": true,
|
||||
"color": "#666666",
|
||||
"selectedColor": "#FF5F15",
|
||||
"backgroundColor": "#ffffff",
|
||||
"borderStyle": "black",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/home/home",
|
||||
"text": "首页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/faxianlist/faxianlist",
|
||||
"text": "分销"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/usercenter/index",
|
||||
"text": "我的"
|
||||
}
|
||||
]
|
||||
},
|
||||
"requiredPrivateInfos": [],
|
||||
"lazyCodeLoading": "requiredComponents",
|
||||
"usingComponents": {},
|
||||
"window": {
|
||||
"backgroundTextStyle": "light",
|
||||
"navigationBarBackgroundColor": "#fff",
|
||||
"navigationBarTitleText": "Weixin",
|
||||
"navigationBarTextStyle": "black"
|
||||
},
|
||||
"sitemapLocation": "sitemap.json",
|
||||
"permission": {}
|
||||
}
|
||||
3
app.wxss
3
app.wxss
|
|
@ -1,3 +0,0 @@
|
|||
@import 'style/iconfont.wxss';
|
||||
|
||||
@import 'style/theme.wxss';
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
export default () => {
|
||||
if (!wx.canIUse('getUpdateManager')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const updateManager = wx.getUpdateManager();
|
||||
|
||||
updateManager.onCheckForUpdate(function (res) {
|
||||
// 请求完新版本信息的回调
|
||||
console.log('版本信息', res);
|
||||
});
|
||||
|
||||
updateManager.onUpdateReady(function () {
|
||||
wx.showModal({
|
||||
title: '更新提示',
|
||||
content: '新版本已经准备好,是否重启应用?',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||
updateManager.applyUpdate();
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
updateManager.onUpdateFailed(function () {
|
||||
// 新版本下载失败
|
||||
});
|
||||
};
|
||||
163
config/config.ts
Normal file
163
config/config.ts
Normal file
|
|
@ -0,0 +1,163 @@
|
|||
// https://umijs.org/config/
|
||||
import { defineConfig } from '@umijs/max';
|
||||
import { join } from 'path';
|
||||
import defaultSettings from './defaultSettings';
|
||||
import proxy from './proxy';
|
||||
|
||||
import routes from './routes';
|
||||
|
||||
const { REACT_APP_ENV = 'dev' } = process.env;
|
||||
|
||||
export default defineConfig({
|
||||
/**
|
||||
* @name 开启 hash 模式
|
||||
* @description 让 build 之后的产物包含 hash 后缀。通常用于增量发布和避免浏览器加载缓存。
|
||||
* @doc https://umijs.org/docs/api/config#hash
|
||||
*/
|
||||
hash: true,
|
||||
|
||||
/**
|
||||
* @name 兼容性设置
|
||||
* @description 设置 ie11 不一定完美兼容,需要检查自己使用的所有依赖
|
||||
* @doc https://umijs.org/docs/api/config#targets
|
||||
*/
|
||||
// targets: {
|
||||
// ie: 11,
|
||||
// },
|
||||
/**
|
||||
* @name 路由的配置,不在路由中引入的文件不会编译
|
||||
* @description 只支持 path,component,routes,redirect,wrappers,title 的配置
|
||||
* @doc https://umijs.org/docs/guides/routes
|
||||
*/
|
||||
// umi routes: https://umijs.org/docs/routing
|
||||
routes,
|
||||
/**
|
||||
* @name 主题的配置
|
||||
* @description 虽然叫主题,但是其实只是 less 的变量设置
|
||||
* @doc antd的主题设置 https://ant.design/docs/react/customize-theme-cn
|
||||
* @doc umi 的theme 配置 https://umijs.org/docs/api/config#theme
|
||||
*/
|
||||
theme: {
|
||||
// 如果不想要 configProvide 动态设置主题需要把这个设置为 default
|
||||
// 只有设置为 variable, 才能使用 configProvide 动态设置主色调
|
||||
'root-entry-name': 'variable',
|
||||
},
|
||||
/**
|
||||
* @name moment 的国际化配置
|
||||
* @description 如果对国际化没有要求,打开之后能减少js的包大小
|
||||
* @doc https://umijs.org/docs/api/config#ignoremomentlocale
|
||||
*/
|
||||
ignoreMomentLocale: true,
|
||||
/**
|
||||
* @name 代理配置
|
||||
* @description 可以让你的本地服务器代理到你的服务器上,这样你就可以访问服务器的数据了
|
||||
* @see 要注意以下 代理只能在本地开发时使用,build 之后就无法使用了。
|
||||
* @doc 代理介绍 https://umijs.org/docs/guides/proxy
|
||||
* @doc 代理配置 https://umijs.org/docs/api/config#proxy
|
||||
*/
|
||||
proxy: proxy[REACT_APP_ENV as keyof typeof proxy],
|
||||
/**
|
||||
* @name 快速热更新配置
|
||||
* @description 一个不错的热更新组件,更新时可以保留 state
|
||||
*/
|
||||
fastRefresh: true,
|
||||
//============== 以下都是max的插件配置 ===============
|
||||
/**
|
||||
* @name 数据流插件
|
||||
* @@doc https://umijs.org/docs/max/data-flow
|
||||
*/
|
||||
model: {},
|
||||
/**
|
||||
* 一个全局的初始数据流,可以用它在插件之间共享数据
|
||||
* @description 可以用来存放一些全局的数据,比如用户信息,或者一些全局的状态,全局初始状态在整个 Umi 项目的最开始创建。
|
||||
* @doc https://umijs.org/docs/max/data-flow#%E5%85%A8%E5%B1%80%E5%88%9D%E5%A7%8B%E7%8A%B6%E6%80%81
|
||||
*/
|
||||
initialState: {},
|
||||
/**
|
||||
* @name layout 插件
|
||||
* @doc https://umijs.org/docs/max/layout-menu
|
||||
*/
|
||||
title: '三鲤',
|
||||
layout: {
|
||||
// locale: true,
|
||||
...defaultSettings,
|
||||
},
|
||||
/**
|
||||
* @name moment2dayjs 插件
|
||||
* @description 将项目中的 moment 替换为 dayjs
|
||||
* @doc https://umijs.org/docs/max/moment2dayjs
|
||||
*/
|
||||
moment2dayjs: {
|
||||
preset: 'antd',
|
||||
plugins: ['duration'],
|
||||
},
|
||||
/**
|
||||
* @name 国际化插件
|
||||
* @doc https://umijs.org/docs/max/i18n
|
||||
*/
|
||||
locale: {
|
||||
// default zh-CN
|
||||
default: 'zh-CN',
|
||||
antd: true,
|
||||
// default true, when it is true, will use `navigator.language` overwrite default
|
||||
baseNavigator: false,
|
||||
},
|
||||
/**
|
||||
* @name antd 插件
|
||||
* @description 内置了 babel import 插件
|
||||
* @doc https://umijs.org/docs/max/antd#antd
|
||||
*/
|
||||
antd: {},
|
||||
/**
|
||||
* @name 网络请求配置
|
||||
* @description 它基于 axios 和 ahooks 的 useRequest 提供了一套统一的网络请求和错误处理方案。
|
||||
* @doc https://umijs.org/docs/max/request
|
||||
*/
|
||||
request: {},
|
||||
/**
|
||||
* @name 权限插件
|
||||
* @description 基于 initialState 的权限插件,必须先打开 initialState
|
||||
* @doc https://umijs.org/docs/max/access
|
||||
*/
|
||||
access: {},
|
||||
/**
|
||||
* @name <head> 中额外的 script
|
||||
* @description 配置 <head> 中额外的 script
|
||||
*/
|
||||
headScripts: [
|
||||
// 解决首次加载时白屏的问题
|
||||
{ src: './scripts/loading.js', async: true },
|
||||
{ src: '//webapi.amap.com/maps?v=2.0&key=b957b91028e7d7c79f0240a7c2a776d2', async: true },
|
||||
],
|
||||
//================ pro 插件配置 =================
|
||||
presets: ['umi-presets-pro'],
|
||||
/**
|
||||
* @name openAPI 插件的配置
|
||||
* @description 基于 openapi 的规范生成serve 和mock,能减少很多样板代码
|
||||
* @doc https://pro.ant.design/zh-cn/docs/openapi/
|
||||
*/
|
||||
openAPI: [
|
||||
{
|
||||
requestLibPath: "import { request } from '@umijs/max'",
|
||||
// 或者使用在线的版本
|
||||
// schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
|
||||
schemaPath: join(__dirname, 'oneapi.json'),
|
||||
mock: false,
|
||||
},
|
||||
{
|
||||
requestLibPath: "import { request } from '@umijs/max'",
|
||||
schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
|
||||
projectName: 'swagger',
|
||||
},
|
||||
],
|
||||
mock: {
|
||||
include: ['mock/**/*', 'src/pages/**/_mock.ts'],
|
||||
},
|
||||
mfsu: {
|
||||
strategy: 'normal',
|
||||
},
|
||||
esbuildMinifyIIFE: true,
|
||||
requestRecord: {},
|
||||
publicPath: "/liiistem/web/",
|
||||
history: { type: 'hash' }
|
||||
});
|
||||
33
config/defaultSettings.ts
Normal file
33
config/defaultSettings.ts
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { ProLayoutProps } from '@ant-design/pro-components';
|
||||
|
||||
/**
|
||||
* @name
|
||||
*/
|
||||
const Settings: ProLayoutProps & {
|
||||
pwa?: boolean;
|
||||
logo?: string;
|
||||
} = {
|
||||
navTheme: 'light',
|
||||
// 拂晓蓝
|
||||
colorPrimary: '#1890ff',
|
||||
layout: 'mix',
|
||||
contentWidth: 'Fluid',
|
||||
fixedHeader: true,
|
||||
fixSiderbar: true,
|
||||
colorWeak: false,
|
||||
title: 'Liiistem',
|
||||
pwa: true,
|
||||
logo: './logo.png',
|
||||
iconfontUrl: '',
|
||||
menu: {
|
||||
locale: false,
|
||||
},
|
||||
token: {
|
||||
// 参见ts声明,demo 见文档,通过token 修改样式
|
||||
//https://procomponents.ant.design/components/layout#%E9%80%9A%E8%BF%87-token-%E4%BF%AE%E6%94%B9%E6%A0%B7%E5%BC%8F
|
||||
},
|
||||
splitMenus: false,
|
||||
siderMenuType: "sub",
|
||||
};
|
||||
|
||||
export default Settings;
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
export const config = {
|
||||
/** 是否使用mock代替api返回 */
|
||||
useMock: true,
|
||||
};
|
||||
593
config/oneapi.json
Normal file
593
config/oneapi.json
Normal file
|
|
@ -0,0 +1,593 @@
|
|||
{
|
||||
"openapi": "3.0.1",
|
||||
"info": {
|
||||
"title": "Ant Design Pro",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "http://localhost:8000/"
|
||||
},
|
||||
{
|
||||
"url": "https://localhost:8000/"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"/api/currentUser": {
|
||||
"get": {
|
||||
"tags": ["api"],
|
||||
"description": "获取当前的用户",
|
||||
"operationId": "currentUser",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/CurrentUser"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Error",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-swagger-router-controller": "api"
|
||||
},
|
||||
"/api/login/captcha": {
|
||||
"post": {
|
||||
"description": "发送验证码",
|
||||
"operationId": "getFakeCaptcha",
|
||||
"tags": ["login"],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "phone",
|
||||
"in": "query",
|
||||
"description": "手机号",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/FakeCaptcha"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/login/outLogin": {
|
||||
"post": {
|
||||
"description": "登录接口",
|
||||
"operationId": "outLogin",
|
||||
"tags": ["login"],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Error",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-swagger-router-controller": "api"
|
||||
},
|
||||
"/api/login/account": {
|
||||
"post": {
|
||||
"tags": ["login"],
|
||||
"description": "登录接口",
|
||||
"operationId": "login",
|
||||
"requestBody": {
|
||||
"description": "登录系统",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/LoginParams"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/LoginResult"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Error",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-codegen-request-body-name": "body"
|
||||
},
|
||||
"x-swagger-router-controller": "api"
|
||||
},
|
||||
"/api/notices": {
|
||||
"summary": "getNotices",
|
||||
"description": "NoticeIconItem",
|
||||
"get": {
|
||||
"tags": ["api"],
|
||||
"operationId": "getNotices",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/NoticeIconList"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/rule": {
|
||||
"get": {
|
||||
"tags": ["rule"],
|
||||
"description": "获取规则列表",
|
||||
"operationId": "rule",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "current",
|
||||
"in": "query",
|
||||
"description": "当前的页码",
|
||||
"schema": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pageSize",
|
||||
"in": "query",
|
||||
"description": "页面的容量",
|
||||
"schema": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/RuleList"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Error",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"tags": ["rule"],
|
||||
"description": "新建规则",
|
||||
"operationId": "addRule",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/RuleListItem"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Error",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"tags": ["rule"],
|
||||
"description": "新建规则",
|
||||
"operationId": "updateRule",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/RuleListItem"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Error",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"tags": ["rule"],
|
||||
"description": "删除规则",
|
||||
"operationId": "removeRule",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Error",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-swagger-router-controller": "api"
|
||||
},
|
||||
"/swagger": {
|
||||
"x-swagger-pipe": "swagger_raw"
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"schemas": {
|
||||
"CurrentUser": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"avatar": {
|
||||
"type": "string"
|
||||
},
|
||||
"userid": {
|
||||
"type": "string"
|
||||
},
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"signature": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"group": {
|
||||
"type": "string"
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"key": {
|
||||
"type": "string"
|
||||
},
|
||||
"label": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"notifyCount": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"unreadCount": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"country": {
|
||||
"type": "string"
|
||||
},
|
||||
"access": {
|
||||
"type": "string"
|
||||
},
|
||||
"geographic": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"province": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"label": {
|
||||
"type": "string"
|
||||
},
|
||||
"key": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"city": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"label": {
|
||||
"type": "string"
|
||||
},
|
||||
"key": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"address": {
|
||||
"type": "string"
|
||||
},
|
||||
"phone": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"LoginResult": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
"currentAuthority": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"PageParams": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"current": {
|
||||
"type": "number"
|
||||
},
|
||||
"pageSize": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
},
|
||||
"RuleListItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"key": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"disabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"href": {
|
||||
"type": "string"
|
||||
},
|
||||
"avatar": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"owner": {
|
||||
"type": "string"
|
||||
},
|
||||
"desc": {
|
||||
"type": "string"
|
||||
},
|
||||
"callNo": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"status": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string",
|
||||
"format": "datetime"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string",
|
||||
"format": "datetime"
|
||||
},
|
||||
"progress": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
}
|
||||
}
|
||||
},
|
||||
"RuleList": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/RuleListItem"
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"type": "integer",
|
||||
"description": "列表的内容总数",
|
||||
"format": "int32"
|
||||
},
|
||||
"success": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"FakeCaptcha": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"LoginParams": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"username": {
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"autoLogin": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ErrorResponse": {
|
||||
"required": ["errorCode"],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"errorCode": {
|
||||
"type": "string",
|
||||
"description": "业务约定的错误码"
|
||||
},
|
||||
"errorMessage": {
|
||||
"type": "string",
|
||||
"description": "业务上的错误信息"
|
||||
},
|
||||
"success": {
|
||||
"type": "boolean",
|
||||
"description": "业务上的请求是否成功"
|
||||
}
|
||||
}
|
||||
},
|
||||
"NoticeIconList": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/NoticeIconItem"
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"type": "integer",
|
||||
"description": "列表的内容总数",
|
||||
"format": "int32"
|
||||
},
|
||||
"success": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"NoticeIconItemType": {
|
||||
"title": "NoticeIconItemType",
|
||||
"description": "已读未读列表的枚举",
|
||||
"type": "string",
|
||||
"properties": {},
|
||||
"enum": ["notification", "message", "event"]
|
||||
},
|
||||
"NoticeIconItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"extra": {
|
||||
"type": "string",
|
||||
"format": "any"
|
||||
},
|
||||
"key": { "type": "string" },
|
||||
"read": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"avatar": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"datetime": {
|
||||
"type": "string",
|
||||
"format": "date"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"extensions": {
|
||||
"x-is-enum": true
|
||||
},
|
||||
"$ref": "#/components/schemas/NoticeIconItemType"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
51
config/proxy.ts
Normal file
51
config/proxy.ts
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/**
|
||||
* @name 代理的配置
|
||||
* @see 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
|
||||
* -------------------------------
|
||||
* The agent cannot take effect in the production environment
|
||||
* so there is no configuration of the production environment
|
||||
* For details, please see
|
||||
* https://pro.ant.design/docs/deploy
|
||||
*
|
||||
* @doc https://umijs.org/docs/guides/proxy
|
||||
*/
|
||||
export default {
|
||||
// 如果需要自定义本地开发服务器 请取消注释按需调整
|
||||
dev: {
|
||||
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
|
||||
'/liiistem': {
|
||||
// 要代理的地址
|
||||
target: 'https://civcar.zhonganonline.top/',
|
||||
// 配置了这个可以从 http 代理到 https
|
||||
// 依赖 origin 的功能可能需要这个,比如 cookie
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api/': {
|
||||
// 要代理的地址
|
||||
target: 'https://proapi.azurewebsites.net',
|
||||
// 配置了这个可以从 http 代理到 https
|
||||
// 依赖 origin 的功能可能需要这个,比如 cookie
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* @name 详细的代理配置
|
||||
* @doc https://github.com/chimurai/http-proxy-middleware
|
||||
*/
|
||||
test: {
|
||||
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
|
||||
'/api/': {
|
||||
target: 'https://proapi.azurewebsites.net',
|
||||
changeOrigin: true,
|
||||
pathRewrite: { '^': '' },
|
||||
},
|
||||
},
|
||||
pre: {
|
||||
'/api/': {
|
||||
target: 'your pre url',
|
||||
changeOrigin: true,
|
||||
pathRewrite: { '^': '' },
|
||||
},
|
||||
},
|
||||
};
|
||||
292
config/routes.ts
Normal file
292
config/routes.ts
Normal file
|
|
@ -0,0 +1,292 @@
|
|||
/**
|
||||
* @name umi 的路由配置
|
||||
* @description 只支持 path,component,routes,redirect,wrappers,name,icon 的配置
|
||||
* @param path path 只支持两种占位符配置,第一种是动态参数 :id 的形式,第二种是 * 通配符,通配符只能出现路由字符串的最后。
|
||||
* @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径,也可以是相对路径,如果是相对路径,会从 src/pages 开始找起。
|
||||
* @param routes 配置子路由,通常在需要为多个路径增加 layout 组件时使用。
|
||||
* @param redirect 配置路由跳转
|
||||
* @param wrappers 配置路由组件的包装组件,通过包装组件可以为当前的路由组件组合进更多的功能。 比如,可以用于路由级别的权限校验
|
||||
* @param name 配置路由的标题,默认读取国际化文件 menu.ts 中 menu.xxxx 的值,如配置 name 为 login,则读取 menu.ts 中 menu.login 的取值作为标题
|
||||
* @param icon 配置路由的图标,取值参考 https://ant.design/components/icon-cn, 注意去除风格后缀和大小写,如想要配置图标为 <StepBackwardOutlined /> 则取值应为 stepBackward 或 StepBackward,如想要配置图标为 <UserOutlined /> 则取值应为 user 或者 User
|
||||
* @doc https://umijs.org/docs/guides/routes
|
||||
*/
|
||||
export default [
|
||||
{
|
||||
path: '/dashboard',
|
||||
name: '首页',
|
||||
icon: 'Home',
|
||||
component: './dashboard/workplace',
|
||||
},
|
||||
{
|
||||
path: '/news',
|
||||
name: '动态',
|
||||
icon: 'FileText',
|
||||
routes: [
|
||||
{
|
||||
path: '/news',
|
||||
redirect: '/news/list',
|
||||
},
|
||||
{
|
||||
name: '动态列表',
|
||||
path: '/news/list',
|
||||
component: './news/list',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
path: '/banner',
|
||||
name: 'banner',
|
||||
icon: 'FileText',
|
||||
routes: [
|
||||
{
|
||||
path: '/banner',
|
||||
redirect: '/banner/list',
|
||||
},
|
||||
{
|
||||
name: 'banner列表',
|
||||
path: '/banner/list',
|
||||
component: './banner/list',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
// {
|
||||
// path: '/coupon',
|
||||
// name: '优惠券',
|
||||
// icon: 'FileText',
|
||||
// 'access': 'canAdmin',
|
||||
// routes: [
|
||||
// {
|
||||
// path: '/coupon',
|
||||
// redirect: '/coupon/list',
|
||||
// },
|
||||
// {
|
||||
// name: '券类型',
|
||||
// path: '/coupon/list',
|
||||
// component: './coupon/list',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
|
||||
{
|
||||
path: '/member',
|
||||
name: '用户',
|
||||
icon: 'FileText',
|
||||
'access': 'canAdmin',
|
||||
routes: [
|
||||
{
|
||||
path: '/member',
|
||||
redirect: '/member/list',
|
||||
},
|
||||
{
|
||||
name: '用户列表',
|
||||
path: '/member/list',
|
||||
component: './member/list',
|
||||
},
|
||||
],
|
||||
},
|
||||
// {
|
||||
// path: '/ground_place',
|
||||
// name: '用户',
|
||||
// icon: 'FileText',
|
||||
// routes: [
|
||||
// {
|
||||
// path: '/ground_place',
|
||||
// redirect: '/ground_place/list',
|
||||
// },
|
||||
// {
|
||||
// name: '用户列表',
|
||||
// path: '/ground_place/list',
|
||||
// component: './ground_place/list',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
path: '/order',
|
||||
name: '订单管理',
|
||||
icon: 'FileText',
|
||||
'access': 'canAdmin',
|
||||
routes: [
|
||||
{
|
||||
path: '/order',
|
||||
redirect: '/order/list',
|
||||
},
|
||||
{
|
||||
name: '订单列表',
|
||||
path: '/order/list',
|
||||
component: './order/list',
|
||||
'access': 'canAdmin',
|
||||
},
|
||||
],
|
||||
},
|
||||
// {
|
||||
// path: '/groupact',
|
||||
// name: '畅打活动',
|
||||
// icon: 'FileText',
|
||||
// routes: [
|
||||
// {
|
||||
// path: '/groupact',
|
||||
// redirect: '/groupact/list',
|
||||
// },
|
||||
// {
|
||||
// name: '活动列表',
|
||||
// path: '/groupact/list',
|
||||
// component: './groupact/list',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// path: '/match',
|
||||
// name: '赛事',
|
||||
// icon: 'FileText',
|
||||
// routes: [
|
||||
// {
|
||||
// path: '/match',
|
||||
// redirect: '/match/list',
|
||||
// },
|
||||
// {
|
||||
// name: '赛事列表',
|
||||
// path: '/match/list',
|
||||
// component: './match/list',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// path: '/ground',
|
||||
// name: '场馆管理',
|
||||
// icon: 'FileText',
|
||||
// routes: [
|
||||
// {
|
||||
// path: '/ground',
|
||||
// redirect: '/ground/list',
|
||||
// },
|
||||
// {
|
||||
// name: '场馆列表',
|
||||
// path: '/ground/list',
|
||||
// component: './ground/list',
|
||||
// },
|
||||
// {
|
||||
// name: '场地列表',
|
||||
// path: '/ground/place/list/:ground_id',
|
||||
// component: './ground_place/list',
|
||||
// hideInMenu: true,
|
||||
// },
|
||||
// {
|
||||
// name: '场馆预定情况',
|
||||
// path: '/ground/dashboard/:ground_id',
|
||||
// component: './ground/dashboard',
|
||||
// hideInMenu: true,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// path: '/classes',
|
||||
// name: '课程管理',
|
||||
// icon: 'FileText',
|
||||
// 'access': 'canAdmin',
|
||||
// routes: [
|
||||
// {
|
||||
// path: '/classes',
|
||||
// redirect: '/classes/list',
|
||||
// },
|
||||
// {
|
||||
// name: '课程列表',
|
||||
// path: '/classes/list',
|
||||
// component: './classes/list',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// path: '/teacher',
|
||||
// name: '教练管理',
|
||||
// icon: 'FileText',
|
||||
// 'access': 'canAdmin',
|
||||
// routes: [
|
||||
// {
|
||||
// path: '/teacher',
|
||||
// redirect: '/teacher/list',
|
||||
// },
|
||||
// {
|
||||
// name: '教练列表',
|
||||
// path: '/teacher/list',
|
||||
// component: './teacher/list',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
path: '/setting',
|
||||
name: '设置',
|
||||
icon: 'Setting',
|
||||
routes: [
|
||||
{
|
||||
path: '/setting',
|
||||
redirect: '/setting/user/list',
|
||||
},
|
||||
{
|
||||
name: '权限管理',
|
||||
path: '/setting/user/list',
|
||||
component: './setting/user/list',
|
||||
'access': 'canAdmin',
|
||||
},
|
||||
// {
|
||||
// name: '会员等级',
|
||||
// path: '/setting/viplevel/list',
|
||||
// component: './setting/viplevel/list',
|
||||
// 'access': 'canAdmin',
|
||||
// },
|
||||
// {
|
||||
// name: '短信匹配管理',
|
||||
// path: '/setting/sms_match/list',
|
||||
// component: './setting/sms_match/list',
|
||||
// 'access': 'canAdmin',
|
||||
// },
|
||||
{
|
||||
name: '基础配置',
|
||||
path: '/setting/config/list',
|
||||
component: './setting/config/list',
|
||||
// 'access': 'canAdmin',
|
||||
},
|
||||
],
|
||||
},
|
||||
// {
|
||||
// path: '/m',
|
||||
// layout: false,
|
||||
// routes: [
|
||||
// {
|
||||
// path: '/m/shenpi/list',
|
||||
// layout: false,
|
||||
// name: 'm_shenpi_list',
|
||||
// component: './shenpi/mlist',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
path: '/user',
|
||||
layout: false,
|
||||
routes: [
|
||||
{
|
||||
path: '/user/login',
|
||||
layout: false,
|
||||
name: 'login',
|
||||
component: './user/login',
|
||||
},
|
||||
{
|
||||
path: '/user',
|
||||
redirect: '/user/login',
|
||||
},
|
||||
// {
|
||||
// component: '404',
|
||||
// path: '/*',
|
||||
// },
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
component: './root',
|
||||
},
|
||||
{
|
||||
component: '404',
|
||||
path: '/*',
|
||||
},
|
||||
];
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
export default [{
|
||||
icon: 'home',
|
||||
text: '动态',
|
||||
url: 'pages/home/home',
|
||||
},
|
||||
{
|
||||
icon: 'share',
|
||||
text: '分销',
|
||||
url: 'pages/faxianlist/faxianlist',
|
||||
},
|
||||
{
|
||||
icon: 'person',
|
||||
text: '我的',
|
||||
url: 'pages/usercenter/index',
|
||||
},
|
||||
];
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
import TabMenu from './data';
|
||||
import R from '../utils/request';
|
||||
import C from '../utils/constant';
|
||||
Component({
|
||||
data: {
|
||||
active: 0,
|
||||
list: [],
|
||||
is_share: false,
|
||||
cdnHost: C.cdnHost,
|
||||
},
|
||||
|
||||
ready() {
|
||||
R.get('/index.php/api/v1/my').then(({ model }) => {
|
||||
this.setData({
|
||||
is_share: !!model.is_share,
|
||||
list: TabMenu.filter((_, idx) => {
|
||||
if (model.is_share) {
|
||||
return true
|
||||
} else {
|
||||
return idx !== 1
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
goTakePhoto() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/takephoto/takephoto',
|
||||
})
|
||||
},
|
||||
onChange(event) {
|
||||
this.setData({ active: event.detail.value });
|
||||
wx.switchTab({
|
||||
url: this.data.list[event.detail.value].url.startsWith('/')
|
||||
? this.data.list[event.detail.value].url
|
||||
: `/${this.data.list[event.detail.value].url}`,
|
||||
});
|
||||
},
|
||||
|
||||
init() {
|
||||
const page = getCurrentPages().pop();
|
||||
const route = page ? page.route.split('?')[0] : '';
|
||||
const active = this.data.list.findIndex(
|
||||
(item) =>
|
||||
(item.url.startsWith('/') ? item.url.substr(1) : item.url) ===
|
||||
`${route}`,
|
||||
);
|
||||
this.setData({ active });
|
||||
},
|
||||
getPhoneNumber(e) {
|
||||
console.log(e.detail.code) // 动态令牌
|
||||
console.log(e.detail.errMsg) // 回调信息(成功失败都会返回)
|
||||
console.log(e.detail.errno) // 错误码(失败时返回)
|
||||
if (!e.detail.errno) {
|
||||
R.post('/index.php/api/v1/bind_auth_phone', { code: e.detail.code }).then(() => {
|
||||
this.setData({ hasPhone: true })
|
||||
this.goTakePhoto();
|
||||
})
|
||||
} else {
|
||||
// e.detail.errMsg
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-tab-bar": "tdesign-miniprogram/tab-bar/tab-bar",
|
||||
"t-tab-bar-item": "tdesign-miniprogram/tab-bar-item/tab-bar-item",
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"t-image": "tdesign-miniprogram/image/image"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
<view class="tabline">
|
||||
<t-tab-bar value="{{active}}" bindchange="onChange" split="{{false}}">
|
||||
<t-tab-bar-item wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index">
|
||||
<view class="{{'custom-tab-bar-wrapper ' + ('tab' + index) + ' ' + (index == active ? 'cur' : '')}}">
|
||||
<t-icon prefix="wr" name="{{item.icon}}" size="40rpx" />
|
||||
<view class="text">{{ item.text }}</view>
|
||||
</view>
|
||||
</t-tab-bar-item>
|
||||
<!-- <t-tab-bar-item>
|
||||
<view class="{{'custom-tab-bar-wrapper ' + ('tab' + 0) + ' ' + (0 == active ? 'cur' : '')}}">
|
||||
<t-icon prefix="wr" name="{{list[0].icon}}" size="40rpx" />
|
||||
<view class="text">{{ list[0].text }}</view>
|
||||
</view>
|
||||
</t-tab-bar-item>
|
||||
<t-tab-bar-item wx:if="{{is_share}}">
|
||||
<view class="{{'custom-tab-bar-wrapper ' + ('tab' + 1) + ' ' + (1 == active ? 'cur' : '')}}">
|
||||
<t-icon prefix="wr" name="{{list[1].icon}}" size="40rpx" />
|
||||
<view class="text">{{ list[1].text }}</view>
|
||||
</view>
|
||||
</t-tab-bar-item>
|
||||
<t-tab-bar-item>
|
||||
<view class="{{'custom-tab-bar-wrapper ' + ('tab' + 2) + ' ' + (2 == active ? 'cur' : '')}}">
|
||||
<t-icon prefix="wr" name="{{list[2].icon}}" size="40rpx" />
|
||||
<view class="text">{{ list[2].text }}</view>
|
||||
</view>
|
||||
</t-tab-bar-item> -->
|
||||
<!-- <view class="camera" bind:tap="goTakePhoto" wx:if="{{hasPhone}}">
|
||||
<t-image loading=" " mode="aspectFill" src="{{cdnHost + '/static/camera.png?v=5'}}" width="29" height="23" />
|
||||
<view class="txt">发现</view>
|
||||
</view>
|
||||
<button open-type="getPhoneNumber" class="camera" bindgetphonenumber="getPhoneNumber" wx:else>
|
||||
<t-image loading=" " mode="aspectFill" src="{{cdnHost + '/static/camera.png?v=5'}}" width="29" height="23" />
|
||||
<view class="txt">发现</view>
|
||||
</button> -->
|
||||
</t-tab-bar>
|
||||
</view>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
.tabline {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
||||
.custom-tab-bar-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 28rpx;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
|
||||
.camera {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
height: 78rpx;
|
||||
width: 176rpx;
|
||||
background: linear-gradient(180deg, rgb(74, 137, 254) 0%, rgb(47, 103, 254) 100%);
|
||||
transform: translateX(-50%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 2;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
}
|
||||
.camera .txt{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left:10rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.custom-tab-bar-wrapper.cur {
|
||||
color: #2966f5;
|
||||
}
|
||||
23
jest.config.ts
Normal file
23
jest.config.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { configUmiAlias, createConfig } from '@umijs/max/test';
|
||||
|
||||
export default async () => {
|
||||
const config = await configUmiAlias({
|
||||
...createConfig({
|
||||
target: 'browser',
|
||||
}),
|
||||
});
|
||||
console.log(JSON.stringify(config));
|
||||
|
||||
return {
|
||||
...config,
|
||||
testEnvironmentOptions: {
|
||||
...(config?.testEnvironmentOptions || {}),
|
||||
url: 'http://localhost:8000',
|
||||
},
|
||||
setupFiles: [...(config.setupFiles || []), './tests/setupTests.jsx'],
|
||||
globals: {
|
||||
...config.globals,
|
||||
localStorage: null,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
|
@ -1,5 +1,11 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "."
|
||||
"jsx": "react-jsx",
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
108
package.json
108
package.json
|
|
@ -1,17 +1,103 @@
|
|||
{
|
||||
"name": "@tencent/tdesign-miniprogram-starter-retail",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "app.js",
|
||||
"name": "ant-design-pro",
|
||||
"version": "6.0.0",
|
||||
"private": true,
|
||||
"description": "An out-of-box UI solution for enterprise applications",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"analyze": "cross-env ANALYZE=1 max build",
|
||||
"build": "max build",
|
||||
"deploy": "npm run build && npm run gh-pages",
|
||||
"dev": "npm run start:dev",
|
||||
"gh-pages": "gh-pages -d dist",
|
||||
"i18n-remove": "pro i18n-remove --locale=zh-CN --write",
|
||||
"postinstall": "max setup",
|
||||
"jest": "jest",
|
||||
"lint": "npm run lint:js && npm run lint:prettier",
|
||||
"lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src ",
|
||||
"lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
|
||||
"lint:prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\" --end-of-line auto",
|
||||
"openapi": "max openapi",
|
||||
"prepare": "husky install",
|
||||
"prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\"",
|
||||
"preview": "npm run build && max preview --port 8000",
|
||||
"record": "cross-env NODE_ENV=development REACT_APP_ENV=test max record --scene=login",
|
||||
"serve": "umi-serve",
|
||||
"start": "cross-env UMI_ENV=dev max dev",
|
||||
"start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev max dev",
|
||||
"start:no-mock": "cross-env MOCK=none UMI_ENV=dev max dev",
|
||||
"start:pre": "cross-env REACT_APP_ENV=pre UMI_ENV=dev max dev",
|
||||
"start:test": "cross-env REACT_APP_ENV=test MOCK=none UMI_ENV=dev max dev",
|
||||
"test": "jest",
|
||||
"test:coverage": "npm run jest -- --coverage",
|
||||
"test:update": "npm run jest -- -u",
|
||||
"tsc": "tsc --noEmit"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not ie <= 10"
|
||||
],
|
||||
"dependencies": {
|
||||
"dayjs": "^1.9.3",
|
||||
"tdesign-miniprogram": "^1.4.0",
|
||||
"tslib": "^1.11.1"
|
||||
"@ant-design/icons": "^4.8.1",
|
||||
"@ant-design/plots": "^2.1.5",
|
||||
"@ant-design/pro-components": "^2.6.44",
|
||||
"@antv/l7": "^2.20.13",
|
||||
"@antv/l7-maps": "^2.20.13",
|
||||
"@antv/l7-react": "^2.4.3",
|
||||
"@umijs/route-utils": "^2.2.2",
|
||||
"antd": "^5.12.7",
|
||||
"antd-style": "^3.6.1",
|
||||
"classnames": "^2.5.1",
|
||||
"compressorjs": "^1.2.1",
|
||||
"dayjs": "^1.11.10",
|
||||
"file-saver": "^2.0.5",
|
||||
"html2canvas": "^1.4.1",
|
||||
"jspdf": "^2.5.1",
|
||||
"jszip": "^3.10.1",
|
||||
"numeral": "^2.0.6",
|
||||
"omit.js": "^2.0.2",
|
||||
"querystring": "^0.2.1",
|
||||
"rc-util": "^5.38.1",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-fittext": "^1.0.0",
|
||||
"react-quill": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {}
|
||||
"devDependencies": {
|
||||
"@ant-design/pro-cli": "^2.1.5",
|
||||
"@testing-library/react": "^13.4.0",
|
||||
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
||||
"@types/classnames": "^2.3.1",
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/jest": "^29.5.11",
|
||||
"@types/lodash": "^4.14.202",
|
||||
"@types/lodash.debounce": "^4.0.9",
|
||||
"@types/react": "^18.2.46",
|
||||
"@types/react-dom": "^18.2.18",
|
||||
"@types/react-helmet": "^6.1.11",
|
||||
"@umijs/fabric": "^2.14.1",
|
||||
"@umijs/lint": "^4.1.0",
|
||||
"@umijs/max": "^4.1.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^8.56.0",
|
||||
"express": "^4.18.2",
|
||||
"gh-pages": "^3.2.3",
|
||||
"husky": "^7.0.4",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"mockjs": "^1.1.0",
|
||||
"prettier": "^3.1.1",
|
||||
"prettier-plugin-organize-imports": "^3.2.4",
|
||||
"prettier-plugin-packagejson": "^2.4.8",
|
||||
"prettier-plugin-two-style-order": "^1.0.1",
|
||||
"react-dev-inspector": "^1.9.0",
|
||||
"swagger-ui-dist": "^4.19.1",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^4.9.5",
|
||||
"umi-presets-pro": "^2.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,109 +0,0 @@
|
|||
import C from '../../utils/constant';
|
||||
import * as F from '../../utils/func';
|
||||
import R from '../../utils/request';
|
||||
import ActionSheet, { ActionSheetTheme } from 'tdesign-miniprogram/action-sheet/index';
|
||||
|
||||
Page({
|
||||
data: {
|
||||
price: '',
|
||||
expireDate: F.parseDate(new Date()),
|
||||
dateVisible: false,
|
||||
start: F.parseDate(new Date()),
|
||||
end: F.parseDate(new Date(new Date() * 1 + 24 * 3600 * 366 * 1000 + 1)),
|
||||
filter(type, options) {
|
||||
if (type === 'year') {
|
||||
return options.sort((a, b) => b.value - a.value);
|
||||
}
|
||||
return options;
|
||||
},
|
||||
popupProps: {
|
||||
usingCustomNavbar: true,
|
||||
},
|
||||
buy_type: '',
|
||||
buy_types: [],
|
||||
},
|
||||
onLoad() {
|
||||
R.get('/index.php/api/v1/config_one', { k: 'buy_types' }).then(({ model }) => {
|
||||
this.setData({
|
||||
buy_types: model || [],
|
||||
buy_type: model[0],
|
||||
});
|
||||
});
|
||||
},
|
||||
handleSelected(e) {
|
||||
console.log(e.detail);
|
||||
this.setData({
|
||||
buy_type: e.detail.selected.label,
|
||||
});
|
||||
},
|
||||
handleAction() {
|
||||
ActionSheet.show({
|
||||
theme: ActionSheetTheme.List,
|
||||
selector: '#t-action-sheet',
|
||||
context: this,
|
||||
items: this.data.buy_types.map((item) => ({
|
||||
label: item,
|
||||
})),
|
||||
});
|
||||
},
|
||||
onConfirm(e) {
|
||||
const { value } = e.detail;
|
||||
this.setData({
|
||||
expireDate: value,
|
||||
dateVisible: false,
|
||||
});
|
||||
},
|
||||
showPicker() {
|
||||
this.setData({ dateVisible: true });
|
||||
},
|
||||
onClose() {
|
||||
this.setData({ dateVisible: false });
|
||||
},
|
||||
validate() {
|
||||
const { price, expireDate } = this.data;
|
||||
if (!price) {
|
||||
wx.showToast({ title: '请输入分销金额', icon: 'none' });
|
||||
return false;
|
||||
}
|
||||
if (!/^\d+(\.\d+)?$/.test(price)) {
|
||||
wx.showToast({ title: '请输入正确的金额', icon: 'none' });
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!expireDate) {
|
||||
wx.showToast({ title: '请选择付款有效期', icon: 'none' });
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
share() {
|
||||
if (!this.validate()) return;
|
||||
// TODO: 调用分享接口
|
||||
// console.log('share1', this.data);
|
||||
// wx.showShareMenu({
|
||||
// withShareTicket: true,
|
||||
// menus: ['shareAppMessage']
|
||||
// });
|
||||
},
|
||||
onShareAppMessage(e) {
|
||||
if (!this.validate()) {
|
||||
return {
|
||||
title: '',
|
||||
path: '',
|
||||
imageUrl: '',
|
||||
promise: Promise.reject(),
|
||||
}
|
||||
}
|
||||
const { price, expireDate, buy_type } = this.data;
|
||||
return R.get('/index.php/api/v1/create_share', {
|
||||
price, expireDate, buy_type,
|
||||
}).then(({ model }) => {
|
||||
return {
|
||||
title: model.title,
|
||||
path: model.path || '/pages/sharebuy/sharebuy?id=' + model.id,
|
||||
imageUrl: model.img,
|
||||
promise: Promise.resolve(),
|
||||
};
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "分销",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {
|
||||
"t-cell": "tdesign-miniprogram/cell/cell",
|
||||
"t-button": "tdesign-miniprogram/button/button",
|
||||
"t-input": "tdesign-miniprogram/input/input",
|
||||
"t-date-time-picker": "tdesign-miniprogram/date-time-picker/date-time-picker",
|
||||
"t-action-sheet": "tdesign-miniprogram/action-sheet/action-sheet"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<view class="container">
|
||||
<view class="form">
|
||||
<t-input label="分销金额" placeholder="请输入分销金额" suffix="元" type="digit" align="right" model:value="{{price}}" />
|
||||
<t-cell title="分销类型" hover note="{{buy_type || '请选择分销类型'}}" arrow bindtap="handleAction" />
|
||||
<t-cell title="付款有效期" hover note="{{expireDate || '请选择付款有效期'}}" arrow bindtap="showPicker" />
|
||||
<!-- <t-input label="分销类型" placeholder="请选择分销类型" align="right" value="{{buy_type}}" bindtap="handleAction" readonly /> -->
|
||||
<!-- <t-input label="付款有效期" placeholder="请选择付款有效期" align="right" value="{{expireDate}}" bindtap="showPicker" readonly /> -->
|
||||
</view>
|
||||
<view class="footer">
|
||||
<t-button theme="primary" open-type="share" block catchtap="share">分享</t-button>
|
||||
</view>
|
||||
<t-action-sheet id="t-action-sheet" usingCustomNavbar bind:selected="handleSelected" />
|
||||
<t-date-time-picker auto-close title="选择日期" visible="{{dateVisible}}" mode="date" default-value="{{expireDate}}" format="YYYY-MM-DD" start="{{start}}" end="{{end}}" filter="{{filter}}" popup-props="{{popupProps}}" bind:confirm="onConfirm" bind:close="onClose" />
|
||||
</view>
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
.container {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.form {
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 40rpx;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
import R from '../../utils/request';
|
||||
import C from '../../utils/constant';
|
||||
Page({
|
||||
|
||||
data: {
|
||||
cdnHost: C.cdnHost,
|
||||
detail: {},
|
||||
user: {},
|
||||
},
|
||||
onLoad(options) {
|
||||
const { id } = options;
|
||||
R.get('/index.php/api/v1/news_detail', { id }).then(({ model }) => {
|
||||
this.setData({
|
||||
detail: {
|
||||
...model.detail,
|
||||
content: (model.detail.content||'').replace(/src\="\/uploads/g, 'src="'+C.cdnHost + '/uploads'),
|
||||
imgs: (model.detail.imgs || '').split(',').filter(o=>!!o),
|
||||
video: model.detail.video ? model.detail.video : '',
|
||||
},
|
||||
user: {
|
||||
...model.user,
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
videoErrorCallback(e) {
|
||||
console.log('视频错误信息:')
|
||||
console.log(e.detail.errMsg)
|
||||
},
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "详情",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"t-image": "tdesign-miniprogram/image/image"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<view>
|
||||
<view class="title">{{detail.title}}</view>
|
||||
<view class="info">
|
||||
<view class="time">{{detail.create_time}}</view>
|
||||
<view class="viewcnt">
|
||||
<t-icon name="browse" size="28rpx" color="#b3b5b9"></t-icon>
|
||||
{{detail.view_cnt}}
|
||||
</view>
|
||||
</view>
|
||||
<rich-text class="desc" nodes="{{detail.content}}"></rich-text>
|
||||
<t-image mode="aspectFill" wx:for="{{detail.imgs}}" src="{{cdnHost + item}}" wx:key="item" class="img" shape="round" />
|
||||
<video class="video" wx:if="{{detail.video}}" id="myVideo" src="{{cdnHost + detail.video}}" binderror="videoErrorCallback" show-center-play-btn='{{false}}' show-play-btn="{{true}}" controls></video>
|
||||
<view class="source">来源: {{user.real_name || '三鲤'}}</view>
|
||||
</view>
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
page {
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
padding: 0 20rpx;
|
||||
padding-top: 20rpx;
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 106rpx);
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 34rpx;
|
||||
list-style: square;
|
||||
margin-bottom: 20rpx;
|
||||
color: #363a44;
|
||||
}
|
||||
|
||||
.info {
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 60rpx;
|
||||
color: #b3b5b9;
|
||||
}
|
||||
|
||||
.info .viewcnt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.info .viewcnt .t-icon {
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.content {
|
||||
word-break: break-all;
|
||||
line-height: 46rpx;
|
||||
font-size: 26rpx;
|
||||
color: #363a44;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 100%;
|
||||
margin: 20rpx auto;
|
||||
}
|
||||
|
||||
.video {
|
||||
width: 100%;
|
||||
margin: 20rpx auto;
|
||||
}
|
||||
|
||||
.source {
|
||||
font-size: 24rpx;
|
||||
color: #b3b5b9;
|
||||
text-align: left;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
// pages/detail_admin/detail.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!--pages/detail_admin/detail.wxml-->
|
||||
<text>pages/detail_admin/detail.wxml</text>
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
import R from '../../utils/request';
|
||||
import C from '../../utils/constant';
|
||||
import * as F from '../../utils/func';
|
||||
Page({
|
||||
|
||||
data: {
|
||||
cdnHost: C.cdnHost,
|
||||
list: [],
|
||||
page: 1,
|
||||
status: '',
|
||||
// money_flag: 'send',
|
||||
listEndText: '',
|
||||
},
|
||||
onShow() {
|
||||
this.getTabBar().init();
|
||||
this.fetchList(1);
|
||||
},
|
||||
onLoad(options) {
|
||||
},
|
||||
goCreate(e) {
|
||||
wx.navigateTo({
|
||||
url: `/pages/createpay/createpay`
|
||||
});
|
||||
},
|
||||
fetchList(page) {
|
||||
const { status } = this.data;
|
||||
// money_flag
|
||||
R.get('/index.php/api/v1/share_list', { page, status }).then(({ model }) => {
|
||||
const list = [];
|
||||
model.forEach(item => {
|
||||
list.push({
|
||||
...item,
|
||||
price: F.formatePrice(item.price),
|
||||
});
|
||||
});
|
||||
if (list.length == 0) {
|
||||
this.setData({ listEndText: '没有更多了' });
|
||||
} else {
|
||||
this.setData({ listEndText: '点击加载更多。。。' });
|
||||
}
|
||||
if (page == 1) {
|
||||
this.setData({ list,page });
|
||||
} else {
|
||||
const list2 = this.data.list.concat(list);
|
||||
this.setData({ list: list2,page });
|
||||
}
|
||||
});
|
||||
// for (let i = 0; i < 20; i++) {
|
||||
// list.push({
|
||||
// id: i,
|
||||
// title: '自动热重载] 已开启代码文件保存后自动热重载自动热重载] 已开启代码文件保存后自动热重载',
|
||||
// image: `${imageCdn}/swiper2.png`,
|
||||
// createTime: '09-12 12:21',
|
||||
// viewCnt: 1922 + i,
|
||||
// });
|
||||
// }
|
||||
// this.setData({
|
||||
// list
|
||||
// })
|
||||
},
|
||||
loadMore() {
|
||||
const { page, listEndText } = this.data;
|
||||
if (listEndText == '点击加载更多。。。') {
|
||||
this.fetchList(page + 1);
|
||||
}
|
||||
},
|
||||
onTabsChange(event) {
|
||||
const v = event.detail.value;
|
||||
this.data.status = v;
|
||||
this.fetchList(1);
|
||||
},
|
||||
// handleSwitchChange(e) {
|
||||
// const { value } = e.detail;
|
||||
// if (value) {
|
||||
// this.data.money_flag = 'send';
|
||||
// } else {
|
||||
// this.data.money_flag = '';
|
||||
// }
|
||||
// this.fetchList(1);
|
||||
// },
|
||||
onReachBottom() {
|
||||
this.loadMore();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.fetchList(1);
|
||||
wx.stopPullDownRefresh();
|
||||
},
|
||||
editRemark(e) {
|
||||
const { id, remark } = e.currentTarget.dataset.detail;
|
||||
const that = this;
|
||||
wx.showModal({
|
||||
title: '备注',
|
||||
content: remark || '',
|
||||
editable: true,
|
||||
success(re) {
|
||||
const remark2 = re.content || '';
|
||||
R.post('/index.php/api/v1/mark', { id, remark: remark2 }).then(() => {
|
||||
that.data.list.find(o => o.id == id).remark = remark2;
|
||||
that.setData({
|
||||
list: [...that.data.list],
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "我的分销",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {
|
||||
"t-tabs": "tdesign-miniprogram/tabs/tabs",
|
||||
"t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
|
||||
"t-image": "tdesign-miniprogram/image/image",
|
||||
"t-sticky": "tdesign-miniprogram/sticky/sticky",
|
||||
"t-divider": "tdesign-miniprogram/divider/divider",
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"t-footer": "tdesign-miniprogram/footer/footer"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<view>
|
||||
<!-- <t-sticky offset-top="{{0}}"> -->
|
||||
<!-- <view class="tabs"> -->
|
||||
<!-- <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" t-class="custom-tabs">
|
||||
<t-tab-panel label="全部" value="" />
|
||||
<t-tab-panel label="已支付" value="payed" />
|
||||
<t-tab-panel label="待支付" value="wait_pay" />
|
||||
</t-tabs>
|
||||
<view class="sw"> -->
|
||||
<!-- <t-switch defaultValue="{{false}}" bindchange="handleSwitchChange" size="small" />
|
||||
<view class="txt">已提现</view> -->
|
||||
<!-- </view> -->
|
||||
<!-- </view> -->
|
||||
<!-- </t-sticky> -->
|
||||
<view class="list">
|
||||
<view class="item" wx:for="{{list}}" wx:key="id">
|
||||
<view class="item-main" data-id="{{item.id}}" bind:tap="goDetail">
|
||||
<view class="right">
|
||||
<view class="text">
|
||||
<view>订单号: {{item.order_no || '-'}} 金额: {{item.price}} 元</view>
|
||||
<view wx:if="{{item.name}}">购买信息: {{item.name}} {{item.phone}}</view>
|
||||
<view data-detail="{{item}}" class="remark" bind:tap="editRemark">
|
||||
<t-icon prefix="wr" name="edit" size="40rpx" />
|
||||
备注: {{item.remark || '无'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view wx:if="{{item.pay_time}}">支付时间: {{item.pay_time}}</view>
|
||||
<view wx:else>订单时间: {{item.create_time}}</view>
|
||||
<view class="viewcnt init">{{item.buy_type}}</view>
|
||||
<!-- <view class="viewcnt init" wx:if="{{item.status == 'init'}}">待审核</view> -->
|
||||
<!-- <view class="viewcnt resolve" wx:if="{{item.status == 'payed'}}">已支付</view> -->
|
||||
<!-- <view class="viewcnt reject" wx:if="{{item.status == 'wait_pay'}}">待支付</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<t-footer wx:if="{{listEndText}}" text="{{listEndText}}" bind:tap="loadMore"></t-footer>
|
||||
</view>
|
||||
<view class="btn_cre" bind:tap="goCreate">
|
||||
<view>创建</view>
|
||||
<view>分销</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
page {
|
||||
padding: 0 20rpx;
|
||||
background-color: rgb(245, 246, 247);
|
||||
}
|
||||
|
||||
.tabs {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
background-color: rgb(245, 246, 247);
|
||||
}
|
||||
|
||||
.tabs .t-tabs {
|
||||
width: 60%;
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
.tabs .t-tabs .t-tabs__wrapper {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
.sw {
|
||||
width: 240rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.sw .txt {
|
||||
padding-left: 16rpx;
|
||||
}
|
||||
|
||||
|
||||
.list {
|
||||
margin-top: 20rpx;
|
||||
padding-bottom: 60rpx;
|
||||
}
|
||||
|
||||
.list .item {
|
||||
border-radius: 16rpx;
|
||||
background-color: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
width: 710rpx;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main {
|
||||
display: flex;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main .right {
|
||||
flex: 1;
|
||||
padding: 0 32rpx;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .text {
|
||||
padding-top: 16rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 46rpx;
|
||||
margin-bottom: 20rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info {
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
justify-content: space-between;
|
||||
color: #8f9197;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info .viewcnt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info .viewcnt.init {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info .viewcnt.resolve {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info .viewcnt.reject {
|
||||
color: gray;
|
||||
}
|
||||
.remark{
|
||||
display: flex;
|
||||
}
|
||||
.btn_cre {
|
||||
position: fixed;
|
||||
bottom: 220rpx;
|
||||
right: 20rpx;
|
||||
height: 120rpx;
|
||||
width: 120rpx;
|
||||
border-radius: 50%;
|
||||
background-color: rgb(111, 172, 207);
|
||||
color: #fff;
|
||||
font-size: 26rpx;
|
||||
z-index: 2;
|
||||
padding-top: 26rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.btn_cre view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: row;
|
||||
text-align: center;
|
||||
}
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
import R from '../../utils/request';
|
||||
import C from '../../utils/constant';
|
||||
Page({
|
||||
data: {
|
||||
cdnHost: C.cdnHost,
|
||||
loadFlag: false,
|
||||
swiperList: [],
|
||||
list: [],
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.getTabBar().init();
|
||||
// this.init();
|
||||
this.fetchBanner();
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
R.login().then(() => {
|
||||
this.init();
|
||||
})
|
||||
},
|
||||
fetchBanner() {
|
||||
R.get('/index.php/api/v1/banner_list', {}).then(({ model }) => {
|
||||
const swiperList = [];
|
||||
model.forEach(item => {
|
||||
swiperList.push({
|
||||
...item,
|
||||
value: C.cdnHost + item.img,
|
||||
ariaLabel: item.title,
|
||||
id: item.id,
|
||||
});
|
||||
});
|
||||
if (JSON.stringify(swiperList) != JSON.stringify(this.data.swiperList)) {
|
||||
this.setData({ swiperList });
|
||||
}
|
||||
});
|
||||
},
|
||||
init() {
|
||||
if (this.data.loadFlag) return;
|
||||
this.data.loadFlag = false;
|
||||
this.fetchList(1);
|
||||
this.fetchBanner();
|
||||
},
|
||||
fetchList(page) {
|
||||
R.get('/index.php/api/v1/news_list', { page, pageSize: 5 }).then(({ model }) => {
|
||||
const list = [];
|
||||
model.forEach(item => {
|
||||
list.push({
|
||||
...item,
|
||||
});
|
||||
});
|
||||
this.setData({ list });
|
||||
});
|
||||
},
|
||||
goDetail(e) {
|
||||
const { id } = e.currentTarget.dataset;
|
||||
wx.navigateTo({
|
||||
url: `/pages/detail/detail?id=${id}`
|
||||
});
|
||||
},
|
||||
onSwiperTap(e) {
|
||||
const { index } = e.detail;
|
||||
this.data.swiperList.forEach((o, i) => {
|
||||
if (i == index) {
|
||||
console.log(o)
|
||||
if(o.action_type == 'newsId'){
|
||||
wx.navigateTo({
|
||||
url: '/pages/detail/detail?id=' + o.action_item,
|
||||
});
|
||||
}
|
||||
if(o.action_type == 'url'){
|
||||
wx.navigateTo({
|
||||
url: '/pages/webview/webview?url=' + encodeURIComponent(o.action_item),
|
||||
});
|
||||
}
|
||||
if(o.action_type == 'path'){
|
||||
wx.navigateTo({
|
||||
url: o.action_item,
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
goUrl(e) {
|
||||
const { url } = e.currentTarget.dataset;
|
||||
wx.navigateTo({
|
||||
url
|
||||
});
|
||||
},
|
||||
goMore() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/news_list/home'
|
||||
});
|
||||
},
|
||||
refresh() {
|
||||
this.fetchList(1);
|
||||
this.fetchBanner();
|
||||
wx.showToast({ icon: 'none', title: '刷新成功' });
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.init();
|
||||
wx.stopPullDownRefresh();
|
||||
},
|
||||
onShareAppMessage() { },
|
||||
onShareTimeline() { },
|
||||
});
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "首页",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {
|
||||
"t-swiper": "tdesign-miniprogram/swiper/swiper",
|
||||
"t-swiper-nav": "tdesign-miniprogram/swiper-nav/swiper-nav",
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"t-image": "tdesign-miniprogram/image/image",
|
||||
"t-divider": "tdesign-miniprogram/divider/divider"
|
||||
},
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
page {
|
||||
box-sizing: border-box;
|
||||
background-color: linear-gradient(180deg, #f0f4fc, #fff);
|
||||
padding: 0 20rpx;
|
||||
padding-top: 10rpx;
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 106rpx);
|
||||
}
|
||||
|
||||
.title_bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
|
||||
.title_bar .title {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||
background-position: left center;
|
||||
background-size: 100% 100%;
|
||||
font-size: 32rpx;
|
||||
color: rgb(53, 58, 71);
|
||||
height: 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-weight: bold;
|
||||
|
||||
.t-icon {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.title_bar .btn {
|
||||
color: #71737b;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.title_bar .btn .t-icon {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.list {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.list .item .item-main .right {
|
||||
flex: 1;
|
||||
padding-left: 32rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .text {
|
||||
padding-top: 0rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 46rpx;
|
||||
margin-bottom: 10rpx;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #363a44;
|
||||
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info {
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
justify-content: space-between;
|
||||
color: #71737b;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info .viewcnt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.list .item .viewcnt .t-icon {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.t-tab-bar {
|
||||
border-top: 1px solid #eee;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.activity {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
|
||||
.t-image {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
<view>
|
||||
<t-swiper wx:if="{{swiperList.length > 0}}" current="{{current}}" autoplay="{{true}}" duration="{{500}}" height="{{180}}" interval="{{3000}}" list="{{swiperList}}" navigation="{{ { type: 'dots-bar' } }}" bind:click="onSwiperTap" />
|
||||
<view class="title_bar" wx:if="{{list.length}}">
|
||||
<view class="title" bind:tap="refresh">
|
||||
公司动态
|
||||
<t-icon name="refresh" size="28rpx" color="71737b"></t-icon>
|
||||
</view>
|
||||
<view class="btn" bind:tap="goMore">
|
||||
查看全部
|
||||
<t-icon name="chevron-right" size="28rpx" color="71737b"></t-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list" wx:if="{{list.length}}">
|
||||
<view class="item" wx:for="{{list}}" wx:key="id">
|
||||
<view class="item-main" data-id="{{item.id}}" bind:tap="goDetail">
|
||||
<t-image mode="aspectFill" src="{{cdnHost+item.poster}}" width="108" height="72" shape="round" />
|
||||
<view class="right">
|
||||
<view class="text">{{item.title}}</view>
|
||||
<view class="info">
|
||||
<view>{{item.create_time}}</view>
|
||||
<view class="viewcnt">
|
||||
<t-icon name="browse" size="28rpx" color="71737b"></t-icon>
|
||||
{{item.view_cnt}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<t-divider />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
page {
|
||||
box-sizing: border-box;
|
||||
background-color: linear-gradient(180deg, #f0f4fc, #fff);
|
||||
padding: 0 20rpx;
|
||||
padding-top: 10rpx;
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 106rpx);
|
||||
}
|
||||
.title_bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
.title_bar .title {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||
background-position: left center;
|
||||
background-size: 100% 100%;
|
||||
font-size: 32rpx;
|
||||
color: #353a47;
|
||||
height: 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
.title_bar .title .t-icon {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.title_bar .btn {
|
||||
color: #71737b;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.title_bar .btn .t-icon {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.list {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.list .item .item-main {
|
||||
display: flex;
|
||||
}
|
||||
.list .item .item-main .right {
|
||||
flex: 1;
|
||||
padding-left: 32rpx;
|
||||
}
|
||||
.list .item .item-main .right .text {
|
||||
padding-top: 0rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 46rpx;
|
||||
margin-bottom: 10rpx;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #363a44;
|
||||
}
|
||||
.list .item .item-main .right .info {
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
justify-content: space-between;
|
||||
color: #71737b;
|
||||
}
|
||||
.list .item .item-main .right .info .viewcnt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.list .item .viewcnt .t-icon {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.t-tab-bar {
|
||||
border-top: 1px solid #eee;
|
||||
position: relative;
|
||||
}
|
||||
.activity {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.activity .t-image {
|
||||
width: 100%;
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
首页功能设定
|
||||
1. loading入场
|
||||
2. 下拉刷新
|
||||
3. 搜索栏
|
||||
4. 分类切换
|
||||
5. 商品列表
|
||||
6. 规格弹层
|
||||
7. 加载更多
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
// pages/news_admin_list/home.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!--pages/news_admin_list/home.wxml-->
|
||||
<text>pages/news_admin_list/home.wxml</text>
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
import R from '../../utils/request';
|
||||
import C from '../../utils/constant';
|
||||
Page({
|
||||
data: {
|
||||
cdnHost: C.cdnHost,
|
||||
list: [],
|
||||
page: 1,
|
||||
listEndText: '',
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.getTabBar().init();
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.init();
|
||||
},
|
||||
init() {
|
||||
this.fetchList(1);
|
||||
},
|
||||
fetchList(page) {
|
||||
R.get('/index.php/api/v1/news_list', { page }).then(({ model }) => {
|
||||
const list = [];
|
||||
model.forEach(item => {
|
||||
list.push({
|
||||
...item,
|
||||
});
|
||||
});
|
||||
if (list.length == 0) {
|
||||
this.setData({ listEndText: '没有更多了' });
|
||||
} else {
|
||||
this.setData({ listEndText: '点击加载更多。。。' });
|
||||
}
|
||||
if (page == 1) {
|
||||
this.setData({ list ,page});
|
||||
} else {
|
||||
const list2 = this.data.list.concat(list);
|
||||
this.setData({ list: list2,page });
|
||||
}
|
||||
});
|
||||
},
|
||||
loadMore() {
|
||||
const { page, listEndText } = this.data;
|
||||
if (listEndText == '点击加载更多。。。') {
|
||||
this.fetchList(page + 1);
|
||||
}
|
||||
},
|
||||
goDetail(e) {
|
||||
const { id } = e.currentTarget.dataset;
|
||||
wx.navigateTo({
|
||||
url: `/pages/detail/detail?id=${id}`
|
||||
});
|
||||
},
|
||||
refresh() {
|
||||
this.fetchList(1);
|
||||
wx.showToast({ icon: 'none', title: '刷新成功' });
|
||||
},
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.init();
|
||||
wx.stopPullDownRefresh();
|
||||
},
|
||||
});
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "发现",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"t-image": "tdesign-miniprogram/image/image",
|
||||
"t-divider": "tdesign-miniprogram/divider/divider",
|
||||
"t-footer": "tdesign-miniprogram/footer/footer"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
page {
|
||||
box-sizing: border-box;
|
||||
background-color: linear-gradient(180deg, #f0f4fc, #fff);
|
||||
padding: 0 20rpx;
|
||||
padding-top: 10rpx;
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 106rpx);
|
||||
}
|
||||
|
||||
.title_bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
|
||||
.title_bar .title {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||
// background: url('http://cdn.zhonganonline.top/newslist/static/title.png') no-repeat;
|
||||
background-position: left center;
|
||||
background-size: 100% 100%;
|
||||
font-size: 32rpx;
|
||||
height: 34rpx;
|
||||
width: 132rpx;
|
||||
}
|
||||
|
||||
|
||||
.title_bar .btn {
|
||||
color: #71737b;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.title_bar .btn .t-icon {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.list {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.list .item .item-main .right {
|
||||
flex: 1;
|
||||
padding-left: 32rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .text {
|
||||
padding-top: 0rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 46rpx;
|
||||
margin-bottom: 10rpx;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #363a44;
|
||||
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info {
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
justify-content: space-between;
|
||||
color: #71737b;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info .viewcnt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.list .item .viewcnt .t-icon {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.t-tab-bar {
|
||||
border-top: 1px solid #eee;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.activity {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
|
||||
.t-image {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
<view>
|
||||
<view class="title_bar">
|
||||
<view class="title">最新动态</view>
|
||||
<view class="btn" bind:tap="refresh">
|
||||
<t-icon name="refresh" size="28rpx" color="71737b"></t-icon>
|
||||
刷新
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item" wx:for="{{list}}" wx:key="id">
|
||||
<view class="item-main" data-id="{{item.id}}" bind:tap="goDetail">
|
||||
<t-image mode="aspectFill" src="{{cdnHost+item.poster}}" width="108" height="72" shape="round" />
|
||||
<view class="right">
|
||||
<view class="text">{{item.title}}</view>
|
||||
<view class="info">
|
||||
<view>{{item.create_time}}</view>
|
||||
<view class="viewcnt">
|
||||
<t-icon name="browse" size="28rpx" color="71737b"></t-icon>
|
||||
{{item.view_cnt}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<t-divider />
|
||||
</view>
|
||||
<t-footer wx:if="{{listEndText}}" text="{{listEndText}}" bind:tap="loadMore"></t-footer>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
page {
|
||||
box-sizing: border-box;
|
||||
background-color: linear-gradient(180deg, #f0f4fc, #fff);
|
||||
padding: 0 20rpx;
|
||||
padding-top: 10rpx;
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 106rpx);
|
||||
}
|
||||
.title_bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
.title_bar .title {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||
background-position: left center;
|
||||
background-size: 100% 100%;
|
||||
font-size: 32rpx;
|
||||
height: 34rpx;
|
||||
width: 132rpx;
|
||||
}
|
||||
.title_bar .btn {
|
||||
color: #71737b;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.title_bar .btn .t-icon {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.list {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.list .item .item-main {
|
||||
display: flex;
|
||||
}
|
||||
.list .item .item-main .right {
|
||||
flex: 1;
|
||||
padding-left: 32rpx;
|
||||
}
|
||||
.list .item .item-main .right .text {
|
||||
padding-top: 0rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 46rpx;
|
||||
margin-bottom: 10rpx;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #363a44;
|
||||
}
|
||||
.list .item .item-main .right .info {
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
justify-content: space-between;
|
||||
color: #71737b;
|
||||
}
|
||||
.list .item .item-main .right .info .viewcnt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.list .item .viewcnt .t-icon {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.t-tab-bar {
|
||||
border-top: 1px solid #eee;
|
||||
position: relative;
|
||||
}
|
||||
.activity {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.activity .t-image {
|
||||
width: 100%;
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
首页功能设定
|
||||
1. loading入场
|
||||
2. 下拉刷新
|
||||
3. 搜索栏
|
||||
4. 分类切换
|
||||
5. 商品列表
|
||||
6. 规格弹层
|
||||
7. 加载更多
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
import R from '../../utils/request';
|
||||
import C from '../../utils/constant';
|
||||
import * as F from '../../utils/func';
|
||||
Page({
|
||||
data: {
|
||||
|
||||
},
|
||||
onLoad(options) {
|
||||
const { order_no, redirect_url } = options;
|
||||
|
||||
R.post('/index.php/api/v1/pay_order_shop', { order_no }).then(({ model }) => {
|
||||
wx.requestPayment({
|
||||
...model,
|
||||
success(res) {
|
||||
wx.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
success() {
|
||||
wx.redirectTo({
|
||||
url: '/pages/shop/shop?path=user',
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
fail(res) {
|
||||
wx.showToast({
|
||||
title: '支付失败',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
wx.redirectTo({
|
||||
url: '/pages/shop/shop?path=user',
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "支付",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
<view class="tip">支付中...</view>
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
.tip {
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
import R from '../../utils/request';
|
||||
import C from '../../utils/constant';
|
||||
import * as F from '../../utils/func';
|
||||
Page({
|
||||
|
||||
data: {
|
||||
cdnHost: C.cdnHost,
|
||||
list: [],
|
||||
page: 1,
|
||||
status: '',
|
||||
// money_flag: 'send',
|
||||
listEndText: '',
|
||||
},
|
||||
onLoad(options) {
|
||||
const {from} = options;
|
||||
if(from == 'sharebuy') {
|
||||
R.post('/index.php/api/v1/configs',{ks:['payed_tip','payed_vip_link']}).then(({model})=>{
|
||||
if(model.payed_tip && model.payed_vip_link) {
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: model.payed_tip,
|
||||
complete: (res) => {
|
||||
if (res.confirm) {
|
||||
wx.navigateTo({
|
||||
url: '/pages/webview/webview?url=' + encodeURIComponent(model.payed_vip_link),
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
this.fetchList(1);
|
||||
},
|
||||
goDetail(e) {
|
||||
const { detail } = e.currentTarget.dataset;
|
||||
if (!detail.phone && detail.status == 'payed') {
|
||||
wx.navigateTo({
|
||||
url: `/pages/sharebuy/sharebuy?id=${detail.share_id}&orderNo=${detail.order_no}`,
|
||||
});
|
||||
}
|
||||
},
|
||||
fetchList(page) {
|
||||
const { status } = this.data;
|
||||
// money_flag
|
||||
R.get('/index.php/api/v1/order_list', { page }).then(({ model }) => {
|
||||
const list = [];
|
||||
model.forEach(item => {
|
||||
list.push({
|
||||
...item,
|
||||
price: F.formatePrice(item.price),
|
||||
});
|
||||
});
|
||||
if (list.length == 0) {
|
||||
this.setData({ listEndText: '没有更多了' });
|
||||
} else {
|
||||
this.setData({ listEndText: '点击加载更多。。。' });
|
||||
}
|
||||
if (page == 1) {
|
||||
this.setData({ list,page });
|
||||
} else {
|
||||
const list2 = this.data.list.concat(list);
|
||||
this.setData({ list: list2,page });
|
||||
}
|
||||
});
|
||||
// for (let i = 0; i < 20; i++) {
|
||||
// list.push({
|
||||
// id: i,
|
||||
// title: '自动热重载] 已开启代码文件保存后自动热重载自动热重载] 已开启代码文件保存后自动热重载',
|
||||
// image: `${imageCdn}/swiper2.png`,
|
||||
// createTime: '09-12 12:21',
|
||||
// viewCnt: 1922 + i,
|
||||
// });
|
||||
// }
|
||||
// this.setData({
|
||||
// list
|
||||
// })
|
||||
},
|
||||
loadMore() {
|
||||
const { page, listEndText } = this.data;
|
||||
if (listEndText == '点击加载更多。。。') {
|
||||
this.fetchList(page + 1);
|
||||
}
|
||||
},
|
||||
onTabsChange(event) {
|
||||
const v = event.detail.value;
|
||||
this.data.status = v;
|
||||
this.fetchList(1);
|
||||
},
|
||||
// handleSwitchChange(e) {
|
||||
// const { value } = e.detail;
|
||||
// if (value) {
|
||||
// this.data.money_flag = 'send';
|
||||
// } else {
|
||||
// this.data.money_flag = '';
|
||||
// }
|
||||
// this.fetchList(1);
|
||||
// },
|
||||
onReachBottom() {
|
||||
this.loadMore();
|
||||
},
|
||||
onShareAppMessage() {
|
||||
}
|
||||
})
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "我的订单",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {
|
||||
"t-tabs": "tdesign-miniprogram/tabs/tabs",
|
||||
"t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
|
||||
"t-image": "tdesign-miniprogram/image/image",
|
||||
"t-sticky": "tdesign-miniprogram/sticky/sticky",
|
||||
"t-divider": "tdesign-miniprogram/divider/divider",
|
||||
"t-footer": "tdesign-miniprogram/footer/footer"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
<view>
|
||||
<view class="list">
|
||||
<view class="item" wx:for="{{list}}" wx:key="id">
|
||||
<view class="item-main" data-detail="{{item}}" bind:tap="goDetail">
|
||||
<view class="right">
|
||||
<view class="text">
|
||||
<view>订单号: {{item.order_no || '-'}}</view>
|
||||
<view>{{item.price}}元</view>
|
||||
</view>
|
||||
<view class="info" wx:if="{{!item.phone}}">
|
||||
<view>{{item.buy_type}}</view>
|
||||
<view style="text-align: right;color:coral">补充信息{{' >'}}</view>
|
||||
</view>
|
||||
<view class="info" wx:if="{{item.phone}}">
|
||||
<view>信息: {{item.name || '暂无'}} {{item.phone}}</view>
|
||||
<view style="text-align: right;">{{item.buy_type}}</view>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view wx:if="{{item.pay_time}}">支付时间: {{item.pay_time}}</view>
|
||||
<view wx:else>订单时间: {{item.create_time}}</view>
|
||||
<!-- <view class="viewcnt init">{{item.buy_type}}</view> -->
|
||||
<!-- <view class="viewcnt init" wx:if="{{item.status == 'init'}}">待审核</view> -->
|
||||
<view class="viewcnt resolve" wx:if="{{item.status == 'payed'}}">已支付</view>
|
||||
<view class="viewcnt reject" wx:if="{{item.status == 'wait_pay'}}">待支付</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<t-footer wx:if="{{listEndText}}" text="{{listEndText}}" bind:tap="loadMore"></t-footer>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
page {
|
||||
padding: 0 20rpx;
|
||||
background-color: rgb(245, 246, 247);
|
||||
}
|
||||
.sw {
|
||||
width: 240rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.sw .txt {
|
||||
padding-left: 16rpx;
|
||||
}
|
||||
|
||||
|
||||
.list {
|
||||
margin-top: 20rpx;
|
||||
padding-bottom: 60rpx;
|
||||
}
|
||||
|
||||
.list .item {
|
||||
border-radius: 16rpx;
|
||||
background-color: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
width: 710rpx;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main {
|
||||
display: flex;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main .right {
|
||||
flex: 1;
|
||||
padding: 0 32rpx;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .text {
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
justify-content: space-between;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info {
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
justify-content: space-between;
|
||||
color: #8f9197;
|
||||
line-height: 36rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info .viewcnt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info .viewcnt.init {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info .viewcnt.resolve {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info .viewcnt.reject {
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.list .item .h20 {
|
||||
height: 20rpx;
|
||||
}
|
||||
|
|
@ -1,141 +0,0 @@
|
|||
import C from '../../utils/constant';
|
||||
import * as F from '../../utils/func';
|
||||
import R from '../../utils/request';
|
||||
Page({
|
||||
data: {
|
||||
expireDate: '',
|
||||
price: '',
|
||||
shareId: '',
|
||||
isPay: false,
|
||||
orderNo: '',
|
||||
phone: '',
|
||||
username: '',
|
||||
tip_before_pay: '',
|
||||
tip_after_pay: '',
|
||||
buy_type: '',
|
||||
},
|
||||
onLoad(options) {
|
||||
const { id, orderNo } = options;
|
||||
if (orderNo) {
|
||||
this.setData({
|
||||
isPay: true,
|
||||
orderNo,
|
||||
})
|
||||
this.fetchOrder(orderNo);
|
||||
} else {
|
||||
R.get('/index.php/api/v1/get_share', { id }).then(({ model }) => {
|
||||
this.setData({
|
||||
shareId: id,
|
||||
price: F.formatePrice(model.price),
|
||||
expireDate: model.expire_time,
|
||||
tip_before_pay: model.tip_before_pay || '',
|
||||
tip_after_pay: model.tip_after_pay || '',
|
||||
buy_type: model.buy_type,
|
||||
});
|
||||
}).catch((e)=>{
|
||||
console.log('xxx',e);
|
||||
})
|
||||
R.get('/index.php/api/v1/view_share', { id });
|
||||
}
|
||||
},
|
||||
refresh() {
|
||||
if (this.data.orderNo) {
|
||||
this.fetchOrder(this.data.orderNo);
|
||||
}
|
||||
},
|
||||
fetchOrder(orderNo) {
|
||||
const that = this;
|
||||
return R.get('/index.php/api/v1/fetch_order_pay', { order_no: orderNo }).then(({ model }) => {
|
||||
console.log('payed', model);
|
||||
if (model.status === 'payed') {
|
||||
clearInterval(that.data.timer);
|
||||
wx.hideLoading();
|
||||
this.setData({
|
||||
isPay: true,
|
||||
orderNo,
|
||||
price: F.formatePrice(model.price),
|
||||
buy_type: model.buy_type,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
checkOrderStatus(orderNo) {
|
||||
wx.showLoading({
|
||||
title: '确认支付中...',
|
||||
})
|
||||
this.data.timer = setInterval(() => {
|
||||
this.fetchOrder(orderNo).catch(() => {
|
||||
clearInterval(this.data.timer);
|
||||
});
|
||||
}, 1000);
|
||||
},
|
||||
goPay() {
|
||||
const that = this;
|
||||
if (this.data.shareId) {
|
||||
R.post('/index.php/api/v1/make_order', { share_id: this.data.shareId }).then(({ model: { order_no } }) => {
|
||||
that.data.orderNo = order_no;
|
||||
R.post('/index.php/api/v1/pay_order', { order_no }).then(({ model }) => {
|
||||
wx.requestPayment({
|
||||
...model,
|
||||
success(res) {
|
||||
wx.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
success() {
|
||||
that.checkOrderStatus(order_no);
|
||||
// this.setData({
|
||||
// isPay: true,
|
||||
// })
|
||||
}
|
||||
})
|
||||
},
|
||||
fail(res) {
|
||||
wx.showToast({
|
||||
title: '您已取消支付',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
// wx.redirectTo({
|
||||
// url: '/pages/shop/shop?path=user',
|
||||
// });
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
|
||||
},
|
||||
validate() {
|
||||
const { username, phone, orderNo, } = this.data;
|
||||
if (!username) {
|
||||
wx.showToast({ title: '请输入姓名', icon: 'none' });
|
||||
return false;
|
||||
}
|
||||
if (!/^1\d{10}$/.test(phone)) {
|
||||
wx.showToast({ title: '请输入正确的手机号', icon: 'none' });
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
submit() {
|
||||
if (!this.validate()) return;
|
||||
const {
|
||||
username, phone, orderNo,
|
||||
} = this.data
|
||||
R.post('/index.php/api/v1/mark_order_info', { name: username, phone, order_no: orderNo, }).then(({ model }) => {
|
||||
wx.showToast({
|
||||
title: '提交成功',
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
success() {
|
||||
wx.redirectTo({
|
||||
url: '/pages/paylist/paylist?from=sharebuy',
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
})
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "支付",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {
|
||||
"t-cell": "tdesign-miniprogram/cell/cell",
|
||||
"t-button": "tdesign-miniprogram/button/button",
|
||||
"t-input": "tdesign-miniprogram/input/input"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
page {
|
||||
box-sizing: border-box;
|
||||
background-color: linear-gradient(180deg, #f0f4fc, #fff);
|
||||
padding: 0 20rpx;
|
||||
padding-top: 10rpx;
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 106rpx);
|
||||
}
|
||||
|
||||
.logo {
|
||||
height: 180rpx;
|
||||
width: 180rpx;
|
||||
margin: 0 auto;
|
||||
background-image: url('http://cdn.zhonganonline.top/liiistem/static/liii_icon.png');
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.form {
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 40rpx;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.card {
|
||||
margin: 20rpx 0;
|
||||
padding: 0 20rpx;
|
||||
|
||||
.line {
|
||||
font-size: 36rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.ma {
|
||||
height: 20rpx;
|
||||
}
|
||||
|
||||
.desc {
|
||||
color: #666;
|
||||
font-size: 28rpx;
|
||||
margin-top: 20rpx;
|
||||
line-height: 34rpx;
|
||||
}
|
||||
|
||||
.refresh{
|
||||
text-align: center;
|
||||
margin-top: 20rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
<view class="logo"></view>
|
||||
<view class="card" wx:if="{{!isPay}}">
|
||||
<!-- <view class="line">付款: {{price}}元</view>
|
||||
<view class="line">付款有效期: {{expireDate}}</view> -->
|
||||
<t-cell title="付款" hover note="{{price}}元" />
|
||||
<t-cell title="有效期" hover note="{{expireDate}}" />
|
||||
<t-cell title="类型" hover note="{{buy_type}}" />
|
||||
<view class="ma"></view>
|
||||
<t-button theme="primary" size="large" block bind:tap="goPay">立即付款</t-button>
|
||||
<view class="refresh" bind:tap="refresh">已支付? 手动刷新</view>
|
||||
<view class="ma"></view>
|
||||
<view class="ma"></view>
|
||||
<view wx:if="{{tip_before_pay}}">
|
||||
<!-- <view>支付提示:</view> -->
|
||||
<rich-text class="desc" nodes="{{tip_before_pay}}"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:else>
|
||||
<!-- <view>付款订单号: {{orderNo}}</view> -->
|
||||
<!-- <view>付款成功: {{price}}元</view> -->
|
||||
<t-cell title="付款订单号" hover note="{{orderNo}}" />
|
||||
<t-cell title="类型" hover note="{{buy_type}}" />
|
||||
<t-cell title="付款成功" hover note="{{price}}元" />
|
||||
<view class="ma"></view>
|
||||
<view class="form">
|
||||
<t-input label="姓名" placeholder="请输入姓名" model:value="{{username}}" />
|
||||
<t-input label="电话" placeholder="请输入电话" type="digit" model:value="{{phone}}" />
|
||||
</view>
|
||||
<view class="footer">
|
||||
<t-button theme="primary" block catchtap="submit">提交</t-button>
|
||||
</view>
|
||||
<view class="ma"></view>
|
||||
<view class="ma"></view>
|
||||
<view wx:if="{{tip_after_pay}}">
|
||||
<rich-text class="desc" nodes="{{tip_after_pay}}"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
page {
|
||||
box-sizing: border-box;
|
||||
background-color: linear-gradient(180deg, #f0f4fc, #fff);
|
||||
padding: 0 20rpx;
|
||||
padding-top: 10rpx;
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 106rpx);
|
||||
}
|
||||
.logo {
|
||||
height: 180rpx;
|
||||
width: 180rpx;
|
||||
margin: 0 auto;
|
||||
background-image: url('http://cdn.zhonganonline.top/liiistem/static/liii_icon.png');
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
.form {
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.footer {
|
||||
margin-top: 40rpx;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
.card {
|
||||
margin: 20rpx 0;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
.card .line {
|
||||
font-size: 36rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
.ma {
|
||||
height: 20rpx;
|
||||
}
|
||||
.desc {
|
||||
color: #666;
|
||||
font-size: 28rpx;
|
||||
margin-top: 20rpx;
|
||||
line-height: 34rpx;
|
||||
}
|
||||
|
||||
.refresh{
|
||||
text-align: center;
|
||||
margin-top: 20rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
import R from '../../utils/request';
|
||||
import C from '../../utils/constant';
|
||||
import * as F from '../../utils/func';
|
||||
Page({
|
||||
|
||||
data: {
|
||||
cdnHost: C.cdnHost,
|
||||
list: [],
|
||||
page: 1,
|
||||
status: '',
|
||||
// money_flag: 'send',
|
||||
listEndText: '',
|
||||
},
|
||||
onLoad(options) {
|
||||
this.fetchList(1);
|
||||
},
|
||||
goDel(e) {
|
||||
const {detail,index} =e.currentTarget.dataset;
|
||||
if(detail.deleted == 1) return;
|
||||
const {id}=detail;
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '置为失效后无法恢复,确认继续吗?',
|
||||
complete: (res) => {
|
||||
if (res.cancel) {
|
||||
|
||||
}
|
||||
|
||||
if (res.confirm) {
|
||||
R.post('/index.php/api/v1/del_share',{id}).then(()=>{
|
||||
const {list} = this.data;
|
||||
this.setData({
|
||||
[`list[${index}]`] : {
|
||||
...list[index],
|
||||
deleted:1,
|
||||
},
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
fetchList(page) {
|
||||
const { status } = this.data;
|
||||
// money_flag
|
||||
R.get('/index.php/api/v1/share_link_list', { page }).then(({ model }) => {
|
||||
const list = [];
|
||||
model.forEach(item => {
|
||||
list.push({
|
||||
...item,
|
||||
price: F.formatePrice(item.price),
|
||||
expire_time: item.expire_time.split(' ')[0],
|
||||
});
|
||||
});
|
||||
if (list.length == 0) {
|
||||
this.setData({ listEndText: '没有更多了' });
|
||||
} else {
|
||||
this.setData({ listEndText: '点击加载更多。。。' });
|
||||
}
|
||||
if (page == 1) {
|
||||
this.setData({ list,page });
|
||||
} else {
|
||||
const list2 = this.data.list.concat(list);
|
||||
this.setData({ list: list2 ,page});
|
||||
}
|
||||
});
|
||||
},
|
||||
loadMore() {
|
||||
const { page, listEndText } = this.data;
|
||||
if (listEndText == '点击加载更多。。。') {
|
||||
this.fetchList(page + 1);
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.loadMore();
|
||||
},
|
||||
})
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "进行中的分销",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {
|
||||
"t-tabs": "tdesign-miniprogram/tabs/tabs",
|
||||
"t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
|
||||
"t-image": "tdesign-miniprogram/image/image",
|
||||
"t-sticky": "tdesign-miniprogram/sticky/sticky",
|
||||
"t-divider": "tdesign-miniprogram/divider/divider",
|
||||
"t-footer": "tdesign-miniprogram/footer/footer"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<view>
|
||||
<view class="list">
|
||||
<view class="item" wx:for="{{list}}" wx:key="id">
|
||||
<view class="item-main" data-detail="{{item}}" data-index="{{index}}" bind:tap="goDel">
|
||||
<view class="right">
|
||||
<view class="text">
|
||||
<view>{{item.buy_type || '-'}}</view>
|
||||
<view>{{item.price}}元</view>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view></view>
|
||||
<view wx:if="{{item.deleted == 0}}" style="text-align: right;color:coral">置为失效</view>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view>创建: {{item.create_time}}</view>
|
||||
<view>截止: {{item.expire_time}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<t-footer wx:if="{{listEndText}}" text="{{listEndText}}" bind:tap="loadMore"></t-footer>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
page {
|
||||
padding: 0 20rpx;
|
||||
background-color: rgb(245, 246, 247);
|
||||
}
|
||||
.sw {
|
||||
width: 240rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.sw .txt {
|
||||
padding-left: 16rpx;
|
||||
}
|
||||
|
||||
|
||||
.list {
|
||||
margin-top: 20rpx;
|
||||
padding-bottom: 60rpx;
|
||||
}
|
||||
|
||||
.list .item {
|
||||
border-radius: 16rpx;
|
||||
background-color: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
width: 710rpx;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main {
|
||||
display: flex;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main .right {
|
||||
flex: 1;
|
||||
padding: 0 32rpx;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .text {
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
justify-content: space-between;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info {
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
justify-content: space-between;
|
||||
color: #8f9197;
|
||||
line-height: 36rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info .viewcnt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info .viewcnt.init {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info .viewcnt.resolve {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.list .item .item-main .right .info .viewcnt.reject {
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.list .item .h20 {
|
||||
height: 20rpx;
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
// pages/shop/shop.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!--pages/shop/shop.wxml-->
|
||||
<text>pages/shop/shop.wxml</text>
|
||||
|
|
@ -1,405 +0,0 @@
|
|||
import R from '../../utils/request';
|
||||
import C from '../../utils/constant';
|
||||
Page({
|
||||
data: {
|
||||
cdnHost: C.cdnHost,
|
||||
cdnHost: C.cdnHost,
|
||||
title: '',
|
||||
tel: '',
|
||||
content: '',
|
||||
shortAddress: '',
|
||||
address: '',
|
||||
video: '',
|
||||
position: {
|
||||
longitude: 0,
|
||||
latitude: 0,
|
||||
},
|
||||
ds: {
|
||||
list: [],
|
||||
refStatusNum: { finished: 0, failed: 0, process: 0 },
|
||||
},
|
||||
ts: {
|
||||
refImgDescs: {},
|
||||
refImgKeywords: {},
|
||||
fileUploadList: [],
|
||||
fileUploadList2: [],
|
||||
isUploading: false,
|
||||
timer: [],
|
||||
},
|
||||
stop: false,
|
||||
gridConfig: {
|
||||
column: 4,
|
||||
width: 160,
|
||||
height: 160,
|
||||
},
|
||||
config: {
|
||||
count: 1,
|
||||
},
|
||||
phoneError: false,
|
||||
//
|
||||
videoFileList: [],
|
||||
},
|
||||
onLoad(options) {
|
||||
const that = this;
|
||||
R.get('/index.php/api/v1/my', {}).then(({ model }) => {
|
||||
this.setData({ tel: model.phone });
|
||||
});
|
||||
wx.getFuzzyLocation({
|
||||
type: 'wgs84',
|
||||
success(res) {
|
||||
const longitude = res.longitude
|
||||
const latitude = res.latitude
|
||||
that.setData({
|
||||
position: {
|
||||
longitude,
|
||||
latitude,
|
||||
},
|
||||
});
|
||||
R.get('/index.php/api/v1/gps', { lat: latitude, lon: longitude }).then(({ model }) => {
|
||||
that.setData({ shortAddress: model.short_ad, address: model.full_ad });
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
onUnload() {
|
||||
this.data.stop = true;
|
||||
},
|
||||
onShareAppMessage() {
|
||||
},
|
||||
choosePoi() {
|
||||
const that = this;
|
||||
wx.chooseLocation({
|
||||
success({ latitude, longitude, name, address }) {
|
||||
that.setData({
|
||||
position: {
|
||||
latitude,
|
||||
longitude,
|
||||
},
|
||||
shortAddress: name,
|
||||
address,
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
//
|
||||
onPhoneInput(e) {
|
||||
const { phoneError } = this.data;
|
||||
const isPhoneNumber = /^[1][3,4,5,7,8,9][0-9]{9}$/.test(e.detail.value);
|
||||
if (phoneError === isPhoneNumber) {
|
||||
this.setData({
|
||||
phoneError: !isPhoneNumber,
|
||||
});
|
||||
}
|
||||
},
|
||||
onSubmit() {
|
||||
console.log('this.stat', this.data);
|
||||
const { title, tel, shortAddress, address, position, ds, content, videoFileList } = this.data;
|
||||
if (ds.refStatusNum.failed > 0) {
|
||||
wx.showToast({
|
||||
title: '请处理上传失败的图片',
|
||||
icon: 'none',
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (ds.refStatusNum.process > 0) {
|
||||
wx.showToast({
|
||||
title: '请等待图片上传完成',
|
||||
icon: 'none',
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 每个属性都判空,并且给出toast提示
|
||||
if (!tel) {
|
||||
wx.showToast({
|
||||
title: '请输入手机号',
|
||||
icon: 'none',
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!title) {
|
||||
wx.showToast({
|
||||
title: '请输入标题',
|
||||
icon: 'none',
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!content) {
|
||||
wx.showToast({
|
||||
title: '请输入您的发件信息',
|
||||
icon: 'none',
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!shortAddress) {
|
||||
wx.showToast({
|
||||
title: '请选择位置',
|
||||
icon: 'none',
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (ds.list.length === 0) {
|
||||
wx.showToast({
|
||||
title: '请上传图片',
|
||||
icon: 'none',
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 提交数据
|
||||
R.post('/index.php/api/v1/submit', {
|
||||
title,
|
||||
tel,
|
||||
shortAddress,
|
||||
address,
|
||||
content,
|
||||
longitude: position.longitude,
|
||||
latitude: position.latitude,
|
||||
imgs: ds.list.map((o) => o.path),
|
||||
video: videoFileList && videoFileList.length > 0 ? videoFileList[0].path : undefined,
|
||||
}).then(({ model }) => {
|
||||
wx.showToast({
|
||||
title: '提交成功,感谢您的反馈',
|
||||
icon: 'success',
|
||||
});
|
||||
setTimeout(() => {
|
||||
wx.navigateBack();
|
||||
}, 1000);
|
||||
});
|
||||
},
|
||||
goBack() {
|
||||
wx.navigateBack();
|
||||
},
|
||||
//
|
||||
callStatusNum() {
|
||||
const { ds } = this.data;
|
||||
const s = { finished: 0, failed: 0, process: 0 };
|
||||
ds.list.forEach((o) => {
|
||||
if (o.failed) s.failed++;
|
||||
else if (o.finished) s.finished++;
|
||||
else s.process++;
|
||||
});
|
||||
this.setData({
|
||||
'ds.refStatusNum': s,
|
||||
});
|
||||
},
|
||||
imgHandleSuccess(e) {
|
||||
console.log('imgHandleSuccess', e.detail);
|
||||
// const { files } = e.detail;
|
||||
// this.setData({
|
||||
// originFiles: files,
|
||||
// });
|
||||
this.httpRequest();
|
||||
},
|
||||
imgHandleRemove(e) {
|
||||
const { index } = e.detail;
|
||||
console.log('imgHandleRemove', e.detail);
|
||||
const { ds } = this.data;
|
||||
ds.list.splice(index, 1);
|
||||
this.setData({
|
||||
'ds.list': ds.list,
|
||||
});
|
||||
},
|
||||
imgHandleClick(e) {
|
||||
console.log(e.detail.file);
|
||||
},
|
||||
beforUpload(e) {
|
||||
const { files } = e.detail;
|
||||
console.log('beforUpload', files);
|
||||
const { ts } = this.data;
|
||||
const { fileUploadList, fileUploadList2 } = ts;
|
||||
files.map((file) => {
|
||||
fileUploadList.push(file);
|
||||
fileUploadList2.push(file);
|
||||
})
|
||||
this.setData({
|
||||
'ts.fileUploadList': fileUploadList,
|
||||
'ts.fileUploadList2': fileUploadList2,
|
||||
});
|
||||
},
|
||||
startPreview() {
|
||||
console.log('startPreview');
|
||||
if (this.data.stop) return;
|
||||
const { ts, ds } = this.data;
|
||||
const { fileUploadList2 } = ts;
|
||||
if (fileUploadList2.length > 0) {
|
||||
const file = fileUploadList2.shift();
|
||||
ds.list.push({
|
||||
src: file.url,
|
||||
url: file.url,
|
||||
uid: file.name,
|
||||
name: file.name,
|
||||
percent: 0,
|
||||
failed: false,
|
||||
status: 'loading',
|
||||
})
|
||||
this.setData({
|
||||
'ts.fileUploadList2': fileUploadList2,
|
||||
'ds.list': ds.list,
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.startPreview();
|
||||
}, 0);
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.startPreview();
|
||||
}, 2000);
|
||||
}
|
||||
},
|
||||
httpRequest(e) {
|
||||
if (this.data.stop) return;
|
||||
const { ts } = this.data;
|
||||
if (ts.isUploading) return;
|
||||
ts.isUploading = true;
|
||||
console.log('httpRequest');
|
||||
// 循环检测 是否有文件可以上传
|
||||
setTimeout(() => {
|
||||
this.uploadHandle();
|
||||
this.startPreview();
|
||||
}, 0);
|
||||
},
|
||||
uploadHandle() {
|
||||
console.log('uploadHandle');
|
||||
if (this.data.stop) return;
|
||||
this.callStatusNum();
|
||||
const { ts, ds } = this.data;
|
||||
const { fileUploadList } = ts;
|
||||
if (fileUploadList.length > 0) {
|
||||
console.log('fileUploadList', fileUploadList);
|
||||
const file = fileUploadList.shift();
|
||||
// formData.append('imageData', file);
|
||||
R.upload({ a: 1 }, 'img_file', file.url).catch((e) => e).then((response) => {
|
||||
// console.log('response-response333', response);
|
||||
ts.isUploading = false;
|
||||
try {
|
||||
response.data = JSON.parse(response.data);
|
||||
} catch (error) {
|
||||
response.data = null;
|
||||
}
|
||||
// console.log('asdfasd-response', response.data);
|
||||
if (response.data && response.data.code == -1000) {
|
||||
wx.showToast({
|
||||
title: '登录超时,请重新登录',
|
||||
icon: 'none',
|
||||
});
|
||||
setTimeout(() => {
|
||||
wx.navigateTo({ url: '/pages/home/home' });
|
||||
}, 500)
|
||||
return;
|
||||
}
|
||||
else if (response.data && response.data.success) {
|
||||
console.log('asdfasd-response2222', response.data);
|
||||
const { data: { model: { path } } } = response;
|
||||
this.setData({
|
||||
'ds.list': ds.list.map((o) => {
|
||||
if (file.name == o.uid) {
|
||||
return { ...o, path, finished: true, percent: 100, status: 'done' };
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
});
|
||||
// this.setData({
|
||||
// [`ds.list[${idx}].url`]: C.cdnHost + path,
|
||||
// });
|
||||
// R.getImg(4, imageId).then((path) => {
|
||||
// const tlist = this.data.ds.list;
|
||||
// let idx = 0;
|
||||
// // console.log('path', path);
|
||||
// tlist.forEach((c, i) => {
|
||||
// if (c.imageId == imageId) {
|
||||
// idx = i;
|
||||
// }
|
||||
// });
|
||||
// if (idx) {
|
||||
// this.setData({
|
||||
// [`ds.list[${idx}].url`]: path,
|
||||
// });
|
||||
// }
|
||||
// })
|
||||
// wx.showToast({
|
||||
// title: '图片:' + file.name + '已暂存',
|
||||
// icon: 'success',
|
||||
// });
|
||||
// this.saveTmpData();
|
||||
} else {
|
||||
console.log(response, file.name);
|
||||
let errorMsg = '上传失败,请移除后重试';
|
||||
// if (response.data && response.data.status == 529) {
|
||||
// errorMsg = '其他图集中已存在,请移除';
|
||||
// }
|
||||
this.setData({
|
||||
'ds.list': ds.list.map((o) => {
|
||||
if (file.name == o.uid) {
|
||||
return { ...o, failed: errorMsg, status: 'failed' };
|
||||
}
|
||||
return { ...o };
|
||||
}),
|
||||
});
|
||||
wx.showToast({
|
||||
title: file.name + ',' + errorMsg,
|
||||
icon: 'error',
|
||||
});
|
||||
// this.saveTmpData();
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.uploadHandle();
|
||||
}, 0);
|
||||
});
|
||||
} else {
|
||||
// setTimeout(() => {
|
||||
// this.uploadHandle();
|
||||
// }, 2000);
|
||||
}
|
||||
},
|
||||
//video
|
||||
handleVideoAdd(e) {
|
||||
const { files } = e.detail;
|
||||
files.forEach(file => this.uploadVideoFile(file))
|
||||
},
|
||||
uploadVideoFile(file) {
|
||||
|
||||
wx.getVideoInfo({ src: file.url }).then((res) => {
|
||||
if (res.duration > 180) {
|
||||
wx.showToast({
|
||||
title: '视频时长不能超过3分钟',
|
||||
icon: 'none',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
const { videoFileList } = this.data;
|
||||
|
||||
this.setData({
|
||||
videoFileList: [...videoFileList, { ...file, path: '', status: 'loading' }],
|
||||
});
|
||||
const { length } = videoFileList;
|
||||
R.upload({ a: 2 }, 'video_file', file.url, (res) => {
|
||||
this.setData({
|
||||
[`videoFileList[${length}].percent`]: res.progress,
|
||||
});
|
||||
}).catch((e) => e).then((response) => {
|
||||
try {
|
||||
response.data = JSON.parse(response.data);
|
||||
} catch (error) {
|
||||
response.data = null;
|
||||
}
|
||||
if (response.data && response.data.success) {
|
||||
const { data: { model: { path } } } = response;
|
||||
console.log('asdfasd-response2222', response.data, this.data.videoFileList, length);
|
||||
this.setData({
|
||||
[`videoFileList[${length}].status`]: 'done',
|
||||
[`videoFileList[${length}].path`]: path,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
handleVideoRemove(e) {
|
||||
const { index } = e.detail;
|
||||
const { videoFileList } = this.data;
|
||||
|
||||
videoFileList.splice(index, 1);
|
||||
this.setData({
|
||||
videoFileList,
|
||||
});
|
||||
},
|
||||
})
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "有发现",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {
|
||||
"t-image": "tdesign-miniprogram/image/image",
|
||||
"t-input": "tdesign-miniprogram/input/input",
|
||||
"t-cell": "tdesign-miniprogram/cell/cell",
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"t-notice-bar": "tdesign-miniprogram/notice-bar/notice-bar",
|
||||
"t-upload": "tdesign-miniprogram/upload/upload",
|
||||
"t-button": "tdesign-miniprogram/button/button",
|
||||
"t-textarea": "tdesign-miniprogram/textarea/textarea"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<view>
|
||||
<image class="img" src="{{cdnHost + '/static/bg_take.jpeg?v=5'}}" />
|
||||
<!-- <view class="img"> -->
|
||||
<!-- <view>发布信息审核通过后获10元红包</view> -->
|
||||
<!-- </view> -->
|
||||
<view class="form">
|
||||
<t-input label="标题" placeholder="请输入您的发现标题" model:value="{{title}}" align="right" />
|
||||
<t-input label="手机" type="number" tips="{{phoneError ? '手机号输入不正确' : ''}}" bindchange="onPhoneInput" placeholder="请输入您的手机号码" model:value="{{tel}}" align="right" />
|
||||
<t-cell title="现场图片" description="最多6张图片" hover></t-cell>
|
||||
<t-cell class="photos">
|
||||
<view class="wrapper" slot="description">
|
||||
<t-upload max="{{6}}" size-limit="{{102400}}" media-type="{{['image']}}" files="{{ds.list}}" gridConfig="{{gridConfig}}" bind:success="imgHandleSuccess" bind:remove="imgHandleRemove" bind:click="imgHandleClick" request-method="{{httpRequest}}" bind:add="beforUpload" />
|
||||
</view>
|
||||
</t-cell>
|
||||
<t-cell title="现场视频(可选)" description="最多一个视频(3分钟内)" hover>
|
||||
<t-upload slot="note" mediaType="{{['video']}}" max="{{1}}" files="{{videoFileList}}" bind:add="handleVideoAdd" bind:remove="handleVideoRemove"></t-upload>
|
||||
</t-cell>
|
||||
<t-textarea t-class="external-class" label="" placeholder="请输入具体内容" value="" maxcharacter="5000" disableDefaultPadding="{{true}}" model:value="{{content}}" />
|
||||
<view class="local_bar">
|
||||
<view class="local">
|
||||
<t-icon name="location-1" size="30rpx" color="green"></t-icon>
|
||||
{{shortAddress}}
|
||||
</view>
|
||||
<view class="btn" bind:tap="choosePoi">
|
||||
修正位置
|
||||
<t-icon name="chevron-right" size="28rpx"></t-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<t-notice-bar visible="{{true}}" theme="warning" content="请确保您发布的信息真实有效"></t-notice-bar>
|
||||
<view class="btns">
|
||||
<t-button theme="primary" size="large" block bind:tap="onSubmit">确认发布</t-button>
|
||||
<t-button theme="primary" size="large" block variant="outline" bind:tap="goBack">取消</t-button>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
page {
|
||||
background-color: rgb(245, 246, 247);
|
||||
}
|
||||
|
||||
.img {
|
||||
font-size: 12rpx;
|
||||
width: 750rpx;
|
||||
margin: 0 auto;
|
||||
height: 530rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.form {
|
||||
margin: 0 20rpx;
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
margin-top: -100rpx;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.form .t-input__label {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.form .t-input__label::after {
|
||||
display: block;
|
||||
content: '*';
|
||||
color: #f00;
|
||||
position: absolute;
|
||||
font-size: 40rpx;
|
||||
right: -30rpx;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.form .photos .t-image {
|
||||
margin-left: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.t-textarea__wrapper {
|
||||
background-color: rgb(245, 246, 247);
|
||||
border: 16rpx;
|
||||
}
|
||||
|
||||
.t-textarea__wrapper .t-textarea__wrapper-inner {
|
||||
padding: 16rpx;
|
||||
border: 16rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.local_bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 40rpx;
|
||||
border-bottom: 10px solid #fff;
|
||||
}
|
||||
|
||||
.local_bar .t-icon {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.local_bar .local {
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
align-items: center;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.local_bar .btn {
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
align-items: center;
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.t-notice-bar {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
.btns {
|
||||
padding: 0 40rpx;
|
||||
padding-bottom: 90rpx;
|
||||
}
|
||||
|
||||
.btns .t-button {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.t-upload .t-grid__content .t-grid-item {
|
||||
width: auto !important;
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
// pages/test/test.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!--pages/test/test.wxml-->
|
||||
<text>pages/test/test.wxml</text>
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
const AuthStepType = {
|
||||
ONE: 1,
|
||||
TWO: 2,
|
||||
THREE: 3,
|
||||
};
|
||||
|
||||
Component({
|
||||
options: {
|
||||
multipleSlots: true,
|
||||
},
|
||||
properties: {
|
||||
currAuthStep: {
|
||||
type: Number,
|
||||
value: AuthStepType.ONE,
|
||||
},
|
||||
userInfo: {
|
||||
type: Object,
|
||||
value: {},
|
||||
},
|
||||
isNeedGetUserInfo: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
data: {
|
||||
defaultAvatarUrl:
|
||||
'https://cdn-we-retail.ym.tencent.com/miniapp/usercenter/icon-user-center-avatar@2x.png',
|
||||
AuthStepType,
|
||||
},
|
||||
methods: {
|
||||
gotoUserEditPage() {
|
||||
this.triggerEvent('gotoUserEditPage');
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"t-avatar": "tdesign-miniprogram/avatar/avatar"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
<view class="user-center-card">
|
||||
<!-- 未登录的情况 -->
|
||||
<block wx:if="{{currAuthStep === AuthStepType.ONE}}">
|
||||
<view class="user-center-card__header" bind:tap="gotoUserEditPage">
|
||||
<t-avatar image="{{userInfo.avatarUrl || defaultAvatarUrl}}" class="user-center-card__header__avatar" />
|
||||
<view class="user-center-card__header__name">{{'请登录'}}</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 已登录但未授权用户信息情况 -->
|
||||
<block wx:if="{{currAuthStep === AuthStepType.TWO}}">
|
||||
<view class="user-center-card__header">
|
||||
<t-avatar image="{{userInfo.avatarUrl || defaultAvatarUrl}}" class="user-center-card__header__avatar" />
|
||||
<view class="user-center-card__header__name">
|
||||
<view class="name">{{userInfo.nickName || '微信用户'}}</view>
|
||||
</view>
|
||||
<!-- 需要授权用户信息,通过slot添加弹窗 -->
|
||||
<view class="user-center-card__header__transparent" wx:if="{{isNeedGetUserInfo}}">
|
||||
<slot name="getUserInfo" />
|
||||
</view>
|
||||
<!-- 不需要授权用户信息,仍然触发gotoUserEditPage事件 -->
|
||||
<view class="user-center-card__header__transparent" bind:tap="gotoUserEditPage" wx:else></view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 已登录且已经授权用户信息的情况 -->
|
||||
<block wx:if="{{currAuthStep === AuthStepType.THREE}}">
|
||||
<view class="user-center-card__header" bind:tap="gotoUserEditPage">
|
||||
<t-avatar
|
||||
t-class="avatar"
|
||||
mode="aspectFill"
|
||||
class="user-center-card__header__avatar"
|
||||
image="{{userInfo.avatarUrl || defaultAvatarUrl}}"
|
||||
/>
|
||||
<view class="user-center-card__header__name">{{userInfo.nickName || '微信用户'}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
.user-center-card {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 480rpx;
|
||||
background-image: url('https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png');
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
.user-center-card__header {
|
||||
margin-top: 192rpx;
|
||||
margin-bottom: 48rpx;
|
||||
height: 96rpx;
|
||||
line-height: 48rpx;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
color: #333;
|
||||
position: relative;
|
||||
}
|
||||
.user-center-card__header__avatar {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 48rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.user-center-card__header__name .name{
|
||||
font-size: 36rpx;
|
||||
line-height: 48rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
margin-left: 24rpx;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
.user-center-card__header__name .score{
|
||||
font-size: 22rpx;
|
||||
line-height: 38rpx;
|
||||
color: #333;
|
||||
margin-left: 24rpx;
|
||||
margin-right: 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.user-center-card__header__transparent {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
background-color: transparent;
|
||||
height: 100%;
|
||||
width: 30%;
|
||||
}
|
||||
.user-center-card__icon {
|
||||
line-height: 96rpx;
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
import R from '../../utils/request';
|
||||
import C from '../../utils/constant';
|
||||
import * as F from '../../utils/func';
|
||||
|
||||
Page({
|
||||
data: {
|
||||
cdnHost: C.cdnHost,
|
||||
phone: '',
|
||||
name: '',
|
||||
price_sum: '',
|
||||
share_cnt: '',
|
||||
share_view_cnt: '',
|
||||
is_share: false,
|
||||
show_vip_link: false,
|
||||
payed_vip_link: '',
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.getTabBar().init();
|
||||
this.init();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.init();
|
||||
},
|
||||
|
||||
init() {
|
||||
this.fetUserInfoHandle();
|
||||
},
|
||||
|
||||
fetUserInfoHandle() {
|
||||
R.get('/index.php/api/v1/my').then(({ model }) => {
|
||||
this.setData({
|
||||
name: model.real_name || model.nick_name || '微信用户',
|
||||
phone: model.phone || '-',
|
||||
share_cnt: model.share_cnt,
|
||||
share_view_cnt: model.share_view_cnt,
|
||||
price_sum: F.formatePrice(model.price_sum || 0),
|
||||
is_share: !!model.is_share,
|
||||
show_vip_link: model.show_vip_link || false,
|
||||
payed_vip_link: model.payed_vip_link || '',
|
||||
});
|
||||
})
|
||||
},
|
||||
getPhoneNumber(e) {
|
||||
console.log(e.detail.code) // 动态令牌
|
||||
console.log(e.detail.errMsg) // 回调信息(成功失败都会返回)
|
||||
console.log(e.detail.errno) // 错误码(失败时返回)
|
||||
if (!e.detail.errno) {
|
||||
R.post('/index.php/api/v1/bind_auth_phone', { code: e.detail.code }).then(() => {
|
||||
this.setData({ hasPhone: true })
|
||||
this.goH5Shop();
|
||||
})
|
||||
} else {
|
||||
// e.detail.errMsg
|
||||
}
|
||||
},
|
||||
goShared() {
|
||||
wx.switchTab({
|
||||
url: '/pages/faxianlist/faxianlist',
|
||||
})
|
||||
},
|
||||
goOrder() {
|
||||
wx.navigateTo({ url: '/pages/paylist/paylist' })
|
||||
},
|
||||
toVipLink() {
|
||||
wx.navigateTo({ url: '/pages/webview/webview?url='+encodeURIComponent(this.data.payed_vip_link) })
|
||||
},
|
||||
goSharelist() {
|
||||
wx.navigateTo({ url: '/pages/sharelist/sharelist' })
|
||||
},
|
||||
goInfo() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/usercenter/info',
|
||||
})
|
||||
},
|
||||
});
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "个人中心",
|
||||
"usingComponents": {
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"t-link": "tdesign-miniprogram/link/link",
|
||||
"t-cell": "tdesign-miniprogram/cell/cell"
|
||||
},
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
|
|
@ -1,173 +0,0 @@
|
|||
page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.header {
|
||||
background-color: linear-gradient(180deg, #f0f4fc, #fff);
|
||||
position: relative;
|
||||
|
||||
background-color: rgba(255, 255, 255, 0.8);
|
||||
box-sizing: border-box;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
margin-top: -300rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.header .info {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.header .info::after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.header .avatar {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.cb {
|
||||
top: 10rpx;
|
||||
right: 100rpx;
|
||||
height: 530rpx;
|
||||
width: 750rpx;
|
||||
background: url('http://cdn.zhonganonline.top/newslist/static/bg_take.jpeg?v=5') no-repeat;
|
||||
background-position: center center;
|
||||
background-size: 100% 100%;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.vip {
|
||||
background: linear-gradient(90deg, #f9e9bc, #f2d786);
|
||||
border-radius: 20rpx;
|
||||
height: 154rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 40rpx;
|
||||
width: 94%;
|
||||
margin: 0 auto;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.vip .dest .a {
|
||||
color: #775d2f;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.vip .dest .b {
|
||||
color: #775d2f;
|
||||
opacity: 0.8;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.vip .btn {
|
||||
background-color: #fff;
|
||||
color: #775d2f;
|
||||
font-size: 24rpx;
|
||||
height: 68rpx;
|
||||
width: 164rpx;
|
||||
border-radius: 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.title_bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 32rpx;
|
||||
width: 92%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.title_bar .title {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||
background-position: left center;
|
||||
background-size: 100% 100%;
|
||||
font-size: 32rpx;
|
||||
color: rgb(53, 58, 71);
|
||||
height: 34rpx;
|
||||
width: 132rpx;
|
||||
}
|
||||
|
||||
.title_bar .btn {
|
||||
color: #f09759;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #fff8e9;
|
||||
padding: 10rpx 20rpx;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
.title_bar .btn .t-icon {
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.ma20 {
|
||||
height: 20rpx;
|
||||
background-color: #f5f5f5;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.cards_w {
|
||||
background-color: #fff;
|
||||
width: 94%;
|
||||
border-radius: 6rpx;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.cards_w .cards {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
|
||||
.cards_w .cards .card {
|
||||
width: 28%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: none;
|
||||
font-size: 0;
|
||||
line-height: 24rpx;
|
||||
|
||||
&::after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.cards_w .cards .card .txt {
|
||||
padding-top: 12rpx;
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.cards_w .cards .card .txt2 {
|
||||
padding-top: 12rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.cards_w .cards .card.hide {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.link {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx 0;
|
||||
width: 50%;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
<view class="cb"></view>
|
||||
<view class="header">
|
||||
<t-cell class="info" title="{{name}}" image="{{cdnHost + '/static/header.png?v=5'}}" description="{{phone}}" hover arrow bind:tap="goInfo"></t-cell>
|
||||
</view>
|
||||
<!-- <view class="vip">
|
||||
<view class="dest">
|
||||
<view class="a">美丽桐庐监督行动</view>
|
||||
<view class="b" wx:if="{{price * 1}}">经审核后可获得{{price}}元现金奖励</view>
|
||||
</view>
|
||||
<view class="btn" bind:tap="goTakePhoto">参与试试</view>
|
||||
</view> -->
|
||||
<!-- <view class="ma20"></view> -->
|
||||
<!-- <view class="title_bar"> -->
|
||||
<!-- <view class="title">服务数据</view> -->
|
||||
<!-- <view class="btn" bind:tap="goTakePhoto">
|
||||
<t-icon name="camera" size="28rpx" color="f09759"></t-icon>
|
||||
有发现
|
||||
</view> -->
|
||||
<!-- </view> -->
|
||||
<!-- <view class="ma20"></view> -->
|
||||
<view class="cards_w">
|
||||
<view class="cards" wx:if="{{is_share}}">
|
||||
<view class="card" bind:tap="goShared">
|
||||
<view class="txt2">{{price_sum}}元</view>
|
||||
<view class="txt">总收入</view>
|
||||
</view>
|
||||
<!-- aa -->
|
||||
<view class="card" bind:tap="goSharelist">
|
||||
<view class="txt2">{{share_cnt}}次</view>
|
||||
<view class="txt">总分享</view>
|
||||
</view>
|
||||
<view class="card">
|
||||
<view class="txt2">{{share_view_cnt}}</view>
|
||||
<view class="txt">分享浏览</view>
|
||||
</view>
|
||||
<!-- /aa -->
|
||||
<!-- <view class="card hide">
|
||||
<t-icon name="location" size="30" color="#aaa" />
|
||||
<view class="txt">---</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="ma20"></view>
|
||||
<t-cell class="info" title="我的订单" hover arrow bind:tap="goOrder"></t-cell>
|
||||
<view class="ma20"></view>
|
||||
<view class="ma20"></view>
|
||||
<view class="link" wx:if="{{show_vip_link}}">
|
||||
<t-link size="small" theme="primary" content="专属服务企业、微信群" suffixIcon="jump" hover bind:tap="toVipLink" />
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -1,150 +0,0 @@
|
|||
page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.header {
|
||||
background-color: linear-gradient(180deg, #f0f4fc, #fff);
|
||||
position: relative;
|
||||
background-color: rgba(255, 255, 255, 0.8);
|
||||
box-sizing: border-box;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
margin-top: -300rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.header .info {
|
||||
background-color: transparent;
|
||||
}
|
||||
.header .info::after {
|
||||
display: none;
|
||||
}
|
||||
.header .avatar {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.cb {
|
||||
top: 10rpx;
|
||||
right: 100rpx;
|
||||
height: 530rpx;
|
||||
width: 750rpx;
|
||||
background: url('http://cdn.zhonganonline.top/newslist/static/bg_take.jpeg?v=5') no-repeat;
|
||||
background-position: center center;
|
||||
background-size: 100% 100%;
|
||||
z-index: 1;
|
||||
}
|
||||
.vip {
|
||||
background: linear-gradient(90deg, #f9e9bc, #f2d786);
|
||||
border-radius: 20rpx;
|
||||
height: 154rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 40rpx;
|
||||
width: 94%;
|
||||
margin: 0 auto;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.vip .dest .a {
|
||||
color: #775d2f;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.vip .dest .b {
|
||||
color: #775d2f;
|
||||
opacity: 0.8;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
.vip .btn {
|
||||
background-color: #fff;
|
||||
color: #775d2f;
|
||||
font-size: 24rpx;
|
||||
height: 68rpx;
|
||||
width: 164rpx;
|
||||
border-radius: 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.title_bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 32rpx;
|
||||
width: 92%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.title_bar .title {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||
background-position: left center;
|
||||
background-size: 100% 100%;
|
||||
font-size: 32rpx;
|
||||
color: #353a47;
|
||||
height: 34rpx;
|
||||
width: 132rpx;
|
||||
}
|
||||
.title_bar .btn {
|
||||
color: #f09759;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #fff8e9;
|
||||
padding: 10rpx 20rpx;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
.title_bar .btn .t-icon {
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
.ma20 {
|
||||
height: 20rpx;
|
||||
background-color: #f5f5f5;
|
||||
width: 100%;
|
||||
}
|
||||
.cards_w {
|
||||
background-color: #fff;
|
||||
width: 94%;
|
||||
border-radius: 6rpx;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.cards_w .cards {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
.cards_w .cards .card {
|
||||
width: 28%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: none;
|
||||
font-size: 0;
|
||||
line-height: 24rpx;
|
||||
}
|
||||
.cards_w .cards .card::after {
|
||||
display: none;
|
||||
}
|
||||
.cards_w .cards .card .txt {
|
||||
padding-top: 12rpx;
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
}
|
||||
.cards_w .cards .card .txt2 {
|
||||
padding-top: 12rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.cards_w .cards .card.hide {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
.link {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx 0;
|
||||
width: 50%;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
import R from '../../utils/request';
|
||||
|
||||
|
||||
Page({
|
||||
data: {
|
||||
name: '',
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
},
|
||||
|
||||
onShow() {
|
||||
R.get('/index.php/api/v1/my').then(({ model }) => {
|
||||
this.setData({
|
||||
name: model.real_name || model.nick_name || '微信用户',
|
||||
});
|
||||
})
|
||||
},
|
||||
onSubmit(){
|
||||
if(!this.data.name.trim()){
|
||||
wx.showToast({
|
||||
title: '请填写姓名',
|
||||
icon: 'none',
|
||||
});
|
||||
return;
|
||||
}
|
||||
R.post('/index.php/api/v1/set_name',{name:this.data.name.trim()}).then(({ model }) => {
|
||||
wx.navigateBack();
|
||||
})
|
||||
}
|
||||
});
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "个人信息",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {
|
||||
"t-input": "tdesign-miniprogram/input/input",
|
||||
"t-button": "tdesign-miniprogram/button/button"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
<view>
|
||||
<view class="form">
|
||||
<t-input label="姓名" placeholder="请输入您的姓名" model:value="{{name}}" align="right" />
|
||||
</view>
|
||||
<view class="btns">
|
||||
<t-button theme="primary" size="large" block bind:tap="onSubmit">确认</t-button>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.btns{
|
||||
padding: 20rpx 40rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
|
||||
Page({
|
||||
data: {
|
||||
url: '',
|
||||
},
|
||||
onLoad(options) {
|
||||
let { url } = options;
|
||||
console.log('url',url);
|
||||
const user_id = wx.getStorageSync('user_id');
|
||||
url = url.replace('${user_id}', user_id);
|
||||
this.setData({ url: decodeURIComponent(url) });
|
||||
},
|
||||
})
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": " ",
|
||||
"backgroundTextStyle": "light",
|
||||
"usingComponents": {}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
<web-view wx:if="{{url}}" src="{{url}}"></web-view>
|
||||
|
|
@ -1 +0,0 @@
|
|||
/* pages/webview/webview.wxss */
|
||||
21452
pnpm-lock.yaml
generated
Normal file
21452
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,78 +0,0 @@
|
|||
{
|
||||
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
||||
"setting": {
|
||||
"urlCheck": true,
|
||||
"es6": true,
|
||||
"enhance": true,
|
||||
"postcss": true,
|
||||
"preloadBackgroundData": false,
|
||||
"minified": true,
|
||||
"newFeature": false,
|
||||
"coverView": true,
|
||||
"nodeModules": true,
|
||||
"autoAudits": false,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"scopeDataCheck": false,
|
||||
"uglifyFileName": false,
|
||||
"checkInvalidKey": true,
|
||||
"checkSiteMap": true,
|
||||
"uploadWithSourceMap": true,
|
||||
"compileHotReLoad": false,
|
||||
"lazyloadPlaceholderEnable": false,
|
||||
"useMultiFrameRuntime": true,
|
||||
"ignoreDevUnusedFiles": false,
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
},
|
||||
"enableEngineNative": false,
|
||||
"useIsolateContext": true,
|
||||
"userConfirmedBundleSwitch": false,
|
||||
"packNpmManually": false,
|
||||
"packNpmRelationList": [],
|
||||
"minifyWXSS": true,
|
||||
"disableUseStrict": false,
|
||||
"minifyWXML": true,
|
||||
"showES6CompileOption": false,
|
||||
"useCompilerPlugins": false,
|
||||
"ignoreUploadUnusedFiles": true,
|
||||
"useStaticServer": true,
|
||||
"compileWorklet": false,
|
||||
"localPlugins": false,
|
||||
"condition": false,
|
||||
"swc": false,
|
||||
"disableSWC": true
|
||||
},
|
||||
"compileType": "miniprogram",
|
||||
"simulatorType": "wechat",
|
||||
"simulatorPluginLibVersion": {},
|
||||
"condition": {
|
||||
"miniprogram": {
|
||||
"list": [
|
||||
{
|
||||
"name": "首页入口",
|
||||
"pathName": "pages/home/home",
|
||||
"query": "",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"name": "示例页-个人中心",
|
||||
"pathName": "pages/usercenter/index",
|
||||
"query": "",
|
||||
"scene": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"editorSetting": {
|
||||
"tabIndent": "insertSpaces",
|
||||
"tabSize": 2
|
||||
},
|
||||
"packOptions": {
|
||||
"ignore": [],
|
||||
"include": []
|
||||
},
|
||||
"appid": "wx1a5ce23035f68f08",
|
||||
"libVersion": "3.5.8"
|
||||
}
|
||||
BIN
public/BiazfanxmamNRoxxVxka.png
Normal file
BIN
public/BiazfanxmamNRoxxVxka.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
BIN
public/favicon.ico
Normal file
BIN
public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.4 KiB |
BIN
public/logo.png
Normal file
BIN
public/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.7 KiB |
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue