diff --git a/App.vue b/App.vue index 08204dc..98337fa 100644 --- a/App.vue +++ b/App.vue @@ -3,6 +3,19 @@ onLaunch: function() { console.warn('当前组件仅支持 uni_modules 目录结构 ,请升级 HBuilderX 到 3.1.0 版本以上!') console.log('App Launch') + + // 1审核 默认进审核 + uni.setStorageSync('SHFlag', true) + this.Post({id:2388},'/api/multimedia/detail').then(res => { + if (res && res.data) { + let SHFlag = res.data.company_name == 1 ? true : false + // let SHFlag = res.data.ext_link == 1 ? true : false + uni.setStorageSync('SHFlag', SHFlag) + return + } else { + uni.setStorageSync('SHFlag', false) + } + }); }, onShow: function() { console.log('App Show') diff --git a/components/cartData.vue b/components/cartData.vue index b6f23df..35edb9f 100644 --- a/components/cartData.vue +++ b/components/cartData.vue @@ -159,7 +159,7 @@ this.cartData = data this.setAllSelect() } else { - this.Post({},'/api/cart/get_post_list').then(res => { + this.Post({noForceLogin: true},'/api/cart/get_post_list').then(res => { if (res) { this.cartData = (res.data || []).map(v=>{ if (v.delivery_method) { @@ -221,9 +221,9 @@ }, clearAllGoods(){ - let ids = this.cartData.map(v=>v.sku.id) + let ids = this.cartData.map(v=>v.id) if (ids.length>0) { - this.Post({sku_id:ids.join(',')},'/api/cart/del_sku').then(res=>{ + this.Post({id:ids.join(',')},'/api/cart/del_sku').then(res=>{ this.cartData = [] this.setAllSelect() }) @@ -247,13 +247,13 @@ addBuyNum(item, num,index){ if (num == -1 && item.num == 1) { - this.Post({sku_id: item.sku_id, num: 0},'/api/cart/del_sku').then(res =>{ + this.Post({id: item.id, num: 0},'/api/cart/del_sku').then(res =>{ this.cartData.splice(index,1) this.setAllSelect() }) } else { let numData = item.num + num - this.Post({sku_id: item.sku_id, num: numData},'/api/cart/update_sku').then(res =>{ + this.Post({id: item.id, num: numData},'/api/cart/update_sku').then(res =>{ item.num += num this.setAllSelect() }) diff --git a/mixins/myMixins.js b/mixins/myMixins.js index 2f412e9..aa61b53 100644 --- a/mixins/myMixins.js +++ b/mixins/myMixins.js @@ -1,5 +1,11 @@ export const myMixins ={ + data() { + return { + shareParam: {}, + } + }, + onLoad(option) { console.log('option',option) if(option && option.wechat_qrcode){ @@ -15,28 +21,33 @@ export const myMixins ={ // 分享到朋友圈 onShareTimeline() { return { - title: '智游常熟', + title: '时味苏州', type: 0, summary: "edewdewdewf", - imageUrl: "https://static.ticket.sz-trip.com/dongtai/images/index/share.jpg" + imageUrl: "https://static.ticket.sz-trip.com/uploads/20250818/5ea2c18a15db8a438f2ce642194b6051.jpg" } }, onShareAppMessage() { const pages = getCurrentPages(); // 获取加载的页面 const view = pages[pages.length - 1]; // 获取当前页面的对象 let url = ''; - if (view.options.url) { - url = view.options.url; + let shareParam = {} + console.log(view) + if (view.$page.fullPath) { + url = view.options.fullPath; } else { url = uni.getStorageSync('webUrl'); } - + if (view.data && view.data.shareParam) { + shareParam = view.data.shareParam + } console.log(111,url,`${view.route}?url=${url}`) return { - title: '智游常熟', // 分享的名称 - path: `${view.route}?url=${url}`, // 将 url 作为参数传递 - imageUrl: "https://static.ticket.sz-trip.com/dongtai/images/index/share.jpg", - mpId: 'wxb8f15afe2765976d' // 此处配置微信小程序的 AppId + title: '时味苏州', // 分享的名称 + path: `${view.$page.fullPath}`, + // imageUrl: "https://static.ticket.sz-trip.com/uploads/20250818/5ea2c18a15db8a438f2ce642194b6051.jpg", + mpId: 'wx699ed131345cf8dd', // 此处配置微信小程序的 AppId + ...shareParam }; } } \ No newline at end of file diff --git a/pages.json b/pages.json index 5998e23..7c7b67f 100644 --- a/pages.json +++ b/pages.json @@ -66,6 +66,12 @@ "navigationBarTitleText" : "搜索" } }, + { + "path" : "search/shopResult", + "style" : { + "navigationStyle": "custom" + } + }, { "path" : "video/video", "style" : { @@ -138,6 +144,12 @@ "navigationBarTitleText" : "农家烟火" } }, + { + "path": "food/cafe", + "style": { + "navigationBarTitleText" : "啡尝美味" + } + }, { "path": "food/detail", "style": { @@ -154,7 +166,7 @@ { "path" : "line/index", "style" : { - "navigationBarTitleText" : "精选线路" + "navigationBarTitleText" : "乡村漫游" } }, { @@ -295,6 +307,48 @@ "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" : "" + } + }, + { + "path": "activity/jitoumi", + "style": { + "navigationBarTitleText" : "水八仙之首—苏州芡实 (鸡头米)" + } } ] }], diff --git a/pages/index/index.vue b/pages/index/index.vue index 478c7f3..c202818 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -2,12 +2,16 @@ - + + + + - + 搜一搜您想要的 + 搜索 @@ -35,31 +39,52 @@ - - - + + + + + + + + + + + + - + - - + + + + + + + + {{item.title}} + ¥{{item.price / 100}} + + + @@ -72,6 +97,8 @@ }, data() { return { + height: 0, + statusBarHeight: 0, homeUi: {}, navList: [], topBanner: [], @@ -79,22 +106,75 @@ 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' + } + ] + }, + + SHFlag: true, + } }, onLoad() { - + + }, + onShow() { + this.initSHFlag() }, // 离开当前页面时获取定位 onHide() { // this.getLocation() }, onReady() { + this.initRectInfo() this.sendRequest() + this.getHeadImg(2378).then(res => {this.CKMap = res}) }, methods: { + initSHFlag () { + let _this = this + // 先查一遍 + try { + _this.SHFlag = uni.getStorageSync('SHFlag')?true: false + } catch (e) { + _this.SHFlag = false + } + console.log(_this.SHFlag) + setTimeout(()=>{ + try { + _this.SHFlag = uni.getStorageSync('SHFlag')?true: false + } catch (e) { + _this.SHFlag = false + } + console.log(_this.SHFlag) + },500) + }, + + initRectInfo () { + const sysInfo = uni.getSystemInfoSync() + this.statusBarHeight = sysInfo.statusBarHeight + // 默认高度 + this.height = sysInfo.statusBarHeight + 40 + }, // 首页UI配置跳转 gotoHomeDetail(item) { + + if(item.jump_type == 'page') { // 内页 // 4外部小程序 5外部链接 6内页 @@ -122,6 +202,9 @@ }, // 广告跳转 gotoBannerDetail(item) { + + + if (this.SHFlag) { return } // 1产品详情 2功能模块 3外部链接 4外部小程序 switch (item.jump_type){ case 1: @@ -197,15 +280,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 +324,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 +359,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 +384,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 +411,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 +460,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 +481,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..f7c70bd 100644 --- a/pages/user/user.vue +++ b/pages/user/user.vue @@ -153,7 +153,7 @@ title: '商户核销', path: '', isShow: true, - webUrl: "https://swsz.supplier-h5.js-dyyj.com", + webUrl: "https://supplier-h5.sutenong.com", }, { src: 'https://static.ticket.sz-trip.com/shiweisuzhou/images/user/yhxy.png', @@ -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/css/base.css b/static/css/base.css index e1677f9..5b307fe 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -89,6 +89,9 @@ view { } .h-1rpx{ height: 1rpx; +} +.no-scrollbar::-webkit-scrollbar{ + display: none; } .no-data-zhanwei{ display: flex; diff --git a/static/js/CommonFunction.js b/static/js/CommonFunction.js index 0ad84d4..1f521fb 100644 --- a/static/js/CommonFunction.js +++ b/static/js/CommonFunction.js @@ -323,6 +323,22 @@ Vue.prototype.goCartNextPage= function(currentPageIndex){ } +Vue.prototype.sharePage = function(param) { + const pages = getCurrentPages(); // 获取加载的页面 + const view = pages[pages.length - 1]; // 获取当前页面的对象 + + let shareParam = { + title: '时味苏州', // 分享的名称 + path: `${view.$page.fullPath}`, + imageUrl: "https://static.ticket.sz-trip.com/uploads/20250818/5ea2c18a15db8a438f2ce642194b6051.jpg", + mpId: 'wx699ed131345cf8dd', // 此处配置微信小程序的 AppId + ...param, + } + + return shareParam; +} + + // 配送时间 /** * 解析"小时:分钟"格式的时间为总分钟数 diff --git a/static/js/request.js b/static/js/request.js index 5c647d1..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 @@ -20,15 +20,17 @@ const getToken = () => { }; // 定义错误处理函数 -const handleError = (res, reject) => { +const handleError = (res, reject, noForceLogin) => { setTimeout(() => { - uni.showToast({ - title: res.data?.msg || res.msg, - icon: 'none' - }); + if (!noForceLogin) { + uni.showToast({ + title: res.data?.msg || res.msg, + icon: 'none' + }); + } reject(res); }, 0); - if (res.data?.code === 401) { + if (res.data?.code === 401 && !noForceLogin) { store.commit('changeLoginPath'); } }; @@ -64,13 +66,13 @@ Vue.prototype.Post = (params = {}, apiurl) => { if (res.data.code === 200 || res.data.code === 1) { resolve(res.data); } else { - handleError(res, reject); + handleError(res, reject,params.noForceLogin); } }, fail: (err) => { console.log('err', err); uni.hideLoading() - handleError(err, reject); + handleError(err, reject,params.noForceLogin); } }); }); diff --git a/subPackages/activity/agriculturalProd.vue b/subPackages/activity/agriculturalProd.vue new file mode 100644 index 0000000..e033532 --- /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..16a7f3d --- /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/activity/jitoumi.vue b/subPackages/activity/jitoumi.vue new file mode 100644 index 0000000..df786ab --- /dev/null +++ b/subPackages/activity/jitoumi.vue @@ -0,0 +1,218 @@ + + + + + \ 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/detail.vue b/subPackages/food/detail.vue index 7150516..047d56d 100644 --- a/subPackages/food/detail.vue +++ b/subPackages/food/detail.vue @@ -75,26 +75,35 @@ - + + + + 购物车 + {{cartNum}} + - 加入购物车 立即购买 - + @@ -222,11 +231,12 @@ } catch(e) {} this.info = resData this.sku = resData.sku + this.shareParam = {title: this.info.title, imageUrl: this.info.headimg} }); }, goMap () { - if (!this.info.lat || !this.info.lon) { + if (!this.info.scene_lat || !this.info.scene_lon) { uni.showToast({ title: '暂未配置地理位置', icon: 'none' @@ -235,13 +245,13 @@ } uni.openLocation({ - latitude: Number(this.info.lat), - longitude: Number(this.info.lon), - name: this.info.title, - address: this.info.address, - success: function () { - console.log('success'); - } + latitude: Number(this.info.scene_lat), + longitude: Number(this.info.scene_lon), + name: this.info.scene_name, + address: this.info.scene_address, + // success: function () { + // console.log('success'); + // } }); }, @@ -257,7 +267,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 }) }, @@ -592,7 +602,7 @@ align-items: center; justify-content: space-between; z-index: 10; - padding: 0 46rpx; + padding: 0 26rpx; .icon-container{ font-weight: 400; font-size: 23rpx; @@ -613,17 +623,17 @@ .btn{ width: 200rpx; - height: 60rpx; + height: 75rpx; + line-height: 75rpx; font-weight: 500; font-size: 31rpx; color: #FFFFFF; - line-height: 60rpx; text-align: center; background: #6A8A27; - border-radius: 0rpx 11rpx 11rpx 0rpx; + border-radius: 0rpx 20rpx 20rpx 0rpx; &:first-of-type{ background: #D3E8A7; - border-radius: 11rpx 0rpx 0rpx 11rpx; + border-radius: 20rpx 0rpx 0rpx 20rpx; color: #6A8A27; } } @@ -844,4 +854,21 @@ button::after { border: none; } + + .cartNum{ + width: 28rpx; + height: 28rpx; + background: #DC2525; + border-radius: 50%; + border: 1px solid #DC2525; + font-weight: normal; + font-size: 23rpx; + color: #FFFFFF; + display: flex; + align-items: center; + justify-content: center; + position: absolute; + top: -10rpx; + right: -6rpx; + } diff --git a/subPackages/food/index.vue b/subPackages/food/index.vue index 27d5fcf..7d4230b 100644 --- a/subPackages/food/index.vue +++ b/subPackages/food/index.vue @@ -1,7 +1,7 @@