diff --git a/pages.json b/pages.json index 9296a5a..cc6d14a 100644 --- a/pages.json +++ b/pages.json @@ -66,6 +66,12 @@ "navigationBarTitleText" : "搜索" } }, + { + "path" : "search/shopResult", + "style" : { + "navigationStyle": "custom" + } + }, { "path" : "video/video", "style" : { @@ -132,6 +138,12 @@ "navigationBarTitleText" : "农家烟火" } }, + { + "path": "food/cafe", + "style": { + "navigationBarTitleText" : "啡尝美味" + } + }, { "path": "food/detail", "style": { @@ -148,7 +160,7 @@ { "path" : "line/index", "style" : { - "navigationBarTitleText" : "精选线路" + "navigationBarTitleText" : "乡村漫游" } }, { @@ -283,6 +295,42 @@ "style" : { "navigationBarTitleText" : "限时特惠" } + }, + { + "path" : "letter/index", + "style" : { + "navigationBarTitleText" : "" + } + }, + { + "path" : "letter/detail", + "style" : { + "navigationBarTitleText" : "详情" + } + }, + { + "path" : "techan/manualIndex", + "style" : { + "navigationBarTitleText" : "非遗手作" + } + }, + { + "path": "activity/agriculturalProd", + "style": { + "navigationBarTitleText" : "" + } + }, + { + "path": "activity/agriculturalProdNH", + "style": { + "navigationBarTitleText" : "" + } + }, + { + "path": "activity/commonRule", + "style": { + "navigationBarTitleText" : "" + } } ] }], diff --git a/pages/index/index.vue b/pages/index/index.vue index 478c7f3..98d5480 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -2,12 +2,16 @@ - + + + + 搜一搜您想要的 + 搜索 @@ -27,6 +31,7 @@ + @@ -35,12 +40,22 @@ - - - + + + + + + + + + + + + @@ -50,16 +65,27 @@ - + + + + + + + {{item.title}} + ¥{{item.price / 100}} + + + @@ -72,6 +98,8 @@ }, data() { return { + height: 0, + statusBarHeight: 0, homeUi: {}, navList: [], topBanner: [], @@ -79,7 +107,26 @@ recommendNav: [], moduleList: [], hotList: [], - finished: false + finished: false, + hotAdv: null, + CKMap: null, + // 乡村生活 + xcsh: { + img1: { + image: "https://static.ticket.sz-trip.com/uploads/20250814/306961c1869208fb80f15c3e1566dfdf.png" + }, + img2: [ + { + image: "https://static.ticket.sz-trip.com/uploads/20250814/bf1b1cb267299a59285e32035684798b.png", + path: "/subPackages/letter/index?type=yxdw&imgId=2380" + }, + { + image: "https://static.ticket.sz-trip.com/uploads/20250814/f74a19e9de6ee0165a0d45919e753034.png", + path: '/subPackages/letter/index?type=whck&imgId=2379' + } + ] + } + } }, onLoad() { @@ -90,9 +137,17 @@ // this.getLocation() }, onReady() { + this.initRectInfo() this.sendRequest() + this.getHeadImg(2378).then(res => {this.CKMap = res}) }, methods: { + initRectInfo () { + const sysInfo = uni.getSystemInfoSync() + this.statusBarHeight = sysInfo.statusBarHeight + // 默认高度 + this.height = sysInfo.statusBarHeight + 40 + }, // 首页UI配置跳转 gotoHomeDetail(item) { if(item.jump_type == 'page') { @@ -197,15 +252,37 @@ }, getHotList() { this.Post({ - tag_id: 648, + // tag_id: 648, offset: this.hotList.length, - limit: 4 - },'/api/product/get_product_by_tag').then(res => { + limit: 5, + order: "sales_number" + },'/api/product/get_product_by_type').then(res => { this.hotList = [...this.hotList, ...res.data.list] - if(res.data.list.length < 4) this.finished = true + if(res.data.list.length < 5) this.finished = true }) - } + // 广告 + if (!this.hotAdv) { + this.Post({ + type_id: 5, + position: 6, + },"/api/adv/getAdv").then(res => { + if (res) { + if (Array.isArray(res.data) && res.data.length>0) + this.hotAdv = res.data[0] + } + }); + } + }, + + openCKMap () { + + uni.previewImage({ + urls: [this.CKMap] + }) + }, + + }, onReachBottom() { setTimeout(() => { @@ -219,23 +296,29 @@ .bg { width: 100%; min-height: 100vh; - background: #CDE29E; - padding: 145rpx 26rpx; + // background: #CDE29E; + background: linear-gradient(to bottom, #CDE29E 0%, #EDF5DC 360px, #EDF5DC 100%); + padding: 0 26rpx 145rpx; } image { display: block; } - - .topImg { - height: 114.67rpx; - margin-left: 30rpx; + .top-image{ + width: 100%; + display: flex; + align-items: flex-end; + .topImg { + height: 81.33rpx; + margin-left: 30rpx; + } } + .search-box { height: 67rpx; background: rgba(255, 255, 255, .66); - border-radius: 20rpx; + border-radius: 33rpx; margin-top: 24rpx; display: flex; align-items: center; @@ -248,6 +331,19 @@ height: 30.67rpx; margin: 0 19rpx 0 27rpx; } + .search-btn{ + width: 107rpx; + height: 53rpx; + background: rgba(106, 138, 39, 0.66); + border-radius: 27rpx; + text-align: center; + line-height: 53rpx; + font-weight: 500; + font-size: 24rpx; + color: #FFFFFF; + margin-left: auto; + margin-right: 7rpx; + } } .top-banner { @@ -260,12 +356,15 @@ margin-top: 45rpx; display: flex; flex-wrap: wrap; + font-size: 23rpx; + .nav-item { width: 20%; display: flex; flex-direction: column; align-items: center; + // font-size: 23rpx; image { width: 100rpx; @@ -284,16 +383,34 @@ height: 200rpx; border-radius: 20rpx; } + .country-box{ + width: 343.33rpx; + height: 451.33rpx; + background-image: url("https://static.ticket.sz-trip.com/uploads/20250813/542650d396ff373150917432ac6204e5.png"); + background-size: 100% 100%; + padding: 101rpx 13rpx 0; + flex-shrink: 0; + .img1{ + width: 100%; + height: 173.33rpx; + } + .img2{ + width: 153.33rpx; + height: 153.33rpx; + } + } .recommend-box { display: flex; justify-content: space-between; flex-wrap: wrap; + flex-direction: column; + width: 343.33rpx; + height: 451.33rpx; .recommend-item { width: 336.67rpx; - height: 225.33rpx; - margin-top: 40rpx; + height: 220rpx; } } @@ -315,9 +432,20 @@ margin-top: 40rpx; display: flex; justify-content: space-between; + &.new-hot-box{ + flex-wrap: wrap; + .hot-adv{ + width: 340rpx; + height: 490rpx; + border-radius: 20rpx; + overflow: hidden; + margin-bottom: 16rpx; + } + } .hot-item { width: 340rpx; + height: 490rpx; background: #FFFFFF; border-radius: 20rpx; overflow: hidden; @@ -325,11 +453,15 @@ image { width: 340rpx; + height: 340rpx; } .hot-content { - padding: 13rpx 13rpx 26rpx 13rpx; - + height: 150rpx; + padding: 6rpx 13rpx 10rpx 13rpx; + display: flex; + flex-direction: column; + justify-content: space-between; .title { font-weight: 500; font-size: 28rpx; diff --git a/pages/user/user.vue b/pages/user/user.vue index ec2bdca..ebaab8d 100644 --- a/pages/user/user.vue +++ b/pages/user/user.vue @@ -221,8 +221,8 @@ that.orderId = id; that.Post({ order_id: id, - pay_method: 'abc', - pay_platform: "miniprogram", + pay_method: 'WEIXIN', + pay_platform: "MINI", }, '/api/pay/unify' ).then(res => { diff --git a/static/js/request.js b/static/js/request.js index 7d9e24e..1f7dd1f 100644 --- a/static/js/request.js +++ b/static/js/request.js @@ -3,8 +3,8 @@ import store from '@/store'; // 定义 API URL // const DEV_API_URL = 'https://api.cloud.sz-trip.com'; -const DEV_API_URL = 'https://swsz.api.js-dyyj.com' -const PROD_API_URL = 'https://swsz.api.js-dyyj.com'; +const DEV_API_URL = 'https://api.sutenong.com' +const PROD_API_URL = 'https://api.sutenong.com'; const NEWAPIURL = process.env.NODE_ENV === 'development' ? DEV_API_URL : PROD_API_URL; // 获取token diff --git a/subPackages/activity/agriculturalProd.vue b/subPackages/activity/agriculturalProd.vue new file mode 100644 index 0000000..0e9ec6e --- /dev/null +++ b/subPackages/activity/agriculturalProd.vue @@ -0,0 +1,412 @@ + + + + + \ No newline at end of file diff --git a/subPackages/activity/agriculturalProdNH.vue b/subPackages/activity/agriculturalProdNH.vue new file mode 100644 index 0000000..fb30b3f --- /dev/null +++ b/subPackages/activity/agriculturalProdNH.vue @@ -0,0 +1,148 @@ + + + + + \ No newline at end of file diff --git a/subPackages/activity/commonRule.vue b/subPackages/activity/commonRule.vue new file mode 100644 index 0000000..b6e77e2 --- /dev/null +++ b/subPackages/activity/commonRule.vue @@ -0,0 +1,46 @@ + + + + + \ No newline at end of file diff --git a/subPackages/food/cafe.vue b/subPackages/food/cafe.vue new file mode 100644 index 0000000..7725997 --- /dev/null +++ b/subPackages/food/cafe.vue @@ -0,0 +1,149 @@ + + + + + \ No newline at end of file diff --git a/subPackages/food/order.vue b/subPackages/food/order.vue index bf2f8b6..b7d0fee 100644 --- a/subPackages/food/order.vue +++ b/subPackages/food/order.vue @@ -261,8 +261,8 @@ this.$store.commit("choseCoupon", ""); this.Post({ order_id: order_id, - pay_method: 'abc', - pay_platform: "miniprogram", + pay_method: 'WEIXIN', + pay_platform: "MINI", }, '/api/order/pay').then(res => { if (res.data) { uni.requestPayment({ diff --git a/subPackages/homestay/order.vue b/subPackages/homestay/order.vue index f197d73..ee48561 100644 --- a/subPackages/homestay/order.vue +++ b/subPackages/homestay/order.vue @@ -335,8 +335,8 @@ export default { uni.removeStorageSync('hotelOrderInfo'); this.Post({ order_id: res.data.order_id, - pay_platform: "miniprogram", - pay_method: 'abc' + pay_platform: "MINI", + pay_method: 'WEIXIN', }, '/api/order/pay').then(res => { if (res.data) { uni.requestPayment({ diff --git a/subPackages/letter/detail.vue b/subPackages/letter/detail.vue new file mode 100644 index 0000000..38aba71 --- /dev/null +++ b/subPackages/letter/detail.vue @@ -0,0 +1,145 @@ + + + + + \ No newline at end of file diff --git a/subPackages/letter/index.vue b/subPackages/letter/index.vue new file mode 100644 index 0000000..bb57a91 --- /dev/null +++ b/subPackages/letter/index.vue @@ -0,0 +1,163 @@ + + + + + \ No newline at end of file diff --git a/subPackages/line/orders.vue b/subPackages/line/orders.vue index 32ffc9d..3aade19 100644 --- a/subPackages/line/orders.vue +++ b/subPackages/line/orders.vue @@ -261,8 +261,8 @@ this.Post({ order_id: order_id, - pay_platform: "miniprogram", - pay_method: 'abc' + pay_platform: "MINI", + pay_method: 'WEIXIN', }, '/api/order/pay').then(res => { if (res.data) { uni.requestPayment({ diff --git a/subPackages/order/cartOrder.vue b/subPackages/order/cartOrder.vue index f779c0a..a0e200e 100644 --- a/subPackages/order/cartOrder.vue +++ b/subPackages/order/cartOrder.vue @@ -379,8 +379,8 @@ export default { this.$store.commit("changeHotelOrderList", []); this.Post({ order_id: res.data.order_id, - pay_platform: "miniprogram", - pay_method: 'abc' + pay_platform: "MINI", + pay_method: 'WEIXIN', }, '/api/order/pay').then(res => { if (res.data) { uni.requestPayment({ diff --git a/subPackages/order/orderDetail.vue b/subPackages/order/orderDetail.vue index 31c6538..6173e66 100644 --- a/subPackages/order/orderDetail.vue +++ b/subPackages/order/orderDetail.vue @@ -613,8 +613,8 @@ setOrderId(id) { this.Post({ order_id: this.info.order_id, - pay_platform: "miniprogram", - pay_method: 'abc' + pay_platform: "MINI", + pay_method: 'WEIXIN', }, '/api/order/pay') .then(res => { if (res.code == 1) { diff --git a/subPackages/order/trades.vue b/subPackages/order/trades.vue index a8cfdbe..7689764 100644 --- a/subPackages/order/trades.vue +++ b/subPackages/order/trades.vue @@ -187,8 +187,8 @@ export default { this.orderId = id; this.Post({ order_id: id, - pay_platform: "miniprogram", - pay_method: 'abc' + pay_platform: "MINI", + pay_method: 'WEIXIN', }, '/api/order/pay') .then(res => { if (res.data) { diff --git a/subPackages/search/shopResult.vue b/subPackages/search/shopResult.vue new file mode 100644 index 0000000..8779f62 --- /dev/null +++ b/subPackages/search/shopResult.vue @@ -0,0 +1,354 @@ + + + + + diff --git a/subPackages/techan/detail.vue b/subPackages/techan/detail.vue index ab62bca..2a49e01 100644 --- a/subPackages/techan/detail.vue +++ b/subPackages/techan/detail.vue @@ -43,6 +43,21 @@ + + + + {{supplierInfo.shop_name}} + + + {{item}} + + + + + 进店 + + + 产品详情 @@ -152,6 +167,7 @@ addCart: false, cartNum: 0, + supplierInfo: null, }; }, @@ -164,7 +180,6 @@ this.down = true query.selectAll(".info-box-query").boundingClientRect(res=>{ let i = res.findLastIndex(v=>v.top-100<=0) - console.log(res, i) if (i>=0) { this.type = i+1 } @@ -197,8 +212,22 @@ } this.info = res.data; this.sku = res.data.sku || [] + this.getSupplierInfo(res.data.supplier_id) }); }, + getSupplierInfo (supplier_id) { + this.Post({supplier_id: supplier_id}, + '/api/supplier/get_supplier_detail').then(res => { + if (res.code == 1) { + this.supplierInfo = res.data; + } + }); + }, + goShopDetail(id) { + uni.navigateTo({ + url:"/subPackages/search/shopResult?id="+id + }) + }, //数量加减 addNumber() { @@ -276,7 +305,7 @@ }, // 购物车 getCartList () { - this.Post({},'/api/cart/get_cart_count').then(res=>{ + this.Post({noForceLogin: true},'/api/cart/get_cart_count').then(res=>{ this.cartNum = res.data || 0 }) }, @@ -328,19 +357,19 @@ } .swipe-box { - height: 413rpx; + height: 750rpx; position: relative; .swiper { - height: 413rpx; + height: 750rpx; position: relative; .swiper-item { width: 100%; - height: 413rpx; + height: 750rpx; .item-img { width: 750rpx; - height: 413rpx; + height: 750rpx; } } } @@ -378,7 +407,7 @@ } .swipe-box { - height: 400rpx; + height: 750rpx; position: relative; .swiper-item-num { @@ -399,16 +428,16 @@ } .swiper { - height: 400rpx; + height: 750rpx; position: relative; .swiper-item { width: 100%; - height: 400rpx; + height: 750rpx; .item-img { width: 750rpx; - height: 400rpx; + height: 750rpx; } } } @@ -865,4 +894,56 @@ z-index: 1; } } + + .supplier-box{ + display: flex; + align-items: center; + padding: 28rpx 23rpx; + .supplier-image{ + width: 113.07rpx; + height: 113.07rpx; + border-radius: 50%; + flex-shrink: 0 ; + } + .supplier-content{ + flex: 1; + width: 1px; + padding: 0 50rpx 0 20rpx; + height: 113.07rpx; + display: flex; + flex-direction: column; + justify-content: center; + font-weight: bold; + font-size: 32rpx; + color: #010101; + } + .supplier-btn{ + flex-shrink: 0; + width: 133rpx; + height: 55rpx; + background: #6A8A2D; + border-radius: 13rpx; + font-weight: 500; + font-size: 31rpx; + color: #FFFFFF; + text-align: center; + line-height: 55rpx; + } + + .tags{ + display: flex; + width: 100%; + overflow: hidden; + padding-top: 10rpx; + .tags-item{ + padding: 4rpx 10rpx; + font-weight: 500; + font-size: 24rpx; + color: #6A8A27; + border-radius: 5rpx 4rpx 4rpx 5rpx; + border: 1px solid #6A8A27; + margin-right: 15rpx; + } + } + } \ No newline at end of file diff --git a/subPackages/techan/index.vue b/subPackages/techan/index.vue index 400a686..383d7e5 100644 --- a/subPackages/techan/index.vue +++ b/subPackages/techan/index.vue @@ -14,8 +14,9 @@