zhengshuiqi 3 years ago
parent
commit
e09ac1651f
  1. 2
      api/request.js
  2. 3
      main.js
  3. 8
      manifest.json
  4. 210
      package-lock.json
  5. 1
      package.json
  6. 7
      pages/account/deleteCount.vue
  7. 283
      pages/login/index.vue
  8. 46
      pages/productDetails/index.vue

2
api/request.js

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

3
main.js

@ -2,6 +2,7 @@ import App from './App'
import store from '@/store/store.js'
import ios from '@/ios/index.js'
import lib from "./common/lib.js"
// Vue.use(fb);
// #ifndef VUE3
import Vue from 'vue'
// Vue.prototype.$onLaunched = new Promise(resolve => {
@ -15,7 +16,7 @@ const app = new Vue({
...App,
store,
ios,
lib
lib,
})

8
manifest.json

@ -4,13 +4,13 @@
// "appid" : "__UNI__7D4CA0F",__UNI__9088064
"description" : "",
"versionName" : "1.5.0",
"versionCode" : 220,
"versionCode" : 230,
"transformPx" : false,
// "targetSdkVersion" : 31,
"channel_list" : [
{
"id" : "DOPEFACEBOOK",
"name" : "DOPEFACEBOOK"
"id" : "DOPEGOOGLE",
"name" : "DOPEGOOGLE"
}
],
/* 5+App */
@ -153,7 +153,7 @@
"xxxhdpi" : "unpackage/res/android/mipmap-xxxhdpi/ic_launcher.png"
},
"ios" : {
"appstore" : "unpackage/res/android/playstore-icon.png",
"appstore" : "unpackage/res/ios/AppIcon.appiconset/icon-1024.png",
"ipad" : {
"app" : "unpackage/res/ios/AppIcon.appiconset/icon-76.png",
"app@2x" : "unpackage/res/ios/AppIcon.appiconset/icon-76@2x.png",

210
package-lock.json

@ -23,6 +23,17 @@
"es6-promisify": "^5.0.0"
}
},
"ajv": {
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
@ -33,6 +44,11 @@
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
"integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA=="
},
"any-promise": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
"integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A=="
},
"asn1": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz",
@ -70,6 +86,15 @@
"is-buffer": "^2.0.2"
}
},
"babel-runtime": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
"integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==",
"requires": {
"core-js": "^2.4.0",
"regenerator-runtime": "^0.11.0"
}
},
"base-64": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz",
@ -135,6 +160,16 @@
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
},
"core-decorators": {
"version": "0.17.0",
"resolved": "https://registry.npmjs.org/core-decorators/-/core-decorators-0.17.0.tgz",
"integrity": "sha512-dBTL931yH4iZRlknHHkqtvPuGiDAEyTcudUnji3W0+mcNIHTrCmXvlqSyE743tzYtIeujLB00H9G/NdAmE3rPg=="
},
"core-js": {
"version": "2.6.12",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
"integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ=="
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
@ -254,6 +289,141 @@
}
}
},
"fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
},
"fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
},
"fb": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/fb/-/fb-2.0.0.tgz",
"integrity": "sha512-76kG876jub8OC2qaVxBcSHrvnMN/oOYUMeOSsZigSiI8F+QHnIZ5mGABYjpTHpnJmMlEB9Os0yaX+k+DoivvTw==",
"requires": {
"any-promise": "^1.3.0",
"babel-runtime": "^6.23.0",
"core-decorators": "^0.17.0",
"debug": "^2.6.3",
"request": "^2.81.0"
},
"dependencies": {
"assert-plus": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
"integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw=="
},
"aws-sign2": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
"integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA=="
},
"caseless": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
"integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw=="
},
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
}
},
"form-data": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
"integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
"mime-types": "^2.1.12"
}
},
"har-validator": {
"version": "5.1.5",
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz",
"integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==",
"requires": {
"ajv": "^6.12.3",
"har-schema": "^2.0.0"
}
},
"http-signature": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
"integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==",
"requires": {
"assert-plus": "^1.0.0",
"jsprim": "^1.2.2",
"sshpk": "^1.7.0"
}
},
"oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
},
"punycode": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
"integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA=="
},
"qs": {
"version": "6.5.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz",
"integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA=="
},
"request": {
"version": "2.88.2",
"resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
"integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==",
"requires": {
"aws-sign2": "~0.7.0",
"aws4": "^1.8.0",
"caseless": "~0.12.0",
"combined-stream": "~1.0.6",
"extend": "~3.0.2",
"forever-agent": "~0.6.1",
"form-data": "~2.3.2",
"har-validator": "~5.1.3",
"http-signature": "~1.2.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
"json-stringify-safe": "~5.0.1",
"mime-types": "~2.1.19",
"oauth-sign": "~0.9.0",
"performance-now": "^2.1.0",
"qs": "~6.5.2",
"safe-buffer": "^5.1.2",
"tough-cookie": "~2.5.0",
"tunnel-agent": "^0.6.0",
"uuid": "^3.3.2"
}
},
"tough-cookie": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
"integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==",
"requires": {
"psl": "^1.1.28",
"punycode": "^2.1.1"
}
},
"tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
"integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==",
"requires": {
"safe-buffer": "^5.0.1"
}
}
}
},
"follow-redirects": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
@ -410,6 +580,11 @@
}
}
},
"har-schema": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
"integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q=="
},
"har-validator": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz",
@ -548,6 +723,11 @@
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",
"integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA=="
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
},
"json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
@ -650,6 +830,11 @@
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz",
"integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ=="
},
"performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
"integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow=="
},
"pify": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
@ -673,6 +858,11 @@
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
"integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ=="
},
"psl": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz",
"integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag=="
},
"punycode": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
@ -686,6 +876,11 @@
"side-channel": "^1.0.4"
}
},
"regenerator-runtime": {
"version": "0.11.1",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
"integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg=="
},
"request": {
"version": "2.79.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz",
@ -822,6 +1017,21 @@
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
"integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA=="
},
"uri-js": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
"integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
"requires": {
"punycode": "^2.1.0"
},
"dependencies": {
"punycode": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
"integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA=="
}
}
},
"uuid": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",

1
package.json

@ -3,6 +3,7 @@
"base-64": "^1.0.0",
"crypto-js": "^4.1.1",
"facebook-js-sdk": "^0.3.4",
"fb": "^2.0.0",
"googleapis": "^27.0.0",
"jpush-sdk": "^3.5.0",
"vuex": "^4.0.2"

7
pages/account/deleteCount.vue

@ -76,6 +76,13 @@
cancelColor: '#39B54A',
success: (res) => {
if(res.confirm) {
uni.clearStorageSync()
uni.removeStorage({
key: 'key',
success: function (res) {
console.log('清理成功!');
}
})
console.log('comfirm') //
defaultRequest(this.delete).then(res =>{
if(res.error == 0){

283
pages/login/index.vue

@ -34,13 +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>
<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>
</view>
</view> -->
</view>
</view>
<view class="login" v-show="current==1">
<input type="text" class="login_input" placeholder="name" @input="verificationReg"
@ -65,13 +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>
<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>
</view>
</view> -->
</view>
</view>
<!-- <view class="mode">
@ -293,60 +293,63 @@
ap_user_last_name: oauth.target.appleInfo.familyName,
ap_user_email: oauth.target.appleInfo.email
}
uni.setStorageSync('isLogin', 1)
// 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)
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
})
}, 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
res.data.isLogin = true
setTimeout(() => {
uni.hideLoading()
uni.showToast({
title: 'Login successful',
icon: 'none',
duration: 2000
})
// 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: '加载中'
});
}, 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.showToast({
// title:'Login is successful, please reopen the App to load information',
// icon:'none',
// duration: 2000
})
// 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
});
// defaultRequest(data).then(res => {
// console.info(res)
// console.log('====================================');
@ -380,57 +383,6 @@
},
//
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) {
@ -439,30 +391,16 @@
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
}
uni.setStorageSync('isLogin', 1)
// 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) {
uni.showLoading({
title: 'Logining',
})
console.log(this.loginDate)
defaultRequest1(this.loginDate).then(res => {
console.log('sadasdsad');
defaultRequest(this.loginDate).then(res => {
app.globalData.error = res.error
console.log('======================', res.error)
console.log('sadasdsad');
if (res.error == 0) {
this.loginErr = false
res.data.isLogin = true
@ -505,13 +443,31 @@
uni.navigateBack({
delta: 1
});
uni.showLoading({
title: '脸书用户登录成功',
icon: 'none',
duration: 2000
// , 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)
// uni.showLoading({
// title: 'Logining',
// })
uni.showLoading({
title: '脸书用户登录成功',
icon: 'none',
duration: 2000
})
})
}
})
}
})
},
@ -547,6 +503,7 @@
googleOauth.login( function(oauth){
// googleOauth.authResult
console.log(googleOauth.authResult);
uni.setStorageSync('isLogin', 1)
let data = {
_action: 'loginbygoogle',
gg_user_id: googleOauth.authResult.openid,
@ -561,53 +518,57 @@
// uni.setStorageSync('user_info.data.nickname', 'googleOauth.authResult.nickName');
defaultRequest(data).then(res => {
console.info(res)
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
})
}, 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
this.loginErr = false
res.data.isLogin = true
setTimeout(() => {
uni.hideLoading()
uni.showToast({
title: 'Login successful',
icon: 'none',
duration: 2000
})
// 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);
}
}, 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.showLoading({
title: '谷歌用户登录成功',
icon: 'none',
duration: 2000
})
// 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
});
}, function(err) {
console.log(err);
uni.showLoading({

46
pages/productDetails/index.vue

@ -470,6 +470,7 @@
defaultRequest2,
defaultRequest4
} from '../../api/index.js'
const app = getApp()
export default {
data() {
@ -715,8 +716,21 @@
this.cartQuery.goods_attr_id = goods_attr_id.substring(0, goods_attr_id.lastIndexOf(','));
}
console.log(this.cartQuery)
// defaultRequest2(this.cartQuery).then(res => {
// if (res.error == 0) {
// let that = this
// that.isLogin = 1
// console.log(that.isLogin);
// console.log(this.isLogin);
// console.log('asasdjasdhaksjhdajkshdjkahsdkjahsdkjahsdkhakdjh');
// }
// })
console.log(this.isLogin == 0);
console.log(this.isLogin);
if (this.isLogin == 1) {
defaultRequest2(this.cartQuery).then(res => {
console.log(res.error);
if (res.error == 0) {
this.isCart = false
this.cartQuery.goods_attr_id = ''
@ -734,6 +748,8 @@
}
})
} else if (this.isLogin == 0) {
console.log(this.isLogin);
console.log('111111111111111');
uni.navigateTo({
url: '../login/index'
})
@ -1097,10 +1113,30 @@
// url: '../order/paypalWebview?src=' + urlStr
// })
// plus.runtime.openURL("urlStr")
// plus.runtime.openURL('https://www.dopeplus.com/facebookShare.html')
plus.runtime.openURL('https://www.dopeplus.com/facebookShare.html?utm_source=Facebook')
// console.log(id);
// fb.share({
// method: 'share',
// href: 'https://www.yourdomain.com',
// hashtag: '#yourdomain',
// quote: 'your message',
// }, function(response){
// console.log(response);
// });
// uni.share({
// provider: "facebook",
// type: 0,
// title: '',
// summary: this.shareText,
// imageUrl: '',
// href: this.sharePath,
// success: (res) => {
// console.log("success:" + JSON.stringify(res));
// },
// fail: (err) => {
// console.log("fail:" + JSON.stringify(err));
// }
// })
},
// 1
@ -1226,8 +1262,8 @@
onShow() {
this.getCartNum();
this.isLogin = uni.getStorageSync('isLogin')
let aaa = uni.getStorageSync('isLogin')
console.log('aaa',aaa)
// let aaa = uni.getStorageSync('isLogin')
// console.log('aaa',aaa)
},
//
onReachBottom() {

Loading…
Cancel
Save