From 89a8a3e405fa4c2ebba55ccae8ca162a049c4cdd Mon Sep 17 00:00:00 2001 From: "@fawn-nine" <1271023382@qq.com> Date: Mon, 24 Jun 2024 09:12:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=90=8E=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/buyPup.vue | 10 +++--- components/z-navigation/z-navigation.vue | 22 ++++++------ config/baseUrl.js | 4 +-- main.js | 2 +- pages.json | 43 ++++++++++++++++++------ pages/course/myCourse.vue | 29 +++++++++++++--- pages/peanut/home.vue | 4 +++ 7 files changed, 81 insertions(+), 33 deletions(-) diff --git a/components/buyPup.vue b/components/buyPup.vue index f921844..9442d50 100644 --- a/components/buyPup.vue +++ b/components/buyPup.vue @@ -34,16 +34,18 @@ return { pricespop:true, curProId:null, + curPro:{} }; },methods:{ closePup() { this.pricespop = false this.$emit('closePup') - // this.proPriceList = [] + }, choosePrice(item) { - // console.log(item, 'choosePrice') + console.log(item, 'choosePrice') this.curProId = item.productId + this.curPro = item }, oprate(val){ if(!this.curProId){ @@ -55,10 +57,10 @@ } if(val=='buy'){ console.log('直接购买'); - this.$emit('oprate',{name:val,id:this.curProId}) + this.$emit('oprate',{name:val,item:this.curPro}) }else if(val == 'gouwuche'){ console.log('加入购物车'); - this.$emit('oprate',{name:val,id:this.curProId}) + this.$emit('oprate',{name:val,item:this.curPro}) } this.closePup() } diff --git a/components/z-navigation/z-navigation.vue b/components/z-navigation/z-navigation.vue index a7c3ec2..4e7744b 100644 --- a/components/z-navigation/z-navigation.vue +++ b/components/z-navigation/z-navigation.vue @@ -86,18 +86,18 @@ export default { selectedIconPath: "static/tab/tab_cur_02.png", text: "购物车", }, - // { - // pagePath: "pages/taihu/index", - // iconPath: "static/tab/tab_nor_03.png", - // selectedIconPath: "static/tab/tab_cur_03.png", - // text: "太湖公益", - // }, + { + pagePath: "pages/bookShop/orderList", + iconPath: "static/tab/order.png", + selectedIconPath: "static/tab/order_active.png", + text: "订单", + }, { - pagePath: "pages/bookShop/orderList", - iconPath: "static/tab/order.png", - selectedIconPath: "static/tab/order_active.png", - text: "订单", - }, + pagePath: "pages/taihu/index", + iconPath: "static/tab/tab_nor_03.png", + selectedIconPath: "static/tab/tab_cur_03.png", + text: "太湖公益", + }, { pagePath: "pages/mine/mine/index", iconPath: "static/tab/tab_nor_04.png", diff --git a/config/baseUrl.js b/config/baseUrl.js index 5b5e824..6e8adf9 100644 --- a/config/baseUrl.js +++ b/config/baseUrl.js @@ -5,9 +5,9 @@ if (process.env.NODE_ENV === 'development') { // baseUrl = "http://localhost:7001/"; // socketUrl = "ws://localhost:6001/"; // baseUrl = "https://twin-ui.com/demo/"; - // baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境 + baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境 // baseUrl = "https://api.nuttyreading.com/"; // 线上正式 - baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑 + // baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑 // baseUrl = "http://59.110.212.44:9200/pb/"; // baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑 // baseUrl = "http://192.168.110.110:9200/pb/"; diff --git a/main.js b/main.js index 7f40514..9621335 100644 --- a/main.js +++ b/main.js @@ -45,7 +45,7 @@ uni.getSystemInfo({ // uView组件库 -import uView from "uview-ui"; +import uView from "@/uni_modules/uview-ui"; Vue.use(uView); // 传参格式 Vue.prototype.$qs = qs diff --git a/pages.json b/pages.json index d4a0ec1..50eecb4 100644 --- a/pages.json +++ b/pages.json @@ -1,7 +1,7 @@ { - "easycom": { - "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" - }, + // "easycom": { + // "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" + // }, "pages": [ { "path": "pages/peanut/home", @@ -436,7 +436,30 @@ "path" : "pages/course/myCourse", "style" : { - "navigationBarTitleText" : "我的课程" + "navigationBarTitleText" : "我的课程", + "enablePullDownRefresh": true + } + },{ + "path": "pages/goods/index/index", + "style": { + "navigationBarTitleText": "商品信息", + "enablePullDownRefresh": false, + "app-plus": { + "bounce": "none", + "titleNView": false, + "popGesture": "none" + } + } + },{ + "path": "pages/goods/order/index", + "style": { + "navigationBarTitleText": "确认订单", + "enablePullDownRefresh": false, + "app-plus": { + "bounce": "none", + "titleNView": false, + "popGesture": "none" + } } } ], @@ -467,18 +490,18 @@ "selectedIconPath": "static/tab/tab_cur_02.png", "text": "购物车" }, - // { - // "pagePath": "pages/taihu/index", - // "iconPath": "static/tab/tab_nor_03.png", - // "selectedIconPath": "static/tab/tab_cur_03.png", - // "text": "太湖公益" - // }, { "pagePath": "pages/bookShop/orderList", "iconPath": "static/tab/order.png", "selectedIconPath": "static/tab/order_active.png", "text": "订单" }, + { + "pagePath": "pages/taihu/index", + "iconPath": "static/tab/tab_nor_03.png", + "selectedIconPath": "static/tab/tab_cur_03.png", + "text": "太湖公益" + }, { "pagePath": "pages/mine/mine/index", "iconPath": "static/tab/tab_nor_04.png", diff --git a/pages/course/myCourse.vue b/pages/course/myCourse.vue index 1cb11f3..de2d835 100644 --- a/pages/course/myCourse.vue +++ b/pages/course/myCourse.vue @@ -280,9 +280,9 @@ oprate(data){ console.log(data,'得到的内容') if(data.name == 'buy'){ - this.buy(data) + this.buy(data.item) }else if(data.name == 'gouwuche'){ - this.addCart(data) + this.addCart(data.item) } }, // 购物车 @@ -291,9 +291,28 @@ }, // 直接购买 buy(val){ - uni.navigateTo({ - url:`/pages/bookShop/settlement?type=2&list=${val.id}` - }) + var mynavData = JSON.stringify({ +         goods: [ +           { +             productImages: val.productImages, +             productId: val.productId, +             productName: val.productName, +             price: val.activityPrice && val.activityPrice != 0 ? val.activityPrice:val.price, +             goodsType: val.goodsType, +           }, +         ], + +         navTitle: this.options.navTitle, +         title: this.options.title, +         typeId: 0, +       }); // 这里转换成 字符串 + +       uni.navigateTo({ +         url: `/pages/goods/order/index?data=${mynavData}`, +       }); + // uni.navigateTo({ + // url:`/pages/bookShop/settlement?type=2&list=${val.id}` + // }) }, closePup(e){ this.pricespop = false diff --git a/pages/peanut/home.vue b/pages/peanut/home.vue index 6e25606..258181b 100644 --- a/pages/peanut/home.vue +++ b/pages/peanut/home.vue @@ -26,6 +26,10 @@ 太湖公益 +