consultCard.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <Theme>
  3. <view
  4. class="consult-card__wrap"
  5. :style="{
  6. background: props.background,
  7. ...props.styles,
  8. }"
  9. >
  10. <view class="consult-card__body">
  11. <view class="consult-card__avatar">
  12. <image src="@/static/chat/consult_avatar.png" mode="widthFix"></image>
  13. </view>
  14. <view class="consult-card__title">
  15. <text>{{ $t("VAVABUY专属官方客服") }}</text>
  16. </view>
  17. <!-- <view class="consult-card__label" @click="showModal">
  18. <text>{{ $t("付费咨询") }}?</text>
  19. <text class="consult-card__label--underline"></text>
  20. </view> -->
  21. </view>
  22. <view class="consult-card__bg">
  23. <image src="@/static/chat/consult_bg_2.png" mode="widthFix"></image>
  24. </view>
  25. </view>
  26. <Popup
  27. ref="tipPopupRef"
  28. mode="center"
  29. class="consult_pay_tip_popup"
  30. title="服务说明"
  31. >
  32. <template #content>
  33. <view class="consult_pay_body">
  34. <view
  35. class="consult_pay_content"
  36. v-html="$t('page.user_chat.tipPopupContentForPay')"
  37. ></view>
  38. </view>
  39. </template>
  40. <template #footer>
  41. <view class="consult_pay_footer">
  42. <view class="consult_pay_footer-btn" @click="onClose">{{
  43. $t("取消")
  44. }}</view>
  45. <view
  46. class="consult_pay_footer-btn consult_pay_footer-btn__confirm"
  47. @click="onConfirm"
  48. >{{ $t("支付") }}</view
  49. >
  50. </view>
  51. </template>
  52. </Popup>
  53. </Theme>
  54. </template>
  55. <script setup>
  56. import { ref, inject } from "vue";
  57. import { storeToRefs } from "pinia";
  58. import { Modal } from "@/utils";
  59. import Popup from "@/components/popup.vue";
  60. import { useMessageStore } from "@/store";
  61. const props = defineProps({
  62. background: {
  63. type: String,
  64. default: "transparent",
  65. },
  66. styles: {
  67. type: Object,
  68. default() {
  69. return {};
  70. },
  71. },
  72. });
  73. const channelID = inject("channel");
  74. const tipPopupRef = ref(null);
  75. function showModal() {
  76. tipPopupRef.value && tipPopupRef.value.open();
  77. }
  78. function onClose() {
  79. tipPopupRef.value && tipPopupRef.value.close();
  80. }
  81. function onConfirm() {
  82. uni.navigateTo({
  83. url: `/pages/shop/payment?type=service&oid=${channelID.value}`,
  84. });
  85. tipPopupRef.value && tipPopupRef.value.close();
  86. }
  87. </script>
  88. <style lang="less" scoped>
  89. .consult-card__wrap {
  90. --top: 80rpx;
  91. --top-up: -80rpx;
  92. }
  93. .consult-card__wrap {
  94. padding-top: var(--top);
  95. position: relative;
  96. background-color: transparent;
  97. }
  98. .consult-card__body {
  99. width: 100%;
  100. position: absolute;
  101. top: 0;
  102. left: 50%;
  103. transform: translateX(-50%);
  104. z-index: 1;
  105. display: flex;
  106. flex-direction: column;
  107. align-items: center;
  108. .consult-card__avatar {
  109. overflow: hidden;
  110. width: 120rpx;
  111. height: 120rpx;
  112. border-radius: 50%;
  113. image {
  114. width: 100%;
  115. height: 100%;
  116. }
  117. }
  118. .consult-card__title {
  119. margin: 16rpx 0 8rpx;
  120. // color: #FFE8D5;
  121. font-size: 28rpx;
  122. font-weight: 500;
  123. background: linear-gradient(180deg, #ffe8d5 0%, #d7a16c 100%);
  124. -webkit-background-clip: text;
  125. background-clip: text;
  126. -webkit-text-fill-color: transparent;
  127. color: transparent;
  128. text-align: center;
  129. }
  130. .consult-card__label {
  131. display: flex;
  132. flex-direction: column;
  133. align-items: center;
  134. background: linear-gradient(180deg, #ffe8d5 0%, #d7a16c 100%);
  135. -webkit-background-clip: text;
  136. background-clip: text;
  137. -webkit-text-fill-color: transparent;
  138. color: transparent;
  139. text-decoration: underline;
  140. font-size: 24rpx;
  141. font-weight: 500;
  142. .consult-card__label--underline {
  143. width: 100%;
  144. height: 2rpx;
  145. background: linear-gradient(180deg, #ffe8d5 0%, #d7a16c 100%);
  146. }
  147. }
  148. }
  149. .consult-card__bg {
  150. overflow: hidden;
  151. width: 100%;
  152. height: auto;
  153. border-radius: 20rpx;
  154. image {
  155. width: 100%;
  156. }
  157. }
  158. .consult_pay_content {
  159. text-indent: 2em;
  160. // text-align: justify;
  161. line-height: 1.4;
  162. }
  163. .consult_pay_footer {
  164. display: flex;
  165. justify-content: space-around;
  166. .consult_pay_footer-btn {
  167. padding: 12rpx 46rpx;
  168. border: 1rpx solid #333;
  169. border-radius: 12rpx;
  170. }
  171. .consult_pay_footer-btn__confirm {
  172. background-color: var(--black);
  173. color: var(--light);
  174. }
  175. }
  176. </style>
  177. <style lang="less" scoped>
  178. .consult_pay_tip_popup :deep(.u-popup__content) {
  179. width: 85%;
  180. }
  181. .consult_pay_tip_popup :deep(.pop .top) {
  182. justify-content: center;
  183. }
  184. </style>