Commit cc7e0d1a6708f9744fd8f8e11655a82a6d0c0551
1 parent
76e2c4c7
开发 admin 营销功能
Showing
19 changed files
with
1812 additions
and
18 deletions
src/api/market/marketWayApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 获取营销文本列表 | |
| 4 | +export function listMarketText(params) { | |
| 5 | + return new Promise((resolve, reject) => { | |
| 6 | + request({ | |
| 7 | + url: '/marketText.listMarketText', | |
| 8 | + method: 'get', | |
| 9 | + params | |
| 10 | + }).then(response => { | |
| 11 | + const res = response.data | |
| 12 | + if (res.code == 0) { | |
| 13 | + resolve(res) | |
| 14 | + } else { | |
| 15 | + reject(new Error(res.msg || '获取营销文本列表失败')) | |
| 16 | + } | |
| 17 | + }).catch(error => { | |
| 18 | + reject(error) | |
| 19 | + }) | |
| 20 | + }) | |
| 21 | +} | |
| 22 | + | |
| 23 | +// 添加营销文本 | |
| 24 | +export function saveMarketText(data) { | |
| 25 | + return new Promise((resolve, reject) => { | |
| 26 | + request({ | |
| 27 | + url: '/marketText.saveMarketText', | |
| 28 | + method: 'post', | |
| 29 | + data | |
| 30 | + }).then(response => { | |
| 31 | + const res = response.data | |
| 32 | + if (res.code == 0) { | |
| 33 | + resolve(res) | |
| 34 | + } else { | |
| 35 | + reject(new Error(res.msg || '添加营销文本失败')) | |
| 36 | + } | |
| 37 | + }).catch(error => { | |
| 38 | + reject(error) | |
| 39 | + }) | |
| 40 | + }) | |
| 41 | +} | |
| 42 | + | |
| 43 | +// 更新营销文本 | |
| 44 | +export function updateMarketText(data) { | |
| 45 | + return new Promise((resolve, reject) => { | |
| 46 | + request({ | |
| 47 | + url: '/marketText.updateMarketText', | |
| 48 | + method: 'post', | |
| 49 | + data | |
| 50 | + }).then(response => { | |
| 51 | + const res = response.data | |
| 52 | + if (res.code == 0) { | |
| 53 | + resolve(res) | |
| 54 | + } else { | |
| 55 | + reject(new Error(res.msg || '更新营销文本失败')) | |
| 56 | + } | |
| 57 | + }).catch(error => { | |
| 58 | + reject(error) | |
| 59 | + }) | |
| 60 | + }) | |
| 61 | +} | |
| 62 | + | |
| 63 | +// 删除营销文本 | |
| 64 | +export function deleteMarketText(textId) { | |
| 65 | + return new Promise((resolve, reject) => { | |
| 66 | + request({ | |
| 67 | + url: '/marketText.deleteMarketText', | |
| 68 | + method: 'post', | |
| 69 | + data: { textId } | |
| 70 | + }).then(response => { | |
| 71 | + const res = response.data | |
| 72 | + if (res.code == 0) { | |
| 73 | + resolve(res) | |
| 74 | + } else { | |
| 75 | + reject(new Error(res.msg || '删除营销文本失败')) | |
| 76 | + } | |
| 77 | + }).catch(error => { | |
| 78 | + reject(error) | |
| 79 | + }) | |
| 80 | + }) | |
| 81 | +} | |
| 82 | + | |
| 83 | +// 获取营销图片列表 | |
| 84 | +export function listMarketPic(params) { | |
| 85 | + return new Promise((resolve, reject) => { | |
| 86 | + request({ | |
| 87 | + url: '/marketPic.listMarketPic', | |
| 88 | + method: 'get', | |
| 89 | + params | |
| 90 | + }).then(response => { | |
| 91 | + const res = response.data | |
| 92 | + if (res.code == 0) { | |
| 93 | + resolve(res) | |
| 94 | + } else { | |
| 95 | + reject(new Error(res.msg || '获取营销图片列表失败')) | |
| 96 | + } | |
| 97 | + }).catch(error => { | |
| 98 | + reject(error) | |
| 99 | + }) | |
| 100 | + }) | |
| 101 | +} | |
| 102 | + | |
| 103 | +// 添加营销图片 | |
| 104 | +export function saveMarketPic(data) { | |
| 105 | + return new Promise((resolve, reject) => { | |
| 106 | + request({ | |
| 107 | + url: '/marketPic.saveMarketPic', | |
| 108 | + method: 'post', | |
| 109 | + data | |
| 110 | + }).then(response => { | |
| 111 | + const res = response.data | |
| 112 | + if (res.code == 0) { | |
| 113 | + resolve(res) | |
| 114 | + } else { | |
| 115 | + reject(new Error(res.msg || '添加营销图片失败')) | |
| 116 | + } | |
| 117 | + }).catch(error => { | |
| 118 | + reject(error) | |
| 119 | + }) | |
| 120 | + }) | |
| 121 | +} | |
| 122 | + | |
| 123 | +// 更新营销图片 | |
| 124 | +export function updateMarketPic(data) { | |
| 125 | + return new Promise((resolve, reject) => { | |
| 126 | + request({ | |
| 127 | + url: '/marketPic.updateMarketPic', | |
| 128 | + method: 'post', | |
| 129 | + data | |
| 130 | + }).then(response => { | |
| 131 | + const res = response.data | |
| 132 | + if (res.code == 0) { | |
| 133 | + resolve(res) | |
| 134 | + } else { | |
| 135 | + reject(new Error(res.msg || '更新营销图片失败')) | |
| 136 | + } | |
| 137 | + }).catch(error => { | |
| 138 | + reject(error) | |
| 139 | + }) | |
| 140 | + }) | |
| 141 | +} | |
| 142 | + | |
| 143 | +// 删除营销图片 | |
| 144 | +export function deleteMarketPic(picId) { | |
| 145 | + return new Promise((resolve, reject) => { | |
| 146 | + request({ | |
| 147 | + url: '/marketPic.deleteMarketPic', | |
| 148 | + method: 'post', | |
| 149 | + data: { picId } | |
| 150 | + }).then(response => { | |
| 151 | + const res = response.data | |
| 152 | + if (res.code == 0) { | |
| 153 | + resolve(res) | |
| 154 | + } else { | |
| 155 | + reject(new Error(res.msg || '删除营销图片失败')) | |
| 156 | + } | |
| 157 | + }).catch(error => { | |
| 158 | + reject(error) | |
| 159 | + }) | |
| 160 | + }) | |
| 161 | +} | |
| 162 | + | |
| 163 | +// 获取营销商品列表 | |
| 164 | +export function listMarketGoods(params) { | |
| 165 | + return new Promise((resolve, reject) => { | |
| 166 | + request({ | |
| 167 | + url: '/marketGoods.listMarketGoods', | |
| 168 | + method: 'get', | |
| 169 | + params | |
| 170 | + }).then(response => { | |
| 171 | + const res = response.data | |
| 172 | + if (res.code == 0) { | |
| 173 | + resolve(res) | |
| 174 | + } else { | |
| 175 | + reject(new Error(res.msg || '获取营销商品列表失败')) | |
| 176 | + } | |
| 177 | + }).catch(error => { | |
| 178 | + reject(error) | |
| 179 | + }) | |
| 180 | + }) | |
| 181 | +} | |
| 182 | + | |
| 183 | +// 添加营销商品 | |
| 184 | +export function saveMarketGoods(data) { | |
| 185 | + return new Promise((resolve, reject) => { | |
| 186 | + request({ | |
| 187 | + url: '/marketGoods.saveMarketGoods', | |
| 188 | + method: 'post', | |
| 189 | + data | |
| 190 | + }).then(response => { | |
| 191 | + const res = response.data | |
| 192 | + if (res.code == 0) { | |
| 193 | + resolve(res) | |
| 194 | + } else { | |
| 195 | + reject(new Error(res.msg || '添加营销商品失败')) | |
| 196 | + } | |
| 197 | + }).catch(error => { | |
| 198 | + reject(error) | |
| 199 | + }) | |
| 200 | + }) | |
| 201 | +} | |
| 202 | + | |
| 203 | +// 更新营销商品 | |
| 204 | +export function updateMarketGoods(data) { | |
| 205 | + return new Promise((resolve, reject) => { | |
| 206 | + request({ | |
| 207 | + url: '/marketGoods.updateMarketGoods', | |
| 208 | + method: 'post', | |
| 209 | + data | |
| 210 | + }).then(response => { | |
| 211 | + const res = response.data | |
| 212 | + if (res.code == 0) { | |
| 213 | + resolve(res) | |
| 214 | + } else { | |
| 215 | + reject(new Error(res.msg || '更新营销商品失败')) | |
| 216 | + } | |
| 217 | + }).catch(error => { | |
| 218 | + reject(error) | |
| 219 | + }) | |
| 220 | + }) | |
| 221 | +} | |
| 222 | + | |
| 223 | +// 删除营销商品 | |
| 224 | +export function deleteMarketGoods(goodsId) { | |
| 225 | + return new Promise((resolve, reject) => { | |
| 226 | + request({ | |
| 227 | + url: '/marketGoods.deleteMarketGoods', | |
| 228 | + method: 'post', | |
| 229 | + data: { goodsId } | |
| 230 | + }).then(response => { | |
| 231 | + const res = response.data | |
| 232 | + if (res.code == 0) { | |
| 233 | + resolve(res) | |
| 234 | + } else { | |
| 235 | + reject(new Error(res.msg || '删除营销商品失败')) | |
| 236 | + } | |
| 237 | + }).catch(error => { | |
| 238 | + reject(error) | |
| 239 | + }) | |
| 240 | + }) | |
| 241 | +} | |
| 242 | + | |
| 243 | +// 获取营销配置列表 | |
| 244 | +export function listMarketSms(params) { | |
| 245 | + return new Promise((resolve, reject) => { | |
| 246 | + request({ | |
| 247 | + url: '/marketSms.listMarketSms', | |
| 248 | + method: 'get', | |
| 249 | + params | |
| 250 | + }).then(response => { | |
| 251 | + const res = response.data | |
| 252 | + if (res.code == 0) { | |
| 253 | + resolve(res) | |
| 254 | + } else { | |
| 255 | + reject(new Error(res.msg || '获取营销配置列表失败')) | |
| 256 | + } | |
| 257 | + }).catch(error => { | |
| 258 | + reject(error) | |
| 259 | + }) | |
| 260 | + }) | |
| 261 | +} | |
| 0 | 262 | \ No newline at end of file | ... | ... |
src/api/staff/addStaffApi.js
| ... | ... | @@ -45,7 +45,7 @@ export function addStaff(data) { |
| 45 | 45 | export function uploadFile(data) { |
| 46 | 46 | return new Promise((resolve, reject) => { |
| 47 | 47 | request({ |
| 48 | - url: '/upload/uploadFile', | |
| 48 | + url: '/callComponent/upload/uploadFile/uploadImage', | |
| 49 | 49 | method: 'post', |
| 50 | 50 | data, |
| 51 | 51 | headers: { |
| ... | ... | @@ -53,11 +53,7 @@ export function uploadFile(data) { |
| 53 | 53 | } |
| 54 | 54 | }).then(response => { |
| 55 | 55 | const res = response.data |
| 56 | - if (res.code === 0) { | |
| 57 | 56 | resolve(res) |
| 58 | - } else { | |
| 59 | - reject(new Error(res.msg || '上传文件失败')) | |
| 60 | - } | |
| 61 | 57 | }).catch(error => { |
| 62 | 58 | reject(error) |
| 63 | 59 | }) | ... | ... |
src/components/market/AddMarketGoods.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog | |
| 3 | + :title="$t('marketGoods.add')" | |
| 4 | + :visible.sync="visible" | |
| 5 | + width="50%" | |
| 6 | + @close="handleClose" | |
| 7 | + > | |
| 8 | + <el-form | |
| 9 | + ref="form" | |
| 10 | + :model="form" | |
| 11 | + :rules="rules" | |
| 12 | + label-width="120px" | |
| 13 | + > | |
| 14 | + <el-form-item | |
| 15 | + :label="$t('marketGoods.name')" | |
| 16 | + prop="name" | |
| 17 | + > | |
| 18 | + <el-input | |
| 19 | + v-model="form.name" | |
| 20 | + :placeholder="$t('marketGoods.name')" | |
| 21 | + /> | |
| 22 | + </el-form-item> | |
| 23 | + <el-form-item | |
| 24 | + :label="$t('marketGoods.remark')" | |
| 25 | + prop="remark" | |
| 26 | + > | |
| 27 | + <el-input | |
| 28 | + v-model="form.remark" | |
| 29 | + type="textarea" | |
| 30 | + :rows="4" | |
| 31 | + :placeholder="$t('marketGoods.remark')" | |
| 32 | + /> | |
| 33 | + </el-form-item> | |
| 34 | + </el-form> | |
| 35 | + <span slot="footer" class="dialog-footer"> | |
| 36 | + <el-button @click="visible = false"> | |
| 37 | + {{ $t('common.cancel') }} | |
| 38 | + </el-button> | |
| 39 | + <el-button type="primary" @click="handleSubmit"> | |
| 40 | + {{ $t('common.save') }} | |
| 41 | + </el-button> | |
| 42 | + </span> | |
| 43 | + </el-dialog> | |
| 44 | +</template> | |
| 45 | + | |
| 46 | +<script> | |
| 47 | +import { saveMarketGoods } from '@/api/market/marketWayApi' | |
| 48 | + | |
| 49 | +export default { | |
| 50 | + name: 'AddMarketGoods', | |
| 51 | + data() { | |
| 52 | + return { | |
| 53 | + visible: false, | |
| 54 | + form: { | |
| 55 | + name: '', | |
| 56 | + remark: '' | |
| 57 | + }, | |
| 58 | + rules: { | |
| 59 | + name: [ | |
| 60 | + { required: true, message: this.$t('marketGoods.name') + this.$t('common.required'), trigger: 'blur' }, | |
| 61 | + { max: 64, message: this.$t('marketGoods.name') + this.$t('common.maxLength64'), trigger: 'blur' } | |
| 62 | + ], | |
| 63 | + remark: [ | |
| 64 | + { required: true, message: this.$t('marketGoods.remark') + this.$t('common.required'), trigger: 'blur' }, | |
| 65 | + { max: 512, message: this.$t('marketGoods.remark') + this.$t('common.maxLength512'), trigger: 'blur' } | |
| 66 | + ] | |
| 67 | + } | |
| 68 | + } | |
| 69 | + }, | |
| 70 | + methods: { | |
| 71 | + open() { | |
| 72 | + this.visible = true | |
| 73 | + }, | |
| 74 | + handleSubmit() { | |
| 75 | + this.$refs.form.validate(async valid => { | |
| 76 | + if (valid) { | |
| 77 | + try { | |
| 78 | + await saveMarketGoods(this.form) | |
| 79 | + this.$message.success(this.$t('common.saveSuccess')) | |
| 80 | + this.$emit('success') | |
| 81 | + this.visible = false | |
| 82 | + } catch (error) { | |
| 83 | + this.$message.error(error.message) | |
| 84 | + } | |
| 85 | + } | |
| 86 | + }) | |
| 87 | + }, | |
| 88 | + handleClose() { | |
| 89 | + this.$refs.form.resetFields() | |
| 90 | +this.form = { | |
| 91 | + goodsId: '', | |
| 92 | + name: '', | |
| 93 | + remark: '' | |
| 94 | + } | |
| 95 | + } | |
| 96 | + } | |
| 97 | +} | |
| 98 | +</script> | |
| 0 | 99 | \ No newline at end of file | ... | ... |
src/components/market/AddMarketPic.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog :title="$t('marketPic.add')" :visible.sync="visible" width="50%" @close="handleClose"> | |
| 3 | + <el-form ref="form" :model="form" :rules="rules" label-width="120px"> | |
| 4 | + <el-form-item :label="$t('marketPic.name')" prop="name"> | |
| 5 | + <el-input v-model="form.name" :placeholder="$t('marketPic.name')" /> | |
| 6 | + </el-form-item> | |
| 7 | + <el-form-item :label="$t('marketPic.image')" prop="picUrl"> | |
| 8 | + <upload-image-url ref="uploadImage" :image-count="1" @notifyUploadCoverImage="handleImageChange" /> | |
| 9 | + </el-form-item> | |
| 10 | + <el-form-item :label="$t('marketPic.url')" prop="picLink"> | |
| 11 | + <el-input v-model="form.picLink" :placeholder="$t('marketPic.url')" /> | |
| 12 | + </el-form-item> | |
| 13 | + <el-form-item :label="$t('marketPic.remark')" prop="remark"> | |
| 14 | + <el-input v-model="form.remark" type="textarea" :rows="4" :placeholder="$t('marketPic.remark')" /> | |
| 15 | + </el-form-item> | |
| 16 | + </el-form> | |
| 17 | + <span slot="footer" class="dialog-footer"> | |
| 18 | + <el-button @click="visible = false"> | |
| 19 | + {{ $t('common.cancel') }} | |
| 20 | + </el-button> | |
| 21 | + <el-button type="primary" @click="handleSubmit"> | |
| 22 | + {{ $t('common.save') }} | |
| 23 | + </el-button> | |
| 24 | + </span> | |
| 25 | + </el-dialog> | |
| 26 | +</template> | |
| 27 | + | |
| 28 | +<script> | |
| 29 | +import { saveMarketPic } from '@/api/market/marketWayApi' | |
| 30 | +import UploadImageUrl from '@/components/upload/UploadImageUrl' | |
| 31 | + | |
| 32 | +export default { | |
| 33 | + name: 'AddMarketPic', | |
| 34 | + components: { | |
| 35 | + UploadImageUrl | |
| 36 | + }, | |
| 37 | + data() { | |
| 38 | + return { | |
| 39 | + visible: false, | |
| 40 | + form: { | |
| 41 | + name: '', | |
| 42 | + picUrl: '', | |
| 43 | + picLink: '', | |
| 44 | + remark: '' | |
| 45 | + }, | |
| 46 | + rules: { | |
| 47 | + name: [ | |
| 48 | + { required: true, message: this.$t('marketPic.name') + this.$t('common.required'), trigger: 'blur' }, | |
| 49 | + { max: 64, message: this.$t('marketPic.name') + this.$t('common.maxLength64'), trigger: 'blur' } | |
| 50 | + ], | |
| 51 | + picUrl: [ | |
| 52 | + { required: true, message: this.$t('marketPic.image') + this.$t('common.required'), trigger: 'change' } | |
| 53 | + ], | |
| 54 | + picLink: [ | |
| 55 | + { required: true, message: this.$t('marketPic.url') + this.$t('common.required'), trigger: 'blur' }, | |
| 56 | + { max: 512, message: this.$t('marketPic.url') + this.$t('common.maxLength512'), trigger: 'blur' } | |
| 57 | + ], | |
| 58 | + remark: [ | |
| 59 | + { required: true, message: this.$t('marketPic.remark') + this.$t('common.required'), trigger: 'blur' }, | |
| 60 | + { max: 512, message: this.$t('marketPic.remark') + this.$t('common.maxLength512'), trigger: 'blur' } | |
| 61 | + ] | |
| 62 | + } | |
| 63 | + } | |
| 64 | + }, | |
| 65 | + methods: { | |
| 66 | + open() { | |
| 67 | + this.visible = true | |
| 68 | + }, | |
| 69 | + handleImageChange(urls) { | |
| 70 | + this.form.picUrl = urls[0] || '' | |
| 71 | + }, | |
| 72 | + handleSubmit() { | |
| 73 | + this.$refs.form.validate(async valid => { | |
| 74 | + if (valid) { | |
| 75 | + try { | |
| 76 | + await saveMarketPic(this.form) | |
| 77 | + this.$message.success(this.$t('common.saveSuccess')) | |
| 78 | + this.$emit('success') | |
| 79 | + this.visible = false | |
| 80 | + } catch (error) { | |
| 81 | + this.$message.error(error.message) | |
| 82 | + } | |
| 83 | + } | |
| 84 | + }) | |
| 85 | + }, | |
| 86 | + handleClose() { | |
| 87 | + this.$refs.form.resetFields() | |
| 88 | + this.$refs.uploadImage.clear() | |
| 89 | + this.form = { | |
| 90 | + name: '', | |
| 91 | + picUrl: '', | |
| 92 | + picLink: '', | |
| 93 | + remark: '' | |
| 94 | + } | |
| 95 | + } | |
| 96 | + } | |
| 97 | +} | |
| 98 | +</script> | |
| 0 | 99 | \ No newline at end of file | ... | ... |
src/components/market/AddMarketText.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog | |
| 3 | + :title="$t('marketText.add')" | |
| 4 | + :visible.sync="visible" | |
| 5 | + width="50%" | |
| 6 | + @close="handleClose" | |
| 7 | + > | |
| 8 | + <el-form | |
| 9 | + ref="form" | |
| 10 | + :model="form" | |
| 11 | + :rules="rules" | |
| 12 | + label-width="120px" | |
| 13 | + > | |
| 14 | + <el-form-item | |
| 15 | + :label="$t('marketText.name')" | |
| 16 | + prop="name" | |
| 17 | + > | |
| 18 | + <el-input | |
| 19 | + v-model="form.name" | |
| 20 | + :placeholder="$t('marketText.name')" | |
| 21 | + /> | |
| 22 | + </el-form-item> | |
| 23 | + <el-form-item | |
| 24 | + :label="$t('marketText.sendRate')" | |
| 25 | + prop="sendRate" | |
| 26 | + > | |
| 27 | + <el-select | |
| 28 | + v-model="form.sendRate" | |
| 29 | + :placeholder="$t('marketText.sendRate')" | |
| 30 | + style="width: 100%" | |
| 31 | + > | |
| 32 | + <el-option | |
| 33 | + v-for="item in sendRateOptions" | |
| 34 | + :key="item.value" | |
| 35 | + :label="item.label" | |
| 36 | + :value="item.value" | |
| 37 | + /> | |
| 38 | + </el-select> | |
| 39 | + </el-form-item> | |
| 40 | + <el-form-item | |
| 41 | + :label="$t('marketText.content')" | |
| 42 | + prop="textContent" | |
| 43 | + > | |
| 44 | + <el-input | |
| 45 | + v-model="form.textContent" | |
| 46 | + type="textarea" | |
| 47 | + :rows="4" | |
| 48 | + :placeholder="$t('marketText.content')" | |
| 49 | + /> | |
| 50 | + </el-form-item> | |
| 51 | + <el-form-item | |
| 52 | + :label="$t('marketText.config')" | |
| 53 | + prop="smsId" | |
| 54 | + > | |
| 55 | + <el-select | |
| 56 | + v-model="form.smsId" | |
| 57 | + :placeholder="$t('marketText.config')" | |
| 58 | + style="width: 100%" | |
| 59 | + > | |
| 60 | + <el-option | |
| 61 | + v-for="item in marketSmss" | |
| 62 | + :key="item.smsId" | |
| 63 | + :label="item.smsName" | |
| 64 | + :value="item.smsId" | |
| 65 | + /> | |
| 66 | + </el-select> | |
| 67 | + </el-form-item> | |
| 68 | + </el-form> | |
| 69 | + <span slot="footer" class="dialog-footer"> | |
| 70 | + <el-button @click="visible = false"> | |
| 71 | + {{ $t('common.cancel') }} | |
| 72 | + </el-button> | |
| 73 | + <el-button type="primary" @click="handleSubmit"> | |
| 74 | + {{ $t('common.save') }} | |
| 75 | + </el-button> | |
| 76 | + </span> | |
| 77 | + </el-dialog> | |
| 78 | +</template> | |
| 79 | + | |
| 80 | +<script> | |
| 81 | +import { saveMarketText, listMarketSms } from '@/api/market/marketWayApi' | |
| 82 | + | |
| 83 | +export default { | |
| 84 | + name: 'AddMarketText', | |
| 85 | + data() { | |
| 86 | + return { | |
| 87 | + visible: false, | |
| 88 | + form: { | |
| 89 | + name: '', | |
| 90 | + sendRate: '', | |
| 91 | + textContent: '', | |
| 92 | + smsId: '' | |
| 93 | + }, | |
| 94 | + marketSmss: [], | |
| 95 | + sendRateOptions: [ | |
| 96 | + { value: '1001', label: this.$t('marketText.sendRateOptions.daily') }, | |
| 97 | + { value: '2002', label: this.$t('marketText.sendRateOptions.monthly') }, | |
| 98 | + { value: '3003', label: this.$t('marketText.sendRateOptions.unlimited') } | |
| 99 | + ], | |
| 100 | + rules: { | |
| 101 | + name: [ | |
| 102 | + { required: true, message: this.$t('marketText.name') + this.$t('common.required'), trigger: 'blur' }, | |
| 103 | + { max: 64, message: this.$t('marketText.name') + this.$t('common.maxLength64'), trigger: 'blur' } | |
| 104 | + ], | |
| 105 | + sendRate: [ | |
| 106 | + { required: true, message: this.$t('marketText.sendRate') + this.$t('common.required'), trigger: 'change' } | |
| 107 | + ], | |
| 108 | + textContent: [ | |
| 109 | + { required: true, message: this.$t('marketText.content') + this.$t('common.required'), trigger: 'blur' }, | |
| 110 | + { max: 512, message: this.$t('marketText.content') + this.$t('common.maxLength512'), trigger: 'blur' } | |
| 111 | + ], | |
| 112 | + smsId: [ | |
| 113 | + { required: true, message: this.$t('marketText.config') + this.$t('common.required'), trigger: 'change' } | |
| 114 | + ] | |
| 115 | + } | |
| 116 | + } | |
| 117 | + }, | |
| 118 | + methods: { | |
| 119 | + open() { | |
| 120 | + this.visible = true | |
| 121 | + this.getMarketSmss() | |
| 122 | + }, | |
| 123 | + async getMarketSmss() { | |
| 124 | + try { | |
| 125 | + const { data } = await listMarketSms({ page: 1, row: 100 }) | |
| 126 | + this.marketSmss = data | |
| 127 | + } catch (error) { | |
| 128 | + this.$message.error(error.message) | |
| 129 | + } | |
| 130 | + }, | |
| 131 | + handleSubmit() { | |
| 132 | + this.$refs.form.validate(async valid => { | |
| 133 | + if (valid) { | |
| 134 | + try { | |
| 135 | + await saveMarketText(this.form) | |
| 136 | + this.$message.success(this.$t('common.saveSuccess')) | |
| 137 | + this.$emit('success') | |
| 138 | + this.visible = false | |
| 139 | + } catch (error) { | |
| 140 | + this.$message.error(error.message) | |
| 141 | + } | |
| 142 | + } | |
| 143 | + }) | |
| 144 | + }, | |
| 145 | + handleClose() { | |
| 146 | + this.$refs.form.resetFields() | |
| 147 | + this.form = { | |
| 148 | + name: '', | |
| 149 | + sendRate: '', | |
| 150 | + textContent: '', | |
| 151 | + smsId: '' | |
| 152 | + } | |
| 153 | + } | |
| 154 | + } | |
| 155 | +} | |
| 156 | +</script> | |
| 0 | 157 | \ No newline at end of file | ... | ... |
src/components/market/DeleteMarketGoods.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog | |
| 3 | + :title="$t('common.deleteConfirm')" | |
| 4 | + :visible.sync="visible" | |
| 5 | + width="30%" | |
| 6 | + > | |
| 7 | + <span>{{ $t('common.deleteConfirm') }}</span> | |
| 8 | + <span slot="footer" class="dialog-footer"> | |
| 9 | + <el-button @click="visible = false"> | |
| 10 | + {{ $t('common.cancel') }} | |
| 11 | + </el-button> | |
| 12 | + <el-button type="primary" @click="handleConfirm"> | |
| 13 | + {{ $t('common.confirm') }} | |
| 14 | + </el-button> | |
| 15 | + </span> | |
| 16 | + </el-dialog> | |
| 17 | +</template> | |
| 18 | + | |
| 19 | +<script> | |
| 20 | +import { deleteMarketGoods } from '@/api/market/marketWayApi' | |
| 21 | + | |
| 22 | +export default { | |
| 23 | + name: 'DeleteMarketGoods', | |
| 24 | + data() { | |
| 25 | + return { | |
| 26 | + visible: false, | |
| 27 | + goodsId: '' | |
| 28 | + } | |
| 29 | + }, | |
| 30 | + methods: { | |
| 31 | + open(row) { | |
| 32 | + this.goodsId = row.goodsId | |
| 33 | + this.visible = true | |
| 34 | + }, | |
| 35 | + async handleConfirm() { | |
| 36 | + try { | |
| 37 | + await deleteMarketGoods(this.goodsId) | |
| 38 | + this.$message.success(this.$t('common.deleteSuccess')) | |
| 39 | + this.$emit('success') | |
| 40 | + this.visible = false | |
| 41 | + } catch (error) { | |
| 42 | + this.$message.error(error.message) | |
| 43 | + } | |
| 44 | + } | |
| 45 | + } | |
| 46 | +} | |
| 47 | +</script> | |
| 0 | 48 | \ No newline at end of file | ... | ... |
src/components/market/DeleteMarketPic.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog | |
| 3 | + :title="$t('common.deleteConfirm')" | |
| 4 | + :visible.sync="visible" | |
| 5 | + width="30%" | |
| 6 | + > | |
| 7 | + <span>{{ $t('common.deleteConfirm') }}</span> | |
| 8 | + <span slot="footer" class="dialog-footer"> | |
| 9 | + <el-button @click="visible = false"> | |
| 10 | + {{ $t('common.cancel') }} | |
| 11 | + </el-button> | |
| 12 | + <el-button type="primary" @click="handleConfirm"> | |
| 13 | + {{ $t('common.confirm') }} | |
| 14 | + </el-button> | |
| 15 | + </span> | |
| 16 | + </el-dialog> | |
| 17 | +</template> | |
| 18 | + | |
| 19 | +<script> | |
| 20 | +import { deleteMarketPic } from '@/api/market/marketWayApi' | |
| 21 | + | |
| 22 | +export default { | |
| 23 | + name: 'DeleteMarketPic', | |
| 24 | + data() { | |
| 25 | + return { | |
| 26 | + visible: false, | |
| 27 | + picId: '' | |
| 28 | + } | |
| 29 | + }, | |
| 30 | + methods: { | |
| 31 | + open(row) { | |
| 32 | + this.picId = row.picId | |
| 33 | + this.visible = true | |
| 34 | + }, | |
| 35 | + async handleConfirm() { | |
| 36 | + try { | |
| 37 | + await deleteMarketPic(this.picId) | |
| 38 | + this.$message.success(this.$t('common.deleteSuccess')) | |
| 39 | + this.$emit('success') | |
| 40 | + this.visible = false | |
| 41 | + } catch (error) { | |
| 42 | + this.$message.error(error.message) | |
| 43 | + } | |
| 44 | + } | |
| 45 | + } | |
| 46 | +} | |
| 47 | +</script> | |
| 0 | 48 | \ No newline at end of file | ... | ... |
src/components/market/DeleteMarketText.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog | |
| 3 | + :title="$t('common.deleteConfirm')" | |
| 4 | + :visible.sync="visible" | |
| 5 | + width="30%" | |
| 6 | + > | |
| 7 | + <span>{{ $t('common.deleteConfirm') }}</span> | |
| 8 | + <span slot="footer" class="dialog-footer"> | |
| 9 | + <el-button @click="visible = false"> | |
| 10 | + {{ $t('common.cancel') }} | |
| 11 | + </el-button> | |
| 12 | + <el-button type="primary" @click="handleConfirm"> | |
| 13 | + {{ $t('common.confirm') }} | |
| 14 | + </el-button> | |
| 15 | + </span> | |
| 16 | + </el-dialog> | |
| 17 | +</template> | |
| 18 | + | |
| 19 | +<script> | |
| 20 | +import { deleteMarketText } from '@/api/market/marketWayApi' | |
| 21 | + | |
| 22 | +export default { | |
| 23 | + name: 'DeleteMarketText', | |
| 24 | + data() { | |
| 25 | + return { | |
| 26 | + visible: false, | |
| 27 | + textId: '' | |
| 28 | + } | |
| 29 | + }, | |
| 30 | + methods: { | |
| 31 | + open(row) { | |
| 32 | + this.textId = row.textId | |
| 33 | + this.visible = true | |
| 34 | + }, | |
| 35 | + async handleConfirm() { | |
| 36 | + try { | |
| 37 | + await deleteMarketText(this.textId) | |
| 38 | + this.$message.success(this.$t('common.deleteSuccess')) | |
| 39 | + this.$emit('success') | |
| 40 | + this.visible = false | |
| 41 | + } catch (error) { | |
| 42 | + this.$message.error(error.message) | |
| 43 | + } | |
| 44 | + } | |
| 45 | + } | |
| 46 | +} | |
| 47 | +</script> | |
| 0 | 48 | \ No newline at end of file | ... | ... |
src/components/market/EditMarketGoods.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog | |
| 3 | + :title="$t('marketGoods.edit')" | |
| 4 | + :visible.sync="visible" | |
| 5 | + width="50%" | |
| 6 | + @close="handleClose" | |
| 7 | + > | |
| 8 | + <el-form | |
| 9 | + ref="form" | |
| 10 | + :model="form" | |
| 11 | + :rules="rules" | |
| 12 | + label-width="120px" | |
| 13 | + > | |
| 14 | + <el-form-item | |
| 15 | + :label="$t('marketGoods.name')" | |
| 16 | + prop="name" | |
| 17 | + > | |
| 18 | + <el-input | |
| 19 | + v-model="form.name" | |
| 20 | + :placeholder="$t('marketGoods.name')" | |
| 21 | + /> | |
| 22 | + </el-form-item> | |
| 23 | + <el-form-item | |
| 24 | + :label="$t('marketGoods.remark')" | |
| 25 | + prop="remark" | |
| 26 | + > | |
| 27 | + <el-input | |
| 28 | + v-model="form.remark" | |
| 29 | + type="textarea" | |
| 30 | + :rows="4" | |
| 31 | + :placeholder="$t('marketGoods.remark')" | |
| 32 | + /> | |
| 33 | + </el-form-item> | |
| 34 | + </el-form> | |
| 35 | + <span slot="footer" class="dialog-footer"> | |
| 36 | + <el-button @click="visible = false"> | |
| 37 | + {{ $t('common.cancel') }} | |
| 38 | + </el-button> | |
| 39 | + <el-button type="primary" @click="handleSubmit"> | |
| 40 | + {{ $t('common.save') }} | |
| 41 | + </el-button> | |
| 42 | + </span> | |
| 43 | + </el-dialog> | |
| 44 | +</template> | |
| 45 | + | |
| 46 | +<script> | |
| 47 | +import { updateMarketGoods } from '@/api/market/marketWayApi' | |
| 48 | + | |
| 49 | +export default { | |
| 50 | + name: 'EditMarketGoods', | |
| 51 | + data() { | |
| 52 | + return { | |
| 53 | + visible: false, | |
| 54 | + form: { | |
| 55 | + goodsId: '', | |
| 56 | + name: '', | |
| 57 | + remark: '' | |
| 58 | + }, | |
| 59 | + rules: { | |
| 60 | + name: [ | |
| 61 | + { required: true, message: this.$t('marketGoods.name') + this.$t('common.required'), trigger: 'blur' }, | |
| 62 | + { max: 64, message: this.$t('marketGoods.name') + this.$t('common.maxLength64'), trigger: 'blur' } | |
| 63 | + ], | |
| 64 | + remark: [ | |
| 65 | + { required: true, message: this.$t('marketGoods.remark') + this.$t('common.required'), trigger: 'blur' }, | |
| 66 | + { max: 512, message: this.$t('marketGoods.remark') + this.$t('common.maxLength512'), trigger: 'blur' } | |
| 67 | + ], | |
| 68 | + goodsId: [ | |
| 69 | + { required: true, message: 'ID' + this.$t('common.required'), trigger: 'blur' } | |
| 70 | + ] | |
| 71 | + } | |
| 72 | + } | |
| 73 | + }, | |
| 74 | + methods: { | |
| 75 | + open(row) { | |
| 76 | + this.form = { ...row } | |
| 77 | + this.visible = true | |
| 78 | + }, | |
| 79 | + handleSubmit() { | |
| 80 | + this.$refs.form.validate(async valid => { | |
| 81 | + if (valid) { | |
| 82 | + try { | |
| 83 | + await updateMarketGoods(this.form) | |
| 84 | + this.$message.success(this.$t('common.updateSuccess')) | |
| 85 | + this.$emit('success') | |
| 86 | + this.visible = false | |
| 87 | + } catch (error) { | |
| 88 | + this.$message.error(error.message) | |
| 89 | + } | |
| 90 | + } | |
| 91 | + }) | |
| 92 | + }, | |
| 93 | + handleClose() { | |
| 94 | + this.$refs.form.resetFields() | |
| 95 | + this.form = { | |
| 96 | + goodsId: '', | |
| 97 | + name: '', | |
| 98 | + remark: '' | |
| 99 | + } | |
| 100 | + } | |
| 101 | + } | |
| 102 | +} | |
| 103 | +</script> | |
| 0 | 104 | \ No newline at end of file | ... | ... |
src/components/market/EditMarketPic.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog :title="$t('marketPic.edit')" :visible.sync="visible" width="50%" @close="handleClose"> | |
| 3 | + <el-form ref="form" :model="form" :rules="rules" label-width="120px"> | |
| 4 | + <el-form-item :label="$t('marketPic.name')" prop="name"> | |
| 5 | + <el-input v-model="form.name" :placeholder="$t('marketPic.name')" /> | |
| 6 | + </el-form-item> | |
| 7 | + <el-form-item :label="$t('marketPic.image')" prop="picUrl"> | |
| 8 | + <upload-image-url ref="uploadImage" :image-count="1" @notifyUploadCoverImage="handleImageChange" /> | |
| 9 | + </el-form-item> | |
| 10 | + <el-form-item :label="$t('marketPic.url')" prop="picLink"> | |
| 11 | + <el-input v-model="form.picLink" :placeholder="$t('marketPic.url')" /> | |
| 12 | + </el-form-item> | |
| 13 | + <el-form-item :label="$t('marketPic.remark')" prop="remark"> | |
| 14 | + <el-input v-model="form.remark" type="textarea" :rows="4" :placeholder="$t('marketPic.remark')" /> | |
| 15 | + </el-form-item> | |
| 16 | + </el-form> | |
| 17 | + <span slot="footer" class="dialog-footer"> | |
| 18 | + <el-button @click="visible = false"> | |
| 19 | + {{ $t('common.cancel') }} | |
| 20 | + </el-button> | |
| 21 | + <el-button type="primary" @click="handleSubmit"> | |
| 22 | + {{ $t('common.save') }} | |
| 23 | + </el-button> | |
| 24 | + </span> | |
| 25 | + </el-dialog> | |
| 26 | +</template> | |
| 27 | + | |
| 28 | +<script> | |
| 29 | +import { updateMarketPic } from '@/api/market/marketWayApi' | |
| 30 | +import UploadImageUrl from '@/components/upload/UploadImageUrl' | |
| 31 | + | |
| 32 | +export default { | |
| 33 | + name: 'EditMarketPic', | |
| 34 | + components: { | |
| 35 | + UploadImageUrl | |
| 36 | + }, | |
| 37 | + data() { | |
| 38 | + return { | |
| 39 | + visible: false, | |
| 40 | + form: { | |
| 41 | + picId: '', | |
| 42 | + name: '', | |
| 43 | + picUrl: '', | |
| 44 | + picLink: '', | |
| 45 | + remark: '' | |
| 46 | + }, | |
| 47 | + rules: { | |
| 48 | + name: [ | |
| 49 | + { required: true, message: this.$t('marketPic.name') + this.$t('common.required'), trigger: 'blur' }, | |
| 50 | + { max: 64, message: this.$t('marketPic.name') + this.$t('common.maxLength64'), trigger: 'blur' } | |
| 51 | + ], | |
| 52 | + picUrl: [ | |
| 53 | + { required: true, message: this.$t('marketPic.image') + this.$t('common.required'), trigger: 'change' } | |
| 54 | + ], | |
| 55 | + picLink: [ | |
| 56 | + { required: true, message: this.$t('marketPic.url') + this.$t('common.required'), trigger: 'blur' }, | |
| 57 | + { max: 512, message: this.$t('marketPic.url') + this.$t('common.maxLength512'), trigger: 'blur' } | |
| 58 | + ], | |
| 59 | + remark: [ | |
| 60 | + { required: true, message: this.$t('marketPic.remark') + this.$t('common.required'), trigger: 'blur' }, | |
| 61 | + { max: 512, message: this.$t('marketPic.remark') + this.$t('common.maxLength512'), trigger: 'blur' } | |
| 62 | + ], | |
| 63 | + picId: [ | |
| 64 | + { required: true, message: 'ID' + this.$t('common.required'), trigger: 'blur' } | |
| 65 | + ] | |
| 66 | + } | |
| 67 | + } | |
| 68 | + }, | |
| 69 | + methods: { | |
| 70 | + open(row) { | |
| 71 | + this.form = { ...row } | |
| 72 | + setTimeout(() => { | |
| 73 | + this.$refs.uploadImage.setImages([row.picUrl]) | |
| 74 | + },500) | |
| 75 | + | |
| 76 | + this.visible = true | |
| 77 | + }, | |
| 78 | + handleImageChange(urls) { | |
| 79 | + this.form.picUrl = urls[0] || '' | |
| 80 | + }, | |
| 81 | + handleSubmit() { | |
| 82 | + this.$refs.form.validate(async valid => { | |
| 83 | + if (valid) { | |
| 84 | + try { | |
| 85 | + await updateMarketPic(this.form) | |
| 86 | + this.$message.success(this.$t('common.updateSuccess')) | |
| 87 | + this.$emit('success') | |
| 88 | + this.visible = false | |
| 89 | + } catch (error) { | |
| 90 | + this.$message.error(error.message) | |
| 91 | + } | |
| 92 | + } | |
| 93 | + }) | |
| 94 | + }, | |
| 95 | + handleClose() { | |
| 96 | + this.$refs.form.resetFields() | |
| 97 | + this.$refs.uploadImage.clear() | |
| 98 | + this.form = { | |
| 99 | + picId: '', | |
| 100 | + name: '', | |
| 101 | + picUrl: '', | |
| 102 | + picLink: '', | |
| 103 | + remark: '' | |
| 104 | + } | |
| 105 | + } | |
| 106 | + } | |
| 107 | +} | |
| 108 | +</script> | |
| 0 | 109 | \ No newline at end of file | ... | ... |
src/components/market/EditMarketText.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog | |
| 3 | + :title="$t('marketText.edit')" | |
| 4 | + :visible.sync="visible" | |
| 5 | + width="50%" | |
| 6 | + @close="handleClose" | |
| 7 | + > | |
| 8 | + <el-form | |
| 9 | + ref="form" | |
| 10 | + :model="form" | |
| 11 | + :rules="rules" | |
| 12 | + label-width="120px" | |
| 13 | + > | |
| 14 | + <el-form-item | |
| 15 | + :label="$t('marketText.name')" | |
| 16 | + prop="name" | |
| 17 | + > | |
| 18 | + <el-input | |
| 19 | + v-model="form.name" | |
| 20 | + :placeholder="$t('marketText.name')" | |
| 21 | + /> | |
| 22 | + </el-form-item> | |
| 23 | + <el-form-item | |
| 24 | + :label="$t('marketText.sendRate')" | |
| 25 | + prop="sendRate" | |
| 26 | + > | |
| 27 | + <el-select | |
| 28 | + v-model="form.sendRate" | |
| 29 | + :placeholder="$t('marketText.sendRate')" | |
| 30 | + style="width: 100%" | |
| 31 | + > | |
| 32 | + <el-option | |
| 33 | + v-for="item in sendRateOptions" | |
| 34 | + :key="item.value" | |
| 35 | + :label="item.label" | |
| 36 | + :value="item.value" | |
| 37 | + /> | |
| 38 | + </el-select> | |
| 39 | + </el-form-item> | |
| 40 | + <el-form-item | |
| 41 | + :label="$t('marketText.content')" | |
| 42 | + prop="textContent" | |
| 43 | + > | |
| 44 | + <el-input | |
| 45 | + v-model="form.textContent" | |
| 46 | + type="textarea" | |
| 47 | + :rows="4" | |
| 48 | + :placeholder="$t('marketText.content')" | |
| 49 | + /> | |
| 50 | + </el-form-item> | |
| 51 | + <el-form-item | |
| 52 | + :label="$t('marketText.config')" | |
| 53 | + prop="smsId" | |
| 54 | + > | |
| 55 | + <el-select | |
| 56 | + v-model="form.smsId" | |
| 57 | + :placeholder="$t('marketText.config')" | |
| 58 | + style="width: 100%" | |
| 59 | + > | |
| 60 | + <el-option | |
| 61 | + v-for="item in marketSmss" | |
| 62 | + :key="item.smsId" | |
| 63 | + :label="item.smsName" | |
| 64 | + :value="item.smsId" | |
| 65 | + /> | |
| 66 | + </el-select> | |
| 67 | + </el-form-item> | |
| 68 | + </el-form> | |
| 69 | + <span slot="footer" class="dialog-footer"> | |
| 70 | + <el-button @click="visible = false"> | |
| 71 | + {{ $t('common.cancel') }} | |
| 72 | + </el-button> | |
| 73 | + <el-button type="primary" @click="handleSubmit"> | |
| 74 | + {{ $t('common.save') }} | |
| 75 | + </el-button> | |
| 76 | + </span> | |
| 77 | + </el-dialog> | |
| 78 | +</template> | |
| 79 | + | |
| 80 | +<script> | |
| 81 | +import { updateMarketText, listMarketSms } from '@/api/market/marketWayApi' | |
| 82 | + | |
| 83 | +export default { | |
| 84 | + name: 'EditMarketText', | |
| 85 | + data() { | |
| 86 | + return { | |
| 87 | + visible: false, | |
| 88 | + form: { | |
| 89 | + textId: '', | |
| 90 | + name: '', | |
| 91 | + sendRate: '', | |
| 92 | + textContent: '', | |
| 93 | + smsId: '' | |
| 94 | + }, | |
| 95 | + marketSmss: [], | |
| 96 | + sendRateOptions: [ | |
| 97 | + { value: '1001', label: this.$t('marketText.sendRateOptions.daily') }, | |
| 98 | + { value: '2002', label: this.$t('marketText.sendRateOptions.monthly') }, | |
| 99 | + { value: '3003', label: this.$t('marketText.sendRateOptions.unlimited') } | |
| 100 | + ], | |
| 101 | + rules: { | |
| 102 | + name: [ | |
| 103 | + { required: true, message: this.$t('marketText.name') + this.$t('common.required'), trigger: 'blur' }, | |
| 104 | + { max: 64, message: this.$t('marketText.name') + this.$t('common.maxLength64'), trigger: 'blur' } | |
| 105 | + ], | |
| 106 | + sendRate: [ | |
| 107 | + { required: true, message: this.$t('marketText.sendRate') + this.$t('common.required'), trigger: 'change' } | |
| 108 | + ], | |
| 109 | + textContent: [ | |
| 110 | + { required: true, message: this.$t('marketText.content') + this.$t('common.required'), trigger: 'blur' }, | |
| 111 | + { max: 512, message: this.$t('marketText.content') + this.$t('common.maxLength512'), trigger: 'blur' } | |
| 112 | + ], | |
| 113 | + smsId: [ | |
| 114 | + { required: true, message: this.$t('marketText.config') + this.$t('common.required'), trigger: 'change' } | |
| 115 | + ], | |
| 116 | + textId: [ | |
| 117 | + { required: true, message: 'ID' + this.$t('common.required'), trigger: 'blur' } | |
| 118 | + ] | |
| 119 | + } | |
| 120 | + } | |
| 121 | + }, | |
| 122 | + methods: { | |
| 123 | + open(row) { | |
| 124 | + this.form = { ...row } | |
| 125 | + this.visible = true | |
| 126 | + this.getMarketSmss() | |
| 127 | + }, | |
| 128 | + async getMarketSmss() { | |
| 129 | + try { | |
| 130 | + const { data } = await listMarketSms({ page: 1, row: 100 }) | |
| 131 | + this.marketSmss = data | |
| 132 | + } catch (error) { | |
| 133 | + this.$message.error(error.message) | |
| 134 | + } | |
| 135 | + }, | |
| 136 | + handleSubmit() { | |
| 137 | + this.$refs.form.validate(async valid => { | |
| 138 | + if (valid) { | |
| 139 | + try { | |
| 140 | + await updateMarketText(this.form) | |
| 141 | + this.$message.success(this.$t('common.updateSuccess')) | |
| 142 | + this.$emit('success') | |
| 143 | + this.visible = false | |
| 144 | + } catch (error) { | |
| 145 | + this.$message.error(error.message) | |
| 146 | + } | |
| 147 | + } | |
| 148 | + }) | |
| 149 | + }, | |
| 150 | + handleClose() { | |
| 151 | + this.$refs.form.resetFields() | |
| 152 | + this.form = { | |
| 153 | + textId: '', | |
| 154 | + name: '', | |
| 155 | + sendRate: '', | |
| 156 | + textContent: '', | |
| 157 | + smsId: '' | |
| 158 | + } | |
| 159 | + } | |
| 160 | + } | |
| 161 | +} | |
| 162 | +</script> | |
| 0 | 163 | \ No newline at end of file | ... | ... |
src/components/market/MarketWayGoods.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="market-goods-container"> | |
| 3 | + <el-card> | |
| 4 | + <div class="search-wrapper"> | |
| 5 | + <el-row :gutter="20"> | |
| 6 | + <el-col :span="6"> | |
| 7 | + <el-input | |
| 8 | + v-model="searchForm.name" | |
| 9 | + :placeholder="$t('marketGoods.name')" | |
| 10 | + clearable | |
| 11 | + @keyup.enter.native="handleSearch" | |
| 12 | + /> | |
| 13 | + </el-col> | |
| 14 | + <el-col :span="6"> | |
| 15 | + <el-button type="primary" @click="handleSearch"> | |
| 16 | + {{ $t('marketGoods.search') }} | |
| 17 | + </el-button> | |
| 18 | + <el-button type="primary" @click="handleAdd"> | |
| 19 | + {{ $t('marketGoods.add') }} | |
| 20 | + </el-button> | |
| 21 | + </el-col> | |
| 22 | + </el-row> | |
| 23 | + </div> | |
| 24 | + | |
| 25 | + <el-table | |
| 26 | + v-loading="loading" | |
| 27 | + :data="tableData" | |
| 28 | + border | |
| 29 | + style="width: 100%" | |
| 30 | + > | |
| 31 | + <el-table-column | |
| 32 | + prop="name" | |
| 33 | + :label="$t('marketGoods.name')" | |
| 34 | + align="center" | |
| 35 | + /> | |
| 36 | + <el-table-column | |
| 37 | + :label="$t('marketGoods.goodsCount')" | |
| 38 | + align="center" | |
| 39 | + > | |
| 40 | + <template slot-scope="scope"> | |
| 41 | + {{ scope.row.goodsCount }} | |
| 42 | + <el-button | |
| 43 | + type="text" | |
| 44 | + @click="handleViewGoods(scope.row)" | |
| 45 | + > | |
| 46 | + ({{ $t('marketGoods.viewGoods') }}) | |
| 47 | + </el-button> | |
| 48 | + </template> | |
| 49 | + </el-table-column> | |
| 50 | + <el-table-column | |
| 51 | + prop="createTime" | |
| 52 | + :label="$t('marketGoods.createTime')" | |
| 53 | + align="center" | |
| 54 | + /> | |
| 55 | + <el-table-column | |
| 56 | + prop="remark" | |
| 57 | + :label="$t('marketGoods.remark')" | |
| 58 | + align="center" | |
| 59 | + /> | |
| 60 | + <el-table-column | |
| 61 | + :label="$t('marketGoods.operation')" | |
| 62 | + align="center" | |
| 63 | + width="200" | |
| 64 | + > | |
| 65 | + <template slot-scope="scope"> | |
| 66 | + <el-button | |
| 67 | + size="mini" | |
| 68 | + type="primary" | |
| 69 | + @click="handleEdit(scope.row)" | |
| 70 | + > | |
| 71 | + {{ $t('marketGoods.edit') }} | |
| 72 | + </el-button> | |
| 73 | + <el-button | |
| 74 | + size="mini" | |
| 75 | + type="danger" | |
| 76 | + @click="handleDelete(scope.row)" | |
| 77 | + > | |
| 78 | + {{ $t('marketGoods.delete') }} | |
| 79 | + </el-button> | |
| 80 | + </template> | |
| 81 | + </el-table-column> | |
| 82 | + </el-table> | |
| 83 | + | |
| 84 | + <el-pagination | |
| 85 | + :current-page.sync="pagination.current" | |
| 86 | + :page-sizes="[10, 20, 30, 50]" | |
| 87 | + :page-size="pagination.size" | |
| 88 | + :total="pagination.total" | |
| 89 | + layout="total, sizes, prev, pager, next, jumper" | |
| 90 | + @size-change="handleSizeChange" | |
| 91 | + @current-change="handleCurrentChange" | |
| 92 | + /> | |
| 93 | + </el-card> | |
| 94 | + | |
| 95 | + <add-market-goods ref="addMarketGoods" @success="handleSuccess" /> | |
| 96 | + <edit-market-goods ref="editMarketGoods" @success="handleSuccess" /> | |
| 97 | + <delete-market-goods ref="deleteMarketGoods" @success="handleSuccess" /> | |
| 98 | + </div> | |
| 99 | +</template> | |
| 100 | + | |
| 101 | +<script> | |
| 102 | +import { listMarketGoods } from '@/api/market/marketWayApi' | |
| 103 | +import AddMarketGoods from './AddMarketGoods' | |
| 104 | +import EditMarketGoods from './EditMarketGoods' | |
| 105 | +import DeleteMarketGoods from './DeleteMarketGoods' | |
| 106 | + | |
| 107 | +export default { | |
| 108 | + name: 'MarketWayGoods', | |
| 109 | + data() { | |
| 110 | + return { | |
| 111 | + loading: false, | |
| 112 | + searchForm: { | |
| 113 | + name: '' | |
| 114 | + }, | |
| 115 | + tableData: [], | |
| 116 | + pagination: { | |
| 117 | + current: 1, | |
| 118 | + size: 10, | |
| 119 | + total: 0 | |
| 120 | + } | |
| 121 | + } | |
| 122 | + }, | |
| 123 | + components: { | |
| 124 | + AddMarketGoods, | |
| 125 | + EditMarketGoods, | |
| 126 | + DeleteMarketGoods | |
| 127 | + }, | |
| 128 | + created() { | |
| 129 | + this.getList() | |
| 130 | + }, | |
| 131 | + methods: { | |
| 132 | + async getList() { | |
| 133 | + try { | |
| 134 | + this.loading = true | |
| 135 | + const params = { | |
| 136 | + page: this.pagination.current, | |
| 137 | + row: this.pagination.size, | |
| 138 | + ...this.searchForm | |
| 139 | + } | |
| 140 | + const { data, total } = await listMarketGoods(params) | |
| 141 | + this.tableData = data | |
| 142 | + this.pagination.total = total | |
| 143 | + } catch (error) { | |
| 144 | + this.$message.error(error.message) | |
| 145 | + } finally { | |
| 146 | + this.loading = false | |
| 147 | + } | |
| 148 | + }, | |
| 149 | + handleSearch() { | |
| 150 | + this.pagination.current = 1 | |
| 151 | + this.getList() | |
| 152 | + }, | |
| 153 | + handleAdd() { | |
| 154 | + this.$refs.addMarketGoods.open() | |
| 155 | + }, | |
| 156 | + handleEdit(row) { | |
| 157 | + this.$refs.editMarketGoods.open(row) | |
| 158 | + }, | |
| 159 | + handleDelete(row) { | |
| 160 | + this.$refs.deleteMarketGoods.open(row) | |
| 161 | + }, | |
| 162 | + handleViewGoods(row) { | |
| 163 | + this.$router.push(`/market/goods-item?goodsId=${row.goodsId}`) | |
| 164 | + }, | |
| 165 | + handleSuccess() { | |
| 166 | + this.getList() | |
| 167 | + }, | |
| 168 | + handleSizeChange(val) { | |
| 169 | + this.pagination.size = val | |
| 170 | + this.getList() | |
| 171 | + }, | |
| 172 | + handleCurrentChange(val) { | |
| 173 | + this.pagination.current = val | |
| 174 | + this.getList() | |
| 175 | + }, | |
| 176 | + refreshList() { | |
| 177 | + this.pagination.current = 1 | |
| 178 | + this.getList() | |
| 179 | + } | |
| 180 | + } | |
| 181 | +} | |
| 182 | +</script> | |
| 183 | + | |
| 184 | +<style lang="scss" scoped> | |
| 185 | +.market-goods-container { | |
| 186 | + .search-wrapper { | |
| 187 | + margin-bottom: 20px; | |
| 188 | + } | |
| 189 | + | |
| 190 | + .el-pagination { | |
| 191 | + margin-top: 20px; | |
| 192 | + text-align: right; | |
| 193 | + } | |
| 194 | +} | |
| 195 | +</style> | |
| 0 | 196 | \ No newline at end of file | ... | ... |
src/components/market/MarketWayPic.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="market-pic-container"> | |
| 3 | + <el-card> | |
| 4 | + <div class="search-wrapper"> | |
| 5 | + <el-row :gutter="20"> | |
| 6 | + <el-col :span="6"> | |
| 7 | + <el-input v-model="searchForm.name" :placeholder="$t('marketPic.name')" clearable | |
| 8 | + @keyup.enter.native="handleSearch" /> | |
| 9 | + </el-col> | |
| 10 | + <el-col :span="6"> | |
| 11 | + <el-button type="primary" @click="handleSearch"> | |
| 12 | + {{ $t('marketPic.search') }} | |
| 13 | + </el-button> | |
| 14 | + <el-button type="primary" @click="handleAdd"> | |
| 15 | + {{ $t('marketPic.add') }} | |
| 16 | + </el-button> | |
| 17 | + </el-col> | |
| 18 | + </el-row> | |
| 19 | + </div> | |
| 20 | + | |
| 21 | + <el-table v-loading="loading" :data="tableData" border style="width: 100%"> | |
| 22 | + <el-table-column :label="$t('marketPic.image')" align="center" width="120"> | |
| 23 | + <template slot-scope="scope"> | |
| 24 | + <el-image v-if="scope.row.picUrl" style="width: 60px; height: 60px; cursor: pointer; border-radius: 4px;" | |
| 25 | + :src="scope.row.picUrl" :preview-src-list="[scope.row.picUrl]" fit="cover" /> | |
| 26 | + <span v-else>-</span> | |
| 27 | + </template> | |
| 28 | + </el-table-column> | |
| 29 | + <el-table-column prop="name" :label="$t('marketPic.name')" align="center" /> | |
| 30 | + <el-table-column prop="picLink" :label="$t('marketPic.url')" align="center" /> | |
| 31 | + <el-table-column prop="createTime" :label="$t('marketPic.createTime')" align="center" /> | |
| 32 | + <el-table-column prop="remark" :label="$t('marketPic.remark')" align="center" /> | |
| 33 | + <el-table-column :label="$t('marketPic.operation')" align="center" width="200"> | |
| 34 | + <template slot-scope="scope"> | |
| 35 | + <el-button size="mini" type="primary" @click="handleEdit(scope.row)"> | |
| 36 | + {{ $t('marketPic.edit') }} | |
| 37 | + </el-button> | |
| 38 | + <el-button size="mini" type="danger" @click="handleDelete(scope.row)"> | |
| 39 | + {{ $t('marketPic.delete') }} | |
| 40 | + </el-button> | |
| 41 | + </template> | |
| 42 | + </el-table-column> | |
| 43 | + </el-table> | |
| 44 | + | |
| 45 | + <el-pagination :current-page.sync="pagination.current" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.size" | |
| 46 | + :total="pagination.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | |
| 47 | + @current-change="handleCurrentChange" /> | |
| 48 | + </el-card> | |
| 49 | + | |
| 50 | + <add-market-pic ref="addMarketPic" @success="handleSuccess" /> | |
| 51 | + <edit-market-pic ref="editMarketPic" @success="handleSuccess" /> | |
| 52 | + <delete-market-pic ref="deleteMarketPic" @success="handleSuccess" /> | |
| 53 | + </div> | |
| 54 | +</template> | |
| 55 | + | |
| 56 | +<script> | |
| 57 | +import { listMarketPic } from '@/api/market/marketWayApi' | |
| 58 | +import AddMarketPic from './AddMarketPic' | |
| 59 | +import EditMarketPic from './EditMarketPic' | |
| 60 | +import DeleteMarketPic from './DeleteMarketPic' | |
| 61 | + | |
| 62 | +export default { | |
| 63 | + name: 'MarketWayPic', | |
| 64 | + data() { | |
| 65 | + return { | |
| 66 | + loading: false, | |
| 67 | + searchForm: { | |
| 68 | + name: '' | |
| 69 | + }, | |
| 70 | + tableData: [], | |
| 71 | + pagination: { | |
| 72 | + current: 1, | |
| 73 | + size: 10, | |
| 74 | + total: 0 | |
| 75 | + } | |
| 76 | + } | |
| 77 | + }, | |
| 78 | + components: { | |
| 79 | + AddMarketPic, | |
| 80 | + EditMarketPic, | |
| 81 | + DeleteMarketPic | |
| 82 | + }, | |
| 83 | + created() { | |
| 84 | + this.getList() | |
| 85 | + }, | |
| 86 | + methods: { | |
| 87 | + async getList() { | |
| 88 | + try { | |
| 89 | + this.loading = true | |
| 90 | + const params = { | |
| 91 | + page: this.pagination.current, | |
| 92 | + row: this.pagination.size, | |
| 93 | + ...this.searchForm | |
| 94 | + } | |
| 95 | + const { data, total } = await listMarketPic(params) | |
| 96 | + this.tableData = data | |
| 97 | + this.pagination.total = total | |
| 98 | + } catch (error) { | |
| 99 | + this.$message.error(error.message) | |
| 100 | + } finally { | |
| 101 | + this.loading = false | |
| 102 | + } | |
| 103 | + }, | |
| 104 | + handleSearch() { | |
| 105 | + this.pagination.current = 1 | |
| 106 | + this.getList() | |
| 107 | + }, | |
| 108 | + handleAdd() { | |
| 109 | + this.$refs.addMarketPic.open() | |
| 110 | + }, | |
| 111 | + handleEdit(row) { | |
| 112 | + this.$refs.editMarketPic.open(row) | |
| 113 | + }, | |
| 114 | + handleDelete(row) { | |
| 115 | + this.$refs.deleteMarketPic.open(row) | |
| 116 | + }, | |
| 117 | + handleSuccess() { | |
| 118 | + this.getList() | |
| 119 | + }, | |
| 120 | + handleSizeChange(val) { | |
| 121 | + this.pagination.size = val | |
| 122 | + this.getList() | |
| 123 | + }, | |
| 124 | + handleCurrentChange(val) { | |
| 125 | + this.pagination.current = val | |
| 126 | + this.getList() | |
| 127 | + }, | |
| 128 | + refreshList() { | |
| 129 | + this.pagination.current = 1 | |
| 130 | + this.getList() | |
| 131 | + } | |
| 132 | + } | |
| 133 | +} | |
| 134 | +</script> | |
| 135 | + | |
| 136 | +<style lang="scss" scoped> | |
| 137 | +.market-pic-container { | |
| 138 | + .search-wrapper { | |
| 139 | + margin-bottom: 20px; | |
| 140 | + } | |
| 141 | + | |
| 142 | + .el-pagination { | |
| 143 | + margin-top: 20px; | |
| 144 | + text-align: right; | |
| 145 | + } | |
| 146 | +} | |
| 147 | +</style> | |
| 0 | 148 | \ No newline at end of file | ... | ... |
src/components/market/MarketWayText.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="market-text-container"> | |
| 3 | + <el-card> | |
| 4 | + <div class="search-wrapper"> | |
| 5 | + <el-row :gutter="20"> | |
| 6 | + <el-col :span="6"> | |
| 7 | + <el-input v-model="searchForm.name" :placeholder="$t('marketText.name')" clearable | |
| 8 | + @keyup.enter.native="handleSearch" /> | |
| 9 | + </el-col> | |
| 10 | + <el-col :span="6"> | |
| 11 | + <el-select v-model="searchForm.sendRate" :placeholder="$t('marketText.sendRate')" clearable> | |
| 12 | + <el-option v-for="item in sendRateOptions" :key="item.value" :label="item.label" :value="item.value" /> | |
| 13 | + </el-select> | |
| 14 | + </el-col> | |
| 15 | + <el-col :span="6"> | |
| 16 | + <el-button type="primary" @click="handleSearch"> | |
| 17 | + {{ $t('marketText.search') }} | |
| 18 | + </el-button> | |
| 19 | + <el-button type="primary" @click="handleAdd"> | |
| 20 | + {{ $t('marketText.add') }} | |
| 21 | + </el-button> | |
| 22 | + </el-col> | |
| 23 | + </el-row> | |
| 24 | + </div> | |
| 25 | + | |
| 26 | + <el-table v-loading="loading" :data="tableData" border style="width: 100%"> | |
| 27 | + <el-table-column prop="name" :label="$t('marketText.name')" align="center" /> | |
| 28 | + <el-table-column prop="sendRateName" :label="$t('marketText.sendRate')" align="center" /> | |
| 29 | + <el-table-column prop="textContent" :label="$t('marketText.content')" align="center" /> | |
| 30 | + <el-table-column prop="smsName" :label="$t('marketText.config')" align="center" /> | |
| 31 | + <el-table-column prop="createTime" :label="$t('marketText.createTime')" align="center" /> | |
| 32 | + <el-table-column :label="$t('marketText.operation')" align="center" width="200"> | |
| 33 | + <template slot-scope="scope"> | |
| 34 | + <el-button size="mini" type="primary" @click="handleEdit(scope.row)"> | |
| 35 | + {{ $t('marketText.edit') }} | |
| 36 | + </el-button> | |
| 37 | + <el-button size="mini" type="danger" @click="handleDelete(scope.row)"> | |
| 38 | + {{ $t('marketText.delete') }} | |
| 39 | + </el-button> | |
| 40 | + </template> | |
| 41 | + </el-table-column> | |
| 42 | + </el-table> | |
| 43 | + | |
| 44 | + <el-pagination :current-page.sync="pagination.current" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.size" | |
| 45 | + :total="pagination.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | |
| 46 | + @current-change="handleCurrentChange" /> | |
| 47 | + </el-card> | |
| 48 | + | |
| 49 | + <add-market-text ref="addMarketText" @success="handleSuccess" /> | |
| 50 | + <edit-market-text ref="editMarketText" @success="handleSuccess" /> | |
| 51 | + <delete-market-text ref="deleteMarketText" @success="handleSuccess" /> | |
| 52 | + </div> | |
| 53 | +</template> | |
| 54 | + | |
| 55 | +<script> | |
| 56 | +import { listMarketText } from '@/api/market/marketWayApi' | |
| 57 | +import AddMarketText from './AddMarketText' | |
| 58 | +import EditMarketText from './EditMarketText' | |
| 59 | +import DeleteMarketText from './DeleteMarketText' | |
| 60 | + | |
| 61 | +export default { | |
| 62 | + name: 'MarketWayText', | |
| 63 | + data() { | |
| 64 | + return { | |
| 65 | + loading: false, | |
| 66 | + searchForm: { | |
| 67 | + name: '', | |
| 68 | + sendRate: '' | |
| 69 | + }, | |
| 70 | + tableData: [], | |
| 71 | + pagination: { | |
| 72 | + current: 1, | |
| 73 | + size: 10, | |
| 74 | + total: 0 | |
| 75 | + }, | |
| 76 | + sendRateOptions: [ | |
| 77 | + { value: '1001', label: this.$t('marketText.sendRateOptions.daily') }, | |
| 78 | + { value: '2002', label: this.$t('marketText.sendRateOptions.monthly') }, | |
| 79 | + { value: '3003', label: this.$t('marketText.sendRateOptions.unlimited') } | |
| 80 | + ] | |
| 81 | + } | |
| 82 | + }, | |
| 83 | + components: { | |
| 84 | + AddMarketText, | |
| 85 | + EditMarketText, | |
| 86 | + DeleteMarketText | |
| 87 | + }, | |
| 88 | + created() { | |
| 89 | + this.getList() | |
| 90 | + }, | |
| 91 | + methods: { | |
| 92 | + async getList() { | |
| 93 | + try { | |
| 94 | + this.loading = true | |
| 95 | + const params = { | |
| 96 | + page: this.pagination.current, | |
| 97 | + row: this.pagination.size, | |
| 98 | + ...this.searchForm | |
| 99 | + } | |
| 100 | + const { data, total } = await listMarketText(params) | |
| 101 | + this.tableData = data | |
| 102 | + this.pagination.total = total | |
| 103 | + } catch (error) { | |
| 104 | + this.$message.error(error.message) | |
| 105 | + } finally { | |
| 106 | + this.loading = false | |
| 107 | + } | |
| 108 | + }, | |
| 109 | + handleSearch() { | |
| 110 | + this.pagination.current = 1 | |
| 111 | + this.getList() | |
| 112 | + }, | |
| 113 | + handleAdd() { | |
| 114 | + this.$refs.addMarketText.open() | |
| 115 | + }, | |
| 116 | + handleEdit(row) { | |
| 117 | + this.$refs.editMarketText.open(row) | |
| 118 | + }, | |
| 119 | + handleDelete(row) { | |
| 120 | + this.$refs.deleteMarketText.open(row) | |
| 121 | + }, | |
| 122 | + handleSuccess() { | |
| 123 | + this.getList() | |
| 124 | + }, | |
| 125 | + handleSizeChange(val) { | |
| 126 | + this.pagination.size = val | |
| 127 | + this.getList() | |
| 128 | + }, | |
| 129 | + handleCurrentChange(val) { | |
| 130 | + this.pagination.current = val | |
| 131 | + this.getList() | |
| 132 | + }, | |
| 133 | + refreshList() { | |
| 134 | + this.pagination.current = 1 | |
| 135 | + this.getList() | |
| 136 | + } | |
| 137 | + } | |
| 138 | +} | |
| 139 | +</script> | |
| 140 | + | |
| 141 | +<style lang="scss" scoped> | |
| 142 | +.market-text-container { | |
| 143 | + .search-wrapper { | |
| 144 | + margin-bottom: 20px; | |
| 145 | + | |
| 146 | + .el-select { | |
| 147 | + width: 100%; | |
| 148 | + } | |
| 149 | + } | |
| 150 | + | |
| 151 | + .el-pagination { | |
| 152 | + margin-top: 20px; | |
| 153 | + text-align: right; | |
| 154 | + } | |
| 155 | +} | |
| 156 | +</style> | |
| 0 | 157 | \ No newline at end of file | ... | ... |
src/components/upload/UploadImageUrl.vue
| ... | ... | @@ -51,15 +51,12 @@ export default { |
| 51 | 51 | try { |
| 52 | 52 | const formData = new FormData() |
| 53 | 53 | formData.append('uploadFile', file) |
| 54 | - formData.append('communityId', '-1') | |
| 54 | + formData.append('communityId', '-1') | |
| 55 | 55 | |
| 56 | - const res = await uploadFile(formData) | |
| 57 | - if (res.code === 0) { | |
| 58 | - this.photosUrl.push(res.data) | |
| 59 | - this.$emit('notifyUploadCoverImage', this.photosUrl) | |
| 60 | - } else { | |
| 61 | - this.$message.error(res.msg || '上传失败') | |
| 62 | - } | |
| 56 | + const { url } = await uploadFile(formData) | |
| 57 | + | |
| 58 | + this.photosUrl.push(url) | |
| 59 | + this.$emit('notifyUploadCoverImage', this.photosUrl) | |
| 63 | 60 | } catch (error) { |
| 64 | 61 | this.$message.error(error.message || '上传失败') |
| 65 | 62 | } |
| ... | ... | @@ -84,13 +81,11 @@ export default { |
| 84 | 81 | } |
| 85 | 82 | if (image.indexOf('http') > -1) { |
| 86 | 83 | this.photos.push(image) |
| 87 | - const fileId = this.getFileIdFromUrl(image) | |
| 88 | - if (fileId) { | |
| 89 | - this.photosUrl.push({ fileId, url: image }) | |
| 90 | - } | |
| 84 | + this.photosUrl.push(image) | |
| 85 | + | |
| 91 | 86 | return |
| 92 | 87 | } |
| 93 | - this.photosUrl.push({ fileId: image, url: '' }) | |
| 88 | + this.photosUrl.push(image) | |
| 94 | 89 | }) |
| 95 | 90 | } |
| 96 | 91 | } | ... | ... |
src/i18n/index.js
| ... | ... | @@ -97,6 +97,7 @@ import { messages as storeOrderCartReturnMessages } from '../views/mall/storeOrd |
| 97 | 97 | import { messages as userIntegralMessages } from '../views/mall/userIntegralLang' |
| 98 | 98 | import { messages as integralDetailMessages } from '../views/mall/integralDetailLang' |
| 99 | 99 | import { messages as marketSmsManageMessages } from '../views/market/marketSmsManageLang' |
| 100 | +import { messages as marketWayMessages } from '../views/market/marketWayLang' | |
| 100 | 101 | |
| 101 | 102 | Vue.use(VueI18n) |
| 102 | 103 | |
| ... | ... | @@ -198,6 +199,7 @@ const messages = { |
| 198 | 199 | ...userIntegralMessages.en, |
| 199 | 200 | ...integralDetailMessages.en, |
| 200 | 201 | ...marketSmsManageMessages.en, |
| 202 | + ...marketWayMessages.en, | |
| 201 | 203 | }, |
| 202 | 204 | zh: { |
| 203 | 205 | ...loginMessages.zh, |
| ... | ... | @@ -295,6 +297,7 @@ const messages = { |
| 295 | 297 | ...userIntegralMessages.zh, |
| 296 | 298 | ...integralDetailMessages.zh, |
| 297 | 299 | ...marketSmsManageMessages.zh, |
| 300 | + ...marketWayMessages.zh, | |
| 298 | 301 | } |
| 299 | 302 | } |
| 300 | 303 | ... | ... |
src/router/index.js
| ... | ... | @@ -471,6 +471,11 @@ const routes = [ |
| 471 | 471 | name:'/pages/admin/marketSmsManage', |
| 472 | 472 | component: () => import('@/views/market/marketSmsManageList.vue') |
| 473 | 473 | }, |
| 474 | + { | |
| 475 | + path:'/pages/admin/marketWay', | |
| 476 | + name:'/pages/admin/marketWay', | |
| 477 | + component: () => import('@/views/market/marketWayList.vue') | |
| 478 | + }, | |
| 474 | 479 | // 其他子路由可以在这里添加 |
| 475 | 480 | ] |
| 476 | 481 | }, | ... | ... |
src/views/market/marketWayLang.js
0 → 100644
| 1 | +export const messages = { | |
| 2 | + en: { | |
| 3 | + marketWay: { | |
| 4 | + title: 'Marketing Management', | |
| 5 | + tabText: 'Marketing Text', | |
| 6 | + tabPic: 'Marketing Image', | |
| 7 | + tabGoods: 'Marketing Goods' | |
| 8 | + }, | |
| 9 | + marketText: { | |
| 10 | + title: 'Marketing Text Management', | |
| 11 | + name: 'Name', | |
| 12 | + sendRate: 'Send Rate', | |
| 13 | + content: 'Content', | |
| 14 | + config: 'Marketing Config', | |
| 15 | + createTime: 'Create Time', | |
| 16 | + operation: 'Operation', | |
| 17 | + edit: 'Edit', | |
| 18 | + delete: 'Delete', | |
| 19 | + add: 'Add', | |
| 20 | + search: 'Search', | |
| 21 | + sendRateOptions: { | |
| 22 | + daily: 'Daily', | |
| 23 | + monthly: 'Monthly', | |
| 24 | + unlimited: 'Unlimited' | |
| 25 | + } | |
| 26 | + }, | |
| 27 | + marketPic: { | |
| 28 | + title: 'Marketing Image Management', | |
| 29 | + image: 'Image', | |
| 30 | + name: 'Name', | |
| 31 | + url: 'URL', | |
| 32 | + createTime: 'Create Time', | |
| 33 | + remark: 'Remark', | |
| 34 | + operation: 'Operation', | |
| 35 | + edit: 'Edit', | |
| 36 | + delete: 'Delete', | |
| 37 | + add: 'Add', | |
| 38 | + search: 'Search' | |
| 39 | + }, | |
| 40 | + marketGoods: { | |
| 41 | + title: 'Marketing Goods Management', | |
| 42 | + name: 'Name', | |
| 43 | + goodsCount: 'Goods Count', | |
| 44 | + createTime: 'Create Time', | |
| 45 | + remark: 'Remark', | |
| 46 | + operation: 'Operation', | |
| 47 | + edit: 'Edit', | |
| 48 | + delete: 'Delete', | |
| 49 | + add: 'Add', | |
| 50 | + search: 'Search', | |
| 51 | + viewGoods: 'View Goods' | |
| 52 | + } | |
| 53 | + }, | |
| 54 | + zh: { | |
| 55 | + marketWay: { | |
| 56 | + title: '营销管理', | |
| 57 | + tabText: '营销文本', | |
| 58 | + tabPic: '营销图片', | |
| 59 | + tabGoods: '营销商品' | |
| 60 | + }, | |
| 61 | + marketText: { | |
| 62 | + title: '营销文本管理', | |
| 63 | + name: '名称', | |
| 64 | + sendRate: '发送频率', | |
| 65 | + content: '内容', | |
| 66 | + config: '营销配置', | |
| 67 | + createTime: '创建时间', | |
| 68 | + operation: '操作', | |
| 69 | + edit: '修改', | |
| 70 | + delete: '删除', | |
| 71 | + add: '添加', | |
| 72 | + search: '查询', | |
| 73 | + sendRateOptions: { | |
| 74 | + daily: '按天', | |
| 75 | + monthly: '按月', | |
| 76 | + unlimited: '不限制' | |
| 77 | + } | |
| 78 | + }, | |
| 79 | + marketPic: { | |
| 80 | + title: '营销图片管理', | |
| 81 | + image: '图片', | |
| 82 | + name: '名称', | |
| 83 | + url: '访问地址', | |
| 84 | + createTime: '创建时间', | |
| 85 | + remark: '备注', | |
| 86 | + operation: '操作', | |
| 87 | + edit: '修改', | |
| 88 | + delete: '删除', | |
| 89 | + add: '添加', | |
| 90 | + search: '查询' | |
| 91 | + }, | |
| 92 | + marketGoods: { | |
| 93 | + title: '营销商品管理', | |
| 94 | + name: '名称', | |
| 95 | + goodsCount: '商品数', | |
| 96 | + createTime: '创建时间', | |
| 97 | + remark: '备注', | |
| 98 | + operation: '操作', | |
| 99 | + edit: '修改', | |
| 100 | + delete: '删除', | |
| 101 | + add: '添加', | |
| 102 | + search: '查询', | |
| 103 | + viewGoods: '查看商品' | |
| 104 | + } | |
| 105 | + } | |
| 106 | +} | |
| 0 | 107 | \ No newline at end of file | ... | ... |
src/views/market/marketWayList.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="market-way-container"> | |
| 3 | + <el-card> | |
| 4 | + <div class="header flex justify-between"> | |
| 5 | + <span>{{ $t('marketWay.title') }}</span> | |
| 6 | + </div> | |
| 7 | + | |
| 8 | + <el-tabs v-model="activeTab" @tab-click="handleTabClick(activeTab)"> | |
| 9 | + <el-tab-pane :label="$t('marketWay.tabText')" name="marketWayText"> | |
| 10 | + <market-way-text ref="marketWayText" /> | |
| 11 | + </el-tab-pane> | |
| 12 | + <el-tab-pane :label="$t('marketWay.tabPic')" name="marketWayPic"> | |
| 13 | + <market-way-pic ref="marketWayPic" /> | |
| 14 | + </el-tab-pane> | |
| 15 | + <el-tab-pane :label="$t('marketWay.tabGoods')" name="marketWayGoods"> | |
| 16 | + <market-way-goods ref="marketWayGoods" /> | |
| 17 | + </el-tab-pane> | |
| 18 | + </el-tabs> | |
| 19 | + </el-card> | |
| 20 | + | |
| 21 | + <view-image ref="viewImage" /> | |
| 22 | + </div> | |
| 23 | +</template> | |
| 24 | + | |
| 25 | +<script> | |
| 26 | +import MarketWayText from '@/components/market/MarketWayText' | |
| 27 | +import MarketWayPic from '@/components/market/MarketWayPic' | |
| 28 | +import MarketWayGoods from '@/components/market/MarketWayGoods' | |
| 29 | +import ViewImage from '@/components/community/viewImage' | |
| 30 | + | |
| 31 | +export default { | |
| 32 | + name: 'MarketWayList', | |
| 33 | + components: { | |
| 34 | + MarketWayText, | |
| 35 | + MarketWayPic, | |
| 36 | + MarketWayGoods, | |
| 37 | + ViewImage | |
| 38 | + }, | |
| 39 | + data() { | |
| 40 | + return { | |
| 41 | + activeTab: 'marketWayText' | |
| 42 | + } | |
| 43 | + }, | |
| 44 | + methods: { | |
| 45 | + handleTabClick(tab) { | |
| 46 | + setTimeout(() => { | |
| 47 | + this.$refs[tab].refreshList() | |
| 48 | + | |
| 49 | + }, 500); | |
| 50 | + } | |
| 51 | + } | |
| 52 | +} | |
| 53 | +</script> | |
| 54 | + | |
| 55 | +<style lang="scss" scoped> | |
| 56 | +.market-way-container { | |
| 57 | + padding: 20px; | |
| 58 | + | |
| 59 | + .header { | |
| 60 | + margin-bottom: 20px; | |
| 61 | + text-align: center; | |
| 62 | + } | |
| 63 | +} | |
| 64 | +</style> | |
| 0 | 65 | \ No newline at end of file | ... | ... |