Browse Source

新增登录

master
zhengshuiqi 3 years ago
parent
commit
ab92a77712
  1. 133
      App.vue
  2. 2
      api/request.js
  3. 6
      index.html
  4. 2
      main.js
  5. 70
      manifest.json
  6. 10042
      package-lock.json
  7. 4
      package.json
  8. 58
      pages/index/index.vue
  9. 80
      pages/login/facebookWebview.vue
  10. 338
      pages/login/index.vue
  11. 26
      pages/productDetails/index.vue
  12. 2
      pages/specialTitle/index.vue
  13. BIN
      static/img/AppleD.png
  14. BIN
      static/img/FacebookD.png
  15. BIN
      static/img/GoogleD.png
  16. BIN
      static/img/mini.png
  17. BIN
      unpackage/res/android/mipmap-hdpi/ic_launcher.png
  18. BIN
      unpackage/res/android/mipmap-ldpi/ic_launcher.png
  19. BIN
      unpackage/res/android/mipmap-mdpi/ic_launcher.png
  20. BIN
      unpackage/res/android/mipmap-xhdpi/ic_launcher.png
  21. BIN
      unpackage/res/android/mipmap-xxhdpi/ic_launcher.png
  22. BIN
      unpackage/res/android/mipmap-xxxhdpi/ic_launcher.png
  23. BIN
      unpackage/res/android/playstore-icon.png
  24. 122
      unpackage/res/ios/AppIcon.appiconset/Contents.json
  25. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-1024.png
  26. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-20-ipad.png
  27. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-20@2x-ipad.png
  28. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-20@2x.png
  29. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-20@3x.png
  30. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-29-ipad.png
  31. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-29.png
  32. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-29@2x-ipad.png
  33. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-29@2x.png
  34. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-29@3x.png
  35. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-40.png
  36. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-40@2x.png
  37. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-40@3x.png
  38. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-60@2x.png
  39. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-60@3x.png
  40. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-76.png
  41. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-76@2x.png
  42. BIN
      unpackage/res/ios/AppIcon.appiconset/icon-83.5@2x.png
  43. 1006
      utils/apple.js
  44. 90
      utils/facebook.js
  45. 88
      utils/facebookShare.js
  46. 2736
      utils/platform.js

133
App.vue

@ -15,63 +15,96 @@
}
},
onLaunch: function() {
// //#ifdef APP-PLUS
// jpushModule.setLoggerEnable(true);
// jpushModule.initJPushService()
// jpushModule.addConnectEventListener(result=>{
// let connectEnable = result.connectEnable
// console.log("jpush", connectEnable)
// })
// jpushModule.addNotificationListener(result=>{
// let notificationEventType = result.notificationEventType
// let messageID = result.messageID
// let title = result.title
// let content = result.content
// let extras = result.extras
// console.log("", result)
// })
// jpushModule.getRegistrationID(result => {
// console.log("ID", result.registerID)
// if(result.registerID){
// uni.setStorageSync("register_id", result.registerID)
// }
// })
// jpushModule.addCustomMessageListener(result=>{
// let messageID = result.messageID
// let content = result.content
// let extras = result.extras
// console.log("", result)
// })
// //#endif
uni.hideTabBar()
setTimeout(() => {
}, 2400);
//#ifdef APP-PLUS
jpushModule.setLoggerEnable(true);
jpushModule.initJPushService()
jpushModule.addConnectEventListener(result => {
let connectEnable = result.connectEnable
console.log("jpush连接", connectEnable)
})
// //#ifdef APP-PLUS
// jpushModule.setLoggerEnable(true);
// jpushModule.initJPushService()
// jpushModule.addConnectEventListener(result => {
// let connectEnable = result.connectEnable
// console.log("jpush", connectEnable)
// })
//
jpushModule.setAlias({
'alias': uni.getStorageSync('userId'),
'sequence': 1
})
//
jpushModule.addTagAliasListener(result => {
let code = result.code
let sequence = result.sequence
let tags = result.tags
let tag = result.tag
let tagEnable = result.tagEnable
let alias = result.alias
console.log(alias, '别名')
})
//
jpushModule.addNotificationListener(result => {
let notificationEventType = result.notificationEventType
let messageID = result.messageID
let title = result.title
let content = result.content
let extras = result.extras
console.log("通知", result)
//
if (notificationEventType == 'notificationOpened') {
uni.navigateTo({
url: ''
})
}
})
jpushModule.getRegistrationID(result => {
console.log("注册ID", result.registerID)
if (result.registerID) {
uni.setStorageSync("register_id", result.registerID)
}
})
jpushModule.addCustomMessageListener(result => {
let messageID = result.messageID
let content = result.content
let extras = result.extras
console.log("自定义消息", result)
})
//#endif
// //
// jpushModule.setAlias({
// 'alias': uni.getStorageSync('userId'),
// 'sequence': 1
// })
// //
// jpushModule.addTagAliasListener(result => {
// let code = result.code
// let sequence = result.sequence
// let tags = result.tags
// let tag = result.tag
// let tagEnable = result.tagEnable
// let alias = result.alias
// console.log(alias, '')
// })
// //
// jpushModule.addNotificationListener(result => {
// let notificationEventType = result.notificationEventType
// let messageID = result.messageID
// let title = result.title
// let content = result.content
// let extras = result.extras
// console.log("", result)
// //
// if (notificationEventType == 'notificationOpened') {
// uni.navigateTo({
// url: ''
// })
// }
// })
// jpushModule.getRegistrationID(result => {
// console.log("ID", result.registerID)
// if (result.registerID) {
// uni.setStorageSync("register_id", result.registerID)
// }
// })
// jpushModule.addCustomMessageListener(result => {
// let messageID = result.messageID
// let content = result.content
// let extras = result.extras
// console.log("", result)
// })
// //#endif
},

2
api/request.js

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

6
index.html

@ -12,9 +12,15 @@
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<!-- <script async defer src="https://apis.google.com/js/platform.js" ></script>
<script async defer src="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js"></script>
<script async defer src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v9.0"></script> -->
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
</body>
</html>

2
main.js

@ -4,10 +4,10 @@ import ios from '@/ios/index.js'
import lib from "./common/lib.js"
// #ifndef VUE3
import Vue from 'vue'
// Vue.prototype.$onLaunched = new Promise(resolve => {
// Vue.prototype.$isResolve = resolve
// })
Vue.config.productionTip = false
// Vue.prototype.lib=lib
App.mpType = 'app'

70
manifest.json

@ -9,8 +9,8 @@
// "targetSdkVersion" : 31,
"channel_list" : [
{
"id" : "DOPEGOOGLE",
"name" : "DOPEGOOGLE"
"id" : "DOPEFACEBOOK",
"name" : "DOPEFACEBOOK"
}
],
/* 5+App */
@ -42,9 +42,9 @@
"modules" : {
"Payment" : {},
"VideoPlayer" : {},
"Contacts" : {},
"Speech" : {},
"iBeacon" : {},
"OAuth" : {},
"Messaging" : {}
},
/* */
@ -59,17 +59,14 @@
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.READ_SMS\"/>",
"<uses-permission android:name=\"android.permission.SEND_SMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SMS\"/>",
@ -95,7 +92,16 @@
}
},
"push" : {},
"speech" : {}
"speech" : {},
"oauth" : {
"google" : {
"clientid" : "dopeplus"
},
"apple" : {},
"facebook" : {
"appid" : "884982142884404"
}
}
},
"splashscreen" : {
"androidStyle" : "default",
@ -142,33 +148,33 @@
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
"hdpi" : "unpackage/res/android/mipmap-hdpi/ic_launcher.png",
"xhdpi" : "unpackage/res/android/mipmap-xhdpi/ic_launcher.png",
"xxhdpi" : "unpackage/res/android/mipmap-xxhdpi/ic_launcher.png",
"xxxhdpi" : "unpackage/res/android/mipmap-xxxhdpi/ic_launcher.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"appstore" : "unpackage/res/android/playstore-icon.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
"app" : "unpackage/res/ios/AppIcon.appiconset/icon-76.png",
"app@2x" : "unpackage/res/ios/AppIcon.appiconset/icon-76@2x.png",
"notification" : "unpackage/res/ios/AppIcon.appiconset/icon-20-ipad.png",
"notification@2x" : "unpackage/res/ios/AppIcon.appiconset/icon-40.png",
"proapp@2x" : "unpackage/res/ios/AppIcon.appiconset/icon-83.5@2x.png",
"settings" : "unpackage/res/ios/AppIcon.appiconset/icon-29-ipad.png",
"settings@2x" : "unpackage/res/ios/AppIcon.appiconset/icon-29@2x-ipad.png",
"spotlight" : "unpackage/res/ios/AppIcon.appiconset/icon-20@2x.png",
"spotlight@2x" : "unpackage/res/ios/AppIcon.appiconset/icon-40@2x.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
"app@2x" : "unpackage/res/ios/AppIcon.appiconset/icon-60@2x.png",
"app@3x" : "unpackage/res/ios/AppIcon.appiconset/icon-60@3x.png",
"notification@2x" : "unpackage/res/ios/AppIcon.appiconset/icon-20@2x-ipad.png",
"notification@3x" : "unpackage/res/ios/AppIcon.appiconset/icon-20@3x.png",
"settings@2x" : "unpackage/res/ios/AppIcon.appiconset/icon-29@2x.png",
"settings@3x" : "unpackage/res/ios/AppIcon.appiconset/icon-29@3x.png",
"spotlight@2x" : "unpackage/res/ios/AppIcon.appiconset/icon-40@2x.png",
"spotlight@3x" : "unpackage/res/ios/AppIcon.appiconset/icon-60@2x.png"
}
}
}
@ -186,6 +192,7 @@
// "platforms" : "Android,iOS",
// "url" : "",
// "android_package_name" : "com.lilbeat.dopeplus",
// // uni.UNIB8B0F18
// "ios_bundle_id" : "com.lilbeat.dopeplus",
// "isCloud" : false,
// "bought" : -1,
@ -326,7 +333,10 @@
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2"
"vueVersion" : "2",
"h5" : {
"template" : ""
}
}
// "nativePlugins" : {
// "JG-JCore" : {

10042
package-lock.json

File diff suppressed because it is too large

4
package.json

@ -2,7 +2,9 @@
"dependencies": {
"base-64": "^1.0.0",
"crypto-js": "^4.1.1",
"facebook-sdk": "^0.3.3",
"facebook-js-sdk": "^0.3.4",
"googleapis": "^27.0.0",
"jpush-sdk": "^3.5.0",
"vuex": "^4.0.2"
}
}

58
pages/index/index.vue

@ -12,6 +12,13 @@
export default {
data() {
return {
dotsStyles:{
backgroundColor: '#787474',
border: '1px #787474 solid',
color: '##787474',
selectedBackgroundColor: '#fff',
selectedBorder: '1px #fff solid'
},
// interval: null,
// frameIndex: 0,
// frames: [],
@ -126,7 +133,7 @@
url: '../category/index'
},
{
src: '../../static/img/min.png',
src: '../../static/img/mini.png',
url: '../index/index2',
name: ''
},
@ -216,7 +223,7 @@
// let time = setInterval(() => {
uni.getNetworkType({
success: (res) => {
console.log(res.networkType, s);
// console.log(res.networkType, s);
if (res.networkType == 'none') {
uni.showToast({
icon: 'none',
@ -519,9 +526,11 @@
pagecode: 'HOMEPOPUPADS'
}
defaultRequest(data2).then(res => {
////console.log('2',res)
console.log('2',res)
if (res.error == 0 && res.data.zones) {
res.data.zones.map(item => {
console.log(item);
console.log('=====================');
if (item.zone_code == 'HOMEPOPUP') {
this.popImg = item.zone_icon
this.popUrl = item.zone_more_link
@ -684,22 +693,22 @@
}
}
if (item.zone_code == 'LIST1') {
// console.log(item.zone_more_link)
console.log(item);
console.log(item.zone_more_link)
console.log('==============');
const i = item.zone_more_link.indexOf('gid=')
// console.log(i)
const ids = item.zone_more_link.substring(i + 4, item
.zone_more_link
.length)
const ids = item.zone_more_link.substring(i + 4, item.zone_more_link.length)
// console.log(ids)
// this.bestlist.push(item.blocks)
// //////console.log(this.bestlist,'')
// console.log(this.bestlist,'')
this.isbest = 1
this.catQuery.gid = ''
this.catQuery.gid = ids
this.getCatList()
item.blocks.map(item1 => {
console.log(item1);
this.bestlist.push(item1)
})
console.log(this.bestlist, '精品')
}
@ -1167,7 +1176,7 @@
if (res.error == 0) {
if (res.data) {
res.data.map(item => {
console.log(item.goods_video)
// console.log(item.goods_video)
this.bestlist.push({
goods_video: item.goods_video,
block_pic: item.goods_img,
@ -1287,9 +1296,9 @@
// //
imgTo(item) {
console.log(item,'item')
////console.log(item.block_link.includes('dope.youhui'))
// console.log(item.block_link.includes('dope.adspecial'))
let goodid
console.log(goodid);
if (item.goodid) {
uni.navigateTo({
url: '../productDetails/index?goodid=' + item.goodid
@ -1310,7 +1319,11 @@
uni.navigateTo({
url: './pickUpCentre'
})
}
} else if (item.block_link.includes('dope.adspecial')) {
uni.navigateTo({
url: '../specialTitle/index' + goodid
})
}
}
this.countdownTime2 = 0
},
@ -1414,7 +1427,7 @@
</view>
<!-- 宫格 -->
<uni-swiper-dot :info="info" :current="current" field="content" mode="default"
<uni-swiper-dot :info="info" :current="current" field="content" mode="default" :dots-styles="dotsStyles"
v-if="item.zone_code=='ICON' && item.zone_status=='NORMAL' && item.zone_code!=indexDate.zones[index-1].zone_code">
<swiper class="grid_swiper " :style="{height:(len > 4?380+'rpx':190+'rpx')}" @change="gridSwiper">
<swiper-item v-for="(item1,index1) in info" :key="item1.zone_id">
@ -1461,7 +1474,7 @@
<image :src="item.blocks[0].block_pic" style="width: 92%;display: flex;justify-content: center;align-items: center;margin: 0 auto;object-fit: cover;"
:style="{height:(item.zone_code=='HOMEAD')?item.zone_column+'rpx':''}" mode=""
@click="registers"></image>
<image style="position: absolute;width: 20px;height: 20px;top: 7px;right: 20px;" mode=" " @click="Register" src="../../static/img/close2.png"></image>
<!-- <image style="position: absolute;width: 20px;height: 20px;top: 7px;right: 20px;" mode=" " @click="Register" src="../../static/img/close2.png"></image> -->
</view>
</view>
</view>
@ -2069,6 +2082,15 @@
padding-left: 5.67rpx;
padding-right: 5.67rpx;
// padding-top: 90rpx;
/deep/ uni-swiper .uni-swiper-dot-active {
background-color: #787474 !important;
}
/deep/ uni-swiper .uni-swiper-dot {
background: rgb(66,66,66);
}
// /deep/ uni-swiper .uni-swiper-dot {
// background: rgb(66 66 66);
// }
}
.video_play {
@ -2151,7 +2173,8 @@
// padding-top: 10rpx;
// margin: 20rpx 0 !important;
// position: fixed;
padding-top: 8px;
padding-top: 4px;
// padding-top: 8px;
padding-bottom: 0px;
// padding-top: 15px;
// padding-bottom: 10rpx;
@ -2178,7 +2201,8 @@
// background-color: #000;
// }
view {
margin-left: 46.67rpx;
margin-left: 12.5px;
// margin-left: 46.67rpx;
display: inline-block;
font-weight: 600;
padding: 12.67rpx 0;

80
pages/login/facebookWebview.vue

@ -0,0 +1,80 @@
<template>
<view>
<web-view :webview-styles="webviewStyles" :src="src"></web-view>
</view>
</template>
<script>
import facebook from '@/utils/facebook.js'
export default {
data() {
return {
webviewStyles: {
progress: {
color: '#FF3333'
}
},
src:''
}
},
mounted() {
// Facebook SDK
window.fbAsyncInit = function() {
console.log("初始化 Facebook SDK");
console.log(f);
FB.init({
appId: '884982142884404',
// 21026908a4829cc8f4dceffbddd01c2e 1179110879655260
autoLogAppEvents: true,
xfbml: true,
version: 'v9.0',
});
};
},
onLoad(e) {
let that = this;
let s = 0;
let time = setInterval(() => {
uni.getNetworkType({
success: (res) => {
console.log(res.networkType, s);
if (res.networkType == 'none') {
uni.showToast({
icon: 'none',
title: 'Please connect to the network',
duration: 3000,
})
} else if (res.networkType !== 'none') {
that.typee = 2;
clearInterval(time);
}
}
})
s++;
}, 1000);
this.src = e.src
},
methods:{
FB.login(function(response) {
if (response.authResponse) {
//
console.log(response);
//
} else {
//
uni.showToast({
title:'User cancelled login or did not fully authorize.',
icon:'none',
duration: 2000
})
console.log('User cancelled login or did not fully authorize.');
}
}, { scope: 'public_profile,email' });
}
}
</script>
<style>
</style>

338
pages/login/index.vue

@ -36,9 +36,11 @@
<view class="cellphone">
<view class="cellphone-box">
<view class="cellphone-minBox" v-if="cellphone == 2"> <image src="../../static/img/apple.png" mode=""></image></view>
<view class="cellphone-minBox"><image src="../../static/img/facebook.png" mode=""></image></view>
<view class="cellphone-minBox" v-if="cellphone == 1"> <image src="../../static/img/gugei.png" mode=""></image></view>
<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" @click="google()"> <image src="../../static/img/GoogleD.png" mode=""></image></view>
<!-- v-if="cellphone == 1" -->
</view>
</view>
@ -84,13 +86,41 @@
</view>
</view>
</template>
<!-- 谷歌 Google SDK -->
<!-- <script src="https://apis.google.com/js/platform.js"></script> -->
<!-- Apple 苹果 SDK -->
<!-- <script src="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js"></script> -->
<!-- 脸书 Facebook SDK -->
<!-- <script src="https://connect.facebook.net/en_US/sdk.js"></script> -->
<script>
// import platform from '@/utils/platform.js'
// import facebook from '@/utils/facebook.js'
// uni.require('@/utils/facebook.js')
// import apple from '@/utils/apple.js'
import {
defaultRequest1,
defaultRequest
} from '../../api/index.js'
// var f = window.console;
const app = getApp()
const jpushModule = uni.requireNativePlugin('JG-JPush')
// const f = uni.getRealWindow()
var f = getCurrentPages();
// facebook
// var facebook = uni.createSelectorQuery('script');
// facebook.src = "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v9.0";
// uni.createSelectorQuery.head.appendChild(facebook);
// google
// var google = document.createElement('script');
// google.src = "https://apis.google.com/js/platform.js";
// document.head.appendChild(google);
// apple
// var apple = document.createElement('script');
// apple.src = "https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js";
// document.head.appendChild(apple);
export default {
data() {
return {
@ -142,6 +172,37 @@
// }, 1000);
// return true;
// },
// mounted(){
// // Facebook SDK
// window.fbAsyncInit = function() {
// console.log(" Facebook SDK");
// console.log(f);
// FB.init({
// appId: '884982142884404',
// // 21026908a4829cc8f4dceffbddd01c2e 1179110879655260
// autoLogAppEvents: true,
// xfbml: true,
// version: 'v9.0',
// });
// };
// //
// // gapi.load('auth2', () => {
// // console.log('gapi====================');
// // gapi.auth2.init({
// // client_id: 'dopeplus',
// // scope: 'profile email'
// // });
// // });
// //
// // const clientId = "6443599835";
// // const redirectURI = "https://www.example.com/callback";
// // AppleID.auth.init({
// // clientId : clientId,
// // scope : 'name email',
// // redirectURI : "redirectURI",
// // state : 'random_string'
// // });
// },
methods: {
seePwd() {
@ -192,13 +253,267 @@
if (src !== item.blocks[0].block_pic) {
this.bg = item.blocks[0].block_pic
}
console.log(this.bg)
// console.log(this.bg)
}
})
})
}, 200)
},
//
apple(){
var appleOauth = null;
plus.oauth.getServices(function(services) {
for (var i in services) {
var service = services[i];
// id 'apple' iOS13 service
if (service.id == 'apple') {
appleOauth = service;
break;
}
}
appleOauth.login( function(oauth){
console.log(oauth);
// oauth.target.appleInfo
let data = {
_action: 'loginbyapple',
ap_user_id: oauth.target.appleInfo.user,
ap_user_name: oauth.target.appleInfo.familyName+oauth.target.appleInfo.giveName,
ap_user_first_name: oauth.target.appleInfo.familyName,
ap_user_middle_name: oauth.target.appleInfo.givenName,
ap_user_last_name: oauth.target.appleInfo.familyName,
ap_user_email: oauth.target.appleInfo.email
}
defaultRequest(data).then(res => {
console.info(res)
if (res.error == 0) {
uni.navigateBack({
delta: 1
});
uni.showToast({
title:'Login is successful, please reopen the App to load information',
icon:'none',
duration: 2000
})
}
})
}, function(err) {
console.log(err);
// error
uni.showToast({
title:'Authorization failure',
icon:'none',
duration: 2000
})
}, {
// scope: 'email'
scope: 'email'
})
}, function(err) {
console.log(err);
// services
})
// AppleID.auth.signIn();
},
//
facebook(){
// var facebookOauth = null;
// plus.oauth.getServices(function(services) {
// for (var i in services) {
// var service = services[i];
// //
// if (service.id == 'facebook') {
// facebookOauth = service;
// break;
// }
// }
// facebookOauth.login( function(oauth){
// console.log(oauth);
// console.log(facebookOauth);
// console.log(facebookOauth.authResult);
// // facebookOauth.authResult
// let data = {
// _action: 'loginbyfacebook',
// fb_user_id: facebookOauth.authResult.openid,
// fb_user_name: '',
// fb_user_first_name: '',
// fb_user_middle_name: '',
// fb_user_last_name: '',
// fb_user_email: ''
// }
// defaultRequest(data).then(res => {
// console.info(res)
// if (res.error == 0) {
// uni.navigateBack({
// delta: 1
// });
// uni.showLoading({
// title: '',
// icon: 'none',
// duration: 2000
// })
// }
// })
// }, function(err) {
// console.log(err);
// uni.showLoading({
// title: '',
// icon: 'none',
// duration: 2000
// })
// //
// // err.code
// })
// }, function(err) {
// console.log(err);
// // services
// })
uni.login({
provider: 'facebook',
success: function (loginRes) {
//
uni.getUserInfo({
provider: 'facebook',
success: function(info) {
console.log(info);
// , info.authResult
let data = {
_action: 'loginbyfacebook',
fb_user_id: info.userInfo.openid,
fb_user_name: info.userInfo.nickName,
fb_user_first_name: '',
fb_user_middle_name: '',
fb_user_last_name: '',
fb_user_email: info.userInfo.email
}
defaultRequest(data).then(res => {
console.info(res)
if (res.error == 0) {
uni.navigateBack({
delta: 1
});
uni.showLoading({
title: '脸书用户登录成功',
icon: 'none',
duration: 2000
})
}
})
}
})
},
fail: function (err) {
console.log(err);
//
// err.code
uni.showLoading({
title: '脸书用户授权失败',
icon: 'none',
duration: 2000
})
}
});
},
//
google(){
// var googleOauth = null;
// plus.oauth.getServices(function(services) {
// for (var i in services) {
// var service = services[i];
// //
// if (service.id == 'google') {
// googleOauth = service;
// break;
// }
// }
// googleOauth.login( function(oauth){
// // googleOauth.authResult
// console.log(googleOauth.authResult);
// let data = {
// _action: 'loginbygoogle',
// fb_user_id: googleOauth.authResult.openid,
// fb_user_name: '',
// fb_user_first_name: '',
// fb_user_middle_name: '',
// fb_user_last_name: '',
// fb_user_email: googleOauth.authResult.email
// }
// defaultRequest(data).then(res => {
// console.info(res)
// if (res.error == 0) {
// uni.navigateBack({
// delta: 1
// });
// uni.showLoading({
// title: '',
// icon: 'none',
// duration: 2000
// })
// }
// })
// }, function(err) {
// console.log(err);
// uni.showLoading({
// title: '',
// icon: 'none',
// duration: 2000
// })
// //
// // err.code
// })
// }, function(err) {
// console.log(err);
// // services
// })
uni.login({
provider: 'google',
success: function (loginRes) {
//
uni.getUserInfo({
provider: 'google',
success: function(info) {
// , info.authResult
console.log(info);
let data = {
_action: 'loginbygoogle',
fb_user_id: info.authResult.openid,
fb_user_name: '',
fb_user_first_name: '',
fb_user_middle_name: '',
fb_user_last_name: '',
fb_user_email: info.authResult.email
}
defaultRequest(data).then(res => {
console.info(res)
if (res.error == 0) {
uni.navigateBack({
delta: 1
});
uni.showLoading({
title: '谷歌用户登录成功',
icon: 'none',
duration: 2000
})
}
})
}
})
},
fail: function (err) {
console.log(err);
uni.showLoading({
title: '谷歌用户授权失败',
icon: 'none',
duration: 2000
})
//
// err.code
}
});
},
//
login() {
// if(!this.loginSelect){
@ -208,7 +523,6 @@
// }
uni.showLoading({
title: 'Logining',
})
console.log(this.loginDate)
defaultRequest1(this.loginDate).then(res => {
@ -334,7 +648,6 @@
})
} else {
var urlStr = encodeURI("https://en.meixx.com/help/privacy.html")
// plus.runtime.openURL(urlStr);
uni.navigateTo({
url: '../order/paypalWebview?src=' + urlStr
@ -355,7 +668,18 @@
}
}
},
// onShow() {
// this.apple();
// this.facebook();
// this.google();
// },
onLoad() {
// FB.init({
// appId: 1179110879655260,//id
// cookie: true,
// xfbml: true,
// version: 'v14.0'
// });
//
let that = this;
let s = 0;

26
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">
<view class="icon_item" @click="facebookShare()">
<image src="../../static/img/facebook1.png" mode=""></image>
<view>Facebook</view>
</view>
@ -461,6 +461,10 @@
</template>
<script>
// var apple = document.createElement('script');
// apple.src = "https://connect.facebook.net/en_US/sdk.js?hash=c7b4d3b5237e274cabe2a52309d2217d#xfbml=1&version=v9.0";
// document.head.appendChild(apple);
// import facebookShare from '@/utils/facebookShare.js'
import {
defaultRequest,
defaultRequest2,
@ -1073,6 +1077,16 @@
uni.navigateBack()
}
},
// Facebook
facebookShare() {
// 使 SDK
FB.ui({
method: 'share',
href: 'https://www.example.com/', //
}, function(response){
console.log(response);
});
},
// 1
Copylink() {
uni.setClipboardData({
@ -1125,6 +1139,16 @@
return url
}
},
mounted(){
window.fbAsyncInit = function() {
FB.init({
appId: '884982142884404', // ID
autoLogAppEvents: true,
xfbml: true,
version: 'v9.0'
});
};
},
onLoad(e) {
let that = this;
let s = 0;

2
pages/specialTitle/index.vue

@ -139,7 +139,7 @@
})
},
imgTo(item) {
// console.log(item.blocks[0].block_link);
console.log(item.block_link);
console.log(item, 'item数据?')

BIN
static/img/AppleD.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
static/img/FacebookD.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
static/img/GoogleD.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
static/img/mini.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
unpackage/res/android/mipmap-hdpi/ic_launcher.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
unpackage/res/android/mipmap-ldpi/ic_launcher.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
unpackage/res/android/mipmap-mdpi/ic_launcher.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
unpackage/res/android/mipmap-xhdpi/ic_launcher.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
unpackage/res/android/mipmap-xxhdpi/ic_launcher.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
unpackage/res/android/mipmap-xxxhdpi/ic_launcher.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
unpackage/res/android/playstore-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

122
unpackage/res/ios/AppIcon.appiconset/Contents.json

@ -0,0 +1,122 @@
{
"images": [
{
"size": "20x20",
"idiom": "iphone",
"filename": "icon-20@2x.png",
"scale": "2x"
},
{
"size": "20x20",
"idiom": "iphone",
"filename": "icon-20@3x.png",
"scale": "3x"
},
{
"size": "29x29",
"idiom": "iphone",
"filename": "icon-29.png",
"scale": "1x"
},
{
"size": "29x29",
"idiom": "iphone",
"filename": "icon-29@2x.png",
"scale": "2x"
},
{
"size": "29x29",
"idiom": "iphone",
"filename": "icon-29@3x.png",
"scale": "3x"
},
{
"size": "40x40",
"idiom": "iphone",
"filename": "icon-40@2x.png",
"scale": "2x"
},
{
"size": "40x40",
"idiom": "iphone",
"filename": "icon-40@3x.png",
"scale": "3x"
},
{
"size": "60x60",
"idiom": "iphone",
"filename": "icon-60@2x.png",
"scale": "2x"
},
{
"size": "60x60",
"idiom": "iphone",
"filename": "icon-60@3x.png",
"scale": "3x"
},
{
"size": "20x20",
"idiom": "ipad",
"filename": "icon-20-ipad.png",
"scale": "1x"
},
{
"size": "20x20",
"idiom": "ipad",
"filename": "icon-20@2x-ipad.png",
"scale": "2x"
},
{
"size": "29x29",
"idiom": "ipad",
"filename": "icon-29-ipad.png",
"scale": "1x"
},
{
"size": "29x29",
"idiom": "ipad",
"filename": "icon-29@2x-ipad.png",
"scale": "2x"
},
{
"size": "40x40",
"idiom": "ipad",
"filename": "icon-40.png",
"scale": "1x"
},
{
"size": "40x40",
"idiom": "ipad",
"filename": "icon-40@2x.png",
"scale": "2x"
},
{
"size": "76x76",
"idiom": "ipad",
"filename": "icon-76.png",
"scale": "1x"
},
{
"size": "76x76",
"idiom": "ipad",
"filename": "icon-76@2x.png",
"scale": "2x"
},
{
"size": "83.5x83.5",
"idiom": "ipad",
"filename": "icon-83.5@2x.png",
"scale": "2x"
},
{
"size": "1024x1024",
"idiom": "ios-marketing",
"filename": "icon-1024.png",
"scale": "1x"
}
],
"info": {
"version": 1,
"author": "icon.wuruihong.com"
}
}

BIN
unpackage/res/ios/AppIcon.appiconset/icon-1024.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
unpackage/res/ios/AppIcon.appiconset/icon-20-ipad.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

BIN
unpackage/res/ios/AppIcon.appiconset/icon-20@2x-ipad.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
unpackage/res/ios/AppIcon.appiconset/icon-20@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
unpackage/res/ios/AppIcon.appiconset/icon-20@3x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
unpackage/res/ios/AppIcon.appiconset/icon-29-ipad.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

BIN
unpackage/res/ios/AppIcon.appiconset/icon-29.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

BIN
unpackage/res/ios/AppIcon.appiconset/icon-29@2x-ipad.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
unpackage/res/ios/AppIcon.appiconset/icon-29@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
unpackage/res/ios/AppIcon.appiconset/icon-29@3x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
unpackage/res/ios/AppIcon.appiconset/icon-40.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
unpackage/res/ios/AppIcon.appiconset/icon-40@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
unpackage/res/ios/AppIcon.appiconset/icon-40@3x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
unpackage/res/ios/AppIcon.appiconset/icon-60@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
unpackage/res/ios/AppIcon.appiconset/icon-60@3x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
unpackage/res/ios/AppIcon.appiconset/icon-76.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
unpackage/res/ios/AppIcon.appiconset/icon-76@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
unpackage/res/ios/AppIcon.appiconset/icon-83.5@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

1006
utils/apple.js

File diff suppressed because one or more lines are too long

90
utils/facebook.js

@ -0,0 +1,90 @@
/*1673591345,,JIT Construction: v1006815498,en_US*/
/**
* Copyright (c) 2017-present, Facebook, Inc. All rights reserved.
*
* You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
* copy, modify, and distribute this software in source code or binary form for use
* in connection with the web services and APIs provided by Facebook.
*
* As with any software that integrates with the Facebook platform, your use of
* this software is subject to the Facebook Platform Policy
* [http://developers.facebook.com/policy/]. This copyright notice shall be
* included in all copies or substantial portions of the software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
(function _(a, b, c, d, e) {
// let f = uni.getRealWindow()
var f = window.console;
f && Math.floor(new Date().getTime() / 1e3) - b > 7 * 24 * 60 * 60 && f.warn(
"The Facebook JSSDK is more than 7 days old.");
if (window[c]) return;
if (!window.JSON) return;
var g = window[c] = {
__buffer: {
replay: function() {
var a = this,
b = function(d) {
var b = window[c];
a.calls[d][0].split(".").forEach(function(a) {
return b = b[a]
});
b.apply(null, a.calls[d][1])
};
for (var d = 0; d < this.calls.length; d++) b(d);
this.calls = []
},
calls: [],
opts: null
},
getUserID: function() {
return ""
},
getAuthResponse: function() {
return null
},
getAccessToken: function() {
return null
},
init: function(a) {
g.__buffer.opts = a
}
};
for (b = 0; b < d.length; b++) {
f = d[b];
if (f in g) continue;
var h = f.split("."),
i = h.pop(),
j = g;
for (var k = 0; k < h.length; k++) j = j[h[k]] || (j[h[k]] = {});
j[i] = function(a) {
if (a === "init") return;
return function() {
g.__buffer.calls.push([a, Array.prototype.slice.call(arguments)])
}
}(f)
}
k = document.createElement("script");
k.src = a;
k.async = !0;
e && (k.crossOrigin = "anonymous");
h = document.getElementsByTagName("script")[0];
h.parentNode && h.parentNode.insertBefore(k, h)
})("https:\/\/connect.facebook.net\/en_US\/sdk.js?hash=9a3a1c29786b95e8ac4f1e0ff5db6b7f", 1673591345, "FB", [
"AppEvents.EventNames", "AppEvents.ParameterNames", "AppEvents.activateApp", "AppEvents.clearAppVersion",
"AppEvents.clearUserID", "AppEvents.getAppVersion", "AppEvents.getUserID", "AppEvents.logEvent",
"AppEvents.logPageView", "AppEvents.logPurchase", "AppEvents.setAppVersion", "AppEvents.setUserID",
"AppEvents.updateUserProperties", "Canvas.Plugin.showPluginElement", "Canvas.Plugin.hidePluginElement",
"Canvas.Prefetcher.addStaticResource", "Canvas.Prefetcher.setCollectionMode", "Canvas.getPageInfo",
"Canvas.scrollTo", "Canvas.setAutoGrow", "Canvas.setDoneLoading", "Canvas.setSize", "Canvas.setUrlHandler",
"Canvas.startTimer", "Canvas.stopTimer", "Event.subscribe", "Event.unsubscribe", "XFBML.parse", "addFriend",
"api", "getAccessToken", "getAuthResponse", "getLoginStatus", "getUserID", "init", "login", "logout", "publish",
"share", "ui"
], true);

88
utils/facebookShare.js

@ -0,0 +1,88 @@
/*1673411369,,JIT Construction: v1006804714,en_US*/
/**
* Copyright (c) 2017-present, Facebook, Inc. All rights reserved.
*
* You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
* copy, modify, and distribute this software in source code or binary form for use
* in connection with the web services and APIs provided by Facebook.
*
* As with any software that integrates with the Facebook platform, your use of
* this software is subject to the Facebook Platform Policy
* [http://developers.facebook.com/policy/]. This copyright notice shall be
* included in all copies or substantial portions of the software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
(function _(a, b, c, d, e) {
var f = window.console;
f && Math.floor(new Date().getTime() / 1e3) - b > 7 * 24 * 60 * 60 && f.warn(
"The Facebook JSSDK is more than 7 days old.");
if (window[c]) return;
if (!window.JSON) return;
var g = window[c] = {
__buffer: {
replay: function() {
var a = this,
b = function(d) {
var b = window[c];
a.calls[d][0].split(".").forEach(function(a) {
return b = b[a]
});
b.apply(null, a.calls[d][1])
};
for (var d = 0; d < this.calls.length; d++) b(d);
this.calls = []
},
calls: [],
opts: null
},
getUserID: function() {
return ""
},
getAuthResponse: function() {
return null
},
getAccessToken: function() {
return null
},
init: function(a) {
g.__buffer.opts = a
}
};
for (b = 0; b < d.length; b++) {
f = d[b];
if (f in g) continue;
var h = f.split("."),
i = h.pop(),
j = g;
for (var k = 0; k < h.length; k++) j = j[h[k]] || (j[h[k]] = {});
j[i] = function(a) {
if (a === "init") return;
return function() {
g.__buffer.calls.push([a, Array.prototype.slice.call(arguments)])
}
}(f)
}
k = document.createElement("script");
k.src = a;
k.async = !0;
e && (k.crossOrigin = "anonymous");
h = document.getElementsByTagName("script")[0];
h.parentNode && h.parentNode.insertBefore(k, h)
})("https:\/\/connect.facebook.net\/en_US\/sdk.js?hash=c7b4d3b5237e274cabe2a52309d2217d#xfbml=1&version=v9.0", 1673411369, "FB", [
"AppEvents.EventNames", "AppEvents.ParameterNames", "AppEvents.activateApp", "AppEvents.clearAppVersion",
"AppEvents.clearUserID", "AppEvents.getAppVersion", "AppEvents.getUserID", "AppEvents.logEvent",
"AppEvents.logPageView", "AppEvents.logPurchase", "AppEvents.setAppVersion", "AppEvents.setUserID",
"AppEvents.updateUserProperties", "Canvas.Plugin.showPluginElement", "Canvas.Plugin.hidePluginElement",
"Canvas.Prefetcher.addStaticResource", "Canvas.Prefetcher.setCollectionMode", "Canvas.getPageInfo",
"Canvas.scrollTo", "Canvas.setAutoGrow", "Canvas.setDoneLoading", "Canvas.setSize", "Canvas.setUrlHandler",
"Canvas.startTimer", "Canvas.stopTimer", "Event.subscribe", "Event.unsubscribe", "XFBML.parse", "addFriend",
"api", "getAccessToken", "getAuthResponse", "getLoginStatus", "getUserID", "init", "login", "logout", "publish",
"share", "ui"
], true);

2736
utils/platform.js

File diff suppressed because it is too large
Loading…
Cancel
Save