Commit 1398b7f4 by 前端

Merge branch 'v3.4.0' into 'master'

V3.4.0

See merge request !1
2 parents 508bbb6f 17f58197
......@@ -3,6 +3,9 @@
"env": {
"node": true
},
"globals": {
"AMap": true
},
"extends": ["plugin:vue/essential", "@vue/prettier"],
"rules": {
"no-console": "off",
......
......@@ -1130,7 +1130,6 @@
"version": "7.20.7",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.7.tgz",
"integrity": "sha512-UF0tvkUtxwAgZ5W/KrkHf0Rn0fdnLDU9ScxBrEVNUprE/MzirjK4MJUX1/BVDv00Sv8cljtukVK1aky++X1SjQ==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.13.11"
},
......@@ -1138,8 +1137,23 @@
"regenerator-runtime": {
"version": "0.13.11",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==",
"dev": true
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="
}
}
},
"@babel/runtime-corejs3": {
"version": "7.20.7",
"resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.20.7.tgz",
"integrity": "sha512-jr9lCZ4RbRQmCR28Q8U8Fu49zvFqLxTY9AMOUz+iyMohMoAgpEcVxY+wJNay99oXOpOcCTODkk70NDN2aaJEeg==",
"requires": {
"core-js-pure": "^3.25.1",
"regenerator-runtime": "^0.13.11"
},
"dependencies": {
"regenerator-runtime": {
"version": "0.13.11",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="
}
}
},
......@@ -4031,6 +4045,11 @@
"browserslist": "^4.21.4"
}
},
"core-js-pure": {
"version": "3.27.1",
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.27.1.tgz",
"integrity": "sha512-BS2NHgwwUppfeoqOXqi08mUqS5FiZpuRuJJpKsaME7kJz0xxuk0xkhDdfMIlP/zLa80krBqss1LtD7f889heAw=="
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
......@@ -13344,6 +13363,23 @@
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz",
"integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw=="
},
"wangeditor": {
"version": "4.7.15",
"resolved": "https://registry.npmjs.org/wangeditor/-/wangeditor-4.7.15.tgz",
"integrity": "sha512-aPTdREd8BxXVyJ5MI+LU83FQ7u1EPd341iXIorRNYSOvoimNoZ4nPg+yn3FGbB93/owEa6buLw8wdhYnMCJQLg==",
"requires": {
"@babel/runtime": "^7.11.2",
"@babel/runtime-corejs3": "^7.11.2",
"tslib": "^2.1.0"
},
"dependencies": {
"tslib": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz",
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA=="
}
}
},
"watchpack": {
"version": "1.7.5",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz",
......
......@@ -14,10 +14,11 @@
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.2.5",
"glsx-components": "^1.5.4",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vuex": "^3.1.2"
"vuex": "^3.1.2",
"wangeditor": "^4.7.15"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
......
<template>
<div id="app">
<!-- <h2>
报表子应用
<span class="right"></span>
</h2>
<div id="nav">
<span>切换路由:</span>
<el-button-group class="right">
<el-button type="primary" size="medium" @click="routerChange('/')">报表</el-button>
<el-button type="primary" size="medium" @click="routerChange('/about')">穿梭框</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-1')">表格</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-2')">日历</el-button>
<el-button type="primary" size="medium" @click="toAppReport('3-1')">aaaa</el-button>
</el-button-group>
</div>
<div class="parent-child-communication">
<h3>父子应用通信:</h3>
<div style="margin-bottom: 20px;">
<span>rxjs通信方案:</span>
<el-button class="right" type="primary" size="medium" @click="callParentChange('rxjs')">通知父应用变天了</el-button>
</div>
<div>
<span>官方通信方案:</span>
<el-button class="right" type="primary" size="medium" @click="callParentChange('default')">通知父应用收到</el-button>
</div>
<img src="./assets/logo.png" alt="" srcset="" />
</div>-->
<router-view />
</div>
</template>
......
import { http } from '@/main'
const url = 'rop-scrm-shopmall/router'
// 分页查询频道列表
const getChannelListApi = params => {
params.method = `scrm.api.shopmall.discover.channel.page`
return http({
url,
method: 'post',
data: params,
sign: true
})
}
// 频道详情
const getChannelDetail = params => {
params.method = `scrm.api.shopmall.discover.channel.detail`
return http({
url,
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
// 新增或编辑频道
const updateChannel = params => {
params.method = `scrm.api.shopmall.discover.channel.add.or.update`
return http({
url,
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
// 门店频道详情
const getMerchantChannelDetail = params => {
params.method = `scrm.api.shopmall.discover.channel.merchant.detail`
return http({
url,
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
// 新增或编辑门店频道
const updateMerchantChannel = params => {
params.method = `scrm.api.shopmall.discover.channel.merchant.add.or.update`
return http({
url,
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
// 开通订阅
const openSubscribe = params => {
params.method = `entmicro.api.system.subscribe.open`
return http({
url,
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
//查询商户配置
const selStoreConfig = params => {
params.method = `scrm.api.equity.service.merchant.pagination.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
returnAll: true
})
}
// 关联活动
const correlateActivity = params => {
params.method = `entmicro.api.system.subscribe.activity.correlate`
return http({
url,
method: 'POST',
data: params,
returnAll: true
})
}
const getActivityList = params => {
params.method = `scrm.api.shopmall.select.bulge.activity.page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
returnAll: true
})
}
// 更改商户开通状态
const updateState = params => {
params.method = `entmicro.api.system.subscribe.state.update`
return http({
url,
method: 'POST',
data: params,
returnAll: true
})
}
// 生成救援贴
const generateRescueCode = params => {
params.method = `entmicro.api.system.subscribe.rescue.generate`
return http({
url,
method: 'POST',
data: params,
returnAll: true
})
}
// 订阅开通商户分页查询
const subscribeMerchant = params => {
params.method = `entmicro.api.system.subscribe.merchant.page`
return http({
url,
method: 'POST',
data: params,
returnAll: true
})
}
export default { updateMerchantChannel,getMerchantChannelDetail,subscribeMerchant, generateRescueCode, updateState, getActivityList, getChannelListApi, openSubscribe, selStoreConfig, getChannelDetail, updateChannel, correlateActivity }
import { http, http_common, http2, http_merchant } from '@/main'
const defaultPath = 'scrm.api.carlife.'
const uploadImgApi = params => {
params.method = `${defaultPath}common.uploadImg`
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const uploadVideoApi = params => {
params.method = `${defaultPath}common.uploadVideo`
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const pictureUpload = params => {
params.method = 'glsx.accounts.biz.common.pictureUpload'
return http_common({
url: '/router?method=glsx.accounts.biz.common.pictureUpload',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const getMerchantList = params => {
params.method = `${defaultPath}merchant.listWithPageByCurMerchant`
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true
})
}
// const pictureUpload = params => {
// params.method = 'glsx.accounts.biz.common.pictureUpload'
// return http_common({
// url: '/router?method=glsx.accounts.biz.common.pictureUpload',
// method: 'POST',
// data: params,
// sign: true,
// noSignAttr: ['file']
// })
// }
export default { uploadImgApi, uploadVideoApi,getMerchantList,pictureUpload }
import { http } from '@/main'
const url = 'rop-scrm-shopmall/router'
// 门店频道-门店列表
const getMerchantListApi = params => {
params.method = `scrm.api.shopmall.discover.channel.merchant.list`
return http({
url,
method: 'post',
data: params,
sign: true
})
}
// 门店频道分享
const getMerchantShare = params => {
params.method = `scrm.api.shopmall.discover.channel.merchant.shared`
return http({
url,
method: 'post',
data: params,
sign: true
})
}
// 新增或编辑门店频道
const configMerchant = params => {
params.method = `scrm.api.shopmall.discover.channel.merchant.config`
return http({
url,
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
// 开通订阅
const openSubscribe = params => {
params.method = `entmicro.api.system.subscribe.open`
return http({
url,
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
//查询商户配置
const selStoreConfig = params => {
params.method = `scrm.api.equity.service.merchant.pagination.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
returnAll: true
})
}
// 获取门店频道配置
const getconfigMerchant = params => {
params.method = `scrm.api.shopmall.discover.channel.merchant.getconfig`
return http({
url,
method: 'POST',
data: params
})
}
// 分页查询频道主题(内容)列表
const getChannelTopicList = params => {
params.method = `scrm.api.shopmall.discover.channel.topic.page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
returnAll: true
})
}
// 频道主题详情
const getTopicDetail = params => {
params.method = `scrm.api.shopmall.discover.channel.topic.detail`
return http({
url,
method: 'POST',
data: params,
returnAll: true
})
}
// 新增或编辑频道主题
const addChannelTopic = params => {
params.method = `scrm.api.shopmall.discover.channel.topic.add.or.update`
return http({
url,
method: 'POST',
data: params,
returnAll: true
})
}
// 媒体文件列表
const getTencentcloudmedialist = params => {
params.method = `scrm.api.shopmall.tencentcloudmedia.list`
return http({
url,
method: 'POST',
data: params,
returnAll: true
})
}
//膨胀金活动
const bulgeActivity = params => {
params.method = 'scrm.api.shopmall.bulge.activity.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//众筹活动
const crowdfundingActivity = params => {
params.method = 'scrm.api.shopmall.all.crowdfunding.activity.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//商品
const goodsActivity = params => {
params.method = 'scrm.api.shopmall.goods.page.allMerchant'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
// 频道主题(内容)-置顶
const topshelvesChannel = params => {
params.method = 'scrm.api.shopmall.discover.channel.topic.topshelves'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 频道主题(内容)-上下架
const updownshelvesChannel = params => {
params.method = 'scrm.api.shopmall.discover.channel.topic.updownshelves'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 删除频道主题(内容)
const deleteChannel = params => {
params.method = 'scrm.api.shopmall.discover.channel.topic.delete'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 膜类专区-配置券
const configCoupons = params => {
params.method = 'scrm.api.shopmall.discover.channel.topic.configcoupons'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 编辑-选择定向礼包列表
const getDirectionalGiftListApi = params => {
params.method = 'scrm.api.coupon.gh.group.equity.coupon.list'
// params.method = 'scrm.api.coupon.gh.group.equity.coupon.list'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
// 获取膜类专区-配置券
const getCouponconfig = params => {
params.method = 'scrm.api.shopmall.discover.channel.topic.getcouponconfig'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true,
returnAll: true
})
}
export default { getCouponconfig, configCoupons, getDirectionalGiftListApi, deleteChannel, updownshelvesChannel, topshelvesChannel, goodsActivity, crowdfundingActivity, bulgeActivity, getTencentcloudmedialist, addChannelTopic, getTopicDetail, getChannelTopicList, getMerchantListApi, openSubscribe, selStoreConfig, getMerchantShare, configMerchant, getconfigMerchant }
import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.'
const getZoneListApi = params => {
params.method = `${defaultPath}zoneInfo.page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
const deleteZoneApi = params => {
params.method = `${defaultPath}zoneInfo.delete`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const getZoneInfoApi = params => {
params.method = `${defaultPath}zoneInfo.getById`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
const insertZoneApi = params => {
params.method = `${defaultPath}zoneInfo.insertOrUpdate`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getZoneListApi, deleteZoneApi, getZoneInfoApi, insertZoneApi }
......@@ -5,19 +5,137 @@ html {
margin: 0;
padding: 0;
overflow: hidden;
background-color: #F4F5FA;
background-color: #f4f5fa;
}
.marketing .container {
.container {
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.marketing .m-b-20 {
.m-b-20 {
margin-bottom: 20px;
}
.marketing.p-t-20 {
.p-t-20 {
padding-top: 20px;
}
\ No newline at end of file
}
.container {
background: #ffffff;
padding: 20px;
}
.word-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.flex {
display: flex;
align-items: center;
}
.mgt15 {
margin-top: 15px;
}
.mgt16 {
margin-top: 16px;
}
.mrt5 {
margin-top: 5px;
}
.text-tip {
font-weight: 400;
font-size: 14px;
color: #999999;
margin-left: 154px;
margin-bottom: 10px;
}
.text-tip-line {
font-weight: 400;
font-size: 14px;
color: #999999;
}
.img-36 {
width: 36px;
height: 36px;
}
.pointer {
cursor: pointer;
}
.activity-box {
width: 248px;
height: auto;
background: #f5f5f5;
border-radius: 2px;
padding: 10px 12px;
box-sizing: border-box;
margin-top: 10px;
position: relative;
.activity-box-title {
font-weight: 600;
font-size: 14px;
color: #333333;
margin-bottom: 10px;
line-height: 20px;
}
.time {
font-weight: 400;
font-size: 12px;
color: #999999;
margin-bottom: 4px;
line-height: 17px;
}
.gift {
position: absolute;
bottom: 0;
width: 24px;
height: 24px;
right: 0;
img {
width: 100%;
}
}
}
.goodss-box {
width: 248px !important;
padding: 16px;
box-sizing: border-box;
background: #f9f9f9;
border-radius: 4px;
display: flex;
align-items: center;
margin-top: 10px;
}
.theme-color {
color: #5850ff;
}
.flex-default {
display: flex;
}
.goods-img {
width: 60px;
height: 60px;
border-radius: 2px;
margin-right: 8px;
img {
width: 100%;
height: 100%;
}
}
.goods-title {
font-size: 14px;
color: #333333;
line-height: 21px;
}
.goods-price {
color: #999999;
font-size: 12px;
font-weight: 400;
line-height: 17px;
margin-top: 4px;
}
.table-popover-img {
width: 120px;
}
.mrb20{
margin-bottom :20px !important;;
}
<template>
<div class="report-home">
HOME
<GLButton type="danger" @click="test()" class="test555" id="1-1-1-1" mode="link">权限按钮测试</GLButton>
<GLButton type="success" size="small" @click="test()" id="1-1-1-1" class="test">权限按钮测试2</GLButton>
<el-button class="test" @click="test()">东方网分</el-button>
<div class="view-panel">
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<video width="100%" autoplay controls :src="dialogSrc" v-else></video>
</div>
</template>
<script>
export default {
name: 'home',
name: 'view',
data() {
return {
dialogVisibleImg: true
}
},
props: {
dialogType: String,
dialogSrc: String
},
methods: {
test() {
console.log('点击了按钮')
......@@ -17,4 +23,4 @@ export default {
}
}
}
</script>
</script>
\ No newline at end of file
/**
* 时间控件-限制月份
*/
export const beforeRangePickerOptions = {
disabledDate(date) {
if (date > new Date()) {
return true
}
return false
}
}
export const afterRangePickerOptions = {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
if (date < yesterday) {
return true
}
return false
}
}
<template>
<div class="map-box" :style="{ height: mapHeight + 'px', width: mapWidth + 'xp' }">
<div id="container">
<el-select v-model="input" class="map-input" filterable remote reserve-keyword placeholder="请输入" :remote-method="remoteMethod" @change="handleChangeAdr" :loading="loading">
<el-option v-for="item in adrList" :key="item.id" :label="item.address" :value="item.id"></el-option>
</el-select>
</div>
<div class="map-address">
<img class="icon-map" src="./images/icon-map.png" />
{{ address }}
</div>
</div>
</template>
<script>
let map, marker, placeSearch
export default {
name: 'map',
props: {
mapHeight: {
type: Number,
default: 460
},
mapWidth: {
type: Number,
default: 740
}
},
data() {
return {
input: [],
address: '',
adrList: [],
lnglat: [],
geocoderAddress: {}
}
},
mounted() {
this.mapInit()
},
methods: {
// initMap() {
// console.log(document.getElementsByTagName('head'))
// var script = document.createElement('script')
// script.type = 'text/javascript'
// script.src = 'https://webapi.amap.com/loader.js'
// document.getElementsByTagName('head')[0].appendChild(script)
// },
mapInit() {
/* eslint-disable */
AMapLoader.load({
/* eslint-enable */
key: '44cc16e43ad7ed3358df507bd0618181', // 申请好的Web端开发者Key,首次调用 load 时必填
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
// 需要使用的的插件列表
plugins: ['AMap.ToolBar', 'AMap.Scale', 'AMap.Geocoder'],
AMapUI: {
// 是否加载 AMapUI,缺省不加载
version: '1.1', // AMapUI 版本
plugins: ['overlay/SimpleMarker'] // 需要加载的 AMapUI ui插件
},
Loca: {
// 是否加载 Loca, 缺省不加载
version: '2.0' // Loca 版本
}
})
.then(AMap => {
map = new AMap.Map('container', {
zoom: 20,
autoFitView: true,
resizeEnable: true,
cursor: 'move'
})
if (this.lnglat.length) {
this.addMarker(this.lnglat)
}
map.addControl(new AMap.Scale())
map.addControl(new AMap.ToolBar())
this.geocoder = new AMap.Geocoder()
map.setDefaultCursor('pointer')
AMap.plugin(['AMap.PlaceSearch'], function() {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
})
})
map.on('click', this.getAddress)
})
.catch(e => {
console.error(e) //加载错误提示
})
},
remoteMethod(query) {
if (query == '') {
return true
}
let _this = this
placeSearch.search(query, function(status, result) {
if (status === 'complete' && result.poiList.pois.length) {
_this.adrList = result.poiList.pois
}
})
},
addMarker(lnglat) {
let position
if (lnglat.lng) {
position = [lnglat.lng, lnglat.lat]
} else {
position = lnglat
}
this.lnglat = position
marker = new AMap.Marker({
map: map,
icon: new AMap.Icon({
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
size: new AMap.Size(27, 34), //图标大小
imageSize: new AMap.Size(27, 34)
}),
// draggable: true,
position: position,
offset: new AMap.Pixel(-10, -10)
})
map.setCenter(position)
map.add(marker)
marker.setMap(map)
// this.map.setFitView()
},
getAddress(e) {
let self = this
let position
if (e.type == 'click') {
position = e.lnglat
} else {
let { lng, lat } = e
position = [lng, lat]
}
if (marker) {
map.remove(marker)
marker.setMap(null)
marker = null
}
self.addMarker(position)
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
geocoder.getAddress(position, (status, result) => {
self.address = result.regeocode.formattedAddress
geocoder.getLocation(self.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
self.geocoderAddress = result.geocodes[0]
}
})
})
})
},
handleChangeAdr(val) {
if (val) {
var location = this.adrList.find(item => item.id == val)
this.getAddress(location.location)
this.input = ''
this.adrList = []
}
}
}
}
</script>
<style scoped lang="scss">
.map-box {
display: flex;
#container {
position: relative;
width: calc(100% - 284px - 16px);
height: 100%;
}
.map-input {
position: absolute;
top: 32px;
width: 60%;
left: 25%;
z-index: 2;
}
}
#panel {
position: absolute;
max-height: 90%;
overflow-y: auto;
top: 80px;
right: 10px;
width: 280px;
}
.map-address {
display: flex;
box-sizing: border-box;
width: 284px;
height: 100%;
background-color: #f9f9f9;
padding: 20px;
margin-left: 16px;
line-height: 20px;
.icon-map {
width: 16px;
height: 16px;
margin-right: 6px;
}
}
</style>
<template>
<div v-if="provinceView">
<el-form ref="provinceForm" :model="provinceForm" inline="true" class="province" style="padding-left: 0;">
<el-select size="small" v-model="provinceForm.provinceName" clearable :disabled="isDisabled" placeholder="选择省份" :style="{ width: defaultWidth }" @change="selectProvince" class="select-padding">
<el-option v-for="item in AllData" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectProvince(item)"></el-option>
</el-select>
<el-select size="small" v-model="provinceForm.cityName" clearable :disabled="isDisabled" placeholder="选择市" :style="{ width: defaultWidth }" @change="selectCity" class="select-padding">
<el-option v-for="item in cityList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectCity(item)"></el-option>
</el-select>
<el-select v-if="subdistrict == 3" size="small" v-model="provinceForm.townName" clearable :disabled="isDisabled" placeholder="选择区" :style="{ width: defaultWidth }" @change="selectTown" class="select-padding">
<el-option v-for="item in townList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectTown(item)"></el-option>
</el-select>
</el-form>
</div>
</template>
<script>
export default {
name: 'GLProvince',
props: {
// 省市级别,2--只显示省市,3--显示省市区,默认只显示省市
subdistrict: {
type: Number,
default: 2
},
// 省市下拉组件宽度
defaultWidth: {
type: String,
default: '150px'
},
// 组件是否展示,默认展示
provinceView: {
type: Boolean,
default: true
},
isDisabled: {
type: Boolean,
default: false
}
},
data() {
return {
// 所有数据
AllData: [],
// 城市列表
cityList: [],
// 地区列表
townList: [],
provinceForm: {
// 省份名称
provinceName: '',
// 城市名称
cityName: '',
// 地区名称
townName: '',
// 省份代码
provinceCode: '',
// 城市代码
cityCode: '',
// 地区代码
townCode: ''
}
}
},
mounted() {
this.provinceList()
},
methods: {
/*
* @params:传入的为一个key-value的对象
1、keywords --查询关键字,只支持单个关键词语搜索关键词支持:行政区名称、citycode、adcode
列如:this.provinceList({keywords: '山东省'}),这样就可以筛选出山东省下的市、区信息
2、subdistrict --设置显示下级行政区级数,0:不返回下级行政区;1:返回下一级行政区;2:返回下两级行政区;3:返回下三级行政区;
不传的话默认为2,可以在组件中穿,也可以在调用方法的时候传,如果需要展示省市组件,传值最小为2
3、page --最外层的districts最多会返回20个数据,若超过限制,请用page请求下一页数据。
例如page=2;page=3。默认page=1
4、extensions --控制行政区信息中返回行政区边界坐标点; 可选值:base、all;
base:不返回行政区边界坐标点;(默认)
all:只返回当前查询district的边界值,不返回子节点的边界值;目前不能返回乡镇/街道级别的边界值
5、filter -- 按照指定行政区划进行过滤,填入后则只返回该省/直辖市信息,需填入adcode,为了保证数据的正确,强烈建议填入此参数
6、callback -- callback值是用户定义的函数名称,此参数只在output=JSON时有效
7、output --返回数据格式类型,可选值:JSON,XML(默认JSON)
* @return:返回的是一个promise对象,如果不需要展示组件,只需要获取值,可以直接调用方法,异步获取返回值
列如:
const p = this.$refs.provinceForm.provinceList({xxxx(可传值,传值可参考上文params描述) })
p.then(r => {
// r 为返回结果
console.log(r)
})
**/
// 获取省市信息
provinceList(params = {}) {
params ? (params.subdistrict ? '' : (params.subdistrict = this.subdistrict)) : (params.subdistrict = this.subdistrict)
let data = ''
for (let key in params) {
data += '&' + key + '=' + params[key]
}
let path = `https://restapi.amap.com/v3/config/district?key=d22348363c34c266f772ae9b635eef2a`
path = path + data
const pro = fetch(path).then(res => {
return res.json()
})
if (this.provinceView) {
pro.then(r => {
this.AllData = r.districts[0].districts
})
}
return pro
},
// 省市回显
init(province, city, town) {
this.provinceForm = {
provinceName: province,
cityName: city,
townName: town
}
if (province) {
this.AllData.map(item => {
if (item.name.indexOf(province) != -1) {
this.provinceForm.provinceName = item.name
this.cityList = item.districts
this.provinceForm.provinceCode = item.adcode
if (city) {
this.cityList.map(itm => {
if (itm.name.indexOf(city) != -1) {
this.provinceForm.cityCode = itm.adcode
this.provinceForm.cityName = itm.name
this.townList = itm.districts
if (town) {
this.townList.map(itmx => {
if (itmx.name.indexOf(town) != -1) {
this.provinceForm.townCode = itmx.adcode
this.provinceForm.townName = itmx.name
}
})
}
}
})
}
}
})
}
},
// 选择省
selectProvince(val) {
this.provinceForm.cityName = ''
this.provinceForm.townName = ''
this.cityList = val.districts
this.$emit('selectProvince', { provinceName: val.name, provinceCode: val.adcode })
},
// 选择市
selectCity(val) {
this.provinceForm.townName = ''
this.townList = val.districts
this.$emit('selectCity', { cityName: val.name, cityCode: val.adcode })
},
// 选择区
selectTown(val) {
this.$emit('selectTown', { townName: val.name, townCode: val.adcode })
}
}
}
</script>
<style lang="scss">
.province {
display: inline-flex;
.el-select .el-input {
width: auto !important;
}
}
.select-padding {
margin-right: 10px;
}
</style>
......@@ -9,5 +9,13 @@
*/
import Vue from 'vue'
import glsxDialog from '@/components/glsx-dialog/index.vue'
import glsxPreview from '@/components/preview/index.vue'
import glsxCombiForm from '@/components/glsx-combi-form/index.vue'
import bigView from '@/components/big-view/index.vue'
import activityModel from '@/components/activity-model/index.vue'
Vue.component('glsx-dialog', glsxDialog)
\ No newline at end of file
Vue.component('glsx-combi-form', glsxCombiForm)
Vue.component('glsx-dialog', glsxDialog)
Vue.component('glsx-preview', glsxPreview)
Vue.component('big-view', bigView)
Vue.component('activity-model', activityModel)
\ No newline at end of file
<template>
<div class="activity-img-box">
<template v-if="imageUrlArr && imageUrlArr.length > 0">
<div v-for="(item, index) in imageUrlArr" :key="index">
<div class="pic-box" :style="{ width: picOptions.width, height: picOptions.height }">
<img class="photo-activity" :src="item" alt="" />
<div class="mask" :style="{ width: picOptions.width, height: picOptions.height }">
<div class="pic-pane-close" @click="handleEnlarge(item)">
<img src="../../assets/channel/view.png" alt="" />
</div>
<template v-if="picOptions.isClose">
<div class="pic-pane-close" @click="close('img', index)">
<img src="../../assets/channel/dele.png" alt="" />
</div>
</template>
</div>
</div>
</div>
</template>
<template v-if="(imageUrlArr && imageUrlArr.length < 9 && limit > 1) || (imageUrlArr&&imageUrlArr.length == 0 && limit == 1)">
<div class="upload-img">
<i class="el-icon-plus avatar-uploader-desc-icon"></i>
<div class="avatar-uploader-desc-word">上传照片</div>
<input type="file" ref="uploadImg" class="upload-img" style="opacity: 0" accept=".jpg, .jpeg, .png" @change="e => handleImgChange(e)" />
</div>
</template>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="50%">
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<!-- <video width="100%" autoplay controls :src="dialogSrc" v-else></video> -->
</el-dialog>
</div>
</template>
<script>
export default {
props: {
picOptions: {
type: Object,
default: () => {
return {
width: '104px',
height: '104px',
isClose: true
}
}
},
imageUrlArr: {
type: Array,
default: () => []
},
limit: {
type: String,
default: '1'
},
index: {
type: Number,
default: -1
}
},
data() {
return {
dialogVisibleImg: false
}
},
methods: {
// 上传图片
handleImgChange(e) {
this.$notify({
title: '提示',
message: '图片上传中,请稍后'
})
var file = e.srcElement.files[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
if (this.imageUrlArr.length > 9) {
this.$message.error('最多上传9张图片')
return
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const arrBase64 = imgFile.split(',')
const splitStr = file.name.split('.')
const fileUrl = splitStr[splitStr.length - 1] + '@' + arrBase64[1]
this.$apis.common.pictureUpload({ file: fileUrl, compress: this.picOptions.compress || 0 }).then(res => {
if (res) {
this.$notify({
title: '提示',
message: '图片上传成功',
type: 'success'
})
this.imageUrlArr.push(res)
this.$emit('change', { arr: this.imageUrlArr, key: this.picOptions.key, index: this.index })
}
e.target.value = ''
this.$refs.uploadImg.value = ''
})
}
},
// 预览图文
handleEnlarge(src, type) {
this.dialogVisibleImg = true
this.dialogSrc = src
this.dialogType = type ? type : 'img'
},
// 删除图片/视频
close(type, index) {
switch (type) {
case 'radio':
this.videoUrl = ''
this.videoImage = ''
break
case 'img':
this.imageUrlArr.splice(index, 1)
this.$emit('change', { arr: this.imageUrlArr, key: this.picOptions.key, id: 1, index: this.index })
break
default:
this.videoUrl = ''
}
}
}
}
</script>
<style scoped lang="scss">
.activity-img-box {
display: flex;
flex-wrap: wrap;
max-width: 600px;
.pic-box {
position: relative;
width: 104px;
height: 104px;
border-radius: 4px;
margin-right: 8px;
margin-bottom: 5px;
&:hover .mask {
opacity: 1;
}
.pic {
position: absolute;
object-fit: fill;
}
.photo-activity {
position: absolute;
width: 100%;
height: 100%;
}
.mask {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
background: rgba(0, 0, 0, 0.5);
color: #ffffff;
opacity: 0;
top: 0;
right: 0;
width: 104px;
height: 104px;
z-index: 999;
.pic-pane-close {
width: 14px;
height: 14px;
cursor: pointer;
margin-right: 8px;
img{
width:100%;
display: block;
}
}
}
}
.upload-img {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 104px;
height: 104px;
background: rgba(0, 0, 0, 0.04);
border: 1px dashed rgba(0, 0, 0, 0.15);
border-radius: 4px;
input {
position: absolute;
// top: 0;
// left: 0;
width: 104px;
height: 104px;
}
}
.avatar-uploader-desc-word {
font-weight: 400;
font-size: 28rpx;
color: #666666;
}
.image-dialog {
/deep/ {
.el-dialog__header {
border-bottom: 0px;
padding: 0px;
}
}
}
}
</style>
\ No newline at end of file
<template>
<div>
<div id="div-demo"></div>
</div>
</template>
<script>
import E from 'wangeditor'
export default {
name: 'textBox',
data() {
return {
editor: '',
content: '',
editorOption: {}
}
},
props: {
excludeMenus: {
type: Array,
default: () => ['code']
},
boxHeight: {
type: Number,
default: 240
}
},
mounted() {
this.getEdit()
},
methods: {
getEdit() {
const _this = this
this.editor = new E('#div-demo')
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = this.boxHeight
this.editor.config.width = 500
this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = html => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit('change', this.content) // 将内容同步到父组件中
}
this.editor.config.onfocus = () => {
this.$emit('focus')
}
// 上传图片
this.editor.config.customUploadImg = function(resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertImgFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
// 上传视频
this.editor.config.customUploadVideo = function(resultFiles, insertVideoFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传视频大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const videoFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + videoFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertVideoFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000
this.editor.create()
},
setEdit(html) {
this.$nextTick(() => {
this.editor.txt.html(html)
})
},
forbidEdit() {
// this.editor.$textElem.attr('contenteditable', false)
this.editor.disable()
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
// margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
<style>
.w-e-text-container {
z-index: 1 !important;
}
.w-e-toolbar {
z-index: 2 !important;
}
</style>
......@@ -12,15 +12,14 @@ let cfg = require('./conf.js')
import { Http } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) {
// console.log(1111111)
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
// }
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
return new Http().get('https://oss-config.dev.glsx.com.cn/mock/63b39b3e606e962c5e174afb/discover')
// return new Http().get('https://oss-config.dev.glsx.com.cn/mock/63b39b3e606e962c5e174afb/discover/config')
return new Http().get('https://oss-config.glsx.com.cn/mock/63c12a6b28a427953783403e/discover/config')
}
export const config = {
install(vue, cfg) {
......
......@@ -4,9 +4,9 @@ const staticRoutes = Object.freeze([{
redirect: { name: 'zoneList' }
},
{
name: 'zoneList',
path: '/zoneList/index',
component: resolve => require([`@/views/zoneList/index.vue`], resolve),
name: 'channel',
path: '/channel/index',
component: resolve => require([`@/views/channel/index.vue`], resolve),
meta: {}
}
])
......
import apis from '@/api'
export default {
namespaced: true,
state: {
videoList: [],
topicDetail: {},
merchantId: '',
channelStyle: 1,
channelType: ''
},
mutations: {
// 设置视频
['SET_VIDEO_LIST'](state, payload) {
state.videoList = payload.videoList
},
// 设置频道主题详情
['SET_TOPIC_DETAIL'](state, payload) {
state.topicDetail = payload.topicDetail
},
// 设置门店id
['SET_MERCHANT_ID'](state, payload) {
state.merchantId = payload.id
},
// 设置频道主题
['SET_CHANNEL_STYLE'](state, payload) {
state.channelStyle = payload.channelStyle
},
['SET_CHANNEL_TYPE'](state, payload) {
state.channelType = payload.channelType
}
},
actions: {
// 获取视频列表
getTencentcloudmedialist(conText, payload) {
apis.store.getTencentcloudmedialist({}).then(res => {
if (res.code == 0) {
conText.commit('SET_VIDEO_LIST', { videoList: res.data })
// if (payload.success) {
// payload.success()
// }
}
})
},
//频道主题详情
getTopicDetail(conText, payload) {
apis.store.getTopicDetail(payload).then(res => {
if (res.code == 0) {
conText.commit('SET_TOPIC_DETAIL', { topicDetail: res.data })
}
})
},
//新增或编辑频道主题
addChannelTopic(conText, payload) {
apis.store.addChannelTopic(payload).then(res => {
if (res) {
if (payload.success) {
payload.success(res)
}
}
})
}
}
}
<template>
<div class="report-about">
<h4>穿梭框1</h4>
<h4 class="align-center">
<label>请打开f12查看移动数据</label>
<el-button size="medium" type="info" @click="changeMode">当前模式:</el-button>
<el-button size="medium" @click="clearChecked()">清除选中</el-button>
<el-button size="medium" @click="toHidden()">去=隐藏的路由</el-button>
</h4>
<div class="box">
<!-- lazy -->
<!-- :lazyFn="lazyFn" -->
<tree-transfer ref="wl-tree-transfer" filter high-light default-transfer :mode="mode" :title="title" :to_data="toData" :from_data="fromData" :filterNode="filterNode" :defaultProps="defaultProps" :defaultCheckedKeys="defaultCheckedKeys" :defaultExpandedKeys="[2, 3]" @right-check-change="rightCheckChange" @left-check-change="leftCheckChange" @removeBtn="remove" @addBtn="add" height="540px" node_key="id">
<span slot="title-right" class="my-title-right" @click="handleTitleRight">自定义内容</span>
</tree-transfer>
</div>
</div>
</template>
<script>
import treeTransfer from 'el-tree-transfer'
export default {
name: 'App',
components: { treeTransfer },
data() {
return {
mode: 'transfer', // transfer addressList
defaultProps: { label: 'name', children: 'children' },
fromData: [
{
id: 1,
pid: 0,
name: '测试左侧',
children: [
{
id: 2,
pid: 1,
name: '水电费是打发斯蒂芬斯蒂芬gas噶水电费噶地方死光光',
disabled: true,
children: []
},
{
id: 3,
pid: 1,
name: '11-3',
children: []
},
{
id: 4,
pid: 1,
name: '11-4',
children: [
{
id: 5,
pid: 4,
name: '11-5',
children: [
{
id: 111,
pid: 5,
name: '11-111'
}
]
},
{
id: 6,
pid: 4,
name: '11-6',
children: []
}
]
}
]
},
{
id: 7127,
pid: 0,
name: 'debug',
children: [
{
id: 71272,
pid: 7127,
name: 'debug22',
// disabled: true,
children: []
},
{
id: 71273,
pid: 7127,
name: 'debug11',
children: []
}
]
}
], // 穿梭框 - 源数据 - 树形
toData: [],
fromArray: [
{
id: '1',
name: '1',
pid: '0'
},
{
id: '2',
name: '2',
pid: '0'
},
{
id: '1-1',
name: '1-1',
pid: '1'
},
{
id: '1-2',
name: '1-2',
pid: '1'
},
{
id: '1-1-1',
name: '1-1-1',
pid: '1-1'
},
{
id: '1-1-1-1',
name: '1-1-1-1',
pid: '1-1-1'
},
{
id: '2-1',
name: '2-1',
pid: '2'
},
{
id: '2-2',
name: '2-2',
pid: '2'
}
],
toArray: [],
defaultCheckedKeys: [] // 左侧默认选中数据
}
},
created() {},
mounted() {
this.$apis.demo.GETLISTDEVICEFILEUNSTOCK({ k: 2, kdj: 5 }).then(res => {})
// 测试延迟默认选中
setTimeout(() => {
this.defaultCheckedKeys = [1]
}, 1000)
},
methods: {
toHidden() {
this.$router.push('/about/hidden')
},
// 清除选中
clearChecked() {
this.$refs['wl-tree-transfer'].clearChecked()
},
// 自定义筛选函数
filterNode(value, data, where) {
console.log(value, data, where)
if (!value) return true
return data[this.defaultProps.label].indexOf(value) !== -1
},
// 懒加载回调
lazyFn(node, resolve) {
setTimeout(() => {
resolve([
{
id: 71272,
pid: 7127,
name: 'debug22',
// disabled: true,
children: []
},
{
id: 71273,
pid: 7127,
name: 'debug11',
children: []
}
])
}, 500)
},
// 切换模式 现有树形穿梭框模式transfer 和通讯录模式addressList
changeMode() {
if (this.mode == 'transfer') {
this.mode = 'addressList'
} else {
this.mode = 'transfer'
}
},
// 添加按钮
add(fromData, toData, obj) {
// 树形穿梭框模式transfer时,返回参数为左侧树移动后数据、右侧树移动后数据、移动的{keys,nodes,halfKeys,halfNodes}对象
// 通讯录模式addressList时,返回参数为右侧收件人列表、右侧抄送人列表、右侧密送人列表
console.log('fromData:', fromData)
console.log('toData:', toData)
console.log('obj:', obj)
},
// 移除按钮
remove(fromData, toData, obj) {
// 树形穿梭框模式transfer时,返回参数为左侧树移动后数据、右侧树移动后数据、移动的{keys,nodes,halfKeys,halfNodes}对象
// 通讯录模式addressList时,返回参数为右侧收件人列表、右侧抄送人列表、右侧密送人列表
console.log('fromData:', fromData)
console.log('toData:', toData)
console.log('obj:', obj)
},
// 左侧源数据选中事件
leftCheckChange(nodeObj, treeObj, checkAll) {
console.log(nodeObj)
console.log(treeObj)
console.log(checkAll)
},
// 右侧目标数据选中事件
rightCheckChange(nodeObj, treeObj, checkAll) {
console.log(nodeObj)
console.log(treeObj)
console.log(checkAll)
},
// 自定义节点 仅树形结构支持
renderContent(h, { node, data }) {
return (
<span class="custom-tree-node">
<span>{node.label}</span>
<span>
<el-button size="mini" type="text" on-click={() => this.append(data)}>
Append
</el-button>
<el-button size="mini" type="text" on-click={() => this.remove(node, data)}>
Delete
</el-button>
</span>
</span>
)
},
// 标题自定义区点击事件
handleTitleRight() {
alert('标题自定义区点击事件')
}
},
computed: {
title() {
if (this.mode == 'transfer') {
return ['源列表', '目标列表']
} else {
return ['通讯录', '收件人', '抄送人', '密送人']
}
}
}
}
</script>
<style>
.align-center {
text-align: center;
}
.box {
width: 600px;
margin: 0 auto;
text-align: left;
}
.btn {
border: 1px solid #ebeef5;
padding: 5px 10px;
background-color: #f5f7fa;
outline: none;
}
.my-title-right {
float: right;
font-size: 12px;
cursor: pointer;
}
</style>
<template>
<div class="add-wrap" v-loading="loading">
<div class="add-container">
<div class="title">{{ this.channelForm.channelName }}编辑</div>
<div class="channel-content gl-form-page">
<el-form ref="ruleForm" :model="channelForm" label-width="154px" size="small" :rules="rules">
<el-form-item label="频道名称:" prop="channelName">
<el-input v-model="channelForm.channelName" :disabled="isDisabled" maxlength="4"></el-input>
</el-form-item>
<span v-if="channelForm.channelType == 1">
<el-form-item label="频道主题:" prop="channelStyle">
<el-col :span="11" class="theme"></el-col>
<el-col :span="11" class="theme dark"></el-col>
</el-form-item>
<el-form-item label="" prop="channelStyle">
<el-radio-group v-model="channelForm.channelStyle" @input="changeChannelStyle">
<el-radio :label="1"></el-radio>
<el-radio :label="2"></el-radio>
</el-radio-group>
<div class="theme-label">
<span>风格1</span>
<span>风格2</span>
</div>
</el-form-item>
</span>
<el-form-item label="频道banner:" prop="channelImg" style="margin-top:15px;">
<glsx-preview :picOptions="picOptions" :imageUrlArr="channelForm.channelImgArr" @change="changeChannelImg"></glsx-preview>
<div class="el-form-item__error" v-if="channelImgFlag">请上传频道banner</div>
</el-form-item>
<div class="text-tip">建议尺寸:750*750</div>
</el-form>
</div>
</div>
<div class="add-container">
<div class="title">{{ this.channelForm.channelName }}分享配置</div>
<div class="channel-content gl-form-page">
<el-form ref="ruleForm" :model="channelForm" label-width="154px" :rules="rules">
<el-form-item label="频道分享预览图:" prop="publicityImg">
<glsx-preview :picOptions="shareOptions" :imageUrlArr="channelForm.publicityImgArr" @change="changeChannelImg"></glsx-preview>
</el-form-item>
<div class="text-tip">建议尺寸:520*416</div>
<el-form-item label="频道分享文案:" prop="promotion">
<el-input type="textarea" v-model="channelForm.promotion" maxlength="100" show-word-limit></el-input>
</el-form-item>
<el-form-item label="频道海报:">
<glsx-preview :picOptions="posterOptions" :imageUrlArr="channelForm.posterImgArr" @change="changeChannelImg"></glsx-preview>
</el-form-item>
<div class="text-tip">建议尺寸:640*1008</div>
</el-form>
</div>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSave">确定</el-button>
</GLFooter>
</div>
</template>
<script>
export default {
data() {
return {
loading: false,
isDisabled: false,
id: this.$route.query.id ? this.$route.query.id : '',
merchantChannelId: this.$route.query.merchantChannelId ? this.$route.query.merchantChannelId : '',
channelForm: {
posterImgArr: [],
publicityImgArr: [],
publicityImg: '',
channelImg: '',
channelImgArr: []
},
channelImgbgArr: ['banner1', 'banner2'],
channelOtherImgbgArr: ['membrane', 'crowd', 'activity'],
channelImgFlag: false,
picOptions: {
width: '104px',
height: '104px',
key: 'channelImg',
isClose: true
},
shareOptions: {
width: '120px',
height: '90px',
key: 'publicityImg',
isClose: true
},
posterOptions: {
width: '104px',
height: '104px',
key: 'posterImg',
isClose: true
},
rules: {
channelName: [{ required: true, message: '请输入频道名称', trigger: 'blur' }],
channelStyle: [{ required: true, message: '请选择频道主题', trigger: 'change' }],
publicityImg: [{ required: true, message: '请上传频道分享预览图', trigger: 'change' }],
channelImg: [{ required: true, message: '请上传频道banner', trigger: 'change' }],
promotion: [{ required: true, message: '请输入频道分享文案', trigger: 'blur' }]
}
}
},
created() {
if (this.id || this.merchantChannelId) this.getChannelDetail()
this.isDisabled = this.id ? true : this.merchantChannelId ? false : true
},
methods: {
changeChannelStyle() {
this.diffChannelStyle()
},
commonImg(name) {
return `https://img02.glsx.com.cn/weapp/resource/miniprogram/glsx/discover/${name}.png`
},
diffChannelStyle() {
if (this.channelForm.channelType == 1) {
this.channelForm.channelImgArr = [this.commonImg(this.channelImgbgArr[this.channelForm.channelStyle - 1])]
this.channelForm.channelImg = this.commonImg(this.channelImgbgArr[this.channelForm.channelStyle - 1])
} else {
this.channelForm.channelImgArr = [this.commonImg(this.channelOtherImgbgArr[this.channelForm.channelType - 2])]
this.channelForm.channelImg = this.commonImg(this.channelOtherImgbgArr[this.channelForm.channelType - 2])
}
},
getChannelDetail() {
let apis = this.id ? 'getChannelDetail' : this.merchantChannelId ? 'getMerchantChannelDetail' : ''
let params = {}
this.id ? (params.id = this.id) : this.merchantChannelId ? (params.merchantChannelId = this.merchantChannelId) : ''
this.$apis.channel[apis](params).then(res => {
if (res.code == 0) {
this.channelForm = { ...res.data, posterImgArr: [], publicityImgArr: [], channelImgArr: [] }
this.channelForm.posterImgArr.push(res.data.posterImg) //海报
this.channelForm.publicityImgArr.push(res.data.publicityImg) //频道分享预览图
this.channelForm.channelImgArr.push(res.data.channelImg) //频道banner
if(!res.data.channelImg) this.diffChannelStyle()
}
})
},
handleCancel() {
this.$router.go(-1)
},
changeChannelImg(val) {
this[val.key + 'Flag'] = false
this.channelForm[val.key] = val.arr[0]
this.$refs.ruleForm.clearValidate(val.key)
},
handleSave() {
this.$refs.ruleForm.validate(valid => {
if (!this.channelForm.channelImg) {
this.channelImgFlag = true
return
}
// if (!this.channelForm.publicityImg) {
// this.publicityImgFlag = true
// return
// }
if (valid) {
let params = {
channelName: this.channelForm.channelName,
channelType: this.channelForm.channelType,
channelStyle: this.channelForm.channelStyle,
channelImg: this.channelForm.channelImg,
promotion: this.channelForm.promotion,
publicityImg: this.channelForm.publicityImg,
posterImg: this.channelForm.posterImg
}
if (this.channelForm.channelType == 1) params.channelStyle = this.channelForm.channelStyle
let apis = this.id ? 'updateChannel' : this.merchantChannelId ? 'updateMerchantChannel' : ''
this.id ? (params.id = this.id) : this.merchantChannelId ? (params.merchantChannelId = this.merchantChannelId) : ''
this.loading = true
this.$apis.channel[apis](params).then(res => {
if (res.code == 0) {
this.loading = false
this.$router.go(-1)
}
this.$message({
message: res.code == '0' ? '编辑成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
})
}
})
}
}
}
</script>
<style scoped lang="scss">
.add-wrap {
.add-container {
background: #ffffff;
margin-bottom: 16px;
.title {
height: 56px;
line-height: 56px;
border-bottom: 1px solid #e5e5e5;
padding-left: 20px;
box-sizing: border-box;
font-size: 16px;
color: #333333;
font-weight: 600;
}
.channel-content {
padding: 32px 0;
}
}
.channel-content /deep/ {
.el-textarea__inner {
min-height: 79px !important;
}
.theme {
width: 48px;
height: 48px;
border-radius: 4px;
background-color: #f24702;
margin-right: 44px;
margin-top: 12px;
}
.dark {
background: #0a0e19;
}
.el-form-item__error {
// margin-top: 25px;
// margin-bottom: 10px;
}
.el-radio__input {
margin-top: -160px;
margin-left: 33px;
color: #fff;
}
.el-radio__label {
color: #fff;
}
}
.theme-label {
font-weight: 400;
font-size: 14px;
color: #333333;
line-height: 20px;
display: flex;
justify-content: space-between;
width: 136px;
margin-top: -50px;
span {
width: 48px;
text-align: center;
display: inline-block;
}
}
.text-tip {
font-weight: 400;
font-size: 14px;
color: #999999;
margin-left: 154px;
margin-bottom: 35px;
margin-top: 15px;
}
}
</style>
\ No newline at end of file
<template>
<div class="channel-wrap">
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable ref="channelRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :beforeSearchFn="beforeSearchFn" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div slot="publicityImg" class="table-image" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.publicityImg" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.publicityImg" />
</el-popover>
</div>
<template slot="activityLink" slot-scope="scope">
<span class="relink">{{ scope.scope.activityName }}</span>
</template>
<template slot="moveCarCodeCount" slot-scope="scope">
<span class="moveCarCodeCount" @click="opneMoveMessage(scope.scope)">{{ scope.scope.moveCarCodeCount }}</span>
</template>
<template slot="switch" slot-scope="scope">
<el-switch v-model="scope.scope.isOpen" @change="updateState(scope.scope)"></el-switch>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button>
</div>
</GLTable>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import * as dayjs from 'dayjs'
export default {
name: 'App',
data() {
return {
tableSearchForm: {
channelName: '',
createDate: []
},
searchForm: {},
url: url,
searchFormData: [
{
label: '频道名称',
name: 'channelName',
type: 'input'
},
{
label: '创建时间',
name: 'createDate',
type: 'datePicker',
isClear: true,
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date > yesterday) {
return true
}
return false
}
}
}
],
getListApi: this.$apis.channel.getChannelListApi,
tableParams: {
listName: 'list',
// tableOption: true,
tableColumns: [
{
label: '频道名称',
prop: 'channelName',
formatter: cellValue => {
return cellValue.channelName || '--'
}
},
{
label: '频道宣传语',
prop: 'promotion',
width: 300,
line: 1,
formatter: cellValue => {
return cellValue.promotion || '--'
}
},
{
label: '宣传图',
prop: 'publicityImg',
addHtml: 'publicityImg'
},
{
label: '关联门店',
prop: 'linkMerchantCnt',
formatter: cellValue => {
return cellValue.linkMerchantCnt || '--'
}
},
{
label: '创建日期',
prop: 'createdDate',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '操作',
addHtml: 'auth-button',
fixed: 'right',
width: 300
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
created() {},
mounted() {},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.tableSearchForm))
if (this.tableSearchForm.createDate.length) {
params.createdDateStrat = new Date(this.tableSearchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.createdDateEnd = new Date(this.tableSearchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = this.getParams()
delete this.searchForm.createDate
resolve()
})
},
handleSearch() {
this.$refs.channelRef.refreshTable()
},
handleReset() {
this.tableSearchForm = {
channelName: '',
createDate: []
}
this.searchForm = {}
this.handleSearch()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.channelRef.data.length ? (this.$refs.channelRef.tableHeightValues = '') : this.$refs.channelRef.setTableHeightFun()
},
handleEdit(val) {
this.$router.push({
path: `/channel/add?id=${val.id}&channelType=${val.channelType}`
})
}
}
}
</script>
<style scoped lang="scss">
.channel-wrap {
}
</style>
<template>
<div class="add-wrap">
<div class="container edit-container" style="min-height: 520px !important">
<p class="edit-title" id="basic">新增门店</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="merchantHtml">
<el-button type="default" class="el-icon-plus" v-if="!isDisabled" @click="handleRelateStoreClose">选择门店</el-button>
<div class="merchantNameLabel" v-if="editForm.merchantName">
<p>所属门店</p>
<div class="merchantName ellipsis-1">{{ editForm.merchantName }}</div>
</div>
<div class="el-form-item__error mrt5" v-if="merchantFlag">请选择门店</div>
</div>
<div slot="channelHtml">
<el-checkbox-group v-model="editForm.channelIds" @change="handleCheckedChannelChange">
<el-checkbox v-for="channel in channelList" :label="channel.id" :key="channel.id">{{ channel.name }}</el-checkbox>
</el-checkbox-group>
</div>
</glsx-combi-form>
</div>
<select-store v-if="relateStoreVisible" ref="relateStore" :dialogVisible="relateStoreVisible" :storeSelected="selectedList" :merchantInfo="editForm.merchantId" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose"></select-store>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSave">确定</el-button>
</GLFooter>
</div>
</template>
<script>
import selectStore from './components/selectStore'
export default {
components: {
selectStore
},
data() {
return {
size: 'small',
editChildRef: 'editChildRef',
editForm: {
channelIds: []
},
merchantFlag: false,
editFormData: [
{
label: '选择门店',
name: 'merchantId',
addHtml: 'merchantHtml'
},
{
label: '频道名称',
name: 'channel',
addHtml: 'channelHtml'
}
],
selectedList: [],
channelList: [
{ name: '新车专区', id: 1 },
{ name: '膜类专区', id: 2 },
{ name: '限时众筹', id: 3 },
{ name: '定保专区', id: 4 }
],
relateStoreVisible: false, // 选择门店
editRule: {
channelIds: [{ required: true, message: '请选择频道名称', trigger: 'change' }]
}
}
},
created() {
},
methods: {
handleCancel() {
this.$router.go(-1)
},
handleSave() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (!this.editForm.merchantName) {
this.merchantFlag = true
return
}
if (valid) {
let params = {
merchantId: this.editForm.merchantId,
merchantName: this.editForm.merchantName,
channelIds: this.editForm.channelIds
}
this.loading = true
this.$apis.store.configMerchant(params).then(res => {
if (res.code == 0) {
this.loading = false
this.$router.go(-1)
}
this.$message({
message: res.code == '0' ? '编辑成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
})
}
})
},
handleCheckedChannelChange(val) {
// console.log(this.editForm.channelIds)
},
// 选择门店
handleRelateStoreClose() {
this.relateStoreVisible = !this.relateStoreVisible
},
handleRelateStoreConfirm(selectedData) {
this.$refs.editFormRef.$refs[this.editChildRef].clearValidate('merchantId')
selectedData.merchantId && (this.editForm.merchantId = selectedData.merchantId)
selectedData.merchantName && ((this.editForm.merchantName = selectedData.merchantName), (this.merchantFlag = false))
this.handleRelateStoreClose()
}
}
}
</script>
<style scoped lang='scss'>
.add-wrap {
.container {
min-height: 680px;
padding: 0px 0px 20px;
margin-bottom: 16px;
}
.edit-title {
font-size: 16px;
font-weight: 600;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
padding: 0 0 0 20px;
}
.edit-form-container {
margin-top: 20px;
}
.assignLabel {
color: #5850ff;
}
.merchantNameLabel {
width: 510px;
color: #1d1d1d;
// margin-left: 50px;
padding: 16px;
margin-top: 8px;
border: 1px solid #e6e6e6;
border-radius: 8rpx;
background: #f9f9f9;
.merchantName {
box-sizing: border-box;
width: 284px;
height: 32px;
background: #ffffff;
border: 1px solid #e6e6e6;
border-radius: 4px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #999999;
line-height: 32px;
padding: 0 8px;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="certificate-wrap" v-loading="loading">
<div class="gl-form-page">
<el-form ref="configForm" label-width="154px" :model="addForm" :rules="addRules">
<div class="config-form-item el-form-item">
<label class="is-require">选择券:</label>
<el-button size="small" icon="el-icon-plus" @click="handleAdd">选择券</el-button>
</div>
</el-form>
</div>
<template v-if="tableData.length > 0">
<div class="merchant-wrap">
<el-table :data="tableData" border style="width: 100%" :height="tableData.length > 15 ? 600 : auto">
<el-table-column type="index" width="50"></el-table-column>
<el-table-column prop="couponName" label="券名称" width="200"></el-table-column>
<el-table-column prop="discountType" label="券类型" width="100">
<template slot-scope="scope">
<span>{{ numToCouponText[scope.row.discountType] }}</span>
</template>
</el-table-column>
<el-table-column prop="couponAnticipatedCost" label="预估成本/元"></el-table-column>
<el-table-column prop="effectiveType" label="有效期" width="100">
<template slot-scope="scope">
<span>{{ toLabelText(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column prop="residueAmount" label="剩余库存" width="100"></el-table-column>
</el-table>
</div>
</template>
<select-gift-dialog v-if="isSelectGiftVisible" :isSelectGiftVisible="isSelectGiftVisible" :selectedGiftList="selectedGiftList" @handleGiftConfirm="handleGiftConfirm" @handleGiftClose="handleGiftClose"></select-gift-dialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import selectGiftDialog from './selectGiftDialog.vue'
export default {
data() {
return {
url: url,
isSelectGiftVisible: false,
selectedGiftList: [],
loading: false,
searchForm: {
subMerchantId: '',
subMerchantName: '',
select: '1',
selectInput: ''
},
openSubscribeList: [],
tableData: [],
selectedList: [],
orderShow: ['service', 'cash', 'discount', 'exchange'],
numToCoupon: {
2: 'discount',
3: 'cash',
4: 'exchange',
7: 'service'
},
numToCouponText: {
2: '折扣券',
3: '代金券',
4: '兑换券',
7: '门店服务'
},
editForm: {
couponList: []
},
couponObj: {
// 折扣券
discount: {
label: '折扣券',
discountType: 2,
list: []
},
// 代金券
cash: {
label: '代金券',
discountType: 3,
list: []
},
// 兑换券
exchange: {
label: '兑换券',
discountType: 4,
list: []
},
// 会员服务
service: {
label: '会员服务',
discountType: 7,
list: []
}
}
}
},
components: {
selectGiftDialog
},
props: {
channelId: {
type: String,
default: ''
},
topicId: {
type: String,
default: ''
}
},
// components: {
// relateStoreDialog
// },
created() {
this.getCouponconfig()
},
methods: {
toLabelText(row) {
switch (row.effectiveType) {
case 3:
return '永久有效'
case 2:
return row.effectiveStartTime ? row.effectiveStartTime.split(' ')[0] + '-' + row.effectiveEndTime.split(' ')[0] : ''
case 1:
return row.effectiveDays + '天'
}
},
getCouponconfig() {
this.$apis.store.getCouponconfig({ topicId: this.topicId }).then(res => {
if (res.code == 0) {
res.data.coupons.forEach(item => {
item.couponAnticipatedCost = (item.couponAnticipatedCost / 100).toFixed(2)
})
this.tableData = res.data.coupons
}
})
},
handleAdd() {
// console.log(this.couponObj, '')
this.selectedGiftList = JSON.parse(JSON.stringify(this.couponObj))
this.handleGiftClose()
},
handleGiftClose() {
this.isSelectGiftVisible = !this.isSelectGiftVisible
},
handleGiftConfirm(selectedData, type) {
// console.log(selectedData, 'selectedData')
if (type != 'group') {
this.handleGiftClose()
}
this.couponObj = selectedData
this.recoveryTotalPrice()
this.recoveryGiftList()
this.getData()
},
getData() {
this.orderShow.forEach(item => {
if (this.couponObj[item].list&&this.couponObj[item].list.length) {
this.tableData = this.couponObj[item].list
}
})
},
// 计算预估成本
recoveryTotalPrice() {
this.totalEstimatedCost = 0
this.orderShow.forEach(item => {
this.couponObj[item].list.forEach(subItem => {
// 失效券不加入预估成本
if (subItem.status != '3') {
this.totalEstimatedCost = this.totalEstimatedCost + parseInt(subItem.couponAnticipatedCost || 0) * parseInt(subItem.couponAmount)
}
})
})
this.totalEstimatedCost = (this.totalEstimatedCost / 100).toFixed(2)
},
// 礼包
recoveryGiftList() {
this.editForm.couponList = []
this.orderShow.forEach(item => {
this.couponObj[item].list.forEach(k => {
this.editForm.couponList.push(k)
})
})
// this.hasCouponBlock()
},
// hasCouponBlock(isValidate = true) {
// var idx = this.editFormData.findIndex(item => item.name == 'couponListBlock')
// this.editFormData[idx].isHide = !this.editForm.couponList.length
// isValidate && this.$refs.editFormRef.$refs[this.editChildRef].validateField('couponList')
// },
handleSave() {
if (this.tableData.length == 0) {
this.$message({
message: '请选择商户',
type: 'error'
})
return
}
let couponIds = []
this.tableData.forEach(item => {
couponIds.push(item.id)
})
let params = {
topicId: this.topicId,
couponIds,
couponNames: this.tableData[0].couponName
}
this.$apis.store.configCoupons(params).then(res => {
if (res.code == 0) {
this.$router.go(-1)
}
this.$message({
message: res.code == '0' ? '配置成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
})
},
handleCancel() {
this.$router.go(-1)
}
}
}
</script>
<style lang="scss" scoped>
.container {
.gl-form-page {
flex: 1;
padding: 20px;
.config-form-item {
display: flex;
margin-top: 20px;
/deep/.el-form-item__content {
width: 460px;
}
/deep/.el-input--prefix .el-input__inner {
line-height: 32px;
height: 32px;
}
}
/deep/.el-input__prefix {
line-height: 32px;
.el-input__icon {
line-height: 32px;
}
}
label {
font-size: 14px;
text-align: right;
color: #666;
width: 154px;
// margin-right: 12px;
height: 36px;
line-height: 36px;
img {
width: 14px;
height: 14px;
vertical-align: middle;
margin-left: 5px;
}
&.is-require {
&::before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
}
}
}
.merchant-wrap {
width: 700px;
margin-left: 194px;
margin-top: 10px;
}
}
</style>
\ No newline at end of file
<template>
<div class="membrane-content gl-form-page">
<el-form ref="ruleForm" :model="membraneForm" label-width="154px" size="small" :rules="rules">
<el-form-item label="上传类型:" prop="mediaType">
<el-radio-group v-model="membraneForm.mediaType" @input="changeMediaType">
<el-radio :label="1">视频</el-radio>
<el-radio :label="2">图片</el-radio>
</el-radio-group>
</el-form-item>
<template v-if="membraneForm.mediaType == 1">
<el-form-item label="选择视频:" prop="mediaUrl">
<el-select v-model="membraneForm.mediaUrl" placeholder="请选择视频" @change="changeVideo">
<el-option :label="video.fileName" :value="video.mediaUrl" v-for="video in videoList" :key="video.id"></el-option>
</el-select>
<div class="preview" @click="handleView">预览</div>
</el-form-item>
<el-form-item label="视频封面图:" prop="mediaCover">
<glsx-preview :picOptions="mediaCoverOptions" :imageUrlArr="membraneForm.mediaCoverArr" @change="changeChannelImg"></glsx-preview>
<!-- <div class="el-form-item__error">请上传频道banner</div> -->
</el-form-item>
<div class="text-tip">建议尺寸:184*230</div>
</template>
<template v-if="membraneForm.mediaType == 2">
<el-form-item label="图片:" prop="picUrl">
<glsx-preview limit="9" :picOptions="picOptions" :imageUrlArr="membraneForm.mediaUrlArr" @change="changeChannelImg"></glsx-preview>
</el-form-item>
</template>
<el-form-item label="宣传文案:" prop="promotion">
<el-input type="textarea" v-model="membraneForm.promotion" maxlength="100" show-word-limit></el-input>
</el-form-item>
</el-form>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="30%">
<big-view ref="viewForm" v-if="dialogVisibleImg" :dialogSrc="dialogSrc" :dialogType="dialogType"></big-view>
</el-dialog>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex'
export default {
data() {
return {
dialogVisibleImg: false,
dialogType: '',
membraneForm: {
mediaType: 1,
mediaCoverArr: [],
mediaUrlArr: [],
mediaUrl: '',
mediaCover: '',
promotion: '',
picUrl: ''
},
mediaCoverOptions: {
width: '92px',
height: '116.26px',
key: 'mediaCover',
isClose: true
},
picOptions: {
width: '104px',
height: '104px',
key: 'picUrl',
isClose: true
},
rules: {
mediaType: [{ required: true, message: '请选择上传类型', trigger: 'change' }],
mediaUrl: [{ required: true, message: '请选择选择视频', trigger: 'change' }],
mediaCover: [{ required: true, message: '请上传视频封面图', trigger: 'change' }],
picUrl: [{ required: true, message: '请上传图片', trigger: 'change' }],
promotion: { required: true, message: '请输入宣传文案', trigger: 'blur' }
}
}
},
computed: {
...mapState({
videoList: state => state.channel.videoList,
topicDetail: state => state.channel.topicDetail
})
},
watch: {
topicDetail: {
handler(data) {
if (data) {
this.membraneForm = {
...data.contentList[0].mediaList[0],
mediaCoverArr: [],
mediaUrlArr: [],
promotion: data.contentList[0].promotion
}
this.membraneForm.mediaCoverArr.push(this.membraneForm.mediaCover)
data.contentList[0].mediaList.forEach(item => {
this.membraneForm.mediaUrlArr.push(item.mediaUrl)
})
this.membraneForm.picUrl = this.membraneForm.mediaUrlArr[0]
}
},
// immediate: true,
deep: true
}
},
props: {
merchantChannelId: {
type: String,
default: ''
},
topicId: {
type: String,
default: ''
}
},
methods: {
...mapActions({
addChannelTopic: 'channel/addChannelTopic'
}),
handleView(row) {
if (!this.membraneForm.mediaUrl) {
return
}
this.dialogType = 'video'
this.dialogVisibleImg = true
this.dialogSrc = this.membraneForm.mediaUrl
},
changeChannelImg(val) {
this.membraneForm[val.key] = val.arr[0]
this.$refs.ruleForm.clearValidate(val.key)
},
changeMediaType(val) {
if (val == 2) {
this.membraneForm.mediaUrlArr = []
this.membraneForm.mediaName = ''
this.membraneForm.mediaCover = ''
this.membraneForm.mediaUrl = ''
this.membraneForm.promotion = ''
} else {
this.membraneForm.mediaCover = ''
this.membraneForm.mediaCoverArr = []
this.membraneForm.promotion = ''
this.membraneForm.mediaUrlArr = []
this.membraneForm.mediaUrl = ''
}
},
changeVideo(value) {
let data = this.videoList.filter(item => item.mediaUrl == value)
this.membraneForm.mediaCoverArr = []
this.membraneForm.mediaName = data[0].fileName
this.membraneForm.mediaCover = data[0].coverUrl
this.membraneForm.mediaUrl = data[0].mediaUrl
this.membraneForm.mediaCoverArr.push(data[0].coverUrl)
this.membraneForm.promotion = data[0].introduction
this.$refs.ruleForm.clearValidate('mediaCover')
this.$refs.ruleForm.clearValidate('promotion')
},
handleCancel() {
this.$router.go(-1)
},
handleSave() {
this.$refs.ruleForm.validate(valid => {
let mediaList = []
if (this.membraneForm.mediaType == 1) {
mediaList = [
{
mediaType: this.membraneForm.mediaType,
mediaName: this.membraneForm.mediaName,
mediaUrl: this.membraneForm.mediaUrl,
mediaCover: this.membraneForm.mediaCover
}
]
} else {
this.membraneForm.mediaUrlArr.forEach(item => {
mediaList.push({
mediaType: this.membraneForm.mediaType,
mediaUrl: item
})
})
}
let contentList = [
{
promotion: this.membraneForm.promotion,
mediaList
}
]
if (valid) {
let params = {
merchantChannelId: this.merchantChannelId,
topicTitle: '热门专区',
contentType: 2,
contentList,
backgroundType: 1
}
if (this.topicId) params.id = this.topicId
this.loading = true
this.addChannelTopic({
...params,
success: res => {
if (res.code == 0) {
this.loading = false
this.$router.go(-1)
}
this.$message({
message: res.code == '0' ? (this.topicId ? '编辑成功' : '新建成功') : res.message,
type: res.code == '0' ? 'success' : 'error'
})
}
})
}
})
}
}
}
</script>
<style scoped lang="scss">
.membrane-content /deep/ {
.el-textarea__inner {
min-height: 79px !important;
}
.el-form-item__error {
// margin-top: 25px;
margin-bottom: 10px;
}
.preview {
font-weight: 400;
font-size: 14px;
color: #5850ff;
position: absolute;
top: 0;
left: 447px;
white-space: nowrap;
cursor: pointer;
}
}
</style>
\ No newline at end of file
<template>
<div class="select-store">
<!-- width="600px" -->
<GLDialog bigTitle="选择门店"
mode="big"
:visible.sync="dialogVisible"
:before-close="handleClose"
:close-on-click-modal="false"
@onOk="handleConfirm"
@onCancel="handleClose">
<glsx-combi-form ref="showSearch"
labelWidth="105px"
:formObj="searchForm"
:formData="searchFormData">
<span slot="footer">
<el-button :size="size"
type="primary"
@click="resetTable">查询</el-button>
</span>
</glsx-combi-form>
<!-- : :hasPage="false"
:getListApi="getListApi"
:tableData="storeList" -->
<GLTable ref="storeRef"
:noDataImg="url"
:tableTotal="total"
:searchForm="searchForm"
:tableParams="tableParams"
:pageConf="pageConf"
@refreshTable="getList"
:tableData="storeList"
:hasNum="false"
:setTableFinishFun="setTableFinishFun">
<div slot="radioHtml"
class="store-table"
slot-scope="scope">
<el-radio v-model="merchantId"
:label="scope.scope.merchantNo"
@click.native="handleClick(scope.scope)"></el-radio>
</div>
</GLTable>
<!-- <span slot="footer" class="dialog-footer">
<el-button size="small" @click="handleClose">取 消</el-button>
<el-button size="small" type="primary" @click="handleConfirm">确 定</el-button>
</span> -->
</GLDialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'selectStore',
data() {
return {
url: url,
searchForm: {
merchantId: '',
merchantName: ''
},
// getListApi: this.$apis.common.getMerchantList,
total: 0,
storeList: [],
heightBox: 200,
merchantId: '',
merchantName: '',
// 搜索
searchFormData: [
{
label: '商户名称',
name: 'merchantName',
type: 'input',
placeholder: '请输入商户名称',
width: '300px',
labelWidth: '10px'
},
{
label: '商户ID',
name: 'merchantId',
type: 'input',
inputType: 'number',
placeholder: '请输入商户ID',
width: '300px',
labelWidth: '10px'
}
],
pageConfig: {
pageSize: 10,
currentPage: 1
},
tableParams: {
listName: 'list',
// tableOption: true,
// 行数据的key
// mutiSelectUniqueKey: 'staffId',
// checkSelectKey: 'staffId',
// checkSelectVal: [],
// 多选ref的名称
// mutiSelectName: 'list',
tableColumns: [
{
label: '',
prop: '',
width: 80,
addHtml: 'radioHtml'
},
{
label: '序号',
prop: 'idx',
width: 80
},
{
label: '商户名称',
prop: 'merchantName',
formatter: cellValue => {
return cellValue.merchantName || '-'
}
},
{
label: '商户id',
prop: 'merchantNo',
formatter: cellValue => {
return cellValue.merchantNo || '-'
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
baseData: {}
}
},
props: {
dialogVisible: {
type: Boolean,
default: false
},
storeSearchForm: {
type: Object
},
merchantInfo: {
required: true
}
// merchantId: {
// type: String,
//
// }
// orderCode: {
// type: String,
// required: true
// }
},
mounted() {
// this.userInfo = this.$globalState.session
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 425
this.merchantId = this.merchantInfo
this.getList()
},
methods: {
getList(pageCon) {
pageCon && (this.pageConfig = pageCon)
var params = {
merchantId: this.merchantId,
...this.searchForm,
...this.pageConfig
// merchantId: '44209390',
}
this.$apis.common.getMerchantList(params).then(res => {
this.storeList = res.list
this.total = res.total
// // this.storeList = res.staffUnitList
// // var page = this.$refs.staffRef.page
// // // 添加序号
// pageConfig
let nowIndex = this.pageConfig.pageSize * (this.pageConfig.currentPage - 1)
this.storeList.forEach((item, index) => {
item.idx = index + 1 + nowIndex
})
// this.$refs.staffRef.tableHeightValues = '460px'
// })
})
},
resetTable() {
this.$refs.storeRef.page.currentPage = 1
this.getList()
},
setTableFinishFun() {
// console.log(this.$refs.staffRef.data)
// this.storeList = this.$refs.staffRef.data
//接收到的数据为空
this.$refs.staffRef.tableHeightValues = '460px'
},
handleClick(val) {
// let { merchantId, merchantName } =val
this.merchantId = val.merchantNo
this.merchantName = val.merchantName
// let temp = JSON.parse(JSON.stringify(val))
// delete temp.idx
// this.staffUuid = val.uuid
// this.store = val
},
handleClose() {
this.$emit('handleRelateStoreClose')
},
handleConfirm() {
// if (!this.staffUuid)
// return this.$message({
// message: '请先选择员工',
// type: 'error'
// })
// let parmas = {
// subOrderCode: this.orderCode,
// staffUuid: this.staffUuid
// }
// this.$apis.orderManage.signerOrder(parmas).then(res => {
// console.log(res)
// })
// this.staffUuid
this.$emit('handleRelateStoreConfirm', {
merchantId: this.merchantId,
merchantName: this.merchantName
})
}
}
}
</script>
<style lang="scss">
.select-store {
.storeDailog {
width: 500px;
}
.title {
margin-bottom: 12px;
}
.customer-tag-box {
display: flex;
margin: 20px 16px;
.tag-label {
display: inline-block;
height: 30px;
line-height: 30px;
}
.input-tag-wrapper {
max-height: 75px;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 648px;
display: flex;
align-items: center;
cursor: pointer;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
}
// .customer-list {
// width: calc(100% - 280px);
// margin-right: 10px;
// }
.p-16 {
padding: 16px;
}
.store-table .el-radio__label {
display: none;
}
}
</style>
<template>
<div class="content-wrap">
<div class="container edit-container" style="min-height: 520px !important">
<p class="edit-title" id="basic">{{ contentTitle }}</p>
<component :is="currentComponent" ref="componentRef" :merchantChannelId="merchantChannelId" :topicId="topicId" :channelType="channelType"></component>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSave">确定</el-button>
</GLFooter>
</div>
</template>
<script>
import { mapActions, mapMutations } from 'vuex'
import carChannel from './components/carChannel.vue'
import membrane from './components/membrane.vue'
import activity from './components/activity.vue'
import certificate from './components/certificate.vue'
export default {
name: 'content',
components: {
carChannel,
membrane,
activity,
certificate
},
data() {
return {
contentTitle: '',
merchantChannelId: this.$route.query.merchantChannelId ? this.$route.query.merchantChannelId : '', //门店频道id
topicId: this.$route.query.topicId ? this.$route.query.topicId : '', //频道主题ID
channelType: this.$route.query.channelType ? this.$route.query.channelType : '', //频道类型
currentComponent: 'carChannel',
relateStoreVisible: false // 选择门店
}
},
created() {
let { $title } = this.$route.query
this.contentTitle = $title ? $title : '新增内容'
//判断显示模块
this.judgeModule()
//获取视频
this.getTencentcloudmedialist()
//编辑获取详情
if (this.topicId) {
this.getTopicDetail({ topicId: this.topicId })
} else {
this.SET_TOPIC_DETAIL({ topicDetail: '' })
}
},
methods: {
...mapActions({
getTencentcloudmedialist: 'channel/getTencentcloudmedialist',
getTopicDetail: 'channel/getTopicDetail'
}),
...mapMutations({
SET_TOPIC_DETAIL: 'channel/SET_TOPIC_DETAIL'
}),
judgeModule() {
let arr = {
'-1': 'certificate',
1: 'carChannel',
2: 'membrane',
3: 'activity',
4: 'activity'
}
this.currentComponent = arr[this.channelType]
},
handleCancel() {
this.$router.go(-1)
},
handleSave() {
this.$refs.componentRef.handleSave()
}
}
}
</script>
<style scoped lang='scss'>
.content-wrap {
.container {
min-height: 680px;
padding: 0px 0px 20px;
margin-bottom: 16px;
}
.edit-title {
font-size: 16px;
font-weight: 600;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #e7eaec;
margin: 0 0 32px 0;
padding: 0 0 0 20px;
}
}
</style>
\ No newline at end of file
<!-- 专区管理 -->
<template>
<div class="marketing p-t-20">
<div class="m-b-20">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新建</el-button>
</div>
<div class="container">
<el-form :inline="true">
<el-form-item label="专区名称">
<el-input style="width: 215px;" :size="size" v-model="searchForm.zoneName"></el-input>
</el-form-item>
<el-form-item class="search-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="default" @click="handleReset">查询</el-button>
</el-form-item>
</el-form>
<!-- 表格区域 开始 -->
<GLTable
ref="zoneRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
export default {
name: 'zoneList',
data() {
return {
size: 'small',
url: url,
searchForm: {
zoneName: '',
createDate: []
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '专区名称',
name: 'zoneName',
type: 'input',
maxlength: 20
},
{
label: '创建日期',
name: 'createDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
// 表格
getListApi: this.$apis.zoneList.getZoneListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '专区名称',
prop: 'zoneName'
},
{
label: '创建日期',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }
}
},
mounted() {},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
params.zoneType = '2' //专区类型(1发现频道,2商城专区)
if (this.searchForm.createDate.length) {
params.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.createDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve()
})
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
this.$message({
type: 'success',
message: addOrEdit == '1' ? '新增' : '编辑'
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.zoneRef.data.length ? (this.$refs.zoneRef.tableHeightValues = '') : this.$refs.zoneRef.setTableHeightFun()
},
handleSearch() {
this.$refs.zoneRef.refreshTable()
},
handleReset() {
this.searchForm = {
zoneName: ''
}
this.handleSearch()
}
}
}
</script>
<style scoped>
.marketing .search-btns {
float: right;
margin-right: 0;
}
</style>
......@@ -6,7 +6,7 @@ const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://cdn.bootcdn.net/'
const cdn = {
css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`]
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`,'https://webapi.amap.com/loader.js']
}
module.exports = {
outputDir: `dist`,
......@@ -33,7 +33,8 @@ module.exports = {
'vue-router': 'VueRouter',
vuex: 'Vuex',
axios: 'axios',
echarts: 'echarts'
echarts: 'echarts',
AMap: 'AMap'
}
},
devServer: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!