Browse Source

1.4.4版本,新增模板消息通知、H5端商家管理发货修改及其列表时间显示修复

master
hupeng 5 years ago
parent
commit
c69b599781
  1. 32
      src/api/yxWechatTemplate.js
  2. 24
      src/api/yxWechatUser.js
  3. 1
      src/icons/svg/temp.svg
  4. 112
      src/views/wechat/template/form.vue
  5. 131
      src/views/wechat/template/index.vue
  6. 199
      src/views/wechat/user/form.vue
  7. 158
      src/views/wechat/user/index.vue

32
src/api/yxWechatTemplate.js

@ -0,0 +1,32 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxWechatTemplate',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/yxWechatTemplate/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxWechatTemplate',
method: 'put',
data
})
}
export function get() {
return request({
url: 'api/yxWechatTemplate',
method: 'get',
})
}

24
src/api/yxWechatUser.js

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/yxWechatUser',
method: 'post',
data
})
}
export function del(uid) {
return request({
url: 'api/yxWechatUser/' + uid,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/yxWechatUser',
method: 'put',
data
})
}

1
src/icons/svg/temp.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1576229286875" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2520" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M64 127.712C64 92.512 92.864 64 128.288 64h255.424C419.232 64 448 92.8 448 127.712V896.32c0 35.2-28.864 63.712-64.288 63.712H128.32C92.768 960 64 931.2 64 896.288V127.68z m64 32.32v703.936c0 17.728 14.272 32.032 31.904 32.032h192.192c17.408 0 31.904-14.336 31.904-32V160c0-17.696-14.272-32-31.904-32H159.904C142.496 128 128 142.336 128 160z m384-31.744C512 92.768 540.704 64 576.192 64h319.616C931.264 64 960 92.864 960 128.288v255.424c0 35.52-28.704 64.288-64.192 64.288h-319.616A64.288 64.288 0 0 1 512 383.712V128.32z m64 31.616v192.192a32 32 0 0 0 31.84 31.904h256.32c17.28 0 31.84-14.272 31.84-31.904V159.904A32 32 0 0 0 864.16 128h-256.32c-17.28 0-31.84 14.272-31.84 31.904z m-64 416.288c0-35.456 28.704-64.192 64.192-64.192h319.616c35.456 0 64.192 28.704 64.192 64.192v319.616A64.16 64.16 0 0 1 895.808 960h-319.616A64.16 64.16 0 0 1 512 895.808v-319.616z m64 31.68v256.288c0 17.28 14.272 31.84 31.84 31.84h256.32c17.28 0 31.84-14.272 31.84-31.84v-256.32c0-17.28-14.272-31.84-31.84-31.84h-256.32c-17.28 0-31.84 14.272-31.84 31.84z" fill="#333333" p-id="2521"></path></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

112
src/views/wechat/template/form.vue

@ -0,0 +1,112 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="模板编号" >
<el-input v-model="form.tempkey" style="width: 370px;"/>
</el-form-item>
<el-form-item label="模板名" >
<el-input v-model="form.name" style="width: 370px;"/>
</el-form-item>
<el-form-item label="回复内容" >
<el-input v-model="form.content" style="width: 370px;" rows="5" type="textarea"/>
</el-form-item>
<el-form-item label="模板ID" >
<el-input v-model="form.tempid" style="width: 370px;"/>
</el-form-item>
<el-form-item label="状态" >
<el-radio v-model="form.status" :label="1">可用</el-radio>
<el-radio v-model="form.status" :label="0">禁用</el-radio>
</el-form-item>
</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 { add, edit } from '@/api/yxWechatTemplate'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
tempkey: '',
name: '',
content: '',
tempid: '',
addTime: '',
status: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
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: '',
tempkey: '',
name: '',
content: '',
tempid: '',
addTime: '',
status: ''
}
}
}
}
</script>
<style scoped>
</style>

131
src/views/wechat/template/index.vue

@ -0,0 +1,131 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['ADMIN','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add">新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd"/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="模板id"/>
<el-table-column prop="tempkey" label="模板编号"/>
<el-table-column prop="name" label="模板名"/>
<el-table-column prop="content" label="回复内容"/>
<el-table-column prop="tempid" label="模板ID"/>
<el-table-column prop="status" label="状态">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status === 1" :type="''">可用</el-tag>
<el-tag v-else :type=" 'info' ">禁用</el-tag>
</div>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['ADMIN','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_EDIT','YXWECHATTEMPLATE_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['ADMIN','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
<el-popover
v-permission="['ADMIN','YXWECHATTEMPLATE_ALL','YXWECHATTEMPLATE_DELETE']"
:ref="scope.row.id"
placement="top"
width="180">
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>
</el-popover>
</template>
</el-table-column>
</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"/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/initData'
import { del } from '@/api/yxWechatTemplate'
import eForm from './form'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'api/yxWechatTemplate'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
tempkey: data.tempkey,
name: data.name,
content: data.content,
tempid: data.tempid,
addTime: data.addTime,
status: data.status
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>

199
src/views/wechat/user/form.vue

@ -0,0 +1,199 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段" >
<el-input v-model="form.unionid" style="width: 370px;"/>
</el-form-item>
<el-form-item label="用户的标识,对当前公众号唯一" >
<el-input v-model="form.openid" style="width: 370px;"/>
</el-form-item>
<el-form-item label="小程序唯一身份ID" >
<el-input v-model="form.routineOpenid" style="width: 370px;"/>
</el-form-item>
<el-form-item label="用户的昵称" >
<el-input v-model="form.nickname" style="width: 370px;"/>
</el-form-item>
<el-form-item label="用户头像" >
<el-input v-model="form.headimgurl" style="width: 370px;"/>
</el-form-item>
<el-form-item label="用户的性别,值为1时是男性,值为2时是女性,值为0时是未知" >
<el-input v-model="form.sex" style="width: 370px;"/>
</el-form-item>
<el-form-item label="用户所在城市" >
<el-input v-model="form.city" style="width: 370px;"/>
</el-form-item>
<el-form-item label="用户的语言,简体中文为zh_CN" >
<el-input v-model="form.language" style="width: 370px;"/>
</el-form-item>
<el-form-item label="用户所在省份" >
<el-input v-model="form.province" style="width: 370px;"/>
</el-form-item>
<el-form-item label="用户所在国家" >
<el-input v-model="form.country" style="width: 370px;"/>
</el-form-item>
<el-form-item label="公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注" >
<el-input v-model="form.remark" style="width: 370px;"/>
</el-form-item>
<el-form-item label="用户所在的分组ID(兼容旧的用户分组接口)" >
<el-input v-model="form.groupid" style="width: 370px;"/>
</el-form-item>
<el-form-item label="用户被打上的标签ID列表" >
<el-input v-model="form.tagidList" style="width: 370px;"/>
</el-form-item>
<el-form-item label="用户是否订阅该公众号标识" >
<el-input v-model="form.subscribe" style="width: 370px;"/>
</el-form-item>
<el-form-item label="关注公众号时间" >
<el-input v-model="form.subscribeTime" style="width: 370px;"/>
</el-form-item>
<el-form-item label="添加时间" >
<el-input v-model="form.addTime" style="width: 370px;"/>
</el-form-item>
<el-form-item label="一级推荐人" >
<el-input v-model="form.stair" style="width: 370px;"/>
</el-form-item>
<el-form-item label="二级推荐人" >
<el-input v-model="form.second" style="width: 370px;"/>
</el-form-item>
<el-form-item label="一级推荐人订单" >
<el-input v-model="form.orderStair" style="width: 370px;"/>
</el-form-item>
<el-form-item label="二级推荐人订单" >
<el-input v-model="form.orderSecond" style="width: 370px;"/>
</el-form-item>
<el-form-item label="佣金" >
<el-input v-model="form.nowMoney" style="width: 370px;"/>
</el-form-item>
<el-form-item label="小程序用户会话密匙" >
<el-input v-model="form.sessionKey" style="width: 370px;"/>
</el-form-item>
<el-form-item label="用户类型" >
<el-input v-model="form.userType" style="width: 370px;"/>
</el-form-item>
</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 { add, edit } from '@/api/yxWechatUser'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
uid: '',
unionid: '',
openid: '',
routineOpenid: '',
nickname: '',
headimgurl: '',
sex: '',
city: '',
language: '',
province: '',
country: '',
remark: '',
groupid: '',
tagidList: '',
subscribe: '',
subscribeTime: '',
addTime: '',
stair: '',
second: '',
orderStair: '',
orderSecond: '',
nowMoney: '',
sessionKey: '',
userType: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
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 = {
uid: '',
unionid: '',
openid: '',
routineOpenid: '',
nickname: '',
headimgurl: '',
sex: '',
city: '',
language: '',
province: '',
country: '',
remark: '',
groupid: '',
tagidList: '',
subscribe: '',
subscribeTime: '',
addTime: '',
stair: '',
second: '',
orderStair: '',
orderSecond: '',
nowMoney: '',
sessionKey: '',
userType: ''
}
}
}
}
</script>
<style scoped>
</style>

158
src/views/wechat/user/index.vue

@ -0,0 +1,158 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['ADMIN','YXWECHATUSER_ALL','YXWECHATUSER_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add">新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd"/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="uid" label="微信用户id"/>
<el-table-column prop="unionid" label="只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段"/>
<el-table-column prop="openid" label="用户的标识,对当前公众号唯一"/>
<el-table-column prop="routineOpenid" label="小程序唯一身份ID"/>
<el-table-column prop="nickname" label="用户的昵称"/>
<el-table-column prop="headimgurl" label="用户头像"/>
<el-table-column prop="sex" label="用户的性别,值为1时是男性,值为2时是女性,值为0时是未知"/>
<el-table-column prop="city" label="用户所在城市"/>
<el-table-column prop="language" label="用户的语言,简体中文为zh_CN"/>
<el-table-column prop="province" label="用户所在省份"/>
<el-table-column prop="country" label="用户所在国家"/>
<el-table-column prop="remark" label="公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注"/>
<el-table-column prop="groupid" label="用户所在的分组ID(兼容旧的用户分组接口)"/>
<el-table-column prop="tagidList" label="用户被打上的标签ID列表"/>
<el-table-column prop="subscribe" label="用户是否订阅该公众号标识"/>
<el-table-column prop="subscribeTime" label="关注公众号时间"/>
<el-table-column prop="addTime" label="添加时间"/>
<el-table-column prop="stair" label="一级推荐人"/>
<el-table-column prop="second" label="二级推荐人"/>
<el-table-column prop="orderStair" label="一级推荐人订单"/>
<el-table-column prop="orderSecond" label="二级推荐人订单"/>
<el-table-column prop="nowMoney" label="佣金"/>
<el-table-column prop="sessionKey" label="小程序用户会话密匙"/>
<el-table-column prop="userType" label="用户类型"/>
<el-table-column v-if="checkPermission(['ADMIN','YXWECHATUSER_ALL','YXWECHATUSER_EDIT','YXWECHATUSER_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['ADMIN','YXWECHATUSER_ALL','YXWECHATUSER_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
<el-popover
v-permission="['ADMIN','YXWECHATUSER_ALL','YXWECHATUSER_DELETE']"
:ref="scope.row.uid"
placement="top"
width="180">
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.uid].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.uid)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>
</el-popover>
</template>
</el-table-column>
</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"/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/initData'
import { del } from '@/api/yxWechatUser'
import eForm from './form'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'api/yxWechatUser'
const sort = 'uid,desc'
this.params = { page: this.page, size: this.size, sort: sort }
return true
},
subDelete(uid) {
this.delLoading = true
del(uid).then(res => {
this.delLoading = false
this.$refs[uid].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[uid].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
uid: data.uid,
unionid: data.unionid,
openid: data.openid,
routineOpenid: data.routineOpenid,
nickname: data.nickname,
headimgurl: data.headimgurl,
sex: data.sex,
city: data.city,
language: data.language,
province: data.province,
country: data.country,
remark: data.remark,
groupid: data.groupid,
tagidList: data.tagidList,
subscribe: data.subscribe,
subscribeTime: data.subscribeTime,
addTime: data.addTime,
stair: data.stair,
second: data.second,
orderStair: data.orderStair,
orderSecond: data.orderSecond,
nowMoney: data.nowMoney,
sessionKey: data.sessionKey,
userType: data.userType
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save