diff --git a/config.js b/config.js index b5a321e..4a54287 100644 --- a/config.js +++ b/config.js @@ -3,11 +3,11 @@ export const appConfig = { //appId:"wx3dc65ce9b588727a",//孕育咨询 // baseUrl: 'http://yunyubang.localhost.com', - baseUrl:'https://yunyubang.ali251.langye.net',// 'https://yunyubang2021.langye.net', //孕育邦 - // baseUrl: 'https://yybtest.ali251.langye.net', + // baseUrl:'https://yunyubang.ali251.langye.net',// 'https://yunyubang2021.langye.net', //孕育邦 + baseUrl: 'https://yybtest.ali251.langye.net', - newBaseUrl: 'https://yunyubang.ali251.langye.net', - // newBaseUrl: 'http://yybtest.ali251.langye.net', + // newBaseUrl: 'https://yunyubang.ali251.langye.net', + newBaseUrl: 'http://yybtest.ali251.langye.net', //baseUrl:'https://yybtest2021.langye.net',//孕育咨询 openidInfoKey: 'openid_info_yunyubang' diff --git a/packages/packageBuy/pages/shopDetail/shopDetail.vue b/packages/packageBuy/pages/shopDetail/shopDetail.vue index 206ee0d..6e61b9f 100644 --- a/packages/packageBuy/pages/shopDetail/shopDetail.vue +++ b/packages/packageBuy/pages/shopDetail/shopDetail.vue @@ -127,7 +127,8 @@ 请输入您的联系方式 - + + 宝妈姓名* @@ -143,6 +144,14 @@ {{form.due_date}} + + + 产品型号* + + + {{modelList[mindex]}} + + 所属区域* @@ -151,7 +160,7 @@ {{arrRegion[rindex]}} - * + * @@ -251,7 +260,9 @@ info: {}, viewCounts:'', dataList: [], - buyName:'', + buyName:'', + mindex:0, + modelList:['请选择产品型号'], form: { product_type: "product", product_id: "", @@ -259,7 +270,8 @@ phone: '', member_name: "", member_comment: "", - promotion: "", + promotion: "", + model_name:'', region: '', address: '', hospital: '' @@ -498,6 +510,10 @@ }) }) } + }, + bindModelChange:function(e) { + this.mindex = e.target.value; + this.form.model_name = this.modelList[e.target.value]; }, bindRegionChange: function(e) { this.rindex = e.target.value; @@ -796,13 +812,16 @@ return false; } - + if (this.modelList.length>1 && (this.form.model_name == "请选择产品型号" || weixin.isNull(this.form.model_name))) { + this.alert('请选择产品型号') + return + } if (this.form.region == "请选择区域" || weixin.isNull(this.form.region)) { this.alert('请选择区域') return } if(this.info.product_type.name==='实物' && weixin.isNull(this.form.address)){ - this.alert('实物商品请填写具体地址') + this.alert('请填写具体地址') return } if (this.form.hospital == "请选择建卡医院") { @@ -913,7 +932,15 @@ that.info = r.data; that.info.poster = (weixin.isNull(that.info.poster) ? "../../static/750x500.jpg" : that.info.poster_url) - that.buyName = that.info.state=='active'?'立即购买':'已下架' + that.buyName = that.info.state=='active'?'立即购买':'已下架' + + let _marr = r.data.model?JSON.parse(r.data.model):[] + if(_marr.length>0){ + _marr.map(item=>{ + that.modelList.push(item.name) + }) + + } }, utilFail: r => { console.log(r); diff --git a/pages/active/detail.vue b/pages/active/detail.vue index 9b2bef2..fc0e563 100644 --- a/pages/active/detail.vue +++ b/pages/active/detail.vue @@ -290,69 +290,91 @@ {{isOrderText}} - + + - - 请输入您的联系方式 - - - 姓名* - - - - 手机号码* - - - - 性别* - - - - - - - - 宝宝生日/预产期* - - - {{form.budget_date}} - - - - - - 所属区域* - - - {{arrRegion[rindex]}} - - - - - - 地址 - - - - 建卡医院* - - - {{arrHospital[hindex]}} - - - - - - + + + 请输入您的联系方式 + + + + + {{item.name}}* + + + + {{item.list[fields_value[index].index].value}} + + + + + + + + + + + + 姓名* + + + + 手机号码* + + + + 性别* + + + + + + + + 宝宝生日/预产期* + + + {{form.budget_date}} + + + + + + 所属区域* + + + {{arrRegion[rindex]}} + + + + + + 地址 + + + + 建卡医院* + + + {{arrHospital[hindex]}} + + + + + + + + 备注信息 @@ -436,7 +458,9 @@ showPass: false, info: {}, viewCounts: '', - dataList: [], + dataList: [], + fields:[], + fields_value:[], form: { merchant_id: "", member_id: "", @@ -447,7 +471,8 @@ phone: "", budget_date: '', address: '', - spread_member_id: '' + spread_member_id: '', + field_value:[] }, arrHospital: ["请选择建卡医院", "市立医院", "苏大附一院", "苏大附二院", "附二浒关院区", "中医院", "第五人民医院", "苏州市第七人民医院", "明基医院", "九龙医院", @@ -1015,53 +1040,74 @@ if (!this.isOrder) { return + } + this.showPop = true; + // 自定义提交字段 + if(this.fields && this.fields.length>0){ + let count = 0 + this.fields_value.map(item=>{ + if(item.is_reqired==='是' && weixin.isNull(item.value)){ + this.alert(`${item.name}必填`) + count++ + } + }) + + + if(count>0){ + return + }else{ + this.form.field_value = this.fields_value + console.log('this.form',this.form) + } + // return + }else{ + let user_info = weixin.getUserInfoCache(); + + if (weixin.isNull(user_info.user_info.phone)) { + this.showPhone = true; + return false; + //this.getUserProfile(); + } + + if (weixin.isNull(this.form.name) || weixin.isNull(this.form.budget_date) || + weixin.isNull(this.form.phone) || weixin.isNull(this.form.sex) || + weixin.isNull(this.form.area) || weixin.isNull(this.form.hospital)) { + + if (weixin.isNull(this.form.name) || this.form.name == '微信用户') { + this.alert('请输入真实会员姓名') + return + } + if (weixin.isNull(this.form.sex)) { + this.alert('请选择性别') + return + } + if (weixin.isNull(this.form.budget_date)) { + this.alert('请选择预产日期') + return + } + if (weixin.isNull(this.form.area) || this.form.area == '请选择区域') { + this.alert('请选择区域') + return + } + if (weixin.isNull(this.form.hospital) || this.form.hospital == '请选择建卡医院') { + this.alert('请选择建卡医院') + return + } + + + if (weixin.isNull(this.form.phone)) { + this.alert('请填写手机号') + return + } + // if (weixin.isNull(this.form.address)) { + // this.alert('请填写地址') + // return + // } + + return false; + } } - - let user_info = weixin.getUserInfoCache(); - - if (weixin.isNull(user_info.user_info.phone)) { - this.showPhone = true; - return false; - //this.getUserProfile(); - } - - if (weixin.isNull(this.form.name) || weixin.isNull(this.form.budget_date) || - weixin.isNull(this.form.phone) || weixin.isNull(this.form.sex) || - weixin.isNull(this.form.area) || weixin.isNull(this.form.hospital)) { - this.showPop = true; - if (weixin.isNull(this.form.name) || this.form.name == '微信用户') { - this.alert('请输入真实会员姓名') - return - } - if (weixin.isNull(this.form.sex)) { - this.alert('请选择性别') - return - } - if (weixin.isNull(this.form.budget_date)) { - this.alert('请选择预产日期') - return - } - if (weixin.isNull(this.form.area) || this.form.area == '请选择区域') { - this.alert('请选择区域') - return - } - if (weixin.isNull(this.form.hospital) || this.form.hospital == '请选择建卡医院') { - this.alert('请选择建卡医院') - return - } - - - if (weixin.isNull(this.form.phone)) { - this.alert('请填写手机号') - return - } - // if (weixin.isNull(this.form.address)) { - // this.alert('请填写地址') - // return - // } - - return false; - } + console.log("this.form",this.form) // 此处用法为在js中调用,需要写uni.$u.throttle() uni.$u.throttle(this.joinActive, 1000); @@ -1110,6 +1156,36 @@ uni.navigateTo({ url: "../shopDetail/shopDetail?id=" + id }) + }, + async getParaList(id) { + let arr = [] + await weixin.request({ + newUrl: true, + api: '/api/member/parameter/show', + data: { + id: id + }, + utilSuccess: (res) => { + console.log("res----",res) + res.detail.map(item => { + arr.push(item.value) + }) + + } + }) + return arr + }, + changeList(e){ + console.log(e) + console.log("this.fields_value",this.fields_value) + var id = e.target.id + var index = e.detail.value + this.fields.map((item,index1)=>{ + if(item.filed==id){ + this.fields_value[index1].index = index + this.fields_value[index1].value = item.list[index].value + } + }) }, loadInfo: function() { let that = this @@ -1125,11 +1201,45 @@ if (r.company_ids) { r.companyList = JSON.parse(r.company_ids) } - this.info = r; + this.info = r; + // 自定义提交字段处理 + this.fields = r.fields? JSON.parse(r.fields):[] + if(this.fields.length>0){ + this.fields.map(item=>{ + this.fields_value.push({ + name:item.name, + field:item.filed, + value:'', + index:-1, + is_reqired:item.is_reqired + }) + if(item.data_id){ + let arr = [] + weixin.request({ + newUrl: true, + api: '/api/member/parameter/show', + data: { + id: item.data_id + }, + utilSuccess: (res) => { + console.log("res----",res) + // res.detail.map(item1 => { + // arr.push(item1.value) + // }) + item.list = res.detail + } + }) + + } + }) + console.log("this.fields",this.fields) + } + let apply_end = r.apply_end let apply_start = r.apply_start let enddate = r.end_date + " " + r.end_time - let nowtime = that.getNowTime() + let nowtime = that.getNowTime() + if (r.audit_status == 2) { that.isOrder = false that.isOrderText = "不可报名"