Translate.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view class="div container">
  3. <uni-popup
  4. background-color="#fff"
  5. ref="isShowtranslateInfo"
  6. type="bottom"
  7. >
  8. <view class="div translate-wrapper" :style="'height:'+(screenHeight*.8)+'px'">
  9. <view class="div translate-header"><text class="title">保障</text><text class="iconfont close" v-on:click="closeTranslateInfo(false)">&#xe65a;</text></view>
  10. <view class="div translate-item">
  11. <view class="item" v-if="storeInfo.store_shiti"><view class="dt">实体认证</view><view class="dd">平台核实该店铺有线下实体店</view></view>
  12. <view class="item" v-if="storeInfo.store_qtian"><view class="dt">实物拍摄</view><view class="dd">商品图片均由线下实体店拍摄</view></view>
  13. <view class="item" v-if="storeInfo.store_zhping"><view class="dt">正品保障</view><view class="dd">正品保障,假一赔四</view></view>
  14. <view class="item" v-if="storeInfo.store_erxiaoshi"><view class="dt">急速发货</view><view class="dd">24小时内急速发货</view></view>
  15. <view class="item" v-if="storeInfo.store_tuihuo"><view class="dt">退货承诺</view><view class="dd">满足相应条件时,享受急速退货</view></view>
  16. <view class="item" v-if="storeInfo.store_shiyong"><view class="dt">试用中心</view><view class="dd">店铺接受买家试用,买家可与店铺对话沟通</view></view>
  17. <view class="item" v-if="storeInfo.store_xiaoxie"><view class="dt">消费者保障</view><view class="dd">买家享有消费者权益保护</view></view>
  18. <view class="item" v-if="storeInfo.store_huodaofk"><view class="dt">货到付款</view><view class="dd">买家享有先购物,货到在付款</view></view>
  19. <view class="item" v-if="storeInfo.store_avaliable_deposit > 0"><view class="dt">保证金</view><view class="dd">店铺已缴纳保证金:{{storeInfo.store_avaliable_deposit}} 元</view></view>
  20. </view>
  21. </view>
  22. </uni-popup>
  23. </view>
  24. </template>
  25. <script>
  26. import { mapState, mapMutations, mapActions } from 'vuex'
  27. import flexLine from '../../../flexLine'
  28. export default {
  29. components:{
  30. flexLine
  31. },
  32. data () {
  33. return {
  34. navHeight: 0,
  35. screenHeight:0,
  36. }
  37. },
  38. created () {
  39. },
  40. computed: {
  41. ...mapState({
  42. // 是否显示保障浮层
  43. isShowtranslateInfo: state => state.goodsdetail.isShowtranslateInfo,
  44. storeInfo: state => state.goodsdetail.storeInfo
  45. })
  46. },
  47. watch: {
  48. isShowtranslateInfo: function (value) {
  49. if(value){
  50. this.showPopup('isShowtranslateInfo')
  51. }else{
  52. this.hidePopup('isShowtranslateInfo')
  53. }
  54. },
  55. },
  56. mounted () {
  57. // #ifdef MP-WEIXIN
  58. this.navHeight = uni.getMenuButtonBoundingClientRect().top
  59. // #endif
  60. const res = uni.getSystemInfoSync()
  61. this.screenHeight = res.windowHeight
  62. },
  63. methods: {
  64. showPopup(id){
  65. this.$refs[id].open()
  66. },
  67. hidePopup(id){
  68. this.$refs[id].close()
  69. },
  70. ...mapMutations({
  71. saveTranslateState: 'saveTranslateState'
  72. }),
  73. // 关闭购物车浮层
  74. closeTranslateInfo (value) {
  75. this.saveTranslateState(value)
  76. },
  77. }
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. .mint-popup-bottom {
  82. overflow: initial;
  83. height: 80%;
  84. border-radius: 0.25rem 0.25rem 0 0;
  85. }
  86. .translate-wrapper{
  87. .translate-header{
  88. display: flex;
  89. align-items: center;
  90. padding: 1rem 0.6rem 0;
  91. box-sizing: border-box;
  92. .title{
  93. font-size: .8rem;
  94. }
  95. .close{
  96. margin-left: auto;
  97. }
  98. }
  99. .translate-item{
  100. background-color: #f5f5f5;
  101. border-radius: .4rem;
  102. padding: $pageSpace;
  103. margin: $pageSpace;
  104. .item{
  105. margin: .6rem 0;
  106. font-size: .7rem;
  107. .dt{
  108. font-size: .7rem;
  109. font-weight: bold;
  110. color: #333;
  111. margin-bottom: .3rem;
  112. }
  113. .dd{
  114. font-size: .6rem;
  115. color: #999;
  116. }
  117. }
  118. }
  119. }
  120. </style>