Commit eb8b2664 authored by 郭晓清's avatar 郭晓清
parents a37be7be 97161d77
; ;
(function() { (function() {
let NODE_ENV = 'dev'; // dev:开发环境 | test:测试环境 let NODE_ENV = 'test'; // dev:开发环境 | test:测试环境
let ENV_VAR = null; let ENV_VAR = null;
if (process.env.NODE_ENV === "development") { if (process.env.NODE_ENV === "development") {
if (NODE_ENV === 'dev') { if (NODE_ENV === 'dev') {
......
This diff is collapsed.
...@@ -19,7 +19,7 @@ let settledApiFun = function(vm){ ...@@ -19,7 +19,7 @@ let settledApiFun = function(vm){
let submitSettleFileInfo = async (params = {}) => await vm.$u.post(ucenterApiUrl+'/v1/settled/submit-info', params); let submitSettleFileInfo = async (params = {}) => await vm.$u.post(ucenterApiUrl+'/v1/settled/submit-info', params);
/* 缴纳保证金 */ /* 缴纳保证金 */
let paySettleDeposit = async (params = {}) => await vm.$u.post(ucenterApiUrl + '/v1/settled/pay-deposit' , params,{'content-type': 'application/x-www-form-urlencoded'}); let paySettleDeposit = async (params = {}) => await vm.$u.post(ucenterApiUrl + '/v2/settled/pay-deposit' , params,{'content-type': 'application/x-www-form-urlencoded'});
let getSettleDepositResult = async (params = {}) => await vm.$u.get(ucenterApiUrl+'/v1/settled/check-oid', params,{'content-type': 'application/x-www-form-urlencoded'}); let getSettleDepositResult = async (params = {}) => await vm.$u.get(ucenterApiUrl+'/v1/settled/check-oid', params,{'content-type': 'application/x-www-form-urlencoded'});
......
...@@ -35,7 +35,7 @@ const install = (Vue, vm) => { ...@@ -35,7 +35,7 @@ const install = (Vue, vm) => {
// 请求拦截,配置Token等参数 // 请求拦截,配置Token等参数
Vue.prototype.$u.http.interceptor.request = (config) => { Vue.prototype.$u.http.interceptor.request = (config) => {
const reg = /\?\w+/; const reg = /\?\w+/;
let token = util.getToken() let token = vm.vuex_token
// if(!token && noLoginUrl.indexOf(config.url)<0){ // if(!token && noLoginUrl.indexOf(config.url)<0){
// toLoginPage() // toLoginPage()
// return false // return false
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
}, },
computed: { computed: {
url() { url() {
return process.uniEnv.qn_base_url + 'topback' + this.index + '.png' return process.uniEnv.qn_base_url + 'topl' + this.index + '.png'
} }
} }
} }
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
border-radius: 12rpx; border-radius: 12rpx;
overflow: auto; overflow: auto;
position: fixed; position: fixed;
top: 320rpx; top: 370rpx;
bottom: 0rpx; bottom: 0rpx;
left: 30rpx; left: 30rpx;
right: 30rpx; right: 30rpx;
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
<!-- <template v-if="isStart==true && currentItem"> --> <!-- <template v-if="isStart==true && currentItem"> -->
<view class="bottom-padding" v-if="currentItem"> <view class="bottom-padding" v-if="currentItem">
<view class="title-view"> <view class="title-view">
<view :class="['title-text', {'radio': currentItem.question.answerType == 1}]"> <view :class="['title-text', {'radio': currentItem.question ? currentItem.question.answerType == 1 : true}]">
<text>{{ titleText[Math.max(0, currentItem.question.answerType - 1)] }}</text> <text>{{ titleText[Math.max(0, currentItem.question ? currentItem.question.answerType - 1 : 0)] }}</text>
</view> </view>
<view class="title-right-view"> <view class="title-right-view">
<image class="timeIcon" :src="time1Image" mode=""></image> <image class="timeIcon" :src="time1Image" mode=""></image>
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
url: systemApiUrl + url: systemApiUrl +
'/wxh-worker-rest/rest/exam' + '/wxh-worker-rest/rest/exam' +
'/serviceRule/userExamInfo/' + '/serviceRule/userExamInfo/' +
getApp().globalData.token + that.vuex_token +
'?examId=' + this.examId, '?examId=' + this.examId,
method: 'POST', method: 'POST',
data: { data: {
...@@ -231,7 +231,7 @@ ...@@ -231,7 +231,7 @@
url: systemApiUrl + url: systemApiUrl +
'/wxh-worker-rest/rest/exam' + '/wxh-worker-rest/rest/exam' +
'/serviceRule/' + '/serviceRule/' +
getApp().globalData.token + that.vuex_token +
'?examId=' + this.examId, '?examId=' + this.examId,
method: 'POST', method: 'POST',
data: { data: {
...@@ -297,7 +297,7 @@ ...@@ -297,7 +297,7 @@
url: systemApiUrl + url: systemApiUrl +
'/wxh-worker-rest/rest/exam' + '/wxh-worker-rest/rest/exam' +
'/serviceRule/next/' + '/serviceRule/next/' +
getApp().globalData.token + that.vuex_token +
'?userExamId=' + this.userExamId + '?userExamId=' + this.userExamId +
'&questionId=' + questionId + '&questionId=' + questionId +
'&userAnswerIds=' + this.userAnswerIds, '&userAnswerIds=' + this.userAnswerIds,
...@@ -468,7 +468,7 @@ ...@@ -468,7 +468,7 @@
let that = this let that = this
uni.request({ uni.request({
url: ucenterApiUrl + '/v1/settled/update-settled-exam-score' + url: ucenterApiUrl + '/v1/settled/update-settled-exam-score' +
'?access-token=' + getApp().globalData.token, '?access-token=' + that.vuex_token,
method: 'POST', method: 'POST',
data: { data: {
score: this.examScore || 0, score: this.examScore || 0,
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
> >
<text class="title-view">充电桩自营平台</text> <text class="title-view">充电桩自营平台</text>
</u-navbar> </u-navbar>
<u-swiper <!-- <u-swiper
:height="240" :height="240"
:list="list" :list="list"
:indicator-pos="indicatorPos" :indicator-pos="indicatorPos"
...@@ -22,7 +22,9 @@ ...@@ -22,7 +22,9 @@
:interval="3000" :interval="3000"
@click="clickSwiper" @click="clickSwiper"
> >
</u-swiper> </u-swiper> -->
<image class="banner-image" :src="bannerImage"></image>
<view class="msg-view"> <view class="msg-view">
<view class="msg-title">最新消息</view> <view class="msg-title">最新消息</view>
<view class="msg-list-view"> <view class="msg-list-view">
...@@ -33,14 +35,14 @@ ...@@ -33,14 +35,14 @@
> >
<view class="msg-content-view"> <view class="msg-content-view">
<view class="left-view"> <view class="left-view">
<image class="msg-icon"></image> <image class="msg-icon" :src="msgStyleImage[item.content_type]"></image>
<text>{{ item.body }}</text> <text>{{ item.title }}</text>
</view> </view>
<image class="right-icon"></image> <image class="right-icon" :src="shouyeyouImage"></image>
</view> </view>
<view <view
class="line-view" class="line-view"
v-if="messageList.length > index + 1" v-if="index != 2"
></view> ></view>
</view> </view>
</view> </view>
...@@ -109,20 +111,20 @@ export default { ...@@ -109,20 +111,20 @@ export default {
return { return {
status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交' status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
triggered: false, triggered: false,
list: [ // list: [
{ // {
image: "https://cdn.uviewui.com/uview/swiper/1.jpg", // image: "https://cdn.uviewui.com/uview/swiper/1.jpg",
}, // },
{ // {
image: "https://cdn.uviewui.com/uview/swiper/2.jpg", // image: "https://cdn.uviewui.com/uview/swiper/2.jpg",
}, // },
{ // {
image: "https://cdn.uviewui.com/uview/swiper/3.jpg", // image: "https://cdn.uviewui.com/uview/swiper/3.jpg",
}, // },
], // ],
title: false, title: false,
mode: "round", // mode: "round",
indicatorPos: "bottomCenter", // indicatorPos: "bottomCenter",
title: "Hello", title: "Hello",
loaded: false, loaded: false,
needSettled: true, needSettled: true,
...@@ -132,14 +134,19 @@ export default { ...@@ -132,14 +134,19 @@ export default {
currentLoadStatus: "loading", currentLoadStatus: "loading",
orderList: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}], orderList: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}],
search: { search: {
token: app.globalData.token || "", token: "",
pageNumber: 0, pageNumber: 0,
pageSize: 10, pageSize: 10,
}, },
bottomLoading: false, bottomLoading: false,
}; };
}, },
watch: {}, watch: {
vuex_token(val){
// 监听token变化,如果更新则重新加载页面数据
val && this.initSettleInfo()
}
},
computed: { computed: {
buttonStyle() { buttonStyle() {
return { return {
...@@ -149,13 +156,19 @@ export default { ...@@ -149,13 +156,19 @@ export default {
"font-weight": "bold", "font-weight": "bold",
}; };
}, },
msgStyle() { msgStyleImage() {
return { return {
1: "", // 置顶 '1': process.uniEnv.qn_base_url + "zhiding.png", // 置顶
2: "", // 通知 '2': process.uniEnv.qn_base_url + "tongzhi.png", // 通知
3: "", // 消息 '3': process.uniEnv.qn_base_url + "xiaoxi.png", // 消息
}; }
}, },
bannerImage() {
return process.uniEnv.qn_base_url + 'banner.png'
},
shouyeyouImage() {
return process.uniEnv.qn_base_url + 'shouyeyou.png'
}
}, },
onLoad() { onLoad() {
this._freshing = false; this._freshing = false;
...@@ -163,13 +176,12 @@ export default { ...@@ -163,13 +176,12 @@ export default {
}, },
onShow() { onShow() {
// 每次进入页面都刷新入驻状态 // 每次进入页面都刷新入驻状态
if (app.globalData.token) { if (this.vuex_token) {
// 初始化入驻信息 this.initSettleInfo();
this.initSettleInfo();
} else { } else {
// 初始化订单数据 // 初始化订单数据
this.loadOrderList(); this.loadOrderList();
} }
}, },
methods: { methods: {
async initSettleInfo() { async initSettleInfo() {
...@@ -180,7 +192,7 @@ export default { ...@@ -180,7 +192,7 @@ export default {
if (result && result.record) { if (result && result.record) {
vm.loaded = true; vm.loaded = true;
vm.needSettled = result.needSettled; vm.needSettled = result.needSettled;
vm.status = Number(result.record.status); vm.status = Number(result.record.status || '0');
// vm.status = 8 // vm.status = 8
} }
}; };
...@@ -207,7 +219,7 @@ export default { ...@@ -207,7 +219,7 @@ export default {
loadOrderList() { loadOrderList() {
let self = this; let self = this;
// 加载订单列表 // 加载订单列表
self.search.token = app.globalData.token; self.search.token = self.vuex_token;
self.$u.api.listByRecommendOrder(self.search).then((res) => { self.$u.api.listByRecommendOrder(self.search).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (res.data && res.data.length > 0) { if (res.data && res.data.length > 0) {
...@@ -259,14 +271,14 @@ export default { ...@@ -259,14 +271,14 @@ export default {
}); });
}, 1000); }, 1000);
}, },
clickSwiper(index) {}, // clickSwiper(index) {},
handleScroll() { handleScroll() {
console.log("-----scroll-------"); console.log("-----scroll-------");
}, },
immediatelyIn() { immediatelyIn() {
if (util.getToken()) { if (this.vuex_token) {
// 0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交' // 0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
var pageIndex = 1; var pageIndex = 1;
switch (this.status) { switch (this.status) {
case 1: case 1:
case 2: case 2:
...@@ -322,6 +334,12 @@ export default { ...@@ -322,6 +334,12 @@ export default {
color: #333333; color: #333333;
font-weight: bold; font-weight: bold;
font-size: 40rpx; font-size: 40rpx;
}
.banner-image {
width: 730rpx;
height: 280rpx;
margin-left: -14rpx;
} }
.msg-view { .msg-view {
...@@ -329,14 +347,14 @@ export default { ...@@ -329,14 +347,14 @@ export default {
color: #333333; color: #333333;
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
padding: 50rpx 0rpx 30rpx 0rpx; padding: 1rpx 0rpx 30rpx 0rpx;
} }
.msg-list-view { .msg-list-view {
border-radius: 12rpx; border-radius: 12rpx;
background-color: #ffffff; background-color: #ffffff;
padding: 6rpx 30rpx; padding: 12rpx 30rpx;
height: 268rpx; height: 252rpx;
} }
.msg-content { .msg-content {
...@@ -356,13 +374,14 @@ export default { ...@@ -356,13 +374,14 @@ export default {
.msg-icon { .msg-icon {
width: 80rpx; width: 80rpx;
height: 36rpx; height: 36rpx;
margin-right: 20rpx;
} }
} }
.right-icon { .right-icon {
width: 14rpx; width: 14rpx;
height: 24px; height: 24rpx;
} }
} }
......
...@@ -83,14 +83,14 @@ export default { ...@@ -83,14 +83,14 @@ export default {
let params = { let params = {
nickname: app.globalData.authUserInfo.nickName, nickname: app.globalData.authUserInfo.nickName,
avatar: app.globalData.authUserInfo.avatarUrl, avatar: app.globalData.authUserInfo.avatarUrl,
wxAppNo: 1,
} }
login.appLogin().then(res => { login.appLogin().then(res => {
params.code = res.code params.code = res.code
return login.authorization(params); return login.authorization(params);
}).then(res => { }).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res && util.getToken()) { if (res) {
that.setUserData(res.data)
that.goBackPage() that.goBackPage()
} else { } else {
this.setLoginStatus() this.setLoginStatus()
...@@ -118,14 +118,14 @@ export default { ...@@ -118,14 +118,14 @@ export default {
avatar: app.globalData.authUserInfo.avatarUrl, avatar: app.globalData.authUserInfo.avatarUrl,
encryptedData: e.detail.encryptedData, encryptedData: e.detail.encryptedData,
iv: e.detail.iv, iv: e.detail.iv,
wxAppNo: 1,
} }
login.appLogin().then(res => { login.appLogin().then(res => {
params.code = res.code params.code = res.code
return login.signup(params); return login.signup(params);
}).then(res => { }).then(res => {
uni.hideLoading() uni.hideLoading()
if (res && util.getToken()) { if (res) {
that.setUserData(res.data)
that.goBackPage() that.goBackPage()
} else { } else {
uni.showToast({ uni.showToast({
...@@ -169,6 +169,16 @@ export default { ...@@ -169,6 +169,16 @@ export default {
} }
}, },
setUserData(userInfo) {
if (userInfo && userInfo.token) {
// 如果已经登录则直接获取相关信息
util.setOpenid(userInfo.wxopenid);
this.$u.vuex('vuex_token', userInfo.token);
uni.setStorageSync("user-info", userInfo);
} else {
this.$u.vuex('vuex_token', '');
}
},
setLoginStatus(authed = true) { setLoginStatus(authed = true) {
if (authed) { if (authed) {
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<text class="label">电工工龄(年)</text> <text class="label">电工工龄(年)</text>
</view> </view>
<p :class="['u-flex-1 u-text-right area', {before: !baseInfo.working_age}]"> <p :class="['u-flex-1 u-text-right area', {before: !baseInfo.working_age}]">
{{ baseInfo.working_age ? workingAgeTxt : '去选择'}} {{ baseInfo.working_age !== '' ? workingAgeTxt : '去选择'}}
</p> </p>
<u-icon name="arrow-right" color="#2272FF" size="28"></u-icon> <u-icon name="arrow-right" color="#2272FF" size="28"></u-icon>
</view> </view>
...@@ -685,7 +685,9 @@ ...@@ -685,7 +685,9 @@
} }
.address-textarea { .address-textarea {
font-size: 26rpx; font-size: 26rpx;
width: 100%;
height: 100%;
} }
.tip-text { .tip-text {
......
...@@ -30,8 +30,7 @@ ...@@ -30,8 +30,7 @@
<text class="card-item-text">{{ fileInfo[cardkey] }}</text> <text class="card-item-text">{{ fileInfo[cardkey] }}</text>
</view> </view>
<view class="line-view"></view> <view class="line-view"></view>
<view class="card-item-error" v-if="fileInfo[cardkey] <view class="card-item-error" v-if="((cardkey == 'id_card_name' || cardkey == 'id_card_number') && frontErrorMsg)">{{ frontErrorMsg }}</view>
&& ((cardkey == 'id_card_name' || cardkey == 'id_card_number') && frontErrorMsg)">{{frontErrorMsg}}</view>
<view class="card-item-error" v-if="(cardkey == 'id_card_date' && backErrorMsg)">{{ backErrorMsg }}</view> <view class="card-item-error" v-if="(cardkey == 'id_card_date' && backErrorMsg)">{{ backErrorMsg }}</view>
</view> </view>
</view> </view>
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
...this.payResult ...this.payResult
} }
const res = await this.$u.api.getSettleDepositResult(params); const res = await this.$u.api.getSettleDepositResult(params);
if (res.status !== true) { if (res.data !== true) {
this.saving = false this.saving = false
return return
} }
...@@ -156,8 +156,9 @@ ...@@ -156,8 +156,9 @@
code: code code: code
// appid:'wxd1d6eede324b0465' // appid:'wxd1d6eede324b0465'
} }
const response = await this.$u.api.paySettleDeposit(params) const response = await this.$u.api.paySettleDeposit(params)
if (response.status !== true) { console.log(response)
if (response.code !== 200) {
uni.showToast({ uni.showToast({
title: response.message, title: response.message,
icon: 'none' icon: 'none'
......
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
return process.uniEnv.qn_base_url + 'erweima-bg.png' return process.uniEnv.qn_base_url + 'erweima-bg.png'
}, },
}, },
onLoad(e) { onLoad(e) {
if (e) { if (e) {
if (e.pageIndex) { if (e.pageIndex) {
this.pageIndex = e.pageIndex; this.pageIndex = e.pageIndex;
...@@ -114,8 +114,8 @@ ...@@ -114,8 +114,8 @@
// } // }
}, },
onShow() { onShow() {
if (!this.settledInfo) { if (!this.settledInfo) {
this.getBaseInfo() this.getBaseInfo()
} }
}, },
...@@ -131,7 +131,28 @@ ...@@ -131,7 +131,28 @@
} }
let settledInfo = await app.getBaseInfo(this, callBack) let settledInfo = await app.getBaseInfo(this, callBack)
this.settledInfo = settledInfo this.settledInfo = settledInfo
this.status = settledInfo.record.status this.status = settledInfo.record.status
switch (this.status) {
case 1:
case 2:
case 3:
case 4:
this.pageIndex = 2;
break;
case 8:
this.pageIndex = 3;
break;
case 5:
case 6:
this.pageIndex = 4;
break;
case 7:
this.pageIndex = 5;
break;
default:
this.pageIndex = 1;
break;
}
uni.hideLoading() uni.hideLoading()
this.initInfo(settledInfo.record) this.initInfo(settledInfo.record)
}, },
......
...@@ -80,7 +80,6 @@ ...@@ -80,7 +80,6 @@
}, },
data() { data() {
return { return {
token: app.globalData.token,
baseInfo: { baseInfo: {
name: "", name: "",
id_card_no: "43072219800123456", id_card_no: "43072219800123456",
...@@ -378,7 +377,7 @@ ...@@ -378,7 +377,7 @@
// }, 2000) // }, 2000)
}, },
async goSign() { async goSign() {
const token = app.globalData.token; const token = this.vuex_token;
const settledInfo = this.settledInfo const settledInfo = this.settledInfo
const baseInfo = this.baseInfo const baseInfo = this.baseInfo
const params = { const params = {
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
try { try {
var dataObject = JSON.parse(dataString); var dataObject = JSON.parse(dataString);
//do something //do something
var imageUrl = config.qiniuImageURLPrefix + '/' + dataObject.key; var imageUrl = config.qiniuImageURLPrefix + '/' + (dataObject.key || dataObject.src);
dataObject.imageURL = imageUrl; dataObject.imageURL = imageUrl;
if (success) { if (success) {
success(dataObject); success(dataObject);
......
...@@ -21,6 +21,6 @@ export default { ...@@ -21,6 +21,6 @@ export default {
} }
}, },
computed: { computed: {
...mapState(['ddd']) ...mapState($uStoreKey)
} }
} }
...@@ -29,11 +29,12 @@ function appLogin() { ...@@ -29,11 +29,12 @@ function appLogin() {
// 小程序授权 // 小程序授权
function authorization(data) { function authorization(data) {
return new Promise(async function (resolve, reject) { return new Promise(async function (resolve, reject) {
data.wxAppNo = app.globalData.wxAppNo
const res = await app.$vm.$u.api.loginWechatAuth(data) const res = await app.$vm.$u.api.loginWechatAuth(data)
if (res) { if (res) {
if (res.code == 200 && res.data) { if (res.code == 200 && res.data) {
app.setUserData(res.data) // app.setUserData(res.data)
app.getBaseInfo(app.$vm) // app.getBaseInfo(app.$vm)
resolve(res); resolve(res);
} else { } else {
reject(res); reject(res);
...@@ -50,11 +51,12 @@ function authorization(data) { ...@@ -50,11 +51,12 @@ function authorization(data) {
// 小程序注册 // 小程序注册
function signup(data) { function signup(data) {
return new Promise(async function (resolve, reject) { return new Promise(async function (resolve, reject) {
data.wxAppNo = app.globalData.wxAppNo
const res = await app.$vm.$u.api.loginWechatAuth(data) const res = await app.$vm.$u.api.loginWechatAuth(data)
if (res) { if (res) {
if (res.code == 200 && res.data) { if (res.code == 200 && res.data) {
app.setUserData(res.data) // app.setUserData(res.data)
app.getBaseInfo(app.$vm) // app.getBaseInfo(app.$vm)
resolve(res); resolve(res);
} else { } else {
uni.showModal({ uni.showModal({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment