Commit e706c413 authored by zhengzy's avatar zhengzy
parents 7df02395 9171b43c
......@@ -17,6 +17,8 @@ npm run dev:mp-weixin // 运行dev环境
```
npm run build:mp-weixin // 运行生产环境
```
### 公共组件:
[图片上传参考](https://ext.dcloud.net.cn/plugin?id=822)
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
......@@ -11,13 +11,18 @@
authUserInfo: '',
},
onLaunch: function() {
// console.log('App Launch')
// 应用初始化(全局只触发一次)
let that = this
that.globalData.token = util.getToken()
},
onShow: function() {
// console.log('App Show--')
// 应用启动,或从后台进入前台显示
if (!this.globalData.token) {
this.autoLogin()
}
},
onHide: function() {
// console.log('App Hide')
// 应用从前台进入后台
},
methods: {
async getBaseInfo(vm, callBack) {
......@@ -33,15 +38,7 @@
});
return false;
}
// if (!res || !res.code) {
// if (res && res.message) {
// uni.showToast({
// title: res && res.message || '获取基本信息错误',
// icon: 'none'
// });
// }
// return false;
// }
this.globalData.settledInfo = res.data
if (!res.data) {
return
......@@ -60,7 +57,11 @@
uni.login({
async success(res) {
if (res.code) {
let result = await that.$u.api.loginWechatAuth({code: res.code})
let params = {
code: res.code,
wxAppNo: 1, // 自营平台小程序
}
let result = await that.$u.api.loginWechatAuth(params)
if (result) {
if (result.code == 200 && result.data) {
that.setUserData(result.data)
......
<template>
<view class="order-view">
<text>订单</text>
</view>
</template>
<script>
export default {
props: {
orderData: {
type: Object,
default: {}
}
},
data() {
return {
};
}
}
</script>
<style lang="scss" scoped>
.order-view {
width: 100%;
height: 200rpx;
}
</style>
<template>
<view class="process-wrap">
<view class="process-title">
<text>{{ title }}</text>
</view>
<view class="process-steps">
<u-steps :list="numList" :current="process" mode="number"></u-steps>
</view>
</view>
</template>
<script>
export default {
// import {u-steps} from ''
name: 'process',
props:{
process: {
type: Number,
default: 0
},
title: {
type: String,
default: '业务流程'
},
type: {
type: Number,
default: 0
}
},
data() {
return {
stepsNums: [],
numList: [
{
name: '业务介绍'
},
{
name: '申请入驻'
},
{
name: '在线考试'
},
{
name: '在线签约'
},
{
name: '开始接单'
}
]
};
},
onLoad() {
let that = this
// 兼容后期配置,有需要可以加载数据显示
that.stepsNums = that.numList
},
computed: {},
methods: {},
};
</script>
<style lang="scss" scoped>
.process-wrap {
border: 4rpx solid #2272ff;
border-radius: 10rpx;
background-color: #ebebeb;
margin: 20rpx;
padding: 10rpx;
}
.process-title {
font-size: 40rpx;
font-weight: bold;
text-align: center;
}
.process-steps {
margin-top: 40rpx;
}
</style>
<template>
<view class="settle-view">
<u-navbar style="position: absolute;" title="入驻" background="{background: transparent}" :border-bottom="false"
back-icon-color="#ffffff" title-color="#ffffff"></u-navbar>
<image :src="url" style="width: 100%;" mode="widthFix"></image>
<view class="introduction">
<slot></slot>
<view class="settle-bottom">
<slot name="bottom"></slot>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
index: {
type: Number,
default: 1
}
},
data() {
return {}
},
computed: {
url() {
return '../../static/settle/bachground' + this.index + '@3x.png'
}
}
}
</script>
<style lang="scss" scoped>
.settle-view {
background-color: #F4F5F7;
}
.introduction {
border-radius: 12rpx;
margin-left: 30rpx;
margin-right: 30rpx;
margin-top: -112rpx;
background-color: #F4F5F7;
overflow: auto;
height: calc(100vh - 312rpx);
}
.settle-bottom {
position: fixed;
width: calc(100vw - 60rpx);
bottom: 44rpx;
}
</style>
......@@ -5,14 +5,6 @@ export default {
components: {},
data() {
return {
// domain: 'http://upload.qiniup.com', // 七牛上传域名地址
// uptokenURL: globalUrl.ucenterUrl.apiUrl + '/v1/tokens', // 上传token地址
// files:[], // 上传文件
// fileMaps:[], // 上传文件返回对象
// keys:[], // 七牛返回key
// uploadToken: '', // 上传token
// maximum:999, // 最大上传数量
// qiniuOptions: {}, // 七牛上传配置
imgList:[]
};
},
......@@ -21,23 +13,64 @@ export default {
// this.initQiniu()
},
methods: {
async uploadPath(type){
// 可以直接上传path
const self = this
let imgList = []
let options = {
files:[] // 文件路径
}
if(type==='qiniu'){
let res = await uploader.qnFileUpload(options)
return
}
let res = await uploader.urlFileUpload(options)
},
async chooseImage(type){
let imageList = []
const self = this
let imgList = []
if(type==='qiniu'){
// 七牛上传
let res = await uploader.qnImgUpload()
console.log(res,'res--------qnImgUpload')
// res.map(item=>{
// imageList.push()
// })
console.log(uploader,uploader.qiniuTokenObj,'qiniuTokenObj')
let imgList = res.map(item=>{
return {
key:item,
src:uploader.qiniuTokenObj.visitPrefix + item
let options = {
onProgressUpdate(res){
let item = {
path:res.path, // 图片临时缓存路径
key:'', // 图片上传成功后相对路径
src:'', // 访问图片的绝对路径
progress:res.progress // 图片上传进度
}
if(res.fileIndex<imgList.length){
imgList[res.fileIndex].progress = res.progress
}else{
imgList.push(item)
}
imgList[res.fileIndex]
self.imgList = imgList
// 多文件上传每个文件进度条
console.log(res,'res---onProgressUpdate')
},
onEachUpdate(res){
// 多文件上传每个文件上传成功触发
if(imgList.length>res.fileIndex){
imgList[res.fileIndex].key = res.url
imgList[res.fileIndex].src = uploader.qiniuTokenObj.visitPrefix + res.url
}
self.imgList = imgList
console.log(res,'res---onEachUpdate')
}
})
this.imgList = imgList
}
// 不需要进度条等可直接获取
let res = await uploader.qnImgUpload(options)
console.log(self.imgList,'self.imgList')
// console.log(uploader,uploader.qiniuTokenObj,'qiniuTokenObj')
// let imgList = res.map(item=>{
// return {
// key:item,
// src:uploader.qiniuTokenObj.visitPrefix + item
// }
// })
// this.imgList = imgList
return
}
// 本地服务上传
......
export const uploadMixn = {
data() {
return {
requestNum: 0, // 当前请求数
}
},
methods: {
//七牛token获取的回调
getQiuToken(callback) {
this.$u.api.get("api/kemean/aid/qn_upload").then(data => {
/*
*接口返回参数:
*visitPrefix:访问文件的域名
*token:七牛云上传token
*folderPath:上传的文件夹
*region: 地区 默认为:SCN
*/
callback({
visitPrefix: data.visitPrefix,
token: data.token,
folderPath: data.folderPath,
region: "SCN"
});
});
},
// 请求拦截
uploadStart(options) {
let requestNum = this.requestNum
if (options.load) {
if (requestNum <= 0) {
//打开加载动画
uni.showLoading({
title: '加载中',
mask: true
});
}
requestNum += 1;
this.requestNum = requestNum
}
// 图片上传大小限制
if (options.method == "FILE" && options.maxSize) {
// 文件最大字节: options.maxSize 可以在调用方法的时候加入参数
const maxSize = options.maxSize;
for (let item of options.files) {
if (item.size > maxSize) {
setTimeout(() => {
uni.showToast({
title: "图片过大,请重新上传",
icon: "none"
});
}, 500);
return false;
}
}
}
//请求前加入token
// options.header['token'] = "你的项目登录token";
return options; // return false 表示请求拦截,不会继续请求
},
uploadEnd(options) {
let requestNum = this.requestNum
//判断当前接口是否需要加载动画
if (options.load) {
requestNum = requestNum - 1;
if (requestNum <= 0) {
this.requestNum = requestNum
uni.hideLoading();
}
}
}
}
}
import qiniuUploader from '@/include/libs/qiniuUploader.js';
//七牛云上传文件命名
export const randomChar = function(l, url = "") {
const x = "0123456789qwertyuioplkjhgfdsazxcvbnm";
let tmp = "";
let time = new Date();
for (let i = 0; i < l; i++) {
tmp += x.charAt(Math.ceil(Math.random() * 100000000) % x.length);
}
return (
"file/" +
url +
time.getTime() +
tmp
);
}
//图片选择
export const chooseImage = function(data) {
return new Promise((resolve, reject) => {
uni.chooseImage({
count: data.count || 9, //默认9
sizeType: data.sizeType || ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: data.sourceType || ['album', 'camera'], //从相册选择
success: function(res) {
resolve(res.tempFiles);
},
fail: err => {
reject({
errMsg: err.errMsg,
errCode: err.errCode,
statusCode: 0,
});
}
});
});
}
//视频选择
export const chooseVideo = function(data) {
return new Promise((resolve, reject) => {
uni.chooseVideo({
sourceType: data.sourceType || ['album', 'camera'], //从相册选择
compressed: data.compressed || false, //是否压缩所选的视频源文件,默认值为 true,需要压缩。
maxDuration: data.maxDuration || 60, //拍摄视频最长拍摄时间,单位秒。最长支持 60 秒。
camera: data.camera || 'back', //'front'、'back',默认'back'
success: function(res) {
let files = [{
path: res.tempFilePath
}];
// #ifdef APP-PLUS || H5 || MP-WEIXIN
files[0].duration = res.duration;
files[0].size = res.size;
files[0].height = res.height;
files[0].width = res.width;
// #endif
// #ifdef H5
files[0].name = res.name;
// #endif
resolve(files);
},
fail: err => {
reject({
errMsg: err.errMsg,
errCode: err.errCode,
statusCode: 0,
});
}
});
});
}
// 七牛云上传
export const qiniuUpload = function(requestInfo, getQnToken) {
return new Promise((resolve, reject) => {
if (Array.isArray(requestInfo.files)) {
let len = requestInfo.files.length;
let fileList = new Array;
if (getQnToken) {
getQnToken(qnRes => {
/*
*接口返回参数:
*visitPrefix:访问文件的域名
*token:七牛云上传token
*folderPath:上传的文件夹
*region: 地区 默认为:SCN
*/
let prefixLen = qnRes.visitPrefix.length;
if(qnRes.visitPrefix.charAt(prefixLen - 1) == '/'){
qnRes.visitPrefix = qnRes.visitPrefix.substring(0, prefixLen - 1)
}
uploadFile(0);
function uploadFile(i) {
let item = requestInfo.files[i];
let updateUrl = randomChar(10, qnRes.folderPath);
let fileData = {
fileIndex: i,
files: requestInfo.files,
...item
};
if (item.name) {
fileData.name = item.name;
let nameArr = item.name.split(".");
updateUrl += "." + nameArr[nameArr.length - 1];
}
// 交给七牛上传
qiniuUploader.upload(item.path || item, (res) => {
fileData.url = res.imageURL;
requestInfo.onEachUpdate && requestInfo.onEachUpdate({
url: res.imageURL,
...fileData
});
fileList.push(res.imageURL);
if (len - 1 > i) {
uploadFile(i + 1);
} else {
resolve(fileList);
}
}, (error) => {
reject(error);
}, {
region: qnRes.region || 'SCN', //地区
domain: qnRes.visitPrefix, // bucket 域名,下载资源时用到。
key: updateUrl,
uptoken: qnRes.token, // 由其他程序生成七牛 uptoken
uptokenURL: 'UpTokenURL.com/uptoken' // 上传地址
}, (res) => {
console.log(requestInfo);
requestInfo.onProgressUpdate && requestInfo.onProgressUpdate(Object.assign({}, fileData, res));
// console.log('上传进度', res.progress)
// console.log('已经上传的数据长度', res.totalBytesSent)
// console.log('预期需要上传的数据总长度', res.totalBytesExpectedToSend)
});
}
});
} else {
reject({
errMsg: "请添加七牛云回调方法:getQnToken",
statusCode: 0
});
}
} else {
reject({
errMsg: "files 必须是数组类型",
statusCode: 0
});
};
});
}
// 服务器URL上传
export const urlUpload = function(requestInfo, dataFactory) {
return new Promise((resolve, reject) => {
// 本地文件上传去掉默认Content-Type
if (requestInfo.header['Content-Type']) {
delete requestInfo.header['Content-Type'];
}
// 本地文件上传去掉默认Content-Type
if (requestInfo.header['content-type']) {
delete requestInfo.header['content-type'];
}
if (Array.isArray(requestInfo.files)) {
// #ifdef APP-PLUS || H5
let files = [];
let fileData = {
files: requestInfo.files,
name: requestInfo.name || "file"
};
requestInfo.files.forEach(item => {
let fileInfo = {
name: requestInfo.name || "file",
};
if(item.path){
fileInfo.uri = item.path;
} else {
fileInfo.file = item;
}
files.push(fileInfo);
});
let config = {
url: requestInfo.url,
files: files,
header: requestInfo.header, //加入请求头
success: (response) => {
//是否用外部的数据处理方法
if (requestInfo.isFactory && dataFactory) {
//数据处理
dataFactory({
...requestInfo,
response: response,
}).then(data => {
requestInfo.onEachUpdate && requestInfo.onEachUpdate({
data: data,
...fileData
});
resolve(data);
},err => {
reject(err);
});
} else {
requestInfo.onEachUpdate && requestInfo.onEachUpdate({
data: response,
...fileData
});
resolve(response);
}
},
fail: (err) => {
reject(err);
}
};
if (requestInfo.data) {
config.formData = requestInfo.data;
}
const uploadTask = uni.uploadFile(config);
uploadTask.onProgressUpdate(res => {
requestInfo.onProgressUpdate && requestInfo.onProgressUpdate(Object.assign({}, fileData, res));
});
// #endif
// #ifdef MP
const len = requestInfo.files.length - 1;
let fileList = new Array;
fileUpload(0);
function fileUpload(i) {
let item = requestInfo.files[i];
let fileData = {
fileIndex: i,
files: requestInfo.files,
...item
};
let config = {
url: requestInfo.url,
filePath: item.path,
header: requestInfo.header, //加入请求头
name: requestInfo.name || "file",
success: (response) => {
//是否用外部的数据处理方法
if (requestInfo.isFactory && dataFactory) {
//数据处理
dataFactory({
...requestInfo,
response: response,
}).then(data => {
fileList.push(data);
requestInfo.onEachUpdate && requestInfo.onEachUpdate({
data: data,
...fileData
});
if (len <= i) {
resolve(fileList);
} else {
fileUpload(i + 1);
}
},err => {
reject(err);
});
} else {
requestInfo.onEachUpdate && requestInfo.onEachUpdate({
data: response,
...fileData
});
fileList.push(response);
if (len <= i) {
resolve(fileList);
} else {
fileUpload(i + 1);
}
}
},
fail: (err) => {
reject(err);
}
};
if (requestInfo.data) {
config.formData = requestInfo.data;
}
const uploadTask = uni.uploadFile(config);
uploadTask.onProgressUpdate(res => {
requestInfo.onProgressUpdate && requestInfo.onProgressUpdate(Object.assign({}, fileData, res));
});
}
// #endif
} else {
reject({
errMsg: "files 必须是数组类型",
statusCode: 0
});
}
});
}
......@@ -3,7 +3,6 @@ import App from './App'
import uView from "uview-ui";
import vuexStore from "@/store/$u.mixin.js";
import store from '@/store/index'
// let vuexStore = require('@/store/$u.mixin.js')
import {router,RouterMount} from '@/router/index.js' //路径换成自己的
Vue.config.productionTip = false
......
......@@ -61,7 +61,12 @@
"es6" : true,
"minified" : true
},
"usingComponents" : true
"usingComponents" : true,
"permission" : {
"scope.userLocation" : {
"desc" : "需要获得位置权限以方便用户定位下单地址"
}
}
},
"mp-alipay" : {
"usingComponents" : true
......
{
{
"easycom": {
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
},
......@@ -36,13 +36,17 @@
{
"path": "pages/settle/index",
"style": {
"navigationBarTitleText": "uni-app"
"navigationBarTitleText": "入驻",
"navigationStyle": "custom", // 隐藏系统导航栏
"disableScroll": true
}
},
{
"path": "pages/settle/base",
"style": {
"navigationBarTitleText": "uni-app"
"navigationBarTitleText": "入驻",
"navigationStyle": "custom",
"disableScroll": true
}
},
{
......@@ -125,7 +129,9 @@
{
"path": "pages/settle/file",
"style": {
"navigationBarTitleText": "入驻资料"
"navigationBarTitleText": "入驻资料",
"navigationStyle": "custom",
"disableScroll": true
}
},{
"path": "pages/exam/start",
......@@ -211,5 +217,5 @@
"query": "" //启动参数,在页面的onLoad函数里面得到
}]
}
}
<template>
<view class="backView">
<process :process="2" :type="0" title="业务流程"></process>
<template v-if="isStart==false">
<view class="noticeView">
<text class="noticeText">规则:系统随机出现20道考试题目,每道题5分,每题答题时间100秒,在规定时间内答对题目的记分。
......
<template>
<view class="content">
<view class="wrap">
<!-- <u-image width="100%" height="300rpx" src="/static/anime3.jpg" mode="widthFix"></u-image> -->
</view>
<u-card title="最新消息">
<view class="" slot="body">
<view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0">
<image src="https://img11.360buyimg.com/n7/jfs/t1/94448/29/2734/524808/5dd4cc16E990dfb6b/59c256f85a8c3757.jpg" mode="aspectFill"></image>
<view class="u-body-item-title u-line-2">瓶身描绘的牡丹一如你初妆,冉冉檀香透过窗心事我了然,宣纸上走笔至此搁一半</view>
</view>
</view>
</u-card>
<u-card title="订单推荐">
<view class="" slot="body">
<view class="u-body-item u-flex u-row-between u-p-b-0">
<view class="u-body-item-title u-line-2">釉色渲染仕女图韵味被私藏,而你嫣然的一笑如含苞待放</view>
<image src="https://img12.360buyimg.com/n7/jfs/t1/102191/19/9072/330688/5e0af7cfE17698872/c91c00d713bf729a.jpg" mode="aspectFill"></image>
</view>
</view>
<view class="order-foot" slot="foot">
<view class="btn-settle">
<u-button type="primary" shape="circle" @click="immediatelyIn">立即入驻</u-button>
</view>
</view>
</u-card>
</view>
</template>
<script>
const app = getApp()
export default {
data() {
return {
}
},
onLoad() {
},
methods: {
immediatelyIn() {
if(app.globalData.token) {
<template>
<view class="content">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" @scroll="handleScroll"
refresher-enabled :refresher-triggered="triggered" @refresherrefresh="onRefresh" scroll-anchoring
@refresherrestore="onRestore" @refresherpulling="triggered = true">
<u-swiper :height="250" :list="list" :indicator-pos="indicatorPos" :mode="mode" :interval="3000"
@click="clickSwiper">
</u-swiper>
<view>
<text class="title">最新消息</text>
<view v-for="(item, index) in messageList" :key="index">
<text class="title">{{ item.body }}</text>
</view>
<view class="order-view">
<!-- 订单推荐吸顶 -->
<u-sticky>
<view class="sticky">
<text>订单推荐</text>
</view>
</u-sticky>
<!-- 入驻成功之后显示推荐订单列表 -->
<view v-if="status == 7 && orderList.length > 0">
<view v-for="(item, index) in orderList" :key="index">
<OrderCell :orderData="item">
</OrderCell>
</view>
<u-loadmore :status="currentLoadStatus" bgColor="#f2f2f2"></u-loadmore>
</view>
<!-- 入驻成功之后无推荐订单 -->
<view v-else-if="status == 7 && orderList.length <= 0">
暂无订单
</view>
<!-- 入驻前-->
<view v-else>
<text class="title">当前订单{{ count }}笔\n入驻通过后,平台将向您推荐订单</text>
<u-button class="settle-button" type="primary" shape="circle" @click="immediatelyIn"
:custom-style="buttonStyle">
立即入驻
</u-button>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script>
import util from '@/utils/util.js';
const app = getApp();
import OrderCell from '@/components/order/index.vue'
export default {
components: {
OrderCell
},
data() {
return {
status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
triggered: false,
list: [{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
},
{
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
},
{
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
}
],
title: false,
mode: 'round',
indicatorPos: 'bottomCenter',
title: 'Hello',
count: 0, // 推荐订单数量
messageList: [{
id: 1234,
type: '',
level: '',
title: '',
url: '',
body: '好消息',
}, {
id: 1234,
type: '',
level: '',
title: '',
url: '',
body: '好消息',
}, {
id: 1234,
type: '',
level: '',
title: '',
url: '',
body: '好消息',
}],
loadStatus: ['more', 'loading', 'noMore'],
currentLoadStatus: 'loading',
orderList: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}],
bottomLoading: false
}
},
computed: {
buttonStyle() {
return {
'width': '300rpx',
}
}
},
onLoad() {
this._freshing = false;
this.triggered = false;
},
onShow() {
// 每次进入页面都刷新入驻状态
if (app.globalData.token) {
// 获取是否显示入驻按钮
this.initSettleInfo()
}
},
methods: {
async initSettleInfo() {
if (this.status == 7) return
const callBack = (vm, result) => {
// 后台自动判断入驻流程是否完成,前台通过status确定状态
if (result && result.record) {
// vm.status = result.record.status
vm.status = 0
}
}
await app.getBaseInfo(this, callBack)
},
onRefresh() {
if (this._freshing) return;
this._freshing = true;
// 获取入驻状态
this.initSettleInfo()
// 获取推荐订单及数量
// ....
setTimeout(() => {
// 数据加载完成更新入驻状态和推荐列表
this.triggered = false;
this._freshing = false;
}, 1000)
},
onRestore() {
this.triggered = 'restore';
},
reachBottom() {
console.log('-----bottom will-----')
if (this.bottomLoading || this.currentLoadStatus == this.loadStatus[2]) {
return
}
console.log('-----bottom did-----')
this.bottomLoading = true
setTimeout(() => {
// 加载更多数据
// ...
this.orderList.push(...[{}, {}, {}, {}, {}, {}, {}, {}, {}, {}])
// 加载完成
this.currentLoadStatus = false/*是否还有*/ ? this.loadStatus[1] : this.loadStatus[2]
this.$nextTick(function() {
this.bottomLoading = false
})
}, 1000);
},
clickSwiper(index) {
},
handleScroll() {
console.log('-----scroll-------')
},
immediatelyIn() {
if (util.getToken()) {
uni.navigateTo({
url: "pages/settle/index"
})
} else {
uni.navigateTo({
url: "pages/login/index"
})
}
}
}
}
</script>
<style scoped lang="scss">
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.wrap {
padding: 40rpx;
}
.u-card-wrap {
background-color: $u-bg-color;
padding: 1px;
}
.u-body-item {
font-size: 32rpx;
color: #333;
padding: 20rpx 10rpx;
}
.u-body-item image {
width: 120rpx;
flex: 0 0 120rpx;
height: 120rpx;
border-radius: 8rpx;
margin-left: 12rpx;
margin-right: 12rpx;
}
.order-foot {
display: flex;
flex-direction: column;
align-items: center;
}
.btn-settle {
width: 400rpx;
}
url: this.status > 0 ? '/pages/settle/prompt' : '/pages/settle/index'
})
} else {
uni.navigateTo({
url: 'pages/login/index'
});
}
}
}
}
</script>
<style lang="scss" scoped>
.content {
height: 100vh;
}
.logo {
height: 200 rpx;
width: 100%;
margin: 0 rpx auto 50 rpx auto;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36 rpx;
color: #8f8f94;
}
.sticky {
height: 120 rpx;
background-color: #2979ff;
color: #fff;
padding: 24 rpx;
text-align: left;
}
.order-view {
text-align: center;
}
</style>
......@@ -81,7 +81,7 @@ export default {
let params = {
nickname: app.globalData.authUserInfo.nickName,
avatar: app.globalData.authUserInfo.avatarUrl,
// wxAppNo: 1,
wxAppNo: 1,
}
login.appLogin().then(res => {
params.code = res.code
......@@ -113,7 +113,7 @@ export default {
avatar: app.globalData.authUserInfo.avatarUrl,
encryptedData: e.detail.encryptedData,
iv: e.detail.iv,
// wxAppNo: 1,
wxAppNo: 1,
}
login.appLogin().then(res => {
params.code = res.code
......
<template>
</template>
<template>
<view>
<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30">
<view class="u-m-r-10">
<u-avatar :src="pic" size="140"></u-avatar>
</view>
<view class="u-flex-1">
<view class="u-font-18 u-p-b-20">uView ui</view>
<view class="u-font-14 u-tips-color">微信号:helang_uView</view>
</view>
</view>
<view class="u-m-t-20">
<u-cell-group>
<u-cell-item v-for="(item, index) in items" :title="item.title" :value="item.value" :key="index">
<u-icon slot="icon" size="32" name="search"></u-icon>
</u-cell-item>
</u-cell-group>
</view>
<view class="u-m-t-20">
<u-cell-group>
<u-cell-item icon="setting" title="设置"></u-cell-item>
</u-cell-group>
</view>
</view>
</template>
<script>
export default {
data() {
return {
pic:'https://uviewui.com/common/logo.png',
show:true
}
},
computed: {
items() {
return [
{title: '我的钱包', value: '', icon: ''},
{title: '我的质保金', value: '', icon: ''},
{title: '我的合同', value: '', icon: ''},
{title: '我的证件', value: '', icon: ''},
{title: '我的收货地址', value: '', icon: ''},
{title: '我的仓库', value: '', icon: ''},
{title: '联系客服', value: '6666666', icon: ''}]
}
},
onLoad() {
},
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>
<script>
</script>
<style>
</style>
This diff is collapsed.
<template>
<view class="content">
<Settle :index="2">
<view class="title">入驻基本信息</view>
<view class="base-list">
<!--view class="item item-input flex-yc">
......@@ -48,11 +49,6 @@
placeholder-style='color:#CCCCCC;font-size:32rpx;'/>
</view>
<view class="tips bottom_padding_80">(选填项)输入可投入交付服务的人员数量</view>
<view class="newAddressView">
<view class="newAddressTitleView" @click="locationClick()">
<view class="address">
......@@ -82,23 +78,27 @@
<view class="btn-wrap flex-xc">
<button class="btn-submit" :disabled="!submitStatus" @click="$u.debounce(submitBaseInfo, 500)">
<!--view class="">submitBaseInfo</view-->
<!--button class="btn-submit" :disabled="!submitStatus" @click="submitBaseInfo()"-->
确定
</button>
</view>
</Settle>
</view>
</template>
<script>
import Settle from '@/components/settle/index.vue'
let r = require("../../libs/bmap-wx.min.js");
let h = new r.BMapWX({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak: "lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
});
export default {
components: {
Settle
},
data() {
return {
baseInfo: {
......@@ -345,7 +345,9 @@
let timer = setTimeout(() => {
clearTimeout(timer)
uni.navigateTo({
url:'/pages/settle/file'
url:'/pages/settle/file',
"animationType": "fade-in",
"animationDuration": 300
})
}, 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" mode="aspectFill" @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()
},
beforeDestroy(){
this.setPrevPageData()
},
methods: {
goBack(type) {
// if (type) {
// this.setPrevPageData()
// }
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.imgObj[uploadType] || []
const formShowList = prevVue.formShowList
formShowList.map(item=>{
if(item.filedName===uploadType){
this.pageTitle = item.label || '图片上传'
}
})
if(this.uploadType!=='other_certificates'){
this.selectNum = 1
}
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 uploadType = this.uploadType
prevVue.imgObj[uploadType] = 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>
......@@ -9,7 +9,6 @@
<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('qiniu')">
......
<template>
<view class="page-content">
<Settle :index="2">
<view class="title">入驻充电安装业务所需资料</view>
<view class="base-list">
<template v-for="(fileItem, index) in formShowList">
......@@ -41,11 +42,16 @@
}}
</button>
</view>
</Settle>
</view>
</template>
<script>
export default {
import Settle from '@/components/settle/index.vue'
export default {
components: {
Settle
},
data() {
return {
fileInfo: {
......
<template>
<view class="wrap">
<process :process="0" :type="0" title="业务流程"></process>
<view class="introduction">
<view class="item">
<view class="label">
<text>招募要求</text>
</view>
<view class="content">
<text>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Aenean euismod bibendum laoreet. Proin gravida dolor sit
amet lacus accumsan et viverra justo commodo. Proin sodales
pulvinar sic tempor. Sociis natoque penatibus et magnis dis
parturient montes, nascetur ridiculus mus. Nam fermentum,
nulla luctus pharetra vulputate, felis tellus 。
</text>
</view>
</view>
<view class="item">
<view class="label">
<text>结算价格</text>
</view>
<view class="content">
<text>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Aenean euismod bibendum laoreet. Proin gravida dolor sit
amet lacus accumsan et viverra justo commodo. Proin sodales
pulvinar sic tempor. Sociis natoque penatibus et magnis dis
parturient montes, nascetur ridiculus mus. Nam fermentum,
nulla luctus pharetra vulputate, felis tellus 。
</text>
</view>
</view>
<view class="item">
<view class="label">
<text>入驻资料</text>
</view>
<view class="content">
<text>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Aenean euismod bibendum laoreet. Proin gravida dolor sit
amet lacus accumsan et viverra justo commodo. Proin sodales
pulvinar sic tempor. Sociis natoque penatibus et magnis dis
parturient montes, nascetur ridiculus mus. Nam fermentum,
nulla luctus pharetra vulputate, felis tellus 。
</text>
</view>
</view>
<view class="item careful-color">
<view class="careful-content">
<text>注意事项:</text>
<text>
身份证、银行卡、签约人均为同一人,否则无法入驻;
</text>
<text>
充电桩材料按要求自行准备
</text>
</view>
</view>
</view>
<view class="bottom_view">
<button :class="isStop ? 'bottom_btn apply_color' : 'bottom_btn default_color' " @click="$u.debounce(applyClick, 500)">
<text class="bottom_title" v-if="!isStop">浏览 {{count}} 秒后可申请入驻</text>
<text class="bottom_title" v-if="isStop">申请入驻</text>
</button>
</view>
</view>
</template>
<script>
import { process } from '@/components/process/process'
export default {
components: {
process
},
data() {
return {
theme_url:'https://qn-static.banshouhui.com/settle_theme.png?v=' + new Date().getTime(),
count:9,
isStop:false,
settledInfo:null,
status:'',
saving:true
}
},
onLoad(e) {
this.initpageData(e)
this.startCounting()
},
onShow(){
// if(!this.settledInfo){
// this.getBaseInfo()
// }
uni.hideLoading()
},
methods: {
initpageData(option){
let recommender = ''
if(option && option.q){
const urlLink = decodeURIComponent(option.q)
recommender = this.getQueryVariable(urlLink,'recommender')
getApp().globalData.settleRecommend = recommender
}
if(option && option.recommender){
recommender = decodeURI(option.recommender)
getApp().globalData.settleRecommend = recommender
}
},
getQueryVariable(url,key){
const queryStringArr = url.split('?')
let val = ''
let queryStr = queryStringArr && queryStringArr.length > 1 && queryStringArr[1]
if(!queryStr){
return
}
let queryArr = queryStr.split("&");
for (let i=0;i<queryArr.length;i++) {
let pair = queryArr[i].split("=");
if(pair[0] == key){
val = pair[1];
}
}
return val
},
async getBaseInfo(){
const app = getApp()
const callBack = (vm,result)=>{
vm.settledInfo = result
vm.status = result.record.status
}
let settledInfo = await app.getBaseInfo(this,callBack)
if(!settledInfo){
return
}
this.settledInfo = settledInfo
this.status = settledInfo.record.status
},
startCounting : function () {
if(this.isStop){
return
}
this.count = this.count - 1
if(this.count > 0){
setTimeout(this.startCounting, 1000);
}else{
this.isStop = true
}
},
applyClick: async function () {
if(!this.isStop){
return
}
this.saving = true
if(!this.settledInfo){
await this.getBaseInfo()
this.jumpJudge()
this.saving = false
return
}
this.jumpJudge()
},
jumpJudge(){
if(this.status>0){
uni.navigateTo({
url:'/pages/settle/prompt'
})
return
}
uni.navigateTo({
url:'/pages/settle/base'
})
}
}
}
</script>
<style>
/* page {
background-color: rgb(240, 242, 244);
} */
</style>
<style lang="scss" scoped>
.u-cell-icon {
width: 36rpx;
height: 36rpx;
margin-right: 8rpx;
}
.back_view{
background-color: #FFFFFF;
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
flex-direction: column;
}
.theme_image{
width: 100%;
height: 3000rpx;
margin-bottom:164rpx;
}
.bottom_view{
position:fixed;
box-shadow: 0 -1rpx 6rpx rgba(0,0,0,0.05);
bottom:0;
background-color: #DAEBFF;;
width: 100%;
height: 164rpx;
display: flex;
align-content: center;
justify-content: center;
}
.bottom_btn{
margin-top: 30rpx;
width: 600rpx;
height: 104rpx;
line-height:96rpx;
border-radius: 54rpx;
// border: 4rpx solid #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
&.apply_color{
// border: 4rpx solid #2272FF;
.bottom_title{
color: #fff;
}
}
}
.bottom_title{
font-weight: bold;
font-size: 32rpx;
color: #2272FF;
}
.default_color{
background-color: #fff;
}
.apply_color{
background-color: #2272FF;
}
.introduction {
border: 4rpx solid #2272FF;
border-radius: 10rpx;
background-color: #FFFFFF;
margin: 20rpx;
margin-bottom: 200rpx;
}
.introduction .item {
padding: 20rpx;
}
.introduction .item .label {
font-size: 32rpx;
padding: 10rpx;
}
.introduction .item .content {
font-size: 28rpx;
padding: 20rpx 40rpx 20rpx 40rpx;
}
.careful-color{
color: red;
}
.careful-content {
padding: 10rpx;
font-size: 32rpx;
}
</style>
This diff is collapsed.
......@@ -21,13 +21,13 @@
promptList:[{
status:1,
statusName:'待审核',
txtArr:['您已成功提交资料','正在审核中'],
txtArr:['已提交,等待审核','正在审核中'],
btnTxt:'去接单广场逛逛',
url:'/pages/take/index'
},{
status:2,
statusName:'已通过',
txtArr:['您已通过','“充电桩安装入驻审核”'],
txtArr:['恭喜,审核通过','“充电桩安装入驻审核”'],
btnTxt:'去考试',
url:'/pages/exam/start'
},{
......@@ -65,7 +65,7 @@
btnTxt:'去接单广场逛逛',
url:'/pages/take/index'
}],
// 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试'
// 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
status:'',
info:null,
......
<template>
<view class="content">
<process :process="3" :type="0" title="业务流程"></process>
<view class="content-txt">
<view class="title">入驻协议内容</view>
......
......@@ -2,8 +2,7 @@ import request from "./request";
const globalUrl = process.uniEnv || {}
let baseOptions = {
baseUrl: '', // 接口请求地址,用于图片上传域名配置
//服务器本地上传文件地址
fileUrl: '',
fileUrl: '', //服务器本地上传文件地址
defaultUploadUrl: "api/common/v1/upload_image", // 服务器上传图片默认url
qiniuUploadUrl: globalUrl.ucenterUrl.apiUrl + '/v1/tokens',
//设置请求头(如果使用报错跨域问题,可能是content-type请求类型和后台那边设置的不一致)
......@@ -27,7 +26,7 @@ let baseOptions = {
let uploader = new request(baseOptions);
// 添加获取七牛云token的方法
uploader.getQnToken = function(callback) {
uploader.getQnToken = function() {
//该地址需要开发者自行配置(每个后台的接口风格都不一样)
// console.log(uploader.get,'uploader.get')
return new Promise((resolve, reject) => {
......@@ -101,7 +100,7 @@ uploader.requestStart = function(options) {
}
}
//请求前加入token
options.header['token'] = "RTOKENf7d46ea33a7923515abfa779e04eccba77f98604"; //项目 token
// options.header['token'] = "RTOKENf7d46ea33a7923515abfa779e04eccba77f98604"; //项目 token
return options; // return false 表示请求拦截,不会继续请求
}
//请求结束
......
/***************纯粹的数据请求(如果使用这种可以删除掉fileUpload.js)******************/
// import request from "./core/request.js";
// export default request;
/********数据请求同时继承了文件上传(包括七牛云上传)************/
import upload from "./upload/upload.js";
export default upload;
\ No newline at end of file
......@@ -86,7 +86,7 @@
fileName = options.key;
}
var formData = {
'token': config.qiniuUploadToken
'token': config.qiniuUploadToken,
};
if (!config.qiniuShouldUseQiniuFileName) {
formData['key'] = fileName
......
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