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

318 lines
7.6 KiB

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