提交 a5d47f04 authored 作者: GOD_ZYX's avatar GOD_ZYX

生成带参数小程序二维码,扫码进入小程序,小程序需要特殊处理

上级 051de350
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
"window": { "window": {
"navigationBarBackgroundColor": "#fff", "navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "紫荆-Kelley金融课堂" "navigationBarTitleText": "紫荆金融课堂"
}, },
"tabBar": { "tabBar": {
"borderStyle": "#dcdcdc", "borderStyle": "#dcdcdc",
......
...@@ -27,8 +27,10 @@ Page({ ...@@ -27,8 +27,10 @@ Page({
url: '/pages/learnSystem/home/home' url: '/pages/learnSystem/home/home'
}) })
}, },
onload: function (query) { onLoad: function (query) {
/* 获取扫描过来的 小程序 可以取到 绑定的 id 和 课程 */
const scene = decodeURIComponent(query.scene) const scene = decodeURIComponent(query.scene)
wx.setStorageSync('scene', scene)
}, },
/* 进入页面,先判断是否获取用户信息 */ /* 进入页面,先判断是否获取用户信息 */
onReady: function () { onReady: function () {
......
{ {
"navigationBarTitleText": "紫荆-Kelley金融课堂", "navigationBarTitleText": "紫荆金融课堂",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#414141", "navigationBarBackgroundColor": "#414141",
"disableScroll": true "disableScroll": true
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<view class='container'> <view class='container'>
<image class='bg' src='./icons/bg.png' mode='aspectFill'></image> <image class='bg' src='./icons/bg.png' mode='aspectFill'></image>
<image class='logo' src='./icons/hd-logo.png' mode='aspectFit'></image> <image class='logo' src='./icons/hd-logo.png' mode='aspectFit'></image>
<view class='text'>紫荆-Kelley金融课堂</view> <view class='text'>紫荆金融课堂</view>
<button class='btn' open-type='getUserInfo' bindgetuserinfo='getUserInfo'>登录</button> <button class='btn' open-type='getUserInfo' bindgetuserinfo='getUserInfo'>登录</button>
<!-- <view class='test-id' bindtap='guestLogin'>游客登录</view> --> <!-- <view class='test-id' bindtap='guestLogin'>游客登录</view> -->
<view class='userinfo'> <view class='userinfo'>
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#fff", "navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "紫荆-Kelley金融课堂" "navigationBarTitleText": "紫荆金融课堂"
} }
\ No newline at end of file
{ {
"navigationBarBackgroundColor": "#fff", "navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "紫荆-Kelley金融课堂" "navigationBarTitleText": "紫荆金融课堂"
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
"navigationBarBackgroundColor": "#3f3f3f", "navigationBarBackgroundColor": "#3f3f3f",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"backgroundColor": "#535353", "backgroundColor": "#535353",
"navigationBarTitleText": "紫荆-Kelley金融课堂" "navigationBarTitleText": "紫荆金融课堂"
} }
\ No newline at end of file
{ {
"navigationBarBackgroundColor": "#3f3f3f", "navigationBarBackgroundColor": "#3f3f3f",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"navigationBarTitleText": "紫荆-Kelley金融课堂", "navigationBarTitleText": "紫荆金融课堂",
"backgroundColor": "#535353", "backgroundColor": "#535353",
"disableScroll": true "disableScroll": true
} }
\ No newline at end of file
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.3.0", "libVersion": "2.3.0",
"appid": "wx944151f4ea4203a4", "appid": "wx80b4557ad9355bdc",
"projectname": "learnOnline", "projectname": "learnOnline-survey",
"isGameTourist": false, "isGameTourist": false,
"condition": { "condition": {
"search": { "search": {
...@@ -21,13 +21,25 @@ ...@@ -21,13 +21,25 @@
"current": -1, "current": -1,
"list": [] "list": []
}, },
"plugin": {
"current": -1,
"list": []
},
"game": { "game": {
"currentL": -1, "currentL": -1,
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": -1, "current": 0,
"list": [] "list": [
{
"id": 0,
"name": "扫码编译",
"pathName": "pages/index/index",
"query": "scene=123%261%2C3",
"scene": "1048"
}
]
} }
} }
} }
\ No newline at end of file
...@@ -6,7 +6,7 @@ const config = { ...@@ -6,7 +6,7 @@ const config = {
// outSiteLink: 'https://applets.ezijing.com', // 本地测试外链 // outSiteLink: 'https://applets.ezijing.com', // 本地测试外链
// URL_PATH: 'https://api2.ezijing.com', // 测试域名 // URL_PATH: 'https://api2.ezijing.com', // 测试域名
// outSiteLink: 'https://kelley2.ezijing.com', // 测试外链 // outSiteLink: 'https://kelley2.ezijing.com', // 测试外链
URL_PATH: 'https://api.ezijing.com/tenant', // 正式域名 - 由于项目变动域名 URL_PATH: 'https://api.ezijing.com/ep', // 正式域名 - 由于项目变动域名
outSiteLink: 'https://e-learning.ezijing.com', // 正式外链 outSiteLink: 'https://e-learning.ezijing.com', // 正式外链
tenant: 'zjkelley' tenant: 'zjkelley'
} }
...@@ -100,9 +100,26 @@ const miniGetInfo = (callback) => { ...@@ -100,9 +100,26 @@ const miniGetInfo = (callback) => {
* 登录api - 获取 openId 、userName等内容 * 登录api - 获取 openId 、userName等内容
*/ */
const loginApi = (obj, callback) => { const loginApi = (obj, callback) => {
/* 特殊绑定 接口 跟 其他登录 接口不一致,这个主要用来 做 扫码登录使用 */
// sid 6489388550075711488
// class_id 6488300987269251072
// 6489392145194024960 公司金融
// 6489392226584494080 家族财富传承
// 6489392240857710592 金融科技:全球与本土视角
let scene = wx.getStorageSync('scene')
let wenti_id = ''
let cids = ''
let semester_id = '6489388550075711488'
let class_id = '6488300987269251072'
if (scene) {
wenti_id = scene.split('&')[0]
cids = scene.split('&')[1] + ','
cids = cids.replace(/1,/gi, '6489392145194024960,').replace(/2,/gi, '6489392226584494080,').replace(/3,/gi, '6489392240857710592,')
cids = cids.substr(0, cids.length - 1)
}
wx.request({ wx.request({
url: config.URL_PATH + '/user/applets-login', url: config.URL_PATH + '/user/authorization',
data: { code: obj.code, encrypted_data: obj.encryptedData, iv: obj.iv }, method: 'POST', header: { data: { code: obj.code, encrypted_data: obj.encryptedData, iv: obj.iv, course_ids: cids, semester_id: semester_id, class_id: class_id, survey_id: wenti_id, idt: config.tenant }, method: 'POST', header: {
tenant: config.tenant tenant: config.tenant
}, },
success: res => { callback(res, obj); } success: res => { callback(res, obj); }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论