| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579 |
- <template>
- <view class="s_container">
- <image src="../../assets/test/4.png" class="s_logo" mode=""></image>
- <view class="s_content_container">
- <view class="s_search" style="">
- <view class="" style="position: relative;width: 100%;">
- <img src="../../assets/home/search.png" class="s_search_img_input" alt="">
- <input type="text" value="" class="s_search_input" style="width: 96%;" placeholder="请输入搜索内容" />
- </view>
- <button type="warn" size="mini" class="s_btn_search">搜索</button>
- </view>
- <view class="s_search_condition">
- <view class="uni-list">
- <view class="uni-list-cell">
- <view class="uni-list-cell-db">
- <picker @change="bindPickerChange" :value="index" :range="array">
- <view class="uni-input">{{array[index]}}</view>
- </picker>
- </view>
- </view>
- </view>
- <view class="uni-list">
- <view class="uni-list-cell">
- <view class="uni-list-cell-db">
- <picker @change="bindPickerChange" :value="index" :range="array">
- <view class="uni-input">{{array[index]}}</view>
- </picker>
- </view>
- </view>
- </view>
- <view class="uni-list">
- <view class="uni-list-cell">
- <view class="uni-list-cell-db">
- <picker @change="bindPickerChange" :value="index" :range="array">
- <view class="uni-input">{{array[index]}}</view>
- </picker>
- </view>
- </view>
- </view>
- <view class="uni-list">
- <view class="uni-list-cell">
- <view class="uni-list-cell-db">
- <picker @change="bindPickerChange" :value="index" :range="array">
- <view class="uni-input">{{array[index]}}</view>
- </picker>
- </view>
- </view>
- </view>
- <view class="uni-list">
- <view class="uni-list-cell">
- <view class="uni-list-cell-db">
- <picker @change="bindPickerChange" :value="index" :range="array">
- <view class="uni-input">{{array[index]}}</view>
- </picker>
- </view>
- </view>
- </view>
- <view class="uni-list">
- <view class="uni-list-cell">
- <view class="uni-list-cell-db">
- <picker @change="bindPickerChange" :value="index" :range="array">
- <view class="uni-input">{{array[index]}}</view>
- </picker>
- </view>
- </view>
- </view>
- </view>
- <view class="s_search_img">
- <view class="s_img_left">
- <view class="s_top_img">
- <view class="s_top_content" v-for="(item,index) in allContentArr" :key="index">
- <!-- <img :src="item.src" class="s_top_image" mode=""></img>
- <view class="s_top_title">
- {{item.name}}
- </view> -->
- <img :src="item.src" class="s_image" mode="" @click="change(index)"></img>
- <view class="s_operation" v-show="index==act">
- <text>{{item.name}}</text>
- <view>
- <img src="../../assets/home/find.png" @click="preview(index)">
- <img src="../../assets/home/dowload.png" alt="" @click="dowload(index)">
- </view>
-
- </view>
- </view>
- </view>
- <view class="s_img s_img_1">
- <view class="s_img_title" v-text="'道具'"></view>
- <view class="s_img_image">
- <view class="s_img_content" v-for="(item,index) in itemArr" :key="index">
- <img :src="item.src" class="s_image" mode="" @click="change1(index)"></img>
- <view class="s_operation" v-show="index==act1">
- <text>{{item.name}}</text>
- <view>
- <img src="../../assets/home/find.png" alt="" @click="preview1(index)">
- <img src="../../assets/home/dowload.png" alt="" @click="dowload1(index)">
- </view>
- </view>
- </view>
- <img src="../../assets/home/left.png" class="v-left" alt="">
- </view>
- </view>
- <view class="s_img">
- <view class="s_img_title" v-text="'角色'"></view>
- <view class="s_img_image">
- <view class="s_img_content" v-for="(item,index) in charactorArr" :key="index">
- <img :src="item.src" class="s_image" mode="" @click="change2(index)"></img>
- <view class="s_operation" v-show="index==act2">
- <text>{{item.name}}</text>
- <view>
- <img src="../../assets/home/find.png" alt="" @click="preview2(index)">
- <img src="../../assets/home/dowload.png" alt="" @click="dowload2(index)">
- </view>
- </view>
- </view>
- <img src="../../assets/home/left.png" class="v-left" alt="">
- </view>
- </view>
- <view class="s_img">
- <view class="s_img_title" v-text="'场景'"></view>
- <view class="s_img_image">
- <view class="s_img_content" v-for="(item,index) in sceneArr" :key="index">
- <img :src="item.src" class="s_image" mode="" @click="change3(index)"></img>
- <view class="s_operation" v-show="index==act3">
- <text>{{item.name}}</text>
- <view>
- <img src="../../assets/home/find.png" alt="" @click="preview3(index)">
- <img src="../../assets/home/dowload.png" alt="" @click="dowload3(index)">
- </view>
-
- </view>
- </view>
- <img src="../../assets/home/left.png" class="v-left" alt="">
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="s_footer" style="text-align: center;padding: 80rpx;">
- </view>
- </view>
- </template>
- <script>
- export default {
- name: "simulationLibrary",
- data() {
- return {
- act: -1,
- act1: -1,
- act2: -1,
- act3: -1,
- array: ['项目类型'],
- index: 0,
- url: '/assets/home/homeBG.png',
- allContentArr:[],
- itemArr:[],
- charactorArr:[],
- sceneArr:[],
- }
- },
- methods: {
- init() {
- console.log('simulationLibrary=',mydata_userInfo.UserID)
- 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('res=',res)
- let items = res.data.Items;
- console.log('全部=',items)
-
- items.forEach(item=>{
- let data = {};
- data.src = item.Texture_Url;
- data.name = item.Name;
- data.fbx = item.Fbx_Url;
- this.allContentArr.push(data);
-
- });
- }
- })
- //道具
- uni.request({
- url: mydata_api + "/item/getitemlist",
- data: {
- "BeginNum" : 0, //第一个
- "EndNum" : 5, //最后一个
- "UserID": mydata_userInfo.UserID,
- "ItemType":"道具" //道具 角色 场景 空为全部
- },
- method: "POST",
- dataType: "json",
- success: res => {
- let items = res.data.Items;
- console.log('道具=',items)
-
- items.forEach(item=>{
- let data = {};
- data.src = item.Texture_Url;
- data.name = item.Name;
- data.fbx = item.Fbx_Url;
- this.itemArr.push(data);
- });
- }
- })
-
- //角色
- uni.request({
- url: mydata_api + "/item/getitemlist",
- data: {
- "BeginNum" : 0, //第一个
- "EndNum" : 5, //最后一个
- "UserID": mydata_userInfo.UserID,
- "ItemType":"角色" //道具 角色 场景 空为全部
- },
- method: "POST",
- dataType: "json",
- success: res => {
- let items = res.data.Items;
- console.log('角色=',items)
-
- items.forEach(item=>{
- let data = {};
- data.src = item.Texture_Url;
- data.name = item.Name;
- data.fbx = item.Fbx_Url;
- this.charactorArr.push(data);
- });
- }
- })
-
- //场景
- uni.request({
- url: mydata_api + "/item/getitemlist",
- data: {
- "BeginNum" : 0, //第一个
- "EndNum" : 5, //最后一个
- "UserID": mydata_userInfo.UserID,
- "ItemType":"场景" //道具 角色 场景 空为全部
- },
- method: "POST",
- dataType: "json",
- success: res => {
- let items = res.data.Items;
- console.log('场景=',items)
-
- items.forEach(item=>{
- let data = {};
- data.src = item.Texture_Url;
- data.name = item.Name;
- data.fbx = item.Fbx_Url;
- this.sceneArr.push(data);
- });
- }
- })
-
- },
- 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('打开文档成功');
- }
- });
- }
- },
- });
- },
- bindPickerChange(e) {
- this.index = e.target.value
- },
- change(e) {
- if (this.act == e) {
- this.act = -1;
- } else {
- this.act = e;
- }
-
- },
- change1(e) {
- if (this.act1 == e) {
- this.act1 = -1;
- } else {
- this.act1 = e;
- }
- },
- change2(e) {
- if (this.act2 == e) {
- this.act2 = -1;
- } else {
- this.act2 = e;
- }
- },
- change3(e) {
- if (this.act3 == e) {
- this.act3 = -1;
- } else {
- this.act3 = e;
- }
- },
- preview(e) {
- // allContentArr:[],
- // itemArr:[],
- // charactorArr:[],
- // sceneArr:[],
-
- // console.log('this.allContentArr=',this.allContentArr);
- // console.log('typeof(e)=',typeof(e),'=',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;
- }
-
- },
- preview1(e) {
-
- },
- dowload1(e) {
-
- },
- preview2(e) {
-
- },
- dowload2(e) {
-
- },
- preview3(e) {
-
- },
- dowload3(e) {
-
- }
- }
- }
- </script>
- <style scoped>
- .s_container {
- width: 100%;
- height: 100%;
- background-color: #fff;
- }
- .s_logo {
- width: 100%;
- height: 400rpx;
- }
- .m_btn_download {
- height: 80rpx;
- line-height: 80rpx;
- padding: 0 70rpx;
- background: #EA252C;
- color: #fff;
- font-family: MicrosoftYaHei;
- }
- .s_search {
- display: flex;
- justify-content: space-between;
- }
- .s_search_input {
- border: 2rpx solid #DDDDDD;
- width: 100%;
- height: 80rpx;
- line-height: 80rpx;
- padding: 0 60rpx;
- border-radius: 10rpx;
- font-size: 20rpx;
- }
- .s_content_container {
- padding: 40rpx 100rpx;
- }
- .s_btn_search {
- width: 130rpx;
- height: 80rpx;
- line-height: 80rpx;
- margin-left: 20rpx;
- }
- .s_search_condition {
- background-color: #F9F9F9;
- margin-top: 40rpx;
- height: 100rpx;
- width: 100%;
- }
- .m_select {
- width: 300rpx;
- line-height: 80rpx;
- }
- .uni-list-cell-db {
- width: 300rpx;
- // height: 100rpx;
- line-height: 100rpx;
- }
- .uni-selector-select .uni-picker-item.selected {
- color: red;
- }
- .uni-input {
- text-align: center;
- }
- .s_search_condition {
- display: flex;
- justify-items: start;
- }
- .uni-list {
- position: relative;
- }
- .uni-list::after {
- content: url(../../assets/learning/icon_ylrz_arrow.png);
- position: absolute;
- right: 0;
- top: 50%;
- transform: translateY(-50%);
- }
- .s_image_text {
- margin-left: 20rpx;
- }
- .s_top_img {
- display: flex;
- justify-content: space-between;
- padding-bottom: 80rpx;
- border-bottom: 3rpx solid #D7D7D7;
- }
- .s_top_content {
- margin-top: 40rpx;
- width: 30%;
- position: relative;
- }
- .s_top_image {
- width: 100%;
- }
- .s_top_title {
- color: #fff;
- position: absolute;
- bottom: 40rpx;
- font-size: 2.0rem;
- line-height: 100rpx;
- font-weight: 500;
- width: 100%;
- text-align: left;
- margin-left: 50rpx;
- }
- .s_img_title {
- font-size: 36rpx;
- line-height: 200rpx;
- font-weight: bold;
- }
- /* .s_top_image {
- width: 400rpx;
- } */
- .s_img_image {
- display: flex;
- position: relative;
- }
- /* .s_image {
- margin-right: 40rpx; */
- /* height: 550rpx; */
- /* } */
- .s_img_1 {
- padding-bottom: 80rpx;
- border-bottom: 3rpx solid #D7D7D7;
- }
- .s_img_left {
- padding-right: 130rpx;
- }
- .s_img_content {
- position: relative;
- padding: 10rpx;
- /* display: flex; */
- /* justify-content: left; */
- /* justify-items: center; */
- }
- .s_image {
- width: 100%;
- }
- /* @media sscreen (min-with:1050px) and (max-width: 1920px) and {
-
- } */
- .s_operation {
- /* position: absolute;
- bottom: -10rpx;
- left: 0;
- width: 100%; */
- margin-top: 30rpx;
- display: flex;
- justify-content: space-between;
- /* margin-right: 40rpx; */
- background-color: #dbd9d9;
- padding: 10rpx 20rpx;
- border-radius: 10rpx;
- }
- .s_operation img {
- margin-left: 20rpx;
- }
- .v-left {
- position: absolute;
- width: 25rpx;
- height: 50rpx;
- right: -100rpx;
- top: 50%;
- transform: translateY(-50%);
- }
- .s_search_img_input {
- position: absolute;
- left: 20rpx;
- top: 50%;
- width: 30rpx;
- transform: translateY(-50%);
- }
- </style>
|