@uxda/appkit 4.1.29 → 4.1.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,11 +4,7 @@
4
4
  <div class="content">
5
5
  <div class="title">自定义</div>
6
6
  <div class="time">
7
- <div
8
- class="item"
9
- :class="focused === 'from' ? 'current' : ''"
10
- @click="switchDateInput('from')"
11
- >
7
+ <div class="item" :class="focused === 'from' ? 'current' : ''" @click="switchDateInput('from')">
12
8
  {{ formatDate(result.from) }}
13
9
  </div>
14
10
  <div class="line">-</div>
@@ -22,18 +18,10 @@
22
18
  <div class="btn confirm" @click="onOkClick">确定</div>
23
19
  </div>
24
20
  <div class="bottom"></div>
25
- <nut-popup v-model:visible="datePickerOpen"
26
- class="appkit-date-filter-picker-popup"
27
- position="bottom"
21
+ <nut-popup v-model:visible="datePickerOpen" class="appkit-date-filter-picker-popup" position="bottom"
28
22
  overlay-class="appkit-date-filter-picker-overlay">
29
- <nut-date-picker
30
- v-model="focusedDate"
31
- :min-date="minDate"
32
- :max-date="maxDate"
33
- :is-show-chinese="false"
34
- :three-dimensional="false"
35
- @cancel="onDatePickerCancel"
36
- @confirm="onDatePickerComplete" />
23
+ <nut-date-picker v-model="focusedDate" :min-date="minDate" :max-date="maxDate" :is-show-chinese="false"
24
+ :three-dimensional="false" @cancel="onDatePickerCancel" @confirm="onDatePickerComplete" />
37
25
  </nut-popup>
38
26
  </div>
39
27
  </template>
@@ -113,7 +101,7 @@ function onDatePickerComplete({ selectedValue, selectedOptions }) {
113
101
  state.couldClose = true
114
102
  }
115
103
 
116
- function onDatePickerCancel () {
104
+ function onDatePickerCancel() {
117
105
  datePickerOpen.value = false
118
106
  state.couldClose = true
119
107
  }
@@ -123,7 +111,7 @@ function onDatePickerCancel () {
123
111
  * 当选择开始时间大于结束时间,结束时间改为开始时间
124
112
  * 时间选择器都要小于当前时间,结束时间的时间选择器要以开始时间为最小值,
125
113
  */
126
- function switchDateInput (shift: string) {
114
+ function switchDateInput(shift: string) {
127
115
  // 要设置一下结束时间的起始值 开始时间往前倒5年
128
116
  if (shift === 'from') {
129
117
  let time = result.from.split('-').map(Number)
@@ -146,6 +134,7 @@ function switchDateInput (shift: string) {
146
134
  flex-direction: column;
147
135
  width: 100%;
148
136
  position: relative;
137
+
149
138
  .date-filter-header {
150
139
  text-align: center;
151
140
  height: 44px;
@@ -154,21 +143,25 @@ function switchDateInput (shift: string) {
154
143
  font-size: 17px;
155
144
  background-color: #f5f5f5;
156
145
  }
146
+
157
147
  .content {
158
148
  flex: 1;
159
149
  margin: 15px;
160
150
  overflow-y: scroll;
161
151
  color: #353535;
162
152
  font-size: 13px;
153
+
163
154
  .title {
164
155
  opacity: 0.6;
165
156
  line-height: 18px;
166
157
  }
158
+
167
159
  .info {
168
160
  display: grid;
169
161
  grid-template-columns: 1fr 1fr 1fr;
170
162
  grid-gap: 10px;
171
163
  margin: 10px 0;
164
+
172
165
  .item {
173
166
  height: 30px;
174
167
  line-height: 30px;
@@ -176,27 +169,26 @@ function switchDateInput (shift: string) {
176
169
  border-radius: 6px;
177
170
  text-align: center;
178
171
  }
172
+
179
173
  .current {
180
174
  border: 1px solid;
181
- border-image-source: linear-gradient(
182
- 180deg,
183
- rgba(239, 208, 130, 0.8) 0%,
184
- rgba(255, 185, 120, 0.8) 100%
185
- );
186
- background: linear-gradient(
187
- 180deg,
175
+ border-image-source: linear-gradient(180deg,
188
176
  rgba(239, 208, 130, 0.8) 0%,
189
- rgba(255, 185, 120, 0.8) 100%
190
- ),
177
+ rgba(255, 185, 120, 0.8) 100%);
178
+ background: linear-gradient(180deg,
179
+ rgba(239, 208, 130, 0.8) 0%,
180
+ rgba(255, 185, 120, 0.8) 100%),
191
181
  linear-gradient(180deg, #fff7e3 0%, #fefde6 100%);
192
182
  }
193
183
  }
194
184
  }
185
+
195
186
  .buttons {
196
187
  margin: 32px 15px 0 15px;
197
188
  display: flex;
198
189
  justify-content: space-between;
199
190
  align-items: center;
191
+
200
192
  .btn {
201
193
  flex: 1;
202
194
  height: 40px;
@@ -208,21 +200,25 @@ function switchDateInput (shift: string) {
208
200
  font-size: 16px;
209
201
  border-radius: 6px;
210
202
  }
203
+
211
204
  .confirm {
212
205
  margin-left: 11px;
213
- color: #000;
206
+ color: #fff;
214
207
  border: none;
215
- background: linear-gradient(90deg, #ffebc1 0%, #ffd7a7 52.29%, #ffb875 100%);
208
+ background: #017FFF;
216
209
  }
217
210
  }
211
+
218
212
  .time {
219
213
  display: flex;
220
214
  justify-content: flex-start;
221
215
  align-items: center;
222
216
  margin: 10px 0 30px 0;
217
+
223
218
  .line {
224
219
  margin: 0 8px;
225
220
  }
221
+
226
222
  .item {
227
223
  height: 30px;
228
224
  line-height: 30px;
@@ -234,15 +230,18 @@ function switchDateInput (shift: string) {
234
230
  background: rgba(#f5f5f5, 0.8);
235
231
  border-radius: 6px;
236
232
  }
233
+
237
234
  .current {
238
235
  border: 1px solid #353535;
239
236
  }
240
237
  }
238
+
241
239
  .bottom {
242
240
  height: 32px;
243
241
  background: #fff;
244
242
  }
245
243
  }
244
+
246
245
  .nut-overlay {
247
246
  &.date-filter-picker-overlay {
248
247
  height: 100vh;
@@ -3,26 +3,22 @@
3
3
  <div class="list-filter-picker-title">
4
4
  <h3>选择筛选项</h3>
5
5
  </div>
6
- <div class="consumption-filter-content">
6
+ <div class="list-filter-picker-content">
7
7
  <template v-for="(item, index) in filterSections" :key="index">
8
8
  <div class="title">{{ item.label }}</div>
9
9
  <div class="info">
10
- <div
11
- v-for="(it, i) in item.data"
12
- @click="() => onFilterSectionClick(item.name, it.value)"
13
- :class="getItemClass(item.name, it.value)"
14
- class="info-item"
15
- :key="i">
10
+ <div v-for="(it, i) in item.data" @click="() => onFilterSectionClick(item.name, it.value)"
11
+ :class="getItemClass(item.name, it.value)" class="info-item" :key="i">
16
12
  {{ typeof it === 'string' ? it : it.label }}
17
13
  </div>
18
14
  </div>
19
15
  </template>
20
16
  </div>
21
- <div class="consumption-filter-btn spa-between">
17
+ <div class="list-filter-picker-btn spa-between">
22
18
  <div class="btn" @click="reset">重置</div>
23
19
  <div class="btn confirm" @click="onOkClick">确定</div>
24
20
  </div>
25
- <div class="consumption-filter-bottom"></div>
21
+ <div class="list-filter-picker-bottom"></div>
26
22
  </div>
27
23
  </template>
28
24
 
@@ -99,6 +95,7 @@ const onOkClick = () => {
99
95
  display: flex;
100
96
  flex-direction: column;
101
97
  width: 100%;
98
+
102
99
  &-title {
103
100
  position: relative;
104
101
  height: 44px;
@@ -108,21 +105,25 @@ const onOkClick = () => {
108
105
  background: #f5f5f5;
109
106
  text-align: center;
110
107
  }
108
+
111
109
  &-content {
112
110
  flex: 1;
113
111
  margin: 15px;
114
112
  overflow-y: scroll;
115
113
  color: #353535;
116
114
  font-size: 13px;
115
+
117
116
  .title {
118
117
  opacity: 0.6;
119
118
  line-height: 18px;
120
119
  }
120
+
121
121
  .info {
122
122
  display: grid;
123
123
  grid-template-columns: 1fr 1fr 1fr;
124
124
  grid-gap: 10px;
125
125
  margin: 10px 0;
126
+
126
127
  &-item {
127
128
  height: 30px;
128
129
  line-height: 30px;
@@ -130,45 +131,45 @@ const onOkClick = () => {
130
131
  border-radius: 6px;
131
132
  text-align: center;
132
133
  }
134
+
133
135
  .current {
134
136
  border-radius: 5px;
135
- border: 1px solid #EFD082;
136
- background: linear-gradient(180deg, #FFF7E3 0%, #FEFDE6 100%);
137
+ border: 1px solid rgba(1, 127, 255, 0.5);
138
+ background: #E6F2FF;
137
139
  }
138
140
  }
139
141
  }
142
+
140
143
  &-btn {
141
144
  margin: 0 15px;
142
145
  display: flex;
143
146
  justify-content: space-between;
144
147
  align-items: center;
148
+
145
149
  .btn {
146
150
  flex: 1;
147
151
  height: 40px;
148
152
  line-height: 40px;
149
153
  text-align: center;
150
154
  border: 1px solid #ccc;
151
- box-sizing: border-box;
152
155
  color: #666;
153
156
  font-size: 16px;
154
157
  border-radius: 6px;
155
158
  }
159
+
156
160
  .confirm {
157
161
  margin-left: 11px;
158
- color: #000;
162
+ color: #fff;
159
163
  border: none;
160
- background: linear-gradient(
161
- 90deg,
162
- #ffebc1 0%,
163
- #ffd7a7 52.29%,
164
- #ffb875 100%
165
- );
164
+ background: #017fff;
166
165
  }
167
166
  }
167
+
168
168
  &-bottom {
169
169
  height: 32px;
170
170
  background: #fff;
171
171
  }
172
+
172
173
  .icon {
173
174
  display: block;
174
175
  width: 20px;
@@ -176,6 +177,7 @@ const onOkClick = () => {
176
177
  background-size: 40px;
177
178
  background-repeat: no-repeat;
178
179
  background-position: center center;
180
+
179
181
  &.icon-x {
180
182
  position: absolute;
181
183
  right: 10px;
@@ -0,0 +1,183 @@
1
+ <template>
2
+ <div class="promoter-card">
3
+ <div class="promoter-card-tab" v-if="useCase === 'company' && isAdmin">
4
+ <div class="promoter-card-tab-item" @click="onTabChange('person')" :class="{ focus: tab === 'person' }">个人</div>
5
+ <div class="promoter-card-tab-item" @click="onTabChange('company')" :class="{ focus: tab === 'company' }">企业</div>
6
+ </div>
7
+ <div class="promoter-card-hd" @click="emits('blance', tab)"
8
+ v-if="applyRecord.distributorFlag === 'Y' || applyRecord.accessCheckStatus === 'Y'">
9
+ <div class="promoter-card-hd-num">{{ promoter.total }}</div>
10
+ <div class="promoter-card-hd-info">可提现余额(元)</div>
11
+ <img class="arrow-img" src="https://cdn.ddjf.com/static/images/appkit/arrow.png" alt="">
12
+ </div>
13
+ <div class="promoter-card-ft">
14
+ <div class="promoter-card-ft-item" v-if="applyRecord.accessCheckStatus === 'Y'" @click="emits('profits', tab)">
15
+ <div class="promoter-card-ft-info">销售累计收益(笔)</div>
16
+ <div class="promoter-card-ft-num">
17
+ {{ promoter.totalIncome }}
18
+ <img class="arrow-img" src="https://cdn.ddjf.com/static/images/appkit/arrow.png" alt="">
19
+ </div>
20
+ </div>
21
+ <div class="promoter-card-ft-line"
22
+ v-if="applyRecord.accessCheckStatus === 'Y' && applyRecord.distributorFlag === 'Y'"></div>
23
+ <div class="promoter-card-ft-item" @click="emits('rebate', tab)" v-if="applyRecord.distributorFlag === 'Y'">
24
+ <div class="promoter-card-ft-info">返佣累计收益(元)</div>
25
+ <div class="promoter-card-ft-num">
26
+ {{ promoter.totalRebateIncome }}
27
+ <img class="arrow-img" src="https://cdn.ddjf.com/static/images/appkit/arrow.png" alt="">
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ </template>
33
+
34
+ <script setup lang="ts">
35
+ import { ref } from 'vue'
36
+ import { endpoints, useHttp } from '../api'
37
+ import { Promoter } from '../types'
38
+ import { useDidShow } from '@tarojs/taro'
39
+
40
+ type PromoterCardProps = {
41
+ useCase: string
42
+ applyRecord: any
43
+ isAdmin?: boolean
44
+ }
45
+ const props = withDefaults(defineProps<PromoterCardProps>(), {
46
+ useCase: '',
47
+ applyRecord: {},
48
+ isAdmin: true
49
+ })
50
+
51
+ const tab = ref('person')
52
+
53
+ const promoter = ref<Promoter>({
54
+ total: 0,
55
+ totalIncome: 0,
56
+ totalRebateIncome: 0,
57
+ })
58
+
59
+ function onTabChange(type: string) {
60
+ tab.value = type
61
+ loadPromoter()
62
+ }
63
+
64
+ async function loadPromoter() {
65
+ const $http = useHttp()
66
+ $http
67
+ .get<Promoter>(endpoints.获取推广方账户信息, {
68
+ useCase: tab.value,
69
+ })
70
+ .then((data) => {
71
+ promoter.value.total = data?.total || 0
72
+ promoter.value.totalIncome = data?.totalIncome || 0
73
+ promoter.value.totalRebateIncome = data?.totalRebateIncome || 0
74
+ })
75
+ }
76
+
77
+ const emits = defineEmits([
78
+ /**
79
+ * 跳可提现余额
80
+ */
81
+ 'blance',
82
+ /**
83
+ * 跳收益页面
84
+ */
85
+ 'profits',
86
+ /**
87
+ * 跳返佣统计页面
88
+ */
89
+ 'rebate',
90
+ ])
91
+
92
+ useDidShow(() => {
93
+ loadPromoter()
94
+ })
95
+
96
+ defineExpose({
97
+ reload: loadPromoter,
98
+ })
99
+ </script>
100
+
101
+ <style lang="scss">
102
+ .promoter-card {
103
+ padding: 15px 20px;
104
+ background: linear-gradient(180deg, #FFEEDB 0%, #FEFEFC 100%);
105
+ box-sizing: border-box;
106
+ margin: 0 auto;
107
+ border-radius: 15px;
108
+
109
+ &-hd {
110
+ display: flex;
111
+ align-items: center;
112
+ color: #353535;
113
+ margin-bottom: 12px;
114
+
115
+ &-num {
116
+ font-size: 22px;
117
+ font-weight: bold;
118
+ margin-right: 8px;
119
+ }
120
+
121
+ &-info {
122
+ font-size: 14px;
123
+ }
124
+ }
125
+
126
+ &-ft {
127
+ display: flex;
128
+ align-items: center;
129
+
130
+ &-item {
131
+ flex: 1;
132
+ }
133
+
134
+ &-info {
135
+ font-size: 12px;
136
+ color: #434242;
137
+ margin-bottom: 5px;
138
+ }
139
+
140
+ &-num {
141
+ display: flex;
142
+ align-items: center;
143
+ font-size: 20px;
144
+ color: #353535;
145
+ }
146
+
147
+ &-line {
148
+ width: 1px;
149
+ height: 19px;
150
+ background: rgba(53, 53, 53, 0.2);
151
+ margin-right: 30px;
152
+ }
153
+ }
154
+
155
+ &-tab {
156
+ margin-top: -3px;
157
+ margin-bottom: 15px;
158
+
159
+ &-item {
160
+ display: inline-flex;
161
+ align-items: center;
162
+ background: #fff;
163
+ border-radius: 15px;
164
+ height: 29px;
165
+ padding: 0 10px;
166
+ font-size: 12px;
167
+ color: #6D4523;
168
+ margin-right: 12px;
169
+
170
+ &.focus {
171
+ background: linear-gradient(90deg, #FFEBC1 0%, #FFB875 100%);
172
+ color: #6D4523;
173
+ }
174
+ }
175
+ }
176
+
177
+ .arrow-img {
178
+ width: 16px;
179
+ height: 12px;
180
+ margin-left: 5px;
181
+ }
182
+ }
183
+ </style>
@@ -3,11 +3,6 @@ import AccountView from './AccountView.vue'
3
3
  import BalanceReminder from './BalanceReminder.vue'
4
4
  import DateRange from './DateRange.vue'
5
5
  import ListFilter from './ListFilter.vue'
6
+ import PromoterCard from './PromoterCard.vue'
6
7
 
7
- export {
8
- BalanceCard,
9
- AccountView,
10
- BalanceReminder,
11
- DateRange,
12
- ListFilter
13
- }
8
+ export { BalanceCard, AccountView, BalanceReminder, DateRange, ListFilter, PromoterCard }
@@ -89,3 +89,9 @@ export type 权益类目 = {
89
89
  name: string
90
90
  code: string
91
91
  }
92
+
93
+ export type Promoter = {
94
+ total: number
95
+ totalIncome: number
96
+ totalRebateIncome: number
97
+ }
package/src/index.ts CHANGED
@@ -46,7 +46,6 @@ const $app: DollarApp = {
46
46
  },
47
47
  setTempToken: (token: () => string) => {
48
48
  const appKitOptions = useAppKitOptions()
49
- console.log('setTempToken: ' + token)
50
49
  appKitOptions.tempToken = token
51
50
  },
52
51
  requestPayment: (options: PaymentParams) => {},
@@ -61,7 +61,6 @@ interface DefaultHeaderType {
61
61
  }
62
62
  function useHttp(defaultHeader?: DefaultHeaderType) {
63
63
  const appkitOptions = useAppKitOptions()
64
- console.log(appkitOptions.tempToken(), ':----- appkitOptions.tempToken()')
65
64
  const headers = {
66
65
  Token: appkitOptions.tempToken() || appkitOptions.token(),
67
66
  Appcode: defaultHeader?.Appcode || appkitOptions.app(),
@@ -1,15 +1,7 @@
1
1
  <template>
2
- <nut-grid
3
- class="amount-picker"
4
- :column-num="3"
5
- :gutter="10"
6
- :border="false">
7
- <nut-grid-item
8
- class="tile"
9
- v-for="(amount, index) in items"
10
- :class="{selected: state.selected === index}"
11
- @click="() => onGridItemClick(index)"
12
- :key="index">
2
+ <nut-grid class="amount-picker" :column-num="3" :gutter="10" :border="false">
3
+ <nut-grid-item class="tile" v-for="(amount, index) in items" :class="{ selected: state.selected === index }"
4
+ @click="() => onGridItemClick(index)" :key="index">
13
5
  <h4 class="token-line number">{{ amount.token }}</h4>
14
6
  <h5>¥<span class="number">{{ amount.amount }}</span></h5>
15
7
  </nut-grid-item>
@@ -56,14 +48,17 @@ const onGridItemClick = (index: number) => {
56
48
  <style lang="scss">
57
49
  .amount-picker {
58
50
  padding: 14px 0 14px 14px;
51
+
59
52
  .nut-grid-item__content {
60
- border: solid 2px transparent;
53
+ border: solid 1px transparent;
61
54
  background: linear-gradient(#f5f5f5, #f5f5f5) padding-box,
62
55
  linear-gradient(to bottom, #cccccc88, #cccccc88) border-box;
63
56
  border-radius: 5px;
64
57
  }
58
+
65
59
  .tile {
66
60
  height: 80px;
61
+
67
62
  &.selected {
68
63
  .nut-grid-item__content {
69
64
  background: linear-gradient(#FFF7E3, #FEFDE6) padding-box,
@@ -71,6 +66,7 @@ const onGridItemClick = (index: number) => {
71
66
  }
72
67
  }
73
68
  }
69
+
74
70
  h4.token-line {
75
71
  background-image: url("https://cdn.ddjf.com/static/images/appkit/yundou.png");
76
72
  background-size: 20px;
@@ -82,6 +78,7 @@ const onGridItemClick = (index: number) => {
82
78
  line-height: 25px;
83
79
  font-size: 18px;
84
80
  }
81
+
85
82
  h5 {
86
83
  line-height: 18px;
87
84
  color: #353535;
@@ -4,35 +4,21 @@
4
4
  <p class="caption">{{ message || '短信将发送至账号绑定手机号' }}</p>
5
5
  <p class="number">{{ phone }}</p>
6
6
  <ns-form v-model="formData" class="form">
7
- <ns-input
8
- class="form-input"
9
- name="code"
10
- v-model="formData.code"
11
- placeholder="请输入验证码"
12
- maxlength="6"
13
- variant="solid"
14
- :rules="['required', {
7
+ <ns-input class="form-input" name="code" v-model="formData.code" placeholder="请输入验证码" maxlength="6"
8
+ variant="solid" :rules="['required', {
15
9
  name: 'function',
16
10
  message: '输入错误, 请重新输入',
17
11
  method: (value: string) => value.length === 6,
18
- }]"
19
- >
12
+ }]">
20
13
  </ns-input>
21
14
  <div class="form-btn">
22
- <ns-button
23
- v-if="!sent"
24
- size="xs"
25
- variant="plain"
26
- color="primary"
27
- @click="send"
28
- label="获取验证码"
29
- />
15
+ <ns-button v-if="!sent" size="xs" variant="plain" color="primary" @click="send" label="获取验证码" />
30
16
  <div class="caption" v-if="sent">{{ countdown }}s后重新发送</div>
31
17
  </div>
32
18
  </ns-form>
33
19
  <div class="row buttons">
34
20
  <ns-button class="cancel-btn" @click="emits('cancel')">取消</ns-button>
35
- <ns-button gradient="#FFEBC1,#FFD7A7,#FFB875/90" @click="onOk">确认</ns-button>
21
+ <ns-button color="primary" @click="onOk">确认</ns-button>
36
22
  </div>
37
23
  </div>
38
24
  </template>
@@ -81,25 +67,29 @@ const props = defineProps<AppVerifyProps>();
81
67
 
82
68
  <style lang="scss">
83
69
  .app-verify {
84
- padding: var(--ns-spacing);
70
+ padding: 10px 30px 20px;
85
71
 
86
72
  h2 {
87
73
  font-size: 16px;
88
74
  font-weight: bold;
89
75
  margin: 10px;
90
76
  }
77
+
91
78
  .caption {
92
- font-size: 10px !important;
79
+ font-size: 13px !important;
93
80
  color: #ccc;
94
81
  line-height: 21px;
95
82
  }
83
+
96
84
  .number {
97
85
  line-height: 21px;
98
86
  }
87
+
99
88
  .form .nut-cell-group__wrap {
100
89
  display: flex;
101
90
  align-items: center;
102
91
  margin: 20px 0 !important;
92
+
103
93
  .form-input {
104
94
  height: 36px;
105
95
  line-height: 36px;
@@ -109,18 +99,31 @@ const props = defineProps<AppVerifyProps>();
109
99
  flex: 1;
110
100
  padding-left: 12px;
111
101
  }
102
+
112
103
  .form-btn {
113
104
  margin-left: 12px;
114
105
  width: 105px;
115
106
  }
116
107
  }
108
+
117
109
  .buttons {
110
+ width: 100%;
111
+ justify-content: space-between;
112
+ margin-top: 10px;
113
+
118
114
  .ns-button {
119
115
  width: 104px;
116
+ border-radius: 30px;
117
+ --radius: 30px;
120
118
  }
119
+
121
120
  .cancel-btn {
122
121
  border: 1px solid #969696 !important;
123
122
  }
124
123
  }
124
+
125
+ .nut-input {
126
+ background: transparent !important;
127
+ }
125
128
  }
126
129
  </style>