| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932 | <template>  <view>    <nav-logo title="选课中心"></nav-logo>    <view v-show="!show">      <view style="position: fixed; width: 100%; z-index: 999">        <view class="check_ck">          <view style="display: flex; align-items: center">            <view style="margin: 0 auto">              <u-tabs                :list="courseLists"                height="70"                :current="current"                @change="change"                :scrollable="false"                font-size="32"              ></u-tabs>            </view>          </view>          <view class="check_search u-flex">            <view class="check_level u-flex" @click="openLeft()">              <view class="u-line-1">{{ selectName }}</view>              <u-icon name="arrow-down-fill" color="#333333" size="20"> </u-icon            ></view>            <view class="line">|</view>            <view class="check_search_input u-flex">              <!-- <img src="../../static/icon/icon-search.png" /> -->              <u-icon name="search" color="#333333" size="28"> </u-icon>              <u-input                style="padding-left: 10rpx"                v-model="goodsName"                type="text"                placeholder="搜索"                @blur="blurSearch"                :auto-blur="true"                confirm-type="search"                :clearable="false"              />            </view>          </view>          <view class="menuSel" v-show="current == 0">            <scroll-view class="r_sliper" scroll-x="true">              <view                v-for="(item, index) in sList"                :key="index"                style="margin-right: 20rpx; display: inline-block"              >                <view                  :class="paramList[0].subjectId == item.id ? 'r_t1' : 'r_t2'"                  @click="cMenu(item.id)"                >                  {{ item.subjectName }}                </view>              </view>            </scroll-view>          </view>          <view class="menuSel" v-show="current == 1">            <scroll-view class="r_sliper" scroll-x="true">              <view                v-for="(item, index) in sList"                :key="index"                style="margin-right: 20rpx; display: inline-block"              >                <view                  :class="paramList[1].subjectId == item.id ? 'r_t1' : 'r_t2'"                  @click="cMenu1(item.id)"                >                  {{ item.subjectName }}                </view>              </view>            </scroll-view>          </view>          <view class="menuSel" v-show="current == 2">            <scroll-view class="r_sliper" scroll-x="true">              <view                v-for="(item, index) in sList"                :key="index"                style="margin-right: 20rpx; display: inline-block"              >                <view                  :class="paramList[2].subjectId == item.id ? 'r_t1' : 'r_t2'"                  @click="cMenu2(item.id)"                >                  {{ item.subjectName }}                </view>              </view>            </scroll-view>          </view>        </view>      </view>      <view v-show="current == 0" class="contents">        <view class="listBox">          <navigator            hover-class="none"            :url="              '/pages3/course/detail?id=' +              item.goodsId +              '&goodsType=' +              item.goodsType            "            v-for="(item, index) in list1"            :key="index"          >            <view class="itemBox">              <image                :src="$method.splitImgHost(item.coverUrl)"                style="height: 367rpx; width: 100%; border-radius: 24rpx"              ></image>              <view                style="display: flex; margin-top: 13rpx; align-items: center"              >                <view class="yearTag" v-if="item.year">{{ item.year }}</view>                <view class="titleTag">{{ item.goodsName }}</view>              </view>              <view                style="                  display: flex;                  justify-content: space-between;                  margin-top: 15rpx;                "              >                <view class="noteTag"                  ><image                    src="/static/icon/wk_icon1.png"                    class="wk_icon"                  ></image>                  共 <text class="blackFont">{{ item.courseNum }}</text>                  <text class="margin30">课程</text>                  <text class="blackFont">{{ item.classHours || "-" }}</text>                  学时</view                >                <view>                  <view                    class="priceTag"                    v-if="                      !item.specTemplateId || (!item.maxPrice && !item.minPrice)                    "                  >                    {{                      item.standPrice === 0 ? "免费" : `¥${item.standPrice}`                    }}                  </view>                  <!-- 范围价格 -->                  <view v-else class="priceTag">                    <view>{{ item.minPrice }}</view>                    <template v-if="item.minPrice != item.maxPrice">                      <text>-</text>                      <view>{{ item.maxPrice }}</view>                    </template>                  </view>                  <text v-if="item.linePrice" class="sale">¥ </text>                  <text v-if="item.linePrice" class="price_line">                    {{ item.linePrice }}</text                  >                </view>              </view>            </view>          </navigator>          <view class="emptyTip" v-if="list1.length == 0"            >暂未上架相关网课~</view          >        </view>      </view>      <view v-show="current == 1" class="contents">        <view class="listBox">          <navigator            hover-class="none"            :url="'/pages2/bank/detail?id=' + item.goodsId"            v-for="(item, index) in list2"            :key="index"          >            <view class="itemBox">              <image                :src="$method.splitImgHost(item.coverUrl)"                style="height: 367rpx; width: 100%; border-radius: 24rpx"              ></image>              <view                style="display: flex; margin-top: 13rpx; align-items: center"              >                <view class="yearTag" v-if="item.year">{{ item.year }}</view>                <view                  class="titleTag"                  style="display: flex; justify-content: space-between; flex: 1"                >                  <view style="flex: 1">{{ item.goodsName }}</view>                  <view>                    <view                      class="priceTag"                      v-if="                        !item.specTemplateId ||                        (!item.maxPrice && !item.minPrice)                      "                    >                      {{                        item.standPrice === 0 ? "免费" : `¥${item.standPrice}`                      }}                    </view>                    <!-- 范围价格 -->                    <view v-else class="priceTag">                      <view>{{ item.minPrice }}</view>                      <template v-if="item.minPrice != item.maxPrice">                        <text>-</text>                        <view>{{ item.maxPrice }}</view>                      </template>                    </view>                    <text v-if="item.linePrice" class="sale">¥ </text>                    <text v-if="item.linePrice" class="price_line">                      {{ item.linePrice }}</text                    >                  </view>                </view>              </view>              <view                style="                  display: flex;                  justify-content: space-between;                  margin-top: 15rpx;                "                v-if="false"              >                <view class="noteTag"                  ><image                    src="/static/icon/wk_icon1.png"                    class="wk_icon"                  ></image>                  共 <text class="blackFont">6</text>                  <view class="margin30">张卷</view>                  <text class="blackFont">120</text>道题                </view>                <view>                  <view                    class="priceTag"                    v-if="                      !item.specTemplateId || (!item.maxPrice && !item.minPrice)                    "                  >                    {{                      item.standPrice === 0 ? "免费" : `¥${item.standPrice}`                    }}                  </view>                  <!-- 范围价格 -->                  <view v-else class="priceTag">                    <view>{{ item.minPrice }}</view>                    <template v-if="item.minPrice != item.maxPrice">                      <text>-</text>                      <view>{{ item.maxPrice }}</view>                    </template>                  </view>                  <text v-if="item.linePrice" class="sale">¥ </text>                  <text v-if="item.linePrice" class="price_line">                    {{ item.linePrice }}</text                  >                </view>              </view>            </view>          </navigator>          <view class="emptyTip" v-if="list2.length == 0"            >暂未上架相关题库~</view          >        </view>      </view>      <view v-show="current == 2" class="contents">        <view class="listBox">          <!-- /pages5/liveDetail/index -->          <navigator            hover-class="none"            :url="              '/pages3/course/detail?id=' +              item.goodsId +              '&goodsType=' +              item.goodsType            "            v-for="(item, index) in list3"            :key="index"          >            <view class="itemBox">              <image                :src="$method.splitImgHost(item.coverUrl)"                style="height: 367rpx; width: 100%; border-radius: 24rpx"              ></image>              <view                style="display: flex; margin-top: 13rpx; align-items: center"              >                <view class="yearTag" v-if="item.year">{{ item.year }}</view>                <view                  class="titleTag"                  style="display: flex; justify-content: space-between; flex: 1"                >                  <view style="flex: 1">{{ item.goodsName }}</view>                  <view>                    <view                      class="priceTag"                      v-if="                        !item.specTemplateId ||                        (!item.maxPrice && !item.minPrice)                      "                    >                      {{                        item.standPrice === 0 ? "免费" : `¥${item.standPrice}`                      }}                    </view>                    <!-- 范围价格 -->                    <view v-else class="priceTag">                      <view>{{ item.minPrice }}</view>                      <template v-if="item.minPrice != item.maxPrice">                        <text>-</text>                        <view>{{ item.maxPrice }}</view>                      </template>                    </view>                    <text v-if="item.linePrice" class="sale">¥ </text>                    <text v-if="item.linePrice" class="price_line">                      {{ item.linePrice }}</text                    >                  </view>                </view>              </view>              <!-- <view style="display: flex;justify-content: space-between;margin-top: 15rpx;" v-if="false">								<view class="noteTag">									<image src="/static/icon/wk_icon1.png" class="wk_icon"></image>									<view>										<text v-if="item.standPrice" class="priceTag">¥ {{item.standPrice.toFixed(2)}}</text>										<text v-else class="priceTag free">免费</text>										<view class="priceTag">¥ {{item.standPrice.toFixed(2)}}</view>										<text class="sale"> ¥ </text>										<text class="price_line"> {{ item.linePrice }}</text>									</view>																	</view>							</view> -->            </view>          </navigator>          <view class="emptyTip" v-if="list3.length == 0"            >暂未上架相关直播~</view          >        </view>      </view>    </view>    <u-popup      v-model="show"      mode="bottom"      border-radius="32"      :mask-close-able="false"      :closeable="!!selObj.bId"    >      <view class="popuBox">        <view class="popuBox-title">选择分类</view>        <view class="flex-d">          <view class="contentZ">            <view class="lzs">              <view                class="tylsz u-flex"                v-for="(item, index) in eList"                :key="index"                @click="active1(item)"                :class="item.id === selObj.eId ? 'activeStys' : 'b-l-eee'"                ><view style="padding-left: 30rpx">{{                  item.educationName                }}</view></view              >            </view>            <view class="rzs">              <view                class="tylszB"                v-for="(item, index) in bList"                :key="index"                @click="active2(item)"                :class="item.id === selObj.bId ? 'activeStys2' : ''"                >{{ item.aliasName }}</view              >            </view>          </view>        </view>      </view>    </u-popup>    <!-- tabbar -->    <myTabbar></myTabbar>  </view></template><script>import { mapGetters } from "vuex";export default {  data() {    return {      show: false,      courseLists: [        {          name: "网课",        },        {          name: "题库通",        },        {          name: "直播课",        },      ],      // array:['全部','建设工程施工管理','机电全科','机电工程管理与实','机电全科','全科'],      current: 0,      menuIndex: 0,      menuIndex1: 0,      paramList: [        {          pageNum: 1,          pageSize: 10,          total: 0,          showStatus: 1,          goodsType: 1,          subjectId: 0,          sortType: 1,        },        {          pageNum: 1,          pageSize: 10,          total: 0,          showStatus: 1,          goodsType: 2,          subjectId: 0,          sortType: 1,        },        {          pageNum: 1,          pageSize: 10,          total: 0,          showStatus: 1,          goodsType: 6,          subjectId: 0,          sortType: 1,        },      ],      goodsName: "",      preGoodsName: "",      list1: [],      list2: [],      list3: [],      eList: [],      bList: [],      sList: [],      selObj: {        eId: 0,        bId: 0,        pId: 0,      },      imgwidth: 0,      imgheight: 0,    };  },  onPullDownRefresh() {    this.initList();    setTimeout(function () {      uni.stopPullDownRefresh();    }, 500);  },  onLoad(option) {    uni.hideTabBar()    let eduStr = null;    // 小程序分享跳转    if (option.scene) {      let arrs = decodeURIComponent(option.scene).split("&");      for (let i = 0; i < arrs.length; i++) {        option[arrs[i].split("=")[0]] = arrs[i].split("=")[1]*1;      }    }    // 默认值    let { bid, pid, eid, cur } = option;    if (bid && pid && eid) {      uni.setStorageSync(        "eduObj",        JSON.stringify({          bId: bid * 1,          pId: pid * 1,          eId: eid * 1,        })      );    }    cur && (this.current = cur);    eduStr = uni.getStorageSync("eduObj");    if (eduStr) {      this.selObj = JSON.parse(eduStr);      this.subjectList({        businessId: this.selObj.bId,        projectId: this.selObj.pId,        educationId: this.selObj.eId,      });      this.mergeBusiness();    } else {      this.show = true;    }    this.initList();  },  methods: {    blurSearch() {      this.preGoodsName != this.goodsName && this.initList();    },    mergeBusiness() {      this.paramList[0].educationTypeId = this.selObj.eId;      this.paramList[0].businessId = this.selObj.bId;      this.paramList[0].subjectId = 0;      this.paramList[1].educationTypeId = this.selObj.eId;      this.paramList[1].businessId = this.selObj.bId;      this.paramList[1].subjectId = 0;      this.paramList[2].educationTypeId = this.selObj.eId;      this.paramList[2].businessId = this.selObj.bId;      this.paramList[2].subjectId = 0;    },    subjectList(data) {      var self = this;      // /app/common/course/subject/list      this.$api.subjectList(data).then((res) => {        if (res.data.code == 200) {          self.sList = res.data.rows;          let allItem = { id: 0, subjectName: "全部" };          self.sList.unshift(allItem);        }      });    },    active2(item) {      // console.log('item', item)      if (item.topicId) {        uni.navigateTo({          url: "/pages4/courseTopic/goodsTopic?topicId=" + item.topicId,        });        return;      }      this.selObj.bId = item.id;      this.show = false;      this.selObj.pId = item.projectId;      uni.setStorageSync("eduObj", JSON.stringify(this.selObj));      this.subjectList({        businessId: item.id,        projectId: item.projectId,        educationId: this.selObj.eId,      });      this.mergeBusiness();      //初始化      this.initList();    },    businessList(data) {      var self = this;      // /app/common/course/business/list      this.$api.businessList(data).then((res) => {        if (res.data.code == 200) {          self.bList = res.data.rows;        }      });    },    active1(item) {      this.selObj.eId = item.id;      this.businessList({ educationId: item.id });    },    educationList() {      var self = this;      // /app/common/course/educationType/list      this.$api.educationTypeList().then((res) => {        if (res.data.code == 200) {          self.eList = res.data.rows;          if (self.selObj.eId) {            self.businessList({ educationId: self.selObj.eId });          } else {            this.active1(self.eList[0]);          }        }      });    },    openLeft() {      this.show = true;    },    initList() {      this.paramList[0].pageNum = 1;      this.paramList[1].pageNum = 1;      this.list1 = [];      this.list2 = [];      this.list3 = [];      this.preGoodsName = this.goodsName;      this.courseList();      this.bankList();      this.liveList();      this.educationList();    },    cMenu(index) {      this.paramList[0].pageNum = 1;      this.paramList[0].subjectId = index;      this.list1 = [];      //	this.menuIndex      this.courseList();    },    cMenu1(index) {      this.paramList[1].pageNum = 1;      this.paramList[1].subjectId = index;      this.list2 = [];      //	this.menuIndex1 = index;      this.bankList();    },    cMenu2(index) {      this.paramList[2].pageNum = 1;      this.paramList[2].subjectId = index;      this.list3 = [];      //	this.menuIndex1 = index;      this.liveList();    },    change(index) {      this.current = index;    },    //课程    courseList() {      var self = this;      var param = this.paramList[0];      param.goodsName = this.goodsName;      this.$api.goodsList(param).then((res) => {        self.paramList[0].total = res.data.total;        self.list1.push.apply(self.list1, res.data.rows);        // if (self.list1.length === res.data.total) {        // 	self.paramList[0].showStatus = true;        // }      });    },    //题库    bankList() {      var self = this;      var param = this.paramList[1];      param.goodsName = this.goodsName;      this.$api.goodsList(param).then((res) => {        self.paramList[1].total = res.data.total;        self.list2.push.apply(self.list2, res.data.rows);        // if (self.list2.length === res.data.total) {        // 	self.paramList[1].showStatus = true;        // }      });    },    //直播    liveList() {      var self = this;      var param = this.paramList[2];      param.goodsName = this.goodsName;      this.$api.goodsList(param).then((res) => {        self.paramList[2].total = res.data.total;        self.list3.push.apply(self.list3, res.data.rows);        // if (self.list3.length === res.data.total) {        // 	self.paramList[2].showStatus = true;        // }      });    },  },  onReachBottom() {    if (this.current == 0) {      if (this.list1.length < this.paramList[0].total) {        this.paramList[0].pageNum++;        this.courseList();      }    }    if (this.current == 1) {      if (this.list2.length < this.paramList[1].total) {        this.paramList[1].pageNum++;        this.bankList();      }    }  },  computed: {    ...mapGetters(["userInfo", "config"]),    selectName() {      let { eId, bId } = this.selObj;      if (!eId || !bId) {        return "";      }      let eItem = this.eList.find((e) => e.id === eId);      let bItem = this.bList.find((e) => e.id === bId);      return `${eItem ? eItem.educationName : ""}:${        bItem ? bItem.aliasName : ""      }`;    },  },};</script><style>::-webkit-scrollbar {  width: 0;  height: 0;  color: transparent;}page {  background-color: #eaeef1;}</style><style scoped lang="scss">.check_ck {  background: #ffffff;  padding: 0 38rpx 24rpx;  .again_ck {    width: 30%;    display: flex;    align-items: center;    justify-content: space-between;  }  .check_search {    border: 2rpx solid #333333;    border-radius: 100rpx;    margin-top: 32rpx;    padding: 0 28rpx;    height: 72rpx;    .check_level {      font-size: 28rpx;      .u-line-1 {        width: 160rpx;        margin-right: 8rpx;      }    }    .line {      margin: -10rpx 18rpx 0 20rpx;      color: #d9d9d9;    }    .check_search_input {      flex: 1;      img {        width: 36rpx;        height: 36rpx;      }    }  }}.contents {  position: relative;  left: 0;  top: 300rpx;}.emptyTip {  color: #999999;  font-size: 32rpx;  text-align: center;  margin-top: 20%;}.popuBox {  border-radius: 30% !important;  height: 70vh;  width: 100%;  background-color: #ffffff;  .popuBox-title {    border-radius: 30%;    font-weight: bold;    color: #222222;    font-size: 32rpx;    height: 100rpx;    line-height: 100rpx;    text-align: center;  }}.activeStys2 {  color: #007aff;}.tylszB {  margin-bottom: 56rpx;  background: #ffffff;  font-size: 32rpx;  overflow: hidden;  white-space: nowrap;  text-overflow: ellipsis;}.activeStys {  height: 32rpx;  font-weight: bold;  color: #222222 !important;  border-left: 6rpx solid #0080ff;}.b-l-eee {  border-left: 6rpx solid #ffffff;}.tylsz {  color: #666;  font-size: 30rpx;  font-size: 32rpx;  color: #999999;  margin-bottom: 40rpx;  vertical-align: bottom;  white-space: nowrap;}.popup_t1 {  padding-left: 35rpx;  border-bottom: 1rpx solid #eee;  height: 57rpx;  margin-top: 86rpx;  font-weight: bold;  color: #007aff;  font-size: 27rpx;}.flex-d {  background-color: #ffffff;  font-size: 30rpx;}.contentZ {  display: flex;  height: calc(70vh - 100rpx);  .lzs {    width: 208rpx;    height: 100%;    overflow-x: auto;    border-right: 2rpx solid #e8e8e8;  }  .rzs {    margin-left: 32rpx;    flex: 1;    height: 100%;    overflow-x: auto;  }}.contentZ::-webkit-scrollbar {  display: none;}.fots {  height: 100rpx;  display: flex;  align-items: center;  justify-content: space-around;  border-top: 1rpx solid #eee;}.leftBtns {  font-size: 30rpx;  color: #007aff;  font-weight: 500;}.right_Btns {  font-size: 30rpx;  color: #fff;  background-color: #007aff;  border-radius: 24rpx;  height: 60rpx;  line-height: 60rpx;  text-align: center;  padding: 0rpx 23rpx;  box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);}.blackFont {  color: #333333;  margin: 0 10rpx;}.margin30 {  margin: 0 20rpx 0 0;}.wk_icon {  width: 24rpx;  height: 24rpx;  margin-right: 12rpx;}.noteTag {  font-size: 24rpx;  font-family: PingFang SC;  font-weight: 500;  color: #999999;  align-items: center;}.priceTag {  display: flex;  font-size: 32rpx;  font-family: PingFang SC;  font-weight: bold;  color: #fc3f3f;  view::before {    content: "¥";    font-size: 24rpx;    font-weight: bold;  }}.sale {  color: #999999;  font-size: 28rpx;  margin-left: 8rpx;}.price_line {  color: #999999;  font-size: 28rpx;  text-decoration: line-through;  font-weight: 400;}.titleTag {  font-size: 32rpx;  font-weight: bold;  color: #333333;  margin-left: 8rpx;}.yearTag {  width: 80rpx;  height: 32rpx;  background: #ebf5ff;  border: 2rpx solid #007aff;  border-radius: 16rpx;  font-size: 24rpx;  color: #007aff;  text-align: center;  line-height: 32rpx;}.itemBox {  background: #ffffff;  border-radius: 24rpx;  width: 100%;  padding: 23rpx 22rpx 32rpx 22rpx;  margin-bottom: 24rpx;  box-shadow: 0rpx 0rpx 20rpx 1rpx rgba(1, 99, 235, 0.1);}.listBox {  background-color: #eaeef1;  padding: 24rpx 24rpx 120rpx 24rpx;  position: relative;  // top: 235rpx;}.menuSel {  margin-top: 32rpx;  // width: 100%;  // height: 70rpx;  // padding: 30rpx 0rpx;  // background: #eaeef1;  white-space: nowrap;  overflow: hidden;}.r_sliper {  padding: 0 20rpx;}.r_t1 {  background: #f2f7ff;  border-radius: 8rpx;  padding: 9rpx 21rpx;  font-size: 26rpx;  color: #3f8dfd;}.r_t2 {  background: #f7f8fc;  border-radius: 8rpx;  padding: 9rpx 21rpx;  color: #666666;  font-size: 26rpx;}</style>
 |