tianyi 2 weeks ago
parent
commit
c067af7243
  1. 2
      pages/login/login.vue
  2. 58
      pages/shop/addGoods.vue

2
pages/login/login.vue

@ -344,7 +344,7 @@
uni.setStorageSync("isShop",true)
setTimeout(() => {
uni.reLaunch({
url: '../index/index'
url: '../worker/index'
})
}, 200)
uni.showToast('登录成功', 2000, true)

58
pages/shop/addGoods.vue

@ -267,7 +267,6 @@
* @param {Object} e {html,text} 内容的html文本和text文本
*/
inputOver(e) {
//
this.productIntro = e
},
@ -276,7 +275,6 @@
* @param {Object} e {html,text} 内容的html文本和text文本
*/
overMax(e) {
//
},
/**
@ -286,9 +284,7 @@
* @tutorial 相关api https://uniapp.dcloud.net.cn/api/media/editor-context.html
*/
initEditor(editor) {
this.editorIns = editor //
//
this.editorIns = editor
},
/**
* 直接运行示例工程插入图片无法正常显示的看这里
@ -308,7 +304,7 @@
// tempFilePath
editorCtx.insertImage({
src: tempFiles[0].tempFilePath,
width: '80%', // 100%便
width: '80%',
success: function() {}
})
// #endif
@ -316,35 +312,10 @@
// #ifndef MP-WEIXIN
editorCtx.insertImage({
src: tempFiles[0].path,
width: '80%', // 100%便
width: '80%',
success: function() {}
})
// #endif
/**
* 使用 uniCloud.uploadFile 上传图片的示例方法可适用多选上传
* 正式开发环境中请将上面 本地临时插入图片预览 注释后模仿以下写法
*/
// tempFiles.forEach(async (item) => {
// uni.showLoading({
// title: '',
// mask: true
// })
// let upfile = await uniCloud.uploadFile({
// filePath: item.path,
// // policy_does_not_allow_file_overwrite
// // cloudPath / cloudstorage
// cloudPath: `cloudstorage/${item.name}`,
// cloudPathAsRealPath: true
// })
// editorCtx.insertImage({
// src: upfile.fileID,
// width: '80%', // 100%便
// success: function () {
// uni.hideLoading()
// }
// })
// })
},
//
goGategoryLow() {
@ -369,7 +340,6 @@
this.typeItem = res.result[0]
this.formData.categoryId = this.typeItem.id
}
}
} else {
uni.showToast({
@ -386,7 +356,7 @@
// this.$refs.form.validate((valid) => {
// if (valid) {
if (this.modalType == 0) {
// id
delete this.formData.id;
if(this.formData.isMoreBuy != 1){
this.formData.isMoreBuy = 0
@ -454,7 +424,7 @@
},
guigeSubmit(){
if(this.modalclassType == 'shuxing'){
// canbuy
if(this.typeToAttrName){
this.canbuyMap[this.typeToAttrName] = parseInt(this.currentCanbuy) || 1
}
@ -462,7 +432,7 @@
let parentName = this.attrValueArr[i].parentName
let canbuyVal = parseInt(this.canbuyMap[parentName]) || 1
if(this.formData.attributeList1.size == 0){
//set has get
let data = {
title:[],
canbuy: canbuyVal
@ -545,7 +515,7 @@
},
edit(v) {
this.modalType = 1;
// null""
for (let attr in v) {
if (v[attr] == null) {
v[attr] = "";
@ -556,7 +526,6 @@
this.formData = data;
// attributeListstring
let attrObj = this.formData.attributeList
if (typeof attrObj === 'string' && attrObj !== '') {
attrObj = JSON.parse(attrObj)
@ -566,7 +535,6 @@
}
this.formData.attributeList1 = new Map(Object.entries(attrObj));
// attributeListPricestring
let priceArr = this.formData.attributeListPrice
if (typeof priceArr === 'string' && priceArr !== '') {
priceArr = JSON.parse(priceArr)
@ -576,7 +544,6 @@
}
this.formData.attributeListPrice = priceArr
// canbuyMapcanbuy1
this.canbuyMap = {}
this.attrValueArr = []
this.formData.attributeList1.forEach((value, key) => {
@ -589,9 +556,8 @@
})
}
});
// attributeListPricespecValueArr
this.specValueArr = JSON.parse(JSON.stringify(this.formData.attributeListPrice))
this.specValueArr = JSON.parse(JSON.stringify(this.formData.attributeListPrice))
this.formData.sellTime = this.formData.sellBeginTime != '' ? 1 : 0
this.modalVisible = true;
@ -610,7 +576,7 @@
}
}
}else{
//guige
if(this.categorySonData[index].checked == true){
this.specValueArr.push(this.categorySonData[index])
}else{
@ -625,7 +591,7 @@
},
//
clickLeftBtn(index) {
// canbuy
if(this.typeToAttrName){
this.canbuyMap[this.typeToAttrName] = parseInt(this.currentCanbuy) || 1
}
@ -638,7 +604,7 @@
}
this.categoryIndex = index
this.typeToAttrName = this.categoryData[this.categoryIndex].title
// canbuy
this.currentCanbuy = this.canbuyMap[this.typeToAttrName] || 1
this.getCateGorySon(this.categoryData[this.categoryIndex].id)
},
@ -674,7 +640,7 @@
that.categoryData[i].parentId = false
}
}
//parent
that.typeToAttrName = res.result[that.categoryIndex].title
// canbuy
that.currentCanbuy = that.canbuyMap[that.typeToAttrName] || 1

Loading…
Cancel
Save