Commit 9675af04 by 杨北旺

完成小程序短链需求开发

1 parent e8e8def5
......@@ -3623,8 +3623,8 @@
},
"charenc": {
"version": "0.0.2",
"resolved": "https://registry.npm.taobao.org/charenc/download/charenc-0.0.2.tgz",
"integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc="
"resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz",
"integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA=="
},
"check-types": {
"version": "8.0.3",
......@@ -4438,8 +4438,8 @@
},
"crypt": {
"version": "0.0.2",
"resolved": "https://registry.npm.taobao.org/crypt/download/crypt-0.0.2.tgz",
"integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs="
"resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz",
"integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow=="
},
"crypto-browserify": {
"version": "3.12.0",
......@@ -6387,9 +6387,9 @@
}
},
"glsx-common": {
"version": "1.4.9",
"resolved": "https://registry.npmjs.org/glsx-common/-/glsx-common-1.4.9.tgz",
"integrity": "sha512-RQWGOGEXUPNmHkZn7n+eukkXp6L/mOfsgMo4gFtrt80ZDxGaznHMg7Isi4+IrEdvVdzp8Cju0eiCTddnZfdsJg==",
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/glsx-common/-/glsx-common-2.0.4.tgz",
"integrity": "sha512-EgWFYUmDk6axzEi6uq5FmYd8nPD7DDg2Vi5kepNMX7YS/cg4bLNBdGCp4iZe2SYFIx3U5O7yKf9fI/aWewCVxw==",
"requires": {
"axios": "^0.21.3",
"md5": "^2.3.0",
......@@ -6398,9 +6398,9 @@
},
"dependencies": {
"qs": {
"version": "6.10.1",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz",
"integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==",
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
"requires": {
"side-channel": "^1.0.4"
}
......@@ -6417,6 +6417,27 @@
"glsx-common": "^1.4.9",
"vue": "^2.6.11",
"vuedraggable": "^2.24.3"
},
"dependencies": {
"glsx-common": {
"version": "1.4.9",
"resolved": "https://registry.npmjs.org/glsx-common/-/glsx-common-1.4.9.tgz",
"integrity": "sha512-RQWGOGEXUPNmHkZn7n+eukkXp6L/mOfsgMo4gFtrt80ZDxGaznHMg7Isi4+IrEdvVdzp8Cju0eiCTddnZfdsJg==",
"requires": {
"axios": "^0.21.3",
"md5": "^2.3.0",
"qs": "^6.10.1",
"sha1": "^1.1.1"
}
},
"qs": {
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
"requires": {
"side-channel": "^1.0.4"
}
}
}
},
"glsx-vue-components": {
......@@ -7555,11 +7576,6 @@
"integrity": "sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==",
"dev": true
},
"jquery": {
"version": "3.6.0",
"resolved": "https://registry.npm.taobao.org/jquery/download/jquery-3.6.0.tgz",
"integrity": "sha1-xyoJ8Vwb3OFC9J2/EXC9+K2sJHA="
},
"js-base64": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz",
......@@ -11173,8 +11189,8 @@
},
"sha1": {
"version": "1.1.1",
"resolved": "https://registry.npm.taobao.org/sha1/download/sha1-1.1.1.tgz",
"integrity": "sha1-rdqnqTFo85PxnrKxUJFhjicA+Eg=",
"resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz",
"integrity": "sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA==",
"requires": {
"charenc": ">= 0.0.1",
"crypt": ">= 0.0.1"
......
......@@ -13,10 +13,9 @@
"cors": "^2.8.5",
"el-tree-transfer": "^2.4.7",
"element-ui": "^2.15.6",
"glsx-common": "^1.4.9",
"glsx-common": "^2.0.4",
"glsx-components": "^1.5.2",
"glsx-vue-components": "^1.0.15",
"jquery": "^3.6.0",
"vue": "^2.6.14",
"vue-bus": "^1.2.1",
"vue-quill-editor": "^3.0.6",
......
......@@ -186,6 +186,15 @@ const createShortLink = params => {
returnAll: true
})
}
/** 获取小程序短链配置 */
const getShortLinkUUID = params => {
params.method = 'entmicro.api.shorturl.uuid.get'
return new_http({
url:'rop-scrm-entmicro/router',
data: params,
returnAll: true
})
}
export default {
getBalanceList,
getOrderList,
......@@ -210,5 +219,6 @@ export default {
getAllBrandList,
exportOrderList,
exportGasList,
createShortLink
createShortLink,
getShortLinkUUID,
}
<!-- 搜索 -->
<template>
<div class="glsx-combi-form">
<el-form :ref="formRef" :inline="true" :model="formObj" :label-width="labelWidth" :rules="formRules" size="small" class="glsx-combi-form-block">
<el-form :ref="formRef" :inline="isInline" :model="formObj" :label-width="labelWidth" :rules="formRules" size="medium" class="glsx-combi-form-block">
<template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ ...item.style }" :label="item.label ? item.label + ':' : ''" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
......@@ -167,6 +167,10 @@ export default {
searchSelectObj: {
type: Object,
default: () => {}
},
isInline:{
type:Boolean,
default:true
}
},
......
......@@ -15,6 +15,7 @@ export const fetchConfig = function(isEnv = true) {
// return Promise.resolve(cfg)
// }
return new Http().get('https://oss-config.test.glsx.com.cn/mock/616e90b11072f92988f05a09/equity/config')
// return new Http().get('https://oss-config.dev.glsx.com.cn/mock/616e90b11072f92988f05a09/equity/config')
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
}
......
......@@ -83,5 +83,11 @@ const staticRoutes = Object.freeze([
component: resolve => require([`@/views/sale/index.vue`], resolve),
meta: {}
},
{//小程序短链
name: 'ShortLink',
path: '/shortLink/index',
component: resolve => require([`@/views/shortLink/index.vue`], resolve),
meta: {}
},
])
export default staticRoutes
<template>
<div class="short-link-container">
<div class="title">小程序短链</div>
<div class="wrapper">
<glsxCombiForm :isInline="false" labelWidth="154px" defaultWidth="474px" :formObj="editForm" :formData="editFormDataPro">
<div slot="tip" class="tip_widget">
<div class="left">常用页面路径:</div>
<div class="right">
<div v-for="(item, index) in tipList" :key="index" class="right_page_title">{{ item.confName }}:{{ item.confId }}</div>
</div>
</div>
<div slot="btn" class="btn_wrap">
<el-button size="medium " @click="resetParam">重置</el-button>
<el-button size="medium " :disabled="btnDisable" type="primary" @click="comfirmShortLink">生成短链</el-button>
</div>
<div v-if="shortLink" slot="links" class="link_wrap">{{shortLink}}</div>
</glsxCombiForm>
</div>
<!-- <div v-if="shortLink" class="cell flex_sc">
<div class="default_w">小程序短链</div>
<el-input size="small" class="default_r_w" :value="shortLink" disabled></el-input>
<el-button class="copyBtn" size="small" type="primary" @click="copyLink">复制</el-button>
</div> -->
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
const ENVVersion = ['trial', 'release']
const GH_MINI_APPID = 'wxfe82b8d65d07808f'
const DJ_MINI_APPID = 'wxe10067a63c1856ac'
const DJ_MINI_BEAT_APPID = 'wx9f91c1ec493eb425'
const ENVLIST = [
{
confId: 1,
confName: '体验版'
},
{
confId: 2,
confName: '线上版'
}
]
const MINI = [
{
confId: GH_MINI_APPID,
confName: '广汇车生活'
},
{
confId: DJ_MINI_APPID,
confName: '嘀加智享车生活'
},
{
confId: DJ_MINI_BEAT_APPID,
confName: '嘀加智享车生活体验版'
}
]
const MINIPAGELIST = [
{
confId: 'pages/tab/index/index',
confName: '首页'
},
{
confId: 'pages/tab/equity/equity',
confName: '权益首页'
},
{
confId: 'pages/tab/mall/mall',
confName: '商城首页'
},
{
confId: 'packageEquity/pages/freecard/freecard',
confName: '试用会员领取页'
},
{
confId: 'packageEquity/pages/reviceVip/reviceVip',
confName: '无忧会员领取页'
}
]
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)
}
export default {
name: '',
components: {
glsxCombiForm
},
data() {
return {
shortLink: '',
btnDisable: false,
tipList: MINIPAGELIST,
editForm: {
env: '',
miniPrograme: '',
path: '',
merchantId: '',
query: ''
},
editFormDataPro: [
{
label: '小程序',
name: 'miniPrograme',
type: 'select',
isClear: true,
noFilter: true,
optionId: 'confId',
optionLabel: 'confName',
optionList: MINI,
changeAttr: val => {
this.resetShortLink()
}
},
{
label: '小程序环境',
name: 'env',
type: 'select',
isClear: true,
noFilter: true,
optionId: 'confId',
optionLabel: 'confName',
optionList: ENVLIST,
isDisabled: false,
changeAttr: val => {
this.resetShortLink()
}
},
{
label: '小程序页面路径',
name: 'path',
type: 'input',
isClear: true
},
{
label: '',
name: 'tip',
addHtml: 'tip'
},
{
label: '商户号',
name: 'merchantId',
type: 'input',
isClear: true
},
{
label: '页面参数',
name: 'query',
type: 'input',
isClear: true,
placeholder: '如:name=vendor&color=black'
},
{
label: '',
name: 'btn',
addHtml: 'btn'
},
{
label: '',
name: 'links',
addHtml: 'links'
},
]
}
},
watch: {
'editForm.merchantId'() {
this.resetShortLink()
},
'editForm.query'() {
this.resetShortLink()
}
},
mounted() {},
methods: {
// 重置页面
resetParam() {
this.editForm = {
env: '',
miniPrograme: '',
path: '',
merchantId: '',
query: ''
}
this.shortLink = ''
this.editFormDataPro[1].isDisabled = false
},
resetShortLink() {
this.shortLink = null
this.btnDisable = false
},
// 自动匹配参数
matchParams(path) {
console.log(path)
// let para = {}
// let query = ''
// let arr = []
// for (let key in para) {
// arr.push(`${key}=${JSON.stringify(para[key])}`)
// }
// query = arr.join('&')
// this.editForm.query = query
},
comfirmShortLink() {
const { env, miniPrograme, path, merchantId, storeCode, query } = this.editForm
if (!miniPrograme) return this.toastMessage('请选择小程序')
if (!env) return this.toastMessage('请选择环境')
if (!path) return this.toastMessage('请输入小程序页面路径')
if (!merchantId) return this.toastMessage('请输入商户号')
let base_info = `merchantId=${merchantId}`
// if (miniPrograme == GH_MINI_APPID && !storeCode) return this.toastMessage('广汇小程序必须填入门店对应的sapCode')
// if (miniPrograme == GH_MINI_APPID && env == 3) return this.toastMessage('广汇小程序暂时没有预发布环境')
// if (storeCode) {
// base_info = `${base_info}&storeCode=${storeCode}`
// }
const params = {
envVersion: ENVVersion[env - 1],
appId: miniPrograme,
param: `${base_info}${query ? '&' : ''}${query}`,
path,
merchantId
}
this.$apis.orderApi.getShortLinkUUID(params).then(res=>{
if(res.code==0){
this.shortLink = res.data
this.btnDisable = true
}else{
this.toastMessage(res.message)
}
})
// this.createShortLink(params).then(res => {
// if (res.code == 0) {
// this.shortLink = res.data
// this.btnDisable = true
// }
// })
// const qrPara = {
// appId: miniPrograme,
// qrcodeType,
// path,
// scene: query
// }
// if (!qrcodeType) return
// this.createQrCodeImage(qrPara).then(res => {
// if (res.code == 0) {
// this.qrcode = res.data
// }
// })
},
toastMessage(message, type = 3) {
const MESSAGE = ['info', 'success', 'warning', 'error']
this.$message({
message,
type: MESSAGE[type]
})
}
}
}
</script>
<style lang="scss" scoped>
.short-link-container {
background: white;
height: calc(100vh - 80px);
.title {
padding: 15px 20px;
font-weight: 500;
font-size: 16px;
color: #333333;
line-height: 28px;
border-bottom: 1px solid #e5e5e5;
}
.wrapper {
padding: 32px 19px;
.tip_widget {
width: 474px;
background: #f9f9f9;
border-radius: 4px;
box-sizing: border-box;
padding: 10px 20px;
margin: 10px 0 0px 0;
display: flex;
.left,
.right_page_title {
font-weight: 400;
font-size: 12px;
color: #666666;
}
.right_page_title {
height: 20px;
}
.right,
.left {
line-height: 20px;
}
}
.btn_wrap{
display: flex;
}
.link_wrap{
width: 474px;
height: 80px;
background: #F4F6FC;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
font-weight: 400;
font-size: 14px;
color: #333333;
}
}
/deep/ .el-form-item__label {
padding-right: 0px !important;
}
/deep/ .el-form-item{
margin-bottom: 20px !important;
}
/deep/ .el-form-item:nth-child(3) {
margin-bottom: 0 !important;
}
}
.flex_sc {
display: flex;
align-items: center;
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!