Commit 8e34738c authored by Morson's avatar Morson

Merge branch 'master' of https://git.banshouhui.com/lijundan/self-support

# Conflicts:
#	src/pages/settle/file.vue
parents 4d14079a d405e12d
This diff is collapsed.
<template>
<view class="list">
<view v-for="(item,index) in settings" :key="index"
:class="{'txt':true,'active':checkStatus(item)}" @click="setValue(item)">{{item}}
</view>
</view>
</template>
<script>
import objMixin from './objMixin'
export default {
name: 'XhRadio',
components: {},
mixins: [objMixin],
props: {},
filters:{},
data() {
return {}
},
computed: {
settings() {
return this.item.settings || []
}
},
watch: {},
mounted() {},
methods: {
checkStatus(item){
if(!item){
return false
}
const dataValue = this.dataValue
let flag = Array.isArray(dataValue) && dataValue.indexOf(item)>-1
console.log(flag,'flag')
return flag
},
setValue(txt) {
const dataValue = this.dataValue || []
let idx = dataValue.indexOf(txt)
if (idx > -1) {
dataValue.splice(idx,1)
} else {
dataValue.push(txt)
}
this.dataValue = dataValue
this.valueChange(this.dataValue)
}
}
}
</script>
<style lang="scss" scoped>
.list {
display: flex;
.txt {
color: #666;
padding: 10rpx;
&.active {
background-color: red;
color: #fff;
}
}
}
</style>
<template>
<view class="file-box">
<view class="u-flex" @click="selectUpload">
<view class="txt u-flex-1">{{item.fieldsTitle}}</view>
<u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view>
<view class="pics u-flex u-flex-wrap">
<u-image class="pic" v-for="item in 6" width="170rpx" height="170" src="'https://cdn.uviewui.com/uview/example/fade.jpg"></u-image>
</view>
<u-popup v-model="maskShow" mode="center" width="500">
<view class="upload-box u-p-30">
<view class="title">请选择图片</view>
<view class="u-flex u-row-between">
<view class="upload-item u-text-center" @click="uploadFile('photo')">
<u-image class="pic" width="170rpx" height="170" src="'https://cdn.uviewui.com/uview/example/fade.jpg"></u-image>
相册
</view>
<view class="upload-item u-text-center" @click="uploadFile">
<u-image class="pic" width="170rpx" height="170" src="'https://cdn.uviewui.com/uview/example/fade.jpg"></u-image>
拍摄
</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import objMixin from './objMixin'
import baseFile from '@/components/upload/index';
export default {
name: 'XhFiles',
components: {},
mixins: [objMixin,baseFile],
props: {},
filters:{},
data() {
return {
maskShow:false
}
},
computed: {
settings() {
return this.item.settings || []
}
},
watch: {},
mounted() {},
methods: {
selectUpload(){
// 弹窗展示
this.maskShow = true
},
chooseImage(){
},
uploadFile(type){
if(type&&type==='photo'){
// 直接打开相册
this.chooseImage()
return
}
// 使用拍照工具拍摄
},
checkStatus(item){
if(!item){
return false
}
const dataValue = this.dataValue
let flag = Array.isArray(dataValue) && dataValue.indexOf(item)>-1
console.log(flag,'flag')
return flag
},
setValue(txt) {
const dataValue = this.dataValue || []
let idx = dataValue.indexOf(txt)
if (idx > -1) {
dataValue.splice(idx,1)
} else {
dataValue.push(txt)
}
this.dataValue = dataValue
this.valueChange(this.dataValue)
}
}
}
</script>
<style lang="scss" scoped>
.pic{
margin-right: 15rpx;
margin-bottom: 15rpx;
&:nth-child(3n){
margin-right: 0;
}
}
// .list {
// display: flex;
// .txt {
// color: #666;
// padding: 10rpx;
// &.active {
// background-color: red;
// color: #fff;
// }
// }
// }
</style>
<template> <template>
<view> <view>
<u-input v-model="item.fieldsValue" /> <u-input v-model="dataValue" @input="valueChange" :type="type" />
</view> </view>
</template> </template>
<script> <script>
import stringMixin from './stringMixin'
export default { export default {
name: 'xhInput', name: 'XhInput', // 新建 input
props: { components: {},
item: { mixins: [stringMixin],
type: Object, props: {},
default () {
return null
}
},
},
data() { data() {
return { return {}
value: '', },
type: 'text', computed: {
border: true, type() {
if (this.item && this.item.fieldsType == 'password') {
return this.item.fieldsType
} else {
return 'text'
} }
} }
},
watch: {},
mounted() {},
methods: {}
} }
</script> </script>
......
<template>
<view class="list">
<view v-for="(item,index) in settings" :key="index" :class="{'txt':true,'active':item===dataValue}"
@click="setValue(item)">{{item}}</view>
</view>
</template>
<script>
import stringMixin from './stringMixin'
export default {
name: 'XhRadio',
components: {},
mixins: [stringMixin],
props: {},
data() {
return {}
},
computed: {
settings(){
return this.item.settings || []
}
},
watch: {},
mounted() {},
methods: {
setValue(txt){
this.dataValue = txt
this.valueChange(txt)
}
}
}
</script>
<style lang="scss" scoped>
.list{
display: flex;
.txt{
color:#666;
padding:10rpx;
&.active{
background-color: red;
color:#fff;
}
}
}
</style>
<template> <template>
<view> <view>
<u-input v-model="item.fieldsValue" /> <u-input v-model="dataValue" readOnly @click="show=true" type="select" />
<u-action-sheet :list="settings" v-model="show" @click="actionSheetCallback"></u-action-sheet>
</view> </view>
</template> </template>
<script> <script>
import stringMixin from './stringMixin'
export default { export default {
name: 'xhInput', name: 'XhSelect',
props: { components: {},
item: { mixins: [stringMixin],
type: Object, props: {},
default () { data() {
return [{}] return {
show: false
} }
}, },
computed: {
type() {
if (this.item && this.item.fieldsType == 'password') {
return this.item.fieldsType
} else {
return 'text'
}
}, },
data() { settings() {
let result = []
let settings = this.item.settings || []
result = settings.map(item => {
return { return {
value: '', text: item
type: 'text', }
border: true, })
return result
}
},
watch: {},
mounted() {},
methods: {
actionSheetCallback(index) {
let txt = this.settings[index].text;
this.dataValue = txt
this.valueChange(txt)
} }
} }
} }
......
/** 自定义组件 共同逻辑 */
export default {
data() {
return {
dataValue:null
}
},
watch: {
value: function(val) {
this.dataValue = val
}
},
props: {
value: {
type: Object,
default: () => {
return null
}
},
/** 索引值 用于更新数据 */
itemIndex: Number,
groupIndex: Number,
/** 包含数据源 */
item: Object,
disabled: {
type: Boolean,
default: false
}
},
mounted() {
/** 如果有值以传入值为主 如果无值 已默认值为主 */
this.dataValue = this.value
},
methods: {
// 输入的值
valueChange(val) {
const data = {
groupIndex: this.groupIndex, // 左侧菜单下标
itemIndex: this.itemIndex, //右侧某一项下标
value: val
}
this.$emit('value-change', data)
}
}
}
/** 自定义组件 共同逻辑 */
export default {
data() {
return {
dataValue: ''
}
},
watch: {
value: function(val) {
this.dataValue = val
}
},
props: {
value: {
type: [String, Number],
default: ''
},
/** 索引值 用于更新数据 */
itemIndex:Number,
groupIndex:Number,
/** 包含数据源 */
item: Object,
disabled: {
type: Boolean,
default: false
}
},
mounted() {
/** 如果有值以传入值为主 如果无值 已默认值为主 */
this.dataValue = this.value
},
methods: {
// 输入的值
valueChange(val) {
const data = {
groupIndex: this.groupIndex,// 左侧菜单下标
itemIndex:this.itemIndex,//右侧某一项下标
value: val
}
this.$emit('value-change', data)
}
}
}
<template>
<view class="content-view">
<view class="content-list" v-for="(item, index) in info" :key="index">
<view class="content-title">{{item.title}}</view>
<view class="content-item" v-for="(i, key) in item.content" :key="key">{{i}}</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {}
},
computed: {
info() {
return [{
title: '一、入驻条件',
content: [
'1.年龄在18-60周岁之间;',
'2.初中及以上学历;',
'3.能熟练使用智能手机;',
'4.与人交流时态度良好,沟通顺畅;'
]
}, {
title: '二、注意事项',
content: [
'1.平台会对每笔订单收取一定比例的服务费抽成;',
'2.若审核通过,平台工作人员将会电话联系您,并邀约参加师傅培训会,请您耐心等待;',
'3.开关插座、线路维修、空开漏保等品类的师傅需持有电工证;',
'4.家电清洗品类的师傅需持有专业高温清洗设备,并在每一笔清洗订单中上传设备照片(单独水枪类清洗设备不符合规定);',
'5.请如实填写自己擅长品类,如有核实师傅申请的维修品类和开通账号的维修品类不一致,将不给予接单资格;'
]
}]
}
}
}
</script>
<style lang="scss" scoped>
.content-view {
padding: 16rpx 30rpx 30rpx 30rpx;
background-color: #F4F5F7;
height: 360rpx;
overflow: scroll;
.content-list {
.content-title {
font-size: 28rpx;
color: #333333;
margin-top: 14rpx;
}
.content-item {
font-size: 24rpx;
color: #666666;
padding-top: 14rpx;
}
}
}
</style>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
}, },
computed: { computed: {
url() { url() {
return '../../static/settle/bachground' + this.index + '@3x.png' return '../../static/settle/top' + this.index + '@3x.png'
} }
} }
} }
......
<template>
<view class="content-view">
<view class="headimage-view">
<image class="headimage-view-image" src="../../static/settle/kefu@3x.png"></image>
<text class="name-text">朱曼婷</text>
</view>
<view class="content-info">
<view>
<view class="content-info-title">深圳唯修汇科技有限公司</view>
<view class="content-info-tip">长按二维码添加官方客服微信及时了解审核进度</view>
</view>
<view class="QRcode-view">
<image class="content-info-QRcode" src="../../static/settle/erweima@3x.png"></image>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
},
data() {
return {}
}
}
</script>
<style lang="scss" scoped>
.content-view {
background-color: #FFFFFF;
width: 440rpx;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
.headimage-view {
position: relative;
.headimage-view-image {
width: 440rpx;
height: 400rpx;
}
.name-text {
position: absolute;
bottom: 20rpx;
left: 20rpx;
color: #FFFFFF;
font-size: 28rpx;
}
}
.content-info {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
padding: 0rpx 12rpx 20rpx 12rpx;
.content-info-title {
font-size: 24rpx;
color: #333333;
margin-bottom: 10rpx;
}
.content-info-tip {
font-size: 20rpx;
color: #666666;
}
.QRcode-view {
margin-left: 30rpx;
}
.content-info-QRcode {
padding-top: 12rpx;
width: 104rpx;
height: 104rpx;
}
}
}
</style>
...@@ -101,7 +101,9 @@ ...@@ -101,7 +101,9 @@
{ {
"path": "pages/settle/pay-ensure", "path": "pages/settle/pay-ensure",
"style": { "style": {
"navigationBarTitleText": "缴纳设备押金" "navigationBarTitleText": "缴纳设备押金",
"navigationStyle": "custom",
"disableScroll": true
} }
}, },
{ {
...@@ -121,7 +123,9 @@ ...@@ -121,7 +123,9 @@
{ {
"path": "pages/settle/sign-contract", "path": "pages/settle/sign-contract",
"style": { "style": {
"navigationBarTitleText": "签约页面" "navigationBarTitleText": "签约页面",
"navigationStyle": "custom", // 隐藏系统导航栏
"disableScroll": true
} }
}, },
{ {
...@@ -217,6 +221,16 @@ ...@@ -217,6 +221,16 @@
"path": "pages/settle/base", //启动页面,必选 "path": "pages/settle/base", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到 "query": "" //启动参数,在页面的onLoad函数里面得到
}, },
{
"name": "在线考试", //模式名称
"path": "pages/learn/exam", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{
"name": "在线考试-old", //模式名称
"path": "pages/exam/start", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{ {
"name": "入驻提示", //模式名称 "name": "入驻提示", //模式名称
"path": "pages/settle/prompt", //启动页面,必选 "path": "pages/settle/prompt", //启动页面,必选
...@@ -232,6 +246,16 @@ ...@@ -232,6 +246,16 @@
"path": "pages/settle/pay-ensure", //启动页面,必选 "path": "pages/settle/pay-ensure", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到 "query": "" //启动参数,在页面的onLoad函数里面得到
}, },
{
"name": "签约页面", //模式名称
"path": "pages/settle/sign-contract", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{
"name": "缴纳保证金", //模式名称
"path": "pages/settle/pay-ensure", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{ {
"name": "订单 - 完工配置", //模式名称 "name": "订单 - 完工配置", //模式名称
"path": "pages/order/complete", //启动页面,必选 "path": "pages/order/complete", //启动页面,必选
......
<template> <template>
<view class="backView"> <view class="backView">
<process :process="2" :type="0" title="业务流程"></process>
<template v-if="isStart==false"> <template v-if="isStart==false">
<view class="noticeView"> <view class="noticeView">
<text class="noticeText">规则:系统随机出现20道考试题目,每道题5分,每题答题时间100秒,在规定时间内答对题目的记分。 <text class="noticeText">规则:系统随机出现20道考试题目,每道题5分,每题答题时间100秒,在规定时间内答对题目的记分。
...@@ -151,7 +150,7 @@ ...@@ -151,7 +150,7 @@
} }
if (res.data.code == 401 || res.data.code == 403) { if (res.data.code == 401 || res.data.code == 403) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/login/index' url: '/pages/login/wxlogin'
}) })
return return
} }
...@@ -220,7 +219,7 @@ ...@@ -220,7 +219,7 @@
if (res.statusCode == 401) { if (res.statusCode == 401) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/login/index' url: '/pages/login/wxlogin'
}) })
return return
} }
...@@ -289,7 +288,7 @@ ...@@ -289,7 +288,7 @@
uni.hideLoading() uni.hideLoading()
if (res.statusCode == 401) { if (res.statusCode == 401) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/login/index' url: '/pages/login/wxlogin'
}) })
return return
} }
...@@ -452,7 +451,7 @@ ...@@ -452,7 +451,7 @@
if (res.statusCode == 401) { if (res.statusCode == 401) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/login/index' url: '/pages/login/wxlogin'
}) })
return return
} }
......
...@@ -156,7 +156,7 @@ export default { ...@@ -156,7 +156,7 @@ export default {
// 后台自动判断入驻流程是否完成,前台通过status确定状态 // 后台自动判断入驻流程是否完成,前台通过status确定状态
if (result && result.record) { if (result && result.record) {
vm.loaded = true; vm.loaded = true;
vm.status = result.record.status; vm.status = Number(result.record.status);
// vm.status = 1 // vm.status = 1
} }
}; };
......
<template> <template>
<view> <view class="learn-vedio">
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
<view><video object-fit="cover" class="course-video" id="courseVideo" :src="courseSrc" @error="videoErrorCallback" controls></video></view> <view><video object-fit="cover" class="course-video" id="courseVideo" :src="courseSrc"
<uni-group> @error="videoErrorCallback" controls></video></view>
<view class="course-title">{{ courseTitle }}</view> <view class="title-content">
<view class="course-desc">{{ courseDesc }}</view> <view class="item-content">
</uni-group> <view class="item-st">
<text class="item-st-text">{{courseTitle.split(' ') ? courseTitle.split(' ')[0] : ''}}</text>
</view>
<view class="item-title">{{courseTitle.split(' ') ? courseTitle.split(' ')[1] : ''}}</view>
</view>
<view>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</view>
</view>
<view class="learn-view">
<view class="learn-view-title">内容大纲</view>
<view class="learn-list" v-for="(item, key) in courseOutline" :key="key">
<view class="learn-list-item">{{item}}</view>
<view class="line-view"></view>
</view>
</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
let app = getApp(); let app = getApp();
export default { export default {
data() { data() {
return { return {
courseId: '', courseId: '',
...@@ -20,14 +33,15 @@ export default { ...@@ -20,14 +33,15 @@ export default {
courseSrc: '', courseSrc: '',
courseTitle: '', courseTitle: '',
courseDesc: '', courseDesc: '',
courseOutline: ['1 aaa', '2 bbb'] // 视频大纲
}; };
}, },
onLoad(e) { onLoad(e) {
if (e) { if (e) {
if(e.courseId) { if (e.courseId) {
this.courseId = e.courseId; this.courseId = e.courseId;
} }
if(e.id) { if (e.id) {
this.courseId = e.courseId; this.courseId = e.courseId;
this.courseSrc = app.globalData.service_standard[e.id].url; this.courseSrc = app.globalData.service_standard[e.id].url;
this.courseTitle = app.globalData.service_standard[e.id].title; this.courseTitle = app.globalData.service_standard[e.id].title;
...@@ -35,7 +49,7 @@ export default { ...@@ -35,7 +49,7 @@ export default {
this.changeCourseStatus(); this.changeCourseStatus();
} }
if(e.status) { if (e.status) {
this.courseStatus = e.status; this.courseStatus = e.status;
} }
} }
...@@ -63,10 +77,11 @@ export default { ...@@ -63,10 +77,11 @@ export default {
}, },
changeCourseStatus() { changeCourseStatus() {
let that = this let that = this
if(that.courseId) { if (that.courseId) {
that.$u.api.saveCourseRate({courseId: that.courseId}).then(res => { that.$u.api.saveCourseRate({
debugger courseId: that.courseId
if(res.code == 200) { }).then(res => {
if (res.code == 200) {
// uni.navigateBack({delta: 1}) // uni.navigateBack({delta: 1})
uni.navigateTo({ uni.navigateTo({
url: "/pages/learn/exam" url: "/pages/learn/exam"
...@@ -77,7 +92,7 @@ export default { ...@@ -77,7 +92,7 @@ export default {
title: "更新课程状态失败" title: "更新课程状态失败"
}) })
} }
}).catch(e=> { }).catch(e => {
}) })
} else { } else {
...@@ -87,19 +102,118 @@ export default { ...@@ -87,19 +102,118 @@ export default {
} }
}, },
} }
}; };
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.course-video { .learn-vedio {
width: 750rpx; background-color: #F4F5F7;
} position: absolute;
.course-title { top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.course-video {
width: 100%;
}
.course-title {
font-size: 36rpx; font-size: 36rpx;
font-weight: 700; font-weight: 700;
padding: 80rpx 60rpx 40rpx 60rpx; padding: 80rpx 60rpx 40rpx 60rpx;
} }
.course-desc {
.course-desc {
margin-left: 60rpx; margin-left: 60rpx;
}
.title-content {
padding: 40rpx 30rpx;
margin-bottom: 20rpx;
background-color: #FFFFFF;
color: #999999;
font-size: 24rpx;
.item-content {
display: flex;
}
.item-st {
width: 80rpx;
height: 36rpx;
background-image: linear-gradient(to right, #FF930D, #FFC174);
font-size: 16rpx;
border-radius: 6rpx 36rpx 36rpx 6rpx;
padding-top: 8rpx;
padding-right: 2rpx;
text-align: center;
margin-right: 20rpx;
.item-st-text {
color: #FFFFFF;
}
}
.item-title {
color: #333333;
font-size: 28rpx;
}
}
.item-content {
display: flex;
padding-bottom: 30rpx;
}
.item-st {
width: 80rpx;
height: 36rpx;
background-image: linear-gradient(to right, #FF930D, #FFC174);
font-size: 16rpx;
border-radius: 6rpx 36rpx 36rpx 6rpx;
padding-top: 8rpx;
padding-right: 2rpx;
text-align: center;
margin-right: 20rpx;
}
.item-title {
color: #333333;
font-size: 28rpx;
}
.learn-view {
background-color: #FFFFFF;
border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx;
margin-bottom: 20rpx;
font-size: 32rpx;
color: #333333;
.learn-view-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 10rpx;
} }
.learn-list {
.learn-list-item {
font: 24rpx;
margin-top: 30rpx;
margin-bottom: 30rpx;
}
.line-view {
background-color: #F4F5F7;
height: 2rpx;
width: 100%;
}
}
}
</style> </style>
<template> <template>
<view class="exam-wrap"> <view class="exam-wrap">
<Settle :index="3"> <Settle :index="3">
<view class="exam-tips"><u-alert-tips :show-icon="true" class="exam-tips" type="warning" :title="tipsTitle" :description="tipsDescription"></u-alert-tips></view> <view class="tip-text">
<image class="tip-image" mode="widthFix" src="../../static/settle/tips1@3x.png"></image>
<text>接单教程可让您快速了解如何使用小程序,建议先查看并学习教程。</text>
</view>
<view class="learn-view">
<view class="learn-view-title">接单操作须知</view>
<view class="learn-list" v-for="(item, key) in tutorials" :key="key">
<view class="learn-list-item">
<view class="item-content">
<view class="item-st"><text
class="item-st-text">{{item.title.split(' ') ? item.title.split(' ')[0] : ''}}</text>
</view>
<view class="item-title">{{item.title.split(' ') ? item.title.split(' ')[1] : ''}}</view>
</view>
<u-button v-if="item.status" type="default" hover-class="none" shape="circle"
:custom-style="learnedStyle" @click="viewCourse(item)">已学习</u-button>
<u-button v-else type="'primary" plain="true" hover-class="none" shape="circle"
:custom-style="learnStyle" @click="viewCourse(item)">去学习</u-button>
</view>
<view class="line-view"></view>
</view>
</view>
<view class="tip-bottom">
<view class="learn-view-title">接单操作考试</view>
<view class="tip-bottom-t">系统随机出20道选择题,每题5分,及格为70分,分数不及格将影响接单。考题来自接单操作须知,请务必认真查看及学习,以便快速通过考试。</view>
<view class="tip-bottom-h">希望您认真对待,祝您能顺利通过考试!</view>
</view>
<!-- <view class="exam-tips">
<u-alert-tips :show-icon="true" class="exam-tips" type="warning" :title="tipsTitle"
:description="tipsDescription"></u-alert-tips>
</view>
<view class="exam-course"> <view class="exam-course">
<u-card margin="20rpx 0rpx 30rpx 0rpx" :border="false" :border-radius="cardRadius"> <u-card margin="20rpx 0rpx 30rpx 0rpx" :border="false" :border-radius="cardRadius">
<view class="exam-head" slot="head">师傅接单教程</view> <view class="exam-head" slot="head">师傅接单教程</view>
<view class="exam-body" slot="body"> <view class="exam-body" slot="body">
<u-cell-group :border="false"> <u-cell-group :border="false">
<u-cell-item <u-cell-item v-for="(item, key) in tutorials" :key="key" icon="play-circle"
v-for="(item, key) in tutorials" :border-bottom="false" :title="item.title" :value="item.value"
:key="key" :value-style="item.courseActive" @click="viewCourse(item)"></u-cell-item>
icon="play-circle"
:border-bottom="false"
:title="item.title"
:value="item.value"
:value-style="item.courseActive"
@click="viewCourse(item)"
></u-cell-item>
</u-cell-group> </u-cell-group>
</view> </view>
</u-card> </u-card>
...@@ -30,18 +54,21 @@ ...@@ -30,18 +54,21 @@
</uni-group> </uni-group>
</u-card> </u-card>
</view> </view>
<view class="content-gap"></view> <view class="content-gap"></view> -->
</Settle> <template v-slot:bottom>
<view class="bottom-fix-btn"> <view class="btn-wrap">
<view class="btn-block"><u-button type="primary" shape="circle">去考试</u-button></view> <u-button type="primary" :custom-style="buttonStyle" shape="circle" @click="handleClick">去考试</u-button>
</view> </view>
</template>
</Settle>
</view> </view>
</template> </template>
<script> <script>
import Settle from '@/components/settle/index.vue'; import Settle from '@/components/settle/index.vue';
let app = getApp() let app = getApp()
export default { export default {
components: { components: {
Settle Settle
}, },
...@@ -50,23 +77,73 @@ export default { ...@@ -50,23 +77,73 @@ export default {
cardRadius: 12, cardRadius: 12,
tipsTitle: '提示:', tipsTitle: '提示:',
// 简单使用固定培训视频 // 简单使用固定培训视频
tutorials: [ tutorials: [{
{ id: 'Course1', courseId: 1, title: '', value: '已查看', courseActive: {}, status: 1, url: ''}, id: 'Course1',
{ id: 'Course2', courseId: 2, title: '', value: '未查看', courseActive: {}, status: 0, url: ''}, courseId: 1,
{ id: 'Course3', courseId: 3, title: '', value: '未查看', courseActive: {}, status: 0, url: ''} title: '',
value: '已学习',
courseActive: {},
status: 1,
url: ''
},
{
id: 'Course2',
courseId: 2,
title: '',
value: '去学习',
courseActive: {},
status: 0,
url: ''
},
{
id: 'Course3',
courseId: 3,
title: '',
value: '去学习',
courseActive: {},
status: 0,
url: ''
}
], ],
tipsDescription: '接单考核可让您快速了解如何使用小程序,建议先查看学习教程' tipsDescription: '接单考核可让您快速了解如何使用小程序,建议先查看学习教程'
}; };
}, },
computed: { computed: {
learnStyle() {
return {
'color': '#2272FF',
'width': '120rpx',
'height': '48rpx',
'background-color': '#FFFFFF',
'font-size': '24rpx'
}
},
learnedStyle() {
return {
'color': '#999999',
'width': '120rpx',
'height': '48rpx',
'background-color': '#FFFFFF',
'font-size': '24rpx'
}
},
buttonStyle() {
return {
'color': '#FFFFFF',
'width': '500rpx',
'height': '112rpx',
'background-color': '#2272FF',
'font-size': '32rpx',
'font-weight': 'bold'
}
}
}, },
onLoad() { onLoad() {
this.tutorials.map((item, key) => { this.tutorials.map((item, key) => {
item['url'] = app.globalData.service_standard[item.id].url item['url'] = app.globalData.service_standard[item.id].url
item['title'] = app.globalData.service_standard[item.id].title item['title'] = app.globalData.service_standard[item.id].title
item['value'] = item['status'] ? '已查看' : '未查看'; item['value'] = item['status'] ? '已学习' : '去学习'
item['courseActive'] = item['status'] ? {"color": "#2979ff"} : {"color": "#ff0000"} item['courseActive'] = item['status'] ? this.learnStyle : this.learnedStyle
}) })
this.loadLearnData(); this.loadLearnData();
}, },
...@@ -81,8 +158,12 @@ export default { ...@@ -81,8 +158,12 @@ export default {
that.tutorials.forEach((data, i) => { that.tutorials.forEach((data, i) => {
if (results.hasOwnProperty(data.id)) { if (results.hasOwnProperty(data.id)) {
data.status = results[data.id]; data.status = results[data.id];
data.value = data.status ? '已查看' : '未查看'; data.value = data.status ? '已学习' : '去学习';
data.courseActive = data.status ? {"color": "#2979ff"} : {"color": "red"} data.courseActive = data.status ? {
"color": "#2979ff"
} : {
"color": "red"
}
that.tutorials[i] = data; that.tutorials[i] = data;
} }
}); });
...@@ -93,6 +174,11 @@ export default { ...@@ -93,6 +174,11 @@ export default {
console.log(e, 'loadLearnData'); console.log(e, 'loadLearnData');
}); });
}, },
handleClick() {
uni.navigateTo({
url: '/pages/exam/index'
})
},
viewCourse(e) { viewCourse(e) {
let that = this; let that = this;
let params = `id=${e.id}&courseId=${e.courseId}&status=${e.status}` let params = `id=${e.id}&courseId=${e.courseId}&status=${e.status}`
...@@ -101,11 +187,11 @@ export default { ...@@ -101,11 +187,11 @@ export default {
}) })
}, },
} }
}; };
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.exam-tips .u-alert-tips { .exam-tips .u-alert-tips {
border-radius: 12rpx !important; border-radius: 12rpx !important;
border: none !important; border: none !important;
...@@ -113,18 +199,116 @@ export default { ...@@ -113,18 +199,116 @@ export default {
font-size: 28rpx !important; font-size: 28rpx !important;
font-weight: bold; font-weight: bold;
} }
} }
.exam-wrap {
background: #f4f5f7; .exam-wrap {
} background-color: #F4F5F7;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.exam-head { .exam-head {
font-size: 36rpx; font-size: 36rpx;
font-weight: bold; font-weight: bold;
} }
.content-gap { .content-gap {
height: 1rpx; height: 1rpx;
margin-bottom: 200rpx; margin-bottom: 200rpx;
} }
.tip-text {
background-color: #FFFFFF;
border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx;
height: 140rpx;
margin-bottom: 20rpx;
font-size: 24rpx;
color: #000000;
display: flex;
align-items: flex-start;
}
.tip-image {
width: 28rpx;
margin-right: 10rpx;
margin-top: 2rpx;
}
.learn-view-title {
font-size: 32rpx;
color: #333333;
font-weight: bold;
}
.tip-bottom {
background-color: #FFFFFF;
border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx;
margin-bottom: 20rpx;
font-size: 28rpx;
color: #333333;
margin-bottom: 188rpx;
.tip-bottom-h {
font-size: 24rpx;
color: #999999;
}
.tip-bottom-t {
margin-top: 30rpx;
margin-bottom: 20rpx;
}
}
.learn-view {
background-color: #FFFFFF;
border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx;
margin-bottom: 20rpx;
font-size: 32rpx;
color: #333333;
.learn-list {
.learn-list-item {
display: flex;
justify-content: space-between;
margin-top: 30rpx;
margin-bottom: 30rpx;
.item-content {
display: flex;
}
.item-st {
width: 80rpx;
height: 36rpx;
background-image: linear-gradient(to right, #FF930D, #FFC174);
font-size: 16rpx;
border-radius: 6rpx 36rpx 36rpx 6rpx;
padding-top: 8rpx;
padding-right: 2rpx;
text-align: center;
margin-right: 20rpx;
.item-st-text {
color: #FFFFFF;
}
}
.item-title {
color: #333333;
font-size: 28rpx;
}
}
.line-view {
background-color: #F4F5F7;
height: 2rpx;
width: 100%;
}
}
}
</style> </style>
...@@ -103,7 +103,6 @@ export default { ...@@ -103,7 +103,6 @@ export default {
signupLogin(e) { signupLogin(e) {
var that = this var that = this
debugger
console.log(e.detail.errMsg) console.log(e.detail.errMsg)
console.log(e.detail.iv) console.log(e.detail.iv)
console.log(e.detail.encryptedData) console.log(e.detail.encryptedData)
......
...@@ -9,53 +9,60 @@ ...@@ -9,53 +9,60 @@
<view class="u-menu-wrap"> <view class="u-menu-wrap">
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop" <scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop"
:scroll-into-view="itemId"> :scroll-into-view="itemId">
<view v-for="(item,index) in tabbar" :key="index" class="u-tab-item" <view v-for="(item,index) in groupList" :key="index" class="u-tab-item"
:class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)"> :class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
<text class="u-line-1">{{item.name}}</text> <text class="u-line-1">{{item.groupName}}</text>
</view> </view>
</scroll-view> </scroll-view>
<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box" <scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box"
@scroll="rightScroll"> @scroll="rightScroll">
<!-- <form-com :item="tabbar"></form-com> -->
<u-form :model="form" ref="uForm"> <u-form :model="form" ref="uForm">
<template v-for="(groupItem,index) in tabbar"> <template v-for="(groupItem,groupIndex) in groupList">
<view class="class-item" :key="index"> <view class="class-item" :key="groupIndex">
<view class="title">{{groupItem.name}}</view> <view class="title">{{groupItem.groupName}}</view>
<view class="class-bd"> <view class="class-bd">
<u-form-item :label-width="0" :required="groupItem.required" <u-form-item v-for="(item,itemIndex) in groupItem.item" :key="itemIndex"
v-for="(item,itemIndex) in groupItem.foods" :key="itemIndex"> :prop="item.fieldsName">
<!-- <view :key="index"> --> <view class="label" @click="nextStep(item)">
<view>{{item.name}}</view> <text class="required" v-if="item.required">*</text>
<xh-input></xh-input> {{item.fieldsTitle}}
<!-- <xh-input :item="item" v-if="item.fieldsType==='input'"></xh-input> --> </view>
<!-- </view> --> <template v-if="item.fieldsType">
<xh-input v-if="item.fieldsType==='input'" :groupIndex="groupIndex"
:itemIndex="itemIndex" :item="item" @value-change="fieldValueChange">
</xh-input>
<xh-radio v-if="item.fieldsType==='radio'" :groupIndex="groupIndex"
:itemIndex="itemIndex" :item="item" @value-change="fieldValueChange">
</xh-radio>
<xh-checkbox v-if="item.fieldsType==='checkbox'" :groupIndex="groupIndex"
:itemIndex="itemIndex" :item="item" @value-change="fieldValueChange">
</xh-checkbox>
<xh-select v-if="item.fieldsType==='select'" :groupIndex="groupIndex"
:itemIndex="itemIndex" :item="item" @value-change="fieldValueChange">
</xh-select>
<xh-files v-if="item.fieldsType==='file'" :groupIndex="groupIndex"
:itemIndex="itemIndex" :item="item" @value-change="fieldValueChange">
</xh-files>
</template>
</u-form-item> </u-form-item>
</view> </view>
</view> </view>
</template> </template>
</u-form> </u-form>
<!-- <xh-input></xh-input> -->
<!-- <view class="page-view">
<view class="class-item" :id="'item' + index" v-for="(item , index) in tabbar" :key="index">
<view class="item-title">
<text>{{item.name}}</text>
</view>
<view class="item-container">
<view class="thumb-box" v-for="(item1, index1) in item.foods" :key="index1">
<image class="item-menu-image" :src="item1.icon" mode=""></image>
<view class="item-menu-name">{{item1.name}}</view>
</view>
</view>
</view>
</view> -->
</scroll-view> </scroll-view>
</view> </view>
<view @click="nextStep">下一步</view>
</view> </view>
</template> </template>
<script> <script>
import classifyData from '@/common/classify.data.js'; import classifyData from '@/common/classify.data.js';
// import formCom from './components/formCom.vue'
import XhInput from '@/components/createCom/XhInput.vue' import XhInput from '@/components/createCom/XhInput.vue'
import XhRadio from '@/components/createCom/XhRadio.vue'
import XhCheckbox from '@/components/createCom/XhCheckbox.vue'
import XhSelect from '@/components/createCom/XhSelect.vue'
import XhFiles from '@/components/createCom/XhFiles.vue'
// import XhRadio from '@/components/createCom/XhRadio.vue'
export default { export default {
data() { data() {
return { return {
...@@ -65,16 +72,50 @@ ...@@ -65,16 +72,50 @@
menuHeight: 0, // 左边菜单的高度 menuHeight: 0, // 左边菜单的高度
menuItemHeight: 0, // 左边菜单item的高度 menuItemHeight: 0, // 左边菜单item的高度
itemId: '', // 栏目右边scroll-view用于滚动的id itemId: '', // 栏目右边scroll-view用于滚动的id
tabbar: classifyData, groupList: classifyData, // 基本信息、安装 、勘察(其中一项表单数据)
menuItemPos: [], menuItemPos: [],
arr: [], arr: [],
scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度 scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
timer: null, // 定时器 timer: null, // 定时器
form: { // 一维表单
name: 'name',
radio: ''
},
rules: {
name: [{
required: true,
min: 10,
message: '姓名不能为空',
// 可以单个或者同时写两个触发验证方式
trigger: ['change', 'blur'],
}],
mobile: [{
required: true,
min: 10,
message: '姓名不能为空',
// 可以单个或者同时写两个触发验证方式
trigger: ['change', 'blur'],
}, {
// 自定义验证函数,见上说明
validator: (rule, value, callback) => {
// 上面有说,返回true表示校验通过,返回false表示不通过
// this.$u.test.mobile()就是返回true或者false的
return this.$u.test.mobile(value);
},
message: '手机号码不正确',
// 触发器可以同时用blur和change
trigger: ['change', 'blur'],
}]
}
} }
}, },
components: { components: {
'xh-input': XhInput, XhInput,
XhRadio,
XhCheckbox,
XhSelect,
XhFiles
// formCom
}, },
created() { created() {
// console.log(allComponents,'allComponents') // console.log(allComponents,'allComponents')
...@@ -83,9 +124,33 @@ ...@@ -83,9 +124,33 @@
}, },
onReady() { onReady() {
this.$refs.uForm.setRules(this.rules);
// 导航栏滚动切换
this.getMenuItemTop() this.getMenuItemTop()
}, },
updated() {
console.log(this.form.name, 'form.name')
},
methods: { methods: {
// 字段的值更新
fieldValueChange(data) {
// data.groupIndex data.itemIndex值下标 data.value //值
console.log(data, 'data')
const groupItem = this.groupList[data.groupIndex]
let innerItem
if (groupItem.item) {
innerItem = groupItem.item[data.itemIndex]
}
console.log(innerItem, 'innerItem')
this.form[innerItem.fieldsName] = data.value
console.log(this.form, 'this.form')
},
nextStep(item) {
// 下一步
console.log(item, 'item')
},
// ------------------------- 以下方法为展示滚动切换 -------------------------
// 点击左边的栏目切换 // 点击左边的栏目切换
async swichMenu(index) { async swichMenu(index) {
if (this.arr.length == 0) { if (this.arr.length == 0) {
...@@ -196,6 +261,35 @@ ...@@ -196,6 +261,35 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// ---------------------------- 表单样式begin ----------------------------
/deep/ .u-form-item {
.u-form-item__message {
padding-left: 0 !important;
}
.u-form-item--left__content--required {
vertical-align: top;
}
}
.class-item {
.label {
color: #333;
font-size: 28rpx;
line-height: 40rpx;
}
.required {
padding-right: 10rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #fa3534;
}
}
// ---------------------------- 表单样式end ----------------------------
.u-wrap { .u-wrap {
height: calc(100vh); height: calc(100vh);
/* #ifdef H5 */ /* #ifdef H5 */
......
<!-- 实现动态组件的绑定 -->
<template>
<view class="group-list">
书籍及
<u-form :model="form" ref="uForm">
<template v-for="(groupItem,index) in group">
<view class="group-item">
<view class="group-title" :key="index">{{groupItem.name}}</view>
<view class="group-items" :key="index">
<u-form-item :label-width="0" :required="item.required"
v-for="(item,itemIndex) in groupItem.foods" :key="index">
<!-- <view :key="index"> -->
<view>{{item.name}}</view>
<xh-input></xh-input>
<!-- <xh-input :item="item" v-if="item.fieldsType==='input'"></xh-input> -->
<!-- </view> -->
</u-form-item>
</view>
</view>
</template>
</u-form>
</view>
</template>
<script>
// import {
// // XhInput,
// // XhSelect,
// // XhMultipleSelect,
// // XhFiles,
// // XhSwitch,
// // XhTextarea,
// // XhServiceMore,
// // XhDate
// } from '@/components/createCom/index.js'
import XhInput from '@/components/createCom/XhInput.vue'
export default {
components: {
'xh-input': XhInput,
},
props: {
item: {
type: Array,
default () {
return []
}
},
},
watch:{
"item":function(newVal){
this.group = newVal
console.log(this.group,'this.group')
}
},
data() {
return {
list: [{
fieldsId: '产品规格',
fieldsType: 'input',
fieldsName: '产品规格',
fieldsValue: '',
required: true,
fields_options: [{
key: '',
label: ''
}]
},],
// 完工信息的不同项
group: [{
groupName: '接入点信息',
item: [{
fieldsId: '基础信息',
fieldsType: 'input',
fieldsName: '产品规格',
fieldsValue: '',
required: true,
fields_options: [{
key: '',
label: ''
}]
},]
}],
configList: [{
panelName: '',
panelType: '',
group: [{
groupName: '接入点信息',
item: [{
fieldsId: '基础信息',
fieldsType: 'input',
fieldsName: '',
fieldsValue: '',
required: true,
fields_options: [{
key: '',
label: ''
}]
}]
}]
}],
form: {
name: '',
intro: '',
sex: ''
},
checkboxList: [{
name: '苹果',
checked: false,
disabled: false
},
{
name: '雪梨',
checked: false,
disabled: false
},
{
name: '柠檬',
checked: false,
disabled: false
}
],
radioList: [{
name: '鲜甜',
disabled: false
},
{
name: '麻辣',
disabled: false
}
],
radio: '',
switchVal: false
}
},
created() {
this.group = this.item
console.log(this.group,'this.group')
console.log(XhInput, 'XhInput')
}
}
</script>
<style lang="scss" scoped>
.group-list{
.group-item{
}
}
</style>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<u-icon name="arrow-right" color="#2272FF" size="28"></u-icon> <u-icon name="arrow-right" color="#2272FF" size="28"></u-icon>
</view> </view>
<view class="tips">可以服务的城市,可选多个</view> <view class="tips">可以服务的城市,可选多个</view>
<view v-if=""> <view v-if="cityText">
<view class="line-view-d"></view> <view class="line-view-d"></view>
<view class="city-text">{{cityText}}</view> <view class="city-text">{{cityText}}</view>
</view> </view>
......
...@@ -458,8 +458,8 @@ export default { ...@@ -458,8 +458,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page-content { .page-content {
background-color: #f4f5f7; background-color: #F4F5F7;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
...@@ -467,9 +467,9 @@ export default { ...@@ -467,9 +467,9 @@ export default {
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.base-list { .base-list {
.item { .item {
display: flex; display: flex;
margin-bottom: 58rpx; margin-bottom: 58rpx;
...@@ -508,7 +508,7 @@ export default { ...@@ -508,7 +508,7 @@ export default {
font-size: 28rpx; font-size: 28rpx;
color: #666; color: #666;
& + .id-identity-box { &+.id-identity-box {
margin-top: -38rpx; margin-top: -38rpx;
margin-bottom: 40rpx; margin-bottom: 40rpx;
} }
...@@ -534,9 +534,10 @@ export default { ...@@ -534,9 +534,10 @@ export default {
// &.tips{ // &.tips{
// margin-bottom:0!important; // margin-bottom:0!important;
// } // }
} }
.item + .tips { .item+.tips {
margin-top: -38rpx; margin-top: -38rpx;
margin-bottom: 58rpx; margin-bottom: 58rpx;
} }
...@@ -597,10 +598,10 @@ export default { ...@@ -597,10 +598,10 @@ export default {
font-weight: 400; font-weight: 400;
} }
} }
} }
.tip-text { .tip-text {
background-color: #ffffff; background-color: #FFFFFF;
border-radius: 12rpx; border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx; padding: 38rpx 30rpx 30rpx 30rpx;
height: 140rpx; height: 140rpx;
...@@ -609,35 +610,35 @@ export default { ...@@ -609,35 +610,35 @@ export default {
color: #000000; color: #000000;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
} }
.tip-image { .tip-image {
width: 34rpx; width: 34rpx;
margin-right: 8rpx; margin-right: 8rpx;
margin-top: 2rpx; margin-top: 2rpx;
} }
.bottom-tip-view { .bottom-tip-view {
color: #999999; color: #999999;
font-size: 20rpx; font-size: 20rpx;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
margin-top: 30rpx; margin-top: 30rpx;
} }
.bottom-tip-image { .bottom-tip-image {
width: 24rpx; width: 24rpx;
height: 24rpx; height: 24rpx;
margin-right: 8rpx; margin-right: 8rpx;
margin-top: 4rpx; margin-top: 4rpx;
} }
.seat { .seat {
padding-bottom: 144rpx; padding-bottom: 144rpx;
} }
/*提交按钮*/ /*提交按钮*/
.btn-wrap { .btn-wrap {
width: 100%; width: 100%;
.btn-submit { .btn-submit {
...@@ -645,17 +646,17 @@ export default { ...@@ -645,17 +646,17 @@ export default {
height: 104rpx; height: 104rpx;
line-height: 104rpx; line-height: 104rpx;
border-radius: 52rpx; border-radius: 52rpx;
background: #2272ff; background: #2272FF;
font-size: 32rpx; font-size: 32rpx;
color: #fff; color: #fff;
&[disabled] { &[disabled] {
background-color: #d1d4d4; background-color: #D1D4D4;
color: #ffffff; color: #FFFFFF;
} }
} }
} }
.card-info-view { .card-info-view {
margin-top: 30rpx; margin-top: 30rpx;
.card-list-view { .card-list-view {
.card-list-item { .card-list-item {
...@@ -671,22 +672,22 @@ export default { ...@@ -671,22 +672,22 @@ export default {
} }
} }
.line-view { .line-view {
background-color: #f4f5f7; background-color: #F4F5F7;
height: 2rpx; height: 2rpx;
width: 100%; width: 100%;
} }
.card-item-error { .card-item-error{
color: red; color: red;
font-size: 20rpx; font-size: 20rpx;
} }
} }
} }
.info-view { .info-view {
margin-bottom: 188rpx; margin-bottom: 188rpx;
.title-view { .title-view {
background-color: #ffffff; background-color: #FFFFFF;
border-radius: 12rpx; border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx; padding: 38rpx 30rpx 30rpx 30rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
...@@ -716,5 +717,5 @@ export default { ...@@ -716,5 +717,5 @@ export default {
height: 226rpx; height: 226rpx;
} }
} }
} }
</style> </style>
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
this.jumpJudge() this.jumpJudge()
}, },
jumpJudge() { jumpJudge() {
if (this.status > 0) { if (Number(this.status) > 0) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/settle/prompt' url: '/pages/settle/prompt'
}) })
......
<template> <template>
<view class="content"> <view class="content">
<Settle :index="5">
<view class="base-list"> <view class="base-list">
<view class="title">充电桩安装需缴纳设备押金</view> <view class="title">充电桩安装需缴纳设备押金</view>
<view class="price"><text>¥</text>{{settledInfo.record.deposit}}</view> <view class="price"><text>¥ </text>{{settledInfo.record.deposit}}</view>
<view class="list"> <view class="list">
<view class="item u-flex u-row-between"> <view class="item u-flex u-row-between">
<view class="txt">您已缴纳金额</view> <view class="txt">您已缴纳金额</view>
<view class="txt">¥ 0.00</view> <view class="txt-value">¥ 0.00</view>
</view> </view>
<view class="line-view"></view>
<view class="item u-flex u-row-between"> <view class="item u-flex u-row-between">
<view class="txt">待缴纳金额</view> <view class="txt">待缴纳金额</view>
<view class="txt">¥ {{settledInfo.record.deposit}}</view> <view class="txt-value">¥ {{settledInfo.record.deposit}}</view>
</view> </view>
</view> </view>
<!-- <view class="tips">你已缴纳金额:1000.00元</view> <!-- <view class="tips">你已缴纳金额:1000.00元</view>
<view class="tips">充电桩安装需缴纳保证金:1000元待缴金额:1000元</view> --> <view class="tips">充电桩安装需缴纳保证金:1000元待缴金额:1000元</view> -->
</view> </view>
<view class="seat"></view>
<template v-slot:bottom>
<view class="btn-wrap flex-xc"> <view class="btn-wrap flex-xc">
<button class="btn-submit" :disabled="saving" @click="paySubmit"> <button class="btn-submit" :disabled="saving" @click="paySubmit">
{{saving ? '支付中……' : '微信支付'}} <image class="button-image" mode="widthFix" src="../../static/settle/weixin@3x.png"></image>
<text>{{saving ? '支付中……' : '微信支付'}}</text>
</button> </button>
</view> </view>
</template>
</Settle>
</view> </view>
</template> </template>
<script> <script>
import Settle from '@/components/settle/index.vue'
import pingpp from '@/include/libs/pingpp.js' import pingpp from '@/include/libs/pingpp.js'
const globalUrl = process.uniEnv || {} const globalUrl = process.uniEnv || {}
import util from '@/utils/util.js' import util from '@/utils/util.js'
export default { export default {
components: {
Settle
},
data() { data() {
return { return {
saving: false, saving: false,
paySuccess:false, paySuccess: false,
payResult:{ payResult: {
oid:'' oid: ''
},
isRefresh: false,
settledInfo: {
record: {
deposit: ''
}
}, },
isRefresh:false,
settledInfo:null,
} }
}, },
onLoad(e) { onLoad(e) {
}, },
onShow(){ onShow() {
if(!this.settledInfo){ if (!this.settledInfo.record.deposit) {
this.getBaseInfo() this.getBaseInfo()
} }
}, },
computed: {}, computed: {},
watch:{ watch: {
isRefresh(val){ isRefresh(val) {
this.getBaseInfo() this.getBaseInfo()
} }
}, },
...@@ -59,42 +73,42 @@ ...@@ -59,42 +73,42 @@
}, },
methods: { methods: {
successCallback(){ successCallback() {
uni.navigateTo({ uni.navigateTo({
url:'/pages/settle/prompt' url: '/pages/settle/prompt'
}) })
}, },
async getBaseInfo(){ async getBaseInfo() {
const app = getApp() const app = getApp()
const callBack = (vm,result)=>{ const callBack = (vm, result) => {
vm.settledInfo = result vm.settledInfo = result
} }
let settledInfo = app.globalData.settledInfo let settledInfo = app.globalData.settledInfo
if(settledInfo){ if (settledInfo) {
callBack(this,settledInfo) callBack(this, settledInfo)
return return
} }
await app.getBaseInfo(this,callBack) await app.getBaseInfo(this, callBack)
}, },
async pending(){ async pending() {
// const timer = setTimeout(async ()=>{ // const timer = setTimeout(async ()=>{
// clearTimeout(timer) // clearTimeout(timer)
const params = { const params = {
...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.status !== true) {
this.saving = false this.saving = false
return return
} }
uni.showToast({ uni.showToast({
title:'支付成功', title: '支付成功',
}) })
let timer = setTimeout(()=>{ let timer = setTimeout(() => {
clearTimeout(timer) clearTimeout(timer)
this.successCallback() this.successCallback()
},3000) }, 3000)
}, },
getCode: async function() { getCode: async function() {
let that = this let that = this
...@@ -127,33 +141,33 @@ ...@@ -127,33 +141,33 @@
const self = this const self = this
this.saving = true this.saving = true
uni.showLoading({ uni.showLoading({
title:'支付中……' title: '支付中……'
}) })
// 提交支付订单 // 提交支付订单
const code = await this.getCode() const code = await this.getCode()
const params = { const params = {
oid: this.settledInfo.record.id, oid: this.settledInfo.record.id,
type: 'wx_lite', type: 'wx_lite',
openid:util.getOpenid(), openid: util.getOpenid(),
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) { if (response.status !== true) {
uni.showToast({ uni.showToast({
title: response.message, title: response.message,
icon:'none' icon: 'none'
}) })
return return
} }
let timer = setTimeout(res=>{ let timer = setTimeout(res => {
clearTimeout(timer) clearTimeout(timer)
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '支付结果', content: '支付结果',
confirmText:'成功', confirmText: '成功',
cancelText:'失败', cancelText: '失败',
success: function (res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
// console.log(res.confirm,'res.confirm') // console.log(res.confirm,'res.confirm')
self.pending() self.pending()
...@@ -163,7 +177,7 @@ ...@@ -163,7 +177,7 @@
} }
} }
}); });
},1000) }, 1000)
const { const {
charge, charge,
...@@ -177,7 +191,7 @@ ...@@ -177,7 +191,7 @@
// 支付成功的结果会在这里返回,其他的支付结果都会跳转到 extra 中对应的 URL。 // 支付成功的结果会在这里返回,其他的支付结果都会跳转到 extra 中对应的 URL。
uni.showToast({ uni.showToast({
title: '支付成功', title: '支付成功',
icon:'none' icon: 'none'
}) })
} else if (result == "fail") { } else if (result == "fail") {
// charge 不正确或者微信公众账号/QQ 公众号/支付宝口碑支付失败时会在此处返回 // charge 不正确或者微信公众账号/QQ 公众号/支付宝口碑支付失败时会在此处返回
...@@ -186,7 +200,7 @@ ...@@ -186,7 +200,7 @@
// 微信公众账号、QQ 公众号、支付宝口碑支付取消支付 // 微信公众账号、QQ 公众号、支付宝口碑支付取消支付
uni.showToast({ uni.showToast({
title: '您已经取消了支付', title: '您已经取消了支付',
icon:'none' icon: 'none'
}) })
} }
}); });
...@@ -195,45 +209,80 @@ ...@@ -195,45 +209,80 @@
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.content {
background-color: #F4F5F7;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.base-list { .base-list {
background-color: #FFFFFF;
border-radius: 12rpx;
padding: 30rpx;
min-height: 160rpx;
margin-bottom: 188rpx;
text-align: center; text-align: center;
.txt{
.txt {
line-height: 50rpx; line-height: 50rpx;
font-size:36rpx; font-size: 36rpx;
color: #333; color: #333;
} }
.title{
margin-top:120rpx; .title {
margin-top: 80rpx;
font-weight: bold; font-weight: bold;
line-height: 50rpx; line-height: 50rpx;
font-size:36rpx; font-size: 40rpx;
color: #333; color: #333;
} }
.price{
margin-top:120rpx; .price {
margin-top: 100rpx;
font-weight: bold; font-weight: bold;
line-height: 90rpx; line-height: 90rpx;
font-size:64rpx; font-size: 64rpx;
color: #333; color: #2272FF;
text{
font-size:32rpx; text {
font-size: 32rpx;
} }
} }
.list{
margin-top:200rpx; .list {
padding:0 50rpx; margin-top: 200rpx;
.item{ padding: 0 50rpx;
padding:28rpx 0;
border-bottom: 1rpx solid #FDFDFD; .line-view {
background-color: #F4F5F7;
height: 2rpx;
width: 100%;
}
.item {
padding: 28rpx 0;
} }
.txt{
.txt {
line-height: 44rpx; line-height: 44rpx;
font-size:32rpx; font-size: 28rpx;
color: #666666;
}
.txt-value {
line-height: 44rpx;
font-size: 28rpx;
color: #333; color: #333;
} }
} }
.tips { .tips {
margin-top: 20rpx; margin-top: 20rpx;
padding: 0 30rpx; padding: 0 30rpx;
...@@ -249,29 +298,27 @@ ...@@ -249,29 +298,27 @@
/*提交按钮*/ /*提交按钮*/
.btn-wrap { .btn-wrap {
position: fixed; width: 100%;
// margin: px2rem(36); .button-image {
left: 0; width: 38rpx;
right: 0; padding-right: 20rpx;
bottom: 0; }
padding: 30rpx 0;
background: #f3f3f3;
.btn-submit { .btn-submit {
width: 600rpx; width: 600rpx;
border-radius: 52rpx;
// left: 5%;
// bottom: px2rem(36);
height: 104rpx; height: 104rpx;
line-height: 104rpx; line-height: 104rpx;
background: #2272ff; border-radius: 52rpx;
background: #2272FF;
font-size: 32rpx; font-size: 32rpx;
color: #fff; color: #fff;
display: flex;
align-items: center;
justify-content: center;
&:disabled { &[disabled] {
border: 2rpx solid #999; background-color: #D1D4D4;
background-color: #f3f3f3; color: #FFFFFF;
color: #999;
} }
} }
} }
......
<template> <template>
<view class="container u-row-between" v-if="info"> <view class="container u-row-between" v-if="info">
<Settle :index="2"> <Settle :index="pageIndex">
<view class="content-view"> <view class="content-view">
<view class="u-flex u-row-center"> <view class="u-flex u-row-center">
<image :class="['icon', {active: status != 1}]" <image :class="['icon', {active: status != 1}]"
...@@ -8,12 +8,16 @@ ...@@ -8,12 +8,16 @@
</image> </image>
</view> </view>
<view class="txt-box"> <view class="txt-box">
<text :class="['title',index ? 'active' : '']" v-for="(txt,index) in info.txtArr">{{txt}}</text> <text :class="['title', {failed: status == 4} ,index ? 'active' : '']" v-for="(txt,index) in info.txtArr">{{txt}}</text>
</view> </view>
<view class="tips-box" v-if="info.tipsArr"> <view class="tips-box" v-if="info.tipsArr">
<text :class="['tips',info.tipsArr.length>1 && index===0 ? 'red' : '']" <text :class="['tips',info.tipsArr.length>1 && index===0 ? 'red' : '']"
v-for="(txt,index) in info.tipsArr">{{txt}}</text> v-for="(txt,index) in info.tipsArr">{{txt}}</text>
</view> </view>
<view class="services-view">
<Services/>
</view>
</view> </view>
<template v-slot:bottom> <template v-slot:bottom>
<button class="btn-submit" @click="$u.debounce(goPage, 500)">{{info.btnTxt}}</button> <button class="btn-submit" @click="$u.debounce(goPage, 500)">{{info.btnTxt}}</button>
...@@ -24,34 +28,37 @@ ...@@ -24,34 +28,37 @@
<script> <script>
import Settle from '@/components/settle/index.vue' import Settle from '@/components/settle/index.vue'
import Services from '@/components/settle/services.vue'
export default { export default {
components: { components: {
Settle Settle,
Services
}, },
data() { data() {
return { return {
pageIndex: 2,
settledInfo: null, settledInfo: null,
promptList: [{ promptList: [{
status: 1, status: 1,
statusName: '待审核', statusName: '待审核',
txtArr: ['已提交,等待审核', '正在审核中'], txtArr: ['已提交,等待审核', '正在审核中'],
btnTxt: '去接单广场逛逛', btnTxt: '去首页',
url: '/pages/take/index' url: '/pages/index/index'
}, { }, {
status: 2, status: 2,
statusName: '已通过', statusName: '已通过',
txtArr: ['恭喜,审核通过', '“充电桩安装入驻审核”'], txtArr: ['恭喜,审核通过', '“充电桩安装入驻审核”'],
btnTxt: '去考试', btnTxt: '去考试',
url: '/pages/exam/start' url: '/pages/learn/exam'
}, { }, {
status: 3, status: 3,
statusName: '备选', statusName: '备选',
txtArr: ['您已成为', "“充电桩安装备选服务商”"], txtArr: ['您已成为', "“充电桩安装备选服务商”"],
tipsArr: ['后续如有业务,请留意通知!'], tipsArr: ['后续如有业务,请留意通知!'],
btnTxt: '去接单广场逛逛', btnTxt: '去首页',
url: '/pages/take/index' url: '/pages/index/index'
}, { }, {
status: 4, status: 4,
statusName: '已驳回', statusName: '已驳回',
...@@ -77,8 +84,8 @@ ...@@ -77,8 +84,8 @@
status: 7, status: 7,
statusName: '已支付保证金', statusName: '已支付保证金',
txtArr: ['您已成为', "充电桩安装的正式服务商"], txtArr: ['您已成为', "充电桩安装的正式服务商"],
btnTxt: '去接单广场逛逛', btnTxt: '去首页',
url: '/pages/take/index' url: '/pages/index/index'
}], }],
// 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交' // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
status: '', status: '',
...@@ -93,9 +100,15 @@ ...@@ -93,9 +100,15 @@
} }
}, },
onLoad(e) { onLoad(e) {
if (e) {
if (e.pageIndex) {
this.pageIndex = e.pageIndex;
}
}
// if(!this.settledInfo){ // if(!this.settledInfo){
// this.getBaseInfo() // this.getBaseInfo()
// } // }
}, },
onShow() { onShow() {
if (!this.settledInfo) { if (!this.settledInfo) {
...@@ -149,9 +162,16 @@ ...@@ -149,9 +162,16 @@
}, },
goPage() { goPage() {
const url = this.info.url const url = this.info.url
if (this.status == 1 || this.status == 3 || this.status == 3) {
uni.reLaunch({
url,
});
} else {
uni.navigateTo({ uni.navigateTo({
url, url,
}); });
}
}, },
}, },
} }
...@@ -187,7 +207,7 @@ ...@@ -187,7 +207,7 @@
} }
.txt-box { .txt-box {
padding-bottom: 50rpx;
} }
.title { .title {
...@@ -198,29 +218,25 @@ ...@@ -198,29 +218,25 @@
font-weight: bold; font-weight: bold;
font-size: 44rpx; font-size: 44rpx;
color: #2272FF; color: #2272FF;
&.failed {
color: #FA5A49;
}
&.active { &.active {
color: #666666; color: #666666;
font-size: 24rpx; font-size: 24rpx;
font-weight: 300rpx; font-weight: 400;
margin-top: 26rpx; margin-top: 20rpx;
} }
} }
.tips-box { .tips-box {
margin-top: 32rpx; // margin-top: 32rpx;
text-align: center; text-align: center;
} }
.tips { .tips {
text-align: center; color: #666666;
line-height: 44rpx; font-size: 24rpx;
font-size: 32rpx;
color: #666;
&.red {
color: red;
}
} }
.btn-submit { .btn-submit {
...@@ -239,5 +255,10 @@ ...@@ -239,5 +255,10 @@
color: #999; color: #999;
} }
} }
.services-view {
display: flex;
justify-content: center;
padding-top: 50rpx;
}
} }
</style> </style>
This diff is collapsed.
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