浏览代码

抖音考试相关的模块重新写了

zhangyujun 2 年之前
父节点
当前提交
bd6eafc7e1

+ 86 - 95
package-lock.json

@@ -3040,6 +3040,44 @@
           "integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=",
           "dev": true
         },
+        "ansi-styles": {
+          "version": "4.3.0",
+          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-convert": "^2.0.1"
+          }
+        },
+        "chalk": {
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
+          }
+        },
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-name": "~1.1.4"
+          }
+        },
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+          "dev": true,
+          "optional": true
+        },
         "globby": {
           "version": "9.2.0",
           "resolved": "https://registry.npm.taobao.org/globby/download/globby-9.2.0.tgz?cache=0&sync_timestamp=1616407139482&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fglobby%2Fdownload%2Fglobby-9.2.0.tgz",
@@ -3056,6 +3094,13 @@
             "slash": "^2.0.0"
           }
         },
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+          "dev": true,
+          "optional": true
+        },
         "hash-sum": {
           "version": "2.0.0",
           "resolved": "https://registry.npm.taobao.org/hash-sum/download/hash-sum-2.0.0.tgz",
@@ -3068,6 +3113,25 @@
           "integrity": "sha1-dQ49tYYgh7RzfrrIIH/9HvJ7Jfw=",
           "dev": true
         },
+        "json5": {
+          "version": "2.2.1",
+          "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
+          "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
+          "dev": true,
+          "optional": true
+        },
+        "loader-utils": {
+          "version": "2.0.2",
+          "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
+          "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "big.js": "^5.2.2",
+            "emojis-list": "^3.0.0",
+            "json5": "^2.1.2"
+          }
+        },
         "slash": {
           "version": "2.0.0",
           "resolved": "https://registry.npm.taobao.org/slash/download/slash-2.0.0.tgz?cache=0&sync_timestamp=1618384508676&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fslash%2Fdownload%2Fslash-2.0.0.tgz",
@@ -3082,6 +3146,28 @@
           "requires": {
             "minipass": "^3.1.1"
           }
+        },
+        "supports-color": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "has-flag": "^4.0.0"
+          }
+        },
+        "vue-loader-v16": {
+          "version": "npm:vue-loader@16.8.3",
+          "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
+          "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "chalk": "^4.1.0",
+            "hash-sum": "^2.0.0",
+            "loader-utils": "^2.0.0"
+          }
         }
       }
     },
@@ -15831,101 +15917,6 @@
         "vue-style-loader": "^4.1.0"
       }
     },
-    "vue-loader-v16": {
-      "version": "npm:vue-loader@16.8.3",
-      "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
-      "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
-      "dev": true,
-      "optional": true,
-      "requires": {
-        "chalk": "^4.1.0",
-        "hash-sum": "^2.0.0",
-        "loader-utils": "^2.0.0"
-      },
-      "dependencies": {
-        "ansi-styles": {
-          "version": "4.3.0",
-          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
-          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "color-convert": "^2.0.1"
-          }
-        },
-        "chalk": {
-          "version": "4.1.2",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
-          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "ansi-styles": "^4.1.0",
-            "supports-color": "^7.1.0"
-          }
-        },
-        "color-convert": {
-          "version": "2.0.1",
-          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
-          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "color-name": "~1.1.4"
-          }
-        },
-        "color-name": {
-          "version": "1.1.4",
-          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
-          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
-          "dev": true,
-          "optional": true
-        },
-        "has-flag": {
-          "version": "4.0.0",
-          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
-          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
-          "dev": true,
-          "optional": true
-        },
-        "hash-sum": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz",
-          "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==",
-          "dev": true,
-          "optional": true
-        },
-        "json5": {
-          "version": "2.2.1",
-          "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
-          "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
-          "dev": true,
-          "optional": true
-        },
-        "loader-utils": {
-          "version": "2.0.2",
-          "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
-          "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "big.js": "^5.2.2",
-            "emojis-list": "^3.0.0",
-            "json5": "^2.1.2"
-          }
-        },
-        "supports-color": {
-          "version": "7.2.0",
-          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
-          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "has-flag": "^4.0.0"
-          }
-        }
-      }
-    },
     "vue-style-loader": {
       "version": "4.1.3",
       "resolved": "https://registry.npm.taobao.org/vue-style-loader/download/vue-style-loader-4.1.3.tgz",

+ 9 - 0
src/api/modules/exam.js

@@ -66,6 +66,15 @@ const exam={
 			method:'get',
 			params
 		})
+	},
+	//新增模拟考成绩
+	studentScoreInfo(data){
+		return request({
+			url:'student/score/info',
+			method:"post",
+			data
+		})
+
 	}
 }
 

+ 3 - 6
src/api/modules/open.js

@@ -21,24 +21,21 @@ const open = {
     },
     lightingCombinationList() {
         return request({
-            url: "/open-api/lighting/combination/list",
+            url: `${openApi}/open-api/lighting/combination/list`,
             method: "GET"
         })
     },
     lightingCombinationId(id) {
         return request({
-            url: "/open-api/lighting/combination/" + id,
+            url: `${openApi}/open-api/lighting/combination/` + id,
             method: "GET",
         })
     },
     lightingItemList(){
         return request({
-            url: "/open-api/lighting/item/list",
+            url: `${openApi}/open-api/lighting/item/list`,
             method: "GET",
         })
     }
-
-
-
 }
 export default open

二进制
src/assets/img/unLoginHead.png


+ 52 - 0
src/components/m-checkbox-group/m-checkbox-group.vue

@@ -0,0 +1,52 @@
+<template>
+  <view class="checkboxGroup">
+    <view @tap.native="changeCheckboxGroup">
+      <slot></slot>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {};
+  },
+  methods: {
+    changeCheckboxGroup(e) {
+      if (this.value.includes(e.target.dataset.item.value)) {
+        e.detail=this.value.filter((item) => {
+          return item !== e.target.dataset.item.value;
+        });
+      } else {
+        e.detail = [...this.value];
+        e.detail.push(e.target.dataset.item.value);
+      }
+      // e.detail = e.target.dataset.item;
+      this.$emit("update:value", e.detail);
+      this.$emit("change", e);
+      console.log(e);
+    },
+  },
+  props: {
+    useIconSlot: {
+      type: Boolean,
+      default: false,
+    },
+    name: {
+      type: String,
+      default: "",
+    },
+    value: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.checkboxGroup {
+}
+</style>

+ 71 - 0
src/components/m-checkbox/m-checkbox.vue

@@ -0,0 +1,71 @@
+<template>
+  <view @tap.native="clickCheckbox" :data-item="item" class="checkbox">
+    <view
+      :data-item="item"
+      class="custom-icon"
+      :class="{
+        'problem-op_selected': item.selected,
+      }"
+      v-if="useIconSlot"
+      >{{ name }}</view
+    >
+    <view :data-item="item" style="width: 8px"></view>
+    <text style="font-weight:600" :data-item="item">{{ item.value }}</text>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {};
+  },
+  methods: {
+    stopClick(e) {
+      e.stopPropagation();
+    },
+    clickCheckbox(e) {
+      console.log(e);
+      this.$emit("clickcheckbox", e);
+      e.stopPropagation();
+    },
+  },
+  props: {
+    useIconSlot: {
+      type: Boolean,
+      default: false,
+    },
+    name: {
+      type: String,
+      default: "",
+    },
+    item: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.checkbox {
+  display: flex;
+  align-content: center;
+  align-items: center;
+  padding: 8px 0;
+}
+.custom-icon {
+  width: 75rpx;
+  height: 75rpx;
+  line-height: 75rpx;
+  border-radius: 50%;
+  text-align: center;
+  overflow: hidden;
+  background: #fff;
+  box-shadow: 0px 4rpx 12rpx rgba(0, 0, 0, 0.16);
+}
+.problem-op_selected {
+  background: #498ef5;
+}
+</style>

+ 2 - 2
src/components/m-classify-tip/m-classify-tip.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div style="width:100%">
     <div class="box">
       <div class="line1">温馨提示:</div>
       <div v-for="(item, index) in content" :key="index">
@@ -28,7 +28,7 @@ export default {
 <style lang="scss" scoped>
 .box {
   padding: 0 15rpx;
-  width: 750rpx;
+  width: 100%;
   font-size: 28rpx;
 
   .line1 {

+ 42 - 0
src/components/m-radio-group/m-radio-group.vue

@@ -0,0 +1,42 @@
+<template>
+  <view class="radioGroup">
+    <view @tap.native="changeRadioGroup">
+      <slot></slot>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {};
+  },
+  methods: {
+    changeRadioGroup(e) {
+      console.log(e);
+      e.detail = e.target.dataset.item.value;
+      this.$emit("update:value", e.detail.value);
+      this.$emit("change", e);
+    },
+  },
+  props: {
+    useIconSlot: {
+      type: Boolean,
+      default: false,
+    },
+    name: {
+      type: String,
+      default: "",
+    },
+    value: {
+      type: String,
+      default: "",
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.radioGroup {
+}
+</style>

+ 71 - 0
src/components/m-radio/m-radio.vue

@@ -0,0 +1,71 @@
+<template>
+  <view @tap.native="clickRadio" :data-item="item" class="radio">
+    <view
+      :data-item="item"
+      class="custom-icon"
+      :class="{
+        'problem-op_selected': item.selected,
+      }"
+      v-if="useIconSlot"
+      >{{ name }}</view
+    >
+    <view :data-item="item" style="width: 8px"></view>
+    <text style="font-weight:600" :data-item="item">{{ item.value }}</text>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {};
+  },
+  methods: {
+    stopClick(e) {
+      e.stopPropagation();
+    },
+    clickRadio(e) {
+      console.log(e);
+      this.$emit("clickRadio", e);
+      e.stopPropagation();
+    },
+  },
+  props: {
+    useIconSlot: {
+      type: Boolean,
+      default: false,
+    },
+    name: {
+      type: String,
+      default: "",
+    },
+    item: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.radio {
+  display: flex;
+  align-content: center;
+  align-items: center;
+  padding: 8px 0;
+}
+.custom-icon {
+  width: 75rpx;
+  height: 75rpx;
+  line-height: 75rpx;
+  border-radius: 50%;
+  text-align: center;
+  overflow: hidden;
+  background: #fff;
+  box-shadow: 0px 4rpx 12rpx rgba(0, 0, 0, 0.16);
+}
+.problem-op_selected {
+  background: #498ef5;
+}
+</style>

+ 26 - 24
src/otherPages/buyVip/index.vue

@@ -134,8 +134,8 @@ export default {
       //#ifdef MP-TOUTIAO
       api.buy.studentTtPrepareOrder().then((res) => {
         uni.pay({
-          orderInfo:res.data,
-          service:5
+          orderInfo: res.data,
+          service: 5,
         });
       });
 
@@ -155,29 +155,31 @@ export default {
     });
     //#endif
     //#ifdef MP-TOUTIAO
-    this.goodsIndex=0
+    this.goodsIndex = 0;
     api.buy.systemConfigConfigKey("vip_price").then((res) => {
-      this.goodsList = [
-        {
-          searchValue: null,
-          createBy: "admin",
-          createTime: "2021-11-18 18:01:26",
-          updateTime: null,
-          updateBy: null,
-          remark: null,
-          params: {},
-          dictCode: 29,
-          dictSort: 0,
-          dictLabel: "终身会员",
-          dictValue: res.data + "," + "0.2",
-          dictType: "vip_type_price",
-          cssClass: null,
-          listClass: null,
-          isDefault: "N",
-          status: "0",
-          default: false,
-        },
-      ];
+      api.buy.systemConfigConfigKey("vip_price_original").then((result) => {
+        this.goodsList = [
+          {
+            searchValue: null,
+            createBy: "admin",
+            createTime: "2021-11-18 18:01:26",
+            updateTime: null,
+            updateBy: null,
+            remark: null,
+            params: {},
+            dictCode: 29,
+            dictSort: 0,
+            dictLabel: "终身会员",
+            dictValue: res.data + "," + result.data,
+            dictType: "vip_type_price",
+            cssClass: null,
+            listClass: null,
+            isDefault: "N",
+            status: "0",
+            default: false,
+          },
+        ];
+      });
     });
     //#endif
   },

+ 34 - 28
src/otherPages/classifyChoose/index.vue

@@ -1,9 +1,11 @@
 <template>
   <div class="cell-container">
-    <div class="cell-box" :class="{
-      'is-row':isRow
-
-    }" >
+    <div
+      class="cell-box"
+      :class="{
+        'is-row': isRow,
+      }"
+    >
       <van-cell
         class="cell"
         :title="
@@ -21,7 +23,7 @@
           () => {
             goExercise({
               excellIssueName: item.excellIssueName,
-              sort:2
+              sort: 2,
             });
           }
         "
@@ -56,7 +58,7 @@
         </template>
       </van-cell> -->
     </div>
-    <div style="padding-right:0rpx" class="cell-box">
+    <div style="padding-right: 0rpx" class="cell-box">
       <van-cell
         class="cell"
         :title="
@@ -83,7 +85,7 @@
         </template>
       </van-cell>
     </div>
-     <div style="height:40rpx;width: 750rpx;"></div>
+    <div style="height: 40rpx; width: 750rpx"></div>
     <m-classify-tip :content="classifyTip"></m-classify-tip>
   </div>
 </template>
@@ -94,19 +96,22 @@ import utils from "@/utils/index";
 export default {
   data() {
     return {
-      isRow:false,
-      classifyTip:['软件题库已同步更新至车管所最新,左边的红色必学题,每套题必须学完.',
-      '模拟考试能连续5次以上达到96分左右,即可参加考试','如果模拟考试达不到要求,请把右边的选学题也学习一遍'],
+      isRow: false,
+      classifyTip: [
+        "软件题库已同步更新至车管所最新,左边的红色必学题,每套题必须学完.",
+        "模拟考试能连续5次以上达到96分左右,即可参加考试",
+        "如果模拟考试达不到要求,请把右边的选学题也学习一遍",
+      ],
       classDataRight: [],
       classDataLeft: [],
       query: {
-        vehicle:""
+        vehicle: "",
       },
     };
   },
   onLoad(query) {
     this.query = query;
-    this.isRow = this.query.vehicle ==='摩托车'
+    this.isRow = this.query.vehicle === "摩托车";
     this.getClassData();
   },
   methods: {
@@ -197,13 +202,14 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-
 .cell-container {
   display: flex;
   flex-direction: row;
   flex-wrap: wrap;
-    padding: 5px 15px;
-    justify-content: space-between;
+  padding: 10rpx 30rpx;
+  justify-content: space-between;
+  width: 100%;
+  box-sizing: border-box;
 }
 .cell-box {
   display: flex;
@@ -215,42 +221,42 @@ export default {
   box-sizing: border-box;
 
   .cell {
-    width: 167px;
-    margin-top: 10px;
-    box-shadow: 0px 0px 10px rgba(124, 129, 136, 0.2);
+    width: 334rpx;
+    margin-top: 10rpx;
+    box-shadow: 0px 0px 10rpx rgba(124, 129, 136, 0.2);
   }
   .icon-blue {
-    width: 20px;
-    height: 20px;
+    width: 40rpx;
+    height: 40rpx;
     background: #498ef5;
     border-radius: 50%;
     font-weight: 500;
     font-family: PingFang SC;
-    font-size: 13px;
+    font-size: 26rpx;
     display: flex;
     justify-content: center;
     align-items: center;
     color: #ffffff;
-    margin-right: 5px;
+    margin-right: 10rpx;
   }
   .icon-red {
-    width: 20px;
-    height: 20px;
+    width: 40rpx;
+    height: 40rpx;
     background: red;
     border-radius: 50%;
     font-weight: 500;
     font-family: PingFang SC;
-    font-size: 13px;
+    font-size: 26rpx;
     display: flex;
     justify-content: center;
     align-items: center;
     color: #ffffff;
-    margin-right: 5px;
+    margin-right: 10rpx;
   }
 }
-.is-row{
+.is-row {
   flex-direction: row;
   width: 100%;
-    justify-content: space-between;
+  justify-content: space-between;
 }
 </style>

+ 65 - 22
src/otherPages/exercise/index.vue

@@ -90,9 +90,7 @@
           <text class="problem-opAnswer">{{ item.value }}</text>
         </view>
       </view>
-      <!-- #endif -->
       <!-- 多选 -->
-      <!-- #ifdef MP-WEIXIN -->
       <view
         v-if="
           problemList[problemListIndex].questionType == 3 &&
@@ -101,7 +99,7 @@
         class="problem-ops"
       >
         <van-checkbox-group
-          @change="changeCheckGroup"
+          @change="changeCheckboxGroup"
           :value="problemList[problemListIndex].userAnswer"
           :max="4"
         >
@@ -246,8 +244,8 @@
         "
         class="problem-ops"
       >
-        <van-checkbox-group
-          @change="changeCheckGroup"
+        <m-checkbox-group
+          @change="changeCheckboxGroup"
           :value="problemList[problemListIndex].userAnswer"
           :max="4"
         >
@@ -261,9 +259,8 @@
             :key="index"
             :name="numberToLetter(index)"
           >
-     
           </m-checkbox>
-        </van-checkbox-group>
+        </m-checkbox-group>
         <view class="flex-center">
           <van-button
             @click="confirmMult"
@@ -290,13 +287,14 @@
             v-if="item.isAnswer && item.selected"
             class="icon-box-img"
             type="success"
-            size="75rpx"
+            color="#06c05f"
+            size="37"
           ></icon>
           <icon
             v-if="!item.isAnswer && item.selected"
             class="icon-box-img"
-            type="cancel"
-            size="75rpx"
+            type="clear"
+            size="37"
           ></icon>
           <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
             numberToLetter(index)
@@ -467,10 +465,10 @@ import api from "@/api/index";
 import utils from "@/utils/index";
 import explainJs from "./components/explainJs.vue";
 import tabbar from "./components/tabbar.vue";
-import mRadio from "./components/m-radio.vue";
-import mRadioGroup from "./components/m-radio-group.vue";
-import mCheckbox from "./components/m-radio.vue";
-import mCheckboxGroup from './components/m-checkbox-group.vue'
+import mRadio from "@/components/m-radio/m-radio.vue";
+import mRadioGroup from "@/components/m-radio-group/m-radio-group.vue";
+import mCheckbox from "@/components/m-checkbox/m-checkbox.vue";
+import mCheckboxGroup from "@/components/m-checkbox-group/m-checkbox-group.vue";
 export default {
   data() {
     return {
@@ -717,9 +715,10 @@ export default {
       }
       // this.problemList[this.problemListIndex]
     },
-    changeCheckGroup(e) {
+    changeCheckboxGroup(e) {
       //console.log(e);
       // this.$set()
+      // #ifdef MP-WEIXIN
       this.$set(
         this.problemList[this.problemListIndex],
         "userAnswer",
@@ -732,6 +731,38 @@ export default {
           item.selected = false;
         }
       });
+      //#endif
+      // #ifdef MP-TOUTIAO
+      this.$set(
+        this.problemList[this.problemListIndex],
+        "userAnswer",
+        e.detail
+      );
+      this.problemList[this.problemListIndex].optsArr.forEach((item, index) => {
+        if (e.detail.includes(item.value)) {
+          item.selected = true;
+          this.$set(
+            this.problemList[this.problemListIndex].optsArr[index],
+            "selected",
+            true
+          );
+        } else {
+          item.selected = false;
+          this.$set(
+            this.problemList[this.problemListIndex].optsArr[index],
+            "selected",
+            false
+          );
+        }
+      });
+      //#endif
+      this.problemList[this.problemListIndex].answer
+        .split("-")
+        .sort()
+        .toString() ===
+      this.problemList[this.problemListIndex].userAnswer.sort().toString()
+        ? (this.trueNum = this.trueNum + 1)
+        : (this.falseNum = this.falseNum + 1);
     },
     changeRadioGroup(e) {
       console.log(e, "changeRadioGroup");
@@ -758,14 +789,25 @@ export default {
       this.$set(
         this.problemList[this.problemListIndex],
         "userAnswer",
-        e.detail.value
-      );
-      e.detail.selected = true;
-      this.$set(
-        this.problemList[this.problemListIndex].optsArr,
-        e.detail.index,
         e.detail
       );
+      this.problemList[this.problemListIndex].optsArr.forEach((item, index) => {
+        if (e.detail === item.value) {
+          item.selected = true;
+          this.$set(
+            this.problemList[this.problemListIndex].optsArr[index],
+            "selected",
+            true
+          );
+        } else {
+          item.selected = false;
+          this.$set(
+            this.problemList[this.problemListIndex].optsArr[index],
+            "selected",
+            false
+          );
+        }
+      });
       e.detail.value === this.problemList[this.problemListIndex].answer
         ? (this.trueNum = this.trueNum + 1)
         : (this.falseNum = this.falseNum + 1);
@@ -840,7 +882,7 @@ export default {
     mRadio,
     mRadioGroup,
     mCheckbox,
-    mCheckboxGroup
+    mCheckboxGroup,
   },
 };
 </script>
@@ -933,6 +975,7 @@ export default {
     }
     .problem-issue {
       font-size: 42rpx;
+      font-weight: 600;
     }
     .problem-ops {
       margin-top: 30rpx;

+ 158 - 0
src/otherPages/mockExam/components/explainJs.vue

@@ -0,0 +1,158 @@
+<template>
+  <van-overlay z-index="10" :show="show">
+    <div class="skills-box">
+      <div class="skills">
+        <div class="title">官方解释</div>
+        <div class="text">{{ explainJs }}</div>
+        <div class="btn">
+          <span
+            @click="
+              () => {
+                $emit('close');
+              }
+            "
+          >
+            关闭
+          </span>
+          <span
+            @click="
+              () => {
+                playExplainjsmp3();
+              }
+            "
+          >
+            语音重播
+          </span>
+        </div>
+      </div>
+    </div>
+  </van-overlay>
+</template>
+
+<script>
+import utils from "@/utils/index";
+export default {
+  data() {
+    return {};
+  },
+  methods: {
+    playExplainjsmp3() {
+      let audio = utils.wxUtils.getGlobAudio();
+      audio.stop();
+      audio.src = this.explainjsmp3;
+      //体验比较好
+      setTimeout(() => {
+        audio.play();
+      }, 1000);
+    },
+  },
+  watch: {
+    show(newValue, oldValue) {
+      let audio = utils.wxUtils.getGlobAudio();
+      if (newValue) {
+        audio.src = this.explainjsmp3;
+        // #ifdef MP-TOUTIAO
+        audio.onCanplay(() => {
+          audio.play();
+        });
+        //#endif
+        // #ifdef MP-WEIXIN
+        audio.play();
+        //#endif
+      } else {
+        audio.stop();
+      }
+    },
+  },
+  props: {
+    show: {
+      type: Boolean,
+      default: false,
+    },
+    explainJs: {
+      type: String,
+      default: "",
+    },
+    explainjsmp3: {
+      type: String,
+      default: "",
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.skills-box {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  height: 100%;
+  .skills {
+    width: 290px;
+    background: #ffffff;
+    box-shadow: 0px 0px 8px rgba(124, 129, 136, 0.16);
+    border-radius: 10px;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    padding: 20px 16px;
+    box-sizing: border-box;
+    .title {
+      font-size: 15px;
+      font-family: PingFang SC;
+      font-weight: bold;
+      line-height: 21px;
+      color: #0a1a33;
+    }
+    .img {
+      width: 258px;
+      height: 129px;
+      border: 1px solid #e8e8e8;
+      margin-top: 16px;
+    }
+    .divider {
+      margin-top: 20px;
+      color: #0a1a33;
+      background: #ffffff;
+    }
+    .text {
+      font-size: 13px;
+      font-family: PingFang SC;
+      font-weight: 400;
+      line-height: 19px;
+      color: #5c6066;
+      margin-top: 10px;
+    }
+    .btn {
+      width: 100%;
+      display: flex;
+      justify-content: space-between;
+      padding: 0 40px;
+      box-sizing: border-box;
+      margin-top: 20px;
+      span {
+        width: 76px;
+        height: 30px;
+        border-radius: 15px;
+        font-size: 13px;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        &:active {
+          background-color: #afaaaa;
+          filter: brightness(50%);
+        }
+        &:nth-of-type(1) {
+          border: 1px solid #707070;
+          color: #5c6066;
+        }
+        &:nth-of-type(2) {
+          background: #498ef5;
+          border: 1px solid #498ef5;
+          color: #ffffff;
+        }
+      }
+    }
+  }
+}
+</style>

+ 45 - 0
src/otherPages/mockExam/components/tabbar.vue

@@ -0,0 +1,45 @@
+<template>
+  <view
+    class="box"
+    :style="{
+      height: height,
+      lineHeight:height
+    }"
+  >
+    <slot></slot>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {};
+  },
+  methods: {
+    name() {},
+  },
+  props: {
+    height: {
+      type: String,
+      default: "0rpx",
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.box{
+    width: 100%;
+    display:flex;
+    justify-content: space-between;
+    overflow: scroll;
+    position: fixed;
+    bottom: 0;
+    font-size: 14px;
+    background: #fff;
+
+
+}
+
+
+</style>

+ 282 - 27
src/otherPages/mockExam/index.vue

@@ -10,15 +10,18 @@
         problemList[problemListIndex].questionType | questionType
       }}</span>
       <!-- <text>{{ problemListIndex + 1 }}、</text> -->
-      <text class="problem-issue">{{
-        problemList[problemListIndex].issue
-      }}</text>
+      <text class="problem-issue"
+        >{{ problemListIndex + 1 }}.{{
+          problemList[problemListIndex].issue
+        }}</text
+      >
       <view v-if="problemList[problemListIndex].image" class="problem-img">
         <image
           mode="widthFix"
           :src="problemList[problemListIndex].image"
         ></image>
       </view>
+      <!-- #ifdef MP-WEIXIN -->
       <!-- 单项选择 -->
       <view
         v-if="problemList[problemListIndex].questionType < 3"
@@ -27,27 +30,22 @@
         <van-radio-group
           :value="problemList[problemListIndex].userAnswer"
           :max="1"
-          @change="changeGroup"
+          @change="changeRadioGroup"
         >
           <van-radio
-            @change="changeCheckbox"
-            :value="
-              problemList[problemListIndex].userAnswer.includes(
-                problemList[problemListIndex].answer
-              )
-            "
+            :value="problemList[problemListIndex].userAnswer === item.value"
             class="problem-checkbox"
             use-icon-slot
             v-for="(item, index) in problemList[problemListIndex].optsArr"
             :key="index"
-            :name="item"
+            :name="item.value"
           >
-            <text>{{ item }}</text>
+            <text>{{ item.value }}</text>
             <view
               class="problem-op"
               :class="{
                 'problem-op_selected':
-                  problemList[problemListIndex].userAnswer.includes(item),
+                  problemList[problemListIndex].userAnswer === item.value,
               }"
               slot="icon"
               >{{ numberToLetter(index) }}</view
@@ -64,27 +62,23 @@
         <van-checkbox-group
           :value="problemList[problemListIndex].userAnswer"
           :max="4"
-          @change="changeGroup"
+          @change="changeCheckboxGroup"
         >
           <van-checkbox
-            @change="changeCheckbox"
             :value="
-              problemList[problemListIndex].userAnswer.includes(
-                problemList[problemListIndex].answer
-              )
+              problemList[problemListIndex].userAnswer.includes(item.value)
             "
             class="problem-checkbox"
             use-icon-slot
             v-for="(item, index) in problemList[problemListIndex].optsArr"
             :key="index"
-            :name="item"
+            :name="item.value"
           >
-            <text>{{ item }}</text>
+            <text>{{ item.value }}</text>
             <view
               class="problem-op"
               :class="{
-                'problem-op_selected':
-                  problemList[problemListIndex].userAnswer.includes(item),
+                'problem-op_selected': item.selected,
               }"
               slot="icon"
               >{{ numberToLetter(index) }}</view
@@ -92,6 +86,142 @@
           </van-checkbox>
         </van-checkbox-group>
       </view>
+      <!-- #endif -->
+
+      <!-- 单选 -->
+      <!-- #ifdef MP-TOUTIAO -->
+      <view
+        v-if="
+          problemList[problemListIndex].questionType < 3 &&
+          !problemList[problemListIndex].isCompleted
+        "
+        class="problem-ops"
+      >
+        <m-radio-group
+          @change="changeRadioGroup"
+          :value.sync="problemList[problemListIndex].userAnswer"
+        >
+          <m-radio
+            :value="item.value"
+            :item="item"
+            :useIconSlot="true"
+            :key="index"
+            :name="numberToLetter(index)"
+            v-for="(item, index) in problemList[problemListIndex].optsArr"
+          >
+          </m-radio>
+        </m-radio-group>
+      </view>
+      <view
+        v-if="
+          problemList[problemListIndex].questionType < 3 &&
+          problemList[problemListIndex].isCompleted
+        "
+      >
+        <view
+          v-for="(item, index) in problemList[problemListIndex].optsArr"
+          :key="index"
+          class="problem-select"
+        >
+          <icon
+            v-if="item.isAnswer && item.selected"
+            class="icon-box-img"
+            type="success"
+            color="#06c05f"
+            size="37"
+          ></icon>
+          <icon
+            v-if="!item.isAnswer && item.selected"
+            class="icon-box-img"
+            type="clear"
+            size="37"
+          ></icon>
+          <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
+            numberToLetter(index)
+          }}</text>
+          <text
+            v-if="item.isAnswer && !item.selected"
+            class="problem-op_green"
+            >{{ numberToLetter(index) }}</text
+          >
+          <text class="problem-opAnswer">{{ item.value }}</text>
+        </view>
+      </view>
+
+      <!-- 多选 -->
+
+      <view
+        v-if="
+          problemList[problemListIndex].questionType == 3 &&
+          !problemList[problemListIndex].isCompleted
+        "
+        class="problem-ops"
+      >
+        <m-checkbox-group
+          @change="changeCheckboxGroup"
+          :value="problemList[problemListIndex].userAnswer"
+          :max="4"
+        >
+          <m-checkbox
+            @change="changeCheckbox"
+            :item="item"
+            :value="item.value"
+            class="problem-checkbox"
+            use-icon-slot
+            v-for="(item, index) in problemList[problemListIndex].optsArr"
+            :key="index"
+            :name="numberToLetter(index)"
+          >
+          </m-checkbox>
+        </m-checkbox-group>
+        <!-- <view class="flex-center">
+          <van-button
+            @click="confirmMult"
+            color="#498ef5"
+            round
+            custom-style="width:600rpx"
+            type="primary"
+            >确定</van-button
+          >
+        </view> -->
+      </view>
+      <view
+        v-if="
+          problemList[problemListIndex].questionType == 3 &&
+          problemList[problemListIndex].isCompleted
+        "
+      >
+        <view
+          v-for="(item, index) in problemList[problemListIndex].optsArr"
+          :key="index"
+          class="problem-select"
+        >
+          <icon
+            v-if="item.isAnswer && item.selected"
+            class="icon-box-img"
+            type="success"
+            color="#06c05f"
+            size="37"
+          ></icon>
+          <icon
+            v-if="!item.isAnswer && item.selected"
+            class="icon-box-img"
+            type="clear"
+            size="37"
+          ></icon>
+          <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
+            numberToLetter(index)
+          }}</text>
+          <text
+            v-if="item.isAnswer && !item.selected"
+            class="problem-op_green"
+            >{{ numberToLetter(index) }}</text
+          >
+          <text class="problem-opAnswer">{{ item.value }}</text>
+        </view>
+      </view>
+
+      <!-- #endif -->
       <view class="function-list">
         <div class="function-item">
           <van-icon name="star-o" size="25px" />
@@ -122,7 +252,7 @@
     </div> -->
       </view>
     </view>
-
+    <!-- #ifdef MP-WEIXIN -->
     <van-tabbar>
       <van-tabbar-item @click="goBeforeTopics"
         ><van-icon
@@ -151,6 +281,39 @@
         />下一题
       </van-tabbar-item>
     </van-tabbar>
+    <!-- #endif -->
+    <!-- #ifdef MP-TOUTIAO -->
+    <tabbar height="35px">
+      <view @click="goBeforeTopics" class="flex-all-center h-full">
+        <van-icon
+          slot="icon"
+          custom-style="transform: rotate(90deg);"
+          custom-class="last-subject"
+          name="down"
+          size="18px"
+        /><text> 上一题 </text>
+      </view>
+
+      <view class="flex-all-center h-full">
+        <van-icon size="18px" name="description" />{{ problemListIndex + 1 }}/{{
+          problemListTotal
+        }}
+      </view>
+      <view @click="submitExam" class="flex-all-center h-full">
+        <van-icon slot="icon" size="18px" name="records" />交卷
+      </view>
+
+      <view @click="goNextTopics" class="flex-all-center h-full">
+        下一题
+        <van-icon
+          custom-style="transform: rotate(-90deg);"
+          custom-class="last-subject"
+          name="down"
+          size="18px"
+        />
+      </view>
+    </tabbar>
+    <!-- #endif -->
   </view>
 </template>
 
@@ -158,6 +321,11 @@
 import navBar from "./components/navBar.vue";
 import api from "@/api/index";
 import utils from "@/utils/index";
+import tabbar from "./components/tabbar.vue";
+import mRadio from "@/components/m-radio/m-radio.vue";
+import mRadioGroup from "@/components/m-radio-group/m-radio-group.vue";
+import mCheckbox from "@/components/m-checkbox/m-checkbox.vue";
+import mCheckboxGroup from "@/components/m-checkbox-group/m-checkbox-group.vue";
 export default {
   data() {
     return {
@@ -299,6 +467,8 @@ export default {
       let score = 0;
       let query = this.query;
       let that = this;
+      let scorePerQuestion = 0
+      query.subject === "4"?scorePerQuestion=2:scorePerQuestion=1
       this.problemList.forEach((item, index) => {
         if (
           typeof item.userAnswer == "object" &&
@@ -311,10 +481,10 @@ export default {
             console.log(answerArr, userAnswer);
           }
           if (answerArr.join("-") === userAnswer.join("-")) {
-            score = score + 1;
+            score = score + scorePerQuestion;
           }
         } else if (typeof item.userAnswer == "string") {
-          item.answer === item.userAnswer ? (score = score + 1) : "";
+          item.answer === item.userAnswer ? (score = score + scorePerQuestion) : "";
         }
       });
       uni.showModal({
@@ -332,7 +502,7 @@ export default {
                 utils.mapToUrlQuery({
                   score,
                   useTime,
-                  ...query,
+                  ...that.query,
                 }),
             });
           }
@@ -368,7 +538,64 @@ export default {
         globalAudio.play();
       }
     },
+    changeRadioGroup(e) {
+      this.$set(
+        this.problemList[this.problemListIndex],
+        "userAnswer",
+        e.detail
+      );
+      this.problemList[this.problemListIndex].optsArr.forEach((item, index) => {
+        if (e.detail === item.value) {
+          item.selected = true;
+          this.$set(
+            this.problemList[this.problemListIndex].optsArr[index],
+            "selected",
+            true
+          );
+        } else {
+          item.selected = false;
+          this.$set(
+            this.problemList[this.problemListIndex].optsArr[index],
+            "selected",
+            false
+          );
+        }
+      });
+      // this.problemList[this.problemListIndex].optsArr.forEach((item) => {
+      //   if (e.detail.value === item.value) {
+      //     item.selected = true;
+      //   } else {
+      //     item.selected = false;
+      //   }
+      // });
+    },
+    changeCheckboxGroup(e) {
+      this.$set(
+        this.problemList[this.problemListIndex],
+        "userAnswer",
+        e.detail
+      );
+
+      this.problemList[this.problemListIndex].optsArr.forEach((item, index) => {
+        if (e.detail.includes(item.value)) {
+          item.selected = true;
+          this.$set(
+            this.problemList[this.problemListIndex].optsArr[index],
+            "selected",
+            true
+          );
+        } else {
+          item.selected = false;
+          this.$set(
+            this.problemList[this.problemListIndex].optsArr[index],
+            "selected",
+            false
+          );
+        }
+      });
+    },
     changeGroup(e) {
+      console.log(e);
       this.$set(
         this.problemList[this.problemListIndex],
         "userAnswer",
@@ -392,7 +619,25 @@ export default {
       })
       .then((res) => {
         res.rows.forEach((element) => {
-          element.optsArr = element.opts.split("-");
+          element.optsArr = [];
+          element.opts.split("-").forEach((item, index) => {
+            if (element.questionType == 3) {
+              element.optsArr.push({
+                selected: false,
+                value: item,
+                index: index,
+                isAnswer: element.answer.split("-").includes(item),
+              });
+            } else {
+              element.optsArr.push({
+                selected: false,
+                value: item,
+                index: index,
+                isAnswer: item === element.answer,
+              });
+            }
+          });
+          element.isCompleted = false;
           element.userAnswer = [];
         });
         that.problemListTotal = res.total;
@@ -419,11 +664,21 @@ export default {
 
   components: {
     navBar,
+    tabbar,
+    mRadio,
+    mRadioGroup,
+    mCheckbox,
+    mCheckboxGroup,
   },
 };
 </script>
 
 <style lang="scss" scoped>
+.flex-all-center {
+  display: flex;
+  align-content: center;
+  align-items: center;
+}
 .divider {
   width: 100%;
   height: 24rpx;

+ 17 - 0
src/otherPages/mockExamEnd/index.vue

@@ -48,6 +48,7 @@
 <script>
 import hege from "./hege.png";
 import buhege from "./buhege.png";
+import api from '@/api/index'
 export default {
   data() {
     return {
@@ -57,15 +58,31 @@ export default {
       useTime: "",
       subject: 1,
       query: {},
+      gs:"",
+      gsMap:{
+        xc:"小车",
+        hc:"货车",
+        kc:"客车",
+        mtc:"摩托车"
+      }
+
     };
   },
   onLoad(query) {
     this.score = query.score;
     this.useTime = query.useTime;
     this.subject = query.subject;
+    this.gs = query.gs
+    api.exam.studentScoreInfo({
+      score:Number(this.score),
+      kskm:this.subject==1?'科目一':'科目四',
+      type:this.gsMap[this.gs]
+    })
+
   },
 };
 //提交考试成绩
+//score=1&useTime=0%3A5&liceCar=1&liceTruck=&liceBus=&liceMoto=&name=%E7%A7%91%E7%9B%AE%E4%B8%80&gs=xc&cert=C1%2FC2%2FC3&vehicle=%E8%BD%BF%E8%BD%A6&subject=1&title=%E6%A8%A1%E6%8B%9F%E8%80%83%E8%AF%95&sort=3&__id__=3
 // createTestScores({
 // 	type: query.vehicle as string,
 // 	kskm: query.name as string,

+ 16 - 9
src/otherPages/testScores/index.vue

@@ -62,7 +62,7 @@
         <view class="w25per">{{ item.type }}</view>
         <view class="w25per">{{ item.kskm }}</view>
         <view class="w25per">{{ item.score }}</view>
-        <view class="w25per">{{ item.createTime }}</view>
+        <view class="w25per">{{ item.createTime.split(" ")[0] }}</view>
       </view>
     </div>
   </view>
@@ -72,17 +72,15 @@
 
 <script>
 import api from "@/api/index";
-
+import utils from "@/utils/index";
 export default {
   data() {
     return {
+      query:{
+
+      },
       testScoresList: [
-        {
-          type: "轿车",
-          kskm: "科目一",
-          score: 90,
-          createTime: "2021-10-11",
-        },
+     
       ],
       testScoresInfo: {
         maxScore: 0,
@@ -94,16 +92,25 @@ export default {
   onLoad(query) {
     this.getTestScoresList();
     this.getTestScoresInfo();
+    this.query = query
   },
   methods: {
+    goMockTest(){
+      uni.navigateTo({
+        url:'/otherPages/beforeMockExam/index?'+utils.mapToUrlQuery(this.query)
+      })
+
+    },
     getTestScoresInfo() {
       api.exam.studentScoreInfoGetScoreInfoAll({}).then((res) => {
+ 
         this.testScoresInfo = res.data;
       });
     },
     getTestScoresList() {
       api.exam.studentScoreInfoList({}).then((res) => {
-        this.testScoresList = res.data;
+        console.log(res)
+        this.testScoresList = res.rows;
       });
     },
   },

+ 46 - 28
src/pages/user/index.vue

@@ -1,9 +1,18 @@
 <template>
   <scroll-view scroll-y class="content">
     <div class="user">
-      <van-cell   center :value="userInfo.nickName" @tap="getUserProfile">
+      <van-cell center :value="userInfo.nickName?userInfo.nickName:'新用户'" @tap="getUserProfile">
         <view slot="title">
-         <image class="user-headImg" :src="userInfo.headImage"></image>
+          <image
+            class="user-headImg"
+            v-if="userInfo.headImage"
+            :src="userInfo.headImage"
+          ></image>
+          <image
+            class="user-headImg"
+            v-else
+            :src="unLoginHead"
+          ></image>
         </view>
       </van-cell>
       <van-cell-group class="group">
@@ -31,6 +40,7 @@
         >
         </van-cell>
       </van-cell-group>
+      <!-- #ifdef MP-WEIXIN -->
       <van-cell-group class="group">
         <van-cell
           title="反馈帮助"
@@ -43,6 +53,7 @@
           </template>
         </van-cell>
       </van-cell-group>
+      <!-- #endif -->
     </div>
 
     <!-- <view class="ad-box serviceBox">
@@ -52,46 +63,53 @@
 </template>
 
 <script>
-import api from '@/api/index'
+import api from "@/api/index";
+import unLoginHead from "@/assets/img/unLoginHead.png"
 export default {
   computed: {
+    unLoginHead(){
+      return unLoginHead
+    },
     userInfo() {
       return this.$store.state.user.userInfo;
     },
-    expireTime(){
-
-      return this.$store.state.user.userInfo.expireTime&&this.$store.getters.isVip?this.$store.state.user.userInfo.expireTime.split(" ")[0]:null
-    }
+    expireTime() {
+      return this.$store.state.user.userInfo.expireTime &&
+        this.$store.getters.isVip
+        ? this.$store.state.user.userInfo.expireTime.split(" ")[0]
+        : null;
+    },
   },
   mounted() {
     this.$store.dispatch("GetInfo");
   },
   methods: {
-     getUserProfile(e) {
-       uni.getUserProfile({
+    getUserProfile(e) {
+      let that =this
+      uni.getUserProfile({
         desc: "业务需要",
-        success(res){
-          console.log(res)
-          api.user.userInfoUserInfo({
-            headImage:res.userInfo.avatarUrl,
-            nickName:res.userInfo.nickName
-          }).then(res=>{
-
-          })
-          
-     
+        success(res) {
+          console.log(res);
+          api.user
+            .userInfoUserInfo({
+              headImage: res.userInfo.avatarUrl,
+              nickName: res.userInfo.nickName,
+            })
+            .then((res) => {
+               that.$store.dispatch("GetInfo");
+            
+            
 
-          
-
-        }
+            });
+        },
       });
-  
+
       // let updateRes = await this.$api.user.updateUserInfo({
       //   headImage: userInfo.userInfo.avatarUrl,
       //   nickName: userInfo.userInfo.nickName,
       // });
       // if (updateRes.code == 200) {
-        
+
       //   this.$store.state.user.userInfo.headImage = userInfo.userInfo.avatarUrl;
       //   this.$store.state.user.userInfo.nickName = userInfo.userInfo.nickName;
       // }
@@ -113,10 +131,10 @@ export default {
     margin-right: 10px;
   }
 }
-.user-headImg{
-	width: 90rpx;
-	height: 90rpx;
-	border-radius: 50%;
+.user-headImg {
+  width: 90rpx;
+  height: 90rpx;
+  border-radius: 50%;
 }
 .cell-icon {
   margin-right: 5px;

+ 7 - 5
src/store/getters.js

@@ -4,6 +4,7 @@ const getters = {
   token: state => state.user.token,
   userInfo: state => state.user.userInfo,
   isVip: state => {
+  
     //#ifdef MP-WEIXIN
     if (state.user.userInfo && state.user.userInfo.expireTime) {
       let expireTime = new Date(state.user.userInfo.expireTime).getTime()
@@ -21,15 +22,19 @@ const getters = {
     //#endif
 
     //#ifdef MP-TOUTIAO
-    if(uni.getStorageInfoSync("unionid")!==state.user.userInfo.unionid){
+    // console.log(tt.getStorageSync("unionid"),state.user.userInfo)
+    if(uni.getStorageSync("unionid")!==state.user.userInfo.unionId){
+     
       return false
     }
     let publicKey = "-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCzR04LMmDlwyVRfK+Kgsm/vFMOFyqvGk4QIVC" +
       "Gj2CKKfhycRExm15N3tKOOouIjl/EU79It45oS+ltJkscvYrJn1zz+1bSoBLelZzJrn7K0NpHF8k" +
       "bCprsFHd60x+YJ4l8C3SDxfFebo4kqveJzx6JNZKwzFm7LPEO5XB9pEBRwIDAQAB-----END PUBLIC KEY-----"
-    let verifyString = state.user.userInfo.unionid + state.user.userInfo.isVip
+    
+    let verifyString = state.user.userInfo.unionId + state.user.userInfo.isVip
     let sign = state.user.userInfo.sign
     function verifySign(data, sign, publicKey) {
+      console.log(data, sign, publicKey)
       const verify = crypto.createVerify('RSA-SHA256');
       verify.update(data);
       verify.end();
@@ -59,9 +64,6 @@ const getters = {
     //   }
     // }
     // console.log(verify(publicKey,verifyString,sign),"验证结果2")
-
-
-
     //#endif