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 @@
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 @@
// 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 @@
"typescript": "^5.3.3" "typescript": "^5.3.3"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^3.7.3", "@antfu/eslint-config": "^6.2.0",
"eslint": "^9.12.0", "eslint": "^9.38.0",
"eslint-config-prettier": "^9.1.0", "eslint-plugin-format": "^1.0.2",
"miniprogram-api-typings": "^4.0.1", "miniprogram-api-typings": "^4.1.0",
"prettier": "3.3.3" "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 @@
} }
] ]
}, },
"appid": "wx71ac9c27c3c3e3f4" "appid": "wxf9ce8010f1ad24aa"
} }

53
src/app.ts

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

11
src/components/popup/index.scss

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

3
src/components/popup/index.wxml

@ -55,7 +55,8 @@
</view> </view>
</view> </view>
<view class="popup6" wx:if="{{type==='popup6'}}"> <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>
<view class="popup7" wx:if="{{type==='popup7'}}"> <view class="popup7" wx:if="{{type==='popup7'}}">
<image class="badge" src="{{imageUrl}}icon78.png?t={{Timestamp}}"></image> <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({
}) })
}, },
handleOffice() { handleOffice() {
this.setData({ wx.ajax({
popupShow: true, method: 'GET',
popupType: 'popup6', url: '?r=zd/common/get-channel-wx-code',
popupParams: { data: {
close: true, 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() { handlePopupCancel() {

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

@ -1,5 +1,5 @@
const app = getApp<IAppOption>()
import dayjs from 'dayjs' import dayjs from 'dayjs'
const app = getApp<IAppOption>()
let live_time: null | number = null let live_time: null | number = null
Page({ Page({
@ -11,6 +11,7 @@ Page({
codeUrl: '', codeUrl: '',
dateValue: '' as string | number, dateValue: '' as string | number,
rewardScore: 0 as number | undefined, rewardScore: 0 as number | undefined,
qrCode: '',
}, },
onLoad(options) { onLoad(options) {
this.setData({ this.setData({
@ -47,6 +48,21 @@ Page({
this.setData({ this.setData({
detail: res, 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() { getLiveDetail() {

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

@ -16,7 +16,7 @@
<view class="tip">欢迎您参与此次活动</view> <view class="tip">欢迎您参与此次活动</view>
<view class="office"> <view class="office">
<view class="o-title">关注公众号,活动提醒不错过</view> <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 class="btn">长按识别二维码</view>
</view> </view>
<view class="container"> <view class="container">

2
typings/index.d.ts vendored

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

Loading…
Cancel
Save