Commit 8be743cf by 王志慧

commit

1 parent d56fe0f3
...@@ -137,4 +137,15 @@ const cancelTopMD = params=>{ ...@@ -137,4 +137,15 @@ const cancelTopMD = params=>{
returnAll: true returnAll: true
}) })
} }
export { cancelTopMD,updateToTopMD,getghSetMealListApi,getSetMealstoreListApi, deleteSetMeal, getSetmealService, getServiceInfo, createSetMeal, upDownPackage, updateSetMeal, configSetMeal ,updateToTop} // 分享
const getMealShare=params=>{
params.method = `scrm.api.equity.package.info.poster`
return http({
url: '/rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export {getMealShare, cancelTopMD,updateToTopMD,getghSetMealListApi,getSetMealstoreListApi, deleteSetMeal, getSetmealService, getServiceInfo, createSetMeal, upDownPackage, updateSetMeal, configSetMeal ,updateToTop}
...@@ -100,7 +100,11 @@ ...@@ -100,7 +100,11 @@
</div> </div>
<GLTable ref="memberCenterRef" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="memberCenterRef" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div slot="cardInfo" slot-scope="scope"> <div slot="cardInfo" slot-scope="scope">
<GLTable class="centerTable" ref="cardListRef" :hasNum="false" :hasPage="false" :noDataImg="url" :tableParams="cardParams" :tableData="scope.scope.list"></GLTable> <GLTable class="centerTable" ref="cardListRef" :hasNum="false" :hasPage="false" :noDataImg="url" :tableParams="cardParams" :tableData="scope.scope.list">
<div slot="activeTypeDesc" slot-scope="scope">
<div>{{ scope.scope.activeTypeDesc }}<span v-if="scope.scope.exchangeCode">({{scope.scope.exchangeCode}})</span></div>
</div>
</GLTable>
</div> </div>
<span slot="accountName" slot-scope="scope"> <span slot="accountName" slot-scope="scope">
<div>{{ scope.scope.accountName }}</div> <div>{{ scope.scope.accountName }}</div>
...@@ -287,6 +291,7 @@ export default { ...@@ -287,6 +291,7 @@ export default {
{ {
label: '开通方式', label: '开通方式',
prop: 'activeTypeDesc', prop: 'activeTypeDesc',
addHtml:'activeTypeDesc',
width: 200 width: 200
}, },
{ {
......
...@@ -76,13 +76,41 @@ ...@@ -76,13 +76,41 @@
</div> </div>
</div> </div>
</glsx-dialog> </glsx-dialog>
<!-- 分享 -->
<GLDialog :mode="mode" title="分享" :visible.sync="shareVisible" :hasFooter="false">
<div class="preview-wrap">
<div class="share-content">
<div>
<div class="share-title">海报</div>
<el-button type="primary" @click="handleSaveImg(shareData.posterUrl)">保存图片</el-button>
</div>
<div class="poster">
<img :src="shareData.posterUrl" />
</div>
</div>
<div class="share-content">
<div>
<div class="share-title">小程序码</div>
<el-button type="primary" @click="handleSaveImg(shareData.qrCodeUrl, '小程序码')">保存图片</el-button>
</div>
<div class="qr-code">
<img :src="shareData.qrCodeUrl" />
</div>
</div>
</div>
<div class="share-footer">
<div class="share-title">小程序页面路径</div>
<div class="share-path">{{ shareData.urlLink }}33水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水水33333333333333</div>
<el-button class="share-btn" type="primary" @click="handleSaveTxt(shareData.urlLink)">复制链接</el-button>
</div>
</GLDialog>
</div> </div>
</template> </template>
<script> <script>
import glsxDialog from '@/components/glsx-dialog' import glsxDialog from '@/components/glsx-dialog'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import { getghSetMealListApi, getSetMealstoreListApi, deleteSetMeal, upDownPackage, updateToTop, cancelTopMD, updateToTopMD } from '@/api/modules/setmeal' import { getghSetMealListApi, getSetMealstoreListApi, deleteSetMeal, upDownPackage, updateToTop, cancelTopMD, updateToTopMD, getMealShare } from '@/api/modules/setmeal'
import { getLoginCount } from '@/api/modules/service' import { getLoginCount } from '@/api/modules/service'
import { stateList } from '@/common/constant' import { stateList } from '@/common/constant'
...@@ -97,6 +125,7 @@ export default { ...@@ -97,6 +125,7 @@ export default {
}, },
data() { data() {
return { return {
shareVisible: false, //分享
showViewer: false, showViewer: false,
showGh: false, showGh: false,
url: url, url: url,
...@@ -109,6 +138,7 @@ export default { ...@@ -109,6 +138,7 @@ export default {
merchantId: 44184606 merchantId: 44184606
// merchantName // merchantName
}, },
shareData: {},
tabList: [ tabList: [
{ {
text: '本店套餐', text: '本店套餐',
...@@ -123,6 +153,19 @@ export default { ...@@ -123,6 +153,19 @@ export default {
// 表格按钮 // 表格按钮
tableButtonList: [ tableButtonList: [
{ {
type: 'el-button',
name: '分享',
attrs: {
type: 'text'
},
listeners: {
click: this.handleShare
}
// condition: row => {
// return row.state != 1
// }
},
{
type: 'GLButton', type: 'GLButton',
name: '编辑', name: '编辑',
attrs: { attrs: {
...@@ -271,7 +314,7 @@ export default { ...@@ -271,7 +314,7 @@ export default {
label: '首页置顶展示', label: '首页置顶展示',
prop: 'topFlag', prop: 'topFlag',
addHtml: 'topFlag', addHtml: 'topFlag',
width: 150, width: 150
}, },
{ {
label: '操作', label: '操作',
...@@ -428,6 +471,36 @@ export default { ...@@ -428,6 +471,36 @@ export default {
} }
}) })
}, },
//分享
handleShare(val) {
getMealShare({ id: val.id }).then(res => {
this.shareData = res
})
this.shareVisible = true
},
//保存图片
handleSaveImg(url, downloadTxt = '海报') {
var alink = document.createElement('a')
alink.href = url
alink.setAttribute('target', '_blank')
alink.download = downloadTxt
alink.click()
alink.remove()
},
//复制
handleSaveTxt(txt) {
this.$message({
message: '复制成功',
type: 'success',
customClass: 'message-Z-zinde'
})
const input = document.createElement('input')
document.body.appendChild(input)
input.setAttribute('value', txt)
input.select()
document.execCommand('Copy')
document.body.removeChild(input)
},
handleEdit(row) { handleEdit(row) {
this.$router.push({ path: '/memberCenter/setmealAddUpdate', query: { id: row.id, $title: encodeURI('编辑套餐') } }) this.$router.push({ path: '/memberCenter/setmealAddUpdate', query: { id: row.id, $title: encodeURI('编辑套餐') } })
}, },
...@@ -604,4 +677,69 @@ export default { ...@@ -604,4 +677,69 @@ export default {
} }
} }
} }
.preview-wrap {
display: flex;
justify-content: space-between;
.share-content {
width: 335px;
height: 328px;
background: #f8f8f8;
border-radius: 2px;
display: flex;
justify-content: space-between;
padding: 20px;
box-sizing: border-box;
.share-title {
font-weight: 600;
font-size: 14px;
color: #333333;
margin-bottom: 50px;
}
.qr-code {
width: 120px;
height: 120px;
img {
width: 100%;
height: 100%;
}
}
.poster {
width: 152px;
height: 242px;
img {
width: 100%;
height: 100%;
}
}
}
}
.share-footer {
width: 680px;
height: 90px;
background: #f8f8f8;
border-radius: 2px;
margin-top: 10px;
padding: 10px 20px;
box-sizing: border-box;
position: relative;
.share-path {
font-weight: 600;
font-size: 14px;
color: #999999;
max-width:400px;
white-space: wrap;
}
.share-title {
font-weight: 600;
font-size: 14px;
color: #333333;
margin-bottom: 10px;
}
.share-btn {
position: absolute;
right: 40px;
bottom: 29px;
}
}
</style> </style>
...@@ -75,6 +75,11 @@ ...@@ -75,6 +75,11 @@
</el-form-item> </el-form-item>
<span class="give-tip">可在套餐详情页顶部展示</span> <span class="give-tip">可在套餐详情页顶部展示</span>
</template> </template>
<template v-if="showGh && accountLevel == 4">
<el-form-item size="small" label="分享图片:">
<preview :picOptions="sharePosterOptions" :imageUrlArr="sharePosterImgArr" @change="changeqrCode"></preview>
</el-form-item>
</template>
</el-form> </el-form>
</div> </div>
<GLFooter> <GLFooter>
...@@ -131,7 +136,14 @@ export default { ...@@ -131,7 +136,14 @@ export default {
key: 'packageImg', key: 'packageImg',
isClose: true isClose: true
}, },
sharePosterOptions: {
width: '104px',
height: '104px',
key: 'sharePosterImg',
isClose: true
},
packageImgArr: [], packageImgArr: [],
sharePosterImgArr:[],
allItemList: [], allItemList: [],
choseItemList: [], //['一年12次洗车券×1', '车身打蜡×2', '全车镀膜×1'], choseItemList: [], //['一年12次洗车券×1', '车身打蜡×2', '全车镀膜×1'],
copyChoseItemList: [], //用于检查页面信息是否改动 copyChoseItemList: [], //用于检查页面信息是否改动
...@@ -211,7 +223,7 @@ export default { ...@@ -211,7 +223,7 @@ export default {
this.merchantName = this.$globalState.session.merchantName this.merchantName = this.$globalState.session.merchantName
this.accountLevel = this.$globalState.session.accountLevel this.accountLevel = this.$globalState.session.accountLevel
} }
this.showGh = window.location.host.indexOf('cgacar') != -1 this.showGh = window.location.host.indexOf('cgacar') == -1
if (this.showGh) { if (this.showGh) {
this.getCardContentFun() this.getCardContentFun()
} }
...@@ -300,7 +312,8 @@ export default { ...@@ -300,7 +312,8 @@ export default {
item.couponAmount = item.serviceQuantity item.couponAmount = item.serviceQuantity
item.id = item.serviceId item.id = item.serviceId
}) })
this.packageImgArr =[res.data.packageImg] this.packageImgArr = [res.data.packageImg]
this.sharePosterImgArr = [res.data.sharePosterImg]
this.recoveryCoupon() this.recoveryCoupon()
this.copyTotalPrice = this.totalPrice this.copyTotalPrice = this.totalPrice
this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据 this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据
...@@ -352,7 +365,11 @@ export default { ...@@ -352,7 +365,11 @@ export default {
param.switchStatus = this.ruleForm.switchStatus ? 1 : 0 param.switchStatus = this.ruleForm.switchStatus ? 1 : 0
if (this.showGh) { if (this.showGh) {
param.giveGoldFlag = this.ruleForm.giveGoldFlag param.giveGoldFlag = this.ruleForm.giveGoldFlag
if (this.accountLevel == 4) param.packageImg = this.ruleForm.packageImg if (this.accountLevel == 4) {
param.packageImg = this.ruleForm.packageImg
param.sharePosterImg = this.ruleForm.sharePosterImg
}
} }
let lists = this.choseItemList let lists = this.choseItemList
for (var k in lists) { for (var k in lists) {
...@@ -391,7 +408,11 @@ export default { ...@@ -391,7 +408,11 @@ export default {
params.switchStatus = this.ruleForm.switchStatus ? 1 : 0 params.switchStatus = this.ruleForm.switchStatus ? 1 : 0
if (this.showGh) { if (this.showGh) {
params.giveGoldFlag = this.ruleForm.giveGoldFlag params.giveGoldFlag = this.ruleForm.giveGoldFlag
if (this.accountLevel == 4) params.packageImg = this.ruleForm.packageImg if (this.accountLevel == 4) {
params.packageImg = this.ruleForm.packageImg
params.sharePosterImg = this.ruleForm.sharePosterImg
}
} }
let list = this.choseItemList let list = this.choseItemList
for (var i in list) { for (var i in list) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!