You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
22 KiB
1 lines
22 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["user-pages-order-sign"],{"0574":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"v-sign-color"},[n("v-uni-view",{staticClass:"options"},t._l(t.options,(function(e,i){return n("v-uni-view",{key:e,staticClass:"option-item",style:[t.optionStyle(e,i)],on:{click:function(n){arguments[0]=n=t.$handleEvent(n),t.onSelect(e,i)}}},[n("v-uni-view",{staticClass:"option-inner",style:[t.optionInnerStyle(e,i)]},[t._v(t._s(t.tick&&t.currentIndex===i?"✓":""))])],1)})),1)],1)},a=[]},1309:function(t,e,n){var i=n("c86c");e=i(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.v-sign-pen[data-v-c3e63b6e]{padding:%?12?%}.v-sign-pen .label[data-v-c3e63b6e]{font-size:%?28?%;color:#333}.v-sign-pen .options[data-v-c3e63b6e]{display:flex;align-items:flex-end}.v-sign-pen .options .opt-item[data-v-c3e63b6e]{display:flex;align-items:flex-end;justify-content:center}.v-sign-pen .options .opt-item[data-v-c3e63b6e]:last-child{margin-right:0}.v-sign-pen .options .opt-item[data-v-c3e63b6e]:active{transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;-webkit-transform:scale(1.1);transform:scale(1.1)}.v-sign-pen .options .opt-item .circle[data-v-c3e63b6e]{border-radius:50%;padding:%?4?%}.v-sign-pen .options .opt-item .circle .inner[data-v-c3e63b6e]{border-radius:50%}.v-sign-pen .options .opt-item .line[data-v-c3e63b6e]{padding:%?4?%}',""]),t.exports=e},"143b":function(t,e,n){"use strict";n.r(e);var i=n("907f"),a=n("7eab");for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("d550");var o=n("828b"),s=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,"c3e63b6e",null,!1,i["a"],void 0);e["default"]=s.exports},1851:function(t,e,n){"use strict";var i=n("8bdb"),a=n("84d6"),r=n("1cb5");i({target:"Array",proto:!0},{fill:a}),r("fill")},"364f":function(t,e,n){"use strict";var i=n("787e"),a=n.n(i);a.a},"4cf8":function(t,e,n){"use strict";n("6a54");var i=n("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("9b1b")),r=i(n("2634")),o=i(n("2fdc"));n("64aa"),n("aa9c"),n("bf0f"),n("2797"),n("1851");var s=n("853a"),c={name:"v-sign",props:{cid:{type:String,default:"v-sign-".concat(Date.now())},width:{type:[String,Number]},height:{type:[String,Number]},lineWidth:{type:Number,default:4},lineColor:{type:String,default:"#333"},bgColor:{type:String,default:"#fff"},customStyle:{type:Object,default:function(){return{}}}},provide:function(){return{getSignInterface:this.provideSignInterface}},data:function(){return{formatSize:s.formatSize,lineData:[],winWidth:0,winHeight:0,penLineWidth:null,penLineColor:null}},created:function(){var t=uni.getSystemInfoSync(),e=t.windowWidth,n=t.windowHeight;this.winWidth=e,this.winHeight=n},onReady:function(){var t=uni.getSystemInfoSync(),e=t.windowWidth,n=t.windowHeight;this.winWidth=e,this.winHeight=n},mounted:function(){var t=this;this.canvasCtx=uni.createCanvasContext(this.cid,this),setTimeout((function(){t.setBackgroundColor(t.bgColor)}),10),this.$emit("init",this.provideSignInterface())},methods:{onTouchStart:function(t){var e=t.touches[0];this.lineData.push({style:{color:this.penLineColor||this.lineColor,width:this.penLineWidth||this.lineWidth},coordinates:[{type:t.type,x:e.x,y:e.y}]}),this.drawLine()},onTouchMove:function(t){var e=t.touches[0];this.lineData[this.lineData.length-1].coordinates.push({type:t.type,x:e.x,y:e.y}),this.drawLine()},onTouchEnd:function(t){this.$emit("end",this.lineData)},clear:function(){this.lineData=[],this.canvasCtx.clearRect(0,0,this.winWidth,this.winHeight),this.canvasCtx.draw(),this.setBackgroundColor(this.bgColor),this.$emit("clear")},revoke:function(){var t=this;this.setBackgroundColor(this.bgColor),this.lineData.pop(),this.lineData.forEach((function(e,n){if(t.canvasCtx.beginPath(),t.canvasCtx.setLineCap("round"),t.canvasCtx.setStrokeStyle(e.style.color),t.canvasCtx.setLineWidth(e.style.width),e.coordinates.length<2){var i=e.coordinates[0];t.canvasCtx.moveTo(i.x,i.y),t.canvasCtx.lineTo(i.x+1,i.y)}else e.coordinates.forEach((function(e){"touchstart"==e.type?t.canvasCtx.moveTo(e.x,e.y):t.canvasCtx.lineTo(e.x,e.y)}));t.canvasCtx.stroke()})),this.canvasCtx.draw(!0),this.$emit("revoke",this.lineData)},drawLine:function(){var t=this.lineData.length;if(t){var e=this.lineData[t-1],n=e.coordinates,i=n.length;if(i){var a,r;i<2?(a=n[i-1],r={x:a.x+1,y:a.y}):(a=n[i-2],r=n[i-1]);var o=e.style;this.canvasCtx.beginPath(),this.canvasCtx.setLineCap("round"),this.canvasCtx.setStrokeStyle(o.color),this.canvasCtx.setLineWidth(o.width),this.canvasCtx.moveTo(a.x,a.y),this.canvasCtx.lineTo(r.x,r.y),this.canvasCtx.stroke(),this.canvasCtx.draw(!0)}}},saveImage:function(){var t=arguments,e=this;return(0,o.default)((0,r.default)().mark((function n(){var i,a;return(0,r.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=t.length>0&&void 0!==t[0]?t[0]:"签名",n.next=3,e.canvasToTempFilePath();case 3:return a=n.sent,n.abrupt("return",new Promise((function(t,e){try{var n=document.createElement("a");n.href=a,n.download=i,document.body.appendChild(n),n.click(),n.remove(),t({errMsg:"saveImageH5:ok"})}catch(r){console.error(r),e(r)}})));case 5:case"end":return n.stop()}}),n)})))()},canvasToTempFilePath:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise((function(n,i){uni.canvasToTempFilePath((0,a.default)((0,a.default)({canvasId:t.cid},e),{},{success:function(t){n(t.tempFilePath)},fail:function(t){console.log("fail",t),i(t)}}),t)}))},setBackgroundColor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#fff";this.canvasCtx.beginPath(),this.canvasCtx.setFillStyle(t),this.canvasCtx.fillRect(0,0,this.winWidth,this.winHeight),this.canvasCtx.fill(),this.canvasCtx.draw(!0)},setLineWidth:function(t){this.penLineWidth=t},setLineColor:function(t){this.penLineColor=t},provideSignInterface:function(){var t=this;return{cid:this.cid,ctx:this.canvasCtx,clear:this.clear,revoke:this.revoke,saveImage:this.saveImage,canvasToTempFilePath:this.canvasToTempFilePath,setLineWidth:this.setLineWidth,setLineColor:this.setLineColor,setBackgroundColor:this.setBackgroundColor,getLineData:function(){return t.lineData}}},caculateBezier:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,a=t.x,r=t.y,o=e.x,s=e.y,c=n.x,u=n.y,d=(c-(1-i)*(1-i)*a-i*i*o)/(2*i*(1-i)),l=(u-(1-i)*(1-i)*r-i*i*s)/(2*i*(1-i));return{x:d,y:l}}}};e.default=c},"4dd1":function(t,e,n){"use strict";n.r(e);var i=n("7efd"),a=n("ac2d");for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("97b1");var o=n("828b"),s=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,"6d4d0cc8",null,!1,i["a"],void 0);e["default"]=s.exports},6011:function(t,e,n){var i=n("cf2cd");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("967d").default;a("4b854f1b",i,!0,{sourceMap:!1,shadowMode:!1})},"787e":function(t,e,n){var i=n("e821");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("967d").default;a("423feb2e",i,!0,{sourceMap:!1,shadowMode:!1})},"7eab":function(t,e,n){"use strict";n.r(e);var i=n("8552"),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},"7efd":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"signature-wrap"},[n("v-uni-canvas",{style:[{width:t.width&&t.formatSize(t.width),height:t.height&&t.formatSize(t.height)},t.customStyle],attrs:{"canvas-id":t.cid,id:t.cid,"disable-scroll":!0},on:{touchstart:function(e){arguments[0]=e=t.$handleEvent(e),t.onTouchStart.apply(void 0,arguments)},touchmove:function(e){arguments[0]=e=t.$handleEvent(e),t.onTouchMove.apply(void 0,arguments)},touchend:function(e){arguments[0]=e=t.$handleEvent(e),t.onTouchEnd.apply(void 0,arguments)}}}),t._t("default")],2)},a=[]},8155:function(t,e,n){var i=n("c86c");e=i(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.options[data-v-e5aea6ca]{padding:%?8?%;display:flex;flex-wrap:wrap}.option-item[data-v-e5aea6ca]{overflow:hidden}.option-item[data-v-e5aea6ca]:last-child{margin-right:0}.option-item[data-v-e5aea6ca]:active{transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;-webkit-transform:scale(1.1);transform:scale(1.1)}.option-inner[data-v-e5aea6ca]{width:100%;height:100%;text-align:center;font-weight:700;color:#fff}',""]),t.exports=e},"853a":function(t,e,n){"use strict";function i(t){return!isNaN(Number(t))}n("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.formatSize=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rpx";return i(t)?"".concat(t).concat(e):t},e.isNumber=i,n("64aa"),n("c223")},8552:function(t,e,n){"use strict";var i;n("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("64aa"),n("fd3c");var a={CIRCLE:"circle",LINE:"line"},r={name:"v-sign-pen",props:{type:{type:String,default:a.CIRCLE},label:{type:String},sizes:{type:Array,default:function(){return[2,4,6,8,10]}},color:{type:String,default:"#333"},activeColor:{type:String,default:"#333"},border:{type:Boolean,default:!0},borderWidth:{type:Number,default:4},space:{type:Number,default:20},bigger:{type:Number,default:2},minSize:{type:Number,default:4}},inject:["getSignInterface"],data:function(){return{type_style:a,currentSelect:null,csizes:[],maxSize:0,maxCsize:0}},computed:{minWrapHeight:function(){var t;switch(this.type){case a.CIRCLE:t=this.maxCsize+10+"px";break;case a.LINE:t=this.maxSize+4+"px";break}return t}},created:function(){var t=this;this.csizes=this.sizes.map((function(e,n){var i=(n+1)*t.bigger+t.minSize;return t.maxSize=i>t.maxSize?i:t.maxSize,t.maxCsize=i>t.maxCsize?i:t.maxCsize,{size:e,csize:i}})),this.currentSelect=this.csizes[0]},mounted:function(){i=this.getSignInterface(),this.setLineWidth()},methods:{onItemClick:function(t){this.currentSelect=t,this.setLineWidth(),this.$emit("change",t.size)},setLineWidth:function(){i.setLineWidth(this.currentSelect.size)},defaultInnerStyle:function(t){var e,n;switch(this.type){case a.CIRCLE:e="".concat(t.csize,"px"),n="".concat(t.csize,"px");break;case a.LINE:e="20px",n="".concat(t.size,"px");break}var i=this.currentSelect.size===t.size?this.activeColor:this.color;return{width:e,height:n,background:i}}}};e.default=r},"907f":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"v-sign-pen"},[t.label?n("v-uni-view",{staticClass:"label"},[t._v(t._s(t.label))]):t._e(),n("v-uni-view",{staticClass:"options"},t._l(t.csizes,(function(e){return n("v-uni-view",{key:e.size,staticClass:"opt-item",style:{minHeight:t.minWrapHeight,marginRight:t.space+"rpx"},on:{click:function(n){arguments[0]=n=t.$handleEvent(n),t.onItemClick(e)}}},[n("v-uni-view",{class:t.type,style:{border:t.border&&t.currentSelect.size===e.size?t.borderWidth+"rpx solid "+t.activeColor:""}},[n("v-uni-view",{staticClass:"inner",style:[t.defaultInnerStyle(e)]})],1)],1)})),1)],1)},a=[]},"97b1":function(t,e,n){"use strict";var i=n("6011"),a=n.n(i);a.a},"980f":function(t,e,n){"use strict";n("6a54");var i=n("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("2634")),r=i(n("2fdc")),o=n("8f59"),s={data:function(){return{isLoad:!1,winWidth:0}},onLoad:function(t){this.options=t,this.initIndex()},computed:(0,o.mapState)({primaryColor:function(t){return t.config.configInfo.primaryColor},subColor:function(t){return t.config.configInfo.subColor},configInfo:function(t){return t.config.configInfo}}),methods:{initIndex:function(){var t=arguments,e=this;return(0,r.default)((0,a.default)().mark((function n(){var i,r,o;return(0,a.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(i=t.length>0&&void 0!==t[0]&&t[0],i||!e.$jweixin.isWechat()){n.next=5;break}return n.next=4,e.$jweixin.initJssdk();case 4:e.$jweixin.wxReady((function(){e.$jweixin.hideOptionMenu()}));case 5:r=uni.getSystemInfoSync(),o=r.windowWidth,e.winWidth=o,e.$util.setNavigationBarColor({bg:e.primaryColor}),e.isLoad=!0;case 9:case"end":return n.stop()}}),n)})))()},onSignInit:function(t){this.signCtx=t},save:function(t){},confirmSign:function(t){var e=this;return(0,r.default)((0,a.default)().mark((function t(){var n,i,r,o,s;return(0,a.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.signCtx.getLineData(),0!=n){t.next=4;break}return e.$util.showToast({title:"请先进行签名"}),t.abrupt("return");case 4:return t.next=6,e.signCtx.canvasToTempFilePath();case 6:return i=t.sent,e.$util.showLoading(),t.next=10,e.$api.base.uploadFile({filePath:i,formData:{type:"picture"}});case 10:return r=t.sent,o=r.attachment_path,s=e.options.id,t.next=15,e.$api.order.userSignOrder({id:s,sign_img:o});case 15:e.$util.hideAll(),e.$util.showToast({title:"签名成功"}),setTimeout((function(){e.$util.back(),e.$util.goUrl({url:1,openType:"navigateBack"})}),1e3);case 18:case"end":return t.stop()}}),t)})))()}}};e.default=s},"9a5a":function(t,e,n){"use strict";var i=n("ea3e"),a=n.n(i);a.a},a091:function(t,e,n){"use strict";n.r(e);var i=n("c315"),a=n("deae");for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("364f");var o=n("828b"),s=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,"6147cd69",null,!1,i["a"],void 0);e["default"]=s.exports},a7a2:function(t,e,n){var i=n("1309");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("967d").default;a("0d0e3cae",i,!0,{sourceMap:!1,shadowMode:!1})},ac2d:function(t,e,n){"use strict";n.r(e);var i=n("4cf8"),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},acb1:function(t,e,n){"use strict";n.r(e);var i=n("f4fd"),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},c065:function(t,e,n){"use strict";n.r(e);var i=n("0574"),a=n("acb1");for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("9a5a");var o=n("828b"),s=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,"e5aea6ca",null,!1,i["a"],void 0);e["default"]=s.exports},c315:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i}));var i={vSign:n("4dd1").default,vSignPen:n("143b").default,vSignColor:n("c065").default},a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.isLoad?n("v-uni-view",{staticClass:"user-order-sign"},[n("v-sign",{attrs:{width:t.winWidth+"px",height:2*t.winWidth,bgColor:t.subColor},on:{init:function(e){arguments[0]=e=t.$handleEvent(e),t.onSignInit.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"control-area"},[n("v-sign-pen",{attrs:{"active-color":t.primaryColor}}),n("v-uni-view",{staticClass:"space-sm"}),n("v-sign-color")],1)],1),n("v-uni-view",{staticClass:"space-max-footer"}),n("fix-bottom-button",{attrs:{text:[{text:"清空签名",type:"cancel"},{text:"确定完成",type:"confirm"}],bgColor:"#fff",classType:2},on:{cancel:function(e){arguments[0]=e=t.$handleEvent(e),t.signCtx.clear()},confirm:function(e){arguments[0]=e=t.$handleEvent(e),t.confirmSign.apply(void 0,arguments)}}})],1):t._e()},r=[]},cf2cd:function(t,e,n){var i=n("c86c");e=i(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.signature-wrap[data-v-6d4d0cc8]{position:relative}',""]),t.exports=e},d550:function(t,e,n){"use strict";var i=n("a7a2"),a=n.n(i);a.a},deae:function(t,e,n){"use strict";n.r(e);var i=n("980f"),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},e821:function(t,e,n){var i=n("c86c");e=i(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.user-order-sign[data-v-6147cd69]{width:100vw;height:100vh}.user-order-sign .control-area[data-v-6147cd69]{padding:%?10?%}',""]),t.exports=e},ea3e:function(t,e,n){var i=n("8155");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("967d").default;a("3f6c1cf0",i,!0,{sourceMap:!1,shadowMode:!1})},f4fd:function(t,e,n){"use strict";n("6a54");var i=n("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("9b1b"));n("64aa"),n("bd06");var r,o=n("853a"),s={CIRCLE:"circle",SQUARE:"square"},c={name:"v-sign-color",props:{type:{type:String,default:s.SQUARE},color:{type:String},options:{type:Array,default:function(){return["#333","#f44236","#3f51b5","#2195f3","#ffeb3b","#ff9900"]}},size:{type:[Number,String],default:44},tick:{type:Boolean,default:!0},tickSize:{type:[Number,String],default:24},borderColor:{type:String,default:"#fff"},border:{type:Boolean,default:!1},space:{type:[Number,String],default:16}},inject:["getSignInterface"],data:function(){return{formatSize:o.formatSize,currentIndex:null}},watch:{color:{handler:function(t){var e=this;if(t){var n=this.options.findIndex((function(t){return t===e.color}));n>0&&(this.currentIndex=n)}else this.currentIndex=0},immediate:!0}},computed:{currentColor:function(){return this.options[this.currentIndex]}},mounted:function(){r=this.getSignInterface(),this.setLineColor()},methods:{onSelect:function(t,e){this.currentIndex=e,this.$emit("change",t),this.setLineColor()},setLineColor:function(){r.setLineColor(this.currentColor)},optionStyle:function(t,e){var n=(0,o.formatSize)(this.size),i={marginRight:(0,o.formatSize)(this.space),width:n,height:n,lineHeight:n,border:this.border&&this.currentIndex===e?"4rpx solid ".concat(this.borderColor):"",padding:this.currentIndex===e?0:this.border?"4rpx":""};switch(this.type){case s.SQUARE:i=(0,a.default)((0,a.default)({},i),{},{borderRadius:this.currentIndex===e?"8rpx":0});break;case s.CIRCLE:i=(0,a.default)((0,a.default)({},i),{},{borderRadius:"50%"});break}return i},optionInnerStyle:function(t,e){var n={background:t,fontSize:(0,o.formatSize)(this.tickSize)};switch(this.type){case s.SQUARE:n=(0,a.default)((0,a.default)({},n),{},{borderRadius:this.currentIndex===e?0:"8rpx"});break;case s.CIRCLE:n=(0,a.default)((0,a.default)({},n),{},{borderRadius:"50%"});break}return n}}};e.default=c}}]); |