Commit 74762c68 authored by Morson's avatar Morson
parents 02ff311a b76391a4
; ;
(function() { (function() {
let NODE_ENV = 'test'; // dev:开发环境 | test:测试环境 let NODE_ENV = 'test'; // dev:开发环境 | test:测试环境 | prod:生产环境
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') {
......
...@@ -76,10 +76,14 @@ export default { ...@@ -76,10 +76,14 @@ export default {
// 系统自动登录::每次运行小程序重新获取用户信息 // 系统自动登录::每次运行小程序重新获取用户信息
await this.autoLogin(); await this.autoLogin();
this.deleteTempImg()
}, },
onShow: async function () { onShow: async function () {
// 应用启动,或从后台进入前台显示 // 应用启动,或从后台进入前台显示
this.handleImageTask() if (this.uploadTask.length > 0) {
upload.uploadImageTask(this)
}
}, },
onHide: function () { onHide: function () {
// 应用从前台进入后台 // 应用从前台进入后台
...@@ -90,20 +94,16 @@ export default { ...@@ -90,20 +94,16 @@ export default {
} }
}, },
methods: { methods: {
// 处理上传图片队列数据 // 处理已上传完成的图片
handleImageTask() { deleteTempImg() {
if (this.uploadTask.length > 0) { const result = uni.getStorageSync('delImg')
upload.uploadImageTask(this) if (result.length > 0) {
} else { // 定时清理缓存在本地的文件 for (let i of result) {
const result = uni.getStorageSync('delImg') uni.removeSavedFile({
if (result.length > 0) { filePath: i
for (let i of result) { })
uni.removeSavedFile({
filePath: i
})
}
uni.setStorageSync('delImg', [])
} }
uni.setStorageSync('delImg', [])
} }
}, },
getSystemInfo() { getSystemInfo() {
......
const db = uniCloud.database({
spaceId: 'tcb-nikbzhlwnpd5n913e1c5e-50f4bbo'
})
let cloudRulesApiFun = function(vm){
/* 查询所有产品 废弃*/
let getAllProduct = async () => await db.collection("product").get();
/* 查询产品下的品牌 {product_code:"P0001"} 废弃*/
let getBrand = async (params = {}) => await db.collection("brand").where(params).get();
/* 查询规范项目 {product_code:"P0001"} 废弃*/
let getstandard = async (params = {}) => await db.collection("standard").where(params).get();
/* 查询分组规范项目 废弃*/
let getGroupStandard = async (params = {}) => await uniCloud.callFunction({name: 'getGroupStandard', data: params});
/* 查询类别数据 */
let getClassifyDictionary = async () => await db.collection("dictionary").where({"type":"classify"}).get()
/* 查询有数据的系统 或者 品牌 数据 {"classify_id":"","system_id":"","field":"system_id|brand_id"}*/
let getRelationDictionary = async (params = {}) => await uniCloud.callFunction({name: 'getRelationDictionary', data: params});
let getRelationDictionaryV2 = async () => await uniCloud.callFunction({name: 'getRelationDictionaryV2'});
/* 查询规范 根据 分类、系统、品牌 {"token":"", "classify_id":"","system_id":"","brand_id":""} */
let getGroupStandardV2 = async (params = {}) => await uniCloud.callFunction({name: 'getGroupStandardV2', data: params});
/* 保存图片 {"token":"", "standardId":"", "url":""} */
let saveImage = async (params = {}) => await uniCloud.callFunction({name: 'saveImage', data: params});
/* 获取用户水印,首次返回默认水印 {"token":"", "systemId":""} */
let getUserWatermark = async (params = {}) => await uniCloud.callFunction({name: 'getUserWatermark', data: params});
/* 保存用户水印配置 {"token":"", "watermark": getUserWatemark返回的数据} */
let saveUserWatermark = async (params = {}) => await uniCloud.callFunction({name: 'saveUserWatermark', data: params});
const rulesApi = {
getAllProduct,
getBrand,
getstandard,
getGroupStandard,
// 新接口
getClassifyDictionary,
getRelationDictionary,
getRelationDictionaryV2,
getGroupStandardV2,
saveImage,
getUserWatermark,
saveUserWatermark
}
return rulesApi
}
module.exports = {
cloudRulesApiFun
}
\ No newline at end of file
import {
cloudRulesApiFun
} from "@/common/api/cloud_rules.js"
import { import {
commonApiFun commonApiFun
} from '@/common/api/common.js'; } from '@/common/api/common.js';
...@@ -14,7 +11,6 @@ import {certApiFun} from"@/common/api/cert.js" ...@@ -14,7 +11,6 @@ import {certApiFun} from"@/common/api/cert.js"
let apiFun = function(vm) { let apiFun = function(vm) {
let commonApi = commonApiFun(vm); let commonApi = commonApiFun(vm);
let settledApi = settledApiFun(vm) let settledApi = settledApiFun(vm)
let cloudApi = cloudRulesApiFun(vm)
let learnApi=learnApiFun(vm) let learnApi=learnApiFun(vm)
let assessmentApi = assessmentApiFun(vm) let assessmentApi = assessmentApiFun(vm)
let orderApi=orderApiFun(vm) let orderApi=orderApiFun(vm)
...@@ -22,7 +18,6 @@ let apiFun = function(vm) { ...@@ -22,7 +18,6 @@ let apiFun = function(vm) {
let apiUrl = { let apiUrl = {
...commonApi, ...commonApi,
...settledApi, ...settledApi,
...cloudApi,
...learnApi, ...learnApi,
...orderApi, ...orderApi,
...assessmentApi, ...assessmentApi,
......
import {apiFun} from '@/common/api/index.js'; import {apiFun} from '@/common/api/index.js';
import {
cloudRulesApiFun
} from "@/common/api/cloud_rules.js"
const install = (Vue, vm) => { const install = (Vue, vm) => {
let apiUrls = apiFun(vm) let apiUrls = apiFun(vm)
...@@ -9,10 +7,6 @@ const install = (Vue, vm) => { ...@@ -9,10 +7,6 @@ const install = (Vue, vm) => {
vm.$u.api = { vm.$u.api = {
...apiUrls, ...apiUrls,
}; };
let cloudRules = cloudRulesApiFun(vm)
vm.$u.cloudApi = {
...cloudRules
}
} }
export default { export default {
......
...@@ -64,36 +64,40 @@ ...@@ -64,36 +64,40 @@
methods: { methods: {
// 保存照片到本地 // 保存照片到本地
async saveTempToLocal(tempImagePath) { async saveTempToLocal(tempImagePath) {
//has_origin //是否保存原图 return new Promise(async (resolve, reject) => {
let that = this //has_origin //是否保存原图
const photo = getApp().globalData.photo let that = this
if(!photo.tempPath){ const photo = getApp().globalData.photo
return if(!photo.tempPath){
} return
let path = ''
if(photo.tempPath.origin && photo.waterSetting.hasOrigin){
// 保存原图到本地
path = photo.tempPath.origin
let result = await this.saveLocal(path)
if(result){
uni.showToast({
icon: 'none',
title: '已将照片原图保存到本地相册'
})
} }
} let path = ''
if(photo.tempPath.origin && photo?.waterSetting?.hasOrigin){
if(photo.tempPath.mixWater){ // 保存原图到本地
// 保存水印处理图片到本地 path = photo.tempPath.origin
path = photo.tempPath.mixWater let result = await this.saveLocal(path)
let result1 = await this.saveLocal(path) if(result){
if(result1){ uni.showToast({
uni.showToast({ icon: 'none',
icon: 'none', title: '已将照片原图保存到本地相册'
title: '已将水印图片保存到本地相册' })
}) }
} }
}
if(photo.tempPath.mixWater){
// 保存水印处理图片到本地
path = photo.tempPath.mixWater
console.log("path", path)
let result1 = await this.saveLocal(path)
if(result1){
uni.showToast({
icon: 'none',
title: '已将水印图片保存到本地相册'
})
resolve()
}
}
})
}, },
saveLocal(path){ saveLocal(path){
return new Promise((resolve,reject)=>{ return new Promise((resolve,reject)=>{
...@@ -128,13 +132,13 @@ ...@@ -128,13 +132,13 @@
//this.$emit('finish') //this.$emit('finish')
}, },
// 确认图片 // 确认图片
continuePhoto() { async continuePhoto() {
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
let self = this let self = this
uni.showLoading({ uni.showLoading({
title:'图片保存中…' title:'图片保存中…'
}) })
self.saveTempToLocal() await self.saveTempToLocal()
if (this.upload) { if (this.upload) {
self.confirmUpload(true) self.confirmUpload(true)
......
...@@ -213,6 +213,7 @@ var json = { ...@@ -213,6 +213,7 @@ var json = {
pic: process.uniEnv.qn_base_url + "fwgf-3x-v2.png", pic: process.uniEnv.qn_base_url + "fwgf-3x-v2.png",
percent: 0, percent: 0,
status: "", status: "",
id: 597,
sectionId: "", sectionId: "",
}, },
{ {
...@@ -221,6 +222,7 @@ var json = { ...@@ -221,6 +222,7 @@ var json = {
pic: process.uniEnv.qn_base_url + "jdgf-3x-v2.png", pic: process.uniEnv.qn_base_url + "jdgf-3x-v2.png",
percent: 0, percent: 0,
status: "", status: "",
id: 598,
sectionId: "", sectionId: "",
}, },
{ {
...@@ -229,6 +231,7 @@ var json = { ...@@ -229,6 +231,7 @@ var json = {
pic: process.uniEnv.qn_base_url + "cdz-3x-v2.png", pic: process.uniEnv.qn_base_url + "cdz-3x-v2.png",
percent: 0, percent: 0,
status: "", status: "",
id: 599,
sectionId: "", sectionId: "",
}, },
], ],
...@@ -265,7 +268,7 @@ var examJson = { ...@@ -265,7 +268,7 @@ var examJson = {
{ {
title: "安装材料及工具准备", title: "安装材料及工具准备",
desc: "通过本认证,是接单的必要条件", desc: "通过本认证,是接单的必要条件",
condition: "随机10题,及格10题", condition: "随机4题,及格4题",
status: "", status: "",
pic: process.uniEnv.qn_base_url + "fwgf-e-3x.png", pic: process.uniEnv.qn_base_url + "fwgf-e-3x.png",
id: 3, id: 3,
...@@ -275,7 +278,7 @@ var examJson = { ...@@ -275,7 +278,7 @@ var examJson = {
isComplete: false, isComplete: false,
}, },
{ {
title: "交付规范", title: "接单规范",
desc: "快速认证,是否具备接单操作能力", desc: "快速认证,是否具备接单操作能力",
condition: "随机5题,及格5题", condition: "随机5题,及格5题",
status: "", status: "",
...@@ -291,7 +294,7 @@ var examJson = { ...@@ -291,7 +294,7 @@ var examJson = {
{ {
title: "安装材料及工具准备", title: "安装材料及工具准备",
desc: "通过本认证,是接单的必要条件", desc: "通过本认证,是接单的必要条件",
condition: "随机20题,及格20题", condition: "随机4题,及格4题",
status: "", status: "",
pic: process.uniEnv.qn_base_url + "fwgf-e-3x.png", pic: process.uniEnv.qn_base_url + "fwgf-e-3x.png",
id: 3, id: 3,
...@@ -301,9 +304,9 @@ var examJson = { ...@@ -301,9 +304,9 @@ var examJson = {
questionTime: null, questionTime: null,
}, },
{ {
title: "接单操作", title: "接单规范",
desc: "快速认证,是否具备接单操作能力", desc: "快速认证,是否具备接单操作能力",
condition: "随机20题,及格16题", condition: "随机5题,及格5题",
status: "", status: "",
pic: process.uniEnv.qn_base_url + "jdgf-e-3x.png", pic: process.uniEnv.qn_base_url + "jdgf-e-3x.png",
id: 4, id: 4,
...@@ -446,7 +449,6 @@ export default { ...@@ -446,7 +449,6 @@ export default {
}, },
onPulling(e) { onPulling(e) {
return true; return true;
console.log("onpulling", e);
}, },
onRefresh() { onRefresh() {
if (this._freshing) return; if (this._freshing) return;
...@@ -458,7 +460,6 @@ export default { ...@@ -458,7 +460,6 @@ export default {
}, },
onRestore() { onRestore() {
this.triggered = "restore"; // 需要重置 this.triggered = "restore"; // 需要重置
console.log("onRestore");
}, },
onAbort() { onAbort() {
console.log("onAbort"); console.log("onAbort");
...@@ -657,10 +658,6 @@ export default { ...@@ -657,10 +658,6 @@ export default {
this.examList[i].examId = res.data.id; this.examList[i].examId = res.data.id;
this.examList[i].examStatus = res.data.examStatus; //i;// this.examList[i].examStatus = res.data.examStatus; //i;//
this.examList[i].questionTime = res.data.questionTime; this.examList[i].questionTime = res.data.questionTime;
console.log(
this.examList[i].questionTime,
"每题考试时间"
);
let examResult = res.data.examLevelResult; let examResult = res.data.examLevelResult;
this.examList[i].status = this.examList[i].status =
examResult != "" ? examResult : "未通过"; examResult != "" ? examResult : "未通过";
...@@ -675,25 +672,20 @@ export default { ...@@ -675,25 +672,20 @@ export default {
// examStatus 用户考试状态 0考试中 1考试完成 2未参与 // examStatus 用户考试状态 0考试中 1考试完成 2未参与
that.exam = res.data; that.exam = res.data;
console.log(that.exam);
if (res.data.examStatus == 2) { if (res.data.examStatus == 2) {
console.log("examStatus " + i + " 2");
return; return;
} }
if (res.data.examStatus == 1) { if (res.data.examStatus == 1) {
console.log("examStatus " + i + " 1");
that.examList[i].isComplete = that.examList[i].isComplete =
this.examList[i].status == "通过"; this.examList[i].status == "通过";
that.examScore = res.data.examScore; that.examScore = res.data.examScore;
return; return;
} }
if (res.data.examStatus == 0) { if (res.data.examStatus == 0) {
console.log("examStatus " + i + " 0");
that.userExamId = res.data.id; that.userExamId = res.data.id;
} }
}) })
.catch((err) => { .catch((err) => {
console.log("getUserExamInfo err" + err);
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring <scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring
scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100" scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
refresher-background="#F4F5F7" @refresherpulling="triggered = true" @refresherrefresh="onRefresh" refresher-background="#F4F5F7" @refresherpulling="triggered = true" @refresherrefresh="onRefresh"
@refresherrestore="onRestore" @refresherabort="onAbort"> @refresherrestore="onRestore">
<NoOrder v-if="noMore" type="black" :customStyle="noOrderCustomStyle" /> <NoOrder v-if="noMore" type="black" :customStyle="noOrderCustomStyle" />
<template v-else> <template v-else>
<view v-for="(item, index) in orderList" :key="item.orderId"> <view v-for="(item, index) in orderList" :key="item.orderId">
...@@ -315,9 +315,6 @@ ...@@ -315,9 +315,6 @@
url: 'pages/order/search' url: 'pages/order/search'
}) })
}, },
onPulling(e) {
console.log("onpulling", e);
},
onRefresh() { onRefresh() {
if (this._freshing) return; if (this._freshing) return;
this._freshing = true; this._freshing = true;
...@@ -329,11 +326,7 @@ ...@@ -329,11 +326,7 @@
}, },
onRestore() { onRestore() {
this.triggered = 'restore'; // 需要重置 this.triggered = 'restore'; // 需要重置
console.log("onRestore");
}, },
onAbort() {
console.log("onAbort");
}
} }
}; };
</script> </script>
......
...@@ -217,7 +217,6 @@ export default { ...@@ -217,7 +217,6 @@ export default {
return; return;
} }
if (res.data.data.examStatus == 1) { if (res.data.data.examStatus == 1) {
console.log("111111111111111111111111111");
that.isComplete = true; that.isComplete = true;
that.examScore = res.data.data.examScore; that.examScore = res.data.data.examScore;
return; return;
...@@ -285,11 +284,6 @@ export default { ...@@ -285,11 +284,6 @@ export default {
// this.endTime = timestamp + time * 1000; // this.endTime = timestamp + time * 1000;
this.currentTime = parseInt(time * 1000); //this.formatTimeToMini(timestamp);//endTime-currentTime再格式化时间显示 this.currentTime = parseInt(time * 1000); //this.formatTimeToMini(timestamp);//endTime-currentTime再格式化时间显示
that.getNext(); that.getNext();
console.log(
this.endTime,
this.currentTime,
"总时间"
);
} }
} else { } else {
uni.showToast({ uni.showToast({
...@@ -361,15 +355,12 @@ export default { ...@@ -361,15 +355,12 @@ export default {
} }
if (res.data.code == 200) { if (res.data.code == 200) {
that.currentItem = res.data.data; that.currentItem = res.data.data;
console.log(that.currentItem);
that.progress = res.data.data.progress; that.progress = res.data.data.progress;
if (res.data.data.isQuestion) { if (res.data.data.isQuestion) {
let str = res.data.data.question.content; let str = res.data.data.question.content;
var wz = str.indexOf("."); var wz = str.indexOf(".");
let str1 = str.substring(wz + 1); let str1 = str.substring(wz + 1);
console.log(that.currentItem);
that.currentItem.question.content = str1.replace('*', ''); that.currentItem.question.content = str1.replace('*', '');
console.log(str1, "切割的字符串");
} }
if (res.data.data.answerList) { if (res.data.data.answerList) {
that.handleData(); that.handleData();
...@@ -423,12 +414,6 @@ export default { ...@@ -423,12 +414,6 @@ export default {
if (this.everyTime > 0) { if (this.everyTime > 0) {
this.timer = setTimeout(this.startCounting, 1000); this.timer = setTimeout(this.startCounting, 1000);
console.log(
"endTime:" + this.endTime,
"everyTime:" + this.everyTime,
"currentTime:" + this.currentTime,
"答案:" + this.userAnswerIds
);
} else { } else {
clearTimeout(this.timer); clearTimeout(this.timer);
this.everyTime = 90; this.everyTime = 90;
...@@ -438,16 +423,7 @@ export default { ...@@ -438,16 +423,7 @@ export default {
itemClick: function (currentItem, ikey) { itemClick: function (currentItem, ikey) {
this.isSelect = true; this.isSelect = true;
//answerType 题目类型,1单选,2多选,3简答
// console.log('选点点击--处理前--this.currentItem:')
// console.log(this.currentItem)
// console.log('选点点击--处理前--ikey:')
// console.log(ikey)
// console.log('选点点击--处理前--题目类型,1单选,2多选,3简答:')
// console.log(this.currentItem.question.answerType)
//answerType 题目类型,1单选,2多选,3简答,
for (let i = 0; i < this.currentItem.answerList.length; i++) { for (let i = 0; i < this.currentItem.answerList.length; i++) {
var item = this.currentItem.answerList[i]; var item = this.currentItem.answerList[i];
...@@ -481,9 +457,6 @@ export default { ...@@ -481,9 +457,6 @@ export default {
//有选答案 //有选答案
this.isSelect = isSelect; this.isSelect = isSelect;
// console.log('选点点击--处理后--this.currentItem.answerList:')
// console.log(this.currentItem.answerList)
}, },
// 点击下一步 // 点击下一步
handleClick() { handleClick() {
...@@ -531,7 +504,6 @@ export default { ...@@ -531,7 +504,6 @@ export default {
// if(this.userAnswerIds.length == 1) // if(this.userAnswerIds.length == 1)
this.userAnswerIds = this.userAnswerIds =
this.userAnswerIds + "," + item.id; this.userAnswerIds + "," + item.id;
console.log(this.userAnswerIds, "答案答案");
} }
//*/ //*/
} else { } else {
......
...@@ -127,12 +127,10 @@ export default { ...@@ -127,12 +127,10 @@ export default {
}, },
success: (res) => { success: (res) => {
console.log("标识符1", res.data);
uni.hideLoading(); uni.hideLoading();
if (res.data.code == 200) { if (res.data.code == 200) {
if (res.data.data.userExamId) { if (res.data.data.userExamId) {
this.userExamId = res.data.data.userExamId; this.userExamId = res.data.data.userExamId;
console.log("这个是个标识符", this.userExamId);
} }
} }
}, },
......
...@@ -41,7 +41,6 @@ export default { ...@@ -41,7 +41,6 @@ export default {
onLoad(a) { onLoad(a) {
this.examId = a.examId; this.examId = a.examId;
this.userExamId = a.userExamId; this.userExamId = a.userExamId;
console.log("userExamId是", this.userExamId);
this.getCourseResult(); this.getCourseResult();
}, },
onUnload() { onUnload() {
...@@ -54,7 +53,6 @@ export default { ...@@ -54,7 +53,6 @@ export default {
.getExamResult(this.examId) .getExamResult(this.examId)
.then((res) => { .then((res) => {
if (res.code != 200) { if (res.code != 200) {
console.log("getUserExamInfo 200 err");
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: "获取考试结果失败", title: "获取考试结果失败",
...@@ -65,7 +63,6 @@ export default { ...@@ -65,7 +63,6 @@ export default {
this.score = this.result.examScore; this.score = this.result.examScore;
}) })
.catch((err) => { .catch((err) => {
console.log("getUserExamInfo err" + err);
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
......
...@@ -45,7 +45,6 @@ export default { ...@@ -45,7 +45,6 @@ export default {
onLoad(a) { onLoad(a) {
this.userExamId = a.userExamId; this.userExamId = a.userExamId;
this.examId = a.examId; this.examId = a.examId;
console.log("userExamId是", this.userExamId);
this.getCourseResult(); this.getCourseResult();
}, },
onUnload() { onUnload() {
...@@ -58,7 +57,6 @@ export default { ...@@ -58,7 +57,6 @@ export default {
.getExamResult(this.examId) .getExamResult(this.examId)
.then((res) => { .then((res) => {
if (res.code != 200) { if (res.code != 200) {
console.log("getUserExamInfo 200 err");
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: "获取考试结果失败", title: "获取考试结果失败",
...@@ -69,7 +67,6 @@ export default { ...@@ -69,7 +67,6 @@ export default {
this.score = this.result.examScore; this.score = this.result.examScore;
}) })
.catch((err) => { .catch((err) => {
console.log("getUserExamInfo err" + err);
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
...@@ -81,7 +78,6 @@ export default { ...@@ -81,7 +78,6 @@ export default {
getAgain: function () { getAgain: function () {
let examId = this.examId; let examId = this.examId;
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组 let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
console.log(routes.length);
uni.navigateTo({ uni.navigateTo({
url: "/pages/learn/assessment?examId=" + examId, url: "/pages/learn/assessment?examId=" + examId,
}); });
......
...@@ -121,8 +121,6 @@ ...@@ -121,8 +121,6 @@
}, },
methods: { methods: {
scroll: function(e) { scroll: function(e) {
console.log('--scroll--')
console.log(e)
this.old.scrollTop = e.detail.scrollTop this.old.scrollTop = e.detail.scrollTop
}, },
goNext(info) { goNext(info) {
...@@ -150,8 +148,6 @@ ...@@ -150,8 +148,6 @@
}else{ }else{
this.scrollValue = 0 this.scrollValue = 0
} }
console.log('--移动距离--')
console.log(this.scrollValue)
}, },
onPlayerTimeupdate(player) { onPlayerTimeupdate(player) {
let intCurrentTime = parseInt(player.detail.currentTime); let intCurrentTime = parseInt(player.detail.currentTime);
...@@ -220,8 +216,6 @@ ...@@ -220,8 +216,6 @@
} }
if (res.data) { if (res.data) {
this.sectionInfo = res.data this.sectionInfo = res.data
console.log("----节信息----")
console.log(this.sectionInfo)
this.nextSectionId = this.sectionInfo.nextSectionId this.nextSectionId = this.sectionInfo.nextSectionId
let wareVal = this.sectionInfo.ware let wareVal = this.sectionInfo.ware
this.courseTitle = res.data.name this.courseTitle = res.data.name
...@@ -237,7 +231,6 @@ ...@@ -237,7 +231,6 @@
let coureWareList = res.data.courseware let coureWareList = res.data.courseware
this.courseSrc = coureWareList[0].src this.courseSrc = coureWareList[0].src
this.videoTotalTime = parseInt(JSON.parse(coureWareList[0].info).time) - 1; this.videoTotalTime = parseInt(JSON.parse(coureWareList[0].info).time) - 1;
console.log('视频时长信息:' + this.videoTotalTime)
} }
} }
}) })
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<view class="amount"><text class="prefix">¥</text>{{ amount }}</view> <view class="amount"><text class="prefix">¥</text>{{ amount }}</view>
</view> </view>
<view class="rules"> <view class="rules">
<view class="title">质保金规则</view> <view class="title">配件押金规则</view>
<view class="item" v-for="(item, index) in rules" :key="index"> <view class="item" v-for="(item, index) in rules" :key="index">
<view class="question"> <view class="question">
<view class="qa-icon danger-bg">Q</view> <view class="qa-icon danger-bg">Q</view>
...@@ -33,15 +33,12 @@ ...@@ -33,15 +33,12 @@
return { return {
rules: [ rules: [
{ {
question: '为什么缴纳设备押金?', question: '为什么缴纳配件押金?',
answer: `设备押金是什么什么什么,应该巴拉巴拉巴拉,所以 answer: '充电桩为客户私人设备,由扳手会保管代发,为安装流程顺利进行,在接单至订单完工过程中由技工师傅保管,因此需缴纳一定额度配件押金,押金可退还。'
要缴纳,巴拉巴拉巴拉。`
}, },
{ {
question: '退还设备押金说明', question: '退还配件押金说明',
answer: `设备押金的退还说明是什么什么样的,应该怎么怎么 answer: '技工师傅与扳手会结束合作关系后即可申请退还缴纳的配件押金。'
样,先找客服,然后再怎么怎么样,然后再怎么怎么
样,这样就可以了。`
} }
], ],
}; };
...@@ -68,7 +65,6 @@ ...@@ -68,7 +65,6 @@
}, },
refund() { refund() {
this.$u.route({ this.$u.route({
type: 'redirect',
url: "pages/mine/customer/index" url: "pages/mine/customer/index"
}) })
}, },
......
...@@ -126,13 +126,13 @@ ...@@ -126,13 +126,13 @@
return ['settlement','statement'] return ['settlement','statement']
} }
}, },
onLoad() { onShow() {
// 未登录,先跳转登录 // 未登录,先跳转登录
if(!this.vuex_token) { if(!this.vuex_token) {
this.$u.route({url: 'pages/login/index'}) this.$u.route({url: 'pages/login/index'})
} }
this.loadAssets() this.loadAssets()
this.loadStatement() this.loadStatement()
}, },
methods: { methods: {
// 提现 // 提现
......
...@@ -3,15 +3,24 @@ ...@@ -3,15 +3,24 @@
<u-navbar back-icon-color="#333333" background="#F4F5F7" title="提现" titleColor="#333333" :border-bottom="false" title-bold> <u-navbar back-icon-color="#333333" background="#F4F5F7" title="提现" titleColor="#333333" :border-bottom="false" title-bold>
</u-navbar> </u-navbar>
<view class="withdraw-content"> <view class="withdraw-content">
<view class="withdraw-content-main"> <view v-if="!submit">
<view class="amount-title">可提现金额</view> <view class="withdraw-content-main">
<view class="amount-text"><text class="amount-symbol">¥</text>{{amount}}</view> <view class="amount-title">可提现金额</view>
<u-button type="primary" shape="circle" :custom-style="buttonStyle" @click="handleClick">提现</u-button> <view class="amount-text"><text class="amount-symbol">¥</text>{{amount}}</view>
<u-button type="primary" shape="circle" :custom-style="buttonStyle" @click="handleClick">全部提现</u-button>
</view>
<view class="line-view"></view>
<view class="rule-title">提现规则说明</view>
<view class="rule-content">1.提现金额:提现金额是指已完工订单通过平台审核后且达到合同账期的订单费用之总和。</view>
<view class="rule-content">2.提现到账时间具体以银行结果为准</view>
</view> </view>
<view class="line-view"></view> <view v-else class="submited-view">
<view class="rule-title">提现规则说明</view> <image class="success-image" :src="imageUrl"></image>
<view class="rule-content">1.提现金额:提现金额是指已完工订单通过平台审核后且达到合同账期的订单费用之总和。</view> <view>您已提交提现申请</view>
<view class="rule-content">2.提现到账时间为1-3个工作日,最终以银行结果为准</view> <view class="submited-button">
<u-button type="primary" shape="circle" :custom-style="buttonStyle" @click="handleClickSure">我知道了</u-button>
</view>
</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -20,7 +29,8 @@ ...@@ -20,7 +29,8 @@
export default { export default {
data() { data() {
return { return {
amount: 0, amount: 0,
submit: false
} }
}, },
computed: { computed: {
...@@ -31,6 +41,9 @@ ...@@ -31,6 +41,9 @@
"font-size": "32rpx", "font-size": "32rpx",
"font-weight": "bold", "font-weight": "bold",
}; };
},
imageUrl() {
return process.uniEnv.qn_base_url + 'chenggong.png'
}, },
}, },
onLoad() { onLoad() {
...@@ -42,7 +55,7 @@ ...@@ -42,7 +55,7 @@
if(self.amount) { if(self.amount) {
let res = await self.$u.api.workerApplyPay() let res = await self.$u.api.workerApplyPay()
if(res && res.code == 200) { if(res && res.code == 200) {
self.$u.route({type: 'redirect', url: 'pages/mine/wallet/index'}) self.submit = true
} else { } else {
self.$u.toast(res.message || '系统异常,提现失败!'); self.$u.toast(res.message || '系统异常,提现失败!');
} }
...@@ -54,7 +67,10 @@ ...@@ -54,7 +67,10 @@
if(res && res.code == 200) { if(res && res.code == 200) {
self.amount = res.data && res.data.canApplyAmount self.amount = res.data && res.data.canApplyAmount
} }
}, },
handleClickSure() {
this.$u.route({type: 'back'})
}
} }
} }
</script> </script>
...@@ -110,6 +126,22 @@ ...@@ -110,6 +126,22 @@
color: #666666; color: #666666;
margin-bottom: 20rpx; margin-bottom: 20rpx;
line-height: 40rpx; line-height: 40rpx;
}
.submited-view {
text-align: center;
color: #2272FF;
font-size: 40rpx;
font-weight: bold;
.success-image {
width: 224rpx;
height: 224rpx;
margin-top: 80rpx;
}
}
.submited-button {
margin-top: 100rpx;
margin-bottom: 100rpx;
} }
} }
......
<template> <template>
<view class="backView"> <view class="backView">
<view class="ph-pr-arr" v-for="(dataItem, index) in list" :key="index"> <view class="ph-pr-arr" v-for="(dataItem, index) in list" :key="index">
<template v-if="dataItem.data.length > 0"> <template v-if="dataItem.data.length > 0">
<view class="topTitle"><text>{{ dataItem.title }}</text></view> <view class="topTitle"><text>{{ dataItem.title }}</text></view>
<view class="ph-pr-content"> <view class="ph-pr-content">
<view v-for="(item,ikey) in dataItem.data" <view v-for="(item,ikey) in dataItem.data"
:class="param[dataItem.type] === item.id ? 'select-item-view' : 'item-view'" :class="param[dataItem.type] === item.id ? 'select-item-view' : 'item-view'"
@click="itemClick(dataItem.type, item, ikey)" :key="item.id"> @click="itemClick(dataItem.type, item, ikey)" :key="item.id">
<text class="itemTitle">{{item.name}}</text> <text class="itemTitle">{{item.name}}</text>
</view> </view>
</view> </view>
</template> </template>
</view> </view>
<u-button class="ph-pr-button" type="primary" shape="circle" @click="handleClick" <u-button class="ph-pr-button" type="primary" shape="circle" @click="handleClick"
:hover-class="selectedAll ? '' : 'none'" :custom-style="buttonStyle">下一步</u-button> :hover-class="selectedAll ? '' : 'none'" :custom-style="buttonStyle">下一步</u-button>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
classifyList: [], classifyList: [],
systemList: [], systemList: [],
brandList: [], brandList: [],
param: { param: {
classifyId: '', classifyId: '',
systemId: '', systemId: '',
brandId: '', brandId: '',
}, },
brandName: '', brandName: '',
selectedAll: false, selectedAll: false,
} }
}, },
computed: { computed: {
list() { list() {
return [{ return [{
title: '请选择类别', title: '请选择类别',
type: 'classifyId', type: 'classifyId',
data: this.classifyList data: this.classifyList
}, },
{ {
title: '请选择系统', title: '请选择系统',
type: 'systemId', type: 'systemId',
data: this.systemList data: this.systemList
}, },
{ {
title: '请选择品牌', title: '请选择品牌',
type: 'brandId', type: 'brandId',
data: this.brandList data: this.brandList
} }
] ]
}, },
buttonStyle() { buttonStyle() {
return this.selectedAll ? { return this.selectedAll ? {
'color': '#FFFFFF', 'color': '#FFFFFF',
'background-color': '#2272FF;', 'background-color': '#2272FF;',
'width': '600rpx', 'width': '600rpx',
'height': '104rpx' 'height': '104rpx'
} : { } : {
'color': '#FFFFFF', 'color': '#FFFFFF',
'background-color': '#D1D4D4;', 'background-color': '#D1D4D4;',
'width': '600rpx', 'width': '600rpx',
'height': '104rpx' 'height': '104rpx'
} }
} }
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('选择产品页') getApp().trackPage('选择产品页')
this.getRelationDictionaryV2() this.getRelationDictionaryV2()
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
let shareObj = { let shareObj = {
title: '', title: '',
path: '/pages/photo/product', path: '/pages/photo/product',
imageUrl: '', imageUrl: '',
success() {}, success() {},
fail() {} fail() {}
} }
return shareObj return shareObj
}, },
methods: { methods: {
getRelationDictionaryV2: function() { //选择 点击
this.$u.cloudApi.getRelationDictionaryV2().then(res => { itemClick: function(type, item, ikey) {
if (res && res.result) {
this.classifyList = res.result switch (type) {
this.param.classifyId = res.result[0].id case 'classifyId':
this.systemList = res.result[0].child this.param = {
} classifyId: item.id,
}) systemId: '',
}, brandId: ''
}
//选择 点击 this.selectedAll = false
itemClick: function(type, item, ikey) { this.systemList = this.classifyList[ikey].child
this.brandList = []
switch (type) { break
case 'classifyId': case 'systemId':
this.param = { this.param = {
classifyId: item.id, classifyId: this.param.classifyId,
systemId: '', systemId: item.id,
brandId: '' brandId: ''
} }
this.selectedAll = false
this.systemList = this.classifyList[ikey].child this.selectedAll = false
this.brandList = [] this.brandList = this.systemList[ikey].child
break
case 'systemId': break
this.param = { case 'brandId':
classifyId: this.param.classifyId, this.param.brandId = item.id
systemId: item.id, this.selectedAll = true
brandId: '' this.brandName = item.name
} break
default:
this.selectedAll = false break
this.brandList = this.systemList[ikey].child }
},
break
case 'brandId': // 点击下一步
this.param.brandId = item.id handleClick() {
this.selectedAll = true // 点击下一步设置全局拍照品牌品类
this.brandName = item.name if (!this.selectedAll) {
break return
default: }
break const globalData = getApp().globalData
} // if (!globalData.token) {
}, // uni.navigateTo({
// url: '/pages/login/wxlogin'
// 点击下一步 // })
handleClick() { // return
// 点击下一步设置全局拍照品牌品类 // }
if (!this.selectedAll) { let keys = ['brandId', 'brandName', 'classifyId', 'systemId']
return keys.map(key => {
} globalData.photo.product[key] = this[key] || this.param[key]
const globalData = getApp().globalData
// if (!globalData.token) {
// uni.navigateTo({
// url: '/pages/login/wxlogin'
// })
// return
// }
let keys = ['brandId', 'brandName', 'classifyId', 'systemId']
keys.map(key => {
globalData.photo.product[key] = this[key] || this.param[key]
}) })
uni.navigateTo({ uni.navigateTo({
url: '/pages/photo/list' + url: '/pages/photo/list' +
'?brandId=' + this.param.brandId + '?brandId=' + this.param.brandId +
'&brand=' + this.brandName + '&brand=' + this.brandName +
'&classifyId=' + this.param.classifyId + '&classifyId=' + this.param.classifyId +
'&systemId=' + this.param.systemId, '&systemId=' + this.param.systemId,
}) })
} }
} }
} }
</script> </script>
<style> <style>
.backView { .backView {
background-color: #F4f5f7; background-color: #F4f5f7;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
height: 100%; height: 100%;
} }
.topTitle { .topTitle {
margin-top: 50rpx; margin-top: 50rpx;
padding-left: 30rpx; padding-left: 30rpx;
font-size: 36rpx; font-size: 36rpx;
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
} }
.ph-pr-content { .ph-pr-content {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: flex-start; justify-content: flex-start;
width: 100%; width: 100%;
padding: 22rpx 22rpx; padding: 22rpx 22rpx;
} }
.ph-pr-arr { .ph-pr-arr {
width: 100%; width: 100%;
} }
.item-view { .item-view {
background-color: #FFFFFF; background-color: #FFFFFF;
/* width: 548rpx; */ /* width: 548rpx; */
margin: 0rpx 8rpx 24rpx 8rpx; margin: 0rpx 8rpx 24rpx 8rpx;
/* flex: 1 1 0%; /* flex: 1 1 0%;
max-width: 33%; */ max-width: 33%; */
width: 222rpx; width: 222rpx;
height: 76rpx; height: 76rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-style: solid; border-style: solid;
box-shadow: 0px 2px 7px 0px rgba(0, 0, 0, 0.05); box-shadow: 0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx; border-width: 0rpx;
border-radius: 12rpx; border-radius: 12rpx;
font-size: 26rpx; font-size: 26rpx;
color: #666666; color: #666666;
} }
.select-item-view { .select-item-view {
background-color: #2272FF; background-color: #2272FF;
margin: 0rpx 8rpx 24rpx 8rpx; margin: 0rpx 8rpx 24rpx 8rpx;
/* flex: 1 1 0%; /* flex: 1 1 0%;
max-width: 33%; */ max-width: 33%; */
width: 222rpx; width: 222rpx;
height: 76rpx; height: 76rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-style: solid; border-style: solid;
box-shadow: 0px 2px 7px 0px rgba(0, 0, 0, 0.05); box-shadow: 0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx; border-width: 0rpx;
border-radius: 12rpx; border-radius: 12rpx;
font-size: 26rpx; font-size: 26rpx;
color: #FFFFFF; color: #FFFFFF;
} }
.ph-pr-button { .ph-pr-button {
position: absolute; position: absolute;
bottom: 76rpx; bottom: 76rpx;
font-size: 32rpx; font-size: 32rpx;
} }
</style> </style>
...@@ -144,27 +144,6 @@ ...@@ -144,27 +144,6 @@
} }
}, },
methods: { methods: {
getListData: function() {
this.loading = true
let that = this
this.$u.cloudApi.getGroupStandardV2({
'token': this.vuex_token,
'classify_id': this.classifyId,
'system_id': this.systemId,
'brand_id': this.brandId
}).then(res => {
this.loading = false
if (res && res.result) {
if (res.result.error_code) {
uni.showToast({
title: res.result.error_msg
})
} else {
that.handleData(res.result)
}
}
})
},
getListDataNew() { getListDataNew() {
this.loading = true this.loading = true
let self = this let self = this
...@@ -251,17 +230,6 @@ ...@@ -251,17 +230,6 @@
url: '/pages/photo/take' url: '/pages/photo/take'
}) })
}, },
// 清除图片
handleClickSure: function() {
this.$u.cloudApi.cleanImage({
'token': this.vuex_token,
}).then(res => {
this.isPopShow = false
if (res && res.result) {
this.getListData()
}
})
},
take(item,ikey) { take(item,ikey) {
this.currentItemDate = item this.currentItemDate = item
......
<template> <template>
<view> <view>
<view class="contentView"> <view class="contentView">
<u-image class="pic" :src="files[0]" bg-color="transparent" @click="showPreviewFn"></u-image> <u-image class="pic" :src="files[0]" bg-color="transparent" @click="showPreviewFn"></u-image>
<!-- <image class="pic" :src="files[0]" v-lazy mode="aspectFit"></image> --> <!-- <image class="pic" :src="files[0]" v-lazy mode="aspectFit"></image> -->
</view> </view>
<view class="bottomView"> <view class="bottomView">
<image class="btn" :src="btn_remake" @click="$u.throttle(remakePhoto, 3000)"></image> <image class="btn" :src="btn_remake" @click="$u.throttle(remakePhoto, 3000)"></image>
<image class="btn" :src="btn_continue" @click="$u.throttle(continuePhoto, 3000)"></image> <image class="btn" :src="btn_continue" @click="$u.throttle(continuePhoto, 3000)"></image>
</view> </view>
<image class="btn finish" src="/static/photo/finish.png" @click="$u.throttle(finishPhoto, 3000)"></image> <image class="btn finish" src="/static/photo/finish.png" @click="$u.throttle(finishPhoto, 3000)"></image>
</view> </view>
</template> </template>
<script> <script>
import qiniup from '@/components/upload/qiniup'; import qiniup from '@/components/upload/qiniup';
const app = getApp() const app = getApp()
export default { export default {
mixins: [qiniup], mixins: [qiniup],
data() { data() {
return { return {
protocolContent: '', protocolContent: '',
btn_remake: 'https://qn-static.banshouhui.com/take_order/photo/remake.png', btn_remake: 'https://qn-static.banshouhui.com/take_order/photo/remake.png',
btn_continue: '/static/photo/continue.png', btn_continue: '/static/photo/continue.png',
standardId: '', standardId: '',
images: [], images: [],
files: [], files: [],
fileMaps: [], fileMaps: [],
keys: [], keys: [],
token: '', token: '',
product: '', product: '',
} }
}, },
onLoad(e) { onLoad(e) {
// 获取照片选项对象 // 获取照片选项对象
const product = app.globalData.photo.product const product = app.globalData.photo.product
this.product = `?brandId=${product.brandId}&brand=${product.brandName}&classifyId=${product.classifyId}&systemId=${product.systemId}` this.product = `?brandId=${product.brandId}&brand=${product.brandName}&classifyId=${product.classifyId}&systemId=${product.systemId}`
if(app.globalData.photo.currentItem) { if(app.globalData.photo.currentItem) {
// 获取规格Id // 获取规格Id
this.standardId = app.globalData.photo.currentItem._id this.standardId = app.globalData.photo.currentItem._id
} }
getApp().trackPage('照片预览页') getApp().trackPage('照片预览页')
const globalTempPath = getApp().globalData.photo.tempPath const globalTempPath = getApp().globalData.photo.tempPath
if(globalTempPath && globalTempPath.mixWater){ if(globalTempPath && globalTempPath.mixWater){
this.files = [globalTempPath.mixWater] this.files = [globalTempPath.mixWater]
} }
if(e.standardId) { if(e.standardId) {
this.standardId = e.standardId this.standardId = e.standardId
} }
this.token = this.vuex_token this.token = this.vuex_token
}, },
methods: { methods: {
// 保存照片到本地 // 保存照片到本地
async saveTempToLocal(tempImagePath) { async saveTempToLocal(tempImagePath) {
//has_origin //是否保存原图 //has_origin //是否保存原图
let that = this let that = this
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
if(!photo.tempPath){ if(!photo.tempPath){
return return
} }
let path = '' let path = ''
if(photo.tempPath.origin && photo.waterSetting && photo.waterSetting.has_origin){ if(photo.tempPath.origin && photo.waterSetting && photo.waterSetting.has_origin){
// 保存原图到本地 // 保存原图到本地
path = photo.tempPath.origin path = photo.tempPath.origin
let result = await this.saveLocal(path) let result = await this.saveLocal(path)
if(result){ if(result){
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '已将照片原图保存到本地相册' title: '已将照片原图保存到本地相册'
}) })
} }
} }
if(photo.currentItem){ if(photo.currentItem){
photo.currentItem.imageList.unshift(photo.tempPath.mixWater) photo.currentItem.imageList.unshift(photo.tempPath.mixWater)
} }
// if(photo.productList && photo.productList[photo.topIndex]){ // if(photo.productList && photo.productList[photo.topIndex]){
// const topArr = photo.productList[photo.topIndex] // const topArr = photo.productList[photo.topIndex]
// if(topArr[photo.itemIndex]){ // if(topArr[photo.itemIndex]){
// topArr[photo.itemIndex].imageList.push(photo.tempPath.mixWater) // topArr[photo.itemIndex].imageList.push(photo.tempPath.mixWater)
// } // }
// } // }
// photo. // photo.
if(photo.tempPath.mixWater){ if(photo.tempPath.mixWater){
// 保存水印处理图片到本地 // 保存水印处理图片到本地
path = photo.tempPath.mixWater path = photo.tempPath.mixWater
let result1 = await this.saveLocal(path) let result1 = await this.saveLocal(path)
if(result1){ if(result1){
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '已将水印图片保存到本地相册' title: '已将水印图片保存到本地相册'
}) })
} }
} }
}, },
saveLocal(path){ saveLocal(path){
return new Promise((resolve,reject)=>{ return new Promise((resolve,reject)=>{
uni.saveImageToPhotosAlbum({ uni.saveImageToPhotosAlbum({
filePath: path, filePath: path,
success() { success() {
resolve(true) resolve(true)
}, },
fail() { fail() {
reject('保存失败') reject('保存失败')
} }
}) })
}) })
}, },
showPreviewFn(img) { showPreviewFn(img) {
uni.previewImage({ uni.previewImage({
current: 0, current: 0,
urls: this.files urls: this.files
}); });
}, },
// 重拍图片 // 重拍图片
remakePhoto() { remakePhoto() {
uni.navigateBack({ uni.navigateBack({
delta:1 delta:1
}) })
}, },
finishPhoto(){ finishPhoto(){
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
photo.currentItemLength = 10 photo.currentItemLength = 10
this.continuePhoto() this.continuePhoto()
// 完成本项 // 完成本项
// uni.navigateBack({ // uni.navigateBack({
// delta:2 // delta:2
// }) // })
}, },
// 确认图片 // 确认图片
continuePhoto() { continuePhoto() {
let self = this let self = this
uni.showLoading({ uni.showLoading({
title:'图片保存中…' title:'图片保存中…'
}) })
self.saveTempToLocal() self.saveTempToLocal()
self.confirmUpload(true) self.confirmUpload(true)
}, },
submitFile() { downloadImages() {
let self = this let self = this;
for (let url of this.images) {
if(self.keys.length) { uni.downloadFile({
for (let s of self.keys) { url: url, //仅为示例,并非真实的资源
self.$u.cloudApi.saveImage({ success(res) {
"token": self.token, // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
"standardId": self.standardId, if (res.statusCode === 200) {
"url": s, self.files.push(res.tempFilePath)
}).then(async res =>{ }
console.log(res, "云服务保存图片"); },
if(res.result.code) { fail(e) {
// TODO 参数是否要来回传递 }
const photo = getApp().globalData.photo })
photo.currentItemLength = photo.currentItemLength + 1 }
uni.hideLoading() },
// 当前项的图片显示
// 拍照项张数目增加 等于10张 }
if(photo.currentItemLength<10){ }
uni.navigateBack({ </script>
delta:1
}) <style lang="scss">
}else{ .contentView {
uni.navigateBack({ background-color: #333333;
delta:2 /* padding-top: 120rpx; */
}) padding-bottom:228rpx;
} height: 100vh;
// let timer = setTimeout(()=>{ display: flex;
// if(photo.currentItemLength<10){ flex-direction: column;
// uni.navigateBack({ }
// delta:1 /deep/ .u-image{
// }) height:100vh !important;
// }else{ }
// uni.navigateBack({ /deep/ .u-image__loading{
// delta:2 background-color: transparent!important;
// }) }
// } /deep/ .u-image__error{
// },2000) background-color: transparent!important;
} else { }
uni.showToast({ .pic {
title:'图片上传失败 '+ res.result.msg flex:1;
}) width: 100%;
}
}) /* height:auto */
} /* height: 760rpx; */
} }
},
downloadImages() { .bottomView {
let self = this; box-shadow: 0 0 1rpx 6rpx rgba(255,255,255,0.05);
for (let url of this.images) { background-color: #333333;
uni.downloadFile({ width: 100%;
url: url, //仅为示例,并非真实的资源 padding:70rpx 0;
success(res) { position: fixed;
// 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容 bottom: 0;
if (res.statusCode === 200) { display: flex;
self.files.push(res.tempFilePath) justify-content: space-around;
} align-items: center;
}, .btn{
fail(e) { display: block;
} width: 200rpx;
}) height: 88rpx;
} }
}, }
.btn{
} display: block;
} width: 232rpx;
</script> height: 80rpx;
&.finish{
<style lang="scss"> position: fixed;
.contentView { top:30rpx;
background-color: #333333; right:30rpx;
/* padding-top: 120rpx; */ }
padding-bottom:228rpx; }
height: 100vh; </style>
display: flex;
flex-direction: column;
}
/deep/ .u-image{
height:100vh !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:30rpx;
right:30rpx;
}
}
</style>
...@@ -122,46 +122,8 @@ ...@@ -122,46 +122,8 @@
const globalData = getApp().globalData const globalData = getApp().globalData
this.icon_close_new = globalData.icon_close_new this.icon_close_new = globalData.icon_close_new
this.systemId = globalData.photo.product.systemId this.systemId = globalData.photo.product.systemId
this.getItemList()
}, },
methods: { methods: {
getItemList: function() {
// this.systemId = '79550af260555cc20afb34156c94b32c' // 测试数据
this.loading = true
this.$u.cloudApi.getUserWatermark({
'token': this.vuex_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.cloudApi.saveUserWatermark({
'token': this.vuex_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) { handleOrigineChange: function(e) {
this.result['hasOrigin'] = !this.result['hasOrigin'] this.result['hasOrigin'] = !this.result['hasOrigin']
......
...@@ -322,11 +322,16 @@ export default { ...@@ -322,11 +322,16 @@ export default {
break; break;
} }
await self.chooseImage("qiniu", {...attr, options: {count: 1}}) if (self.uploadType === 'id_card_front' || self.uploadType === 'id_card_back') {
await self.chooseImage("qiniu", {...attr, options: {count: 1}})
} else {
self.imgList = await self.chooseImg({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
self.formShowList[index].imgs[key] = self.imgList[0].src self.formShowList[index].imgs[key] = self.imgList[0].path
this.updateImgs() this.updateImgs()
} }
}, },
...@@ -349,14 +354,14 @@ export default { ...@@ -349,14 +354,14 @@ export default {
let imgs = [] let imgs = []
otherImgs.map(item => { otherImgs.map(item => {
const img = item.key || item.src || '' const img = item.key || ''
imgs.push(img) imgs.push(img)
}) })
this.fileInfo['other_photos'][photoType]['url'] = imgs.join(',') this.fileInfo['other_photos'][photoType]['url'] = imgs.join(',')
return return
} }
this.fileInfo[uploadType] = uploadImgs[0].key || uploadImgs[0].src || '' this.fileInfo[uploadType] = uploadImgs[0].key || ''
}, },
toUploadImg(item, index) { toUploadImg(item, index) {
this.uploadType = item.filedName this.uploadType = item.filedName
...@@ -372,7 +377,7 @@ export default { ...@@ -372,7 +377,7 @@ export default {
}, },
async checkIdCard(type) { async checkIdCard(type) {
uni.showLoading({ uni.showLoading({
title: '加载中' title: '识别中'
}) })
let request = { let request = {
front: this.$u.api.checkSettleIDCardFront, front: this.$u.api.checkSettleIDCardFront,
...@@ -461,9 +466,9 @@ export default { ...@@ -461,9 +466,9 @@ export default {
return formFlag; return formFlag;
}, },
async submitFileInfo() { async submitFileInfo() {
if (!this.submitBtnStatus) { if (!this.submitBtnStatus) {
return return
} }
if (!this.checkFileInfo()) { if (!this.checkFileInfo()) {
return; return;
...@@ -472,7 +477,7 @@ export default { ...@@ -472,7 +477,7 @@ export default {
fileInfo.other_photos = JSON.stringify(fileInfo.other_photos) fileInfo.other_photos = JSON.stringify(fileInfo.other_photos)
let submitInfoData = { let submitInfoData = {
...fileInfo, ...fileInfo,
recommender: getApp().globalData.settleRecommend recommender: getApp().globalData.settleRecommend,
} }
uni.showLoading({ uni.showLoading({
title: '加载中……' title: '加载中……'
...@@ -529,7 +534,7 @@ export default { ...@@ -529,7 +534,7 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y:auto; overflow-y:auto;
} }
...@@ -748,9 +753,9 @@ export default { ...@@ -748,9 +753,9 @@ export default {
padding: 38rpx 30rpx 30rpx 30rpx; padding: 38rpx 30rpx 30rpx 30rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;
.title-left-view { .title-left-view {
font-weight: bold; font-weight: bold;
} }
.title-image { .title-image {
......
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