xiaohaizhao 1 年之前
父节点
当前提交
3df6d33062

+ 25 - 22
packageA/activity/selectProduct/cart/index.js

@@ -6,6 +6,11 @@ const _Http = getApp().globalData.http,
 	}).format();
 let downCount = {};
 let ids = {};
+
+import {
+	getCustomText
+} from "../../../../utils/customItemType";
+
 Page({
 	data: {
 		list: [],
@@ -22,29 +27,26 @@ Page({
 		this.setData({
 			hidePrice: wx.getStorageSync('hidePrice'),
 		})
-		getApp().globalData.customizedProduct = this.customizedProduct.bind(this);
-	},
-	//修改定制
-	customizedProduct(item) {
-		return new Promise((resolve) => {
-			_Http.basic({
-				"id": 20220924104302,
-				"content": {
-					"sa_shoppingcartid": item.sa_shoppingcartid,
-					"qty": item.qty,
-					"width": item.width || 0,
-					"length": item.length || 0
-				},
-			}).then(res => {
-				console.log("修改定制", res)
-				wx.showToast({
-					title: res.msg != '成功' ? res.msg : '修改成功',
-					icon: "none"
-				});
-				this.getList()
-				resolve(true)
+		getApp().globalData.customizedProduct = (item, custom) => {
+			return new Promise((resolve) => {
+				_Http.basic({
+					"id": 20220924104302,
+					"content": {
+						"sa_shoppingcartid": item.sa_shoppingcartid,
+						"qty": item.qty,
+						...custom
+					},
+				}).then(res => {
+					console.log("修改定制", res)
+					wx.showToast({
+						title: res.msg != '成功' ? res.msg : '修改成功',
+						icon: "none"
+					});
+					this.getList()
+					resolve(true)
+				})
 			})
-		})
+		}
 	},
 	/* 获取列表 */
 	getList() {
@@ -82,6 +84,7 @@ Page({
 						results: [v.sa_shoppingcartid],
 					})
 				}
+				if (v.iscustomsize) v.customText = getCustomText(v);
 				return v
 			});
 			this.setData({

+ 1 - 2
packageA/activity/selectProduct/cart/index.wxml

@@ -21,8 +21,7 @@
 					<view class="exp">品牌:{{item.brandname ||" --"}}</view>
 					<view class="exp">领域:{{item.tradefield_shoppingcart ||" --"}}</view>
 					<view class="exp" wx:if="{{item.iscustomsize}}" data-item="{{item}}" catch:tap="customization" style="color:#085CDF;">
-						长:{{item.length}} / 宽:{{item.width}}
-						<van-icon name="arrow-down" />
+						{{item.customText}}<van-icon name="arrow-down" />
 					</view>
 					<view class="price" style="bottom: {{item.iscustomsize?'40rpx':'0rpx'}};">{{handleHide.query(item.showPrice,hidePrice)}}/{{item.unitname}}</view>
 				</view>

+ 39 - 29
packageA/activity/selectProduct/index.js

@@ -3,7 +3,11 @@ const _Http = getApp().globalData.http,
   file = require("../../../utils/FormatTheAttachment"),
   {
     getItem
-  } = require("./calculatePrice")
+  } = require("./calculatePrice");
+import {
+  getCustomText
+} from "../../../utils/customItemType";
+
 Page({
   data: {
     loading: true,
@@ -32,7 +36,34 @@ Page({
       idname: options.idname || this.data.idname
     });
     this.getList()
-    getApp().globalData.customizedProduct = this.customizedProduct.bind(this);
+    getApp().globalData.customizedProduct = (item, custom) => {
+      item = getItem(getItem(Object.assign(item, custom)), 'newOldPrice', 'oldprice');
+      item.customText = getCustomText(item);
+
+      return new Promise((resolve) => {
+        let index = this.data.list.findIndex(v => v[this.data.idname] == item[this.data.idname]),
+          resultList = this.data.resultList,
+          result = this.data.result;
+        if (index != -1) this.data.list[index] = item;
+        let i = resultList.findIndex(v => v[this.data.idname] == item[this.data.idname]);
+        if (item.pitchOn) {
+          if (i == -1) {
+            resultList.push(item);
+            result.push(item[this.data.idname])
+          } else {
+            resultList[i] = item;
+          }
+        } else {
+          resultList[i] = item;
+        }
+        this.setData({
+          list: this.data.list,
+          result,
+          resultList
+        })
+        resolve(true)
+      })
+    }
   },
   onShow() {
     this.getCollectCount()
@@ -106,33 +137,6 @@ Page({
     item.pitchOn = false;
     if (item) this.selectComponent("#Custom").onClick(item)
   },
-  customizedProduct(item) {
-    item = getItem(item);
-    item = getItem(item, 'newOldPrice', 'oldprice');
-    return new Promise((resolve) => {
-      let index = this.data.list.findIndex(v => v[this.data.idname] == item[this.data.idname]),
-        resultList = this.data.resultList,
-        result = this.data.result;
-      if (index != -1) this.data.list[index] = item;
-      let i = resultList.findIndex(v => v[this.data.idname] == item[this.data.idname]);
-      if (item.pitchOn) {
-        if (i == -1) {
-          resultList.push(item);
-          result.push(item[this.data.idname])
-        } else {
-          resultList[i] = item;
-        }
-      } else {
-        resultList[i] = item;
-      }
-      this.setData({
-        list: this.data.list,
-        result,
-        resultList
-      })
-      resolve(true)
-    })
-  },
   getList(init = false) {
     //init 用于初始化分页
     if (init.detail != undefined) init = init.detail;
@@ -171,6 +175,12 @@ Page({
         if (!value.saledqty) value.saledqty = 0;
         value.maxQty = value.groupqty == 0 ? "" : value.groupqty - value.saledqty; //有限购 设置最高可订购数量
         value.qty = value.orderminqty;
+
+        if (value.iscustomsize) {
+          value.customText = getCustomText(value);
+          value.pitchOn = false;
+        }
+
         return value;
       })
       this.setData({

+ 1 - 1
packageA/activity/selectProduct/index.scss

@@ -107,7 +107,7 @@ page {
 	min-height: 130rpx;
 	position: fixed;
 	bottom: 0;
-	z-index: 999;
+	z-index: 9 !important;
 	display: flex;
 	justify-content: space-between;
 	padding: 0 30rpx;

+ 4 - 3
packageA/activity/selectProduct/index.wxml

@@ -18,9 +18,8 @@
 				<view class="exp">规格:{{item.standards ||" --"}}</view>
 				<view class="exp">型号:{{item.model ||" --"}}</view>
 				<view class="exp"><text style="font-size: 24rpx;font-weight: 600;color: #FF3B30;">{{item.showPrice||item.newPrice}}</text><text style="font-size: 20rpx; text-decoration:line-through; margin-left: 6rpx;">{{item.newOldPrice||item.oldPrice}}</text></view>
-
-				<view wx:if="{{item.iscustomsize}}" class="subfield line-1" data-item="{{item}}" catch:tap="customization" style="color:#085CDF;">
-					长:{{item.length||0}} / 宽:{{item.width||0}}
+				<view wx:if="{{item.iscustomsize}}" class="exp" data-item="{{item}}" catch:tap="customization" style="color:#085CDF;">
+					{{item.customText}}
 					<van-icon name="arrow-down" />
 				</view>
 				<view class="exp">特征码:{{item.signaturecode ||" --"}}</view>
@@ -40,6 +39,8 @@
 	<Yl_Empty wx:if="{{list.length==0}}" />
 </Yl_ListBox>
 <footer wx:if="{{butText=='生成订单'}}" id='Footer' disabled='{{!result.length}}' bind:onClick='updateCart' />
+
+
 <!-- 底部 -->
 <block wx:else>
 	<view style="height: 130rpx;" />

+ 6 - 3
packageA/market/detail.js

@@ -196,11 +196,14 @@ Page({
 	},
 	handleStorage(index) {
 		let detail = this.data.detail,
-			custom = {};
+			custom = {
+				length: 0,
+				width: 0
+			};
 		//是否为定制项
 		if (detail.iscustomsize == 1) custom = this.selectComponent("#customMade").getResult(true);
-		if (typeof custom == boolean) return;
-		
+		if (typeof custom == "boolean") return;
+
 		let content = Object.assign(this.data.content, {
 			sa_brandid,
 			itemid: detail.itemid, //货品id

+ 1 - 1
packageA/market/detail.json

@@ -1,6 +1,6 @@
 {
   "usingComponents": {
     "van-tag": "@vant/weapp/tag/index",
-    "customMade": "./customMade/index"
+    "customMade": "/pages/index/collect/modules/customMade/index"
   }
 }

+ 29 - 26
pages/index/collect/index.js

@@ -5,6 +5,9 @@ const _Http = getApp().globalData.http,
 		precision: 2
 	}).format();
 let downCount = {};
+import {
+	getCustomText
+} from "../../../utils/customItemType";
 Component({
 	options: {
 		addGlobalClass: true,
@@ -16,37 +19,36 @@ Component({
 		sa_brandid: null, //当前选中品牌id
 		classList: [], //生成订单时所选
 		sum: 0, //价格合
-		allBrandList: []
+		allBrandList: [],
+		hidePrice: wx.getStorageSync('hidePrice'),
 	},
 	methods: {
 		init() {
 			this.getList()
-			this.setData({
-				hidePrice: wx.getStorageSync('hidePrice'),
-			})
-			getApp().globalData.customizedProduct = this.customizedProduct.bind(this);
-			return true;
-		},
-		customizedProduct(item) {
-			return new Promise((resolve) => {
-				_Http.basic({
-					"id": 20220924104302,
-					"content": {
-						"sa_shoppingcartid": item.sa_shoppingcartid,
-						"qty": item.qty,
-						"width": item.width || 0,
-						"length": item.length || 0
-					},
-				}).then(res => {
-					console.log("修改定制", res)
-					wx.showToast({
-						title: res.msg != '成功' ? res.msg : '修改成功',
-						icon: "none"
-					});
-					this.getList()
-					resolve(true)
+			getApp().globalData.customizedProduct = (item, custom) => {
+				return new Promise((resolve) => {
+					wx.showLoading({
+						title: '修改中...',
+					})
+					_Http.basic({
+						"id": 20220924104302,
+						"content": {
+							"sa_shoppingcartid": item.sa_shoppingcartid,
+							"qty": item.qty,
+							...custom
+						},
+					}).then(res => {
+						console.log("修改定制", res)
+						wx.showToast({
+							title: res.msg != '成功' ? res.msg : '修改成功',
+							icon: "none"
+						});
+						this.getList()
+						resolve(true)
+					})
 				})
-			})
+			}
+			return true;
 		},
 		/* 获取列表 */
 		getList() {
@@ -83,6 +85,7 @@ Component({
 							results: [v.sa_shoppingcartid],
 						})
 					}
+					if (v.iscustomsize) v.customText = getCustomText(v);
 					return v
 				});
 				this.setData({

+ 3 - 3
pages/index/collect/index.wxml

@@ -16,12 +16,12 @@
 						<van-checkbox shape='square' disabled="{{sa_brandid && sa_brandid!=item.sa_brandid}}" icon-size='24rpx' value="{{ decide.checked(item.sa_shoppingcartid,results) }}" />
 					</view>
 					<view class="exp">编号:{{item.itemno}}</view>
-					<!-- <view class="exp">规格:{{item.spec ||" --"}}</view> -->
 					<view class="exp">型号:{{item.model ||" --"}}</view>
 					<view class="exp">品牌:{{item.brandname ||" --"}}</view>
 					<view class="exp">领域:{{item.tradefield_shoppingcart ||" --"}}</view>
 					<view class="exp" wx:if="{{item.iscustomsize}}" data-item="{{item}}" catch:tap="customization" style="color:#085CDF;">
-						长:{{item.length}} / 宽:{{item.width}} <van-icon name="arrow-down" />
+						{{item.customText}}
+						<van-icon name="arrow-down" />
 					</view>
 					<view class="price" style="bottom: {{item.iscustomsize?'40rpx':'0rpx'}};">{{handleHide.query(item.showPrice,hidePrice)}}/{{item.unitname}}</view>
 				</view>
@@ -36,7 +36,7 @@
 		<view slot="right" class="cell-right">删 除</view>
 	</van-swipe-cell>
 	<Yl_Empty wx:if="{{list.length === 0}}" />
-	<view style="height: 200px;" />
+	<view style="height: 120px;" />
 </Yl_ListBox>
 <view class="footer-box">
 	<view class="footer">

+ 21 - 68
pages/index/collect/modules/custom.js

@@ -1,4 +1,5 @@
 const _Http = getApp().globalData.http;
+
 Component({
   properties: {
     isOldPrice: {
@@ -11,53 +12,35 @@ Component({
   },
   methods: {
     onClick(item) {
-      console.log(item)
       if (this.data.product != null && item.itemid == this.data.product.itemid) return this.setData({
         show: true
       })
       wx.showLoading({
         title: '获取定制方案中..',
       })
-      Promise.all([{
-        "id": "20230707091603",
-        "version": 1,
-        "content": {
-          "sa_sizecustomizedschemeid": item.lengthschemeid,
-          date: Date.now()
-        }
-      }, {
-        "id": "20230707091603",
-        "version": 1,
-        "content": {
-          "sa_sizecustomizedschemeid": item.widthschemeid,
-          date: Date.now() + 2
-        }
-      }].map(v => _Http.basic(v))).then(s => {
-        console.log("获取定制方案", s)
+      this.selectComponent("#customMade").init(item).then(res => {
         wx.hideLoading();
-        if (s.some(c => c.msg != '成功')) return wx.showToast({
-          title: '定制方案获取失败',
-          icon: "none"
-        })
-        s[0].data.name = '长度'
-        if (!item.length) item.length = s[0].data.type == '可选' ? s[0].data.rowsdetail[0].num : s[0].data.min - 0;
-        console.log("长度id", item.lengthschemeid, '长:' + item.length, '结果:', s[0].data.sa_sizecustomizedschemeid)
-        s[1].data.name = '宽度'
-        if (!item.width) item.width = s[1].data.type == '可选' ? s[1].data.rowsdetail[0].num : s[1].data.min - 0;
-        console.log("宽度id", item.widthschemeid, '宽:' + item.width, '结果:', s[1].data.sa_sizecustomizedschemeid)
-        this.setData({
-          show: true,
-          arr: [s[0].data, s[1].data],
-          product: item
-        });
-      });
-
+        if (res) {
+          this.setData({
+            show: true
+          })
+        } else {
+          wx.showToast({
+            title: '未获取到定制方案',
+            icon: "none"
+          })
+        }
+      })
       this.selectComponent("#Dialog").data.beforeClose = (action) => new Promise((resolve) => {
         if (action === 'confirm') {
-          //getItem(this.data.product, this.data.isOldPrice ? "oldprice" : "")
-          getApp().globalData.customizedProduct(this.data.product).then(res => {
-            resolve(true);
-          })
+          let custom = {
+            length: 0,
+            width: 0
+          };
+          //是否为定制项
+          custom = this.selectComponent("#customMade").getResult(true);
+          if (typeof custom == "boolean") return resolve(false);
+          getApp().globalData.customizedProduct(item, custom).then(res => resolve(true))
         } else {
           resolve(false);
           this.setData({
@@ -65,36 +48,6 @@ Component({
           })
         }
       });
-    },
-    selected(e) {
-      const {
-        name,
-        num
-      } = e.currentTarget.dataset;
-      this.data.product[name] = num;
-      this.setData({
-        product: this.data.product
-      })
-    },
-    /* 定制步进器 */
-    cahngeStepper(e) {
-      const {
-        name,
-        item
-      } = e.currentTarget.dataset,
-        product = this.data.product;
-      if (e.type == 'plus') {
-        product[name] += 1
-      } else if (e.type == 'minus') {
-        product[name] -= 1
-      } else {
-        product[name] = (e.detail.value - 0).toFixed(product.decimalplaces);
-      }
-      if (product[name] > item.max) product[name] = item.max;
-      if (product[name] < item.min) product[name] = item.min;
-      this.setData({
-        product
-      })
     }
   }
 })

+ 2 - 1
pages/index/collect/modules/custom.json

@@ -2,6 +2,7 @@
   "component": true,
   "usingComponents": {
     "van-dialog": "@vant/weapp/dialog/index",
-    "van-stepper": "@vant/weapp/stepper/index"
+    "van-stepper": "@vant/weapp/stepper/index",
+    "customMade": "./customMade/index"
   }
 }

+ 11 - 39
pages/index/collect/modules/custom.scss

@@ -1,44 +1,16 @@
-.box {
-	width: 100%;
-	padding: 0 30rpx 20rpx;
-	box-sizing: border-box;
+.external-custom-stepper-box {
+	display: block !important;
+}
 
-	.item {
-		display: flex;
-		margin-top: 20rpx;
+.external-explain {
+	margin: 10rpx 0 !important;
+}
 
-		.label {
-			font-weight: 700;
-		}
+.external-custom-option {
+	font-size: 24rpx;
+}
 
-		.selectable {
-			display: flex;
-			flex-wrap: wrap;
 
-			.num {
-				border: 1px solid #ddd;
-				margin-right: 8rpx;
-				padding: 4rpx 15rpx;
-				border-radius: 8rpx;
-				font-size: 26rpx;
-				margin-bottom: 10rpx;
-			}
-
-			.active {
-				border: 1px solid #085CDF;
-				color: #085CDF;
-				font-weight: 700;
-			}
-		}
-
-		.stepper {
-
-			.explain {
-				font-size: 24rpx;
-				color: #999;
-				margin-top: 6rpx;
-			}
-		}
-
-	}
+.external-active {
+	color: #085CDF;
 }

+ 2 - 15
pages/index/collect/modules/custom.wxml

@@ -1,18 +1,5 @@
 <van-dialog id="Dialog" use-slot title="定制" show="{{ show }}" asyncClose confirm-button-color='#085CDF' show-cancel-button>
-	<view class="box">
-		<view class="item" wx:for="{{arr}}" wx:key="name">
-			<view class="label">
-				{{item.name}}:
-			</view>
-			<view class="selectable" wx:if="{{item.type=='可选'}}">
-				<view class="num {{product[item.name=='宽度'?'width':'length']==it.num?'active':''}}" wx:for="{{item.rowsdetail}}" wx:for-item='it' wx:for-index='i' wx:key="rowno" data-name="{{item.name=='宽度'?'width':'length'}}" data-num="{{it.num}}" catch:tap='selected'>
-					{{it.num}}
-				</view>
-			</view>
-			<view class="stepper" wx:else>
-				<van-stepper value="{{ product[ item.name=='宽度'?'width':'length'] }}" input-width="60px" min="{{item.min}}" max="{{item.max}}" decimal-length="{{ item.decimalplaces }}" data-item="{{item}}" data-name="{{ item.name=='宽度'?'width':'length' }}" bind:plus='cahngeStepper' bind:blur='cahngeStepper' bind:minus='cahngeStepper' />
-				<view class="explain">{{item.min+'mm ~ '+ item.max}}mm,<text wx:if="{{item.decimalplaces}}">保留{{item.decimalplaces}}位小数</text><text wx:else>不保留小数</text></view>
-			</view>
-		</view>
+	<view style="padding: 20rpx;box-sizing: border-box;">
+		<customMade id="customMade" external-custom-stepper-box='external-custom-stepper-box' external-explain='external-explain' external-active='external-active' external-custom-option='external-custom-option' />
 	</view>
 </van-dialog>

+ 11 - 11
packageA/market/customMade/index.js → pages/index/collect/modules/customMade/index.js

@@ -1,6 +1,6 @@
 import {
   getCustomItems
-} from "../../../utils/customItemType";
+} from "../../../../../utils/customItemType";
 
 Component({
   properties: {
@@ -15,19 +15,21 @@ Component({
   options: {
     multipleSlots: true
   },
-  externalClasses: ["external-custom-box", "external-custom-label"],
+  externalClasses: ["external-custom-box", "external-custom-label", "external-custom-stepper-box", "external-explain", "external-active", "external-custom-option"],
   data: {
     list: []
   },
   methods: {
     init(data) {
-      getCustomItems(data).then(list => {
-        this.setData({
-          list
-        })
-        this.getResult();
-        console.log(this.data.list)
-      })
+      return new Promise((resolve) => {
+        getCustomItems(data).then(list => {
+          this.setData({
+            list
+          });
+          this.getResult();
+          resolve(list.length);
+        });
+      });
     },
     onOption(e) {
       const {
@@ -43,7 +45,6 @@ Component({
     getResult(isSubmit) {
       let obj = {};
       let breakOff = false;
-
       this.data.list.filter(v => {
         if (breakOff) return;
         if (v.type == '自定义') {
@@ -59,7 +60,6 @@ Component({
           breakOff = true;
         }
       })
-      console.log("result", obj)
       this.triggerEvent("onChange", breakOff ? false : obj)
       return breakOff ? false : obj
     },

+ 0 - 0
packageA/market/customMade/index.json → pages/index/collect/modules/customMade/index.json


+ 5 - 0
packageA/market/customMade/index.scss → pages/index/collect/modules/customMade/index.scss

@@ -27,6 +27,11 @@
 		background: #E7EEFF !important;
 	}
 
+	.stepper-box {
+		display: flex;
+		align-items: center;
+	}
+
 	.explain {
 		font-size: 22rpx;
 		color: #333;

+ 3 - 5
packageA/market/customMade/index.wxml → pages/index/collect/modules/customMade/index.wxml

@@ -8,14 +8,12 @@
 	</view>
 	<!-- 可选项 -->
 	<block wx:if="{{item.type=='可选'}}">
-		<navigator url="#" class="custom-option {{it.num == item.value?'active':''}}" data-value="{{it.num}}" data-index="{{index}}" wx:for="{{item.rowsdetail}}" wx:for-item="it" wx:for-index="i" wx:key="sa_sizeschemedetailid" bindtap="onOption">
+		<navigator url="#" class="custom-option {{it.num == item.value?'active external-active':''}} external-custom-option" data-value="{{it.num}}" data-index="{{index}}" wx:for="{{item.rowsdetail}}" wx:for-item="it" wx:for-index="i" wx:key="sa_sizeschemedetailid" bindtap="onOption">
 			{{it.num}}
 		</navigator>
 	</block>
-
-	<view style="display: flex; align-items: center;" wx:elif="{{item.type=='自定义'}}">
+	<view class="stepper-box external-custom-stepper-box" wx:elif="{{item.type=='自定义'}}">
 		<van-stepper value="{{item.value||0}}" data-item="{{item}}" data-index="{{index}}" input-width="60px" min="{{item.min}}" max="{{item.max}}" decimal-length="{{ item.decimalplaces }}" bind:plus='changeStepper' bind:blur='changeStepper' bind:minus='changeStepper' />
-		<view class="explain">{{item.min+'mm ~ '+ item.max}}mm,<text wx:if="{{item.decimalplaces}}">保留{{item.decimalplaces}}位小数</text><text wx:else>不保留小数</text></view>
+		<view class="explain external-explain">{{item.min+'mm ~ '+ item.max}}mm,<text wx:if="{{item.decimalplaces}}">保留{{item.decimalplaces}}位小数</text><text wx:else>不保留小数</text></view>
 	</view>
-
 </view>

+ 7 - 0
project.private.config.json

@@ -78,6 +78,13 @@
           "query": "",
           "launchMode": "default",
           "scene": null
+        },
+        {
+          "name": "商品详情",
+          "pathName": "packageA/market/detail",
+          "query": "params=%7B%22sa_itemgroupid%22%3A6009%2C%22sa_brandid%22%3A47%7D",
+          "launchMode": "default",
+          "scene": null
         }
       ]
     }

+ 20 - 12
select/product/index.js

@@ -1,6 +1,12 @@
 const _Http = getApp().globalData.http,
 	file = require("../../utils/FormatTheAttachment");
 import currency from "../../utils/currency";
+
+import {
+	getCustomText
+} from "../../utils/customItemType";
+
+
 Page({
 	data: {
 		hidePrice: wx.getStorageSync('hidePrice'),
@@ -29,19 +35,20 @@ Page({
 			newPrice: options.newprice || "price", //红色价格
 		});
 		this.getList();
-		getApp().globalData.customizedProduct = this.customizedProduct.bind(this);
-	},
-	customizedProduct(item) {
-		return new Promise((resolve) => {
-			let index = this.data.list.findIndex(v => v[this.data.idname] == item[this.data.idname]);
-			if (index != -1) this.data.list[index] = item;
-			if (item.pitchOn) this.data.result.push(item[this.data.idname])
-			this.setData({
-				list: this.data.list,
-				result: this.data.result
+		getApp().globalData.customizedProduct = (item, custom) => {
+			return new Promise((resolve) => {
+				item = Object.assign(item, custom)
+				item.customText = getCustomText(item);
+				let index = this.data.list.findIndex(v => v[this.data.idname] == item[this.data.idname]);
+				if (index != -1) this.data.list[index] = item;
+				if (item.pitchOn) this.data.result.push(item[this.data.idname])
+				this.setData({
+					list: this.data.list,
+					result: this.data.result
+				})
+				resolve(true)
 			})
-			resolve(true)
-		})
+		}
 	},
 	getList(init = false) {
 		//init 用于初始化分页
@@ -74,6 +81,7 @@ Page({
 				value.qty = value.orderminqty;
 				value.width = 0;
 				value.length = 0;
+				if (value.iscustomsize) value.customText = getCustomText(value);
 				return value;
 			})
 			this.setData({

+ 1 - 1
select/product/index.wxml

@@ -34,7 +34,7 @@
                     规格:{{item.standards||' --'}}
                 </view>
                 <view wx:if="{{item.iscustomsize}}" class="subfield line-1" data-item="{{item}}" catch:tap="customization" style="color:#085CDF;">
-                    长:{{item.length}} / 宽:{{item.width}}
+                    {{item.customText}}
                     <van-icon name="arrow-down" />
                 </view>
                 <view class="price line-1">

+ 1 - 0
utils/Http.js

@@ -6,6 +6,7 @@ class HTTP {
 		} else {
 			// this.baseUrl = "https://lsa.cnyunl.com";
 			this.baseUrl = "http://61.164.207.46:8300";
+			// this.baseUrl = "http://61.164.207.46:8200";
 		}
 		console.log("接口地址:", this.baseUrl)
 	}

+ 14 - 3
utils/customItemType.js

@@ -1,5 +1,3 @@
-const _Http = getApp().globalData.http;
-
 function getLabelList() {
 	let siteCustomLabel = {
 		"default": {
@@ -25,6 +23,7 @@ function getLabelList() {
 }
 
 function getCustomItems(data) {
+	const _Http = getApp().globalData.http;
 	let labelList = getLabelList(),
 		httpList = [];
 	for (const key in labelList) {
@@ -33,6 +32,7 @@ function getCustomItems(data) {
 			sa_sizecustomizedschemeid: data[name],
 			date: Date.now() + 1,
 			label: labelList[key],
+			value: data[key] || "",
 			key: key,
 			name
 		})
@@ -51,7 +51,18 @@ function getCustomItems(data) {
 	})
 }
 
+function getCustomText(data) {
+	let labelList = getLabelList(),
+		customText = [];
+	for (const key in labelList) {
+		const name = key + 'schemeid';
+		if (data[name]) customText.push(`${labelList[key]}:${data[key]||'定制'}`)
+	};
+	return customText
+}
+
 module.exports = {
 	getLabelList,
-	getCustomItems
+	getCustomItems,
+	getCustomText
 }