✨ feat(37需求): 打开webview的页面
This commit is contained in:
@@ -65,7 +65,8 @@ export enum ACTIVITY_TYPE {
|
||||
BIND_PHONE = 50, // 绑定手机号
|
||||
WEEKLY_FUND = 51, // 周基金
|
||||
MONTHLY_FUND = 52, // 月基金
|
||||
REBATE = 53, // 返利
|
||||
REBATE = 53, // 返利
|
||||
WEBVIEW = 54, // 平台活动页面
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+5
-3
@@ -13,6 +13,8 @@ export default class Link extends BaseModel {
|
||||
@prop({ required: true, default: '' })
|
||||
link: string; // 外链
|
||||
@prop({ required: true, default: '' })
|
||||
androidLink: string; // 安卓外链
|
||||
@prop({ required: true, default: '' })
|
||||
qrCodeLink: string; // 微信群二维码
|
||||
|
||||
public static async findByServerId(serverId: number) {
|
||||
@@ -35,9 +37,9 @@ export default class Link extends BaseModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async updateLinks(updateArr: { type: number, link?: string, qrCodeLink?: string }[], uid: number) {
|
||||
await LinkModel.bulkWrite(updateArr.map(({type, link, qrCodeLink}) => {
|
||||
return { updateOne: { filter: { type, serverId: 0 }, update: { $set: { link, qrCodeLink, updatedBy: uid }, $setOnInsert: { createdBy: uid } }, upsert: true} }
|
||||
public static async updateLinks(updateArr: { type: number, link?: string, qrCodeLink?: string, androidLink?: string }[], uid: number) {
|
||||
await LinkModel.bulkWrite(updateArr.map(({type, link, qrCodeLink, androidLink }) => {
|
||||
return { updateOne: { filter: { type, serverId: 0 }, update: { $set: { link, qrCodeLink, androidLink, updatedBy: uid }, $setOnInsert: { createdBy: uid } }, upsert: true} }
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,10 +86,12 @@ class WXPublicAccountPage extends PageData {
|
||||
}
|
||||
|
||||
class BBSPage extends PageData {
|
||||
link: string; // 论坛外链
|
||||
iosLink: string; // 论坛外链
|
||||
androidLink: string; // 安卓外链
|
||||
|
||||
public setLink(link: LinkType) {
|
||||
this.link = link.link;
|
||||
this.iosLink = link.link;
|
||||
this.androidLink = link.androidLink;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import { ActivityModelType } from "../../db/Activity";
|
||||
import { ActivityBase } from "./activityField";
|
||||
|
||||
interface WebViewDataInDb {
|
||||
iosUrl: string;
|
||||
androidUrl: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 打脸公告
|
||||
*/
|
||||
export class WebViewData extends ActivityBase {
|
||||
iosUrl: string;
|
||||
androidUrl: string;
|
||||
|
||||
constructor(activityData: ActivityModelType, createTime: number, serverTime: number) {
|
||||
super(activityData, createTime, serverTime)
|
||||
this.initData(activityData.data)
|
||||
}
|
||||
|
||||
public initData(data: string) {
|
||||
let dataObj: WebViewDataInDb = JSON.parse(data);
|
||||
this.iosUrl = dataObj.iosUrl;
|
||||
this.androidUrl = dataObj.androidUrl;
|
||||
}
|
||||
|
||||
public getShowResult() {
|
||||
return {
|
||||
...this.getBaseKeys(),
|
||||
iosUrl: this.iosUrl,
|
||||
androidUrl: this.androidUrl,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -292,5 +292,11 @@
|
||||
"activityType": 53,
|
||||
"name": "REBATE",
|
||||
"string": "返利"
|
||||
},
|
||||
{
|
||||
"id": 54,
|
||||
"activityType": 54,
|
||||
"name": "WEBVIEW",
|
||||
"string": "平台活动网页"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user