Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
op-web-service
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
bp
op-web-service
Commits
4f5f1b64
Commit
4f5f1b64
authored
Aug 31, 2021
by
gengshaojing
Browse files
Options
Browse Files
Download
Plain Diff
fix: 合并hotfix
parents
354158d0
c9861793
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
18001 additions
and
18217 deletions
+18001
-18217
package-lock.json
package-lock.json
+15447
-15418
index.html
public/index.html
+2
-0
relay.js
server/controllers/relay.js
+93
-0
router.js
server/router.js
+6
-0
request.js
server/utils/request.js
+35
-25
index.vue
src/pages/Activity/ActivityDetail/index.vue
+267
-295
addProduc.vue
src/pages/Activity/releaseProduc/components/addProduc.vue
+631
-769
infoEditing.vue
src/pages/Activity/releaseProduc/components/infoEditing.vue
+142
-151
myMap.vue
src/pages/Activity/releaseProduc/components/myMap.vue
+256
-244
index.vue
src/pages/Goods/Detail/index.vue
+1073
-1272
groupmeal.js
src/service/Groupmeal/groupmeal.js
+17
-14
util.js
src/utils/util.js
+32
-29
No files found.
package-lock.json
View file @
4f5f1b64
This diff is collapsed.
Click to expand it.
public/index.html
View file @
4f5f1b64
...
...
@@ -16,6 +16,8 @@
<
%
for
(
let
i
in
htmlWebpackPlugin
.
options
.
cdn
&&
htmlWebpackPlugin
.
options
.
cdn
.
js
)
{
%
>
<script
src=
"<%= htmlWebpackPlugin.options.cdn.js[i] %>"
></script>
<
%
}
%
>
<script
src=
"//webapi.amap.com/maps?v=1.3&key=bb057625545d8cf77df1379e7aaae0b5"
></script>
<script
src=
"//webapi.amap.com/ui/1.0/main.js"
></script>
<title><
%=
htmlWebpackPlugin
.
options
.
title
%
></title>
</head>
...
...
server/controllers/relay.js
0 → 100644
View file @
4f5f1b64
const
fs
=
require
(
"fs"
);
const
API_INTERNAL_URI
=
require
(
"../config.js"
).
API_INTERNAL_URI
;
const
reqOther
=
require
(
"../utils/request"
).
httpReqOther
;
const
FormData
=
require
(
"form-data"
);
const
http
=
require
(
"http"
);
const
GROUPMEAL_URI
=
require
(
"../config.js"
).
GROUPMEAL_URI
;
exports
.
uploadPic
=
async
(
ctx
,
next
)
=>
{
const
url
=
`
${
API_INTERNAL_URI
}
/ksy/ks3apiunencrypt/ks3api_upload`
;
const
{
body
:
{
type
},
files
,
}
=
ctx
.
request
;
console
.
log
(
"type"
,
type
);
const
filePath
=
files
.
file
.
path
;
const
file
=
fs
.
createReadStream
(
filePath
);
const
form
=
new
FormData
();
form
.
append
(
"file"
,
file
);
form
.
append
(
"type"
,
type
);
const
opts
=
{
method
:
"post"
,
url
:
url
,
body
:
form
,
headers
:
form
.
getHeaders
(),
};
ctx
.
body
=
await
reqOther
(
opts
);
};
exports
.
oldOrderExport
=
async
(
ctx
)
=>
{
const
{
marketing_id
,
type
}
=
ctx
.
query
;
// `${ENV}order/oldbackground/order_export?marketing_id=${eventId}&type=${type}`;
const
url
=
`
${
GROUPMEAL_URI
}
/order/oldbackground/order_export?marketing_id=
${
marketing_id
}
&type=
${
type
}
`
;
console
.
log
(
"url"
,
url
);
const
options
=
new
URL
(
url
);
let
{
buffer
,
res
}
=
await
requestPromise
(
options
);
const
fileName
=
res
.
headers
[
"content-disposition"
].
split
(
"="
)[
1
];
ctx
.
set
(
"Content-Type"
,
"application/octet-stream"
);
ctx
.
set
(
"Content-Disposition"
,
`attachment; filename=
${
fileName
}
`
);
ctx
.
body
=
buffer
;
};
exports
.
orderExport
=
async
(
ctx
)
=>
{
const
{
marketing_id
,
type
}
=
ctx
.
query
;
const
url
=
`
${
GROUPMEAL_URI
}
/order/background/order_export?marketing_id=
${
marketing_id
}
&type=
${
type
}
`
;
console
.
log
(
"url"
,
url
);
const
options
=
new
URL
(
url
);
let
{
buffer
,
res
}
=
await
requestPromise
(
options
);
const
fileName
=
res
.
headers
[
"content-disposition"
].
split
(
"="
)[
1
];
ctx
.
set
(
"Content-Type"
,
"application/octet-stream"
);
ctx
.
set
(
"Content-Disposition"
,
`attachment; filename=
${
fileName
}
`
);
ctx
.
body
=
buffer
;
};
function
requestPromise
(
options
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
const
req
=
http
.
request
(
options
,
function
(
res
)
{
let
{
statusCode
}
=
res
;
//返回不是200
if
(
statusCode
!==
200
)
{
return
reject
(
new
Error
(
"error"
));
}
let
arr
=
[];
let
len
=
0
;
res
.
on
(
"data"
,
(
chunk
)
=>
{
len
+=
chunk
.
length
;
arr
.
push
(
Buffer
.
from
(
chunk
));
});
res
.
on
(
"end"
,
()
=>
{
//正确 success
return
resolve
({
buffer
:
Buffer
.
concat
(
arr
,
len
),
res
,
});
});
});
//请求出错
req
.
on
(
"error"
,
(
err
)
=>
{
return
reject
(
err
);
});
req
.
end
();
});
}
server/router.js
View file @
4f5f1b64
...
...
@@ -10,6 +10,7 @@ const activity = require("./controllers/activity");
const
withdrawal
=
require
(
"./controllers/withdrawal"
);
const
groupmeal
=
require
(
"./controllers/groupmeal"
);
const
qr_code
=
require
(
"./controllers/qr-code"
);
const
relay
=
require
(
"./controllers/relay"
);
const
router
=
Router
();
const
API_VERSION
=
"/api/v1"
;
...
...
@@ -130,4 +131,9 @@ router.post(`${API_VERSION}/get_reblack_list`, withdrawal.getReblackList);
router
.
get
(
`
${
API_VERSION
}
/get_wallet_account_status`
,
withdrawal
.
getWalletAccountStatus
);
router
.
post
(
`
${
API_VERSION
}
/reset_wallet_account_status`
,
withdrawal
.
resetAccountStatus
);
// 图片上传
router
.
post
(
`
${
API_VERSION
}
/relay/ks3api_upload`
,
relay
.
uploadPic
);
router
.
get
(
`
${
API_VERSION
}
/relay/order_export`
,
relay
.
orderExport
);
router
.
get
(
`
${
API_VERSION
}
/relay/old_order_export`
,
relay
.
oldOrderExport
);
module
.
exports
=
router
;
server/utils/request.js
View file @
4f5f1b64
...
...
@@ -11,17 +11,13 @@ exports.httpReq = (ctx, opts) => {
version
:
"999999"
,
distribution
:
"op"
,
net
:
"wifi"
,
platform
:
"2"
platform
:
"2"
,
};
opts
.
qs
=
{
...
defaultQs
,
...
ctx
.
request
.
query
,
...
opts
.
qs
};
request
(
opts
,
(
err
,
res
,
body
)
=>
{
console
.
info
(
`[Api] httpReq (
${
opts
.
url
}
, user:[
${
opts
.
qs
.
op_cur_user
}
]) spent:
${
+
new
Date
()
-
time_start
}
ms`
);
console
.
info
(
`[Api] httpReq (
${
opts
.
url
}
, user:[
${
opts
.
qs
.
op_cur_user
}
]) spent:
${
+
new
Date
()
-
time_start
}
ms`
);
if
(
!
err
)
{
resolve
(
body
);
...
...
@@ -32,3 +28,17 @@ exports.httpReq = (ctx, opts) => {
});
});
};
exports
.
httpReqOther
=
(
opts
)
=>
{
opts
.
timeout
=
opts
.
timeout
||
10000
;
return
new
Promise
((
resolve
,
reject
)
=>
{
request
(
opts
,
(
err
,
res
,
body
)
=>
{
if
(
!
err
)
{
resolve
(
body
);
}
else
{
reject
(
err
);
console
.
error
(
opts
.
url
,
err
);
}
});
});
};
src/pages/Activity/ActivityDetail/index.vue
View file @
4f5f1b64
...
...
@@ -44,9 +44,9 @@
<h3>
{{
marketingInfo
.
marketing_name
}}
</h3>
<!-- 查看参与字段待确认 -->
<p>
<span>
{{
detailInfo
.
lookUserCount
}}
人查看
</span>
|
<span
>
{{
detailInfo
.
haveBuyGoodsUserCount
}}
人参与
</span
>
<span>
{{
detailInfo
.
lookUserCount
}}
人查看
</span>
|
<span>
{{
detailInfo
.
haveBuyGoodsUserCount
}}
人参与
</span
>
</p>
<p
class=
"endTime"
>
{{
showTimer
}}
</p>
</div>
...
...
@@ -82,11 +82,7 @@
><
/el-image
>
<
/el-card
>
<
el
-
card
class
=
"activities box-card"
>
<
div
v
-
for
=
"goodsItem in goodsList"
:
key
=
"goodsItem.goods_sku_id"
class
=
"activityItem"
>
<
div
v
-
for
=
"goodsItem in goodsList"
:
key
=
"goodsItem.goods_sku_id"
class
=
"activityItem"
>
<
el
-
image
class
=
"activityImage"
style
=
"width: 100px; height: 100px"
...
...
@@ -97,15 +93,8 @@
<
p
>
{{
goodsItem
.
goods_name
}}
<
/p
>
<
p
class
=
"price"
>
<
span
class
=
"nowPrice"
>
{{
`¥${goodsItem.price
}
`
}}
<
/span
>
<
span
class
=
"originPrice"
>
{{
`¥${goodsItem.original_price
}
`
}}
<
/span
>
<
span
class
=
"sold"
v
-
if
=
"goodsItem.inventory_rest == 0"
>
抢光了
<
/spa
n
>
<
span
class
=
"sold"
v
-
else
>
已售
{{
goodsItem
.
all_have_buy_goods_count
}}
<
/spa
n
>
<
span
class
=
"originPrice"
>
{{
`¥${goodsItem.original_price
}
`
}}
<
/span
>
<
span
class
=
"sold"
>
已售
{{
goodsItem
.
all_have_buy_goods_count
}}
<
/span
>
<
/p
>
<
/div
>
<
/div
>
...
...
@@ -113,23 +102,17 @@
<
/section
>
<
/div
>
<
div
class
=
"button-close"
>
<
el
-
button
class
=
"button-block"
size
=
"medium"
type
=
"primary"
@
click
=
"closePage"
>
关
闭
<
/el-butto
n
>
<
el
-
button
class
=
"button-block"
size
=
"medium"
type
=
"primary"
@
click
=
"closePage"
>
关
闭
<
/el-button
>
<
/div
>
<
/div
>
<
/template
>
<
script
>
import
ActivityService
from
"@/service/Activity/index"
;
import
{
ElMessage
}
from
"element-plus"
;
import
dayJs
from
"dayjs"
;
import
ActivityService
from
"@/service/Activity/index"
;
import
{
ElMessage
}
from
"element-plus"
;
import
dayJs
from
"dayjs"
;
export
default
{
export
default
{
props
:
{
}
,
data
()
{
return
{
...
...
@@ -138,7 +121,7 @@ export default {
marketingInfo
:
{
}
,
endTime
:
""
,
showTimer
:
""
,
detailInfo
:
{
}
detailInfo
:
{
}
,
}
;
}
,
watch
:
{
}
,
...
...
@@ -150,11 +133,11 @@ export default {
let
dataArr
=
await
Promise
.
all
([
ActivityService
.
checkActivityDetail
({
marketing_id
:
this
.
$route
.
query
.
marketing_id
,
marketing_type
:
this
.
$route
.
query
.
marketing_type
marketing_type
:
this
.
$route
.
query
.
marketing_type
,
}
),
ActivityService
.
checkActivityDetailInfo
({
marketing_id
:
this
.
$route
.
query
.
marketing_id
}
)
marketing_id
:
this
.
$route
.
query
.
marketing_id
,
}
),
]);
this
.
pageLoading
=
false
;
this
.
goodsList
=
dataArr
[
0
].
result
.
goods_list
;
...
...
@@ -171,21 +154,10 @@ export default {
getTimeout
(
timeCount
)
{
if
(
timeCount
>
0
)
{
var
days
=
parseInt
(
timeCount
/
(
1000
*
60
*
60
*
24
));
var
hours
=
parseInt
(
(
timeCount
%
(
1000
*
60
*
60
*
24
))
/
(
1000
*
60
*
60
)
);
var
hours
=
parseInt
((
timeCount
%
(
1000
*
60
*
60
*
24
))
/
(
1000
*
60
*
60
));
var
minutes
=
parseInt
((
timeCount
%
(
1000
*
60
*
60
))
/
(
1000
*
60
));
var
seconds
=
parseInt
((
timeCount
%
(
1000
*
60
))
/
1000
);
this
.
showTimer
=
"距结束:"
+
days
+
" 天 "
+
hours
+
" 小时 "
+
minutes
+
" 分钟 "
+
seconds
+
" 秒 "
;
this
.
showTimer
=
"距结束:"
+
days
+
" 天 "
+
hours
+
" 小时 "
+
minutes
+
" 分钟 "
+
seconds
+
" 秒 "
;
}
else
{
this
.
showTimer
=
"已结束"
;
}
...
...
@@ -206,7 +178,7 @@ export default {
closePage
()
{
this
.
$router
.
go
(
-
1
);
}
}
,
}
,
async
created
()
{
await
this
.
checkActivityDetail
();
...
...
@@ -214,11 +186,11 @@ export default {
}
,
beforeUnmount
()
{
clearInterval
(
this
.
timer
);
}
}
;
}
,
}
;
<
/script
>
<
style
lang
=
"less"
scoped
>
.
wrapper
{
.
wrapper
{
height
:
100
%
;
display
:
flex
;
overflow
-
y
:
scroll
;
...
...
@@ -324,5 +296,5 @@ export default {
width
:
200
px
;
}
}
}
}
<
/style
>
src/pages/Activity/releaseProduc/components/addProduc.vue
View file @
4f5f1b64
This diff is collapsed.
Click to expand it.
src/pages/Activity/releaseProduc/components/infoEditing.vue
View file @
4f5f1b64
<
template
>
<div
class=
"infoEditing"
>
<el-form
ref=
"infoEditForm"
:model=
"infoEditForm"
label-width=
"80px"
@
submit
.
prevent
>
<el-form
ref=
"infoEditForm"
:model=
"infoEditForm"
label-width=
"80px"
@
submit
.
prevent
>
<el-form-item
label=
"标题:"
>
<el-input
v-model=
"infoEditForm.title"
maxlength=
"30"
></el-input>
</el-form-item>
<el-form-item
label=
"介绍:"
>
<el-input
type=
"textarea"
v-model=
"infoEditForm.desc"
maxlength=
"1000"
rows=
"4"
></el-input>
<el-input
type=
"textarea"
v-model=
"infoEditForm.desc"
maxlength=
"1000"
rows=
"4"
></el-input>
</el-form-item>
<el-form-item
label=
"图片:"
>
<el-upload
...
...
@@ -47,18 +37,19 @@
</template>
<
script
>
import
{
GOODS_URI
}
from
"../../../../../server/config"
;
export
default
{
import
{
UploadPicUrl
}
from
"@/utils/util"
;
export
default
{
props
:
{
infoEditArr
:
{
type
:
Object
,
default
:
()
=>
{
return
{
pindan_pic_url
:
[]
pindan_pic_url
:
[],
};
},
require
:
true
}
require
:
true
,
},
},
data
()
{
return
{
...
...
@@ -66,38 +57,38 @@ export default {
title
:
""
,
// 标题
desc
:
""
,
// 介绍
picUploadList
:
[],
// 上传详情图片列表
picUrlList
:
[]
// 图片回显列表
picUrlList
:
[],
// 图片回显列表
},
picSubmitList
:
[],
// 发布功能需要的图片列表
propData
:
{},
isShowPopver
:
false
,
// 是否展示图片框
uploadUrl
:
`
${
GOODS_URI
}
/ksy/ks3apiunencrypt/ks3api_upload`
,
// 金山云上传地址
uploadUrl
:
UploadPicUrl
,
// 金山云上传地址
hideUpload
:
false
,
limitCount
:
9
limitCount
:
9
,
};
},
watch
:
{
infoEditArr
:
{
// 监听props属性 展示自提点列表
handler
:
function
(
newVal
)
{
handler
:
function
(
newVal
)
{
if
(
this
.
$route
.
query
.
marketing_id
)
{
this
.
propData
=
newVal
;
this
.
infoEditForm
.
title
=
this
.
propData
.
marketing_name
;
this
.
infoEditForm
.
desc
=
this
.
propData
.
pindan_desc
;
for
(
var
i
in
this
.
propData
.
pindan_pic_url
)
{
this
.
infoEditForm
.
picUrlList
.
push
({
url
:
this
.
propData
.
pindan_pic_url
[
i
]
url
:
this
.
propData
.
pindan_pic_url
[
i
],
});
this
.
picSubmitList
.
push
({
url
:
this
.
propData
.
pindan_pic_url
[
i
]
url
:
this
.
propData
.
pindan_pic_url
[
i
],
});
}
this
.
hideUpload
=
this
.
picSubmitList
.
length
>=
this
.
limitCount
;
// 大于9 隐藏
}
},
deep
:
true
,
immediate
:
true
}
immediate
:
true
,
},
},
methods
:
{
// 展示商品大图
...
...
@@ -115,7 +106,7 @@ export default {
this
.
infoEditForm
.
picUploadList
.
push
(
res
.
result
.
image_id
);
// 上传成功图片的id
this
.
picSubmitList
.
push
({
// 发布功能需要的图片列表
url
:
res
.
result
.
url
url
:
res
.
result
.
url
,
});
this
.
hideUpload
=
this
.
picSubmitList
.
length
>=
this
.
limitCount
;
},
...
...
@@ -141,23 +132,23 @@ export default {
this
.
infoEditForm
.
desc
=
this
.
propData
.
pindan_desc
;
for
(
var
i
in
this
.
propData
.
pindan_pic_url
)
{
this
.
infoEditForm
.
picUrlList
.
push
({
url
:
this
.
propData
.
pindan_pic_url
[
i
]
url
:
this
.
propData
.
pindan_pic_url
[
i
],
});
}
}
},
},
created
()
{
// this.marketingInfoMet();
}
};
},
};
</
script
>
<
style
scoped
>
.infoEditing
{
.infoEditing
{
width
:
64%
;
margin
:
0
auto
;
}
.hide
/
deep
/
.el-upload--picture-card
{
}
.hide
/
deep
/
.el-upload--picture-card
{
display
:
none
;
}
}
</
style
>
src/pages/Activity/releaseProduc/components/myMap.vue
View file @
4f5f1b64
...
...
@@ -5,42 +5,39 @@
<el-form
ref=
"form"
@
submit
.
prevent
>
<el-form-item
label-position=
"left"
>
<el-button
@
click=
"handleSearch"
>
搜索
</el-button>
<el-input
class=
"dialog-input"
v-model=
"searchKey"
placeholder=
"请输入关键字"
autocomplete=
"on"
>
<el-input
class=
"dialog-input"
v-model=
"searchKey"
placeholder=
"请输入关键字"
autocomplete=
"on"
>
<template
#
suffix
>
<i
@
click=
"searchKey = ''"
class=
"el-input__icon el-icon-close"
></i>
<i
@
click=
"searchKey = ''"
class=
"el-input__icon el-icon-close"
></i>
</
template
>
</el-input>
</el-form-item>
</el-form>
<div
id=
"js-result"
v-show=
"searchKey"
class=
"result"
></div>
</div>
<div
id=
"js-container"
class=
"myMap"
>
正在加载数据 ...
</div>
<div
id=
"js-container"
class=
"myMap"
>
正在加载数据 ...
</div>
</div>
<div
class=
"mapInfo"
>
<div
class=
"infoAll"
>
<h3
class=
"title"
>
拖拽选址
</h3>
<ul
class=
"info"
>
<li><span>
经度:
</span>
{{ dragData.lng }}
</li>
<li><span>
纬度:
</span>
{{ dragData.lat }}
</li>
<li><span>
地址:
</span>
{{ dragData.address }}
</li>
<li>
<span>
经度:
</span>
{{ dragData.lng }}
</li>
<li>
<span>
纬度:
</span>
{{ dragData.lat }}
</li>
<li>
<span>
地址:
</span>
{{ dragData.address }}
</li>
</ul>
</div>
<div
class=
"confirmButton"
>
<el-button
class=
"button_pre"
@
click=
"cancel"
>
取 消
</el-button>
<el-button
class=
"button_next"
type=
"primary"
@
click=
"confirm"
>
确 定
</el-button
>
<el-button
class=
"button_next"
type=
"primary"
@
click=
"confirm"
>
确 定
</el-button>
</div>
</div>
<!-- <div class="confirmButton">
...
...
@@ -51,8 +48,8 @@
</template>
<
script
>
import
remoteLoad
from
"@/utils/remoteLoad.js"
;
export
default
{
import
remoteLoad
from
"@/utils/remoteLoad.js"
;
export
default
{
name
:
"app"
,
data
()
{
return
{
...
...
@@ -65,8 +62,8 @@ export default {
address
:
null
,
nearestJunction
:
null
,
nearestRoad
:
null
,
nearestPOI
:
null
}
nearestPOI
:
null
,
},
};
},
methods
:
{
...
...
@@ -92,7 +89,7 @@ export default {
address
:
data
.
address
,
province
:
data
.
regeocode
.
addressComponent
.
province
,
city
:
data
.
regeocode
.
addressComponent
.
city
,
area
:
data
.
regeocode
.
addressComponent
.
district
area
:
data
.
regeocode
.
addressComponent
.
district
,
};
},
...
...
@@ -102,15 +99,16 @@ export default {
let
AMapUI
=
(
this
.
AMapUI
=
window
.
AMapUI
);
let
AMap
=
(
this
.
AMap
=
window
.
AMap
);
AMapUI
.
loadUI
([
"misc/PositionPicker"
],
PositionPicker
=>
{
AMapUI
.
loadUI
([
"misc/PositionPicker"
],
(
PositionPicker
)
=>
{
let
mapConfig
=
{
zoom
:
16
zoom
:
16
,
// cityName: this.MapCityName
};
if
(
this
.
lat
&&
this
.
lng
)
{
mapConfig
.
center
=
[
this
.
lng
,
this
.
lat
];
}
let
map
=
new
AMap
.
Map
(
"js-container"
,
mapConfig
);
let
_this
=
this
;
// 加载地图搜索插件
AMap
.
service
(
"AMap.PlaceSearch"
,
()
=>
{
...
...
@@ -120,21 +118,37 @@ export default {
citylimit
:
true
,
// city: this.MapCityName,
map
:
map
,
panel
:
"js-result"
panel
:
"js-result"
,
});
this
.
placeSearch
.
on
(
"selectChanged"
,
function
({
selected
})
{
console
.
log
(
selected
);
const
{
address
,
location
,
pname
,
cityname
,
adname
}
=
selected
.
data
;
_this
.
dragData
=
{
lng
:
location
.
lng
,
lat
:
location
.
lat
,
address
:
address
,
province
:
pname
,
city
:
cityname
,
area
:
adname
,
};
_this
.
searchKey
=
""
;
});
});
// 启用工具条
AMap
.
plugin
([
"AMap.ToolBar"
],
function
()
{
AMap
.
plugin
([
"AMap.ToolBar"
],
function
()
{
map
.
addControl
(
new
AMap
.
ToolBar
({
position
:
"RB"
})
position
:
"RB"
,
}),
);
});
// 地图地图定位
AMap
.
plugin
(
"AMap.Geolocation"
,
function
()
{
AMap
.
plugin
(
"AMap.Geolocation"
,
function
()
{
var
geolocation
=
new
AMap
.
Geolocation
({
// 是否使用高精度定位,默认:true
enableHighAccuracy
:
true
,
...
...
@@ -145,7 +159,7 @@ export default {
// 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
zoomToAccuracy
:
true
,
// 定位按钮的排放位置, RB表示右下
buttonPosition
:
"RB"
buttonPosition
:
"RB"
,
});
map
.
addControl
(
geolocation
);
geolocation
.
getCurrentPosition
();
...
...
@@ -171,18 +185,18 @@ export default {
//自定义外观
url
:
"//webapi.amap.com/ui/1.0/assets/position-picker2.png"
,
//图片地址
size
:
[
50
,
50
],
//要显示的点大小,将缩放图片
ancher
:
[
24
,
40
]
//锚点的位置,即被size缩放之后,图片的什么位置作为选中的位置
}
ancher
:
[
24
,
40
],
//锚点的位置,即被size缩放之后,图片的什么位置作为选中的位置
},
});
// 拖拽完成发送自定义 drag 事件
positionPicker
.
on
(
"success"
,
positionResult
=>
{
positionPicker
.
on
(
"success"
,
(
positionResult
)
=>
{
this
.
dragMap
(
positionResult
);
});
// 启动拖放
positionPicker
.
start
();
});
}
},
},
async
mounted
()
{
// 已载入高德地图API,则直接初始化地图
...
...
@@ -190,18 +204,16 @@ export default {
this
.
initMap
();
// 未载入高德地图API,则先载入API再初始化
}
else
{
await
remoteLoad
(
`http://webapi.amap.com/maps?v=1.3&key=bb057625545d8cf77df1379e7aaae0b5`
);
await
remoteLoad
(
`http://webapi.amap.com/maps?v=1.3&key=bb057625545d8cf77df1379e7aaae0b5`
);
await
remoteLoad
(
"http://webapi.amap.com/ui/1.0/main.js"
);
this
.
initMap
();
}
}
};
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.mapContainer {
.mapContainer {
height: 100%;
width: 100%;
// display: flex;
...
...
@@ -250,19 +262,19 @@ export default {
}
}
}
}
.m-map .search {
}
.m-map .search {
position: absolute;
top: 10px;
left: 10px;
width: 285px;
z-index: 1;
}
.m-map .search input {
}
.m-map .search input {
width: 180px;
border: 1px solid #ccc;
line-height: 20px;
padding: 5px;
outline: none;
}
}
</
style
>
src/pages/Goods/Detail/index.vue
View file @
4f5f1b64
This diff is collapsed.
Click to expand it.
src/service/Groupmeal/groupmeal.js
View file @
4f5f1b64
...
...
@@ -112,15 +112,21 @@ export async function orderRefundReject(params) {
// 导出订单
export
function
getOrderExportURL
(
eventId
,
type
)
{
var
ENV
;
if
(
process
.
env
.
NODE_ENV
==
"development"
)
{
ENV
=
"http://bp-dev.ini.yidian-inc.com/"
;
}
else
if
(
process
.
env
.
NODE_ENV
==
"test"
)
{
ENV
=
"http://bp-test.ini.yidian-inc.com/"
;
// var ENV;
// if(process.env.NODE_ENV == "development"){
// ENV = "http://bp-dev.ini.yidian-inc.com/"
// }else if(process.env.NODE_ENV == "test"){
// ENV = "http://bp-test.ini.yidian-inc.com/"
// }else{
// ENV = "http://bp.int.yidian-inc.com/"
// }
// return `${ENV}order/oldbackground/order_export?marketing_id=${eventId}&type=${type}`;
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
return
`http://127.0.0.1:8055/api/v1/relay/old_order_export?marketing_id=
${
eventId
}
&type=
${
type
}
`
;
}
else
{
ENV
=
"http://bp.int.yidian-inc.com/"
;
return
`/api/v1/relay/old_order_export?marketing_id=
${
eventId
}
&type=
${
type
}
`
;
}
return
`
${
ENV
}
order/oldbackground/order_export?marketing_id=
${
eventId
}
&type=
${
type
}
`
;
}
// 新订单管理
...
...
@@ -191,13 +197,10 @@ export async function newOrderRefundReject(params) {
// 导出订单
export
function
newGetOrderExportURL
(
eventId
,
type
)
{
var
ENV
;
if
(
process
.
env
.
NODE_ENV
==
"development"
)
{
ENV
=
"http://bp-dev.ini.yidian-inc.com/"
;
}
else
if
(
process
.
env
.
NODE_ENV
==
"test"
)
{
ENV
=
"http://bp-test.ini.yidian-inc.com/"
;
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
return
`http://127.0.0.1:8055/api/v1/relay/order_export?marketing_id=
${
eventId
}
&type=
${
type
}
`
;
}
else
{
ENV
=
"http://bp.int.yidian-inc.com/"
;
return
`/api/v1/relay/order_export?marketing_id=
${
eventId
}
&type=
${
type
}
`
;
}
return
`
${
ENV
}
order/background
/order_export?marketing_id=
${
eventId
}
&type=
${
type
}
`
;
// return `/api/v1/relay
/order_export?marketing_id=${eventId}&type=${type}`;
}
src/utils/util.js
View file @
4f5f1b64
...
...
@@ -22,25 +22,25 @@ import router from "@/router";
export
function
redirectToLogin
()
{
let
hasCallback
=
window
.
location
.
href
.
match
(
/
\?
callback/
);
if
(
hasCallback
)
return
;
if
(
hasCallback
)
return
;
let
isLogin
=
window
.
location
.
pathname
.
match
(
/op
\/
login/
);
router
.
push
(
`/op/login
${
!
isLogin
?
'?callback='
+
window
.
encodeURIComponent
(
window
.
location
.
pathname
)
:
''
}
`
)
router
.
push
(
`/op/login
${
!
isLogin
?
"?callback="
+
window
.
encodeURIComponent
(
window
.
location
.
pathname
)
:
""
}
`
);
}
export
function
redirectPage
()
{
let
url
=
window
.
location
.
search
.
split
(
'?callback='
)[
1
]
||
window
.
location
.
pathname
;
router
.
push
(
window
.
decodeURIComponent
(
url
))
let
url
=
window
.
location
.
search
.
split
(
"?callback="
)[
1
]
||
window
.
location
.
pathname
;
router
.
push
(
window
.
decodeURIComponent
(
url
));
}
export
function
isYdUser
(
email
)
{
return
email
.
match
(
/yidian-inc/
)
||
false
return
email
.
match
(
/yidian-inc/
)
||
false
;
}
export
function
setCookie
(
name
,
value
)
{
var
hour
=
8
;
var
exp
=
new
Date
();
exp
.
setTime
(
exp
.
getTime
()
+
hour
*
60
*
60
*
1000
);
document
.
cookie
=
name
+
"="
+
value
+
";expires="
+
exp
.
toGMTString
()
+
";path=/"
;
exp
.
setTime
(
exp
.
getTime
()
+
hour
*
60
*
60
*
1000
);
document
.
cookie
=
name
+
"="
+
value
+
";expires="
+
exp
.
toGMTString
()
+
";path=/"
;
}
//获取cookie
...
...
@@ -58,12 +58,15 @@ export function getCookie(NameOfCookie) {
}
export
function
delCookie
()
{
var
keys
=
document
.
cookie
.
match
(
/
[^
=;
]
+
(?=
=
)
/g
)
var
keys
=
document
.
cookie
.
match
(
/
[^
=;
]
+
(?=
=
)
/g
);
if
(
keys
)
{
for
(
var
i
=
keys
.
length
;
i
--
;
)
{
document
.
cookie
=
keys
[
i
]
+
'=0;path=/;expires='
+
new
Date
(
0
).
toUTCString
()
document
.
cookie
=
keys
[
i
]
+
'=0;path=/;domain='
+
document
.
domain
+
';expires='
+
new
Date
(
0
).
toUTCString
()
document
.
cookie
=
keys
[
i
]
+
'=0;path=/;domain=yidian-inc.com;expires='
+
new
Date
(
0
).
toUTCString
()
for
(
var
i
=
keys
.
length
;
i
--
;
)
{
document
.
cookie
=
keys
[
i
]
+
"=0;path=/;expires="
+
new
Date
(
0
).
toUTCString
();
document
.
cookie
=
keys
[
i
]
+
"=0;path=/;domain="
+
document
.
domain
+
";expires="
+
new
Date
(
0
).
toUTCString
();
document
.
cookie
=
keys
[
i
]
+
"=0;path=/;domain=yidian-inc.com;expires="
+
new
Date
(
0
).
toUTCString
();
}
}
}
export
const
UploadPicUrl
=
process
.
env
.
NODE_ENV
===
"development"
?
`http://127.0.0.1:8055/api/v1/relay/ks3api_upload`
:
"/api/v1/relay/ks3api_upload"
;
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