Authored by 陈峰

Merge branch 'release/6.9.2' into 'master'

Release/6.9.2

返回app功能

See merge request !13
@@ -32,6 +32,7 @@ App({ @@ -32,6 +32,7 @@ App({
32 thirdSession: '', 32 thirdSession: '',
33 udid: '', 33 udid: '',
34 unionType: '', 34 unionType: '',
  35 + currentScene: 1001,
35 systemInfo: {} 36 systemInfo: {}
36 }, 37 },
37 reportData: { 38 reportData: {
@@ -61,11 +62,17 @@ App({ @@ -61,11 +62,17 @@ App({
61 this.globalData.sid = MD5(timestamp); 62 this.globalData.sid = MD5(timestamp);
62 yas = new Yas(this); 63 yas = new Yas(this);
63 yas.report('YB_LAUNCH_APP'); 64 yas.report('YB_LAUNCH_APP');
  65 +
  66 + let scene = options ? options.scene : '';
  67 + this.globalData.currentScene = scene;
64 }, 68 },
65 onShow: function(options) { 69 onShow: function(options) {
66 udid.get(); // 生成 UDID 70 udid.get(); // 生成 UDID
67 verify.gen(); // 此处返回是是 Promise,需要调用接口的业务,最好在 then 里边执行 71 verify.gen(); // 此处返回是是 Promise,需要调用接口的业务,最好在 then 里边执行
68 72
  73 + let scene = options ? options.scene : '';
  74 + this.globalData.currentScene = scene;
  75 +
69 // wx.getLocation({}); // 获取位置信息 76 // wx.getLocation({}); // 获取位置信息
70 wx.checkSession().then(() => { // 微信登录未过期 77 wx.checkSession().then(() => { // 微信登录未过期
71 this.getWechatThirdSession(); 78 this.getWechatThirdSession();
@@ -148,12 +148,18 @@ Page(Object.assign({ @@ -148,12 +148,18 @@ Page(Object.assign({
148 scene = query.scene; 148 scene = query.scene;
149 } 149 }
150 150
  151 + let currentScene = app.globalData.currentScene;
  152 + let isGoApp = (currentScene == 1036 || currentScene == 1069) ? true : false;
  153 + let appParameter = `http://m.yohobuy.com?openby:yohobuy={\"action\":\"go.limitpurchase\",\"params\":{\"lp\":\"${limitProductCode}\"}}`;
  154 +
151 this.setData({ 155 this.setData({
152 limitProductCode, 156 limitProductCode,
153 originUid, 157 originUid,
154 originUnionID, 158 originUnionID,
155 uid, 159 uid,
156 - scene 160 + scene,
  161 + isGoApp,
  162 + appParameter
157 }); 163 });
158 164
159 yas = new Yas(app); // 实例化埋点 165 yas = new Yas(app); // 实例化埋点
@@ -745,6 +751,18 @@ Page(Object.assign({ @@ -745,6 +751,18 @@ Page(Object.assign({
745 error: false 751 error: false
746 }); 752 });
747 }, 753 },
  754 +
  755 + goApp : function(e) {
  756 +
  757 + },
  758 + launchAppError: function (e) {
  759 + wx.showToast({
  760 + title: '打开失败!您可能未安装Yoho!Buy官方APP,请下载后再尝试。',
  761 + icon: 'none',
  762 + duration: 3000
  763 + })
  764 + },
  765 +
748 goLogin(login = 1) { 766 goLogin(login = 1) {
749 let data = {}; 767 let data = {};
750 768
@@ -488,4 +488,8 @@ @@ -488,4 +488,8 @@
488 </yoho-alert> 488 </yoho-alert>
489 </block> 489 </block>
490 490
  491 +<button wx:if="{{isGoApp}}" class="appBtn" bindtap='goApp' type="default" hover-class="none" open-type="launchApp" app-parameter="{{appParameter}}" binderror="launchAppError">
  492 + <image class="appImg" src="../../../static/images/back2App@3x.png"></image>
  493 +</button>
  494 +
491 <template is="zan-actionsheet" data="{{...actionSheet}}" /> 495 <template is="zan-actionsheet" data="{{...actionSheet}}" />
@@ -259,3 +259,23 @@ @@ -259,3 +259,23 @@
259 padding: 0 0; 259 padding: 0 0;
260 width: 200rpx; 260 width: 200rpx;
261 } 261 }
  262 +
  263 +.appBtn {
  264 + position: fixed;
  265 + width: 80rpx;
  266 + height: 160rpx;
  267 + right: 50rpx;
  268 + bottom: 148rpx;
  269 + padding: 0;
  270 + align-self: center;
  271 + background-color: transparent !important;
  272 + z-index: 99;
  273 +}
  274 +.appBtn::after {
  275 + border: none;
  276 +}
  277 +
  278 +.appBtn .appImg {
  279 + width: 80rpx;
  280 + height: 160rpx;
  281 +}