valueAddedModel.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <Popup ref="popRef" isClose :title="result?.title">
  3. <template #content>
  4. <view class="content">
  5. <image :src="`/static/shop/${result?.img}`" class="img" mode="widthFix"></image>
  6. <view class="tips_title">
  7. <trans _t="服务说明" />
  8. </view>
  9. <view class="tis_cont">
  10. <trans :_t="result?.cont" />
  11. </view>
  12. </view>
  13. </template>
  14. <template #footer>
  15. <view class="submit_btn" @click="close">
  16. <trans _t="我知道了" />
  17. </view>
  18. </template>
  19. </Popup>
  20. </template>
  21. <script setup>
  22. import { ref } from 'vue'
  23. import Popup from '@/components/popup.vue';
  24. import { t } from "@/locale"
  25. const popRef = ref(null);
  26. const emit = defineEmits(['open', 'close'])
  27. const moduleList = [
  28. { channel: 0, title: '易碎品加固', cont: '_yspjg_desc', img: 'add-ys.png' },
  29. { channel: 1, title: '标准质检', cont: '_bzzj_desc', img: 'add-bz.png' },
  30. { channel: 2, title: '优先采购', cont: '_yxdg_desc', img: 'add-cg.png' },
  31. { channel: 3, title: '个性化拍照', cont: '_gxhpz_desc', img: 'add-pz.png' }
  32. ]
  33. const result = ref(null);
  34. const open = (type = 0) => {
  35. result.value = moduleList.find(item => item.channel === type);
  36. popRef.value && popRef.value.open()
  37. }
  38. const close = () => {
  39. emit('close')
  40. popRef.value && popRef.value.close()
  41. }
  42. defineExpose({ open, close })
  43. </script>
  44. <style lang="less" scoped>
  45. @import url('@/style.less');
  46. :deep(.conts) {
  47. min-width: 65vw;
  48. }
  49. .content {
  50. width: 100%;
  51. .img {
  52. display: block;
  53. width: 100%;
  54. }
  55. .tips_title {
  56. font-size: 32rpx;
  57. color: var(--black);
  58. font-weight: 700;
  59. line-height: 60rpx;
  60. margin-top: 30rpx;
  61. }
  62. .tis_cont {
  63. font-size: 28rpx;
  64. color: var(--text);
  65. line-height: 40rpx;
  66. margin-top: 20rpx;
  67. padding: 0 30rpx;
  68. text-align: left;
  69. }
  70. }
  71. .submit_btn {
  72. height: 76rpx;
  73. padding: 16rpx 30rpx;
  74. background-color: var(--black);
  75. color: var(--light);
  76. .flex_center();
  77. border-radius: 16rpx;
  78. .size(24rpx);
  79. }
  80. </style>