diff --git a/api/activity.js b/api/activity.js index da05b2a..cc8feb6 100644 --- a/api/activity.js +++ b/api/activity.js @@ -301,7 +301,8 @@ export function storeActivityQrcode(data) { } // 活动商品专区 - export function storeActivityProduct(data) { - return request.get(`storeActivity/product`, data); + return request.get(`storeActivity/product`, data, { + noAuth: true + }); } diff --git a/components/shortPopupActive.vue b/components/shortPopupActive.vue new file mode 100644 index 0000000..b107236 --- /dev/null +++ b/components/shortPopupActive.vue @@ -0,0 +1,523 @@ + + + + + \ No newline at end of file diff --git a/config/app.js b/config/app.js index ccbb88f..cdcc9f8 100644 --- a/config/app.js +++ b/config/app.js @@ -11,8 +11,8 @@ let httpApiFive let wsApi // 在打包之前请检查当前环境是否正确 -// const env = 'dev'; // 开发 -const env = 'prod'; // 生产 +const env = 'dev'; // 开发 +// const env = 'prod'; // 生产 // const env = 'prew'; // 预上线 switch (env) { diff --git a/manifest.json b/manifest.json index bc84aeb..aa33955 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "惠农生活", "appid" : "__UNI__3A527D1", "description" : "", - "versionName" : "1.7.7", - "versionCode" : 177, + "versionName" : "1.7.8", + "versionCode" : 178, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { @@ -84,7 +84,9 @@ }, "permissionPhoneState" : { "request" : "none" //拨打电话权限关闭 - } + }, + "targetSdkVersion" : 30, + "minSdkVersion" : 23 }, /* ios打包配置 */ "ios" : { diff --git a/pages/index/index.vue b/pages/index/index.vue index 0f5d3c7..a077e29 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -362,7 +362,7 @@ import activityCard from "@/components/activityCard.vue" }, //获取商品列表 list(isPage=false, id) { - // if(!id) return that.list2(true, ''); // 定位没有获取到时,直接推荐 + if(!id||this.loadend) return this.list2(true, ''); // 定位没有获取到时,直接推荐 let that = this; if (that.loadend&&!isPage) return; if (that.loading&&!isPage) return; @@ -384,7 +384,7 @@ import activityCard from "@/components/activityCard.vue" limit: that.where.limit, street_id: id, type_id: '17,10', - location: this.latitude + ',' + this.longitude + location: `${this.latitude||''},${this.longitude||''}` }).then(res => { // console.log(222) let list = res.data.list; @@ -601,7 +601,7 @@ import activityCard from "@/components/activityCard.vue" this.list(true, this.street_id) }, selfLocation() { - if (uni.getStorageSync('RejectTarget')) return; + if (uni.getStorageSync('RejectTarget')) return this.list(true, ''); if (uni.getStorageSync('loction') == true) { this.isshow = false this.list(true, '') @@ -688,6 +688,7 @@ import activityCard from "@/components/activityCard.vue" uni.setStorageSync("RejectTarget", true) Toast('定位失败,请检查定位权限是否开启') this.street = '定位失败' + this.list2(true, '') // uni.showToast({ // title: "获取定位超时", diff --git a/pages/newActivity/towPrice/towPrice.vue b/pages/newActivity/towPrice/towPrice.vue index 0060ace..eb70657 100644 --- a/pages/newActivity/towPrice/towPrice.vue +++ b/pages/newActivity/towPrice/towPrice.vue @@ -8,6 +8,7 @@ src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/back.png"> + 当前活动区域为 [ {{address.townName||'未选择'}} ] , 点击切换 @@ -23,7 +24,7 @@ {{ item.product.price.split('.')[0] }}.{{item.product.price.split('.')[1]}} 限时特惠 - + @@ -31,7 +32,7 @@ - + @@ -45,7 +46,7 @@ import { Toast } from "../../../libs/uniApi"; import authorize from "@/components/Authorize.vue"; import { getUserInfo } from '@/api/user.js'; - import shortPopup from "@/components/shortPopup.vue" + import shortPopupActive from "@/components/shortPopupActive.vue" import { storeActivityProduct } from "@/api/activity.js" import { cloudWarehouse @@ -57,7 +58,7 @@ export default { components: { authorize, - shortPopup + shortPopupActive }, data() { return { @@ -67,12 +68,17 @@ activity: { title: '' }, + address: { + townName: '', + street_id: '' + }, show: false, isAuto: false, //没有授权的不会自动授权 isShowAuth: false, //是否隐藏授权 goodsList: [], street_id: '', - goodsNum: 0 + goodsNum: 0, + can_buy: 0, // 是否可以购买, 0不可以, 1可以 } }, onLoad(options) { @@ -82,8 +88,12 @@ this.getUserInfo(); this.loadList(); this.cartFn(); + this.address = this.$store.state.storage.address; }, methods: { + changeAddress(){ + + }, back() { uni.navigateBack() }, @@ -100,8 +110,10 @@ storeActivityProduct({ street_code: this.$store.state.storage.address.street_id, activity_id: 2, //默认传2 - location: location + location: location, + source: 105 }).then(res => { + this.can_buy = res.data.can_buy; this.goodsList = res.data.list; }).catch(e=>{ Toast(e.msg||e.message||e) @@ -113,6 +125,10 @@ }, // 点击商品 clickProduct(data){ + if(!this.address.townName) return Toast('请先选择活动区域') + if(!this.can_buy){ + return Toast('活动限购一件, 您已经买过了哦~') + } this.$refs.shortPopupRef.setDatas(data, this.goodsNum); this.$refs.shortPopupRef.open(); }, @@ -123,7 +139,7 @@ // 购物车信息 cartFn() { getCartCounts({ - source: 103, + source: 105, // product_type: 98 }).then(res => { this.goodsNum = res.data[0].count @@ -268,6 +284,9 @@ font-weight: bold; font-size: 28rpx; } + .no_qiang{ + background-color: #7f7f7f; + } } .r_street{ font-size: 24rpx;