Commit 4f5f1b64 authored by gengshaojing's avatar gengshaojing

fix: 合并hotfix

parents 354158d0 c9861793
This diff is collapsed.
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
<% for (let i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %> <% for (let i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script> <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> <title><%= htmlWebpackPlugin.options.title %></title>
</head> </head>
......
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();
});
}
...@@ -10,6 +10,7 @@ const activity = require("./controllers/activity"); ...@@ -10,6 +10,7 @@ const activity = require("./controllers/activity");
const withdrawal = require("./controllers/withdrawal"); const withdrawal = require("./controllers/withdrawal");
const groupmeal = require("./controllers/groupmeal"); const groupmeal = require("./controllers/groupmeal");
const qr_code = require("./controllers/qr-code"); const qr_code = require("./controllers/qr-code");
const relay = require("./controllers/relay");
const router = Router(); const router = Router();
const API_VERSION = "/api/v1"; const API_VERSION = "/api/v1";
...@@ -130,4 +131,9 @@ router.post(`${API_VERSION}/get_reblack_list`, withdrawal.getReblackList); ...@@ -130,4 +131,9 @@ router.post(`${API_VERSION}/get_reblack_list`, withdrawal.getReblackList);
router.get(`${API_VERSION}/get_wallet_account_status`, withdrawal.getWalletAccountStatus); router.get(`${API_VERSION}/get_wallet_account_status`, withdrawal.getWalletAccountStatus);
router.post(`${API_VERSION}/reset_wallet_account_status`, withdrawal.resetAccountStatus); 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; module.exports = router;
...@@ -11,17 +11,13 @@ exports.httpReq = (ctx, opts) => { ...@@ -11,17 +11,13 @@ exports.httpReq = (ctx, opts) => {
version: "999999", version: "999999",
distribution: "op", distribution: "op",
net: "wifi", net: "wifi",
platform: "2" platform: "2",
}; };
opts.qs = { ...defaultQs, ...ctx.request.query, ...opts.qs }; opts.qs = { ...defaultQs, ...ctx.request.query, ...opts.qs };
request(opts, (err, res, body) => { request(opts, (err, res, body) => {
console.info( console.info(`[Api] httpReq (${opts.url}, user:[${opts.qs.op_cur_user}]) spent: ${+new Date() - time_start}ms`);
`[Api] httpReq (${opts.url}, user:[${
opts.qs.op_cur_user
}]) spent: ${+new Date() - time_start}ms`
);
if (!err) { if (!err) {
resolve(body); resolve(body);
...@@ -32,3 +28,17 @@ exports.httpReq = (ctx, opts) => { ...@@ -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);
}
});
});
};
...@@ -44,9 +44,9 @@ ...@@ -44,9 +44,9 @@
<h3>{{ marketingInfo.marketing_name }}</h3> <h3>{{ marketingInfo.marketing_name }}</h3>
<!-- 查看参与字段待确认 --> <!-- 查看参与字段待确认 -->
<p> <p>
<span>{{ detailInfo.lookUserCount }}人查看</span><span <span>{{ detailInfo.lookUserCount }}人查看</span>
>{{ detailInfo.haveBuyGoodsUserCount }}人参与</span
> <span>{{ detailInfo.haveBuyGoodsUserCount }}人参与</span>
</p> </p>
<p class="endTime">{{ showTimer }}</p> <p class="endTime">{{ showTimer }}</p>
</div> </div>
...@@ -82,11 +82,7 @@ ...@@ -82,11 +82,7 @@
></el-image> ></el-image>
</el-card> </el-card>
<el-card class="activities box-card"> <el-card class="activities box-card">
<div <div v-for="goodsItem in goodsList" :key="goodsItem.goods_sku_id" class="activityItem">
v-for="goodsItem in goodsList"
:key="goodsItem.goods_sku_id"
class="activityItem"
>
<el-image <el-image
class="activityImage" class="activityImage"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
...@@ -97,15 +93,8 @@ ...@@ -97,15 +93,8 @@
<p>{{ goodsItem.goods_name }}</p> <p>{{ goodsItem.goods_name }}</p>
<p class="price"> <p class="price">
<span class="nowPrice">{{ `¥${goodsItem.price}` }}</span> <span class="nowPrice">{{ `¥${goodsItem.price}` }}</span>
<span class="originPrice">{{ <span class="originPrice">{{ `¥${goodsItem.original_price} ` }}</span>
`¥${goodsItem.original_price} ` <span class="sold">已售{{ goodsItem.all_have_buy_goods_count }}</span>
}}</span>
<span class="sold" v-if="goodsItem.inventory_rest == 0"
>抢光了</span
>
<span class="sold" v-else
>已售{{ goodsItem.all_have_buy_goods_count }}</span
>
</p> </p>
</div> </div>
</div> </div>
...@@ -113,23 +102,17 @@ ...@@ -113,23 +102,17 @@
</section> </section>
</div> </div>
<div class="button-close"> <div class="button-close">
<el-button <el-button class="button-block" size="medium" type="primary" @click="closePage"> </el-button>
class="button-block"
size="medium"
type="primary"
@click="closePage"
> </el-button
>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import ActivityService from "@/service/Activity/index"; import ActivityService from "@/service/Activity/index";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import dayJs from "dayjs"; import dayJs from "dayjs";
export default { export default {
props: {}, props: {},
data() { data() {
return { return {
...@@ -138,7 +121,7 @@ export default { ...@@ -138,7 +121,7 @@ export default {
marketingInfo: {}, marketingInfo: {},
endTime: "", endTime: "",
showTimer: "", showTimer: "",
detailInfo: {} detailInfo: {},
}; };
}, },
watch: {}, watch: {},
...@@ -150,11 +133,11 @@ export default { ...@@ -150,11 +133,11 @@ export default {
let dataArr = await Promise.all([ let dataArr = await Promise.all([
ActivityService.checkActivityDetail({ ActivityService.checkActivityDetail({
marketing_id: this.$route.query.marketing_id, marketing_id: this.$route.query.marketing_id,
marketing_type: this.$route.query.marketing_type marketing_type: this.$route.query.marketing_type,
}), }),
ActivityService.checkActivityDetailInfo({ ActivityService.checkActivityDetailInfo({
marketing_id: this.$route.query.marketing_id marketing_id: this.$route.query.marketing_id,
}) }),
]); ]);
this.pageLoading = false; this.pageLoading = false;
this.goodsList = dataArr[0].result.goods_list; this.goodsList = dataArr[0].result.goods_list;
...@@ -171,21 +154,10 @@ export default { ...@@ -171,21 +154,10 @@ export default {
getTimeout(timeCount) { getTimeout(timeCount) {
if (timeCount > 0) { if (timeCount > 0) {
var days = parseInt(timeCount / (1000 * 60 * 60 * 24)); var days = parseInt(timeCount / (1000 * 60 * 60 * 24));
var hours = parseInt( var hours = parseInt((timeCount % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
(timeCount % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)
);
var minutes = parseInt((timeCount % (1000 * 60 * 60)) / (1000 * 60)); var minutes = parseInt((timeCount % (1000 * 60 * 60)) / (1000 * 60));
var seconds = parseInt((timeCount % (1000 * 60)) / 1000); var seconds = parseInt((timeCount % (1000 * 60)) / 1000);
this.showTimer = this.showTimer = "距结束:" + days + " 天 " + hours + " 小时 " + minutes + " 分钟 " + seconds + " 秒 ";
"距结束:" +
days +
" 天 " +
hours +
" 小时 " +
minutes +
" 分钟 " +
seconds +
" 秒 ";
} else { } else {
this.showTimer = "已结束"; this.showTimer = "已结束";
} }
...@@ -206,7 +178,7 @@ export default { ...@@ -206,7 +178,7 @@ export default {
closePage() { closePage() {
this.$router.go(-1); this.$router.go(-1);
} },
}, },
async created() { async created() {
await this.checkActivityDetail(); await this.checkActivityDetail();
...@@ -214,11 +186,11 @@ export default { ...@@ -214,11 +186,11 @@ export default {
}, },
beforeUnmount() { beforeUnmount() {
clearInterval(this.timer); clearInterval(this.timer);
} },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.wrapper { .wrapper {
height: 100%; height: 100%;
display: flex; display: flex;
overflow-y: scroll; overflow-y: scroll;
...@@ -324,5 +296,5 @@ export default { ...@@ -324,5 +296,5 @@ export default {
width: 200px; width: 200px;
} }
} }
} }
</style> </style>
<template> <template>
<div class="infoEditing"> <div class="infoEditing">
<el-form <el-form ref="infoEditForm" :model="infoEditForm" label-width="80px" @submit.prevent>
ref="infoEditForm"
:model="infoEditForm"
label-width="80px"
@submit.prevent
>
<el-form-item label="标题:"> <el-form-item label="标题:">
<el-input v-model="infoEditForm.title" maxlength="30"></el-input> <el-input v-model="infoEditForm.title" maxlength="30"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="介绍:"> <el-form-item label="介绍:">
<el-input <el-input type="textarea" v-model="infoEditForm.desc" maxlength="1000" rows="4"></el-input>
type="textarea"
v-model="infoEditForm.desc"
maxlength="1000"
rows="4"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="图片:"> <el-form-item label="图片:">
<el-upload <el-upload
...@@ -47,18 +37,19 @@ ...@@ -47,18 +37,19 @@
</template> </template>
<script> <script>
import { GOODS_URI } from "../../../../../server/config"; import { UploadPicUrl } from "@/utils/util";
export default {
export default {
props: { props: {
infoEditArr: { infoEditArr: {
type: Object, type: Object,
default: () => { default: () => {
return { return {
pindan_pic_url: [] pindan_pic_url: [],
}; };
}, },
require: true require: true,
} },
}, },
data() { data() {
return { return {
...@@ -66,38 +57,38 @@ export default { ...@@ -66,38 +57,38 @@ export default {
title: "", // 标题 title: "", // 标题
desc: "", // 介绍 desc: "", // 介绍
picUploadList: [], // 上传详情图片列表 picUploadList: [], // 上传详情图片列表
picUrlList: [] // 图片回显列表 picUrlList: [], // 图片回显列表
}, },
picSubmitList: [], // 发布功能需要的图片列表 picSubmitList: [], // 发布功能需要的图片列表
propData: {}, propData: {},
isShowPopver: false, // 是否展示图片框 isShowPopver: false, // 是否展示图片框
uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload`, // 金山云上传地址 uploadUrl: UploadPicUrl, // 金山云上传地址
hideUpload: false, hideUpload: false,
limitCount: 9 limitCount: 9,
}; };
}, },
watch: { watch: {
infoEditArr: { infoEditArr: {
// 监听props属性 展示自提点列表 // 监听props属性 展示自提点列表
handler: function(newVal) { handler: function (newVal) {
if (this.$route.query.marketing_id) { if (this.$route.query.marketing_id) {
this.propData = newVal; this.propData = newVal;
this.infoEditForm.title = this.propData.marketing_name; this.infoEditForm.title = this.propData.marketing_name;
this.infoEditForm.desc = this.propData.pindan_desc; this.infoEditForm.desc = this.propData.pindan_desc;
for (var i in this.propData.pindan_pic_url) { for (var i in this.propData.pindan_pic_url) {
this.infoEditForm.picUrlList.push({ this.infoEditForm.picUrlList.push({
url: this.propData.pindan_pic_url[i] url: this.propData.pindan_pic_url[i],
}); });
this.picSubmitList.push({ 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 隐藏 this.hideUpload = this.picSubmitList.length >= this.limitCount; // 大于9 隐藏
} }
}, },
deep: true, deep: true,
immediate: true immediate: true,
} },
}, },
methods: { methods: {
// 展示商品大图 // 展示商品大图
...@@ -115,7 +106,7 @@ export default { ...@@ -115,7 +106,7 @@ export default {
this.infoEditForm.picUploadList.push(res.result.image_id); // 上传成功图片的id this.infoEditForm.picUploadList.push(res.result.image_id); // 上传成功图片的id
this.picSubmitList.push({ this.picSubmitList.push({
// 发布功能需要的图片列表 // 发布功能需要的图片列表
url: res.result.url url: res.result.url,
}); });
this.hideUpload = this.picSubmitList.length >= this.limitCount; this.hideUpload = this.picSubmitList.length >= this.limitCount;
}, },
...@@ -141,23 +132,23 @@ export default { ...@@ -141,23 +132,23 @@ export default {
this.infoEditForm.desc = this.propData.pindan_desc; this.infoEditForm.desc = this.propData.pindan_desc;
for (var i in this.propData.pindan_pic_url) { for (var i in this.propData.pindan_pic_url) {
this.infoEditForm.picUrlList.push({ this.infoEditForm.picUrlList.push({
url: this.propData.pindan_pic_url[i] url: this.propData.pindan_pic_url[i],
}); });
} }
} },
}, },
created() { created() {
// this.marketingInfoMet(); // this.marketingInfoMet();
} },
}; };
</script> </script>
<style scoped> <style scoped>
.infoEditing { .infoEditing {
width: 64%; width: 64%;
margin: 0 auto; margin: 0 auto;
} }
.hide /deep/ .el-upload--picture-card { .hide /deep/ .el-upload--picture-card {
display: none; display: none;
} }
</style> </style>
...@@ -5,42 +5,39 @@ ...@@ -5,42 +5,39 @@
<el-form ref="form" @submit.prevent> <el-form ref="form" @submit.prevent>
<el-form-item label-position="left"> <el-form-item label-position="left">
<el-button @click="handleSearch">搜索</el-button> <el-button @click="handleSearch">搜索</el-button>
<el-input <el-input class="dialog-input" v-model="searchKey" placeholder="请输入关键字" autocomplete="on">
class="dialog-input"
v-model="searchKey"
placeholder="请输入关键字"
autocomplete="on"
>
<template #suffix> <template #suffix>
<i <i @click="searchKey = ''" class="el-input__icon el-icon-close"></i>
@click="searchKey = ''"
class="el-input__icon el-icon-close"
></i>
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div id="js-result" v-show="searchKey" class="result"></div> <div id="js-result" v-show="searchKey" class="result"></div>
</div> </div>
<div id="js-container" class="myMap"> <div id="js-container" class="myMap">正在加载数据 ...</div>
正在加载数据 ...
</div>
</div> </div>
<div class="mapInfo"> <div class="mapInfo">
<div class="infoAll"> <div class="infoAll">
<h3 class="title">拖拽选址</h3> <h3 class="title">拖拽选址</h3>
<ul class="info"> <ul class="info">
<li><span>经度:</span>{{ dragData.lng }}</li> <li>
<li><span>纬度:</span>{{ dragData.lat }}</li> <span>经度:</span>
<li><span>地址:</span>{{ dragData.address }}</li> {{ dragData.lng }}
</li>
<li>
<span>纬度:</span>
{{ dragData.lat }}
</li>
<li>
<span>地址:</span>
{{ dragData.address }}
</li>
</ul> </ul>
</div> </div>
<div class="confirmButton"> <div class="confirmButton">
<el-button class="button_pre" @click="cancel">取 消</el-button> <el-button class="button_pre" @click="cancel">取 消</el-button>
<el-button class="button_next" type="primary" @click="confirm" <el-button class="button_next" type="primary" @click="confirm">确 定</el-button>
>确 定</el-button
>
</div> </div>
</div> </div>
<!-- <div class="confirmButton"> <!-- <div class="confirmButton">
...@@ -51,8 +48,8 @@ ...@@ -51,8 +48,8 @@
</template> </template>
<script> <script>
import remoteLoad from "@/utils/remoteLoad.js"; import remoteLoad from "@/utils/remoteLoad.js";
export default { export default {
name: "app", name: "app",
data() { data() {
return { return {
...@@ -65,8 +62,8 @@ export default { ...@@ -65,8 +62,8 @@ export default {
address: null, address: null,
nearestJunction: null, nearestJunction: null,
nearestRoad: null, nearestRoad: null,
nearestPOI: null nearestPOI: null,
} },
}; };
}, },
methods: { methods: {
...@@ -92,7 +89,7 @@ export default { ...@@ -92,7 +89,7 @@ export default {
address: data.address, address: data.address,
province: data.regeocode.addressComponent.province, province: data.regeocode.addressComponent.province,
city: data.regeocode.addressComponent.city, city: data.regeocode.addressComponent.city,
area: data.regeocode.addressComponent.district area: data.regeocode.addressComponent.district,
}; };
}, },
...@@ -102,15 +99,16 @@ export default { ...@@ -102,15 +99,16 @@ export default {
let AMapUI = (this.AMapUI = window.AMapUI); let AMapUI = (this.AMapUI = window.AMapUI);
let AMap = (this.AMap = window.AMap); let AMap = (this.AMap = window.AMap);
AMapUI.loadUI(["misc/PositionPicker"], PositionPicker => { AMapUI.loadUI(["misc/PositionPicker"], (PositionPicker) => {
let mapConfig = { let mapConfig = {
zoom: 16 zoom: 16,
// cityName: this.MapCityName // cityName: this.MapCityName
}; };
if (this.lat && this.lng) { if (this.lat && this.lng) {
mapConfig.center = [this.lng, this.lat]; mapConfig.center = [this.lng, this.lat];
} }
let map = new AMap.Map("js-container", mapConfig); let map = new AMap.Map("js-container", mapConfig);
let _this = this;
// 加载地图搜索插件 // 加载地图搜索插件
AMap.service("AMap.PlaceSearch", () => { AMap.service("AMap.PlaceSearch", () => {
...@@ -120,21 +118,37 @@ export default { ...@@ -120,21 +118,37 @@ export default {
citylimit: true, citylimit: true,
// city: this.MapCityName, // city: this.MapCityName,
map: map, 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( map.addControl(
new AMap.ToolBar({ new AMap.ToolBar({
position: "RB" position: "RB",
}) }),
); );
}); });
// 地图地图定位 // 地图地图定位
AMap.plugin("AMap.Geolocation", function() { AMap.plugin("AMap.Geolocation", function () {
var geolocation = new AMap.Geolocation({ var geolocation = new AMap.Geolocation({
// 是否使用高精度定位,默认:true // 是否使用高精度定位,默认:true
enableHighAccuracy: true, enableHighAccuracy: true,
...@@ -145,7 +159,7 @@ export default { ...@@ -145,7 +159,7 @@ export default {
// 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false // 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
zoomToAccuracy: true, zoomToAccuracy: true,
// 定位按钮的排放位置, RB表示右下 // 定位按钮的排放位置, RB表示右下
buttonPosition: "RB" buttonPosition: "RB",
}); });
map.addControl(geolocation); map.addControl(geolocation);
geolocation.getCurrentPosition(); geolocation.getCurrentPosition();
...@@ -171,18 +185,18 @@ export default { ...@@ -171,18 +185,18 @@ export default {
//自定义外观 //自定义外观
url: "//webapi.amap.com/ui/1.0/assets/position-picker2.png", //图片地址 url: "//webapi.amap.com/ui/1.0/assets/position-picker2.png", //图片地址
size: [50, 50], //要显示的点大小,将缩放图片 size: [50, 50], //要显示的点大小,将缩放图片
ancher: [24, 40] //锚点的位置,即被size缩放之后,图片的什么位置作为选中的位置 ancher: [24, 40], //锚点的位置,即被size缩放之后,图片的什么位置作为选中的位置
} },
}); });
// 拖拽完成发送自定义 drag 事件 // 拖拽完成发送自定义 drag 事件
positionPicker.on("success", positionResult => { positionPicker.on("success", (positionResult) => {
this.dragMap(positionResult); this.dragMap(positionResult);
}); });
// 启动拖放 // 启动拖放
positionPicker.start(); positionPicker.start();
}); });
} },
}, },
async mounted() { async mounted() {
// 已载入高德地图API,则直接初始化地图 // 已载入高德地图API,则直接初始化地图
...@@ -190,18 +204,16 @@ export default { ...@@ -190,18 +204,16 @@ export default {
this.initMap(); this.initMap();
// 未载入高德地图API,则先载入API再初始化 // 未载入高德地图API,则先载入API再初始化
} else { } else {
await remoteLoad( await remoteLoad(`http://webapi.amap.com/maps?v=1.3&key=bb057625545d8cf77df1379e7aaae0b5`);
`http://webapi.amap.com/maps?v=1.3&key=bb057625545d8cf77df1379e7aaae0b5`
);
await remoteLoad("http://webapi.amap.com/ui/1.0/main.js"); await remoteLoad("http://webapi.amap.com/ui/1.0/main.js");
this.initMap(); this.initMap();
} }
} },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.mapContainer { .mapContainer {
height: 100%; height: 100%;
width: 100%; width: 100%;
// display: flex; // display: flex;
...@@ -250,19 +262,19 @@ export default { ...@@ -250,19 +262,19 @@ export default {
} }
} }
} }
} }
.m-map .search { .m-map .search {
position: absolute; position: absolute;
top: 10px; top: 10px;
left: 10px; left: 10px;
width: 285px; width: 285px;
z-index: 1; z-index: 1;
} }
.m-map .search input { .m-map .search input {
width: 180px; width: 180px;
border: 1px solid #ccc; border: 1px solid #ccc;
line-height: 20px; line-height: 20px;
padding: 5px; padding: 5px;
outline: none; outline: none;
} }
</style> </style>
This diff is collapsed.
...@@ -112,15 +112,21 @@ export async function orderRefundReject(params) { ...@@ -112,15 +112,21 @@ export async function orderRefundReject(params) {
// 导出订单 // 导出订单
export function getOrderExportURL(eventId, type) { export function getOrderExportURL(eventId, type) {
var ENV; // var ENV;
if (process.env.NODE_ENV == "development") { // if(process.env.NODE_ENV == "development"){
ENV = "http://bp-dev.ini.yidian-inc.com/"; // ENV = "http://bp-dev.ini.yidian-inc.com/"
} else if (process.env.NODE_ENV == "test") { // }else if(process.env.NODE_ENV == "test"){
ENV = "http://bp-test.ini.yidian-inc.com/"; // 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 { } 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) { ...@@ -191,13 +197,10 @@ export async function newOrderRefundReject(params) {
// 导出订单 // 导出订单
export function newGetOrderExportURL(eventId, type) { export function newGetOrderExportURL(eventId, type) {
var ENV; if (process.env.NODE_ENV === "development") {
if (process.env.NODE_ENV == "development") { return `http://127.0.0.1:8055/api/v1/relay/order_export?marketing_id=${eventId}&type=${type}`;
ENV = "http://bp-dev.ini.yidian-inc.com/";
} else if (process.env.NODE_ENV == "test") {
ENV = "http://bp-test.ini.yidian-inc.com/";
} else { } 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}`;
} }
...@@ -22,25 +22,25 @@ import router from "@/router"; ...@@ -22,25 +22,25 @@ import router from "@/router";
export function redirectToLogin() { export function redirectToLogin() {
let hasCallback = window.location.href.match(/\?callback/); let hasCallback = window.location.href.match(/\?callback/);
if(hasCallback) return; if (hasCallback) return;
let isLogin = window.location.pathname.match(/op\/login/); 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() { export function redirectPage() {
let url = window.location.search.split('?callback=')[1] || window.location.pathname; let url = window.location.search.split("?callback=")[1] || window.location.pathname;
router.push(window.decodeURIComponent(url)) router.push(window.decodeURIComponent(url));
} }
export function isYdUser(email) { export function isYdUser(email) {
return email.match(/yidian-inc/) || false return email.match(/yidian-inc/) || false;
} }
export function setCookie(name, value) { export function setCookie(name, value) {
var hour = 8; var hour = 8;
var exp = new Date(); var exp = new Date();
exp.setTime(exp.getTime() + hour*60*60*1000); exp.setTime(exp.getTime() + hour * 60 * 60 * 1000);
document.cookie = name + "="+ value + ";expires=" + exp.toGMTString()+";path=/"; document.cookie = name + "=" + value + ";expires=" + exp.toGMTString() + ";path=/";
} }
//获取cookie //获取cookie
...@@ -58,12 +58,15 @@ export function getCookie(NameOfCookie) { ...@@ -58,12 +58,15 @@ export function getCookie(NameOfCookie) {
} }
export function delCookie() { export function delCookie() {
var keys = document.cookie.match(/[^ =;]+(?==)/g) var keys = document.cookie.match(/[^ =;]+(?==)/g);
if (keys) { if (keys) {
for (var i = keys.length; i--;) { for (var i = keys.length; i--; ) {
document.cookie = keys[i] + '=0;path=/;expires=' + new Date(0).toUTCString() 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=" + document.domain + ";expires=" + new Date(0).toUTCString();
document.cookie = keys[i] + '=0;path=/;domain=yidian-inc.com;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";
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment