新增营销系统、分销系统、会员功能、门店、提现功能

This commit is contained in:
Shaw
2024-02-08 21:01:37 +08:00
parent 68b3f2dcc3
commit 17c043348a
1398 changed files with 81279 additions and 56269 deletions

View File

@ -4,10 +4,10 @@
3. 修复改变上传视频宽高不生效的BUG
## 1.0.32023-07-03
去除插槽判断避免某些平台不显示的BUG
## 1.0.22023-05-24
1. 优化fileListwatch中增加deep属性
## 1.0.12023-05-16
1. 优化组件依赖,修改后无需全局引入,组件导入即可使用
2. 优化部分功能
## 1.0.02023-05-10
uv-upload 上传
## 1.0.22023-05-24
1. 优化fileListwatch中增加deep属性
## 1.0.12023-05-16
1. 优化组件依赖,修改后无需全局引入,组件导入即可使用
2. 优化部分功能
## 1.0.02023-05-10
uv-upload 上传

View File

@ -1,52 +1,52 @@
<template>
<uv-popup ref="popup" @change="change">
<view class="video-view" v-if="show">
<video class="video" :src="getSec" :autoplay="autoplay"></video>
</view>
</uv-popup>
</template>
<script>
export default {
props: {
src: {
type: String,
default: ''
},
autoplay: {
type: Boolean,
default: true
}
},
data() {
return {
videoSrc: '',
show: false
}
},
computed: {
getSec() {
return this.src || this.videoSrc;
}
},
methods: {
open(url) {
this.videoSrc = url;
this.$refs.popup.open();
},
close() {
this.$refs.popup.close();
},
change(e) {
this.show = e.show;
}
}
}
</script>
<style scoped lang="scss">
.video-view {
width: 750rpx;
.video {
width: 750rpx;
}
}
<template>
<uv-popup ref="popup" @change="change">
<view class="video-view" v-if="show">
<video class="video" :src="getSec" :autoplay="autoplay"></video>
</view>
</uv-popup>
</template>
<script>
export default {
props: {
src: {
type: String,
default: ''
},
autoplay: {
type: Boolean,
default: true
}
},
data() {
return {
videoSrc: '',
show: false
}
},
computed: {
getSec() {
return this.src || this.videoSrc;
}
},
methods: {
open(url) {
this.videoSrc = url;
this.$refs.popup.open();
},
close() {
this.$refs.popup.close();
},
change(e) {
this.show = e.show;
}
}
}
</script>
<style scoped lang="scss">
.video-view {
width: 750rpx;
.video {
width: 750rpx;
}
}
</style>

View File

@ -1,22 +1,22 @@
import { error } from '@/uni_modules/uv-ui-tools/libs/function/index.js'
export default {
watch: {
// 监听accept的变化判断是否符合个平台要求
// 只有微信小程序才支持选择媒体,文件类型,所以这里做一个判断提示
accept: {
immediate: true,
handler(val) {
// #ifndef MP-WEIXIN
if (val === 'all' || val === 'media') {
error('只有微信小程序才支持把accept配置为all、media之一')
}
// #endif
// #ifndef H5 || MP-WEIXIN
if (val === 'file') {
error('只有微信小程序和H5(HX2.9.9)才支持把accept配置为file')
}
// #endif
}
}
}
}
import { error } from '@/uni_modules/uv-ui-tools/libs/function/index.js'
export default {
watch: {
// 监听accept的变化判断是否符合个平台要求
// 只有微信小程序才支持选择媒体,文件类型,所以这里做一个判断提示
accept: {
immediate: true,
handler(val) {
// #ifndef MP-WEIXIN
if (val === 'all' || val === 'media') {
error('只有微信小程序才支持把accept配置为all、media之一')
}
// #endif
// #ifndef H5 || MP-WEIXIN
if (val === 'file') {
error('只有微信小程序和H5(HX2.9.9)才支持把accept配置为file')
}
// #endif
}
}
}
}

View File

@ -1,130 +1,130 @@
export default {
props: {
// 接受的文件类型, 可选值为all media image file video
accept: {
type: String,
default: 'image'
},
// 图片或视频拾取模式当accept为image类型时设置capture可选额外camera可以直接调起摄像头
capture: {
type: [String, Array],
default: () => ['album', 'camera']
},
// 当accept为video时生效是否压缩视频默认为true
compressed: {
type: Boolean,
default: true
},
// 当accept为video时生效可选值为back或front
camera: {
type: String,
default: 'back'
},
// 当accept为video时生效拍摄视频最长拍摄时间单位秒
maxDuration: {
type: Number,
default: 60
},
// 上传区域的图标,只能内置图标
uploadIcon: {
type: String,
default: 'camera-fill'
},
// 上传区域的图标的颜色,默认
uploadIconColor: {
type: String,
default: '#D3D4D6'
},
// 是否开启文件读取前事件
useBeforeRead: {
type: Boolean,
default: false
},
// 读取后的处理函数
afterRead: {
type: Function,
default: null
},
// 读取前的处理函数
beforeRead: {
type: Function,
default: null
},
// 是否开启图片预览功能
previewFullImage: {
type: Boolean,
default: true
},
// 是否开启视频预览功能
previewFullVideo: {
type: Boolean,
default: true
},
// 最大上传数量
maxCount: {
type: [String, Number],
default: 52
},
// 是否禁用
disabled: {
type: Boolean,
default: false
},
// 预览上传的图片时的裁剪模式和image组件mode属性一致
imageMode: {
type: String,
default: 'aspectFill'
},
// 标识符,可以在回调函数的第二项参数中获取
name: {
type: String,
default: ''
},
// 所选的图片的尺寸, 可选值为original compressed
sizeType: {
type: Array,
default: () => ['original', 'compressed']
},
// 是否开启图片多选,部分安卓机型不支持
multiple: {
type: Boolean,
default: false
},
// 是否展示删除按钮
deletable: {
type: Boolean,
default: true
},
// 文件大小限制单位为byte
maxSize: {
type: [String, Number],
default: Number.MAX_VALUE
},
// 显示已上传的文件列表
fileList: {
type: Array,
default: () => []
},
// 上传区域的提示文字
uploadText: {
type: String,
default: ''
},
// 内部预览图片区域和选择图片按钮的区域宽度
width: {
type: [String, Number],
default: 80
},
// 内部预览图片区域和选择图片按钮的区域高度
height: {
type: [String, Number],
default: 80
},
// 是否在上传完成后展示预览图
previewImage: {
type: Boolean,
default: true
},
...uni.$uv?.props?.upload
}
export default {
props: {
// 接受的文件类型, 可选值为all media image file video
accept: {
type: String,
default: 'image'
},
// 图片或视频拾取模式当accept为image类型时设置capture可选额外camera可以直接调起摄像头
capture: {
type: [String, Array],
default: () => ['album', 'camera']
},
// 当accept为video时生效是否压缩视频默认为true
compressed: {
type: Boolean,
default: true
},
// 当accept为video时生效可选值为back或front
camera: {
type: String,
default: 'back'
},
// 当accept为video时生效拍摄视频最长拍摄时间单位秒
maxDuration: {
type: Number,
default: 60
},
// 上传区域的图标,只能内置图标
uploadIcon: {
type: String,
default: 'camera-fill'
},
// 上传区域的图标的颜色,默认
uploadIconColor: {
type: String,
default: '#D3D4D6'
},
// 是否开启文件读取前事件
useBeforeRead: {
type: Boolean,
default: false
},
// 读取后的处理函数
afterRead: {
type: Function,
default: null
},
// 读取前的处理函数
beforeRead: {
type: Function,
default: null
},
// 是否开启图片预览功能
previewFullImage: {
type: Boolean,
default: true
},
// 是否开启视频预览功能
previewFullVideo: {
type: Boolean,
default: true
},
// 最大上传数量
maxCount: {
type: [String, Number],
default: 52
},
// 是否禁用
disabled: {
type: Boolean,
default: false
},
// 预览上传的图片时的裁剪模式和image组件mode属性一致
imageMode: {
type: String,
default: 'aspectFill'
},
// 标识符,可以在回调函数的第二项参数中获取
name: {
type: String,
default: ''
},
// 所选的图片的尺寸, 可选值为original compressed
sizeType: {
type: Array,
default: () => ['original', 'compressed']
},
// 是否开启图片多选,部分安卓机型不支持
multiple: {
type: Boolean,
default: false
},
// 是否展示删除按钮
deletable: {
type: Boolean,
default: true
},
// 文件大小限制单位为byte
maxSize: {
type: [String, Number],
default: Number.MAX_VALUE
},
// 显示已上传的文件列表
fileList: {
type: Array,
default: () => []
},
// 上传区域的提示文字
uploadText: {
type: String,
default: ''
},
// 内部预览图片区域和选择图片按钮的区域宽度
width: {
type: [String, Number],
default: 80
},
// 内部预览图片区域和选择图片按钮的区域高度
height: {
type: [String, Number],
default: 80
},
// 是否在上传完成后展示预览图
previewImage: {
type: Boolean,
default: true
},
...uni.$uv?.props?.upload
}
}

View File

@ -1,151 +1,151 @@
function pickExclude(obj, keys) {
// 某些情况下type可能会为
if (!['[object Object]', '[object File]'].includes(Object.prototype.toString.call(obj))) {
return {}
}
return Object.keys(obj).reduce((prev, key) => {
if (!keys.includes(key)) {
prev[key] = obj[key]
}
return prev
}, {})
}
function formatImage(res) {
return res.tempFiles.map((item) => ({
...pickExclude(item, ['path']),
type: 'image',
url: item.path,
thumb: item.path,
size: item.size,
// #ifdef H5
name: item.name
// #endif
}))
}
function formatVideo(res) {
return [
{
...pickExclude(res, ['tempFilePath', 'thumbTempFilePath', 'errMsg']),
type: 'video',
url: res.tempFilePath,
thumb: res.thumbTempFilePath,
size: res.size,
// #ifdef H5
name: res.name
// #endif
}
]
}
function formatMedia(res) {
return res.tempFiles.map((item) => ({
...pickExclude(item, ['fileType', 'thumbTempFilePath', 'tempFilePath']),
type: res.type,
url: item.tempFilePath,
thumb: res.type === 'video' ? item.thumbTempFilePath : item.tempFilePath,
size: item.size
}))
}
function formatFile(res) {
return res.tempFiles.map((item) => ({
...pickExclude(item, ['path']),
url: item.path,
size:item.size,
// #ifdef H5
name: item.name,
type: item.type
// #endif
}))
}
export function chooseFile({
accept,
multiple,
capture,
compressed,
maxDuration,
sizeType,
camera,
maxCount
}) {
return new Promise((resolve, reject) => {
switch (accept) {
case 'image':
uni.chooseImage({
count: multiple ? Math.min(maxCount, 9) : 1,
sourceType: capture,
sizeType,
success: (res) => resolve(formatImage(res)),
fail: reject
})
break
// #ifdef MP-WEIXIN
// 只有微信小程序才支持chooseMedia接口
case 'media':
wx.chooseMedia({
count: multiple ? Math.min(maxCount, 9) : 1,
sourceType: capture,
maxDuration,
sizeType,
camera,
success: (res) => resolve(formatMedia(res)),
fail: reject
})
break
// #endif
case 'video':
uni.chooseVideo({
sourceType: capture,
compressed,
maxDuration,
camera,
success: (res) => resolve(formatVideo(res)),
fail: reject
})
break
// #ifdef MP-WEIXIN || H5
// 只有微信小程序才支持chooseMessageFile接口
case 'file':
// #ifdef MP-WEIXIN
wx.chooseMessageFile({
count: multiple ? maxCount : 1,
type: accept,
success: (res) => resolve(formatFile(res)),
fail: reject
})
// #endif
// #ifdef H5
// 需要hx2.9.9以上才支持uni.chooseFile
uni.chooseFile({
count: multiple ? maxCount : 1,
type: accept,
success: (res) => resolve(formatFile(res)),
fail: reject
})
// #endif
break
// #endif
default:
// 此为保底选项在accept不为上面任意一项的时候选取全部文件
// #ifdef MP-WEIXIN
wx.chooseMessageFile({
count: multiple ? maxCount : 1,
type: 'all',
success: (res) => resolve(formatFile(res)),
fail: reject
})
// #endif
// #ifdef H5
// 需要hx2.9.9以上才支持uni.chooseFile
uni.chooseFile({
count: multiple ? maxCount : 1,
type: 'all',
success: (res) => resolve(formatFile(res)),
fail: reject
})
// #endif
}
})
}
function pickExclude(obj, keys) {
// 某些情况下type可能会为
if (!['[object Object]', '[object File]'].includes(Object.prototype.toString.call(obj))) {
return {}
}
return Object.keys(obj).reduce((prev, key) => {
if (!keys.includes(key)) {
prev[key] = obj[key]
}
return prev
}, {})
}
function formatImage(res) {
return res.tempFiles.map((item) => ({
...pickExclude(item, ['path']),
type: 'image',
url: item.path,
thumb: item.path,
size: item.size,
// #ifdef H5
name: item.name
// #endif
}))
}
function formatVideo(res) {
return [
{
...pickExclude(res, ['tempFilePath', 'thumbTempFilePath', 'errMsg']),
type: 'video',
url: res.tempFilePath,
thumb: res.thumbTempFilePath,
size: res.size,
// #ifdef H5
name: res.name
// #endif
}
]
}
function formatMedia(res) {
return res.tempFiles.map((item) => ({
...pickExclude(item, ['fileType', 'thumbTempFilePath', 'tempFilePath']),
type: res.type,
url: item.tempFilePath,
thumb: res.type === 'video' ? item.thumbTempFilePath : item.tempFilePath,
size: item.size
}))
}
function formatFile(res) {
return res.tempFiles.map((item) => ({
...pickExclude(item, ['path']),
url: item.path,
size:item.size,
// #ifdef H5
name: item.name,
type: item.type
// #endif
}))
}
export function chooseFile({
accept,
multiple,
capture,
compressed,
maxDuration,
sizeType,
camera,
maxCount
}) {
return new Promise((resolve, reject) => {
switch (accept) {
case 'image':
uni.chooseImage({
count: multiple ? Math.min(maxCount, 9) : 1,
sourceType: capture,
sizeType,
success: (res) => resolve(formatImage(res)),
fail: reject
})
break
// #ifdef MP-WEIXIN
// 只有微信小程序才支持chooseMedia接口
case 'media':
wx.chooseMedia({
count: multiple ? Math.min(maxCount, 9) : 1,
sourceType: capture,
maxDuration,
sizeType,
camera,
success: (res) => resolve(formatMedia(res)),
fail: reject
})
break
// #endif
case 'video':
uni.chooseVideo({
sourceType: capture,
compressed,
maxDuration,
camera,
success: (res) => resolve(formatVideo(res)),
fail: reject
})
break
// #ifdef MP-WEIXIN || H5
// 只有微信小程序才支持chooseMessageFile接口
case 'file':
// #ifdef MP-WEIXIN
wx.chooseMessageFile({
count: multiple ? maxCount : 1,
type: accept,
success: (res) => resolve(formatFile(res)),
fail: reject
})
// #endif
// #ifdef H5
// 需要hx2.9.9以上才支持uni.chooseFile
uni.chooseFile({
count: multiple ? maxCount : 1,
type: accept,
success: (res) => resolve(formatFile(res)),
fail: reject
})
// #endif
break
// #endif
default:
// 此为保底选项在accept不为上面任意一项的时候选取全部文件
// #ifdef MP-WEIXIN
wx.chooseMessageFile({
count: multiple ? maxCount : 1,
type: 'all',
success: (res) => resolve(formatFile(res)),
fail: reject
})
// #endif
// #ifdef H5
// 需要hx2.9.9以上才支持uni.chooseFile
uni.chooseFile({
count: multiple ? maxCount : 1,
type: 'all',
success: (res) => resolve(formatFile(res)),
fail: reject
})
// #endif
}
})
}

File diff suppressed because it is too large Load Diff

View File

@ -1,89 +1,89 @@
{
"id": "uv-upload",
"displayName": "uv-upload 上传 全面兼容小程序、nvue、vue2、vue3等多端",
"version": "1.0.4",
"description": "该组件用于上传图片等文件场景。",
"keywords": [
"uv-upload",
"uvui",
"uv-ui",
"upload",
"上传"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"type": "component-vue",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "插件不采集任何数据",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [
"uv-ui-tools",
"uv-icon",
"uv-loading-icon"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"Vue": {
"vue2": "y",
"vue3": "y"
},
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
{
"id": "uv-upload",
"displayName": "uv-upload 上传 全面兼容小程序、nvue、vue2、vue3等多端",
"version": "1.0.4",
"description": "该组件用于上传图片等文件场景。",
"keywords": [
"uv-upload",
"uvui",
"uv-ui",
"upload",
"上传"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"type": "component-vue",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "插件不采集任何数据",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [
"uv-ui-tools",
"uv-icon",
"uv-loading-icon"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"Vue": {
"vue2": "y",
"vue3": "y"
},
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}

View File

@ -1,11 +1,11 @@
## Upload 上传
> **组件名uv-upload**
该组件用于上传图片等文件场景。
### <a href="https://www.uvui.cn/components/upload.html" target="_blank">查看文档</a>
### [完整示例项目下载 | 关注更多组件](https://ext.dcloud.net.cn/plugin?name=uv-ui)
#### 如使用过程中有任何问题或者您对uv-ui有一些好的建议欢迎加入 uv-ui 交流群:<a href="https://ext.dcloud.net.cn/plugin?id=12287" target="_blank">uv-ui</a>、<a href="https://www.uvui.cn/components/addQQGroup.html" target="_blank">官方QQ群</a>
## Upload 上传
> **组件名uv-upload**
该组件用于上传图片等文件场景。
### <a href="https://www.uvui.cn/components/upload.html" target="_blank">查看文档</a>
### [完整示例项目下载 | 关注更多组件](https://ext.dcloud.net.cn/plugin?name=uv-ui)
#### 如使用过程中有任何问题或者您对uv-ui有一些好的建议欢迎加入 uv-ui 交流群:<a href="https://ext.dcloud.net.cn/plugin?id=12287" target="_blank">uv-ui</a>、<a href="https://www.uvui.cn/components/addQQGroup.html" target="_blank">官方QQ群</a>