kj-tabbar.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <view id="tabber" style="position: fixed; z-index: 1000; bottom: 0">
  3. <view class="bottom u-flex u-row-between" v-if="value1 == 3">
  4. <view class="u-flex">
  5. <u-checkbox-group v-model="all" placement="column" @change="checkAll">
  6. <u-checkbox
  7. shape="circle"
  8. :name="i18n.selectall"
  9. activeColor="#F83224"
  10. >
  11. </u-checkbox>
  12. </u-checkbox-group>
  13. <text class="all">{{ i18n.selectall }}</text>
  14. </view>
  15. <view v-if="success == false" class="dle">
  16. {{ i18n.delete }}
  17. </view>
  18. <view class="u-flex" v-else>
  19. <view class="">
  20. <text class="allweight">{{ i18n.Grossweight }} </text>
  21. <text class="allweight"> {{ goodsWeight }}kg,</text>
  22. <text class="sum">{{ i18n.total }}:</text>
  23. <text class="summon">¥</text>
  24. <text class="summon" style="font-size: 36rpx">{{ goodsPrice }}</text>
  25. <text class="summon">.34</text>
  26. </view>
  27. <view class="settle" @click="account">{{ i18n.GotoResult }}</view>
  28. </view>
  29. </view>
  30. <u-tabbar
  31. :list="list"
  32. active-color="#F83224"
  33. inactive-color="#333"
  34. :value="value1"
  35. >
  36. <u-tabbar-item
  37. :text="item.text"
  38. v-for="(item, idx) in list"
  39. @click="click1"
  40. :key="idx"
  41. >
  42. <image
  43. style="width: 40rpx; height: 40rpx"
  44. class="u-page__item__slot-icon"
  45. slot="inactive-icon"
  46. :src="item.iconPath"
  47. ></image>
  48. <image
  49. style="width: 40rpx; height: 40rpx"
  50. class="u-page__item__slot-icon"
  51. slot="active-icon"
  52. :src="item.selectedIconPath"
  53. ></image>
  54. </u-tabbar-item>
  55. </u-tabbar>
  56. </view>
  57. </template>
  58. <script>
  59. import { mapState } from "vuex";
  60. export default {
  61. name: "kj-tabbar",
  62. props: {
  63. value1: {
  64. type: Number,
  65. default: 0,
  66. },
  67. goodsWeight: {
  68. type: Number,
  69. default: 0,
  70. },
  71. goodsPrice: {
  72. type: Number,
  73. default: 0,
  74. },
  75. },
  76. computed: {
  77. i18n() {
  78. return this.$t("index");
  79. },
  80. },
  81. data() {
  82. return {
  83. success: true,
  84. list: [
  85. {
  86. iconPath: "../../static/express1.png",
  87. selectedIconPath: "../../static/express2.png",
  88. text: "跨境速递",
  89. pagePath: "pages/express/express",
  90. },
  91. {
  92. iconPath: "../../static/index1.png",
  93. selectedIconPath: "../../static/index2.png",
  94. text: "商城",
  95. pagePath: "pages/index/index",
  96. },
  97. {
  98. iconPath: "../../static/shop.png",
  99. selectedIconPath: "../../static/shop.png",
  100. text: "购",
  101. pagePath: "pages/shopping/shopping",
  102. },
  103. {
  104. iconPath: "../../static/cart1.png",
  105. selectedIconPath: "../../static/cart2.png",
  106. text: "购物车",
  107. pagePath: "pages/cart/cart",
  108. },
  109. {
  110. iconPath: "../../static/mine1.png",
  111. selectedIconPath: "../../static/mine2.png",
  112. text: "我的",
  113. pagePath: "pages/mine/mine",
  114. },
  115. ],
  116. all: [],
  117. };
  118. },
  119. created() {
  120. // if (uni.getStorageSync('tabbar')!=1) {
  121. // this.value1 = uni.getStorageSync('tabbar')
  122. // }
  123. // const dom = uni.createSelectorQuery("#tabber")
  124. },
  125. methods: {
  126. account() {
  127. uni.navigateTo({
  128. url: "/pageA/order",
  129. });
  130. },
  131. getLabelHeight() {
  132. const dom = uni.createSelectorQuery("#tabber");
  133. console.log(dom);
  134. },
  135. // click1(e) {
  136. // this.value1 = e
  137. // console.log(e);
  138. // if (this.value1 == 4) {
  139. // uni.redirectTo({
  140. // url: '../../pages/mine/mine'
  141. // })
  142. // }
  143. // if (this.value1 == 0) {
  144. // uni.redirectTo({
  145. // url: '../../pages/express/express'
  146. // })
  147. // }
  148. // if (this.value1 == 1) {
  149. // uni.redirectTo({
  150. // url: '../../pages/index/index'
  151. // })
  152. // }
  153. // if (this.value1 == 2) {
  154. // uni.redirectTo({
  155. // url: '../../pages/shopping/shopping'
  156. // })
  157. // }
  158. // if (this.value1 == 3) {
  159. // uni.redirectTo({
  160. // url: '../../pages/cart/cart'
  161. // })
  162. // }
  163. // uni.setStorageSync('tabbar', e)
  164. // },
  165. checkAll() {
  166. this.$emit("allSelect");
  167. },
  168. //
  169. cancelAll(value) {
  170. if (value == "全选") {
  171. return this.all;
  172. } else if (value == "取消") {
  173. this.all = [];
  174. } else {
  175. this.all.push(this.i18n.selectall);
  176. }
  177. },
  178. click1(e) {
  179. console.log(e);
  180. if (e == 4) {
  181. uni.switchTab({
  182. url: "../../pages/mine/mine",
  183. });
  184. }
  185. if (e == 0) {
  186. uni.switchTab({
  187. url: "../../pages/express/express",
  188. });
  189. }
  190. if (e == 1) {
  191. uni.switchTab({
  192. url: "../../pages/index/index",
  193. });
  194. }
  195. if (e == 2) {
  196. uni.switchTab({
  197. url: "../../pages/shopping/shopping",
  198. });
  199. }
  200. if (e == 3) {
  201. uni.switchTab({
  202. url: "../../pages/cart/cart",
  203. });
  204. }
  205. // uni.setStorageSync('tabbar', e)
  206. },
  207. },
  208. // created() {},
  209. // computed: {
  210. // ...mapState(['config'])
  211. // },
  212. // watch: {
  213. // config: {
  214. // handler(val) {
  215. // if (val.report_switch == 1) {
  216. // this.list = [{
  217. // "iconPath": "/static/images/index.png",
  218. // "pagePath": "/pages/index/index",
  219. // "selectedIconPath": "/static/images/index1.png",
  220. // "text": "首页"
  221. // },
  222. // {
  223. // "iconPath": "/static/images/video.png",
  224. // "pagePath": "/pages/video/video",
  225. // "selectedIconPath": "/static/images/video1.png",
  226. // "text": "视频"
  227. // },
  228. // {
  229. // "iconPath": "/static/images/baobei.png",
  230. // "pagePath": "/pages/baobei/baobei",
  231. // "selectedIconPath": "/static/images/baobei1.png",
  232. // "text": "客户报备"
  233. // },
  234. // {
  235. // "iconPath": "/static/images/mine.png",
  236. // "pagePath": "/pages/mine/mine",
  237. // "selectedIconPath": "/static/images/mine1.png",
  238. // "text": "我的"
  239. // }
  240. // ]
  241. // }
  242. // },
  243. // deep: true
  244. // }
  245. // }
  246. };
  247. </script>
  248. <style lang="scss" scoped>
  249. .all {
  250. font-family: PingFangSC, PingFang SC;
  251. font-weight: 400;
  252. font-size: 22rpx;
  253. color: #444444;
  254. line-height: 32rpx;
  255. text-align: left;
  256. font-style: normal;
  257. }
  258. .bottom {
  259. width: 750rpx;
  260. height: 100rpx;
  261. background: #ffffff;
  262. padding: 0 24rpx;
  263. box-sizing: border-box;
  264. .allweight {
  265. font-family: PingFangSC, PingFang SC;
  266. font-weight: 400;
  267. font-size: 22rpx;
  268. color: #333333;
  269. line-height: 32rpx;
  270. text-align: left;
  271. font-style: normal;
  272. }
  273. .sum {
  274. font-family: PingFangSC, PingFang SC;
  275. font-weight: 400;
  276. font-size: 22rpx;
  277. color: #333333;
  278. line-height: 32rpx;
  279. text-align: left;
  280. font-style: normal;
  281. }
  282. .summon {
  283. font-family: JDZhengHT, JDZhengHT;
  284. font-weight: 400;
  285. font-size: 24rpx;
  286. color: #ff1515;
  287. line-height: 30rpx;
  288. text-align: left;
  289. font-style: normal;
  290. }
  291. .settle {
  292. width: 176rpx;
  293. height: 68rpx;
  294. background: #f83224;
  295. border-radius: 38rpx;
  296. font-family: PingFangSC, PingFang SC;
  297. font-weight: 500;
  298. font-size: 28rpx;
  299. color: #ffffff;
  300. line-height: 68rpx;
  301. text-align: center;
  302. font-style: normal;
  303. margin-left: 20rpx;
  304. }
  305. }
  306. </style>