Authored by dongjunjie

店铺销售类目

var request = require('request');
var _ = require('lodash');
var fs = require('fs');
var yohoSearch = global.global.Register.yohoSearch;
var yohoSearch = global.Register.yohoSearch;
module.exports = {
namespace: "common",
... ...
... ... @@ -8,7 +8,7 @@
<com-selection :url="selectUrl" :selected-data="{id:shopId,text:shopName}" :placeholder="'请选择店铺'"></com-selection>
</div>
<div class="shopInfo">
<span @click=''>店铺ID:<b>{{showShopId}}{{state1.id}}</b></span>
<span @click=''>店铺ID:<b>{{showShopId}}</b></span>
<span>店铺名称:<b>{{showShopName}}</b></span>
</div>
<div class="clearfix"></div>
... ... @@ -36,25 +36,29 @@
import pageheader from '../../../../components/pageheader/index';
import grid from '../../../../components/grid/index';
import selection from '../../../../components/selection/index';
{}
export default{
components: {
comPageheader: pageheader,
comGrid: grid,
comSelection: selection
},
vuex:{
getters: {
state1 : function (state) {
stateData : function (state) {
return {state}=state;
}
},
actions: {
setShop : function ({dispatch}) {
dispatch("SETSHOP")
}
}
},
components: {
comPageheader: pageheader,
comGrid: grid,
comSelection: selection
},
data(){
return {
shopId: -1,
shopName: '--',
shopId: -11,
shopName: '-3-',
selectUrl: '/ShopsRest/selectCheckPassShopsByName',
categoryNum: 0,
grid: {
... ... @@ -86,13 +90,8 @@
},
methods: {
initShop(){
console.log(this.$route.params);
if(this.$route.params.shopId){
this.shopId = this.$route.params.shopId;
}
if(this.$route.params.shopName) {
this.shopName = this.$route.params.shopName;
}
this.shopId = this.stateData.shopId;
this.shopName = this.stateData.shopName;
},
getCategoryList(){
this.$broadcast('grid-reload',{shop_id:this.shopId});
... ... @@ -111,7 +110,8 @@
completeSelect(data){
this.shopId = data.id;
this.shopName = data.text;
this.getCategoryList();
this.setShop(data.id, data.text);
//this.getCategoryList();
},
completeGrid(data){
this.categoryNum = data.length;
... ...
... ... @@ -61,6 +61,14 @@
comTab: tab,
comGrid: grid
},
vuex:{
getters: {
stateData : function (state) {
console.log(state);
return {state}=state;
}
}
},
data() {
return {
shopId: -1,
... ... @@ -108,29 +116,21 @@
},
methods: {
initShop(){
this.shopId = this.$route.params.shopId;
this.shopName = this.$route.params.shopName;
console.log(this.stateData);
this.shopId = this.stateData.shopId;
this.shopName = this.stateData.shopName;
},
open(){
common.dialog.confirm(this.currentShop.text,"2",function () {},function(){})
},
back(){
this.$router.go({name:'index',params:{
shopId:this.shopId,
shopName:this.shopName
}});
this.$router.go({name:'index'});
},
eventBlind(){
$(document).on('click','.btn-save', function () {
alert(1);
})
}
},
route: {
canReuse: function(transition){
console.log('.....')
transition.next();
}
}
}
</script>
... ...
... ... @@ -25,11 +25,11 @@ router.map({
name:"add",
component: require("./edit.vue")
},
'/edit/:shopId/:shopName': {
'/edit': {
name:"edit",
component: require("./edit.vue")
},
'/info/:shopId': {
'/info': {
name:"info",
component: require("./info.vue")
}
... ...
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
Vue.use(Vuex);
const state = {
id:0
}
shopId: 15,
shopName: 'debdd'
};
const mutations = {
}
SETSHOP(id,name){
state.shopId = id;
state.shopName = name;
}
};
export default new Vuex.Store({
state,
... ...
... ... @@ -19,8 +19,8 @@ module.exports = {
loaders: [
{ test: /\.vue$/, loader: "vue" },
{ test: /\.scss$/, loader: ExtractTextPlugin.extract("style-loader", 'css-loader!autoprefixer!sass-loader') },
{ test: /\.js$/, loader: 'babel', exclude: /node_modules/ },
{ test: /\.(png|jpg|gif)$/, loader: 'url?limit=10000&name=./images/[name].[ext]?[hash:10]', },
{ test: /\.js$/, loader: 'babel', exclude: [/node_modules/,/js\.vue/,/js\.jquery\/common\/util/] },
{ test: /\.(png|jpg|gif)$/, loader: 'url?limit=10000&name=./images/[name].[ext]?[hash:10]', }
]
},
babel: {
... ...