diff --git a/packages/packageBuy/pages/buyMember/buyMember.vue b/packages/packageBuy/pages/buyMember/buyMember.vue index 30d45ad..c2b338c 100644 --- a/packages/packageBuy/pages/buyMember/buyMember.vue +++ b/packages/packageBuy/pages/buyMember/buyMember.vue @@ -33,7 +33,7 @@ - 建卡医院* + 建卡医院 {{arrHospital[hindex]}} @@ -57,6 +57,8 @@ --> + + 立即支付 @@ -137,18 +139,12 @@ this.alert('请输入具体街道/地址') return } - if (weixin.isNull(this.info.hospital) || this.hindex == 0) { - this.alert('请输入具体建卡医院') - return - } weixin.request({ api: '/api/member/order-add', method: 'POST', data: this.info, - utilSuccess: r => { - console.log(r.data.total) - console.log(r.data.total) + utilSuccess: r => { if (parseFloat(r.data.total) == 0) { uni.navigateTo({ url: '../buyMemberSuccess/buyMemberSuccess?id=' + @@ -187,6 +183,7 @@ } }, utilFail: r => { + weixin.alert(r) console.log(r); } @@ -221,6 +218,10 @@ } + diff --git a/packages/packageBuy/pages/packageInfo/index.vue b/packages/packageBuy/pages/packageInfo/index.vue index 739e285..17055b7 100644 --- a/packages/packageBuy/pages/packageInfo/index.vue +++ b/packages/packageBuy/pages/packageInfo/index.vue @@ -6,12 +6,15 @@ - {{packages.price}}{{packages.name}} + + + {{packages.price}} + 免费 + {{packages.name}} - + - + @@ -34,18 +39,40 @@ - {{packages.content}} + + + - - - + + + + + + 首页 + + + + + 分享 + + + + 立即购买 + @@ -92,7 +119,9 @@ sharePath: "", scare: 1, shareHeight: 500, - id: "" + domain: "", + id: "", + promotion_id: "" } }, onLoad(option) { @@ -103,11 +132,21 @@ this.id = option.id; this.getPackages(); } + const scene = decodeURIComponent(option.scene); + if (!weixin.isNull(scene)) { + console.log(scene) + this.id = weixin.getParam(scene, "id"); + this.promotion_id = weixin.getParam(scene, "promotion_id"); + uni.setStorageSync("base_promotion_id", this.promotion_id); + this.getPackages(); + } weixin.getOpenidInfo(info => { this.user_info = info }, false) this.scare = windowWidth / 375; + console.log(weixin.getBaseUrl()) + this.domain = weixin.getBaseUrl(); }, onShow() { if (this.checkLogin()) { @@ -117,11 +156,12 @@ onShareAppMessage() { return { title: this.packages.name, - path: 'packages/packageBuy/pages/packageInfo/index?id='+this.id+'&promotion_id=' + this.user_info.id, + path: 'packages/packageBuy/pages/packageInfo/index?id=' + this.id + '&promotion_id=' + this.user_info.id, imageUrl: this.img } }, methods: { + shareOpen() { uni.showLoading({ title: '加载中' @@ -138,19 +178,18 @@ }); }, getAvatar: function() { - let userProfile = uni.getStorageSync('user_profile'); - if(!weixin.isNull(userProfile)){ - uni.getImageInfo({ - src: userProfile.avatarUrl, // 头像 - success: rlogo => { - this.imgAvatar = rlogo.path; - this.draw(); - } - }); - } - else{ - this.imgAvatar="../../../../static/avatar.jpg"; - this.draw(); + let userProfile = uni.getStorageSync('user_profile'); + if (!weixin.isNull(userProfile)) { + uni.getImageInfo({ + src: userProfile.avatarUrl, // 头像 + success: rlogo => { + this.imgAvatar = rlogo.path; + this.draw(); + } + }); + } else { + this.imgAvatar = "../../../../static/avatar.jpg"; + this.draw(); } }, draw: function() { @@ -161,7 +200,7 @@ method: 'GET', data: { path: 'packages/packageBuy/pages/packageInfo/index', - scene: 'id='+this.id+'&promotion_id=' + this.user_info.id + scene: 'id=' + this.id + '&promotion_id=' + this.user_info.id }, success: r => { if (r.data.status === 1) { @@ -290,8 +329,8 @@ if (this.checkLogin()) { let package_id = this.id; - uni.navigateTo({ - url:"../buyMember/buyMember?package_id=" + package_id + uni.navigateTo({ + url: "../buyMember/buyMember?package_id=" + package_id }); } }, @@ -340,7 +379,62 @@ padding-bottom: 160rpx; } -