Commit 14f70e2b authored by 李俊赕's avatar 李俊赕

充电桩入驻静态页面

parent 689b48c6
......@@ -7,11 +7,17 @@ let settledApiFun = function(vm){
let getSettleArea = async (params = {}) => await vm.$u.get('/v1/h5/settled/area', params);
/* 提交用户基本信息 */
let submitSettleBaseInfo = async (params = {}) => await vm.$u.get('/v1/h5/settled/save-info', params);
/* 校验身份证正面 */
let checkSettleIDCardFront = async (params = {}) => await vm.$u.get('/v1/h5/settled/card-front', params);
/* 校验身份证反面 */
let checkSettleIDCardBack = async (params = {}) => await vm.$u.get('/v1/h5/settled/card-back', params);
const settledApi = {
getSettleBaseInfo,
getSettleArea,
submitSettleBaseInfo
submitSettleBaseInfo,
checkSettleIDCardFront,
checkSettleIDCardBack,
}
return settledApi
}
......
......@@ -223,6 +223,14 @@ function js_date_time(unixtime) {
}
function randStr(len) {
const randomChars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
let result = '';
for (let i=0; i<len; i++) {
result += randomChars.charAt(Math.ceil(Math.random()*100000000) % randomChars.length);
}
return result;
}
export {
strlen,
isWeiXinBrowser,
......@@ -239,5 +247,6 @@ export {
getDynamicUrl,
getAskUrl,
dianji,
js_date_time
js_date_time,
randStr
}
import qiniuUploader from '@/include/libs/qiniuUploader.js';
export default {
name: 'upload-img',
components: {},
data() {
return {
domain: 'https://s-fa.banshouhui.com',
uptokenURL: 'http://rest-u.yunya.com/v1/tokens',
imgList: [],
uploadToken: ''
};
},
props: {
uploadVisible: {
//选择按钮是否显示
type: Boolean,
default: true,
},
selectNum: {
//选择图片的数量
type: Number,
default: 9,
},
},
computed: {
uploadBtnShow() {
let flag = this.imgList.length < this.selectNum
return flag && this.uploadVisible
}
},
created() {
this.initQiniu()
this.initImg();
},
methods: {
initQiniu: function() {
var options = {
// bucket所在区域,这里是华北区。ECN, SCN, NCN, NA, ASG,分别对应七牛云的:华东,华南,华北,北美,新加坡 5 个区域
region: 'SCN',
bucket: 'fa-cms',
qiniuBucketURLPrefix: 'uploads',
// 获取uptoken方法三选一即可,执行优先级为:uptoken > uptokenURL > uptokenFunc。三选一,剩下两个置空。推荐使用uptokenURL,详情请见 README.md
// 由其他程序生成七牛云uptoken,然后直接写入uptoken
uptoken: '',
// 从指定 url 通过 HTTP GET 获取 uptoken,返回的格式必须是 json 且包含 uptoken 字段,例如: {"uptoken": "0MLvWPnyy..."}
uptokenURL: this.uptokenURL,
// uptokenFunc 这个属性的值可以是一个用来生成uptoken的函数,详情请见 README.md
uptokenFunc: function() {
},
// bucket 外链域名,下载资源时用到。如果设置,会在 success callback 的 res 参数加上可以直接使用的 fileURL 字段。否则需要自己拼接
domain: this.domain,
// qiniuShouldUseQiniuFileName 如果是 true,则文件的 key 由 qiniu 服务器分配(全局去重)。如果是 false,则文件的 key 使用微信自动生成的 filename。出于初代sdk用户升级后兼容问题的考虑,默认是 false。
// 微信自动生成的 filename较长,导致fileURL较长。推荐使用{qiniuShouldUseQiniuFileName: true} + "通过fileURL下载文件时,自定义下载名" 的组合方式。
// 自定义上传key 需要两个条件:1. 此处shouldUseQiniuFileName值为false。 2. 通过修改qiniuUploader.upload方法传入的options参数,可以进行自定义key。(请不要直接在sdk中修改options参数,修改方法请见demo的index.js)
// 通过fileURL下载文件时,自定义下载名,请参考:七牛云“对象存储 > 产品手册 > 下载资源 > 下载设置 > 自定义资源下载名”(https://developer.qiniu.com/kodo/manual/1659/download-setting)。本sdk在README.md的"常见问题"板块中,有"通过fileURL下载文件时,自定义下载名"使用样例。
shouldUseQiniuFileName: true
};
// 将七牛云相关配置初始化进本sdk
qiniuUploader.init(options);
},
chooseImage() {
if (this.selectNum - this.imgList.length <= 0) {
uni.showToast({
title: '图片数量不能大于' + this.selectNum,
icon: 'none'
})
return
}
uni.chooseImage({
count: this.selectNum, //默认9 this.selectNum
success: (chooseImageRes) => {
for (var i = 0; i < chooseImageRes.tempFilePaths.length; i++) {
let file = chooseImageRes.tempFilePaths[i];
let index = file.lastIndexOf('/');
let len = file.length
let name = file.substring(index + 1, len)
// 交给七牛上传
let newLen = this.selectNum - this.imgList.length
let item = {
src: '',
id: '',
// filesize: '',
progress: 0
}
if (newLen > 0) {
qiniuUploader.upload(file, (res) => {
let inLen = this.selectNum - this.imgList.length
if (inLen > 0) {
item.src = file
this.imgList.push(item);
// this.addRecord(item,res)
this.$emit('image-change', this.imgList) //将图片回传父页面
} else {
uni.showToast({
title: '图片数量不能大于9'
})
}
}, (error) => {
console.log('error: ' + error);
}, null, (res) => {
// item.filesize = res.totalBytesSent
item.progress = res.progress
}, () => {
// 取消上传
}, () => {
// `before` 上传前执行的操作
}, (err) => {
// `complete` 上传接受后执行的操作(无论成功还是失败都执行)
});
}
}
}
})
},
perviewImg(index) {
let urls = []
this.imgList.map(item => {
urls.push(item.src)
})
uni.previewImage({
current: index,
urls: urls
});
},
initImg() {
//传入图片,回显
this.imgList = this.initImgList.map(item=>{
let imgItem = {
src:'',
id:''
}
if(typeof item === 'string'){
imgItem.src = item
}else{
imgItem.src = item.src || item.pic || item.image
imgItem.id = item.id || '0'
}
return imgItem
})
},
// async addRecord(item, res) {
// let path = res.key;
// let hash = res.hash;
// let ext = path.substr(path.lastIndexOf('.') + 1);
// //推送到增加记录接口
// let params = {
// filename: hash + '.' + ext,
// full_url: res.fileURL,
// absolute_path: path,
// filesize: item.filesize,
// ext: ext
// };
// let recordRes = await this.$u.api.qiniuRecord(params);
// if (recordRes.code != 1) {
// uni.showToast({
// title: recordRs.msg,
// icon: 'none'
// })
// return
// }
// item.id = recordRes.data.id.id
// },
async removeImg(index) {
this.imgList.splice(index, 1)
// this.$emit('image-change', this.imgList) //将图片回传父页面
},
getUrlKey(file) {
let index = file.lastIndexOf('/');
let len = file.length
let name = file.substring(index + 1, len)
return name;
}
}
}
(function () {
// 请参考demo的index.js中的initQiniu()方法,若在使用处对options进行了赋值,则此处config不需要赋默认值。init(options) 即updateConfigWithOptions(options),会对config进行赋值
var config = {
// bucket 所在区域。ECN, SCN, NCN, NA, ASG,分别对应七牛云的:华东,华南,华北,北美,新加坡 5 个区域
qiniuRegion: '',
// 七牛云bucket 外链前缀,外链在下载资源时用到
qiniuBucketURLPrefix: '',
// 获取uptoken方法三选一即可,执行优先级为:uptoken > uptokenURL > uptokenFunc。三选一,剩下两个置空。推荐使用uptokenURL,详情请见 README.md
// 由其他程序生成七牛云uptoken,然后直接写入uptoken
qiniuUploadToken: '',
// 从指定 url 通过 HTTP GET 获取 uptoken,返回的格式必须是 json 且包含 uptoken 字段,例如: {"uptoken": "0MLvWPnyy..."}
qiniuUploadTokenURL: '',
// uptokenFunc 这个属性的值可以是一个用来生成uptoken的函数,详情请见 README.md
qiniuUploadTokenFunction: function () { },
// qiniuShouldUseQiniuFileName 如果是 true,则文件的 key 由 qiniu 服务器分配(全局去重)。如果是 false,则文件的 key 使用微信自动生成的 filename。出于初代sdk用户升级后兼容问题的考虑,默认是 false。
// 微信自动生成的 filename较长,导致fileURL较长。推荐使用{qiniuShouldUseQiniuFileName: true} + "通过fileURL下载文件时,自定义下载名" 的组合方式。
// 自定义上传key 需要两个条件:1. 此处shouldUseQiniuFileName值为false。 2. 通过修改qiniuUploader.upload方法传入的options参数,可以进行自定义key。(请不要直接在sdk中修改options参数,修改方法请见demo的index.js)
// 通过fileURL下载文件时,自定义下载名,请参考:七牛云“对象存储 > 产品手册 > 下载资源 > 下载设置 > 自定义资源下载名”(https://developer.qiniu.com/kodo/manual/1659/download-setting)。本sdk在README.md的"常见问题"板块中,有"通过fileURL下载文件时,自定义下载名"使用样例。
qiniuShouldUseQiniuFileName: false
}
// init(options) 将七牛云相关配置初始化进本sdk
// 在整个程序生命周期中,只需要 init(options); 一次即可
// 如果需要变更七牛云配置,再次调用 init(options); 即可
function init(options) {
updateConfigWithOptions(options);
}
// 更新七牛云配置
function updateConfigWithOptions(options) {
if (options.region) {
config.qiniuRegion = options.region;
} else {
console.error('qiniu uploader need your bucket region');
}
if (options.uptoken) {
config.qiniuUploadToken = options.uptoken;
} else if (options.uptokenURL) {
config.qiniuUploadTokenURL = options.uptokenURL;
} else if (options.uptokenFunc) {
config.qiniuUploadTokenFunction = options.uptokenFunc;
}
if (options.domain) {
config.qiniuBucketURLPrefix = options.domain;
}
config.qiniuShouldUseQiniuFileName = options.shouldUseQiniuFileName
}
// 正式上传的前置方法,做预处理,应用七牛云配置
function upload(filePath, success, fail, options, progress, cancelTask) {
if (null == filePath) {
console.error('qiniu uploader need filePath to upload');
return;
}
if (options) {
updateConfigWithOptions(options);
}
if (config.qiniuUploadToken) {
doUpload(filePath, success, fail, options, progress, cancelTask);
} else if (config.qiniuUploadTokenURL) {
getQiniuToken(function () {
doUpload(filePath, success, fail, options, progress, cancelTask);
});
} else if (config.qiniuUploadTokenFunction) {
config.qiniuUploadToken = config.qiniuUploadTokenFunction();
if (null == config.qiniuUploadToken && config.qiniuUploadToken.length > 0) {
console.error('qiniu UploadTokenFunction result is null, please check the return value');
return
}
doUpload(filePath, success, fail, options, progress, cancelTask);
} else {
console.error('qiniu uploader need one of [uptoken, uptokenURL, uptokenFunc]');
return;
}
}
// 正式上传
function doUpload(filePath, success, fail, options, progress, cancelTask) {
if (null == config.qiniuUploadToken && config.qiniuUploadToken.length > 0) {
console.error('qiniu UploadToken is null, please check the init config or networking');
return
}
var url = uploadURLFromRegionCode(config.qiniuRegion);
var fileName = filePath.split('//')[1];
// 自定义上传key(即自定义上传文件名)。通过修改qiniuUploader.upload方法传入的options参数,可以进行自定义文件名称。如果options非空,则使用options中的key作为fileName
if (options && options.key) {
fileName = options.key;
}
var formData = {
'token': config.qiniuUploadToken
};
// qiniuShouldUseQiniuFileName 如果是 true,则文件的 key 由 qiniu 服务器分配(全局去重)。如果是 false,则文件的 key 使用微信自动生成的 filename。出于初代sdk用户升级后兼容问题的考虑,默认是 false。
if (!config.qiniuShouldUseQiniuFileName) {
formData['key'] = fileName
}
var uploadTask = wx.uploadFile({
url: url,
filePath: filePath,
name: 'file',
formData: formData,
success: function (res) {
var dataString = res.data
// // this if case is a compatibility with wechat server returned a charcode, but was fixed
// if(res.data.hasOwnProperty('type') && res.data.type === 'Buffer'){
// dataString = String.fromCharCode.apply(null, res.data.data)
// }
try {
var dataObject = JSON.parse(dataString);
// 拼接fileURL
var fileURL = config.qiniuBucketURLPrefix + '/' + dataObject.key;
dataObject.fileURL = fileURL;
// imageURL字段和fileURL字段重复,但本sdk不做删除,因为在最初版本使用的是imageURL。直接删除可能导致原有用户升级至新版sdk后出现异常。
dataObject.imageURL = fileURL;
if (success) {
success(dataObject);
}
} catch (e) {
if (fail) {
fail(e);
}
}
},
fail: function (error) {
console.error(error);
if (fail) {
fail(error);
}
}
})
// 文件上传进度
uploadTask.onProgressUpdate((res) => {
progress && progress(res)
})
// 中断文件上传
cancelTask && cancelTask(() => {
uploadTask.abort()
})
}
// 获取七牛云uptoken, url为后端服务器获取七牛云uptoken接口
function getQiniuToken(callback) {
wx.request({
url: config.qiniuUploadTokenURL,
//url: 'https://www.llxq.net/addons/qiniu/index/createToken',
success: function (res) {
var token = res.data.data.token;
if (token && token.length > 0) {
config.qiniuUploadToken = token;
if (callback) {
callback();
}
} else {
console.error('qiniuUploader cannot get your token, please check the uptokenURL or server')
}
},
fail: function (error,res) {
console.log(res);
console.log(config.qiniuUploadTokenURL, config.qiniuUploadTokenURL.Promise);
console.error('qiniu UploadToken is null, please check the init config or networking: ' + error);
}
})
}
// 选择七牛云文件上传接口,文件向匹配的接口中传输。ECN, SCN, NCN, NA, ASG,分别对应七牛云的:华东,华南,华北,北美,新加坡 5 个区域
function uploadURLFromRegionCode(code) {
var uploadURL = null;
switch (code) {
case 'ECN': uploadURL = 'https://up.qiniup.com'; break;
case 'NCN': uploadURL = 'https://up-z1.qiniup.com'; break;
case 'SCN': uploadURL = 'https://up-z2.qiniup.com'; break;
case 'NA': uploadURL = 'https://up-na0.qiniup.com'; break;
case 'ASG': uploadURL = 'https://up-as0.qiniup.com'; break;
default: console.error('please make the region is with one of [ECN, SCN, NCN, NA, ASG]');
}
return uploadURL;
}
module.exports = {
init: init,
upload: upload,
}
})();
......@@ -28,8 +28,34 @@
"navigationBarTitleText": "选择可服务的城市"
}
},
},
{
"path": "pages/settle/file",
"style": {
"navigationBarTitleText": "入驻资料"
}
},{
"path": "pages/settle/file-upload",
"style": {
"navigationBarTitleText": "图片上传"
}
},
{
"path": "pages/settle/pay-ensure",
"style": {
"navigationBarTitleText": "缴纳保证金"
}
},
{
"path": "pages/settle/prompt",
"style": {
"navigationBarTitleText": "入驻提示"
}
},
{
"path": "pages/index/index",
"style": {
......@@ -246,12 +272,20 @@
"current": 0, //当前激活的模式(list 的索引项)
"list": [{
"name": "拍照小工具", //模式名称
"path": "pages/photo/try", //启动页面,必选
"path": "pages/settle/prompt", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},{
"name": "基本信息", //模式名称
"path": "pages/settle/base", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},{
"name": "资料信息", //模式名称
"path": "pages/settle/file", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},{
"name": "缴纳保证金", //模式名称
"path": "pages/settle/pay-ensure", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
}]
}
}
......@@ -27,6 +27,12 @@
<!-- <i class="iconfont icon-xiangyou"></i> -->
</view>
<view class="tips">(必选项)选择你从事电工工作的工龄</view>
<view class="item item-input flex u-row-between">
<label class="label">详细地址:</label>
<u-icon name="map" color="#999" size="34"></u-icon>
<!-- <input placeholder="请输入您的电话" v-model="baseInfo.mobile" class="input flex1" /> -->
</view>
<view class="tips">{{baseInfo.address}}</view>
</view>
<view class="seat"></view>
<view class="btn-wrap flex-xc">
......@@ -38,6 +44,11 @@
</template>
<script>
let r = require("../../libs/bmap-wx.min.js");
let h = new r.BMapWX({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak: "lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
});
export default {
data() {
return {
......@@ -46,6 +57,7 @@
mobile: "",
service_area: [],
working_age: "",
address:''
},
saving: false,
areaTxts: [],
......@@ -58,6 +70,7 @@
//console.log(e.activeService)
this.activeService = e.activeService
}
this.initLocation()
},
computed: {
submitStatus() {
......@@ -70,6 +83,45 @@
},
methods: {
initLocation(){
const self = this
uni.getLocation({
type: 'wgs84',
success: function (res) {
console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res.latitude);
self.baiduLocation(res.longitude,res.latitude)
}
});
},
baiduLocation(long,lat) {
let a = this,
t = function() {
let t = {
success: function(res) {
let e = res.wxMarkerData[0];
console.log(e,e.address,'e.address')
let i = e.address;
a.baseInfo.address = i
// a.setData({
// addressValue: i
// }), o.globalData.addressValue = i, a.initWatermarkBoxHeightAndWidth();
},
fail: function(a) {
console.log(a, 'a')
// n.error(a), console.log(a);
}
};
if (lat && long) {
let e = lat + "," + long
// let e = "113.88308" + ',' + "22.55329"
// let e = "22.55329" + ',' + "113.88308"
t.location = e;
}
h.regeocoding(t);
};
t()
},
gopage(url) {
uni.navigateTo({
url,
......@@ -176,7 +228,7 @@
if (res.status != 200) {
uni.showToast({
title: res.message,
icon: 'success'
icon: 'none'
});
return;
}
......@@ -187,7 +239,7 @@
let timer = setTimeout(() => {
clearTimeout(timer)
uni.navigateTo({
url:'/pages/settle/base'
url:'/pages/settle/file'
})
}, 2000)
},
......
<template>
<view class="img-wrap rel">
<view class="upload-box">
<view class="img-item pic" v-for="(file,index) in imgList" >
<!-- <view class="tip-sucess u-flex u-row-center" v-if="file && (file.status == status.QUEUED || file.status == status.UPLOADING)">
<span>正在上传中...{{file.percent}}%</span>
</view> -->
<img :src="file.src" @click="perviewImg(index)">
<view class="close" @click="removeImg(index)">
<u-icon name="close" color="#fff" size="20"></u-icon>
</view>
</view>
<view>
<view class="pic upload" @click="chooseImage">
<u-icon name="camera" color="#fff" size="100"></u-icon>
<span class="txt">点击拍摄</span>
</view>
</view>
</view>
</view>
</template>
<script>
import base from '@/components/upload/upload';
export default {
mixins:[base],
data() {
return {
initImgList:[],
currentIndex: 0,
uploadType: '',
pageTitle:''
}
},
computed: {
},
onLoad(option) {
this.initPage(option)
// this.initworkingAgeList();
// this.getareaList()
},
methods: {
goBack(type) {
if (type) {
this.setPrevPageData()
}
uni.navigateBack({
delta: 2
});
},
initPage(option) {
const uploadType = option.uploadType
this.uploadType = uploadType
let pages = getCurrentPages()
if (pages.length < 2) {
return
}
let prevVue = pages[pages.length - 2].$vm
this.imgList = [prevVue.fileInfo[uploadType]]
const formShowList = prevVue.formShowList
pageTitle =
formShowList.map(item=>{
if(item.filedName===uploadType){
this.pageTitle = item.label
}
})
uni.setNavigationBarTitle({
title: this.pageTitle
});
},
setPrevPageData() {
let pages = getCurrentPages()
if (pages.length < 2) {
return
}
let selected = this.selected
let prevVue = pages[pages.length - 2].$vm
const selectType = this.selectType
prevVue.fileInfo[selectType] = this.imgList
},
initworkingAgeList() {
let list = [{
value: 0,
name: "1年内",
}, ];
for (let i = 1; i < 10; i++) {
const item = {
value: i,
name: i + "年",
};
list.push(item);
}
list.push({
value: 10,
name: "10年+",
});
this.workingAgeList = list;
},
getareaList(code, level, provinceIndex) {
provinceIndex = provinceIndex || 0
this.currentIndex = provinceIndex
let areaList = this.areaList
if (level) {
if (areaList[provinceIndex].children) {
return
}
}
uni.showLoading({
title: '加载中'
});
let params = {
type: '充电桩安装',
level: level || 0,
code: code
}
const res = this.$u.api.getSettleArea(params)
uni.hideLoading()
if (res.status != 200) {
return;
}
if (!level) {
this.areaList = res.data
const parmas = [res.data[0].id, 1]
this.getareaList(...parmas)
} else {
this.$set(areaList[provinceIndex], 'children', res.data)
}
},
selectAge(item) {
this.selected.working_age = item.value
this.selected.workingAgeTxt = item.name
},
selectArea(areaItem) {
const code = areaItem.id
const selected = this.selected
const idx = selected.areaIds.indexOf(code)
const currentProvince = this.areaList[this.currentIndex]
let txt = currentProvince.name + '-' + areaItem.name
if (idx >= 0) {
selected.areaTxts.splice(idx, 1)
selected.areaIds.splice(idx, 1)
} else {
selected.areaIds.push(code)
selected.areaTxts.push(txt)
}
this.selected = selected
},
},
}
</script>
<style lang="scss">
.upload-box {
padding: 30rpx 16rpx;
.pic {
position: relative;
display: block;
width: 720rpx;
height: 450rpx;
// overflow: hidden;
border-radius: 12rpx;
margin-bottom: 30rpx;
img {
width: 100%;
height: 100%;
}
}
.pic.upload {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
img {
display: block;
width: 60rpx;
height: 52rpx;
}
.txt {
font-weight: bold;
margin-top: 18rpx;
font-size: 32rpx;
color: #fff;
&.iconfont {
font-size: 60rpx;
}
}
background-color: rgba(0, 0, 0, 0.3);
}
}
.close{
position: absolute;
width:50rpx;
height:50rpx;
right:0;
top:0;
text-align: center;
line-height:50rpx;
border-radius: 50%;
background: red;
color: #fff;
}
.tip-sucess {
position: absolute;
bottom: 0;
left: 0;
padding: 20rpx 0;
width: 100%;
z-index: 5;
background: rgba(0, 0, 0, .4);
border-radius: 0;
color: #fff;
font-size: 28rpx;
&.tip-fail i {
background: red;
}
i {
margin-right: 12rpx;
width: 50rpx;
height: 50rpx;
background: #7fbe4c;
border-radius: 50%;
text-align: center;
line-height: 50rpx;
font-size: 24rpx;
}
}
</style>
This diff is collapsed.
......@@ -75,12 +75,15 @@
.theme_image{
width: 100%;
height: 3000rpx;
margin-bottom:164rpx;
}
.bottom_view{
position:fixed;
bottom:0;
background-color: #002CC0;
width: 100%;
height: 200rpx;
height: 164rpx;
display: flex;
align-content: center;
justify-content: center;
......@@ -89,7 +92,7 @@
.bottom_btn{
margin-top: 30rpx;
width: 600rpx;
height: 100rpx;
height: 104rpx;
border: 4rpx solid #FFFFFF;
display: flex;
align-items: center;
......
<template>
<view class="content">
<view class="base-list">
<view class="tips">充电桩安装需缴纳保证金:1000元</view>
<view class="tips">你已缴纳金额:0元</view>
<view class="tips">充电桩安装需缴纳保证金:1000元待缴金额:1000元</view>
</view>
<view class="seat"></view>
<view class="btn-wrap flex-xc">
<button class="btn-submit" @click="submitBaseInfo">
微信支付
</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
baseInfo: {
name: "",
mobile: "",
service_area: [],
working_age: "",
address: ''
},
saving: false,
areaTxts: [],
workingAgeTxt: '',
protocolContent: ''
}
},
onLoad(e) {
},
computed: {
},
components: {
},
methods: {
},
}
</script>
<style lang="scss">
.base-list {
.tips {
margin-top: 20rpx;
padding: 0 30rpx;
line-height: 40rpx;
font-size: 28rpx;
color: #666;
}
}
.seat {
padding-bottom: 144rpx;
}
/*提交按钮*/
.btn-wrap {
position: fixed;
// margin: px2rem(36);
left: 0;
right: 0;
bottom: 0;
padding: 30rpx 0;
background: #f3f3f3;
.btn-submit {
width: 600rpx;
// left: 5%;
// bottom: px2rem(36);
height: 104rpx;
line-height: 104rpx;
background: #2272ff;
font-size: 32rpx;
color: #fff;
&:disabled {
border: 2rpx solid #999;
background-color: #f3f3f3;
color: #999;
}
}
}
</style>
<template>
<view class="container u-row-between" v-if="info">
<view class="txt-box">
<text class="title" v-for="txt in info.txtArr">{{txt}}</text>
</view>
<button class="btn-submit" @click="goPage(info.url)">{{info.btnTxt}}</button>
</view>
</template>
<script>
export default {
data() {
return {
promptList:[{
stepName:'step1',
txtArr:['你已通过充电桩安装入驻审核!','在培训学习后,可以正式签约了!'],
btnTxt:'去培训学习',
url:'/pages/exam/index'
},{
stepName:'step2',
txtArr:['你已成为充电桩安装备选服务商!','后续如有业务,请留意通知!'],
btnTxt:'去接单广场逛逛',
url:'/pages/take/index'
},{
stepName:'step3',
txtArr:['你的入驻资料已被驳回!可重新提交资料!','理由:图片不够清晰!'],
btnTxt:'重新提交',
url:'/pages/settle/file'
},{
stepName:'step4',
txtArr:['你已通过充电桩安装入驻审核!','可以正式签约了!'],
btnTxt:'去签约',
url:'/pages/settle/file'
},{
stepName:'step5',
txtArr:['你已成为充电桩安装签约服务商!','请缴纳1000元质保金'],
btnTxt:'去缴纳保证金',
url:'/pages/settle/pay-ensure'
},{
stepName:'step6',
txtArr:['你已成为充电桩安装的正式服务商!'],
btnTxt:'去接单广场逛逛',
url:'/pages/take/index'
}],
info:null
}
},
onLoad(e) {
this.initInfo(e)
},
computed: {
},
components: {
},
methods: {
initInfo(option){
let info
if(option.promptType){
const infoArr = this.promptList.filter(item=>{
item.stepName===option.promptType
})
info = infoArr.length>0 && infoArr[0]
}else{
info = this.promptList[0]
}
this.info = info
},
gopage(url) {
uni.navigateTo({
url,
});
},
},
}
</script>
<style lang="scss">
.container{
width:750rpx;
height:500rpx;
display: flex;
flex-direction: column;
.txt-box{
margin-top:100rpx;
}
.title{
display: block;
margin-top: 20rpx;
padding: 0 30rpx;
text-align: center;
font-weight: bold;
line-height: 40rpx;
font-size: 28rpx;
color: #666;
}
.btn-submit {
width: 600rpx;
height: 104rpx;
line-height: 104rpx;
background: #2272ff;
font-size: 32rpx;
color: #fff;
&:disabled {
border: 2rpx solid #999;
background-color: #f3f3f3;
color: #999;
}
}
}
</style>
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