diff --git a/api/activity.js b/api/activity.js
index 0398ede..c2e01e0 100644
--- a/api/activity.js
+++ b/api/activity.js
@@ -261,4 +261,26 @@ export function spuTopList(data) {
return request.get(`product/spu/get_hot_ranking`, data, {
noAuth: true
});
-}
\ No newline at end of file
+}
+
+// 活动列表
+export function consumption(data) {
+ return request.get(`storeActivity/consumption`, data, {
+ noAuth: true
+ });
+}
+
+// 参加活动
+export function chooseConsumption(data) {
+ return request.post(`storeActivity/choose`, data);
+}
+
+// 拉新红包活动完成状态
+export function storeActivityStatus(data) {
+ return request.get(`storeActivity/status`, data);
+}
+
+// 拉新红包活动完成状态
+export function storeActivityReceive(data) {
+ return request.post(`storeActivity/receive`, data);
+}
diff --git a/components/activityCard.vue b/components/activityCard.vue
new file mode 100644
index 0000000..c483e49
--- /dev/null
+++ b/components/activityCard.vue
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages.json b/pages.json
index 01bb9ef..ea46af7 100644
--- a/pages.json
+++ b/pages.json
@@ -1,6 +1,21 @@
{
"pages": [
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+ {
+ "path": "pages/index/index",
+ "style": {
+ "navigationBarTitleText": "首页",
+ "navigationStyle": "custom",
+ "enablePullDownRefresh": true,
+ "onReachBottomDistance": 300,
+ // #ifdef APP-PLUS
+ "enablePullDownRefresh": true,
+ // #endif
+ "app-plus": {
+ "scrollIndicator": false //禁用原生导航栏
+ }
+ }
+ },
{
"path": "pages/supply_chains/supply_chains",
"style": {
@@ -10,20 +25,6 @@
"onReachBottomDistance": 300
}
- },{
- "path": "pages/index/index",
- "style": {
- "navigationBarTitleText": "首页",
- "navigationStyle": "custom",
- "enablePullDownRefresh": true,
- "onReachBottomDistance": 300,
- // #ifdef APP-PLUS
- "enablePullDownRefresh": true,
- // #endif
- "app-plus": {
- "scrollIndicator": false //禁用原生导航栏
- }
- }
},
//#ifdef APP-PLUS
//启动页
@@ -195,6 +196,36 @@
"navigationBarTitleText" : "选择位置",
"enablePullDownRefresh" : false
}
+ },
+ {
+ "path" : "pages/newActivity/activityDetail/activityDetail",
+ "style" :
+ {
+ "navigationBarTitleText": "活动",
+ "enablePullDownRefresh": true,
+ "navigationStyle": "custom",
+ "onReachBottomDistance": 300
+ }
+ },
+ {
+ "path" : "pages/newActivity/subsidy/subsidy",
+ "style" :
+ {
+ "navigationBarTitleText": "补贴记录",
+ "enablePullDownRefresh": true,
+ "navigationStyle": "custom",
+ "onReachBottomDistance": 300
+ }
+ },
+ {
+ "path" : "pages/newActivity/invitation/invitation",
+ "style" :
+ {
+ "navigationBarTitleText": "拉新活动",
+ "enablePullDownRefresh": true,
+ "navigationStyle": "custom",
+ "onReachBottomDistance": 300
+ }
}
],
"subPackages": [{
@@ -1718,19 +1749,19 @@
"list": [
+ // {
+ // "pagePath": "pages/supply_chains/supply_chains",
+ // "iconPath": "static/tabbar_icon/d.png",
+ // "selectedIconPath": "static/tabbar_icon/d-a.png",
+ // "text": "供销"
+ // },
{
- "pagePath": "pages/supply_chains/supply_chains",
- "iconPath": "static/tabbar_icon/d.png",
- "selectedIconPath": "static/tabbar_icon/d-a.png",
- "text": "供销"
- },
- // {
- // "pagePath": "pages/index/index",
- // "iconPath": "static/tabbar_icon/a.png",
- // "selectedIconPath": "static/tabbar_icon/a-a.png",
- // "text": "泸州"
-
- // },
+ "pagePath": "pages/index/index",
+ "iconPath": "static/tabbar_icon/a.png",
+ "selectedIconPath": "static/tabbar_icon/a-a.png",
+ // "text": "泸州"
+ "text": "供销"
+ },
{
"pagePath": "pages/gather/gather",
"iconPath": "static/tabbar_icon/b.png",
diff --git a/pages/index/index.vue b/pages/index/index.vue
index b5cc220..52798ff 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -2,71 +2,149 @@
-
-
-
+
+
+
+
{{ street||'定位中' }}
-
+
-
+
+
+
+
- {{ street||'定位中' }}
+ {{street||'定位中' }}
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ september
+ {{new Date().getMonth()+1}}月
+
+
+
+
+ {{ town }}
+
+ 综合供销云市场
+
+
+
+ 点击查看
-
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
-
+
-
+
+
+
+
+ 暂无商品,试试其他位置
+
+
+ 为你推荐
+
+
+
-
- {{ loadTitle }}
+
+ {{loadTitle}}
+
+
+ {{loadTitle2}}
@@ -76,40 +154,27 @@
-
-
-
-
-
-
- 全部分类
-
-
- 点击进入分类
-
-
- {{ item.cate_name }}
-
-
-
-
-
位置权限使用说明
用于向你推荐最近门店
x
+
+
+
+
+
+
+
@@ -118,11 +183,8 @@
import { wgsToGcj } from "@/utils/wgs.js";
import zbpSwiper from '@/components/zbpSwiper'
import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue';
- import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlows.vue'
- import authorize from '@/components/Authorize';
- import {
- getUserInfo
- } from '@/api/user.js';
+ import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlowo.vue'
+ import Cache from '@/utils/cache';
import {
getSlideAPI
} from '@/api/lihai.js'
@@ -134,12 +196,16 @@
import {
getIndexData,
getDiy,
- getArticleList,
- getArticleCategoryLists
+ spuRecommend
} from '@/api/api.js'
+
+ import {
+ spuInfo
+ } from '@/api/product.js';
import {
getGeocoder,
- merClassifly
+ merClassifly,
+ getProductslist
} from '@/api/store.js';
import {
getArea,
@@ -148,19 +214,18 @@
import {
Toast
} from '@/libs/uniApi'
+import { data } from '../../uni_modules/uview-ui/libs/mixin/mixin';
+import activityCard from "@/components/activityCard.vue"
export default {
components: {
mTabbar,
zbpSwiper,
easyLoadimage,
WaterfallsFlow,
- authorize
+ activityCard
},
data() {
return {
-
- isAuto: false, //没有授权的不会自动授权
- isShowAuth: false, //是否隐藏授权
activeStyle: {
color: '#333333',
fontWeight: 'bold',
@@ -168,6 +233,8 @@
},
isshow: false,
locationArr: ({}),
+ latitude: null,
+ longitude: null,
bgColor: '',
showPicker: false,
columnData: [],
@@ -185,82 +252,80 @@
page: 1,
limit: 10
},
- loadend: false,
- loading: false,
- loadTitle: '加载更多',
+ where2: {
+ category_id: 0,
+ page: 1,
+ limit: 10
+ },
+
currentItemId: 69, // 默认获取 社区的数据 0 表示推荐 || 69 社区
keyword: '',
location: '',
emptyShow: false,
- street: '',
- productList: [],
+ town: '',
+ productList: [], // 当前区域列表
+ productList2: [], // 当前推荐列表
recoList: [],
articleList: [],
- streeta_id: '',
+ street_id: '',
street: '',
bgColor: '',
- backColor: 0,
isFshow: false,
- scrollTop: 0,
- show: true,
- userid: '',
- current: 0
+ backColor: 0,
+ loadend: false,
+ loading: false,
+ loadTitle: '加载更多',
+ loadend2: false,
+ loading2: false,
+ loadTitle2: '加载更多',
}
},
-
onPullDownRefresh() {
- this.where.page = 1
- this.getCateList()
- this.getGoods(true)
+ this.loadend = false;
+ this.loading = false;
+ this.list(true, this.street_id);
this.Area()
- uni.stopPullDownRefresh()
- },
-
- onLoad() {
- this.selfLocation()
- this.getCateList()
- //this.getArticle()
- this.getGoods(true)
- this.Area()
- //this.setPermissions()
- // this.openTongZhi()
-
- },
-
- onTabItemTap(e) {
- uni.pageScrollTo({
- selector: ".Circle_friends",
- scrollTop: 0,
- duration: 200
+ this.$u.sleep(1000).then(()=>{
+ uni.stopPullDownRefresh()
})
-
},
- onHide() {
-
- uni.setTabBarItem({
- index: 0,
- text: "泸州",
- iconPath: '/static/tabbar_icon/a.png',
- selectedIconPath: '/static/tabbar_icon/a-a.png'
- });
- this.isFshow = false
-
- },
- onReachBottom() {
-
- if (this.productList.length > 0) {
- this.$u.sleep(50).then(() => {
- this.getGoods(false);
- })
- }
-
- },
-
- mounted() {
- this.getUserInfo()
-
-
+ onShow() {},
+ onLoad() {
+ this.Area()
// this.selfLocation()
+ // this.openTongZhi()
+ uni.$on('connectstatusChange', (connectstatus) => {
+ var connectstr = ''
+ if (connectstatus == true) {
+ connectstr = '已连接'
+ this.getRegistrationID()
+ } else {
+ connectstr = '未连接'
+ }
+ this.connectstatus = connectStr
+ })
+ this.selfLocation()
+
+ },
+
+ onReachBottom() {
+ if (this.productList.length > 0) {
+ setTimeout(() => {
+ this.list(false, this.street_id);
+ this.productList2 = [];
+ }, 50)
+ } else if (this.productList2.length > 0) {
+ setTimeout(() => {
+ this.list2(false, '');
+ }, 50)
+ }
+ },
+ beforeDestroy() {
+ // 销毁监听事件
+ this.$bus.$off('value-updated')
+ },
+ mounted() {
+
// #ifdef H5
// 监听页面滚动事件
window.addEventListener("scroll", this.scrolling);
@@ -269,53 +334,45 @@
this.$bus.$on('value-updated', (newValue) => {
// 更新父组件的值
this.street = newValue.split(',')[0]
+ this.town = newValue.split(',')[0]
+ this.street_id = newValue.split(',')[1]
+
});
+
+ this.$nextTick(()=>{
+ this.$refs.activityPopup.open();
+ })
+
+
+
},
-
// #ifdef APP-PLUS
onPageScroll(e) {
const scrollTop = e.scrollTop;
-
- // 导航条颜色透明渐变
-
if (scrollTop <= 20) {
this.backColor = 0
this.isFshow = false
- this.show = true
- uni.setTabBarItem({
- index: 0,
- text: "泸州",
- iconPath: '/static/tabbar_icon/a.png',
- selectedIconPath: '/static/tabbar_icon/a-a.png'
- });
} else if (20 < scrollTop && scrollTop <= 100) {
this.backColor = 0.5
this.isFshow = true
- this.show = false
} else if (scrollTop > 100) {
this.backColor = 1
this.isFshow = true
- this.show = false
- this.$nextTick(() => {
- uni.setTabBarItem({
- index: 0,
- text: '返回顶部',
- iconPath: '/static/tabbar_icon/top.png',
- selectedIconPath: '/static/tabbar_icon/top.png'
- });
- })
}
-
-
},
// #endif
- beforeDestroy() {
- // 销毁监听事件
- this.$bus.$off('value-updated')
- },
methods: {
+ closeActivityCard(){
+ this.$refs.activityPopup.close();
+ },
+ navaction(val) {
+ uni.navigateTo({
+ url: '/pages/nongKe/supply_chain/suppliers?id=' + val
+ })
+
+ },
getPositionFn() {
this.street = '定位中'
this.$store.commit('setLocation', { lat: null, long: null })
@@ -323,58 +380,91 @@
this.selfLocation()
},
+ //获取商品列表
+ list(isPage=false, id) {
+ // if(!id) return that.list2(true, ''); // 定位没有获取到时,直接推荐
+ let that = this;
+ if (that.loadend&&!isPage) return;
+ if (that.loading&&!isPage) return;
- //直播
-
- zhibo() {
- uni.navigateTo({
- url: '/pages/room/index'
- })
- },
- //弹出
- open() {
- this.$refs.popup.open()
- },
- //隐藏
- cuo() {
- this.$refs.popup.close()
- },
- // 授权回调
- onLoadFun(data) {
- this.getUserInfo();
- this.isShowAuth = false;
- },
- /**
- * 获取个人用户信息
- */
- getUserInfo() {
- getUserInfo().then(res => {
- this.userid = res.data.uid
- });
- },
- //分栏视频 图文查看
- itemTap(item) {
-
-
- if (item.video_link.length > 0) {
- uni.navigateTo({
- // #ifdef MP || H5
- url: `/pages/short_video/nvueSwiper/index?id=${item.community_id}&uid=${this.userid}&user=1`
- // #endif
- // #ifdef APP
- url: `/pages/short_video/appSwiper/index?id=${item.community_id}&uid=${this.userid}&user=1`
- // #endif
- })
- } else {
- uni.navigateTo({
- url: `/pages/plantGrass/plant_detail/index?id=${item.community_id}`
+ if (isPage === true) {
+ that.$set(that, 'productList', []);
+ that.$set(that, 'where', {
+ category_id: 0,
+ page: 1,
+ limit: 10
})
}
+ that.$set(that, 'productList2', []);
+
+ that.loading = true;
+ that.loadTitle = '';
+ getProductslist({
+ page: that.where.page,
+ limit: that.where.limit,
+ street_id: id,
+ type_id: '17,10',
+ location: this.latitude + ',' + this.longitude
+ }).then(res => {
+ // console.log(222)
+ let list = res.data.list;
+ if (res.data.count == 0 && isPage) {
+ that.list2(true, '');
+ }
+ let productList = that.$util.SplitArray(list, that.productList);
+ let loadend = list.length < that.where.limit;
+ that.loadend = loadend;
+ that.loading = false;
+ that.loadTitle = loadend ? '已全部加载' : '加载更多';
+ that.$set(that, 'productList', productList);
+ // console.log(that.productList)
+ that.$set(that.where, 'page', that.where.page + 1);
+ if (that.where.page == 1 && res.data.list.length <= 0) that.emptyShow = true
+ }).catch(err => {
+ that.loading = false;
+ that.loadTitle = '加载更多';
+ });
},
- // 授权关闭
- authColse: function(e) {
- this.isShowAuth = e
+ list2(isPage=false, id) {
+ let that = this;
+
+ if (that.loadend2&&!isPage) return;
+ if (that.loading2&&!isPage) return;
+
+ if (isPage === true) {
+ that.$set(that, 'productList2', []);
+ that.$set(that, 'where2', {
+ category_id: 0,
+ page: 1,
+ limit: 10
+ })
+ }
+ that.$set(that, 'productList', []);
+
+ that.loading2 = true;
+ that.loadTitle2 = '';
+ let query = {
+ page: that.where2.page,
+ limit: that.where2.limit,
+ };
+ if(this.latitude&&this.longitude) query.location = this.latitude + ',' + this.longitude
+ spuRecommend(query).then(res => {
+ let list = res.data.list;
+ let productList = that.$util.SplitArray(list, that.productList2);
+ let loadend = list.length < that.where2.limit;
+ that.loadend2 = loadend;
+ that.loading2 = false;
+ that.loadTitle2 = loadend ? '已全部加载' : '加载更多';
+ that.$set(that, 'productList2', productList);
+ // console.log(that.productList)
+ that.$set(that.where2, 'page', that.where2.page + 1);
+ if (that.where.page2 == 1 && res.data.list.length <= 0) that.emptyShow2 = true
+ }).catch(err => {
+ that.loading2 = false;
+ that.loadTitle2 = '加载更多';
+ });
+
},
scrolling() {
// 滚动条距文档顶部的距离
@@ -387,6 +477,7 @@
// console.log("header 滚动距离 ", scrollTop);
// 更新——滚动前,滚动条距文档顶部的距离
this.oldScrollTop = scrollTop;
+
//变量windowHeight是可视区的高度
let windowHeight =
document.documentElement.clientHeight || document.body.clientHeight;
@@ -399,77 +490,21 @@
//你想做的事情
// console.log("header 你已经到底部了");
}
+
+
if (scrollTop <= 20) {
this.backColor = 0
this.isFshow = false
- uni.setTabBarItem({
- index: 0,
- text: "泸州",
- iconPath: '/static/tabbar_icon/a.png',
- selectedIconPath: '/static/tabbar_icon/a-a.png'
- });
} else if (20 < scrollTop && scrollTop <= 100) {
this.backColor = 0.5
this.isFshow = true
} else if (scrollTop > 100) {
this.backColor = 1
this.isFshow = true
-
- uni.setTabBarItem({
- index: 0,
- text: '返回顶部',
- iconPath: '/static/tabbar_icon/top.png',
- selectedIconPath: '/static/tabbar_icon/top.png'
- });
}
-
},
- tabsChange1(item) {
-
- this.getArticleList(item.article_category_id)
- this.streeta_id = item.id
- this.tabsData1.tabsActive = item.index
- },
- async getArticle() {
- let list = []
-
- const {
- data
- } = await getArticleCategoryLists()
- data.map((item, index) => {
- if (item.title !== '首页推荐') {
- list.push(item)
- } else {
- getArticleList(item.article_category_id).then(res => {
- this.recoList = res.data.list
- })
- }
- })
-
- this.tabsData1.list = list
- this.getArticleList(list[0].article_category_id)
- },
- async getArticleList(id) {
- let obj = {
- is_home: 1
- }
- const {
- data
- } = await getArticleList(id)
- this.articleList = data.list
- },
- article(item) {
- uni.navigateTo({
- url: '/pages/news_details/index?id=' + item.article_id
- })
- },
- selectPlce(e) {
- this.street_id = e.value[1].code
- this.town = e.value[1].name
- this.getCloudShopMerId(e.value[1].code)
- },
getCloudShopMerId(id) {
get_cloud_shop(id).then(res => {
res.data.length > 0 ? this.isYunCang = 1 : this.isYunCang = 0
@@ -481,8 +516,15 @@
confirm(e) {
this.street = e.value[1].name
-
+ this.street_id = e.value[1].code
+ this.town = e.value[1].name
+ this.loadend = false;
+ this.loadend2 = false;
+ this.$set(this.where, 'page', 1)
+ this.$set(this.where2, 'page', 1)
+ this.$set(this, 'productList', []);
this.$nextTick(() => {
+ this.list(true, this.street_id)
this.$bus.$emit('value-updated', e.value[1].name + ',' + e.value[1].code);
})
@@ -519,13 +561,9 @@
this.$refs.uPicker.setColumnValues(1, res.data);
});
},
- dchange(e) {
-
- this.$refs.list.street = e.value[1].name
- this.street = e.value[1].name
- },
gogogo(item) {
if (item.video_link.length > 0) {
+
uni.navigateTo({
// #ifdef MP || H5
url: `/pages/short_video/nvueSwiper/index?id=${item.community_id}`
@@ -557,121 +595,78 @@
}
})
},
- getGoods: function(isPage) {
- let that = this;
- if (that.loadend) return;
- if (that.loading) return;
+ go_shop() {
+ if (this.isYunCang == 0) {
+ return Toast('当前区域没有云仓库')
+ }
+ // uni.navigateTo({
+ // url: `/pages/nongKe/cloud_entrepot/index?street=${this.street_id}&town=${this.town}&source=103&location=${this.latitude},${this.longitude}`
+ // })
+ uni.navigateTo({
+ url: `/pages/nongKe/cloud_entrepot/indexh?street_id=${this.street_id}&townName=${this.town}&source=103&location=${this.latitude},${this.longitude}`
+ })
- if (isPage === true) that.$set(that, 'productList', []);
-
- that.loading = true;
- that.loadTitle = '';
- graphicLstApi(that.where).then(res => {
- let list = res.data.list;
- let productList = that.$util.SplitArray(list, that.productList);
- let loadend = list.length < that.where.limit;
- that.loadend = loadend;
- that.loading = false;
- that.loadTitle = loadend ? '已全部加载' : '加载更多';
- setTimeout(() => {
- that.$set(that, 'productList', productList);
- }, 500)
-
- // console.log(that.productList)
- that.$set(that.where, 'page', that.where.page + 1);
- if (that.where.page == 1 && res.data.list.length <= 0) that.emptyShow = true
- }).catch(err => {
- that.loading = false;
- that.loadTitle = '加载更多';
- });
},
- /*获取分类列表*/
- async getCateList() {
- const {
- data
- } = await getTopicList()
- this.tabsData.list = [{
- cate_name: "热门推荐",
- category_id: 0
- }, ...data]
+ navgo(url) {
+ uni.navigateTo({
+ url
+ })
},
- tabsChange(item) {
-
- this.productList = []
- this.where.category_id = item.category_id
- this.emptyShow = false
+ dchange(e) {
+ this.street = e.value[1].name
+ this.street_id = e.value[1].code
+ this.town = e.value[1].name
this.loadend = false;
this.$set(this.where, 'page', 1)
- this.getGoods(true)
- this.street_id = item.id
- this.tabsData.tabsActive = item.index
- this.current = item.index
-
- },
- tabsChange2(item, index) {
- // console.log(item,index)
-
- this.productList = []
- this.where.category_id = item.category_id
- this.$refs.popup.close()
- this.emptyShow = false
- this.loadend = false;
- this.$set(this.where, 'page', 1)
- this.getGoods(true)
- this.tabsData.tabsActive = index
- this.current = index
-
+ this.list(true, this.street_id)
},
selfLocation() {
- console.log(uni.getStorageSync('RejectTarget'), 6666, uni.getStorageSync('RejectTarget'));
if (uni.getStorageSync('RejectTarget')) return;
-
if (uni.getStorageSync('loction') == true) {
this.isshow = false
+ this.list(true, '')
} else {
this.isshow = true
uni.setStorageSync('loction', true);
}
- if (this.$store.state.storage.location.lat) {
+ // console.log(this.$store.state.storage.location);
+ if (this.$store?.state?.storage?.location?.lat) {
this.isshow = false
- let latitude, longitude;
- latitude = this.$store.state.storage.location.lat.toString();
- longitude = this.$store.state.storage.location.long.toString();
+ this.latitude = this.$store.state.storage.location.lat;
+ this.longitude = this.$store.state.storage.location.long;
getGeocoder({
- lat: latitude,
- long: longitude
+ lat: this.latitude,
+ long: this.longitude
}).then(res => {
- console.log(res);
- let town = res.data.address_reference.town.title
- let street_id = res.data.address_reference.town.id
- this.street = res.data.address_reference.town.title
- this.$nextTick(() => {
- this.$bus.$emit('value-updated', this.street + ',' +
- street_id);
-
- })
- }).catch(err => {
- console.log(err);
this.isshow = false
- // uni.showToast({
- // title: err,
- // icon: 'none'
- // })
- this.uniLocation();
+ this.town = res.data.address_reference.town.title
+ this.street_id = res.data.address_reference.town.id
+ this.street = res.data.address_reference.town.title;
+ this.list(true, this.street_id)
+ this.$nextTick(() => {
+ this.$bus.$emit('value-updated', this.street + ',' + this
+ .street_id);
+ })
+
+ }).catch(err => {
+ this.isshow = false
+ this.list2(true, '')
+ uni.showToast({
+ title: err,
+ icon: 'none'
+ })
})
- } else this.uniLocation();
- },
- uniLocation() {
- uni.getLocation({
+ } else uni.getLocation({
type: 'wgs84',
- timeout: '1000',
+ timeout: '10',
success: (res) => {
res = wgsToGcj(res);
- console.log('定位成功', res);
this.isshow = false
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();
+ this.latitude = res.latitude.toFixed(6);
+ this.longitude = res.longitude.toFixed(6);
this.$store.commit('setLocation', {
lat: res.latitude.toFixed(6),
long: res.longitude.toFixed(6),
@@ -680,17 +675,19 @@
lat: latitude,
long: longitude
}).then(res => {
-
- let town = res.data.address_reference.town.title
- let street_id = res.data.address_reference.town.id
- this.street = res.data.address_reference.town.title
+ this.isshow = false
+ this.town = res.data.address_reference.town.title
+ this.street_id = res.data.address_reference.town.id
+ this.street = res.data.address_reference.town.title;
+ this.list(true, this.street_id)
this.$nextTick(() => {
- this.$bus.$emit('value-updated', this.street + ',' +
- street_id);
-
+ this.$bus.$emit('value-updated', this.street + ',' + this
+ .street_id);
})
+
}).catch(err => {
this.isshow = false
+ this.list2(true, '')
uni.showToast({
title: err,
icon: 'none'
@@ -699,113 +696,29 @@
})
},
fail: (err) => {
- console.log(err);
- uni.setStorageSync("RejectTarget", true)
+ console.log('定位失败');
this.isshow = false
- this.street = '定位失败'
+ uni.setStorageSync("RejectTarget", true)
Toast('定位失败,请检查定位权限是否开启')
+ this.street = '定位失败'
+ // uni.showToast({
+ // title: "获取定位超时",
+ // icon: 'none',
+ // duration: 2000
+ // });
}
});
},
-
- /**
- * 设置手机通知权限
- */
- setPermissions() {
- // #ifdef APP-PLUS
- if (plus.os.name == 'Android') { // 判断是Android
- var main = plus.android.runtimeMainActivity();
- var pkName = main.getPackageName();
- var uid = main.getApplicationInfo().plusGetAttribute("uid");
- var NotificationManagerCompat = plus.android.importClass(
- "android.support.v4.app.NotificationManagerCompat");
- //android.support.v4升级为androidx
- if (NotificationManagerCompat == null) {
- NotificationManagerCompat = plus.android.importClass(
- "androidx.core.app.NotificationManagerCompat");
- }
- var areNotificationsEnabled = NotificationManagerCompat.from(main).areNotificationsEnabled();
-
-
-
-
- // 未开通‘允许通知’权限,则弹窗提醒开通,并点击确认后,跳转到系统设置页面进行设置
- if (!areNotificationsEnabled) {
- uni.showModal({
- title: '通知权限开启提醒',
- content: '您还没有开启通知权限,无法接受到消息通知,请前往设置!',
- showCancel: false,
- confirmText: '去设置',
- success: function(res) {
- if (res.confirm) {
- var Intent = plus.android.importClass('android.content.Intent');
- var Build = plus.android.importClass("android.os.Build");
- //android 8.0引导
- if (Build.VERSION.SDK_INT >= 26) {
- var intent = new Intent(
- 'android.settings.APP_NOTIFICATION_SETTINGS');
- intent.putExtra('android.provider.extra.APP_PACKAGE', pkName);
- } else if (Build.VERSION.SDK_INT >= 21) { //android 5.0-7.0
- var intent = new Intent(
- 'android.settings.APP_NOTIFICATION_SETTINGS');
- intent.putExtra("app_package", pkName);
- intent.putExtra("app_uid", uid);
- } else { //(<21)其他--跳转到该应用管理的详情页
- intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
- var uri = Uri.fromParts("package", mainActivity
- .getPackageName(),
- null);
- intent.setData(uri);
- }
- // 跳转到该应用的系统通知设置页
- main.startActivity(intent);
- }
- }
- });
- }
- } else if (plus.os.name == 'iOS') { // 判断是ISO
- var isOn = undefined;
- var types = 0;
- var app = plus.ios.invoke('UIApplication', 'sharedApplication');
- var settings = plus.ios.invoke(app, 'currentUserNotificationSettings');
- if (settings) {
- types = settings.plusGetAttribute('types');
- plus.ios.deleteObject(settings);
- } else {
- types = plus.ios.invoke(app, 'enabledRemoteNotificationTypes');
- }
- plus.ios.deleteObject(app);
- isOn = (0 != types);
- if (isOn == false) {
- uni.showModal({
- title: '通知权限开启提醒',
- content: '您还没有开启通知权限,无法接受到消息通知,请前往设置!',
- showCancel: false,
- confirmText: '去设置',
- success: function(res) {
- if (res.confirm) {
- var app = plus.ios.invoke('UIApplication', 'sharedApplication');
- var setting = plus.ios.invoke('NSURL', 'URLWithString:',
- 'app-settings:');
- plus.ios.invoke(app, 'openURL:', setting);
- plus.ios.deleteObject(setting);
- plus.ios.deleteObject(app);
- }
- }
- });
- }
- }
- // #endif
- },
// 选择位置
changeMap() {
uni.navigateTo({
url: `/pages/select_address/select_address_n`,
success: () => {
uni.$once('changeAddress', (e) => {
- // this.street_id = e.street.code;
- // this.street = e.street.name;
+ this.street_id = e.street.code;
+ this.street = e.street.name;
+ this.town = e.street.name;
if (e.longitude) {
this.longitude = e.longitude;
this.latitude = e.latitude;
@@ -814,29 +727,71 @@
long: e.longitude,
});
}
+ this.loadend = false;
+ this.loadend2 = false;
+ this.$set(this.where, 'page', 1)
+ this.$set(this.where2, 'page', 1)
+ this.$set(this, 'productList', []);
+ uni.pageScrollTo({
+ scrollTop: 0, // 滚动到页面的目标位置(单位px)
+ duration: 200 // 滚动动画的时长,默认300ms,单位 ms
+ });
+ this.$nextTick(()=>{
+ this.list(true, this.street_id);
+ });
this.$bus.$emit('value-updated', e.street.name + ',' + e.street.code);
})
}
})
}
+
+
}
}
\ No newline at end of file
diff --git a/pages/newActivity/activityDetail/activityDetail.vue b/pages/newActivity/activityDetail/activityDetail.vue
new file mode 100644
index 0000000..094745a
--- /dev/null
+++ b/pages/newActivity/activityDetail/activityDetail.vue
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/newActivity/invitation/invitation.vue b/pages/newActivity/invitation/invitation.vue
new file mode 100644
index 0000000..1b1b0ed
--- /dev/null
+++ b/pages/newActivity/invitation/invitation.vue
@@ -0,0 +1,367 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 扫一扫,红包马上就到
+ 温馨提示:邀请新用户才有机会获得红包哦
+
+
+
+
+
+
+
+
+
+
+
+ 邀请新用户消费达目标金额,有机会领取红包哦~
+
+
+
+
+
+
+
+
+
+
+
+ 抱歉!
+ 邀请新用户未达3人及以上
+ 无法领红包哦~
+
+
+
+
+
+
+
+
+ 恭喜!
+ 成功获得实物通用红包
+ 赶快打开吧~
+
+
+
+
+
+
+
+
+ 恭喜你!成功获得
+ 500元
+ 购买指定商品可直接抵扣使用
+ 2024-10-10 18:00:00过期
+
+
+
+
+
+
+
+
+
+
+
+
+ 名称
+ ID
+ 目标金额
+ 状态
+
+
+
+
+ {{item.nickname}}
+ {{item.uid}}
+ {{item.target_amount}}元
+
+ 已完成
+ 未完成
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/newActivity/subsidy/subsidy.vue b/pages/newActivity/subsidy/subsidy.vue
new file mode 100644
index 0000000..d425e33
--- /dev/null
+++ b/pages/newActivity/subsidy/subsidy.vue
@@ -0,0 +1,150 @@
+
+
+
+
+
+
+
+ 总计获得 580 元补贴红包
+
+
+
+
+ 消费金额
+ 补贴金额
+ 红包获得时间
+
+
+
+ 200元
+ 110元
+ 2024-01-20
+
+ 暂无记录
+
+
+
+
+
+
+
+
+
diff --git a/pages/supply_chains/supply_chains.vue b/pages/supply_chains/supply_chains.vue
index df531a8..52798ff 100644
--- a/pages/supply_chains/supply_chains.vue
+++ b/pages/supply_chains/supply_chains.vue
@@ -161,6 +161,10 @@
x
+
+
+
+