Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
Project
Project
Details
Activity
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
wangxuelai
wechatapp.shangjiadao.com
Commits
80a0d76d
Commit
80a0d76d
authored
Apr 10, 2020
by
lvtz
Browse files
Options
Browse Files
Download
Plain Diff
fix
parents
81d894ad
fe3d06c0
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
101 additions
and
80 deletions
+101
-80
api.js
constants/api.js
+3
-2
common.js
service/common.js
+4
-7
index.js
src/pages/activityindex/index.js
+0
-1
index.js
src/pages/clockeditor/index.js
+60
-47
index.js
src/pages/mall/index.js
+0
-1
userinfoupdate.js
src/pages/setting/userinfoupdate.js
+33
-20
userinfoupdate.wxml
src/pages/setting/userinfoupdate.wxml
+1
-1
index.js
src/pages/teacherpclogin/index.js
+0
-1
No files found.
constants/api.js
View file @
80a0d76d
import
constants
from
'./constants.js'
;
import
constants
from
'./constants.js'
;
const
api
=
constants
.
host
+
'/v3/'
;
// 打卡通用接口
const
api
=
constants
.
host
+
'/v3/'
;
// 打卡通用接口
const
apiv4
=
constants
.
host
+
'/v4/'
;
// 打卡通用接口
const
apiv2
=
constants
.
host2
+
'/shop/api/'
;
// 打卡登录注册忘记密码接口
const
apiv2
=
constants
.
host2
+
'/shop/api/'
;
// 打卡登录注册忘记密码接口
const
apis
=
{
const
apis
=
{
...
@@ -41,9 +42,9 @@ const apis = {
...
@@ -41,9 +42,9 @@ const apis = {
// login: `${api}member/login`,
// login: `${api}member/login`,
// verifyCode: 'http://biz.wp53.cn/v2/api/service/user/verify_code',
// verifyCode: 'http://biz.wp53.cn/v2/api/service/user/verify_code',
// register: `${api}common/qx_login/register`,
// register: `${api}common/qx_login/register`,
cOssAccess
:
`
${
api
}
student/oss/access`
,
cOssAccess
:
`
${
api
v4
}
student/oss/access`
,
circleUserShow
:
`
${
api
}
consumer/clock/circle/userShow`
,
circleUserShow
:
`
${
api
}
consumer/clock/circle/userShow`
,
cMediaOssAccess
:
`
${
api
}
student/media_access`
,
cMediaOssAccess
:
`
${
api
v4
}
student/media_access`
,
generateBusinessQrcode
:
`
${
api
}
common/qr_code_unlimit`
,
generateBusinessQrcode
:
`
${
api
}
common/qr_code_unlimit`
,
generateCustomerQrcode
:
`
${
api
}
common/qr_code_unlimit`
,
generateCustomerQrcode
:
`
${
api
}
common/qr_code_unlimit`
,
updateUserinfo
:
`
${
api
}
consumer/clock/userinfo/edit`
,
updateUserinfo
:
`
${
api
}
consumer/clock/userinfo/edit`
,
...
...
service/common.js
View file @
80a0d76d
...
@@ -6,21 +6,18 @@ import {
...
@@ -6,21 +6,18 @@ import {
}
from
'../utilities/index.js'
;
}
from
'../utilities/index.js'
;
import
apis
from
'../constants/api.js'
;
import
apis
from
'../constants/api.js'
;
// 原本c端公用的方法
// 原本c端公用的方法
function
cOssAccess
()
{
function
cOssAccess
(
data
)
{
return
wxRequest
({
return
wxRequest
({
url
:
apis
.
customer
.
common
.
cOssAccess
,
url
:
apis
.
customer
.
common
.
cOssAccess
,
data
:
{
data
:
data
||
{},
},
method
:
'GET'
,
method
:
'GET'
,
errorresolve
:
1
,
errorresolve
:
1
,
})
})
}
}
function
cMediaOssAccess
(
{
type
}
)
{
function
cMediaOssAccess
(
data
)
{
return
wxRequest
({
return
wxRequest
({
url
:
apis
.
customer
.
common
.
cMediaOssAccess
,
url
:
apis
.
customer
.
common
.
cMediaOssAccess
,
data
:
{
data
,
type
},
method
:
'GET'
,
method
:
'GET'
,
errorresolve
:
1
,
errorresolve
:
1
,
})
})
...
...
src/pages/activityindex/index.js
View file @
80a0d76d
// src/pages/activityindex/index.js
// src/pages/activityindex/index.js
import
{
import
{
wxChooseImage
,
wxUploadFile
wxUploadFile
}
from
'../../../utilities/wxApi.js'
;
}
from
'../../../utilities/wxApi.js'
;
import
{
import
{
...
...
src/pages/clockeditor/index.js
View file @
80a0d76d
...
@@ -384,14 +384,8 @@ Page({
...
@@ -384,14 +384,8 @@ Page({
this
.
setData
({
this
.
setData
({
imageUploaded
:
false
imageUploaded
:
false
})
})
cOssAccess
().
then
((
acc
)
=>
{
wxChooseImage
({
access
=
acc
.
data
;
count
:
this
.
data
.
maxImgCount
-
imgCount
if
(
!
tempFiles
.
currentTarget
){
return
{
tempFiles
,};
}
return
wxChooseImage
({
count
:
this
.
data
.
maxImgCount
-
imgCount
})
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
const
{
tempFiles
}
=
res
;
const
{
tempFiles
}
=
res
;
let
imageBox
=
this
.
data
.
imageBox
;
let
imageBox
=
this
.
data
.
imageBox
;
...
@@ -419,16 +413,17 @@ Page({
...
@@ -419,16 +413,17 @@ Page({
this
.
setData
({
this
.
setData
({
imageBox
:
res
.
imageBox
,
imageBox
:
res
.
imageBox
,
})
})
this
.
singleUploadFile
(
access
)
this
.
singleUploadFile
()
}).
catch
((
e
)
=>
{
}).
catch
((
e
)
=>
{
wx
.
hideLoading
()
wx
.
hideLoading
()
})
})
},
},
singleUploadFile
(
access
)
{
singleUploadFile
()
{
wx
.
showLoading
({
wx
.
showLoading
({
title
:
'图片上传中...'
,
title
:
'图片上传中...'
,
mask
:
true
mask
:
true
})
})
let
access
=
{};
let
imageBox
=
this
.
data
.
imageBox
;
let
imageBox
=
this
.
data
.
imageBox
;
if
(
this
.
data
.
currentIndex
==
(
imageBox
.
length
))
{
if
(
this
.
data
.
currentIndex
==
(
imageBox
.
length
))
{
wx
.
hideLoading
();
wx
.
hideLoading
();
...
@@ -440,34 +435,45 @@ Page({
...
@@ -440,34 +435,45 @@ Page({
}
}
return
;
return
;
}
}
let
filename
=
`
${
access
.
dir
}${
getRandomFilename
(
imageBox
[
this
.
data
.
currentIndex
].
src
)}
`
;
imageBox
[
this
.
data
.
currentIndex
].
status
=
'resolving'
;
imageBox
[
this
.
data
.
currentIndex
].
status
=
'resolving'
;
this
.
setData
({
this
.
setData
({
imageBox
imageBox
})
})
wxUploadFile
({
const
path
=
imageBox
[
this
.
data
.
currentIndex
].
src
;
url
:
access
.
host
,
const
fileType
=
path
.
substr
(
path
.
lastIndexOf
(
'.'
)
+
1
);
formData
:
{
cOssAccess
({
key
:
filename
,
school_id
:
this
.
data
.
sid
,
policy
:
access
.
policy
,
ext
:
fileType
OSSAccessKeyId
:
access
.
accessid
,
}).
then
((
acc
)
=>
{
signature
:
access
.
signature
,
access
=
acc
.
data
;
callback
:
access
.
callback
,
// if(!tempFiles.currentTarget){
success_action_status
:
'200'
// return {tempFiles,};
},
// }
filePath
:
imageBox
[
this
.
data
.
currentIndex
].
src
,
// imageBox[this.data.currentIndex].src = access.path;
name
:
'file'
,
return
wxUploadFile
({
url
:
access
.
host
,
formData
:
{
key
:
access
.
path
,
policy
:
access
.
policy
,
OSSAccessKeyId
:
access
.
accessid
,
signature
:
access
.
signature
,
callback
:
access
.
callback
,
success_action_status
:
'200'
},
filePath
:
imageBox
[
this
.
data
.
currentIndex
].
src
,
name
:
'file'
,
})
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
let
data
=
JSON
.
parse
(
res
.
data
);
let
data
=
JSON
.
parse
(
res
.
data
);
if
(
data
.
status
==
'ok'
)
{
if
(
data
.
status
==
'ok'
)
{
imageBox
[
this
.
data
.
currentIndex
].
status
=
'fullfilled'
;
imageBox
[
this
.
data
.
currentIndex
].
status
=
'fullfilled'
;
imageBox
[
this
.
data
.
currentIndex
].
src
=
filename
;
imageBox
[
this
.
data
.
currentIndex
].
src
=
access
.
path
;
let
currentIndex
=
this
.
data
.
currentIndex
+
1
;
let
currentIndex
=
this
.
data
.
currentIndex
+
1
;
this
.
setData
({
this
.
setData
({
imageBox
,
imageBox
,
currentIndex
currentIndex
})
})
this
.
singleUploadFile
(
access
);
this
.
singleUploadFile
();
}
else
{
}
else
{
imageBox
[
this
.
data
.
currentIndex
].
status
=
'fail'
;
imageBox
[
this
.
data
.
currentIndex
].
status
=
'fail'
;
let
currentIndex
=
this
.
data
.
currentIndex
+
1
;
let
currentIndex
=
this
.
data
.
currentIndex
+
1
;
...
@@ -475,16 +481,16 @@ Page({
...
@@ -475,16 +481,16 @@ Page({
imageBox
,
imageBox
,
currentIndex
currentIndex
})
})
this
.
singleUploadFile
(
access
);
this
.
singleUploadFile
();
}
}
}).
catch
(()
=>
{
}).
catch
((
e
)
=>
{
imageBox
[
this
.
data
.
currentIndex
].
status
=
'fail'
;
imageBox
[
this
.
data
.
currentIndex
].
status
=
'fail'
;
let
currentIndex
=
this
.
data
.
currentIndex
+
1
;
let
currentIndex
=
this
.
data
.
currentIndex
+
1
;
this
.
setData
({
this
.
setData
({
imageBox
,
imageBox
,
currentIndex
currentIndex
})
})
this
.
singleUploadFile
(
access
);
this
.
singleUploadFile
();
})
})
},
},
delimg
(
e
)
{
delimg
(
e
)
{
...
@@ -783,18 +789,16 @@ Page({
...
@@ -783,18 +789,16 @@ Page({
const
that
=
this
;
const
that
=
this
;
let
access
=
{};
let
access
=
{};
let
filename
=
''
;
let
filename
=
''
;
cMediaOssAccess
({
let
videoInsertIndex
=
0
;
type
:
1
let
imageBox
=
this
.
data
.
imageBox
;
}).
then
((
res
)
=>
{
let
size
=
0
;
access
=
res
.
data
;
let
duration
=
0
;
if
(
tempFile
){
let
tempFilePath
=
''
;
return
tempFile
wxChooseVideo
({
}
return
wxChooseVideo
({
})
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
let
tempFilePath
=
''
;
// access = res.data;
const
{
duration
,
size
}
=
res
;
size
=
res
.
size
;
duration
=
res
.
duration
;
if
(
tempFile
){
if
(
tempFile
){
tempFilePath
=
res
.
path
;
tempFilePath
=
res
.
path
;
}
else
{
}
else
{
...
@@ -818,11 +822,19 @@ Page({
...
@@ -818,11 +822,19 @@ Page({
})
})
return
return
}
}
let
imageBox
=
this
.
data
.
imageBox
videoInsertIndex
=
imageBox
.
filter
(
ele
=>
ele
.
type
==
'video'
).
length
;
let
videoInsertIndex
=
imageBox
.
filter
(
ele
=>
ele
.
type
==
'video'
).
length
;
// filename = `${access.dir}${getRandomFilename(tempFilePath)}`;
filename
=
`
${
access
.
dir
}${
getRandomFilename
(
tempFilePath
)}
`
;
const
path
=
tempFilePath
;
const
fileType
=
path
.
substr
(
path
.
lastIndexOf
(
'.'
)
+
1
).
toLowerCase
();
return
cMediaOssAccess
({
school_id
:
this
.
data
.
sid
,
ext
:
fileType
,
type
:
1
})
}).
then
((
res
)
=>
{
access
=
res
.
data
;
imageBox
.
splice
(
videoInsertIndex
,
0
,
{
imageBox
.
splice
(
videoInsertIndex
,
0
,
{
src
:
filename
,
src
:
access
.
path
,
status
:
'resolving'
,
status
:
'resolving'
,
type
:
'video'
,
type
:
'video'
,
size
:
size
,
size
:
size
,
...
@@ -831,10 +843,10 @@ Page({
...
@@ -831,10 +843,10 @@ Page({
that
.
setData
({
that
.
setData
({
imageBox
imageBox
})
})
that
.
data
.
uploadVideoTask
[
`
${
filename
}
`
]
=
wx
.
uploadFile
({
that
.
data
.
uploadVideoTask
[
`
${
access
.
path
}
`
]
=
wx
.
uploadFile
({
url
:
access
.
host
,
url
:
access
.
host
,
formData
:
{
formData
:
{
key
:
filename
,
key
:
access
.
path
,
policy
:
access
.
policy
,
policy
:
access
.
policy
,
OSSAccessKeyId
:
access
.
accessid
,
OSSAccessKeyId
:
access
.
accessid
,
signature
:
access
.
signature
,
signature
:
access
.
signature
,
...
@@ -846,9 +858,9 @@ Page({
...
@@ -846,9 +858,9 @@ Page({
success
(
res
)
{
success
(
res
)
{
const
{
data
}
=
res
;
const
{
data
}
=
res
;
if
(
data
==
'{"status":"ok"}'
)
{
if
(
data
==
'{"status":"ok"}'
)
{
console
.
log
(
videoInsertIndex
,
'videoInsertIndex'
);
let
imageBox
=
that
.
data
.
imageBox
;
let
imageBox
=
that
.
data
.
imageBox
;
imageBox
[
videoInsertIndex
].
src
=
filename
;
console
.
log
(
access
.
path
,
'filenamefilenamefilename'
);
imageBox
[
videoInsertIndex
].
src
=
access
.
path
;
imageBox
[
videoInsertIndex
].
status
=
'fullfilled'
;
imageBox
[
videoInsertIndex
].
status
=
'fullfilled'
;
imageBox
[
videoInsertIndex
].
videoprogress
=
100
;
imageBox
[
videoInsertIndex
].
videoprogress
=
100
;
that
.
setData
({
that
.
setData
({
...
@@ -1255,6 +1267,7 @@ audioStorage[value].isWaiting = true;
...
@@ -1255,6 +1267,7 @@ audioStorage[value].isWaiting = true;
const
videoList
=
tempFiles
.
filter
(
ele
=>
{
const
videoList
=
tempFiles
.
filter
(
ele
=>
{
return
ele
.
type
==
'video'
return
ele
.
type
==
'video'
})
})
console
.
log
(
imgList
,
'tempFilestempFiles'
);
this
.
addImg
(
imgList
);
this
.
addImg
(
imgList
);
videoList
.
forEach
((
ele
)
=>
{
videoList
.
forEach
((
ele
)
=>
{
this
.
addVideoMethod
(
ele
)
this
.
addVideoMethod
(
ele
)
...
...
src/pages/mall/index.js
View file @
80a0d76d
// src/pages/activityindex/index.js
// src/pages/activityindex/index.js
import
{
import
{
wxChooseImage
,
wxUploadFile
wxUploadFile
}
from
'../../../utilities/wxApi.js'
;
}
from
'../../../utilities/wxApi.js'
;
import
{
import
{
...
...
src/pages/setting/userinfoupdate.js
View file @
80a0d76d
...
@@ -129,26 +129,36 @@ Page({
...
@@ -129,26 +129,36 @@ Page({
});
});
},
},
// .then((acc) => {
// access = acc.data;
// return access;
// })
proMainImgUpload
(
e
)
{
proMainImgUpload
(
e
)
{
let
access
=
{};
let
access
=
{};
let
tempFiles
=
null
;
let
filename
=
''
;
let
filename
=
''
;
const
{
type
}
=
e
.
currentTarget
.
dataset
;
const
{
type
}
=
e
.
currentTarget
.
dataset
;
cOssAccess
({
wxChooseImage
({}).
then
((
res
)
=>
{
school_id
:
this
.
data
.
sid
tempFiles
=
res
.
tempFiles
;
}).
then
((
acc
)
=>
{
const
path
=
tempFiles
[
0
].
path
;
access
=
acc
.
data
;
const
fileType
=
path
.
substr
(
path
.
lastIndexOf
(
'.'
)
+
1
);
return
wxChooseImage
({})
return
cOssAccess
({
}).
then
((
res
)
=>
{
school_id
:
this
.
data
.
sid
,
const
{
tempFiles
}
=
res
;
ext
:
fileType
filename
=
`
${
access
.
dir
}${
getRandomFilename
(
tempFiles
[
0
].
path
)}
`
;
})
}).
then
((
data
)
=>
{
const
acc
=
data
.
data
;
// filename = `${access.dir}${getRandomFilename(tempFiles[0].path)}`;
filename
=
acc
.
path
;
console
.
log
(
filename
,
'filename '
);
return
wxUploadFile
({
return
wxUploadFile
({
url
:
acc
ess
.
host
,
url
:
acc
.
host
,
formData
:
{
formData
:
{
key
:
filename
,
key
:
filename
,
policy
:
acc
ess
.
policy
,
policy
:
acc
.
policy
,
OSSAccessKeyId
:
acc
ess
.
accessid
,
OSSAccessKeyId
:
acc
.
accessid
,
signature
:
acc
ess
.
signature
,
signature
:
acc
.
signature
,
callback
:
acc
ess
.
callback
,
callback
:
acc
.
callback
,
success_action_status
:
'200'
success_action_status
:
'200'
},
},
filePath
:
tempFiles
[
0
].
path
,
filePath
:
tempFiles
[
0
].
path
,
...
@@ -156,6 +166,7 @@ Page({
...
@@ -156,6 +166,7 @@ Page({
})
})
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
const
{
data
}
=
res
;
const
{
data
}
=
res
;
console
.
log
(
data
,
'data'
)
if
(
data
==
'{"status":"ok"}'
)
{
if
(
data
==
'{"status":"ok"}'
)
{
this
.
setData
({
this
.
setData
({
cropperSrc
:
imagify
(
filename
,
'image/resize,w_1280/format,jpg'
),
cropperSrc
:
imagify
(
filename
,
'image/resize,w_1280/format,jpg'
),
...
@@ -196,6 +207,8 @@ Page({
...
@@ -196,6 +207,8 @@ Page({
},
},
clickcut
(
e
)
{
clickcut
(
e
)
{
let
filepath
=
e
.
detail
.
url
;
let
filepath
=
e
.
detail
.
url
;
const
fileType
=
filepath
.
substr
(
filepath
.
lastIndexOf
(
'.'
)
+
1
);
let
fileName
=
''
;
this
.
setData
({
this
.
setData
({
showCropper
:
false
,
showCropper
:
false
,
cropperSrc
:
''
,
cropperSrc
:
''
,
...
@@ -203,18 +216,18 @@ Page({
...
@@ -203,18 +216,18 @@ Page({
})
})
let
filename
=
''
;
let
filename
=
''
;
cOssAccess
({
cOssAccess
({
school_id
:
this
.
data
.
sid
school_id
:
this
.
data
.
sid
,
}).
then
((
acc
)
=>
{
ext
:
fileType
return
acc
.
data
;
}).
then
((
res
)
=>
{
}).
then
((
access
)
=>
{
const
access
=
res
.
data
;
filename
=
`
${
access
.
dir
}${
getRandomFilename
(
filepath
)}
`
;
wx
.
showLoading
({
wx
.
showLoading
({
title
:
'图片上传中'
title
:
'图片上传中'
})
})
fileName
=
access
.
path
;
return
wxUploadFile
({
return
wxUploadFile
({
url
:
access
.
host
,
url
:
access
.
host
,
formData
:
{
formData
:
{
key
:
filename
,
key
:
access
.
path
,
policy
:
access
.
policy
,
policy
:
access
.
policy
,
OSSAccessKeyId
:
access
.
accessid
,
OSSAccessKeyId
:
access
.
accessid
,
signature
:
access
.
signature
,
signature
:
access
.
signature
,
...
@@ -235,7 +248,7 @@ Page({
...
@@ -235,7 +248,7 @@ Page({
})
})
this
.
mycropper
=
null
;
this
.
mycropper
=
null
;
this
.
setData
({
this
.
setData
({
'userInfo.avatar'
:
file
n
ame
,
'userInfo.avatar'
:
file
N
ame
,
})
})
}
else
{
}
else
{
wx
.
hideLoading
();
wx
.
hideLoading
();
...
...
src/pages/setting/userinfoupdate.wxml
View file @
80a0d76d
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<view class="listitem">
<view class="listitem">
<text class="listtitle">头像</text>
<text class="listtitle">头像</text>
<view class="listcontent" bindtap="proMainImgUpload">
<view class="listcontent" bindtap="proMainImgUpload">
<image class="avatar" src="{{filter.imagify(userInfo.avatar, 'image/resize,w_320/format,jpg/quality,q_50')}}" wx:if="{{userInfo.avatar}}"></image>
<image class="avatar"
mode="aspectFill"
src="{{filter.imagify(userInfo.avatar, 'image/resize,w_320/format,jpg/quality,q_50')}}" wx:if="{{userInfo.avatar}}"></image>
<image class="avatar" src="{{imageRoot}}2c/ucenter2/empty_avatar.png?{{imageVersion}}" wx:else></image>
<image class="avatar" src="{{imageRoot}}2c/ucenter2/empty_avatar.png?{{imageVersion}}" wx:else></image>
<image class="arrowsmall" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
<image class="arrowsmall" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view>
</view>
...
...
src/pages/teacherpclogin/index.js
View file @
80a0d76d
// src/pages/activityindex/index.js
// src/pages/activityindex/index.js
import
{
import
{
wxChooseImage
,
wxUploadFile
wxUploadFile
}
from
'../../../utilities/wxApi.js'
;
}
from
'../../../utilities/wxApi.js'
;
import
{
import
{
...
...
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