public
This commit is contained in:
10
public/mp-weixin/components/share-popup/poster.js
Normal file
10
public/mp-weixin/components/share-popup/poster.js
Normal file
@ -0,0 +1,10 @@
|
||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/share-popup/poster"],{"01a8":function(e,n,t){"use strict";t.r(n);var o=t("a946"),r=t("65df");for(var i in r)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return r[e]}))}(i);var a=t("828b"),c=Object(a["a"])(r["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);n["default"]=c.exports},"65df":function(e,n,t){"use strict";t.r(n);var o=t("d624"),r=t.n(o);for(var i in o)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(i);n["default"]=r.a},a946:function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"c",(function(){return r})),t.d(n,"a",(function(){}));var o=function(){var e=this.$createElement;this._self._c},r=[]},d624:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o={name:"share-poster",components:{lPainter:function(){Promise.all([t.e("common/vendor"),t.e("components/lime-painter/components/l-painter/l-painter")]).then(function(){return resolve(t("ead4"))}.bind(null,t)).catch(t.oe)},lPainterImage:function(){Promise.all([t.e("common/vendor"),t.e("components/lime-painter/components/l-painter-image/l-painter-image")]).then(function(){return resolve(t("c5a0"))}.bind(null,t)).catch(t.oe)},lPainterText:function(){Promise.all([t.e("common/vendor"),t.e("components/lime-painter/components/l-painter-text/l-painter-text")]).then(function(){return resolve(t("54d5"))}.bind(null,t)).catch(t.oe)},lPainterView:function(){Promise.all([t.e("common/vendor"),t.e("components/lime-painter/components/l-painter-view/l-painter-view")]).then(function(){return resolve(t("7198"))}.bind(null,t)).catch(t.oe)},lPainterQrcode:function(){Promise.all([t.e("common/vendor"),t.e("components/lime-painter/components/l-painter-qrcode/l-painter-qrcode")]).then(function(){return resolve(t("0a94"))}.bind(null,t)).catch(t.oe)}},props:{config:{type:Object,default:function(){return{}}},shareId:{type:[Number,String],default:""},qrcode:{type:[String],default:""},pagePath:{type:String,default:""},link:{type:String,default:""},type:{type:String,default:"goods"}},data:function(){return{}},computed:{price:function(){var e=this.config.price;return console.log(e),void 0==e?{}:(e=String(parseFloat(e)).split("."),{prev:e[0],next:e[1]?".".concat(e[1]):""})},marketPrice:function(){return"¥".concat(parseFloat(this.config.marketPrice))}},methods:{handleSuccess:function(e){this.$emit("success",e)},handleFail:function(e){this.$emit("fail")}}};n.default=o}}]);
|
||||
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
|
||||
'components/share-popup/poster-create-component',
|
||||
{
|
||||
'components/share-popup/poster-create-component':(function(module, exports, __webpack_require__){
|
||||
__webpack_require__('df3c')['createComponent'](__webpack_require__("01a8"))
|
||||
})
|
||||
},
|
||||
[['components/share-popup/poster-create-component']]
|
||||
]);
|
||||
10
public/mp-weixin/components/share-popup/poster.json
Normal file
10
public/mp-weixin/components/share-popup/poster.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"l-painter": "/components/lime-painter/components/l-painter/l-painter",
|
||||
"l-painter-image": "/components/lime-painter/components/l-painter-image/l-painter-image",
|
||||
"l-painter-text": "/components/lime-painter/components/l-painter-text/l-painter-text",
|
||||
"l-painter-view": "/components/lime-painter/components/l-painter-view/l-painter-view",
|
||||
"l-painter-qrcode": "/components/lime-painter/components/l-painter-qrcode/l-painter-qrcode"
|
||||
}
|
||||
}
|
||||
1
public/mp-weixin/components/share-popup/poster.wxml
Normal file
1
public/mp-weixin/components/share-popup/poster.wxml
Normal file
File diff suppressed because one or more lines are too long
10
public/mp-weixin/components/share-popup/share-popup.js
Normal file
10
public/mp-weixin/components/share-popup/share-popup.js
Normal file
@ -0,0 +1,10 @@
|
||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/share-popup/share-popup"],{"1c3c":function(e,t,n){"use strict";(function(e){var r=n("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n("7eb4")),c=r(n("ee10")),a=r(n("7ca3")),i=n("7a03"),u=n("a381"),s=n("8f59");function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d={components:{poster:function(){n.e("components/share-popup/poster").then(function(){return resolve(n("01a8"))}.bind(null,n)).catch(n.oe)}},props:{value:{type:Boolean},shareId:{type:[String,Number],default:""},config:{type:Object,default:function(){return{}}},pagePath:{type:String,default:""},type:{type:String,default:"goods"}},data:function(){return{poster:"",enablePoster:!1,showPoster:!1,showTips:!1,mnpQrcode:""}},computed:f(f({},(0,s.mapGetters)(["inviteCode","userInfo"])),{},{getLink:function(){return"".concat(u.baseURL).concat(u.basePath,"/").concat(this.pagePath,"?id=").concat(this.shareId,"&invite_code=").concat(this.inviteCode)},showshare:{get:function(){return this.value},set:function(e){this.$emit("input",e)}}}),watch:{showPoster:function(e){e||(this.enablePoster=!1)}},methods:{getPoster:function(){var t=this;return(0,c.default)(o.default.mark((function n(){var r;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t.isLogin){n.next=2;break}return n.abrupt("return",t.$Router.push("/pages/login/login"));case 2:if(e.showLoading({title:"正在生成中"}),t.mnpQrcode){n.next=8;break}return n.next=6,t.getMnpQrcode();case 6:r=n.sent,t.mnpQrcode=r.data.qr_code.replaceAll("\r\n","");case 8:t.enablePoster=!0;case 9:case"end":return n.stop()}}),n)})))()},getMnpQrcode:function(){var e=this;return new Promise((function(t,n){(0,i.apiMnpQrCode)({id:e.shareId,url:e.pagePath,type:e.type}).then((function(e){t(e)})).catch((function(){n()}))}))},getTtQrCode:function(){var t=this;return new Promise((function(n,r){var o=e.getSystemInfoSync();(0,i.apiTtQrCode)({appname:TtAppNameEnum[o.appName],id:t.shareId,page:t.pagePath}).then((function(e){n(e)})).catch((function(){e.hideLoading()}))}))},handleSuccess:function(t){this.poster=t,e.hideLoading(),this.showPoster=!0,this.showshare=!1},handleFail:function(){var t=this;e.hideLoading({success:function(){t.$toast({title:"生成失败"})}})},shareWx:function(){},savePoster:function(){var t=this;return(0,c.default)(o.default.mark((function n(){return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:e.saveImageToPhotosAlbum({filePath:t.poster,success:function(e){t.showPoster=!1,t.$toast({title:"保存成功",icon:"success"})},fail:function(e){t.$toast({title:"保存失败"}),console.log(e)}});case 1:case"end":return n.stop()}}),n)})))()}}};t.default=d}).call(this,n("df3c")["default"])},"6b51":function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return c})),n.d(t,"a",(function(){return r}));var r={uPopup:function(){return n.e("components/uview-ui/components/u-popup/u-popup").then(n.bind(null,"b12c"))}},o=function(){var e=this,t=e.$createElement;e._self._c;e._isMounted||(e.e0=function(t){e.showshare=!1})},c=[]},7165:function(e,t,n){},"8ad1":function(e,t,n){"use strict";n.r(t);var r=n("6b51"),o=n("ccb6");for(var c in o)["default"].indexOf(c)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(c);n("c9dd");var a=n("828b"),i=Object(a["a"])(o["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],void 0);t["default"]=i.exports},c9dd:function(e,t,n){"use strict";var r=n("7165"),o=n.n(r);o.a},ccb6:function(e,t,n){"use strict";n.r(t);var r=n("1c3c"),o=n.n(r);for(var c in r)["default"].indexOf(c)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(c);t["default"]=o.a}}]);
|
||||
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
|
||||
'components/share-popup/share-popup-create-component',
|
||||
{
|
||||
'components/share-popup/share-popup-create-component':(function(module, exports, __webpack_require__){
|
||||
__webpack_require__('df3c')['createComponent'](__webpack_require__("8ad1"))
|
||||
})
|
||||
},
|
||||
[['components/share-popup/share-popup-create-component']]
|
||||
]);
|
||||
7
public/mp-weixin/components/share-popup/share-popup.json
Normal file
7
public/mp-weixin/components/share-popup/share-popup.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"u-popup": "/components/uview-ui/components/u-popup/u-popup",
|
||||
"poster": "/components/share-popup/poster"
|
||||
}
|
||||
}
|
||||
1
public/mp-weixin/components/share-popup/share-popup.wxml
Normal file
1
public/mp-weixin/components/share-popup/share-popup.wxml
Normal file
@ -0,0 +1 @@
|
||||
<view><u-popup bind:input="__e" class="share-popup" vue-id="201fd178-1" mode="bottom" border-radius="14" closeable="{{true}}" safe-area-inset-bottom="{{true}}" mask-close-able="{{false}}" mask-custom-style="{{({background:'rgba(0, 0, 0, 0.1)'})}}" value="{{showshare}}" data-event-opts="{{[['^input',[['__set_model',['','showshare','$event',[]]]]]]}}" bind:__l="__l" vue-slots="{{['default']}}"><view class="flex row-center md bold m-t-30 m-b-30">分享至</view><view class="flex row-around share-tab"><view data-event-opts="{{[['tap',[['getPoster',['$event']]]]]}}" class="flex-col col--center" bindtap="__e"><image class="share-icon" mode="widthFix" src="/static/images/icon_generate_poster.png"></image><view class="m-t-10">生成海报</view></view><button class="flex-col col--center" open-type="share" hover-class="none"><image class="share-icon" src="/static/images/icon_wechat.png"></image><view class="m-t-10">微信好友</view></button></view><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" class="flex row-center bg-body cancel xl" bindtap="__e">取消</view></u-popup><u-popup bind:input="__e" class="share-poster" vue-id="201fd178-2" mode="center" closeable="{{true}}" safe-area-inset-bottom="{{true}}" value="{{showPoster}}" data-event-opts="{{[['^input',[['__set_model',['','showPoster','$event',[]]]]]]}}" bind:__l="__l" vue-slots="{{['default']}}"><image style="width:640rpx;" mode="widthFix" src="{{poster}}"></image><button class="flex row-center save-btn" size="lg" data-event-opts="{{[['tap',[['savePoster',['$event']]]]]}}" bindtap="__e"> 保存图片到相册 </button></u-popup><block wx:if="{{enablePoster}}"><poster vue-id="201fd178-3" type="{{type}}" share-id="{{shareId}}" page-path="{{pagePath}}" config="{{config}}" qrcode="{{mnpQrcode}}" link="{{getLink}}" data-event-opts="{{[['^success',[['handleSuccess']]],['^fail',[['handleFail']]]]}}" bind:success="__e" bind:fail="__e" bind:__l="__l"></poster></block></view>
|
||||
1
public/mp-weixin/components/share-popup/share-popup.wxss
Normal file
1
public/mp-weixin/components/share-popup/share-popup.wxss
Normal file
@ -0,0 +1 @@
|
||||
.share-popup .share-tab{margin:40rpx 0 140rpx}.share-popup .share-tab .share-icon{width:100rpx;height:100rpx}.share-popup .cancel{height:98rpx}.share-poster .share-img{width:640rpx;border-radius:12rpx}.share-poster .save-btn{background-color:#ff2c3c;color:#fff;margin-top:20rpx}.share-tips .share-arrow{width:140rpx;height:250rpx;float:right;margin:15rpx 31rpx 0 0}
|
||||
Reference in New Issue
Block a user