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
13 KiB
1 lines
13 KiB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["package1/index/shareStyle"],{1669:function(e,t,i){},4173:function(e,t,i){"use strict";i.r(t);var s=i("4937"),a=i("888d");for(var o in a)["default"].indexOf(o)<0&&function(e){i.d(t,e,(function(){return a[e]}))}(o);i("d5a9");var n=i("828b"),c=Object(n["a"])(a["default"],s["b"],s["c"],!1,null,null,null,!1,s["a"],void 0);t["default"]=c.exports},4937:function(e,t,i){"use strict";i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return o})),i.d(t,"a",(function(){return s}));var s={uniSearchBar:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar")]).then(i.bind(null,"f56e"))},uniIcons:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(i.bind(null,"6bbb6"))},uLoadmore:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-loadmore/u-loadmore")]).then(i.bind(null,"9fc5"))},uniPopup:function(){return i.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(i.bind(null,"2864"))},uniPopupShare:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-popup/components/uni-popup-share/uni-popup-share")]).then(i.bind(null,"85cb"))}},a=function(){var e=this,t=e.$createElement,i=(e._self._c,e.carList.length);e._isMounted||(e.e0=function(t){return e.$refs.upNewPopup.open()},e.e1=function(t){return e.$refs.showPopup.close()}),e.$mp.data=Object.assign({},{$root:{g0:i}})},o=[]},"6a33":function(e,t,i){"use strict";(function(e,s){var a=i("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(i("7eb4")),n=a(i("af34")),c=a(i("ee10")),r={components:{},data:function(){return{bigImg:[],swiperDotIndex:0,canvasshow:!1,indexList:[],pageNum:1,shopList:[],shopList1:[],shopId:e.getStorageSync("shopId"),shopOwnerPhone:e.getStorageSync("shopOwnerPhone"),username:e.getStorageSync("username"),info:0,classId:"",gateType:"",goodsList:[],categoryId:"",searchName:"",checkbox:"",id:"",carList:[],zheng:"",fu:"",khName:[],carNum:0,carType:0,type:"",gwcList:[],data:{},height:0,base64:"",shareSuccess:!1,tempFilePath:"",mini_program_openid:"",unionid:"",official_account_openid:"",customerCategoryList:[],FWHPic:"https://jewel-shop.oss-cn-beijing.aliyuncs.com/f2ba2080aaa54c618c2e47df4f220087.png"}},created:function(){e.hideHomeButton()},onReachBottom:function(){this.pageNum>=this.pages||(this.pageNum++,"search"==this.gateType?this.getShareList("search"):this.getShareList())},onShareTimeline:function(){return{title:"查看我的推荐",imageUrl:"https://jewel-shop.oss-cn-beijing.aliyuncs.com/70c3d9a274ff4feeb6df0bcb8be0f733.jpg",query:"khid="+this.khid}},onShareAppMessage:function(){return this.shareSuccess=!0,1==this.carList.length&&"2"==this.data.shareType?{title:this.shopName+"的推荐",imageUrl:"https://jewel-shop.oss-cn-beijing.aliyuncs.com/70c3d9a274ff4feeb6df0bcb8be0f733.jpg",path:"/package1/index/oneGoodsShare?khid="+this.khid+"&userId="+this.khName.userId+"&shareType="+this.data.shareType+"&mini_program_openid="+this.mini_program_openid+"&unionid="+this.unionid+"&official_account_openid="+this.official_account_openid+"&customId="+this.khName.id}:{title:this.shopName+"的推荐",imageUrl:"https://jewel-shop.oss-cn-beijing.aliyuncs.com/70c3d9a274ff4feeb6df0bcb8be0f733.jpg",path:"/package1/index/downStearmList?khid="+this.khid+"&userId="+this.khName.userId+"&shareType="+this.data.shareType+"&mini_program_openid="+this.mini_program_openid+"&unionid="+this.unionid+"&official_account_openid="+this.official_account_openid+"&customId="+this.khName.id}},onShow:function(){var t=this;this.shareSuccess&&(""==this.khName||null!=this.khName.officialAccountOpenid&&""!=this.khName.officialAccountOpenid&&"null"!=this.khName.officialAccountOpenid&&void 0!=this.khName.officialAccountOpenid||e.showModal({title:"提示",content:"该客户没有关注公众号,无法接收消息通知,是否邀请用户关注?",success:function(i){i.confirm&&e.previewImage({urls:[t.FWHPic]})}}),this.shareSuccess=!1)},onLoad:function(t){this.height=s.getSystemInfoSync().windowHeight,void 0!=t.khid?e.redirectTo({url:"/package1/index/downStearmList?khid="+t.khid}):(this.type=e.getStorageSync("type"),this.getGategoryList()),this.shopName=t.shopName?t.shopName:e.getStorageSync("shopName"),this.getCustomerCategoryList()},methods:{lunbochange:function(e){this.current=e.detail.current},largeImg:function(e){if(null==e.productPicture&&null==e.productPictures||""==e.productPicture&&null==e.productPictures)this.tui.toast("暂无可展示的图片",300);else{if(this.bigImg=[],null!=e.productPicture){var t={productPicture:e.productPicture};this.bigImg.push(t)}if(null!=e.productPictures)for(var i=0;i<e.productPictures.length;i++)this.bigImg.push(e.productPictures[i]);this.$refs.imgPopup.open()}},upNewRemind:function(){this.checkUserClass("4"),this.$refs.upNewPopup.close()},checkUserClass:function(e,t){if("31"==e){for(var i=0;i<this.customerCategoryList.length;i++)this.upNew("3",this.customerCategoryList[i]);this.upNew("5","")}else"3"==e?this.upNew("3",t):"0"==e?this.upNew("0",""):"1"==e?this.upNew("1",""):"4"==e&&this.upNew("3",this.khName)},upNew:function(t,i){var s=this;if(this.$refs.upNewPopup.close(),this.data={shareType:"2",shareProductId:this.carList},this.data.priceType="5"==t?"1":"4"==t?""!=this.khName.categoryId&&null!=this.khName.categoryId&&"null"!=this.khName.categoryId?"3":"1":t,"3"==t){var a={id:i.categoryId,name:i.categoryName,userId:this.khName.userId,customId:this.khName.id,mini_program_openid:this.khName.mini_program_openid,unionid:this.khName.unionid,official_account_openid:this.khName.official_account_openid};this.data.scene=JSON.stringify(a)}this.tui.request("/app/productShare/save","POST",this.data,!1,!0).then((function(a){if(200==a.code){s.khid=a.result.id;var o={thing3:"【"+e.getStorageSync("shopName")+"】上新啦!点击查看详情",time2:a.result.createTime};s.tui.request("/social/wechat/sendWechatTempMessage","post",{tempId:"M45X8AmPi58c16M9YVTMEOhwEVEa9s5md-6i3TwjpRQ",title:"店铺上新",content:JSON.stringify(o),pagePath:"package1/index/downStearmList?khid="+s.khid+"&userId="+s.khName.userId+"&shareType="+s.data.shareType+"&mini_program_openid="+s.khName.miniProgramOpenid+"&unionid="+s.khName.unionid+"&official_account_openid="+s.khName.officialAccountOpenid+"&customId="+s.khName.id,upNewType:"0"==t||"1"==t?t:"",userId:"4"==t?s.khName.userId:"",categoryId:"4"==t?s.khName.categoryId:i.categoryId?i.categoryId:"",isAll:"5"==t?"1":""},!1,!1).then((function(e){200==e.code||s.tui.toast(e.message)})).catch((function(e){}))}else s.tui.toast(a.message)})).catch((function(e){})),this.$refs.payDialog.close()},clearkhName:function(){this.khName="",this.$forceUpdate()},getCustomerCategoryList:function(){var t=this;this.tui.request("/app/customerCategory/getCustomerCategoryListByShopId","POST",{shopId:e.getStorageSync("shopId")},!1,!0).then((function(e){if(200==e.code)if(e.result.length>0){t.customerCategoryList=e.result;for(var i=0;i<t.customerCategoryList.length;i++){var s={categoryName:t.customerCategoryList[i].categoryName,categoryId:t.customerCategoryList[i].id,categoryPrice:""};t.customerCategoryList[i]=s}}else t.customerCategoryList=null;else t.tui.toast(e.message)})).catch((function(e){}))},seeStockCount:function(e,t){this.zheng=e,this.fu=t,this.$refs.showPopup.open()},goPopleList:function(){e.navigateTo({url:"/package1/index/peopleList?popleType=khName"})},getUserData:function(t){var i=this,s=this;this.tui.request("/order/ow/getWechatQrcode","post",{page:"package1/index/downStearmList",scene:t,envVersion:__wxConfig.envVersion},!1,!0).then((function(t){if(200==t.code){var a=t.result;e.downloadFile({url:a,success:function(t){i.base64=t.tempFilePath,"1"==i.data.shareType?(e.showLoading({title:"请求中..."}),setTimeout((function(t){e.hideLoading(),e.showModal({title:"提示",content:"确定要分享全部吗?",success:function(e){e.confirm&&s.getData()}})}),500)):i.$refs.share.open()}})}else i.tui.toast(res.message)})).catch((function(e){}))},getData:function(){var t=this,i=this;e.showLoading({title:"生成中..."}),this.canvasshow=!0;var s=e.createCanvasContext("myCanvas",this);e.downloadFile({url:"https://jewel-shop.oss-cn-beijing.aliyuncs.com/0f96ca9700b741d486dd23bbe4e0f970.jpg",success:function(a){if(200===a.statusCode){s.drawImage(a.tempFilePath,0,0,1700,2200),s.draw(),s.drawImage(i.base64,650,850,400,400),s.draw(!0),s.font="bold 200px SimSun",s.fillStyle="#088FEB";var o=t.shopName,n=s.measureText(o).width,c=(1700-n)/2;s.fillText(o,c,700),s.draw(!0),setTimeout((function(i){e.canvasToTempFilePath({x:0,y:0,width:1700,height:2200,destWidth:1701,destHeight:2200,canvasId:"myCanvas",success:function(i){t.canvasshow=!1,t.tempFilePath=i.tempFilePath,e.previewImage({urls:[i.tempFilePath]}),e.hideLoading()}})}),500)}}})},getGategoryList:function(){var e=this;this.tui.request("/app/productCategory/list","get",{},!1,!0).then((function(t){if(200==t.code){e.indexList=t.result;for(var i=0;i<e.indexList.length;i++)e.indexList[i].parentId=0==i;e.categoryId=e.indexList[0].id,e.pageNum=1,e.searchName="",e.shopList1=[],e.shopList=[],e.getShareList()}else e.tui.toast(t.message)})).catch((function(e){}))},getShareList:function(e){var t=this;return(0,c.default)(o.default.mark((function i(){return o.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return t,t.goodsList=[],i.next=4,t.tui.request("/app/product/getShareList","POST",{categoryId:""==t.searchName?t.categoryId:"",searchStr:t.searchName,pageNum:t.pageNum,pageSize:"10"},!1,!1).then((function(i){if(200==i.code){for(var s=0;s<i.result.records.length;s++)""!=i.result.records&&(i.result.records[s].checked=!1);t.$nextTick((function(){"search"==e?(t.gateType="search",t.shopList=[],t.status="nomore",1==t.pages?t.shopList1=i.result.records:t.shopList1=[].concat((0,n.default)(t.shopList1),(0,n.default)(i.result.records)),t.pages=i.result.pages):(t.gateType="",t.shopList1=[],t.status="nomore",1==t.pages?t.shopList=i.result.records:t.shopList=[].concat((0,n.default)(t.shopList),(0,n.default)(i.result.records)),t.pages=i.result.pages)}))}else t.tui.toast(i.message)})).catch((function(e){}));case 4:return i.next=6,t.getCheck();case 6:case"end":return i.stop()}}),i)})))()},search:function(e){this.pageNum=1,this.shopList1=[],this.shopList=[],""==e.value?(this.searchName="",this.getShareList()):(this.searchName=e.value,this.getShareList("search"))},clearSearch:function(){this.searchName="",this.getGategoryList()},getCheck:function(){if(""!=this.carList)if(""!=this.searchName)for(var e=0;e<this.carList.length;e++)for(var t=0;t<this.shopList.length;t++)this.carList[e]==this.shopList[t].id&&(this.shopList[t].checked=!0);else for(e=0;e<this.carList.length;e++)for(t=0;t<this.shopList.length;t++)this.carList[e]==this.shopList[t].id&&(this.shopList[t].checked=!0);this.$forceUpdate()},clickMask:function(){e.showToast({title:"请将商品上架或入库后再操作!",icon:"none"})},clickLeftBtn:function(e){for(var t=0;t<this.indexList.length;t++)this.indexList[t].parentId=t==e;this.categoryId=this.indexList[e].id,this.pageNum=1,this.searchName="",this.shopList1=[],this.shopList=[],this.getShareList(this.indexList[e].id)},checkboxChange:function(e){if(e.checked=!e.checked,-1!=this.carList.indexOf(e.id)?this.carList.splice(this.carList.indexOf(e.id),1):this.carList.push(e.id),0==this.gwcList.length)this.gwcList.push(e);else for(var t=0;t<this.gwcList.length;t++)if(this.gwcList[t].id==e.id)this.gwcList.splice(t,1);else if(this.gwcList.length==t+1)return void this.gwcList.push(e)},clickShareBtn:function(e){"all"==e||""!=this.carList?(this.data="all"==e?{shareType:"1"}:{shareType:"2",shareProductId:this.carList},this.$refs.payDialog.open()):this.tui.toast("请勾选商品后再分享",1e3)},toggle:function(e,t){"carPopup"==e?(this.$refs.carPopup.open("bottom"),this.carType=this.carList.length):(this.checkGoods(t),this.$refs.popup.open("bottom"))},delShop:function(t){var i=this;e.showModal({title:"提示",content:"确定删除此条商品吗?",success:function(e){if(e.confirm)for(var s=0;s<i.gwcList.length;s++)if(i.gwcList[s].id==t){i.carList.splice(i.carList.indexOf(t),1),i.carType=i.carList.length,i.gwcList.splice(s,1);for(var a=0;a<i.goodsList.length;a++)i.goodsList[a].id==t&&i.$set(i.goodsList[a],"checked",!i.goodsList[a].checked)}}})},checkPay:function(e,t){var i=this;this.data.priceType=e;var s={id:t.categoryId,name:t.categoryName,userId:this.khName.userId,customId:this.khName.id,mini_program_openid:this.mini_program_openid,unionid:this.unionid,official_account_openid:this.official_account_openid};this.data.scene=JSON.stringify(s),this.tui.request("/app/productShare/save","POST",this.data,!1,!0).then((function(e){200==e.code?(i.khid=e.result.id,i.getUserData(e.result.id)):i.tui.toast(e.message)})).catch((function(e){})),this.$refs.payDialog.close()},closeCar:function(){this.$refs.carPopup.close()}}};t.default=r}).call(this,i("df3c")["default"],i("3223")["default"])},"888d":function(e,t,i){"use strict";i.r(t);var s=i("6a33"),a=i.n(s);for(var o in s)["default"].indexOf(o)<0&&function(e){i.d(t,e,(function(){return s[e]}))}(o);t["default"]=a.a},d5a9:function(e,t,i){"use strict";var s=i("1669"),a=i.n(s);a.a},db48:function(e,t,i){"use strict";(function(e,t){var s=i("47a9");i("7859");s(i("3240"));var a=s(i("4173"));e.__webpack_require_UNI_MP_PLUGIN__=i,t(a.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])}},[["db48","common/runtime","common/vendor"]]]);
|