diff --git a/android/app/build.gradle b/android/app/build.gradle index 07302d39..be6c78ab 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -36,7 +36,6 @@ MobSDK { ShareSDK { - // platform configuration information devInfo { Wechat { id 4 diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 1d24a7a8..8d00ae52 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -7,7 +7,6 @@ PODS: - BaiduMapKit/Utils (6.2.0): - BaiduMapKit/Base - BMKLocationKit (2.0.0) - - Bugly (2.5.90) - Flutter (1.0.0) - flutter_baidu_mapapi_base (2.0.0): - BaiduMapKit/Utils (= 6.2.0) @@ -27,9 +26,6 @@ PODS: - flutter_bmflocation (1.0.3): - BMKLocationKit - Flutter - - flutter_bugly (0.0.1): - - Bugly - - Flutter - fluwx (0.0.1): - Flutter - WechatOpenSDK (= 1.8.7.1) @@ -108,7 +104,6 @@ DEPENDENCIES: - flutter_baidu_mapapi_search (from `.symlinks/plugins/flutter_baidu_mapapi_search/ios`) - flutter_baidu_mapapi_utils (from `.symlinks/plugins/flutter_baidu_mapapi_utils/ios`) - flutter_bmflocation (from `.symlinks/plugins/flutter_bmflocation/ios`) - - flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`) - fluwx (from `.symlinks/plugins/fluwx/ios`) - image_cropper (from `.symlinks/plugins/image_cropper/ios`) - image_picker (from `.symlinks/plugins/image_picker/ios`) @@ -129,7 +124,6 @@ SPEC REPOS: trunk: - BaiduMapKit - BMKLocationKit - - Bugly - FMDB - mob_sharesdk - MOBFoundation @@ -151,8 +145,6 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/flutter_baidu_mapapi_utils/ios" flutter_bmflocation: :path: ".symlinks/plugins/flutter_bmflocation/ios" - flutter_bugly: - :path: ".symlinks/plugins/flutter_bugly/ios" fluwx: :path: ".symlinks/plugins/fluwx/ios" image_cropper: @@ -185,14 +177,12 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: BaiduMapKit: 907c6d9b74f66c3ff4741fc4b568ae0b339917f8 BMKLocationKit: 097814ef672b1e57e86e6c1968d7892fb78002bf - Bugly: 88bc32c0acc6fef7b74d610f0319ee7560d6b9fe Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c flutter_baidu_mapapi_base: 90fddba11ec4435406a7211d6ee905b4311c31db flutter_baidu_mapapi_map: 771bf00671832b1fcddb17733518cd631529df16 flutter_baidu_mapapi_search: 4cffaa74e739a4114595c4f82f790e1783bb612d flutter_baidu_mapapi_utils: a5bd582b91ecd35be1bc45558b38f49d5684f70a flutter_bmflocation: 12f1ba91bae4b16d78d4f475023e0254ed351f1c - flutter_bugly: c9800f4d5bc5bdc27ffdde3417a26ba44266e0c3 fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902 FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a image_cropper: f1668dd8d2cad2d357955caad15a40547856edcb diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index abb6f228..656c85d9 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -47,6 +47,13 @@ 6EE8F376269581FB00237A5E /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F375269581FB00237A5E /* AddressBook.framework */; }; 6EE8F3782695820600237A5E /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F3772695820600237A5E /* libiconv.tbd */; }; 6EE8F37F269582C200237A5E /* UniappPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 6EE8F37E269582C200237A5E /* UniappPlugin.m */; }; + 89319A6F26E237A5001EFBD7 /* __uniappes6.js in Resources */ = {isa = PBXBuildFile; fileRef = 89319A6826E237A5001EFBD7 /* __uniappes6.js */; }; + 89319A7026E237A5001EFBD7 /* uni-jsframework.js in Resources */ = {isa = PBXBuildFile; fileRef = 89319A6926E237A5001EFBD7 /* uni-jsframework.js */; }; + 89319A7126E237A5001EFBD7 /* PandoraApi.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 89319A6A26E237A5001EFBD7 /* PandoraApi.bundle */; }; + 89319A7226E237A5001EFBD7 /* unincomponents.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 89319A6B26E237A5001EFBD7 /* unincomponents.ttf */; }; + 89319A7326E237A5001EFBD7 /* userPosition@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 89319A6C26E237A5001EFBD7 /* userPosition@2x.png */; }; + 89319A7426E237A5001EFBD7 /* weex-polyfill.js in Resources */ = {isa = PBXBuildFile; fileRef = 89319A6D26E237A5001EFBD7 /* weex-polyfill.js */; }; + 89319A7526E237A5001EFBD7 /* weexUniJs.js in Resources */ = {isa = PBXBuildFile; fileRef = 89319A6E26E237A5001EFBD7 /* weexUniJs.js */; }; 899C4C3C26A5179900B44087 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 899C4C3E26A5179900B44087 /* InfoPlist.strings */; }; 89A6269F26A7F6D30004A8F0 /* liblibPayment.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89A6269E26A7F6D30004A8F0 /* liblibPayment.a */; }; 89A626A126A7F6E30004A8F0 /* libwxpay.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89A626A026A7F6E30004A8F0 /* libwxpay.a */; }; @@ -214,6 +221,13 @@ 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 7AFFD8EE1D35381100E5BB4D /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppDelegate.mm; sourceTree = ""; }; 81880E8F5E90EA6E5E0D57EB /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 89319A6826E237A5001EFBD7 /* __uniappes6.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = __uniappes6.js; sourceTree = ""; }; + 89319A6926E237A5001EFBD7 /* uni-jsframework.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "uni-jsframework.js"; sourceTree = ""; }; + 89319A6A26E237A5001EFBD7 /* PandoraApi.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = PandoraApi.bundle; sourceTree = ""; }; + 89319A6B26E237A5001EFBD7 /* unincomponents.ttf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = unincomponents.ttf; sourceTree = ""; }; + 89319A6C26E237A5001EFBD7 /* userPosition@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "userPosition@2x.png"; sourceTree = ""; }; + 89319A6D26E237A5001EFBD7 /* weex-polyfill.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "weex-polyfill.js"; sourceTree = ""; }; + 89319A6E26E237A5001EFBD7 /* weexUniJs.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = weexUniJs.js; sourceTree = ""; }; 89847A4826A14482008C8077 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; 899C4C3826A5171500B44087 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = ""; }; 899C4C3926A5171500B44087 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = ""; }; @@ -393,6 +407,7 @@ 6EE8F2E52695815A00237A5E /* Resources */ = { isa = PBXGroup; children = ( + 89319A6726E237A5001EFBD7 /* Resources */, 89AEFA8226A684D700DD2817 /* userPosition@2x.png */, 6EE8F2E62695815A00237A5E /* __uniappes6.js */, 6EE8F2E72695815A00237A5E /* uni-jsframework.js */, @@ -524,6 +539,20 @@ path = Libs; sourceTree = ""; }; + 89319A6726E237A5001EFBD7 /* Resources */ = { + isa = PBXGroup; + children = ( + 89319A6826E237A5001EFBD7 /* __uniappes6.js */, + 89319A6926E237A5001EFBD7 /* uni-jsframework.js */, + 89319A6A26E237A5001EFBD7 /* PandoraApi.bundle */, + 89319A6B26E237A5001EFBD7 /* unincomponents.ttf */, + 89319A6C26E237A5001EFBD7 /* userPosition@2x.png */, + 89319A6D26E237A5001EFBD7 /* weex-polyfill.js */, + 89319A6E26E237A5001EFBD7 /* weexUniJs.js */, + ); + name = Resources; + sourceTree = ""; + }; 89A626A826A7FFF30004A8F0 /* wx */ = { isa = PBXGroup; children = ( @@ -678,18 +707,25 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 89319A6F26E237A5001EFBD7 /* __uniappes6.js in Resources */, 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 89319A7526E237A5001EFBD7 /* weexUniJs.js in Resources */, 6EE8F3452695816000237A5E /* __uniappes6.js in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 6EE8F3472695816000237A5E /* PandoraApi.bundle in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 89319A7126E237A5001EFBD7 /* PandoraApi.bundle in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 6EE8F3482695816000237A5E /* unincomponents.ttf in Resources */, 6EE8F34A2695816000237A5E /* weexUniJs.js in Resources */, 6EE8F3492695816000237A5E /* weex-polyfill.js in Resources */, 89AEFA8426A684D800DD2817 /* userPosition@2x.png in Resources */, 899C4C3C26A5179900B44087 /* InfoPlist.strings in Resources */, + 89319A7326E237A5001EFBD7 /* userPosition@2x.png in Resources */, 6EE8F3462695816000237A5E /* uni-jsframework.js in Resources */, + 89319A7226E237A5001EFBD7 /* unincomponents.ttf in Resources */, + 89319A7426E237A5001EFBD7 /* weex-polyfill.js in Resources */, + 89319A7026E237A5001EFBD7 /* uni-jsframework.js in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -874,7 +910,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 36; + CURRENT_PROJECT_VERSION = 38; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -924,7 +960,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 1.0.36; + MARKETING_VERSION = 1.0.38; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "$(inherited)", @@ -1110,7 +1146,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 36; + CURRENT_PROJECT_VERSION = 38; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -1160,7 +1196,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 1.0.36; + MARKETING_VERSION = 1.0.38; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -1239,7 +1275,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 36; + CURRENT_PROJECT_VERSION = 38; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -1289,7 +1325,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 1.0.36; + MARKETING_VERSION = 1.0.38; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "$(inherited)", diff --git a/ios/UniMPSDK/Resources/PandoraApi.bundle/all.js b/ios/UniMPSDK/Resources/PandoraApi.bundle/all.js index 15326c16..4b9ac84a 100644 --- a/ios/UniMPSDK/Resources/PandoraApi.bundle/all.js +++ b/ios/UniMPSDK/Resources/PandoraApi.bundle/all.js @@ -1 +1 @@ -var plusType;function __adsfsdaf99dsafsd090dsfsd__(){var a=["plus","tools","bridge","Console","console","concat","slice","call","logLevel","apply","j","o","stringify","c","","error JSON.stringify()ing argument: ","prototype","toString","","length","string","exec","shift","push","%","%","unshift","join","","log","LOG","info","INFO","warn","WARN","error","ERROR","assert","ASSERT:","clear","clear","time","valueOf","timeEnd","Timer [",": ","ms]","format","logLevel"," ","debug","addEventListener","error","message","\rfilename:","filename","\rlineno:","lineno"],e=(window[a[0]][a[1]],window[a[0]]);function t(e,t){t=[e][a[5]]([][a[6]][a[7]](t)),logger[a[8]][a[9]](logger,t)}function n(e,t){if(null==e)return[a[18]];if(1==arguments[a[19]])return[e[a[17]]()];typeof e!=a[20]&&(e=e[a[17]]());for(var n=/(.*?)%(.)(.*)/,i=e,o=[];t[a[19]];){var r=n[a[21]](i);if(!r)break;var s=t[a[22]](),i=r[3];o[a[23]](r[1]),r[2]!=a[24]?o[a[23]](function(e,t){try{switch(t){case a[10]:case a[11]:return JSON[a[12]](e);case a[13]:return a[14]}}catch(e){return a[15]+e}return null==e?Object[a[16]].toString[a[7]](e):e[a[17]]()}(s,r[2])):(o[a[23]](a[24]),t[a[26]](s))}o[a[23]](i);var c=[][a[6]][a[7]](t);return c[a[26]](o[a[27]](a[14])),c}B=window[a[0]][a[2]],_LOGF=a[3],winConsole=window[a[4]],Timers={},logger={},logger[a[29]]=function(e){t(a[30],arguments)},logger[a[31]]=function(e){t(a[32],arguments)},logger[a[33]]=function(e){t(a[34],arguments)},logger[a[35]]=function(e){t(a[36],arguments)},logger[a[37]]=function(e){if(!e){var t=vformat([][a[6]][a[7]](arguments,1));throw logger[a[29]](a[38]+t),new Error(t)}},logger[a[39]]=function(){B[a[21]](_LOGF,a[40],0)},logger[a[41]]=function(e){Timers[e]=(new Date)[a[42]]()},logger[a[43]]=function(e){var t=Timers[e];t&&(t=(new Date)[a[42]]()-t,logger[a[29]](a[44]+e+a[45]+t+a[46]))},logger[a[8]]=function(e){var t=[][a[6]][a[7]](arguments,1),t=logger[a[47]][a[9]](logger[a[47]],t);B[a[21]](_LOGF,a[48],[e,t])},logger[a[47]]=function(e,t){return n(e,[][a[6]][a[7]](arguments,1))[a[27]](a[49])},e[a[4]]={},e[a[4]][a[29]]=function(){},e[a[4]][a[31]]=function(){},e[a[4]][a[35]]=function(){},e[a[4]][a[33]]=function(){},e[a[4]][a[37]]=function(){},e[a[4]][a[39]]=function(){},e[a[4]][a[41]]=function(){},e[a[4]][a[43]]=function(){},e[a[1]][a[50]]&&(window[a[4]][a[29]]=logger[a[29]],window[a[4]][a[31]]=logger[a[31]],window[a[4]][a[35]]=logger[a[35]],window[a[4]][a[33]]=logger[a[33]],window[a[51]](a[52],function(e){e=e[a[53]]+a[54]+e[a[55]]+a[56]+e[a[57]];window[a[4]][a[35]](e)}))}window.plus&&(!window.plus||window.plus.isReady)||(plusType=typeof window.plus,"function"==plusType||"object"==plusType?(window.plus.isReady=!0,navigator.plus=window.__html5plus__=window.plus):window.__html5plus__=window.plus=navigator.plus={isReady:!0}),function(e){var i=e.tools={__UUID__:0,UNKNOWN:-1,IOS:0,ANDROID:1,platform:-1,debug:!1,UUID:function(e){return e+this.__UUID__+++(new Date).valueOf()},extend:function(e,t){for(var n in t)e[n]=t[n]},typeName:function(e){return Object.prototype.toString.call(e).slice(8,-1)},isDate:function(e){return"Date"==i.typeName(e)},isArray:function(e){return"Array"==i.typeName(e)},isDebug:function(){return e.tools.debug},stringify:function(e){return(window.JSON3||JSON).stringify(e)},isNumber:function(e){return"number"==typeof e||e instanceof Number},getElementOffsetInWebview:function(e,t){for(var n=0,i=e;i;)n+=i[t],i=i.offsetParent;return n},getElementOffsetXInWebview:function(e){return i.getElementOffsetInWebview(e,"offsetLeft")},getElementOffsetYInWebview:function(e){return i.getElementOffsetInWebview(e,"offsetTop")},execJSfile:function(e){var t=document.createElement("script");t.type="text/javascript",t.src=e,function e(t){var n=document.head,i=document.body;n?n.insertBefore(t,n.firstChild):i?i.insertBefore(t,i.firstChild):setTimeout(function(){e(t)},100)}(t)},copyObjProp2Obj:function(e,t,n){var i,o=n instanceof Array;for(i in t){var r=!0;if(o)for(var s=0;sthis.length?this.position=this.length:this.position=e)},t.truncate=function(e){if(this.readyState===y.WRITING)throw new u(u.INVALID_STATE_ERR);this.readyState=y.WRITING;var t=this;"function"==typeof t.onwritestart&&t.onwritestart(new i("writestart",{target:this})),a.exec(function(e){t.readyState!==y.DONE&&(t.readyState=y.DONE,t.length=e,t.position=Math.min(t.position,e),"function"==typeof t.onwrite&&t.onwrite(new i("write",{target:t})),"function"==typeof t.onwriteend&&t.onwriteend(new i("writeend",{target:t})))},function(e){t.readyState!==y.DONE&&(t.readyState=y.DONE,t.error=new u(e),"function"==typeof t.onerror&&t.onerror(new i("error",{target:t})),"function"==typeof t.onwriteend&&t.onwriteend(new i("writeend",{target:t})))},"truncate",[this.fileName,e,this.position])},e.io={FileSystem:v,DirectoryEntry:d,DirectoryReader:h,FileReader:p,FileWriter:y,requestFileSystem:function(t,n,i){function o(e){"function"==typeof i&&i(new u(e))}var r,e;t<1||4=this.southwest.longitude&&e.latitude<=this.northease.latitude&&e.latitude>=this.southwest.latitude)},g.prototype.equals=function(e){return e instanceof g&&(this.northease.equals(e.northease)&&this.southwest.equals(e.southwest))},g.prototype.getCenter=function(){var e=(this.northease.longitude-this.southwest.longitude)/2,t=(this.northease.latitude-this.southwest.latitude)/2;return new w(e+this.southwest.longitude,t+this.southwest.latitude)},(t=w.prototype).setLng=function(e){this.longitude=e},t.getLng=function(){return this.longitude},t.setLat=function(e){this.latitude=e},t.getLat=function(){return this.latitude},t.equals=function(e){return this.longitude==e.longitude&&this.latitude==e.latitude},(t=n.prototype).show=function(){1!=this.visable&&(this.visable=!0,p(this._UUID_,"show",["true"]))},t.hide=function(){0!=this.visable&&(this.visable=!1,p(this._UUID_,"hide",["false"]))},t.isVisible=function(){return this.visable},t.bringToTop=function(){p(this._UUID_,"bringToTop",[])},(t=b.prototype=new n).constructor=b,t.setPoint=function(e){e instanceof w&&(e=[this.point=e],p(this._UUID_,"setPoint",e))},t.getPoint=function(){return this.point},t.setIcon=function(e){"string"==typeof e&&(this.icon=e,p(this._UUID_,"setIcon",[e]))},t.setLabel=function(e){"string"==typeof e&&(this.caption=e,p(this._UUID_,"setLabel",[e]))},t.getLabel=function(){return this.caption},t.setBubble=function(e,t){var n,i;e instanceof v?((n=e.marker)&&n!=this&&(i=[n.bubble=null,null,null,null,!1],p(n._UUID_,"setBubble",i)),(e.marker=this).bubble=e,i=[this.bubble.label,this.bubble.icon,this.bubble.__contentImageAsDataURL,this.bubble.__contentImage,t],p(this._UUID_,"setBubble",i)):null==e&&p(this._UUID_,"setBubble",[null,null,null,null,t])},t.hideBubble=function(){this.bubble&&p(this._UUID_,"hideBubble",[])},t.getBubble=function(){return this.bubble},t.setDraggable=function(e){e!=this.canDraggable&&(this.canDraggable=!this.canDraggable,p(this._UUID_,"setDraggable",[this.canDraggable]))},t.isDraggable=function(){return this.canDraggable},t.setIcons=function(e,t){p(this._UUID_,"setIcons",[e,t])},(t=m.prototype=new n).constructor=m,t.setStrokeColor=function(e){"string"==typeof e&&(this.strokeColor=e,p(this._UUID_,"setStrokeColor",[e]))},t.getStrokeColor=function(){return this.strokeColor},t.setStrokeOpacity=function(e){"number"==typeof e&&(e<0?e=0:1this.options.minDistance&&(this.direction=1.73*nthis.options.minDistance&&(this.isPull=!0,this.options.onPullStart(e,this.distanceY))),this.isPull&&this.direction===o.DOWN&&(this.distanceY=t.pageY-this.startY,this.refreshY=parseInt(this.distanceY*this.options.pullRatio),this.options.onMove(e,this.distanceY)))},__end:function(e){!this.hasTouch||o.LEFT_RIGHT!==this.direction&&o.DOWN!==this.direction||(this.direction===o.LEFT_RIGHT&&(e.preventDefault(),e.stopPropagation(),this.options.onPullEnd(e,this.distanceX,o.LEFT_RIGHT)),this.direction===o.DOWN&&this.isPull&&(e.preventDefault(),e.stopPropagation(),this.options.onPullEnd(e,this.distanceY,o.DOWN))),this.hasTouch=!1,this.isPull=!1}},{init:function(e){return new r(e)},DIRECTION:o});function r(e){"string"==typeof e.con&&(e.con=t.querySelector(e.con)),this.options=Object.assign({},i,e),this.hasTouch=!1,this.direction=o.NONE,this.distanceX=this.startY=this.startX=0,this.isPull=!1,this.initEvent()}var w,F={drawArrow:w=function(e,t,n,i,o,r,s,c,a,u){"string"==typeof t&&(t=parseFloat(t)),"string"==typeof n&&(n=parseFloat(n)),"string"==typeof i&&(i=parseFloat(i)),"string"==typeof o&&(o=parseFloat(o)),r=void 0!==r?r:3,s=void 0!==s?s:1,c=void 0!==c?c:Math.PI/8,a=void 0!==a?a:10;var l,_,f="function"!=typeof r?b:r,d=Math.sqrt((i-t)*(i-t)+(o-n)*(o-n)),h=(d-a/3)/d,d=1&s?(l=Math.round(t+(i-t)*h),Math.round(n+(o-n)*h)):(l=i,o),h=2&s?(_=t+(i-t)*(1-h),n+(o-n)*(1-h)):(_=t,n);e.beginPath(),e.moveTo(_,h),e.lineTo(l,d),e.stroke();var p,y,v,g,d=Math.atan2(o-n,i-t),a=Math.abs(a/Math.cos(c));1&s&&(p=d+Math.PI+c,y=i+Math.cos(p)*a,v=o+Math.sin(p)*a,g=d+Math.PI-c,f(e,y,v,i,o,i+Math.cos(g)*a,o+Math.sin(g)*a,r,u)),2&s&&(p=d+c,g=d-c,f(e,y=t+Math.cos(p)*a,v=n+Math.sin(p)*a,t,n,t+Math.cos(g)*a,n+Math.sin(g)*a,r,u))},drawArcedArrow:function(e,t,n,i,o,r,s,c,a,u,l,_,f,d){var h,p,y,v,g;c=void 0!==c?c:3,a=void 0!==a?a:1,u=void 0!==u?u:Math.PI/8,l=void 0!==l?l:10,_=void 0!==_?_:1,e.save(),e.beginPath(),e.globalAlpha=1,e.restore(),e.lineWidth=_,e.beginPath(),e.arc(t,n,i,o,r,s),e.stroke(),1&a&&(h=Math.cos(o)*i+t,p=Math.sin(o)*i+n,y=Math.atan2(t-h,p-n),g=s?(v=h+10*Math.cos(y),p+10*Math.sin(y)):(v=h-10*Math.cos(y),p-10*Math.sin(y)),w(e,h,p,v,g,c,2,u,l,d)),2&a&&(h=Math.cos(r)*i+t,p=Math.sin(r)*i+n,y=Math.atan2(t-h,p-n),g=s?(v=h-10*Math.cos(y),p-10*Math.sin(y)):(v=h+10*Math.cos(y),p+10*Math.sin(y)),w(e,h-f*Math.sin(r),p+f*Math.cos(r),v-f*Math.sin(r),g+f*Math.cos(r),c,2,u,l,d)),e.restore()}};function b(e,t,n,i,o,r,s,c,a){switch("string"==typeof t&&(t=parseFloat(t)),"string"==typeof n&&(n=parseFloat(n)),"string"==typeof i&&(i=parseFloat(i)),"string"==typeof o&&(o=parseFloat(o)),"string"==typeof r&&(r=parseFloat(r)),"string"==typeof s&&(s=parseFloat(s)),Math.PI,e.save(),c){case 0:var u=Math.sqrt((r-t)*(r-t)+(s-n)*(s-n));e.arcTo(i,o,t,n,.55*u),e.fill();break;case 1:.5=this.minRefreshDistance&&(this.shouldRefresh=!0),this.shouldRefresh},pullTipExist:function(){return this.$pullTip},reset:function(){var e=this.isRefreshing;this.isRefreshing=!1,this.shouldRefresh=!1,this.removePullTip(e)},canvasObj:(a=s=c=null,u=!1,_=l=100,f=50,d=!(r=15),(h=["green"])[0],p=1,y={startAngle:0,speed:5,color:h[0],counterClockwise:!1,globalCompositeOperation:"source-out",lineWidth:r},v={startAngle:0,speed:5,color:"white",counterClockwise:!1,globalCompositeOperation:"destination-out",lineWidth:r+40},b=y,m="draw",I=50,S=x=w=g=0,{init:function(e,t){this.reset(),S=0,d=!1,s=e.querySelector("canvas"),a=s.getContext?s.getContext("2d"):s,u=!s.getContext,w=g=0,y.startAngle=v.startAngle=0,x=R(g),p=1,h=[t.options.color],y.color=h[p],m="draw",b=y,c=t,u?l=_=f=(40-2*9)/2:(l=_=100,f=50)},reset:function(){a=s=null},drawArrowedArcByDis:function(e){O(e)},drawArc:function(e){C?console.log("not support"):A()},clearCurrent:function(){var e,n,i,o,t;C?console.log("not support"):(t=c.$pullTip.ownerDocument.defaultView.getComputedStyle(c.$pullTip,null),(t=(e=t.transform,t=0,e&&(t=(e=(e=e.replace("matrix(","").replace(")","")).replace(/\s+/gi,"")).split(",")[5]||0),t))
'.replace(/\{WIDTH\}/g,40*this.options.ratio+"px").replace(/\{SHADOWOFFSETY\}/g,2*this.options.ratio).replace(/\{SHADOWBLUR\}/g,5*this.options.ratio),this.$pullTip=document.body.appendChild(t.firstElementChild),n=this.$pullTip,this.$pullTipInner=n.querySelector("div"),t=n.offsetHeight,E=25*this.options.ratio,this.minRefreshDistance=70*this.options.ratio,(n=n).querySelector("canvas"),n.style.top=this.options.offset-t+"px",n.style.webkitTransition="none",n.style.webkitTransform="translate3d(0,0,0)",this.initCanvas())},movePullTip:function(e,t,n){var i;this.pullTipExist()&&(i=Math.min(this.options.range+20*this.options.ratio,e),this.$pullTip.style.webkitTransition=t||"none",t=50*this.options.ratio,i=Math.max(0,i-t),this.$pullTip.style.webkitTransform="translate3d(0,"+i+"px,0)",this.$pullTip.style.height=Math.min(e,t)+"px",this.$pullTipInner.style.webkitTransform="translateY("+Math.min(0,Math.max(-t,e-t))+"px)",0===e?this.canvasObj.clearCurrent():E=40*this.options.ratio&&this.canvasObj.rotate(e),this.canvasObj.drawArrowedArcByDis(e-E),this.canvasObj.changeOpacity(e-E))))},changePullTip:function(e,t){this.pullTipExist()},removePullTip:function(e){this.pullTipExist()&&(e?(this.canvasObj.stopAuto(),this.$pullTip.style.webkitTransition="all 100ms linear",this.$pullTip.style.opacity=.1,this.$pullTip.style.webkitTransform+=" scale(0.1)"):(this.$pullTip.removeEventListener("webkitTransitionEnd",this.onTransitionEnd,!1),this.$pullTip.remove(),this.$pullTip=null))}},{init:function(e){return new t(e)}}}(),y=/complete|loaded|interactive/,v=!1;window.__setPullToRefresh__=function(i,o){var e;e=function(){return!i.support&&s?(s.reset(),s.touchPull.detachEvent(),void(v=!0)):void(i.support&&(980===(n=window.innerWidth)&&(n=window.plus&&plus.screen.resolutionWidth||window.screen.width),e=n/(window.plus&&plus.screen.resolutionWidth||window.screen.width),t=parseInt(i.offset),n=parseInt(i.range)||128,useCapture=!1!==i.useCapture,n=n*e+(t*=e),s?(s.options.useCapture=useCapture,v&&s.touchPull.initEvent(),i.offset&&(s.options.offset=t),i.range&&(s.options.range=n),i.color&&(s.options.color=i.color),s.options.doRefresh=o):s=c.init({offset:t,range:n,ratio:e,useCapture:useCapture,color:i.color||"green",doRefresh:o})));var e,t,n},y.test(document.readyState)?e():document.addEventListener("DOMContentLoaded",function(){e()},!1)},window.__endPullToRefresh__=function(){s&&s.reset()},window.__beginPullToRefresh__=function(){s&&s.beginPullToRefresh()}}(),__Mkey__Push__=function(){var i=[];return{pushCallback_Push:function(e,t,n){i[e]={fun:t,nokeep:n}},execCallback_Push:function(e,t,n){i[e]&&i[e].fun&&i[e].fun(n)}}}(),function(i){var i=i,o=window.plus.bridge,r=window.plus.tools,s="Push";function c(e,t,n){this.__UUID__=null,this.message=e,this.Payload=t,this.options=n}i.push={getClientInfo:function(){return o.execSync2(s,"getClientInfo",[])},getClientInfoAsync:function(t,n){var e=o.callbackId(function(e){"function"==typeof t&&t(e)},function(e){"function"==typeof n&&n(e)});o.exec(s,"getClientInfoAsync",[e])},createMessage:function(e,t,n){r.platform==r.IOS?o.exec(s,"createMessage",[e,t,n]):(n&&n.icon&&(n.icon=i.io.convertLocalFileSystemURL(n.icon)),e=new c(e,t,n),n=o.execSync(s,"createMessage",[e]),e.__UUID__=n)},clear:function(){o.exec(s,"clear",[])},addEventListener:function(e,t,n){var i=r.UUID(e);__Mkey__Push__.pushCallback_Push(i,t,n),o.exec(s,"addEventListener",[window.__HtMl_Id__,i,e])},remove:function(e){o.exec(s,"remove",[e.__UUID__])},getAllMessage:function(){return o.execSync(s,"getAllMessage",[])},setAutoNotification:function(e){o.exec(s,"setAutoNotification",[e])}}}(window.plus),function(e){var e=e,c=window.plus.bridge,a="Runtime";e.runtime={arguments:null,version:null,innerVersion:null,uniVersion:"",launchLoadedTime:null,launcher:null,origin:null,processId:null,startupTime:null,isRecovery:!1,restart:function(){c.exec(a,"restart",[])},install:function(e,t,n,i){i=c.callbackId(n,i);c.exec(a,"install",[e,i,t])},getProperty:function(e,t){t=c.callbackId(t);c.exec(a,"getProperty",[e,t])},quit:function(){c.exec(a,"quit",[])},openURL:function(e,t,n){var i=c.callbackId(null,function(e){"function"==typeof t&&t(e)});c.exec(a,"openURL",[e,i,n])},launchApplication:function(e,t){var n=c.callbackId(null,function(e){"function"==typeof t&&t(e)});c.exec(a,"launchApplication",[e,n])},setBadgeNumber:function(e,t){"number"==typeof e&&c.exec(a,"setBadgeNumber",[e,t])},openFile:function(e,t,n){var i=c.callbackId(null,function(e){"function"==typeof n&&n(e)});c.exec(a,"openFile",[e,t,i])},isStreamValid:function(){return c.execSync(a,"isStreamValid")},openWeb:function(e){return c.exec(a,"openWeb",[e])},isApplicationExist:function(e){return null!=e&&"string"!=typeof e&&c.execSync(a,"isApplicationExist",[e])},processDirectPage:function(){return c.execSync(a,"processDirectPage",[])},isCustomLaunchPath:function(){return c.execSync(a,"isCustomLaunchPath")},getDCloudId:function(){return c.execSync(a,"getDCloudId")},agreePrivacy:function(){c.exec(a,"agreePrivacy",[])},disagreePrivacy:function(){c.exec(a,"disagreePrivacy",[])},isAgreePrivacy:function(){return c.execSync(a,"isAgreePrivacy",[])},downloadFile:function(o,r,s){var e;if("string"==typeof o.url)10r.Uninitialized&&("function"==typeof this.onabort&&this.onabort(this.__progessEvent__),this.__init__(),o.exec(r.__F__,"abort",[this.__UUID__]))},s.getAllResponseHeaders=function(){if(this.readyState>=r.Receiving){if(this.__noParseResponseHeader__)return this.__noParseResponseHeader__;var e,t="";for(e in this.__responseHeaders__)t=t+e+": "+this.__responseHeaders__[e]+"\r\n";return this.__noParseResponseHeader__=t,this.__noParseResponseHeader__}return null},s.getResponseHeader=function(e){if("string"==typeof e&&this.readyState>=r.Receiving){var t=null;if(e=e.toLowerCase(),t=this.__cacheReponseHeaders__[e])return t;for(n in this.__responseHeaders__){var n,i=this.__responseHeaders__[n];e===(n=n.toLowerCase())&&(t=t?t+", "+i:i)}return this.__cacheReponseHeaders__[e]=t}return null},s.setRequestHeader=function(e,t){var n;"string"==typeof e&&"string"==typeof t&&r.Open==this.readyState&&(n=this.__requestHeaders__[e],this.__requestHeaders__[e]=n?n+", "+t:t)},s.open=function(e,t,n,i){r.Open!=this.readyState&&r.Loaded!=this.readyState||this.__init__(),r.Uninitialized==this.readyState&&(this.readyState=r.Open,o.exec(r.__F__,"open",[this.__UUID__,e,"string"==typeof(t=t)?0==(t=t.replace(/(^\s*)|(\s*$)/g,"")).indexOf("http://")||0==t.indexOf("https://")?t:t=0==t.indexOf("/")?location.origin+t:location.origin+location.pathname+t:"",n,i,this.timeout]),"function"==typeof this.onreadystatechange&&this.onreadystatechange())},s.overrideMimeType=function(e){o.exec(r.__F__,"overrideMimeType",[this.__UUID__,e])},s.send=function(e){var n=this;if(r.Open!=this.readyState)throw new Error("XMLHttpRequest not open");this.readyState=r.Sent,"function"==typeof this.onloadstart&&this.onloadstart(n.__progessEvent__);var t=o.callbackId(function(e){if(r.Receiving==e.readyState)r.Sent==n.readyState?(n.readyState=r.Receiving,n.status=e.status,n.statusText=e.statusText,n.__responseHeaders__=e.header,n.__progessEvent__.lengthComputable=e.lengthComputable,n.__progessEvent__.total=e.totalSize):r.Receiving==n.readyState&&(n.responseText=e.responseText,n.__progessEvent__.loaded=e.revSize),"function"==typeof n.onreadystatechange&&n.onreadystatechange(),"function"==typeof n.onprogress&&n.onprogress(n.__progessEvent__);else if(r.Loaded==e.readyState){n.readyState=r.Loaded,e.status&&(n.status=e.status);try{n.responseText&&(t=new DOMParser,n.responseXML=t.parseFromString(n.responseText,"text/xml"))}catch(e){n.responseXML=null}try{var t;"document"==n.responseType?(t=new DOMParser,n.response=n.responseXML):"json"==n.responseType&&(n.response=JSON.parse(n.responseText))}catch(e){n.response=null}"function"==typeof n.onreadystatechange&&n.onreadystatechange(),e.error==i.Timeout?"function"==typeof n.ontimeout&&n.ontimeout(n.__progessEvent__):e.error==i.Other?"function"==typeof n.onerror&&n.onerror(n.__progessEvent__):"function"==typeof n.onload&&n.onload(n.__progessEvent__),"function"==typeof n.onloadend&&n.onloadend(n.__progessEvent__)}});return o.exec(r.__F__,"send",[this.__UUID__,t,e,this.__requestHeaders__]),void("function"==typeof this.onreadystatechange&&this.onreadystatechange())},e.net={XMLHttpRequest:r}}(window.plus),function(e){var e=e,o=window.plus.bridge,r="Zip";e.zip={compressVideo:function(e,t,n){n=o.callbackId(function(e){t&&(e={tempFilePath:e.tempFilePath,size:e.size},t(e))},n);o.exec(r,"compressVideo",[e,n])},decompress:function(e,t,n,i){i=o.callbackId(n,i);o.exec(r,"decompress",[e,t,i])},compress:function(e,t,n,i){i=o.callbackId(n,i);o.exec(r,"compress",[e,t,i])},compressImage:function(e,t,n){n=o.callbackId(function(e){t&&(e={target:e.path,width:e.w,height:e.h,size:e.size},t(e))},n);o.exec(r,"compressImage",[e,n])}}}(window.plus),function(i){var r=(i=i).bridge,s="ShortVideo",o=i.tools;function c(e){return o.getElementOffsetXInWebview(e)}function a(e){return o.getElementOffsetYInWebview(e)}function e(e,t){this.id=o.UUID("dt"),this.IDENTITY=s,div=document.getElementById(e);var n=this.id,e=[];div&&(i.tools.platform==i.tools.ANDROID?document.addEventListener("plusorientationchange",function(){setTimeout(function(){var e=[c(div),a(div),div.offsetWidth,div.offsetHeight];r.exec(s,"resize",[n,e])},200)},!1):div.addEventListener("resize",function(){var e=[c(div),a(div),div.offsetWidth,div.offsetHeight];r.exec(s,"resize",[n,e])},!1),e=[c(div),a(div),div.offsetWidth,div.offsetHeight]),r.exec(s,"ShortVideo",[this.id,e,t])}var t=e.prototype;function n(e,t){this.id=o.UUID("dt"),this.IDENTITY=s,div=document.getElementById(e);var e=[],n=this.id;div&&(i.tools.platform==i.tools.ANDROID?document.addEventListener("plusorientationchange",function(){setTimeout(function(){var e=[c(div),a(div),div.offsetWidth,div.offsetHeight];r.exec(s,"shortVideoEditor_resize",[n,e])},200)},!1):div.addEventListener("resize",function(){var e=[c(div),a(div),div.offsetWidth,div.offsetHeight];r.exec(s,"shortVideoEditor_resize",[n,e])},!1),e=[c(div),a(div),div.offsetWidth,div.offsetHeight]),r.exec(s,"ShortVideoEditor",[this.id,e,t])}t.start=function(e){r.exec(s,"ShortVideo_start",[this.id,e])},t.pause=function(){r.exec(s,"ShortVideo_pause",[this.id])},t.resume=function(){r.exec(s,"ShortVideo_resume",[this.id])},t.stop=function(){r.exec(s,"ShortVideo_stop",[this.id])},t.close=function(){r.exec(s,"ShortVideo_close",[this.id])},t.switchCamera=function(e){r.exec(s,"ShortVideo_switchCamera",[this.id,e])},t.setStyles=function(e){r.exec(s,"ShortVideo_setStyles",[this.id,e])},t.startMixAudio=function(e){r.exec(s,"ShortVideo_startMixAudio",[this.id,e])},t.pauseMixAudio=function(){r.exec(s,"ShortVideo_pauseMixAudio",[this.id])},t.resumeMixAudio=function(){r.exec(s,"ShortVideo_resumeMixAudio",[this.id])},t.stopMixAudio=function(){r.exec(s,"ShortVideo_stopMixAudio",[this.id])},t.addEventListener=function(e,t){var n,i=this;t&&(n=function(e){"function"==typeof t&&(e.target=i,t(e))},t.callback=n,n=r.callbackId(n)),r.exec(s,"ShortVideo_addEventListener",[this.id,e,n])},(t=n.prototype).play=function(){r.exec(s,"shortVideoEditor_play",[this.id])},t.pause=function(){r.exec(s,"shortVideoEditor_pause",[this.id])},t.resume=function(){r.exec(s,"shortVideoEditor_resume",[this.id])},t.stop=function(){r.exec(s,"shortVideoEditor_stop",[this.id])},t.close=function(){r.exec(s,"shortVideoEditor_close",[this.id])},t.setStyles=function(e){r.exec(s,"shortVideoEditor_setStyles",[this.id,e])},t.save=function(e,t,n){var i="function"!=typeof t?null:function(e){t(e)},o="function"!=typeof n?null:function(e){n(e)},o=r.callbackId(i,o);r.exec(s,"shortVideoEditor_save",[this.id,e,o])},t.addEventListener=function(e,t){var n,i=this;t&&(n=function(e){"function"==typeof t&&(e.target=i,t(e))},t.callback=n,n=r.callbackId(n)),r.exec(s,"shortVideoEditor_addEventListener",[this.id,e,n])},t={Camera:e,Editor:n,upload:function(e,t,n){var i="function"!=typeof t?null:function(e){t(e)},o="function"!=typeof n?null:function(e){n(e)},o=r.callbackId(i,o);r.exec(s,"uploader",[e,o])}},i.shortvideo=t}(window.plus),function(e){var o="iBeacon",r=e.bridge,t={startBeaconDiscovery:function(t){if("object"==typeof t){var n="function"!=typeof t.complete?function(){}:t.complete,e="function"!=typeof t.success?n:function(e){t.success(e),n(e)},i="function"!=typeof t.fail?n:function(e){t.fail(e),n(e)};return callbackID=r.callbackId(e,i),r.exec(o,"startBeaconDiscovery",[callbackID,t.uuids])}},stopBeaconDiscovery:function(t){var n="function"!=typeof t.complete?function(){}:t.complete,e="function"!=typeof t.success?n:function(e){t.success(e),n(e)},i="function"!=typeof t.fail?n:function(e){t.fail(e),n(e)};return callbackID=r.callbackId(e,i),r.exec(o,"stopBeaconDiscovery",[callbackID])},getBeacons:function(t){var n="function"!=typeof t.complete?function(){}:t.complete,e="function"!=typeof t.success?n:function(e){t.success(e),n(e)},i="function"!=typeof t.fail?n:function(e){t.fail(e),n(e)};return callbackID=r.callbackId(e,i),r.exec(o,"getBeacons",[callbackID])},onBeaconUpdate:function(e){e="function"!=typeof e?null:e;return callbackID=r.callbackId(e),r.exec(o,"onBeaconUpdate",[callbackID])},onBeaconServiceChange:function(e){e="function"!=typeof e?null:e;return callbackID=r.callbackId(e),r.execSync(o,"onBeaconServiceChange",[callbackID])}};e.ibeacon=t}(window.plus),function(e){var i="Bluetooth",a=window.plus.bridge,t={closeBluetoothAdapter:function(e){return callbackID=this.getCallbackIDByFunction(e.success,e.fail,e.complete),a.exec(i,"closeBluetoothAdapter",[callbackID])},openBluetoothAdapter:function(e){return callbackID=this.getCallbackIDByFunction(e.success,e.fail,e.complete),a.exec(i,"openBluetoothAdapter",[callbackID])},getBluetoothAdapterState:function(e){return callbackID=this.getCallbackIDByFunction(e.success,e.fail,e.complete),a.exec(i,"getBluetoothAdapterState",[callbackID])},getBluetoothDevices:function(r){var s=this,c="function"!=typeof r.complete?function(){}:r.complete,e="function"!=typeof r.success?null:function(e){for(var t=e.devices,n=0;nthis.length?this.position=this.length:this.position=e)},t.truncate=function(e){if(this.readyState===y.WRITING)throw new u(u.INVALID_STATE_ERR);this.readyState=y.WRITING;var t=this;"function"==typeof t.onwritestart&&t.onwritestart(new i("writestart",{target:this})),c.exec(function(e){t.readyState!==y.DONE&&(t.readyState=y.DONE,t.length=e,t.position=Math.min(t.position,e),"function"==typeof t.onwrite&&t.onwrite(new i("write",{target:t})),"function"==typeof t.onwriteend&&t.onwriteend(new i("writeend",{target:t})))},function(e){t.readyState!==y.DONE&&(t.readyState=y.DONE,t.error=new u(e),"function"==typeof t.onerror&&t.onerror(new i("error",{target:t})),"function"==typeof t.onwriteend&&t.onwriteend(new i("writeend",{target:t})))},"truncate",[this.fileName,e,this.position])},e.io={FileSystem:v,DirectoryEntry:d,DirectoryReader:h,FileReader:p,FileWriter:y,requestFileSystem:function(t,n,i){function o(e){"function"==typeof i&&i(new u(e))}var r,e;t<1||4=this.southwest.longitude&&e.latitude<=this.northease.latitude&&e.latitude>=this.southwest.latitude)},g.prototype.equals=function(e){return e instanceof g&&(this.northease.equals(e.northease)&&this.southwest.equals(e.southwest))},g.prototype.getCenter=function(){var e=(this.northease.longitude-this.southwest.longitude)/2,t=(this.northease.latitude-this.southwest.latitude)/2;return new w(e+this.southwest.longitude,t+this.southwest.latitude)},(t=w.prototype).setLng=function(e){this.longitude=e},t.getLng=function(){return this.longitude},t.setLat=function(e){this.latitude=e},t.getLat=function(){return this.latitude},t.equals=function(e){return this.longitude==e.longitude&&this.latitude==e.latitude},(t=n.prototype).show=function(){1!=this.visable&&(this.visable=!0,p(this._UUID_,"show",["true"]))},t.hide=function(){0!=this.visable&&(this.visable=!1,p(this._UUID_,"hide",["false"]))},t.isVisible=function(){return this.visable},t.bringToTop=function(){p(this._UUID_,"bringToTop",[])},(t=b.prototype=new n).constructor=b,t.setPoint=function(e){e instanceof w&&(e=[this.point=e],p(this._UUID_,"setPoint",e))},t.getPoint=function(){return this.point},t.setIcon=function(e){"string"==typeof e&&(this.icon=e,p(this._UUID_,"setIcon",[e]))},t.setLabel=function(e){"string"==typeof e&&(this.caption=e,p(this._UUID_,"setLabel",[e]))},t.getLabel=function(){return this.caption},t.setBubble=function(e,t){var n,i;e instanceof v?((n=e.marker)&&n!=this&&(i=[n.bubble=null,null,null,null,!1],p(n._UUID_,"setBubble",i)),(e.marker=this).bubble=e,i=[this.bubble.label,this.bubble.icon,this.bubble.__contentImageAsDataURL,this.bubble.__contentImage,t],p(this._UUID_,"setBubble",i)):null==e&&p(this._UUID_,"setBubble",[null,null,null,null,t])},t.hideBubble=function(){this.bubble&&p(this._UUID_,"hideBubble",[])},t.getBubble=function(){return this.bubble},t.setDraggable=function(e){e!=this.canDraggable&&(this.canDraggable=!this.canDraggable,p(this._UUID_,"setDraggable",[this.canDraggable]))},t.isDraggable=function(){return this.canDraggable},t.setIcons=function(e,t){p(this._UUID_,"setIcons",[e,t])},(t=m.prototype=new n).constructor=m,t.setStrokeColor=function(e){"string"==typeof e&&(this.strokeColor=e,p(this._UUID_,"setStrokeColor",[e]))},t.getStrokeColor=function(){return this.strokeColor},t.setStrokeOpacity=function(e){"number"==typeof e&&(e<0?e=0:1this.options.minDistance&&(this.direction=1.73*nthis.options.minDistance&&(this.isPull=!0,this.options.onPullStart(e,this.distanceY))),this.isPull&&this.direction===o.DOWN&&(this.distanceY=t.pageY-this.startY,this.refreshY=parseInt(this.distanceY*this.options.pullRatio),this.options.onMove(e,this.distanceY)))},__end:function(e){!this.hasTouch||o.LEFT_RIGHT!==this.direction&&o.DOWN!==this.direction||(this.direction===o.LEFT_RIGHT&&(e.preventDefault(),e.stopPropagation(),this.options.onPullEnd(e,this.distanceX,o.LEFT_RIGHT)),this.direction===o.DOWN&&this.isPull&&(e.preventDefault(),e.stopPropagation(),this.options.onPullEnd(e,this.distanceY,o.DOWN))),this.hasTouch=!1,this.isPull=!1}},{init:function(e){return new r(e)},DIRECTION:o});function r(e){"string"==typeof e.con&&(e.con=t.querySelector(e.con)),this.options=Object.assign({},i,e),this.hasTouch=!1,this.direction=o.NONE,this.distanceX=this.startY=this.startX=0,this.isPull=!1,this.initEvent()}var w,F={drawArrow:w=function(e,t,n,i,o,r,s,a,c,u){"string"==typeof t&&(t=parseFloat(t)),"string"==typeof n&&(n=parseFloat(n)),"string"==typeof i&&(i=parseFloat(i)),"string"==typeof o&&(o=parseFloat(o)),r=void 0!==r?r:3,s=void 0!==s?s:1,a=void 0!==a?a:Math.PI/8,c=void 0!==c?c:10;var l,_,f="function"!=typeof r?b:r,d=Math.sqrt((i-t)*(i-t)+(o-n)*(o-n)),h=(d-c/3)/d,d=1&s?(l=Math.round(t+(i-t)*h),Math.round(n+(o-n)*h)):(l=i,o),h=2&s?(_=t+(i-t)*(1-h),n+(o-n)*(1-h)):(_=t,n);e.beginPath(),e.moveTo(_,h),e.lineTo(l,d),e.stroke();var p,y,v,g,d=Math.atan2(o-n,i-t),c=Math.abs(c/Math.cos(a));1&s&&(p=d+Math.PI+a,y=i+Math.cos(p)*c,v=o+Math.sin(p)*c,g=d+Math.PI-a,f(e,y,v,i,o,i+Math.cos(g)*c,o+Math.sin(g)*c,r,u)),2&s&&(p=d+a,g=d-a,f(e,y=t+Math.cos(p)*c,v=n+Math.sin(p)*c,t,n,t+Math.cos(g)*c,n+Math.sin(g)*c,r,u))},drawArcedArrow:function(e,t,n,i,o,r,s,a,c,u,l,_,f,d){var h,p,y,v,g;a=void 0!==a?a:3,c=void 0!==c?c:1,u=void 0!==u?u:Math.PI/8,l=void 0!==l?l:10,_=void 0!==_?_:1,e.save(),e.beginPath(),e.globalAlpha=1,e.restore(),e.lineWidth=_,e.beginPath(),e.arc(t,n,i,o,r,s),e.stroke(),1&c&&(h=Math.cos(o)*i+t,p=Math.sin(o)*i+n,y=Math.atan2(t-h,p-n),g=s?(v=h+10*Math.cos(y),p+10*Math.sin(y)):(v=h-10*Math.cos(y),p-10*Math.sin(y)),w(e,h,p,v,g,a,2,u,l,d)),2&c&&(h=Math.cos(r)*i+t,p=Math.sin(r)*i+n,y=Math.atan2(t-h,p-n),g=s?(v=h-10*Math.cos(y),p-10*Math.sin(y)):(v=h+10*Math.cos(y),p+10*Math.sin(y)),w(e,h-f*Math.sin(r),p+f*Math.cos(r),v-f*Math.sin(r),g+f*Math.cos(r),a,2,u,l,d)),e.restore()}};function b(e,t,n,i,o,r,s,a,c){switch("string"==typeof t&&(t=parseFloat(t)),"string"==typeof n&&(n=parseFloat(n)),"string"==typeof i&&(i=parseFloat(i)),"string"==typeof o&&(o=parseFloat(o)),"string"==typeof r&&(r=parseFloat(r)),"string"==typeof s&&(s=parseFloat(s)),Math.PI,e.save(),a){case 0:var u=Math.sqrt((r-t)*(r-t)+(s-n)*(s-n));e.arcTo(i,o,t,n,.55*u),e.fill();break;case 1:.5=this.minRefreshDistance&&(this.shouldRefresh=!0),this.shouldRefresh},pullTipExist:function(){return this.$pullTip},reset:function(){var e=this.isRefreshing;this.isRefreshing=!1,this.shouldRefresh=!1,this.removePullTip(e)},canvasObj:(c=s=a=null,u=!1,_=l=100,f=50,d=!(r=15),(h=["green"])[0],p=1,y={startAngle:0,speed:5,color:h[0],counterClockwise:!1,globalCompositeOperation:"source-out",lineWidth:r},v={startAngle:0,speed:5,color:"white",counterClockwise:!1,globalCompositeOperation:"destination-out",lineWidth:r+40},b=y,m="draw",I=50,S=x=w=g=0,{init:function(e,t){this.reset(),S=0,d=!1,s=e.querySelector("canvas"),c=s.getContext?s.getContext("2d"):s,u=!s.getContext,w=g=0,y.startAngle=v.startAngle=0,x=R(g),p=1,h=[t.options.color],y.color=h[p],m="draw",b=y,a=t,u?l=_=f=(40-2*9)/2:(l=_=100,f=50)},reset:function(){c=s=null},drawArrowedArcByDis:function(e){O(e)},drawArc:function(e){C?console.log("not support"):A()},clearCurrent:function(){var e,n,i,o,t;C?console.log("not support"):(t=a.$pullTip.ownerDocument.defaultView.getComputedStyle(a.$pullTip,null),(t=(e=t.transform,t=0,e&&(t=(e=(e=e.replace("matrix(","").replace(")","")).replace(/\s+/gi,"")).split(",")[5]||0),t))
'.replace(/\{WIDTH\}/g,40*this.options.ratio+"px").replace(/\{SHADOWOFFSETY\}/g,2*this.options.ratio).replace(/\{SHADOWBLUR\}/g,5*this.options.ratio),this.$pullTip=document.body.appendChild(t.firstElementChild),n=this.$pullTip,this.$pullTipInner=n.querySelector("div"),t=n.offsetHeight,E=25*this.options.ratio,this.minRefreshDistance=70*this.options.ratio,(n=n).querySelector("canvas"),n.style.top=this.options.offset-t+"px",n.style.webkitTransition="none",n.style.webkitTransform="translate3d(0,0,0)",this.initCanvas())},movePullTip:function(e,t,n){var i;this.pullTipExist()&&(i=Math.min(this.options.range+20*this.options.ratio,e),this.$pullTip.style.webkitTransition=t||"none",t=50*this.options.ratio,i=Math.max(0,i-t),this.$pullTip.style.webkitTransform="translate3d(0,"+i+"px,0)",this.$pullTip.style.height=Math.min(e,t)+"px",this.$pullTipInner.style.webkitTransform="translateY("+Math.min(0,Math.max(-t,e-t))+"px)",0===e?this.canvasObj.clearCurrent():E=40*this.options.ratio&&this.canvasObj.rotate(e),this.canvasObj.drawArrowedArcByDis(e-E),this.canvasObj.changeOpacity(e-E))))},changePullTip:function(e,t){this.pullTipExist()},removePullTip:function(e){this.pullTipExist()&&(e?(this.canvasObj.stopAuto(),this.$pullTip.style.webkitTransition="all 100ms linear",this.$pullTip.style.opacity=.1,this.$pullTip.style.webkitTransform+=" scale(0.1)"):(this.$pullTip.removeEventListener("webkitTransitionEnd",this.onTransitionEnd,!1),this.$pullTip.remove(),this.$pullTip=null))}},{init:function(e){return new t(e)}}}(),y=/complete|loaded|interactive/,v=!1;window.__setPullToRefresh__=function(i,o){var e;e=function(){return!i.support&&s?(s.reset(),s.touchPull.detachEvent(),void(v=!0)):void(i.support&&(980===(n=window.innerWidth)&&(n=window.plus&&plus.screen.resolutionWidth||window.screen.width),e=n/(window.plus&&plus.screen.resolutionWidth||window.screen.width),t=parseInt(i.offset),n=parseInt(i.range)||128,useCapture=!1!==i.useCapture,n=n*e+(t*=e),s?(s.options.useCapture=useCapture,v&&s.touchPull.initEvent(),i.offset&&(s.options.offset=t),i.range&&(s.options.range=n),i.color&&(s.options.color=i.color),s.options.doRefresh=o):s=a.init({offset:t,range:n,ratio:e,useCapture:useCapture,color:i.color||"green",doRefresh:o})));var e,t,n},y.test(document.readyState)?e():document.addEventListener("DOMContentLoaded",function(){e()},!1)},window.__endPullToRefresh__=function(){s&&s.reset()},window.__beginPullToRefresh__=function(){s&&s.beginPullToRefresh()}}(),__Mkey__Push__=function(){var i=[];return{pushCallback_Push:function(e,t,n){i[e]={fun:t,nokeep:n}},execCallback_Push:function(e,t,n){i[e]&&i[e].fun&&i[e].fun(n)}}}(),function(i){var i=i,o=window.plus.bridge,r=window.plus.tools,s="Push";function a(e,t,n){this.__UUID__=null,this.message=e,this.Payload=t,this.options=n}i.push={getClientInfo:function(){return o.execSync2(s,"getClientInfo",[])},getClientInfoAsync:function(t,n){var e=o.callbackId(function(e){"function"==typeof t&&t(e)},function(e){"function"==typeof n&&n(e)});o.exec(s,"getClientInfoAsync",[e])},createMessage:function(e,t,n){r.platform==r.IOS?o.exec(s,"createMessage",[e,t,n]):(n&&n.icon&&(n.icon=i.io.convertLocalFileSystemURL(n.icon)),e=new a(e,t,n),n=o.execSync(s,"createMessage",[e]),e.__UUID__=n)},clear:function(){o.exec(s,"clear",[])},addEventListener:function(e,t,n){var i=r.UUID(e);__Mkey__Push__.pushCallback_Push(i,t,n),o.exec(s,"addEventListener",[window.__HtMl_Id__,i,e])},remove:function(e){o.exec(s,"remove",[e.__UUID__])},getAllMessage:function(){return o.execSync(s,"getAllMessage",[])},setAutoNotification:function(e){o.exec(s,"setAutoNotification",[e])}}}(window.plus),function(e){var e=e,a=window.plus.bridge,c="Runtime";e.runtime={arguments:null,version:null,innerVersion:null,uniVersion:"",launchLoadedTime:null,launcher:null,origin:null,processId:null,startupTime:null,isRecovery:!1,restart:function(){a.exec(c,"restart",[])},install:function(e,t,n,i){i=a.callbackId(n,i);a.exec(c,"install",[e,i,t])},getProperty:function(e,t){t=a.callbackId(t);a.exec(c,"getProperty",[e,t])},quit:function(){a.exec(c,"quit",[])},openURL:function(e,t,n){var i=a.callbackId(null,function(e){"function"==typeof t&&t(e)});a.exec(c,"openURL",[e,i,n])},launchApplication:function(e,t){var n=a.callbackId(null,function(e){"function"==typeof t&&t(e)});a.exec(c,"launchApplication",[e,n])},setBadgeNumber:function(e,t){"number"==typeof e&&a.exec(c,"setBadgeNumber",[e,t])},openFile:function(e,t,n){var i=a.callbackId(null,function(e){"function"==typeof n&&n(e)});a.exec(c,"openFile",[e,t,i])},openDocument:function(e,t,n,i){var o=a.callbackId(function(e){"function"==typeof n&&n(e)},function(e){"function"==typeof i&&i(e)});a.exec(c,"openDocument",[e,t,o])},isStreamValid:function(){return a.execSync(c,"isStreamValid")},openWeb:function(e){return a.exec(c,"openWeb",[e])},isApplicationExist:function(e){return null!=e&&"string"!=typeof e&&a.execSync(c,"isApplicationExist",[e])},processDirectPage:function(){return a.execSync(c,"processDirectPage",[])},isCustomLaunchPath:function(){return a.execSync(c,"isCustomLaunchPath")},getDCloudId:function(){return a.execSync(c,"getDCloudId")},agreePrivacy:function(){a.exec(c,"agreePrivacy",[])},disagreePrivacy:function(){a.exec(c,"disagreePrivacy",[])},isAgreePrivacy:function(){return a.execSync(c,"isAgreePrivacy",[])},downloadFile:function(o,r,s){var e;if("string"==typeof o.url)10r.Uninitialized&&("function"==typeof this.onabort&&this.onabort(this.__progessEvent__),this.__init__(),o.exec(r.__F__,"abort",[this.__UUID__]))},s.getAllResponseHeaders=function(){if(this.readyState>=r.Receiving){if(this.__noParseResponseHeader__)return this.__noParseResponseHeader__;var e,t="";for(e in this.__responseHeaders__)t=t+e+": "+this.__responseHeaders__[e]+"\r\n";return this.__noParseResponseHeader__=t,this.__noParseResponseHeader__}return null},s.getResponseHeader=function(e){if("string"==typeof e&&this.readyState>=r.Receiving){var t=null;if(e=e.toLowerCase(),t=this.__cacheReponseHeaders__[e])return t;for(n in this.__responseHeaders__){var n,i=this.__responseHeaders__[n];e===(n=n.toLowerCase())&&(t=t?t+", "+i:i)}return this.__cacheReponseHeaders__[e]=t}return null},s.setRequestHeader=function(e,t){var n;"string"==typeof e&&"string"==typeof t&&r.Open==this.readyState&&(n=this.__requestHeaders__[e],this.__requestHeaders__[e]=n?n+", "+t:t)},s.open=function(e,t,n,i){r.Open!=this.readyState&&r.Loaded!=this.readyState||this.__init__(),r.Uninitialized==this.readyState&&(this.readyState=r.Open,o.exec(r.__F__,"open",[this.__UUID__,e,"string"==typeof(t=t)?0==(t=t.replace(/(^\s*)|(\s*$)/g,"")).indexOf("http://")||0==t.indexOf("https://")?t:t=0==t.indexOf("/")?location.origin+t:location.origin+location.pathname+t:"",n,i,this.timeout]),"function"==typeof this.onreadystatechange&&this.onreadystatechange())},s.overrideMimeType=function(e){o.exec(r.__F__,"overrideMimeType",[this.__UUID__,e])},s.send=function(e){var n=this;if(r.Open!=this.readyState)throw new Error("XMLHttpRequest not open");this.readyState=r.Sent,"function"==typeof this.onloadstart&&this.onloadstart(n.__progessEvent__);var t=o.callbackId(function(e){if(r.Receiving==e.readyState)r.Sent==n.readyState?(n.readyState=r.Receiving,n.status=e.status,n.statusText=e.statusText,n.__responseHeaders__=e.header,n.__progessEvent__.lengthComputable=e.lengthComputable,n.__progessEvent__.total=e.totalSize):r.Receiving==n.readyState&&(n.responseText=e.responseText,n.__progessEvent__.loaded=e.revSize),"function"==typeof n.onreadystatechange&&n.onreadystatechange(),"function"==typeof n.onprogress&&n.onprogress(n.__progessEvent__);else if(r.Loaded==e.readyState){n.readyState=r.Loaded,e.status&&(n.status=e.status);try{n.responseText&&(t=new DOMParser,n.responseXML=t.parseFromString(n.responseText,"text/xml"))}catch(e){n.responseXML=null}try{var t;"document"==n.responseType?(t=new DOMParser,n.response=n.responseXML):"json"==n.responseType&&(n.response=JSON.parse(n.responseText))}catch(e){n.response=null}"function"==typeof n.onreadystatechange&&n.onreadystatechange(),e.error==i.Timeout?"function"==typeof n.ontimeout&&n.ontimeout(n.__progessEvent__):e.error==i.Other?"function"==typeof n.onerror&&n.onerror(n.__progessEvent__):"function"==typeof n.onload&&n.onload(n.__progessEvent__),"function"==typeof n.onloadend&&n.onloadend(n.__progessEvent__)}});return o.exec(r.__F__,"send",[this.__UUID__,t,e,this.__requestHeaders__]),void("function"==typeof this.onreadystatechange&&this.onreadystatechange())},e.net={XMLHttpRequest:r}}(window.plus),function(e){var e=e,o=window.plus.bridge,r="Zip";e.zip={compressVideo:function(e,t,n){n=o.callbackId(function(e){t&&(e={tempFilePath:e.tempFilePath,size:e.size},t(e))},n);o.exec(r,"compressVideo",[e,n])},decompress:function(e,t,n,i){i=o.callbackId(n,i);o.exec(r,"decompress",[e,t,i])},compress:function(e,t,n,i){i=o.callbackId(n,i);o.exec(r,"compress",[e,t,i])},compressImage:function(e,t,n){n=o.callbackId(function(e){t&&(e={target:e.path,width:e.w,height:e.h,size:e.size},t(e))},n);o.exec(r,"compressImage",[e,n])}}}(window.plus),function(i){var r=(i=i).bridge,s="ShortVideo",o=i.tools;function a(e){return o.getElementOffsetXInWebview(e)}function c(e){return o.getElementOffsetYInWebview(e)}function e(e,t){this.id=o.UUID("dt"),this.IDENTITY=s,div=document.getElementById(e);var n=this.id,e=[];div&&(i.tools.platform==i.tools.ANDROID?document.addEventListener("plusorientationchange",function(){setTimeout(function(){var e=[a(div),c(div),div.offsetWidth,div.offsetHeight];r.exec(s,"resize",[n,e])},200)},!1):div.addEventListener("resize",function(){var e=[a(div),c(div),div.offsetWidth,div.offsetHeight];r.exec(s,"resize",[n,e])},!1),e=[a(div),c(div),div.offsetWidth,div.offsetHeight]),r.exec(s,"ShortVideo",[this.id,e,t])}var t=e.prototype;function n(e,t){this.id=o.UUID("dt"),this.IDENTITY=s,div=document.getElementById(e);var e=[],n=this.id;div&&(i.tools.platform==i.tools.ANDROID?document.addEventListener("plusorientationchange",function(){setTimeout(function(){var e=[a(div),c(div),div.offsetWidth,div.offsetHeight];r.exec(s,"shortVideoEditor_resize",[n,e])},200)},!1):div.addEventListener("resize",function(){var e=[a(div),c(div),div.offsetWidth,div.offsetHeight];r.exec(s,"shortVideoEditor_resize",[n,e])},!1),e=[a(div),c(div),div.offsetWidth,div.offsetHeight]),r.exec(s,"ShortVideoEditor",[this.id,e,t])}t.start=function(e){r.exec(s,"ShortVideo_start",[this.id,e])},t.pause=function(){r.exec(s,"ShortVideo_pause",[this.id])},t.resume=function(){r.exec(s,"ShortVideo_resume",[this.id])},t.stop=function(){r.exec(s,"ShortVideo_stop",[this.id])},t.close=function(){r.exec(s,"ShortVideo_close",[this.id])},t.switchCamera=function(e){r.exec(s,"ShortVideo_switchCamera",[this.id,e])},t.setStyles=function(e){r.exec(s,"ShortVideo_setStyles",[this.id,e])},t.startMixAudio=function(e){r.exec(s,"ShortVideo_startMixAudio",[this.id,e])},t.pauseMixAudio=function(){r.exec(s,"ShortVideo_pauseMixAudio",[this.id])},t.resumeMixAudio=function(){r.exec(s,"ShortVideo_resumeMixAudio",[this.id])},t.stopMixAudio=function(){r.exec(s,"ShortVideo_stopMixAudio",[this.id])},t.addEventListener=function(e,t){var n,i=this;t&&(n=function(e){"function"==typeof t&&(e.target=i,t(e))},t.callback=n,n=r.callbackId(n)),r.exec(s,"ShortVideo_addEventListener",[this.id,e,n])},(t=n.prototype).play=function(){r.exec(s,"shortVideoEditor_play",[this.id])},t.pause=function(){r.exec(s,"shortVideoEditor_pause",[this.id])},t.resume=function(){r.exec(s,"shortVideoEditor_resume",[this.id])},t.stop=function(){r.exec(s,"shortVideoEditor_stop",[this.id])},t.close=function(){r.exec(s,"shortVideoEditor_close",[this.id])},t.setStyles=function(e){r.exec(s,"shortVideoEditor_setStyles",[this.id,e])},t.save=function(e,t,n){var i="function"!=typeof t?null:function(e){t(e)},o="function"!=typeof n?null:function(e){n(e)},o=r.callbackId(i,o);r.exec(s,"shortVideoEditor_save",[this.id,e,o])},t.addEventListener=function(e,t){var n,i=this;t&&(n=function(e){"function"==typeof t&&(e.target=i,t(e))},t.callback=n,n=r.callbackId(n)),r.exec(s,"shortVideoEditor_addEventListener",[this.id,e,n])},t={Camera:e,Editor:n,upload:function(e,t,n){var i="function"!=typeof t?null:function(e){t(e)},o="function"!=typeof n?null:function(e){n(e)},o=r.callbackId(i,o);r.exec(s,"uploader",[e,o])}},i.shortvideo=t}(window.plus),function(e){var o="iBeacon",r=e.bridge,t={startBeaconDiscovery:function(t){if("object"==typeof t){var n="function"!=typeof t.complete?function(){}:t.complete,e="function"!=typeof t.success?n:function(e){t.success(e),n(e)},i="function"!=typeof t.fail?n:function(e){t.fail(e),n(e)};return callbackID=r.callbackId(e,i),r.exec(o,"startBeaconDiscovery",[callbackID,t.uuids])}},stopBeaconDiscovery:function(t){var n="function"!=typeof t.complete?function(){}:t.complete,e="function"!=typeof t.success?n:function(e){t.success(e),n(e)},i="function"!=typeof t.fail?n:function(e){t.fail(e),n(e)};return callbackID=r.callbackId(e,i),r.exec(o,"stopBeaconDiscovery",[callbackID])},getBeacons:function(t){var n="function"!=typeof t.complete?function(){}:t.complete,e="function"!=typeof t.success?n:function(e){t.success(e),n(e)},i="function"!=typeof t.fail?n:function(e){t.fail(e),n(e)};return callbackID=r.callbackId(e,i),r.exec(o,"getBeacons",[callbackID])},onBeaconUpdate:function(e){e="function"!=typeof e?null:e;return callbackID=r.callbackId(e),r.exec(o,"onBeaconUpdate",[callbackID])},onBeaconServiceChange:function(e){e="function"!=typeof e?null:e;return callbackID=r.callbackId(e),r.execSync(o,"onBeaconServiceChange",[callbackID])}};e.ibeacon=t}(window.plus),function(e){var i="Bluetooth",c=window.plus.bridge,t={closeBluetoothAdapter:function(e){return callbackID=this.getCallbackIDByFunction(e.success,e.fail,e.complete),c.exec(i,"closeBluetoothAdapter",[callbackID])},openBluetoothAdapter:function(e){return callbackID=this.getCallbackIDByFunction(e.success,e.fail,e.complete),c.exec(i,"openBluetoothAdapter",[callbackID])},getBluetoothAdapterState:function(e){return callbackID=this.getCallbackIDByFunction(e.success,e.fail,e.complete),c.exec(i,"getBluetoothAdapterState",[callbackID])},getBluetoothDevices:function(r){var s=this,a="function"!=typeof r.complete?function(){}:r.complete,e="function"!=typeof r.success?null:function(e){for(var t=e.devices,n=0;n - Accelerometer + Bluetooth class - PGAccelerometer + libBlueTooth + + Geolocation + + class + PGGeolocation global - Ad + Orientation class - FeatureUniAd + PGOrientation + global + + + Maps + + class + PGMap global + server + + class + PGBaiduKeyVerify + identifier + com.baidu.keyverify + - Audio + Device class - PGAudio + PGDeviceStatus global - Bluetooth + File class - libBlueTooth + PGFile + global + Cache @@ -35,287 +56,271 @@ global - Camera + Zip class - PGCamera + PGZip global - + - Console + Runtime class - PGLog + PGRuntime global - + - Contacts + Audio class - PGContacts + PGAudio global - Device + Accelerometer class - PGDeviceStatus + PGAccelerometer global - Downloader + Push - class - PGDownload + server + + class + PGPushServer + identifier + com.pushserver + + baseclass + PGPush global + autostart + - File + barcode class - PGFile + PGBarcode global - + - Gallery + XMLHttpRequest class - PGGallery + PGXHR global - + - Geolocation + UI class - PGGeolocation + PGUI global + extend + + Navigator + PG_Navigate + WebNavigator + PGWebNavi + - Invocation + Contacts class - PGInvocation + PGContacts global - LivePusher + Proximity class - PGLivePush + PGProximity global - + - Maps + Invocation class - PGMap + PGInvocation global - + + + Statistic + server class - PGBaiduKeyVerify + PGUmengStartUp identifier - com.baidu.keyverify + com.umeng.startup - - Media - class - PGMediaVideo + PGStatistic global + autostart + - Messaging + Camera class - PGMessaging + PGCamera global - NativeObj + Console - autostart - class - PGNativeObj + PGLog global - NativeUI + Storage class - PGNativeUI + PGNStorage + autostart + global - + - Navigator + Gallery class - PGNavigator + PGGallery global - + - Notification + Downloader - autostart - class - PGNotification + PGDownload global - OAuth + Messaging class - PGOauthManager - extend - - apple - PGAppleOauth - qihoo - PGQHOauth - qq - PGQQOauth - univerify - PGUniVerify - weibo - PGSinaWBOauth - weixin - PGWXOauth - xiaomi - PGMiOauth - + PGMessaging global - Orientation + Uploader class - PGOrientation + PGUpload global - + Payment class PGPlatbyManager - extend - - alix - PGAlixPay - appleiap - PGPlatbyIAP - weixin - PGWXPay - global + extend + - Proximity - - class - PGProximity - global - - - Push + Speech - autostart - - baseclass - PGPush class - PGPushActualize + PGSpeech global - server + extend - class - PGPushServerAct - identifier - com.pushserver + baidu + PGBaiduSpeech + ifly + PGIFLYSpeech - Runtime + OAuth - class - PGRuntime + extend + + weibo + PGSinaWBOauth + xiaomi + PGMiOauth + qq + PGQQOauth + qihoo + PGQHOauth + weixin + PGWXOauth + apple + PGAppleOauth + univerify + PGUniVerify + global - + + class + PGOauthManager Share - argument - weixin - autostart - class PGShareManager + global + + autostart + + argument + weixin extend qq PGTencentQQShare - sinaweibo - PGSinaShare tencentweibo PGQQShare + sinaweibo + PGSinaShare weixin PGWXShare - global - - ShortVideo + NativeObj class - PluginShortVideo - global + PGNativeObj + autostart + global + - Speech + NativeUI class - PGSpeech - extend - - baidu - PGBaiduSpeech - ifly - PGIFLYSpeech - + PGNativeUI global - + - Sqlite + Navigator class - libSqlite + PGNavigator global - Statistic + Notification - autostart - class - PGStatistic + PGNotification global - server - - class - PGUmengStartUp - identifier - com.umeng.startup - - - Storage - autostart + + fingerprint + class - PGNStorage + Fingerprint global @@ -326,66 +331,52 @@ global - UI + VideoPlayer class - PGUI - extend - - Navigator - PG_Navigate - WebNavigator - PGWebNavi - + PGVideo global - + - Uploader + Media class - PGUpload + PGMediaVideo global - VideoPlayer + LivePusher class - PGVideo + PGLivePush global - XMLHttpRequest + Ad class - PGXHR + FeatureUniAd global - + - Zip + ShortVideo class - PGZip + PluginShortVideo global - barcode - - class - PGBarcode - global - - - fingerprint + iBeacon class - Fingerprint + PGBeacon global - + - iBeacon + Sqlite class - PGBeacon + libSqlite global diff --git a/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/en.lproj/Localizable.strings b/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/en.lproj/Localizable.strings index a9cc2bf7..4e845784 100644 Binary files a/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/en.lproj/Localizable.strings and b/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/en.lproj/Localizable.strings differ diff --git a/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/zh-Hans.lproj/Localizable.strings b/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/zh-Hans.lproj/Localizable.strings index 905eb2c3..256cefb8 100644 Binary files a/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/zh-Hans.lproj/Localizable.strings and b/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/zh-Hans.lproj/Localizable.strings differ diff --git a/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/zh-Hant.lproj/Localizable.strings b/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/zh-Hant.lproj/Localizable.strings index d63885d9..07843666 100644 Binary files a/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/zh-Hant.lproj/Localizable.strings and b/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/zh-Hant.lproj/Localizable.strings differ diff --git a/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/en.lproj/Localizable.strings b/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/en.lproj/Localizable.strings index 199bf88f..ed1a031f 100644 Binary files a/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/en.lproj/Localizable.strings and b/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/en.lproj/Localizable.strings differ diff --git a/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/zh-Hans.lproj/Localizable.strings b/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/zh-Hans.lproj/Localizable.strings index 6c227b5d..26d6c9ec 100644 Binary files a/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/zh-Hans.lproj/Localizable.strings and b/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/zh-Hans.lproj/Localizable.strings differ diff --git a/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/zh-Hant.lproj/Localizable.strings b/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/zh-Hant.lproj/Localizable.strings index 03413dca..6e94bc1c 100644 Binary files a/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/zh-Hant.lproj/Localizable.strings and b/ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/zh-Hant.lproj/Localizable.strings differ diff --git a/ios/UniMPSDK/Resources/PandoraApi.bundle/iconfont.ttf b/ios/UniMPSDK/Resources/PandoraApi.bundle/iconfont.ttf index e69de29b..b7853587 100644 Binary files a/ios/UniMPSDK/Resources/PandoraApi.bundle/iconfont.ttf and b/ios/UniMPSDK/Resources/PandoraApi.bundle/iconfont.ttf differ diff --git a/lib/home/activity_list_page.dart b/lib/home/activity_list_page.dart index fd388ad7..9fa55b6b 100644 --- a/lib/home/activity_list_page.dart +++ b/lib/home/activity_list_page.dart @@ -91,7 +91,7 @@ class _ActivityListPage extends State return InkWell( onTap: () { Navigator.of(context).pushNamed( - '/router/store_detail_page', + '/router/web_page', arguments: {"activityId": activityList[position].id}); }, child: FrameSeparateWidget( diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index f1dee7c3..d730d76a 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -77,17 +77,6 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { apiService = ApiService(Dio(), context: context, token: value.getString('token'), showLoading: false); - BaseData> baseData = await apiService.queryBanner({ - "model": {"type": "HOME_PAGE"}, - }).catchError((onError) { - refreshController.refreshFailed(); - }); - if (baseData != null && baseData.isSuccess) { - bannerData.clear(); - bannerData.addAll(baseData.data.records); - if (bannerData.length > 0) controller.move(0, animation: false); - } - BaseData brand = await apiService.queryHomeBrand().catchError((onError) { refreshController.refreshFailed(); }); @@ -101,7 +90,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { BaseData> article = await apiService.queryArticle({ "pageNum": 1, - "pageSize": 2, + "pageSize": 3, "searchKey": "", "state": 1, "type": 2 @@ -119,18 +108,28 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { "pageNum": 1, "pageSize": 10, "state": 1 + }).catchError((onError) { + refreshController.refreshFailed(); }); if (goodsData != null && goodsData.isSuccess) { gooods.clear(); gooods.addAll(goodsData.data.list); } - // SmartDialog.dismiss(); - EasyLoading.dismiss(); + + BaseData> baseData = await apiService.queryBanner({ + "model": {"type": "HOME_PAGE"}, + }).catchError((onError) { + refreshController.refreshFailed(); + }); if (baseData != null && baseData.isSuccess) { + bannerData.clear(); + bannerData.addAll(baseData.data.records); refreshController.refreshCompleted(); + if (bannerData.length > 0) controller.move(0, animation: false); } else { refreshController.refreshFailed(); } + EasyLoading.dismiss(); } @override diff --git a/lib/home/home_view/brand_view.dart b/lib/home/home_view/brand_view.dart index 1da0f3e3..eff1deea 100644 --- a/lib/home/home_view/brand_view.dart +++ b/lib/home/home_view/brand_view.dart @@ -36,7 +36,6 @@ class _BrandView extends State { ); } - brands() { return Container( height: 90.h, @@ -48,8 +47,6 @@ class _BrandView extends State { loop: true, itemBuilder: (context, position) { return Container( - // height: 60.h, - // width: 120.w, margin: EdgeInsets.symmetric(horizontal: 3.w, vertical: 15.h), decoration: BoxDecoration( color: Colors.white, diff --git a/lib/home/home_view/home_banner.dart b/lib/home/home_view/home_banner.dart index 3d31264e..062d732b 100644 --- a/lib/home/home_view/home_banner.dart +++ b/lib/home/home_view/home_banner.dart @@ -78,13 +78,13 @@ class _HomeBanner extends State { break; case 2: Navigator.of(context) - .pushNamed('/router/store_detail_page', arguments: { + .pushNamed('/router/web_page', arguments: { "activityId": bannerData.content, }); break; case 3: Navigator.of(context) - .pushNamed('/router/store_detail_page', arguments: { + .pushNamed('/router/web_page', arguments: { "articleId": bannerData.content, }); break; diff --git a/lib/home/home_view/hot_article.dart b/lib/home/home_view/hot_article.dart index 46262212..685f57e7 100644 --- a/lib/home/home_view/hot_article.dart +++ b/lib/home/home_view/hot_article.dart @@ -46,7 +46,7 @@ class _HotArticle extends State { itemCount: widget.articles != null ? ((widget.articles.length > 3) ? 3 : widget.articles.length) : 0, - physics: BouncingScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, padding: EdgeInsets.symmetric(vertical: 12.h), itemBuilder: (context, position) { diff --git a/lib/home/huixiang_view/huixiang_banner.dart b/lib/home/huixiang_view/huixiang_banner.dart index c013beaa..c535ac38 100644 --- a/lib/home/huixiang_view/huixiang_banner.dart +++ b/lib/home/huixiang_view/huixiang_banner.dart @@ -70,13 +70,13 @@ class _HuiXiangBanner extends State { break; case 2: Navigator.of(context) - .pushNamed('/router/store_detail_page', arguments: { + .pushNamed('/router/web_page', arguments: { "activityId": bannerData.content, }); break; case 3: Navigator.of(context) - .pushNamed('/router/store_detail_page', arguments: { + .pushNamed('/router/web_page', arguments: { "articleId": bannerData.content, }); break; diff --git a/lib/home/points_mall_view/points_mall_banner.dart b/lib/home/points_mall_view/points_mall_banner.dart index ab695a84..cf8492ea 100644 --- a/lib/home/points_mall_view/points_mall_banner.dart +++ b/lib/home/points_mall_view/points_mall_banner.dart @@ -76,13 +76,13 @@ class _PointMallBanner extends State { break; case 2: Navigator.of(context) - .pushNamed('/router/store_detail_page', arguments: { + .pushNamed('/router/web_page', arguments: { "activityId": bannerData.content, }); break; case 3: Navigator.of(context) - .pushNamed('/router/store_detail_page', arguments: { + .pushNamed('/router/web_page', arguments: { "articleId": bannerData.content, }); break; diff --git a/lib/integral/integral_page.dart b/lib/integral/integral_page.dart index 360ba9b7..f76a60ff 100644 --- a/lib/integral/integral_page.dart +++ b/lib/integral/integral_page.dart @@ -3,22 +3,20 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; -import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/integral/intergra_view/in_for_points.dart'; +import 'package:huixiang/integral/intergra_view/integral_vip.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/rank.dart'; import 'package:huixiang/retrofit/data/sign_info.dart'; -import 'package:huixiang/retrofit/data/task.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; -import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; -import 'package:huixiang/view_widget/round_button.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:huixiang/view_widget/sign_in_widget.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'intergra_view/integral_task.dart'; class IntegralPage extends StatefulWidget { @override @@ -31,48 +29,44 @@ class _IntegralPage extends State { ApiService apiService; SignInfo signInfo; - UserInfo userinfo; + UserInfo userInfo; List ranks = []; int rankLevel = 1; - @override - void initState() { - super.initState(); - - SharedPreferences.getInstance().then((value) { - apiService = ApiService(Dio(), - context: context, - token: value.getString("token"), - showLoading: false); - userinfo = UserInfo.fromJson(jsonDecode(value.getString("user"))); - EasyLoading.show(status: S.of(context).zhengzaijiazai); - querySignInfo(); - }); - } - querySignInfo() async { - BaseData baseData = await apiService.signInInfo(); + EasyLoading.show(status: S.of(context).zhengzaijiazai); + + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + showLoading: false, + ); + userInfo = UserInfo.fromJson(jsonDecode(value.getString("user"))); - BaseData> rankData = await apiService.rankList(); + BaseData> rankData = + await apiService.rankList().catchError((onError) {}); if (rankData != null && rankData.isSuccess) { ranks.clear(); ranks.addAll(rankData.data); } - if (userinfo != null && - userinfo.memberRankVo != null && + if (userInfo != null && + userInfo.memberRankVo != null && ranks != null && ranks.length > 0) { rankLevel = (ranks - .indexWhere((element) => element.id == userinfo.memberRankVo.id) + + .indexWhere((element) => element.id == userInfo.memberRankVo.id) + 1); } - // SmartDialog.dismiss(closeType: 3); - EasyLoading.dismiss(); + + BaseData baseData = + await apiService.signInInfo().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { signInfo = baseData.data; - setState(() {}); } + EasyLoading.dismiss(); } @override @@ -103,417 +97,46 @@ class _IntegralPage extends State { ), ), ), - body: SingleChildScrollView( - child: Container( - child: Stack( - children: [ - Positioned( - child: Container( - height: 122.h, - color: Color(0xFF3A405A), - ), - top: 0, - left: 0, - right: 0, - ), - Column( - children: [ - integralAndVip(), - inForPoints(), - integralTask(), - ], - ), - ], - ), - ), - ), - ); - } - - Widget integralTask() { - return Container( - width: MediaQuery.of(context).size.width - 32, - height: 300.h, - margin: EdgeInsets.all(16), - padding: EdgeInsets.fromLTRB(10.w, 20.h, 10.w, 20.h), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(left: 10.w), - child: Text( - S.of(context).zuorenwudejifen, - style: TextStyle( - color: Color(0xFF353535), - fontWeight: MyFontWeight.medium, - fontSize: 16.sp, + body: Container( + child: Stack( + children: [ + Positioned( + child: Container( + height: 122.h, + color: Color(0xFF3A405A), ), + top: 0, + left: 0, + right: 0, ), - ), - Expanded( - child: Container( - child: Swiper( - loop: false, - physics: BouncingScrollPhysics(), - pagination: SwiperPagination( - alignment: Alignment.bottomCenter, - builder: DotSwiperPaginationBuilder( - size: 8, - activeSize: 8, - space: 5, - activeColor: Colors.black, - color: Colors.black.withAlpha(76), - ), - ), - itemBuilder: (context, position) { - return taskPage(position); - }, - itemCount: (signInfo != null && - signInfo.taskList != null && - signInfo.taskList.length > 0) - ? (signInfo.taskList.length < 3 - ? 1 - : (signInfo.taskList.length ~/ 3 + - (signInfo.taskList.length % 3 > 0 ? 1 : 0))) - : 1), - ), - flex: 1, - ) - ], - ), - ); - } - - Widget taskPage(position) { - if (signInfo == null || signInfo.taskList == null) return Container(); - return Container( - margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 16.h), - child: Column( - children: [ - tashItem(signInfo.taskList[position * 3 + 0]), - if (signInfo.taskList.length > (position * 3 + 1)) - tashItem(signInfo.taskList[position * 3 + 1]), - if (signInfo.taskList.length > (position * 3 + 2)) - tashItem(signInfo.taskList[position * 3 + 2]), - ], - ), - ); - } - - taskImg(String taskType) { - switch (taskType) { - case "bill_type_point_login": - return "assets/image/icon_integral_share.png"; - break; - case "bill_type_point_order": - return "assets/image/icon_integral_order.png"; - break; - case "bill_type_point_signin": - return "assets/image/icon_integral_sign.png"; - break; - } - return "assets/image/icon_integral_share.png"; - } + SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: FutureBuilder( + future: querySignInfo(), + builder: (context, snap) { + return Column( + children: [ + /// 上面的积分和VIP等级显示 + IntegralVip(rankLevel, signInfo, userInfo), - Widget tashItem(Task task) { - return Container( - margin: EdgeInsets.only(top: 8.h, bottom: 8.h), - alignment: Alignment.center, - child: Row( - children: [ - Image.asset( - taskImg(task.type), - width: 24.w, - height: 24.h, - ), - SizedBox( - width: 21.w, - ), - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - task.name, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF353535), - ), - ), - SizedBox( - height: 7.h, - ), - Row( - children: [ - Text( - "+${double.tryParse(task.rewardValue).toInt()}", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF727272), - ), - ), - SizedBox( - width: 20.w, - ), - Text( - S.of(context).wancheng_( - "${task.complateNum ?? task.conplateNum}/${task.limitDay}"), - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF727272), - ), - ), - ], - ) - ], - ), - ), - RoundButton( - text: task.limitDay == (task.complateNum ?? task.conplateNum) - ? S.of(context).yiwancheng - : S.of(context).quwancheng, - textColor: Colors.white, - backgroup: task.limitDay == (task.complateNum ?? task.conplateNum) - ? Color(0xFFA0A0A0) - : Color(0xFF32A060), - radius: 12.w, - fontSize: 14.sp, - fontWeight: FontWeight.bold, - padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 12.w), - ), - ], - ), - ); - } + ///立即签到 + InForPoints(signInfo, _signIn), - Widget signInItem(position) { - if (position == 6) { - return Container( - padding: EdgeInsets.all(4), - decoration: BoxDecoration( - color: Color(0xFFF0F0F2), - borderRadius: BorderRadius.circular(4), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "0${position + 1}", - style: TextStyle( - color: Color(0xFF353535), - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - ), - ), - Container( - alignment: Alignment.center, - height: 30.h, - child: Text( - S.of(context).shenmijifendali, - style: TextStyle( - color: Color(0xFF727272), - fontWeight: FontWeight.bold, - fontSize: 10.sp, - ), - ), - ), - Text( - "", - style: TextStyle( - color: Color(0xFF353535), - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - ), - ), - ], - ), - flex: 1, - ), - Container( - alignment: Alignment.center, - child: Image.asset( - "assets/image/icon_gold_blessing.png", - width: 59.w, - height: 59.h, - ), - ), - ], - ), - ); - } else { - return Container( - padding: EdgeInsets.all(4), - decoration: BoxDecoration( - color: (signInfo != null && - signInfo.signInList != null && - signInfo.signInList.length > position) - ? Color(0xFF32A060) - : Color(0xFFF0F0F2), - borderRadius: BorderRadius.circular(4), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "0${position + 1}", - style: TextStyle( - color: (signInfo != null && - signInfo.signInList != null && - signInfo.signInList.length > position) - ? Colors.white - : Color(0xFF353535), - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - ), - ), - Container( - alignment: Alignment.center, - child: Image.asset( - "assets/image/icon_gold_coin.png", - width: 30.w, - height: 30.h, - ), - ), - Container( - alignment: Alignment.center, - margin: EdgeInsets.only( - top: 2.h, - ), - child: Text( - (signInfo != null && - signInfo.rewardList != null && - signInfo.rewardList.length > position) - ? "+${signInfo.rewardList[position]}" - : "+10", - style: TextStyle( - color: (signInfo != null && - signInfo.signInList != null && - signInfo.signInList.length > position) - ? Colors.white - : Color(0xFF727272), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - ), + ///积分任务 + IntegralTask(signInfo), + ], + ); + }, ), ), ], ), - ); - } - } - - ///立即签到 - Widget inForPoints() { - return Container( - width: double.infinity, - margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h), - padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 20.h), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - S.of(context).qiandaolingjifen, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 16.sp, - color: Color(0xFF353535), - ), - ), - SizedBox( - height: 10.h, - ), - Text( - S.of(context).lianxuqiandaolingqushuangbeijifen, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 11.sp, - color: Color(0xFF727272), - ), - ), - SizedBox( - height: 32.h, - ), - StaggeredGridView.countBuilder( - crossAxisCount: 4, - shrinkWrap: true, - itemCount: 7, - mainAxisSpacing: 8, - crossAxisSpacing: 18, - padding: EdgeInsets.only(bottom: 32), - physics: NeverScrollableScrollPhysics(), - itemBuilder: (context, position) { - return signInItem(position); - }, - staggeredTileBuilder: (position) { - return StaggeredTile.count(position == 6 ? 2 : 1, 1.28); - }, - ), - InkWell( - onTap: signIn, - child: Container( - alignment: Alignment.center, - child: RoundButton( - width: 106.w, - height: 34.h, - text: (signInfo != null && signInfo.todayHasSignin) - ? S.of(context).yiqiandao - : S.of(context).lijiqiandao, - textColor: Colors.white, - backgroup: (signInfo != null && signInfo.todayHasSignin) - ? Colors.grey - : Color(0xFF32A060), - fontSize: 16.sp, - fontWeight: MyFontWeight.regular, - padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h), - radius: 4.w, - ), - ), - ), - ], ), ); } ///立即签到 - signIn() async { + _signIn() async { if ((signInfo != null && signInfo.todayHasSignin)) { SmartDialog.showToast("今日已签到了", alignment: Alignment.center); return; @@ -521,7 +144,7 @@ class _IntegralPage extends State { EasyLoading.show(status: S.of(context).zhengzaijiazai); BaseData baseData = await apiService.signIn(); if (baseData != null && baseData.isSuccess) { - querySignInfo(); + setState(() {}); SmartDialog.show( widget: SignInWidget("${signInfo.signInList.length + 1}", "${signInfo.rewardList[signInfo.signInList.length]}")); @@ -529,108 +152,4 @@ class _IntegralPage extends State { EasyLoading.dismiss(); } } - - //上面的积分和VIP等级显示 - Widget integralAndVip() { - return Container( - padding: EdgeInsets.only(top: 16.h, bottom: 16.h), - color: Color(0xFF3A405A), - child: Row( - children: [ - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - signInfo != null ? "${signInfo.point}" : "0", - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 21.sp, - color: Colors.white, - ), - ), - SizedBox( - height: 6.h, - ), - Text( - S.of(context).wodejifenzhi, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFF2F2F2), - ), - ) - ], - ), - ), - Container( - width: 2.w, - height: 32.h, - color: Color(0xFFFFFFFF), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - SharedPreferences.getInstance().then((value) { - if (value.getString("token") != null && - value.getString("token") != "") { - Navigator.of(context) - .pushNamed('/router/mine_vip_level_page', arguments: { - "rankLevel": rankLevel, - "createTime": - (userinfo != null) ? "${userinfo.createTime}" : "", - "points": (userinfo != null) - ? int.tryParse(userinfo.points) - : 0, - }); - } - }); - }, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - (signInfo != null && signInfo.rank != null) - ? "${signInfo.rank.rankName.replaceAll("会员", "")}" - : "", - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 21.sp, - color: Colors.white, - ), - ), - SizedBox( - height: 6.h, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - S.of(context).wodehuiyuandengji, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFF2F2F2), - ), - ), - Icon( - Icons.keyboard_arrow_right, - color: Colors.white, - size: 15, - ), - ], - ), - ], - ), - ), - ), - ], - ), - ); - } } diff --git a/lib/integral/intergra_view/in_for_points.dart b/lib/integral/intergra_view/in_for_points.dart new file mode 100644 index 00000000..931728ce --- /dev/null +++ b/lib/integral/intergra_view/in_for_points.dart @@ -0,0 +1,236 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/sign_info.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/round_button.dart'; + + +class InForPoints extends StatefulWidget { + + final SignInfo signInfo; + final Function signIn; + + InForPoints(this.signInfo, this.signIn); + + @override + State createState() { + return _InForPoints(); + } + +} + +class _InForPoints extends State { + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h), + padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 20.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + S.of(context).qiandaolingjifen, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + color: Color(0xFF353535), + ), + ), + SizedBox( + height: 10.h, + ), + Text( + S.of(context).lianxuqiandaolingqushuangbeijifen, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 11.sp, + color: Color(0xFF727272), + ), + ), + SizedBox( + height: 32.h, + ), + StaggeredGridView.countBuilder( + crossAxisCount: 4, + shrinkWrap: true, + itemCount: 7, + mainAxisSpacing: 8, + crossAxisSpacing: 18, + padding: EdgeInsets.only(bottom: 32), + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return signInItem(position); + }, + staggeredTileBuilder: (position) { + return StaggeredTile.count(position == 6 ? 2 : 1, 1.28); + }, + ), + InkWell( + onTap: widget.signIn, + child: Container( + alignment: Alignment.center, + child: RoundButton( + width: 106.w, + height: 34.h, + text: (widget.signInfo != null && widget.signInfo.todayHasSignin) + ? S.of(context).yiqiandao + : S.of(context).lijiqiandao, + textColor: Colors.white, + backgroup: (widget.signInfo != null && widget.signInfo.todayHasSignin) + ? Colors.grey + : Color(0xFF32A060), + fontSize: 16.sp, + fontWeight: MyFontWeight.regular, + padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h), + radius: 4.w, + ), + ), + ), + ], + ), + ); + } + + + Widget signInItem(position) { + if (position == 6) { + return Container( + padding: EdgeInsets.all(4), + decoration: BoxDecoration( + color: Color(0xFFF0F0F2), + borderRadius: BorderRadius.circular(4), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "0${position + 1}", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + Container( + alignment: Alignment.center, + height: 30.h, + child: Text( + S.of(context).shenmijifendali, + style: TextStyle( + color: Color(0xFF727272), + fontWeight: FontWeight.bold, + fontSize: 10.sp, + ), + ), + ), + Text( + "", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ], + ), + flex: 1, + ), + Container( + alignment: Alignment.center, + child: Image.asset( + "assets/image/icon_gold_blessing.png", + width: 59.w, + height: 59.h, + ), + ), + ], + ), + ); + } else { + return Container( + padding: EdgeInsets.all(4), + decoration: BoxDecoration( + color: (widget.signInfo != null && + widget.signInfo.signInList != null && + widget.signInfo.signInList.length > position) + ? Color(0xFF32A060) + : Color(0xFFF0F0F2), + borderRadius: BorderRadius.circular(4), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "0${position + 1}", + style: TextStyle( + color: (widget.signInfo != null && + widget.signInfo.signInList != null && + widget.signInfo.signInList.length > position) + ? Colors.white + : Color(0xFF353535), + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + Container( + alignment: Alignment.center, + child: Image.asset( + "assets/image/icon_gold_coin.png", + width: 30.w, + height: 30.h, + ), + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.only( + top: 2.h, + ), + child: Text( + (widget.signInfo != null && + widget.signInfo.rewardList != null && + widget.signInfo.rewardList.length > position) + ? "+${widget.signInfo.rewardList[position]}" + : "+10", + style: TextStyle( + color: (widget.signInfo != null && + widget.signInfo.signInList != null && + widget.signInfo.signInList.length > position) + ? Colors.white + : Color(0xFF727272), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ), + ], + ), + ); + } + } + + +} diff --git a/lib/integral/intergra_view/integral_task.dart b/lib/integral/intergra_view/integral_task.dart new file mode 100644 index 00000000..0ec67080 --- /dev/null +++ b/lib/integral/intergra_view/integral_task.dart @@ -0,0 +1,202 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/sign_info.dart'; +import 'package:huixiang/retrofit/data/task.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/round_button.dart'; + +class IntegralTask extends StatefulWidget { + final SignInfo signInfo; + + IntegralTask(this.signInfo); + + @override + State createState() { + return _IntegralTask(); + } +} + +class _IntegralTask extends State { + @override + Widget build(BuildContext context) { + return Container( + width: MediaQuery.of(context).size.width - 32, + height: 300.h, + margin: EdgeInsets.all(16), + padding: EdgeInsets.symmetric( + horizontal: 10.w, + vertical: 20.h, + ), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 10.w), + child: Text( + S.of(context).zuorenwudejifen, + style: TextStyle( + color: Color(0xFF353535), + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + ), + ), + ), + Expanded( + child: Container( + child: Swiper( + loop: false, + physics: BouncingScrollPhysics(), + pagination: SwiperPagination( + alignment: Alignment.bottomCenter, + builder: DotSwiperPaginationBuilder( + size: 8, + activeSize: 8, + space: 5, + activeColor: Colors.black, + color: Colors.black.withAlpha(76), + ), + ), + itemBuilder: (context, position) { + return taskPage(position); + }, + itemCount: (widget.signInfo != null && + widget.signInfo.taskList != null && + widget.signInfo.taskList.length > 0) + ? (widget.signInfo.taskList.length < 3 + ? 1 + : (widget.signInfo.taskList.length ~/ 3 + + (widget.signInfo.taskList.length % 3 > 0 + ? 1 + : 0))) + : 1), + ), + flex: 1, + ) + ], + ), + ); + } + + Widget taskPage(position) { + if (widget.signInfo == null || widget.signInfo.taskList == null) + return Container(); + return Container( + margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 16.h), + child: Column( + children: [ + tashItem(widget.signInfo.taskList[position * 3 + 0]), + if (widget.signInfo.taskList.length > (position * 3 + 1)) + tashItem(widget.signInfo.taskList[position * 3 + 1]), + if (widget.signInfo.taskList.length > (position * 3 + 2)) + tashItem(widget.signInfo.taskList[position * 3 + 2]), + ], + ), + ); + } + + taskImg(String taskType) { + switch (taskType) { + case "bill_type_point_login": + return "assets/image/icon_integral_share.png"; + break; + case "bill_type_point_order": + return "assets/image/icon_integral_order.png"; + break; + case "bill_type_point_signin": + return "assets/image/icon_integral_sign.png"; + break; + } + return "assets/image/icon_integral_share.png"; + } + + Widget tashItem(Task task) { + return Container( + margin: EdgeInsets.only(top: 8.h, bottom: 8.h), + alignment: Alignment.center, + child: Row( + children: [ + Image.asset( + taskImg(task.type), + width: 24.w, + height: 24.h, + ), + SizedBox( + width: 21.w, + ), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + task.name, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + SizedBox( + height: 7.h, + ), + Row( + children: [ + Text( + "+${double.tryParse(task.rewardValue).toInt()}", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF727272), + ), + ), + SizedBox( + width: 20.w, + ), + Text( + S.of(context).wancheng_( + "${task.complateNum ?? task.conplateNum}/${task.limitDay}"), + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF727272), + ), + ), + ], + ), + ], + ), + ), + RoundButton( + text: task.limitDay == (task.complateNum ?? task.conplateNum) + ? S.of(context).yiwancheng + : S.of(context).quwancheng, + textColor: Colors.white, + backgroup: task.limitDay == (task.complateNum ?? task.conplateNum) + ? Color(0xFFA0A0A0) + : Color(0xFF32A060), + radius: 12.w, + fontSize: 14.sp, + fontWeight: FontWeight.bold, + padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 12.w), + ), + ], + ), + ); + } +} diff --git a/lib/integral/intergra_view/integral_vip.dart b/lib/integral/intergra_view/integral_vip.dart new file mode 100644 index 00000000..3336d2b6 --- /dev/null +++ b/lib/integral/intergra_view/integral_vip.dart @@ -0,0 +1,132 @@ +import 'package:flutter/material.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/sign_info.dart'; +import 'package:huixiang/retrofit/data/user_info.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class IntegralVip extends StatefulWidget { + + final SignInfo signInfo; + final UserInfo userinfo; + final rankLevel; + + IntegralVip(this.rankLevel, this.signInfo, this.userinfo); + + @override + State createState() { + return _IntegralVip(); + } + +} + + +class _IntegralVip extends State { + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.symmetric(vertical: 16.h), + child: Row( + children: [ + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + widget.signInfo != null ? "${widget.signInfo.point}" : "0", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 21.sp, + color: Colors.white, + ), + ), + SizedBox( + height: 6.h, + ), + Text( + S.of(context).wodejifenzhi, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFF2F2F2), + ), + ) + ], + ), + ), + Container( + width: 2.w, + height: 32.h, + color: Color(0xFFFFFFFF), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") != null && + value.getString("token") != "") { + Navigator.of(context) + .pushNamed('/router/mine_vip_level_page', arguments: { + "rankLevel": widget.rankLevel, + "createTime": + (widget.userinfo != null) ? "${widget.userinfo.createTime}" : "", + "points": (widget.userinfo != null) + ? int.tryParse(widget.userinfo.points) + : 0, + }); + } + }); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + (widget.signInfo != null && widget.signInfo.rank != null) + ? "${widget.signInfo.rank.rankName.replaceAll("会员", "")}" + : "", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 21.sp, + color: Colors.white, + ), + ), + SizedBox( + height: 6.h, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + S.of(context).wodehuiyuandengji, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFF2F2F2), + ), + ), + Icon( + Icons.keyboard_arrow_right, + color: Colors.white, + size: 15, + ), + ], + ), + ], + ), + ), + ), + ], + ), + ); + } + + + + +} diff --git a/lib/main.dart b/lib/main.dart index 6c97f288..b149fae3 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,7 +6,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart'; -import 'package:flutter_bugly/flutter_bugly.dart'; +// import 'package:flutter_bugly/flutter_bugly.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/address/address_map_page.dart'; @@ -51,7 +51,7 @@ import 'package:huixiang/setting/setting_page.dart'; import 'package:huixiang/setting/treaty_page.dart'; import 'package:huixiang/union/location_map_page.dart'; -import 'package:huixiang/union/store_details_page.dart'; +import 'package:huixiang/web/web_page.dart'; import 'package:huixiang/union/union_details_page.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -87,12 +87,11 @@ void main() async { } initSdk(); bool isFirst = sharedPreferences.getBool("isFirst"); - print("isFirst:$isFirst"); - FlutterBugly.postCatchedException((){ - runApp(MyApp(locale, isFirst)); - }); - FlutterBugly.init(androidAppId: "204f207673",iOSAppId: "8bb92ba0f6"); + runApp(MyApp(locale, isFirst)); + // FlutterBugly.postCatchedException((){ + // }); + // FlutterBugly.init(androidAppId: "204f207673",iOSAppId: "8bb92ba0f6"); } XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); @@ -242,8 +241,8 @@ Map routers = { '/router/treaty_page': (context, {arguments}) => TreatyPage(), '/router/union_detail_page': (context, {arguments}) => UnionDetailsPage(arguments: arguments), - '/router/store_detail_page': (context, {arguments}) => - StoreDetailsPage(arguments: arguments), + '/router/web_page': (context, {arguments}) => + WebPage(arguments: arguments), '/router/integral_store_page': (context, {arguments}) => IntegralStoreDetailsPage( arguments: arguments, diff --git a/lib/mine/mine_vip_level_page.dart b/lib/mine/mine_vip_level_page.dart index 2b115a1e..83ef7a84 100644 --- a/lib/mine/mine_vip_level_page.dart +++ b/lib/mine/mine_vip_level_page.dart @@ -6,6 +6,7 @@ import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/rank.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/view_widget/mine_vip_view.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; @@ -26,7 +27,7 @@ class _MineVipLevelPage extends State { ApiService apiService; List ranks = []; - SwiperController controller = SwiperController(); + final SwiperController controller = SwiperController(); @override void initState() { @@ -67,7 +68,7 @@ class _MineVipLevelPage extends State { child: Column( children: [ Container( - height: 224.h, + height: (MediaQuery.of(context).size.width) / 1.78 * AppUtils.textScale(context), child: Swiper( viewportFraction: 0.95, loop: false, diff --git a/lib/mine/mine_wallet_page.dart b/lib/mine/mine_wallet_page.dart index 9fd608d7..fdbe9446 100644 --- a/lib/mine/mine_wallet_page.dart +++ b/lib/mine/mine_wallet_page.dart @@ -166,25 +166,6 @@ class _MineWalletPage extends State { SizedBox( height: 16.h, ), - // Row( - // children: [ - // Container( - // width: 3, - // height: 15, - // color: Color(0xFF20662A), - // ), - // SizedBox( - // width: 3, - // ), - // Text( - // "09/2021", - // style: TextStyle( - // color: Color(0xFF353535), - // fontSize: 14, - // ), - // ), - // ], - // ), Container( margin: EdgeInsets.only(top: 14.h), child: ListView.builder( diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index ab5f73ef..ffb33f3b 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -207,6 +207,12 @@ class _RechargePage extends State { } int amount = int.tryParse(money); if (checkIndex == 1) { + + if (amount < 10) { + SmartDialog.showToast(S.of(context).chongzhizuixiaojine(10), alignment: Alignment.center); + return; + } + if (!(await Min.isInitialize())) { // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index ebce206c..9582ca60 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -178,16 +178,13 @@ class _OrderDetailPage extends State { child:*/ Stack( children: [ - Container( - color: Color(0xFF3A405A), - child:Positioned( - top: 0, - left: 0, - right: 0, - child: Container( - height: 36.h, - color: Color(0xFF3A405A), - ), + Positioned( + top: 0, + left: 0, + right: 0, + child: Container( + height: 36.h, + color: Color(0xFF3A405A), ), ), SingleChildScrollView( diff --git a/lib/union/store_details_page.dart b/lib/union/store_details_page.dart deleted file mode 100644 index 5e791df4..00000000 --- a/lib/union/store_details_page.dart +++ /dev/null @@ -1,1006 +0,0 @@ -import 'dart:io'; -import 'dart:ui'; - -import 'package:dio/dio.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; -import 'package:flutter_html/flutter_html.dart'; -import 'package:flutter_html/image_render.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; -import 'package:huixiang/retrofit/data/member_comment_list.dart'; -import 'package:huixiang/generated/l10n.dart'; -import 'package:huixiang/retrofit/data/activity.dart'; -import 'package:huixiang/retrofit/data/article.dart'; -import 'package:huixiang/retrofit/data/base_data.dart'; -import 'package:huixiang/retrofit/data/page.dart'; -import 'package:huixiang/retrofit/retrofit_api.dart'; -import 'package:huixiang/view_widget/comment_menu.dart'; -import 'package:huixiang/view_widget/custom_image.dart'; -import 'package:huixiang/view_widget/login_tips.dart'; -import 'package:huixiang/view_widget/my_appbar.dart'; -import 'package:huixiang/view_widget/share_dialog.dart'; -import 'package:huixiang/view_widget/tips_dialog.dart'; -import 'package:like_button/like_button.dart'; -import 'package:pull_to_refresh/pull_to_refresh.dart'; -import 'package:shared_preferences/shared_preferences.dart'; -import 'package:sharesdk_plugin/sharesdk_defines.dart'; -import 'package:sharesdk_plugin/sharesdk_interface.dart'; -import 'package:sharesdk_plugin/sharesdk_map.dart'; -import 'package:video_player/video_player.dart'; -import 'package:webview_flutter/webview_flutter.dart'; -import 'package:flutter_html/src/replaced_element.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:chewie/src/chewie_progress_colors.dart' as chewie; -import 'package:chewie/chewie.dart'; - -class StoreDetailsPage extends StatefulWidget { - final Map arguments; - - ///富文本 文章 活动 - StoreDetailsPage({this.arguments}); - - @override - State createState() { - return _StoreDetailsPage(); - } -} - -class _StoreDetailsPage extends State - with WidgetsBindingObserver { - ApiService apiService; - RefreshController _refreshController; - int commentTotal = 0; - var commentTextController = TextEditingController(); - var commentFocus = FocusNode(); - String hintText = S.current.liuxianinjingcaidepinglunba; - String parenId = "0"; - - bool isKeyBoardShow = false; - - @override - void didChangeMetrics() { - super.didChangeMetrics(); - WidgetsBinding.instance.addPostFrameCallback((_) { - setState(() { - print("object: ${MediaQuery.of(context).viewInsets.bottom}"); - if (MediaQuery.of(context).viewInsets.bottom == 0) { - if (isKeyBoardShow) { - isKeyBoardShow = false; - //关闭键盘 软键盘关闭了, 清除输入控件的焦点, 否则重新进入页面会导致软键盘再弹出问题 - FocusScope.of(context).requestFocus(FocusNode()); - } - } else { - isKeyBoardShow = true; - } - }); - }); - } - - @override - void initState() { - super.initState(); - WidgetsBinding.instance.addObserver(this); - - _refreshController = RefreshController(); - - if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); - - SharedPreferences.getInstance().then((value) { - apiService = - ApiService(Dio(), context: context, token: value.getString("token")); - queryHtml(); - queryMemberCommentList(); - }); - } - - Activity activity; - Article article; - List memberList = []; - GlobalKey commentKey = GlobalKey(); - ScrollController scrollController = ScrollController(); - - queryHtml() async { - //activityInfo - if (widget.arguments["activityId"] != null) { - BaseData baseData = - await apiService.activityInfo(widget.arguments["activityId"]); - if (baseData != null && baseData.isSuccess) { - setState(() { - activity = baseData.data; - }); - } - } - if (widget.arguments["articleId"] != null) { - BaseData
baseData = - await apiService.informationInfo(widget.arguments["articleId"]); - if (baseData != null && baseData.isSuccess) { - setState(() { - article = baseData.data; - }); - } - } - } - - share() async { - SSDKMap params = SSDKMap() - ..setGeneral( - activity != null - ? activity.mainTitle - : article != null - ? article.mainTitle - : "", - activity != null - ? activity.viceTitle - : article != null - ? article.viceTitle - : "", - [ - activity != null - ? activity.coverImg - : article != null - ? article.coverImg - : "", - ], - activity != null - ? activity.coverImg - : article != null - ? article.coverImg - : "", - "", - buildShareUrl(), - "", - "", - "", - "", - SSDKContentTypes.webpage, - ); - - debugPrint(activity != null - ? activity.coverImg - : article != null - ? article.coverImg - : ""); - - showModalBottomSheet( - context: context, - backgroundColor: Colors.transparent, - builder: (context) { - return ShareDialog((platform) { - if (platform == ShareSDKPlatforms.line) { - params.map["type"] = SSDKContentTypes.text.value; - params.map["text"] = - "${activity != null ? activity.viceTitle : article != null ? article.viceTitle : ""} ${buildShareUrl()}"; - } - SharesdkPlugin.share(platform, params, - (state, userData, contentEntity, error) { - print("share!$state"); - }); - }); - }); - } - - String buildShareUrl() { - return "https://hx.lotus-wallet.com/index.html?id=${widget.arguments["activityId"] ?? widget.arguments["articleId"]}&type=${activity != null ? "activity" : article != null ? "article" : ""}"; - } - - //评论列表 - queryMemberCommentList() async { - BaseData> baseData = - await apiService.memberCommentList({ - "pageNum": 1, - "pageSize": 100, - "relationalId": - widget.arguments["activityId"] ?? widget.arguments["articleId"], - "relationalType": 1, - }).catchError((error) { - _refreshController.refreshFailed(); - }); - if (baseData != null && baseData.isSuccess) { - _refreshController.refreshCompleted(); - setState(() { - commentTotal = baseData.data.size; - memberList = baseData.data.list; - }); - } - } - - //评论点赞 - queryCommentLike(String id) async { - SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); - String token = sharedPreferences.getString("token"); - if (token == null || token == "") { - SmartDialog.show( - widget: LoginTips( - click: () { - SharedPreferences.getInstance() - .then((value) => value..setString("token", "")); - Navigator.of(context) - .pushNamed('/router/login_page', arguments: {"login": "login"}); - }, - ), - clickBgDismissTemp: false, - ); - return; - } - - BaseData baseData = - await apiService.commentLike(id).catchError((onError) {}); - if (baseData != null && baseData.isSuccess) { - setState(() { - memberList.forEach((element) { - if (element.id == id) { - if (element.liked) { - element.likes -= 1; - element.liked = false; - } else { - element.likes += 1; - element.liked = true; - } - } - }); - }); - } - } - - //给文章/活动点赞 - queryInformationLikes() async { - BaseData baseData = await apiService.informationLikes( - widget.arguments["activityId"] ?? widget.arguments["articleId"]); - if (baseData != null && baseData.isSuccess) { - setState(() { - if (article != null) { - if (article.liked) { - article.likes -= 1; - } else { - article.likes += 1; - } - article.liked = !article.liked; - } else if (activity != null) { - if (activity.liked) { - activity.likes -= 1; - } else { - activity.likes += 1; - } - activity.liked = !activity.liked; - } - }); - } else { - SmartDialog.showToast(baseData.msg, alignment: Alignment.center); - } - } - - //发布评论 - queryMemberComment(String content) async { - BaseData baseData = await apiService.memberComment({ - "content": content, - "parentId": parenId, - "relationalId": - widget.arguments["activityId"] ?? widget.arguments["articleId"], - "relationalType": 1 - }).catchError((error) { - _refreshController.refreshFailed(); - }); - if (baseData != null && baseData.isSuccess) { - commentTextController.text = ""; - await queryMemberCommentList(); - toComment(); - } - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: MyAppBar( - action: Container( - margin: EdgeInsets.only(right: 10), - child: GestureDetector( - onTap: () { - share(); - }, - child: Icon( - Icons.share, - size: 24, - color: Colors.black, - ), - ), - ), - background: Color(0xFFF7F7F7), - leadingColor: Colors.black, - title: activity != null - ? activity.mainTitle - : article != null - ? article.mainTitle - : "", - titleSize: 18.sp, - titleColor: Colors.black, - ), - body: Container( - child: Column( - children: [ - Expanded( - child: GestureDetector( - onTap: () { - commentFocus.unfocus(); - setState(() { - hintText = S.of(context).liuxianinjingcaidepinglunba; - }); - parenId = "0"; - }, - child: SingleChildScrollView( - controller: scrollController, - physics: BouncingScrollPhysics(), - child: Column( - children: [ - Container( - color: Color(0xFFF7F7F7), - padding: EdgeInsets.all(12), - alignment: Alignment.centerLeft, - child: Text( - activity != null - ? activity.mainTitle - : article != null - ? article.mainTitle - : "", - style: TextStyle( - fontSize: 16.sp, - fontWeight: FontWeight.bold, - color: Color(0xFF353535), - ), - ), - ), - Container( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - InkWell( - child: Text( - "${activity != null ? (activity.storeName ?? "") : (article != null && article.author != null) ? (article.author.name ?? "") : ""}", - style: TextStyle( - fontWeight: FontWeight.normal, - fontSize: 14.sp, - color: Colors.blue, - ), - ), - onTap: () { - if (activity != null) { - if (widget.arguments["source"] != null && - widget.arguments["source"] == - activity.storeId) { - Navigator.of(context).pop(); - } else { - Navigator.of(context).pushNamed( - '/router/union_detail_page', - arguments: { - "id": activity.storeId, - "source": - widget.arguments["activityId"] - }); - } - } - }, - ), - SizedBox( - width: 10.w, - ), - Text( - activity != null - ? activity.createTime - : article != null - ? article.createTime - : "", - style: TextStyle( - fontWeight: FontWeight.normal, - fontSize: 12.sp, - color: Colors.grey, - ), - ), - ], - ), - ), - Html( - data: activity != null - ? activity.content - : article != null - ? article.content - : "", - customImageRenders: { - base64DataUriMatcher(): base64ImageRender(), - assetUriMatcher(): assetImageRender(), - networkSourceMatcher(extension: "svg"): - svgNetworkImageRender(), - networkSourceMatcher(): networkImageRender( - loadingWidget: () { - return Container(); - }, - ), - }, - customRender: { - "video": (context, parsedChild, attributes, element) { - return videoWidget( - double.tryParse(attributes['width'] ?? ""), - double.tryParse( - element.attributes['height'] ?? ""), - element.children.first.attributes["src"], - element.attributes["sandbox"]); - }, - "iframe": - (context, parsedChild, attributes, element) { - return videoWidget( - double.tryParse(attributes['width'] ?? ""), - double.tryParse( - element.attributes['height'] ?? ""), - element.children.first.attributes["src"], - element.attributes["sandbox"]); - }, - "audio": (context, parsedChild, attributes, element) { - final sources = [ - if (element.attributes['src'] != null) - element.attributes['src'], - ]; - if (sources == null || - sources.isEmpty || - sources.first == null) { - return EmptyContentElement(); - } - return audioWidget( - attributes['controls'] != null, - attributes['loop'] != null, - attributes['autoplay'] != null, - sources, - context.style.width ?? 300.w, - ); - }, - }, - ), - Container( - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 2), - blurRadius: 14, - spreadRadius: 0, - ), - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - key: commentKey, - padding: EdgeInsets.all(16), - child: Row( - children: [ - Text( - S - .of(context) - .pinglun_(commentTotal.toString()), - style: TextStyle( - fontSize: 16.sp, - fontWeight: FontWeight.bold, - color: Color(0xff1A1A1A), - ), - ), - SizedBox( - width: 16.w, - ), - Text( - S.of(context).xihuan_( - "${article?.likes ?? activity?.likes ?? "0"}"), - style: TextStyle( - fontSize: 16.sp, - fontWeight: FontWeight.bold, - color: Color(0xff1A1A1A), - ), - ), - ], - ), - ), - if (memberList != null && memberList.length > 0) - ListView.builder( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemCount: - memberList != null ? memberList.length : 0, - scrollDirection: Axis.vertical, - itemBuilder: (context, position) { - return Material( - color: Colors.white, - child: InkWell( - onTap: () { - showPressMenu( - memberList[position].createUser, - memberList[position]); - }, - child: commentItem(memberList[position], - position, memberList.length), - ), - ); - }, - ), - if (memberList != null && memberList.length > 0) - Container( - height: 63.h, - decoration: BoxDecoration( - color: Color(0xFFF2F2F2), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 2), - blurRadius: 14, - spreadRadius: 0, - ), - ], - ), - alignment: Alignment.center, - child: Text( - S.of(context).yixiansquanbupinglun, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xff353535), - ), - ), - ), - if (memberList == null || memberList.length == 0) - Container( - width: double.infinity, - height: 80.h, - alignment: Alignment.center, - child: Text( - S.of(context).zanwupinglun, - style: TextStyle( - fontSize: 14.sp, - fontWeight: FontWeight.bold, - color: Color(0xFFA0A0A0), - ), - ), - ), - ], - ), - ), - SizedBox( - height: 12.h, - ), - ], - ), - ), - ), - flex: 1, - ), - commentWidget(), - ], - ), - ), - ); - } - - showPressMenu(String userId, memberComment) { - if (isKeyBoardShow) { - setState(() { - hintText = S.of(context).liuxianinjingcaidepinglunba; - }); - FocusScope.of(context).requestFocus(FocusNode()); - return; - } - SharedPreferences.getInstance().then((value) { - showModalBottomSheet( - context: context, - backgroundColor: Colors.transparent, - builder: (context) { - return CommentMenu( - (type) { - print("click: $type"); - if (type == "huifu") { - reply(memberComment); - } else if (type == "shanchu") { - delCommentTips(); - } - }, - isSelf: userId == value.getString("userId"), - ); - }, - ); - }); - } - - delCommentTips() { - SmartDialog.show(widget: Tips(() { - delComment(); - })); - } - - delComment() async { - BaseData baseData = await apiService.delComment( - widget.arguments["activityId"] ?? widget.arguments["articleId"]); - if (baseData != null && baseData.isSuccess) { - queryMemberCommentList(); - } - } - - reply(memberComment) { - FocusScope.of(context).requestFocus(commentFocus); - parenId = memberComment.id; - setState(() { - hintText = S.of(context).huifu_("${memberComment.username}"); - }); - } - - Widget commentWidget() { - return Container( - padding: EdgeInsets.all(16), - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 2), - blurRadius: 14, - spreadRadius: 0, - ), - ], - borderRadius: BorderRadius.vertical( - top: Radius.circular(8), - ), - ), - child: Row( - children: [ - Expanded( - flex: 1, - child: Container( - decoration: BoxDecoration( - color: Color(0xffF2F2F2), - borderRadius: BorderRadius.circular(2.0), - ), - child: Column( - children: [ - Container( - margin: EdgeInsets.fromLTRB(4, 0, 4, 0), - alignment: Alignment.topLeft, - child: TextField( - maxLines: 8, - minLines: 1, - focusNode: commentFocus, - controller: commentTextController, - decoration: InputDecoration( - border: InputBorder.none, - hintText: hintText, - hintStyle: TextStyle( - fontSize: 14.sp, - color: Color(0xFF868686), - ), - ), - ), - ), - ], - ), - ), - ), - if (isKeyBoardShow) - GestureDetector( - onTap: () { - var commentText = commentTextController.text; - if (commentText == "") { - return; - } - queryMemberComment(commentText); - }, - child: Container( - padding: EdgeInsets.symmetric(horizontal: 20.w), - child: Text( - S.of(context).fasong, - style: TextStyle( - fontSize: 16.sp, - fontWeight: FontWeight.bold, - color: Color(0XFF1A1A1A), - ), - ), - ), - ), - if (!isKeyBoardShow) - InkWell( - onTap: toComment, - child: Container( - padding: EdgeInsets.only(left: 20, right: 10), - child: Image.asset( - "assets/image/icon_comment.png", - width: 24, - height: 24, - ), - ), - ), - if (!isKeyBoardShow) - LikeButton( - padding: EdgeInsets.all(10), - size: 24, - circleSize: 24, - circleColor: CircleColor( - start: Color(0xff00ddff), - end: Color(0xff0099cc), - ), - bubblesColor: BubblesColor( - dotPrimaryColor: Color(0xff33b5e5), - dotSecondaryColor: Color(0xff0099cc), - ), - bubblesSize: 24, - likeBuilder: (bool isLiked) { - return isLiked - ? Image.asset( - "assets/image/icon_like.png", - width: 24, - height: 24, - ) - : Image.asset( - "assets/image/icon_like_h.png", - width: 24, - height: 24, - ); - }, - isLiked: (activity != null - ? activity.liked - : article != null - ? article.liked - : false), - onTap: (isLiked) async { - await queryInformationLikes(); - return (activity != null - ? activity.liked - : article != null - ? article.liked - : false); - }, - // likeCount: memberList.likes, - countBuilder: (int count, bool isLiked, String text) { - return Text( - text, - style: TextStyle( - color: Color(0xFF1A1A1A), - fontSize: 12.sp, - ), - ); - }, - ), - ], - ), - ); - } - - toComment() { - if (commentKey.currentContext == null) return; - RenderBox firstRenderBox = commentKey.currentContext.findRenderObject(); - Offset first = firstRenderBox.localToGlobal(Offset.zero); - scrollController.animateTo( - first.dy + - scrollController.offset - - (kToolbarHeight + MediaQuery.of(context).padding.top), - duration: Duration(milliseconds: 100), - curve: Curves.easeIn); - } - - VideoPlayerController videoPlayerController; - ChewieController chewieAudioController; - Chewie chewies; - - Widget videoWidget(double width, double height, src, sandboxMode) { - print("src : $src"); - return Container( - width: MediaQuery.of(context).size.width, - height: (MediaQuery.of(context).size.width) / (width / height), - child: chewies = Chewie( - controller: chewieAudioController = ChewieController( - videoPlayerController: videoPlayerController = - VideoPlayerController.network( - src, - ), - aspectRatio: width / height, - //宽高比 - autoPlay: false, - //自动播放 - looping: false, - //循环播放 - // 拖动条样式颜色 - materialProgressColors: chewie.ChewieProgressColors( - playedColor: Colors.white, - handleColor: Colors.white, - backgroundColor: Colors.grey, - bufferedColor: Colors.transparent, - ), - autoInitialize: true, - ), - ), - ); - } - - Widget audioWidget(showControls, loop, autoplay, src, width) { - return Container( - width: width, - child: chewies = Chewie( - controller: chewieAudioController = ChewieController( - videoPlayerController: VideoPlayerController.network( - src.first ?? "", - ), - autoPlay: autoplay, - looping: loop, - showControls: showControls, - autoInitialize: true, - ), - ), - ); - } - - Widget commentItem(MemberCommentList memberList, int index, int max) { - return Container( - padding: EdgeInsets.symmetric(vertical: 8.w), - child: Column( - children: [ - Container( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - MImage( - memberList.userAvatarUrl ?? "", - fit: BoxFit.cover, - isCircle: true, - width: 40, - height: 40, - fadeSrc: "assets/image/default_user.png", - errorSrc: "assets/image/default_user.png", - ), - SizedBox( - width: 12.w, - ), - Expanded( - child: Container( - height: 60.h, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text.rich( - TextSpan( - children: [ - TextSpan( - text: memberList.username, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.sp, - color: Colors.black, - ), - ), - ], - ), - textDirection: TextDirection.ltr, - ), - Text( - memberList.createTime, - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xff808080), - ), - ), - ], - ), - ), - flex: 1, - ), - Container( - alignment: Alignment.topRight, - child: LikeButton( - padding: EdgeInsets.all(10), - circleSize: 16, - circleColor: CircleColor( - start: Color(0xff00ddff), - end: Color(0xff0099cc), - ), - bubblesColor: BubblesColor( - dotPrimaryColor: Color(0xff33b5e5), - dotSecondaryColor: Color(0xff0099cc), - ), - bubblesSize: 15, - likeBuilder: (bool isLiked) { - return isLiked - ? Image.asset( - "assets/image/icon_like.png", - width: 16, - height: 16, - ) - : Image.asset( - "assets/image/icon_like_h.png", - width: 16, - height: 16, - ); - }, - isLiked: memberList.liked ?? false, - onTap: (isLiked) async { - await queryCommentLike(memberList.id); - return (memberList == null || memberList.liked == null) - ? false - : memberList.liked; - }, - likeCount: memberList.likes, - countBuilder: (int count, bool isLiked, String text) { - return Text( - text, - style: TextStyle( - color: Color(0xFF1A1A1A), - fontSize: 12.sp, - ), - ); - }, - ), - ), - ], - ), - ), - Container( - padding: - EdgeInsets.only(left: 68, right: 16, top: 16.h, bottom: 16.h), - child: Align( - alignment: Alignment.centerLeft, - child: Text( - memberList.content, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xff1A1A1A), - ), - ), - ), - ), - SizedBox( - height: 12.h, - ), - if (memberList.parentContent != null) - Container( - margin: EdgeInsets.only(left: 68.w, right: 16.w), - decoration: BoxDecoration( - color: Color(0xffF2F2F2), - borderRadius: BorderRadius.circular(2.0), - ), - child: Padding( - padding: EdgeInsets.only(left: 4.w, top: 4.h, bottom: 4.h), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "${memberList.parentUserName}:" ?? "", - style: TextStyle( - fontSize: 12.sp, - color: Color(0xff808080), - ), - ), - Expanded( - flex: 1, - child: Text( - memberList.parentContent ?? "", - style: TextStyle( - fontSize: 12.sp, - color: Color(0xff808080), - ), - ), - ), - ], - ), - ), - ), - ], - ), - ); - } - - @override - void dispose() { - WidgetsBinding.instance.removeObserver(this); - if (chewieAudioController != null) chewieAudioController.dispose(); - - if (videoPlayerController != null) videoPlayerController.dispose(); - - super.dispose(); - } -} diff --git a/lib/union/union_details_page.dart b/lib/union/union_details_page.dart index 5c06cdfb..b4ba090f 100644 --- a/lib/union/union_details_page.dart +++ b/lib/union/union_details_page.dart @@ -772,7 +772,7 @@ class _UnionDetailsPage extends State { widget.arguments["source"] == activitys[position].id) { Navigator.of(context).pop(); } else { - Navigator.of(context).pushNamed('/router/store_detail_page', + Navigator.of(context).pushNamed('/router/web_page', arguments: { "activityId": activitys[position].id, "source": widget.arguments["id"] diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 0ecea3e4..e7ea2960 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -517,7 +517,7 @@ class _UnionPage extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - padding: EdgeInsets.only(top: 1.h, left: 2, right: 2), + padding: EdgeInsets.only(top: 3.h, left: 2, right: 2), child: Image.asset( "assets/image/icon_union_location_black.png", width: 14, diff --git a/lib/view_widget/comment_menu.dart b/lib/view_widget/comment_menu.dart index 947c30c8..fb0d4c10 100644 --- a/lib/view_widget/comment_menu.dart +++ b/lib/view_widget/comment_menu.dart @@ -34,10 +34,11 @@ class _CommentMenu extends State { children: [ InkWell( onTap: () { - Navigator.of(context).pop(); widget.clickType("huifu"); }, child: Container( + width: MediaQuery.of(context).size.width, + alignment: Alignment.center, padding: EdgeInsets.all(20.h), child: Text( S.of(context).huifu, @@ -56,10 +57,11 @@ class _CommentMenu extends State { if (widget.isSelf) InkWell( onTap: () { - Navigator.of(context).pop(); widget.clickType("shanchu"); }, child: Container( + width: MediaQuery.of(context).size.width, + alignment: Alignment.center, padding: EdgeInsets.all(20.h), child: Text( S.of(context).shanchu, @@ -78,9 +80,11 @@ class _CommentMenu extends State { ), InkWell( onTap: () { - Navigator.of(context).pop(); + widget.clickType("quxiao"); }, child: Container( + width: MediaQuery.of(context).size.width, + alignment: Alignment.center, padding: EdgeInsets.all(20.h), child: Text( S.of(context).quxiao, diff --git a/lib/view_widget/hot_item.dart b/lib/view_widget/hot_item.dart index bafe1b8b..a55f04fc 100644 --- a/lib/view_widget/hot_item.dart +++ b/lib/view_widget/hot_item.dart @@ -33,7 +33,7 @@ class _HotArticleItem extends State { } click() async { - await Navigator.of(context).pushNamed('/router/store_detail_page', + await Navigator.of(context).pushNamed('/router/web_page', arguments: {"articleId": widget.article.id}); widget.article.viewers = (widget.article.viewers + 1); setState(() {}); @@ -236,7 +236,7 @@ class _HotArticleItem extends State { ), flex: 1, ), - if (widget.isHot != null && widget.isHot) + // if (widget.isHot != null && widget.isHot) IconText( widget.article != null ? (widget.article.createTime.split(" ")[0]) diff --git a/lib/view_widget/mine_vip_view.dart b/lib/view_widget/mine_vip_view.dart index 8f25ee71..4fd60891 100644 --- a/lib/view_widget/mine_vip_view.dart +++ b/lib/view_widget/mine_vip_view.dart @@ -46,8 +46,8 @@ class MineVipView extends StatelessWidget { userInfo.memberRankVo != null && ranks != null && ranks.length > 0) { - curLevel = (ranks.indexWhere( - (element) => element.id == userInfo.memberRankVo.id) + + curLevel = (ranks + .indexWhere((element) => element.id == userInfo.memberRankVo.id) + 1); vipLevel = curLevel; } @@ -115,26 +115,30 @@ class MineVipView extends StatelessWidget { } return GestureDetector( onTap: () { - SharedPreferences.getInstance().then((value) { - if (value.getString("token") == null || - value.getString("token") == "") { - LoginTipsDialog().show(context); - return; - } - Navigator.of(context) - .pushNamed('/router/mine_vip_level_page', arguments: { - "rankLevel": curLevel, - "createTime": (userInfo != null) ? "${userInfo.createTime}" : "", - "points": (userInfo != null) ? int.tryParse(userInfo.points) : 0, + if (userInfo != null) { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context) + .pushNamed('/router/mine_vip_level_page', arguments: { + "rankLevel": curLevel, + "createTime": (userInfo != null) ? "${userInfo.createTime}" : "", + "points": (userInfo != null) ? int.tryParse(userInfo.points) : 0, + }); }); - }); + } }, child: Hero( tag: tag, child: Container( margin: EdgeInsets.fromLTRB(padding.w, 16.h, padding.w, 8.h), width: MediaQuery.of(context).size.width - 32.w, - height: 200.h, + height: (MediaQuery.of(context).size.width - 32.w) / + 1.78 * + AppUtils.textScale(context), decoration: BoxDecoration( gradient: LinearGradient( colors: linearColor, @@ -156,13 +160,13 @@ class MineVipView extends StatelessWidget { children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - height: 95.h, + height: 86.w, child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, children: [ Container( padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h), @@ -201,97 +205,103 @@ class MineVipView extends StatelessWidget { child: Image.asset( "assets/image/icon_mine_huixiang_logo.png", width: 86.w, - height: 86.h, + height: 86.w, fit: BoxFit.contain, ), ), ], ), - Container( - margin: EdgeInsets.only(left: 13.w, right: 12.w, bottom: 12.h), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.baseline, - textBaseline: TextBaseline.alphabetic, - children: [ - Expanded( - child: Text( - rank > rankMax - ? S.of(context).dangqiandengji - : "${S.of(context).jifen_(rankMax - rank)} ${S.of(context).daoxiayidengji}", - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: textColor, - fontWeight: FontWeight.w400, - fontSize: 14.sp, + Expanded( + child: Container( + margin: EdgeInsets.only( + left: 13.w, + right: 12.w, + bottom: 12.h, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Expanded( + child: Text( + rank > rankMax + ? S.of(context).dangqiandengji + : "${S.of(context).jifen_(rankMax - rank)} ${S.of(context).daoxiayidengji}", + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: textColor, + fontWeight: FontWeight.w400, + fontSize: 14.sp, + ), ), + flex: 1, ), - flex: 1, - ), - Text.rich( - TextSpan( - children: [ - TextSpan( - text: "$rank", - style: TextStyle( - fontSize: 26.sp, - fontWeight: FontWeight.bold, - color: textColor, - ), - ), - if (rank <= rankMax) + Text.rich( + TextSpan( + children: [ TextSpan( - // string - text: rankMax > 0 ? "/$rankMax" : "/0", + text: "$rank", style: TextStyle( - fontSize: 14.sp, - fontWeight: FontWeight.w400, + fontSize: 26.sp, + fontWeight: FontWeight.bold, color: textColor, ), ), - ], + if (rank <= rankMax) + TextSpan( + text: rankMax > 0 ? "/$rankMax" : "/0", + style: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.w400, + color: textColor, + ), + ), + ], + ), ), - ), - ], - ), - Container( - margin: EdgeInsets.only(top: 12.h, bottom: 12.h), - height: 8.h, - child: ClipRRect( - borderRadius: BorderRadius.circular(6.5), - child: LinearProgressIndicator( - value: rankMax > 0 ? rank / rankMax : 0, - backgroundColor: Colors.white, - color: levelColor, - ), + ], ), - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - S.of(context).kaitongriqi( - (createTime != null && createTime != "") - ? createTime.split(" ")[0] - : "$createTime"), - style: TextStyle( - color: textColor, - fontWeight: FontWeight.w400, - fontSize: 12.sp, + Container( + height: 8.h, + child: ClipRRect( + borderRadius: BorderRadius.circular(6.5), + child: LinearProgressIndicator( + value: rankMax > 0 ? rank / rankMax : 0, + backgroundColor: Colors.white, + color: levelColor, ), ), - Icon( - Icons.qr_code, - size: 24, - color: Colors.white, - ), - ], - ), - ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + S.of(context).kaitongriqi( + (createTime != null && createTime != "") + ? createTime.split(" ")[0] + : "$createTime"), + style: TextStyle( + color: textColor, + fontWeight: FontWeight.w400, + fontSize: 12.sp, + ), + ), + Icon( + Icons.qr_code, + size: 24, + color: Colors.white, + ), + ], + ), + ], + ), ), + flex: 1, ), ], ), diff --git a/lib/web/web_page.dart b/lib/web/web_page.dart new file mode 100644 index 00000000..2e6436a5 --- /dev/null +++ b/lib/web/web_page.dart @@ -0,0 +1,318 @@ +import 'dart:io'; +import 'dart:ui'; + +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/activity.dart'; +import 'package:huixiang/retrofit/data/article.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/share_dialog.dart'; +import 'package:huixiang/view_widget/tips_dialog.dart'; +import 'package:huixiang/web/web_view/comment_list.dart'; +import 'package:huixiang/web/web_view/input_comment.dart'; +import 'package:huixiang/web/web_view/web_content.dart'; +import 'package:huixiang/web/web_view/web_header.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:sharesdk_plugin/sharesdk_defines.dart'; +import 'package:sharesdk_plugin/sharesdk_interface.dart'; +import 'package:sharesdk_plugin/sharesdk_map.dart'; +import 'package:webview_flutter/webview_flutter.dart'; +import 'package:flutter/cupertino.dart'; + +class WebPage extends StatefulWidget { + final Map arguments; + + ///富文本 文章 活动 + WebPage({this.arguments}); + + @override + State createState() { + return _WebPage(); + } +} + +class _WebPage extends State with WidgetsBindingObserver { + ApiService apiService; + int commentTotal = 0; + String hintText = S.current.liuxianinjingcaidepinglunba; + var commentFocus = FocusNode(); + String parenId = "0"; + + Activity activity; + Article article; + final GlobalKey commentKey = GlobalKey(); + final GlobalKey inputKey = GlobalKey(); + final ScrollController scrollController = ScrollController(); + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addObserver(this); + if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); + + queryHtml(); + + } + + bool isKeyBoardShow = false; + + @override + void didChangeMetrics() { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (MediaQuery.of(context).viewInsets.bottom == 0) { + if (isKeyBoardShow) { + FocusScope.of(context).requestFocus(FocusNode()); + setState(() { + hintText = S.current.liuxianinjingcaidepinglunba; + isKeyBoardShow = false; + }); + } + } else { + setState(() { + isKeyBoardShow = true; + }); + } + }); + } + + @override + void dispose() { + WidgetsBinding.instance.removeObserver(this); + super.dispose(); + } + + queryHtml() async { + SharedPreferences value = await SharedPreferences.getInstance(); + if (apiService == null) + apiService = ApiService(Dio(), context: context, token: value.getString("token")); + + if (widget.arguments["activityId"] != null) { + BaseData baseData = await apiService.activityInfo(widget.arguments["activityId"]).catchError((onError){}); + if (baseData != null && baseData.isSuccess) { + activity = baseData.data; + setState(() {}); + } + } + if (widget.arguments["articleId"] != null) { + BaseData
baseData = await apiService.informationInfo(widget.arguments["articleId"]).catchError((onError){}); + if (baseData != null && baseData.isSuccess) { + article = baseData.data; + setState(() {}); + } + } + } + + //发布评论 + _queryMemberComment(String content) async { + BaseData baseData = await apiService.memberComment({ + "content": content, + "parentId": parenId, + "relationalId": + widget.arguments["activityId"] ?? widget.arguments["articleId"], + "relationalType": 1 + }).catchError((error) {}); + if (baseData != null && baseData.isSuccess) { + _toComment(); + } + } + + share() async { + SSDKMap params = SSDKMap() + ..setGeneral( + activity != null + ? activity.mainTitle + : article != null + ? article.mainTitle + : "", + activity != null + ? activity.viceTitle + : article != null + ? article.viceTitle + : "", + [ + activity != null + ? activity.coverImg + : article != null + ? article.coverImg + : "", + ], + activity != null + ? activity.coverImg + : article != null + ? article.coverImg + : "", + "", buildShareUrl(), "", "", "", "", + SSDKContentTypes.webpage, + ); + + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (context) { + return ShareDialog((platform) { + if (platform == ShareSDKPlatforms.line) { + params.map["type"] = SSDKContentTypes.text.value; + params.map["text"] = + "${activity != null ? activity.viceTitle : article != null ? article.viceTitle : ""} ${buildShareUrl()}"; + } + SharesdkPlugin.share(platform, params, + (state, userData, contentEntity, error) { + print("share!$state"); + }); + }); + }); + } + + String buildShareUrl() { + return "https://hx.lotus-wallet.com/index.html?id=${widget.arguments["activityId"] ?? widget.arguments["articleId"]}&type=${activity != null ? "activity" : article != null ? "article" : ""}"; + } + + //给文章/活动点赞 + _queryInformationLikes() async { + BaseData baseData = await apiService.informationLikes( + widget.arguments["activityId"] ?? widget.arguments["articleId"]); + if (baseData != null && baseData.isSuccess) { + if (article != null) { + if (article.liked) { + article.likes -= 1; + } else { + article.likes += 1; + } + article.liked = !article.liked; + } else if (activity != null) { + if (activity.liked) { + activity.likes -= 1; + } else { + activity.likes += 1; + } + activity.liked = !activity.liked; + } + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + action: Container( + margin: EdgeInsets.only(right: 10), + child: GestureDetector( + onTap: () { + share(); + }, + child: Icon( + Icons.share, + size: 24, + color: Colors.black, + ), + ), + ), + background: Color(0xFFF7F7F7), + leadingColor: Colors.black, + title: activity != null + ? activity.mainTitle + : article != null + ? article.mainTitle + : "", + titleSize: 18.sp, + titleColor: Colors.black, + ), + body: Container( + child: Column( + children: [ + Expanded( + child: GestureDetector( + onTap: () { + commentFocus.unfocus(); + hintText = S.of(context).liuxianinjingcaidepinglunba; + inputKey.currentState.setState(() {});; + parenId = "0"; + }, + child: SingleChildScrollView( + controller: scrollController, + physics: BouncingScrollPhysics(), + child: Column( + children: [ + /// 富文本的头部 + WebHeader(widget.arguments, activity, article), + + /// 富文本的内容 + WebContent(activity, article), + + /// 富文本的评论 + CommentList( + commentKey, + widget.arguments, + activity, + article, + isKeyBoardShow, + _reply, + _delCommentTips, + ), + ], + ), + ), + ), + flex: 1, + ), + + /// 富文本评论的输入框 + InputComment( + inputKey, + hintText, + activity, + article, + isKeyBoardShow, + commentFocus, + _toComment, + _queryMemberComment, + _queryInformationLikes, + ), + ], + ), + ), + ); + } + + _delCommentTips() { + SmartDialog.show(widget: Tips(() { + delComment(); + })); + } + + delComment() async { + BaseData baseData = await apiService.delComment( + widget.arguments["activityId"] ?? widget.arguments["articleId"]); + if (baseData != null && baseData.isSuccess) { + commentKey.currentState.setState(() {}); + } + } + + _reply(memberComment) { + FocusScope.of(context).requestFocus(commentFocus); + parenId = memberComment.id; + hintText = S.of(context).huifu_("${memberComment.username}"); + } + + _toComment() { + if (commentKey.currentContext == null) return; + RenderBox firstRenderBox = commentKey.currentContext.findRenderObject(); + Offset first = firstRenderBox.localToGlobal(Offset.zero); + scrollController.animateTo( + first.dy + + scrollController.offset - + (kToolbarHeight + MediaQuery.of(context).padding.top), + duration: Duration(milliseconds: 1000), + curve: Curves.easeIn); + } + + +} diff --git a/lib/web/web_view/comment_list.dart b/lib/web/web_view/comment_list.dart new file mode 100644 index 00000000..2a9e9c60 --- /dev/null +++ b/lib/web/web_view/comment_list.dart @@ -0,0 +1,422 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/retrofit/data/activity.dart'; +import 'package:huixiang/retrofit/data/article.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/member_comment_list.dart'; +import 'package:huixiang/retrofit/data/page.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/view_widget/comment_menu.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/login_tips_dialog.dart'; +import 'package:like_button/like_button.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class CommentList extends StatefulWidget { + final Map arguments; + final Activity activity; + final Article article; + final bool isKeyBoardShow; + final Function reply; + final Function delCommentTips; + + CommentList( + Key key, + this.arguments, + this.activity, + this.article, + this.isKeyBoardShow, + this.reply, + this.delCommentTips, + ) : super(key: key); + + @override + State createState() { + return _CommentList(); + } +} + +class _CommentList extends State { + int commentTotal = 0; + List memberList = []; + ApiService apiService; + + //评论点赞 + queryCommentLike(String id) async { + SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); + String token = sharedPreferences.getString("token"); + if (token == null || token == "") { + LoginTipsDialog().show(context); + return; + } + BaseData baseData = + await apiService.commentLike(id).catchError((onError) {}); + if (baseData != null && baseData.isSuccess) { + memberList.forEach((element) { + if (element.id == id) { + if (element.liked) { + element.likes -= 1; + element.liked = false; + } else { + element.likes += 1; + element.liked = true; + } + } + }); + } + } + + @override + void initState() { + super.initState(); + queryMemberCommentList(); + } + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Container( + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 2), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(16), + child: Row( + children: [ + Text( + S.of(context).pinglun_(commentTotal.toString()), + style: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.bold, + color: Color(0xff1A1A1A), + ), + ), + SizedBox( + width: 16.w, + ), + Text( + S.of(context).xihuan_( + "${widget.article?.likes ?? widget.activity?.likes ?? "0"}"), + style: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.bold, + color: Color(0xff1A1A1A), + ), + ), + ], + ), + ), + if (memberList != null && memberList.length > 0) + ListView.builder( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemCount: memberList != null ? memberList.length : 0, + scrollDirection: Axis.vertical, + itemBuilder: (context, position) { + return Material( + color: Colors.white, + child: InkWell( + onTap: () { + showPressMenu(memberList[position].createUser, + memberList[position]); + }, + child: commentItem( + memberList[position], position, memberList.length), + ), + ); + }, + ), + if (memberList != null && memberList.length > 0) + Container( + height: 63.h, + decoration: BoxDecoration( + color: Color(0xFFF2F2F2), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 2), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + alignment: Alignment.center, + child: Text( + S.of(context).yixiansquanbupinglun, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xff353535), + ), + ), + ), + if (memberList == null || memberList.length == 0) + Container( + width: double.infinity, + height: 80.h, + alignment: Alignment.center, + child: Text( + S.of(context).zanwupinglun, + style: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.bold, + color: Color(0xFFA0A0A0), + ), + ), + ), + ], + ), + ), + SizedBox( + height: 12.h, + ), + ], + ); + } + + //评论列表 + queryMemberCommentList() async { + SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); + if (apiService == null) + apiService = ApiService(Dio(), + context: context, token: sharedPreferences.getString("token")); + BaseData> baseData = + await apiService.memberCommentList({ + "pageNum": 1, + "pageSize": 100, + "relationalId": + widget.arguments["activityId"] ?? widget.arguments["articleId"], + "relationalType": 1, + }).catchError((error) {}); + if (baseData != null && baseData.isSuccess) { + commentTotal = baseData.data.size; + memberList = baseData.data.list; + setState(() {}); + } + } + + showPressMenu(String userId, memberComment) { + if (widget.isKeyBoardShow) { + FocusScope.of(context).requestFocus(FocusNode()); + return; + } + SharedPreferences.getInstance().then((value) { + // showModalBottomSheet( + // context: context, + // backgroundColor: Colors.transparent, + // builder: (context) { + // return CommentMenu( + // (type) { + // print("click: $type"); + // if (type == "huifu") { + // widget.reply(memberComment); + // } else if (type == "shanchu") { + // widget.delCommentTips(); + // } + // }, + // isSelf: userId == value.getString("userId"), + // ); + // }, + // ); + + SmartDialog.show( + widget: CommentMenu((type) { + SmartDialog.dismiss(); + if (type == "huifu") { + widget.reply(memberComment); + } else if (type == "shanchu") { + widget.delCommentTips(); + } + }, + isSelf: userId == value.getString("userId"), + ), + alignmentTemp: Alignment.bottomCenter, + isUseAnimationTemp: true, + animationDurationTemp: Duration(milliseconds: 300), + ); + }); + } + + Widget commentItem(MemberCommentList memberList, int index, int max) { + return Container( + padding: EdgeInsets.symmetric(vertical: 8.w), + child: Column( + children: [ + Container( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + MImage( + memberList.userAvatarUrl ?? "", + fit: BoxFit.cover, + isCircle: true, + width: 40, + height: 40, + fadeSrc: "assets/image/default_user.png", + errorSrc: "assets/image/default_user.png", + ), + SizedBox( + width: 12.w, + ), + Expanded( + child: Container( + height: 60.h, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: memberList.username, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14.sp, + color: Colors.black, + ), + ), + ], + ), + textDirection: TextDirection.ltr, + ), + Text( + memberList.createTime, + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xff808080), + ), + ), + ], + ), + ), + flex: 1, + ), + Container( + alignment: Alignment.topRight, + child: LikeButton( + padding: EdgeInsets.all(10), + circleSize: 16, + circleColor: CircleColor( + start: Color(0xff00ddff), + end: Color(0xff0099cc), + ), + bubblesColor: BubblesColor( + dotPrimaryColor: Color(0xff33b5e5), + dotSecondaryColor: Color(0xff0099cc), + ), + bubblesSize: 15, + likeBuilder: (bool isLiked) { + return isLiked + ? Image.asset( + "assets/image/icon_like.png", + width: 16, + height: 16, + ) + : Image.asset( + "assets/image/icon_like_h.png", + width: 16, + height: 16, + ); + }, + isLiked: memberList.liked ?? false, + onTap: (isLiked) async { + await queryCommentLike(memberList.id); + return (memberList == null || memberList.liked == null) + ? false + : memberList.liked; + }, + likeCount: memberList.likes, + countBuilder: (int count, bool isLiked, String text) { + return Text( + text, + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 12.sp, + ), + ); + }, + ), + ), + ], + ), + ), + Container( + padding: EdgeInsets.only( + left: 68, + right: 16, + top: 16.h, + bottom: 16.h, + ), + child: Align( + alignment: Alignment.centerLeft, + child: Text( + memberList.content, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xff1A1A1A), + ), + ), + ), + ), + SizedBox( + height: 12.h, + ), + if (memberList.parentContent != null) + Container( + margin: EdgeInsets.only(left: 68.w, right: 16.w), + decoration: BoxDecoration( + color: Color(0xffF2F2F2), + borderRadius: BorderRadius.circular(2.0), + ), + child: Padding( + padding: EdgeInsets.only(left: 4.w, top: 4.h, bottom: 4.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "${memberList.parentUserName}:" ?? "", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xff808080), + ), + ), + Expanded( + flex: 1, + child: Text( + memberList.parentContent ?? "", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xff808080), + ), + ), + ), + ], + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/web/web_view/input_comment.dart b/lib/web/web_view/input_comment.dart new file mode 100644 index 00000000..2833ad87 --- /dev/null +++ b/lib/web/web_view/input_comment.dart @@ -0,0 +1,178 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/activity.dart'; +import 'package:huixiang/retrofit/data/article.dart'; +import 'package:like_button/like_button.dart'; + +class InputComment extends StatefulWidget { + final String hintText; + final Activity activity; + final Article article; + final bool isKeyBoardShow; + final FocusNode commentFocus; + final Function toComment; + final Function(String text) queryMemberComment; + final Function() queryInformationLikes; + + InputComment( + Key key, + this.hintText, + this.activity, + this.article, + this.isKeyBoardShow, + this.commentFocus, + this.toComment, + this.queryMemberComment, + this.queryInformationLikes, + ) : super(key: key); + + @override + State createState() { + return _InputComment(); + } +} + +class _InputComment extends State { + + var commentTextController = TextEditingController(); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 2), + blurRadius: 14, + spreadRadius: 0, + ), + ], + borderRadius: BorderRadius.vertical( + top: Radius.circular(8), + ), + ), + child: Row( + children: [ + Expanded( + flex: 1, + child: Container( + decoration: BoxDecoration( + color: Color(0xffF2F2F2), + borderRadius: BorderRadius.circular(2.0), + ), + child: Column( + children: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 4.w), + alignment: Alignment.topLeft, + child: TextField( + maxLines: 8, + minLines: 1, + focusNode: widget.commentFocus, + controller: commentTextController, + decoration: InputDecoration( + border: InputBorder.none, + hintText: widget.hintText, + hintStyle: TextStyle( + fontSize: 14.sp, + color: Color(0xFF868686), + ), + ), + ), + ), + ], + ), + ), + ), + if (widget.isKeyBoardShow) + GestureDetector( + onTap: () { + var commentText = commentTextController.text; + if (commentText == "") { + return; + } + widget.queryMemberComment(commentText); + }, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 20.w), + child: Text( + S.of(context).fasong, + style: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.bold, + color: Color(0XFF1A1A1A), + ), + ), + ), + ), + if (!widget.isKeyBoardShow) + InkWell( + onTap: widget.toComment, + child: Container( + padding: EdgeInsets.only(left: 20.w, right: 10.w), + child: Image.asset( + "assets/image/icon_comment.png", + width: 24, + height: 24, + ), + ), + ), + if (!widget.isKeyBoardShow) + LikeButton( + padding: EdgeInsets.all(10), + size: 24, + circleSize: 24, + circleColor: CircleColor( + start: Color(0xff00ddff), + end: Color(0xff0099cc), + ), + bubblesColor: BubblesColor( + dotPrimaryColor: Color(0xff33b5e5), + dotSecondaryColor: Color(0xff0099cc), + ), + bubblesSize: 24, + likeBuilder: (bool isLiked) { + return isLiked + ? Image.asset( + "assets/image/icon_like.png", + width: 24, + height: 24, + ) + : Image.asset( + "assets/image/icon_like_h.png", + width: 24, + height: 24, + ); + }, + isLiked: (widget.activity != null + ? widget.activity.liked + : widget.article != null + ? widget.article.liked + : false), + onTap: (isLiked) async { + await widget.queryInformationLikes(); + return (widget.activity != null + ? widget.activity.liked + : widget.article != null + ? widget.article.liked + : false); + }, + countBuilder: (int count, bool isLiked, String text) { + return Text( + text, + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 12.sp, + ), + ); + }, + ), + ], + ), + ); + } +} diff --git a/lib/web/web_view/web_content.dart b/lib/web/web_view/web_content.dart new file mode 100644 index 00000000..b50ce1e7 --- /dev/null +++ b/lib/web/web_view/web_content.dart @@ -0,0 +1,170 @@ + + +import 'package:chewie/chewie.dart'; +import 'package:flutter_html/flutter_html.dart'; +import 'package:flutter_html/image_render.dart'; +import 'package:chewie/src/chewie_progress_colors.dart' as chewie; +import 'package:flutter/material.dart'; +import 'package:flutter_html/src/replaced_element.dart'; +import 'package:huixiang/retrofit/data/activity.dart'; +import 'package:huixiang/retrofit/data/article.dart'; +import 'package:video_player/video_player.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class WebContent extends StatefulWidget { + + final Activity activity; + final Article article; + + WebContent(this.activity, this.article); + + @override + State createState() { + return _WebContent(); + } + +} + +class _WebContent extends State { + @override + Widget build(BuildContext context) { + return Html( + data: widget.activity != null + ? widget.activity.content + : widget.article != null + ? widget.article.content + : "", + customImageRenders: { + base64DataUriMatcher(): base64ImageRender(), + assetUriMatcher(): assetImageRender(), + networkSourceMatcher(extension: "svg"): + svgNetworkImageRender(), + networkSourceMatcher(): networkImageRender( + loadingWidget: () { + return Container(); + }, + ), + }, + customRender: { + "video": + (context, parsedChild, attributes, element) { + var src = attributes['src']; + return videoWidget( + double.tryParse(attributes['width'] ?? ""), + double.tryParse( + element.attributes['height'] ?? ""), + (src != null && + src != "" && + src.endsWith(".mp4")) + ? src + : element + .children.first.attributes["src"], + element.attributes["sandbox"]); + }, + "iframe": + (context, parsedChild, attributes, element) { + var src = attributes['src']; + return videoWidget( + double.tryParse(attributes['width'] ?? ""), + double.tryParse( + element.attributes['height'] ?? ""), + (src != null && + src != "" && + src.endsWith(".mp4")) + ? src + : element + .children.first.attributes["src"], + element.attributes["sandbox"]); + }, + "audio": + (context, parsedChild, attributes, element) { + final sources = [ + if (element.attributes['src'] != null) + element.attributes['src'], + ]; + if (sources == null || + sources.isEmpty || + sources.first == null) { + return EmptyContentElement(); + } + return audioWidget( + attributes['controls'] != null, + attributes['loop'] != null, + attributes['autoplay'] != null, + sources, + context.style.width ?? 300.w, + ); + }, + }, + ); + } + + VideoPlayerController videoPlayerController; + ChewieController chewieAudioController; + Chewie chewies; + + Widget videoWidget(double width, double height, src, sandboxMode) { + print("src : $src"); + return Container( + width: MediaQuery.of(context).size.width, + height: (MediaQuery.of(context).size.width) / (width / height), + child: chewies = Chewie( + controller: chewieAudioController = ChewieController( + videoPlayerController: videoPlayerController = + VideoPlayerController.network( + src, + ), + aspectRatio: width / height, + //宽高比 + autoPlay: false, + //自动播放 + looping: false, + //循环播放 + // 拖动条样式颜色 + materialProgressColors: chewie.ChewieProgressColors( + playedColor: Colors.white, + handleColor: Colors.white, + backgroundColor: Colors.grey, + bufferedColor: Colors.transparent, + ), + autoInitialize: true, + ), + ), + ); + } + + Widget audioWidget(showControls, loop, autoplay, src, width) { + return Container( + width: width, + child: chewies = Chewie( + controller: chewieAudioController = ChewieController( + videoPlayerController: VideoPlayerController.network( + src.first ?? "", + ), + autoPlay: autoplay, + looping: loop, + showControls: showControls, + autoInitialize: true, + ), + ), + ); + } + + @override + void dispose() { + + if (chewieAudioController != null) { + chewieAudioController.pause(); + chewieAudioController.dispose(); + chewieAudioController = null; + } + + if (videoPlayerController != null) { + videoPlayerController.pause(); + videoPlayerController.dispose(); + } + + super.dispose(); + } + +} \ No newline at end of file diff --git a/lib/web/web_view/web_header.dart b/lib/web/web_view/web_header.dart new file mode 100644 index 00000000..025e897b --- /dev/null +++ b/lib/web/web_view/web_header.dart @@ -0,0 +1,100 @@ + +import 'package:flutter/material.dart'; +import 'package:huixiang/retrofit/data/activity.dart'; +import 'package:huixiang/retrofit/data/article.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class WebHeader extends StatefulWidget { + + final Map arguments; + final Activity activity; + final Article article; + + WebHeader(this.arguments, this.activity, this.article); + + @override + State createState() { + return _WebHeader(); + } + +} + +class _WebHeader extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Container( + color: Color(0xFFF7F7F7), + padding: EdgeInsets.all(12), + alignment: Alignment.centerLeft, + child: Text( + widget.activity != null + ? widget.activity.mainTitle + : widget.article != null + ? widget.article.mainTitle + : "", + style: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.bold, + color: Color(0xFF353535), + ), + ), + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Row( + children: [ + InkWell( + child: Text( + "${widget.activity != null ? (widget.activity.storeName ?? "") : (widget.article != null && widget.article.author != null) ? (widget.article.author.name ?? "") : ""}", + style: TextStyle( + fontWeight: FontWeight.normal, + fontSize: 14.sp, + color: Colors.blue, + ), + ), + onTap: () { + if (widget.activity != null) { + if (widget.arguments["source"] != null && + widget.arguments["source"] == + widget.activity.storeId) { + Navigator.of(context).pop(); + } else { + Navigator.of(context).pushNamed( + '/router/union_detail_page', + arguments: { + "id": widget.activity.storeId, + "source": + widget.arguments["activityId"] + }); + } + } + }, + ), + SizedBox( + width: 10.w, + ), + Text( + widget.activity != null + ? widget.activity.createTime + : widget.article != null + ? widget.article.createTime + : "", + style: TextStyle( + fontWeight: FontWeight.normal, + fontSize: 12.sp, + color: Colors.grey, + ), + ), + ], + ), + ), + ], + ); + } + +} + + + diff --git a/pubspec.lock b/pubspec.lock index 853abd16..ef77fc11 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -321,13 +321,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.0.4" - flutter_bugly: - dependency: "direct main" - description: - name: flutter_bugly - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.3.3" flutter_cache_manager: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 1bfe3480..928d8713 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -92,7 +92,7 @@ dependencies: rive: ^0.6.8 flare_flutter: ^3.0.2 - flutter_bugly: ^0.3.3 +# flutter_bugly: ^0.3.3 dev_dependencies: flutter_test: