作者 朱振飞

修改

... ... @@ -2,7 +2,7 @@
App({
onLaunch: function () {
this.count()
},
//判断小程序是否注册
ifregister(e){
... ... @@ -16,9 +16,7 @@ App({
var param = {
code: code
}
that.post(url, param).then((res) => {
console.log(res);
that.post(url, param).then((res) => {
}).catch((errMsg) => {
console.log(errMsg);
})
... ... @@ -27,6 +25,30 @@ App({
});
},
count() {
let that = this;
wx.login({
success: function (s) {
let url = 'wxapp/public/getSessionKey';
if (s.code) {
var code = s.code;
var param = {
code: code
}
that.post(url, param).then((res) => {
let url = 'wxapp/public/visit';
let params = {
openid: res.openid
}
that.post(url, params).then((res) => {
}).catch((err) => {
})
}).catch((errMsg) => {
})
}
}
});
},
//获取sessionKey和openid
start(e) {
let that = this;
... ...
... ... @@ -61,5 +61,10 @@
"selectedIconPath": "pages/imgs/nav08@2x.png"
}
]
}
},
"permission":{
"scope.userLocation":{
"desc":"你的位置信息将用于小程序位置接口效果展示"
}
}
}
\ No newline at end of file
... ...
... ... @@ -82,7 +82,6 @@ Page({
},
//获取sessionKey和openid (登陆授权)
start(e) {
let exe = e.currentTarget.dataset.exe;
let that = this;
app.globalData.userInfo = e.detail.userInfo;
... ...
... ... @@ -137,7 +137,6 @@
<view class='index_logotxt'>让每件衣服延续它的温暖</view>
<import src="../template/template.wxml"></import>
<view>
<template is="poster" data='{{...posterobj}}'></template>
</view>
<template is="callback" data='{{showlocation}}'></template>
\ No newline at end of file
... ...
... ... @@ -12,7 +12,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.4.0",
"appid": "wx4ac44ac1779dc6a6",
"appid": "wxa00560506f66e48f",
"projectname": "recycle%E6%97%A7%E8%A1%A3%E5%9B%9E%E6%94%B6%E9%A1%B9%E7%9B%AE(%E5%AE%A2%E6%88%B7%E7%9A%84appID)",
"debugOptions": {
"hidedInDevtools": []
... ...