kj-tabbar.vue 7.4 KB

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