|
|
@@ -3,10 +3,10 @@
|
|
|
<div>
|
|
|
<!-- 模板内容 -->
|
|
|
<el-form ref="queryForm" :inline="true" :model="queryform" label-width="100px" class="top-search">
|
|
|
- <el-form-item label="商品名称" >
|
|
|
+ <el-form-item label="商品名称">
|
|
|
<el-input v-model="queryform.productName" placeholder="请输入" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="状态" >
|
|
|
+ <el-form-item label="状态">
|
|
|
<el-select v-model="queryform.productStatus" placeholder="请选择状态" clearable filterable>
|
|
|
<el-option label="全部" value=" "></el-option>
|
|
|
<el-option label="上架" value="1"></el-option>
|
|
|
@@ -23,19 +23,19 @@
|
|
|
:showBatchDelete="false" :data="Result" :columns="Columns" @findPage="findPage">
|
|
|
<template slot="buttonSlot" slot-scope="{ row }">
|
|
|
<el-button type="text" @click="viewDetails(row)">查看</el-button>
|
|
|
- <el-button v-if="row.productStatus==1" type="text" @click="linkShare(row)">一键分享</el-button>
|
|
|
+ <el-button v-if="row.productStatus == 1" type="text" @click="linkShare(row)">一键分享</el-button>
|
|
|
</template>
|
|
|
</templateTable>
|
|
|
</div>
|
|
|
<el-dialog title="生成推广链接" :visible.sync="linkShareShow" width="40%">
|
|
|
<div class="flex a-c">
|
|
|
<span>推广链接</span>
|
|
|
- <el-input v-model="productLink" placeholder="请输入推广链接" clearable style="width: 70%;margin: 0 20px;"></el-input>
|
|
|
- <el-button @click="linkCopy()">复制</el-button>
|
|
|
+ <el-input v-model="productLink" placeholder="请输入推广链接" clearable style="width: 70%;margin: 0 20px;"></el-input>
|
|
|
+ <el-button @click="linkCopy()">复制</el-button>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="linkShareShow = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="linkShareShow=false">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="linkShareShow = false">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
@@ -52,12 +52,12 @@ export default {
|
|
|
// 数据存放区域
|
|
|
data() {
|
|
|
return {
|
|
|
- linkShareShow:false,//链接分享弹窗
|
|
|
+ linkShareShow: false,//链接分享弹窗
|
|
|
queryform: {
|
|
|
- productName:"",//商品名称
|
|
|
- productStatus:"",//上架状态
|
|
|
- pageNum:1,
|
|
|
- pageSize:10,
|
|
|
+ productName: "",//商品名称
|
|
|
+ productStatus: "",//上架状态
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
},//页面检索对象
|
|
|
form: {},//提交表单
|
|
|
rules: {
|
|
|
@@ -77,12 +77,12 @@ export default {
|
|
|
Columns: [
|
|
|
{ prop: "productName", label: "商品名称", minWidth: 180, },
|
|
|
{ prop: "categoryName", label: "商品类目", minWidth: 180, },
|
|
|
- { prop: "soldPrice", label: "价格", minWidth: 180, formatter: this.soldPriceFormatter},
|
|
|
+ { prop: "soldPrice", label: "价格", minWidth: 180, formatter: this.soldPriceFormatter },
|
|
|
{ prop: "merchantName", label: "商户名称", minWidth: 180 },
|
|
|
{ prop: "soldQuantity", label: "已售", minWidth: 180 },
|
|
|
- { prop: "productStatus", label: "状态", minWidth: 180,formatter: this.productStatusFormatter },
|
|
|
+ { prop: "productStatus", label: "状态", minWidth: 180, formatter: this.productStatusFormatter },
|
|
|
],
|
|
|
- productLink: '',
|
|
|
+ productLink: '',
|
|
|
}
|
|
|
},
|
|
|
// 生命周期函数
|
|
|
@@ -91,17 +91,17 @@ export default {
|
|
|
},
|
|
|
// 方法函数
|
|
|
methods: {
|
|
|
- soldPriceFormatter(row){
|
|
|
- return row.soldPrice+'元';
|
|
|
+ soldPriceFormatter(row) {
|
|
|
+ return row.soldPrice + '元';
|
|
|
},
|
|
|
- productStatusFormatter(row){
|
|
|
- return row.productStatus==0?"下架":"上架"
|
|
|
+ productStatusFormatter(row) {
|
|
|
+ return row.productStatus == 0 ? "下架" : "上架"
|
|
|
},
|
|
|
// 查看详情
|
|
|
viewDetails(row) {
|
|
|
this.$router.push({
|
|
|
path: 'commodityManageDetail',
|
|
|
- query: {id: row.productId },
|
|
|
+ query: { id: row.productId },
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
@@ -109,22 +109,22 @@ export default {
|
|
|
* @param row status 状态 true 已绑定 false 未绑定
|
|
|
*/
|
|
|
linkShare(row) {
|
|
|
- this.linkShareShow=true;
|
|
|
- if(row.type == 1) {
|
|
|
- this.productLink = `https://test.baoxianzhanggui.com/custh5/#/pages/mall/detail/details-food?productId=${row.productId}&merchantId=${row.merchantId}&categoryId=${row.categoryId}`
|
|
|
- } else if(row.type == 2) {
|
|
|
- this.productLink = `https://test.baoxianzhanggui.com/custh5/#/pages/mall/detail/details-service?productId=${row.productId}&merchantId=${row.merchantId}&categoryId=${row.categoryId}`
|
|
|
- }
|
|
|
+ this.linkShareShow = true;
|
|
|
+ if (row.type == 1) {
|
|
|
+ this.productLink = `https://open.weixin.qq.com/sns/getexpappinfo?appid=wxab9634bf98628a03&path=pages/mall/detail/details-food.html?productId=${row.productId}&merchantId=${row.merchantId}&categoryId=${row.categoryId}&env_version=develop#wechat-redirect`
|
|
|
+ } else if (row.type == 2) {
|
|
|
+ this.productLink = `https://open.weixin.qq.com/sns/getexpappinfo?appid=wxab9634bf98628a03&path=pages/mall/detail/details-service.html?productId=${row.productId}&merchantId=${row.merchantId}&categoryId=${row.categoryId}&env_version=develop#wechat-redirect`
|
|
|
+ }
|
|
|
},
|
|
|
linkCopy() {
|
|
|
- let inputs=document.createElement("input") //创建节点
|
|
|
- inputs.value=this.productLink //给节点赋值
|
|
|
- document.body.appendChild(inputs) //渲染节点(要不然不起作用,可以添加隐藏属性)
|
|
|
- inputs.select() //选中节点
|
|
|
- let actions = document.execCommand("Copy") //指定复制命令(返回的是一个boolean类型)
|
|
|
- if(this.productLink && actions) {
|
|
|
- this.$message.success('复制成功!')
|
|
|
- }
|
|
|
+ let inputs = document.createElement("input") //创建节点
|
|
|
+ inputs.value = this.productLink //给节点赋值
|
|
|
+ document.body.appendChild(inputs) //渲染节点(要不然不起作用,可以添加隐藏属性)
|
|
|
+ inputs.select() //选中节点
|
|
|
+ let actions = document.execCommand("Copy") //指定复制命令(返回的是一个boolean类型)
|
|
|
+ if (this.productLink && actions) {
|
|
|
+ this.$message.success('复制成功!')
|
|
|
+ }
|
|
|
},
|
|
|
async findPage(data) {
|
|
|
if (data && data.pageRequest) {
|
|
|
@@ -133,13 +133,13 @@ export default {
|
|
|
}
|
|
|
try {
|
|
|
const res = await axios.get('https://test.baoxianzhanggui.com/locallive-java/customer/product/getPageProductList', {
|
|
|
- params:this.queryform,
|
|
|
+ params: this.queryform,
|
|
|
});
|
|
|
this.Result = {
|
|
|
- rows:res.data.rows,
|
|
|
- pageNum:res.data.pageNum,
|
|
|
- pageSize:res.data.pageSize,
|
|
|
- total:res.data.total,
|
|
|
+ rows: res.data.rows,
|
|
|
+ pageNum: res.data.pageNum,
|
|
|
+ pageSize: res.data.pageSize,
|
|
|
+ total: res.data.total,
|
|
|
};
|
|
|
} catch (error) {
|
|
|
console.error('获取产品列表失败:', error);
|