|
@@ -54,20 +54,16 @@ import food from '../food/food'
|
|
|
|
|
|
const ERR_OK = 0
|
|
|
const debug = process.env.NODE_ENV !== 'production'
|
|
|
-const goods = require('../../../mock/data.json')
|
|
|
+const mockDataJson = require('../../../mock/data.json')
|
|
|
|
|
|
export default {
|
|
|
- props: {
|
|
|
- seller: {
|
|
|
- type: Object
|
|
|
- }
|
|
|
- },
|
|
|
data () {
|
|
|
return {
|
|
|
goods: [],
|
|
|
listHeight: [],
|
|
|
scrollY: 0,
|
|
|
- selectedFood: {}
|
|
|
+ selectedFood: {},
|
|
|
+ seller: {}
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -96,17 +92,11 @@ export default {
|
|
|
},
|
|
|
created () {
|
|
|
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: {
|