商品增加链接图
This commit is contained in:
@@ -0,0 +1,211 @@
|
||||
<template>
|
||||
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog"
|
||||
title="发放优惠券'" width="1200px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="优惠券ID">
|
||||
<el-input v-model="form.cid" style="width: 300px;" :disabled="true" />
|
||||
<el-input v-model="form.ctype" type="hidden" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="优惠券名称">
|
||||
<el-input v-model="form.cname" style="width: 300px;" :disabled="true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="选择会员">
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;"
|
||||
class="filter-item" @keyup.enter.native="toQuery" />
|
||||
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item"
|
||||
style="width: 130px">
|
||||
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name"
|
||||
:value="item.key" />
|
||||
</el-select>
|
||||
<el-select v-model="userType" clearable placeholder="用户来源" class="filter-item"
|
||||
style="width: 130px">
|
||||
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search"
|
||||
@click="toQuery">搜索
|
||||
</el-button>
|
||||
<!-- 新增 -->
|
||||
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-refresh"
|
||||
@click="toQuery">刷新
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column prop="uid" label="用户id" />
|
||||
<el-table-column prop="nickname" label="用户昵称" />
|
||||
<el-table-column ref="table" prop="avatar" label="用户头像">
|
||||
<template slot-scope="scope">
|
||||
<a :href="scope.row.avatar" style="color: #42b983" target="_blank"><img
|
||||
:src="scope.row.avatar" alt="点击打开" class="el-avatar"></a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="phone" label="手机号码" />
|
||||
<el-table-column prop="nowMoney" label="用户余额" />
|
||||
<el-table-column prop="createTime" label="创建日期" width="140">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div @click="onStatus(scope.row.uid, scope.row.status)">
|
||||
<el-tag v-if="scope.row.status == 1" style="cursor: pointer" :type="''">正常</el-tag>
|
||||
<el-tag v-else style="cursor: pointer" :type="'info'">禁用</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用户来源" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.userType == 'wechat'">公众号</el-tag>
|
||||
<el-tag v-else-if="scope.row.userType == 'routine'">小程序</el-tag>
|
||||
<el-tag v-else>H5</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="spreadUid" label="推荐人" /> -->
|
||||
<el-table-column prop="payCount" label="购买次数" />
|
||||
</el-table>
|
||||
<el-pagination :total="total" :current-page="page + 1" style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes" @size-change="sizeChange"
|
||||
@current-change="pageChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取消</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import { add, edit } from '@/api/bxg/yxStoreCouponIssue'
|
||||
import initData from '@/mixins/crud'
|
||||
export default {
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
userType: '',
|
||||
queryTypeOptions: [
|
||||
{ key: 'nickname', display_name: '用户昵称' },
|
||||
{ key: 'phone', display_name: '手机号码' }
|
||||
],
|
||||
statusOptions: [
|
||||
{ value: 'routine', label: '小程序' },
|
||||
{ value: 'wechat', label: '公众号' },
|
||||
{ value: 'H5', label: 'H5' }
|
||||
],
|
||||
loading: false,
|
||||
dialog: false,
|
||||
form: {
|
||||
id: '',
|
||||
cid: '',
|
||||
cname: '',
|
||||
ctype: 0,
|
||||
startTimeDate: '',
|
||||
endTimeDate: '',
|
||||
totalCount: 0,
|
||||
remainCount: 0,
|
||||
isPermanent: 0,
|
||||
status: 1,
|
||||
isDel: 0,
|
||||
addTime: ''
|
||||
},
|
||||
rules: {
|
||||
},
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(val){
|
||||
this.multipleSelection = val;
|
||||
console.log('this.multipleSelection',this.multipleSelection )
|
||||
},
|
||||
checkPermission,
|
||||
beforeInit() {
|
||||
this.url = 'bxg/api/yxUser'
|
||||
const sort = 'uid,desc'
|
||||
this.params = { page: this.page, size: this.size, sort: sort, userType: this.userType }
|
||||
const query = this.query
|
||||
const type = query.type
|
||||
const value = query.value
|
||||
if (type && value) { this.params[type] = value }
|
||||
return true
|
||||
},
|
||||
cancel() {
|
||||
// this.resetForm()
|
||||
this.dialog = false
|
||||
},
|
||||
doSubmit() {
|
||||
this.loading = true
|
||||
},
|
||||
doAdd() {
|
||||
add(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '添加成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
doEdit() {
|
||||
edit(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '修改成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
// resetForm() {
|
||||
// this.dialog = false
|
||||
// this.$refs['form'].resetFields()
|
||||
// this.form = {
|
||||
// id: '',
|
||||
// cid: '',
|
||||
// startTime: '',
|
||||
// endTime: '',
|
||||
// totalCount: '',
|
||||
// remainCount: '',
|
||||
// isPermanent: '',
|
||||
// status: '',
|
||||
// isDel: '',
|
||||
// addTime: ''
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<!--表单组件-->
|
||||
<eForm ref="form" :is-add="isAdd" />
|
||||
<eIForm ref="form2" :is-add="isAdd" />
|
||||
<vipForm ref="form3" />
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<!--<el-table-column prop="id" label="ID"/>-->
|
||||
@@ -65,6 +66,15 @@
|
||||
<el-dropdown size="mini" split-button type="primary" trigger="click">
|
||||
操作
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item>
|
||||
<el-button
|
||||
v-permission="['admin','YXSTORECOUPON_ALL','YXSTORECOUPON_EDIT']"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="edit3(scope.row)"
|
||||
>发放</el-button>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<el-button
|
||||
v-permission="['admin','YXSTORECOUPON_ALL','YXSTORECOUPON_EDIT']"
|
||||
@@ -111,10 +121,11 @@ import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
import { del } from '@/api/bxg/yxStoreCoupon'
|
||||
import eForm from './form'
|
||||
import vipForm from './form3'
|
||||
import eIForm from '../couponissue/form'
|
||||
import { formatTime } from '@/utils/index'
|
||||
export default {
|
||||
components: { eForm, eIForm },
|
||||
components: { eForm, eIForm,vipForm },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
@@ -192,6 +203,22 @@ export default {
|
||||
isDel: 0
|
||||
}
|
||||
_this.dialog = true
|
||||
},
|
||||
//向会员发放优惠券
|
||||
edit3(data) {
|
||||
this.isAdd = true
|
||||
const _this = this.$refs.form3
|
||||
_this.form = {
|
||||
cid: data.id,
|
||||
cname: data.title,
|
||||
ctype: data.type,
|
||||
isPermanent: 0,
|
||||
status: 1,
|
||||
totalCount: 0,
|
||||
remainCount: 0,
|
||||
isDel: 0
|
||||
}
|
||||
_this.dialog = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,11 +41,16 @@
|
||||
<el-input v-model="formValidate.store_info" type="textarea" :rows="3" placeholder="请输入商品简介" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="商品封面图:" prop="image">
|
||||
<single-pic v-model="formValidate.image" type="image" :num="1" :width="150" :height="150" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="链接封面图:" prop="image">
|
||||
<single-pic v-model="formValidate.linkImage" type="image" :num="1" :width="150" :height="150" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="商品轮播图:" prop="slider_image">
|
||||
<MaterialList v-model="formValidate.slider_image" type="image" :num="4" :width="150" :height="150" />
|
||||
@@ -531,6 +536,7 @@ export default {
|
||||
unit_name: '',
|
||||
store_info: '',
|
||||
image: '',
|
||||
linkImage:'',
|
||||
slider_image: [],
|
||||
description: '',
|
||||
ficti: 0,
|
||||
@@ -646,6 +652,12 @@ export default {
|
||||
console.log('bbbbbb:'+this.oneFormValidate.pic)
|
||||
}
|
||||
},
|
||||
'formValidate.linkImage': function(val) {
|
||||
console.log('aaaa:'+val)
|
||||
if (val) {
|
||||
this.formValidate.linkImage= val
|
||||
}
|
||||
},
|
||||
'form.sliderImageArr': function(val) {
|
||||
if (val) {
|
||||
this.form.slider_image = val.join(',')
|
||||
@@ -882,6 +894,9 @@ export default {
|
||||
if (data.config==undefined){
|
||||
data['config']=[]
|
||||
}
|
||||
if (data.linkImage==null){
|
||||
data.linkImage=''
|
||||
}
|
||||
that.editableTabs=data.config
|
||||
that.formValidate = data;
|
||||
that.formValidate.cate_id = cate_id;
|
||||
@@ -995,6 +1010,7 @@ export default {
|
||||
unit_name: '',
|
||||
store_info: '',
|
||||
image: '',
|
||||
linkImage:'',
|
||||
slider_image: [],
|
||||
description: '',
|
||||
ficti: 0,
|
||||
|
||||
Reference in New Issue
Block a user