From bef3a652349b7b79c914afcc013d7229706a2b3b Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期五, 09 六月 2023 09:10:32 +0800 Subject: [PATCH] Merge branch 'hotfix/修复苹果问题' --- /dev/null | 1 uniapp/pages/goods/goodsDetail.vue | 13 ++++++ uniapp/components/empowerModel.vue | 6 ++ uniapp/App.vue | 54 +++++++++++++++++++++++++- uniapp/components/pddremind.vue | 2 uniapp/pages/mine/mine.vue | 30 ++++++++++----- 6 files changed, 90 insertions(+), 16 deletions(-) diff --git a/uniapp/App.vue b/uniapp/App.vue index a2558af..28c9a50 100644 --- a/uniapp/App.vue +++ b/uniapp/App.vue @@ -135,7 +135,10 @@ userInfo: {}, canlisten: true, appinfo: {}, - ifwt: 0 + ifwt: 0, + hasinit:false, + hasbcinit:false, + }, onShow: function() { var that = this; @@ -147,10 +150,20 @@ content: '妫�娴嬪埌缃戠粶鏉冮檺鍙兘璁剧疆涓哄叧闂紝鎮ㄥ彲浠ュ湪鈥滆缃�濅腑妫�鏌ユ棤绾挎暟鎹強铚傜獫绉诲姩缃戠粶' }) }else{ - let appInfo = utils.getCacheSync('appInfo') - if(appInfo == "" || appInfo == undefined){ + console.log("鏄惁璇锋眰杩囷細"+that.globalData.hasinit) + if(!that.globalData.hasinit) + { that.getAppInfo(); } + if(!that.globalData.hasbcinit) + { + that.bcInit(); + } + /* let appInfo = utils.getCacheSync('appInfo') + if(appInfo == "" || appInfo == undefined){ + console.log("鑾峰彇鏂规硶") + that.getAppInfo(); + } */ } } }) @@ -169,10 +182,29 @@ onHide: function() {}, methods: { ...mapMutations(['login']), + bcInit:function() + { + var that = this; + console.log(uni.getSystemInfoSync().platform); + if (uni.getSystemInfoSync().platform == 'ios') + { + const plug = uni.requireNativePlugin('xiguazhu-baichuan'); + console.log(plug) + plug.init({}, result => { + console.log(result); // code绛変簬0灏辨槸鍒濆鍖栨垚鍔� + if(result.code==0) + { + that.globalData.hasbcinit=true; + } + }); + } + }, getAppInfo: function() { var that = this; this.$u.api.comminInt({}).then(e => { + console.log(e) if (e.code != 0) return that.$alert(e.msg) + that.globalData.hasinit=true; that.globalData.appinfo = e.data.basic utils.setCache('appInfo', e.data.basic) utils.setCache('baseUrl', this.$u.http.config.baseUrl) @@ -206,6 +238,22 @@ }).catch(function(err) {}) }, + + watch:function(method,istr){ + var obj=this.globalData + console.log(obj) + Object.defineProperty(obj,istr,{ + configurable:true, + enumerable:true, + set:function(value){ + this._consumerGoodsStatus=value + method(value) + }, + get:function(value){ + return this._consumerGoodsStatus + } + }) + }, }, } </script> diff --git a/uniapp/components/empowerModel.vue b/uniapp/components/empowerModel.vue index f104ba0..1e06b80 100644 --- a/uniapp/components/empowerModel.vue +++ b/uniapp/components/empowerModel.vue @@ -34,6 +34,10 @@ }, created() { this.applogo = getApp().globalData.appinfo.logo + if(!getApp().globalData.hasbcinit) + { + getApp().bcInit(); + } /* console.log(uni.getSystemInfoSync().platform); if (uni.getSystemInfoSync().platform == 'ios') { plug.init({}, result => { @@ -47,7 +51,7 @@ console.log(getApp().globalData.appinfo); console.log(plug); plug.login({}, result => { - console.log(plug); + console.log(result); var nick = result.userinfo.nick if (result.code == 0) { plug.taobaoOauth({ diff --git a/uniapp/components/pddremind.vue b/uniapp/components/pddremind.vue index 634e2e7..3cb6cbc 100644 --- a/uniapp/components/pddremind.vue +++ b/uniapp/components/pddremind.vue @@ -22,7 +22,7 @@ <script> import util from '../utils/utils.js' - const plug = uni.requireNativePlugin('Html5app-Baichuan') + const plug = uni.requireNativePlugin('xiguazhu-baichuan') export default { data() { return { diff --git a/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Headers b/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Headers deleted file mode 100644 index a177d2a..0000000 --- a/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Headers +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Headers \ No newline at end of file diff --git a/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Resources b/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Resources deleted file mode 100644 index 953ee36..0000000 --- a/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Resources +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Resources \ No newline at end of file diff --git a/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/UTDID b/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/UTDID deleted file mode 100644 index 97fe3a5..0000000 --- a/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/UTDID +++ /dev/null Binary files differ diff --git a/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Versions/A/Headers/AidProtocol.h b/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Versions/A/Headers/AidProtocol.h deleted file mode 100644 index e431bf3..0000000 --- a/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Versions/A/Headers/AidProtocol.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// AidProtocol.h -// UtdidSDK -// -// Created by ALLEN on 14-12-22. -// Copyright (c) 2014骞� Alvin. All rights reserved. -// - -#ifndef AidProtocol_h -#define AidProtocol_h - -#define EVENT_REQUEST_STARTED 1000 -#define EVENT_REQUEST_SUCCESS 1001 -#define EVENT_REQUEST_FAILED 1002 -#define EVENT_NETWORK_ERROR 1003 - -@protocol AidProtocolDelegate <NSObject> -@required -- (void) onAidEventChanged:(NSInteger)eventId - aid:(NSString *)aid; -@end - -#endif diff --git a/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Versions/A/Headers/UTDevice.h b/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Versions/A/Headers/UTDevice.h deleted file mode 100644 index 49ed9d1..0000000 --- a/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Versions/A/Headers/UTDevice.h +++ /dev/null @@ -1,56 +0,0 @@ -// -// UTDevice.h -// -// -// Created by Alvin on 4/21/13. -// -// 璁惧淇℃伅鐨勫垎瑁呯被锛歴dk鍚堜綔寮�鍙戦渶瑕佺敤杩欎釜绫绘彁渚涚殑璁惧淇℃伅鎺ュ彛 - -// Version:utdid4all-1.1.0 - -#ifndef UTDIDDevice_h -#define UTDIDDevice_h - -#import "AidProtocol.h" - -@interface UTDevice : NSObject - -/** - * @brief 鑾峰彇SDK鐢熸垚鐨勮澶囧敮涓�鏍囪瘑. - * - * @warning 璋冪敤璇存槑:杩欎釜璁惧鍞竴鏍囪瘑鏄寔涔呯殑,骞朵笖鏍煎紡瀹夊叏,iOS6浠ュ強浠ヤ笅,澶氬簲鐢ㄤ簰閫�. - * - * 璋冪敤椤哄簭:utdid浠绘剰鏃跺埢閮藉彲浠ヨ皟鐢�. - * - * @return 24瀛楄妭鐨勮澶囧敮涓�鏍囪瘑. - */ -+(NSString *) utdid; - -/** - * @brief 鍚屾鑾峰緱AID. - * - * @warning 璋冪敤璇存槑:鑻ユ湰鍦扮娌℃湁鏈�鏂癆ID锛屽皢鑰楄垂杩滅▼閫氫俊鏃堕棿骞堕樆濉炵嚎绋嬶紝寤鸿灏嗘璋冪敤缃簬闈炰富绾跨▼锛屾垨浣跨敤{@link getAidAsync}寮傛鑾峰緱AID銆� - * - * 璋冪敤椤哄簭:aid浠绘剰鏃跺埢閮藉彲浠ヨ皟鐢�. - * - * @return AID. - */ -+(NSString *) aid:(NSString *)appName - token:(NSString *)token; - -/** - * @brief 寮傛璇锋眰AID. - * - * @warning 璋冪敤璇存槑:鑻ユ湰鍦扮娌℃湁鏈�鏂癆ID锛屽皢寤虹珛寮傛璇锋眰鑾峰緱AID锛� - * - * 璋冪敤椤哄簭:aidAsync浠绘剰鏃跺埢閮藉彲浠ヨ皟鐢�. - * - * @return AID. - */ -+(void) aidAsync:(NSString *)appName - token:(NSString *)token - aidDelegate:(id<AidProtocolDelegate>)aidDelegate; - -@end - -#endif diff --git a/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Versions/A/Resources/Info.plist b/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Versions/A/Resources/Info.plist deleted file mode 100644 index cb425ba..0000000 --- a/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Versions/A/Resources/Info.plist +++ /dev/null Binary files differ diff --git a/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Versions/A/UTDID b/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Versions/A/UTDID deleted file mode 100644 index bc30575..0000000 --- a/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Versions/A/UTDID +++ /dev/null Binary files differ diff --git a/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Versions/Current b/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Versions/Current deleted file mode 100644 index 8c7e5a6..0000000 --- a/uniapp/nativeplugins/xiguazhu-baichuan/ios/UTDID.framework/Versions/Current +++ /dev/null @@ -1 +0,0 @@ -A \ No newline at end of file diff --git a/uniapp/pages/goods/goodsDetail.vue b/uniapp/pages/goods/goodsDetail.vue index 65d6aa6..c0ac99a 100644 --- a/uniapp/pages/goods/goodsDetail.vue +++ b/uniapp/pages/goods/goodsDetail.vue @@ -263,6 +263,7 @@ import pddEmpower from '../../components/pddempower.vue' import inviteCodeModel from '../../components/inviteCode.vue' import inviterModel from '../../components/inviterModel.vue' + export default { components: { empowerModel, @@ -305,6 +306,16 @@ if (this.memberId) { this.updataUser() } + + if(!getApp().globalData.hasinit) + { + console.log("鍒濆鍖�") + getApp().getAppInfo(); + } + if(!getApp().globalData.hasbcinit) + { + getApp().bcInit(); + } }, onLoad(options) { this.appinfo = utils.getCacheSync('appInfo') @@ -553,10 +564,12 @@ goodsId: this.optionsInfo.goodsId, type: 0 }).then(e => { + console.log(e) if (e.code != 0) return that.$alert(e.msg) var res = e.data.info; var tburl = res.shortUrl // #ifdef APP-PLUS + if (plus.runtime.isApplicationExist({ pname: 'com.taobao.taobao', action: 'taobao://' diff --git a/uniapp/pages/mine/mine.vue b/uniapp/pages/mine/mine.vue index 61fa61f..6256853 100644 --- a/uniapp/pages/mine/mine.vue +++ b/uniapp/pages/mine/mine.vue @@ -262,7 +262,6 @@ platform: '', showtar: false, bbcList:'', - sct: 0, inviteCodeShow:false, inviterShow:false @@ -278,6 +277,7 @@ this.getuserInfo(); this.centerInfo(); this.getmoneyInfo(); + this.getInit(); uni.stopPullDownRefresh(); }, onLoad() { @@ -286,24 +286,36 @@ url:"/pages/login/wxlogin" }) }else{ - // #ifdef APP-PLUS - this.appInfo = uni.getStorageSync('appInfo'); - console.log(this.appInfo.iosExamine); - this.showtar = getApp().globalData.ifwt == 1 ? false : true; - this.platform = plus.os.name - // #endif + //getApp().watch(this.ifwtChange,'ifwt') this.centerInfo() this.getbanner() } - }, onShow() { if(this.hasLogin){ + this.getInit(); this.getmoneyInfo() this.getuserInfo() } }, methods: { + getInit() + { + if(!getApp().globalData.hasinit) + { + getApp().getAppInfo(); + setTimeout(()=>{ + this.getInit(); + },2000) + } + + // #ifdef APP-PLUS + console.log(getApp().globalData.ifwt) + this.appInfo = uni.getStorageSync('appInfo'); + this.showtar = getApp().globalData.ifwt == 1 ? false : true; + this.platform = plus.os.name + // #endif + }, getmoneyInfo() { var that = this; this.$u.api.getEstimateAmount({}).then(e => { @@ -416,8 +428,6 @@ } }, - - cpr_version(a, b) { console.log(a); var _a = this.toNum(a), -- Gitblit v1.9.3