zhengshuiqi 3 years ago
parent
commit
80456d05cc
  1. 10
      manifest.json
  2. 117
      pages/login/index.vue
  3. 61
      pages/productDetails/index.vue
  4. BIN
      static/img/AppleZ.png
  5. BIN
      static/img/GoogleZ.png
  6. BIN
      static/img/facebookZ.png

10
manifest.json

@ -45,7 +45,8 @@
"Speech" : {},
"iBeacon" : {},
"OAuth" : {},
"Messaging" : {}
"Messaging" : {},
"Share" : {}
},
/* */
"distribute" : {
@ -91,7 +92,9 @@
"__platform__" : [ "ios", "android" ]
}
},
"push" : {},
"push" : {
"unipush" : null
},
"speech" : {},
"oauth" : {
"google" : {
@ -101,7 +104,8 @@
"facebook" : {
"appid" : "884982142884404"
}
}
},
"share" : {}
},
"splashscreen" : {
"androidStyle" : "default",

117
pages/login/index.vue

@ -68,6 +68,15 @@
</text> and <text class="text" @click="gotonewpage(2)"> privacy policy</text>.
</view>
</view>
<view class="cellphone" style="padding-top: 15px;">
<view class="cellphone-box">
<view class="cellphone-minBox" v-if="cellphone == 2" @click="apple()"> <image src="../../static/img/AppleZ.png" mode=""></image></view>
<!-- v-if="cellphone == 2" -->
<view class="cellphone-minBox" @click="facebook()"><image src="../../static/img/facebookZ.png" mode=""></image></view>
<view class="cellphone-minBox" v-if="cellphone == 1" @click="google()"> <image src="../../static/img/GoogleZ.png" mode=""></image></view>
<!-- v-if="cellphone == 1" -->
</view>
</view>
</view>
<!-- <view class="mode">
@ -294,6 +303,42 @@
defaultRequest(data).then(res => {
console.info(res)
if (res.error == 0) {
this.loginErr = false
res.data.isLogin = true
setTimeout(() => {
uni.hideLoading()
uni.showToast({
title: 'Login successful',
icon: 'none',
duration: 2000
})
}, 1000)
let list = {
email: res.data.email,
cartlist: []
}
let list2 = []
list2.push(list)
uni.setStorageSync('cartlist', list2)
uni.setStorageSync('isLogin', 1)
uni.setStorageSync('user_info', res.data)
uni.navigateBack({
delta: 1
})
// uni.switchTab({
// delta: 1
// url:'../index/index'
// })
} else {
if (res.data) {
this.$refs.alertDialog.open()
this.query.username = this.loginDate.username
} else {
this.loginErr = true
this.errMsg = res.message
console.log(this.errMsg);
}
uni.showToast({
title:'Login is successful, please reopen the App to load information',
icon:'none',
@ -409,6 +454,42 @@
defaultRequest(data).then(res => {
console.info(res)
if (res.error == 0) {
this.loginErr = false
res.data.isLogin = true
setTimeout(() => {
uni.hideLoading()
uni.showToast({
title: 'Login successful',
icon: 'none',
duration: 2000
})
}, 1000)
let list = {
email: res.data.email,
cartlist: []
}
let list2 = []
list2.push(list)
uni.setStorageSync('cartlist', list2)
uni.setStorageSync('isLogin', 1)
uni.setStorageSync('user_info', res.data)
uni.navigateBack({
delta: 1
})
// uni.switchTab({
// delta: 1
// url:'../index/index'
// })
} else {
if (res.data) {
this.$refs.alertDialog.open()
this.query.username = this.loginDate.username
} else {
this.loginErr = true
this.errMsg = res.message
console.log(this.errMsg);
}
uni.showLoading({
title: '加载中'
});
@ -472,6 +553,42 @@
defaultRequest(data).then(res => {
console.info(res)
if (res.error == 0) {
this.loginErr = false
res.data.isLogin = true
setTimeout(() => {
uni.hideLoading()
uni.showToast({
title: 'Login successful',
icon: 'none',
duration: 2000
})
}, 1000)
let list = {
email: res.data.email,
cartlist: []
}
let list2 = []
list2.push(list)
uni.setStorageSync('cartlist', list2)
uni.setStorageSync('isLogin', 1)
uni.setStorageSync('user_info', res.data)
uni.navigateBack({
delta: 1
})
// uni.switchTab({
// delta: 1
// url:'../index/index'
// })
} else {
if (res.data) {
this.$refs.alertDialog.open()
this.query.username = this.loginDate.username
} else {
this.loginErr = true
this.errMsg = res.message
console.log(this.errMsg);
}
uni.navigateBack({
delta: 1
});

61
pages/productDetails/index.vue

@ -114,7 +114,7 @@
@click="addLike(goodsDate.id)"></image>
<image src="../../static/icon/like_red.png" mode="" v-show="goodsDate.is_attention==1"
@click="removeLike(goodsDate.id)"></image>
<image src="../../static/icon/share_white.png" mode="" @click="Isshare=true"></image>
<image src="../../static/icon/share_white.png" mode="" @click="Proshare()"></image>
</view>
</view>
<view class="variations">
@ -600,6 +600,11 @@
},
methods: {
//
Proshare(){
this.Isshare = true
this.video = false
},
//
goReview() {
uni.navigateTo({
@ -1080,12 +1085,34 @@
// Facebook
facebookShare() {
// 使 SDK
FB.ui({
method: 'share',
href: 'https://www.example.com/', //
}, function(response){
console.log(response);
});
//FB.ui({
// method: 'share',
//href: 'https://www.example.com/', //
// }, function(response){
// console.log(response);
// });
// Facebook App
// var urlStr = encodeURI("https://apps.apple.com/cn/app/facebook/id284882215?target=encodeURIComponent('https://www.facebook.com/')")
// uni.navigateTo({
// url: '../order/paypalWebview?src=' + urlStr
// })
// plus.runtime.openURL("urlStr")
// plus.runtime.openURL('https://www.dopeplus.com/facebookShare.html')
// uni.shareWithSystem({
// type: 'image',
// imageUrl: this.img,
// success: function() {
// uni.showToast({ title: '' });
// },
// fail: function(e) {
// uni.showModal({
// title: '',
// content: JSON.stringify(e)
// });
// }
// });
},
// 1
Copylink() {
@ -1139,16 +1166,16 @@
return url
}
},
mounted(){
window.fbAsyncInit = function() {
FB.init({
appId: '884982142884404', // ID
autoLogAppEvents: true,
xfbml: true,
version: 'v9.0'
});
};
},
// mounted(){
// window.fbAsyncInit = function() {
// FB.init({
// appId: '884982142884404', // ID
// autoLogAppEvents: true,
// xfbml: true,
// version: 'v9.0'
// });
// };
// },
onLoad(e) {
let that = this;
let s = 0;

BIN
static/img/AppleZ.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
static/img/GoogleZ.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
static/img/facebookZ.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Loading…
Cancel
Save