zhengshuiqi 3 years ago
parent
commit
3f376487c8
  1. 2
      api/request.js
  2. 13
      manifest.json
  3. 6
      pages/account/index.vue
  4. 129
      pages/login/index.vue
  5. 21
      pages/productDetails/index.vue

2
api/request.js

@ -17,7 +17,7 @@ const httpRequest = (params) => {
const json_data = {
appcode: 'DOPE+', //应用编码
appchannel: 'DOPEFACEBOOK', //应用发布渠道
appver: '1.3.0', //应用版本
appver: '1.5.0', //应用版本
appname: 'cnic_buyer', //应用名称
manufacturer: 'HUAWEI', //设备生产商
phonebrand: 'HORNOR', //设备品牌

13
manifest.json

@ -3,8 +3,8 @@
"appid" : "__UNI__EA8CB08",
// "appid" : "__UNI__7D4CA0F",__UNI__9088064
"description" : "",
"versionName" : "1.3.0",
"versionCode" : 200,
"versionName" : "1.5.0",
"versionCode" : 220,
"transformPx" : false,
// "targetSdkVersion" : 31,
"channel_list" : [
@ -45,8 +45,7 @@
"Speech" : {},
"iBeacon" : {},
"OAuth" : {},
"Messaging" : {},
"Share" : {}
"Messaging" : {}
},
/* */
"distribute" : {
@ -92,9 +91,6 @@
"__platform__" : [ "ios", "android" ]
}
},
"push" : {
"unipush" : null
},
"speech" : {},
"oauth" : {
"google" : {
@ -104,8 +100,7 @@
"facebook" : {
"appid" : "884982142884404"
}
},
"share" : {}
}
},
"splashscreen" : {
"androidStyle" : "default",

6
pages/account/index.vue

@ -492,9 +492,9 @@
onShow() {
// this.getIndex()
// this.getCatList()
this.getUserInfo()
this.getImg()
this.getList()
// this.getImg()
// this.getUserInfo()
// this.getList()
uni.hideTabBar()
// uni.showTabBar()
this.isLogin = uni.getStorageSync('isLogin')

129
pages/login/index.vue

@ -34,16 +34,13 @@
</view>
</view> -->
<view class="cellphone">
<!-- <view class="cellphone">
<view class="cellphone-box">
<view class="cellphone-minBox" v-if="cellphone == 2" @click="apple()"> <image src="../../static/img/AppleD.png" mode=""></image></view>
<!-- v-if="cellphone == 2" -->
<view class="cellphone-minBox" @click="facebook()"><image src="../../static/img/FacebookD.png" mode=""></image></view>
<view class="cellphone-minBox" v-if="cellphone == 1" @click="google()"> <image src="../../static/img/GoogleD.png" mode=""></image></view>
<!-- v-if="cellphone == 1" -->
</view>
</view>
</view> -->
</view>
<view class="login" v-show="current==1">
<input type="text" class="login_input" placeholder="name" @input="verificationReg"
@ -68,15 +65,13 @@
</text> and <text class="text" @click="gotonewpage(2)"> privacy policy</text>.
</view>
</view>
<view class="cellphone" style="padding-top: 15px;">
<!-- <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">
@ -298,8 +293,8 @@
ap_user_last_name: oauth.target.appleInfo.familyName,
ap_user_email: oauth.target.appleInfo.email
}
uni.setStorageSync('user_info', {nickname: oauth.target.appleInfo.familyName})
uni.setStorageSync('user_info', {email: oauth.target.appleInfo.email})
// uni.setStorageSync('user_info', {nickname: oauth.target.appleInfo.familyName})
// uni.setStorageSync('user_info', {email: oauth.target.appleInfo.email})
defaultRequest(data).then(res => {
console.info(res)
if (res.error == 0) {
@ -339,11 +334,17 @@
this.errMsg = res.message
console.log(this.errMsg);
}
uni.showToast({
title:'Login is successful, please reopen the App to load information',
icon:'none',
duration: 2000
})
uni.showLoading({
title: '加载中'
});
uni.navigateBack({
delta: 1
});
// uni.showToast({
// title:'Login is successful, please reopen the App to load information',
// icon:'none',
// duration: 2000
// })
}
})
// defaultRequest(data).then(res => {
@ -448,59 +449,67 @@
fb_user_last_name: '',
fb_user_email: info.userInfo.email
}
uni.setStorageSync('user_info', {nickname: info.userInfo.nickName})
uni.setStorageSync('user_info', {email: info.userInfo.email})
// uni.setStorageSync('user_info', {nickname: info.userInfo.nickName})
// uni.setStorageSync('user_info', {email: info.userInfo.email})
// uni.setStorageSync('user_info', 'info.userInfo');
defaultRequest(data).then(res => {
console.info(res)
if (res.error == 0) {
this.loginErr = false
res.data.isLogin = true
uni.showLoading({
title: 'Logining',
})
console.log(this.loginDate)
defaultRequest1(this.loginDate).then(res => {
app.globalData.error = res.error
console.log('======================', res.error)
if (res.error == 0) {
this.loginErr = false
res.data.isLogin = true
setTimeout(() => {
uni.hideLoading()
uni.showToast({
title: 'Login successful',
icon: 'none',
duration: 2000
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
})
}, 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
// uni.switchTab({
// delta: 1
// url:'../index/index'
// })
} else {
this.loginErr = true
this.errMsg = res.message
console.log(this.errMsg);
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: '加载中'
});
})
uni.navigateBack({
delta: 1
});
// uni.showLoading({
// title: '',
// icon: 'none',
// duration: 2000
// })
uni.showLoading({
title: '脸书用户登录成功',
icon: 'none',
duration: 2000
})
}
})
}
@ -547,8 +556,8 @@
gg_user_last_name: '',
gg_user_email: googleOauth.authResult.email
}
uni.setStorageSync('user_info', {email: googleOauth.authResult.email})
uni.setStorageSync('user_info', {nickname: googleOauth.authResult.nickName})
// uni.setStorageSync('user_info', {email: googleOauth.authResult.email})
// uni.setStorageSync('user_info', {nickname: googleOauth.authResult.nickName})
// uni.setStorageSync('user_info.data.nickname', 'googleOauth.authResult.nickName');
defaultRequest(data).then(res => {
console.info(res)

21
pages/productDetails/index.vue

@ -437,7 +437,7 @@
<image src="../../static/img/close1.png" mode="" @click="Isshare=false"></image>
</view>
<view class="share_icon">
<view class="icon_item" @click="facebookShare()">
<view class="icon_item" @click="facebookShare(ID)">
<image src="../../static/img/facebook1.png" mode=""></image>
<view>Facebook</view>
</view>
@ -1083,7 +1083,7 @@
}
},
// Facebook
facebookShare() {
facebookShare(id) {
// 使 SDK
//FB.ui({
// method: 'share',
@ -1098,20 +1098,9 @@
// })
// 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)
// });
// }
// });
// console.log(id);
},
// 1

Loading…
Cancel
Save