Browse Source

直播详情&报名结果页公众号二维码修改

master
kola-web 1 month ago
parent
commit
ef81e069ee
  1. 28
      eslint.config.js
  2. 28
      eslint.config.mjs
  3. 8
      package.json
  4. 2596
      pnpm-lock.yaml
  5. 2
      project.config.json
  6. 53
      src/app.ts
  7. 11
      src/components/popup/index.scss
  8. 3
      src/components/popup/index.wxml
  9. BIN
      src/images/bg32.png
  10. 20
      src/patient/pages/liveDetail/index.ts
  11. 18
      src/patient/pages/liveResult/index.ts
  12. 2
      src/patient/pages/liveResult/index.wxml
  13. 2
      typings/index.d.ts

28
eslint.config.js

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
import antfu from '@antfu/eslint-config'
export default antfu({
env: {
es6: true,
},
parserOptions: { project: ['./tsconfig.json'] },
globals: {
wx: true,
App: true,
Page: true,
getCurrentPages: true,
getApp: true,
Component: true,
requirePlugin: true,
requireMiniProgram: true,
},
rules: {
'eslint-comments/no-unlimited-disable': 'off',
'ts/no-require-imports': 'off',
eqeqeq: 'off',
},
formatters: {
css: 'prettier',
html: 'prettier',
markdown: 'prettier',
},
})

28
eslint.config.mjs

@ -1,28 +0,0 @@ @@ -1,28 +0,0 @@
// eslint.config.mjs
import antfu from '@antfu/eslint-config'
import prettierConfig from 'eslint-config-prettier'
export default antfu(
{
env: {
es6: true,
},
stylistic: false,
parserOptions: { project: ['./tsconfig.json'] },
globals: {
wx: true,
App: true,
Page: true,
getCurrentPages: true,
getApp: true,
Component: true,
requirePlugin: true,
requireMiniProgram: true,
},
rules: {
'eslint-comments/no-unlimited-disable': 'off',
'ts/no-require-imports': 'off',
},
},
prettierConfig,
)

8
package.json

@ -17,10 +17,10 @@ @@ -17,10 +17,10 @@
"typescript": "^5.3.3"
},
"devDependencies": {
"@antfu/eslint-config": "^3.7.3",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
"miniprogram-api-typings": "^4.0.1",
"@antfu/eslint-config": "^6.2.0",
"eslint": "^9.38.0",
"eslint-plugin-format": "^1.0.2",
"miniprogram-api-typings": "^4.1.0",
"prettier": "3.3.3"
}
}

2596
pnpm-lock.yaml

File diff suppressed because it is too large Load Diff

2
project.config.json

@ -71,5 +71,5 @@ @@ -71,5 +71,5 @@
}
]
},
"appid": "wx71ac9c27c3c3e3f4"
"appid": "wxf9ce8010f1ad24aa"
}

53
src/app.ts

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
import dayjs from 'dayjs'
import licia from 'miniprogram-licia'
import component from '@/utils/component'
import relativeTime from '@/utils/dayjs/relativeTime.js'
import page from '@/utils/page'
import { request } from '@/utils/request'
import { parseScene } from './utils/util'
const dayjs = require('dayjs')
const licia = require('miniprogram-licia')
require('/utils/dayjs/day-zh-cn.js')
@ -16,15 +16,15 @@ App<IAppOption>({ @@ -16,15 +16,15 @@ App<IAppOption>({
// 测试号 wx2b0bb13edf717c1d
// dev
// appid:wxf9ce8010f1ad24aa
// url: 'https://m.xd.hbraas.com',
// upFileUrl: 'https://m.xd.hbraas.com/',
// imageUrl: 'https://m.xd.hbraas.com/xd/',
url: 'https://m.xd.hbraas.com',
upFileUrl: 'https://m.xd.hbraas.com/',
imageUrl: 'https://m.xd.hbraas.com/xd/',
// pro
// appid:wx71ac9c27c3c3e3f4
url: 'https://m.xd.hbsaas.com',
upFileUrl: 'https://m.xd.hbsaas.com/',
imageUrl: 'https://m.xd.hbsaas.com/api/xd/',
// url: 'https://m.xd.hbsaas.com',
// upFileUrl: 'https://m.xd.hbsaas.com/',
// imageUrl: 'https://m.xd.hbsaas.com/api/xd/',
loginState: '',
isLogin: 0,
@ -114,7 +114,8 @@ App<IAppOption>({ @@ -114,7 +114,8 @@ App<IAppOption>({
onShow(options) {
if (options.query.scene) {
this.globalData.scene = parseScene(options.query.scene)
} else if (options.query.proMethodId) {
}
else if (options.query.proMethodId) {
this.globalData.scene.proMethodId = options.query.proMethodId
}
},
@ -235,7 +236,7 @@ App<IAppOption>({ @@ -235,7 +236,7 @@ App<IAppOption>({
data: {},
}) as Promise<never>
},
mpBehavior(data: { doctor?: boolean; PageName: string }) {
mpBehavior(data: { doctor?: boolean, PageName: string }) {
let url = '?r=zd/mp-behavior/add'
if (data.doctor) {
url = '?r=zd/doctor/mp-behavior/add'
@ -267,9 +268,10 @@ App<IAppOption>({ @@ -267,9 +268,10 @@ App<IAppOption>({
})
},
// zd相关函数
zdMpBehavior(data: { PageName: string; doctor?: boolean }) {
zdMpBehavior(data: { PageName: string, doctor?: boolean }) {
const { loginType } = this.globalData
if (loginType === 0) return
if (loginType === 0)
return
let url = '?r=zd/mp-behavior/add'
if (data.doctor) {
url = '?r=zd/doctor/mp-behavior/add'
@ -296,13 +298,15 @@ App<IAppOption>({ @@ -296,13 +298,15 @@ App<IAppOption>({
if (this.zdVerifySys(pub)) {
if (this.globalData.loginType === 1) {
this.zdRegistrationVerification(() => resolve(), loginPage)
} else {
}
else {
resolve()
}
}
}
const unRegFun = (resolve) => {
if (!this.zdVerifySys(pub)) return
if (!this.zdVerifySys(pub))
return
resolve()
}
return new Promise((resolve: (value?) => void) => {
@ -360,11 +364,14 @@ App<IAppOption>({ @@ -360,11 +364,14 @@ App<IAppOption>({
let urlKey = ''
if (!PatientId) {
urlKey = 'enterInfo'
} else if (AuditStatus == 0) {
}
else if (AuditStatus == 0) {
urlKey = 'noCert'
} else if (AuditStatus == 1) {
}
else if (AuditStatus == 1) {
urlKey = isFollow ? 'nopending' : 'pending'
} else if (AuditStatus == 2) {
}
else if (AuditStatus == 2) {
urlKey = 'reject'
}
const navUrl = {
@ -415,7 +422,8 @@ App<IAppOption>({ @@ -415,7 +422,8 @@ App<IAppOption>({
})
return false
}
if (ignorePath.includes(url)) return true
if (ignorePath.includes(url))
return true
if (loginType === 1) {
if (url.includes('doctor/pages')) {
@ -423,14 +431,16 @@ App<IAppOption>({ @@ -423,14 +431,16 @@ App<IAppOption>({
url: '/pages/index/index',
})
return false
} else {
}
else {
return true
}
}
if (loginType === 2 && !pub) {
if (url.includes('doctor/pages')) {
return true
} else {
}
else {
const params = Object.entries(options)
.map(([key, value]) => `${key}=${value}`)
.join('&')
@ -455,7 +465,8 @@ App<IAppOption>({ @@ -455,7 +465,8 @@ App<IAppOption>({
url: '/patient/pages/login/index',
})
isReject = true
} else if (!isNewReg) {
}
else if (!isNewReg) {
wx.reLaunch({
url: '/patient/pages/enterInfo/index',
})

11
src/components/popup/index.scss

@ -129,10 +129,19 @@ @@ -129,10 +129,19 @@
.popup6 {
width: 590rpx;
height: 880rpx;
position: relative;
.p-img {
width: 100%;
height: 100%;
}
.code {
position: absolute;
top: 350rpx;
left: 50%;
transform: translateX(-50%);
width: 290rpx;
height: 290rpx;
}
}
.popup7 {
@ -187,7 +196,7 @@ @@ -187,7 +196,7 @@
width: 100%;
height: 100%;
}
.code{
.code {
position: absolute;
top: 372rpx;
left: 50%;

3
src/components/popup/index.wxml

@ -55,7 +55,8 @@ @@ -55,7 +55,8 @@
</view>
</view>
<view class="popup6" wx:if="{{type==='popup6'}}">
<image class="p-img" src="{{imageUrl}}bg20.png?t={{Timestamp}}" show-menu-by-longpress></image>
<image class="p-img" src="{{imageUrl}}bg32.png?t={{Timestamp}}"></image>
<image class="code" src="{{params.qrCode}}" show-menu-by-longpress></image>
</view>
<view class="popup7" wx:if="{{type==='popup7'}}">
<image class="badge" src="{{imageUrl}}icon78.png?t={{Timestamp}}"></image>

BIN
src/images/bg32.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

20
src/patient/pages/liveDetail/index.ts

@ -393,12 +393,22 @@ Page({ @@ -393,12 +393,22 @@ Page({
})
},
handleOffice() {
this.setData({
popupShow: true,
popupType: 'popup6',
popupParams: {
close: true,
wx.ajax({
method: 'GET',
url: '?r=zd/common/get-channel-wx-code',
data: {
ChannelType: this.data.detail.Type == 1 ? '1' : '11',
Id: this.data.id,
},
}).then((res) => {
this.setData({
popupShow: true,
popupType: 'popup6',
popupParams: {
qrCode: res,
close: true,
},
})
})
},
handlePopupCancel() {

18
src/patient/pages/liveResult/index.ts

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
const app = getApp<IAppOption>()
import dayjs from 'dayjs'
const app = getApp<IAppOption>()
let live_time: null | number = null
Page({
@ -11,6 +11,7 @@ Page({ @@ -11,6 +11,7 @@ Page({
codeUrl: '',
dateValue: '' as string | number,
rewardScore: 0 as number | undefined,
qrCode: '',
},
onLoad(options) {
this.setData({
@ -47,6 +48,21 @@ Page({ @@ -47,6 +48,21 @@ Page({
this.setData({
detail: res,
})
this.getQrCode()
})
},
getQrCode() {
wx.ajax({
method: 'GET',
url: '?r=zd/common/get-channel-wx-code',
data: {
ChannelType: this.data.detail.Type == 1 ? '1' : '11',
Id: this.data.id,
},
}).then((res) => {
this.setData({
qrCode: res,
})
})
},
getLiveDetail() {

2
src/patient/pages/liveResult/index.wxml

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
<view class="tip">欢迎您参与此次活动</view>
<view class="office">
<view class="o-title">关注公众号,活动提醒不错过</view>
<image class="code" src="{{imageUrl}}code1.png?t={{Timestamp}}" show-menu-by-longpress></image>
<image class="code" src="{{qrCode}}" show-menu-by-longpress></image>
<view class="btn">长按识别二维码</view>
</view>
<view class="container">

2
typings/index.d.ts vendored

@ -1,3 +1,5 @@ @@ -1,3 +1,5 @@
declare module 'miniprogram-licia';
type pageType = 0 | 1 | 2
interface IAppOption {
globalData: {

Loading…
Cancel
Save