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