index.js 9.5 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/home/index"],{"2e8f":function(t,o,n){"use strict";n.r(o);var e=n("9351"),i=n.n(e);for(var c in e)["default"].indexOf(c)<0&&function(t){n.d(o,t,(function(){return e[t]}))}(c);o["default"]=i.a},4951:function(t,o,n){"use strict";n.d(o,"b",(function(){return i})),n.d(o,"c",(function(){return c})),n.d(o,"a",(function(){return e}));var e={zModal:function(){return n.e("components/z-modal/z-modal").then(n.bind(null,"f822"))}},i=function(){var t=this.$createElement,o=(this._self._c,this.menus.length);this.$mp.data=Object.assign({},{$root:{g0:o}})},c=[]},"495e":function(t,o,n){},"4c09":function(t,o,n){"use strict";(function(t,o){var e=n("47a9");n("2438");e(n("3240"));var i=e(n("ed49"));t.__webpack_require_UNI_MP_PLUGIN__=n,o(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},6601:function(t,o,n){"use strict";var e=n("495e"),i=n.n(e);i.a},9351:function(t,o,n){"use strict";(function(t){var e=n("47a9");Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var i,c=e(n("7ca3")),a=n("766ec"),r=n("87c4"),u=n("08b2"),s=n("7085"),l=e(n("4686")),d=n("6fb3"),h={components:{zModal:function(){n.e("components/z-modal/z-modal").then(function(){return resolve(n("f822"))}.bind(null,n)).catch(n.oe)},freeAudio:function(){n.e("components/chengpeng-audio/free-audio").then(function(){return resolve(n("39ea"))}.bind(null,n)).catch(n.oe)},Menu:function(){n.e("components/Menu").then(function(){return resolve(n("592d"))}.bind(null,n)).catch(n.oe)},HotProduct:function(){n.e("pages/home/components/HotProduct").then(function(){return resolve(n("4526"))}.bind(null,n)).catch(n.oe)},NewProduct:function(){n.e("pages/home/components/NewProduct").then(function(){return resolve(n("0372"))}.bind(null,n)).catch(n.oe)},TuiProduct:function(){Promise.all([n.e("common/vendor"),n.e("components/tuiProduct")]).then(function(){return resolve(n("be0c"))}.bind(null,n)).catch(n.oe)},courseView:function(){Promise.all([n.e("common/vendor"),n.e("pages/home/components/courseView")]).then(function(){return resolve(n("6691"))}.bind(null,n)).catch(n.oe)}},data:function(){return{btnGroup:[{text:"取消",color:"#FFFFFF",bgColor:"#999999",width:"150rpx",height:"80rpx",shape:"fillet",eventName:"cancle"},{text:"确定",color:"#FFFFFF",bgColor:"#2BC7B9",width:"150rpx",height:"80rpx",shape:"fillet",eventName:"sure"}],tuiModalControl:!1,activity:null,activityShow:!1,newProductList:[],hotProductList:[],tuiProductList:[],menus:[],canvas:[],allDoctorTitle:"全部医生",topLen:0,deptId:0,depts:[],docTab:1,top:0,cartCount:0,doctorOrderList:[],orderType:0,cateId:null,articleList:[],advList:[],doctorList:[],articleCateList:[],statusBarHeight:t.getStorageSync("menuInfo").statusBarHeight,tabBg:l.default,orderTypes:[{name:"全部",id:0},{name:"图文",id:1},{name:"语音",id:2}],messageShow:!0}},onLoad:function(o){if(null!=o.userCode&&(t.setStorageSync("userCode",o.userCode),this.utils.checkLoginState()&&this.getUserInfo()),o.hasOwnProperty("q")&&o.q){var n=decodeURIComponent(o.q);this.url=n;var e=this.utils.urlToObj(n);t.setStorageSync("userCode",e.userCode),this.utils.checkLoginState()&&this.getUserInfo()}this.getStoreActivity()},onUnload:function(){t.$emit("stop")},onHide:function(){t.$emit("stop")},onPageScroll:function(t){this.top=t.scrollTop},mounted:function(){},onShareAppMessage:function(t){return{title:"丝路佳选",path:"/pages/common/launch",imageUrl:"https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20250814/3687aa8663c7479d9d75c2d203cbaa72.jpg"}},onReachBottom:function(){console.log("onReachBottom"),this.$refs.tuiProduct.getTuiProducts()},onShareTimeline:function(t){return{title:"丝路佳选",query:"",imageUrl:"https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20250814/3687aa8663c7479d9d75c2d203cbaa72.jpg"}},computed:{bg:function(){var t=this.top/30;return"rgba(43,199,185, "+t+")"}},onShow:function(){this.getMenu(),this.getIndexData(),this.utils.checkLoginState()&&this.getCartCount(),this.getStoreConfig(),this.getCanvas()},methods:(i={navToMiniProgram:function(){t.navigateToMiniProgram({appId:"wxc3f0a952b7bc2b94",path:"/pages/common/launch",extraData:{},envVersion:"develop",success:function(t){},fail:function(t){}})},getUserInfo:function(){var o=this;(0,d.getUserInfo)().then((function(n){200==n.code?null!=n.user&&(null!=n.user.isPromoter&&0!=n.user.isPromoter||(o.tuiModalControl=!0)):t.showToast({icon:"none",title:"请求失败"})}),(function(t){}))},cancleTui:function(t){this.tuiModalControl=!1},submitTui:function(o){var n=this;if(console.log(o),null!=o.inputText&&""!=o.inputText){var e={userCode:o.inputText};(0,d.bindPromoter)(e).then((function(o){200==o.code?(t.showToast({icon:"none",title:o.msg}),n.tuiModalControl=!1):t.showToast({icon:"none",title:o.msg})}),(function(t){}))}else t.showToast({icon:"none",title:"请输入邀请码"})},bindload:function(t){},binderror:function(t){},closeActivity:function(){this.activityShow=!1},getStoreActivity:function(){var t=this;(0,a.getStoreActivity)({}).then((function(o){t.activity=o.activity,null!=t.activity?t.activityShow=!0:t.activityShow=!1}))},showActivity:function(){this.activityShow=!1,t.navigateTo({url:"/pages_shopping/shopping/activityDetails?activityId="+this.activity.activityId})},menuClick:function(o){1==o.linkType?"/pages/shopping/index"==o.linkUrl||"/pages/healthy/index"==o.linkUrl?t.switchTab({url:o.linkUrl}):t.navigateTo({url:o.linkUrl}):0==o.linkType&&t.showToast({icon:"none",title:"开发中..."})},goDev:function(){t.showToast({icon:"none",title:"开发中..."})},handleAdvClick:function(o){console.log(o),1==o.showType?(t.setStorageSync("url",o.advUrl),t.navigateTo({url:"h5"})):2==o.showType?t.navigateTo({url:o.advUrl}):3==o.showType&&(t.setStorageSync("content",o.content),t.navigateTo({url:"content"}))},deptChange:function(t){this.deptId=t.departmentId,this.getTuiDoctor()},getMenu:function(){var t=this;(0,u.getMenu)().then((function(o){console.log(o),200==o.code&&(t.menus=o.data)}))},getCanvas:function(){var t=this;(0,u.getCanvas)().then((function(o){200==o.code&&(console.log(o.data),t.canvas=JSON.parse(o.data.json))}))},getDepartmentList:function(){var o=this;this.depts=[],(0,r.getDepartmentList)().then((function(n){if(200==n.code){o.depts.push({departmentId:0,departmentName:"全部"}),o.depts=o.depts.concat(n.data)}else t.showToast({icon:"none",title:"请求失败"})}))},getTuiDoctor:function(){var o=this,n={departmentId:this.deptId,doctorType:this.docTab};(0,u.getTuiDoctor)(n).then((function(n){200==n.code?o.doctorList=n.data:t.showToast({icon:"none",title:"请求失败"})}),(function(t){}))},docTabChange:function(t){1==t&&(this.allDoctorTitle="全部医师"),2==t&&(this.allDoctorTitle="全部药师"),3==t&&(this.allDoctorTitle="全部营养师"),this.docTab=t,this.getTuiDoctor()},showImg:function(o){var n=o.split(",");t.previewImage({urls:n,current:n[0]})},getStoreConfig:function(){(0,s.getStoreConfig)().then((function(o){200==o.code&&t.setStorageSync("config",JSON.stringify(o.data))}),(function(t){}))},goAuthUrl:function(o){this.utils.isLogin().then((function(n){n&&t.navigateTo({url:o})}))},switchTo:function(o){t.switchTab({url:o})},navTo:function(o){t.navigateTo({url:o})},getLocation:function(){t.authorize({scope:"scope.userLocation",success:function(){t.getLocation({type:"gcj02",success:function(o){t.setStorageSync("isLocation",1),t.setStorageSync("lng",o.longitude),t.setStorageSync("lat",o.latitude)}})},fail:function(t){console.log(t)}})},getIndexData:function(){var o=this;(0,u.getIndexData)({}).then((function(n){200==n.code?(o.advList=n.data.advList,o.articleCateList=n.data.articleCateList,null!=o.articleCateList&&o.articleCateList.length>0&&(o.cateId=o.articleCateList[0].cateId,o.getTuiArticle()),o.tuiProductList=n.data.tuiProductList,o.newProductList=n.data.newProductList,o.hotProductList=n.data.hotProductList):t.showToast({icon:"none",title:"请求失败"})}),(function(t){}))},getCartCount:function(){var t=this;this.utils.isLogin().then((function(o){o&&(0,u.getCartCount)().then((function(o){200==o.code&&(t.cartCount=o.data)}),(function(t){}))}))},getTuiArticle:function(){var o=this,n={cateId:this.cateId};(0,u.getTuiArticle)(n).then((function(n){200==n.code?o.articleList=n.data:t.showToast({icon:"none",title:"请求失败"})}),(function(t){}))},getTuiDoctorOrder:function(){var o=this,n={orderType:this.orderType};(0,u.getTuiDoctorOrder)(n).then((function(n){200==n.code?o.doctorOrderList=n.data:t.showToast({icon:"none",title:"请求失败"})}),(function(t){}))},showArticle:function(o){t.navigateTo({url:"../healthy/detail?articleId="+o.articleId})},showProduct:function(o){t.navigateTo({url:"../shopping/productDetails?productId="+o.productId})},toSearch:function(){t.navigateTo({url:"./productSearch"})},articleCateChange:function(t){this.cateId=t.cateId,this.getTuiArticle()},orderTypeChange:function(t){this.orderType=t.id,console.log(this.orderType),this.getTuiDoctorOrder()},closeMsg:function(){this.messageShow=!1},viewAll:function(o){t.navigateTo({url:"/pages/home/"+o})},shopDoctor:function(o){console.log(o),t.navigateTo({url:"../doctor/doctorDetail?doctorId="+o.doctorId})},navgetTo:function(o){t.navigateTo({url:o})}},(0,c.default)(i,"switchTo",(function(o){t.switchTab({url:o})})),(0,c.default)(i,"openIm",(function(){t.navigateTo({url:"../doctor/doctorOrderIM?orderId=10"})})),i)};o.default=h}).call(this,n("df3c")["default"])},ed49:function(t,o,n){"use strict";n.r(o);var e=n("4951"),i=n("2e8f");for(var c in i)["default"].indexOf(c)<0&&function(t){n.d(o,t,(function(){return i[t]}))}(c);n("6601");var a=n("828b"),r=Object(a["a"])(i["default"],e["b"],e["c"],!1,null,null,null,!1,e["a"],void 0);o["default"]=r.exports}},[["4c09","common/runtime","common/vendor"]]]);