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

117
pages/login/index.vue

@ -68,6 +68,15 @@
</text> and <text class="text" @click="gotonewpage(2)"> privacy policy</text>. </text> and <text class="text" @click="gotonewpage(2)"> privacy policy</text>.
</view> </view>
</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>
<!-- <view class="mode"> <!-- <view class="mode">
@ -294,6 +303,42 @@
defaultRequest(data).then(res => { defaultRequest(data).then(res => {
console.info(res) console.info(res)
if (res.error == 0) { 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({ uni.showToast({
title:'Login is successful, please reopen the App to load information', title:'Login is successful, please reopen the App to load information',
icon:'none', icon:'none',
@ -409,6 +454,42 @@
defaultRequest(data).then(res => { defaultRequest(data).then(res => {
console.info(res) console.info(res)
if (res.error == 0) { 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({ uni.showLoading({
title: '加载中' title: '加载中'
}); });
@ -472,6 +553,42 @@
defaultRequest(data).then(res => { defaultRequest(data).then(res => {
console.info(res) console.info(res)
if (res.error == 0) { 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({ uni.navigateBack({
delta: 1 delta: 1
}); });

61
pages/productDetails/index.vue

@ -114,7 +114,7 @@
@click="addLike(goodsDate.id)"></image> @click="addLike(goodsDate.id)"></image>
<image src="../../static/icon/like_red.png" mode="" v-show="goodsDate.is_attention==1" <image src="../../static/icon/like_red.png" mode="" v-show="goodsDate.is_attention==1"
@click="removeLike(goodsDate.id)"></image> @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> </view>
<view class="variations"> <view class="variations">
@ -600,6 +600,11 @@
}, },
methods: { methods: {
//
Proshare(){
this.Isshare = true
this.video = false
},
// //
goReview() { goReview() {
uni.navigateTo({ uni.navigateTo({
@ -1080,12 +1085,34 @@
// Facebook // Facebook
facebookShare() { facebookShare() {
// 使 SDK // 使 SDK
FB.ui({ //FB.ui({
method: 'share', // method: 'share',
href: 'https://www.example.com/', // //href: 'https://www.example.com/', //
}, function(response){ // }, function(response){
console.log(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 // 1
Copylink() { Copylink() {
@ -1139,16 +1166,16 @@
return url return url
} }
}, },
mounted(){ // mounted(){
window.fbAsyncInit = function() { // window.fbAsyncInit = function() {
FB.init({ // FB.init({
appId: '884982142884404', // ID // appId: '884982142884404', // ID
autoLogAppEvents: true, // autoLogAppEvents: true,
xfbml: true, // xfbml: true,
version: 'v9.0' // version: 'v9.0'
}); // });
}; // };
}, // },
onLoad(e) { onLoad(e) {
let that = this; let that = this;
let s = 0; 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