Compare commits

...

2 Commits

Author SHA1 Message Date
tianyi 802ce78def 1 1 month ago
tianyi 21d56db0e0 1 1 month ago
  1. 29
      pages/shop/addGoods.vue
  2. 2
      pages/shop/shopEvaluate.vue
  3. 2
      pages/shop/transferDeliveryOrderList.vue

29
pages/shop/addGoods.vue

@ -31,9 +31,8 @@
<input type="digit" class="content-input" v-model="formData.orderFiled" placeholder="请输入排名"> <input type="digit" class="content-input" v-model="formData.orderFiled" placeholder="请输入排名">
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="商品分类" name="editTitle"> <uni-forms-item label="商品分类" name="editTitle">
<view style="border: 4rpx solid #eee;display: flex;flex: 1;border-radius: 10rpx;"> <view @click="goGategoryLow" style="height:70rpx;border: 4rpx solid #eee;display: flex;flex: 1;border-radius: 10rpx;">
<text @click="goGategoryLow" placeholder="请选择商品分类" <text class="content-input" style="height:70rpx;border: 0;">{{typeItem.categoryName}}</text>
class="content-input" style="border: 0;flex: 1;">{{typeItem.categoryName}}</text>
<uni-icons type="right" size="16" <uni-icons type="right" size="16"
style="margin-left: 40rpx;line-height: 70rpx;"></uni-icons> style="margin-left: 40rpx;line-height: 70rpx;"></uni-icons>
</view> </view>
@ -117,7 +116,6 @@
<uni-forms-item label="详细图文" name="startPayNum"> <uni-forms-item label="详细图文" name="startPayNum">
<view class="xiangxi-box"> <view class="xiangxi-box">
<sp-editor <sp-editor
@init="initEditor" @init="initEditor"
@input="inputOver" @input="inputOver"
@upinImage="upinImage" @upinImage="upinImage"
@ -374,7 +372,6 @@
}, },
// //
goGategoryLow() { goGategoryLow() {
console.log("111111111111")
uni.navigateTo({ uni.navigateTo({
url: '/pages/shop/addType' url: '/pages/shop/addType'
}) })
@ -388,10 +385,7 @@
this.productCategoryList = Array.isArray(res.result) ? res.result : [] this.productCategoryList = Array.isArray(res.result) ? res.result : []
this.syncSelectedCategory() this.syncSelectedCategory()
} else { } else {
uni.showToast({ this.tui.toast(res.message)
title: res.message,
icon: 'none'
})
} }
}) })
}, },
@ -433,6 +427,7 @@
submit() { submit() {
let that = this; let that = this;
this.syncLunchBoxByMoreBuy() this.syncLunchBoxByMoreBuy()
this.normalizeGroupBuyPrices()
if (!this.validateProductSpecs()) { if (!this.validateProductSpecs()) {
return return
} }
@ -517,7 +512,6 @@
} }
const startPayNum = String(this.formData.startPayNum).trim() const startPayNum = String(this.formData.startPayNum).trim()
if (startPayNum !== '' && !this.isValidInteger(startPayNum)) { if (startPayNum !== '' && !this.isValidInteger(startPayNum)) {
uni.showToast({ uni.showToast({
title: '起售数量只能输入整数', title: '起售数量只能输入整数',
icon: 'none' icon: 'none'
@ -555,6 +549,17 @@
} }
return true return true
}, },
normalizeGroupBuyPrices() {
if (!Array.isArray(this.formData.productGroupBuyPrices)) {
this.formData.productGroupBuyPrices = []
return
}
this.formData.productGroupBuyPrices = this.formData.productGroupBuyPrices.filter((item) => {
const groupCount = item && item.groupCount !== undefined && item.groupCount !== null ? String(item.groupCount).trim() : ''
const groupPrice = item && item.groupPrice !== undefined && item.groupPrice !== null ? String(item.groupPrice).trim() : ''
return groupCount !== '' || groupPrice !== ''
})
},
isValidPrice(value) { isValidPrice(value) {
return /^\d+(\.\d{1,2})?$/.test(value) && Number(value) > 0 return /^\d+(\.\d{1,2})?$/.test(value) && Number(value) > 0
}, },
@ -845,7 +850,9 @@
}, },
getCateGorySon(id){ getCateGorySon(id){
let that = this let that = this
this.NB.sendRequest("/app/productAttributeValue/selectByAttributeId", {}, false, 'get', 'application/x-www-form-urlencoded').then((res) => { this.NB.sendRequest("/app/productAttributeValue/selectByAttributeId", {
id: id,
}, false, 'get', 'application/x-www-form-urlencoded').then((res) => {
if (res.code == 200) { if (res.code == 200) {
that.categorySonData = res.result that.categorySonData = res.result
for (var i = 0; i < that.categorySonData.length; i++) { for (var i = 0; i < that.categorySonData.length; i++) {

2
pages/shop/shopEvaluate.vue

@ -361,7 +361,7 @@
let that = this; let that = this;
let hiver_token = uni.getStorageSync("hiver_token") let hiver_token = uni.getStorageSync("hiver_token")
await uni.uploadFile({ await uni.uploadFile({
url: that.tui.interfaceUrl() + '/upload/file', url: getApp().globalData.mainurl + '/upload/file',
filePath: path, filePath: path,
name: 'file', name: 'file',
header: { header: {

2
pages/shop/transferDeliveryOrderList.vue

@ -205,7 +205,7 @@
}, },
uploadImage(index, filePath) { uploadImage(index, filePath) {
uni.uploadFile({ uni.uploadFile({
url: this.tui.interfaceUrl() + '/upload/file', url: getApp().globalData.mainurl + '/upload/file',
filePath, filePath,
name: 'file', name: 'file',
header: { header: {

Loading…
Cancel
Save