python学习
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
]
|
||||
},
|
||||
"navigateToMiniProgramAppIdList": [
|
||||
"wx56c8f077de74b07c"
|
||||
"wxaae03bb4c7273f06"
|
||||
],
|
||||
"sitemapLocation": "sitemap.json"
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
module.exports = {
|
||||
version: "2.1.0",
|
||||
note: '优化了名片二维码的生成效率,减少图片空间存储',
|
||||
subDomain: "aicard", // 根据教程 https://www.yuque.com/apifm/doc/qr6l4m 查看你自己的 subDomain
|
||||
// subDomain: "aicard", // 根据教程 https://www.yuque.com/apifm/doc/qr6l4m 查看你自己的 subDomain
|
||||
subDomain: "hcms", // 根据教程 https://www.yuque.com/apifm/doc/qr6l4m 查看你自己的 subDomain
|
||||
// subDomain: "", // 根据教程 https://www.yuque.com/apifm/doc/qr6l4m 查看你自己的 subDomain
|
||||
}
|
||||
@@ -94,11 +94,13 @@ module.exports =
|
||||
|
||||
/* eslint-disable */
|
||||
// 小程序开发api接口工具包,https://github.com/gooking/wxapi
|
||||
var API_BASE_URL = 'https://api.it120.cc';
|
||||
//var API_BASE_URL = 'https://api.it120.cc';
|
||||
var API_BASE_URL = 'http://www.ruilaizipj.com';
|
||||
var subDomain = 'tz';
|
||||
|
||||
var request = function request(url, needSubDomain, method, data) {
|
||||
var _url = API_BASE_URL + (needSubDomain ? '/' + subDomain : '') + url;
|
||||
var _url = API_BASE_URL + (needSubDomain ? '/' + subDomain : '') + url;
|
||||
// var _url = API_BASE_URL + (needSubDomain ? '' + subDomain : '') + url;
|
||||
return new Promise(function (resolve, reject) {
|
||||
wx.request({
|
||||
url: _url,
|
||||
@@ -263,41 +265,21 @@ module.exports = {
|
||||
alipay: function alipay(data) {
|
||||
return request('/pay/alipay/semiAutomatic/payurl', true, 'post', data);
|
||||
},
|
||||
login_wx: function login_wx(code) {
|
||||
return request('/user/wxapp/login', true, 'post', {
|
||||
login_wx: function login_wx(code,nickName,avatarUrl,gender,province,city,country) {
|
||||
return request('/wxlogin/login', true, 'post', {
|
||||
code: code,
|
||||
type: 2
|
||||
nickName: nickName,
|
||||
avatarUrl: avatarUrl,
|
||||
gender: gender,
|
||||
province: province,
|
||||
city: city,
|
||||
country: country,
|
||||
});
|
||||
},
|
||||
login_username: function login_username(data) {
|
||||
return request('/user/username/login', true, 'post', data);
|
||||
},
|
||||
bindUsername: function bindUsername(token, username) {
|
||||
var pwd = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
||||
|
||||
return request('/user/username/bindUsername', true, 'post', {
|
||||
token: token, username: username, pwd: pwd
|
||||
});
|
||||
},
|
||||
login_mobile: function login_mobile(mobile, pwd) {
|
||||
var deviceId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
||||
var deviceName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
||||
|
||||
return request('/user/m/login', true, 'post', {
|
||||
mobile: mobile, pwd: pwd, deviceId: deviceId, deviceName: deviceName
|
||||
});
|
||||
},
|
||||
resetPwdUseMobileCode: function resetPwdUseMobileCode(mobile, pwd, code) {
|
||||
return request('/user/m/reset-pwd', true, 'post', {
|
||||
mobile: mobile, pwd: pwd, code: code
|
||||
});
|
||||
},
|
||||
resetPwdUseEmailCode: function resetPwdUseEmailCode(email, pwd, code) {
|
||||
return request('/user/email/reset-pwd', true, 'post', {
|
||||
email: email, pwd: pwd, code: code
|
||||
});
|
||||
},
|
||||
register_complex: function register_complex(data) {
|
||||
// login_wx: function login_wx(data) {
|
||||
// return request('/wxlogin/login', true, 'post', data);
|
||||
// },
|
||||
register_complex: function register_complex(data) {
|
||||
return request('/user/wxapp/register/complex', true, 'post', data);
|
||||
},
|
||||
register_simple: function register_simple(data) {
|
||||
@@ -480,6 +462,9 @@ module.exports = {
|
||||
friendUserDetail: function friendUserDetail(token, uid) {
|
||||
return request('/user/friend/detail', true, 'get', { token: token, uid: uid });
|
||||
},
|
||||
// friendUserDetail: function friendUserDetail(token, uid) {
|
||||
// return request('/wxlogin/login', true, 'get', { token: token, uid: uid });
|
||||
// },
|
||||
videoDetail: function videoDetail(videoId) {
|
||||
return request('/media/video/detail', true, 'get', {
|
||||
videoId: videoId
|
||||
|
||||
@@ -1,106 +1,117 @@
|
||||
{
|
||||
"description": "项目配置文件。",
|
||||
"setting": {
|
||||
"urlCheck": false,
|
||||
"es6": true,
|
||||
"enhance": true,
|
||||
"postcss": false,
|
||||
"minified": true,
|
||||
"newFeature": true,
|
||||
"nodeModules": false,
|
||||
"autoAudits": false,
|
||||
"checkInvalidKey": true,
|
||||
"checkSiteMap": true,
|
||||
"uploadWithSourceMap": true,
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
}
|
||||
},
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "2.9.4",
|
||||
"appid": "wx872cc8cc1327641a",
|
||||
"projectname": "%E5%90%8D%E7%89%87%E5%B0%8F%E7%A8%8B%E5%BA%8F",
|
||||
"scripts": {},
|
||||
"simulatorType": "wechat",
|
||||
"simulatorPluginLibVersion": {},
|
||||
"condition": {
|
||||
"search": {
|
||||
"current": -1,
|
||||
"list": []
|
||||
},
|
||||
"conversation": {
|
||||
"current": -1,
|
||||
"list": []
|
||||
},
|
||||
"plugin": {
|
||||
"current": -1,
|
||||
"list": []
|
||||
},
|
||||
"game": {
|
||||
"current": -1,
|
||||
"list": []
|
||||
},
|
||||
"miniprogram": {
|
||||
"current": 7,
|
||||
"list": [
|
||||
{
|
||||
"id": -1,
|
||||
"name": "home",
|
||||
"pathName": "pages/index/index",
|
||||
"query": "",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"name": "商品详情页面",
|
||||
"pathName": "pages/goods-details/index",
|
||||
"query": "id=134&inviter_id=456",
|
||||
"scene": 1011
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"name": "商品详情页面",
|
||||
"pathName": "pages/goods-details/index",
|
||||
"query": "id= 6761",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"name": "砍价详情页面",
|
||||
"pathName": "pages/goods-details/index",
|
||||
"query": "id=6765",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"name": "砍价详情页面",
|
||||
"pathName": "pages/goods-details/index",
|
||||
"query": "id=6765&kjJoinUid=701677",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"name": "拼团",
|
||||
"pathName": "pages/goods-details/index",
|
||||
"query": "id=6761",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"name": "生成海报",
|
||||
"pathName": "pages/goods-details/poster",
|
||||
"query": "goodsid=6761",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"name": "分销中心",
|
||||
"pathName": "pages/fx/apply-status",
|
||||
"scene": null
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
"description": "项目配置文件。",
|
||||
"setting": {
|
||||
"urlCheck": false,
|
||||
"es6": true,
|
||||
"enhance": true,
|
||||
"postcss": false,
|
||||
"preloadBackgroundData": false,
|
||||
"minified": true,
|
||||
"newFeature": true,
|
||||
"coverView": true,
|
||||
"nodeModules": false,
|
||||
"autoAudits": false,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"scopeDataCheck": false,
|
||||
"uglifyFileName": false,
|
||||
"checkInvalidKey": true,
|
||||
"checkSiteMap": true,
|
||||
"uploadWithSourceMap": true,
|
||||
"compileHotReLoad": false,
|
||||
"useMultiFrameRuntime": false,
|
||||
"useApiHook": true,
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
},
|
||||
"enableEngineNative": false,
|
||||
"bundle": false,
|
||||
"useIsolateContext": true,
|
||||
"useCompilerModule": true,
|
||||
"userConfirmedUseCompilerModuleSwitch": false,
|
||||
"packNpmManually": false,
|
||||
"packNpmRelationList": [],
|
||||
"minifyWXSS": true
|
||||
},
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "2.9.4",
|
||||
"appid": "wxaae03bb4c7273f06",
|
||||
"projectname": "%E5%90%8D%E7%89%87%E5%B0%8F%E7%A8%8B%E5%BA%8F",
|
||||
"scripts": {},
|
||||
"simulatorType": "wechat",
|
||||
"simulatorPluginLibVersion": {},
|
||||
"condition": {
|
||||
"search": {
|
||||
"list": []
|
||||
},
|
||||
"conversation": {
|
||||
"list": []
|
||||
},
|
||||
"plugin": {
|
||||
"list": []
|
||||
},
|
||||
"game": {
|
||||
"list": []
|
||||
},
|
||||
"miniprogram": {
|
||||
"list": [
|
||||
{
|
||||
"id": -1,
|
||||
"name": "home",
|
||||
"pathName": "pages/index/index",
|
||||
"query": "",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"name": "商品详情页面",
|
||||
"pathName": "pages/goods-details/index",
|
||||
"query": "id=134&inviter_id=456",
|
||||
"scene": 1011
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"name": "商品详情页面",
|
||||
"pathName": "pages/goods-details/index",
|
||||
"query": "id= 6761",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"name": "砍价详情页面",
|
||||
"pathName": "pages/goods-details/index",
|
||||
"query": "id=6765",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"name": "砍价详情页面",
|
||||
"pathName": "pages/goods-details/index",
|
||||
"query": "id=6765&kjJoinUid=701677",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"name": "拼团",
|
||||
"pathName": "pages/goods-details/index",
|
||||
"query": "id=6761",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"name": "生成海报",
|
||||
"pathName": "pages/goods-details/poster",
|
||||
"query": "goodsid=6761",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"name": "分销中心",
|
||||
"pathName": "pages/fx/apply-status",
|
||||
"scene": null
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,10 +20,22 @@ async function checkHasLogined() {
|
||||
}
|
||||
|
||||
async function login(page){
|
||||
|
||||
const _this = this
|
||||
wx.login({
|
||||
success: function (res) {
|
||||
WXAPI.login_wx(res.code).then(function (res) {
|
||||
// 必须是在用户已经授权的情况下调用
|
||||
let code = res.code; // 微信登录接口返回的 code 参数,下面注册接口需要用到
|
||||
wx.getUserInfo({
|
||||
success: function (res) {
|
||||
var userInfo = res.userInfo
|
||||
var nickName = userInfo.nickName
|
||||
var avatarUrl = userInfo.avatarUrl
|
||||
var gender = userInfo.gender //性别 0:未知、1:男、2:女
|
||||
var province = userInfo.province
|
||||
var city = userInfo.city
|
||||
var country = userInfo.country
|
||||
WXAPI.login_wx(res.code,nickName,avatarUrl,gender,province,city,country).then(function (res) {
|
||||
if (res.code == 10000) {
|
||||
// 去注册
|
||||
//_this.register(page)
|
||||
@@ -44,6 +56,10 @@ async function login(page){
|
||||
page.onShow()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user