| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787 |
- <template>
- <view class="s_container">
- <view class="s_content_container" v-if="bShow[0]">
- <view class="s_search">
- <img src="../../assets/home/search.png" class="s_search_img_logo" alt="">
- <input type="text" value="" class="s_search_input" placeholder="请输入搜索内容" />
- <button type="warn" size="mini" class="s_btn_search">搜索</button>
- </view>
-
- <view class="content">
- <view class="top-dispaly-block">
- <view class="top_content" v-for="(item,index) in allContentArr" :key="index">
- <img :src="item.Texture_Url" class="top_image" mode="" @click="viewDetail(index)"></img>
- </view>
- </view>
-
- <view class="s_content_block">
- <view class="s_img_title" v-text="'角色'"></view>
- <view class="s_img_image_block">
- <view class="s_img_content">
- <view class="s_image_block" v-for="(item,index) in charactorArr" :key="index">
- <img :src="item.Texture_Url" class="s_image" mode="" @click="viewDetail0(index)"></img>
- </view>
- </view>
- <img src="../../assets/home/left.png" class="v-left" alt="" @click="more0()">
- </view>
- </view>
-
- <view class="s_content_block">
- <view class="s_img_title" v-text="'场景'"></view>
- <view class="s_img_image_block">
- <view class="s_img_content">
- <view class="s_image_block" v-for="(item,index) in sceneArr" :key="index">
- <img :src="item.Texture_Url" class="s_image" mode="" @click="viewDetail1(index)"></img>
- </view>
- </view>
- <img src="../../assets/home/left.png" class="v-left" alt="" @click="more1()">
- </view>
- </view>
-
- <view class="s_content_block">
- <view class="s_img_title" v-text="'道具'"></view>
- <view class="s_img_image_block">
- <view class="s_img_content">
- <view class="s_image_block" v-for="(item,index) in itemArr" :key="index">
- <img :src="item.Texture_Url" class="s_image" mode="" @click="viewDetail2(index)"></img>
- </view>
- </view>
- <img src="../../assets/home/left.png" class="v-left" alt="" @click="more2()">
- </view>
- </view>
- </view>
- </view>
-
- <view class="detail" v-if="bShow[1]">
- <view class="creator-info-block">
- <view class="firstLine">
- <img src="../../assets/login/loginPic3.png" class="avatar" alt="">
- <text class="creatorName">{{creatorName}}</text>
- </view>
- <view class="secondLine">
- <view class="secondLine-block1">
- <view class="Star"></view>
- <view class="CollectionAuth">收藏作者</view>
- </view>
- <view class="secondLine-block2"><text>联系作者</text></view>
- </view>
- <view class="detailBack" @click="detailBack()"><text>返回</text></view>
- </view>
- <view class="detail-block">
- <view class="DefaultDisplayImg-block">
- <!-- <image :src="imageUrl" mode="widthFix"></image> -->
- <img :src="imageUrl" mode="widthFix"></img>
- </view>
- <view class="Label-block">
- <text>作品名称:{{ItemName}}</text>
- <text>上传时间:{{uploadTime}}</text>
- <text @click="dowload()">下载</text>
- <!-- <text>学生互评</text> -->
- </view>
- </view>
- </view>
-
- <view class="more" v-if="bShow[2]">
- <view class="ListBack" @click="detailBack()"><text>返回</text></view>
- <view class="detail_image_block" v-for="(item,index) in detailArr" :key="index">
- <img :src="item.Texture_Url" class="detail_image" @click="viewDetail0(index)" :style="{left:`${index%3*400}rpx`,top:`${parseInt(index/3)*400+100}rpx`}" v-if="bShowImg[0]"></img>
- <img :src="item.Texture_Url" class="detail_image" @click="viewDetail1(index)" :style="{left:`${index%3*400}rpx`,top:`${parseInt(index/3)*400+100}rpx`}" v-if="bShowImg[1]"></img>
- <img :src="item.Texture_Url" class="detail_image" @click="viewDetail2(index)" :style="{left:`${index%3*400}rpx`,top:`${parseInt(index/3)*400+100}rpx`}" v-if="bShowImg[2]"></img>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: "simulationLibrary",
-
- data() {
- return {
- array: ['项目类型'],
- index: 0,
- // url: '/assets/home/homeBG.jpg',
- // imageUrl:require('../../assets/home/simulationLibrary/DefaultDisplayImg.png'),
- imageUrl:'',
- fbx_url:'',
- allContentArr:[],
- itemArr:[],
- charactorArr:[],
- sceneArr:[],
- bShow: [
- true, //normal
- false, //detail
- false, //more
- ],
- bShowImg:[
- false, //normal
- false, //detail
- false, //more
- ],
- detailArr:[],
- creatorName:"姓名",
- ItemName:'物品名',
- uploadTime:'上传时间',
-
- }
- },
- methods: {
-
- init() {
- //临时
- this.allContentArr.length = 0;
- this.itemArr.length = 0;
- this.charactorArr.length = 0;
- this.sceneArr.length = 0;
- uni.request({
- url: mydata_api + "/item/getitemlist",
- data: {
- "BeginNum" : 0, //第一个
- "EndNum" : 3, //最后一个
- "UserID": mydata_userInfo.UserID,
- "ItemType":"" //道具 角色 场景 空为全部
- },
- method: "POST",
- dataType: "json",
- success: res => {
- // console.log('res111111111=',res)
- this.allContentArr = res.data.Items;
- // let items = res.data.Items;
- console.log('全部=',res.data.Items)
- }
- })
- //道具
- uni.request({
- url: mydata_api + "/item/getitemlist",
- data: {
- "BeginNum" : 0, //第一个
- "EndNum" : 5, //最后一个
- "UserID": mydata_userInfo.UserID,
- "ItemType":"道具" //道具 角色 场景 空为全部
- },
- method: "POST",
- dataType: "json",
- success: res => {
-
- this.itemArr = res.data.Items;
- // let items = res.data.Items;
- // console.log('道具=',items)
- }
- })
-
- //角色
- uni.request({
- url: mydata_api + "/item/getitemlist",
- data: {
- "BeginNum" : 0, //第一个
- "EndNum" : 5, //最后一个
- "UserID": mydata_userInfo.UserID,
- "ItemType":"角色" //道具 角色 场景 空为全部
- },
- method: "POST",
- dataType: "json",
- success: res => {
- this.charactorArr = res.data.Items;
-
- // let items = res.data.Items;
- // console.log('角色=',items)
- }
- })
-
- //场景
- uni.request({
- url: mydata_api + "/item/getitemlist",
- data: {
- "BeginNum" : 0, //第一个
- "EndNum" : 5, //最后一个
- "UserID": mydata_userInfo.UserID,
- "ItemType":"场景" //道具 角色 场景 空为全部
- },
- method: "POST",
- dataType: "json",
- success: res => {
-
- this.sceneArr = res.data.Items;
- }
- })
- },
- // previewImage(url){
- // uni.downloadFile({
- // url:url,
- // success: (res) => {
- // if (res.statusCode === 200) {
- // uni.openDocument({
- // filePath: res.tempFilePath,
- // // 如果文件名包含中文,建议使用escape(res.tempFilePath)转码,防止ios和安卓客户端导致的差异
- // success: function(res) {
- // console.log('打开文档成功');
- // }
- // });
- // }
- // },
- // });
- // },
- viewDetail(e) {
- let index = parseInt(e);
- let aItem = this.allContentArr[index];
- console.log('aItem=',aItem)
- if(aItem)
- {
- this.imageUrl = aItem.Texture_Url;
-
- this.bShow = [
- false, //normal
- true, //detail
- false, //more
- ]
-
- this.creatorName = aItem.CreateUserName;
- this.ItemName = aItem.Name;
- this.uploadTime = aItem.UploadTime;
- this.fbx_url = aItem.Fbx_Url;
- }
- },
- viewDetail0(e) {
- let index = parseInt(e);
-
- let aItem = this.charactorArr[index];
- if(aItem)
- {
- this.imageUrl = aItem.Texture_Url;
-
- this.bShow = [
- false, //normal
- true, //detail
- false, //more
- ]
- this.creatorName=aItem.CreateUserName;
- this.ItemName = aItem.Name;
- this.uploadTime = aItem.UploadTime;
- this.fbx_url = aItem.Fbx_Url;
- }
- },
- viewDetail1(e) {
- let index = parseInt(e);
- let aItem = this.sceneArr[index];
- if(aItem)
- {
- this.imageUrl = aItem.Texture_Url;
-
- this.bShow = [
- false, //normal
- true, //detail
- false, //more
- ]
- this.creatorName=aItem.CreateUserName;
- this.ItemName = aItem.Name;
- this.uploadTime = aItem.UploadTime;
- this.fbx_url = aItem.Fbx_Url;
- }
- },
- viewDetail2(e) {
- let index = parseInt(e);
- let aItem = this.itemArr[index];
-
- if(aItem)
- {
- this.imageUrl = aItem.Texture_Url;
-
- this.bShow = [
- false, //normal
- true, //detail
- false, //more
- ]
-
- this.creatorName=aItem.CreateUserName;
- this.ItemName = aItem.Name;
- this.uploadTime = aItem.UploadTime;
- this.fbx_url = aItem.Fbx_Url;
- }
- },
- more0(){
-
- this.bShow = [
- false, //normal
- false, //detail
- true, //more
- ]
-
- this.bShowImg = [
- true, //normal
- false, //detail
- false, //more
- ]
- this.detailArr=this.charactorArr;//.itemArr;
- },
- more1(){
-
- this.bShow = [
- false, //normal
- false, //detail
- true, //more
- ]
-
- this.bShowImg = [
- false, //normal
- true, //detail
- false, //more
- ]
-
- this.detailArr=this.sceneArr;//charactorArr;
-
- },
- more2(){
- this.bShow = [
- false, //normal
- false, //detail
- true, //more
- ]
-
- this.bShowImg = [
- false, //normal
- false, //detail
- true, //more
- ]
-
- this.detailArr=this.itemArr;
-
- console.log('this.detailArr=',this.detailArr);
- },
- detailBack(){
- this.bShow = [
- true, //normal
- false, //detail
- false, //more
- ]
- },
- dowload() {
- window.location.href = this.fbx_url;
- }
- // preview(e) {
- // let index = parseInt(e);
- // console.log('index=',typeof(index),'=',index);
-
- // if(this.allContentArr[index])
- // {
- // // console.log('this.allContentArr[index]=',this.allContentArr[index]);
- // console.log('src=',this.allContentArr[index].src);
- // this.previewImage(this.allContentArr[index].src);
- // }
- // },
- // dowload(e) {
- // let index = parseInt(e);
- // console.log('index=',typeof(index),'=',index);
-
- // if(this.allContentArr[index])
- // {
- // console.log('fbx=',this.allContentArr[index].fbx);
- // window.location.href = this.allContentArr[index].fbx;
- // }
-
- // },
- }
- }
- </script>
- <style scoped>
- .s_container {
- width: 100%;
- height: 100%;
-
- display: flex;
- justify-content: center;
- align-items:center;
- flex-direction: column;
-
- background-color: #fff;
- }
-
- .s_content_container {
- width: 96%;
- height: 96%;
-
- display: flex;
- justify-content: center;
- align-items:center;
- flex-direction: column;
-
- border-bottom: 3rpx solid #D7D7D7;
- }
-
- .s_search {
- width: 100%;
- height: 3%;
-
- margin-top: 3%;
-
- display: flex;
- justify-content: space-between;
- align-items:center;
- flex-direction: row;
- }
-
- .s_search_img_logo{
- height: 100%;
- margin-right: 1%;
- }
-
- .s_search_input {
- width: 100%;
- height: 100%;
- border-radius: 10rpx;
- font-size: 20rpx;
- border: 2rpx solid #DDDDDD;
- }
-
- .s_btn_search {
- width: 130rpx;
- height: 100%;
- line-height: 80rpx;
- margin-left: 1%;
- }
-
- .content{
- width: 100%;
- height: 100%;
-
- display: flex;
- justify-content: center;
- align-items:center;
- flex-direction: column;
-
- margin-top: 1%;
- margin-bottom: 1%;
- }
-
- .top-dispaly-block {
- width: 100%;
- height: 30%;
-
- display: flex;
- justify-content: space-between;
- align-items:center;
- flex-direction: row;
- border-bottom: 3rpx solid #D7D7D7;
- }
-
- .top_content {
- width: 30%;
- height: 90%;
-
- display: flex;
- justify-content: center;
- align-items:center;
-
- margin-right: 1%;
- }
-
- .top_image{
- width: 100%;
- height: 100%;
- }
-
- .s_content_block {
- width: 100%;
- height: 20%;
- margin-bottom: 3%;
-
- display: flex;
- justify-content: center;
- align-items:center;
- flex-direction: column;
-
- /* border: 1rpx solid #ff0000; */
- }
-
- .s_img_title {
- width: 100%;
-
- font-size: 36rpx;
- line-height: 200rpx;
- font-weight: bold;
-
- display: flex;
- justify-content: left;
- align-items:center;
- flex-direction: row;
- }
-
- .s_img_image_block {
-
- width: 100%;
- height: 100%;
-
- display: flex;
- justify-content: space-around;
- align-items:center;
- flex-direction: row;
- }
-
- .s_img_content {
- width: 100%;
-
- display: flex;
- justify-content: left;
- align-items:center;
- flex-direction: row;
- }
-
- .s_image_block{
- margin-right: 1%;
- /* border: 1rpx solid #ff0000; */
- }
-
- .s_image {
- width: 350rpx;
- height: 350rpx;
- /* border: 1rpx solid #ff0000; */
- }
-
- .v-left {
- width: 25rpx;
- height: 50rpx;
- }
-
- .detail{
- position: absolute;
- width: 100%;
- height: 100%;
- background-color: #FFFFFF;
-
- display: flex;
- justify-content: space-between;
- align-items:center;
- flex-direction: row;
-
- /* border: 1rpx solid #ff0000; */
- }
- .detailBack{
- width: 100%;
- height: 3%;
-
- display: flex;
- justify-content: center;
- align-items:center;
-
- margin-top:60%;
-
- /* border: 1rpx solid #000000; */
- }
-
- .detailBack text{
- width: 30%;
- height: 100%;
-
- display: flex;
- justify-content: center;
- align-items:center;
- border: 1rpx solid #000000;
- }
-
- .creator-info-block{
- width: 30%;
- height: 100%;
- /* border: 1rpx solid #ff0000; */
- }
-
- .firstLine{
- height: 8%;
- margin-left: 10%;
- margin-top: 30%;
-
- display: flex;
- justify-content: flex-start;
- align-items:center;
- flex-direction: row;
-
- /* border: 1rpx solid #ff0000; */
- }
- .avatar{
-
- }
- .creatorName{
- font-size: 50rpx;
- color: #A27452;
- margin-left: 5%;
-
- /* border: 1rpx solid #ff0000; */
- }
-
- .secondLine{
- height: 4%;
- margin-left: 10%;
- margin-top: 10%;
-
- display: flex;
- justify-content: space-between;
- align-items:center;
- flex-direction: row;
-
- /* border: 1rpx solid #ff0000; */
- }
-
- .secondLine-block1{
- background-image:url( "../../assets/home/simulationLibrary/Bg.png");
- background-size: 90% 90%;
- background-repeat: no-repeat;
-
- width:48%;
- height: 100%;
-
- display: flex;
- justify-content: space-between;
- align-items:center;
- flex-direction: row;
-
- /* border: 1rpx solid #000000; */
- }
-
- .Star{
- background-image:url( "../../assets/home/simulationLibrary/Start.png");
- background-size: 99% 99%;
- background-repeat: no-repeat;
-
- display: flex;
- justify-content: center;
- align-items:center;
-
- width:10%;
- height: 50%;
-
- margin-left: 10%;
- margin-bottom: 2%;
- /* border: 1rpx solid #000000; */
- }
-
- .CollectionAuth{
- color: #000000;
- font-size: 30rpx;
-
- width:80%;
- height: 80%;
-
-
- display: flex;
- justify-content: center;
- align-items:center;
-
- margin-right: 1%;
- margin-bottom: 2%;
- /* border: 1rpx solid #000000; */
- }
-
- .secondLine-block2{
- background-image:url( "../../assets/home/simulationLibrary/Block2.png");
- background-size: 90% 90%;
- background-repeat: no-repeat;
-
- width:48%;
- height: 100%;
-
- display: flex;
- justify-content: center;
- align-items:center;
-
- color: #000000;
- font-size: 30rpx;
- /* border: 1rpx solid #000000; */
- }
-
- .secondLine-block2 text{
- margin-right: 10%;
- margin-bottom: 1%;
- color: #000000;
- font-size: 30rpx;
- /* border: 1rpx solid #000000; */
- }
-
-
- .detail-block{
- width: 70%;
- height: 100%;
-
- display: flex;
- justify-content: center;
- align-items:center;
- flex-direction: column;
-
- border: 1rpx solid #000000;
- }
-
- .DefaultDisplayImg-block{
- width: 90%;
- height: 100%;
-
- display: flex;
- justify-content: center;
- align-items:center;
-
- margin-top: 20%;
- margin-bottom: 5%;
- /* border: 1rpx solid #ff0000; */
- }
-
- .DefaultDisplayImg-block image{
- width: 100%;
- /* height: 80%; */
- }
-
- .Label-block{
- width:70%;
- height:10%;
-
- display: flex;
- justify-content: space-between;
- align-items:center;
- flex-direction: row;
-
- margin-bottom: 10%;
-
- /* border: 1rpx solid #ff0000; */
- }
-
- .more{
- position: absolute;
- width: 80%;
- height: 80%;
- /* background-color: #000000; */
- /* background-color: #FFFFFF; */
-
- /* display: flex;
- justify-content: space-between;
- align-items:center;
- flex-direction: column; */
-
- /* border: 1rpx solid #ff0000; */
- }
-
- .detail_image_block{
-
- width:30%;
- /* height:90%; */
-
- /* display: flex;
- justify-content: space-between;
- align-items:center;
- flex-direction: row; */
-
- /* border: 1rpx solid #ff0000; */
- }
-
- .detail_image{
- position: absolute;
- width: 350rpx;
- height: 350rpx;
- }
- .ListBack{
- width: 5%;
- height: 3%;
-
- display: flex;
- justify-content: center;
- align-items:center;
-
- margin-bottom: 5%;
- border: 1rpx solid #000000;
- }
- </style>
|