爱简收旧衣按件回收前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

334 lines
8.1 KiB

2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
1 month ago
1 month ago
2 months ago
1 month ago
2 months ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
2 months ago
1 month ago
2 months ago
2 months ago
1 month ago
1 month ago
1 month ago
2 months ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
1 month ago
2 months ago
  1. <template>
  2. <view class="faq-page">
  3. <!-- 顶部导航栏 -->
  4. <view class="nav-bar">
  5. <view class="back" @tap="navigateBack">
  6. <uni-icons type="left" size="20"></uni-icons>
  7. </view>
  8. <text class="title">联系客服</text>
  9. </view>
  10. <view class="main-content">
  11. <view class="content-card">
  12. <view class="qa-list">
  13. <view class="qa-item" v-for="(item, idx) in faqList" :key="idx">
  14. <view class="question-row">
  15. <text class="q-icon">Q</text>
  16. <text class="question">{{item.q}}</text>
  17. </view>
  18. <view class="answer">{{item.a}}</view>
  19. </view>
  20. </view>
  21. <view class="dashed-line"></view>
  22. <view class="bottom-tip">
  23. 如有任何问题或建议请随时与我们联系我们将竭诚为您服务
  24. </view>
  25. </view>
  26. </view>
  27. <!-- 底部按钮 -->
  28. <view class="bottom-btns">
  29. <button class="btn-outline" @tap="callService">客服电话</button>
  30. <button class="btn-gradient" @tap="openEmailPopup">联系在线客服</button>
  31. </view>
  32. <email-popup
  33. :show="showEmailPopup"
  34. @close="handleCloseEmailPopup"
  35. @copyEmail="copyEmail"
  36. />
  37. <!-- 客服电话底部弹窗 -->
  38. <view v-if="showPhonePopup" class="phone-popup">
  39. <view class="popup-mask" @tap="closePhonePopup"></view>
  40. <view class="popup-content">
  41. <view class="popup-header">
  42. <text class="close-btn" @tap="closePhonePopup">关闭</text>
  43. <text class="popup-title">客服电话</text>
  44. </view>
  45. <view class="popup-phone-row">
  46. <text class="popup-phone">{{phone}}</text>
  47. <view class="popup-phone-icon">
  48. <uni-icons type="phone-filled" size="28" color="#222" @tap="makePhoneCall"/>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import pullRefreshMixin from '@/pages/mixins/pullRefreshMixin.js'
  57. import emailPopup from '@/wxcomponents/email-popup/email-popup.vue'
  58. export default {
  59. mixins: [pullRefreshMixin],
  60. components: { emailPopup },
  61. data() {
  62. return {
  63. statusBarHeight: 0,
  64. navBarHeight: 0, // px
  65. navBarHeightRpx: 0, // rpx
  66. showEmailPopup: false,
  67. showPhonePopup: false,
  68. faqList: []
  69. }
  70. },
  71. onLoad() {
  72. const sysInfo = uni.getSystemInfoSync()
  73. this.statusBarHeight = sysInfo.statusBarHeight
  74. let navBarHeight = 24
  75. try {
  76. const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
  77. navBarHeight = menuButtonInfo.bottom + menuButtonInfo.top - sysInfo.statusBarHeight
  78. } catch (e) {}
  79. this.navBarHeight = navBarHeight
  80. // px转rpx(750设计稿)
  81. this.navBarHeightRpx = Math.round(navBarHeight * 750 / sysInfo.windowWidth)
  82. this.getQuestionList()
  83. },
  84. computed: {
  85. phone() {
  86. console.log(getApp().globalData.configData,'getApp().globalData.configData')
  87. const item = getApp().globalData.configData.find(i => i.keyName === 'phone')
  88. return item ? item.keyContent : ''
  89. },
  90. },
  91. methods: {
  92. async onRefresh() {
  93. // 模拟刷新数据
  94. await new Promise(resolve => setTimeout(resolve, 1000))
  95. uni.stopPullRefresh()
  96. },
  97. openEmailPopup() { this.showEmailPopup = true },
  98. handleCloseEmailPopup() { this.showEmailPopup = false },
  99. navigateBack() { uni.navigateBack() },
  100. callService() {
  101. // 打开客服电话弹窗
  102. this.showPhonePopup = true
  103. },
  104. closePhonePopup() {
  105. this.showPhonePopup = false
  106. },
  107. makePhoneCall() {
  108. // uni.makePhoneCall({ phoneNumber: '0731-599327-8899' })
  109. if (this.phone) {
  110. uni.makePhoneCall({
  111. phoneNumber: this.phone //仅为示例
  112. });
  113. }else{
  114. uni.showToast({ title: '暂无客服电话', icon: 'none' });
  115. }
  116. },
  117. copyEmail(){
  118. if (this.phone) {
  119. uni.makePhoneCall({
  120. phoneNumber: this.phone //仅为示例
  121. });
  122. }else{
  123. uni.showToast({ title: '暂无微信客服', icon: 'none' });
  124. }
  125. },
  126. getQuestionList() {
  127. this.$api('getQuestionList', {}, res => {
  128. if (res && res.success && res.result && res.result.records) {
  129. this.faqList = res.result.records.map(item => ({
  130. q: item.title,
  131. a: item.titleText
  132. }))
  133. }
  134. })
  135. }
  136. }
  137. }
  138. </script>
  139. <style lang="scss" scoped>
  140. .faq-page {
  141. min-height: 100vh;
  142. background: linear-gradient(180deg, #fff3db 0%, #ffffff 100%);
  143. padding-bottom: env(safe-area-inset-bottom);
  144. }
  145. .nav-bar {
  146. display: flex;
  147. align-items: center;
  148. height: calc(150rpx + var(--status-bar-height));
  149. padding: 0 32rpx;
  150. padding-top: var(--status-bar-height);
  151. background: linear-gradient(180deg, #fff3db 100%, #ffffff 0%);
  152. position: fixed;
  153. top: 0;
  154. left: 0;
  155. right: 0;
  156. z-index: 999;
  157. box-sizing: border-box;
  158. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
  159. .back {
  160. padding: 20rpx;
  161. margin-left: -20rpx;
  162. }
  163. .title {
  164. flex: 1;
  165. text-align: center;
  166. font-size: 34rpx;
  167. font-weight: 500;
  168. color: #222;
  169. }
  170. }
  171. .main-content {
  172. margin-top: calc(150rpx + var(--status-bar-height));
  173. margin-bottom: 40rpx;
  174. padding-bottom: calc(88rpx + env(safe-area-inset-bottom));
  175. }
  176. .content-card {
  177. margin: 0 32rpx;
  178. padding: 32rpx;
  179. background: #fff;
  180. border-radius: 32rpx;
  181. box-shadow: 0 8rpx 32rpx rgba(60, 167, 250, 0.08);
  182. }
  183. .qa-list {
  184. padding: 0 36rpx;
  185. }
  186. .qa-item {
  187. margin-bottom: 36rpx;
  188. }
  189. .question-row {
  190. display: flex;
  191. align-items: center;
  192. margin-bottom: 8rpx;
  193. }
  194. .q-icon {
  195. color: #ffb300;
  196. font-size: 32rpx;
  197. font-weight: bold;
  198. margin-right: 12rpx;
  199. }
  200. .question {
  201. font-size: 32rpx;
  202. font-weight: bold;
  203. color: #222;
  204. }
  205. .answer {
  206. font-size: 26rpx;
  207. color: #999;
  208. line-height: 1.7;
  209. padding-left: 44rpx;
  210. }
  211. .dashed-line {
  212. border-bottom: 2rpx dashed #e5e5e5;
  213. margin: 24rpx 36rpx 0 36rpx;
  214. }
  215. .bottom-tip {
  216. font-size: 24rpx;
  217. color: #999;
  218. text-align: left;
  219. line-height: 1.6;
  220. padding: 32rpx 36rpx 0 36rpx;
  221. }
  222. .bottom-btns {
  223. position: fixed;
  224. left: 0;
  225. right: 0;
  226. bottom: 0;
  227. z-index: 101;
  228. display: flex;
  229. justify-content: center;
  230. align-items: center;
  231. gap: 32rpx;
  232. padding: 24rpx 36rpx calc(24rpx + env(safe-area-inset-bottom)) 36rpx;
  233. background: #fff;
  234. box-shadow: 0 -2rpx 12rpx rgba(0,0,0,0.03);
  235. }
  236. .btn-outline {
  237. flex: 1;
  238. height: 88rpx;
  239. line-height: 88rpx;
  240. background: #fff0d2;
  241. color: #ffb300;
  242. font-size: 32rpx;
  243. border-radius: 44rpx;
  244. border: 2rpx solid #ffb300;
  245. margin-right: 0;
  246. }
  247. .btn-gradient {
  248. flex: 1;
  249. height: 88rpx;
  250. line-height: 88rpx;
  251. background: linear-gradient(90deg, #ffdf8c 0%, #ffb300 100%);
  252. color: #fff;
  253. font-size: 32rpx;
  254. border-radius: 44rpx;
  255. border: none;
  256. margin-left: 0;
  257. }
  258. .phone-popup {
  259. position: fixed;
  260. left: 0; right: 0; bottom: 0; top: 0;
  261. z-index: 9999;
  262. display: flex;
  263. align-items: flex-end;
  264. justify-content: center;
  265. .popup-mask {
  266. position: absolute;
  267. left: 0; right: 0; top: 0; bottom: 0;
  268. background: rgba(0,0,0,0.7);
  269. z-index: 0;
  270. }
  271. .popup-content {
  272. position: relative;
  273. width: 100vw;
  274. background: #fff;
  275. border-radius: 24rpx 24rpx 0 0;
  276. box-shadow: 0 -4rpx 32rpx rgba(0,0,0,0.08);
  277. padding-bottom: env(safe-area-inset-bottom);
  278. animation: popupUp 0.2s;
  279. }
  280. @keyframes popupUp {
  281. from { transform: translateY(100%); }
  282. to { transform: translateY(0); }
  283. }
  284. .popup-header {
  285. display: flex;
  286. align-items: center;
  287. justify-content: center;
  288. height: 56px;
  289. border-bottom: 1px solid #f2f2f2;
  290. position: relative;
  291. .close-btn {
  292. position: absolute;
  293. left: 24px;
  294. font-size: 17px;
  295. color: #999;
  296. }
  297. .popup-title {
  298. font-size: 18px;
  299. color: #222;
  300. font-weight: 600;
  301. letter-spacing: 1px;
  302. }
  303. }
  304. .popup-phone-row {
  305. display: flex;
  306. align-items: center;
  307. justify-content: center;
  308. padding: 40px 0 32px 0;
  309. .popup-phone {
  310. font-size: 24px;
  311. color: #222;
  312. font-weight: 400;
  313. letter-spacing: 1px;
  314. margin-right: 18px;
  315. }
  316. .popup-phone-icon {
  317. width: 44px;
  318. height: 44px;
  319. background: #f5f5f5;
  320. border-radius: 50%;
  321. display: flex;
  322. align-items: center;
  323. justify-content: center;
  324. }
  325. }
  326. }
  327. </style>