按钮undefined 修改

This commit is contained in:
1154079537 2024-05-22 17:28:09 +08:00
parent a0950db415
commit b9567e1099
2 changed files with 24 additions and 22 deletions

View File

@ -70,16 +70,16 @@
<u-icon name="arrow-right" style="margin-right: 30rpx;"></u-icon>
</view>
</u-form-item>
<u-form-item label="零售价格" prop="formData.price" ref="item1" border-bottom>
<u--input inputAlign='right' placeholderStyle="color:#777777" style="width: 300rpx;"
placeholder="请输入零售价" type='number' @blur='fixed2(1)' v-model="formData.attrValue[0].price"
slot='right'></u--input>
</u-form-item>
<u-form-item v-if='isWholeSale' label="批发价格" prop="formData.wholesale_price" ref="item1" border-bottom>
<u--input inputAlign='right' placeholderStyle="color:#777777" style="width: 300rpx;"
placeholder="请输入批发价格" @blur='fixed2(2)' type='number'
v-model="formData.attrValue[0].wholesale_price" slot='right'></u--input>
</u-form-item>
<u-form-item v-else label="零售价格" prop="formData.price" ref="item1" border-bottom>
<u--input inputAlign='right' placeholderStyle="color:#777777" style="width: 300rpx;"
placeholder="请输入零售价" type='number' @blur='fixed2(1)' v-model="formData.attrValue[0].price"
slot='right'></u--input>
</u-form-item>
<u-form-item label="商品库存" prop="formData.stock" ref="item1">
<u--input inputAlign='right' type='number' placeholderStyle="color:#777777" style="width: 300rpx;"
placeholder="请输入库存" v-model="formData.attrValue[0].stock" slot='right'></u--input>
@ -143,8 +143,6 @@
</view>
<view class='mask' catchtouchmove="true" :hidden='showVideo==false' @tap="showVideo=false"></view>
</view>
</template>
<script>
@ -238,16 +236,11 @@
"cate_name": "",
"unit_name": "",
"cate_id": '',
"mer_cate_id": [
],
"mer_cate_id": [],
"mer_cate_name": "",
"spec_type": "0",
"specifica": "",
"delivery_way": [
],
"delivery_way": [],
"delivery_free": "1",
"temp_id": "",
"tempName": "",
@ -320,7 +313,6 @@
message: '请输入库存',
trigger: ['change', 'blur'],
}],
},
};
},
@ -355,7 +347,7 @@
}
},
async choseMedia(e) {
// #ifdef APP-PLUS
let result = await this.$store.dispatch("permission/requestPermissions",
'CAMERA')
@ -444,7 +436,6 @@
console.log(JSON.stringify(res.tempFilePaths));
}
});
},
choseAttr(name) {
@ -517,7 +508,6 @@
console.log('err', errors)
// uni.$u.toast(errors[0].message)
})
}
},
onLoad(option) {
@ -532,7 +522,6 @@
.split('--')[1] : JSON.parse(option.data).label;
this.formData.cate_id = JSON.parse(option.data).value
}
console.log(this.formData.attrValue[0].detail)
},
};
</script>

View File

@ -19,7 +19,8 @@
</view>
</view>
<view class="" style="color: #FC452F;font-size: 24rpx;">
<text style="font-size: 22rpx;"></text><text>{{short.attrValue[0].price}}</text><text
<text
style="font-size: 22rpx;"></text><text>{{short.attrValue && short.attrValue[0].price}}</text><text
style="color: #828282;">/{{short.attrValue && short.attrValue[0].unit_name}}</text>
</view>
</view>
@ -67,8 +68,9 @@
<!-- <view class="btn-view">f
<button class="btn" @click="show=true">确认修改</button>
</view> -->
<view class="submit-btn">
<u-button type="primary" shape="circle" text="确认修改" @click="show=true"></u-button>
<view class="submit-btn" @click="show=true">
<button>确认修改</button>
<!-- <u-button type="primary" shape="circle" text="确认修改" ></u-button> -->
</view>
<u-modal :show="show" :closeOnClickOverlay="true" title="提示" content="确定更新库存吗" showCancelButton
@confirm="onUpdate" @cancel="show=false"></u-modal>
@ -255,6 +257,17 @@
width: 670rpx;
left: 50%;
transform: translateX(-50%);
button {
width: 100%;
height: 76rpx;
background-color: #40AE36;
border-radius: 38rpx;
color: #fff;
font-size: 28rpx;
line-height: 76rpx;
text-align: center;
}
}
// old