Blame view

member-miniapp/packageProfile/pickup-code/pickup-code.vue 4.46 KB
d8035736   “wangming”   Refactor project ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  <template>
    <view class="page-shell pickup-code-page">
      <view class="page-blur"></view>
      <view class="page-blur-secondary"></view>
      <view class="page-blur-tertiary"></view>
  
      <view class="page-content subpage-content">
        <view class="subpage-nav">
          <view class="subpage-back" @tap="goBack">‹</view>
          <view class="subpage-title-wrap">
            <text class="subpage-title">核销码</text>
            <text class="subpage-subtitle">到店出示核销码,任意门店核销后即可完成自提</text>
          </view>
        </view>
  
        <view class="subpage-hero glass-card">
e1dcb3a0   “wangming”   1
17
18
19
          <text class="hero-kicker">待自提</text>
          <text class="hero-title">门店自提取件码</text>
          <text class="hero-desc">订单编号 {{ info.orderNo }} · {{ info.storeName }}</text>
d8035736   “wangming”   Refactor project ...
20
21
22
        </view>
  
        <lf-pickup-code
e1dcb3a0   “wangming”   1
23
24
25
26
          v-if="info.pickupCode"
          :code="info.pickupCode"
          title="门店自提取件码"
          desc="到自提门店出示取件码,门店核销后即可完成自提。"
d8035736   “wangming”   Refactor project ...
27
28
        />
  
d8035736   “wangming”   Refactor project ...
29
30
31
32
33
34
35
        <view class="subpage-card">
          <view class="section-head">
            <text class="section-title">核销信息</text>
            <text class="section-link">门店自提</text>
          </view>
          <view class="info-list">
            <view class="info-row">
e1dcb3a0   “wangming”   1
36
37
              <text class="info-label">自提门店</text>
              <text class="info-value">{{ info.storeName || '—' }}</text>
d8035736   “wangming”   Refactor project ...
38
39
40
            </view>
            <view class="info-row">
              <text class="info-label">核销方式</text>
e1dcb3a0   “wangming”   1
41
              <text class="info-value">到店出示取件码核销</text>
d8035736   “wangming”   Refactor project ...
42
43
            </view>
            <view class="info-row">
e1dcb3a0   “wangming”   1
44
45
              <text class="info-label">取件码</text>
              <text class="info-value">{{ info.pickupCode }}</text>
d8035736   “wangming”   Refactor project ...
46
47
48
49
50
            </view>
          </view>
        </view>
  
        <view class="cta-row">
e1dcb3a0   “wangming”   1
51
          <view class="secondary-button" @tap="copyCode">复制取件码</view>
d8035736   “wangming”   Refactor project ...
52
53
54
55
56
57
58
          <view class="primary-button" @tap="goOrderDetail">返回订单</view>
        </view>
      </view>
    </view>
  </template>
  
  <script>
e1dcb3a0   “wangming”   1
59
  import { getPickupCode } from '@/api/mall'
d8035736   “wangming”   Refactor project ...
60
61
62
63
  
  export default {
    data() {
      return {
e1dcb3a0   “wangming”   1
64
65
        orderId: '',
        info: {}
d8035736   “wangming”   Refactor project ...
66
67
68
      }
    },
    onLoad(options) {
e1dcb3a0   “wangming”   1
69
70
      this.orderId = options.orderId || options.id || ''
      this.loadCode()
d8035736   “wangming”   Refactor project ...
71
72
    },
    methods: {
e1dcb3a0   “wangming”   1
73
74
75
76
77
78
79
80
81
82
83
84
85
      loadCode() {
        getPickupCode(this.orderId)
          .then((data) => {
            this.info = data || {}
          })
          .catch(() => {})
      },
      copyCode() {
        if (!this.info.pickupCode) return
        uni.setClipboardData({
          data: this.info.pickupCode,
          success: () => uni.showToast({ title: '取件码已复制', icon: 'none' })
        })
d8035736   “wangming”   Refactor project ...
86
87
88
89
90
      },
      goBack() {
        uni.navigateBack({ fail: () => this.goOrderDetail() })
      },
      goOrderDetail() {
e1dcb3a0   “wangming”   1
91
        uni.redirectTo({ url: `/packageProfile/order-detail/order-detail?id=${this.orderId}` })
d8035736   “wangming”   Refactor project ...
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
      }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  @import '@/styles/mixins.scss';
  @import '@/styles/subpage.scss';
  
  .product-card {
    display: flex;
    padding: 28rpx;
    margin-bottom: 24rpx;
  }
  
  .product-art {
    width: 180rpx;
    height: 180rpx;
    border-radius: 28rpx;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(241, 246, 241, 0.96);
    border: 1rpx solid rgba(120, 146, 121, 0.14);
    box-shadow: inset 0 1rpx 0 rgba(255, 255, 255, 0.65);
    overflow: hidden;
  }
  
  .product-art-ring {
    width: 96rpx;
    height: 96rpx;
    border-radius: 50%;
    border: 1rpx solid rgba(120, 146, 121, 0.18);
    background: rgba(255, 255, 255, 0.45);
    animation: lfPulseSoft 5.2s ease-in-out infinite;
  }
  
  .product-art-label {
    position: absolute;
    font-size: 24rpx;
    letter-spacing: 4rpx;
    color: $brand-primary-deep;
    font-weight: 600;
  }
  
  .product-art::before {
    content: '';
    position: absolute;
    right: -30rpx;
    top: -30rpx;
    width: 120rpx;
    height: 120rpx;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(210, 191, 156, 0.22), rgba(210, 191, 156, 0));
    animation: lfFloatSoft 9.8s ease-in-out infinite;
  }
  
  .product-copy {
    flex: 1;
    margin-left: 22rpx;
  }
  
  .product-name,
  .product-spec,
  .product-qty,
  .product-amount {
    display: block;
  }
  
  .product-name {
    font-size: 30rpx;
    line-height: 1.5;
    font-weight: 700;
  }
  
  .product-spec,
  .product-qty {
    margin-top: 14rpx;
    font-size: 24rpx;
    line-height: 1.7;
    color: $text-secondary;
  }
  
  .product-amount {
    margin-top: 18rpx;
    font-size: 34rpx;
    font-weight: 700;
    color: $brand-primary-deep;
  }
  </style>