|
|
@@ -154,33 +154,43 @@ export default {
|
|
|
// #endif
|
|
|
|
|
|
// #ifdef APP-PLUS
|
|
|
+ let that = this
|
|
|
if(plus.runtime.isApplicationExist({pname:'com.tencent.mm',action:'weixin://'})){
|
|
|
- var sweixin
|
|
|
+ uni.login({
|
|
|
+ provider: 'weixin',
|
|
|
+ success: function (loginRes) {
|
|
|
+ plus.share.getServices(function(s){
|
|
|
+ var sweixin
|
|
|
+
|
|
|
+ for (var i = 0; i < s.length; i++) {
|
|
|
+ var t = s[i];
|
|
|
+ if (t.id == 'weixin') {
|
|
|
+ sweixin = t;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- plus.share.getServices(function(s){
|
|
|
- for (var i = 0; i < s.length; i++) {
|
|
|
- var t = s[i];
|
|
|
- if (t.id == 'weixin') {
|
|
|
- sweixin = t;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (sweixin && sweixin.nativeClient) {
|
|
|
- sweixin.launchMiniProgram({
|
|
|
- id: 'gh_73b8b357d19a',
|
|
|
- path: '/pagesPurchase/order',
|
|
|
- type: 0
|
|
|
+ if (sweixin && sweixin.nativeClient) {
|
|
|
+ sweixin.launchMiniProgram({
|
|
|
+ id: 'gh_73b8b357d19a',
|
|
|
+ path: '/pagesPurchase/order',
|
|
|
+ type: 0
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ that.$msg('请安装微信');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }, function(e){
|
|
|
+ that.$msg("获取微信失败:" + e.message)
|
|
|
+ console.log("获取微信失败:" + e.message);
|
|
|
});
|
|
|
- } else {
|
|
|
- this.$msg('请安装微信');
|
|
|
- return false;
|
|
|
+ },
|
|
|
+ fail: function (res) {
|
|
|
+ that.$msg("微信登录失败:" + JSON.stringify(res))
|
|
|
+ console.log(res)
|
|
|
}
|
|
|
- }, function(e){
|
|
|
- this.$msg("获取微信失败:" + e.message)
|
|
|
- console.log("获取微信失败:" + e.message);
|
|
|
- });
|
|
|
+ })
|
|
|
} else {
|
|
|
- this.$msg("微信应用未安装")
|
|
|
+ that.$msg("微信应用未安装")
|
|
|
return false
|
|
|
}
|
|
|
// #endif
|