爱简收旧衣按件回收前端代码仓库
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.

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