|
|
@@ -23,48 +23,47 @@
|
|
|
} from "@/api/task";
|
|
|
|
|
|
export default {
|
|
|
- export default {
|
|
|
- name: 'task-ima-tab',
|
|
|
- data() {
|
|
|
- return {
|
|
|
- current: 0,
|
|
|
- navList: [{
|
|
|
- id: 0,
|
|
|
- briefness_name: '全部',
|
|
|
- product_icon: '/static/img/task/task-all.png'
|
|
|
- }]
|
|
|
- }
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.getTaskType()
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getTaskType() {
|
|
|
- getTaskType().then(res => {
|
|
|
- if (res.code === 1) {
|
|
|
- this.navList.push(...res.data)
|
|
|
+ name: 'task-ima-tab',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ current: 0,
|
|
|
+ navList: [{
|
|
|
+ id: 0,
|
|
|
+ briefness_name: '全部',
|
|
|
+ product_icon: '/static/img/task/task-all.png'
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getTaskType()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getTaskType() {
|
|
|
+ getTaskType().then(res => {
|
|
|
+ if (res.code === 1) {
|
|
|
+ this.navList.push(...res.data)
|
|
|
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- setType(current) {
|
|
|
- // this.$nextTick(() => {
|
|
|
- // uni.createSelectorQuery().in(this).select(".z-tabs-scroll-view").fields({
|
|
|
- // scrollOffset: true
|
|
|
- // }, data => {
|
|
|
- // if (data) {
|
|
|
- // this.currentScrollLeft = data.scrollLeft;
|
|
|
- // console.log(data);
|
|
|
- // } else {}
|
|
|
- // }).exec();
|
|
|
- // })
|
|
|
- if (current !== this.current) {
|
|
|
- this.current = current
|
|
|
- this.$emit('setProductId', this.navList[current].id)
|
|
|
}
|
|
|
- },
|
|
|
- }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setType(current) {
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // uni.createSelectorQuery().in(this).select(".z-tabs-scroll-view").fields({
|
|
|
+ // scrollOffset: true
|
|
|
+ // }, data => {
|
|
|
+ // if (data) {
|
|
|
+ // this.currentScrollLeft = data.scrollLeft;
|
|
|
+ // console.log(data);
|
|
|
+ // } else {}
|
|
|
+ // }).exec();
|
|
|
+ // })
|
|
|
+ if (current !== this.current) {
|
|
|
+ this.current = current
|
|
|
+ this.$emit('setProductId', this.navList[current].id)
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|