branddetails.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view class="pages">
  3. <u-navbar
  4. title="品牌详情"
  5. :placeholder="true"
  6. :autoBack="false"
  7. @leftClick="leftClick"
  8. :safeAreaInsetTop="true"
  9. >
  10. </u-navbar>
  11. <u-loading-page :loading="loadingPage" bgColor="#f1f1f1"></u-loading-page>
  12. <view class="page-wrap">
  13. <u--image :showLoading="true" :src="details.faceImg" width="100%" height="480rpx" radius="8rpx" bgColor="#fff"></u--image>
  14. <view class="base-info u-flex u-row-between">
  15. <view class="left u-flex">
  16. <u-avatar :src="details.logo" size="145rpx"></u-avatar>
  17. <view class="text">
  18. <view class="name u-line-1">{{details.name}}</view>
  19. <view class="typeName"> <text class="type">{{details.typeName}}</text> </view>
  20. <view class="businessTime">营业时间:{{details.businessTime}}</view>
  21. </view>
  22. </view>
  23. <view class="right u-flex u-row-center" @click="makePhoneCall">
  24. <u-icon :customStyle="{'margin-right': '3rpx'}" name="phone" color="#fff" size="34rpx"></u-icon>
  25. 拨打
  26. </view>
  27. </view>
  28. <view class="remark">
  29. <view class="title">品牌简介</view>
  30. <view class="content">
  31. <u-parse :content="details.brandRemark"></u-parse>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {
  41. staticUrl:this.$commonConfig.staticUrl,
  42. id:'',
  43. loadingPage:true,
  44. details:{}
  45. }
  46. },
  47. onShow() {
  48. },
  49. onLoad(page) {
  50. this.id = page.id;
  51. this.getDetails(this.id);
  52. },
  53. methods: {
  54. leftClick(e){
  55. let pages = getCurrentPages();
  56. if(pages.length==1){
  57. uni.$u.route('/pages/index/index')
  58. }else{
  59. uni.navigateBack()
  60. };
  61. },
  62. getDetails(id){
  63. this.$u.api.brandInfo({id:id}).then(res=>{
  64. this.loadingPage = false;
  65. // console.log('res',res.data);
  66. this.details = res.data;
  67. }).catch(err=>{
  68. console.log('getDetails',err.data);
  69. })
  70. },
  71. makePhoneCall(){
  72. if(!this.details.contactTel){
  73. uni.showToast({
  74. title:'电话号码为空',
  75. icon:"none"
  76. })
  77. return
  78. }
  79. uni.makePhoneCall({
  80. phoneNumber: this.details.contactTel,
  81. success() {
  82. console.log('success');
  83. },
  84. fail() {
  85. console.log('fail');
  86. }
  87. });
  88. }
  89. }
  90. }
  91. </script>
  92. <style>
  93. page{
  94. background-color: #F5F5F5;
  95. }
  96. </style>
  97. <style lang="scss" scoped>
  98. .base-info{
  99. padding: 30rpx;
  100. background-color: #fff;
  101. margin-bottom: 20rpx;
  102. border-radius: 4rpx;
  103. .left{
  104. flex: 1;
  105. .text{
  106. margin-left: 20rpx;
  107. font-size: 22rpx;
  108. color: #999999;
  109. line-height: 30rpx;
  110. .name{
  111. font-size: 30rpx;
  112. font-weight: 600;
  113. color: #333333;
  114. line-height: 42rpx;
  115. margin-bottom: 20rpx;
  116. }
  117. .typeName{
  118. margin-bottom: 20rpx;
  119. .type{
  120. background: rgba(0,164,71,0.1);
  121. border-radius: 4rpx;
  122. font-size: 24rpx;
  123. color: #00A447;
  124. padding: 8rpx 16rpx;
  125. margin-left: 0;
  126. }
  127. }
  128. }
  129. }
  130. .right{
  131. width: 164rpx;
  132. height: 64rpx;
  133. background: linear-gradient(180deg, #00DC84 0%, #00A447 100%);
  134. border-radius: 32rpx;
  135. text-align: center;
  136. font-size: 28rpx;
  137. font-weight: 500;
  138. color: #FFFFFF;
  139. }
  140. }
  141. .remark{
  142. padding: 20rpx;
  143. background-color: #fff;
  144. margin-bottom: 20rpx;
  145. border-radius: 4rpx;
  146. .title{
  147. font-size: 32rpx;
  148. font-weight: 600;
  149. color: #333333;
  150. line-height: 50rpx;
  151. margin-bottom: 10rpx;
  152. }
  153. .content{
  154. font-size: 30rpx;
  155. font-weight: 400;
  156. color: #666666;
  157. line-height: 44rpx;
  158. }
  159. }
  160. </style>