Commit 967e44e1 authored by 李超鹏's avatar 李超鹏

update:update

scope:self-support
body:删除云开发相关代码
parent 4be9741b
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 {
commonApiFun
} from '@/common/api/common.js';
......@@ -14,7 +11,6 @@ import {certApiFun} from"@/common/api/cert.js"
let apiFun = function(vm) {
let commonApi = commonApiFun(vm);
let settledApi = settledApiFun(vm)
let cloudApi = cloudRulesApiFun(vm)
let learnApi=learnApiFun(vm)
let assessmentApi = assessmentApiFun(vm)
let orderApi=orderApiFun(vm)
......@@ -22,7 +18,6 @@ let apiFun = function(vm) {
let apiUrl = {
...commonApi,
...settledApi,
...cloudApi,
...learnApi,
...orderApi,
...assessmentApi,
......
import {apiFun} from '@/common/api/index.js';
import {
cloudRulesApiFun
} from "@/common/api/cloud_rules.js"
const install = (Vue, vm) => {
let apiUrls = apiFun(vm)
......@@ -9,10 +7,6 @@ const install = (Vue, vm) => {
vm.$u.api = {
...apiUrls,
};
let cloudRules = cloudRulesApiFun(vm)
vm.$u.cloudApi = {
...cloudRules
}
}
export default {
......
......@@ -81,16 +81,6 @@
return shareObj
},
methods: {
getRelationDictionaryV2: function() {
this.$u.cloudApi.getRelationDictionaryV2().then(res => {
if (res && res.result) {
this.classifyList = res.result
this.param.classifyId = res.result[0].id
this.systemList = res.result[0].child
}
})
},
//选择 点击
itemClick: function(type, item, ikey) {
......
......@@ -144,27 +144,6 @@
}
},
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() {
this.loading = true
let self = this
......@@ -251,17 +230,6 @@
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) {
this.currentItemDate = item
......
......@@ -138,53 +138,6 @@
self.saveTempToLocal()
self.confirmUpload(true)
},
submitFile() {
let self = this
if(self.keys.length) {
for (let s of self.keys) {
self.$u.cloudApi.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){
uni.navigateBack({
delta:1
})
}else{
uni.navigateBack({
delta:2
})
}
// let timer = setTimeout(()=>{
// if(photo.currentItemLength<10){
// uni.navigateBack({
// delta:1
// })
// }else{
// uni.navigateBack({
// delta:2
// })
// }
// },2000)
} else {
uni.showToast({
title:'图片上传失败 '+ res.result.msg
})
}
})
}
}
},
downloadImages() {
let self = this;
for (let url of this.images) {
......
......@@ -122,46 +122,8 @@
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.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) {
this.result['hasOrigin'] = !this.result['hasOrigin']
......
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