From 22acdfa74646e0f8c2f975539af36d52d855cfcd Mon Sep 17 00:00:00 2001
From: weipengfei <2187978347@qq.com>
Date: Wed, 22 Nov 2023 17:08:05 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=80=89=E6=8B=A9=E8=A7=84?=
=?UTF-8?q?=E6=A0=BC=E6=A8=A1=E6=9D=BF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/product/addGood/specGood.vue | 55 +++++++++++++++++++++---------
1 file changed, 39 insertions(+), 16 deletions(-)
diff --git a/pages/product/addGood/specGood.vue b/pages/product/addGood/specGood.vue
index eb3dd37..06de8a7 100644
--- a/pages/product/addGood/specGood.vue
+++ b/pages/product/addGood/specGood.vue
@@ -3,14 +3,13 @@
规格模板
-
- 点击选择模板
-
-
+
+
+ {{template_name}}
+
+
+
添加模板
-
-
-
点击设置规格
@@ -58,6 +57,7 @@
+
@@ -109,7 +109,8 @@
import { TOKENNAME, HTTP_REQUEST_URL } from '@/config/app.js';
import { Toast } from "../../../libs/uniApi";
import {
- specificationUpdate
+ specificationUpdate,
+ attrList
} from "@/api/product.js"
export default {
components: {
@@ -120,7 +121,9 @@
return {
attrValue: [],
attr: [],
- attr_mode: {
+ attr_mode_list: [], //规格模板列表
+ template_name: '点击选择模板', //选中的模板名字
+ attr_mode: { // 规格字段模板
"detail": {},
"sku": "",
"stock": 0,
@@ -158,6 +161,7 @@
})
this.userInfo = this.$store.state.app.userInfo;
if (typeof this.userInfo == 'string') this.userInfo = JSON.parse(this.userInfo);
+ this.initAttrModeList();
},
methods: {
updateCode(e) {
@@ -421,6 +425,23 @@
deleteAttr() {
this.attrValue.splice(this.deleteIndex, 1);
this.showDelete = false;
+ },
+ // 初始化规格模板
+ initAttrModeList(){
+ attrList(this.userInfo.service.mer_id,{
+ page: 1,
+ limit: 10000
+ }).then((res)=>{
+ console.log(res);
+ this.attr_mode_list = res.data.list;
+ })
+ },
+ changAttrMode(e){
+ this.attr_template_id = this.attr_mode_list[e.detail.value].attr_template_id;
+ this.template_name = this.attr_mode_list[e.detail.value].template_name;
+ this.attr = JSON.parse(JSON.stringify(this.attr_mode_list[e.detail.value].template_value));
+ this.$set(this, 'attrValue', []);
+ this.addAttrValueCard();
}
},
onBackPress: () => {
@@ -514,9 +535,14 @@
.mode {
width: 100%;
background-color: #fff;
+ position: fixed;
+ top: 0;
+ left: 0;
+ z-index: 1;
.line {
- padding: 28rpx;
+ padding: 0 28rpx;
+ height: 80rpx;
display: flex;
justify-content: space-between;
align-items: center;
@@ -542,16 +568,13 @@
}
}
- .line-warp {
- padding: 0 28rpx;
- display: flex;
- }
-
.btn-box {
- padding: 20rpx 28rpx;
+ height: 80rpx;
display: flex;
justify-content: center;
+ align-items: center;
border-top: 1rpx solid #eee;
+ border-bottom: 1rpx solid #eee;
}
.mode-ref {