Commit dc6c6014 by 前端

Merge branch 'v3.16.0' into 'master'

V3.16.0

See merge request !537
2 parents f233bcf5 7448ddf5
...@@ -8,11 +8,12 @@ ...@@ -8,11 +8,12 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"axios": "^1.4.0",
"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",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-components": "^1.5.3", "glsx-components": "^1.5.7",
"glsx-components_beta": "^1.0.4", "glsx-components_beta": "^1.0.4",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"node-sass": "^4.0.0", "node-sass": "^4.0.0",
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
"vuedraggable": "^2.24.3", "vuedraggable": "^2.24.3",
"vuex": "^3.1.2", "vuex": "^3.1.2",
"wangeditor": "^4.7.12", "wangeditor": "^4.7.12",
"word-edit": "^1.2.5" "word-edit": "^1.2.7"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0", "@vue/cli-plugin-babel": "^4.1.0",
...@@ -36,7 +37,7 @@ ...@@ -36,7 +37,7 @@
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1", "eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
"glsx-common": "^1.4.9", "glsx-common": "^2.1.0",
"node-sass": "^4.12.0", "node-sass": "^4.12.0",
"prettier": "^1.19.1", "prettier": "^1.19.1",
"sass-loader": "^8.0.0", "sass-loader": "^8.0.0",
......
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-08-21 11:35:26
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-08-22 15:45:33
* @FilePath: \scrm-micro-marketing\src\api\glsxUpload.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import TcVod from 'vod-js-sdk-v6'
import { http } from '@/main'
// 请求配置
const SIGN = {
v: '1.0.0',
source: 'scm-home',
format: 'json',
appKey: '48e5e13229b82c1b4e6e8c96151f0637'
}
const SECRET = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const REQUEST = {
timeout: 180000,
responseType: 'json',
baseURL: 'http://scrm.dev.glsx.com.cn',
withCredentials: true
}
// const RESPONSE = {
// code_key: ['code', 'returnCode'],
// code_message_map: {},
// code_success_value: '0',
// data_key: 'data',
// errId_logout_value: '21',
// message_key: 'message'
// }
class GlsxUpload {
constructor(params) {
this.initParam = params
}
init() {
return new Promise((resolve, reject) => {
if (this.tcVod) return resolve({ status: 0, msg: 'init successful' })
const { params: { data, url } = {} } = this.initParam || {}
console.log(data)
return http({
data,
url: url,
returnAll: true
})
.then(res => {
if (res.code == '0') {
this.tcVod = new TcVod({
getSignature: () => {
return res.data
}
})
}
if (this.tcVod) return resolve({ status: 0, msg: 'init successful' })
reject({ status: -1, msg: 'init failed' })
})
.catch(err => {
reject({ status: -1, msg: 'init failed' })
})
})
}
uploaded(file, img) {
return new Promise((resolve, reject) => {
if (!file) return reject({ status: -1, msg: 'file is required' })
let params = {
mediaFile: file
}
if (img) params.coverFile = img
this.uploader = this.tcVod.upload(params)
this.uploader
.done()
.then(doneResult => {
resolve(doneResult)
})
.catch(err => {
reject(err)
})
})
}
uploadEvent(eventType, callback) {
if (!eventType) callback({ status: -1, msg: 'eventType is required' })
try {
this.uploader.on(eventType, info => {
callback(info)
})
} catch (err) {
callback(err)
}
}
uploadCancel() {
this.uploader.cancel()
}
}
export default GlsxUpload
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-08-21 11:35:02
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-08-21 11:37:50
* @FilePath: \scrm-micro-marketing\src\api\modules\uploadApi.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import GlsxUpload from './glsxUpload'
const upload = new GlsxUpload({
params: {
data: { method: 'scrm.api.shopmall.tencentcloudmedia.uploadsignature' },
url: 'rop-scrm-shopmall/router'
}
})
export default upload
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-10-19 18:34:08
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-08-31 15:25:35
* @FilePath: \scrm-micro-marketing\src\config\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV // 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js') // let request = require('@/http/request.js')
let cfg = require('./conf.js') let cfg = require('./conf.js')
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2022-11-24 14:42:00 * @Date: 2022-11-24 14:42:00
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-24 17:18:31 * @LastEditTime: 2023-08-28 11:12:22
* @FilePath: \live\src\mixins\upload.js * @FilePath: \live\src\mixins\upload.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
return {} return {}
}, },
methods: { methods: {
getImgUrl(url, multiple = 3) { getImgUrl(url, multiple = 0.5) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
var canvas = document.createElement('canvas') // 获取 canvas 对象 var canvas = document.createElement('canvas') // 获取 canvas 对象
const ctx = canvas.getContext('2d') // 绘制2d const ctx = canvas.getContext('2d') // 绘制2d
...@@ -20,10 +20,10 @@ export default { ...@@ -20,10 +20,10 @@ export default {
video.crossOrigin = 'anonymous' // 解决跨域问题,也就是提示污染资源无法转换视频 video.crossOrigin = 'anonymous' // 解决跨域问题,也就是提示污染资源无法转换视频
video.currentTime = 1 // 第一帧 video.currentTime = 1 // 第一帧
video.oncanplay = async () => { video.oncanplay = async () => {
canvas.width = video.clientWidth * multiple // 获取视频宽度 canvas.width = video.videoWidth * multiple // 获取视频宽度
canvas.height = video.clientHeight * multiple // 获取视频高度 canvas.height = video.videoHeight * multiple // 获取视频高度
// 利用canvas对象方法绘图 // 利用canvas对象方法绘图
ctx.drawImage(video, 0, 0, video.clientWidth * multiple, video.clientHeight * multiple) ctx.drawImage(video, 0, 0, video.videoWidth * multiple, video.videoHeight * multiple)
console.log(canvas, 'canvas') console.log(canvas, 'canvas')
// 转换成base64形式 // 转换成base64形式
var oGrayImg = canvas.toDataURL('image/png') // 截取后的视频封面 var oGrayImg = canvas.toDataURL('image/png') // 截取后的视频封面
......
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
* @Description: * @Description:
* @Author: huyue * @Author: huyue
* @Date: 2022-01-20 18:06:46 * @Date: 2022-01-20 18:06:46
* @LastEditors: huyue * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-07-12 14:14:15 * @LastEditTime: 2023-08-29 09:58:45
*/ */
import Vue from 'vue' import Vue from 'vue'
import {message, messageBox} from '@/plugins/element.js' import { message, messageBox } from '@/plugins/element.js'
import {fetchConfig} from '@/config' import { fetchConfig } from '@/config'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import {GLButton, GLTable, GLFooter, GLCombiForm, GLTableButton, GLDialog} from 'glsx-components' //权限按钮 (根据权限动态创建) import { GLButton, GLTable, GLFooter, GLCombiForm, GLTableButton, GLDialog } from 'glsx-components' //权限按钮 (根据权限动态创建)
import {GLEditor} from 'word-edit' import { GLEditor } from 'word-edit'
import {getRoutes} from '@/router' import { getRoutes } from '@/router'
import '@/assets/css/public.scss' import '@/assets/css/public.scss'
import render from './render' import render from './render'
// import 'glsx-components/src/theme/theme.scss' // import 'glsx-components/src/theme/theme.scss'
...@@ -29,18 +29,8 @@ Vue.use(GLTableButton) ...@@ -29,18 +29,8 @@ Vue.use(GLTableButton)
Vue.use(GLEditor) Vue.use(GLEditor)
Vue.use(GLDialog) Vue.use(GLDialog)
export async function bootstrap({history, common, messenger, globalState, routerBase}) { export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { const { response, request, request2, sign, secret, sign_common, request_common, request_merchant, merchantId } = await fetchConfig(false)
response,
request,
request2,
sign,
secret,
sign_common,
request_common,
request_merchant,
merchantId
} = await fetchConfig(false)
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
...@@ -56,15 +46,15 @@ export async function bootstrap({history, common, messenger, globalState, router ...@@ -56,15 +46,15 @@ export async function bootstrap({history, common, messenger, globalState, router
sign, sign,
secret, secret,
alert: message.error, alert: message.error,
headers: {token: globalState.session.token} headers: { token: globalState.session.token }
}) })
Vue.prototype.$http_upload = new common.Http({ Vue.prototype.$http_upload = new common.Http({
response: {...response, data_key: 'result', code_success_value: true, code_key: 'success'}, response: { ...response, data_key: 'result', code_success_value: true, code_key: 'success' },
request, request,
sign, sign,
secret, secret,
alert: message.error, alert: message.error,
headers: {token: globalState.session.token, 'Content-Type': 'multipart/form-data'} headers: { token: globalState.session.token, 'Content-Type': 'multipart/form-data' }
}) })
Vue.prototype.$http2 = new common.Http({ Vue.prototype.$http2 = new common.Http({
response, response,
...@@ -72,7 +62,7 @@ export async function bootstrap({history, common, messenger, globalState, router ...@@ -72,7 +62,7 @@ export async function bootstrap({history, common, messenger, globalState, router
sign, sign,
secret, secret,
alert: message.error, alert: message.error,
headers: {token: globalState.session.token} headers: { token: globalState.session.token }
}) })
Vue.prototype.$http_merchant = new common.Http({ Vue.prototype.$http_merchant = new common.Http({
response, response,
...@@ -80,7 +70,7 @@ export async function bootstrap({history, common, messenger, globalState, router ...@@ -80,7 +70,7 @@ export async function bootstrap({history, common, messenger, globalState, router
sign, sign,
secret, secret,
alert: message.error, alert: message.error,
headers: {token: globalState.session.token} headers: { token: globalState.session.token }
}) })
Vue.prototype.$http_common = new common.Http({ Vue.prototype.$http_common = new common.Http({
response, response,
...@@ -89,7 +79,7 @@ export async function bootstrap({history, common, messenger, globalState, router ...@@ -89,7 +79,7 @@ export async function bootstrap({history, common, messenger, globalState, router
sign: sign_common, sign: sign_common,
secret, secret,
alert: ElementUI.Message.error, alert: ElementUI.Message.error,
headers: {TGT: globalState.session.token} headers: { TGT: globalState.session.token }
}) })
// Vue.prototype.$http_xiaolong = new common.Http({ response, request: xiaolong_req, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) // Vue.prototype.$http_xiaolong = new common.Http({ response, request: xiaolong_req, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$tracker = common.tracker Vue.prototype.$tracker = common.tracker
...@@ -103,8 +93,8 @@ export async function bootstrap({history, common, messenger, globalState, router ...@@ -103,8 +93,8 @@ export async function bootstrap({history, common, messenger, globalState, router
// Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] }) // Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
const routesData = common.utils.deepClone(globalState.routers) const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData) routes = getRoutes(routesData)
subscribe({messenger}) subscribe({ messenger })
Vue.use(GLButton, {routes, routerBase}) Vue.use(GLButton, { routes, routerBase })
} }
export async function mount(props) { export async function mount(props) {
...@@ -120,7 +110,7 @@ export async function unmount() { ...@@ -120,7 +110,7 @@ export async function unmount() {
router = null router = null
} }
function subscribe({messenger}) { function subscribe({ messenger }) {
messenger.subscribe(v => { messenger.subscribe(v => {
console.log(`监听到子应用${v.from}发来消息:`, v) console.log(`监听到子应用${v.from}发来消息:`, v)
}) })
......
.inline-b { .inline-b {
display: inline-block; display: inline-block;
} }
...@@ -10,23 +9,29 @@ ...@@ -10,23 +9,29 @@
.green-text { .green-text {
color: #00A854; color: #00A854;
} }
.gray-text{
color:#666666; .gray-text {
margin-left:6px; color: #666666;
margin-left: 6px;
} }
.red-text { .red-text {
color: rgb(255, 0, 0); color: rgb(255, 0, 0);
} }
.blue-text{
color:$btnBlue; .blue-text {
&:hover{ color: $btnBlue;
&:hover {
color: #9994FF; color: #9994FF;
cursor: pointer; cursor: pointer;
} }
} }
.pure-blue-text{
color:$btnBlue!important; .pure-blue-text {
color: $btnBlue !important;
} }
.green { .green {
background-color: #00A854; background-color: #00A854;
} }
...@@ -35,12 +40,13 @@ ...@@ -35,12 +40,13 @@
color: rgb(255, 0, 0); color: rgb(255, 0, 0);
} }
.flex-center{ .flex-center {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.additional-text{
.additional-text {
height: 22px; height: 22px;
font-size: 16px; font-size: 16px;
...@@ -48,6 +54,7 @@ ...@@ -48,6 +54,7 @@
color: #666666; color: #666666;
line-height: 22px; line-height: 22px;
} }
.btn-blue { .btn-blue {
height: 32px; height: 32px;
background: $btnBlue; background: $btnBlue;
...@@ -92,7 +99,8 @@ ...@@ -92,7 +99,8 @@
background: -moz-linear-gradient(left, transparent, #fff 55%); background: -moz-linear-gradient(left, transparent, #fff 55%);
background: linear-gradient(to right, transparent, #fff 55%); background: linear-gradient(to right, transparent, #fff 55%);
} }
.ellipsis-4{
.ellipsis-4 {
overflow: hidden; overflow: hidden;
height: 40px; height: 40px;
line-height: 20px; line-height: 20px;
...@@ -101,6 +109,7 @@ ...@@ -101,6 +109,7 @@
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 4; -webkit-line-clamp: 4;
} }
.ellipsis-4-text:after { .ellipsis-4-text:after {
content: "..."; content: "...";
position: absolute; position: absolute;
...@@ -113,6 +122,16 @@ ...@@ -113,6 +122,16 @@
background: -moz-linear-gradient(left, transparent, #fff 55%); background: -moz-linear-gradient(left, transparent, #fff 55%);
background: linear-gradient(to right, transparent, #fff 55%); background: linear-gradient(to right, transparent, #fff 55%);
} }
.statusText { .statusText {
vertical-align: middle; vertical-align: middle;
} }
.switch-tip {
height: 17px;
line-height: 17px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 12px;
color: #999999;
}
\ No newline at end of file \ No newline at end of file
...@@ -138,6 +138,10 @@ ...@@ -138,6 +138,10 @@
<template slot="useDescriptionHtml"> <template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" /> <el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
</template> </template>
<template slot="couponCenterHtml">
<el-switch :disabled="apear != 'couponAdd'" v-model="editForm.couponCenterFlag" :active-value="2" :inactive-value="1"></el-switch>
<div class="switch-tip">开启后,用户可在小程序我的-优惠券-领券中心直接领取</div>
</template>
<template slot="editHtml"> <template slot="editHtml">
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button> <el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template> </template>
...@@ -202,7 +206,8 @@ export default { ...@@ -202,7 +206,8 @@ export default {
full: '', full: '',
goods: '1', goods: '1',
goodsRefList: [], goodsRefList: [],
directionalFlag: '1' directionalFlag: '1',
couponCenterFlag: 1
// scopeApplication: '' // scopeApplication: ''
}, },
//商品列表 //商品列表
...@@ -320,6 +325,10 @@ export default { ...@@ -320,6 +325,10 @@ export default {
addHtml: 'useDescriptionHtml' addHtml: 'useDescriptionHtml'
}, },
{ {
label: '领券中心可见',
addHtml: 'couponCenterHtml'
},
{
name: 'editHtml', name: 'editHtml',
addHtml: 'editHtml', addHtml: 'editHtml',
isHide: true isHide: true
...@@ -766,6 +775,8 @@ export default { ...@@ -766,6 +775,8 @@ export default {
} }
//使用描述 //使用描述
obj.useDescription = form.useDescription obj.useDescription = form.useDescription
//领券中心可见
obj.couponCenterFlag = form.couponCenterFlag
//预估成本 //预估成本
obj.anticipatedCost = (form.anticipatedCost * 100).toFixed(0) obj.anticipatedCost = (form.anticipatedCost * 100).toFixed(0)
return obj return obj
......
...@@ -107,6 +107,10 @@ ...@@ -107,6 +107,10 @@
<template slot="useDescriptionHtml"> <template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" /> <el-input type="textarea" v-model="editForm.useDescription" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
</template> </template>
<template slot="couponCenterHtml">
<el-switch :disabled="apear != 'couponAdd'" v-model="editForm.couponCenterFlag" :active-value="2" :inactive-value="1"></el-switch>
<div class="switch-tip">开启后,用户可在小程序我的-优惠券-领券中心直接领取</div>
</template>
<template slot="editHtml"> <template slot="editHtml">
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button> <el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template> </template>
...@@ -178,7 +182,8 @@ export default { ...@@ -178,7 +182,8 @@ export default {
effectiveDays: '', effectiveDays: '',
anticipatedCost: '', anticipatedCost: '',
discountIntensity: '', discountIntensity: '',
directionalFlag: '1' directionalFlag: '1',
couponCenterFlag: 1
// scopeApplication: '' // scopeApplication: ''
}, },
editRule: { editRule: {
...@@ -243,6 +248,10 @@ export default { ...@@ -243,6 +248,10 @@ export default {
addHtml: 'useDescriptionHtml' addHtml: 'useDescriptionHtml'
}, },
{ {
label: '领券中心可见',
addHtml: 'couponCenterHtml'
},
{
name: '', name: '',
addHtml: 'editHtml', addHtml: 'editHtml',
isHide: true isHide: true
...@@ -514,6 +523,8 @@ export default { ...@@ -514,6 +523,8 @@ export default {
obj.useDescription = form.useDescription obj.useDescription = form.useDescription
//是否定制礼包专用 //是否定制礼包专用
obj.directionalFlag = form.directionalFlag obj.directionalFlag = form.directionalFlag
//领券中心可见
obj.couponCenterFlag = form.couponCenterFlag
//预估成本 //预估成本
obj.anticipatedCost = (form.anticipatedCost * 100).toFixed(0) obj.anticipatedCost = (form.anticipatedCost * 100).toFixed(0)
return obj return obj
......
...@@ -95,6 +95,10 @@ ...@@ -95,6 +95,10 @@
<template slot="useDescriptionHtml"> <template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" /> <el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
</template> </template>
<template slot="couponCenterHtml">
<el-switch :disabled="apear != 'couponAdd'" v-model="editForm.couponCenterFlag" :active-value="2" :inactive-value="1"></el-switch>
<div class="switch-tip">开启后,用户可在小程序我的-优惠券-领券中心直接领取</div>
</template>
<template slot="editHtml"> <template slot="editHtml">
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button> <el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template> </template>
...@@ -163,7 +167,8 @@ export default { ...@@ -163,7 +167,8 @@ export default {
effectiveTime: [], effectiveTime: [],
effectiveDays: '', effectiveDays: '',
anticipatedCost: '', anticipatedCost: '',
directionalFlag: '1' directionalFlag: '1',
couponCenterFlag: 1
// scopeApplication: '' // scopeApplication: ''
}, },
editRule: { editRule: {
...@@ -214,6 +219,10 @@ export default { ...@@ -214,6 +219,10 @@ export default {
addHtml: 'useDescriptionHtml' addHtml: 'useDescriptionHtml'
}, },
{ {
label: '领券中心可见',
addHtml: 'couponCenterHtml'
},
{
name: '', name: '',
addHtml: 'editHtml', addHtml: 'editHtml',
isHide: true isHide: true
...@@ -443,6 +452,8 @@ export default { ...@@ -443,6 +452,8 @@ export default {
obj.useDescription = form.useDescription obj.useDescription = form.useDescription
//是否定制礼包专用 //是否定制礼包专用
obj.directionalFlag = form.directionalFlag obj.directionalFlag = form.directionalFlag
//
obj.couponCenterFlag = form.couponCenterFlag
//预估成本 //预估成本
obj.anticipatedCost = (form.anticipatedCost * 100).toFixed(0) obj.anticipatedCost = (form.anticipatedCost * 100).toFixed(0)
return obj return obj
......
...@@ -97,6 +97,10 @@ ...@@ -97,6 +97,10 @@
<el-form-item size="small" label="使用说明:" prop="useDescription"> <el-form-item size="small" label="使用说明:" prop="useDescription">
<el-input size="small" :rows="6" :disabled="disabledDescription" type="textarea" v-model="ruleForm.useDescription" placeholder="请输入" maxlength="200" show-word-limit></el-input> <el-input size="small" :rows="6" :disabled="disabledDescription" type="textarea" v-model="ruleForm.useDescription" placeholder="请输入" maxlength="200" show-word-limit></el-input>
</el-form-item> </el-form-item>
<el-form-item size="small" label="领券中心可见:" prop="couponCenterFlag">
<el-switch :disabled="disabledContent" v-model="ruleForm.couponCenterFlag" :active-value="2" :inactive-value="1"></el-switch>
<div class="switch-tip">开启后,用户可在小程序我的-优惠券-领券中心直接领取</div>
</el-form-item>
<el-form-item size="small" style="margin-left: -100px" v-show="isEdit"> <el-form-item size="small" style="margin-left: -100px" v-show="isEdit">
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button> <el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</el-form-item> </el-form-item>
...@@ -248,7 +252,8 @@ export default { ...@@ -248,7 +252,8 @@ export default {
stock: '', stock: '',
useDescription: '', useDescription: '',
daterange: [], daterange: [],
limitStockFlag: 1 limitStockFlag: 1,
couponCenterFlag: 1
// scopeApplication: '' // scopeApplication: ''
}, },
copyRuleForm: {}, copyRuleForm: {},
...@@ -500,6 +505,7 @@ export default { ...@@ -500,6 +505,7 @@ export default {
// params.scopeApplication = this.ruleForm.scopeApplication // params.scopeApplication = this.ruleForm.scopeApplication
// } // }
params.useDescription = this.ruleForm.useDescription params.useDescription = this.ruleForm.useDescription
params.couponCenterFlag = this.ruleForm.couponCenterFlag
params.discountType = 7 params.discountType = 7
params.merchantId = this.merchantId params.merchantId = this.merchantId
...@@ -531,6 +537,7 @@ export default { ...@@ -531,6 +537,7 @@ export default {
param.couponId = this.$route.query.couponId param.couponId = this.$route.query.couponId
param.stock = this.ruleForm.stock param.stock = this.ruleForm.stock
param.useDescription = this.ruleForm.useDescription param.useDescription = this.ruleForm.useDescription
param.couponCenterFlag = this.ruleForm.couponCenterFlag
this.sloading = true this.sloading = true
updateService(param) updateService(param)
.then(res => { .then(res => {
......
<template>
<div class="material-view">
<div class="material-view-container">
<el-carousel :height="height + 'px'" interval="100000" @change="handleChange" v-if="fileList.length">
<el-carousel-item v-for="item in fileList" :key="item">
<div class="carousel-item">
<img :src="item.url" class="carousel-img" />
<img src="@/assets/material/videoIcon.png" class="play" v-if="item.type == 'video'" />
</div>
</el-carousel-item>
</el-carousel>
<div class="material-text" v-html="textBoxContent"></div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
height: 200,
fileList: []
}
},
watch: {
materialAddForm: {
async handler(val) {
const fileList = (val.imageUrlList || []).map(item => {
return {
type: 'img',
url: item
}
})
this.fileList = val.videoUrl ? fileList.concat({ url: val.coverUrl, type: 'video' }) : fileList
if (this.fileList.length) {
for (let val of this.fileList) {
this.$set(val, 'height', await this.getHeight(val.url))
}
this.height = this.fileList[0].height
}
},
deep: true,
immediate: true
}
},
props: {
materialAddForm: {
type: Object,
default: () => {}
},
textBoxContent: {
type: String
}
},
methods: {
//获取图片高度
getHeight(url) {
return new Promise(resolve => {
const img = new Image()
img.src = url
img.onload = res => {
resolve((img.height / img.width) * 250)
}
})
},
handleChange(e) {
this.height = this.fileList[e].height
}
}
}
</script>
<style lang="scss" scoped>
.material-view {
width: 289.47px;
height: 566px;
background: url('../../../assets/phone.png');
background-size: 100% 100%;
position: relative;
overflow: hidden;
.material-view-container {
position: absolute;
top: 56px;
left: 20px;
width: calc(100% - 40px);
height: calc(100% - 112px);
overflow-y: auto;
/deep/ .el-carousel__button {
width: 8px;
}
.carousel-item {
position: relative;
height: 100%;
width: 100%;
.carousel-img {
width: 100%;
height: 100%;
}
.play {
position: absolute;
width: 30px;
height: 30px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
.material-text {
word-wrap: break-word;
img {
width: 100% !important;
}
}
}
}
</style>
<style>
.material-text img {
width: 100% !important;
}
</style>
...@@ -15,24 +15,19 @@ ...@@ -15,24 +15,19 @@
</span> </span>
<div class="container"> <div class="container">
<div class="search-form"> <div class="search-form">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="materialFormData" <GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="materialFormData" @handleOk="getListApi" @handleRest="handleReset"></GLCombiForm>
@handleOk="getListApi" @handleRest="handleReset"></GLCombiForm>
</div> </div>
<div class="tabelList"> <div class="tabelList">
<el-row> <el-row>
<el-col :span="5"> <el-col :span="5">
<div class="left"> <div class="left">
<MaterialGroup ref="materialGroup" @openAddDialog="addDialogShow" :groupHeight="boxHeight" <MaterialGroup ref="materialGroup" @openAddDialog="addDialogShow" :groupHeight="boxHeight" :eventBus="eventBus" @getList="getList" @getListApi="getListApi"></MaterialGroup>
:eventBus="eventBus" @getList="getList" @getListApi="getListApi"></MaterialGroup>
</div> </div>
</el-col> </el-col>
<el-col :span="19"> <el-col :span="19">
<div class="right" :style="{ height: boxHeight + 'px' }"> <div class="right" :style="{ height: boxHeight + 'px' }">
<div class="groupTitle">{{ materialGroupName }}(共{{ tableTotal }}条数据)</div> <div class="groupTitle">{{ materialGroupName }}(共{{ tableTotal }}条数据)</div>
<GLTable ref="materialRef" :hasPage="false" :noDataImg="url" @refreshTable="getListApi" :layout="layout" <GLTable ref="materialRef" :hasPage="false" :noDataImg="url" @refreshTable="getListApi" :layout="layout" :searchForm="searchForm" :tableParams="tableParams" :tableData="materialTableData" :pageConf="pageConf" :tableTotal="tableTotal" @sortChange="sortChange" :isCustomHead="true" :customHeadShowList="customHeadShowList">
:searchForm="searchForm" :tableParams="tableParams" :tableData="materialTableData"
:pageConf="pageConf" :tableTotal="tableTotal" @sortChange="sortChange" :isCustomHead="true"
:customHeadShowList="customHeadShowList">
<!-- 素材内容 --> <!-- 素材内容 -->
<div slot="materialContentRpcResponse" slot-scope="scope"> <div slot="materialContentRpcResponse" slot-scope="scope">
<span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span> <span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span>
...@@ -99,10 +94,8 @@ ...@@ -99,10 +94,8 @@
</el-row> </el-row>
</div> </div>
</div> </div>
<AddMaterialGroupDia :businessTypes="businessTypes" ref="addMaterialGroup" :dialogVisible="materialGroupDialog" <AddMaterialGroupDia :businessTypes="businessTypes" ref="addMaterialGroup" :dialogVisible="materialGroupDialog" :eventBus="eventBus"></AddMaterialGroupDia>
:eventBus="eventBus"></AddMaterialGroupDia> <FunctionIntroduc :introductionDialog="introductionDialog" @closeIntroductDia="closeIntroductDia"></FunctionIntroduc>
<FunctionIntroduc :introductionDialog="introductionDialog"
@closeIntroductDia="closeIntroductDia"></FunctionIntroduc>
<VideoShowDia ref="VideoShowDia" :dialogVisible="dialogVisibleImg"></VideoShowDia> <VideoShowDia ref="VideoShowDia" :dialogVisible="dialogVisibleImg"></VideoShowDia>
</div> </div>
</template> </template>
...@@ -140,9 +133,9 @@ export default { ...@@ -140,9 +133,9 @@ export default {
businessType: '', // 业务类型 businessType: '', // 业务类型
status: '', // 状态 status: '', // 状态
materialName: '', // 素材名称 materialName: '', // 素材名称
createdType:'2' createdType: '2'
}, },
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'}, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
layout: 'sizes, prev, pager, next, jumper, ->, total', layout: 'sizes, prev, pager, next, jumper, ->, total',
// 表格数据 // 表格数据
materialTableData: [], materialTableData: [],
...@@ -265,7 +258,7 @@ export default { ...@@ -265,7 +258,7 @@ export default {
fn: '编辑' fn: '编辑'
}, },
listeners: { listeners: {
click: row => row.createdType == 1 ? this.addMaterial(3, row) : this.addMaterial(2, row) click: row => (row.createdType == 1 ? this.addMaterial(3, row) : this.addMaterial(2, row))
} }
}, },
{ {
...@@ -323,7 +316,7 @@ export default { ...@@ -323,7 +316,7 @@ export default {
formatter: cellVal => { formatter: cellVal => {
return cellVal.sendNum return cellVal.sendNum
}, },
renderHeader: (h, {column, $index}) => { renderHeader: (h, { column, $index }) => {
return h( return h(
'div', 'div',
{ {
...@@ -371,7 +364,7 @@ export default { ...@@ -371,7 +364,7 @@ export default {
formatter: cellVal => { formatter: cellVal => {
return cellVal.readNum return cellVal.readNum
}, },
renderHeader: (h, {column, $index}) => { renderHeader: (h, { column, $index }) => {
return h( return h(
'div', 'div',
{ {
...@@ -459,7 +452,7 @@ export default { ...@@ -459,7 +452,7 @@ export default {
businessType: '', businessType: '',
status: '', status: '',
materialName: '', materialName: '',
createdType:'2' createdType: '2'
} }
this.getListApi() this.getListApi()
this.$refs.materialGroup.currentIndex = null this.$refs.materialGroup.currentIndex = null
...@@ -525,7 +518,7 @@ export default { ...@@ -525,7 +518,7 @@ export default {
}, },
// 素材删除 // 素材删除
handleDelete(scope) { handleDelete(scope) {
this.secondConfirm('提示', '删除素材,该素材将不再可以使用,是否继续删除?', 'material', 'materialDelete', {id: scope.id}) this.secondConfirm('提示', '删除素材,该素材将不再可以使用,是否继续删除?', 'material', 'materialDelete', { id: scope.id })
}, },
// 1-新增素材,2-编辑素材 // 1-新增素材,2-编辑素材
addMaterial(addOrEdit, scope) { addMaterial(addOrEdit, scope) {
...@@ -557,13 +550,13 @@ export default { ...@@ -557,13 +550,13 @@ export default {
let videoHtml = html.match(/<video.*?(?:>|\/>)/g) let videoHtml = html.match(/<video.*?(?:>|\/>)/g)
if (imgHtml) { if (imgHtml) {
let imgSrc = imgHtml[0].match('<img[^<>]*? src="([^<>]*?)"') let imgSrc = imgHtml[0].match('<img[^<>]*? src="([^<>]*?)"')
item.materialContentRpcResponse.materialUrl = imgSrc? imgSrc[1] :'' item.materialContentRpcResponse.materialUrl = imgSrc ? imgSrc[1] : ''
item.urlType = 'img' item.urlType = 'img'
item.imgCount = imgHtml.length item.imgCount = imgHtml.length
} }
if (videoHtml) { if (videoHtml) {
let videoSrc = videoHtml[0].match('<video[^<>]*? src="([^<>]*?)"') let videoSrc = videoHtml[0].match('<video[^<>]*? src="([^<>]*?)"')
item.materialContentRpcResponse.materialUrl = videoSrc ? videoSrc[1] :'' item.materialContentRpcResponse.materialUrl = videoSrc ? videoSrc[1] : ''
item.urlType = 'video' item.urlType = 'video'
} }
} }
......
File mode changed
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-10-19 18:34:08
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-08-22 13:52:11
* @FilePath: \scrm-micro-marketing\vue.config.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const path = require('path') const path = require('path')
const packageName = require('./package.json').name const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production' const node_env = process.env.NODE_ENV === 'production'
...@@ -32,7 +40,6 @@ module.exports = { ...@@ -32,7 +40,6 @@ module.exports = {
'element-ui': 'ELEMENT', 'element-ui': 'ELEMENT',
'vue-router': 'VueRouter', 'vue-router': 'VueRouter',
vuex: 'Vuex', vuex: 'Vuex',
axios: 'axios',
echarts: 'echarts', echarts: 'echarts',
moment: 'moment', moment: 'moment',
AMap: 'AMap' AMap: 'AMap'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!