Commit f9921081 authored by 郭晓清's avatar 郭晓清
parents fc74282d 18595172
const UNI_APP = { const UNI_APP = {
ucenterUrl: { ucenterUrl: {
apiUrl: 'http://rest-u.yunya.com', //php端域名请求头 apiUrl: 'http://192.168.1.46', //php端域名请求头
// xueUrl: 'https://xue.banshouhui.com', //学院 xueUrl: 'http://192.168.1.46:8088', //学院
// banshou: 'https://m.banshou.com', //扳手app // banshou: 'https://m.banshou.com', //扳手app
}, },
systemUrl: { systemUrl: {
......
; ;
(function() { (function() {
let NODE_ENV = 'test'; // dev:开发环境 | test:测试环境 let NODE_ENV = 'dev'; // dev:开发环境 | test:测试环境
let ENV_VAR = null; let ENV_VAR = null;
if (process.env.NODE_ENV === "development") { if (process.env.NODE_ENV === "development") {
if (NODE_ENV === 'dev') { if (NODE_ENV === 'dev') {
......
...@@ -46,14 +46,37 @@ export default { ...@@ -46,14 +46,37 @@ export default {
// 授权用户信息 // 授权用户信息
authUserInfo: "", authUserInfo: "",
// 用户入驻信息 // 用户入驻信息
settledInfo: {}, settledInfo: {},
navHeight: 0, //导航栏高度
rpxScreenHeight: 0,// 照相视框高度
safeHeight:0, // 安全高度
//拍照相关数据
photo: {
product: {
brandId: '', // 品牌id
brandName: '', // 品牌名称
classifyId: '', // 分类id
systemId: '', // 系统id
},
topIndex:0,
itemIndex:0,
currentItemLength: 0,//已拍摄照片张数
productList: [],
currentItem: null, // 选择的某一项
setting: null, //自定义设置
waterSetting: null, // 水印设置
tempPath: {
origin: '', // 缓存拍照图片
mixWater: '' // 缓存水印拍照图片
}
},
}, },
onLaunch: function () { onLaunch: function () {
// 应用初始化(全局只触发一次) // 应用初始化(全局只触发一次)
AnalysysAgent.registerSuperProperty("platform", "self-support"); AnalysysAgent.registerSuperProperty("platform", "self-support");
this.getSystemInfo()
// 版本更新 // 版本更新
this.updateApp(); this.updateApp();
}, },
...@@ -64,7 +87,22 @@ export default { ...@@ -64,7 +87,22 @@ export default {
onHide: function () { onHide: function () {
// 应用从前台进入后台 // 应用从前台进入后台
}, },
methods: { methods: {
getSystemInfo() {
try {
let a = wx.getSystemInfoSync();
// this.globalData.platform = systemInfo.platform, this.globalData.pixelRatio = a.pixelRatio,
// this.globalData.statusBarHeight = a.statusBarHeight, this.globalData.navHeight = a.statusBarHeight / a.screenWidth * 750 + 90,
// this.globalData.rpxScreenHeight = a.screenHeight / a.screenWidth * 750, this.globalData.screenWidth = a.screenWidth,
// this.globalData.screenHeight = a.screenHeight;
this.globalData.navHeight = a.statusBarHeight / a.screenWidth * 750 + 90
this.globalData.rpxScreenHeight = a.screenHeight / a.screenWidth * 750
this.globalData.screenHeight = a.screenHeight
this.globalData.safeHeight = a.safeArea.bottom
} catch (a) {
}
},
async getBaseInfo(vm, callBack) { async getBaseInfo(vm, callBack) {
uni.showLoading({ uni.showLoading({
title: "加载中……", title: "加载中……",
......
let commonApiFun = function(vm){ let commonApiFun = function(vm){
let loginWxByUser = async (params = {}) => await vm.$u.get('/wxh-support-rest/rest/ssoinfo/v3/getUsersByCode', params); let loginWxByUser = async (params = {}) => await vm.$u.get('/wxh-support-rest/rest/ssoinfo/v3/getUsersByCode', params);
let loginWxByPhone = async (params = {}) => await vm.$u.post('/wxh-support-rest/rest/ssoinfo/v3/findByMobile', params,{'content-type': 'application/x-www-form-urlencoded'}); let loginWxByPhone = async (params = {}) => await vm.$u.post('/wxh-support-rest/rest/ssoinfo/v3/findByMobile', params,{'content-type': 'application/x-www-form-urlencoded'});
let loginWechatAuth = async (params = {}) => await vm.$u.post('/wxh-support-rest/rest/ssoinfo/wxapp/unify/authorization', params, {'content-type': 'application/x-www-form-urlencoded'}); let loginWechatAuth = async (params = {}) => await vm.$u.post('/wxh-support-rest/rest/ssoinfo/wxapp/unify/authorization', params, {'content-type': 'application/x-www-form-urlencoded'});
// 水印-查询用户自定义设置
let getUserWatermark = async (params = {}) => await vm.$u.post('http://apidoc.banshouhui.com:3000/mock/89/getUserWatermark', params);
// 水印-保存用户自定义设置
let saveUserWatermark = async (params = {}) => await vm.$u.post('http://apidoc.banshouhui.com:3000/mock/89/saveUserWatermark', params);
// 保存图片
let saveImage = async (params = {}) => await vm.$u.post('http://apidoc.banshouhui.com:3000/mock/89/saveImage', params);
const commonApi = { const commonApi = {
loginWxByUser, loginWxByUser,
loginWxByPhone, loginWxByPhone,
loginWechatAuth, loginWechatAuth,
getUserWatermark,
saveUserWatermark,
saveImage
} }
return commonApi return commonApi
} }
......
...@@ -7,7 +7,7 @@ import { ...@@ -7,7 +7,7 @@ import {
import { import {
settledApiFun settledApiFun
} from '@/common/api/settled.js'; } from '@/common/api/settled.js';
import { learnApiFun } from "@/common/api/learn.js"; import {learnApiFun} from "@/common/api/learn.js";
import { orderApiFun } from "@/common/api/order.js"; import { orderApiFun } from "@/common/api/order.js";
let apiFun = function(vm) { let apiFun = function(vm) {
let commonApi = commonApiFun(vm); let commonApi = commonApiFun(vm);
......
const globalUrl = process.uniEnv || {} const globalUrl = process.uniEnv || {}
const ucenterApiUrl = globalUrl.ucenterUrl.apiUrl const ucenterApiUrl = globalUrl.ucenterUrl.apiUrl
const collegeApiUrl = globalUrl.ucenterUrl.xueUrl
let learnApiFun = function(vm){ let learnApiFun = function(vm){
/* 查询用户基本信息 */ /* 通知消息基本信息 */
let getTrainingNoticeList = async (params = {}) => await vm.$u.get(ucenterApiUrl+'/v1/notice/list', params); let getTrainingNoticeList = async (params = {}) => await vm.$u.get(ucenterApiUrl+'/v1/notice/list', params);
/* 获取学习视频基本信息 */
let CourseList = async (params = {}) => await vm.$u.get(collegeApiUrl+'/v1/course-details?course_id=173',params);
/* 获取章节详情 */
let ChapterDetails = async (params = {}) => await vm.$u.get(collegeApiUrl+'/v1/chapter-sections',params);
/* 获取课程节信息*/
let CourseSection = async (params = {}) => await vm.$u.get(collegeApiUrl+'/v1/section-details',params);
const learnApi = { const learnApi = {
getTrainingNoticeList, getTrainingNoticeList,CourseList,ChapterDetails,CourseSection
} }
return learnApi return learnApi
} }
......
page { page {
background-color: #fafafa; background-color: #fafafa;
} }
::-webkit-scrollbar {
width:0;
height:0;
color:transparent;
display:none;
}
.btn-share { .btn-share {
background-color: transparent; background-color: transparent;
......
<template> <template>
<view class="order-cell"> <view class="order-view" @click="handleClickCell">
<view class="order-view" @click="handleClickCell"> <view class="order-top-view">
<view class="order-top-view"> <view class="left-view">
<view class="left-view"> <view :class="['tag-view', {'active': active}]">
<view :class="['tag-view', {'active': active}]"> {{ orderData.orderServiceType }}
{{ orderData.orderServiceType }}
</view>
<view class="store-view">{{ orderData.categoryName }}</view>
</view> </view>
<view class="right-view">{{ orderData.orderBusinessTypeText }}</view> <view class="store-view">{{ orderData.categoryName }}</view>
</view> </view>
<view class="content-view"> <view class="right-view">{{ orderData.orderBusinessTypeText }}</view>
<view class="info-view" v-for="(item, key) in infoTexts" :key="key"> </view>
<text>{{item + ':'}}</text> <view class="content-view">
<text>{{orderData[key]}}</text> <view class="info-view" v-for="(item, key) in infoTexts" :key="key">
<text>{{item + ':'}}</text>
<text>{{orderData[key]}}</text>
</view>
<view class="address-view">
<view class="address-left-view">
<image class="address-image" :src="dizhiImage" mode="widthFix"></image>
<text>{{orderData.contactAddress }}</text>
</view> </view>
<view class="address-view"> <view v-if="showDistance">
<view class="address-left-view"> {{getDistance(orderData.contactAddressLatitud,orderData.contactAddressLongitud)}}km
<image class="address-image" :src="dizhiImage" mode="widthFix"></image>
<text>{{orderData.contactAddress }}</text>
</view>
<view v-if="showDistance">
{{getDistance(orderData.contactAddressLatitud,orderData.contactAddressLongitud)}}km
</view>
</view> </view>
</view> </view>
</view>
<view class="line-view"></view> <view class="line-view"></view>
<view class="reason-view" v-if="showReason"><text>未通过原因:</text> <view class="reason-view" v-if="showReason"><text>未通过原因:</text>
<text class="reason-text">{{orderData.auditResults.remark}}</text> <text class="reason-text">{{orderData.auditResults.remark}}</text>
</view> </view>
<view class="bottom-view"> <view class="bottom-view">
<view> <view>
<view v-if="showCountTime" class="bottom-left-view"> <view v-if="showCountTime" class="bottom-left-view">
<view :class="['bottom-tag-view', {'will': orderData.currentWillOverTime}]">{{tagText}}</view> <view :class="['bottom-tag-view', {'will': orderData.currentWillOverTime}]">{{tagText}}</view>
<u-count-down :timestamp="orderData.currentWillOverTime || orderData.currentOverTime" <u-count-down :timestamp="orderData.currentWillOverTime || orderData.currentOverTime" font-size="44"
font-size="44" color="#FF930D" @change="handleChange" ref="order-count-down"></u-count-down> color="#FF930D" @change="handleChange" ref="order-count-down"></u-count-down>
</view> </view>
<view v-else-if="showTime"> <view v-else-if="showTime">
<text>{{timeTitle}}</text> <text>{{timeTitle}}</text>
<text>{{timeText}}</text> <text>{{timeText}}</text>
</view>
</view> </view>
<u-button class="right-btn" @click.stop="handleClick" :custom-style="buttonStyle" type="primary"
shape="circle">
{{orderText}}
</u-button>
</view> </view>
<u-button class="right-btn" @click.stop="handleClick" :custom-style="buttonStyle" type="primary"
shape="circle">
{{orderText}}
</u-button>
</view> </view>
</view> </view>
</view> </view>
...@@ -251,138 +249,134 @@ ...@@ -251,138 +249,134 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.order-cell { .order-view {
padding-bottom: 20rpx; width: 100%;
background-color: #FFFFFF;
border-radius: 12rpx;
padding: 30rpx;
margin-bottom: 20rpx;
.order-view { .order-top-view {
width: 100%; display: flex;
background-color: #FFFFFF; align-items: center;
border-radius: 12rpx; justify-content: space-between;
padding: 30rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.order-top-view { .left-view {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
.left-view {
display: flex;
align-items: center;
.tag-view { .tag-view {
width: 84rpx; width: 84rpx;
height: 40rpx; height: 40rpx;
color: #FFFFFF; color: #FFFFFF;
border-radius: 8rpx; border-radius: 8rpx;
background-image: linear-gradient(to right, #FF930D, #FFC174); background-image: linear-gradient(to right, #FF930D, #FFC174);
&.active {
background-image: linear-gradient(to right, #2272FF, #47ABFF);
}
}
.store-view { &.active {
color: #333333; background-image: linear-gradient(to right, #2272FF, #47ABFF);
font-size: 36rpx;
font-weight: bold;
margin-left: 20rpx;
} }
} }
.right-view { .store-view {
width: 100rpx;
height: 40rpx;
background-color: #F4F5F7;
border-radius: 20rpx;
color: #333333; color: #333333;
font-size: 22rpx; font-size: 36rpx;
line-height: 40rpx; font-weight: bold;
margin-left: 20rpx;
} }
} }
.content-view { .right-view {
.info-view { width: 100rpx;
text-align: left; height: 40rpx;
color: #333333; background-color: #F4F5F7;
font-size: 26rpx; border-radius: 20rpx;
margin-top: 12rpx; color: #333333;
margin-bottom: 12rpx; font-size: 22rpx;
} line-height: 40rpx;
}
}
.content-view {
.info-view {
text-align: left;
color: #333333;
font-size: 26rpx;
margin-top: 12rpx;
margin-bottom: 12rpx;
}
.address-view { .address-view {
display: flex;
align-items: flex-start;
justify-content: space-between;
color: #333333;
font-size: 24rpx;
margin-top: 12rpx;
.address-left-view {
display: flex; display: flex;
align-items: center;
align-items: flex-start; align-items: flex-start;
justify-content: space-between;
color: #333333;
font-size: 24rpx;
margin-top: 12rpx;
.address-left-view { .address-image {
display: flex; width: 26rpx;
align-items: center; height: 28rpx;
align-items: flex-start; margin-right: 8rpx;
flex-shrink: 0;
.address-image { margin-top: 4rpx;
width: 26rpx;
height: 28rpx;
margin-right: 8rpx;
flex-shrink: 0;
margin-top: 4rpx;
}
} }
.address-right-view {}
} }
}
.line-view { .address-right-view {}
background-color: #F4F5F7;
height: 2rpx;
width: 100%;
margin-top: 30rpx;
} }
}
.reason-view { .line-view {
text-align: left; background-color: #F4F5F7;
margin-top: 30rpx; height: 2rpx;
font-size: 26rpx; width: 100%;
color: #666666; margin-top: 30rpx;
}
.reason-text { .reason-view {
color: #FA5A49; text-align: left;
} margin-top: 30rpx;
font-size: 26rpx;
color: #666666;
.reason-text {
color: #FA5A49;
} }
}
.bottom-view { .bottom-view {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 30rpx;
.bottom-left-view {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
margin-top: 30rpx;
.bottom-left-view { .bottom-tag-view {
display: flex; width: 52rpx;
align-items: center; height: 52rpx;
border-radius: 26rpx;
.bottom-tag-view { line-height: 56rpx;
width: 52rpx; color: #FFFFFF;
height: 52rpx; font-size: 26rpx;
border-radius: 26rpx; background-color: #FA5A49;
line-height: 56rpx; margin-right: 20rpx;
color: #FFFFFF;
font-size: 26rpx;
background-color: #FA5A49;
margin-right: 20rpx;
&.will { &.will {
background-color: #FF930D; background-color: #FF930D;
}
} }
} }
.right-btn {}
} }
.right-btn {}
} }
} }
</style> </style>
<template>
<view>
<view class="contentView">
<!-- <u-image class="pic" :src="files[0]" bg-color="transparent" @click="showPreviewFn"></u-image> -->
<image class="pic" :src="files[0]" v-lazy mode="aspectFit" @click="showPreviewFn"></image>
</view>
<view class="bottomView">
<image class="btn" :src="btn_remake" @click="$u.throttle(remakePhoto, 3000)"></image>
<image class="btn" :src="btn_continue" @click="$u.throttle(continuePhoto, 3000)"></image>
</view>
<image class="btn finish" src="/static/photo/finish.png" @click="$u.throttle(finishPhoto, 3000)"></image>
</view>
</template>
<script>
import qiniup from '@/components/upload/qiniup';
const app = getApp()
export default {
props: {},
mixins: [qiniup],
data() {
return {
protocolContent: '',
btn_remake: 'https://qn-static.banshouhui.com/take_order/photo/remake.png',
btn_continue: '/static/photo/continue.png',
standardId: '',
images: [],
files: [],
fileMaps: [],
keys: [],
token: '',
product: '',
}
},
created(e) {
// 获取照片选项对象
console.log(getApp().globalData.photo.currentItem)
const product = app.globalData.photo.product
this.product = `?brandId=${product.brandId}&brand=${product.brandName}&classifyId=${product.classifyId}&systemId=${product.systemId}`
// if(app.globalData.photo.currentItem) {
// // 获取规格Id
// this.standardId = app.globalData.photo.currentItem._id
// }
getApp().trackPage('照片预览页')
const globalTempPath = getApp().globalData.photo.tempPath
if(globalTempPath && globalTempPath.mixWater){
this.files = [globalTempPath.mixWater]
}
// if(e.standardId) {
// this.standardId = e.standardId
// }
console.log(this.files)
this.token = getApp().globalData.token
},
methods: {
// 保存照片到本地
async saveTempToLocal(tempImagePath) {
//has_origin //是否保存原图
let that = this
const photo = getApp().globalData.photo
if(!photo.tempPath){
return
}
let path = ''
if(photo.tempPath.origin && photo.waterSetting && photo.waterSetting.has_origin){
// 保存原图到本地
path = photo.tempPath.origin
let result = await this.saveLocal(path)
if(result){
uni.showToast({
icon: 'none',
title: '已将照片原图保存到本地相册'
})
}
}
if(photo.currentItem){
photo.currentItem.imageList.unshift(photo.tempPath.mixWater)
}
// if(photo.productList && photo.productList[photo.topIndex]){
// const topArr = photo.productList[photo.topIndex]
// if(topArr[photo.itemIndex]){
// topArr[photo.itemIndex].imageList.push(photo.tempPath.mixWater)
// }
// }
// photo.
if(photo.tempPath.mixWater){
// 保存水印处理图片到本地
path = photo.tempPath.mixWater
let result1 = await this.saveLocal(path)
if(result1){
uni.showToast({
icon: 'none',
title: '已将水印图片保存到本地相册'
})
}
}
},
saveLocal(path){
return new Promise((resolve,reject)=>{
uni.saveImageToPhotosAlbum({
filePath: path,
success() {
resolve(true)
},
fail() {
reject('保存失败')
}
})
})
},
showPreviewFn(img) {
uni.previewImage({
current: 0,
urls: this.files
});
},
// 重拍图片
remakePhoto() {
this.$emit('changeType', 1)
},
finishPhoto(){
const photo = getApp().globalData.photo
photo.currentItemLength = 10
this.continuePhoto()
// 完成本项
this.$emit('finish')
},
// 确认图片
continuePhoto() {
const photo = getApp().globalData.photo
let self = this
uni.showLoading({
title:'图片保存中…'
})
self.saveTempToLocal()
self.confirmUpload(true)
},
submitFile() {
let self = this
if(self.keys.length) {
for (let s of self.keys) {
self.$u.api.saveImage({
"token": self.token,
"standardId": self.standardId,
"url": s,
}).then(async res =>{
console.log(res, "云服务保存图片");
if(res.result.code) {
// TODO 参数是否要来回传递
const photo = getApp().globalData.photo
photo.currentItemLength = photo.currentItemLength + 1
uni.hideLoading()
// 当前项的图片显示
// 拍照项张数目增加 等于10张
if(photo.currentItemLength<10){
this.$emit('changeType', 1)
}else{
this.$emit('finish')
}
} else {
uni.showToast({
title:'图片上传失败 '+ res.result.msg
})
}
})
}
}
},
downloadImages() {
let self = this;
for (let url of this.images) {
uni.downloadFile({
url: url, //仅为示例,并非真实的资源
success(res) {
// 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
if (res.statusCode === 200) {
self.files.push(res.tempFilePath)
}
},
fail(e) {
debugger
}
})
}
},
}
}
</script>
<style lang="scss">
.contentView {
background-color: #333333;
/* padding-top: 120rpx; */
padding-bottom:228rpx;
height: 100vh;
display: flex;
flex-direction: column;
}
/deep/ .u-image{
height:100%!important;
}
/deep/ .u-image__loading{
background-color: transparent!important;
}
/deep/ .u-image__error{
background-color: transparent!important;
}
.pic {
flex:1;
width: 100%;
/* height:auto */
/* height: 760rpx; */
}
.bottomView {
box-shadow: 0 0 1rpx 6rpx rgba(255,255,255,0.05);
background-color: #333333;
width: 100%;
padding:70rpx 0;
position: fixed;
bottom: 0;
display: flex;
justify-content: space-around;
align-items: center;
.btn{
display: block;
width: 200rpx;
height: 88rpx;
}
}
.btn{
display: block;
width: 232rpx;
height: 80rpx;
&.finish{
position: fixed;
top:180rpx;
right:30rpx;
}
}
</style>
<template>
<view class="backView">
<u-navbar title="设置" :title-size="26" title-color="#000" :custom-back="backTake"></u-navbar>
<view class="shadowBackView" style="background-color: transparent;z-index: 1" v-if="loading">
<u-loading style="position: fixed;top: 50%;" :show="loading" size="36" mode="flower"></u-loading>
</view>
<view class="itemView firstItem">
<view class="itemTitleView">
<text class="itemTitle">保存原图</text>
<text class="itemNotice">拍照后另保存一张无水印的图片</text>
</view>
<switch class="itemSwitch" :checked="result['has_origin']" @change="handleOrigineChange" color="#007AFF" />
</view>
<view class="itemView" v-if="showTitleSwitch">
<view class="itemTitleView" @click="itemClick({},-1)">
<text class="itemTitle">水印标题</text>
<text class="itemNotice">{{result['lower_right']['title_text'] || '点击可编辑更改'}}</text>
</view>
<switch class="itemSwitch" disabled :checked="result['lower_right']['title_text'] != ''"
@click="handleClickTitleSwitch" color="#007AFF" />
</view>
<view class="itemView" v-for="(item,ikey) in itemList" :key="ikey">
<view class="itemTitleView" @click="itemClick(item,ikey)">
<text class="itemTitle">{{item['watemark_text'] || '自定义' + (ikey + 1)}}</text>
<text class="itemNotice">{{item['watemark_value'] || '点击可编辑更改'}}</text>
</view>
<switch class="itemSwitch" :checked="item['enable']" @change="itemChange(item, ikey)" color="#007AFF" />
</view>
<u-popup border-radius="10" v-model="isPopShow" safe-area-inset-bottom :mask-close-able="false" mode="center"
width="690rpx" height="600rpx" @close="handlePopClose">
<view class="popCenterView">
<text class="popTitle">设置自定义项</text>
<view class="inputBackView">
<view class="ph-pop-left-view">
<view class="leftInputView">
<input class="leftInput" type="text" v-model="currenItem['watemark_text']"
@input="leftInput()" :disabled="currenItem.type === 'title_text'" placeholder="请输入"
maxlength="10" />
</view>
<view class="ph-pop-tip-view" v-if="showTipLeft">*必填项</view>
</view>
<view class="ph-pop-mid-view">:</view>
<view>
<view class="rightInputView">
<input class="rightInput" type="text" v-model="currenItem['watemark_value']"
@input="rightInput()" placeholder="请输入内容" maxlength="30" />
</view>
<view class="ph-pop-tip-view" v-if="showTipRight">*必填项</view>
</view>
</view>
<text class="popNoticeText u-m-t-20">示例:</text>
<text class="popNoticeText">工程队名称:蓝天工程队</text>
<view class="popBtnView">
<u-button :custom-style="customStyleCancel" hover-class="none" shape="circle" type="primary" @click="popCancelClick()">
取消
</u-button>
<u-button :custom-style="customStyleSave" shape="circle" type="primary" @click="popSaveClick()">
保存
</u-button>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
return {
systemId: '',
isSaveOrigine: true,
isPopShow: false,
icon_close_new: '',
result: {
has_origin: true,
lower_right: {
body: []
}
},
currenItem: {
'watemark_text': '',
'watemark_value': ''
},
editingItem: {},
showTipLeft: false,
showTipRight: false,
loading: true
}
},
computed: {
itemList() {
if (this.result['lower_right']) {
var arr = this.result['lower_right']['body']
return arr.filter((item) => {
return item.watemark_type === '备注'
})
} else {
return []
}
},
showTitleSwitch() {
return this.result['lower_right'].hasOwnProperty('title_text')
},
customStyleCancel() {
return {
'background-color': '#D1D4D4',
'width': '280rpx',
'height': '96rpx'
}
},
customStyleSave() {
return {
'background-color': '##2272FF',
'width': '280rpx',
'height': '96rpx',
'margin-left': '50rpx'
}
}
},
created(e) {
getApp().trackPage('水印设置页')
const globalData = getApp().globalData
this.icon_close_new = globalData.icon_close_new
this.systemId = globalData.photo.product.systemId
this.getItemList()
},
methods: {
getItemList: function() {
// this.systemId = '79550af260555cc20afb34156c94b32c' // 测试数据
this.loading = true
this.$u.api.getUserWatermark({
'token': getApp().globalData.token,
'system_id': this.systemId
}).then(res => {
if (res && res.result) {
if(res.result.error_code){
uni.showToast({title: res.result.error_msg})
}else{
this.result = res.result
}
}else{
uni.showToast({title: '网络异常'})
}
this.loading = false
})
},
saveUserWatermark: function() {
this.loading = true
this.$u.api.saveUserWatermark({
'token': getApp().globalData.token,
'watermark': this.result
}).then(res => {
if (res.result.code == true) {
const photo = getApp().globalData.photo
photo.waterSetting = this.result
}else{
uni.showToast({title: res.result.msg})
}
this.loading = false
})
},
//保存原图 开关
handleOrigineChange: function(e) {
this.result['has_origin'] = !this.result['has_origin']
this.saveUserWatermark()
},
handleClickTitleSwitch: function(e) {
var string = this.result['lower_right']['title_text'] ? '水印标题不可关闭' : '请先编辑该自定义项'
uni.showToast({
icon: 'none',
title: string
})
},
//自定义 开关
itemChange: function(item, ikey) {
if (item['watemark_value']) {
// 修改
item['enable'] = !item['enable']
this.saveUserWatermark()
} else {
uni.showToast({
icon: 'none',
title: '请先编辑该自定义项'
})
}
},
//自定义 点击
itemClick: function(item, ikey) {
if (ikey === -1) {
this.currenItem = {
'watemark_text': '水印标题',
'watemark_value': this.result['lower_right']['title_text'],
'type': 'title_text'
}
} else {
this.editingItem = item
this.currenItem = {
...item
}
}
this.isPopShow = true
},
//左侧输入框
leftInput: function(e) {
if (this.currenItem['watemark_text']) {
this.showTipLeft = false
}
},
//右侧输入框
rightInput: function(e) {
if (this.currenItem['watemark_value']) {
this.showTipRight = false
}
},
//自定义弹窗 关闭
popCancelClick: function() {
this.isPopShow = false
this.currenItem = {
'watemark_text': '',
'watemark_value': ''
}
},
handlePopClose() {
this.showTipLeft = false,
this.showTipRight = false
},
backTake() {
this.$emit('changeType', 1)
},
//自定义弹窗 保存
popSaveClick: function() {
if (this.currenItem['watemark_text'] && this.currenItem['watemark_value']) {
this.isPopShow = false
if (this.currenItem.type === 'title_text') {
this.result['lower_right']['title_text'] = this.currenItem['watemark_value']
} else {
this.editingItem['watemark_text'] = this.currenItem['watemark_text']
this.editingItem['watemark_value'] = this.currenItem['watemark_value']
this.editingItem['enable'] = true
}
this.saveUserWatermark()
} else {
// 提示
if (!this.currenItem['watemark_text']) {
this.showTipLeft = true
}
if (!this.currenItem['watemark_value']) {
this.showTipRight = true
}
}
}
}
}
</script>
<style>
.backView {
background-color: #FAFAFA;
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
/*
.firstItemView{
background-color: #FFFFFF;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding-top: 80rpx;
padding-bottom: 80rpx;
border-bottom: 2rpx solid #F4F5F7;
} */
.itemView {
background-color: #FFFFFF;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding-top: 54rpx;
padding-bottom: 54rpx;
}
.itemView.firstItem {
border-bottom: 2rpx solid #F4F5F7;
}
.itemTitleView {
background-color: #FFFFFF;
width: 80%;
display: flex;
flex-direction: column;
padding-left: 30rpx;
}
.itemTitle {
font-size: 32rpx;
font-weight: bold;
color: #333333;
}
.itemNotice {
font-size: 26rpx;
color: #666666;
margin-top: 4rpx;
}
.itemSwitch {
margin-right: 30rpx;
transform: scale(0.78, 0.75);
}
.shadowBackView {
background-color: rgba(0, 0, 0, 0.5);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.popCenterView {
background-color: #FFFFFF;
display: flex;
flex-direction: column;
}
.popTitle {
font-size: 36rpx;
font-weight: bold;
margin-top: 50rpx;
padding-left: 30rpx;
}
.inputBackView {
margin-top: 52rpx;
width: 100%;
height: 90rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
display: flex;
align-items: flex-start;
}
.leftInputView {
width: 220rpx;
height: 72rpx;
border: 2rpx solid #666666;
display: flex;
align-items: center;
justify-content: center;
}
.leftInput {
width: 180rpx;
height: 32rpx;
}
.ph-pop-left-view {
margin-left: 30rpx;
}
.ph-pop-tip-view {
color: #F56C6C;
}
.ph-pop-mid-view {
margin-top: 20rpx;
}
.rightInputView {
width: 360rpx;
height: 72rpx;
border: 2rpx solid #666666;
margin-right: 30rpx;
display: flex;
align-items: center;
justify-content: center;
}
.rightInput {
width: 320rpx;
height: 32rpx;
}
.popNoticeText {
font-size: 26rpx;
color: #666666;
padding-left: 30rpx;
}
.popBtnView {
margin-top: 110rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
}
/* .popCancelBtn {
background-color: #D1D4D4;
width: 280rpx;
height: 96rpx;
border-radius: 48rpx;
margin-left: 40rpx;
display: flex;
align-items: center;
justify-content: center;
} */
/* .popSaveBtn {
background-color: #2272FF;
width: 280rpx;
height: 96rpx;
border-radius: 48rpx;
margin-right: 40rpx;
display: flex;
align-items: center;
justify-content: center;
} */
/* .popBtnText {
font-size: 32rpx;
color: #FFFFFF;
font-weight: 600;
} */
</style>
<!-- 拍照规范弹窗 -->
<template>
<view class="standard-box">
<swiper class="swiper-box" :current="swiperCurrent" @change="changeTab" @transition="transition" @animationfinish="animationfinish">
<swiper-item class="swiper-item" key="swiper1">
<view class="title">
拍照要求
</view>
<view class="txt-box" >
<view class="txt" v-for="(txt,index) in currentItem.main_point" :key="index">
{{index+1}}. {{txt}}
</view>
<view class="txt tips">
注意:{{currentItem.note}}
</view>
</view>
</swiper-item>
<swiper-item class="swiper-item" v-for="(src, index) in swiperList" :key="index">
<image @click="previewImage(index)" class="icon" mode="aspectFit" :src="src"></image>
</swiper-item>
</swiper>
<view class="tab-box">
<u-tabs-swiper bg-color="transparent" inactive-color="#999"
ref="uTabs" :list="tabList" :current="current"
@change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
</view>
</view>
</template>
<script>
export default {
name:"photo-standard",
props:{
currentItem:{
type: Object,
default () {
return {
images: [],
}
}
},
},
data() {
return {
tabList: [{
name: '十年'
}, {
name: '青春'
}, {
name: '之约'
}],
swiperList:[],
// 因为内部的滑动机制限制,请将tabs组件和swiper组件的current用不同变量赋值
current: 0, // tabs组件的current值,表示当前活动的tab选项
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
height:0,
}
},
watch:{
"currentItem.images"(val){
if(val.length>0){
this.changeList(val)
// let swiperList = JSON.parse(JSON.stringify(val))
// let len = tabs.length
// let tabList = [{name:'拍照要求'}].concat(Array.from({name:'示意图'},len))
// console.log(tabList,'tabList')
}
},
},
created() {
// getApp().trackPage('照片预览页')
// console.log(e, 'e')
// if (e.img) {
// this.images = [e.img]
// }
// console.log(this.images, 'this.images')
},
mounted(){
this.changeList(this.currentItem.images)
this.getSwiperHeight()
},
methods: {
changeList(list){
let swiperList = JSON.parse(JSON.stringify(list))
let len = list.length
let tabList = []
for(let i=0;i<len;i++){
let item = {
name:'示意图' + (i + 1)
}
tabList.push(item)
}
tabList = [{name:'拍照要求'}].concat(tabList)
this.swiperList = swiperList
this.tabList = tabList
},
getSwiperHeight(){
const globalData = getApp().globalData
this.height = globalData.screenHeight*2 - globalData.navHeight - 200
},
previewImage(index){
uni.previewImage({
current:index,
urls:this.swiperList,
})
},
// tabs通知swiper切换
tabsChange(index) {
this.swiperCurrent = index;
},
// swiper-item左右移动,通知tabs的滑块跟随移动
transition(e) {
// console.log(e.detail,'e.detail-transition')
// let dx = e.detail.dx;
// this.$refs.uTabs.setDx(dx);
},
changeTab(){
this.current = this.swiperCurrent
},
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
// swiper滑动结束,分别设置tabs和swiper的状态
animationfinish(e) {
// console.log(e.detail,'e.detail-animationfinish')
// let current = e.detail.current;
// this.$refs.uTabs.setFinishCurrent(current);
// this.swiperCurrent = current;
// this.current = current;
},
// scroll-view到底部加载更多
onreachBottom() {
}
}
}
</script>
<style lang="scss">
.standard-box{
position: absolute;
left:0;right:0;
/* height: calc(100vh - 240rpx); */
z-index: 100;
bottom:240rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color:#fff;
}
.swiper-box{
width: 690rpx;
min-height: 690rpx;
margin-bottom: 150rpx;
border-radius: 12rpx;
background-color: #fff;
}
.tab-box{
position: absolute;
bottom:0;
left:30rpx;
right:30rpx;
}
.swiper-item{
box-sizing: border-box;
// width:690rpx;
padding:30rpx;
.title{
margin-top:20rpx;
font-weight: bold;
line-height: 50rpx;
color:#333;
font-size: 36rpx;
}
&>image{
width:630rpx;
min-height: 630rpx;
}
.txt-box{
max-height: 560rpx;
overflow: auto;
}
.txt{
white-space: normal;
padding-top:26rpx;
line-height: 34rpx;
color:#666;
font-size: 28rpx;
&.tips{
padding-bottom:26rpx;
color:#D73400
}
}
}
/* .pic {
display: block;
width: 100%;
height: auto;
}
.scroll-view_H {
white-space: nowrap;
width: 750rpx;
height: 300rpx;
}
.view-content {
display: flex;
} */
</style>
<template>
<view>
<view class="wrap">
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition"
@animationfinish="animationfinish">
<swiper-item class="swiper-item">
<view class="inner txt-inner" :style="{'background-image':'url(/static/photo/shadow-bg.png)'}">
<view class="title">
拍照要求
</view>
<view class="txt-box" >
<view class="txt" v-for="(txt,index) in currentItem.main_point" :key="index">
{{index+1}}. {{txt}}
</view>
<view class="txt tips" v-if="currentItem.note">
注意:{{currentItem.note}}
</view>
</view>
</view>
</swiper-item>
<swiper-item class="swiper-item" v-for="(src, index) in swiperList" :key="index">
<view class="inner pic">
<image @click="previewImage(index)" class="icon" mode="aspectFit" :src="src"></image>
</view>
</swiper-item>
</swiper>
<view class="u-tabs-box">
<u-tabs-swiper bg-color="transparent" inactive-color="#999" activeColor="#2272FF" ref="tabs"
:list="tabList" :current="current" @change="change" :is-scroll="false" swiperWidth="750">
</u-tabs-swiper>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
currentItem: {
type: Object,
default () {
return {
images: [],
}
}
},
},
data() {
return {
current: 0,
swiperCurrent: 0,
dx: 0,
};
},
onLoad() {},
computed: {
swiperList() {
let list = this.currentItem.images || []
return list
},
tabList() {
let list = this.currentItem.images || []
let swiperList = JSON.parse(JSON.stringify(list))
let len = list.length
let tabList = []
for (let i = 0; i < len; i++) {
let item = {
name: '示意图' + (i + 1)
}
tabList.push(item)
}
tabList = [{
name: '拍照要求'
}].concat(tabList)
return tabList
},
},
methods: {
previewImage(index){
uni.previewImage({
current:index,
urls:this.swiperList,
})
},
// tab栏切换
change(index) {
this.swiperCurrent = index;
// this.getOrderList(index);
},
transition({
detail: {
dx
}
}) {
this.$refs.tabs.setDx(dx);
},
animationfinish({
detail: {
current
}
}) {
this.$refs.tabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
}
}
};
</script>
<style>
/* #ifndef H5 */
page {
height: 100%;
background-color: #f2f2f2;
}
/* #endif */
</style>
<style lang="scss" scoped>
.wrap {
display: flex;
flex-direction: column;
height: calc(100vh - var(--window-top) - 200rpx);
padding-top:100rpx;
width: 100%;
padding-bottom: 0;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);;
}
.swiper-box {
flex: 1;
}
.swiper-item {
display: flex;
align-items: center;
height: 100%;
padding: 0 30rpx;
box-sizing: border-box;
}
.swiper-item .inner {
padding: 30rpx;
background-color: #fff;
width:690rpx;
height: 690rpx;
overflow: hidden;
&.txt-inner{
background-position: bottom right;
background-size: 340rpx 380rpx;
background-repeat: no-repeat;
}
.title {
margin-top: 20rpx;
font-weight: bold;
line-height: 50rpx;
color: #333;
font-size: 36rpx;
}
&.pic{
padding:0;
background-color: transparent;
}
&>image {
width: 690rpx;
min-height: 690rpx;
}
.txt-box {
// max-height: 560rpx;
overflow: auto;
width:100%;
height: 560rpx;
}
.txt {
white-space: normal;
padding-top: 26rpx;
line-height: 34rpx;
color: #666;
font-size: 28rpx;
&.tips {
padding-bottom: 26rpx;
color: #D73400
}
}
}
</style>
...@@ -31,13 +31,19 @@ ...@@ -31,13 +31,19 @@
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.settle-view {
::-webkit-scrollbar {
width: 0;
}
}
.introduction { .introduction {
border-radius: 12rpx; border-radius: 12rpx;
overflow: auto; overflow: auto;
position: fixed; position: fixed;
top: 370rpx; top: 370rpx;
bottom: 0rpx; bottom: 168rpx;
left: 30rpx; left: 30rpx;
right: 30rpx; right: 30rpx;
} }
......
<template>
<view>
<view class="camera-container" v-if="showType === 1">
<cover-view class="header-box" :style="{'height':navHeight/2 + 'px'}">
<cover-view class="inner">
<cover-image @click="setCameraInfo('devicePosition')" class="icon" mode="aspectFit"
src="/static/photo/icon-switch.png"></cover-image>
<cover-image @click="setCameraInfo('flash')" class="icon" mode="aspectFit"
:src="'/static/photo/icon-light-' + cameraInfo.flash +'.png'"></cover-image>
<cover-image @click="changeType(3)" class="icon" mode="aspectFit"
src="/static/photo/icon-setting.png"></cover-image>
</cover-view>
</cover-view>
<camera class="camera-box" v-if="cameraChange&&!standardShow" :device-position="cameraInfo.devicePosition"
:flash="cameraInfo.flash" :style="{'height':cameraHeight/2 + 'px','top':parseInt(navHeight/2) + 'px'}"
@error="cameraError">
<cover-view class="mark-box">
<cover-view class="txt big" v-if="titleTxt">{{titleTxt}}</cover-view>
<cover-view class="txt" v-for="(txt,index) in settingTxtArr" :key="index">{{txt || '获取中'}}</cover-view>
<!-- <cover-view class="txt u-m-t-10">维度:{{waterInfo.latitude || '正在获取中...'}}</cover-view>
<cover-view class="txt u-m-t-10">地址:{{waterInfo.address || '正在获取中...'}}</cover-view>
<cover-view class="txt u-m-t-10">时间:{{waterInfo.date || '正在获取中...'}}</cover-view> -->
</cover-view>
<cover-image class="mark-water" mode="aspectFit" :src="waterInfo.markImage"></cover-image>
</camera>
<cover-view class="bottom-box" v-if="!standardShow">
<cover-image class="icon" src='/static/photo/icon-back.png' mode="" @click="goBack"></cover-image>
<cover-image class='icon-take icon' src='/static/photo/icon-take.png' @click="$u.debounce(takePhoto, 500)"> </cover-image>
<cover-image class='icon' src='/static/photo/icon-standard.png' @click="standardShow = true"> </cover-image>
</cover-view>
<canvas canvas-id="canvas" id="photoCanvas" class="canvas"
:style="{'width':750 + 'rpx','height': cameraHeight + 'rpx'}"></canvas>
<view v-show="standardShow" class="page-mask" :z-index="10000">
<photo-standard :currentItem="currentItem" />
<view class="btn-close">
<image @click="closeShadow" class="icon icon-close" mode="aspectFit" src="/static/photo/icon-close.png">
</image>
</view>
</view>
</view>
<photo-preview v-if="showType === 2" @changeType="changeType" @finish="goBack" />
<photo-setting v-if="showType === 3" @changeType="changeType" />
</view>
</template>
// 加载该组件需要在当前页面隐藏顶部导航栏,然后加上自定义导航栏,通过状态切换显示隐藏
<!-- <u-navbar v-if="!takeStatus" :is-back="false" :title-size="26" title-color="#000" title="我的"></u-navbar> -->
<script>
let r = require("@/libs/bmap-wx.min.js");
let h = new r.BMapWX({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak: "iXsGdyEcm1iQONoUPyEp0hrBTLCuOaW2"
});
import standard from '@/components/photo/standard.vue'
import preview from '@/components/photo/preview.vue'
import setting from '@/components/photo/setting.vue'
export default {
props: {
currentItem: { // 拍照要求,示意图,system_id, standardId
type: Object,
default () {
return {
images: [
'https://qn-static.banshouhui.com/live_mark.png',
'https://qn-static.banshouhui.com/live_mark.png',
'https://qn-static.banshouhui.com/live_mark.png'
],
main_point: []
}
}
}
},
components: {
'photo-standard': standard,
'photo-preview': preview,
'photo-setting': setting,
},
data() {
return {
showType: 1,
standardShow: true,
cameraInfo: {
devicePosition: 'back',
flash: 'auto'
},
waterInfo: {
longitude: '', // 经度
latitude: '', // 维度
address: '', //地址
date: '', //日期
markImage: 'https://qn-static.banshouhui.com/live_mark.png'
},
tempImgs: {
'markImage': '', // 拍照水印
'origin': '', // 无水印照片
'mixWater': '', // 有水印照片
},
authSetting: {
camera: false, // 相机授权
location: false, // 位置授权
},
navHeight: 130,
cameraWidth: 750,
cameraHeight: 1000, // (4 / 3 * 750) 图片比例4:3
ratio: 0,
cameraChange: false,
waterSetting: null,
shadowInitShow: true, // 第一次进入页面需显示弹窗
}
},
created(e) {
const photo = getApp().globalData.photo
getApp().trackPage('拍照页')
// this.ctx = uni.createCameraContext();
this.updateTime()
this.getLocation()
this.getMarkPath()
this.initData()
//this.currentItem = photo.currentItem
},
computed: {
titleTxt() {
const waterSetting = this.waterSetting
let txt = ''
if (!waterSetting || !waterSetting.lower_right) {
return ''
}
txt = waterSetting.lower_right && waterSetting.lower_right.title_text || ''
return txt
},
settingTxtArr() {
let arr = []
// 包含经纬度
const waterInfo = this.waterInfo
arr = ['经度:' + waterInfo.longitude, '纬度:' + waterInfo.latitude, '地址:' + waterInfo.address, '时间:' +
waterInfo.date
]
let settingTxtArr = []
const typeArr = ['经度', '纬度', '地址', '时间']
const waterSetting = this.waterSetting
if (!waterSetting || !waterSetting.lower_right || !waterSetting.lower_right.body) {
return arr
}
const settingArr = waterSetting.lower_right.body
settingArr.map(item => {
const idx = typeArr.indexOf(item.watemark_type)
if (item.enable && (idx > -1 || (item.watemark_value && item.watemark_text))) {
if (idx > -1) {
settingTxtArr.push(arr[idx])
} else {
settingTxtArr.push(item.watemark_text + ':' + item.watemark_value)
}
}
})
return settingTxtArr
}
},
watch: {},
mounted() {
// 默认开启弹窗
const photo = getApp().globalData.photo
this.waterSetting = photo.waterSetting
this.standardShow = this.shadowInitShow
this.cameraChange = true
// this.initData()
},
destroyed(){
this.cameraChange = false
},
methods: {
closeShadow() {
this.shadowInitShow = false
this.standardShow = false
},
goBack() {
uni.showTabBar()
this.$emit('close')
},
changeType(type) {
this.showType = type
},
updateTime() {
this.waterInfo.date = this.getTime()
// let timer = setTimeout(() => {
// clearTimeout(timer);
// this.updateTime()
// }, 1000)
},
setCameraInfo(type) {
// 设置相机前置后置、闪关灯等
const cameraInfo = this.cameraInfo
let val = cameraInfo[type]
switch (type) {
case 'devicePosition':
val = val === 'back' ? 'front' : 'back'
break;
case 'flash':
val = val === 'auto' ? 'on' : (val === 'on' ? 'off' : 'auto')
break;
defalut:
break;
}
this.cameraInfo[type] = val
},
initData() {
const globalData = getApp().globalData
this.navHeight = globalData.navHeight
this.cameraHeight = parseInt(globalData.safeHeight*2 - globalData.navHeight - 200)
this.ratio = globalData.screenHeight / globalData.rpxScreenHeight
this.waterSetting = globalData.photo.waterSetting
},
baiduLocation() {
// 百度sdk解析经纬度
let waterInfo = this.waterInfo
const t = function() {
let t = {
success: function(res) {
let e = res.wxMarkerData[0];
let i = e.address;
waterInfo.address = i
},
fail: function(err) {
//console.log(err, 'err')
}
};
if (waterInfo.latitude && waterInfo.longitude) {
let e = waterInfo.latitude + "," + waterInfo.longitude;
t.location = e;
}
h.regeocoding(t);
};
t()
},
cameraError(e) {
const {
errMsg
} = e.detail
// console.log(e.detail, 'e.detail')
if (errMsg !== 'insertCamera:fail auth deny') {
return
}
this.showSettingModal('camera')
},
//获取位置
getLocation() {
let that = this
const waterInfo = this.waterInfo
uni.getLocation({
type: 'gcj02',
success: function(res) {
waterInfo.longitude = parseFloat(res.longitude).toFixed(4)
waterInfo.latitude = parseFloat(res.latitude).toFixed(3)
that.baiduLocation()
},
fail(err) {
that.showSettingModal('location')
// that.showLocationAuthModal('')
}
});
},
showSettingModal(type) {
type = type || 'camera'
const self = this
let authSetting = {
'camera': {
content: '将无法进行拍照',
method: ''
},
'location': {
content: '将无法定位当前位置',
method: ''
},
'writePhotosAlbum': {
content: '将无法保存图片到本地',
method: ''
}
}
let content = authSetting[type].content
uni.showModal({
content: '拒绝授权' + content + ',是否去设置打开?',
confirmText: "确认",
cancelText: '取消',
success(res) {
if (res.confirm) {
self.openSetting()
}
},
fail() {}
})
},
openSetting() {
// 打开设置
let self = this
this.cameraChange = false
wx.openSetting({
success(res) {
const authSetting = res.authSetting
self.cameraChange = true
if (authSetting['scope.userLocation']) {
// 位置授权成功
self.authSetting.location = true
self.getLocation()
}
if (res.authSetting['scope.camera']) {
self.authSetting.camera = true
}
if (res.authSetting['scope.writePhotosAlbum']) {
self.authSetting.writePhotosAlbum = true
}
}
})
},
//获取 水印 本地缓存路径
getMarkPath: function() {
uni.downloadFile({
url: this.waterInfo.markImage, //仅为示例,并非真实的资源
success: (res) => {
if (res.statusCode === 200) {
this.tempImgs.markImage = res.tempFilePath
}
},
fail() {
console.log('水印图片 下载失败')
}
})
},
/* ---------------------- 拍照流程 ---------------------- */
// 第一步:拍照
takePhoto() {
wx.createCameraContext().takePhoto({
quality: "high"
}).then(res => {
this.tempImgs.origin = res.tempImagePath
this.drawCanvas(res.tempImagePath)
})
},
// 第二步:绘制画布
drawCanvas: function(tempPath) {
uni.showLoading({
title: '数据处理中...',
icon: 'loading'
})
const waterSetting = this.waterSetting
const globalTempPath = getApp().globalData.photo.tempPath
const ratio = this.ratio
console.log(this.ratio,'this.ratio')
// const ratio = 0.5
let canvasWidth = this.cameraWidth * ratio
let canvasHeight = this.cameraHeight * ratio
const waterInfo = this.waterInfo
this.showImage = true
const settingTxtArr = this.settingTxtArr
//将原图画到canvas上面
let canvas = uni.createCanvasContext("canvas", this)
canvas.rect(0, 0, canvasWidth, canvasHeight)
canvas.drawImage(tempPath, 0, 0, canvasWidth, canvasHeight)
// this.canvas.draw()
let txtHeight = 18
let h = 1
//加入 水印文字
for (let i = settingTxtArr.length - 1; i >= 0; i--) {
txtHeight = 20
canvas.setFontSize(15)
canvas.setFillStyle('#f2f2f2')
let txt = settingTxtArr[i]
if(txt.indexOf('时间')>=0){
canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
}else{
if(txt.length>22){
canvas.fillText(txt.substr(22,22), 10, canvasHeight - txtHeight * h++);
canvas.fillText(txt.substr(0,22), 10, canvasHeight - txtHeight * h++);
}else{
canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
}
}
// canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
}
const title = this.titleTxt
if (title) {
canvas.save()
let titleHeight = title.length > 14 ? 60 : 30
let rectWidth = title.length > 14 ? 215 : title.length*10
canvas.setFillStyle('rgba(34, 114, 255, 0.6)')
canvas.fillRect(10, canvasHeight - txtHeight * h - titleHeight, 215, titleHeight)
canvas.restore()
canvas.setFontSize(20)
canvas.setFillStyle('#f2f2f2')
// canvas.setTextAlign('center')
if (title.length > 14) {
canvas.fillText(title.substr(14, 14), 10, canvasHeight - txtHeight * h++ + 20);
}
canvas.fillText(title.substr(0, 14), 10, canvasHeight - txtHeight * h++ - titleHeight / 2 + 10);
}
if (this.waterSetting && this.waterSetting.mid_text) {
//加入 水印图片
canvas.drawImage(this.tempImgs.markImage, canvasWidth / 2 - 100, canvasHeight / 2 - 25, 200, 50)
}
// canvas.drawImage(this.tempImgs.markImage, canvasWidth / 2 - 100, canvasHeight / 2 - 25, 200, 50)
canvas.draw(false,
setTimeout(() => {
uni.canvasToTempFilePath({
width: canvasWidth,
height: canvasHeight,
canvasId: 'canvas',
success: (res) => {
this.tempImgs.mixWater = res.tempFilePath
globalTempPath.origin = this.tempImgs.origin
globalTempPath.mixWater = res.tempFilePath
let timer = setTimeout(()=>{
//this.goPage('/pages/photo/preview')
this.changeType(2)
},0)
// this.saveToLocal(res.tempFilePath)
},
fail: (res) => {
console.log(res);
},
complete: () => {
uni.hideLoading();
}
}, this);
}, 50))
},
// 第三步:保存到本地
saveToLocal(tempImagePath) {
//has_origin //是否保存原图
let that = this
uni.saveImageToPhotosAlbum({
filePath: tempImagePath,
success() {
uni.showToast({
icon: 'none',
title: '已将照片保存到本地相册'
})
},
fail() {}
})
},
showPreviewFn(img) {
uni.previewImage({
current: 0,
urls: [img]
});
},
//获取当前时间
getTime: function() {
let d = new Date();
let year = d.getFullYear();
let month = d.getMonth() + 1;
let date = d.getDate();
let days = new Array("日", "一", "二", "三", "四", "五", "六");
let day = d.getDay();
let hour = (d.getHours() < 10) ? ("0" + d.getHours()) : d.getHours();
let min = (d.getMinutes() < 10) ? ("0" + d.getMinutes()) : d.getMinutes();
let sec = (d.getSeconds() < 10) ? ("0" + d.getSeconds()) : d.getSeconds();
let now = year + "年" + month + "月" + date + "日 " + hour + ":" + min + ":" + sec;
return now
},
}
}
</script>
<style scoped lang="scss">
.camera-container {
// padding-top:var(--status-bar-height);
min-height: 100vh;
background-color: black;
}
.header-box {
// padding:10rpx 20rpx;
position: relative;
.inner {
display: flex;
position: absolute;
left: 0;
right: 0;
bottom: 0;
}
.icon {
margin: 20rpx;
display: block;
width: 44rpx;
height: 44rpx;
}
}
.camera-box {
position: absolute;
left:0;
width: 100%;
// height: 100vh;
z-index: 1;
}
.mark-water {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 360rpx;
height: 90rpx;
z-index: 6;
}
.mark-box {
position: absolute;
left: 0;
bottom: 0;
padding: 20rpx;
.txt {
max-width: 500rpx;
max-height: 80rpx;
overflow: hidden;
margin-top: 5rpx;
line-height: 40rpx;
white-space: normal;
font-size: 28rpx;
color: #fff;
&.big {
padding: 10rpx;
margin-bottom: 10rpx;
width: 430rpx;
line-height: 40rpx;
font-size: 32rpx;
background-color: rgba(34, 114, 255, 0.6);
}
}
}
.bottom-box {
position: absolute;
left: 0;
right: 0;
bottom:0;
// bottom: constant(safe-area-inset-bottom);
// bottom: env(safe-area-inset-bottom);
z-index: 5;
box-sizing: border-box;
height: 200rpx;
display: flex;
justify-content: space-between;
padding: 20rpx 78rpx;
align-items: center;
background-color: black;
.txt {
white-space: nowrap;
line-height: 60rpx;
color: #fff;
}
.icon {
display: block;
width: 92rpx;
height: 92rpx;
&.icon-take {
width: 144rpx;
height: 144rpx;
}
}
}
.canvas {
position: fixed;
left: -750rpx;
top: 0;
}
// 拍照规范
.page-mask {
position: fixed;
bottom: 0;
bottom: constant(safe-area-inset-bottom);
bottom: env(safe-area-inset-bottom);
z-index: 1000;
width: 750rpx;
height: 100vh;
// padding: 0 30rpx;
box-sizing: border-box;
background-color: rgba(0, 0, 0, 0.8);
.icon {
width: 92rpx;
height: 92rpx;
}
.btn-close {
position: absolute;
bottom: 0;
bottom: constant(safe-area-inset-bottom);
bottom: env(safe-area-inset-bottom);
left: 0;
right: 0;
height: 200rpx;
z-index: 100;
display: flex;
justify-content: center;
align-items: center;
}
}
</style>
import qiniuUploader from '@/include/libs/qiniuUploader.js'; import qiniuUploader from '@/include/libs/qiniuUploader.js';
const globalUrl = process.uniEnv || {}' const globalUrl = process.uniEnv || {}
export default { export default {
name: 'qiniup', name: 'qiniup',
components: {}, components: {},
......
import qiniuUploader from '@/include/libs/qiniuUploader.js';
const globalUrl = process.uniEnv || {}
export default {
name: 'qiniup',
components: {},
data() {
return {
domain: 'http://upload.qiniup.com', // 七牛上传域名地址
uptokenURL: globalUrl.ucenterUrl.apiUrl + '/v1/tokens', // 上传token地址
files:[], // 上传文件
fileMaps:[], // 上传文件返回对象
keys:[], // 七牛返回key
uploadToken: '', // 上传token
maximum:999, // 最大上传数量
qiniuOptions: {}, // 七牛上传配置
};
},
created() {
this.initQiniu()
},
methods: {
initQiniu: function() {
var defaulfs = {
// bucket所在区域,这里是华北区。ECN, SCN, NCN, NA, ASG,分别对应七牛云的:华东,华南,华北,北美,新加坡 5 个区域
region: 'ECN',
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
};
let options = {}
if(Object.keys(this.qiniuOptions).length) {
Object.assign(options, defaulfs, this.qiniuOptions);
} else {
options = defaulfs;
}
// 将七牛云相关配置初始化进本sdk
qiniuUploader.init(options);
},
getUrlKey(file) {
let index = file.lastIndexOf('/');
let len = file.length
let name = file.substring(index + 1, len)
return name;
},
/**
* 确认上传
* @param {boolean} submit
*/
confirmUpload(submit = false) {
let self = this
const fileList = self.files
if (self.maximum - fileList.length <= 0) {
uni.showToast({
title: '图片数量不能大于' + self.maximum,
icon: 'none'
})
return
}
for (let file of fileList) {
let name = self.getUrlKey(file)
// 交给七牛上传
let item = {
src: '',
id: '',
key:'',
// filesize: '',
progress: 0
}
const params = {
name:name,
file:file,
}
qiniuUploader.upload(params, (res) => {
console.log(res,'res')
let inLen = self.maximum - fileList.length
if (inLen > 0) {
item.src = file
item.key = res.key || res.src
self.fileMaps.push(item);
self.keys.push(item.key)
if(submit) {
self.submitFile()
}
} else {
uni.showToast({
title: '图片数量不能大于9'
})
}
}, (error) => {
console.log('error: ' + error);
}, null, (res) => {
item.progress = res.progress
}, () => {
// 取消上传
}, () => {
// `before` 上传前执行的操作
}, (err) => {
// `complete` 上传接受后执行的操作(无论成功还是失败都执行)
});
}
}
}
}
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "首页", "navigationBarTitleText": "首页",
"navigationStyle": "custom" "navigationStyle": "custom",
"enablePullDownRefresh": true
} }
}, },
{ {
...@@ -41,7 +42,8 @@ ...@@ -41,7 +42,8 @@
{ {
"path": "pages/mine/index", "path": "pages/mine/index",
"style": { "style": {
"navigationBarTitleText": "我的" "navigationBarTitleText": "我的",
"navigationStyle": "custom"
} }
}, },
{ {
...@@ -69,7 +71,8 @@ ...@@ -69,7 +71,8 @@
{ {
"path": "pages/learn/index", "path": "pages/learn/index",
"style": { "style": {
"navigationBarTitleText": "学习" "navigationBarTitleText": "学习",
"navigationStyle":"custom"//隐藏系统导航栏
} }
}, },
{ {
...@@ -84,17 +87,23 @@ ...@@ -84,17 +87,23 @@
"navigationBarTitleText": "考试答题" "navigationBarTitleText": "考试答题"
} }
}, },
{ {
"path": "pages/learn/result", "path":"pages/learn/result",
"style": { "style":{
"navigationBarTitleText": "考试结果页" "navigationBarTitleText":"考试答题"
} }
}, },
{ {
"path": "pages/learn/news-details", "path": "pages/learn/news-details",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
},
{
"path":"pages/learn/section",
"style" :{
"navigationBarTitleText": ""
}
}, },
{ {
"path": "pages/learn/curriculum", "path": "pages/learn/curriculum",
...@@ -106,7 +115,8 @@ ...@@ -106,7 +115,8 @@
"path": "pages/settle/select", "path": "pages/settle/select",
"style": { "style": {
"navigationBarTitleText": "选择可服务的城市", "navigationBarTitleText": "选择可服务的城市",
"navigationBarBackgroundColor": "#FFFFFF" "navigationBarBackgroundColor": "#FFFFFF",
"disableScroll": true
} }
}, },
{ {
...@@ -202,8 +212,8 @@ ...@@ -202,8 +212,8 @@
"tabBar": { "tabBar": {
"color": "#7A7E83", "color": "#7A7E83",
"selectedColor": "#007AFF", "selectedColor": "#007AFF",
"borderStyle": "black", "borderStyle": "white",
"backgroundColor": "#F8F8F8", "backgroundColor": "#FFFFFF",
"list": [ "list": [
{ {
"pagePath": "pages/index/index", "pagePath": "pages/index/index",
...@@ -260,8 +270,8 @@ ...@@ -260,8 +270,8 @@
"query": "" //启动参数,在页面的onLoad函数里面得到 "query": "" //启动参数,在页面的onLoad函数里面得到
}, },
{ {
"name": "入驻提示", //模式名称 "name": "完工配置", //模式名称
"path": "pages/settle/prompt", //启动页面,必选 "path": "pages/order/complete", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到 "query": "" //启动参数,在页面的onLoad函数里面得到
}, },
{ {
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</view> </view>
<view class="bottomRightView"> <view class="bottomRightView">
<view :class="isSelect ? 'nextBtn selectBackColor' : 'nextBtn defaultBackColor' " <view :class="isSelect ? 'nextBtn selectBackColor' : 'nextBtn defaultBackColor' "
@click="nextClick()"> @click="handleClick()">
<text class="bottomTitle">{{bottomTitle}}</text> <text class="bottomTitle">{{bottomTitle}}</text>
</view> </view>
</view> </view>
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
return process.uniEnv.qn_base_url + 'chenggong.png' return process.uniEnv.qn_base_url + 'chenggong.png'
}, },
timuImage() { timuImage() {
return process.uniEnv.qn_base_url + 'timu.png' return process.uniEnv.qn_base_url + 'timu-new.png'
} }
}, },
onLoad(e) { onLoad(e) {
...@@ -300,7 +300,7 @@ ...@@ -300,7 +300,7 @@
that.vuex_token + that.vuex_token +
'?userExamId=' + this.userExamId + '?userExamId=' + this.userExamId +
'&questionId=' + questionId + '&questionId=' + questionId +
'&userAnswerIds=' + this.userAnswerIds, '&userAnswerIds=' + (this.userAnswerIds || '9999'), // 9999超时自动下一题
method: 'POST', method: 'POST',
data: { data: {
// userExamId:this.userExamId, // userExamId:this.userExamId,
...@@ -372,7 +372,6 @@ ...@@ -372,7 +372,6 @@
}, },
startCounting: function() { startCounting: function() {
if (this.isStop) { if (this.isStop) {
return return
} }
...@@ -441,16 +440,18 @@ ...@@ -441,16 +440,18 @@
},
// 点击下一步
handleClick() {
// 判断有没有选
if (!this.isSelect) {
return
}
this.nextClick()
}, },
//下一题 //下一题
nextClick: function() { nextClick: function() {
//判断有没有选
if (!this.isSelect) {
return
}
clearTimeout(this.timer) clearTimeout(this.timer)
this.currentNumber = this.currentNumber + 1 this.currentNumber = this.currentNumber + 1
...@@ -582,7 +583,9 @@ ...@@ -582,7 +583,9 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y:auto;
overflow-y:auto;
} }
.noticeView { .noticeView {
...@@ -803,10 +806,10 @@ ...@@ -803,10 +806,10 @@
} }
.bottom-padding { .bottom-padding {
margin-bottom: 188rpx; // margin-bottom: 188rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 12rpx; border-radius: 12rpx;
padding: 40rpx 30rpx 46rpx 30rpx; padding: 40rpx 30rpx 40rpx 30rpx;
} }
.answerBottomView { .answerBottomView {
......
<template> <template>
<view class="content"> <view class="content">
<view style="width: 700rpx; height: 800rpx"> <!-- <view style="width: 700rpx; height: 800rpx"> -->
<!-- <view class="title-view">充电桩自营平台</view> --> <!-- <view class="title-view">充电桩自营平台</view> -->
<u-navbar <u-navbar :is-back="false" :is-fixed="false" :background="{ background: 'transparent' }" :border-bottom="false">
:is-back="false" <text class="title-view">充电桩自营平台</text>
:is-fixed="false" </u-navbar>
:background="{ background: 'transparent' }" <!-- <u-swiper
:border-bottom="false"
>
<text class="title-view">充电桩自营平台</text>
</u-navbar>
<!-- <u-swiper
:height="240" :height="240"
:list="list" :list="list"
:indicator-pos="indicatorPos" :indicator-pos="indicatorPos"
...@@ -18,459 +13,475 @@ ...@@ -18,459 +13,475 @@
:interval="3000" :interval="3000"
@click="clickSwiper" @click="clickSwiper"
> >
</u-swiper> --> </u-swiper> -->
<image class="banner-image" :src="bannerImage"></image> <image class="banner-image" :src="bannerImage"></image>
<view class="msg-view"> <view class="msg-view">
<view class="msg-title">最新消息</view> <view class="msg-title">最新消息</view>
<view class="msg-list-view"> <view class="msg-list-view">
<view <view class="msg-content" v-for="(item, index) in messageList" :key="index">
class="msg-content" <view class="msg-content-view">
v-for="(item, index) in messageList" <view class="left-view">
:key="index" <image class="msg-icon" :src="msgStyleImage[item.content_type]"></image>
> <text class="msg-text">{{ item.title }}</text>
<view class="msg-content-view"> </view>
<view class="left-view"> <image class="right-icon" :src="shouyeyouImage"></image>
<image class="msg-icon" :src="msgStyleImage[item.content_type]"></image> </view>
<text>{{ item.title }}</text> <view class="line-view" v-if="index != 2"></view>
</view> </view>
<image class="right-icon" :src="shouyeyouImage"></image> </view>
</view> </view>
<view <!-- 订单推荐吸顶 -->
class="line-view" <u-sticky>
v-if="index != 2" <view class="sticky">
></view> <text>订单推荐</text>
</view> </view>
</view> </u-sticky>
</view> <view class="order-view">
<!-- 订单推荐吸顶 --> <!-- 入驻成功之后显示推荐订单列表 -->
<u-sticky> <view class="order-list-view" v-if="loaded">
<view class="sticky"> <!-- 入驻前-->
<text>订单推荐</text> <view v-if="needSettled" class="tip-view">
</view> <view class="tip-title">当前订单(笔)</view>
</u-sticky> <view class="tip-count">{{ count }}</view>
<view class="order-view"> <view class="tip-other">入驻通过后平台将向您推荐订单</view>
<!-- 入驻成功之后显示推荐订单列表 --> <u-button class="settle-button" type="primary" shape="circle" @click="immediatelyIn"
<view class="order-list-view"> :custom-style="buttonStyle">
<!-- 入驻前--> 立即入驻
<view v-if="needSettled" class="tip-view"> </u-button>
<view class="tip-title">当前订单(笔)</view> </view>
<view class="tip-count">{{ count }}</view> <view v-else-if="!needSettled && orderList.length > 0" class="order-item-view">
<view class="tip-other">入驻通过后平台将向您推荐订单</view> <view v-for="(item, index) in orderList" :key="index">
<u-button <OrderCell :orderData="item" :orderType="0" :location="location" @click="handleClick"
class="settle-button" @action="handleAction"> </OrderCell>
type="primary" </view>
shape="circle" <u-loadmore :status="currentLoadStatus" bgColor="#f2f2f2"></u-loadmore>
@click="immediatelyIn" </view>
:custom-style="buttonStyle" <!-- 入驻成功之后无推荐订单 -->
> <view v-else-if="!needSettled && orderList.length <= 0" class="no-order-view">
立即入驻 <image class="no-order-image" :src="wudingdanImage"></image>
</u-button> <text>当前暂无订单</text>
</view> </view>
<view </view>
v-else-if="!needSettled && orderList.length > 0" </view>
class="order-item-view" <!-- </view> -->
> <!-- </scroll-view> -->
<view v-for="(item, index) in orderList" :key="index"> <view class="bottom-view">
<OrderCell :orderData="item" :orderType="0" :location="location" @click="handleClick" @action="handleAction"> </OrderCell> <view class="bottom-line-view"></view>
</view> <view class="bottom-text">我也是有底线哒</view>
<u-loadmore <view class="bottom-line-view"></view>
:status="currentLoadStatus" </view>
bgColor="#f2f2f2" </view>
></u-loadmore>
</view>
<!-- 入驻成功之后无推荐订单 -->
<view
v-else-if="!needSettled && orderList.length <= 0"
class="no-order-view"
>
暂无订单
</view>
</view>
</view>
</view>
<!-- </scroll-view> -->
</view>
</template> </template>
<script> <script>
import util from "@/utils/util.js"; import util from "@/utils/util.js";
const app = getApp(); const app = getApp();
import OrderCell from "@/components/order/index.vue"; import OrderCell from "@/components/order/index.vue";
export default { export default {
components: { components: {
OrderCell, OrderCell,
}, },
data() { data() {
return { return {
status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交' status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
triggered: false, location: [116.3896, 39.91917], // 经纬度
location: [116.3896, 39.91917], // 经纬度 title: false,
// list: [ title: "Hello",
// { loaded: false,
// image: "https://cdn.uviewui.com/uview/swiper/1.jpg", needSettled: true,
// }, count: 0, // 推荐订单数量
// { messageList: [],
// image: "https://cdn.uviewui.com/uview/swiper/2.jpg", loadStatus: ["more", "loading", "noMore"],
// }, currentLoadStatus: "loading",
// { orderList: [],
// image: "https://cdn.uviewui.com/uview/swiper/3.jpg", search: {
// }, token: "",
// ], pageNumber: 0,
title: false, pageSize: 10,
// mode: "round", },
// indicatorPos: "bottomCenter", bottomLoading: false,
title: "Hello", };
loaded: false, },
needSettled: true, watch: {
count: 0, // 推荐订单数量 vuex_token(val) {
messageList: [], // 监听token变化,如果更新则重新加载页面数据
loadStatus: ["more", "loading", "noMore"], val && this.initSettleInfo()
currentLoadStatus: "loading", }
orderList: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}], },
search: { computed: {
token: "", buttonStyle() {
pageNumber: 0, return {
pageSize: 10, width: "400rpx",
}, height: "104rpx",
bottomLoading: false, "font-size": "32rpx",
}; "font-weight": "bold",
}, };
watch: { },
vuex_token(val){ msgStyleImage() {
// 监听token变化,如果更新则重新加载页面数据 return {
val && this.initSettleInfo() '1': process.uniEnv.qn_base_url + "zhiding.png", // 置顶
} '2': process.uniEnv.qn_base_url + "tongzhi.png", // 通知
}, '3': process.uniEnv.qn_base_url + "xiaoxi.png", // 消息
computed: { }
buttonStyle() { },
return { bannerImage() {
width: "400rpx", return process.uniEnv.qn_base_url + 'banner.png'
height: "104rpx", },
"font-size": "32rpx", shouyeyouImage() {
"font-weight": "bold", return process.uniEnv.qn_base_url + 'shouyeyou.png'
}; },
}, wudingdanImage() {
msgStyleImage() { return process.uniEnv.qn_base_url + 'wudingdan.png'
return { }
'1': process.uniEnv.qn_base_url + "zhiding.png", // 置顶 },
'2': process.uniEnv.qn_base_url + "tongzhi.png", // 通知 onLoad() {},
'3': process.uniEnv.qn_base_url + "xiaoxi.png", // 消息 onShow() {
} // 每次进入页面都刷新入驻状态
}, if (this.vuex_token) {
bannerImage() { this.initSettleInfo();
return process.uniEnv.qn_base_url + 'banner.png' } else {
}, // 初始化订单数据
shouyeyouImage() { this.loadOrderList();
return process.uniEnv.qn_base_url + 'shouyeyou.png' }
} },
}, onPullDownRefresh() {
onLoad() { console.log('------下拉刷新------')
this._freshing = false; // 下拉刷洗
this.triggered = false; this.initSettleInfo()
}, },
onShow() {
// 每次进入页面都刷新入驻状态 methods: {
if (this.vuex_token) { handleClick() { // 点击了cell
this.initSettleInfo(); console.log('点击了cell')
} else { },
// 初始化订单数据 handleAction() { // 点击了按钮
this.loadOrderList(); console.log('点击了按钮')
}
}, },
methods: { async initSettleInfo() {
handleClick() { // 点击了cell let self = this;
console.log('点击了cell') const callBack = (vm, result) => {
}, // 后台自动判断入驻流程是否完成,前台通过status确定状态
handleAction() { // 点击了按钮 if (result && result.record) {
console.log('点击了按钮') vm.loaded = true;
vm.needSettled = result.needSettled;
}, vm.status = Number(result.record.status || '0');
async initSettleInfo() { // vm.status = 8
let self = this; }
if (self.status == 7) return; };
const callBack = (vm, result) => { await app.getBaseInfo(self, callBack);
// 后台自动判断入驻流程是否完成,前台通过status确定状态
if (result && result.record) { // 加载消息列表
vm.loaded = true; self.loadMessageList();
vm.needSettled = result.needSettled; self.loadOrderList();
vm.status = Number(result.record.status || '0'); },
// vm.status = 8 loadMessageList() {
} let self = this;
}; self.$u.api.listByNotice().then((res) => {
await app.getBaseInfo(self, callBack); uni.stopPullDownRefresh() // 结束下拉刷新
if (res.code == 200) {
// 加载消息列表 if (res.data && res.data.length > 3) {
self.loadMessageList(); self.messageList = res.data.slice(0, 3);
self.loadOrderList(); } else {
}, self.messageList = res.data || [];
loadMessageList() { }
let self = this; } else {
self.$u.api.listByNotice().then((res) => { console.log(res.message, "初始化消息列表异常");
if (res.code == 200) { }
if (res.data && res.data.length > 3) { });
self.messageList = res.data.slice(0, 3); },
} else { loadOrderList() {
self.messageList = res.data || []; let self = this;
} // 加载订单列表
} else { self.search.token = self.vuex_token;
console.log(res.message, "初始化消息列表异常"); self.$u.api.listByRecommendOrder(self.search).then((res) => {
} uni.stopPullDownRefresh() // 结束下拉刷新
}); if (res.code == 200) {
}, if (res.data && res.data.length > 0) {
loadOrderList() { self.orderList.push().apply(res.data);
let self = this; }
// 加载订单列表 } else {
self.search.token = self.vuex_token; console.log(res.message, "初始化订单列表异常");
self.$u.api.listByRecommendOrder(self.search).then((res) => { }
if (res.code == 200) { });
if (res.data && res.data.length > 0) { },
self.orderList.push().apply(res.data); onRefresh() {
} if (this._freshing) return;
} else { this._freshing = true;
console.log(res.message, "初始化订单列表异常");
} // 获取入驻状态
}); this.initSettleInfo();
}, // 获取推荐订单及数量
onRefresh() { // ....
if (this._freshing) return;
this._freshing = true; setTimeout(() => {
// 数据加载完成更新入驻状态和推荐列表
// 获取入驻状态 this.triggered = false;
this.initSettleInfo(); this._freshing = false;
// 获取推荐订单及数量 }, 1000);
// .... },
onRestore() {
setTimeout(() => { this.triggered = "restore";
// 数据加载完成更新入驻状态和推荐列表 },
this.triggered = false; reachBottom() {
this._freshing = false; console.log("-----bottom will-----");
}, 1000); if (this.bottomLoading || this.currentLoadStatus == this.loadStatus[2]) {
}, return;
onRestore() { }
this.triggered = "restore"; console.log("-----bottom did-----");
},
reachBottom() { this.bottomLoading = true;
console.log("-----bottom will-----");
if (this.bottomLoading || this.currentLoadStatus == this.loadStatus[2]) { setTimeout(() => {
return; // 加载更多数据
} // ...
console.log("-----bottom did-----"); this.orderList.push(...[{}, {}, {}, {}, {}, {}, {}, {}, {}, {}]);
this.bottomLoading = true; // 加载完成
this.currentLoadStatus = false /*是否还有*/ ?
setTimeout(() => { this.loadStatus[1] :
// 加载更多数据 this.loadStatus[2];
// ... this.$nextTick(function() {
this.orderList.push(...[{}, {}, {}, {}, {}, {}, {}, {}, {}, {}]); this.bottomLoading = false;
});
// 加载完成 }, 1000);
this.currentLoadStatus = false /*是否还有*/ },
? this.loadStatus[1] // clickSwiper(index) {},
: this.loadStatus[2]; handleScroll() {
this.$nextTick(function () { console.log("-----scroll-------");
this.bottomLoading = false; },
}); immediatelyIn() {
}, 1000); if (this.vuex_token) {
}, // 0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
// clickSwiper(index) {}, var pageIndex = 1;
handleScroll() { switch (this.status) {
console.log("-----scroll-------"); case 1:
}, case 2:
immediatelyIn() { case 3:
if (this.vuex_token) { case 4:
// 0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交' pageIndex = 2;
var pageIndex = 1; break;
switch (this.status) { case 8:
case 1: pageIndex = 3;
case 2: break;
case 3: case 5:
case 4: case 6:
pageIndex = 2; pageIndex = 4;
break; break;
case 8: case 7:
pageIndex = 3; pageIndex = 5;
break; break;
case 5: default:
case 6: pageIndex = 1;
pageIndex = 4; break;
break; }
case 7:
pageIndex = 5; uni.navigateTo({
break; url: this.status > 0 ?
default: "/pages/settle/prompt?pageIndex=" + pageIndex : "/pages/settle/index",
pageIndex = 1; });
break; } else {
} uni.navigateTo({
url: "pages/login/index",
uni.navigateTo({ });
url: }
this.status > 0 },
? "/pages/settle/prompt?pageIndex=" + pageIndex },
: "/pages/settle/index", };
});
} else {
uni.navigateTo({
url: "pages/login/index",
});
}
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
height: 100vh; height: 100vh;
background-color: #f4f5f7; background-color: #f4f5f7;
padding: 0rpx 30rpx 0 30rpx; padding: 0rpx 30rpx 0 30rpx;
overflow-y: auto;
.scroll-view {
::-webkit-scrollbar { .title-view {
/*隐藏滚轮*/ color: #333333;
display: none; font-weight: bold;
} font-size: 40rpx;
} }
.title-view { .banner-image {
color: #333333; width: 730rpx;
font-weight: bold; height: 280rpx;
font-size: 40rpx; margin-left: -14rpx;
} }
.banner-image { .msg-view {
width: 730rpx; .msg-title {
height: 280rpx; color: #333333;
margin-left: -14rpx; font-size: 32rpx;
} font-weight: bold;
padding: 1rpx 0rpx 30rpx 0rpx;
.msg-view { }
.msg-title {
color: #333333; .msg-list-view {
font-size: 32rpx; border-radius: 12rpx;
font-weight: bold; background-color: #ffffff;
padding: 1rpx 0rpx 30rpx 0rpx; padding: 12rpx 30rpx;
} height: 252rpx;
}
.msg-list-view {
border-radius: 12rpx; .msg-content {
background-color: #ffffff; color: #333333;
padding: 12rpx 30rpx; font-size: 26rpx;
height: 252rpx;
} .msg-content-view {
display: flex;
.msg-content { align-items: center;
color: #333333; justify-content: space-between;
font-size: 26rpx; margin-top: 20rpx;
margin-bottom: 20rpx;
.msg-content-view {
display: flex; .left-view {
align-items: center; display: flex;
justify-content: space-between; align-items: center;
margin-top: 20rpx;
margin-bottom: 20rpx; .msg-icon {
width: 80rpx;
.left-view { height: 36rpx;
display: flex; margin-right: 20rpx;
align-items: center; }
.msg-icon { .msg-text {
width: 80rpx; text-overflow: ellipsis;
height: 36rpx; overflow: hidden;
margin-right: 20rpx; white-space: nowrap;
} width: 448rpx;
} }
}
.right-icon {
width: 14rpx; .right-icon {
height: 24rpx; width: 14rpx;
} height: 24rpx;
} }
}
.line-view {
height: 2rpx; .line-view {
background-color: #f4f5f7; height: 2rpx;
} background-color: #f4f5f7;
} }
} }
} }
}
.logo {
height: 200 rpx; .logo {
width: 100%; height: 200 rpx;
margin: 0 rpx auto 50 rpx auto; width: 100%;
} margin: 0 rpx auto 50 rpx auto;
}
.text-area {
display: flex; .text-area {
justify-content: center; display: flex;
} justify-content: center;
}
.title {
font-size: 36 rpx; .title {
color: #8f8f94; font-size: 36 rpx;
} color: #8f8f94;
}
// .sticky-view {
// position: sticky; // .sticky-view {
// position: -webkit-sticky; // position: sticky;
// top: 0rpx; // position: -webkit-sticky;
// width: 100%; // top: 0rpx;
// height: 200rpx; // width: 100%;
// background-color: black; // height: 200rpx;
// } // background-color: black;
// }
.sticky {
background-color: #f4f5f7; .sticky {
color: #fff; background-color: #f4f5f7;
padding: 24 rpx; color: #fff;
text-align: left; padding: 24 rpx;
font-size: 32rpx; text-align: left;
font-weight: bold; font-size: 32rpx;
color: #333333; font-weight: bold;
padding: 46rpx 0 28rpx 0; color: #333333;
} padding: 46rpx 0 28rpx 0;
}
.order-view {
text-align: center; .order-view {
text-align: center;
.order-list-view {
background-color: #ffffff; .order-list-view {
border-radius: 12rpx;
min-height: 460rpx; .tip-view {
padding: 30rpx; padding: 30rpx;
margin-bottom: 30rpx; background-color: #ffffff;
border-radius: 12rpx;
.order-item-view {
} .tip-title {
font-size: 32rpx;
.no-order-view { font-weight: bold;
} color: #333333;
margin-top: 30rpx;
.tip-view { }
.tip-title {
font-size: 32rpx; .tip-count {
font-weight: bold; color: #2272ff;
color: #333333; font-size: 70rpx;
margin-top: 30rpx; font-weight: bold;
} margin-top: 50rpx;
margin-bottom: 20rpx;
.tip-count { }
color: #2272ff;
font-size: 70rpx; .tip-other {
font-weight: bold; font-size: 28rpx;
margin-top: 50rpx; color: #333333;
margin-bottom: 20rpx; margin-bottom: 56rpx;
} }
}
.tip-other {
font-size: 28rpx; .order-item-view {
color: #333333; background-color: #F4F5F7;
margin-bottom: 56rpx; border-radius: 12rpx;
} }
}
} .no-order-view {
} display: flex;
</style> flex-direction: column;
justify-content: center;
align-items: center;
color: #666666;
font-size: 28rpx;
padding: 30rpx;
background-color: #ffffff;
border-radius: 12rpx;
min-height: 460rpx;
.no-order-image {
width: 374rpx;
height: 218rpx;
margin-top: 70rpx;
margin-bottom: 20rpx;
}
}
}
}
.bottom-view {
display: flex;
align-items: center;
justify-content: space-between;
padding: 50rpx 40rpx 50rpx 40rpx;
.bottom-line-view {
background-color: #D5D5D5;
height: 2rpx;
width: 30%;
}
.bottom-text {
color: #999999;
font-size: 24rpx;
}
}
</style>
...@@ -45,8 +45,12 @@ ...@@ -45,8 +45,12 @@
} }
], ],
selectId:[], selectId:[],
}; };
}, },
onLoad() {
this.getUserExamInfo()
},
methods: { methods: {
abc() { abc() {
console.log("11111") console.log("11111")
...@@ -73,7 +77,10 @@ ...@@ -73,7 +77,10 @@
this.selectId.push(this.list[index].title) this.selectId.push(this.list[index].title)
console.log("选中的值", this.selectId) console.log("选中的值", this.selectId)
} }
} },
}, },
mounted() { mounted() {
console.log("111111") console.log("111111")
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
<view class="title">考试规则说明</view> <view class="title">考试规则说明</view>
<view class="test"> <view class="test">
<view class="text"> <view class="text">
<text class="left">考试科目:</text><text style="color: #007AFF;">服务规范</text> <text class="left">考试科目:</text><text style="color: #007AFF;">{{exam.examName}}</text>
</view> </view>
<view class="text"> <view class="text">
<text class="left">合格条件:</text><text>随机20题,答对20题</text> <text class="left">合格条件:</text><text>{{exam.ruleDisc}}</text>
</view> </view>
<view class="text"> <view class="text">
<text class="left">考试时间:</text><text>30分钟</text> <text class="left">考试时间:</text><text>30分钟</text>
...@@ -26,9 +26,13 @@ ...@@ -26,9 +26,13 @@
export default { export default {
data() { data() {
return { return {
examId:1,
exam:null
} }
}, },
onLoad() {
this.getUserExamInfo()
},
methods: { methods: {
aaa(){ aaa(){
...@@ -36,7 +40,83 @@ ...@@ -36,7 +40,83 @@
url:'./answer' url:'./answer'
}) })
} },
//获取考试信息
getUserExamInfo: function() {
uni.showLoading({
title: '请稍候'
})
let that = this
uni.request({
url: 'https://system.banshouhui.com' +
'/wxh-worker-rest/rest/exam' +
'/serviceRule/userExamInfo/' +
'RTOKENf86a7c0606ef5ebf36f211ace3466b7f9de56e37' +
'?examId=' + this.examId,
method: 'POST',
data: {
//examId:this.examId,
},
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
success: (res) => {
console.log(res.data)
uni.hideLoading()
if (!res.data) {
return
}
if (res.data.code == 401 || res.data.code == 403) {
// uni.navigateTo({
// url: '/pages/login/wxlogin'
// })
// return
console.log('洪塘张学友')
}
if (res.data.code == 200) {
//examStatus 用户考试状态 0考试中 1考试完成 2未参与
that.exam = res.data.data
console.log(that.exam)
if (res.data.data.examStatus == 2) {
that.applyExam()
return
}
if(res.data.data.examStatus == 1){
console.log('111111111111111111111111111')
that.isComplete = true
that.examScore = res.data.data.examScore
that.postResult()
return
}
if (res.data.data.examStatus == 0 ) {
that.userExamId = res.data.data.id
that.getNext()
}
} else {
uni.showToast({
icon: 'none',
title: res.data.message
})
}
},
fail: (e) => {
uni.hideLoading()
uni.showToast({
icon: 'none',
title: '获取考试信息失败'
})
}
})
},
} }
} }
</script> </script>
......
...@@ -163,7 +163,8 @@ export default { ...@@ -163,7 +163,8 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y:auto;
} }
.course-video { .course-video {
......
...@@ -15,59 +15,22 @@ ...@@ -15,59 +15,22 @@
<view class="" style="font-size: 40rpx;font-weight:1000"> <view class="" style="font-size: 40rpx;font-weight:1000">
目录 目录
</view> </view>
<view class="" style="font-size: 40rpx;font-weight: 1000;"> <view v-for="item in list">
第一章 充电桩常见问题答疑 <view class="chapter">
</view> {{item.name}}
<view class="video" >
<view class="video_1" >
<view class="text" >
视频
</view>
<text class="text2">1-1唯修汇公司简介</text>
</view>
<view class="video_1" >
<view class="text">
视频
</view>
<text class="text2">1-2可接单评定标准</text>
</view>
<view class="video_1" >
<view class="text">
视频
</view>
<text class="text2">1-3结算规则</text>
</view>
<view class="video_1">
<view class="text">
视频
</view>
<text class="text2">1-4充电桩安装开城计划</text>
</view>
<view class="video_1">
<view class="text">
视频
</view>
<text class="text2">1-5缴纳质保金和费用答疑</text>
</view>
<view class="video_1" >
<view class="text" >
视频
</view>
<text class="text2">1-6安装材料品牌答疑1</text>
</view>
<view class="video_1" >
<view class="text">
视频
</view>
<text class="text2">1-7安装材料答疑2</text>
</view> </view>
<view class="video_1"> <view class="video" v-for="key in item.section" @click=details(key.id)>
<view class="text"> <view class="video_1" >
视频 <view class="text" v-text="key.ware=='0'?'视频':'图文'">
</view>
<text>1-{{key.order}}</text>
<text class="text2">{{key.name}}</text>
<text class="text3" v-text="key.isLearned==false?'未开始':'完成'"></text>
</view> </view>
<text class="text2">1-8其他问题答疑</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
...@@ -77,11 +40,72 @@ ...@@ -77,11 +40,72 @@
export default { export default {
data() { data() {
return { return {
params:{
course_id:0,
},
list:[],
examId:1,
} }
}, },
onLoad(a){
console.log(a)
this.params.course_id=a.course_id
console.log(this.params.course_id)
this.getCapterDetails()
},
methods: { methods: {
//获取章节详情
getCapterDetails() {
console.log(1111111)
this.$u.api
.ChapterDetails(this.params)
.then((res) => {
if (res.code == 200) {
if (res.data) {
this.list = this.list.concat(res.data);
console.log(this.list)
if (res.data.length < 5) {
//判断接口返回数据量小于请求数据量,则表示此为最后一页
this.isLoadMore = true;
this.loadStatus = "nomore";
} else {
this.isLoadMore = false;
}
} else {
this.isLoadMore = true;
this.loadStatus = "nomore";
}
} else {
//接口请求失败的处理
uni.showToast({
title: res.message,
icon: "none"
});
this.isLoadMore = false;
if (this.params.start > 0) {
this.page -= 5;
}
}
})
.catch((err) => {
uni.showToast({
title: err,
icon: "none",
});
this.isLoadMore = false;
if (this.params.start > 0) {
this.page -= 5;
}
});
},
//跳转到小节
details(id){
console.log(id)
uni.navigateTo({
url:"./section?section_id=" + id
})
}
} }
} }
</script> </script>
...@@ -101,9 +125,18 @@ ...@@ -101,9 +125,18 @@
width: 128rpx; width: 128rpx;
height: 128rpx; height: 128rpx;
} }
.chapter{
font-size: 37rpx;
font-weight: 700;
}
.video{
width: 100%;
}
.video_1{ .video_1{
display: flex; display: flex;
margin: 20rpx 0; margin: 20rpx 0;
position: relative;
width: 100%;
.text{ .text{
width: 100rpx; width: 100rpx;
height: 38rpx; height: 38rpx;
...@@ -114,8 +147,15 @@ ...@@ -114,8 +147,15 @@
} }
.text2{ .text2{
width: 397rpx;
font-size: 33rpx; font-size: 33rpx;
color: #82848A; color: #82848A;
margin-right: 0rpx;
}
.text3{
float: right;
position: relative;
right: 0;
} }
} }
</style> </style>
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
return { return {
'color': '#FFFFFF', 'color': '#FFFFFF',
'width': '500rpx', 'width': '500rpx',
'height': '112rpx', 'height': '104rpx',
'background-color': '#2272FF', 'background-color': '#2272FF',
'font-size': '32rpx', 'font-size': '32rpx',
'font-weight': 'bold' 'font-weight': 'bold'
...@@ -226,7 +226,8 @@ ...@@ -226,7 +226,8 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y:auto;
} }
.exam-head { .exam-head {
...@@ -234,10 +235,10 @@ ...@@ -234,10 +235,10 @@
font-weight: bold; font-weight: bold;
} }
.content-gap { // .content-gap {
height: 1rpx; // height: 1rpx;
margin-bottom: 200rpx; // margin-bottom: 200rpx;
} // }
.tip-text { .tip-text {
background-color: #FFFFFF; background-color: #FFFFFF;
...@@ -271,7 +272,7 @@ ...@@ -271,7 +272,7 @@
margin-bottom: 20rpx; margin-bottom: 20rpx;
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
margin-bottom: 188rpx; // margin-bottom: 188rpx;
.tip-bottom-h { .tip-bottom-h {
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
......
<template> <template>
<view class="study"> <view class="study">
<view class="banner"> <u-navbar
<u-swiper :list="banner"></u-swiper> :is-back="false"
</view> background="{background: transparent}"
:border-bottom="false"
:is-fixed="false"
>
<text class="title-view">学习</text>
</u-navbar>
<image :src="bannerImage" mode="" class="banner"></image>
<!-- <u-tabs :list="tabs" :is-scroll="false" :current="current" @change="change"></u-tabs> --> <!-- <u-tabs :list="tabs" :is-scroll="false" :current="current" @change="change"></u-tabs> -->
<view> <view>
<u-tabs-swiper ref="uTabs" :list="tabs" :current="current" @change="tabsChange" :is-scroll="false" <u-tabs-swiper bg-color="#F4F5F7" inactive-color="#999999" font-size="28" ref="uTabs" :list="tabs" :current="current" @change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
swiperWidth="750"></u-tabs-swiper> </view>
</view> <swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" style="height: 755rpx;">
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" > <swiper-item class="swiper-item">
<swiper-item class="swiper-item"> <scroll-view scroll-y style="height:796rpx;width:100%;" @scrolltolower="onreachBottom">
<scroll-view scroll-y style="height: 800rpx;width:100%;" @scrolltolower="onreachBottom"> <view class="standard" @click="goToPrint">
<view class="standard" @click="goToPrint"> <text>充电桩交付规范</text>
<text>充电桩交付规范</text> <text>></text>
<text >></text> </view>
</view> </scroll-view>
</scroll-view> </swiper-item>
</swiper-item> <swiper-item class="swiper-item">
<swiper-item class="swiper-item"> <scroll-view scroll-y style="height:100%;width:100%;" @scrolltolower="onreachBottom">
<scroll-view scroll-y style="height: 666rpx;width:100%;" @scrolltolower="onreachBottom" > <view v-for="item in list" :key="item.id" class="notice" @click="bbb(item)">
<view v-for="item in list" :key="item.id" class="notice" @click="bbb"> <view class="n-head">
<view class="n-head"> 《{{item.title}}》
《{{item.title}}》 </view>
<view class="news" v-html="item.body">
{{item.body}}
</view>
</view>
<view v-shou="isLoadMore">
<u-loadmore :status="loadStatus" />
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height:100%;width:100%;">
<view class="lean">
<view class="top">
<view class="currency-class">
<view class="title">通用课程</view>
<view class="class1" @click=ccc(173)>
<image class="img" :src=courselist.course.preview_pic mode=""></image>
<view class="right">
<view class="">
{{courselist.course.name}}
</view>
<view class="intro" v-html="courselist.course.intro">
{{courselist.course.intro}}
</view>
<view class="" style="display:flex;justify-content: space-between;">
<u-line-progress active-color="#2979ff" :percent=courselist.learnedInfo.learnPercent style="width:54%;"></u-line-progress>
<text v-text="(courselist.learnedInfo.isLearned) ?(courselist.learnedInfo.learnPercent==1)?'已完成':'继续':'未观看' "></text>
</view>
</view>
</view> </view>
<view class=""> <view class="class1">
{{item.body}} <image class="img" src="../../static/logo.png" mode=""></image>
<view class="right">
<view class="">
接单操作
</view>
<view class="">
快速学习,使用APP接单、抢单
</view>
<view class="" style="display:flex;justify-content: space-between;">
<u-line-progress active-color="#2979ff" :percent="30" style="width:54%;"></u-line-progress>
<text>继续</text>
</view>
</view>
</view> </view>
</view> </view>
<view v-shou="isLoadMore"> <view class="currency-class">
<u-loadmore :status="loadStatus" /> <view class="title">技能课程</view>
<view class="class1">
<image class="img" src="../../static/logo.png" mode=""></image>
<view class="right">
<view class="">
从0-1学习充电桩安装服务
</view>
<view class="">
让你全面了解充电桩市场及服务规范
</view>
<view class="" style="display:flex;justify-content: space-between;">
<u-line-progress active-color="#2979ff" :percent="100" style="width:54%;"></u-line-progress>
<text>完成</text>
</view>
</view>
</view>
</view> </view>
</scroll-view> </view>
</swiper-item> </view>
<swiper-item class="swiper-item"> </scroll-view>
<scroll-view scroll-y style="height:500rpx;width:100%;"> </swiper-item>
<view class="lean"> <swiper-item>
<view class="top"> <scroll-view scroll-y style="height:100%;width:100%;" @scrolltolower="onreachBottom">
<view class="currency-class"> <view class="lean">
<text class="title">通用课程</text> <view class="top">
<view class="class1"> <view class="currency-class">
<image class="img" src="../../static/logo.png" mode=""></image> <text class="title">通用认证</text>
<view class="right"> <view class="class1" @click="aaa">
<view class=""> <image class="img" src="../../static/logo.png" mode=""></image>
服务规范 <view class="right">
</view> <view class="">
<view class=""> 服务规范
为用户提供更好服务,自己赚更多钱
</view>
<view class="" style="display:flex;justify-content: space-between;">
<u-line-progress active-color="#2979ff" :percent="30" style="width:54%;"></u-line-progress>
<text>继续</text>
</view>
</view>
</view> </view>
<view class="class1"> <view class="">
<image class="img" src="../../static/logo.png" mode=""></image> 通过本认证,是接单的前提条件
<view class="right"> </view>
<view class=""> <view class="" style="display:flex;justify-content: space-between;">
接单操作 <text style="color: #a69999;">随机20题,及格20题</text>
</view> <text>通过</text>
<view class="">
快速学习,使用APP接单、抢单
</view>
<view class="" style="display:flex;justify-content: space-between;">
<u-line-progress active-color="#2979ff" :percent="30" style="width:54%;"></u-line-progress>
<text>未观看</text>
</view>
</view>
</view> </view>
</view> </view>
<view class="currency-class"> </view>
<text class="title">技能课程</text> <view class="class1" @click="aaa">
<view class="class1"> <image class="img" src="../../static/logo.png" mode=""></image>
<image class="img" src="../../static/logo.png" mode=""></image> <view class="right">
<view class="right"> <view class="">
<view class=""> 接单操作
从0-1学习充电桩安装服务 </view>
</view> <view class="">
<view class=""> 快速认证,是否具备接单操作能力
让你全面了解充电桩市场及服务规范 </view>
</view> <view class="" style="display:flex;justify-content: space-between;">
<view class="" style="display:flex;justify-content: space-between;"> <text style="color: #a69999">随机20题,及格16题</text>
<u-line-progress active-color="#2979ff" :percent="100" style="width:54%;"></u-line-progress> <text>未通过</text>
<text>完成</text>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</scroll-view> <view class="currency-class">
</swiper-item> <text class="title">技能认证</text>
<swiper-item> <view class="class1" @click="aaa">
<scroll-view scroll-y style="height:800rpx;width:100%;" @scrolltolower="onreachBottom"> <image class="img" src="../../static/logo.png" mode=""></image>
<view class="lean"> <view class="right">
<view class="top"> <view class="">
<view class="currency-class"> 从0-1学习充电桩安装服务
<text class="title">通用认证</text>
<view class="class1" @click="aaa">
<image class="img" src="../../static/logo.png" mode=""></image>
<view class="right">
<view class="">
服务规范
</view>
<view class="">
通过本认证,是接单的前提条件
</view>
<view class="" style="display:flex;justify-content: space-between;">
<text>随机20题,及格20题</text>
<text>通过</text>
</view>
</view>
</view> </view>
<view class="class1" @click="aaa"> <view class="">
<image class="img" src="../../static/logo.png" mode=""></image> 通过本认证后,可接充电桩业务单
<view class="right">
<view class="">
接单操作
</view>
<view class="">
快速认证,是否具备接单操作能力
</view>
<view class="" style="display:flex;justify-content: space-between;">
<text>随机20题,及格16题</text>
<text>未通过</text>
</view>
</view>
</view> </view>
</view> <view class="" style="display:flex;justify-content: space-between;">
<view class="currency-class"> <text style="color: #a69999;">随机30题,及格25题</text>
<text class="title">技能认证</text> <text>未通过</text>
<view class="class1" @click="aaa">
<image class="img" src="../../static/logo.png" mode=""></image>
<view class="right">
<view class="">
从0-1学习充电桩安装服务
</view>
<view class="">
通过本认证后,可接充电桩业务单
</view>
<view class="" style="display:flex;justify-content: space-between;">
<text>随机30题,及格25题</text>
<text>未通过</text>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</scroll-view> </view>
</swiper-item> </view>
</swiper> </scroll-view>
</view> </swiper-item>
</swiper>
</view>
</view> </view>
</template> </template>
...@@ -159,20 +165,7 @@ ...@@ -159,20 +165,7 @@
export default { export default {
data() { data() {
return { return {
banner: [ msg: "赣南吴彦祖",
{
image: "https://cdn.uviewui.com/uview/swiper/1.jpg",
title: "昨夜星辰昨夜风,画楼西畔桂堂东",
},
{
image: "https://cdn.uviewui.com/uview/swiper/2.jpg",
title: "身无彩凤双飞翼,心有灵犀一点通",
},
{
image: "https://cdn.uviewui.com/uview/swiper/3.jpg",
title: "谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳",
},
],
tabs: [ tabs: [
{ {
name: "交付规范", name: "交付规范",
...@@ -193,15 +186,23 @@ export default { ...@@ -193,15 +186,23 @@ export default {
start: 0, start: 0,
}, },
list: [], list: [],
courselist: null,
loadStatus: "loading", //加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式 loadStatus: "loading", //加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式
isLoadMore: false, //是否加载中 isLoadMore: false, //是否加载中
course_id: "course_id_=173",
exam: null,
}; };
}, },
onLoad() { onLoad() {
this.getList(); this.getList();
this.$u.mpShare.path = '' this.getCourseList();
this.getUserExamInfo();
},
computed: {
bannerImage() {
return process.uniEnv.qn_base_url + "banner-xx.png";
},
}, },
methods: { methods: {
getList() { getList() {
this.$u.api this.$u.api
...@@ -223,7 +224,54 @@ export default { ...@@ -223,7 +224,54 @@ export default {
} }
} else { } else {
//接口请求失败的处理 //接口请求失败的处理
uni.showToast({ title: res.message, icon: "none" }); uni.showToast({
title: res.message,
icon: "none",
});
this.isLoadMore = false;
if (this.params.start > 0) {
this.page -= 5;
}
}
})
.catch((err) => {
uni.showToast({
title: err,
icon: "none",
});
this.isLoadMore = false;
if (this.params.start > 0) {
this.page -= 5;
}
});
},
//在线学习通用课程信息
getCourseList() {
this.$u.api
.CourseList()
.then((res) => {
if (res.code == 200) {
if (res.data) {
this.courselist = res.data;
console.log("--------");
console.log(this.courselist);
if (res.data.length < 5) {
//判断接口返回数据量小于请求数据量,则表示此为最后一页
this.isLoadMore = true;
this.loadStatus = "nomore";
} else {
this.isLoadMore = false;
}
} else {
this.isLoadMore = true;
this.loadStatus = "nomore";
}
} else {
//接口请求失败的处理
uni.showToast({
title: res.message,
icon: "none",
});
this.isLoadMore = false; this.isLoadMore = false;
if (this.params.start > 0) { if (this.params.start > 0) {
this.page -= 5; this.page -= 5;
...@@ -262,11 +310,30 @@ export default { ...@@ -262,11 +310,30 @@ export default {
url: "./assessment", url: "./assessment",
}); });
}, },
//跳转到课程介绍
ccc(id) {
uni.navigateTo({
url: "./curriculum?course_id=" + id,
});
},
//跳转到 //跳转到
bbb() { bbb(e) {
wx.navigateTo({ var news = {
body: e.body,
id: e.id,
level: e.level,
title: e.title,
};
// console.log(news)
uni.navigateTo({
url: "./news-details", url: "./news-details",
}); });
setTimeout(() => {
uni.$emit("news", news), console.log("发送数据");
}, 500);
console.log("跳转结束11111111");
}, },
//scroll-view到底部加载更多 //scroll-view到底部加载更多
onreachBottom() { onreachBottom() {
...@@ -294,20 +361,99 @@ export default { ...@@ -294,20 +361,99 @@ export default {
}, },
}); });
}, },
//考核认证,通用认证,考试通过or未通过查询接口请求
getUserExamInfo() {
uni.showLoading({
title: "请稍候",
});
let that = this;
uni.request({
url:
"http://192.168.1.22" +
"/wxh-worker-rest/rest/exam" +
"/serviceRule/userExamInfo/" +
getApp().globalData.token +
"?examId=" +
2,
method: "POST",
data: {
//examId:this.examId,
},
header: {
"Content-Type": "application/x-www-form-urlencoded",
},
success: (res) => {
console.log(res.data);
uni.hideLoading();
if (!res.data) {
return;
}
if (res.data.code == 401 || res.data.code == 403) {
// uni.navigateTo({
// url: '/pages/login/wxlogin'
// })
// return
console.log("洪塘张学友");
}
if (res.data.code == 200) {
//examStatus 用户考试状态 0考试中 1考试完成 2未参与
that.exam = res.data.data;
console.log(that.exam);
if (res.data.data.examStatus == 2) {
that.applyExam();
return;
}
if (res.data.data.examStatus == 1) {
console.log("111111111111111111111111111");
that.isComplete = true;
that.examScore = res.data.data.examScore;
that.postResult();
return;
}
if (res.data.data.examStatus == 0) {
that.userExamId = res.data.data.id;
that.getNext();
}
} else {
uni.showToast({
icon: "none",
title: res.data.message,
});
}
},
fail: (e) => {
uni.hideLoading();
uni.showToast({
icon: "none",
title: "获取考试信息失败",
});
},
});
},
}, },
}; };
</script> </script>
<style> <style>
.study { .study {
background: #f9f9f9; height: 100vh;
padding: 15rpx; background-color: #f4f5f7;
height: 100%; padding: 0rpx 30rpx 0 30rpx;
}
.title-view {
color: #333333;
font-weight: bold;
font-size: 40rpx;
} }
.banner { .banner {
padding: 2rpx; width: 690rpx;
height: 240rpx;
/* margin-left: -15rpx; */
} }
//交付规范
/* //交付规范 */
.standard { .standard {
width: 656rpx; width: 656rpx;
display: flex; display: flex;
...@@ -316,24 +462,34 @@ export default { ...@@ -316,24 +462,34 @@ export default {
padding: 0 34rpx; padding: 0 34rpx;
margin: 72rpx auto; margin: 72rpx auto;
} }
//培训通知
/* //培训通知 */
.notice { .notice {
border: #808080 solid 2rpx; border: #808080 solid 2rpx;
width: 100%; width: 100%;
height: 400rpx; height: 400rpx;
margin-top: 36rpx; margin-top: 36rpx;
overflow: hidden;
} }
.n-head { .n-head {
text-align: center; text-align: center;
margin: 32rpx 0; margin: 32rpx 0;
} }
//在线学习 .news {
}
/* //在线学习 */
.currency-class { .currency-class {
width: 100%; width: 100%;
height: 455rpx;
background: #ffffff; background: #ffffff;
padding: 18rpx; padding: 18rpx;
margin-bottom: 11px; margin-bottom: 11px;
border-radius: 12rpx;
}
.title {
font-size: 32rpx;
font-weight: bold;
font-family: PingFang-SC-Bold, PingFang-SC;
} }
.class1 { .class1 {
display: flex; display: flex;
...@@ -342,31 +498,41 @@ export default { ...@@ -342,31 +498,41 @@ export default {
margin-top: 28rpx; margin-top: 28rpx;
border-top: 1rpx solid #808080; border-top: 1rpx solid #808080;
} }
.img { .img {
width: 200rpx; width: 201rpx;
height: 126rpx; height: 201rpx;
display: block; display: block;
margin-right: 0rpx; margin-right: 0rpx;
} }
.right { .right {
width: 428rpx; width: 428rpx;
height: 147rpx; display: flex;
flex-direction: column;
justify-content: space-between;
}
.intro {
color: #9999a6;
} }
.tab { .tab {
background: #fff; background: #fff;
height: 82rpx; height: 82rpx;
margin: 0 0; margin: 0 0;
} }
.text { .text {
margin: 0 40rpx; margin: 0 40rpx;
line-height: 82rpx; line-height: 82rpx;
color: #667eb5; color: #667eb5;
} }
.content { .content {
margin: 5px 0; margin: 5px 0;
height: 485rpx; height: 485rpx;
background: #fff; background: #fff;
} }
swiper { swiper {
height: 691rpx; height: 691rpx;
} }
......
<template> <template>
<view> <view>
<view class="title"> <view class="title">
《关于充电桩xxxx》 {{newsInfo.title}}
</view> </view>
<view class="content"> <view class="content" v-html="newsInfo.body">
于2021年3月23日 10:00 进行《xxx》内容进行培训。 <button @click="add">aaa</button>
{{newsInfo.body}}
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 。
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
</view> </view>
</view> </view>
</template> </template>
...@@ -18,10 +14,24 @@ ...@@ -18,10 +14,24 @@
export default { export default {
data() { data() {
return { return {
banner:{},
obj:{
},
newsInfo:null
} }
}, },
methods: { methods: {
},
onLoad() {
},
onShow(){
uni.$on('news',(news)=>{
this.newsInfo = news;
console.log(news,'news')
})
}, },
onLoad() { onLoad() {
......
<template> <template>
<view class="content"> <view class="test-result">
<view class="title"> <text class="title">考试结果</text>
考试结果
</view>
<view class="result"> <view class="result">
未通过 未通过
</view> </view>
<view class="details"> <view class="test-explain">
<view class=""> <view class="hang">
<text class="first">合格条件:</text><text>答对20题</text> <text class="text1">合格条件:</text><text class="text2">答对20题</text>
</view>
<view class="">
<text class="first">考试结果:</text><text>答对10题</text>
</view> </view>
<view class=""> <view class="hang">
<text class="first">考试用时</text><text>16分29秒</text> <text class="text1">考试结果:</text><text class="text2">答对10题</text>
</view> </view>
<view class="btn"> <view class="hang">
<button class="btn1">再答一次</button> <text class="text1">考试用时:</text><text class="text2">16分29秒</text>
<button class="btn2">退出重考</button>
</view> </view>
</view> </view>
<view class="btn">
<button class="btn1">再答一次</button>
<button class="btn2">退出重考</button>
</view>
</view> </view>
</template> </template>
...@@ -32,57 +29,61 @@ ...@@ -32,57 +29,61 @@
} }
}, },
methods:{ methods: {
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.content{ .test-result{
width: 100%; width: 610rpx;
height: 950rpx; height: 965rpx;
background: #DCDFE6; margin: 70rpx auto 0;
padding: 53rpx; .title{
} margin: 0 44rpx 0;
.title{
font-size: 30rpx;
}
.result{
color: red;
font-size: 73rpx;
text-align: center;
margin: 46rpx 0;
}
.details{
border-top: 2rpx dashed #808080;
height: 600rpx;
padding-top: 94rpx;
view{
margin: 26rpx 0 0;
.first{
margin: 0 20rpx 0;
}
} }
} .result{
.btn{ color: red;
.btn1{ font-size: 66rpx;
width: 477rpx; text-align: center;
height: 61rpx; border-bottom: 1px dashed #000000;
border-radius: 27rpx; margin: 74rpx 0;
line-height: 61rpx; padding: 66rpx;
font-size: 29rpx; }
background: #007AFF; .test-explain{
color: #FFFFFF; .hang{
margin: 140rpx auto 34rpx; margin: 26rpx 26rpx;
.text1{
color: #a69999;
margin-right: 22rpx;
}
.text2{
color: #333333;
}
}
} }
.btn2{ .btn{
width: 477rpx; margin-top: 236rpx;
height: 61rpx; .btn1{
border-radius: 27rpx; width: 478rpx;
line-height: 61rpx; height: 60rpx;
font-size: 29rpx; background: #0079fe;
color: #fff;
font-size: 26rpx;
line-height: 60rpx;
margin: 20rpx auto;
}
.btn2{
width: 478rpx;
height: 60rpx;
background: #f2f2f2;
color: #333333;
font-size: 26rpx;
line-height: 60rpx;
margin:0 auto;
}
} }
} }
</style> </style>
\ No newline at end of file
<template>
<view>
<view class="title">
{{CourseSectionlist.name}}
</view>
<view class="content" v-html="CourseSectionlist.content">
{{CourseSectionlist.content}}
</view>
</view>
</template>
<script>
export default {
data() {
return {
CourseSectionlist:null,
section_id:{
section_id:0
}
}
},
onLoad(id) {
this.section_id.section_id = id.section_id
this.getCourseSection()
},
methods: {
getCourseSection() {
this.$u.api
.CourseSection(this.section_id)
.then((res) => {
if (res.code == 200) {
if (res.data) {
this.CourseSectionlist = res.data;
console.log("--------")
console.log(this.CourseSectionlist)
if (res.data.length < 5) {
//判断接口返回数据量小于请求数据量,则表示此为最后一页
this.isLoadMore = true;
this.loadStatus = "nomore";
} else {
this.isLoadMore = false;
}
} else {
this.isLoadMore = true;
this.loadStatus = "nomore";
}
} else {
//接口请求失败的处理
uni.showToast({
title: res.message,
icon: "none"
});
this.isLoadMore = false;
if (this.params.start > 0) {
this.page -= 5;
}
}
})
.catch((err) => {
uni.showToast({
title: err,
icon: "none",
});
this.isLoadMore = false;
if (this.params.start > 0) {
this.page -= 5;
}
});
},
}
}
</script>
<style lang="scss">
.title{
text-align: center;
font-size: 45rpx;
font-weight: 700;
margin: 24rpx;
}
.content{
font-size: 30rpx;
padding: 50rpx;
}
</style>
<template> <template>
<view> <view>
<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30"> <u-navbar v-if="!takeStatus" :is-back="false" :title-size="26" title-color="#000" title="我的"></u-navbar>
<view class="u-m-r-10"> <view v-if="!takeStatus">
<u-avatar :src="pic" size="140"></u-avatar> <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>
<view class="u-flex-1">
<view class="u-font-18 u-p-b-20">uView ui</view> <view class="u-m-t-20">
<view class="u-font-14 u-tips-color">微信号:helang_uView</view> <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 class="u-m-t-20" @click="take">
<u-cell-group>
<u-cell-item icon="setting" title="相机组件测试"></u-cell-item>
</u-cell-group>
</view> </view>
</view> </view>
<take-photo type="test" v-if="takeStatus" @close="closeTake"></take-photo>
<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> </view>
</template> </template>
<script> <script>
import takePhoto from '@/components/take/index.vue'
export default { export default {
components: {
'take-photo': takePhoto
},
data() { data() {
return { return {
pic:'https://uviewui.com/common/logo.png', pic:'https://uviewui.com/common/logo.png',
show:true show:true,
takeStatus: false
} }
}, },
computed: { computed: {
...@@ -50,7 +64,13 @@ ...@@ -50,7 +64,13 @@
}, },
methods: { methods: {
take() {
uni.hideTabBar()
this.takeStatus = true
},
closeTake() {
this.takeStatus = false
}
} }
} }
</script> </script>
......
...@@ -22,13 +22,13 @@ ...@@ -22,13 +22,13 @@
<view class="city-text">{{cityText}}</view> <view class="city-text">{{cityText}}</view>
</view> </view>
</view> </view>
<view class="base-item" style="height: 600rpx;"> <view class="base-item" style="margin-bottom: 0rpx;">
<view class="item item-select" @click="gopage('/pages/settle/select?selectType=working_age')"> <view class="item item-select" @click="gopage('/pages/settle/select?selectType=working_age')">
<view class="flex-center"> <view class="flex-center">
<image class="item-image" :src="mixingImage"></image> <image class="item-image" :src="mixingImage"></image>
<text class="label">电工工龄(年)</text> <text class="label">电工工龄(年)</text>
</view> </view>
<p :class="['u-flex-1 u-text-right area', {before: !baseInfo.working_age}]"> <p :class="['u-flex-1 u-text-right area', {before: baseInfo.working_age === ''}]">
{{ baseInfo.working_age !== '' ? workingAgeTxt : '去选择'}} {{ baseInfo.working_age !== '' ? workingAgeTxt : '去选择'}}
</p> </p>
<u-icon name="arrow-right" color="#2272FF" size="28"></u-icon> <u-icon name="arrow-right" color="#2272FF" size="28"></u-icon>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="seat"></view> <!-- <view class="seat"></view> -->
<template v-slot:bottom> <template v-slot:bottom>
<view class="btn-wrap flex-xc"> <view class="btn-wrap flex-xc">
<u-button class="btn-submit" @click="$u.debounce(submitBaseInfo, 500)" :custom-style="buttonStyle" <u-button class="btn-submit" @click="$u.debounce(submitBaseInfo, 500)" :custom-style="buttonStyle"
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
submitStatus() { submitStatus() {
const baseInfo = this.baseInfo const baseInfo = this.baseInfo
//baseInfo.name && baseInfo.mobile && //baseInfo.name && baseInfo.mobile &&
const flag = baseInfo.service_area && baseInfo.working_age !== '' && baseInfo.address const flag = baseInfo.service_area.length > 0 && baseInfo.working_age !== '' && baseInfo.address !== ''
return flag && !this.saving return flag && !this.saving
}, },
cityText() { cityText() {
...@@ -235,7 +235,7 @@ ...@@ -235,7 +235,7 @@
} }
this.baseInfo = res.data this.baseInfo = res.data
uni.showToast({ uni.showToast({
title: '入驻基本信息提交成功', title: '提交成功',
icon: 'success' icon: 'success'
}); });
}, },
...@@ -326,7 +326,9 @@ ...@@ -326,7 +326,9 @@
*/ */
async submitBaseInfo() { async submitBaseInfo() {
if (!this.submitStatus) {
return
}
// this.newSubmitBaseInfo() // this.newSubmitBaseInfo()
// return // return
const baseInfo = this.baseInfo; const baseInfo = this.baseInfo;
...@@ -384,7 +386,8 @@ ...@@ -384,7 +386,8 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y:auto;
} }
.base-list { .base-list {
...@@ -427,7 +430,8 @@ ...@@ -427,7 +430,8 @@
.label { .label {
color: #333; color: #333;
font-size: 32rpx; font-size: 32rpx;
font-weight: bold;
} }
.txt { .txt {
...@@ -582,9 +586,9 @@ ...@@ -582,9 +586,9 @@
font-weight: bold; font-weight: bold;
} }
.seat { // .seat {
padding-bottom: 168rpx; // padding-bottom: 168rpx;
} // }
/*提交按钮*/ /*提交按钮*/
.btn-wrap { .btn-wrap {
...@@ -680,7 +684,8 @@ ...@@ -680,7 +684,8 @@
.address-view { .address-view {
border: 2rpx solid #ECECEC; border: 2rpx solid #ECECEC;
height: 112rpx; height: 112rpx;
margin-top: 30rpx; margin-top: 30rpx;
margin-bottom: 20rpx;
padding: 16rpx 30rpx; padding: 16rpx 30rpx;
} }
......
...@@ -321,7 +321,7 @@ export default { ...@@ -321,7 +321,7 @@ export default {
break; break;
} }
await self.chooseImage("qiniu", attr) await self.chooseImage("qiniu", {...attr, options: {count: 1}})
if(self.uploadType && self.imgList && self.imgList.length > 0) { if(self.uploadType && self.imgList && self.imgList.length > 0) {
// 设置图片对象 // 设置图片对象
self.imgObj[self.uploadType] = self.imgList self.imgObj[self.uploadType] = self.imgList
...@@ -460,7 +460,10 @@ export default { ...@@ -460,7 +460,10 @@ export default {
return formFlag; return formFlag;
}, },
async submitFileInfo() { async submitFileInfo() {
if (!this.submitBtnStatus) {
return
}
if (!this.checkFileInfo()) { if (!this.checkFileInfo()) {
return; return;
} }
...@@ -525,7 +528,8 @@ export default { ...@@ -525,7 +528,8 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y:auto;
} }
.base-list { .base-list {
...@@ -735,7 +739,7 @@ export default { ...@@ -735,7 +739,7 @@ export default {
} }
.info-view { .info-view {
margin-bottom: 188rpx; // margin-bottom: 188rpx;
.title-view { .title-view {
background-color: #FFFFFF; background-color: #FFFFFF;
......
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
.content-view { .content-view {
background-color: #FFFFFF; background-color: #FFFFFF;
margin-bottom: 188rpx; // margin-bottom: 188rpx;
border-radius: 12rpx; border-radius: 12rpx;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="content"> <view class="content">
<Settle :index="5"> <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">
...@@ -146,7 +146,8 @@ ...@@ -146,7 +146,8 @@
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 = {
...@@ -158,31 +159,14 @@ ...@@ -158,31 +159,14 @@
} }
const response = await this.$u.api.paySettleDeposit(params) const response = await this.$u.api.paySettleDeposit(params)
console.log(response) console.log(response)
if (response.code !== 200) { if (response.code !== 200) {
this.saving = false
uni.showToast({ uni.showToast({
title: response.message, title: response.message,
icon: 'none' icon: 'none'
}) })
return return
} }
let timer = setTimeout(res => {
clearTimeout(timer)
uni.showModal({
title: '提示',
content: '支付结果',
confirmText: '成功',
cancelText: '失败',
success: function(res) {
if (res.confirm) {
// console.log(res.confirm,'res.confirm')
self.pending()
} else if (res.cancel) {
self.saving = false
console.log('用户点击取消');
}
}
});
}, 1000)
const { const {
charge, charge,
...@@ -193,16 +177,19 @@ ...@@ -193,16 +177,19 @@
pingpp.createPayment(charge, (result, err) => { pingpp.createPayment(charge, (result, err) => {
if (result == "success") { if (result == "success") {
// 只有微信公众账号 (wx_pub)、微信小程序 (wx_lite)、QQ 公众号 (qpay_pub)、支付宝口碑 (alipay_qr) // 只有微信公众账号 (wx_pub)、微信小程序 (wx_lite)、QQ 公众号 (qpay_pub)、支付宝口碑 (alipay_qr)
// 支付成功的结果会在这里返回,其他的支付结果都会跳转到 extra 中对应的 URL。 // 支付成功的结果会在这里返回,其他的支付结果都会跳转到 extra 中对应的 URL。
this.showPopView()
uni.showToast({ uni.showToast({
title: '支付成功', title: '支付成功',
icon: 'none' icon: 'none'
}) })
} else if (result == "fail") { } else if (result == "fail") {
// charge 不正确或者微信公众账号/QQ 公众号/支付宝口碑支付失败时会在此处返回 // charge 不正确或者微信公众账号/QQ 公众号/支付宝口碑支付失败时会在此处返回
// console.log(err.msg) // console.log(err.msg)
this.showPopView()
} else if (result == "cancel") { } else if (result == "cancel") {
// 微信公众账号、QQ 公众号、支付宝口碑支付取消支付 // 微信公众账号、QQ 公众号、支付宝口碑支付取消支付
this.saving = false
uni.showToast({ uni.showToast({
title: '您已经取消了支付', title: '您已经取消了支付',
icon: 'none' icon: 'none'
...@@ -210,6 +197,26 @@ ...@@ -210,6 +197,26 @@
} }
}); });
}, },
showPopView() {
// let timer = setTimeout(res => {
// clearTimeout(timer)
uni.showModal({
title: '提示',
content: '支付结果',
confirmText: '成功',
cancelText: '失败',
success: ((res) => {
if (res.confirm) {
// console.log(res.confirm,'res.confirm')
this.pending()
} else if (res.cancel) {
this.pending()
console.log('用户点击取消');
}
})
});
// }, 1000)
}
}, },
} }
</script> </script>
...@@ -223,7 +230,8 @@ ...@@ -223,7 +230,8 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y:auto;
} }
.base-list { .base-list {
...@@ -231,7 +239,7 @@ ...@@ -231,7 +239,7 @@
border-radius: 12rpx; border-radius: 12rpx;
padding: 30rpx; padding: 30rpx;
min-height: 160rpx; min-height: 160rpx;
margin-bottom: 188rpx; // margin-bottom: 188rpx;
text-align: center; text-align: center;
.txt { .txt {
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<view class="container u-row-between" v-if="info"> <view class="container u-row-between" v-if="info">
<Settle :index="pageIndex"> <Settle :index="pageIndex">
<view class="content-view"> <view class="content-view">
<view style="min-height: 120rpx;" v-if="status == 8"></view> <!-- <view style="min-height: 120rpx;" v-if="status == 8"></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, h: [1, 2, 3, 4].indexOf(status) != -1}]"
:src="imageUrl"> :src="imageUrl">
</image> </image>
</view> </view>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
v-for="(txt,index) in info.tipsArr" :key="index">{{txt}}</text> v-for="(txt,index) in info.tipsArr" :key="index">{{txt}}</text>
</view> </view>
<view class="services-view"> <view class="services-view">
<view v-if="status != 8"> <view v-if="[1, 2, 3, 4].indexOf(status) != -1">
<image class="service-info-image" :src="erweimaImage"></image> <image class="service-info-image" :src="erweimaImage"></image>
<view class="content-info-tip">长按二维码添加官方客服微信</view> <view class="content-info-tip">长按二维码添加官方客服微信</view>
<view class="content-info-tip">及时了解审核进度</view> <view class="content-info-tip">及时了解审核进度</view>
...@@ -45,14 +45,14 @@ ...@@ -45,14 +45,14 @@
promptList: [{ promptList: [{
status: 1, status: 1,
statusName: '待审核', statusName: '待审核',
txtArr: ['已提交,等待审核', '正在审核中'], txtArr: ['入驻资料提交成功', '您的申请入驻资料已成功提交,工作人员正在审核中'],
btnTxt: '去首页', btnTxt: '去首页',
url: '/pages/index/index' url: '/pages/index/index'
}, { }, {
status: 2, status: 2,
statusName: '已通过', statusName: '已通过',
txtArr: ['恭喜,审核通过', '“充电桩安装入驻审核”'], txtArr: ['入驻资料审核成功', '您的申请入驻资料已审核提交,可进行在线学习考试'],
btnTxt: '去考试', btnTxt: '下一步',
url: '/pages/learn/exam' url: '/pages/learn/exam'
}, { }, {
status: 3, status: 3,
...@@ -64,28 +64,26 @@ ...@@ -64,28 +64,26 @@
}, { }, {
status: 4, status: 4,
statusName: '已驳回', statusName: '已驳回',
txtArr: ['您的入驻资料已被驳回!', '可重新提交资料!'], txtArr: ['入驻资料审核失败'],
tipsArr: ['原因:', '图片不够清楚'], tipsArr: ['原因:', '图片不够清楚'],
btnTxt: '重新提交', btnTxt: '重新提交',
url: '/pages/settle/file' url: '/pages/settle/file'
}, { }, {
status: 8, status: 8,
statusName: 'step4', statusName: 'step4',
txtArr: ['您已通过', '“充电桩安装入驻考试”'], txtArr: ['您已通过接单在线考试', '通过在线考试后,可以前往签约'],
tipsArr: ['可以正式签约了'], btnTxt: '下一步',
btnTxt: '去签约',
url: '/pages/settle/sign-contract' url: '/pages/settle/sign-contract'
}, { }, {
status: [5, 6], status: [5, 6],
statusName: '未支付保证金', statusName: '未支付保证金',
txtArr: ['您已成为', "充电桩安装的签约服务商"], txtArr: ['您已成功完成签约', "完成签约后,缴纳配件押金即可完成入驻"],
tipsArr: ['请缴纳1000元质保金'], btnTxt: '下一步',
btnTxt: '去缴纳保证金',
url: '/pages/settle/pay-ensure' url: '/pages/settle/pay-ensure'
}, { }, {
status: 7, status: 7,
statusName: '已支付保证金', statusName: '已支付保证金',
txtArr: ['您已成为', "充电桩安装的正式服务商"], txtArr: ['您已成功缴纳配件押金', " 成功缴纳配件押金后即前往接单"],
btnTxt: '去首页', btnTxt: '去首页',
url: '/pages/index/index' url: '/pages/index/index'
}], }],
...@@ -177,9 +175,10 @@ ...@@ -177,9 +175,10 @@
this.info = this.promptList[0] this.info = this.promptList[0]
return return
} }
if (status === 6) { // if (status === 6) {
info.tipsArr[0] = '请缴纳' + this.settledInfo.record.deposit + '元质保金' // info.tipsArr[0] = '请缴纳' + this.settledInfo.record.deposit + '元质保金'
} else if (status === 4) { // } else
if (status === 4) {
info.tipsArr[1] = this.settledInfo.record.reason || '' info.tipsArr[1] = this.settledInfo.record.reason || ''
} }
this.info = info this.info = info
...@@ -218,9 +217,15 @@ ...@@ -218,9 +217,15 @@
height: 224rpx; height: 224rpx;
&.active { &.active {
margin-top: 38rpx; margin-top: 150rpx;
width: 234rpx; width: 234rpx;
height: 222rpx; height: 222rpx;
}
&.h {
margin-top: 38rpx;
width: 234rpx;
height: 222rpx;
} }
} }
......
...@@ -412,7 +412,15 @@ ...@@ -412,7 +412,15 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
background-color: #F3F3F3; background-color: #F4F5F7;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow-y:auto;
} }
.nav-item, .nav-item,
.age-item { .age-item {
...@@ -447,7 +455,7 @@ ...@@ -447,7 +455,7 @@
} }
.nav-item.active { .nav-item.active {
background-color: #ededed; background-color: #F4F5F7;
} }
} }
......
...@@ -366,7 +366,7 @@ ...@@ -366,7 +366,7 @@
// } // }
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: '入驻基本信息提交成功', title: '提交成功',
icon: 'success' icon: 'success'
}); });
// let timer = setTimeout(() => { // let timer = setTimeout(() => {
...@@ -424,7 +424,8 @@ ...@@ -424,7 +424,8 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y:auto;
} }
.content-txt { .content-txt {
...@@ -453,8 +454,8 @@ ...@@ -453,8 +454,8 @@
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 12rpx; border-radius: 12rpx;
padding: 30rpx 30rpx 0rpx 30rpx; padding: 30rpx 30rpx 0rpx 30rpx;
margin-bottom: 20rpx; // margin-bottom: 20rpx;
margin-bottom: 188rpx; // margin-bottom: 188rpx;
/deep/ .u-radio__label { /deep/ .u-radio__label {
line-height: 40rpx; line-height: 40rpx;
......
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