Commit 7b2f4127 authored by 黄媛媛's avatar 黄媛媛
parents 462c60fc 2e4dbdd7
......@@ -734,11 +734,13 @@
},
//修改版权
TestMiniApp() {
this.apipost("/api/Mall/GetHome", {
}, res => {
console.log("Test",res.data);
})
var cmdStr = "";
//cmdStr = "/api/test/get";
cmdStr="/api/Mall/GetHome";
// this.apipost(cmdStr, {
// }, res => {
// console.log("Test", res.data);
// })
},
},
mounted() {
......
<style>
.weixinappmsg{
position: relative;
}
.weixinappmsg .mimitBody {
padding: 20px;
background-color: #fff;
margin: 10px 0 20px 0;
display: table;
width: 100%;
}
.weixinappmsg .mimitList {
margin-bottom: 15px;
display: flex;
flex-direction: row;
}
.weixinappmsg .mimitBody .el-tag {
min-width: 120px;
padding-right: 50px;
}
.weixinappmsg .el-button--small {
padding: 9px 15px;
}
.wexin_Header{
padding: 0 20px;
height: 56px;
line-height: 56px;
background-color: #fff;
margin-bottom: 10px;
}
.weixinTopBtn{
position: absolute;
top: 10px;
right: 10px;
z-index: 2;
}
.weixin_warmTips{
margin: 0px 20px 20px;
background-color: rgb(244, 244, 245);
padding: 10px 15px;
color: rgb(144, 147, 153);
display: inline-block;
font-size: 15px;
}
</style>
<template>
<div class="weixinappmsg">
<!--<el-button class="weixinTopBtn" type="primary" size="small">一键添加订阅信息</el-button>-->
<div class="wexin_Header">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="微信小程序" name="1"></el-tab-pane>
</el-tabs>
</div>
<template v-if="checkIndex==1">
<div class="mimitBody">
<div class="el-col el-col-24">
<div class="weixin_warmTips">温馨提示:获取前请先确认您已获得订阅消息的使用权限,并且订阅消息中没有任何数据。获取后请不要到小程序后台 删除相应的订阅消息,否则会影响订阅消息正常使用。</div>
<el-form label-width="300px">
<el-form-item label="拼团成功通知(类目: 服装/鞋/箱包 )">
<el-input type="text" style="width:30%" size="small" maxlength="200" v-model="wechatMsg.sucMsg">
</el-input>
<el-button plain size="small">查看订阅消息示例</el-button>
</el-form-item>
<el-form-item label="拼团失败通知(类目: 服装/鞋/箱包 )">
<el-input type="text" style="width:30%" size="small" maxlength="200" v-model="wechatMsg.falMsg">
</el-input>
<el-button plain size="small">查看订阅消息示例</el-button>
</el-form-item>
</el-form>
</div>
</div>
<el-button size="small" type="primary" @click="saveMsg()">保 存</el-button>
<el-button size="small" type="primary">生成测试二维码</el-button>
</template>
</div>
</template>
<script>
export default {
data() {
return {
//商城订阅消息
activeName:'1',
checkIndex:1,
wechatMsg:{
sucMsg:'',
falMsg:''
},
};
},
created() {
},
methods: {
//切换
handleClick(tab){
this.checkIndex = tab.name;
},
//保存信息
saveMsg(){
}
},
mounted() {
}
};
</script>
<style>
.pintuanSet .custom_Header {
padding: 0 20px;
height: 56px;
line-height: 56px;
background-color: #fff;
margin-bottom: 15px;
width: 100%;
}
.pintuan_Cont {
padding: 20px 0 10px 0;
}
.pintuanSet .red {
padding: 0 25px;
display: inline-block;
color: red;
}
.pintuanSet .block-box {
color: #ffffff;
cursor: pointer;
display: inline-block;
margin-right: 25px;
height: 280px;
width: 300px;
border: 1px solid #D4D4D4;
border-top-left-radius: 20px;
border-top-right-radius: 20px;
position: relative;
}
.block-box .Cubeselect {
display: none;
}
.imgCube_chooseBtn {
position: absolute;
height: 30px;
width: 80px;
padding: 0 !important;
text-align: center;
background-color: #409EFF;
top: 50%;
left: 0;
right: 0;
margin: -15px auto 0 !important;
z-index: 10;
display: none;
}
.block-box:hover .imgCube_chooseBtn {
display: block;
}
.active .imgCube_chooseBtn {
display: none !important;
}
.active .opacity {
display: none !important;
}
.imgCube .opacity {
position: absolute;
height: 250px;
width: 280px;
bottom: 0;
left: 10px;
z-index: 5;
background-color: rgba(0, 0, 0, .3);
display: none;
}
.cube_blockImg {
width: 280px;
height: 250px;
position: absolute;
bottom: 0px;
left: 10px;
}
.active .Cubeselect {
position: absolute;
top: 0;
left: 0;
height: 80px;
width: 80px;
display: block;
z-index: 10;
}
</style>
<template>
<div class="pintuanSet">
<div class="custom_Header">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="基本设置" name="1"></el-tab-pane>
<el-tab-pane label="轮播图" name="2"></el-tab-pane>
<el-tab-pane label="拼团广告" name="3"></el-tab-pane>
</el-tabs>
</div>
<div class="pintuan_Cont">
<!-- 基本设置 -->
<template v-if="checkIndex==1">
<div class="app-setting">
<el-form label-width="180px">
<el-card class="box-card" style="margin-bottom:10px;">
<div slot="header" class="clearfix">
<span>购买设置</span>
</div>
<el-form-item label="是否开启分销" size="mini">
<el-switch v-model="msg.Is_Share" active-color="#409EFF" :active-value="1" :inactive-value="0">
</el-switch>
<span class="red">注:必须在“<el-button type="text" @click="CommonJump('baseSet')">分销中心=>基础设置</el-button>
”中开启,才能使用</span>
</el-form-item>
<el-form-item label="是否开启区域允许购买" size="mini">
<el-switch v-model="msg.Is_Territorial_Limitation" active-color="#409EFF" :active-value="1"
:inactive-value="0">
</el-switch>
<span class="red">注:必须在“<el-button type="text">系统管理=>区域允许购买</el-button>”中开启,才能使用</span>
</el-form-item>
<el-form-item label="支付方式" size="mini">
<el-tooltip class="item" effect="dark" content="默认支持线上支付;若三个都不勾选,则视为勾选线上支付" placement="top">
<i class="topelzk elzk el-tooltip el-icon-info"></i>
</el-tooltip>
<el-checkbox-group v-model="msg.Payment_TypeList" style="display:inline-block;margin-left:10px;">
<el-checkbox label="online_pay">线上支付</el-checkbox>
<el-checkbox label="huodao">货到付款</el-checkbox>
<el-checkbox label="balance">余额支付</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="发货方式" size="mini">
<el-tooltip class="item" effect="dark" content="自提需要设置门店,如果您还未设置门店请保存本页后设置门店" placement="top">
<i class="topelzk elzk el-tooltip el-icon-info"></i>
</el-tooltip>
<el-checkbox-group v-model="msg.Send_TypeList" style="display:inline-block;margin-left:10px;">
<el-checkbox label="express">快递配送</el-checkbox>
<el-checkbox label="offline">到店自提</el-checkbox>
<el-checkbox label="city">同城配送</el-checkbox>
</el-checkbox-group>
<div style="color: rgb(204, 204, 204);">
注:手机端显示排序(1.快递配送 2.到店自提 3.同城配送)
</div>
</el-form-item>
</el-card>
<el-card class="box-card" style="margin-bottom:10px;">
<div slot="header" class="clearfix">
<span>优惠叠加设置</span>
</div>
<el-form-item label="优惠券" size="mini">
<el-switch v-model="msg.Is_Coupon" active-color="#409EFF" :active-value="1" :inactive-value="0">
</el-switch>
</el-form-item>
<el-form-item label="超级会员卡" size="mini">
<el-switch v-model="msg.SVIP_Status" active-color="#409EFF" :active-value="1" :inactive-value="0">
</el-switch>
<span class="red">注:必须在“<el-button type="text">插件中心=>超级会员卡</el-button>”中开启,才能使用</span>
</el-form-item>
<el-form-item label="会员价" size="mini">
<el-switch v-model="msg.Is_Member_Price" active-color="#409EFF" :active-value="1" :inactive-value="0">
</el-switch>
</el-form-item>
<el-form-item label="积分抵扣" size="mini">
<el-switch v-model="msg.Is_Integral" active-color="#409EFF" :active-value="1" :inactive-value="0">
</el-switch>
</el-form-item>
</el-card>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>拼团规则设置</span>
</div>
<el-form-item label="活动规则" size="mini">
<UE style="width:750px;" :defaultMsg="msg.RuleText" ref="ue"></UE>
</el-form-item>
</el-card>
</el-form>
</div>
</template>
<!-- 轮播图 -->
<template v-if="checkIndex==2">
</template>
<!-- 拼团广告 -->
<template v-if="checkIndex==3">
<el-form label-width="150px">
<el-form-item label="拼团广告状态" size="mini">
<el-switch v-model="msg.Is_Advertisement" active-color="#409EFF" :active-value="1" :inactive-value="0">
</el-switch>
</el-form-item>
<el-form-item label="样式选择" size="mini">
<div class="block-box" v-for="(item,index) in styleList" :key="index" :class="isActive==item.Id?'active':''"
@click="getStyleType(item.Id,item.Style)">
<img src="../../assets/img/storeDesign/select.png" class="Cubeselect" alt="" />
<div class="opacity"></div>
<el-button class="imgCube_chooseBtn" type="primary">启用该样式</el-button>
<img :src="item.ImgUrl" class="cube_blockImg" alt="">
</div>
</el-form-item>
<el-form-item label="板块设置">
<!-- <el-row style="margin-bottom:15px;" v-for="(subItem,subIndex) in addMsg.MagicDataList" :key="subIndex">
<el-col :span="4">
<el-tooltip class="item" effect="dark" :content="'建议尺寸:'+subItem.size" placement="top">
<el-button size="mini" @click="choicImg=true,commonIndex=subIndex">选择图片</el-button>
</el-tooltip>
<div class="customize-share-title">
<div class="zk_pic_box" style="width:80px;height:80px;" flex="main:center cross:center"
:style="{backgroundImage:'url(' + getIconLink(subItem.ImgUrl) + ')'}">
<i v-if="subItem.ImgUrl==''" class="el-icon-picture-outline"></i>
</div>
</div>
</el-col>
<el-col :span="10">
<div style="display:flex;" flex="box:last">
<el-input type="text" v-model="subItem.Link" :disabled="true" size="small">
</el-input>
<div>
<el-button size="mini" @click="isShowLink=true,commonIndex=subIndex">选择链接</el-button>
</div>
</div>
</el-col>
</el-row> -->
</el-form-item>
</el-form>
</template>
<el-button size="small" style="margin:30px 0 150px 0;padding:9px 25px;" type="primary" @click="saveGroupBuyConfig">保 存</el-button>
</div>
</div>
</template>
<script>
import UE from '@/components/global/UE.vue'
export default {
data() {
return {
activeName: '1',
checkIndex: 1,
config: {
initialFrameWidth: null,
initialFrameHeight: 350,
},
isActive: -1,
msg: {
GroupByConfigId: 0, //配置编号
Is_Share: 0, //是否开启分销
Is_Territorial_Limitation: 0, //是否开启区域允许购买
Payment_TypeList: ["online_pay", "balance", "huodao"], //支付方式
Send_TypeList: ["express", "offline", "city"], //发货方式
Is_Coupon: 1, //优惠券
SVIP_Status: 1, //超级会员卡
Is_Member_Price: 1, //会员价
Is_Integral: 1, //积分抵扣
RuleText: '', //活动规则
Is_Advertisement: 1, //拼团广告状态
Goods_Poster: "",
}
};
},
created() {},
components: {
UE
},
methods: {
//切换
handleClick(tab) {
this.checkIndex = tab.name;
},
//点击选择广告
getStyleType() {
},
//保存拼团配置
saveGroupBuyConfig() {
this.apipost("/api/GroupBuy/SetGroupBuyConfig", this.msg, res => {
if (res.data.resultCode == 1) {
this.getGroupBuyConfig();
this.Success(res.data.message);
} else {
this.Info(res.data.message);
}
})
},
//获取拼团配置
getGroupBuyConfig() {
this.apipost("/api/GroupBuy/GetGroupBuyConfigModule", {}, res => {
if (res.data.resultCode == 1) {
var dataObj = res.data.data;
console.log("dataObj", dataObj);
if (dataObj) {
}
} else {
this.Info(res.data.message);
}
})
}
},
mounted() {
this.getGroupBuyConfig();
}
};
</script>
<style>
.pintuanMain {
height: 100%;
display: flex;
-webkit-box-orient: horizontal;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
-ms-flex-preferred-size: auto;
flex-basis: auto;
-webkit-box-sizing: border-box;
box-sizing: border-box;
min-width: 0;
font-size: 14px;
}
.pintuanMain .mainLeftMenu {
position: relative;
display: flex;
flex-direction: row;
color: #fff;
}
.pintuanMain .leftMenu1 {
background: #444444;
cursor: pointer;
width: 200px;
height: 100%;
overflow-y: auto;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.pintuanMain .asideInner {
background: rgba(0, 0, 0, 0.15);
padding: 6px 6px;
width: 100%;
border-radius: 3px;
font-weight: bold;
}
.pintuanMain .F_Logo {
height: 60px;
background: #464d54;
color: #f2f2f2;
cursor: pointer;
font-weight: bold;
text-align: center;
padding: 0 15px;
display: flex;
align-items: center;
}
.pintuanMain .mainRightContent {
width: 100%;
height: 100%;
background-color: #f3f3f3;
}
.pintuanMain .mainRightTop {
width: 100%;
height: 60px;
background: #fff;
display: flex;
justify-content: space-between;
color: #909399;
}
.pintuanMain .mainRightLeft {
width: 110px;
height: 60px;
line-height: 62px;
text-align: center;
margin-left: 30px;
cursor: pointer;
position: relative;
top: -2px;
}
.pintuanMain .marinRightList {
display: flex;
flex-wrap: wrap;
align-items: center;
width: 300px;
float: right;
}
.pintuanMain .marinRightList ul {
display: flex;
width: 100%;
justify-content: space-around;
}
.pintuanMain .marinRightList ul li {
display: block;
list-style-type: none;
cursor: pointer;
color: #909399;
outline: none;
border: none;
}
.pintuanMain .main_routerPage {
padding: 20px;
overflow-y: scroll;
}
.pintuanMain .pintuanSetUU{
position: fixed;
width: 200px;
height: 100%;
position: fixed;
top: 60px;
left: 0;
overflow: auto;
z-index: 5;
background-color: rgb(84, 92, 100);
}
.pintuanMain .pintuanSetUU .menu_item{
font-size: 14px;
color: #303133;
padding: 0 20px;
cursor: pointer;
-webkit-transition: border-color .3s,background-color .3s,color .3s;
transition: border-color .3s,background-color .3s,color .3s;
box-sizing: border-box;
height:56px;
line-height: 56px;
list-style: none;
white-space: nowrap;
color:#fff;
display: flex;
align-items: center;
}
.pintuanMain .pintuanSetUU .menu_item i {
margin-right: 5px;
width: 24px;
text-align: center;
font-size: 18px;
vertical-align: middle;
color:#909399;
}
.pintuanMain .menu_item:hover{
background-color: rgba(67,74,80);
}
.pintuanMain .F_Logo:hover{
background-color: #30353a;
color:#fff;
}
.pintuanMain .Fchecked{
color:rgb(255, 208, 75)!important;
}
.pintuanMain .Fchecked i{
color:rgb(255, 208, 75)!important;
}
</style>
<template>
<div class="pintuanMain">
<div class="mainLeftMenu">
<div class="leftMenu1">
<div class="F_Logo">
<div class="asideInner" @click="CommonJump('mallIndex')">{{currentUser.MallName}}
</div>
</div>
<ul class="pintuanSetUU">
<li class="menu_item" :class="{'Fchecked':isChecked=='/pintuanSet'}" @click="isChecked='/pintuanSet',CommonJump('pintuanSet')">
<i class="el-icon-menu"></i><span>拼团设置</span>
</li>
<li class="menu_item" :class="{'Fchecked':isChecked=='/pintuanMsg'}" @click="isChecked='/pintuanMsg',CommonJump('pintuanMsg')">
<i class="el-icon-menu"></i><span>消息通知</span>
</li>
<li class="menu_item" :class="{'Fchecked':isChecked=='/AppletPublishing'}" @click="isChecked='/AppletPublishing',CommonJump('AppletPublishing')">
<i class="el-icon-menu"></i><span>拼团活动</span>
</li>
<li class="menu_item" :class="{'Fchecked':isChecked==4}" @click="isChecked=4">
<i class="el-icon-menu"></i><span>活动数据</span>
</li>
</ul>
</div>
</div>
<div class="mainRightContent">
<div class="mainRightTop">
<div class="mainRightLeft">微信小程序</div>
<div class="marinRightList">
<ul>
<li style="display:none">缓存</li>
<li style="display:none"> title="教程管理">
<el-dropdown trigger="click">
<span class="el-dropdown-link">
教程管理<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>操作教程</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</li>
<li :title="currentUser.MallName">
<el-dropdown trigger="click">
<span class="el-dropdown-link">
{{currentUser.MallName}}<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item disabled>{{currentUser.MallName}}</el-dropdown-item>
<el-dropdown-item disabled>{{currentUser.Account}}({{currentUser.MobilePhone}})</el-dropdown-item>
<el-dropdown-item @click.native="CommonJump('index')">返回系统</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</li>
</ul>
</div>
</div>
<div class="main_routerPage" :style="{height: Height+'px'}">
<router-view />
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
currentUser: {},
isChecked:'',
Height:0
};
},
created() {
this.currentUser = this.getLocalStorage();
this.isChecked=this.$route.path;
if(this.$route.query.FIndex){
this.CommonJump('pintuanSet');
this.isChecked='/pintuanSet'
}
},
methods: {
},
mounted() {
this.Height = document.documentElement.clientHeight - 60;
//监听浏览器窗口变化 
window.onresize = () => {
this.Height = document.documentElement.clientHeight - 60
}
}
};
</script>
......@@ -30,6 +30,30 @@
.plugin-item:hover .display-name {
color: #409EFF;
}
.plugin-icon-bg{
background: rgb(250, 163, 34);
border-radius: 10px;
font-size: 0;
display: inline-block;
}
.plugin-icon{
width:50px;
height:50px;
}
.plugin-name{
font-size: 14px;
margin-bottom: 4px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.plugin-desc{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #999999;
font-size: 12px;
}
</style>
<template>
<div class="pluginCenter">
......@@ -68,6 +92,24 @@
</div>
</div>
</div>
<div flex="cross:center" style="margin-top:20px;">
<h3 class="plugin_ListTitle">营销工具</h3>
</div>
<div flex="dir:left" class="plugin-list el-row">
<div class="el-col el-col-24 el-col-xs-24 el-col-sm-12 el-col-md-8 el-col-lg-6 el-col-xl-4" @click="goDiyCenter('pintuanMain')">
<div flex="dir:left box:first" class="plugin-item">
<div style="padding-right: 12px;">
<div class="plugin-icon-bg">
<img src="../../assets/img/sallCenter/pintuan.png" style="width: 50px; height: 50px; display: block;"></div>
</div>
<div>
<div class="plugin-name">拼团</div>
<div flex="box:last"><div class="plugin-desc">邀请朋友一起拼团购买</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
......
import md5 from 'js-md5'
export default {
install(Vue, options) {
Vue.prototype.md5 = md5;
//消息成功提示
Vue.prototype.Success = function(msg) {
this.$message({
message: msg,
duration: 2000,
type: "success"
});
},
//错误提示
Vue.prototype.Error = function(msg) {
this.$message({
message: msg,
duration: 2000,
type: "error"
});
},
install(Vue, options) {
Vue.prototype.md5 = md5;
//消息成功提示
Vue.prototype.Success = function (msg) {
this.$message({
message: msg,
duration: 2000,
type: "success"
});
},
//错误提示
Vue.prototype.Error = function (msg) {
this.$message({
message: msg,
duration: 2000,
type: "error"
});
},
//一般提示
Vue.prototype.Info = function(msg) {
this.$message({
message: msg,
duration: 2000,
type: "info"
});
},
//警告提示
Vue.prototype.Warning = function(msg) {
this.$message({
message: msg,
duration: 2000,
type: "warning"
});
},
//Confirm
Vue.prototype.Confirm = function(msg, callback) {
this.$confirm(msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
if (typeof callback === 'function') {
callback();
}
})
.catch(() => {
this.Info("已取消操作");
});
},
//域名管理对象
Vue.prototype.domainManager = function() {
let domainUrl = '';
// domainUrl = "https://mallapi.oytour.com";
// domainUrl = "https://localhost:5001";
// domainUrl = "http://192.168.2.65";
domainUrl = "http://192.168.2.16:8088";
let locationName = window.location.hostname;
if (locationName.indexOf('testmall.oytour') !== -1) {
domainUrl = "https://mallapi.oytour.com";
} else if (locationName.indexOf('oytour') !== -1) {
domainUrl = "https://mallapi.oytour.com";
}
var obj = {
//主地址npm
DomainUrl: domainUrl,
//资产管理
javaUrl: "http://192.168.2.65:8018",
// javaUrl: "http://192.168.2.16:8087",
// javaUrl: "http://property.oytour.com",
//常用提交数据URL
PostUrl: domainUrl + "/api/common/post",
ImageUrl: 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com',
UploadFileUrl: domainUrl + '/api/File/LocalFileUploadImport',
UploadBlob: domainUrl + '/api/File/UploadBlob',
};
return obj;
},
//浏览器缓存
Vue.prototype.getLocalStorage = function() {
var localStorageData = window.localStorage["mall_userInfo"];
if (localStorageData !== undefined && localStorageData != 'undefined') {
return JSON.parse(localStorageData);
} else {
return null;
}
},
//验证只能输入2位小数【负数:isMinus传true】
Vue.prototype.checkPrice = function(item, filed, isMinus) {
var value = "" + item[filed]; //转字符串
var t = value.charAt(0);
value = value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
value = value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
value = value
.replace(".", "$#$")
.replace(/\./g, "")
.replace("$#$", ".");
value = value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
//如果第一位是负号,则允许添加 如果不允许添加负号 可以把这块注释掉
//是否允许负数
if (isMinus && t == '-') {
value = '-' + value;
}
item[filed] = value;
}
//验证只能输入整数【负数:isMinus传true】
Vue.prototype.checkInteger = function(item, filed, isMinus) {
var value = "" + item[filed]; //转字符串
var t = value.charAt(0);
value = value.replace(this.$commonUtils.Regex.isInteger, "");
//是否允许负数
if (isMinus && t == '-') {
value = '-' + value;
}
item[filed] = value;
},
//是否是线上环境【发布时修改为true】
Vue.prototype.isOnline = function() {
return process.env.NODE_ENV !== 'development';
},
//文件类型数组
Vue.prototype.FileType = function() {
var fileTypeJson = {
//主地址npm
UserImg: "User", //用户相图片
//常用提交数据URL
GoodsImg: "Goods", //素材相关文件
SetImg: "Set", //用户相图片
};
return fileTypeJson;
},
//上传文件到云存储
Vue.prototype.UploadFileToTencent = function(path, fileObj, callback) {
//获取文件扩展名
var filename = fileObj.name;
var index = filename.lastIndexOf(".");
var suffix = filename.substr(index);
var timestamp1 = Date.parse(new Date())+"_"+(Math.ceil(Math.random()*1000));
let str = '';
if (this.isOnline()) {
str = "/Test"
}
var newFileName = str + '/Upload/' + path + "/" + timestamp1 + "" + suffix;
var uploadMsg = {
Bucket: "viitto-1301420277",
Region: "ap-chengdu",
/* 存储桶所在地域,必须字段 */
SecretId: "AKIDDPnbIzi8C1eqEOPP8dw6MNAg9H9ldDKd",
SecretKey: "PdcLtOjslUzNFYdU4OSI1fKtdHpFT2Ob",
};
var COS = require('cos-js-sdk-v5');
var cos = new COS({
SecretId: uploadMsg.SecretId,
SecretKey: uploadMsg.SecretKey,
});
cos.putObject({
Bucket: uploadMsg.Bucket,
Region: uploadMsg.Region, //存储桶所在地域,必须字段
Key: newFileName, //文件名
StorageClass: 'STANDARD',
Body: fileObj, // 上传文件对象
onProgress: function(progressData) {}
}, function(err, data) {
if (data && data.statusCode == 200) {
var uploadResult = {
resultCode: 1,
FileName: fileObj.name,
FileUrl: "http://" + data.Location
}
if (callback) {
callback(uploadResult);
}
} else {
/*上传文件异常*/
console.log(err || data);
}
});
},
//公用跳转
Vue.prototype.CommonJump = function(path, obj) {
this.$router.push({
name: path,
query: obj
});
}
//公用判断图片地址 判断是否包含http
Vue.prototype.getIconLink = function(url) {
let str = ''
if (url && url != '') {
if (url.indexOf('http') != -1) {
str = url
} else {
str = this.domainManager().ImageUrl + url;
}
return str;
}
//一般提示
Vue.prototype.Info = function (msg) {
this.$message({
message: msg,
duration: 2000,
type: "info"
});
},
//警告提示
Vue.prototype.Warning = function (msg) {
this.$message({
message: msg,
duration: 2000,
type: "warning"
});
},
//Confirm
Vue.prototype.Confirm = function (msg, callback) {
this.$confirm(msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
if (typeof callback === 'function') {
callback();
}
//HTTP提交数据
Vue.prototype.apipost = function(cmd, msg, successCall, faildCall, isOnline) {
var apiurl = this.domainManager().DomainUrl + cmd;
var postData = this.GetPostData(cmd, msg, "");
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
path: '/login'
});
} else if (res.resultCode == 10005) {
this.$router.go(-1);
} else {
successCall(res);
}
}, faildCall)
}
//获取请求参数
Vue.prototype.GetPostData = function(cmd, msg, newCmd) {
if (msg == null || msg == "") {
msg = {}
}
var timestamp = (new Date()).valueOf();
if (!localStorage.mall_userInfo && localStorage.mall_userInfo != "" &&
this.$route.path.toLowerCase() != "/login" &&
this.$route.path.toLowerCase() != "/register" &&
this.$route.path.toLowerCase() != "/forgetpassword"
) {
this.$router.push({
path: '/login'
})
}
var token = "";
var key = "";
var MallBaseId = "0"; //小程序ID
var TenantId = "0"; //商户Id
var EmpId = 0; //员工编号【员工登录时使用】
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().Token;
key = this.getLocalStorage().SecretKey;
MallBaseId = this.getLocalStorage().MallBaseId;
TenantId = this.getLocalStorage().TenantId;
EmpId = this.getLocalStorage().EmpId;
}
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
let tempLanguage = 0;
if (localStorage.language && localStorage.language != '') {
if (localStorage.language == "zh-TW") {
tempLanguage = 1;
} else if (localStorage.language == "Japanese") {
tempLanguage = 2;
}
}
var cmdStr = "";
if (newCmd) {
cmdStr = newCmd;
}
var postData = {
msg: msg,
timestamp: timestamp,
token: token,
sign: md5Str,
languageId: tempLanguage,
cmd: cmdStr,
MallBaseId: MallBaseId,
TenantId: TenantId,
EmpId: EmpId,
// MiniAppId:"wxacd9f8cc3480d29e",
// OpenId:"ow_7I5ZQKhAB66yvOTGI35Xk-Kmg",
// UserId:19992,
}
return postData
},
//HTTP提交数据资产
Vue.prototype.assetsApipost = function(cmd, msg, successCall, faildCall, isOnline) {
var apiurl = this.domainManager().DomainUrl + cmd;
var postData = this.GetAssetsPostData(cmd, msg, "");
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
path: '/login'
});
} else if (res.resultCode == 10005) {
this.$router.go(-1);
} else {
successCall(res);
}
}, faildCall)
})
.catch(() => {
this.Info("已取消操作");
});
},
//域名管理对象
Vue.prototype.domainManager = function () {
let domainUrl = '';
let javaUrl='http://192.168.2.65:8018';
domainUrl = "http://192.168.2.214:8200";
//domainUrl = "https://localhost:5001";
let locationName = window.location.hostname;
if (locationName.indexOf('testmall.oytour') !== -1) {
domainUrl = "https://mallapi.oytour.com";
javaUrl="http://property.oytour.com";
} else if (locationName.indexOf('oytour') !== -1) {
domainUrl = "https://mallapi.oytour.com";
javaUrl="http://property.oytour.com";
}
//获取请求参数
Vue.prototype.GetAssetsPostData = function(cmd, msg, newCmd) {
if (msg == null || msg == "") {
msg = {}
}
var timestamp = (new Date()).valueOf();
if (!localStorage.mall_userInfo && localStorage.mall_userInfo != "" &&
this.$route.path.toLowerCase() != "/login" &&
this.$route.path.toLowerCase() != "/register" &&
this.$route.path.toLowerCase() != "/forgetpassword"
) {
this.$router.push({
path: '/login'
})
}
var token = "";
var key = "";
var MallBaseId = "0"; //小程序ID
var TenantId = "0"; //商户Id
var EmpId = 0; //员工编号【员工登录时使用】
var ERPGroupId = 0;
var ERPEmpId = 0;
var ERPBranchId = 0;
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().Token;
key = this.getLocalStorage().SecretKey;
MallBaseId = this.getLocalStorage().MallBaseId;
TenantId = this.getLocalStorage().TenantId;
EmpId = this.getLocalStorage().EmpId;
ERPGroupId = this.getLocalStorage().ERPGroupId;
ERPEmpId = this.getLocalStorage().ERPEmpId;
ERPBranchId = this.getLocalStorage().ERPBranchId;
var obj = {
//主地址npm
DomainUrl: domainUrl,
//资产管理
javaUrl: javaUrl,
//常用提交数据URL
PostUrl: domainUrl + "/api/common/post",
ImageUrl: 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com',
UploadFileUrl: domainUrl + '/api/File/LocalFileUploadImport',
UploadBlob: domainUrl + '/api/File/UploadBlob',
};
return obj;
},
//浏览器缓存
Vue.prototype.getLocalStorage = function () {
var localStorageData = window.localStorage["mall_userInfo"];
if (localStorageData !== undefined && localStorageData != 'undefined') {
return JSON.parse(localStorageData);
} else {
return null;
}
},
//验证只能输入2位小数【负数:isMinus传true】
Vue.prototype.checkPrice = function (item, filed, isMinus) {
var value = "" + item[filed]; //转字符串
var t = value.charAt(0);
value = value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
value = value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
value = value
.replace(".", "$#$")
.replace(/\./g, "")
.replace("$#$", ".");
value = value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
//如果第一位是负号,则允许添加 如果不允许添加负号 可以把这块注释掉
//是否允许负数
if (isMinus && t == '-') {
value = '-' + value;
}
item[filed] = value;
}
//验证只能输入整数【负数:isMinus传true】
Vue.prototype.checkInteger = function (item, filed, isMinus) {
var value = "" + item[filed]; //转字符串
var t = value.charAt(0);
value = value.replace(this.$commonUtils.Regex.isInteger, "");
//是否允许负数
if (isMinus && t == '-') {
value = '-' + value;
}
item[filed] = value;
},
//是否是线上环境【发布时修改为true】
Vue.prototype.isOnline = function () {
return process.env.NODE_ENV !== 'development';
},
//文件类型数组
Vue.prototype.FileType = function () {
var fileTypeJson = {
//主地址npm
UserImg: "User", //用户相图片
//常用提交数据URL
GoodsImg: "Goods", //素材相关文件
SetImg: "Set", //用户相图片
};
return fileTypeJson;
},
//上传文件到云存储
Vue.prototype.UploadFileToTencent = function (path, fileObj, callback) {
//获取文件扩展名
var filename = fileObj.name;
var index = filename.lastIndexOf(".");
var suffix = filename.substr(index);
var timestamp1 = Date.parse(new Date()) + "_" + (Math.ceil(Math.random() * 1000));
let str = '';
if (this.isOnline()) {
str = "/Test"
}
var newFileName = str + '/Upload/' + path + "/" + timestamp1 + "" + suffix;
var uploadMsg = {
Bucket: "viitto-1301420277",
Region: "ap-chengdu",
/* 存储桶所在地域,必须字段 */
SecretId: "AKIDDPnbIzi8C1eqEOPP8dw6MNAg9H9ldDKd",
SecretKey: "PdcLtOjslUzNFYdU4OSI1fKtdHpFT2Ob",
};
var COS = require('cos-js-sdk-v5');
var cos = new COS({
SecretId: uploadMsg.SecretId,
SecretKey: uploadMsg.SecretKey,
});
cos.putObject({
Bucket: uploadMsg.Bucket,
Region: uploadMsg.Region, //存储桶所在地域,必须字段
Key: newFileName, //文件名
StorageClass: 'STANDARD',
Body: fileObj, // 上传文件对象
onProgress: function (progressData) {}
}, function (err, data) {
if (data && data.statusCode == 200) {
var uploadResult = {
resultCode: 1,
FileName: fileObj.name,
FileUrl: "http://" + data.Location
}
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
let tempLanguage = 0;
if (localStorage.language && localStorage.language != '') {
if (localStorage.language == "zh-TW") {
tempLanguage = 1;
} else if (localStorage.language == "Japanese") {
tempLanguage = 2;
}
if (callback) {
callback(uploadResult);
}
var cmdStr = "";
if (newCmd) {
cmdStr = newCmd;
} else {
/*上传文件异常*/
console.log(err || data);
}
});
},
//公用跳转
Vue.prototype.CommonJump = function (path, obj) {
this.$router.push({
name: path,
query: obj
});
}
//公用判断图片地址 判断是否包含http
Vue.prototype.getIconLink = function (url) {
let str = ''
if (url && url != '') {
if (url.indexOf('http') != -1) {
str = url
} else {
str = this.domainManager().ImageUrl + url;
}
return str;
}
}
//HTTP提交数据
Vue.prototype.apipost = function (cmd, msg, successCall, faildCall, isOnline) {
var apiurl = this.domainManager().DomainUrl + cmd;
var postData = this.GetPostData(cmd, msg, "");
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
path: '/login'
});
} else if (res.resultCode == 10005) {
this.$router.go(-1);
} else {
successCall(res);
}
}, faildCall)
}
//获取请求参数
Vue.prototype.GetPostData = function (cmd, msg, newCmd) {
if (msg == null || msg == "") {
msg = {}
}
var timestamp = (new Date()).valueOf();
if (!localStorage.mall_userInfo && localStorage.mall_userInfo != "" &&
this.$route.path.toLowerCase() != "/login" &&
this.$route.path.toLowerCase() != "/register" &&
this.$route.path.toLowerCase() != "/forgetpassword"
) {
this.$router.push({
path: '/login'
})
}
var token = "";
var key = "";
var MallBaseId = "0"; //小程序ID
var TenantId = "0"; //商户Id
var EmpId = 0; //员工编号【员工登录时使用】
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().Token;
key = this.getLocalStorage().SecretKey;
MallBaseId = this.getLocalStorage().MallBaseId;
TenantId = this.getLocalStorage().TenantId;
EmpId = this.getLocalStorage().EmpId;
}
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
let tempLanguage = 0;
if (localStorage.language && localStorage.language != '') {
if (localStorage.language == "zh-TW") {
tempLanguage = 1;
} else if (localStorage.language == "Japanese") {
tempLanguage = 2;
}
}
var cmdStr = "";
if (newCmd) {
cmdStr = newCmd;
}
var postData = {
msg: msg,
timestamp: timestamp,
token: token,
sign: md5Str,
languageId: tempLanguage,
cmd: cmdStr,
MallBaseId: MallBaseId,
TenantId: TenantId,
EmpId: EmpId,
MiniAppId: "wxacd9f8cc3480d29e",
OpenId: "ow_7I5ZQKhAB66yvOTGI35Xk-Kmg",
// UserId:19992,
}
return postData
},
//HTTP提交数据资产
Vue.prototype.assetsApipost = function (cmd, msg, successCall, faildCall, isOnline) {
var apiurl = this.domainManager().DomainUrl + cmd;
var postData = this.GetAssetsPostData(cmd, msg, "");
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
var postData = {
msg: msg,
timestamp: timestamp,
token: token,
sign: md5Str,
languageId: tempLanguage,
cmd: cmdStr,
MallBaseId: MallBaseId,
TenantId: TenantId,
EmpId: EmpId,
ERPGroupId: ERPGroupId,
ERPEmpId: ERPEmpId,
ERPBranchId: ERPBranchId,
// MiniAppId:"wxacd9f8cc3480d29e",
// OpenId:"ow_7I5ZQKhAB66yvOTGI35Xk-Kmg",
// UserId:19992,
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
path: '/login'
});
} else if (res.resultCode == 10005) {
this.$router.go(-1);
} else {
successCall(res);
}
return postData
},
//文件下载
Vue.prototype.GetLocalFile = function(cmd, msg, fileName, newCmd, successCall) {
var apiurl = this.domainManager().DomainUrl + cmd;
var postData = this.GetPostData(cmd, msg, newCmd);
this.$http.post(apiurl, postData, {
responseType: 'arraybuffer'
}).then((res) => {
let blob = new Blob([res.data], {
type: "application/vnd.ms-excel"
})
let url = URL.createObjectURL(blob);
let link = document.createElement('a');
link.href = url;
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
successCall(res);
}).catch(function(res) {});
},
//调用资产的接口
Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") {
msg = {}
}
var apiurl = this.domainManager().javaUrl + cmd;
var timestamp = (new Date()).valueOf();
this.apiurl = apiurl;
var token = "";
var key = "";
var MallBaseId = "0"; //小程序ID
var TenantId = "0"; //商户Id
var uid = "0"
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().Token;
key = this.getLocalStorage().SecretKey;
MallBaseId = this.getLocalStorage().MallBaseId;
TenantId = this.getLocalStorage().TenantId;
uid =this.getLocalStorage().ERPEmpId
}
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`msg=YXZCGL2020&timestamp=${timestamp}&token=${token}&key=${key}`);
// var md5Str = md5(`msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
}, faildCall)
}
//获取请求参数
Vue.prototype.GetAssetsPostData = function (cmd, msg, newCmd) {
if (msg == null || msg == "") {
msg = {}
}
var timestamp = (new Date()).valueOf();
if (!localStorage.mall_userInfo && localStorage.mall_userInfo != "" &&
this.$route.path.toLowerCase() != "/login" &&
this.$route.path.toLowerCase() != "/register" &&
this.$route.path.toLowerCase() != "/forgetpassword"
) {
this.$router.push({
path: '/login'
})
}
var token = "";
var key = "";
var MallBaseId = "0"; //小程序ID
var TenantId = "0"; //商户Id
var EmpId = 0; //员工编号【员工登录时使用】
var ERPGroupId = 0;
var ERPEmpId = 0;
var ERPBranchId = 0;
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().Token;
key = this.getLocalStorage().SecretKey;
MallBaseId = this.getLocalStorage().MallBaseId;
TenantId = this.getLocalStorage().TenantId;
EmpId = this.getLocalStorage().EmpId;
ERPGroupId = this.getLocalStorage().ERPGroupId;
ERPEmpId = this.getLocalStorage().ERPEmpId;
ERPBranchId = this.getLocalStorage().ERPBranchId;
}
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
let tempLanguage = 0;
if (localStorage.language && localStorage.language != '') {
if (localStorage.language == "zh-TW") {
tempLanguage = 1;
} else if (localStorage.language == "Japanese") {
tempLanguage = 2;
}
}
var cmdStr = "";
if (newCmd) {
cmdStr = newCmd;
}
var postData = {
msg: msg,
timestamp: timestamp,
token: token,
sign: md5Str,
languageId: tempLanguage,
cmd: cmdStr,
MallBaseId: MallBaseId,
TenantId: TenantId,
EmpId: EmpId,
ERPGroupId: ERPGroupId,
ERPEmpId: ERPEmpId,
ERPBranchId: ERPBranchId,
// MiniAppId:"wxacd9f8cc3480d29e",
// OpenId:"ow_7I5ZQKhAB66yvOTGI35Xk-Kmg",
// UserId:19992,
}
return postData
},
var postData = {
"msg": msg,
"timestamp": timestamp,
"token": token,
"sign": md5Str,
"MallBaseId": MallBaseId,
"TenantId": TenantId,
'uid':uid
//文件下载
Vue.prototype.GetLocalFile = function (cmd, msg, fileName, newCmd, successCall) {
var apiurl = this.domainManager().DomainUrl + cmd;
var postData = this.GetPostData(cmd, msg, newCmd);
this.$http.post(apiurl, postData, {
responseType: 'arraybuffer'
}).then((res) => {
let blob = new Blob([res.data], {
type: "application/vnd.ms-excel"
})
let url = URL.createObjectURL(blob);
let link = document.createElement('a');
link.href = url;
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
successCall(res);
}).catch(function (res) {});
},
}
if (localStorage.g && localStorage.g != 'undefined') {
// postData.groupId = parseInt(JSON.parse(localStorage.g).i)
postData.groupId = 2;
}
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
path: '/login'
})
} else if (res.data.resultCode == 10005) {
this.$router.go(-1)
} else {
successCall(res)
}
}, faildCall)
//调用资产的接口
Vue.prototype.apiJavaPost = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") {
msg = {}
}
var apiurl = this.domainManager().javaUrl + cmd;
var timestamp = (new Date()).valueOf();
this.apiurl = apiurl;
var token = "";
var key = "";
var MallBaseId = "0"; //小程序ID
var TenantId = "0"; //商户Id
var uid = "0"
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().Token;
key = this.getLocalStorage().SecretKey;
MallBaseId = this.getLocalStorage().MallBaseId;
TenantId = this.getLocalStorage().TenantId;
uid = this.getLocalStorage().ERPEmpId
}
var md5Str = md5(`msg=YXZCGL2020&timestamp=${timestamp}&token=${token}&key=${key}`);
var postData = {
"msg": msg,
"timestamp": timestamp,
"token": token,
"sign": md5Str,
"MallBaseId": MallBaseId,
"TenantId": TenantId,
'uid': uid
}
if (localStorage.g && localStorage.g != 'undefined') {
postData.groupId = 2;
}
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
path: '/login'
})
} else if (res.data.resultCode == 10005) {
this.$router.go(-1)
} else {
successCall(res)
}
}, faildCall)
}
}
}
\ No newline at end of file
......@@ -790,6 +790,25 @@ export default new Router({
]
},
{
path: '/pintuanMain',
name: 'pintuanMain',
component: resolve => require(['@/components/pintuanMain'], resolve),
children: [
//拼团 拼团设置
{
path: '/pintuanSet',
name: 'pintuanSet',
component: resolve => require(['@/components/pintuan/pintuanSet'], resolve),
},
//拼团 消息通知
{
path: '/pintuanMsg',
name: 'pintuanMsg',
component: resolve => require(['@/components/pintuan/pintuanMsg'], resolve),
}
]
}
]
})
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