index.vue 7.2 KB

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