Commit bf50b5f9 by 李伟康

Merge branch 'dev_lwk' into v3.24.0

2 parents 534476a6 8b14b551
Showing 45 changed files with 3254 additions and 41 deletions
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
"env": { "env": {
"node": true "node": true
}, },
"globals": {
"AMap": true
},
"extends": ["plugin:vue/essential", "@vue/prettier"], "extends": ["plugin:vue/essential", "@vue/prettier"],
"rules": { "rules": {
"no-console": "off", "no-console": "off",
......
...@@ -1129,11 +1129,26 @@ ...@@ -1129,11 +1129,26 @@
"version": "7.18.9", "version": "7.18.9",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.9.tgz", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.9.tgz",
"integrity": "sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==", "integrity": "sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==",
"dev": true,
"requires": { "requires": {
"regenerator-runtime": "^0.13.4" "regenerator-runtime": "^0.13.4"
} }
}, },
"@babel/runtime-corejs3": {
"version": "7.23.7",
"resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.23.7.tgz",
"integrity": "sha512-ER55qzLREVA5YxeyQ3Qu48tgsF2ZrFjFjUS6V6wF0cikSw+goBJgB9PBRM1T6+Ah4iiM+sxmfS/Sy/jdzFfhiQ==",
"requires": {
"core-js-pure": "^3.30.2",
"regenerator-runtime": "^0.14.0"
},
"dependencies": {
"regenerator-runtime": {
"version": "0.14.1",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
}
}
},
"@babel/template": { "@babel/template": {
"version": "7.18.10", "version": "7.18.10",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz",
...@@ -3260,6 +3275,11 @@ ...@@ -3260,6 +3275,11 @@
"integrity": "sha512-YpeKZngUmG65rLudJ4taU7VLkOCTMhNl/u4ctNC56LQS/zJTyNH0Lrtwm1tfTsbLlwvlfsA2d1c8vCf/Kh2KwQ==", "integrity": "sha512-YpeKZngUmG65rLudJ4taU7VLkOCTMhNl/u4ctNC56LQS/zJTyNH0Lrtwm1tfTsbLlwvlfsA2d1c8vCf/Kh2KwQ==",
"dev": true "dev": true
}, },
"china-area-data": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/china-area-data/-/china-area-data-5.0.1.tgz",
"integrity": "sha512-BQDPpiv5Nn+018ekcJK2oSD9PAD+E1bvXB0wgabc//dFVS/KvRqCgg0QOEUt3vBkx9XzB5a9BmkJCEZDBxVjVw=="
},
"chokidar": { "chokidar": {
"version": "3.5.3", "version": "3.5.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
...@@ -4004,6 +4024,11 @@ ...@@ -4004,6 +4024,11 @@
} }
} }
}, },
"core-js-pure": {
"version": "3.35.0",
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.35.0.tgz",
"integrity": "sha512-f+eRYmkou59uh7BPcyJ8MC76DiGhspj1KMxVIcF24tzP8NA9HVa1uC7BTW2tgx7E1QVCzDzsgp7kArrzhlz8Ew=="
},
"core-util-is": { "core-util-is": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
...@@ -10092,8 +10117,7 @@ ...@@ -10092,8 +10117,7 @@
"regenerator-runtime": { "regenerator-runtime": {
"version": "0.13.9", "version": "0.13.9",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
"integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
"dev": true
}, },
"regenerator-transform": { "regenerator-transform": {
"version": "0.15.0", "version": "0.15.0",
...@@ -12815,6 +12839,23 @@ ...@@ -12815,6 +12839,23 @@
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz", "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz",
"integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==" "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.6.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
}
}
},
"watchpack": { "watchpack": {
"version": "1.7.5", "version": "1.7.5",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz",
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"china-area-data": "^5.0.1",
"core-js": "^3.4.4", "core-js": "^3.4.4",
"dayjs": "^1.10.7", "dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
...@@ -20,6 +21,7 @@ ...@@ -20,6 +21,7 @@
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuedraggable": "^2.24.3", "vuedraggable": "^2.24.3",
"vuex": "^3.1.2", "vuex": "^3.1.2",
"wangeditor": "^4.7.15",
"xlsx": "^0.18.5" "xlsx": "^0.18.5"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -22,7 +22,7 @@ export default { ...@@ -22,7 +22,7 @@ export default {
getRedEnvelopeMerchantList (params) { getRedEnvelopeMerchantList (params) {
params.method = 'scrm.api.carlife.merchant.listWithPageByCurMerchant' params.method = 'scrm.api.carlife.merchant.listWithPageByCurMerchant'
params.pageSize = 50 params.pageSize = params.pageSize || 50
return http({ return http({
url: '/rop-scrm-carlife/router', url: '/rop-scrm-carlife/router',
data: params data: params
...@@ -182,6 +182,73 @@ export default { ...@@ -182,6 +182,73 @@ export default {
url, url,
data: params data: params
}) })
} },
// 展示记录列表
displayListApi(params){
params.method = 'marketing.api.activityRedEnvelope.show.record.page'
return http({
url,
data: params
})
},
// 展示记录导出
displayExportApi(params){
params.method = 'marketing.api.activityRedEnvelope.show.record.export'
return http({
url,
data: params
})
},
// 抽奖记录列表
drawListApi(params){
params.method = 'marketing.api.activityRedEnvelope.lottery.draw.record.page'
return http({
url,
data: params
})
},
// 导出红包抽奖记录
drawExportApi(params){
params.method = 'marketing.api.activityRedEnvelope.lottery.draw.record.export'
return http({
url,
data: params
})
},
// 中奖记录列表
winningListApi(params){
params.method = 'marketing.api.activityRedEnvelope.winning.record.page'
return http({
url,
data: params
})
},
// 导出中奖记录列表
winningExportApi(params){
params.method = 'marketing.api.activityRedEnvelope.winning.record.export'
return http({
url,
data: params
})
},
// 实物奖品核销列表
winningGoodsApi(params){
params.method = 'marketing.api.activityRedEnvelope.winning.goods.record.page'
return http({
url,
data: params
})
},
// 实物奖品核销导出
winningGoodsExportApi(params){
params.method = 'marketing.api.activityRedEnvelope.winning.goods.record.export'
return http({
url,
data: params
})
},
} }
import { http } from '@/main'
const url = '/rop-scrm-marketing/router'
export default {
/**
* 分页查询接龙列表
*/
getSolitaireList (params) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.page'
return http({
url,
data: params
})
},
/**
* 导出查询接龙活动列表
*/
exportSolitaireList (params) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.list.export'
return http({
url,
data: params
})
},
/**获取接龙抽奖详情 */
getSolitaireDetail (params) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.detail'
return http({
url,
data: params
})
},
/**
* 新建或更新接龙活动
*/
createOrUpdateSolitaire (params) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.createOrUpdate'
return http({
url,
data: params
})
},
/**
* 红包活动
*/
getActivityRedEnvelopeList (params) {
params.method = 'marketing.api.activityRedEnvelope.merchant.list'
return http({
url,
data: params
})
},
/**商城券 */
getMerchantCouponList (params) {
params.method = 'scrm.api.coupon.list.merchant'
return http({
url: '/rop-scrm-coupon/router',
data: params
})
},
/**权益卡劵 */
getEquityActivityList (params) {
params.method = 'scrm.api.coupon.equity.list.merchant'
return http({
url: '/rop-scrm-coupon/router',
data: params
})
},
/**
* 分页查询群接龙中奖明细列表
*/
getSolitaireAewardList (params) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.record.page'
return http({
url,
data: params
})
},
/**
* 导出群接龙中奖明细列表
*/
exportSolitaireAewardList (params) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.record.export'
return http({
url,
data: params
})
},
/**
* 导出查询接龙明细列表
*/
exportSolitaireUserList (params) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.record.all.export'
return http({
url,
data: params
})
},
/** 查询接龙活动渠道来源 */
getSolitaireMerchantList (params = {}) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.merchants'
params.pageSize = 9999
params.pageNum = 1
return http({
url,
data: params
})
},
/**群聊列表 */
getMerchantWechatGroupList (params) {
params.method = 'entmicro.api.customer.base.list.simple'
return http({
url: '/rop-scrm-entmicro/router',
data: params
})
},
}
\ No newline at end of file \ No newline at end of file
<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>
\ No newline at end of file \ No newline at end of file
<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>
<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
},
disabled: Boolean
},
mounted () {
this.getEdit()
},
watch: {
'disabled' (n) {
if (n) this.forbidEdit()
}
},
methods: {
getEdit () {
const _this = this
this.editor = new E('#div-demo')
this.editor.config.focus = false
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>
<template>
<el-cascader placeholder="请选择省市区" clearable :props="areaProps" v-model="selectedArea"
@change="handleAreaChange"
:options="areaList"></el-cascader>
</template>
<script>
import areaData from 'china-area-data/v5/data';
export default {
name: 'AreaCascader',
props: {
selectedArea: {
type: Array,
default: () => []
},
key: {
type: String,
default: 'areaCode'
},
checkStrictly: {
type: Boolean,
default: false
}
},
data() {
return {
localSelectedArea: this.selectedArea,
areaProps: {
label: 'label',
value: 'value',
checkStrictly: this.checkStrictly
},
areaList: this.formatAreaData(areaData['86'], 1)
}
},
methods: {
handleAreaChange(value) {
this.$emit('update:selectedArea', value);
},
formatAreaData(data, level) {
return Object.keys(data).map(key => {
let item = {
value: key,
label: data[key]
};
if (level < 3 && areaData[key]) {
item.children = this.formatAreaData(areaData[key], level + 1);
}
return item;
});
}
},
watch: {
selectedArea(newVal) {
this.localSelectedArea = newVal;
},
}
}
</script>
<style lang="scss">
.el-cascader-panel {
max-height: 220px;
overflow-y: auto; /* 添加滚动条 */
}
</style>
...@@ -8,18 +8,25 @@ ...@@ -8,18 +8,25 @@
*/ */
// 本地环境配置 // 本地环境配置
module.exports = { module.exports = {
title: 'scrm-sub-marketing',
response: { response: {
data_key: 'data', data_key: 'data',
message_key: 'message', message_key: 'message',
code_key: 'code', code_key: ['code', 'returnCode'],
code_success_value: '0', code_success_value: '0',
errId_logout_value: '21', errId_logout_value: '21',
code_message_map: {} code_message_map: {}
}, },
request: { request: {
// baseURL: 'http://scrm.test.glsx.com.cn/', baseURL: "https://scrm.dev.glsx.com.cn",
baseURL: 'http://192.168.2.42:8064/', // 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
request_common: {
baseURL: "//didicb.glsx.com.cn",
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
...@@ -31,9 +38,13 @@ module.exports = { ...@@ -31,9 +38,13 @@ module.exports = {
appKey: '48e5e13229b82c1b4e6e8c96151f0637', appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0', v: '1.0.0',
format: 'json', format: 'json',
source: '' source: 'scrm-home'
},
sign_common: {
app_key: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: 'glsx'
}, },
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b', secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b",
cdn: 'https://www.xxx.cn/static'
} }
...@@ -12,19 +12,19 @@ let cfg = require('./conf.js') ...@@ -12,19 +12,19 @@ let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function(common) { export const fetchConfig = function (common) {
// if (isEnv) { // if (isEnv) {
// let { request } = cfg // let { request } = cfg
// Object.assign(request, { timeout }) // Object.assign(request, { timeout })
// return Promise.resolve(cfg) // return Promise.resolve(cfg)
// } // }
// return new Http().get('https://oss-config.dev.glsx.com.cn/mock/62ecda0909756a6f4f85cf9a/outbound/config') // return new Http().get('https://oss-config.dev.glsx.com.cn/mock/62ecda0909756a6f4f85cf9a/outbound/config')
let params = { moduleName: 'outbound', mockUrl: 'https://oss-config.test.glsx.com.cn/mock/62fe2a36abac6ff6ac239d3c/outbound/config',httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } } let params = { moduleName: 'outbound', mockUrl: 'https://oss-config.test.glsx.com.cn/mock/62fe2a36abac6ff6ac239d3c/outbound/config', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
console.log(common.utils.getConfig(params)) console.log(common.utils.getConfig(params))
return common.utils.getConfig(params) return common.utils.getConfig(params)
} }
export const config = { export const config = {
install(vue, cfg) { install (vue, cfg) {
vue.prototype.$config = cfg vue.prototype.$config = cfg
} }
} }
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
:tableParams="tableParams" :tableParams="tableParams"
:tableTotal="tableTotal" :tableTotal="tableTotal"
:pageConf="pageConf" :pageConf="pageConf"
@refreshTable="refreshTable"
ref="listRef" ref="listRef"
> >
</GLTable> </GLTable>
......
...@@ -91,6 +91,9 @@ export default { ...@@ -91,6 +91,9 @@ export default {
font-size: 14px; font-size: 14px;
color: #333333; color: #333333;
padding-top: 4px; padding-top: 4px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
&:hover { &:hover {
opacity: 0.95; opacity: 0.95;
......
...@@ -74,6 +74,9 @@ export default { ...@@ -74,6 +74,9 @@ export default {
font-size: 14px; font-size: 14px;
color: #333333; color: #333333;
padding-top: 4px; padding-top: 4px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
&:hover { &:hover {
opacity: 0.95; opacity: 0.95;
......
...@@ -150,10 +150,8 @@ export default { ...@@ -150,10 +150,8 @@ export default {
limitSize: 10, limitSize: 10,
maxPhotoNum: 1, maxPhotoNum: 1,
suffixSlot: 'cardCover', suffixSlot: 'cardCover',
beforeLoading: true,
handleUpload: async (e, file, targetItem) => { handleUpload: async (e, file, targetItem) => {
let loading = this.$loading({
target: document.querySelector('.activity-img'),
})
try { try {
const imgFile = e.target.result, const imgFile = e.target.result,
arrBase64 = imgFile.split(',')[1], arrBase64 = imgFile.split(',')[1],
...@@ -163,10 +161,10 @@ export default { ...@@ -163,10 +161,10 @@ export default {
if (res) { if (res) {
this.configForm[targetItem.name] = res this.configForm[targetItem.name] = res
this.formRef().validateField(targetItem.name) this.formRef().validateField(targetItem.name)
loading.close() this.$loading().close()
} else throw '上传失败' } else throw '上传失败'
} catch (error) { } catch (error) {
loading.close() this.$loading().close()
this.$message(error) this.$message(error)
} }
} }
...@@ -268,6 +266,7 @@ export default { ...@@ -268,6 +266,7 @@ export default {
} }
try { try {
if (index == 2) params.pageNum = pageNum if (index == 2) params.pageNum = pageNum
if(index == 3) params.pageSize = 9999
this.activityObj.loading = true this.activityObj.loading = true
const res = await this.$apis.questionnaire[targetApi](params) const res = await this.$apis.questionnaire[targetApi](params)
let data = res let data = res
...@@ -275,6 +274,7 @@ export default { ...@@ -275,6 +274,7 @@ export default {
data = [...this.activityObj.data, ...res.list] data = [...this.activityObj.data, ...res.list]
this.activityObj.total = res.total this.activityObj.total = res.total
} }
if(index == 3) data = res.list
this.setActivityData(data) this.setActivityData(data)
} catch (error) { } catch (error) {
this.setActivityData() this.setActivityData()
......
...@@ -379,9 +379,10 @@ export default { ...@@ -379,9 +379,10 @@ export default {
let arr = Array.from(new Set([...value.split('\n').map(e => e)])), let arr = Array.from(new Set([...value.split('\n').map(e => e)])),
str = [] str = []
arr.map(i => { arr.map(i => {
if (i && ((type === 1 || type === 2) && str.length < 10 || (type === 4 || type === 5))) { if (i) str.push(i.trim())
str.push(i.trim()) // if (i && ((type === 1 || type === 2) && str.length < 10 || (type === 4 || type === 5))) {
} // str.push(i.trim())
}) })
this.configForm[inputKeyObject[type]] = str.join('\n') this.configForm[inputKeyObject[type]] = str.join('\n')
}, },
......
<template>
<div>ActiveTemplateManagement</div>
</template>
<script>
export default {
name: "ActiveTemplateManagement"
}
</script>
<style scoped>
</style>
// dataImportMixin.js
import * as dayjs from 'dayjs';
import url from '@/assets/empty.png'
export default {
data() {
return {
url,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
searchForm: {
selectedArea:[]
},
searchFormData: [
{
label: '微信昵称',
name: 'wechatName',
type: 'input',
maxlength: 100
},
{
label: '手机号',
name: 'userPhone',
type: 'input',
maxlength: 100
},
{
label: '活动名称',
name: 'activityName',
type: 'input',
maxlength: 100
},
{
label: '省市区',
addHtml:'regionSlot'
},
{
label: '展示时间',
name: 'showTime',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
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.redenvelope.displayListApi,
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '手机号',
prop: 'userPhone',
minWidth: 100
},
{
label: '微信昵称',
prop: 'wechatName',
minWidth: 100
},
{
label: '红包链接',
prop: 'link',
minWidth: 100
},
{
label: '活动名称',
minWidth: 100,
prop:'activityName'
},
{
label: '省份',
prop: 'provinces',
minWidth: 100
},
{
label: '城市',
prop: 'city',
minWidth: 150
},
{
label: '区域',
prop: 'districts',
minWidth: 150
},
{
label: '详细地址',
prop: 'address',
minWidth: 100
},
{
label: '展示时间',
prop: 'showTime',
minWidth: 100
},
]
},
tableSearchForm: {}
}
},
methods: {
},
};
<template>
<div class="container">
<div class="sticky">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
>
<div slot="regionSlot">
<regionCascader :checkStrictly="true" @update:selectedArea="val => searchForm.selectedArea = val"></regionCascader>
</div>
</GLCombiForm>
<div class="sticky-btns">
<div class="btns">
<el-button
@click="handleExport('displayExportApi')"
>导出
</el-button>
</div>
</div>
</div>
<div class="tabelList">
<div class="table-title">展示记录列表</div>
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span>
</GLTable>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import dataImportMixin from "./dataImportMixin";
import repeatMethods from "../common/repeatMethods";
import regionCascader from "@/components/regionCascader";
import {exportFn} from '@/common/constant'
import {utils} from 'glsx-common'
export default {
name: 'DisplayRecord',
mixins: [dataImportMixin,repeatMethods],
components:{
regionCascader
},
data() {
return {
}
},
mounted() {
},
methods: {
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
this.updateParams(params, 'showTime', 'showTime', 'startShowTime', 'endShowTime');
return params
},
}
}
</script>
<style scoped lang='scss'>
.container {
height: 100%;
background-color: #fff;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 20px;
.table-title {
font-weight: 700;
font-size: 16px;
color: #333333;
padding-bottom: 18px;
}
.sticky {
position: relative;
z-index: 2;
&-btns {
position: absolute;
right: 0;
bottom: -23px;
overflow: hidden;
.el-button + .el-button {
margin-left: 8px;
}
.btns {
transition: all 0.25s;
.el-button {
padding: 8px 15px;
min-width: 60px;
}
}
}
}
}
</style>
// dataImportMixin.js
import * as dayjs from 'dayjs';
import url from '@/assets/empty.png'
export default {
data() {
return {
url,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
searchForm: {
selectedArea:[]
},
searchFormData: [
{
label: '微信昵称',
name: 'wechatName',
type: 'input',
maxlength: 100
},
{
label: '手机号',
name: 'userPhone',
type: 'input',
maxlength: 100
},
{
label: '活动名称',
name: 'activityName',
type: 'input',
maxlength: 100
},
{
label: '省市区',
addHtml:'regionSlot'
},
{
label: '状态',
name: 'activityName',
type: 'input',
maxlength: 100
},
{
label: '抽奖时间',
name: 'openTime',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
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.redenvelope.drawListApi,
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '手机号',
prop: 'userPhone',
minWidth: 100
},
{
label: '微信昵称',
prop: 'wechatName',
minWidth: 100
},
{
label: '红包链接',
prop: 'link',
minWidth: 100
},
{
label: '活动名称',
minWidth: 100,
prop:'activityName'
},
{
label: '省份',
prop: 'provinces',
minWidth: 100,
},
{
label: '城市',
prop: 'city',
minWidth: 150
},
{
label: '区域',
prop: 'districts',
minWidth: 150
},
{
label: '详细地址',
prop: 'address',
minWidth: 100
},
{
label: '状态',
prop:'statusStr'
},
{
label: '抽奖时间',
prop: 'openTime',
minWidth: 100
},
]
},
tableSearchForm: {}
}
},
methods: {
},
};
<template>
<div class="container">
<div class="sticky">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
>
<div slot="regionSlot">
<regionCascader :checkStrictly="true" @update:selectedArea="val => searchForm.selectedArea = val"></regionCascader>
</div>
</GLCombiForm>
<div class="sticky-btns">
<div class="btns">
<el-button
@click="handleExport('drawExportApi')"
>导出
</el-button>
</div>
</div>
</div>
<div class="tabelList">
<div class="table-title">抽奖列表</div>
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
:beforeSearchFn="beforeSearchFn"
></GLTableButton>
</span>
</GLTable>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import regionCascader from "@/components/regionCascader";
import dataImportMixin from "./dataImportMixin";
import repeatMethods from "../common/repeatMethods";
export default {
name: 'DisplayRecord',
mixins: [dataImportMixin,repeatMethods],
components:{
regionCascader
},
data() {
return {
}
},
mounted() {
},
methods: {
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
this.updateParams(params, 'openTime', 'openTime', 'startOpenTime', 'endOpenTime');
return params
},
}
}
</script>
<style scoped lang='scss'>
.container {
height: 100%;
background-color: #fff;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 20px;
.table-title {
font-weight: 700;
font-size: 16px;
color: #333333;
padding-bottom: 18px;
}
.sticky {
position: relative;
z-index: 2;
&-btns {
position: absolute;
right: 0;
bottom: -23px;
overflow: hidden;
.el-button + .el-button {
margin-left: 8px;
}
.btns {
transition: all 0.25s;
.el-button {
padding: 8px 15px;
min-width: 60px;
}
}
}
}
}
</style>
// dataImportMixin.js
import * as dayjs from 'dayjs';
import url from '@/assets/empty.png'
export default {
data() {
return {
url,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
searchForm: {
},
searchFormData: [
{
label: '微信昵称',
name: 'wechatName',
type: 'input',
maxlength: 100
},
{
label: '手机号',
name: 'userPhone',
type: 'input',
maxlength: 100
},
{
label: '活动名称',
name: 'activityName',
type: 'input',
maxlength: 100
},
{
label: '核销类型',
name: 'exchangeType',
type: 'select',
optionList: [
{ text: '全部', id: '' },
{ text: '快递到家', id: '0' },
{ text: '到店核销', id: '1' }
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '核销状态',
name: 'exchangeStatus',
type: 'select',
optionList: [
{ text: '全部', id: '' },
{ text: '代发货', id: '0' },
{ text: '已发货', id: '1' },
{ text: '待核销', id: '2' },
{ text: '已核销', id: '3' }
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '奖品名称',
name: 'prizeName',
type: 'input',
maxlength: 11
},
{
label: '核销时间',
name: 'exchangeTime',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
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.redenvelope.winningGoodsApi,
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '手机号',
prop: 'userPhone',
minWidth: 100
},
{
label: '微信昵称',
prop: 'wechatName',
minWidth: 100
},
{
label: '红包链接',
prop: 'link',
minWidth: 100
},
{
label: '活动名称',
minWidth: 100,
prop: 'activityName',
},
{
label: '奖品名称',
minWidth: 100,
prop: 'activityName',
},
{
label: '核销类型',
minWidth: 150,
formatter: cell => {
return {0: '快递到家', 1: '到店核销'}[cell.exchangeType]
}
},
{
label: '核销状态',
minWidth: 150,
prop:'statusStr'
},
{
label: '核销时间',
prop: 'operateTime',
minWidth: 100
},
]
},
tableSearchForm: {}
}
},
methods: {
},
};
<template>
<div class="container">
<div class="sticky">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
>
</GLCombiForm>
<div class="sticky-btns">
<div class="btns">
<el-button
@click="handleExport('winningGoodsExportApi')"
>导出
</el-button>
</div>
</div>
</div>
<div class="tabelList">
<div class="table-title">实物奖品核销列表</div>
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span>
</GLTable>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import dataImportMixin from "./dataImportMixin";
import repeatMethods from "../common/repeatMethods";
export default {
name: 'DisplayRecord',
mixins: [dataImportMixin,repeatMethods],
components:{
},
data() {
return {
}
},
mounted() {
},
methods: {
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
this.updateParams(params, 'exchangeTime', 'exchangeTime', 'startExchangeTime', 'endExchangeTime');
return params
}
}
}
</script>
<style scoped lang='scss'>
.container {
height: 100%;
background-color: #fff;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 20px;
.table-title {
font-weight: 700;
font-size: 16px;
color: #333333;
padding-bottom: 18px;
}
.sticky {
position: relative;
z-index: 2;
&-btns {
position: absolute;
right: 0;
bottom: -23px;
overflow: hidden;
.el-button + .el-button {
margin-left: 8px;
}
.btns {
transition: all 0.25s;
.el-button {
padding: 8px 15px;
min-width: 60px;
}
}
}
}
}
</style>
...@@ -103,6 +103,18 @@ export default { ...@@ -103,6 +103,18 @@ export default {
type: 'datePicker', type: 'datePicker',
isClear: true isClear: true
}, },
{
label: '创建类型',
name: 'createdSource',
type: 'select',
optionList: [
{ text: '全部', id: '' },
{ text: '外采', id: '1' },
{ text: '自研', id: '0' },
],
optionId: 'id',
optionLabel: 'text'
},
], ],
getListApi: this.$apis.redenvelope.getRedEnvelopeConfigList, getListApi: this.$apis.redenvelope.getRedEnvelopeConfigList,
tableParams: { tableParams: {
...@@ -128,6 +140,13 @@ export default { ...@@ -128,6 +140,13 @@ export default {
} }
}, },
{ {
label: '创建类型',
minWidth: 100,
formatter:cell => {
return {'0':'自研','1':'外采'}[cell.createdSource]
}
},
{
label: '活动形式', label: '活动形式',
prop: 'activityTypeStr', prop: 'activityTypeStr',
minWidth: 100 minWidth: 100
......
...@@ -78,11 +78,11 @@ export default { ...@@ -78,11 +78,11 @@ export default {
listName: 'data', listName: 'data',
tableOption: false, tableOption: false,
tableColumns: [ tableColumns: [
// { {
// label: '红包链接', label: '红包链接',
// prop: 'link', prop: 'link',
// minWidth: 180 minWidth: 180
// }, },
{ {
label: '导入时间', label: '导入时间',
prop: 'exportTime', prop: 'exportTime',
......
...@@ -212,6 +212,7 @@ export default { ...@@ -212,6 +212,7 @@ export default {
exportFn(res) exportFn(res)
}) })
}, },
getParams() { getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm)) let params = JSON.parse(JSON.stringify(this.searchForm))
this.updateParams(params, 'showTime', 'showTime', 'startShowTime', 'endShowTime'); this.updateParams(params, 'showTime', 'showTime', 'startShowTime', 'endShowTime');
......
...@@ -118,6 +118,12 @@ export default { ...@@ -118,6 +118,12 @@ export default {
maxlength: 100 maxlength: 100
}, },
{ {
label: '手机号',
name: 'userPhone',
type: 'input',
maxlength: 100
},
{
label: '提现金额/元', label: '提现金额/元',
addHtml: 'thirdCashOutMoneySlot', addHtml: 'thirdCashOutMoneySlot',
// type: 'input' // type: 'input'
...@@ -137,7 +143,19 @@ export default { ...@@ -137,7 +143,19 @@ export default {
return false return false
} }
} }
} },
{
label: '提现类型',
name: 'cashOutType',
type: 'select',
optionList: [
{ text: '全部', id: '' },
{ text: '自研提现', id: '0' },
{ text: '外采提现', id: '1' },
],
optionId: 'id',
optionLabel: 'text'
},
], ],
getListApi: this.$apis.redenvelope.getRedEnvelopeWithdraw, getListApi: this.$apis.redenvelope.getRedEnvelopeWithdraw,
tableParams: { tableParams: {
...@@ -155,11 +173,29 @@ export default { ...@@ -155,11 +173,29 @@ export default {
minWidth: 100 minWidth: 100
}, },
{ {
label: '红包链接',
prop: 'link',
minWidth: 100
},
{
label: '活动名称',
prop: 'activityName',
minWidth: 100
},
{
label: '流水号', label: '流水号',
prop: 'thirdSerialNumber', prop: 'thirdSerialNumber',
minWidth: 100 minWidth: 100
}, },
{ {
label: '提现类型',
minWidth: 100,
formatter:
cell => {
return {0: '自研提现', 1: '外采提现'}[cell.cashOutType]
}
},
{
label: '提现金额/元', label: '提现金额/元',
prop: 'thirdCashOutMoney', prop: 'thirdCashOutMoney',
minWidth: 100, minWidth: 100,
......
// dataImportMixin.js
import * as dayjs from 'dayjs';
import url from '@/assets/empty.png'
export default {
data() {
return {
url,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
searchForm: {
},
searchFormData: [
{
label: '微信昵称',
name: 'wechatName',
type: 'input',
maxlength: 100
},
{
label: '手机号',
name: 'userPhone',
type: 'input',
maxlength: 100
},
{
label: '活动名称',
name: 'activityName',
type: 'input',
maxlength: 100
},
{
label: '奖品类型',
name: 'prizeType',
type: 'select',
optionList: [
{ text: '全部', id: '' },
{ text: '红包', id: '0' },
{ text: '实物', id: '1' },
{ text: '优惠券', id: '2' },
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '奖品名称',
name: 'prizeName',
type: 'input',
maxlength: 11
},
{
label: '金额',
addHtml:'priceSlot'
},
{
label: '状态',
name: 'status',
type: 'select',
maxlength: 100,
optionList: [
{ text: '全部', id: '' },
{ text: '已领取', id: '0' },
{ text: '领取失败', id: '1' },
{ text: '发放中', id: '2' },
{ text: '发放成功', id: '3' },
{ text: '发放失败', id: '4' },
{ text: '待核销', id: '5' },
{ text: '已核销', id: '6' },
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '中奖时间',
name: 'winTime',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
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.redenvelope.winningListApi,
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '手机号',
prop: 'userPhone',
minWidth: 100
},
{
label: '微信昵称',
prop: 'wechatName',
minWidth: 100
},
{
label: '红包链接',
prop: 'link',
minWidth: 100
},
{
label: '活动名称',
minWidth: 100,
prop: 'activityName',
},
{
label: '奖品类型',
minWidth: 150,
formatter: cell => {
return {0: '红包', 1: '实物', 2: '优惠券'}[cell.prizeType]
}
},
{
label: '金额/元',
prop: 'amount',
minWidth: 100
},
{
label: '省份',
prop: 'provinces',
minWidth: 100,
},
{
label: '城市',
prop: 'city',
minWidth: 150
},
{
label: '区域',
prop: 'districts',
minWidth: 150
},
{
label: '详细地址',
prop: 'address',
minWidth: 100
},
{
label: '状态',
minWidth: 100,
prop:'statusStr'
},
{
label: '中奖时间',
prop: 'winTime',
minWidth: 100
},
]
},
tableSearchForm: {}
}
},
methods: {
},
};
<template>
<div class="container">
<div class="sticky">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
>
<div slot="priceSlot">
<inputNumRange :formData="searchForm" :keyObj="{from: 'startAmount', to:'endAmount'}"></inputNumRange>
</div>
</GLCombiForm>
<div class="sticky-btns">
<div class="btns">
<el-button
@click="handleExport('winningExportApi')"
>导出
</el-button>
</div>
</div>
</div>
<div class="tabelList">
<div class="table-title">中奖列表</div>
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span>
</GLTable>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import dataImportMixin from "./dataImportMixin";
import repeatMethods from "../common/repeatMethods";
import inputNumRange from "@/components/inputNumRange";
export default {
name: 'DisplayRecord',
mixins: [dataImportMixin, repeatMethods],
components: {
inputNumRange
},
data() {
return {}
},
mounted() {
},
methods: {
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
params.startAmount = params.startAmount ? params.startAmount * 100 : ''
params.endAmount = params.endAmount ? params.endAmount * 100 : ''
this.updateParams(params, 'winTime', 'winTime', 'startWinTime', 'startWinTime');
return params
}
}
}
</script>
<style scoped lang='scss'>
.container {
height: 100%;
background-color: #fff;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 20px;
.table-title {
font-weight: 700;
font-size: 16px;
color: #333333;
padding-bottom: 18px;
}
.sticky {
position: relative;
z-index: 2;
&-btns {
position: absolute;
right: 0;
bottom: -23px;
overflow: hidden;
.el-button + .el-button {
margin-left: 8px;
}
.btns {
transition: all 0.25s;
.el-button {
padding: 8px 15px;
min-width: 60px;
}
}
}
}
}
</style>
import {exportFn} from "@/common/constant";
export default {
methods: {
handleSearch() {
this.tableSearchForm = this.getParams()
this.$refs.listRef.refreshTable()
},
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
},
handleExport(apiName) {
const params = this.getParams()
this.$apis.redenvelope[apiName](params).then(res => {
exportFn(res)
})
},
beforeSearchFn() {
return new Promise((resolve) => {
const { selectedArea } = this.searchForm;
// 清除旧的省市区 ID
this.searchForm.provincesId = '';
this.searchForm.cityId = '';
this.searchForm.districtsId = '';
// 根据 selectedArea 的长度设置相应的 ID
if (selectedArea) {
[this.searchForm.provincesId, this.searchForm.cityId, this.searchForm.districtsId] = selectedArea;
}
delete this.searchForm.selectedArea;
resolve();
});
},
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
updateParams(params, paramKey, formKey, beginKey, endKey) {
if (params[paramKey]) {
params[beginKey] = this.searchForm[formKey][0];
params[endKey] = this.searchForm[formKey][1];
delete params[paramKey];
} else {
delete params[beginKey];
delete params[endKey];
}
return params
}
},
}
...@@ -18,14 +18,25 @@ ...@@ -18,14 +18,25 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import RedEnvelopeConfig from './components/RedEnvelopeConfig/index.vue' // import RedEnvelopeConfig from './components/RedEnvelopeConfig/index.vue'
import RedEnvelopeRecord from './components/RedEnvelopeRecord/index.vue' // import RedEnvelopeRecord from './components/RedEnvelopeRecord/index.vue'
import RedEnvelopeWithdraw from "./components/RedEnvelopeWithdraw/index.vue"; // import RedEnvelopeWithdraw from "./components/RedEnvelopeWithdraw/index.vue";
// import DisplayRecord from "./components/DisplayRecord/index.vue";
// import DrawRecord from "./components/DrawRecord/index.vue";
// import WinningRecord from "./components/WinningRecord/index.vue";
// import PhysicalPrizeWriteOff from "./components/PhysicalPrizeWriteOff/index.vue";
// import ActiveTemplateManagement from "./components/ActiveTemplateManagement/index.vue";
export default { export default {
// 按需加载子组件
components: { components: {
RedEnvelopeConfig, RedEnvelopeConfig: () => import('./components/RedEnvelopeConfig/index.vue'),
RedEnvelopeRecord, RedEnvelopeRecord: () => import('./components/RedEnvelopeRecord/index.vue'),
RedEnvelopeWithdraw RedEnvelopeWithdraw: () => import('./components/RedEnvelopeWithdraw/index.vue'),
DisplayRecord: () => import('./components/DisplayRecord/index.vue'),
DrawRecord: () => import('./components/DrawRecord/index.vue'),
WinningRecord: () => import('./components/WinningRecord/index.vue'),
PhysicalPrizeWriteOff: () => import('./components/PhysicalPrizeWriteOff/index.vue'),
ActiveTemplateManagement: () => import('./components/ActiveTemplateManagement/index.vue')
}, },
name: '', name: '',
data () { data () {
...@@ -37,13 +48,33 @@ export default { ...@@ -37,13 +48,33 @@ export default {
name: 'RedEnvelopeConfig' name: 'RedEnvelopeConfig'
}, },
{ {
label: '提现记录',
name: 'RedEnvelopeWithdraw'
},
{
label: '展示记录',
name:'DisplayRecord'
},
{
label: '抽奖记录',
name:'DrawRecord'
},
{
label: '中奖记录',
name:'WinningRecord'
},
{
label: '实物奖品核销',
name:'PhysicalPrizeWriteOff'
},
{
label: '红包记录', label: '红包记录',
name: 'RedEnvelopeRecord' name: 'RedEnvelopeRecord'
}, },
{ {
label: '提现记录', label: '活动模板管理',
name: 'RedEnvelopeWithdraw' name:'ActiveTemplateManagement'
}, }
] ]
} }
}, },
......
import * as dayjs from 'dayjs'
const generateOptionsArray = function (count = 9) {
return Array.from({ length: count }, (_, index) => ({
optionId: Number(index + 1),
optionLabel: Number(index + 1)
}))
},
required = true,
trigger = 'change'
export const formData = that => {
return [
{
label: '所属渠道',
name: 'merchantId',
width: '432px',
addHtml: 'merchantId'
// attrs: {
// 'filter-method': (e) => {
// that.getMerchantList(e)
// },
// remote: true
// },
// noFilter: false,
// optionList: [],
// optionId: 'confId',
// optionLabel: 'confName',
// isDisabled: false
},
{
label: '群接龙种类',
type: 'radio',
name: 'gameplayType',
optionList: [
{
text: '猜数字',
id: 1
},
],
optionId: 'id',
optionLabel: 'text',
isDisabled: false
},
{
label: '群接龙说明',
name: 'description',
type: 'textBox',
excludeMenus: ['video', 'code', 'table', 'splitLine'],
boxHeight: 240,
width: '592px',
isDisabled: false
},
{
label: '卡片标题',
name: 'title',
type: 'input',
maxlength: 20,
isDisabled: false
},
{
label: '卡片封面',
name: 'cover',
type: 'upload',
width: '320px',
limitSize: 10,
maxPhotoNum: 1,
suffixSlot: 'cover',
beforeLoading: true,
isDisabled: false,
handleUpload: async (e, file, targetItem, config) => {
try {
const { result: imgFile } = e.target,
arrBase64 = imgFile.split(',')[1],
str = file.name.split('.'),
base64 = str.at(-1) + '@' + arrBase64,
res = await that.$apis.common.pictureUpload({ file: base64, fileType: 'image' })
that.$loading().close()
if (res) {
config[targetItem.name] = res
that.formRef.validateField(targetItem.name)
} else throw '上传失败'
} catch (error) {
that.$loading().close()
that.$message(error)
}
}
},
{
label: '数字上限',
name: 'numLimit',
type: 'select',
optionList: generateOptionsArray(),
optionId: 'optionId',
optionLabel: 'optionLabel',
isDisabled: false
},
{
label: '中奖数字',
name: 'numWin',
type: 'select',
optionList: [
{
optionId: 0,
optionLabel: '随机'
},
...generateOptionsArray()
],
optionId: 'optionId',
optionLabel: 'optionLabel',
isDisabled: false
},
{
label: '接龙结束时间',
type: 'radio',
name: 'endTimeType',
optionList: [
{
text: '无限制',
id: 0
},
{
text: '选择时间',
id: 1
},
],
optionId: 'id',
optionLabel: 'text',
suffixSlot: 'endTimeType',
isDisabled: false
},
{
label: '接龙开奖时间',
name: 'lotteryTime',
addHtml: 'lotteryTime',
isDisabled: false
},
{
label: '转发群限制',
type: 'radio',
name: 'groupLimitOpen',
optionList: [
{
text: '无限制',
id: false
},
{
text: '限制群',
id: true
},
],
optionId: 'id',
optionLabel: 'text',
suffixSlot: 'groupLimitOpen',
isDisabled: false
},
{
label: '关联奖品',
name: 'rewardId',
addHtml: 'rewardId',
isDisabled: false
}
]
}
export const rule = that => {
return {
type: [{ required, message: '请选择接龙种类', trigger }],
merchantId: [{ required, message: '请选择所属渠道', trigger }],
description: [{ required, message: '请输入群接龙说明', trigger }],
title: [{ required, message: '请输入卡片标题', trigger }],
cover: [{ required, message: '请上传卡片封面', trigger }],
numLimit: [{ required }],
numWin: [{ required }],
endTimeType: [{
required,
validator: (rule, value, callback) => {
if (that.disabled) callback()
try {
if (value == 1) {
if (!that.configForm.endTime) throw '请选择接龙结束时间'
else {
if (dayjs(that.configForm.endTime).valueOf() < dayjs().valueOf()) throw '接龙结束时间需大于当前时间'
}
}
callback()
} catch (error) {
callback(new Error(error))
}
},
}],
lotteryTime: [{
required, trigger,
validator: (rule, value, callback) => {
try {
if (that.disabled) callback()
if (!value) throw '请选择接龙开奖时间'
else {
const valueTimestamp = dayjs(value).valueOf()
if (that.configForm.endTimeType != 1) {
if (valueTimestamp < dayjs().valueOf()) throw '接龙开奖时间需大于当前时间'
} else {
if (valueTimestamp < dayjs(that.configForm.endTime).valueOf()) throw '接龙开奖时间需大于或等于接龙结束时间'
}
}
callback()
} catch (error) {
callback(new Error(error))
}
},
}],
groupLimitOpen: [{
required,
validator: (rule, value, callback) => {
if (value == 1 && !that.configForm.groupLimitList.length) {
callback(new Error('请选择群'))
}
callback()
},
}],
rewardId: [{ required, message: '请选择关联奖品', trigger }]
}
}
export const afterRangePickerOptions = {
disabledDate (time) {
let oneDay = 60 * 60 * 24 * 1000;
return time.getTime() < Date.now() - oneDay
},
}
// computed: {
// afterRangePickerOptions () {
// //这里判断是不是今天
// let newVal = new Date(this.configForm.endTime)
// let selectableRange = '00:00:00 - 23:59:59' //默认的时间范围
// if (
// newVal &&
// newVal.getFullYear() == new Date().getFullYear() &&
// newVal.getMonth() == new Date().getMonth() &&
// newVal.getDate() == new Date().getDate()
// ) {
// //如果为今天,则限制当前时间前的时间+1分钟不能选择。
// selectableRange = new Date().getHours() + ':' + (new Date().getMinutes() + 1) + ':00 - 23:59:59'
// }
// return {
// selectableRange,
// disabledDate (time) {
// // 只能选大于当前截止时间的
// return time.getTime() < Date.now() - 8.64e7
// }
// }
// }
// }
\ No newline at end of file \ No newline at end of file
<template>
<div
@click="chooseRed(data.id,data.couponName)"
:class="['item',{'disabled':disabled},{'active':configForm.rewardId == data.id}]"
>
<div class="radio">
<img src="@/assets/red-radio.png" />
</div>
<div class="icon">
<img src="@/assets/activity-2.png" />
</div>
<div class="icon"></div>
<div class="title">{{ data.couponName }}</div>
<template v-if="[2,3,6].includes(data.effectiveType)">
<div class="type">有效期:
<template v-if="data.effectiveType == 2">
{{ data.effectiveStartTime ? data.effectiveStartTime.split(' ')[0] : '' }}~{{ data.effectiveEndTime ? data.effectiveEndTime.split(' ')[0] : '' }}
</template>
<template v-if="data.effectiveType == 3">
无限制
</template>
<template v-if="data.effectiveType == 6">
{{ data.effectiveDays }}天
</template>
</div>
</template>
<div class="time">使用途径: {{ data.useChannel == 1 ? '线上商品' : '到店核销' }}</div>
<div class="status flex">数量:{{ data.residueAmount || 0 }}</div>
</div>
</template>
<script type='text/ecmascript-6'>
import * as dayjs from 'dayjs'
export default {
name: '',
props: {
data: {
type: Object,
default: () => { }
},
configForm: {
type: Object,
default: () => { }
},
disabled: Boolean
},
data () {
return {
dayjs,
}
},
mounted () {
},
methods: {
chooseRed (rewardId, rewardName) {
const { disabled } = this
if (disabled) return
this.$emit('choose', {
rewardId,
rewardName
})
}
}
}
</script>
<style scoped lang='scss'>
.item {
width: 100%;
height: 96px;
background: #fff;
border-radius: 4px;
box-sizing: border-box;
cursor: pointer;
padding: 0 16px;
font-size: 12px;
color: #999999;
line-height: 17px;
position: relative;
user-select: none;
.icon {
position: absolute;
right: 0;
bottom: 0;
width: 28px;
height: 28px;
}
.radio {
display: none;
}
.title {
font-weight: 500;
font-size: 14px;
color: #333333;
padding: 10px 0 7px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&:hover {
opacity: 0.95;
}
}
.active {
border-color: #5850ff;
.radio {
display: block;
position: absolute;
right: 0;
top: 0;
width: 16px;
height: 16px;
background-color: #5850ff;
border-radius: 0 0 0 4px;
overflow: hidden;
}
&::after {
content: '';
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
border: 1px solid #5850ff;
box-sizing: border-box;
}
}
.disabled {
cursor: not-allowed;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div
@click="chooseRed(data.id,data.goodsName)"
:class="['item',{'disabled':disabled},{'active':configForm.rewardId == data.id}]"
>
<div class="radio">
<img src="@/assets/red-radio.png" />
</div>
<div class="icon">
<img src="@/assets/activity-3.png" />
</div>
<div class="title">品牌:{{ data.brandName }}</div>
<div class="time">商品名称:{{data.goodsName}}</div>
<div class="status flex">券面额:{{Number(data.denomination / 100).toFixed(2)}}</div>
</div>
</template>
<script type='text/ecmascript-6'>
import * as dayjs from 'dayjs'
export default {
name: '',
props: {
data: {
type: Object,
default: () => { }
},
configForm: {
type: Object,
default: () => { }
},
disabled: Boolean
},
data () {
return {
dayjs,
}
},
mounted () {
},
methods: {
chooseRed (rewardId, rewardName) {
const { disabled } = this
if (disabled) return
this.$emit('choose', {
rewardId,
rewardName
})
}
}
}
</script>
<style scoped lang='scss'>
.item {
width: 100%;
height: 75px;
background: #fff;
border-radius: 4px;
box-sizing: border-box;
cursor: pointer;
padding: 0 16px;
font-size: 12px;
color: #999999;
line-height: 17px;
position: relative;
user-select: none;
.icon {
position: absolute;
right: 0;
bottom: 0;
width: 28px;
height: 28px;
}
.radio {
display: none;
}
.title {
padding-top: 12px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
&:hover {
opacity: 0.95;
}
}
.active {
.radio {
display: block;
position: absolute;
right: 0;
top: 0;
width: 16px;
height: 16px;
background-color: #5850ff;
border-radius: 0 0 0 4px;
overflow: hidden;
}
&::after {
content: '';
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
border: 1px solid #5850ff;
box-sizing: border-box;
}
}
.disabled {
cursor: not-allowed;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="tab-box">
<el-tabs
ref="tabs"
v-model="rewardType"
@tab-click="handleClick"
:disabled="disabled"
>
<template v-for="(i,index) in rewardList">
<el-tab-pane
:key="index"
:label="i.label"
:name="i.name"
:disabled="disabled"
>
<template v-if="dataList[i.name].list.length">
<div class="content-box">
<template v-for="(item,ind) in dataList[i.name].list">
<template>
<component
:key="ind"
:is="{
3: 'EquityItem',
2: 'CouponItem',
1: 'RedEnvelopeItem'
}[rewardType]"
:configForm="form"
:data="item"
@choose="choose"
:disabled="disabled"
></component>
</template>
</template>
</div>
<el-pagination
background
@current-change="handleCurrentChange"
:page-size="15"
layout="total, prev, pager, next"
:total="dataList[i.name].total"
>
</el-pagination>
</template>
<template v-else>
<div class="nothing">
<img :src="url">
暂无数据
</div>
</template>
</el-tab-pane>
</template>
</el-tabs>
</div>
</template>
<script type='text/ecmascript-6'>
import url from '@/assets/empty.png'
import EquityItem from './EquityItem.vue'
import CouponItem from './CouponItem.vue'
import RedEnvelopeItem from './RedEnvelopeItem.vue'
export default {
name: 'prize-box',
components: { RedEnvelopeItem, EquityItem, CouponItem },
props: {
form: {
type: Object,
default: () => { }
},
disabled: Boolean
},
data () {
return {
url,
rewardType: 1,
rewardList: [
{ label: '红包活动', name: 1 },
{ label: '商城券', name: 2 },
{ label: '权益卡券', name: 3 },
],
dataList: {
1: {
list: [],
total: 0,
pageNum: 1
},
2: {
list: [],
total: 0,
pageNum: 1
},
3: {
list: [],
total: 0,
pageNum: 1
}
}
}
},
mounted () {
this.init()
},
methods: {
reset () {
this.dataList = this.$options.data.call(this).dataList
this.handleClick()
},
init () {
const { rewardType } = this
this.$nextTick(() => {
this.$refs.tabs.$emit('tab-click', { name: rewardType })
})
},
handleClick () {
this.resetActivePosition(this.$refs.tabs.$el)
this.getActivityList()
},
resetActivePosition ($el) { // tabs的样式修改
this.$nextTick(() => {
const activeEl = $el.querySelector('.el-tabs__item.is-active'),
lineEl = $el.querySelector('.el-tabs__active-bar'),
style = getComputedStyle(activeEl),
pl = style.paddingLeft.match(/\d+/)[0] * 1,
pr = style.paddingRight.match(/\d+/)[0] * 1,
w = style.width.match(/\d+/)[0] * 1
lineEl.style.transform = 'translateX(' + (activeEl.offsetLeft + pl) + 'px)'
lineEl.style.width = (w - pl - pr) + 'px'
})
},
handleCurrentChange (e) {
const { rewardType: index } = this
this.dataList[index].pageNum = e
this.getActivityList()
},
async getActivityList () {
const { rewardType: index } = this,
{ merchantId } = this.form,
{ pageNum } = this.dataList[index],
targetApi = {
1: 'getActivityRedEnvelopeList',
2: 'getMerchantCouponList',
3: 'getEquityActivityList',
}[index],
params = {
merchantId,
pageNum,
pageSize: 15
}
if (!merchantId) return
if (index == 2) {
params.status = 2
params.directionalFlag = 1
params.validlype = 'valid'
params.discountTypes = [2, 3, 4, 7]
}
if (index == 3) {
params.status = 2
params.appearance = 1
}
try {
this.$loading()
const data = await this.$apis.solitaire[targetApi](params)
this.dataList[index].list = data.list
this.dataList[index].total = data.total
this.$loading().close()
} catch (error) {
console.log(error)
this.$loading().close()
}
},
choose ({ rewardId, rewardName }) {
this.$emit('choose', {
rewardId,
rewardName,
rewardType: this.rewardType
})
}
}
}
</script>
<style scoped lang='scss'>
.tab-box {
width: 824px;
padding: 0 20px 20px;
background: #f9f9f9;
/deep/.el-tabs--top {
line-height: 56px;
}
/deep/.el-tabs__item.is-active {
font-weight: 700;
}
/deep/.el-tabs__item.is-disabled{
cursor: not-allowed;
}
/deep/.el-pager {
line-height: 28px;
}
.content-box {
display: flex;
flex-wrap: wrap;
gap: 16px;
margin-top: 5px;
.item{
width: calc(33.33% - 16px);
}
}
.nothing {
display: flex;
flex-direction: column;
padding: 4px 0;
justify-content: center;
align-items: center;
color: #909399;
font-size: 14px;
img {
margin-bottom: 12px;
width: 64px;
height: 40px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div
@click="chooseRed(data.id,data.activityName)"
:class="['item',{'disabled':disabled},{'active':configForm.rewardId == data.id}]"
>
<div class="radio">
<img src="@/assets/red-radio.png" />
</div>
<div class="icon">
<img src="@/assets/activity-1.png" />
</div>
<div class="title">{{ data.activityName }}</div>
<div class="type">活动形式:{{ {0: '随机红包', 1: '九宫格', 2: '翻牌', 3: '大转盘' }[data.activityType] }}</div>
<div class="time">活动时间:{{dayjs(data.activityStartTime).format('YYYY/MM/DD')}}-{{dayjs(data.activityEndTime).format('YYYY/MM/DD')}}</div>
<div class="status">状态:{{ {0: '活动待进行', 1: '活动进行中', 2: '红包已用完', 3: '活动已结束' }[data.activityStatus] }}</div>
</div>
</template>
<script type='text/ecmascript-6'>
import * as dayjs from 'dayjs'
export default {
name: '',
props: {
data: {
type: Object,
default: () => { }
},
configForm: {
type: Object,
default: () => { }
},
disabled: Boolean
},
data () {
return {
dayjs,
}
},
mounted () {
},
methods: {
chooseRed (rewardId, rewardName) {
const { disabled } = this
if (disabled) return
this.$emit('choose', {
rewardId,
rewardName
})
}
}
}
</script>
<style scoped lang='scss'>
.item {
width: 100%;
height: 96px;
background: #fff;
border-radius: 4px;
box-sizing: border-box;
cursor: pointer;
padding: 0 16px;
font-size: 12px;
color: #999999;
line-height: 17px;
position: relative;
user-select: none;
.radio {
display: none;
}
.icon {
position: absolute;
right: 0;
bottom: 0;
width: 28px;
height: 28px;
}
.title {
font-weight: 500;
font-size: 14px;
color: #333333;
padding: 10px 0 7px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&:hover {
opacity: 0.95;
}
}
.active {
border-color: #5850ff;
.radio {
display: block;
position: absolute;
right: 0;
top: 0;
width: 16px;
height: 16px;
background-color: #5850ff;
border-radius: 0 0 0 4px;
overflow: hidden;
}
&::after {
content: '';
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
border: 1px solid #5850ff;
box-sizing: border-box;
}
}
.disabled {
cursor: not-allowed;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="layout">
<div class="fixed-content">
<template v-for="(i,index) in fixedForm">
<template>
<div
:key="index"
class="item flex"
>
<div class="label">{{i.label}}:</div>
<div class="value">
<template v-if="i.formatter">
{{i.formatter(data)}}
</template>
<template v-else>
{{ data[i.key] || '--'}}
</template>
</div>
</div>
</template>
</template>
</div>
<div class="container">
<div class="sticky">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="sticky-btns">
<div class="btns">
<el-button
type="default"
@click="handleExport"
>导出</el-button>
</div>
</div>
</div>
<div class="tabelList">
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
>
<template
slot="claimState"
slot-scope="scope"
>
<div :class="`status status-${scope.scope.claimState}`">
{{{
'0':'未领取',
'1':'已领取'
}[scope.scope.claimState]}}
</div>
</template>
</GLTable>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
import util from '@/utils/util'
import * as dayjs from 'dayjs'
const solitaireTableColumns = [
{
label: '手机号码',
prop: 'phone',
minWidth: 120
},
{
label: '用户名称',
prop: 'name',
minWidth: 100
},
{
label: '接龙数字',
prop: 'relayContent',
minWidth: 100
},
{
label: '接龙时间',
minWidth: 100,
formatter (cell) {
return dayjs(cell.relayTime).format('YYYY/MM/DD HH:mm:ss')
}
},
], winningTableColumns = [
{
label: '手机号码',
prop: 'phone',
minWidth: 120
},
{
label: '用户名称',
prop: 'name',
minWidth: 100
},
{
label: '接龙数字',
prop: 'relayContent',
minWidth: 100
},
{
label: '接龙时间',
minWidth: 100,
formatter (cell) {
return dayjs(cell.relayTime).format('YYYY/MM/DD HH:mm:ss')
}
},
{
label: '状态',
minWidth: 100,
addHtml: 'claimState'
},
]
export default {
name: 'detail',
data () {
return {
url,
data: {},
tableSearchForm: {},
fixedForm: [
{
label: '卡片标题',
key: 'title'
},
{
label: '创建时间',
formatter (cell) {
return dayjs(cell.createdTime).format('YYYY/MM/DD HH:mm:ss')
}
},
{
label: '开奖时间',
formatter (cell) {
return dayjs(cell.lotteryTime).format('YYYY/MM/DD HH:mm:ss')
}
},
{
label: '中奖数字',
formatter (cell) {
return cell.numType == 1 ? `随机(${cell.numWin || '--'})` : cell.numWin || '--'
}
},
{
label: '关联奖品',
formatter: cell => {
return `${{
1: '红包活动',
2: '优惠券',
3: '权益卡券'
}[cell.rewardType]}-${cell.rewardName}`
}
},
{
label: '所属渠道',
key: 'merchantName'
},
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
searchForm: {
phone: '',
name: '',
activityTime: ''
},
searchFormData: [
{
label: '手机号码',
name: 'phone',
type: 'input',
maxlength: 11
},
{
label: '用户名称',
name: 'name',
type: 'input',
maxlength: 100
},
{
label: '接龙时间',
name: 'activityTime',
type: 'datePicker',
isClear: true,
valueFormat: 'yyyy-MM-dd',
customPickerOptions: {
disabledDate (date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
return date > yesterday
}
}
},
],
getListApi: this.$apis.solitaire.getSolitaireAewardList,
tableParams: {
listName: 'list',
tableColumns: this.$route.query.type ? winningTableColumns : solitaireTableColumns
},
}
},
mounted () {
this.getSolitaireDetail()
},
methods: {
async getSolitaireDetail () {
try {
const { relayLotteryId } = this.$route.query,
data = await this.$apis.solitaire.getSolitaireDetail({ relayLotteryId })
this.data = data
this.$loading().close()
} catch (error) {
this.$loading().close()
}
},
getParams () {
let params = JSON.parse(JSON.stringify(this.searchForm))
if (params.activityTime) {
params.startRelayTime = dayjs(params.activityTime[0]).format('YYYY-MM-DD') + ' 00:00:00'
params.endRelayTime = dayjs(params.activityTime[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
delete params.activityTime
if (this.$route.query.type) params.winState = 2//中奖明细
params.relayLotteryId = this.$route.query.relayLotteryId
return params
},
beforeSearchFn () {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
handleSearch () {
this.$refs.listRef.refreshTable()
},
handleReset () {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
},
handleExport () {
const target = this.$route.query.type ? 'exportSolitaireAewardList' : 'exportSolitaireUserList'
this.$apis.solitaire[target]({ ...this.getParams(), ...this.$refs.listRef.page }).then(res => {
exportFn(res)
})
},
download (url) {
util.downloadIamge(url)
},
}
}
</script>
<style scoped lang='scss'>
.layout {
height: calc(100vh - 80px);
.fixed-content {
height: 100px;
background: #ffffff;
margin-bottom: 16px;
display: grid;
grid-template-columns: repeat(3, 1fr);
font-size: 14px;
color: #666666;
.item {
line-height: 20px;
.label {
width: 154px;
text-align: right;
flex-shrink: 0;
}
.value {
color: #333333;
}
}
}
.container {
height: calc(100% - 116px);
background-color: #fff;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 20px;
overflow-y: scroll;
.sticky {
position: relative;
z-index: 2;
/deep/.el-tag--info {
max-width: 50%;
}
&-btns {
position: absolute;
right: 0;
bottom: 10px;
overflow: hidden;
.el-button + .el-button {
margin-left: 8px;
}
.btns {
transition: all 0.25s;
.el-button {
padding: 8px 15px;
min-width: 60px;
}
}
}
}
.qr {
width: 36px;
height: 36px;
img {
width: 100%;
height: 100%;
vertical-align: top;
}
}
}
}
.img-plus {
width: 200px;
height: 200px;
}
.download-img {
cursor: pointer;
margin-top: 10px;
font-size: 14px;
font-weight: 600;
color: #5850ff;
line-height: 20px;
text-align: center;
}
.status {
display: flex;
align-items: center;
&::before {
content: '';
width: 8px;
height: 8px;
border-radius: 100%;
margin-right: 8px;
background: #999999;
}
}
.status-0 {
&::before {
background: #f8b757;
}
}
.status-1 {
&::before {
background: #4aca74;
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -14,7 +14,7 @@ const resolve = dir => path.join(__dirname, dir) ...@@ -14,7 +14,7 @@ const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://img02.glsx.com.cn/' const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = { const cdn = {
css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`], 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 = { module.exports = {
outputDir: `dist`, outputDir: `dist`,
...@@ -41,7 +41,8 @@ module.exports = { ...@@ -41,7 +41,8 @@ module.exports = {
'vue-router': 'VueRouter', 'vue-router': 'VueRouter',
vuex: 'Vuex', vuex: 'Vuex',
axios: 'axios', axios: 'axios',
echarts: 'echarts' echarts: 'echarts',
AMap: 'AMap'
} }
}, },
devServer: { devServer: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!