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,99 +29,89 @@ Vue.use(GLTableButton) ...@@ -29,99 +29,89 @@ 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, Vue.prototype.$history = history
request, Vue.prototype.$messenger = messenger
request2, Vue.prototype.$globalState = globalState
sign, Vue.prototype.$common = common
secret, Vue.prototype.$message = message
sign_common, Vue.prototype.$messageBox = messageBox
request_common, Vue.prototype.$hmdMerchantId = merchantId
request_merchant, // 集团版集团账号
merchantId Vue.prototype.$isGroupUp = globalState.session.accountLevel != 4
} = await fetchConfig(false) Vue.prototype.$http = new common.Http({
Vue.prototype.$history = history response,
Vue.prototype.$messenger = messenger request,
Vue.prototype.$globalState = globalState sign,
Vue.prototype.$common = common secret,
Vue.prototype.$message = message alert: message.error,
Vue.prototype.$messageBox = messageBox headers: { token: globalState.session.token }
Vue.prototype.$hmdMerchantId = merchantId })
// 集团版集团账号 Vue.prototype.$http_upload = new common.Http({
Vue.prototype.$isGroupUp = globalState.session.accountLevel != 4 response: { ...response, data_key: 'result', code_success_value: true, code_key: 'success' },
Vue.prototype.$http = new common.Http({ request,
response, sign,
request, secret,
sign, alert: message.error,
secret, headers: { token: globalState.session.token, 'Content-Type': 'multipart/form-data' }
alert: message.error, })
headers: {token: globalState.session.token} Vue.prototype.$http2 = new common.Http({
}) response,
Vue.prototype.$http_upload = new common.Http({ request: request2,
response: {...response, data_key: 'result', code_success_value: true, code_key: 'success'}, sign,
request, secret,
sign, alert: message.error,
secret, headers: { token: globalState.session.token }
alert: message.error, })
headers: {token: globalState.session.token, 'Content-Type': 'multipart/form-data'} Vue.prototype.$http_merchant = new common.Http({
}) response,
Vue.prototype.$http2 = new common.Http({ request: request_merchant,
response, sign,
request: request2, secret,
sign, alert: message.error,
secret, headers: { token: globalState.session.token }
alert: message.error, })
headers: {token: globalState.session.token} Vue.prototype.$http_common = new common.Http({
}) response,
Vue.prototype.$http_merchant = new common.Http({ signWay: 'md5',
response, request: request_common,
request: request_merchant, sign: sign_common,
sign, secret,
secret, alert: ElementUI.Message.error,
alert: message.error, headers: { TGT: globalState.session.token }
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.$http_common = new common.Http({ Vue.prototype.$tracker = common.tracker
response, // const myToken = 'scrm-base-107ee03c-1214-48c3-a443-a2332e553b2f-rop'
signWay: 'md5', // Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: myToken } })
request: request_common, // Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: myToken } })
sign: sign_common, // Vue.prototype.$http_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: message.error, headers: { token: myToken } })
secret, // Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: myToken } })
alert: ElementUI.Message.error, // Vue.prototype.$http_xiaolong = new common.Http({ response, request: xiaolong_req, sign, secret, alert: message.error, headers: { token: myToken } })
headers: {TGT: globalState.session.token} // Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
}) // Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
// Vue.prototype.$http_xiaolong = new common.Http({ response, request: xiaolong_req, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) const routesData = common.utils.deepClone(globalState.routers)
Vue.prototype.$tracker = common.tracker routes = getRoutes(routesData)
// const myToken = 'scrm-base-107ee03c-1214-48c3-a443-a2332e553b2f-rop' subscribe({ messenger })
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: myToken } }) Vue.use(GLButton, { routes, routerBase })
// Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: myToken } })
// Vue.prototype.$http_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: message.error, headers: { token: myToken } })
// Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: myToken } })
// Vue.prototype.$http_xiaolong = new common.Http({ response, request: xiaolong_req, sign, secret, alert: message.error, headers: { token: myToken } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
// 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)
routes = getRoutes(routesData)
subscribe({messenger})
Vue.use(GLButton, {routes, routerBase})
} }
export async function mount(props) { export async function mount(props) {
const insts = render(props.routerBase, routes) const insts = render(props.routerBase, routes)
router = insts.router router = insts.router
instance = insts.vm instance = insts.vm
} }
export async function unmount() { export async function unmount() {
instance.$destroy() instance.$destroy()
instance.$el.innerHTML = '' instance.$el.innerHTML = ''
instance = null instance = null
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>
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!