diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..4a3296c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,15 @@
+.DS_Store
+node_modules/
+unpackage/
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+/test/unit/coverage/
+
+# Editor directories and files
+.idea
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
diff --git a/README.md b/README.md
index 2693978..f600b87 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,9 @@
# 美团饿了吗CPS红包,别人领红包下单,你拿推广佣金

+
### 使用方法
-源码为uniapp项目,需使用hbuilder打包,可编译成h5或小程序(跳转地址需改为小程序路径)
+源码为uniapp项目,需下载hbuilder导入项目打包,可编译成h5或小程序(跳转地址为小程序路径)
### 常见问题
1. 如何获取美团饿了吗的推广链接
@@ -13,10 +14,15 @@
2.如何打包成小程序
-编译成小程序的话,需要把coupons里的跳转地址改成小程序的,点击立即领取也要改成跳转小程序
+编译成小程序的话,需要配置coupons里小程序路径
-比如跳转美团小程序:
+比如跳转饿了么小程序:
```
-/index/pages/h5/h5?weburl=https%3A%2F%2Frunion.meituan.com%2Furl%3Fkey%3Dcd23768d09c339d1641b2738df39aa67%26url%3Dhttps%253A%252F%252Fi.meituan.com%252Fawp%252Fhfe%252Fblock%252Fa13b87919a9ace9cfab4%252F89400%252Findex.html%253Fappkey%253Dcd23768d09c339d1641b2738df39aa67%253Ajuhe%26sid%3Djuhe&lch=cps:waimai:5:cd23768d09c339d1641b2738df39aa67:juhe&f_token=1&f_userId=1
+minapp: {
+ appid: 'wxece3a9a4c82f58c9',
+ path: 'pages/sharePid/web/index?scene=https://s.click.ele.me/wR9ecuu'
+}
```
+
+如有疑问,请提issue
\ No newline at end of file
diff --git a/components/.DS_Store b/components/.DS_Store
deleted file mode 100644
index 37fdde6..0000000
Binary files a/components/.DS_Store and /dev/null differ
diff --git a/components/v-tabs/.DS_Store b/components/v-tabs/.DS_Store
deleted file mode 100644
index 5008ddf..0000000
Binary files a/components/v-tabs/.DS_Store and /dev/null differ
diff --git a/components/v-tabs/v-tabs.vue b/components/v-tabs/v-tabs.vue
index 604fadd..c8ca267 100644
--- a/components/v-tabs/v-tabs.vue
+++ b/components/v-tabs/v-tabs.vue
@@ -298,6 +298,9 @@ export default {
display: flex;
align-items: center;
background-color: #ffffff;
+ scroll-view{
+ width: 750rpx;
+ }
&__container {
min-width: 100%;
position: relative;
diff --git a/pages/index/index.vue b/pages/index/index.vue
index e6ab045..8514669 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -65,7 +65,11 @@ export default {
bannerPic: '/static/coupon/ele_banner.png',
url: 'https://s.click.ele.me/frZOjvu',
type: 1,
- tabId: 1
+ tabId: 1,
+ minapp: {
+ appid: 'wxece3a9a4c82f58c9',
+ path: 'pages/sharePid/web/index?scene=https://s.click.ele.me/wR9ecuu'
+ }
},
{
name: '美团外卖红包',
@@ -73,7 +77,11 @@ export default {
bannerPic: '/static/coupon/meituan_banner.png',
url:'https://runion.meituan.com/url?key=cd23768d09c339d1641b2738df39aa67&url=https%3A%2F%2Fi.meituan.com%2Fawp%2Fhfe%2Fblock%2Fa945391288b790d558b7%2F78716%2Findex.html%3Fappkey%3Dcd23768d09c339d1641b2738df39aa67%3Ajuhe&sid=juhe',
type: 1,
- tabId: 2
+ tabId: 2,
+ minapp: {
+ appid: 'wxde8ac0a21135c07d',
+ path: '/index/pages/h5/h5?weburl=https%3A%2F%2Frunion.meituan.com%2Furl%3Fkey%3D591ec05930c57331c1212b936e6785c1%26url%3Dhttps%253A%252F%252Fi.meituan.com%252Fawp%252Fhfe%252Fblock%252Fa13b87919a9ace9cfab4%252F89400%252Findex.html%253Fappkey%253D591ec05930c57331c1212b936e6785c1%253A000001%26sid%3D000001&lch=cps:waimai:5:591ec05930c57331c1212b936e6785c1:000001&f_token=1&f_userId=1'
+ }
},
{
name: '爱奇艺会员',
@@ -97,7 +105,11 @@ export default {
bannerPic: '/static/coupon/ele_guosu.png',
url:'https://s.click.ele.me/RpRFhvu',
type: 1,
- tabId: 1
+ tabId: 1,
+ minapp: {
+ appid: 'wxece3a9a4c82f58c9',
+ path: 'pages/sharePid/web/index?scene=https://s.click.ele.me/I4Yacuu'
+ }
},
{
name: '抽红包立减',
@@ -110,8 +122,13 @@ export default {
]
};
},
- onLoad() {
+ onLoad(e) {
+ //#ifdef H5
let tabId = this.$route.query.tabId ? parseInt(this.$route.query.tabId) : 0
+ //#endif
+ //#ifdef MP-WEIXIN
+ let tabId = e.tabId ? parseInt(e.tabId) : 0
+ //#endif
for(let i in this.tabs){
if(tabId == this.tabs[i].tabId){
this.current = parseInt(i)
@@ -119,6 +136,12 @@ export default {
}
this.changeTab(this.current)
},
+ onShareAppMessage(res) {
+ return {
+ title: '美团饿了么大额红包,每日可领',
+ path: '/pages/index/index'
+ }
+ },
methods: {
changeTab(index) {
console.log('当前选中的项:' + index);
@@ -135,16 +158,33 @@ export default {
}
}
}
+ //#ifdef H5
this.$nextTick(() => {
this.$refs.coupon.scrollTop= 0;
})
+ //#endif
setTimeout(() => {
uni.hideLoading()
}, 500)
},
toCoupon(i){
- console.log(this.couponList[i].url)
+ console.log(this.couponList[i])
+ //h5
+ //#ifdef H5
window.location.href = this.couponList[i].url
+ //#endif
+ //微信小程序
+ //#ifdef MP-WEIXIN
+ if(this.couponList[i].minapp){
+ wx.navigateToMiniProgram({
+ appId: this.couponList[i].minapp.appid,
+ path: this.couponList[i].minapp.path,
+ success(res) {
+ // 打开成功
+ }
+ })
+ }
+ //#endif
}
}
};
diff --git a/unpackage/dist/build/.automator/h5/.automator.json b/unpackage/dist/build/.automator/h5/.automator.json
deleted file mode 100644
index e69de29..0000000
diff --git a/unpackage/dist/build/h5/index.html b/unpackage/dist/build/h5/index.html
deleted file mode 100644
index bfe63df..0000000
--- a/unpackage/dist/build/h5/index.html
+++ /dev/null
@@ -1,2 +0,0 @@
-