arrts.js 5.5 KB

12345678910
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/upload/child/arrts"],{"1db7":function(t,e,i){},"443b":function(t,e,i){"use strict";i.r(e);var a=i("c0f0"),r=i("bfb2");for(var n in r)["default"].indexOf(n)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(n);i("cb34");var s=i("f0c5"),o=Object(s["a"])(r["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],void 0);e["default"]=o.exports},6105:function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i("c306"),r={props:{baseURL:{type:String,default:""},value:{type:Array,default:[]},item:{type:Array}},data:function(){return{values:this.value,items:this.item?this.item:[],header:[],tebindex:"",arrts:[],showarrts:{value:"",detail:[]},isqd:0,showarrtname:"",arrtname:"",addarrts:[],addarrt:"",guige:"",price:"",o_price:"",y_price:"",breakprice:"",stock:""}},mounted:function(){console.log(this.values),0!=this.items.length&&(this.arrts=this.items,this.scarrt())},methods:{open:function(t,e){console.log(t,e),t&&(this.arrtname=t.value,this.addarrts=t.detail),void 0!=e&&(this.tebindex=e,console.log(this.tebindex)),this.$refs.arrt.open()},close:function(){this.isqd=0,this.showarrtname="",this.tebindex="",this.arrtname="",this.addarrts=[],this.addarrt="",this.$refs.arrt.close()},setup:function(){var t=this;this.values.forEach((function(e){console.log(t.guige,t.price,t.o_price,t.y_price,t.breakprice,t.stock),t.guige&&(e.pic=t.guige),t.price&&(e.price=1*t.price),t.o_price&&(e.cost=1*t.o_price),t.y_price&&(e.ot_price=1*t.y_price),t.breakprice&&(e.brokerage_origin=t.breakprice),t.stock&&(e.stock=t.stock)}))},addarrtname:function(){if(""==this.showarrtname)return this.$api.msg("请填写规则");this.isqd=1,this.arrtname=this.showarrtname,this.showarrtname=""},succ:function(){console.log(this.items,"111"),this.$emit("getarrts",this.values,this.items)},addarrtvalue:function(t){this.addarrt&&(this.addarrts.push(this.addarrt),this.addarrt="")},delarrtvalue:function(t){if(console.log(t,"123456"),1==this.arrts.length)return this.$api.msg("请设置至少一个规则值");this.addarrts.splice(t,1)},dearrt:function(){this.arrts.splice(this.tebindex,1),this.close()},del:function(t){if(1==this.value.length)return this.$api.msg("请设置至少一个规则");this.value.splice(t,1)},jcarrtvalue:function(t,e){if(!t.detail.value)return this.$api.msg("规格值不能为空")},qd:function(){if(0==this.addarrts.length)return this.close(),this.$api.msg("规格值不能为空");if("string"!=typeof this.tebindex)console.log(this.tebindex),this.arrts[this.tebindex].value=this.arrtname,this.arrts[this.tebindex].detail=this.addarrts;else{var t={value:"",detail:[],attrHidden:"",detailValue:""};t.value=this.arrtname,t.detail=this.addarrts,this.arrts.push(t)}this.close()},upLoad:function(e){var i=this;return t.showLoading({title:"图片上传中",mask:!0}),new Promise((function(a,r){t.uploadFile({url:i.baseURL+"/api/upload/image",filePath:e,name:"file",header:{"Authori-zation":"Bearer "+t.getStorageSync("token")},success:function(t){"string"===typeof t.data?a(JSON.parse(t.data).data):a(t.data.data)},complete:function(){t.hideLoading()}})}))},navCroper:function(e,i,a){var r=this;this.onImg().then((function(n){t.navigateTo({url:"/pages/set/cropper?width=".concat(e,"&height=").concat(i),events:{uploadSuccess:function(t){r.upLoad(t).then((function(t){"guige"==a?r.guige=t.url:r.value[a].pic=t.url}))}},success:function(t){t.eventChannel.emit("urlNext",{url:n})}})}))},onImg:function(e){var i=this;return new Promise((function(e,a){t.showActionSheet({itemList:["拍照","选择一张照片"],success:function(t){i.chooseImage(t.tapIndex).then((function(t){e(t)})).catch((function(t){a(t)}))},fail:function(t){a(t),console.log(t.errMsg)}})}))},chooseImage:function(e){return new Promise((function(i,a){var r=0===e?["camera"]:["album"];t.chooseImage({count:1,sizeType:["original","compressed"],sourceType:r,success:function(t){i(t.tempFilePaths[0])},fail:function(e){t.showModal({title:"文件打开错误",content:"请设置授权文件存储权限",showCancel:!1}),a(e)}})}))},scarrt:function(){var e=this;t.showLoading({title:"生成中"}),(0,a.is_format_attr)({attrs:this.arrts}).then((function(i){var a=i.data;t.hideLoading(),e.items=a.attr,e.header=a.header,0==e.values.length&&(e.values=a.value),console.log(a)})).catch((function(e){t.hideLoading()}))}}};e.default=r}).call(this,i("543d")["default"])},bfb2:function(t,e,i){"use strict";i.r(e);var a=i("6105"),r=i.n(a);for(var n in a)["default"].indexOf(n)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(n);e["default"]=r.a},c0f0:function(t,e,i){"use strict";i.d(e,"b",(function(){return r})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){return a}));var a={uniPopup:function(){return i.e("components/uni-popup/uni-popup").then(i.bind(null,"1808"))}},r=function(){var t=this,e=t.$createElement,i=(t._self._c,t.arrts.length),a=0!=i?t.__map(t.arrts,(function(e,i){var a=t.__get_orig(e),r=e.detail.length;return{$orig:a,g1:r}})):null,r=t.arrts.length,n=0!=t.header.length&&0!=t.values.length;t.$mp.data=Object.assign({},{$root:{g0:i,l0:a,g2:r,g3:n}})},n=[]},cb34:function(t,e,i){"use strict";var a=i("1db7"),r=i.n(a);r.a}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'pages/upload/child/arrts-create-component',
  4. {
  5. 'pages/upload/child/arrts-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('543d')['createComponent'](__webpack_require__("443b"))
  7. })
  8. },
  9. [['pages/upload/child/arrts-create-component']]
  10. ]);