|
@@ -54,20 +54,16 @@ import food from '../food/food'
|
|
|
|
|
|
const ERR_OK = 0
|
|
const ERR_OK = 0
|
|
const debug = process.env.NODE_ENV !== 'production'
|
|
const debug = process.env.NODE_ENV !== 'production'
|
|
-const goods = require('../../../mock/data.json')
|
|
|
|
|
|
+const mockDataJson = require('../../../mock/data.json')
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- props: {
|
|
|
|
- seller: {
|
|
|
|
- type: Object
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
goods: [],
|
|
goods: [],
|
|
listHeight: [],
|
|
listHeight: [],
|
|
scrollY: 0,
|
|
scrollY: 0,
|
|
- selectedFood: {}
|
|
|
|
|
|
+ selectedFood: {},
|
|
|
|
+ seller: {}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -96,17 +92,11 @@ export default {
|
|
},
|
|
},
|
|
created () {
|
|
created () {
|
|
this.classMap = ['decrease', 'discount', 'special', 'invoice', 'guarantee']
|
|
this.classMap = ['decrease', 'discount', 'special', 'invoice', 'guarantee']
|
|
-
|
|
|
|
- const url = 'http://ustbhuangyi.com/sell/api/goods'
|
|
|
|
- this.$http.get(url).then((response) => {
|
|
|
|
- response = response.body
|
|
|
|
- if (response.errno === ERR_OK) {
|
|
|
|
- this.goods = response.data
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this._initScroll()
|
|
|
|
- this._calculateHeight()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ this.seller = mockDataJson.seller
|
|
|
|
+ this.goods = mockDataJson.goods
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this._initScroll()
|
|
|
|
+ this._calculateHeight()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|