|
|
@@ -33,7 +33,7 @@ Page({
|
|
|
multiArray: [], //picker数据
|
|
|
value: [0, 0, 0],
|
|
|
text: "",
|
|
|
-
|
|
|
+ dictList:[],
|
|
|
isPickerRender: false,
|
|
|
isPickerShow: false,
|
|
|
pickerConfig: {
|
|
|
@@ -71,8 +71,10 @@ Page({
|
|
|
this.setData({
|
|
|
storeId: options.storeId
|
|
|
})
|
|
|
- this.getChildListByMtLei()
|
|
|
- this.bindStore()
|
|
|
+ this.getChildListByMtLei();
|
|
|
+ this.getDictByCode();
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -220,28 +222,34 @@ Page({
|
|
|
this.setData({
|
|
|
region: e.detail.value
|
|
|
})
|
|
|
- this.data.storeInfo.storeArea = this.data.region.join("")
|
|
|
+ this.data.storeInfo.storeArea = this.data.region.join(" ")
|
|
|
},
|
|
|
bindStore(){
|
|
|
var that = this
|
|
|
util.request(util.api.queryByStoreId, {id:that.data.storeId}, "GET", false, true,app.globalData.token).then((res)=>{
|
|
|
if (res.code == 200) {
|
|
|
|
|
|
- var oneTypeData = that.data.selectList.filter((e)=>e.id == res.result.oneType );
|
|
|
- if(oneTypeData!=null&&oneTypeData.length>0){
|
|
|
- var twoTypeData = oneTypeData[0].children.filter((e)=>e.id == res.result.twoType );
|
|
|
- this.setData({
|
|
|
- text: oneTypeData[0].name + " " + twoTypeData[0].name ,
|
|
|
- })
|
|
|
- }
|
|
|
+ var oneTypeData = that.data.selectList.filter((e)=>e.id == res.result.oneType );
|
|
|
+ if(oneTypeData!=null&&oneTypeData.length>0){
|
|
|
+ var twoTypeData = oneTypeData[0].children.filter((e)=>e.id == res.result.twoType );
|
|
|
+ this.setData({
|
|
|
+ text: oneTypeData[0].name + " " + twoTypeData[0].name ,
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
- console.log(66666)
|
|
|
|
|
|
that.setData({
|
|
|
storeInfo: res.result,
|
|
|
dataStr: res.result.businessBegin +" ~ "+ res.result.businessEnd,
|
|
|
- region: (res.result.storeArea).split(" ")
|
|
|
+ region: res.result.storeArea?(res.result.storeArea).split(" "):[]
|
|
|
})
|
|
|
+ var peisongTypeData = that.data.dictList.filter((e)=>e.value == res.result.peisongType );
|
|
|
+ if(peisongTypeData !=null && peisongTypeData.length>0){
|
|
|
+ that.setData({
|
|
|
+ ['storeInfo.peisongTypeName']:peisongTypeData[0].text,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
console.log("========================")
|
|
|
console.log(storeInfo)
|
|
|
}
|
|
|
@@ -325,5 +333,27 @@ Page({
|
|
|
util.toast("获取不到美团品类")
|
|
|
}
|
|
|
}).catch((res) => {})
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+ //配送类型
|
|
|
+ getDictByCode() {
|
|
|
+ var that = this
|
|
|
+ util.request(util.api.getDictByCode, {code:"peisong_type"}, "GET", false, true,app.globalData.token).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ that.setData({
|
|
|
+ dictList: res.result
|
|
|
+ })
|
|
|
+ this.bindStore();
|
|
|
+ }
|
|
|
+ }).catch((res) => {})
|
|
|
+
|
|
|
+ },
|
|
|
+ //选配送类型
|
|
|
+ bindDictPickerChange: function (e) {
|
|
|
+ var item = this.data.dictList[e.detail.value]
|
|
|
+ this.setData({
|
|
|
+ ['storeInfo.peisongType']: item.value,
|
|
|
+ ['storeInfo.peisongTypeName']: item.text
|
|
|
+ })
|
|
|
+ },
|
|
|
})
|