common.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import {statics} from '../statics.js';
  2. import {mapState} from 'vuex';
  3. export const common = {
  4. data(){
  5. return {
  6. statics:statics
  7. }
  8. },
  9. computed:{
  10. ...mapState({
  11. tempColor:state => state.template.tempColor,
  12. tempColorRgb:state => state.template.tempColorRbg,
  13. memberToken:state => state.member.mToken,
  14. latLng:state => state.location.location,
  15. memberInfo:state => state.member.member,
  16. adviserId:state => state.member.adviserId,//推广的顾问员
  17. parentId:state => state.member.parentId, //父推广员ID
  18. mendianSelectId:state => state.location.mendianSelectId, //当前的门店ID
  19. memdianLists:state => state.location.memdianLists
  20. }),
  21. checkLogin(){ //验证是否登录
  22. if(this.memberToken === null) return false;
  23. if(this.memberInfo == null) return false;
  24. if(!this.memberInfo.member_id) return false;
  25. return true;
  26. },
  27. getBtnStyle(){
  28. let style = 'background:'+this.tempColor+';color:#ffffff;';
  29. style+="box-shadow: 0px "+uni.upx2px(8)+"px "+uni.upx2px(32)+"px -"+uni.upx2px(8)+"px rgba("+this.tempColorRgb.r+", "+this.tempColorRgb.g+", "+this.tempColorRgb.b+", 0.3);";
  30. return style;
  31. },
  32. getBtnDisStyle(){
  33. let style = 'background:#F0F1F5;color:#AEB2C1;';
  34. return style;
  35. },
  36. getTagStyle(){
  37. let style = "background:rgba("+this.tempColorRgb.r+", "+this.tempColorRgb.g+", "+this.tempColorRgb.b+", 0.08);";
  38. style+='color:'+this.tempColor + ';';
  39. return style;
  40. },
  41. getBtnPlanStyle(){
  42. let style = 'border: 1px solid '+this.tempColor+';';
  43. style+='color:'+this.tempColor+';';
  44. return style;
  45. }
  46. },
  47. methods:{
  48. },
  49. }