Browse Source

来活动修改

master
slj 3 years ago
parent
commit
353016b70f
  1. 4
      app.js
  2. 2
      config.js
  3. 9
      models/topic.js
  4. 13
      pages/topics/activity/activitySign/index.js
  5. 2
      pages/topics/index.js
  6. 56
      pages/user/index.js
  7. 7
      pages/user/index.wxml
  8. 5
      pages/user/index.wxss
  9. 29
      pages/weChatAuth/index.js
  10. 18
      project.config.json
  11. 27
      project.private.config.json
  12. 2
      utils/http.js

4
app.js

@ -13,7 +13,8 @@ App({
if(options.referrerInfo.hasOwnProperty('extraData')){ if(options.referrerInfo.hasOwnProperty('extraData')){
this.globalData.navigate.mobile = options.referrerInfo.extraData.mobile, this.globalData.navigate.mobile = options.referrerInfo.extraData.mobile,
this.globalData.navigate.nickname = options.referrerInfo.extraData.nickname, this.globalData.navigate.nickname = options.referrerInfo.extraData.nickname,
this.globalData.navigate.faceImg = options.referrerInfo.extraData.faceImg this.globalData.navigate.faceImg = options.referrerInfo.extraData.faceImg,
this.globalData.navigate.id = options.referrerInfo.extraData.id
} }
http.fetchAuthToken(res => { http.fetchAuthToken(res => {
console.log('app登录--->',res) console.log('app登录--->',res)
@ -37,6 +38,7 @@ App({
mobile:'', mobile:'',
nickname:'', nickname:'',
faceImg:'', faceImg:'',
id:''
}, },
windowHeight:'', windowHeight:'',
screenHeight:'', screenHeight:'',

2
config.js

@ -1,5 +1,5 @@
const config = { const config = {
// api_url: 'http://10.10.11.107:7101/fqsb', // 服务器地址 // api_url: 'http://10.10.11.44:7101/fqsb', // 服务器地址
api_url: 'https://shibeirencai.elinkit.com.cn:7101/fqsb' // 正式环境 api_url: 'https://shibeirencai.elinkit.com.cn:7101/fqsb' // 正式环境
// api_url: 'https://dingoa.elinkit.com.cn/fqsb', // 测试环境 // api_url: 'https://dingoa.elinkit.com.cn/fqsb', // 测试环境
} }

9
models/topic.js

@ -381,13 +381,18 @@ class TopicModel extends HTTP {
this.request(params) this.request(params)
} }
// 在线报名 // 在线报名
onlineSign(aId, success) { onlineSign(aId,id,phone,nickName,company, success) {
let params = { let params = {
url: TopicBaseUrl.activity_online_url, url: TopicBaseUrl.activity_online_url,
success: success, success: success,
method: Method.GET, method: Method.GET,
data: { data: {
activityId: aId activityId: aId,
id:id,
phone:phone,
nickName:nickName,
company:company
} }
} }
this.request(params) this.request(params)

13
pages/topics/activity/activitySign/index.js

@ -16,7 +16,8 @@ Page({
aId: '', aId: '',
username: '', username: '',
company: '', company: '',
phone: '' phone: '',
id:''
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -31,11 +32,14 @@ Page({
initFormData() { initFormData() {
let { let {
nickName, nickName,
phone phone,
id
} = store.readUserInfo() } = store.readUserInfo()
console.log(store.readUserInfo())
this.setData({ this.setData({
username: nickName, username: nickName,
phone: phone phone: phone,
id:id
}) })
}, },
changeCompany: function (e) { changeCompany: function (e) {
@ -93,7 +97,8 @@ Page({
}, },
//在线报名 //在线报名
onlineSignApi() { onlineSignApi() {
topicModel.onlineSign(this.data.aId, res => { console.log(this.data.aId,this.data.id,this.data.phone,this.data.username,this.data.company)
topicModel.onlineSign(this.data.aId,this.data.id,this.data.phone,this.data.username,this.data.company, res => {
if (res.code == 200) { if (res.code == 200) {
console.log(res.code); console.log(res.code);
wx.showModal({ wx.showModal({

2
pages/topics/index.js

@ -142,7 +142,7 @@ Page({
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
wx.redirectTo({ wx.redirectTo({
url: '/pages/weChatAuth/index', url: '/pages/weChatAuth/index?tabType=funeng',
}) })
} else if (res.cancel) { } else if (res.cancel) {
wx.switchTab({ wx.switchTab({

56
pages/user/index.js

@ -124,24 +124,24 @@ Page({
id: 3, id: 3,
name: '政务服务' name: '政务服务'
}, },
// {
// id: 4,
// name: '学历教育'
// },
// {
// id: 5,
// name: '场景开放'
// },
// {
// id: 6,
// name: '企业招聘'
// },
// {
// id: 7,
// name: '名人堂'
// },
{ {
id: 4, id: 4,
name: '学历教育'
},
{
id: 5,
name: '场景开放'
},
{
id: 6,
name: '企业招聘'
},
{
id: 7,
name: '名人堂'
},
{
id: 8,
name: '法律服务' name: '法律服务'
}, },
], ],
@ -200,13 +200,15 @@ Page({
var params = { var params = {
phone: app.globalData.navigate.mobile, phone: app.globalData.navigate.mobile,
nickName: app.globalData.navigate.nickname, nickName: app.globalData.navigate.nickname,
avatarUrl: app.globalData.navigate.faceImg avatarUrl: app.globalData.navigate.faceImg,
id:app.globalData.navigate.id,
} }
userModel.navigateUser(params, res => { userModel.navigateUser(params, res => {
store.saveUserInfo({ store.saveUserInfo({
nickName: params.nickName, nickName: params.nickName,
avatarUrl: params.avatarUrl, avatarUrl: params.avatarUrl,
phone: params.phone phone: params.phone,
id:params.id
}) })
wx.reLaunch({ wx.reLaunch({
@ -252,13 +254,15 @@ Page({
var params = { var params = {
phone: app.globalData.navigate.mobile, phone: app.globalData.navigate.mobile,
nickName: app.globalData.navigate.nickname, nickName: app.globalData.navigate.nickname,
avatarUrl: app.globalData.navigate.faceImg avatarUrl: app.globalData.navigate.faceImg,
id:app.globalData.navigate.id
} }
userModel.navigateUser(params, res => { userModel.navigateUser(params, res => {
store.saveUserInfo({ store.saveUserInfo({
nickName: params.nickName, nickName: params.nickName,
avatarUrl: params.avatarUrl, avatarUrl: params.avatarUrl,
phone: params.phone phone: params.phone,
id:params.id
}) })
wx.reLaunch({ wx.reLaunch({
@ -291,20 +295,23 @@ Page({
store.saveUserInfo({ store.saveUserInfo({
nickName: res.result.nickName, nickName: res.result.nickName,
avatarUrl: res.result.avatarUrl, avatarUrl: res.result.avatarUrl,
phone: res.result.phone || '' phone: res.result.phone || '',
id: res.result.id
}) })
} else { } else {
if (app.globalData.navigate.mobile) { if (app.globalData.navigate.mobile) {
var params = { var params = {
phone: app.globalData.navigate.mobile, phone: app.globalData.navigate.mobile,
nickName: app.globalData.navigate.nickname, nickName: app.globalData.navigate.nickname,
avatarUrl: app.globalData.navigate.faceImg avatarUrl: app.globalData.navigate.faceImg,
id: app.globalData.navigate.id
} }
userModel.navigateUser(params, res => { userModel.navigateUser(params, res => {
store.saveUserInfo({ store.saveUserInfo({
nickName: params.nickName, nickName: params.nickName,
avatarUrl: params.avatarUrl, avatarUrl: params.avatarUrl,
phone: params.phone phone: params.phone,
id: params.id
}) })
wx.reLaunch({ wx.reLaunch({
@ -344,7 +351,6 @@ Page({
type type
} = e.currentTarget.dataset } = e.currentTarget.dataset
console.log('type-->',type) console.log('type-->',type)
if (this.data.isAuth) { if (this.data.isAuth) {
if (type === 'myInfo') { if (type === 'myInfo') {
console.log('进入个人信息页面'); console.log('进入个人信息页面');
@ -359,7 +365,7 @@ Page({
} }
} else { } else {
wx.redirectTo({ wx.redirectTo({
url: '/pages/weChatAuth/index', url: '/pages/weChatAuth/index?tabType=login',
}) })
} }
}, },

7
pages/user/index.wxml

@ -35,7 +35,8 @@
</view> </view>
</view> </view>
<!-- wx:if="{{talentsType != 0 && talentsType != 9}}"--> <!-- wx:if="{{talentsType != 0 && talentsType != 9}}"-->
<view class="title-cell" wx:if="{{talentsType}}"> <block wx:if="{{isAuth}}">
<view class="title-cell" wx:if="{{talentsType}}">
<view class="con"> <view class="con">
<view class="t">人才服务</view> <view class="t">人才服务</view>
<view class="t2" bindtap="service" wx:if="{{talentsType != 0 && talentsType != 9}}"><text>我的服务</text><text class="fa fa-angle-right fa-lg" <view class="t2" bindtap="service" wx:if="{{talentsType != 0 && talentsType != 9}}"><text>我的服务</text><text class="fa fa-angle-right fa-lg"
@ -103,7 +104,7 @@
</swiper> </swiper>
<!--普通人才、企业人才--> <!--普通人才、企业人才-->
<swiper class="nav" indicator-dots="{{false}}" indicator-color="rgb(217,217,217)" <swiper class="nav_public" indicator-dots="{{false}}" indicator-color="rgb(217,217,217)"
indicator-active-color="rgb(230,208,68)" wx:if="{{talentsType == 0 || talentsType == 9}}"> indicator-active-color="rgb(230,208,68)" wx:if="{{talentsType == 0 || talentsType == 9}}">
<block wx:for="{{servicePublic}}"> <block wx:for="{{servicePublic}}">
<swiper-item> <swiper-item>
@ -138,6 +139,8 @@
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
</block>
<mp-cells ext-class="page_hd" wx:if="{{!isAuth}}"> <mp-cells ext-class="page_hd" wx:if="{{!isAuth}}">
<mp-cell bindtap="onTapItem" data-type="myInfo"> <mp-cell bindtap="onTapItem" data-type="myInfo">
<view class="user_hd"> <view class="user_hd">

5
pages/user/index.wxss

@ -72,7 +72,10 @@ page{
height:410rpx; height:410rpx;
background-color: white; background-color: white;
} }
.nav_public{
height:200rpx;
background-color: white;
}
.circular{ .circular{
width: 70rpx; width: 70rpx;
height: 70rpx; height: 70rpx;

29
pages/weChatAuth/index.js

@ -5,7 +5,7 @@ let userModel = new UserModel()
import { AuthModel } from '../../models/auth.js' import { AuthModel } from '../../models/auth.js'
let authModel = new AuthModel() let authModel = new AuthModel()
import { config } from '../../config.js' import { config } from '../../config.js'
const app = getApp()
Page({ Page({
/** /**
@ -20,7 +20,8 @@ Page({
type: Object, type: Object,
value: {} value: {}
}, },
type:1 type:1,
tabType:""
}, },
/** /**
@ -28,7 +29,8 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({ this.setData({
type:options.type type:options.type,
tabType:options.tabType
}) })
}, },
@ -74,13 +76,27 @@ Page({
userInfo: res.result, userInfo: res.result,
avatarUrl: res.result.avatarUrl, avatarUrl: res.result.avatarUrl,
nickName: res.result.nickName, nickName: res.result.nickName,
id:res.result.id,
reAuth: true, reAuth: true,
isAuth: false isAuth: false
}, () => { }, () => {
if (store.hasPhone()) { if (store.hasPhone()) {
//console.log('已经绑定手机号码') console.log('已经绑定手机号码')
let tabType=this.data.tabType
console.log('tabType--',tabType)
if(tabType=='funeng'){
app.globalData.currentTab = "1"
wx.switchTab({
url: '/pages/topics/index'
})
}
if(tabType=='login'){
wx.switchTab({
url: '/pages/user/index'
})
}
} else { } else {
//console.log('未绑定手机号码') console.log('未绑定手机号码')
wx.showModal({ wx.showModal({
title: '温馨提示', title: '温馨提示',
content: '是否前往验证手机号码?', content: '是否前往验证手机号码?',
@ -102,7 +118,8 @@ Page({
store.saveUserInfo({ store.saveUserInfo({
nickName: res.result.nickName, nickName: res.result.nickName,
avatarUrl: res.result.avatarUrl, avatarUrl: res.result.avatarUrl,
phone: res.result.phone || '' phone: res.result.phone || '',
id:res.result.id,
}) })
} else { } else {
//console.log('未授权') //console.log('未授权')

18
project.config.json

@ -1,7 +1,8 @@
{ {
"description": "项目配置文件", "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"packOptions": { "packOptions": {
"ignore": [] "ignore": [],
"include": []
}, },
"setting": { "setting": {
"urlCheck": false, "urlCheck": false,
@ -36,16 +37,15 @@
"packNpmManually": false, "packNpmManually": false,
"packNpmRelationList": [], "packNpmRelationList": [],
"minifyWXSS": true, "minifyWXSS": true,
"showES6CompileOption": false "showES6CompileOption": false,
"disableUseStrict": false,
"useStaticServer": true,
"useCompilerPlugins": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.8.1", "libVersion": "2.8.1",
"appid": "wx8f4ebf5537cf4962", "appid": "wx8f4ebf5537cf4962",
"projectname": "fqsb_wx", "projectname": "fqsb_wx",
"debugOptions": {
"hidedInDevtools": []
},
"isGameTourist": false,
"simulatorType": "wechat", "simulatorType": "wechat",
"simulatorPluginLibVersion": {}, "simulatorPluginLibVersion": {},
"condition": { "condition": {
@ -174,5 +174,9 @@
} }
] ]
} }
},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
} }
} }

27
project.private.config.json

@ -1,117 +1,93 @@
{ {
"setting": {}, "setting": {},
"condition": { "condition": {
"plugin": {
"list": []
},
"game": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"id": -1,
"name": "Boillboard", "name": "Boillboard",
"pathName": "pages/billboards/index", "pathName": "pages/billboards/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1,
"name": "Park", "name": "Park",
"pathName": "pages/billboards/park/index", "pathName": "pages/billboards/park/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1,
"name": "Policy", "name": "Policy",
"pathName": "pages/billboards/policy/index", "pathName": "pages/billboards/policy/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1,
"name": "Artice", "name": "Artice",
"pathName": "pages/article/index", "pathName": "pages/article/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1,
"name": "policy-list", "name": "policy-list",
"pathName": "pages/billboards/policy/policy-list/index", "pathName": "pages/billboards/policy/policy-list/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1,
"name": "Register", "name": "Register",
"pathName": "pages/register/index", "pathName": "pages/register/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1,
"name": "User", "name": "User",
"pathName": "pages/user/index", "pathName": "pages/user/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1,
"name": "Topics", "name": "Topics",
"pathName": "pages/topics/index", "pathName": "pages/topics/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1,
"name": "pages/weChatAuth/index", "name": "pages/weChatAuth/index",
"pathName": "pages/weChatAuth/index", "pathName": "pages/weChatAuth/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1,
"name": "pages/topics/message/index", "name": "pages/topics/message/index",
"pathName": "pages/topics/message/index", "pathName": "pages/topics/message/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1,
"name": "pages/user/myWhistle/evaluate/index", "name": "pages/user/myWhistle/evaluate/index",
"pathName": "pages/user/myWhistle/evaluate/index", "pathName": "pages/user/myWhistle/evaluate/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1,
"name": "pages/user/myInfo/index", "name": "pages/user/myInfo/index",
"pathName": "pages/user/myInfo/index", "pathName": "pages/user/myInfo/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1,
"name": "pages/user/myInfo/register/index", "name": "pages/user/myInfo/register/index",
"pathName": "pages/user/myInfo/register/index", "pathName": "pages/user/myInfo/register/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1,
"name": "pages/resource/index", "name": "pages/resource/index",
"pathName": "pages/resource/index", "pathName": "pages/resource/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": 14,
"name": "pages/resource/detail/index", "name": "pages/resource/detail/index",
"pathName": "pages/resource/detail/index", "pathName": "pages/resource/detail/index",
"query": "", "query": "",
@ -161,5 +137,6 @@
} }
] ]
} }
} },
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
} }

2
utils/http.js

@ -84,7 +84,7 @@ class HTTP {
// 获取token // 获取token
this._fetchWXCode().then(res => { this._fetchWXCode().then(res => {
//console.log('啦啦啦啦凉啊') //console.log('啦啦啦啦凉啊')
//console.log(res) console.log(res)
if (!res) return if (!res) return
let params = { let params = {
url: HTTPConst.TokenURL, url: HTTPConst.TokenURL,

Loading…
Cancel
Save