提交 41b3f75d 编写于 作者: 小帅丶

:sparkles:面相功能增加。获取openid方法修改

上级 9fcdba08
......@@ -44,7 +44,8 @@
│ └── landmark //地标识别页面
│ └── quickcalculation //速算页面
│ └── redwine //红酒识别页面
│ └── skin //肤质分析页面
│ └── skin //肤质分析页面
│ └── physiognomy //面相分析
├── utils
│ └── api.js //全部的接口url在这里配置
│ └── util.js //暂时没用
......
//app.js
var api = require('/utils/api.js');
var oauthUrl = api.getOauthUrl();
var loginUrl = api.getLoginUrl();
App({
data:{
data: {
userInfo: {},
backUserInfo: {},//后台得到的微信用户信息
hasUserInfo: false,
......@@ -17,74 +17,26 @@ App({
wx.setStorageSync('logs', logs);
//1.静默操作获取用户信息 调用wx.login
var that = this;
// 登录
wx.login({
success: function (res) {
var code = res.code;//2.登录凭证code
if (null != code) {
wx.getUserInfo({
success: function (ress) {
console.log('res===' + ress);
//3.请求自己的服务器,解密用户信息
wx.request({
url: oauthUrl,
method: 'post',
header: {
'content-type': 'application/x-www-form-urlencoded'
},
data: { encryptedData: ress.encryptedData, iv: ress.iv, code: code },
success: function (res) {
that.globalData.userInfo = res.data
}, fail: function (res) {
var res = "";
that.globalData.backUserInfo = res;
}
})
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
wx.request({
url: loginUrl,
data: {
code: res.code
},
success: function (res) {
if (res.data.code == 200) {
that.data.openId = res.data.data.openid
}
})
}
},
})
}
})
if (that.globalData.userInfo) {
userInfo=app.globalData.userInfo,
hasUserInfo=true
} else if (this.data.canIUse) {
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
that.userInfoReadyCallback = res => {
that.globalData.userInfo = res.userInfo,
hasUserInfo = true
}
} else {
// 在没有 open-type=getUserInfo 版本的兼容处理
wx.getUserInfo({
success: res => {
that.globalData.userInfo = res.userInfo,
hasUserInfo=true
}
})
}
},
getUserInfo:function(cb){
var that = this
if(this.globalData.userInfo){
typeof cb == "function" && cb(this.globalData.userInfo)
}else{
//调用登录接口
wx.login({
success: function () {
wx.getUserInfo({
success: function (res) {
console.info("app.js===" + res.userInfo)
that.globalData.userInfo = res.userInfo
typeof cb == "function" && cb(that.globalData.userInfo)
}
})
}
})
}
},
globalData:{
userInfo:null,
backUserInfo:null
globalData: {
userInfo: null,
backUserInfo: null
}
})
\ No newline at end of file
......@@ -28,7 +28,8 @@
"pages/redwine/redwine",
"pages/landmark/landmark",
"pages/driverbehavior/driverbehavior",
"pages/quickcalculation/quickcalculation"
"pages/quickcalculation/quickcalculation",
"pages/physiognomy/physiognomy"
],
"window": {
"backgroundTextStyle": "light",
......@@ -73,5 +74,6 @@
"text": "神奇变脸"
}
]
}
},
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
......@@ -120,12 +120,9 @@ Page({
})
},
onLoad: function () {
var getAppWXUserInfo = app.globalData.userInfo;
var openIdKey = app.data.openId;
this.setData({
userInfo: getAppWXUserInfo,
hasUserInfo: true,
openId: getAppWXUserInfo.openId,
nickName: getAppWXUserInfo.nickName,
openId: openIdKey
})
}
});
\ No newline at end of file
......@@ -121,12 +121,9 @@ Page({
})
},
onLoad: function () {
var getAppWXUserInfo = app.globalData.userInfo;
var openIdKey = app.data.openId;
this.setData({
userInfo: getAppWXUserInfo,
hasUserInfo: true,
openId: getAppWXUserInfo.openId,
nickName: getAppWXUserInfo.nickName,
openId: openIdKey
})
}
});
\ No newline at end of file
......@@ -112,12 +112,9 @@ Page( {
})
},
onLoad: function () {
var getAppWXUserInfo = app.globalData.userInfo;
var openIdKey = app.data.openId;
this.setData({
userInfo: getAppWXUserInfo,
hasUserInfo: true,
openId: getAppWXUserInfo.openId,
nickName: getAppWXUserInfo.nickName,
openId: openIdKey
})
}
});
\ No newline at end of file
......@@ -124,12 +124,9 @@ Page({
})
},
onLoad: function () {
var getAppWXUserInfo = app.globalData.userInfo;
var openIdKey = app.data.openId;
this.setData({
userInfo: getAppWXUserInfo,
hasUserInfo: true,
openId: getAppWXUserInfo.openId,
nickName: getAppWXUserInfo.nickName,
openId: openIdKey
})
}
});
\ No newline at end of file
......@@ -17,32 +17,32 @@ Page({
nickName: "",
canIUse: wx.canIUse('button.open-type.getUserInfo'),
facecosmeticJP: [
{ "id": "1", "url": "https://yourself.com/facecosmetic/1.png", "text": "芭比粉" },
{ "id": "2", "url": "https://yourself.com/facecosmetic/2.png", "text": "清透" },
{ "id": "3", "url": "https://yourself.com/facecosmetic/3.png", "text": "烟灰" },
{ "id": "4", "url": "https://yourself.com/facecosmetic/4.png", "text": "自然" },
{ "id": "5", "url": "https://yourself.com/facecosmetic/5.png", "text": "樱花粉" },
{ "id": "6", "url": "https://yourself.com/facecosmetic/6.png", "text": "原宿红" }],
{ "id": "1", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/1.png", "text": "芭比粉" },
{ "id": "2", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/2.png", "text": "清透" },
{ "id": "3", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/3.png", "text": "烟灰" },
{ "id": "4", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/4.png", "text": "自然" },
{ "id": "5", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/5.png", "text": "樱花粉" },
{ "id": "6", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/6.png", "text": "原宿红" }],
facecosmeticKO: [
{ "id": "7", "url": "https://yourself.com/facecosmetic/7.png", "text": "闪亮" },
{ "id": "8", "url": "https://yourself.com/facecosmetic/8.png", "text": "粉紫" },
{ "id": "9", "url": "https://yourself.com/facecosmetic/9.png", "text": "粉嫩" },
{ "id": "10", "url": "https://yourself.com/facecosmetic/10.png", "text": "自然" },
{ "id": "11", "url": "https://yourself.com/facecosmetic/11.png", "text": "清透" },
{ "id": "12", "url": "https://yourself.com/facecosmetic/12.png", "text": "大地色" },
{ "id": "13", "url": "https://yourself.com/facecosmetic/13.png", "text": "玫瑰" }],
{ "id": "7", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/7.png", "text": "闪亮" },
{ "id": "8", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/8.png", "text": "粉紫" },
{ "id": "9", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/9.png", "text": "粉嫩" },
{ "id": "10", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/10.png", "text": "自然" },
{ "id": "11", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/11.png", "text": "清透" },
{ "id": "12", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/12.png", "text": "大地色" },
{ "id": "13", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/13.png", "text": "玫瑰" }],
facecosmeticNL: [
{ "id": "14", "url": "https://yourself.com/facecosmetic/14.png", "text": "自然" },
{ "id": "15", "url": "https://yourself.com/facecosmetic/15.png", "text": "清透" },
{ "id": "16", "url": "https://yourself.com/facecosmetic/16.png", "text": "桃粉" },
{ "id": "17", "url": "https://yourself.com/facecosmetic/17.png", "text": "橘粉" },
{ "id": "18", "url": "https://yourself.com/facecosmetic/18.png", "text": "春夏" },
{ "id": "19", "url": "https://yourself.com/facecosmetic/19.png", "text": "秋冬" }],
{ "id": "14", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/14.png", "text": "自然" },
{ "id": "15", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/15.png", "text": "清透" },
{ "id": "16", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/16.png", "text": "桃粉" },
{ "id": "17", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/17.png", "text": "橘粉" },
{ "id": "18", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/18.png", "text": "春夏" },
{ "id": "19", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/19.png", "text": "秋冬" }],
facecosmeticTH: [
{ "id": "20", "url": "https://yourself.com/facecosmetic/20.png", "text": "经典复古" },
{ "id": "21", "url": "https://yourself.com/facecosmetic/21.png", "text": "性感混血" },
{ "id": "22", "url": "https://yourself.com/facecosmetic/22.png", "text": "炫彩明眸" },
{ "id": "23", "url": "https://yourself.com/facecosmetic/23.png", "text": "紫色魅惑" }]
{ "id": "20", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/20.png", "text": "经典复古" },
{ "id": "21", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/21.png", "text": "性感混血" },
{ "id": "22", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/22.png", "text": "炫彩明眸" },
{ "id": "23", "url": "https://wximage-1251091977.cos.ap-beijing.myqcloud.com/facecosmetic/23.png", "text": "紫色魅惑" }]
},
onShareAppMessage: function () {
return {
......@@ -200,12 +200,9 @@ Page({
})
},
onLoad: function () {
var getAppWXUserInfo = app.globalData.userInfo;
var openIdKey = app.data.openId;
this.setData({
userInfo: getAppWXUserInfo,
hasUserInfo: true,
openId: getAppWXUserInfo.openId,
nickName: getAppWXUserInfo.nickName,
openId: openIdKey
})
},
/**
......
var app = getApp();
// pages/ninegrid/ninegrid.js
Page({
/**
* 页面的初始数据
*/
......@@ -36,6 +36,36 @@ Page({
// url: '../../pages/subject/subject',
// icon: '../../image/image_HL.png'
// },
{
id: '19',
name: '红酒识别',
url: '../../pages/redwine/redwine',
icon: '../../image/redwine.png'
},
{
id: '20',
name: '景区识别',
url: '../../pages/landmark/landmark',
icon: '../../image/landmark.png'
},
// {
// id: '21',
// name: '驾驶行为分析',
// url: '../../pages/driverbehavior/driverbehavior',
// icon: '../../image/driverbehavior.png'
// },
{
id: '23',
name: '面相分析',
url: '../../pages/physiognomy/physiognomy',
icon: '../../image/physiognomy.png'
},
{
id: '22',
name: '速算题目识别',
url: '../../pages/quickcalculation/quickcalculation',
icon: '../../image/quickcalculation.png'
},
{
id: '12',
name: '快乐相似脸',
......@@ -123,7 +153,6 @@ Page({
]
},
toPage: function (event) {
console.info(event.currentTarget.id);
var route = event.currentTarget.id;
if (route == 0) {
wx.navigateTo({
......@@ -195,6 +224,28 @@ Page({
wx.navigateTo({
url: '/pages/skin/skin',
})
} else if (route == 19){
wx.navigateTo({
url: '/pages/redwine/redwine',
})
} else if (route == 20) {
wx.navigateTo({
url: '/pages/landmark/landmark',
})
} else if (route == 21) {
wx.showModal({
title: '功能说明',
content: '功能待完善,即将开放',
showCancel: false,
})
} else if (route == 22) {
wx.navigateTo({
url: '/pages/quickcalculation/quickcalculation',
})
} else if(route==23){
wx.navigateTo({
url: '/pages/physiognomy/physiognomy',
})
}else {
wx.showModal({
title: '温馨提示',
......@@ -207,8 +258,7 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.info(options)
onLoad: function () {
},
/**
......
......@@ -288,12 +288,9 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function () {
var getAppWXUserInfo = app.globalData.userInfo;
var openIdKey = app.data.openId;
this.setData({
userInfo: getAppWXUserInfo,
hasUserInfo: true,
openId: getAppWXUserInfo.openId,
nickName: getAppWXUserInfo.nickName,
openId: openIdKey
})
}
})
\ No newline at end of file
var app = getApp();
var api = require('../../utils/api.js');
var physiognomyUrl = api.getPhysiognomyUrl();
Page({
data: {
motto: '面相分析',
images: {},
info: "",
icrName: "",
score: "",
userInfo: {},
backUserInfo: {},//后台得到的微信用户信息
hasUserInfo: false,
openId: "",
nickName: "",
canIUse: wx.canIUse('button.open-type.getUserInfo'),
baikeUrl: "",
imageUrl: "",
description: "",
remark: "",
physiognomy:null
},
onShareAppMessage: function () {
return {
title: '面相分析小程序',
path: '/pages/physiognomy/physiognomy',
success: function (res) {
if (res.errMsg == 'shareAppMessage:ok') {
wx.showToast({
title: '分享成功',
icon: 'success',
duration: 500
});
}
},
fail: function (res) {
if (res.errMsg == 'shareAppMessage:fail cancel') {
wx.showToast({
title: '分享取消',
icon: 'loading',
duration: 500
})
}
}
}
},
//事件处理函数
bindViewTap: function () {
wx.navigateTo({
url: '../logs/logs'
})
},
uploads: function () {
var that = this
wx.chooseImage({
count: 1, // 默认9
sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
//console.log( res )
that.setData({
img: res.tempFilePaths[0],
info: "",
icrName: "",
score: "",
baikeUrl: "",
imageUrl: "",
description: "",
physiognomy: null
}),
wx.showLoading({
title: "努力分析中...",
mask: true
}),
wx.uploadFile({
url: physiognomyUrl,
filePath: res.tempFilePaths[0],
header: {
'content-type': 'multipart/form-data'
},
name: 'file',
formData: {
'openId': that.data.openId
},
success: function (res) {
wx.hideLoading();
var data = res.data;
var str = JSON.parse(data);
if (str.recognitionResult.status == 0) {
that.setData({
physiognomy: str.recognitionResult
})
console.log(that.data.physiognomy.length)
} else if (str.recognitionResult.status == 1) {
that.setData({
info: "未检测到人脸"
})
} else if (str.recognitionResult.status == 2) {
that.setData({
info: "请上传单人照片"
})
} else if (str.recognitionResult.status == 3) {
that.setData({
info: "人脸不完整"
})
} else {
that.setData({
info: "Sorry 小程序远走高飞了",
})
}
},
fail: function (res) {
wx.hideLoading();
console.log(res);
that.setData({
info: '小程序离家出走了稍后再试',
})
}
})
}
})
},
onLoad: function () {
var openIdKey = app.data.openId;
this.setData({
openId: openIdKey
})
}
});
\ No newline at end of file
{
"navigationBarTitleText": "面相分析学"
}
\ No newline at end of file
<view class="container">
<view class="img_wrap">
<image src="{{ img }}" mode='aspectFit'/>
</view>
<button bindtap="uploads" class="up">拍照/选取图片识别</button>
<text class="user-probabilitys" wx:if="{{info}}">错误提示:{{info}}</text>
<view class='baikecard' wx:if="{{physiognomy}}">
<text style='font-size:40rpx;margin:14rpx 0rpx;color:#3a3a3a;font-weight:bold'>脸型:{{physiognomy.face.shape}}</text>
<text class='baikecontent' >{{physiognomy.face.paraphrase[0]}}</text>
<text class='baikecontent' >{{physiognomy.face.paraphrase[1]}}</text>
<text class='baikecontent'>{{physiognomy.face.paraphrase[2]}}</text>
<text class='baikecontent' >{{physiognomy.face.paraphrase[3]}}</text>
<text class='baikecontent' >{{physiognomy.face.paraphrase[4]}}</text>
<view class='baikeform'>
</view>
</view>
<view style="padding-top:20rpx;" wx:if="{{physiognomy}}"></view>
<view class='baikecard' wx:if="{{physiognomy}}">
<text style='font-size:40rpx;margin:14rpx 0rpx;color:#3a3a3a;font-weight:bold' >眉毛:{{physiognomy.brow.shape}}</text>
<text class='baikecontent' >{{physiognomy.brow.paraphrase[0]}}</text>
<text class='baikecontent' >{{physiognomy.brow.paraphrase[1]}}</text>
<text class='baikecontent' >{{physiognomy.brow.paraphrase[2]}}</text>
<text class='baikecontent' >{{physiognomy.brow.paraphrase[3]}}</text>
<text class='baikecontent' >{{physiognomy.brow.paraphrase[4]}}</text>
<view class='baikeform'>
</view>
</view>
<view style="padding-top:20rpx;" wx:if="{{physiognomy}}"></view>
<view class='baikecard' wx:if="{{physiognomy}}">
<text style='font-size:40rpx;margin:14rpx 0rpx;color:#3a3a3a;font-weight:bold' >眼睛:{{physiognomy.eye.shape}}</text>
<text class='baikecontent' >{{physiognomy.eye.paraphrase[0]}}</text>
<text class='baikecontent' >{{physiognomy.eye.paraphrase[1]}}</text>
<text class='baikecontent' >{{physiognomy.eye.paraphrase[2]}}</text>
<text class='baikecontent' >{{physiognomy.eye.paraphrase[3]}}</text>
<text class='baikecontent' >{{physiognomy.eye.paraphrase[4]}}</text>
<view class='baikeform'>
</view>
</view>
<view style="padding-top:20rpx;" wx:if="{{physiognomy}}"></view>
<view class='baikecard' wx:if="{{physiognomy}}">
<text style='font-size:40rpx;margin:14rpx 0rpx;color:#3a3a3a;font-weight:bold' >嘴巴:{{physiognomy.mouth.shape}}</text>
<text class='baikecontent' >{{physiognomy.mouth.paraphrase[0]}}</text>
<text class='baikecontent' >{{physiognomy.mouth.paraphrase[1]}}</text>
<text class='baikecontent' >{{physiognomy.mouth.paraphrase[2]}}</text>
<text class='baikecontent' >{{physiognomy.mouth.paraphrase[3]}}</text>
<text class='baikecontent' >{{physiognomy.mouth.paraphrase[4]}}</text>
<view class='baikeform'>
</view>
</view>
<view style="padding-top:20rpx;" wx:if="{{physiognomy}}"></view>
<view class='baikecard' wx:if="{{physiognomy}}">
<text style='font-size:40rpx;margin:14rpx 0rpx;color:#3a3a3a;font-weight:bold' >鼻子:{{physiognomy.nose.shape}}</text>
<text class='baikecontent' >{{physiognomy.nose.paraphrase[0]}}</text>
<text class='baikecontent' >{{physiognomy.nose.paraphrase[1]}}</text>
<text class='baikecontent' >{{physiognomy.nose.paraphrase[2]}}</text>
<text class='baikecontent' >{{physiognomy.nose.paraphrase[3]}}</text>
<text class='baikecontent' >{{physiognomy.nose.paraphrase[4]}}</text>
<view class='baikeform'>
</view>
</view>
</view>
\ No newline at end of file
.image {
width: 100%;
height: 360rpx;
}
.container {
margin-top: -110px;
background-image: url("https://www.ydxiaoshuai.cn/timg.jpg");
background-repeat: no-repeat;
background-size: auto;
background-position: bottom;
background-position-x: right;
}
button {
font-family: 微软雅黑;
}
.page-body-info {
display: flex;
box-sizing: border-box;
padding: 30rpx;
height: 420rpx;
border-top: 1rpx solid #d9d9d9;
border-bottom: 1rpx solid #d9d9d9;
align-items: center;
justify-content: center;
}
.up {
color: rgb(255, 255, 255);
font-size: 20px;
font-family: 微软雅黑;
width: 200px;
height: 50px;
vertical-align: middle;
text-align: center;
line-height: 45px;
border-radius: 25px;
background-color: rgb(26, 160, 225);
}
.user-motto {
font-family: 微软雅黑;
}
.user-names {
font-family: 微软雅黑;
color: rgb(35,175,8);
}
.user-calories{
font-family: 微软雅黑;
color: rgb(35,175,8);
}
.user-probabilitys{
font-family: 微软雅黑;
color: rgb(35,175,8);
}
.user-remark {
font-family: 微软雅黑;
margin-top: 65px;
}
.dish{
float: left;
font-family: 微软雅黑;
}
.img_wrap {
margin-bottom: 10px;
width: 750rpx;
height: 468rpx;
background: #ececec;
}
image {
width: 100%;
height: 100%;
max-height: 1
}
.msg {
margin: 10px 0;
text-align: center;
}
.baikeinfo{
margin:15rpx 40rpx;
display: flex;
flex-direction: row;
box-shadow:0rpx 2rpx 4rpx 4rpx #f2f2f2;
}
.baikecontent{
overflow:hidden;
text-overflow:ellipsis;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;
font-size:26rpx;
color:#858585;
margin:0rpx 40rpx ;
line-height:40rpx;
}
.baikeform{
font-size: 26rpx;
color: #c0c0c0;
border-top: 1rpx solid #eeeeee;
margin:30rpx 40rpx 0rpx 40rpx;
padding: 20rpx;
}
.baikecard{
display: flex;
flex-direction: column;
text-align: center;
}
\ No newline at end of file
......@@ -115,13 +115,10 @@ Page({
}
})
},
onLoad:function(){
var getAppWXUserInfo = app.globalData.userInfo;
onLoad: function () {
var openIdKey = app.data.openId;
this.setData({
userInfo: getAppWXUserInfo,
hasUserInfo: true,
openId: getAppWXUserInfo.openId,
nickName: getAppWXUserInfo.nickName,
openId: openIdKey
})
}
});
\ No newline at end of file
......@@ -114,12 +114,9 @@ Page({
})
},
onLoad: function () {
var getAppWXUserInfo = app.globalData.userInfo;
var openIdKey = app.data.openId;
this.setData({
userInfo: getAppWXUserInfo,
hasUserInfo: true,
openId: getAppWXUserInfo.openId,
nickName: getAppWXUserInfo.nickName,
openId: openIdKey
})
}
});
\ No newline at end of file
......@@ -115,12 +115,9 @@ Page({
})
},
onLoad: function () {
var getAppWXUserInfo = app.globalData.userInfo;
var openIdKey = app.data.openId;
this.setData({
userInfo: getAppWXUserInfo,
hasUserInfo: true,
openId: getAppWXUserInfo.openId,
nickName: getAppWXUserInfo.nickName,
openId: openIdKey
})
}
});
\ No newline at end of file
......@@ -35,13 +35,10 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var getAppWXUserInfo = app.globalData.userInfo;
var openIdKey = app.data.openId;
this.setData({
userInfo: getAppWXUserInfo,
hasUserInfo: true,
openId: getAppWXUserInfo.openId,
nickName: getAppWXUserInfo.nickName,
});
openId: openIdKey
})
let that = this;
that.countInterval(that.data.percent);
that.drawProgressbg();
......
......@@ -114,12 +114,9 @@ Page({
})
},
onLoad: function () {
var getAppWXUserInfo = app.globalData.userInfo;
var openIdKey = app.data.openId;
this.setData({
userInfo: getAppWXUserInfo,
hasUserInfo: true,
openId: getAppWXUserInfo.openId,
nickName: getAppWXUserInfo.nickName,
openId: openIdKey
})
}
});
\ No newline at end of file
......@@ -122,12 +122,9 @@ Page({
})
},
onLoad: function () {
var getAppWXUserInfo = app.globalData.userInfo;
var openIdKey = app.data.openId;
this.setData({
userInfo: getAppWXUserInfo,
hasUserInfo: true,
openId: getAppWXUserInfo.openId,
nickName: getAppWXUserInfo.nickName,
openId: openIdKey
})
}
});
\ No newline at end of file
......@@ -7,6 +7,7 @@ var clientType= 'wsc';
/*接口地址开始*/
//授权获取微信用户信息url
const oauthurl = prefix + '/wcsp/oauth';
const loginurl = prefix + '/wcsp/login';
//颜值分析url
const faceurl = prefix+'/rest/face/detect?clientType='+clientType+'&apiType=face&authCode='+authCode;
//魅力值分析url
......@@ -57,10 +58,18 @@ const landmarkurl = prefix + '/rest/icr/detect?clientType=' + clientType + '&api
const redwineurl = prefix + '/rest/icr/detect?clientType=' + clientType + '&apiType=redwine&authCode=' + authCode;
//速算识别url
const qcurl = prefix + '/rest/youtu/detect?clientType=' + clientType + '&apiType=qc&authCode=' + authCode;
//速算识别url
const physiognomyurl = prefix + '/rest/physiognomy/face?clientType=' + clientType + '&authCode=' + authCode;
/*常量函数*/
function getOauthUrl() {
return oauthurl;
}
function getPhysiognomyUrl() {
return physiognomyurl;
}
function getLoginUrl() {
return loginurl;
}
function getFaceUrl(){
return faceurl;
}
......@@ -162,4 +171,6 @@ module.exports.getFacestickerurl = getFacestickerurl;
module.exports.getFaceskinurl = getFaceskinurl;
module.exports.getLandmarkUrl = getLandmarkUrl;
module.exports.getRedwineUrl = getRedwineUrl;
module.exports.getQcUrl = getQcUrl;
\ No newline at end of file
module.exports.getQcUrl = getQcUrl;
module.exports.getLoginUrl = getLoginUrl;
module.exports.getPhysiognomyUrl = getPhysiognomyUrl;
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册