123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const api_index = require("../../api/index.js");
- const _sfc_main = {
- data() {
- return {
- scaleInfoNew: {},
- scaleInfo: {
- name: ""
- },
- isCheck: false,
- type: null,
- topimg: "../../static/images/topImg.png",
- // scalName: '抑郁测试「简单评估版」',
- scaleDes: "测一测?",
- scaleNumber: "43.8W人测试过",
- scaleimg1: "../../static/images/1.jpg",
- scaleimg2: "../../static/images/2.jpg",
- scaleimg3: "../../static/images/3.jpg",
- //量表
- flag: "",
- //分享人的id
- uid: "",
- //来源
- source: "",
- //模态框是否弹出的标志
- modalFlag: false,
- questionNum: 0
- };
- },
- onLoad() {
- console.log(this.$route.query.flag);
- console.log(this.$route.query.uid);
- console.log(this.$route.query.source);
- this.flag = this.$route.query.flag;
- this.uid = this.$route.query.uid;
- this.source = this.$route.query.source;
- this.selectScale();
- },
- methods: {
- selectScale() {
- this.$request.get({
- url: `${api_index.getScaleTitle}/${this.flag}?uid=${this.uid}&source=${this.source}`,
- loadingTip: "加载中...",
- data: {}
- }).then((res) => {
- this.questionNum = res.data.questionNum;
- this.scaleInfo = res.data.subjectEntityDto2List[0];
- this.scaleInfoNew = res.data.ScaleDetailsEntity;
- });
- },
- checkChange(e) {
- if (e.detail.value.length == 0) {
- this.isCheck = false;
- } else {
- this.isCheck = true;
- }
- },
- toggle() {
- this.$refs.popup.open();
- },
- close() {
- this.$refs.popup.close();
- },
- //同意条框进行进入
- agreeFun() {
- this.modalFlag = false;
- common_vendor.index.navigateTo({
- url: `/examWidght/examWidght/index?flag=${this.flag}&uid=${this.uid}&source=${this.source}`
- });
- },
- //不同意方法
- unAgreeFun() {
- this.modalFlag = false;
- },
- startTest() {
- console.log(this.isCheck);
- if (this.isCheck) {
- common_vendor.index.navigateTo({
- url: `/examWidght/examWidght/index?flag=${this.flag}&uid=${this.uid}&source=${this.source}`
- });
- } else {
- this.modalFlag = true;
- }
- },
- goHistory() {
- common_vendor.index.navigateTo({
- url: "/paymentPage/queryByPhone/index"
- });
- },
- formatArr(str) {
- return str ? JSON.parse(str) : [];
- },
- formatObj(obj) {
- let key = Object.keys(obj)[0];
- return obj[key];
- },
- // 分割名言警句
- getMyjj(str, i) {
- return str ? str.split("——")[i] : "";
- }
- }
- };
- if (!Array) {
- const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
- const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
- (_easycom_uni_icons2 + _easycom_uni_popup2)();
- }
- const _easycom_uni_icons = () => "../../node-modules/@dcloudio/uni-ui/lib/uni-icons/uni-icons.js";
- const _easycom_uni_popup = () => "../../node-modules/@dcloudio/uni-ui/lib/uni-popup/uni-popup.js";
- if (!Math) {
- (_easycom_uni_icons + _easycom_uni_popup)();
- }
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return common_vendor.e({
- a: common_vendor.o((...args) => $options.goHistory && $options.goHistory(...args)),
- b: common_vendor.t($data.scaleInfoNew.scaleName),
- c: common_vendor.t($data.scaleInfoNew.testNum),
- d: common_vendor.t($data.scaleInfoNew.evaluationIntroduction),
- e: common_vendor.t($data.questionNum),
- f: common_vendor.t(Math.ceil($data.questionNum * 0.25)),
- g: $data.questionNum > 30
- }, $data.questionNum > 30 ? {} : {}, {
- h: $data.scaleInfoNew.celebrityAphorism
- }, $data.scaleInfoNew.celebrityAphorism ? common_vendor.e({
- i: common_vendor.t($options.getMyjj($data.scaleInfoNew.celebrityAphorism, 0)),
- j: $options.getMyjj($data.scaleInfoNew.celebrityAphorism, 1)
- }, $options.getMyjj($data.scaleInfoNew.celebrityAphorism, 1) ? {
- k: common_vendor.t($options.getMyjj($data.scaleInfoNew.celebrityAphorism, 1))
- } : {}) : {}, {
- l: common_vendor.f($options.formatArr($data.scaleInfoNew.relatedQuestion), (item, k0, i0) => {
- return {
- a: common_vendor.t(item)
- };
- }),
- m: common_vendor.t($data.scaleInfoNew.evaluationTheory),
- n: common_vendor.t($data.scaleInfoNew.evaluationTheoryAttention),
- o: common_vendor.f($options.formatArr($data.scaleInfoNew.obtained), (item, k0, i0) => {
- return {
- a: common_vendor.t(Object.keys(item)[0]),
- b: common_vendor.t($options.formatObj(item))
- };
- }),
- p: common_vendor.f($options.formatArr($data.scaleInfoNew.suitCrowd), (item, k0, i0) => {
- return {
- a: common_vendor.t(item)
- };
- }),
- q: common_vendor.f($options.formatArr($data.scaleInfoNew.reportContent), (item, index, i0) => {
- return {
- a: common_vendor.t(index + 1),
- b: common_vendor.t(item),
- c: index < $options.formatArr($data.scaleInfoNew.reportContent).length - 1
- };
- }),
- r: $data.scaleInfoNew.reference && $data.scaleInfoNew.reference.length > 0
- }, $data.scaleInfoNew.reference && $data.scaleInfoNew.reference.length > 0 ? {
- s: common_vendor.f($options.formatArr($data.scaleInfoNew.reference), (item, index, i0) => {
- return {
- a: common_vendor.t(index + 1),
- b: common_vendor.t(item)
- };
- })
- } : {}, {
- t: common_vendor.o((...args) => $options.checkChange && $options.checkChange(...args)),
- v: common_vendor.o(($event) => $options.toggle()),
- w: common_vendor.o(($event) => $options.startTest()),
- x: common_vendor.o(($event) => $options.close()),
- y: common_vendor.p({
- type: "clear",
- size: "30"
- }),
- z: common_vendor.o(($event) => $options.close()),
- A: common_vendor.sr("popup", "8e07d3cc-0"),
- B: common_vendor.p({
- type: "bottom",
- ["background-color"]: "#fff"
- }),
- C: common_vendor.o(($event) => $options.toggle()),
- D: common_vendor.o(($event) => $options.agreeFun()),
- E: common_vendor.o(($event) => $options.unAgreeFun()),
- F: $data.modalFlag
- });
- }
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "E:/psy_web_share/pages/index/index.vue"]]);
- tt.createPage(MiniProgramPage);
|