company.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view>
  3. <image :src="companyImg" mode="widthFix" style="width: 100%"></image>
  4. </view>
  5. </template>
  6. <script>
  7. const util = require('../../../utils/util.js');
  8. const api = require('../../../config/api.js');
  9. //获取应用实例
  10. const app = getApp();
  11. export default {
  12. data() {
  13. return {
  14. companyImg:'https://mall.zhaijieshi.cc/file/jzmall/zhaie.jpg',
  15. randomNum: (Math.random() * 100000000).toFixed(0),
  16. name: 'o2o商城',
  17. address: '',
  18. latitude: '31.201900',
  19. longitude: '121.587839',
  20. phone: '4009208718',
  21. qq: ''
  22. };
  23. }
  24. /**
  25. * 生命周期函数--监听页面加载
  26. */,
  27. onLoad: function (options) {
  28. let yunjia= api.checkYunJia();
  29. if(yunjia){
  30. this.companyImg='https://mall.zhaijieshi.cc/file/jzmall/yunjia.jpg?t='+(Math.random() * 100000000).toFixed(0)
  31. }else{
  32. this.companyImg='https://mall.zhaijieshi.cc/file/jzmall/zhaie.jpg?t='+(Math.random() * 100000000).toFixed(0)
  33. }
  34. },
  35. methods: {
  36. getAbout: function () {
  37. let that = this;
  38. util.request(api.AboutUrl).then(function (res) {
  39. if (res.errno === 0) {
  40. that.setData({
  41. name: res.data.name,
  42. address: res.data.address,
  43. phone: res.data.phone,
  44. qq: res.data.qq,
  45. latitude: res.data.latitude,
  46. longitude: res.data.longitude
  47. });
  48. }
  49. });
  50. },
  51. showLocation: function (e) {
  52. var that = this;
  53. uni.openLocation({
  54. latitude: parseFloat(that.latitude),
  55. longitude: parseFloat(that.longitude),
  56. name: that.name,
  57. address: that.address
  58. });
  59. },
  60. callPhone: function (e) {
  61. var that = this;
  62. uni.makePhoneCall({
  63. phoneNumber: that.phone
  64. });
  65. }
  66. }
  67. };
  68. </script>
  69. <style>
  70. /* about.ttss */
  71. .label {
  72. font-size: 26rpx;
  73. margin-left: 20rpx;
  74. padding: 10rpx 0;
  75. }
  76. .about-item {
  77. background: white;
  78. border-top: solid #f2f2f2 0.5rpx;
  79. border-bottom: solid #f2f2f2 0.5rpx;
  80. width: 100%;
  81. height: 100rpx;
  82. display: flex;
  83. flex-direction: row;
  84. justify-content: space-between;
  85. }
  86. .item-left {
  87. font-size: 24rpx;
  88. margin-left: 40rpx;
  89. margin-top: auto;
  90. margin-bottom: auto;
  91. }
  92. .item-right {
  93. margin-right: 15rpx;
  94. margin-top: auto;
  95. margin-bottom: auto;
  96. }
  97. .right-icon {
  98. width: 40rpx;
  99. height: 40rpx;
  100. }
  101. </style>