commit 1c24452b6c3ab7b54678c0b78f022a6c653c4075 Author: PC-202306242200\Administrator <1648263436@qq.com> Date: Sat Mar 28 23:10:55 2026 +0800 first commit diff --git a/App.vue b/App.vue new file mode 100644 index 0000000..14685a3 --- /dev/null +++ b/App.vue @@ -0,0 +1,43 @@ + + + diff --git a/api/http.ts b/api/http.ts new file mode 100644 index 0000000..1665070 --- /dev/null +++ b/api/http.ts @@ -0,0 +1,69 @@ +import { toast } from '@/utils/fun.js'; + +export const proxyObj = { + // 开发版 + development: 'https://apidjk.jitujt.com', + // development: 'http://192.168.1.62:48080', + // development: 'http://192.168.1.191:48080', + // 正式版 + production: 'https://apidjk.jitujt.com', +} + +interface shortcutsType { + url : string + params : any + method : any +} + + + +export const http = ({ url, params, method } : shortcutsType) => { + return new Promise((resolve, reject) => { + let Authorization : string = uni.getStorageSync('Authorization') || '' + let header = { + Authorization, + "Tenant-id": "134", + } + uni.request({ + url: proxyObj[process.env.NODE_ENV || 'development'] + url, + data: params || {}, + method: method || 'POST', + header: header, + success: (res : any) => { + const data = res.data + if (data.code == 401 || res.statusCode == 401) { + uni.removeStorageSync('Authorization'); + uni.removeStorageSync('userInfo'); + + + uni.showModal({ + title: '提示', + content: `${Authorization ? '登录失效' : '你还未登录'},是否前往登录?`, + success: function (res) { + if (res.confirm) { + // uni.clearStorageSync(); + uni.navigateTo({ + url: '/pages/login/login' + }) + } else if (res.cancel) { + uni.clearStorageSync(); + console.log('用户点击取消'); + } + } + }); + reject(data) + return + } + if (data.code === 0) { + resolve(data.data || null) + } else { + toast(data.msg) + reject(data) + } + }, + fail: (err) => { + reject(err) + } + }) + }); +}; \ No newline at end of file diff --git a/api/index.ts b/api/index.ts new file mode 100644 index 0000000..d73c4ee --- /dev/null +++ b/api/index.ts @@ -0,0 +1,13 @@ +import users from './modules/users' +import goods from './modules/goods' +import config from './modules/config' +import order from './modules/order' +// 公用接口申明 +const api = { + // 用户相关接口 + ...users, + ...goods, + ...config, + ...order +} +export default api \ No newline at end of file diff --git a/api/modules/config.ts b/api/modules/config.ts new file mode 100644 index 0000000..f22be3a --- /dev/null +++ b/api/modules/config.ts @@ -0,0 +1,17 @@ +import { http } from '../http' + + + + +// 用户相关接口 +const api = { + // 轮播图列表 + banner: (params = {}) => http({ url: '/app-api/djk/app/banner/page', params, method: 'GET' }), + // 公告列表 + noticePage: (params = {}) => http({ url: '/app-api/djk/app/notice/page', params, method: 'GET' }), + // 公告分类 + noticeCatePage: (params = {}) => http({ url: '/app-api/djk/app/notice-category/page', params, method: 'GET' }), + // 公告详情 + noticeInfo: (params = {}) => http({ url: '/app-api/djk/app/notice/get', params, method: 'GET' }), +} +export default api \ No newline at end of file diff --git a/api/modules/goods.ts b/api/modules/goods.ts new file mode 100644 index 0000000..80be502 --- /dev/null +++ b/api/modules/goods.ts @@ -0,0 +1,15 @@ +import { http } from '../http' + + + + +// 用户相关接口 +const api = { + // 商品列表 + goodsPage: (params = {}) => http({ url: '/app-api/djk/app/goods/page', params, method: 'GET' }), + // 商品详情 + goodsInfo: (params = {}) => http({ url: '/app-api/djk/app/goods/get', params, method: 'GET' }), + // 商品分类 + goodsCate: (params = {}) => http({ url: '/app-api/djk/app/goods/category/page', params, method: 'GET' }), +} +export default api \ No newline at end of file diff --git a/api/modules/order.ts b/api/modules/order.ts new file mode 100644 index 0000000..d63c691 --- /dev/null +++ b/api/modules/order.ts @@ -0,0 +1,15 @@ +import { http } from '../http' + + + + +// 用户相关接口 +const api = { + // 创建用户订单 + orderCreate: (params = {}) => http({ url: '/app-api/djk/app/order/create', params, method: 'POST' }), + // 用户订单列表 + orderPage: (params = {}) => http({ url: '/app-api/djk/app/order/page', params, method: 'GET' }), + // 获取用户订单详情 + orderInfo: (params = {}) => http({ url: '/app-api/djk/app/order/get', params, method: 'GET' }), +} +export default api \ No newline at end of file diff --git a/api/modules/users.ts b/api/modules/users.ts new file mode 100644 index 0000000..985a162 --- /dev/null +++ b/api/modules/users.ts @@ -0,0 +1,44 @@ +import { http } from '../http' + + + + +// 用户相关接口 +const api = { + // 密码登录 + loginApi: (params = {}) => http({ url: '/app-api/member/auth/login', params, method: 'POST' }), + // 验证码登录 + smsLoginApi: (params = {}) => http({ url: '/app-api/member/auth/sms-login', params, method: 'POST' }), + //用户注册 + registerApi: (params = {}) => http({ url: '/app-api/member/auth/register', params, method: 'POST' }), + // 发送验证码 + smsCode: (params = {}) => http({ url: '/app-api/member/auth/send-sms-code', params, method: 'POST' }), + // 用户基本信息 + usersGetInfo: (params = {}) => http({ url: '/app-api/member/user/get', params, method: 'GET' }), + // 获取团队列表 + usersGetInfoTeam: (params = {}) => http({ url: '/app-api/member/user/getPage', params, method: 'GET' }), + // 修改个人信息 + usersUpdate: (params = {}) => http({ url: '/app-api/member/user/update', params, method: 'PUT' }), + // 收货地址分页 + addressPage: (params = {}) => http({ url: '/app-api/djk/app/user-receiver/page', params, method: 'GET' }), + // 新增收货地址 + addressAdd: (params = {}) => http({ url: '/app-api/djk/app/user-receiver/create', params, method: 'POST' }), + // 编辑收货地址 + addressUp: (params = {}) => http({ url: '/app-api/djk/app/user-receiver/update', params, method: 'PUT' }), + // 编辑收货地址 + addressInfo: (params = {}) => http({ url: '/app-api/djk/app/user-receiver/get', params, method: 'GET' }), + // 删除收货地址 + addressDel: (params = {}) => http({ url: '/app-api/djk/app/user-receiver/delete?id=' + params.id, params, method: 'DELETE' }), + // 余额记录 + moneyRecord: (params = {}) => http({ url: '/app-api/member/money-record/djk/page', params, method: 'GET' }), + // 修改用户手机号 + updateMobile: (params = {}) => http({ url: '/app-api/member/user/update-mobile', params, method: 'PUT' }), + // 报单综合 + rewardReport: (params = {}) => http({ url: '/app-api/member/money-record/djk/rewardReport', params, method: 'GET' }), + // 团队月度业绩奖查询 + getTeamMonthlyPerformanceAward: (params = {}) => http({ url: '/app-api/member/money-record/djk/getTeamMonthlyPerformanceAward', params, method: 'GET' }), + + // 划转 + transfer2other: (params = {}) => http({ url: '/app-api/member/user/pay/transfer2other', params, method: 'POST' }), +} +export default api \ No newline at end of file diff --git a/common/index.scss b/common/index.scss new file mode 100644 index 0000000..036cbc1 --- /dev/null +++ b/common/index.scss @@ -0,0 +1,15 @@ + +view, +image { + padding: 0; + margin: 0; + box-sizing: border-box; +} + +.mt30 { + margin-top: 30rpx; +} + +.p30 { + padding: 30rpx; +} diff --git a/common/js/user.js b/common/js/user.js new file mode 100644 index 0000000..0ca5bee --- /dev/null +++ b/common/js/user.js @@ -0,0 +1,37 @@ +import { + getOssUploadParams +} from "@/api/api.js" + + + +export const uploadFiles = (urls) => { + return new Promise(async (resolve, reject) => { + let res = await getOssUploadParams() + const fd = { + policy: res.policy, + OSSAccessKeyId: res.accessId, + success_action_status: 200, + signature: res.signature, + key: res.dir + Date.now() + Math.floor(100000 + Math.random() * + 900000) + '.' + + urls.substring(urls.lastIndexOf(".") + 1), + }; + uni.uploadFile({ + url: res.host, // Example, not a real endpoint + filePath: urls, + header: { + "content-type": 'multipart/form-data' + }, + name: 'file', + formData: fd, + success: (_res) => { + resolve(fd.key); + }, + fail: (err) => { + console.log(err); + reject(err); + } + }); + console.log(); + }); +} \ No newline at end of file diff --git a/common/money.json b/common/money.json new file mode 100644 index 0000000..7641fa4 --- /dev/null +++ b/common/money.json @@ -0,0 +1,105 @@ +[{ + "name": "充值", + "id": 1100 + }, + { + "name": "后台充值", + "id": 1200 + }, + { + "name": "后台划扣", + "id": 1201 + }, + { + "name": "购买商品", + "id": 2100 + }, + { + "name": "商品推广", + "id": 2110 + }, + { + "name": "商品培育津贴", + "id": 2120 + }, + { + "name": "商品服务津贴", + "id": 2130 + }, + { + "name": "购买商品-退单", + "id": 2200 + }, + { + "name": "商品推广-退单", + "id": 2210 + }, + { + "name": "商品培育津贴-退单", + "id": 2220 + }, + { + "name": "商品服务津贴-退单", + "id": 2230 + }, + { + "name": "充电桩收益", + "id": 3100 + }, + { + "name": "充电桩推广", + "id": 3110 + }, + { + "name": "充电桩培育津贴", + "id": 3120 + }, + { + "name": "充电桩服务津贴", + "id": 3130 + }, + { + "name": "充电桩收益-退单", + "id": 3200 + }, + { + "name": "充电桩推广-退单", + "id": 3210 + }, + { + "name": "充电桩培育津贴-退单", + "id": 3220 + }, + { + "name": "充电桩服务津贴-退单", + "id": 3230 + }, + { + "name": "提现", + "id": 4100 + }, + { + "name": "提现失败", + "id": 4200 + }, + { + "name": "转赠付款", + "id": 5100 + }, + { + "name": "转赠收款", + "id": 5200 + }, + { + "name": "转换减少", + "id": 6100 + }, + { + "name": "转换增加", + "id": 6200 + }, + { + "name": "转账-星梦", + "id": 7100 + } +] \ No newline at end of file diff --git a/hooks/useNav.js b/hooks/useNav.js new file mode 100644 index 0000000..3df5437 --- /dev/null +++ b/hooks/useNav.js @@ -0,0 +1,54 @@ +import { + ref, + watch +} from 'vue'; +import { + Store +} from '@/store'; +const store = Store(); + +export function useNav() { + + const navTo = (path, token, call) => { + if (call) { + uni.makePhoneCall({ + phoneNumber: '17707569278' + }); + return + } + + const Authorization = uni.getStorageSync('Authorization') || '' + if (token && !Authorization) { + return uni.showModal({ + title: '提示', + content: '你还未登录,是否前往登录?', + success: function(res) { + if (res.confirm) { + uni.navigateTo({ + url: '/pages/login/login' + }) + } else if (res.cancel) { + console.log('用户点击取消'); + } + } + }); + } else { + uni.navigateTo({ + url: path + }) + } + } + + const nav = (e) => { + uni[e.type == 'nav' || !e.type ? 'navigateTo' : e.type == 'switchTab' ? 'switchTab' : 'navigateTo']({ + url: e.path + }) + } + + return { + nav, + navTo + } +} + +export default useNav \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..c3ff205 --- /dev/null +++ b/index.html @@ -0,0 +1,20 @@ + + + + + + + + + + +
+ + + diff --git a/main.js b/main.js new file mode 100644 index 0000000..ffb5927 --- /dev/null +++ b/main.js @@ -0,0 +1,37 @@ +// #ifndef VUE3 +import Vue from 'vue' +import App from './App' + +Vue.config.productionTip = false + +App.mpType = 'app' + +const app = new Vue({ + ...App +}) + + +import share from "./utils/mpShare.js"; +Vue.mixin(share) + +app.$mount() +// #endif + +// #ifdef VUE3 +import { + createSSRApp +} from 'vue' +import App from './App.vue' +import * as Pinia from 'pinia' +import share from "./utils/mpShare.js"; + + +export function createApp() { + const app = createSSRApp(App) + app.mixin(share) + app.use(Pinia.createPinia()) + return { + app + } +} +// #endif \ No newline at end of file diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..58b5af0 --- /dev/null +++ b/manifest.json @@ -0,0 +1,60 @@ +{ + "name" : "dajiankuang", + "appid" : "__UNI__C20A99C", + "description" : "", + "versionName" : "1.0.0", + "versionCode" : "100", + "transformPx" : false, + "app-plus" : { + /* 5+App特有相关 */ + "usingComponents" : true, + "nvueCompiler" : "uni-app", + "nvueStyleCompiler" : "uni-app", + "splashscreen" : { + "alwaysShowBeforeRender" : true, + "waiting" : true, + "autoclose" : true, + "delay" : 0 + }, + "modules" : {}, + /* 模块配置 */ + "distribute" : { + /* 应用发布信息 */ + "android" : { + /* android打包配置 */ + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "ios" : {}, + /* ios打包配置 */ + "sdkConfigs" : {} + } + }, + /* SDK配置 */ + "quickapp" : {}, + /* 快应用特有相关 */ + "mp-weixin" : { + /* 小程序特有相关 */ + "appid" : "wx80532d1eec915730", + "setting" : { + "urlCheck" : false + }, + "usingComponents" : true + }, + "vueVersion" : "3" +} diff --git a/pages.json b/pages.json new file mode 100644 index 0000000..d7a174d --- /dev/null +++ b/pages.json @@ -0,0 +1,187 @@ +{ + "pages": [{ + "path": "pages/index/index", + "style": { + "navigationBarTitleText": "首页", + "navigationStyle": "custom" + } + }, + { + "path": "pages/mine/mine", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "pages/cate/cate", + "style": { + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#799675" + } + }, + { + "path": "pages/order/order", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "pages/login/login", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "pages/goods/goods", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "pages/team/team", + "style": { + "navigationBarTitleText": "我的团队" + } + }, + { + "path": "pages/mine/sett", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "pages/equity/equity", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "pages/wallet/wallet", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "pages/notice/notice", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "pages/address/list", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "pages/address/add", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "pages/order/confirm", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "pages/order/success", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "pages/goods/prefecture", + "style": { + "navigationBarTitleText": "进货专区", + "navigationStyle": "custom" + } + }, + { + "path": "pages/wallet/list", + "style": { + "navigationBarTitleText": "我的账单", + "navigationStyle": "custom" + } + }, + { + "path": "pages/notice/details", + "style": { + "navigationBarTitleText": "公告", + "navigationBarBackgroundColor": "#fff" + } + }, + { + "path": "pages/mine/mobile", + "style": { + "navigationBarTitleText": "修改手机号", + "navigationBarBackgroundColor": "#fff" + } + }, + { + "path" : "pages/protocol/protocol", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/wallet/zhaun", + "style" : + { + "navigationBarTitleText" : "余额划转" + } + } + ], + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "uni-app", + "navigationBarBackgroundColor": "#F8F8F8", + "backgroundColor": "#F8F8F8", + "app-plus": { + "background": "#efeff4" + } + }, + "tabBar": { + "color": "#AAA", + "selectedColor": "#516E41", + "borderStyle": "black", + "backgroundColor": "#ffffff", + // "height": "60px", + "fontSize": "16px", + "list": [{ + "iconPath": "static/tabbar/home.png", + "selectedIconPath": "static/tabbar/homes.png", + "pagePath": "pages/index/index", + "text": "首页" + }, { + "iconPath": "static/tabbar/cate.png", + "selectedIconPath": "static/tabbar/cates.png", + "pagePath": "pages/cate/cate", + "text": "分类" + }, { + "iconPath": "static/tabbar/order.png", + "selectedIconPath": "static/tabbar/orders.png", + "pagePath": "pages/order/order", + "text": "订单" + }, { + "iconPath": "static/tabbar/mine.png", + "selectedIconPath": "static/tabbar/mines.png", + "pagePath": "pages/mine/mine", + "text": "我的" + }] + } +} \ No newline at end of file diff --git a/pages/address/add.vue b/pages/address/add.vue new file mode 100644 index 0000000..9592aa6 --- /dev/null +++ b/pages/address/add.vue @@ -0,0 +1,252 @@ + + + + + diff --git a/pages/address/list.vue b/pages/address/list.vue new file mode 100644 index 0000000..e81fe9d --- /dev/null +++ b/pages/address/list.vue @@ -0,0 +1,267 @@ + + + + + diff --git a/pages/cate/cate.vue b/pages/cate/cate.vue new file mode 100644 index 0000000..9fbe65e --- /dev/null +++ b/pages/cate/cate.vue @@ -0,0 +1,290 @@ + + + + + diff --git a/pages/equity/equity.vue b/pages/equity/equity.vue new file mode 100644 index 0000000..0f1d71c --- /dev/null +++ b/pages/equity/equity.vue @@ -0,0 +1,207 @@ + + + + + diff --git a/pages/goods/goods.vue b/pages/goods/goods.vue new file mode 100644 index 0000000..e45f8f5 --- /dev/null +++ b/pages/goods/goods.vue @@ -0,0 +1,191 @@ + + + + + diff --git a/pages/goods/prefecture.vue b/pages/goods/prefecture.vue new file mode 100644 index 0000000..4b4e65d --- /dev/null +++ b/pages/goods/prefecture.vue @@ -0,0 +1,126 @@ + + + + + diff --git a/pages/index/index.vue b/pages/index/index.vue new file mode 100644 index 0000000..6b671aa --- /dev/null +++ b/pages/index/index.vue @@ -0,0 +1,293 @@ + + + + + diff --git a/pages/login/login.vue b/pages/login/login.vue new file mode 100644 index 0000000..25eac71 --- /dev/null +++ b/pages/login/login.vue @@ -0,0 +1,502 @@ + + + + + diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue new file mode 100644 index 0000000..477c6a1 --- /dev/null +++ b/pages/mine/mine.vue @@ -0,0 +1,522 @@ + + + + + diff --git a/pages/mine/mobile.vue b/pages/mine/mobile.vue new file mode 100644 index 0000000..bdb8346 --- /dev/null +++ b/pages/mine/mobile.vue @@ -0,0 +1,246 @@ + + + + + diff --git a/pages/mine/sett.vue b/pages/mine/sett.vue new file mode 100644 index 0000000..a40816f --- /dev/null +++ b/pages/mine/sett.vue @@ -0,0 +1,274 @@ + + + + + diff --git a/pages/notice/details.vue b/pages/notice/details.vue new file mode 100644 index 0000000..c246004 --- /dev/null +++ b/pages/notice/details.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/pages/notice/notice.vue b/pages/notice/notice.vue new file mode 100644 index 0000000..db7da38 --- /dev/null +++ b/pages/notice/notice.vue @@ -0,0 +1,138 @@ + + + + + diff --git a/pages/order/confirm - 副本.vue b/pages/order/confirm - 副本.vue new file mode 100644 index 0000000..892e21d --- /dev/null +++ b/pages/order/confirm - 副本.vue @@ -0,0 +1,536 @@ + + + + diff --git a/pages/order/confirm.vue b/pages/order/confirm.vue new file mode 100644 index 0000000..9bb3f54 --- /dev/null +++ b/pages/order/confirm.vue @@ -0,0 +1,501 @@ + + + + + diff --git a/pages/order/order.vue b/pages/order/order.vue new file mode 100644 index 0000000..65e5c37 --- /dev/null +++ b/pages/order/order.vue @@ -0,0 +1,344 @@ + + + + + diff --git a/pages/order/success.vue b/pages/order/success.vue new file mode 100644 index 0000000..05eaac6 --- /dev/null +++ b/pages/order/success.vue @@ -0,0 +1,286 @@ + + + diff --git a/pages/protocol/protocol.vue b/pages/protocol/protocol.vue new file mode 100644 index 0000000..8183fd0 --- /dev/null +++ b/pages/protocol/protocol.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/pages/team/team.vue b/pages/team/team.vue new file mode 100644 index 0000000..c7a0047 --- /dev/null +++ b/pages/team/team.vue @@ -0,0 +1,225 @@ + + + + diff --git a/pages/wallet/list.vue b/pages/wallet/list.vue new file mode 100644 index 0000000..5fe3f3f --- /dev/null +++ b/pages/wallet/list.vue @@ -0,0 +1,124 @@ + + + + + diff --git a/pages/wallet/wallet.vue b/pages/wallet/wallet.vue new file mode 100644 index 0000000..0643b45 --- /dev/null +++ b/pages/wallet/wallet.vue @@ -0,0 +1,329 @@ + + + + + diff --git a/pages/wallet/zhaun.vue b/pages/wallet/zhaun.vue new file mode 100644 index 0000000..b4bf2d2 --- /dev/null +++ b/pages/wallet/zhaun.vue @@ -0,0 +1,180 @@ + + + + + diff --git a/static/customicons.css b/static/customicons.css new file mode 100644 index 0000000..14ed5fa --- /dev/null +++ b/static/customicons.css @@ -0,0 +1,20 @@ +@font-face { + font-family: "customicons"; /* Project id 2878519 */ + src:url('/static/customicons.ttf') format('truetype'); +} + +.customicons { + font-family: "customicons" !important; +} + +.youxi:before { + content: "\e60e"; +} + +.wenjian:before { + content: "\e60f"; +} + +.zhuanfa:before { + content: "\e610"; +} diff --git a/static/customicons.ttf b/static/customicons.ttf new file mode 100644 index 0000000..a3c8ab9 Binary files /dev/null and b/static/customicons.ttf differ diff --git a/static/equity/bei1.png b/static/equity/bei1.png new file mode 100644 index 0000000..dc40a6e Binary files /dev/null and b/static/equity/bei1.png differ diff --git a/static/equity/bei2.png b/static/equity/bei2.png new file mode 100644 index 0000000..3630e5c Binary files /dev/null and b/static/equity/bei2.png differ diff --git a/static/equity/bei3.png b/static/equity/bei3.png new file mode 100644 index 0000000..b1145f1 Binary files /dev/null and b/static/equity/bei3.png differ diff --git a/static/equity/icon1.png b/static/equity/icon1.png new file mode 100644 index 0000000..c4da679 Binary files /dev/null and b/static/equity/icon1.png differ diff --git a/static/equity/icon2.png b/static/equity/icon2.png new file mode 100644 index 0000000..bc61e32 Binary files /dev/null and b/static/equity/icon2.png differ diff --git a/static/equity/icon3.png b/static/equity/icon3.png new file mode 100644 index 0000000..a91cc32 Binary files /dev/null and b/static/equity/icon3.png differ diff --git a/static/equity/iconY1.png b/static/equity/iconY1.png new file mode 100644 index 0000000..2ec780f Binary files /dev/null and b/static/equity/iconY1.png differ diff --git a/static/equity/iconY2.png b/static/equity/iconY2.png new file mode 100644 index 0000000..5e265cc Binary files /dev/null and b/static/equity/iconY2.png differ diff --git a/static/equity/iconY3.png b/static/equity/iconY3.png new file mode 100644 index 0000000..a6cfb96 Binary files /dev/null and b/static/equity/iconY3.png differ diff --git a/static/equity/img1.png b/static/equity/img1.png new file mode 100644 index 0000000..3fe92f1 Binary files /dev/null and b/static/equity/img1.png differ diff --git a/static/equity/img2.png b/static/equity/img2.png new file mode 100644 index 0000000..8b974c0 Binary files /dev/null and b/static/equity/img2.png differ diff --git a/static/equity/img3.png b/static/equity/img3.png new file mode 100644 index 0000000..e2d1ecb Binary files /dev/null and b/static/equity/img3.png differ diff --git a/static/equity/s1.png b/static/equity/s1.png new file mode 100644 index 0000000..5b05669 Binary files /dev/null and b/static/equity/s1.png differ diff --git a/static/equity/s2.png b/static/equity/s2.png new file mode 100644 index 0000000..b7616c3 Binary files /dev/null and b/static/equity/s2.png differ diff --git a/static/equity/s3.png b/static/equity/s3.png new file mode 100644 index 0000000..009e0cb Binary files /dev/null and b/static/equity/s3.png differ diff --git a/static/equityBei.png b/static/equityBei.png new file mode 100644 index 0000000..3ed4bc0 Binary files /dev/null and b/static/equityBei.png differ diff --git a/static/equity_pack.png b/static/equity_pack.png new file mode 100644 index 0000000..1a28ee1 Binary files /dev/null and b/static/equity_pack.png differ diff --git a/static/homeBanner.png b/static/homeBanner.png new file mode 100644 index 0000000..a6ff2c0 Binary files /dev/null and b/static/homeBanner.png differ diff --git a/static/homeY.png b/static/homeY.png new file mode 100644 index 0000000..ee0926d Binary files /dev/null and b/static/homeY.png differ diff --git a/static/hui.png b/static/hui.png new file mode 100644 index 0000000..5273e33 Binary files /dev/null and b/static/hui.png differ diff --git a/static/icons/address.png b/static/icons/address.png new file mode 100644 index 0000000..3f1b797 Binary files /dev/null and b/static/icons/address.png differ diff --git a/static/icons/cancelled.png b/static/icons/cancelled.png new file mode 100644 index 0000000..38730f0 Binary files /dev/null and b/static/icons/cancelled.png differ diff --git a/static/icons/cha.png b/static/icons/cha.png new file mode 100644 index 0000000..b00916b Binary files /dev/null and b/static/icons/cha.png differ diff --git a/static/icons/code.png b/static/icons/code.png new file mode 100644 index 0000000..0cbc5ca Binary files /dev/null and b/static/icons/code.png differ diff --git a/static/icons/finished.png b/static/icons/finished.png new file mode 100644 index 0000000..abd10c1 Binary files /dev/null and b/static/icons/finished.png differ diff --git a/static/icons/fx.png b/static/icons/fx.png new file mode 100644 index 0000000..b9fe8e4 Binary files /dev/null and b/static/icons/fx.png differ diff --git a/static/icons/goodkf.png b/static/icons/goodkf.png new file mode 100644 index 0000000..f4b9f54 Binary files /dev/null and b/static/icons/goodkf.png differ diff --git a/static/icons/gou.png b/static/icons/gou.png new file mode 100644 index 0000000..9f3286d Binary files /dev/null and b/static/icons/gou.png differ diff --git a/static/icons/huazhuan.png b/static/icons/huazhuan.png new file mode 100644 index 0000000..7e73e5c Binary files /dev/null and b/static/icons/huazhuan.png differ diff --git a/static/icons/info.png b/static/icons/info.png new file mode 100644 index 0000000..9521b4b Binary files /dev/null and b/static/icons/info.png differ diff --git a/static/icons/kf.png b/static/icons/kf.png new file mode 100644 index 0000000..05ea39e Binary files /dev/null and b/static/icons/kf.png differ diff --git a/static/icons/money.png b/static/icons/money.png new file mode 100644 index 0000000..85f5c2e Binary files /dev/null and b/static/icons/money.png differ diff --git a/static/icons/pre-order.png b/static/icons/pre-order.png new file mode 100644 index 0000000..7469af1 Binary files /dev/null and b/static/icons/pre-order.png differ diff --git a/static/icons/tj.png b/static/icons/tj.png new file mode 100644 index 0000000..d0e2a7d Binary files /dev/null and b/static/icons/tj.png differ diff --git a/static/icons/tjr.png b/static/icons/tjr.png new file mode 100644 index 0000000..31c16b1 Binary files /dev/null and b/static/icons/tjr.png differ diff --git a/static/icons/wait-pay.png b/static/icons/wait-pay.png new file mode 100644 index 0000000..7ed5974 Binary files /dev/null and b/static/icons/wait-pay.png differ diff --git a/static/icons/wen.png b/static/icons/wen.png new file mode 100644 index 0000000..0d24bf8 Binary files /dev/null and b/static/icons/wen.png differ diff --git a/static/icons/xia.png b/static/icons/xia.png new file mode 100644 index 0000000..bae5e38 Binary files /dev/null and b/static/icons/xia.png differ diff --git a/static/icons/yan.png b/static/icons/yan.png new file mode 100644 index 0000000..fad909d Binary files /dev/null and b/static/icons/yan.png differ diff --git a/static/icons/yans.png b/static/icons/yans.png new file mode 100644 index 0000000..0b79735 Binary files /dev/null and b/static/icons/yans.png differ diff --git a/static/icons/youh.png b/static/icons/youh.png new file mode 100644 index 0000000..67a28ae Binary files /dev/null and b/static/icons/youh.png differ diff --git a/static/icons/yue.png b/static/icons/yue.png new file mode 100644 index 0000000..3e4f259 Binary files /dev/null and b/static/icons/yue.png differ diff --git a/static/icons/zhangdan.png b/static/icons/zhangdan.png new file mode 100644 index 0000000..e771393 Binary files /dev/null and b/static/icons/zhangdan.png differ diff --git a/static/login.png b/static/login.png new file mode 100644 index 0000000..1a276ab Binary files /dev/null and b/static/login.png differ diff --git a/static/logo.png b/static/logo.png new file mode 100644 index 0000000..02be206 Binary files /dev/null and b/static/logo.png differ diff --git a/static/mineBanner.png b/static/mineBanner.png new file mode 100644 index 0000000..caf8b0b Binary files /dev/null and b/static/mineBanner.png differ diff --git a/static/qianBeiAs.png b/static/qianBeiAs.png new file mode 100644 index 0000000..e63b521 Binary files /dev/null and b/static/qianBeiAs.png differ diff --git a/static/qianbaoBei.png b/static/qianbaoBei.png new file mode 100644 index 0000000..42afad7 Binary files /dev/null and b/static/qianbaoBei.png differ diff --git a/static/settbie.png b/static/settbie.png new file mode 100644 index 0000000..d91c312 Binary files /dev/null and b/static/settbie.png differ diff --git a/static/tabbar/cate.png b/static/tabbar/cate.png new file mode 100644 index 0000000..67018cc Binary files /dev/null and b/static/tabbar/cate.png differ diff --git a/static/tabbar/cates.png b/static/tabbar/cates.png new file mode 100644 index 0000000..8a6bb71 Binary files /dev/null and b/static/tabbar/cates.png differ diff --git a/static/tabbar/home.png b/static/tabbar/home.png new file mode 100644 index 0000000..d35e153 Binary files /dev/null and b/static/tabbar/home.png differ diff --git a/static/tabbar/homes.png b/static/tabbar/homes.png new file mode 100644 index 0000000..8cbb09f Binary files /dev/null and b/static/tabbar/homes.png differ diff --git a/static/tabbar/mine.png b/static/tabbar/mine.png new file mode 100644 index 0000000..02a19e1 Binary files /dev/null and b/static/tabbar/mine.png differ diff --git a/static/tabbar/mines.png b/static/tabbar/mines.png new file mode 100644 index 0000000..e350454 Binary files /dev/null and b/static/tabbar/mines.png differ diff --git a/static/tabbar/order.png b/static/tabbar/order.png new file mode 100644 index 0000000..f3cab36 Binary files /dev/null and b/static/tabbar/order.png differ diff --git a/static/tabbar/orders.png b/static/tabbar/orders.png new file mode 100644 index 0000000..1916c90 Binary files /dev/null and b/static/tabbar/orders.png differ diff --git a/static/team.png b/static/team.png new file mode 100644 index 0000000..90622b7 Binary files /dev/null and b/static/team.png differ diff --git a/static/warn.png b/static/warn.png new file mode 100644 index 0000000..498f9dc Binary files /dev/null and b/static/warn.png differ diff --git a/static/y.png b/static/y.png new file mode 100644 index 0000000..0a5faa9 Binary files /dev/null and b/static/y.png differ diff --git a/static/yao.png b/static/yao.png new file mode 100644 index 0000000..7553424 Binary files /dev/null and b/static/yao.png differ diff --git a/store/index.ts b/store/index.ts new file mode 100644 index 0000000..ddf0c23 --- /dev/null +++ b/store/index.ts @@ -0,0 +1,135 @@ +import api from '@/api' +import { defineStore } from 'pinia' + +export const Store = defineStore('counter', { + state: () => { + return { + userId: '', + userInfo: { + inviteCode: '', + nickname: '', + mobile: '', + avatar: '', + puser: null, + paywallet: { + balance: 0 + }, + userRights: null + }, // 用户信息 + tem_list: [], // 临时列表(支持其他页面对该列表数据的更新) + set_title: '', // 设置页面标题 + set_options: [], // 设置详细参数 + set_end_function: () => { } // 设置页面结束后执行的方法 + } + }, + actions: { + setUserId(_id) { + this.userId = _id + }, + // 设置临时列表 + setTemList(list = []) { + this['tem_list'] = list + }, + // 移除临时列表的某一项 + removeTemList(_id) { + if (!_id || this['tem_list'].length === 0) return + let _index = this['tem_list'].findIndex(item => item._id === _id) + this['tem_list'].splice(_index, 1) + }, + // 更新临时列表 + updateTemList(_id, key, val) { + if (!_id || !key || this['tem_list'].length === 0) return + let _index = this['tem_list'].findIndex(item => item._id === _id) + let obj = this['tem_list'][_index] + obj[key] = val + this['tem_list'].splice(_index, 1, obj) + }, + // 设置参数 + setOptions({ set_title, set_options, set_end_function }) { + if (!set_title) { + set_title = '设置' + } + // 不存在时使用示例参数 + if (!set_options || set_options.length === 0) { + set_options = [ + // 输入框 + { + type: 'input', + list: [ + { title: 'Breathe的主题配置一', value: '', type: 'text' }, + ] + }, + // 开关 + { + type: 'switch', + list: [ + { title: '自动(跟随系统)', value: false }, + ] + }, + // 选择 + { + type: 'select', + tip: '选择主题并应用到程序选择主题并应用到程序选择主题并应用到程序选择主题并应用到程序。', + list: [ + { title: '默认', value: true }, + { title: '暗黑', value: false }, + { title: '激光红', value: false }, + { title: '天空蓝', value: false }, + ] + }, + ] + } + if (!set_end_function) { + set_end_function = (e) => { + console.log(`------->默认的set_end_function,e:`, e); + } + } + this['set_title'] = set_title + this['set_options'] = set_options + this['set_end_function'] = set_end_function + const { type, path } = set_options[0] + // 如果是希望去动态列表选择内容 就跳转到指定页面 + if (set_options.length === 1 && type === 'select-list') return uni.navigateTo({ url: path }) + uni.navigateTo({ url: '/pages-system/set/set-options' }) + }, + // 同步本地数据 + async syncStore() { }, + // 获取用户信息 + + async logoutUser() { + this['userInfo'] = { + inviteCode: '', + nickname: '', + mobile: '', + avatar: '', + paywallet: { + balance: 0 + } + } + + uni.clearStorage({ + success() { + uni.switchTab({ + url: '/pages/index/index' + }); + }, + fail(err) { + console.error('清除缓存失败', err); + } + }) + + + }, + async usersGetInfo() { + try { + let _res = {} + // 获取用户信息 + _res = await api.usersGetInfo() + console.log(_res); + this['userInfo'] = _res + } catch (e) { + throw (e) + } + } + }, +}) \ No newline at end of file diff --git a/types/users.d.ts b/types/users.d.ts new file mode 100644 index 0000000..cea5e2b --- /dev/null +++ b/types/users.d.ts @@ -0,0 +1,7 @@ +export type loginInfoType = { + mobile ?: string + password ?: string + code ?: string + tenantId ?: number + inviteCode ?: string +} diff --git a/uni.scss b/uni.scss new file mode 100644 index 0000000..8ac9801 --- /dev/null +++ b/uni.scss @@ -0,0 +1,2 @@ +@import '@/uni_modules/uni-scss/variables.scss'; + diff --git a/uni_modules/mp-html/README.md b/uni_modules/mp-html/README.md new file mode 100644 index 0000000..cf9ba73 --- /dev/null +++ b/uni_modules/mp-html/README.md @@ -0,0 +1,192 @@ +## 为减小组件包的大小,默认组件包中不包含编辑、latex 公式等扩展功能,需要使用扩展功能的请参考下方的 插件扩展 栏的说明 + +## 功能介绍 +- 全端支持(含 `v3、NVUE`) +- 支持丰富的标签(包括 `table`、`video`、`svg` 等) +- 支持丰富的事件效果(自动预览图片、链接处理等) +- 支持设置占位图(加载中、出错时、预览时) +- 支持锚点跳转、长按复制等丰富功能 +- 支持大部分 *html* 实体 +- 丰富的插件(关键词搜索、内容编辑、`latex` 公式等) +- 效率高、容错性强且轻量化 + +查看 [功能介绍](https://jin-yufeng.github.io/mp-html/#/overview/feature) 了解更多 + +## 使用方法 +- `uni_modules` 方式 + 1. 点击右上角的 `使用 HBuilder X 导入插件` 按钮直接导入项目或点击 `下载插件 ZIP` 按钮下载插件包并解压到项目的 `uni_modules/mp-html` 目录下 + 2. 在需要使用页面的 `(n)vue` 文件中添加 + ```html + + + ``` + ```javascript + export default { + data() { + return { + html: '
Hello World!
' + } + } + } + ``` + 3. 需要更新版本时在 `HBuilder X` 中右键 `uni_modules/mp-html` 目录选择 `从插件市场更新` 即可 + +- 源码方式 + 1. 从 [github](https://github.com/jin-yufeng/mp-html/tree/master/dist/uni-app) 或 [gitee](https://gitee.com/jin-yufeng/mp-html/tree/master/dist/uni-app) 下载源码 + 插件市场的 **非 uni_modules 版本** 无法更新,不建议从插件市场获取 + 2. 在需要使用页面的 `(n)vue` 文件中添加 + ```html + + ``` + ```javascript + import mpHtml from '@/components/mp-html/mp-html' + export default { + // HBuilderX 2.5.5+ 可以通过 easycom 自动引入 + components: { + mpHtml + }, + data() { + return { + html: '
Hello World!
' + } + } + } + ``` + +- npm 方式 + 1. 在项目根目录下执行 + ```bash + npm install mp-html + ``` + 2. 在需要使用页面的 `(n)vue` 文件中添加 + ```html + + ``` + ```javascript + import mpHtml from 'mp-html/dist/uni-app/components/mp-html/mp-html' + export default { + // 不可省略 + components: { + mpHtml + }, + data() { + return { + html: '
Hello World!
' + } + } + } + ``` + 3. 需要更新版本时执行以下命令即可 + ```bash + npm update mp-html + ``` + + 使用 *cli* 方式运行的项目,通过 *npm* 方式引入时,需要在 *vue.config.js* 中配置 *transpileDependencies*,详情可见 [#330](https://github.com/jin-yufeng/mp-html/issues/330#issuecomment-913617687) + 如果在 **nvue** 中使用还要将 `dist/uni-app/static` 目录下的内容拷贝到项目的 `static` 目录下,否则无法运行 + +查看 [快速开始](https://jin-yufeng.github.io/mp-html/#/overview/quickstart) 了解更多 + +## 组件属性 + +| 属性 | 类型 | 默认值 | 说明 | +|:---:|:---:|:---:|---| +| container-style | String | | 容器的样式([2.1.0+](https://jin-yufeng.github.io/mp-html/#/changelog/changelog#v210)) | +| content | String | | 用于渲染的 html 字符串 | +| copy-link | Boolean | true | 是否允许外部链接被点击时自动复制 | +| domain | String | | 主域名(用于链接拼接) | +| error-img | String | | 图片出错时的占位图链接 | +| lazy-load | Boolean | false | 是否开启图片懒加载 | +| loading-img | String | | 图片加载过程中的占位图链接 | +| pause-video | Boolean | true | 是否在播放一个视频时自动暂停其他视频 | +| preview-img | Boolean | true | 是否允许图片被点击时自动预览 | +| scroll-table | Boolean | false | 是否给每个表格添加一个滚动层使其能单独横向滚动 | +| selectable | Boolean | false | 是否开启文本长按复制 | +| set-title | Boolean | true | 是否将 title 标签的内容设置到页面标题 | +| show-img-menu | Boolean | true | 是否允许图片被长按时显示菜单 | +| tag-style | Object | | 设置标签的默认样式 | +| use-anchor | Boolean | false | 是否使用锚点链接 | + +查看 [属性](https://jin-yufeng.github.io/mp-html/#/basic/prop) 了解更多 + +## 组件事件 + +| 名称 | 触发时机 | +|:---:|---| +| load | dom 树加载完毕时 | +| ready | 图片加载完毕时 | +| error | 发生渲染错误时 | +| imgtap | 图片被点击时 | +| linktap | 链接被点击时 | +| play | 音视频播放时 | + +查看 [事件](https://jin-yufeng.github.io/mp-html/#/basic/event) 了解更多 + +## api +组件实例上提供了一些 `api` 方法可供调用 + +| 名称 | 作用 | +|:---:|---| +| in | 将锚点跳转的范围限定在一个 scroll-view 内 | +| navigateTo | 锚点跳转 | +| getText | 获取文本内容 | +| getRect | 获取富文本内容的位置和大小 | +| setContent | 设置富文本内容 | +| imgList | 获取所有图片的数组 | +| pauseMedia | 暂停播放音视频([2.2.2+](https://jin-yufeng.github.io/mp-html/#/changelog/changelog#v222)) | +| setPlaybackRate | 设置音视频播放速率([2.4.0+](https://jin-yufeng.github.io/mp-html/#/changelog/changelog#v240)) | + +查看 [api](https://jin-yufeng.github.io/mp-html/#/advanced/api) 了解更多 + +## 插件扩展 +除基本功能外,本组件还提供了丰富的扩展,可按照需要选用 + +| 名称 | 作用 | +|:---:|---| +| audio | 音乐播放器 | +| editable | 富文本 **编辑**([示例项目](https://mp-html.oss-cn-hangzhou.aliyuncs.com/editable.zip)) | +| emoji | 解析 emoji | +| highlight | 代码块高亮显示 | +| markdown | 渲染 markdown | +| search | 关键词搜索 | +| style | 匹配 style 标签中的样式 | +| txv-video | 使用腾讯视频 | +| img-cache | 图片缓存 by [@PentaTea](https://github.com/PentaTea) | +| latex | 渲染 latex 公式 by [@Zeng-J](https://github.com/Zeng-J) | + +从插件市场导入的包中 **不含有** 扩展插件,使用插件需通过微信小程序 `富文本插件` 获取或参考以下方法进行打包: +1. 获取完整组件包 + ```bash + npm install mp-html + ``` +2. 编辑 `tools/config.js` 中的 `plugins` 项,选择需要的插件 +3. 生成新的组件包 + 在 `node_modules/mp-html` 目录下执行 + ```bash + npm install + npm run build:uni-app + ``` +4. 拷贝 `dist/uni-app` 中的内容到项目根目录 + +查看 [插件](https://jin-yufeng.github.io/mp-html/#/advanced/plugin) 了解更多 + +## 关于 nvue +`nvue` 使用原生渲染,不支持部分 `css` 样式,为实现和 `html` 相同的效果,组件内部通过 `web-view` 进行渲染,性能上差于原生,根据 `weex` 官方建议,`web` 标签仅应用在非常规的降级场景。因此,如果通过原生的方式(如 `richtext`)能够满足需要,则不建议使用本组件,如果有较多的富文本内容,则可以直接使用 `vue` 页面 +由于渲染方式与其他端不同,有以下限制: +1. 不支持 `lazy-load` 属性 +2. 视频不支持全屏播放 +3. 如果在 `flex-direction: row` 的容器中使用,需要给组件设置宽度或设置 `flex: 1` 占满剩余宽度 + +纯 `nvue` 模式下,[此问题](https://ask.dcloud.net.cn/question/119678) 修复前,不支持通过 `uni_modules` 引入,需要本地引入(将 [dist/uni-app](https://github.com/jin-yufeng/mp-html/tree/master/dist/uni-app) 中的内容拷贝到项目根目录下) + + +## 问题反馈 +遇到问题时,请先查阅 [常见问题](https://jin-yufeng.github.io/mp-html/#/question/faq) 和 [issue](https://github.com/jin-yufeng/mp-html/issues) 中是否已有相同的问题 +可通过 [issue](https://github.com/jin-yufeng/mp-html/issues/new/choose) 、插件问答或发送邮件到 [mp_html@126.com](mailto:mp_html@126.com) 提问,不建议在评论区提问(不方便回复) +提问请严格按照 [issue 模板](https://github.com/jin-yufeng/mp-html/issues/new/choose) ,描述清楚使用环境、`html` 内容或可复现的 `demo` 项目以及复现方式,对于 **描述不清**、**无法复现** 或重复的问题将不予回复 + +欢迎加入 `QQ` 交流群: +群1(已满):`699734691` +群2(已满):`778239129` +群3:`960265313` + +查看 [问题反馈](https://jin-yufeng.github.io/mp-html/#/question/feedback) 了解更多 diff --git a/uni_modules/mp-html/changelog.md b/uni_modules/mp-html/changelog.md new file mode 100644 index 0000000..ebb557a --- /dev/null +++ b/uni_modules/mp-html/changelog.md @@ -0,0 +1,156 @@ +## v2.5.1(2025-04-20) +1. `U` 适配鸿蒙 `APP` [详细](https://github.com/jin-yufeng/mp-html/issues/615) +2. `U` 微信小程序替换废弃 `api` `getSystemInfoSync` [详细](https://github.com/jin-yufeng/mp-html/issues/613) +3. `F` 修复了 `app` 端播放视频可能报错的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/617) +4. `F` 修复了 `latex` 插件可能出现 `xxx can be used only in display mode` 的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/632) +5. `F` 修复了 `uni-app` 包 `latex` 公式可能不显示的问题 [#599](https://github.com/jin-yufeng/mp-html/issues/599)、[#627](https://github.com/jin-yufeng/mp-html/issues/627) +## v2.5.0(2024-04-22) +1. `U` `play` 事件增加返回 `src` 等信息 [详细](https://github.com/jin-yufeng/mp-html/issues/526) +2. `U` `preview-img` 属性支持设置为 `all` 开启 `base64` 图片预览 [详细](https://github.com/jin-yufeng/mp-html/issues/536) +3. `U` `editable` 插件增加简易模式(点击文字直接编辑) +4. `U` `latex` 插件支持块级公式 [详细](https://github.com/jin-yufeng/mp-html/issues/582) +5. `F` 修复了表格部分情况下背景丢失的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/587) +6. `F` 修复了部分 `svg` 无法显示的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/591) +7. `F` 修复了 `h5` 和 `app` 端部分情况下样式无法识别的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/518) +8. `F` 修复了 `latex` 插件部分情况下显示不正确的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/580) +9. `F` 修复了 `editable` 插件表格无法删除的问题 +10. `F` 修复了 `editable` 插件 `vue3` `h5` 端点击图片报错的问题 +11. `F` 修复了 `editable` 插件点击表格没有菜单栏的问题 +## v2.4.3(2024-01-21) +1. `A` 增加 [card](https://jin-yufeng.gitee.io/mp-html/#/advanced/plugin#card) 插件 [详细](https://github.com/jin-yufeng/mp-html/pull/533) by [@whoooami](https://github.com/whoooami) +2. `F` 修复了 `svg` 中包含 `foreignobject` 可能不显示的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/523) +3. `F` 修复了合并单元格的表格部分情况下显示不正确的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/561) +4. `F` 修复了 `img` 标签设置 `object-fit` 无效的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/567) +5. `F` 修复了 `latex` 插件公式会换行的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/540) +6. `F` 修复了 `editable` 和 `audio` 插件共用时点击 `audio` 无法编辑的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/529) by [@whoooami](https://github.com/whoooami) +7. `F` 修复了微信小程序部分情况下图片会报错 `replace of undefined` 的问题 +8. `F` 修复了快手小程序图片不显示的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/571) +## v2.4.2(2023-05-14) +1. `A` `editable` 插件支持修改文字颜色 [详细](https://github.com/jin-yufeng/mp-html/issues/254) +2. `F` 修复了 `svg` 中有 `style` 不生效的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/505) +3. `F` 修复了使用旧版编译器可能报错 `Bad attr nodes` 的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/472) +4. `F` 修复了 `app` 端可能出现无法读取 `lazyLoad` 的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/513) +5. `F` 修复了 `editable` 插件在点击换图时未拼接 `domain` 的问题 [详细](https://github.com/jin-yufeng/mp-html/pull/497) by [@TwoKe945](https://github.com/TwoKe945) +6. `F` 修复了 `latex` 插件部分情况下不显示的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/515) +7. `F` 修复了 `editable` 插件点击音视频时其他标签框不消失的问题 +## v2.4.1(2022-12-25) +1. `F` 修复了没有图片时 `ready` 事件可能不触发的问题 +2. `F` 修复了加载过程中可能出现 `Root label not found` 错误的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/470) +3. `F` 修复了 `audio` 插件退出页面可能会报错的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/457) +4. `F` 修复了 `vue3` 运行到 `app` 在 `HBuilder X 3.6.10` 以上报错的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/480) +5. `F` 修复了 `nvue` 端链接中包含 `%22` 时可能无法显示的问题 +6. `F` 修复了 `vue3` 使用 `highlight` 插件可能报错的问题 +## v2.4.0(2022-08-27) +1. `A` 增加了 [setPlaybackRate](https://jin-yufeng.gitee.io/mp-html/#/advanced/api#setPlaybackRate) 的 `api`,可以设置音视频的播放速率 [详细](https://github.com/jin-yufeng/mp-html/issues/452) +2. `A` 示例小程序代码开源 [详细](https://github.com/jin-yufeng/mp-html-demo) +3. `U` 优化 `ready` 事件触发时机,未设置懒加载的情况下基本可以准确触发 [详细](https://github.com/jin-yufeng/mp-html/issues/195) +4. `U` `highlight` 插件在编辑状态下不进行高亮处理,便于编辑 +5. `F` 修复了 `flex` 布局下图片大小可能不正确的问题 +6. `F` 修复了 `selectable` 属性没有设置 `force` 也可能出现渲染异常的问题 +7. `F` 修复了表格中的图片大小可能不正确的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/448) +8. `F` 修复了含有合并单元格的表格可能无法设置竖直对齐的问题 +9. `F` 修复了 `editable` 插件在 `scroll-view` 中使用时工具条位置可能不正确的问题 +10. `F` 修复了 `vue3` 使用 [search](advanced/plugin#search) 插件可能导致错误换行的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/449) +## v2.3.2(2022-08-13) +1. `A` 增加 [latex](https://jin-yufeng.gitee.io/mp-html/#/advanced/plugin#latex) 插件,可以渲染数学公式 [详细](https://github.com/jin-yufeng/mp-html/pull/447) by [@Zeng-J](https://github.com/Zeng-J) +2. `U` 优化根节点下有很多标签的长内容渲染速度 +3. `U` `highlight` 插件适配 `lang-xxx` 格式 +4. `F` 修复了 `table` 标签设置 `border` 属性后可能无法修改边框样式的问题 [详细](https://github.com/jin-yufeng/mp-html/pull/439) by [@zouxingjie](https://github.com/zouxingjie) +5. `F` 修复了 `editable` 插件输入连续空格无效的问题 +6. `F` 修复了 `vue3` 图片设置 `inline` 会报错的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/438) +7. `F` 修复了 `vue3` 使用 `table` 可能报错的问题 +## v2.3.1(2022-05-20) +1. `U` `app` 端支持使用本地图片 +2. `U` 优化了微信小程序 `selectable` 属性在 `ios` 端的处理 [详细](https://jin-yufeng.gitee.io/mp-html/#/basic/prop#selectable) +3. `F` 修复了 `editable` 插件不在顶部时 `tooltip` 位置可能错误的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/430) +4. `F` 修复了 `vue3` 运行到微信小程序可能报错丢失内容的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/414) +5. `F` 修复了 `vue3` 部分标签可能被错误换行的问题 +6. `F` 修复了 `editable` 插件 `app` 端插入视频无法预览的问题 +## v2.3.0(2022-04-01) +1. `A` 增加了 `play` 事件,音视频播放时触发,可用于与页面其他音视频进行互斥播放 [详细](basic/event#play) +2. `U` `show-img-menu` 属性支持控制预览时是否长按弹出菜单 +3. `U` 优化 `wxs` 处理,提高渲染性能 [详细](https://developers.weixin.qq.com/community/develop/article/doc/0006cc2b204740f601bd43fa25a413) +4. `U` `video` 标签支持 `object-fit` 属性 +5. `U` 增加支持一些常用实体编码 [详细](https://github.com/jin-yufeng/mp-html/issues/418) +6. `F` 修复了图片仅设置高度可能不显示的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/410) +7. `F` 修复了 `video` 标签高度设置为 `auto` 不显示的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/411) +8. `F` 修复了使用 `grid` 布局时可能样式错误的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/413) +9. `F` 修复了含有合并单元格的表格部分情况下显示异常的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/417) +10. `F` 修复了 `editable` 插件连续插入内容时顺序不正确的问题 +11. `F` 修复了 `uni-app` 包 `vue3` 使用 `audio` 插件报错的问题 +12. `F` 修复了 `uni-app` 包 `highlight` 插件使用自定义的 `prism.min.js` 报错的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/416) +## v2.2.2(2022-02-26) +1. `A` 增加了 [pauseMedia](https://jin-yufeng.gitee.io/mp-html/#/advanced/api#pauseMedia) 的 `api`,可用于暂停播放音视频 [详细](https://github.com/jin-yufeng/mp-html/issues/317) +2. `U` 优化了长内容的加载速度 +3. `U` 适配 `vue3` [#389](https://github.com/jin-yufeng/mp-html/issues/389)、[#398](https://github.com/jin-yufeng/mp-html/pull/398) by [@zhouhuafei](https://github.com/zhouhuafei)、[#400](https://github.com/jin-yufeng/mp-html/issues/400) +4. `F` 修复了小程序端图片高度设置为百分比时可能不显示的问题 +5. `F` 修复了 `highlight` 插件部分情况下可能显示不完整的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/403) +## v2.2.1(2021-12-24) +1. `A` `editable` 插件增加上下移动标签功能 +2. `U` `editable` 插件支持在文本中间光标处插入内容 +3. `F` 修复了 `nvue` 端设置 `margin` 后可能导致高度不正确的问题 +4. `F` 修复了 `highlight` 插件使用压缩版的 `prism.css` 可能导致背景失效的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/367) +5. `F` 修复了编辑状态下使用 `emoji` 插件内容为空时可能报错的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/371) +6. `F` 修复了使用 `editable` 插件后将 `selectable` 属性设置为 `force` 不生效的问题 +## v2.2.0(2021-10-12) +1. `A` 增加 `customElements` 配置项,便于添加自定义功能性标签 [详细](https://github.com/jin-yufeng/mp-html/issues/350) +2. `A` `editable` 插件增加切换音视频自动播放状态的功能 [详细](https://github.com/jin-yufeng/mp-html/pull/341) by [@leeseett](https://github.com/leeseett) +3. `A` `editable` 插件删除媒体标签时触发 `remove` 事件,便于删除已上传的文件 +4. `U` `editable` 插件 `insertImg` 方法支持同时插入多张图片 [详细](https://github.com/jin-yufeng/mp-html/issues/342) +5. `U` `editable` 插入图片和音视频时支持拼接 `domian` 主域名 +6. `F` 修复了内部链接参数中包含 `://` 时被认为是外部链接的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/356) +7. `F` 修复了部分 `svg` 标签名或属性名大小写不正确时不生效的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/351) +8. `F` 修复了 `nvue` 页面运行到非 `app` 平台时可能样式错误的问题 +## v2.1.5(2021-08-13) +1. `A` 增加支持标签的 `dir` 属性 +2. `F` 修复了 `ruby` 标签文字与拼音没有居中对齐的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/325) +3. `F` 修复了音视频标签内有 `a` 标签时可能无法播放的问题 +4. `F` 修复了 `externStyle` 中的 `class` 名包含下划线或数字时可能失效的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/326) +5. `F` 修复了 `h5` 端引入 `externStyle` 可能不生效的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/326) +## v2.1.4(2021-07-14) +1. `F` 修复了 `rt` 标签无法设置样式的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/318) +2. `F` 修复了表格中有单元格同时合并行和列时可能显示不正确的问题 +3. `F` 修复了 `app` 端无法关闭图片长按菜单的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/322) +4. `F` 修复了 `editable` 插件只能添加图片链接不能修改的问题 [详细](https://github.com/jin-yufeng/mp-html/pull/312) by [@leeseett](https://github.com/leeseett) +## v2.1.3(2021-06-12) +1. `A` `editable` 插件增加 `insertTable` 方法 +2. `U` `editable` 插件支持编辑表格中的空白单元格 [详细](https://github.com/jin-yufeng/mp-html/issues/310) +3. `F` 修复了 `externStyle` 中使用伪类可能失效的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/298) +4. `F` 修复了多个组件同时使用时 `tag-style` 属性时可能互相影响的问题 [详细](https://github.com/jin-yufeng/mp-html/pull/305) by [@woodguoyu](https://github.com/woodguoyu) +5. `F` 修复了包含 `linearGradient` 的 `svg` 可能无法显示的问题 +6. `F` 修复了编译到头条小程序时可能报错的问题 +7. `F` 修复了 `nvue` 端不触发 `click` 事件的问题 +8. `F` 修复了 `editable` 插件尾部插入时无法撤销的问题 +9. `F` 修复了 `editable` 插件的 `insertHtml` 方法只能在末尾插入的问题 +10. `F` 修复了 `editable` 插件插入音频不显示的问题 +## v2.1.2(2021-04-24) +1. `A` 增加了 [img-cache](https://jin-yufeng.gitee.io/mp-html/#/advanced/plugin#img-cache) 插件,可以在 `app` 端缓存图片 [详细](https://github.com/jin-yufeng/mp-html/issues/292) by [@PentaTea](https://github.com/PentaTea) +2. `U` 支持通过 `container-style` 属性设置 `white-space` 来保留连续空格和换行符 [详细](https://jin-yufeng.gitee.io/mp-html/#/question/faq#space) +3. `U` 代码风格符合 [standard](https://standardjs.com) 标准 +4. `U` `editable` 插件编辑状态下支持预览视频 [详细](https://github.com/jin-yufeng/mp-html/issues/286) +5. `F` 修复了 `svg` 标签内嵌 `svg` 时无法显示的问题 +6. `F` 修复了编译到支付宝和头条小程序时部分区域不可复制的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/291) +## v2.1.1(2021-04-09) +1. 修复了对 `p` 标签设置 `tag-style` 可能不生效的问题 +2. 修复了 `svg` 标签中的文本无法显示的问题 +3. 修复了使用 `editable` 插件编辑表格时可能报错的问题 +4. 修复了使用 `highlight` 插件运行到头条小程序时可能没有样式的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/280) +5. 修复了使用 `editable` 插件 `editable` 属性为 `false` 时会报错的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/284) +6. 修复了 `style` 插件连续子选择器失效的问题 +7. 修复了 `editable` 插件无法修改图片和字体大小的问题 +## v2.1.0.2(2021-03-21) +修复了 `nvue` 端使用可能报错的问题 +## v2.1.0(2021-03-20) +1. `A` 增加了 [container-style](https://jin-yufeng.gitee.io/mp-html/#/basic/prop#container-style) 属性 [详细](https://gitee.com/jin-yufeng/mp-html/pulls/1) +2. `A` 增加支持 `strike` 标签 +3. `A` `editable` 插件增加 `placeholder` 属性 [详细](https://jin-yufeng.gitee.io/mp-html/#/advanced/plugin#editable) +4. `A` `editable` 插件增加 `insertHtml` 方法 [详细](https://jin-yufeng.gitee.io/mp-html/#/advanced/plugin#editable) +5. `U` 外部样式支持标签名选择器 [详细](https://jin-yufeng.gitee.io/mp-html/#/overview/quickstart#setting) +6. `F` 修复了 `nvue` 端部分情况下可能不显示的问题 +## v2.0.5(2021-03-12) +1. `U` [linktap](https://jin-yufeng.gitee.io/mp-html/#/basic/event#linktap) 事件增加返回内部文本内容 `innerText` [详细](https://github.com/jin-yufeng/mp-html/issues/271) +2. `U` [selectable](https://jin-yufeng.gitee.io/mp-html/#/basic/prop#selectable) 属性设置为 `force` 时能够在微信 `iOS` 端生效(文本块会变成 `inline-block`) [详细](https://github.com/jin-yufeng/mp-html/issues/267) +3. `F` 修复了部分情况下竖向无法滚动的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/182) +4. `F` 修复了多次修改富文本数据时部分内容可能不显示的问题 +5. `F` 修复了 [腾讯视频](https://jin-yufeng.gitee.io/mp-html/#/advanced/plugin#txv-video) 插件可能无法播放的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/265) +6. `F` 修复了 [highlight](https://jin-yufeng.gitee.io/mp-html/#/advanced/plugin#highlight) 插件没有设置高亮语言时没有应用默认样式的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/276) by [@fuzui](https://github.com/fuzui) diff --git a/uni_modules/mp-html/components/mp-html/mp-html.vue b/uni_modules/mp-html/components/mp-html/mp-html.vue new file mode 100644 index 0000000..796762b --- /dev/null +++ b/uni_modules/mp-html/components/mp-html/mp-html.vue @@ -0,0 +1,498 @@ + + + + + diff --git a/uni_modules/mp-html/components/mp-html/node/node.vue b/uni_modules/mp-html/components/mp-html/node/node.vue new file mode 100644 index 0000000..d3457c5 --- /dev/null +++ b/uni_modules/mp-html/components/mp-html/node/node.vue @@ -0,0 +1,597 @@ +