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
73936f54
Commit
73936f54
authored
Jun 18, 2021
by
Facius
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://git.banshouhui.com/lijundan/self-support
into dev
parents
018535cd
95c60b5e
Changes
32
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
115 additions
and
1454 deletions
+115
-1454
.env.js
.env.js
+4
-3
launch.json
.hbuilderx/launch.json
+5
-10
manifest.json
src/manifest.json
+2
-2
addSite.vue
src/pages/mine/address/addSite.vue
+102
-68
take.vue
src/pages/photo/take.vue
+1
-2
base.vue
src/pages/settle/base.vue
+1
-2
LICENSE.md
uniCloud-tcb/cloudfunctions/common/uni-id/LICENSE.md
+0
-201
config.json
uniCloud-tcb/cloudfunctions/common/uni-id/config.json
+0
-44
index.js
uniCloud-tcb/cloudfunctions/common/uni-id/index.js
+0
-1
package.json
uniCloud-tcb/cloudfunctions/common/uni-id/package.json
+0
-13
index.js
uniCloud-tcb/cloudfunctions/common/user-common/index.js
+0
-13
package.json
uniCloud-tcb/cloudfunctions/common/user-common/package.json
+0
-12
index.js
uniCloud-tcb/cloudfunctions/getGroupStandard/index.js
+0
-18
getGroupStandardV2.param.json
...unctions/getGroupStandardV2/getGroupStandardV2.param.json
+0
-10
index.js
uniCloud-tcb/cloudfunctions/getGroupStandardV2/index.js
+0
-56
package-lock.json
...d-tcb/cloudfunctions/getGroupStandardV2/package-lock.json
+0
-11
package.json
uniCloud-tcb/cloudfunctions/getGroupStandardV2/package.json
+0
-15
getRelationDictionary.param.json
...ns/getRelationDictionary/getRelationDictionary.param.json
+0
-9
index.js
uniCloud-tcb/cloudfunctions/getRelationDictionary/index.js
+0
-19
index.js
uniCloud-tcb/cloudfunctions/getRelationDictionaryV2/index.js
+0
-45
getUserWatermark.param.json
...oudfunctions/getUserWatermark/getUserWatermark.param.json
+0
-8
index.js
uniCloud-tcb/cloudfunctions/getUserWatermark/index.js
+0
-21
package-lock.json
...oud-tcb/cloudfunctions/getUserWatermark/package-lock.json
+0
-11
package.json
uniCloud-tcb/cloudfunctions/getUserWatermark/package.json
+0
-15
index.js
uniCloud-tcb/cloudfunctions/saveImage/index.js
+0
-19
package-lock.json
uniCloud-tcb/cloudfunctions/saveImage/package-lock.json
+0
-11
package.json
uniCloud-tcb/cloudfunctions/saveImage/package.json
+0
-15
index.js
uniCloud-tcb/cloudfunctions/saveUserWatermark/index.js
+0
-25
package-lock.json
...ud-tcb/cloudfunctions/saveUserWatermark/package-lock.json
+0
-11
package.json
uniCloud-tcb/cloudfunctions/saveUserWatermark/package.json
+0
-15
saveUserWatermark.param.json
...dfunctions/saveUserWatermark/saveUserWatermark.param.json
+0
-57
db_init.json
uniCloud-tcb/database/db_init.json
+0
-692
No files found.
.env.js
View file @
73936f54
(
function
()
{
(
function
()
{
let
NODE_ENV
=
'test'
;
// dev:开发环境 | test:测试环境 | prod:生产环境
let
NODE_ENV
=
'test'
;
// dev:开发环境 | test:测试环境 | prod:生产环境
let
ENV_VAR
=
null
;
let
ENV_VAR
=
null
;
let
VERSION_NUMBER
=
'1.3.6'
;
//版本号
let
VERSION_NUMBER
=
'1.3.6'
;
//版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
if
(
NODE_ENV
===
'dev'
)
{
if
(
NODE_ENV
===
'dev'
)
{
ENV_VAR
=
require
(
'./.env.dev.js'
);
ENV_VAR
=
require
(
'./.env.dev.js'
);
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
}
else
if
(
NODE_ENV
===
'prod'
)
{
}
else
if
(
NODE_ENV
===
'prod'
)
{
ENV_VAR
=
require
(
'./.env.prod.js'
);
ENV_VAR
=
require
(
'./.env.prod.js'
);
}
}
ENV_VAR
[
'bmapAK'
]
=
'G1wPip2Oj62NnoUctXhiE1faZVHbeo2A'
;
}
else
if
(
process
.
env
.
NODE_ENV
===
"production"
)
{
}
else
if
(
process
.
env
.
NODE_ENV
===
"production"
)
{
if
(
NODE_ENV
===
'test'
)
{
if
(
NODE_ENV
===
'test'
)
{
ENV_VAR
=
require
(
'./.env.test.js'
);
ENV_VAR
=
require
(
'./.env.test.js'
);
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
process
.
uniEnv
=
{};
process
.
uniEnv
=
{};
process
.
uniEnv
[
'node_env'
]
=
NODE_ENV
;
process
.
uniEnv
[
'node_env'
]
=
NODE_ENV
;
process
.
uniEnv
[
'version_number'
]
=
VERSION_NUMBER
;
process
.
uniEnv
[
'version_number'
]
=
VERSION_NUMBER
;
process
.
uniEnv
[
'bmapAK'
]
=
'lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI'
;
for
(
let
key
in
ENV_VAR
)
{
for
(
let
key
in
ENV_VAR
)
{
process
.
uniEnv
[
key
]
=
ENV_VAR
[
key
];
process
.
uniEnv
[
key
]
=
ENV_VAR
[
key
];
}
}
...
...
.hbuilderx/launch.json
View file @
73936f54
...
@@ -2,15 +2,10 @@
...
@@ -2,15 +2,10 @@
//
launchtype项可配置值为local或remote
,
local代表前端连本地云函数,remote代表前端连云端云函数
//
launchtype项可配置值为local或remote
,
local代表前端连本地云函数,remote代表前端连云端云函数
"version"
:
"0.0"
,
"version"
:
"0.0"
,
"configurations"
:
[{
"configurations"
:
[{
"default"
:
"type"
:
"uniCloud"
,
{
"default"
:
{
"launchtype"
:
"remote"
"launchtype"
:
"local"
},
}
"mp-weixin"
:
}
{
"launchtype"
:
"remote"
},
"type"
:
"uniCloud"
}
]
]
}
}
src/manifest.json
View file @
73936f54
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
"sdkConfigs"
:
{}
"sdkConfigs"
:
{}
},
},
"uniStatistics"
:
{
"uniStatistics"
:
{
"enable"
:
tru
e
"enable"
:
fals
e
}
}
},
},
/*
SDK配置
*/
/*
SDK配置
*/
...
@@ -76,7 +76,7 @@
...
@@ -76,7 +76,7 @@
}
}
},
},
"uniStatistics"
:
{
"uniStatistics"
:
{
"enable"
:
tru
e
"enable"
:
fals
e
}
}
},
},
"mp-alipay"
:
{
"mp-alipay"
:
{
...
...
src/pages/mine/address/addSite.vue
View file @
73936f54
...
@@ -3,27 +3,31 @@
...
@@ -3,27 +3,31 @@
<w-navbar
:title=
"title"
></w-navbar>
<w-navbar
:title=
"title"
></w-navbar>
<view
class=
"top"
>
<view
class=
"top"
>
<view
class=
"item"
>
<view
class=
"item"
>
<view
class=
"left"
>
姓名
</view>
<view
class=
"left"
>
收货人
</view>
<input
disabled
v-model=
"name"
type=
"text"
placeholder-class=
"line"
placeholder=
"请填写姓名"
/>
<input
disabled
v-model=
"name"
type=
"text"
placeholder-class=
"line"
placeholder=
"请填写
收货人
姓名"
/>
</view>
</view>
<view
class=
"item"
>
<view
class=
"item"
>
<view
class=
"left"
>
电话
</view>
<view
class=
"left"
>
手机号码
</view>
<input
disabled
v-model=
"mobile"
type=
"text"
placeholder-class=
"line"
placeholder=
"请填写
电话
"
/>
<input
disabled
v-model=
"mobile"
type=
"text"
placeholder-class=
"line"
placeholder=
"请填写
收货人手机号
"
/>
</view>
</view>
<view
class=
"item address"
>
<view
class=
"left label"
>
地址
</view>
<view
class=
"item"
>
<textarea
v-model=
"address"
type=
"text"
placeholder-class=
"line"
placeholder=
"请填写地址"
/>
<view
class=
"left"
>
所在地区
</view>
<view
class=
"right"
@
tap=
"autoLocation"
>
<input
@
tap=
"showRegionPicker"
disabled
v-model=
"region"
type=
"text"
placeholder-class=
"line"
placeholder=
"省市区县、乡镇等"
/>
<u-icon
<u-icon
@
click=
"autoLocation"
class=
"right"
name=
"map"
label=
"定位"
label-size=
"24"
label-color=
"#2272FF"
/>
name=
"map"
color=
"#2272FF"
size=
"30"
label=
"自动定位"
label-size=
"24"
label-color=
"#2272FF"
></u-icon>
</view>
</view>
</view>
<u-field
class=
"item-address"
v-model=
"address"
label=
"详细地址"
label-width=
"160"
placeholder=
"街道、楼牌等"
placeholder-style=
"color:#c0c4cc;"
type=
"textarea"
:auto-height=
"false"
:border-bottom=
"false"
>
</u-field>
</view>
</view>
<view
class=
"bottom"
>
<view
class=
"bottom"
>
<button
class=
"btn, bottom-btn"
@
click=
"show = true"
>
<button
class=
"btn, bottom-btn"
@
click=
"show = true"
>
...
@@ -37,6 +41,7 @@
...
@@ -37,6 +41,7 @@
<view
class=
"right"
><switch
color=
"red"
@
change=
"setDefault"
/></view>
<view
class=
"right"
><switch
color=
"red"
@
change=
"setDefault"
/></view>
</view>
-->
</view>
-->
</view>
</view>
<u-picker
mode=
"region"
ref=
"uPicker"
v-model=
"showPicker"
:params=
"params"
@
confirm=
"confirmRegion"
/>
<u-popup
<u-popup
border-radius=
"12"
border-radius=
"12"
width=
"690"
width=
"690"
...
@@ -65,7 +70,7 @@
...
@@ -65,7 +70,7 @@
<
script
>
<
script
>
let
r
=
require
(
"libs/bmap-wx.min.js"
);
let
r
=
require
(
"libs/bmap-wx.min.js"
);
let
h
=
new
r
.
BMapWX
({
let
h
=
new
r
.
BMapWX
({
ak
:
"lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
ak
:
process
.
uniEnv
.
bmapAK
});
});
export
default
{
export
default
{
data
()
{
data
()
{
...
@@ -78,6 +83,14 @@ export default {
...
@@ -78,6 +83,14 @@ export default {
name
:
'--'
,
name
:
'--'
,
mobile
:
''
,
mobile
:
''
,
settled
:
null
,
settled
:
null
,
region
:
[],
regionObj
:
[],
showPicker
:
false
,
params
:
{
province
:
true
,
city
:
true
,
area
:
true
},
};
};
},
},
computed
:
{},
computed
:
{},
...
@@ -103,19 +116,13 @@ export default {
...
@@ -103,19 +116,13 @@ export default {
callback
(
this
,
this
.
vuex_settled
)
callback
(
this
,
this
.
vuex_settled
)
}
}
getApp
().
getBaseInfo
(
this
,
callback
);
getApp
().
getBaseInfo
(
this
,
callback
);
this
.
initLocation
()
},
},
/**
showRegionPicker
()
{
* 初始化位置
this
.
showPicker
=
true
*/
},
initLocation
()
{
confirmRegion
(
params
)
{
const
self
=
this
this
.
regionObj
=
params
uni
.
getLocation
({
this
.
region
=
params
.
province
.
label
+
params
.
city
.
label
+
params
.
area
.
label
type
:
'wgs84'
,
success
:
function
(
res
)
{
self
.
baiduLocation
(
res
.
longitude
,
res
.
latitude
)
}
});
},
},
/**
/**
* 百度定位
* 百度定位
...
@@ -123,25 +130,28 @@ export default {
...
@@ -123,25 +130,28 @@ export default {
* @param {Object} lat
* @param {Object} lat
*/
*/
baiduLocation
(
long
,
lat
)
{
baiduLocation
(
long
,
lat
)
{
let
self
=
this
,
console
.
log
(
"11111111111"
,
this
.
title
)
t
=
function
()
{
let
t
=
{
let
t
=
{
success
:
(
res
)
=>
{
success
:
function
(
res
)
{
console
.
log
(
'success:'
,
res
)
let
e
=
res
.
wxMarkerData
[
0
];
let
e
=
res
.
wxMarkerData
[
0
];
let
i
=
e
.
address
;
let
i
=
e
.
address
;
self
.
location
=
i
this
.
location
=
i
;
},
},
fail
:
function
(
error
)
{
fail
:
(
res
)
=>
{
// n.error(a), console.log(a);
console
.
log
(
'fail:'
,
res
)
}
}
};
}
if
(
lat
&&
long
)
{
if
(
lat
&&
long
)
{
let
e
=
lat
+
","
+
long
let
e
=
lat
+
","
+
long
t
.
location
=
e
;
t
.
location
=
e
}
// t.coordtype = 'wgs84'
h
.
regeocoding
(
t
);
// t.latitude = lat
};
// t.longitude = long
t
()
console
.
log
(
'regeocoding:'
,
t
)
h
.
regeocoding
(
t
);
}
},
},
/**
/**
...
@@ -150,8 +160,8 @@ export default {
...
@@ -150,8 +160,8 @@ export default {
autoLocation
()
{
autoLocation
()
{
let
that
=
this
let
that
=
this
uni
.
chooseLocation
({
uni
.
chooseLocation
({
success
:
function
(
res
)
{
success
:
(
res
)
=>
{
th
at
.
address
=
res
.
address
+
res
.
name
th
is
.
baiduLocation
(
res
.
longitude
,
res
.
latitude
)
},
},
fail
:
function
(
res
)
{
fail
:
function
(
res
)
{
// uni.showToast({
// uni.showToast({
...
@@ -199,33 +209,57 @@ export default {
...
@@ -199,33 +209,57 @@ export default {
color
:
#333333
;
color
:
#333333
;
line-height
:
88rpx
;
line-height
:
88rpx
;
align-items
:
center
;
align-items
:
center
;
border-bottom
:
solid
2rpx
$u-border-color
;
border-bottom
:
solid
2rpx
#F4F5F7
;
.left
{
.left
{
width
:
88
rpx
;
width
:
160
rpx
;
color
:
#999999
;
color
:
#999999
;
}
}
input
{
input
{
text-align
:
left
;
text-align
:
left
;
flex
:
auto
;
}
}
}
.textarea
{
.address
{
padding
:
24rpx
0
;
align-items
:
flex-start
;
textarea
{
height
:
240rpx
;
background-color
:
#f7f7f7
;
line-height
:
60rpx
;
padding
:
20rpx
;
width
:
400rpx
;
}
}
.right
{
.right
{
text-align
:
right
;
margin-left
:
30rpx
;
width
:
160rpx
;
font-size
:
30rpx
;
font-size
:
24rpx
;
font-weight
:
400
;
font-weight
:
400
;
color
:
#2272FF
;
color
:
#2272FF
;
line-height
:
88rpx
;
}
}
.item-address
{
height
:
168rpx
;
width
:
auto
;
flex
:
auto
;
/
deep
/
.u-field
{
padding
:
0
;
padding-top
:
30rpx
;
border-bottom
:
solid
2rpx
#F4F5F7
;
.u-label
{
color
:
#999999
;
line-height
:
normal
;
}
.fild-body
{
font-size
:
28rpx
;
font-weight
:
400
;
color
:
#333333
;
textarea
{
line-height
:
normal
;
height
:
98rpx
;
}
}
.fild-body
>
view
{
margin
:
4rpx
8rpx
0
0
!
important
;
}
.right
{
margin-left
:
30rpx
;
font-size
:
30rpx
;
font-weight
:
400
;
color
:
#2272FF
;
align-self
:
top
;
}
}
}
}
}
}
}
...
...
src/pages/photo/take.vue
View file @
73936f54
...
@@ -42,8 +42,7 @@
...
@@ -42,8 +42,7 @@
<
script
>
<
script
>
let
r
=
require
(
"../../libs/bmap-wx.min.js"
);
let
r
=
require
(
"../../libs/bmap-wx.min.js"
);
let
h
=
new
r
.
BMapWX
({
let
h
=
new
r
.
BMapWX
({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak
:
process
.
uniEnv
.
bmapAK
ak
:
"lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
});
});
import
standard
from
'@/components/photo/standard.vue'
import
standard
from
'@/components/photo/standard.vue'
export
default
{
export
default
{
...
...
src/pages/settle/base.vue
View file @
73936f54
...
@@ -81,8 +81,7 @@
...
@@ -81,8 +81,7 @@
let
r
=
require
(
"../../libs/bmap-wx.min.js"
);
let
r
=
require
(
"../../libs/bmap-wx.min.js"
);
let
h
=
new
r
.
BMapWX
({
let
h
=
new
r
.
BMapWX
({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak
:
process
.
uniEnv
.
bmapAK
ak
:
"lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
});
});
export
default
{
export
default
{
components
:
{
components
:
{
...
...
uniCloud-tcb/cloudfunctions/common/uni-id/LICENSE.md
deleted
100644 → 0
View file @
018535cd
This diff is collapsed.
Click to expand it.
uniCloud-tcb/cloudfunctions/common/uni-id/config.json
deleted
100644 → 0
View file @
018535cd
{
"passwordSecret"
:
"passwordSecret-demo"
,
"tokenSecret"
:
"tokenSecret-demo"
,
"tokenExpiresIn"
:
7200
,
"tokenExpiresThreshold"
:
600
,
"passwordErrorLimit"
:
6
,
"bindTokenToDevice"
:
true
,
"passwordErrorRetryTime"
:
3600
,
"autoSetInviteCode"
:
false
,
"forceInviteCode"
:
false
,
"app-plus"
:
{
"tokenExpiresIn"
:
2592000
,
"oauth"
:
{
"weixin"
:
{
"appid"
:
"weixin appid"
,
"appsecret"
:
"weixin appsecret"
}
}
},
"mp-weixin"
:
{
"oauth"
:
{
"weixin"
:
{
"appid"
:
"weixin appid"
,
"appsecret"
:
"weixin appsecret"
}
}
},
"mp-alipay"
:
{
"oauth"
:
{
"alipay"
:
{
"appid"
:
"alipay appid"
,
"privateKey"
:
"alipay privateKey"
}
}
},
"service"
:
{
"sms"
:
{
"name"
:
"DCloud"
,
"codeExpiresIn"
:
300
,
"smsKey"
:
"your sms key"
,
"smsSecret"
:
"your sms secret"
}
}
}
uniCloud-tcb/cloudfunctions/common/uni-id/index.js
deleted
100644 → 0
View file @
018535cd
This diff is collapsed.
Click to expand it.
uniCloud-tcb/cloudfunctions/common/uni-id/package.json
deleted
100644 → 0
View file @
018535cd
{
"name"
:
"uni-id"
,
"version"
:
"2.0.3"
,
"description"
:
"uni-id for uniCloud"
,
"main"
:
"index.js"
,
"homepage"
:
"https://uniapp.dcloud.io/uniCloud/uni-id"
,
"repository"
:
{
"type"
:
"git"
,
"url"
:
"git+https://gitee.com/dcloud/uni-id.git"
},
"author"
:
""
,
"license"
:
"Apache-2.0"
}
\ No newline at end of file
uniCloud-tcb/cloudfunctions/common/user-common/index.js
deleted
100644 → 0
View file @
018535cd
async
function
getUserId
(
token
)
{
const
res
=
await
uniCloud
.
httpclient
.
request
(
"https://system.dev.banshouhui.com/wxh-worker-rest/rest/"
+
token
+
"/myinfo/id"
,
{
method
:
'GET'
,
dataType
:
'text'
})
return
res
&&
res
.
status
===
200
?
res
.
data
:
token
}
module
.
exports
=
{
getUserId
}
uniCloud-tcb/cloudfunctions/common/user-common/package.json
deleted
100644 → 0
View file @
018535cd
{
"name"
:
"user-common"
,
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
"keywords"
:
[],
"author"
:
""
,
"license"
:
"ISC"
}
uniCloud-tcb/cloudfunctions/getGroupStandard/index.js
deleted
100644 → 0
View file @
018535cd
'use strict'
;
exports
.
main
=
async
(
event
,
context
)
=>
{
const
db
=
uniCloud
.
database
();
let
res
=
await
db
.
collection
(
"standard"
).
where
(
event
).
get
();
let
data
=
res
.
data
const
map
=
new
Map
()
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
){
let
key
=
data
[
i
].
type
if
(
map
.
has
(
key
)){
data
[
i
].
images
=
data
[
i
].
images
.
split
(
","
)
map
.
get
(
key
).
list
.
push
(
data
[
i
])
}
else
{
data
[
i
].
images
=
data
[
i
].
images
.
split
(
","
)
map
.
set
(
key
,{
type
:
key
,
list
:[
data
[
i
]]})
}
}
return
[...
map
.
values
()]
};
uniCloud-tcb/cloudfunctions/getGroupStandardV2/getGroupStandardV2.param.json
deleted
100644 → 0
View file @
018535cd
//
本文件中的json内容将在云函数【运行】时作为参数传给云函数。
//
配置教程参考:https
:
//uniapp.dcloud.net.cn/uniCloud/quickstart?id=runparam
{
"token"
:
"RTOKENeb70458c5502c48838d5e4cf84900767fa010f00"
,
"classify_id"
:
"79550af260555cc20afb34146966a2c4"
,
"system_id"
:
"79550af260555cc20afb34156c94b32c"
,
"brand_id"
:
"28ee4e3e6063f2880d8956a013293a7f"
}
uniCloud-tcb/cloudfunctions/getGroupStandardV2/index.js
deleted
100644 → 0
View file @
018535cd
'use strict'
;
const
{
getUserId
}
=
require
(
'user-common'
)
exports
.
main
=
async
(
event
,
context
)
=>
{
const
db
=
uniCloud
.
database
();
const
_
=
db
.
command
const
$
=
db
.
command
.
aggregate
const
user_id
=
await
getUserId
(
event
.
token
)
let
res
=
await
db
.
collection
(
"standardV2"
).
aggregate
().
lookup
({
from
:
'user_upload_file'
,
let
:
{
standard_id
:
'$_id'
},
pipeline
:
$
.
pipeline
()
.
match
(
_
.
expr
(
$
.
and
([
$
.
eq
([
'$standard_id'
,
'$$standard_id'
]),
$
.
eq
([
'$user_id'
,
user_id
])
]))).
sort
({
create_date
:
-
1
}).
limit
(
10
)
.
project
({
"_id"
:
0
,
"url"
:
1
,
})
.
done
(),
as
:
'imageList'
}).
match
({
"classify_id"
:
event
.
classify_id
,
"system_id"
:
event
.
system_id
,
"brand_id"
:
event
.
brand_id
}).
limit
(
100
).
end
()
const
watermarkC
=
uniCloud
.
database
().
collection
(
"user_watermark"
).
field
({
'_id'
:
false
})
let
userWatermark
=
await
watermarkC
.
where
({
user_id
:
user_id
,
system_id
:
event
.
system_id
}).
get
()
if
(
!
userWatermark
.
data
||
userWatermark
.
data
.
length
<=
0
)
{
// 用户没有 获取模板
userWatermark
=
await
watermarkC
.
where
({
system_id
:
event
.
system_id
}).
get
()
}
let
userWatermarkData
=
userWatermark
.
data
[
0
]
let
data
=
res
.
data
const
map
=
new
Map
()
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
data
[
i
].
imageList
=
data
[
i
].
imageList
.
map
(
a
=>
a
.
url
)
let
key
=
data
[
i
].
type
if
(
map
.
has
(
key
))
{
data
[
i
].
images
=
data
[
i
].
images
.
split
(
","
)
map
.
get
(
key
).
list
.
push
(
data
[
i
])
}
else
{
data
[
i
].
images
=
data
[
i
].
images
.
split
(
","
)
map
.
set
(
key
,
{
type
:
key
,
userWatermark
:
userWatermarkData
,
list
:
[
data
[
i
]]
})
}
}
return
[...
map
.
values
()]
};
uniCloud-tcb/cloudfunctions/getGroupStandardV2/package-lock.json
deleted
100644 → 0
View file @
018535cd
{
"name"
:
"getGroupStandardV2"
,
"version"
:
"1.0.0"
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"dependencies"
:
{
"user-common"
:
{
"version"
:
"file:../common/user-common"
}
}
}
uniCloud-tcb/cloudfunctions/getGroupStandardV2/package.json
deleted
100644 → 0
View file @
018535cd
{
"name"
:
"getGroupStandardV2"
,
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
"keywords"
:
[],
"author"
:
""
,
"license"
:
"ISC"
,
"dependencies"
:
{
"user-common"
:
"file:../common/user-common"
}
}
uniCloud-tcb/cloudfunctions/getRelationDictionary/getRelationDictionary.param.json
deleted
100644 → 0
View file @
018535cd
//
本文件中的json内容将在云函数【运行】时作为参数传给云函数。
//
配置教程参考:https
:
//uniapp.dcloud.net.cn/uniCloud/quickstart?id=runparam
{
"classify_id"
:
"79550af260555cc20afb34146966a2c4"
,
"system_id"
:
"79550af260555cc20afb34156c94b32c"
,
"field"
:
"brand_id"
}
uniCloud-tcb/cloudfunctions/getRelationDictionary/index.js
deleted
100644 → 0
View file @
018535cd
'use strict'
;
exports
.
main
=
async
(
event
,
context
)
=>
{
const
param
=
{
"classify_id"
:
event
.
classify_id
,
"system_id"
:
event
.
system_id
,
"brand_id"
:
event
.
brand_id
}
const
db
=
uniCloud
.
database
()
let
res
=
await
db
.
collection
(
"standardV2"
).
aggregate
().
match
(
param
).
group
({
_id
:
"$"
+
event
.
field
}).
end
();
res
=
await
db
.
collection
(
'dictionary'
).
field
({
"_id"
:
true
,
"name"
:
true
}).
where
({
_id
:
db
.
command
.
in
(
Array
.
from
(
res
.
data
,
item
=>
item
.
_id
))
}).
get
()
return
res
.
data
};
uniCloud-tcb/cloudfunctions/getRelationDictionaryV2/index.js
deleted
100644 → 0
View file @
018535cd
'use strict'
;
exports
.
main
=
async
(
event
,
context
)
=>
{
//event为客户端上传的参数
const
db
=
uniCloud
.
database
()
let
res
=
await
db
.
collection
(
"standardV2"
).
field
({
"classify_id"
:
true
,
"system_id"
:
true
,
"brand_id"
:
true
}).
get
();
let
data
=
{}
let
id
=
[]
res
.
data
.
map
(
item
=>
{
id
.
push
(
item
.
classify_id
)
id
.
push
(
item
.
system_id
)
id
.
push
(
item
.
brand_id
)
if
(
data
[
item
.
classify_id
])
{
if
(
data
[
item
.
classify_id
][
item
.
system_id
])
{
if
(
data
[
item
.
classify_id
][
item
.
system_id
].
indexOf
(
item
.
brand_id
)
<
0
)
data
[
item
.
classify_id
][
item
.
system_id
].
push
(
item
.
brand_id
)
}
else
{
data
[
item
.
classify_id
][
item
.
system_id
]
=
[
item
.
brand_id
]
}
}
else
{
let
obj
=
{}
obj
[
item
.
system_id
]
=
[
item
.
brand_id
]
data
[
item
.
classify_id
]
=
obj
}
})
let
dic
=
await
db
.
collection
(
"dictionary"
).
where
({
_id
:
db
.
command
.
in
(
id
)
}).
get
()
let
dic_data
=
{}
dic
.
data
.
map
(
item
=>
{
dic_data
[
item
.
_id
]
=
item
.
name
})
let
result
=
[]
for
(
let
first
in
data
)
{
let
secondArr
=
[]
for
(
let
second
in
data
[
first
])
{
let
thirdArr
=
[]
data
[
first
][
second
].
map
(
third
=>
{
thirdArr
.
push
({
id
:
third
,
name
:
dic_data
[
third
]})
})
secondArr
.
push
({
id
:
second
,
name
:
dic_data
[
second
],
child
:
thirdArr
})
}
result
.
push
({
id
:
first
,
name
:
dic_data
[
first
],
child
:
secondArr
})
}
return
result
;
};
uniCloud-tcb/cloudfunctions/getUserWatermark/getUserWatermark.param.json
deleted
100644 → 0
View file @
018535cd
//
本文件中的json内容将在云函数【运行】时作为参数传给云函数。
//
配置教程参考:https
:
//uniapp.dcloud.net.cn/uniCloud/quickstart?id=runparam
{
"token"
:
"fdsadfsafsafsadfdsa"
,
"system_id"
:
"79550af260555cc20afb34156c94b32c"
}
uniCloud-tcb/cloudfunctions/getUserWatermark/index.js
deleted
100644 → 0
View file @
018535cd
'use strict'
;
const
{
getUserId
}
=
require
(
'user-common'
)
exports
.
main
=
async
(
event
,
context
)
=>
{
//event为客户端上传的参数
const
user_id
=
await
getUserId
(
event
.
token
)
const
collection
=
uniCloud
.
database
().
collection
(
"user_watermark"
).
field
({
'_id'
:
false
})
let
res
=
await
collection
.
where
({
user_id
:
user_id
,
system_id
:
event
.
system_id
}).
get
()
if
(
!
res
.
data
||
res
.
data
.
length
<=
0
)
{
// 用户没有 获取模板
res
=
await
collection
.
where
({
system_id
:
event
.
system_id
}).
get
()
}
return
res
.
data
[
0
]
};
uniCloud-tcb/cloudfunctions/getUserWatermark/package-lock.json
deleted
100644 → 0
View file @
018535cd
{
"name"
:
"getUserWatermark"
,
"version"
:
"1.0.0"
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"dependencies"
:
{
"user-common"
:
{
"version"
:
"file:../common/user-common"
}
}
}
uniCloud-tcb/cloudfunctions/getUserWatermark/package.json
deleted
100644 → 0
View file @
018535cd
{
"name"
:
"getUserWatermark"
,
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
"keywords"
:
[],
"author"
:
""
,
"license"
:
"ISC"
,
"dependencies"
:
{
"user-common"
:
"file:../common/user-common"
}
}
uniCloud-tcb/cloudfunctions/saveImage/index.js
deleted
100644 → 0
View file @
018535cd
'use strict'
;
const
{
getUserId
}
=
require
(
'user-common'
)
exports
.
main
=
async
(
event
,
context
)
=>
{
//event为客户端上传的参数
let
workerId
=
await
getUserId
(
event
.
token
)
if
(
workerId
)
{
await
uniCloud
.
database
().
collection
(
"user_upload_file"
).
add
({
"user_id"
:
workerId
,
"standard_id"
:
event
.
standardId
,
url
:
"https://img2.banshouhui.com/"
+
event
.
url
,
create_date
:
new
Date
()
})
return
true
}
return
false
};
uniCloud-tcb/cloudfunctions/saveImage/package-lock.json
deleted
100644 → 0
View file @
018535cd
{
"name"
:
"saveImage"
,
"version"
:
"1.0.0"
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"dependencies"
:
{
"user-common"
:
{
"version"
:
"file:../common/user-common"
}
}
}
uniCloud-tcb/cloudfunctions/saveImage/package.json
deleted
100644 → 0
View file @
018535cd
{
"name"
:
"saveImage"
,
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
"keywords"
:
[],
"author"
:
""
,
"license"
:
"ISC"
,
"dependencies"
:
{
"user-common"
:
"file:../common/user-common"
}
}
uniCloud-tcb/cloudfunctions/saveUserWatermark/index.js
deleted
100644 → 0
View file @
018535cd
'use strict'
;
const
{
getUserId
}
=
require
(
'user-common'
)
exports
.
main
=
async
(
event
,
context
)
=>
{
let
user_id
=
await
getUserId
(
event
.
token
)
console
.
log
(
user_id
);
const
watermark
=
event
.
watermark
if
(
user_id
)
{
watermark
.
user_id
=
user_id
const
collection
=
uniCloud
.
database
().
collection
(
"user_watermark"
);
const
res
=
await
collection
.
where
({
user_id
:
user_id
,
system_id
:
watermark
.
system_id
}).
get
()
if
(
res
.
data
&&
res
.
data
.
length
>
0
)
{
await
collection
.
doc
(
res
.
data
[
0
].
_id
).
update
(
watermark
)
}
else
{
await
collection
.
add
(
watermark
)
}
}
//返回数据给客户端
return
true
};
uniCloud-tcb/cloudfunctions/saveUserWatermark/package-lock.json
deleted
100644 → 0
View file @
018535cd
{
"name"
:
"saveUserWatermark"
,
"version"
:
"1.0.0"
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"dependencies"
:
{
"user-common"
:
{
"version"
:
"file:../common/user-common"
}
}
}
uniCloud-tcb/cloudfunctions/saveUserWatermark/package.json
deleted
100644 → 0
View file @
018535cd
{
"name"
:
"saveUserWatermark"
,
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
"keywords"
:
[],
"author"
:
""
,
"license"
:
"ISC"
,
"dependencies"
:
{
"user-common"
:
"file:../common/user-common"
}
}
uniCloud-tcb/cloudfunctions/saveUserWatermark/saveUserWatermark.param.json
deleted
100644 → 0
View file @
018535cd
{
"token"
:
"fdsadfsafsafsadfdsa"
,
"watermark"
:
{
"has_origin"
:
true
,
"lower_right"
:
{
"body"
:
[{
"enable"
:
true
,
"watemark_text"
:
"时间"
,
"watemark_type"
:
"时间"
,
"watemark_value"
:
""
},
{
"enable"
:
true
,
"watemark_text"
:
"地址"
,
"watemark_type"
:
"地址"
,
"watemark_value"
:
""
},
{
"enable"
:
true
,
"watemark_text"
:
"经度"
,
"watemark_type"
:
"经度"
,
"watemark_value"
:
""
},
{
"enable"
:
true
,
"watemark_text"
:
"纬度"
,
"watemark_type"
:
"纬度"
,
"watemark_value"
:
""
},
{
"enable"
:
false
,
"watemark_text"
:
""
,
"watemark_type"
:
"备注"
,
"watemark_value"
:
""
},
{
"watemark_value"
:
"蓝天工程队3"
,
"enable"
:
true
,
"watemark_text"
:
"工程队名称3"
,
"watemark_type"
:
"备注"
},
{
"enable"
:
true
,
"watemark_text"
:
"10000"
,
"watemark_type"
:
"备注"
,
"watemark_value"
:
"111111"
},
{
"enable"
:
false
,
"watemark_text"
:
""
,
"watemark_type"
:
"备注"
,
"watemark_value"
:
""
},
{
"enable"
:
false
,
"watemark_text"
:
""
,
"watemark_type"
:
"备注"
,
"watemark_value"
:
""
}]
},
"mid_text"
:
"现场拍照"
,
"system_id"
:
"79550af260555cc20afb34156c94b32c"
,
"user_id"
:
"fdsadfsafsafsadfdsa"
}
}
\ No newline at end of file
uniCloud-tcb/database/db_init.json
deleted
100644 → 0
View file @
018535cd
This diff is collapsed.
Click to expand it.
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