Authored by 肖亚东

3054:app分享小程序返回APP

@@ -52,6 +52,7 @@ Page(Object.assign({ @@ -52,6 +52,7 @@ Page(Object.assign({
52 * 页面的初始数据 52 * 页面的初始数据
53 */ 53 */
54 data: { 54 data: {
  55 + isGoApp: false,
55 tabIdx: '', 56 tabIdx: '',
56 showAuth: false, 57 showAuth: false,
57 actPrizeId: '', 58 actPrizeId: '',
@@ -111,6 +112,10 @@ Page(Object.assign({ @@ -111,6 +112,10 @@ Page(Object.assign({
111 112
112 let data = {}; 113 let data = {};
113 114
  115 + let currentScene = app.globalData.currentScene;
  116 + let isGoApp = (currentScene == 1036 || currentScene == 1069) ? true : false;
  117 + data.isGoApp = isGoApp;
  118 +
114 if (options.shareUid) { 119 if (options.shareUid) {
115 data.shareUid = options.shareUid; 120 data.shareUid = options.shareUid;
116 } 121 }
@@ -588,6 +593,13 @@ Page(Object.assign({ @@ -588,6 +593,13 @@ Page(Object.assign({
588 }) 593 })
589 } 594 }
590 }, 595 },
  596 + launchAppError: function (e) {
  597 + wx.showToast({
  598 + title: '打开失败!您可能未安装Yoho!Buy官方APP,请下载后再尝试。',
  599 + icon: 'none',
  600 + duration: 3000
  601 + })
  602 + },
591 //跳转到登录页面 603 //跳转到登录页面
592 loginAndRegisterTapped(needBind) { 604 loginAndRegisterTapped(needBind) {
593 let that = this; 605 let that = this;
@@ -95,3 +95,7 @@ @@ -95,3 +95,7 @@
95 bindgetphonenumber="getPhoneNumber" bindgetuserinfo='getUserInfo'>授权登录 95 bindgetphonenumber="getPhoneNumber" bindgetuserinfo='getUserInfo'>授权登录
96 </button> 96 </button>
97 </zero-alert> 97 </zero-alert>
  98 +
  99 +<button wx:if="{{isGoApp}}" class="appBtn" bindtap='goApp' type="default" hover-class="none" open-type="launchApp" app-parameter="{{appParameter}}" binderror="launchAppError">
  100 + <image class="appImg" src="./images/back2App@3x.png"></image>
  101 +</button>
@@ -208,3 +208,23 @@ @@ -208,3 +208,23 @@
208 z-index:10; 208 z-index:10;
209 left:82rpx; 209 left:82rpx;
210 } 210 }
  211 +
  212 +.appBtn {
  213 + position: fixed;
  214 + width: 80rpx;
  215 + height: 160rpx;
  216 + right: 50rpx;
  217 + bottom: 148rpx;
  218 + padding: 0;
  219 + align-self: center;
  220 + background-color: transparent !important;
  221 + z-index: 99;
  222 +}
  223 +.appBtn::after {
  224 + border: none;
  225 +}
  226 +
  227 +.appBtn .appImg {
  228 + width: 80rpx;
  229 + height: 160rpx;
  230 +}
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 "list": [] 31 "list": []
32 }, 32 },
33 "miniprogram": { 33 "miniprogram": {
34 - "current": 5, 34 + "current": 6,
35 "list": [ 35 "list": [
36 { 36 {
37 "id": 0, 37 "id": 0,
@@ -73,6 +73,14 @@ @@ -73,6 +73,14 @@
73 "name": "YOLUCK DETAIL", 73 "name": "YOLUCK DETAIL",
74 "pathName": "pages/zeroSell/detail", 74 "pathName": "pages/zeroSell/detail",
75 "query": "actPrizeId=41" 75 "query": "actPrizeId=41"
  76 + },
  77 + {
  78 + "id": 6,
  79 + "name": "1036",
  80 + "pathName": "pages/zeroSell/detail",
  81 + "query": "actPrizeId=62&fromPageParam=1&tabIdx=1",
  82 + "scene": 1036,
  83 + "referrerInfo": {}
76 } 84 }
77 ] 85 ]
78 } 86 }