Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李俊赕
self-support
Commits
2c8aba78
Commit
2c8aba78
authored
Apr 19, 2021
by
Facius
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.banshouhui.com/lijundan/self-support
parents
26039978
dcbabe22
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
740 additions
and
597 deletions
+740
-597
App.vue
src/App.vue
+4
-3
classify.data.js
src/common/classify.data.js
+3
-1
XhFiles.vue
src/components/createCom/XhFiles.vue
+102
-0
XhRadio - 副本.vue
src/components/createCom/XhRadio - 副本.vue
+0
-45
index.js
src/components/upload/index.js
+17
-4
complete.vue
src/pages/order/complete.vue
+6
-1
file.vue
src/pages/settle/file.vue
+605
-540
index.js
src/plugins/uploader/index.js
+2
-2
upload.js
src/plugins/uploader/request/upload/upload.js
+1
-1
No files found.
src/App.vue
View file @
2c8aba78
...
...
@@ -36,6 +36,9 @@
// 授权用户信息
authUserInfo
:
''
,
// 用户入驻信息
settledInfo
:
{},
},
onLaunch
:
function
()
{
// 应用初始化(全局只触发一次)
...
...
@@ -46,9 +49,7 @@
},
onShow
:
function
()
{
// 应用启动,或从后台进入前台显示
if
(
!
this
.
globalData
.
token
)
{
this
.
autoLogin
()
}
},
onHide
:
function
()
{
// 应用从前台进入后台
...
...
src/common/classify.data.js
View file @
2c8aba78
...
...
@@ -38,7 +38,9 @@ export default [{
"cat"
:
10
},
{
"fieldsTitle"
:
"短裙"
,
"fieldsTitle"
:
"文件选择"
,
"fieldsName"
:
"file"
,
"fieldsType"
:
"file"
,
"key"
:
"短裙"
,
"icon"
:
"https://cdn.uviewui.com/uview/common/classify/1/5.jpg"
,
"cat"
:
10
...
...
src/components/createCom/XhFiles.vue
0 → 100644
View file @
2c8aba78
<
template
>
<view
class=
"file-box"
>
<view
class=
"u-flex"
@
click=
"selectUpload"
>
<view
class=
"txt u-flex-1"
>
{{
item
.
fieldsTitle
}}
</view>
<u-icon
name=
"arrow-right"
color=
"#666"
size=
"28"
></u-icon>
</view>
<view
class=
"pics u-flex u-flex-wrap"
>
<u-image
class=
"pic"
v-for=
"(item,index) in imgList"
width=
"170rpx"
height=
"170"
:src=
"item.path"
></u-image>
<!--
<u-image
class=
"pic"
v-for=
"item in 6"
width=
"170rpx"
height=
"170"
src=
"'https://cdn.uviewui.com/uview/example/fade.jpg"
></u-image>
-->
</view>
<u-popup
v-model=
"maskShow"
mode=
"center"
width=
"500"
>
<view
class=
"upload-box u-p-30"
>
<view
class=
"title"
>
请选择图片
</view>
<view
class=
"u-flex u-row-between"
>
<view
class=
"upload-item u-text-center"
@
click=
"uploadFile('photo')"
>
<u-image
class=
"pic"
width=
"170rpx"
height=
"170"
src=
"'https://cdn.uviewui.com/uview/example/fade.jpg"
></u-image>
相册
</view>
<view
class=
"upload-item u-text-center"
@
click=
"uploadFile"
>
<u-image
class=
"pic"
width=
"170rpx"
height=
"170"
src=
"'https://cdn.uviewui.com/uview/example/fade.jpg"
></u-image>
拍摄
</view>
</view>
</view>
</u-popup>
</view>
</
template
>
<
script
>
import
objMixin
from
'./objMixin'
import
baseFile
from
'@/components/upload/index'
;
export
default
{
name
:
'XhFiles'
,
components
:
{},
mixins
:
[
objMixin
,
baseFile
],
props
:
{},
filters
:{},
data
()
{
return
{
maskShow
:
false
}
},
computed
:
{
settings
()
{
return
this
.
item
.
settings
||
[]
}
},
watch
:
{},
mounted
()
{},
methods
:
{
selectUpload
(){
// 弹窗展示
this
.
maskShow
=
true
},
async
uploadFile
(
type
){
const
self
=
this
if
(
type
&&
type
===
'photo'
){
// 直接打开相册
let
config
=
{
options
:{
consourceType
:[
'album'
],
//['album', 'camera']
}
}
await
this
.
chooseImage
(
'qiniu'
,
config
)
self
.
setValue
()
return
}
// 使用拍照工具拍摄
},
setValue
()
{
const
dataValue
=
[]
this
.
imgList
.
map
(
item
=>
{
dataValue
.
push
(
item
.
key
)
})
this
.
valueChange
(
dataValue
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.pic
{
margin-right
:
15rpx
;
margin-bottom
:
15rpx
;
&
:nth-child
(
3n
)
{
margin-right
:
0
;
}
}
// .list {
// display: flex;
// .txt {
// color: #666;
// padding: 10rpx;
// &.active {
// background-color: red;
// color: #fff;
// }
// }
// }
</
style
>
src/components/createCom/XhRadio - 副本.vue
deleted
100644 → 0
View file @
26039978
<
template
>
<view
class=
"list"
>
<view
v-for=
"(item,index) in settings"
:key=
"index"
:class=
"
{'txt':true,'active':item===dataValue}"
@click="setValue(item)">
{{
item
}}
</view>
</view>
</
template
>
<
script
>
import
stringMixin
from
'./stringMixin'
export
default
{
name
:
'XhRadio'
,
components
:
{},
mixins
:
[
stringMixin
],
props
:
{},
data
()
{
return
{}
},
computed
:
{
settings
(){
return
this
.
item
.
settings
||
[]
}
},
watch
:
{},
mounted
()
{},
methods
:
{
setValue
(
txt
){
this
.
dataValue
=
txt
this
.
valueChange
(
txt
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.list
{
display
:
flex
;
.txt
{
color
:
#666
;
padding
:
10rpx
;
&
.active
{
background-color
:
red
;
color
:
#fff
;
}
}
}
</
style
>
src/components/upload/index.js
View file @
2c8aba78
...
...
@@ -5,7 +5,9 @@ export default {
components
:
{},
data
()
{
return
{
imgList
:[]
imgList
:[],
// 上传文件种类:0--头像、1--证件、2--身份证
categories
:
[
'avatar'
,
'cert'
,
'id'
],
};
},
created
()
{
...
...
@@ -26,10 +28,19 @@ export default {
}
let
res
=
await
uploader
.
urlFileUpload
(
options
)
},
async
chooseImage
(
type
){
/**
* 上传图片公用组件
* @param {Object} type 文件上传方式
* @param {Object} attr 文件属性:图片种类[category](身份证、证件、头像);
* 图片上传其他配置[options】(如,选择图片或拍摄options.consourceType,['album', 'camera'];)其他
*/
async
chooseImage
(
type
,
attr
=
{}){
const
self
=
this
let
imgList
=
[]
if
(
type
===
'qiniu'
){
// 图片种类
let
category
=
attr
&&
attr
.
category
||
self
.
categories
[
0
]
let
config
=
attr
&&
attr
.
options
||
{}
// 图片上传参数配置
// 七牛上传
let
options
=
{
onProgressUpdate
(
res
){
...
...
@@ -57,13 +68,15 @@ export default {
}
self
.
imgList
=
imgList
console
.
log
(
res
,
'res---onEachUpdate'
)
}
},
cardType
:
category
,
...
config
}
// 不需要进度条等可直接获取
let
res
=
await
uploader
.
qnImgUpload
(
options
)
console
.
log
(
self
.
imgList
,
'self.imgList'
)
//
console.log(uploader,uploader.qiniuTokenObj,'qiniuTokenObj')
console
.
log
(
uploader
,
uploader
.
qiniuTokenObj
,
'qiniuTokenObj'
)
// let imgList = res.map(item=>{
// return {
// key:item,
...
...
src/pages/order/complete.vue
View file @
2c8aba78
...
...
@@ -41,6 +41,9 @@
<xh-select
v-if=
"item.fieldsType==='select'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
@
value-change=
"fieldValueChange"
>
</xh-select>
<xh-files
v-if=
"item.fieldsType==='file'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
@
value-change=
"fieldValueChange"
>
</xh-files>
</
template
>
</u-form-item>
</view>
...
...
@@ -58,6 +61,7 @@
import
XhRadio
from
'@/components/createCom/XhRadio.vue'
import
XhCheckbox
from
'@/components/createCom/XhCheckbox.vue'
import
XhSelect
from
'@/components/createCom/XhSelect.vue'
import
XhFiles
from
'@/components/createCom/XhFiles.vue'
// import XhRadio from '@/components/createCom/XhRadio.vue'
export
default
{
data
()
{
...
...
@@ -109,7 +113,8 @@
XhInput
,
XhRadio
,
XhCheckbox
,
XhSelect
XhSelect
,
XhFiles
// formCom
},
created
()
{
...
...
src/pages/settle/file.vue
View file @
2c8aba78
This diff is collapsed.
Click to expand it.
src/plugins/uploader/index.js
View file @
2c8aba78
...
...
@@ -26,11 +26,11 @@ let baseOptions = {
let
uploader
=
new
request
(
baseOptions
);
// 添加获取七牛云token的方法
uploader
.
getQnToken
=
function
(
data
)
{
uploader
.
getQnToken
=
function
(
params
)
{
//该地址需要开发者自行配置(每个后台的接口风格都不一样)
// console.log(uploader.get,'uploader.get')
return
new
Promise
((
resolve
,
reject
)
=>
{
uploader
.
post
(
baseOptions
.
qiniuUploadUrl
,
data
).
then
(
data
=>
{
uploader
.
post
(
baseOptions
.
qiniuUploadUrl
,
params
).
then
(
data
=>
{
/*
*接口返回参数:
*visitPrefix:访问文件的域名
...
...
src/plugins/uploader/request/upload/upload.js
View file @
2c8aba78
...
...
@@ -83,7 +83,7 @@ export default class fileUpload extends request {
}
let
qnRes
=
this
.
qiniuTokenObj
if
(
!
qnRes
||
qnRes
.
cardType
!==
requestInfo
.
cardType
){
let
params
=
{
type
:
requestInfo
.
cardType
||
''
}
let
params
=
{
type
:
requestInfo
.
cardType
||
'
avatar
'
}
qnRes
=
await
this
.
getQnToken
(
params
)
this
.
qiniuTokenObj
=
{
cardType
:
''
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment