|
@@ -21,6 +21,7 @@
|
|
|
<router-view></router-view>
|
|
|
</el-main>
|
|
|
</el-container>
|
|
|
+ <shop-add ref="shopAdd" :products="productList"></shop-add>
|
|
|
</el-container>
|
|
|
</template>
|
|
|
|
|
@@ -29,10 +30,13 @@ import sidebar from "../common/sider.vue";
|
|
|
import headerVue from "../common/header.vue";
|
|
|
import { mapState } from "vuex";
|
|
|
import bus from "../common/bus.js";
|
|
|
+import shopAdd from "../components/shopCompoents/shopAdd";
|
|
|
+import { getProductList } from "../api/shop.js";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
audio: null,
|
|
|
+ productList: [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -41,12 +45,46 @@ export default {
|
|
|
components: {
|
|
|
sidebar,
|
|
|
headerVue,
|
|
|
+ shopAdd,
|
|
|
},
|
|
|
created() {
|
|
|
bus.$emit("openGetSoundMsg");
|
|
|
+ this.getProductList();
|
|
|
+ let memberType = this.$store.state.userInfo.memberType;
|
|
|
+ if (memberType === 1) {
|
|
|
+ this.$confirm("您当前还不是商户,请先申请成为商户!", "提示", {
|
|
|
+ confirmButtonText: "成为商户",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!",
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消删除",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ getProductList() {
|
|
|
+ getProductList().then((res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.productList = res.data;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: "error",
|
|
|
+ message: res.msg,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
goPrinter() {
|
|
|
this.$router.push({
|
|
|
path: "/shopInfo/shopInfos",
|
|
@@ -54,8 +92,8 @@ export default {
|
|
|
tabNum: 3,
|
|
|
},
|
|
|
});
|
|
|
- if(this.$route.name === 'shopInfos'){
|
|
|
- bus.$emit('goPrinter')
|
|
|
+ if (this.$route.name === "shopInfos") {
|
|
|
+ bus.$emit("goPrinter");
|
|
|
}
|
|
|
},
|
|
|
loginOut() {
|