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') {
......
<script> <script>
import './../.env.js' import "./../.env.js";
import { import { AnalysysAgent } from "@/utils/analysys_paas.js";
AnalysysAgent import util from "@/utils/util.js";
} from '@/utils/analysys_paas.js' export default {
import util from '@/utils/util.js' globalData: {
export default { // 开发环境
globalData:{ uniEnv: process.uniEnv,
// 开发环境 // 登录凭证
uniEnv:process.uniEnv, token: "",
// 登录凭证 // 微信小程序平台编号,空--家维广场,1--自营平台
token: '', wxAppNo: 1,
//授权提示 图标
icon_auth_notice: 'https://qn-static.banshouhui.com/auth_notice.png',
//授权提示新 图标
icon_auth_notice_new: 'https://qn-static.banshouhui.com/auth_notice_new.png',
// 服务规范教程视频
service_standard: {
"course1": {
url: "https://qn-static.banshouhui.com/self-support/videoen.mp4",
title: "第一节 师傅考核规则",
desc: "接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。",
},
"course2": {
url: "https://qn-static.banshouhui.com/self-support/videoen.mp4",
title: "第二节 安装材料及工具",
desc: "接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。",
},
"course3": {
url: "https://qn-static.banshouhui.com/self-support/videoen.mp4",
title: "第三节 安装施工规范",
desc: "接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。",
},
"course4": {
url: "https://qn-static.banshouhui.com/self-support/videoen.mp4",
title: "第四节 录单上传要求",
desc: "接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。",
},
},
// 授权用户信息
authUserInfo: '',
// 用户入驻信息
settledInfo: {},
},
onLaunch: function() {
// 应用初始化(全局只触发一次)
let that = this
that.globalData.token = util.getToken()
AnalysysAgent.registerSuperProperty("platform", "self-support");
// 应用启动,或从后台进入前台显示
this.autoLogin()
},
onShow: function() {
// 应用启动,或从后台进入前台显示
// this.autoLogin()
},
onHide: function() {
// 应用从前台进入后台
},
methods: {
async getBaseInfo(vm, callBack) {
uni.showLoading({
title: '加载中……'
})
const res = await vm.$u.api.getSettleBaseInfo()
console.log(res,'res')
if(res.code !==200){
uni.showToast({
title: res && res.message || '获取基本信息错误',
icon: 'none'
});
return false;
}
this.globalData.settledInfo = res.data //授权提示 图标
if (!res.data) { icon_auth_notice: "https://qn-static.banshouhui.com/auth_notice.png",
return //授权提示新 图标
} icon_auth_notice_new:
if(typeof callBack == 'function') { "https://qn-static.banshouhui.com/auth_notice_new.png",
callBack(vm, res.data) // 服务规范教程视频
} service_standard: {
uni.hideLoading() course1: {
return res.data url: "https://qn-static.banshouhui.com/self-support/videoen.mp4",
title: "第一节 师傅考核规则",
}, desc:
"接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。",
/** },
* 用户自动登录 course2: {
*/ url: "https://qn-static.banshouhui.com/self-support/videoen.mp4",
autoLogin() { title: "第二节 安装材料及工具",
let that = this desc:
uni.login({ "接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。",
async success(res) { },
if (res.code) { course3: {
let params = { url: "https://qn-static.banshouhui.com/self-support/videoen.mp4",
code: res.code, title: "第三节 安装施工规范",
wxAppNo: 1, // 自营平台小程序 desc:
} "接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。",
let result = await that.$u.api.loginWechatAuth(params) },
if (result) { course4: {
if (result.code == 200 && result.data) { url: "https://qn-static.banshouhui.com/self-support/videoen.mp4",
that.setUserData(result.data) title: "第四节 录单上传要求",
that.getBaseInfo(that) desc:
} "接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。",
} else { },
uni.showModal({ },
title: '请求失败',
content: result.message, // 授权用户信息
showCancel: false authUserInfo: "",
});
} // 用户入驻信息
uni.hideLoading() settledInfo: {},
} else { },
uni.showModal({ onLaunch: function () {
title: '登录失败', // 应用初始化(全局只触发一次)
content: '未获取到code', AnalysysAgent.registerSuperProperty("platform", "self-support");
});
} // 版本更新
}, this.updateApp();
fail() { },
onShow: function () {
} // 应用启动,或从后台进入前台显示
}); this.autoLogin();
}, },
setUserData(userInfo) { onHide: function () {
if (userInfo && userInfo.token) { // 应用从前台进入后台
// 如果已经登录则直接获取相关信息 },
util.setOpenid(userInfo.wxopenid) methods: {
util.setToken(userInfo.token) async getBaseInfo(vm, callBack) {
uni.setStorageSync('user-info', userInfo); uni.showLoading({
} else { title: "加载中……",
util.setToken('') });
} const res = await vm.$u.api.getSettleBaseInfo();
}, console.log(res, "res");
if (res.code !== 200) {
/* ------------------------- 数据埋点begin ------------------------------ */ uni.showToast({
track(event, properties) { title: (res && res.message) || "获取基本信息错误",
if (AnalysysAgent) { icon: "none",
// 易观添加事件 });
let AnalysysAgent = wx.AnalysysAgent; return false;
AnalysysAgent.track("take_order_" + event, properties); }
}
}, this.globalData.settledInfo = res.data;
identify(userInfo, openid, unionid = null) { if (!res.data) {
// 设备身份表示 return;
if (AnalysysAgent) { }
let setProfile = { if (typeof callBack == "function") {
'openid': openid, callBack(vm, res.data);
'unionid': unionid, }
} uni.hideLoading();
setProfile = Object.assign(setProfile, userInfo) return res.data;
AnalysysAgent.profileSet(setProfile); },
}
}, /**
setUserId(userId) { * 用户自动登录
// 用户id设置 */
if (AnalysysAgent) { autoLogin() {
AnalysysAgent.alias(userId + '') let that = this;
} uni.login({
}, async success(res) {
setUser(user) { if (res.code) {
// 用户附加属性 let params = {
if (AnalysysAgent) { code: res.code,
let userInfo = { wxAppNo: that.globalData.wxAppNo, // 自营平台小程序
'mobile': user.mobile, };
'userfrom_id': user.uid, let result = await that.$u.api.loginWechatAuth(params);
'userfrom': '家维广场', if (result) {
'avatar': user.avatar, if (result.code == 200 && result.data) {
'nickname': user.nickname, that.setUserData(result.data);
'username': user.username, }
'wxhuid': user.wxhuid, } else {
'id': user.id, uni.showModal({
'money': user.money, title: "请求失败",
'score': user.score content: result.message,
}; showCancel: false,
Object.keys(userInfo).map(key => { });
if (key && userInfo[key]) { }
AnalysysAgent.profileAppend(key, userInfo[key]) uni.hideLoading();
} } else {
}) uni.showModal({
} title: "登录失败",
}, content: "未获取到code",
share(toShareProperties, trackProperties) { });
if (AnalysysAgent) { }
AnalysysAgent.share(toShareProperties, trackProperties); },
} fail() {},
}, });
trackPage(pageName, properties) { },
if (AnalysysAgent) { setUserData(userInfo) {
AnalysysAgent.pageView(pageName, properties); if (userInfo && userInfo.token) {
} // 如果已经登录则直接获取相关信息
}, util.setOpenid(userInfo.wxopenid);
initShare(option) { this.$u.vuex('vuex_token', userInfo.token);
console.log(option, 'option-initShare') uni.setStorageSync("user-info", userInfo);
option = option || {} } else {
if (AnalysysAgent && option.user_id) { this.$u.vuex('vuex_token', '');
let shareUserInfo = { }
'share_from_id': option.user_id || '', },
'share_from_nickname': option.user_name || '',
} /* 版本更新 */
AnalysysAgent.registerSuperProperties(shareUserInfo); updateApp() {
} // 版本更新
}, const updateManager = uni.getUpdateManager();
/* ------------------------- 数据埋点end ------------------------------ */
} updateManager.onCheckForUpdate(function (res) {
} // 请求完新版本信息的回调
console.log(res.hasUpdate);
});
updateManager.onUpdateReady(function (res) {
uni.showModal({
title: "更新提示",
content: "新版本已经准备好,是否重启应用?",
success(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate();
}
},
});
});
updateManager.onUpdateFailed(function (res) {
// 新的版本下载失败
});
},
/* ------------------------- 数据埋点begin ------------------------------ */
track(event, properties) {
if (AnalysysAgent) {
// 易观添加事件
let AnalysysAgent = wx.AnalysysAgent;
AnalysysAgent.track("take_order_" + event, properties);
}
},
identify(userInfo, openid, unionid = null) {
// 设备身份表示
if (AnalysysAgent) {
let setProfile = {
openid: openid,
unionid: unionid,
};
setProfile = Object.assign(setProfile, userInfo);
AnalysysAgent.profileSet(setProfile);
}
},
setUserId(userId) {
// 用户id设置
if (AnalysysAgent) {
AnalysysAgent.alias(userId + "");
}
},
setUser(user) {
// 用户附加属性
if (AnalysysAgent) {
let userInfo = {
mobile: user.mobile,
userfrom_id: user.uid,
userfrom: "家维广场",
avatar: user.avatar,
nickname: user.nickname,
username: user.username,
wxhuid: user.wxhuid,
id: user.id,
money: user.money,
score: user.score,
};
Object.keys(userInfo).map((key) => {
if (key && userInfo[key]) {
AnalysysAgent.profileAppend(key, userInfo[key]);
}
});
}
},
share(toShareProperties, trackProperties) {
if (AnalysysAgent) {
AnalysysAgent.share(toShareProperties, trackProperties);
}
},
trackPage(pageName, properties) {
if (AnalysysAgent) {
AnalysysAgent.pageView(pageName, properties);
}
},
initShare(option) {
console.log(option, "option-initShare");
option = option || {};
if (AnalysysAgent && option.user_id) {
let shareUserInfo = {
share_from_id: option.user_id || "",
share_from_nickname: option.user_name || "",
};
AnalysysAgent.registerSuperProperties(shareUserInfo);
}
},
/* ------------------------- 数据埋点end ------------------------------ */
},
};
</script> </script>
<style> <style>
/*每个页面公共css */ /*每个页面公共css */
</style> </style>
<style lang="scss"> <style lang="scss">
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */ /* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
@import "uview-ui/index.scss"; @import "uview-ui/index.scss";
@import '@/common/index.scss'; @import "@/common/index.scss";
</style> </style>
\ No newline at end of file
...@@ -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