index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <template>
  2. <view class="">
  3. <view class="fixed" v-if="consultMobile.consultationStatus == 1">
  4. <view class="we_t" v-if="show">
  5. <view class="child" v-if="consultMobile.serviceHotlineStatus == 1">
  6. <img src="https://file.gdzckj.net/web/static/img/icon/servers.png" alt=""
  7. @click="activeIn == 1 ? activeIn = 0 : activeIn = 1">
  8. <text class="text" @click="activeIn == 1 ? activeIn = 0 : activeIn = 1">热线</text>
  9. <view class="fix" v-if="activeIn == 1">
  10. <view style="font-weight: bold;">
  11. 服务时间
  12. </view>
  13. <view style="margin:14rpx;font-size: 26rpx;white-space: nowrap;color: #AAAAAA;">
  14. {{consultMobile.servicingTime}}
  15. </view>
  16. <view style="font-weight: bold;line-height: 46rpx;white-space: pre-wrap;"
  17. @click="copy(consultMobile.serviceNumber)">
  18. {{consultMobile.serviceNumber}}
  19. </view>
  20. </view>
  21. </view>
  22. <view class="child" v-if="consultMobile.serviceWechatStatus == 1">
  23. <img src="https://file.gdzckj.net/web/static/img/icon/wechat.png" alt=""
  24. @click="activeIn == 2 ? activeIn = 0 : activeIn = 2">
  25. <text class="text" @click="activeIn == 2 ? activeIn = 0 : activeIn = 2">微信</text>
  26. <view class="fix" v-if="activeIn == 2">
  27. <img style="width:260rpx;height:260rpx;"
  28. :src="$method.splitImgHost(consultMobile.serviceWechatImg)" alt="">
  29. <view style="margin-top:10rpx;text-align:center;font-weight: bold;font-size: 30rpx;"
  30. @click="copy(consultMobile.serviceWechatNumber)">
  31. 微信号:{{consultMobile.serviceWechatNumber}}
  32. </view>
  33. </view>
  34. </view>
  35. <view class="child" v-if="consultMobile.shoppingCarStatus == 1 && $method.isLogin()"
  36. @click="jumpShopCar">
  37. <img src="https://file.gdzckj.net/web/static/img/icon/shoppingCar.png" alt="" @click="activeIn = 0">
  38. <text class="text" @click="activeIn =0">购物车</text>
  39. <view class="fix_car" v-if="false">
  40. {{shoppingNum > 99 ?'99+':shoppingNum}}
  41. </view>
  42. </view>
  43. <view class="child" @click="show = !show">
  44. <img src="https://file.gdzckj.net/web/static/img/icon/close.png" alt="" @click="activeIn =0">
  45. </view>
  46. </view>
  47. <view class="we_l" v-if="!show" @click="show = !show">
  48. <img src="https://file.gdzckj.net/web/static/img/icon/we.png" alt="" @click="activeIn = 0">
  49. </view>
  50. <view class="up" @click="backTop" :class="backTopBtn ? '':'hideBtn'">
  51. <img src="https://file.gdzckj.net/web/static/img/icon/backTop.png" alt="">
  52. </view>
  53. </view>
  54. <u-tabbar v-model="current" :before-switch="beforeSwitch" :list="list" @change="change" active-color="#007aff"
  55. :height="Headers"></u-tabbar>
  56. </view>
  57. </template>
  58. <script>
  59. import config from "@/common/config";
  60. import {
  61. mapGetters,
  62. } from "vuex";
  63. export default {
  64. name: "myTabbar",
  65. options: {
  66. styleIsolation: "shared"
  67. },
  68. props: {
  69. backTopBtn: {
  70. type: Boolean,
  71. default: () => {
  72. return false
  73. }
  74. }
  75. },
  76. data() {
  77. return {
  78. activeIn: 0,
  79. show: false,
  80. list: [{
  81. pagePath: "/pages/index/index",
  82. iconPath: require("@/static/modIcon/home-1.png"),
  83. selectedIconPath: require("@/static/modIcon/home.png"),
  84. text: "首页",
  85. },
  86. {
  87. pagePath: "/pages/course/index",
  88. iconPath: require("@/static/modIcon/choose-1.png"),
  89. selectedIconPath: require("@/static/modIcon/choose.png"),
  90. text: "选购",
  91. },
  92. {
  93. pagePath: "/pages/learn/index",
  94. iconPath: require("@/static/modIcon/study-1.png"),
  95. selectedIconPath: require("@/static/modIcon/study.png"),
  96. text: "学习",
  97. },
  98. {
  99. pagePath: "/pages/questionBank/index",
  100. iconPath: require("@/static/modIcon/practice-1.png"),
  101. selectedIconPath: require("@/static/modIcon/practice.png"),
  102. text: "练习",
  103. },
  104. // {
  105. // pagePath: "/pages/information/index",
  106. // iconPath: config.BASE_IMG_URL + "/web/icon/nav4.png",
  107. // selectedIconPath: config.BASE_IMG_URL + "/web/icon/nav4_on.png",
  108. // text: "资料",
  109. // },
  110. {
  111. pagePath: "/pages/wd/index",
  112. iconPath: require("@/static/modIcon/my-1.png"),
  113. selectedIconPath: require("@/static/modIcon/my.png"),
  114. text: "我的",
  115. },
  116. ],
  117. current: 0,
  118. Headers: "100rpx"
  119. };
  120. },
  121. computed: {
  122. ...mapGetters(["consultMobile", "shoppingNum"]),
  123. },
  124. mounted() {},
  125. onShow() {},
  126. methods: {
  127. backTop() {
  128. const pages = getCurrentPages();
  129. const currentPage = pages[pages.length - 1];
  130. const currentRoute = currentPage.route;
  131. if (currentRoute.includes('pages/course/index')) {
  132. uni.$emit('backTop', 1)
  133. } else {
  134. uni.pageScrollTo({
  135. scrollTop: 0,
  136. duration: 300
  137. });
  138. }
  139. },
  140. jumpShopCar() {
  141. uni.navigateTo({
  142. url: "/pages4/shopping/shoppingCart",
  143. });
  144. this.activeIn = 0
  145. },
  146. beforeSwitch(index) {
  147. return true; // 或者根据逻辑返回false
  148. },
  149. change(index) {
  150. this.current = index
  151. this.show = false
  152. // if (index === 4) {
  153. // this.toInformation();
  154. // }
  155. },
  156. toInformation() {
  157. uni.reLaunch({
  158. url: "/pages/information/index",
  159. });
  160. },
  161. copy(text) {
  162. uni.setClipboardData({
  163. data: text
  164. });
  165. }
  166. },
  167. };
  168. </script>
  169. <style lang="scss">
  170. .u-tabbar {
  171. ::v-deep &__content {
  172. z-index: 10000 !important;
  173. }
  174. }
  175. .fixed {
  176. position: fixed;
  177. right: 20rpx;
  178. display: flex;
  179. flex-direction: column;
  180. justify-content: end;
  181. bottom: 20vh;
  182. .we {
  183. // background-color: #007aff;
  184. // border-radius: 50%;
  185. // width: 80rpx;
  186. // height: 80rpx;
  187. // display: flex;
  188. // align-items: center;
  189. // justify-content: center;
  190. // margin-bottom: 20rpx;
  191. // img {
  192. // width: 40rpx;
  193. // height: 40rpx;
  194. // }
  195. .we_children {
  196. background-color: #007aff;
  197. border-radius: 50%;
  198. width: 80rpx;
  199. height: 80rpx;
  200. display: flex;
  201. flex-direction: column;
  202. align-items: center;
  203. justify-content: center;
  204. &:last-child {
  205. margin-bottom: 20rpx;
  206. }
  207. img {
  208. width: 40rpx;
  209. height: 40rpx;
  210. }
  211. }
  212. .we_children_show {
  213. visibility: hidden;
  214. }
  215. }
  216. .we_sty {
  217. background-color: #007aff;
  218. border-radius: 50px;
  219. }
  220. .we_t {
  221. border-radius: 50px;
  222. background-color: #007aff;
  223. padding: 10rpx 0rpx;
  224. .child {
  225. display: flex;
  226. flex-direction: column;
  227. justify-content: center;
  228. align-items: center;
  229. padding: 14rpx 0rpx;
  230. position: relative;
  231. img {
  232. width: 40rpx;
  233. height: 40rpx;
  234. margin-bottom: 6rpx;
  235. }
  236. .text {
  237. color: #fff;
  238. font-size: 22rpx;
  239. }
  240. .fix {
  241. box-shadow: 0rpx 0rpx 20rpx 11rpx rgba(0, 0, 0, 0.2);
  242. position: absolute;
  243. top: 0rpx;
  244. right: 110%;
  245. padding: 26rpx;
  246. border-radius: 8px;
  247. background-color: #fff;
  248. }
  249. .fix_car {
  250. position: absolute;
  251. top: 0rpx;
  252. right: 0rpx;
  253. padding: 0rpx 8rpx;
  254. border-radius: 100px;
  255. color: #fff;
  256. font-size: 20rpx;
  257. background-color: #f56c6c;
  258. }
  259. }
  260. }
  261. .we_l {
  262. background-color: #007aff;
  263. border-radius: 50%;
  264. width: 90rpx;
  265. height: 90rpx;
  266. display: flex;
  267. align-items: center;
  268. justify-content: center;
  269. img {
  270. width: 40rpx;
  271. height: 40rpx;
  272. }
  273. }
  274. .up {
  275. background-color: #007aff;
  276. border-radius: 50%;
  277. width: 90rpx;
  278. height: 90rpx;
  279. display: flex;
  280. align-items: center;
  281. justify-content: center;
  282. margin-top: 20rpx;
  283. img {
  284. width: 40rpx;
  285. height: 40rpx;
  286. }
  287. }
  288. }
  289. .hideBtn{
  290. visibility: hidden;
  291. }
  292. </style>