index.jsx 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import { AtModal, AtModalContent } from "taro-ui";
  2. import { View, Image, Text } from "@tarojs/components";
  3. import { addLog } from "../../service";
  4. import "./index.less";
  5. import Taro from "@tarojs/taro";
  6. import selectStep from "../../images/productDetail/selectStep.png";
  7. import xianyu from "../../images/productDetail/xianyu.png";
  8. import stepThree from "../../images/productDetail/stepThree.png";
  9. export default function Modal(props) {
  10. const { productPromotion, isOpened, title, linkText } = props;
  11. const handleCopyLink = () => {
  12. Taro.setClipboardData({
  13. data: productPromotion.short_tpwd,
  14. }).then(() => {
  15. Taro.showToast({
  16. title: '口令已复制',
  17. icon: 'success',
  18. });
  19. addLog({
  20. log_type: 'click_to_purchase',
  21. });
  22. });
  23. }
  24. return (
  25. <AtModal isOpened={isOpened} closeOnClickOverlay={true}>
  26. <AtModalContent>
  27. <View className="container">
  28. <View className="title">{title}</View>
  29. <View className="content">
  30. <View className="link-text">{linkText}</View>
  31. <View className="steps">
  32. <View className="step-item">
  33. <View className="step-title">
  34. <Text className="number">1</Text>
  35. <Text className="desc">点击复制口令</Text>
  36. </View>
  37. <View className="step-box">
  38. <View className="step-One">
  39. 复制口令
  40. </View>
  41. <Image className="step-img-one" src={selectStep} />
  42. </View>
  43. </View>
  44. <View className="step-item">
  45. <View className="step-title">
  46. <Text className="number">2</Text>
  47. <Text className="desc">打开咸鱼APP</Text>
  48. </View>
  49. <View className="step-box">
  50. <Image className="step-img-t" src={xianyu} />
  51. <Image className="step-img-two" src={selectStep} />
  52. </View>
  53. </View>
  54. <View className="step-item">
  55. <View className="step-title">
  56. <Text className="number">3</Text>
  57. <Text className="desc">自动识别口令</Text>
  58. </View>
  59. <View className="step-box">
  60. <Image mode="heightFix" className="step-img-three" src={stepThree} />
  61. </View>
  62. </View>
  63. </View>
  64. {/* 复制口令 */}
  65. <View className="copy-link" onClick={handleCopyLink}>
  66. 复制口令
  67. </View>
  68. </View>
  69. </View>
  70. </AtModalContent>
  71. </AtModal>
  72. );
  73. }