@qywh/package 0.0.3-beta01 → 0.0.3-beta05

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.
Files changed (71) hide show
  1. package/common/actions/index.ts +2 -5
  2. package/common/actions/jumpXcxToQuestion.ts +57 -0
  3. package/common/actions/link.ts +0 -310
  4. package/common/compnents/dialog/index.vue +1 -1
  5. package/common/index.ts +1 -5
  6. package/lib/cdnUrl.ts +1 -8
  7. package/lib/httpdns-request.ts +3 -62
  8. package/lib/methods/actions-fn.ts +69 -519
  9. package/lib/methods/jump.ts +3 -21
  10. package/lib/request.ts +1 -6
  11. package/lib/utils/domain-config.ts +2 -132
  12. package/lib/utils/format-img.ts +3 -17
  13. package/lib/utils/index.ts +1 -4
  14. package/lib/utils/logParamHandle.ts +138 -0
  15. package/package.json +1 -1
  16. package/packages/qy-anchor/components/index.vue +4 -4
  17. package/packages/qy-atmosphere-countdown/settings/index.ts +2 -3
  18. package/packages/qy-atmosphere-countdownv2/settings/index.ts +2 -2
  19. package/packages/qy-button/components/index.vue +2 -2
  20. package/packages/qy-button/components/static/default-btn.png +0 -0
  21. package/packages/qy-button/settings/applet/v1.ts +2 -3
  22. package/packages/qy-button/settings/applet/v2.ts +2 -3
  23. package/packages/qy-container/components/index.vue +4 -4
  24. package/packages/qy-countdown/settings/index.ts +2 -3
  25. package/packages/qy-dialog/components/index.vue +30 -30
  26. package/packages/qy-hotarea/components/index.vue +2 -2
  27. package/packages/qy-limit-countdown/components/index.vue +1 -1
  28. package/packages/qy-limit-countdown/settings/index.ts +2 -3
  29. package/packages/qy-out-form-input/components/index.vue +1 -1
  30. package/packages/qy-out-form-select/components/index.vue +1 -1
  31. package/packages/qy-out-form-submit-button/components/index.vue +18 -18
  32. package/packages/qy-out-form-submit-button/components/static/default-btn.png +0 -0
  33. package/packages/qy-out-success-wechat-diversion/components/index.vue +120 -745
  34. package/packages/qy-out-success-wechat-diversion/menu.ts +1 -1
  35. package/packages/qy-out-success-wechat-diversion/settings/index.ts +5 -424
  36. package/packages/qy-out-wx-auth-button/components/index.vue +4 -4
  37. package/packages/qy-out-wx-auth-button/components/static/default-btn.png +0 -0
  38. package/packages/qy-out-wx-auth-button/settings/applet/v1.ts +2 -2
  39. package/packages/qy-out-wx-auth-button/settings/index.ts +2 -2
  40. package/packages/qy-page/components/index.vue +1 -1
  41. package/packages/qy-page/components/out-weixin-share.ts +49 -81
  42. package/packages/qy-picture/components/index.vue +1 -1
  43. package/packages/qy-picture/components/static/single_pic-2.png +0 -0
  44. package/packages/qy-picture/settings/applet/v1.ts +2 -2
  45. package/packages/qy-picture/settings/index.ts +2 -2
  46. package/packages/qy-rect/components/index.vue +2 -2
  47. package/typings/enum/saleChannelConfig.ts +1 -1
  48. package/typings/index.d.ts +0 -1
  49. package/common/actions/jumpXcx.ts +0 -20
  50. package/common/domain.ts +0 -12
  51. package/common/service.ts +0 -65
  52. package/lib/baseUrl.ts +0 -12
  53. package/lib/checkRepeat.ts +0 -28
  54. package/lib/utils/environment.ts +0 -39
  55. package/lib/utils/order-recall.ts +0 -26
  56. package/lib/utils/weixin.ts +0 -160
  57. package/lib/utils/wxGroupManage.ts +0 -211
  58. package/lib/zyb-yike-utils/feWechatMultiterminal.ts +0 -103
  59. package/lib/zyb-yike-utils/logParamHandle.ts +0 -298
  60. package/packages/qy-seckill/actions/index.ts +0 -1
  61. package/packages/qy-seckill/components/index.vue +0 -263
  62. package/packages/qy-seckill/index.ts +0 -18
  63. package/packages/qy-seckill/menu.ts +0 -6
  64. package/packages/qy-seckill/settings/index.ts +0 -101
  65. package/packages/qy-seckill/static/clock.png +0 -0
  66. package/typings/enum/coupon.ts +0 -5
  67. /package/lib/{zyb-yike-utils → utils}/cookieExt.ts +0 -0
  68. /package/lib/{zyb-yike-utils → utils}/guid.ts +0 -0
  69. /package/lib/{zyb-yike-utils → utils}/sparkMD5.js +0 -0
  70. /package/lib/{zyb-yike-utils → utils}/urlExt.ts +0 -0
  71. /package/lib/{zyb-yike-utils → utils}/utils.ts +0 -0
@@ -1,782 +1,157 @@
1
1
  <template>
2
2
  <div class="qy-out-success-wechat-diversion">
3
- <!-- 无灌班支付成功 -->
4
- <div
5
- v-show="!isShow"
6
- class="daoliu-prompt-info"
7
- >
8
- <div class="info-content">
9
- <img src="https://qy-toufang.cdnjtzy.com/uploadFile/qy_41bfcae7a622afc0da48f29e56c74f55.png" alt="">
10
- <div class="text">报名成功</div>
11
- </div>
3
+ <!-- 报名成功 -->
4
+ <div class="pay-success-step">
5
+ <div class="step-icon">&#10003;</div>
6
+ <div class="step-text">{{ bgText }}</div>
12
7
  </div>
13
- <!-- 有灌班支付成功 -->
14
- <div v-show="isShow" class="pay-success-qrcode-content">
15
- <div class="title">
16
- <span class="icon"></span>
17
- <span class="title-text">{{ bgText }}</span>
18
- </div>
19
- <div class="diversion-info-content">
20
- <!-- 实时灌班 -->
21
- <div class="not-delay-info" v-if="[0, 1].includes(this.scence) ">
22
- <div class="not-delay-info-teacher">
23
- <div class="teacher-pic">
24
- <img
25
- class="teacher-pic-url"
26
- :src="teacherInfo.userPicUrl"
27
- alt="教师头像"
28
- />
29
- </div>
30
- <div class="teacher-wechat-content">
31
- <div class="wechat-name">
32
- <span class="name">{{ teacherInfo.lpcName }}</span
33
- ><span class="header-teacher">专属辅导老师</span>
34
- </div>
35
- <div class="wechat-id" v-if="!hideWechatId(true, teacherInfo)">
36
- 微信号:<span class="wechar-number">{{ teacherInfo.wxId }}</span>
37
- </div>
38
- </div>
39
- </div>
40
- <div class="no-delay-title">
41
- <div class="main-title">{{ getTitle }}</div>
42
- <div class="sub-title">{{ getTip }}</div>
43
- </div>
44
- </div>
45
- <!-- 延时灌班-文字 -->
46
- <div v-else class="delay-info">
47
- <div class="sub-title">
48
- {{ getTitle }}
49
- </div>
50
- <div class="delay-sub-title">
51
- {{ isWx ? "长按识别二维码" : "截屏保存二维码" }}
52
- </div>
53
- <div class="delay-sub-title">
54
- {{ getTip }}“{{ getName }}”
55
- </div>
56
- </div>
57
- <!-- 二维码 -->
58
- <div class="qr-code">
59
- <img
60
- @touchstart="gtouchstart()"
61
- @touchend="gtouchend()"
62
- class="qr-code-img"
63
- :class="[isWx ? 'qr-code-img-wechat' : '']"
64
- :src="getQrCode"
65
- alt="二维码"
66
- />
67
- </div>
68
- <div
69
- v-show="isShowCopyButton && (isUseQyuss === '0' || !isUseQyuss)"
70
- class="qr-code-button"
71
- ref="copyButton"
72
- @click="copyClick"
73
- :data-clipboard-text="getName"
74
- >
75
- <a class="button weixin-btn-color" :style="`background-color:${themeColor};`" href="javascript:void(0);">{{
76
- getCopyButtonText
77
- }}</a>
78
- </div>
79
- <div class="daoliu-success-info" v-if="getisShowGift">
80
- <div class="image-sub-title">
81
- 添加成功,额外获得以下福利
82
- </div>
83
- <img v-if="getGiftPic[0].imageUrl" class="success-img" :src="getGiftPic[0].imageUrl" alt="" />
84
- </div>
8
+ <!-- 加微二维码 -->
9
+ <div class="qrcode-section">
10
+ <p class="qrcode-tip">请务必添加企微二维码咨询</p>
11
+ <img
12
+ v-if="qrcode"
13
+ :src="qrcode"
14
+ class="qrcode-img"
15
+ @error="onQrcodeError"
16
+ />
17
+ <div v-else class="qrcode-placeholder">
18
+ <span>{{ isEdit ? '' : (error || '加载中...') }}</span>
85
19
  </div>
20
+ <p class="qrcode-sub">长按识别二维码添加</p>
21
+ </div>
22
+ <div class="notice">
23
+ <p>· 如二维码显示异常,请<span class="link" @click="fetchQrCode">点击此处</span>刷新</p>
24
+ <p>· 如无法添加请切换网络重试</p>
86
25
  </div>
87
26
  </div>
88
27
  </template>
89
- <script lang='ts'>
90
- import { Vue, Component, Prop, Watch, Mixins } from 'vue-property-decorator'
91
- // @ts-ignore: Unreachable code error
92
- import { platform, environment, getUserInfo } from '../../../lib/utils'
93
- import urlExt from '../../../lib/zyb-yike-utils/urlExt'
94
- import { service } from '../../../lib/request'
95
- // @ts-ignore: Unreachable code error
96
- import { toast as Toast, isMiniProgram } from '../../../lib/methods'
97
- // @ts-ignore: Unreachable code error
98
- import { getCommonWxXcxScheme } from '../../../lib/utils/weixin'
99
28
 
100
- import Clipboard from 'clipboard'
101
- const isEdit = process.env.VUE_APP_RUNTIME_PLATFORM === 'editor'
102
- const orderIds = urlExt.getQuery('orderIds')
103
- const lastfrom = urlExt.getQuery('lastfrom')
104
- const fromH5Wx = urlExt.getQuery('fromH5Wx')
105
- const pageData = (window as any).__PAGE_DATA__
106
- const actId = pageData?.actInfo?.actId
29
+ <script lang="ts">
30
+ import { Component, Vue, Prop } from 'vue-property-decorator'
31
+ import { service } from '../../../lib/request'
107
32
 
108
- @Component({
109
- components: {
110
- }
111
- })
33
+ @Component
112
34
  export default class QyOutSuccessWechatDiversion extends Vue {
113
- @Prop({ type: Array }) readonly actions!: any
114
- // 组件uid
115
- @Prop({ type: String, default: 0 }) readonly uid!: string
116
- // 组件name
117
- @Prop({ type: String, default: '' }) readonly componentName!: string
118
- // 背景文案
119
- @Prop({ type: String, default: '支付成功' }) readonly bgText!: string
120
- // 当前编辑端选择的是 实时灌班-微信 0 / 实时灌班-非微信 1 / 延迟灌班-微信 2 / 延迟灌班-非微信 3
121
- @Prop({ type: String, default: '0' }) guideType!: string
122
- // 实时灌班-微信 标题
123
- @Prop({ type: String, default: '添加老师微信,提前预习' }) readonly currentWxTitle!: string
124
- // 实时灌班-微信 提示语
125
- @Prop({ type: String, default: '长按识别二维码 即可添加' }) readonly currentWxTip!: string
126
- // 主题色
127
- @Prop({ type: String, default: '#FF5C34' }) readonly currentWxThemeColor!: string
128
- // 实时灌班-微信 是否展示复制按钮
129
- @Prop({ type: Number, default: 1 }) readonly currentWxisShowCopyButton!: number
130
- // 实时灌班-微信 复制按钮文案
131
- @Prop({ type: String, default: '复制微信号' }) readonly currentWxCopyButtonText!: string
132
- // 实时灌班-微信 按钮功能
133
- @Prop({ type: Number, default: 1 }) readonly currentWxButtonFunc!: number
134
- // 实时灌班-微信 跳转获客助手 按钮文案
135
- @Prop({ type: String, default: '添加老师微信' }) readonly currentWxJumpWxUrlText!: string
136
- // 实时灌班-微信 是否展示礼品图片
137
- @Prop({ type: Number, default: 1 }) readonly currentWxisShowGift!: number
138
- // 实时灌班-微信 礼品图片地址
139
- @Prop({ type: Array, default: () => [{ imageUrl: 'https://qy-toufang.cdnjtzy.com/uploadFile/qy_d3ae11809f403da0ca6ea9bd473bc549.png' }] }) currentWxGiftPic!: any[]
35
+ @Prop({ type: String, default: '报名成功' }) readonly bgText!: string
140
36
 
141
- // 实时灌班-非微信 标题
142
- @Prop({ type: String, default: '添加老师微信,提前预习' }) readonly currentNotWxTitle!: string
143
- // 实时灌班-非微信 提示语
144
- @Prop({ type: String, default: '截屏保存二维码或在微信搜索老师微信号' }) readonly currentNotWxTip!: string
145
- // 主题色
146
- @Prop({ type: String, default: '#FF5C34' }) readonly currentNotWxThemeColor!: string
147
- // 实时灌班-非微信 是否展示复制按钮
148
- @Prop({ type: Number, default: 1 }) readonly currentNotWxisShowCopyButton!: number
149
- // 实时灌班-微信 按钮功能
150
- @Prop({ type: Number, default: 1 }) readonly currentNotWxButtonFunc!: number
151
- // 实时灌班-微信 跳转获客助手 按钮文案
152
- @Prop({ type: String, default: '添加老师微信' }) readonly currentNotWxJumpWxUrlText!: string
153
- // 实时灌班-非微信 复制按钮文案
154
- @Prop({ type: String, default: '复制微信号,打开微信搜索' }) readonly currentNotWxCopyButtonText!: string
155
- // 实时灌班-非微信 跳转小程序按钮文案
156
- @Prop({ type: String, default: '打开微信' }) readonly currentNotWxJumpWxXcxText!: string
157
- // 实时灌班-非微信 是否展示礼品图片
158
- @Prop({ type: Number, default: 1 }) readonly currentNotWxisShowGift!: number
159
- // 实时灌班-非微信 礼品图片
160
- @Prop({ type: Array, default: () => [{ imageUrl: 'https://qy-toufang.cdnjtzy.com/uploadFile/qy_d3ae11809f403da0ca6ea9bd473bc549.png' }] }) currentNotWxGiftPic!: any[]
37
+ qrcode = ''
38
+ error = ''
161
39
 
162
- // 延迟灌班-微信 标题
163
- @Prop({ type: String, default: '关注微信公众号,获取上课信息' }) readonly delayWxTitle!: string
164
- // 延迟灌班-微信 提示语
165
- @Prop({ type: String, default: '即可关注' }) readonly delayWxTip!: string
166
- // 主题色
167
- @Prop({ type: String, default: '#FF5C34' }) readonly delayWxThemeColor!: string
168
- // 延迟灌班-微信 公众号名称
169
- @Prop({ type: String, default: '' }) readonly delayName!: string
170
- // 延迟灌班-微信 自定义二维码
171
- @Prop({ type: Array, default: () => [{ imageUrl: '' }] }) delayWxQrcode!: any[]
172
- // 延迟灌班-微信 是否展复制按钮
173
- @Prop({ type: Number, default: 1 }) readonly delayWxisShowCopyButton!: number
174
- // 延迟灌班-微信 复制按钮文案
175
- @Prop({ type: String, default: '复制公众号名称' }) readonly delayWxCopyButtonText!: string
176
- // 延迟灌班-微信 是否展示礼品图片
177
- @Prop({ type: Number, default: 1 }) readonly delayWxisShowGift!: number
178
- // 延迟灌班-微信 礼品图片地址
179
- @Prop({ type: Array, default: () => [{ imageUrl: 'https://qy-toufang.cdnjtzy.com/uploadFile/qy_d3ae11809f403da0ca6ea9bd473bc549.png' }] }) delayWxGiftPic!: any[]
180
-
181
- // 延迟灌班-微信 标题
182
- @Prop({ type: String, default: '关注微信公众号,获取上课信息' }) readonly delayNotWxTitle!: string
183
- // 延迟灌班-微信 提示语
184
- @Prop({ type: String, default: '或在微信搜索' }) readonly delayNotWxTip!: string
185
- // 主题色
186
- @Prop({ type: String, default: '#FF5C34' }) readonly delayNotWxThemeColor!: string
187
- // 延迟灌班-微信 公众号名称
188
- @Prop({ type: String, default: '' }) readonly delayNotName!: string
189
- // 延迟灌班-微信 自定义二维码
190
- @Prop({ type: Array, default: () => [{ imageUrl: '' }] }) delayNotWxQrcode!: any[]
191
- // 延迟灌班-微信 是否展复制按钮
192
- @Prop({ type: Number, default: 1 }) readonly delayNotWxisShowCopyButton!: number
193
- // 延迟灌班-微信 按钮功能
194
- @Prop({ type: Number, default: 1 }) readonly delayNotWxButtonFunc!: number
195
- // 延迟灌班-非微信 跳转小程序按钮文案
196
- @Prop({ type: String, default: '打开微信' }) readonly delayNotWxJumpWxXcxText!: string
197
- // 延迟灌班-微信 复制按钮文案
198
- @Prop({ type: String, default: '复制公众号名称' }) readonly delayNotWxCopyButtonText!: string
199
- // 延迟灌班-微信 是否展示礼品图片
200
- @Prop({ type: Number, default: 1 }) readonly delayNotWxisShowGift!: number
201
- // 延迟灌班-微信 礼品图片地址
202
- @Prop({ type: Array, default: () => [{ imageUrl: 'https://qy-toufang.cdnjtzy.com/uploadFile/qy_d3ae11809f403da0ca6ea9bd473bc549.png' }] }) delayNotWxGiftPic!: any[]
203
- // isWx: boolean = platform.isWechat
204
- scenceArr: string[] = ['currentWx', 'currentNotWx', 'delayWx', 'delayNotWx']
205
- addWxInfoList: any = []
206
- timeOutEvent: any = ''
207
- isUseQyuss: string = '0'
208
- qyuss: string = ''
209
- userId: number = 0 // 用户uid
210
- xcxUrlScheme: string = '' // 小程序url短链
211
- isMiniProgram: boolean = false
212
-
213
- get isWx () {
214
- if (isEdit) {
215
- if (['0', '2'].includes(this.guideType)) {
216
- return true
217
- } else {
218
- return false
219
- }
220
- } else {
221
- return platform.isWechat
222
- }
223
- }
224
- // 是否展示
225
- get isShow () {
226
- return isEdit || (orderIds && this.addWxInfoList.length)
227
- }
228
- // 根据环境判断,当前显示的场景 实时灌班-微信 0 / 实时灌班-非微信 1 / 延迟灌班-微信 2 / 延迟灌班-非微信 3
229
- get scence () {
230
- if (isEdit) {
231
- return Number(this.guideType)
232
- } else {
233
- const isDelay = this.addWxInfoList[0] ? this.addWxInfoList[0].courseDelayStatus : 1
234
- if (!isDelay && this.isWx) {
235
- // 实时灌班-微信
236
- return 0
237
- }
238
- if (!isDelay && !this.isWx) {
239
- // 实时灌班-非微信
240
- return 1
241
- }
242
- if (isDelay && this.isWx) {
243
- // 延时灌班-微信
244
- return 2
245
- }
246
- if (isDelay && !this.isWx) {
247
- // 延时灌班-非微信
248
- return 3
249
- }
250
- return -1
251
- }
252
- }
253
- // 展示的公众号名称
254
- get getName () {
255
- const scenceName = this.scenceArr[this.scence]
256
- if ([2, 3].includes(this.scence)) {
257
- let nameScence = ''
258
- if (Number(this.scence) === 2) {
259
- nameScence = 'delay'
260
- }
261
- if (Number(this.scence) === 3) {
262
- nameScence = 'delayNot'
263
- }
264
- // 延时灌班,展示名称
265
- return this.$props[`${nameScence}Name`]
266
- } else {
267
- // 展示的是老师的微信号
268
- return (this.addWxInfoList[0] ? this.addWxInfoList[0] : {}).wxId
269
- }
270
- }
271
- // 教师信息
272
- get teacherInfo () {
273
- return this.addWxInfoList[0] ? this.addWxInfoList[0] : {}
274
- }
275
- // 标题
276
- get getTitle () {
277
- const scenceName = this.scenceArr[this.scence]
278
- return this.$props[`${scenceName}Title`]
279
- }
280
- // 提示语
281
- get getTip () {
282
- const scenceName = this.scenceArr[this.scence]
283
- return this.$props[`${scenceName}Tip`]
284
- }
285
- // 展示二维码
286
- get getQrCode () {
287
- const scenceName = this.scenceArr[this.scence]
288
- if ([0, 1].includes(this.scence)) {
289
- // 实时灌班
290
- return (this.addWxInfoList[0] ? this.addWxInfoList[0] : {}).qrCode
291
- } else {
292
- // 延时灌班
293
- return this.$props[`${scenceName}Qrcode`][0].imageUrl
294
- }
295
- }
296
- // 是否展示复制按钮
297
- get isShowCopyButton () {
298
- const scenceName = this.scenceArr[this.scence]
299
- return this.$props[`${scenceName}isShowCopyButton`]
300
- }
301
- // 是否是跳转获客助手
302
- get isJumpWxLink () {
303
- const scenceName = this.scenceArr[this.scence]
304
- const isJumpWxLink = this.$props[`${scenceName}ButtonFunc`]
305
- return isJumpWxLink && isJumpWxLink === 2
306
- }
307
- // 是否是跳转小程序
308
- get isJumpXcx () {
309
- const scenceName = this.scenceArr[this.scence]
310
- const isJumpWxLink = this.$props[`${scenceName}ButtonFunc`]
311
- return isJumpWxLink && isJumpWxLink === 3
312
- }
313
- get buttonFuncType () {
314
- if (this.isJumpWxLink) {
315
- return 1
316
- }
317
- if (this.isJumpXcx) {
318
- return 2
319
- }
320
- return 0
40
+ get isEdit () {
41
+ return (this as any).$attrs?.isEdit === true || location.href.includes('workbench')
321
42
  }
322
43
 
323
- // 复制按钮文案
324
- get getCopyButtonText () {
325
- const scenceName = this.scenceArr[this.scence]
326
- if (this.isJumpWxLink) {
327
- return this.$props[`${scenceName}JumpWxUrlText`]
328
- } else {
329
- if (this.isJumpXcx) {
330
- return this.$props[`${scenceName}JumpWxXcxText`]
331
- } else {
332
- return this.$props[`${scenceName}CopyButtonText`]
333
- }
334
- }
335
- }
336
- get getisShowGift () {
337
- const scenceName = this.scenceArr[this.scence]
338
- return this.$props[`${scenceName}isShowGift`]
339
- }
340
- get getGiftPic () {
341
- const scenceName = this.scenceArr[this.scence]
342
- return this.$props[`${scenceName}GiftPic`]
343
- }
344
- get themeColor () {
345
- const scenceName = this.scenceArr[this.scence]
346
- return this.$props[`${scenceName}ThemeColor`]
347
- }
348
-
349
- @Watch('scence', { immediate: true })
350
- scenceChange (val: number) {
351
- if (isEdit) {
352
- if ([0, 1].includes(val)) {
353
- this.addWxInfoList = [{
354
- courseDelayStatus: 0,
355
- userPicUrl: 'https://img.zuoyebang.cc/qy_8706f1e68115ac8fc5e956a064526bf7.jpg',
356
- lpcName: '小鱼儿老师',
357
- courseName: '【语文课】',
358
- courseId: 1,
359
- qrCode: 'https://img.zuoyebang.cc/qy_0901222f26448287d0aef0921675c35d.jpg',
360
- wxId: '111111',
361
- labelAppleId: 'gh_b9debf844820',
362
- jumpUrl: 'pages/middlelink/middlelink?applyScene=app_middle_page&redirectUri=&sceneValue=1015',
363
- customer_acquisition_link: '111'
364
- }]
365
- } else {
366
- this.addWxInfoList = [{
367
- courseDelayStatus: 1,
368
- name: '公众号名称',
369
- qrCode: 'https://qy-toufang.cdnjtzy.com/uploadFile/qy_d3ae11809f403da0ca6ea9bd473bc549.png'
370
- }]
371
- }
372
- }
373
- }
374
- getChannel () {
375
- const channel = Array.isArray(lastfrom) ? lastfrom[0].split('_')[2] : lastfrom.split('_')[2]
376
- if (!channel) { return '' }
377
- return channel
378
- }
379
- copyClick () {
380
- // 复制按钮点击
381
- }
382
- initClipboard () {
383
- const qrCodeButton = document.querySelectorAll('.qr-code-button')
384
- const clipboard = new Clipboard(qrCodeButton)
385
- clipboard.on('success', (e) => {
386
- console.log('复制成功,请在微信粘贴添加')
387
- let message = '微信号已复制~'
388
- if (this.scence === 0) {
389
- // 实时灌班-微信
390
- message = '已复制微信号'
391
- if (!isEdit && this.isJumpWxLink && this.teacherInfo.customer_acquisition_link) {
392
- // 跳转获客助手
393
- window.location.href = this.teacherInfo.customer_acquisition_link
394
- }
395
- }
396
- if (this.scence === 1) {
397
- // 实时灌班-非微信
398
- message = '微信号已复制,去微信搜索老师并添加吧'
399
- if (!isEdit && this.isJumpWxLink && this.teacherInfo.customer_acquisition_link) {
400
- // 跳转获客助手
401
- window.location.href = this.teacherInfo.customer_acquisition_link
402
- } else {
403
- if (this.isJumpXcx) {
404
- message = ''
405
- this.jumpXcx()
406
- }
407
- }
408
- }
409
- if (this.scence === 2) {
410
- // 延时灌班-微信
411
- message = '微信号已复制,去微信搜索老师并添加吧'
412
- }
413
- if (this.scence === 3) {
414
- // 延时灌班-非微信
415
- message = `公众号"${this.getName}"已复制`
416
- if (this.isJumpXcx) {
417
- message = ''
418
- this.jumpXcx()
419
- }
420
- }
421
- if (message) {
422
- Toast(message)
423
- }
424
- })
425
- clipboard.on('error', (e) => {
426
- console.log('复制失败,请再次尝试')
427
- Toast('复制失败,当前浏览器不支持复制')
428
- })
429
- }
430
- gtouchstart (e: any) {
431
- this.timeOutEvent = setTimeout(() => {
432
- // 长按3秒
433
- this.timeOutEvent = 0
434
- }, 1500)
435
- }
436
- gtouchend () {
437
- clearTimeout(this.timeOutEvent)
438
- this.timeOutEvent = 0
439
- }
440
- hideWechatId (isNotDelay: boolean, wxInfo: any) {
441
- if (!isNotDelay) return false
442
- const wxTypeWeCom = '2' // 企业微信
443
- if (wxInfo && wxInfo.wxType && wxInfo.wxType === wxTypeWeCom) {
444
- return true
44
+ mounted () {
45
+ if (!this.isEdit) {
46
+ this.fetchQrCode()
445
47
  }
446
- return false
447
48
  }
448
49
 
449
- // 跳转小程序方法
450
- async jumpXcx () {
451
- if (this.xcxUrlScheme) {
452
- location.href = this.xcxUrlScheme
453
- } else {
454
- await this.getUserInfo()
455
- await this.getXcxScheme()
456
- this.jumpXcx()
457
- }
50
+ get pageQuery () {
51
+ return (this as any).$utils ? (this as any).$utils.getUrlParams() : {}
458
52
  }
459
53
 
460
- // 获取小程序短链
461
- async getXcxScheme () {
462
- const pageId = urlExt.getQuery('pageId')
463
- const groupId = urlExt.getQuery('groupId')
464
- let successPageInfoParam: any = encodeURIComponent(JSON.stringify({ pageId, groupId }))
465
- const schemeUrlRes: any = await getCommonWxXcxScheme({
466
- appId: 'wx6ecf667b0a8527c2',
467
- path: '/pages/webview/index',
468
- ext: {
469
- lastfrom,
470
- successPageInfo: successPageInfoParam,
471
- isUseQyuss: 1,
472
- actId,
473
- qyuss: this.qyuss,
474
- orderIds
475
- }
476
- })
477
- console.log('getCommonWxXcxScheme', schemeUrlRes)
478
- if (schemeUrlRes && schemeUrlRes.openlink) {
479
- this.xcxUrlScheme = schemeUrlRes.openlink
480
- }
481
- }
54
+ async fetchQrCode () {
55
+ if (this.isEdit) return
482
56
 
483
- // 获取用户UID
484
- async getUserInfo () {
485
- const loginStatus: any = await getUserInfo()
486
- if (loginStatus && loginStatus.uid) {
487
- this.userId = loginStatus.uid
488
- this.qyuss = loginStatus.qyuss
57
+ const { orderId, userId } = this.pageQuery
58
+ if (!orderId || !userId) {
59
+ this.error = '缺少订单参数'
60
+ return
489
61
  }
490
- }
491
62
 
492
- async getData () {
493
- console.log('getData', this.isUseQyuss, this.isMiniProgram)
494
- if (this.isUseQyuss && this.isMiniProgram && !isEdit) {
495
- // 在小程序内,且拥有isUseQyuss参数
496
- await service({
497
- method: 'get',
498
- url: '/cube/api/wx/v2/out/payresult',
499
- params: {
500
- orderIds,
501
- qyuss: this.qyuss,
502
- channelId: 14
63
+ for (let i = 0; i < 5; i++) {
64
+ try {
65
+ this.error = ''
66
+ const res: any = await service.get('/common/api/getOrderQrCode', {
67
+ params: { orderId, userId }
68
+ })
69
+ if (res && res.data && res.data.qrCode) {
70
+ this.qrcode = res.data.qrCode
71
+ return
503
72
  }
504
- }).then((res:any) => {
505
- this.addWxInfoList = res.data.list || []
506
- // 复制初始化
507
- // this.initClipboard()
508
- }).catch((err: any) => {})
509
- } else {
510
- // fromH5Wx = 1 标识 可能是扩科从支付返回来的
511
- if (!isEdit && Number(fromH5Wx) !== 1) {
512
- await service({
513
- method: 'get',
514
- url: '/cube/api/wx/v2/payresult',
515
- params: {
516
- orderIds,
517
- channelId: 14
518
- }
519
- }).then((res:any) => {
520
- this.addWxInfoList = res.data.list || []
521
- // 复制初始化
522
- // this.initClipboard()
523
- }).catch((err: any) => {})
73
+ } catch (e) {
74
+ console.error('获取二维码失败:', e)
524
75
  }
525
- }
526
- }
527
- async created () {
528
- this.isUseQyuss = urlExt.getQuery('isUseQyuss')
529
- this.qyuss = urlExt.getQuery('qyuss')
530
- const isMiniProgramRes: any = await isMiniProgram()
531
- this.isMiniProgram = isMiniProgramRes
532
- await this.getData()
533
- await this.getUserInfo()
534
- if (this.isJumpXcx && !this.isMiniProgram) {
535
- await this.getXcxScheme()
536
- // 选了跳小程序,拿到了短链直接跳
537
- if (this.xcxUrlScheme) {
538
- setTimeout(() => {
539
- location.href = this.xcxUrlScheme
540
- }, 1000)
76
+ if (i < 4) {
77
+ await new Promise(r => setTimeout(r, 3000))
541
78
  }
542
79
  }
80
+ this.error = '获取二维码失败,请点击刷新重试'
543
81
  }
544
- async mounted () {
545
- this.initClipboard()
82
+
83
+ onQrcodeError () {
84
+ this.qrcode = ''
85
+ this.error = '二维码加载失败,请点击刷新重试'
546
86
  }
547
87
  }
548
88
  </script>
89
+
549
90
  <style lang="less" scoped>
550
91
  .qy-out-success-wechat-diversion {
551
- // background-color: #fff;
552
- .daoliu-prompt-info {
553
- padding-top: 2.5rem;
554
- background-color: #FFF;
555
- .info-content {
556
- text-align: center;
557
- img {
558
- width: 1.28rem;
559
- height: 1.28rem;
560
- }
561
- .text {
562
- font-size: 0.4rem;
563
- color: #333333;
564
- text-align: center;
565
- line-height: 0.58rem;
566
- font-weight: 400;
567
- }
568
- }
92
+ padding: 30px 20px;
93
+ text-align: center;
94
+ }
95
+
96
+ .pay-success-step {
97
+ margin-bottom: 24px;
98
+ .step-icon {
99
+ display: inline-flex;
100
+ align-items: center;
101
+ justify-content: center;
102
+ width: 48px;
103
+ height: 48px;
104
+ border-radius: 50%;
105
+ background: #67C23A;
106
+ color: #fff;
107
+ font-size: 28px;
108
+ margin-bottom: 8px;
109
+ }
110
+ .step-text {
111
+ font-size: 18px;
112
+ font-weight: 600;
113
+ color: #303133;
569
114
  }
570
- .pay-success-qrcode-content {
571
- padding-top: .48rem;
572
- width: 100%;
573
- height: auto;
574
- background-image: url('https://qy-toufang.cdnjtzy.com/uploadFile/qy_d4030e8617e52c8955b2c74db45d0cc6.png');
575
- background-position: top center;
576
- background-repeat: no-repeat;
577
- background-size: 100% auto;
578
- overflow: hidden;
579
- .title {
580
- width: 100%;
581
- text-align: center;
582
- margin-bottom: 0.48rem;
583
- height: 0.48rem;
584
- overflow: hidden;
585
- .icon {
586
- overflow: hidden;
587
- box-sizing: border-box;
588
- display: inline-block;
589
- width: 0.4rem;
590
- height: 0.4rem;
591
- margin-right: 0.16rem;
592
- background-image: url('https://qy-toufang.cdnjtzy.com/uploadFile/qy_e6be485136581464241cb2ebfc200984.png');
593
- background-repeat: no-repeat;
594
- background-position: top left;
595
- background-size: 100%;
596
- vertical-align: top;
597
- }
598
- .title-text {
599
- display: inline-block;
600
- font-family: PingFangSC-Medium;
601
- font-size: 0.4rem;
602
- height: 0.4rem;
603
- color: #FFFFFF;
604
- line-height: 0.4rem;
605
- font-weight: 500;
606
- }
607
- }
115
+ }
116
+
117
+ .qrcode-section {
118
+ margin-bottom: 24px;
119
+ .qrcode-tip {
120
+ font-size: 16px;
121
+ color: #333;
122
+ margin-bottom: 16px;
123
+ }
124
+ .qrcode-img {
125
+ width: 200px;
126
+ height: 200px;
127
+ border-radius: 8px;
128
+ }
129
+ .qrcode-placeholder {
130
+ display: inline-flex;
131
+ align-items: center;
132
+ justify-content: center;
133
+ width: 200px;
134
+ height: 200px;
135
+ border-radius: 8px;
136
+ background: #f5f5f5;
137
+ color: #999;
138
+ font-size: 14px;
139
+ }
140
+ .qrcode-sub {
141
+ font-size: 14px;
142
+ color: #999;
143
+ margin-top: 12px;
608
144
  }
609
- .diversion-info-content {
610
- width: 6.56rem;
611
- background:rgba(255,255,255,1);
612
- margin: 0 auto;
613
- border-radius: 0.16rem;
614
- padding: 0.32rem 0.32rem 0;
615
- .not-delay-info {
616
- width: 100%;
617
- // padding-bottom: 0.32rem;
618
- box-sizing: border-box;
619
- // margin-bottom: 0.32rem;
620
- .not-delay-info-teacher {
621
- display: flex;
622
- align-items: center;
623
- width: 100%;
624
- border-bottom: 0.01rem dashed #E5E5E5;
625
- padding-bottom: 0.32rem;
626
- box-sizing: border-box;
627
- margin-bottom: 0.32rem;
628
- .teacher-pic {
629
- width: 0.8rem;
630
- height: 0.8rem;
631
- border-radius: 0.4rem;
632
- overflow: hidden;
633
- .teacher-pic-url{
634
- width: 100%;
635
- height: 100%;
636
- }
637
- }
638
- .teacher-wechat-content{
639
- margin-left: 0.16rem;
640
- box-sizing: border-box;
641
- padding-bottom: 0.06rem;
642
- .wechat-name {
643
- .name {
644
- // height: 0.28rem;
645
- font-size: 0.28rem;
646
- font-weight: 600;
647
- line-height: 0.28rem;
648
- font-family: PingFangSC-Semibold;
649
- color: #333333;
650
- }
651
- .header-teacher {
652
- box-sizing: border-box;
653
- margin-left: 0.16rem;
654
- width: 1.28rem;
655
- height: 0.32rem;
656
- border-radius: 0.04rem;
657
- background-color: #FFF2EE;
658
- font-size: 0.2rem;
659
- font-family: PingFangSC-Medium;
660
- font-weight:400;
661
- color: #FF7F58;
662
- line-height: 0.32rem;
663
- text-align: center;
664
- padding: 0 0.04rem;
665
- vertical-align: text-bottom;
666
- }
667
- }
668
- .wechat-id {
669
- margin-top: .08rem;
670
- height: 0.24rem;
671
- font-size: 0.24rem;
672
- font-weight:400;
673
- color: #999;
674
- line-height: 0.24rem;
675
- }
676
- }
677
- }
678
- .no-delay-title {
679
- .main-title {
680
- font-family: PingFangSC-Medium;
681
- font-size: 0.32rem;
682
- color: #333333;
683
- text-align: center;
684
- line-height: 0.32rem;
685
- font-weight: 500;
686
- margin-bottom: 0.24rem;
687
- }
688
- .sub-title {
689
- font-family: PingFangSC-Regular;
690
- font-size: 0.24rem;
691
- color: #999999;
692
- text-align: center;
693
- line-height: 0.24rem;
694
- font-weight: 400;
695
- }
696
- }
697
- }
698
- .delay-info {
699
- width: 100%;
700
- box-sizing: border-box;
701
- padding-top: 0.08rem;
702
- // padding-bottom: 0.32rem;
703
- .sub-title {
704
- font-family: PingFangSC-Medium;
705
- width: 100%;
706
- font-size: 0.32rem;
707
- color: #333333;
708
- text-align: center;
709
- line-height: 0.32rem;
710
- font-weight: 500;
711
- margin-bottom: 0.2rem;
712
- }
713
- .delay-sub-title {
714
- width: 100%;
715
- font-family: PingFangSC-Regular;
716
- font-size: 0.24rem;
717
- color: #999999;
718
- text-align: center;
719
- line-height: 0.36rem;
720
- font-weight: 400;
721
- }
722
- }
723
- .qr-code {
724
- font-size: 0;
725
- width: 2.4rem;
726
- height: 2.4rem;
727
- background: #FFFFFF;
728
- border: 0.01rem solid #EDEFF0;
729
- border-radius: 0.08rem;
730
- text-align: center;
731
- padding: 0.16rem;
732
- box-sizing: border-box;
733
- margin: 0 auto;
734
- margin-bottom: 0.32rem;
735
- margin-top: 0.32rem;
736
- .qr-code-img {
737
- display: inline-block;
738
- width: 2.08rem;
739
- height: 2.08rem;
740
- }
741
- .qr-code-img-wechat {
742
- pointer-events: auto !important;
743
- }
744
- }
745
- .qr-code-button {
746
- width: 100%;
747
- box-sizing: border-box;
748
- padding-bottom: 0.32rem;
749
- .button {
750
- display: inline-block;
751
- width: 100%;
752
- height: 0.8rem;
753
- line-height: 0.8rem;
754
- text-align: center;
755
- border-radius: 0.4rem;
756
- font-size: 0.32rem;
757
- text-decoration: none;
758
- font-family: PingFangSC-Regular;
759
- color: #FFFFFF;
760
- text-align: center;
761
- font-weight: 400;
762
- }
763
- }
764
- .daoliu-success-info {
765
- width: 100%;
766
- .image-sub-title {
767
- width: 100%;
768
- font-size: .24rem;
769
- font-family: PingFangSC-Regular;
770
- color: rgba(0,0,0,0.60);
771
- text-align: center;
772
- line-height: 0.24rem;
773
- font-weight: 400;
774
- }
775
- .success-img{
776
- width: 100%;
777
- height: auto;
778
- }
779
- }
145
+ }
146
+
147
+ .notice {
148
+ text-align: left;
149
+ font-size: 13px;
150
+ color: #666;
151
+ line-height: 1.8;
152
+ .link {
153
+ color: #2677F0;
154
+ cursor: pointer;
780
155
  }
781
156
  }
782
157
  </style>