| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const common_config = require("../../common/config.js");
- const _sfc_main = {
- data() {
- return {
- videoSrc: "https://data.qicai321.com/minlong/latentsync/9791ad45-dd30-4f84-a1c6-0c07c4d08707_result.mp4",
- nextPath: "/pages/index/index",
- statusBarHeight: 0,
- navBarHeight: 44,
- videoHeight: 0,
- tenant_id: ""
- // 租户ID
- };
- },
- onLoad(options) {
- this.videoSrc = options && options.src ? decodeURIComponent(options.src) : "";
- this.nextPath = options && options.next ? decodeURIComponent(options.next) : "/pages/index/index";
- const sysInfo = common_vendor.index.getSystemInfoSync();
- this.statusBarHeight = sysInfo.statusBarHeight || 0;
- this.videoHeight = (sysInfo.windowHeight || 0) - this.statusBarHeight;
- this.getTenantId();
- },
- methods: {
- // 获取本地存储的tenant_id
- getTenantId() {
- const tenantId = common_vendor.index.getStorageSync("tenant_id");
- if (tenantId) {
- this.tenant_id = tenantId;
- return tenantId;
- }
- return null;
- },
- handleSkip() {
- this.navigateToNext();
- },
- handleEnded() {
- this.navigateToNext();
- },
- handleError(e) {
- common_vendor.index.showToast({ title: "视频加载失败", icon: "none" });
- },
- /* navigateToNext() {
- console.log(uni.getStorageSync('configData'));
- // 若 nextPath 是 tabBar 页面,需要使用 switchTab;否则使用 navigateTo
- try {
- const tabBarPages = [
- '/pages/index/index',
- '/pages/my/my'
- ];
- if (tabBarPages.includes(this.nextPath)) {
- uni.switchTab({ url: this.nextPath });
- } else {
- uni.navigateTo({ url: this.nextPath });
- }
- } catch (err) {
- // 兜底跳首页
- uni.switchTab({ url: '/pages/index/index' });
- }
- }, */
- navigateToNext() {
- try {
- const configStr = common_vendor.index.getStorageSync("configData");
- let configData = null;
- if (configStr) {
- try {
- configData = JSON.parse(configStr);
- console.log("解析到的配置数据:", configData);
- } catch (parseError) {
- console.error("解析configData失败:", parseError);
- }
- }
- this.handleUserInfoAndNavigation(configData.require_resume_upload);
- } catch (error) {
- console.error("跳转处理失败:", error);
- }
- },
- // 处理用户信息获取和页面跳转逻辑
- handleUserInfoAndNavigation(require_resume_upload) {
- const openid = JSON.parse(common_vendor.index.getStorageSync("userInfo")).openid;
- common_vendor.index.request({
- url: `${common_config.apiBaseUrl}/api/wechat/user/get_full_info?tenant_id=${this.tenant_id || JSON.parse(common_vendor.index.getStorageSync("userInfo")).tenant_id || 1}&openid=${openid}`,
- method: "GET",
- success: (infoRes) => {
- if (infoRes.statusCode === 200 && infoRes.data && infoRes.data.data && infoRes.data.data.profile) {
- const resumeUrl = infoRes.data.data.profile.resume_url || "";
- if (!resumeUrl && require_resume_upload) {
- common_vendor.index.navigateTo({
- url: "/pages/uploadResume/uploadResume",
- // 假设跳转到上传简历页面
- fail: (err) => {
- console.error("页面跳转失败:", err);
- common_vendor.index.showToast({
- title: "页面跳转失败",
- icon: "none"
- });
- }
- });
- } else {
- common_vendor.index.navigateTo({
- url: "/pages/Personal/Personal",
- fail: (err) => {
- console.error("页面跳转失败:", err);
- common_vendor.index.showToast({
- title: "页面跳转失败",
- icon: "none"
- });
- }
- });
- }
- } else {
- common_vendor.index.navigateTo({
- url: "/pages/Personal/Personal",
- fail: (err) => {
- console.error("页面跳转失败:", err);
- common_vendor.index.showToast({
- title: "页面跳转失败",
- icon: "none"
- });
- }
- });
- }
- },
- fail: (err) => {
- console.error("获取用户信息失败:", err);
- common_vendor.index.navigateTo({
- url: "/pages/Personal/Personal",
- fail: (err2) => {
- console.error("页面跳转失败:", err2);
- common_vendor.index.showToast({
- title: "页面跳转失败",
- icon: "none"
- });
- }
- });
- }
- });
- }
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return {
- a: "20px",
- b: common_vendor.o((...args) => $options.handleSkip && $options.handleSkip(...args)),
- c: $data.videoSrc,
- d: common_vendor.o((...args) => $options.handleEnded && $options.handleEnded(...args)),
- e: common_vendor.o((...args) => $options.handleError && $options.handleError(...args)),
- f: $data.videoHeight + "px"
- };
- }
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
- wx.createPage(MiniProgramPage);
|