From 0508098fe3faede3cf579398b0077a8bceb50585 Mon Sep 17 00:00:00 2001 From: BigBoss <2280520255@qq.com> Date: Mon, 11 May 2020 23:20:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=AD=9B=E9=80=89=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8E=A5=E5=8F=A3=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CommodityCard/CommodityCard.vue | 2 +- src/pages.json | 17 ++-- src/pages/index/index.vue | 109 +++++-------------------- src/pages/myOrder/myOrder.vue | 4 + src/pages/myOrderPaying/myOrderPaying.vue | 4 +- src/pages/user/user.vue | 6 +- src/store/modules/categoryOrder.js | 40 +++++++++ src/store/url.js | 5 +- 8 files changed, 84 insertions(+), 103 deletions(-) create mode 100644 src/store/modules/categoryOrder.js diff --git a/src/components/CommodityCard/CommodityCard.vue b/src/components/CommodityCard/CommodityCard.vue index d277950..8a00931 100644 --- a/src/components/CommodityCard/CommodityCard.vue +++ b/src/components/CommodityCard/CommodityCard.vue @@ -42,7 +42,7 @@ toGoods(id){ console.log('toGoods =====> id======>', id) uni.navigateTo({ - url: `../detail/detail?oderId=1`, + url: `../frameDetail/frameDetail?oderId={{id}}`, success: res => {}, fail: () => {}, complete: () => {} diff --git a/src/pages.json b/src/pages.json index d99f2fb..8edc2f7 100644 --- a/src/pages.json +++ b/src/pages.json @@ -1,12 +1,6 @@ { "pages": [ { - "path": "pages/cart/cart", - "style": { - "navigationBarTitleText": "购物车" - } - }, - { "path": "pages/index/index", "style": { "navigationBarTitleText": "商城一览" @@ -24,6 +18,12 @@ "navigationBarTitleText": "产品详情" } }, + { + "path": "pages/cart/cart", + "style": { + "navigationBarTitleText": "购物车" + } + }, { "path" : "pages/purchaseLenses/purchaseLenses", "style" : { @@ -71,7 +71,10 @@ "path": "pages/customerService/customerService" }, { - "path": "pages/myOrderPaying/myOrderPaying" + "path": "pages/myOrderPaying/myOrderPaying", + "style": { + "navigationBarTitleText": "待付款" + } } ], diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 396b2b9..438b6d4 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -102,18 +102,7 @@ export default { showRight: false, indexArr: "", valueArr: "", - // //商品数据 - // goodsList: [ - // { - // // goods_id: 0, - // // img: "/static/img/goods/p1.jpg", - // // name: "商品名称", - // // originCost: "¥198", - // // price: "¥168", - // // slogan: "1235人浏览" - // } - // ], - loadingText: "正在加载...", + loadingText: "~~到底了~~", filterDropdownValue: [], filterData: [] }; @@ -123,7 +112,11 @@ export default { // 也可以从 getters 获取 console.log(this.$store.getters.list); return this.$store.state.test.list; - } + }, + categoryList(){ + console.log(JSON.stringify(this.$store.state.categoryOrder.categoryList)); + } + }, filters: { outData(value) { @@ -132,53 +125,20 @@ export default { }, onLoad: function() { store.dispatch('test/fetch'); - // uni.request({ - // url: "https://api.glass.xiuyetang.com/app/prod/list", - // method: "post", - // data: { - // // text: 'uni.request' - // }, - // header: { - // // 'custom-header': 'hello', //自定义请求头信息 - // "Content-Type": "application/x-www-form-urlencoded" - // // 'Content-Type':'multipart/form-data' - // // 'Content-Type':'ext/plain' - // }, - // timeout: 3000, - // // dataType:'json' - // // responseType:'text', - // // sslVerify: true, //验证 ssl 证书 - // withCredentials: false, //跨域请求时是否携带凭证(cookies) - // success: res => { - // console.error("success status === > ", res); - // this.goodsList = res.data.data; - // // console.log('res.data', res.data); - // // this.text = 'request success'; - // }, - // fail: res => { - // console.log("fail status === > ", res); - // }, - // complete: res => { - // console.log("complete status === > ", res); - // } - // }); + store.dispatch('categoryOrder/fetch') + //定时器模拟ajax异步请求数据 - // setTimeout(()=>{ - // //传入defaultSelected的结构不能错,错了就报错运行异常。 不选中的项目传入null - // this.filterDropdownValue = [ - // [1,1,0], //第0个菜单选中 一级菜单的第1项,二级菜单的第1项,三级菜单的第3项 - // [null,null], //第1个菜单选中 都不选中 - // [1], //第2个菜单选中 一级菜单的第1项 - // [[0],[1,2,7],[1,0]], //筛选菜单选中 第一个筛选的第0项,第二个筛选的第1,2,7项,第三个筛选的第1,0项 - // [[0],[1],[1]], //单选菜单选中 第一个筛选的第0项,第二个筛选的第1项,第三个筛选的第1项 - // ]; - // this.filterData = data; - // },100); - // 模拟ajax请求子菜单数据。 - // setTimeout(()=>{ - // console.log('发起请求','ddddddd'); - // // this.filterData[1].submenu[0].submenu = [{"name": "附近","value": "附近"},{"name": "1km","value": "1km"},{"name": "2km","value": "2km"},{"name": "3km","value": "3km"},{"name": "4km","value": "4km"},{"name": "5km","value": "5km"}]; - // },3000); + setTimeout(()=>{ + //传入defaultSelected的结构不能错,错了就报错运行异常。 不选中的项目传入null + // this.filterDropdownValue = [ + // [1,1,0], //第0个菜单选中 一级菜单的第1项,二级菜单的第1项,三级菜单的第3项 + // [null,null], //第1个菜单选中 都不选中 + // [1], //第2个菜单选中 一级菜单的第1项 + // [[0],[1,2,7],[1,0]], //筛选菜单选中 第一个筛选的第0项,第二个筛选的第1,2,7项,第三个筛选的第1,0项 + // [[0],[1],[1]], //单选菜单选中 第一个筛选的第0项,第二个筛选的第1项,第三个筛选的第1项 + // ]; + this.filterData = data; + },100); }, methods: { showDrawer(e) { @@ -210,36 +170,7 @@ export default { }; } }, - onNavigationBarButtonTap(e) { - this.showRight = !this.showRight; - }, - //上拉加载, - onReachBottom() { - console.log("到底加载"); - let len = this.goodsList.length; - if (len >= 30) { - this.loadingText = "~~到底了~~"; - return false; - } else { - this.loadingText = "正在加载..."; - } - let end_goods_id = this.goodsList[len - 1].goods_id; - for (let i = 1; i <= 10; i++) { - let goods_id = end_goods_id + i; - let p = { - goods_id: goods_id, - img: - "/static/img/goods/p" + - (goods_id % 10 == 0 ? 10 : goods_id % 10) + - ".jpg", - name: "商品名称", - originCost: "¥198", - price: "¥168", - slogan: "1235人付款" - }; - this.goodsList.push(p); - } - } + }; diff --git a/src/pages/myOrder/myOrder.vue b/src/pages/myOrder/myOrder.vue index 5335572..250dcd7 100644 --- a/src/pages/myOrder/myOrder.vue +++ b/src/pages/myOrder/myOrder.vue @@ -51,6 +51,10 @@ }; }, + onLoad:function(option){ + // console.log(option.current) + this.current = option.current + }, methods:{ onClickItem(e) { if (this.current !== e) { diff --git a/src/pages/myOrderPaying/myOrderPaying.vue b/src/pages/myOrderPaying/myOrderPaying.vue index 376752c..f319c73 100644 --- a/src/pages/myOrderPaying/myOrderPaying.vue +++ b/src/pages/myOrderPaying/myOrderPaying.vue @@ -1,13 +1,13 @@