12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6f441c61"],{2381:function(t,e,n){},"2f21":function(t,e,n){"use strict";var i=n("79e5");t.exports=function(t,e){return!!t&&i(function(){e?t.call(null,function(){},1):t.call(null)})}},3846:function(t,e,n){n("9e1e")&&"g"!=/./g.flags&&n("86cc").f(RegExp.prototype,"flags",{configurable:!0,get:n("0bfb")})},"41ee":function(t,e,n){},"55dd":function(t,e,n){"use strict";var i=n("5ca1"),s=n("d8e8"),o=n("4bf8"),a=n("79e5"),r=[].sort,c=[1,2,3];i(i.P+i.F*(a(function(){c.sort(void 0)})||!a(function(){c.sort(null)})||!n("2f21")(r)),"Array",{sort:function(t){return void 0===t?r.call(o(this)):r.call(o(this),s(t))}})},"5f5f":function(t,e,n){"use strict";n("68ef"),n("a526")},"66b9":function(t,e,n){"use strict";n("68ef")},"6b54":function(t,e,n){"use strict";n("3846");var i=n("cb7c"),s=n("0bfb"),o=n("9e1e"),a="toString",r=/./[a],c=function(t){n("2aba")(RegExp.prototype,a,t,!0)};n("79e5")(function(){return"/a/b"!=r.call({source:"a",flags:"b"})})?c(function(){var t=i(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?s.call(t):void 0)}):r.name!=a&&c(function(){return r.call(this)})},"6d80":function(t,e,n){"use strict";n.r(e);var i,s=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"card"},[t._m(0),n("p",[t._v("希望对方的性别是")]),n("van-radio-group",{model:{value:t.radio,callback:function(e){t.radio=e},expression:"radio"}},[n("van-radio",{staticStyle:{float:"left","margin-right":"20px"},attrs:{name:"0","checked-color":"#fd6740"}},[t._v("男")]),n("van-radio",{attrs:{name:"1","checked-color":"#fd6740"}},[t._v("女")])],1),n("p",[t._v("礼物名称")]),n("van-field",{attrs:{placeholder:"给你的礼物起个名字吧",error:t.pnError,required:"",maxlength:"10"},on:{click:function(e){t.pnError=!1}},model:{value:t.presentName,callback:function(e){t.presentName=e},expression:"presentName"}}),n("p",[t._v("我的礼物丨走心介绍")]),n("van-cell-group",[n("van-field",{attrs:{type:"textarea",placeholder:"请在此输入你的礼物介绍和礼物故事",rows:"5",autosize:"",error:t.descError,required:"",maxlength:"300"},on:{click:function(e){t.descError=!1}},model:{value:t.desc,callback:function(e){t.desc=e},expression:"desc"}})],1),n("p",[t._v("礼物标签")]),n("div",{staticStyle:{"margin-bottom":"20px"}},[n("van-checkbox-group",{model:{value:t.result,callback:function(e){t.result=e},expression:"result"}},t._l(t.tags,function(e,i){return n("van-checkbox",{key:i,style:(i+1)%4===0?t.br:t.nobr,attrs:{name:i}},[t._v(t._s(e))])}))],1)],1),n("div",{staticClass:"card"},[n("p",[t._v("上传礼物照片")]),n("add-photo",{on:{uploadPhoto:t.onReadPhoto}})],1),n("van-button",{attrs:{size:"large",type:"primary"},on:{click:t.publishPresent}},[t._v("下一步")])],1)},o=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("h3",[n("strong",[t._v("礼物匹配")])])}],a=(n("6b54"),n("ac6a"),n("55dd"),n("e7e5"),n("d399")),r=n("ade3"),c=(n("66b9"),n("b650")),l=(n("5f5f"),n("f253")),u=(n("68ef"),n("2381"),n("fe7e")),h=n("f331"),d=Object(u["a"])({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b()},[n("div",{class:[t.b("icon",[t.shape,{disabled:t.isDisabled,checked:t.checked}])],on:{click:t.toggle}},[t._t("icon",[n("icon",{style:t.iconStyle,attrs:{name:"success"}})],{checked:t.checked})],2),t.$slots.default?n("span",{class:t.b("label",t.labelPosition),on:{click:function(e){t.toggle("label")}}},[t._t("default")],2):t._e()])},name:"checkbox",mixins:[h["a"]],props:{name:null,value:null,disabled:Boolean,checkedColor:String,labelPosition:String,labelDisabled:Boolean,shape:{type:String,default:"round"}},computed:{checked:{get:function(){return this.parent?-1!==this.parent.value.indexOf(this.name):this.value},set:function(t){this.parent?this.setParentValue(t):this.$emit("input",t)}},isDisabled:function(){return this.parent&&this.parent.disabled||this.disabled},iconStyle:function(){var t=this.checkedColor;if(t&&this.checked&&!this.isDisabled)return{borderColor:t,backgroundColor:t}}},watch:{value:function(t){this.$emit("change",t)}},created:function(){this.findParent("van-checkbox-group")},methods:{toggle:function(t){this.isDisabled||"label"===t&&this.labelDisabled||(this.checked=!this.checked)},setParentValue:function(t){var e=this.parent,n=e.value.slice();if(t){if(e.max&&n.length>=e.max)return;-1===n.indexOf(this.name)&&(n.push(this.name),e.$emit("input",n))}else{var i=n.indexOf(this.name);-1!==i&&(n.splice(i,1),e.$emit("input",n))}}}}),f=Object(u["a"])({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b()},[t._t("default")],2)},name:"checkbox-group",props:{max:Number,value:Array,disabled:Boolean},watch:{value:function(t){this.$emit("change",t)}}}),m=(n("4ddd"),n("9f14")),p=(n("a44c"),n("e27c")),g=(n("be7f"),n("565f")),b=(n("0653"),n("34e9")),v=(n("c3a6"),n("ad06")),x=(n("7f7f"),n("e930"),n("8f80")),y=n("6ef9"),k=n("1901"),_={name:"PresentRegister",components:(i={AddPhoto:k["a"]},Object(r["a"])(i,x["a"].name,x["a"]),Object(r["a"])(i,v["a"].name,v["a"]),Object(r["a"])(i,b["a"].name,b["a"]),Object(r["a"])(i,g["a"].name,g["a"]),Object(r["a"])(i,p["a"].name,p["a"]),Object(r["a"])(i,m["a"].name,m["a"]),Object(r["a"])(i,f.name,f),Object(r["a"])(i,d.name,d),Object(r["a"])(i,l["a"].name,l["a"]),Object(r["a"])(i,c["a"].name,c["a"]),i),data:function(){return{radio:"0",presentId:"",presentName:"",pnError:!1,desc:"",descError:!1,tags:["情怀","复古","有趣","学霸","实用","同年","吃货","佛系","土味","活力","洋气","精致","轻奢","其它"],result:[],photo:null,nobr:"float: left; margin-right: 5px",br:""}},methods:{publishPresent:function(){if(0!==this.presentName.length){if(this.desc.length<=15)return this.descError=!0,void a["a"].fail("请输入至少15个字的礼物介绍");if(null!==this.photo){var t=localStorage.getItem("frontend-userid"),e="";this.result=this.result.sort(function(t,e){return t>e?1:t<e?-1:0}),console.log(this.result);var n=0;for(this.result.forEach(function(t){for(n;n<t;n++)e+="0";e+="1",n++}),n;n<14;n++)e+="0";e+=this.radio,console.log(e),e=parseInt(e,2),console.log(e),console.log(this.photo);var i=[{goodid:this.presentId,name:this.presentName,goodsNo:"A2",modelId:"1",ownerId:t.toString(),goodFirstKind:e.toString(),goodSecondKind:"2000",sellPrice:"0.0",marketPrice:"0.0",costPrice:"0.0",upTime:I(),downTime:I(),createTime:I(),storeNums:"1",img:this.photo.file.name,isDel:"0",content:"none",keywords:"none",description:this.desc,searchWords:"",weight:"0.4",point:"4",unit:"10",brandId:"1",visit:"1",favorite:"1",sort:"1",listImg:"xx.jpg",smallImg:"xx.jpg",specArray:"{}",exp:"0"}];console.log(i);var s=this,o="updateBatch";""===this.presentId&&(o="saveBatch"),y["a"].get_data("smartGoods/"+o,function(t){console.log("------ Data Rcvd in PresentReg --------"),console.log(t),"10000"===t.ret?s.$router.push("index"):a["a"].fail("上传失败,请检查网络")},i)}else a["a"].fail("请上传礼物照片")}else this.pnError=!0},onReadPhoto:function(t){this.photo=t}},created:function(){if(this.$route.query.present){var t=this.$route.query.present;console.log(t),this.presentId=t.id,this.radio=t.gender.toString(),this.presentName=t.presentName,this.desc=t.presentDesc;for(var e=t.tags,n=13,i=e.length-1;i>=0;i--)"1"===e.charAt(i)&&this.result.push(n),n--}}};function I(){var t=new Date,e="-",n=t.getFullYear(),i=t.getMonth()+1,s=t.getDate(),o=t.getHours(),a=t.getMinutes(),r=t.getSeconds();i>=1&&i<=9&&(i="0"+i),s>=0&&s<=9&&(s="0"+s),o>=0&&o<=9&&(o="0"+o),a>=0&&a<=9&&(a="0"+a),r>=0&&r<=9&&(r="0"+r);var c=n+e+i+e+s;return c=c+" "+o+":"+a+":"+r,c}var C=_,O=(n("8e4c"),n("2877")),S=Object(O["a"])(C,s,o,!1,null,"3f0b060a",null);S.options.__file="PresentRegister.vue";e["default"]=S.exports},"8e4c":function(t,e,n){"use strict";var i=n("41ee"),s=n.n(i);s.a},a526:function(t,e,n){},b650:function(t,e,n){"use strict";var i=n("fe7e");e["a"]=Object(i["a"])({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n(t.tag,{tag:"component",class:t.b([t.type,t.size,{block:t.block,plain:t.plain,round:t.round,square:t.square,loading:t.loading,disabled:t.disabled,unclickable:t.disabled||t.loading,"bottom-action":t.bottomAction}]),attrs:{type:t.nativeType,disabled:t.disabled},on:{click:t.onClick}},[t.loading?n("loading",{attrs:{size:"20px",color:"default"===t.type?void 0:""}}):n("span",{class:t.b("text")},[t._t("default",[t._v(t._s(t.text))])],2)],1)},name:"button",props:{text:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,disabled:Boolean,nativeType:String,bottomAction:Boolean,tag:{type:String,default:"button"},type:{type:String,default:"default"},size:{type:String,default:"normal"}},methods:{onClick:function(t){this.loading||this.disabled||this.$emit("click",t)}}})},f253:function(t,e,n){"use strict";var i=n("fe7e"),s=n("1128");function o(t){return Array.isArray(t)?t.map(function(t){return o(t)}):"object"===typeof t?Object(s["a"])({},t):t}var a=n("a142"),r=200,c=Object(i["a"])({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:[t.b(),t.className],style:t.columnStyle,on:{touchstart:t.onTouchStart,touchmove:function(e){return e.preventDefault(),t.onTouchMove(e)},touchend:t.onTouchEnd,touchcancel:t.onTouchEnd}},[n("ul",{style:t.wrapperStyle},t._l(t.options,function(e,i){return n("li",{staticClass:"van-ellipsis",class:t.b("item",{disabled:t.isDisabled(e),selected:i===t.currentIndex}),style:t.optionStyle,domProps:{innerHTML:t._s(t.getOptionText(e))},on:{click:function(e){t.setIndex(i,!0)}}})}))])},name:"picker-column",props:{valueKey:String,className:String,itemHeight:Number,defaultIndex:Number,initialOptions:Array,visibleItemCount:Number},data:function(){return{startY:0,offset:0,duration:0,startOffset:0,options:o(this.initialOptions),currentIndex:this.defaultIndex}},created:function(){this.$parent.children&&this.$parent.children.push(this),this.setIndex(this.currentIndex)},destroyed:function(){var t=this.$parent.children;t&&t.splice(t.indexOf(this),1)},watch:{defaultIndex:function(){this.setIndex(this.defaultIndex)}},computed:{count:function(){return this.options.length},baseOffset:function(){return this.itemHeight*(this.visibleItemCount-1)/2},columnStyle:function(){return{height:this.itemHeight*this.visibleItemCount+"px"}},wrapperStyle:function(){return{transition:this.duration+"ms",transform:"translate3d(0, "+(this.offset+this.baseOffset)+"px, 0)",lineHeight:this.itemHeight+"px"}},optionStyle:function(){return{height:this.itemHeight+"px"}}},methods:{onTouchStart:function(t){this.startY=t.touches[0].clientY,this.startOffset=this.offset,this.duration=0},onTouchMove:function(t){var e=t.touches[0].clientY-this.startY;this.offset=Object(a["f"])(this.startOffset+e,-this.count*this.itemHeight,this.itemHeight)},onTouchEnd:function(){if(this.offset!==this.startOffset){this.duration=r;var t=Object(a["f"])(Math.round(-this.offset/this.itemHeight),0,this.count-1);this.setIndex(t,!0)}},adjustIndex:function(t){t=Object(a["f"])(t,0,this.count);for(var e=t;e<this.count;e++)if(!this.isDisabled(this.options[e]))return e;for(var n=t-1;n>=0;n--)if(!this.isDisabled(this.options[n]))return n},isDisabled:function(t){return Object(a["d"])(t)&&t.disabled},getOptionText:function(t){return Object(a["d"])(t)&&this.valueKey in t?t[this.valueKey]:t},setIndex:function(t,e){t=this.adjustIndex(t)||0,this.offset=-t*this.itemHeight,t!==this.currentIndex&&(this.currentIndex=t,e&&this.$emit("change",t))},setValue:function(t){for(var e=this.options,n=0;n<e.length;n++)if(this.getOptionText(e[n])===t)return this.setIndex(n)},getValue:function(){return this.options[this.currentIndex]}}}),l={props:{title:String,loading:Boolean,showToolbar:Boolean,cancelButtonText:String,confirmButtonText:String,visibleItemCount:{type:Number,default:5},itemHeight:{type:Number,default:44}}};e["a"]=Object(i["a"])({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b()},[t.showToolbar?n("div",{staticClass:"van-hairline--top-bottom",class:t.b("toolbar")},[t._t("default",[n("div",{class:t.b("cancel"),on:{click:function(e){t.emit("cancel")}}},[t._v("\n "+t._s(t.cancelButtonText||t.$t("cancel"))+"\n ")]),t.title?n("div",{staticClass:"van-ellipsis",class:t.b("title"),domProps:{textContent:t._s(t.title)}}):t._e(),n("div",{class:t.b("confirm"),on:{click:function(e){t.emit("confirm")}}},[t._v("\n "+t._s(t.confirmButtonText||t.$t("confirm"))+"\n ")])])],2):t._e(),t.loading?n("div",{class:t.b("loading")},[n("loading")],1):t._e(),n("div",{class:t.b("columns"),style:t.columnsStyle,on:{touchmove:function(t){t.preventDefault()}}},[t._l(t.simple?[t.columns]:t.columns,function(e,i){return n("picker-column",{key:i,attrs:{"value-key":t.valueKey,"initial-options":t.simple?e:e.values,"class-name":e.className,"default-index":e.defaultIndex,"item-height":t.itemHeight,"visible-item-count":t.visibleItemCount},on:{change:function(e){t.onChange(i)}}})}),n("div",{staticClass:"van-hairline--top-bottom",class:t.b("frame"),style:t.frameStyle})],2)])},name:"picker",mixins:[l],components:{PickerColumn:c},props:{columns:Array,valueKey:{type:String,default:"text"}},data:function(){return{children:[]}},computed:{frameStyle:function(){return{height:this.itemHeight+"px"}},columnsStyle:function(){return{height:this.itemHeight*this.visibleItemCount+"px"}},simple:function(){return this.columns.length&&!this.columns[0].values}},watch:{columns:function(){this.setColumns()}},methods:{setColumns:function(){var t=this,e=this.simple?[{values:this.columns}]:this.columns;e.forEach(function(e,n){t.setColumnValues(n,o(e.values))})},emit:function(t){this.simple?this.$emit(t,this.getColumnValue(0),this.getColumnIndex(0)):this.$emit(t,this.getValues(),this.getIndexes())},onChange:function(t){this.simple?this.$emit("change",this,this.getColumnValue(0),this.getColumnIndex(0)):this.$emit("change",this,this.getValues(),t)},getColumn:function(t){return this.children[t]},getColumnValue:function(t){var e=this.getColumn(t);return e&&e.getValue()},setColumnValue:function(t,e){var n=this.getColumn(t);n&&n.setValue(e)},getColumnIndex:function(t){return(this.getColumn(t)||{}).currentIndex},setColumnIndex:function(t,e){var n=this.getColumn(t);n&&n.setIndex(e)},getColumnValues:function(t){return(this.children[t]||{}).options},setColumnValues:function(t,e){var n=this.children[t];n&&JSON.stringify(n.options)!==JSON.stringify(e)&&(n.options=e,n.setIndex(0))},getValues:function(){return this.children.map(function(t){return t.getValue()})},setValues:function(t){var e=this;t.forEach(function(t,n){e.setColumnValue(n,t)})},getIndexes:function(){return this.children.map(function(t){return t.currentIndex})},setIndexes:function(t){var e=this;t.forEach(function(t,n){e.setColumnIndex(n,t)})}}})}}]);
- //# sourceMappingURL=chunk-6f441c61.dcb665d6.js.map
|