谢杰标 пре 2 година
родитељ
комит
d43554352d

+ 1 - 1
common/config.js

@@ -1,6 +1,6 @@
 // test 测试环境
 const test = {
-  BASE_URL: "http://192.168.1.7:5055",
+  BASE_URL: "http://192.168.1.222:5055",
   BASE_IMG_URL: "https://file-dev.xyyxt.net/",
   domain: "h.xyyxt.net",
   tenantId: "867735392558919680", //详粤云学堂

+ 24 - 0
common/httpList/goods.js

@@ -512,4 +512,28 @@ export default {
       data: data,
     });
   },
+  // 山东题库列表
+  sdQuestionList(data) {
+    return myRequest({
+      url: "/course/special/question/list",
+      method: "get",
+      data: data,
+    });
+  },
+  // 查询用户是否有山东题库
+  getIsHaveOtherQuetion(data) {
+    return myRequest({
+      url: "/course/special/question/count",
+      method: "get",
+      data: data,
+    });
+  },
+  // 获取三方题库试卷ID
+  getOtherExamId(data) {
+    return myRequest({
+      url: "/goods/rel/exam",
+      method: "post",
+      data: data,
+    });
+  },
 };

+ 55 - 41
common/httpList/wxpay.js

@@ -1,42 +1,56 @@
-import {
-	myRequest
-} from '../request.js'
+import { myRequest } from "../request.js";
 export default {
-	//获取支付回调凭证
-	wxCallback(data) {
-		return myRequest({
-			url: '/wx/pay/callback',
-			method: 'post',
-			data: data
-		})
-	},
-	//获取支付凭证
-	wxPayment(data) {
-		return myRequest({
-			url: '/wx/pay/payment',
-			method: 'post',
-			data: data
-		})
-	},
-	wxOpenid(data) {
-		return myRequest({
-			url: '/wx/getOpenid',
-			method: 'post',
-			data: data
-		})
-	},
-	checkBindGzh(data) {
-		return myRequest({
-			url: '/app/user/checkBindGzh',
-			method: 'get',
-			data: data
-		})
-	},
-	OfficialLogin(data) {
-		return myRequest({
-			url: '/app/user/gzh_bind',
-			method: 'post',
-			data: data
-		})
-	},
-}
+  //获取支付回调凭证
+  wxCallback(data) {
+    return myRequest({
+      url: "/wx/pay/callback",
+      method: "post",
+      data: data,
+    });
+  },
+  //获取支付凭证
+  wxPayment(data) {
+    return myRequest({
+      url: "/wx/pay/payment",
+      method: "post",
+      data: data,
+    });
+  },
+  wxOpenid(data) {
+    return myRequest({
+      url: "/wx/getOpenid",
+      method: "post",
+      data: data,
+    });
+  },
+  checkBindGzh(data) {
+    return myRequest({
+      url: "/app/user/checkBindGzh",
+      method: "get",
+      data: data,
+    });
+  },
+  OfficialLogin(data) {
+    return myRequest({
+      url: "/app/user/gzh_bind",
+      method: "post",
+      data: data,
+    });
+  },
+  // 获取公众号id
+  getH5Openid(data) {
+    return myRequest({
+      url: "/app/user/wx/gzh_bind",
+      method: "post",
+      data: data,
+    });
+  },
+  // 获取公众号id
+  getWxOpenid(data) {
+    return myRequest({
+      url: "/wx/exam/getOpenid",
+      method: "post",
+      data: data,
+    });
+  },
+};

+ 19 - 13
pages/learn/index.vue

@@ -381,20 +381,14 @@
                   选班重学
                 </view>
               </template>
-              <!-- examApplyGoodsList.length -是判断是否关联指定学员 -->
-              <!-- item.applyStatus === 1 &&
-                    !(
-                      sysTime <= item.serviceStartTime ||
-                      sysTime >= item.serviceEndTime ||
-                      (item.classStartTime && sysTime <= item.classStartTime) ||
-                      (item.classEndTime && sysTime >= item.classEndTime) ||
-                      item.learningStatus == 2 ||
-                      item.classStatus == 0 ||
-                      (item.learningStatus == 3 &&
-                        sysTime < item.learningTimeStart) ||
-                      !item.examApplyGoodsList.length
-                    ) -->
               <view v-else class="exam_btns">
+                <view
+                  class="box_appoint"
+                  v-if="item.openQuestion === 1"
+                  @click="toBuyQuestionBank(item)"
+                >
+                  <view class="exam_word ones">购买题库</view>
+                </view>
                 <view
                   class="box_appoint"
                   v-if="item.examApplyGoodsList"
@@ -599,6 +593,8 @@
         <rich-text :nodes="nodesCcontent | formatRichText"></rich-text>
       </view>
     </u-modal>
+    <!-- tabbar -->
+    <myTabbar></myTabbar>
   </view>
 </template>
 
@@ -1385,6 +1381,16 @@ export default {
       this.appointTestShow = false;
       this.appoint_an(this.appoint);
     },
+    toBuyQuestionBank(item) {
+      this.$api.goodsDetail(item.questionGoodsId).then((res) => {
+        this.$store.commit("setShoppingCartList", {
+          shoppingCartList: [
+            { relevanceId: item.orderGoodsId, ...res.data.data },
+          ],
+        });
+        this.$navTo.togo("/pages2/order/confirm_pay");
+      });
+    },
     appointment(item) {
       this.appointItemIndex = item;
       this.appointTestList = item.examApplyGoodsList;

+ 97 - 43
pages/questionBank/index.vue

@@ -7,35 +7,23 @@
       <view class="my_courses">
         <text class="titles">我的题库</text>
         <view class="bottoms">
-          <navigator hover-class="none" url="/pages2/subject/collect">
-            <view class="item collect">
-              <view class="text"
-                >收藏集<u-icon name="arrow-right"></u-icon
-              ></view>
-              <image class="img" src="/static/questionBank_collect.png"></image>
-            </view>
-          </navigator>
+          <view class="item collect" @click="toRecord(0)">
+            <view class="text">收藏集<u-icon name="arrow-right"></u-icon></view>
+            <image class="img" src="/static/questionBank_collect.png"></image>
+          </view>
           <view class="item list">
-            <navigator hover-class="none" url="/pages2/bank/question_record">
-              <view class="list-in">
-                <image
-                  class="img"
-                  src="/static/questionBank_record.png"
-                ></image>
-                <view class="text">
-                  做题记录 <u-icon name="arrow-right"></u-icon>
-                </view>
+            <view class="list-in" @click="toRecord(1)">
+              <image class="img" src="/static/questionBank_record.png"></image>
+              <view class="text">
+                做题记录 <u-icon name="arrow-right"></u-icon>
               </view>
-            </navigator>
-
-            <navigator hover-class="none" url="/pages2/subject/wrong">
-              <view class="list-in">
-                <image class="img" src="/static/questionBank_wrong.png"></image>
-                <view class="text">
-                  错题集 <u-icon name="arrow-right"></u-icon>
-                </view>
+            </view>
+            <view class="list-in" @click="toRecord(2)">
+              <image class="img" src="/static/questionBank_wrong.png"></image>
+              <view class="text">
+                错题集 <u-icon name="arrow-right"></u-icon>
               </view>
-            </navigator>
+            </view>
           </view>
         </view>
 
@@ -60,10 +48,11 @@
                   class="l_range"
                   src="/static/learn/learn_range.png"
                 ></image>
-                学习周期:
+                {{ isGetOtherQuetion ? "有效期" : "学习周期" }}
                 <text class="l_time"
-                  >{{ item.serviceStartTime | formate("yyyy.mm.dd") }} -
-                  {{ item.serviceEndTime | formate("yyyy.mm.dd") }}</text
+                  >{{ item.serviceStartTime | formate("yyyy.mm.dd") }}-{{
+                    item.serviceEndTime | formate("yyyy.mm.dd")
+                  }}</text
                 >
               </view>
             </view>
@@ -78,23 +67,33 @@
               <view class="rights" v-if="!item.externalLinkStatus">
                 <view class="learn_progress">
                   <view class="progress_up">
-                    <view>
-                      学习进度:{{ item.doNum }}/{{ item.totalNum }}
-                    </view>
-                    <view class="progress_bar" style="width: 100%">
-                      <u-line-progress
-                        :show-percent="false"
-                        height="22"
-                        active-color="#ff9900"
-                        :percent="(item.doNum / item.totalNum) * 100"
-                      ></u-line-progress>
+                    <view v-if="isGetOtherQuetion">
+                      总题数:{{ item.questionNum || 300 }}题
                     </view>
+                    <template v-else>
+                      <view>
+                        学习进度:{{ item.doNum }}/{{ item.totalNum }}
+                      </view>
+                      <view class="progress_bar" style="width: 100%">
+                        <u-line-progress
+                          :show-percent="false"
+                          height="22"
+                          active-color="#ff9900"
+                          :percent="(item.doNum / item.totalNum) * 100"
+                        ></u-line-progress>
+                      </view>
+                    </template>
                   </view>
                 </view>
               </view>
             </view>
             <!-- 按钮 -->
-            <view class="study_btns" v-if="!item.externalLinkStatus">
+            <view class="study_btns" v-if="isGetOtherQuetion">
+              <view class="exam_word intos" @click="toSdLearn(item)"
+                >开始刷题</view
+              >
+            </view>
+            <view class="study_btns" v-else-if="!item.externalLinkStatus">
               <view
                 v-for="(child, c_index) in item.paperVos"
                 :key="c_index"
@@ -140,13 +139,14 @@ export default {
       },
       total: 0,
       options: {},
+      isGetOtherQuetion: true,
     };
   },
   computed: {
     ...mapGetters(["userInfo", "config"]),
   },
   onLoad(options) {
-    uni.hideTabBar()
+    uni.hideTabBar();
     this.options = options;
     if (this.options.isAct && !this.$method.isLogin()) {
       uni.navigateTo({
@@ -159,6 +159,7 @@ export default {
     if (this.options.skipPort) {
       await this.$method.skipLogin(this.options.skipPort);
     }
+    // this.getIsHaveOtherQuetion();
     this.param.pageNum = 1;
     this.questionLists = [];
     this.getBankList();
@@ -181,8 +182,10 @@ export default {
         return;
       }
       this.allLoading = true;
-      this.$api
-        .listUserFreeUnionBuyGoodsList(this.param)
+      const fn = this.isGetOtherQuetion
+        ? "sdQuestionList"
+        : "listUserFreeUnionBuyGoodsList";
+      this.$api[fn](this.param)
         .then((res) => {
           if (res.data.code == 200) {
             this.questionLists.push(...(res.data.rows || []));
@@ -248,6 +251,57 @@ export default {
           paperId,
       });
     },
+    // 是否含有山东题库
+    async getIsHaveOtherQuetion() {
+      let res = await this.$api.getIsHaveOtherQuetion();
+      if (res.data.data == 1) {
+        uni.showModal({
+          title: "提示",
+          content: "是否学习山东题库?",
+          success: (res) => {
+            this.isGetOtherQuetion = res.confirm;
+            if (res.confirm) {
+              this.getBankList();
+            }
+          },
+        });
+      }
+    },
+    toSdLearn(item) {
+      this.$api.getOtherExamId({ relId: item.qsId }).then((res) => {
+        if (res.data.code == 200) {
+          uni.navigateTo({
+            url:
+              "/pages2/bank/questionBank?id=" +
+              res.data.data.examId +
+              "&goodsid=" +
+              item.goodsId +
+              "&orderGoodsId=" +
+              item.orderGoodsId +
+              "&entryType=sd",
+          });
+        } else {
+          uni.showToast({
+            icon: "none",
+            title: res.data.msg,
+          });
+        }
+      });
+    },
+    toRecord(type) {
+      let url = [
+        "/pages2/subject/collect",
+        "/pages2/bank/question_record",
+        "/pages2/subject/wrong",
+        "",
+      ][type];
+      if (this.isGetOtherQuetion) {
+        url += "?isOther=1";
+      }
+      uni.navigateTo({
+        url,
+      });
+    },
   },
 };
 </script>

+ 4 - 0
pages2/bank/questionBank.vue

@@ -921,6 +921,7 @@
 </template>
 
 <script>
+import f from "@/utils/authority";
 export default {
   data() {
     return {
@@ -2401,6 +2402,9 @@ export default {
   computed: {
     doMode() {
       // 做题模式 1章卷 2随机练习 3模拟组卷
+      if (this.entryType == "sd") {
+        return 4;
+      }
       return this.examData.simulateStatus
         ? 3
         : this.entryType == "random"

+ 30 - 36
pages2/bank/question_record.vue

@@ -1,7 +1,7 @@
 <template>
   <view>
     <nav-bar title="做题记录" class="nav"></nav-bar>
-    <view class="tabs">
+    <view class="tabs" v-if="!isOther">
       <view
         class="tab"
         :class="{ active: index == 1 }"
@@ -30,9 +30,9 @@
       </view>
     </view>
 
-    <view class="record">
+    <view class="record" :style="{ marginTop: isOther ? '0' : '80rpx' }">
       <view class="item" v-for="(record, index) in recordList" :key="index">
-        <view class="note">{{ record.paperName }}</view>
+        <view class="note" v-if="record.paperName">{{ record.paperName }}</view>
         <view class="title">{{ record.examName }}</view>
         <view class="desc">
           <view>
@@ -41,13 +41,19 @@
           </view>
           <view>
             <image src="/static/icon/wk_icon2.png"></image>
-            <text>总共 {{ record.totalQuestionNum }} 题 做对 {{ record.rightQuestionNum }} 题</text>
+            <text
+              >总共 {{ record.totalQuestionNum }} 题 做对{{
+                record.rightQuestionNum
+              }}题</text
+            >
           </view>
         </view>
         <view class="btns">
           <view
             class="btn"
-            v-if="record.doMode == 1 && record.status == 1"
+            v-if="
+              (record.doMode == 1 && record.status == 1) || record.doMode == 4
+            "
             @click="doRepeat(record.goodsId, record)"
             >重做</view
           >
@@ -81,7 +87,7 @@
       </view>
     </view>
 
-    <view class="modal" :style="{ top: modalTop + 'px' }" v-if="index == 1">
+    <view class="modal" v-if="index == 1">
       <view class="content">
         <scroll-view scroll-y="true" style="height: 100%">
           <view
@@ -150,34 +156,15 @@ export default {
       activeIndex: 0,
       typeIndex: 0,
       itemIndex: "",
-      modalTop: 0,
+      isOther: 0,
     };
   },
   onLoad(option) {
-    this.listGoodsUserQuestion();
-    this.examaperList();
-    // this.getExamRecordList();
-
-    uni.getSystemInfo({
-      success: (e) => {
-        let info = uni.createSelectorQuery().select(".nav");
-        info
-          .boundingClientRect((navData) => {
-            //data - 各种参数
-
-            let info = uni.createSelectorQuery().select(".tabs");
-            info
-              .boundingClientRect((tabData) => {
-                //data - 各种参数
-                this.modalTop = navData.height + tabData.height;
-                console.log(navData); // 获取元素宽度
-                console.log(tabData); // 获取元素宽度
-              })
-              .exec();
-          })
-          .exec();
-      },
-    });
+    this.isOther = option.isOther;
+    if (!this.isOther) {
+      this.listGoodsUserQuestion();
+      this.examaperList();
+    }
   },
   onPullDownRefresh() {
     let that = this;
@@ -361,10 +348,12 @@ export default {
       if (this.param.pageNum == 1) {
         this.recordList = [];
       }
-      this.$api.examRecordGroupList(this.param).then((res) => {
-        this.recordList.push.apply(this.recordList, res.data.rows);
-        this.total = res.data.total;
-      });
+      this.$api
+        .examRecordGroupList({ ...this.param, ...this.doMode })
+        .then((res) => {
+          this.recordList.push.apply(this.recordList, res.data.rows);
+          this.total = res.data.total;
+        });
     },
     /**
      * 继续做题
@@ -567,6 +556,11 @@ export default {
       });
     },
   },
+  computed: {
+    doMode() {
+      return this.isOther ? { doMode: 4 } : {};
+    },
+  },
 };
 </script>
 <style>
@@ -604,7 +598,6 @@ page {
 }
 
 .record {
-  margin-top: 80rpx;
   padding: 16rpx 8rpx;
   display: flex;
   flex-wrap: wrap;
@@ -681,6 +674,7 @@ page {
 }
 
 .modal {
+  top: 168rpx;
   bottom: 0;
   z-index: 199999999;
   position: fixed;

+ 460 - 409
pages2/subject/collect.vue

@@ -1,429 +1,480 @@
 <template>
-	<view class="safeArea">
-		<nav-bar title="收藏集" class="nav"></nav-bar>
-		<view class="sceenBox">
-			<view :class="['item', {'active':sceenType===1} ]" @click="showSceen(1)">全部题库记录<u-icon class="icon" :class="sceenType ===1 ? 'animals':''"  name="arrow-down"></u-icon></view>
-			<view :class="['item', {'active':sceenType===2} ]" @click="showSceen(2)">全部试卷类型<u-icon class="icon" :class="sceenType ===2 ? 'animals':''"  name="arrow-down"></u-icon></view>
-		</view>
-		<view class="sceenModel" v-if="sceenType"  :style="{top:modalTop+'px'}" >
-			<view class="sceenModelBg" @click="hideSceen"></view>
-			<view class="sceenMain" >
-				<scroll-view scroll-y="true" style="height:100%">
-					<div class="sceenMainContent">
-						<template v-if="sceenType===1">
-							<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList1" :key="index" @click="choseRecord(index)">{{item.goodsName}}</view>
-						</template>
-						<template v-if="sceenType===2">
-							<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choseType(index)">{{item.paperName}}</view>
-						</template>
-					</div>
-					
-				</scroll-view>
-				
-			</view>
-		</view>
-		<view class="wrap">
-			<view class="wrongTab">
-				<view class="item" :class="{active:type == 1}" @click="selectType(1)">试卷归类</view>
-				<view class="item" :class="{active:type == 2}" @click="selectType(2)">题型归类</view>
-			</view>
-			<view class="wrongHead">
-				<view class="title">收藏统计</view>
-				<view class="progress">
-					<text>{{total}}</text>
-				</view>
-			</view>
-			<view class="wrongList" v-if="type == 1">
-				<view class="item" v-for="(item,index) in testList.rows" :key="index">
-					<view class="title">{{item.examName}}</view>
-					<view class="bt">
-						<view class="left">收藏数<text class="num">{{item.questionNum}}</text></view>
-						<view class="right">
-							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?examId='+item.examId + '&distinction=1' + '&doMode=' + item.doMode">
-								<view class="btn">重做</view>
-							</navigator>
-							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?examId='+item.examId+'&explain=1' + '&distinction=1'+ '&doMode=' + item.doMode">
-								<view class="btn">解析</view>
-							</navigator>
-							<!-- <view class="btn">解析</view> -->
-						</view>
-					</view>
-				</view> 
-			</view>
-			
-			<view class="wrongList" v-if="type == 2">
-				<view class="item" v-for="(item,index) in typeList.rows" :key="index">
-					<view class="title">
-						<text v-if="item.type==1">单选题</text>
-						<text v-if="item.type==2">多选题</text>
-						<text v-if="item.type==3">判断题</text>
-						<text v-if="item.type==4">案例题</text>
-						<text v-if="item.type==5">简答题</text>
-					</view>
-					<view class="bt">
-						<view class="left">收藏数<text class="num">{{item.num}}</text></view>
-						<view class="right">
-							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?type='+item.type + '&distinction=2'+ '&doMode=' + item.doMode">
-								<view class="btn">重做</view>
-							</navigator>
-							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?type='+item.type+'&explain=1' + '&distinction=2'+ '&doMode=' + item.doMode">
-								<view class="btn">解析</view>
-							</navigator>
-							<!-- <navigator  hover-class="none" :url="'/pages2/subject/collectTypeBank?type='+item.type + '&distinction=2'">
-								<view class="btn">重做</view>
-							</navigator>
-							<navigator  hover-class="none" :url="'/pages2/subject/collectTypeBank?type='+item.type+'&explain=1' + '&distinction=2'">
-								<view class="btn">解析</view>
-							</navigator> -->
-						</view>
-					</view>
-				</view>
-			</view>
-		</view>
-	</view>
+  <view class="safeArea">
+    <nav-bar title="收藏集" class="nav"></nav-bar>
+    <view class="sceenBox" v-if="!isOther">
+      <view :class="['item', { active: sceenType === 1 }]" @click="showSceen(1)"
+        >全部题库记录<u-icon
+          class="icon"
+          :class="sceenType === 1 ? 'animals' : ''"
+          name="arrow-down"
+        ></u-icon
+      ></view>
+      <view :class="['item', { active: sceenType === 2 }]" @click="showSceen(2)"
+        >全部试卷类型<u-icon
+          class="icon"
+          :class="sceenType === 2 ? 'animals' : ''"
+          name="arrow-down"
+        ></u-icon
+      ></view>
+    </view>
+    <view class="sceenModel" v-if="sceenType">
+      <view class="sceenModelBg" @click="hideSceen"></view>
+      <view class="sceenMain">
+        <scroll-view scroll-y="true" style="height: 100%">
+          <div class="sceenMainContent">
+            <template v-if="sceenType === 1">
+              <view
+                :class="['item', { active: item.checked }]"
+                v-for="(item, index) in scennList1"
+                :key="index"
+                @click="choseRecord(index)"
+                >{{ item.goodsName }}</view
+              >
+            </template>
+            <template v-if="sceenType === 2">
+              <view
+                :class="['item', { active: item.checked }]"
+                v-for="(item, index) in scennList2"
+                :key="index"
+                @click="choseType(index)"
+                >{{ item.paperName }}</view
+              >
+            </template>
+          </div>
+        </scroll-view>
+      </view>
+    </view>
+    <view :class="isOther ? 'wrap1' : 'wrap'">
+      <view class="wrongTab" v-if="!isOther">
+        <view class="item" :class="{ active: type == 1 }" @click="selectType(1)"
+          >试卷归类</view
+        >
+        <view class="item" :class="{ active: type == 2 }" @click="selectType(2)"
+          >题型归类</view
+        >
+      </view>
+      <view class="wrongHead">
+        <view class="title">收藏统计</view>
+        <view class="progress">
+          <text>{{ total }}</text>
+        </view>
+      </view>
+      <view class="wrongList" v-if="type == 1">
+        <view class="item" v-for="(item, index) in testList.rows" :key="index">
+          <view class="title">{{ item.examName }}</view>
+          <view class="bt">
+            <view class="left"
+              >收藏数<text class="num">{{ item.questionNum }}</text></view
+            >
+            <view class="right">
+              <navigator
+                hover-class="none"
+                :url="
+                  '/pages2/subject/collectBank?examId=' +
+                  item.examId +
+                  '&distinction=1' +
+                  '&doMode=' +
+                  item.doMode
+                "
+              >
+                <view class="btn">重做</view>
+              </navigator>
+              <navigator
+                hover-class="none"
+                :url="
+                  '/pages2/subject/collectBank?examId=' +
+                  item.examId +
+                  '&explain=1' +
+                  '&distinction=1' +
+                  '&doMode=' +
+                  item.doMode
+                "
+              >
+                <view class="btn">解析</view>
+              </navigator>
+              <!-- <view class="btn">解析</view> -->
+            </view>
+          </view>
+        </view>
+      </view>
+
+      <view class="wrongList" v-if="type == 2">
+        <view class="item" v-for="(item, index) in typeList.rows" :key="index">
+          <view class="title">
+            <text v-if="item.type == 1">单选题</text>
+            <text v-if="item.type == 2">多选题</text>
+            <text v-if="item.type == 3">判断题</text>
+            <text v-if="item.type == 4">案例题</text>
+            <text v-if="item.type == 5">简答题</text>
+          </view>
+          <view class="bt">
+            <view class="left"
+              >收藏数<text class="num">{{ item.num }}</text></view
+            >
+            <view class="right">
+              <navigator
+                hover-class="none"
+                :url="
+                  '/pages2/subject/collectBank?type=' +
+                  item.type +
+                  '&distinction=2' +
+                  '&doMode=' +
+                  item.doMode
+                "
+              >
+                <view class="btn">重做</view>
+              </navigator>
+              <navigator
+                hover-class="none"
+                :url="
+                  '/pages2/subject/collectBank?type=' +
+                  item.type +
+                  '&explain=1' +
+                  '&distinction=2' +
+                  '&doMode=' +
+                  item.doMode
+                "
+              >
+                <view class="btn">解析</view>
+              </navigator>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-import { mapGetters } from 'vuex';
+import { mapGetters } from "vuex";
 export default {
-	components: {},
-	data() {
-		return {
-			sceenType: null,
-			scennList1:[
-				{goodsId: '', goodsName: '全部题库记录', checked: true}
-			],
-			scennList2:[
-				{paperId: '', paperName: '全部试卷类型', checked: true}
-			],
-			type:1,
-			total:0,
-			modalTop:0,
-			testList:[],
-			typeList:[],
-			goodsid:'',
-			orderGoodsId:'',
-			paperid:''
-		};
-	},
-	onPullDownRefresh() {},
-	onLoad(option) {
-		this.orderGoodsId = option.orderGoodsId || '';
-		this.listGoodsUserQuestion();
-		this.examaperList();
-		
-		
-		uni.getSystemInfo({
-			success:(e) => {
-				let info = uni.createSelectorQuery().select(".nav");
-				info.boundingClientRect((navData) => { //data - 各种参数
-				
-					let info = uni.createSelectorQuery().select(".sceenBox");
-					info.boundingClientRect((tabData) => { //data - 各种参数
-						this.modalTop = navData.height + tabData.height
-						console.log(navData) // 获取元素宽度
-						console.log(tabData) // 获取元素宽度
-					}).exec()
-				}).exec()
-			}
-		})
-	},
-	onShow() {
-		this.getData()
-	},
-	methods: {
-		getData() {
-			if(this.type == 1) {
-				this.goodsCollectExamList()
-			} else if(this.type == 2) {
-				this.collectQuestionTypeList();
-			}
-		},
-		examaperList() {
-			this.$api.examaperList({
-				
-			}).then(res => {
-				this.scennList2 = [...this.scennList2,...res.data.rows];
-			})
-		},
-		
-		listGoodsUserQuestion() {
-			this.$api.listGoodsUserQuestion({
-				
-			}).then(res => {
-				this.scennList1 = [...this.scennList1,...res.data.rows];
-			})
-		},
-		goodsCollectExamList() {
-			this.$api.goodsCollectExamList({
-				paperId:this.paperid,
-				goodsId:this.goodsid,
-				orderGoodsId:this.orderGoodsId
-			}).then(res => {
-				this.testList = res.data 
-				let total = 0;
-				this.testList.rows.forEach(item => {
-					total += item.questionNum;
-				})
-				
-				this.total = total
-			})
-		},
-		collectQuestionTypeList() {
-			// let params = {}
-			// this.paperid && (params['paperId'] = this.paperid)
-			// this.orderGoodsId && (params['orderGoodsId'])
-			this.$api.collectQuestionTypeList({
-				paperId:this.paperid,
-				orderGoodsId:this.orderGoodsId
-			}).then(res => {
-				this.typeList = res.data 
-				let total = 0;
-				this.typeList.rows.forEach(item => {
-					total += item.num;
-				})
-				
-				this.total = total
-			})
-		},
-		showSceen(type){
-			if(this.sceenType == type) {
-				this.sceenType = null
-				return;
-			}
-			this.sceenType = type
-		},
-		/**
-		 * @param {Object} tab切换
-		 */
-		selectType(type) {
-			this.type = type;
-			this.getData();
-		},
-		hideSceen(){
-			this.sceenType = null
-		},
-		choseRecord(index) {
-			this.sceenType = null
-			this.scennList1.forEach((item,idx)=>{
-				this.$set(item, 'checked',false)
-				if(index==idx){
-					this.goodsid = item.goodsId
-					this.$set(item, 'checked',true)
-				}
-			})
-			
-			this.getData()
-		},
-		choseType(index) {
-			this.sceenType = null
-			this.scennList2.forEach((item,idx)=>{
-				this.$set(item, 'checked',false)
-				if(index==idx){
-					this.paperid = item.paperId
-					this.$set(item, 'checked',true)
-				}
-			})
-			this.getData()
-		},
-	}
+  components: {},
+  data() {
+    return {
+      sceenType: null,
+      scennList1: [{ goodsId: "", goodsName: "全部题库记录", checked: true }],
+      scennList2: [{ paperId: "", paperName: "全部试卷类型", checked: true }],
+      type: 1,
+      total: 0,
+      testList: [],
+      typeList: [],
+      goodsid: "",
+      orderGoodsId: "",
+      paperid: "",
+      isOther: 0,
+    };
+  },
+  onPullDownRefresh() {},
+  onLoad(option) {
+    this.orderGoodsId = option.orderGoodsId || "";
+    this.isOther = option.isOther;
+    if (!this.isOther) {
+      this.listGoodsUserQuestion();
+      this.examaperList();
+    }
+  },
+  onShow() {
+    this.getData();
+  },
+  methods: {
+    getData() {
+      if (this.type == 1) {
+        this.goodsCollectExamList();
+      } else if (this.type == 2) {
+        this.collectQuestionTypeList();
+      }
+    },
+    examaperList() {
+      this.$api.examaperList({}).then((res) => {
+        this.scennList2 = [...this.scennList2, ...res.data.rows];
+      });
+    },
+
+    listGoodsUserQuestion() {
+      this.$api.listGoodsUserQuestion({ ...this.doMode }).then((res) => {
+        this.scennList1 = [...this.scennList1, ...res.data.rows];
+      });
+    },
+    goodsCollectExamList() {
+      this.$api
+        .goodsCollectExamList({
+          paperId: this.paperid,
+          goodsId: this.goodsid,
+          orderGoodsId: this.orderGoodsId,
+          ...this.doMode,
+        })
+        .then((res) => {
+          this.testList = res.data;
+          let total = 0;
+          this.testList.rows.forEach((item) => {
+            total += item.questionNum;
+          });
+
+          this.total = total;
+        });
+    },
+    collectQuestionTypeList() {
+      // let params = {}
+      // this.paperid && (params['paperId'] = this.paperid)
+      // this.orderGoodsId && (params['orderGoodsId'])
+      this.$api
+        .collectQuestionTypeList({
+          paperId: this.paperid,
+          orderGoodsId: this.orderGoodsId,
+        })
+        .then((res) => {
+          this.typeList = res.data;
+          let total = 0;
+          this.typeList.rows.forEach((item) => {
+            total += item.num;
+          });
+
+          this.total = total;
+        });
+    },
+    showSceen(type) {
+      if (this.sceenType == type) {
+        this.sceenType = null;
+        return;
+      }
+      this.sceenType = type;
+    },
+    /**
+     * @param {Object} tab切换
+     */
+    selectType(type) {
+      this.type = type;
+      this.getData();
+    },
+    hideSceen() {
+      this.sceenType = null;
+    },
+    choseRecord(index) {
+      this.sceenType = null;
+      this.scennList1.forEach((item, idx) => {
+        this.$set(item, "checked", false);
+        if (index == idx) {
+          this.goodsid = item.goodsId;
+          this.$set(item, "checked", true);
+        }
+      });
+
+      this.getData();
+    },
+    choseType(index) {
+      this.sceenType = null;
+      this.scennList2.forEach((item, idx) => {
+        this.$set(item, "checked", false);
+        if (index == idx) {
+          this.paperid = item.paperId;
+          this.$set(item, "checked", true);
+        }
+      });
+      this.getData();
+    },
+  },
+  computed: {
+    doMode() {
+      return this.isOther ? { doMode: 4 } : {};
+    },
+  },
 };
 </script>
 <style lang="scss">
 page {
-	background: #EAEEF1;
+  background: #eaeef1;
 }
-
 </style>
 <style scoped lang="scss">
-	.animals{
-		transition: all 0.3s;
-		transform: rotate(180deg);
-	}
+.animals {
+  transition: all 0.3s;
+  transform: rotate(180deg);
+}
 .sceenBox {
-	width:100%;
-	height: 80rpx;
-	background: #FFFFFF;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	font-size: 32rpx;
-	font-family: PingFang SC;
-	font-weight: 500;
-	color: #999999;
-	position: fixed;
-	z-index: 999;
-	border-bottom: 1px solid #eee;
-	.item{
-		flex:1;
-		text-align: center;
-		&.active{
-			color:#333;
-			font-weight: bold;
-			.icon{
-				transform: rotate(180deg);
-			}
-		}
-	}
+  width: 100%;
+  height: 80rpx;
+  background: #ffffff;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  font-size: 32rpx;
+  font-family: PingFang SC;
+  font-weight: 500;
+  color: #999999;
+  position: fixed;
+  z-index: 999;
+  border-bottom: 1px solid #eee;
+  .item {
+    flex: 1;
+    text-align: center;
+    &.active {
+      color: #333;
+      font-weight: bold;
+      .icon {
+        transform: rotate(180deg);
+      }
+    }
+  }
+}
+.sceenModel {
+  left: 0;
+  bottom: 0;
+  top: 168rpx;
+  width: 100%;
+  position: fixed;
+  z-index: 998;
+  .sceenModelBg {
+    width: 100%;
+    height: 100%;
+    position: fixed;
+    background: rgba(0, 0, 0, 0.3);
+    z-index: 998;
+  }
+  .sceenMain {
+    position: relative;
+    z-index: 999;
+    background: #fff;
+    height: 80%;
+    .sceenMainContent {
+      display: flex;
+      flex-wrap: wrap;
+      padding: 8rpx;
+      justify-content: space-between;
+
+      .item {
+        width: 350rpx;
+        background: #f5f5f5;
+        border-radius: 16rpx;
+        padding: 25rpx 19rpx;
+        margin: 8rpx;
+        font-size: 32rpx;
+        font-family: PingFang SC;
+        font-weight: bold;
+        color: #666666;
+        &.active {
+          background: #007aff;
+          color: #fff;
+        }
+        &:first-child {
+          width: 100%;
+          text-align: center;
+        }
+      }
+    }
+  }
 }
-.sceenModel{
-	left:0;
-	bottom:0;
-	width:100%;
-	position: fixed;
-	z-index: 998;
-	.sceenModelBg{
-		width:100%;
-		height:100%;
-		position: fixed;
-		background: rgba(0,0,0,.3);
-		z-index: 998;
-	}
-	.sceenMain{
-		position: relative;
-		z-index: 999;
-		background: #fff;
-		height:80%;
-		.sceenMainContent {
-			
-			display: flex;
-			flex-wrap: wrap;
-			padding: 8rpx;
-			justify-content: space-between;
-			
-			.item{
-				width: 350rpx;
-				background: #F5F5F5;
-				border-radius: 16rpx;
-				padding: 25rpx 19rpx;
-				margin: 8rpx;
-				font-size: 32rpx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #666666;
-				&.active{
-					background: #007AFF;
-					color:#fff;
-				}
-				&:first-child{
-					width:100%;
-					text-align: center;
-				}
-			}
-		}
-		
-	}
+.wrap {
+  padding: 96rpx 16rpx 16rpx;
 }
-.wrap{
-	padding:96rpx 16rpx 16rpx;
+.wrap1 {
+  padding: 16rpx;
 }
-.wrongHead{
-	background: #FFFFFF;
-	border-radius: 16px;
-	padding:24rpx;
-	.title{
-		font-size: 30rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #333333;
-		.sub{
-			font-size: 20rpx;
-			font-weight: 500;
-			color: #999999;
-		}
-	}
-	.progress{
-		width: 180rpx;
-		height: 180rpx;
-		line-height: 140rpx;
-		border: 20rpx solid #EEEEEE;
-		border-radius: 50%;
-		margin: 24rpx auto;
-		font-size: 50rpx;
-		text-align: center;
-		
-	}
+.wrongHead {
+  background: #ffffff;
+  border-radius: 16px;
+  padding: 24rpx;
+  .title {
+    font-size: 30rpx;
+    font-family: PingFang SC;
+    font-weight: bold;
+    color: #333333;
+    .sub {
+      font-size: 20rpx;
+      font-weight: 500;
+      color: #999999;
+    }
+  }
+  .progress {
+    width: 180rpx;
+    height: 180rpx;
+    line-height: 140rpx;
+    border: 20rpx solid #eeeeee;
+    border-radius: 50%;
+    margin: 24rpx auto;
+    font-size: 50rpx;
+    text-align: center;
+  }
 }
-.wrongTab{
-	display: flex;
-	margin: 24rpx 0;
-	.item{
-		width: 144rpx;
-		height: 48rpx;
-		line-height: 48rpx;
-		text-align: center;
-		background: #fff;
-		border-radius: 16px;
-		font-size: 28rpx;
-		font-family: PingFang SC;
-		font-weight: 500;
-		color: #666666;
-		margin-left: 15rpx;
-		&.active{
-			background: #007AFF;
-			color: #fff;
-		}
-	}
+.wrongTab {
+  display: flex;
+  margin: 24rpx 0;
+  .item {
+    width: 144rpx;
+    height: 48rpx;
+    line-height: 48rpx;
+    text-align: center;
+    background: #fff;
+    border-radius: 16px;
+    font-size: 28rpx;
+    font-family: PingFang SC;
+    font-weight: 500;
+    color: #666666;
+    margin-left: 15rpx;
+    &.active {
+      background: #007aff;
+      color: #fff;
+    }
+  }
 }
-.wrongList{
-	margin-top:20rpx;
-	.item{
-		background: #FFFFFF;
-		border-radius: 16rpx;
-		padding: 0 30rpx;
-		margin-bottom: 16rpx;
-		overflow: hidden;
-		.title{
-			font-size: 32rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			color: #333333;
-			margin: 40rpx 0 17rpx;
-		}
-		.bt{
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			padding-bottom: 24rpx;
-			.left{
-				width: 176rpx;
-				height: 40rpx;
-				background: #FFFFFF;
-				border: 1px solid #EEEEEE;
-				border-radius: 16rpx;
-				font-size: 26rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #999999;
-				display: flex;
-				justify-content: center;
-				align-items: center;
-				.num{
-					font-size: 26rpx;
-					font-weight: bold;
-					color: #FF3B30;
-					margin-left: 16rpx;
-				}
-			}
-			.right{
-				display: flex;
-				.btn{
-					width: 100rpx;
-					height: 48rpx;
-					background: #FFFFFF;
-					border: 1px solid #007AFF;
-					border-radius: 16px;
-					font-size: 24rpx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					color: #007AFF;
-					margin-left:9rpx;
-					display: flex;
-					align-items: center;
-					justify-content: center;
-				}
-			}
-		}
-	}
+.wrongList {
+  margin-top: 20rpx;
+  .item {
+    background: #ffffff;
+    border-radius: 16rpx;
+    padding: 0 30rpx;
+    margin-bottom: 16rpx;
+    overflow: hidden;
+    .title {
+      font-size: 32rpx;
+      font-family: PingFang SC;
+      font-weight: bold;
+      color: #333333;
+      margin: 40rpx 0 17rpx;
+    }
+    .bt {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      padding-bottom: 24rpx;
+      .left {
+        width: 176rpx;
+        height: 40rpx;
+        background: #ffffff;
+        border: 1px solid #eeeeee;
+        border-radius: 16rpx;
+        font-size: 26rpx;
+        font-family: PingFang SC;
+        font-weight: 500;
+        color: #999999;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        .num {
+          font-size: 26rpx;
+          font-weight: bold;
+          color: #ff3b30;
+          margin-left: 16rpx;
+        }
+      }
+      .right {
+        display: flex;
+        .btn {
+          width: 100rpx;
+          height: 48rpx;
+          background: #ffffff;
+          border: 1px solid #007aff;
+          border-radius: 16px;
+          font-size: 24rpx;
+          font-family: PingFang SC;
+          font-weight: 500;
+          color: #007aff;
+          margin-left: 9rpx;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+      }
+    }
+  }
 }
 </style>

+ 437 - 393
pages2/subject/wrong.vue

@@ -1,413 +1,457 @@
 <template>
-	<view class="safeArea">
-		<nav-bar title="错题集"  class="nav"></nav-bar>
-		<view class="sceenBox">
-			<view :class="['item', {'active':sceenType===1} ]" @click="showSceen(1)">全部题库记录<u-icon class="icon" :class="sceenType ===1 ? 'animals':''"  name="arrow-down"></u-icon></view>
-			<view :class="['item', {'active':sceenType===2} ]" @click="showSceen(2)">全部试卷类型<u-icon class="icon" :class="sceenType ===2? 'animals':''"  name="arrow-down"></u-icon></view>
-		</view>
-		<view class="sceenModel" v-if="sceenType" :style="{top:modalTop+'px'}" >
-			<view class="sceenModelBg" @click="hideSceen"></view>
-			<view class="sceenMain">
-				<scroll-view scroll-y="true" style="height:100%">
-					<view class="sceenMainContent">
-						<template v-if="sceenType===1">
-							<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList1" :key="index" @click="choseRecord(index)">{{item.goodsName}}</view>
-						</template>
-						<template v-if="sceenType===2">
-							<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choseType(index)">{{item.paperName}}</view>
-						</template>
-					</view>
-				</scroll-view>
-				
-			</view>
-		</view>
-		<view class="wrap">
-			<view class="wrongTab">
-				<view class="item" :class="{active:type == 1}" @click="selectType(1)">试卷归类</view>
-				<view class="item" :class="{active:type == 2}" @click="selectType(2)">题型归类</view>
-			</view>
-			<view class="wrongHead">
-				<view class="title">错题统计<text class="sub">(不含简答和案例题)</text></view>
-				<view class="progress">
-					<text>{{total}}</text>
-				</view>
-			</view> 
-			<view class="wrongList" v-if="type == 1">
-				<view class="item" v-for="(item,index) in testList.rows" :key="index">
-					<view class="title">{{item.examName}}</view>
-					<view class="bt">
-						<view class="left">错题数<text class="num">{{item.wrongQuestionNum}}</text></view>
-						<view class="right">
-							<navigator  hover-class="none" :url="'/pages2/subject/wrongBank?examId='+item.examId">
-								<view class="btn">重做</view>
-							</navigator>
-							<navigator  hover-class="none" :url="'/pages2/subject/wrongBank?examId='+item.examId+'&explain=1'">
-								<view class="btn">解析</view>
-							</navigator>
-							<!-- <view class="btn">解析</view> -->
-						</view>
-					</view>
-				</view>
-			</view>
-			
-			<view class="wrongList" v-if="type == 2">
-				<view class="item" v-for="(item,index) in typeList.rows" :key="index">
-					<view class="title">
-						<text v-if="item.type==1">单选题</text>
-						<text v-if="item.type==2">多选题</text>
-						<text v-if="item.type==3">判断题</text>
-						<text v-if="item.type==4">案例题</text>
-						<text v-if="item.type==5">简答题</text>
-					</view>
-					<view class="bt">
-						<view class="left">错题数<text class="num">{{item.num}}</text></view>
-						<view class="right">
-							<navigator  hover-class="none" :url="'/pages2/subject/wrongTypeBank?type='+item.type">
-								<view class="btn">重做</view>
-							</navigator>
-							<navigator  hover-class="none" :url="'/pages2/subject/wrongTypeBank?type='+item.type+'&explain=1'">
-								<view class="btn">解析</view>
-							</navigator>
-						</view>
-					</view>
-				</view>
-			</view>
-		</view>
-	</view>
+  <view class="safeArea">
+    <nav-bar title="错题集" class="nav"></nav-bar>
+    <view class="sceenBox" v-if="!isOther">
+      <view :class="['item', { active: sceenType === 1 }]" @click="showSceen(1)"
+        >全部题库记录<u-icon
+          class="icon"
+          :class="sceenType === 1 ? 'animals' : ''"
+          name="arrow-down"
+        ></u-icon
+      ></view>
+      <view :class="['item', { active: sceenType === 2 }]" @click="showSceen(2)"
+        >全部试卷类型<u-icon
+          class="icon"
+          :class="sceenType === 2 ? 'animals' : ''"
+          name="arrow-down"
+        ></u-icon
+      ></view>
+    </view>
+    <view class="sceenModel" v-if="sceenType">
+      <view class="sceenModelBg" @click="hideSceen"></view>
+      <view class="sceenMain">
+        <scroll-view scroll-y="true" style="height: 100%">
+          <view class="sceenMainContent">
+            <template v-if="sceenType === 1">
+              <view
+                :class="['item', { active: item.checked }]"
+                v-for="(item, index) in scennList1"
+                :key="index"
+                @click="choseRecord(index)"
+                >{{ item.goodsName }}</view
+              >
+            </template>
+            <template v-if="sceenType === 2">
+              <view
+                :class="['item', { active: item.checked }]"
+                v-for="(item, index) in scennList2"
+                :key="index"
+                @click="choseType(index)"
+                >{{ item.paperName }}</view
+              >
+            </template>
+          </view>
+        </scroll-view>
+      </view>
+    </view>
+    <view :class="isOther ? 'wrap1' : 'wrap'">
+      <view class="wrongTab" v-if="!isOther">
+        <view class="item" :class="{ active: type == 1 }" @click="selectType(1)"
+          >试卷归类</view
+        >
+        <view class="item" :class="{ active: type == 2 }" @click="selectType(2)"
+          >题型归类</view
+        >
+      </view>
+      <view class="wrongHead">
+        <view class="title"
+          >错题统计<text class="sub">(不含简答和案例题)</text></view
+        >
+        <view class="progress">
+          <text>{{ total }}</text>
+        </view>
+      </view>
+      <view class="wrongList" v-if="type == 1">
+        <view class="item" v-for="(item, index) in testList.rows" :key="index">
+          <view class="title">{{ item.examName }}</view>
+          <view class="bt">
+            <view class="left"
+              >错题数<text class="num">{{ item.wrongQuestionNum }}</text></view
+            >
+            <view class="right">
+              <navigator
+                hover-class="none"
+                :url="'/pages2/subject/wrongBank?examId=' + item.examId"
+              >
+                <view class="btn">重做</view>
+              </navigator>
+              <navigator
+                hover-class="none"
+                :url="
+                  '/pages2/subject/wrongBank?examId=' +
+                  item.examId +
+                  '&explain=1'
+                "
+              >
+                <view class="btn">解析</view>
+              </navigator>
+              <!-- <view class="btn">解析</view> -->
+            </view>
+          </view>
+        </view>
+      </view>
+
+      <view class="wrongList" v-if="type == 2">
+        <view class="item" v-for="(item, index) in typeList.rows" :key="index">
+          <view class="title">
+            <text v-if="item.type == 1">单选题</text>
+            <text v-if="item.type == 2">多选题</text>
+            <text v-if="item.type == 3">判断题</text>
+            <text v-if="item.type == 4">案例题</text>
+            <text v-if="item.type == 5">简答题</text>
+          </view>
+          <view class="bt">
+            <view class="left"
+              >错题数<text class="num">{{ item.num }}</text></view
+            >
+            <view class="right">
+              <navigator
+                hover-class="none"
+                :url="'/pages2/subject/wrongTypeBank?type=' + item.type"
+              >
+                <view class="btn">重做</view>
+              </navigator>
+              <navigator
+                hover-class="none"
+                :url="
+                  '/pages2/subject/wrongTypeBank?type=' +
+                  item.type +
+                  '&explain=1'
+                "
+              >
+                <view class="btn">解析</view>
+              </navigator>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-import { mapGetters } from 'vuex';
+import { mapGetters } from "vuex";
 export default {
-	components: {},
-	data() {
-		return {
-			sceenType: null,
-			scennList1:[
-				{goodsId: '', goodsName: '全部题库记录', checked: true}
-			],
-			scennList2:[
-				{paperId: '', paperName: '全部试卷类型', checked: true}
-			],
-			type:1,
-			testList:[],
-			typeList:[],
-			goodsid:'',
-			paperid:'',
-			total:0,
-			orderGoodsId:'',
-			modalTop:0,
-		};
-	},
-	onPullDownRefresh() {},
-	onShow() {
-		this.getData();
-	},
-	onLoad(option) {
-		this.orderGoodsId = option.orderGoodsId || ''
-		this.listGoodsUserQuestion();
-		this.examaperList();
-		
-		uni.getSystemInfo({
-			success:(e) => {
-				let info = uni.createSelectorQuery().select(".nav");
-				info.boundingClientRect((navData) => { //data - 各种参数
-				
-					let info = uni.createSelectorQuery().select(".sceenBox");
-					info.boundingClientRect((tabData) => { //data - 各种参数
-						this.modalTop = navData.height + tabData.height
-						console.log(navData) // 获取元素宽度
-						console.log(tabData) // 获取元素宽度
-					}).exec()
-				}).exec()
-			}
-		})
-	},
-	methods: {
-		getData() {
-			if(this.type == 1) {
-				this.wrongRecordList()
-			} else if(this.type == 2) {
-				this.wrongRecordTypeList();
-			}
-		},
-		examaperList() {
-			this.$api.examaperList({
-				
-			}).then(res => {
-				this.scennList2 = [...this.scennList2,...res.data.rows];
-			})
-		},
-		
-		listGoodsUserQuestion() {
-			this.$api.listGoodsUserQuestion({
-				
-			}).then(res => {
-				this.scennList1 = [...this.scennList1,...res.data.rows];
-			})
-		},
-		wrongRecordList() {
-			this.$api.wrongRecordList({
-				paperId:this.paperid,
-				goodsId:this.goodsid,
-				orderGoodsId:this.orderGoodsId
-			}).then(res => {
-				this.testList = res.data;
-				let total = 0;
-				this.testList.rows.forEach(item => {
-					total += item.wrongQuestionNum;
-				})
-				
-				this.total = total
-			})
-		},
-		wrongRecordTypeList() {
-			this.$api.wrongRecordTypeList({
-				paperId:this.paperid,
-				orderGoodsId:this.orderGoodsId
-			}).then(res => {
-				this.typeList = res.data;
-				
-				let total = 0;
-				this.typeList.rows.forEach(item => {
-					total += item.num;
-				})
-				
-				this.total = total
-			})
-		},
-		selectType(type) {
-			this.type = type;
-			this.getData();
-		},
-		showSceen(type){
-			if(this.sceenType == type) {
-				this.sceenType = null
-				return;
-			}
-			this.sceenType = type
-		},
-		hideSceen(){
-			this.sceenType = null
-		},
-		choseRecord(index) {
-			this.sceenType = null
-			this.scennList1.forEach((item,idx)=>{
-				this.$set(item, 'checked',false)
-				if(index==idx){
-					this.goodsid = item.goodsId
-					this.$set(item, 'checked',true)
-				}
-			})
-			
-			this.getData()
-		},
-		choseType(index) {
-			this.sceenType = null
-			this.scennList2.forEach((item,idx)=>{
-				this.$set(item, 'checked',false)
-				if(index==idx){
-					this.paperid = item.paperId
-					this.$set(item, 'checked',true)
-				}
-			})
-			this.getData()
-		},
-	}
+  components: {},
+  data() {
+    return {
+      sceenType: null,
+      scennList1: [{ goodsId: "", goodsName: "全部题库记录", checked: true }],
+      scennList2: [{ paperId: "", paperName: "全部试卷类型", checked: true }],
+      type: 1,
+      testList: [],
+      typeList: [],
+      goodsid: "",
+      paperid: "",
+      total: 0,
+      orderGoodsId: "",
+      isOther: 0,
+    };
+  },
+  onPullDownRefresh() {},
+  onShow() {
+    this.getData();
+  },
+  onLoad(option) {
+    this.orderGoodsId = option.orderGoodsId || "";
+    this.isOther = option.isOther;
+    if (!this.isOther) {
+      this.listGoodsUserQuestion();
+      this.examaperList();
+    }
+  },
+  methods: {
+    getData() {
+      if (this.type == 1) {
+        this.wrongRecordList();
+      } else if (this.type == 2) {
+        this.wrongRecordTypeList();
+      }
+    },
+    examaperList() {
+      this.$api.examaperList({}).then((res) => {
+        this.scennList2 = [...this.scennList2, ...res.data.rows];
+      });
+    },
+
+    listGoodsUserQuestion() {
+      this.$api.listGoodsUserQuestion({}).then((res) => {
+        this.scennList1 = [...this.scennList1, ...res.data.rows];
+      });
+    },
+    wrongRecordList() {
+      this.$api
+        .wrongRecordList({
+          paperId: this.paperid,
+          goodsId: this.goodsid,
+          orderGoodsId: this.orderGoodsId,
+          ...this.doMode,
+        })
+        .then((res) => {
+          this.testList = res.data;
+          let total = 0;
+          this.testList.rows.forEach((item) => {
+            total += item.wrongQuestionNum;
+          });
+
+          this.total = total;
+        });
+    },
+    wrongRecordTypeList() {
+      this.$api
+        .wrongRecordTypeList({
+          paperId: this.paperid,
+          orderGoodsId: this.orderGoodsId,
+        })
+        .then((res) => {
+          this.typeList = res.data;
+
+          let total = 0;
+          this.typeList.rows.forEach((item) => {
+            total += item.num;
+          });
+
+          this.total = total;
+        });
+    },
+    selectType(type) {
+      this.type = type;
+      this.getData();
+    },
+    showSceen(type) {
+      if (this.sceenType == type) {
+        this.sceenType = null;
+        return;
+      }
+      this.sceenType = type;
+    },
+    hideSceen() {
+      this.sceenType = null;
+    },
+    choseRecord(index) {
+      this.sceenType = null;
+      this.scennList1.forEach((item, idx) => {
+        this.$set(item, "checked", false);
+        if (index == idx) {
+          this.goodsid = item.goodsId;
+          this.$set(item, "checked", true);
+        }
+      });
+
+      this.getData();
+    },
+    choseType(index) {
+      this.sceenType = null;
+      this.scennList2.forEach((item, idx) => {
+        this.$set(item, "checked", false);
+        if (index == idx) {
+          this.paperid = item.paperId;
+          this.$set(item, "checked", true);
+        }
+      });
+      this.getData();
+    },
+  },
+  computed: {
+    doMode() {
+      return this.isOther ? { doMode: 4 } : {};
+    },
+  },
 };
 </script>
 <style lang="scss">
 page {
-	background: #EAEEF1;
+  background: #eaeef1;
 }
-
 </style>
 <style scoped lang="scss">
-	.animals{
-		transition: all 0.3s;
-		transform: rotate(180deg);
-	}
+.animals {
+  transition: all 0.3s;
+  transform: rotate(180deg);
+}
 .sceenBox {
-	width:100%;
-	height: 80rpx;
-	background: #FFFFFF;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	font-size: 32rpx;
-	font-family: PingFang SC;
-	font-weight: 500;
-	color: #999999;
-	position: fixed;
-	z-index: 999;
-	border-bottom: 1px solid #eee;
-	.item{
-		flex:1;
-		text-align: center;
-		&.active{
-			color:#333;
-			font-weight: bold;
-			.icon{
-				transform: rotate(180deg);
-			}
-		}
-	}
+  width: 100%;
+  height: 80rpx;
+  background: #ffffff;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  font-size: 32rpx;
+  font-family: PingFang SC;
+  font-weight: 500;
+  color: #999999;
+  position: fixed;
+  z-index: 999;
+  border-bottom: 1px solid #eee;
+  .item {
+    flex: 1;
+    text-align: center;
+    &.active {
+      color: #333;
+      font-weight: bold;
+      .icon {
+        transform: rotate(180deg);
+      }
+    }
+  }
+}
+.sceenModel {
+  left: 0;
+  bottom: 0;
+  width: 100%;
+  position: fixed;
+  z-index: 998;
+  .sceenModelBg {
+    width: 100%;
+    height: 100%;
+    position: fixed;
+    background: rgba(0, 0, 0, 0.3);
+    z-index: 998;
+  }
+  .sceenMain {
+    position: relative;
+    z-index: 999;
+    background: #fff;
+    height: 80%;
+    .sceenMainContent {
+      display: flex;
+      flex-wrap: wrap;
+      padding: 8rpx;
+      justify-content: space-between;
+      .item {
+        width: 350rpx;
+        background: #f5f5f5;
+        border-radius: 16rpx;
+        padding: 25rpx 19rpx;
+        margin: 8rpx;
+        font-size: 32rpx;
+        font-family: PingFang SC;
+        font-weight: bold;
+        color: #666666;
+        &.active {
+          background: #007aff;
+          color: #fff;
+        }
+        &:first-child {
+          width: 100%;
+          text-align: center;
+        }
+      }
+    }
+  }
 }
-.sceenModel{
-	left:0;
-	bottom:0;
-	width:100%;
-	position: fixed;
-	z-index: 998;
-	.sceenModelBg{
-		width:100%;
-		height:100%;
-		position: fixed;
-		background: rgba(0,0,0,.3);
-		z-index: 998;
-	}
-	.sceenMain{
-		position: relative;
-		z-index: 999;
-		background: #fff;
-		height:80%;
-		.sceenMainContent {
-			
-			display: flex;
-			flex-wrap: wrap;
-			padding: 8rpx;
-			justify-content: space-between;
-				.item{
-					width: 350rpx;
-					background: #F5F5F5;
-					border-radius: 16rpx;
-					padding: 25rpx 19rpx;
-					margin: 8rpx;
-					font-size: 32rpx;
-					font-family: PingFang SC;
-					font-weight: bold;
-					color: #666666;
-					&.active{
-						background: #007AFF;
-						color:#fff;
-					}
-					&:first-child{
-						width:100%;
-						text-align: center;
-					}
-				}
-		}		
-	}
+.wrap {
+  padding: 96rpx 16rpx 16rpx;
 }
-.wrap{
-	padding:96rpx 16rpx 16rpx;
+.wrap1 {
+  padding: 16rpx;
 }
-.wrongHead{
-	background: #FFFFFF;
-	border-radius: 16px;
-	padding:24rpx;
-	.title{
-		font-size: 30rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #333333;
-		.sub{
-			font-size: 20rpx;
-			font-weight: 500;
-			color: #999999;
-		}
-	}
-	.progress{
-		width: 180rpx;
-		height: 180rpx;
-		line-height: 140rpx;
-		border: 20rpx solid #EEEEEE;
-		border-radius: 50%;
-		margin: 24rpx auto;
-		font-size: 50rpx;
-		text-align: center;
-	}
+.wrongHead {
+  background: #ffffff;
+  border-radius: 16px;
+  padding: 24rpx;
+  .title {
+    font-size: 30rpx;
+    font-family: PingFang SC;
+    font-weight: bold;
+    color: #333333;
+    .sub {
+      font-size: 20rpx;
+      font-weight: 500;
+      color: #999999;
+    }
+  }
+  .progress {
+    width: 180rpx;
+    height: 180rpx;
+    line-height: 140rpx;
+    border: 20rpx solid #eeeeee;
+    border-radius: 50%;
+    margin: 24rpx auto;
+    font-size: 50rpx;
+    text-align: center;
+  }
 }
-.wrongTab{
-	display: flex;
-	margin: 24rpx 0;
-	.item{
-		width: 144rpx;
-		height: 48rpx;
-		line-height: 48rpx;
-		text-align: center;
-		background: #fff;
-		border-radius: 16px;
-		font-size: 28rpx;
-		font-family: PingFang SC;
-		font-weight: 500;
-		color: #666666;
-		margin-left: 15rpx;
-		&.active{
-			background: #007AFF;
-			color: #fff;
-		}
-	}
+.wrongTab {
+  display: flex;
+  margin: 24rpx 0;
+  .item {
+    width: 144rpx;
+    height: 48rpx;
+    line-height: 48rpx;
+    text-align: center;
+    background: #fff;
+    border-radius: 16px;
+    font-size: 28rpx;
+    font-family: PingFang SC;
+    font-weight: 500;
+    color: #666666;
+    margin-left: 15rpx;
+    &.active {
+      background: #007aff;
+      color: #fff;
+    }
+  }
 }
-.wrongList{
-	margin-top:20rpx;
-	.item{
-		background: #FFFFFF;
-		border-radius: 16rpx;
-		padding: 0 30rpx;
-		margin-bottom: 16rpx;
-		overflow: hidden;
-		.title{
-			font-size: 32rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			color: #333333;
-			margin: 40rpx 0 17rpx;
-		}
-		.bt{
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			padding-bottom: 24rpx;
-			.left{
-				width: 176rpx;
-				height: 40rpx;
-				background: #FFFFFF;
-				border: 1px solid #EEEEEE;
-				border-radius: 16rpx;
-				font-size: 26rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #999999;
-				display: flex;
-				justify-content: center;
-				align-items: center;
-				.num{
-					font-size: 26rpx;
-					font-weight: bold;
-					color: #FF3B30;
-					margin-left: 16rpx;
-				}
-			}
-			.right{
-				display: flex;
-				.btn{
-					width: 100rpx;
-					height: 48rpx;
-					background: #FFFFFF;
-					border: 1px solid #007AFF;
-					border-radius: 16px;
-					font-size: 24rpx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					color: #007AFF;
-					margin-left:9rpx;
-					display: flex;
-					align-items: center;
-					justify-content: center;
-				}
-			}
-		}
-	}
+.wrongList {
+  margin-top: 20rpx;
+  .item {
+    background: #ffffff;
+    border-radius: 16rpx;
+    padding: 0 30rpx;
+    margin-bottom: 16rpx;
+    overflow: hidden;
+    .title {
+      font-size: 32rpx;
+      font-family: PingFang SC;
+      font-weight: bold;
+      color: #333333;
+      margin: 40rpx 0 17rpx;
+    }
+    .bt {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      padding-bottom: 24rpx;
+      .left {
+        width: 176rpx;
+        height: 40rpx;
+        background: #ffffff;
+        border: 1px solid #eeeeee;
+        border-radius: 16rpx;
+        font-size: 26rpx;
+        font-family: PingFang SC;
+        font-weight: 500;
+        color: #999999;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        .num {
+          font-size: 26rpx;
+          font-weight: bold;
+          color: #ff3b30;
+          margin-left: 16rpx;
+        }
+      }
+      .right {
+        display: flex;
+        .btn {
+          width: 100rpx;
+          height: 48rpx;
+          background: #ffffff;
+          border: 1px solid #007aff;
+          border-radius: 16px;
+          font-size: 24rpx;
+          font-family: PingFang SC;
+          font-weight: 500;
+          color: #007aff;
+          margin-left: 9rpx;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+      }
+    }
+  }
 }
 </style>

+ 58 - 0
utils/authority.js

@@ -0,0 +1,58 @@
+import store from "@/store/index.js";
+import api from "@/common/api.js";
+import { getQueryString } from "../common/navTo";
+export function getCode() {
+  return new Promise((resolve, reject) => {
+    // #ifdef H5
+    if (location.search.includes("code")) {
+      const code = getQueryString("code");
+      uni.setStorageSync("h5_code", code);
+      resolve(code);
+    } else {
+      // 没有code,就重定向到地址https://www.xyyxt.net?ask_type=https://api.xyyxt.net/pages2/order/confirm_pay 去获取code,授权后就会把code带上然后访问域名
+      // ?fromCart=&code=061F5a1w3aolh03SLe1w3sMsCF4F5a16&state=STATE
+      if (process.env.NODE_ENV !== "development") {
+        const url = window.location.host + "/pages2/order/confirm_pay";
+        // 跳自己授权
+        if (store.getters.config.gzhSelfLicense) {
+          api.getWxConfig().then((res) => {
+            location.replace(
+              `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${
+                res.data.data.gzhAppId
+              }&redirect_uri=${encodeURIComponent(
+                "https://" + url
+              )}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
+            );
+          });
+        } else {
+          location.replace("https://www.xyyxt.net/?ask_type=" + url);
+        }
+      }
+    }
+    // #endif
+    // #ifdef MP-WEIXIN
+    uni.login({
+      provider: "weixin",
+      success: (loginRes) => {
+        uni.setStorageSync("wx_code", loginRes.code);
+        resolve(loginRes.code);
+      },
+    });
+    // #endif
+  });
+}
+
+export function codeGetOpenid(code) {
+  return new Promise((resolve, reject) => {
+    // #ifdef H5
+    api.getH5Openid(code).then((res) => {
+      console.log("🚀 ~ file: authority.js:48 ~ codeGetOpenid ~ res:", res);
+    });
+    // #endif
+    // #ifdef MP-WEIXIN
+    api.getWxOpenid(code).then((res) => {
+      console.log("🚀 ~ file: authority.js:48 ~ codeGetOpenid ~ res:", res);
+    });
+    // #endif
+  });
+}