Commit c50a6cb5 by zhouzy

增加功能

1 parent 26127cf2
...@@ -2192,6 +2192,11 @@ ...@@ -2192,6 +2192,11 @@
} }
} }
}, },
"base64-arraybuffer": {
"version": "0.2.0",
"resolved": "https://registry.nlark.com/base64-arraybuffer/download/base64-arraybuffer-0.2.0.tgz?cache=0&sync_timestamp=1628588917496&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fbase64-arraybuffer%2Fdownload%2Fbase64-arraybuffer-0.2.0.tgz",
"integrity": "sha1-S5RPrAGRqlkHr+LYyZnMxXzoD0U="
},
"base64-js": { "base64-js": {
"version": "1.3.0", "version": "1.3.0",
"resolved": "http://registry.npm.taobao.org/base64-js/download/base64-js-1.3.0.tgz", "resolved": "http://registry.npm.taobao.org/base64-js/download/base64-js-1.3.0.tgz",
...@@ -3408,6 +3413,14 @@ ...@@ -3408,6 +3413,14 @@
} }
} }
}, },
"css-line-break": {
"version": "2.0.1",
"resolved": "https://registry.nlark.com/css-line-break/download/css-line-break-2.0.1.tgz?cache=0&sync_timestamp=1628083455740&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcss-line-break%2Fdownload%2Fcss-line-break-2.0.1.tgz",
"integrity": "sha1-PcdMLtXrZCEUgCgZMkdXkCQ+czg=",
"requires": {
"base64-arraybuffer": "^0.2.0"
}
},
"css-loader": { "css-loader": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/css-loader/download/css-loader-1.0.0.tgz", "resolved": "http://registry.npm.taobao.org/css-loader/download/css-loader-1.0.0.tgz",
...@@ -5827,6 +5840,15 @@ ...@@ -5827,6 +5840,15 @@
} }
} }
}, },
"html2canvas": {
"version": "1.3.2",
"resolved": "https://registry.nlark.com/html2canvas/download/html2canvas-1.3.2.tgz?cache=0&sync_timestamp=1629033308740&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fhtml2canvas%2Fdownload%2Fhtml2canvas-1.3.2.tgz",
"integrity": "sha1-lRzIOIo86Tn9rAITEAfuKBJK/Cc=",
"requires": {
"css-line-break": "2.0.1",
"text-segmentation": "^1.0.2"
}
},
"htmlparser2": { "htmlparser2": {
"version": "3.3.0", "version": "3.3.0",
"resolved": "http://registry.npm.taobao.org/htmlparser2/download/htmlparser2-3.3.0.tgz", "resolved": "http://registry.npm.taobao.org/htmlparser2/download/htmlparser2-3.3.0.tgz",
...@@ -11064,6 +11086,14 @@ ...@@ -11064,6 +11086,14 @@
"integrity": "sha1-y7Y52QAu7ZxrWXXrIFmNeTbx+fI=", "integrity": "sha1-y7Y52QAu7ZxrWXXrIFmNeTbx+fI=",
"dev": true "dev": true
}, },
"text-segmentation": {
"version": "1.0.2",
"resolved": "https://registry.nlark.com/text-segmentation/download/text-segmentation-1.0.2.tgz?cache=0&sync_timestamp=1628857855224&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ftext-segmentation%2Fdownload%2Ftext-segmentation-1.0.2.tgz",
"integrity": "sha1-H4KPoUqhAcEU3tG9o1un3MF8mFg=",
"requires": {
"utrie": "^1.0.1"
}
},
"text-table": { "text-table": {
"version": "0.2.0", "version": "0.2.0",
"resolved": "http://registry.npm.taobao.org/text-table/download/text-table-0.2.0.tgz", "resolved": "http://registry.npm.taobao.org/text-table/download/text-table-0.2.0.tgz",
...@@ -11685,6 +11715,21 @@ ...@@ -11685,6 +11715,21 @@
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=",
"dev": true "dev": true
}, },
"utrie": {
"version": "1.0.1",
"resolved": "https://registry.nlark.com/utrie/download/utrie-1.0.1.tgz?cache=0&sync_timestamp=1628857880301&other_urls=https%3A%2F%2Fregistry.nlark.com%2Futrie%2Fdownload%2Futrie-1.0.1.tgz",
"integrity": "sha1-4VUjXry93ImuCSYatudzzmFAGy8=",
"requires": {
"base64-arraybuffer": "^1.0.1"
},
"dependencies": {
"base64-arraybuffer": {
"version": "1.0.1",
"resolved": "https://registry.nlark.com/base64-arraybuffer/download/base64-arraybuffer-1.0.1.tgz?cache=0&sync_timestamp=1628588917496&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fbase64-arraybuffer%2Fdownload%2Fbase64-arraybuffer-1.0.1.tgz",
"integrity": "sha1-h70TUlYm20qYOOAKUIwrc+/PNIw="
}
}
},
"uuid": { "uuid": {
"version": "3.3.2", "version": "3.3.2",
"resolved": "http://registry.npm.taobao.org/uuid/download/uuid-3.3.2.tgz", "resolved": "http://registry.npm.taobao.org/uuid/download/uuid-3.3.2.tgz",
...@@ -11784,6 +11829,11 @@ ...@@ -11784,6 +11829,11 @@
"vue-style-loader": "^4.1.0" "vue-style-loader": "^4.1.0"
} }
}, },
"vue-qr": {
"version": "2.5.0",
"resolved": "https://registry.nlark.com/vue-qr/download/vue-qr-2.5.0.tgz",
"integrity": "sha1-K5OPjUw9B+r55JMbcU4y98oVtd0="
},
"vue-quill-editor": { "vue-quill-editor": {
"version": "3.0.6", "version": "3.0.6",
"resolved": "https://registry.npmjs.org/vue-quill-editor/-/vue-quill-editor-3.0.6.tgz", "resolved": "https://registry.npmjs.org/vue-quill-editor/-/vue-quill-editor-3.0.6.tgz",
......
...@@ -14,10 +14,12 @@ ...@@ -14,10 +14,12 @@
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"glsx-vue-common": "^1.2.9", "glsx-vue-common": "^1.2.9",
"glsx-vue-components": "^1.0.13", "glsx-vue-components": "^1.0.13",
"html2canvas": "^1.3.2",
"sha1": "^1.1.1", "sha1": "^1.1.1",
"vee-validate": "^2.1.7", "vee-validate": "^2.1.7",
"vue": "^2.5.17", "vue": "^2.5.17",
"vue-clipboard2": "^0.2.1", "vue-clipboard2": "^0.2.1",
"vue-qr": "^2.5.0",
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
"xlsx": "^0.16.9" "xlsx": "^0.16.9"
}, },
......
...@@ -174,7 +174,7 @@ export const goodsEquityManageApi = { ...@@ -174,7 +174,7 @@ export const goodsEquityManageApi = {
}, },
/* 获取品牌下商品形态列表*/ /* 获取品牌下商品形态列表*/
getAppearanceList(data = {}) { getAppearanceList(data = {}) {
return request({...data, supplier: 'HW' }, 'scrm.api.equity.goods.appearance.list') return request({ ...data, supplier: 'HW' }, 'scrm.api.equity.goods.appearance.list')
}, },
} }
...@@ -219,4 +219,8 @@ export const equityApi = { ...@@ -219,4 +219,8 @@ export const equityApi = {
getCollectionMerchantList(data = {}) { getCollectionMerchantList(data = {}) {
return request(data, 'scrm.api.equity.card.get.by.merchant.name') return request(data, 'scrm.api.equity.card.get.by.merchant.name')
}, },
/*获取推广信息*/
getQrUrl(data = {}) {
return request(data, 'scrm.api.equity.card.class.generate.try.url')
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
</div> </div>
<el-select <el-select
v-model="searchForm.merchantName" v-model="searchForm.merchantName"
clearable clearab
le
filterable filterable
remote remote
reserve-keyword reserve-keyword
...@@ -66,11 +67,69 @@ ...@@ -66,11 +67,69 @@
>编辑</el-button> >编辑</el-button>
<el-button <el-button
type="text" type="text"
:disabled="scope.scope.tryAble == 0?true:false"
@click="extension(scope.scope)"
>推广</el-button>
<el-button
type="text"
@click="copy(scope.scope)" @click="copy(scope.scope)"
>复制</el-button> >复制</el-button>
</span> </span>
</d2-table> </d2-table>
</div> </div>
<!-- 推广弹窗 -->
<el-dialog
:title="title"
:visible.sync="isVisible"
:before-close="handleClose"
:close-on-click-modal="false"
width="580px"
>
<el-form
:model="editForm"
:rules="rules"
ref="ruleForm"
label-width="68px"
>
<div class='main-qrcode'>
<img
:src="editForm.qrCode"
ref="Qrcode"
id="qrCode"
>{{this.tryNum}}天试用
<div
class='download-qrcode'
@click="downloadImg"
:download="downloadFilename"
>下载二维码</div>
</div>
<el-form-item
label="领取链接"
prop=""
>
<el-input
disabled='true'
:value='`${editForm.url}`'
maxlength="14"
placeholder="请输入链接"
clearable
>
<el-button
@click='closeText(`${editForm.url}`)'
slot="append"
type=""
>复制链接</el-button>
</el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button
type="primary"
@click="handleConfirm"
>确定</el-button>
<el-button @click="handleClose">取消</el-button>
</div>
</el-dialog>
<!-- 新建权益卡弹窗 --> <!-- 新建权益卡弹窗 -->
<el-dialog <el-dialog
title="" title=""
...@@ -185,7 +244,7 @@ ...@@ -185,7 +244,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="商品ID:" label="权益商品编码:"
prop="" prop=""
> >
<el-input-number <el-input-number
...@@ -208,6 +267,40 @@ ...@@ -208,6 +267,40 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="baseinformation2"> <span class="titleText">其他信息</span> </div>
<div class="form">
<el-form-item
label="试用设置:"
prop=""
>
<el-switch
v-model="value"
active-color="#13ce66"
inactive-color="#ff4949"
>
</el-switch>
</el-form-item>
<div class="durationCtn">
<el-form-item
label="试用时长:"
:prop="value == false?'':'tryNum'"
>
<el-input-number
v-model="tryNum"
controls-position="right"
size="mini"
:disabled='!hasTryNum'
:min="1"
:max="100"
></el-input-number>天试用
<span class="
codeTxt">
测试后将生成试用链接和二维码可用于推广
</span>
</el-form-item>
</div>
</div>
<div class="buttonCtn"> <div class="buttonCtn">
<el-form-item> <el-form-item>
<el-button <el-button
...@@ -225,6 +318,14 @@ ...@@ -225,6 +318,14 @@
</template> </template>
<script> <script>
const cloneText = (message) => {
let input = document.createElement("input");
input.value = message;
document.body.appendChild(input);
input.select();
input.setSelectionRange(0, input.value.length), document.execCommand('Copy');
document.body.removeChild(input);
}
function date_format(date) { function date_format(date) {
var date = new Date(date); var date = new Date(date);
var YY = date.getFullYear() + '-'; var YY = date.getFullYear() + '-';
...@@ -235,11 +336,18 @@ function date_format(date) { ...@@ -235,11 +336,18 @@ function date_format(date) {
var ss = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()); var ss = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
return YY + MM + DD + " " + hh + mm + ss; return YY + MM + DD + " " + hh + mm + ss;
} }
import { equityApi } from '@/api/api' import { equityApi, getQrUrl } from '@/api/api'
import vueQr from 'vue-qr'
// import {memberCardDetails} from "@/api/test"; // import {memberCardDetails} from "@/api/test";
export default { export default {
data() { data() {
return { return {
hasTryNum: '',
value: false,
downloadFilename: '',
isVisible: false,
title: '试用推广',
mainPage: location.origin + '/scrm-fission-mobile/#/?activityId=',
submitBtn: false, submitBtn: false,
disableInputNumber: false, disableInputNumber: false,
disableSelect: false, disableSelect: false,
...@@ -308,6 +416,7 @@ export default { ...@@ -308,6 +416,7 @@ export default {
// name: '淘票票2' // name: '淘票票2'
// } // }
// ], // ],
tryNum: '',
effectiveNum: '', effectiveNum: '',
data: '', data: '',
ruleForm: { ruleForm: {
...@@ -320,6 +429,10 @@ export default { ...@@ -320,6 +429,10 @@ export default {
merchantName: '', merchantName: '',
id: '' id: ''
}, },
editForm: {
url: '',
qrCode: ''
},
product: [ product: [
{ {
id: "firstImg", id: "firstImg",
...@@ -359,6 +472,9 @@ export default { ...@@ -359,6 +472,9 @@ export default {
merchantName: [ merchantName: [
{ required: true, message: '请选择门店', trigger: 'change' } { required: true, message: '请选择门店', trigger: 'change' }
], ],
tryNum: [
{ required: true, message: '请选择试用天数', trigger: 'blur' }
]
}, },
//权益卡管理界面 //权益卡管理界面
date_format, date_format,
...@@ -425,6 +541,9 @@ export default { ...@@ -425,6 +541,9 @@ export default {
} }
} }
}, },
components: {
vueQr
},
mounted() { mounted() {
this.list = this.states.map(item => { this.list = this.states.map(item => {
return { value: `value:${item}`, label: `label:${item}` }; return { value: `value:${item}`, label: `label:${item}` };
...@@ -435,9 +554,75 @@ export default { ...@@ -435,9 +554,75 @@ export default {
this.generateOptions.map(e => { this.generateOptions.map(e => {
if (e.merchantName == n) this.ruleForm.merchantId = e.merchantId if (e.merchantName == n) this.ruleForm.merchantId = e.merchantId
}) })
},
'value'(n) {
if (n == true) {
this.hasTryNum = true
} else {
this.hasTryNum = false
this.tryNum = ''
}
} }
}, },
methods: { methods: {
extension(row) {
console.log(row);
equityApi.getQrUrl({
id: row.id
}).then((res) => {
console.log(this.editForm);
this.editForm = res.data
this.isVisible = true
})
},
handleConfirm() {
this.isVisible = !this.isVisible
},
// 下载二维码
// downloadImg() {
// console.log(this.$refs.Qrcode);
// const iconUrl = this.$refs.Qrcode.src
// let a = document.createElement('a')
// let event = new MouseEvent('click')
// a.download = '二维码'
// a.href = iconUrl
// a.dispatchEvent(event)
// },
downloadImg() {
var img = document.getElementById('qrCode'); // 获取要下载的图片
var url = img.src + '?response-content-type=application/octet-stream '; // 获取图片地址
console.log(url)
var a = document.createElement('a'); // 创建一个a节点插入的document
var event = new MouseEvent('click') // 模拟鼠标click点击事件
a.download = '二维码' // 设置a节点的download属性值
a.href = url; // 将图片的src赋值给a节点的href
a.dispatchEvent(event)
},
// downloadImg(){
// html2canvas(document.getElementById("qrCode")).then(canvas => {
// let saveUrl = canvas.toDataURL('image/png')
// let aLink = document.createElement('a')
// let blob = this.base64ToBlob(saveUrl)
// let evt = document.createEvent('HTMLEvents')
// evt.initEvent('click', true, true)
// aLink.download = '二维码.jpg'
// aLink.href = URL.createObjectURL(blob)
// aLink.click()
// console.log(aLink.href)
// if (aLink.href) {
// Toast.success('保存成功')
// }
// })
// },
handleClose() {
this.isVisible = !this.isVisible
},
// 复制链接按钮
closeText(val) {
cloneText(val);
this.$message.success('复制成功');
},
//管理分页列表下拉框 //管理分页列表下拉框
remoteMethod(query) { remoteMethod(query) {
if (query !== '') { if (query !== '') {
...@@ -485,6 +670,14 @@ export default { ...@@ -485,6 +670,14 @@ export default {
if (this.ruleForm.effectiveType == 2) { if (this.ruleForm.effectiveType == 2) {
this.effectiveNum = row.effectiveNum this.effectiveNum = row.effectiveNum
} }
if(row.tryAble == 1){
this.value = true,
this.tryNum = row.tryNum
}else{
this.value = false,
this.tryNum = ''
}
// 禁用门店框 // 禁用门店框
this.disableSelect = true this.disableSelect = true
// 改变高亮 // 改变高亮
...@@ -507,6 +700,13 @@ export default { ...@@ -507,6 +700,13 @@ export default {
if (this.ruleForm.effectiveType == 2) { if (this.ruleForm.effectiveType == 2) {
this.effectiveNum = row.effectiveNum this.effectiveNum = row.effectiveNum
} }
if(row.tryAble == 1){
this.value = true,
this.tryNum = row.tryNum
}else{
this.value = false,
this.tryNum = ''
}
}, },
addCard(cd) { addCard(cd) {
this.submitBtn = false this.submitBtn = false
...@@ -560,6 +760,13 @@ export default { ...@@ -560,6 +760,13 @@ export default {
if (this.ruleForm.effectiveType == 2) { if (this.ruleForm.effectiveType == 2) {
this.ruleForm.effectiveNum = this.effectiveNum this.ruleForm.effectiveNum = this.effectiveNum
} }
if(this.value == true){
this.ruleForm.tryNum = this.tryNum
this.ruleForm.tryAble = '1'
}else{
this.ruleForm.tryNum = ''
this.ruleForm.tryAble = '0'
}
//判断是否是从新建按钮进来的 //判断是否是从新建按钮进来的
var apiName = this.isAdd ? 'newEquityCard' : 'editEquityCard' var apiName = this.isAdd ? 'newEquityCard' : 'editEquityCard'
console.log(apiName) console.log(apiName)
...@@ -663,6 +870,12 @@ export default { ...@@ -663,6 +870,12 @@ export default {
line-height: 60px; line-height: 60px;
margin-top: -40px; margin-top: -40px;
} }
.baseinformation2 {
width: 100%;
background: #d3d3d3;
height: 60px;
line-height: 60px;
}
.titleText { .titleText {
margin-left: 20px; margin-left: 20px;
} }
...@@ -722,5 +935,25 @@ export default { ...@@ -722,5 +935,25 @@ export default {
font-size: 12px; font-size: 12px;
margin-left: 15px; margin-left: 15px;
} }
.main-qrcode {
text-align: center;
margin-bottom: 10px;
}
.main-qrcode img {
width: 200px;
height: 200px;
}
.download-qrcode {
text-decoration: underline;
color: #f49334;
line-height: 26px;
text-align: center;
cursor: pointer;
}
.durationCtn {
background: #e9e8e8;
padding-left: 20px;
margin-left: 100px;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -10,22 +10,6 @@ ...@@ -10,22 +10,6 @@
<ul> <ul>
<li> <li>
<a <a
href="../customer/customerService.html"
target="_self"
>
客服管理
</a>
</li>
<li>
<a
href="../customer/officialAccount.html"
target="_self"
>
公众号配置
</a>
</li>
<li>
<a
href="../customer/collectionManagement.html" href="../customer/collectionManagement.html"
target="_self" target="_self"
> >
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!